import{_ as O,gK as H,kc as K,u as U,b9 as W,bg as B,j$ as J,en as X,v as Y,A as T,hw as Z,p as ee,az as se,hx as te,hz as w,bL as F,bM as ae,T as C,r as g,t as u,g8 as re,s as ne,cS as ie,fO as oe,g as ce,fg as le,ev as Q,aU as de,gn as pe,eG as ue,bQ as he,j as s,D as fe,a as k,ap as E,d as P,bd as S,l as me,bG as A}from"./index-_eM6l4Nf.js";import{P as ge}from"./Panel-BNKhRIJO.js";var xe=O(function(t,e){return H(K(t),e)});const G=te(he.DATE_TIME.DATE),Ve=()=>{var D,y;const{id:i,fsId:t,fvName:e,fvVersion:a,tdVersion:n}=U(),o=W(),{pathname:h}=B(),{currentData:c={items:[]}}=J({pId:+i,fsId:+t,id:e}),{currentData:x,isFetching:f,refetch:m}=X({pId:+i,fsId:+t,id:e,version:+a,params:{expand:["features"]}}),{currentData:d={items:[]},refetch:p}=Y({pId:+i,fsId:+t,id:e,version:+a}),_=d.items.find(T("version",+n)),{currentData:r,isFetching:$}=Z({pId:+i,fsId:+t,fvName:e,fvVersion:+a,id:+n,params:{fields:"content"}},{skip:xe(T("version",+n),d.items)}),L=ee(F(ae(C("version"))),se(({version:l,eventStartTime:v,eventEndTime:V})=>({value:`${l}`,label:`${l} (${G(w(v))} -> ${G(w(V))})`})))(d.items),M=g.useCallback(l=>{o(u.project.featureView.td.statistics,{fsId:t,fvName:e,fvVersion:l,tdVersion:+n})},[t,e,o,n]),R=g.useCallback(l=>{const v=[u.project.featureView.td.statistics,u.project.featureView.td.correlation].find(V=>re(ne(V,u.project.value),h))??u.project.featureView.td.statistics;o(v,{fsId:t,fvName:e,fvVersion:+a,tdVersion:+l})},[t,e,a,o,h]),[I,q]=ie("split"),b=r!=null&&r.entities?[]:F(oe(ce),le(r)),j=r!=null&&r.entities?r.entities.statistics:(y=(D=C(I??Q(b),r))==null?void 0:D.entities)==null?void 0:y.statistics,z=g.useMemo(()=>de(pe(ue,["extendedStatistics","correlations"]),j??{}),[j]),N=g.useCallback(()=>{m(),p()},[p,m]);return{allFvs:c,correlations:z,fv:x,fvName:e,fvVersion:a,handleTdVersionChange:R,handleVersionChange:M,isFetching:f||$,refetchAllData:N,statistics:j,splitNames:b,setSplit:q,split:I,tdVersion:n,tdVersionOptions:L,trainingDataset:_}},Ie=({isFetching:i,fvName:t,fvVersion:e,allFvs:a,handleVersionChange:n,handleTdVersionChange:o,refetchAllData:h,splitNames:c,setSplit:x,split:f,tdVersion:m,tdVersionOptions:d})=>s.jsxs(s.Fragment,{children:[i&&s.jsx(fe,{}),s.jsx(ge,{title:t,versions:(a==null?void 0:a.items)??[{version:+e}],version:+e,onVersionChange:n,idColor:"labels.purple",onClickRefresh:h,children:s.jsxs(k,{alignItems:"center",ml:"2px",children:[s.jsx(E,{icon:P.arrow_right,color:"grayShade1"}),s.jsx(S,{width:"216px",value:m,options:d,placeholder:"version",onChange:o}),!me(c)&&s.jsxs(s.Fragment,{children:[s.jsx(E,{icon:P.arrow_right,color:"grayShade1"}),c.length>1?s.jsx(S,{width:"140px",value:f||Q(c),options:c.map(p=>({value:p,label:p})).reverse(),placeholder:"split",onChange:x}):s.jsxs(k,{alignItems:"flex-end",children:[s.jsx(A,{ml:"5px",color:"gray",children:"split"}),s.jsx(A,{mx:"5px",children:f})]})]})]})})]});export{Ie as T,Ve as u};
