import{d as D,r as N,k as s,a9 as c,o as i,E as d,G as C,a as l,A as w,M as h,L as m,H as A,N as E,z as u}from"./vue.6daa721c.js";import{T as G}from"./index.abe7750b.js";import{_ as H}from"./_plugin-vue_export-helper.c27b6911.js";const L={class:"metric-value"},U={class:"metric-pre"},j=D({name:"MCard",__name:"mCard",props:{modelValue:{},metricItems:{},color:{}},emits:["update:modelValue","change-metric"],setup(x,{emit:k}){const t=x,p=k,n=N(t.modelValue),B=(e,a)=>{p("update:modelValue",e),p("change-metric",e,a)},o=s(()=>{const e=t.metricItems.find(a=>a.value===n.value);return e||null}),b=s(()=>{const e={"border-top-color":"rgb(232, 244, 255)"};return t.color&&(e["border-top-color"]=t.color),e}),_=s(()=>{var e;return(((e=o.value)==null?void 0:e.gapVal)??-1)>0}),r=s(()=>_.value?"green":"red");return(e,a)=>{const S=c("Top"),T=c("Bottom"),I=c("el-icon"),M=c("el-card");return i(),d(M,{class:"metric-card"},{default:C(()=>{var v,f,V,g,y;return[l("div",{class:"metric-card__color",style:w(b.value)},null,4),h(G,{modelValue:n.value,"onUpdate:modelValue":a[0]||(a[0]=z=>n.value=z),options:t.metricItems,onChange:B},null,8,["modelValue","options"]),l("div",L,m((v=o.value)==null?void 0:v.metricVal),1),l("div",U,[l("span",null,m((f=o.value)==null?void 0:f.preVal)+"  ",1),A(h(I,{style:{display:"inline-block","padding-top":"2px"}},{default:C(()=>[_.value?(i(),d(S,{key:0,class:u(r.value)},null,8,["class"])):(i(),d(T,{key:1,class:u(r.value)},null,8,["class"]))]),_:1},512),[[E,(V=o.value)==null?void 0:V.gapVal]]),l("span",{class:u(r.value)},m((g=o.value)!=null&&g.gapVal?((y=o.value)==null?void 0:y.gapVal)+"%":""),3)])]}),_:1})}}});const K=H(j,[["__scopeId","data-v-a765336d"]]);export{K as default};
