PageSourceSearch

https://finthos.ai/assets/CapitalCallsCalendar-Dg3vei8S.js

js finthos.ai collected 2026-10-05 11:59:50 UTC 6,840 bytes, 1 lines download raw bytes

1import{j as e,R as o,B as i,V as _,g as k}from"./index-g4WugBH4.js";import{r as T}from"./react-BpdGtorb.js";import{u as $,b as P}from"./useCapitalCalls-DGRTnTfA.js";import{f as c}from"./privateMarketCalculations-BBLA8rWW.js";import{C as p}from"./calendar-D_26tjgl.js";import{C as z}from"./clock-DMevmvOF.js";import{W as S}from"./wallet-HpDRxlz2.js";import{C as U}from"./chevron-left-CNuhV7no.js";import{s as x,a as B}from"./startOfMonth-DrI67C0Y.js";import{e as h}from"./endOfMonth-TCNI7KCh.js";import{f as u}from"./format-BpOyM-BW.js";import{s as O}from"./subMonths-grsZku1C.js";import{d as R}from"./differenceInDays-BiuGPnlW.js";import"./charts-VqRjxJBw.js";import"./supabase-DRR_Es6B.js";import"./useEffectiveUserId-Cw4gMied.js";import"./getTimezoneOffsetInMilliseconds-B9UnuQsa.js";import"./en-US-Bfz1jvxT.js";import"./differenceInCalendarDays-CZ0qhtMk.js";function ae(){const[l,m]=T.useState(new Date),{data:N,isLoading:y}=$(365),b=P();if(y)return e.jsxs("div",{className:"p-6 space-y-6",children:[e.jsx(o,{className:"h-10 w-64"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[1,2,3].map(s=>e.jsx(o,{className:"h-32"},s))}),e.jsx(o,{className:"h-96"})]});const r=N||[],d=new Date,v=r.filter(s=>{const t=new Date(s.due_date);return t>=x(d)&&t<=h(d)}).reduce((s,t)=>s+t.call_amount,0),g=r.filter(s=>{const t=new Date(s.due_date);return t>=x(d)&&t<=h(d)}).length,D=r.filter(s=>{const t=new Date(s.due_date),a=new Date;return a.setDate(a.getDate()+90),t>=d&&t<=a}).reduce((s,t)=>s+t.call_amount,0),j=r.filter(s=>{const t=new Date(s.due_date),a=new Date;return a.setDate(a.getDate()+90),t>=d&&t<=a}).length,w=r.reduce((s,t)=>s+t.call_amount,0),f=r.filter(s=>{const t=new Date(s.due_date);return t>=x(l)&&t<=h(l)});return e.jsxs("div",{className:"p-6 space-y-6",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl font-bold text-charcoal flex items-center gap-2",children:[e.jsx(p,{className:"h-6 w-6 text-amber-500"}),"Capital Calls Calendar"]}),e.jsx("p",{className:"text-muted-grey text-sm mt-1",children:"Track and manage your upcoming capital call obligations"})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 md:gap-6",children:[e.jsxs("div",{className:"bg-gradient-to-br from-amber-500/20 to-orange-500/20 p-5 md:p-6 rounded-xl border border-amber-500/30 shadow-lg",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("h3",{className:"text-amber-600 font-medium text-sm",children:"Due This Month"}),e.jsx(p,{className:"w-5 h-5 text-amber-500"})]}),e.jsxs("div",{className:"text-2xl md:text-3xl font-bold text-charcoal mb-1",children:["€",c(v)]}),e.jsxs("div",{className:"text-xs text-muted-grey",children:[g," capital call",g!==1?"s":""]})]}),e.jsxs("div",{className:"bg-gradient-to-br from-orange-500/20 to-red-500/20 p-5 md:p-6 rounded-xl border border-orange-500/30 shadow-lg",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("h3",{className:"text-orange-600 font-medium text-sm",children:"Due Next 90 Days"}),e.jsx(z,{className:"w-5 h-5 text-orange-500"})]}),e.jsxs("div",{className:"text-2xl md:text-3xl font-bold text-charcoal mb-1",children:["€",c(D)]}),e.jsxs("div",{className:"text-xs text-muted-grey",children:[j," capital call",j!==1?"s":""]})]}),e.jsxs("div",{className:"bg-gradient-to-br from-blue-500/20 to-cyan-500/20 p-5 md:p-6 rounded-xl border border-blue-500/30 shadow-lg",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("h3",{className:"text-blue-600 font-medium text-sm",children:"Total Outstanding"}),e.jsx(S,{className:"w-5 h-5 text-blue-500"})]}),e.jsxs("div",{className:"text-2xl md:text-3xl font-bold text-charcoal mb-1",children:["€",c(w)]}),e.jsxs("div",{className:"text-xs text-muted-grey",children:[r.length," scheduled call",r.length!==1?"s":""]})]})]}),e.jsxs("div",{className:"bg-white p-6 rounded-xl border border-soft-border shadow-sm",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("h3",{className:"text-lg font-semibold text-charcoal",children:u(l,"MMMM yyyy")}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(i,{variant:"outline",size:"icon",onClick:()=>m(O(l,1)),children:e.jsx(U,{className:"h-4 w-4"})}),e.jsx(i,{variant:"outline",size:"sm",onClick:()=>m(new Date),children:"Today"}),e.jsx(i,{variant:"outline",size:"icon",onClick:()=>m(B(l,1)),children:e.jsx(_,{className:"h-4 w-4"})})]})]}),f.length===0?e.jsxs("div",{className:"py-12 text-center text-muted-grey",children:["No capital calls due in ",u(l,"MMMM yyyy")]}):e.jsx("div",{className:"space-y-3",children:f.map(s=>{const t=new Date(s.due_date),a=R(t,d),n=a<0,C=n?"border-red-500 bg-red-50":a<=7?"border-red-300 bg-red-50/50":a<=30?"border-amber-300 bg-amber-50/50":"border-blue-300 bg-blue-50/50",M=n||a<=7?"bg-red-100 text-red-700 border-red-200":a<=30?"bg-amber-100 text-amber-700 border-amber-200":"bg-blue-100 text-blue-700 border-blue-200";return e.jsx("div",{className:`p-4 rounded-lg border-l-4 ${C} transition-colors`,children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("span",{className:`w-2.5 h-2.5 rounded-full ${n||a<=7?"bg-red-500 animate-pulse":a<=30?"bg-amber-500":"bg-blue-500"}`}),e.jsx("h4",{className:"font-semibold text-charcoal",children:s.investment_name}),s.fund_manager&&e.jsxs("span",{className:"text-sm text-muted-grey",children:["• ",s.fund_manager]})]}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mt-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-grey mb-1",children:"Call Amount"}),e.jsxs("div",{className:"font-semibold text-charcoal",children:["€",c(s.call_amount)]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-grey mb-1",children:"Due Date"}),e.jsx("div",{className:"font-semibold text-charcoal",children:u(t,"MMM d, yyyy")})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-grey mb-1",children:"Days Until Due"}),e.jsx("div",{className:`font-semibold ${n||a<=7?"text-red-600":a<=30?"text-amber-600":"text-blue-600"}`,children:n?`${Math.abs(a)} days overdue`:`${a} days`})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-grey mb-1",children:"Status"}),e.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium border ${M}`,children:s.status})]})]})]}),e.jsx("div",{className:"flex gap-2",children:s.status!=="paid"&&e.jsxs(i,{size:"sm",className:"bg-emerald-600 hover:bg-emerald-700 text-white",onClick:()=>b.mutate(s.id),disabled:b.isPending,children:[e.jsx(k,{className:"h-4 w-4 mr-1"}),"Mark Paid"]})})]})},s.id)})})]})]})}export{ae as default};

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.