import{k as F,B as u,s as M,c as e,w as a,F as N,o as c,d as f,C as _,x as r,y as l,z as o,$ as t,b as h,K as v}from"./index-DPl16C00.js";import{b as V,V as y,f as p,d as C}from"./VCard-CJTiHjO-.js";import{V as z}from"./VTextField-BpJ2unt4.js";import{n as x}from"./index-w-dkzpPh.js";import{a as k}from"./VBtn-ClDdYB5F.js";import"./VImg-B-97Yzkt.js";import"./VInput-qFshDEqa.js";import"./group-bVGzOFiw.js";import"./forwardRefs-BQ8_JL2J.js";const A={class:"my-2"},S=F({__name:"Forecast",setup(D){const i=u(!1),d=u(!1),n=u(""),m=u(10),b=async function(){i.value=!0;try{const s=await v.createModel(m.value);n.value=t("settings.forecast_r2score")+" "+s.data.r2.toFixed(2)}catch{n.value=t("settings.forecast_create_model_error")}finally{i.value=!1}},w=[s=>!!s||t("settings.forecast_field_required"),s=>!!s&&s>2||t("settings.forecast_value_too_small")],B=async()=>{d.value=!0,await v.tuneModel(),d.value=!1};return(s,g)=>(c(),M(N,null,[e(V,{class:"elevation-2 ma-4 max-w-sm"},{default:a(()=>[e(y,null,{default:a(()=>[r(l(o(t)("settings.forecast_create_model")),1)]),_:1}),e(p,null,{default:a(()=>[h("div",A,l(o(t)("settings.forecast_create_model_text")),1),e(z,{modelValue:m.value,"onUpdate:modelValue":g[0]||(g[0]=T=>m.value=T),label:"Anzahl Tage","single-line":"",type:"number",rules:w},null,8,["modelValue"]),i.value?(c(),f(x,{key:0,indeterminate:"",class:"ma-2"})):_("",!0)]),_:1}),n.value!=""?(c(),f(p,{key:0},{default:a(()=>[r(l(n.value),1)]),_:1})):_("",!0),e(C,null,{default:a(()=>[e(k,{class:"ma-2",onClick:b},{default:a(()=>[r(l(o(t)("settings.forecast_create")),1)]),_:1})]),_:1})]),_:1}),e(V,{class:"elevation-2 ma-4 max-w-sm"},{default:a(()=>[e(y,null,{default:a(()=>[r(l(o(t)("settings.forecast_tune_model")),1)]),_:1}),e(p,null,{default:a(()=>[r(l(o(t)("settings.forecast_tune_model_text"))+" ",1),d.value?(c(),f(x,{key:0,indeterminate:"",class:"ma-2"})):_("",!0)]),_:1}),e(C,null,{default:a(()=>[e(k,{class:"ma-2",onClick:B},{default:a(()=>[r(l(o(t)("settings.forecast_tune")),1)]),_:1})]),_:1})]),_:1})],64))}});export{S as default};
