const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./About-BjWNLgcP.js","./index-DjbVAZHL.js","./envs-CRUy-_iG.js","./index-DeQqyExs.css","./snakeCase-Dg4N4ThO.js","./_createCompounder-CI5okWsL.js","./isObjectLike-DlSfHoCn.js","./Health-LrX4JU4r.js","./useTable-CzYZMRdm.js","./DebouncedInput-BTa39xKg.js","./DeviceImage-Bsu1Hk6P.js","./index-BzinHeAr.js","./defineProperty-CegpTSss.js","./InfoAlert-CmtOpoKi.js","./Table-Cn-yqNHh.js","./Duration-CfkwsB-n.js","./TimeAgo-B6rAagzx.js","./Settings-CE6leTyM.js","./SettingsList-BXEgH0vS.js","./CheckboxField-h2bgaDmU.js","./InputField-D1U5kSs2.js","./NumberField-QiXHex0z.js","./SelectField-XDAy-a1R.js","./Tools-Jm7ok59W.js","./Bridge-DMfmQVNH.js","./Json-nKHxYK2r.js","./DevConsole-WdB2vhEZ.js","./TextareaField-CDvERvhg.js"])))=>i.map(i=>d[i]);
import{dG as p,dD as b,dE as f,dj as h,dq as o,bA as j,bt as x,aX as T,cQ as E,aV as N,aB as $,dm as a,S as d,o as y,R as A,J as P,a as w,a0 as S,aa as l}from"./index-DjbVAZHL.js";import"./envs-CRUy-_iG.js";const z=o.lazy(async()=>await l(()=>import("./About-BjWNLgcP.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)),D=o.lazy(async()=>await l(()=>import("./Health-LrX4JU4r.js"),__vite__mapDeps([7,1,2,3,8,9,10,11,12,13,14,15,16]),import.meta.url)),L=o.lazy(async()=>await l(()=>import("./Settings-CE6leTyM.js"),__vite__mapDeps([17,1,2,3,13,18,19,20,21,22]),import.meta.url)),R=o.lazy(async()=>await l(()=>import("./Tools-Jm7ok59W.js"),__vite__mapDeps([23,1,2,3,20,11]),import.meta.url)),V=o.lazy(async()=>await l(()=>import("./Bridge-DMfmQVNH.js"),__vite__mapDeps([24,1,2,3,25]),import.meta.url)),O=o.lazy(async()=>await l(()=>import("./DevConsole-WdB2vhEZ.js"),__vite__mapDeps([26,1,2,3,20,22,27,13]),import.meta.url));function C(t,n,s){switch(n){case"about":return a.jsx(z,{sourceIdx:t},t);case"health":return a.jsx(D,{sourceIdx:t},t);case"settings":return a.jsx(L,{sourceIdx:t,tab:s??"main"},t);case"tools":return a.jsx(R,{sourceIdx:t},t);case"bridge":return a.jsx(V,{sourceIdx:t},t);case"dev-console":return a.jsx(O,{sourceIdx:t,tab:s??"mqtt"},t)}}const _=({isActive:t})=>t?"menu-active":void 0;function q(){const{t}=p("settings"),n=b(),{sourceIdx:s,tab:i,subTab:r}=f(),[g,c]=h(s);o.useEffect(()=>{!s||!c?n(`/settings/0/${i||"about"}`,{replace:!0}):i?r||(i==="settings"?n(`/settings/${s}/settings/main`,{replace:!0}):i==="dev-console"&&n(`/settings/${s}/dev-console/mqtt`,{replace:!0})):n(`/settings/${s}/about`,{replace:!0})},[s,c,i,r,n]);const v=o.useMemo(()=>[{to:`/settings/${s}/about`,icon:j,title:t(e=>e.about)},{to:`/settings/${s}/health`,icon:x,title:t(e=>e.health)},{to:`/settings/${s}/settings`,icon:T,title:t(e=>e.settings)},{to:`/settings/${s}/tools`,icon:E,title:t(e=>e.tools)},{to:`/settings/${s}/bridge`,icon:N,title:t(e=>e.bridge)},{to:`/settings/${s}/dev-console`,icon:$,title:t(e=>e.dev_console)}],[s,t]),m=a.jsx("div",{className:"menu menu-horizontal flex-1",children:v.map(e=>a.jsx("li",{className:"tooltip tooltip-bottom","data-tip":e.title,children:a.jsxs(d,{to:e.to,className:_,children:[a.jsx(y,{icon:e.icon,size:"lg"}),a.jsx("span",{className:"hidden lg:inline",children:e.title})]})},e.to))});return a.jsxs(a.Fragment,{children:[a.jsx(A,{children:P?a.jsxs("div",{className:"flex-1 flex flex-col",children:[a.jsx("div",{className:"menu menu-horizontal flex-1 pb-0",children:w.map((e,u)=>a.jsx("li",{children:a.jsx(d,{to:`/settings/${u}/${i||"about"}${r?`/${r}`:""}`,className:_,children:a.jsx(S,{idx:u,alwaysShowName:!0})})},e))}),m]}):m}),i&&C(g,i,r)]})}export{q as default};
