import{C as e,E as t,Ht as n,I as r,Q as i,R as a,W as o,_ as s,b as c,ut as l,v as u,w as d,y as f}from"./vue.runtime.esm-bundler-56z_v_HH.js";import{a as p}from"./vue-router-_izWfDzq.js";import{t as m}from"./AiConfigurationForm-CPJIXij0.js";import{n as h,t as g}from"./use-installation-feedback-D_coaJTi.js";var _={key:0},v={class:`mt-6`},y=t({__name:`AiView`,setup(t){let y=p(),{isSuccessfulResponse:b,showRequestError:x,showResponseError:S}=g(),C=l(!1),w=l(!1),T=l(null),E=l([]);r(D);async function D(){w.value=!0;try{let{data:e}=await h.get(`/api/v1/installation/ai/config`);T.value=e.config,E.value=e.drivers}catch(e){x(e)}finally{w.value=!1}}async function O(e){C.value=!0;try{let{data:t}=await h.post(`/api/v1/installation/ai/config`,e);if(!b(t)){S(t);return}await y.push({name:`installation.account`})}catch(e){x(e)}finally{C.value=!1}}async function k(){await O({ai_enabled:`NO`,ai_driver:`openrouter`,ai_api_key:``,ai_base_url:``,ai_chat_enabled:`NO`,ai_chat_model:``,ai_text_generation_enabled:`NO`,ai_text_generation_model:``})}return(t,r)=>{let l=o(`BaseButton`),p=o(`BaseWizardStep`);return a(),u(p,{title:t.$t(`settings.ai.installer_title`),description:t.$t(`settings.ai.installer_description`)},{default:i(()=>[T.value?(a(),c(`div`,_,[d(m,{"config-data":T.value,drivers:E.value,"is-saving":C.value,"is-fetching-initial-data":w.value,onSubmitData:O},null,8,[`config-data`,`drivers`,`is-saving`,`is-fetching-initial-data`]),s(`div`,v,[d(l,{variant:`primary-outline`,type:`button`,disabled:C.value,onClick:k},{default:i(()=>[e(n(t.$t(`general.skip`)),1)]),_:1},8,[`disabled`])])])):f(``,!0)]),_:1},8,[`title`,`description`])}}});export{y as default};