"use strict";(self.webpackChunk_mlflow_mlflow=self.webpackChunk_mlflow_mlflow||[]).push([[8140],{28140:function(e,s,i){i.r(s),i.d(s,{default:function(){return D}});var n=i(68248),t=i(43979),l=i(59930),a=i.n(l),o=i(91105),c=i(46709),r=i(54871),d=i(15756),u=i(79444),m=i(14429),p=i(54741),f=i(48785),g=i(89949),h=i(82716),v=i(27757),x=i(40724),Y=i(73408);var y={name:"1vfb318",styles:"flex:1;display:flex;align-items:center;justify-content:center"};const I=({error:e})=>{var s;return(0,Y.Y)(h.PageWrapper,{css:y,children:(0,Y.Y)(h.Empty,{"data-testid":"fallback",title:(0,Y.Y)(x.A,{id:"QXLV8h",defaultMessage:"Error"}),description:null!==(s=null===e||void 0===e?void 0:e.message)&&void 0!==s?s:(0,Y.Y)(x.A,{id:"D99bil",defaultMessage:"An error occurred while rendering chat sessions."}),image:(0,Y.Y)(v.k,{})})})},S=({children:e})=>(0,Y.Y)(g.tH,{fallback:(0,Y.Y)(I,{}),children:e});var b=i(27462),A=i(65641);const w=e=>e.type===d.$6.ASSESSMENT||e.type===d.$6.EXPECTATION||[d.yX,d.d6,d.Rl].includes(e.id),T=()=>{const{experimentId:e}=(0,o.g)(),{theme:s}=(0,v.u)(),[i,l]=(0,c.useState)(""),[g,h]=(0,c.useState)({});(0,r.Gt)("selectedSessionIds",g),a()(e,"Experiment ID must be defined");(0,u.U)();const{loading:x}=(0,p.L)({experimentId:e}),y=(0,m.Pz)(),I=(0,c.useMemo)(()=>[(0,d.$U)(e)],[e]),S=(0,c.useMemo)(()=>(0,f._)({sessionId:null}),[]),{data:T,isLoading:D,isFetching:M}=(0,d.Zn)({locations:I,timeRange:y,filters:S,searchQuery:i,disabled:!1}),k=(0,b.F)({traceSearchLocations:I}),E=(0,c.useMemo)(()=>({deleteTracesAction:k}),[k]);return(0,Y.FD)("div",{css:(0,n.AH)({display:"flex",flexDirection:"column",flex:1,minHeight:0,gap:s.spacing.sm},""),children:[(0,Y.Y)(t.J,{viewState:"sessions"}),(0,d.I0)()?(0,Y.Y)(A.v,{experimentId:e,additionalFilters:S,endpointName:"",timeRange:y,customDefaultSelectedColumns:w,forceGroupBySession:!0,columnStorageKeyPrefix:"chat-sessions"}):(0,Y.Y)(d.sp,{experimentId:e,traces:null!==T&&void 0!==T?T:[],isLoading:D,searchQuery:i,setSearchQuery:l,traceActions:E})]})};var D=()=>(0,Y.Y)(S,{children:(0,Y.Y)(u.k,{children:(0,Y.Y)(T,{})})})},43979:function(e,s,i){i.d(s,{J:function(){return d}});var n=i(68248),t=i(82716),l=i(27757),a=i(12998),o=i(84411),c=i(42747),r=i(73408);const d=({viewState:e,sessionId:s,className:i})=>{const{theme:d}=(0,l.u)();return(0,r.FD)("div",{css:(0,n.AH)({display:"flex",alignItems:"center",width:"100%",borderBottom:`1px solid ${d.colors.borderDecorative}`,paddingBottom:`${d.spacing.sm}px`},""),className:i,children:[!("single-chat-session"===e)&&(0,r.Y)(o.$,{}),"single-chat-session"===e&&(0,r.FD)("div",{css:(0,n.AH)({display:"flex",alignItems:"center",gap:d.spacing.sm},""),children:[(0,r.Y)(t.Tag,{color:"default",componentId:"mlflow.chat-sessions.session-header-label",css:(0,n.AH)({padding:d.spacing.xs+2,margin:0},""),children:(0,r.FD)("span",{css:(0,n.AH)({display:"flex",alignItems:"center",gap:d.spacing.sm},""),children:[(0,r.Y)(t.SpeechBubbleIcon,{}),(0,r.Y)(l.T.Text,{ellipsis:!0,bold:!0,children:(0,r.Y)(c.sA,{id:"EAf6xM",defaultMessage:"Session"})})]})}),(0,r.Y)(l.T.Title,{level:3,withoutMargins:!0,children:s}),s&&(0,r.Y)(a.ad,{copyText:s,componentId:"mlflow.chat-sessions.copy-session-id",buttonProps:{icon:void 0}})]})]})}}}]);