@odigos/ui-kit 0.0.183 → 0.0.185

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 (77) hide show
  1. package/CHANGELOG.md +0 -101
  2. package/README.md +12 -16
  3. package/lib/chunks/ui-components-DO2fZKs1.js +2286 -0
  4. package/lib/components/_v2/drop-data/index.d.ts +7 -9
  5. package/lib/components/_v2/input/index.d.ts +1 -3
  6. package/lib/components/_v2/loader/index.d.ts +1 -3
  7. package/lib/components/_v2/segment/index.d.ts +2 -1
  8. package/lib/components/_v2/table/styled.d.ts +18 -29
  9. package/lib/components/_v2/table/types.d.ts +0 -2
  10. package/lib/components/selection-button/index.d.ts +1 -1
  11. package/lib/components/styled.d.ts +50 -46
  12. package/lib/components/tab-list/index.d.ts +3 -4
  13. package/lib/components/text/index.d.ts +1 -1
  14. package/lib/components/v2.js +1 -1
  15. package/lib/components.js +1 -1
  16. package/lib/constants/sources/index.d.ts +1 -5
  17. package/lib/constants.js +1 -1
  18. package/lib/containers/_v2/central-connections/config-drawer/index.d.ts +8 -6
  19. package/lib/containers/_v2/central-connections/index.d.ts +6 -5
  20. package/lib/containers/_v2/central-connections/source-drawer/index.d.ts +1 -1
  21. package/lib/containers/_v2/central-connections/source-drawer/styled.d.ts +15 -15
  22. package/lib/containers/_v2/index.d.ts +0 -1
  23. package/lib/containers/_v2/pipeline-collectors/pods-info/index.d.ts +1 -1
  24. package/lib/containers/data-flow/column/frame.d.ts +1 -0
  25. package/lib/containers/data-flow/column/index.d.ts +1 -0
  26. package/lib/containers/data-flow-actions-menu/search/search-results/builder.d.ts +1 -1
  27. package/lib/containers/data-flow-actions-menu/styled.d.ts +5 -9
  28. package/lib/containers/instrumentation-rule-modal/index.d.ts +1 -0
  29. package/lib/containers/source-drawer/describe/index.d.ts +1 -1
  30. package/lib/containers/source-drawer/odigos-health/index.d.ts +2 -1
  31. package/lib/containers/v2.js +20 -27
  32. package/lib/containers.js +130 -128
  33. package/lib/contexts/odigos-context.d.ts +9 -11
  34. package/lib/contexts.js +1 -1
  35. package/lib/functions.js +1 -1
  36. package/lib/hooks/index.d.ts +1 -0
  37. package/lib/hooks/useActionFormData.d.ts +1 -1
  38. package/lib/hooks/useConnection.d.ts +3 -0
  39. package/lib/hooks.js +1 -1
  40. package/lib/icons/auth/index.d.ts +0 -1
  41. package/lib/icons/common/index.d.ts +0 -1
  42. package/lib/icons.js +1 -1
  43. package/lib/mock-data/sources/index.d.ts +19 -2
  44. package/lib/snippets/_v2/yaml-section-card/index.d.ts +0 -2
  45. package/lib/snippets/add-button/index.d.ts +1 -1
  46. package/lib/snippets/source-container/index.d.ts +1 -1
  47. package/lib/snippets/source-container/override-runtime.d.ts +1 -2
  48. package/lib/snippets.js +1 -1
  49. package/lib/store.js +1 -1
  50. package/lib/theme/animations/index.d.ts +22 -28
  51. package/lib/theme/index.d.ts +12 -3
  52. package/lib/theme.js +1 -1
  53. package/lib/types/common/index.d.ts +1 -1
  54. package/lib/types/enum/index.d.ts +1 -23
  55. package/lib/types/index.d.ts +0 -1
  56. package/lib/types/instrumentation-instances/index.d.ts +0 -1
  57. package/lib/types/pipeline-collectors/index.d.ts +0 -9
  58. package/lib/types/sources/index.d.ts +2 -4
  59. package/lib/types.js +1 -1
  60. package/lib/visuals/index.d.ts +2 -1
  61. package/lib/visuals/visual-star/index.d.ts +2 -0
  62. package/lib/visuals/visual-success/index.d.ts +2 -0
  63. package/lib/visuals.js +1 -1
  64. package/package.json +1 -1
  65. package/lib/chunks/ui-components-CYC_0_iY.js +0 -2296
  66. package/lib/containers/_v2/system-drawer/describe/index.d.ts +0 -10
  67. package/lib/containers/_v2/system-drawer/diagnose/index.d.ts +0 -6
  68. package/lib/containers/_v2/system-drawer/index.d.ts +0 -11
  69. package/lib/containers/_v2/system-drawer/tokens/index.d.ts +0 -7
  70. package/lib/containers/_v2/system-drawer/tokens/token-actions.d.ts +0 -12
  71. package/lib/containers/_v2/system-drawer/tokens/token-expires-at.d.ts +0 -6
  72. package/lib/containers/_v2/system-drawer/tokens/token-input.d.ts +0 -8
  73. package/lib/icons/auth/okta-icon/index.d.ts +0 -2
  74. package/lib/icons/common/diagnose-icon/index.d.ts +0 -2
  75. package/lib/types/diagnose/index.d.ts +0 -6
  76. package/lib/visuals/visual-green-rings/index.d.ts +0 -7
  77. /package/lib/theme/{palettes → palletes}/index.d.ts +0 -0
package/lib/containers.js CHANGED
@@ -1,51 +1,51 @@
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{a8 as g,a9 as y,aa as v,ab as b,ac as f,ad as x,ae as S,af as $,ag as C,ah as w,ai as k,aj as D,ak as T,al as N,am as E,an as O,ao as A,ap as F,aq as I,ar as M,as as R,at as L,au as P,av as j,aw as K,ax as q,ay as H,az as z,aA as V,E as B,a5 as W,aB as _,aC as J,aD as U,aE as Y,aF as G,aG as X,aH as Z,aI as Q,aJ as ee,aK as te,aL as ie,S as ne,aM as ae,aN as oe,aO as re,aP as le,F as se,aQ as ce,aR as de,aS as ue,a as pe,aT as he,c as me,aU as ge,aV as ye,aW as ve,aX as be,aY as fe,aZ as xe,a_ as Se,a$ as $e,b0 as Ce,b1 as we,b2 as ke,b3 as De,j as Te,N as Ne,b4 as Ee,b5 as Oe,b6 as Ae,r as Fe,b7 as Ie,b8 as Me,b9 as Re,$ as Le,ba as Pe,bb as je,bc as Ke,bd as qe,be as He,bf as ze,bg as Ve,g as Be,P as We,bh as _e,u as Je,bi as Ue,bj as Ye,bk as Ge,bl as Xe,bm as Ze,bn as Qe,bo as et,bp as tt,bq as it,br as nt,bs as at,bt as ot,bu as rt,bv as lt,bw as st,bx as ct,by as dt,bz as ut,bA as pt,D as ht,bB as mt,bC as gt,bD as yt,bE as vt,bF as bt,bG as ft,bH as xt,bI as St,bJ as $t,bK as Ct,bL as wt,bM as kt,bN as Dt,h as Tt,bO as Nt,bP as Et,bQ as Ot,bR as At,bS as Ft,bT as It,bU as Mt,bV as Rt,bW as Lt,bX as Pt,bY as jt,bZ as Kt,b_ as qt,b$ as Ht,c0 as zt,c1 as Vt,c2 as Bt,c3 as Wt,s as _t,c4 as Jt,c5 as Ut,c6 as Yt,c7 as Gt,c8 as Xt,c9 as Zt,ca as Qt,cb as ei,cc as ti,cd as ii,ce as ni,Y as ai,cf as oi,t as ri,cg as li,ch as si,ci,cj as di,ck as ui,cl as pi,cm as hi,cn as mi,co as gi,a4 as yi,a3 as vi,q as bi,cp as fi,cq as xi,cr as Si,cs as $i,ct as Ci,cu as wi,cv as ki}from"./chunks/ui-components-CYC_0_iY.js";import{VSquareIcon as Di,XSquareIcon as Ti,EditIcon as Ni,TrashIcon as Ei,OdigosLogoText as Oi,PlusIcon as Ai,RefreshIcon as Fi,SearchIcon as Ii,FilterIcon as Mi,DataStreamIcon as Ri,VIcon as Li,OdigosLogo as Pi,ArrowIcon as ji,RefreshLeftArrowIcon as Ki,NotificationIcon as qi,UserIcon as Hi,ImageErrorIcon as zi,OverviewIcon as Vi,SourceIcon as Bi,DestinationIcon as Wi,InstrumentationRuleIcon as _i,ActionIcon as Ji,SlackLogo as Ui,KeyIcon as Yi,TerminalIcon as Gi,ExclamationTriangleIcon as Xi,TraceViewIcon as Zi}from"./icons.js";import{MarkerType as Qi,useNodesState as en,useEdgesState as tn,applyNodeChanges as nn}from"@xyflow/react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-1oZp1FpB.js";import"react-dom";import"react-error-boundary";import"lottie-react";import"prism-react-renderer";const an=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?.map(e=>e.toLowerCase()).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},on=f.PiiCategories,rn=p.div`
1
+ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperativeHandle as o,useMemo as l,Fragment as r,useCallback as s,Children as c}from"react";import d,{css as u,useTheme as p}from"styled-components";import{a1 as m,a2 as h,a3 as g,a4 as y,a5 as v,a6 as b,a7 as f,a8 as x,a9 as S,aa as $,ab as k,ac as C,ad as w,ae as D,af as T,ag as N,Q as E,ah as O,ai as A,aj as F,ak as I,al as M,am as R,an as L,ao as P,ap as j,aq as K,ar as V,as as q,E as H,at as z,au as B,av as W,aw as _,ax as J,ay as U,az as G,aA as Y,aB as X,aC as Q,aD as Z,aE as ee,aF as te,S as ae,aG as ie,aH as ne,aI as oe,F as le,aJ as re,aK as se,aL as ce,a as de,aM as ue,c as pe,aN as me,aO as he,aP as ge,aQ as ye,aR as ve,aS as be,aT as fe,aU as xe,aV as Se,aW as $e,aX as ke,aY as Ce,j as we,N as De,aZ as Te,a_ as Ne,a$ as Ee,q as Oe,b0 as Ae,b1 as Fe,b2 as Ie,b3 as Me,b4 as Re,b5 as Le,b6 as Pe,b7 as je,b8 as Ke,b9 as Ve,g as qe,P as He,ba as ze,bb as Be,u as We,bc as _e,bd as Je,be as Ue,bf as Ge,bg as Ye,bh as Xe,bi as Qe,bj as Ze,bk as et,bl as tt,bm as at,bn as it,bo as nt,bp as ot,bq as lt,br as rt,bs as st,bt as ct,bu as dt,D as ut,bv as pt,bw as mt,bx as ht,by as gt,bz as yt,bA as vt,bB as bt,bC as ft,bD as xt,bE as St,bF as $t,bG as kt,bH as Ct,h as wt,bI as Dt,bJ as Tt,bK as Nt,bL as Et,bM as Ot,bN as At,bO as Ft,bP as It,bQ as Mt,bR as Rt,bS as Lt,bT as Pt,bU as jt,bV as Kt,bW as Vt,bX as qt,r as Ht,bY as zt,bZ as Bt,b_ as Wt,b$ as _t,c0 as Jt,c1 as Ut,c2 as Gt,c3 as Yt,c4 as Xt,c5 as Qt,c6 as Zt,Y as ea,c7 as ta,w as aa,c8 as ia,c9 as na,ca as oa,cb as la,cc as ra,cd as sa,ce as ca,cf as da,cg as ua,ch as pa,ci as ma,p as ha,cj as ga,ck as ya,cl as va,cm as ba,cn as fa,co as xa,cp as Sa}from"./chunks/ui-components-DO2fZKs1.js";import{VSquareIcon as $a,XSquareIcon as ka,EditIcon as Ca,TrashIcon as wa,OdigosLogoText as Da,PlusIcon as Ta,RefreshIcon as Na,SearchIcon as Ea,FilterIcon as Oa,DataStreamIcon as Aa,VIcon as Fa,OdigosLogo as Ia,ArrowIcon as Ma,RefreshLeftArrowIcon as Ra,NotificationIcon as La,UserIcon as Pa,ImageErrorIcon as ja,OverviewIcon as Ka,SourceIcon as Va,DestinationIcon as qa,InstrumentationRuleIcon as Ha,ActionIcon as za,SlackLogo as Ba,KeyIcon as Wa,TerminalIcon as _a,ExclamationTriangleIcon as Ja,TraceViewIcon as Ua}from"./icons.js";import{MarkerType as Ga,useNodesState as Ya,useEdgesState as Xa,applyNodeChanges as Qa}from"@xyflow/react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-1oZp1FpB.js";import"react-dom";import"react-error-boundary";import"lottie-react";import"prism-react-renderer";const Za=e=>{const{type:t,name:a,notes:i,signals:n,disabled:o,fields:{collectContainerAttributes:l,collectReplicaSetAttributes:r,collectWorkloadId:s,collectClusterId:c,labelsAttributes:d,annotationsAttributes:u,clusterAttributes:p,overwriteExistingValues:v,attributeNamesToDelete:b,renames:f,piiCategories:x,fallbackSamplingRatio:S,samplingPercentage:$,endpointsFilters:k,servicesNameFilters:C,attributeFilters:w}}=e,D=[{title:m.TYPE,value:t},{type:h.ActiveStatus,title:m.STATUS,value:String(!o)},{type:h.Monitors,title:m.SIGNALS_FOR_PROCESSING,value:n?.map(e=>e.toLowerCase()).join(", ")||""},{title:m.NAME,value:a||""},{title:m.NOTES,value:i||""},{type:h.Divider}];if(t===g.K8sAttributes&&(D.push({title:"Collect Container Attributes",value:String(l)}),D.push({title:"Collect ReplicaSet Attributes",value:String(r)}),D.push({title:"Collect Workload ID",value:String(s)}),D.push({title:"Collect Cluster ID",value:String(c)}),d?.length&&D.push({type:h.Divider}),d?.forEach(({labelKey:e,attributeKey:t,from:a,fromSources:i},n)=>{let o="";o+=`Label Key: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`From: ${i?.length?i.join(", "):a||y.Pod}\n`,D.push({title:"Label"+(d.length>1?` #${n+1}`:""),value:o})}),u?.length&&D.push({type:h.Divider}),u?.forEach(({annotationKey:e,attributeKey:t,from:a,fromSources:i},n)=>{let o="";o+=`Annotation Key: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`From: ${i?.length?i.join(", "):a||y.Pod}\n`,D.push({title:"Annotation"+(u.length>1?` #${n+1}`:""),value:o})})),t===g.AddClusterInfo){D.push({title:"Overwrite Existing Values",value:String(v||!1)});let e="";p?.forEach(({attributeName:t,attributeStringValue:a},i)=>{e+=`${t}: ${a}`,i<p.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===g.DeleteAttributes){let e="";b?.forEach((t,a)=>{e+=t,a<b.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===g.RenameAttributes){let e="";const t=Object.entries(f||{});t.forEach(([a,i],n)=>{e+=`${a}: ${i}`,n<t.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===g.PiiMasking){let e="";x?.forEach((t,a)=>{e+=t,a<x.length-1&&(e+=", ")}),D.push({title:"Categories",value:e})}return t===g.ErrorSampler&&D.push({title:"Sampling Ratio",value:String(S)}),t===g.ProbabilisticSampler&&D.push({title:"Sampling Percentage",value:String($)}),t===g.LatencySampler&&k?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:a,fallbackSamplingRatio:i},n)=>{let o="";o+=`Service Name: ${e}\n`,o+=`HTTP Route: ${t}\n`,o+=`Min. Latency: ${a}\n`,o+=`Fallback Sampling Ratio: ${i}`,D.push({title:"Endpoint"+(k.length>1?` #${n+1}`:""),value:o})}),t===g.ServiceNameSampler&&C?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:a},i)=>{let n="";n+=`Service Name: ${e}\n`,n+=`Sampling Ratio: ${t}\n`,n+=`Fallback Sampling Ratio: ${a}`,D.push({title:"Filter"+(C.length>1?` #${i+1}`:""),value:n})}),t===g.SpanAttributeSampler&&w?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:a,condition:i},n)=>{let o="";o+=`Service Name: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`Fallback Sampling Ratio: ${a}\n`;const l=Object.keys(i)[0];o+=`Condition: ${l}\n`,o+=`Operation: ${i[l]?.operation}\n`,o+=`Expected Value: ${i[l]?.expectedValue}`,"jsonCondition"===l&&(o+=`\nJSON Path: ${i[l].jsonPath}`),D.push({title:"Filter"+(w.length>1?` #${n+1}`:""),value:o})}),D},ei=v.PiiCategories,ti=d.div`
2
2
  display: flex;
3
3
  flex-direction: row;
4
4
  gap: 32px;
5
- ${({$hasError:e})=>e&&h`
5
+ ${({$hasError:e})=>e&&u`
6
6
  border: 1px solid ${({theme:e})=>e.text.error};
7
7
  border-radius: 32px;
8
8
  padding: 8px;
9
9
  `}
10
- `,ln=[{id:"CREDIT_CARD",label:"Credit Card"}],sn=f.FallbackSamplingRatio,cn=[{value:b.Pod,id:b.Pod},{value:b.Namespace,id:b.Namespace},{value:b.Node,id:b.Node}],dn=[{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:cn,required:!1,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],un=[{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:cn,required:!1,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],pn=f.EndpointsFilters,hn=[{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}],mn=f.AttributeNamesToDelete,gn=f.Renames,yn=f.ServicesNameFilters,vn=[{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}],bn=f.SamplingPercentage,fn=f.AttributeFilters,xn=[{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:O.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:O.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}],Sn={[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:dn,value:n[f.LabelsAttributes]||[],onChange:e=>o(f.LabelsAttributes,e),errorMessage:r[f.LabelsAttributes]}),t(D,{columns:un,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[mn],o=e[mn]||[];return t(E,{title:"Attributes to delete",value:o,onChange:e=>i(mn,e),required:!0,errorMessage:a})},[v.RenameAttributes]:({value:e,setValue:i,formErrors:n})=>{const a=n[gn],o=Object.entries(e[gn]||{}).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(gn,t)},required:!0,errorMessage:a})},[v.PiiMasking]:({value:i,setValue:o,formErrors:r})=>{const l=r[on],s=i[on]||[],[c,d]=n(1===s.length);return a(()=>{if(!s.length){const e=ln.map(({id:e})=>e);o(on,e),d(1===ln.length)}},[]),e("div",{children:[t(x,{title:"Attributes to mask",required:!0}),t(rn,{$hasError:!!l,children:ln.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(on,i),d(1===i.length)})(e,t)},e))}),!!l&&t($,{children:l})]})},[v.ErrorSampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[sn],o=e[sn];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(sn,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[v.ProbabilisticSampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[bn],o=e[bn];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(bn,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[v.LatencySampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[pn],o=e[pn]||[];return t(D,{columns:hn,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(pn,t)},errorMessage:a})},[v.ServiceNameSampler]:({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,samplingRatio:t,fallbackSamplingRatio:i})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(i)}));i(yn,t)},errorMessage:a})},[v.SpanAttributeSampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[fn],o=(e[fn]||[]).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:xn,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(fn,t)},errorMessage:a,limitFieldsPerRow:3})}},$n=({actionType:e,value:i,setValue:n,formErrors:a})=>{if(!e)return null;const o=Sn[e];return o?t(o,{value:i,setValue:n,formErrors:a}):null},Cn=p.div`
10
+ `,ai=[{id:"CREDIT_CARD",label:"Credit Card"}],ii=v.FallbackSamplingRatio,ni=[{value:y.Pod,id:y.Pod},{value:y.Namespace,id:y.Namespace},{value:y.Node,id:y.Node}],oi=[{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:ni,required:!1,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],li=[{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:ni,required:!1,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],ri=v.EndpointsFilters,si=[{title:"Service",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Service name: The rule applies to a specific service name. Only traces originating from this service’s root span will be considered.",required:!0},{title:"HTTP route",keyName:"httpRoute",placeholder:"e.g. /api/v1/users",tooltip:"HTTP route: The specific HTTP route prefix to match for sampling. Only traces with routes beginning with this prefix will be considered. For instance, configuring /buy will also match /buy/product.",required:!0},{title:"Threshold",keyName:"minimumLatencyThreshold",placeholder:"e.g. 1000",tooltip:"Minimum latency threshold (ms): Specifies the minimum latency in milliseconds; traces with latency below this threshold are ignored.",required:!0,type:$.Number},{title:"Fallback",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Fallback sampling ratio: Specifies the percentage of traces that meet the service/http_route filter but fall below the threshold that you still want to retain. For example, if a rule is set for service A and http_route B with a minimum latency threshold of 1 second, you might still want to keep some traces below this threshold. Setting the ratio to 20% ensures that 20% of these traces will be retained.",required:!0,type:$.Number}],ci=v.AttributeNamesToDelete,di=v.Renames,ui=v.ServicesNameFilters,pi=[{title:"Service Name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (Across all available spans).",required:!0},{title:"Sampling Ratio",keyName:"samplingRatio",placeholder:"e.g. 10",tooltip:"Specifies the sample rate for all traces.",required:!0,type:$.Number},{title:"Fallback Sampling Ratio",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Specifies the percentage of traces that don’t meet the service name filter and that you still like to retain.",required:!0,type:$.Number}],mi=v.SamplingPercentage,hi=v.AttributeFilters,gi=[{title:"Service Name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (across all available spans).",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"e.g. http.request.method",tooltip:"Specifies the attribute key inside of the span.",required:!0},{title:"Fallback Sampling Ratio",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Specifies the percentage of traces that don’t meet the service name filter and that you still like to retain.",required:!0,type:$.Number},{title:"Condition",keyName:"condition",tooltip:"An object representing the filters for span attributes filters.",required:!0,componentType:N.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:N.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}],yi={[g.K8sAttributes]:({value:t,setValue:i,formErrors:n})=>(a(()=>{t[v.CollectContainerAttributes]||t[v.CollectReplicaSetAttributes]||t[v.CollectWorkloadId]||t[v.CollectClusterId]||t[v.LabelsAttributes]?.length||t[v.AnnotationsAttributes]?.length||(i(v.CollectContainerAttributes,!0),i(v.CollectReplicaSetAttributes,!0),i(v.CollectWorkloadId,!0),i(v.CollectClusterId,!0),i(v.LabelsAttributes,[]),i(v.AnnotationsAttributes,[]))},[]),e.createElement(e.Fragment,null,e.createElement(f,{title:"Collect Container Attributes",value:t[v.CollectContainerAttributes]||!1,onChange:e=>i(v.CollectContainerAttributes,e),errorMessage:n[v.CollectContainerAttributes]}),e.createElement(f,{title:"Collect ReplicaSet Attributes",value:t[v.CollectReplicaSetAttributes]||!1,onChange:e=>i(v.CollectReplicaSetAttributes,e),errorMessage:n[v.CollectReplicaSetAttributes]}),e.createElement(f,{title:"Collect Workload ID",value:t[v.CollectWorkloadId]||!1,onChange:e=>i(v.CollectWorkloadId,e),errorMessage:n[v.CollectWorkloadId]}),e.createElement(f,{title:"Collect Cluster ID",value:t[v.CollectClusterId]||!1,onChange:e=>i(v.CollectClusterId,e),errorMessage:n[v.CollectClusterId]}),e.createElement(C,{columns:oi,value:t[v.LabelsAttributes]||[],onChange:e=>i(v.LabelsAttributes,e),errorMessage:n[v.LabelsAttributes]}),e.createElement(C,{columns:li,value:t[v.AnnotationsAttributes]||[],onChange:e=>i(v.AnnotationsAttributes,e),errorMessage:n[v.AnnotationsAttributes]}))),[g.AddClusterInfo]:({value:t,setValue:a,formErrors:i})=>e.createElement(e.Fragment,null,e.createElement(w,{title:"Overwrite Existing Values",tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",initialValue:t[v.OverwriteExistingValues]||!1,onChange:e=>a(v.OverwriteExistingValues,e)}),e.createElement(D,{title:"Resource Attributes",value:t[v.ClusterAttributes]?.map(e=>({key:e.attributeName,value:e.attributeStringValue}))||[],onChange:e=>a(v.ClusterAttributes,e.map(e=>({attributeName:e.key,attributeStringValue:e.value}))),required:!0,errorMessage:i[v.ClusterAttributes]})),[g.DeleteAttributes]:({value:t,setValue:a,formErrors:i})=>{const n=i[ci],o=t[ci]||[];return e.createElement(T,{title:"Attributes to delete",value:o,onChange:e=>a(ci,e),required:!0,errorMessage:n})},[g.RenameAttributes]:({value:t,setValue:a,formErrors:i})=>{const n=i[di],o=Object.entries(t[di]||{}).map(([e,t])=>({key:e,value:t}));return e.createElement(D,{title:"Attributes to rename",value:o,onChange:e=>{const t={};e.forEach(e=>t[e.key]=e.value),a(di,t)},required:!0,errorMessage:n})},[g.PiiMasking]:({value:i,setValue:n,formErrors:o})=>{const l=o[ei],r=i[ei]||[],[s,c]=t(1===r.length);return a(()=>{if(!r.length){const e=ai.map(({id:e})=>e);n(ei,e),c(1===ai.length)}},[]),e.createElement("div",null,e.createElement(b,{title:"Attributes to mask",required:!0}),e.createElement(ti,{$hasError:!!l},ai.map(({id:t,label:a})=>e.createElement(f,{key:t,title:a,disabled:s&&r.includes(t),value:r.includes(t),onChange:e=>((e,t)=>{const a=t?[...r,e]:r.filter(t=>t!==e);n(ei,a),c(1===a.length)})(t,e)}))),!!l&&e.createElement(x,null,l))},[g.ErrorSampler]:({value:t,setValue:a,formErrors:i})=>{const n=i[ii],o=t[ii];return e.createElement(S,{title:"Fallback sampling ratio",required:!0,type:$.Number,min:0,max:100,value:k(o)?"":String(o),onChange:({target:{value:e}})=>{return t=e,a(ii,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:n})},[g.ProbabilisticSampler]:({value:t,setValue:a,formErrors:i})=>{const n=i[mi],o=t[mi];return e.createElement(S,{title:"Sampling percentage",required:!0,type:$.Number,min:0,max:100,value:k(o)?"":String(o),onChange:({target:{value:e}})=>{return t=e,a(mi,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:n})},[g.LatencySampler]:({value:t,setValue:a,formErrors:i})=>{const n=i[ri],o=t[ri]||[];return e.createElement(C,{columns:si,value:o,onChange:e=>{const t=e.map(({serviceName:e,httpRoute:t,minimumLatencyThreshold:a,fallbackSamplingRatio:i})=>({serviceName:e,httpRoute:t,minimumLatencyThreshold:Number(a),fallbackSamplingRatio:Number(i)}));a(ri,t)},errorMessage:n})},[g.ServiceNameSampler]:({value:t,setValue:a,formErrors:i})=>{const n=i[ui],o=t[ui]||[];return e.createElement(C,{columns:pi,value:o,onChange:e=>{const t=e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:a})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(a)}));a(ui,t)},errorMessage:n})},[g.SpanAttributeSampler]:({value:t,setValue:a,formErrors:i})=>{const n=i[hi],o=(t[hi]||[]).map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:a,condition:i})=>{const n=Object.entries(i).filter(([e,t])=>t)[0][0];return{serviceName:e,attributeKey:t,fallbackSamplingRatio:a,condition:n,operation:i[n]?.operation,expectedValue:i[n]?.expectedValue,jsonPath:i[n]?.jsonPath}});return e.createElement(C,{columns:gi,value:o,onChange:e=>{const t=e.map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:a,condition:i,operation:n,expectedValue:o,jsonPath:l})=>{const r={serviceName:e,attributeKey:t,fallbackSamplingRatio:Number(a),condition:{[i]:{operation:n,expectedValue:o}}};return l&&(r.condition[i].jsonPath=l),r});a(hi,t)},errorMessage:n,limitFieldsPerRow:3})}},vi=({actionType:t,value:a,setValue:i,formErrors:n})=>{if(!t)return null;const o=yi[t];return o?e.createElement(o,{value:a,setValue:i,formErrors:n}):null},bi=d.div`
11
11
  display: flex;
12
12
  flex-direction: column;
13
13
  gap: 24px;
14
14
  padding: 4px;
15
- `,wn=p(P)`
15
+ `,fi=d(R)`
16
16
  margin-bottom: 12px;
17
- `,kn=({isUpdate:i,action:n,formData:a,formErrors:o,handleFormChange:r})=>{const l=m();return e(Cn,{children:[i&&e("div",{children:[t(wn,{children:"Status"}),t(A,{options:[{icon:Di,label:g.ENABLED,value:!1,selectedBgColor:l.text.success+F["050"]},{icon:Ti,label:g.DISABLED,value:!0,selectedBgColor:l.text.error+F["050"]}],selected:a.disabled,setSelected:e=>r("disabled",e)})]}),!i&&t(I,{title:"",description:n.docsDescription,actionButton:t(M,{endpoint:n.docsEndpoint})}),t(R,{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($n,{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})]})},Dn=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,O]=n(!1),[A,F]=n(!1),I=r(null),M=D===B.Source,R=()=>{O(!1),F(!1)},L=()=>{R(),b&&b(!1),T(null),N(null),v?.()};l(w,()=>({closeDrawer:L}));const W=()=>{I.current?.clearTitle(),S&&S(),R()},_=()=>{const e=I.current?.isTitleDirty();g||e?F(!0):W()},J=()=>{O(!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(Ni,{}),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(Ei,{}),t(P,{color:k.text.error,size:14,family:"secondary",decoration:"underline",children:M?q.UNINSTRUMENT:q.DELETE})]})}),e(i,{children:[t(H,{isOpen:!0,onClose:h?_:L,closeOnEscape:!E&&!A,width:`${o+64}px`,header:{icons:u,iconSrcs:p,title:s,titleTooltip:c,replaceTitleWith:!d&&h?t(Tn,{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(Ei,{}),t(P,{size:14,color:k.text.error,family:"secondary",decoration:"underline",children:q.DELETE})]})}]:[]},children:a}),t(z,{isOpen:E,noOverlay:!0,name:`${D}${s?` (${s})`:""}`,type:D,isLastItem:y,onApprove:()=>{x&&x(),R()},onDeny:R}),t(V,{isOpen:A,noOverlay:!0,name:"edit mode",onApprove:W,onDeny:R})]})}),Tn=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)})});Tn.displayName=Tn.name,Dn.displayName=Dn.name;const Nn=p.div`
17
+ `,xi=({isUpdate:t,action:a,formData:i,formErrors:n,handleFormChange:o})=>{const l=E.useTheme();return e.createElement(bi,null,t&&e.createElement("div",null,e.createElement(fi,null,"Status"),e.createElement(O,{options:[{icon:$a,label:m.ENABLED,value:!1,selectedBgColor:l.text.success+E.opacity.hex["050"]},{icon:ka,label:m.DISABLED,value:!0,selectedBgColor:l.text.error+E.opacity.hex["050"]}],selected:i.disabled,setSelected:e=>o("disabled",e)})),!t&&e.createElement(A,{title:"",description:a.docsDescription,actionButton:e.createElement(F,{endpoint:a.docsEndpoint})}),e.createElement(I,{title:"Signals for Processing",required:!0,allowedSignals:a.allowedSignals,selectedSignals:i.signals||[],setSelectedSignals:e=>o("signals",e),errorMessage:n.signals}),!t&&e.createElement(S,{title:"Action name",placeholder:"Use a name that describes the action",value:i.name||"",onChange:({target:{value:e}})=>o("name",e),errorMessage:n.name}),e.createElement(vi,{actionType:a.type,value:i.fields,setValue:(e,t)=>o(`fields.${e}`,t),formErrors:n}),e.createElement(M,{title:"Notes",value:i.notes||"",onChange:({target:{value:e}})=>o("notes",e),errorMessage:n.notes}))},Si=i(({children:a,width:i=640,title:l,titleTooltip:r,hideEditTitleFromEdit:s,icons:c,iconSrcs:d,isEdit:u=!1,isFormDirty:m=!1,isLastItem:h=!1,onClose:g,onEdit:y,onSave:v,onDelete:b,onCancel:f,tabs:x,headerActionButtons:S},$)=>{const k=p(),{drawerType:C,setDrawerType:w,setDrawerEntityId:D}=L();P({key:"Enter",active:u},()=>_());const[T,N]=t(!1),[E,O]=t(!1),A=n(null),F=C===H.Source,I=()=>{N(!1),O(!1)},M=()=>{I(),y&&y(!1),w(null),D(null),g?.()};o($,()=>({closeDrawer:M}));const z=()=>{A.current?.clearTitle(),f&&f(),I()},B=()=>{const e=A.current?.isTitleDirty();m||e?O(!0):z()},W=()=>{N(!0)},_=()=>{v&&v(A.current?.getTitle()||"")},J=S||[];return y&&!u&&J.push({"data-id":"drawer-edit",variant:"tertiary",onClick:()=>y(!0),children:e.createElement(e.Fragment,null,e.createElement(Ca,null),e.createElement(R,{size:14,family:"secondary",decoration:"underline"},"Edit"))}),b&&!u&&J.push({"data-id":"drawer-delete",variant:"tertiary",onClick:W,children:e.createElement(e.Fragment,null,e.createElement(wa,null),e.createElement(R,{color:k.text.error,size:14,family:"secondary",decoration:"underline"},F?j.UNINSTRUMENT:j.DELETE))}),e.createElement(e.Fragment,null,e.createElement(K,{isOpen:!0,onClose:u?B:M,closeOnEscape:!T&&!E,width:`${i+64}px`,header:{icons:c,iconSrcs:d,title:l,titleTooltip:r,replaceTitleWith:!s&&u?e.createElement($i,{ref:A,title:l}):void 0,actionButtons:J,tabs:x},footer:{isOpen:u,leftButtons:[{"data-id":"drawer-save",variant:"primary",onClick:_,children:j.SAVE},{"data-id":"drawer-cancel",variant:"secondary",onClick:B,children:j.CANCEL}],rightButtons:b?[{"data-id":"drawer-delete",variant:"tertiary",onClick:W,children:e.createElement(e.Fragment,null,e.createElement(wa,null),e.createElement(R,{size:14,color:k.text.error,family:"secondary",decoration:"underline"},j.DELETE))}]:[]}},a),e.createElement(V,{isOpen:T,noOverlay:!0,name:`${C}${l?` (${l})`:""}`,type:C,isLastItem:h,onApprove:()=>{b&&b(),I()},onDeny:I}),e.createElement(q,{isOpen:E,noOverlay:!0,name:"edit mode",onApprove:z,onDeny:I}))}),$i=i(({title:i},n)=>{const[l,r]=t(i);return a(()=>{r(i)},[i]),o(n,()=>({getTitle:()=>l||i,isTitleDirty:()=>l!==i,clearTitle:()=>r(i)})),e.createElement(S,{"data-id":"title",value:l,onChange:e=>r(e.target.value)})});$i.displayName=$i.name,Si.displayName=Si.name;const ki=d.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
- `,En=p.div`
23
+ `,Ci=d.div`
24
24
  display: flex;
25
25
  flex-direction: column;
26
26
  gap: 12px;
27
- `,On=({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(Dn,{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:Z.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(Nn,{children:t(kn,{isUpdate:!0,action:k,formData:b,formErrors:f,handleFormChange:(...e)=>{v(!0),x(...e)}})}):e(En,{children:[t(Y,{conditions:w.conditions||[]}),t(G,{title:g.ACTION_DETAILS,data:w?an(w):[]})]})})},An=p(se)`
27
+ `,wi=({updateAction:i,deleteAction:o})=>{const{actions:r}=z(),{drawerType:s,drawerEntityId:c}=L(),d=n(null),u=s===H.Action,[p,h]=t(!1),[g,y]=t(!1),{formData:v,formErrors:b,handleFormChange:f,resetFormData:x,validateForm:S,loadFormWithDrawerItem:$}=B(),k=l(()=>{if(c)return r?.find(e=>W(e)===c)},[c,r]);if(a(()=>{u&&k?$(k):x()},[u,k]),!k)return null;const C=_.find(({type:e})=>e===k.type)||_.find(({label:e})=>"Attributes"===e)?.items?.find(({type:e})=>e===k.type)||_.find(({label:e})=>"Samplers"===e)?.items?.find(({type:e})=>e===k.type);return e.createElement(Si,{ref:d,title:k.name||k.type,icons:[J(k.type)],isEdit:p,isFormDirty:g,onEdit:e=>{h("boolean"!=typeof e||e)},onSave:e=>{if(S({withAlert:!0,alertTitle:Y.Update})){const t=e!==k.type?e:"";f("name",t),i(c,{...v,name:t}),h(!1),y(!1)}},onDelete:()=>{o(c,k.type),h(!1),y(!1),d.current?.closeDrawer()},onCancel:()=>{h(!1),y(!1),$(k)}},p&&C?e.createElement(ki,null,e.createElement(xi,{isUpdate:!0,action:C,formData:v,formErrors:b,handleFormChange:(...e)=>{y(!0),f(...e)}})):e.createElement(Ci,null,e.createElement(U,{conditions:k.conditions||[]}),e.createElement(G,{title:m.ACTION_DETAILS,data:k?Za(k):[]})))},Di=d(le)`
28
28
  margin-top: 24px;
29
29
  gap: 12px;
30
- `,Fn=({createAction:i})=>{const{currentModal:a,setCurrentModal:o}=Q(),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:Z.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(An,{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(kn,{action:p,formData:l,formErrors:s,handleFormChange:c})]}):null]})})},In=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},Mn=({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(Rn,{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})})},Rn=({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}`)})})},Ln=({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}},Pn=[{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}],jn=({maxHeight:i,maxWidth:n})=>{const a=m(),o=ye(),{actions:r,actionsLoading:l}=W(),{setDrawerType:c,setDrawerEntityId:d}=j(),u=s(()=>Ln({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:In(e),textColor:a.text.info,withTooltip:!0},{columnKey:"signals",component:()=>t(xe,{withLabels:!0,monitors:e.signals||[]})},{columnKey:"conditions",component:()=>t(Mn,{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:Pn,rows:p})}),!u.length&&t(Te,{style:{marginTop:"2rem"},children:t(Ne,{})})]})},Kn=p(se)`
30
+ `,Ti=({createAction:a})=>{const{currentModal:i,setCurrentModal:n}=X(),o=i===H.Action,{formData:l,formErrors:r,handleFormChange:s,resetFormData:c,validateForm:d}=B(),[u,p]=t(void 0),h=()=>{c(),p(void 0),n("")},g=()=>{if(!d({withAlert:!0,alertTitle:Y.Create}))return null;a(l),h()};return P({key:"Enter",active:o},()=>g()),e.createElement(Q,{isOpen:o,onClose:h,header:{title:"Add Action"},actionComponent:e.createElement(Z,{buttons:[{variant:"primary",label:"DONE",onClick:g,disabled:!u}]})},e.createElement(ee,null,e.createElement(A,{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.createElement(Di,null,e.createElement(te,{type:ae.Warning,message:ie.DEFINED_FOR_ALL_STREAMS(m.ACTIONS)}),e.createElement(ne,{options:_,selectedOption:u,onOptionSelect:e=>{return t=e,c(),s("type",t?.type||""),void p(t);var t},autoFocus:!u?.type})),u?.type?e.createElement("div",null,e.createElement(oe,{margin:"16px 0"}),e.createElement(xi,{action:u,formData:l,formErrors:r,handleFormChange:s})):null))},Ni=e=>{const{type:t,fields:{collectContainerAttributes:a,collectReplicaSetAttributes:i,collectWorkloadId:n,collectClusterId:o,labelsAttributes:l,annotationsAttributes:r,clusterAttributes:s,overwriteExistingValues:c,attributeNamesToDelete:d,renames:u,piiCategories:p,fallbackSamplingRatio:m,samplingPercentage:h,endpointsFilters:v,attributeFilters:b,servicesNameFilters:f}}=e;let x="";if(t===g.K8sAttributes&&(a&&(x+="Container Attributes, "),i&&(x+="ReplicaSet Attributes, "),n&&(x+="Workload ID, "),o&&(x+="Cluster ID, "),l?.forEach(({labelKey:e,attributeKey:t,from:a,fromSources:i},n)=>{const o=i?.length?i.join(","):a||y.Pod;x+=`Label: ${e} ${t} ${o} `,n===l.length-1&&(x+=", ")}),r?.forEach(({annotationKey:e,attributeKey:t,from:a,fromSources:i},n)=>{const o=i?.length?i.join(","):a||y.Pod;x+=`Annotation: ${e} ${t} ${o} `,n===r.length-1&&(x+=", ")})),t===g.AddClusterInfo&&(x+=`Overwrite Existing: ${c}\n`,s?.forEach(({attributeName:e,attributeStringValue:t},a)=>{x+=`${e}: ${t}`,a<s.length-1&&(x+=", ")})),t===g.DeleteAttributes&&d?.forEach((e,t)=>{x+=e,t<d.length-1&&(x+=", ")}),t===g.RenameAttributes){const e=Object.entries(u||{});e.forEach(([t,a],i)=>{x+=`${t}: ${a}`,i<e.length-1&&(x+=", ")})}return t===g.PiiMasking&&p?.forEach((e,t)=>{x+=e,t<p.length-1&&(x+=", ")}),t===g.ErrorSampler&&(x+=String(m)),t===g.ProbabilisticSampler&&(x+=String(h),x+="%"),t===g.LatencySampler&&v?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:a,fallbackSamplingRatio:i},n)=>{x+=`Endpoint${v.length>1?` #${n+1}`:""}=${e}${t}\n`,x+=` Latency=${a}`,x+=` Sampling=${i}`,n<v.length-1&&(x+=", ")}),t===g.ServiceNameSampler&&f?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:a})=>{x+=`Service Name: ${e}, `,x+=`Sampling Ratio: ${t}, `,x+=`Fallback Sampling Ratio: ${a}\n`}),t===g.SpanAttributeSampler&&b?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:a})=>{x+=`Service Name: ${e}, `,x+=`Attribute Key: ${t}, `,x+=`Fallback Sampling Ratio: ${a}\n`}),x},Ei=({conditions:t,id:a})=>{const{errors:i,warnings:n,disableds:o,hasLoadings:r}=l(()=>re(t),[t]),s=i.length>0?i:n.length>0?n:o.length>0?o:[];if(s.length>0)return e.createElement("div",{style:{lineHeight:1}},e.createElement(Oi,{conditions:s,id:a}));const c=r?ce.Loading:ae.Success;return e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:c,title:c,withBorder:!0,withIcon:!0}))},Oi=({conditions:t,id:a})=>{const i=E.useTheme();return e.createElement(de,null,ue(t).map(({status:t,type:n,reason:o,message:l,lastTransitionTime:r},s)=>{"loading"!==t&&"disabled"!==t||(t=ae.Info);const c=me(t,i);return e.createElement(pe,{key:`condition-${a}-${t}-${n}-${s}`,titleIcon:c,title:n,text:l||o||"",timestamp:r},e.createElement(se,{status:t,title:o||n,withBorder:!0,withIcon:!0}))}))},Ai=({instrumentationRules:e,sources:t,actions:a,destinations:i,searchText:n,selectedCategory:o})=>{const l=n?e.filter(e=>e.type?.toLowerCase().includes(n)||e.ruleName?.toLowerCase().includes(n)):e,r=n?t.filter(e=>e.name?.toLowerCase().includes(n)||e.otelServiceName?.toLowerCase().includes(n)||e.namespace?.toLowerCase().includes(n)):t,s=n?a.filter(e=>e.type?.toLowerCase().includes(n)||e.name?.toLowerCase().includes(n)):a,c=n?i.filter(e=>e.destinationType.displayName?.toLowerCase().includes(n)||e.name?.toLowerCase().includes(n)):i,d=[{category:H.Source,label:"Sources",count:r.length,entities:[]},{category:H.Action,label:"Actions",count:s.length,entities:[]},{category:H.Destination,label:"Destinations",count:c.length,entities:[]},{category:H.InstrumentationRule,label:"Instrumentation Rules",count:l.length,entities:[]}];d.unshift({category:"all",label:"All",count:l.length+r.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===H.InstrumentationRule?l:e.category===H.Source?r:e.category===H.Action?s:e.category===H.Destination?c:[]}));return{categories:d,searchResults:u}},Fi=[{key:"icon",title:""},{key:"name",title:m.NAME,sortable:!0},{key:"signals",title:m.MONITORS},{key:"active-status",title:m.STATUS},{key:"conditions",title:"Conditions"},{key:"type",title:m.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:m.NOTES,sortable:!0}],Ii=({maxHeight:t,maxWidth:a})=>{const i=E.useTheme(),n=he(),{actions:o,actionsLoading:r}=z(),{setDrawerType:s,setDrawerEntityId:c}=L(),d=l(()=>Ai({instrumentationRules:[],sources:[],actions:ge(o,n),destinations:[],searchText:n.searchText,selectedCategory:H.Action}).searchResults.find(({category:e})=>e===H.Action)?.entities||[],[o,n]),u=l(()=>d.map(t=>{const{hasErrors:a,hasWarnings:n,hasDisableds:o}=re(t.conditions||[]);return{status:a?ae.Error:n?ae.Warning:void 0,faded:o,onClick:()=>{s(H.Action),c(t.id)},cells:[{columnKey:"icon",component:()=>e.createElement(ye,{icon:J(t.type)})},{columnKey:"name",value:ve(t,H.Action,{prioritizeDisplayName:!0})},{columnKey:"type",value:t.type,textColor:i.text.info},{columnKey:"notes",value:t.notes,textColor:i.text.info,withTooltip:!0},{columnKey:"spec",value:Ni(t),textColor:i.text.info,withTooltip:!0},{columnKey:"signals",component:()=>e.createElement(be,{withLabels:!0,monitors:t.signals||[]})},{columnKey:"conditions",component:()=>e.createElement(Ei,{conditions:t.conditions||[],id:t.id})},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:t.disabled?ae.Error:ae.Success,title:t.disabled?m.DISABLED:m.ENABLED,withIcon:!0,withBorder:!0}))}]}}),[d]),{badge:p,badgeTooltip:h}=l(()=>d.length!==o.length?{badge:`${d.length}/${o.length}`,badgeTooltip:m.FILTERED_COUNT_TOOLTIP}:{badge:o.length,badgeTooltip:void 0},[d,o]);return e.createElement(fe,{$maxWidth:a},e.createElement(xe,null,e.createElement(Se,{icon:$e(H.Action),title:m.ACTIONS,badge:p,badgeTooltip:h,loading:r})),e.createElement(ke,{$maxHeight:t},e.createElement(Ce,{columns:Fi,rows:u})),!d.length&&e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(De,null)))},Mi=d(le)`
31
31
  // width: 100vw;
32
32
  // height: 100vh;
33
33
  gap: 64px;
34
34
  align-items: center;
35
35
  justify-content: center;
36
- `,qn=p(se)`
36
+ `,Ri=d(le)`
37
37
  max-width: 400px;
38
38
  gap: 12px;
39
39
  align-items: center;
40
40
  justify-content: center;
41
- `,Hn=p(P)`
41
+ `,Li=d(R)`
42
42
  text-align: center;
43
43
  font-size: 24px;
44
- `,zn=p(P)`
44
+ `,Pi=d(R)`
45
45
  text-align: center;
46
46
  line-height: 26px;
47
47
  color: ${({theme:e})=>e.text.info};
48
- `,Vn=()=>{const[i,o]=n(0);return a(()=>{(async()=>{for(let e=0;e<=100;e+=5)await Ae(500),o(e)})()},[]),e(Kn,{children:[t(Oi,{size:100}),t(Ee,{width:400}),e(qn,{children:[e(pe,{$gap:16,children:[t(Hn,{children:"Preparing your workspace..."}),t(Oe,{label:`${i}%`})]}),t(zn,{children:"It can take up to a few minutes. Grab a cup of coffee, look out a window, and enjoy your free moment!"})]})]})},Bn=p(se)`
48
+ `,ji=()=>{const[i,n]=t(0);return a(()=>{(async()=>{for(let e=0;e<=100;e+=5)await Ee(500),n(e)})()},[]),e.createElement(Mi,null,e.createElement(Da,{size:100}),e.createElement(Te,{width:400}),e.createElement(Ri,null,e.createElement(de,{$gap:16},e.createElement(Li,null,"Preparing your workspace..."),e.createElement(Ne,{label:`${i}%`})),e.createElement(Pi,null,"It can take up to a few minutes. Grab a cup of coffee, look out a window, and enjoy your free moment!")))},Ki=d(le)`
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+F["030"]};
64
+ background-color: ${({theme:e})=>e.colors.dropdown_bg_2+E.opacity.hex["030"]};
65
65
  }
