PageSourceSearch

https://app.stammer.ai/static/react/7786.c191424a36d0b3eba5d7.js

js stammer.ai collected 2026-09-28 10:06:20 UTC 23,648 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkStammer_ai=self.webpackChunkStammer_ai||[]).push([[7786],{17786:function(e,n,t){t.r(n),t.d(n,{ChatbotObservabilityPage:function(){return X}});var r=t(78685),o=t(2057),i=t(17e3),a=t(16657),l=t(78166),s=t(81e3),c=t(14160),u=t(73433),d=t(974);var S=function(e){var n=e.icon,t=e.label,o=e.value,i=e.caption,a=e.isLoading;return(0,r.jsxs)(l.ZpM,{variant:"outlined",sx:{borderColor:"divider",boxShadow:"none",height:"100%",p:2},children:[(0,r.jsxs)(l.azJ,{display:"flex",alignItems:"center",gap:1,mb:1.5,children:[(0,r.jsx)(l.azJ,{display:"flex",alignItems:"center",justifyContent:"center",sx:{width:32,height:32,borderRadius:1.5,color:"primary.main",bgcolor:"action.hover"},children:n}),(0,r.jsx)(l.o5u,{variant:"body2",color:"text.secondary",noWrap:!0,children:t})]}),a?(0,r.jsx)(l.EAD,{variant:"text",width:72,height:36}):(0,r.jsx)(l.o5u,{variant:"h5",fontWeight:700,lineHeight:1.2,children:o}),i&&!a&&(0,r.jsx)(l.o5u,{variant:"caption",color:"text.secondary",children:i})]})},v=t(1331),h=function(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))};function x(e){return null==e?"—":e<1e3?"".concat(Math.round(e),"ms"):"".concat((e/1e3).toFixed(2),"s")}function L(e){return null==e?"—":e.toLocaleString()}function p(e){if(null==e||""===e)return"—";var n=Number(e);return Number.isNaN(n)?"—":"$".concat(n.toFixed(4))}function f(e){if(!e)return"—";var n=new Date(e);return Number.isNaN(n.getTime())?"—":(0,v.r6)(e)}function A(e){if(null==e)return"";if("string"==typeof e)return e;try{return JSON.stringify(e,null,2)}catch(n){return String(e)}}var I=function(e){var n,t,o,i,s,c,d,v,h,p,f=e.data,A=e.isLoading,I=(0,a.Bd)().t,E=[{icon:(0,r.jsx)(u.pr,{fontSize:"small"}),label:I("DISPLAY_LABELS.OBSERVABILITY_TOTAL_RESPONSES"),value:L(null!==(n=null==f?void 0:f.totalTraces)&&void 0!==n?n:0)},{icon:(0,r.jsx)(u.th,{fontSize:"small"}),label:I("DISPLAY_LABELS.OBSERVABILITY_SUCCESS_RATE"),value:(p=null!==(t=null==f?void 0:f.successRate)&&void 0!==t?t:null,null==p?"—":"".concat(Math.round(100*p),"%")),caption:I("DISPLAY_LABELS.OBSERVABILITY_ERRORS_COUNT",{count:null!==(o=null==f?void 0:f.errorCount)&&void 0!==o?o:0})},{icon:(0,r.jsx)(u.gO,{fontSize:"small"}),label:I("DISPLAY_LABELS.OBSERVABILITY_AVG_LATENCY"),value:x(null!==(i=null==f?void 0:f.avgLatencyMs)&&void 0!==i?i:null)},{icon:(0,r.jsx)(u.xf,{fontSize:"small"}),label:I("DISPLAY_LABELS.OBSERVABILITY_P95_LATENCY"),value:x(null!==(s=null==f?void 0:f.p95LatencyMs)&&void 0!==s?s:null)},{icon:(0,r.jsx)(u.B7,{fontSize:"small"}),label:I("DISPLAY_LABELS.OBSERVABILITY_TOTAL_TOKENS"),value:L(null!==(c=null==f?void 0:f.totalTokens)&&void 0!==c?c:0)},{icon:(0,r.jsx)(u.Mm,{fontSize:"small"}),label:I("DISPLAY_LABELS.OBSERVABILITY_TOTAL_STEPS"),value:L(null!==(d=null==f?void 0:f.totalSteps)&&void 0!==d?d:0)},{icon:(0,r.jsx)(u.L2,{fontSize:"small"}),label:I("DISPLAY_LABELS.OBSERVABILITY_TOOL_CALLS"),value:L(null!==(v=null==f?void 0:f.toolCallCount)&&void 0!==v?v:0)},{icon:(0,r.jsx)(u.po,{fontSize:"small"}),label:I("DISPLAY_LABELS.OBSERVABILITY_ERRORS"),value:L(null!==(h=null==f?void 0:f.errorCount)&&void 0!==h?h:0)}];return(0,r.jsx)(l.fPr,{container:!0,spacing:2,children:E.map((function(e){return(0,r.jsx)(l.fPr,{size:{xs:12,sm:6,md:3},children:(0,r.jsx)(S,{icon:e.icon,label:e.label,value:e.value,caption:e.caption,isLoading:A})},e.label)}))})},E=t(81491);var m=function(e){var n=e.status,t=e.size,o=void 0===t?"small":t,i=(0,a.Bd)().t,s=E.dj[n];return(0,r.jsx)(l.vu3,{size:o,color:s.color,variant:"outlined",label:i(s.labelKey),sx:{fontWeight:600,textTransform:"capitalize"}})},B=(0,l.I4L)(l.nA6)((function(e){var n=e.theme;return{color:n.palette.text.secondary,fontWeight:600,fontSize:12,textTransform:"uppercase",letterSpacing:.4,backgroundColor:n.palette.action.hover,borderBottom:"1px solid ".concat(n.palette.divider),whiteSpace:"nowrap"}})),b=(0,l.I4L)(l.nA6)((function(e){var n=e.theme;return{color:n.palette.text.primary,borderBottom:"1px solid ".concat(n.palette.divider),whiteSpace:"nowrap"}}));function T(e){return e.conversationTitle?e.conversationTitle:e.conversationNumber?"#".concat(e.conversationNumber):"—"}var j=function(e){var n,t=e.rows,i=e.totalCount,s=e.page,c=e.filters,d=e.isLoading,S=e.onPageChange,v=e.onStatusChange,h=e.onConversationSearch,A=e.onConversationSelect,I=e.onSelect,j=(0,a.Bd)().t,g=Math.max(Math.ceil(i/E.Dx),1),_=t.some((function(e){return null!=e.estimatedCost})),O=_?8:7,y=(0,o.useState)(null!==(n=c.conversationSearch)&&void 0!==n?n:""),R=y[0],Y=y[1];(0,o.useEffect)((function(){var e;Y(null!==(e=c.conversationSearch)&&void 0!==e?e:"")}
1),[c.conversationSearch]);var C=function(){var e=R.trim();h(e||null)};return(0,r.jsxs)(l.azJ,{children:[(0,r.jsxs)(l.azJ,{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:1,mb:2,children:[(0,r.jsx)(l.A_L,{size:"small",value:R,placeholder:j("DISPLAY_LABELS.OBSERVABILITY_SEARCH_CONVERSATION"),onChange:function(e){return Y(e.target.value)},onKeyDown:function(e){"Enter"===e.key&&C()},onBlur:C,sx:{minWidth:280},InputProps:{startAdornment:(0,r.jsx)(l.jC1,{position:"start",children:(0,r.jsx)(u.vj,{fontSize:"small",color:"action"})}),endAdornment:R?(0,r.jsx)(l.jC1,{position:"end",children:(0,r.jsx)(l.K0,{size:"small",onClick:function(){Y(""),h(null)},"aria-label":j("DISPLAY_LABELS.CLOSE_BUTTON"),children:(0,r.jsx)(u.bm,{fontSize:"small"})})}):null}}),(0,r.jsx)(l.l6P,{size:"small",value:c.status,displayEmpty:!0,onChange:function(e){return v(e.target.value)},sx:{minWidth:180},children:E.zq.map((function(e){return(0,r.jsx)(l.Drp,{value:e.value,children:j(e.labelKey)},e.value||"all")}))})]}),(0,r.jsx)(l.K3K,{sx:{border:function(e){return"1px solid ".concat(e.palette.divider)},borderRadius:1},children:(0,r.jsxs)(l.XIK,{stickyHeader:!0,size:"small",children:[(0,r.jsx)(l.ndF,{children:(0,r.jsxs)(l.Hjg,{children:[(0,r.jsx)(B,{children:j("DISPLAY_LABELS.OBSERVABILITY_COL_STATUS")}),(0,r.jsx)(B,{children:j("DISPLAY_LABELS.OBSERVABILITY_COL_MODEL")}),(0,r.jsx)(B,{children:j("DISPLAY_LABELS.OBSERVABILITY_COL_CONVERSATION")}),(0,r.jsx)(B,{align:"right",children:j("DISPLAY_LABELS.OBSERVABILITY_COL_STEPS")}),(0,r.jsx)(B,{align:"right",children:j("DISPLAY_LABELS.OBSERVABILITY_COL_LATENCY")}),(0,r.jsx)(B,{align:"right",children:j("DISPLAY_LABELS.OBSERVABILITY_COL_TOKENS")}),_&&(0,r.jsx)(B,{align:"right",children:j("DISPLAY_LABELS.OBSERVABILITY_COL_COST")}),(0,r.jsx)(B,{children:j("DISPLAY_LABELS.OBSERVABILITY_COL_TIME")})]})}),(0,r.jsx)(l.BFY,{children:d?Array.from({length:6}).map((function(e,n){return(0,r.jsx)(l.Hjg,{children:Array.from({length:O}).map((function(e,n){return(0,r.jsx)(b,{children:(0,r.jsx)(l.EAD,{variant:"text"})},n)}))},"skeleton-".concat(n))})):0===t.length?(0,r.jsx)(l.Hjg,{children:(0,r.jsx)(b,{colSpan:O,sx:{textAlign:"center",py:6,color:"text.secondary",whiteSpace:"normal"},children:j("DISPLAY_LABELS.OBSERVABILITY_NO_FILTERED_TRACES")})}):t.map((function(e){return(0,r.jsxs)(l.Hjg,{hover:!0,onClick:function(){return I(e.id)},sx:{cursor:"pointer"},children:[(0,r.jsxs)(b,{children:[(0,r.jsx)(m,{status:e.status}),e.errorType&&(0,r.jsx)(l.o5u,{variant:"caption",color:"error",display:"block",children:e.errorType})]}),(0,r.jsxs)(b,{children:[(0,r.jsx)(l.o5u,{variant:"body2",fontWeight:600,children:e.model||"—"}),e.provider&&(0,r.jsx)(l.o5u,{variant:"caption",color:"text.secondary",children:e.provider})]}
1),(0,r.jsx)(b,{sx:{maxWidth:220},children:null!=e.conversationId?(0,r.jsx)(l.vu3,{size:"small",variant:"outlined",color:c.conversation===e.conversationId?"primary":"default",label:T(e),onClick:function(n){n.stopPropagation(),A(e.conversationId)},sx:{maxWidth:"100%"}}):"—"}),(0,r.jsx)(b,{align:"right",children:(0,r.jsx)(l.vu3,{size:"small",variant:"outlined",label:e.stepCount,sx:{minWidth:36}})}),(0,r.jsx)(b,{align:"right",children:x(e.latencyMs)}),(0,r.jsx)(b,{align:"right",children:L(e.totalTokens)}),_&&(0,r.jsx)(b,{align:"right",children:p(e.estimatedCost)}),(0,r.jsx)(b,{children:(0,r.jsx)(l.o5u,{variant:"body2",color:"text.secondary",children:f(e.createdAt)})})]},e.id)}))})]})}),!d&&i>E.Dx&&(0,r.jsxs)(l.azJ,{display:"flex",justifyContent:"space-between",alignItems:"center",mt:2,children:[(0,r.jsx)(l.o5u,{variant:"caption",color:"text.secondary",children:j("DISPLAY_LABELS.OBSERVABILITY_TOTAL_COUNT",{count:i})}),(0,r.jsx)(l.dKS,{count:g,page:s,onChange:function(e,n){return S(n)},color:"primary",size:"small",shape:"rounded"})]})]})},g=t(7098);var _=function(e){var n=e.label,t=e.value;return t?(0,r.jsxs)(l.azJ,{mb:1.5,children:[(0,r.jsx)(l.o5u,{variant:"caption",color:"text.primary",sx:{fontWeight:700,textTransform:"uppercase",letterSpacing:.4},children:n}),(0,r.jsx)(l.azJ,{component:"pre",sx:{m:0,mt:.5,p:1.5,borderRadius:1,border:function(e){return"1px solid ".concat(e.palette.divider)},bgcolor:"action.hover",color:"text.primary",fontSize:12,lineHeight:1.6,maxHeight:260,overflow:"auto",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:t})]}):null},O={primary:"primary.main",info:"info.main",secondary:"secondary.main",success:"success.main",error:"error.main",warning:"warning.main",default:"text.disabled"};var y=function(e){var n,t=e.step,o=e.bar,i=e.expanded,s=e.onToggle,c=(0,a.Bd)().t,d=null!==(n=E.k_[t.kind])&&void 0!==n?n:E.k_.tool,S="error"===t.status,v=S?"error.main":O[d.color],h=Object.entries({provider:t.provider,model:t.model,httpMethod:t.httpMethod,httpStatus:t.httpStatus,endpoint:t.endpoint,promptTokens:t.promptTokens,completionTokens:t.completionTokens,totalTokens:t.totalTokens,timeToFirstTokenMs:t.timeToFirstTokenMs,failureClassification:t.failureClassification,providerCallId:t.providerCallId}).filter((function(e){var n=e[1];return null!=n&&""!==n}));return(0,r.jsxs)(l.azJ,{sx:{borderBottom:function(e){return"1px solid ".concat(e.palette.divider)},bgcolor:function(e){return S?(0,g.X4)(e.palette.error.main,.06):"transparent"}},children:[(0,r.jsxs)(l.azJ,{onClick:s,sx:{display:"flex",alignItems:"center",gap:1.5,px:1.5,py:1.5,cursor:"pointer","&:hover":{bgcolor:"action.hover"}},children:[(0,r.jsx)(u.CO,{sx:{color:"text.secondary",transform:i?"rotate(0deg)":"rotate(-90deg)",transition:"0.2s"}}),(0,r.jsx)(l.vu3,{size:"small",color:d.color,variant:"outlined",label:c(d.labelKey),sx:{minWidth:88,fontWeight:600}}),(0,r.jsxs)(l.azJ,{flex:1,minWidth:0,children:[(0,r.jsx)(l.o5u,{variant:"body2",fontWeight:600,noWrap:!0,children:t.name||c(d.labelKey)}),(0,r.jsx)(l.azJ,{sx:{position:"relative",height:8,mt:.75,borderRadius:4,bgcolor:"action.hover",overflow:"hidden"},children:(0,r.jsx)(l.azJ,{sx:{position:"absolute",left:0,width:"".concat(o.widthPct,"%"),top:0,bottom:0,borderRadius:4,bgcolor:v}})})]}),(0,r.jsx)(l.o5u,{variant:"body2",fontWeight:600,color:"text.secondary",sx:{minWidth:60,textAlign:"right"},children:x(t.latencyMs)})]}),(0,r.jsx)(l.SDm,{in:i,unmountOnExit:!0,children:(0,r.jsxs)(l.azJ,{sx:{px:5,pb:2,pt:.5},children:[h.length>0&&(0,r.jsx)(l.azJ,{display:"flex",flexWrap:"wrap",gap:.75,mb:2,children:h.map((function(e){var n=e[0],t=e[1];return(0,r.jsx)(l.vu3,{size:"small",variant:"outlined",label:"".concat(n,": ").concat(t)},n)}))}),(0,r.jsx)(_,{label:c("DISPLAY_LABELS.OBSERVABILITY_INPUT"),value:A(t.input)}),(0,r.jsx)(_,{label:c("DISPLAY_LABELS.OBSERVABILITY_OUTPUT"),value:A(t.output)}),t.errorMessage&&(0,r.jsx)(_,{label:c("DISPLAY_LABELS.OBSERVABILITY_ERROR"),value:A(t.errorMessage)})]})})]})},R=t(19124),Y=t(6765),C=t(21762),D=t(86591),P="observability-overview",V="observability-traces",N="observability-trace-detail",w=function(){return w=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},w.apply(this,arguments)},z=function(e,n,t,r){return new(t||(t=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function l(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,l)}s((r=r.apply(e,n||[])).next())}))},k=function(e,n){var t,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(s){return function(l){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=n.call(e,i)}catch(e){l=[6,e],r=0}finally{t=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}},M=function(e,n,t){return void 0===t&&(t={}),(0,R.uc)(w({chatbot:e,status:n.status||void 0,conversation:n.conversation||void 0,conversationSearch:n.conversationSearch||void 0},t))},W=function(e,n){return(0,D.I)({queryKey:[P,e,n],queryFn:function(){return function(e,n){return z(void 0,void 0,Promise,(function(){var t;return k(this,(function(r){switch(r.label){case 0:return[4,Y.nv.get(C.n.OBSERVABILITY.OVERVIEW,{params:M(e,n
1)})];case 1:return t=r.sent(),[2,(0,R.Cb)(t.data)]}}))}))}(e,n)},refetchOnWindowFocus:!0,refetchOnMount:!0,staleTime:0})},J=function(e,n,t,r){return(0,D.I)({queryKey:[V,e,n,t,r],queryFn:function(){return function(e,n,t,r){return z(void 0,void 0,Promise,(function(){var o;return k(this,(function(i){switch(i.label){case 0:return[4,Y.nv.get(C.n.OBSERVABILITY.TRACES,{params:M(e,n,{page:t,pageSize:r})})];case 1:return o=i.sent(),[2,(0,R.Cb)(o.data)]}}))}))}(e,n,t,r)},refetchOnWindowFocus:!0,refetchOnMount:!0,staleTime:0})},F=function(e){return(0,D.I)({queryKey:[N,e],queryFn:function(){return function(e){return z(void 0,void 0,Promise,(function(){var n;return k(this,(function(t){switch(t.label){case 0:return[4,Y.nv.get(C.n.OBSERVABILITY.TRACE_DETAIL(e))];case 1:return n=t.sent(),[2,(0,R.Cb)(n.data)]}}))}))}(e)},enabled:Boolean(e),refetchOnWindowFocus:!1,staleTime:3e4})};function U(e){var n=e.label,t=e.value;return(0,r.jsxs)(l.azJ,{children:[(0,r.jsx)(l.o5u,{variant:"caption",color:"text.primary",display:"block",sx:{textTransform:"uppercase",letterSpacing:.4,fontWeight:700,mb:.25},children:n}),(0,r.jsx)(l.o5u,{variant:"body1",fontWeight:600,children:t})]})}var K=function(e){var n,t,i,s,c,d,S,v=e.traceId,I=e.onClose,E=(0,a.Bd)().t,B=F(v),b=B.data,T=B.isLoading,j=B.isError,g=(0,o.useState)(new Set),O=g[0],R=g[1];(0,o.useEffect)((function(){var e;R(new Set((null!==(e=null==b?void 0:b.steps)&&void 0!==e?e:[]).map((function(e){return e.id}))))}),[null==b?void 0:b.steps]);var Y=(0,o.useMemo)((function(){var e;return function(e){if(0===e.length)return[];var n=e.map((function(e){var n;return Math.max(null!==(n=e.latencyMs)&&void 0!==n?n:0,0)})),t=Math.max.apply(Math,h(h([],n,!1),[1],!1)),r=n.reduce((function(e,n){return e+n}),0)||1;return n.map((function(e){return{widthPct:e>0?Math.max(e/t*100,4):0,fraction:e/r}}))}(null!==(e=null==b?void 0:b.steps)&&void 0!==e?e:[])}),[null==b?void 0:b.steps]),C=null!==(n=null==b?void 0:b.requestDetail)&&void 0!==n?n:{},D=null!=(null==b?void 0:b.promptTokens)||null!=(null==b?void 0:b.completionTokens)?"".concat(L(null==b?void 0:b.promptTokens)," → ").concat(L(null==b?void 0:b.completionTokens)):L(null==b?void 0:b.totalTokens),P=null!==(c=null!==(t=null==b?void 0:b.timeToFirstTokenMs)&&void 0!==t?t:null===(s=(null!==(i=null==b?void 0:b.steps)&&void 0!==i?i:[]).find((function(e){return null!=e.timeToFirstTokenMs})))||void 0===s?void 0:s.timeToFirstTokenMs)&&void 0!==c?c:null,V=(null!==(d=null==b?void 0:b.steps)&&void 0!==d?d:[]).reduce((function(e,n){return e+(n.estimatedCost?Number(n.estimatedCost):0)}),0),N=null!=(null==b?void 0:b.estimatedCost)||(null!==(S=null==b?void 0:b.steps)&&void 0!==S?S:[]).some((function(e){return null!=e.estimatedCost})),w=null!=(null==b?void 0:b.estimatedCost)?p(b.estimatedCost):p(String(V));return(0,r.jsx)(l._s,{anchor:"right",open:Boolean(v),onClose:I,sx:{"& .MuiDrawer-paper":{width:{xs:"100%",sm:640},maxWidth:"100%"}},children:(0,r.jsxs)(l.azJ,{display:"flex",flexDirection:"column",height:"100%",children:[(0,r.jsxs)(l.azJ,{display:"flex",justifyContent:"space-between",alignItems:"center",px:3,py:2,sx:{borderBottom:function(e){return"1px solid ".concat(e.palette.divider)}},children:[(0,r.jsxs)(l.azJ,{display:"flex",alignItems:"center",gap:1.5,children:[(0,r.jsx)(l.o5u,{variant:"h6",fontWeight:700,children:E("DISPLAY_LABELS.OBSERVABILITY_TRACE_DETAIL")}),b&&(0,r.jsx)(m,{status:b.status})]}),(0,r.jsx)(l.K0,{onClick:I,size:"small","aria-label":E("DISPLAY_LABELS.CLOSE_BUTTON"),children:(0,r.jsx)(u.bm,{fontSize:"small"})})]}),(0,r.jsxs)(l.azJ,{flex:1,sx:{overflowY:"auto"},px:3,py:2,children:[j&&(0,r.jsx)(l.FcD,{severity:"error",children:E("DISPLAY_LABELS.OBSERVABILITY_LOAD_ERROR")}),T&&(0,r.jsxs)(l.azJ,{children:[(0,r.jsx)(l.EAD,{variant:"rounded",height:72,sx:{mb:2}}),(0,r.jsx)(l.EAD,{variant:"rounded",height:200})]}),b&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(l.azJ,{display:"flex",flexWrap:"wrap",gap:3,px:2,py:1.5,sx:{borderRadius:1,border:function(e){return"1px solid ".concat(e.palette.divider)},bgcolor:"action.hover",mb:2},children:[(0,r.jsx)(U,{label:E("DISPLAY_LABELS.OBSERVABILITY_DURATION"),value:x(b.latencyMs)}),null!=P&&(0,r.jsx)(U,{label:E("DISPLAY_LABELS.OBSERVABILITY_TTFT"),value:x(P)}),(0,r.jsx)(U,{label:E("DISPLAY_LABELS.OBSERVABILITY_COL_TOKENS"),value:D}),N&&(0,r.jsx)(U,{label:E("DISPLAY_LABELS.OBSERVABILITY_EST_COST"),value:w}),(0,r.jsx)(U,{label:E("DISPLAY_LABELS.OBSERVABILITY_COL_MODEL"),value:b.model||"—"}),(0,r.jsx)(U,{label:E("DISPLAY_LABELS.OBSERVABILITY_COL_TIME"),value:f(b.createdAt)})]}
1),(C.query||C.systemPrompt||C.answer)&&(0,r.jsxs)(l.azJ,{mb:2,children:[(0,r.jsx)(l.o5u,{variant:"subtitle1",fontWeight:700,mb:1,children:E("DISPLAY_LABELS.OBSERVABILITY_REQUEST")}),(0,r.jsx)(_,{label:E("DISPLAY_LABELS.OBSERVABILITY_QUERY"),value:A(C.query)}),(0,r.jsx)(_,{label:E("DISPLAY_LABELS.OBSERVABILITY_SYSTEM_PROMPT"),value:A(C.systemPrompt)}),(0,r.jsx)(_,{label:E("DISPLAY_LABELS.OBSERVABILITY_RESPONSE"),value:A(C.answer)})]}),b.errorMessage&&(0,r.jsx)(l.azJ,{mb:2,children:(0,r.jsx)(_,{label:E("DISPLAY_LABELS.OBSERVABILITY_ERROR"),value:A(b.errorMessage)})}),(0,r.jsx)(l.cGx,{sx:{my:2}}),(0,r.jsxs)(l.o5u,{color:"text.primary",variant:"subtitle1",fontWeight:700,mb:1,children:[E("DISPLAY_LABELS.OBSERVABILITY_STEPS")," (",b.steps.length,")"]}),0===b.steps.length?(0,r.jsx)(l.o5u,{variant:"body2",color:"text.secondary",children:E("DISPLAY_LABELS.OBSERVABILITY_NO_STEPS")}):(0,r.jsx)(l.azJ,{sx:{border:function(e){return"1px solid ".concat(e.palette.divider)},borderRadius:1,overflow:"hidden"},children:b.steps.map((function(e,n){return(0,r.jsx)(y,{step:e,bar:Y[n],expanded:O.has(e.id),onToggle:function(){return n=e.id,R((function(e){var t=new Set(e);return t.has(n)?t.delete(n):t.add(n),t}));var n}},e.id)}))})]})]})]})})},H=function(){return H=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},H.apply(this,arguments)};function q(e){var n,t,i,s,c,d,S=e.chatbotId,v=(0,a.Bd)().t,h=new URLSearchParams(location.search).get("conversation"),x=h?parseInt(h,10):NaN,L=Number.isNaN(x)?void 0:x,p=(0,o.useState)({status:"",conversation:L}),f=p[0],A=p[1],m=(0,o.useState)(1),B=m[0],b=m[1],T=(0,o.useState)(null),g=T[0],_=T[1],O=W(S,f),y=J(S,f,B,E.Dx),R=null!==(t=null===(n=y.data)||void 0===n?void 0:n.results)&&void 0!==t?t:[],Y=null!==(s=null===(i=y.data)||void 0===i?void 0:i.count)&&void 0!==s?s:0,C=""!==f.status||Boolean(f.conversationSearch)||null!=f.conversation,D=!y.isLoading&&0===Y&&!C,P=(null===(c=R[0])||void 0===c?void 0:c.conversationTitle)||((null===(d=R[0])||void 0===d?void 0:d.conversationNumber)?"#".concat(R[0].conversationNumber):""),V=P?"".concat(v("DISPLAY_LABELS.OBSERVABILITY_FILTERED_BY_CONVERSATION"),": ").concat(P):v("DISPLAY_LABELS.OBSERVABILITY_FILTERED_BY_CONVERSATION");return(0,r.jsxs)(l.azJ,{display:"flex",flexDirection:"column",gap:3,children:[(O.isError||y.isError)&&(0,r.jsx)(l.FcD,{severity:"error",children:v("DISPLAY_LABELS.OBSERVABILITY_LOAD_ERROR")}),(0,r.jsx)(l.Zkm,{title:v("DISPLAY_LABELS.OBSERVABILITY_OVERVIEW"),children:(0,r.jsx)(I,{data:O.data,isLoading:O.isLoading})}),(0,r.jsxs)(l.Zkm,{title:v("DISPLAY_LABELS.OBSERVABILITY_TRACES"),children:[null!=f.conversation&&(0,r.jsx)(l.azJ,{mb:2,children:(0,r.jsx)(l.vu3,{color:"primary",variant:"outlined",label:V,onDelete:function(){A((function(e){return H(H({},e),{conversation:void 0})})),b(1)}})}),D?(0,r.jsxs)(l.azJ,{textAlign:"center",py:6,children:[(0,r.jsx)(u.iL,{sx:{fontSize:48,color:"text.disabled",mb:1}}),(0,r.jsx)(l.o5u,{variant:"subtitle1",fontWeight:600,children:v("DISPLAY_LABELS.OBSERVABILITY_NO_TRACES")}),(0,r.jsx)(l.o5u,{variant:"body2",color:"text.secondary",children:v("DISPLAY_LABELS.OBSERVABILITY_NO_TRACES_HINT")})]}):(0,r.jsx)(j,{rows:R,totalCount:Y,page:B,filters:f,isLoading:y.isLoading,onPageChange:b,onStatusChange:function(e){A((function(n){return H(H({},n),{status:e})})),b(1)},onConversationSearch:function(e){A((function(n){return H(H({},n),{conversationSearch:null!=e?e:void 0,conversation:void 0})})),b(1)},onConversationSelect:function(e){A((function(n){return H(H({},n),{conversation:e,conversationSearch:void 0})})),b(1)},onSelect:_})]}),(0,r.jsx)(K,{traceId:g,onClose:function(){return _(null)}})]})}var G=function(e){var n=e.chatbotId,t=(0,a.Bd)().t,i=new URLSearchParams(location.search),s=i.get("tab"),c=i.get("highlight"),u=c?parseInt(c,10):null,S=Number.isNaN(u)?null:u,v=s&&parseInt(s)||E.fg.TRACES,h=(0,o.useState)(v),x=h[0],L=h[1];return(0,r.jsxs)(l.azJ,{children:[(0,r.jsx)(l.azJ,{mb:2,children:(0,r.jsx)(l.qIE,{selectedTab:x,onTabChange:function(e){var n=Number(e);window.history.pushState(null,"","?tab=".concat(n)),L(n)},tabs:[{id:E.fg.TRACES,label:t("DISPLAY_LABELS.OBSERVABILITY_TRACES_TAB"),isActive:x===E.fg.TRACES},{id:E.fg.EVALUATED_CONVERSATIONS,label:t("DISPLAY_LABELS.EVALUATED_CONVERSATIONS"),isActive:x===E.fg.EVALUATED_CONVERSATIONS}]})}),x===E.fg.EVALUATED_CONVERSATIONS?(0,r.jsx)(d.ME,{chatbotId:n,highlightConversationId:S}):(0,r.jsx)(q,{chatbotId:n})]})},Q=t(11815);function Z(e){var n,t,o=e.chatbotId,i=(0,a.Bd)().t,u=(0,s.J)(),d=u.userDetails;return u.isLoading||!d?(0,r.jsx)(l.azJ,{sx:{display:"flex",justifyContent:"center",py:8},children:(0,r.jsx)(l.PaH,{size:28})}):null!==(t=null===(n=d.permissions)||void 0===n?void 0:n.includes(c.Qp.CAN_VIEW_OBSERVABILITY.value))&&void 0!==t&&t?(0,r.jsx)(G,{chatbotId:o}):(0,r.jsxs)(l.azJ,{sx:{textAlign:"center",py:8,px:2},children:[(0,r.jsx)(l.o5u,{variant:"h6",gutterBottom:!0,children:i("DISPLAY_STRINGS.PERMISSION_DENIED")}),(0,r.jsx)(l.o5u,{variant:"body2",color:"text.secondary",children:i("DISPLAY_STRINGS.PERMISSION_DENIED_MESSAGE")})]})}function X(){var e=(0,a.Bd)().t,n=(0,i.g)(),t=Number(n.chatbotId);return(0,r.jsx)(Q.H,{heading:e("DISPLAY_LABELS.SHELL_OBSERVABILITY"),chatbotId:t,currentViewName:"chatbot-observability",showHeader:!0,children:(0,r.jsx)(Z,{chatbotId:t})})}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.