(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[38842],{450:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>d});var i=t(95155),n=t(92571),a=t(31966),l=t(73321),r=t(12115),c=t(1550),o=t(86939),h=t(89239);function d(){(0,c.si)("Edit Provider",{hideActions:!0});let e=(0,l.useRouter)(),{id:s}=(0,l.useParams)(),[t,d]=(0,r.useState)(null),[u,m]=(0,r.useState)(!0);(0,r.useEffect)(()=>{fetch("/api/providers").then(e=>e.json()).then(e=>{d(e.find(e=>e.id===s)||null),m(!1)}).catch(()=>m(!1))},[s]);let p=(0,r.useCallback)(async t=>{await fetch(`/api/providers/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),e.push("/settings")},[s,e]),N=(0,r.useCallback)(async()=>{await fetch(`/api/providers/${s}`,{method:"DELETE"}),e.push("/settings")},[s,e]);return u?(0,i.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,i.jsx)(n.A,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):t?(0,i.jsxs)("div",{className:"flex-1 min-h-0 flex flex-col p-4 gap-4",children:[(0,i.jsxs)(h.$,{variant:"ghost",size:"sm",className:"self-start shrink-0",onClick:()=>e.push("/settings"),children:[(0,i.jsx)(a.A,{className:"h-4 w-4 mr-1"}),"Settings"]}),(0,i.jsx)("div",{className:"flex-1 min-h-0",children:(0,i.jsx)(o.Q,{provider:t,isNew:!1,lockedEnvKeys:["ANTHROPIC_BASE_URL","ANTHROPIC_AUTH_TOKEN","ANTHROPIC_MODEL","ANTHROPIC_DEFAULT_OPUS_MODEL","ANTHROPIC_DEFAULT_SONNET_MODEL","ANTHROPIC_DEFAULT_HAIKU_MODEL","CLAUDE_CODE_SUBAGENT_MODEL"],onSave:p,onCancel:()=>e.push("/settings"),onDelete:N})})]}):(0,i.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto p-4 space-y-4",children:[(0,i.jsxs)(h.$,{variant:"ghost",size:"sm",onClick:()=>e.push("/settings"),children:[(0,i.jsx)(a.A,{className:"h-4 w-4 mr-1"}),"Settings"]}),(0,i.jsx)("p",{className:"text-sm text-muted-foreground",children:"Provider not found."})]})}},99784:(e,s,t)=>{Promise.resolve().then(t.bind(t,450))}},e=>{e.O(0,[989,25781,1550,86939,28441,93794,77358],()=>e(e.s=99784)),_N_E=e.O()}]);