66
- `,Wn=({entityType:i,description:n})=>{const{setCurrentModal:a}=Q();return e(Bn,{onClick:()=>a(i),children:[e(pe,{$gap:4,children:[t(Ai,{}),e(P,{size:14,weight:600,family:"secondary",decoration:"underline",children:["Add ",i]})]}),t(P,{size:12,align:"center",children:n})]})},_n=p.div`
66
+ `,Vi=({entityType:t,description:a})=>{const{setCurrentModal:i}=X();return e.createElement(Ki,{onClick:()=>i(t)},e.createElement(de,{$gap:4},e.createElement(Ta,null),e.createElement(R,{size:14,weight:600,family:"secondary",decoration:"underline"},"Add ",t)),e.createElement(R,{size:12,align:"center"},a))},qi=d.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
- `,Jn=p(pe)`
74
+ `,Hi=d(de)`
75
75
  margin-left: ${({$marginLeft:e})=>e};
76
- `,Un=p(Ie)`
76
+ `,zi=d(Ae)`
77
77
  width: 24px;
78
78
  height: 24px;
79
79
  padding: 0;
80
- `,Yn=p.div`
80
+ `,Bi=d.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
- `,Gn=({entityType:i,badge:n,badgeTooltip:a,isLoading:o,refetch:r,partiallySelected:l,allSelected:s,onSelectAll:c,progressPercent:d})=>{const u=m(),{setCurrentModal:p}=Q(),h=we(i);return e(_n,{children:[c&&t(Jn,{$marginLeft:"28px",children:t(S,{partiallyChecked:l,value:s,onChange:c})}),t(Jn,{$marginLeft:i===B.Source?"0":"28px",children:t(Ce,{icon:h,title:`${i}s`,badge:n,badgeTooltip:a,loading:!1})}),e(Jn,{$marginLeft:"auto",children:[t(Un,{"data-id":`refresh-${i}`,variant:"secondary",onClick:r,disabled:o,children:o?t(Fe,{scale:.8}):t(Fi,{fill:u.colors.secondary,size:18})}),t(Un,{"data-id":`add-${i}`,variant:"primary",onClick:()=>p(i),children:t(Ai,{fill:u.colors.primary,size:18})})]}),"number"==typeof d&&t(Yn,{percent:d})]})},Xn=p.div`
89
+ `,Wi=({entityType:t,badge:a,badgeTooltip:i,isLoading:n,refetch:o,partiallySelected:l,allSelected:r,onSelectAll:s,progressPercent:c})=>{const d=p(),{setCurrentModal:u}=X(),m=$e(t);return e.createElement(qi,null,s&&e.createElement(Hi,{$marginLeft:"28px"},e.createElement(f,{partiallyChecked:l,value:r,onChange:s})),e.createElement(Hi,{$marginLeft:t===H.Source?"0":"28px"},e.createElement(Se,{icon:m,title:`${t}s`,badge:a,badgeTooltip:i,loading:!1})),e.createElement(Hi,{$marginLeft:"auto"},e.createElement(zi,{"data-id":`refresh-${t}`,variant:"secondary",onClick:o,disabled:n},n?e.createElement(Oe,{scale:.8}):e.createElement(Na,{fill:d.colors.secondary,size:18})),e.createElement(zi,{"data-id":`add-${t}`,variant:"primary",onClick:()=>u(t)},e.createElement(Ta,{fill:d.colors.primary,size:18}))),"number"==typeof c&&e.createElement(Bi,{percent:c}))},_i=d.div`
90
90
  padding: 2px 6px;
91
91
  background-color: ${({theme:e})=>e.colors.primary};
92
92
  border-radius: 360px;
@@ -101,7 +101,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
101
101
  align-items: center;
102
102
  justify-content: center;
103
103
  white-space: nowrap;
104
- `,Zn=({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}=Me(),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(Re,{"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(Fe,{scale:.8}):n?t(n,{size:14}):null;return c?e(Xn,{$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)}}})},Qn=p.div`
104
+ `,Ji=({entityId:t,entityType:a,status:i,faded:n,title:o,subTitle:l,tooltip:r,label:s,icon:c,icons:d,iconSrc:u,iconSrcs:m,monitors:h,isActive:g,raw:y})=>{const v=p(),b=a===H.Source,f="boolean"==typeof g,{setDrawerType:x,setDrawerEntityId:S}=L(),{selectedSources:$,setSelectedSources:k}=Fe(),C={...$},{namespace:w,name:D,kind:T}=y;b&&!C[w]&&(C[w]=[]);const N=b?C[w].findIndex(e=>e.name===D&&e.kind===T):-1;return e.createElement(Ie,{"data-id":a===H.Source?`${t.namespace}-${t.name}-${t.kind}`:t,title:o,subTitle:l,onClick:()=>{x(a),S(t)},renderActions:()=>{const t=b&&(!y.conditions?.length||y.conditions?.some(({status:e})=>"loading"===e)),a=f&&!g?me(ae.Info,v):i?me(i,v):void 0,n=t?e.createElement(Oe,{scale:.8}):a?e.createElement(a,{size:14}):null;return s?e.createElement(_i,{$isError:i===ae.Error},e.createElement(pe,{text:r||"Heads up! The data-flow metrics you see are calculated over 10-second intervals."},s),n):n||null},iconProps:{icon:c,icons:d,iconSrc:u,iconSrcs:m},visualProps:{status:i,faded:n||f&&!g,monitors:h||void 0},checkboxProps:{withCheckbox:b,isChecked:-1!==N,onCheckboxChange:()=>{-1===N?C[w].push(y):C[w].splice(N,1),k(C)}}})},Ui=d.div`
105
105
  height: calc(${({$height:e})=>e}px - 24px);
106
106
  width: calc(100% - 24px);
107
107
  padding: 12px;
@@ -109,7 +109,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
109
109
  border: 1px dashed ${({theme:e})=>e.colors.border};
110
110
  border-radius: 24px;
111
111
  position: relative;
