PageSourceSearch

https://propvault.com/assets/investor-CexxQdcO.js

js propvault.com collected 2026-10-09 22:58:34 UTC 16,450 bytes, 1 lines download raw bytes

1import{u as H,a as W,c as O,l as B,b as z,r as P,C as j,e as M,i as Y,j as e,f as I,m as K,n as U}from"./index-BfBkqBNq.js";import{u as X,D as Q,T as C,e as G}from"./DashboardLayout-CA1yfd_w.js";import{C as Z}from"./CollapsibleSection-DPgMXAFj.js";import{S as F}from"./DashboardCharts-r47fp6vX.js";import{f as v,a as T}from"./triangle-alert-eBrbmV7z.js";import{r as N}from"./operating-coc-view-whQn7sjq.js";import{F as J}from"./FailureDetail-C15zjOsa.js";import{D as A}from"./download-CUTv8xUj.js";import{B as ee}from"./building-2-BMaXS4Y1.js";import{A as te}from"./arrow-right-B8mhqEms.js";import"./report-xlsx-0elmp6kq.js";import"./x-mOM0OqM8.js";import"./printer--topBers.js";import"./index-Du5FxyQ2.js";import"./PropVaultLogo-CExv2j-M.js";import"./invites.functions-BP_ptYw7.js";const re=t=>U(t),R=t=>t==null?"—":`${t.toFixed(2)}×`,_=t=>t==null?"—":`${t.toFixed(1)}%`,q=t=>t==null?"—":`${(t*100).toFixed(1)}%`,E=t=>t==null?"—":v(t);function ke(){const{user:t,loading:o}=H(),a=W(),d=O(B),{data:s}=z(),[r,c]=X();P.useEffect(()=>{!o&&!t&&a({to:"/login"})},[o,t,a]),P.useEffect(()=>{j.INVESTOR_HOME||a({to:"/dashboard",replace:!0})},[a]);const h=j.INVESTOR_HOME_WORKSPACE_SCOPE?r==="all"?{allWorkspaces:!0}:s?.id?{orgId:s.id}:void 0:void 0,l=M({queryKey:["my-investor-positions",h??null],queryFn:()=>d({data:{scope:h}}),enabled:j.INVESTOR_HOME&&!!t&&(!j.INVESTOR_HOME_WORKSPACE_SCOPE||r==="all"||!!s?.id)});if(o||!t||!j.INVESTOR_HOME)return null;const m=r==="all",f=s?.name??"this workspace",u=Y(s?.role);return e.jsx(Q,{children:e.jsxs("div",{className:"mx-auto max-w-5xl space-y-6",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-semibold text-foreground",children:m?"All My Investments":"My Portfolio"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:m?"Your equity positions across every workspace.":`Your equity positions in ${f}.`})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[e.jsx(I,{to:"/investor-overview",className:"inline-flex items-center gap-1.5 rounded-md border border-border bg-background px-3 py-1.5 text-xs font-medium text-muted-foreground hover:text-foreground",children:"Overview"}),j.INVESTOR_PORTFOLIO_PACKET&&l.data&&l.data.positions.length>=2&&e.jsxs(I,{to:"/reports/portfolio-packet",className:"inline-flex items-center gap-1.5 rounded-md border border-border bg-background px-3 py-1.5 text-xs font-medium text-muted-foreground hover:text-foreground",children:[e.jsx(A,{className:"h-3.5 w-3.5"})," Portfolio packet"]}),j.INVESTOR_BULK_EXPORT&&e.jsxs(I,{to:"/reports/my-packets-all",className:"inline-flex items-center gap-1.5 rounded-md border border-border bg-background px-3 py-1.5 text-xs font-medium text-muted-foreground hover:text-foreground",children:[e.jsx(A,{className:"h-3.5 w-3.5"})," Download all my reports"]}),j.INVESTOR_HOME_WORKSPACE_SCOPE&&m&&e.jsxs("button",{type:"button",onClick:()=>c("workspace"),className:"rounded-md border border-border bg-background px-3 py-1.5 text-xs font-medium text-muted-foreground hover:text-foreground",children:["Back to ",f]})]})]}),l.isLoading?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-primary border-t-transparent"})}):l.isError?e.jsx("div",{className:"rounded-lg border border-border bg-card p-4",children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:["We couldn't load your portfolio right now."," ",e.jsx(J,{error:l.error})]})}):!l.data||l.data.positions.length===0?e.jsx(ae,{data:l.data,isUnion:m,workspaceName:f,onSeeAll:()=>c("all")}):j.INVESTOR_EXPERIENCE?e.jsx(ne,{initial:l.data,scope:h,isUnion:m}):e.jsx(ie,{data:l.data,isUnion:m,isManager:u}),l.data&&l.data.positions.length>0&&e.jsx(oe,{})]})})}function se(t){const[o,a]=t.split("-").map(Number);return!o||!a?t:new Date(Date.UTC(o,a-1,1)).toLocaleDateString("en-US",{month:"short",year:"numeric",timeZone:"UTC"})}function oe(){const t=O(K),o=M({queryKey:["my-portfolio-timeseries"],queryFn:()=>t({data:{}}),retry:!1}),[a,d]=P.useState("12");if(o.isLoading||o.isError||!o.data)return null;const s=o.data;if(s.properties.length===0||s.months.length===0)return null;const r=a==="12"?s.months.slice(-12):s.months,c=r.map(se),h=s.properties.map((n,x)=>({key:n.participantId,label:n.propertyName,color:`var(--chart-${x%5+1})`})),l=Array.from(new Map(s.properties.map(n=>[n.propertyId,n])).values()),m=l.map((n,x)=>({key:n.propertyId,label:n.propertyName,color:`var(--chart-${x%5+1})`})),f={};for(const n of s.properties){const x=new Map(n.distributions.map(b=>[b.month,b.amount]));f[n.participantId]=r.map(b=>x.get(b)??0)}const u={};for(const n of l){const x=new Map(n.performance.map(b=>[b.month,b.noi]));u[n.propertyId]=r.map(b=>x.get(b)??0)}const g=(n,x)=>e.jsx("button",{type:"button",role:"tab","aria-selected":a===n,onClick:()=>d(n),className:`px-2.5 py-1 text-[11.5px] font-medium transition-colors first:pl-3 last:pr-3 ${a===n?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,children:x});return e.jsxs("section",{className:"space-y-4 rounded-lg border border-border bg-card p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-foreground",children:[e.jsx(C,{className:"mr-1.5 inline h-4 w-4 text-primary"})," Performance over time"]}),e.jsxs("div",{role:"tablist","aria-label":"Performance range",className:"inline-flex overflow-hidden rounded-md border border-border bg-background",children:[g("12","Last 12 mo"),e.jsx("span",{className:"border-l border-border"}),g("all","Property lifetime")]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-[13px] font-semibold text-foreground",children:"Distributions to you"}),e.jsx("p",{className:"mb-2.5 mt-0.5 text-[11.5px] text-muted-foreground",children:"What you received each month · by property · click legend to show/hide"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsx(F,{monthLabels:c,series:h,values:f,valueFormatter:T,ariaLabel:"Distributions to you by property over time",labelEveryMonth:!0})})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-[13px] font-semibold text-foreground",children:"Net operating income"}),e.jsx("p",{className:"mb-2.5 mt-0.5 text-[11.5px] text-muted-foreground",children:"Monthly NOI for each property you hold a stake in · by property · click legend to show/hide"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsx(F,{monthLabels:c,series:m,values:u,valueFormatter:T,ariaLabel:"Net operating income by property over time",labelEveryMonth:!0})})]})]})}function ae({data:t,isUnion:o,workspaceName:a,onSeeAll:d}){const s=t?.workspaceScope,r=s&&s.mode==="workspace"?s.scopedPositionCount===0?s.workspaceCount:Math.max(0,s.workspaceCount-1):0,c=!o&&s&&s.mode==="workspace"&&s.totalPositionCount>0&&s.scopedPositionCount===0;return e.jsxs("div",{className:"rounded-lg border border-dashed border-border bg-card/50 py-20 text-center",children:[e.jsx(ee,{className:"mx-auto mb-3 h-8 w-8 text-muted-foreground
1/50"}),c?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["No investments in ",a,"."]}),e.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["You hold ",s.totalPositionCount," position",s.totalPositionCount===1?"":"s"," across ",r," ","other workspace",r===1?"":"s","."]}),e.jsxs("button",{type:"button",onClick:d,className:"mt-4 inline-flex items-center gap-1.5 rounded-md border border-border bg-background px-3 py-1.5 text-xs font-medium text-foreground hover:bg-muted/40",children:[e.jsx(C,{className:"h-3.5 w-3.5"})," See All My Investments"]})]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"You don't have any investor positions yet."}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Once a property owner links your login to an equity stake, it will appear here."})]})]})}function ne({initial:t,scope:o,isUnion:a}){const d=O(B),s=G(),r=P.useMemo(()=>{const i=new Set;for(const y of t.positions)i.add(re(y));return[...i].sort((y,k)=>y.localeCompare(k))},[t]),[c,h]=P.useState(null),l=c!=null&&c.length>0&&c.length<r.length,m=M({queryKey:["my-investor-positions","subset",o??null,c],queryFn:()=>d({data:{entityNames:c??[],scope:o}}),enabled:l}),f=l&&m.data?m.data:t,{rollup:u,positions:g}=f,n=g.map(i=>i.navAsOf).filter(i=>!!i),x=n.length>0?n.slice().sort().at(-1)??null:null,b=new Set(n).size>1,V=i=>{h(y=>{const k=y??r,S=k.includes(i)?k.filter($=>$!==i):[...k,i];return S.length===r.length||S.length===0?null:S})},L=i=>c==null?!0:c.includes(i);return e.jsxs(e.Fragment,{children:[x&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Values as of ",x,b?" · values reflect each property's latest valuation":""]}),r.length>1&&e.jsxs("div",{className:"flex flex-wrap items-center gap-2 rounded-lg border border-border bg-card px-4 py-3",children:[e.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Investing as"}),r.map(i=>{const y=L(i);return e.jsxs("button",{type:"button",onClick:()=>V(i),className:`rounded-full border px-3 py-1 text-xs font-medium transition-colors ${y?"border-primary/50 bg-primary/10 text-foreground":"border-border bg-background text-muted-foreground hover:text-foreground"}`,"aria-pressed":y,children:[y?"✓ ":"",i]},i)})]}),e.jsxs("section",{className:"rounded-lg border border-border bg-card",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-sm font-semibold text-foreground",children:[e.jsx(C,{className:"mr-1.5 inline h-4 w-4 text-primary"})," Portfolio roll-up"]}),e.jsxs("p",{className:"mt-0.5 text-xs text-muted-foreground",children:[g.length," propert",g.length===1?"y":"ies",l?" · filtered":""]})]}),l&&m.isLoading&&e.jsx("span",{className:"text-xs text-muted-foreground",children:"Recomputing…"})]}),e.jsxs("div",{className:"grid gap-3 p-4 sm:grid-cols-2 lg:grid-cols-3",children:[e.jsx(p,{label:"Total invested",value:v(u.contributed)}),e.jsx(p,{label:"Distributions received",value:v(u.distributed)}),e.jsx(p,{label:"Current value of stakes",value:E(u.unrealizedValue)}),e.jsx(p,{label:"Blended IRR",value:_(u.irrPct),hint:u.irrPct==null?"not enough history":void 0}),e.jsx(p,{label:"Blended cash-on-cash",value:q(N(u).ratio),hint:N(u).disclosure??void 0}),e.jsx(p,{label:"Blended equity multiple",value:R(u.equityMultiple)})]}),f.valuationBasis==="equity_contributed_proxy"&&f.valuationNote&&e.jsx("p",{className:"border-t border-border px-4 py-2 text-xs italic text-amber-700 dark:text-amber-500",children:f.valuationNote})]}),e.jsx(Z,{title:"How your return is calculated",icon:e.jsx(C,{className:"h-4 w-4"}),children:e.jsxs("div",{className:"space-y-2 px-1 pb-1 text-sm text-muted-foreground",children:[e.jsx("p",{children:"Your blended return reflects the timing and size of the money you put in across every position, the money you've received back, and the current value of your stakes."}),e.jsxs("ul",{className:"ml-4 list-disc space-y-1",children:[e.jsxs("li",{children:["You've invested"," ",e.jsx("span",{className:"font-medium text-foreground",children:v(u.contributed)})," ","across ",g.length," propert",g.length===1?"y":"ies","."]}),e.jsxs("li",{children:["You've received"," ",e.jsx("span",{className:"font-medium text-foreground",children:v(u.distributed)})," ","in distributions — these are already"," ",e.jsx("span",{className:"font-medium text-foreground",children:"after the sponsor's share"}),"."]}),e.jsxs("li",{children:["Your stakes are currently worth"," ",e.jsx("span",{className:"font-medium text-foreground",children:E(u.unrealizedValue)}),", based on each property's latest net asset value × your ownership."]})]})]})}),e.jsx("section",{className:"grid gap-3 sm:grid-cols-2",children:g.map(i=>e.jsx(D,{position:i,entityPrimary:!0,showWorkspace:a,onActivate:()=>s({propertyId:i.propertyId,organizationId:i.organizationId})},i.participantId))})]})}function ie({data:t,isUnion:o,isManager:a}){const{rollup:d,positions:s}=t;return e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"rounded-lg border border-border bg-card",children:[e.jsxs("div",{className:"border-b border-border px-4 py-3",children:[e.jsxs("h2",{className:"text-sm font-semibold text-foreground",children:[e.jsx(C,{className:"mr-1.5 inline h-4 w-4 text-primary"})," Portfolio roll-up"]}),e.jsxs("p",{className:"mt-0.5 text-xs text-muted-foreground",children:[s.length," propert",s.length===1?"y":"ies"]})]}),e.jsxs("div",{className:"grid gap-3 p-4 sm:grid-cols-2 lg:grid-cols-3",children:[e.jsx(p,{label:"Total invested",value:v(d.contributed)}),e.jsx(p,{label:"Distributions received",value:v(d.distributed)}),e.jsx(p,{label:"Current value of stakes",value:E(d.unrealizedValue)}),e.jsx(p,{label:"Blended IRR",value:_(d.irrPct),hint:d.irrPct==null?"not enough history":void 0}),e.jsx(p,{label:"Blended cash-on-cash",value:q(N(d).ratio),hint:N(d).disclosure??void 0}),e.jsx(p,{label:"Blended equity multiple",value:R(d.equityMultiple)})]}),t.valuationBasis==="equity_contributed_proxy"&&t.valuationNote&&e.jsx("p",{className:"border-t border-border px-4 py-2 text-xs italic text-amber-700 dark:text-amber-500",children:t.valuationNote})]}),e.jsx("section",{className:"grid gap-3 sm:grid-cols-2",children:s.map(r=>e.jsx(D,{position:r,showWorkspace:o,isManager:a},r.participantId))})]})}function D({position:t,entityPrimary:o=!1,showWorkspace:a=!1,onActivate:d,isManager:s=!1}){const r=t,c="group rounded-lg border border-border bg-card p-4 transition-colors hover:border-primary/50 hover:bg-muted/30",h=e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"truncate font-semibold text-foreground",children:r.propertyName}),a&&e.jsx("p",{className:"truncate text-[11px] uppercase tracking-wide text-muted-foreground",children:r.workspaceName??"Unknown workspace"}),o&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"truncate text-xs font-medium text-foreground",children:r.entityName??e.jsx("span",{className:"text-muted-foreground",children:"Personal (no entity)"})}),e.jsx("p",{className:"truncate text-xs text-muted-foreground",children:r.participantName})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[Number(r.ownershipPercentage).toFixed(2),"% equity stake",r.navAsOf?` · value as of ${r.navAsOf}`:""]})]}),e.jsx(te,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-hover:translate-x-0.5"})]}),e.jsxs("div",{className:"mt-3 grid grid-cols-3 gap-2",children:[e.jsx(w,{label:"Invested",value:v(r.contributed)}),e.jsx(w,{label:"Distributed",value:v(r.distributed)}),e.jsx(w,{label:"Current value",value:E(r.unrealizedValue)}),e.jsx(w,{label:"IRR",value:_(r.irrPct)}),e.jsx(w,{label:"Cash-on-cash",value:q(N(r).ratio)}
1),e.jsx(w,{label:"Equity mult.",value:R(r.equityMultiple)})]}),N(r).disclosure&&e.jsx("p",{className:"mt-2 text-[11px] text-muted-foreground",children:N(r).disclosure}),r.valuationBasis==="equity_contributed_proxy"&&r.valuationNote&&e.jsx("p",{className:"mt-2 text-[11px] italic text-amber-700 dark:text-amber-500",children:r.valuationNote})]});return d?e.jsx("button",{type:"button",onClick:d,className:`${c} flex w-full flex-col items-start justify-start text-left`,children:h}):s?e.jsx(I,{to:"/properties/$propertyId",params:{propertyId:r.propertyId},className:c,children:h}):e.jsx(I,{to:"/properties/$propertyId/investor",params:{propertyId:r.propertyId},className:c,children:h})}function p({label:t,value:o,hint:a}){return e.jsxs("div",{className:"rounded-md border border-border bg-background p-3",children:[e.jsx("p",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:t}),e.jsx("p",{className:"mt-1 text-xl font-semibold text-foreground",children:o}),a&&e.jsx("p",{className:"mt-0.5 text-[11px] text-muted-foreground",children:a})]})}function w({label:t,value:o}){return e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:t}),e.jsx("p",{className:"mt-0.5 text-sm font-semibold text-foreground",children:o})]})}export{ke 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.