@odigos/ui-kit 0.0.199 → 0.0.201

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.
Files changed (34) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/lib/chunks/index-Bi_rpSHV.js +3 -0
  3. package/lib/chunks/ui-components-BxG2GlHM.js +2382 -0
  4. package/lib/components/scroll-y/index.d.ts +1 -0
  5. package/lib/components/v2.js +1 -1
  6. package/lib/components.js +1 -1
  7. package/lib/constants.js +1 -1
  8. package/lib/containers/_v2/_drawers/add-source-drawer/index.d.ts +1 -2
  9. package/lib/containers/_v2/_forms/add-action-form/custom-fields/url-templatization/index.d.ts +5 -0
  10. package/lib/containers/action-form/custom-fields/url-templatization.d.ts +5 -0
  11. package/lib/containers/data-flow/column/namespace-divider.d.ts +7 -0
  12. package/lib/containers/data-flow/column/source-visual-state.d.ts +9 -0
  13. package/lib/containers/source-modal/index.d.ts +2 -2
  14. package/lib/containers/source-selection-form/index.d.ts +2 -2
  15. package/lib/containers/v2.js +26 -26
  16. package/lib/containers.js +151 -116
  17. package/lib/contexts.js +1 -1
  18. package/lib/functions/get-containers-icons/index.d.ts +3 -1
  19. package/lib/functions.js +1 -1
  20. package/lib/hooks/useSourceSelectionFormData.d.ts +4 -5
  21. package/lib/hooks.js +1 -1
  22. package/lib/snippets.js +1 -1
  23. package/lib/store/useSetupStore.d.ts +0 -2
  24. package/lib/store.js +1 -1
  25. package/lib/theme.js +1 -1
  26. package/lib/types/actions/index.d.ts +25 -2
  27. package/lib/types/namespaces/index.d.ts +2 -8
  28. package/lib/types/sources/index.d.ts +1 -0
  29. package/lib/types/workload/index.d.ts +8 -0
  30. package/lib/types.js +1 -1
  31. package/lib/visuals.js +1 -1
  32. package/package.json +1 -1
  33. package/lib/chunks/index-DXnojvL1.js +0 -3
  34. package/lib/chunks/ui-components-DSKV7uC0.js +0 -2382
