import{c as N,a as m,f as y}from"../chunks/vfPE-AD7.js";import{i as z,p as X,j as D,t as k,c as E,e as s,n as H,r as a,f as g,g as $,u as J}from"../chunks/DhUiKsxN.js";import{I as P,a as I,e as K,g as F,f as O,h as Q,c as R}from"../chunks/QNXDtpsh.js";import{s as L}from"../chunks/Dsv8gxIT.js";import{l as S,b as V,i as T,s as U,a as Y}from"../chunks/DUil1G3I.js";import{c as Z}from"../chunks/qte2Y0k0.js";import{p as aa}from"../chunks/B2gI4nmm.js";import{r as q}from"../chunks/DyqxJaEr.js";import{s as f}from"../chunks/BvTRQjz0.js";import{C as ea,M as ra}from"../chunks/AByEuEpv.js";import"../chunks/1jpszzm8.js";function sa(i,e){const t=S(e,["children","$$slots","$$events","$$legacy"]);/**
 * @license lucide-svelte v0.469.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const l=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z"}],["path",{d:"M12 22V12"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7"}],["path",{d:"m7.5 4.27 9 5.15"}]];P(i,V({name:"package"},()=>t,{get iconNode(){return l},children:(n,p)=>{var r=N(),d=z(r);I(d,e,"default",{}),m(n,r)},$$slots:{default:!0}}))}function ta(i,e){const t=S(e,["children","$$slots","$$events","$$legacy"]);/**
 * @license lucide-svelte v0.469.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const l=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18"}]];P(i,V({name:"server"},()=>t,{get iconNode(){return l},children:(n,p)=>{var r=N(),d=z(r);I(d,e,"default",{}),m(n,r)},$$slots:{default:!0}}))}function oa(i,e){const t=S(e,["children","$$slots","$$events","$$legacy"]);/**
 * @license lucide-svelte v0.469.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const l=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}],["circle",{cx:"12",cy:"12",r:"3"}]];P(i,V({name:"settings"},()=>t,{get iconNode(){return l},children:(n,p)=>{var r=N(),d=z(r);I(d,e,"default",{}),m(n,r)},$$slots:{default:!0}}))}var la=y("<a><!> </a>"),na=y('<div class="hidden sm:flex items-center gap-2 text-sm text-muted-foreground"><span>Memory:</span> <span class="font-mono"> </span> <div class="w-24 h-2 bg-gray-200 rounded-full overflow-hidden"><div class="h-full bg-mlx-500 transition-all"></div></div></div>'),ia=y('<nav class="bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700"><div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8"><div class="flex justify-between h-16"><div class="flex items-center"><a class="flex items-center gap-2"><!> <span class="font-bold text-xl">MLX Manager</span></a> <div class="hidden md:flex ml-10 space-x-4"></div></div> <div class="flex items-center gap-4"><!></div></div></div></nav>');function da(i,e){X(e,!0);const t=()=>Y(aa,"$page",l),[l,n]=U(),p=[{href:"/servers",label:"Servers",icon:ta},{href:"/chat",label:"Chat",icon:ra},{href:"/models",label:"Models",icon:sa},{href:"/profiles",label:"Profiles",icon:oa}];D(()=>{f.refreshMemory();const o=setInterval(()=>f.refreshMemory(),3e4);return()=>clearInterval(o)});var r=ia(),d=s(r),A=s(d),b=s(A),_=s(b),B=s(_);ea(B,{class:"w-8 h-8 text-mlx-500"}),H(2),a(_);var C=g(_,2);K(C,21,()=>p,o=>o.href,(o,c)=>{const h=J(()=>t().url.pathname.startsWith($(c).href));var v=la(),x=s(v);Z(x,()=>$(c).icon,(u,M)=>{M(u,{class:"w-4 h-4"})});var w=g(x);a(v),k(u=>{F(v,"href",u),O(v,1,`flex items-center gap-2 px-3 py-2 rounded-md text-sm font-medium transition-colors
								${$(h)?"bg-mlx-100 text-mlx-700 dark:bg-mlx-900 dark:text-mlx-100":"text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700"}`),L(w,` ${$(c).label??""}`)},[()=>q($(c).href)]),m(o,v)}),a(C),a(b);var j=g(b,2),G=s(j);{var W=o=>{var c=na(),h=g(s(c),2),v=s(h);a(h);var x=g(h,2),w=s(x);a(x),a(c),k((u,M)=>{L(v,`${u??""} / ${M??""} GB`),Q(w,`width: ${f.memory.percent_used??""}%`)},[()=>f.memory.used_gb.toFixed(1),()=>f.memory.total_gb.toFixed(0)]),m(o,c)};T(G,o=>{f.memory&&o(W)})}a(j),a(A),a(d),a(r),k(o=>F(_,"href",o),[()=>q("/")]),m(i,r),E(),n()}var ca=y('<div class="min-h-screen bg-gray-50 dark:bg-gray-900"><!> <main class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8"><!></main></div>');function ba(i,e){var t=ca(),l=s(t);da(l,{});var n=g(l,2),p=s(n);R(p,()=>e.children),a(n),a(t),m(i,t)}export{ba as component};