112
- `,ea=p.div`
112
+ `,Gi=d.div`
113
113
  position: absolute;
114
114
  bottom: 0;
115
115
  left: 0;
@@ -124,21 +124,23 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
124
124
  justify-content: center;
125
125
 
126
126
  pointer-events: none;
127
- `,ta=({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:ze(t.containers),icon:we(e)};case B.Destination:return He(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(Zn,{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(Qn,{$height:i,children:[t(Ke,{containerHeight:i-24,elementHeight:80,elements:l}),t(ea,{$hide:!0})]})},ia=p.div`
127
+ `,Yi=({height:t,entityType:a,entities:i,metrics:n,isVm:o})=>{const r=l(()=>i.map(t=>{const i=W(t);if(!i)return null;const l=[H.Source,H.Destination].includes(a),r=[H.Destination,H.Action].includes(a),s=[H.Destination,H.Action,H.InstrumentationRule].includes(a),c=r?a==H.Destination?Me(t.exportedSignals):t.signals:void 0,d=l?n?.[`${a.toLowerCase()}s`]?.find(e=>JSON.stringify(W(e))===JSON.stringify(i)):void 0,u=s?!t.disabled:void 0,p=ve(t,a,{extended:a===H.Source,prioritizeDisplayName:a!==H.Source}),m=((e,t,a)=>{switch(e){case H.Source:return a?`${t.kind}`:`${t.namespace} • ${t.kind}`;case H.Destination:return t.destinationType.displayName;case H.Action:case H.InstrumentationRule:return t.type;default:return""}})(a,t,o),h=l?Re(d?.throughput):void 0,{priorotizedStatus:g,hasDisableds:y}=re(t.conditions||[]),{icons:v,icon:b,iconSrc:f}=((e,t)=>{switch(e){case H.Source:return{icons:Ke(t.containers),icon:$e(e)};case H.Destination:return je(t.destinationType.type);case H.Action:return{icon:J(t.type)};case H.InstrumentationRule:return{icon:Pe(t.type)};default:return{icon:$e(e)}}})(a,t),x=a===H.Source?t.podsAgentInjectionStatus:void 0,S=x?(e=>{switch(e){case Ve.Error:return ae.Error;case Ve.Notice:return ae.Warning;case Ve.Waiting:return ae.Info}})(x.status):void 0,$=x&&S?x.message:void 0;return e.createElement(Ji,{key:JSON.stringify(i),entityType:a,entityId:i,raw:t,title:p,subTitle:m,faded:y,status:S||g,tooltip:$,label:h,icons:v,icon:b,iconSrc:f,monitors:c,isActive:u})}),[i,a,n,o]);return e.createElement(Ui,{$height:t},e.createElement(Le,{containerHeight:t-24,elementHeight:80,elements:r}),e.createElement(Gi,{$hide:!0}))},Xi=d.div`
128
128
  width: ${({$isVm:e})=>e?"45vw":"22vw"};
129
+
129
130
  display: flex;
130
131
  flex-direction: column;
131
132
  gap: 12px;
132
- `,na=({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}=Me(),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(ia,{$isVm:d,children:[t(Gn,{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(ta,{height:u,entityType:i,entities:n,metrics:o}):r?t(_e,{size:3}):t(Wn,{entityType:i,description:g.TO_COLLECT_OTEL_DATA})]})},aa=p.div`
133
+ `,Qi=({entityType:t,entities:a,unfilteredCount:i,metrics:n,loading:o,maxHeight:r,isVm:s,refetch:c})=>{const{frameHeight:d,hasFiltersApplied:u,isSources:p}=l(()=>({frameHeight:Math.min(r,80*a.length+12),hasFiltersApplied:a.length!==i,isSources:t===H.Source}),[t,a.length,r,i]),{progress:h}=qe(),g=l(()=>p&&(h[He.Instrumenting]||h[He.Uninstrumenting])?h[He.Instrumenting]?.percentage||h[He.Uninstrumenting]?.percentage||0:void 0,[p,h[He.Instrumenting],h[He.Uninstrumenting]]),{selectedSources:y,setSelectedSources:v}=Fe(),b=l(()=>p?Object.values(y).reduce((e,t)=>e+t.length,0):0,[p,y]);return s&&[H.InstrumentationRule,H.Action].includes(t)?null:e.createElement(Xi,{$isVm:s},e.createElement(Wi,{entityType:t,badge:"number"==typeof g?`${g}%`:u?`${a.length}/${i}`:i,badgeTooltip:u?m.FILTERED_COUNT_TOOLTIP:void 0,isLoading:o,refetch:c,partiallySelected:b>0&&a?.length!==b,allSelected:b>0&&a?.length===b,onSelectAll:p?e=>{if(p)if(e){const e={};a?.forEach(t=>{const{namespace:a}=t;e[a]?e[a].push(t):e[a]=[t]}),v(e)}else v({})}:void 0,progressPercent:g}),a.length?e.createElement(Yi,{height:d,entityType:t,entities:a,metrics:n,isVm:s}):o?e.createElement(ze,{size:3}):e.createElement(Vi,{entityType:t,description:m.TO_COLLECT_OTEL_DATA}))},Zi=d.div`
133
134
  width: 100%;
134
135
  height: ${({$height:e})=>e};
136
+
135
137
  display: flex;
136
138
  justify-content: space-evenly;
137
139
  gap: 24px;
138
- `,oa=({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,O]=n([]),[A,F]=n([]);return a(()=>{D(Xe(C,u))},[C,u]),a(()=>{N(Ze(w,u))},[w,u]),a(()=>{O(ve(f,u))},[f,u]),a(()=>{F(S)},[S]),e(aa,{ref:h,$height:i,children:[t(na,{entityType:B.InstrumentationRule,entities:A,unfilteredCount:S.length,loading:$,maxHeight:m,refetch:d}),t(na,{entityType:B.Source,entities:k,unfilteredCount:C.length,metrics:o,loading:y,maxHeight:m,refetch:r}),t(na,{entityType:B.Action,entities:E,unfilteredCount:f.length,loading:x,maxHeight:m,refetch:c}),t(na,{entityType:B.Destination,entities:T,unfilteredCount:w.length,metrics:o,loading:b,maxHeight:m,refetch:l})]})},ra=p.div`
140
+ `,en=({height:i,metrics:n,refetchSources:o,refetchDestinations:l,refetchActions:r,refetchInstrumentationRules:s})=>{const{isVm:c}=Be(),d=he(),{selectedStreamName:u}=We(),{containerRef:p,containerHeight:m}=_e(),{sources:h,sourcesLoading:g,destinations:y,destinationsLoading:v,actions:b,actionsLoading:f,instrumentationRules:x,instrumentationRulesLoading:S}=z(),[$,k]=t([]),[C,w]=t([]),[D,T]=t([]),[N,E]=t([]);return a(()=>{k(Je(Ue(h,u),d))},[h,u,d]),a(()=>{w(Ge(Ye(y,u),d))},[y,u,d]),a(()=>{T(ge(b,d))},[b,d]),a(()=>{E(x)},[x]),e.createElement(Zi,{ref:p,$height:i},e.createElement(Qi,{entityType:H.InstrumentationRule,entities:N,unfilteredCount:x.length,loading:S,maxHeight:m,isVm:c,refetch:s}),e.createElement(Qi,{entityType:H.Source,entities:$,unfilteredCount:h.length,metrics:n,loading:g,maxHeight:m,isVm:c,refetch:o}),e.createElement(Qi,{entityType:H.Action,entities:D,unfilteredCount:b.length,loading:f,maxHeight:m,isVm:c,refetch:r}),e.createElement(Qi,{entityType:H.Destination,entities:C,unfilteredCount:y.length,metrics:n,loading:v,maxHeight:m,isVm:c,refetch:l}))},tn=d.div`
139
141
  position: relative;
140
142
  max-width: 200px;
141
- `;p.div`
143
+ `;d.div`
142
144
  position: absolute;
143
145
  top: calc(100% + 8px);
144
146
  left: 0;
@@ -149,110 +151,110 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
149
151
  background-color: ${({theme:e})=>e.colors.dropdown_bg};
150
152
  border: ${({theme:e})=>`1px solid ${e.colors.border}`};
151
153
  border-radius: 24px;
152
- `;const la=p.div`
154
+ `;const an=d.div`
153
155
  display: flex;
154
156
  align-items: center;
155
157
  overflow-x: scroll;
156
- `,sa=({onClose:i})=>{const o=m(),{onClickNode:r}=Qe(),{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(()=>Ln({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(la,{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,{})})},ca=({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(ra,{ref:u,children:[t(C,{placeholder:"Search",icon:Ii,value:a,onChange:e=>o(e.target.value.toLowerCase()),onFocus:()=>s(!0)}),c&&!i?t(sa,{onClose:d}):null]})},da=({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})},ua=({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})},pa=({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})},ha=({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})},ma=({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})},ga=({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})},ya=({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})},va=p.div`
158
+ `,nn=({onClose:i})=>{const n=E.useTheme(),{onClickNode:o}=Xe(),{searchText:s}=he(),{selectedStreamName:c}=We(),{sources:d,destinations:u,actions:p,instrumentationRules:m}=z(),{popupRef:h,popupOpen:g,setPopupOpen:y,popupPosition:v,handlePosition:b}=Qe();a(()=>{g||(b(0,50),y(!0))},[g]);const[f,x]=t("all"),{categories:S,searchResults:$}=l(()=>Ai({instrumentationRules:m,sources:Ue(d,c),actions:p,destinations:Ye(u,c),searchText:s,selectedCategory:f}),[m,d,p,u,c,s,f]);return $.length?e.createElement(Ze,{ref:h,isOpen:g,top:v.top,left:v.left,maxWidth:"420px",header:e.createElement(an,null,S.map(({category:t,label:a,count:i})=>!!i&&e.createElement(et,{key:`category-select-${t}`,label:a,badgeLabel:i,isSelected:f===t,onClick:()=>x(t)})))},$.map(({category:t,label:a,entities:l},s)=>!!l.length&&e.createElement(r,{key:`category-list-${t}`},e.createElement(tt,{style:{maxHeight:"all"!==f?"240px":"140px",padding:"12px 0"}},e.createElement(R,{size:12,family:"secondary",color:n.text.darker_grey,style:{marginLeft:"16px"}},a),l.map((a,n)=>e.createElement(et,{key:`entity-${s}-${n}`,icon:$e(t),label:ve(a,t,{extended:!0}),onClick:()=>{const e=W(a);o(null,{data:{type:t,id:e}}),i()},style:{width:"100%",justifyContent:"flex-start"},color:"transparent"}))),e.createElement(oe,{thickness:s===$.length-1?0:1,length:"90%",margin:"8px auto"})))):e.createElement(Ze,{ref:h,isOpen:g,top:v.top,left:v.left},e.createElement(De,null))},on=({preventPopup:a=!1})=>{const{searchText:i,setSearchText:o}=he(),[l,r]=t(!1),s=!!i||l,c=()=>{o(""),r(!1)},d=n(null);return at(d,c),P({key:"Escape",active:s},c),e.createElement(tn,{ref:d},e.createElement(S,{placeholder:"Search",icon:Ea,value:i,onChange:e=>o(e.target.value.toLowerCase()),onFocus:()=>r(!0)}),s&&!a?e.createElement(nn,{onClose:c}):null)},ln=({sources:t,title:a="Condition",value:i,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t.forEach(({conditions:t})=>{t?.forEach(({type:t,reason:a})=>{e.find(e=>e.id===`${t}#${a}`)||e.push({id:`${t}#${a}`,value:`${it(t)} - ${it(a)}`})})}),e.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[t]);return e.createElement(nt,{disabled:!s?.length,title:a,placeholder:"All",options:s,value:i,onSelect:n,onDeselect:o,...r})},rn=({sources:t,title:a="Error Message",value:i,onSelect:n,onDeselect:o,disabled:r,...s})=>{const c=l(()=>{const e=[];return t.forEach(({conditions:t})=>{ue(t||[]).forEach(({status:t,message:a,reason:i})=>{t!==ae.Error||e.find(e=>e.id===a)||(a?e.find(e=>e.id===a)||e.push({id:a,value:a}):i&&(e.find(e=>e.id===i)||e.push({id:i,value:i})))})}),e},[t]);return e.createElement(nt,{disabled:r||!c?.length,title:a,placeholder:"All",options:c,value:i,onSelect:n,onDeselect:o,...s})},sn=({sources:t,title:a="Programming Language",value:i,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t.forEach(({containers:t})=>{t?.forEach(({language:t})=>{e.find(e=>e.id===t)||e.push({id:t,value:ot[t]||t})})}),e.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[t]);return e.createElement(nt,{disabled:!s?.length,title:a,placeholder:"All",options:s,value:i,onSelect:n,onDeselect:o,...r})},cn=({title:t="Monitors",value:a,onSelect:i,onDeselect:n,...o})=>{const r=l(()=>{const e=[];return lt.forEach(({id:t,value:a})=>{e.find(e=>e.id===t)||e.push({id:t,value:a})}),e},[]);return e.createElement(nt,{disabled:!r?.length,title:t,placeholder:"All",options:r,value:a,onSelect:i,onDeselect:n,...o})},dn=({namespaces:t,title:a="Namespace",value:i,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t?.forEach(({name:t})=>{e.find(e=>e.id===t)||e.push({id:t,value:t})}),e},[t]);return e.createElement(nt,{disabled:!s?.length,title:a,placeholder:"Select namespace",options:s,value:i,onSelect:n,onDeselect:o,...r})},un=({sources:t,title:a="Kind",value:i,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t.forEach(({kind:t})=>{e.find(e=>e.id===t)||e.push({id:t,value:t})}),e},[t]);return e.createElement(nt,{disabled:!s?.length,title:a,placeholder:"All",options:s,value:i,onSelect:n,onDeselect:o,...r})},pn=({sources:t,title:a="Agent Injection Status",value:i,onSelect:n,onDeselect:o,disabled:r,...s})=>{const c=l(()=>{const e=[];return t.forEach(({podsAgentInjectionStatus:t})=>{const{reasonEnum:a,message:i}=t||{};a?e.find(e=>e.id===a)||e.push({id:a,value:it(a)}):i&&(e.find(e=>e.id===i)||e.push({id:i,value:i}))}),e},[t]);return e.createElement(nt,{disabled:r||!c?.length,title:a,placeholder:"All",options:c,value:i,onSelect:n,onDeselect:o,...s})},mn=d.div`
157
159
  display: flex;
158
160
  flex-direction: column;
159
161
  gap: 12px;
160
162
  padding: 12px;
161
- `,ba=p.div`
163
+ `,hn=d.div`
162
164
  padding: 12px 6px 6px 6px;
163
- `,fa=p(Ie)`
165
+ `,gn=d(Ae)`
164
166
  font-size: 14px;
165
167
  ${({$color:e})=>`color: ${e};`}
166
- `,xa=p.div`
168
+ `,yn=d.div`
167
169
  margin-left: auto;
168
- `,Sa=e=>{let t=0;return Object.values(e).forEach(e=>{e&&Array.isArray(e)&&e.length>0&&(t+=e.length)}),e.onlyErrors&&t++,e.searchText&&t++,t},$a=()=>{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:O}=ye(),A=s(()=>Ye(l,c),[l,c]),[F,I]=n({namespaces:f,kinds:x,monitors:S,languages:$,conditions:C,errors:w,onlyErrors:k,podsAgentInjectionStatus:D}),[M,R]=n(Sa(F));a(()=>{const e=d(ct.OVERVIEW_FILTERS,O());N(e)},[]),a(()=>{if(!g){const e={namespaces:f,kinds:x,monitors:S,languages:$,conditions:C,errors:w,onlyErrors:k};I(e),R(Sa(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(ra,{ref:P,children:[t(nt,{label:"Filters",icon:Mi,badgeLabel:M,badgeFilled:!!M,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(fa,{variant:"primary",onClick:()=>{u(ct.OVERVIEW_FILTERS,F),N(F),R(Sa(F)),y(!1)},children:"Apply"}),t(fa,{variant:"secondary",onClick:L,children:"Cancel"}),t(xa,{children:t(fa,{variant:"tertiary",onClick:()=>{p(ct.OVERVIEW_FILTERS),E(),I(O()),R(0),y(!1)},$color:i.text.error,children:"Reset"})})]}),children:e(va,{children:[t(ma,{namespaces:o,value:F.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(ga,{sources:A,value:F.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(pa,{sources:A,value:F.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(ha,{value:F.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(da,{sources:A,value:F.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(ya,{sources:A,value:F.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(ba,{children:t(T,{title:"Show only sources with errors",initialValue:F.onlyErrors,onChange:e=>I(t=>({...t,errors:[],onlyErrors:e}))})}),t(ua,{sources:A,value:F.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:!F.onlyErrors,showSearch:!0,required:!0,isMulti:!0})]})})]})},Ca=p.div`
170
+ `,vn=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},bn=()=>{const i=E.useTheme(),{isVm:o}=Be(),{namespaces:r,sources:s}=z(),{selectedStreamName:c}=We(),{getItemSS:d,setItemSS:u,removeItemSS:p}=st(),{popupRef:m,popupOpen:h,setPopupOpen:g,popupPosition:y,handlePosition:v}=Qe(),{namespaces:b,kinds:f,monitors:x,languages:S,conditions:$,errors:k,onlyErrors:C,podsAgentInjectionStatus:D,setAll:T,clearAll:N,getEmptyState:O}=he(),A=l(()=>Ue(s,c),[s,c]),[F,I]=t({namespaces:b,kinds:f,monitors:x,languages:S,conditions:$,errors:k,onlyErrors:C,podsAgentInjectionStatus:D}),[M,R]=t(vn(F));a(()=>{const e=d(rt.OVERVIEW_FILTERS,O());T(e)},[]),a(()=>{if(!h){const e={namespaces:b,kinds:f,monitors:x,languages:S,conditions:$,errors:k,onlyErrors:C};I(e),R(vn(e))}},[h,b,f,x,S,$,k,C]);const L=()=>{g(!1)},j=n(null);return at(j,L),P({key:"Escape",active:h},L),e.createElement(tn,{ref:j},e.createElement(et,{label:"Filters",icon:Oa,badgeLabel:M,badgeFilled:!!M,withBorder:!0,color:"transparent",onClick:()=>{v(0,50),g(!0)}}),e.createElement(Ze,{ref:m,isOpen:h,top:y.top,left:y.left,width:"420px",footer:e.createElement(de,null,e.createElement(gn,{variant:"primary",onClick:()=>{u(rt.OVERVIEW_FILTERS,F),T(F),R(vn(F)),g(!1)}},"Apply"),e.createElement(gn,{variant:"secondary",onClick:L},"Cancel"),e.createElement(yn,null,e.createElement(gn,{variant:"tertiary",onClick:()=>{p(rt.OVERVIEW_FILTERS),N(),I(O()),R(0),g(!1)},$color:i.text.error},"Reset")))},e.createElement(mn,null,!o&&e.createElement(dn,{namespaces:r,value:F.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}),e.createElement(un,{sources:A,value:F.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}),e.createElement(sn,{sources:A,value:F.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}),e.createElement(cn,{value:F.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}),e.createElement(ln,{sources:A,value:F.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}),e.createElement(pn,{sources:A,value:F.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}),e.createElement(hn,null,e.createElement(w,{title:"Show only sources with errors",initialValue:F.onlyErrors,onChange:e=>I(t=>({...t,errors:[],onlyErrors:e}))})),e.createElement(rn,{sources:A,value:F.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:!F.onlyErrors,showSearch:!0,required:!0,isMulti:!0}))))},fn=d.div`
169
171
  display: flex;
170
172
  flex-direction: column;
171
173
  gap: 24px;
172
174
  padding: 4px;
173
- `,wa=({formData:i,handleFormChange:n,formErrors:a})=>{const{dataStreams:o,selectedStreamName:r}=Je(),l=s(()=>o.find(e=>e.name===i.name&&e.name!==r),[o,i.name,r]);return e(Ca,{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}),l&&t(ie,{type:ne.Warning,message:g.DATA_STREAM_EXISTS_WARNING(r,l.name)})]})},ka=p.div`
175
+ `,xn=({formData:t,handleFormChange:a,formErrors:i})=>{const{dataStreams:n,selectedStreamName:o}=We(),r=l(()=>n.find(e=>e.name===t.name&&e.name!==o),[n,t.name,o]);return e.createElement(fn,null,e.createElement(S,{name:"name",title:m.STREAM_NAME,placeholder:m.NAME_YOUR_STREAM_PLACEHOLDER,required:!0,value:t.name,onChange:({target:{value:e}})=>a("name",e),errorMessage:i.name}),r&&e.createElement(te,{type:ae.Warning,message:m.DATA_STREAM_EXISTS_WARNING(o,r.name)}))},Sn=d.div`
174
176
  width: 100%;
175
177
  height: 100%;
176
178
  max-height: calc(100vh - 220px);
177
179
  overflow: overlay;
178
180
  overflow-y: auto;
179
- `,Da=({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(Dn,{ref:c,title:f.name,icons:[Ri],hideEditTitleFromEdit:!0,isEdit:!0,isFormDirty:u,onSave:()=>{y({withAlert:!0,alertTitle:Z.Update})&&(o(a,h),p(!1),i())},onCancel:()=>{v(),p(!1),i()},children:t(ka,{children:t(wa,{formData:h,handleFormChange:x,formErrors:g})})}):null},Ta=p.div`
181
+ `,$n=({isOpen:a,onClose:i,dataStreamName:o,updateDataStream:r})=>{const{dataStreams:c}=We(),d=n(null),[u,p]=t(!1),{formData:m,handleFormChange:h,formErrors:g,validateForm:y,resetFormData:v,loadFormWithDrawerItem:b}=ct({name:o}),f=l(()=>{if(!a)return v();const e=c?.find(e=>e.name===o);return e?b(e):v(),e},[a,c,o]),x=s((e,t)=>{h(e,t),p(!0)},[h]);return f?e.createElement(Si,{ref:d,title:f.name,icons:[Aa],hideEditTitleFromEdit:!0,isEdit:!0,isFormDirty:u,onSave:()=>{y({withAlert:!0,alertTitle:Y.Update})&&(r(o,m),p(!1),i())},onCancel:()=>{v(),p(!1),i()}},e.createElement(Sn,null,e.createElement(xn,{formData:m,handleFormChange:x,formErrors:g}))):null},kn=d.div`
180
182
  position: relative;
181
- `,Na=p(pe)`
183
+ `,Cn=d(de)`
182
184
  border: 1px solid ${({theme:e})=>e.colors.border};
183
185
  border-radius: 32px;
184
186
 
185
187
  & button {
186
188
  max-height: 28px;
187
189
  }
188
- `,Ea=p(P)`
190
+ `,wn=d(R)`
189
191
  text-wrap: nowrap;
190
- `,Oa=p(it)`
192
+ `,Dn=d(tt)`
191
193
  max-height: 240px;
192
194
  padding: 0px !important;
193
- `,Aa=p(pe)`
195
+ `,Tn=d(de)`
194
196
  width: 100%;
195
- `,Fa=p.div`
197
+ `,Nn=d.div`
196
198
  width: 100%;
197
- `,Ia=({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(Aa,{children:[t(Fa,{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(Ei,{})}),t(mt,{onClick:()=>x(i),tooltip:q.EDIT,children:t(Ni,{})})]},`stream-${i}`)),[y,v,w]);return e(i,{children:[e(Ta,{children:[e(Na,{$gap:0,children:[e(Ie,{variant:"tertiary",onClick:()=>{g(0,50),p(e=>!e)},children:[t(Ri,{fill:l.text.info}),e(Ea,{children:["Data Stream: ",v]}),t(gt,{extend:u}),t(Oe,{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:Ii,value:w,onChange:e=>k(e.target.value)}),children:t(Oa,{children:D})})]}),t(z,{isOpen:""!==S,name:S,onApprove:()=>{r(S),$("")},onDeny:()=>{$("")}}),t(Da,{isOpen:""!==f,onClose:()=>{x("")},dataStreamName:f,updateDataStream:o})]})},Ma=p.div`
199
+ `,En=({onClickNewDataStream:a,updateDataStream:i,deleteDataStream:n})=>{const o=E.useTheme(),{clearStore:r}=dt(),{popupRef:s,popupOpen:c,setPopupOpen:d,popupPosition:u,handlePosition:p}=Qe(),{dataStreams:m,selectedStreamName:h,setSelectedStreamName:g}=We(),[y,v]=t(""),[b,f]=t(""),[x,$]=t(""),k=l(()=>m.filter(({name:e})=>!x||e.toLowerCase().includes(x.toLowerCase())).map(({name:t})=>e.createElement(Tn,{key:`stream-${t}`},e.createElement(Nn,null,e.createElement(et,{label:t,isSelected:h===t,onClick:()=>{r(),g(t),d(!1)},color:"transparent",style:{width:"100%",justifyContent:"flex-start"}})),t!==ut&&e.createElement(pt,{onClick:()=>f(t),tooltip:j.DELETE},e.createElement(wa,null)),e.createElement(pt,{onClick:()=>v(t),tooltip:j.EDIT},e.createElement(Ca,null)))),[m,h,x]);return e.createElement(e.Fragment,null,e.createElement(kn,null,e.createElement(Cn,{$gap:0},e.createElement(Ae,{variant:"tertiary",onClick:()=>{p(0,50),d(e=>!e)}},e.createElement(Aa,{fill:o.text.info}),e.createElement(wn,null,"Data Stream: ",h),e.createElement(mt,{extend:c}),e.createElement(Ne,{label:m.length})),e.createElement(oe,{orientation:"vertical",length:"32px",thickness:2,margin:"0"}),e.createElement(ht,{onClick:()=>{r(),a()},label:j.NEW})),e.createElement(Ze,{ref:s,isOpen:c,top:u.top,left:u.left,header:e.createElement(S,{placeholder:"Search...",icon:Ea,value:x,onChange:e=>$(e.target.value)})},e.createElement(Dn,null,k))),e.createElement(V,{isOpen:""!==b,name:b,onApprove:()=>{n(b),f("")},onDeny:()=>{f("")}}),e.createElement($n,{isOpen:""!==y,onClose:()=>{v("")},dataStreamName:y,updateDataStream:i}))},On=d.div`
198
200
  display: flex;
199
201
  align-items: center;
200
202
  margin: 20px 0;
201
203
  padding: 0 16px;
202
204
  gap: 8px;
203
- `,Ra=p.div`
205
+ `,An=d.div`
204
206
  margin-left: auto;
