import{_ as z,gF as H,jD as J,u as O,b9 as Y,bg as B,jq as K,el as W,t as X,A as C,hi as Z,p as ee,az as se,hj as te,hl as F,bL as T,bM as ae,U as w,r as g,q as u,g4 as ie,o as re,cS as ne,fL as oe,e as ce,fc as le,et as _,aJ as de,gi as pe,eE as ue,bQ as he,j as s,D as fe,$ as E,ap as P,C as S,bd as k,h as me,bG as A}from"./index-Cc-6WbPt.js";import{P as ge}from"./Panel-BCZwmXoJ.js";var je=z(function(t,e){return H(J(t),e)});const Q=te(he.DATE_TIME.DATE),ve=()=>{var I,y;const{id:n,fsId:t,fvName:e,fvVersion:a,tdVersion:r}=O(),o=Y(),{pathname:h}=B(),{currentData:c={items:[]}}=K({pId:+n,fsId:+t,id:e}),{currentData:j,isFetching:f,refetch:m}=W({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}),$=d.items.find(C("version",+r)),{currentData:i,isFetching:G}=Z({pId:+n,fsId:+t,fvName:e,fvVersion:+a,id:+r,params:{fields:"content"}},{skip:je(C("version",+r),d.items)}),L=ee(T(ae(w("version"))),se(({version:l,eventStartTime:V,eventEndTime:v})=>({value:`${l}`,label:`${l} (${Q(F(V))} -> ${Q(F(v))})`})))(d.items),R=g.useCallback(l=>{o(u.project.featureView.td.statistics,{fsId:t,fvName:e,fvVersion:l,tdVersion:+r})},[t,e,o,r]),q=g.useCallback(l=>{const V=[u.project.featureView.td.statistics,u.project.featureView.td.correlation].find(v=>ie(re(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]),[b,M]=ne("split"),D=i!=null&&i.entities?[]:T(oe(ce),le(i)),x=i!=null&&i.entities?i.entities.statistics:(y=(I=w(b??_(D),i))==null?void 0:I.entities)==null?void 0:y.statistics,N=g.useMemo(()=>de(pe(ue,["extendedStatistics","correlations"]),x??{}),[x]),U=g.useCallback(()=>{m(),p()},[p,m]);return{allFvs:c,correlations:N,fv:j,fvName:e,fvVersion:a,handleTdVersionChange:q,handleVersionChange:R,isFetching:f||G,refetchAllData:U,statistics:x,splitNames:D,setSplit:M,split:b,tdVersion:r,tdVersionOptions:L,trainingDataset:$}},be=({isFetching:n,fvName:t,fvVersion:e,allFvs:a,handleVersionChange:r,handleTdVersionChange:o,refetchAllData:h,splitNames:c,setSplit:j,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(E,{alignItems:"center",ml:"2px",children:[s.jsx(P,{icon:S.arrow_right,color:"grayShade1"}),s.jsx(k,{width:"216px",value:m,options:d,placeholder:"version",onChange:o}),!me(c)&&s.jsxs(s.Fragment,{children:[s.jsx(P,{icon:S.arrow_right,color:"grayShade1"}),c.length>1?s.jsx(k,{width:"140px",value:f||_(c),options:c.map(p=>({value:p,label:p})).reverse(),placeholder:"split",onChange:j}):s.jsxs(E,{alignItems:"flex-end",children:[s.jsx(A,{ml:"5px",color:"gray",children:"split"}),s.jsx(A,{mx:"5px",children:f})]})]})]})})]});export{be as T,ve as u};
