import{d as D,r as N,k as s,a8 as c,o as i,E as m,G as C,a as l,A as w,M as h,L as u,H as A,N as E,z as d}from"./vue.95e072e2.js";import{T as G}from"./index.df979911.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(b,{emit:x}){const t=b,p=x,n=N(t.modelValue),k=(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(),m(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:k},null,8,["modelValue","options"]),l("div",L,u((v=o.value)==null?void 0:v.metricVal),1),l("div",U,[l("span",null,u((f=o.value)==null?void 0:f.preVal)+"  ",1),A(h(I,{style:{display:"inline-block","padding-top":"2px"}},{default:C(()=>[_.value?(i(),m(S,{key:0,class:d(r.value)},null,8,["class"])):(i(),m(T,{key:1,class:d(r.value)},null,8,["class"]))]),_:1},512),[[E,(V=o.value)==null?void 0:V.gapVal]]),l("span",{class:d(r.value)},u((g=o.value)!=null&&g.gapVal?((y=o.value)==null?void 0:y.gapVal)+"%":""),3)])]}),_:1})}}});const K=H(j,[["__scopeId","data-v-9557fb8e"]]);export{K as default};