205
- `,La=({addEntity:i,preventSearchPopup:n,onClickNewDataStream:a,updateDataStream:o,deleteDataStream:r})=>{const{isVm:l}=Le(),{setCurrentModal:s}=Q();return e(Ma,{children:[!l&&t(Ia,{onClickNewDataStream:a,updateDataStream:o,deleteDataStream:r}),t(ca,{preventPopup:n}),t($a,{}),i&&t(Ra,{children:t(yt,{"data-id":`add-${i}`,onClick:()=>s(i),label:`${q.ADD} ${ot(i)}`,variant:"primary",textProps:{weight:900}})})]})},Pa=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(wa,{formData:r,handleFormChange:s,formErrors:c})]})})});Pa.displayName=Pa.name;const ja=({createDataStream:e})=>{const{currentModal:i,setCurrentModal:n}=Q(),{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(Pa,{ref:d,isModal:!0})})},Ka=e=>Object.keys(e).filter(t=>e[t]).join(", "),qa=(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:Ka(a)},{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},Ha=({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 O.Input:return t(C,{...s,onChange:e=>n(o.name,e.target.value),errorMessage:a[o.name]},o.name);case O.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 O.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 O.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 O.TextArea:return t(L,{...s,onChange:e=>n(o.name,e.target.value),errorMessage:a[o.name]},o.name);case O.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}}),za=p(Ie)`
207
+ `,Fn=({addEntity:t,preventSearchPopup:a,onClickNewDataStream:i,updateDataStream:n,deleteDataStream:o})=>{const{setCurrentModal:l}=X();return e.createElement(On,null,e.createElement(En,{onClickNewDataStream:i,updateDataStream:n,deleteDataStream:o}),e.createElement(on,{preventPopup:a}),e.createElement(bn,null),t&&e.createElement(An,null,e.createElement(ht,{"data-id":`add-${t}`,onClick:()=>l(t),label:`${j.ADD} ${it(t)}`,variant:"primary",textProps:{weight:900}})))},In=i(({isModal:t,onClickSummary:a},i)=>{const{selectedStreamName:n}=We(),{formData:l,handleFormChange:r,formErrors:s,validateForm:c}=ct({name:n});return o(i,()=>({validateForm:c,getFormValues:()=>l})),e.createElement(ee,{$isNotModal:!t},e.createElement(le,{$gap:24},a&&e.createElement(gt,{onClick:a}),e.createElement(A,{title:m.NAME_YOUR_STREAM,description:m.STREAM_DESCRIPTION}),e.createElement(xn,{formData:l,handleFormChange:r,formErrors:s})))});In.displayName=In.name;const Mn=({createDataStream:t})=>{const{currentModal:a,setCurrentModal:i}=X(),{addDataStreams:o,setSelectedStreamName:l}=We(),r=a===yt.DataStream,s=()=>i(""),c=async()=>{if(d.current&&d.current.validateForm()){const e=d.current.getFormValues();t?t(e):(o([e]),l(e.name)),s()}},d=n(null);return P({key:"Enter",active:r},c),e.createElement(Q,{isOpen:r,onClose:s,header:{title:"Add Data Stream"},actionComponent:e.createElement(Z,{buttons:[{label:"DONE",variant:"primary",onClick:c}]})},e.createElement(In,{ref:d,isModal:!0}))},Rn=e=>Object.keys(e).filter(t=>e[t]).join(", "),Ln=(e,t)=>{const{destinationType:a,disabled:i,exportedSignals:n}=e,o=[{title:m.TYPE,value:a.type},{type:h.ActiveStatus,title:m.STATUS,value:String(!i)},{type:h.Monitors,title:m.MONITORS,value:Rn(n)},{title:m.NAME,value:a.displayName}],l=vt(e,t),r=l.map(e=>({name:e.key,value:e.value}));return l.map(({key:e,name:a,value:i})=>{const{secret:l,componentProperties:s,hideFromReadData:c,customReadDataLabels:d}=t.find(t=>t.name===e)||{};if(!c?.length||!bt(c,Me(n),r)){const{type:e}=ft(s,{type:""}),t=(l||"password"===e)&&i.length?new Array(10).fill("•").join(""):"";o.push({type:h.Divider}),d?.length?d.forEach(({condition:e,...t})=>{e==i&&o.push({title:t.title,value:t.value})}):o.push({title:a,value:t||i})}}),o},Pn=({signals:t,fields:a,onChange:i,formErrors:n})=>a?.map(o=>{const{componentType:l,renderCondition:r,...s}=o;if(r&&!bt(r,t,a))return null;switch(l){case N.Input:return e.createElement(S,{key:o.name,...s,onChange:e=>i(o.name,e.target.value),errorMessage:n[o.name]});case N.Dropdown:return e.createElement(nt,{key:o.name,...s,showSearch:!0,value:{id:s.value||"",value:s.value||""},options:s.options||[],onSelect:e=>i(o.name,e.id),errorMessage:n[o.name]});case N.MultiInput:return e.createElement(T,{key:o.name,...s,value:"string"==typeof s.value?ft(s.value,[]):s.value,onChange:e=>i(o.name,JSON.stringify(e)),errorMessage:n[o.name]});case N.KeyValuePair:return e.createElement(D,{key:o.name,...s,value:"string"==typeof s.value?ft(s.value,[]):s.value,onChange:e=>i(o.name,JSON.stringify(e)),errorMessage:n[o.name]});case N.TextArea:return e.createElement(M,{key:o.name,...s,onChange:e=>i(o.name,e.target.value),errorMessage:n[o.name]});case N.Checkbox:return e.createElement(f,{key:o.name,...s,value:"true"==s.value,onChange:e=>i(o.name,String(e)),errorMessage:n[o.name]});default:return null}}),jn=d(Ae)`
206
208
  display: flex;
207
209
  align-items: center;
208
210
  gap: 8px;
209
211
 
