import{B as F,r as u,q as i,D as M,m as e,w as t,J as N,F as r,G as l,I as o,$ as a,H as h,t as f,M as _,R as v}from"./index-5ee1411a.js";import{b as V,V as y,f as p,e as C}from"./VCard-8ba7cfc2.js";import{d as D}from"./VTextField-a8ac4f44.js";import{n as x}from"./transition-cd9cc606.js";import{a as k}from"./VBtn-1e45aba2.js";import"./VImg-71612e97.js";import"./index-a55adddd.js";import"./forwardRefs-2fb8bd5a.js";import"./VProgressCircular-4762adb7.js";import"./resizeObserver-5499429a.js";const q={class:"my-2"},P=F({__name:"Forecast",setup(A){const c=u(!1),m=u(!1),n=u(""),d=u(10),w=async function(){c.value=!0;try{const s=await v.createModel(d.value);n.value=a("settings.forecast_r2score")+" "+s.data.r2.toFixed(2)}catch{n.value=a("settings.forecast_create_model_error")}finally{c.value=!1}},B=[s=>!!s||a("settings.forecast_field_required"),s=>!!s&&s>2||a("settings.forecast_value_too_small")],T=async()=>{m.value=!0,await v.tuneModel(),m.value=!1};return(s,g)=>(i(),M(N,null,[e(V,{class:"max-w-sm m-4 elevation-2"},{default:t(()=>[e(y,null,{default:t(()=>[r(l(o(a)("settings.forecast_create_model")),1)]),_:1}),e(p,null,{default:t(()=>[h("div",q,l(o(a)("settings.forecast_create_model_text")),1),e(D,{modelValue:d.value,"onUpdate:modelValue":g[0]||(g[0]=b=>d.value=b),label:"Anzahl Tage","single-line":"",type:"number",rules:B},null,8,["modelValue"]),c.value?(i(),f(x,{key:0,indeterminate:"",class:"m-2"})):_("",!0)]),_:1}),n.value!=""?(i(),f(p,{key:0},{default:t(()=>[r(l(n.value),1)]),_:1})):_("",!0),e(C,null,{default:t(()=>[e(k,{class:"m-2",onClick:w},{default:t(()=>[r(l(o(a)("settings.forecast_create")),1)]),_:1})]),_:1})]),_:1}),e(V,{class:"max-w-sm m-4 elevation-2"},{default:t(()=>[e(y,null,{default:t(()=>[r(l(o(a)("settings.forecast_tune_model")),1)]),_:1}),e(p,null,{default:t(()=>[r(l(o(a)("settings.forecast_tune_model_text"))+" ",1),m.value?(i(),f(x,{key:0,indeterminate:"",class:"m-2"})):_("",!0)]),_:1}),e(C,null,{default:t(()=>[e(k,{class:"m-2",onClick:T},{default:t(()=>[r(l(o(a)("settings.forecast_tune")),1)]),_:1})]),_:1})]),_:1})],64))}});export{P as default};
