PageSourceSearch

https://foundervillage.xyz/assets/old_.dashboard-tvhAb5e_.js

js foundervillage.xyz collected 2026-10-05 08:53:45 UTC 78,481 bytes, 1 lines download raw bytes

1import{e as $,r as n,j as e,X as Xa,B,D as O,u as Za,a as et,t as C,S as at,U as tt,V as rt,W as st,Y as nt,Z as lt,L as ge,$ as ot,a0 as it,a1 as dt}from"./index-PlZrRKaG.js";import{S as oa}from"./SiteShell-fvoHZ96F.js";import{r as H,l as ct,u as mt,a as ut,b as xt,s as ht}from"./crm.functions-Cy06XYQN.js";import{C as gt,R as bt,M as pt}from"./receipt-text-CI5zyh-M.js";import{C as ft}from"./chevron-right-DYDEjRCJ.js";import{S as oe}from"./shield-check-D1B-sRQo.js";import{L as jt}from"./log-out-Bhu4phrC.js";import{U as ia}from"./users-KUqg4MI7.js";import{M as Ee}from"./mail-th6DSeOj.js";import{C as xa}from"./chart-column-S5IefYRj.js";import{L as he}from"./loader-circle-DZtnW1Ow.js";import{S as yt}from"./search-DAol_qvG.js";import{C as ha}from"./calendar-days-BFqnaeea.js";import{W as ga}from"./wallet-DUoM7bBm.js";import{B as ba}from"./book-open-Cnr6mFv9.js";import{A as vt,C as Nt,X as wt,Y as kt,a as Ct}from"./AreaChart-Z-x60sFM.js";import{E as Ue}from"./external-link-Dl6WBfBo.js";import{M as St}from"./map-pin-BBnLoydT.js";import{B as pa}from"./building-2-W5pIqWNi.js";import{F as Mt}from"./file-text-hONeI1bl.js";import{D as At}from"./download-B9m2_59u.js";import{C as $t}from"./credit-card-BfazUx4Z.js";import{C as fa}from"./circle-check-D07pbR88.js";import{L as ja}from"./lock-keyhole-BVLI0_BZ.js";import"./logo-AprPGqdc.js";import"./logo-light-v9K0FGsF.js";import"./menu-DYwRXAml.js";import"./forms.functions-J2EPSXSH.js";import"./check-CH_56XJ5.js";import"./sparkles-0GsWtx9F.js";const Ft=[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 18V6",key:"zqpxq5"}]],Dt=$("badge-dollar-sign",Ft);const Lt=[["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M16 6V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2",key:"1ksdt3"}],["path",{d:"M22 13a18.15 18.15 0 0 1-20 0",key:"12hx5q"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],Pe=$("briefcase-business",Lt);const Rt=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]],Ie=$("chart-line",Rt);const Tt=[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]],ya=$("chart-pie",Tt);const Et=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Pt=$("gauge",Et);const _t=[["path",{d:"M11 15h2a2 2 0 1 0 0-4h-3c-.6 0-1.1.2-1.4.6L3 17",key:"geh8rc"}],["path",{d:"m7 21 1.6-1.4c.3-.4.8-.6 1.4-.6h4c1.1 0 2.1-.4 2.8-1.2l4.6-4.4a2 2 0 0 0-2.75-2.91l-4.2 3.9",key:"1fto5m"}],["path",{d:"m2 16 6 6",key:"1pfhp9"}],["circle",{cx:"16",cy:"9",r:"2.9",key:"1n0dlu"}],["circle",{cx:"6",cy:"5",r:"3",key:"151irh"}]],Ut=$("hand-coins",_t);const It=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],va=$("panel-left-close",It);const Bt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],Na=$("panel-left-open",Bt);const Ot=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],wa=$("phone",Ot);const Ht=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Kt=$("plus",Ht);const Vt=[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]],ka=$("rocket",Vt);const zt=[["path",{d:"M15 3v18",key:"14nvp0"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}
1],["path",{d:"M21 15H3",key:"9uk58r"}]],Ca=$("table-properties",zt);const Wt=[["path",{d:"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z",key:"16rjxf"}],["path",{d:"M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193",key:"178nd4"}],["circle",{cx:"10.5",cy:"6.5",r:".5",fill:"currentColor",key:"12ikhr"}]],qt=$("tags",Wt);const Gt=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],Yt=$("trending-up",Gt);const Qt=[["path",{d:"M2 21a8 8 0 0 1 13.292-6",key:"bjp14o"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"m16 19 2 2 4-4",key:"1b14m6"}]],Be=$("user-round-check",Qt);function Jt({images:a,startIndex:r=0,open:s,onClose:i}){const[o,m]=n.useState(r);n.useEffect(()=>{s&&m(r)},[s,r]);const j=n.useCallback(()=>m(x=>(x+1)%a.length),[a.length]),h=n.useCallback(()=>m(x=>(x-1+a.length)%a.length),[a.length]);if(n.useEffect(()=>{if(!s)return;const x=k=>{k.key==="Escape"?i():k.key==="ArrowRight"?j():k.key==="ArrowLeft"&&h()};window.addEventListener("keydown",x);const y=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{window.removeEventListener("keydown",x),document.body.style.overflow=y}},[s,j,h,i]),n.useEffect(()=>{if(!s||a.length<=1)return;[a[(o+1)%a.length],a[(o-1+a.length)%a.length]].forEach(y=>{const k=new Image;k.decoding="async",k.src=y.src})},[s,o,a]),!s||a.length===0)return null;const b=a[o];return e.jsxs("div",{className:"fixed inset-0 z-[120] flex items-center justify-center bg-background/92 backdrop-blur-md p-4 sm:p-10",onClick:i,role:"dialog","aria-modal":"true",children:[e.jsx("button",{type:"button",onClick:x=>{x.stopPropagation(),i()},"aria-label":"Close",className:"absolute right-4 top-4 sm:right-6 sm:top-6 inline-flex h-11 w-11 items-center justify-center rounded-full border border-border bg-background/70 text-foreground/85 backdrop-blur transition hover:border-primary/50 hover:text-primary",children:e.jsx(Xa,{className:"h-5 w-5"})}),a.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:x=>{x.stopPropagation(),h()},"aria-label":"Previous image",className:"absolute left-3 sm:left-6 top-1/2 -translate-y-1/2 inline-flex h-12 w-12 items-center justify-center rounded-full border border-border bg-background/70 text-foreground/85 backdrop-blur transition hover:border-primary/50 hover:text-primary",children:e.jsx(gt,{className:"h-6 w-6"})}),e.jsx("button",{type:"button",onClick:x=>{x.stopPropagation(),j()},"aria-label":"Next image",className:"absolute right-3 sm:right-6 top-1/2 -translate-y-1/2 inline-flex h-12 w-12 items-center justify-center rounded-full border border-border bg-background/70 text-foreground/85 backdrop-blur transition hover:border-primary/50 hover:text-primary",children:e.jsx(ft,{className:"h-6 w-6"})})]}),e.jsxs("figure",{className:"relative max-h-[88vh] max-w-[92vw] sm:max-w-[85vw]",onClick:x=>x.stopPropagation(),children:[e.jsx("img",{src:b.src,alt:b.alt??"",decoding:"async",fetchPriority:"high",className:"max-h-[88vh] max-w-full rounded-xl object-contain shadow-glow"}),a.length>1&&e.jsxs("figcaption",{className:"mt-3 text-center text-xs uppercase tracking-[0.22em] text-muted-foreground",children:[o+1," / ",a.length,b.alt?e.jsx("span",{className:"ml-3 normal-case tracking-normal",children:b.alt}):null]})]})]})}const da=["admin","investor","member"],ca=B({method:"GET"}).middleware([H]).handler(O("e4f613da354b95ded8ce2081279082f37e586523eb22e7ba9403d1ead85e95f2")),Xt=B({method:"POST"}).middleware([H]).handler(O("61d957dc8a9ca29ae1864cbe329d9dcb6826f2b811dfca130816e0e5d20dea4f")),Zt=B({method:"GET"}).middleware([H]).handler(O("9c36922af9ad4e1943caaa0042cc72996e9e2e3569daa9a960307bbe99ba8acf"));B({method:"POST"}).middleware([H]).handler(O("5759f8a9b1a25905dde98e80234c8083c1abbb008521e7ae4af0da496345f6c1"));B({method:"POST"}).middleware([H]).handler(O("3ff0b62292e66f9198fae74c34565a8a45b9f0d1a9f379acd15f0cf694eb48bb"));B({method:"POST"}).middleware([H]).handler(O("514b10b0aa0af1937c6a79e9ac3afc5fc327b925e1dba5441618fde1847abd96"));const er=B({method:"GET"}).middleware([H]).handler(O("f593a63e64f5960479ee593f23f82538b67409aa5c74e298fd58287b36d93213")),ar=B({method:"POST"}).middleware([H]).handler(O("d4630eb26a6bc93df9d04a599f1e8478f884371cdf8ae28faddfa0572c4a3a25")),G=[{key:"magic_island",label:"Magic Island",short:"Magic"},{key:"fh_membership",label:"FH Member",short:"FH"},{key:"fv_bizdev",label:"FV BizDev",short:"BizDev"},{key:"founder_desk",label:"Founder Desk",short:"Desk"},{key:"fv_token",label:"FV Token",short:"Token"}],I=["cold","potential","warm","contacted","negotiation","closed"],E={cold:{label:"Cold",badge:"border-sky-500/30 bg-sky-500/12 text-sky-300",dot:"bg-sky-4
100",bar:"from-sky-500/70 to-sky-400/40"},potential:{label:"Potential",badge:"border-cyan-500/30 bg-cyan-500/12 text-cyan-300",dot:"bg-cyan-400",bar:"from-cyan-500/75 to-cyan-400/45"},warm:{label:"Warm",badge:"border-amber-500/30 bg-amber-500/12 text-amber-300",dot:"bg-amber-400",bar:"from-amber-500/80 to-amber-400/50"},contacted:{label:"Contacted",badge:"border-violet-500/30 bg-violet-500/12 text-violet-300",dot:"bg-violet-400",bar:"from-violet-500/80 to-violet-400/50"},negotiation:{label:"Negotiation",badge:"border-fuchsia-500/30 bg-fuchsia-500/12 text-fuchsia-300",dot:"bg-fuchsia-400",bar:"from-fuchsia-500/80 to-fuchsia-400/50"},closed:{label:"Closed",badge:"border-emerald-500/30 bg-emerald-500/12 text-emerald-300",dot:"bg-emerald-400",bar:"from-emerald-500/85 to-emerald-400/60"}},Oe="dev-founder-village-member",tr="Magic Island",De=()=>({name:"",email:"",phone:"",preferredLanguage:"",funnelStage:"cold",notes:""}),rr=new Intl.NumberFormat("en-US"),sr=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}),f=a=>rr.format(a),Le=(a,r)=>r>0?Math.round(a/r*100):0;function nr(a){const r={},s={};let i=null;for(const o of a)r[o.status]=(r[o.status]??0)+1,s[o.source]=(s[o.source]??0)+1,o.updatedAt&&(!i||o.updatedAt>i)&&(i=o.updatedAt);return{total:a.length,withEmail:a.filter(o=>o.email).length,withPhone:a.filter(o=>o.phone).length,withCompany:a.filter(o=>o.company).length,withCategories:a.filter(o=>o.categories.length).length,byStatus:r,bySource:s,lastUpdatedAt:i}}const He=[{slug:"founder-haus",name:"Founder Haus Jurere",category:"Beach Club",image:"/buildings/founder-haus-watercolor.png",fallbackImage:"/buildings/01-founder-haus.png",tokenPrice:"$12,500",tokenPriceCents:125e4,available:"240 public tokens",holdings:"7,200 FVT",revenue:"$41.2K",occupancy:"72%",performance:72,metrics:["4 suites live","18 founder stays","$128 ADR"]},{slug:"founder-desk",name:"Founder Desk",category:"Workspace membership",image:"/buildings/02-founder-desk.png",fallbackImage:"/buildings/02-founder-desk.png",tokenPrice:"$8.50",tokenPriceCents:850,available:"62,100 FVT",holdings:"3,100 FVT",revenue:"$24.8K",occupancy:"81%",performance:81,metrics:["34 active desks","11 company teams","92% retention"]},{slug:"founder-cafe",name:"Founder Cafe",category:"Community revenue",image:"/buildings/04-founder-cafe.png",fallbackImage:"/buildings/04-founder-cafe.png",tokenPrice:"$5.20",tokenPriceCents:520,available:"88,000 FVT",holdings:"2,200 FVT",revenue:"$16.6K",occupancy:"64%",performance:64,metrics:["1,840 orders","42% member sales","3 pop-ups"]},{slug:"founder-farm",name:"Founder Farm",category:"Regenerative supply",image:"/buildings/05-founder-farm-2.png",fallbackImage:"/buildings/05-founder-farm.png",tokenPrice:"$6.40",tokenPriceCents:640,available:"54,000 FVT",holdings:"1,600 FVT",revenue:"$9.8K",occupancy:"41%",performance:41,metrics:["Cafe supply pilot","Member boxes planned","Local surplus sales"]},{slug:"aia",name:"AIA",category:"AI Accelerator",image:"/buildings/06-aia-2.png",fallbackImage:"/buildings/06-aia.png",tokenPrice:"$10.00",tokenPriceCents:1e3,available:"40,000 FVT",holdings:"900 FVT",revenue:"$12.1K",occupancy:"58%",performance:58,metrics:["Pilot cohort scoped","Operator mentors","Demo day revenue"]}];function Sa(a){const r=a.currentTarget,s=r.dataset.fallback;!s||r.dataset.fallbackApplied==="true"||(r.dataset.fallbackApplied="true",r.src=s)}const lr=[{value:"dashboard",label:"Dashboard",icon:ga},{value:"assets",label:"Assets",icon:pa},{value:"financials",label:"Financials",icon:Ca},{value:"updates",label:"Updates",icon:Ie},{value:"roadmap",label:"Roadmap",icon:ka}],Ma=[{value:"dashboard",label:"Dashboard",icon:Pt},{value:"waitlist",label:"Waitlist",icon:Be},{value:"people",label:"CRM",icon:Pe},{value:"funnel",label:"Funnel",icon:xa},{value:"team",label:"Team",icon:oe}],or=[{name:"Paloma",email:"[email protected]",focus:"Community and member experience",expectedRole:"admin"},{name:"George",email:"[email protected]",focus:"Partnerships and revenue",expectedRole:"admin"},{name:"Founder Haus Host",email:"[email protected]",focus:"House operations and hospital
1ity",expectedRole:"admin"},{name:"Eric",email:"[email protected]",focus:"Product and operations",expectedRole:"admin"},{name:"Iggy Noronha",email:"[email protected]",focus:"Founder and platform owner",expectedRole:"admin"},{name:"Founder Haus Admin",email:"[email protected]",focus:"Admin operations",expectedRole:"admin"}],ir=[{label:"Gross revenue YTD",value:"$719.2K",detail:"Placeholder accrual view"},{label:"Net revenue YTD",value:"$631.1K",detail:"After fees and taxes"},{label:"EBITDA YTD",value:"$267.4K",detail:"37.2% margin"},{label:"Net income YTD",value:"$212.2K",detail:"29.5% margin"}],dr=[{label:"Talent",value:50,amount:"$290K"},{label:"Growth",value:30,amount:"$174K"},{label:"Product",value:10,amount:"$58K"},{label:"Infrastructure",value:10,amount:"$58K"}],cr=[{holder:"Founder",ownership:"55%",notes:"Placeholder founder common"},{holder:"Co-founders",ownership:"35%",notes:"Operating team allocation"},{holder:"C-levels & heads",ownership:"6.2%",notes:"Advisor/team grants"},{holder:"Advisors",ownership:"2.8%",notes:"Strategic advisors"},{holder:"SOP / options pool",ownership:"1%",notes:"Future hiring pool"}],mr=[{month:"April 2026",tcv:"$174.3K",clients:"17",active:"145",churn:"4"},{month:"March 2026",tcv:"$201.1K",clients:"19",active:"132",churn:"5"},{month:"February 2026",tcv:"$148.1K",clients:"13",active:"118",churn:"6"},{month:"January 2026",tcv:"$196.1K",clients:"16",active:"111",churn:"7"},{month:"December 2025",tcv:"$66.7K",clients:"14",active:"102",churn:"10"},{month:"November 2025",tcv:"$109.9K",clients:"21",active:"98",churn:"12"}],ur=[{date:"2023",title:"Founder Village foundation",body:"Initial thesis: build community-owned infrastructure for healthy founders in Florianopolis."},{date:"2024",title:"Founder Haus and local network",body:"Community programming, founder stays, local operations, and first asset underwriting."},{date:"Q2 2026",title:"Founding member dashboard",body:"Holdings, asset pages, founding member updates, and the Founder Haus deal room."},{date:"Q3 2026",title:"Allocation and reporting",body:"Connect CRM, token allocations, monthly memos, data exports, and financial reporting."},{date:"2027",title:"Multi-asset expansion",body:"Scale from Founder Haus into desk, cafe, wellness, farm, and event revenue streams."}],xr=[{area:"CEO / Finance",kpi:"Runway >= 12 months",deliverable:"Monthly P&L and founding member pipeline"},{area:"Growth",kpi:"SQLs/month and CAC payback",deliverable:"Founder demand and capital partner funnel"},{area:"Operations",kpi:"Asset uptime >= 99%",deliverable:"Hospitality, maintenance, and member experience"},{area:"Product",kpi:"Critical bugs = 0",deliverable:"Dashboard, asset deal room, reporting"},{area:"Community",kpi:"NPS >= 70",deliverable:"Events, onboarding, founder rituals, retention"}];function ms(){const{user:a,session:r,loading:s,signOut:i}=Za(),o=et(),[m,j]=n.useState("investor"),[h,b]=n.useState(null),[x,y]=n.useState(!0),[k,N]=n.useState("90d"),[M,F]=n.useState("dashboard"),[g,v]=n.useState("dashboard"),[T,Q]=n.useState(He[0]);n.useEffect(()=>{!s&&!a&&o({to:"/old/login"})},[s,a,o]),n.useEffect(()=>{let P=!1;async function K(){if(!a)return;if(a.id===Oe){P||(b("admin"),j("admin"),y(!1));return}y(!0);const W=r?.access.role==="admin"?"admin":"member";if(b(W),W==="member"){y(!1),await i(),window.location.href="/old/login?waitlist=pending";return}j(W==="admin"?"admin":"investor"),y(!1)}return K(),()=>{P=!0}},[r?.access.role,i,a]);const be=n.useMemo(()=>(a?.email?.split("@")[0]??"member").split(/[._-]/).filter(Boolean).map(K=>K.charAt(0).toUpperCase()+K.slice(1)).join(" "),[a?.email]),ie=n.useMemo(()=>[],[]);return s||!a||x?e.jsx(oa,{children:e.jsx("div",{className:"container-x pt-40 text-sm text-muted-foreground",children:"Loading dashboard..."})}):e.jsx(oa,{navItems:ie,children:e.jsxs("div",{className:"min-h-screen overflow-x-hidden bg-background pt-24 md:pt-28",children:[e.jsx("section",{className:"border-b border-border bg-surface/35",children:e.jsx("div",{className:"container-x py-8 md:py-10",children:e.jsxs("div",{className:"flex flex-col gap-6 lg:flex-row lg:items-end lg:justify-between",children:[e.jsxs("div",{className:"max-w-3xl",children:[e.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2 text-xs font-semibold uppercase tracking-[0.24em] text-primary",children:[e.jsx(oe,{className:"h-4 w-4"}),"Members dashboard"]}),e.jsxs("h1",{className:"font-display text-5xl leading-none md:text-7xl",children:["Welcome, ",be]}),e.jsx("p",{className:"mt-4 max-w-2xl text-sm leading-6 text-muted-foreground md:text-base",children:"Track Founder Village capital, holdings, asset performance, product allocations, and founding member communications from one focused workspace."})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[h==="admin"&&e.jsx(le,{label:"Role",value:m,options:[{value:"admin",label:"Admin"},{value:"investor",label:"Founding member"}],onChange:j}),e.jsxs("button",{onClick:()=>{i(),o({to:"/old"})},className:"inline-flex h-10 items-center gap-2 rounded-lg border border-border px-4 text-sm text-foreground
1/80 transition hover:bg-surface hover:text-primary",children:[e.jsx(jt,{className:"h-4 w-4"}),"Sign out"]})]})]})})}),m==="admin"?e.jsx(hr,{session:r,activePage:M,onPageChange:F}):e.jsx(fr,{session:r,activePage:g,onPageChange:v,selectedProduct:T,setSelectedProduct:Q})]})})}function hr({session:a,activePage:r,onPageChange:s}){const[i,o]=n.useState(""),[m,j]=n.useState("all"),[h,b]=n.useState("all"),[x,y]=n.useState("all"),[k,N]=n.useState(G[0].key),[M,F]=n.useState(null),[g,v]=n.useState([]),[T,Q]=n.useState(null),[be,ie]=n.useState(!1),[P,K]=n.useState(!1),[W,_]=n.useState(null),[Ra,pe]=n.useState(!1),[U,fe]=n.useState(()=>De()),[de,Ke]=n.useState(!1),[J,ce]=n.useState([]),[X,Ta]=n.useState("all"),[je,me]=n.useState(!1),[ye,Z]=n.useState(null),[Ve,ze]=n.useState(null),[ve,Ne]=n.useState([]),[we,We]=n.useState(!1),[ke,Ce]=n.useState(null),[qe,Ge]=n.useState(null),[L,Ye]=n.useState("updated"),[V,Se]=n.useState("desc"),[Qe,Ea]=n.useState(!1),[Pa,_a]=n.useState(()=>Date.now());n.useEffect(()=>{const t=setInterval(()=>_a(Date.now()),3e4);return()=>clearInterval(t)},[]);const p=n.useMemo(()=>a?{}:null,[a]),D=!!(p&&a?.user.id!==Oe),Me=n.useCallback(async()=>{if(!D||!p){v([]),Q(null),_("Sign in as a real admin to load live Luma CRM data.");return}ie(!0),_(null);try{const t=await ct({headers:p}),l=Array.isArray(t.people)?t.people:[];v(l),Q(t.lastSync),l.length===0&&_("Live Luma CRM is empty. It will populate on the next automatic sync.")}catch(t){v([]),Q(null),_(t instanceof Error?t.message:"Could not load the live CRM table.")}finally{ie(!1)}},[p,D]);n.useEffect(()=>{Me()},[Me]);const Ae=n.useCallback(async()=>{if(!D||!p){ce([]),Z("Sign in as a real admin to load backend users.");return}me(!0),Z(null);try{const t=await ca({headers:p});ce(Array.isArray(t)?t:[])}catch(t){const l=t instanceof Error?t.message:"Could not load backend users. Confirm this account has the admin role.";Z(l)}finally{me(!1)}},[p,D]);n.useEffect(()=>{Ae()},[Ae]);const ue=n.useCallback(async()=>{if(!D||!p){Ne([]),Ce("Sign in as a real admin to load the dashboard waitlist.");return}We(!0),Ce(null);try{const t=await er({headers:p});Ne(Array.isArray(t)?t:[])}catch(t){Ce(t instanceof Error?t.message:"Could not load dashboard waitlist.")}finally{We(!1)}},[p,D]);n.useEffect(()=>{ue()},[ue]);const Je=async(t,l)=>{if(!D||!p){C.error("Sign in as a real admin to update roles.");return}ze(t);try{await Xt({data:{userId:t,role:l},headers:p}),ce(d=>Array.isArray(d)?d.map(c=>c.id===t?{...c,role:l}:c):[]),l==="investor"&&await ue(),C.success("User role updated.")}catch(d){C.error(d instanceof Error?d.message:"Could not update user role.")}finally{ze(null)}},Ua=async t=>{if(!D||!p){C.error("Sign in as a real admin to approve waitlist users.");return}Ge(t);try{const l=await ar({data:{userId:t},headers:p});Ne(d=>d.map(c=>c.userId===t?l.waitlist:c)),await Ae(),C.success("User approved as founding member.")}catch(l){C.error(l instanceof Error?l.message:"Could not approve waitlist user.")}finally{Ge(null)}},Ia=async()=>{if(!D||!p){C.error("Sign in as a real admin to sync Luma CRM data.");return}K(!0),_(null);try{const t=await ht({data:{maxEvents:12},headers:p});await Me(),C.success(`Luma synced ${f(t.peopleUpserted)} people across ${f(t.eventsSynced)} events.`)}catch(t){const l=t instanceof Error?t.message:"Could not sync Luma CRM data.";_(l),C.error(l)}finally{K(!1)}},Xe=t=>{pe(t),!t&&!de&&fe(De())},q=(t,l)=>{fe(d=>({...d,[t]:l}))},Ba=async t=>{if(t.preventDefault(),!D||!p){C.error("Sign in as a real admin to add CRM leads.");return}Ke(!0),_(null);try{const l=await xt({data:U,headers:p});v(d=>[l,...d.filter(c=>c.id!==l.id)]),Ye("updated"),Se("desc"),fe(De()),pe(!1),C.success("Lead added to CRM.")}catch(l){const d=l instanceof Error?l.message:"Could not add CRM lead.";_(d),C.error(d)}finally{Ke(!1)}},R=g,A=n.useMemo(()=>nr(R),[R]),$e=i.trim().toLowerCase(),Fe=n.useMemo(()=>{const t=new Set([tr]);for(const l of R)for(const d of l.categories)d.trim()&&t.add(d);return[...t].sort((l,d)=>l.localeCompare(d))},[R]);n.useEffect(()=>{h!=="all"&&!Fe.includes(h)&&b("all")},[h,Fe]);const Ze=n.useMemo(()=>{const t=Array.isArray(J)?J:[];return X==="all"?t:t.filter(l=>l.role===X)},[X,J]),ea=n.useMemo(()=>new Map(J.map(t=>[t.email.toLowerCase(),t])),[J]),aa=n.useMemo(()=>or.map(t=>({...t,backendUser:ea.get(t.email.toLowerCase())??null})),[ea]),ta=ve.filter(t=>t.status==="pending").length,xe=n.useMemo(()=>R.filter(t=>{const l=!$e||t.searchText.includes($e),d=m==="all"||Rr(t).includes(m),c=h==="all"||t.categories.includes(h),u=x==="all"||se(t.funnelStages?.[k]??t.funnelStage)===x;return l&&d&&c&&u}),[m,R,$e,h,x,k]),ee=n.useCallback(t=>{t===L?Se(l=>l==="asc"?"desc":"asc"):(Ye(t),Se(t==="name"||t==="contact"?"asc":"desc"))},[L]),ra=n.useMemo(()=>{const t=V==="asc"?1:-1,l=(d,c)=>{if(L==="name")return d.name.localeCompare(c.name);if(L==="contact")return(d.email??"").localeCompare(c.email??"");if(L==="events")return _e(d)-_e(c);const u=ua(L==="joined"?re(d):d.updatedAt??re(d)),w=ua(L==="joined"?re(c):c.updatedAt??re(c));return u-w};return[...xe].sort((d,c)=>l(d,c)*t||d.name.localeCompare(c.name))},[L,V,xe]).slice(0,80),Oa=3600*1e3,sa=T?.finishedAt?new Date(T.finishedAt).getTime()+Oa:null,Ha=(()=>
1{if(!sa)return"Auto-syncs hourly";const t=sa-Pa;if(t<=0)return"Auto-sync due";const l=Math.round(t/6e4);return l<60?`Auto-sync in ${l}m`:`Auto-sync in ${Math.floor(l/60)}h ${l%60}m`})(),Ka=n.useMemo(()=>G.map(t=>{const l=I.reduce((c,u)=>({...c,[u]:0}),{});for(const c of R){const u=se(c.funnelStages?.[t.key]??c.funnelStage);l[u]+=1}const d=R.length;return{category:t,total:d,stages:I.map(c=>({stage:c,label:E[c].label,count:l[c]}))}}),[R]),Va=n.useCallback(async(t,l,d)=>{if(!p){C.error("Sign in as a real admin to save CRM stages.");return}F(`${t}:${l}`);const c=g.find(u=>u.id===t);v(u=>u.map(w=>w.id===t?{...w,funnelStages:{...w.funnelStages??{},[l]:d}}:w));try{const u=await mt({data:{id:t,category:l,funnelStage:d},headers:p});if(u.funnelStages?.[l]!==d)throw new Error("Backend did not confirm the saved CRM stage.");v(w=>w.map(ae=>ae.id===t?{...ae,funnelStage:u.funnelStage,funnelStages:u.funnelStages,updatedAt:u.updatedAt}:ae)),C.success(`Stage saved: ${E[d].label}`)}catch(u){console.error("updateCrmPersonStage failed",u),c&&v(ae=>ae.map(la=>la.id===t?c:la));const w=u instanceof Response?`${u.status} ${u.statusText}`:u instanceof Error?u.message:"Failed to update funnel stage";C.error(w)}finally{F(null)}},[p,g]),za=n.useCallback(async(t,l)=>{if(!p){C.error("Sign in as a real admin to save CRM notes.");return}const d=g.find(c=>c.id===t);v(c=>c.map(u=>u.id===t?{...u,notes:l}:u));try{const c=await ut({data:{id:t,notes:l},headers:p});v(u=>u.map(w=>w.id===t?{...w,notes:c.notes,updatedAt:c.updatedAt}:w))}catch(c){d&&v(u=>u.map(w=>w.id===t?d:w)),C.error(c instanceof Error?c.message:"Failed to save notes")}},[p,g]),Wa=n.useMemo(()=>[{label:"CRM people",value:f(A.total),change:`${f(A.byStatus.active??0)} active`,icon:ia},{label:"Email coverage",value:`${Le(A.withEmail,A.total)}%`,change:`${f(A.withEmail)} records`,icon:Ee},{label:"Phone coverage",value:`${Le(A.withPhone,A.total)}%`,change:`${f(A.withPhone)} records`,icon:wa},{label:"Company mapped",value:f(A.withCompany),change:`${f(A.withCategories)} categorized`,icon:Pe}],[A]),qa=Math.max(A.total,1),Ga=G[0],na=I.reduce((t,l)=>({...t,[l]:R.filter(d=>se(d.funnelStages?.[Ga.key]??d.funnelStage)===l).length}),{});[`${f(A.total)}`,...I.map(t=>({label:E[t].label,value:Le(na[t]??0,qa),accent:`${f(na[t]??0)} people`}))];const Ya=Ma.find(t=>t.value===r)?.label??"Dashboard",Qa=r==="dashboard"?"Capital, CRM coverage, and operating signals for the Founder Village backend.":r==="team"?"Manage authenticated dashboard users and assign admin, founding member, or member access.":r==="waitlist"?"Review new login/sign-up requests and approve founding members into the dashboard.":r==="people"?"Search, filter, and sync the live CRM people database.":"Track contact quality and CRM funnel health.",Ja=Qe?"grid gap-4 lg:grid-cols-[4rem_minmax(0,1fr)]":"grid gap-6 lg:grid-cols-[230px_minmax(0,1fr)] xl:grid-cols-[250px_minmax(0,1fr)]";return e.jsx("div",{className:"container-x py-8 md:py-10",children:e.jsxs("div",{className:Ja,children:[e.jsx(gr,{activePage:r,onPageChange:s,pendingWaitlistCount:ta,collapsed:Qe,onCollapsedChange:Ea}),e.jsxs("div",{className:"min-w-0",children:[r!=="people"&&r!=="funnel"&&e.jsx("div",{className:"mb-6 flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold uppercase tracking-[0.24em] text-primary",children:"Admin workspace"}),e.jsx("h2",{className:"mt-2 font-display text-4xl leading-none md:text-5xl",children:Ya}),e.jsx("p",{className:"mt-3 max-w-2xl text-sm leading-6 text-muted-foreground",children:Qa})]})}),r==="dashboard"&&e.jsxs("div",{className:"space-y-6",children:[e.jsx($a,{metrics:Wa}),e.jsx(wr,{people:g})]}),r==="team"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs(S,{icon:ia,eyebrow:`${f(aa.length)} people`,title:"Team people",children:[e.jsx("p",{className:"mb-5 max-w-2xl text-sm leading-6 text-muted-foreground",children:"Core Founder Haus access list. If a person shows as needing OTP login, they have not created a Supabase auth user yet."}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full min-w-[920px] text-left text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border text-xs uppercase tracking-[0.18em] text-muted-foreground",children:[e.jsx("th",{className:"pb-3 font-medium",children:"Team member"}),e.jsx("th",{className:"pb-3 font-medium",children:"Focus"}),e.jsx("th",{className:"pb-3 font-medium",children:"Expected access"}),e.jsx("th",{className:"pb-3 font-medium",children:"Dashboard role"}),e.jsx("th",{className:"pb-3 font-medium",children:"Auth status"})]})}),e.jsx("tbody",{children:aa.map(t=>e.jsxs("tr",{className:"border-b border-border/70 last:border-0",children:[e.jsxs("td",{className:"py-4 pr-4",children:[e.jsx("div",{className:"font-medium text-foreground",children:t.name}),e.jsxs("a",{href:`mailto:${t.email}`,className:"mt-1 inline-flex items-center gap-2 text-xs text-muted-foreground transition hover:text-primary",children:[e.jsx(Ee,{className:"h-3.5 w-3.5"}),t.email]})]}),e.jsx("td",{className:"py-4 pr-4 text-muted-foreground",children:t.focus}),e.jsx("td",{className:"py-4 pr-4",children:e.jsx("span",{className:"inline-flex rounded-full border border-primary/35 bg-primary/10 px-3 py-1 text-xs font-semibold capitalize text-primary",children:Te(t.expectedRole)})}),e.jsx("td",{className:"py-4 pr-4",children:t.backendUser?e.jsx("select",{value:t.backendUser.role,disabled:Ve===t.backendUser.id,onChange:l=>Je(t.backendUser.id,l.target.value),className:"h-10 rounded-lg border border-border bg-background/45 px-3 text-sm capitalize outline-none transition focus:border-primary disabled:opacity-50",children:da.map(l=>e.jsx("option",{value:l,children:Te(l)},l))}):e.jsx("span",{className:"text-sm text-muted-foreground",children:"Needs OTP login"})}),e.jsx("td",{className:"py-4 text-muted-foreground",children:t.backendUser?t.backendUser.emailConfirmedAt?"Confirmed":"Pending email":"Not in Auth yet"})]},t.email))})]})})]}
1),e.jsxs(S,{icon:oe,eyebrow:"Backend users",title:"User roles",children:[e.jsxs("div",{className:"mb-4 flex flex-col gap-3 xl:flex-row xl:items-center xl:justify-between",children:[e.jsx("p",{className:"max-w-2xl text-sm leading-6 text-muted-foreground",children:"Real Supabase auth users. Admins can assign exactly one dashboard role: admin, founding member, or member."}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx(le,{label:"User role",value:X,options:[{value:"all",label:"All roles"},{value:"admin",label:"Admins"},{value:"investor",label:"Founding members"},{value:"member",label:"Members"}],onChange:Ta}),e.jsx("button",{onClick:async()=>{if(!(!D||!p)){me(!0),Z(null);try{const t=await ca({headers:p});ce(Array.isArray(t)?t:[])}catch(t){Z(t instanceof Error?t.message:"Could not refresh users.")}finally{me(!1)}}},disabled:je||!D,className:"inline-flex h-10 items-center justify-center rounded-lg border border-border px-4 text-sm text-foreground/80 transition hover:bg-surface hover:text-primary disabled:opacity-50",children:je?"Loading...":"Refresh users"})]})]}),ye&&e.jsx("div",{className:"mb-4 rounded-lg border border-destructive/40 bg-destructive/10 p-4 text-sm text-destructive",children:ye}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full min-w-[980px] text-left text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border text-xs uppercase tracking-[0.18em] text-muted-foreground",children:[e.jsx("th",{className:"pb-3 font-medium",children:"User"}),e.jsx("th",{className:"pb-3 font-medium",children:"Role"}),e.jsx("th",{className:"pb-3 font-medium",children:"Created"}),e.jsx("th",{className:"pb-3 font-medium",children:"Last sign in"}),e.jsx("th",{className:"pb-3 font-medium",children:"Email status"})]})}),e.jsx("tbody",{children:Ze.map(t=>e.jsxs("tr",{className:"border-b border-border/70 last:border-0",children:[e.jsxs("td",{className:"py-4 pr-4",children:[e.jsx("div",{className:"font-medium text-foreground",children:t.fullName||t.email}),e.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:t.email})]}),e.jsx("td",{className:"py-4 pr-4",children:e.jsx("select",{value:t.role,disabled:Ve===t.id,onChange:l=>Je(t.id,l.target.value),className:"h-10 rounded-lg border border-border bg-background/45 px-3 text-sm capitalize outline-none transition focus:border-primary disabled:opacity-50",children:da.map(l=>e.jsx("option",{value:l,children:Te(l)},l))})}),e.jsx("td",{className:"py-4 pr-4 text-muted-foreground",children:Y(t.createdAt)}),e.jsx("td",{className:"py-4 pr-4 text-muted-foreground",children:Y(t.lastSignInAt)}),e.jsx("td",{className:"py-4 text-muted-foreground",children:t.emailConfirmedAt?"Confirmed":"Pending"})]},t.id))})]})}),!je&&!Ze.length&&!ye&&e.jsx("div",{className:"py-8 text-center text-sm text-muted-foreground",children:X==="all"?"No backend users found.":"No backend users match that role filter."})]})]}),r==="waitlist"&&e.jsxs(S,{className:"mt-8",icon:Be,eyebrow:`${f(ta)} pending`,title:"Dashboard waitlist",action:e.jsx("button",{onClick:ue,disabled:we||!D,className:"inline-flex h-10 items-center justify-center rounded-lg border border-border px-4 text-sm text-foreground/80 transition hover:bg-surface hover:text-primary disabled:opacity-50",children:we?"Loading...":"Refresh waitlist"}),children:[e.jsx("p",{className:"mb-5 max-w-2xl text-sm leading-6 text-muted-foreground",children:"New login/sign-up requests land here as pending. Approving a user assigns the founding member role, so their next OTP login opens the founding member dashboard."}),ke&&e.jsx("div",{className:"mb-4 rounded-lg border border-destructive/40 bg-destructive/10 p-4 text-sm text-destructive",children:ke}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full min-w-[860px] text-left text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border text-xs uppercase tracking-[0.18em] text-muted-foreground",children:[e.jsx("th",{className:"pb-3 font-medium",children:"User"}),e.jsx("th",{className:"pb-3 font-medium",children:"Status"}),e.jsx("th",{className:"pb-3 font-medium",children:"Requested"}),e.jsx("th",{className:"pb-3 font-medium",children:"Updated"}),e.jsx("th",{className:"pb-3 font-medium",children:"Action"})]})}),e.jsx("tbody",{children:ve.map(t=>e.jsxs("tr",{className:"border-b border-border/70 last:border-0",children:[e.jsxs("td",{className:"py-4 pr-4",children:[e.jsx("div",{className:"font-medium text-foreground",children:t.email}),e.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:t.userId})]}),e.jsx("td",{className:"py-4 pr-4",children:e.jsx("span",{className:`inline-flex rounded-full border px-3 py-1 text-xs font-semibold capitalize ${t.status==="approved"?"border-primary/35 bg-primary/10 text-primary":t.status==="rejected"?"border-destructive/35 bg-destructive/10 text-destructive":"border-amber-300/35 bg-amber-300/10 text-amber-200"}`,children:t.status})}),e.jsx("td",{className:"py-4 pr-4 text-muted-foreground",children:Y(t.requestedAt)}),e.jsx("td",{className:"py-4 pr-4 text-muted-foreground",children:Y(t.updatedAt)}),e.jsx("td",{className:"py-4",children:e.jsxs("button",{onClick:()=>
1Ua(t.userId),disabled:t.status==="approved"||qe===t.userId||!D,className:"inline-flex h-10 items-center justify-center gap-2 rounded-lg bg-gradient-orange px-4 text-sm font-semibold text-primary-foreground shadow-glow transition disabled:cursor-not-allowed disabled:opacity-50",children:[qe===t.userId&&e.jsx(he,{className:"h-4 w-4 animate-spin"}),t.status==="approved"?"Approved":"Approve as founding member"]})})]},t.id))})]})}),!we&&!ve.length&&!ke&&e.jsx("div",{className:"py-8 text-center text-sm text-muted-foreground",children:"No waitlist requests yet."})]}),(r==="people"||r==="funnel")&&e.jsxs("div",{className:"mt-8",children:[r==="people"&&e.jsxs(S,{icon:Pe,eyebrow:`${f(A.total)} people`,title:"CRM",action:e.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[e.jsxs("button",{type:"button",onClick:()=>pe(!0),className:"inline-flex h-10 items-center gap-2 rounded-lg bg-gradient-orange px-3 text-sm font-semibold text-primary-foreground shadow-glow transition",children:[e.jsx(Kt,{className:"h-4 w-4"}),"Add lead"]}),e.jsxs("button",{type:"button",onClick:Ia,disabled:P,className:"inline-flex h-10 items-center gap-2 rounded-lg border border-border px-3 text-sm text-foreground/80 transition hover:bg-background/70 hover:text-primary disabled:opacity-50",children:[P?e.jsx(he,{className:"h-4 w-4 animate-spin"}):e.jsx(ha,{className:"h-4 w-4"}),"Sync now"]}),e.jsxs("span",{className:"inline-flex items-center gap-2 text-xs text-muted-foreground",children:[P&&e.jsx(he,{className:"h-3.5 w-3.5 animate-spin"}),P?"Syncing...":Ha]})]}),children:[e.jsx(at,{open:Ra,onOpenChange:Xe,children:e.jsx(tt,{className:"max-w-xl border-border bg-surface",children:e.jsxs("form",{onSubmit:Ba,children:[e.jsxs(rt,{children:[e.jsx(st,{children:"Add lead"}),e.jsx(nt,{children:"Manual CRM lead"})]}),e.jsxs("div",{className:"mt-5 grid gap-4",children:[e.jsxs("label",{className:"grid gap-2 text-sm font-medium text-foreground",children:["Name",e.jsx("input",{value:U.name,onChange:t=>q("name",t.target.value),required:!0,className:"h-11 rounded-lg border border-border bg-background/45 px-3 text-sm outline-none transition placeholder:text-muted-foreground/70 focus:border-primary"})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("label",{className:"grid gap-2 text-sm font-medium text-foreground",children:["Email",e.jsx("input",{type:"email",value:U.email,onChange:t=>q("email",t.target.value),className:"h-11 rounded-lg border border-border bg-background/45 px-3 text-sm outline-none transition placeholder:text-muted-foreground/70 focus:border-primary"})]}),e.jsxs("label",{className:"grid gap-2 text-sm font-medium text-foreground",children:["Phone",e.jsx("input",{value:U.phone,onChange:t=>q("phone",t.target.value),className:"h-11 rounded-lg border border-border bg-background/45 px-3 text-sm outline-none transition placeholder:text-muted-foreground/70 focus:border-primary"})]})]}),e.jsxs("label",{className:"grid gap-2 text-sm font-medium text-foreground",children:["Preferred language",e.jsx("input",{value:U.preferredLanguage,onChange:t=>q("preferredLanguage",t.target.value),className:"h-11 rounded-lg border border-border bg-background/45 px-3 text-sm outline-none transition placeholder:text-muted-foreground/70 focus:border-primary"})]}),e.jsxs("label",{className:"grid gap-2 text-sm font-medium text-foreground",children:["Lead stage",e.jsx("select",{value:U.funnelStage,onChange:t=>q("funnelStage",t.target.value),className:"h-11 rounded-lg border border-border bg-background/45 px-3 text-sm outline-none transition focus:border-primary",children:I.map(t=>e.jsx("option",{value:t,children:E[t].label},t))})]}),e.jsxs("label",{className:"grid gap-2 text-sm font-medium text-foreground",children:["Notes",e.jsx("textarea",{value:U.notes,onChange:t=>q("notes",t.target.value),rows:4,className:"min-h-28 rounded-lg border border-border bg-background/45 px-3 py-3 text-sm outline-none transition placeholder:text-muted-foreground/70 focus:border-primary"})]})]}),e.jsxs(lt,{className:"mt-6 gap-2 sm:space-x-0",children:[e.jsx("button",{type:"button",onClick:()=>Xe(!1),disabled:de,className:"inline-flex h-10 items-center justify-center rounded-lg border border-border px-4 text-sm text-foreground
1/80 transition hover:bg-background/70 hover:text-primary disabled:opacity-50",children:"Cancel"}),e.jsxs("button",{type:"submit",disabled:de||!U.name.trim(),className:"inline-flex h-10 items-center justify-center gap-2 rounded-lg bg-gradient-orange px-4 text-sm font-semibold text-primary-foreground shadow-glow transition disabled:cursor-not-allowed disabled:opacity-50",children:[de&&e.jsx(he,{className:"h-4 w-4 animate-spin"}),"Save lead"]})]})]})})}),W&&e.jsx("div",{className:"mb-4 rounded-lg border border-primary/30 bg-primary/10 p-3 text-sm text-muted-foreground",children:W}),e.jsx("div",{className:"mb-4 flex flex-wrap items-center gap-3",children:e.jsx(le,{label:"CRM audience",value:m,options:[{value:"all",label:"All people"},{value:"member",label:"Members"},{value:"founding-member",label:"Founding members"}],onChange:j})}),e.jsxs("div",{className:"mb-4 grid gap-3 xl:grid-cols-[1fr_auto_auto] xl:items-center",children:[e.jsxs("label",{className:"relative block",children:[e.jsx("span",{className:"sr-only",children:"Search CRM people"}),e.jsx(yt,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx("input",{value:i,onChange:t=>o(t.target.value),placeholder:"Search name, company, email, phone, city...",className:"h-11 w-full rounded-lg border border-border bg-background/45 pl-9 pr-3 text-sm outline-none transition placeholder:text-muted-foreground/70 focus:border-primary"})]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:be?"Loading live CRM...":`Showing ${f(ra.length)} of ${f(xe.length)}`}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"sr-only",children:"Funnel category"}),e.jsx("select",{value:k,onChange:t=>N(t.target.value),className:"h-10 min-w-36 rounded-lg border border-border bg-background/45 px-3 text-sm text-foreground outline-none transition focus:border-primary",children:G.map(t=>e.jsx("option",{value:t.key,children:t.label},t.key))})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"sr-only",children:"Funnel stage"}),e.jsxs("select",{value:x,onChange:t=>y(t.target.value),className:"h-10 min-w-32 rounded-lg border border-border bg-background/45 px-3 text-sm text-foreground outline-none transition focus:border-primary",children:[e.jsx("option",{value:"all",children:"All stages"}),I.map(t=>e.jsx("option",{value:t,children:E[t].label},t))]})]})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"sr-only",children:"CRM funnel"}),e.jsxs("select",{value:h,onChange:t=>b(t.target.value),className:"h-10 min-w-40 rounded-lg border border-border bg-background/45 px-3 text-sm text-foreground outline-none transition focus:border-primary",children:[e.jsx("option",{value:"all",children:"All funnels"}),Fe.map(t=>e.jsx("option",{value:t,children:t},t))]})]})]}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full min-w-[1500px] text-left text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border text-xs uppercase tracking-[0.18em] text-muted-foreground",children:[e.jsx(te,{label:"Person",sortKey:"name",activeSort:L,sortDir:V,onSort:ee}),e.jsx(te,{label:"Contact",sortKey:"contact",activeSort:L,sortDir:V,onSort:ee}),G.map(t=>e.jsx("th",{className:"pb-3 font-medium",title:t.label,children:t.short},t.key)),e.jsx(te,{label:"Events",sortKey:"events",activeSort:L,sortDir:V,onSort:ee}),e.jsx(te,{label:"Joined",sortKey:"joined",activeSort:L,sortDir:V,onSort:ee}),e.jsx(te,{label:"Updated",sortKey:"updated",activeSort:L,sortDir:V,onSort:ee}),e.jsx("th",{className:"pb-3 font-medium",children:"Notes"}),e.jsx("th",{className:"pb-3 font-medium",children:"Context"})]})}),e.jsx("tbody",{children:ra.map(t=>e.jsx(pr,{person:t,onChangeStage:Va,onChangeNotes:za,updatingStageId:M},t.id))})]})}),xe.length===0&&e.jsx("div",{className:"py-10 text-center text-sm text-muted-foreground",children:"No CRM records match that search."})]}),r==="funnel"&&e.jsxs(S,{icon:xa,eyebrow:`${f(A.total)} people`,title:"Funnel",children:[e.jsx("p",{className:"mb-6 max-w-2xl text-sm leading-6 text-muted-foreground",children:"One funnel per category. Update a person's stage from the CRM table."}),e.jsx("div",{className:"grid gap-8 lg:grid-cols-2",children:Ka.map(t=>e.jsxs("div",{className:"rounded-xl border border-border bg-surface/40 p-5",children:[e.jsxs("div",{className:"mb-4 flex items-baseline justify-between",children:[e.jsx("h3",{className:"font-display text-lg text-foreground",children:t.category.label}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[f(t.total)," people"]})]}),e.jsx("div",{className:"space-y-3",children:t.stages.map((l,d)=>{const c=E[l.stage],u=[100,78,56,34][d]??100,w=t.total?l.count/t.total*100:0;return e.jsxs("div",{className:"mx-auto",style:{width:`${u}%`},children:[e.jsxs("div",{className:"mb-1 flex items-center justify-between text-xs",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`h-2 w-2 rounded-full ${c.dot}`}),e.jsx("span",{className:"font-medium text-foreground",children:c.label})]}),e.jsxs("span",{className:"text-muted-foreground",children:[f(l.count)," · ",w.toFixed(1),"%"]})]}),e.jsx("div",{className:"h-6 w-full overflow-hidden rounded-md border border-border bg-background/40",children:e.jsx("div",{className:`h-full bg-gradient-to-r ${c.bar}`,style:{width:`${Math.max(w,l.count>0?4:0)}%`}})})]},l.stage)})})]},t.category.key))})]})]})]})]})})}
1function gr({activePage:a,onPageChange:r,pendingWaitlistCount:s,collapsed:i,onCollapsedChange:o}){return e.jsx("aside",{className:"lg:sticky lg:top-28 lg:self-start",children:e.jsxs("nav",{"aria-label":"Admin dashboard sections",className:`rounded-lg border border-border bg-surface/55 p-2 shadow-sm ${i?"w-16":"w-full"}`,children:[e.jsxs("div",{className:`mb-1 flex items-center gap-2 px-1 py-1 ${i?"justify-center":"justify-between"}`,children:[!i&&e.jsx("div",{className:"px-2 text-xs font-semibold uppercase tracking-[0.2em] text-muted-foreground",children:"Admin"}),e.jsx("button",{type:"button",title:i?"Expand sidebar":"Collapse sidebar","aria-label":i?"Expand admin sidebar":"Collapse admin sidebar",onClick:()=>o(!i),className:"inline-flex h-9 w-9 items-center justify-center rounded-md border border-border text-muted-foreground transition hover:bg-background/60 hover:text-primary",children:i?e.jsx(Na,{className:"h-4 w-4"}):e.jsx(va,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[Ma.map(m=>{const j=m.icon,h=a===m.value,b=m.value==="waitlist"&&s>0;return e.jsxs("button",{type:"button","aria-current":h?"page":void 0,"aria-label":m.label,title:i?m.label:void 0,onClick:()=>r(m.value),className:`relative flex min-h-11 w-full items-center gap-3 rounded-md py-2 text-left text-sm transition ${h?"bg-primary/12 text-primary":"text-foreground/75 hover:bg-background/60 hover:text-foreground"} ${i?"justify-center px-0":"justify-between px-3"}`,children:[e.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(j,{className:"h-4 w-4 shrink-0"}),i?e.jsx("span",{className:"sr-only",children:m.label}):e.jsx("span",{className:"truncate",children:m.label})]}),b&&i&&e.jsx("span",{className:"absolute right-2 top-2 h-2 w-2 rounded-full bg-primary"}),b&&!i&&e.jsx("span",{className:"rounded-full border border-primary/30 bg-primary/10 px-2 py-0.5 text-[11px] font-semibold text-primary",children:f(s)})]},m.value)}),e.jsxs(ge,{to:"/old/docs","aria-label":"Docs",title:i?"Docs":void 0,className:`flex min-h-11 w-full items-center gap-3 rounded-md py-2 text-left text-sm text-foreground/75 transition hover:bg-background/60 hover:text-primary ${i?"justify-center px-0":"px-3"}`,children:[e.jsx(ba,{className:"h-4 w-4 shrink-0"}),i?e.jsx("span",{className:"sr-only",children:"Docs"}):e.jsx("span",{children:"Docs"})]})]})]})})}function br({activePage:a,onPageChange:r,collapsed:s,onCollapsedChange:i}){return e.jsx("aside",{className:"lg:sticky lg:top-28 lg:self-start",children:e.jsxs("nav",{"aria-label":"Founding member dashboard sections",className:`rounded-lg border border-border bg-surface/55 p-2 shadow-sm ${s?"w-16":"w-full"}`,children:[e.jsxs("div",{className:`mb-1 flex items-center gap-2 px-1 py-1 ${s?"justify-center":"justify-between"}`,children:[!s&&e.jsx("div",{className:"px-2 text-xs font-semibold uppercase tracking-[0.2em] text-muted-foreground",children:"Founding member"}),e.jsx("button",{type:"button",title:s?"Expand sidebar":"Collapse sidebar","aria-label":s?"Expand founding member sidebar":"Collapse founding member sidebar",onClick:()=>i(!s),className:"inline-flex h-9 w-9 items-center justify-center rounded-md border border-border text-muted-foreground transition hover:bg-background/60 hover:text-primary",children:s?e.jsx(Na,{className:"h-4 w-4"}):e.jsx(va,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[lr.map(o=>{const m=o.icon,j=a===o.value;return e.jsxs("button",{type:"button","aria-current":j?"page":void 0,"aria-label":o.label,title:s?o.label:void 0,onClick:()=>r(o.value),className:`flex min-h-11 w-full items-center gap-3 rounded-md py-2 text-left text-sm transition ${j?"bg-primary/12 text-primary":"text-foreground/75 hover:bg-background/60 hover:text-foreground"} ${s?"justify-center px-0":"px-3"}`,children:[e.jsx(m,{className:"h-4 w-4 shrink-0"}),s?e.jsx("span",{className:"sr-only",children:o.label}):e.jsx("span",{className:"truncate",children:o.label})]},o.value)}),e.jsxs(ge,{to:"/old/docs","aria-label":"Docs",title:s?"Docs":void 0,className:`flex min-h-11 w-full items-center gap-3 rounded-md py-2 text-left text-sm text-foreground
1/75 transition hover:bg-background/60 hover:text-primary ${s?"justify-center px-0":"px-3"}`,children:[e.jsx(ba,{className:"h-4 w-4 shrink-0"}),s?e.jsx("span",{className:"sr-only",children:"Docs"}):e.jsx("span",{children:"Docs"})]})]})]})})}function te({label:a,sortKey:r,activeSort:s,sortDir:i,onSort:o}){const m=s===r,j=m?i==="asc"?"▲":"▼":"";return e.jsx("th",{className:"pb-3 font-medium",children:e.jsxs("button",{type:"button",onClick:()=>o(r),className:`inline-flex items-center gap-1 rounded-md px-2 py-1 transition ${m?"bg-primary/12 text-primary":"hover:bg-background/60 hover:text-foreground"}`,children:[a,j&&e.jsx("span",{className:"text-[10px]",children:j})]})})}function pr({person:a,onChangeStage:r,onChangeNotes:s,updatingStageId:i}){const o=Lr(a),m=o.slice(0,3),j=o.length-m.length,h=Da(a),b=La(a),x=_e(a),[y,k]=n.useState(a.notes??"");return n.useEffect(()=>{k(a.notes??"")},[a.id,a.notes]),e.jsxs("tr",{className:"border-b border-border/70 align-top last:border-0",children:[e.jsx("td",{className:"py-4 pr-4",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-foreground",children:a.name}),e.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:[a.title,a.company].filter(Boolean).join(" at ")||"No company mapped"})]}),a.profileUrl&&e.jsx("a",{href:a.profileUrl,target:"_blank",rel:"noreferrer","aria-label":`Open profile for ${a.name}`,className:"mt-0.5 text-muted-foreground transition hover:text-primary",children:e.jsx(Ue,{className:"h-3.5 w-3.5"})})]})}),e.jsx("td",{className:"py-4 pr-4",children:e.jsxs("div",{className:"space-y-1.5 text-xs text-muted-foreground",children:[a.email?e.jsxs("a",{href:`mailto:${a.email}`,className:"flex items-center gap-2 transition hover:text-primary",children:[e.jsx(Ee,{className:"h-3.5 w-3.5"}),a.email]}):null,a.phone?e.jsxs("a",{href:`tel:${a.phone.replace(/[^\d+]/g,"")}`,className:"flex items-center gap-2 transition hover:text-primary",children:[e.jsx(wa,{className:"h-3.5 w-3.5"}),a.phone]}):null,a.location?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(St,{className:"h-3.5 w-3.5"}),a.location]}):null,!a.email&&!a.phone&&!a.location?"No contact details":null]})}),G.map(N=>{const M=se(a.funnelStages?.[N.key]??a.funnelStage),F=i===`${a.id}:${N.key}`;return e.jsx("td",{className:"py-4 pr-2",children:e.jsx("select",{value:M,disabled:F,onChange:g=>r(a.id,N.key,g.target.value),"aria-label":`${N.label} stage`,className:`h-7 rounded-full border px-2 text-[11px] font-semibold outline-none transition focus:ring-2 focus:ring-primary/40 ${E[M].badge} ${F?"opacity-60":""}`,children:I.map(g=>e.jsx("option",{value:g,className:"bg-background text-foreground",children:E[g].label},g))})},N.key)}),e.jsxs("td",{className:"py-4 pr-4",children:[e.jsx("span",{className:"inline-flex min-w-12 justify-center rounded-full border border-border bg-surface px-3 py-1 text-xs font-semibold text-foreground",children:f(x)}),b>h&&e.jsxs("div",{className:"mt-1 text-[11px] text-muted-foreground",children:[f(h)," attended / ",f(b)," RSVP"]})]}),e.jsx("td",{className:"py-4 pr-4 text-xs text-muted-foreground",children:Y(re(a))}),e.jsx("td",{className:"py-4 pr-4 text-xs text-muted-foreground",children:Y(a.updatedAt)}),e.jsx("td",{className:"py-4 pr-4",children:e.jsx("textarea",{value:y,onChange:N=>k(N.target.value),onBlur:()=>{y!==(a.notes??"")&&s(a.id,y)},placeholder:"Add note...",rows:2,className:"min-h-[44px] w-44 resize-y rounded-md border border-border bg-background/40 px-2 py-1 text-xs text-foreground outline-none transition placeholder:text-muted-foreground/60 focus:border-primary"})}),e.jsx("td",{className:"py-4 pr-4",children:m.length?e.jsxs("div",{className:"flex max-w-xs flex-wrap gap-1.5",children:[m.map(N=>e.jsx("span",{className:"inline-flex rounded-md border border-border bg-background/50 px-2 py-1 text-xs text-muted-foreground",children:N},N)),j>0&&e.jsxs("span",{className:"inline-flex rounded-md border border-border bg-background/50 px-2 py-1 text-xs text-muted-foreground",children:["+",j]})]}):e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsx(qt,{className:"h-3.5 w-3.5"}),"No category"]})})]})}function fr({session:a,activePage:r,onPageChange:s,selectedProduct:i,setSelectedProduct:o}){const[m,j]=n.useState(null),[h,b]=n.useState(!1),[x,y]=n.useState(!1),k=n.useMemo(()=>{const g=m?.purchases.length??0;
1return[{label:"Ownership tokens",value:"Not issued",detail:"No onchain ownership exists in V1",icon:ga},{label:"Model currency",value:"BRL",detail:"Internal scenarios use current working terms",icon:Yt},{label:"Legacy checkout rows",value:f(g),detail:"Historical and non-binding",icon:Dt},{label:"Deployment network",value:"Base Sepolia",detail:"Mainnet and liquidity are disabled",icon:ya}]},[m]),N=n.useMemo(()=>!a||a.user.id===Oe?null:{},[a]),M=n.useCallback(async()=>{if(N){b(!0);try{j(await Zt({headers:N}))}catch(g){C.error(g instanceof Error?g.message:"Could not load token purchases.")}finally{b(!1)}}},[N]);n.useEffect(()=>{M()},[M]);const F=x?"grid gap-4 lg:grid-cols-[4rem_minmax(0,1fr)]":"grid gap-6 lg:grid-cols-[230px_minmax(0,1fr)] xl:grid-cols-[250px_minmax(0,1fr)]";return e.jsx("div",{className:"container-x py-8 md:py-10",children:e.jsxs("div",{className:F,children:[e.jsx(br,{activePage:r,onPageChange:s,collapsed:x,onCollapsedChange:y}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"mb-6 flex flex-col gap-5 xl:flex-row xl:items-end xl:justify-between",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold uppercase tracking-[0.24em] text-primary",children:"Founding member workspace"}),e.jsx("h2",{className:"mt-2 font-display text-4xl leading-none md:text-5xl",children:"Holdings, asset reporting, and founding member materials"})]})}),r==="dashboard"&&e.jsx(jr,{metrics:k,metricsLoading:!!N&&m===null,purchaseSnapshot:m}),r==="assets"&&e.jsx(kr,{selectedProduct:i,setSelectedProduct:o}),r==="financials"&&e.jsx(Ar,{}),r==="updates"&&e.jsx($r,{}),r==="roadmap"&&e.jsx(Fr,{})]})]})})}function jr({metrics:a,metricsLoading:r=!1,purchaseSnapshot:s}){return e.jsxs(e.Fragment,{children:[e.jsx($a,{metrics:a,loading:r}),e.jsxs("div",{className:"mt-8 grid gap-6 xl:grid-cols-[1fr_0.9fr]",children:[e.jsxs(S,{icon:oe,eyebrow:"Founder Haus",title:"Private tokenization workbench",children:[e.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:"Review sourced asset statistics, compare BRL tokenization scenarios, and prepare a Base Sepolia Safe package. Every output is an internal model—not an offer, market price, valuation guarantee, liquidity promise, or promised yield."}),e.jsxs(ge,{to:"/old/dashboard/founder-haus",className:"mt-6 inline-flex h-11 items-center gap-2 rounded-lg bg-gradient-orange px-5 text-sm font-semibold text-primary-foreground",children:["Open Founder Haus workbench",e.jsx(Ue,{className:"h-4 w-4"})]})]}),e.jsx(S,{icon:Mt,eyebrow:"Historical records",title:"Legacy checkout archive",children:e.jsxs("div",{className:"rounded-lg border border-amber-300/35 bg-amber-300/10 p-4 text-sm leading-6 text-amber-100",children:[s?.purchases.length??0," historical checkout record(s) are retained as"," ",e.jsx("strong",{children:"legacy_nonbinding"}),". They are not onchain ownership, a current price, or an entitlement to tokens."]})})]})]})}const yr={signups:{label:"Signups",color:"#f97316"}};function Re(a,r){const s=new Date(a);if(s.setHours(0,0,0,0),r==="week"){const o=(s.getDay()+6)%7;return s.setDate(s.getDate()-o),s}return r==="month"?new Date(s.getFullYear(),s.getMonth(),1):r==="quarter"?new Date(s.getFullYear(),Math.floor(s.getMonth()/3)*3,1):new Date(s.getFullYear(),0,1)}function vr(a,r){const s=new Date(a);return r==="week"?s.setDate(s.getDate()+7):r==="month"?s.setMonth(s.getMonth()+1):r==="quarter"?s.setMonth(s.getMonth()+3):s.setFullYear(s.getFullYear()+1),s}function Nr(a,r){return r==="year"?String(a.getFullYear()):r==="quarter"?`Q${Math.floor(a.getMonth()/3)+1} ${String(a.getFullYear()).slice(2)}`:r==="month"?a.toLocaleDateString("en-US",{month:"short",year:"2-digit"}):a.toLocaleDateString("en-US",{month:"short",day:"numeric"})}function wr({people:a}){const[r,s]=n.useState("month"),[i,o]=n.useState("2y"),m=n.useMemo(()=>{const h=new Date;let b=null;const x=[];for(const g of a){const v=g.lumaJoinedAt;if(!v)continue;const T=new Date(v).getTime();Number.isNaN(T)||(x.push(T),(!b||T<b.getTime())&&(b=new Date(T)))}let y;if(i==="all")y=b??new Date(h.getFullYear(),h.getMonth()-11,1);else{y=new Date(h);const g={"1m":1,"3m":3,"6m":6,"1y":12,"2y":24};y.setMonth(y.getMonth()-g[i])}const k=Re(y,r),N=Re(h,r),M=new Map;let F=new Date(k);for(;F.getTime()<=N.getTime();)M.set(F.getTime(),0),F=vr(F,r);for(const g of x){if(g<k.getTime())continue;
1const v=Re(new Date(g),r).getTime();M.has(v)&&M.set(v,(M.get(v)??0)+1)}return Array.from(M.entries()).map(([g,v])=>({label:Nr(new Date(g),r),signups:v}))},[a,r,i]),j=n.useMemo(()=>m.reduce((h,b)=>h+b.signups,0),[m]);return e.jsxs(S,{icon:Ie,eyebrow:`${f(j)} signups`,title:"Luma signups over time",children:[e.jsxs("div",{className:"mb-5 flex flex-wrap items-center gap-3",children:[e.jsx(le,{label:"Time range",value:i,options:[{value:"1m",label:"1M"},{value:"3m",label:"3M"},{value:"6m",label:"6M"},{value:"1y",label:"1Y"},{value:"2y",label:"2Y"},{value:"all",label:"All"}],onChange:o}),e.jsx(le,{label:"Granularity",value:r,options:[{value:"week",label:"Weekly"},{value:"month",label:"Monthly"},{value:"quarter",label:"Quarterly"},{value:"year",label:"Yearly"}],onChange:s})]}),e.jsx(ot,{config:yr,className:"h-[280px] w-full",children:e.jsxs(vt,{data:m,margin:{left:4,right:12,top:12,bottom:0},children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"signupsFill",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"5%",stopColor:"var(--color-signups)",stopOpacity:.45}),e.jsx("stop",{offset:"95%",stopColor:"var(--color-signups)",stopOpacity:.04})]})}),e.jsx(Nt,{vertical:!1}),e.jsx(wt,{dataKey:"label",axisLine:!1,tickLine:!1,tickMargin:10,minTickGap:24}),e.jsx(kt,{axisLine:!1,tickLine:!1,tickMargin:10,width:40,allowDecimals:!1}),e.jsx(it,{cursor:!1,content:e.jsx(dt,{formatter:h=>e.jsxs("div",{className:"flex min-w-[8rem] items-center justify-between gap-4",children:[e.jsx("span",{className:"text-muted-foreground",children:"Signups"}),e.jsx("span",{className:"font-mono font-medium text-foreground",children:f(Number(h))})]})})}),e.jsx(Ct,{dataKey:"signups",type:"monotone",fill:"url(#signupsFill)",stroke:"var(--color-signups)",strokeWidth:2.5})]})})]})}function kr({selectedProduct:a,setSelectedProduct:r}){return e.jsxs("div",{className:"min-w-0 max-w-full space-y-6",children:[e.jsx(S,{className:"min-w-0 max-w-full",icon:pa,eyebrow:"Assets",title:"Asset browser",children:e.jsx("div",{className:"-mx-1 flex max-w-full gap-3 overflow-x-auto overscroll-x-contain px-1 pb-2",children:He.map(s=>{const i=s.slug===a.slug;return e.jsxs("button",{onClick:()=>r(s),className:`grid min-w-[13.5rem] grid-cols-[4.75rem_1fr] items-center gap-3 rounded-lg border p-2 text-left transition md:min-w-[15rem] ${i?"border-primary/70 bg-primary/10":"border-border bg-background/35 hover:border-primary/45 hover:bg-surface"}`,children:[e.jsx("div",{className:"h-16 overflow-hidden rounded-md border border-border bg-background/40",children:e.jsx("img",{src:s.image,alt:`${s.name} thumbnail`,"data-fallback":s.fallbackImage,onError:Sa,className:"h-full w-full object-cover",loading:"lazy"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate text-sm font-medium",children:s.name}),e.jsx("div",{className:"mt-1 truncate text-xs text-muted-foreground",children:s.category}),e.jsxs("div",{className:"mt-2 flex items-center gap-2 text-xs text-primary",children:[e.jsx("span",{children:s.occupancy}),e.jsx("span",{className:"h-1 w-1 rounded-full bg-primary/60"}),e.jsx("span",{children:s.revenue})]})]})]},s.slug)})})}),e.jsx("div",{className:"min-w-0 max-w-full",children:a.slug==="founder-haus"?e.jsx(Cr,{}):a.slug==="founder-desk"?e.jsx(Sr,{product:a}):e.jsx(Mr,{product:a})})]})}function Cr(){return e.jsxs("section",{className:"rounded-lg border border-primary/30 bg-primary/[0.05] p-6 md:p-8",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs font-semibold uppercase tracking-[0.18em] text-primary",children:[e.jsx(oe,{className:"h-4 w-4"}),"Internal tokenization workbench"]}),e.jsx("h2",{className:"mt-3 text-2xl font-semibold",children:"Founder Haus token sale checkout is retired"}),e.jsx("p",{className:"mt-3 max-w-3xl text-sm leading-6 text-muted-foreground",children:"Existing purchase records are preserved as legacy, non-binding history. New work uses a team-only BRL model and an admin-controlled Base Sepolia mint; memberships and products do not automatically mint ownership tokens."}),e.jsxs(ge,{to:"/old/dashboard/founder-haus",className:"mt-6 inline-flex h-11 items-center gap-2 rounded-lg bg-gradient-orange px-5 text-sm font-semibold text-primary-foreground",children:["Open Founder Haus workbench",e.jsx(Ue,{className:"h-4 w-4"})]})]})}const ma=He.map(a=>({src:a.image,alt:a.name}));function Aa({product:a}){const[r,s]=n.useState(!1),i=Math.max(0,ma.findIndex(o=>o.src===a.image));return e.jsxs(e.Fragment,{children:[e.jsx("img",{src:a.image,alt:a.name,"data-fallback":a.fallbackImage,onError:Sa,decoding:"async",loading:"eager",className:"absolute inset-0 h-full w-full object-cover"}),e.jsx("button",{type:"button",onClick:()=>s(!0),"aria-label":`View ${a.name} images`,title:`View ${a.name} images`,className:"absolute right-3 top-3 z-20 inline-flex h-10 w-10 items-center justify-center rounded-lg border border-primary/40 bg-background/85 text-foreground shadow-glow backdrop-blur transition hover:border-primary hover:text-primary",children:e.jsx(pt,{className:"h-4 w-4"})}),e.jsx(Jt,{images:ma,startIndex:i,open:r,onClose:()=>s(!1)})]})}function Sr({product:a,className:r=""}){return e.jsxs("section",{className:`grid min-w-0 max-w-full overflow-hidden rounded-lg border border-border bg-background/40 lg:grid-cols-[0.72fr_1.28fr] ${r}`,children:[e.jsxs("div",{className:"relative min-h-64 border-b border-border bg-background/40 lg:border-b-0 lg:border-r",children:[e.jsx(Aa,{product:a}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-background/85 via-background/20 to-transparent"}),e.jsxs("div",{className:"absolute bottom-0 left-0 right-0 p-5",children:[e.jsx("div",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-primary",children:"Worksp
1ace membership"}),e.jsx("h2",{className:"mt-2 text-2xl font-semibold text-foreground",children:a.name})]})]}),e.jsxs("div",{className:"p-5 md:p-6",children:[e.jsxs("div",{className:"mb-6 flex items-start gap-3",children:[e.jsx("div",{className:"rounded-lg border border-border bg-background/50 p-2",children:e.jsx($t,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-primary",children:"Membership allocation"}),e.jsx("h2",{className:"mt-1 text-xl font-semibold",children:"Purchase workspace membership tokens"})]})]}),e.jsx("div",{className:"grid gap-3 sm:grid-cols-1",children:e.jsx(z,{label:"Your holdings",value:a.holdings,strong:!0})}),e.jsxs("div",{className:"mt-5",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between gap-4 text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Membership allocation progress"}),e.jsxs("span",{className:"font-medium text-foreground",children:[a.performance,"%"]})]}),e.jsx("div",{className:"h-3 overflow-hidden rounded-full bg-background",children:e.jsx("div",{className:"h-full rounded-full bg-gradient-orange",style:{width:`${a.performance}%`}})}),e.jsx("p",{className:"mt-3 text-xs leading-5 text-muted-foreground",children:"Workspace membership tokens will use the same allocation and checkout pattern as Founder Haus once the dedicated terms are finalized."})]}),e.jsxs("div",{className:"mt-5 grid gap-4 lg:grid-cols-[1fr_auto] lg:items-end",children:[e.jsxs("div",{className:"rounded-lg border border-border bg-background/40 p-4",children:[e.jsx("h3",{className:"font-semibold",children:"Membership metrics"}),e.jsx("ul",{className:"mt-3 grid gap-2 text-sm text-muted-foreground sm:grid-cols-3 lg:grid-cols-1",children:a.metrics.map(s=>e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(fa,{className:"h-4 w-4 text-primary"}),s]},s))})]}),e.jsxs("button",{type:"button",disabled:!0,className:"inline-flex h-11 items-center justify-center gap-2 rounded-lg border border-border bg-background/60 px-5 text-sm font-semibold text-muted-foreground",children:[e.jsx(ja,{className:"h-4 w-4"}),"Checkout coming soon"]})]})]})]})}function Mr({product:a,className:r=""}){return e.jsxs("section",{className:`grid min-w-0 max-w-full overflow-hidden rounded-lg border border-border bg-background/40 lg:grid-cols-[0.72fr_1.28fr] ${r}`,children:[e.jsxs("div",{className:"relative min-h-64 border-b border-border bg-background/40 lg:border-b-0 lg:border-r",children:[e.jsx(Aa,{product:a}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-background/85 via-background/20 to-transparent"}),e.jsxs("div",{className:"absolute bottom-0 left-0 right-0 p-5",children:[e.jsx("div",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-primary",children:a.category}),e.jsx("h2",{className:"mt-2 text-2xl font-semibold text-foreground",children:a.name})]})]}),e.jsxs("div",{className:"p-5 md:p-6",children:[e.jsxs("div",{className:"mb-6 flex items-start gap-3",children:[e.jsx("div",{className:"rounded-lg border border-border bg-background/50 p-2",children:e.jsx(bt,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-primary",children:"Asset allocation"}),e.jsxs("h2",{className:"mt-1 text-xl font-semibold",children:[a.name," purchase flow"]})]})]}),e.jsx("div",{className:"grid gap-3 sm:grid-cols-1",children:e.jsx(z,{label:"Your holdings",value:a.holdings,strong:!0})}),e.jsx("div",{className:"mt-5",children:e.jsx(ne,{label:"Asset performance score",value:a.performance,accent:`${a.performance}%`})}),e.jsxs("div",{className:"mt-5 grid gap-4 lg:grid-cols-[1fr_auto] lg:items-end",children:[e.jsxs("div",{className:"rounded-lg border border-border bg-background/40 p-4",children:[e.jsx("h3",{className:"font-semibold",children:"Asset metrics"}),e.jsx("ul",{className:"mt-3 grid gap-2 text-sm text-muted-foreground sm:grid-cols-3 lg:grid-cols-1",children:a.metrics.map(s=>e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(fa,{className:"h-4 w-4 text-primary"}),s]},s))})]}),e.jsxs("button",{type:"button",disabled:!0,className:"inline-flex h-11 items-center justify-center gap-2 rounded-lg border border-border bg-background/60 px-5 text-sm font-semibold text-muted-foreground",children:[e.jsx(ja,{className:"h-4 w-4"}),"Checkout coming soon"]})]})]})]})}function Ar(){return e.jsxs("div",{className:"grid gap-6 xl:grid-cols-[1fr_0.9fr]",children:[e.jsxs(S,{icon:Ca,eyebrow:"P&L 2026",title:"Financial summary",children:[e.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:ir.map(a=>e.jsx(z,{label:a.label,value:a.value,strong:!0},a.label))}),e.jsxs("div",{className:"mt-6 rounded-lg border border-border bg-background/40 p-5",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between gap-4",children:[e.jsx("h3",{className:"font-semibold",children:"Detailed P&L placeholder"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Accrual basis"})]}),[["Gross revenue","$719,232"],["Net revenue","$631,115"],["Operating costs and expenses","$363,710"],["EBITDA","$267,405"],["Income tax provision","$55,237"],["Net income","$212,168"]].map(([a,r])=>e.jsxs("div",{className:"flex items-center justify-between border-b border-border/70 py-3 text-sm last:border-0",children:[e.jsx("span",{className:"text-muted-foreground",children:a}),e.jsx("span",{className:"font-medium",children:r})]},a))]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(S,{icon:Ut,eyebrow:"Fundraising",title:"$580K pre-seed placeholder",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsx(z,{label:"Raised",value:"$300K",strong:!0}),e.jsx(z,{label:"Remaining",value:"$280K",strong:!0}),e.jsx(z,{label:"Cap",value:"$5.8M",strong:!0})]}),e.jsx("div",{className:"mt-6 space-y-4",children:dr.map(a=>e.jsx(ne,{label:`${a.label} - ${a.amount}`,value:a.value,accent:`${a.value}%`},a.label))})]}),e.jsx(S,{icon:ya,eyebrow:"Cap table",title:"Ownership structure",action:e.jsx(At,{className:"h-4 w-4 text-muted-foreground"}),children:e.jsx("div",{className:"space-y-3",children:cr.map(a=>e.jsxs("div",{className:"rounded-lg border border-border bg-background/40 p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("div",{className:"font-medium",children:a.holder}),e.jsx("div",{className:"font-display text-2xl text-primary",children:a.ownership})]}),e.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:a.notes})]},a.holder))})})]})]})}function $r(){return e.jsxs("div",{className:"grid gap-6 xl:grid-cols-[0.9fr_1.1fr]",children:[e.jsxs(S,{icon:Ie,eyebrow:"Founding member updates",title:"Monthly KPI dashboard",children:[e.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:[{label:"Total TCV",value:"$1.30M"},{label:"Avg TCV / month",value:"$130.4K"},{label:"Active clients",value:"145"},{label:"ARR Apr/26",value:"$1.58M"}].map(a=>e.jsx(z,{label:a.label,value:a.value,strong:!0},a.label))}),e.jsxs("div",{className:"mt-6 space-y-5",children:[e.jsx(ne,{label:"Active client retention",value:67,accent:"67.1%"}),e.jsx(ne,{label:"LTV / CAC",value:78,accent:"3.9x"}),e.jsx(ne,{label:"MRR growth projection",value:72,accent:"19.7% MoM"})]})]}),e.jsxs(S,{icon:ha,eyebrow:"Reports",title:"Monthly progress reports",children:[e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full min-w-[620px] text-left text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border text-xs uppercase tracking-[0.18em] text-muted-foreground",children:[e.jsx("th",{className:"pb-3 font-medium",children:"Month"}),e.jsx("th",{className:"pb-3 font-medium",children:"TCV"}),e.jsx("th",{className:"pb-3 font-medium",children:"New clients"}),e.jsx("th",{className:"pb-3 font-medium",children:"Active"}),e.jsx("th",{className:"pb-3 font-medium",children:"Churn"})]})}),e.jsx("tbody",{children:mr.map(a=>e.jsxs("tr",{className:"border-b border-border/70 last:border-0",children:[e.jsx("td",{className:"py-4 font-medium",children:a.month}),e.jsx("td",{className:"py-4 text-muted-foreground",children:a.tcv}),e.jsx("td",{className:"py-4 text-muted-foreground",children:a.clients}),e.jsx("td",{className:"py-4 text-muted-foreground",children:a.active}),e.jsx("td",{className:"py-4 text-muted-foreground",children:a.churn})]},a.month))})]})}),e.jsx("p",{className:"mt-5 text-sm leading-6 text-muted-foreground",children:"Founding member update cadence is set for the 1st of every month. Values are placeholders adapted from the asset-specific Founder Haus deal room."})]})]})}function Fr(){return e.jsxs("div",{className:"grid gap-6 xl:grid-cols-[1.05fr_0.95fr]",children:[e.jsx(S,{icon:ka,eyebrow:"Roadmap",title:"Strategic journey timeline",children:e.jsx("div",{className:"space-y-4",children:ur.map(a=>
1e.jsxs("div",{className:"grid gap-4 rounded-lg border border-border bg-background/40 p-5 sm:grid-cols-[120px_1fr]",children:[e.jsx("div",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-primary",children:a.date}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold",children:a.title}),e.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:a.body})]})]},a.title))})}),e.jsxs(S,{icon:Be,eyebrow:"Team and organogram",title:"Operating areas",children:[e.jsx("div",{className:"space-y-3",children:xr.map(a=>e.jsxs("div",{className:"rounded-lg border border-border bg-background/40 p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:a.area}),e.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:a.deliverable})]}),e.jsx("span",{className:"rounded-md border border-primary/30 bg-primary/10 px-2 py-1 text-xs text-primary",children:"KPI"})]}),e.jsx("div",{className:"mt-3 text-sm text-muted-foreground",children:a.kpi})]},a.area))}),e.jsxs("div",{className:"mt-6 rounded-lg border border-border bg-background/40 p-5",children:[e.jsx("h3",{className:"font-semibold",children:"Meeting cadence"}),e.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:"Weekly area syncs, monthly all-hands, and quarterly strategic planning. Meeting cards are placeholders for future agenda views and founding member-facing notes."})]})]})]})}function $a({metrics:a,loading:r=!1}){return r?e.jsx("div",{className:"grid gap-4 sm:grid-cols-2 xl:grid-cols-4",children:Array.from({length:a.length||4}).map((s,i)=>e.jsxs("div",{className:"rounded-lg border border-border bg-surface p-5","aria-hidden":"true",children:[e.jsxs("div",{className:"mb-5 flex items-center justify-between gap-4",children:[e.jsx("div",{className:"h-9 w-9 animate-pulse rounded-lg bg-muted/40"}),e.jsx("div",{className:"h-3 w-16 animate-pulse rounded bg-muted/40"})]}),e.jsx("div",{className:"h-9 w-28 animate-pulse rounded bg-muted/50"}),e.jsx("div",{className:"mt-3 h-4 w-32 animate-pulse rounded bg-muted/30"})]},i))}):e.jsx("div",{className:"grid gap-4 sm:grid-cols-2 xl:grid-cols-4",children:a.map(s=>e.jsxs("div",{className:"rounded-lg border border-border bg-surface p-5",children:[e.jsxs("div",{className:"mb-5 flex items-center justify-between gap-4",children:[e.jsx("div",{className:"rounded-lg border border-border bg-background/50 p-2",children:e.jsx(s.icon,{className:"h-5 w-5 text-primary"})}),(s.change||s.detail)&&e.jsx("span",{className:"text-xs font-medium text-primary",children:s.change??s.detail})]}),e.jsx("div",{className:"font-display text-4xl leading-none",children:s.value}),e.jsx("div",{className:"mt-2 text-sm text-muted-foreground",children:s.label})]},s.label))})}function S({icon:a,eyebrow:r,title:s,children:i,action:o,className:m=""}){return e.jsxs("section",{className:`min-w-0 rounded-lg border border-border bg-surface p-5 md:p-6 ${m}`,children:[e.jsxs("div",{className:"mb-6 flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"rounded-lg border border-border bg-background/50 p-2",children:e.jsx(a,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-primary",children:r}),e.jsx("h2",{className:"mt-1 text-xl font-semibold",children:s})]})]}),o]}),i]})}function le({label:a,value:r,options:s,onChange:i}){return e.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-border bg-background/45 p-1",children:[e.jsx("span",{className:"sr-only",children:a}),s.map(o=>{const m=o.value===r;return e.jsx("button",{onClick:()=>i(o.value),className:`h-8 rounded-md px-3 text-sm font-medium transition ${m?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-surface hover:text-foreground"}`,children:o.label},o.value)})]})}function Fa(a){return a.split(/[\s_-]+/).filter(Boolean).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")}function Y(a){if(!a)return"No date";const r=new Date(a);return Number.isNaN(r.getTime())?"No date":sr.format(r)}
1function ua(a){if(!a)return 0;const r=new Date(a).getTime();return Number.isNaN(r)?0:r}function re(a){return a.lumaJoinedAt??a.createdAt}function Da(a){return a.eventsAttended??0}function La(a){return a.eventsRegistered??0}function _e(a){return Math.max(Da(a),La(a))}function Te(a){return a==="investor"?"founding member":a}function se(a){const r=typeof a=="string"?a.trim().toLowerCase().replace(/[\s-]+/g,"_"):"";return r==="negotiating"||r==="in_negotiation"?"negotiation":I.includes(r)?r:"cold"}function Dr(a){return E[a]?.label??Fa(a)}function Lr(a){const r=a.source.split("+").map(o=>Fa(o.trim())).filter(Boolean),s=[`Stage: ${Dr(se(a.funnelStage))}`],i=a.preferredLanguage?[`Language: ${a.preferredLanguage}`]:[];return Array.from(new Set([...r,...s,...i,...a.categories]))}function Rr(a){const r=[a.membershipTier,a.source,a.searchText,...a.categories].filter(Boolean).join(" ").replace(/[_-]/g," ").toLowerCase(),s=[];return/\b(member|membership|resident|founder in residence|community)\b/.test(r)&&s.push("member"),/\b(founding member|investment|shareholder|token holder|tokenholder|lp|capital partner)\b/.test(r)&&s.push("founding-member"),s}function ne({label:a,value:r,accent:s}){return e.jsxs("div",{children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between gap-4 text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:a}),e.jsx("span",{className:"font-medium text-foreground",children:s??`${r}%`})]}),e.jsx("div",{className:"h-2 overflow-hidden rounded-full bg-background",children:e.jsx("div",{className:"h-full rounded-full bg-gradient-orange",style:{width:`${r}%`}})})]})}function z({label:a,value:r,strong:s=!1}){return e.jsxs("div",{className:"rounded-lg border border-border bg-background/40 p-3",children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:a}),e.jsx("div",{className:`mt-1 ${s?"text-lg":"text-sm"} font-semibold text-foreground`,children:r})]})}export{ms 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.