import{C as B,D as N,r as n,t as u,E as x,m as t,w as a,K as F,G as l,H as s,I as M,u as d,N as f,V as g}from"./index-5a44a053.js";import{b as v,V,f as _,e as y}from"./VCard-2565a0b7.js";import{d as h}from"./VTextField-f153c512.js";import{n as C}from"./transition-1df78eef.js";import{a as k}from"./VBtn-bc6fd420.js";import"./VImg-1aa5363e.js";import"./index-cc451665.js";import"./forwardRefs-a329760c.js";import"./VProgressCircular-e11c7d5f.js";import"./resizeObserver-115493a9.js";const D={class:"my-2"},R=B({__name:"Forecast",setup(I){const{t:r}=N(),i=n(!1),m=n(!1),o=n(""),c=n(10),w=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}},T=[e=>!!e||r("settings.forecast_field_required"),e=>!!e&&e>2||r("settings.forecast_value_too_small")],$=async()=>{m.value=!0,await g.tuneModel(),m.value=!1};return(e,p)=>(u(),x(F,null,[t(v,{class:"elevation-2 m-4 max-w-sm"},{default:a(()=>[t(V,null,{default:a(()=>[l(s(e.$t("settings.forecast_create_model")),1)]),_:1}),t(_,null,{default:a(()=>[M("div",D,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:T},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:w},{default:a(()=>[l(s(e.$t("settings.forecast_create")),1)]),_:1})]),_:1})]),_:1}),t(v,{class:"elevation-2 m-4 max-w-sm"},{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:$},{default:a(()=>[l(s(e.$t("settings.forecast_tune")),1)]),_:1})]),_:1})]),_:1})],64))}});export{R as default};
