import{t as e}from"./jsx-runtime-B6e-FjZo.js";import{t}from"./arrow-up-right-CexZMVf0.js";import{Ar as n,nr as r}from"./app-figJB8d1.js";import{t as i}from"./card-GiWUhIM5.js";var a=r(`ArrowDownRight`,[[`path`,{d:`m7 7 10 10`,key:`1fmybs`}],[`path`,{d:`M17 7v10H7`,key:`6fjiku`}]]),o=n(),s=e();function c(e){let t=(0,o.c)(19),{values:n,accent:r,width:i,height:a}=e,c=i===void 0?96:i,l=a===void 0?28:a;if(n.length===0)return null;let u=Math.max(1,...n),d=c/Math.max(1,n.length-1),f;if(t[0]!==l||t[1]!==u||t[2]!==d||t[3]!==n){let e;t[5]!==l||t[6]!==u||t[7]!==d?(e=(e,t)=>`${(t*d).toFixed(1)},${(l-e/u*l).toFixed(1)}`,t[5]=l,t[6]=u,t[7]=d,t[8]=e):e=t[8],f=n.map(e).join(` `),t[0]=l,t[1]=u,t[2]=d,t[3]=n,t[4]=f}else f=t[4];let p=f,m=`0,${l} ${p} ${c},${l}`,h=`0 0 ${c} ${l}`,g;t[9]!==r||t[10]!==m?(g=(0,s.jsx)(`polygon`,{points:m,fill:r,fillOpacity:`0.12`}),t[9]=r,t[10]=m,t[11]=g):g=t[11];let _;t[12]!==r||t[13]!==p?(_=(0,s.jsx)(`polyline`,{points:p,fill:`none`,stroke:r,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`}),t[12]=r,t[13]=p,t[14]=_):_=t[14];let v;return t[15]!==h||t[16]!==g||t[17]!==_?(v=(0,s.jsxs)(`svg`,{viewBox:h,className:`h-7 w-20 shrink-0 sm:w-24`,preserveAspectRatio:`none`,"aria-hidden":!0,children:[g,_]}),t[15]=h,t[16]=g,t[17]=_,t[18]=v):v=t[18],v}function l(e,t){if(t===0)return{dir:`flat`,pct:0};let n=Math.round((e-t)/t*100);return n===0?{dir:`flat`,pct:0}:{dir:n>0?`up`:`down`,pct:Math.abs(n)}}function u(e){let n=(0,o.c)(25),{label:r,value:l,sub:u,icon:d,iconTone:f,series:p,accent:m,trendData:h}=e,g=`rounded-lg p-2 ${f}`,_;n[0]!==d||n[1]!==g?(_=(0,s.jsx)(`div`,{className:g,children:d}),n[0]=d,n[1]=g,n[2]=_):_=n[2];let v;n[3]===h?v=n[4]:(v=h&&h.dir!==`flat`&&(0,s.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 rounded-full px-2 py-0.5 text-[11px] font-medium ${h.dir===`up`?`bg-emerald-500/10 text-emerald-700 dark:text-emerald-400`:`bg-rose-500/10 text-rose-700 dark:text-rose-400`}`,children:[h.dir===`up`?(0,s.jsx)(t,{className:`size-3`}):(0,s.jsx)(a,{className:`size-3`}),h.pct,`%`]}),n[3]=h,n[4]=v);let y;n[5]!==_||n[6]!==v?(y=(0,s.jsxs)(`div`,{className:`flex items-start justify-between`,children:[_,v]}),n[5]=_,n[6]=v,n[7]=y):y=n[7];let b;n[8]===r?b=n[9]:(b=(0,s.jsx)(`p`,{className:`mt-3 text-xs leading-tight font-medium tracking-wider text-muted-foreground uppercase`,children:r}),n[8]=r,n[9]=b);let x;n[10]===l?x=n[11]:(x=(0,s.jsx)(`p`,{className:`mt-1 text-2xl font-semibold tracking-tight tabular-nums sm:text-3xl`,children:l}),n[10]=l,n[11]=x);let S;n[12]===u?S=n[13]:(S=u&&(0,s.jsx)(`p`,{className:`min-w-0 text-xs text-muted-foreground`,children:u}),n[12]=u,n[13]=S);let C;n[14]!==m||n[15]!==p?(C=p&&m&&(0,s.jsx)(c,{values:p,accent:m}),n[14]=m,n[15]=p,n[16]=C):C=n[16];let w;n[17]!==S||n[18]!==C?(w=(0,s.jsxs)(`div`,{className:`mt-1 flex min-w-0 flex-col gap-2 sm:flex-row sm:items-end sm:justify-between`,children:[S,C]}),n[17]=S,n[18]=C,n[19]=w):w=n[19];let T;return n[20]!==y||n[21]!==b||n[22]!==x||n[23]!==w?(T=(0,s.jsxs)(i,{className:`relative min-w-0 overflow-hidden p-4 sm:p-5`,children:[y,b,x,w]}),n[20]=y,n[21]=b,n[22]=x,n[23]=w,n[24]=T):T=n[24],T}export{l as n,c as r,u as t};