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