import{_ as Z,hE as z,l0 as H,u as J,ba as U,bp as W,kO as B,ek as K,z as X,D as F,is as Y,p as ee,ay as se,iv as T,bZ as w,b_ as te,Q as C,r as g,x as u,g_ as ae,t as ie,d1 as re,gJ as ne,i as oe,fi as ce,es as A,aU as le,gW as de,eD as pe,it as ue,c2 as he,j as s,L as fe,q as P,ao as k,v as E,be as S,h as me,bl as _}from"./index-DNBEEyYo.js";import{P as ge}from"./Panel-LhPx0w--.js";var xe=Z(function(t,e){return z(H(t),e)});const Q=ue(he.DATE_TIME.DATE),Ve=()=>{var y,b;const{id:n,fsId:t,fvName:e,fvVersion:a,tdVersion:r}=J(),o=U(),{pathname:h}=W(),{currentData:c={items:[]}}=B({pId:+n,fsId:+t,id:e}),{currentData:x,isFetching:f,refetch:m}=K({pId:+n,fsId:+t,id:e,version:+a,params:{expand:["features"]}}),{currentData:d={items:[]},refetch:p}=X({pId:+n,fsId:+t,id:e,version:+a}),G=d.items.find(F("version",+r)),{currentData:i,isFetching:L}=Y({pId:+n,fsId:+t,fvName:e,fvVersion:+a,id:+r,params:{fields:"content"}},{skip:xe(F("version",+r),d.items)}),$=ee(w(te(C("version"))),se(({version:l,eventStartTime:j,eventEndTime:V})=>({value:`${l}`,label:`${l} (${Q(T(j))} -> ${Q(T(V))})`})))(d.items),q=g.useCallback(l=>{o(u.project.featureView.td.statistics,{fsId:t,fvName:e,fvVersion:l,tdVersion:+r})},[t,e,o,r]),M=g.useCallback(l=>{const j=[u.project.featureView.td.statistics,u.project.featureView.td.correlation].find(V=>ae(ie(V,u.project.value),h))??u.project.featureView.td.statistics;o(j,{fsId:t,fvName:e,fvVersion:+a,tdVersion:+l})},[t,e,a,o,h]),[I,R]=re("split"),D=i!=null&&i.entities?[]:w(ne(oe),ce(i)),v=i!=null&&i.entities?i.entities.statistics:(b=(y=C(I??A(D),i))==null?void 0:y.entities)==null?void 0:b.statistics,N=g.useMemo(()=>le(de(pe,["extendedStatistics","correlations"]),v??{}),[v]),O=g.useCallback(()=>{m(),p()},[p,m]);return{allFvs:c,correlations:N,fv:x,fvName:e,fvVersion:a,handleTdVersionChange:M,handleVersionChange:q,isFetching:f||L,refetchAllData:O,statistics:v,splitNames:D,setSplit:R,split:I,tdVersion:r,tdVersionOptions:$,trainingDataset:G}},Ie=({isFetching:n,fvName:t,fvVersion:e,allFvs:a,handleVersionChange:r,handleTdVersionChange:o,refetchAllData:h,splitNames:c,setSplit:x,split:f,tdVersion:m,tdVersionOptions:d})=>s.jsxs(s.Fragment,{children:[n&&s.jsx(fe,{}),s.jsx(ge,{title:t,versions:(a==null?void 0:a.items)??[{version:+e}],version:+e,onVersionChange:r,idColor:"labels.purple",onClickRefresh:h,children:s.jsxs(P,{alignItems:"center",ml:"2px",children:[s.jsx(k,{icon:E.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(k,{icon:E.arrow_right,color:"grayShade1"}),c.length>1?s.jsx(S,{width:"140px",value:f||A(c),options:c.map(p=>({value:p,label:p})).reverse(),placeholder:"split",onChange:x}):s.jsxs(P,{alignItems:"flex-end",children:[s.jsx(_,{ml:"5px",color:"gray",children:"split"}),s.jsx(_,{mx:"5px",children:f})]})]})]})})]});export{Ie as T,Ve as u};