210
- ${({$status:e,theme:t})=>e===ne.Success?h`
212
+ ${({$status:e,theme:t})=>e===ae.Success?u`
211
213
  border-color: transparent;
212
214
  background-color: ${t.colors.success};
213
- `:"error"===e?h`
214
- border-color: transparent;
215
- background-color: ${t.colors.error};
216
- `:h`
217
- background-color: transparent;
218
- `}
219
- `,Va=({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(za,{$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(Fe,{}):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"})]})},Ba=p(se)`
215
+ `:"error"===e?u`
216
+ border-color: transparent;
217
+ background-color: ${t.colors.error};
218
+ `:u`
219
+ background-color: transparent;
220
+ `}
221
+ `,Kn=({destination:a,validateForm:i,status:n,testConnection:o,onSuccess:l,onError:r})=>{const s=E.useTheme(),{selectedStreamName:c}=We(),[d,u]=t(!1),p=n?me(n,s):void 0;return e.createElement(jn,{$status:n,variant:"secondary",onClick:async()=>{if(i()){u(!0);const e=await o({...a,currentStreamName:c});e&&(e.succeeded?l(e):r(e)),u(!1)}}},d?e.createElement(Oe,null):p?e.createElement(p,null):null,e.createElement(R,{family:"secondary",decoration:"underline",size:14,color:n?s.text[n]:void 0},d?"Checking":n===ae.Success?"Connection OK":"error"===n?"Connection Failed":"Test Connection"))},Vn=d(le)`
220
222
  align-items: unset;
221
223
  padding: 0 4px;
222
- `,Wa=p.div`
224
+ `,qn=d.div`
223
225
  display: flex;
224
226
  flex-direction: column;
225
227
  gap: 12px;
226
- `,_a=p(pe)`
228
+ `,Hn=d(de)`
227
229
  justify-content: space-between;
228
- `,Ja=p(P)`
230
+ `,zn=d(R)`
229
231
  margin-bottom: 12px;
230
- `,Ua=({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 O=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(Ba,{$gap:24,children:[e(Ba,{$gap:12,children:[t(I,{title:i?"Update destination":"Create destination",description:`Connect ${b} with Odigos.`,actionButton:x&&t(Va,{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(Wa,{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(_a,{children:[t(R,{title:i?"":"This connection will monitor:",required:!0,allowedSignals:O,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(M,{endpoint:`/backends/${v}`})]}),i&&e("div",{children:[t(Ja,{children:"Status"}),t(A,{options:[{icon:Di,label:g.ENABLED,value:!1,selectedBgColor:S.text.success+F["050"]},{icon:Ti,label:g.DISABLED,value:!0,selectedBgColor:S.text.error+F["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(Ha,{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})]})},Ya=p.div`
232
+ `,Bn=({isUpdate:i,categoryItem:o,formData:r,formErrors:s,validateForm:c,handleFormChange:d,dynamicFields:u,setDynamicFields:p,testConnection:h})=>{const{type:g,displayName:y,supportedSignals:v,testConnectionSupported:b}=o||{},f=E.useTheme(),[x,$]=t(!1),[k,C]=t(!1),[w,D]=t(void 0),T=n(!1);a(()=>{if(u.length&&!T.current){T.current=!0;let e=!1;for(let t=0;t<u.length;t++){const{required:a,value:i}=u[t];if(a){if([void 0,null,""].includes(i)){e=!1;break}e=!0}}$(e)}},[u,k]);const N=l(()=>{const{logs:e,metrics:t,traces:a}=v||{},i=[];return e?.supported&&i.push(xt.Logs),t?.supported&&i.push(xt.Metrics),a?.supported&&i.push(xt.Traces),i},[v]),M=l(()=>{const{logs:e,metrics:t,traces:a}=r.exportedSignals||{},i=[];return e&&i.push(xt.Logs),t&&i.push(xt.Metrics),a&&i.push(xt.Traces),i},[r.exportedSignals]),R=()=>{$(!1),C(!0),D(void 0)};return e.createElement(Vn,{$gap:24},e.createElement(Vn,{$gap:12},e.createElement(A,{title:i?"Update destination":"Create destination",description:`Connect ${y} with Odigos.`,actionButton:b&&e.createElement(Kn,{destination:r,validateForm:c,status:w?.type,testConnection:h,onError:e=>{C(!1),D({type:ae.Error,title:e?.reason||"Connection failed",message:e?.message||"Please check your input and try again."})},onSuccess:e=>{C(!1),D({type:ae.Success,title:e?.reason||"Connection succeeded",message:e?.message||""})}})}),e.createElement(qn,null,b&&w&&e.createElement(te,{type:w.type,title:w.title,message:w.message}),x&&!w&&!i&&e.createElement(te,{type:ae.Default,message:`Odigos autocompleted ${y} destination details.`})),e.createElement(oe,null)),e.createElement(Hn,null,e.createElement(I,{title:i?"":"This connection will monitor:",required:!0,allowedSignals:N,selectedSignals:M,setSelectedSignals:e=>{R(),d("exportedSignals",{logs:e.includes(xt.Logs),metrics:e.includes(xt.Metrics),traces:e.includes(xt.Traces)})},errorMessage:s.exportedSignals}),!i&&e.createElement(F,{endpoint:`/backends/${g}`})),i&&e.createElement("div",null,e.createElement(zn,null,"Status"),e.createElement(O,{options:[{icon:$a,label:m.ENABLED,value:!1,selectedBgColor:f.text.success+E.opacity.hex["050"]},{icon:ka,label:m.DISABLED,value:!0,selectedBgColor:f.text.error+E.opacity.hex["050"]}],selected:r.disabled,setSelected:e=>d("disabled",e)})),!i&&e.createElement(S,{title:"Destination name",placeholder:"Enter destination name",value:r.name,onChange:e=>{R(),d("name",e.target.value)},errorMessage:s.name}),e.createElement(Pn,{signals:M,fields:u,onChange:(e,t)=>{R(),p(a=>{const i=[...a],n=i.findIndex(t=>t.name===e);return-1!==n&&(i[n]={...i[n],value:t}),i})},formErrors:s}))},Wn=d.div`
231
233
  width: 100%;
232
234
  height: 100%;
233
235
  max-height: calc(100vh - 220px);
234
236
  overflow: overlay;
235
237
  overflow-y: auto;
236
- `,Ga=p.div`
238
+ `,_n=d.div`
237
239
  display: flex;
238
240
  flex-direction: column;
239
241
  gap: 12px;
240
- `,Xa=({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:O,setDynamicFields:A}=Ct({}),F=s(()=>{if(h)return m?.find(e=>J(e)===h)},[h,m]);if(a(()=>{v&&F?(E(wt(i,F)),T(F)):k()},[v,F,i]),!F)return null;const I=i.flatMap(e=>e.items).find(e=>e.type===F.destinationType.type),{icon:M,iconSrc:R}=I?He(I?.type):{icon:void 0,iconSrc:void 0};return t(Dn,{ref:y,title:F.name||F.destinationType.displayName,icons:M?[M]:void 0,iconSrcs:R?[R]:void 0,isEdit:b,isFormDirty:x,onEdit:e=>{f("boolean"!=typeof e||e)},onSave:async e=>{if(D({withAlert:!0,alertTitle:Z.Update})){const t=e!==F.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(F)},isLastItem:1===m.length,children:b?t(Ya,{children:t(Ua,{isUpdate:!0,categoryItem:I,formData:$,formErrors:C,handleFormChange:(...e)=>{S(!0),w(...e)},dynamicFields:O,setDynamicFields:(...e)=>{S(!0),A(...e)},validateForm:D,testConnection:c})}):e(Ga,{children:[F.conditions?.length?t(Y,{conditions:F.conditions}):null,t(G,{title:g.DESTINATION_DETAILS,data:F?qa(F,N):[]})]})})},Za=p.div`
242
+ `,Jn=({categories:i,updateDestination:o,deleteDestination:r,testConnection:s})=>{const{destinations:c}=z(),{selectedStreamName:d}=We(),{drawerType:u,drawerEntityId:p}=L(),h=l(()=>Ye(c,d),[c,d]),g=n(null),y=u===H.Destination,[v,b]=t(!1),[f,x]=t(!1),{formData:S,formErrors:$,handleFormChange:k,resetFormData:C,validateForm:w,loadFormWithDrawerItem:D,yamlFields:T,setYamlFields:N,dynamicFields:E,setDynamicFields:O}=St({}),A=l(()=>{if(p)return h?.find(e=>W(e)===p)},[p,h]);if(a(()=>{y&&A?(N($t(i,A)),D(A)):C()},[y,A,i]),!A)return null;const F=i.flatMap(e=>e.items).find(e=>e.type===A.destinationType.type),{icon:I,iconSrc:M}=F?je(F?.type):{icon:void 0,iconSrc:void 0};return e.createElement(Si,{ref:g,title:A.name||A.destinationType.displayName,icons:I?[I]:void 0,iconSrcs:M?[M]:void 0,isEdit:v,isFormDirty:f,onEdit:e=>{b("boolean"!=typeof e||e)},onSave:async e=>{if(w({withAlert:!0,alertTitle:Y.Update})){const t=e!==A.destinationType.displayName?e:"";k("name",t),o(p,{...S,name:t}),b(!1),x(!1)}},onDelete:async()=>{r(p),b(!1),x(!1),g.current?.closeDrawer()},onCancel:()=>{b(!1),x(!1),D(A)},isLastItem:1===h.length},v?e.createElement(Wn,null,e.createElement(Bn,{isUpdate:!0,categoryItem:F,formData:S,formErrors:$,handleFormChange:(...e)=>{x(!0),k(...e)},dynamicFields:E,setDynamicFields:(...e)=>{x(!0),O(...e)},validateForm:w,testConnection:s})):e.createElement(_n,null,A.conditions?.length?e.createElement(U,{conditions:A.conditions}):null,e.createElement(G,{title:m.DESTINATION_DETAILS,data:A?Ln(A,T):[]})))},Un=d.div`
241
243
  display: flex;
242
244
  flex-direction: column;
243
245
  gap: 12px;
244
- `,Qa=({items:i,onSelectNew:n,onSelectConfigured:a,isLoadingForDestinationIds:o})=>{const{configuredDestinationsUpdateOnly:r}=pt();return i.map(i=>{const l=i.name===Dt.EXISTS.TITLE;return e(Za,{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=Object.keys(e.supportedSignals).filter(t=>e.supportedSignals[t].supported),{icon:d,iconSrc:u}=He(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(Re,{"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}`)})},eo=p.div`
246
+ `,Gn=({items:t,onSelectNew:a,onSelectConfigured:i,isLoadingForDestinationIds:n})=>{const{configuredDestinationsUpdateOnly:o}=dt();return t.map(t=>{const l=t.name===Ct.EXISTS.TITLE;return e.createElement(Un,{key:`category-${t.name}`},e.createElement(A,{size:"small",icon:t.icon,title:kt(t.name),description:t.description}),t.items.map(r=>{const s=`select-${t.name.replaceAll(" ","")}-destination-${r.type}`,c=Object.keys(r.supportedSignals).filter(e=>r.supportedSignals[e].supported),{icon:d,iconSrc:u}=je(r.type),p=r.selected||o.some(e=>e.id===r.id),m=!!n.find(e=>e===r.id),h=l?()=>i(r.id):()=>a(r);return e.createElement(Ie,{key:s,"data-id":s,title:r.displayName,hoverText:j.SELECT,onClick:h,iconProps:{icon:d,iconSrc:u},visualProps:{monitors:c,monitorsWithLabels:!0},checkboxProps:{withCheckbox:l,isChecked:p,isLoading:m,onCheckboxChange:()=>i(r.id)}})}))})},Yn=d.div`
245
247
  display: flex;
246
248
  flex-direction: column;
247
249
  gap: 24px;
248
- `,to=p.div`
250
+ `,Xn=d.div`
249
251
  display: flex;
250
252
  align-items: center;
251
253
  gap: 12px;
252
- `,io=p.div`
254
+ `,Qn=d.div`
253
255
  width: 170px;
254
256
  margin-right: 8px;
255
- `,no=p.div`
257
+ `,Zn=d.div`
256
258
  display: flex;
257
259
  flex-direction: column;
258
260
  align-self: stretch;
@@ -263,18 +265,18 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
263
265
  @media (height < 800px) {
264
266
  max-height: calc(100vh - 400px);
265
267
  }
266
- `,ao=p(eo)`
268
+ `,eo=d(Yn)`
267
269
  margin-top: 80px;
268
- `,{MANAGED:oo,SELF_HOSTED:ro,DETECTED:lo,EXISTS:so}=Dt,co=[{value:"All types",id:"all"},{value:oo.TITLE,id:oo.TITLE},{value:ro.TITLE,id:ro.TITLE},{value:lo.TITLE,id:lo.TITLE},{value:so.TITLE,id:so.TITLE}],uo=co[0],po=[$t.Logs,$t.Metrics,$t.Traces],ho=(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:{[$t.Logs]:{supported:e.exportedSignals.logs},[$t.Metrics]:{supported:e.exportedSignals.metrics},[$t.Traces]:{supported:e.exportedSignals.traces}}}}),mo=({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(uo),[b,f]=n(po),x=s(()=>{const e=Tt(a);return e.unshift({name:so.TITLE,description:so.DESCRIPTION,icon:Li,items:ho(d,u,new Set(p.concat(h).map(e=>e.id)))}),e.unshift({name:lo.TITLE,description:lo.DESCRIPTION,icon:Pi,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===e.name,a=b.some(e=>t.supportedSignals[e.toLowerCase()]?.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(eo,{children:[t(I,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e(to,{children:[t(io,{children:t(C,{placeholder:"Search...",icon:Ii,value:m,onChange:({target:{value:e}})=>g(e)})}),t(io,{children:t(rt,{options:co,value:y,onSelect:v,onDeselect:()=>{}})}),t(R,{title:"",selectedSignals:b,setSelectedSignals:f})]}),t(re,{}),x.length?t(no,{children:t(Qa,{items:x,onSelectNew:e=>r(e,b),onSelectConfigured:l,isLoadingForDestinationIds:c})}):t(ao,{children:t(Ne,{title:"No destinations found"})})]})},go=p.div`
270
+ `,{MANAGED:to,SELF_HOSTED:ao,DETECTED:io,EXISTS:no}=Ct,oo=[{value:"All types",id:"all"},{value:to.TITLE,id:to.TITLE},{value:ao.TITLE,id:ao.TITLE},{value:io.TITLE,id:io.TITLE},{value:no.TITLE,id:no.TITLE}],lo=oo[0],ro=[xt.Logs,xt.Metrics,xt.Traces],so=(e,t,a)=>e.map(e=>{const{type:i,displayName:n}=e.destinationType,o=e.dataStreamNames?.includes(t),l=a.has(e.id);return{id:e.id,type:i,displayName:n,selected:o||l,fields:[],testConnectionSupported:!1,supportedSignals:{[xt.Logs]:{supported:e.exportedSignals.logs},[xt.Metrics]:{supported:e.exportedSignals.metrics},[xt.Traces]:{supported:e.exportedSignals.traces}}}}),co=({hidden:a,categories:i,potentialDestinations:n,onSelectNew:o,onSelectConfigured:r,isLoadingForDestinationIds:s})=>{const{destinations:c}=z(),{selectedStreamName:d}=We(),{configuredDestinations:u,configuredDestinationsUpdateOnly:p}=dt(),[m,h]=t(""),[g,y]=t(lo),[v,b]=t(ro),f=l(()=>{const e=wt(i);return e.unshift({name:no.TITLE,description:no.DESCRIPTION,icon:Fa,items:so(c,d,new Set(u.concat(p).map(e=>e.id)))}),e.unshift({name:io.TITLE,description:io.DESCRIPTION,icon:Ia,items:n}),e.map(e=>{const t=e.items.filter(t=>{const a=!m||t.displayName.toLowerCase().includes(m.toLowerCase()),i="all"===g.id||g.id===e.name,n=v.some(e=>t.supportedSignals[e.toLowerCase()]?.supported);return a&&i&&n});return{...e,items:t}}).filter(({items:e})=>!!e.length)},[i,n,c,m,g,v,d,u,p]);return a?null:e.createElement(Yn,null,e.createElement(A,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e.createElement(Xn,null,e.createElement(Qn,null,e.createElement(S,{placeholder:"Search...",icon:Ea,value:m,onChange:({target:{value:e}})=>h(e)})),e.createElement(Qn,null,e.createElement(nt,{options:oo,value:g,onSelect:y,onDeselect:()=>{}})),e.createElement(I,{title:"",selectedSignals:v,setSelectedSignals:b})),e.createElement(oe,null),f.length?e.createElement(Zn,null,e.createElement(Gn,{items:f,onSelectNew:e=>o(e,v),onSelectConfigured:r,isLoadingForDestinationIds:s})):e.createElement(eo,null,e.createElement(De,{title:"No destinations found"})))},uo=d.div`
269
271
  display: flex;
270
- `,yo=p.div`
272
+ `,po=d.div`
271
273
  border-right: 1px solid ${({theme:e})=>e.colors.border};
272
274
  padding: 32px;
273
275
  width: 200px;
274
276
  @media (max-width: 1050px) {
275
277
  display: none;
276
278
  }
277
- `,vo=({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}=Q(),{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:O}=Ct({supportedSignals:x?.supportedSignals,preLoadedFields:x?.fields}),[A,F]=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}}}}},M=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);F(t=>[...t,e.id]),i?await s(e.id):await l(e.id,O(t)),F(t=>t.filter(t=>t!==e.id))}}else r($)},R=()=>{k(),S(void 0),h("")},L=()=>{k(),S(void 0)},P=async()=>{if(x){if(!D({withAlert:!i,alertTitle:Z.Create}))return null;M()}R()};return K({key:"Enter",active:f},()=>P()),t(ee,{isOpen:f,onClose:R,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(ji,{rotate:-90}),variant:"secondary",onClick:L}),e})()}),children:e(go,{children:[t(yo,{children:t(Nt,{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(mo,{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[t].supported).forEach(e=>i[e]=!0),w("exportedSignals",i),T(e?.fields||[]),S(e)},onSelectConfigured:e=>{const t=d.find(t=>t.id===e);t&&M(t)},isLoadingForDestinationIds:A}),x&&t(Ua,{categoryItem:x,formData:$,formErrors:C,handleFormChange:w,dynamicFields:N,setDynamicFields:E,validateForm:D,testConnection:c})]})]})})},bo=p.div`
279
+ `,mo=({isOnboarding:a,categories:i,potentialDestinations:n,createDestination:o,updateDestination:l,deleteDestination:r,testConnection:s})=>{const{destinations:c}=z(),{selectedStreamName:d}=We(),{currentModal:u,setCurrentModal:p}=X(),{addConfiguredDestination:h,addConfiguredDestinationUpdateOnly:g,removeConfiguredDestinationUpdateOnly:y,configuredDestinationsUpdateOnly:v}=dt(),b=u===H.Destination,[f,x]=t(void 0),{formData:S,formErrors:$,handleFormChange:k,resetFormData:C,validateForm:w,setYamlFields:D,dynamicFields:T,setDynamicFields:N,loadFormWithDrawerItem:E}=St({supportedSignals:f?.supportedSignals,preLoadedFields:f?.fields}),[O,A]=t([]),F=e=>{const t={};return e||T.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:f.type,displayName:f.displayName,supportedSignals:{logs:{supported:!1},metrics:{supported:!1},traces:{supported:!1}}}}},I=async e=>{if(a&&!e){const e=F();h(e)}else if(a&&e){const t=F(e);v.some(t=>t.id===e.id)?y(e):g(t)}else if(a||e){if(!a&&e){const t=F(e),a=t.dataStreamNames.some(e=>e===d);A(t=>[...t,e.id]),a?await r(e.id):await l(e.id,E(t)),A(t=>t.filter(t=>t!==e.id))}}else o(S)},M=()=>{C(),x(void 0),p("")},R=()=>{C(),x(void 0)},L=async()=>{if(f){if(!w({withAlert:!a,alertTitle:Y.Create}))return null;I()}M()};return P({key:"Enter",active:b},()=>L()),e.createElement(Q,{isOpen:b,onClose:M,header:{title:m.ADD_DESTINATION},actionComponent:e.createElement(Z,{buttons:(()=>{const t=[{label:"DONE",variant:"primary",onClick:L}];return f&&t.unshift({label:"BACK",icon:()=>e.createElement(Ma,{rotate:-90}),variant:"secondary",onClick:R}),t})()})},e.createElement(uo,null,e.createElement(po,null,e.createElement(Dt,{currentStep:f?2:1,data:[{stepNumber:1,title:m.DESTINATIONS},{stepNumber:2,title:m.CONNECTION}]})),e.createElement(ee,{style:{margin:"32px 24px 12px 24px"}},e.createElement(co,{hidden:void 0!==f,categories:i,potentialDestinations:n,onSelectNew:(e,t)=>{C(),k("type",e?.type||""),k("currentStreamName",d);const a={logs:!1,metrics:!1,traces:!1};t.filter(t=>e.supportedSignals[t].supported).forEach(e=>a[e]=!0),k("exportedSignals",a),D(e?.fields||[]),x(e)},onSelectConfigured:e=>{const t=c.find(t=>t.id===e);t&&I(t)},isLoadingForDestinationIds:O}),f&&e.createElement(Bn,{categoryItem:f,formData:S,formErrors:$,handleFormChange:k,dynamicFields:T,setDynamicFields:N,validateForm:w,testConnection:s}))))},ho=d.div`
278
280
  display: flex;
279
281
  flex-direction: column;
280
282
  align-items: center;
@@ -283,7 +285,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
283
285
  max-height: calc(100vh - 310px);
284
286
  height: fit-content;
285
287
  overflow-y: scroll;
286
- `,fo=({categories:e,withDelete:i})=>{const{configuredDestinations:n,configuredDestinationsUpdateOnly:a}=pt();return n.length||a.length?t(bo,{children:n.concat(a).map((o,r)=>t(xo,{"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"})})},xo=({item:a,yamlFields:o,isLastItem:r,withDelete:l})=>{const[c,d]=n(!1),{icon:u,iconSrc:p}=He(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(Re,{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(Et,{data:g})},renderActions:l?()=>t(mt,{onClick:()=>d(!0),children:t(Ei,{})}):void 0}),l&&t(z,{isOpen:c,name:a.destinationType.displayName||a.name,type:B.Destination,isLastItem:r,onApprove:()=>{a.id?m(a):h(a)},onDeny:()=>d(!1)})]})},So=p(Ie)`
288
+ `,go=({categories:t,withDelete:a})=>{const{configuredDestinations:i,configuredDestinationsUpdateOnly:n}=dt();return i.length||n.length?e.createElement(ho,null,i.concat(n).map((o,l)=>e.createElement(yo,{key:`configured-destination-${o.destinationType.type}-${l}`,"data-id":`configured-destination-${o.destinationType.type}`,item:o,yamlFields:$t(t,o),isLastItem:i.length+n.length===1,withDelete:a}))):e.createElement(we,null,e.createElement(De,{title:"No destinations",subTitle:"Please add a destination"}))},yo=({item:a,yamlFields:i,isLastItem:n,withDelete:o})=>{const[r,s]=t(!1),{icon:c,iconSrc:d}=je(a.destinationType.type),{removeConfiguredDestination:u,removeConfiguredDestinationUpdateOnly:p}=dt(),m=l(()=>vt(a,i).map(e=>({title:e.name,value:e.value})),[a,i]);return e.createElement(e.Fragment,null,e.createElement(Ie,{title:a.name||a.destinationType.displayName,subTitle:a.destinationType.type,iconProps:{icon:c,iconSrc:d},visualProps:{monitors:Me(a.exportedSignals),monitorsWithLabels:!0},extendableProps:{withExtend:!0,renderExtended:()=>e.createElement(Tt,{data:m})},renderActions:o?()=>e.createElement(pt,{onClick:()=>s(!0)},e.createElement(wa,null)):void 0}),o&&e.createElement(V,{isOpen:r,name:a.destinationType.displayName||a.name,type:H.Destination,isLastItem:n,onApprove:()=>{a.id?p(a):u(a)},onDeny:()=>s(!1)}))},vo=d(Ae)`
287
289
  display: flex;
288
290
  align-items: center;
289
291
  justify-content: center;
@@ -292,47 +294,47 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
292
294
  padding: 32px;
293
295
  border-radius: 16px;
294
296
  border-style: dashed !important;
295
- `,$o=({isSourcesListEmpty:n,goToSources:a,categories:o,potentialDestinations:r,testConnection:l,onClickSummary:s})=>{const c=m(),{setCurrentModal:d}=Q(),{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(So,{variant:"secondary",onClick:()=>d(B.Destination),children:[t(Ai,{}),t(P,{color:c.colors.secondary,size:14,decoration:"underline",family:"secondary",children:g.ADD_DESTINATION})]})]}),t(fo,{categories:o,withDelete:!0})]})}),t(vo,{isOnboarding:!0,categories:o,potentialDestinations:r,updateDestination:async()=>{},createDestination:async()=>{},deleteDestination:async()=>{},testConnection:l})]})},Co=[{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}],wo=({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(()=>Ln({instrumentationRules:[],sources:[],actions:[],destinations:Ze(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}=He(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(Ot(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(Mn,{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:Co,rows:v})}),!y.length&&t(Te,{style:{marginTop:"2rem"},children:t(Ne,{})})]})},ko=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[At.HeaderKeys]||[]).filter(e=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(c){const e=(c[It.Java]||[]).map(e=>new Ft(e.className,e.methodName)).map(e=>`• ${e.toString()}`).join("\r\n");e&&d.push({title:g.JAVA_CUSTOM_PROBES,value:e});const t=(c[It.Golang]||[]).map(e=>new Mt(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},Do=p.div`
297
+ `,bo=({isSourcesListEmpty:t,goToSources:a,categories:i,potentialDestinations:n,testConnection:o,onClickSummary:l})=>{const r=E.useTheme(),{setCurrentModal:s}=X(),{configuredDestinations:c,configuredDestinationsUpdateOnly:d}=dt();return e.createElement(e.Fragment,null,e.createElement(ee,{$isNotModal:!0},e.createElement(le,{$gap:12},e.createElement(le,{$gap:24},l&&e.createElement(gt,{onClick:l}),e.createElement(A,{title:m.ADD_DESTINATIONS,badgeLabel:c.length+d.length,description:m.ADD_DESTINATION_DESCRIPTION}),t&&e.createElement(te,{type:ae.Warning,message:m.NO_SOURCES_GO_BACK,action:{label:m.SELECT_SOURCES,onClick:a}}),e.createElement(vo,{variant:"secondary",onClick:()=>s(H.Destination)},e.createElement(Ta,null),e.createElement(R,{color:r.colors.secondary,size:14,decoration:"underline",family:"secondary"},m.ADD_DESTINATION))),e.createElement(go,{categories:i,withDelete:!0}))),e.createElement(mo,{isOnboarding:!0,categories:i,potentialDestinations:n,updateDestination:async()=>{},createDestination:async()=>{},deleteDestination:async()=>{},testConnection:o}))},fo=[{key:"icon",title:""},{key:"name",title:m.NAME,sortable:!0},{key:"type",title:m.TYPE,sortable:!0},{key:"signals",title:m.MONITORS},{key:"active-status",title:m.STATUS},{key:"conditions",title:"Conditions"},{key:"throughput",title:"Throughput",sortable:!0}],xo=({metrics:t,maxHeight:a,maxWidth:i})=>{const n=E.useTheme(),o=he(),{selectedStreamName:r}=We(),{setDrawerType:s,setDrawerEntityId:c}=L(),{destinations:d,destinationsLoading:u}=z(),p=l(()=>Ye(d,r),[d,r]),h=l(()=>Ai({instrumentationRules:[],sources:[],actions:[],destinations:Ge(p,o),searchText:o.searchText,selectedCategory:H.Destination}).searchResults.find(({category:e})=>e===H.Destination)?.entities||[],[p,o]),g=l(()=>h.map(a=>{const{hasErrors:i,hasWarnings:o,hasDisableds:l}=re(a.conditions||[]),{icon:r,iconSrc:d}=je(a.destinationType.type);return{status:i?ae.Error:o?ae.Warning:void 0,faded:l,onClick:()=>{s(H.Destination),c(a.id)},cells:[{columnKey:"icon",component:()=>e.createElement(ye,{icon:r,src:d})},{columnKey:"name",value:ve(a,H.Destination,{prioritizeDisplayName:!0})},{columnKey:"type",value:a.destinationType.type,textColor:n.text.info},{columnKey:"throughput",value:Re(Nt(t,H.Destination,a.id).throughput),textColor:n.text.info},{columnKey:"signals",component:()=>e.createElement(be,{withLabels:!0,monitors:Me(a.exportedSignals)})},{columnKey:"conditions",component:()=>a.conditions?.length?e.createElement(Ei,{conditions:a.conditions,id:a.id}):null},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:a.disabled?ae.Error:ae.Success,title:a.disabled?m.DISABLED:m.ENABLED,withIcon:!0,withBorder:!0}))}]}}),[h,t]),{badge:y,badgeTooltip:v}=l(()=>h.length!==p.length?{badge:`${h.length}/${p.length}`,badgeTooltip:m.FILTERED_COUNT_TOOLTIP}:{badge:p.length,badgeTooltip:void 0},[h,p]);return e.createElement(fe,{$maxWidth:i},e.createElement(xe,null,e.createElement(Se,{icon:$e(H.Destination),title:m.DESTINATIONS,badge:y,badgeTooltip:v,loading:u})),e.createElement(ke,{$maxHeight:a},e.createElement(Ce,{columns:fo,rows:g})),!h.length&&e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(De,null)))},So=e=>{const{type:t,ruleName:a,notes:i,disabled:n,profileName:o,payloadCollection:l,codeAttributes:r,headersCollection:s,customInstrumentations:c}=e,d=[{title:m.TYPE,value:t},{type:h.ActiveStatus,title:m.STATUS,value:String(!n)},{title:m.NAME,value:a},{title:m.NOTES,value:i},{title:m.MANAGED_BY_PROFILE,value:o},{type:h.Divider}];if(l){const e=Object.entries(l).filter(([e,t])=>t).map(([e,t])=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(r){const e=Object.entries(r).filter(([e,t])=>t).map(([e,t])=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(s){const e=(s[Et.HeaderKeys]||[]).filter(e=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(c){const e=(c[At.Java]||[]).map(e=>new Ot(e.className,e.methodName)).map(e=>`• ${e.toString()}`).join("\r\n");e&&d.push({title:m.JAVA_CUSTOM_PROBES,value:e});const t=(c[At.Golang]||[]).map(e=>new Ft(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)).map(e=>`• ${e.toString()}`).join("\r\n");t&&d.push({title:m.GOLANG_CUSTOM_PROBES,value:t})}return d},$o=d.div`
296
298
  display: flex;
297
299
  flex-direction: column;
298
300
  gap: 12px;
299
301
  margin-top: 8px;
300
- ${({$hasError:e})=>e&&h`
302
+ ${({$hasError:e})=>e&&u`
301
303
  border: 1px solid ${({theme:e})=>e.text.error};
302
304
  border-radius: 16px;
303
305
  padding: 8px;
304
306
  `}
305
- `,To=[{id:Rt.FilePath,label:"Collect File Path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Rt.Function,label:"Collect Function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Rt.LineNumber,label:"Collect Line Number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],No=[{id:Rt.Column,label:"Collect Column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Rt.Namespace,label:"Collect Namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Rt.StackTrace,label:"Collect Stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Eo={[It.Java]:[new Ft("","")],[It.Golang]:[new Mt("")]},Oo=["*"],Ao=p.div`
307
+ `,ko=[{id:It.FilePath,label:"Collect File Path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:It.Function,label:"Collect Function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:It.LineNumber,label:"Collect Line Number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Co=[{id:It.Column,label:"Collect Column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:It.Namespace,label:"Collect Namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:It.StackTrace,label:"Collect Stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],wo={[At.Java]:[new Ot("","")],[At.Golang]:[new Ft("")]},Do=["*"],To=d.div`
306
308
  display: flex;
307
309
  flex-direction: column;
308
310
  gap: 12px;
309
311
  margin-top: 8px;
310
- ${({$hasError:e})=>e&&h`
312
+ ${({$hasError:e})=>e&&u`
311
313
  border: 1px solid ${({theme:e})=>e.text.error};
312
314
  border-radius: 16px;
313
315
  padding: 8px;
314
316
  `}
315
- `,Fo=[{id:Lt.HttpRequest,label:"Collect HTTP Request"},{id:Lt.HttpResponse,label:"Collect HTTP Response"},{id:Lt.DbQuery,label:"Collect DB Query"},{id:Lt.Messaging,label:"Collect Messaging"}],Io={[Pt.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={[Rt.Column]:null,[Rt.FilePath]:!0,[Rt.Function]:!0,[Rt.LineNumber]:!0,[Rt.Namespace]:null,[Rt.StackTrace]:null};r("codeAttributes",e),p(!1)}},[]);const h=(e,t)=>{const i=t?[...d,e]:d.filter(t=>t!==e),n=Object.values(Rt).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(Do,{$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})]}),e("div",{children:[t(x,{title:"Verbose data to collect",required:!0}),t(Do,{$hasError:!!c,children:No.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})]})]})},[Pt.CustomInstrumentation]:({value:i,setValue:n,formErrors:o})=>{const r=o.customInstrumentations,l=s(()=>(i?.customInstrumentations?.[It.Java]||[]).map(e=>({key:e.className,value:e.methodName})),[i]),c=s(()=>(i?.customInstrumentations?.[It.Golang]||[]).map(e=>new Mt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[i]),d=(e,t)=>{const i={};switch(t){case"java":i[It.Java]=e.map(e=>new Ft(e.className,e.methodName)),i[It.Golang]=c.map(e=>new Mt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName));break;case"golang":i[It.Golang]=e.map(e=>new Mt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),i[It.Java]=l.map(({key:e,value:t})=>new Ft(e,t))}n("customInstrumentations",i)};return a(()=>{i?.customInstrumentations||n("customInstrumentations",{[It.Golang]:Eo[It.Golang],[It.Java]:Eo[It.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"})]})},[Pt.HeadersCollection]:({value:e,setValue:i,formErrors:n})=>{const o=n.headersCollection,r=s(()=>e?.headersCollection?.[At.HeaderKeys]||[],[e]),l=e=>{const t={[At.HeaderKeys]:e};i("headersCollection",t)};return a(()=>{r.length||l(Oo)},[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})})},[Pt.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={[Lt.HttpRequest]:{},[Lt.HttpResponse]:{},[Lt.DbQuery]:{},[Lt.Messaging]:{}};o("payloadCollection",e),u(!1)}},[]),e("div",{children:[t(x,{title:"Type of data to collect",required:!0}),t(Ao,{$hasError:!!l,children:Fo.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={[Lt.HttpRequest]:i.includes(Lt.HttpRequest)?{}:null,[Lt.HttpResponse]:i.includes(Lt.HttpResponse)?{}:null,[Lt.DbQuery]:i.includes(Lt.DbQuery)?{}:null,[Lt.Messaging]:i.includes(Lt.Messaging)?{}:null};o("payloadCollection",n),u(1===i.length)})(e,t)},e))}),!!l&&t($,{children:l})]})},[Pt.UnknownType]:null},Mo=({ruleType:e,value:i,setValue:n,formErrors:a})=>{if(!e)return null;const o=Io[e];return o?t(o,{value:i,setValue:n,formErrors:a}):null},Ro=p.div`
317
+ `,No=[{id:Mt.HttpRequest,label:"Collect HTTP Request"},{id:Mt.HttpResponse,label:"Collect HTTP Response"},{id:Mt.DbQuery,label:"Collect DB Query"},{id:Mt.Messaging,label:"Collect Messaging"}],Eo={[Rt.CodeAttributes]:({value:i,setValue:n,formErrors:o})=>{const r=o.codeAttributes,s=l(()=>Object.entries(i.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]),[c,d]=t(1===s.length);a(()=>{if(!s.length){const e={[It.Column]:null,[It.FilePath]:!0,[It.Function]:!0,[It.LineNumber]:!0,[It.Namespace]:null,[It.StackTrace]:null};n("codeAttributes",e),d(!1)}},[]);const u=(e,t)=>{const a=t?[...s,e]:s.filter(t=>t!==e),i=Object.values(It).reduce((e,t)=>(e[t]=!!a.includes(t)||null,e),{});n("codeAttributes",i),d(1===a.length)};return e.createElement(e.Fragment,null,e.createElement("div",null,e.createElement(b,{title:"Recommended data to collect",required:!0}),e.createElement($o,{$hasError:!!r},ko.map(({id:t,label:a,tooltip:i})=>e.createElement(pe,{key:t,text:i,withIcon:!0},e.createElement(f,{title:a,disabled:c&&s.includes(t),value:s.includes(t),onChange:e=>u(t,e)})))),!!r&&e.createElement(x,null,r)),e.createElement("div",null,e.createElement(b,{title:"Verbose data to collect",required:!0}),e.createElement($o,{$hasError:!!r},Co.map(({id:t,label:a,tooltip:i})=>e.createElement(pe,{key:t,text:i,withIcon:!0},e.createElement(f,{title:a,disabled:c&&s.includes(t),value:s.includes(t),onChange:e=>u(t,e)})))),!!r&&e.createElement(x,null,r)))},[Rt.CustomInstrumentation]:({value:t,setValue:i,formErrors:n})=>{const o=n.customInstrumentations,r=l(()=>(t?.customInstrumentations?.[At.Java]||[]).map(e=>({key:e.className,value:e.methodName})),[t]),s=l(()=>(t?.customInstrumentations?.[At.Golang]||[]).map(e=>new Ft(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[t]),c=(e,t)=>{const a={};switch(t){case"java":a[At.Java]=e.map(e=>new Ot(e.className,e.methodName)),a[At.Golang]=s.map(e=>new Ft(e.packageName,e.functionName,e.receiverName,e.receiverMethodName));break;case"golang":a[At.Golang]=e.map(e=>new Ft(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),a[At.Java]=r.map(({key:e,value:t})=>new Ot(e,t))}i("customInstrumentations",a)};return a(()=>{t?.customInstrumentations||i("customInstrumentations",{[At.Golang]:wo[At.Golang],[At.Java]:wo[At.Java]})},[i,t]),e.createElement("div",null,e.createElement(C,{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=>c(e,"golang"),errorMessage:o,limitFieldsPerRow:2}),e.createElement(D,{title:"Java Custom Probes",tooltip:"Specify class name and method name pair to instrument.",value:r,onChange:(e=[])=>c(e.map(({key:e,value:t})=>({className:e,methodName:t})),"java"),errorMessage:o,keyPlaceholder:"Class name",valuePlaceholder:"Method name"}))},[Rt.HeadersCollection]:({value:t,setValue:i,formErrors:n})=>{const o=n.headersCollection,r=l(()=>t?.headersCollection?.[Et.HeaderKeys]||[],[t]),s=e=>{const t={[Et.HeaderKeys]:e};i("headersCollection",t)};return a(()=>{r.length||s(Do)},[r]),e.createElement("div",null,r.length>0&&e.createElement(T,{title:"Header Keys",tooltip:"Specify which headers you want to collect, asterisk (*) will collect all headers.",value:r,onChange:e=>s(e),errorMessage:o}))},[Rt.PayloadCollection]:({value:i,setValue:n,formErrors:o})=>{const r=o.payloadCollection,s=l(()=>Object.entries(i.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]),[c,d]=t(1===s.length);return a(()=>{if(!s.length){const e={[Mt.HttpRequest]:{},[Mt.HttpResponse]:{},[Mt.DbQuery]:{},[Mt.Messaging]:{}};n("payloadCollection",e),d(!1)}},[]),e.createElement("div",null,e.createElement(b,{title:"Type of data to collect",required:!0}),e.createElement(To,{$hasError:!!r},No.map(({id:t,label:a})=>e.createElement(f,{key:t,title:a,disabled:c&&s.includes(t),value:s.includes(t),onChange:e=>((e,t)=>{const a=t?[...s,e]:s.filter(t=>t!==e),i={[Mt.HttpRequest]:a.includes(Mt.HttpRequest)?{}:null,[Mt.HttpResponse]:a.includes(Mt.HttpResponse)?{}:null,[Mt.DbQuery]:a.includes(Mt.DbQuery)?{}:null,[Mt.Messaging]:a.includes(Mt.Messaging)?{}:null};n("payloadCollection",i),d(1===a.length)})(t,e)}))),!!r&&e.createElement(x,null,r))},[Rt.UnknownType]:null},Oo=({ruleType:t,value:a,setValue:i,formErrors:n})=>{if(!t)return null;const o=Eo[t];return o?e.createElement(o,{value:a,setValue:i,formErrors:n}):null},Ao=d.div`
316
318
  display: flex;
317
319
  flex-direction: column;
318
320
  gap: 24px;
319
321
  padding: 4px;
320
- `,Lo=p(P)`
322
+ `,Fo=d(R)`
321
323
  margin-bottom: 12px;
322
- `,Po=({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(jt,{icon:Kt(e),type:ne.Info,children:lt[e]},e))}),n?e("div",{children:[t(Lo,{children:"Status"}),t(A,{options:[{icon:Di,label:g.ENABLED,value:!1,selectedBgColor:s.text.success+F["050"]},{icon:Ti,label:g.DISABLED,value:!0,selectedBgColor:s.text.error+F["050"]}],selected:o.disabled,setSelected:e=>l("disabled",e)})]}):e(i,{children:[t(I,{title:"",description:a.docsDescription,actionButton:t(M,{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(Mo,{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})]})},jo=p.div`
324
+ `,Io=({isUpdate:t,rule:a,formData:i,formErrors:n,handleFormChange:o})=>{const l=E.useTheme();return e.createElement(Ao,null,e.createElement(de,null,a.supportedLanguages.map(t=>e.createElement(Lt,{key:t,icon:Pt(t),type:ae.Info},ot[t]))),t?e.createElement("div",null,e.createElement(Fo,null,"Status"),e.createElement(O,{options:[{icon:$a,label:m.ENABLED,value:!1,selectedBgColor:l.text.success+E.opacity.hex["050"]},{icon:ka,label:m.DISABLED,value:!0,selectedBgColor:l.text.error+E.opacity.hex["050"]}],selected:i.disabled,setSelected:e=>o("disabled",e)})):e.createElement(e.Fragment,null,e.createElement(A,{title:"",description:a.docsDescription,actionButton:e.createElement(F,{endpoint:a.docsEndpoint})}),e.createElement(S,{title:"Rule name",placeholder:"Use a name that describes the rule",value:i.ruleName,onChange:({target:{value:e}})=>o("ruleName",e),errorMessage:n.ruleName})),e.createElement(Oo,{ruleType:a.type,value:i,setValue:(e,t)=>o(e,t),formErrors:n}),e.createElement(M,{title:"Notes",value:i.notes,onChange:({target:{value:e}})=>o("notes",e),errorMessage:n.notes}))},Mo=d.div`
323
325
  width: 100%;
324
326
  height: 100%;
325
327
  max-height: calc(100vh - 220px);
326
328
  overflow: overlay;
327
329
  overflow-y: auto;
328
- `,Ko=p.div`
330
+ `,Ro=d.div`
329
331
  display: flex;
330
332
  flex-direction: column;
331
333
  gap: 12px;
332
- `,qo=({updateInstrumentationRule:i,deleteInstrumentationRule:o})=>{const{instrumentationRules:l}=W(),{addNotification:c}=qt(),{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}=Ht(),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=zt.find(({type:e})=>e===w.type);return t(Dn,{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(jo,{children:t(Po,{isUpdate:!0,rule:k,formData:b,formErrors:f,handleFormChange:(...e)=>{v(!0),x(...e)}})}):e(Ko,{children:[t(Y,{conditions:w.conditions||[]}),t(G,{title:"Instrumentation Rule Details",data:w?ko(w):[]})]})})},Ho=p(se)`
334
+ `,Lo=({updateInstrumentationRule:i,deleteInstrumentationRule:o})=>{const{instrumentationRules:r}=z(),{addNotification:s}=jt(),{drawerType:c,drawerEntityId:d}=L(),u=n(null),p=c===H.InstrumentationRule,[m,h]=t(!1),[g,y]=t(!1),{formData:v,formErrors:b,handleFormChange:f,resetFormData:x,validateForm:S,loadFormWithDrawerItem:$}=Kt(),k=l(()=>{if(d)return r?.find(e=>W(e)===d)},[d,r]);if(a(()=>{p&&k?$(k):x()},[p,k]),!k)return null;const C=Vt.find(({type:e})=>e===k.type);return e.createElement(Si,{ref:u,title:k.ruleName||k.type,icons:[Pe(k.type)],isEdit:m,isFormDirty:g,onEdit:e=>{k.mutable||!e&&void 0!==e?h("boolean"!=typeof e||e):s({type:ae.Warning,title:ie.FORBIDDEN,message:ie.CANNOT_EDIT_RULE,crdType:H.InstrumentationRule,target:d,hideFromHistory:!0})},onSave:e=>{if(S()){const t=e!==k.type?e:"";f("ruleName",t),i(d,{...v,ruleName:t}),h(!1),y(!1)}},onDelete:()=>{k.mutable?(o(d),h(!1),y(!1),u.current?.closeDrawer()):s({type:ae.Warning,title:ie.FORBIDDEN,message:ie.CANNOT_DELETE_RULE,crdType:H.InstrumentationRule,target:d,hideFromHistory:!0})},onCancel:()=>{h(!1),y(!1),$(k)}},m&&C?e.createElement(Mo,null,e.createElement(Io,{isUpdate:!0,rule:C,formData:v,formErrors:b,handleFormChange:(...e)=>{y(!0),f(...e)}})):e.createElement(Ro,null,e.createElement(U,{conditions:k.conditions||[]}),e.createElement(G,{title:"Instrumentation Rule Details",data:k?So(k):[]})))},Po=d(le)`
333
335
  margin-top: 24px;
334
336
  gap: 12px;
335
- `,zo=zt,Vo=({createInstrumentationRule:i})=>{const{tier:a}=Le(),o=a===Vt.Onprem,{currentModal:r,setCurrentModal:l}=Q(),s=r===B.InstrumentationRule,{formData:c,formErrors:d,handleFormChange:u,resetFormData:p,validateForm:h}=Ht(),[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(Ho,{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(Po,{rule:m,formData:c,formErrors:d,handleFormChange:u})]}):null]})})},Bo=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(It).forEach(e=>{const t=(n[e]||[]).filter(e=>e).join(", ");t&&(a+=a?`, ${t}`:t)}),a},Wo=[{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}],_o=({maxHeight:i,maxWidth:n})=>{const a=m(),o=ye(),{setDrawerType:r,setDrawerEntityId:l}=j(),{instrumentationRules:c,instrumentationRulesLoading:d}=W(),u=s(()=>Ln({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:Bo(e),textColor:a.text.info,withTooltip:!0},{columnKey:"conditions",component:()=>t(Mn,{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:Wo,rows:p})}),!u.length&&t(Te,{style:{marginTop:"2rem"},children:t(Ne,{})})]})},Jo=p.div`
337
+ `,jo=Vt,Ko=({isEnterprise:a,createInstrumentationRule:i})=>{const{currentModal:n,setCurrentModal:o}=X(),l=n===H.InstrumentationRule,{formData:r,formErrors:s,handleFormChange:c,resetFormData:d,validateForm:u}=Kt(),[p,h]=t(void 0),g=()=>{d(),h(void 0),o("")},y=()=>{if(!u())return null;i(r),g()};return P({key:"Enter",active:l},()=>y()),e.createElement(Q,{isOpen:l,onClose:g,header:{title:"Add Instrumentation Rule"},actionComponent:e.createElement(Z,{buttons:[{variant:"primary",label:"DONE",onClick:y,disabled:!a||!p,tooltip:a?"":ie.ENTERPRISE_ONLY("Instrumentation Rules")}]})},e.createElement(ee,null,e.createElement(A,{title:"Select Instrumentation Rule",description:"Define how telemetry is recorded from your application. Choose a rule type and configure the details."}),e.createElement(Po,null,a?e.createElement(te,{type:ae.Warning,message:ie.DEFINED_FOR_ALL_STREAMS(m.INSTRUMENTATION_RULES)}):e.createElement(te,{type:ae.Default,message:ie.ENTERPRISE_ONLY(m.INSTRUMENTATION_RULES)}),e.createElement(ne,{options:jo,selectedOption:p,onOptionSelect:e=>{return t=e,d(),void h(t);var t},autoFocus:!p?.type})),p?.type?e.createElement("div",null,e.createElement(oe,{margin:"16px 0"}),e.createElement(Io,{rule:p,formData:r,formErrors:s,handleFormChange:c})):null))},Vo=e=>{const{payloadCollection:t,codeAttributes:a,customInstrumentations:i}=e;let n="";return t&&(n+=Object.entries(t).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),a&&(n+=Object.entries(a).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),i&&Object.values(At).forEach(e=>{const t=(i[e]||[]).filter(e=>e).join(", ");t&&(n+=n?`, ${t}`:t)}),n},qo=[{key:"icon",title:""},{key:"name",title:m.NAME,sortable:!0},{key:"profile",title:m.MANAGED_BY_PROFILE,sortable:!0},{key:"active-status",title:m.STATUS},{key:"conditions",title:"Conditions"},{key:"source-count",title:"Applicable Source"},{key:"type",title:m.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:m.NOTES,sortable:!0}],Ho=({maxHeight:t,maxWidth:a})=>{const i=p(),n=he(),{setDrawerType:o,setDrawerEntityId:r}=L(),{instrumentationRules:s,instrumentationRulesLoading:c}=z(),d=l(()=>Ai({instrumentationRules:s,sources:[],actions:[],destinations:[],searchText:n.searchText,selectedCategory:H.InstrumentationRule}).searchResults.find(({category:e})=>e===H.InstrumentationRule)?.entities||[],[s,n]),u=l(()=>d.map(t=>{const{hasErrors:a,hasWarnings:n,hasDisableds:l}=re(t.conditions||[]);return{status:a?ae.Error:n?ae.Warning:void 0,faded:l,onClick:()=>{o(H.InstrumentationRule),r(t.ruleId)},cells:[{columnKey:"icon",component:()=>e.createElement(ye,{icon:Pe(t.type)})},{columnKey:"name",value:ve(t,H.InstrumentationRule,{prioritizeDisplayName:!0})},{columnKey:"type",value:t.type,textColor:i.text.info},{columnKey:"profile",value:t.profileName,textColor:i.text.info},{columnKey:"notes",value:t.notes,textColor:i.text.info,withTooltip:!0},{columnKey:"spec",value:Vo(t),textColor:i.text.info,withTooltip:!0},{columnKey:"conditions",component:()=>e.createElement(Ei,{conditions:t.conditions||[],id:t.ruleId})},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:t.disabled?ae.Error:ae.Success,title:t.disabled?m.DISABLED:m.ENABLED,withIcon:!0,withBorder:!0}))},{columnKey:"source-count",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:ae.Info,title:"all sources",withBorder:!0}))}]}}),[d]),{badge:h,badgeTooltip:g}=l(()=>d.length!==s.length?{badge:`${d.length}/${s.length}`,badgeTooltip:m.FILTERED_COUNT_TOOLTIP}:{badge:s.length,badgeTooltip:void 0},[d,s]);return e.createElement(fe,{$maxWidth:a},e.createElement(xe,null,e.createElement(Se,{icon:$e(H.Action),title:m.INSTRUMENTATION_RULES,badge:h,badgeTooltip:g,loading:c})),e.createElement(ke,{$maxHeight:t},e.createElement(Ce,{columns:qo,rows:u})),!d.length&&e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(De,null)))},zo=d.div`
336
338
  position: fixed;
337
339
  bottom: 0;
338
340
  left: 50%;
@@ -345,18 +347,18 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
345
347
  border-radius: 32px;
346
348
  border: 1px solid ${({theme:e})=>e.colors.border};
347
349
  background-color: ${({theme:e})=>e.colors.dropdown_bg};
348
- animation-name: ${Bt.in.center};
349
- `,Uo=({totalSourceCount:i,uninstrumentSources:a,restartWorkloads:o})=>{const r=m(),{selectedSources:l,setSelectedSources:d}=Me(),[u,p]=n(!1),h=s(()=>{let e=0;return Object.values(l).forEach(t=>{e+=t.length}),e},[l]),g=()=>{d({})};return h?e(c,{children:[e(Jo,{"data-id":"multi-source-control",children:[t(P,{children:"Selected sources"}),t(Oe,{label:h,filled:!0}),t(re,{orientation:"vertical",length:"16px"}),t(Ie,{variant:"tertiary",onClick:g,children:t(P,{family:"secondary",decoration:"underline",children:"Deselect"})}),e(Ie,{variant:"tertiary",onClick:()=>{const e=[];Object.values(l).forEach(t=>{e.push(...t.map(e=>Wt(e)))}),o(e),g()},children:[t(Ki,{}),t(P,{family:"secondary",decoration:"underline",children:"Restart"})]}),e(Ie,{variant:"tertiary",onClick:()=>p(!0),children:[t(Ei,{}),t(P,{family:"secondary",decoration:"underline",color:r.text.error,children:"Uninstrument"})]})]}),t(z,{isOpen:u,name:`${h} sources`,type:B.Source,isLastItem:h===i,onApprove:()=>{const e={};Object.entries(l).forEach(([t,i])=>{e[t]=i.map(e=>({...e,selected:!1}))}),a(e),p(!1),g()},onDeny:()=>p(!1)})]}):null},Yo=p.div`
350
+ animation-name: ${E.animations.slide.in.center};
351
+ `,Bo=({totalSourceCount:a,uninstrumentSources:i,restartWorkloads:n})=>{const o=E.useTheme(),{selectedSources:s,setSelectedSources:c}=Fe(),[d,u]=t(!1),p=l(()=>{let e=0;return Object.values(s).forEach(t=>{e+=t.length}),e},[s]),m=()=>{c({})};return p?e.createElement(r,null,e.createElement(zo,{"data-id":"multi-source-control"},e.createElement(R,null,"Selected sources"),e.createElement(Ne,{label:p,filled:!0}),e.createElement(oe,{orientation:"vertical",length:"16px"}),e.createElement(Ae,{variant:"tertiary",onClick:m},e.createElement(R,{family:"secondary",decoration:"underline"},"Deselect")),e.createElement(Ae,{variant:"tertiary",onClick:()=>{const e=[];Object.values(s).forEach(t=>{e.push(...t.map(e=>qt(e)))}),n(e),m()}},e.createElement(Ra,null),e.createElement(R,{family:"secondary",decoration:"underline"},"Restart")),e.createElement(Ae,{variant:"tertiary",onClick:()=>u(!0)},e.createElement(wa,null),e.createElement(R,{family:"secondary",decoration:"underline",color:o.text.error},"Uninstrument"))),e.createElement(V,{isOpen:d,name:`${p} sources`,type:H.Source,isLastItem:p===a,onApprove:()=>{const e={};Object.entries(s).forEach(([t,a])=>{e[t]=a.map(e=>({...e,selected:!1}))}),i(e),u(!1),m()},onDeny:()=>u(!1)})):null},Wo=d.div`
350
352
  position: relative;
351
353
  width: fit-content;
352
- `,Go=p(pe)`
354
+ `,_o=d(de)`
353
355
  gap: 12px;
354
356
  padding: 0 12px;
355
- `,Xo=p(se)`
357
+ `,Jo=d(le)`
356
358
  gap: 12px;
357
359
  max-height: 400px;
358
360
  overflow-y: auto;
359
- `,Zo=p.div`
361
+ `,Uo=d.div`
360
362
  position: absolute;
361
363
  bottom: 0;
362
364
  left: 0;
@@ -365,19 +367,19 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
365
367
  border-radius: 0 0 24px 24px;
366
368
  background: ${({theme:e})=>`linear-gradient(to top, ${e.colors.dropdown_bg}, transparent)`};
367
369
  pointer-events: none;
368
- `,Qo=p(P)`
370
+ `,Go=d(R)`
369
371
  background-color: ${({theme:e})=>e.colors.orange_soft};
370
372
  color: ${({theme:e})=>e.text.primary};
371
373
  border-radius: 32px;
372
374
  width: fit-content;
373
375
  padding: 2px 8px;
374
- `,er=()=>{const i=m(),{notifications:n,markAsSeen:a}=qt(),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(Yo,{children:[t(mt,{onClick:()=>{p(0,0),d(e=>!e)},tooltip:"Notifications",withPing:!!l,pingColor:i.colors.orange_og,children:t(qi,{size:18})}),e(tt,{ref:s,isOpen:c,right:u.left,maxWidth:"400px",header:e(Go,{children:[t(P,{size:20,children:"Notifications"}),!!l&&e(Qo,{size:12,family:"secondary",children:[l," new"]})]}),children:[t(Xo,{children:o.length?o.map(e=>t(rr,{...e,onClick:()=>d(!1)},`notification-${e.id}`)):t(Ne,{title:"No notifications",subTitle:""})}),t(Zo,{})]})]})},tr=p.div`
376
+ `,Yo=()=>{const t=E.useTheme(),{notifications:a,markAsSeen:i}=jt(),n=a.filter(({hideFromHistory:e})=>!e),o=n.filter(({seen:e})=>!e),l=o.length,{popupRef:r,popupOpen:s,setPopupOpen:c,popupPosition:d,handlePosition:u}=Qe({defaultClientHeight:420,defaultClientwidth:400,onClickOutside:()=>{l&&o.forEach(({id:e})=>i(e))}});return e.createElement(Wo,null,e.createElement(pt,{onClick:()=>{u(0,0),c(e=>!e)},tooltip:"Notifications",withPing:!!l,pingColor:t.colors.orange_og},e.createElement(La,{size:18})),e.createElement(Ze,{ref:r,isOpen:s,right:d.left,maxWidth:"400px",header:e.createElement(_o,null,e.createElement(R,{size:20},"Notifications"),!!l&&e.createElement(Go,{size:12,family:"secondary"},l," new"))},e.createElement(Jo,null,n.length?n.map(t=>e.createElement(al,{key:`notification-${t.id}`,...t,onClick:()=>c(!1)})):e.createElement(De,{title:"No notifications",subTitle:""})),e.createElement(Uo,null)))},Xo=d.div`
375
377
  display: flex;
376
378
  align-items: flex-start;
377
379
  gap: 12px;
378
380
  padding: 16px;
379
381
  border-radius: 16px;
380
- background-color: ${({theme:e})=>e.colors.dropdown_bg_2+F["080"]};
382
+ background-color: ${({theme:e})=>e.colors.dropdown_bg_2+E.opacity.hex["080"]};
381
383
  cursor: not-allowed;
382
384
  &.click-enabled {
383
385
  cursor: pointer;
@@ -385,27 +387,27 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
385
387
  background-color: ${({theme:e})=>e.colors.dropdown_bg_2};
386
388
  }
387
389
  }
388
- `,ir=p.div`
389
- background-color: ${({$type:e,theme:t})=>t.text[e]+F["015"]};
390
+ `,Qo=d.div`
391
+ background-color: ${({$type:e,theme:t})=>t.text[e]+E.opacity.hex["015"]};
390
392
  border-radius: 8px;
391
393
  width: 36px;
392
394
  height: 36px;
393
395
  display: flex;
394
396
  align-items: center;
395
397
  justify-content: center;
396
- `,nr=p.div`
398
+ `,Zo=d.div`
397
399
  width: 290px;
398
- `,ar=p.div`
400
+ `,el=d.div`
399
401
  margin-bottom: 6px;
400
- `,or=p.div`
402
+ `,tl=d.div`
401
403
  display: flex;
402
404
  align-items: center;
403
405
  gap: 6px;
404
- `,rr=({id:n,seen:a,type:o,title:r,message:l,time:s,crdType:c,target:d,onClick:u})=>{const p=m(),{formatTimeAgo:h}=_t(),{onClickNotification:g}=Jt(),y=!!c&&!!d,v=r?.toLowerCase().includes(Z.Delete.toLowerCase())||!1,b=ge(o,p);return e(tr,{className:y?"click-enabled":"",onClick:()=>{y&&(u(),g({id:n,crdType:c,target:d}))},children:[t(ir,{$type:v?ne.Error:o,children:t(v?Ei:b,{})}),e(nr,{children:[t(ar,{children:t(P,{size:14,children:l})}),e(or,{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}`)},lr=(e,t,i)=>{const n=e?.serviceName||t?.otelServiceName||t?.name,a=i?[Hi]:ze(t?.containers||[]),{priorotizedStatus:o}=ce(t?.conditions||[]);return{id:n,title:n,icons:a.length?a:[zi],status:o,serviceMapEntry:e}},sr=e=>"user"===e?.otelServiceName&&!e?.namespace&&!e?.name&&!e?.kind,cr=p.div`
406
+ `,al=({id:t,seen:a,type:i,title:n,message:o,time:l,crdType:r,target:s,onClick:c})=>{const d=E.useTheme(),{formatTimeAgo:u}=Ht(),{onClickNotification:p}=zt(),m=!!r&&!!s,h=n?.toLowerCase().includes(Y.Delete.toLowerCase())||!1,g=me(i,d);return e.createElement(Xo,{key:`notification-${t}`,className:m?"click-enabled":"",onClick:()=>{m&&(c(),p({id:t,crdType:r,target:s}))}},e.createElement(Qo,{$type:h?ae.Error:i},h?e.createElement(wa,null):e.createElement(g,null)),e.createElement(Zo,null,e.createElement(el,null,e.createElement(R,{size:14},o)),e.createElement(tl,null,e.createElement(R,{size:10,color:d.text.grey},u(l)),!a&&e.createElement(e.Fragment,null,e.createElement(R,{size:10},"·"),e.createElement(R,{size:10,color:d.colors.orange_soft},"new")))))},il=(e,t,a)=>{const i=e?.serviceName||t?.otelServiceName||t?.name,n=a?[Pa]:Ke(t?.containers||[]),{priorotizedStatus:o}=re(t?.conditions||[]);return{id:i,title:i,icons:n.length?n:[ja],status:o,serviceMapEntry:e}},nl=e=>"user"===e?.otelServiceName&&!e?.namespace&&!e?.name&&!e?.kind,ol=d.div`
405
407
  width: 100%;
406
408
  height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px)`};
407
409
  position: relative;
408
- `,dr={namespace:"",name:"",kind:"",otelServiceName:"user",selected:!0,numberOfInstances:0,dataStreamNames:[],containers:[],conditions:[]},ur=({heightToRemove:e,serviceMap:i})=>{const n=m(),{sources:o,sourcesLoading:r}=W(),{containerRef:l,containerHeight:s,containerWidth:c}=Ue(),[d,u,p]=en([]),[h,y,v]=tn([]);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}-${Ut.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}-${Ut.MapItem}`,type:Ut.MapItem,position:r.get(i),data:lr(t,n,sr(n))})}),o.forEach((t,i)=>{if(a.find(e=>e.id===`${B.Source}-${i}-${Ut.MapItem}`))return;const n=e.find(e=>i===e.otelServiceName||i===e.name);a.push({id:`${B.Source}-${i}-${Ut.MapItem}`,type:Ut.MapItem,position:r.get(i),data:lr(t,n,sr(n))})});let i=50;e.forEach(e=>{const t=e.otelServiceName||e.name;a.find(e=>e.id===`${B.Source}-${t}-${Ut.MapItem}`)||(a.push({id:`${B.Source}-${t}-${Ut.MapItem}`,type:Ut.MapItem,position:{x:i,y:10},data:lr(void 0,e,sr(e))}),i+=110)})}else a.push({id:`${B.Source}-${Ut.NoData}`,type:Ut.NoData,position:{x:n/2-150,y:i/4},data:{subTitle:g.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return a})({serviceMap:i,sources:[dr].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}-${Ut.NoData}`)&&i.push({id:`${B.Source}-${Ut.NoData}`,type:"remove"}),nn(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}-${Ut.MapItem}`,l=o===ne.Error;n.push({id:`${a}-to-${r}`,source:a,target:r,markerEnd:{type:Qi.ArrowClosed},style:{stroke:l?e?.colors.dark_red:e?.colors.border}})})}),n})({theme:n,nodes:d,serviceMap:i}))},[n,d,i]),t(cr,{ref:l,$heightToRemove:e,children:t(Yt,{nodes:d,edges:h,onNodesChange:p,onEdgesChange:v,zoomOnScroll:!0})})},pr=p.div`
410
+ `,ll={namespace:"",name:"",kind:"",otelServiceName:"user",selected:!0,numberOfInstances:0,dataStreamNames:[],containers:[],conditions:[]},rl=({heightToRemove:t,serviceMap:i})=>{const n=E.useTheme(),{sources:o,sourcesLoading:l}=z(),{containerRef:r,containerHeight:s,containerWidth:c}=_e(),[d,u,p]=Ya([]),[h,g,y]=Xa([]);return a(()=>{if(s&&c){const t=(({sources:e,serviceMap:t,containerHeight:a,containerWidth:i})=>{const n=[],o=new Map,l=((e,t)=>{const a=new Map,i=new Map,n=new Map,o=new Set;e.forEach(e=>{o.add(e.serviceName),e.services.forEach(e=>{o.add(e.serviceName)})}),o.forEach(e=>{i.set(e,[]),n.set(e,0)}),e.forEach(e=>{e.services.forEach(t=>{i.get(e.serviceName)?.push(t.serviceName);const a=n.get(t.serviceName)||0;n.set(t.serviceName,a+1)})});const l=[],r=[];for(o.forEach(e=>{0===(n.get(e)||0)&&r.push(e)});r.length>0;){const e=[],t=r.length;for(let a=0;a<t;a++){const t=r.shift();e.push(t),i.get(t)?.forEach(e=>{const t=n.get(e)||0;n.set(e,t-1),t-1==0&&r.push(e)})}e.length>0&&l.push(e)}return o.forEach(e=>{l.flat().includes(e)||(0===l.length?l.push([e]):l[l.length-1].push(e))}),l.forEach((e,i)=>{const n=100+150*i,o=150*(e.length-1),l=(t-o)/2;e.forEach((e,t)=>{const i=l+150*t,o=n;a.set(e,{x:i,y:o})})}),a})(t,i);if(t.length&&e.length){t.forEach(t=>{const a=t.serviceName;if(n.find(e=>e.id===`${H.Source}-${a}-${Bt.MapItem}`))return;const i=e.find(e=>a===e.otelServiceName||a===e.name);o.set(a,t),t.services.forEach(e=>o.set(e.serviceName,{serviceName:e.serviceName,services:[]})),n.push({id:`${H.Source}-${a}-${Bt.MapItem}`,type:Bt.MapItem,position:l.get(a),data:il(t,i,nl(i))})}),o.forEach((t,a)=>{if(n.find(e=>e.id===`${H.Source}-${a}-${Bt.MapItem}`))return;const i=e.find(e=>a===e.otelServiceName||a===e.name);n.push({id:`${H.Source}-${a}-${Bt.MapItem}`,type:Bt.MapItem,position:l.get(a),data:il(t,i,nl(i))})});let a=50;e.forEach(e=>{const t=e.otelServiceName||e.name;n.find(e=>e.id===`${H.Source}-${t}-${Bt.MapItem}`)||(n.push({id:`${H.Source}-${t}-${Bt.MapItem}`,type:Bt.MapItem,position:{x:a,y:10},data:il(void 0,e,nl(e))}),a+=110)})}else n.push({id:`${H.Source}-${Bt.NoData}`,type:Bt.NoData,position:{x:i/2-150,y:a/4},data:{subTitle:m.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return n})({serviceMap:i,sources:[ll].concat(o),containerHeight:s,containerWidth:c});d.length>1?(e=t,u(t=>{const a=e.map(e=>{const a=t.find(t=>t.id===e.id);return e.position=a?.position||e.position,{id:e.id,item:e,type:a?"replace":"add"}});return t.find(e=>e.id===`${H.Source}-${Bt.NoData}`)&&a.push({id:`${H.Source}-${Bt.NoData}`,type:"remove"}),Qa(a,t)})):u(t)}var e},[i,o,l,s,c]),a(()=>{g((({theme:e,nodes:t,serviceMap:a})=>{const i=[];return t.forEach(({id:t,data:{id:n,status:o}})=>{const{services:l}=a.find(e=>e.serviceName===n)||{services:[]};l.forEach(a=>{const n=t,l=`${H.Source}-${a.serviceName}-${Bt.MapItem}`,r=o===ae.Error;i.push({id:`${n}-to-${l}`,source:n,target:l,markerEnd:{type:Ga.ArrowClosed},style:{stroke:r?e?.colors.dark_red:e?.colors.border}})})}),i})({theme:n,nodes:d,serviceMap:i}))},[n,d,i]),e.createElement(ol,{ref:r,$heightToRemove:t},e.createElement(Wt,{nodes:d,edges:h,onNodesChange:p,onEdgesChange:y,zoomOnScroll:!0}))},sl=d.div`
409
411
  display: flex;
410
412
  flex-direction: column;
411
413
  align-items: center;
@@ -415,12 +417,12 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
415
417
  max-height: ${({$isModal:e})=>e?"calc(100vh - 510px)":"calc(100vh - 310px)"};
416
418
  height: fit-content;
417
419
  overflow-y: scroll;
418
- `,hr=p.div`
420
+ `,cl=d.div`
419
421
  width: 100%;
420
422
  padding-bottom: ${({$isOpen:e})=>e?"18px":"0"};
421
423
  border-radius: 16px;
422
- background-color: ${({$selected:e,theme:t})=>e?t.colors.majestic_blue+F["024"]:t.colors.dropdown_bg_2+F["040"]};
423
- `,mr=p.div`
424
+ background-color: ${({$selected:e,theme:t})=>e?t.colors.majestic_blue+E.opacity.hex["024"]:t.colors.dropdown_bg_2+E.opacity.hex["040"]};
425
+ `,dl=d.div`
424
426
  display: flex;
425
427
  justify-content: space-between;
426
428
  gap: 12px;
@@ -429,29 +431,29 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
429
431
  border-radius: 16px;
430
432
  cursor: ${({$withClick:e})=>e?"pointer":"unset"};
431
433
  &:hover {
432
- background-color: ${({$withClick:e,$selected:t,theme:i})=>e&&(t?i.colors.majestic_blue+F["040"]:i.colors.dropdown_bg_2+F["080"])};
434
+ background-color: ${({$withClick:e,$selected:t,theme:a})=>e&&(t?a.colors.majestic_blue+E.opacity.hex["040"]:a.colors.dropdown_bg_2+E.opacity.hex["080"])};
433
435
  transition: background-color 0.3s;
434
436
  }
435
- `,gr=p(mr)`
437
+ `,ul=d(dl)`
436
438
  width: calc(100% - 100px);
437
439
  margin: 0 auto;
438
440
  padding: 8px;
439
- `,yr=p.div`
441
+ `,pl=d.div`
440
442
  position: relative;
441
443
  padding-bottom: ${({$addPadding:e})=>e?"16px":"0"};
442
- `,vr=p.div`
444
+ `,ml=d.div`
443
445
  position: absolute;
444
446
  top: 6px;
445
447
  left: 18px;
446
- `,br=p(Te)`
448
+ `,hl=d(we)`
447
449
  padding-bottom: ${({$addPadding:e})=>e?"16px":"0"};
448
- `,fr=p.div`
450
+ `,gl=d.div`
449
451
  width: ${({$width:e})=>`${e||42}px`};
450
452
  display: flex;
451
453
  align-items: center;
452
454
  justify-content: flex-end;
453
455
  text-align: right;
454
- `,xr=we(B.Namespace),Sr=({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(pr,{$isModal:i,children: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(hr,{"data-id":`namespace-${i}`,$selected:C,$isOpen:$,children:[e(mr,{$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(xr,{}),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(fr,{$width:108,children:a!==i||o?.includes(i)?null:t(Gt,{size:10,children:"Retrieving workloads..."})}),t(fr,{children:t(P,{size:10,color:h.text.grey,children:x?`${f.length}/${r.length}`:null})}),s&&t(gt,{extend:$})]})]}),($||!s)&&(k?e(yr,{$addPadding:!d,children:[t(vr,{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($r,{withInstances:n,source:e,namespace:i,isSelected:a,onSelect:d},`source-${e.name}`)})]}):t(br,{$addPadding:!d,children:v||a===i&&!o?.includes(i)?t(Fe,{}):t(Ne,{title:g.NO_SOURCES_NAMESPACE,subTitle:g.TRY_SEARCH_OR_OTHER_NAMESPACE})}))]},`namespace-${i}`):null})}):t(Te,{children:v||a?t(Fe,{}):t(Ne,{title:g.NO_SOURCES,subTitle:!y&&s?g.PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES:g.PLEASE_ADD_SOURCE})})},$r=({withInstances:i,source:n,namespace:a,isSelected:o,onSelect:r})=>t(gr,{"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}`]})]})]})}),Cr=p.div`
456
+ `,yl=$e(H.Namespace),vl=({isModal:t=!1,withInstances:a=!0,fetchingNamespace:i,fetchedNamespaces:n,filteredNamespacesAndSources:o,selectedNamespace:l,onSelectNamespace:r,selectedSources:s,onSelectSource:c,selectedFutureApps:d,onSelectFutureApps:u})=>{const p=E.useTheme(),{isVm:h}=Be(),{namespacesLoading:g}=z(),y=Object.entries(o||{});return y?.length?e.createElement(sl,{$isModal:t},y.map(([t,o])=>{const y=s?.[t]||[],v=d?.[t]?.selected||!1,b=y.filter(({selected:e})=>e),x=y.length>0,S=l===t,$=b.length>0&&b.length===o.length,k=b.length>0&&b.length!==o.length,C=o.length>0,D=1===o.length;return r||C?e.createElement(cl,{key:`namespace-${t}`,"data-id":`namespace-${t}`,$selected:$,$isOpen:S},e.createElement(dl,{$selected:$,$withClick:!!r,onClick:()=>r?.(t)},e.createElement(de,{$gap:12},r&&e.createElement(f,{partiallyChecked:k,value:$,onChange:e=>r(t,e)}),e.createElement(yl,null),e.createElement(R,null,t)),e.createElement(de,{$gap:24},!h&&u&&e.createElement(w,{title:m.FUTURE_APPS_TITLE,tooltip:m.FUTURE_APPS_DESCRIPTION,initialValue:v,onChange:e=>u(e,t),flipHorizontally:!0}),e.createElement(gl,{$width:108},i!==t||n?.includes(t)?null:e.createElement(_t,{size:10},"Retrieving workloads...")),e.createElement(gl,null,e.createElement(R,{size:10,color:p.text.grey},x?`${b.length}/${o.length}`:null)),r&&e.createElement(mt,{extend:S}))),(S||!r)&&(C?e.createElement(pl,{$addPadding:!c},e.createElement(ml,null,e.createElement(oe,{orientation:"vertical",length:(D?24:34*o.length)+"px"})),o.map(i=>{const n=b.some(({name:e})=>e===i.name);return e.createElement(bl,{key:`source-${i.name}`,withInstances:a,source:i,namespace:t,isSelected:n,onSelect:c})})):e.createElement(hl,{$addPadding:!c},g||i===t&&!n?.includes(t)?e.createElement(Oe,null):e.createElement(De,{title:m.NO_SOURCES_NAMESPACE,subTitle:m.TRY_SEARCH_OR_OTHER_NAMESPACE})))):null})):e.createElement(we,null,g||i?e.createElement(Oe,null):e.createElement(De,{title:m.NO_SOURCES,subTitle:!h&&r?m.PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES:m.PLEASE_ADD_SOURCE}))},bl=({withInstances:t,source:a,namespace:i,isSelected:n,onSelect:o})=>e.createElement(ul,{"data-id":`source-${a.name}`,$selected:n,$withClick:!!o,onClick:()=>o?.(a)},e.createElement(de,{$gap:12},o&&e.createElement(f,{value:n,onChange:()=>o(a,i)}),e.createElement(de,{$gap:4},e.createElement(R,null,a.name),e.createElement(R,{opacity:.8,size:10},t?` • ${a.numberOfInstances||0} running instance${1!==a.numberOfInstances?"s":""}`:"",` • ${a.kind}`)))),fl=d.div`
455
457
  display: flex;
456
458
  flex-direction: column;
457
459
  align-items: center;
@@ -460,35 +462,35 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
460
462
  max-height: calc(100vh - 200px);
461
463
  height: fit-content;
462
464
  overflow-y: scroll;
463
- `,wr=({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(Cr,{children:[t(G,{title:g.STREAM_NAME,action:()=>t(Xt,{onClick:i}),data:[{title:"",value:r}]}),t(G,{title:g.SELECTED_SOURCES,titleBadge:u,action:()=>t(Xt,{onClick:n}),children:t(Sr,{filteredNamespacesAndSources:l,withInstances:!1})}),t(G,{title:g.SELECTED_DESTINATIONS,titleBadge:c.length+d.length,action:()=>t(Xt,{onClick:a}),children:t(fo,{categories:o})})]})]})})};var kr;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}(kr||(kr={}));const Dr=({onClickId:e,defaultSelectedId:i,extendedNavIcons:a})=>{const{isVm:o}=Le(),[r,l]=n(i||""),c=s(()=>[{id:kr.Overview,icon:Vi,selected:r===kr.Overview,onClick:()=>{l(kr.Overview),e(kr.Overview)},tooltip:"Overview"},...(a||[]).map(e=>({...e,selected:r===e.id,onClick:()=>{l(e.id),e.onClick()}}))],[r]),d=s(()=>{const t=[{id:kr.Sources,icon:Bi,selected:r===kr.Sources,onClick:()=>{l(kr.Sources),e(kr.Sources)},tooltip:"Sources"},{id:kr.Destinations,icon:Wi,selected:r===kr.Destinations,onClick:()=>{l(kr.Destinations),e(kr.Destinations)},tooltip:"Destinations"}];return o||(t.push({id:kr.InstrumentationRules,icon:_i,selected:r===kr.InstrumentationRules,onClick:()=>{l(kr.InstrumentationRules),e(kr.InstrumentationRules)},tooltip:"Instrumentation Rules"}),t.push({id:kr.Actions,icon:Ji,selected:r===kr.Actions,onClick:()=>{l(kr.Actions),e(kr.Actions)},tooltip:"Actions"})),t},[o,r]);return t(Zt,{orientation:"vertical",mainIcons:c,subIcons:d})},Tr=({})=>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(Ui,{})}),Nr=(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},Er=p.div`
465
+ `,xl=({onEditStream:t,onEditSources:a,onEditDestinations:i,categories:n})=>{const{selectedStreamName:o}=We(),{configuredSources:r,configuredDestinations:s,configuredDestinationsUpdateOnly:c}=dt(),d=l(()=>Object.values(r).reduce((e,t)=>e+t.filter(e=>e.selected).length,0),[r]);return e.createElement(ee,{$isNotModal:!0},e.createElement(le,{$gap:12},e.createElement(A,{title:m.SUMMARY,description:m.STREAM_CONFIRM}),e.createElement(fl,null,e.createElement(G,{title:m.STREAM_NAME,action:()=>e.createElement(Jt,{onClick:t}),data:[{title:"",value:o}]}),e.createElement(G,{title:m.SELECTED_SOURCES,titleBadge:d,action:()=>e.createElement(Jt,{onClick:a})},e.createElement(vl,{filteredNamespacesAndSources:r,withInstances:!1})),e.createElement(G,{title:m.SELECTED_DESTINATIONS,titleBadge:s.length+c.length,action:()=>e.createElement(Jt,{onClick:i})},e.createElement(go,{categories:n})))))};var Sl;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}(Sl||(Sl={}));const $l=({onClickId:a,defaultSelectedId:i,extendedNavIcons:n})=>{const{isVm:o}=Be(),[r,s]=t(i||""),c=l(()=>[{id:Sl.Overview,icon:Ka,selected:r===Sl.Overview,onClick:()=>{s(Sl.Overview),a(Sl.Overview)},tooltip:"Overview"},...(n||[]).map(e=>({...e,selected:r===e.id,onClick:()=>{s(e.id),e.onClick()}}))],[r]),d=l(()=>{const e=[{id:Sl.Sources,icon:Va,selected:r===Sl.Sources,onClick:()=>{s(Sl.Sources),a(Sl.Sources)},tooltip:"Sources"},{id:Sl.Destinations,icon:qa,selected:r===Sl.Destinations,onClick:()=>{s(Sl.Destinations),a(Sl.Destinations)},tooltip:"Destinations"}];return o||(e.push({id:Sl.InstrumentationRules,icon:Ha,selected:r===Sl.InstrumentationRules,onClick:()=>{s(Sl.InstrumentationRules),a(Sl.InstrumentationRules)},tooltip:"Instrumentation Rules"}),e.push({id:Sl.Actions,icon:za,selected:r===Sl.Actions,onClick:()=>{s(Sl.Actions),a(Sl.Actions)},tooltip:"Actions"})),e},[o,r]);return e.createElement(Ut,{orientation:"vertical",mainIcons:c,subIcons:d})},kl=({})=>e.createElement(pt,{onClick:()=>window.open("https://join.slack.com/t/odigos/shared_invite/zt-2wc6gm4j9-EhcVFYrLwHqvcIErO9sVzw","_blank","noopener noreferrer"),tooltip:"Join our Slack community"},e.createElement(Ba,null)),Cl=(e,t)=>{const{name:a,kind:i,namespace:n}=e,o=[{title:m.KIND,value:i},{title:m.NAME,value:a,tooltip:"Resource name"}];return t||(o.unshift({title:m.NAMESPACE,value:n}),o.push({type:h.Divider}),o.push({type:h.CopyText,value:`kubectl get ${i} ${a} -n ${n}`.toLowerCase()})),o},wl=d.div`
464
466
  display: flex;
465
467
  flex-direction: column;
466
468
  gap: 24px;
467
469
  padding: 4px;
468
- `,Or=({formData:e,handleFormChange:i})=>t(Er,{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)})}),Ar=({workloadOdigosHealthStatus:e})=>{if(!e)return null;const i=Qt(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,restartPod: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||ei(d)?ne.Error:ne.Success,m=[];return m.push(t(ti,{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(ii,{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(ii,{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(ii,{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(ii,{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(ni,{...e},`pod-container-${e.containerName.value}`))}),p&&(m.push(t(re,{length:"100%",margin:"0"},"divider-6")),m.push(t(ai,{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(oi,{isOpen:!0,positionRight:"calc(100% + 12px)",actions:r?[{id:ri(),label:"Restart",rightIcon:Fi,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(Fe,{})})},Ir=p(pe)`
470
+ `,Dl=({formData:t,handleFormChange:a})=>e.createElement(wl,null,e.createElement(S,{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:t.otelServiceName,onChange:({target:{value:e}})=>a("otelServiceName",e)})),Tl=({workloadOdigosHealthStatus:t})=>{if(!t)return null;const a=Gt(t?.status),i=it(t?.reasonEnum),n=t?.message;return e.createElement(de,{$alignItems:"center",$justifyContent:"center"},e.createElement(se,{status:a,title:i,subtitle:n,withBackground:a!==ce.Disabled,withBorder:!0,withIcon:!0,width:"calc(100% - 24px)"}))},Nl=({source:i,fetchSourceDescribe:n,restartPod:o})=>{const[l,r]=t(!1),[s,d]=t(null);return a(()=>{i&&n({namespace:i.namespace,name:i.name,kind:i.kind}).then(({data:e})=>{e?.describeSource?d(e.describeSource):r(!0)})},[i.namespace,i.name,i.kind]),s||l?e.createElement(le,{$gap:12},l?e.createElement(we,{$height:"70vh"},e.createElement(De,{subTitle:"Could not fetch describe for this source"})):s?.pods?.length?s.pods.map(({podName:t,nodeName:a,phase:n,agentInjected:l,runningLatestWorkloadRevision:r,containers:d,manifestYAML:u})=>{const p=n.status!==ae.Success||Yt(d)?ae.Error:ae.Success,m=[];return m.push(e.createElement(Xt,{key:"copy-text",value:`kubectl get pod ${t.value} -n ${s?.namespace?.value||i.namespace}`.toLowerCase()})),m.push(e.createElement(oe,{key:"divider-1",length:"100%",margin:"0"})),m.push(e.createElement(Qt,{key:"describe-row-1",title:a.name,tooltip:a.explain||"",value:{status:a.status||void 0,text:a.value}})),m.push(e.createElement(oe,{key:"divider-2",length:"100%",margin:"0"})),m.push(e.createElement(Qt,{key:"describe-row-2",title:n.name,tooltip:n.explain||"",value:{status:n.status||void 0,text:n.value}})),m.push(e.createElement(oe,{key:"divider-3",length:"100%",margin:"0"})),m.push(e.createElement(Qt,{key:"describe-row-3",title:l.name,tooltip:l.explain||"",value:{status:l.status||void 0,text:l.value}})),m.push(e.createElement(oe,{key:"divider-4",length:"100%",margin:"0"})),r?.name&&(m.push(e.createElement(Qt,{key:"describe-row-4",title:r.name,tooltip:r.explain||void 0,value:{status:r.status||void 0,text:r.value}})),m.push(e.createElement(oe,{key:"divider-5",length:"100%",margin:"0"}))),d.forEach(t=>{m.push(e.createElement(Zt,{key:`pod-container-${t.containerName.value}`,...t}))}),u&&(m.push(e.createElement(oe,{key:"divider-6",length:"100%",margin:"0"})),m.push(e.createElement(ea,{key:"yaml-section-card",yaml:u}))),e.createElement(G,{key:`pod-${t.value}`,title:`Pod: ${t.value}`,withExtend:!0,action:({hovered:a})=>e.createElement("div",{style:{position:"relative"}},e.createElement(se,{key:"status",status:p,title:p,withIcon:!0,withBorder:!0}),a&&e.createElement(ta,{key:"hover-actions",isOpen:!0,positionRight:"calc(100% + 12px)",actions:[{id:aa(),label:"Restart",rightIcon:Na,onClick:()=>o(s?.namespace?.value||i.namespace,t.value)}]}))},c.toArray(m))}):e.createElement(we,{$height:"70vh"},e.createElement(De,{subTitle:"Check if you have any running pods and try again"}))):e.createElement(we,{$height:"70vh"},e.createElement(Oe,null))},El=d(de)`
469
471
  width: 100%;
470
472
  align-items: center;
471
473
  justify-content: space-between;
472
- `,Mr=({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(Tt(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(Ir,{$width:"100%",children:[t(P,{size:12,color:r.text.grey,children:i}),e(pe,{$gap:4,children:[o.map(({key:e,value:n})=>li(n)&&si(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(Fe,{})})};var Rr;!function(e){e.Overview="Overview",e.Pods="Pods",e.Libraries="Libraries"}(Rr||(Rr={}));const Lr=[di.Deployment,di.StatefulSet,di.DaemonSet,di.DeploymentConfig,di.Rollout,di.StaticPod],Pr=[di.Deployment,di.StatefulSet,di.DaemonSet,di.DeploymentConfig,di.Rollout,di.Pod],jr=[ui.Python,ui.Go,ui.Java],Kr=p.div`
474
+ `,Ol=({source:i,fetchSourceLibraries:n})=>{const o=E.useTheme(),[l,s]=t(!1),[c,d]=t(null);return a(()=>{i&&n({namespace:i.namespace,name:i.name,kind:i.kind}).then(({data:e})=>{e?.instrumentationInstanceComponents?d(wt(e.instrumentationInstanceComponents).sort((e,t)=>e.name.localeCompare(t.name))):s(!0)})},[i.namespace,i.name,i.kind]),c||l?e.createElement(le,{$gap:12},l?e.createElement(we,{$height:"70vh"},e.createElement(De,{subTitle:"Could not fetch libraries for this source"})):c?.length?e.createElement(G,{title:"Instrumented Libraries"},c.map(({name:t,healthy:a,nonIdentifyingAttributes:i},n)=>e.createElement(r,{key:`library-${t}`},e.createElement(El,null,e.createElement(R,{size:12,color:o.text.grey},t),e.createElement(de,{$gap:4},i.map(({key:a,value:i})=>ia(i)&&na(i)&&"is_standard_lib"===a?e.createElement(se,{key:`${t}-${a}`,status:ae.Default,title:"STANDARD",withBorder:!0}):null),"boolean"==typeof a&&e.createElement(se,{status:a?ae.Success:ae.Error,title:a?"HEALTHY":"UNHEALTHY",withBorder:!0}))),n!==c.length-1&&e.createElement(oe,{length:"100%",margin:"0"})))):e.createElement(we,{$height:"70vh",$gap:12},e.createElement(De,{title:"No libraries found",subTitle:""}),e.createElement(te,{type:ae.Warning,message:"This feature is in early development, and has very limited support"}))):e.createElement(we,{$height:"70vh"},e.createElement(Oe,null))};var Al;!function(e){e.Overview="Overview",e.Pods="Pods",e.Libraries="Libraries"}(Al||(Al={}));const Fl=[la.Deployment,la.StatefulSet,la.DaemonSet,la.DeploymentConfig],Il=[ra.Python,ra.Go,ra.Java],Ml=d.div`
473
475
  width: 100%;
474
476
  height: 100%;
475
477
  max-height: calc(100vh - 220px);
476
478
  overflow: overlay;
477
479
  overflow-y: auto;
478
- `,qr=p.div`
480
+ `,Rl=d.div`
479
481
  display: flex;
480
482
  flex-direction: column;
481
483
  gap: 12px;
482
- `,Hr=({persistSources:o,updateSource:l,restartWorkloads:c,fetchSourceById:d,fetchSourceDescribe:u,fetchSourceLibraries:p,restartPod:h})=>{const{isVm:m}=Le(),{sources:y}=W(),{selectedStreamName:v}=Je(),{drawerType:b,drawerEntityId:f}=j(),x=s(()=>Ye(y,v),[y,v]),S=r(null),$=b===B.Source,[C,w]=n(!1),[k,D]=n(!1),[T,N]=n(Rr.Overview),[E,O]=n(null);a(()=>{$&&f&&d(f).then(e=>O(e||null))},[$,f]);const{formData:A,handleFormChange:F,resetFormData:I,loadFormWithDrawerItem:M}=ci(),R=s(()=>{if(f)return E&&JSON.stringify(Wt(E))===JSON.stringify(Wt(f))?E:x?.find(e=>JSON.stringify(Wt(e))===JSON.stringify(Wt(f)))},[f,x,E]);a(()=>{$&&R?M(R):I()},[$,R]);const L=s(()=>{const e=R?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===ue.Loading,containers:R?.containers||[]}},[R]),K=s(()=>{const e=[{label:Rr.Overview,onClick:()=>N(Rr.Overview),selected:T===Rr.Overview}];return m||(Lr.includes(R?.kind)&&e.push({label:Rr.Pods,onClick:()=>N(Rr.Pods),selected:T===Rr.Pods}),R?.containers?.some(({language:e})=>jr.includes(e))&&e.push({label:Rr.Libraries,onClick:()=>N(Rr.Libraries),selected:T===Rr.Libraries})),e},[T,R,m]);return R?t(Dn,{ref:S,onClose:()=>{N(Rr.Overview),O(null)},title:R.otelServiceName||R.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:ze(R.containers),isEdit:C,isFormDirty:k,onEdit:T===Rr.Overview?e=>{w("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=A.otelServiceName!==R.name?A.otelServiceName:"";F("otelServiceName",e),await l(f,{...A,otelServiceName:e}),O(null),D(!1),w(!1)},onDelete:T===Rr.Overview?async()=>{const{namespace:e}=R;o({[e]:[{...R,selected:!1,currentStreamName:v}]},{}),O(null),D(!1),w(!1),S.current?.closeDrawer()}:void 0,onCancel:()=>{D(!1),w(!1),F("otelServiceName",R.otelServiceName||R.name||"")},isLastItem:1===x.length,tabs:K,headerActionButtons:m?[]:Pr.includes(R?.kind)?[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>c([f]),children:e(i,{children:[t(Ki,{}),t(P,{size:14,family:"secondary",decoration:"underline",children:"Restart"})]})}]:[],children:T===Rr.Overview?C?t(Kr,{children:t(Or,{formData:A,handleFormChange:(...e)=>{D(!0),F(...e),F("currentStreamName",v)}})}):e(qr,{children:[t(Ar,{workloadOdigosHealthStatus:R.workloadOdigosHealthStatus}),t(Y,{conditions:R.conditions||[]}),t(G,{title:g.SOURCE_DETAILS,data:R?Nr(R,m):[]}),t(G,{title:m?g.DETECTED_PROCESSES:g.DETECTED_CONTAINERS,titleBadge:L.isLoading?ue.Loading:L.containers.length,description:L.description||(m?g.DETECTED_PROCESSES_DESCRIPTION:g.DETECTED_CONTAINERS_DESCRIPTION),children:L.containers.map(e=>t(pi,{...e,callbackRuntimeOverride:e=>l(f,e)},`source-container-${e.containerName}`))}),R.manifestYAML&&t(ai,{title:`${R.kind} YAML`,yaml:R.manifestYAML,defaultOpen:!R.instrumentationConfigYAML}),R.instrumentationConfigYAML&&t(ai,{title:"Instrumentation Config YAML",yaml:R.instrumentationConfigYAML,defaultOpen:!R.manifestYAML})]}):T===Rr.Pods?t(Fr,{source:R,fetchSourceDescribe:u,restartPod:Pr.includes(R?.kind)?h:void 0}):t(Mr,{source:R,fetchSourceLibraries:p})}):null},zr=p.div`
484
+ `,Ll=({persistSources:i,updateSource:o,restartWorkloads:r,fetchSourceById:s,fetchSourceDescribe:c,fetchSourceLibraries:d,restartPod:u})=>{const{isVm:p}=Be(),{sources:h}=z(),{selectedStreamName:g}=We(),{drawerType:y,drawerEntityId:v}=L(),b=l(()=>Ue(h,g),[h,g]),f=n(null),x=y===H.Source,[S,$]=t(!1),[k,C]=t(!1),[w,D]=t(Al.Overview),[T,N]=t(null);a(()=>{x&&v&&s(v).then(e=>N(e||null))},[x,v]);const{formData:E,handleFormChange:O,resetFormData:A,loadFormWithDrawerItem:F}=oa(),I=l(()=>{if(v)return T&&JSON.stringify(qt(T))===JSON.stringify(qt(v))?T:b?.find(e=>JSON.stringify(qt(e))===JSON.stringify(qt(v)))},[v,b,T]);a(()=>{x&&I?F(I):A()},[x,I]);const M=l(()=>{const e=I?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===ce.Loading,containers:I?.containers||[]}},[I]),P=l(()=>{const e=[{label:Al.Overview,onClick:()=>D(Al.Overview),selected:w===Al.Overview}];return Fl.includes(I?.kind)&&e.push({label:Al.Pods,onClick:()=>D(Al.Pods),selected:w===Al.Pods}),I?.containers?.some(({language:e})=>Il.includes(e))&&e.push({label:Al.Libraries,onClick:()=>D(Al.Libraries),selected:w===Al.Libraries}),e},[w,I]);return I?e.createElement(Si,{ref:f,onClose:()=>{D(Al.Overview),N(null)},title:I.otelServiceName||I.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:Ke(I.containers),isEdit:S,isFormDirty:k,onEdit:w===Al.Overview?e=>{$("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=E.otelServiceName!==I.name?E.otelServiceName:"";O("otelServiceName",e),await o(v,{...E,otelServiceName:e}),N(null),C(!1),$(!1)},onDelete:w===Al.Overview?async()=>{const{namespace:e}=I;i({[e]:[{...I,selected:!1,currentStreamName:g}]},{}),N(null),C(!1),$(!1),f.current?.closeDrawer()}:void 0,onCancel:()=>{C(!1),$(!1),O("otelServiceName",I.otelServiceName||I.name||"")},isLastItem:1===b.length,tabs:P,headerActionButtons:[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>r([v]),children:e.createElement(e.Fragment,null,e.createElement(Ra,null),e.createElement(R,{size:14,family:"secondary",decoration:"underline"},"Restart"))}]},w===Al.Overview?S?e.createElement(Ml,null,e.createElement(Dl,{formData:E,handleFormChange:(...e)=>{C(!0),O(...e),O("currentStreamName",g)}})):e.createElement(Rl,null,e.createElement(Tl,{workloadOdigosHealthStatus:I.workloadOdigosHealthStatus}),e.createElement(U,{conditions:I.conditions||[]}),e.createElement(G,{title:m.SOURCE_DETAILS,data:I?Cl(I,p):[]}),e.createElement(G,{title:p?m.DETECTED_PROCESSES:m.DETECTED_CONTAINERS,titleBadge:M.isLoading?ce.Loading:M.containers.length,description:M.description||(p?m.DETECTED_PROCESSES_DESCRIPTION:m.DETECTED_CONTAINERS_DESCRIPTION)},M.containers.map(t=>e.createElement(sa,{key:`source-container-${t.containerName}`,...t,callbackRuntimeOverride:async e=>await o(v,e)}))),e.createElement(ea,{yaml:I.manifestYAML})):w===Al.Pods?e.createElement(Nl,{source:I,fetchSourceDescribe:c,restartPod:u}):e.createElement(Ol,{source:I,fetchSourceLibraries:d})):null},Pl=d.div`
483
485
  max-width: ${({$fullWidth:e})=>e?"unset":"420px"};
484
486
  width: 100%;
485
- `,Vr=o(({isModal:i,fetchSingleNamespace:n,onClickSummary:a},o)=>{const r=m(),{isVm:s}=Le(),c=hi({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:Ii,value:b,onChange:e=>f(e.target.value.toLowerCase())})}),!s&&t(A,{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(Sr,{isModal:i,...c})]})})});Vr.displayName=Vr.name;const Br=({fetchSingleNamespace:e,persistSources:i})=>{const{currentModal:n,setCurrentModal:a}=Q(),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(Vr,{ref:c,isModal:!0,fetchSingleNamespace:e})}):null},Wr=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},_r=({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}=Me(),{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(()=>Ln({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=Wt(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(mi,{icons:ze(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(Ot(i,B.Source,a).throughput),textColor:o.text.info},{columnKey:"conditions",component:()=>t(Mn,{conditions:n.conditions||[],id:r})},{columnKey:"containers",component:()=>t("div",{style:{lineHeight:1},children:t(de,{status:ne.Info,title:gi(n.containers),withBorder:!0})})}]}}),[C,v,i,T]),{badge:E,badgeTooltip:O}=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:O,loading:p||"number"==typeof x})]}),t(ke,{$maxHeight:n,children:t(De,{columns:Wr(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(Oe,{label:`${x}%`})]})]})]})},Jr=({expiresAt:t})=>{const i=m(),{formatTimeAgo:n}=_t(),a=n(t),o=new Date(t).toDateString().split(" ").slice(1).join(" "),r=yi(t,0)?i.text.error:yi(t,6048e5)?i.text.warning:i.text.success;return e(P,{size:14,color:r,children:[a," (",o,")"]})},Ur=p.div`
487
+ `,jl=i(({isModal:t,fetchSingleNamespace:a,onClickSummary:i},n)=>{const l=E.useTheme(),{isVm:r}=Be(),s=ca({fetchSingleNamespace:a}),{selectedSources:c,fetchingNamespace:d,selectedAllNamespaces:u,onSelectAllNamespaces:p,getApiSourcesPayload:h,getApiFutureAppsPayload:g,searchText:y,setSearchText:v,searchBy:b,setSearchBy:f,showSelectedOnly:x,setShowSelectedOnly:$,showRunningOnly:k,setShowRunningOnly:C}=s;o(n,()=>({getFormValues:()=>({apps:h(),futureApps:g()})}));const D=Object.values(c).reduce((e,t)=>e+t.filter(e=>e.selected).length,0);return e.createElement(ee,{$isNotModal:!t},e.createElement(le,{$gap:12},e.createElement(le,{$gap:24},i&&e.createElement(gt,{onClick:i}),e.createElement(A,{title:m.SELECT_SOURCES,badgeLabel:D,description:m.SELECT_SOURCES_DESCRIPTION}),e.createElement(de,{$justifyContent:"space-between"},e.createElement(Pl,{$fullWidth:r},e.createElement(S,{placeholder:b===H.Source?m.SEARCH_SOURCES:m.SEARCH_NAMESPACES,icon:Ea,value:y,onChange:e=>v(e.target.value.toLowerCase())})),!r&&e.createElement(O,{options:[{label:m.SOURCE,value:H.Source,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary},{label:m.NAMESPACE,value:H.Namespace,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary}],selected:b,setSelected:f})),e.createElement(de,{$gap:36},e.createElement(w,{title:m.SELECT_ALL,initialValue:u,onChange:p,disabled:!!d}),e.createElement(w,{title:m.ONLY_SELECTED,initialValue:x,onChange:$}),e.createElement(w,{title:m.ONLY_RUNNING_INSTANCES,initialValue:k,onChange:C}))),e.createElement(oe,null),e.createElement(vl,{isModal:t,...s})))});jl.displayName=jl.name;const Kl=({fetchSingleNamespace:t,persistSources:a})=>{const{currentModal:i,setCurrentModal:o}=X(),l=i===H.Source,r=()=>{o("")},s=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();a(e,t),r()}},c=n(null);return P({key:"Enter",active:l},s),l?e.createElement(Q,{isOpen:l,onClose:r,header:{title:"Add Source"},actionComponent:e.createElement(Z,{buttons:[{label:"DONE",variant:"primary",onClick:s}]})},e.createElement(jl,{ref:c,isModal:!0,fetchSingleNamespace:t})):null},Vl=e=>{const t=[{key:"checkbox-and-icon",title:""},{key:"name",title:m.NAME,sortable:!0},{key:"kind",title:"Kind",sortable:!0}];return e||t.push({key:"namespace",title:m.NAMESPACE,sortable:!0}),t.push({key:"containers",title:m.DETECTED_CONTAINERS}),t.push({key:"conditions",title:"Conditions"}),t.push({key:"throughput",title:"Throughput",sortable:!0}),t},ql=({metrics:t,maxHeight:a,maxWidth:i})=>{const n=p(),{isVm:o}=Be(),r=he(),{selectedStreamName:c}=We(),{sources:d,sourcesLoading:u}=z(),{setDrawerType:h,setDrawerEntityId:g}=L(),{selectedSources:y,setSelectedSources:v}=Fe(),{progress:b}=qe(),x=l(()=>b[He.Instrumenting]||b[He.Uninstrumenting]?b[He.Instrumenting]?.percentage||b[He.Uninstrumenting]?.percentage||0:void 0,[b[He.Instrumenting],b[He.Uninstrumenting]]),S=l(()=>Ue(d,c),[d,c]),$=l(()=>Ai({instrumentationRules:[],sources:Je(S,r),actions:[],destinations:[],searchText:r.searchText,selectedCategory:H.Source}).searchResults.find(({category:e})=>e===H.Source)?.entities||[],[S,r]),[k,C]=l(()=>{let e=0;return Object.values(y).forEach(t=>{e+=t.length}),[0!==e,e]},[y]),w=s(e=>{if(e){const e={};$.forEach(t=>{const{namespace:a}=t;e[a]?e[a].push(t):e[a]=[t]}),v(e)}else v({})},[$]),D=s(e=>{const{namespace:t,name:a,kind:i}=e,n={...y};n[t]||(n[t]=[]);const o=n[t].findIndex(e=>e.name===a&&e.kind===i);-1===o?n[t].push(e):n[t].splice(o,1),v(n)},[y]),T=l(()=>$.map(a=>{const i=qt(a),o=JSON.stringify(i),{hasErrors:l,hasWarnings:r,hasDisableds:s}=re(a.conditions||[]),c=!!y[i.namespace]?.find(e=>e.namespace===i.namespace&&e.name===i.name&&e.kind===i.kind);return{status:l?ae.Error:r?ae.Warning:void 0,faded:s,onClick:()=>{h(H.Source),g(i)},cells:[{columnKey:"checkbox-and-icon",component:()=>e.createElement(de,{$gap:16},e.createElement(f,{value:c,onChange:()=>D(a)}),e.createElement(da,{icons:Ke(a.containers),id:o}))},{columnKey:"name",value:ve(a,H.Source,{extended:!0})},{columnKey:"kind",value:a.kind,textColor:n.text.info},{columnKey:"namespace",value:a.namespace,textColor:n.text.info},{columnKey:"throughput",value:Re(Nt(t,H.Source,i).throughput),textColor:n.text.info},{columnKey:"conditions",component:()=>e.createElement(Ei,{conditions:a.conditions||[],id:o})},{columnKey:"containers",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:ae.Info,title:ua(a.containers),withBorder:!0}))}]}}),[$,y,t,D]),{badge:N,badgeTooltip:E}=l(()=>$.length!==S.length?{badge:`${$.length}/${S.length}`,badgeTooltip:m.FILTERED_COUNT_TOOLTIP}:{badge:S.length,badgeTooltip:void 0},[$,S]);return e.createElement(fe,{$maxWidth:i},e.createElement(xe,null,e.createElement(f,{partiallyChecked:k&&$?.length!==C,value:k&&$?.length===C,onChange:w,disabled:!$?.length}),e.createElement(Se,{icon:$e(H.Source),title:m.SOURCES,badge:N,badgeTooltip:E,loading:u||"number"==typeof x})),e.createElement(ke,{$maxHeight:a},e.createElement(Ce,{columns:Vl(o),rows:T})),"number"!=typeof x||T.length?T.length?null:e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(De,null)):e.createElement(we,{style:{marginTop:"2rem",gap:"24px"}},e.createElement(Te,{width:420}),e.createElement(de,{$gap:16},e.createElement(R,{color:n.text.info},b[He.Instrumenting]?"Instrumenting":"Uninstrumenting"," workloads..."),e.createElement(Ne,{label:`${x}%`}))))},Hl=({expiresAt:t})=>{const a=E.useTheme(),{formatTimeAgo:i}=Ht(),n=i(t),o=new Date(t).toDateString().split(" ").slice(1).join(" "),l=pa(t,0)?a.text.error:pa(t,6048e5)?a.text.warning:a.text.success;return e.createElement(R,{size:14,color:l},n," (",o,")")},zl=d.div`
486
488
  position: relative;
487
- `,Yr=({token:i,saveToken:a})=>{const{CopyButton:o}=vi(),{formData:r,handleFormChange:l,resetFormData:s}=bi({token:i}),[c,d]=n(!1),u=()=>{d(!1),s()};return e(pe,{$gap:0,children:[t(o,{value:i,size:fi.L}),t(re,{orientation:"vertical",length:"12px"}),e(Ur,{children:[t(mt,{size:32,onClick:()=>{d(!0)},children:t(Ni,{})}),c&&t(xi,{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)})})]})]})},Gr=({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:Yi},{columnKey:"name",value:e},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>t(Jr,{expiresAt:a})},{columnKey:"actions",component:()=>t(Yr,{token:n,saveToken:i})}]}))}}]}),Xr=({fetchDescribeOdigos:o})=>{const[r,l]=n(null);if(a(()=>{o().then(({data:e})=>l(e?.describeOdigos||null))},[]),!r)return t(Te,{children:t(Fe,{})});const s=e=>e?.name?[t(re,{},`divider-${e.name}`),t(ii,{title:e.name,subTitle:e.explain||void 0,value:{status:e.status||(li(e.value)?si(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)})]})},Zr=p.div`
489
+ `,Bl=({token:a,saveToken:i})=>{const{CopyButton:n}=ma(),{formData:o,handleFormChange:l,resetFormData:r}=ha({token:a}),[s,c]=t(!1),d=()=>{c(!1),r()};return e.createElement(de,{$gap:0},e.createElement(n,{value:a,size:ga.L}),e.createElement(oe,{orientation:"vertical",length:"12px"}),e.createElement(zl,null,e.createElement(pt,{size:32,onClick:()=>{c(!0)}},e.createElement(Ca,null)),s&&e.createElement(ya,{flipX:!0,clientX:36,isOpen:s,onClose:d,onSave:()=>{i(o.token).then(d)},title:"Enter a new API Token",titleTooltip:"Contact us to generate a new one"},e.createElement(S,{placeholder:"API Token",type:"password",value:o.token,onChange:e=>l("token",e.target.value)}))))},Wl=({tokens:t,saveToken:a})=>e.createElement(G,{title:"Authorization Tokens",titleBadge:t.length,data:[{type:h.Table,value:{columns:[{key:"icon",title:""},{key:"name",title:"Name"},{key:"expires_at",title:"Expires"},{key:"token",title:"Token"},{key:"actions",title:""}],rows:t.map(({name:t,token:i,expiresAt:n})=>({cells:[{columnKey:"icon",icon:Wa},{columnKey:"name",value:t},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>e.createElement(Hl,{expiresAt:n})},{columnKey:"actions",component:()=>e.createElement(Bl,{token:i,saveToken:a})}]}))}}]}),_l=({fetchDescribeOdigos:i})=>{const[n,o]=t(null);if(a(()=>{i().then(({data:e})=>o(e?.describeOdigos||null))},[]),!n)return e.createElement(we,null,e.createElement(Oe,null));const l=t=>t?.name?[e.createElement(oe,{key:`divider-${t.name}`}),e.createElement(Qt,{key:`describe-row-${t.name}`,title:t.name,subTitle:t.explain||void 0,value:{status:t.status||(ia(t.value)?na(t.value)?ae.Success:ae.Error:ae.Default),text:t.value}})]:[];return e.createElement(e.Fragment,null,e.createElement(G,{title:"General Information",withExtend:!0,initialExtended:!0,data:[{title:n?.odigosVersion?.name,value:n?.odigosVersion?.value},{title:n?.kubernetesVersion?.name,value:n?.kubernetesVersion?.value},{title:n?.installationMethod?.name,value:n?.installationMethod?.value},{title:n?.tier?.name,value:n?.tier?.value},{title:"# of sources",value:n?.numberOfSources?.toString()},{title:"# of destinations",value:n?.numberOfDestinations?.toString()}]}),e.createElement(G,{title:"Cluster Collector",withExtend:!0},Object.values(n?.clusterCollector||{}).map(l)),e.createElement(G,{title:"Node Collector",withExtend:!0},Object.values(n?.nodeCollector||{}).map(l)))},Jl=d.div`
488
490
  display: flex;
489
491
  flex-direction: column;
490
492
  gap: 12px;
491
- `,Qr="System Overview",el=({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(Gi,{size:18})},Qr),t(H,{width:"750px",isOpen:l,onClose:c,header:{icons:[Gi],title:Qr},footer:{isOpen:!1},children:e(Zr,{children:[!!a?.length&&t(Gr,{tokens:a,saveToken:o}),t(Xr,{fetchDescribeOdigos:r})]})})]})},tl=p.div`
493
+ `,Ul="System Overview",Gl=({tokens:a,saveToken:i,fetchDescribeOdigos:n})=>{const[o,l]=t(!1),r=()=>l(e=>!e);return e.createElement(e.Fragment,null,e.createElement(pt,{key:Ul,onClick:r,tooltip:Ul},e.createElement(_a,{size:18})),e.createElement(K,{width:"750px",isOpen:o,onClose:r,header:{icons:[_a],title:Ul},footer:{isOpen:!1}},e.createElement(Jl,null,!!a?.length&&e.createElement(Wl,{tokens:a,saveToken:i}),e.createElement(_l,{fetchDescribeOdigos:n}))))},Yl=d.div`
492
494
  position: fixed;
493
495
  bottom: 12px;
494
496
  left: 12px;
@@ -497,7 +499,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
497
499
  flex-direction: column-reverse;
498
500
  gap: 6px;
499
501
  max-width: 600px;
500
- `,il=()=>{const{notifications:e,markAsDismissed:i,markAsSeen:n}=qt(),{onClickNotification:a}=Jt();return t(tl,{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}`))})},nl=p.div`
502
+ `,Xl=()=>{const{notifications:t,markAsDismissed:a,markAsSeen:i}=jt(),{onClickNotification:n}=zt();return e.createElement(Yl,null,t.filter(({dismissed:e})=>!e).map(({id:t,type:o,title:l,message:r,crdType:s,target:c})=>e.createElement(te,{key:`toast-${t}`,id:t,type:o,title:l,message:r,action:s&&c?{label:"go to details",onClick:()=>n({id:t,crdType:s,target:c},{dismissToast:!0})}:void 0,onClose:()=>(({id:e,asSeen:t})=>{a(e),i(e)})({id:t,asSeen:!0})})))},Ql=d.div`
501
503
  position: relative;
502
504
  display: flex;
503
505
  align-items: center;
@@ -516,7 +518,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
516
518
  stroke: ${({theme:e})=>e.text.secondary};
517
519
  }
518
520
  }
519
- `,al=p.div`
521
+ `,Zl=d.div`
520
522
  position: absolute;
521
523
  top: 2px;
522
524
  left: ${({$darkMode:e})=>e?"2px":"calc(100% - 2px - 24px)"};
@@ -526,50 +528,50 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
526
528
  background-color: ${({theme:e})=>e.colors.border};
527
529
  border-radius: 100%;
528
530
  transition: all 0.3s;
529
- `,ol=({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})}),rl=()=>{const{darkMode:i,setDarkMode:n}=Si();return e(nl,{onClick:()=>n(!i),children:[t(ol,{path:"M14 7.977A4.333 4.333 0 1 1 8.023 2H8a6 6 0 1 0 6 6v-.023Z"}),t(ol,{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(al,{$darkMode:i})]})},ll=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)},sl=(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},cl=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},dl=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:$i(o)}),s.push({title:"Start time",value:new Date(r/1e3).toLocaleString()}),l.length&&(s.push({type:y.Divider}),s.push({title:"Warnings",titleIcon:Xi,value:l})),s},ul=(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},pl=p.div`
531
+ `,er=({path:t})=>e.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"none"},e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:t})),tr=()=>{const{darkMode:t,setDarkMode:a}=va();return e.createElement(Ql,{onClick:()=>a(!t)},e.createElement(er,{path:"M14 7.977A4.333 4.333 0 1 1 8.023 2H8a6 6 0 1 0 6 6v-.023Z"}),e.createElement(er,{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"}),e.createElement(Zl,{$darkMode:t}))},ar=e=>{const{spans:t}=e,a=new Map;t.forEach(e=>{a.set(e.spanID,{...e,spans:[]})});const i=[];return t.forEach(e=>{const t=a.get(e.spanID);let n=!1;if(e.references.length){const t=e.references.find(e=>"CHILD_OF"===e.refType);t&&t.spanID&&a.has(t.spanID)||(n=!0)}else n=!0;if(n)i.push(t);else{const i=e.references.find(e=>"CHILD_OF"===e.refType);if(i){const e=a.get(i.spanID);e&&(e.spans=e.spans||[],e.spans.push(t),e.spans=e.spans.sort((e,t)=>e.startTime-t.startTime))}}}),i.sort((e,t)=>e.startTime-t.startTime)},ir=(e,t)=>{const{tags:a}=e,i={},n=[];return a.forEach(e=>{i[e.key]=e.value}),n.push({type:h.Code,value:{language:"json",code:JSON.stringify(i,null,2),pretty:t}}),n},nr=e=>{const{logs:t}=e,a=[];return t.forEach((e,i)=>{e.fields.forEach(e=>{a.push({title:e.key,value:e.value})}),i!==t.length-1&&a.push({type:h.Divider})}),a},or=e=>{const{traceID:t,spanID:a,processID:i,operationName:n,duration:o,startTime:l,warnings:r}=e,s=[];return s.push({type:h.CopyText,title:"Trace ID",value:t}),s.push({type:h.CopyText,title:"Span ID",value:a}),s.push({type:h.Divider}),s.push({title:"Service",value:i}),s.push({title:"Operation",value:n}),s.push({title:"Duration",value:ba(o)}),s.push({title:"Start time",value:new Date(l/1e3).toLocaleString()}),r.length&&(s.push({type:h.Divider}),s.push({title:"Warnings",titleIcon:Ja,value:r})),s},lr=(e,t)=>{const{tags:a}=e,i={},n=[];return a.forEach(e=>{i[e.key]=e.value}),n.push({type:h.Code,value:{language:"json",code:JSON.stringify(i,null,2),pretty:t}}),n},rr=d.div`
530
532
  display: flex;
531
533
  flex-direction: column;
532
534
  gap: 12px;
533
535
  max-height: 100vh;
534
536
  overflow-y: auto;
535
- `,hl=({span:i,process:a,onClose:o})=>{const[r,l]=n(!0),[s,c]=n(!0);return t(H,{width:"750px",isOpen:!0,onClose:o,header:{icons:[Zi],title:i.operationName},footer:{isOpen:!1},children:e(pl,{children:[t(G,{title:"Details",data:dl(i)}),i.logs.length>0&&t(G,{title:"Errors",titleBadge:i.logs.length,titleIcon:Xi,data:cl(i)}),t(G,{title:"Tags",data:sl(i,r),action:t(Ci,{isPrettyMode:r,setIsPrettyMode:l})}),a&&t(G,{title:`Process (${a.serviceName})`,data:ul(a,s),action:t(Ci,{isPrettyMode:s,setIsPrettyMode:c})})]})})},ml=370,gl=["#33DCA7","#50F6E8","#444AD9","#8B55FF","#FF7CA9"].reverse(),yl=p.div`
537
+ `,sr=({span:a,process:i,onClose:n})=>{const[o,l]=t(!0),[r,s]=t(!0);return e.createElement(K,{width:"750px",isOpen:!0,onClose:n,header:{icons:[Ua],title:a.operationName},footer:{isOpen:!1}},e.createElement(rr,null,e.createElement(G,{title:"Details",data:or(a)}),a.logs.length>0&&e.createElement(G,{title:"Errors",titleBadge:a.logs.length,titleIcon:Ja,data:nr(a)}),e.createElement(G,{title:"Tags",data:ir(a,o),action:e.createElement(fa,{isPrettyMode:o,setIsPrettyMode:l})}),i&&e.createElement(G,{title:`Process (${i.serviceName})`,data:lr(i,r),action:e.createElement(fa,{isPrettyMode:r,setIsPrettyMode:s})})))},cr=370,dr=["#33DCA7","#50F6E8","#444AD9","#8B55FF","#FF7CA9"].reverse(),ur=d.div`
536
538
  display: flex;
537
539
  align-items: center;
538
- width: ${ml}px;
539
- background-color: ${({$withErrors:e,theme:t})=>e?t.colors.error+F["042"]:t.colors.dark_grey};
540
+ width: ${cr}px;
541
+ background-color: ${({$withErrors:e,theme:t})=>e?t.colors.error+E.opacity.hex["042"]:t.colors.dark_grey};
540
542
  &:hover {
541
- ${({$withErrors:e,$preventHover:t,theme:i})=>!t&&`background-color: ${e?i.colors.error:i.colors.secondary+F["010"]};`}
543
+ ${({$withErrors:e,$preventHover:t,theme:a})=>!t&&`background-color: ${e?a.colors.error:a.colors.secondary+E.opacity.hex["010"]};`}
542
544
  cursor: ${({$preventHover:e})=>e?"default":"pointer"};
543
545
  }
544
- `,vl=p(pe)`
546
+ `,pr=d(de)`
545
547
  align-items: center;
546
548
  justify-content: space-between;
547
549
  gap: 4px;
548
550
  padding: 12px;
549
551
  padding-left: ${({$depth:e})=>12*e||12}px;
550
- width: calc(${ml}px - ${({$depth:e})=>12*e}px);
551
- `,bl=p(pe)`
552
+ width: calc(${cr}px - ${({$depth:e})=>12*e}px);
553
+ `,mr=d(de)`
552
554
  align-items: center;
553
555
  gap: 4px;
554
556
  position: absolute;
555
557
  right: 56px;
556
558
  width: calc(100% - ${434}px);
557
- `,fl=p.div`
559
+ `,hr=d.div`
558
560
  position: absolute;
559
- left: ${({$startTime:e,$minStartTime:t,$maxEndTime:i})=>(e-t)/(i-t)*100+"%"};
561
+ left: ${({$startTime:e,$minStartTime:t,$maxEndTime:a})=>(e-t)/(a-t)*100+"%"};
560
562
  width: ${({$duration:e,$maxDuration:t})=>e/t*100+"%"};
561
563
  height: 12px;
562
564
  border-radius: 32px;
563
- background-color: ${({$indexInMatrix:e})=>gl[e%gl.length]};
564
- `,xl=p(P)`
565
+ background-color: ${({$indexInMatrix:e})=>dr[e%dr.length]};
566
+ `,gr=d(R)`
565
567
  padding-left: calc(100% + 8px);
566
568
  font-size: 10px;
567
569
  color: ${({theme:e})=>e.text.darker_grey};
568
570
  font-family: ${({theme:e})=>e.font_family.secondary};
569
571
  white-space: nowrap;
570
- `,Sl=({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=ml-12*a-20-(c?12:0),x=c&&(1===a||i.logs.length>0);return e(yl,{className:"span-container",$withErrors:c,$preventHover:v,onClick:g,children:[e(vl,{$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(ki,{maxWidth:f/2,text:i.processID,textSize:14}),t(P,{size:12,color:y.text.darker_grey,children:"•"}),t(ki,{maxWidth:f/2,text:i.operationName,textSize:12,textColor:y.text.darker_grey})]}),c&&(x?t(me,{...d,children:t(Xi,{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(bl,{className:"span-right",children:t(fl,{$indexInMatrix:o,$duration:i.duration,$maxDuration:r,$startTime:i.startTime,$minStartTime:l,$maxEndTime:s,children:t(xl,{children:$i(i.duration)})})})]})},$l=({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:wi(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(Sl,{span:i,depth:a,indexInMatrix:o+p+a,maxDuration:r,minStartTime:l,maxEndTime:s,withErrors:v,errorTooltip:{titleIcon:Xi,title:b,text:f},isOpen:m,withToggle:g,onToggleOpen:()=>c.set(e=>e.some(e=>e===h)?e.filter(e=>e!=h):[...e,h,...wi(i,"spans","spanID")]),onSelect:()=>d.set(e=>e?.spanID===h?null:i)}),m&&g?t($l,{spans:i.spans||[],logs:y,depth:a+1,indexInMatrix:o+p,maxDuration:r,minStartTime:l,maxEndTime:s,openSpanIdsState:c,selectedSpanState:d}):null]},`span-${h}`)})},Cl=p.div`
572
+ `,yr=({span:a,depth:i,indexInMatrix:n,maxDuration:o,minStartTime:l,maxEndTime:r,withErrors:s,errorTooltip:c,isOpen:d,withToggle:u,onToggleOpen:p,onSelect:m})=>{const h=E.useTheme(),[g,y]=t(!1),v=cr-12*i-20-(s?12:0),b=s&&(1===i||a.logs.length>0);return e.createElement(ur,{className:"span-container",$withErrors:s,$preventHover:g,onClick:m},e.createElement(pr,{$depth:i,className:"span-left"},e.createElement(de,{$gap:4,$alignItems:"center"},u?e.createElement("div",{onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1)},e.createElement(pt,{onClick:e=>{e.stopPropagation(),p?.()},size:24},e.createElement(mt,{extend:d??!1}))):e.createElement("div",{style:{width:"24px"}}),e.createElement(Sa,{maxWidth:v/2,text:a.processID,textSize:14}),e.createElement(R,{size:12,color:h.text.darker_grey},"•"),e.createElement(Sa,{maxWidth:v/2,text:a.operationName,textSize:12,textColor:h.text.darker_grey})),s&&(b?e.createElement(pe,{...c},e.createElement(Ja,{fill:h.text.error})):e.createElement("div",{style:{position:"relative"}},e.createElement("div",{style:{position:"absolute",top:"-24px",right:"8px"}},e.createElement(oe,{type:ae.Error,orientation:"vertical",thickness:1,length:"48px",margin:"0",opacity:.5}))))),e.createElement(mr,{className:"span-right"},e.createElement(hr,{$indexInMatrix:n,$duration:a.duration,$maxDuration:o,$startTime:a.startTime,$minStartTime:l,$maxEndTime:r},e.createElement(gr,null,ba(a.duration)))))},vr=({spans:t,logs:a,depth:i,indexInMatrix:n,maxDuration:o,minStartTime:l,maxEndTime:r,openSpanIdsState:s,selectedSpanState:c})=>{const d=E.useTheme();return t.map((t,u)=>{const p=t.spanID,m=s.value.includes(p),h=!!t.spans?.length,g=a.length?a:xa(t,"spans","logs"),y=g.length>0,v=y?g.length>1?`(${g.length}) errors`:g[0].fields.find(e=>"exception.message"===e.key)?.value:void 0,b=y?g.length>1?void 0:g[0].fields.find(e=>"exception.stacktrace"===e.key)?.value:void 0;return e.createElement("div",{key:`span-${p}`,style:{borderBottom:1===i?`1px dotted ${d.colors.border}`:"none"}},e.createElement(yr,{span:t,depth:i,indexInMatrix:n+u+i,maxDuration:o,minStartTime:l,maxEndTime:r,withErrors:y,errorTooltip:{titleIcon:Ja,title:v,text:b},isOpen:m,withToggle:h,onToggleOpen:()=>s.set(e=>e.some(e=>e===p)?e.filter(e=>e!=p):[...e,p,...xa(t,"spans","spanID")]),onSelect:()=>c.set(e=>e?.spanID===p?null:t)}),m&&h?e.createElement(vr,{spans:t.spans||[],logs:g,depth:i+1,indexInMatrix:n+u,maxDuration:o,minStartTime:l,maxEndTime:r,openSpanIdsState:s,selectedSpanState:c}):null)})},br=d.div`
571
573
  width: 100%;
572
- `,wl=p.div`
574
+ `,fr=d.div`
573
575
  max-height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
574
576
  overflow: auto;
575
577
 
@@ -579,22 +581,22 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
579
581
  border-radius: 24px;
580
582
  border: 1px solid ${({theme:e})=>e.colors.dropdown_bg_2};
581
583
  position: relative;
582
- `,kl=p.div`
584
+ `,xr=d.div`
583
585
  padding: 12px 12px 12px 24px;
584
- width: calc(${ml}px - 36px);
586
+ width: calc(${cr}px - 36px);
585
587
  background-color: ${({theme:e})=>e.colors.dark_grey};
586
- `,Dl=p.div`
588
+ `,Sr=d.div`
587
589
  width: 1px;
588
590
  height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
589
591
  background: ${({theme:e})=>`linear-gradient(to bottom, ${e.colors.border}, transparent)`};
590
592
 
591
593
  position: absolute;
592
- left: calc(${ml}px + ((100% - ${ml}px) / ${5}) * ${({index:e})=>e});
593
- `,Tl=p(P)`
594
+ left: calc(${cr}px + ((100% - ${cr}px) / ${5}) * ${({index:e})=>e});
595
+ `,$r=d(R)`
594
596
  color: ${({theme:e})=>e.text.darker_grey};
595
597
  font-size: 12px;
596
598
  font-family: ${({theme:e})=>e.font_family.secondary};
597
599
  padding-top: 12px;
598
600
  padding-left: 12px;
599
601
  white-space: nowrap;
600
- `,Nl=({heightToRemove:a,traces:o,isLoading:r})=>{const[l,c]=n([]),[d,u]=n(null),p=s(()=>Tt(o).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:ll(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(Cl,{$heightToRemove:a,children:r?t(Te,{$height:"50vh",children:t(Fe,{scale:1.5})}):p.length?e(wl,{$heightToRemove:a,children:[t(kl,{children:t(P,{children:"Service & operation"})}),new Array(5).fill(null).map((e,i)=>t(Dl,{$heightToRemove:a,index:i,children:t(Tl,{children:$i(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($l,{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(hl,{span:d,process:m,onClose:()=>u(null)})]})};export{On as ActionDrawer,kn as ActionForm,Fn as ActionModal,jn as ActionTable,Vn as AwaitPipeline,da as ConditionDropdown,oa as DataFlow,La as DataFlowActionsMenu,Da as DataStreamDrawer,wa as DataStreamForm,ja as DataStreamModal,Pa as DataStreamSelectionForm,Xa as DestinationDrawer,Ua as DestinationForm,vo as DestinationModal,$o as DestinationSelectionForm,wo as DestinationTable,ua as ErrorDropdown,qo as InstrumentationRuleDrawer,Po as InstrumentationRuleForm,Vo as InstrumentationRuleModal,_o as InstrumentationRuleTable,ga as KindDropdown,pa as LanguageDropdown,ha as MonitorDropdown,Uo as MultiSourceControl,ma as NamespaceDropdown,kr as NavIconIds,er as NotificationManager,Dn as OverviewDrawer,ya as PodsAgentInjectionStatusDropdown,ur as ServiceMap,wr as SetupSummary,Dr as SideNav,Tr as SlackInvite,Hr as SourceDrawer,Or as SourceForm,Br as SourceModal,Vr as SourceSelectionForm,_r as SourceTable,el as SystemOverview,Mn as TableCellConditions,il as ToastList,rl as ToggleDarkMode,Nl as TraceView};
602
+ `,kr=({heightToRemove:a,traces:i,isLoading:n})=>{const[o,r]=t([]),[s,c]=t(null),d=l(()=>wt(i).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:ar(e)})),[i]),u=l(()=>d.reduce((e,t)=>Math.max(e,t.spans.reduce((e,t)=>e+t.duration,0)),0),[d]),p=l(()=>{const e=d.find(e=>e.spans.some(e=>e.spanID===s?.spanID)),t=e?.processes.find(e=>e.serviceName===s?.processID);return t},[d,s]);return e.createElement(e.Fragment,null,e.createElement(br,{$heightToRemove:a},n?e.createElement(we,{$height:"50vh"},e.createElement(Oe,{scale:1.5})):d.length?e.createElement(fr,{$heightToRemove:a},e.createElement(xr,null,e.createElement(R,null,"Service & operation")),new Array(5).fill(null).map((t,i)=>e.createElement(Sr,{key:`${i}-divider`,$heightToRemove:a,index:i},e.createElement($r,null,ba(u/5*i)))),d.map((t,a)=>{const{spans:i}=t,n=i.reduce((e,t)=>Math.min(e,t.startTime),Number.MAX_SAFE_INTEGER),l=i.reduce((e,t)=>Math.max(e,t.startTime+t.duration),0);return e.createElement(vr,{key:`recursive-spans-${t.traceID}`,spans:i,logs:[],depth:1,indexInMatrix:a,maxDuration:u,minStartTime:n,maxEndTime:l,openSpanIdsState:{value:o,set:r},selectedSpanState:{value:s,set:c}})})):e.createElement(we,{$height:"50vh"},e.createElement(De,{title:m.NO_TRACES_FOUND,subTitle:m.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}))),s&&e.createElement(sr,{span:s,process:p,onClose:()=>c(null)}))};export{wi as ActionDrawer,xi as ActionForm,Ti as ActionModal,Ii as ActionTable,ji as AwaitPipeline,ln as ConditionDropdown,en as DataFlow,Fn as DataFlowActionsMenu,$n as DataStreamDrawer,xn as DataStreamForm,Mn as DataStreamModal,In as DataStreamSelectionForm,Jn as DestinationDrawer,Bn as DestinationForm,mo as DestinationModal,bo as DestinationSelectionForm,xo as DestinationTable,rn as ErrorDropdown,Lo as InstrumentationRuleDrawer,Io as InstrumentationRuleForm,Ko as InstrumentationRuleModal,Ho as InstrumentationRuleTable,un as KindDropdown,sn as LanguageDropdown,cn as MonitorDropdown,Bo as MultiSourceControl,dn as NamespaceDropdown,Sl as NavIconIds,Yo as NotificationManager,Si as OverviewDrawer,pn as PodsAgentInjectionStatusDropdown,rl as ServiceMap,xl as SetupSummary,$l as SideNav,kl as SlackInvite,Ll as SourceDrawer,Dl as SourceForm,Kl as SourceModal,jl as SourceSelectionForm,ql as SourceTable,Gl as SystemOverview,Ei as TableCellConditions,Xl as ToastList,tr as ToggleDarkMode,kr as TraceView};