"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[4301],{30420(O,c,t){t.r(c),t.d(c,{plugin:()=>H});var h=t(45468),r=t(52358),d=t(81292),a=t(74848),l=t(96540),m=t(96787),v=t(95304),u=t(40927);const S=({value:e,onChange:s,context:o})=>{const n=(0,l.useMemo)(()=>(0,u.L)(o.data[0]),[o.data]);(0,l.useEffect)(()=>{e.adhocFilters||s({...e,adhocFilters:[]})},[s,e]);const i=(0,v.Z)(n,e,s);return!n||!i?null:(0,a.jsx)(m.N,{controller:i})};var F=t(22803),g=t(16817),y=t(6737),j=t(24022);const f={wrapper:(0,F.css)({height:"100%",overflow:"scroll"})},x=({data:e,options:s,replaceVariables:o})=>{const n=(0,l.useRef)(null),i=(0,l.useMemo)(()=>(0,u.L)(e.series[0]),[e.series]),L=(0,g.A)(async()=>{const p=e.request?.targets[0].datasource?.uid??s.datasource?.uid;if(p)return await(0,y.l)().get(p)});return!e||!e.series.length||!i?(0,a.jsx)("div",{className:"panel-empty",children:(0,a.jsx)("p",{children:(0,a.jsx)(r.x6,{i18nKey:"traces.traces-panel.no-data-found-in-response",children:"No data found in response"})})}):(0,a.jsxs)("div",{className:f.wrapper,children:[(0,a.jsx)("div",{ref:n}),(0,a.jsx)(j.V,{dataFrames:e.series,scrollElementClass:f.wrapper,traceProp:i,datasource:L.value,topOfViewRef:n,createSpanLink:s.createSpanLink,focusedSpanId:s.focusedSpanId,createFocusSpanLink:s.createFocusSpanLink,spanFilters:(0,d.Qh)(o,s.spanFilters),timeRange:e.timeRange,hideHeaderDetails:s.hideHeaderDetails})]})};var P=t(2543);const V=e=>(0,P.defaultsDeep)(e,{cardOptions:{previewModifier:s=>{s.options=s.options??{},s.options.hideHeaderDetails=!0}}}),D=e=>{if(e.hasPreferredVisualisationType("trace"))return[V({})]},H=new h.m(x).setMigrationHandler(e=>e.options?.spanFilters?{spanFilters:(0,d.D)(e.options.spanFilters)}:e.options).setPanelOptions(e=>{const s=[(0,r.t)("traces.category-span-filters","Span filters")];e.addCustomEditor({id:"filters",name:(0,r.t)("traces.name-filters","Filters"),path:"spanFilters",category:s,editor:S,defaultValue:void 0}),e.addBooleanSwitch({path:"spanFilters.matchesOnly",name:(0,r.t)("traces.name-show-matches-only","Show matches only"),defaultValue:!1,category:s}).addBooleanSwitch({path:"spanFilters.criticalPathOnly",name:(0,r.t)("traces.name-critical-path-only","Select critical path"),defaultValue:!1,category:s})}).setSuggestionsSupplier(D)}}]);

//# sourceMappingURL=tracesPanel.13adb2c152a9c3cbafab.js.map