import{c as e,j as t}from"./index-DItyo5Xo.js";import{c as s,b as a}from"./recharts-bmHCCfxU.js";const n=e("signal-high",[["path",{d:"M2 20h.01",key:"4haj6o"}],["path",{d:"M7 20v-4",key:"j294jx"}],["path",{d:"M12 20v-8",key:"i3yub9"}],["path",{d:"M17 20V8",key:"1tkaf5"}]]),r=e("signal-low",[["path",{d:"M2 20h.01",key:"4haj6o"}],["path",{d:"M7 20v-4",key:"j294jx"}]]),c=e("signal-medium",[["path",{d:"M2 20h.01",key:"4haj6o"}],["path",{d:"M7 20v-4",key:"j294jx"}],["path",{d:"M12 20v-8",key:"i3yub9"}]]),o=e("signal-zero",[["path",{d:"M2 20h.01",key:"4haj6o"}]]),i=e("signal",[["path",{d:"M2 20h.01",key:"4haj6o"}],["path",{d:"M7 20v-4",key:"j294jx"}],["path",{d:"M12 20v-8",key:"i3yub9"}],["path",{d:"M17 20V8",key:"1tkaf5"}],["path",{d:"M22 4v16",key:"sih9yq"}]]);function d(e){return e>=-90?"excellent":e>=-100?"good":e>=-110?"fair":e>=-120?"weak":"poor"}function l(e,t){if(!t)return"bg-white/10";switch(e){case"excellent":return"bg-accent-success";case"good":return"bg-[#71F8E5]";case"fair":return"bg-[#F9D26F]";case"weak":return"bg-[#FB923C]";case"poor":return"bg-accent-danger";default:return"bg-white/20"}}function x({rssi:e,className:a="w-4 h-4"}){const l=d(e),x=function(e){switch(e){case"excellent":return"text-accent-success";case"good":return"text-[#71F8E5]";case"fair":return"text-[#F9D26F]";case"weak":return"text-[#FB923C]";case"poor":return"text-accent-danger";default:return"text-text-muted"}}(l),h=s(x,a);switch(l){case"excellent":return t.jsx(i,{className:h});case"good":return t.jsx(n,{className:h});case"fair":return t.jsx(c,{className:h});case"weak":return t.jsx(r,{className:h});default:return t.jsx(o,{className:h})}}const h=a.memo(function({rssi:e,snr:a,compact:n=!1,showValues:r=!0}){const c=d(e),o={excellent:4,good:3,fair:2,weak:1,poor:0}[c];return n?t.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[r&&t.jsx("span",{className:"text-[10px] font-mono text-text-secondary",children:e}),t.jsx("div",{className:"flex items-end gap-[2px] h-3",children:Array.from({length:4}).map((e,a)=>t.jsx("div",{className:s("w-[3px] rounded-[1px] transition-colors",l(c,a<o)),style:{height:(a+1)/4*100+"%"}},a))})]}):t.jsxs("div",{className:"flex items-center justify-end gap-2",children:[r&&t.jsxs("div",{className:"flex flex-col items-end",children:[t.jsxs("span",{className:"text-xs font-mono text-text-secondary leading-tight",children:[e," dBm"]}),void 0!==a&&t.jsxs("span",{className:"text-[10px] font-mono text-text-muted leading-tight",children:[a.toFixed(1)," dB"]})]}),t.jsx("div",{className:"flex items-end gap-[2px] h-3.5",children:Array.from({length:4}).map((e,a)=>t.jsx("div",{className:s("w-[3px] rounded-[1px] transition-colors",l(c,a<o)),style:{height:(a+1)/4*100+"%"}},a))})]})});function u(e){const t=d(e);return t.charAt(0).toUpperCase()+t.slice(1)}export{h as S,x as a,u as g};
