(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6607],{23879:(e,s,a)=>{"use strict";a.d(s,{default:()=>o});var t=a(95155),n=a(12115),i=a(3534),d=a(28777),l=a(52679),c=a(43666);function o(){let[e,s]=(0,n.useState)([]),[a,o]=(0,n.useState)([]),[r,u]=(0,n.useState)({}),[h,f]=(0,n.useState)(!1),[p,w]=(0,n.useState)(null),[v,g]=(0,n.useState)({running:!1,certExists:!1,dnsStatus:{},hasCachedPassword:!1});(0,n.useEffect)(()=>{S(),y(),k(),j()},[]);let S=async()=>{try{let e=await fetch("/api/providers");if(e.ok){let a=await e.json();s(a.connections||[])}}catch{}},y=async()=>{try{let e=await fetch("/api/keys");if(e.ok){let s=await e.json();o(s.keys||[])}}catch{}},k=async()=>{try{let e=await fetch("/api/models/alias");if(e.ok){let s=await e.json();u(s.aliases||{})}}catch{}},j=async()=>{try{let e=await fetch("/api/settings");if(e.ok){let s=await e.json();f(s.cloudEnabled||!1)}}catch{}},m=()=>e.filter(e=>!1!==e.isActive),E=Object.entries(i.wn);return(0,t.jsxs)("div",{className:"flex w-full flex-col gap-6",children:[(0,t.jsx)(c.tA,{apiKeys:a,cloudEnabled:h,onStatusChange:g}),(0,t.jsx)("div",{className:"grid gap-3 sm:gap-4",children:E.map(([e,s])=>(0,t.jsx)(c.kn,{tool:s,isExpanded:p===e,onToggle:()=>w(p===e?null:e),serverRunning:v.running,dnsActive:v.dnsStatus?.[e]||!1,hasCachedPassword:v.hasCachedPassword||!1,needsSudoPassword:!1!==v.needsSudoPassword,isWin:!0===v.isWin,apiKeys:a,activeProviders:m(),hasActiveProviders:m().some(e=>(0,d.KC)(e.provider).length>0||(0,l.mq)(e.provider)||(0,l.gb)(e.provider)),modelAliases:r,cloudEnabled:h,onDnsChange:e=>g(s=>({...s,dnsStatus:e.dnsStatus??s.dnsStatus}))},e))})]})}},56006:(e,s,a)=>{Promise.resolve().then(a.bind(a,23879))}},e=>{e.O(0,[2574,3862,2194,698,5772,1321,5497,6069,8441,3794,7358],()=>e(e.s=56006)),_N_E=e.O()}]);