const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./About-BECKqY6K.js","./index-ClCsMWbS.js","./envs-CSqIi4cL.js","./index-uKtJ6Klq.css","./snakeCase-D0nOJtgb.js","./_createCompounder-CDQ_1ElC.js","./isObjectLike-D4auEUP9.js","./Health-B5TOTzGW.js","./useTable-Bu98B1Qm.js","./DebouncedInput-B8gvkj6A.js","./DeviceImage-Bs0M9j-k.js","./index-C8QGyin-.js","./InfoAlert-DaX4x_1T.js","./Table-BikCpRDP.js","./Duration-CJDh_0iP.js","./TimeAgo-55eetS_D.js","./Settings-C0i2GffX.js","./SettingsList-B14Dp6bl.js","./CheckboxField-BxtT6ttj.js","./InputField-CqTVHKf8.js","./NumberField-Bv80Uoa9.js","./SelectField-WiB6Edsu.js","./Tools-Cqc7mfYu.js","./Bridge-_Dqz0S6H.js","./Json-a0ZE4H4E.js","./DevConsole-LvSvkafL.js","./TextareaField-BeRpIFjo.js"])))=>i.map(i=>d[i]);
import{u as b,y as v,z as f,C as h,r as o,I as j,b as x,P as T,as as E,at as N,X as y,j as s,G as _,F as $,N as A,M as P,A as w,S as z,_ as l}from"./index-ClCsMWbS.js";import"./envs-CSqIi4cL.js";const S=o.lazy(async()=>await l(()=>import("./About-BECKqY6K.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)),L=o.lazy(async()=>await l(()=>import("./Health-B5TOTzGW.js"),__vite__mapDeps([7,1,2,3,8,9,10,11,12,13,14,15]),import.meta.url)),D=o.lazy(async()=>await l(()=>import("./Settings-C0i2GffX.js"),__vite__mapDeps([16,1,2,3,12,17,18,19,20,21]),import.meta.url)),R=o.lazy(async()=>await l(()=>import("./Tools-Cqc7mfYu.js"),__vite__mapDeps([22,1,2,3,19,11]),import.meta.url)),V=o.lazy(async()=>await l(()=>import("./Bridge-_Dqz0S6H.js"),__vite__mapDeps([23,1,2,3,24]),import.meta.url)),C=o.lazy(async()=>await l(()=>import("./DevConsole-LvSvkafL.js"),__vite__mapDeps([25,1,2,3,19,21,26,12]),import.meta.url));function O(t,n,a){switch(n){case"about":return s.jsx(S,{sourceIdx:t},t);case"health":return s.jsx(L,{sourceIdx:t},t);case"settings":return s.jsx(D,{sourceIdx:t,tab:a??"main"},t);case"tools":return s.jsx(R,{sourceIdx:t},t);case"bridge":return s.jsx(V,{sourceIdx:t},t);case"dev-console":return s.jsx(C,{sourceIdx:t,tab:a??"mqtt"},t)}}const g=({isActive:t})=>t?"menu-active":void 0;function F(){const{t}=b("settings"),n=v(),{sourceIdx:a,tab:i,subTab:r}=f(),[d,c]=h(a);o.useEffect(()=>{!a||!c?n(`/settings/0/${i||"about"}`,{replace:!0}):i?r||(i==="settings"?n(`/settings/${a}/settings/main`,{replace:!0}):i==="dev-console"&&n(`/settings/${a}/dev-console/mqtt`,{replace:!0})):n(`/settings/${a}/about`,{replace:!0})},[a,c,i,r,n]);const p=o.useMemo(()=>[{to:`/settings/${a}/about`,icon:j,title:t(e=>e.about)},{to:`/settings/${a}/health`,icon:x,title:t(e=>e.health)},{to:`/settings/${a}/settings`,icon:T,title:t(e=>e.settings)},{to:`/settings/${a}/tools`,icon:E,title:t(e=>e.tools)},{to:`/settings/${a}/bridge`,icon:N,title:t(e=>e.bridge)},{to:`/settings/${a}/dev-console`,icon:y,title:t(e=>e.dev_console)}],[a,t]),m=s.jsx("div",{className:"menu menu-horizontal flex-1",children:p.map(e=>s.jsx("li",{className:"tooltip tooltip-bottom","data-tip":e.title,children:s.jsxs(_,{to:e.to,className:g,children:[s.jsx($,{icon:e.icon,size:"lg"}),s.jsx("span",{className:"hidden lg:inline",children:e.title})]})},e.to))});return s.jsxs(s.Fragment,{children:[s.jsx(A,{children:P?s.jsxs("div",{className:"flex-1 flex flex-col",children:[s.jsx("div",{className:"menu menu-horizontal flex-1 pb-0",children:w.map((e,u)=>s.jsx("li",{children:s.jsx(_,{to:`/settings/${u}/${i||"about"}${r?`/${r}`:""}`,className:g,children:s.jsx(z,{idx:u,alwaysShowName:!0})})},e))}),m]}):m}),i&&O(d,i,r)]})}export{F as default};
