import{n as e,t}from"./jsx-runtime-BrKkGzFB.js";import{t as n}from"./plus-ButcMK4X.js";import{B as r,Dt as i,Et as a,h as o,i as s,r as c,st as l}from"./app-KzKSswgw.js";import{a as u,c as d,i as f,o as p,r as m}from"./app-page-BJMKIegZ.js";import{r as h}from"./utils-Bv0pu62v.js";import{MyInvestmentsTable as g}from"./my-investments-table-BP8s7dtU.js";var _=e(),v=t();function y(e){let t=(0,_.c)(36),{investments:o,balance_total:y,invested_active_total:x,withdrawable_total:S,invested_pending_total:C,invested_any:w}=e,T=Number(y),E;t[0]===T?E=t[1]:(E=h(T),t[0]=T,t[1]=E);let D=E,O=Number(x),k;t[2]===O?k=t[3]:(k=h(O),t[2]=O,t[3]=k);let A=k,j=Number(S),M;t[4]===j?M=t[5]:(M=h(j),t[4]=j,t[5]=M);let N=M,P=Number(C),F;t[6]===P?F=t[7]:(F=h(P),t[6]=P,t[7]=F);let I=F,L;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,v.jsx)(a,{title:`Mis inversiones`}),t[8]=L):L=t[8];let R;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,v.jsx)(p,{title:`Mis inversiones`,description:`Las ganancias se acreditan cada día sobre tu principal pactado; el principal permanece bloqueado hasta el vencimiento.`}),t[9]=R):R=t[9];let z;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,v.jsxs)(u,{children:[R,(0,v.jsx)(f,{children:(0,v.jsx)(r,{asChild:!0,children:(0,v.jsxs)(i,{href:`/invertir`,children:[(0,v.jsx)(n,{}),`Nueva inversión`]})})})]}),t[10]=z):z=t[10];let B;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,v.jsxs)(`h2`,{className:`flex items-center gap-2 text-xl font-bold`,children:[(0,v.jsx)(l,{className:`size-5`}),`Resumen rápido`]}),t[11]=B):B=t[11];let V;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,v.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Balance total`}),t[12]=V):V=t[12];let H;t[13]===D?H=t[14]:(H=(0,v.jsxs)(`p`,{className:`mt-1 text-lg font-semibold tabular-nums text-foreground`,children:[`$`,D]}),t[13]=D,t[14]=H);let U;t[15]!==A||t[16]!==N?(U=(0,v.jsxs)(`p`,{className:`mt-2 text-xs leading-relaxed text-muted-foreground`,children:[`Inversiones: $`,A,` | disponible para retiro: $`,N]}),t[15]=A,t[16]=N,t[17]=U):U=t[17];let W;t[18]!==H||t[19]!==U?(W=(0,v.jsxs)(`div`,{className:`rounded-xl bg-background p-4 text-center`,children:[V,H,U]}),t[18]=H,t[19]=U,t[20]=W):W=t[20];let G;t[21]===I?G=t[22]:(G=(0,v.jsx)(b,{highlight:`warning`,label:`Pendientes de confirmación`,value:I}),t[21]=I,t[22]=G);let K=String(o.length),q;t[23]===K?q=t[24]:(q=(0,v.jsx)(b,{label:`Registros`,value:K}),t[23]=K,t[24]=q);let J;t[25]!==W||t[26]!==G||t[27]!==q?(J=(0,v.jsx)(c,{className:d,children:(0,v.jsxs)(s,{className:`space-y-4 p-6`,children:[B,(0,v.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-3`,children:[W,G,q]})]})}),t[25]=W,t[26]=G,t[27]=q,t[28]=J):J=t[28];let Y;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(Y=(0,v.jsx)(`h2`,{className:`sr-only`,children:`Listado detallado`}),t[29]=Y):Y=t[29];let X;t[30]!==w||t[31]!==o?(X=(0,v.jsx)(c,{children:(0,v.jsxs)(s,{className:`space-y-6 p-6`,children:[Y,!w||o.length===0?(0,v.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-4 py-10 text-center`,children:[(0,v.jsx)(`p`,{className:`text-muted-foreground`,children:`Aún no tienes inversiones registradas.`}),(0,v.jsx)(r,{asChild:!0,children:(0,v.jsxs)(i,{href:`/invertir`,children:[(0,v.jsx)(n,{}),`Crear tu primera inversión`]})})]}):(0,v.jsx)(g,{investments:o})]})}),t[30]=w,t[31]=o,t[32]=X):X=t[32];let Z;return t[33]!==J||t[34]!==X?(Z=(0,v.jsxs)(v.Fragment,{children:[L,(0,v.jsxs)(m,{children:[z,J,X]})]}),t[33]=J,t[34]=X,t[35]=Z):Z=t[35],Z}function b(e){let t=(0,_.c)(8),{label:n,value:r,highlight:i}=e,a=i===`warning`?`text-primary`:`text-foreground`,o;t[0]===n?o=t[1]:(o=(0,v.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n}),t[0]=n,t[1]=o);let s=`mt-1 text-lg font-semibold tabular-nums ${a}`,c;t[2]!==s||t[3]!==r?(c=(0,v.jsx)(`p`,{className:s,children:r}),t[2]=s,t[3]=r,t[4]=c):c=t[4];let l;return t[5]!==o||t[6]!==c?(l=(0,v.jsxs)(`div`,{className:`rounded-xl bg-background p-4 text-center`,children:[o,c]}),t[5]=o,t[6]=c,t[7]=l):l=t[7],l}y.layout={breadcrumbs:[{title:`Inicio`,href:o()},{title:`Mis inversiones`,href:`/mis-inversiones`}]};export{y as default};