package/lib/containers.js CHANGED
@@ -1,4 +1,4 @@
1
- import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState as n,useEffect as a,forwardRef as o,useRef as r,useImperativeHandle as l,useMemo as s,Fragment as c,useCallback as d,Children as u}from"react";import p,{css as h,useTheme as m}from"styled-components";import{a4 as g,aN as y,h as v,K as b,A as f,aO as x,aP as S,aQ as $,aR as C,c as w,i as k,aS as D,aT as T,aU as N,aV as E,g as F,aW as O,a0 as A,aX as I,aY as R,aZ as M,a_ as L,a$ as P,b0 as j,am as K,az as q,b1 as z,b2 as H,b3 as V,aj as B,aq as W,b4 as _,b5 as J,b6 as U,b7 as Y,b8 as G,b9 as X,ba as Q,bb as Z,bc as ee,bd as te,be as ie,p as ne,a5 as ae,bf as oe,bg as re,bh as le,F as se,bi as ce,bj as de,bk as ue,k as pe,bl as he,J as me,bm as ge,bn as ye,bo as ve,bp as be,bq as fe,br as xe,bs as Se,bt as $e,bu as Ce,bv as we,bw as ke,bx as De,l as Te,by as Ne,bz as Ee,bA as Fe,bB as Oe,aF as Ae,bC as Ie,bD as Re,bE as Me,au as Le,G as Pe,bF as je,S as Ke,bG as qe,aa as ze,bH as He,bI as Ve,ah as Be,ak as We,bJ as _e,ac as Je,bK as Ue,bL as Ye,bM as Ge,bN as Xe,bO as Qe,bP as Ze,bQ as et,bR as tt,bS as it,bT as nt,bU as at,bV as ot,bW as rt,_ as lt,M as st,bX as ct,bY as dt,bZ as ut,b_ as pt,ai as ht,b$ as mt,c0 as gt,c1 as yt,c2 as vt,c3 as bt,c4 as ft,w as xt,y as St,E as $t,c5 as Ct,c6 as wt,c7 as kt,z as Dt,a9 as Tt,a8 as Nt,j as Et,c8 as Ft,c9 as Ot,ca as At,cb as It,O as Rt,U as Mt,X as Lt,Q as Pt,H as jt,P as Kt,Y as qt,cc as zt,$ as Ht,cd as Vt,ce as Bt,ad as Wt,cf as _t,cg as Jt,ch as Ut,ci as Yt,an as Gt,cj as Xt,ck as Qt,cl as Zt,cm as ei,cn as ti,co as ii,cp as ni,cq as ai,cr as oi,cs as ri,ct as li,cu as si,aw as ci,cv as di,cw as ui,cx as pi,cy as hi,cz as mi,cA as gi,cB as yi,cC as vi,cD as bi,ao as fi,al as xi,a3 as Si,a7 as $i,cE as Ci,cF as wi,cG as ki,cH as Di,cI as Ti,cJ as Ni}from"./chunks/ui-components-DSKV7uC0.js";import{VSquareIcon as Ei,XSquareIcon as Fi,EditIcon as Oi,TrashIcon as Ai,OdigosLogoText as Ii,PlusIcon as Ri,RefreshIcon as Mi,SearchIcon as Li,FilterIcon as Pi,DataStreamIcon as ji,VIcon as Ki,OdigosLogo as qi,ArrowIcon as zi,RefreshLeftArrowIcon as Hi,NotificationIcon as Vi,UserIcon as Bi,ImageErrorIcon as Wi,OverviewIcon as _i,SourceIcon as Ji,DestinationIcon as Ui,InstrumentationRuleIcon as Yi,ActionIcon as Gi,SlackLogo as Xi,KeyIcon as Qi,TerminalIcon as Zi,ExclamationTriangleIcon as en,TraceViewIcon as tn}from"./icons.js";import{MarkerType as nn,useNodesState as an,useEdgesState as on,applyNodeChanges as rn}from"@xyflow/react";import{Y as ln}from"./chunks/index-DXnojvL1.js";import"zustand";import"javascript-time-ago";import"./chunks/vendor-DUWBN0Mg.js";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";const sn=e=>{const{type:t,name:i,notes:n,signals:a,disabled:o,fields:{collectContainerAttributes:r,collectReplicaSetAttributes:l,collectWorkloadId:s,collectClusterId:c,labelsAttributes:d,annotationsAttributes:u,clusterAttributes:p,overwriteExistingValues:h,attributeNamesToDelete:m,renames:f,piiCategories:x,fallbackSamplingRatio:S,samplingPercentage:$,endpointsFilters:C,servicesNameFilters:w,attributeFilters:k}}=e,D=[{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:i||""},{title:g.NOTES,value:n||""},{type:y.Divider}];if(t===v.K8sAttributes&&(D.push({title:"Collect Container Attributes",value:String(r)}),D.push({title:"Collect ReplicaSet Attributes",value:String(l)}),D.push({title:"Collect Workload ID",value:String(s)}),D.push({title:"Collect Cluster ID",value:String(c)}),d?.length&&D.push({type:y.Divider}),d?.forEach(({labelKey:e,attributeKey:t,from:i,fromSources:n},a)=>{let o="";o+=`Label Key: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`From: ${n?.length?n.join(", "):i||b.Pod}\n`,D.push({title:"Label"+(d.length>1?` #${a+1}`:""),value:o})}),u?.length&&D.push({type:y.Divider}),u?.forEach(({annotationKey:e,attributeKey:t,from:i,fromSources:n},a)=>{let o="";o+=`Annotation Key: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`From: ${n?.length?n.join(", "):i||b.Pod}\n`,D.push({title:"Annotation"+(u.length>1?` #${a+1}`:""),value:o})})),t===v.AddClusterInfo){D.push({title:"Overwrite Existing Values",value:String(h||!1)});let e="";p?.forEach(({attributeName:t,attributeStringValue:i},n)=>{e+=`${t}: ${i}`,n<p.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===v.DeleteAttributes){let e="";m?.forEach((t,i)=>{e+=t,i<m.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===v.RenameAttributes){let e="";const t=Object.entries(f||{});t.forEach(([i,n],a)=>{e+=`${i}: ${n}`,a<t.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===v.PiiMasking){let e="";x?.forEach((t,i)=>{e+=t,i<x.length-1&&(e+=", ")}),D.push({title:"Categories",value:e})}return t===v.ErrorSampler&&D.push({title:"Sampling Ratio",value:String(S)}),t===v.ProbabilisticSampler&&D.push({title:"Sampling Percentage",value:String($)}),t===v.LatencySampler&&C?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:i,fallbackSamplingRatio:n},a)=>{let o="";o+=`Service Name: ${e}\n`,o+=`HTTP Route: ${t}\n`,o+=`Min. Latency: ${i}\n`,o+=`Fallback Sampling Ratio: ${n}`,D.push({title:"Endpoint"+(C.length>1?` #${a+1}`:""),value:o})}),t===v.ServiceNameSampler&&w?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i},n)=>{let a="";a+=`Service Name: ${e}\n`,a+=`Sampling Ratio: ${t}\n`,a+=`Fallback Sampling Ratio: ${i}`,D.push({title:"Filter"+(w.length>1?` #${n+1}`:""),value:a})}),t===v.SpanAttributeSampler&&k?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:n},a)=>{let o="";o+=`Service Name: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`Fallback Sampling Ratio: ${i}\n`;const r=Object.keys(n)[0];o+=`Condition: ${r}\n`,o+=`Operation: ${n[r]?.operation}\n`,o+=`Expected Value: ${n[r]?.expectedValue}`,"jsonCondition"===r&&(o+=`\nJSON Path: ${n[r].jsonPath}`),D.push({title:"Filter"+(k.length>1?` #${a+1}`:""),value:o})}),D},cn=f.PiiCategories,dn=p.div`
1
+ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState as n,useEffect as a,Fragment as o,forwardRef as r,useRef as l,useImperativeHandle as s,useMemo as c,useCallback as d,Children as u}from"react";import p,{css as h,useTheme as m}from"styled-components";import{a5 as g,aO as y,l as v,K as f,A as b,aP as x,aQ as $,aR as S,aS as C,c as k,i as w,aT as T,aU as D,aV as N,aW as E,D as A,F,g as O,aX as I,aY as R,k as M,aZ as K,a1 as L,a_ as P,a$ as j,b0 as z,b1 as q,b2 as B,b3 as H,an as V,aA as W,b4 as _,b5 as U,b6 as J,ak as G,ar as Y,b7 as X,b8 as Z,b9 as Q,ba as ee,bb as te,bc as ie,bd as ne,be as ae,bf as oe,bg as re,bh as le,s as se,a6 as ce,bi as de,bj as ue,bk as pe,bl as he,bm as me,bn as ge,O as ye,bo as ve,bp as fe,bq as be,br as xe,bs as $e,bt as Se,bu as Ce,bv as ke,bw as we,bx as Te,by as De,bz as Ne,n as Ee,bA as Ae,bB as Fe,bC as Oe,bD as Ie,aG as Re,bE as Me,bF as Ke,bG as Le,bH as Pe,av as je,S as ze,H as qe,bI as Be,bJ as He,ab as Ve,bK as We,ai as _e,al as Ue,bL as Je,ad as Ge,bM as Ye,bN as Xe,bO as Ze,bP as Qe,bQ as et,bR as tt,bS as it,bT as nt,bU as at,bV as ot,bW as rt,bX as lt,bY as st,$ as ct,M as dt,bZ as ut,b_ as pt,b$ as ht,c0 as mt,aj as gt,c1 as yt,c2 as vt,c3 as ft,c4 as bt,x as xt,z as $t,G as St,c5 as Ct,c6 as kt,c7 as wt,E as Tt,aa as Dt,a9 as Nt,m as Et,c8 as At,c9 as Ft,ca as Ot,cb as It,P as Rt,X as Mt,Y as Kt,U as Lt,J as Pt,Q as jt,Z as zt,cc as qt,a0 as Bt,cd as Ht,ce as Vt,ae as Wt,cf as _t,cg as Ut,ch as Jt,ci as Gt,ao as Yt,cj as Xt,ck as Zt,cl as Qt,cm as ei,cn as ti,co as ii,cp as ni,cq as ai,cr as oi,cs as ri,ct as li,ax as si,cu as ci,cv as di,cw as ui,cx as pi,cy as hi,cz as mi,cA as gi,cB as yi,cC as vi,ap as fi,am as bi,a4 as xi,a8 as $i,cD as Si,cE as Ci,cF as ki,cG as wi,cH as Ti,cI as Di}from"./chunks/ui-components-BxG2GlHM.js";import{TrashIcon as Ni,VSquareIcon as Ei,XSquareIcon as Ai,EditIcon as Fi,OdigosLogoText as Oi,PlusIcon as Ii,RefreshIcon as Ri,SearchIcon as Mi,FilterIcon as Ki,DataStreamIcon as Li,VIcon as Pi,OdigosLogo as ji,ArrowIcon as zi,RefreshLeftArrowIcon as qi,NotificationIcon as Bi,UserIcon as Hi,ImageErrorIcon as Vi,OverviewIcon as Wi,SourceIcon as _i,DestinationIcon as Ui,InstrumentationRuleIcon as Ji,ActionIcon as Gi,SlackLogo as Yi,KeyIcon as Xi,TerminalIcon as Zi,ExclamationTriangleIcon as Qi,TraceViewIcon as en}from"./icons.js";import{MarkerType as tn,useNodesState as nn,useEdgesState as an,applyNodeChanges as on}from"@xyflow/react";import{Y as rn}from"./chunks/index-Bi_rpSHV.js";import"zustand";import"javascript-time-ago";import"./chunks/vendor-DUWBN0Mg.js";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";const ln=e=>{const{type:t,name:i,notes:n,signals:a,disabled:o,fields:{collectContainerAttributes:r,collectReplicaSetAttributes:l,collectWorkloadId:s,collectClusterId:c,labelsAttributes:d,annotationsAttributes:u,clusterAttributes:p,overwriteExistingValues:h,attributeNamesToDelete:m,renames:b,piiCategories:x,fallbackSamplingRatio:$,samplingPercentage:S,endpointsFilters:C,servicesNameFilters:k,attributeFilters:w,urlTemplatizationRulesGroups:T}}=e,D=[{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:i||""},{title:g.NOTES,value:n||""},{type:y.Divider}];if(t===v.K8sAttributes&&(D.push({title:"Collect Container Attributes",value:String(r)}),D.push({title:"Collect ReplicaSet Attributes",value:String(l)}),D.push({title:"Collect Workload ID",value:String(s)}),D.push({title:"Collect Cluster ID",value:String(c)}),d?.length&&D.push({type:y.Divider}),d?.forEach(({labelKey:e,attributeKey:t,from:i,fromSources:n},a)=>{let o="";o+=`Label Key: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`From: ${n?.length?n.join(", "):i||f.Pod}\n`,D.push({title:"Label"+(d.length>1?` #${a+1}`:""),value:o})}),u?.length&&D.push({type:y.Divider}),u?.forEach(({annotationKey:e,attributeKey:t,from:i,fromSources:n},a)=>{let o="";o+=`Annotation Key: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`From: ${n?.length?n.join(", "):i||f.Pod}\n`,D.push({title:"Annotation"+(u.length>1?` #${a+1}`:""),value:o})})),t===v.AddClusterInfo){D.push({title:"Overwrite Existing Values",value:String(h||!1)});let e="";p?.forEach(({attributeName:t,attributeStringValue:i},n)=>{e+=`${t}: ${i}`,n<p.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===v.DeleteAttributes){let e="";m?.forEach((t,i)=>{e+=t,i<m.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===v.RenameAttributes){let e="";const t=Object.entries(b||{});t.forEach(([i,n],a)=>{e+=`${i}: ${n}`,a<t.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===v.PiiMasking){let e="";x?.forEach((t,i)=>{e+=t,i<x.length-1&&(e+=", ")}),D.push({title:"Categories",value:e})}return t===v.ErrorSampler&&D.push({title:"Sampling Ratio",value:String($)}),t===v.ProbabilisticSampler&&D.push({title:"Sampling Percentage",value:String(S)}),t===v.LatencySampler&&C?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:i,fallbackSamplingRatio:n},a)=>{let o="";o+=`Service Name: ${e}\n`,o+=`HTTP Route: ${t}\n`,o+=`Min. Latency: ${i}\n`,o+=`Fallback Sampling Ratio: ${n}`,D.push({title:"Endpoint"+(C.length>1?` #${a+1}`:""),value:o})}),t===v.ServiceNameSampler&&k?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i},n)=>{let a="";a+=`Service Name: ${e}\n`,a+=`Sampling Ratio: ${t}\n`,a+=`Fallback Sampling Ratio: ${i}`,D.push({title:"Filter"+(k.length>1?` #${n+1}`:""),value:a})}),t===v.SpanAttributeSampler&&w?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:n},a)=>{let o="";o+=`Service Name: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`Fallback Sampling Ratio: ${i}\n`;const r=Object.keys(n)[0];o+=`Condition: ${r}\n`,o+=`Operation: ${n[r]?.operation}\n`,o+=`Expected Value: ${n[r]?.expectedValue}`,"jsonCondition"===r&&(o+=`\nJSON Path: ${n[r].jsonPath}`),D.push({title:"Filter"+(w.length>1?` #${a+1}`:""),value:o})}),t===v.URLTemplatization&&T?.forEach((e,t)=>{let i="";e.filterK8sNamespace&&(i+=`Namespace: ${e.filterK8sNamespace}\n`),e.workloadFilters?.length&&e.workloadFilters.forEach(e=>{const t=[e.kind,e.name].filter(Boolean).join("/");t&&(i+=`Workload: ${t}\n`)});const n=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");i+=`Templates: ${n}`,e.notes&&(i+=`\nNotes: ${e.notes}`),D.push({title:"Group"+(T.length>1?` #${t+1}`:""),value:i})}),D},sn=b.PiiCategories,cn=p.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 i}from"react/jsx-runtime";import{useState
7
7
  border-radius: 32px;
8
8
  padding: 8px;
9
9
  `}
10
- `,un=[{id:"CREDIT_CARD",label:"Credit Card"}],pn=f.FallbackSamplingRatio,hn=[{value:b.Pod,id:b.Pod},{value:b.Namespace,id:b.Namespace},{value:b.Node,id:b.Node}],mn=[{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:hn,required:!0,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],gn=[{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:hn,required:!1,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],yn=f.EndpointsFilters,vn=[{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:w.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:w.Number}],bn=f.AttributeNamesToDelete,fn=f.Renames,xn=f.ServicesNameFilters,Sn=[{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:w.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:w.Number}],$n=f.SamplingPercentage,Cn=f.AttributeFilters,wn=[{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:w.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}],kn={[v.K8sAttributes]:({value:n,setValue:o,formErrors:r})=>(a(()=>{n[f.CollectContainerAttributes]||n[f.CollectReplicaSetAttributes]||n[f.CollectWorkloadId]||n[f.CollectClusterId]||n[f.LabelsAttributes]?.length||n[f.AnnotationsAttributes]?.length||(o(f.CollectContainerAttributes,!0),o(f.CollectReplicaSetAttributes,!0),o(f.CollectWorkloadId,!0),o(f.CollectClusterId,!0),o(f.LabelsAttributes,[]),o(f.AnnotationsAttributes,[]))},[]),e(i,{children:[t(S,{title:"Collect Container Attributes",value:n[f.CollectContainerAttributes]||!1,onChange:e=>o(f.CollectContainerAttributes,e),errorMessage:r[f.CollectContainerAttributes]}),t(S,{title:"Collect ReplicaSet Attributes",value:n[f.CollectReplicaSetAttributes]||!1,onChange:e=>o(f.CollectReplicaSetAttributes,e),errorMessage:r[f.CollectReplicaSetAttributes]}),t(S,{title:"Collect Workload ID",value:n[f.CollectWorkloadId]||!1,onChange:e=>o(f.CollectWorkloadId,e),errorMessage:r[f.CollectWorkloadId]}),t(S,{title:"Collect Cluster ID",value:n[f.CollectClusterId]||!1,onChange:e=>o(f.CollectClusterId,e),errorMessage:r[f.CollectClusterId]}),t(D,{columns:mn,value:n[f.LabelsAttributes]||[],onChange:e=>o(f.LabelsAttributes,e),errorMessage:r[f.LabelsAttributes]}),t(D,{columns:gn,value:n[f.AnnotationsAttributes]||[],onChange:e=>o(f.AnnotationsAttributes,e),errorMessage:r[f.AnnotationsAttributes]})]})),[v.AddClusterInfo]:({value:n,setValue:a,formErrors:o})=>e(i,{children:[t(T,{title:"Overwrite Existing Values",tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",initialValue:n[f.OverwriteExistingValues]||!1,onChange:e=>a(f.OverwriteExistingValues,e)}),t(N,{title:"Resource Attributes",value:n[f.ClusterAttributes]?.map(e=>({key:e.attributeName,value:e.attributeStringValue}))||[],onChange:e=>a(f.ClusterAttributes,e.map(e=>({attributeName:e.key,attributeStringValue:e.value}))),required:!0,errorMessage:o[f.ClusterAttributes]})]}),[v.DeleteAttributes]:({value:e,setValue:i,formErrors:n})=>{const a=n[bn],o=e[bn]||[];return t(E,{title:"Attributes to delete",value:o,onChange:e=>i(bn,e),required:!0,errorMessage:a})},[v.RenameAttributes]:({value:e,setValue:i,formErrors:n})=>{const a=n[fn],o=Object.entries(e[fn]||{}).map(([e,t])=>({key:e,value:t}));return t(N,{title:"Attributes to rename",value:o,onChange:e=>{const t={};e.forEach(e=>t[e.key]=e.value),i(fn,t)},required:!0,errorMessage:a})},[v.PiiMasking]:({value:i,setValue:o,formErrors:r})=>{const l=r[cn],s=i[cn]||[],[c,d]=n(1===s.length);return a(()=>{if(!s.length){const e=un.map(({id:e})=>e);o(cn,e),d(1===un.length)}},[]),e("div",{children:[t(x,{title:"Attributes to mask",required:!0}),t(dn,{$hasError:!!l,children:un.map(({id:e,label:i})=>t(S,{title:i,disabled:c&&s.includes(e),value:s.includes(e),onChange:t=>((e,t)=>{const i=t?[...s,e]:s.filter(t=>t!==e);o(cn,i),d(1===i.length)})(e,t)},e))}),!!l&&t($,{children:l})]})},[v.ErrorSampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[pn],o=e[pn];return t(C,{title:"Fallback sampling ratio",required:!0,type:w.Number,min:0,max:100,value:k(o)?"":String(o),onChange:({target:{value:e}})=>{return t=e,i(pn,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[v.ProbabilisticSampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[$n],o=e[$n];return t(C,{title:"Sampling percentage",required:!0,type:w.Number,min:0,max:100,value:k(o)?"":String(o),onChange:({target:{value:e}})=>{return t=e,i($n,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[v.LatencySampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[yn],o=e[yn]||[];return t(D,{columns:vn,value:o,onChange:e=>{const t=e.map(({serviceName:e,httpRoute:t,minimumLatencyThreshold:i,fallbackSamplingRatio:n})=>({serviceName:e,httpRoute:t,minimumLatencyThreshold:Number(i),fallbackSamplingRatio:Number(n)}));i(yn,t)},errorMessage:a})},[v.ServiceNameSampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[xn],o=e[xn]||[];return t(D,{columns:Sn,value:o,onChange:e=>{const t=e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(i)}));i(xn,t)},errorMessage:a})},[v.SpanAttributeSampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[Cn],o=(e[Cn]||[]).map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:n})=>{const a=Object.entries(n).filter(([e,t])=>t)[0][0];return{serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:a,operation:n[a]?.operation,expectedValue:n[a]?.expectedValue,jsonPath:n[a]?.jsonPath}});return t(D,{columns:wn,value:o,onChange:e=>{const t=e.map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:n,operation:a,expectedValue:o,jsonPath:r})=>{const l={serviceName:e,attributeKey:t,fallbackSamplingRatio:Number(i),condition:{[n]:{operation:a,expectedValue:o}}};return r&&(l.condition[n].jsonPath=r),l});i(Cn,t)},errorMessage:a,limitFieldsPerRow:3})}},Dn=({actionType:e,value:i,setValue:n,formErrors:a})=>{if(!e)return null;const o=kn[e];return o?t(o,{value:i,setValue:n,formErrors:a}):null},Tn=p.div`
10
+ `,dn=[{id:"CREDIT_CARD",label:"Credit Card"}],un=b.FallbackSamplingRatio,pn=[{value:f.Pod,id:f.Pod},{value:f.Namespace,id:f.Namespace},{value:f.Node,id:f.Node}],hn=[{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:pn,required:!0,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],mn=[{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:pn,required:!1,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],gn=b.EndpointsFilters,yn=[{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:k.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:k.Number}],vn=b.AttributeNamesToDelete,fn=b.Renames,bn=b.UrlTemplatizationRulesGroups,xn=[{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"}],$n=b.ServicesNameFilters,Sn=[{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:k.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:k.Number}],Cn=b.SamplingPercentage,kn=b.AttributeFilters,wn=[{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:k.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}],Tn={[v.K8sAttributes]:({value:n,setValue:o,formErrors:r})=>(a(()=>{n[b.CollectContainerAttributes]||n[b.CollectReplicaSetAttributes]||n[b.CollectWorkloadId]||n[b.CollectClusterId]||n[b.LabelsAttributes]?.length||n[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(i,{children:[t($,{title:"Collect Container Attributes",value:n[b.CollectContainerAttributes]||!1,onChange:e=>o(b.CollectContainerAttributes,e),errorMessage:r[b.CollectContainerAttributes]}),t($,{title:"Collect ReplicaSet Attributes",value:n[b.CollectReplicaSetAttributes]||!1,onChange:e=>o(b.CollectReplicaSetAttributes,e),errorMessage:r[b.CollectReplicaSetAttributes]}),t($,{title:"Collect Workload ID",value:n[b.CollectWorkloadId]||!1,onChange:e=>o(b.CollectWorkloadId,e),errorMessage:r[b.CollectWorkloadId]}),t($,{title:"Collect Cluster ID",value:n[b.CollectClusterId]||!1,onChange:e=>o(b.CollectClusterId,e),errorMessage:r[b.CollectClusterId]}),t(T,{columns:hn,value:n[b.LabelsAttributes]||[],onChange:e=>o(b.LabelsAttributes,e),errorMessage:r[b.LabelsAttributes]}),t(T,{columns:mn,value:n[b.AnnotationsAttributes]||[],onChange:e=>o(b.AnnotationsAttributes,e),errorMessage:r[b.AnnotationsAttributes]})]})),[v.AddClusterInfo]:({value:n,setValue:a,formErrors:o})=>e(i,{children:[t(D,{title:"Overwrite Existing Values",tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",initialValue:n[b.OverwriteExistingValues]||!1,onChange:e=>a(b.OverwriteExistingValues,e)}),t(N,{title:"Resource Attributes",value:n[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:i,formErrors:n})=>{const a=n[vn],o=e[vn]||[];return t(E,{title:"Attributes to delete",value:o,onChange:e=>i(vn,e),required:!0,errorMessage:a})},[v.RenameAttributes]:({value:e,setValue:i,formErrors:n})=>{const a=n[fn],o=Object.entries(e[fn]||{}).map(([e,t])=>({key:e,value:t}));return t(N,{title:"Attributes to rename",value:o,onChange:e=>{const t={};e.forEach(e=>t[e.key]=e.value),i(fn,t)},required:!0,errorMessage:a})},[v.PiiMasking]:({value:i,setValue:o,formErrors:r})=>{const l=r[sn],s=i[sn]||[],[c,d]=n(1===s.length);return a(()=>{if(!s.length){const e=dn.map(({id:e})=>e);o(sn,e),d(1===dn.length)}},[]),e("div",{children:[t(x,{title:"Attributes to mask",required:!0}),t(cn,{$hasError:!!l,children:dn.map(({id:e,label:i})=>t($,{title:i,disabled:c&&s.includes(e),value:s.includes(e),onChange:t=>((e,t)=>{const i=t?[...s,e]:s.filter(t=>t!==e);o(sn,i),d(1===i.length)})(e,t)},e))}),!!l&&t(S,{children:l})]})},[v.ErrorSampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[un],o=e[un];return t(C,{title:"Fallback sampling ratio",required:!0,type:k.Number,min:0,max:100,value:w(o)?"":String(o),onChange:({target:{value:e}})=>{return t=e,i(un,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[v.ProbabilisticSampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[Cn],o=e[Cn];return t(C,{title:"Sampling percentage",required:!0,type:k.Number,min:0,max:100,value:w(o)?"":String(o),onChange:({target:{value:e}})=>{return t=e,i(Cn,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[v.LatencySampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[gn],o=e[gn]||[];return t(T,{columns:yn,value:o,onChange:e=>{const t=e.map(({serviceName:e,httpRoute:t,minimumLatencyThreshold:i,fallbackSamplingRatio:n})=>({serviceName:e,httpRoute:t,minimumLatencyThreshold:Number(i),fallbackSamplingRatio:Number(n)}));i(gn,t)},errorMessage:a})},[v.ServiceNameSampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[$n],o=e[$n]||[];return t(T,{columns:Sn,value:o,onChange:e=>{const t=e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(i)}));i($n,t)},errorMessage:a})},[v.SpanAttributeSampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[kn],o=(e[kn]||[]).map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:n})=>{const a=Object.entries(n).filter(([e,t])=>t)[0][0];return{serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:a,operation:n[a]?.operation,expectedValue:n[a]?.expectedValue,jsonPath:n[a]?.jsonPath}});return t(T,{columns:wn,value:o,onChange:e=>{const t=e.map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:n,operation:a,expectedValue:o,jsonPath:r})=>{const l={serviceName:e,attributeKey:t,fallbackSamplingRatio:Number(i),condition:{[n]:{operation:a,expectedValue:o}}};return r&&(l.condition[n].jsonPath=r),l});i(kn,t)},errorMessage:a,limitFieldsPerRow:3})},[v.URLTemplatization]:({value:n,setValue:a,formErrors:r})=>{const l=r[bn],s=n[bn]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>a(bn,e),d=(e,t)=>c(s.map((i,n)=>n===e?{...i,...t}:i));return e(i,{children:[s.map((i,n)=>e(o,{children:[t(A,{}),e(F,{$gap:12,children:[e(O,{$justifyContent:"space-between",$alignItems:"center",children:[t(x,{title:`Rule Group ${n+1}`}),s.length>1&&t(I,{size:30,onClick:()=>{return e=n,c(s.filter((t,i)=>i!==e));var e},children:t(Ni,{})})]}),t(C,{title:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:i.filterK8sNamespace||"",onChange:e=>d(n,{filterK8sNamespace:e.target.value})}),t(T,{title:"Workload Filters",columns:xn,value:i.workloadFilters||[],onChange:e=>d(n,{workloadFilters:e})}),t(E,{title:"Templates",required:!0,value:i.templatizationRules.map(e=>e.template),onChange:e=>d(n,{templatizationRules:e.map(e=>({template:e}))})})]}),!!l&&t(S,{children:l})]},`url-templatization-group-${n}`)),t(R,{label:"Add Rule Group",onClick:()=>c([...s,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(A,{})]})}},Dn=({actionType:e,value:i,setValue:n,formErrors:a})=>{if(!e)return null;const o=Tn[e];return o?t(o,{value:i,setValue:n,formErrors:a}):null},Nn=p.div`
11
11
  display: flex;
12
12
  flex-direction: column;
13
13
  gap: 24px;
14
14
  padding: 4px;
15
- `,Nn=p(P)`
15
+ `,En=p(B)`
16
16
  margin-bottom: 12px;
17
- `,En=({isUpdate:i,action:n,formData:a,formErrors:o,handleFormChange:r})=>{const l=m();return e(Tn,{children:[i&&e("div",{children:[t(Nn,{children:"Status"}),t(O,{options:[{icon:Ei,label:g.ENABLED,value:!1,selectedBgColor:l.text.success+A["050"]},{icon:Fi,label:g.DISABLED,value:!0,selectedBgColor:l.text.error+A["050"]}],selected:a.disabled,setSelected:e=>r("disabled",e)})]}),!i&&t(I,{title:"",description:n.docsDescription,actionButton:t(R,{endpoint:n.docsEndpoint})}),t(M,{title:"Signals for Processing",required:!0,allowedSignals:n.allowedSignals,selectedSignals:a.signals||[],setSelectedSignals:e=>r("signals",e),errorMessage:o.signals}),!i&&t(C,{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(Dn,{actionType:n.type,value:a.fields,setValue:(e,t)=>r(`fields.${e}`,t),formErrors:o}),t(L,{title:"Notes",value:a.notes||"",onChange:({target:{value:e}})=>r("notes",e),errorMessage:o.notes})]})},Fn=o(({children:a,width:o=640,title:s,titleTooltip:c,hideEditTitleFromEdit:d,icons:u,iconSrcs:p,isEdit:h=!1,isFormDirty:g=!1,isLastItem:y=!1,onClose:v,onEdit:b,onSave:f,onDelete:x,onCancel:S,tabs:$,headerActionButtons:C},w)=>{const k=m(),{drawerType:D,setDrawerType:T,setDrawerEntityId:N}=j();K({key:"Enter",active:h},()=>U());const[E,F]=n(!1),[O,A]=n(!1),I=r(null),R=D===B.Source,M=()=>{F(!1),A(!1)},L=()=>{M(),b&&b(!1),T(null),N(null),v?.()};l(w,()=>({closeDrawer:L}));const W=()=>{I.current?.clearTitle(),S&&S(),M()},_=()=>{const e=I.current?.isTitleDirty();g||e?A(!0):W()},J=()=>{F(!0)},U=()=>{f&&f(I.current?.getTitle()||"")},Y=C||[];return b&&!h&&Y.push({"data-id":"drawer-edit",variant:"tertiary",onClick:()=>b(!0),children:e(i,{children:[t(Oi,{}),t(P,{size:14,family:"secondary",decoration:"underline",children:"Edit"})]})}),x&&!h&&Y.push({"data-id":"drawer-delete",variant:"tertiary",onClick:J,children:e(i,{children:[t(Ai,{}),t(P,{color:k.text.error,size:14,family:"secondary",decoration:"underline",children:R?q.UNINSTRUMENT:q.DELETE})]})}),e(i,{children:[t(z,{isOpen:!0,onClose:h?_:L,closeOnEscape:!E&&!O,width:`${o+64}px`,header:{icons:u,iconSrcs:p,title:s,titleTooltip:c,replaceTitleWith:!d&&h?t(On,{ref:I,title:s}):void 0,actionButtons:Y,tabs:$},footer:{isOpen:h,leftButtons:[{"data-id":"drawer-save",variant:"primary",onClick:U,children:q.SAVE},{"data-id":"drawer-cancel",variant:"secondary",onClick:_,children:q.CANCEL}],rightButtons:x?[{"data-id":"drawer-delete",variant:"tertiary",onClick:J,children:e(i,{children:[t(Ai,{}),t(P,{size:14,color:k.text.error,family:"secondary",decoration:"underline",children:q.DELETE})]})}]:[]},children:a}),t(H,{isOpen:E,noOverlay:!0,name:`${D}${s?` (${s})`:""}`,type:D,isLastItem:y,onApprove:()=>{x&&x(),M()},onDeny:M}),t(V,{isOpen:O,noOverlay:!0,name:"edit mode",onApprove:W,onDeny:M})]})}),On=o(({title:e},i)=>{const[o,r]=n(e);return a(()=>{r(e)},[e]),l(i,()=>({getTitle:()=>o||e,isTitleDirty:()=>o!==e,clearTitle:()=>r(e)})),t(C,{"data-id":"title",value:o,onChange:e=>r(e.target.value)})});On.displayName=On.name,Fn.displayName=Fn.name;const An=p.div`
17
+ `,An=({isUpdate:i,action:n,formData:a,formErrors:o,handleFormChange:r})=>{const l=m();return e(Nn,{children:[i&&e("div",{children:[t(En,{children:"Status"}),t(K,{options:[{icon:Ei,label:g.ENABLED,value:!1,selectedBgColor:l.text.success+L["050"]},{icon:Ai,label:g.DISABLED,value:!0,selectedBgColor:l.text.error+L["050"]}],selected:a.disabled,setSelected:e=>r("disabled",e)})]}),!i&&t(P,{title:"",description:n.docsDescription,actionButton:t(j,{endpoint:n.docsEndpoint})}),t(z,{title:"Signals for Processing",required:!0,allowedSignals:n.allowedSignals,selectedSignals:a.signals||[],setSelectedSignals:e=>r("signals",e),errorMessage:o.signals}),!i&&t(C,{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(Dn,{actionType:n.type,value:a.fields,setValue:(e,t)=>r(`fields.${e}`,t),formErrors:o}),t(q,{title:"Notes",value:a.notes||"",onChange:({target:{value:e}})=>r("notes",e),errorMessage:o.notes})]})},Fn=r(({children:a,width:o=640,title:r,titleTooltip:c,hideEditTitleFromEdit:d,icons:u,iconSrcs:p,isEdit:h=!1,isFormDirty:g=!1,isLastItem:y=!1,onClose:v,onEdit:f,onSave:b,onDelete:x,onCancel:$,tabs:S,headerActionButtons:C},k)=>{const w=m(),{drawerType:T,setDrawerType:D,setDrawerEntityId:N}=H();V({key:"Enter",active:h},()=>z());const[E,A]=n(!1),[F,O]=n(!1),I=l(null),R=T===G.Source,M=()=>{A(!1),O(!1)},K=()=>{M(),f&&f(!1),D(null),N(null),v?.()};s(k,()=>({closeDrawer:K}));const L=()=>{I.current?.clearTitle(),$&&$(),M()},P=()=>{const e=I.current?.isTitleDirty();g||e?O(!0):L()},j=()=>{A(!0)},z=()=>{b&&b(I.current?.getTitle()||"")},q=C||[];return f&&!h&&q.push({"data-id":"drawer-edit",variant:"tertiary",onClick:()=>f(!0),children:e(i,{children:[t(Fi,{}),t(B,{size:14,family:"secondary",decoration:"underline",children:"Edit"})]})}),x&&!h&&q.push({"data-id":"drawer-delete",variant:"tertiary",onClick:j,children:e(i,{children:[t(Ni,{}),t(B,{color:w.text.error,size:14,family:"secondary",decoration:"underline",children:R?W.UNINSTRUMENT:W.DELETE})]})}),e(i,{children:[t(_,{isOpen:!0,onClose:h?P:K,closeOnEscape:!E&&!F,width:`${o+64}px`,header:{icons:u,iconSrcs:p,title:r,titleTooltip:c,replaceTitleWith:!d&&h?t(On,{ref:I,title:r}):void 0,actionButtons:q,tabs:S},footer:{isOpen:h,leftButtons:[{"data-id":"drawer-save",variant:"primary",onClick:z,children:W.SAVE},{"data-id":"drawer-cancel",variant:"secondary",onClick:P,children:W.CANCEL}],rightButtons:x?[{"data-id":"drawer-delete",variant:"tertiary",onClick:j,children:e(i,{children:[t(Ni,{}),t(B,{size:14,color:w.text.error,family:"secondary",decoration:"underline",children:W.DELETE})]})}]:[]},children:a}),t(U,{isOpen:E,noOverlay:!0,name:`${T}${r?` (${r})`:""}`,type:T,isLastItem:y,onApprove:()=>{x&&x(),M()},onDeny:M}),t(J,{isOpen:F,noOverlay:!0,name:"edit mode",onApprove:L,onDeny:M})]})}),On=r(({title:e},i)=>{const[o,r]=n(e);return a(()=>{r(e)},[e]),s(i,()=>({getTitle:()=>o||e,isTitleDirty:()=>o!==e,clearTitle:()=>r(e)})),t(C,{"data-id":"title",value:o,onChange:e=>r(e.target.value)})});On.displayName=On.name,Fn.displayName=Fn.name;const In=p.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
- `,In=p.div`
23
+ `,Rn=p.div`
24
24
  display: flex;
25
25
  flex-direction: column;
26
26
  gap: 12px;
27
- `,Rn=({updateAction:i,deleteAction:o})=>{const{actions:l}=W(),{drawerType:c,drawerEntityId:d}=j(),u=r(null),p=c===B.Action,[h,m]=n(!1),[y,v]=n(!1),{formData:b,formErrors:f,handleFormChange:x,resetFormData:S,validateForm:$,loadFormWithDrawerItem:C}=_(),w=s(()=>{if(d)return l?.find(e=>J(e)===d)},[d,l]);if(a(()=>{p&&w?C(w):S()},[p,w]),!w)return null;const k=U.find(({type:e})=>e===w.type)||U.find(({label:e})=>"Attributes"===e)?.items?.find(({type:e})=>e===w.type)||U.find(({label:e})=>"Samplers"===e)?.items?.find(({type:e})=>e===w.type);return t(Fn,{ref:u,title:w.name||w.type,icons:[X(w.type)],isEdit:h,isFormDirty:y,onEdit:e=>{m("boolean"!=typeof e||e)},onSave:e=>{if($({withAlert:!0,alertTitle:Q.Update})){const t=e!==w.type?e:"";x("name",t),i(d,{...b,name:t}),m(!1),v(!1)}},onDelete:()=>{o(d,w.type),m(!1),v(!1),u.current?.closeDrawer()},onCancel:()=>{m(!1),v(!1),C(w)},children:h&&k?t(An,{children:t(En,{isUpdate:!0,action:k,formData:b,formErrors:f,handleFormChange:(...e)=>{v(!0),x(...e)}})}):e(In,{children:[t(Y,{conditions:w.conditions||[]}),t(G,{title:g.ACTION_DETAILS,data:w?sn(w):[]})]})})},Mn=p(se)`
27
+ `,Mn=({updateAction:i,deleteAction:o})=>{const{actions:r}=Y(),{drawerType:s,drawerEntityId:d}=H(),u=l(null),p=s===G.Action,[h,m]=n(!1),[y,v]=n(!1),{formData:f,formErrors:b,handleFormChange:x,resetFormData:$,validateForm:S,loadFormWithDrawerItem:C}=X(),k=c(()=>{if(d)return r?.find(e=>Z(e)===d)},[d,r]);if(a(()=>{p&&k?C(k):$()},[p,k]),!k)return null;const w=Q.find(({type:e})=>e===k.type)||Q.find(({label:e})=>"Attributes"===e)?.items?.find(({type:e})=>e===k.type)||Q.find(({label:e})=>"Samplers"===e)?.items?.find(({type:e})=>e===k.type);return t(Fn,{ref:u,title:k.name||k.type,icons:[ie(k.type)],isEdit:h,isFormDirty:y,onEdit:e=>{m("boolean"!=typeof e||e)},onSave:e=>{if(S({withAlert:!0,alertTitle:ne.Update})){const t=e!==k.type?e:"";x("name",t),i(d,{...f,name:t}),m(!1),v(!1)}},onDelete:()=>{o(d,k.type),m(!1),v(!1),u.current?.closeDrawer()},onCancel:()=>{m(!1),v(!1),C(k)},children:h&&w?t(In,{children:t(An,{isUpdate:!0,action:w,formData:f,formErrors:b,handleFormChange:(...e)=>{v(!0),x(...e)}})}):e(Rn,{children:[t(ee,{conditions:k.conditions||[]}),t(te,{title:g.ACTION_DETAILS,data:k?ln(k):[]})]})})},Kn=p(F)`
28
28
  margin-top: 24px;
29
29
  gap: 12px;
30
- `,Ln=({createAction:i})=>{const{currentModal:a,setCurrentModal:o}=Z(),r=a===B.Action,{formData:l,formErrors:s,handleFormChange:c,resetFormData:d,validateForm:u}=_(),[p,h]=n(void 0),m=()=>{d(),h(void 0),o("")},y=()=>{if(!u({withAlert:!0,alertTitle:Q.Create}))return null;i(l),m()};return K({key:"Enter",active:r},()=>y()),t(ee,{isOpen:r,onClose:m,header:{title:"Add Action"},actionComponent:t(le,{buttons:[{variant:"primary",label:"DONE",onClick:y,disabled:!p}]}),children:e(te,{children:[t(I,{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(Mn,{children:[t(ie,{type:ne.Warning,message:ae.DEFINED_FOR_ALL_STREAMS(g.ACTIONS)}),t(oe,{options:U,selectedOption:p,onOptionSelect:e=>{return t=e,d(),c("type",t?.type||""),void h(t);var t},autoFocus:!p?.type})]}),p?.type?e("div",{children:[t(re,{margin:"16px 0"}),t(En,{action:p,formData:l,formErrors:s,handleFormChange:c})]}):null]})})},Pn=e=>{const{type:t,fields:{collectContainerAttributes:i,collectReplicaSetAttributes:n,collectWorkloadId:a,collectClusterId:o,labelsAttributes:r,annotationsAttributes:l,clusterAttributes:s,overwriteExistingValues:c,attributeNamesToDelete:d,renames:u,piiCategories:p,fallbackSamplingRatio:h,samplingPercentage:m,endpointsFilters:g,attributeFilters:y,servicesNameFilters:f}}=e;let x="";if(t===v.K8sAttributes&&(i&&(x+="Container Attributes, "),n&&(x+="ReplicaSet Attributes, "),a&&(x+="Workload ID, "),o&&(x+="Cluster ID, "),r?.forEach(({labelKey:e,attributeKey:t,from:i,fromSources:n},a)=>{const o=n?.length?n.join(","):i||b.Pod;x+=`Label: ${e} ${t} ${o} `,a===r.length-1&&(x+=", ")}),l?.forEach(({annotationKey:e,attributeKey:t,from:i,fromSources:n},a)=>{const o=n?.length?n.join(","):i||b.Pod;x+=`Annotation: ${e} ${t} ${o} `,a===l.length-1&&(x+=", ")})),t===v.AddClusterInfo&&(x+=`Overwrite Existing: ${c}\n`,s?.forEach(({attributeName:e,attributeStringValue:t},i)=>{x+=`${e}: ${t}`,i<s.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,i],n)=>{x+=`${t}: ${i}`,n<e.length-1&&(x+=", ")})}return t===v.PiiMasking&&p?.forEach((e,t)=>{x+=e,t<p.length-1&&(x+=", ")}),t===v.ErrorSampler&&(x+=String(h)),t===v.ProbabilisticSampler&&(x+=String(m),x+="%"),t===v.LatencySampler&&g?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:i,fallbackSamplingRatio:n},a)=>{x+=`Endpoint${g.length>1?` #${a+1}`:""}=${e}${t}\n`,x+=` Latency=${i}`,x+=` Sampling=${n}`,a<g.length-1&&(x+=", ")}),t===v.ServiceNameSampler&&f?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i})=>{x+=`Service Name: ${e}, `,x+=`Sampling Ratio: ${t}, `,x+=`Fallback Sampling Ratio: ${i}\n`}),t===v.SpanAttributeSampler&&y?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i})=>{x+=`Service Name: ${e}, `,x+=`Attribute Key: ${t}, `,x+=`Fallback Sampling Ratio: ${i}\n`}),x},jn=({conditions:e,id:i})=>{const{errors:n,warnings:a,disableds:o,hasLoadings:r}=s(()=>ce(e),[e]),l=n.length>0?n:a.length>0?a:o.length>0?o:[];if(l.length>0)return t("div",{style:{lineHeight:1},children:t(Kn,{conditions:l,id:i})});const c=r?ue.Loading:ne.Success;return t("div",{style:{lineHeight:1},children:t(de,{status:c,title:c,withBorder:!0,withIcon:!0})})},Kn=({conditions:e,id:i})=>{const n=m();return t(pe,{children:he(e).map(({status:e,type:a,reason:o,message:r,lastTransitionTime:l},s)=>{"loading"!==e&&"disabled"!==e||(e=ne.Info);const c=ge(e,n);return t(me,{titleIcon:c,title:a,text:r||o||"",timestamp:l,children:t(de,{status:e,title:o||a,withBorder:!0,withIcon:!0})},`condition-${i}-${e}-${a}-${s}`)})})},qn=({instrumentationRules:e,sources:t,actions:i,destinations:n,searchText:a,selectedCategory:o})=>{const r=a?e.filter(e=>e.type?.toLowerCase().includes(a)||e.ruleName?.toLowerCase().includes(a)):e,l=a?t.filter(e=>e.name?.toLowerCase().includes(a)||e.otelServiceName?.toLowerCase().includes(a)||e.namespace?.toLowerCase().includes(a)):t,s=a?i.filter(e=>e.type?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):i,c=a?n.filter(e=>e.destinationType.displayName?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):n,d=[{category:B.Source,label:"Sources",count:l.length,entities:[]},{category:B.Action,label:"Actions",count:s.length,entities:[]},{category:B.Destination,label:"Destinations",count:c.length,entities:[]},{category:B.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(o)).map(e=>({...e,entities:e.category===B.InstrumentationRule?r:e.category===B.Source?l:e.category===B.Action?s:e.category===B.Destination?c:[]}));return{categories:d,searchResults:u}},zn=[{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}],Hn=({maxHeight:i,maxWidth:n})=>{const a=m(),o=ye(),{actions:r,actionsLoading:l}=W(),{setDrawerType:c,setDrawerEntityId:d}=j(),u=s(()=>qn({instrumentationRules:[],sources:[],actions:ve(r,o),destinations:[],searchText:o.searchText,selectedCategory:B.Action}).searchResults.find(({category:e})=>e===B.Action)?.entities||[],[r,o]),p=s(()=>u.map(e=>{const{hasErrors:i,hasWarnings:n,hasDisableds:o}=ce(e.conditions||[]);return{status:i?ne.Error:n?ne.Warning:void 0,faded:o,onClick:()=>{c(B.Action),d(e.id)},cells:[{columnKey:"icon",component:()=>t(be,{icon:X(e.type)})},{columnKey:"name",value:fe(e,B.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:Pn(e),textColor:a.text.info,withTooltip:!0},{columnKey:"signals",component:()=>t(xe,{withLabels:!0,monitors:e.signals||[]})},{columnKey:"conditions",component:()=>t(jn,{conditions:e.conditions||[],id:e.id})},{columnKey:"active-status",component:()=>t("div",{style:{lineHeight:1},children:t(de,{status:e.disabled?ne.Error:ne.Success,title:e.disabled?g.DISABLED:g.ENABLED,withIcon:!0,withBorder:!0})})}]}}),[u]),{badge:h,badgeTooltip:y}=s(()=>u.length!==r.length?{badge:`${u.length}/${r.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:r.length,badgeTooltip:void 0},[u,r]);return e(Se,{$maxWidth:n,children:[t($e,{children:t(Ce,{icon:we(B.Action),title:g.ACTIONS,badge:h,badgeTooltip:y,loading:l})}),t(ke,{$maxHeight:i,children:t(De,{columns:zn,rows:p})}),!u.length&&t(Te,{style:{marginTop:"2rem"},children:t(Ne,{})})]})},Vn=p(se)`
30
+ `,Ln=({createAction:i})=>{const{currentModal:a,setCurrentModal:o}=ae(),r=a===G.Action,{formData:l,formErrors:s,handleFormChange:c,resetFormData:d,validateForm:u}=X(),[p,h]=n(void 0),m=()=>{d(),h(void 0),o("")},y=()=>{if(!u({withAlert:!0,alertTitle:ne.Create}))return null;i(l),m()};return V({key:"Enter",active:r},()=>y()),t(oe,{isOpen:r,onClose:m,header:{title:"Add Action"},actionComponent:t(ue,{buttons:[{variant:"primary",label:"DONE",onClick:y,disabled:!p}]}),children:e(re,{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(Kn,{children:[t(le,{type:se.Warning,message:ce.DEFINED_FOR_ALL_STREAMS(g.ACTIONS)}),t(de,{options:Q,selectedOption:p,onOptionSelect:e=>{return t=e,d(),c("type",t?.type||""),void h(t);var t},autoFocus:!p?.type})]}),p?.type?e("div",{children:[t(A,{margin:"16px 0"}),t(An,{action:p,formData:l,formErrors:s,handleFormChange:c})]}):null]})})},Pn=e=>{const{type:t,fields:{collectContainerAttributes:i,collectReplicaSetAttributes:n,collectWorkloadId:a,collectClusterId:o,labelsAttributes:r,annotationsAttributes:l,clusterAttributes:s,overwriteExistingValues:c,attributeNamesToDelete:d,renames:u,piiCategories:p,fallbackSamplingRatio:h,samplingPercentage:m,endpointsFilters:g,attributeFilters:y,servicesNameFilters:b,urlTemplatizationRulesGroups:x}}=e;let $="";if(t===v.K8sAttributes&&(i&&($+="Container Attributes, "),n&&($+="ReplicaSet Attributes, "),a&&($+="Workload ID, "),o&&($+="Cluster ID, "),r?.forEach(({labelKey:e,attributeKey:t,from:i,fromSources:n},a)=>{const o=n?.length?n.join(","):i||f.Pod;$+=`Label: ${e} ${t} ${o} `,a===r.length-1&&($+=", ")}),l?.forEach(({annotationKey:e,attributeKey:t,from:i,fromSources:n},a)=>{const o=n?.length?n.join(","):i||f.Pod;$+=`Annotation: ${e} ${t} ${o} `,a===l.length-1&&($+=", ")})),t===v.AddClusterInfo&&($+=`Overwrite Existing: ${c}\n`,s?.forEach(({attributeName:e,attributeStringValue:t},i)=>{$+=`${e}: ${t}`,i<s.length-1&&($+=", ")})),t===v.DeleteAttributes&&d?.forEach((e,t)=>{$+=e,t<d.length-1&&($+=", ")}),t===v.RenameAttributes){const e=Object.entries(u||{});e.forEach(([t,i],n)=>{$+=`${t}: ${i}`,n<e.length-1&&($+=", ")})}return t===v.PiiMasking&&p?.forEach((e,t)=>{$+=e,t<p.length-1&&($+=", ")}),t===v.ErrorSampler&&($+=String(h)),t===v.ProbabilisticSampler&&($+=String(m),$+="%"),t===v.LatencySampler&&g?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:i,fallbackSamplingRatio:n},a)=>{$+=`Endpoint${g.length>1?` #${a+1}`:""}=${e}${t}\n`,$+=` Latency=${i}`,$+=` Sampling=${n}`,a<g.length-1&&($+=", ")}),t===v.ServiceNameSampler&&b?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i})=>{$+=`Service Name: ${e}, `,$+=`Sampling Ratio: ${t}, `,$+=`Fallback Sampling Ratio: ${i}\n`}),t===v.SpanAttributeSampler&&y?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i})=>{$+=`Service Name: ${e}, `,$+=`Attribute Key: ${t}, `,$+=`Fallback Sampling Ratio: ${i}\n`}),t===v.URLTemplatization&&x?.forEach((e,t)=>{const i=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");$+=`Group ${t+1}: ${i}`,t<x.length-1&&($+="; ")}),$},jn=({conditions:e,id:i})=>{const{errors:n,warnings:a,disableds:o,hasLoadings:r}=c(()=>pe(e),[e]),l=n.length>0?n:a.length>0?a:o.length>0?o:[];if(l.length>0)return t("div",{style:{lineHeight:1},children:t(zn,{conditions:l,id:i})});const s=r?me.Loading:se.Success;return t("div",{style:{lineHeight:1},children:t(he,{status:s,title:s,withBorder:!0,withIcon:!0})})},zn=({conditions:e,id:i})=>{const n=m();return t(O,{children:ge(e).map(({status:e,type:a,reason:o,message:r,lastTransitionTime:l},s)=>{"loading"!==e&&"disabled"!==e||(e=se.Info);const c=ve(e,n);return t(ye,{titleIcon:c,title:a,text:r||o||"",timestamp:l,children:t(he,{status:e,title:o||a,withBorder:!0,withIcon:!0})},`condition-${i}-${e}-${a}-${s}`)})})},qn=({instrumentationRules:e,sources:t,actions:i,destinations:n,searchText:a,selectedCategory:o})=>{const r=a?e.filter(e=>e.type?.toLowerCase().includes(a)||e.ruleName?.toLowerCase().includes(a)):e,l=a?t.filter(e=>e.name?.toLowerCase().includes(a)||e.otelServiceName?.toLowerCase().includes(a)||e.namespace?.toLowerCase().includes(a)):t,s=a?i.filter(e=>e.type?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):i,c=a?n.filter(e=>e.destinationType.displayName?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):n,d=[{category:G.Source,label:"Sources",count:l.length,entities:[]},{category:G.Action,label:"Actions",count:s.length,entities:[]},{category:G.Destination,label:"Destinations",count:c.length,entities:[]},{category:G.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(o)).map(e=>({...e,entities:e.category===G.InstrumentationRule?r:e.category===G.Source?l:e.category===G.Action?s:e.category===G.Destination?c:[]}));return{categories:d,searchResults:u}},Bn=[{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}],Hn=({maxHeight:i,maxWidth:n})=>{const a=m(),o=fe(),{actions:r,actionsLoading:l}=Y(),{setDrawerType:s,setDrawerEntityId:d}=H(),u=c(()=>qn({instrumentationRules:[],sources:[],actions:be(r,o),destinations:[],searchText:o.searchText,selectedCategory:G.Action}).searchResults.find(({category:e})=>e===G.Action)?.entities||[],[r,o]),p=c(()=>u.map(e=>{const{hasErrors:i,hasWarnings:n,hasDisableds:o}=pe(e.conditions||[]);return{status:i?se.Error:n?se.Warning:void 0,faded:o,onClick:()=>{s(G.Action),d(e.id)},cells:[{columnKey:"icon",component:()=>t(xe,{icon:ie(e.type)})},{columnKey:"name",value:$e(e,G.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:Pn(e),textColor:a.text.info,withTooltip:!0},{columnKey:"signals",component:()=>t(Se,{withLabels:!0,monitors:e.signals||[]})},{columnKey:"conditions",component:()=>t(jn,{conditions:e.conditions||[],id:e.id})},{columnKey:"active-status",component:()=>t("div",{style:{lineHeight:1},children:t(he,{status:e.disabled?se.Error:se.Success,title:e.disabled?g.DISABLED:g.ENABLED,withIcon:!0,withBorder:!0})})}]}}),[u]),{badge:h,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(Ce,{$maxWidth:n,children:[t(ke,{children:t(we,{icon:Te(G.Action),title:g.ACTIONS,badge:h,badgeTooltip:y,loading:l})}),t(De,{$maxHeight:i,children:t(Ne,{columns:Bn,rows:p})}),!u.length&&t(Ee,{style:{marginTop:"2rem"},children:t(Ae,{})})]})},Vn=p(F)`
31
31
  // width: 100vw;
32
32
  // height: 100vh;
33
33
  gap: 64px;
34
34
  align-items: center;
35
35
  justify-content: center;
36
- `,Bn=p(se)`
36
+ `,Wn=p(F)`
37
37
  max-width: 400px;
38
38
  gap: 12px;
39
39
  align-items: center;
40
40
  justify-content: center;
41
- `,Wn=p(P)`
41
+ `,_n=p(B)`
42
42
  text-align: center;
43
43
  font-size: 24px;
44
- `,_n=p(P)`
44
+ `,Un=p(B)`
45
45
  text-align: center;
46
46
  line-height: 26px;
47
47
  color: ${({theme:e})=>e.text.info};
48
- `,Jn=()=>{const[i,o]=n(0);return a(()=>{(async()=>{for(let e=0;e<=100;e+=5)await Oe(500),o(e)})()},[]),e(Vn,{children:[t(Ii,{size:100}),t(Ee,{width:400}),e(Bn,{children:[e(pe,{$gap:16,children:[t(Wn,{children:"Preparing your workspace..."}),t(Fe,{label:`${i}%`})]}),t(_n,{children:"It can take up to a few minutes. Grab a cup of coffee, look out a window, and enjoy your free moment!"})]})]})},Un=p(se)`
48
+ `,Jn=()=>{const[i,o]=n(0);return a(()=>{(async()=>{for(let e=0;e<=100;e+=5)await Ie(500),o(e)})()},[]),e(Vn,{children:[t(Oi,{size:100}),t(Fe,{width:400}),e(Wn,{children:[e(O,{$gap:16,children:[t(_n,{children:"Preparing your workspace..."}),t(Oe,{label:`${i}%`})]}),t(Un,{children:"It can take up to a few minutes. Grab a cup of coffee, look out a window, and enjoy your free moment!"})]})]})},Gn=p(F)`
49
49
  align-items: center !important;
50
50
  justify-content: center !important;
51
51
  align-self: stretch;
@@ -61,9 +61,9 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
61
61
  cursor: pointer;
62
62
 
63
63
  &:hover {
64
- background-color: ${({theme:e})=>e.colors.dropdown_bg_2+A["030"]};
64
+ background-color: ${({theme:e})=>e.colors.dropdown_bg_2+L["030"]};
65
65
  }
66
- `,Yn=({entityType:i,description:n})=>{const{setCurrentModal:a}=Z();return e(Un,{onClick:()=>a(i),children:[e(pe,{$gap:4,children:[t(Ri,{}),e(P,{size:14,weight:600,family:"secondary",decoration:"underline",children:["Add ",i]})]}),t(P,{size:12,align:"center",children:n})]})},Gn=p.div`
66
+ `,Yn=({entityType:i,description:n})=>{const{setCurrentModal:a}=ae();return e(Gn,{onClick:()=>a(i),children:[e(O,{$gap:4,children:[t(Ii,{}),e(B,{size:14,weight:600,family:"secondary",decoration:"underline",children:["Add ",i]})]}),t(B,{size:12,align:"center",children:n})]})},Xn=p.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 i}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
- `,Xn=p(pe)`
74
+ `,Zn=p(O)`
75
75
  margin-left: ${({$marginLeft:e})=>e};
76
- `,Qn=p(Ie)`
76
+ `,Qn=p(Me)`
77
77
  width: 24px;
78
78
  height: 24px;
79
79
  padding: 0;
80
- `,Zn=p.div`
80
+ `,ea=p.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 i}from"react/jsx-runtime";import{useState
86
86
  height: 4px;
87
87
  width: ${({percent:e})=>`${e}%`};
88
88
  transition: width 0.3s;
89
- `,ea=({entityType:i,badge:n,badgeTooltip:a,isLoading:o,refetch:r,partiallySelected:l,allSelected:s,onSelectAll:c,progressPercent:d})=>{const u=m(),{setCurrentModal:p}=Z(),h=we(i);return e(Gn,{children:[c&&t(Xn,{$marginLeft:"28px",children:t(S,{partiallyChecked:l,value:s,onChange:c})}),t(Xn,{$marginLeft:i===B.Source?"0":"28px",children:t(Ce,{icon:h,title:`${i}s`,badge:n,badgeTooltip:a,loading:!1})}),e(Xn,{$marginLeft:"auto",children:[t(Qn,{"data-id":`refresh-${i}`,variant:"secondary",onClick:r,disabled:o,children:o?t(Ae,{scale:.8}):t(Mi,{fill:u.colors.secondary,size:18})}),t(Qn,{"data-id":`add-${i}`,variant:"primary",onClick:()=>p(i),children:t(Ri,{fill:u.colors.primary,size:18})})]}),"number"==typeof d&&t(Zn,{percent:d})]})},ta=p.div`
89
+ `,ta=({entityType:i,badge:n,badgeTooltip:a,isLoading:o,refetch:r,partiallySelected:l,allSelected:s,onSelectAll:c,progressPercent:d})=>{const u=m(),{setCurrentModal:p}=ae(),h=Te(i);return e(Xn,{children:[c&&t(Zn,{$marginLeft:"28px",children:t($,{partiallyChecked:l,value:s,onChange:c})}),t(Zn,{$marginLeft:i===G.Source?"0":"28px",children:t(we,{icon:h,title:`${i}s`,badge:n,badgeTooltip:a,loading:!1})}),e(Zn,{$marginLeft:"auto",children:[t(Qn,{"data-id":`refresh-${i}`,variant:"secondary",onClick:r,disabled:o,children:o?t(Re,{scale:.8}):t(Ri,{fill:u.colors.secondary,size:18})}),t(Qn,{"data-id":`add-${i}`,variant:"primary",onClick:()=>p(i),children:t(Ii,{fill:u.colors.primary,size:18})})]}),"number"==typeof d&&t(ea,{percent:d})]})},ia=p.div`
90
90
  padding: 2px 6px;
91
91
  background-color: ${({theme:e})=>e.colors.primary};
92
92
  border-radius: 360px;
@@ -101,7 +101,42 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
101
101
  align-items: center;
102
102
  justify-content: center;
103
103
  white-space: nowrap;
104
- `,ia=({entityId:i,entityType:n,status:a,faded:o,title:r,subTitle:l,tooltip:s,label:c,icon:d,icons:u,iconSrc:p,iconSrcs:h,monitors:g,isActive:y,raw:v})=>{const b=m(),f=n===B.Source,x="boolean"==typeof y,{setDrawerType:S,setDrawerEntityId:$}=j(),{selectedSources:C,setSelectedSources:w}=Re(),k={...C},{namespace:D,name:T,kind:N}=v;f&&!k[D]&&(k[D]=[]);const E=f?k[D].findIndex(e=>e.name===T&&e.kind===N):-1;return t(Me,{"data-id":n===B.Source?`${i.namespace}-${i.name}-${i.kind}`:i,title:r,subTitle:l,onClick:()=>{S(n),$(i)},renderActions:()=>{const i=f&&(!v.conditions?.length||v.conditions?.some(({status:e})=>"loading"===e)),n=x&&!y?ge(ne.Info,b):a?ge(a,b):void 0,o=i?t(Ae,{scale:.8}):n?t(n,{size:14}):null;return c?e(ta,{$isError:a===ne.Error,children:[t(me,{text:s||"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:h},visualProps:{status:a,faded:o||x&&!y,monitors:g||void 0},checkboxProps:{withCheckbox:f,isChecked:-1!==E,onCheckboxChange:()=>{-1===E?k[D].push(v):k[D].splice(E,1),w(k)}}})},na=p.div`
104
+ `,na=({entityId:i,entityType:n,status:a,faded:o,title:r,subTitle:l,tooltip:s,label:c,icon:d,icons:u,iconSrc:p,iconSrcs:h,monitors:g,isActive:y,raw:v})=>{const f=m(),b=n===G.Source,x="boolean"==typeof y,{setDrawerType:$,setDrawerEntityId:S}=H(),{selectedSources:C,setSelectedSources:k}=Ke(),w={...C},{namespace:T,name:D,kind:N}=v;b&&!w[T]&&(w[T]=[]);const E=b?w[T].findIndex(e=>e.name===D&&e.kind===N):-1;return t(Le,{"data-id":n===G.Source?`${i.namespace}-${i.name}-${i.kind}`:i,title:r,subTitle:l,onClick:()=>{$(n),S(i)},renderActions:()=>{const i=b&&(!v.conditions?.length||v.conditions?.some(({status:e})=>"loading"===e)),n=x&&!y?ve(se.Info,f):a?ve(a,f):void 0,o=i?t(Re,{scale:.8}):n?t(n,{size:14}):null;return c?e(ia,{$isError:a===se.Error,children:[t(ye,{text:s||"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:h},visualProps:{status:a,faded:o||x&&!y,monitors:g||void 0},checkboxProps:{withCheckbox:b,isChecked:-1!==E,onCheckboxChange:()=>{-1===E?w[T].push(v):w[T].splice(E,1),k(w)}}})};function aa(e){const t=e.conditions?.some(({status:e})=>e===me.Loading);return t?e:{...e,conditions:[{status:me.Loading,type:"Pending",message:"",lastTransitionTime:""}]}}function oa(e){const t=e.conditions?.filter(({status:e})=>e!==me.Loading);return t?.length===e.conditions?.length?e:{...e,conditions:t?.length?t:[{status:se.Success,type:"Healthy",message:"",lastTransitionTime:""}]}}const ra=p.div`
105
+ position: absolute;
106
+ top: 12px;
107
+ left: 12px;
108
+ right: 12px;
109
+ z-index: 1;
110
+ padding: 4px 12px;
111
+ background: ${({theme:e})=>e.colors.primary};
112
+ border-bottom: 1px solid ${({theme:e})=>e.colors.border};
113
+ border-radius: 12px 12px 0 0;
114
+ pointer-events: none;
115
+ `,la=p.span`
116
+ font-family: ${({theme:e})=>e.font_family.primary};
117
+ font-size: 11px;
118
+ font-weight: 600;
119
+ color: ${({theme:e})=>e.text.grey};
120
+ text-transform: uppercase;
121
+ letter-spacing: 0.5px;
122
+ `,sa=p.div`
123
+ display: flex;
124
+ align-items: center;
125
+ gap: 8px;
126
+ padding: 4px 8px 0;
127
+ `,ca=p.div`
128
+ flex: 1;
129
+ height: 1px;
130
+ background: ${({theme:e})=>e.colors.border};
131
+ `,da=p.span`
132
+ font-family: ${({theme:e})=>e.font_family.secondary};
133
+ font-size: 10px;
134
+ font-weight: 600;
135
+ color: ${({theme:e})=>e.text.grey};
136
+ text-transform: uppercase;
137
+ letter-spacing: 0.5px;
138
+ white-space: nowrap;
139
+ `,ua=({namespace:e})=>t(ra,{children:t(la,{children:e})}),pa=({namespace:i})=>e(sa,{children:[t(ca,{}),t(da,{children:i}),t(ca,{})]}),ha=p.div`
105
140
  height: calc(${({$height:e})=>e}px - 24px);
106
141
  width: calc(100% - 24px);
107
142
  padding: 12px;
@@ -109,7 +144,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
109
144
  border: 1px dashed ${({theme:e})=>e.colors.border};
110
145
  border-radius: 24px;
111
146
  position: relative;
112
- `,aa=p.div`
147
+ `,ma=p.div`
113
148
  position: absolute;
114
149
  bottom: 0;
115
150
  left: 0;
@@ -124,18 +159,18 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
124
159
  justify-content: center;
125
160
 
126
161
  pointer-events: none;
127
- `,oa=({height:i,entityType:n,entities:a,metrics:o})=>{const{isVm:r}=Le(),l=s(()=>a.map(e=>{const i=J(e);if(!i)return null;const a=[B.Source,B.Destination].includes(n),l=[B.Destination,B.Action].includes(n),s=[B.Destination,B.Action,B.InstrumentationRule].includes(n),c=l?n==B.Destination?Pe(e.exportedSignals):e.signals:void 0,d=a?o?.[`${n.toLowerCase()}s`]?.find(e=>JSON.stringify(J(e))===JSON.stringify(i)):void 0,u=s?!e.disabled:void 0,p=fe(e,n,{extended:n===B.Source,prioritizeDisplayName:n!==B.Source}),h=((e,t,i)=>{switch(e){case B.Source:return i?`${t.kind}`:`${t.namespace} • ${t.kind}`;case B.Destination:return t.destinationType.displayName;case B.Action:case B.InstrumentationRule:return t.type;default:return""}})(n,e,r),m=a?je(d?.throughput):void 0,{priorotizedStatus:g,hasDisableds:y}=ce(e.conditions||[]),{icons:v,icon:b,iconSrc:f}=((e,t)=>{switch(e){case B.Source:return{icons:He(t.containers),icon:we(e)};case B.Destination:return ze(t.destinationType.type);case B.Action:return{icon:X(t.type)};case B.InstrumentationRule:return{icon:qe(t.type)};default:return{icon:we(e)}}})(n,e),x=n===B.Source?e.podsAgentInjectionStatus:void 0,S=x?(e=>{switch(e){case Ve.Error:return ne.Error;case Ve.Notice:return ne.Warning;case Ve.Waiting:return ne.Info}})(x.status):void 0,$=x&&S?x.message:void 0;return t(ia,{entityType:n,entityId:i,raw:e,title:p,subTitle:h,faded:y,status:S||g,tooltip:$,label:m,icons:v,icon:b,iconSrc:f,monitors:c,isActive:u},JSON.stringify(i))}),[a,n,o,r]);return e(na,{$height:i,children:[t(Ke,{gap:8,elements:l}),t(aa,{$hide:!0})]})},ra=p.div`
162
+ `,ga={[G.Source]:{subTitle:(e,t)=>t?e.kind:`${e.namespace} • ${e.kind}`,icons:e=>({icons:We(e),icon:Te(G.Source)}),withMetrics:!0},[G.Destination]:{subTitle:e=>e.destinationType.displayName,icons:e=>Ve(e.destinationType.type),withMetrics:!0,withMonitors:!0,withActive:!0},[G.Action]:{subTitle:e=>e.type,icons:e=>({icon:ie(e.type)}),withMonitors:!0,withActive:!0},[G.InstrumentationRule]:{subTitle:e=>e.type,icons:e=>({icon:He(e.type)}),withActive:!0},[G.Namespace]:{subTitle:()=>"",icons:()=>({icon:Te(G.Namespace)})}};const ya=({height:i,entityType:o,entities:r,metrics:l})=>{const{isVm:s}=je(),u=o===G.Source,[p,h]=n(""),m=c(()=>r.map(e=>function(e,t,i,n){const a=Z(e);if(!a)return null;const o=ga[t],r=t===G.Source,l=o.withMonitors?t===G.Destination?qe(e.exportedSignals):e.signals:void 0,s=o.withMetrics?n?.[`${t.toLowerCase()}s`]?.find(e=>JSON.stringify(Z(e))===JSON.stringify(a)):void 0,c=o.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 Pe.Failure:return{status:se.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message??void 0,displaySource:e};case Pe.Notice:return{status:se.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message??void 0,displaySource:e};case Pe.Pending:case Pe.Waiting:return{status:void 0,faded:!1,displaySource:aa(e)};case Pe.Unsupported:case Pe.Disabled:return{status:void 0,faded:!0,displaySource:e};default:return{status:void 0,faded:!1,displaySource:oa(e)}}}(e);d=t.status,p=t.faded,u=t.tooltip,h=t.displaySource}else{const{priorotizedStatus:t,hasDisableds:i}=pe(e.conditions||[]);d=t,p=i}return{entityId:a,namespace:r?e.namespace:void 0,title:$e(e,t,{extended:r,prioritizeDisplayName:!r}),subTitle:o.subTitle(e,i),status:d,faded:p,tooltip:u,label:o.withMetrics?Be(s?.throughput):void 0,...o.icons(e),monitors:l,isActive:c,raw:h}}(e,o,s,l)).filter(Boolean),[r,o,l,s]),{elements:g,indexToNamespace:y,multipleNs:v}=c(()=>{const e=[],i=[],n=new Set(m.map(e=>e.namespace).filter(Boolean)).size>1;n&&(i.push(""),e.push(t("div",{style:{height:28}},"ns-spacer")));let a="";for(const n of m)u&&n.namespace&&n.namespace!==a&&(""!==a&&(i.push(n.namespace),e.push(t(pa,{namespace:n.namespace},`ns-divider-${n.namespace}`))),a=n.namespace),i.push(n.namespace||""),e.push(t(na,{entityType:o,entityId:n.entityId,raw:n.raw,title:n.title,subTitle:n.subTitle,faded:n.faded,status:n.status,tooltip:n.tooltip,label:n.label,icons:n.icons,icon:n.icon,iconSrc:n.iconSrc,monitors:n.monitors,isActive:n.isActive},JSON.stringify(n.entityId)));return{elements:e,indexToNamespace:i,multipleNs:n}},[m,o,u]);a(()=>{if(u&&y.length&&!p){const e=y.find(Boolean);e&&h(e)}},[u,y]);const f=d(e=>{if(!y.length)return;const t=y[Math.min(e,y.length-1)];t&&t!==p&&h(t)},[y,p]);return e(ha,{$height:i,children:[v&&p&&t(ua,{namespace:p}),t(ze,{gap:8,elements:g,onTopIndexChange:v?f:void 0}),t(ma,{$hide:!0})]})},va=p.div`
128
163
  width: ${({$isVm:e})=>e?"45vw":"22vw"};
129
164
  display: flex;
130
165
  flex-direction: column;
131
166
  gap: 12px;
132
- `,la=({entityType:i,entities:n,unfilteredCount:a,metrics:o,loading:r,maxHeight:l,refetch:c})=>{const{isVm:d}=Le(),{frameHeight:u,hasFiltersApplied:p,isSources:h}=s(()=>({frameHeight:Math.min(l,80*n.length+12),hasFiltersApplied:n.length!==a,isSources:i===B.Source}),[i,n.length,l,a]),{progress:m}=Be(),y=s(()=>h&&(m[We.Instrumenting]||m[We.Uninstrumenting])?m[We.Instrumenting]?.percentage||m[We.Uninstrumenting]?.percentage||0:void 0,[h,m[We.Instrumenting],m[We.Uninstrumenting]]),{selectedSources:v,setSelectedSources:b}=Re(),f=s(()=>h?Object.values(v).reduce((e,t)=>e+t.length,0):0,[h,v]);return d&&[B.InstrumentationRule,B.Action].includes(i)?null:e(ra,{$isVm:d,children:[t(ea,{entityType:i,badge:"number"==typeof y?`${y}%`:p?`${n.length}/${a}`:a,badgeTooltip:p?g.FILTERED_COUNT_TOOLTIP:void 0,isLoading:r,refetch:c,partiallySelected:f>0&&n?.length!==f,allSelected:f>0&&n?.length===f,onSelectAll:h?e=>{if(h)if(e){const e={};n?.forEach(t=>{const{namespace:i}=t;e[i]?e[i].push(t):e[i]=[t]}),b(e)}else b({})}:void 0,progressPercent:y}),n.length?t(oa,{height:u,entityType:i,entities:n,metrics:o}):r?t(_e,{size:3}):t(Yn,{entityType:i,description:g.TO_COLLECT_OTEL_DATA})]})},sa=p.div`
167
+ `,fa=({entityType:i,entities:n,unfilteredCount:a,metrics:o,loading:r,maxHeight:l,refetch:s})=>{const{isVm:d}=je(),{frameHeight:u,hasFiltersApplied:p,isSources:h}=c(()=>({frameHeight:Math.min(l,80*n.length+12),hasFiltersApplied:n.length!==a,isSources:i===G.Source}),[i,n.length,l,a]),{progress:m}=_e(),y=c(()=>h&&(m[Ue.Instrumenting]||m[Ue.Uninstrumenting])?m[Ue.Instrumenting]?.percentage||m[Ue.Uninstrumenting]?.percentage||0:void 0,[h,m[Ue.Instrumenting],m[Ue.Uninstrumenting]]),{selectedSources:v,setSelectedSources:f}=Ke(),b=c(()=>h?Object.values(v).reduce((e,t)=>e+t.length,0):0,[h,v]);return d&&[G.InstrumentationRule,G.Action].includes(i)?null:e(va,{$isVm:d,children:[t(ta,{entityType:i,badge:"number"==typeof y?`${y}%`:p?`${n.length}/${a}`:a,badgeTooltip:p?g.FILTERED_COUNT_TOOLTIP:void 0,isLoading:r,refetch:s,partiallySelected:b>0&&n?.length!==b,allSelected:b>0&&n?.length===b,onSelectAll:h?e=>{if(h)if(e){const e={};n?.forEach(t=>{const{namespace:i}=t;e[i]?e[i].push(t):e[i]=[t]}),f(e)}else f({})}:void 0,progressPercent:y}),n.length?t(ya,{height:u,entityType:i,entities:n,metrics:o}):r?t(Je,{size:3}):t(Yn,{entityType:i,description:g.TO_COLLECT_OTEL_DATA})]})},ba=p.div`
133
168
  width: 100%;
134
169
  height: ${({$height:e})=>e};
135
170
  display: flex;
136
171
  justify-content: space-evenly;
137
172
  gap: 24px;
138
- `,ca=({height:i,metrics:o,refetchSources:r,refetchDestinations:l,refetchActions:c,refetchInstrumentationRules:d})=>{const u=ye(),{selectedStreamName:p}=Je(),{containerRef:h,containerHeight:m}=Ue(),{sources:g,sourcesLoading:y,destinations:v,destinationsLoading:b,actions:f,actionsLoading:x,instrumentationRules:S,instrumentationRulesLoading:$}=W(),C=s(()=>Ye(g,p),[g,p]),w=s(()=>Ge(v,p),[v,p]),[k,D]=n([]),[T,N]=n([]),[E,F]=n([]),[O,A]=n([]);return a(()=>{D(Xe(C,u))},[C,u]),a(()=>{N(Qe(w,u))},[w,u]),a(()=>{F(ve(f,u))},[f,u]),a(()=>{A(S)},[S]),e(sa,{ref:h,$height:i,children:[t(la,{entityType:B.InstrumentationRule,entities:O,unfilteredCount:S.length,loading:$,maxHeight:m,refetch:d}),t(la,{entityType:B.Source,entities:k,unfilteredCount:C.length,metrics:o,loading:y,maxHeight:m,refetch:r}),t(la,{entityType:B.Action,entities:E,unfilteredCount:f.length,loading:x,maxHeight:m,refetch:c}),t(la,{entityType:B.Destination,entities:T,unfilteredCount:w.length,metrics:o,loading:b,maxHeight:m,refetch:l})]})},da=p.div`
173
+ `,xa=({height:i,metrics:o,refetchSources:r,refetchDestinations:l,refetchActions:s,refetchInstrumentationRules:d})=>{const u=fe(),{selectedStreamName:p}=Ge(),{containerRef:h,containerHeight:m}=Ye(),{sources:g,sourcesLoading:y,destinations:v,destinationsLoading:f,actions:b,actionsLoading:x,instrumentationRules:$,instrumentationRulesLoading:S}=Y(),C=c(()=>Xe(g,p),[g,p]),k=c(()=>Ze(v,p),[v,p]),[w,T]=n([]),[D,N]=n([]),[E,A]=n([]),[F,O]=n([]);return a(()=>{T(Qe(C,u))},[C,u]),a(()=>{N(et(k,u))},[k,u]),a(()=>{A(be(b,u))},[b,u]),a(()=>{O($)},[$]),e(ba,{ref:h,$height:i,children:[t(fa,{entityType:G.InstrumentationRule,entities:F,unfilteredCount:$.length,loading:S,maxHeight:m,refetch:d}),t(fa,{entityType:G.Source,entities:w,unfilteredCount:C.length,metrics:o,loading:y,maxHeight:m,refetch:r}),t(fa,{entityType:G.Action,entities:E,unfilteredCount:b.length,loading:x,maxHeight:m,refetch:s}),t(fa,{entityType:G.Destination,entities:D,unfilteredCount:k.length,metrics:o,loading:f,maxHeight:m,refetch:l})]})},$a=p.div`
139
174
  position: relative;
140
175
  max-width: 200px;
141
176
  `;p.div`
@@ -149,65 +184,65 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
149
184
  background-color: ${({theme:e})=>e.colors.dropdown_bg};
150
185
  border: ${({theme:e})=>`1px solid ${e.colors.border}`};
151
186
  border-radius: 24px;
152
- `;const ua=p.div`
187
+ `;const Sa=p.div`
153
188
  display: flex;
154
189
  align-items: center;
155
190
  overflow-x: scroll;
156
- `,pa=({onClose:i})=>{const o=m(),{onClickNode:r}=Ze(),{searchText:l}=ye(),{selectedStreamName:d}=Je(),{sources:u,destinations:p,actions:h,instrumentationRules:g}=W(),{popupRef:y,popupOpen:v,setPopupOpen:b,popupPosition:f,handlePosition:x}=et();a(()=>{v||(x(0,50),b(!0))},[v]);const[S,$]=n("all"),{categories:C,searchResults:w}=s(()=>qn({instrumentationRules:g,sources:Ye(u,d),actions:h,destinations:Ge(p,d),searchText:l,selectedCategory:S}),[g,u,h,p,d,l,S]);return w.length?t(tt,{ref:y,isOpen:v,top:f.top,left:f.left,maxWidth:"420px",header:t(ua,{children:C.map(({category:e,label:i,count:n})=>!!n&&t(nt,{label:i,badgeLabel:n,isSelected:S===e,onClick:()=>$(e)},`category-select-${e}`))}),children:w.map(({category:n,label:a,entities:l},s)=>!!l.length&&e(c,{children:[e(it,{style:{maxHeight:"all"!==S?"240px":"140px",padding:"12px 0"},children:[t(P,{size:12,family:"secondary",color:o.text.darker_grey,style:{marginLeft:"16px"},children:a}),l.map((e,a)=>t(nt,{icon:we(n),label:fe(e,n,{extended:!0}),onClick:()=>{const t=J(e);r(null,{data:{type:n,id:t}}),i()},style:{width:"100%",justifyContent:"flex-start"},color:"transparent"},`entity-${s}-${a}`))]}),t(re,{thickness:s===w.length-1?0:1,length:"90%",margin:"8px auto"})]},`category-list-${n}`))}):t(tt,{ref:y,isOpen:v,top:f.top,left:f.left,children:t(Ne,{})})},ha=({preventPopup:i=!1})=>{const{searchText:a,setSearchText:o}=ye(),[l,s]=n(!1),c=!!a||l,d=()=>{o(""),s(!1)},u=r(null);return at(u,d),K({key:"Escape",active:c},d),e(da,{ref:u,children:[t(C,{placeholder:"Search",icon:Li,value:a,onChange:e=>o(e.target.value.toLowerCase()),onFocus:()=>s(!0)}),c&&!i?t(pa,{onClose:d}):null]})},ma=({sources:e,title:i="Condition",value:n,onSelect:a,onDeselect:o,...r})=>{const l=s(()=>{const t=[];return e.forEach(({conditions:e})=>{e?.forEach(({type:e,reason:i})=>{t.find(t=>t.id===`${e}#${i}`)||t.push({id:`${e}#${i}`,value:`${ot(e)} - ${ot(i)}`})})}),t.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[e]);return t(rt,{disabled:!l?.length,title:i,placeholder:"All",options:l,value:n,onSelect:a,onDeselect:o,...r})},ga=({sources:e,title:i="Error Message",value:n,onSelect:a,onDeselect:o,disabled:r,...l})=>{const c=s(()=>{const t=[];return e.forEach(({conditions:e})=>{he(e||[]).forEach(({status:e,message:i,reason:n})=>{e!==ne.Error||t.find(e=>e.id===i)||(i?t.find(e=>e.id===i)||t.push({id:i,value:i}):n&&(t.find(e=>e.id===n)||t.push({id:n,value:n})))})}),t},[e]);return t(rt,{disabled:r||!c?.length,title:i,placeholder:"All",options:c,value:n,onSelect:a,onDeselect:o,...l})},ya=({sources:e,title:i="Programming Language",value:n,onSelect:a,onDeselect:o,...r})=>{const l=s(()=>{const t=[];return e.forEach(({containers:e})=>{e?.forEach(({language:e})=>{t.find(t=>t.id===e)||t.push({id:e,value:lt[e]||e})})}),t.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[e]);return t(rt,{disabled:!l?.length,title:i,placeholder:"All",options:l,value:n,onSelect:a,onDeselect:o,...r})},va=({title:e="Monitors",value:i,onSelect:n,onDeselect:a,...o})=>{const r=s(()=>{const e=[];return st.forEach(({id:t,value:i})=>{e.find(e=>e.id===t)||e.push({id:t,value:i})}),e},[]);return t(rt,{disabled:!r?.length,title:e,placeholder:"All",options:r,value:i,onSelect:n,onDeselect:a,...o})},ba=({namespaces:e,title:i="Namespace",value:n,onSelect:a,onDeselect:o,...r})=>{const l=s(()=>{const t=[];return e?.forEach(({name:e})=>{t.find(t=>t.id===e)||t.push({id:e,value:e})}),t},[e]);return t(rt,{disabled:!l?.length,title:i,placeholder:"Select namespace",options:l,value:n,onSelect:a,onDeselect:o,...r})},fa=({sources:e,title:i="Kind",value:n,onSelect:a,onDeselect:o,...r})=>{const l=s(()=>{const t=[];return e.forEach(({kind:e})=>{t.find(t=>t.id===e)||t.push({id:e,value:e})}),t},[e]);return t(rt,{disabled:!l?.length,title:i,placeholder:"All",options:l,value:n,onSelect:a,onDeselect:o,...r})},xa=({sources:e,title:i="Agent Injection Status",value:n,onSelect:a,onDeselect:o,disabled:r,...l})=>{const c=s(()=>{const t=[];return e.forEach(({podsAgentInjectionStatus:e})=>{const{reasonEnum:i,message:n}=e||{};i?t.find(e=>e.id===i)||t.push({id:i,value:ot(i)}):n&&(t.find(e=>e.id===n)||t.push({id:n,value:n}))}),t},[e]);return t(rt,{disabled:r||!c?.length,title:i,placeholder:"All",options:c,value:n,onSelect:a,onDeselect:o,...l})},Sa=p.div`
191
+ `,Ca=({onClose:i})=>{const r=m(),{onClickNode:l}=tt(),{searchText:s}=fe(),{selectedStreamName:d}=Ge(),{sources:u,destinations:p,actions:h,instrumentationRules:g}=Y(),{popupRef:y,popupOpen:v,setPopupOpen:f,popupPosition:b,handlePosition:x}=it();a(()=>{v||(x(0,50),f(!0))},[v]);const[$,S]=n("all"),{categories:C,searchResults:k}=c(()=>qn({instrumentationRules:g,sources:Xe(u,d),actions:h,destinations:Ze(p,d),searchText:s,selectedCategory:$}),[g,u,h,p,d,s,$]);return k.length?t(nt,{ref:y,isOpen:v,top:b.top,left:b.left,maxWidth:"420px",header:t(Sa,{children:C.map(({category:e,label:i,count:n})=>!!n&&t(ot,{label:i,badgeLabel:n,isSelected:$===e,onClick:()=>S(e)},`category-select-${e}`))}),children:k.map(({category:n,label:a,entities:s},c)=>!!s.length&&e(o,{children:[e(at,{style:{maxHeight:"all"!==$?"240px":"140px",padding:"12px 0"},children:[t(B,{size:12,family:"secondary",color:r.text.darker_grey,style:{marginLeft:"16px"},children:a}),s.map((e,a)=>t(ot,{icon:Te(n),label:$e(e,n,{extended:!0}),onClick:()=>{const t=Z(e);l(null,{data:{type:n,id:t}}),i()},style:{width:"100%",justifyContent:"flex-start"},color:"transparent"},`entity-${c}-${a}`))]}),t(A,{thickness:c===k.length-1?0:1,length:"90%",margin:"8px auto"})]},`category-list-${n}`))}):t(nt,{ref:y,isOpen:v,top:b.top,left:b.left,children:t(Ae,{})})},ka=({preventPopup:i=!1})=>{const{searchText:a,setSearchText:o}=fe(),[r,s]=n(!1),c=!!a||r,d=()=>{o(""),s(!1)},u=l(null);return rt(u,d),V({key:"Escape",active:c},d),e($a,{ref:u,children:[t(C,{placeholder:"Search",icon:Mi,value:a,onChange:e=>o(e.target.value.toLowerCase()),onFocus:()=>s(!0)}),c&&!i?t(Ca,{onClose:d}):null]})},wa=({sources:e,title:i="Condition",value:n,onSelect:a,onDeselect:o,...r})=>{const l=c(()=>{const t=[];return e.forEach(({conditions:e})=>{e?.forEach(({type:e,reason:i})=>{t.find(t=>t.id===`${e}#${i}`)||t.push({id:`${e}#${i}`,value:`${lt(e)} - ${lt(i)}`})})}),t.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[e]);return t(st,{disabled:!l?.length,title:i,placeholder:"All",options:l,value:n,onSelect:a,onDeselect:o,...r})},Ta=({sources:e,title:i="Error Message",value:n,onSelect:a,onDeselect:o,disabled:r,...l})=>{const s=c(()=>{const t=[];return e.forEach(({conditions:e})=>{ge(e||[]).forEach(({status:e,message:i,reason:n})=>{e!==se.Error||t.find(e=>e.id===i)||(i?t.find(e=>e.id===i)||t.push({id:i,value:i}):n&&(t.find(e=>e.id===n)||t.push({id:n,value:n})))})}),t},[e]);return t(st,{disabled:r||!s?.length,title:i,placeholder:"All",options:s,value:n,onSelect:a,onDeselect:o,...l})},Da=({sources:e,title:i="Programming Language",value:n,onSelect:a,onDeselect:o,...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:ct[e]||e})})}),t.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[e]);return t(st,{disabled:!l?.length,title:i,placeholder:"All",options:l,value:n,onSelect:a,onDeselect:o,...r})},Na=({title:e="Monitors",value:i,onSelect:n,onDeselect:a,...o})=>{const r=c(()=>{const e=[];return dt.forEach(({id:t,value:i})=>{e.find(e=>e.id===t)||e.push({id:t,value:i})}),e},[]);return t(st,{disabled:!r?.length,title:e,placeholder:"All",options:r,value:i,onSelect:n,onDeselect:a,...o})},Ea=({namespaces:e,title:i="Namespace",value:n,onSelect:a,onDeselect:o,...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(st,{disabled:!l?.length,title:i,placeholder:"Select namespace",options:l,value:n,onSelect:a,onDeselect:o,...r})},Aa=({sources:e,title:i="Kind",value:n,onSelect:a,onDeselect:o,...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(st,{disabled:!l?.length,title:i,placeholder:"All",options:l,value:n,onSelect:a,onDeselect:o,...r})},Fa=({sources:e,title:i="Agent Injection Status",value:n,onSelect:a,onDeselect:o,disabled:r,...l})=>{const s=c(()=>{const t=[];return e.forEach(({podsAgentInjectionStatus:e})=>{const{reasonEnum:i,message:n}=e||{};i?t.find(e=>e.id===i)||t.push({id:i,value:lt(i)}):n&&(t.find(e=>e.id===n)||t.push({id:n,value:n}))}),t},[e]);return t(st,{disabled:r||!s?.length,title:i,placeholder:"All",options:s,value:n,onSelect:a,onDeselect:o,...l})},Oa=p.div`
157
192
  display: flex;
158
193
  flex-direction: column;
159
194
  gap: 12px;
160
195
  padding: 12px;
161
- `,$a=p.div`
196
+ `,Ia=p.div`
162
197
  padding: 12px 6px 6px 6px;
163
- `,Ca=p(Ie)`
198
+ `,Ra=p(Me)`
164
199
  font-size: 14px;
165
200
  ${({$color:e})=>`color: ${e};`}
166
- `,wa=p.div`
201
+ `,Ma=p.div`
167
202
  margin-left: auto;
168
- `,ka=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},Da=()=>{const i=m(),{namespaces:o,sources:l}=W(),{selectedStreamName:c}=Je(),{getItemSS:d,setItemSS:u,removeItemSS:p}=dt(),{popupRef:h,popupOpen:g,setPopupOpen:y,popupPosition:v,handlePosition:b}=et(),{namespaces:f,kinds:x,monitors:S,languages:$,conditions:C,errors:w,onlyErrors:k,podsAgentInjectionStatus:D,setAll:N,clearAll:E,getEmptyState:F}=ye(),O=s(()=>Ye(l,c),[l,c]),[A,I]=n({namespaces:f,kinds:x,monitors:S,languages:$,conditions:C,errors:w,onlyErrors:k,podsAgentInjectionStatus:D}),[R,M]=n(ka(A));a(()=>{const e=d(ct.OVERVIEW_FILTERS,F());N(e)},[]),a(()=>{if(!g){const e={namespaces:f,kinds:x,monitors:S,languages:$,conditions:C,errors:w,onlyErrors:k};I(e),M(ka(e))}},[g,f,x,S,$,C,w,k]);const L=()=>{y(!1)},P=r(null);return at(P,L),K({key:"Escape",active:g},L),e(da,{ref:P,children:[t(nt,{label:"Filters",icon:Pi,badgeLabel:R,badgeFilled:!!R,withBorder:!0,color:"transparent",onClick:()=>{b(0,50),y(!0)}}),t(tt,{ref:h,isOpen:g,top:v.top,left:v.left,width:"420px",footer:e(pe,{children:[t(Ca,{variant:"primary",onClick:()=>{u(ct.OVERVIEW_FILTERS,A),N(A),M(ka(A)),y(!1)},children:"Apply"}),t(Ca,{variant:"secondary",onClick:L,children:"Cancel"}),t(wa,{children:t(Ca,{variant:"tertiary",onClick:()=>{p(ct.OVERVIEW_FILTERS),E(),I(F()),M(0),y(!1)},$color:i.text.error,children:"Reset"})})]}),children:e(Sa,{children:[t(ba,{namespaces:o,value:A.namespaces,onSelect:e=>I(t=>({...t,namespaces:[...t.namespaces||[],e]})),onDeselect:e=>I(t=>({...t,namespaces:(t.namespaces||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(fa,{sources:O,value:A.kinds,onSelect:e=>I(t=>({...t,kinds:[...t.kinds||[],e]})),onDeselect:e=>I(t=>({...t,kinds:(t.kinds||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(ya,{sources:O,value:A.languages,onSelect:e=>I(t=>({...t,languages:[...t.languages||[],e]})),onDeselect:e=>I(t=>({...t,languages:(t.languages||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(va,{value:A.monitors,onSelect:e=>I(t=>({...t,monitors:[...t.monitors||[],e]})),onDeselect:e=>I(t=>({...t,monitors:(t.monitors||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(ma,{sources:O,value:A.conditions,onSelect:e=>I(t=>({...t,conditions:[...t.conditions||[],e]})),onDeselect:e=>I(t=>({...t,conditions:(t.conditions||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(xa,{sources:O,value:A.podsAgentInjectionStatus,onSelect:e=>I(t=>({...t,podsAgentInjectionStatus:[...t.podsAgentInjectionStatus||[],e]})),onDeselect:e=>I(t=>({...t,podsAgentInjectionStatus:(t.podsAgentInjectionStatus||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t($a,{children:t(T,{title:"Show only sources with errors",initialValue:A.onlyErrors,onChange:e=>I(t=>({...t,errors:[],onlyErrors:e}))})}),t(ga,{sources:O,value:A.errors,onSelect:e=>I(t=>({...t,errors:[...t.errors||[],e]})),onDeselect:e=>I(t=>({...t,errors:(t.errors||[]).filter(t=>t.id!==e.id)})),disabled:!A.onlyErrors,showSearch:!0,required:!0,isMulti:!0})]})})]})},Ta=p.div`
203
+ `,Ka=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},La=()=>{const i=m(),{namespaces:o,sources:r}=Y(),{selectedStreamName:s}=Ge(),{getItemSS:d,setItemSS:u,removeItemSS:p}=pt(),{popupRef:h,popupOpen:g,setPopupOpen:y,popupPosition:v,handlePosition:f}=it(),{namespaces:b,kinds:x,monitors:$,languages:S,conditions:C,errors:k,onlyErrors:w,podsAgentInjectionStatus:T,setAll:N,clearAll:E,getEmptyState:A}=fe(),F=c(()=>Xe(r,s),[r,s]),[I,R]=n({namespaces:b,kinds:x,monitors:$,languages:S,conditions:C,errors:k,onlyErrors:w,podsAgentInjectionStatus:T}),[M,K]=n(Ka(I));a(()=>{const e=d(ut.OVERVIEW_FILTERS,A());N(e)},[]),a(()=>{if(!g){const e={namespaces:b,kinds:x,monitors:$,languages:S,conditions:C,errors:k,onlyErrors:w,podsAgentInjectionStatus:T};R(e),K(Ka(e))}},[g,b,x,$,S,C,k,w,T]);const L=()=>{y(!1)},P=l(null);return rt(P,L),V({key:"Escape",active:g},L),e($a,{ref:P,children:[t(ot,{label:"Filters",icon:Ki,badgeLabel:M,badgeFilled:!!M,withBorder:!0,color:"transparent",onClick:()=>{f(0,50),y(!0)}}),t(nt,{ref:h,isOpen:g,top:v.top,left:v.left,width:"420px",footer:e(O,{children:[t(Ra,{variant:"primary",onClick:()=>{u(ut.OVERVIEW_FILTERS,I),N(I),K(Ka(I)),y(!1)},children:"Apply"}),t(Ra,{variant:"secondary",onClick:L,children:"Cancel"}),t(Ma,{children:t(Ra,{variant:"tertiary",onClick:()=>{p(ut.OVERVIEW_FILTERS),E(),R(A()),K(0),y(!1)},$color:i.text.error,children:"Reset"})})]}),children:e(Oa,{children:[t(Ea,{namespaces:o,value:I.namespaces,onSelect:e=>R(t=>({...t,namespaces:[...t.namespaces||[],e]})),onDeselect:e=>R(t=>({...t,namespaces:(t.namespaces||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(Aa,{sources:F,value:I.kinds,onSelect:e=>R(t=>({...t,kinds:[...t.kinds||[],e]})),onDeselect:e=>R(t=>({...t,kinds:(t.kinds||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(Da,{sources:F,value:I.languages,onSelect:e=>R(t=>({...t,languages:[...t.languages||[],e]})),onDeselect:e=>R(t=>({...t,languages:(t.languages||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(Na,{value:I.monitors,onSelect:e=>R(t=>({...t,monitors:[...t.monitors||[],e]})),onDeselect:e=>R(t=>({...t,monitors:(t.monitors||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(wa,{sources:F,value:I.conditions,onSelect:e=>R(t=>({...t,conditions:[...t.conditions||[],e]})),onDeselect:e=>R(t=>({...t,conditions:(t.conditions||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(Fa,{sources:F,value:I.podsAgentInjectionStatus,onSelect:e=>R(t=>({...t,podsAgentInjectionStatus:[...t.podsAgentInjectionStatus||[],e]})),onDeselect:e=>R(t=>({...t,podsAgentInjectionStatus:(t.podsAgentInjectionStatus||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(Ia,{children:t(D,{title:"Show only sources with errors",initialValue:I.onlyErrors,onChange:e=>R(t=>({...t,errors:[],onlyErrors:e}))})}),t(Ta,{sources:F,value:I.errors,onSelect:e=>R(t=>({...t,errors:[...t.errors||[],e]})),onDeselect:e=>R(t=>({...t,errors:(t.errors||[]).filter(t=>t.id!==e.id)})),disabled:!I.onlyErrors,showSearch:!0,required:!0,isMulti:!0})]})})]})},Pa=p.div`
169
204
  display: flex;
170
205
  flex-direction: column;
171
206
  gap: 24px;
172
207
  padding: 4px;
173
- `,Na=({formData:i,handleFormChange:n,formErrors:a,editingStreamName:o})=>{const{dataStreams:r,selectedStreamName:l}=Je(),c=o||l,d=s(()=>r.find(e=>e.name===i.name&&e.name!==c),[r,i.name,c]);return e(Ta,{children:[t(C,{name:"name",title:g.STREAM_NAME,placeholder:g.NAME_YOUR_STREAM_PLACEHOLDER,required:!0,value:i.name,onChange:({target:{value:e}})=>n("name",e),errorMessage:a.name}),d&&t(ie,{type:ne.Warning,message:g.DATA_STREAM_EXISTS_WARNING(c,d.name)})]})},Ea=p.div`
208
+ `,ja=({formData:i,handleFormChange:n,formErrors:a,editingStreamName:o})=>{const{dataStreams:r,selectedStreamName:l}=Ge(),s=o||l,d=c(()=>r.find(e=>e.name===i.name&&e.name!==s),[r,i.name,s]);return e(Pa,{children:[t(C,{name:"name",title:g.STREAM_NAME,placeholder:g.NAME_YOUR_STREAM_PLACEHOLDER,required:!0,value:i.name,onChange:({target:{value:e}})=>n("name",e),errorMessage:a.name}),d&&t(le,{type:se.Warning,message:g.DATA_STREAM_EXISTS_WARNING(s,d.name)})]})},za=p.div`
174
209
  width: 100%;
175
210
  height: 100%;
176
211
  max-height: calc(100vh - 220px);
177
212
  overflow: overlay;
178
213
  overflow-y: auto;
179
- `,Fa=({isOpen:e,onClose:i,dataStreamName:a,updateDataStream:o})=>{const{dataStreams:l}=Je(),c=r(null),[u,p]=n(!1),{formData:h,handleFormChange:m,formErrors:g,validateForm:y,resetFormData:v,loadFormWithDrawerItem:b}=ut({name:a}),f=s(()=>{if(!e)return v();const t=l?.find(e=>e.name===a);return t?b(t):v(),t},[e,l,a]),x=d((e,t)=>{m(e,t),p(!0)},[m]);return f?t(Fn,{ref:c,title:f.name,icons:[ji],hideEditTitleFromEdit:!0,isEdit:!0,isFormDirty:u,onSave:()=>{y({withAlert:!0,alertTitle:Q.Update})&&(o(a,h),p(!1),i())},onCancel:()=>{v(),p(!1),i()},children:t(Ea,{children:t(Na,{formData:h,handleFormChange:x,formErrors:g,editingStreamName:a})})}):null},Oa=p.div`
214
+ `,qa=({isOpen:e,onClose:i,dataStreamName:a,updateDataStream:o})=>{const{dataStreams:r}=Ge(),s=l(null),[u,p]=n(!1),{formData:h,handleFormChange:m,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]),x=d((e,t)=>{m(e,t),p(!0)},[m]);return b?t(Fn,{ref:s,title:b.name,icons:[Li],hideEditTitleFromEdit:!0,isEdit:!0,isFormDirty:u,onSave:()=>{y({withAlert:!0,alertTitle:ne.Update})&&(o(a,h),p(!1),i())},onCancel:()=>{v(),p(!1),i()},children:t(za,{children:t(ja,{formData:h,handleFormChange:x,formErrors:g,editingStreamName:a})})}):null},Ba=p.div`
180
215
  position: relative;
181
- `,Aa=p(pe)`
216
+ `,Ha=p(O)`
182
217
  border: 1px solid ${({theme:e})=>e.colors.border};
183
218
  border-radius: 32px;
184
219
 
185
220
  & button {
186
221
  max-height: 28px;
187
222
  }
188
- `,Ia=p(P)`
223
+ `,Va=p(B)`
189
224
  text-wrap: nowrap;
190
- `,Ra=p(it)`
225
+ `,Wa=p(at)`
191
226
  max-height: 240px;
192
227
  padding: 0px !important;
193
- `,Ma=p(pe)`
228
+ `,_a=p(O)`
194
229
  width: 100%;
195
- `,La=p.div`
230
+ `,Ua=p.div`
196
231
  width: 100%;
197
- `,Pa=({onClickNewDataStream:a,updateDataStream:o,deleteDataStream:r})=>{const l=m(),{clearStore:c}=pt(),{popupRef:d,popupOpen:u,setPopupOpen:p,popupPosition:h,handlePosition:g}=et(),{dataStreams:y,selectedStreamName:v,setSelectedStreamName:b}=Je(),[f,x]=n(""),[S,$]=n(""),[w,k]=n(""),D=s(()=>y.filter(({name:e})=>!w||e.toLowerCase().includes(w.toLowerCase())).map(({name:i})=>e(Ma,{children:[t(La,{children:t(nt,{label:i,isSelected:v===i,onClick:()=>{c(),b(i),p(!1)},color:"transparent",style:{width:"100%",justifyContent:"flex-start"}})}),i!==ht&&t(mt,{onClick:()=>$(i),tooltip:q.DELETE,children:t(Ai,{})}),t(mt,{onClick:()=>x(i),tooltip:q.EDIT,children:t(Oi,{})})]},`stream-${i}`)),[y,v,w]);return e(i,{children:[e(Oa,{children:[e(Aa,{$gap:0,children:[e(Ie,{variant:"tertiary",onClick:()=>{g(0,50),p(e=>!e)},children:[t(ji,{fill:l.text.info}),e(Ia,{children:["Data Stream: ",v]}),t(gt,{extend:u}),t(Fe,{label:y.length})]}),t(re,{orientation:"vertical",length:"32px",thickness:2,margin:"0"}),t(yt,{onClick:()=>{c(),a()},label:q.NEW})]}),t(tt,{ref:d,isOpen:u,top:h.top,left:h.left,header:t(C,{placeholder:"Search...",icon:Li,value:w,onChange:e=>k(e.target.value)}),children:t(Ra,{children:D})})]}),t(H,{isOpen:""!==S,name:S,onApprove:()=>{r(S),$("")},onDeny:()=>{$("")}}),t(Fa,{isOpen:""!==f,onClose:()=>{x("")},dataStreamName:f,updateDataStream:o})]})},ja=p.div`
232
+ `,Ja=({onClickNewDataStream:a,updateDataStream:o,deleteDataStream:r})=>{const l=m(),{clearStore:s}=mt(),{popupRef:d,popupOpen:u,setPopupOpen:p,popupPosition:h,handlePosition:g}=it(),{dataStreams:y,selectedStreamName:v,setSelectedStreamName:f}=Ge(),[b,x]=n(""),[$,S]=n(""),[k,w]=n(""),T=c(()=>y.filter(({name:e})=>!k||e.toLowerCase().includes(k.toLowerCase())).map(({name:i})=>e(_a,{children:[t(Ua,{children:t(ot,{label:i,isSelected:v===i,onClick:()=>{s(),f(i),p(!1)},color:"transparent",style:{width:"100%",justifyContent:"flex-start"}})}),i!==gt&&t(I,{onClick:()=>S(i),tooltip:W.DELETE,children:t(Ni,{})}),t(I,{onClick:()=>x(i),tooltip:W.EDIT,children:t(Fi,{})})]},`stream-${i}`)),[y,v,k]);return e(i,{children:[e(Ba,{children:[e(Ha,{$gap:0,children:[e(Me,{variant:"tertiary",onClick:()=>{g(0,50),p(e=>!e)},children:[t(Li,{fill:l.text.info}),e(Va,{children:["Data Stream: ",v]}),t(yt,{extend:u}),t(Oe,{label:y.length})]}),t(A,{orientation:"vertical",length:"32px",thickness:2,margin:"0"}),t(R,{onClick:()=>{s(),a()},label:W.NEW})]}),t(nt,{ref:d,isOpen:u,top:h.top,left:h.left,header:t(C,{placeholder:"Search...",icon:Mi,value:k,onChange:e=>w(e.target.value)}),children:t(Wa,{children:T})})]}),t(U,{isOpen:""!==$,name:$,onApprove:()=>{r($),S("")},onDeny:()=>{S("")}}),t(qa,{isOpen:""!==b,onClose:()=>{x("")},dataStreamName:b,updateDataStream:o})]})},Ga=p.div`
198
233
  display: flex;
199
234
  align-items: center;
200
235
  margin: 20px 0;
201
236
  padding: 0 16px;
202
237
  gap: 8px;
203
- `,Ka=p.div`
238
+ `,Ya=p.div`
204
239
  margin-left: auto;
205
- `,qa=({addEntity:i,preventSearchPopup:n,onClickNewDataStream:a,updateDataStream:o,deleteDataStream:r})=>{const{isVm:l}=Le(),{setCurrentModal:s}=Z();return e(ja,{children:[!l&&t(Pa,{onClickNewDataStream:a,updateDataStream:o,deleteDataStream:r}),t(ha,{preventPopup:n}),t(Da,{}),i&&t(Ka,{children:t(yt,{"data-id":`add-${i}`,onClick:()=>s(i),label:`${q.ADD} ${ot(i)}`,variant:"primary",textProps:{weight:900}})})]})},za=o(({isModal:i,onClickSummary:n},a)=>{const{selectedStreamName:o}=Je(),{formData:r,handleFormChange:s,formErrors:c,validateForm:d}=ut({name:o});return l(a,()=>({validateForm:d,getFormValues:()=>r})),t(te,{$isNotModal:!i,children:e(se,{$gap:24,children:[n&&t(vt,{onClick:n}),t(I,{title:g.NAME_YOUR_STREAM,description:g.STREAM_DESCRIPTION}),t(Na,{formData:r,handleFormChange:s,formErrors:c})]})})});za.displayName=za.name;const Ha=({createDataStream:e})=>{const{currentModal:i,setCurrentModal:n}=Z(),{addDataStreams:a,setSelectedStreamName:o}=Je(),l=i===bt.DataStream,s=()=>n(""),c=async()=>{if(d.current&&d.current.validateForm()){const t=d.current.getFormValues();e?e(t):(a([t]),o(t.name)),s()}},d=r(null);return K({key:"Enter",active:l},c),t(ee,{isOpen:l,onClose:s,header:{title:"Add Data Stream"},actionComponent:t(le,{buttons:[{label:"DONE",variant:"primary",onClick:c}]}),children:t(za,{ref:d,isModal:!0})})},Va=(e,t)=>{const{destinationType:i,disabled:n,exportedSignals:a}=e,o=[{title:g.TYPE,value:i.type},{type:y.ActiveStatus,title:g.STATUS,value:String(!n)},{type:y.Monitors,title:g.MONITORS,value:Pe(a).join(", ")},{title:g.NAME,value:i.displayName}],r=ft(e,t),l=r.map(e=>({name:e.key,value:e.value}));return r.map(({key:e,name:i,value:n})=>{const{secret:r,componentProperties:s,hideFromReadData:c,customReadDataLabels:d}=t.find(t=>t.name===e)||{};if(!c?.length||!xt(c,Pe(a),l)){const{type:e}=St(s,{type:""}),t=(r||"password"===e)&&n.length?new Array(10).fill("•").join(""):"";o.push({type:y.Divider}),d?.length?d.forEach(({condition:e,...t})=>{e==n&&o.push({title:t.title,value:t.value})}):o.push({title:i,value:t||n})}}),o},Ba=({signals:e,fields:i,onChange:n,formErrors:a})=>i?.map(o=>{const{componentType:r,renderCondition:l,...s}=o;if(l&&!xt(l,e,i))return null;switch(r){case F.Input:return t(C,{...s,onChange:e=>n(o.name,e.target.value),errorMessage:a[o.name]},o.name);case F.Dropdown:return t(rt,{...s,showSearch:!0,value:{id:s.value||"",value:s.value||""},options:s.options||[],onSelect:e=>n(o.name,e.id),errorMessage:a[o.name]},o.name);case F.MultiInput:return t(E,{...s,value:"string"==typeof s.value?St(s.value,[]):s.value,onChange:e=>n(o.name,JSON.stringify(e)),errorMessage:a[o.name]},o.name);case F.KeyValuePair:return t(N,{...s,value:"string"==typeof s.value?St(s.value,[]):s.value,onChange:e=>n(o.name,JSON.stringify(e)),errorMessage:a[o.name]},o.name);case F.TextArea:return t(L,{...s,onChange:e=>n(o.name,e.target.value),errorMessage:a[o.name]},o.name);case F.Checkbox:return t(S,{...s,value:"true"==s.value,onChange:e=>n(o.name,String(e)),errorMessage:a[o.name]},o.name);default:return null}}),Wa=p(Ie)`
240
+ `,Xa=({addEntity:i,preventSearchPopup:n,onClickNewDataStream:a,updateDataStream:o,deleteDataStream:r})=>{const{isVm:l}=je(),{setCurrentModal:s}=ae();return e(Ga,{children:[!l&&t(Ja,{onClickNewDataStream:a,updateDataStream:o,deleteDataStream:r}),t(ka,{preventPopup:n}),t(La,{}),i&&t(Ya,{children:t(R,{"data-id":`add-${i}`,onClick:()=>s(i),label:`${W.ADD} ${lt(i)}`,variant:"primary",textProps:{weight:900}})})]})},Za=r(({isModal:i,onClickSummary:n},a)=>{const{selectedStreamName:o}=Ge(),{formData:r,handleFormChange:l,formErrors:c,validateForm:d}=ht({name:o});return s(a,()=>({validateForm:d,getFormValues:()=>r})),t(re,{$isNotModal:!i,children:e(F,{$gap:24,children:[n&&t(vt,{onClick:n}),t(P,{title:g.NAME_YOUR_STREAM,description:g.STREAM_DESCRIPTION}),t(ja,{formData:r,handleFormChange:l,formErrors:c})]})})});Za.displayName=Za.name;const Qa=({createDataStream:e})=>{const{currentModal:i,setCurrentModal:n}=ae(),{addDataStreams:a,setSelectedStreamName:o}=Ge(),r=i===ft.DataStream,s=()=>n(""),c=async()=>{if(d.current&&d.current.validateForm()){const t=d.current.getFormValues();e?e(t):(a([t]),o(t.name)),s()}},d=l(null);return V({key:"Enter",active:r},c),t(oe,{isOpen:r,onClose:s,header:{title:"Add Data Stream"},actionComponent:t(ue,{buttons:[{label:"DONE",variant:"primary",onClick:c}]}),children:t(Za,{ref:d,isModal:!0})})},eo=(e,t)=>{const{destinationType:i,disabled:n,exportedSignals:a}=e,o=[{title:g.TYPE,value:i.type},{type:y.ActiveStatus,title:g.STATUS,value:String(!n)},{type:y.Monitors,title:g.MONITORS,value:qe(a).join(", ")},{title:g.NAME,value:i.displayName}],r=bt(e,t),l=r.map(e=>({name:e.key,value:e.value}));return r.map(({key:e,name:i,value:n})=>{const{secret:r,componentProperties:s,hideFromReadData:c,customReadDataLabels:d}=t.find(t=>t.name===e)||{};if(!c?.length||!xt(c,qe(a),l)){const{type:e}=$t(s,{type:""}),t=(r||"password"===e)&&n.length?new Array(10).fill("•").join(""):"";o.push({type:y.Divider}),d?.length?d.forEach(({condition:e,...t})=>{e==n&&o.push({title:t.title,value:t.value})}):o.push({title:i,value:t||n})}}),o},to=({signals:e,fields:i,onChange:n,formErrors:a})=>i?.map(o=>{const{componentType:r,renderCondition:l,...s}=o;if(l&&!xt(l,e,i))return null;switch(r){case M.Input:return t(C,{...s,onChange:e=>n(o.name,e.target.value),errorMessage:a[o.name]},o.name);case M.Dropdown:return t(st,{...s,showSearch:!0,value:{id:s.value||"",value:s.value||""},options:s.options||[],onSelect:e=>n(o.name,e.id),errorMessage:a[o.name]},o.name);case M.MultiInput:return t(E,{...s,value:"string"==typeof s.value?$t(s.value,[]):s.value,onChange:e=>n(o.name,JSON.stringify(e)),errorMessage:a[o.name]},o.name);case M.KeyValuePair:return t(N,{...s,value:"string"==typeof s.value?$t(s.value,[]):s.value,onChange:e=>n(o.name,JSON.stringify(e)),errorMessage:a[o.name]},o.name);case M.TextArea:return t(q,{...s,onChange:e=>n(o.name,e.target.value),errorMessage:a[o.name]},o.name);case M.Checkbox:return t($,{...s,value:"true"==s.value,onChange:e=>n(o.name,String(e)),errorMessage:a[o.name]},o.name);default:return null}}),io=p(Me)`
206
241
  display: flex;
207
242
  align-items: center;
208
243
  gap: 8px;
209
244
 
210
- ${({$status:e,theme:t})=>e===ne.Success?h`
245
+ ${({$status:e,theme:t})=>e===se.Success?h`
211
246
  border-color: transparent;
212
247
  background-color: ${t.colors.success};
213
248
  `:"error"===e?h`
@@ -216,43 +251,43 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
216
251
  `:h`
217
252
  background-color: transparent;
218
253
  `}
219
- `,_a=({destination:i,validateForm:a,status:o,testConnection:r,onSuccess:l,onError:s})=>{const c=m(),{selectedStreamName:d}=Je(),[u,p]=n(!1),h=o?ge(o,c):void 0;return e(Wa,{$status:o,variant:"secondary",onClick:async()=>{if(a()){p(!0);const e=await r({...i,currentStreamName:d});e&&(e.succeeded?l(e):s(e)),p(!1)}},children:[u?t(Ae,{}):h?t(h,{}):null,t(P,{family:"secondary",decoration:"underline",size:14,color:o?c.text[o]:void 0,children:u?"Checking":o===ne.Success?"Connection OK":"error"===o?"Connection Failed":"Test Connection"})]})},Ja=p(se)`
254
+ `,no=({destination:i,validateForm:a,status:o,testConnection:r,onSuccess:l,onError:s})=>{const c=m(),{selectedStreamName:d}=Ge(),[u,p]=n(!1),h=o?ve(o,c):void 0;return e(io,{$status:o,variant:"secondary",onClick:async()=>{if(a()){p(!0);const e=await r({...i,currentStreamName:d});e&&(e.succeeded?l(e):s(e)),p(!1)}},children:[u?t(Re,{}):h?t(h,{}):null,t(B,{family:"secondary",decoration:"underline",size:14,color:o?c.text[o]:void 0,children:u?"Checking":o===se.Success?"Connection OK":"error"===o?"Connection Failed":"Test Connection"})]})},ao=p(F)`
220
255
  align-items: unset;
221
256
  padding: 0 4px;
222
- `,Ua=p.div`
257
+ `,oo=p.div`
223
258
  display: flex;
224
259
  flex-direction: column;
225
260
  gap: 12px;
226
- `,Ya=p(pe)`
261
+ `,ro=p(O)`
227
262
  justify-content: space-between;
228
- `,Ga=p(P)`
263
+ `,lo=p(B)`
229
264
  margin-bottom: 12px;
230
- `,Xa=({isUpdate:i,categoryItem:o,formData:l,formErrors:c,validateForm:d,handleFormChange:u,dynamicFields:p,setDynamicFields:h,testConnection:y})=>{const{type:v,displayName:b,supportedSignals:f,testConnectionSupported:x}=o||{},S=m(),[$,w]=n(!1),[k,D]=n(!1),[T,N]=n(void 0),E=r(!1);a(()=>{if(p.length&&!E.current){E.current=!0;let e=!1;for(let t=0;t<p.length;t++){const{required:i,value:n}=p[t];if(i){if([void 0,null,""].includes(n)){e=!1;break}e=!0}}w(e)}},[p,k]);const F=s(()=>{const{logs:e,metrics:t,traces:i}=f||{},n=[];return e?.supported&&n.push($t.Logs),t?.supported&&n.push($t.Metrics),i?.supported&&n.push($t.Traces),n},[f]),L=s(()=>{const{logs:e,metrics:t,traces:i}=l.exportedSignals||{},n=[];return e&&n.push($t.Logs),t&&n.push($t.Metrics),i&&n.push($t.Traces),n},[l.exportedSignals]),P=()=>{w(!1),D(!0),N(void 0)};return e(Ja,{$gap:24,children:[e(Ja,{$gap:12,children:[t(I,{title:i?"Update destination":"Create destination",description:`Connect ${b} with Odigos.`,actionButton:x&&t(_a,{destination:l,validateForm:d,status:T?.type,testConnection:y,onError:e=>{D(!1),N({type:ne.Error,title:e?.reason||"Connection failed",message:e?.message||"Please check your input and try again."})},onSuccess:e=>{D(!1),N({type:ne.Success,title:e?.reason||"Connection succeeded",message:e?.message||""})}})}),e(Ua,{children:[x&&T&&t(ie,{type:T.type,title:T.title,message:T.message}),$&&!T&&!i&&t(ie,{type:ne.Default,message:`Odigos autocompleted ${b} destination details.`})]}),t(re,{})]}),e(Ya,{children:[t(M,{title:i?"":"This connection will monitor:",required:!0,allowedSignals:F,selectedSignals:L,setSelectedSignals:e=>{P(),u("exportedSignals",{logs:e.includes($t.Logs),metrics:e.includes($t.Metrics),traces:e.includes($t.Traces)})},errorMessage:c.exportedSignals}),!i&&t(R,{endpoint:`/backends/${v}`})]}),i&&e("div",{children:[t(Ga,{children:"Status"}),t(O,{options:[{icon:Ei,label:g.ENABLED,value:!1,selectedBgColor:S.text.success+A["050"]},{icon:Fi,label:g.DISABLED,value:!0,selectedBgColor:S.text.error+A["050"]}],selected:l.disabled,setSelected:e=>u("disabled",e)})]}),!i&&t(C,{title:"Destination name",placeholder:"Enter destination name",value:l.name,onChange:e=>{P(),u("name",e.target.value)},errorMessage:c.name}),t(Ba,{signals:L,fields:p,onChange:(e,t)=>{P(),h(i=>{const n=[...i],a=n.findIndex(t=>t.name===e);return-1!==a&&(n[a]={...n[a],value:t}),n})},formErrors:c})]})},Qa=p.div`
265
+ `,so=({isUpdate:i,categoryItem:o,formData:r,formErrors:s,validateForm:d,handleFormChange:u,dynamicFields:p,setDynamicFields:h,testConnection:y})=>{const{type:v,displayName:f,supportedSignals:b,testConnectionSupported:x}=o||{},$=m(),[S,k]=n(!1),[w,T]=n(!1),[D,N]=n(void 0),E=l(!1);a(()=>{if(p.length&&!E.current){E.current=!0;let e=!1;for(let t=0;t<p.length;t++){const{required:i,value:n}=p[t];if(i){if([void 0,null,""].includes(n)){e=!1;break}e=!0}}k(e)}},[p,w]);const F=c(()=>{const{logs:e,metrics:t,traces:i}=b||{},n=[];return e?.supported&&n.push(St.Logs),t?.supported&&n.push(St.Metrics),i?.supported&&n.push(St.Traces),n},[b]),O=c(()=>{const{logs:e,metrics:t,traces:i}=r.exportedSignals||{},n=[];return e&&n.push(St.Logs),t&&n.push(St.Metrics),i&&n.push(St.Traces),n},[r.exportedSignals]),I=()=>{k(!1),T(!0),N(void 0)};return e(ao,{$gap:24,children:[e(ao,{$gap:12,children:[t(P,{title:i?"Update destination":"Create destination",description:`Connect ${f} with Odigos.`,actionButton:x&&t(no,{destination:r,validateForm:d,status:D?.type,testConnection:y,onError:e=>{T(!1),N({type:se.Error,title:e?.reason||"Connection failed",message:e?.message||"Please check your input and try again."})},onSuccess:e=>{T(!1),N({type:se.Success,title:e?.reason||"Connection succeeded",message:e?.message||""})}})}),e(oo,{children:[x&&D&&t(le,{type:D.type,title:D.title,message:D.message}),S&&!D&&!i&&t(le,{type:se.Default,message:`Odigos autocompleted ${f} destination details.`})]}),t(A,{})]}),e(ro,{children:[t(z,{title:i?"":"This connection will monitor:",required:!0,allowedSignals:F,selectedSignals:O,setSelectedSignals:e=>{I(),u("exportedSignals",{logs:e.includes(St.Logs),metrics:e.includes(St.Metrics),traces:e.includes(St.Traces)})},errorMessage:s.exportedSignals}),!i&&t(j,{endpoint:`/backends/${v}`})]}),i&&e("div",{children:[t(lo,{children:"Status"}),t(K,{options:[{icon:Ei,label:g.ENABLED,value:!1,selectedBgColor:$.text.success+L["050"]},{icon:Ai,label:g.DISABLED,value:!0,selectedBgColor:$.text.error+L["050"]}],selected:r.disabled,setSelected:e=>u("disabled",e)})]}),!i&&t(C,{title:"Destination name",placeholder:"Enter destination name",value:r.name,onChange:e=>{I(),u("name",e.target.value)},errorMessage:s.name}),t(to,{signals:O,fields:p,onChange:(e,t)=>{I(),h(i=>{const n=[...i],a=n.findIndex(t=>t.name===e);return-1!==a&&(n[a]={...n[a],value:t}),n})},formErrors:s})]})},co=p.div`
231
266
  width: 100%;
232
267
  height: 100%;
233
268
  max-height: calc(100vh - 220px);
234
269
  overflow: overlay;
235
270
  overflow-y: auto;
236
- `,Za=p.div`
271
+ `,uo=p.div`
237
272
  display: flex;
238
273
  flex-direction: column;
239
274
  gap: 12px;
240
- `,eo=({categories:i,updateDestination:o,deleteDestination:l,testConnection:c})=>{const{destinations:d}=W(),{selectedStreamName:u}=Je(),{drawerType:p,drawerEntityId:h}=j(),m=s(()=>Ge(d,u),[d,u]),y=r(null),v=p===B.Destination,[b,f]=n(!1),[x,S]=n(!1),{formData:$,formErrors:C,handleFormChange:w,resetFormData:k,validateForm:D,loadFormWithDrawerItem:T,yamlFields:N,setYamlFields:E,dynamicFields:F,setDynamicFields:O}=Ct({}),A=s(()=>{if(h)return m?.find(e=>J(e)===h)},[h,m]);if(a(()=>{v&&A?(E(wt(i,A)),T(A)):k()},[v,A,i]),!A)return null;const I=i.flatMap(e=>e.items).find(e=>e.type===A.destinationType.type),{icon:R,iconSrc:M}=I?ze(I?.type):{icon:void 0,iconSrc:void 0};return t(Fn,{ref:y,title:A.name||A.destinationType.displayName,icons:R?[R]:void 0,iconSrcs:M?[M]:void 0,isEdit:b,isFormDirty:x,onEdit:e=>{f("boolean"!=typeof e||e)},onSave:async e=>{if(D({withAlert:!0,alertTitle:Q.Update})){const t=e!==A.destinationType.displayName?e:"";w("name",t),o(h,{...$,name:t}),f(!1),S(!1)}},onDelete:async()=>{l(h),f(!1),S(!1),y.current?.closeDrawer()},onCancel:()=>{f(!1),S(!1),T(A)},isLastItem:1===m.length,children:b?t(Qa,{children:t(Xa,{isUpdate:!0,categoryItem:I,formData:$,formErrors:C,handleFormChange:(...e)=>{S(!0),w(...e)},dynamicFields:F,setDynamicFields:(...e)=>{S(!0),O(...e)},validateForm:D,testConnection:c})}):e(Za,{children:[A.conditions?.length?t(Y,{conditions:A.conditions}):null,t(G,{title:g.DESTINATION_DETAILS,data:A?Va(A,N):[]})]})})},to=p.div`
275
+ `,po=({categories:i,updateDestination:o,deleteDestination:r,testConnection:s})=>{const{destinations:d}=Y(),{selectedStreamName:u}=Ge(),{drawerType:p,drawerEntityId:h}=H(),m=c(()=>Ze(d,u),[d,u]),y=l(null),v=p===G.Destination,[f,b]=n(!1),[x,$]=n(!1),{formData:S,formErrors:C,handleFormChange:k,resetFormData:w,validateForm:T,loadFormWithDrawerItem:D,yamlFields:N,setYamlFields:E,dynamicFields:A,setDynamicFields:F}=Ct({}),O=c(()=>{if(h)return m?.find(e=>Z(e)===h)},[h,m]);if(a(()=>{v&&O?(E(kt(i,O)),D(O)):w()},[v,O,i]),!O)return null;const I=i.flatMap(e=>e.items).find(e=>e.type===O.destinationType.type),{icon:R,iconSrc:M}=I?Ve(I?.type):{icon:void 0,iconSrc:void 0};return t(Fn,{ref:y,title:O.name||O.destinationType.displayName,icons:R?[R]:void 0,iconSrcs:M?[M]:void 0,isEdit:f,isFormDirty:x,onEdit:e=>{b("boolean"!=typeof e||e)},onSave:async e=>{if(T({withAlert:!0,alertTitle:ne.Update})){const t=e!==O.destinationType.displayName?e:"";k("name",t),o(h,{...S,name:t}),b(!1),$(!1)}},onDelete:async()=>{r(h),b(!1),$(!1),y.current?.closeDrawer()},onCancel:()=>{b(!1),$(!1),D(O)},isLastItem:1===m.length,children:f?t(co,{children:t(so,{isUpdate:!0,categoryItem:I,formData:S,formErrors:C,handleFormChange:(...e)=>{$(!0),k(...e)},dynamicFields:A,setDynamicFields:(...e)=>{$(!0),F(...e)},validateForm:T,testConnection:s})}):e(uo,{children:[O.conditions?.length?t(ee,{conditions:O.conditions}):null,t(te,{title:g.DESTINATION_DETAILS,data:O?eo(O,N):[]})]})})},ho=p.div`
241
276
  display: flex;
242
277
  flex-direction: column;
243
278
  gap: 12px;
244
- `,io=({items:i,onSelectNew:n,onSelectConfigured:a,isLoadingForDestinationIds:o})=>{const{configuredDestinationsUpdateOnly:r}=pt();return i.map(i=>{const l=i.name===Tt[Nt.EXISTS].TITLE;return e(to,{children:[t(I,{size:"small",icon:i.icon,title:kt(i.name),description:i.description}),i.items.map(e=>{const s=`select-${i.name.replaceAll(" ","")}-destination-${e.type}`,c=Dt(e.supportedSignals),{icon:d,iconSrc:u}=ze(e.type),p=e.selected||r.some(t=>t.id===e.id),h=!!o.find(t=>t===e.id),m=l?()=>a(e.id):()=>n(e);return t(Me,{"data-id":s,title:e.displayName,hoverText:q.SELECT,onClick:m,iconProps:{icon:d,iconSrc:u},visualProps:{monitors:c,monitorsWithLabels:!0},checkboxProps:{withCheckbox:l,isChecked:p,isLoading:h,onCheckboxChange:()=>a(e.id)}},s)})]},`category-${i.name}`)})},no=p.div`
279
+ `,mo=({items:i,onSelectNew:n,onSelectConfigured:a,isLoadingForDestinationIds:o})=>{const{configuredDestinationsUpdateOnly:r}=mt();return i.map(i=>{const l=i.name===Dt[Nt.EXISTS].TITLE;return e(ho,{children:[t(P,{size:"small",icon:i.icon,title:wt(i.name),description:i.description}),i.items.map(e=>{const s=`select-${i.name.replaceAll(" ","")}-destination-${e.type}`,c=Tt(e.supportedSignals),{icon:d,iconSrc:u}=Ve(e.type),p=e.selected||r.some(t=>t.id===e.id),h=!!o.find(t=>t===e.id),m=l?()=>a(e.id):()=>n(e);return t(Le,{"data-id":s,title:e.displayName,hoverText:W.SELECT,onClick:m,iconProps:{icon:d,iconSrc:u},visualProps:{monitors:c,monitorsWithLabels:!0},checkboxProps:{withCheckbox:l,isChecked:p,isLoading:h,onCheckboxChange:()=>a(e.id)}},s)})]},`category-${i.name}`)})},go=p.div`
245
280
  display: flex;
246
281
  flex-direction: column;
247
282
  gap: 24px;
248
- `,ao=p.div`
283
+ `,yo=p.div`
249
284
  display: flex;
250
285
  align-items: center;
251
286
  gap: 12px;
252
- `,oo=p.div`
287
+ `,vo=p.div`
253
288
  width: 170px;
254
289
  margin-right: 8px;
255
- `,ro=p.div`
290
+ `,fo=p.div`
256
291
  display: flex;
257
292
  flex-direction: column;
258
293
  align-self: stretch;
@@ -263,18 +298,18 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
263
298
  @media (height < 800px) {
264
299
  max-height: calc(100vh - 400px);
265
300
  }
266
- `,lo=p(no)`
301
+ `,bo=p(go)`
267
302
  margin-top: 80px;
268
- `,so=Object.values(Nt).map(e=>({value:Tt[e].TITLE,id:e})),co=so[0],uo=[$t.Logs,$t.Metrics,$t.Traces],po=(e,t,i)=>e.map(e=>{const{type:n,displayName:a}=e.destinationType,o=e.dataStreamNames?.includes(t),r=i.has(e.id);return{id:e.id,type:n,displayName:a,selected:o||r,fields:[],testConnectionSupported:!1,supportedSignals:{logs:{supported:e.exportedSignals.logs},metrics:{supported:e.exportedSignals.metrics},traces:{supported:e.exportedSignals.traces}}}}),ho=({hidden:i,categories:a,potentialDestinations:o,onSelectNew:r,onSelectConfigured:l,isLoadingForDestinationIds:c})=>{const{destinations:d}=W(),{selectedStreamName:u}=Je(),{configuredDestinations:p,configuredDestinationsUpdateOnly:h}=pt(),[m,g]=n(""),[y,v]=n(co),[b,f]=n(uo),x=s(()=>{const e=Et(a);return e.unshift({name:Nt.EXISTS,description:Tt[Nt.EXISTS].DESCRIPTION,icon:Ki,items:po(d,u,new Set(p.concat(h).map(e=>e.id)))}),e.unshift({name:Nt.DETECTED,description:Tt[Nt.DETECTED].DESCRIPTION,icon:qi,items:o}),e.map(e=>{const t=e.items.filter(t=>{const i=!m||t.displayName.toLowerCase().includes(m.toLowerCase()),n="all"===y.id||y.id?.toLowerCase()?.replaceAll("-"," ")===e.name.toLowerCase()?.replaceAll("-"," "),a=b.some(e=>t.supportedSignals[Ft[e]]?.supported);return i&&n&&a});return{...e,items:t}}).filter(({items:e})=>!!e.length)},[a,o,d,m,y,b,u,p,h]);return i?null:e(no,{children:[t(I,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e(ao,{children:[t(oo,{children:t(C,{placeholder:"Search...",icon:Li,value:m,onChange:({target:{value:e}})=>g(e)})}),t(oo,{children:t(rt,{options:so,value:y,onSelect:v,onDeselect:()=>{}})}),t(M,{title:"",selectedSignals:b,setSelectedSignals:f})]}),t(re,{}),x.length?t(ro,{children:t(io,{items:x,onSelectNew:e=>r(e,b),onSelectConfigured:l,isLoadingForDestinationIds:c})}):t(lo,{children:t(Ne,{title:"No destinations found"})})]})},mo=p.div`
303
+ `,xo=Object.values(Nt).map(e=>({value:Dt[e].TITLE,id:e})),$o=xo[0],So=[St.Logs,St.Metrics,St.Traces],Co=(e,t,i)=>e.map(e=>{const{type:n,displayName:a}=e.destinationType,o=e.dataStreamNames?.includes(t),r=i.has(e.id);return{id:e.id,type:n,displayName:a,selected:o||r,fields:[],testConnectionSupported:!1,supportedSignals:{logs:{supported:e.exportedSignals.logs},metrics:{supported:e.exportedSignals.metrics},traces:{supported:e.exportedSignals.traces}}}}),ko=({hidden:i,categories:a,potentialDestinations:o,onSelectNew:r,onSelectConfigured:l,isLoadingForDestinationIds:s})=>{const{destinations:d}=Y(),{selectedStreamName:u}=Ge(),{configuredDestinations:p,configuredDestinationsUpdateOnly:h}=mt(),[m,g]=n(""),[y,v]=n($o),[f,b]=n(So),x=c(()=>{const e=Et(a);return e.unshift({name:Nt.EXISTS,description:Dt[Nt.EXISTS].DESCRIPTION,icon:Pi,items:Co(d,u,new Set(p.concat(h).map(e=>e.id)))}),e.unshift({name:Nt.DETECTED,description:Dt[Nt.DETECTED].DESCRIPTION,icon:ji,items:o}),e.map(e=>{const t=e.items.filter(t=>{const i=!m||t.displayName.toLowerCase().includes(m.toLowerCase()),n="all"===y.id||y.id?.toLowerCase()?.replaceAll("-"," ")===e.name.toLowerCase()?.replaceAll("-"," "),a=f.some(e=>t.supportedSignals[At[e]]?.supported);return i&&n&&a});return{...e,items:t}}).filter(({items:e})=>!!e.length)},[a,o,d,m,y,f,u,p,h]);return i?null:e(go,{children:[t(P,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e(yo,{children:[t(vo,{children:t(C,{placeholder:"Search...",icon:Mi,value:m,onChange:({target:{value:e}})=>g(e)})}),t(vo,{children:t(st,{options:xo,value:y,onSelect:v,onDeselect:()=>{}})}),t(z,{title:"",selectedSignals:f,setSelectedSignals:b})]}),t(A,{}),x.length?t(fo,{children:t(mo,{items:x,onSelectNew:e=>r(e,f),onSelectConfigured:l,isLoadingForDestinationIds:s})}):t(bo,{children:t(Ae,{title:"No destinations found"})})]})},wo=p.div`
269
304
  display: flex;
270
- `,go=p.div`
305
+ `,To=p.div`
271
306
  border-right: 1px solid ${({theme:e})=>e.colors.border};
272
307
  padding: 32px;
273
308
  width: 200px;
274
309
  @media (max-width: 1050px) {
275
310
  display: none;
276
311
  }
277
- `,yo=({isOnboarding:i,categories:a,potentialDestinations:o,createDestination:r,updateDestination:l,deleteDestination:s,testConnection:c})=>{const{destinations:d}=W(),{selectedStreamName:u}=Je(),{currentModal:p,setCurrentModal:h}=Z(),{addConfiguredDestination:m,addConfiguredDestinationUpdateOnly:y,removeConfiguredDestinationUpdateOnly:v,configuredDestinationsUpdateOnly:b}=pt(),f=p===B.Destination,[x,S]=n(void 0),{formData:$,formErrors:C,handleFormChange:w,resetFormData:k,validateForm:D,setYamlFields:T,dynamicFields:N,setDynamicFields:E,loadFormWithDrawerItem:F}=Ct({supportedSignals:x?.supportedSignals,preLoadedFields:x?.fields}),[O,A]=n([]),I=e=>{const t={};return e||N.forEach(e=>t[e.name]=e.value),{id:e?.id||"",name:e?.name||$.name,disabled:e?.disabled||$.disabled,dataStreamNames:e?.dataStreamNames||[],conditions:e?.conditions||[],exportedSignals:e?.exportedSignals||$.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}}}}},R=async e=>{if(i&&!e){const e=I();m(e)}else if(i&&e){const t=I(e);b.some(t=>t.id===e.id)?v(e):y(t)}else if(i||e){if(!i&&e){const t=I(e),i=t.dataStreamNames.some(e=>e===u);A(t=>[...t,e.id]),i?await s(e.id):await l(e.id,F(t)),A(t=>t.filter(t=>t!==e.id))}}else r($)},M=()=>{k(),S(void 0),h("")},L=()=>{k(),S(void 0)},P=async()=>{if(x){if(!D({withAlert:!i,alertTitle:Q.Create}))return null;R()}M()};return K({key:"Enter",active:f},()=>P()),t(ee,{isOpen:f,onClose:M,header:{title:g.ADD_DESTINATION},actionComponent:t(le,{buttons:(()=>{const e=[{label:"DONE",variant:"primary",onClick:P}];return x&&e.unshift({label:"BACK",icon:()=>t(zi,{rotate:-90}),variant:"secondary",onClick:L}),e})()}),children:e(mo,{children:[t(go,{children:t(Ot,{currentStep:x?2:1,data:[{stepNumber:1,title:g.DESTINATIONS},{stepNumber:2,title:g.CONNECTION}]})}),e(te,{style:{margin:"32px 24px 12px 24px"},children:[t(ho,{hidden:void 0!==x,categories:a,potentialDestinations:o,onSelectNew:(e,t)=>{k(),w("type",e?.type||""),w("currentStreamName",u);const i={logs:!1,metrics:!1,traces:!1};t.filter(t=>e.supportedSignals[Ft[t]].supported).forEach(e=>i[Ft[e]]=!0),w("exportedSignals",i),T(e?.fields||[]),S(e)},onSelectConfigured:e=>{const t=d.find(t=>t.id===e);t&&R(t)},isLoadingForDestinationIds:O}),x&&t(Xa,{categoryItem:x,formData:$,formErrors:C,handleFormChange:w,dynamicFields:N,setDynamicFields:E,validateForm:D,testConnection:c})]})]})})},vo=p.div`
312
+ `,Do=({isOnboarding:i,categories:a,potentialDestinations:o,createDestination:r,updateDestination:l,deleteDestination:s,testConnection:c})=>{const{destinations:d}=Y(),{selectedStreamName:u}=Ge(),{currentModal:p,setCurrentModal:h}=ae(),{addConfiguredDestination:m,addConfiguredDestinationUpdateOnly:y,removeConfiguredDestinationUpdateOnly:v,configuredDestinationsUpdateOnly:f}=mt(),b=p===G.Destination,[x,$]=n(void 0),{formData:S,formErrors:C,handleFormChange:k,resetFormData:w,validateForm:T,setYamlFields:D,dynamicFields:N,setDynamicFields:E,loadFormWithDrawerItem:A}=Ct({supportedSignals:x?.supportedSignals,preLoadedFields:x?.fields}),[F,O]=n([]),I=e=>{const t={};return e||N.forEach(e=>t[e.name]=e.value),{id:e?.id||"",name:e?.name||S.name,disabled:e?.disabled||S.disabled,dataStreamNames:e?.dataStreamNames||[],conditions:e?.conditions||[],exportedSignals:e?.exportedSignals||S.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}}}}},R=async e=>{if(i&&!e){const e=I();m(e)}else if(i&&e){const t=I(e);f.some(t=>t.id===e.id)?v(e):y(t)}else if(i||e){if(!i&&e){const t=I(e),i=t.dataStreamNames.some(e=>e===u);O(t=>[...t,e.id]),i?await s(e.id):await l(e.id,A(t)),O(t=>t.filter(t=>t!==e.id))}}else r(S)},M=()=>{w(),$(void 0),h("")},K=()=>{w(),$(void 0)},L=async()=>{if(x){if(!T({withAlert:!i,alertTitle:ne.Create}))return null;R()}M()};return V({key:"Enter",active:b},()=>L()),t(oe,{isOpen:b,onClose:M,header:{title:g.ADD_DESTINATION},actionComponent:t(ue,{buttons:(()=>{const e=[{label:"DONE",variant:"primary",onClick:L}];return x&&e.unshift({label:"BACK",icon:()=>t(zi,{rotate:-90}),variant:"secondary",onClick:K}),e})()}),children:e(wo,{children:[t(To,{children:t(Ft,{currentStep:x?2:1,data:[{stepNumber:1,title:g.DESTINATIONS},{stepNumber:2,title:g.CONNECTION}]})}),e(re,{style:{margin:"32px 24px 12px 24px"},children:[t(ko,{hidden:void 0!==x,categories:a,potentialDestinations:o,onSelectNew:(e,t)=>{w(),k("type",e?.type||""),k("currentStreamName",u);const i={logs:!1,metrics:!1,traces:!1};t.filter(t=>e.supportedSignals[At[t]].supported).forEach(e=>i[At[e]]=!0),k("exportedSignals",i),D(e?.fields||[]),$(e)},onSelectConfigured:e=>{const t=d.find(t=>t.id===e);t&&R(t)},isLoadingForDestinationIds:F}),x&&t(so,{categoryItem:x,formData:S,formErrors:C,handleFormChange:k,dynamicFields:N,setDynamicFields:E,validateForm:T,testConnection:c})]})]})})},No=p.div`
278
313
  display: flex;
279
314
  flex-direction: column;
280
315
  align-items: center;
@@ -283,7 +318,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
283
318
  max-height: calc(100vh - 310px);
284
319
  height: fit-content;
285
320
  overflow-y: scroll;
286
- `,bo=({categories:e,withDelete:i})=>{const{configuredDestinations:n,configuredDestinationsUpdateOnly:a}=pt();return n.length||a.length?t(vo,{children:n.concat(a).map((o,r)=>t(fo,{"data-id":`configured-destination-${o.destinationType.type}`,item:o,yamlFields:wt(e,o),isLastItem:n.length+a.length===1,withDelete:i},`configured-destination-${o.destinationType.type}-${r}`))}):t(Te,{children:t(Ne,{title:"No destinations",subTitle:"Please add a destination"})})},fo=({item:a,yamlFields:o,isLastItem:r,withDelete:l})=>{const[c,d]=n(!1),{icon:u,iconSrc:p}=ze(a.destinationType.type),{removeConfiguredDestination:h,removeConfiguredDestinationUpdateOnly:m}=pt(),g=s(()=>ft(a,o).map(e=>({title:e.name,value:e.value})),[a,o]);return e(i,{children:[t(Me,{title:a.name||a.destinationType.displayName,subTitle:a.destinationType.type,iconProps:{icon:u,iconSrc:p},visualProps:{monitors:Pe(a.exportedSignals),monitorsWithLabels:!0},extendableProps:{withExtend:!0,renderExtended:()=>t(At,{data:g})},renderActions:l?()=>t(mt,{onClick:()=>d(!0),children:t(Ai,{})}):void 0}),l&&t(H,{isOpen:c,name:a.destinationType.displayName||a.name,type:B.Destination,isLastItem:r,onApprove:()=>{a.id?m(a):h(a)},onDeny:()=>d(!1)})]})},xo=p(Ie)`
321
+ `,Eo=({categories:e,withDelete:i})=>{const{configuredDestinations:n,configuredDestinationsUpdateOnly:a}=mt();return n.length||a.length?t(No,{children:n.concat(a).map((o,r)=>t(Ao,{"data-id":`configured-destination-${o.destinationType.type}`,item:o,yamlFields:kt(e,o),isLastItem:n.length+a.length===1,withDelete:i},`configured-destination-${o.destinationType.type}-${r}`))}):t(Ee,{children:t(Ae,{title:"No destinations",subTitle:"Please add a destination"})})},Ao=({item:a,yamlFields:o,isLastItem:r,withDelete:l})=>{const[s,d]=n(!1),{icon:u,iconSrc:p}=Ve(a.destinationType.type),{removeConfiguredDestination:h,removeConfiguredDestinationUpdateOnly:m}=mt(),g=c(()=>bt(a,o).map(e=>({title:e.name,value:e.value})),[a,o]);return e(i,{children:[t(Le,{title:a.name||a.destinationType.displayName,subTitle:a.destinationType.type,iconProps:{icon:u,iconSrc:p},visualProps:{monitors:qe(a.exportedSignals),monitorsWithLabels:!0},extendableProps:{withExtend:!0,renderExtended:()=>t(Ot,{data:g})},renderActions:l?()=>t(I,{onClick:()=>d(!0),children:t(Ni,{})}):void 0}),l&&t(U,{isOpen:s,name:a.destinationType.displayName||a.name,type:G.Destination,isLastItem:r,onApprove:()=>{a.id?m(a):h(a)},onDeny:()=>d(!1)})]})},Fo=p(Me)`
287
322
  display: flex;
288
323
  align-items: center;
289
324
  justify-content: center;
@@ -292,7 +327,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
292
327
  padding: 32px;
293
328
  border-radius: 16px;
294
329
  border-style: dashed !important;
295
- `,So=({isSourcesListEmpty:n,goToSources:a,categories:o,potentialDestinations:r,testConnection:l,onClickSummary:s})=>{const c=m(),{setCurrentModal:d}=Z(),{configuredDestinations:u,configuredDestinationsUpdateOnly:p}=pt();return e(i,{children:[t(te,{$isNotModal:!0,children:e(se,{$gap:12,children:[e(se,{$gap:24,children:[s&&t(vt,{onClick:s}),t(I,{title:g.ADD_DESTINATIONS,badgeLabel:u.length+p.length,description:g.ADD_DESTINATION_DESCRIPTION}),n&&t(ie,{type:ne.Warning,message:g.NO_SOURCES_GO_BACK,action:{label:g.SELECT_SOURCES,onClick:a}}),e(xo,{variant:"secondary",onClick:()=>d(B.Destination),children:[t(Ri,{}),t(P,{color:c.colors.secondary,size:14,decoration:"underline",family:"secondary",children:g.ADD_DESTINATION})]})]}),t(bo,{categories:o,withDelete:!0})]})}),t(yo,{isOnboarding:!0,categories:o,potentialDestinations:r,updateDestination:async()=>{},createDestination:async()=>{},deleteDestination:async()=>{},testConnection:l})]})},$o=[{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}],Co=({metrics:i,maxHeight:n,maxWidth:a})=>{const o=m(),r=ye(),{selectedStreamName:l}=Je(),{setDrawerType:c,setDrawerEntityId:d}=j(),{destinations:u,destinationsLoading:p}=W(),h=s(()=>Ge(u,l),[u,l]),y=s(()=>qn({instrumentationRules:[],sources:[],actions:[],destinations:Qe(h,r),searchText:r.searchText,selectedCategory:B.Destination}).searchResults.find(({category:e})=>e===B.Destination)?.entities||[],[h,r]),v=s(()=>y.map(e=>{const{hasErrors:n,hasWarnings:a,hasDisableds:r}=ce(e.conditions||[]),{icon:l,iconSrc:s}=ze(e.destinationType.type);return{status:n?ne.Error:a?ne.Warning:void 0,faded:r,onClick:()=>{c(B.Destination),d(e.id)},cells:[{columnKey:"icon",component:()=>t(be,{icon:l,src:s})},{columnKey:"name",value:fe(e,B.Destination,{prioritizeDisplayName:!0})},{columnKey:"type",value:e.destinationType.type,textColor:o.text.info},{columnKey:"throughput",value:je(It(i,B.Destination,e.id).throughput),textColor:o.text.info},{columnKey:"signals",component:()=>t(xe,{withLabels:!0,monitors:Pe(e.exportedSignals)})},{columnKey:"conditions",component:()=>e.conditions?.length?t(jn,{conditions:e.conditions,id:e.id}):null},{columnKey:"active-status",component:()=>t("div",{style:{lineHeight:1},children:t(de,{status:e.disabled?ne.Error:ne.Success,title:e.disabled?g.DISABLED:g.ENABLED,withIcon:!0,withBorder:!0})})}]}}),[y,i]),{badge:b,badgeTooltip:f}=s(()=>y.length!==h.length?{badge:`${y.length}/${h.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:h.length,badgeTooltip:void 0},[y,h]);return e(Se,{$maxWidth:a,children:[t($e,{children:t(Ce,{icon:we(B.Destination),title:g.DESTINATIONS,badge:b,badgeTooltip:f,loading:p})}),t(ke,{$maxHeight:n,children:t(De,{columns:$o,rows:v})}),!y.length&&t(Te,{style:{marginTop:"2rem"},children:t(Ne,{})})]})},wo=e=>{const{type:t,ruleName:i,notes:n,disabled:a,profileName:o,payloadCollection:r,codeAttributes:l,headersCollection:s,customInstrumentations:c}=e,d=[{title:g.TYPE,value:t},{type:y.ActiveStatus,title:g.STATUS,value:String(!a)},{title:g.NAME,value:i},{title:g.NOTES,value:n},{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(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[Rt.HeaderKeys]||[]).filter(e=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(c){const e=(c[Lt.Java]||[]).map(e=>new Mt(e.className,e.methodName)).map(e=>`• ${e.toString()}`).join("\r\n");e&&d.push({title:g.JAVA_CUSTOM_PROBES,value:e});const t=(c[Lt.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},ko=p.div`
330
+ `,Oo=({isSourcesListEmpty:n,goToSources:a,categories:o,potentialDestinations:r,testConnection:l,onClickSummary:s})=>{const c=m(),{setCurrentModal:d}=ae(),{configuredDestinations:u,configuredDestinationsUpdateOnly:p}=mt();return e(i,{children:[t(re,{$isNotModal:!0,children:e(F,{$gap:12,children:[e(F,{$gap:24,children:[s&&t(vt,{onClick:s}),t(P,{title:g.ADD_DESTINATIONS,badgeLabel:u.length+p.length,description:g.ADD_DESTINATION_DESCRIPTION}),n&&t(le,{type:se.Warning,message:g.NO_SOURCES_GO_BACK,action:{label:g.SELECT_SOURCES,onClick:a}}),e(Fo,{variant:"secondary",onClick:()=>d(G.Destination),children:[t(Ii,{}),t(B,{color:c.colors.secondary,size:14,decoration:"underline",family:"secondary",children:g.ADD_DESTINATION})]})]}),t(Eo,{categories:o,withDelete:!0})]})}),t(Do,{isOnboarding:!0,categories:o,potentialDestinations:r,updateDestination:async()=>{},createDestination:async()=>{},deleteDestination:async()=>{},testConnection:l})]})},Io=[{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}],Ro=({metrics:i,maxHeight:n,maxWidth:a})=>{const o=m(),r=fe(),{selectedStreamName:l}=Ge(),{setDrawerType:s,setDrawerEntityId:d}=H(),{destinations:u,destinationsLoading:p}=Y(),h=c(()=>Ze(u,l),[u,l]),y=c(()=>qn({instrumentationRules:[],sources:[],actions:[],destinations:et(h,r),searchText:r.searchText,selectedCategory:G.Destination}).searchResults.find(({category:e})=>e===G.Destination)?.entities||[],[h,r]),v=c(()=>y.map(e=>{const{hasErrors:n,hasWarnings:a,hasDisableds:r}=pe(e.conditions||[]),{icon:l,iconSrc:c}=Ve(e.destinationType.type);return{status:n?se.Error:a?se.Warning:void 0,faded:r,onClick:()=>{s(G.Destination),d(e.id)},cells:[{columnKey:"icon",component:()=>t(xe,{icon:l,src:c})},{columnKey:"name",value:$e(e,G.Destination,{prioritizeDisplayName:!0})},{columnKey:"type",value:e.destinationType.type,textColor:o.text.info},{columnKey:"throughput",value:Be(It(i,G.Destination,e.id).throughput),textColor:o.text.info},{columnKey:"signals",component:()=>t(Se,{withLabels:!0,monitors:qe(e.exportedSignals)})},{columnKey:"conditions",component:()=>e.conditions?.length?t(jn,{conditions:e.conditions,id:e.id}):null},{columnKey:"active-status",component:()=>t("div",{style:{lineHeight:1},children:t(he,{status:e.disabled?se.Error:se.Success,title:e.disabled?g.DISABLED:g.ENABLED,withIcon:!0,withBorder:!0})})}]}}),[y,i]),{badge:f,badgeTooltip:b}=c(()=>y.length!==h.length?{badge:`${y.length}/${h.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:h.length,badgeTooltip:void 0},[y,h]);return e(Ce,{$maxWidth:a,children:[t(ke,{children:t(we,{icon:Te(G.Destination),title:g.DESTINATIONS,badge:f,badgeTooltip:b,loading:p})}),t(De,{$maxHeight:n,children:t(Ne,{columns:Io,rows:v})}),!y.length&&t(Ee,{style:{marginTop:"2rem"},children:t(Ae,{})})]})},Mo=e=>{const{type:t,ruleName:i,notes:n,disabled:a,profileName:o,payloadCollection:r,codeAttributes:l,headersCollection:s,customInstrumentations:c}=e,d=[{title:g.TYPE,value:t},{type:y.ActiveStatus,title:g.STATUS,value:String(!a)},{title:g.NAME,value:i},{title:g.NOTES,value:n},{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(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[Rt.HeaderKeys]||[]).filter(e=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(c){const e=(c[Kt.Java]||[]).map(e=>new Mt(e.className,e.methodName)).map(e=>`• ${e.toString()}`).join("\r\n");e&&d.push({title:g.JAVA_CUSTOM_PROBES,value:e});const t=(c[Kt.Golang]||[]).map(e=>new Lt(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},Ko=p.div`
296
331
  display: flex;
297
332
  flex-direction: column;
298
333
  gap: 12px;
@@ -302,7 +337,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
302
337
  border-radius: 16px;
303
338
  padding: 8px;
304
339
  `}
305
- `,Do=[{id:jt.FilePath,label:"Collect File Path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:jt.Function,label:"Collect Function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:jt.LineNumber,label:"Collect Line Number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],To=[{id:jt.Column,label:"Collect Column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:jt.Namespace,label:"Collect Namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:jt.StackTrace,label:"Collect Stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],No={[Lt.Java]:[new Mt("","")],[Lt.Golang]:[new Pt("")]},Eo=["*"],Fo=p.div`
340
+ `,Lo=[{id:Pt.FilePath,label:"Collect File Path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Pt.Function,label:"Collect Function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Pt.LineNumber,label:"Collect Line Number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Po=[{id:Pt.Column,label:"Collect Column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Pt.Namespace,label:"Collect Namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Pt.StackTrace,label:"Collect Stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],jo={[Kt.Java]:[new Mt("","")],[Kt.Golang]:[new Lt("")]},zo=["*"],qo=p.div`
306
341
  display: flex;
307
342
  flex-direction: column;
308
343
  gap: 12px;
@@ -312,27 +347,27 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
312
347
  border-radius: 16px;
313
348
  padding: 8px;
314
349
  `}
315
- `,Oo=[{id:Kt.HttpRequest,label:"Collect HTTP Request"},{id:Kt.HttpResponse,label:"Collect HTTP Response"},{id:Kt.DbQuery,label:"Collect DB Query"},{id:Kt.Messaging,label:"Collect Messaging"}],Ao={[qt.CodeAttributes]:({value:o,setValue:r,formErrors:l})=>{const c=l.codeAttributes,d=s(()=>Object.entries(o.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]),[u,p]=n(1===d.length);a(()=>{if(!d.length){const e={[jt.Column]:null,[jt.FilePath]:!0,[jt.Function]:!0,[jt.LineNumber]:!0,[jt.Namespace]:null,[jt.StackTrace]:null};r("codeAttributes",e),p(!1)}},[]);const h=(e,t)=>{const i=t?[...d,e]:d.filter(t=>t!==e),n=Object.values(jt).reduce((e,t)=>(e[t]=!!i.includes(t)||null,e),{});r("codeAttributes",n),p(1===i.length)};return e(i,{children:[e("div",{children:[t(x,{title:"Recommended data to collect",required:!0}),t(ko,{$hasError:!!c,children:Do.map(({id:e,label:i,tooltip:n})=>t(me,{text:n,withIcon:!0,children:t(S,{title:i,disabled:u&&d.includes(e),value:d.includes(e),onChange:t=>h(e,t)})},e))}),!!c&&t($,{children:c})]}),e("div",{children:[t(x,{title:"Verbose data to collect",required:!0}),t(ko,{$hasError:!!c,children:To.map(({id:e,label:i,tooltip:n})=>t(me,{text:n,withIcon:!0,children:t(S,{title:i,disabled:u&&d.includes(e),value:d.includes(e),onChange:t=>h(e,t)})},e))}),!!c&&t($,{children:c})]})]})},[qt.CustomInstrumentation]:({value:i,setValue:n,formErrors:o})=>{const r=o.customInstrumentations,l=s(()=>(i?.customInstrumentations?.[Lt.Java]||[]).map(e=>({key:e.className,value:e.methodName})),[i]),c=s(()=>(i?.customInstrumentations?.[Lt.Golang]||[]).map(e=>new Pt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[i]),d=(e,t)=>{const i={};switch(t){case"java":i[Lt.Java]=e.map(e=>new Mt(e.className,e.methodName)),i[Lt.Golang]=c.map(e=>new Pt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName));break;case"golang":i[Lt.Golang]=e.map(e=>new Pt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),i[Lt.Java]=l.map(({key:e,value:t})=>new Mt(e,t))}n("customInstrumentations",i)};return a(()=>{i?.customInstrumentations||n("customInstrumentations",{[Lt.Golang]:No[Lt.Golang],[Lt.Java]:No[Lt.Java]})},[n,i]),e("div",{children:[t(D,{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:c,onChange:e=>d(e,"golang"),errorMessage:r,limitFieldsPerRow:2}),t(N,{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"})]})},[qt.HeadersCollection]:({value:e,setValue:i,formErrors:n})=>{const o=n.headersCollection,r=s(()=>e?.headersCollection?.[Rt.HeaderKeys]||[],[e]),l=e=>{const t={[Rt.HeaderKeys]:e};i("headersCollection",t)};return a(()=>{r.length||l(Eo)},[r]),t("div",{children:r.length>0&&t(E,{title:"Header Keys",tooltip:"Specify which headers you want to collect, asterisk (*) will collect all headers.",value:r,onChange:e=>l(e),errorMessage:o})})},[qt.PayloadCollection]:({value:i,setValue:o,formErrors:r})=>{const l=r.payloadCollection,c=s(()=>Object.entries(i.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]),[d,u]=n(1===c.length);return a(()=>{if(!c.length){const e={[Kt.HttpRequest]:{},[Kt.HttpResponse]:{},[Kt.DbQuery]:{},[Kt.Messaging]:{}};o("payloadCollection",e),u(!1)}},[]),e("div",{children:[t(x,{title:"Type of data to collect",required:!0}),t(Fo,{$hasError:!!l,children:Oo.map(({id:e,label:i})=>t(S,{title:i,disabled:d&&c.includes(e),value:c.includes(e),onChange:t=>((e,t)=>{const i=t?[...c,e]:c.filter(t=>t!==e),n={[Kt.HttpRequest]:i.includes(Kt.HttpRequest)?{}:null,[Kt.HttpResponse]:i.includes(Kt.HttpResponse)?{}:null,[Kt.DbQuery]:i.includes(Kt.DbQuery)?{}:null,[Kt.Messaging]:i.includes(Kt.Messaging)?{}:null};o("payloadCollection",n),u(1===i.length)})(e,t)},e))}),!!l&&t($,{children:l})]})},[qt.UnknownType]:null},Io=({ruleType:e,value:i,setValue:n,formErrors:a})=>{if(!e)return null;const o=Ao[e];return o?t(o,{value:i,setValue:n,formErrors:a}):null},Ro=p.div`
350
+ `,Bo=[{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"}],Ho={[zt.CodeAttributes]:({value:o,setValue:r,formErrors:l})=>{const s=l.codeAttributes,d=c(()=>Object.entries(o.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]),[u,p]=n(1===d.length);a(()=>{if(!d.length){const e={[Pt.Column]:null,[Pt.FilePath]:!0,[Pt.Function]:!0,[Pt.LineNumber]:!0,[Pt.Namespace]:null,[Pt.StackTrace]:null};r("codeAttributes",e),p(!1)}},[]);const h=(e,t)=>{const i=t?[...d,e]:d.filter(t=>t!==e),n=Object.values(Pt).reduce((e,t)=>(e[t]=!!i.includes(t)||null,e),{});r("codeAttributes",n),p(1===i.length)};return e(i,{children:[e("div",{children:[t(x,{title:"Recommended data to collect",required:!0}),t(Ko,{$hasError:!!s,children:Lo.map(({id:e,label:i,tooltip:n})=>t(ye,{text:n,withIcon:!0,children:t($,{title:i,disabled:u&&d.includes(e),value:d.includes(e),onChange:t=>h(e,t)})},e))}),!!s&&t(S,{children:s})]}),e("div",{children:[t(x,{title:"Verbose data to collect",required:!0}),t(Ko,{$hasError:!!s,children:Po.map(({id:e,label:i,tooltip:n})=>t(ye,{text:n,withIcon:!0,children:t($,{title:i,disabled:u&&d.includes(e),value:d.includes(e),onChange:t=>h(e,t)})},e))}),!!s&&t(S,{children:s})]})]})},[zt.CustomInstrumentation]:({value:i,setValue:n,formErrors:o})=>{const r=o.customInstrumentations,l=c(()=>(i?.customInstrumentations?.[Kt.Java]||[]).map(e=>({key:e.className,value:e.methodName})),[i]),s=c(()=>(i?.customInstrumentations?.[Kt.Golang]||[]).map(e=>new Lt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[i]),d=(e,t)=>{const i={};switch(t){case"java":i[Kt.Java]=e.map(e=>new Mt(e.className,e.methodName)),i[Kt.Golang]=s.map(e=>new Lt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName));break;case"golang":i[Kt.Golang]=e.map(e=>new Lt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),i[Kt.Java]=l.map(({key:e,value:t})=>new Mt(e,t))}n("customInstrumentations",i)};return a(()=>{i?.customInstrumentations||n("customInstrumentations",{[Kt.Golang]:jo[Kt.Golang],[Kt.Java]:jo[Kt.Java]})},[n,i]),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(N,{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"})]})},[zt.HeadersCollection]:({value:e,setValue:i,formErrors:n})=>{const o=n.headersCollection,r=c(()=>e?.headersCollection?.[Rt.HeaderKeys]||[],[e]),l=e=>{const t={[Rt.HeaderKeys]:e};i("headersCollection",t)};return a(()=>{r.length||l(zo)},[r]),t("div",{children:r.length>0&&t(E,{title:"Header Keys",tooltip:"Specify which headers you want to collect, asterisk (*) will collect all headers.",value:r,onChange:e=>l(e),errorMessage:o})})},[zt.PayloadCollection]:({value:i,setValue:o,formErrors:r})=>{const l=r.payloadCollection,s=c(()=>Object.entries(i.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]),[d,u]=n(1===s.length);return a(()=>{if(!s.length){const e={[jt.HttpRequest]:{},[jt.HttpResponse]:{},[jt.DbQuery]:{},[jt.Messaging]:{}};o("payloadCollection",e),u(!1)}},[]),e("div",{children:[t(x,{title:"Type of data to collect",required:!0}),t(qo,{$hasError:!!l,children:Bo.map(({id:e,label:i})=>t($,{title:i,disabled:d&&s.includes(e),value:s.includes(e),onChange:t=>((e,t)=>{const i=t?[...s,e]:s.filter(t=>t!==e),n={[jt.HttpRequest]:i.includes(jt.HttpRequest)?{}:null,[jt.HttpResponse]:i.includes(jt.HttpResponse)?{}:null,[jt.DbQuery]:i.includes(jt.DbQuery)?{}:null,[jt.Messaging]:i.includes(jt.Messaging)?{}:null};o("payloadCollection",n),u(1===i.length)})(e,t)},e))}),!!l&&t(S,{children:l})]})},[zt.UnknownType]:null},Vo=({ruleType:e,value:i,setValue:n,formErrors:a})=>{if(!e)return null;const o=Ho[e];return o?t(o,{value:i,setValue:n,formErrors:a}):null},Wo=p.div`
316
351
  display: flex;
317
352
  flex-direction: column;
318
353
  gap: 24px;
319
354
  padding: 4px;
320
- `,Mo=p(P)`
355
+ `,_o=p(B)`
321
356
  margin-bottom: 12px;
322
- `,Lo=({isUpdate:n,rule:a,formData:o,formErrors:r,handleFormChange:l})=>{const s=m();return e(Ro,{children:[t(pe,{children:a.supportedLanguages.map(e=>t(zt,{icon:Ht(e),type:ne.Info,children:lt[e]},e))}),n?e("div",{children:[t(Mo,{children:"Status"}),t(O,{options:[{icon:Ei,label:g.ENABLED,value:!1,selectedBgColor:s.text.success+A["050"]},{icon:Fi,label:g.DISABLED,value:!0,selectedBgColor:s.text.error+A["050"]}],selected:o.disabled,setSelected:e=>l("disabled",e)})]}):e(i,{children:[t(I,{title:"",description:a.docsDescription,actionButton:t(R,{endpoint:a.docsEndpoint})}),t(C,{title:"Rule name",placeholder:"Use a name that describes the rule",value:o.ruleName,onChange:({target:{value:e}})=>l("ruleName",e),errorMessage:r.ruleName})]}),t(Io,{ruleType:a.type,value:o,setValue:(e,t)=>l(e,t),formErrors:r}),t(L,{title:"Notes",value:o.notes,onChange:({target:{value:e}})=>l("notes",e),errorMessage:r.notes})]})},Po=p.div`
357
+ `,Uo=({isUpdate:n,rule:a,formData:o,formErrors:r,handleFormChange:l})=>{const s=m();return e(Wo,{children:[t(O,{children:a.supportedLanguages.map(e=>t(qt,{icon:Bt(e),type:se.Info,children:ct[e]},e))}),n?e("div",{children:[t(_o,{children:"Status"}),t(K,{options:[{icon:Ei,label:g.ENABLED,value:!1,selectedBgColor:s.text.success+L["050"]},{icon:Ai,label:g.DISABLED,value:!0,selectedBgColor:s.text.error+L["050"]}],selected:o.disabled,setSelected:e=>l("disabled",e)})]}):e(i,{children:[t(P,{title:"",description:a.docsDescription,actionButton:t(j,{endpoint:a.docsEndpoint})}),t(C,{title:"Rule name",placeholder:"Use a name that describes the rule",value:o.ruleName,onChange:({target:{value:e}})=>l("ruleName",e),errorMessage:r.ruleName})]}),t(Vo,{ruleType:a.type,value:o,setValue:(e,t)=>l(e,t),formErrors:r}),t(q,{title:"Notes",value:o.notes,onChange:({target:{value:e}})=>l("notes",e),errorMessage:r.notes})]})},Jo=p.div`
323
358
  width: 100%;
324
359
  height: 100%;
325
360
  max-height: calc(100vh - 220px);
326
361
  overflow: overlay;
327
362
  overflow-y: auto;
328
- `,jo=p.div`
363
+ `,Go=p.div`
329
364
  display: flex;
330
365
  flex-direction: column;
331
366
  gap: 12px;
332
- `,Ko=({updateInstrumentationRule:i,deleteInstrumentationRule:o})=>{const{instrumentationRules:l}=W(),{addNotification:c}=Vt(),{drawerType:d,drawerEntityId:u}=j(),p=r(null),h=d===B.InstrumentationRule,[m,g]=n(!1),[y,v]=n(!1),{formData:b,formErrors:f,handleFormChange:x,resetFormData:S,validateForm:$,loadFormWithDrawerItem:C}=Bt(),w=s(()=>{if(u)return l?.find(e=>J(e)===u)},[u,l]);if(a(()=>{h&&w?C(w):S()},[h,w]),!w)return null;const k=Wt.find(({type:e})=>e===w.type);return t(Fn,{ref:p,title:w.ruleName||w.type,icons:[qe(w.type)],isEdit:m,isFormDirty:y,onEdit:e=>{w.mutable||!e&&void 0!==e?g("boolean"!=typeof e||e):c({type:ne.Warning,title:ae.FORBIDDEN,message:ae.CANNOT_EDIT_RULE,crdType:B.InstrumentationRule,target:u,hideFromHistory:!0})},onSave:e=>{if($()){const t=e!==w.type?e:"";x("ruleName",t),i(u,{...b,ruleName:t}),g(!1),v(!1)}},onDelete:()=>{w.mutable?(o(u),g(!1),v(!1),p.current?.closeDrawer()):c({type:ne.Warning,title:ae.FORBIDDEN,message:ae.CANNOT_DELETE_RULE,crdType:B.InstrumentationRule,target:u,hideFromHistory:!0})},onCancel:()=>{g(!1),v(!1),C(w)},children:m&&k?t(Po,{children:t(Lo,{isUpdate:!0,rule:k,formData:b,formErrors:f,handleFormChange:(...e)=>{v(!0),x(...e)}})}):e(jo,{children:[t(Y,{conditions:w.conditions||[]}),t(G,{title:"Instrumentation Rule Details",data:w?wo(w):[]})]})})},qo=p(se)`
367
+ `,Yo=({updateInstrumentationRule:i,deleteInstrumentationRule:o})=>{const{instrumentationRules:r}=Y(),{addNotification:s}=Ht(),{drawerType:d,drawerEntityId:u}=H(),p=l(null),h=d===G.InstrumentationRule,[m,g]=n(!1),[y,v]=n(!1),{formData:f,formErrors:b,handleFormChange:x,resetFormData:$,validateForm:S,loadFormWithDrawerItem:C}=Vt(),k=c(()=>{if(u)return r?.find(e=>Z(e)===u)},[u,r]);if(a(()=>{h&&k?C(k):$()},[h,k]),!k)return null;const w=Wt.find(({type:e})=>e===k.type);return t(Fn,{ref:p,title:k.ruleName||k.type,icons:[He(k.type)],isEdit:m,isFormDirty:y,onEdit:e=>{k.mutable||!e&&void 0!==e?g("boolean"!=typeof e||e):s({type:se.Warning,title:ce.FORBIDDEN,message:ce.CANNOT_EDIT_RULE,crdType:G.InstrumentationRule,target:u,hideFromHistory:!0})},onSave:e=>{if(S()){const t=e!==k.type?e:"";x("ruleName",t),i(u,{...f,ruleName:t}),g(!1),v(!1)}},onDelete:()=>{k.mutable?(o(u),g(!1),v(!1),p.current?.closeDrawer()):s({type:se.Warning,title:ce.FORBIDDEN,message:ce.CANNOT_DELETE_RULE,crdType:G.InstrumentationRule,target:u,hideFromHistory:!0})},onCancel:()=>{g(!1),v(!1),C(k)},children:m&&w?t(Jo,{children:t(Uo,{isUpdate:!0,rule:w,formData:f,formErrors:b,handleFormChange:(...e)=>{v(!0),x(...e)}})}):e(Go,{children:[t(ee,{conditions:k.conditions||[]}),t(te,{title:"Instrumentation Rule Details",data:k?Mo(k):[]})]})})},Xo=p(F)`
333
368
  margin-top: 24px;
334
369
  gap: 12px;
335
- `,zo=Wt,Ho=({createInstrumentationRule:i})=>{const{tier:a}=Le(),o=a===_t.Onprem,{currentModal:r,setCurrentModal:l}=Z(),s=r===B.InstrumentationRule,{formData:c,formErrors:d,handleFormChange:u,resetFormData:p,validateForm:h}=Bt(),[m,y]=n(void 0),v=()=>{p(),y(void 0),l("")},b=()=>{if(!h())return null;i(c),v()};return K({key:"Enter",active:s},()=>b()),t(ee,{isOpen:s,onClose:v,header:{title:"Add Instrumentation Rule"},actionComponent:t(le,{buttons:[{variant:"primary",label:"DONE",onClick:b,disabled:!o||!m,tooltip:o?"":ae.ENTERPRISE_ONLY("Instrumentation Rules")}]}),children:e(te,{children:[t(I,{title:"Select Instrumentation Rule",description:"Define how telemetry is recorded from your application. Choose a rule type and configure the details."}),e(qo,{children:[t(ie,o?{type:ne.Warning,message:ae.DEFINED_FOR_ALL_STREAMS(g.INSTRUMENTATION_RULES)}:{type:ne.Default,message:ae.ENTERPRISE_ONLY(g.INSTRUMENTATION_RULES)}),t(oe,{options:zo,selectedOption:m,onOptionSelect:e=>{return t=e,p(),void y(t);var t},autoFocus:!m?.type})]}),m?.type?e("div",{children:[t(re,{margin:"16px 0"}),t(Lo,{rule:m,formData:c,formErrors:d,handleFormChange:u})]}):null]})})},Vo=e=>{const{payloadCollection:t,codeAttributes:i,customInstrumentations:n}=e;let a="";return t&&(a+=Object.entries(t).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),i&&(a+=Object.entries(i).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),n&&Object.values(Lt).forEach(e=>{const t=(n[e]||[]).filter(e=>e).join(", ");t&&(a+=a?`, ${t}`:t)}),a},Bo=[{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}],Wo=({maxHeight:i,maxWidth:n})=>{const a=m(),o=ye(),{setDrawerType:r,setDrawerEntityId:l}=j(),{instrumentationRules:c,instrumentationRulesLoading:d}=W(),u=s(()=>qn({instrumentationRules:c,sources:[],actions:[],destinations:[],searchText:o.searchText,selectedCategory:B.InstrumentationRule}).searchResults.find(({category:e})=>e===B.InstrumentationRule)?.entities||[],[c,o]),p=s(()=>u.map(e=>{const{hasErrors:i,hasWarnings:n,hasDisableds:o}=ce(e.conditions||[]);return{status:i?ne.Error:n?ne.Warning:void 0,faded:o,onClick:()=>{r(B.InstrumentationRule),l(e.ruleId)},cells:[{columnKey:"icon",component:()=>t(be,{icon:qe(e.type)})},{columnKey:"name",value:fe(e,B.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:Vo(e),textColor:a.text.info,withTooltip:!0},{columnKey:"conditions",component:()=>t(jn,{conditions:e.conditions||[],id:e.ruleId})},{columnKey:"active-status",component:()=>t("div",{style:{lineHeight:1},children:t(de,{status:e.disabled?ne.Error:ne.Success,title:e.disabled?g.DISABLED:g.ENABLED,withIcon:!0,withBorder:!0})})},{columnKey:"source-count",component:()=>t("div",{style:{lineHeight:1},children:t(de,{status:ne.Info,title:"all sources",withBorder:!0})})}]}}),[u]),{badge:h,badgeTooltip:y}=s(()=>u.length!==c.length?{badge:`${u.length}/${c.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:c.length,badgeTooltip:void 0},[u,c]);return e(Se,{$maxWidth:n,children:[t($e,{children:t(Ce,{icon:we(B.Action),title:g.INSTRUMENTATION_RULES,badge:h,badgeTooltip:y,loading:d})}),t(ke,{$maxHeight:i,children:t(De,{columns:Bo,rows:p})}),!u.length&&t(Te,{style:{marginTop:"2rem"},children:t(Ne,{})})]})},_o=p.div`
370
+ `,Zo=Wt,Qo=({createInstrumentationRule:i})=>{const{tier:a}=je(),o=a===_t.Onprem,{currentModal:r,setCurrentModal:l}=ae(),s=r===G.InstrumentationRule,{formData:c,formErrors:d,handleFormChange:u,resetFormData:p,validateForm:h}=Vt(),[m,y]=n(void 0),v=()=>{p(),y(void 0),l("")},f=()=>{if(!h())return null;i(c),v()};return V({key:"Enter",active:s},()=>f()),t(oe,{isOpen:s,onClose:v,header:{title:"Add Instrumentation Rule"},actionComponent:t(ue,{buttons:[{variant:"primary",label:"DONE",onClick:f,disabled:!o||!m,tooltip:o?"":ce.ENTERPRISE_ONLY("Instrumentation Rules")}]}),children:e(re,{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(Xo,{children:[t(le,o?{type:se.Warning,message:ce.DEFINED_FOR_ALL_STREAMS(g.INSTRUMENTATION_RULES)}:{type:se.Default,message:ce.ENTERPRISE_ONLY(g.INSTRUMENTATION_RULES)}),t(de,{options:Zo,selectedOption:m,onOptionSelect:e=>{return t=e,p(),void y(t);var t},autoFocus:!m?.type})]}),m?.type?e("div",{children:[t(A,{margin:"16px 0"}),t(Uo,{rule:m,formData:c,formErrors:d,handleFormChange:u})]}):null]})})},er=e=>{const{payloadCollection:t,codeAttributes:i,customInstrumentations:n}=e;let a="";return t&&(a+=Object.entries(t).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),i&&(a+=Object.entries(i).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),n&&Object.values(Kt).forEach(e=>{const t=(n[e]||[]).filter(e=>e).join(", ");t&&(a+=a?`, ${t}`:t)}),a},tr=[{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}],ir=({maxHeight:i,maxWidth:n})=>{const a=m(),o=fe(),{setDrawerType:r,setDrawerEntityId:l}=H(),{instrumentationRules:s,instrumentationRulesLoading:d}=Y(),u=c(()=>qn({instrumentationRules:s,sources:[],actions:[],destinations:[],searchText:o.searchText,selectedCategory:G.InstrumentationRule}).searchResults.find(({category:e})=>e===G.InstrumentationRule)?.entities||[],[s,o]),p=c(()=>u.map(e=>{const{hasErrors:i,hasWarnings:n,hasDisableds:o}=pe(e.conditions||[]);return{status:i?se.Error:n?se.Warning:void 0,faded:o,onClick:()=>{r(G.InstrumentationRule),l(e.ruleId)},cells:[{columnKey:"icon",component:()=>t(xe,{icon:He(e.type)})},{columnKey:"name",value:$e(e,G.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:er(e),textColor:a.text.info,withTooltip:!0},{columnKey:"conditions",component:()=>t(jn,{conditions:e.conditions||[],id:e.ruleId})},{columnKey:"active-status",component:()=>t("div",{style:{lineHeight:1},children:t(he,{status:e.disabled?se.Error:se.Success,title:e.disabled?g.DISABLED:g.ENABLED,withIcon:!0,withBorder:!0})})},{columnKey:"source-count",component:()=>t("div",{style:{lineHeight:1},children:t(he,{status:se.Info,title:"all sources",withBorder:!0})})}]}}),[u]),{badge:h,badgeTooltip:y}=c(()=>u.length!==s.length?{badge:`${u.length}/${s.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:s.length,badgeTooltip:void 0},[u,s]);return e(Ce,{$maxWidth:n,children:[t(ke,{children:t(we,{icon:Te(G.Action),title:g.INSTRUMENTATION_RULES,badge:h,badgeTooltip:y,loading:d})}),t(De,{$maxHeight:i,children:t(Ne,{columns:tr,rows:p})}),!u.length&&t(Ee,{style:{marginTop:"2rem"},children:t(Ae,{})})]})},nr=p.div`
336
371
  position: fixed;
337
372
  bottom: 0;
338
373
  left: 50%;
@@ -345,18 +380,18 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
345
380
  border-radius: 32px;
346
381
  border: 1px solid ${({theme:e})=>e.colors.border};
347
382
  background-color: ${({theme:e})=>e.colors.dropdown_bg};
348
- animation-name: ${Ut.in.center};
349
- `,Jo=({totalSourceCount:i,uninstrumentSources:a,restartWorkloads:o})=>{const r=m(),{selectedSources:l,setSelectedSources:d}=Re(),[u,p]=n(!1),[h,g]=n(!1),y=s(()=>{let e=0;return Object.values(l).forEach(t=>{e+=t.length}),e},[l]),v=()=>{d({})};return y?e(c,{children:[e(_o,{"data-id":"multi-source-control",children:[t(P,{children:"Selected sources"}),t(Fe,{label:y,filled:!0}),t(re,{orientation:"vertical",length:"16px"}),t(Ie,{variant:"tertiary",onClick:v,children:t(P,{family:"secondary",decoration:"underline",children:"Deselect"})}),e(Ie,{variant:"tertiary",onClick:()=>g(!0),children:[t(Hi,{}),t(P,{family:"secondary",decoration:"underline",children:"Restart"})]}),e(Ie,{variant:"tertiary",onClick:()=>p(!0),children:[t(Ai,{}),t(P,{family:"secondary",decoration:"underline",color:r.text.error,children:"Uninstrument"})]})]}),t(H,{isOpen:u,name:`${y} sources`,type:B.Source,isLastItem:y===i,onApprove:()=>{const e={};Object.entries(l).forEach(([t,i])=>{e[t]=i.map(e=>({...e,selected:!1}))}),a(e),p(!1),v()},onDeny:()=>p(!1)}),t(Jt,{isOpen:h,title:"Rollout Restart Workloads",description:"Are you sure you want to rollout restart these workloads?",approveButton:{text:"Confirm",variant:ne.Warning,onClick:()=>{const e=[];Object.values(l).forEach(t=>{e.push(...t.map(e=>Yt(e)))}),o(e),v()}},denyButton:{text:"Go Back",onClick:()=>g(!1)}})]}):null},Uo=p.div`
383
+ animation-name: ${Jt.in.center};
384
+ `,ar=({totalSourceCount:i,uninstrumentSources:a,restartWorkloads:r})=>{const l=m(),{selectedSources:s,setSelectedSources:d}=Ke(),[u,p]=n(!1),[h,g]=n(!1),y=c(()=>{let e=0;return Object.values(s).forEach(t=>{e+=t.length}),e},[s]),v=()=>{d({})};return y?e(o,{children:[e(nr,{"data-id":"multi-source-control",children:[t(B,{children:"Selected sources"}),t(Oe,{label:y,filled:!0}),t(A,{orientation:"vertical",length:"16px"}),t(Me,{variant:"tertiary",onClick:v,children:t(B,{family:"secondary",decoration:"underline",children:"Deselect"})}),e(Me,{variant:"tertiary",onClick:()=>g(!0),children:[t(qi,{}),t(B,{family:"secondary",decoration:"underline",children:"Restart"})]}),e(Me,{variant:"tertiary",onClick:()=>p(!0),children:[t(Ni,{}),t(B,{family:"secondary",decoration:"underline",color:l.text.error,children:"Uninstrument"})]})]}),t(U,{isOpen:u,name:`${y} sources`,type:G.Source,isLastItem:y===i,onApprove:()=>{const e={};Object.entries(s).forEach(([t,i])=>{e[t]=i.map(e=>({...e,selected:!1}))}),a(e),p(!1),v()},onDeny:()=>p(!1)}),t(Ut,{isOpen:h,title:"Rollout Restart Workloads",description:"Are you sure you want to rollout restart these workloads?",approveButton:{text:"Confirm",variant:se.Warning,onClick:()=>{const e=[];Object.values(s).forEach(t=>{e.push(...t.map(e=>Gt(e)))}),r(e),v()}},denyButton:{text:"Go Back",onClick:()=>g(!1)}})]}):null},or=p.div`
350
385
  position: relative;
351
386
  width: fit-content;
352
- `,Yo=p(pe)`
387
+ `,rr=p(O)`
353
388
  gap: 12px;
354
389
  padding: 0 12px;
355
- `,Go=p(se)`
390
+ `,lr=p(F)`
356
391
  gap: 12px;
357
392
  max-height: 400px;
358
393
  overflow-y: auto;
359
- `,Xo=p.div`
394
+ `,sr=p.div`
360
395
  position: absolute;
361
396
  bottom: 0;
362
397
  left: 0;
@@ -365,19 +400,19 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
365
400
  border-radius: 0 0 24px 24px;
366
401
  background: ${({theme:e})=>`linear-gradient(to top, ${e.colors.dropdown_bg}, transparent)`};
367
402
  pointer-events: none;
368
- `,Qo=p(P)`
403
+ `,cr=p(B)`
369
404
  background-color: ${({theme:e})=>e.colors.orange_soft};
370
405
  color: ${({theme:e})=>e.text.primary};
371
406
  border-radius: 32px;
372
407
  width: fit-content;
373
408
  padding: 2px 8px;
374
- `,Zo=()=>{const i=m(),{notifications:n,markAsSeen:a}=Vt(),o=n.filter(({hideFromHistory:e})=>!e),r=o.filter(({seen:e})=>!e),l=r.length,{popupRef:s,popupOpen:c,setPopupOpen:d,popupPosition:u,handlePosition:p}=et({defaultClientHeight:420,defaultClientwidth:400,onClickOutside:()=>{l&&r.forEach(({id:e})=>a(e))}});return e(Uo,{children:[t(mt,{onClick:()=>{p(0,0),d(e=>!e)},tooltip:"Notifications",withPing:!!l,pingColor:i.colors.orange_og,children:t(Vi,{size:18})}),e(tt,{ref:s,isOpen:c,right:u.left,maxWidth:"400px",header:e(Yo,{children:[t(P,{size:20,children:"Notifications"}),!!l&&e(Qo,{size:12,family:"secondary",children:[l," new"]})]}),children:[t(Go,{children:o.length?o.map(e=>t(or,{...e,onClick:()=>d(!1)},`notification-${e.id}`)):t(Ne,{title:"No notifications",subTitle:""})}),t(Xo,{})]})]})},er=p.div`
409
+ `,dr=()=>{const i=m(),{notifications:n,markAsSeen:a}=Ht(),o=n.filter(({hideFromHistory:e})=>!e),r=o.filter(({seen:e})=>!e),l=r.length,{popupRef:s,popupOpen:c,setPopupOpen:d,popupPosition:u,handlePosition:p}=it({defaultClientHeight:420,defaultClientwidth:400,onClickOutside:()=>{l&&r.forEach(({id:e})=>a(e))}});return e(or,{children:[t(I,{onClick:()=>{p(0,0),d(e=>!e)},tooltip:"Notifications",withPing:!!l,pingColor:i.colors.orange_og,children:t(Bi,{size:18})}),e(nt,{ref:s,isOpen:c,right:u.left,maxWidth:"400px",header:e(rr,{children:[t(B,{size:20,children:"Notifications"}),!!l&&e(cr,{size:12,family:"secondary",children:[l," new"]})]}),children:[t(lr,{children:o.length?o.map(e=>t(yr,{...e,onClick:()=>d(!1)},`notification-${e.id}`)):t(Ae,{title:"No notifications",subTitle:""})}),t(sr,{})]})]})},ur=p.div`
375
410
  display: flex;
376
411
  align-items: flex-start;
377
412
  gap: 12px;
378
413
  padding: 16px;
379
414
  border-radius: 16px;
380
- background-color: ${({theme:e})=>e.colors.dropdown_bg_2+A["080"]};
415
+ background-color: ${({theme:e})=>e.colors.dropdown_bg_2+L["080"]};
381
416
  cursor: not-allowed;
382
417
  &.click-enabled {
383
418
  cursor: pointer;
@@ -385,32 +420,32 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
385
420
  background-color: ${({theme:e})=>e.colors.dropdown_bg_2};
386
421
  }
387
422
  }
388
- `,tr=p.div`
389
- background-color: ${({$type:e,theme:t})=>t.text[e]+A["015"]};
423
+ `,pr=p.div`
424
+ background-color: ${({$type:e,theme:t})=>t.text[e]+L["015"]};
390
425
  border-radius: 8px;
391
426
  width: 36px;
392
427
  height: 36px;
393
428
  display: flex;
394
429
  align-items: center;
395
430
  justify-content: center;
396
- `,ir=p.div`
431
+ `,hr=p.div`
397
432
  width: 290px;
398
- `,nr=p.div`
433
+ `,mr=p.div`
399
434
  margin-bottom: 6px;
400
- `,ar=p.div`
435
+ `,gr=p.div`
401
436
  display: flex;
402
437
  align-items: center;
403
438
  gap: 6px;
404
- `,or=({id:n,seen:a,type:o,title:r,message:l,time:s,crdType:c,target:d,onClick:u})=>{const p=m(),{formatTimeAgo:h}=Gt(),{onClickNotification:g}=Xt(),y=!!c&&!!d,v=r?.toLowerCase().includes(Q.Delete.toLowerCase())||!1,b=ge(o,p);return e(er,{className:y?"click-enabled":"",onClick:()=>{y&&(u(),g({id:n,crdType:c,target:d}))},children:[t(tr,{$type:v?ne.Error:o,children:t(v?Ai:b,{})}),e(ir,{children:[t(nr,{children:t(P,{size:14,children:l})}),e(ar,{children:[t(P,{size:10,color:p.text.grey,children:h(s)}),!a&&e(i,{children:[t(P,{size:10,children:"·"}),t(P,{size:10,color:p.colors.orange_soft,children:"new"})]})]})]})]},`notification-${n}`)},rr=(e,t,i)=>{const n=e?.serviceName||t?.otelServiceName||t?.name,a=i?[Bi]:He(t?.containers||[]),{priorotizedStatus:o}=ce(t?.conditions||[]);return{id:n,title:n,icons:a.length?a:[Wi],status:o,serviceMapEntry:e}},lr=e=>"user"===e?.otelServiceName&&!e?.namespace&&!e?.name&&!e?.kind,sr=p.div`
439
+ `,yr=({id:n,seen:a,type:o,title:r,message:l,time:s,crdType:c,target:d,onClick:u})=>{const p=m(),{formatTimeAgo:h}=Yt(),{onClickNotification:g}=Xt(),y=!!c&&!!d,v=r?.toLowerCase().includes(ne.Delete.toLowerCase())||!1,f=ve(o,p);return e(ur,{className:y?"click-enabled":"",onClick:()=>{y&&(u(),g({id:n,crdType:c,target:d}))},children:[t(pr,{$type:v?se.Error:o,children:t(v?Ni:f,{})}),e(hr,{children:[t(mr,{children:t(B,{size:14,children:l})}),e(gr,{children:[t(B,{size:10,color:p.text.grey,children:h(s)}),!a&&e(i,{children:[t(B,{size:10,children:"·"}),t(B,{size:10,color:p.colors.orange_soft,children:"new"})]})]})]})]},`notification-${n}`)},vr=(e,t,i)=>{const n=e?.serviceName||t?.otelServiceName||t?.name,a=i?[Hi]:t?We(t):[],{priorotizedStatus:o}=pe(t?.conditions||[]);return{id:n,title:n,icons:a.length?a:[Vi],status:o,serviceMapEntry:e}},fr=e=>"user"===e?.otelServiceName&&!e?.namespace&&!e?.name&&!e?.kind,br=p.div`
405
440
  width: 100%;
406
441
  height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px)`};
407
442
  position: relative;
408
- `,cr={namespace:"",name:"",kind:"",otelServiceName:"user",selected:!0,numberOfInstances:0,dataStreamNames:[],containers:[],conditions:[]},dr=({heightToRemove:e,serviceMap:i})=>{const n=m(),{sources:o,sourcesLoading:r}=W(),{containerRef:l,containerHeight:s,containerWidth:c}=Ue(),[d,u,p]=an([]),[h,y,v]=on([]);return a(()=>{if(s&&c){const t=(({sources:e,serviceMap:t,containerHeight:i,containerWidth:n})=>{const a=[],o=new Map,r=((e,t)=>{const i=new Map,n=new Map,a=new Map,o=new Set;e.forEach(e=>{o.add(e.serviceName),e.services.forEach(e=>{o.add(e.serviceName)})}),o.forEach(e=>{n.set(e,[]),a.set(e,0)}),e.forEach(e=>{e.services.forEach(t=>{n.get(e.serviceName)?.push(t.serviceName);const i=a.get(t.serviceName)||0;a.set(t.serviceName,i+1)})});const r=[],l=[];for(o.forEach(e=>{0===(a.get(e)||0)&&l.push(e)});l.length>0;){const e=[],t=l.length;for(let i=0;i<t;i++){const t=l.shift();e.push(t),n.get(t)?.forEach(e=>{const t=a.get(e)||0;a.set(e,t-1),t-1==0&&l.push(e)})}e.length>0&&r.push(e)}return o.forEach(e=>{r.flat().includes(e)||(0===r.length?r.push([e]):r[r.length-1].push(e))}),r.forEach((e,n)=>{const a=100+150*n,o=150*(e.length-1),r=(t-o)/2;e.forEach((e,t)=>{const n=r+150*t,o=a;i.set(e,{x:n,y:o})})}),i})(t,n);if(t.length&&e.length){t.forEach(t=>{const i=t.serviceName;if(a.find(e=>e.id===`${B.Source}-${i}-${Qt.MapItem}`))return;const n=e.find(e=>i===e.otelServiceName||i===e.name);o.set(i,t),t.services.forEach(e=>o.set(e.serviceName,{serviceName:e.serviceName,services:[]})),a.push({id:`${B.Source}-${i}-${Qt.MapItem}`,type:Qt.MapItem,position:r.get(i),data:rr(t,n,lr(n))})}),o.forEach((t,i)=>{if(a.find(e=>e.id===`${B.Source}-${i}-${Qt.MapItem}`))return;const n=e.find(e=>i===e.otelServiceName||i===e.name);a.push({id:`${B.Source}-${i}-${Qt.MapItem}`,type:Qt.MapItem,position:r.get(i),data:rr(t,n,lr(n))})});let i=50;e.forEach(e=>{const t=e.otelServiceName||e.name;a.find(e=>e.id===`${B.Source}-${t}-${Qt.MapItem}`)||(a.push({id:`${B.Source}-${t}-${Qt.MapItem}`,type:Qt.MapItem,position:{x:i,y:10},data:rr(void 0,e,lr(e))}),i+=110)})}else a.push({id:`${B.Source}-${Qt.NoData}`,type:Qt.NoData,position:{x:n/2-150,y:i/4},data:{subTitle:g.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return a})({serviceMap:i,sources:[cr].concat(o),containerHeight:s,containerWidth:c});d.length>1?(e=t,u(t=>{const i=e.map(e=>{const i=t.find(t=>t.id===e.id);return e.position=i?.position||e.position,{id:e.id,item:e,type:i?"replace":"add"}});return t.find(e=>e.id===`${B.Source}-${Qt.NoData}`)&&i.push({id:`${B.Source}-${Qt.NoData}`,type:"remove"}),rn(i,t)})):u(t)}var e},[i,o,r,s,c]),a(()=>{y((({theme:e,nodes:t,serviceMap:i})=>{const n=[];return t.forEach(({id:t,data:{id:a,status:o}})=>{const{services:r}=i.find(e=>e.serviceName===a)||{services:[]};r.forEach(i=>{const a=t,r=`${B.Source}-${i.serviceName}-${Qt.MapItem}`,l=o===ne.Error;n.push({id:`${a}-to-${r}`,source:a,target:r,markerEnd:{type:nn.ArrowClosed},style:{stroke:l?e?.colors.dark_red:e?.colors.border}})})}),n})({theme:n,nodes:d,serviceMap:i}))},[n,d,i]),t(sr,{ref:l,$heightToRemove:e,children:t(Zt,{nodes:d,edges:h,onNodesChange:p,onEdgesChange:v,zoomOnScroll:!0})})},ur=p.div`
443
+ `,xr={namespace:"",name:"",kind:"",otelServiceName:"user",selected:!0,numberOfInstances:0,dataStreamNames:[],containers:[],conditions:[]},$r=({heightToRemove:e,serviceMap:i})=>{const n=m(),{sources:o,sourcesLoading:r}=Y(),{containerRef:l,containerHeight:s,containerWidth:c}=Ye(),[d,u,p]=nn([]),[h,y,v]=an([]);return a(()=>{if(s&&c){const t=(({sources:e,serviceMap:t,containerHeight:i,containerWidth:n})=>{const a=[],o=new Map,r=((e,t)=>{const i=new Map,n=new Map,a=new Map,o=new Set;e.forEach(e=>{o.add(e.serviceName),e.services.forEach(e=>{o.add(e.serviceName)})}),o.forEach(e=>{n.set(e,[]),a.set(e,0)}),e.forEach(e=>{e.services.forEach(t=>{n.get(e.serviceName)?.push(t.serviceName);const i=a.get(t.serviceName)||0;a.set(t.serviceName,i+1)})});const r=[],l=[];for(o.forEach(e=>{0===(a.get(e)||0)&&l.push(e)});l.length>0;){const e=[],t=l.length;for(let i=0;i<t;i++){const t=l.shift();e.push(t),n.get(t)?.forEach(e=>{const t=a.get(e)||0;a.set(e,t-1),t-1==0&&l.push(e)})}e.length>0&&r.push(e)}return o.forEach(e=>{r.flat().includes(e)||(0===r.length?r.push([e]):r[r.length-1].push(e))}),r.forEach((e,n)=>{const a=100+150*n,o=150*(e.length-1),r=(t-o)/2;e.forEach((e,t)=>{const n=r+150*t,o=a;i.set(e,{x:n,y:o})})}),i})(t,n);if(t.length&&e.length){t.forEach(t=>{const i=t.serviceName;if(a.find(e=>e.id===`${G.Source}-${i}-${Zt.MapItem}`))return;const n=e.find(e=>i===e.otelServiceName||i===e.name);o.set(i,t),t.services.forEach(e=>o.set(e.serviceName,{serviceName:e.serviceName,services:[]})),a.push({id:`${G.Source}-${i}-${Zt.MapItem}`,type:Zt.MapItem,position:r.get(i),data:vr(t,n,fr(n))})}),o.forEach((t,i)=>{if(a.find(e=>e.id===`${G.Source}-${i}-${Zt.MapItem}`))return;const n=e.find(e=>i===e.otelServiceName||i===e.name);a.push({id:`${G.Source}-${i}-${Zt.MapItem}`,type:Zt.MapItem,position:r.get(i),data:vr(t,n,fr(n))})});let i=50;e.forEach(e=>{const t=e.otelServiceName||e.name;a.find(e=>e.id===`${G.Source}-${t}-${Zt.MapItem}`)||(a.push({id:`${G.Source}-${t}-${Zt.MapItem}`,type:Zt.MapItem,position:{x:i,y:10},data:vr(void 0,e,fr(e))}),i+=110)})}else a.push({id:`${G.Source}-${Zt.NoData}`,type:Zt.NoData,position:{x:n/2-150,y:i/4},data:{subTitle:g.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return a})({serviceMap:i,sources:[xr].concat(o),containerHeight:s,containerWidth:c});d.length>1?(e=t,u(t=>{const i=e.map(e=>{const i=t.find(t=>t.id===e.id);return e.position=i?.position||e.position,{id:e.id,item:e,type:i?"replace":"add"}});return t.find(e=>e.id===`${G.Source}-${Zt.NoData}`)&&i.push({id:`${G.Source}-${Zt.NoData}`,type:"remove"}),on(i,t)})):u(t)}var e},[i,o,r,s,c]),a(()=>{y((({theme:e,nodes:t,serviceMap:i})=>{const n=[];return t.forEach(({id:t,data:{id:a,status:o}})=>{const{services:r}=i.find(e=>e.serviceName===a)||{services:[]};r.forEach(i=>{const a=t,r=`${G.Source}-${i.serviceName}-${Zt.MapItem}`,l=o===se.Error;n.push({id:`${a}-to-${r}`,source:a,target:r,markerEnd:{type:tn.ArrowClosed},style:{stroke:l?e?.colors.dark_red:e?.colors.border}})})}),n})({theme:n,nodes:d,serviceMap:i}))},[n,d,i]),t(br,{ref:l,$heightToRemove:e,children:t(Qt,{nodes:d,edges:h,onNodesChange:p,onEdgesChange:v,zoomOnScroll:!0})})},Sr=p.div`
409
444
  width: 100%;
410
445
  padding-bottom: ${({$isOpen:e})=>e?"18px":"0"};
411
446
  border-radius: 16px;
412
- background-color: ${({$selected:e,theme:t})=>e?t.colors.majestic_blue+A["024"]:t.colors.dropdown_bg_2+A["040"]};
413
- `,pr=p.div`
447
+ background-color: ${({$selected:e,theme:t})=>e?t.colors.majestic_blue+L["024"]:t.colors.dropdown_bg_2+L["040"]};
448
+ `,Cr=p.div`
414
449
  display: flex;
415
450
  justify-content: space-between;
416
451
  gap: 12px;
@@ -419,29 +454,29 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
419
454
  border-radius: 16px;
420
455
  cursor: ${({$withClick:e})=>e?"pointer":"unset"};
421
456
  &:hover {
422
- background-color: ${({$withClick:e,$selected:t,theme:i})=>e&&(t?i.colors.majestic_blue+A["040"]:i.colors.dropdown_bg_2+A["080"])};
457
+ background-color: ${({$withClick:e,$selected:t,theme:i})=>e&&(t?i.colors.majestic_blue+L["040"]:i.colors.dropdown_bg_2+L["080"])};
423
458
  transition: background-color 0.3s;
424
459
  }
425
- `,hr=p(pr)`
460
+ `,kr=p(Cr)`
426
461
  width: calc(100% - 100px);
427
462
  margin: 0 auto;
428
463
  padding: 8px;
429
- `,mr=p.div`
464
+ `,wr=p.div`
430
465
  position: relative;
431
466
  padding-bottom: ${({$addPadding:e})=>e?"16px":"0"};
432
- `,gr=p.div`
467
+ `,Tr=p.div`
433
468
  position: absolute;
434
469
  top: 6px;
435
470
  left: 18px;
436
- `,yr=p(Te)`
471
+ `,Dr=p(Ee)`
437
472
  padding-bottom: ${({$addPadding:e})=>e?"16px":"0"};
438
- `,vr=p.div`
473
+ `,Nr=p.div`
439
474
  width: ${({$width:e})=>`${e||42}px`};
440
475
  display: flex;
441
476
  align-items: center;
442
477
  justify-content: flex-end;
443
478
  text-align: right;
444
- `,br=we(B.Namespace),fr=({isModal:i=!1,withInstances:n=!0,fetchingNamespace:a,fetchedNamespaces:o,filteredNamespacesAndSources:r,selectedNamespace:l,onSelectNamespace:s,selectedSources:c,onSelectSource:d,selectedFutureApps:u,onSelectFutureApps:p})=>{const h=m(),{isVm:y}=Le(),{namespacesLoading:v}=W(),b=Object.entries(r||{});return b?.length?t(Ke,{height:i?"calc(100vh - 510px)":"calc(100vh - 310px)",gap:12,noAnimation:!0,elements:b.map(([i,r])=>{const m=c?.[i]||[],b=u?.[i]?.selected||!1,f=m.filter(({selected:e})=>e),x=m.length>0,$=l===i,C=f.length>0&&f.length===r.length,w=f.length>0&&f.length!==r.length,k=r.length>0,D=1===r.length;return s||k?e(ur,{"data-id":`namespace-${i}`,$selected:C,$isOpen:$,children:[e(pr,{$selected:C,$withClick:!!s,onClick:()=>s?.(i),children:[e(pe,{$gap:12,children:[s&&t(S,{partiallyChecked:w,value:C,onChange:e=>s(i,e)}),t(br,{}),t(P,{children:i})]}),e(pe,{$gap:24,children:[!y&&p&&t(T,{title:g.FUTURE_APPS_TITLE,tooltip:g.FUTURE_APPS_DESCRIPTION,initialValue:b,onChange:e=>p(e,i),flipHorizontally:!0}),t(vr,{$width:108,children:a!==i||o?.includes(i)?null:t(ei,{size:10,children:"Retrieving workloads..."})}),t(vr,{children:t(P,{size:10,color:h.text.grey,children:x?`${f.length}/${r.length}`:null})}),s&&t(gt,{extend:$})]})]}),($||!s)&&(k?e(mr,{$addPadding:!d,children:[t(gr,{children:t(re,{orientation:"vertical",length:(D?24:34*r.length)+"px"})}),r.map(e=>{const a=f.some(({name:t})=>t===e.name);return t(xr,{withInstances:n,source:e,namespace:i,isSelected:a,onSelect:d},`source-${e.name}`)})]}):t(yr,{$addPadding:!d,children:v||a===i&&!o?.includes(i)?t(Ae,{}):t(Ne,{title:g.NO_SOURCES_NAMESPACE,subTitle:g.TRY_SEARCH_OR_OTHER_NAMESPACE})}))]},`namespace-${i}`):null})}):t(Te,{children:v||a?t(Ae,{}):t(Ne,{title:g.NO_SOURCES,subTitle:!y&&s?g.PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES:g.PLEASE_ADD_SOURCE})})},xr=({withInstances:i,source:n,namespace:a,isSelected:o,onSelect:r})=>t(hr,{"data-id":`source-${n.name}`,$selected:o,$withClick:!!r,onClick:()=>r?.(n),children:e(pe,{$gap:12,children:[r&&t(S,{value:o,onChange:()=>r(n,a)}),e(pe,{$gap:4,children:[t(P,{children:n.name}),e(P,{opacity:.8,size:10,children:[i?` • ${n.numberOfInstances||0} running instance${1!==n.numberOfInstances?"s":""}`:"",` • ${n.kind}`]})]})]})}),Sr=p.div`
479
+ `,Er=Te(G.Namespace),Ar=({isModal:i=!1,withInstances:n=!0,loading:a,filteredNamespacesAndSources:o,selectedNamespace:r,onSelectNamespace:l,selectedSources:s,onSelectSource:c,selectedFutureApps:d,onSelectFutureApps:u})=>{const p=m(),{isVm:h}=je(),{namespacesLoading:y}=Y(),v=Object.entries(o||{});return v?.length?t(ze,{height:i?"calc(100vh - 510px)":"calc(100vh - 310px)",gap:12,noAnimation:!0,elements:v.map(([i,o])=>{const m=s?.[i]||[],v=d?.[i]?.selected||!1,f=m.filter(({selected:e})=>e),b=m.length>0,x=r===i,S=f.length>0&&f.length===o.length,C=f.length>0&&f.length!==o.length,k=o.length>0,w=1===o.length;return l||k?e(Sr,{"data-id":`namespace-${i}`,$selected:S,$isOpen:x,children:[e(Cr,{$selected:S,$withClick:!!l,onClick:()=>l?.(i),children:[e(O,{$gap:12,children:[l&&t($,{partiallyChecked:C,value:S,onChange:e=>l(i,e)}),t(Er,{}),t(B,{children:i})]}),e(O,{$gap:24,children:[!h&&u&&t(D,{title:g.FUTURE_APPS_TITLE,tooltip:g.FUTURE_APPS_DESCRIPTION,initialValue:v,onChange:e=>u(e,i),flipHorizontally:!0}),t(Nr,{children:t(B,{size:10,color:p.text.grey,children:b?`${f.length}/${o.length}`:null})}),l&&t(yt,{extend:x})]})]}),(x||!l)&&(k?e(wr,{$addPadding:!c,children:[t(Tr,{children:t(A,{orientation:"vertical",length:(w?24:34*o.length)+"px"})}),o.map(e=>{const a=f.some(({name:t})=>t===e.name);return t(Fr,{withInstances:n,source:e,namespace:i,isSelected:a,onSelect:c},`source-${e.name}`)})]}):t(Dr,{$addPadding:!c,children:y||a?t(Re,{}):t(Ae,{title:g.NO_SOURCES_NAMESPACE,subTitle:g.TRY_SEARCH_OR_OTHER_NAMESPACE})}))]},`namespace-${i}`):null})}):t(Ee,{children:y||a?t(Re,{}):t(Ae,{title:g.NO_SOURCES,subTitle:!h&&l?g.PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES:g.PLEASE_ADD_SOURCE})})},Fr=({withInstances:i,source:n,namespace:a,isSelected:o,onSelect:r})=>t(kr,{"data-id":`source-${n.name}`,$selected:o,$withClick:!!r,onClick:()=>r?.(n),children:e(O,{$gap:12,children:[r&&t($,{value:o,onChange:()=>r(n,a)}),e(O,{$gap:4,children:[t(B,{children:n.name}),e(B,{opacity:.8,size:10,children:[i?` • ${n.numberOfInstances||0} running instance${1!==n.numberOfInstances?"s":""}`:"",` • ${n.kind}`]})]})]})}),Or=p.div`
445
480
  display: flex;
446
481
  flex-direction: column;
447
482
  align-items: center;
@@ -450,35 +485,35 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
450
485
  max-height: calc(100vh - 200px);
451
486
  height: fit-content;
452
487
  overflow-y: scroll;
453
- `,$r=({onEditStream:i,onEditSources:n,onEditDestinations:a,categories:o})=>{const{selectedStreamName:r}=Je(),{configuredSources:l,configuredDestinations:c,configuredDestinationsUpdateOnly:d}=pt(),u=s(()=>Object.values(l).reduce((e,t)=>e+t.filter(e=>e.selected).length,0),[l]);return t(te,{$isNotModal:!0,children:e(se,{$gap:12,children:[t(I,{title:g.SUMMARY,description:g.STREAM_CONFIRM}),e(Sr,{children:[t(G,{title:g.STREAM_NAME,action:()=>t(ti,{onClick:i}),data:[{title:"",value:r}]}),t(G,{title:g.SELECTED_SOURCES,titleBadge:u,action:()=>t(ti,{onClick:n}),children:t(fr,{filteredNamespacesAndSources:l,withInstances:!1})}),t(G,{title:g.SELECTED_DESTINATIONS,titleBadge:c.length+d.length,action:()=>t(ti,{onClick:a}),children:t(bo,{categories:o})})]})]})})};var Cr;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}(Cr||(Cr={}));const wr=({onClickId:e,defaultSelectedId:i,extendedNavIcons:a})=>{const{isVm:o}=Le(),[r,l]=n(i||""),c=s(()=>[{id:Cr.Overview,icon:_i,selected:r===Cr.Overview,onClick:()=>{l(Cr.Overview),e(Cr.Overview)},tooltip:"Overview"},...(a||[]).map(e=>({...e,selected:r===e.id,onClick:()=>{l(e.id),e.onClick()}}))],[r]),d=s(()=>{const t=[{id:Cr.Sources,icon:Ji,selected:r===Cr.Sources,onClick:()=>{l(Cr.Sources),e(Cr.Sources)},tooltip:"Sources"},{id:Cr.Destinations,icon:Ui,selected:r===Cr.Destinations,onClick:()=>{l(Cr.Destinations),e(Cr.Destinations)},tooltip:"Destinations"}];return o||(t.push({id:Cr.InstrumentationRules,icon:Yi,selected:r===Cr.InstrumentationRules,onClick:()=>{l(Cr.InstrumentationRules),e(Cr.InstrumentationRules)},tooltip:"Instrumentation Rules"}),t.push({id:Cr.Actions,icon:Gi,selected:r===Cr.Actions,onClick:()=>{l(Cr.Actions),e(Cr.Actions)},tooltip:"Actions"})),t},[o,r]);return t(ii,{orientation:"vertical",mainIcons:c,subIcons:d})},kr=({})=>t(mt,{onClick:()=>window.open("https://join.slack.com/t/odigos/shared_invite/zt-2wc6gm4j9-EhcVFYrLwHqvcIErO9sVzw","_blank","noopener noreferrer"),tooltip:"Join our Slack community",children:t(Xi,{})}),Dr=(e,t)=>{const{name:i,kind:n,namespace:a}=e,o=[{title:g.KIND,value:n},{title:g.NAME,value:i,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 ${n} ${i} -n ${a}`.toLowerCase()})),o},Tr=p.div`
488
+ `,Ir=({onEditStream:i,onEditSources:n,onEditDestinations:a,categories:o})=>{const{selectedStreamName:r}=Ge(),{configuredSources:l,configuredDestinations:s,configuredDestinationsUpdateOnly:d}=mt(),u=c(()=>Object.values(l).reduce((e,t)=>e+t.filter(e=>e.selected).length,0),[l]);return t(re,{$isNotModal:!0,children:e(F,{$gap:12,children:[t(P,{title:g.SUMMARY,description:g.STREAM_CONFIRM}),e(Or,{children:[t(te,{title:g.STREAM_NAME,action:()=>t(ei,{onClick:i}),data:[{title:"",value:r}]}),t(te,{title:g.SELECTED_SOURCES,titleBadge:u,action:()=>t(ei,{onClick:n}),children:t(Ar,{filteredNamespacesAndSources:l,withInstances:!1})}),t(te,{title:g.SELECTED_DESTINATIONS,titleBadge:s.length+d.length,action:()=>t(ei,{onClick:a}),children:t(Eo,{categories:o})})]})]})})};var Rr;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}(Rr||(Rr={}));const Mr=({onClickId:e,defaultSelectedId:i,extendedNavIcons:a})=>{const{isVm:o}=je(),[r,l]=n(i||""),s=c(()=>[{id:Rr.Overview,icon:Wi,selected:r===Rr.Overview,onClick:()=>{l(Rr.Overview),e(Rr.Overview)},tooltip:"Overview"},...(a||[]).map(e=>({...e,selected:r===e.id,onClick:()=>{l(e.id),e.onClick()}}))],[r]),d=c(()=>{const t=[{id:Rr.Sources,icon:_i,selected:r===Rr.Sources,onClick:()=>{l(Rr.Sources),e(Rr.Sources)},tooltip:"Sources"},{id:Rr.Destinations,icon:Ui,selected:r===Rr.Destinations,onClick:()=>{l(Rr.Destinations),e(Rr.Destinations)},tooltip:"Destinations"}];return o||(t.push({id:Rr.InstrumentationRules,icon:Ji,selected:r===Rr.InstrumentationRules,onClick:()=>{l(Rr.InstrumentationRules),e(Rr.InstrumentationRules)},tooltip:"Instrumentation Rules"}),t.push({id:Rr.Actions,icon:Gi,selected:r===Rr.Actions,onClick:()=>{l(Rr.Actions),e(Rr.Actions)},tooltip:"Actions"})),t},[o,r]);return t(ti,{orientation:"vertical",mainIcons:s,subIcons:d})},Kr=({})=>t(I,{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,{})}),Lr=(e,t)=>{const{name:i,kind:n,namespace:a}=e,o=[{title:g.KIND,value:n},{title:g.NAME,value:i,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 ${n} ${i} -n ${a}`.toLowerCase()})),o},Pr=p.div`
454
489
  display: flex;
455
490
  flex-direction: column;
456
491
  gap: 24px;
457
492
  padding: 4px;
458
- `,Nr=({formData:e,handleFormChange:i})=>t(Tr,{children:t(C,{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}})=>i("otelServiceName",e)})}),Er=({workloadOdigosHealthStatus:e})=>{if(!e)return null;const i=ni(e?.status),n=ot(e?.reasonEnum),a=e?.message;return t(pe,{$alignItems:"center",$justifyContent:"center",children:t(de,{status:i,title:n,subtitle:a,withBackground:i!==ue.Disabled,withBorder:!0,withIcon:!0,width:"calc(100% - 24px)"})})},Fr=({source:i,fetchSourceDescribe:o,onClickRestartPod:r})=>{const[l,s]=n(!1),[c,d]=n(null);return a(()=>{i&&o({namespace:i.namespace,name:i.name,kind:i.kind}).then(({data:e})=>{e?.describeSource?d(e.describeSource):s(!0)})},[i.namespace,i.name,i.kind]),c||l?t(se,{$gap:12,children:l?t(Te,{$height:"70vh",children:t(Ne,{subTitle:"Could not fetch describe for this source"})}):c?.pods?.length?c.pods.map(({podName:n,nodeName:a,phase:o,agentInjected:l,runningLatestWorkloadRevision:s,containers:d,manifestYAML:p})=>{const h=o.status!==ne.Success||ai(d)?ne.Error:ne.Success,m=[];return m.push(t(oi,{value:`kubectl get pod ${n.value} -n ${c?.namespace?.value||i.namespace}`.toLowerCase()},"copy-text")),m.push(t(re,{length:"100%",margin:"0"},"divider-1")),m.push(t(ri,{title:a.name,tooltip:a.explain||"",value:{status:a.status||void 0,text:a.value}},"describe-row-1")),m.push(t(re,{length:"100%",margin:"0"},"divider-2")),m.push(t(ri,{title:o.name,tooltip:o.explain||"",value:{status:o.status||void 0,text:o.value}},"describe-row-2")),m.push(t(re,{length:"100%",margin:"0"},"divider-3")),m.push(t(ri,{title:l.name,tooltip:l.explain||"",value:{status:l.status||void 0,text:l.value}},"describe-row-3")),m.push(t(re,{length:"100%",margin:"0"},"divider-4")),s?.name&&(m.push(t(ri,{title:s.name,tooltip:s.explain||void 0,value:{status:s.status||void 0,text:s.value}},"describe-row-4")),m.push(t(re,{length:"100%",margin:"0"},"divider-5"))),d.forEach(e=>{m.push(t(li,{...e},`pod-container-${e.containerName.value}`))}),p&&(m.push(t(re,{length:"100%",margin:"0"},"divider-6")),m.push(t(ln,{yaml:p},"yaml-section-card"))),t(G,{title:`Pod: ${n.value}`,withExtend:!0,action:({hovered:a})=>e("div",{style:{position:"relative"},children:[t(de,{status:h,title:h,withIcon:!0,withBorder:!0},"status"),a&&t(si,{isOpen:!0,positionRight:"calc(100% + 12px)",actions:r?[{id:ci(),label:"Restart",rightIcon:Mi,onClick:()=>r(c?.namespace?.value||i.namespace,n.value)}]:[]},"hover-actions")]}),children:u.toArray(m)},`pod-${n.value}`)}):t(Te,{$height:"70vh",children:t(Ne,{subTitle:"Check if you have any running pods and try again"})})}):t(Te,{$height:"70vh",children:t(Ae,{})})},Or=p(pe)`
493
+ `,jr=({formData:e,handleFormChange:i})=>t(Pr,{children:t(C,{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}})=>i("otelServiceName",e)})}),zr=({workloadOdigosHealthStatus:e})=>{if(!e)return null;const i=ii(e?.status),n=lt(e?.reasonEnum),a=e?.message;return t(O,{$alignItems:"center",$justifyContent:"center",children:t(he,{status:i,title:n,subtitle:a,withBackground:i!==me.Disabled,withBorder:!0,withIcon:!0,width:"calc(100% - 24px)"})})},qr=({source:i,fetchSourceDescribe:o,onClickRestartPod:r})=>{const[l,s]=n(!1),[c,d]=n(null);return a(()=>{i&&o({namespace:i.namespace,name:i.name,kind:i.kind}).then(({data:e})=>{e?.describeSource?d(e.describeSource):s(!0)})},[i.namespace,i.name,i.kind]),c||l?t(F,{$gap:12,children:l?t(Ee,{$height:"70vh",children:t(Ae,{subTitle:"Could not fetch describe for this source"})}):c?.pods?.length?c.pods.map(({podName:n,nodeName:a,phase:o,agentInjected:l,runningLatestWorkloadRevision:s,containers:d,manifestYAML:p})=>{const h=o.status!==se.Success||ni(d)?se.Error:se.Success,m=[];return m.push(t(ai,{value:`kubectl get pod ${n.value} -n ${c?.namespace?.value||i.namespace}`.toLowerCase()},"copy-text")),m.push(t(A,{length:"100%",margin:"0"},"divider-1")),m.push(t(oi,{title:a.name,tooltip:a.explain||"",value:{status:a.status||void 0,text:a.value}},"describe-row-1")),m.push(t(A,{length:"100%",margin:"0"},"divider-2")),m.push(t(oi,{title:o.name,tooltip:o.explain||"",value:{status:o.status||void 0,text:o.value}},"describe-row-2")),m.push(t(A,{length:"100%",margin:"0"},"divider-3")),m.push(t(oi,{title:l.name,tooltip:l.explain||"",value:{status:l.status||void 0,text:l.value}},"describe-row-3")),m.push(t(A,{length:"100%",margin:"0"},"divider-4")),s?.name&&(m.push(t(oi,{title:s.name,tooltip:s.explain||void 0,value:{status:s.status||void 0,text:s.value}},"describe-row-4")),m.push(t(A,{length:"100%",margin:"0"},"divider-5"))),d.forEach(e=>{m.push(t(ri,{...e},`pod-container-${e.containerName.value}`))}),p&&(m.push(t(A,{length:"100%",margin:"0"},"divider-6")),m.push(t(rn,{yaml:p},"yaml-section-card"))),t(te,{title:`Pod: ${n.value}`,withExtend:!0,action:({hovered:a})=>e("div",{style:{position:"relative"},children:[t(he,{status:h,title:h,withIcon:!0,withBorder:!0},"status"),a&&t(li,{isOpen:!0,positionRight:"calc(100% + 12px)",actions:r?[{id:si(),label:"Restart",rightIcon:Ri,onClick:()=>r(c?.namespace?.value||i.namespace,n.value)}]:[]},"hover-actions")]}),children:u.toArray(m)},`pod-${n.value}`)}):t(Ee,{$height:"70vh",children:t(Ae,{subTitle:"Check if you have any running pods and try again"})})}):t(Ee,{$height:"70vh",children:t(Re,{})})},Br=p(O)`
459
494
  width: 100%;
460
495
  align-items: center;
461
496
  justify-content: space-between;
462
- `,Ar=({source:i,fetchSourceLibraries:o})=>{const r=m(),[l,s]=n(!1),[d,u]=n(null);return a(()=>{i&&o({namespace:i.namespace,name:i.name,kind:i.kind}).then(({data:e})=>{e?.instrumentationInstanceComponents?u(Et(e.instrumentationInstanceComponents).sort((e,t)=>e.name.localeCompare(t.name))):s(!0)})},[i.namespace,i.name,i.kind]),d||l?t(se,{$gap:12,children:l?t(Te,{$height:"70vh",children:t(Ne,{subTitle:"Could not fetch libraries for this source"})}):d?.length?t(G,{title:"Instrumented Libraries",children:d.map(({name:i,healthy:n,message:a,nonIdentifyingAttributes:o},l)=>e(c,{children:[e(se,{$gap:4,$width:"100%",children:[e(Or,{$width:"100%",children:[t(P,{size:12,color:r.text.grey,children:i}),e(pe,{$gap:4,children:[o.map(({key:e,value:n})=>di(n)&&ui(n)&&"is_standard_lib"===e?t(de,{status:ne.Default,title:"STANDARD",withBorder:!0},`${i}-${e}`):null),"boolean"==typeof n&&t(de,{status:n?ne.Success:ne.Error,title:n?"HEALTHY":"UNHEALTHY",withBorder:!0})]})]}),a&&t(P,{size:10,color:r.text.error,align:"right",children:a})]}),l!==d.length-1&&t(re,{length:"100%",margin:"0"})]},`library-${i}`))}):e(Te,{$height:"70vh",$gap:12,children:[t(Ne,{title:"No libraries found",subTitle:""}),t(ie,{type:ne.Warning,message:"This feature is in early development, and has very limited support"})]})}):t(Te,{$height:"70vh",children:t(Ae,{})})};var Ir;!function(e){e.Overview="Overview",e.Pods="Pods",e.Libraries="Libraries"}(Ir||(Ir={}));const Rr=[hi.Deployment,hi.StatefulSet,hi.DaemonSet,hi.DeploymentConfig,hi.Rollout,hi.StaticPod],Mr=[hi.Deployment,hi.StatefulSet,hi.DaemonSet,hi.DeploymentConfig,hi.Rollout,hi.Pod],Lr=[mi.Python,mi.Go,mi.Java],Pr=p.div`
497
+ `,Hr=({source:i,fetchSourceLibraries:r})=>{const l=m(),[s,c]=n(!1),[d,u]=n(null);return a(()=>{i&&r({namespace:i.namespace,name:i.name,kind:i.kind}).then(({data:e})=>{e?.instrumentationInstanceComponents?u(Et(e.instrumentationInstanceComponents).sort((e,t)=>e.name.localeCompare(t.name))):c(!0)})},[i.namespace,i.name,i.kind]),d||s?t(F,{$gap:12,children:s?t(Ee,{$height:"70vh",children:t(Ae,{subTitle:"Could not fetch libraries for this source"})}):d?.length?t(te,{title:"Instrumented Libraries",children:d.map(({name:i,healthy:n,message:a,nonIdentifyingAttributes:r},s)=>e(o,{children:[e(F,{$gap:4,$width:"100%",children:[e(Br,{$width:"100%",children:[t(B,{size:12,color:l.text.grey,children:i}),e(O,{$gap:4,children:[r.map(({key:e,value:n})=>ci(n)&&di(n)&&"is_standard_lib"===e?t(he,{status:se.Default,title:"STANDARD",withBorder:!0},`${i}-${e}`):null),"boolean"==typeof n&&t(he,{status:n?se.Success:se.Error,title:n?"HEALTHY":"UNHEALTHY",withBorder:!0})]})]}),a&&t(B,{size:10,color:l.text.error,align:"right",children:a})]}),s!==d.length-1&&t(A,{length:"100%",margin:"0"})]},`library-${i}`))}):e(Ee,{$height:"70vh",$gap:12,children:[t(Ae,{title:"No libraries found",subTitle:""}),t(le,{type:se.Warning,message:"This feature is in early development, and has very limited support"})]})}):t(Ee,{$height:"70vh",children:t(Re,{})})};var Vr;!function(e){e.Overview="Overview",e.Pods="Pods",e.Libraries="Libraries"}(Vr||(Vr={}));const Wr=[pi.Deployment,pi.StatefulSet,pi.DaemonSet,pi.DeploymentConfig,pi.Rollout,pi.StaticPod],_r=[pi.Deployment,pi.StatefulSet,pi.DaemonSet,pi.DeploymentConfig,pi.Rollout,pi.Pod],Ur=[hi.Python,hi.Go,hi.Java],Jr=p.div`
463
498
  width: 100%;
464
499
  height: 100%;
465
500
  max-height: calc(100vh - 220px);
466
501
  overflow: overlay;
467
502
  overflow-y: auto;
468
- `,jr=p.div`
503
+ `,Gr=p.div`
469
504
  display: flex;
470
505
  flex-direction: column;
471
506
  gap: 12px;
472
- `;var Kr;!function(e){e.Workload="Workload",e.Pod="Pod"}(Kr||(Kr={}));const qr=({persistSources:o,updateSource:l,restartWorkloads:c,fetchSourceById:d,fetchSourceDescribe:u,fetchSourceLibraries:p,restartPod:h,recoverFromRollback:m})=>{const{isVm:y}=Le(),{sources:v}=W(),{selectedStreamName:b}=Je(),{drawerType:f,drawerEntityId:x}=j(),S=s(()=>Ye(v,b),[v,b]),$=r(null),C=f===B.Source,[w,k]=n(!1),[D,T]=n(!1),[N,E]=n(Ir.Overview),[F,O]=n(null);a(()=>{C&&x&&d(x).then(e=>O(e||null))},[C,x]);const{formData:A,handleFormChange:I,resetFormData:R,loadFormWithDrawerItem:M}=pi(),L=s(()=>{if(x)return F&&JSON.stringify(Yt(F))===JSON.stringify(Yt(x))?F:S?.find(e=>JSON.stringify(Yt(e))===JSON.stringify(Yt(x)))},[x,S,F]);a(()=>{C&&L?M(L):R()},[C,L]);const K=s(()=>{const e=L?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===ue.Loading,containers:L?.containers||[]}},[L]),q=s(()=>!!L?.rollbackOccurred,[L?.rollbackOccurred]),z=s(()=>{const e=[{label:Ir.Overview,onClick:()=>E(Ir.Overview),selected:N===Ir.Overview}];return y||(Rr.includes(L?.kind)&&e.push({label:Ir.Pods,onClick:()=>E(Ir.Pods),selected:N===Ir.Pods}),L?.containers?.some(({language:e})=>Lr.includes(e))&&e.push({label:Ir.Libraries,onClick:()=>E(Ir.Libraries),selected:N===Ir.Libraries})),e},[N,L,y]),H=Mr.includes(L?.kind),[V,_]=n({openFor:null,workloadId:void 0,podNamespace:void 0,podName:void 0});return L?e(Fn,{ref:$,onClose:()=>{E(Ir.Overview),O(null)},title:L.otelServiceName||L.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:He(L.containers),isEdit:w,isFormDirty:D,onEdit:N===Ir.Overview?e=>{k("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=A.otelServiceName!==L.name?A.otelServiceName:"";I("otelServiceName",e),await l(x,{...A,otelServiceName:e}),O(null),T(!1),k(!1)},onDelete:N===Ir.Overview?async()=>{const{namespace:e}=L;o({[e]:[{...L,selected:!1,currentStreamName:b}]},{}),O(null),T(!1),k(!1),$.current?.closeDrawer()}:void 0,onCancel:()=>{T(!1),k(!1),I("otelServiceName",L.otelServiceName||L.name||"")},isLastItem:1===S.length,tabs:z,headerActionButtons:y?[]:H?[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>_({openFor:Kr.Workload,workloadId:x}),children:e(i,{children:[t(Hi,{}),t(P,{size:14,family:"secondary",decoration:"underline",children:"Restart"})]})}]:[],children:[N===Ir.Overview?w?t(Pr,{children:t(Nr,{formData:A,handleFormChange:(...e)=>{T(!0),I(...e),I("currentStreamName",b)}})}):e(jr,{children:[t(Er,{workloadOdigosHealthStatus:L.workloadOdigosHealthStatus}),q&&t(ie,{type:ne.Warning,message:g.ROLLBACK_OCCURRED_MESSAGE,action:{label:g.ROLLBACK_RECOVER,onClick:async()=>{await m(x);const e=await d(x);e&&O(e)}}}),t(Y,{conditions:L.conditions||[]}),t(G,{title:g.SOURCE_DETAILS,data:L?Dr(L,y):[]}),t(G,{title:y?g.DETECTED_PROCESSES:g.DETECTED_CONTAINERS,titleBadge:K.isLoading?ue.Loading:K.containers.length,description:K.description||(y?g.DETECTED_PROCESSES_DESCRIPTION:g.DETECTED_CONTAINERS_DESCRIPTION),children:K.containers.map(e=>t(gi,{...e,callbackRuntimeOverride:e=>l(x,e)},`source-container-${e.containerName}`))}),L.manifestYAML&&t(ln,{title:`${L.kind} YAML`,yaml:L.manifestYAML,defaultOpen:!L.instrumentationConfigYAML}),L.instrumentationConfigYAML&&t(ln,{title:"Instrumentation Config YAML",yaml:L.instrumentationConfigYAML,defaultOpen:!L.manifestYAML})]}):N===Ir.Pods?t(Fr,{source:L,fetchSourceDescribe:u,onClickRestartPod:H?(e,t)=>_({openFor:Kr.Pod,podNamespace:e,podName:t}):void 0}):t(Ar,{source:L,fetchSourceLibraries:p}),t(Jt,{isOpen:!!V.openFor,title:`Rollout Restart ${V.openFor}`,description:`Are you sure you want to rollout restart this ${V.openFor?.toLowerCase()}?`,approveButton:{text:"Confirm",variant:ne.Warning,onClick:()=>{V.openFor===Kr.Workload&&V.workloadId?c([V.workloadId]):V.openFor===Kr.Pod&&V.podNamespace&&V.podName&&h(V.podNamespace,V.podName),_({openFor:null})}},denyButton:{text:"Go Back",onClick:()=>{_({openFor:null})}}})]}):null},zr=p.div`
507
+ `;var Yr;!function(e){e.Workload="Workload",e.Pod="Pod"}(Yr||(Yr={}));const Xr=({persistSources:o,updateSource:r,restartWorkloads:s,fetchSourceById:d,fetchSourceDescribe:u,fetchSourceLibraries:p,restartPod:h,recoverFromRollback:m})=>{const{isVm:y}=je(),{sources:v}=Y(),{selectedStreamName:f}=Ge(),{drawerType:b,drawerEntityId:x}=H(),$=c(()=>Xe(v,f),[v,f]),S=l(null),C=b===G.Source,[k,w]=n(!1),[T,D]=n(!1),[N,E]=n(Vr.Overview),[A,F]=n(null);a(()=>{C&&x&&d(x).then(e=>F(e||null))},[C,x]);const{formData:O,handleFormChange:I,resetFormData:R,loadFormWithDrawerItem:M}=ui(),K=c(()=>{if(x)return A&&JSON.stringify(Gt(A))===JSON.stringify(Gt(x))?A:$?.find(e=>JSON.stringify(Gt(e))===JSON.stringify(Gt(x)))},[x,$,A]);a(()=>{C&&K?M(K):R()},[C,K]);const L=c(()=>{const e=K?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===me.Loading,containers:K?.containers||[]}},[K]),P=c(()=>!!K?.rollbackOccurred,[K?.rollbackOccurred]),j=c(()=>{const e=[{label:Vr.Overview,onClick:()=>E(Vr.Overview),selected:N===Vr.Overview}];return y||(Wr.includes(K?.kind)&&e.push({label:Vr.Pods,onClick:()=>E(Vr.Pods),selected:N===Vr.Pods}),K?.containers?.some(({language:e})=>Ur.includes(e))&&e.push({label:Vr.Libraries,onClick:()=>E(Vr.Libraries),selected:N===Vr.Libraries})),e},[N,K,y]),z=_r.includes(K?.kind),[q,V]=n({openFor:null,workloadId:void 0,podNamespace:void 0,podName:void 0});return K?e(Fn,{ref:S,onClose:()=>{E(Vr.Overview),F(null)},title:K.otelServiceName||K.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:We(K),isEdit:k,isFormDirty:T,onEdit:N===Vr.Overview?e=>{w("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=O.otelServiceName!==K.name?O.otelServiceName:"";I("otelServiceName",e),await r(x,{...O,otelServiceName:e}),F(null),D(!1),w(!1)},onDelete:N===Vr.Overview?async()=>{const{namespace:e}=K;o({[e]:[{...K,selected:!1,currentStreamName:f}]},{}),F(null),D(!1),w(!1),S.current?.closeDrawer()}:void 0,onCancel:()=>{D(!1),w(!1),I("otelServiceName",K.otelServiceName||K.name||"")},isLastItem:1===$.length,tabs:j,headerActionButtons:y?[]:z?[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>V({openFor:Yr.Workload,workloadId:x}),children:e(i,{children:[t(qi,{}),t(B,{size:14,family:"secondary",decoration:"underline",children:"Restart"})]})}]:[],children:[N===Vr.Overview?k?t(Jr,{children:t(jr,{formData:O,handleFormChange:(...e)=>{D(!0),I(...e),I("currentStreamName",f)}})}):e(Gr,{children:[t(zr,{workloadOdigosHealthStatus:K.workloadOdigosHealthStatus}),P&&t(le,{type:se.Warning,message:g.ROLLBACK_OCCURRED_MESSAGE,action:{label:g.ROLLBACK_RECOVER,onClick:async()=>{await m(x);const e=await d(x);e&&F(e)}}}),t(ee,{conditions:K.conditions||[]}),t(te,{title:g.SOURCE_DETAILS,data:K?Lr(K,y):[]}),t(te,{title:y?g.DETECTED_PROCESSES:g.DETECTED_CONTAINERS,titleBadge:L.isLoading?me.Loading:L.containers.length,description:L.description||(y?g.DETECTED_PROCESSES_DESCRIPTION:g.DETECTED_CONTAINERS_DESCRIPTION),children:L.containers.map(e=>t(mi,{...e,callbackRuntimeOverride:e=>r(x,e)},`source-container-${e.containerName}`))}),K.manifestYAML&&t(rn,{title:`${K.kind} YAML`,yaml:K.manifestYAML,defaultOpen:!K.instrumentationConfigYAML}),K.instrumentationConfigYAML&&t(rn,{title:"Instrumentation Config YAML",yaml:K.instrumentationConfigYAML,defaultOpen:!K.manifestYAML})]}):N===Vr.Pods?t(qr,{source:K,fetchSourceDescribe:u,onClickRestartPod:z?(e,t)=>V({openFor:Yr.Pod,podNamespace:e,podName:t}):void 0}):t(Hr,{source:K,fetchSourceLibraries:p}),t(Ut,{isOpen:!!q.openFor,title:`Rollout Restart ${q.openFor}`,description:`Are you sure you want to rollout restart this ${q.openFor?.toLowerCase()}?`,approveButton:{text:"Confirm",variant:se.Warning,onClick:()=>{q.openFor===Yr.Workload&&q.workloadId?s([q.workloadId]):q.openFor===Yr.Pod&&q.podNamespace&&q.podName&&h(q.podNamespace,q.podName),V({openFor:null})}},denyButton:{text:"Go Back",onClick:()=>{V({openFor:null})}}})]}):null},Zr=p.div`
473
508
  max-width: ${({$fullWidth:e})=>e?"unset":"420px"};
474
509
  width: 100%;
475
- `,Hr=o(({isModal:i,fetchSingleNamespace:n,onClickSummary:a},o)=>{const r=m(),{isVm:s}=Le(),c=yi({fetchSingleNamespace:n}),{selectedSources:d,fetchingNamespace:u,selectedAllNamespaces:p,onSelectAllNamespaces:h,getApiSourcesPayload:y,getApiFutureAppsPayload:v,searchText:b,setSearchText:f,searchBy:x,setSearchBy:S,showSelectedOnly:$,setShowSelectedOnly:w,showRunningOnly:k,setShowRunningOnly:D}=c;l(o,()=>({getFormValues:()=>({apps:y(),futureApps:v()})}));const N=Object.values(d).reduce((e,t)=>e+t.filter(e=>e.selected).length,0);return t(te,{$isNotModal:!i,children:e(se,{$gap:12,children:[e(se,{$gap:24,children:[a&&t(vt,{onClick:a}),t(I,{title:g.SELECT_SOURCES,badgeLabel:N,description:g.SELECT_SOURCES_DESCRIPTION}),e(pe,{$justifyContent:"space-between",children:[t(zr,{$fullWidth:s,children:t(C,{placeholder:x===B.Source?g.SEARCH_SOURCES:g.SEARCH_NAMESPACES,icon:Li,value:b,onChange:e=>f(e.target.value.toLowerCase())})}),!s&&t(O,{options:[{label:g.SOURCE,value:B.Source,selectedBgColor:r.text.secondary,selectedTextColor:r.text.primary},{label:g.NAMESPACE,value:B.Namespace,selectedBgColor:r.text.secondary,selectedTextColor:r.text.primary}],selected:x,setSelected:S})]}),e(pe,{$gap:36,children:[t(T,{title:g.SELECT_ALL,initialValue:p,onChange:h,disabled:!!u}),t(T,{title:g.ONLY_SELECTED,initialValue:$,onChange:w}),t(T,{title:g.ONLY_RUNNING_INSTANCES,initialValue:k,onChange:D})]})]}),t(re,{}),t(fr,{isModal:i,...c})]})})});Hr.displayName=Hr.name;const Vr=({fetchSingleNamespace:e,persistSources:i})=>{const{currentModal:n,setCurrentModal:a}=Z(),o=n===B.Source,l=()=>{a("")},s=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();i(e,t),l()}},c=r(null);return K({key:"Enter",active:o},s),o?t(ee,{isOpen:o,onClose:l,header:{title:"Add Source"},actionComponent:t(le,{buttons:[{label:"DONE",variant:"primary",onClick:s}]}),children:t(Hr,{ref:c,isModal:!0,fetchSingleNamespace:e})}):null},Br=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},Wr=({metrics:i,maxHeight:n,maxWidth:a})=>{const o=m(),{isVm:r}=Le(),l=ye(),{selectedStreamName:c}=Je(),{sources:u,sourcesLoading:p}=W(),{setDrawerType:h,setDrawerEntityId:y}=j(),{selectedSources:v,setSelectedSources:b}=Re(),{progress:f}=Be(),x=s(()=>f[We.Instrumenting]||f[We.Uninstrumenting]?f[We.Instrumenting]?.percentage||f[We.Uninstrumenting]?.percentage||0:void 0,[f[We.Instrumenting],f[We.Uninstrumenting]]),$=s(()=>Ye(u,c),[u,c]),C=s(()=>qn({instrumentationRules:[],sources:Xe($,l),actions:[],destinations:[],searchText:l.searchText,selectedCategory:B.Source}).searchResults.find(({category:e})=>e===B.Source)?.entities||[],[$,l]),[w,k]=s(()=>{let e=0;return Object.values(v).forEach(t=>{e+=t.length}),[0!==e,e]},[v]),D=d(e=>{if(e){const e={};C.forEach(t=>{const{namespace:i}=t;e[i]?e[i].push(t):e[i]=[t]}),b(e)}else b({})},[C]),T=d(e=>{const{namespace:t,name:i,kind:n}=e,a={...v};a[t]||(a[t]=[]);const o=a[t].findIndex(e=>e.name===i&&e.kind===n);-1===o?a[t].push(e):a[t].splice(o,1),b(a)},[v]),N=s(()=>C.map(n=>{const a=Yt(n),r=JSON.stringify(a),{hasErrors:l,hasWarnings:s,hasDisableds:c}=ce(n.conditions||[]),d=!!v[a.namespace]?.find(e=>e.namespace===a.namespace&&e.name===a.name&&e.kind===a.kind);return{status:l?ne.Error:s?ne.Warning:void 0,faded:c,onClick:()=>{h(B.Source),y(a)},cells:[{columnKey:"checkbox-and-icon",component:()=>e(pe,{$gap:16,children:[t(S,{value:d,onChange:()=>T(n)}),t(vi,{icons:He(n.containers),id:r})]})},{columnKey:"name",value:fe(n,B.Source,{extended:!0})},{columnKey:"kind",value:n.kind,textColor:o.text.info},{columnKey:"namespace",value:n.namespace,textColor:o.text.info},{columnKey:"throughput",value:je(It(i,B.Source,a).throughput),textColor:o.text.info},{columnKey:"conditions",component:()=>t(jn,{conditions:n.conditions||[],id:r})},{columnKey:"containers",component:()=>t("div",{style:{lineHeight:1},children:t(de,{status:ne.Info,title:bi(n.containers),withBorder:!0})})}]}}),[C,v,i,T]),{badge:E,badgeTooltip:F}=s(()=>C.length!==$.length?{badge:`${C.length}/${$.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:$.length,badgeTooltip:void 0},[C,$]);return e(Se,{$maxWidth:a,children:[e($e,{children:[t(S,{partiallyChecked:w&&C?.length!==k,value:w&&C?.length===k,onChange:D,disabled:!C?.length}),t(Ce,{icon:we(B.Source),title:g.SOURCES,badge:E,badgeTooltip:F,loading:p||"number"==typeof x})]}),t(ke,{$maxHeight:n,children:t(De,{columns:Br(r),rows:N})}),"number"!=typeof x||N.length?N.length?null:t(Te,{style:{marginTop:"2rem"},children:t(Ne,{})}):e(Te,{style:{marginTop:"2rem",gap:"24px"},children:[t(Ee,{width:420}),e(pe,{$gap:16,children:[e(P,{color:o.text.info,children:[f[We.Instrumenting]?"Instrumenting":"Uninstrumenting"," workloads..."]}),t(Fe,{label:`${x}%`})]})]})]})},_r=({expiresAt:t})=>{const i=m(),{formatTimeAgo:n}=Gt(),a=n(t),o=new Date(t).toDateString().split(" ").slice(1).join(" "),r=fi(t,0)?i.text.error:fi(t,6048e5)?i.text.warning:i.text.success;return e(P,{size:14,color:r,children:[a," (",o,")"]})},Jr=p.div`
510
+ `,Qr=r(({isModal:i,fetchNamespacesWithWorkloads:n,onClickSummary:a},o)=>{const r=m(),{isVm:l}=je(),c=gi({fetchNamespacesWithWorkloads:n}),{selectedSources:d,loading:u,selectedAllNamespaces:p,onSelectAllNamespaces:h,getApiSourcesPayload:y,getApiFutureAppsPayload:v,searchText:f,setSearchText:b,searchBy:x,setSearchBy:$,showSelectedOnly:S,setShowSelectedOnly:k,showRunningOnly:w,setShowRunningOnly:T}=c;s(o,()=>({getFormValues:()=>({apps:y(),futureApps:v()})}));const N=Object.values(d).reduce((e,t)=>e+t.filter(e=>e.selected).length,0);return t(re,{$isNotModal:!i,children:e(F,{$gap:12,children:[e(F,{$gap:24,children:[a&&t(vt,{onClick:a}),t(P,{title:g.SELECT_SOURCES,badgeLabel:N,description:g.SELECT_SOURCES_DESCRIPTION}),e(O,{$justifyContent:"space-between",children:[t(Zr,{$fullWidth:l,children:t(C,{placeholder:x===G.Source?g.SEARCH_SOURCES:g.SEARCH_NAMESPACES,icon:Mi,value:f,onChange:e=>b(e.target.value.toLowerCase())})}),!l&&t(K,{options:[{label:g.SOURCE,value:G.Source,selectedBgColor:r.text.secondary,selectedTextColor:r.text.primary},{label:g.NAMESPACE,value:G.Namespace,selectedBgColor:r.text.secondary,selectedTextColor:r.text.primary}],selected:x,setSelected:$})]}),e(O,{$gap:36,children:[t(D,{title:g.SELECT_ALL,initialValue:p,onChange:h,disabled:u}),t(D,{title:g.ONLY_SELECTED,initialValue:S,onChange:k}),t(D,{title:g.ONLY_RUNNING_INSTANCES,initialValue:w,onChange:T})]})]}),t(A,{}),t(Ar,{isModal:i,...c})]})})});Qr.displayName=Qr.name;const el=({fetchNamespacesWithWorkloads:e,persistSources:i})=>{const{currentModal:n,setCurrentModal:a}=ae(),o=n===G.Source,r=()=>{a("")},s=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();i(e,t),r()}},c=l(null);return V({key:"Enter",active:o},s),o?t(oe,{isOpen:o,onClose:r,header:{title:"Add Source"},actionComponent:t(ue,{buttons:[{label:"DONE",variant:"primary",onClick:s}]}),children:t(Qr,{ref:c,isModal:!0,fetchNamespacesWithWorkloads:e})}):null},tl=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},il=({metrics:i,maxHeight:n,maxWidth:a})=>{const o=m(),{isVm:r}=je(),l=fe(),{selectedStreamName:s}=Ge(),{sources:u,sourcesLoading:p}=Y(),{setDrawerType:h,setDrawerEntityId:y}=H(),{selectedSources:v,setSelectedSources:f}=Ke(),{progress:b}=_e(),x=c(()=>b[Ue.Instrumenting]||b[Ue.Uninstrumenting]?b[Ue.Instrumenting]?.percentage||b[Ue.Uninstrumenting]?.percentage||0:void 0,[b[Ue.Instrumenting],b[Ue.Uninstrumenting]]),S=c(()=>Xe(u,s),[u,s]),C=c(()=>qn({instrumentationRules:[],sources:Qe(S,l),actions:[],destinations:[],searchText:l.searchText,selectedCategory:G.Source}).searchResults.find(({category:e})=>e===G.Source)?.entities||[],[S,l]),[k,w]=c(()=>{let e=0;return Object.values(v).forEach(t=>{e+=t.length}),[0!==e,e]},[v]),T=d(e=>{if(e){const e={};C.forEach(t=>{const{namespace:i}=t;e[i]?e[i].push(t):e[i]=[t]}),f(e)}else f({})},[C]),D=d(e=>{const{namespace:t,name:i,kind:n}=e,a={...v};a[t]||(a[t]=[]);const o=a[t].findIndex(e=>e.name===i&&e.kind===n);-1===o?a[t].push(e):a[t].splice(o,1),f(a)},[v]),N=c(()=>C.map(n=>{const a=Gt(n),r=JSON.stringify(a),{hasErrors:l,hasWarnings:s,hasDisableds:c}=pe(n.conditions||[]),d=!!v[a.namespace]?.find(e=>e.namespace===a.namespace&&e.name===a.name&&e.kind===a.kind);return{status:l?se.Error:s?se.Warning:void 0,faded:c,onClick:()=>{h(G.Source),y(a)},cells:[{columnKey:"checkbox-and-icon",component:()=>e(O,{$gap:16,children:[t($,{value:d,onChange:()=>D(n)}),t(yi,{icons:We(n),id:r})]})},{columnKey:"name",value:$e(n,G.Source,{extended:!0})},{columnKey:"kind",value:n.kind,textColor:o.text.info},{columnKey:"namespace",value:n.namespace,textColor:o.text.info},{columnKey:"throughput",value:Be(It(i,G.Source,a).throughput),textColor:o.text.info},{columnKey:"conditions",component:()=>t(jn,{conditions:n.conditions||[],id:r})},{columnKey:"containers",component:()=>t("div",{style:{lineHeight:1},children:t(he,{status:se.Info,title:vi(n.containers),withBorder:!0})})}]}}),[C,v,i,D]),{badge:E,badgeTooltip:A}=c(()=>C.length!==S.length?{badge:`${C.length}/${S.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:S.length,badgeTooltip:void 0},[C,S]);return e(Ce,{$maxWidth:a,children:[e(ke,{children:[t($,{partiallyChecked:k&&C?.length!==w,value:k&&C?.length===w,onChange:T,disabled:!C?.length}),t(we,{icon:Te(G.Source),title:g.SOURCES,badge:E,badgeTooltip:A,loading:p||"number"==typeof x})]}),t(De,{$maxHeight:n,children:t(Ne,{columns:tl(r),rows:N})}),"number"!=typeof x||N.length?N.length?null:t(Ee,{style:{marginTop:"2rem"},children:t(Ae,{})}):e(Ee,{style:{marginTop:"2rem",gap:"24px"},children:[t(Fe,{width:420}),e(O,{$gap:16,children:[e(B,{color:o.text.info,children:[b[Ue.Instrumenting]?"Instrumenting":"Uninstrumenting"," workloads..."]}),t(Oe,{label:`${x}%`})]})]})]})},nl=({expiresAt:t})=>{const i=m(),{formatTimeAgo:n}=Yt(),a=n(t),o=new Date(t).toDateString().split(" ").slice(1).join(" "),r=fi(t,0)?i.text.error:fi(t,6048e5)?i.text.warning:i.text.success;return e(B,{size:14,color:r,children:[a," (",o,")"]})},al=p.div`
476
511
  position: relative;
477
- `,Ur=({token:i,saveToken:a})=>{const{CopyButton:o}=xi(),{formData:r,handleFormChange:l,resetFormData:s}=Si({token:i}),[c,d]=n(!1),u=()=>{d(!1),s()};return e(pe,{$gap:0,children:[t(o,{value:i,size:$i.L}),t(re,{orientation:"vertical",length:"12px"}),e(Jr,{children:[t(mt,{size:32,onClick:()=>{d(!0)},children:t(Oi,{})}),c&&t(Ci,{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(C,{placeholder:"API Token",type:"password",value:r.token,onChange:e=>l("token",e.target.value)})})]})]})},Yr=({tokens:e,saveToken:i})=>t(G,{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:n,expiresAt:a})=>({cells:[{columnKey:"icon",icon:Qi},{columnKey:"name",value:e},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>t(_r,{expiresAt:a})},{columnKey:"actions",component:()=>t(Ur,{token:n,saveToken:i})}]}))}}]}),Gr=({fetchDescribeOdigos:o})=>{const[r,l]=n(null);if(a(()=>{o().then(({data:e})=>l(e?.describeOdigos||null))},[]),!r)return t(Te,{children:t(Ae,{})});const s=e=>e?.name?[t(re,{},`divider-${e.name}`),t(ri,{title:e.name,subTitle:e.explain||void 0,value:{status:e.status||(di(e.value)?ui(e.value)?ne.Success:ne.Error:ne.Default),text:e.value}},`describe-row-${e.name}`)]:[];return e(i,{children:[t(G,{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(G,{title:"Cluster Collector",withExtend:!0,children:Object.values(r?.clusterCollector||{}).map(s)}),t(G,{title:"Node Collector",withExtend:!0,children:Object.values(r?.nodeCollector||{}).map(s)})]})},Xr=p.div`
512
+ `,ol=({token:i,saveToken:a})=>{const{CopyButton:o}=bi(),{formData:r,handleFormChange:l,resetFormData:s}=xi({token:i}),[c,d]=n(!1),u=()=>{d(!1),s()};return e(O,{$gap:0,children:[t(o,{value:i,size:$i.L}),t(A,{orientation:"vertical",length:"12px"}),e(al,{children:[t(I,{size:32,onClick:()=>{d(!0)},children:t(Fi,{})}),c&&t(Si,{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(C,{placeholder:"API Token",type:"password",value:r.token,onChange:e=>l("token",e.target.value)})})]})]})},rl=({tokens:e,saveToken:i})=>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:n,expiresAt:a})=>({cells:[{columnKey:"icon",icon:Xi},{columnKey:"name",value:e},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>t(nl,{expiresAt:a})},{columnKey:"actions",component:()=>t(ol,{token:n,saveToken:i})}]}))}}]}),ll=({fetchDescribeOdigos:o})=>{const[r,l]=n(null);if(a(()=>{o().then(({data:e})=>l(e?.describeOdigos||null))},[]),!r)return t(Ee,{children:t(Re,{})});const s=e=>e?.name?[t(A,{},`divider-${e.name}`),t(oi,{title:e.name,subTitle:e.explain||void 0,value:{status:e.status||(ci(e.value)?di(e.value)?se.Success:se.Error:se.Default),text:e.value}},`describe-row-${e.name}`)]:[];return e(i,{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(s)}),t(te,{title:"Node Collector",withExtend:!0,children:Object.values(r?.nodeCollector||{}).map(s)})]})},sl=p.div`
478
513
  display: flex;
479
514
  flex-direction: column;
480
515
  gap: 12px;
481
- `,Qr="System Overview",Zr=({tokens:a,saveToken:o,fetchDescribeOdigos:r})=>{const[l,s]=n(!1),c=()=>s(e=>!e);return e(i,{children:[t(mt,{onClick:c,tooltip:Qr,children:t(Zi,{size:18})},Qr),t(z,{width:"750px",isOpen:l,onClose:c,header:{icons:[Zi],title:Qr},footer:{isOpen:!1},children:e(Xr,{children:[!!a?.length&&t(Yr,{tokens:a,saveToken:o}),t(Gr,{fetchDescribeOdigos:r})]})})]})},el=p.div`
516
+ `,cl="System Overview",dl=({tokens:a,saveToken:o,fetchDescribeOdigos:r})=>{const[l,s]=n(!1),c=()=>s(e=>!e);return e(i,{children:[t(I,{onClick:c,tooltip:cl,children:t(Zi,{size:18})},cl),t(_,{width:"750px",isOpen:l,onClose:c,header:{icons:[Zi],title:cl},footer:{isOpen:!1},children:e(sl,{children:[!!a?.length&&t(rl,{tokens:a,saveToken:o}),t(ll,{fetchDescribeOdigos:r})]})})]})},ul=p.div`
482
517
  position: fixed;
483
518
  bottom: 12px;
484
519
  left: 12px;
@@ -487,7 +522,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
487
522
  flex-direction: column-reverse;
488
523
  gap: 6px;
489
524
  max-width: 600px;
490
- `,tl=()=>{const{notifications:e,markAsDismissed:i,markAsSeen:n}=Vt(),{onClickNotification:a}=Xt();return t(el,{children:e.filter(({dismissed:e})=>!e).map(({id:e,type:o,title:r,message:l,crdType:s,target:c})=>t(ie,{id:e,type:o,title:r,message:l,action:s&&c?{label:"go to details",onClick:()=>a({id:e,crdType:s,target:c},{dismissToast:!0})}:void 0,onClose:()=>(({id:e,asSeen:t})=>{i(e),n(e)})({id:e,asSeen:!0})},`toast-${e}`))})},il=p.div`
525
+ `,pl=()=>{const{notifications:e,markAsDismissed:i,markAsSeen:n}=Ht(),{onClickNotification:a}=Xt();return t(ul,{children:e.filter(({dismissed:e})=>!e).map(({id:e,type:o,title:r,message:l,crdType:s,target:c})=>t(le,{id:e,type:o,title:r,message:l,action:s&&c?{label:"go to details",onClick:()=>a({id:e,crdType:s,target:c},{dismissToast:!0})}:void 0,onClose:()=>(({id:e,asSeen:t})=>{i(e),n(e)})({id:e,asSeen:!0})},`toast-${e}`))})},hl=p.div`
491
526
  position: relative;
492
527
  display: flex;
493
528
  align-items: center;
@@ -506,7 +541,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
506
541
  stroke: ${({theme:e})=>e.text.secondary};
507
542
  }
508
543
  }
509
- `,nl=p.div`
544
+ `,ml=p.div`
510
545
  position: absolute;
511
546
  top: 2px;
512
547
  left: ${({$darkMode:e})=>e?"2px":"calc(100% - 2px - 24px)"};
@@ -516,50 +551,50 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
516
551
  background-color: ${({theme:e})=>e.colors.border};
517
552
  border-radius: 100%;
518
553
  transition: all 0.3s;
519
- `,al=({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})}),ol=()=>{const{darkMode:i,setDarkMode:n}=wi();return e(il,{onClick:()=>n(!i),children:[t(al,{path:"M14 7.977A4.333 4.333 0 1 1 8.023 2H8a6 6 0 1 0 6 6v-.023Z"}),t(al,{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(nl,{$darkMode:i})]})},rl=e=>{const{spans:t}=e,i=new Map;t.forEach(e=>{i.set(e.spanID,{...e,spans:[]})});const n=[];return t.forEach(e=>{const t=i.get(e.spanID);let a=!1;if(e.references.length){const t=e.references.find(e=>"CHILD_OF"===e.refType);t&&t.spanID&&i.has(t.spanID)||(a=!0)}else a=!0;if(a)n.push(t);else{const n=e.references.find(e=>"CHILD_OF"===e.refType);if(n){const e=i.get(n.spanID);e&&(e.spans=e.spans||[],e.spans.push(t),e.spans=e.spans.sort((e,t)=>e.startTime-t.startTime))}}}),n.sort((e,t)=>e.startTime-t.startTime)},ll=(e,t)=>{const{tags:i}=e,n={},a=[];return i.forEach(e=>{n[e.key]=e.value}),a.push({type:y.Code,value:{language:"json",code:JSON.stringify(n,null,2),pretty:t}}),a},sl=e=>{const{logs:t}=e,i=[];return t.forEach((e,n)=>{e.fields.forEach(e=>{i.push({title:e.key,value:e.value})}),n!==t.length-1&&i.push({type:y.Divider})}),i},cl=e=>{const{traceID:t,spanID:i,processID:n,operationName:a,duration:o,startTime:r,warnings:l}=e,s=[];return s.push({type:y.CopyText,title:"Trace ID",value:t}),s.push({type:y.CopyText,title:"Span ID",value:i}),s.push({type:y.Divider}),s.push({title:"Service",value:n}),s.push({title:"Operation",value:a}),s.push({title:"Duration",value:ki(o)}),s.push({title:"Start time",value:new Date(r/1e3).toLocaleString()}),l.length&&(s.push({type:y.Divider}),s.push({title:"Warnings",titleIcon:en,value:l})),s},dl=(e,t)=>{const{tags:i}=e,n={},a=[];return i.forEach(e=>{n[e.key]=e.value}),a.push({type:y.Code,value:{language:"json",code:JSON.stringify(n,null,2),pretty:t}}),a},ul=p.div`
554
+ `,gl=({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})}),yl=()=>{const{darkMode:i,setDarkMode:n}=Ci();return e(hl,{onClick:()=>n(!i),children:[t(gl,{path:"M14 7.977A4.333 4.333 0 1 1 8.023 2H8a6 6 0 1 0 6 6v-.023Z"}),t(gl,{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(ml,{$darkMode:i})]})},vl=e=>{const{spans:t}=e,i=new Map;t.forEach(e=>{i.set(e.spanID,{...e,spans:[]})});const n=[];return t.forEach(e=>{const t=i.get(e.spanID);let a=!1;if(e.references.length){const t=e.references.find(e=>"CHILD_OF"===e.refType);t&&t.spanID&&i.has(t.spanID)||(a=!0)}else a=!0;if(a)n.push(t);else{const n=e.references.find(e=>"CHILD_OF"===e.refType);if(n){const e=i.get(n.spanID);e&&(e.spans=e.spans||[],e.spans.push(t),e.spans=e.spans.sort((e,t)=>e.startTime-t.startTime))}}}),n.sort((e,t)=>e.startTime-t.startTime)},fl=(e,t)=>{const{tags:i}=e,n={},a=[];return i.forEach(e=>{n[e.key]=e.value}),a.push({type:y.Code,value:{language:"json",code:JSON.stringify(n,null,2),pretty:t}}),a},bl=e=>{const{logs:t}=e,i=[];return t.forEach((e,n)=>{e.fields.forEach(e=>{i.push({title:e.key,value:e.value})}),n!==t.length-1&&i.push({type:y.Divider})}),i},xl=e=>{const{traceID:t,spanID:i,processID:n,operationName:a,duration:o,startTime:r,warnings:l}=e,s=[];return s.push({type:y.CopyText,title:"Trace ID",value:t}),s.push({type:y.CopyText,title:"Span ID",value:i}),s.push({type:y.Divider}),s.push({title:"Service",value:n}),s.push({title:"Operation",value:a}),s.push({title:"Duration",value:ki(o)}),s.push({title:"Start time",value:new Date(r/1e3).toLocaleString()}),l.length&&(s.push({type:y.Divider}),s.push({title:"Warnings",titleIcon:Qi,value:l})),s},$l=(e,t)=>{const{tags:i}=e,n={},a=[];return i.forEach(e=>{n[e.key]=e.value}),a.push({type:y.Code,value:{language:"json",code:JSON.stringify(n,null,2),pretty:t}}),a},Sl=p.div`
520
555
  display: flex;
521
556
  flex-direction: column;
522
557
  gap: 12px;
523
558
  max-height: 100vh;
524
559
  overflow-y: auto;
525
- `,pl=({span:i,process:a,onClose:o})=>{const[r,l]=n(!0),[s,c]=n(!0);return t(z,{width:"750px",isOpen:!0,onClose:o,header:{icons:[tn],title:i.operationName},footer:{isOpen:!1},children:e(ul,{children:[t(G,{title:"Details",data:cl(i)}),i.logs.length>0&&t(G,{title:"Errors",titleBadge:i.logs.length,titleIcon:en,data:sl(i)}),t(G,{title:"Tags",data:ll(i,r),action:t(Di,{isPrettyMode:r,setIsPrettyMode:l})}),a&&t(G,{title:`Process (${a.serviceName})`,data:dl(a,s),action:t(Di,{isPrettyMode:s,setIsPrettyMode:c})})]})})},hl=370,ml=["#33DCA7","#50F6E8","#444AD9","#8B55FF","#FF7CA9"].reverse(),gl=p.div`
560
+ `,Cl=({span:i,process:a,onClose:o})=>{const[r,l]=n(!0),[s,c]=n(!0);return t(_,{width:"750px",isOpen:!0,onClose:o,header:{icons:[en],title:i.operationName},footer:{isOpen:!1},children:e(Sl,{children:[t(te,{title:"Details",data:xl(i)}),i.logs.length>0&&t(te,{title:"Errors",titleBadge:i.logs.length,titleIcon:Qi,data:bl(i)}),t(te,{title:"Tags",data:fl(i,r),action:t(wi,{isPrettyMode:r,setIsPrettyMode:l})}),a&&t(te,{title:`Process (${a.serviceName})`,data:$l(a,s),action:t(wi,{isPrettyMode:s,setIsPrettyMode:c})})]})})},kl=370,wl=["#33DCA7","#50F6E8","#444AD9","#8B55FF","#FF7CA9"].reverse(),Tl=p.div`
526
561
  display: flex;
527
562
  align-items: center;
528
- width: ${hl}px;
529
- background-color: ${({$withErrors:e,theme:t})=>e?t.colors.error+A["042"]:t.colors.dark_grey};
563
+ width: ${kl}px;
564
+ background-color: ${({$withErrors:e,theme:t})=>e?t.colors.error+L["042"]:t.colors.dark_grey};
530
565
  &:hover {
531
- ${({$withErrors:e,$preventHover:t,theme:i})=>!t&&`background-color: ${e?i.colors.error:i.colors.secondary+A["010"]};`}
566
+ ${({$withErrors:e,$preventHover:t,theme:i})=>!t&&`background-color: ${e?i.colors.error:i.colors.secondary+L["010"]};`}
532
567
  cursor: ${({$preventHover:e})=>e?"default":"pointer"};
533
568
  }
534
- `,yl=p(pe)`
569
+ `,Dl=p(O)`
535
570
  align-items: center;
536
571
  justify-content: space-between;
537
572
  gap: 4px;
538
573
  padding: 12px;
539
574
  padding-left: ${({$depth:e})=>12*e||12}px;
540
- width: calc(${hl}px - ${({$depth:e})=>12*e}px);
541
- `,vl=p(pe)`
575
+ width: calc(${kl}px - ${({$depth:e})=>12*e}px);
576
+ `,Nl=p(O)`
542
577
  align-items: center;
543
578
  gap: 4px;
544
579
  position: absolute;
545
580
  right: 56px;
546
581
  width: calc(100% - ${434}px);
547
- `,bl=p.div`
582
+ `,El=p.div`
548
583
  position: absolute;
549
584
  left: ${({$startTime:e,$minStartTime:t,$maxEndTime:i})=>(e-t)/(i-t)*100+"%"};
550
585
  width: ${({$duration:e,$maxDuration:t})=>e/t*100+"%"};
551
586
  height: 12px;
552
587
  border-radius: 32px;
553
- background-color: ${({$indexInMatrix:e})=>ml[e%ml.length]};
554
- `,fl=p(P)`
588
+ background-color: ${({$indexInMatrix:e})=>wl[e%wl.length]};
589
+ `,Al=p(B)`
555
590
  padding-left: calc(100% + 8px);
556
591
  font-size: 10px;
557
592
  color: ${({theme:e})=>e.text.darker_grey};
558
593
  font-family: ${({theme:e})=>e.font_family.secondary};
559
594
  white-space: nowrap;
560
- `,xl=({span:i,depth:a,indexInMatrix:o,maxDuration:r,minStartTime:l,maxEndTime:s,withErrors:c,errorTooltip:d,isOpen:u,withToggle:p,onToggleOpen:h,onSelect:g})=>{const y=m(),[v,b]=n(!1),f=hl-12*a-20-(c?12:0),x=c&&(1===a||i.logs.length>0);return e(gl,{className:"span-container",$withErrors:c,$preventHover:v,onClick:g,children:[e(yl,{$depth:a,className:"span-left",children:[e(pe,{$gap:4,$alignItems:"center",children:[t("div",p?{onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),children:t(mt,{onClick:e=>{e.stopPropagation(),h?.()},size:24,children:t(gt,{extend:u??!1})})}:{style:{width:"24px"}}),t(Ni,{maxWidth:f/2,text:i.processID,textSize:14}),t(P,{size:12,color:y.text.darker_grey,children:"•"}),t(Ni,{maxWidth:f/2,text:i.operationName,textSize:12,textColor:y.text.darker_grey})]}),c&&(x?t(me,{...d,children:t(en,{fill:y.text.error})}):t("div",{style:{position:"relative"},children:t("div",{style:{position:"absolute",top:"-24px",right:"8px"},children:t(re,{type:ne.Error,orientation:"vertical",thickness:1,length:"48px",margin:"0",opacity:.5})})}))]}),t(vl,{className:"span-right",children:t(bl,{$indexInMatrix:o,$duration:i.duration,$maxDuration:r,$startTime:i.startTime,$minStartTime:l,$maxEndTime:s,children:t(fl,{children:ki(i.duration)})})})]})},Sl=({spans:i,logs:n,depth:a,indexInMatrix:o,maxDuration:r,minStartTime:l,maxEndTime:s,openSpanIdsState:c,selectedSpanState:d})=>{const u=m();return i.map((i,p)=>{const h=i.spanID,m=c.value.includes(h),g=!!i.spans?.length,y=n.length?n:Ti(i,"spans","logs"),v=y.length>0,b=v?y.length>1?`(${y.length}) errors`:y[0].fields.find(e=>"exception.message"===e.key)?.value:void 0,f=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(xl,{span:i,depth:a,indexInMatrix:o+p+a,maxDuration:r,minStartTime:l,maxEndTime:s,withErrors:v,errorTooltip:{titleIcon:en,title:b,text:f},isOpen:m,withToggle:g,onToggleOpen:()=>c.set(e=>e.some(e=>e===h)?e.filter(e=>e!=h):[...e,h,...Ti(i,"spans","spanID")]),onSelect:()=>d.set(e=>e?.spanID===h?null:i)}),m&&g?t(Sl,{spans:i.spans||[],logs:y,depth:a+1,indexInMatrix:o+p,maxDuration:r,minStartTime:l,maxEndTime:s,openSpanIdsState:c,selectedSpanState:d}):null]},`span-${h}`)})},$l=p.div`
595
+ `,Fl=({span:i,depth:a,indexInMatrix:o,maxDuration:r,minStartTime:l,maxEndTime:s,withErrors:c,errorTooltip:d,isOpen:u,withToggle:p,onToggleOpen:h,onSelect:g})=>{const y=m(),[v,f]=n(!1),b=kl-12*a-20-(c?12:0),x=c&&(1===a||i.logs.length>0);return e(Tl,{className:"span-container",$withErrors:c,$preventHover:v,onClick:g,children:[e(Dl,{$depth:a,className:"span-left",children:[e(O,{$gap:4,$alignItems:"center",children:[t("div",p?{onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),children:t(I,{onClick:e=>{e.stopPropagation(),h?.()},size:24,children:t(yt,{extend:u??!1})})}:{style:{width:"24px"}}),t(Di,{maxWidth:b/2,text:i.processID,textSize:14}),t(B,{size:12,color:y.text.darker_grey,children:"•"}),t(Di,{maxWidth:b/2,text:i.operationName,textSize:12,textColor:y.text.darker_grey})]}),c&&(x?t(ye,{...d,children:t(Qi,{fill:y.text.error})}):t("div",{style:{position:"relative"},children:t("div",{style:{position:"absolute",top:"-24px",right:"8px"},children:t(A,{type:se.Error,orientation:"vertical",thickness:1,length:"48px",margin:"0",opacity:.5})})}))]}),t(Nl,{className:"span-right",children:t(El,{$indexInMatrix:o,$duration:i.duration,$maxDuration:r,$startTime:i.startTime,$minStartTime:l,$maxEndTime:s,children:t(Al,{children:ki(i.duration)})})})]})},Ol=({spans:i,logs:n,depth:a,indexInMatrix:o,maxDuration:r,minStartTime:l,maxEndTime:s,openSpanIdsState:c,selectedSpanState:d})=>{const u=m();return i.map((i,p)=>{const h=i.spanID,m=c.value.includes(h),g=!!i.spans?.length,y=n.length?n:Ti(i,"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(Fl,{span:i,depth:a,indexInMatrix:o+p+a,maxDuration:r,minStartTime:l,maxEndTime:s,withErrors:v,errorTooltip:{titleIcon:Qi,title:f,text:b},isOpen:m,withToggle:g,onToggleOpen:()=>c.set(e=>e.some(e=>e===h)?e.filter(e=>e!=h):[...e,h,...Ti(i,"spans","spanID")]),onSelect:()=>d.set(e=>e?.spanID===h?null:i)}),m&&g?t(Ol,{spans:i.spans||[],logs:y,depth:a+1,indexInMatrix:o+p,maxDuration:r,minStartTime:l,maxEndTime:s,openSpanIdsState:c,selectedSpanState:d}):null]},`span-${h}`)})},Il=p.div`
561
596
  width: 100%;
562
- `,Cl=p.div`
597
+ `,Rl=p.div`
563
598
  max-height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
564
599
  overflow: auto;
565
600
 
@@ -569,22 +604,22 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
569
604
  border-radius: 24px;
570
605
  border: 1px solid ${({theme:e})=>e.colors.dropdown_bg_2};
571
606
  position: relative;
572
- `,wl=p.div`
607
+ `,Ml=p.div`
573
608
  padding: 12px 12px 12px 24px;
574
- width: calc(${hl}px - 36px);
609
+ width: calc(${kl}px - 36px);
575
610
  background-color: ${({theme:e})=>e.colors.dark_grey};
576
- `,kl=p.div`
611
+ `,Kl=p.div`
577
612
  width: 1px;
578
613
  height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
579
614
  background: ${({theme:e})=>`linear-gradient(to bottom, ${e.colors.border}, transparent)`};
580
615
 
581
616
  position: absolute;
582
- left: calc(${hl}px + ((100% - ${hl}px) / ${5}) * ${({index:e})=>e});
583
- `,Dl=p(P)`
617
+ left: calc(${kl}px + ((100% - ${kl}px) / ${5}) * ${({index:e})=>e});
618
+ `,Ll=p(B)`
584
619
  color: ${({theme:e})=>e.text.darker_grey};
585
620
  font-size: 12px;
586
621
  font-family: ${({theme:e})=>e.font_family.secondary};
587
622
  padding-top: 12px;
588
623
  padding-left: 12px;
589
624
  white-space: nowrap;
590
- `,Tl=({heightToRemove:a,traces:o,isLoading:r})=>{const[l,c]=n([]),[d,u]=n(null),p=s(()=>Et(o).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:rl(e)})),[o]),h=s(()=>p.reduce((e,t)=>Math.max(e,t.spans.reduce((e,t)=>e+t.duration,0)),0),[p]),m=s(()=>{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(i,{children:[t($l,{$heightToRemove:a,children:r?t(Te,{$height:"50vh",children:t(Ae,{scale:1.5})}):p.length?e(Cl,{$heightToRemove:a,children:[t(wl,{children:t(P,{children:"Service & operation"})}),new Array(5).fill(null).map((e,i)=>t(kl,{$heightToRemove:a,index:i,children:t(Dl,{children:ki(h/5*i)})},`${i}-divider`)),p.map((e,i)=>{const{spans:n}=e,a=n.reduce((e,t)=>Math.min(e,t.startTime),Number.MAX_SAFE_INTEGER),o=n.reduce((e,t)=>Math.max(e,t.startTime+t.duration),0);return t(Sl,{spans:n,logs:[],depth:1,indexInMatrix:i,maxDuration:h,minStartTime:a,maxEndTime:o,openSpanIdsState:{value:l,set:c},selectedSpanState:{value:d,set:u}},`recursive-spans-${e.traceID}`)})]}):t(Te,{$height:"50vh",children:t(Ne,{title:g.NO_TRACES_FOUND,subTitle:g.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC})})}),d&&t(pl,{span:d,process:m,onClose:()=>u(null)})]})};export{Rn as ActionDrawer,En as ActionForm,Ln as ActionModal,Hn as ActionTable,Jn as AwaitPipeline,ma as ConditionDropdown,ca as DataFlow,qa as DataFlowActionsMenu,Fa as DataStreamDrawer,Na as DataStreamForm,Ha as DataStreamModal,za as DataStreamSelectionForm,eo as DestinationDrawer,Xa as DestinationForm,yo as DestinationModal,So as DestinationSelectionForm,Co as DestinationTable,ga as ErrorDropdown,Ko as InstrumentationRuleDrawer,Lo as InstrumentationRuleForm,Ho as InstrumentationRuleModal,Wo as InstrumentationRuleTable,fa as KindDropdown,ya as LanguageDropdown,va as MonitorDropdown,Jo as MultiSourceControl,ba as NamespaceDropdown,Cr as NavIconIds,Zo as NotificationManager,Fn as OverviewDrawer,xa as PodsAgentInjectionStatusDropdown,dr as ServiceMap,$r as SetupSummary,wr as SideNav,kr as SlackInvite,qr as SourceDrawer,Nr as SourceForm,Vr as SourceModal,Hr as SourceSelectionForm,Wr as SourceTable,Zr as SystemOverview,jn as TableCellConditions,tl as ToastList,ol as ToggleDarkMode,Tl as TraceView};
625
+ `,Pl=({heightToRemove:a,traces:o,isLoading:r})=>{const[l,s]=n([]),[d,u]=n(null),p=c(()=>Et(o).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:vl(e)})),[o]),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(i,{children:[t(Il,{$heightToRemove:a,children:r?t(Ee,{$height:"50vh",children:t(Re,{scale:1.5})}):p.length?e(Rl,{$heightToRemove:a,children:[t(Ml,{children:t(B,{children:"Service & operation"})}),new Array(5).fill(null).map((e,i)=>t(Kl,{$heightToRemove:a,index:i,children:t(Ll,{children:ki(h/5*i)})},`${i}-divider`)),p.map((e,i)=>{const{spans:n}=e,a=n.reduce((e,t)=>Math.min(e,t.startTime),Number.MAX_SAFE_INTEGER),o=n.reduce((e,t)=>Math.max(e,t.startTime+t.duration),0);return t(Ol,{spans:n,logs:[],depth:1,indexInMatrix:i,maxDuration:h,minStartTime:a,maxEndTime:o,openSpanIdsState:{value:l,set:s},selectedSpanState:{value:d,set:u}},`recursive-spans-${e.traceID}`)})]}):t(Ee,{$height:"50vh",children:t(Ae,{title:g.NO_TRACES_FOUND,subTitle:g.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC})})}),d&&t(Cl,{span:d,process:m,onClose:()=>u(null)})]})};export{Mn as ActionDrawer,An as ActionForm,Ln as ActionModal,Hn as ActionTable,Jn as AwaitPipeline,wa as ConditionDropdown,xa as DataFlow,Xa as DataFlowActionsMenu,qa as DataStreamDrawer,ja as DataStreamForm,Qa as DataStreamModal,Za as DataStreamSelectionForm,po as DestinationDrawer,so as DestinationForm,Do as DestinationModal,Oo as DestinationSelectionForm,Ro as DestinationTable,Ta as ErrorDropdown,Yo as InstrumentationRuleDrawer,Uo as InstrumentationRuleForm,Qo as InstrumentationRuleModal,ir as InstrumentationRuleTable,Aa as KindDropdown,Da as LanguageDropdown,Na as MonitorDropdown,ar as MultiSourceControl,Ea as NamespaceDropdown,Rr as NavIconIds,dr as NotificationManager,Fn as OverviewDrawer,Fa as PodsAgentInjectionStatusDropdown,$r as ServiceMap,Ir as SetupSummary,Mr as SideNav,Kr as SlackInvite,Xr as SourceDrawer,jr as SourceForm,el as SourceModal,Qr as SourceSelectionForm,il as SourceTable,dl as SystemOverview,jn as TableCellConditions,pl as ToastList,yl as ToggleDarkMode,Pl as TraceView};