import{b as i,E as N,j as n,B as u,q as a,aw as d}from"./index-ktJf6c6X.js";const f={UPCOMING:"#ab9e16",ACTIVE:"#3b82f6",ACHIEVED:"#10b981",CLOSED:"#a41010"},C=e=>(e||"").replace(/_/g," ").replace(/\b\w/g,t=>t.toUpperCase()),y=e=>e?new Date(e).toLocaleDateString("en-GB"):"—",p=e=>`₹${Number(e||0).toLocaleString("en-IN",{maximumFractionDigits:2})}`,g=(e,t)=>{const r=Number(t||0);return r<=0?0:Math.round(Number(e||0)/r*100)},S=({status:e})=>{const t=e||"ACTIVE",r=f[t]||"#6b7280";return i(N,{label:C(t),size:"small",sx:{bgcolor:`${r}1a`,color:r,fontWeight:600,border:`1px solid ${r}55`}})},M=({label:e,achieved:t,target:r,money:c})=>{const o=Number(r||0)>0,b=g(t,r),s=o&&Number(t||0)>Number(r||0),l=m=>c?p(m):String(Number(m||0)),x=s?"#10b981":"#3b82f6";return n(u,{sx:{mb:1},children:[n(u,{sx:{display:"flex",justifyContent:"space-between",alignItems:"baseline"},children:[i(a,{variant:"caption",color:"text.secondary",children:e}),n(a,{variant:"caption",fontWeight:600,color:o?"text.primary":"text.disabled",children:[o?`${l(t)} / ${l(r)}`:"—",o&&n(a,{component:"span",variant:"caption",color:s?"success.main":"text.secondary",sx:{ml:.5},children:["(",b,"%",s?` · +${c?p(Number(t)-Number(r)):Number(t)-Number(r)} over`:"",")"]})]})]}),i(d,{variant:"determinate",value:Math.min(b,100),sx:{height:6,borderRadius:3,mt:.3,opacity:o?1:.35,"& .MuiLinearProgress-bar":{backgroundColor:x}}})]})};export{M,S,y as f};
