import{r as j,u as g,j as s,F as c,k,a_ as B,bi as E,h as P,bj as u,bk as v,bl as x,bm as F,bn as p}from"./index-CE-9RlbR.js";import{s as w}from"./snakeCase-WwJ9QoNs.js";const L=j.memo(h=>{const{device:b,batteryPercent:r,batteryState:m,batteryLow:f,showLevel:d,...i}=h,{t:n}=g("zigbee");let t;switch(b?.power_source&&(t=b.power_source),t){case"Battery":{let a=n(y=>y.battery),l="",e=u,o=!1;if(r!=null)l=`${r}%`,r>=85?e=u:r>=65?e=v:r>=40?e=x:r>=20?e=F:(e=p,o=!0);else if(m!=null)switch(l=m,m){case"high":e=u;break;case"medium":e=x;break;case"low":e=p,o=!0;break}else f!=null&&(l=f?"low":"ok",e=f?p:u);return f===!0&&(o=!0),l!==""&&(a+=`, ${n(y=>y.power_level)}: ${l}`),s.jsxs("span",{className:o?"text-error":"",children:[s.jsx(c,{icon:e,fade:o,title:a,...i}),d&&s.jsx("span",{className:"ps-2",children:l})]})}case"Mains (single phase)":case"Mains (3 phase)":case"DC Source":return s.jsx(c,{icon:P,"aria-label":n(a=>a[w(t)]),...i});case"Emergency mains and transfer switch":case"Emergency mains constantly powered":return s.jsx(c,{icon:E,"aria-label":n(a=>a[w(t)]),...i});default:return b?.type==="GreenPower"?s.jsx(c,{icon:k,"aria-label":"Green",...i}):s.jsx(c,{icon:B,"aria-label":t?n(a=>a[w(t)]):void 0,...i})}});export{L as P};
