@odigos/ui-kit 0.0.217 → 0.0.218

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/containers.js CHANGED
@@ -1,4 +1,4 @@
1
- import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState as i,useEffect as a,Fragment as o,forwardRef as r,useRef as s,useImperativeHandle as l,useMemo as c,useCallback as d,Children as u}from"react";import p,{css as m,useTheme as h}from"styled-components";import{ac as g,aX as y,s as v,K as f,f as b,aY as S,aZ as x,a_ as C,a$ as E,k as N,l as k,b0 as T,b1 as w,b2 as $,b3 as D,D as A,F as I,c as O,b4 as R,b5 as L,r as M,b6 as F,h as _,b7 as P,b8 as K,b9 as j,ba as V,bb as z,bc as U,ay as B,aF as W,bd as H,be as q,bf as G,a9 as J,ak as Y,bg as X,bh as Q,bi as Z,bj as ee,bk as te,bl as ne,bm as ie,a2 as ae,bn as oe,bo as re,bp as se,bq as le,br as ce,Q as de,O as ue,bs as pe,bt as me,bu as he,bv as ge,bw as ye,bx as ve,U as fe,by as be,bz as Se,bA as xe,bB as Ce,bC as Ee,bD as Ne,bE as ke,bF as Te,bG as we,bH as $e,bI as De,bJ as Ae,b as Ie,bK as Oe,bL as Re,bM as Le,bN as Me,aM as Fe,bO as _e,bP as Pe,bQ as Ke,bR as je,bS as Ve,L as ze,bT as Ue,bU as Be,ah as We,bV as He,aq as qe,ar as Ge,bW as Je,E as Ye,bX as Xe,bY as Qe,bZ as Ze,b_ as et,b$ as tt,c0 as nt,c1 as it,c2 as at,c3 as ot,c4 as rt,c5 as st,c6 as lt,c7 as ct,a0 as dt,c8 as ut,c9 as pt,ca as mt,cb as ht,cc as gt,cd as yt,ce as vt,cf as ft,cg as bt,ch as St,z as xt,M as Ct,J as Et,ci as Nt,cj as kt,ck as Tt,H as wt,G as $t,v as Dt,ag as At,cl as It,cm as Ot,cn as Rt,co as Lt,V as Mt,Y as Ft,Z as _t,X as Pt,R as Kt,W as jt,_ as Vt,cp as zt,a1 as Ut,cq as Bt,cr as Wt,al as Ht,a8 as qt,cs as Gt,ct as Jt,cu as Yt,az as Xt,cv as Qt,cw as Zt,cx as en,ax as tn,cy as nn,cz as an,a5 as on,cA as rn,cB as sn,cC as ln,cD as cn,cE as dn,cF as un,cG as pn,aW as mn,g as hn,cH as gn,cI as yn,cJ as vn,cK as fn,au as bn,cL as Sn,cM as xn,cN as Cn,cO as En,cP as Nn,aA as kn,u as Tn,t as wn,ae as $n,cQ as Dn,cR as An,cS as In,cT as On,cU as Rn,cV as Ln}from"./chunks/ui-components-DaRAAytB.js";import{TrashIcon as Mn,VSquareIcon as Fn,XSquareIcon as _n,EditIcon as Pn,OdigosLogoText as Kn,PlusIcon as jn,RefreshIcon as Vn,SearchIcon as zn,FilterIcon as Un,DataStreamIcon as Bn,VIcon as Wn,OdigosLogo as Hn,ArrowIcon as qn,RefreshLeftArrowIcon as Gn,NotificationIcon as Jn,UserIcon as Yn,ImageErrorIcon as Xn,ChevronDownIcon as Qn,ChevronRightIcon as Zn,OverviewIcon as ei,SourceIcon as ti,DestinationIcon as ni,InstrumentationRuleIcon as ii,ActionIcon as ai,SlackLogo as oi,KeyIcon as ri,TerminalIcon as si,ExclamationTriangleIcon as li,TraceViewIcon as ci}from"./icons.js";import{MarkerType as di,useNodesState as ui,useEdgesState as pi}from"@xyflow/react";import{E as mi}from"./chunks/vendor-C150cdxb.js";import{Y as hi}from"./chunks/index-eGTPcqRB.js";import"zustand";import"javascript-time-ago";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";const gi=e=>{const{type:t,name:n,notes:i,signals:a,disabled:o,fields:{collectContainerAttributes:r,collectReplicaSetAttributes:s,collectWorkloadId:l,collectClusterId:c,labelsAttributes:d,annotationsAttributes:u,clusterAttributes:p,overwriteExistingValues:m,attributeNamesToDelete:h,renames:b,piiCategories:S,fallbackSamplingRatio:x,samplingPercentage:C,endpointsFilters:E,servicesNameFilters:N,attributeFilters:k,urlTemplatizationRulesGroups:T}}=e,w=[{title:g.TYPE,value:t},{type:y.ActiveStatus,title:g.STATUS,value:String(!o)},{type:y.Monitors,title:g.SIGNALS_FOR_PROCESSING,value:a?.join(", ")||""},{title:g.NAME,value:n||""},{title:g.NOTES,value:i||""},{type:y.Divider}];if(t===v.K8sAttributes&&(w.push({title:"Collect Container Attributes",value:String(r)}),w.push({title:"Collect ReplicaSet Attributes",value:String(s)}),w.push({title:"Collect Workload ID",value:String(l)}),w.push({title:"Collect Cluster ID",value:String(c)}),d?.length&&w.push({type:y.Divider}),d?.forEach(({labelKey:e,attributeKey:t,from:n,fromSources:i},a)=>{let o="";o+=`Label Key: ${e}\n`,o+=`Attribute Key: ${t}\n`;o+=`From: ${i?.length?i.join(", "):n||f.Pod}\n`,w.push({title:"Label"+(d.length>1?` #${a+1}`:""),value:o})}),u?.length&&w.push({type:y.Divider}),u?.forEach(({annotationKey:e,attributeKey:t,from:n,fromSources:i},a)=>{let o="";o+=`Annotation Key: ${e}\n`,o+=`Attribute Key: ${t}\n`;o+=`From: ${i?.length?i.join(", "):n||f.Pod}\n`,w.push({title:"Annotation"+(u.length>1?` #${a+1}`:""),value:o})})),t===v.AddClusterInfo){w.push({title:"Overwrite Existing Values",value:String(m||!1)});let e="";p?.forEach(({attributeName:t,attributeStringValue:n},i)=>{e+=`${t}: ${n}`,i<p.length-1&&(e+=", ")}),w.push({title:"Attributes",value:e})}if(t===v.DeleteAttributes){let e="";h?.forEach((t,n)=>{e+=t,n<h.length-1&&(e+=", ")}),w.push({title:"Attributes",value:e})}if(t===v.RenameAttributes){let e="";const t=Object.entries(b||{});t.forEach(([n,i],a)=>{e+=`${n}: ${i}`,a<t.length-1&&(e+=", ")}),w.push({title:"Attributes",value:e})}if(t===v.PiiMasking){let e="";S?.forEach((t,n)=>{e+=t,n<S.length-1&&(e+=", ")}),w.push({title:"Categories",value:e})}return t===v.ErrorSampler&&w.push({title:"Sampling Ratio",value:String(x)}),t===v.ProbabilisticSampler&&w.push({title:"Sampling Percentage",value:String(C)}),t===v.LatencySampler&&E?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:n,fallbackSamplingRatio:i},a)=>{let o="";o+=`Service Name: ${e}\n`,o+=`HTTP Route: ${t}\n`,o+=`Min. Latency: ${n}\n`,o+=`Fallback Sampling Ratio: ${i}`,w.push({title:"Endpoint"+(E.length>1?` #${a+1}`:""),value:o})}),t===v.ServiceNameSampler&&N?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:n},i)=>{let a="";a+=`Service Name: ${e}\n`,a+=`Sampling Ratio: ${t}\n`,a+=`Fallback Sampling Ratio: ${n}`,w.push({title:"Filter"+(N.length>1?` #${i+1}`:""),value:a})}),t===v.SpanAttributeSampler&&k?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:n,condition:i},a)=>{let o="";o+=`Service Name: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`Fallback Sampling Ratio: ${n}\n`;const r=Object.keys(i)[0];o+=`Condition: ${r}\n`,o+=`Operation: ${i[r]?.operation}\n`,o+=`Expected Value: ${i[r]?.expectedValue}`,"jsonCondition"===r&&(o+=`\nJSON Path: ${i[r].jsonPath}`),w.push({title:"Filter"+(k.length>1?` #${a+1}`:""),value:o})}),t===v.URLTemplatization&&T?.forEach((e,t)=>{let n="";e.filterK8sNamespace&&(n+=`Namespace: ${e.filterK8sNamespace}\n`),e.workloadFilters?.length&&e.workloadFilters.forEach(e=>{const t=[e.kind,e.name].filter(Boolean).join("/");t&&(n+=`Workload: ${t}\n`)});const i=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");n+=`Templates: ${i}`,e.notes&&(n+=`\nNotes: ${e.notes}`),w.push({title:"Group"+(T.length>1?` #${t+1}`:""),value:n})}),w},yi=b.PiiCategories,vi=p.div`
1
+ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState as i,useEffect as o,Fragment as a,forwardRef as r,useRef as l,useImperativeHandle as s,useMemo as c,useCallback as d,useLayoutEffect as u,Children as p}from"react";import h,{css as m,useTheme as g}from"styled-components";import{ac as f,aX as v,s as y,K as b,f as x,aY as S,aZ as C,a_ as w,a$ as k,k as $,l as E,b0 as T,b1 as N,b2 as D,b3 as A,D as I,F as R,c as O,b4 as M,b5 as L,r as F,b6 as P,h as _,b7 as z,b8 as K,b9 as j,ba as B,bb as W,bc as V,ay as U,aF as H,bd as q,be as G,bf as Y,a9 as J,ak as X,bg as Q,bh as Z,bi as ee,bj as te,bk as ne,bl as ie,bm as oe,a2 as ae,bn as re,bo as le,bp as se,bq as ce,br as de,Q as ue,O as pe,bs as he,bt as me,bu as ge,bv as fe,bw as ve,bx as ye,U as be,by as xe,bz as Se,bA as Ce,bB as we,bC as ke,bD as $e,bE as Ee,bF as Te,bG as Ne,bH as De,bI as Ae,bJ as Ie,b as Re,bK as Oe,bL as Me,bM as Le,bN as Fe,aM as Pe,bO as _e,bP as ze,bQ as Ke,bR as je,bS as Be,L as We,bT as Ve,bU as Ue,ah as He,bV as qe,aq as Ge,ar as Ye,bW as Je,E as Xe,bX as Qe,bY as Ze,bZ as et,b_ as tt,b$ as nt,c0 as it,c1 as ot,c2 as at,c3 as rt,c4 as lt,c5 as st,c6 as ct,c7 as dt,a0 as ut,c8 as pt,c9 as ht,ca as mt,cb as gt,cc as ft,cd as vt,ce as yt,cf as bt,cg as xt,ch as St,z as Ct,M as wt,J as kt,ci as $t,cj as Et,ck as Tt,H as Nt,G as Dt,v as At,ag as It,cl as Rt,cm as Ot,cn as Mt,co as Lt,V as Ft,Y as Pt,Z as _t,X as zt,R as Kt,W as jt,_ as Bt,cp as Wt,a1 as Vt,cq as Ut,cr as Ht,al as qt,a8 as Gt,cs as Yt,ct as Jt,cu as Xt,az as Qt,cv as Zt,cw as en,cx as tn,ax as nn,cy as on,cz as an,a5 as rn,cA as ln,cB as sn,T as cn,e as dn,q as un,B as pn,a as hn,u as mn,af as gn,aV as fn,x as vn,cC as yn,aj as bn,N as xn,$ as Sn,cD as Cn,cE as wn,cF as kn,cG as $n,cH as En,aW as Tn,g as Nn,cI as Dn,cJ as An,cK as In,cL as Rn,au as On,cM as Mn,cN as Ln,cO as Fn,cP as Pn,cQ as _n,aA as zn,t as Kn,ae as jn,cR as Bn,cS as Wn,cT as Vn,cU as Un,cV as Hn,cW as qn}from"./chunks/ui-components-CzlBPbLD.js";import{TrashIcon as Gn,VSquareIcon as Yn,XSquareIcon as Jn,EditIcon as Xn,OdigosLogoText as Qn,PlusIcon as Zn,RefreshIcon as ei,SearchIcon as ti,FilterIcon as ni,DataStreamIcon as ii,VIcon as oi,OdigosLogo as ai,ArrowIcon as ri,RefreshLeftArrowIcon as li,NotificationIcon as si,UserIcon as ci,ImageErrorIcon as di,ChevronDownIcon as ui,ChevronRightIcon as pi,OverviewIcon as hi,SourceIcon as mi,DestinationIcon as gi,InstrumentationRuleIcon as fi,ActionIcon as vi,SlackLogo as yi,DotIcon as bi,DownloadIcon as xi,SortArrowsIcon as Si,KeyIcon as Ci,TerminalIcon as wi,ExclamationTriangleIcon as ki,TraceViewIcon as $i}from"./icons.js";import{MarkerType as Ei,useNodesState as Ti,useEdgesState as Ni}from"@xyflow/react";import{E as Di}from"./chunks/vendor-C150cdxb.js";import{Y as Ai}from"./chunks/index-BPGpDZxy.js";import"zustand";import"javascript-time-ago";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";const Ii=e=>{const{type:t,name:n,notes:i,signals:o,disabled:a,fields:{collectContainerAttributes:r,collectReplicaSetAttributes:l,collectWorkloadId:s,collectClusterId:c,labelsAttributes:d,annotationsAttributes:u,clusterAttributes:p,overwriteExistingValues:h,attributeNamesToDelete:m,renames:g,piiCategories:x,fallbackSamplingRatio:S,samplingPercentage:C,endpointsFilters:w,servicesNameFilters:k,attributeFilters:$,urlTemplatizationRulesGroups:E}}=e,T=[{title:f.TYPE,value:t},{type:v.ActiveStatus,title:f.STATUS,value:String(!a)},{type:v.Monitors,title:f.SIGNALS_FOR_PROCESSING,value:o?.join(", ")||""},{title:f.NAME,value:n||""},{title:f.NOTES,value:i||""},{type:v.Divider}];if(t===y.K8sAttributes&&(T.push({title:"Collect Container Attributes",value:String(r)}),T.push({title:"Collect ReplicaSet Attributes",value:String(l)}),T.push({title:"Collect Workload ID",value:String(s)}),T.push({title:"Collect Cluster ID",value:String(c)}),d?.length&&T.push({type:v.Divider}),d?.forEach(({labelKey:e,attributeKey:t,from:n,fromSources:i},o)=>{let a="";a+=`Label Key: ${e}\n`,a+=`Attribute Key: ${t}\n`;a+=`From: ${i?.length?i.join(", "):n||b.Pod}\n`,T.push({title:"Label"+(d.length>1?` #${o+1}`:""),value:a})}),u?.length&&T.push({type:v.Divider}),u?.forEach(({annotationKey:e,attributeKey:t,from:n,fromSources:i},o)=>{let a="";a+=`Annotation Key: ${e}\n`,a+=`Attribute Key: ${t}\n`;a+=`From: ${i?.length?i.join(", "):n||b.Pod}\n`,T.push({title:"Annotation"+(u.length>1?` #${o+1}`:""),value:a})})),t===y.AddClusterInfo){T.push({title:"Overwrite Existing Values",value:String(h||!1)});let e="";p?.forEach(({attributeName:t,attributeStringValue:n},i)=>{e+=`${t}: ${n}`,i<p.length-1&&(e+=", ")}),T.push({title:"Attributes",value:e})}if(t===y.DeleteAttributes){let e="";m?.forEach((t,n)=>{e+=t,n<m.length-1&&(e+=", ")}),T.push({title:"Attributes",value:e})}if(t===y.RenameAttributes){let e="";const t=Object.entries(g||{});t.forEach(([n,i],o)=>{e+=`${n}: ${i}`,o<t.length-1&&(e+=", ")}),T.push({title:"Attributes",value:e})}if(t===y.PiiMasking){let e="";x?.forEach((t,n)=>{e+=t,n<x.length-1&&(e+=", ")}),T.push({title:"Categories",value:e})}return t===y.ErrorSampler&&T.push({title:"Sampling Ratio",value:String(S)}),t===y.ProbabilisticSampler&&T.push({title:"Sampling Percentage",value:String(C)}),t===y.LatencySampler&&w?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:n,fallbackSamplingRatio:i},o)=>{let a="";a+=`Service Name: ${e}\n`,a+=`HTTP Route: ${t}\n`,a+=`Min. Latency: ${n}\n`,a+=`Fallback Sampling Ratio: ${i}`,T.push({title:"Endpoint"+(w.length>1?` #${o+1}`:""),value:a})}),t===y.ServiceNameSampler&&k?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:n},i)=>{let o="";o+=`Service Name: ${e}\n`,o+=`Sampling Ratio: ${t}\n`,o+=`Fallback Sampling Ratio: ${n}`,T.push({title:"Filter"+(k.length>1?` #${i+1}`:""),value:o})}),t===y.SpanAttributeSampler&&$?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:n,condition:i},o)=>{let a="";a+=`Service Name: ${e}\n`,a+=`Attribute Key: ${t}\n`,a+=`Fallback Sampling Ratio: ${n}\n`;const r=Object.keys(i)[0];a+=`Condition: ${r}\n`,a+=`Operation: ${i[r]?.operation}\n`,a+=`Expected Value: ${i[r]?.expectedValue}`,"jsonCondition"===r&&(a+=`\nJSON Path: ${i[r].jsonPath}`),T.push({title:"Filter"+($.length>1?` #${o+1}`:""),value:a})}),t===y.URLTemplatization&&E?.forEach((e,t)=>{let n="";e.filterK8sNamespace&&(n+=`Namespace: ${e.filterK8sNamespace}\n`),e.workloadFilters?.length&&e.workloadFilters.forEach(e=>{const t=[e.kind,e.name].filter(Boolean).join("/");t&&(n+=`Workload: ${t}\n`)});const i=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");n+=`Templates: ${i}`,e.notes&&(n+=`\nNotes: ${e.notes}`),T.push({title:"Group"+(E.length>1?` #${t+1}`:""),value:n})}),T},Ri=x.PiiCategories,Oi=h.div`
2
2
  display: flex;
3
3
  flex-direction: row;
4
4
  gap: 32px;
@@ -7,45 +7,45 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
7
7
  border-radius: 32px;
8
8
  padding: 8px;
9
9
  `}
10
- `,fi=[{id:"CREDIT_CARD",label:"Credit Card"}],bi=b.FallbackSamplingRatio,Si=[{value:f.Pod,id:f.Pod},{value:f.Namespace,id:f.Namespace},{value:f.Node,id:f.Node}],xi=[{title:"Label Key",keyName:"labelKey",placeholder:"app.kubernetes.io/name",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"app.kubernetes.name",required:!0},{title:"From Sources",keyName:"fromSources",placeholder:"pod, namespace",componentType:"multi-dropdown",options:Si,required:!0,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],Ci=[{title:"Annotation Key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt",required:!0},{title:"From Sources",keyName:"fromSources",placeholder:"pod, namespace",componentType:"multi-dropdown",options:Si,required:!1,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],Ei=b.EndpointsFilters,Ni=[{title:"Service",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Service name: The rule applies to a specific service name. Only traces originating from this service’s root span will be considered.",required:!0},{title:"HTTP route",keyName:"httpRoute",placeholder:"e.g. /api/v1/users",tooltip:"HTTP route: The specific HTTP route prefix to match for sampling. Only traces with routes beginning with this prefix will be considered. For instance, configuring /buy will also match /buy/product.",required:!0},{title:"Threshold",keyName:"minimumLatencyThreshold",placeholder:"e.g. 1000",tooltip:"Minimum latency threshold (ms): Specifies the minimum latency in milliseconds; traces with latency below this threshold are ignored.",required:!0,type:N.Number},{title:"Fallback",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Fallback sampling ratio: Specifies the percentage of traces that meet the service/http_route filter but fall below the threshold that you still want to retain. For example, if a rule is set for service A and http_route B with a minimum latency threshold of 1 second, you might still want to keep some traces below this threshold. Setting the ratio to 20% ensures that 20% of these traces will be retained.",required:!0,type:N.Number}],ki=b.AttributeNamesToDelete,Ti=b.Renames,wi=b.UrlTemplatizationRulesGroups,$i=[{keyName:"kind",title:"Kind",placeholder:"Any kind",componentType:"dropdown",options:[{id:"Deployment",value:"Deployment"},{id:"StatefulSet",value:"StatefulSet"},{id:"DaemonSet",value:"DaemonSet"}]},{keyName:"name",title:"Name",placeholder:"Any name"}],Di=b.ServicesNameFilters,Ai=[{title:"Service Name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (Across all available spans).",required:!0},{title:"Sampling Ratio",keyName:"samplingRatio",placeholder:"e.g. 10",tooltip:"Specifies the sample rate for all traces.",required:!0,type:N.Number},{title:"Fallback Sampling Ratio",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Specifies the percentage of traces that don’t meet the service name filter and that you still like to retain.",required:!0,type:N.Number}],Ii=b.SamplingPercentage,Oi=b.AttributeFilters,Ri=[{title:"Service Name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (across all available spans).",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"e.g. http.request.method",tooltip:"Specifies the attribute key inside of the span.",required:!0},{title:"Fallback Sampling Ratio",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Specifies the percentage of traces that don’t meet the service name filter and that you still like to retain.",required:!0,type:N.Number},{title:"Condition",keyName:"condition",tooltip:"An object representing the filters for span attributes filters.",required:!0,componentType:M.Dropdown,options:[{id:"stringCondition",value:"String Condition"},{id:"numberCondition",value:"Number Condition"},{id:"booleanCondition",value:"Boolean Condition"},{id:"jsonCondition",value:"JSON Condition"}]},{title:"Operation",keyName:"operation",tooltip:"Specifies the operation to run against the attribute.",required:!0,componentType:M.Dropdown,options:[{id:"exists",value:"Exists"},{id:"equals",value:"Equals"},{id:"not_equals",value:"Not Equals"},{id:"contains",value:"Contains"},{id:"not_contains",value:"Not Contains"},{id:"regex",value:"Regex"},{id:"greater_than",value:"Greater Than"},{id:"less_than",value:"Less Than"},{id:"greater_than_or_equal",value:"Greater Than Or Equal"},{id:"less_than_or_equal",value:"Less Than Or Equal"},{id:"is_valid_json",value:"Is Valid JSON"},{id:"is_invalid_json",value:"Is Invalid JSON"},{id:"jsonpath_exists",value:"JSON Path Exists"},{id:"key_equals",value:"Key Equals"},{id:"key_not_equals",value:"Key Not Equals"}]},{title:"Expected Value",keyName:"expectedValue",placeholder:"e.g. GET",tooltip:"The values to test the attribute against.",required:!0},{title:"JSON Path",keyName:"jsonPath",placeholder:"e.g. $.user.role",tooltip:"An expression used to navigate the JSON structure.",required:!1,renderCondition:e=>"jsonCondition"===e.condition}],Li={[v.K8sAttributes]:({value:i,setValue:o,formErrors:r})=>(a(()=>{i[b.CollectContainerAttributes]||i[b.CollectReplicaSetAttributes]||i[b.CollectWorkloadId]||i[b.CollectClusterId]||i[b.LabelsAttributes]?.length||i[b.AnnotationsAttributes]?.length||(o(b.CollectContainerAttributes,!0),o(b.CollectReplicaSetAttributes,!0),o(b.CollectWorkloadId,!0),o(b.CollectClusterId,!0),o(b.LabelsAttributes,[]),o(b.AnnotationsAttributes,[]))},[]),e(n,{children:[t(x,{title:"Collect Container Attributes",value:i[b.CollectContainerAttributes]||!1,onChange:e=>o(b.CollectContainerAttributes,e),errorMessage:r[b.CollectContainerAttributes]}),t(x,{title:"Collect ReplicaSet Attributes",value:i[b.CollectReplicaSetAttributes]||!1,onChange:e=>o(b.CollectReplicaSetAttributes,e),errorMessage:r[b.CollectReplicaSetAttributes]}),t(x,{title:"Collect Workload ID",value:i[b.CollectWorkloadId]||!1,onChange:e=>o(b.CollectWorkloadId,e),errorMessage:r[b.CollectWorkloadId]}),t(x,{title:"Collect Cluster ID",value:i[b.CollectClusterId]||!1,onChange:e=>o(b.CollectClusterId,e),errorMessage:r[b.CollectClusterId]}),t(T,{columns:xi,value:i[b.LabelsAttributes]||[],onChange:e=>o(b.LabelsAttributes,e),errorMessage:r[b.LabelsAttributes]}),t(T,{columns:Ci,value:i[b.AnnotationsAttributes]||[],onChange:e=>o(b.AnnotationsAttributes,e),errorMessage:r[b.AnnotationsAttributes]})]})),[v.AddClusterInfo]:({value:i,setValue:a,formErrors:o})=>e(n,{children:[t(w,{title:"Overwrite Existing Values",tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",initialValue:i[b.OverwriteExistingValues]||!1,onChange:e=>a(b.OverwriteExistingValues,e)}),t($,{title:"Resource Attributes",value:i[b.ClusterAttributes]?.map(e=>({key:e.attributeName,value:e.attributeStringValue}))||[],onChange:e=>a(b.ClusterAttributes,e.map(e=>({attributeName:e.key,attributeStringValue:e.value}))),required:!0,errorMessage:o[b.ClusterAttributes]})]}),[v.DeleteAttributes]:({value:e,setValue:n,formErrors:i})=>{const a=i[ki],o=e[ki]||[];return t(D,{title:"Attributes to delete",value:o,onChange:e=>n(ki,e),required:!0,errorMessage:a})},[v.RenameAttributes]:({value:e,setValue:n,formErrors:i})=>{const a=i[Ti],o=Object.entries(e[Ti]||{}).map(([e,t])=>({key:e,value:t}));return t($,{title:"Attributes to rename",value:o,onChange:e=>{const t={};e.forEach(e=>t[e.key]=e.value),n(Ti,t)},required:!0,errorMessage:a})},[v.PiiMasking]:({value:n,setValue:o,formErrors:r})=>{const s=r[yi],l=n[yi]||[],[c,d]=i(1===l.length);return a(()=>{if(!l.length){const e=fi.map(({id:e})=>e);o(yi,e),d(1===fi.length)}},[]),e("div",{children:[t(S,{title:"Attributes to mask",required:!0}),t(vi,{$hasError:!!s,children:fi.map(({id:e,label:n})=>t(x,{title:n,disabled:c&&l.includes(e),value:l.includes(e),onChange:t=>((e,t)=>{const n=t?[...l,e]:l.filter(t=>t!==e);o(yi,n),d(1===n.length)})(e,t)},e))}),!!s&&t(C,{children:s})]})},[v.ErrorSampler]:({value:e,setValue:n,formErrors:i})=>{const a=i[bi],o=e[bi];return t(E,{title:"Fallback sampling ratio",required:!0,type:N.Number,min:0,max:100,value:k(o)?"":String(o),onChange:({target:{value:e}})=>{return t=e,n(bi,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[v.ProbabilisticSampler]:({value:e,setValue:n,formErrors:i})=>{const a=i[Ii],o=e[Ii];return t(E,{title:"Sampling percentage",required:!0,type:N.Number,min:0,max:100,value:k(o)?"":String(o),onChange:({target:{value:e}})=>{return t=e,n(Ii,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[v.LatencySampler]:({value:e,setValue:n,formErrors:i})=>{const a=i[Ei],o=e[Ei]||[];return t(T,{columns:Ni,value:o,onChange:e=>{const t=e.map(({serviceName:e,httpRoute:t,minimumLatencyThreshold:n,fallbackSamplingRatio:i})=>({serviceName:e,httpRoute:t,minimumLatencyThreshold:Number(n),fallbackSamplingRatio:Number(i)}));n(Ei,t)},errorMessage:a})},[v.ServiceNameSampler]:({value:e,setValue:n,formErrors:i})=>{const a=i[Di],o=e[Di]||[];return t(T,{columns:Ai,value:o,onChange:e=>{const t=e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:n})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(n)}));n(Di,t)},errorMessage:a})},[v.SpanAttributeSampler]:({value:e,setValue:n,formErrors:i})=>{const a=i[Oi],o=(e[Oi]||[]).map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:n,condition:i})=>{const a=Object.entries(i).filter(([e,t])=>t)[0][0];return{serviceName:e,attributeKey:t,fallbackSamplingRatio:n,condition:a,operation:i[a]?.operation,expectedValue:i[a]?.expectedValue,jsonPath:i[a]?.jsonPath}});return t(T,{columns:Ri,value:o,onChange:e=>{const t=e.map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:n,condition:i,operation:a,expectedValue:o,jsonPath:r})=>{const s={serviceName:e,attributeKey:t,fallbackSamplingRatio:Number(n),condition:{[i]:{operation:a,expectedValue:o}}};return r&&(s.condition[i].jsonPath=r),s});n(Oi,t)},errorMessage:a,limitFieldsPerRow:3})},[v.URLTemplatization]:({value:i,setValue:a,formErrors:r})=>{const s=r[wi],l=i[wi]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>a(wi,e),d=(e,t)=>c(l.map((n,i)=>i===e?{...n,...t}:n));return e(n,{children:[l.map((n,i)=>e(o,{children:[t(A,{}),e(I,{$gap:12,children:[e(O,{$justifyContent:"space-between",$alignItems:"center",children:[t(S,{title:`Rule Group ${i+1}`}),l.length>1&&t(R,{size:30,onClick:()=>{return e=i,c(l.filter((t,n)=>n!==e));var e},children:t(Mn,{})})]}),t(E,{title:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:n.filterK8sNamespace||"",onChange:e=>d(i,{filterK8sNamespace:e.target.value})}),t(T,{title:"Workload Filters",columns:$i,value:n.workloadFilters||[],onChange:e=>d(i,{workloadFilters:e})}),t(D,{title:"Templates",required:!0,value:n.templatizationRules.map(e=>e.template),onChange:e=>d(i,{templatizationRules:e.map(e=>({template:e}))})})]}),!!s&&t(C,{children:s})]},`url-templatization-group-${i}`)),t(L,{label:"Add Rule Group",onClick:()=>c([...l,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(A,{})]})}},Mi=({actionType:e,value:n,setValue:i,formErrors:a})=>{if(!e)return null;const o=Li[e];return o?t(o,{value:n,setValue:i,formErrors:a}):null},Fi=p.div`
10
+ `,Mi=[{id:"CREDIT_CARD",label:"Credit Card"}],Li=x.FallbackSamplingRatio,Fi=[{value:b.Pod,id:b.Pod},{value:b.Namespace,id:b.Namespace},{value:b.Node,id:b.Node}],Pi=[{title:"Label Key",keyName:"labelKey",placeholder:"app.kubernetes.io/name",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"app.kubernetes.name",required:!0},{title:"From Sources",keyName:"fromSources",placeholder:"pod, namespace",componentType:"multi-dropdown",options:Fi,required:!0,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],_i=[{title:"Annotation Key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt",required:!0},{title:"From Sources",keyName:"fromSources",placeholder:"pod, namespace",componentType:"multi-dropdown",options:Fi,required:!1,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],zi=x.EndpointsFilters,Ki=[{title:"Service",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Service name: The rule applies to a specific service name. Only traces originating from this service’s root span will be considered.",required:!0},{title:"HTTP route",keyName:"httpRoute",placeholder:"e.g. /api/v1/users",tooltip:"HTTP route: The specific HTTP route prefix to match for sampling. Only traces with routes beginning with this prefix will be considered. For instance, configuring /buy will also match /buy/product.",required:!0},{title:"Threshold",keyName:"minimumLatencyThreshold",placeholder:"e.g. 1000",tooltip:"Minimum latency threshold (ms): Specifies the minimum latency in milliseconds; traces with latency below this threshold are ignored.",required:!0,type:$.Number},{title:"Fallback",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Fallback sampling ratio: Specifies the percentage of traces that meet the service/http_route filter but fall below the threshold that you still want to retain. For example, if a rule is set for service A and http_route B with a minimum latency threshold of 1 second, you might still want to keep some traces below this threshold. Setting the ratio to 20% ensures that 20% of these traces will be retained.",required:!0,type:$.Number}],ji=x.AttributeNamesToDelete,Bi=x.Renames,Wi=x.UrlTemplatizationRulesGroups,Vi=[{keyName:"kind",title:"Kind",placeholder:"Any kind",componentType:"dropdown",options:[{id:"Deployment",value:"Deployment"},{id:"StatefulSet",value:"StatefulSet"},{id:"DaemonSet",value:"DaemonSet"}]},{keyName:"name",title:"Name",placeholder:"Any name"}],Ui=x.ServicesNameFilters,Hi=[{title:"Service Name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (Across all available spans).",required:!0},{title:"Sampling Ratio",keyName:"samplingRatio",placeholder:"e.g. 10",tooltip:"Specifies the sample rate for all traces.",required:!0,type:$.Number},{title:"Fallback Sampling Ratio",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Specifies the percentage of traces that don’t meet the service name filter and that you still like to retain.",required:!0,type:$.Number}],qi=x.SamplingPercentage,Gi=x.AttributeFilters,Yi=[{title:"Service Name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (across all available spans).",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"e.g. http.request.method",tooltip:"Specifies the attribute key inside of the span.",required:!0},{title:"Fallback Sampling Ratio",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Specifies the percentage of traces that don’t meet the service name filter and that you still like to retain.",required:!0,type:$.Number},{title:"Condition",keyName:"condition",tooltip:"An object representing the filters for span attributes filters.",required:!0,componentType:F.Dropdown,options:[{id:"stringCondition",value:"String Condition"},{id:"numberCondition",value:"Number Condition"},{id:"booleanCondition",value:"Boolean Condition"},{id:"jsonCondition",value:"JSON Condition"}]},{title:"Operation",keyName:"operation",tooltip:"Specifies the operation to run against the attribute.",required:!0,componentType:F.Dropdown,options:[{id:"exists",value:"Exists"},{id:"equals",value:"Equals"},{id:"not_equals",value:"Not Equals"},{id:"contains",value:"Contains"},{id:"not_contains",value:"Not Contains"},{id:"regex",value:"Regex"},{id:"greater_than",value:"Greater Than"},{id:"less_than",value:"Less Than"},{id:"greater_than_or_equal",value:"Greater Than Or Equal"},{id:"less_than_or_equal",value:"Less Than Or Equal"},{id:"is_valid_json",value:"Is Valid JSON"},{id:"is_invalid_json",value:"Is Invalid JSON"},{id:"jsonpath_exists",value:"JSON Path Exists"},{id:"key_equals",value:"Key Equals"},{id:"key_not_equals",value:"Key Not Equals"}]},{title:"Expected Value",keyName:"expectedValue",placeholder:"e.g. GET",tooltip:"The values to test the attribute against.",required:!0},{title:"JSON Path",keyName:"jsonPath",placeholder:"e.g. $.user.role",tooltip:"An expression used to navigate the JSON structure.",required:!1,renderCondition:e=>"jsonCondition"===e.condition}],Ji={[y.K8sAttributes]:({value:i,setValue:a,formErrors:r})=>(o(()=>{i[x.CollectContainerAttributes]||i[x.CollectReplicaSetAttributes]||i[x.CollectWorkloadId]||i[x.CollectClusterId]||i[x.LabelsAttributes]?.length||i[x.AnnotationsAttributes]?.length||(a(x.CollectContainerAttributes,!0),a(x.CollectReplicaSetAttributes,!0),a(x.CollectWorkloadId,!0),a(x.CollectClusterId,!0),a(x.LabelsAttributes,[]),a(x.AnnotationsAttributes,[]))},[]),e(n,{children:[t(C,{title:"Collect Container Attributes",value:i[x.CollectContainerAttributes]||!1,onChange:e=>a(x.CollectContainerAttributes,e),errorMessage:r[x.CollectContainerAttributes]}),t(C,{title:"Collect ReplicaSet Attributes",value:i[x.CollectReplicaSetAttributes]||!1,onChange:e=>a(x.CollectReplicaSetAttributes,e),errorMessage:r[x.CollectReplicaSetAttributes]}),t(C,{title:"Collect Workload ID",value:i[x.CollectWorkloadId]||!1,onChange:e=>a(x.CollectWorkloadId,e),errorMessage:r[x.CollectWorkloadId]}),t(C,{title:"Collect Cluster ID",value:i[x.CollectClusterId]||!1,onChange:e=>a(x.CollectClusterId,e),errorMessage:r[x.CollectClusterId]}),t(T,{columns:Pi,value:i[x.LabelsAttributes]||[],onChange:e=>a(x.LabelsAttributes,e),errorMessage:r[x.LabelsAttributes]}),t(T,{columns:_i,value:i[x.AnnotationsAttributes]||[],onChange:e=>a(x.AnnotationsAttributes,e),errorMessage:r[x.AnnotationsAttributes]})]})),[y.AddClusterInfo]:({value:i,setValue:o,formErrors:a})=>e(n,{children:[t(N,{title:"Overwrite Existing Values",tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",initialValue:i[x.OverwriteExistingValues]||!1,onChange:e=>o(x.OverwriteExistingValues,e)}),t(D,{title:"Resource Attributes",value:i[x.ClusterAttributes]?.map(e=>({key:e.attributeName,value:e.attributeStringValue}))||[],onChange:e=>o(x.ClusterAttributes,e.map(e=>({attributeName:e.key,attributeStringValue:e.value}))),required:!0,errorMessage:a[x.ClusterAttributes]})]}),[y.DeleteAttributes]:({value:e,setValue:n,formErrors:i})=>{const o=i[ji],a=e[ji]||[];return t(A,{title:"Attributes to delete",value:a,onChange:e=>n(ji,e),required:!0,errorMessage:o})},[y.RenameAttributes]:({value:e,setValue:n,formErrors:i})=>{const o=i[Bi],a=Object.entries(e[Bi]||{}).map(([e,t])=>({key:e,value:t}));return t(D,{title:"Attributes to rename",value:a,onChange:e=>{const t={};e.forEach(e=>t[e.key]=e.value),n(Bi,t)},required:!0,errorMessage:o})},[y.PiiMasking]:({value:n,setValue:a,formErrors:r})=>{const l=r[Ri],s=n[Ri]||[],[c,d]=i(1===s.length);return o(()=>{if(!s.length){const e=Mi.map(({id:e})=>e);a(Ri,e),d(1===Mi.length)}},[]),e("div",{children:[t(S,{title:"Attributes to mask",required:!0}),t(Oi,{$hasError:!!l,children:Mi.map(({id:e,label:n})=>t(C,{title:n,disabled:c&&s.includes(e),value:s.includes(e),onChange:t=>((e,t)=>{const n=t?[...s,e]:s.filter(t=>t!==e);a(Ri,n),d(1===n.length)})(e,t)},e))}),!!l&&t(w,{children:l})]})},[y.ErrorSampler]:({value:e,setValue:n,formErrors:i})=>{const o=i[Li],a=e[Li];return t(k,{title:"Fallback sampling ratio",required:!0,type:$.Number,min:0,max:100,value:E(a)?"":String(a),onChange:({target:{value:e}})=>{return t=e,n(Li,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:o})},[y.ProbabilisticSampler]:({value:e,setValue:n,formErrors:i})=>{const o=i[qi],a=e[qi];return t(k,{title:"Sampling percentage",required:!0,type:$.Number,min:0,max:100,value:E(a)?"":String(a),onChange:({target:{value:e}})=>{return t=e,n(qi,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:o})},[y.LatencySampler]:({value:e,setValue:n,formErrors:i})=>{const o=i[zi],a=e[zi]||[];return t(T,{columns:Ki,value:a,onChange:e=>{const t=e.map(({serviceName:e,httpRoute:t,minimumLatencyThreshold:n,fallbackSamplingRatio:i})=>({serviceName:e,httpRoute:t,minimumLatencyThreshold:Number(n),fallbackSamplingRatio:Number(i)}));n(zi,t)},errorMessage:o})},[y.ServiceNameSampler]:({value:e,setValue:n,formErrors:i})=>{const o=i[Ui],a=e[Ui]||[];return t(T,{columns:Hi,value:a,onChange:e=>{const t=e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:n})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(n)}));n(Ui,t)},errorMessage:o})},[y.SpanAttributeSampler]:({value:e,setValue:n,formErrors:i})=>{const o=i[Gi],a=(e[Gi]||[]).map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:n,condition:i})=>{const o=Object.entries(i).filter(([e,t])=>t)[0][0];return{serviceName:e,attributeKey:t,fallbackSamplingRatio:n,condition:o,operation:i[o]?.operation,expectedValue:i[o]?.expectedValue,jsonPath:i[o]?.jsonPath}});return t(T,{columns:Yi,value:a,onChange:e=>{const t=e.map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:n,condition:i,operation:o,expectedValue:a,jsonPath:r})=>{const l={serviceName:e,attributeKey:t,fallbackSamplingRatio:Number(n),condition:{[i]:{operation:o,expectedValue:a}}};return r&&(l.condition[i].jsonPath=r),l});n(Gi,t)},errorMessage:o,limitFieldsPerRow:3})},[y.URLTemplatization]:({value:i,setValue:o,formErrors:r})=>{const l=r[Wi],s=i[Wi]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>o(Wi,e),d=(e,t)=>c(s.map((n,i)=>i===e?{...n,...t}:n));return e(n,{children:[s.map((n,i)=>e(a,{children:[t(I,{}),e(R,{$gap:12,children:[e(O,{$justifyContent:"space-between",$alignItems:"center",children:[t(S,{title:`Rule Group ${i+1}`}),s.length>1&&t(M,{size:30,onClick:()=>{return e=i,c(s.filter((t,n)=>n!==e));var e},children:t(Gn,{})})]}),t(k,{title:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:n.filterK8sNamespace||"",onChange:e=>d(i,{filterK8sNamespace:e.target.value})}),t(T,{title:"Workload Filters",columns:Vi,value:n.workloadFilters||[],onChange:e=>d(i,{workloadFilters:e})}),t(A,{title:"Templates",required:!0,value:n.templatizationRules.map(e=>e.template),onChange:e=>d(i,{templatizationRules:e.map(e=>({template:e}))})})]}),!!l&&t(w,{children:l})]},`url-templatization-group-${i}`)),t(L,{label:"Add Rule Group",onClick:()=>c([...s,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(I,{})]})}},Xi=({actionType:e,value:n,setValue:i,formErrors:o})=>{if(!e)return null;const a=Ji[e];return a?t(a,{value:n,setValue:i,formErrors:o}):null},Qi=h.div`
11
11
  display: flex;
12
12
  flex-direction: column;
13
13
  gap: 24px;
14
14
  padding: 4px;
15
- `,_i=p(z)`
15
+ `,Zi=h(W)`
16
16
  margin-bottom: 12px;
17
- `,Pi=({isUpdate:n,action:i,formData:a,formErrors:o,handleFormChange:r})=>{const s=h();return e(Fi,{children:[n&&e("div",{children:[t(_i,{children:"Status"}),t(F,{options:[{icon:Fn,label:g.ENABLED,value:!1,selectedBgColor:s.text.success+_["050"]},{icon:_n,label:g.DISABLED,value:!0,selectedBgColor:s.text.error+_["050"]}],selected:a.disabled,setSelected:e=>r("disabled",e)})]}),!n&&t(P,{title:"",description:i.docsDescription,actionButton:t(K,{endpoint:i.docsEndpoint})}),t(j,{title:"Signals for Processing",required:!0,allowedSignals:i.allowedSignals,selectedSignals:a.signals||[],setSelectedSignals:e=>r("signals",e),errorMessage:o.signals}),!n&&t(E,{title:"Action name",placeholder:"Use a name that describes the action",value:a.name||"",onChange:({target:{value:e}})=>r("name",e),errorMessage:o.name}),t(Mi,{actionType:i.type,value:a.fields,setValue:(e,t)=>r(`fields.${e}`,t),formErrors:o}),t(V,{title:"Notes",value:a.notes||"",onChange:({target:{value:e}})=>r("notes",e),errorMessage:o.notes})]})},Ki=r(({children:a,width:o=640,title:r,titleTooltip:c,hideEditTitleFromEdit:d,icons:u,iconSrcs:p,isEdit:m=!1,isFormDirty:g=!1,isLastItem:y=!1,onClose:v,onEdit:f,onSave:b,onDelete:S,onCancel:x,tabs:C,headerActionButtons:E},N)=>{const k=h(),{drawerType:T,setDrawerType:w,setDrawerEntityId:$}=U();B({key:"Enter",active:m},()=>j());const[D,A]=i(!1),[I,O]=i(!1),R=s(null),L=T===J.Source,M=()=>{A(!1),O(!1)},F=()=>{M(),f&&f(!1),w(null),$(null),v?.()};l(N,()=>({closeDrawer:F}));const _=()=>{R.current?.clearTitle(),x&&x(),M()},P=()=>{const e=R.current?.isTitleDirty();g||e?O(!0):_()},K=()=>{A(!0)},j=()=>{b&&b(R.current?.getTitle()||"")},V=E||[];return f&&!m&&V.push({"data-id":"drawer-edit",variant:"tertiary",onClick:()=>f(!0),children:e(n,{children:[t(Pn,{}),t(z,{size:14,family:"secondary",decoration:"underline",children:"Edit"})]})}),S&&!m&&V.push({"data-id":"drawer-delete",variant:"tertiary",onClick:K,children:e(n,{children:[t(Mn,{}),t(z,{color:k.text.error,size:14,family:"secondary",decoration:"underline",children:L?W.UNINSTRUMENT:W.DELETE})]})}),e(n,{children:[t(H,{isOpen:!0,onClose:m?P:F,closeOnEscape:!D&&!I,width:`${o+64}px`,header:{icons:u,iconSrcs:p,title:r,titleTooltip:c,replaceTitleWith:!d&&m?t(ji,{ref:R,title:r}):void 0,actionButtons:V,tabs:C},footer:{isOpen:m,leftButtons:[{"data-id":"drawer-save",variant:"primary",onClick:j,children:W.SAVE},{"data-id":"drawer-cancel",variant:"secondary",onClick:P,children:W.CANCEL}],rightButtons:S?[{"data-id":"drawer-delete",variant:"tertiary",onClick:K,children:e(n,{children:[t(Mn,{}),t(z,{size:14,color:k.text.error,family:"secondary",decoration:"underline",children:W.DELETE})]})}]:[]},children:a}),t(q,{isOpen:D,noOverlay:!0,name:`${T}${r?` (${r})`:""}`,type:T,isLastItem:y,onApprove:()=>{S&&S(),M()},onDeny:M}),t(G,{isOpen:I,noOverlay:!0,name:"edit mode",onApprove:_,onDeny:M})]})}),ji=r(({title:e},n)=>{const[o,r]=i(e);return a(()=>{r(e)},[e]),l(n,()=>({getTitle:()=>o||e,isTitleDirty:()=>o!==e,clearTitle:()=>r(e)})),t(E,{"data-id":"title",value:o,onChange:e=>r(e.target.value)})});ji.displayName=ji.name,Ki.displayName=Ki.name;const Vi=p.div`
17
+ `,eo=({isUpdate:n,action:i,formData:o,formErrors:a,handleFormChange:r})=>{const l=g();return e(Qi,{children:[n&&e("div",{children:[t(Zi,{children:"Status"}),t(P,{options:[{icon:Yn,label:f.ENABLED,value:!1,selectedBgColor:l.text.success+_["050"]},{icon:Jn,label:f.DISABLED,value:!0,selectedBgColor:l.text.error+_["050"]}],selected:o.disabled,setSelected:e=>r("disabled",e)})]}),!n&&t(z,{title:"",description:i.docsDescription,actionButton:t(K,{endpoint:i.docsEndpoint})}),t(j,{title:"Signals for Processing",required:!0,allowedSignals:i.allowedSignals,selectedSignals:o.signals||[],setSelectedSignals:e=>r("signals",e),errorMessage:a.signals}),!n&&t(k,{title:"Action name",placeholder:"Use a name that describes the action",value:o.name||"",onChange:({target:{value:e}})=>r("name",e),errorMessage:a.name}),t(Xi,{actionType:i.type,value:o.fields,setValue:(e,t)=>r(`fields.${e}`,t),formErrors:a}),t(B,{title:"Notes",value:o.notes||"",onChange:({target:{value:e}})=>r("notes",e),errorMessage:a.notes})]})},to=r(({children:o,width:a=640,title:r,titleTooltip:c,hideEditTitleFromEdit:d,icons:u,iconSrcs:p,isEdit:h=!1,isFormDirty:m=!1,isLastItem:f=!1,onClose:v,onEdit:y,onSave:b,onDelete:x,onCancel:S,tabs:C,headerActionButtons:w},k)=>{const $=g(),{drawerType:E,setDrawerType:T,setDrawerEntityId:N}=V();U({key:"Enter",active:h},()=>K());const[D,A]=i(!1),[I,R]=i(!1),O=l(null),M=E===J.Source,L=()=>{A(!1),R(!1)},F=()=>{L(),y&&y(!1),T(null),N(null),v?.()};s(k,()=>({closeDrawer:F}));const P=()=>{O.current?.clearTitle(),S&&S(),L()},_=()=>{const e=O.current?.isTitleDirty();m||e?R(!0):P()},z=()=>{A(!0)},K=()=>{b&&b(O.current?.getTitle()||"")},j=w||[];return y&&!h&&j.push({"data-id":"drawer-edit",variant:"tertiary",onClick:()=>y(!0),children:e(n,{children:[t(Xn,{}),t(W,{size:14,family:"secondary",decoration:"underline",children:"Edit"})]})}),x&&!h&&j.push({"data-id":"drawer-delete",variant:"tertiary",onClick:z,children:e(n,{children:[t(Gn,{}),t(W,{color:$.text.error,size:14,family:"secondary",decoration:"underline",children:M?H.UNINSTRUMENT:H.DELETE})]})}),e(n,{children:[t(q,{isOpen:!0,onClose:h?_:F,closeOnEscape:!D&&!I,width:`${a+64}px`,header:{icons:u,iconSrcs:p,title:r,titleTooltip:c,replaceTitleWith:!d&&h?t(no,{ref:O,title:r}):void 0,actionButtons:j,tabs:C},footer:{isOpen:h,leftButtons:[{"data-id":"drawer-save",variant:"primary",onClick:K,children:H.SAVE},{"data-id":"drawer-cancel",variant:"secondary",onClick:_,children:H.CANCEL}],rightButtons:x?[{"data-id":"drawer-delete",variant:"tertiary",onClick:z,children:e(n,{children:[t(Gn,{}),t(W,{size:14,color:$.text.error,family:"secondary",decoration:"underline",children:H.DELETE})]})}]:[]},children:o}),t(G,{isOpen:D,noOverlay:!0,name:`${E}${r?` (${r})`:""}`,type:E,isLastItem:f,onApprove:()=>{x&&x(),L()},onDeny:L}),t(Y,{isOpen:I,noOverlay:!0,name:"edit mode",onApprove:P,onDeny:L})]})}),no=r(({title:e},n)=>{const[a,r]=i(e);return o(()=>{r(e)},[e]),s(n,()=>({getTitle:()=>a||e,isTitleDirty:()=>a!==e,clearTitle:()=>r(e)})),t(k,{"data-id":"title",value:a,onChange:e=>r(e.target.value)})});no.displayName=no.name,to.displayName=to.name;const io=h.div`
18
18
  width: 100%;
19
19
  height: 100%;
20
20
  max-height: calc(100vh - 220px);
21
21
  overflow: overlay;
22
22
  overflow-y: auto;
23
- `,zi=p.div`
23
+ `,oo=h.div`
24
24
  display: flex;
25
25
  flex-direction: column;
26
26
  gap: 12px;
27
- `,Ui=({updateAction:n,deleteAction:o})=>{const{actions:r}=Y(),{drawerType:l,drawerEntityId:d}=U(),u=s(null),p=l===J.Action,[m,h]=i(!1),[y,v]=i(!1),{formData:f,formErrors:b,handleFormChange:S,resetFormData:x,validateForm:C,loadFormWithDrawerItem:E}=X(),N=c(()=>{if(d)return r?.find(e=>Q(e)===d)},[d,r]);if(a(()=>{p&&N?E(N):x()},[p,N]),!N)return null;const k=Z.find(({type:e})=>e===N.type)||Z.find(({label:e})=>"Attributes"===e)?.items?.find(({type:e})=>e===N.type)||Z.find(({label:e})=>"Samplers"===e)?.items?.find(({type:e})=>e===N.type);return t(Ki,{ref:u,title:N.name||N.type,icons:[ne(N.type)],isEdit:m,isFormDirty:y,onEdit:e=>{h("boolean"!=typeof e||e)},onSave:e=>{if(C({withAlert:!0,alertTitle:ie.Update})){const t=e!==N.type?e:"";S("name",t),n(d,{...f,name:t}),h(!1),v(!1)}},onDelete:()=>{o(d,N.type),h(!1),v(!1),u.current?.closeDrawer()},onCancel:()=>{h(!1),v(!1),E(N)},children:m&&k?t(Vi,{children:t(Pi,{isUpdate:!0,action:k,formData:f,formErrors:b,handleFormChange:(...e)=>{v(!0),S(...e)}})}):e(zi,{children:[t(ee,{conditions:N.conditions||[]}),t(te,{title:g.ACTION_DETAILS,data:N?gi(N):[]})]})})},Bi=p(I)`
27
+ `,ao=({updateAction:n,deleteAction:a})=>{const{actions:r}=X(),{drawerType:s,drawerEntityId:d}=V(),u=l(null),p=s===J.Action,[h,m]=i(!1),[g,v]=i(!1),{formData:y,formErrors:b,handleFormChange:x,resetFormData:S,validateForm:C,loadFormWithDrawerItem:w}=Q(),k=c(()=>{if(d)return r?.find(e=>Z(e)===d)},[d,r]);if(o(()=>{p&&k?w(k):S()},[p,k]),!k)return null;const $=ee.find(({type:e})=>e===k.type)||ee.find(({label:e})=>"Attributes"===e)?.items?.find(({type:e})=>e===k.type)||ee.find(({label:e})=>"Samplers"===e)?.items?.find(({type:e})=>e===k.type);return t(to,{ref:u,title:k.name||k.type,icons:[ie(k.type)],isEdit:h,isFormDirty:g,onEdit:e=>{m("boolean"!=typeof e||e)},onSave:e=>{if(C({withAlert:!0,alertTitle:oe.Update})){const t=e!==k.type?e:"";x("name",t),n(d,{...y,name:t}),m(!1),v(!1)}},onDelete:()=>{a(d,k.type),m(!1),v(!1),u.current?.closeDrawer()},onCancel:()=>{m(!1),v(!1),w(k)},children:h&&$?t(io,{children:t(eo,{isUpdate:!0,action:$,formData:y,formErrors:b,handleFormChange:(...e)=>{v(!0),x(...e)}})}):e(oo,{children:[t(te,{conditions:k.conditions||[]}),t(ne,{title:f.ACTION_DETAILS,data:k?Ii(k):[]})]})})},ro=h(R)`
28
28
  margin-top: 24px;
29
29
  gap: 12px;
30
- `,Wi=({createAction:n})=>{const{version:a}=ae(),{currentModal:o,setCurrentModal:r}=oe(),s=o===J.Action,{formData:l,formErrors:d,handleFormChange:u,resetFormData:p,validateForm:m}=X(),h=c(()=>{if(!a)return Z;const e=re(a);return Z.map(t=>({...t,items:t.items?.filter(t=>!t.minVersion||t.minVersion<=e)}))},[a]),[y,v]=i(void 0),f=()=>{p(),v(void 0),r("")},b=()=>{if(!m({withAlert:!0,alertTitle:ie.Create}))return null;n(l),f()};return B({key:"Enter",active:s},()=>b()),t(se,{isOpen:s,onClose:f,header:{title:"Add Action"},actionComponent:t(me,{buttons:[{variant:"primary",label:"DONE",onClick:b,disabled:!y}]}),children:e(le,{children:[t(P,{title:"Select Action",description:"Select an action to modify telemetry data before it`s sent to destinations. Choose an action type and configure its details."}),e(Bi,{children:[t(ce,{type:de.Warning,message:ue.DEFINED_FOR_ALL_STREAMS(g.ACTIONS)}),t(pe,{options:h,selectedOption:y,onOptionSelect:e=>{return t=e,p(),u("type",t?.type||""),void v(t);var t},autoFocus:!y?.type})]}),y?.type?e("div",{children:[t(A,{margin:"16px 0"}),t(Pi,{action:y,formData:l,formErrors:d,handleFormChange:u})]}):null]})})},Hi=e=>{const{type:t,fields:{collectContainerAttributes:n,collectReplicaSetAttributes:i,collectWorkloadId:a,collectClusterId:o,labelsAttributes:r,annotationsAttributes:s,clusterAttributes:l,overwriteExistingValues:c,attributeNamesToDelete:d,renames:u,piiCategories:p,fallbackSamplingRatio:m,samplingPercentage:h,endpointsFilters:g,attributeFilters:y,servicesNameFilters:b,urlTemplatizationRulesGroups:S}}=e;let x="";if(t===v.K8sAttributes&&(n&&(x+="Container Attributes, "),i&&(x+="ReplicaSet Attributes, "),a&&(x+="Workload ID, "),o&&(x+="Cluster ID, "),r?.forEach(({labelKey:e,attributeKey:t,from:n,fromSources:i},a)=>{const o=i?.length?i.join(","):n||f.Pod;x+=`Label: ${e} ${t} ${o} `,a===r.length-1&&(x+=", ")}),s?.forEach(({annotationKey:e,attributeKey:t,from:n,fromSources:i},a)=>{const o=i?.length?i.join(","):n||f.Pod;x+=`Annotation: ${e} ${t} ${o} `,a===s.length-1&&(x+=", ")})),t===v.AddClusterInfo&&(x+=`Overwrite Existing: ${c}\n`,l?.forEach(({attributeName:e,attributeStringValue:t},n)=>{x+=`${e}: ${t}`,n<l.length-1&&(x+=", ")})),t===v.DeleteAttributes&&d?.forEach((e,t)=>{x+=e,t<d.length-1&&(x+=", ")}),t===v.RenameAttributes){const e=Object.entries(u||{});e.forEach(([t,n],i)=>{x+=`${t}: ${n}`,i<e.length-1&&(x+=", ")})}return t===v.PiiMasking&&p?.forEach((e,t)=>{x+=e,t<p.length-1&&(x+=", ")}),t===v.ErrorSampler&&(x+=String(m)),t===v.ProbabilisticSampler&&(x+=String(h),x+="%"),t===v.LatencySampler&&g?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:n,fallbackSamplingRatio:i},a)=>{x+=`Endpoint${g.length>1?` #${a+1}`:""}=${e}${t}\n`,x+=` Latency=${n}`,x+=` Sampling=${i}`,a<g.length-1&&(x+=", ")}),t===v.ServiceNameSampler&&b?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:n})=>{x+=`Service Name: ${e}, `,x+=`Sampling Ratio: ${t}, `,x+=`Fallback Sampling Ratio: ${n}\n`}),t===v.SpanAttributeSampler&&y?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:n})=>{x+=`Service Name: ${e}, `,x+=`Attribute Key: ${t}, `,x+=`Fallback Sampling Ratio: ${n}\n`}),t===v.URLTemplatization&&S?.forEach((e,t)=>{const n=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");x+=`Group ${t+1}: ${n}`,t<S.length-1&&(x+="; ")}),x},qi=({conditions:e,id:n})=>{const{errors:i,warnings:a,disableds:o,hasLoadings:r}=c(()=>he(e),[e]),s=i.length>0?i:a.length>0?a:o.length>0?o:[];if(s.length>0)return t("div",{style:{lineHeight:1},children:t(Gi,{conditions:s,id:n})});const l=r?ye.Loading:de.Success;return t("div",{style:{lineHeight:1},children:t(ge,{status:l,title:l,withBorder:!0,withIcon:!0})})},Gi=({conditions:e,id:n})=>{const i=h();return t(O,{children:ve(e).map(({status:e,type:a,reason:o,message:r},s)=>{"loading"!==e&&"disabled"!==e||(e=de.Info);const l=be(e,i);return t(fe,{titleIcon:l,title:a,text:r||o||"",children:t(ge,{status:e,title:o||a,withBorder:!0,withIcon:!0})},`condition-${n}-${e}-${a}-${s}`)})})},Ji=({instrumentationRules:e,sources:t,actions:n,destinations:i,searchText:a,selectedCategory:o})=>{const r=a?e.filter(e=>e.type?.toLowerCase().includes(a)||e.ruleName?.toLowerCase().includes(a)):e,s=a?t.filter(e=>e.name?.toLowerCase().includes(a)||e.otelServiceName?.toLowerCase().includes(a)||e.namespace?.toLowerCase().includes(a)):t,l=a?n.filter(e=>e.type?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):n,c=a?i.filter(e=>e.destinationType.displayName?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):i,d=[{category:J.Source,label:"Sources",count:s.length,entities:[]},{category:J.Action,label:"Actions",count:l.length,entities:[]},{category:J.Destination,label:"Destinations",count:c.length,entities:[]},{category:J.InstrumentationRule,label:"Instrumentation Rules",count:r.length,entities:[]}];d.unshift({category:"all",label:"All",count:r.length+s.length+l.length+c.length,entities:[]});const u=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(o)).map(e=>({...e,entities:e.category===J.InstrumentationRule?r:e.category===J.Source?s:e.category===J.Action?l:e.category===J.Destination?c:[]}));return{categories:d,searchResults:u}},Yi=[{key:"icon",title:""},{key:"name",title:g.NAME,sortable:!0},{key:"signals",title:g.MONITORS},{key:"active-status",title:g.STATUS},{key:"conditions",title:"Conditions"},{key:"type",title:g.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:g.NOTES,sortable:!0}],Xi=({maxHeight:n,maxWidth:i})=>{const a=h(),o=Se(),{actions:r,actionsLoading:s}=Y(),{setDrawerType:l,setDrawerEntityId:d}=U(),u=c(()=>Ji({instrumentationRules:[],sources:[],actions:xe(r,o),destinations:[],searchText:o.searchText,selectedCategory:J.Action}).searchResults.find(({category:e})=>e===J.Action)?.entities||[],[r,o]),p=c(()=>u.map(e=>{const{hasErrors:n,hasWarnings:i,hasDisableds:o}=he(e.conditions||[]);return{status:n?de.Error:i?de.Warning:void 0,faded:o,onClick:()=>{l(J.Action),d(e.id)},cells:[{columnKey:"icon",component:()=>t(Ce,{icon:ne(e.type)})},{columnKey:"name",value:Ee(e,J.Action,{prioritizeDisplayName:!0})},{columnKey:"type",value:e.type,textColor:a.text.info},{columnKey:"notes",value:e.notes,textColor:a.text.info,withTooltip:!0},{columnKey:"spec",value:Hi(e),textColor:a.text.info,withTooltip:!0},{columnKey:"signals",component:()=>t(Ne,{withLabels:!0,monitors:e.signals||[]})},{columnKey:"conditions",component:()=>t(qi,{conditions:e.conditions||[],id:e.id})},{columnKey:"active-status",component:()=>t("div",{style:{lineHeight:1},children:t(ge,{status:e.disabled?de.Error:de.Success,title:e.disabled?g.DISABLED:g.ENABLED,withIcon:!0,withBorder:!0})})}]}}),[u]),{badge:m,badgeTooltip:y}=c(()=>u.length!==r.length?{badge:`${u.length}/${r.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:r.length,badgeTooltip:void 0},[u,r]);return e(ke,{$maxWidth:i,children:[t(Te,{children:t(we,{icon:$e(J.Action),title:g.ACTIONS,badge:m,badgeTooltip:y,loading:s})}),t(De,{$maxHeight:n,children:t(Ae,{columns:Yi,rows:p})}),!u.length&&t(Ie,{style:{marginTop:"2rem"},children:t(Oe,{})})]})},Qi=p(I)`
30
+ `,lo=({createAction:n})=>{const{version:o}=ae(),{currentModal:a,setCurrentModal:r}=re(),l=a===J.Action,{formData:s,formErrors:d,handleFormChange:u,resetFormData:p,validateForm:h}=Q(),m=c(()=>{if(!o)return ee;const e=le(o);return ee.map(t=>({...t,items:t.items?.filter(t=>!t.minVersion||t.minVersion<=e)}))},[o]),[g,v]=i(void 0),y=()=>{p(),v(void 0),r("")},b=()=>{if(!h({withAlert:!0,alertTitle:oe.Create}))return null;n(s),y()};return U({key:"Enter",active:l},()=>b()),t(se,{isOpen:l,onClose:y,header:{title:"Add Action"},actionComponent:t(me,{buttons:[{variant:"primary",label:"DONE",onClick:b,disabled:!g}]}),children:e(ce,{children:[t(z,{title:"Select Action",description:"Select an action to modify telemetry data before it`s sent to destinations. Choose an action type and configure its details."}),e(ro,{children:[t(de,{type:ue.Warning,message:pe.DEFINED_FOR_ALL_STREAMS(f.ACTIONS)}),t(he,{options:m,selectedOption:g,onOptionSelect:e=>{return t=e,p(),u("type",t?.type||""),void v(t);var t},autoFocus:!g?.type})]}),g?.type?e("div",{children:[t(I,{margin:"16px 0"}),t(eo,{action:g,formData:s,formErrors:d,handleFormChange:u})]}):null]})})},so=e=>{const{type:t,fields:{collectContainerAttributes:n,collectReplicaSetAttributes:i,collectWorkloadId:o,collectClusterId:a,labelsAttributes:r,annotationsAttributes:l,clusterAttributes:s,overwriteExistingValues:c,attributeNamesToDelete:d,renames:u,piiCategories:p,fallbackSamplingRatio:h,samplingPercentage:m,endpointsFilters:g,attributeFilters:f,servicesNameFilters:v,urlTemplatizationRulesGroups:x}}=e;let S="";if(t===y.K8sAttributes&&(n&&(S+="Container Attributes, "),i&&(S+="ReplicaSet Attributes, "),o&&(S+="Workload ID, "),a&&(S+="Cluster ID, "),r?.forEach(({labelKey:e,attributeKey:t,from:n,fromSources:i},o)=>{const a=i?.length?i.join(","):n||b.Pod;S+=`Label: ${e} ${t} ${a} `,o===r.length-1&&(S+=", ")}),l?.forEach(({annotationKey:e,attributeKey:t,from:n,fromSources:i},o)=>{const a=i?.length?i.join(","):n||b.Pod;S+=`Annotation: ${e} ${t} ${a} `,o===l.length-1&&(S+=", ")})),t===y.AddClusterInfo&&(S+=`Overwrite Existing: ${c}\n`,s?.forEach(({attributeName:e,attributeStringValue:t},n)=>{S+=`${e}: ${t}`,n<s.length-1&&(S+=", ")})),t===y.DeleteAttributes&&d?.forEach((e,t)=>{S+=e,t<d.length-1&&(S+=", ")}),t===y.RenameAttributes){const e=Object.entries(u||{});e.forEach(([t,n],i)=>{S+=`${t}: ${n}`,i<e.length-1&&(S+=", ")})}return t===y.PiiMasking&&p?.forEach((e,t)=>{S+=e,t<p.length-1&&(S+=", ")}),t===y.ErrorSampler&&(S+=String(h)),t===y.ProbabilisticSampler&&(S+=String(m),S+="%"),t===y.LatencySampler&&g?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:n,fallbackSamplingRatio:i},o)=>{S+=`Endpoint${g.length>1?` #${o+1}`:""}=${e}${t}\n`,S+=` Latency=${n}`,S+=` Sampling=${i}`,o<g.length-1&&(S+=", ")}),t===y.ServiceNameSampler&&v?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:n})=>{S+=`Service Name: ${e}, `,S+=`Sampling Ratio: ${t}, `,S+=`Fallback Sampling Ratio: ${n}\n`}),t===y.SpanAttributeSampler&&f?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:n})=>{S+=`Service Name: ${e}, `,S+=`Attribute Key: ${t}, `,S+=`Fallback Sampling Ratio: ${n}\n`}),t===y.URLTemplatization&&x?.forEach((e,t)=>{const n=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");S+=`Group ${t+1}: ${n}`,t<x.length-1&&(S+="; ")}),S},co=({conditions:e,id:n})=>{const{errors:i,warnings:o,disableds:a,hasLoadings:r}=c(()=>ge(e),[e]),l=i.length>0?i:o.length>0?o:a.length>0?a:[];if(l.length>0)return t("div",{style:{lineHeight:1},children:t(uo,{conditions:l,id:n})});const s=r?ve.Loading:ue.Success;return t("div",{style:{lineHeight:1},children:t(fe,{status:s,title:s,withBorder:!0,withIcon:!0})})},uo=({conditions:e,id:n})=>{const i=g();return t(O,{children:ye(e).map(({status:e,type:o,reason:a,message:r},l)=>{"loading"!==e&&"disabled"!==e||(e=ue.Info);const s=xe(e,i);return t(be,{titleIcon:s,title:o,text:r||a||"",children:t(fe,{status:e,title:a||o,withBorder:!0,withIcon:!0})},`condition-${n}-${e}-${o}-${l}`)})})},po=({instrumentationRules:e,sources:t,actions:n,destinations:i,searchText:o,selectedCategory:a})=>{const r=o?e.filter(e=>e.type?.toLowerCase().includes(o)||e.ruleName?.toLowerCase().includes(o)):e,l=o?t.filter(e=>e.name?.toLowerCase().includes(o)||e.otelServiceName?.toLowerCase().includes(o)||e.namespace?.toLowerCase().includes(o)):t,s=o?n.filter(e=>e.type?.toLowerCase().includes(o)||e.name?.toLowerCase().includes(o)):n,c=o?i.filter(e=>e.destinationType.displayName?.toLowerCase().includes(o)||e.name?.toLowerCase().includes(o)):i,d=[{category:J.Source,label:"Sources",count:l.length,entities:[]},{category:J.Action,label:"Actions",count:s.length,entities:[]},{category:J.Destination,label:"Destinations",count:c.length,entities:[]},{category:J.InstrumentationRule,label:"Instrumentation Rules",count:r.length,entities:[]}];d.unshift({category:"all",label:"All",count:r.length+l.length+s.length+c.length,entities:[]});const u=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(a)).map(e=>({...e,entities:e.category===J.InstrumentationRule?r:e.category===J.Source?l:e.category===J.Action?s:e.category===J.Destination?c:[]}));return{categories:d,searchResults:u}},ho=[{key:"icon",title:""},{key:"name",title:f.NAME,sortable:!0},{key:"signals",title:f.MONITORS},{key:"active-status",title:f.STATUS},{key:"conditions",title:"Conditions"},{key:"type",title:f.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:f.NOTES,sortable:!0}],mo=({maxHeight:n,maxWidth:i})=>{const o=g(),a=Se(),{actions:r,actionsLoading:l}=X(),{setDrawerType:s,setDrawerEntityId:d}=V(),u=c(()=>po({instrumentationRules:[],sources:[],actions:Ce(r,a),destinations:[],searchText:a.searchText,selectedCategory:J.Action}).searchResults.find(({category:e})=>e===J.Action)?.entities||[],[r,a]),p=c(()=>u.map(e=>{const{hasErrors:n,hasWarnings:i,hasDisableds:a}=ge(e.conditions||[]);return{status:n?ue.Error:i?ue.Warning:void 0,faded:a,onClick:()=>{s(J.Action),d(e.id)},cells:[{columnKey:"icon",component:()=>t(we,{icon:ie(e.type)})},{columnKey:"name",value:ke(e,J.Action,{prioritizeDisplayName:!0})},{columnKey:"type",value:e.type,textColor:o.text.info},{columnKey:"notes",value:e.notes,textColor:o.text.info,withTooltip:!0},{columnKey:"spec",value:so(e),textColor:o.text.info,withTooltip:!0},{columnKey:"signals",component:()=>t($e,{withLabels:!0,monitors:e.signals||[]})},{columnKey:"conditions",component:()=>t(co,{conditions:e.conditions||[],id:e.id})},{columnKey:"active-status",component:()=>t("div",{style:{lineHeight:1},children:t(fe,{status:e.disabled?ue.Error:ue.Success,title:e.disabled?f.DISABLED:f.ENABLED,withIcon:!0,withBorder:!0})})}]}}),[u]),{badge:h,badgeTooltip:m}=c(()=>u.length!==r.length?{badge:`${u.length}/${r.length}`,badgeTooltip:f.FILTERED_COUNT_TOOLTIP}:{badge:r.length,badgeTooltip:void 0},[u,r]);return e(Ee,{$maxWidth:i,children:[t(Te,{children:t(Ne,{icon:De(J.Action),title:f.ACTIONS,badge:h,badgeTooltip:m,loading:l})}),t(Ae,{$maxHeight:n,children:t(Ie,{columns:ho,rows:p})}),!u.length&&t(Re,{style:{marginTop:"2rem"},children:t(Oe,{})})]})},go=h(R)`
31
31
  // width: 100vw;
32
32
  // height: 100vh;
33
33
  gap: 64px;
34
34
  align-items: center;
35
35
  justify-content: center;
36
- `,Zi=p(I)`
36
+ `,fo=h(R)`
37
37
  max-width: 400px;
38
38
  gap: 12px;
39
39
  align-items: center;
40
40
  justify-content: center;
41
- `,ea=p(z)`
41
+ `,vo=h(W)`
42
42
  text-align: center;
43
43
  font-size: 24px;
44
- `,ta=p(z)`
44
+ `,yo=h(W)`
45
45
  text-align: center;
46
46
  line-height: 26px;
47
47
  color: ${({theme:e})=>e.text.info};
48
- `,na=()=>{const[n,o]=i(0);return a(()=>{(async()=>{for(let e=0;e<=100;e+=5)await Me(500),o(e)})()},[]),e(Qi,{children:[t(Kn,{size:100}),t(Re,{width:400}),e(Zi,{children:[e(O,{$gap:16,children:[t(ea,{children:"Preparing your workspace..."}),t(Le,{label:`${n}%`})]}),t(ta,{children:"It can take up to a few minutes. Grab a cup of coffee, look out a window, and enjoy your free moment!"})]})]})},ia=p(I)`
48
+ `,bo=()=>{const[n,a]=i(0);return o(()=>{(async()=>{for(let e=0;e<=100;e+=5)await Fe(500),a(e)})()},[]),e(go,{children:[t(Qn,{size:100}),t(Me,{width:400}),e(fo,{children:[e(O,{$gap:16,children:[t(vo,{children:"Preparing your workspace..."}),t(Le,{label:`${n}%`})]}),t(yo,{children:"It can take up to a few minutes. Grab a cup of coffee, look out a window, and enjoy your free moment!"})]})]})},xo=h(R)`
49
49
  align-items: center !important;
50
50
  justify-content: center !important;
51
51
  align-self: stretch;
@@ -63,7 +63,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
63
63
  &:hover {
64
64
  background-color: ${({theme:e})=>e.colors.dropdown_bg_2+_["030"]};
65
65
  }
66
- `,aa=({entityType:n,description:i})=>{const{setCurrentModal:a}=oe();return e(ia,{onClick:()=>a(n),children:[e(O,{$gap:4,children:[t(jn,{}),e(z,{size:14,weight:600,family:"secondary",decoration:"underline",children:["Add ",n]})]}),t(z,{size:12,align:"center",children:i})]})},oa=p.div`
66
+ `,So=({entityType:n,description:i})=>{const{setCurrentModal:o}=re();return e(xo,{onClick:()=>o(n),children:[e(O,{$gap:4,children:[t(Zn,{}),e(W,{size:14,weight:600,family:"secondary",decoration:"underline",children:["Add ",n]})]}),t(W,{size:12,align:"center",children:i})]})},Co=h.div`
67
67
  position: relative;
68
68
  width: 100%;
69
69
  padding: 12px 0;
@@ -71,13 +71,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
71
71
  display: flex;
72
72
  align-items: center;
73
73
  border-bottom: 1px solid ${({theme:e})=>e.colors.border};
74
- `,ra=p(O)`
74
+ `,wo=h(O)`
75
75
  margin-left: ${({$marginLeft:e})=>e};
76
- `,sa=p(_e)`
76
+ `,ko=h(_e)`
77
77
  width: 24px;
78
78
  height: 24px;
79
79
  padding: 0;
80
- `,la=p.div`
80
+ `,$o=h.div`
81
81
  position: absolute;
82
82
  bottom: -2px;
83
83
  left: 0;
@@ -86,7 +86,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
86
86
  height: 4px;
87
87
  width: ${({percent:e})=>`${e}%`};
88
88
  transition: width 0.3s;
89
- `,ca=({entityType:n,badge:i,badgeTooltip:a,isLoading:o,refetch:r,partiallySelected:s,allSelected:l,onSelectAll:c,progressPercent:d})=>{const u=h(),{setCurrentModal:p}=oe(),m=$e(n);return e(oa,{children:[c&&t(ra,{$marginLeft:"28px",children:t(x,{partiallyChecked:s,value:l,onChange:c})}),t(ra,{$marginLeft:n===J.Source?"0":"28px",children:t(we,{icon:m,title:`${n}s`,badge:i,badgeTooltip:a,loading:!1})}),e(ra,{$marginLeft:"auto",children:[t(sa,{"data-id":`refresh-${n}`,variant:"secondary",onClick:r,disabled:o,children:o?t(Fe,{scale:.8}):t(Vn,{fill:u.colors.secondary,size:18})}),t(sa,{"data-id":`add-${n}`,variant:"primary",onClick:()=>p(n),children:t(jn,{fill:u.colors.primary,size:18})})]}),"number"==typeof d&&t(la,{percent:d})]})},da=p.div`
89
+ `,Eo=({entityType:n,badge:i,badgeTooltip:o,isLoading:a,refetch:r,partiallySelected:l,allSelected:s,onSelectAll:c,progressPercent:d})=>{const u=g(),{setCurrentModal:p}=re(),h=De(n);return e(Co,{children:[c&&t(wo,{$marginLeft:"28px",children:t(C,{partiallyChecked:l,value:s,onChange:c})}),t(wo,{$marginLeft:n===J.Source?"0":"28px",children:t(Ne,{icon:h,title:`${n}s`,badge:i,badgeTooltip:o,loading:!1})}),e(wo,{$marginLeft:"auto",children:[t(ko,{"data-id":`refresh-${n}`,variant:"secondary",onClick:r,disabled:a,children:a?t(Pe,{scale:.8}):t(ei,{fill:u.colors.secondary,size:18})}),t(ko,{"data-id":`add-${n}`,variant:"primary",onClick:()=>p(n),children:t(Zn,{fill:u.colors.primary,size:18})})]}),"number"==typeof d&&t($o,{percent:d})]})},To=h.div`
90
90
  padding: 2px 6px;
91
91
  background-color: ${({theme:e})=>e.colors.primary};
92
92
  border-radius: 360px;
@@ -101,7 +101,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
101
101
  align-items: center;
102
102
  justify-content: center;
103
103
  white-space: nowrap;
104
- `,ua=({entityId:n,entityType:i,status:a,faded:o,title:r,subTitle:s,tooltip:l,label:c,icon:d,icons:u,iconSrc:p,iconSrcs:m,monitors:g,isActive:y,raw:v})=>{const f=h(),b=i===J.Source,S="boolean"==typeof y,{setDrawerType:x,setDrawerEntityId:C}=U(),{selectedSources:E,setSelectedSources:N}=Pe(),k={...E},{namespace:T,name:w,kind:$}=v;b&&!k[T]&&(k[T]=[]);const D=b?k[T].findIndex(e=>e.name===w&&e.kind===$):-1;return t(Ke,{"data-id":i===J.Source?`${n.namespace}-${n.name}-${n.kind}`:n,title:r,subTitle:s,onClick:()=>{x(i),C(n)},renderActions:()=>{const n=b&&(!v.conditions?.length||v.conditions?.some(({status:e})=>"loading"===e)),i=S&&!y?be(de.Info,f):a?be(a,f):void 0,o=n?t(Fe,{scale:.8}):i?t(i,{size:14}):null;return c?e(da,{$isError:a===de.Error,children:[t(fe,{text:l||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:c}),o]}):o||null},iconProps:{icon:d,icons:u,iconSrc:p,iconSrcs:m},visualProps:{status:a,faded:o||S&&!y,monitors:g||void 0},checkboxProps:{withCheckbox:b,isChecked:-1!==D,onCheckboxChange:()=>{-1===D?k[T].push(v):k[T].splice(D,1),N(k)}}})};function pa(e){const t=e.conditions?.some(({status:e})=>e===ye.Loading);return t?e:{...e,conditions:[{status:ye.Loading,type:"Pending",message:""}]}}function ma(e){const t=e.conditions?.filter(({status:e})=>e!==ye.Loading);return t?.length===e.conditions?.length?e:{...e,conditions:t?.length?t:[{status:de.Success,type:"Healthy",message:""}]}}const ha=p.div`
104
+ `,No=({entityId:n,entityType:i,status:o,faded:a,title:r,subTitle:l,tooltip:s,label:c,icon:d,icons:u,iconSrc:p,iconSrcs:h,monitors:m,isActive:f,raw:v})=>{const y=g(),b=i===J.Source,x="boolean"==typeof f,{setDrawerType:S,setDrawerEntityId:C}=V(),{selectedSources:w,setSelectedSources:k}=ze(),$={...w},{namespace:E,name:T,kind:N}=v;b&&!$[E]&&($[E]=[]);const D=b?$[E].findIndex(e=>e.name===T&&e.kind===N):-1;return t(Ke,{"data-id":i===J.Source?`${n.namespace}-${n.name}-${n.kind}`:n,title:r,subTitle:l,onClick:()=>{S(i),C(n)},renderActions:()=>{const n=b&&(!v.conditions?.length||v.conditions?.some(({status:e})=>"loading"===e)),i=x&&!f?xe(ue.Info,y):o?xe(o,y):void 0,a=n?t(Pe,{scale:.8}):i?t(i,{size:14}):null;return c?e(To,{$isError:o===ue.Error,children:[t(be,{text:s||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:c}),a]}):a||null},iconProps:{icon:d,icons:u,iconSrc:p,iconSrcs:h},visualProps:{status:o,faded:a||x&&!f,monitors:m||void 0},checkboxProps:{withCheckbox:b,isChecked:-1!==D,onCheckboxChange:()=>{-1===D?$[E].push(v):$[E].splice(D,1),k($)}}})};function Do(e){const t=e.conditions?.some(({status:e})=>e===ve.Loading);return t?e:{...e,conditions:[{status:ve.Loading,type:"Pending",message:""}]}}function Ao(e){const t=e.conditions?.filter(({status:e})=>e!==ve.Loading);return t?.length===e.conditions?.length?e:{...e,conditions:t?.length?t:[{status:ue.Success,type:"Healthy",message:""}]}}const Io=h.div`
105
105
  position: absolute;
106
106
  top: 12px;
107
107
  left: 12px;
@@ -112,23 +112,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
112
112
  border-bottom: 1px solid ${({theme:e})=>e.colors.border};
113
113
  border-radius: 12px 12px 0 0;
114
114
  pointer-events: none;
115
- `,ga=p.span`
115
+ `,Ro=h.span`
116
116
  font-family: ${({theme:e})=>e.font_family.primary};
117
117
  font-size: 11px;
118
118
  font-weight: 600;
119
119
  color: ${({theme:e})=>e.text.grey};
120
120
  text-transform: uppercase;
121
121
  letter-spacing: 0.5px;
122
- `,ya=p.div`
122
+ `,Oo=h.div`
123
123
  display: flex;
124
124
  align-items: center;
125
125
  gap: 8px;
126
126
  padding: 4px 8px 0;
127
- `,va=p.div`
127
+ `,Mo=h.div`
128
128
  flex: 1;
129
129
  height: 1px;
130
130
  background: ${({theme:e})=>e.colors.border};
131
- `,fa=p.span`
131
+ `,Lo=h.span`
132
132
  font-family: ${({theme:e})=>e.font_family.secondary};
133
133
  font-size: 10px;
134
134
  font-weight: 600;
@@ -136,7 +136,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
136
136
  text-transform: uppercase;
137
137
  letter-spacing: 0.5px;
138
138
  white-space: nowrap;
139
- `,ba=({namespace:e})=>t(ha,{children:t(ga,{children:e})}),Sa=({namespace:n})=>e(ya,{children:[t(va,{}),t(fa,{children:n}),t(va,{})]}),xa=p.div`
139
+ `,Fo=({namespace:e})=>t(Io,{children:t(Ro,{children:e})}),Po=({namespace:n})=>e(Oo,{children:[t(Mo,{}),t(Lo,{children:n}),t(Mo,{})]}),_o=h.div`
140
140
  height: calc(${({$height:e})=>e}px - 24px);
141
141
  width: calc(100% - 24px);
142
142
  padding: 12px;
@@ -144,7 +144,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
144
144
  border: 1px dashed ${({theme:e})=>e.colors.border};
145
145
  border-radius: 24px;
146
146
  position: relative;
147
- `,Ca=p.div`
147
+ `,zo=h.div`
148
148
  position: absolute;
149
149
  bottom: 0;
150
150
  left: 0;
@@ -159,21 +159,21 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
159
159
  justify-content: center;
160
160
 
161
161
  pointer-events: none;
162
- `,Ea={[J.Source]:{subTitle:(e,t)=>t?e.kind:`${e.namespace} • ${e.kind}`,icons:e=>({icons:He(e),icon:$e(J.Source)}),withMetrics:!0},[J.Destination]:{subTitle:e=>e.destinationType.displayName,icons:e=>We(e.destinationType.type),withMetrics:!0,withMonitors:!0,withActive:!0},[J.Action]:{subTitle:e=>e.type,icons:e=>({icon:ne(e.type)}),withMonitors:!0,withActive:!0},[J.InstrumentationRule]:{subTitle:e=>e.type,icons:e=>({icon:Be(e.type)}),withActive:!0},[J.Namespace]:{subTitle:()=>"",icons:()=>({icon:$e(J.Namespace)})},[J.SamplingRule]:{subTitle:()=>"",icons:()=>({icon:$e(J.SamplingRule)})}};function Na(e,t,n,i){const a=Q(e);if(!a)return null;const o=Ea[t],r=t===J.Source,s=o.withMonitors?t===J.Destination?ze(e.exportedSignals):e.signals:void 0,l=o.withMetrics?i?.[`${t.toLowerCase()}s`]?.find(e=>JSON.stringify(Q(e))===JSON.stringify(a)):void 0,c=o.withActive?!e.disabled:void 0;let d,u,p=!1,m=e;if(r){const t=function(e){const t=e.workloadOdigosHealthStatus?.status;switch(t){case je.Failure:return{status:de.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message??void 0,displaySource:e};case je.Notice:return{status:de.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message??void 0,displaySource:e};case je.Pending:case je.Waiting:return{status:void 0,faded:!1,displaySource:pa(e)};case je.Unsupported:case je.Disabled:return{status:void 0,faded:!0,displaySource:e};default:return{status:void 0,faded:!1,displaySource:ma(e)}}}(e);d=t.status,p=t.faded,u=t.tooltip,m=t.displaySource}else{const{priorotizedStatus:t,hasDisableds:n}=he(e.conditions||[]);d=t,p=n}return{entityId:a,namespace:r?e.namespace:void 0,title:Ee(e,t,{extended:r,prioritizeDisplayName:!r}),subTitle:o.subTitle(e,n),status:d,faded:p,tooltip:u,label:o.withMetrics?Ue(l?.throughput):void 0,...o.icons(e),monitors:s,isActive:c,raw:m}}const ka=({height:n,entityType:o,entities:r,metrics:s})=>{const{isVm:l}=ae(),u=o===J.Source,[p,m]=i(""),h=c(()=>r.map(e=>Na(e,o,l,s)).filter(Boolean),[r,o,s,l]),{elements:g,indexToNamespace:y,multipleNs:v}=c(()=>{const e=[],n=[],i=new Set(h.map(e=>e.namespace).filter(Boolean)).size>1;i&&(n.push(""),e.push(t("div",{style:{height:28}},"ns-spacer")));let a="";for(const i of h)u&&i.namespace&&i.namespace!==a&&(""!==a&&(n.push(i.namespace),e.push(t(Sa,{namespace:i.namespace},`ns-divider-${i.namespace}`))),a=i.namespace),n.push(i.namespace||""),e.push(t(ua,{entityType:o,entityId:i.entityId,raw:i.raw,title:i.title,subTitle:i.subTitle,faded:i.faded,status:i.status,tooltip:i.tooltip,label:i.label,icons:i.icons,icon:i.icon,iconSrc:i.iconSrc,monitors:i.monitors,isActive:i.isActive},JSON.stringify(i.entityId)));return{elements:e,indexToNamespace:n,multipleNs:i}},[h,o,u]);a(()=>{if(u&&y.length&&!p){const e=y.find(Boolean);e&&m(e)}},[u,y]);const f=d(e=>{if(!y.length)return;const t=y[Math.min(e,y.length-1)];t&&t!==p&&m(t)},[y,p]);return e(xa,{$height:n,children:[v&&p&&t(ba,{namespace:p}),t(Ve,{gap:8,elements:g,onTopIndexChange:v?f:void 0}),t(Ca,{$hide:!0})]})},Ta=p.div`
162
+ `,Ko={[J.Source]:{subTitle:(e,t)=>t?e.kind:`${e.namespace} • ${e.kind}`,icons:e=>({icons:qe(e),icon:De(J.Source)}),withMetrics:!0},[J.Destination]:{subTitle:e=>e.destinationType.displayName,icons:e=>He(e.destinationType.type),withMetrics:!0,withMonitors:!0,withActive:!0},[J.Action]:{subTitle:e=>e.type,icons:e=>({icon:ie(e.type)}),withMonitors:!0,withActive:!0},[J.InstrumentationRule]:{subTitle:e=>e.type,icons:e=>({icon:Ue(e.type)}),withActive:!0},[J.Namespace]:{subTitle:()=>"",icons:()=>({icon:De(J.Namespace)})},[J.SamplingRule]:{subTitle:()=>"",icons:()=>({icon:De(J.SamplingRule)})}};function jo(e,t,n,i){const o=Z(e);if(!o)return null;const a=Ko[t],r=t===J.Source,l=a.withMonitors?t===J.Destination?We(e.exportedSignals):e.signals:void 0,s=a.withMetrics?i?.[`${t.toLowerCase()}s`]?.find(e=>JSON.stringify(Z(e))===JSON.stringify(o)):void 0,c=a.withActive?!e.disabled:void 0;let d,u,p=!1,h=e;if(r){const t=function(e){const t=e.workloadOdigosHealthStatus?.status;switch(t){case je.Failure:return{status:ue.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message??void 0,displaySource:e};case je.Notice:return{status:ue.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message??void 0,displaySource:e};case je.Pending:case je.Waiting:return{status:void 0,faded:!1,displaySource:Do(e)};case je.Unsupported:case je.Disabled:return{status:void 0,faded:!0,displaySource:e};default:return{status:void 0,faded:!1,displaySource:Ao(e)}}}(e);d=t.status,p=t.faded,u=t.tooltip,h=t.displaySource}else{const{priorotizedStatus:t,hasDisableds:n}=ge(e.conditions||[]);d=t,p=n}return{entityId:o,namespace:r?e.namespace:void 0,title:ke(e,t,{extended:r,prioritizeDisplayName:!r}),subTitle:a.subTitle(e,n),status:d,faded:p,tooltip:u,label:a.withMetrics?Ve(s?.throughput):void 0,...a.icons(e),monitors:l,isActive:c,raw:h}}const Bo=({height:n,entityType:a,entities:r,metrics:l})=>{const{isVm:s}=ae(),u=a===J.Source,[p,h]=i(""),m=c(()=>r.map(e=>jo(e,a,s,l)).filter(Boolean),[r,a,l,s]),{elements:g,indexToNamespace:f,multipleNs:v}=c(()=>{const e=[],n=[],i=new Set(m.map(e=>e.namespace).filter(Boolean)).size>1;i&&(n.push(""),e.push(t("div",{style:{height:28}},"ns-spacer")));let o="";for(const i of m)u&&i.namespace&&i.namespace!==o&&(""!==o&&(n.push(i.namespace),e.push(t(Po,{namespace:i.namespace},`ns-divider-${i.namespace}`))),o=i.namespace),n.push(i.namespace||""),e.push(t(No,{entityType:a,entityId:i.entityId,raw:i.raw,title:i.title,subTitle:i.subTitle,faded:i.faded,status:i.status,tooltip:i.tooltip,label:i.label,icons:i.icons,icon:i.icon,iconSrc:i.iconSrc,monitors:i.monitors,isActive:i.isActive},JSON.stringify(i.entityId)));return{elements:e,indexToNamespace:n,multipleNs:i}},[m,a,u]);o(()=>{if(u&&f.length&&!p){const e=f.find(Boolean);e&&h(e)}},[u,f]);const y=d(e=>{if(!f.length)return;const t=f[Math.min(e,f.length-1)];t&&t!==p&&h(t)},[f,p]);return e(_o,{$height:n,children:[v&&p&&t(Fo,{namespace:p}),t(Be,{gap:8,elements:g,onTopIndexChange:v?y:void 0}),t(zo,{$hide:!0})]})},Wo=h.div`
163
163
  width: ${({$isVm:e})=>e?"45vw":"22vw"};
164
164
  display: flex;
165
165
  flex-direction: column;
166
166
  gap: 12px;
167
- `,wa=({entityType:n,entities:i,unfilteredCount:a,metrics:o,loading:r,maxHeight:s,refetch:l})=>{const{isVm:d}=ae(),{frameHeight:u,hasFiltersApplied:p,isSources:m}=c(()=>({frameHeight:Math.min(s,80*i.length+12),hasFiltersApplied:i.length!==a,isSources:n===J.Source}),[n,i.length,s,a]),{progress:h}=qe(),y=c(()=>m&&(h[Ge.Instrumenting]||h[Ge.Uninstrumenting])?h[Ge.Instrumenting]?.percentage||h[Ge.Uninstrumenting]?.percentage||0:void 0,[m,h[Ge.Instrumenting],h[Ge.Uninstrumenting]]),{selectedSources:v,setSelectedSources:f}=Pe(),b=c(()=>m?Object.values(v).reduce((e,t)=>e+t.length,0):0,[m,v]);return d&&[J.InstrumentationRule,J.Action].includes(n)?null:e(Ta,{$isVm:d,children:[t(ca,{entityType:n,badge:"number"==typeof y?`${y}%`:p?`${i.length}/${a}`:a,badgeTooltip:p?g.FILTERED_COUNT_TOOLTIP:void 0,isLoading:r,refetch:l,partiallySelected:b>0&&i?.length!==b,allSelected:b>0&&i?.length===b,onSelectAll:m?e=>{if(m)if(e){const e={};i?.forEach(t=>{const{namespace:n}=t;e[n]?e[n].push(t):e[n]=[t]}),f(e)}else f({})}:void 0,progressPercent:y}),i.length?t(ka,{height:u,entityType:n,entities:i,metrics:o}):r?t(Je,{size:3}):t(aa,{entityType:n,description:g.TO_COLLECT_OTEL_DATA})]})},$a=p.div`
167
+ `,Vo=({entityType:n,entities:i,unfilteredCount:o,metrics:a,loading:r,maxHeight:l,refetch:s})=>{const{isVm:d}=ae(),{frameHeight:u,hasFiltersApplied:p,isSources:h}=c(()=>({frameHeight:Math.min(l,80*i.length+12),hasFiltersApplied:i.length!==o,isSources:n===J.Source}),[n,i.length,l,o]),{progress:m}=Ge(),g=c(()=>h&&(m[Ye.Instrumenting]||m[Ye.Uninstrumenting])?m[Ye.Instrumenting]?.percentage||m[Ye.Uninstrumenting]?.percentage||0:void 0,[h,m[Ye.Instrumenting],m[Ye.Uninstrumenting]]),{selectedSources:v,setSelectedSources:y}=ze(),b=c(()=>h?Object.values(v).reduce((e,t)=>e+t.length,0):0,[h,v]);return d&&[J.InstrumentationRule,J.Action].includes(n)?null:e(Wo,{$isVm:d,children:[t(Eo,{entityType:n,badge:"number"==typeof g?`${g}%`:p?`${i.length}/${o}`:o,badgeTooltip:p?f.FILTERED_COUNT_TOOLTIP:void 0,isLoading:r,refetch:s,partiallySelected:b>0&&i?.length!==b,allSelected:b>0&&i?.length===b,onSelectAll:h?e=>{if(h)if(e){const e={};i?.forEach(t=>{const{namespace:n}=t;e[n]?e[n].push(t):e[n]=[t]}),y(e)}else y({})}:void 0,progressPercent:g}),i.length?t(Bo,{height:u,entityType:n,entities:i,metrics:a}):r?t(Je,{size:3}):t(So,{entityType:n,description:f.TO_COLLECT_OTEL_DATA})]})},Uo=h.div`
168
168
  width: 100%;
169
169
  height: ${({$height:e})=>e};
170
170
  display: flex;
171
171
  justify-content: space-evenly;
172
172
  gap: 24px;
173
- `,Da=({height:n,metrics:o,refetchSources:r,refetchDestinations:s,refetchActions:l,refetchInstrumentationRules:d})=>{const u=Se(),{selectedStreamName:p}=Ye(),{containerRef:m,containerHeight:h}=Xe(),{sources:g,sourcesLoading:y,destinations:v,destinationsLoading:f,actions:b,actionsLoading:S,instrumentationRules:x,instrumentationRulesLoading:C}=Y(),E=c(()=>Qe(g,p),[g,p]),N=c(()=>Ze(v,p),[v,p]),[k,T]=i([]),[w,$]=i([]),[D,A]=i([]),[I,O]=i([]);return a(()=>{T(et(E,u))},[E,u]),a(()=>{$(tt(N,u))},[N,u]),a(()=>{A(xe(b,u))},[b,u]),a(()=>{O(x)},[x]),e($a,{ref:m,$height:n,children:[t(wa,{entityType:J.InstrumentationRule,entities:I,unfilteredCount:x.length,loading:C,maxHeight:h,refetch:d}),t(wa,{entityType:J.Source,entities:k,unfilteredCount:E.length,metrics:o,loading:y,maxHeight:h,refetch:r}),t(wa,{entityType:J.Action,entities:D,unfilteredCount:b.length,loading:S,maxHeight:h,refetch:l}),t(wa,{entityType:J.Destination,entities:w,unfilteredCount:N.length,metrics:o,loading:f,maxHeight:h,refetch:s})]})},Aa=p.div`
173
+ `,Ho=({height:n,metrics:a,refetchSources:r,refetchDestinations:l,refetchActions:s,refetchInstrumentationRules:d})=>{const u=Se(),{selectedStreamName:p}=Xe(),{containerRef:h,containerHeight:m}=Qe(),{sources:g,sourcesLoading:f,destinations:v,destinationsLoading:y,actions:b,actionsLoading:x,instrumentationRules:S,instrumentationRulesLoading:C}=X(),w=c(()=>Ze(g,p),[g,p]),k=c(()=>et(v,p),[v,p]),[$,E]=i([]),[T,N]=i([]),[D,A]=i([]),[I,R]=i([]);return o(()=>{E(tt(w,u))},[w,u]),o(()=>{N(nt(k,u))},[k,u]),o(()=>{A(Ce(b,u))},[b,u]),o(()=>{R(S)},[S]),e(Uo,{ref:h,$height:n,children:[t(Vo,{entityType:J.InstrumentationRule,entities:I,unfilteredCount:S.length,loading:C,maxHeight:m,refetch:d}),t(Vo,{entityType:J.Source,entities:$,unfilteredCount:w.length,metrics:a,loading:f,maxHeight:m,refetch:r}),t(Vo,{entityType:J.Action,entities:D,unfilteredCount:b.length,loading:x,maxHeight:m,refetch:s}),t(Vo,{entityType:J.Destination,entities:T,unfilteredCount:k.length,metrics:a,loading:y,maxHeight:m,refetch:l})]})},qo=h.div`
174
174
  position: relative;
175
175
  max-width: 200px;
176
- `;p.div`
176
+ `;h.div`
177
177
  position: absolute;
178
178
  top: calc(100% + 8px);
179
179
  left: 0;
@@ -184,65 +184,65 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
184
184
  background-color: ${({theme:e})=>e.colors.dropdown_bg};
185
185
  border: ${({theme:e})=>`1px solid ${e.colors.border}`};
186
186
  border-radius: 24px;
187
- `;const Ia=p.div`
187
+ `;const Go=h.div`
188
188
  display: flex;
189
189
  align-items: center;
190
190
  overflow-x: scroll;
191
- `,Oa=({onClose:n})=>{const r=h(),{onClickNode:s}=nt(),{searchText:l}=Se(),{selectedStreamName:d}=Ye(),{sources:u,destinations:p,actions:m,instrumentationRules:g}=Y(),{popupRef:y,popupOpen:v,setPopupOpen:f,popupPosition:b,handlePosition:S}=it();a(()=>{v||(S(0,50),f(!0))},[v]);const[x,C]=i("all"),{categories:E,searchResults:N}=c(()=>Ji({instrumentationRules:g,sources:Qe(u,d),actions:m,destinations:Ze(p,d),searchText:l,selectedCategory:x}),[g,u,m,p,d,l,x]);return N.length?t(at,{ref:y,isOpen:v,top:b.top,left:b.left,maxWidth:"420px",header:t(Ia,{children:E.map(({category:e,label:n,count:i})=>!!i&&t(rt,{label:n,badgeLabel:i,isSelected:x===e,onClick:()=>C(e)},`category-select-${e}`))}),children:N.map(({category:i,label:a,entities:l},c)=>!!l.length&&e(o,{children:[e(ot,{style:{maxHeight:"all"!==x?"240px":"140px",padding:"12px 0"},children:[t(z,{size:12,family:"secondary",color:r.text.darker_grey,style:{marginLeft:"16px"},children:a}),l.map((e,a)=>t(rt,{icon:$e(i),label:Ee(e,i,{extended:!0}),onClick:()=>{const t=Q(e);s(null,{data:{type:i,id:t}}),n()},style:{width:"100%",justifyContent:"flex-start"},color:"transparent"},`entity-${c}-${a}`))]}),t(A,{thickness:c===N.length-1?0:1,length:"90%",margin:"8px auto"})]},`category-list-${i}`))}):t(at,{ref:y,isOpen:v,top:b.top,left:b.left,children:t(Oe,{})})},Ra=({preventPopup:n=!1})=>{const{searchText:a,setSearchText:o}=Se(),[r,l]=i(!1),c=!!a||r,d=()=>{o(""),l(!1)},u=s(null);return st(u,d),B({key:"Escape",active:c},d),e(Aa,{ref:u,children:[t(E,{placeholder:"Search",icon:zn,value:a,onChange:e=>o(e.target.value.toLowerCase()),onFocus:()=>l(!0)}),c&&!n?t(Oa,{onClose:d}):null]})},La=({sources:e,title:n="Condition",value:i,onSelect:a,onDeselect:o,...r})=>{const s=c(()=>{const t=[];return e.forEach(({conditions:e})=>{e?.forEach(({type:e,reason:n})=>{t.find(t=>t.id===`${e}#${n}`)||t.push({id:`${e}#${n}`,value:`${lt(e)} - ${lt(n)}`})})}),t.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[e]);return t(ct,{disabled:!s?.length,title:n,placeholder:"All",options:s,value:i,onSelect:a,onDeselect:o,...r})},Ma=({sources:e,title:n="Error Message",value:i,onSelect:a,onDeselect:o,disabled:r,...s})=>{const l=c(()=>{const t=[];return e.forEach(({conditions:e})=>{ve(e||[]).forEach(({status:e,message:n,reason:i})=>{e!==de.Error||t.find(e=>e.id===n)||(n?t.find(e=>e.id===n)||t.push({id:n,value:n}):i&&(t.find(e=>e.id===i)||t.push({id:i,value:i})))})}),t},[e]);return t(ct,{disabled:r||!l?.length,title:n,placeholder:"All",options:l,value:i,onSelect:a,onDeselect:o,...s})},Fa=({sources:e,title:n="Programming Language",value:i,onSelect:a,onDeselect:o,...r})=>{const s=c(()=>{const t=[];return e.forEach(({containers:e})=>{e?.forEach(({language:e})=>{t.find(t=>t.id===e)||t.push({id:e,value:dt[e]||e})})}),t.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[e]);return t(ct,{disabled:!s?.length,title:n,placeholder:"All",options:s,value:i,onSelect:a,onDeselect:o,...r})},_a=({title:e="Monitors",value:n,onSelect:i,onDeselect:a,...o})=>{const r=c(()=>{const e=[];return ut.forEach(({id:t,value:n})=>{e.find(e=>e.id===t)||e.push({id:t,value:n})}),e},[]);return t(ct,{disabled:!r?.length,title:e,placeholder:"All",options:r,value:n,onSelect:i,onDeselect:a,...o})},Pa=({namespaces:e,title:n="Namespace",value:i,onSelect:a,onDeselect:o,...r})=>{const s=c(()=>{const t=[];return e?.forEach(({name:e})=>{t.find(t=>t.id===e)||t.push({id:e,value:e})}),t},[e]);return t(ct,{disabled:!s?.length,title:n,placeholder:"Select namespace",options:s,value:i,onSelect:a,onDeselect:o,...r})},Ka=({sources:e,title:n="Kind",value:i,onSelect:a,onDeselect:o,...r})=>{const s=c(()=>{const t=[];return e.forEach(({kind:e})=>{t.find(t=>t.id===e)||t.push({id:e,value:e})}),t},[e]);return t(ct,{disabled:!s?.length,title:n,placeholder:"All",options:s,value:i,onSelect:a,onDeselect:o,...r})},ja=({sources:e,title:n="Agent Injection Status",value:i,onSelect:a,onDeselect:o,disabled:r,...s})=>{const l=c(()=>{const t=[];return e.forEach(({podsAgentInjectionStatus:e})=>{const{reasonEnum:n,message:i}=e||{};if(n){t.find(e=>e.id===n)||t.push({id:n,value:lt(n)})}else if(i){t.find(e=>e.id===i)||t.push({id:i,value:i})}}),t},[e]);return t(ct,{disabled:r||!l?.length,title:n,placeholder:"All",options:l,value:i,onSelect:a,onDeselect:o,...s})},Va=p.div`
191
+ `,Yo=({onClose:n})=>{const r=g(),{onClickNode:l}=it(),{searchText:s}=Se(),{selectedStreamName:d}=Xe(),{sources:u,destinations:p,actions:h,instrumentationRules:m}=X(),{popupRef:f,popupOpen:v,setPopupOpen:y,popupPosition:b,handlePosition:x}=ot();o(()=>{v||(x(0,50),y(!0))},[v]);const[S,C]=i("all"),{categories:w,searchResults:k}=c(()=>po({instrumentationRules:m,sources:Ze(u,d),actions:h,destinations:et(p,d),searchText:s,selectedCategory:S}),[m,u,h,p,d,s,S]);return k.length?t(at,{ref:f,isOpen:v,top:b.top,left:b.left,maxWidth:"420px",header:t(Go,{children:w.map(({category:e,label:n,count:i})=>!!i&&t(lt,{label:n,badgeLabel:i,isSelected:S===e,onClick:()=>C(e)},`category-select-${e}`))}),children:k.map(({category:i,label:o,entities:s},c)=>!!s.length&&e(a,{children:[e(rt,{style:{maxHeight:"all"!==S?"240px":"140px",padding:"12px 0"},children:[t(W,{size:12,family:"secondary",color:r.text.darker_grey,style:{marginLeft:"16px"},children:o}),s.map((e,o)=>t(lt,{icon:De(i),label:ke(e,i,{extended:!0}),onClick:()=>{const t=Z(e);l(null,{data:{type:i,id:t}}),n()},style:{width:"100%",justifyContent:"flex-start"},color:"transparent"},`entity-${c}-${o}`))]}),t(I,{thickness:c===k.length-1?0:1,length:"90%",margin:"8px auto"})]},`category-list-${i}`))}):t(at,{ref:f,isOpen:v,top:b.top,left:b.left,children:t(Oe,{})})},Jo=({preventPopup:n=!1})=>{const{searchText:o,setSearchText:a}=Se(),[r,s]=i(!1),c=!!o||r,d=()=>{a(""),s(!1)},u=l(null);return st(u,d),U({key:"Escape",active:c},d),e(qo,{ref:u,children:[t(k,{placeholder:"Search",icon:ti,value:o,onChange:e=>a(e.target.value.toLowerCase()),onFocus:()=>s(!0)}),c&&!n?t(Yo,{onClose:d}):null]})},Xo=({sources:e,title:n="Condition",value:i,onSelect:o,onDeselect:a,...r})=>{const l=c(()=>{const t=[];return e.forEach(({conditions:e})=>{e?.forEach(({type:e,reason:n})=>{t.find(t=>t.id===`${e}#${n}`)||t.push({id:`${e}#${n}`,value:`${ct(e)} - ${ct(n)}`})})}),t.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[e]);return t(dt,{disabled:!l?.length,title:n,placeholder:"All",options:l,value:i,onSelect:o,onDeselect:a,...r})},Qo=({sources:e,title:n="Error Message",value:i,onSelect:o,onDeselect:a,disabled:r,...l})=>{const s=c(()=>{const t=[];return e.forEach(({conditions:e})=>{ye(e||[]).forEach(({status:e,message:n,reason:i})=>{e!==ue.Error||t.find(e=>e.id===n)||(n?t.find(e=>e.id===n)||t.push({id:n,value:n}):i&&(t.find(e=>e.id===i)||t.push({id:i,value:i})))})}),t},[e]);return t(dt,{disabled:r||!s?.length,title:n,placeholder:"All",options:s,value:i,onSelect:o,onDeselect:a,...l})},Zo=({sources:e,title:n="Programming Language",value:i,onSelect:o,onDeselect:a,...r})=>{const l=c(()=>{const t=[];return e.forEach(({containers:e})=>{e?.forEach(({language:e})=>{t.find(t=>t.id===e)||t.push({id:e,value:ut[e]||e})})}),t.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[e]);return t(dt,{disabled:!l?.length,title:n,placeholder:"All",options:l,value:i,onSelect:o,onDeselect:a,...r})},ea=({title:e="Monitors",value:n,onSelect:i,onDeselect:o,...a})=>{const r=c(()=>{const e=[];return pt.forEach(({id:t,value:n})=>{e.find(e=>e.id===t)||e.push({id:t,value:n})}),e},[]);return t(dt,{disabled:!r?.length,title:e,placeholder:"All",options:r,value:n,onSelect:i,onDeselect:o,...a})},ta=({namespaces:e,title:n="Namespace",value:i,onSelect:o,onDeselect:a,...r})=>{const l=c(()=>{const t=[];return e?.forEach(({name:e})=>{t.find(t=>t.id===e)||t.push({id:e,value:e})}),t},[e]);return t(dt,{disabled:!l?.length,title:n,placeholder:"Select namespace",options:l,value:i,onSelect:o,onDeselect:a,...r})},na=({sources:e,title:n="Kind",value:i,onSelect:o,onDeselect:a,...r})=>{const l=c(()=>{const t=[];return e.forEach(({kind:e})=>{t.find(t=>t.id===e)||t.push({id:e,value:e})}),t},[e]);return t(dt,{disabled:!l?.length,title:n,placeholder:"All",options:l,value:i,onSelect:o,onDeselect:a,...r})},ia=({sources:e,title:n="Agent Injection Status",value:i,onSelect:o,onDeselect:a,disabled:r,...l})=>{const s=c(()=>{const t=[];return e.forEach(({podsAgentInjectionStatus:e})=>{const{reasonEnum:n,message:i}=e||{};if(n){t.find(e=>e.id===n)||t.push({id:n,value:ct(n)})}else if(i){t.find(e=>e.id===i)||t.push({id:i,value:i})}}),t},[e]);return t(dt,{disabled:r||!s?.length,title:n,placeholder:"All",options:s,value:i,onSelect:o,onDeselect:a,...l})},oa=h.div`
192
192
  display: flex;
193
193
  flex-direction: column;
194
194
  gap: 12px;
195
195
  padding: 12px;
196
- `,za=p.div`
196
+ `,aa=h.div`
197
197
  padding: 12px 6px 6px 6px;
198
- `,Ua=p(_e)`
198
+ `,ra=h(_e)`
199
199
  font-size: 14px;
200
200
  ${({$color:e})=>`color: ${e};`}
201
- `,Ba=p.div`
201
+ `,la=h.div`
202
202
  margin-left: auto;
203
- `,Wa=e=>{let t=0;return Object.values(e).forEach(e=>{e&&Array.isArray(e)&&e.length>0&&(t+=e.length)}),e.onlyErrors&&t++,e.searchText&&t++,t},Ha=()=>{const n=h(),{namespaces:o,sources:r}=Y(),{selectedStreamName:l}=Ye(),{getItemSS:d,setItemSS:u,removeItemSS:p}=mt(),{popupRef:m,popupOpen:g,setPopupOpen:y,popupPosition:v,handlePosition:f}=it(),{namespaces:b,kinds:S,monitors:x,languages:C,conditions:E,errors:N,onlyErrors:k,podsAgentInjectionStatus:T,setAll:$,clearAll:D,getEmptyState:A}=Se(),I=c(()=>Qe(r,l),[r,l]),[R,L]=i({namespaces:b,kinds:S,monitors:x,languages:C,conditions:E,errors:N,onlyErrors:k,podsAgentInjectionStatus:T}),[M,F]=i(Wa(R));a(()=>{const e=d(pt.OVERVIEW_FILTERS,A());$(e)},[]),a(()=>{if(!g){const e={namespaces:b,kinds:S,monitors:x,languages:C,conditions:E,errors:N,onlyErrors:k,podsAgentInjectionStatus:T};L(e),F(Wa(e))}},[g,b,S,x,C,E,N,k,T]);const _=()=>{y(!1)},P=s(null);return st(P,_),B({key:"Escape",active:g},_),e(Aa,{ref:P,children:[t(rt,{label:"Filters",icon:Un,badgeLabel:M,badgeFilled:!!M,withBorder:!0,color:"transparent",onClick:()=>{f(0,50),y(!0)}}),t(at,{ref:m,isOpen:g,top:v.top,left:v.left,width:"420px",footer:e(O,{children:[t(Ua,{variant:"primary",onClick:()=>{u(pt.OVERVIEW_FILTERS,R),$(R),F(Wa(R)),y(!1)},children:"Apply"}),t(Ua,{variant:"secondary",onClick:_,children:"Cancel"}),t(Ba,{children:t(Ua,{variant:"tertiary",onClick:()=>{p(pt.OVERVIEW_FILTERS),D(),L(A()),F(0),y(!1)},$color:n.text.error,children:"Reset"})})]}),children:e(Va,{children:[t(Pa,{namespaces:o,value:R.namespaces,onSelect:e=>L(t=>({...t,namespaces:[...t.namespaces||[],e]})),onDeselect:e=>L(t=>({...t,namespaces:(t.namespaces||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(Ka,{sources:I,value:R.kinds,onSelect:e=>L(t=>({...t,kinds:[...t.kinds||[],e]})),onDeselect:e=>L(t=>({...t,kinds:(t.kinds||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(Fa,{sources:I,value:R.languages,onSelect:e=>L(t=>({...t,languages:[...t.languages||[],e]})),onDeselect:e=>L(t=>({...t,languages:(t.languages||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(_a,{value:R.monitors,onSelect:e=>L(t=>({...t,monitors:[...t.monitors||[],e]})),onDeselect:e=>L(t=>({...t,monitors:(t.monitors||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(La,{sources:I,value:R.conditions,onSelect:e=>L(t=>({...t,conditions:[...t.conditions||[],e]})),onDeselect:e=>L(t=>({...t,conditions:(t.conditions||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(ja,{sources:I,value:R.podsAgentInjectionStatus,onSelect:e=>L(t=>({...t,podsAgentInjectionStatus:[...t.podsAgentInjectionStatus||[],e]})),onDeselect:e=>L(t=>({...t,podsAgentInjectionStatus:(t.podsAgentInjectionStatus||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(za,{children:t(w,{title:"Show only sources with errors",initialValue:R.onlyErrors,onChange:e=>L(t=>({...t,errors:[],onlyErrors:e}))})}),t(Ma,{sources:I,value:R.errors,onSelect:e=>L(t=>({...t,errors:[...t.errors||[],e]})),onDeselect:e=>L(t=>({...t,errors:(t.errors||[]).filter(t=>t.id!==e.id)})),disabled:!R.onlyErrors,showSearch:!0,required:!0,isMulti:!0})]})})]})},qa=p.div`
203
+ `,sa=e=>{let t=0;return Object.values(e).forEach(e=>{e&&Array.isArray(e)&&e.length>0&&(t+=e.length)}),e.onlyErrors&&t++,e.searchText&&t++,t},ca=()=>{const n=g(),{namespaces:a,sources:r}=X(),{selectedStreamName:s}=Xe(),{getItemSS:d,setItemSS:u,removeItemSS:p}=mt(),{popupRef:h,popupOpen:m,setPopupOpen:f,popupPosition:v,handlePosition:y}=ot(),{namespaces:b,kinds:x,monitors:S,languages:C,conditions:w,errors:k,onlyErrors:$,podsAgentInjectionStatus:E,setAll:T,clearAll:D,getEmptyState:A}=Se(),I=c(()=>Ze(r,s),[r,s]),[R,M]=i({namespaces:b,kinds:x,monitors:S,languages:C,conditions:w,errors:k,onlyErrors:$,podsAgentInjectionStatus:E}),[L,F]=i(sa(R));o(()=>{const e=d(ht.OVERVIEW_FILTERS,A());T(e)},[]),o(()=>{if(!m){const e={namespaces:b,kinds:x,monitors:S,languages:C,conditions:w,errors:k,onlyErrors:$,podsAgentInjectionStatus:E};M(e),F(sa(e))}},[m,b,x,S,C,w,k,$,E]);const P=()=>{f(!1)},_=l(null);return st(_,P),U({key:"Escape",active:m},P),e(qo,{ref:_,children:[t(lt,{label:"Filters",icon:ni,badgeLabel:L,badgeFilled:!!L,withBorder:!0,color:"transparent",onClick:()=>{y(0,50),f(!0)}}),t(at,{ref:h,isOpen:m,top:v.top,left:v.left,width:"420px",footer:e(O,{children:[t(ra,{variant:"primary",onClick:()=>{u(ht.OVERVIEW_FILTERS,R),T(R),F(sa(R)),f(!1)},children:"Apply"}),t(ra,{variant:"secondary",onClick:P,children:"Cancel"}),t(la,{children:t(ra,{variant:"tertiary",onClick:()=>{p(ht.OVERVIEW_FILTERS),D(),M(A()),F(0),f(!1)},$color:n.text.error,children:"Reset"})})]}),children:e(oa,{children:[t(ta,{namespaces:a,value:R.namespaces,onSelect:e=>M(t=>({...t,namespaces:[...t.namespaces||[],e]})),onDeselect:e=>M(t=>({...t,namespaces:(t.namespaces||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(na,{sources:I,value:R.kinds,onSelect:e=>M(t=>({...t,kinds:[...t.kinds||[],e]})),onDeselect:e=>M(t=>({...t,kinds:(t.kinds||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(Zo,{sources:I,value:R.languages,onSelect:e=>M(t=>({...t,languages:[...t.languages||[],e]})),onDeselect:e=>M(t=>({...t,languages:(t.languages||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(ea,{value:R.monitors,onSelect:e=>M(t=>({...t,monitors:[...t.monitors||[],e]})),onDeselect:e=>M(t=>({...t,monitors:(t.monitors||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(Xo,{sources:I,value:R.conditions,onSelect:e=>M(t=>({...t,conditions:[...t.conditions||[],e]})),onDeselect:e=>M(t=>({...t,conditions:(t.conditions||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(ia,{sources:I,value:R.podsAgentInjectionStatus,onSelect:e=>M(t=>({...t,podsAgentInjectionStatus:[...t.podsAgentInjectionStatus||[],e]})),onDeselect:e=>M(t=>({...t,podsAgentInjectionStatus:(t.podsAgentInjectionStatus||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(aa,{children:t(N,{title:"Show only sources with errors",initialValue:R.onlyErrors,onChange:e=>M(t=>({...t,errors:[],onlyErrors:e}))})}),t(Qo,{sources:I,value:R.errors,onSelect:e=>M(t=>({...t,errors:[...t.errors||[],e]})),onDeselect:e=>M(t=>({...t,errors:(t.errors||[]).filter(t=>t.id!==e.id)})),disabled:!R.onlyErrors,showSearch:!0,required:!0,isMulti:!0})]})})]})},da=h.div`
204
204
  display: flex;
205
205
  flex-direction: column;
206
206
  gap: 24px;
207
207
  padding: 4px;
208
- `,Ga=({formData:n,handleFormChange:i,formErrors:a,editingStreamName:o})=>{const{dataStreams:r,selectedStreamName:s}=Ye(),l=o||s,d=c(()=>r.find(e=>e.name===n.name&&e.name!==l),[r,n.name,l]);return e(qa,{children:[t(E,{name:"name",title:g.STREAM_NAME,placeholder:g.NAME_YOUR_STREAM_PLACEHOLDER,required:!0,value:n.name,onChange:({target:{value:e}})=>i("name",e),errorMessage:a.name}),d&&t(ce,{type:de.Warning,message:g.DATA_STREAM_EXISTS_WARNING(l,d.name)})]})},Ja=p.div`
208
+ `,ua=({formData:n,handleFormChange:i,formErrors:o,editingStreamName:a})=>{const{dataStreams:r,selectedStreamName:l}=Xe(),s=a||l,d=c(()=>r.find(e=>e.name===n.name&&e.name!==s),[r,n.name,s]);return e(da,{children:[t(k,{name:"name",title:f.STREAM_NAME,placeholder:f.NAME_YOUR_STREAM_PLACEHOLDER,required:!0,value:n.name,onChange:({target:{value:e}})=>i("name",e),errorMessage:o.name}),d&&t(de,{type:ue.Warning,message:f.DATA_STREAM_EXISTS_WARNING(s,d.name)})]})},pa=h.div`
209
209
  width: 100%;
210
210
  height: 100%;
211
211
  max-height: calc(100vh - 220px);
212
212
  overflow: overlay;
213
213
  overflow-y: auto;
214
- `,Ya=({isOpen:e,onClose:n,dataStreamName:a,updateDataStream:o})=>{const{dataStreams:r}=Ye(),l=s(null),[u,p]=i(!1),{formData:m,handleFormChange:h,formErrors:g,validateForm:y,resetFormData:v,loadFormWithDrawerItem:f}=ht({name:a}),b=c(()=>{if(!e)return v();const t=r?.find(e=>e.name===a);return t?f(t):v(),t},[e,r,a]),S=d((e,t)=>{h(e,t),p(!0)},[h]);if(!b)return null;return t(Ki,{ref:l,title:b.name,icons:[Bn],hideEditTitleFromEdit:!0,isEdit:!0,isFormDirty:u,onSave:()=>{y({withAlert:!0,alertTitle:ie.Update})&&(o(a,m),p(!1),n())},onCancel:()=>{v(),p(!1),n()},children:t(Ja,{children:t(Ga,{formData:m,handleFormChange:S,formErrors:g,editingStreamName:a})})})},Xa=p.div`
214
+ `,ha=({isOpen:e,onClose:n,dataStreamName:o,updateDataStream:a})=>{const{dataStreams:r}=Xe(),s=l(null),[u,p]=i(!1),{formData:h,handleFormChange:m,formErrors:g,validateForm:f,resetFormData:v,loadFormWithDrawerItem:y}=gt({name:o}),b=c(()=>{if(!e)return v();const t=r?.find(e=>e.name===o);return t?y(t):v(),t},[e,r,o]),x=d((e,t)=>{m(e,t),p(!0)},[m]);if(!b)return null;return t(to,{ref:s,title:b.name,icons:[ii],hideEditTitleFromEdit:!0,isEdit:!0,isFormDirty:u,onSave:()=>{f({withAlert:!0,alertTitle:oe.Update})&&(a(o,h),p(!1),n())},onCancel:()=>{v(),p(!1),n()},children:t(pa,{children:t(ua,{formData:h,handleFormChange:x,formErrors:g,editingStreamName:o})})})},ma=h.div`
215
215
  position: relative;
216
- `,Qa=p(O)`
216
+ `,ga=h(O)`
217
217
  border: 1px solid ${({theme:e})=>e.colors.border};
218
218
  border-radius: 32px;
219
219
 
220
220
  & button {
221
221
  max-height: 28px;
222
222
  }
223
- `,Za=p(z)`
223
+ `,fa=h(W)`
224
224
  text-wrap: nowrap;
225
- `,eo=p(ot)`
225
+ `,va=h(rt)`
226
226
  max-height: 240px;
227
227
  padding: 0px !important;
228
- `,to=p(O)`
228
+ `,ya=h(O)`
229
229
  width: 100%;
230
- `,no=p.div`
230
+ `,ba=h.div`
231
231
  width: 100%;
232
- `,io=({onClickNewDataStream:a,updateDataStream:o,deleteDataStream:r})=>{const s=h(),{clearStore:l}=gt(),{popupRef:d,popupOpen:u,setPopupOpen:p,popupPosition:m,handlePosition:g}=it(),{dataStreams:y,selectedStreamName:v,setSelectedStreamName:f}=Ye(),[b,S]=i(""),[x,C]=i(""),[N,k]=i(""),T=c(()=>y.filter(({name:e})=>!N||e.toLowerCase().includes(N.toLowerCase())).map(({name:n})=>e(to,{children:[t(no,{children:t(rt,{label:n,isSelected:v===n,onClick:()=>{l(),f(n),p(!1)},color:"transparent",style:{width:"100%",justifyContent:"flex-start"}})}),n!==yt&&t(R,{onClick:()=>C(n),tooltip:W.DELETE,children:t(Mn,{})}),t(R,{onClick:()=>S(n),tooltip:W.EDIT,children:t(Pn,{})})]},`stream-${n}`)),[y,v,N]);return e(n,{children:[e(Xa,{children:[e(Qa,{$gap:0,children:[e(_e,{variant:"tertiary",onClick:()=>{g(0,50),p(e=>!e)},children:[t(Bn,{fill:s.text.info}),e(Za,{children:["Data Stream: ",v]}),t(vt,{extend:u}),t(Le,{label:y.length})]}),t(A,{orientation:"vertical",length:"32px",thickness:2,margin:"0"}),t(L,{onClick:()=>{l(),a()},label:W.NEW})]}),t(at,{ref:d,isOpen:u,top:m.top,left:m.left,header:t(E,{placeholder:"Search...",icon:zn,value:N,onChange:e=>k(e.target.value)}),children:t(eo,{children:T})})]}),t(q,{isOpen:""!==x,name:x,onApprove:()=>{r(x),C("")},onDeny:()=>{C("")}}),t(Ya,{isOpen:""!==b,onClose:()=>{S("")},dataStreamName:b,updateDataStream:o})]})},ao=p.div`
232
+ `,xa=({onClickNewDataStream:o,updateDataStream:a,deleteDataStream:r})=>{const l=g(),{clearStore:s}=ft(),{popupRef:d,popupOpen:u,setPopupOpen:p,popupPosition:h,handlePosition:m}=ot(),{dataStreams:f,selectedStreamName:v,setSelectedStreamName:y}=Xe(),[b,x]=i(""),[S,C]=i(""),[w,$]=i(""),E=c(()=>f.filter(({name:e})=>!w||e.toLowerCase().includes(w.toLowerCase())).map(({name:n})=>e(ya,{children:[t(ba,{children:t(lt,{label:n,isSelected:v===n,onClick:()=>{s(),y(n),p(!1)},color:"transparent",style:{width:"100%",justifyContent:"flex-start"}})}),n!==vt&&t(M,{onClick:()=>C(n),tooltip:H.DELETE,children:t(Gn,{})}),t(M,{onClick:()=>x(n),tooltip:H.EDIT,children:t(Xn,{})})]},`stream-${n}`)),[f,v,w]);return e(n,{children:[e(ma,{children:[e(ga,{$gap:0,children:[e(_e,{variant:"tertiary",onClick:()=>{m(0,50),p(e=>!e)},children:[t(ii,{fill:l.text.info}),e(fa,{children:["Data Stream: ",v]}),t(yt,{extend:u}),t(Le,{label:f.length})]}),t(I,{orientation:"vertical",length:"32px",thickness:2,margin:"0"}),t(L,{onClick:()=>{s(),o()},label:H.NEW})]}),t(at,{ref:d,isOpen:u,top:h.top,left:h.left,header:t(k,{placeholder:"Search...",icon:ti,value:w,onChange:e=>$(e.target.value)}),children:t(va,{children:E})})]}),t(G,{isOpen:""!==S,name:S,onApprove:()=>{r(S),C("")},onDeny:()=>{C("")}}),t(ha,{isOpen:""!==b,onClose:()=>{x("")},dataStreamName:b,updateDataStream:a})]})},Sa=h.div`
233
233
  display: flex;
234
234
  align-items: center;
235
235
  margin: 20px 0;
236
236
  padding: 0 16px;
237
237
  gap: 8px;
238
- `,oo=p.div`
238
+ `,Ca=h.div`
239
239
  margin-left: auto;
240
- `,ro=({addEntity:n,preventSearchPopup:i,onClickNewDataStream:a,updateDataStream:o,deleteDataStream:r})=>{const{isVm:s}=ae(),{setCurrentModal:l}=oe();return e(ao,{children:[!s&&t(io,{onClickNewDataStream:a,updateDataStream:o,deleteDataStream:r}),t(Ra,{preventPopup:i}),t(Ha,{}),n&&t(oo,{children:t(L,{"data-id":`add-${n}`,onClick:()=>l(n),label:`${W.ADD} ${lt(n)}`,variant:"primary",textProps:{weight:900}})})]})},so=r(({isModal:n,onClickSummary:i},a)=>{const{selectedStreamName:o}=Ye(),{formData:r,handleFormChange:s,formErrors:c,validateForm:d}=ht({name:o});return l(a,()=>({validateForm:d,getFormValues:()=>r})),t(le,{$isNotModal:!n,children:e(I,{$gap:24,children:[i&&t(ft,{onClick:i}),t(P,{title:g.NAME_YOUR_STREAM,description:g.STREAM_DESCRIPTION}),t(Ga,{formData:r,handleFormChange:s,formErrors:c})]})})});so.displayName=so.name;const lo=({createDataStream:e})=>{const{currentModal:n,setCurrentModal:i}=oe(),{addDataStreams:a,setSelectedStreamName:o}=Ye(),r=n===bt.DataStream,l=()=>i(""),c=async()=>{if(d.current&&d.current.validateForm()){const t=d.current.getFormValues();e?e(t):(a([t]),o(t.name)),l()}},d=s(null);return B({key:"Enter",active:r},c),t(se,{isOpen:r,onClose:l,header:{title:"Add Data Stream"},actionComponent:t(me,{buttons:[{label:"DONE",variant:"primary",onClick:c}]}),children:t(so,{ref:d,isModal:!0})})},co=(e,t)=>{const{destinationType:n,disabled:i,exportedSignals:a}=e,o=[{title:g.TYPE,value:n.type},{type:y.ActiveStatus,title:g.STATUS,value:String(!i)},{type:y.Monitors,title:g.MONITORS,value:ze(a).join(", ")},{title:g.NAME,value:n.displayName}],r=St(e,t),s=r.map(e=>({name:e.key,value:e.value}));return r.map(({key:e,name:n,value:i})=>{const{secret:r,componentProperties:l,hideFromReadData:c,customReadDataLabels:d}=t.find(t=>t.name===e)||{};if(!(!!c?.length&&xt(c,ze(a),s))){const{type:e}=Ct(l,{type:""}),t=(r||"password"===e)&&i.length?new Array(10).fill("•").join(""):"";o.push({type:y.Divider}),d?.length?d.forEach(({condition:e,...t})=>{e==i&&o.push({title:t.title,value:t.value})}):o.push({title:n,value:t||i})}}),o},uo=({signals:e,fields:n,onChange:i,formErrors:a})=>n?.map(o=>{const{componentType:r,renderCondition:s,...l}=o;if(!(!s||xt(s,e,n)))return null;switch(r){case M.Input:return t(E,{...l,onChange:e=>i(o.name,e.target.value),errorMessage:a[o.name]},o.name);case M.Dropdown:return t(ct,{...l,showSearch:!0,value:{id:l.value||"",value:l.value||""},options:l.options||[],onSelect:e=>i(o.name,e.id),errorMessage:a[o.name]},o.name);case M.MultiInput:return t(D,{...l,value:"string"==typeof l.value?Ct(l.value,[]):l.value,onChange:e=>i(o.name,JSON.stringify(e)),errorMessage:a[o.name]},o.name);case M.KeyValuePair:return t($,{...l,value:"string"==typeof l.value?Ct(l.value,[]):l.value,onChange:e=>i(o.name,JSON.stringify(e)),errorMessage:a[o.name]},o.name);case M.TextArea:return t(V,{...l,onChange:e=>i(o.name,e.target.value),errorMessage:a[o.name]},o.name);case M.Checkbox:return t(x,{...l,value:"true"==l.value,onChange:e=>i(o.name,String(e)),errorMessage:a[o.name]},o.name);default:return null}}),po=p(_e)`
240
+ `,wa=({addEntity:n,preventSearchPopup:i,onClickNewDataStream:o,updateDataStream:a,deleteDataStream:r})=>{const{isVm:l}=ae(),{setCurrentModal:s}=re();return e(Sa,{children:[!l&&t(xa,{onClickNewDataStream:o,updateDataStream:a,deleteDataStream:r}),t(Jo,{preventPopup:i}),t(ca,{}),n&&t(Ca,{children:t(L,{"data-id":`add-${n}`,onClick:()=>s(n),label:`${H.ADD} ${ct(n)}`,variant:"primary",textProps:{weight:900}})})]})},ka=r(({isModal:n,onClickSummary:i},o)=>{const{selectedStreamName:a}=Xe(),{formData:r,handleFormChange:l,formErrors:c,validateForm:d}=gt({name:a});return s(o,()=>({validateForm:d,getFormValues:()=>r})),t(ce,{$isNotModal:!n,children:e(R,{$gap:24,children:[i&&t(bt,{onClick:i}),t(z,{title:f.NAME_YOUR_STREAM,description:f.STREAM_DESCRIPTION}),t(ua,{formData:r,handleFormChange:l,formErrors:c})]})})});ka.displayName=ka.name;const $a=({createDataStream:e})=>{const{currentModal:n,setCurrentModal:i}=re(),{addDataStreams:o,setSelectedStreamName:a}=Xe(),r=n===xt.DataStream,s=()=>i(""),c=async()=>{if(d.current&&d.current.validateForm()){const t=d.current.getFormValues();e?e(t):(o([t]),a(t.name)),s()}},d=l(null);return U({key:"Enter",active:r},c),t(se,{isOpen:r,onClose:s,header:{title:"Add Data Stream"},actionComponent:t(me,{buttons:[{label:"DONE",variant:"primary",onClick:c}]}),children:t(ka,{ref:d,isModal:!0})})},Ea=(e,t)=>{const{destinationType:n,disabled:i,exportedSignals:o}=e,a=[{title:f.TYPE,value:n.type},{type:v.ActiveStatus,title:f.STATUS,value:String(!i)},{type:v.Monitors,title:f.MONITORS,value:We(o).join(", ")},{title:f.NAME,value:n.displayName}],r=St(e,t),l=r.map(e=>({name:e.key,value:e.value}));return r.map(({key:e,name:n,value:i})=>{const{secret:r,componentProperties:s,hideFromReadData:c,customReadDataLabels:d}=t.find(t=>t.name===e)||{};if(!(!!c?.length&&Ct(c,We(o),l))){const{type:e}=wt(s,{type:""}),t=(r||"password"===e)&&i.length?new Array(10).fill("•").join(""):"";a.push({type:v.Divider}),d?.length?d.forEach(({condition:e,...t})=>{e==i&&a.push({title:t.title,value:t.value})}):a.push({title:n,value:t||i})}}),a},Ta=({signals:e,fields:n,onChange:i,formErrors:o})=>n?.map(a=>{const{componentType:r,renderCondition:l,...s}=a;if(!(!l||Ct(l,e,n)))return null;switch(r){case F.Input:return t(k,{...s,onChange:e=>i(a.name,e.target.value),errorMessage:o[a.name]},a.name);case F.Dropdown:return t(dt,{...s,showSearch:!0,value:{id:s.value||"",value:s.value||""},options:s.options||[],onSelect:e=>i(a.name,e.id),errorMessage:o[a.name]},a.name);case F.MultiInput:return t(A,{...s,value:"string"==typeof s.value?wt(s.value,[]):s.value,onChange:e=>i(a.name,JSON.stringify(e)),errorMessage:o[a.name]},a.name);case F.KeyValuePair:return t(D,{...s,value:"string"==typeof s.value?wt(s.value,[]):s.value,onChange:e=>i(a.name,JSON.stringify(e)),errorMessage:o[a.name]},a.name);case F.TextArea:return t(B,{...s,onChange:e=>i(a.name,e.target.value),errorMessage:o[a.name]},a.name);case F.Checkbox:return t(C,{...s,value:"true"==s.value,onChange:e=>i(a.name,String(e)),errorMessage:o[a.name]},a.name);default:return null}}),Na=h(_e)`
241
241
  display: flex;
242
242
  align-items: center;
243
243
  gap: 8px;
244
244
 
245
- ${({$status:e,theme:t})=>e===de.Success?m`
245
+ ${({$status:e,theme:t})=>e===ue.Success?m`
246
246
  border-color: transparent;
247
247
  background-color: ${t.colors.success};
248
248
  `:"error"===e?m`
@@ -251,43 +251,43 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
251
251
  `:m`
252
252
  background-color: transparent;
253
253
  `}
254
- `,mo=({destination:n,validateForm:a,status:o,testConnection:r,onSuccess:s,onError:l})=>{const c=h(),{selectedStreamName:d}=Ye(),[u,p]=i(!1),m=o?be(o,c):void 0;return e(po,{$status:o,variant:"secondary",onClick:async()=>{if(a()){p(!0);const e=await r({...n,currentStreamName:d});e&&(e.succeeded?s(e):l(e)),p(!1)}},children:[u?t(Fe,{}):m?t(m,{}):null,t(z,{family:"secondary",decoration:"underline",size:14,color:o?c.text[o]:void 0,children:u?"Checking":o===de.Success?"Connection OK":"error"===o?"Connection Failed":"Test Connection"})]})},ho=p(I)`
254
+ `,Da=({destination:n,validateForm:o,status:a,testConnection:r,onSuccess:l,onError:s})=>{const c=g(),{selectedStreamName:d}=Xe(),[u,p]=i(!1),h=a?xe(a,c):void 0;return e(Na,{$status:a,variant:"secondary",onClick:async()=>{if(o()){p(!0);const e=await r({...n,currentStreamName:d});e&&(e.succeeded?l(e):s(e)),p(!1)}},children:[u?t(Pe,{}):h?t(h,{}):null,t(W,{family:"secondary",decoration:"underline",size:14,color:a?c.text[a]:void 0,children:u?"Checking":a===ue.Success?"Connection OK":"error"===a?"Connection Failed":"Test Connection"})]})},Aa=h(R)`
255
255
  align-items: unset;
256
256
  padding: 0 4px;
257
- `,go=p.div`
257
+ `,Ia=h.div`
258
258
  display: flex;
259
259
  flex-direction: column;
260
260
  gap: 12px;
261
- `,yo=p(O)`
261
+ `,Ra=h(O)`
262
262
  justify-content: space-between;
263
- `,vo=p(z)`
263
+ `,Oa=h(W)`
264
264
  margin-bottom: 12px;
265
- `,fo=({isUpdate:n,categoryItem:o,formData:r,formErrors:l,validateForm:d,handleFormChange:u,dynamicFields:p,setDynamicFields:m,testConnection:y})=>{const{type:v,displayName:f,supportedSignals:b,testConnectionSupported:S}=o||{},x=h(),[C,N]=i(!1),[k,T]=i(!1),[w,$]=i(void 0),D=s(!1);a(()=>{if(p.length&&!D.current){D.current=!0;let e=!1;for(let t=0;t<p.length;t++){const{required:n,value:i}=p[t];if(n){if([void 0,null,""].includes(i)){e=!1;break}e=!0}}N(e)}},[p,k]);const I=c(()=>{const{logs:e,metrics:t,traces:n}=b||{},i=[];return e?.supported&&i.push(Et.Logs),t?.supported&&i.push(Et.Metrics),n?.supported&&i.push(Et.Traces),i},[b]),O=c(()=>{const{logs:e,metrics:t,traces:n}=r.exportedSignals||{},i=[];return e&&i.push(Et.Logs),t&&i.push(Et.Metrics),n&&i.push(Et.Traces),i},[r.exportedSignals]),R=()=>{N(!1),T(!0),$(void 0)};return e(ho,{$gap:24,children:[e(ho,{$gap:12,children:[t(P,{title:n?"Update destination":"Create destination",description:`Connect ${f} with Odigos.`,actionButton:S&&t(mo,{destination:r,validateForm:d,status:w?.type,testConnection:y,onError:e=>{T(!1),$({type:de.Error,title:e?.reason||"Connection failed",message:e?.message||"Please check your input and try again."})},onSuccess:e=>{T(!1),$({type:de.Success,title:e?.reason||"Connection succeeded",message:e?.message||""})}})}),e(go,{children:[S&&w&&t(ce,{type:w.type,title:w.title,message:w.message}),C&&!w&&!n&&t(ce,{type:de.Default,message:`Odigos autocompleted ${f} destination details.`})]}),t(A,{})]}),e(yo,{children:[t(j,{title:n?"":"This connection will monitor:",required:!0,allowedSignals:I,selectedSignals:O,setSelectedSignals:e=>{R(),u("exportedSignals",{logs:e.includes(Et.Logs),metrics:e.includes(Et.Metrics),traces:e.includes(Et.Traces)})},errorMessage:l.exportedSignals}),!n&&t(K,{endpoint:`/backends/${v}`})]}),n&&e("div",{children:[t(vo,{children:"Status"}),t(F,{options:[{icon:Fn,label:g.ENABLED,value:!1,selectedBgColor:x.text.success+_["050"]},{icon:_n,label:g.DISABLED,value:!0,selectedBgColor:x.text.error+_["050"]}],selected:r.disabled,setSelected:e=>u("disabled",e)})]}),!n&&t(E,{title:"Destination name",placeholder:"Enter destination name",value:r.name,onChange:e=>{R(),u("name",e.target.value)},errorMessage:l.name}),t(uo,{signals:O,fields:p,onChange:(e,t)=>{R(),m(n=>{const i=[...n],a=i.findIndex(t=>t.name===e);return-1!==a&&(i[a]={...i[a],value:t}),i})},formErrors:l})]})},bo=p.div`
265
+ `,Ma=({isUpdate:n,categoryItem:a,formData:r,formErrors:s,validateForm:d,handleFormChange:u,dynamicFields:p,setDynamicFields:h,testConnection:m})=>{const{type:v,displayName:y,supportedSignals:b,testConnectionSupported:x}=a||{},S=g(),[C,w]=i(!1),[$,E]=i(!1),[T,N]=i(void 0),D=l(!1);o(()=>{if(p.length&&!D.current){D.current=!0;let e=!1;for(let t=0;t<p.length;t++){const{required:n,value:i}=p[t];if(n){if([void 0,null,""].includes(i)){e=!1;break}e=!0}}w(e)}},[p,$]);const A=c(()=>{const{logs:e,metrics:t,traces:n}=b||{},i=[];return e?.supported&&i.push(kt.Logs),t?.supported&&i.push(kt.Metrics),n?.supported&&i.push(kt.Traces),i},[b]),R=c(()=>{const{logs:e,metrics:t,traces:n}=r.exportedSignals||{},i=[];return e&&i.push(kt.Logs),t&&i.push(kt.Metrics),n&&i.push(kt.Traces),i},[r.exportedSignals]),O=()=>{w(!1),E(!0),N(void 0)};return e(Aa,{$gap:24,children:[e(Aa,{$gap:12,children:[t(z,{title:n?"Update destination":"Create destination",description:`Connect ${y} with Odigos.`,actionButton:x&&t(Da,{destination:r,validateForm:d,status:T?.type,testConnection:m,onError:e=>{E(!1),N({type:ue.Error,title:e?.reason||"Connection failed",message:e?.message||"Please check your input and try again."})},onSuccess:e=>{E(!1),N({type:ue.Success,title:e?.reason||"Connection succeeded",message:e?.message||""})}})}),e(Ia,{children:[x&&T&&t(de,{type:T.type,title:T.title,message:T.message}),C&&!T&&!n&&t(de,{type:ue.Default,message:`Odigos autocompleted ${y} destination details.`})]}),t(I,{})]}),e(Ra,{children:[t(j,{title:n?"":"This connection will monitor:",required:!0,allowedSignals:A,selectedSignals:R,setSelectedSignals:e=>{O(),u("exportedSignals",{logs:e.includes(kt.Logs),metrics:e.includes(kt.Metrics),traces:e.includes(kt.Traces)})},errorMessage:s.exportedSignals}),!n&&t(K,{endpoint:`/backends/${v}`})]}),n&&e("div",{children:[t(Oa,{children:"Status"}),t(P,{options:[{icon:Yn,label:f.ENABLED,value:!1,selectedBgColor:S.text.success+_["050"]},{icon:Jn,label:f.DISABLED,value:!0,selectedBgColor:S.text.error+_["050"]}],selected:r.disabled,setSelected:e=>u("disabled",e)})]}),!n&&t(k,{title:"Destination name",placeholder:"Enter destination name",value:r.name,onChange:e=>{O(),u("name",e.target.value)},errorMessage:s.name}),t(Ta,{signals:R,fields:p,onChange:(e,t)=>{O(),h(n=>{const i=[...n],o=i.findIndex(t=>t.name===e);return-1!==o&&(i[o]={...i[o],value:t}),i})},formErrors:s})]})},La=h.div`
266
266
  width: 100%;
267
267
  height: 100%;
268
268
  max-height: calc(100vh - 220px);
269
269
  overflow: overlay;
270
270
  overflow-y: auto;
271
- `,So=p.div`
271
+ `,Fa=h.div`
272
272
  display: flex;
273
273
  flex-direction: column;
274
274
  gap: 12px;
275
- `,xo=({categories:n,updateDestination:o,deleteDestination:r,testConnection:l})=>{const{destinations:d}=Y(),{selectedStreamName:u}=Ye(),{drawerType:p,drawerEntityId:m}=U(),h=c(()=>Ze(d,u),[d,u]),y=s(null),v=p===J.Destination,[f,b]=i(!1),[S,x]=i(!1),{formData:C,formErrors:E,handleFormChange:N,resetFormData:k,validateForm:T,loadFormWithDrawerItem:w,yamlFields:$,setYamlFields:D,dynamicFields:A,setDynamicFields:I}=Nt({}),O=c(()=>{if(m)return h?.find(e=>Q(e)===m)},[m,h]);if(a(()=>{v&&O?(D(kt(n,O)),w(O)):k()},[v,O,n]),!O)return null;const R=n.flatMap(e=>e.items).find(e=>e.type===O.destinationType.type),{icon:L,iconSrc:M}=R?We(R?.type):{icon:void 0,iconSrc:void 0};return t(Ki,{ref:y,title:O.name||O.destinationType.displayName,icons:L?[L]:void 0,iconSrcs:M?[M]:void 0,isEdit:f,isFormDirty:S,onEdit:e=>{b("boolean"!=typeof e||e)},onSave:async e=>{if(T({withAlert:!0,alertTitle:ie.Update})){const t=e!==O.destinationType.displayName?e:"";N("name",t),o(m,{...C,name:t}),b(!1),x(!1)}},onDelete:async()=>{r(m),b(!1),x(!1),y.current?.closeDrawer()},onCancel:()=>{b(!1),x(!1),w(O)},isLastItem:1===h.length,children:f?t(bo,{children:t(fo,{isUpdate:!0,categoryItem:R,formData:C,formErrors:E,handleFormChange:(...e)=>{x(!0),N(...e)},dynamicFields:A,setDynamicFields:(...e)=>{x(!0),I(...e)},validateForm:T,testConnection:l})}):e(So,{children:[O.conditions?.length?t(ee,{conditions:O.conditions}):null,t(te,{title:g.DESTINATION_DETAILS,data:O?co(O,$):[]})]})})},Co=p.div`
275
+ `,Pa=({categories:n,updateDestination:a,deleteDestination:r,testConnection:s})=>{const{destinations:d}=X(),{selectedStreamName:u}=Xe(),{drawerType:p,drawerEntityId:h}=V(),m=c(()=>et(d,u),[d,u]),g=l(null),v=p===J.Destination,[y,b]=i(!1),[x,S]=i(!1),{formData:C,formErrors:w,handleFormChange:k,resetFormData:$,validateForm:E,loadFormWithDrawerItem:T,yamlFields:N,setYamlFields:D,dynamicFields:A,setDynamicFields:I}=$t({}),R=c(()=>{if(h)return m?.find(e=>Z(e)===h)},[h,m]);if(o(()=>{v&&R?(D(Et(n,R)),T(R)):$()},[v,R,n]),!R)return null;const O=n.flatMap(e=>e.items).find(e=>e.type===R.destinationType.type),{icon:M,iconSrc:L}=O?He(O?.type):{icon:void 0,iconSrc:void 0};return t(to,{ref:g,title:R.name||R.destinationType.displayName,icons:M?[M]:void 0,iconSrcs:L?[L]:void 0,isEdit:y,isFormDirty:x,onEdit:e=>{b("boolean"!=typeof e||e)},onSave:async e=>{if(E({withAlert:!0,alertTitle:oe.Update})){const t=e!==R.destinationType.displayName?e:"";k("name",t),a(h,{...C,name:t}),b(!1),S(!1)}},onDelete:async()=>{r(h),b(!1),S(!1),g.current?.closeDrawer()},onCancel:()=>{b(!1),S(!1),T(R)},isLastItem:1===m.length,children:y?t(La,{children:t(Ma,{isUpdate:!0,categoryItem:O,formData:C,formErrors:w,handleFormChange:(...e)=>{S(!0),k(...e)},dynamicFields:A,setDynamicFields:(...e)=>{S(!0),I(...e)},validateForm:E,testConnection:s})}):e(Fa,{children:[R.conditions?.length?t(te,{conditions:R.conditions}):null,t(ne,{title:f.DESTINATION_DETAILS,data:R?Ea(R,N):[]})]})})},_a=h.div`
276
276
  display: flex;
277
277
  flex-direction: column;
278
278
  gap: 12px;
279
- `,Eo=({items:n,onSelectNew:i,onSelectConfigured:a,isLoadingForDestinationIds:o})=>{const{configuredDestinationsUpdateOnly:r}=gt();return n.map(n=>{const s=n.name===$t.EXISTS;return e(Co,{children:[t(P,{size:"small",icon:n.icon,title:Tt(n.name),description:n.description}),n.items.map(e=>{const l=`select-${n.name.replaceAll(" ","")}-destination-${e.type}-${e.id||""}`,c=wt(e.supportedSignals),{icon:d,iconSrc:u}=We(e.type),p=e.selected||r.some(t=>t.id===e.id),m=!!o.find(t=>t===e.id),h=s?()=>a(e.id):()=>i(e);return t(Ke,{"data-id":l,title:e.displayName,hoverText:W.SELECT,onClick:h,iconProps:{icon:d,iconSrc:u},visualProps:{monitors:c,monitorsWithLabels:!0},checkboxProps:{withCheckbox:s,isChecked:p,isLoading:m,onCheckboxChange:()=>a(e.id)}},l)})]},`category-${n.name}`)})},No=p.div`
279
+ `,za=({items:n,onSelectNew:i,onSelectConfigured:o,isLoadingForDestinationIds:a})=>{const{configuredDestinationsUpdateOnly:r}=ft();return n.map(n=>{const l=n.name===Dt.EXISTS;return e(_a,{children:[t(z,{size:"small",icon:n.icon,title:Tt(n.name),description:n.description}),n.items.map(e=>{const s=`select-${n.name.replaceAll(" ","")}-destination-${e.type}-${e.id||""}`,c=Nt(e.supportedSignals),{icon:d,iconSrc:u}=He(e.type),p=e.selected||r.some(t=>t.id===e.id),h=!!a.find(t=>t===e.id),m=l?()=>o(e.id):()=>i(e);return t(Ke,{"data-id":s,title:e.displayName,hoverText:H.SELECT,onClick:m,iconProps:{icon:d,iconSrc:u},visualProps:{monitors:c,monitorsWithLabels:!0},checkboxProps:{withCheckbox:l,isChecked:p,isLoading:h,onCheckboxChange:()=>o(e.id)}},s)})]},`category-${n.name}`)})},Ka=h.div`
280
280
  display: flex;
281
281
  flex-direction: column;
282
282
  gap: 24px;
283
- `,ko=p.div`
283
+ `,ja=h.div`
284
284
  display: flex;
285
285
  align-items: center;
286
286
  gap: 12px;
287
- `,To=p.div`
287
+ `,Ba=h.div`
288
288
  width: 170px;
289
289
  margin-right: 8px;
290
- `,wo=p.div`
290
+ `,Wa=h.div`
291
291
  display: flex;
292
292
  flex-direction: column;
293
293
  align-self: stretch;
@@ -298,18 +298,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
298
298
  @media (height < 800px) {
299
299
  max-height: calc(100vh - 400px);
300
300
  }
301
- `,$o=p(No)`
301
+ `,Va=h(Ka)`
302
302
  margin-top: 80px;
303
- `,Do=Object.values($t).map(e=>({value:At[e].TITLE,id:e})),Ao=Do[0],Io=[Et.Logs,Et.Metrics,Et.Traces],Oo=(e,t,n)=>e.map(e=>{const{type:i,displayName:a}=e.destinationType,o=e.dataStreamNames?.includes(t),r=n.has(e.id);return{id:e.id,type:i,displayName:a,selected:o||r,fields:[],testConnectionSupported:!1,supportedSignals:{logs:{supported:e.exportedSignals.logs},metrics:{supported:e.exportedSignals.metrics},traces:{supported:e.exportedSignals.traces}}}}),Ro=({hidden:n,categories:a,potentialDestinations:o,onSelectNew:r,onSelectConfigured:s,isLoadingForDestinationIds:l})=>{const{destinations:d}=Y(),{selectedStreamName:u}=Ye(),{configuredDestinations:p,configuredDestinationsUpdateOnly:m}=gt(),[h,g]=i(""),[y,v]=i(Ao),[f,b]=i(Io),S=c(()=>{const e=Dt(a);return e.unshift({name:$t.EXISTS,description:At[$t.EXISTS].DESCRIPTION,icon:Wn,items:Oo(d,u,new Set(p.concat(m).map(e=>e.id)))}),e.unshift({name:$t.DETECTED,description:At[$t.DETECTED].DESCRIPTION,icon:Hn,items:o}),e.map(e=>{const t=e.items.filter(t=>{const n=!h||t.displayName.toLowerCase().includes(h.toLowerCase()),i="all"===y.id||y.id?.toLowerCase()?.replaceAll("-"," ")===e.name.toLowerCase()?.replaceAll("-"," "),a=f.some(e=>t.supportedSignals[It[e]]?.supported);return n&&i&&a});return{...e,items:t}}).filter(({items:e})=>!!e.length)},[a,o,d,h,y,f,u,p,m]);return n?null:e(No,{children:[t(P,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e(ko,{children:[t(To,{children:t(E,{placeholder:"Search...",icon:zn,value:h,onChange:({target:{value:e}})=>g(e)})}),t(To,{children:t(ct,{options:Do,value:y,onSelect:v,onDeselect:()=>{}})}),t(j,{title:"",selectedSignals:f,setSelectedSignals:b})]}),t(A,{}),S.length?t(wo,{children:t(Eo,{items:S,onSelectNew:e=>r(e,f),onSelectConfigured:s,isLoadingForDestinationIds:l})}):t($o,{children:t(Oe,{title:"No destinations found"})})]})},Lo=p.div`
303
+ `,Ua=Object.values(Dt).map(e=>({value:It[e].TITLE,id:e})),Ha=Ua[0],qa=[kt.Logs,kt.Metrics,kt.Traces],Ga=(e,t,n)=>e.map(e=>{const{type:i,displayName:o}=e.destinationType,a=e.dataStreamNames?.includes(t),r=n.has(e.id);return{id:e.id,type:i,displayName:o,selected:a||r,fields:[],testConnectionSupported:!1,supportedSignals:{logs:{supported:e.exportedSignals.logs},metrics:{supported:e.exportedSignals.metrics},traces:{supported:e.exportedSignals.traces}}}}),Ya=({hidden:n,categories:o,potentialDestinations:a,onSelectNew:r,onSelectConfigured:l,isLoadingForDestinationIds:s})=>{const{destinations:d}=X(),{selectedStreamName:u}=Xe(),{configuredDestinations:p,configuredDestinationsUpdateOnly:h}=ft(),[m,g]=i(""),[f,v]=i(Ha),[y,b]=i(qa),x=c(()=>{const e=At(o);return e.unshift({name:Dt.EXISTS,description:It[Dt.EXISTS].DESCRIPTION,icon:oi,items:Ga(d,u,new Set(p.concat(h).map(e=>e.id)))}),e.unshift({name:Dt.DETECTED,description:It[Dt.DETECTED].DESCRIPTION,icon:ai,items:a}),e.map(e=>{const t=e.items.filter(t=>{const n=!m||t.displayName.toLowerCase().includes(m.toLowerCase()),i="all"===f.id||f.id?.toLowerCase()?.replaceAll("-"," ")===e.name.toLowerCase()?.replaceAll("-"," "),o=y.some(e=>t.supportedSignals[Rt[e]]?.supported);return n&&i&&o});return{...e,items:t}}).filter(({items:e})=>!!e.length)},[o,a,d,m,f,y,u,p,h]);return n?null:e(Ka,{children:[t(z,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e(ja,{children:[t(Ba,{children:t(k,{placeholder:"Search...",icon:ti,value:m,onChange:({target:{value:e}})=>g(e)})}),t(Ba,{children:t(dt,{options:Ua,value:f,onSelect:v,onDeselect:()=>{}})}),t(j,{title:"",selectedSignals:y,setSelectedSignals:b})]}),t(I,{}),x.length?t(Wa,{children:t(za,{items:x,onSelectNew:e=>r(e,y),onSelectConfigured:l,isLoadingForDestinationIds:s})}):t(Va,{children:t(Oe,{title:"No destinations found"})})]})},Ja=h.div`
304
304
  display: flex;
305
- `,Mo=p.div`
305
+ `,Xa=h.div`
306
306
  border-right: 1px solid ${({theme:e})=>e.colors.border};
307
307
  padding: 32px;
308
308
  width: 200px;
309
309
  @media (max-width: 1050px) {
310
310
  display: none;
311
311
  }
312
- `,Fo=({isOnboarding:n,categories:a,potentialDestinations:o,createDestination:r,updateDestination:s,deleteDestination:l,testConnection:c})=>{const{destinations:d}=Y(),{selectedStreamName:u}=Ye(),{currentModal:p,setCurrentModal:m}=oe(),{addConfiguredDestination:h,addConfiguredDestinationUpdateOnly:y,removeConfiguredDestinationUpdateOnly:v,configuredDestinationsUpdateOnly:f}=gt(),b=p===J.Destination,[S,x]=i(void 0),{formData:C,formErrors:E,handleFormChange:N,resetFormData:k,validateForm:T,setYamlFields:w,dynamicFields:$,setDynamicFields:D,loadFormWithDrawerItem:A}=Nt({supportedSignals:S?.supportedSignals,preLoadedFields:S?.fields}),[I,O]=i([]),R=e=>{const t={};return e||$.forEach(e=>t[e.name]=e.value),{id:e?.id||"",name:e?.name||C.name,disabled:e?.disabled||C.disabled,dataStreamNames:e?.dataStreamNames||[],conditions:e?.conditions||[],exportedSignals:e?.exportedSignals||C.exportedSignals,fields:e?.fields||JSON.stringify(t),destinationType:e?.destinationType||{type:S.type,displayName:S.displayName,supportedSignals:{logs:{supported:!1},metrics:{supported:!1},traces:{supported:!1}}}}},L=async e=>{if(n&&!e){const e=R();h(e)}else if(n&&e){const t=R(e);f.some(t=>t.id===e.id)?v(e):y(t)}else if(n||e){if(!n&&e){const t=R(e),n=t.dataStreamNames.some(e=>e===u);O(t=>[...t,e.id]),n?await l(e.id):await s(e.id,A(t)),O(t=>t.filter(t=>t!==e.id))}}else r(C)},M=()=>{k(),x(void 0),m("")},F=()=>{k(),x(void 0)},_=async()=>{if(S){if(!T({withAlert:!n,alertTitle:ie.Create}))return null;L()}M()};return B({key:"Enter",active:b},()=>_()),t(se,{isOpen:b,onClose:M,header:{title:g.ADD_DESTINATION},actionComponent:t(me,{buttons:(()=>{const e=[{label:"DONE",variant:"primary",onClick:_}];return S&&e.unshift({label:"BACK",icon:()=>t(qn,{rotate:-90}),variant:"secondary",onClick:F}),e})()}),children:e(Lo,{children:[t(Mo,{children:t(Ot,{currentStep:S?2:1,data:[{stepNumber:1,title:g.DESTINATIONS},{stepNumber:2,title:g.CONNECTION}]})}),e(le,{style:{margin:"32px 24px 12px 24px"},children:[t(Ro,{hidden:void 0!==S,categories:a,potentialDestinations:o,onSelectNew:(e,t)=>{k(),N("type",e?.type||""),N("currentStreamName",u);const n={logs:!1,metrics:!1,traces:!1};t.filter(t=>e.supportedSignals[It[t]].supported).forEach(e=>n[It[e]]=!0),N("exportedSignals",n),w(e?.fields||[]),x(e)},onSelectConfigured:e=>{const t=d.find(t=>t.id===e);t&&L(t)},isLoadingForDestinationIds:I}),S&&t(fo,{categoryItem:S,formData:C,formErrors:E,handleFormChange:N,dynamicFields:$,setDynamicFields:D,validateForm:T,testConnection:c})]})]})})},_o=p.div`
312
+ `,Qa=({isOnboarding:n,categories:o,potentialDestinations:a,createDestination:r,updateDestination:l,deleteDestination:s,testConnection:c})=>{const{destinations:d}=X(),{selectedStreamName:u}=Xe(),{currentModal:p,setCurrentModal:h}=re(),{addConfiguredDestination:m,addConfiguredDestinationUpdateOnly:g,removeConfiguredDestinationUpdateOnly:v,configuredDestinationsUpdateOnly:y}=ft(),b=p===J.Destination,[x,S]=i(void 0),{formData:C,formErrors:w,handleFormChange:k,resetFormData:$,validateForm:E,setYamlFields:T,dynamicFields:N,setDynamicFields:D,loadFormWithDrawerItem:A}=$t({supportedSignals:x?.supportedSignals,preLoadedFields:x?.fields}),[I,R]=i([]),O=e=>{const t={};return e||N.forEach(e=>t[e.name]=e.value),{id:e?.id||"",name:e?.name||C.name,disabled:e?.disabled||C.disabled,dataStreamNames:e?.dataStreamNames||[],conditions:e?.conditions||[],exportedSignals:e?.exportedSignals||C.exportedSignals,fields:e?.fields||JSON.stringify(t),destinationType:e?.destinationType||{type:x.type,displayName:x.displayName,supportedSignals:{logs:{supported:!1},metrics:{supported:!1},traces:{supported:!1}}}}},M=async e=>{if(n&&!e){const e=O();m(e)}else if(n&&e){const t=O(e);y.some(t=>t.id===e.id)?v(e):g(t)}else if(n||e){if(!n&&e){const t=O(e),n=t.dataStreamNames.some(e=>e===u);R(t=>[...t,e.id]),n?await s(e.id):await l(e.id,A(t)),R(t=>t.filter(t=>t!==e.id))}}else r(C)},L=()=>{$(),S(void 0),h("")},F=()=>{$(),S(void 0)},P=async()=>{if(x){if(!E({withAlert:!n,alertTitle:oe.Create}))return null;M()}L()};return U({key:"Enter",active:b},()=>P()),t(se,{isOpen:b,onClose:L,header:{title:f.ADD_DESTINATION},actionComponent:t(me,{buttons:(()=>{const e=[{label:"DONE",variant:"primary",onClick:P}];return x&&e.unshift({label:"BACK",icon:()=>t(ri,{rotate:-90}),variant:"secondary",onClick:F}),e})()}),children:e(Ja,{children:[t(Xa,{children:t(Ot,{currentStep:x?2:1,data:[{stepNumber:1,title:f.DESTINATIONS},{stepNumber:2,title:f.CONNECTION}]})}),e(ce,{style:{margin:"32px 24px 12px 24px"},children:[t(Ya,{hidden:void 0!==x,categories:o,potentialDestinations:a,onSelectNew:(e,t)=>{$(),k("type",e?.type||""),k("currentStreamName",u);const n={logs:!1,metrics:!1,traces:!1};t.filter(t=>e.supportedSignals[Rt[t]].supported).forEach(e=>n[Rt[e]]=!0),k("exportedSignals",n),T(e?.fields||[]),S(e)},onSelectConfigured:e=>{const t=d.find(t=>t.id===e);t&&M(t)},isLoadingForDestinationIds:I}),x&&t(Ma,{categoryItem:x,formData:C,formErrors:w,handleFormChange:k,dynamicFields:N,setDynamicFields:D,validateForm:E,testConnection:c})]})]})})},Za=h.div`
313
313
  display: flex;
314
314
  flex-direction: column;
315
315
  align-items: center;
@@ -318,7 +318,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
318
318
  max-height: calc(100vh - 310px);
319
319
  height: fit-content;
320
320
  overflow-y: scroll;
321
- `,Po=({categories:e,withDelete:n})=>{const{configuredDestinations:i,configuredDestinationsUpdateOnly:a}=gt();return i.length||a.length?t(_o,{children:i.concat(a).map((o,r)=>t(Ko,{"data-id":`configured-destination-${o.destinationType.type}`,item:o,yamlFields:kt(e,o),isLastItem:i.length+a.length===1,withDelete:n},`configured-destination-${o.destinationType.type}-${r}`))}):t(Ie,{children:t(Oe,{title:"No destinations",subTitle:"Please add a destination"})})},Ko=({item:a,yamlFields:o,isLastItem:r,withDelete:s})=>{const[l,d]=i(!1),{icon:u,iconSrc:p}=We(a.destinationType.type),{removeConfiguredDestination:m,removeConfiguredDestinationUpdateOnly:h}=gt(),g=c(()=>St(a,o).map(e=>({title:e.name,value:e.value})),[a,o]);return e(n,{children:[t(Ke,{title:a.name||a.destinationType.displayName,subTitle:a.destinationType.type,iconProps:{icon:u,iconSrc:p},visualProps:{monitors:ze(a.exportedSignals),monitorsWithLabels:!0},extendableProps:{withExtend:!0,renderExtended:()=>t(Rt,{data:g})},renderActions:s?()=>t(R,{onClick:()=>d(!0),children:t(Mn,{})}):void 0}),s&&t(q,{isOpen:l,name:a.destinationType.displayName||a.name,type:J.Destination,isLastItem:r,onApprove:()=>{a.id?h(a):m(a)},onDeny:()=>d(!1)})]})},jo=p(_e)`
321
+ `,er=({categories:e,withDelete:n})=>{const{configuredDestinations:i,configuredDestinationsUpdateOnly:o}=ft();return i.length||o.length?t(Za,{children:i.concat(o).map((a,r)=>t(tr,{"data-id":`configured-destination-${a.destinationType.type}`,item:a,yamlFields:Et(e,a),isLastItem:i.length+o.length===1,withDelete:n},`configured-destination-${a.destinationType.type}-${r}`))}):t(Re,{children:t(Oe,{title:"No destinations",subTitle:"Please add a destination"})})},tr=({item:o,yamlFields:a,isLastItem:r,withDelete:l})=>{const[s,d]=i(!1),{icon:u,iconSrc:p}=He(o.destinationType.type),{removeConfiguredDestination:h,removeConfiguredDestinationUpdateOnly:m}=ft(),g=c(()=>St(o,a).map(e=>({title:e.name,value:e.value})),[o,a]);return e(n,{children:[t(Ke,{title:o.name||o.destinationType.displayName,subTitle:o.destinationType.type,iconProps:{icon:u,iconSrc:p},visualProps:{monitors:We(o.exportedSignals),monitorsWithLabels:!0},extendableProps:{withExtend:!0,renderExtended:()=>t(Mt,{data:g})},renderActions:l?()=>t(M,{onClick:()=>d(!0),children:t(Gn,{})}):void 0}),l&&t(G,{isOpen:s,name:o.destinationType.displayName||o.name,type:J.Destination,isLastItem:r,onApprove:()=>{o.id?m(o):h(o)},onDeny:()=>d(!1)})]})},nr=h(_e)`
322
322
  display: flex;
323
323
  align-items: center;
324
324
  justify-content: center;
@@ -327,7 +327,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
327
327
  padding: 32px;
328
328
  border-radius: 16px;
329
329
  border-style: dashed !important;
330
- `,Vo=({isSourcesListEmpty:i,goToSources:a,categories:o,potentialDestinations:r,testConnection:s,onClickSummary:l})=>{const c=h(),{setCurrentModal:d}=oe(),{configuredDestinations:u,configuredDestinationsUpdateOnly:p}=gt();return e(n,{children:[t(le,{$isNotModal:!0,children:e(I,{$gap:12,children:[e(I,{$gap:24,children:[l&&t(ft,{onClick:l}),t(P,{title:g.ADD_DESTINATIONS,badgeLabel:u.length+p.length,description:g.ADD_DESTINATION_DESCRIPTION}),i&&t(ce,{type:de.Warning,message:g.NO_SOURCES_GO_BACK,action:{label:g.SELECT_SOURCES,onClick:a}}),e(jo,{variant:"secondary",onClick:()=>d(J.Destination),children:[t(jn,{}),t(z,{color:c.colors.secondary,size:14,decoration:"underline",family:"secondary",children:g.ADD_DESTINATION})]})]}),t(Po,{categories:o,withDelete:!0})]})}),t(Fo,{isOnboarding:!0,categories:o,potentialDestinations:r,updateDestination:async()=>{},createDestination:async()=>{},deleteDestination:async()=>{},testConnection:s})]})},zo=[{key:"icon",title:""},{key:"name",title:g.NAME,sortable:!0},{key:"type",title:g.TYPE,sortable:!0},{key:"signals",title:g.MONITORS},{key:"active-status",title:g.STATUS},{key:"conditions",title:"Conditions"},{key:"throughput",title:"Throughput",sortable:!0}],Uo=({metrics:n,maxHeight:i,maxWidth:a})=>{const o=h(),r=Se(),{selectedStreamName:s}=Ye(),{setDrawerType:l,setDrawerEntityId:d}=U(),{destinations:u,destinationsLoading:p}=Y(),m=c(()=>Ze(u,s),[u,s]),y=c(()=>Ji({instrumentationRules:[],sources:[],actions:[],destinations:tt(m,r),searchText:r.searchText,selectedCategory:J.Destination}).searchResults.find(({category:e})=>e===J.Destination)?.entities||[],[m,r]),v=c(()=>y.map(e=>{const{hasErrors:i,hasWarnings:a,hasDisableds:r}=he(e.conditions||[]),{icon:s,iconSrc:c}=We(e.destinationType.type);return{status:i?de.Error:a?de.Warning:void 0,faded:r,onClick:()=>{l(J.Destination),d(e.id)},cells:[{columnKey:"icon",component:()=>t(Ce,{icon:s,src:c})},{columnKey:"name",value:Ee(e,J.Destination,{prioritizeDisplayName:!0})},{columnKey:"type",value:e.destinationType.type,textColor:o.text.info},{columnKey:"throughput",value:Ue(Lt(n,J.Destination,e.id).throughput),textColor:o.text.info},{columnKey:"signals",component:()=>t(Ne,{withLabels:!0,monitors:ze(e.exportedSignals)})},{columnKey:"conditions",component:()=>e.conditions?.length?t(qi,{conditions:e.conditions,id:e.id}):null},{columnKey:"active-status",component:()=>t("div",{style:{lineHeight:1},children:t(ge,{status:e.disabled?de.Error:de.Success,title:e.disabled?g.DISABLED:g.ENABLED,withIcon:!0,withBorder:!0})})}]}}),[y,n]),{badge:f,badgeTooltip:b}=c(()=>y.length!==m.length?{badge:`${y.length}/${m.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:m.length,badgeTooltip:void 0},[y,m]);return e(ke,{$maxWidth:a,children:[t(Te,{children:t(we,{icon:$e(J.Destination),title:g.DESTINATIONS,badge:f,badgeTooltip:b,loading:p})}),t(De,{$maxHeight:i,children:t(Ae,{columns:zo,rows:v})}),!y.length&&t(Ie,{style:{marginTop:"2rem"},children:t(Oe,{})})]})},Bo=e=>{const{type:t,ruleName:n,notes:i,disabled:a,profileName:o,payloadCollection:r,codeAttributes:s,headersCollection:l,customInstrumentations:c}=e,d=[{title:g.TYPE,value:t},{type:y.ActiveStatus,title:g.STATUS,value:String(!a)},{title:g.NAME,value:n},{title:g.NOTES,value:i},{title:g.MANAGED_BY_PROFILE,value:o},{type:y.Divider}];if(r){const e=Object.entries(r).filter(([e,t])=>t).map(([e,t])=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(s){const e=Object.entries(s).filter(([e,t])=>t).map(([e,t])=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(l){const e=(l[Mt.HeaderKeys]||[]).filter(e=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(c){const e=(c[_t.Java]||[]).map(e=>new Ft(e.className,e.methodName)).map(e=>`• ${e.toString()}`).join("\r\n");e&&d.push({title:g.JAVA_CUSTOM_PROBES,value:e});const t=(c[_t.Golang]||[]).map(e=>new Pt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)).map(e=>`• ${e.toString()}`).join("\r\n");t&&d.push({title:g.GOLANG_CUSTOM_PROBES,value:t})}return d},Wo=p.div`
330
+ `,ir=({isSourcesListEmpty:i,goToSources:o,categories:a,potentialDestinations:r,testConnection:l,onClickSummary:s})=>{const c=g(),{setCurrentModal:d}=re(),{configuredDestinations:u,configuredDestinationsUpdateOnly:p}=ft();return e(n,{children:[t(ce,{$isNotModal:!0,children:e(R,{$gap:12,children:[e(R,{$gap:24,children:[s&&t(bt,{onClick:s}),t(z,{title:f.ADD_DESTINATIONS,badgeLabel:u.length+p.length,description:f.ADD_DESTINATION_DESCRIPTION}),i&&t(de,{type:ue.Warning,message:f.NO_SOURCES_GO_BACK,action:{label:f.SELECT_SOURCES,onClick:o}}),e(nr,{variant:"secondary",onClick:()=>d(J.Destination),children:[t(Zn,{}),t(W,{color:c.colors.secondary,size:14,decoration:"underline",family:"secondary",children:f.ADD_DESTINATION})]})]}),t(er,{categories:a,withDelete:!0})]})}),t(Qa,{isOnboarding:!0,categories:a,potentialDestinations:r,updateDestination:async()=>{},createDestination:async()=>{},deleteDestination:async()=>{},testConnection:l})]})},or=[{key:"icon",title:""},{key:"name",title:f.NAME,sortable:!0},{key:"type",title:f.TYPE,sortable:!0},{key:"signals",title:f.MONITORS},{key:"active-status",title:f.STATUS},{key:"conditions",title:"Conditions"},{key:"throughput",title:"Throughput",sortable:!0}],ar=({metrics:n,maxHeight:i,maxWidth:o})=>{const a=g(),r=Se(),{selectedStreamName:l}=Xe(),{setDrawerType:s,setDrawerEntityId:d}=V(),{destinations:u,destinationsLoading:p}=X(),h=c(()=>et(u,l),[u,l]),m=c(()=>po({instrumentationRules:[],sources:[],actions:[],destinations:nt(h,r),searchText:r.searchText,selectedCategory:J.Destination}).searchResults.find(({category:e})=>e===J.Destination)?.entities||[],[h,r]),v=c(()=>m.map(e=>{const{hasErrors:i,hasWarnings:o,hasDisableds:r}=ge(e.conditions||[]),{icon:l,iconSrc:c}=He(e.destinationType.type);return{status:i?ue.Error:o?ue.Warning:void 0,faded:r,onClick:()=>{s(J.Destination),d(e.id)},cells:[{columnKey:"icon",component:()=>t(we,{icon:l,src:c})},{columnKey:"name",value:ke(e,J.Destination,{prioritizeDisplayName:!0})},{columnKey:"type",value:e.destinationType.type,textColor:a.text.info},{columnKey:"throughput",value:Ve(Lt(n,J.Destination,e.id).throughput),textColor:a.text.info},{columnKey:"signals",component:()=>t($e,{withLabels:!0,monitors:We(e.exportedSignals)})},{columnKey:"conditions",component:()=>e.conditions?.length?t(co,{conditions:e.conditions,id:e.id}):null},{columnKey:"active-status",component:()=>t("div",{style:{lineHeight:1},children:t(fe,{status:e.disabled?ue.Error:ue.Success,title:e.disabled?f.DISABLED:f.ENABLED,withIcon:!0,withBorder:!0})})}]}}),[m,n]),{badge:y,badgeTooltip:b}=c(()=>m.length!==h.length?{badge:`${m.length}/${h.length}`,badgeTooltip:f.FILTERED_COUNT_TOOLTIP}:{badge:h.length,badgeTooltip:void 0},[m,h]);return e(Ee,{$maxWidth:o,children:[t(Te,{children:t(Ne,{icon:De(J.Destination),title:f.DESTINATIONS,badge:y,badgeTooltip:b,loading:p})}),t(Ae,{$maxHeight:i,children:t(Ie,{columns:or,rows:v})}),!m.length&&t(Re,{style:{marginTop:"2rem"},children:t(Oe,{})})]})},rr=e=>{const{type:t,ruleName:n,notes:i,disabled:o,profileName:a,payloadCollection:r,codeAttributes:l,headersCollection:s,customInstrumentations:c}=e,d=[{title:f.TYPE,value:t},{type:v.ActiveStatus,title:f.STATUS,value:String(!o)},{title:f.NAME,value:n},{title:f.NOTES,value:i},{title:f.MANAGED_BY_PROFILE,value:a},{type:v.Divider}];if(r){const e=Object.entries(r).filter(([e,t])=>t).map(([e,t])=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(l){const e=Object.entries(l).filter(([e,t])=>t).map(([e,t])=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(s){const e=(s[Ft.HeaderKeys]||[]).filter(e=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(c){const e=(c[_t.Java]||[]).map(e=>new Pt(e.className,e.methodName)).map(e=>`• ${e.toString()}`).join("\r\n");e&&d.push({title:f.JAVA_CUSTOM_PROBES,value:e});const t=(c[_t.Golang]||[]).map(e=>new zt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)).map(e=>`• ${e.toString()}`).join("\r\n");t&&d.push({title:f.GOLANG_CUSTOM_PROBES,value:t})}return d},lr=h.div`
331
331
  display: flex;
332
332
  flex-direction: column;
333
333
  gap: 12px;
@@ -337,7 +337,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
337
337
  border-radius: 16px;
338
338
  padding: 8px;
339
339
  `}
340
- `,Ho=[{id:Kt.FilePath,label:"Collect File Path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Kt.Function,label:"Collect Function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Kt.LineNumber,label:"Collect Line Number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],qo=[{id:Kt.Column,label:"Collect Column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Kt.Namespace,label:"Collect Namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Kt.StackTrace,label:"Collect Stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Go={[_t.Java]:[new Ft("","")],[_t.Golang]:[new Pt("")]},Jo=["*"],Yo=p.div`
340
+ `,sr=[{id:Kt.FilePath,label:"Collect File Path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Kt.Function,label:"Collect Function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Kt.LineNumber,label:"Collect Line Number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],cr=[{id:Kt.Column,label:"Collect Column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Kt.Namespace,label:"Collect Namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Kt.StackTrace,label:"Collect Stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],dr={[_t.Java]:[new Pt("","")],[_t.Golang]:[new zt("")]},ur=["*"],pr=h.div`
341
341
  display: flex;
342
342
  flex-direction: column;
343
343
  gap: 12px;
@@ -347,27 +347,27 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
347
347
  border-radius: 16px;
348
348
  padding: 8px;
349
349
  `}
350
- `,Xo=[{id:jt.HttpRequest,label:"Collect HTTP Request"},{id:jt.HttpResponse,label:"Collect HTTP Response"},{id:jt.DbQuery,label:"Collect DB Query"},{id:jt.Messaging,label:"Collect Messaging"}],Qo={[Vt.CodeAttributes]:({value:o,setValue:r,formErrors:s})=>{const l=s.codeAttributes,d=c(()=>Object.entries(o.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]),[u,p]=i(1===d.length);a(()=>{if(!d.length){const e={[Kt.Column]:null,[Kt.FilePath]:!0,[Kt.Function]:!0,[Kt.LineNumber]:!0,[Kt.Namespace]:null,[Kt.StackTrace]:null};r("codeAttributes",e),p(!1)}},[]);const m=(e,t)=>{const n=t?[...d,e]:d.filter(t=>t!==e),i=Object.values(Kt).reduce((e,t)=>(e[t]=!!n.includes(t)||null,e),{});r("codeAttributes",i),p(1===n.length)};return e(n,{children:[e("div",{children:[t(S,{title:"Recommended data to collect",required:!0}),t(Wo,{$hasError:!!l,children:Ho.map(({id:e,label:n,tooltip:i})=>t(fe,{text:i,withIcon:!0,children:t(x,{title:n,disabled:u&&d.includes(e),value:d.includes(e),onChange:t=>m(e,t)})},e))}),!!l&&t(C,{children:l})]}),e("div",{children:[t(S,{title:"Verbose data to collect",required:!0}),t(Wo,{$hasError:!!l,children:qo.map(({id:e,label:n,tooltip:i})=>t(fe,{text:i,withIcon:!0,children:t(x,{title:n,disabled:u&&d.includes(e),value:d.includes(e),onChange:t=>m(e,t)})},e))}),!!l&&t(C,{children:l})]})]})},[Vt.CustomInstrumentation]:({value:n,setValue:i,formErrors:o})=>{const r=o.customInstrumentations,s=c(()=>(n?.customInstrumentations?.[_t.Java]||[]).map(e=>({key:e.className,value:e.methodName})),[n]),l=c(()=>(n?.customInstrumentations?.[_t.Golang]||[]).map(e=>new Pt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[n]),d=(e,t)=>{const n={};switch(t){case"java":n[_t.Java]=e.map(e=>new Ft(e.className,e.methodName)),n[_t.Golang]=l.map(e=>new Pt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName));break;case"golang":n[_t.Golang]=e.map(e=>new Pt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),n[_t.Java]=s.map(({key:e,value:t})=>new Ft(e,t))}i("customInstrumentations",n)};return a(()=>{n?.customInstrumentations||i("customInstrumentations",{[_t.Golang]:Go[_t.Golang],[_t.Java]:Go[_t.Java]})},[i,n]),e("div",{children:[t(T,{title:"Golang Custom Probes",columns:[{title:"",keyName:"packageName",placeholder:"Package name",required:!0,tooltip:"The full import path of the package containing the function or method to be instrumented."},{title:"",keyName:"functionName",placeholder:"Function name",required:!1,tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{title:"",keyName:"receiverName",placeholder:"Receiver name",required:!1,tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{title:"",keyName:"receiverMethodName",placeholder:"Receiver method name",required:!1,tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],value:l,onChange:e=>d(e,"golang"),errorMessage:r,limitFieldsPerRow:2}),t($,{title:"Java Custom Probes",tooltip:"Specify class name and method name pair to instrument.",value:s,onChange:(e=[])=>d(e.map(({key:e,value:t})=>({className:e,methodName:t})),"java"),errorMessage:r,keyPlaceholder:"Class name",valuePlaceholder:"Method name"})]})},[Vt.HeadersCollection]:({value:e,setValue:n,formErrors:i})=>{const o=i.headersCollection,r=c(()=>e?.headersCollection?.[Mt.HeaderKeys]||[],[e]),s=e=>{const t={[Mt.HeaderKeys]:e};n("headersCollection",t)};return a(()=>{r.length||s(Jo)},[r]),t("div",{children:r.length>0&&t(D,{title:"Header Keys",tooltip:"Specify which headers you want to collect, asterisk (*) will collect all headers.",value:r,onChange:e=>s(e),errorMessage:o})})},[Vt.PayloadCollection]:({value:n,setValue:o,formErrors:r})=>{const s=r.payloadCollection,l=c(()=>Object.entries(n.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[n]),[d,u]=i(1===l.length);a(()=>{if(!l.length){const e={[jt.HttpRequest]:{},[jt.HttpResponse]:{},[jt.DbQuery]:{},[jt.Messaging]:{}};o("payloadCollection",e),u(!1)}},[]);return e("div",{children:[t(S,{title:"Type of data to collect",required:!0}),t(Yo,{$hasError:!!s,children:Xo.map(({id:e,label:n})=>t(x,{title:n,disabled:d&&l.includes(e),value:l.includes(e),onChange:t=>((e,t)=>{const n=t?[...l,e]:l.filter(t=>t!==e),i={[jt.HttpRequest]:n.includes(jt.HttpRequest)?{}:null,[jt.HttpResponse]:n.includes(jt.HttpResponse)?{}:null,[jt.DbQuery]:n.includes(jt.DbQuery)?{}:null,[jt.Messaging]:n.includes(jt.Messaging)?{}:null};o("payloadCollection",i),u(1===n.length)})(e,t)},e))}),!!s&&t(C,{children:s})]})},[Vt.UnknownType]:null},Zo=({ruleType:e,value:n,setValue:i,formErrors:a})=>{if(!e)return null;const o=Qo[e];return o?t(o,{value:n,setValue:i,formErrors:a}):null},er=p.div`
350
+ `,hr=[{id:jt.HttpRequest,label:"Collect HTTP Request"},{id:jt.HttpResponse,label:"Collect HTTP Response"},{id:jt.DbQuery,label:"Collect DB Query"},{id:jt.Messaging,label:"Collect Messaging"}],mr={[Bt.CodeAttributes]:({value:a,setValue:r,formErrors:l})=>{const s=l.codeAttributes,d=c(()=>Object.entries(a.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[a]),[u,p]=i(1===d.length);o(()=>{if(!d.length){const e={[Kt.Column]:null,[Kt.FilePath]:!0,[Kt.Function]:!0,[Kt.LineNumber]:!0,[Kt.Namespace]:null,[Kt.StackTrace]:null};r("codeAttributes",e),p(!1)}},[]);const h=(e,t)=>{const n=t?[...d,e]:d.filter(t=>t!==e),i=Object.values(Kt).reduce((e,t)=>(e[t]=!!n.includes(t)||null,e),{});r("codeAttributes",i),p(1===n.length)};return e(n,{children:[e("div",{children:[t(S,{title:"Recommended data to collect",required:!0}),t(lr,{$hasError:!!s,children:sr.map(({id:e,label:n,tooltip:i})=>t(be,{text:i,withIcon:!0,children:t(C,{title:n,disabled:u&&d.includes(e),value:d.includes(e),onChange:t=>h(e,t)})},e))}),!!s&&t(w,{children:s})]}),e("div",{children:[t(S,{title:"Verbose data to collect",required:!0}),t(lr,{$hasError:!!s,children:cr.map(({id:e,label:n,tooltip:i})=>t(be,{text:i,withIcon:!0,children:t(C,{title:n,disabled:u&&d.includes(e),value:d.includes(e),onChange:t=>h(e,t)})},e))}),!!s&&t(w,{children:s})]})]})},[Bt.CustomInstrumentation]:({value:n,setValue:i,formErrors:a})=>{const r=a.customInstrumentations,l=c(()=>(n?.customInstrumentations?.[_t.Java]||[]).map(e=>({key:e.className,value:e.methodName})),[n]),s=c(()=>(n?.customInstrumentations?.[_t.Golang]||[]).map(e=>new zt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[n]),d=(e,t)=>{const n={};switch(t){case"java":n[_t.Java]=e.map(e=>new Pt(e.className,e.methodName)),n[_t.Golang]=s.map(e=>new zt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName));break;case"golang":n[_t.Golang]=e.map(e=>new zt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),n[_t.Java]=l.map(({key:e,value:t})=>new Pt(e,t))}i("customInstrumentations",n)};return o(()=>{n?.customInstrumentations||i("customInstrumentations",{[_t.Golang]:dr[_t.Golang],[_t.Java]:dr[_t.Java]})},[i,n]),e("div",{children:[t(T,{title:"Golang Custom Probes",columns:[{title:"",keyName:"packageName",placeholder:"Package name",required:!0,tooltip:"The full import path of the package containing the function or method to be instrumented."},{title:"",keyName:"functionName",placeholder:"Function name",required:!1,tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{title:"",keyName:"receiverName",placeholder:"Receiver name",required:!1,tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{title:"",keyName:"receiverMethodName",placeholder:"Receiver method name",required:!1,tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],value:s,onChange:e=>d(e,"golang"),errorMessage:r,limitFieldsPerRow:2}),t(D,{title:"Java Custom Probes",tooltip:"Specify class name and method name pair to instrument.",value:l,onChange:(e=[])=>d(e.map(({key:e,value:t})=>({className:e,methodName:t})),"java"),errorMessage:r,keyPlaceholder:"Class name",valuePlaceholder:"Method name"})]})},[Bt.HeadersCollection]:({value:e,setValue:n,formErrors:i})=>{const a=i.headersCollection,r=c(()=>e?.headersCollection?.[Ft.HeaderKeys]||[],[e]),l=e=>{const t={[Ft.HeaderKeys]:e};n("headersCollection",t)};return o(()=>{r.length||l(ur)},[r]),t("div",{children:r.length>0&&t(A,{title:"Header Keys",tooltip:"Specify which headers you want to collect, asterisk (*) will collect all headers.",value:r,onChange:e=>l(e),errorMessage:a})})},[Bt.PayloadCollection]:({value:n,setValue:a,formErrors:r})=>{const l=r.payloadCollection,s=c(()=>Object.entries(n.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[n]),[d,u]=i(1===s.length);o(()=>{if(!s.length){const e={[jt.HttpRequest]:{},[jt.HttpResponse]:{},[jt.DbQuery]:{},[jt.Messaging]:{}};a("payloadCollection",e),u(!1)}},[]);return e("div",{children:[t(S,{title:"Type of data to collect",required:!0}),t(pr,{$hasError:!!l,children:hr.map(({id:e,label:n})=>t(C,{title:n,disabled:d&&s.includes(e),value:s.includes(e),onChange:t=>((e,t)=>{const n=t?[...s,e]:s.filter(t=>t!==e),i={[jt.HttpRequest]:n.includes(jt.HttpRequest)?{}:null,[jt.HttpResponse]:n.includes(jt.HttpResponse)?{}:null,[jt.DbQuery]:n.includes(jt.DbQuery)?{}:null,[jt.Messaging]:n.includes(jt.Messaging)?{}:null};a("payloadCollection",i),u(1===n.length)})(e,t)},e))}),!!l&&t(w,{children:l})]})},[Bt.UnknownType]:null},gr=({ruleType:e,value:n,setValue:i,formErrors:o})=>{if(!e)return null;const a=mr[e];return a?t(a,{value:n,setValue:i,formErrors:o}):null},fr=h.div`
351
351
  display: flex;
352
352
  flex-direction: column;
353
353
  gap: 24px;
354
354
  padding: 4px;
355
- `,tr=p(z)`
355
+ `,vr=h(W)`
356
356
  margin-bottom: 12px;
357
- `,nr=({isUpdate:i,rule:a,formData:o,formErrors:r,handleFormChange:s})=>{const l=h();return e(er,{children:[t(O,{children:a.supportedLanguages.map(e=>t(zt,{icon:Ut(e),type:de.Info,children:dt[e]},e))}),i?e("div",{children:[t(tr,{children:"Status"}),t(F,{options:[{icon:Fn,label:g.ENABLED,value:!1,selectedBgColor:l.text.success+_["050"]},{icon:_n,label:g.DISABLED,value:!0,selectedBgColor:l.text.error+_["050"]}],selected:o.disabled,setSelected:e=>s("disabled",e)})]}):e(n,{children:[t(P,{title:"",description:a.docsDescription,actionButton:t(K,{endpoint:a.docsEndpoint})}),t(E,{title:"Rule name",placeholder:"Use a name that describes the rule",value:o.ruleName,onChange:({target:{value:e}})=>s("ruleName",e),errorMessage:r.ruleName})]}),t(Zo,{ruleType:a.type,value:o,setValue:(e,t)=>s(e,t),formErrors:r}),t(V,{title:"Notes",value:o.notes,onChange:({target:{value:e}})=>s("notes",e),errorMessage:r.notes})]})},ir=p.div`
357
+ `,yr=({isUpdate:i,rule:o,formData:a,formErrors:r,handleFormChange:l})=>{const s=g();return e(fr,{children:[t(O,{children:o.supportedLanguages.map(e=>t(Wt,{icon:Vt(e),type:ue.Info,children:ut[e]},e))}),i?e("div",{children:[t(vr,{children:"Status"}),t(P,{options:[{icon:Yn,label:f.ENABLED,value:!1,selectedBgColor:s.text.success+_["050"]},{icon:Jn,label:f.DISABLED,value:!0,selectedBgColor:s.text.error+_["050"]}],selected:a.disabled,setSelected:e=>l("disabled",e)})]}):e(n,{children:[t(z,{title:"",description:o.docsDescription,actionButton:t(K,{endpoint:o.docsEndpoint})}),t(k,{title:"Rule name",placeholder:"Use a name that describes the rule",value:a.ruleName,onChange:({target:{value:e}})=>l("ruleName",e),errorMessage:r.ruleName})]}),t(gr,{ruleType:o.type,value:a,setValue:(e,t)=>l(e,t),formErrors:r}),t(B,{title:"Notes",value:a.notes,onChange:({target:{value:e}})=>l("notes",e),errorMessage:r.notes})]})},br=h.div`
358
358
  width: 100%;
359
359
  height: 100%;
360
360
  max-height: calc(100vh - 220px);
361
361
  overflow: overlay;
362
362
  overflow-y: auto;
363
- `,ar=p.div`
363
+ `,xr=h.div`
364
364
  display: flex;
365
365
  flex-direction: column;
366
366
  gap: 12px;
367
- `,or=({updateInstrumentationRule:n,deleteInstrumentationRule:o})=>{const{instrumentationRules:r}=Y(),{addNotification:l}=Bt(),{drawerType:d,drawerEntityId:u}=U(),p=s(null),m=d===J.InstrumentationRule,[h,g]=i(!1),[y,v]=i(!1),{formData:f,formErrors:b,handleFormChange:S,resetFormData:x,validateForm:C,loadFormWithDrawerItem:E}=Wt(),N=c(()=>{if(u)return r?.find(e=>Q(e)===u)},[u,r]);if(a(()=>{m&&N?E(N):x()},[m,N]),!N)return null;const k=Ht.find(({type:e})=>e===N.type);return t(Ki,{ref:p,title:N.ruleName||N.type,icons:[Be(N.type)],isEdit:h,isFormDirty:y,onEdit:e=>{N.mutable||!e&&void 0!==e?g("boolean"!=typeof e||e):l({type:de.Warning,title:ue.FORBIDDEN,message:ue.CANNOT_EDIT_RULE,crdType:J.InstrumentationRule,target:u,hideFromHistory:!0})},onSave:e=>{if(C()){const t=e!==N.type?e:"";S("ruleName",t),n(u,{...f,ruleName:t}),g(!1),v(!1)}},onDelete:()=>{N.mutable?(o(u),g(!1),v(!1),p.current?.closeDrawer()):l({type:de.Warning,title:ue.FORBIDDEN,message:ue.CANNOT_DELETE_RULE,crdType:J.InstrumentationRule,target:u,hideFromHistory:!0})},onCancel:()=>{g(!1),v(!1),E(N)},children:h&&k?t(ir,{children:t(nr,{isUpdate:!0,rule:k,formData:f,formErrors:b,handleFormChange:(...e)=>{v(!0),S(...e)}})}):e(ar,{children:[t(ee,{conditions:N.conditions||[]}),t(te,{title:"Instrumentation Rule Details",data:N?Bo(N):[]})]})})},rr=p(I)`
367
+ `,Sr=({updateInstrumentationRule:n,deleteInstrumentationRule:a})=>{const{instrumentationRules:r}=X(),{addNotification:s}=Ut(),{drawerType:d,drawerEntityId:u}=V(),p=l(null),h=d===J.InstrumentationRule,[m,g]=i(!1),[f,v]=i(!1),{formData:y,formErrors:b,handleFormChange:x,resetFormData:S,validateForm:C,loadFormWithDrawerItem:w}=Ht(),k=c(()=>{if(u)return r?.find(e=>Z(e)===u)},[u,r]);if(o(()=>{h&&k?w(k):S()},[h,k]),!k)return null;const $=qt.find(({type:e})=>e===k.type);return t(to,{ref:p,title:k.ruleName||k.type,icons:[Ue(k.type)],isEdit:m,isFormDirty:f,onEdit:e=>{k.mutable||!e&&void 0!==e?g("boolean"!=typeof e||e):s({type:ue.Warning,title:pe.FORBIDDEN,message:pe.CANNOT_EDIT_RULE,crdType:J.InstrumentationRule,target:u,hideFromHistory:!0})},onSave:e=>{if(C()){const t=e!==k.type?e:"";x("ruleName",t),n(u,{...y,ruleName:t}),g(!1),v(!1)}},onDelete:()=>{k.mutable?(a(u),g(!1),v(!1),p.current?.closeDrawer()):s({type:ue.Warning,title:pe.FORBIDDEN,message:pe.CANNOT_DELETE_RULE,crdType:J.InstrumentationRule,target:u,hideFromHistory:!0})},onCancel:()=>{g(!1),v(!1),w(k)},children:m&&$?t(br,{children:t(yr,{isUpdate:!0,rule:$,formData:y,formErrors:b,handleFormChange:(...e)=>{v(!0),x(...e)}})}):e(xr,{children:[t(te,{conditions:k.conditions||[]}),t(ne,{title:"Instrumentation Rule Details",data:k?rr(k):[]})]})})},Cr=h(R)`
368
368
  margin-top: 24px;
369
369
  gap: 12px;
370
- `,sr=Ht,lr=({createInstrumentationRule:n})=>{const{tier:a}=ae(),o=a===qt.Onprem,{currentModal:r,setCurrentModal:s}=oe(),l=r===J.InstrumentationRule,{formData:c,formErrors:d,handleFormChange:u,resetFormData:p,validateForm:m}=Wt(),[h,y]=i(void 0),v=()=>{p(),y(void 0),s("")},f=()=>{if(!m())return null;n(c),v()};return B({key:"Enter",active:l},()=>f()),t(se,{isOpen:l,onClose:v,header:{title:"Add Instrumentation Rule"},actionComponent:t(me,{buttons:[{variant:"primary",label:"DONE",onClick:f,disabled:!o||!h,tooltip:o?"":ue.ENTERPRISE_ONLY("Instrumentation Rules")}]}),children:e(le,{children:[t(P,{title:"Select Instrumentation Rule",description:"Define how telemetry is recorded from your application. Choose a rule type and configure the details."}),e(rr,{children:[t(ce,o?{type:de.Warning,message:ue.DEFINED_FOR_ALL_STREAMS(g.INSTRUMENTATION_RULES)}:{type:de.Default,message:ue.ENTERPRISE_ONLY(g.INSTRUMENTATION_RULES)}),t(pe,{options:sr,selectedOption:h,onOptionSelect:e=>{return t=e,p(),void y(t);var t},autoFocus:!h?.type})]}),h?.type?e("div",{children:[t(A,{margin:"16px 0"}),t(nr,{rule:h,formData:c,formErrors:d,handleFormChange:u})]}):null]})})},cr=e=>{const{payloadCollection:t,codeAttributes:n,customInstrumentations:i}=e;let a="";return t&&(a+=Object.entries(t).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),n&&(a+=Object.entries(n).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),i&&Object.values(_t).forEach(e=>{const t=(i[e]||[]).filter(e=>e).join(", ");t&&(a+=a?`, ${t}`:t)}),a},dr=[{key:"icon",title:""},{key:"name",title:g.NAME,sortable:!0},{key:"profile",title:g.MANAGED_BY_PROFILE,sortable:!0},{key:"active-status",title:g.STATUS},{key:"conditions",title:"Conditions"},{key:"source-count",title:"Applicable Source"},{key:"type",title:g.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:g.NOTES,sortable:!0}],ur=({maxHeight:n,maxWidth:i})=>{const a=h(),o=Se(),{setDrawerType:r,setDrawerEntityId:s}=U(),{instrumentationRules:l,instrumentationRulesLoading:d}=Y(),u=c(()=>Ji({instrumentationRules:l,sources:[],actions:[],destinations:[],searchText:o.searchText,selectedCategory:J.InstrumentationRule}).searchResults.find(({category:e})=>e===J.InstrumentationRule)?.entities||[],[l,o]),p=c(()=>u.map(e=>{const{hasErrors:n,hasWarnings:i,hasDisableds:o}=he(e.conditions||[]);return{status:n?de.Error:i?de.Warning:void 0,faded:o,onClick:()=>{r(J.InstrumentationRule),s(e.ruleId)},cells:[{columnKey:"icon",component:()=>t(Ce,{icon:Be(e.type)})},{columnKey:"name",value:Ee(e,J.InstrumentationRule,{prioritizeDisplayName:!0})},{columnKey:"type",value:e.type,textColor:a.text.info},{columnKey:"profile",value:e.profileName,textColor:a.text.info},{columnKey:"notes",value:e.notes,textColor:a.text.info,withTooltip:!0},{columnKey:"spec",value:cr(e),textColor:a.text.info,withTooltip:!0},{columnKey:"conditions",component:()=>t(qi,{conditions:e.conditions||[],id:e.ruleId})},{columnKey:"active-status",component:()=>t("div",{style:{lineHeight:1},children:t(ge,{status:e.disabled?de.Error:de.Success,title:e.disabled?g.DISABLED:g.ENABLED,withIcon:!0,withBorder:!0})})},{columnKey:"source-count",component:()=>t("div",{style:{lineHeight:1},children:t(ge,{status:de.Info,title:"all sources",withBorder:!0})})}]}}),[u]),{badge:m,badgeTooltip:y}=c(()=>u.length!==l.length?{badge:`${u.length}/${l.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:l.length,badgeTooltip:void 0},[u,l]);return e(ke,{$maxWidth:i,children:[t(Te,{children:t(we,{icon:$e(J.Action),title:g.INSTRUMENTATION_RULES,badge:m,badgeTooltip:y,loading:d})}),t(De,{$maxHeight:n,children:t(Ae,{columns:dr,rows:p})}),!u.length&&t(Ie,{style:{marginTop:"2rem"},children:t(Oe,{})})]})},pr=p.div`
370
+ `,wr=qt,kr=({createInstrumentationRule:n})=>{const{tier:o}=ae(),a=o===Gt.Onprem,{currentModal:r,setCurrentModal:l}=re(),s=r===J.InstrumentationRule,{formData:c,formErrors:d,handleFormChange:u,resetFormData:p,validateForm:h}=Ht(),[m,g]=i(void 0),v=()=>{p(),g(void 0),l("")},y=()=>{if(!h())return null;n(c),v()};return U({key:"Enter",active:s},()=>y()),t(se,{isOpen:s,onClose:v,header:{title:"Add Instrumentation Rule"},actionComponent:t(me,{buttons:[{variant:"primary",label:"DONE",onClick:y,disabled:!a||!m,tooltip:a?"":pe.ENTERPRISE_ONLY("Instrumentation Rules")}]}),children:e(ce,{children:[t(z,{title:"Select Instrumentation Rule",description:"Define how telemetry is recorded from your application. Choose a rule type and configure the details."}),e(Cr,{children:[t(de,a?{type:ue.Warning,message:pe.DEFINED_FOR_ALL_STREAMS(f.INSTRUMENTATION_RULES)}:{type:ue.Default,message:pe.ENTERPRISE_ONLY(f.INSTRUMENTATION_RULES)}),t(he,{options:wr,selectedOption:m,onOptionSelect:e=>{return t=e,p(),void g(t);var t},autoFocus:!m?.type})]}),m?.type?e("div",{children:[t(I,{margin:"16px 0"}),t(yr,{rule:m,formData:c,formErrors:d,handleFormChange:u})]}):null]})})},$r=e=>{const{payloadCollection:t,codeAttributes:n,customInstrumentations:i}=e;let o="";return t&&(o+=Object.entries(t).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),n&&(o+=Object.entries(n).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),i&&Object.values(_t).forEach(e=>{const t=(i[e]||[]).filter(e=>e).join(", ");t&&(o+=o?`, ${t}`:t)}),o},Er=[{key:"icon",title:""},{key:"name",title:f.NAME,sortable:!0},{key:"profile",title:f.MANAGED_BY_PROFILE,sortable:!0},{key:"active-status",title:f.STATUS},{key:"conditions",title:"Conditions"},{key:"source-count",title:"Applicable Source"},{key:"type",title:f.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:f.NOTES,sortable:!0}],Tr=({maxHeight:n,maxWidth:i})=>{const o=g(),a=Se(),{setDrawerType:r,setDrawerEntityId:l}=V(),{instrumentationRules:s,instrumentationRulesLoading:d}=X(),u=c(()=>po({instrumentationRules:s,sources:[],actions:[],destinations:[],searchText:a.searchText,selectedCategory:J.InstrumentationRule}).searchResults.find(({category:e})=>e===J.InstrumentationRule)?.entities||[],[s,a]),p=c(()=>u.map(e=>{const{hasErrors:n,hasWarnings:i,hasDisableds:a}=ge(e.conditions||[]);return{status:n?ue.Error:i?ue.Warning:void 0,faded:a,onClick:()=>{r(J.InstrumentationRule),l(e.ruleId)},cells:[{columnKey:"icon",component:()=>t(we,{icon:Ue(e.type)})},{columnKey:"name",value:ke(e,J.InstrumentationRule,{prioritizeDisplayName:!0})},{columnKey:"type",value:e.type,textColor:o.text.info},{columnKey:"profile",value:e.profileName,textColor:o.text.info},{columnKey:"notes",value:e.notes,textColor:o.text.info,withTooltip:!0},{columnKey:"spec",value:$r(e),textColor:o.text.info,withTooltip:!0},{columnKey:"conditions",component:()=>t(co,{conditions:e.conditions||[],id:e.ruleId})},{columnKey:"active-status",component:()=>t("div",{style:{lineHeight:1},children:t(fe,{status:e.disabled?ue.Error:ue.Success,title:e.disabled?f.DISABLED:f.ENABLED,withIcon:!0,withBorder:!0})})},{columnKey:"source-count",component:()=>t("div",{style:{lineHeight:1},children:t(fe,{status:ue.Info,title:"all sources",withBorder:!0})})}]}}),[u]),{badge:h,badgeTooltip:m}=c(()=>u.length!==s.length?{badge:`${u.length}/${s.length}`,badgeTooltip:f.FILTERED_COUNT_TOOLTIP}:{badge:s.length,badgeTooltip:void 0},[u,s]);return e(Ee,{$maxWidth:i,children:[t(Te,{children:t(Ne,{icon:De(J.Action),title:f.INSTRUMENTATION_RULES,badge:h,badgeTooltip:m,loading:d})}),t(Ae,{$maxHeight:n,children:t(Ie,{columns:Er,rows:p})}),!u.length&&t(Re,{style:{marginTop:"2rem"},children:t(Oe,{})})]})},Nr=h.div`
371
371
  position: fixed;
372
372
  bottom: 0;
373
373
  left: 50%;
@@ -381,17 +381,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
381
381
  border: 1px solid ${({theme:e})=>e.colors.border};
382
382
  background-color: ${({theme:e})=>e.colors.dropdown_bg};
383
383
  animation-name: ${Jt.in.center};
384
- `,mr=({totalSourceCount:n,uninstrumentSources:a,restartWorkloads:r})=>{const s=h(),{selectedSources:l,setSelectedSources:d}=Pe(),[u,p]=i(!1),[m,g]=i(!1),y=c(()=>{let e=0;return Object.values(l).forEach(t=>{e+=t.length}),e},[l]),v=()=>{d({})};return y?e(o,{children:[e(pr,{"data-id":"multi-source-control",children:[t(z,{children:"Selected sources"}),t(Le,{label:y,filled:!0}),t(A,{orientation:"vertical",length:"16px"}),t(_e,{variant:"tertiary",onClick:v,children:t(z,{family:"secondary",decoration:"underline",children:"Deselect"})}),e(_e,{variant:"tertiary",onClick:()=>g(!0),children:[t(Gn,{}),t(z,{family:"secondary",decoration:"underline",children:"Restart"})]}),e(_e,{variant:"tertiary",onClick:()=>p(!0),children:[t(Mn,{}),t(z,{family:"secondary",decoration:"underline",color:s.text.error,children:"Uninstrument"})]})]}),t(q,{isOpen:u,name:`${y} sources`,type:J.Source,isLastItem:y===n,onApprove:()=>{const e={};Object.entries(l).forEach(([t,n])=>{e[t]=n.map(e=>({...e,selected:!1}))}),a(e),p(!1),v()},onDeny:()=>p(!1)}),t(Gt,{isOpen:m,title:"Rollout Restart Workloads",description:"Are you sure you want to rollout restart these workloads?",approveButton:{text:"Confirm",variant:de.Warning,onClick:()=>{const e=[];Object.values(l).forEach(t=>{e.push(...t.map(e=>Yt(e)))}),r(e),v()}},denyButton:{text:"Go Back",onClick:()=>g(!1)}})]}):null},hr=p.div`
384
+ `,Dr=({totalSourceCount:n,uninstrumentSources:o,restartWorkloads:r})=>{const l=g(),{selectedSources:s,setSelectedSources:d}=ze(),[u,p]=i(!1),[h,m]=i(!1),f=c(()=>{let e=0;return Object.values(s).forEach(t=>{e+=t.length}),e},[s]),v=()=>{d({})};return f?e(a,{children:[e(Nr,{"data-id":"multi-source-control",children:[t(W,{children:"Selected sources"}),t(Le,{label:f,filled:!0}),t(I,{orientation:"vertical",length:"16px"}),t(_e,{variant:"tertiary",onClick:v,children:t(W,{family:"secondary",decoration:"underline",children:"Deselect"})}),e(_e,{variant:"tertiary",onClick:()=>m(!0),children:[t(li,{}),t(W,{family:"secondary",decoration:"underline",children:"Restart"})]}),e(_e,{variant:"tertiary",onClick:()=>p(!0),children:[t(Gn,{}),t(W,{family:"secondary",decoration:"underline",color:l.text.error,children:"Uninstrument"})]})]}),t(G,{isOpen:u,name:`${f} sources`,type:J.Source,isLastItem:f===n,onApprove:()=>{const e={};Object.entries(s).forEach(([t,n])=>{e[t]=n.map(e=>({...e,selected:!1}))}),o(e),p(!1),v()},onDeny:()=>p(!1)}),t(Yt,{isOpen:h,title:"Rollout Restart Workloads",description:"Are you sure you want to rollout restart these workloads?",approveButton:{text:"Confirm",variant:ue.Warning,onClick:()=>{const e=[];Object.values(s).forEach(t=>{e.push(...t.map(e=>Xt(e)))}),r(e),v()}},denyButton:{text:"Go Back",onClick:()=>m(!1)}})]}):null},Ar=h.div`
385
385
  position: relative;
386
386
  width: fit-content;
387
- `,gr=p(O)`
387
+ `,Ir=h(O)`
388
388
  gap: 12px;
389
389
  padding: 0 12px;
390
- `,yr=p(I)`
390
+ `,Rr=h(R)`
391
391
  gap: 12px;
392
392
  max-height: 400px;
393
393
  overflow-y: auto;
394
- `,vr=p.div`
394
+ `,Or=h.div`
395
395
  position: absolute;
396
396
  bottom: 0;
397
397
  left: 0;
@@ -400,13 +400,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
400
400
  border-radius: 0 0 24px 24px;
401
401
  background: ${({theme:e})=>`linear-gradient(to top, ${e.colors.dropdown_bg}, transparent)`};
402
402
  pointer-events: none;
403
- `,fr=p(z)`
403
+ `,Mr=h(W)`
404
404
  background-color: ${({theme:e})=>e.colors.orange_soft};
405
405
  color: ${({theme:e})=>e.text.primary};
406
406
  border-radius: 32px;
407
407
  width: fit-content;
408
408
  padding: 2px 8px;
409
- `,br=()=>{const n=h(),{notifications:i,markAsSeen:a}=Bt(),o=i.filter(({hideFromHistory:e})=>!e),r=o.filter(({seen:e})=>!e),s=r.length,{popupRef:l,popupOpen:c,setPopupOpen:d,popupPosition:u,handlePosition:p}=it({defaultClientHeight:420,defaultClientwidth:400,onClickOutside:()=>{s&&r.forEach(({id:e})=>a(e))}});return e(hr,{children:[t(R,{onClick:()=>{p(0,0),d(e=>!e)},tooltip:"Notifications",withPing:!!s,pingColor:n.colors.orange_og,children:t(Jn,{size:18})}),e(at,{ref:l,isOpen:c,right:u.left,maxWidth:"400px",header:e(gr,{children:[t(z,{size:20,children:"Notifications"}),!!s&&e(fr,{size:12,family:"secondary",children:[s," new"]})]}),children:[t(yr,{children:o.length?o.map(e=>t(kr,{...e,onClick:()=>d(!1)},`notification-${e.id}`)):t(Oe,{title:"No notifications",subTitle:""})}),t(vr,{})]})]})},Sr=p.div`
409
+ `,Lr=()=>{const n=g(),{notifications:i,markAsSeen:o}=Ut(),a=i.filter(({hideFromHistory:e})=>!e),r=a.filter(({seen:e})=>!e),l=r.length,{popupRef:s,popupOpen:c,setPopupOpen:d,popupPosition:u,handlePosition:p}=ot({defaultClientHeight:420,defaultClientwidth:400,onClickOutside:()=>{l&&r.forEach(({id:e})=>o(e))}});return e(Ar,{children:[t(M,{onClick:()=>{p(0,0),d(e=>!e)},tooltip:"Notifications",withPing:!!l,pingColor:n.colors.orange_og,children:t(si,{size:18})}),e(at,{ref:s,isOpen:c,right:u.left,maxWidth:"400px",header:e(Ir,{children:[t(W,{size:20,children:"Notifications"}),!!l&&e(Mr,{size:12,family:"secondary",children:[l," new"]})]}),children:[t(Rr,{children:a.length?a.map(e=>t(jr,{...e,onClick:()=>d(!1)},`notification-${e.id}`)):t(Oe,{title:"No notifications",subTitle:""})}),t(Or,{})]})]})},Fr=h.div`
410
410
  display: flex;
411
411
  align-items: flex-start;
412
412
  gap: 12px;
@@ -420,7 +420,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
420
420
  background-color: ${({theme:e})=>e.colors.dropdown_bg_2};
421
421
  }
422
422
  }
423
- `,xr=p.div`
423
+ `,Pr=h.div`
424
424
  background-color: ${({$type:e,theme:t})=>t.text[e]+_["015"]};
425
425
  border-radius: 8px;
426
426
  width: 36px;
@@ -428,22 +428,22 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
428
428
  display: flex;
429
429
  align-items: center;
430
430
  justify-content: center;
431
- `,Cr=p.div`
431
+ `,_r=h.div`
432
432
  width: 290px;
433
- `,Er=p.div`
433
+ `,zr=h.div`
434
434
  margin-bottom: 6px;
435
- `,Nr=p.div`
435
+ `,Kr=h.div`
436
436
  display: flex;
437
437
  align-items: center;
438
438
  gap: 6px;
439
- `,kr=({id:i,seen:a,type:o,title:r,message:s,time:l,crdType:c,target:d,onClick:u})=>{const p=h(),{formatTimeAgo:m}=Xt(),{onClickNotification:g}=Qt(),y=!!c&&!!d,v=r?.toLowerCase().includes(ie.Delete.toLowerCase())||!1,f=be(o,p);return e(Sr,{className:y?"click-enabled":"",onClick:()=>{y&&(u(),g({id:i,crdType:c,target:d}))},children:[t(xr,{$type:v?de.Error:o,children:t(v?Mn:f,{})}),e(Cr,{children:[t(Er,{children:t(z,{size:14,children:s})}),e(Nr,{children:[t(z,{size:10,color:p.text.grey,children:m(l)}),!a&&e(n,{children:[t(z,{size:10,children:"·"}),t(z,{size:10,color:p.colors.orange_soft,children:"new"})]})]})]})]},`notification-${i}`)},Tr=e=>`${J.Source}-${e}-${Zt.MapItem}`,wr=(e,t,n)=>{const i=e.isVirtual,a=n?[Yn]:i?[en(e)]:t?He(t):[Xn],{priorotizedStatus:o}=i?{priorotizedStatus:void 0}:he(t?.conditions||[]);return{id:e.graphKey,title:e.serviceName,icons:a,isVirtual:i,status:o,aggService:e}},$r=e=>!(!e||"user"!==e.otelServiceName||e.namespace||e.name||e.kind),Dr=({theme:e,nodes:t,aggregatedServiceMap:n})=>{const i=[],a=new Map(t.map(e=>[e.id,e]));for(const t of n){const n=Tr(t.graphKey),o=a.get(n);if(!o)continue;const r=o.data?.status===de.Error;for(const o of t.connections){const s=Tr(o.targetGraphKey);a.has(s)&&i.push({id:`${n}-to-${s}`,type:"smoothstep",source:n,target:s,data:{sourceGraphKey:t.graphKey,targetGraphKey:o.targetGraphKey},markerEnd:{type:di.ArrowClosed},style:{stroke:r?e?.colors.dark_red:e?.colors.border}})}}return i},Ar=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},Ir=new mi,Or=`${J.Source}-user-${Zt.MapItem}`,Rr={"elk.algorithm":"layered","elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"150","elk.spacing.nodeNode":"120","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.spacing.edgeEdgeBetweenLayers":"30","elk.layered.spacing.edgeNodeBetweenLayers":"40"},Lr=p.div`
439
+ `,jr=({id:i,seen:o,type:a,title:r,message:l,time:s,crdType:c,target:d,onClick:u})=>{const p=g(),{formatTimeAgo:h}=Qt(),{onClickNotification:m}=Zt(),f=!!c&&!!d,v=r?.toLowerCase().includes(oe.Delete.toLowerCase())||!1,y=xe(a,p);return e(Fr,{className:f?"click-enabled":"",onClick:()=>{f&&(u(),m({id:i,crdType:c,target:d}))},children:[t(Pr,{$type:v?ue.Error:a,children:t(v?Gn:y,{})}),e(_r,{children:[t(zr,{children:t(W,{size:14,children:l})}),e(Kr,{children:[t(W,{size:10,color:p.text.grey,children:h(s)}),!o&&e(n,{children:[t(W,{size:10,children:"·"}),t(W,{size:10,color:p.colors.orange_soft,children:"new"})]})]})]})]},`notification-${i}`)},Br=e=>`${J.Source}-${e}-${en.MapItem}`,Wr=(e,t,n)=>{const i=e.isVirtual,o=n?[ci]:i?[tn(e)]:t?qe(t):[di],{priorotizedStatus:a}=i?{priorotizedStatus:void 0}:ge(t?.conditions||[]);return{id:e.graphKey,title:e.serviceName,icons:o,isVirtual:i,status:a,aggService:e}},Vr=e=>!(!e||"user"!==e.otelServiceName||e.namespace||e.name||e.kind),Ur=({theme:e,nodes:t,aggregatedServiceMap:n})=>{const i=[],o=new Map(t.map(e=>[e.id,e]));for(const t of n){const n=Br(t.graphKey),a=o.get(n);if(!a)continue;const r=a.data?.status===ue.Error;for(const a of t.connections){const l=Br(a.targetGraphKey);o.has(l)&&i.push({id:`${n}-to-${l}`,type:"smoothstep",source:n,target:l,data:{sourceGraphKey:t.graphKey,targetGraphKey:a.targetGraphKey},markerEnd:{type:Ei.ArrowClosed},style:{stroke:r?e?.colors.dark_red:e?.colors.border}})}}return i},Hr=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},qr=new Di,Gr=`${J.Source}-user-${en.MapItem}`,Yr={"elk.algorithm":"layered","elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"150","elk.spacing.nodeNode":"120","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.spacing.edgeEdgeBetweenLayers":"30","elk.layered.spacing.edgeNodeBetweenLayers":"40"},Jr=h.div`
440
440
  padding: 8px 0;
441
- `,Mr=p.div`
441
+ `,Xr=h.div`
442
442
  display: flex;
443
443
  gap: 12px;
444
444
  align-items: center;
445
445
  padding: 4px 0 4px 16px;
446
- `,Fr=p.button`
446
+ `,Qr=h.button`
447
447
  display: flex;
448
448
  align-items: center;
449
449
  gap: 4px;
@@ -457,18 +457,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
457
457
  &:hover {
458
458
  text-decoration: underline;
459
459
  }
460
- `,_r=p.div`
460
+ `,Zr=h.div`
461
461
  padding: 4px 0 8px;
462
- `,Pr=({conn:n,onToggle:i,isExpanded:a})=>{const o=n.details.length>0;return t(Lr,{children:e(O,{$justifyContent:"space-between",$alignItems:"center",children:[t(z,{size:14,weight:500,children:n.targetServiceName}),o&&e(Fr,{onClick:i,children:[t(a?Qn:Zn,{size:12}),a?"hide attributes":`${n.details.length} attribute${n.details.length>1?"s":""}`]})]})})},Kr=({conn:e})=>{const i=h();return t(n,{children:e.details.map(e=>t(Mr,{children:t(z,{size:12,color:i.text.secondary,style:{flex:1},children:e.value})},e.value))})},jr=({connections:a,isVirtual:o,attributes:r})=>{const[s,l]=i(new Set),c=h();if(o){const i=Object.entries(r||{});return e(n,{children:[t(z,{size:12,color:c.text.info,children:"This service is not instrumented. It was detected from client-side spans of services that communicate with it."}),i.length>0&&e(n,{children:[t(_r,{style:{paddingTop:16},children:t(z,{size:11,color:c.text.info,children:"Attributes"})}),i.map(([n,i])=>e(Mr,{children:[t(z,{size:12,color:c.text.secondary,children:n}),t(z,{size:12,children:i})]},n))]})]})}return a.length?e(n,{children:[t(_r,{children:t(z,{size:11,color:c.text.info,children:"Connected services"})}),a.map(n=>e("div",{children:[t(Pr,{conn:n,isExpanded:s.has(n.targetGraphKey),onToggle:()=>{return e=n.targetGraphKey,void l(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});var e}}),s.has(n.targetGraphKey)&&t(Kr,{conn:n}),t(A,{})]},n.targetGraphKey))]}):t(z,{size:12,color:c.text.info,children:"No outgoing connections"})},Vr=({conn:i})=>{const a=h();return i?t(n,{children:i.details.length>0?e(n,{children:[t(_r,{children:t(z,{size:11,color:a.text.info,children:"Attribute breakdown"})}),i.details.map(e=>t(Mr,{children:t(z,{size:12,style:{flex:1},children:e.value})},e.value))]}):t(z,{size:12,color:a.text.info,style:{padding:"8px 0"},children:"No attribute breakdown"})}):t(z,{size:12,color:a.text.info,children:"No data for this connection"})},zr=({drawerState:e,aggregatedData:n,onClose:i})=>{if(!e)return null;const a=new Map(n.map(e=>[e.graphKey,e]));let o="",r="",s=null;if("node"===e.type){const n=a.get(e.graphKey);o=n?.serviceName||e.graphKey,r=n?.isVirtual?"Virtual service (uninstrumented)":"Outgoing connections",s=t(jr,{connections:n?.connections||[],isVirtual:n?.isVirtual,attributes:n?.attributes})}else{const n=a.get(e.sourceKey),i=n?.connections.find(t=>t.targetGraphKey===e.targetKey);o=`${n?.serviceName||e.sourceKey} → ${i?.targetServiceName||e.targetKey}`,r="Connection details",s=t(Vr,{conn:i})}return t(tn,{isOpen:!0,width:"420px",position:"right",header:{title:o,subTitle:r,onClose:i},children:s})},Ur=p.div`
462
+ `,el=({conn:n,onToggle:i,isExpanded:o})=>{const a=n.details.length>0;return t(Jr,{children:e(O,{$justifyContent:"space-between",$alignItems:"center",children:[t(W,{size:14,weight:500,children:n.targetServiceName}),a&&e(Qr,{onClick:i,children:[t(o?ui:pi,{size:12}),o?"hide attributes":`${n.details.length} attribute${n.details.length>1?"s":""}`]})]})})},tl=({conn:e})=>{const i=g();return t(n,{children:e.details.map(e=>t(Xr,{children:t(W,{size:12,color:i.text.secondary,style:{flex:1},children:e.value})},e.value))})},nl=({connections:o,isVirtual:a,attributes:r})=>{const[l,s]=i(new Set),c=g();if(a){const i=Object.entries(r||{});return e(n,{children:[t(W,{size:12,color:c.text.info,children:"This service is not instrumented. It was detected from client-side spans of services that communicate with it."}),i.length>0&&e(n,{children:[t(Zr,{style:{paddingTop:16},children:t(W,{size:11,color:c.text.info,children:"Attributes"})}),i.map(([n,i])=>e(Xr,{children:[t(W,{size:12,color:c.text.secondary,children:n}),t(W,{size:12,children:i})]},n))]})]})}return o.length?e(n,{children:[t(Zr,{children:t(W,{size:11,color:c.text.info,children:"Connected services"})}),o.map(n=>e("div",{children:[t(el,{conn:n,isExpanded:l.has(n.targetGraphKey),onToggle:()=>{return e=n.targetGraphKey,void s(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});var e}}),l.has(n.targetGraphKey)&&t(tl,{conn:n}),t(I,{})]},n.targetGraphKey))]}):t(W,{size:12,color:c.text.info,children:"No outgoing connections"})},il=({conn:i})=>{const o=g();return i?t(n,{children:i.details.length>0?e(n,{children:[t(Zr,{children:t(W,{size:11,color:o.text.info,children:"Attribute breakdown"})}),i.details.map(e=>t(Xr,{children:t(W,{size:12,style:{flex:1},children:e.value})},e.value))]}):t(W,{size:12,color:o.text.info,style:{padding:"8px 0"},children:"No attribute breakdown"})}):t(W,{size:12,color:o.text.info,children:"No data for this connection"})},ol=({drawerState:e,aggregatedData:n,onClose:i})=>{if(!e)return null;const o=new Map(n.map(e=>[e.graphKey,e]));let a="",r="",l=null;if("node"===e.type){const n=o.get(e.graphKey);a=n?.serviceName||e.graphKey,r=n?.isVirtual?"Virtual service (uninstrumented)":"Outgoing connections",l=t(nl,{connections:n?.connections||[],isVirtual:n?.isVirtual,attributes:n?.attributes})}else{const n=o.get(e.sourceKey),i=n?.connections.find(t=>t.targetGraphKey===e.targetKey);a=`${n?.serviceName||e.sourceKey} → ${i?.targetServiceName||e.targetKey}`,r="Connection details",l=t(il,{conn:i})}return t(nn,{isOpen:!0,width:"420px",position:"right",header:{title:a,subTitle:r,onClose:i},children:l})},al=h.div`
463
463
  width: 100%;
464
464
  height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px)`};
465
465
  position: relative;
466
- `,Br={namespace:"",name:"",kind:"",otelServiceName:"user",selected:!0,numberOfInstances:0,dataStreamNames:[],containers:[],conditions:[]},Wr=`${J.Source}-`,Hr=`-${Zt.MapItem}`,qr=.15,Gr=({heightToRemove:n,serviceMap:o,onRefresh:r})=>{const l=h(),{sources:c}=Y(),[u,p,m]=ui([]),[y,v,f]=pi([]),[b,S]=i(0),[x,C]=i(null),E=s([]);E.current=u;const N=s(l);N.current=l;const k=s([]),T=s([]),w=d(()=>S(e=>e+1),[]),{activeNodeId:$,setActiveNodeType:D,setActiveNodeId:A}=nn();a(()=>{if(!$)return;const e=(t=$).startsWith(Wr)&&t.endsWith(Hr)?t.slice(Wr.length,-Hr.length):null;var t;e&&C({type:"node",graphKey:e})},[$]);const I=d((e,t)=>{const{sourceGraphKey:n,targetGraphKey:i}=t.data||{};n&&i&&(D(null),A(null),C({type:"edge",sourceKey:n,targetKey:i}))},[D,A]),O=d(()=>{C(null),D(null),A(null)},[D,A]),R=d((e,t)=>{const n=t.id;v(e=>e.map(e=>e.source===n||e.target===n?{...e,animated:!0,style:{...e.style,strokeWidth:2.5},labelStyle:{...e.labelStyle,opacity:1},labelBgStyle:{...e.labelBgStyle,opacity:1}}:{...e,style:{...e.style,opacity:qr},labelStyle:{...e.labelStyle,opacity:qr},labelBgStyle:{...e.labelBgStyle,opacity:qr}}))},[v]),L=d(()=>{v(T.current)},[v]);return a(()=>{let e=!1;const t=(e=>{const t=new Map,n=new Set,i=(e,n,i=!1)=>{let a=t.get(e);return a||(a={serviceName:n,isVirtual:i,attributes:{},connectionMap:new Map},t.set(e,a)),a},a=(e,t)=>{if(t)for(const{key:n,value:i}of t)n in e||(e[n]=i)};for(const t of e){const{graphKey:e}=Ar(t.nodeId),o=i(e,t.serviceName);o.isVirtual=!1;for(const e of t.services){const{graphKey:t,detail:r}=Ar(e.nodeId);e.isVirtual&&(n.add(t),a(i(t,e.serviceName,!0).attributes,e.nodeAttributes));let s=o.connectionMap.get(t);if(s||(s={targetGraphKey:t,targetServiceName:e.serviceName,totalRequests:0,lastDateTime:e.dateTime,details:[]},o.connectionMap.set(t,s)),s.totalRequests+=e.requests,e.dateTime>s.lastDateTime&&(s.lastDateTime=e.dateTime),r){const t=s.details.find(e=>e.value===r);t?(t.requests+=e.requests,e.dateTime>t.dateTime&&(t.dateTime=e.dateTime)):s.details.push({value:r,requests:e.requests,dateTime:e.dateTime})}}}const o=[...t.entries()];for(const[,{connectionMap:e}]of o)for(const[a,o]of e)t.has(a)||i(a,o.targetServiceName,n.has(a));const r=[];for(const[e,{serviceName:n,isVirtual:i,attributes:a,connectionMap:o}]of t){const t=[...o.values()];t.sort((e,t)=>e.targetGraphKey.localeCompare(t.targetGraphKey)),r.push({graphKey:e,serviceName:n,isVirtual:i,connections:t,attributes:a})}return r.sort((e,t)=>e.graphKey.localeCompare(t.graphKey)),r})(o);k.current=t;const n=(({sources:e,aggregatedServiceMap:t})=>{const n=[],i={x:0,y:0};if(t.length&&e.length)for(const a of t){const t=Tr(a.graphKey),o=e.find(e=>a.serviceName===e.otelServiceName||a.serviceName===e.name);n.push({id:t,type:Zt.MapItem,position:i,data:wr(a,o,$r(o)),measured:{width:80,height:80}})}else n.push({id:`${J.Source}-${Zt.NoData}`,type:Zt.NoData,position:i,data:{subTitle:g.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return n})({aggregatedServiceMap:t,sources:[Br].concat(c)});if(1===n.length&&n[0].id===`${J.Source}-${Zt.NoData}`)return p(n),v([]),void(T.current=[]);const i=new Set(E.current.map(e=>e.id)),a=new Set(n.map(e=>e.id)),r=n.some(e=>!i.has(e.id)),s=E.current.some(e=>!a.has(e.id));if(!(r||s)){const e=new Map(E.current.map(e=>[e.id,e.position]));p(n.map(t=>({...t,position:e.get(t.id)??t.position})));const i=Dr({theme:N.current,nodes:n,aggregatedServiceMap:t});return T.current=i,void v(i)}return(async(e,t,n={})=>{const i={id:"root",layoutOptions:{...Rr,...n},children:e.map(e=>({id:e.id,width:80,height:80,...e.id===Or?{layoutOptions:{"elk.layered.layering.layerConstraint":"FIRST","elk.alignment":"CENTER"}}:{}})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},a=await Ir.layout(i),o=new Map;return a.children?.forEach(e=>{o.set(e.id,{x:e.x??0,y:e.y??0})}),{nodes:e.map(e=>({...e,position:o.get(e.id)??e.position})),edges:t}})(n,Dr({theme:N.current,nodes:n,aggregatedServiceMap:t})).then(({nodes:t})=>{if(e)return;p(t);const n=Dr({theme:N.current,nodes:t,aggregatedServiceMap:k.current});T.current=n,v(n),w()}),()=>{e=!0}},[o,c]),a(()=>{if(!E.current.length)return;const e=Dr({theme:l,nodes:E.current,aggregatedServiceMap:k.current});T.current=e,v(e)},[l]),e(Ur,{$heightToRemove:n,children:[t(an,{nodes:u,edges:y,onNodesChange:m,onEdgesChange:f,onEdgeClick:I,onNodeMouseEnter:R,onNodeMouseLeave:L,onRefresh:r,fitViewTrigger:b,zoomOnScroll:!0}),t(zr,{drawerState:x,aggregatedData:k.current,onClose:O})]})},Jr=p.div`
466
+ `,rl={namespace:"",name:"",kind:"",otelServiceName:"user",selected:!0,numberOfInstances:0,dataStreamNames:[],containers:[],conditions:[]},ll=`${J.Source}-`,sl=`-${en.MapItem}`,cl=.15,dl=({heightToRemove:n,serviceMap:a,onRefresh:r})=>{const s=g(),{sources:c}=X(),[u,p,h]=Ti([]),[m,v,y]=Ni([]),[b,x]=i(0),[S,C]=i(null),w=l([]);w.current=u;const k=l(s);k.current=s;const $=l([]),E=l([]),T=d(()=>x(e=>e+1),[]),{activeNodeId:N,setActiveNodeType:D,setActiveNodeId:A}=on();o(()=>{if(!N)return;const e=(t=N).startsWith(ll)&&t.endsWith(sl)?t.slice(ll.length,-sl.length):null;var t;e&&C({type:"node",graphKey:e})},[N]);const I=d((e,t)=>{const{sourceGraphKey:n,targetGraphKey:i}=t.data||{};n&&i&&(D(null),A(null),C({type:"edge",sourceKey:n,targetKey:i}))},[D,A]),R=d(()=>{C(null),D(null),A(null)},[D,A]),O=d((e,t)=>{const n=t.id;v(e=>e.map(e=>e.source===n||e.target===n?{...e,animated:!0,style:{...e.style,strokeWidth:2.5},labelStyle:{...e.labelStyle,opacity:1},labelBgStyle:{...e.labelBgStyle,opacity:1}}:{...e,style:{...e.style,opacity:cl},labelStyle:{...e.labelStyle,opacity:cl},labelBgStyle:{...e.labelBgStyle,opacity:cl}}))},[v]),M=d(()=>{v(E.current)},[v]);return o(()=>{let e=!1;const t=(e=>{const t=new Map,n=new Set,i=(e,n,i=!1)=>{let o=t.get(e);return o||(o={serviceName:n,isVirtual:i,attributes:{},connectionMap:new Map},t.set(e,o)),o},o=(e,t)=>{if(t)for(const{key:n,value:i}of t)n in e||(e[n]=i)};for(const t of e){const{graphKey:e}=Hr(t.nodeId),a=i(e,t.serviceName);a.isVirtual=!1;for(const e of t.services){const{graphKey:t,detail:r}=Hr(e.nodeId);e.isVirtual&&(n.add(t),o(i(t,e.serviceName,!0).attributes,e.nodeAttributes));let l=a.connectionMap.get(t);if(l||(l={targetGraphKey:t,targetServiceName:e.serviceName,totalRequests:0,lastDateTime:e.dateTime,details:[]},a.connectionMap.set(t,l)),l.totalRequests+=e.requests,e.dateTime>l.lastDateTime&&(l.lastDateTime=e.dateTime),r){const t=l.details.find(e=>e.value===r);t?(t.requests+=e.requests,e.dateTime>t.dateTime&&(t.dateTime=e.dateTime)):l.details.push({value:r,requests:e.requests,dateTime:e.dateTime})}}}const a=[...t.entries()];for(const[,{connectionMap:e}]of a)for(const[o,a]of e)t.has(o)||i(o,a.targetServiceName,n.has(o));const r=[];for(const[e,{serviceName:n,isVirtual:i,attributes:o,connectionMap:a}]of t){const t=[...a.values()];t.sort((e,t)=>e.targetGraphKey.localeCompare(t.targetGraphKey)),r.push({graphKey:e,serviceName:n,isVirtual:i,connections:t,attributes:o})}return r.sort((e,t)=>e.graphKey.localeCompare(t.graphKey)),r})(a);$.current=t;const n=(({sources:e,aggregatedServiceMap:t})=>{const n=[],i={x:0,y:0};if(t.length&&e.length)for(const o of t){const t=Br(o.graphKey),a=e.find(e=>o.serviceName===e.otelServiceName||o.serviceName===e.name);n.push({id:t,type:en.MapItem,position:i,data:Wr(o,a,Vr(a)),measured:{width:80,height:80}})}else n.push({id:`${J.Source}-${en.NoData}`,type:en.NoData,position:i,data:{subTitle:f.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return n})({aggregatedServiceMap:t,sources:[rl].concat(c)});if(1===n.length&&n[0].id===`${J.Source}-${en.NoData}`)return p(n),v([]),void(E.current=[]);const i=new Set(w.current.map(e=>e.id)),o=new Set(n.map(e=>e.id)),r=n.some(e=>!i.has(e.id)),l=w.current.some(e=>!o.has(e.id));if(!(r||l)){const e=new Map(w.current.map(e=>[e.id,e.position]));p(n.map(t=>({...t,position:e.get(t.id)??t.position})));const i=Ur({theme:k.current,nodes:n,aggregatedServiceMap:t});return E.current=i,void v(i)}return(async(e,t,n={})=>{const i={id:"root",layoutOptions:{...Yr,...n},children:e.map(e=>({id:e.id,width:80,height:80,...e.id===Gr?{layoutOptions:{"elk.layered.layering.layerConstraint":"FIRST","elk.alignment":"CENTER"}}:{}})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},o=await qr.layout(i),a=new Map;return o.children?.forEach(e=>{a.set(e.id,{x:e.x??0,y:e.y??0})}),{nodes:e.map(e=>({...e,position:a.get(e.id)??e.position})),edges:t}})(n,Ur({theme:k.current,nodes:n,aggregatedServiceMap:t})).then(({nodes:t})=>{if(e)return;p(t);const n=Ur({theme:k.current,nodes:t,aggregatedServiceMap:$.current});E.current=n,v(n),T()}),()=>{e=!0}},[a,c]),o(()=>{if(!w.current.length)return;const e=Ur({theme:s,nodes:w.current,aggregatedServiceMap:$.current});E.current=e,v(e)},[s]),e(al,{$heightToRemove:n,children:[t(an,{nodes:u,edges:m,onNodesChange:h,onEdgesChange:y,onEdgeClick:I,onNodeMouseEnter:O,onNodeMouseLeave:M,onRefresh:r,fitViewTrigger:b,zoomOnScroll:!0}),t(ol,{drawerState:S,aggregatedData:$.current,onClose:R})]})},ul=h.div`
467
467
  width: 100%;
468
468
  padding-bottom: ${({$isOpen:e})=>e?"18px":"0"};
469
469
  border-radius: 16px;
470
470
  background-color: ${({$selected:e,theme:t})=>e?t.colors.majestic_blue+_["024"]:t.colors.dropdown_bg_2+_["040"]};
471
- `,Yr=p.div`
471
+ `,pl=h.div`
472
472
  display: flex;
473
473
  justify-content: space-between;
474
474
  gap: 12px;
@@ -480,26 +480,26 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
480
480
  background-color: ${({$withClick:e,$selected:t,theme:n})=>e&&(t?n.colors.majestic_blue+_["040"]:n.colors.dropdown_bg_2+_["080"])};
481
481
  transition: background-color 0.3s;
482
482
  }
483
- `,Xr=p(Yr)`
483
+ `,hl=h(pl)`
484
484
  width: calc(100% - 100px);
485
485
  margin: 0 auto;
486
486
  padding: 8px;
487
- `,Qr=p.div`
487
+ `,ml=h.div`
488
488
  position: relative;
489
489
  padding-bottom: ${({$addPadding:e})=>e?"16px":"0"};
490
- `,Zr=p.div`
490
+ `,gl=h.div`
491
491
  position: absolute;
492
492
  top: 6px;
493
493
  left: 18px;
494
- `,es=p(Ie)`
494
+ `,fl=h(Re)`
495
495
  padding-bottom: ${({$addPadding:e})=>e?"16px":"0"};
496
- `,ts=p.div`
496
+ `,vl=h.div`
497
497
  width: ${({$width:e})=>`${e||42}px`};
498
498
  display: flex;
499
499
  align-items: center;
500
500
  justify-content: flex-end;
501
501
  text-align: right;
502
- `,ns=$e(J.Namespace),is=({isModal:n=!1,withInstances:i=!0,loading:a,filteredNamespacesAndSources:o,selectedNamespace:r,onSelectNamespace:s,selectedSources:l,onSelectSource:c,selectedFutureApps:d,onSelectFutureApps:u})=>{const p=h(),{isVm:m}=ae(),{namespacesLoading:y}=Y(),v=Object.entries(o||{});return v?.length?t(Ve,{height:n?"calc(100vh - 510px)":"calc(100vh - 310px)",gap:12,noAnimation:!0,elements:v.map(([n,o])=>{const h=l?.[n]||[],v=d?.[n]?.selected||!1,f=h.filter(({selected:e})=>e),b=h.length>0,S=r===n,C=f.length>0&&f.length===o.length,E=f.length>0&&f.length!==o.length,N=o.length>0,k=1===o.length;return s||N?e(Jr,{"data-id":`namespace-${n}`,$selected:C,$isOpen:S,children:[e(Yr,{$selected:C,$withClick:!!s,onClick:()=>s?.(n),children:[e(O,{$gap:12,children:[s&&t(x,{partiallyChecked:E,value:C,onChange:e=>s(n,e)}),t(ns,{}),t(z,{children:n})]}),e(O,{$gap:24,children:[!m&&u&&t(w,{title:g.FUTURE_APPS_TITLE,tooltip:g.FUTURE_APPS_DESCRIPTION,initialValue:v,onChange:e=>u(e,n),flipHorizontally:!0}),t(ts,{children:t(z,{size:10,color:p.text.grey,children:b?`${f.length}/${o.length}`:null})}),s&&t(vt,{extend:S})]})]}),(S||!s)&&(N?e(Qr,{$addPadding:!c,children:[t(Zr,{children:t(A,{orientation:"vertical",length:(k?24:34*o.length)+"px"})}),o.map(e=>{const a=f.some(({name:t})=>t===e.name);return t(as,{withInstances:i,source:e,namespace:n,isSelected:a,onSelect:c},`source-${e.name}`)})]}):t(es,{$addPadding:!c,children:y||a?t(Fe,{}):t(Oe,{title:g.NO_SOURCES_NAMESPACE,subTitle:g.TRY_SEARCH_OR_OTHER_NAMESPACE})}))]},`namespace-${n}`):null})}):t(Ie,{children:y||a?t(Fe,{}):t(Oe,{title:g.NO_SOURCES,subTitle:!m&&s?g.PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES:g.PLEASE_ADD_SOURCE})})},as=({withInstances:n,source:i,namespace:a,isSelected:o,onSelect:r})=>{const{tier:s}=ae(),l=s!==qt.Onprem&&!!i.kind&&on.has(i.kind);return t(Xr,{"data-id":`source-${i.name}`,$selected:!l&&o,$withClick:!l&&!!r,onClick:()=>!l&&r?.(i),style:l?{opacity:.5,cursor:"not-allowed"}:void 0,children:e(O,{$gap:12,children:[r&&t(x,{value:!l&&o,onChange:()=>!l&&r(i,a)}),e(O,{$gap:4,children:[t(z,{children:i.name}),e(z,{opacity:.8,size:10,children:[n?` • ${i.numberOfInstances||0} running instance${1!==i.numberOfInstances?"s":""}`:"",` • ${i.kind}`,l?" • Enterprise only":""]})]})]})})},os=p.div`
502
+ `,yl=De(J.Namespace),bl=({isModal:n=!1,withInstances:i=!0,loading:o,filteredNamespacesAndSources:a,selectedNamespace:r,onSelectNamespace:l,selectedSources:s,onSelectSource:c,selectedFutureApps:d,onSelectFutureApps:u})=>{const p=g(),{isVm:h}=ae(),{namespacesLoading:m}=X(),v=Object.entries(a||{});return v?.length?t(Be,{height:n?"calc(100vh - 510px)":"calc(100vh - 310px)",gap:12,noAnimation:!0,elements:v.map(([n,a])=>{const g=s?.[n]||[],v=d?.[n]?.selected||!1,y=g.filter(({selected:e})=>e),b=g.length>0,x=r===n,S=y.length>0&&y.length===a.length,w=y.length>0&&y.length!==a.length,k=a.length>0,$=1===a.length;return l||k?e(ul,{"data-id":`namespace-${n}`,$selected:S,$isOpen:x,children:[e(pl,{$selected:S,$withClick:!!l,onClick:()=>l?.(n),children:[e(O,{$gap:12,children:[l&&t(C,{partiallyChecked:w,value:S,onChange:e=>l(n,e)}),t(yl,{}),t(W,{children:n})]}),e(O,{$gap:24,children:[!h&&u&&t(N,{title:f.FUTURE_APPS_TITLE,tooltip:f.FUTURE_APPS_DESCRIPTION,initialValue:v,onChange:e=>u(e,n),flipHorizontally:!0}),t(vl,{children:t(W,{size:10,color:p.text.grey,children:b?`${y.length}/${a.length}`:null})}),l&&t(yt,{extend:x})]})]}),(x||!l)&&(k?e(ml,{$addPadding:!c,children:[t(gl,{children:t(I,{orientation:"vertical",length:($?24:34*a.length)+"px"})}),a.map(e=>{const o=y.some(({name:t})=>t===e.name);return t(xl,{withInstances:i,source:e,namespace:n,isSelected:o,onSelect:c},`source-${e.name}`)})]}):t(fl,{$addPadding:!c,children:m||o?t(Pe,{}):t(Oe,{title:f.NO_SOURCES_NAMESPACE,subTitle:f.TRY_SEARCH_OR_OTHER_NAMESPACE})}))]},`namespace-${n}`):null})}):t(Re,{children:m||o?t(Pe,{}):t(Oe,{title:f.NO_SOURCES,subTitle:!h&&l?f.PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES:f.PLEASE_ADD_SOURCE})})},xl=({withInstances:n,source:i,namespace:o,isSelected:a,onSelect:r})=>{const{tier:l}=ae(),s=l!==Gt.Onprem&&!!i.kind&&rn.has(i.kind);return t(hl,{"data-id":`source-${i.name}`,$selected:!s&&a,$withClick:!s&&!!r,onClick:()=>!s&&r?.(i),style:s?{opacity:.5,cursor:"not-allowed"}:void 0,children:e(O,{$gap:12,children:[r&&t(C,{value:!s&&a,onChange:()=>!s&&r(i,o)}),e(O,{$gap:4,children:[t(W,{children:i.name}),e(W,{opacity:.8,size:10,children:[n?` • ${i.numberOfInstances||0} running instance${1!==i.numberOfInstances?"s":""}`:"",` • ${i.kind}`,s?" • Enterprise only":""]})]})]})})},Sl=h.div`
503
503
  display: flex;
504
504
  flex-direction: column;
505
505
  align-items: center;
@@ -508,46 +508,140 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
508
508
  max-height: calc(100vh - 200px);
509
509
  height: fit-content;
510
510
  overflow-y: scroll;
511
- `,rs=({onEditStream:n,onEditSources:i,onEditDestinations:a,categories:o})=>{const{selectedStreamName:r}=Ye(),{configuredSources:s,configuredDestinations:l,configuredDestinationsUpdateOnly:d}=gt(),u=c(()=>Object.values(s).reduce((e,t)=>e+t.filter(e=>e.selected).length,0),[s]);return t(le,{$isNotModal:!0,children:e(I,{$gap:12,children:[t(P,{title:g.SUMMARY,description:g.STREAM_CONFIRM}),e(os,{children:[t(te,{title:g.STREAM_NAME,action:()=>t(rn,{onClick:n}),data:[{title:"",value:r}]}),t(te,{title:g.SELECTED_SOURCES,titleBadge:u,action:()=>t(rn,{onClick:i}),children:t(is,{filteredNamespacesAndSources:s,withInstances:!1})}),t(te,{title:g.SELECTED_DESTINATIONS,titleBadge:l.length+d.length,action:()=>t(rn,{onClick:a}),children:t(Po,{categories:o})})]})]})})};var ss;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}(ss||(ss={}));const ls=({onClickId:e,defaultSelectedId:n,extendedNavIcons:a})=>{const{isVm:o}=ae(),[r,s]=i(n||""),l=c(()=>[{id:ss.Overview,icon:ei,selected:r===ss.Overview,onClick:()=>{s(ss.Overview),e(ss.Overview)},tooltip:"Overview"},...(a||[]).map(e=>({...e,selected:r===e.id,onClick:()=>{s(e.id),e.onClick()}}))],[r]),d=c(()=>{const t=[{id:ss.Sources,icon:ti,selected:r===ss.Sources,onClick:()=>{s(ss.Sources),e(ss.Sources)},tooltip:"Sources"},{id:ss.Destinations,icon:ni,selected:r===ss.Destinations,onClick:()=>{s(ss.Destinations),e(ss.Destinations)},tooltip:"Destinations"}];return o||(t.push({id:ss.InstrumentationRules,icon:ii,selected:r===ss.InstrumentationRules,onClick:()=>{s(ss.InstrumentationRules),e(ss.InstrumentationRules)},tooltip:"Instrumentation Rules"}),t.push({id:ss.Actions,icon:ai,selected:r===ss.Actions,onClick:()=>{s(ss.Actions),e(ss.Actions)},tooltip:"Actions"})),t},[o,r]);return t(sn,{orientation:"vertical",mainIcons:l,subIcons:d})},cs=({})=>t(R,{onClick:()=>window.open("https://join.slack.com/t/odigos/shared_invite/zt-2wc6gm4j9-EhcVFYrLwHqvcIErO9sVzw","_blank","noopener noreferrer"),tooltip:"Join our Slack community",children:t(oi,{})}),ds=(e,t)=>{const{name:n,kind:i,namespace:a}=e,o=[{title:g.KIND,value:i},{title:g.NAME,value:n,tooltip:"Resource name"}];return t||(o.unshift({title:g.NAMESPACE,value:a}),o.push({type:y.Divider}),o.push({type:y.CopyText,value:`kubectl get ${i} ${n} -n ${a}`.toLowerCase()})),o},us=p.div`
511
+ `,Cl=({onEditStream:n,onEditSources:i,onEditDestinations:o,categories:a})=>{const{selectedStreamName:r}=Xe(),{configuredSources:l,configuredDestinations:s,configuredDestinationsUpdateOnly:d}=ft(),u=c(()=>Object.values(l).reduce((e,t)=>e+t.filter(e=>e.selected).length,0),[l]);return t(ce,{$isNotModal:!0,children:e(R,{$gap:12,children:[t(z,{title:f.SUMMARY,description:f.STREAM_CONFIRM}),e(Sl,{children:[t(ne,{title:f.STREAM_NAME,action:()=>t(ln,{onClick:n}),data:[{title:"",value:r}]}),t(ne,{title:f.SELECTED_SOURCES,titleBadge:u,action:()=>t(ln,{onClick:i}),children:t(bl,{filteredNamespacesAndSources:l,withInstances:!1})}),t(ne,{title:f.SELECTED_DESTINATIONS,titleBadge:s.length+d.length,action:()=>t(ln,{onClick:o}),children:t(er,{categories:a})})]})]})})};var wl;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}(wl||(wl={}));const kl=({onClickId:e,defaultSelectedId:n,extendedNavIcons:o})=>{const{isVm:a}=ae(),[r,l]=i(n||""),s=c(()=>[{id:wl.Overview,icon:hi,selected:r===wl.Overview,onClick:()=>{l(wl.Overview),e(wl.Overview)},tooltip:"Overview"},...(o||[]).map(e=>({...e,selected:r===e.id,onClick:()=>{l(e.id),e.onClick()}}))],[r]),d=c(()=>{const t=[{id:wl.Sources,icon:mi,selected:r===wl.Sources,onClick:()=>{l(wl.Sources),e(wl.Sources)},tooltip:"Sources"},{id:wl.Destinations,icon:gi,selected:r===wl.Destinations,onClick:()=>{l(wl.Destinations),e(wl.Destinations)},tooltip:"Destinations"}];return a||(t.push({id:wl.InstrumentationRules,icon:fi,selected:r===wl.InstrumentationRules,onClick:()=>{l(wl.InstrumentationRules),e(wl.InstrumentationRules)},tooltip:"Instrumentation Rules"}),t.push({id:wl.Actions,icon:vi,selected:r===wl.Actions,onClick:()=>{l(wl.Actions),e(wl.Actions)},tooltip:"Actions"})),t},[a,r]);return t(sn,{orientation:"vertical",mainIcons:s,subIcons:d})},$l=({})=>t(M,{onClick:()=>window.open("https://join.slack.com/t/odigos/shared_invite/zt-2wc6gm4j9-EhcVFYrLwHqvcIErO9sVzw","_blank","noopener noreferrer"),tooltip:"Join our Slack community",children:t(yi,{})});function El(e,t){const n=e.names[t];if(null==n)return"";if("string"==typeof n)return n;if("object"==typeof n&&"name"in n){const e=n.name;if("string"==typeof e)return e}return"number"==typeof n||"boolean"==typeof n?String(n):""}function Tl(e){const t=Math.abs(e);return t>=1e9?`${Nl(e/1e9)} Bil`:t>=1e6?`${Nl(e/1e6)} Mil`:t>=1e3?`${Nl(e/1e3)}K`:String(Math.round(e))}function Nl(e){return e.toFixed(2).replace(/\.?0+$/,"")}function Dl(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function Al(e,t){const n=t.trim().toLowerCase();return!n||e.toLowerCase().includes(n)}function Il(e,t,n,i,o,a=null){if(0===e.levels.length||t<2||n<2)return null;const r=function(e){const t=[];for(let n=0;n<e.levels.length;n++){const i=e.levels[n];for(let e=0;e+3<i.length;e+=4)t.push({level:n,offset:i[e],size:i[e+1],self:i[e+2],nameIndex:i[e+3]})}return t}(e),l=a?function(e,t){const n=e.reduce((e,t)=>Math.max(e,t.level),t.level),i=new Map;for(const t of e){const e=i.get(t.level);e?e.push(t):i.set(t.level,[t])}const o=[t];for(let e=t.level+1;e<=n;e++){const t=o.filter(t=>t.level===e-1);if(0===t.length)break;const n=i.get(e);if(n?.length)for(const e of n)for(const n of t)if(e.offset>=n.offset&&e.offset+e.size<=n.offset+n.size){o.push(e);break}}return o}(r,a):r;if(0===l.length)return null;const s=a?.level??0,c=a?.offset??0,d=a?.size??e.numTicks;if(d<=0)return null;const u=a?Math.max(...l.map(e=>e.level-s))+1:e.levels.length,p=i??Number.POSITIVE_INFINITY,h=Math.max(1,Math.min(n/u,p)),m=o.trim(),g=h>8?1:0;return l.map(n=>{const i=n.level-s,o=(n.offset-c)/d*t,r=Math.max(n.size/d*t,1),l=(a?i:n.level)*h,u=Math.max(h-g,1),p=El(e,n.nameIndex);return{...n,x:o,y:l,w:r,h:u,name:p,matchesSearch:Al(p,m)}})}function Rl(e,t){let n=0;for(let t=0;t<e.length;t++)n=31*n+e.charCodeAt(t)>>>0;const i=t.v2.colors.black[500],o=[{fill:t.v2.colors.purple[300],text:i},{fill:t.v2.colors.green[300],text:i},{fill:t.v2.colors.red[300],text:i},{fill:t.v2.colors.blue[300],text:i},{fill:t.v2.colors.yellow[300],text:i}];return o[n%o.length]}function Ol(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function Ml(e,t,n){for(const i of n)if(e>=i.x&&e<i.x+i.w&&t>=i.y&&t<i.y+i.h)return i;return null}const Ll=({flamebearer:n,maxRowPx:a,searchQuery:r="",minHostHeight:s=200})=>{const p=g(),h=l(null),m=l(null),f=l({x:0,y:0}),v=l(n.numTicks),[y,b]=i({w:0,h:0}),[x,S]=i(""),[C,w]=i(null),[k,$]=i([]),E=k.length>0?k[k.length-1]:null,T=E?.size??n.numTicks;o(()=>{v.current!==n.numTicks&&(v.current=n.numTicks,$([]))},[n.numTicks]),u(()=>{const e=h.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();b({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),o(()=>{if(0===k.length)return;const e=e=>{"Escape"===e.key&&(e.preventDefault(),$(e=>e.slice(0,-1)))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[k.length]);const N=c(()=>Il(n,y.w,y.h,a,r,E),[n,a,r,y.h,y.w,E]),D=c(()=>function(e){return[...e].sort((e,t)=>t.level-e.level)}(N?.length?r.trim()?N.filter(e=>e.matchesSearch):N:[]),[N,r]),A=d(e=>{if(y.w<2||y.h<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const i=Ml((e.clientX-t.left)/t.width*y.w,(e.clientY-t.top)/t.height*y.h,D);if(i){const e=Dl(i);w(e);const t=T>0?(100*i.size/T).toFixed(1):"0",o=n.numTicks>0?(100*i.size/n.numTicks).toFixed(1):"0";S(`${i.name}\ntotal ${Tl(i.size)} (${t}% of view, ${o}% of profile) · self ${Tl(i.self)}`)}else w(null),S("")},[D,n.numTicks,y.h,y.w,T]),I=d(e=>{A(e)},[A]),R=d(()=>{w(null),S("")},[]),O=d(e=>{f.current={x:e.clientX,y:e.clientY}},[]),M=d(e=>{const{x:t,y:n}=f.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-n)>3)return;if(y.w<2||y.h<2)return;const i=e.currentTarget.getBoundingClientRect();if(i.width<1||i.height<1)return;const o=Ml((e.clientX-i.left)/i.width*y.w,(e.clientY-i.top)/i.height*y.h,D);if(!o)return;const a=function(e){return{level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}}(o);$(e=>{const t=e.length>0?e[e.length-1]:null;return t&&function(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}(a,t)?e.slice(0,-1):[...e,a]})},[D,y.h,y.w]);u(()=>{const e=m.current;if(!e||y.w<2||y.h<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1;e.width=Math.floor(y.w*t),e.height=Math.floor(y.h*t),e.style.width=`${y.w}px`,e.style.height=`${y.h}px`;const i=e.getContext("2d");i&&(i.setTransform(t,0,0,t,0,0),i.clearRect(0,0,y.w,y.h),N?.length?function(e,t,n,i,o,a,r,l){const s=a.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,n);const c=o.trim().length>0;for(const t of i){const{x:n,y:i,w:o,h:r,name:s,size:d,matchesSearch:u}=t;if(c&&!u)continue;const{fill:p,text:h}=Rl(s,a);e.fillStyle=p,e.fillRect(n,i,o,r),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(n+.5,i+.5),e.lineTo(n+o-.5,i+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(n+.5,i+.5,Math.max(o-1,0),Math.max(r-1,0));const m=Ol(d,l),g=`${s} (${Tl(d)}, ${m}%)`,f=a.v2.text.size.xxs,v=3,y=22,b=Math.min(f,Math.floor(r-2));if(o>=y&&b>=5){e.font=`${b}px ${a.font_family.code}, ui-monospace, monospace`,e.textBaseline="middle",e.textAlign="left",e.fillStyle=h;let t=g;for(;t.length>2&&e.measureText(t).width>o-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=o-2*v&&e.fillText(t,n+v,i+r/2)}}if(r)for(const t of i){if(Dl(t)!==r)continue;if(c&&!t.matchesSearch)continue;const{x:n,y:i,w:o,h:a}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(n+1,i+1,Math.max(o-2,0),Math.max(a-2,0));break}}(i,y.w,y.h,N,r,p,C,n.numTicks):(i.fillStyle=p.v2.colors.silver[900],i.fillRect(0,0,y.w,y.h)))},[N,n.numTicks,C,r,y.h,y.w,p]);const L=E?El(n,E.nameIndex):"",F=d(()=>$([]),[]),P=d(()=>$(e=>e.slice(0,-1)),[]);return e("div",{style:{flex:1,minHeight:s,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap",minHeight:32,flexShrink:0,padding:"0 2px"},children:[t("div",{style:{flex:"1 1 120px",minWidth:0},children:t(cn,E?{size:dn.XXS,color:p.v2.colors.silver[200],nowrap:!0,children:`Zoomed: ${L} • ${Tl(T)} samples in view`}:{size:dn.XXS,color:p.v2.colors.silver[200],children:"Click a frame to zoom into its subtree (pprof-style). Click the top bar again or press Esc to step back."})}),k.length>0&&e("div",{style:{display:"flex",gap:8,flexShrink:0},children:[k.length>1&&t(un,{variant:hn.Secondary,size:pn.S,label:"Back",onClick:P}),t(un,{variant:hn.Secondary,size:pn.S,label:"Reset zoom",onClick:F})]})]}),t(be,{fullWidth:!0,keepAlive:!0,text:x,children:t("div",{ref:h,style:{flex:1,minHeight:300,minWidth:0,width:"100%",height:"60vh",position:"relative"},children:t("canvas",{ref:m,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:C?"pointer":"default"},onPointerDown:O,onPointerMove:I,onPointerLeave:R,onClick:M})})})]})};var Fl;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(Fl||(Fl={}));const Pl=h(R)`
512
+ width: 100%;
513
+ min-height: 0;
514
+ flex: 1;
515
+ border-radius: 16px;
516
+ overflow: hidden;
517
+ background: ${({theme:e})=>e.v2.colors.silver[800]};
518
+ box-shadow: 0 2px 14.1px 0 rgba(0, 0, 0, 0.25);
519
+ `,_l=h.div`
520
+ display: flex;
521
+ align-items: center;
522
+ gap: 10px;
523
+ flex-wrap: wrap;
524
+ padding: 12px 12px 8px;
525
+ background: ${({theme:e})=>e.v2.colors.silver[800]};
526
+ border-radius: 16px 16px 0 0;
527
+ `,zl=h(O)`
528
+ flex-shrink: 0;
529
+ align-items: center;
530
+ gap: 4px;
531
+ `,Kl=h.div`
532
+ display: flex;
533
+ flex: 1;
534
+ align-items: stretch;
535
+ gap: ${({$gap:e})=>e}px;
536
+ padding: 16px;
537
+ min-height: 0;
538
+ background: ${({theme:e})=>e.v2.colors.silver[800]};
539
+ border-radius: 0 0 16px 16px;
540
+ `,jl=h(R)`
541
+ flex: ${({$splitWithFlame:e})=>e?"0 0 min(413px, 42%)":"1 1 auto"};
542
+ width: ${({$splitWithFlame:e})=>e?"auto":"100%"};
543
+ max-width: ${({$splitWithFlame:e})=>e?"none":"100%"};
544
+ min-width: 0;
545
+ min-height: 0;
546
+ gap: 10px;
547
+ `,Bl=h(R)`
548
+ flex: ${({$splitWithTable:e})=>e?"1":"1 1 auto"};
549
+ width: ${({$splitWithTable:e})=>e?"auto":"100%"};
550
+ min-width: 0;
551
+ min-height: 0;
552
+ gap: 10px;
553
+ `,Wl=h.div`
554
+ flex: 1;
555
+ display: flex;
556
+ flex-direction: column;
557
+ min-height: 200px;
558
+ min-width: 0;
559
+ `,Vl=h(O)`
560
+ width: 100%;
561
+ min-height: 32px;
562
+ flex-shrink: 0;
563
+ `,Ul=h.div`
564
+ border-radius: 12px;
565
+ overflow: hidden;
566
+ border: 1px solid ${({theme:e})=>e.v2.colors.grey[500]};
567
+ `,Hl=h.div`
568
+ display: flex;
569
+ align-items: center;
570
+ justify-content: ${({$align:e})=>"right"===e?"flex-end":"flex-start"};
571
+ gap: 8px;
572
+ flex: ${({$flex:e})=>e??1};
573
+ min-width: 0;
574
+ padding: 0 12px;
575
+ height: 54px;
576
+ background: ${({theme:e})=>e.v2.colors.silver[750]};
577
+ border-bottom: 1px solid ${({theme:e})=>e.v2.colors.grey[500]};
578
+ cursor: ${({$clickable:e})=>e?"pointer":"default"};
579
+ `,ql=h.div`
580
+ display: flex;
581
+ align-items: stretch;
582
+ background: ${({$hovered:e,theme:t})=>e?t.v2.colors.silver[700]:t.v2.colors.silver[800]};
583
+ border-bottom: 1px solid ${({theme:e})=>e.v2.colors.grey[500]};
584
+ min-height: 54px;
585
+ `,Gl=h.div`
586
+ display: flex;
587
+ align-items: center;
588
+ justify-content: ${({$align:e})=>"right"===e?"flex-end":"flex-start"};
589
+ flex: ${({$flex:e})=>e??1};
590
+ min-width: 0;
591
+ padding: 10px 12px;
592
+ `,Yl=h.div`
593
+ display: flex;
594
+ align-items: center;
595
+ gap: 8px;
596
+ width: 100%;
597
+ min-width: 0;
598
+ `,Jl=h.div`
599
+ flex: 1 1 0;
600
+ min-width: 0;
601
+ overflow: hidden;
602
+ text-overflow: ellipsis;
603
+ `,Xl=h.div`
604
+ padding: 12px;
605
+ `;function Ql(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}const Zl=({source:n,fetchProfilingSlots:a,enableProfiling:r,releaseProfiling:s,fetchSourceProfiling:u})=>{const p=g(),{CopyButton:h}=mn(),m={namespace:n.namespace,kind:n.kind,name:n.name},[f,v]=i(null),[y,b]=i(null),[x,S]=i(!1),[C,w]=i(Fl.Both),[k,$]=i(""),[E,T]=i("self"),[N,D]=i("desc"),[A,I]=i(null),R=l(null),M=d(async()=>{try{const[e,t]=await Promise.all([a(),u(m)]);e&&v(e),t?.profileJson&&b(t.profileJson)}finally{S(!0)}},[a,u,n.namespace,n.kind,n.name]);o(()=>{let e=!1;return(async()=>{await r(m),e||(await M(),e||(R.current=setInterval(M,3e3)))})(),()=>{e=!0,R.current&&clearInterval(R.current),s(m)}},[r,s,M,n.namespace,n.kind,n.name]);const L=c(()=>function(e){if(!e?.trim())return null;try{const t=JSON.parse(e),n=t.flamebearer;return!n?.names?.length||!Array.isArray(n.levels)||"number"!=typeof n.numTicks||n.numTicks<=0?null:{flamebearer:n,units:t.metadata?.units}}catch{return null}}(y),[y]),F=c(()=>L?function(e){const t=new Map;for(let n=0;n<e.levels.length;n++){const i=e.levels[n];for(let n=0;n+3<i.length;n+=4){const o=i[n+1],a=i[n+2],r=El(e,i[n+3]);if(!r)continue;const l=t.get(r);(!l||o>l.total)&&t.set(r,{self:a,total:o})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)}(L.flamebearer):[],[L]),P=c(()=>{const e=k.trim().toLowerCase();return e?F.filter(t=>t.name.toLowerCase().includes(e)):F},[F,k]),_=c(()=>{const e=[...P];return e.sort((e,t)=>{const n=("self"===E?e.self:e.total)-("self"===E?t.self:t.total);return"desc"===N?-n:n}),e},[P,E,N]),z=e=>{E===e?D(e=>"desc"===e?"asc":"desc"):(T(e),D("desc"))},K=C===Fl.Table||C===Fl.Both,j=C===Fl.Flame||C===Fl.Both,B=K&&j;return x?e(Pl,{$gap:0,$width:"100%",children:[e(_l,{children:[t(be,{text:"Live CPU profile collected from the workload agent. Search symbols, switch between the table and flame graph, or download a JSON snapshot.",withIcon:!0,children:t(zl,{children:t(cn,{size:dn.S,weight:500,color:p.v2.colors.white[500],nowrap:!0,children:"CPU Profiling"})})}),e(O,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(fn,{value:k,onChange:$,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:p.v2.colors.silver[900],emphasizeBackgroundColor:p.v2.colors.silver[800]})}),t(vn,{size:bn.S,variant:yn.Filled,options:[{value:Fl.Table,label:"Top table"},{value:Fl.Flame,label:"Flame graph"},{value:Fl.Both,label:"Both"}],selected:C,setSelected:w}),t(un,{variant:hn.Secondary,size:pn.S,label:"Live",tooltip:"Odigos profiler works in-memory and doesn't store any data on disk, to keep minimum memory footprint we store only last 10 minutes of data on demand",leftIcon:e=>t(bi,{...e,size:8,fill:p.v2.colors.green[500]})})]})]}),e(Kl,{$gap:K&&j?16:0,children:[K&&e(jl,{$splitWithFlame:B,children:[t(Vl,{$justifyContent:"flex-end",children:t(un,{variant:hn.Secondary,size:pn.S,label:"Download Snapshot",rightIcon:xi,onClick:()=>{if(!y)return;const e=new Blob([y],{type:"application/json"}),t=URL.createObjectURL(e),i=document.createElement("a");i.href=t,i.download=`cpu-profile-${n.namespace}-${n.kind}-${n.name}.json`,i.click(),URL.revokeObjectURL(t)},disabled:!y})}),L?e(Ul,{children:[e(O,{style:{width:"100%",alignItems:"stretch"},children:[t(Hl,{$flex:2.4,children:t(cn,{size:dn.XS,weight:500,color:p.v2.colors.white[500],children:"Symbol"})}),e(Hl,{$flex:.9,$align:"right",$clickable:!0,role:"button",onClick:()=>z("self"),children:[t(cn,{size:dn.XS,weight:500,color:p.v2.colors.white[500],children:"Self"}),t(Si,{size:14,fill:"self"===E?p.v2.colors.white[500]:p.v2.colors.grey[300],rotate:"self"===E&&"asc"===N?180:0})]}),e(Hl,{$flex:.9,$align:"right",$clickable:!0,role:"button",onClick:()=>z("total"),children:[t(cn,{size:dn.XS,weight:500,color:p.v2.colors.white[500],children:"Total"}),t(Si,{size:14,fill:"total"===E?p.v2.colors.white[500]:p.v2.colors.grey[300],rotate:"total"===E&&"asc"===N?180:0})]})]}),t("div",{children:0===_.length?t(ql,{children:t(Gl,{children:t(cn,{size:dn.XS,color:p.v2.colors.silver[200],children:"No symbols match your search"})})}):_.map((n,i)=>e(ql,{$hovered:A===i,onMouseEnter:()=>I(i),onMouseLeave:()=>I(null),children:[t(Gl,{$flex:2.4,children:e(Yl,{children:[t(Jl,{children:t(cn,{size:dn.XS,weight:300,color:p.v2.colors.white[500],nowrap:!0,children:n.name})}),A===i&&t(h,{value:n.name})]})}),t(Gl,{$flex:.9,$align:"right",children:t(cn,{size:dn.XS,weight:300,color:p.v2.colors.white[500],children:Tl(n.self)})}),t(Gl,{$flex:.9,$align:"right",children:t(cn,{size:dn.XS,weight:300,color:p.v2.colors.white[500],children:Tl(n.total)})})]},`${n.name}-${i}`))})]}):t(Re,{children:t(xn,{title:"No profile data yet",subTitle:"Keep this tab open while the agent collects a sample."})})]}),j&&e(Bl,{$splitWithTable:B,children:[t(Vl,{$justifyContent:"center",children:t(Sn,{label:L?`Total samples in view ${Tl(L.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:p.v2.colors.silver[750],textColor:p.v2.colors.silver[200],textSize:dn.XXS})}),L?t(Wl,{children:t(Ll,{flamebearer:L.flamebearer,maxRowPx:B?15:22,searchQuery:k,minHostHeight:B?200:280},C)}):t(Re,{$height:200,children:t(cn,{size:dn.XS,color:p.v2.colors.silver[200],children:"Flame graph appears once a profile is available"})})]})]}),f&&t(Xl,{children:t(cn,{size:dn.XXXS,color:p.v2.colors.silver[300],children:`${f.activeKeys.length} / ${f.maxSlots} profiling slots · ${Ql(f.totalBytesUsed)} / ${Ql(f.maxTotalBytesBudget)} budget · TTL ${f.slotTtlSeconds}s`})})]}):t(Re,{$height:"70vh",children:t(gn,{withSpinner:!0})})},es=(e,t)=>{const{name:n,kind:i,namespace:o}=e,a=[{title:f.KIND,value:i},{title:f.NAME,value:n,tooltip:"Resource name"}];return t||(a.unshift({title:f.NAMESPACE,value:o}),a.push({type:v.Divider}),a.push({type:v.CopyText,value:`kubectl get ${i} ${n} -n ${o}`.toLowerCase()})),a},ts=h.div`
512
606
  display: flex;
513
607
  flex-direction: column;
514
608
  gap: 24px;
515
609
  padding: 4px;
516
- `,ps=({formData:e,handleFormChange:n})=>t(us,{children:t(E,{name:"sourceName",title:"Source name",tooltip:"This overrides the default service name that runs in your cluster.",placeholder:"Use a name that overrides the source name",value:e.otelServiceName,onChange:({target:{value:e}})=>n("otelServiceName",e)})}),ms=({workloadOdigosHealthStatus:e})=>{if(!e)return null;const n=ln(e?.status),i=lt(e?.reasonEnum),a=e?.message;return t(O,{$alignItems:"center",$justifyContent:"center",children:t(ge,{status:n,title:i,subtitle:a,withBackground:n!==ye.Disabled,withBorder:!0,withIcon:!0,width:"calc(100% - 24px)"})})},hs=({source:n,fetchSourceDescribe:o,onClickRestartPod:r})=>{const[s,l]=i(!1),[c,d]=i(null);return a(()=>{n&&o({namespace:n.namespace,name:n.name,kind:n.kind}).then(({data:e})=>{e?.describeSource?d(e.describeSource):l(!0)})},[n.namespace,n.name,n.kind]),c||s?t(I,{$gap:12,children:s?t(Ie,{$height:"70vh",children:t(Oe,{subTitle:"Could not fetch describe for this source"})}):c?.pods?.length?c.pods.map(({podName:i,nodeName:a,phase:o,agentInjected:s,runningLatestWorkloadRevision:l,containers:d,manifestYAML:p})=>{const m=o.status!==de.Success||cn(d)?de.Error:de.Success,h=[];return h.push(t(dn,{value:`kubectl get pod ${i.value} -n ${c?.namespace?.value||n.namespace}`.toLowerCase()},"copy-text")),h.push(t(A,{length:"100%",margin:"0"},"divider-1")),h.push(t(un,{title:a.name,tooltip:a.explain||"",value:{status:a.status||void 0,text:a.value}},"describe-row-1")),h.push(t(A,{length:"100%",margin:"0"},"divider-2")),h.push(t(un,{title:o.name,tooltip:o.explain||"",value:{status:o.status||void 0,text:o.value}},"describe-row-2")),h.push(t(A,{length:"100%",margin:"0"},"divider-3")),h.push(t(un,{title:s.name,tooltip:s.explain||"",value:{status:s.status||void 0,text:s.value}},"describe-row-3")),h.push(t(A,{length:"100%",margin:"0"},"divider-4")),l?.name&&(h.push(t(un,{title:l.name,tooltip:l.explain||void 0,value:{status:l.status||void 0,text:l.value}},"describe-row-4")),h.push(t(A,{length:"100%",margin:"0"},"divider-5"))),d.forEach(e=>{h.push(t(pn,{...e},`pod-container-${e.containerName.value}`))}),p&&(h.push(t(A,{length:"100%",margin:"0"},"divider-6")),h.push(t(hi,{yaml:p},"yaml-section-card"))),t(te,{title:`Pod: ${i.value}`,withExtend:!0,action:({hovered:a})=>e("div",{style:{position:"relative"},children:[t(ge,{status:m,title:m,withIcon:!0,withBorder:!0},"status"),a&&t(mn,{isOpen:!0,positionRight:"calc(100% + 12px)",actions:r?[{id:hn(),label:"Restart",rightIcon:Vn,onClick:()=>r(c?.namespace?.value||n.namespace,i.value)}]:[]},"hover-actions")]}),children:u.toArray(h)},`pod-${i.value}`)}):t(Ie,{$height:"70vh",children:t(Oe,{subTitle:"Check if you have any running pods and try again"})})}):t(Ie,{$height:"70vh",children:t(Fe,{})})},gs=p(O)`
610
+ `,ns=({formData:e,handleFormChange:n})=>t(ts,{children:t(k,{name:"sourceName",title:"Source name",tooltip:"This overrides the default service name that runs in your cluster.",placeholder:"Use a name that overrides the source name",value:e.otelServiceName,onChange:({target:{value:e}})=>n("otelServiceName",e)})}),is=({workloadOdigosHealthStatus:e})=>{if(!e)return null;const n=Cn(e?.status),i=ct(e?.reasonEnum),o=e?.message;return t(O,{$alignItems:"center",$justifyContent:"center",children:t(fe,{status:n,title:i,subtitle:o,withBackground:n!==ve.Disabled,withBorder:!0,withIcon:!0,width:"calc(100% - 24px)"})})},os=({source:n,fetchSourceDescribe:a,onClickRestartPod:r})=>{const[l,s]=i(!1),[c,d]=i(null);return o(()=>{n&&a({namespace:n.namespace,name:n.name,kind:n.kind}).then(({data:e})=>{e?.describeSource?d(e.describeSource):s(!0)})},[n.namespace,n.name,n.kind]),c||l?t(R,{$gap:12,children:l?t(Re,{$height:"70vh",children:t(Oe,{subTitle:"Could not fetch describe for this source"})}):c?.pods?.length?c.pods.map(({podName:i,nodeName:o,phase:a,agentInjected:l,runningLatestWorkloadRevision:s,containers:d,manifestYAML:u})=>{const h=a.status!==ue.Success||wn(d)?ue.Error:ue.Success,m=[];return m.push(t(kn,{value:`kubectl get pod ${i.value} -n ${c?.namespace?.value||n.namespace}`.toLowerCase()},"copy-text")),m.push(t(I,{length:"100%",margin:"0"},"divider-1")),m.push(t($n,{title:o.name,tooltip:o.explain||"",value:{status:o.status||void 0,text:o.value}},"describe-row-1")),m.push(t(I,{length:"100%",margin:"0"},"divider-2")),m.push(t($n,{title:a.name,tooltip:a.explain||"",value:{status:a.status||void 0,text:a.value}},"describe-row-2")),m.push(t(I,{length:"100%",margin:"0"},"divider-3")),m.push(t($n,{title:l.name,tooltip:l.explain||"",value:{status:l.status||void 0,text:l.value}},"describe-row-3")),m.push(t(I,{length:"100%",margin:"0"},"divider-4")),s?.name&&(m.push(t($n,{title:s.name,tooltip:s.explain||void 0,value:{status:s.status||void 0,text:s.value}},"describe-row-4")),m.push(t(I,{length:"100%",margin:"0"},"divider-5"))),d.forEach(e=>{m.push(t(En,{...e},`pod-container-${e.containerName.value}`))}),u&&(m.push(t(I,{length:"100%",margin:"0"},"divider-6")),m.push(t(Ai,{yaml:u},"yaml-section-card"))),t(ne,{title:`Pod: ${i.value}`,withExtend:!0,action:({hovered:o})=>e("div",{style:{position:"relative"},children:[t(fe,{status:h,title:h,withIcon:!0,withBorder:!0},"status"),o&&t(Tn,{isOpen:!0,positionRight:"calc(100% + 12px)",actions:r?[{id:Nn(),label:"Restart",rightIcon:ei,onClick:()=>r(c?.namespace?.value||n.namespace,i.value)}]:[]},"hover-actions")]}),children:p.toArray(m)},`pod-${i.value}`)}):t(Re,{$height:"70vh",children:t(Oe,{subTitle:"Check if you have any running pods and try again"})})}):t(Re,{$height:"70vh",children:t(Pe,{})})},as=h(O)`
517
611
  width: 100%;
518
612
  align-items: center;
519
613
  justify-content: space-between;
520
- `,ys=({source:n,fetchSourceLibraries:r})=>{const s=h(),[l,c]=i(!1),[d,u]=i(null);return a(()=>{n&&r({namespace:n.namespace,name:n.name,kind:n.kind}).then(({data:e})=>{e?.instrumentationInstanceComponents?u(Dt(e.instrumentationInstanceComponents).sort((e,t)=>e.name.localeCompare(t.name))):c(!0)})},[n.namespace,n.name,n.kind]),d||l?t(I,{$gap:12,children:l?t(Ie,{$height:"70vh",children:t(Oe,{subTitle:"Could not fetch libraries for this source"})}):d?.length?t(te,{title:"Instrumented Libraries",children:d.map(({name:n,healthy:i,message:a,nonIdentifyingAttributes:r},l)=>e(o,{children:[e(I,{$gap:4,$width:"100%",children:[e(gs,{$width:"100%",children:[t(z,{size:12,color:s.text.grey,children:n}),e(O,{$gap:4,children:[r.map(({key:e,value:i})=>gn(i)&&yn(i)&&"is_standard_lib"===e?t(ge,{status:de.Default,title:"STANDARD",withBorder:!0},`${n}-${e}`):null),"boolean"==typeof i&&t(ge,{status:i?de.Success:de.Error,title:i?"HEALTHY":"UNHEALTHY",withBorder:!0})]})]}),a&&t(z,{size:10,color:s.text.error,align:"right",children:a})]}),l!==d.length-1&&t(A,{length:"100%",margin:"0"})]},`library-${n}`))}):e(Ie,{$height:"70vh",$gap:12,children:[t(Oe,{title:"No libraries found",subTitle:""}),t(ce,{type:de.Warning,message:"This feature is in early development, and has very limited support"})]})}):t(Ie,{$height:"70vh",children:t(Fe,{})})},vs="70vh",fs=(e,t)=>e.serviceName.localeCompare(t.serviceName),bs=p(z)`
614
+ `,rs=({source:n,fetchSourceLibraries:r})=>{const l=g(),[s,c]=i(!1),[d,u]=i(null);return o(()=>{n&&r({namespace:n.namespace,name:n.name,kind:n.kind}).then(({data:e})=>{e?.instrumentationInstanceComponents?u(At(e.instrumentationInstanceComponents).sort((e,t)=>e.name.localeCompare(t.name))):c(!0)})},[n.namespace,n.name,n.kind]),d||s?t(R,{$gap:12,children:s?t(Re,{$height:"70vh",children:t(Oe,{subTitle:"Could not fetch libraries for this source"})}):d?.length?t(ne,{title:"Instrumented Libraries",children:d.map(({name:n,healthy:i,message:o,nonIdentifyingAttributes:r},s)=>e(a,{children:[e(R,{$gap:4,$width:"100%",children:[e(as,{$width:"100%",children:[t(W,{size:12,color:l.text.grey,children:n}),e(O,{$gap:4,children:[r.map(({key:e,value:i})=>Dn(i)&&An(i)&&"is_standard_lib"===e?t(fe,{status:ue.Default,title:"STANDARD",withBorder:!0},`${n}-${e}`):null),"boolean"==typeof i&&t(fe,{status:i?ue.Success:ue.Error,title:i?"HEALTHY":"UNHEALTHY",withBorder:!0})]})]}),o&&t(W,{size:10,color:l.text.error,align:"right",children:o})]}),s!==d.length-1&&t(I,{length:"100%",margin:"0"})]},`library-${n}`))}):e(Re,{$height:"70vh",$gap:12,children:[t(Oe,{title:"No libraries found",subTitle:""}),t(de,{type:ue.Warning,message:"This feature is in early development, and has very limited support"})]})}):t(Re,{$height:"70vh",children:t(Pe,{})})},ls="70vh",ss=(e,t)=>e.serviceName.localeCompare(t.serviceName),cs=h(W)`
521
615
  cursor: ${({$clickable:e})=>e?"pointer":"default"};
522
616
  text-decoration: ${({$clickable:e})=>e?"underline":"none"};
523
617
  &:hover {
524
618
  opacity: ${({$clickable:e})=>e?.7:1};
525
619
  }
526
- `,Ss=p(O)`
620
+ `,ds=h(O)`
527
621
  justify-content: flex-end;
528
622
  align-items: center;
529
623
  gap: 6px;
530
624
  cursor: pointer;
531
- `,xs=({items:i,emptyMessage:a,keyPrefix:r,findSource:s,onNavigate:l})=>{const c=h();return i.length?t(n,{children:i.map(({serviceName:n},a)=>{const d=!!s(n);return e(o,{children:[t(bs,{size:13,color:d?c.text.secondary:c.text.grey,$clickable:d,onClick:()=>l(n),children:n}),a!==i.length-1&&t(A,{length:"100%",margin:"0"})]},`${r}-${n}`)})}):t(z,{size:13,color:c.text.grey,children:a})},Cs=({source:n,fetchPeerSources:o})=>{const r=h(),{setDrawerType:l,setDrawerEntityId:c}=U(),u=Y(e=>e.sources),[p,m]=i(!1),[g,y]=i(!1),[v,f]=i(null),b=n.otelServiceName||n.name,S=s(o);S.current=o;const x=d(()=>{b&&(y(!0),m(!1),S.current(b).then(({data:e})=>{e?.peerSources?f(e.peerSources):m(!0)}).finally(()=>y(!1)))},[b]);a(()=>{x()},[x]);const C=d(e=>u.find(t=>t.otelServiceName===e||t.name===e),[u]),E=d(e=>{const t=C(e);t&&(l(J.Source),c({namespace:t.namespace,name:t.name,kind:t.kind}))},[C,l,c]);if(!v&&!p&&g)return t(Ie,{$height:vs,children:t(Fe,{})});if(p)return t(Ie,{$height:vs,children:t(Oe,{subTitle:"Could not fetch peer sources"})});const N=v?.inbound?[...v.inbound].sort(fs):[],k=v?.outbound?[...v.outbound].sort(fs):[];return e(I,{$gap:12,children:[t(te,{title:"Inbound",titleBadge:N.length,description:`Services that send requests to ${b}`,children:t(xs,{items:N,emptyMessage:"No inbound connections",keyPrefix:"inbound",findSource:C,onNavigate:E})}),t(te,{title:"Outbound",titleBadge:k.length,description:`Services that ${b} sends requests to`,children:t(xs,{items:k,emptyMessage:"No outbound connections",keyPrefix:"outbound",findSource:C,onNavigate:E})}),e(Ss,{onClick:x,children:[t(Vn,{size:14}),t(z,{size:12,color:r.text.grey,decoration:"underline",children:"Refresh"})]})]})};var Es;!function(e){e.Overview="Overview",e.Pods="Pods",e.Libraries="Libraries",e.PeerSources="Peer Sources"}(Es||(Es={}));const Ns=[fn.Deployment,fn.StatefulSet,fn.DaemonSet,fn.DeploymentConfig,fn.Rollout,fn.StaticPod],ks=[fn.Deployment,fn.StatefulSet,fn.DaemonSet,fn.DeploymentConfig,fn.Rollout,fn.Pod],Ts=[bn.Python,bn.Go,bn.Java],ws=p.div`
625
+ `,us=({items:i,emptyMessage:o,keyPrefix:r,findSource:l,onNavigate:s})=>{const c=g();return i.length?t(n,{children:i.map(({serviceName:n},o)=>{const d=!!l(n);return e(a,{children:[t(cs,{size:13,color:d?c.text.secondary:c.text.grey,$clickable:d,onClick:()=>s(n),children:n}),o!==i.length-1&&t(I,{length:"100%",margin:"0"})]},`${r}-${n}`)})}):t(W,{size:13,color:c.text.grey,children:o})},ps=({source:n,fetchPeerSources:a})=>{const r=g(),{setDrawerType:l,setDrawerEntityId:s}=V(),c=X(e=>e.sources),[u,p]=i(!1),[h,m]=i(!1),[f,v]=i(null),y=n.otelServiceName||n.name,b=d(()=>{y&&(m(!0),p(!1),a(y).then(({data:e})=>{e?.peerSources?v(e.peerSources):p(!0)}).finally(()=>m(!1)))},[y]);o(()=>{b()},[b]);const x=d(e=>c.find(t=>t.otelServiceName===e||t.name===e),[c]),S=d(e=>{const t=x(e);t&&(l(J.Source),s({namespace:t.namespace,name:t.name,kind:t.kind}))},[x,l,s]);if(!f&&!u&&h)return t(Re,{$height:ls,children:t(Pe,{})});if(u)return t(Re,{$height:ls,children:t(Oe,{subTitle:"Could not fetch peer sources"})});const C=f?.inbound?[...f.inbound].sort(ss):[],w=f?.outbound?[...f.outbound].sort(ss):[];return e(R,{$gap:12,children:[t(ne,{title:"Inbound",titleBadge:C.length,description:`Services that send requests to ${y}`,children:t(us,{items:C,emptyMessage:"No inbound connections",keyPrefix:"inbound",findSource:x,onNavigate:S})}),t(ne,{title:"Outbound",titleBadge:w.length,description:`Services that ${y} sends requests to`,children:t(us,{items:w,emptyMessage:"No outbound connections",keyPrefix:"outbound",findSource:x,onNavigate:S})}),e(ds,{onClick:b,children:[t(ei,{size:14}),t(W,{size:12,color:r.text.grey,decoration:"underline",children:"Refresh"})]})]})};var hs;!function(e){e.Overview="Overview",e.Pods="Pods",e.Libraries="Libraries",e.PeerSources="Peer Sources",e.Profiling="Profiling"}(hs||(hs={}));const ms=[Rn.Deployment,Rn.StatefulSet,Rn.DaemonSet,Rn.DeploymentConfig,Rn.Rollout,Rn.StaticPod],gs=[Rn.Deployment,Rn.StatefulSet,Rn.DaemonSet,Rn.DeploymentConfig,Rn.Rollout,Rn.Pod],fs=[On.Python,On.Go,On.Java],vs=h.div`
532
626
  width: 100%;
533
627
  height: 100%;
534
628
  max-height: calc(100vh - 220px);
535
629
  overflow: overlay;
536
630
  overflow-y: auto;
537
- `,$s=p.div`
631
+ `,ys=h.div`
538
632
  display: flex;
539
633
  flex-direction: column;
540
634
  gap: 12px;
541
- `;var Ds;!function(e){e.Workload="Workload",e.Pod="Pod"}(Ds||(Ds={}));const As=({persistSources:o,updateSource:r,restartWorkloads:l,fetchSourceById:d,fetchSourceDescribe:u,fetchSourceLibraries:p,fetchPeerSources:m,restartPod:h,recoverFromRollback:y})=>{const{isVm:v}=ae(),{sources:f}=Y(),{selectedStreamName:b}=Ye(),{drawerType:S,drawerEntityId:x}=U(),C=c(()=>Qe(f,b),[f,b]),E=s(null),N=S===J.Source,[k,T]=i(!1),[w,$]=i(!1),[D,A]=i(Es.Overview),[I,O]=i(null);a(()=>{N&&x&&d(x).then(e=>O(e||null))},[N,x]);const{formData:R,handleFormChange:L,resetFormData:M,loadFormWithDrawerItem:F}=vn(),_=c(()=>{if(x)return I&&JSON.stringify(Yt(I))===JSON.stringify(Yt(x))?I:C?.find(e=>JSON.stringify(Yt(e))===JSON.stringify(Yt(x)))},[x,C,I]);a(()=>{N&&_?F(_):M()},[N,_]);const P=c(()=>{const e=_?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===ye.Loading,containers:_?.containers||[]}},[_]),K=c(()=>!!_?.rollbackOccurred,[_?.rollbackOccurred]),j=c(()=>{const e=[{label:Es.Overview,onClick:()=>A(Es.Overview),selected:D===Es.Overview}];return v||(Ns.includes(_?.kind)&&e.push({label:Es.Pods,onClick:()=>A(Es.Pods),selected:D===Es.Pods}),_?.containers?.some(({language:e})=>Ts.includes(e))&&e.push({label:Es.Libraries,onClick:()=>A(Es.Libraries),selected:D===Es.Libraries}),e.push({label:Es.PeerSources,onClick:()=>A(Es.PeerSources),selected:D===Es.PeerSources})),e},[D,_,v]),V=ks.includes(_?.kind),[B,W]=i({openFor:null,workloadId:void 0,podNamespace:void 0,podName:void 0});if(!_)return null;return e(Ki,{ref:E,onClose:()=>{A(Es.Overview),O(null)},title:_.otelServiceName||_.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:xn(_.containers),isEdit:k,isFormDirty:w,onEdit:D===Es.Overview?e=>{T("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=R.otelServiceName!==_.name?R.otelServiceName:"";L("otelServiceName",e),await r(x,{...R,otelServiceName:e}),O(null),$(!1),T(!1)},onDelete:D===Es.Overview?async()=>{const{namespace:e}=_;o({[e]:[{..._,selected:!1,currentStreamName:b}]},{}),O(null),$(!1),T(!1),E.current?.closeDrawer()}:void 0,onCancel:()=>{$(!1),T(!1),L("otelServiceName",_.otelServiceName||_.name||"")},isLastItem:1===C.length,tabs:j,headerActionButtons:v?[]:V?[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>W({openFor:Ds.Workload,workloadId:x}),children:e(n,{children:[t(Gn,{}),t(z,{size:14,family:"secondary",decoration:"underline",children:"Restart"})]})}]:[],children:[D===Es.Overview?k?t(ws,{children:t(ps,{formData:R,handleFormChange:(...e)=>{$(!0),L(...e),L("currentStreamName",b)}})}):e($s,{children:[t(ms,{workloadOdigosHealthStatus:_.workloadOdigosHealthStatus}),K&&t(ce,{type:de.Warning,message:g.ROLLBACK_OCCURRED_MESSAGE,action:{label:g.ROLLBACK_RECOVER,onClick:async()=>{await y(x);const e=await d(x);e&&O(e)}}}),t(ee,{conditions:_.conditions||[]}),t(te,{title:g.SOURCE_DETAILS,data:_?ds(_,v):[]}),t(te,{title:v?g.DETECTED_PROCESSES:g.DETECTED_CONTAINERS,titleBadge:P.isLoading?ye.Loading:P.containers.length,description:P.description||(v?g.DETECTED_PROCESSES_DESCRIPTION:g.DETECTED_CONTAINERS_DESCRIPTION),children:P.containers.map(e=>t(Sn,{...e,callbackRuntimeOverride:e=>r(x,e)},`source-container-${e.containerName}`))}),_.manifestYAML&&t(hi,{title:`${_.kind} YAML`,yaml:_.manifestYAML,defaultOpen:!_.instrumentationConfigYAML}),_.instrumentationConfigYAML&&t(hi,{title:"Instrumentation Config YAML",yaml:_.instrumentationConfigYAML,defaultOpen:!_.manifestYAML})]}):D===Es.Pods?t(hs,{source:_,fetchSourceDescribe:u,onClickRestartPod:V?(e,t)=>W({openFor:Ds.Pod,podNamespace:e,podName:t}):void 0}):D===Es.PeerSources?t(Cs,{source:_,fetchPeerSources:m}):t(ys,{source:_,fetchSourceLibraries:p}),t(Gt,{isOpen:!!B.openFor,title:`Rollout Restart ${B.openFor}`,description:`Are you sure you want to rollout restart this ${B.openFor?.toLowerCase()}?`,approveButton:{text:"Confirm",variant:de.Warning,onClick:()=>{B.openFor===Ds.Workload&&B.workloadId?l([B.workloadId]):B.openFor===Ds.Pod&&B.podNamespace&&B.podName&&h(B.podNamespace,B.podName),W({openFor:null})}},denyButton:{text:"Go Back",onClick:()=>{W({openFor:null})}}})]})},Is=p.div`
635
+ `;var bs;!function(e){e.Workload="Workload",e.Pod="Pod"}(bs||(bs={}));const xs=({persistSources:a,updateSource:r,restartWorkloads:s,fetchSourceById:d,fetchSourceDescribe:u,fetchSourceLibraries:p,fetchPeerSources:h,restartPod:m,recoverFromRollback:g,fetchProfilingSlots:v,enableProfiling:y,releaseProfiling:b,fetchSourceProfiling:x})=>{const{isVm:S}=ae(),{sources:C}=X(),{selectedStreamName:w}=Xe(),{drawerType:k,drawerEntityId:$}=V(),E=c(()=>Ze(C,w),[C,w]),T=l(null),N=k===J.Source,[D,A]=i(!1),[I,R]=i(!1),[O,M]=i(hs.Overview),[L,F]=i(null);o(()=>{N&&$&&d($).then(e=>F(e||null))},[N,$]);const{formData:P,handleFormChange:_,resetFormData:z,loadFormWithDrawerItem:K}=In(),j=c(()=>{if($)return L&&JSON.stringify(Xt(L))===JSON.stringify(Xt($))?L:E?.find(e=>JSON.stringify(Xt(e))===JSON.stringify(Xt($)))},[$,E,L]);o(()=>{N&&j?K(j):z()},[N,j]);const B=c(()=>{const e=j?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===ve.Loading,containers:j?.containers||[]}},[j]),U=c(()=>!!j?.rollbackOccurred,[j?.rollbackOccurred]),H=c(()=>{const e=[{label:hs.Overview,onClick:()=>M(hs.Overview),selected:O===hs.Overview}];return S||(ms.includes(j?.kind)&&e.push({label:hs.Pods,onClick:()=>M(hs.Pods),selected:O===hs.Pods}),j?.containers?.some(({language:e})=>fs.includes(e))&&e.push({label:hs.Libraries,onClick:()=>M(hs.Libraries),selected:O===hs.Libraries}),e.push({label:hs.PeerSources,onClick:()=>M(hs.PeerSources),selected:O===hs.PeerSources}),v&&y&&b&&x&&e.push({label:hs.Profiling,onClick:()=>M(hs.Profiling),selected:O===hs.Profiling})),e},[O,j,S,v,y,b,x]),q=gs.includes(j?.kind),[G,Y]=i({openFor:null,workloadId:void 0,podNamespace:void 0,podName:void 0});if(!j)return null;return e(to,{ref:T,width:O===hs.Profiling?1200:void 0,onClose:()=>{M(hs.Overview),F(null)},title:j.otelServiceName||j.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:Ln(j.containers),isEdit:D,isFormDirty:I,onEdit:O===hs.Overview?e=>{A("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=P.otelServiceName!==j.name?P.otelServiceName:"";_("otelServiceName",e),await r($,{...P,otelServiceName:e}),F(null),R(!1),A(!1)},onDelete:O===hs.Overview?async()=>{const{namespace:e}=j;a({[e]:[{...j,selected:!1,currentStreamName:w}]},{}),F(null),R(!1),A(!1),T.current?.closeDrawer()}:void 0,onCancel:()=>{R(!1),A(!1),_("otelServiceName",j.otelServiceName||j.name||"")},isLastItem:1===E.length,tabs:H,headerActionButtons:S?[]:q?[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>Y({openFor:bs.Workload,workloadId:$}),children:e(n,{children:[t(li,{}),t(W,{size:14,family:"secondary",decoration:"underline",children:"Restart"})]})}]:[],children:[O===hs.Overview?D?t(vs,{children:t(ns,{formData:P,handleFormChange:(...e)=>{R(!0),_(...e),_("currentStreamName",w)}})}):e(ys,{children:[t(is,{workloadOdigosHealthStatus:j.workloadOdigosHealthStatus}),U&&t(de,{type:ue.Warning,message:f.ROLLBACK_OCCURRED_MESSAGE,action:{label:f.ROLLBACK_RECOVER,onClick:async()=>{await g($);const e=await d($);e&&F(e)}}}),t(te,{conditions:j.conditions||[]}),t(ne,{title:f.SOURCE_DETAILS,data:j?es(j,S):[]}),t(ne,{title:S?f.DETECTED_PROCESSES:f.DETECTED_CONTAINERS,titleBadge:B.isLoading?ve.Loading:B.containers.length,description:B.description||(S?f.DETECTED_PROCESSES_DESCRIPTION:f.DETECTED_CONTAINERS_DESCRIPTION),children:B.containers.map(e=>t(Mn,{...e,callbackRuntimeOverride:e=>r($,e)},`source-container-${e.containerName}`))}),j.manifestYAML&&t(Ai,{title:`${j.kind} YAML`,yaml:j.manifestYAML,defaultOpen:!j.instrumentationConfigYAML}),j.instrumentationConfigYAML&&t(Ai,{title:"Instrumentation Config YAML",yaml:j.instrumentationConfigYAML,defaultOpen:!j.manifestYAML})]}):O===hs.Pods?t(os,{source:j,fetchSourceDescribe:u,onClickRestartPod:q?(e,t)=>Y({openFor:bs.Pod,podNamespace:e,podName:t}):void 0}):O===hs.Libraries?t(rs,{source:j,fetchSourceLibraries:p}):O===hs.PeerSources?t(ps,{source:j,fetchPeerSources:h}):O===hs.Profiling&&v&&y&&b&&x?t(Zl,{source:j,fetchProfilingSlots:v,enableProfiling:y,releaseProfiling:b,fetchSourceProfiling:x}):null,t(Yt,{isOpen:!!G.openFor,title:`Rollout Restart ${G.openFor}`,description:`Are you sure you want to rollout restart this ${G.openFor?.toLowerCase()}?`,approveButton:{text:"Confirm",variant:ue.Warning,onClick:()=>{G.openFor===bs.Workload&&G.workloadId?s([G.workloadId]):G.openFor===bs.Pod&&G.podNamespace&&G.podName&&m(G.podNamespace,G.podName),Y({openFor:null})}},denyButton:{text:"Go Back",onClick:()=>{Y({openFor:null})}}})]})},Ss=h.div`
542
636
  max-width: ${({$fullWidth:e})=>e?"unset":"420px"};
543
637
  width: 100%;
544
- `,Os=r(({isModal:n,fetchNamespacesWithWorkloads:i,onClickSummary:a},o)=>{const r=h(),{isVm:s}=ae(),c=Cn({fetchNamespacesWithWorkloads:i}),{selectedSources:d,loading:u,selectedAllNamespaces:p,onSelectAllNamespaces:m,getApiSourcesPayload:y,getApiFutureAppsPayload:v,searchText:f,setSearchText:b,searchBy:S,setSearchBy:x,showSelectedOnly:C,setShowSelectedOnly:N,showRunningOnly:k,setShowRunningOnly:T}=c;l(o,()=>({getFormValues:()=>({apps:y(),futureApps:v()})}));const $=Object.values(d).reduce((e,t)=>e+t.filter(e=>e.selected).length,0);return t(le,{$isNotModal:!n,children:e(I,{$gap:12,children:[e(I,{$gap:24,children:[a&&t(ft,{onClick:a}),t(P,{title:g.SELECT_SOURCES,badgeLabel:$,description:g.SELECT_SOURCES_DESCRIPTION}),e(O,{$justifyContent:"space-between",children:[t(Is,{$fullWidth:s,children:t(E,{placeholder:S===J.Source?g.SEARCH_SOURCES:g.SEARCH_NAMESPACES,icon:zn,value:f,onChange:e=>b(e.target.value.toLowerCase())})}),!s&&t(F,{options:[{label:g.SOURCE,value:J.Source,selectedBgColor:r.text.secondary,selectedTextColor:r.text.primary},{label:g.NAMESPACE,value:J.Namespace,selectedBgColor:r.text.secondary,selectedTextColor:r.text.primary}],selected:S,setSelected:x})]}),e(O,{$gap:36,children:[t(w,{title:g.SELECT_ALL,initialValue:p,onChange:m,disabled:u}),t(w,{title:g.ONLY_SELECTED,initialValue:C,onChange:N}),t(w,{title:g.ONLY_RUNNING_INSTANCES,initialValue:k,onChange:T})]})]}),t(A,{}),t(is,{isModal:n,...c})]})})});Os.displayName=Os.name;const Rs=({fetchNamespacesWithWorkloads:e,persistSources:n})=>{const{currentModal:i,setCurrentModal:a}=oe(),o=i===J.Source,r=()=>{a("")},l=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();n(e,t),r()}},c=s(null);return B({key:"Enter",active:o},l),o?t(se,{isOpen:o,onClose:r,header:{title:"Add Source"},actionComponent:t(me,{buttons:[{label:"DONE",variant:"primary",onClick:l}]}),children:t(Os,{ref:c,isModal:!0,fetchNamespacesWithWorkloads:e})}):null},Ls=e=>{const t=[{key:"checkbox-and-icon",title:""},{key:"name",title:g.NAME,sortable:!0},{key:"kind",title:"Kind",sortable:!0}];return e||t.push({key:"namespace",title:g.NAMESPACE,sortable:!0}),t.push({key:"containers",title:g.DETECTED_CONTAINERS}),t.push({key:"conditions",title:"Conditions"}),t.push({key:"throughput",title:"Throughput",sortable:!0}),t},Ms=({metrics:n,maxHeight:i,maxWidth:a})=>{const o=h(),{isVm:r}=ae(),s=Se(),{selectedStreamName:l}=Ye(),{sources:u,sourcesLoading:p}=Y(),{setDrawerType:m,setDrawerEntityId:y}=U(),{selectedSources:v,setSelectedSources:f}=Pe(),{progress:b}=qe(),S=c(()=>b[Ge.Instrumenting]||b[Ge.Uninstrumenting]?b[Ge.Instrumenting]?.percentage||b[Ge.Uninstrumenting]?.percentage||0:void 0,[b[Ge.Instrumenting],b[Ge.Uninstrumenting]]),C=c(()=>Qe(u,l),[u,l]),E=c(()=>Ji({instrumentationRules:[],sources:et(C,s),actions:[],destinations:[],searchText:s.searchText,selectedCategory:J.Source}).searchResults.find(({category:e})=>e===J.Source)?.entities||[],[C,s]),[N,k]=c(()=>{let e=0;return Object.values(v).forEach(t=>{e+=t.length}),[0!==e,e]},[v]),T=d(e=>{if(e){const e={};E.forEach(t=>{const{namespace:n}=t;e[n]?e[n].push(t):e[n]=[t]}),f(e)}else f({})},[E]),w=d(e=>{const{namespace:t,name:n,kind:i}=e,a={...v};a[t]||(a[t]=[]);const o=a[t].findIndex(e=>e.name===n&&e.kind===i);-1===o?a[t].push(e):a[t].splice(o,1),f(a)},[v]),$=c(()=>E.map(i=>{const a=Yt(i),r=JSON.stringify(a),{hasErrors:s,hasWarnings:l,hasDisableds:c}=he(i.conditions||[]),d=!!v[a.namespace]?.find(e=>e.namespace===a.namespace&&e.name===a.name&&e.kind===a.kind);return{status:s?de.Error:l?de.Warning:void 0,faded:c,onClick:()=>{m(J.Source),y(a)},cells:[{columnKey:"checkbox-and-icon",component:()=>e(O,{$gap:16,children:[t(x,{value:d,onChange:()=>w(i)}),t(En,{icons:He(i),id:r})]})},{columnKey:"name",value:Ee(i,J.Source,{extended:!0})},{columnKey:"kind",value:i.kind,textColor:o.text.info},{columnKey:"namespace",value:i.namespace,textColor:o.text.info},{columnKey:"throughput",value:Ue(Lt(n,J.Source,a).throughput),textColor:o.text.info},{columnKey:"conditions",component:()=>t(qi,{conditions:i.conditions||[],id:r})},{columnKey:"containers",component:()=>t("div",{style:{lineHeight:1},children:t(ge,{status:de.Info,title:Nn(i.containers),withBorder:!0})})}]}}),[E,v,n,w]),{badge:D,badgeTooltip:A}=c(()=>E.length!==C.length?{badge:`${E.length}/${C.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:C.length,badgeTooltip:void 0},[E,C]);return e(ke,{$maxWidth:a,children:[e(Te,{children:[t(x,{partiallyChecked:N&&E?.length!==k,value:N&&E?.length===k,onChange:T,disabled:!E?.length}),t(we,{icon:$e(J.Source),title:g.SOURCES,badge:D,badgeTooltip:A,loading:p||"number"==typeof S})]}),t(De,{$maxHeight:i,children:t(Ae,{columns:Ls(r),rows:$})}),"number"!=typeof S||$.length?$.length?null:t(Ie,{style:{marginTop:"2rem"},children:t(Oe,{})}):e(Ie,{style:{marginTop:"2rem",gap:"24px"},children:[t(Re,{width:420}),e(O,{$gap:16,children:[e(z,{color:o.text.info,children:[b[Ge.Instrumenting]?"Instrumenting":"Uninstrumenting"," workloads..."]}),t(Le,{label:`${S}%`})]})]})]})},Fs=({expiresAt:t})=>{const n=h(),{formatTimeAgo:i}=Xt(),a=i(t),o=new Date(t).toDateString().split(" ").slice(1).join(" "),r=kn(t,0)?n.text.error:kn(t,6048e5)?n.text.warning:n.text.success;return e(z,{size:14,color:r,children:[a," (",o,")"]})},_s=p.div`
638
+ `,Cs=r(({isModal:n,fetchNamespacesWithWorkloads:i,onClickSummary:o},a)=>{const r=g(),{isVm:l}=ae(),c=Fn({fetchNamespacesWithWorkloads:i}),{selectedSources:d,loading:u,selectedAllNamespaces:p,onSelectAllNamespaces:h,getApiSourcesPayload:m,getApiFutureAppsPayload:v,searchText:y,setSearchText:b,searchBy:x,setSearchBy:S,showSelectedOnly:C,setShowSelectedOnly:w,showRunningOnly:$,setShowRunningOnly:E}=c;s(a,()=>({getFormValues:()=>({apps:m(),futureApps:v()})}));const T=Object.values(d).reduce((e,t)=>e+t.filter(e=>e.selected).length,0);return t(ce,{$isNotModal:!n,children:e(R,{$gap:12,children:[e(R,{$gap:24,children:[o&&t(bt,{onClick:o}),t(z,{title:f.SELECT_SOURCES,badgeLabel:T,description:f.SELECT_SOURCES_DESCRIPTION}),e(O,{$justifyContent:"space-between",children:[t(Ss,{$fullWidth:l,children:t(k,{placeholder:x===J.Source?f.SEARCH_SOURCES:f.SEARCH_NAMESPACES,icon:ti,value:y,onChange:e=>b(e.target.value.toLowerCase())})}),!l&&t(P,{options:[{label:f.SOURCE,value:J.Source,selectedBgColor:r.text.secondary,selectedTextColor:r.text.primary},{label:f.NAMESPACE,value:J.Namespace,selectedBgColor:r.text.secondary,selectedTextColor:r.text.primary}],selected:x,setSelected:S})]}),e(O,{$gap:36,children:[t(N,{title:f.SELECT_ALL,initialValue:p,onChange:h,disabled:u}),t(N,{title:f.ONLY_SELECTED,initialValue:C,onChange:w}),t(N,{title:f.ONLY_RUNNING_INSTANCES,initialValue:$,onChange:E})]})]}),t(I,{}),t(bl,{isModal:n,...c})]})})});Cs.displayName=Cs.name;const ws=({fetchNamespacesWithWorkloads:e,persistSources:n})=>{const{currentModal:i,setCurrentModal:o}=re(),a=i===J.Source,r=()=>{o("")},s=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();n(e,t),r()}},c=l(null);return U({key:"Enter",active:a},s),a?t(se,{isOpen:a,onClose:r,header:{title:"Add Source"},actionComponent:t(me,{buttons:[{label:"DONE",variant:"primary",onClick:s}]}),children:t(Cs,{ref:c,isModal:!0,fetchNamespacesWithWorkloads:e})}):null},ks=e=>{const t=[{key:"checkbox-and-icon",title:""},{key:"name",title:f.NAME,sortable:!0},{key:"kind",title:"Kind",sortable:!0}];return e||t.push({key:"namespace",title:f.NAMESPACE,sortable:!0}),t.push({key:"containers",title:f.DETECTED_CONTAINERS}),t.push({key:"conditions",title:"Conditions"}),t.push({key:"throughput",title:"Throughput",sortable:!0}),t},$s=({metrics:n,maxHeight:i,maxWidth:o})=>{const a=g(),{isVm:r}=ae(),l=Se(),{selectedStreamName:s}=Xe(),{sources:u,sourcesLoading:p}=X(),{setDrawerType:h,setDrawerEntityId:m}=V(),{selectedSources:v,setSelectedSources:y}=ze(),{progress:b}=Ge(),x=c(()=>b[Ye.Instrumenting]||b[Ye.Uninstrumenting]?b[Ye.Instrumenting]?.percentage||b[Ye.Uninstrumenting]?.percentage||0:void 0,[b[Ye.Instrumenting],b[Ye.Uninstrumenting]]),S=c(()=>Ze(u,s),[u,s]),w=c(()=>po({instrumentationRules:[],sources:tt(S,l),actions:[],destinations:[],searchText:l.searchText,selectedCategory:J.Source}).searchResults.find(({category:e})=>e===J.Source)?.entities||[],[S,l]),[k,$]=c(()=>{let e=0;return Object.values(v).forEach(t=>{e+=t.length}),[0!==e,e]},[v]),E=d(e=>{if(e){const e={};w.forEach(t=>{const{namespace:n}=t;e[n]?e[n].push(t):e[n]=[t]}),y(e)}else y({})},[w]),T=d(e=>{const{namespace:t,name:n,kind:i}=e,o={...v};o[t]||(o[t]=[]);const a=o[t].findIndex(e=>e.name===n&&e.kind===i);-1===a?o[t].push(e):o[t].splice(a,1),y(o)},[v]),N=c(()=>w.map(i=>{const o=Xt(i),r=JSON.stringify(o),{hasErrors:l,hasWarnings:s,hasDisableds:c}=ge(i.conditions||[]),d=!!v[o.namespace]?.find(e=>e.namespace===o.namespace&&e.name===o.name&&e.kind===o.kind);return{status:l?ue.Error:s?ue.Warning:void 0,faded:c,onClick:()=>{h(J.Source),m(o)},cells:[{columnKey:"checkbox-and-icon",component:()=>e(O,{$gap:16,children:[t(C,{value:d,onChange:()=>T(i)}),t(Pn,{icons:qe(i),id:r})]})},{columnKey:"name",value:ke(i,J.Source,{extended:!0})},{columnKey:"kind",value:i.kind,textColor:a.text.info},{columnKey:"namespace",value:i.namespace,textColor:a.text.info},{columnKey:"throughput",value:Ve(Lt(n,J.Source,o).throughput),textColor:a.text.info},{columnKey:"conditions",component:()=>t(co,{conditions:i.conditions||[],id:r})},{columnKey:"containers",component:()=>t("div",{style:{lineHeight:1},children:t(fe,{status:ue.Info,title:_n(i.containers),withBorder:!0})})}]}}),[w,v,n,T]),{badge:D,badgeTooltip:A}=c(()=>w.length!==S.length?{badge:`${w.length}/${S.length}`,badgeTooltip:f.FILTERED_COUNT_TOOLTIP}:{badge:S.length,badgeTooltip:void 0},[w,S]);return e(Ee,{$maxWidth:o,children:[e(Te,{children:[t(C,{partiallyChecked:k&&w?.length!==$,value:k&&w?.length===$,onChange:E,disabled:!w?.length}),t(Ne,{icon:De(J.Source),title:f.SOURCES,badge:D,badgeTooltip:A,loading:p||"number"==typeof x})]}),t(Ae,{$maxHeight:i,children:t(Ie,{columns:ks(r),rows:N})}),"number"!=typeof x||N.length?N.length?null:t(Re,{style:{marginTop:"2rem"},children:t(Oe,{})}):e(Re,{style:{marginTop:"2rem",gap:"24px"},children:[t(Me,{width:420}),e(O,{$gap:16,children:[e(W,{color:a.text.info,children:[b[Ye.Instrumenting]?"Instrumenting":"Uninstrumenting"," workloads..."]}),t(Le,{label:`${x}%`})]})]})]})},Es=({expiresAt:t})=>{const n=g(),{formatTimeAgo:i}=Qt(),o=i(t),a=new Date(t).toDateString().split(" ").slice(1).join(" "),r=zn(t,0)?n.text.error:zn(t,6048e5)?n.text.warning:n.text.success;return e(W,{size:14,color:r,children:[o," (",a,")"]})},Ts=h.div`
545
639
  position: relative;
546
- `,Ps=({token:n,saveToken:a})=>{const{CopyButton:o}=Tn(),{formData:r,handleFormChange:s,resetFormData:l}=wn({token:n}),[c,d]=i(!1),u=()=>{d(!1),l()};return e(O,{$gap:0,children:[t(o,{value:n,size:$n.L}),t(A,{orientation:"vertical",length:"12px"}),e(_s,{children:[t(R,{size:32,onClick:()=>{d(!0)},children:t(Pn,{})}),c&&t(Dn,{flipX:!0,clientX:36,isOpen:c,onClose:u,onSave:()=>{a(r.token).then(u)},title:"Enter a new API Token",titleTooltip:"Contact us to generate a new one",children:t(E,{placeholder:"API Token",type:"password",value:r.token,onChange:e=>s("token",e.target.value)})})]})]})},Ks=({tokens:e,saveToken:n})=>t(te,{title:"Authorization Tokens",titleBadge:e.length,data:[{type:y.Table,value:{columns:[{key:"icon",title:""},{key:"name",title:"Name"},{key:"expires_at",title:"Expires"},{key:"token",title:"Token"},{key:"actions",title:""}],rows:e.map(({name:e,token:i,expiresAt:a})=>({cells:[{columnKey:"icon",icon:ri},{columnKey:"name",value:e},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>t(Fs,{expiresAt:a})},{columnKey:"actions",component:()=>t(Ps,{token:i,saveToken:n})}]}))}}]}),js=({fetchDescribeOdigos:o})=>{const[r,s]=i(null);if(a(()=>{o().then(({data:e})=>s(e?.describeOdigos||null))},[]),!r)return t(Ie,{children:t(Fe,{})});const l=e=>e?.name?[t(A,{},`divider-${e.name}`),t(un,{title:e.name,subTitle:e.explain||void 0,value:{status:e.status||(gn(e.value)?yn(e.value)?de.Success:de.Error:de.Default),text:e.value}},`describe-row-${e.name}`)]:[];return e(n,{children:[t(te,{title:"General Information",withExtend:!0,initialExtended:!0,data:[{title:r?.odigosVersion?.name,value:r?.odigosVersion?.value},{title:r?.kubernetesVersion?.name,value:r?.kubernetesVersion?.value},{title:r?.installationMethod?.name,value:r?.installationMethod?.value},{title:r?.tier?.name,value:r?.tier?.value},{title:"# of sources",value:r?.numberOfSources?.toString()},{title:"# of destinations",value:r?.numberOfDestinations?.toString()}]}),t(te,{title:"Cluster Collector",withExtend:!0,children:Object.values(r?.clusterCollector||{}).map(l)}),t(te,{title:"Node Collector",withExtend:!0,children:Object.values(r?.nodeCollector||{}).map(l)})]})},Vs=p.div`
640
+ `,Ns=({token:n,saveToken:o})=>{const{CopyButton:a}=mn(),{formData:r,handleFormChange:l,resetFormData:s}=Kn({token:n}),[c,d]=i(!1),u=()=>{d(!1),s()};return e(O,{$gap:0,children:[t(a,{value:n,size:jn.L}),t(I,{orientation:"vertical",length:"12px"}),e(Ts,{children:[t(M,{size:32,onClick:()=>{d(!0)},children:t(Xn,{})}),c&&t(Bn,{flipX:!0,clientX:36,isOpen:c,onClose:u,onSave:()=>{o(r.token).then(u)},title:"Enter a new API Token",titleTooltip:"Contact us to generate a new one",children:t(k,{placeholder:"API Token",type:"password",value:r.token,onChange:e=>l("token",e.target.value)})})]})]})},Ds=({tokens:e,saveToken:n})=>t(ne,{title:"Authorization Tokens",titleBadge:e.length,data:[{type:v.Table,value:{columns:[{key:"icon",title:""},{key:"name",title:"Name"},{key:"expires_at",title:"Expires"},{key:"token",title:"Token"},{key:"actions",title:""}],rows:e.map(({name:e,token:i,expiresAt:o})=>({cells:[{columnKey:"icon",icon:Ci},{columnKey:"name",value:e},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>t(Es,{expiresAt:o})},{columnKey:"actions",component:()=>t(Ns,{token:i,saveToken:n})}]}))}}]}),As=({fetchDescribeOdigos:a})=>{const[r,l]=i(null);if(o(()=>{a().then(({data:e})=>l(e?.describeOdigos||null))},[]),!r)return t(Re,{children:t(Pe,{})});const s=e=>e?.name?[t(I,{},`divider-${e.name}`),t($n,{title:e.name,subTitle:e.explain||void 0,value:{status:e.status||(Dn(e.value)?An(e.value)?ue.Success:ue.Error:ue.Default),text:e.value}},`describe-row-${e.name}`)]:[];return e(n,{children:[t(ne,{title:"General Information",withExtend:!0,initialExtended:!0,data:[{title:r?.odigosVersion?.name,value:r?.odigosVersion?.value},{title:r?.kubernetesVersion?.name,value:r?.kubernetesVersion?.value},{title:r?.installationMethod?.name,value:r?.installationMethod?.value},{title:r?.tier?.name,value:r?.tier?.value},{title:"# of sources",value:r?.numberOfSources?.toString()},{title:"# of destinations",value:r?.numberOfDestinations?.toString()}]}),t(ne,{title:"Cluster Collector",withExtend:!0,children:Object.values(r?.clusterCollector||{}).map(s)}),t(ne,{title:"Node Collector",withExtend:!0,children:Object.values(r?.nodeCollector||{}).map(s)})]})},Is=h.div`
547
641
  display: flex;
548
642
  flex-direction: column;
549
643
  gap: 12px;
550
- `,zs="System Overview",Us=({tokens:a,saveToken:o,fetchDescribeOdigos:r})=>{const[s,l]=i(!1),c=()=>l(e=>!e);return e(n,{children:[t(R,{onClick:c,tooltip:zs,children:t(si,{size:18})},zs),t(H,{width:"750px",isOpen:s,onClose:c,header:{icons:[si],title:zs},footer:{isOpen:!1},children:e(Vs,{children:[!!a?.length&&t(Ks,{tokens:a,saveToken:o}),t(js,{fetchDescribeOdigos:r})]})})]})},Bs=p.div`
644
+ `,Rs="System Overview",Os=({tokens:o,saveToken:a,fetchDescribeOdigos:r})=>{const[l,s]=i(!1),c=()=>s(e=>!e);return e(n,{children:[t(M,{onClick:c,tooltip:Rs,children:t(wi,{size:18})},Rs),t(q,{width:"750px",isOpen:l,onClose:c,header:{icons:[wi],title:Rs},footer:{isOpen:!1},children:e(Is,{children:[!!o?.length&&t(Ds,{tokens:o,saveToken:a}),t(As,{fetchDescribeOdigos:r})]})})]})},Ms=h.div`
551
645
  position: fixed;
552
646
  bottom: 12px;
553
647
  left: 12px;
@@ -556,7 +650,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
556
650
  flex-direction: column-reverse;
557
651
  gap: 6px;
558
652
  max-width: 600px;
559
- `,Ws=()=>{const{notifications:e,markAsDismissed:n,markAsSeen:i}=Bt(),{onClickNotification:a}=Qt();return t(Bs,{children:e.filter(({dismissed:e})=>!e).map(({id:e,type:o,title:r,message:s,crdType:l,target:c})=>t(ce,{id:e,type:o,title:r,message:s,action:l&&c?{label:"go to details",onClick:()=>a({id:e,crdType:l,target:c},{dismissToast:!0})}:void 0,onClose:()=>(({id:e,asSeen:t})=>{n(e),i(e)})({id:e,asSeen:!0})},`toast-${e}`))})},Hs=p.div`
653
+ `,Ls=()=>{const{notifications:e,markAsDismissed:n,markAsSeen:i}=Ut(),{onClickNotification:o}=Zt();return t(Ms,{children:e.filter(({dismissed:e})=>!e).map(({id:e,type:a,title:r,message:l,crdType:s,target:c})=>t(de,{id:e,type:a,title:r,message:l,action:s&&c?{label:"go to details",onClick:()=>o({id:e,crdType:s,target:c},{dismissToast:!0})}:void 0,onClose:()=>(({id:e,asSeen:t})=>{n(e),i(e)})({id:e,asSeen:!0})},`toast-${e}`))})},Fs=h.div`
560
654
  position: relative;
561
655
  display: flex;
562
656
  align-items: center;
@@ -575,7 +669,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
575
669
  stroke: ${({theme:e})=>e.text.secondary};
576
670
  }
577
671
  }
578
- `,qs=p.div`
672
+ `,Ps=h.div`
579
673
  position: absolute;
580
674
  top: 2px;
581
675
  left: ${({$darkMode:e})=>e?"2px":"calc(100% - 2px - 24px)"};
@@ -585,50 +679,50 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
585
679
  background-color: ${({theme:e})=>e.colors.border};
586
680
  border-radius: 100%;
587
681
  transition: all 0.3s;
588
- `,Gs=({path:e})=>t("svg",{width:16,height:16,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"none",children:t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})}),Js=()=>{const{darkMode:n,setDarkMode:i}=An();return e(Hs,{onClick:()=>i(!n),children:[t(Gs,{path:"M14 7.977A4.333 4.333 0 1 1 8.023 2H8a6 6 0 1 0 6 6v-.023Z"}),t(Gs,{path:"M8 15.333v-.666m-5.185-1.482.471-.471M.666 8h.667m1.482-5.185.471.47M8 1.334V.667m4.714 2.619.471-.471M14.667 8h.666m-2.619 4.714.471.471M12 8a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"}),t(qs,{$darkMode:n})]})},Ys=e=>{const{spans:t}=e,n=new Map;t.forEach(e=>{n.set(e.spanID,{...e,spans:[]})});const i=[];return t.forEach(e=>{const t=n.get(e.spanID);let a=!1;if(e.references.length){const t=e.references.find(e=>"CHILD_OF"===e.refType);t&&t.spanID&&n.has(t.spanID)||(a=!0)}else a=!0;if(a)i.push(t);else{const i=e.references.find(e=>"CHILD_OF"===e.refType);if(i){const e=n.get(i.spanID);e&&(e.spans=e.spans||[],e.spans.push(t),e.spans=e.spans.sort((e,t)=>e.startTime-t.startTime))}}}),i.sort((e,t)=>e.startTime-t.startTime)},Xs=(e,t)=>{const{tags:n}=e,i={},a=[];return n.forEach(e=>{i[e.key]=e.value}),a.push({type:y.Code,value:{language:"json",code:JSON.stringify(i,null,2),pretty:t}}),a},Qs=e=>{const{logs:t}=e,n=[];return t.forEach((e,i)=>{e.fields.forEach(e=>{n.push({title:e.key,value:e.value})}),i!==t.length-1&&n.push({type:y.Divider})}),n},Zs=e=>{const{traceID:t,spanID:n,processID:i,operationName:a,duration:o,startTime:r,warnings:s}=e,l=[];return l.push({type:y.CopyText,title:"Trace ID",value:t}),l.push({type:y.CopyText,title:"Span ID",value:n}),l.push({type:y.Divider}),l.push({title:"Service",value:i}),l.push({title:"Operation",value:a}),l.push({title:"Duration",value:In(o)}),l.push({title:"Start time",value:new Date(r/1e3).toLocaleString()}),s.length&&(l.push({type:y.Divider}),l.push({title:"Warnings",titleIcon:li,value:s})),l},el=(e,t)=>{const{tags:n}=e,i={},a=[];return n.forEach(e=>{i[e.key]=e.value}),a.push({type:y.Code,value:{language:"json",code:JSON.stringify(i,null,2),pretty:t}}),a},tl=p.div`
682
+ `,_s=({path:e})=>t("svg",{width:16,height:16,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"none",children:t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})}),zs=()=>{const{darkMode:n,setDarkMode:i}=Wn();return e(Fs,{onClick:()=>i(!n),children:[t(_s,{path:"M14 7.977A4.333 4.333 0 1 1 8.023 2H8a6 6 0 1 0 6 6v-.023Z"}),t(_s,{path:"M8 15.333v-.666m-5.185-1.482.471-.471M.666 8h.667m1.482-5.185.471.47M8 1.334V.667m4.714 2.619.471-.471M14.667 8h.666m-2.619 4.714.471.471M12 8a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"}),t(Ps,{$darkMode:n})]})},Ks=e=>{const{spans:t}=e,n=new Map;t.forEach(e=>{n.set(e.spanID,{...e,spans:[]})});const i=[];return t.forEach(e=>{const t=n.get(e.spanID);let o=!1;if(e.references.length){const t=e.references.find(e=>"CHILD_OF"===e.refType);t&&t.spanID&&n.has(t.spanID)||(o=!0)}else o=!0;if(o)i.push(t);else{const i=e.references.find(e=>"CHILD_OF"===e.refType);if(i){const e=n.get(i.spanID);e&&(e.spans=e.spans||[],e.spans.push(t),e.spans=e.spans.sort((e,t)=>e.startTime-t.startTime))}}}),i.sort((e,t)=>e.startTime-t.startTime)},js=(e,t)=>{const{tags:n}=e,i={},o=[];return n.forEach(e=>{i[e.key]=e.value}),o.push({type:v.Code,value:{language:"json",code:JSON.stringify(i,null,2),pretty:t}}),o},Bs=e=>{const{logs:t}=e,n=[];return t.forEach((e,i)=>{e.fields.forEach(e=>{n.push({title:e.key,value:e.value})}),i!==t.length-1&&n.push({type:v.Divider})}),n},Ws=e=>{const{traceID:t,spanID:n,processID:i,operationName:o,duration:a,startTime:r,warnings:l}=e,s=[];return s.push({type:v.CopyText,title:"Trace ID",value:t}),s.push({type:v.CopyText,title:"Span ID",value:n}),s.push({type:v.Divider}),s.push({title:"Service",value:i}),s.push({title:"Operation",value:o}),s.push({title:"Duration",value:Vn(a)}),s.push({title:"Start time",value:new Date(r/1e3).toLocaleString()}),l.length&&(s.push({type:v.Divider}),s.push({title:"Warnings",titleIcon:ki,value:l})),s},Vs=(e,t)=>{const{tags:n}=e,i={},o=[];return n.forEach(e=>{i[e.key]=e.value}),o.push({type:v.Code,value:{language:"json",code:JSON.stringify(i,null,2),pretty:t}}),o},Us=h.div`
589
683
  display: flex;
590
684
  flex-direction: column;
591
685
  gap: 12px;
592
686
  max-height: 100vh;
593
687
  overflow-y: auto;
594
- `,nl=({span:n,process:a,onClose:o})=>{const[r,s]=i(!0),[l,c]=i(!0);return t(H,{width:"750px",isOpen:!0,onClose:o,header:{icons:[ci],title:n.operationName},footer:{isOpen:!1},children:e(tl,{children:[t(te,{title:"Details",data:Zs(n)}),n.logs.length>0&&t(te,{title:"Errors",titleBadge:n.logs.length,titleIcon:li,data:Qs(n)}),t(te,{title:"Tags",data:Xs(n,r),action:t(On,{isPrettyMode:r,setIsPrettyMode:s})}),a&&t(te,{title:`Process (${a.serviceName})`,data:el(a,l),action:t(On,{isPrettyMode:l,setIsPrettyMode:c})})]})})},il=370,al=["#33DCA7","#50F6E8","#444AD9","#8B55FF","#FF7CA9"].reverse(),ol=p.div`
688
+ `,Hs=({span:n,process:o,onClose:a})=>{const[r,l]=i(!0),[s,c]=i(!0);return t(q,{width:"750px",isOpen:!0,onClose:a,header:{icons:[$i],title:n.operationName},footer:{isOpen:!1},children:e(Us,{children:[t(ne,{title:"Details",data:Ws(n)}),n.logs.length>0&&t(ne,{title:"Errors",titleBadge:n.logs.length,titleIcon:ki,data:Bs(n)}),t(ne,{title:"Tags",data:js(n,r),action:t(Un,{isPrettyMode:r,setIsPrettyMode:l})}),o&&t(ne,{title:`Process (${o.serviceName})`,data:Vs(o,s),action:t(Un,{isPrettyMode:s,setIsPrettyMode:c})})]})})},qs=370,Gs=["#33DCA7","#50F6E8","#444AD9","#8B55FF","#FF7CA9"].reverse(),Ys=h.div`
595
689
  display: flex;
596
690
  align-items: center;
597
- width: ${il}px;
691
+ width: ${qs}px;
598
692
  background-color: ${({$withErrors:e,theme:t})=>e?t.colors.error+_["042"]:t.colors.dark_grey};
599
693
  &:hover {
600
694
  ${({$withErrors:e,$preventHover:t,theme:n})=>!t&&`background-color: ${e?n.colors.error:n.colors.secondary+_["010"]};`}
601
695
  cursor: ${({$preventHover:e})=>e?"default":"pointer"};
602
696
  }
603
- `,rl=p(O)`
697
+ `,Js=h(O)`
604
698
  align-items: center;
605
699
  justify-content: space-between;
606
700
  gap: 4px;
607
701
  padding: 12px;
608
702
  padding-left: ${({$depth:e})=>12*e||12}px;
609
- width: calc(${il}px - ${({$depth:e})=>12*e}px);
610
- `,sl=p(O)`
703
+ width: calc(${qs}px - ${({$depth:e})=>12*e}px);
704
+ `,Xs=h(O)`
611
705
  align-items: center;
612
706
  gap: 4px;
613
707
  position: absolute;
614
708
  right: 56px;
615
709
  width: calc(100% - ${434}px);
616
- `,ll=p.div`
710
+ `,Qs=h.div`
617
711
  position: absolute;
618
712
  left: ${({$startTime:e,$minStartTime:t,$maxEndTime:n})=>(e-t)/(n-t)*100+"%"};
619
713
  width: ${({$duration:e,$maxDuration:t})=>e/t*100+"%"};
620
714
  height: 12px;
621
715
  border-radius: 32px;
622
- background-color: ${({$indexInMatrix:e})=>al[e%al.length]};
623
- `,cl=p(z)`
716
+ background-color: ${({$indexInMatrix:e})=>Gs[e%Gs.length]};
717
+ `,Zs=h(W)`
624
718
  padding-left: calc(100% + 8px);
625
719
  font-size: 10px;
626
720
  color: ${({theme:e})=>e.text.darker_grey};
627
721
  font-family: ${({theme:e})=>e.font_family.secondary};
628
722
  white-space: nowrap;
629
- `,dl=({span:n,depth:a,indexInMatrix:o,maxDuration:r,minStartTime:s,maxEndTime:l,withErrors:c,errorTooltip:d,isOpen:u,withToggle:p,onToggleOpen:m,onSelect:g})=>{const y=h(),[v,f]=i(!1),b=il-12*a-20-(c?12:0),S=c&&(1===a||n.logs.length>0);return e(ol,{className:"span-container",$withErrors:c,$preventHover:v,onClick:g,children:[e(rl,{$depth:a,className:"span-left",children:[e(O,{$gap:4,$alignItems:"center",children:[t("div",p?{onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),children:t(R,{onClick:e=>{e.stopPropagation(),m?.()},size:24,children:t(vt,{extend:u??!1})})}:{style:{width:"24px"}}),t(Ln,{maxWidth:b/2,text:n.processID,textSize:14}),t(z,{size:12,color:y.text.darker_grey,children:"•"}),t(Ln,{maxWidth:b/2,text:n.operationName,textSize:12,textColor:y.text.darker_grey})]}),c&&(S?t(fe,{...d,children:t(li,{fill:y.text.error})}):t("div",{style:{position:"relative"},children:t("div",{style:{position:"absolute",top:"-24px",right:"8px"},children:t(A,{type:de.Error,orientation:"vertical",thickness:1,length:"48px",margin:"0",opacity:.5})})}))]}),t(sl,{className:"span-right",children:t(ll,{$indexInMatrix:o,$duration:n.duration,$maxDuration:r,$startTime:n.startTime,$minStartTime:s,$maxEndTime:l,children:t(cl,{children:In(n.duration)})})})]})},ul=({spans:n,logs:i,depth:a,indexInMatrix:o,maxDuration:r,minStartTime:s,maxEndTime:l,openSpanIdsState:c,selectedSpanState:d})=>{const u=h();return n.map((n,p)=>{const m=n.spanID,h=c.value.includes(m),g=!!n.spans?.length,y=i.length?i:Rn(n,"spans","logs"),v=y.length>0,f=v?y.length>1?`(${y.length}) errors`:y[0].fields.find(e=>"exception.message"===e.key)?.value:void 0,b=v?y.length>1?void 0:y[0].fields.find(e=>"exception.stacktrace"===e.key)?.value:void 0;return e("div",{style:{borderBottom:1===a?`1px dotted ${u.colors.border}`:"none"},children:[t(dl,{span:n,depth:a,indexInMatrix:o+p+a,maxDuration:r,minStartTime:s,maxEndTime:l,withErrors:v,errorTooltip:{titleIcon:li,title:f,text:b},isOpen:h,withToggle:g,onToggleOpen:()=>c.set(e=>e.some(e=>e===m)?e.filter(e=>e!=m):[...e,m,...Rn(n,"spans","spanID")]),onSelect:()=>d.set(e=>e?.spanID===m?null:n)}),h&&g?t(ul,{spans:n.spans||[],logs:y,depth:a+1,indexInMatrix:o+p,maxDuration:r,minStartTime:s,maxEndTime:l,openSpanIdsState:c,selectedSpanState:d}):null]},`span-${m}`)})},pl=p.div`
723
+ `,ec=({span:n,depth:o,indexInMatrix:a,maxDuration:r,minStartTime:l,maxEndTime:s,withErrors:c,errorTooltip:d,isOpen:u,withToggle:p,onToggleOpen:h,onSelect:m})=>{const f=g(),[v,y]=i(!1),b=qs-12*o-20-(c?12:0),x=c&&(1===o||n.logs.length>0);return e(Ys,{className:"span-container",$withErrors:c,$preventHover:v,onClick:m,children:[e(Js,{$depth:o,className:"span-left",children:[e(O,{$gap:4,$alignItems:"center",children:[t("div",p?{onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),children:t(M,{onClick:e=>{e.stopPropagation(),h?.()},size:24,children:t(yt,{extend:u??!1})})}:{style:{width:"24px"}}),t(qn,{maxWidth:b/2,text:n.processID,textSize:14}),t(W,{size:12,color:f.text.darker_grey,children:"•"}),t(qn,{maxWidth:b/2,text:n.operationName,textSize:12,textColor:f.text.darker_grey})]}),c&&(x?t(be,{...d,children:t(ki,{fill:f.text.error})}):t("div",{style:{position:"relative"},children:t("div",{style:{position:"absolute",top:"-24px",right:"8px"},children:t(I,{type:ue.Error,orientation:"vertical",thickness:1,length:"48px",margin:"0",opacity:.5})})}))]}),t(Xs,{className:"span-right",children:t(Qs,{$indexInMatrix:a,$duration:n.duration,$maxDuration:r,$startTime:n.startTime,$minStartTime:l,$maxEndTime:s,children:t(Zs,{children:Vn(n.duration)})})})]})},tc=({spans:n,logs:i,depth:o,indexInMatrix:a,maxDuration:r,minStartTime:l,maxEndTime:s,openSpanIdsState:c,selectedSpanState:d})=>{const u=g();return n.map((n,p)=>{const h=n.spanID,m=c.value.includes(h),g=!!n.spans?.length,f=i.length?i:Hn(n,"spans","logs"),v=f.length>0,y=v?f.length>1?`(${f.length}) errors`:f[0].fields.find(e=>"exception.message"===e.key)?.value:void 0,b=v?f.length>1?void 0:f[0].fields.find(e=>"exception.stacktrace"===e.key)?.value:void 0;return e("div",{style:{borderBottom:1===o?`1px dotted ${u.colors.border}`:"none"},children:[t(ec,{span:n,depth:o,indexInMatrix:a+p+o,maxDuration:r,minStartTime:l,maxEndTime:s,withErrors:v,errorTooltip:{titleIcon:ki,title:y,text:b},isOpen:m,withToggle:g,onToggleOpen:()=>c.set(e=>e.some(e=>e===h)?e.filter(e=>e!=h):[...e,h,...Hn(n,"spans","spanID")]),onSelect:()=>d.set(e=>e?.spanID===h?null:n)}),m&&g?t(tc,{spans:n.spans||[],logs:f,depth:o+1,indexInMatrix:a+p,maxDuration:r,minStartTime:l,maxEndTime:s,openSpanIdsState:c,selectedSpanState:d}):null]},`span-${h}`)})},nc=h.div`
630
724
  width: 100%;
631
- `,ml=p.div`
725
+ `,ic=h.div`
632
726
  max-height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
633
727
  overflow: auto;
634
728
 
@@ -638,22 +732,22 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useState
638
732
  border-radius: 24px;
639
733
  border: 1px solid ${({theme:e})=>e.colors.dropdown_bg_2};
640
734
  position: relative;
641
- `,hl=p.div`
735
+ `,oc=h.div`
642
736
  padding: 12px 12px 12px 24px;
643
- width: calc(${il}px - 36px);
737
+ width: calc(${qs}px - 36px);
644
738
  background-color: ${({theme:e})=>e.colors.dark_grey};
645
- `,gl=p.div`
739
+ `,ac=h.div`
646
740
  width: 1px;
647
741
  height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
648
742
  background: ${({theme:e})=>`linear-gradient(to bottom, ${e.colors.border}, transparent)`};
649
743
 
650
744
  position: absolute;
651
- left: calc(${il}px + ((100% - ${il}px) / ${5}) * ${({index:e})=>e});
652
- `,yl=p(z)`
745
+ left: calc(${qs}px + ((100% - ${qs}px) / ${5}) * ${({index:e})=>e});
746
+ `,rc=h(W)`
653
747
  color: ${({theme:e})=>e.text.darker_grey};
654
748
  font-size: 12px;
655
749
  font-family: ${({theme:e})=>e.font_family.secondary};
656
750
  padding-top: 12px;
657
751
  padding-left: 12px;
658
752
  white-space: nowrap;
659
- `,vl=({heightToRemove:a,traces:o,isLoading:r})=>{const[s,l]=i([]),[d,u]=i(null),p=c(()=>Dt(o).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:Ys(e)})),[o]),m=c(()=>p.reduce((e,t)=>Math.max(e,t.spans.reduce((e,t)=>e+t.duration,0)),0),[p]),h=c(()=>{const e=p.find(e=>e.spans.some(e=>e.spanID===d?.spanID)),t=e?.processes.find(e=>e.serviceName===d?.processID);return t},[p,d]);return e(n,{children:[t(pl,{$heightToRemove:a,children:r?t(Ie,{$height:"50vh",children:t(Fe,{scale:1.5})}):p.length?e(ml,{$heightToRemove:a,children:[t(hl,{children:t(z,{children:"Service & operation"})}),new Array(5).fill(null).map((e,n)=>t(gl,{$heightToRemove:a,index:n,children:t(yl,{children:In(m/5*n)})},`${n}-divider`)),p.map((e,n)=>{const{spans:i}=e,a=i.reduce((e,t)=>Math.min(e,t.startTime),Number.MAX_SAFE_INTEGER),o=i.reduce((e,t)=>Math.max(e,t.startTime+t.duration),0);return t(ul,{spans:i,logs:[],depth:1,indexInMatrix:n,maxDuration:m,minStartTime:a,maxEndTime:o,openSpanIdsState:{value:s,set:l},selectedSpanState:{value:d,set:u}},`recursive-spans-${e.traceID}`)})]}):t(Ie,{$height:"50vh",children:t(Oe,{title:g.NO_TRACES_FOUND,subTitle:g.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC})})}),d&&t(nl,{span:d,process:h,onClose:()=>u(null)})]})};export{Ui as ActionDrawer,Pi as ActionForm,Wi as ActionModal,Xi as ActionTable,na as AwaitPipeline,La as ConditionDropdown,Da as DataFlow,ro as DataFlowActionsMenu,Ya as DataStreamDrawer,Ga as DataStreamForm,lo as DataStreamModal,so as DataStreamSelectionForm,xo as DestinationDrawer,fo as DestinationForm,Fo as DestinationModal,Vo as DestinationSelectionForm,Uo as DestinationTable,Ma as ErrorDropdown,or as InstrumentationRuleDrawer,nr as InstrumentationRuleForm,lr as InstrumentationRuleModal,ur as InstrumentationRuleTable,Ka as KindDropdown,Fa as LanguageDropdown,_a as MonitorDropdown,mr as MultiSourceControl,Pa as NamespaceDropdown,ss as NavIconIds,br as NotificationManager,Ki as OverviewDrawer,ja as PodsAgentInjectionStatusDropdown,Gr as ServiceMap,rs as SetupSummary,ls as SideNav,cs as SlackInvite,As as SourceDrawer,ps as SourceForm,Rs as SourceModal,Os as SourceSelectionForm,Ms as SourceTable,Us as SystemOverview,qi as TableCellConditions,Ws as ToastList,Js as ToggleDarkMode,vl as TraceView};
753
+ `,lc=({heightToRemove:o,traces:a,isLoading:r})=>{const[l,s]=i([]),[d,u]=i(null),p=c(()=>At(a).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:Ks(e)})),[a]),h=c(()=>p.reduce((e,t)=>Math.max(e,t.spans.reduce((e,t)=>e+t.duration,0)),0),[p]),m=c(()=>{const e=p.find(e=>e.spans.some(e=>e.spanID===d?.spanID)),t=e?.processes.find(e=>e.serviceName===d?.processID);return t},[p,d]);return e(n,{children:[t(nc,{$heightToRemove:o,children:r?t(Re,{$height:"50vh",children:t(Pe,{scale:1.5})}):p.length?e(ic,{$heightToRemove:o,children:[t(oc,{children:t(W,{children:"Service & operation"})}),new Array(5).fill(null).map((e,n)=>t(ac,{$heightToRemove:o,index:n,children:t(rc,{children:Vn(h/5*n)})},`${n}-divider`)),p.map((e,n)=>{const{spans:i}=e,o=i.reduce((e,t)=>Math.min(e,t.startTime),Number.MAX_SAFE_INTEGER),a=i.reduce((e,t)=>Math.max(e,t.startTime+t.duration),0);return t(tc,{spans:i,logs:[],depth:1,indexInMatrix:n,maxDuration:h,minStartTime:o,maxEndTime:a,openSpanIdsState:{value:l,set:s},selectedSpanState:{value:d,set:u}},`recursive-spans-${e.traceID}`)})]}):t(Re,{$height:"50vh",children:t(Oe,{title:f.NO_TRACES_FOUND,subTitle:f.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC})})}),d&&t(Hs,{span:d,process:m,onClose:()=>u(null)})]})};export{ao as ActionDrawer,eo as ActionForm,lo as ActionModal,mo as ActionTable,bo as AwaitPipeline,Xo as ConditionDropdown,Ho as DataFlow,wa as DataFlowActionsMenu,ha as DataStreamDrawer,ua as DataStreamForm,$a as DataStreamModal,ka as DataStreamSelectionForm,Pa as DestinationDrawer,Ma as DestinationForm,Qa as DestinationModal,ir as DestinationSelectionForm,ar as DestinationTable,Qo as ErrorDropdown,Sr as InstrumentationRuleDrawer,yr as InstrumentationRuleForm,kr as InstrumentationRuleModal,Tr as InstrumentationRuleTable,na as KindDropdown,Zo as LanguageDropdown,ea as MonitorDropdown,Dr as MultiSourceControl,ta as NamespaceDropdown,wl as NavIconIds,Lr as NotificationManager,to as OverviewDrawer,ia as PodsAgentInjectionStatusDropdown,dl as ServiceMap,Cl as SetupSummary,kl as SideNav,$l as SlackInvite,xs as SourceDrawer,ns as SourceForm,ws as SourceModal,Cs as SourceSelectionForm,$s as SourceTable,Os as SystemOverview,co as TableCellConditions,Ls as ToastList,zs as ToggleDarkMode,lc as TraceView};