import{_ as z,gF as H,jC as J,u as O,b9 as Y,bg as B,jp as K,el as W,t as X,A as y,hh as Z,p as ee,az as se,hi as te,hk as F,bL as T,bM as ae,U as w,r as g,q as h,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 he,bQ as ue,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-ljTaFLaB.js";import{P as ge}from"./Panel-mILL570q.js";var xe=z(function(t,e){return H(J(t),e)});const Q=te(ue.DATE_TIME.DATE),ve=()=>{var D,C;const{id:n,fsId:t,fvName:e,fvVersion:a,tdVersion:r}=O(),o=Y(),{pathname:u}=B(),{currentData:c={items:[]}}=K({pId:+n,fsId:+t,id:e}),{currentData:x,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(y("version",+r)),{currentData:i,isFetching:G}=Z({pId:+n,fsId:+t,fvName:e,fvVersion:+a,id:+r,params:{fields:"content"}},{skip:xe(y("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(h.project.featureView.td.statistics,{fsId:t,fvName:e,fvVersion:l,tdVersion:+r})},[t,e,o,r]),M=g.useCallback(l=>{const V=[h.project.featureView.td.statistics,h.project.featureView.td.correlation].find(v=>ie(re(v,h.project.value),u))??h.project.featureView.td.statistics;o(V,{fsId:t,fvName:e,fvVersion:+a,tdVersion:+l})},[t,e,a,o,u]),[b,q]=ne("split"),I=i!=null&&i.entities?[]:T(oe(ce),le(i)),j=i!=null&&i.entities?i.entities.statistics:(C=(D=w(b??_(I),i))==null?void 0:D.entities)==null?void 0:C.statistics,N=g.useMemo(()=>de(pe(he,["extendedStatistics","correlations"]),j??{}),[j]),U=g.useCallback(()=>{m(),p()},[p,m]);return{allFvs:c,correlations:N,fv:x,fvName:e,fvVersion:a,handleTdVersionChange:M,handleVersionChange:R,isFetching:f||G,refetchAllData:U,statistics:j,splitNames:I,setSplit:q,split:b,tdVersion:r,tdVersionOptions:L,trainingDataset:$}},be=({isFetching:n,fvName:t,fvVersion:e,allFvs:a,handleVersionChange:r,handleTdVersionChange:o,refetchAllData:u,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:u,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:x}):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};
