import{M as B,N as M,r as n,l as u,S as N,J as t,w as a,K as x,_ as l,$ as s,Q as F,m as d,V as f,a3 as g}from"./index-2a796b7e.js";import{b as V,V as v,d as _,c as y}from"./VCard-e2c302fe.js";import{d as h}from"./VTextField-71028ec4.js";import{l as C}from"./VImg-9fff8259.js";import{V as k}from"./VBtn-29a0de88.js";import"./VAvatar-c55f1640.js";import"./index-bfe34a20.js";import"./forwardRefs-ab2b038b.js";import"./VProgressCircular-57c5ac59.js";import"./resizeObserver-a1e84c0c.js";const A={class:"my-2"},Q=B({__name:"Forecast",setup(D){const{t:r}=M(),i=n(!1),m=n(!1),o=n(""),c=n(10),$=async function(){i.value=!0;try{const e=await g.createModel(c.value);o.value=r("settings.forecast_r2score")+" "+e.data.r2.toFixed(2)}catch{o.value=r("settings.forecast_create_model_error")}finally{i.value=!1}},w=[e=>!!e||r("settings.forecast_field_required"),e=>!!e&&e>2||r("settings.forecast_value_too_small")],T=async()=>{m.value=!0,await g.tuneModel(),m.value=!1};return(e,p)=>(u(),N(x,null,[t(V,{class:"m-4 max-w-sm elevation-2"},{default:a(()=>[t(v,null,{default:a(()=>[l(s(e.$t("settings.forecast_create_model")),1)]),_:1}),t(_,null,{default:a(()=>[F("div",A,s(e.$t("settings.forecast_create_model_text")),1),t(h,{modelValue:c.value,"onUpdate:modelValue":p[0]||(p[0]=b=>c.value=b),label:"Anzahl Tage","single-line":"",type:"number",rules:w},null,8,["modelValue"]),i.value?(u(),d(C,{key:0,indeterminate:"",class:"m-2"})):f("",!0)]),_:1}),o.value!=""?(u(),d(_,{key:0},{default:a(()=>[l(s(o.value),1)]),_:1})):f("",!0),t(y,null,{default:a(()=>[t(k,{class:"m-2",onClick:$},{default:a(()=>[l(s(e.$t("settings.forecast_create")),1)]),_:1})]),_:1})]),_:1}),t(V,{class:"m-4 max-w-sm elevation-2"},{default:a(()=>[t(v,null,{default:a(()=>[l(s(e.$t("settings.forecast_tune_model")),1)]),_:1}),t(_,null,{default:a(()=>[l(s(e.$t("settings.forecast_tune_model_text"))+" ",1),m.value?(u(),d(C,{key:0,indeterminate:"",class:"m-2"})):f("",!0)]),_:1}),t(y,null,{default:a(()=>[t(k,{class:"m-2",onClick:T},{default:a(()=>[l(s(e.$t("settings.forecast_tune")),1)]),_:1})]),_:1})]),_:1})],64))}});export{Q as default};
