@odigos/ui-kit 0.0.123 → 0.0.124

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 (46) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/lib/chunks/ui-components-898f30d4.js +1655 -0
  3. package/lib/chunks/vendor-f206ac21.js +1 -0
  4. package/lib/components/index.d.ts +1 -0
  5. package/lib/components/loading-text/index.d.ts +1 -1
  6. package/lib/components/scroll-y/index.d.ts +8 -0
  7. package/lib/components/styled.d.ts +1 -0
  8. package/lib/components/v2.js +1 -1
  9. package/lib/components.js +1 -1
  10. package/lib/constants.js +1 -1
  11. package/lib/containers/data-flow/column/add.d.ts +8 -0
  12. package/lib/containers/data-flow/column/base.d.ts +20 -0
  13. package/lib/containers/data-flow/column/frame.d.ts +11 -0
  14. package/lib/containers/data-flow/column/head.d.ts +10 -0
  15. package/lib/containers/data-flow/column/index.d.ts +13 -0
  16. package/lib/containers/data-flow/index.d.ts +2 -2
  17. package/lib/containers.js +194 -106
  18. package/lib/functions.js +1 -1
  19. package/lib/hooks.js +1 -1
  20. package/lib/icons.js +1 -1
  21. package/lib/snippets/react-flow/index.d.ts +0 -10
  22. package/lib/snippets.js +1 -1
  23. package/lib/store.js +1 -1
  24. package/lib/theme.js +1 -1
  25. package/lib/types.js +1 -1
  26. package/lib/visuals.js +1 -1
  27. package/package.json +2 -1
  28. package/lib/chunks/ui-components-16ba4841.js +0 -1755
  29. package/lib/chunks/vendor-1dea551d.js +0 -1
  30. package/lib/containers/data-flow/helpers/build-action-nodes.d.ts +0 -17
  31. package/lib/containers/data-flow/helpers/build-destination-nodes.d.ts +0 -17
  32. package/lib/containers/data-flow/helpers/build-edges.d.ts +0 -12
  33. package/lib/containers/data-flow/helpers/build-other-nodes.d.ts +0 -8
  34. package/lib/containers/data-flow/helpers/build-rule-nodes.d.ts +0 -17
  35. package/lib/containers/data-flow/helpers/build-source-nodes.d.ts +0 -18
  36. package/lib/containers/data-flow/helpers/get-node-positions.d.ts +0 -11
  37. package/lib/snippets/react-flow/edges/labeled-edge.d.ts +0 -10
  38. package/lib/snippets/react-flow/node-config.d.ts +0 -6
  39. package/lib/snippets/react-flow/nodes/add-node.d.ts +0 -11
  40. package/lib/snippets/react-flow/nodes/base-node.d.ts +0 -21
  41. package/lib/snippets/react-flow/nodes/edged-node.d.ts +0 -9
  42. package/lib/snippets/react-flow/nodes/frame-node.d.ts +0 -9
  43. package/lib/snippets/react-flow/nodes/header-node.d.ts +0 -14
  44. package/lib/snippets/react-flow/nodes/odi-logo-node.d.ts +0 -5
  45. package/lib/snippets/react-flow/nodes/scroll-node.d.ts +0 -15
  46. package/lib/snippets/react-flow/nodes/skeleton-node.d.ts +0 -8
package/lib/containers.js CHANGED
@@ -1,4 +1,4 @@
1
- import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperativeHandle as a,useMemo as l,Fragment as r,useCallback as s,Children as c}from"react";import d,{css as u}from"styled-components";import{D as p,a as m,A as h,K as g,F as y,C as v,b as f,c as b,I as x,d as C,i as $,e as k,f as S,g as w,h as D,j as N,k as T,T as I,S as E,l as O,m as M,M as A,n as F,u as R,o as L,p as P,q,B as K,r as H,s as z,t as W,E as j,v as V,w as B,x as U,y as _,z as G,G as J,H as Y,J as Q,L as X,N as Z,O as ee,P as te,Q as oe,R as ie,U as ne,V as ae,W as le,X as re,Y as se,Z as ce,_ as de,$ as ue,a0 as pe,a1 as me,a2 as he,a3 as ge,a4 as ye,a5 as ve,a6 as fe,a7 as be,a8 as xe,a9 as Ce,aa as $e,ab as ke,ac as Se,ad as we,ae as De,af as Ne,ag as Te,ah as Ie,ai as Ee,aj as Oe,ak as Me,al as Ae,am as Fe,an as Re,ao as Le,ap as Pe,aq as qe,ar as Ke,as as He,at as ze,au as We,av as je,aw as Ve,ax as Be,ay as Ue,az as _e,aA as Ge,aB as Je,aC as Ye,aD as Qe,aE as Xe,aF as Ze,aG as et,aH as tt,aI as ot,aJ as it,aK as nt,aL as at,aM as lt,aN as rt,aO as st,aP as ct,aQ as dt,aR as ut,aS as pt,aT as mt,aU as ht,aV as gt,aW as yt,aX as vt,aY as ft,aZ as bt,a_ as xt,a$ as Ct,b0 as $t,b1 as kt,b2 as St,b3 as wt,b4 as Dt,b5 as Nt,b6 as Tt,b7 as It,b8 as Et,b9 as Ot,ba as Mt,bb as At,bc as Ft,bd as Rt,be as Lt,bf as Pt,bg as qt,bh as Kt,bi as Ht,bj as zt,bk as Wt,bl as jt,bm as Vt,bn as Bt,bo as Ut,bp as _t,bq as Gt,br as Jt,bs as Yt,bt as Qt,bu as Xt,bv as Zt,bw as eo,bx as to,by as oo,bz as io,bA as no,bB as ao,bC as lo,bD as ro,bE as so,bF as co,bG as uo,bH as po,bI as mo,bJ as ho,bK as go,bL as yo,bM as vo,bN as fo,bO as bo,bP as xo,bQ as Co,bR as $o,bS as ko}from"./chunks/ui-components-16ba4841.js";import{CheckCircledIcon as So,CrossCircledIcon as wo,EditIcon as Do,TrashIcon as No,OdigosLogoText as To,SearchIcon as Io,FilterIcon as Eo,DataStreamsIcon as Oo,CheckIcon as Mo,OdigosLogo as Ao,ArrowIcon as Fo,PlusIcon as Ro,RefreshLeftArrowIcon as Lo,NotificationIcon as Po,UserIcon as qo,ImageErrorIcon as Ko,OverviewIcon as Ho,RulesIcon as zo,ActionsIcon as Wo,SourcesIcon as jo,DestinationsIcon as Vo,SlackLogo as Bo,CopyIcon as Uo,KeyIcon as _o,TerminalIcon as Go,GearIcon as Jo,WarningTriangleIcon as Yo,TraceViewIcon as Qo,ErrorTriangleIcon as Xo}from"./icons.js";import{useNodesState as Zo,useEdgesState as ei,applyNodeChanges as ti,MarkerType as oi}from"@xyflow/react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-1dea551d.js";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";const ii=e=>{const{type:t,name:o,notes:i,signals:n,disabled:a,fields:{collectContainerAttributes:l,collectReplicaSetAttributes:r,collectWorkloadId:s,collectClusterId:c,labelsAttributes:d,annotationsAttributes:u,clusterAttributes:y,overwriteExistingValues:v,attributeNamesToDelete:f,renames:b,piiCategories:x,fallbackSamplingRatio:C,samplingPercentage:$,endpointsFilters:k,servicesNameFilters:S,attributeFilters:w}}=e,D=[{title:p.TYPE,value:t},{type:m.ActiveStatus,title:p.STATUS,value:String(!a)},{type:m.Monitors,title:p.SIGNALS_FOR_PROCESSING,value:n?.map(e=>e.toLowerCase()).join(", ")||""},{title:p.NAME,value:o||""},{title:p.NOTES,value:i||""},{type:m.Divider}];if(t===h.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:m.Divider}),d?.forEach(({labelKey:e,attributeKey:t,from:o},i)=>{let n="";n+=`Label Key: ${e}\n`,n+=`Attribute Key: ${t}\n`,n+=`From: ${o||g.Pod}\n`,D.push({title:"Label"+(d.length>1?` #${i+1}`:""),value:n})}),u?.length&&D.push({type:m.Divider}),u?.forEach(({annotationKey:e,attributeKey:t,from:o},i)=>{let n="";n+=`Annotation Key: ${e}\n`,n+=`Attribute Key: ${t}\n`,n+=`From: ${o||g.Pod}\n`,D.push({title:"Annotation"+(u.length>1?` #${i+1}`:""),value:n})})),t===h.AddClusterInfo){D.push({title:"Overwrite Existing Values",value:String(v||!1)});let e="";y?.forEach(({attributeName:t,attributeStringValue:o},i)=>{e+=`${t}: ${o}`,i<y.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===h.DeleteAttributes){let e="";f?.forEach((t,o)=>{e+=t,o<f.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===h.RenameAttributes){let e="";const t=Object.entries(b||{});t.forEach(([o,i],n)=>{e+=`${o}: ${i}`,n<t.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===h.PiiMasking){let e="";x?.forEach((t,o)=>{e+=t,o<x.length-1&&(e+=", ")}),D.push({title:"Categories",value:e})}return t===h.ErrorSampler&&D.push({title:"Sampling Ratio",value:String(C)}),t===h.ProbabilisticSampler&&D.push({title:"Sampling Percentage",value:String($)}),t===h.LatencySampler&&k?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:o,fallbackSamplingRatio:i},n)=>{let a="";a+=`Service Name: ${e}\n`,a+=`HTTP Route: ${t}\n`,a+=`Min. Latency: ${o}\n`,a+=`Fallback Sampling Ratio: ${i}`,D.push({title:"Endpoint"+(k.length>1?` #${n+1}`:""),value:a})}),t===h.ServiceNameSampler&&S?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:o},i)=>{let n="";n+=`Service Name: ${e}\n`,n+=`Sampling Ratio: ${t}\n`,n+=`Fallback Sampling Ratio: ${o}`,D.push({title:"Filter"+(S.length>1?` #${i+1}`:""),value:n})}),t===h.SpanAttributeSampler&&w?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:i},n)=>{let a="";a+=`Service Name: ${e}\n`,a+=`Attribute Key: ${t}\n`,a+=`Fallback Sampling Ratio: ${o}\n`;const l=Object.keys(i)[0];a+=`Condition: ${l}\n`,a+=`Operation: ${i[l]?.operation}\n`,a+=`Expected Value: ${i[l]?.expectedValue}`,"jsonCondition"===l&&(a+=`\nJSON Path: ${i[l].jsonPath}`),D.push({title:"Filter"+(w.length>1?` #${n+1}`:""),value:a})}),D},ni=b.PiiCategories,ai=d.div`
1
+ import e,{useState as t,useEffect as o,forwardRef as i,useRef as a,useImperativeHandle as n,useMemo as l,Fragment as r,useCallback as s,Children as c}from"react";import d,{css as u}from"styled-components";import{D as p,a as m,A as h,K as g,F as y,C as v,b as f,c as b,I as x,d as C,i as k,e as w,f as S,g as $,h as D,j as N,k as T,T as I,S as E,l as O,m as A,M,n as F,u as R,o as L,p as P,q,B as K,r as j,s as V,t as z,E as B,v as H,w as U,x as W,y as _,z as G,G as J,H as Y,J as Q,L as X,N as Z,O as ee,P as te,Q as oe,R as ie,U as ae,V as ne,W as le,X as re,Y as se,Z as ce,_ as de,$ as ue,a0 as pe,a1 as me,a2 as he,a3 as ge,a4 as ye,a5 as ve,a6 as fe,a7 as be,a8 as xe,a9 as Ce,aa as ke,ab as we,ac as Se,ad as $e,ae as De,af as Ne,ag as Te,ah as Ie,ai as Ee,aj as Oe,ak as Ae,al as Me,am as Fe,an as Re,ao as Le,ap as Pe,aq as qe,ar as Ke,as as je,at as Ve,au as ze,av as Be,aw as He,ax as Ue,ay as We,az as _e,aA as Ge,aB as Je,aC as Ye,aD as Qe,aE as Xe,aF as Ze,aG as et,aH as tt,aI as ot,aJ as it,aK as at,aL as nt,aM as lt,aN as rt,aO as st,aP as ct,aQ as dt,aR as ut,aS as pt,aT as mt,aU as ht,aV as gt,aW as yt,aX as vt,aY as ft,aZ as bt,a_ as xt,a$ as Ct,b0 as kt,b1 as wt,b2 as St,b3 as $t,b4 as Dt,b5 as Nt,b6 as Tt,b7 as It,b8 as Et,b9 as Ot,ba as At,bb as Mt,bc as Ft,bd as Rt,be as Lt,bf as Pt,bg as qt,bh as Kt,bi as jt,bj as Vt,bk as zt,bl as Bt,bm as Ht,bn as Ut,bo as Wt,bp as _t,bq as Gt,br as Jt,bs as Yt,bt as Qt,bu as Xt,bv as Zt,bw as eo,bx as to,by as oo,bz as io,bA as ao,bB as no,bC as lo,bD as ro,bE as so,bF as co,bG as uo,bH as po,bI as mo,bJ as ho,bK as go,bL as yo,bM as vo,bN as fo,bO as bo,bP as xo,bQ as Co}from"./chunks/ui-components-898f30d4.js";import{CheckCircledIcon as ko,CrossCircledIcon as wo,EditIcon as So,TrashIcon as $o,OdigosLogoText as Do,PlusIcon as No,SearchIcon as To,FilterIcon as Io,DataStreamsIcon as Eo,CheckIcon as Oo,OdigosLogo as Ao,ArrowIcon as Mo,RefreshLeftArrowIcon as Fo,NotificationIcon as Ro,UserIcon as Lo,ImageErrorIcon as Po,OverviewIcon as qo,RulesIcon as Ko,ActionsIcon as jo,SourcesIcon as Vo,DestinationsIcon as zo,SlackLogo as Bo,CopyIcon as Ho,KeyIcon as Uo,TerminalIcon as Wo,GearIcon as _o,WarningTriangleIcon as Go,TraceViewIcon as Jo,ErrorTriangleIcon as Yo}from"./icons.js";import{MarkerType as Qo,useNodesState as Xo,useEdgesState as Zo,applyNodeChanges as ei}from"@xyflow/react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-f206ac21.js";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";const ti=e=>{const{type:t,name:o,notes:i,signals:a,disabled:n,fields:{collectContainerAttributes:l,collectReplicaSetAttributes:r,collectWorkloadId:s,collectClusterId:c,labelsAttributes:d,annotationsAttributes:u,clusterAttributes:y,overwriteExistingValues:v,attributeNamesToDelete:f,renames:b,piiCategories:x,fallbackSamplingRatio:C,samplingPercentage:k,endpointsFilters:w,servicesNameFilters:S,attributeFilters:$}}=e,D=[{title:p.TYPE,value:t},{type:m.ActiveStatus,title:p.STATUS,value:String(!n)},{type:m.Monitors,title:p.SIGNALS_FOR_PROCESSING,value:a?.map(e=>e.toLowerCase()).join(", ")||""},{title:p.NAME,value:o||""},{title:p.NOTES,value:i||""},{type:m.Divider}];if(t===h.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:m.Divider}),d?.forEach(({labelKey:e,attributeKey:t,from:o},i)=>{let a="";a+=`Label Key: ${e}\n`,a+=`Attribute Key: ${t}\n`,a+=`From: ${o||g.Pod}\n`,D.push({title:"Label"+(d.length>1?` #${i+1}`:""),value:a})}),u?.length&&D.push({type:m.Divider}),u?.forEach(({annotationKey:e,attributeKey:t,from:o},i)=>{let a="";a+=`Annotation Key: ${e}\n`,a+=`Attribute Key: ${t}\n`,a+=`From: ${o||g.Pod}\n`,D.push({title:"Annotation"+(u.length>1?` #${i+1}`:""),value:a})})),t===h.AddClusterInfo){D.push({title:"Overwrite Existing Values",value:String(v||!1)});let e="";y?.forEach(({attributeName:t,attributeStringValue:o},i)=>{e+=`${t}: ${o}`,i<y.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===h.DeleteAttributes){let e="";f?.forEach((t,o)=>{e+=t,o<f.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===h.RenameAttributes){let e="";const t=Object.entries(b||{});t.forEach(([o,i],a)=>{e+=`${o}: ${i}`,a<t.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===h.PiiMasking){let e="";x?.forEach((t,o)=>{e+=t,o<x.length-1&&(e+=", ")}),D.push({title:"Categories",value:e})}return t===h.ErrorSampler&&D.push({title:"Sampling Ratio",value:String(C)}),t===h.ProbabilisticSampler&&D.push({title:"Sampling Percentage",value:String(k)}),t===h.LatencySampler&&w?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:o,fallbackSamplingRatio:i},a)=>{let n="";n+=`Service Name: ${e}\n`,n+=`HTTP Route: ${t}\n`,n+=`Min. Latency: ${o}\n`,n+=`Fallback Sampling Ratio: ${i}`,D.push({title:"Endpoint"+(w.length>1?` #${a+1}`:""),value:n})}),t===h.ServiceNameSampler&&S?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:o},i)=>{let a="";a+=`Service Name: ${e}\n`,a+=`Sampling Ratio: ${t}\n`,a+=`Fallback Sampling Ratio: ${o}`,D.push({title:"Filter"+(S.length>1?` #${i+1}`:""),value:a})}),t===h.SpanAttributeSampler&&$?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:i},a)=>{let n="";n+=`Service Name: ${e}\n`,n+=`Attribute Key: ${t}\n`,n+=`Fallback Sampling Ratio: ${o}\n`;const l=Object.keys(i)[0];n+=`Condition: ${l}\n`,n+=`Operation: ${i[l]?.operation}\n`,n+=`Expected Value: ${i[l]?.expectedValue}`,"jsonCondition"===l&&(n+=`\nJSON Path: ${i[l].jsonPath}`),D.push({title:"Filter"+($.length>1?` #${a+1}`:""),value:n})}),D},oi=b.PiiCategories,ii=d.div`
2
2
  display: flex;
3
3
  flex-direction: row;
4
4
  gap: 32px;
@@ -7,49 +7,137 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
7
7
  border-radius: 32px;
8
8
  padding: 8px;
9
9
  `}
10
- `,li=[{id:"CREDIT_CARD",label:"Credit Card"}],ri=b.FallbackSamplingRatio,si=[{value:g.Pod,id:g.Pod},{value:g.Namespace,id:g.Namespace}],ci=[{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",keyName:"from",placeholder:si[0].value,componentType:"dropdown",options:si,required:!1}],di=[{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",keyName:"from",placeholder:si[0].value,componentType:"dropdown",options:si,required:!1}],ui=b.EndpointsFilters,pi=[{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:C.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:C.Number}],mi=b.AttributeNamesToDelete,hi=b.Renames,gi=b.ServicesNameFilters,yi=[{title:"Service Name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (Across all available spans).",required:!0},{title:"Sampling Ratio",keyName:"samplingRatio",placeholder:"e.g. 10",tooltip:"Specifies the sample rate for all traces.",required:!0,type:C.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:C.Number}],vi=b.SamplingPercentage,fi=b.AttributeFilters,bi=[{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:C.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}],xi={[h.K8sAttributes]:({value:t,setValue:i,formErrors:n})=>(o(()=>{t[b.CollectContainerAttributes]||t[b.CollectReplicaSetAttributes]||t[b.CollectWorkloadId]||t[b.CollectClusterId]||t[b.LabelsAttributes]?.length||t[b.AnnotationsAttributes]?.length||(i(b.CollectContainerAttributes,!0),i(b.CollectReplicaSetAttributes,!0),i(b.CollectWorkloadId,!0),i(b.CollectClusterId,!0),i(b.LabelsAttributes,[]),i(b.AnnotationsAttributes,[]))},[]),e.createElement(e.Fragment,null,e.createElement(v,{title:"Collect Container Attributes",value:t[b.CollectContainerAttributes]||!1,onChange:e=>i(b.CollectContainerAttributes,e),errorMessage:n[b.CollectContainerAttributes]}),e.createElement(v,{title:"Collect ReplicaSet Attributes",value:t[b.CollectReplicaSetAttributes]||!1,onChange:e=>i(b.CollectReplicaSetAttributes,e),errorMessage:n[b.CollectReplicaSetAttributes]}),e.createElement(v,{title:"Collect Workload ID",value:t[b.CollectWorkloadId]||!1,onChange:e=>i(b.CollectWorkloadId,e),errorMessage:n[b.CollectWorkloadId]}),e.createElement(v,{title:"Collect Cluster ID",value:t[b.CollectClusterId]||!1,onChange:e=>i(b.CollectClusterId,e),errorMessage:n[b.CollectClusterId]}),e.createElement(k,{columns:ci,value:t[b.LabelsAttributes]||[],onChange:e=>i(b.LabelsAttributes,e),errorMessage:n[b.LabelsAttributes]}),e.createElement(k,{columns:di,value:t[b.AnnotationsAttributes]||[],onChange:e=>i(b.AnnotationsAttributes,e),errorMessage:n[b.AnnotationsAttributes]}))),[h.AddClusterInfo]:({value:t,setValue:o,formErrors:i})=>e.createElement(e.Fragment,null,e.createElement(S,{title:"Overwrite Existing Values",tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",initialValue:t[b.OverwriteExistingValues]||!1,onChange:e=>o(b.OverwriteExistingValues,e)}),e.createElement(w,{title:"Resource Attributes",value:t[b.ClusterAttributes]?.map(e=>({key:e.attributeName,value:e.attributeStringValue}))||[],onChange:e=>o(b.ClusterAttributes,e.map(e=>({attributeName:e.key,attributeStringValue:e.value}))),required:!0,errorMessage:i[b.ClusterAttributes]})),[h.DeleteAttributes]:({value:t,setValue:o,formErrors:i})=>{const n=i[mi],a=t[mi]||[];return e.createElement(D,{title:"Attributes to delete",value:a,onChange:e=>o(mi,e),required:!0,errorMessage:n})},[h.RenameAttributes]:({value:t,setValue:o,formErrors:i})=>{const n=i[hi],a=Object.entries(t[hi]||{}).map(([e,t])=>({key:e,value:t}));return e.createElement(w,{title:"Attributes to rename",value:a,onChange:e=>{const t={};e.forEach(e=>t[e.key]=e.value),o(hi,t)},required:!0,errorMessage:n})},[h.PiiMasking]:({value:i,setValue:n,formErrors:a})=>{const l=a[ni],r=i[ni]||[],[s,c]=t(1===r.length);return o(()=>{if(!r.length){const e=li.map(({id:e})=>e);n(ni,e),c(1===li.length)}},[]),e.createElement("div",null,e.createElement(y,{title:"Attributes to mask",required:!0}),e.createElement(ai,{$hasError:!!l},li.map(({id:t,label:o})=>e.createElement(v,{key:t,title:o,disabled:s&&r.includes(t),value:r.includes(t),onChange:e=>((e,t)=>{const o=t?[...r,e]:r.filter(t=>t!==e);n(ni,o),c(1===o.length)})(t,e)}))),!!l&&e.createElement(f,null,l))},[h.ErrorSampler]:({value:t,setValue:o,formErrors:i})=>{const n=i[ri],a=t[ri];return e.createElement(x,{title:"Fallback sampling ratio",required:!0,type:C.Number,min:0,max:100,value:$(a)?"":String(a),onChange:({target:{value:e}})=>{return t=e,o(ri,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:n})},[h.ProbabilisticSampler]:({value:t,setValue:o,formErrors:i})=>{const n=i[vi],a=t[vi];return e.createElement(x,{title:"Sampling percentage",required:!0,type:C.Number,min:0,max:100,value:$(a)?"":String(a),onChange:({target:{value:e}})=>{return t=e,o(vi,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:n})},[h.LatencySampler]:({value:t,setValue:o,formErrors:i})=>{const n=i[ui],a=t[ui]||[];return e.createElement(k,{columns:pi,value:a,onChange:e=>{const t=e.map(({serviceName:e,httpRoute:t,minimumLatencyThreshold:o,fallbackSamplingRatio:i})=>({serviceName:e,httpRoute:t,minimumLatencyThreshold:Number(o),fallbackSamplingRatio:Number(i)}));o(ui,t)},errorMessage:n})},[h.ServiceNameSampler]:({value:t,setValue:o,formErrors:i})=>{const n=i[gi],a=t[gi]||[];return e.createElement(k,{columns:yi,value:a,onChange:e=>{const t=e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:o})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(o)}));o(gi,t)},errorMessage:n})},[h.SpanAttributeSampler]:({value:t,setValue:o,formErrors:i})=>{const n=i[fi],a=(t[fi]||[]).map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:i})=>{const n=Object.entries(i).filter(([e,t])=>t)[0][0];return{serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:n,operation:i[n]?.operation,expectedValue:i[n]?.expectedValue,jsonPath:i[n]?.jsonPath}});return e.createElement(k,{columns:bi,value:a,onChange:e=>{const t=e.map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:i,operation:n,expectedValue:a,jsonPath:l})=>{const r={serviceName:e,attributeKey:t,fallbackSamplingRatio:Number(o),condition:{[i]:{operation:n,expectedValue:a}}};return l&&(r.condition[i].jsonPath=l),r});o(fi,t)},errorMessage:n,limitFieldsPerRow:3})}},Ci=({actionType:t,value:o,setValue:i,formErrors:n})=>{if(!t)return null;const a=xi[t];return a?e.createElement(a,{value:o,setValue:i,formErrors:n}):null},$i=d.div`
10
+ `,ai=[{id:"CREDIT_CARD",label:"Credit Card"}],ni=b.FallbackSamplingRatio,li=[{value:g.Pod,id:g.Pod},{value:g.Namespace,id:g.Namespace}],ri=[{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",keyName:"from",placeholder:li[0].value,componentType:"dropdown",options:li,required:!1}],si=[{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",keyName:"from",placeholder:li[0].value,componentType:"dropdown",options:li,required:!1}],ci=b.EndpointsFilters,di=[{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:C.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:C.Number}],ui=b.AttributeNamesToDelete,pi=b.Renames,mi=b.ServicesNameFilters,hi=[{title:"Service Name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (Across all available spans).",required:!0},{title:"Sampling Ratio",keyName:"samplingRatio",placeholder:"e.g. 10",tooltip:"Specifies the sample rate for all traces.",required:!0,type:C.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:C.Number}],gi=b.SamplingPercentage,yi=b.AttributeFilters,vi=[{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:C.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}],fi={[h.K8sAttributes]:({value:t,setValue:i,formErrors:a})=>(o(()=>{t[b.CollectContainerAttributes]||t[b.CollectReplicaSetAttributes]||t[b.CollectWorkloadId]||t[b.CollectClusterId]||t[b.LabelsAttributes]?.length||t[b.AnnotationsAttributes]?.length||(i(b.CollectContainerAttributes,!0),i(b.CollectReplicaSetAttributes,!0),i(b.CollectWorkloadId,!0),i(b.CollectClusterId,!0),i(b.LabelsAttributes,[]),i(b.AnnotationsAttributes,[]))},[]),e.createElement(e.Fragment,null,e.createElement(v,{title:"Collect Container Attributes",value:t[b.CollectContainerAttributes]||!1,onChange:e=>i(b.CollectContainerAttributes,e),errorMessage:a[b.CollectContainerAttributes]}),e.createElement(v,{title:"Collect ReplicaSet Attributes",value:t[b.CollectReplicaSetAttributes]||!1,onChange:e=>i(b.CollectReplicaSetAttributes,e),errorMessage:a[b.CollectReplicaSetAttributes]}),e.createElement(v,{title:"Collect Workload ID",value:t[b.CollectWorkloadId]||!1,onChange:e=>i(b.CollectWorkloadId,e),errorMessage:a[b.CollectWorkloadId]}),e.createElement(v,{title:"Collect Cluster ID",value:t[b.CollectClusterId]||!1,onChange:e=>i(b.CollectClusterId,e),errorMessage:a[b.CollectClusterId]}),e.createElement(w,{columns:ri,value:t[b.LabelsAttributes]||[],onChange:e=>i(b.LabelsAttributes,e),errorMessage:a[b.LabelsAttributes]}),e.createElement(w,{columns:si,value:t[b.AnnotationsAttributes]||[],onChange:e=>i(b.AnnotationsAttributes,e),errorMessage:a[b.AnnotationsAttributes]}))),[h.AddClusterInfo]:({value:t,setValue:o,formErrors:i})=>e.createElement(e.Fragment,null,e.createElement(S,{title:"Overwrite Existing Values",tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",initialValue:t[b.OverwriteExistingValues]||!1,onChange:e=>o(b.OverwriteExistingValues,e)}),e.createElement($,{title:"Resource Attributes",value:t[b.ClusterAttributes]?.map(e=>({key:e.attributeName,value:e.attributeStringValue}))||[],onChange:e=>o(b.ClusterAttributes,e.map(e=>({attributeName:e.key,attributeStringValue:e.value}))),required:!0,errorMessage:i[b.ClusterAttributes]})),[h.DeleteAttributes]:({value:t,setValue:o,formErrors:i})=>{const a=i[ui],n=t[ui]||[];return e.createElement(D,{title:"Attributes to delete",value:n,onChange:e=>o(ui,e),required:!0,errorMessage:a})},[h.RenameAttributes]:({value:t,setValue:o,formErrors:i})=>{const a=i[pi],n=Object.entries(t[pi]||{}).map(([e,t])=>({key:e,value:t}));return e.createElement($,{title:"Attributes to rename",value:n,onChange:e=>{const t={};e.forEach(e=>t[e.key]=e.value),o(pi,t)},required:!0,errorMessage:a})},[h.PiiMasking]:({value:i,setValue:a,formErrors:n})=>{const l=n[oi],r=i[oi]||[],[s,c]=t(1===r.length);return o(()=>{if(!r.length){const e=ai.map(({id:e})=>e);a(oi,e),c(1===ai.length)}},[]),e.createElement("div",null,e.createElement(y,{title:"Attributes to mask",required:!0}),e.createElement(ii,{$hasError:!!l},ai.map(({id:t,label:o})=>e.createElement(v,{key:t,title:o,disabled:s&&r.includes(t),value:r.includes(t),onChange:e=>((e,t)=>{const o=t?[...r,e]:r.filter(t=>t!==e);a(oi,o),c(1===o.length)})(t,e)}))),!!l&&e.createElement(f,null,l))},[h.ErrorSampler]:({value:t,setValue:o,formErrors:i})=>{const a=i[ni],n=t[ni];return e.createElement(x,{title:"Fallback sampling ratio",required:!0,type:C.Number,min:0,max:100,value:k(n)?"":String(n),onChange:({target:{value:e}})=>{return t=e,o(ni,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[h.ProbabilisticSampler]:({value:t,setValue:o,formErrors:i})=>{const a=i[gi],n=t[gi];return e.createElement(x,{title:"Sampling percentage",required:!0,type:C.Number,min:0,max:100,value:k(n)?"":String(n),onChange:({target:{value:e}})=>{return t=e,o(gi,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[h.LatencySampler]:({value:t,setValue:o,formErrors:i})=>{const a=i[ci],n=t[ci]||[];return e.createElement(w,{columns:di,value:n,onChange:e=>{const t=e.map(({serviceName:e,httpRoute:t,minimumLatencyThreshold:o,fallbackSamplingRatio:i})=>({serviceName:e,httpRoute:t,minimumLatencyThreshold:Number(o),fallbackSamplingRatio:Number(i)}));o(ci,t)},errorMessage:a})},[h.ServiceNameSampler]:({value:t,setValue:o,formErrors:i})=>{const a=i[mi],n=t[mi]||[];return e.createElement(w,{columns:hi,value:n,onChange:e=>{const t=e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:o})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(o)}));o(mi,t)},errorMessage:a})},[h.SpanAttributeSampler]:({value:t,setValue:o,formErrors:i})=>{const a=i[yi],n=(t[yi]||[]).map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:i})=>{const a=Object.entries(i).filter(([e,t])=>t)[0][0];return{serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:a,operation:i[a]?.operation,expectedValue:i[a]?.expectedValue,jsonPath:i[a]?.jsonPath}});return e.createElement(w,{columns:vi,value:n,onChange:e=>{const t=e.map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:i,operation:a,expectedValue:n,jsonPath:l})=>{const r={serviceName:e,attributeKey:t,fallbackSamplingRatio:Number(o),condition:{[i]:{operation:a,expectedValue:n}}};return l&&(r.condition[i].jsonPath=l),r});o(yi,t)},errorMessage:a,limitFieldsPerRow:3})}},bi=({actionType:t,value:o,setValue:i,formErrors:a})=>{if(!t)return null;const n=fi[t];return n?e.createElement(n,{value:o,setValue:i,formErrors:a}):null},xi=d.div`
11
11
  display: flex;
12
12
  flex-direction: column;
13
13
  gap: 24px;
14
14
  padding: 4px;
15
- `,ki=d(T)`
15
+ `,Ci=d(T)`
16
16
  margin-bottom: 12px;
17
- `,Si=({isUpdate:t,action:o,formData:i,formErrors:n,handleFormChange:a})=>{const l=I.useTheme();return e.createElement($i,null,t&&e.createElement("div",null,e.createElement(ki,null,"Status"),e.createElement(E,{options:[{icon:So,label:p.ENABLED,value:!1,selectedBgColor:l.text.success+I.opacity.hex["050"]},{icon:wo,label:p.DISABLED,value:!0,selectedBgColor:l.text.error+I.opacity.hex["050"]}],selected:i.disabled,setSelected:e=>a("disabled",e)})),!t&&e.createElement(O,{title:"",description:o.docsDescription,actionButton:e.createElement(M,{endpoint:o.docsEndpoint})}),e.createElement(A,{title:"Signals for Processing",required:!0,allowedSignals:o.allowedSignals,selectedSignals:i.signals||[],setSelectedSignals:e=>a("signals",e),errorMessage:n.signals}),!t&&e.createElement(x,{title:"Action name",placeholder:"Use a name that describes the action",value:i.name||"",onChange:({target:{value:e}})=>a("name",e),errorMessage:n.name}),e.createElement(Ci,{actionType:o.type,value:i.fields,setValue:(e,t)=>a(`fields.${e}`,t),formErrors:n}),e.createElement(F,{title:"Notes",value:i.notes||"",onChange:({target:{value:e}})=>a("notes",e),errorMessage:n.notes}))},wi=i(({children:o,width:i=640,title:r,titleTooltip:s,hideEditTitleFromEdit:c,icons:d,iconSrcs:u,isEdit:p=!1,isFormDirty:m=!1,isLastItem:h=!1,onClose:g,onEdit:y,onSave:v,onDelete:f,onCancel:b,tabs:x,headerActionButtons:C},$)=>{const k=I.useTheme(),{isThisPending:S}=R(),{addNotification:w}=L(),{drawerType:D,drawerEntityId:N,setDrawerType:E,setDrawerEntityId:O}=P();q({key:"Enter",active:p},()=>Z());const[M,A]=t(!1),[F,B]=t(!1),U=n(null),_=D===j.Source,G=()=>{A(!1),B(!1)},J=()=>{G(),y&&y(!1),E(null),O(null),g?.()};a($,()=>({closeDrawer:J}));const Y=()=>{U.current?.clearTitle(),b&&b(),G()},Q=()=>{const e=U.current?.isTitleDirty();m||e?B(!0):Y()},X=()=>{A(!0)},Z=()=>{v&&v(U.current?.getTitle()||"")},ee=l(()=>!!D&&S({entityType:D,entityId:N}),[D,N]),te=e=>{w({type:V.Warning,title:"Pending",message:`Cannot click ${e}, ${D} is pending`,hideFromHistory:!0})},oe=C||[];return y&&!p&&oe.push({"data-id":"drawer-edit",variant:"tertiary",onClick:ee?()=>te("edit"):()=>y(!0),children:e.createElement(e.Fragment,null,e.createElement(Do,null),e.createElement(T,{size:14,family:"secondary",decoration:"underline"},"Edit"))}),f&&!p&&oe.push({"data-id":"drawer-delete",variant:"tertiary",onClick:ee?()=>te(_?"uninstrument":"delete"):X,children:e.createElement(e.Fragment,null,e.createElement(No,null),e.createElement(T,{color:k.text.error,size:14,family:"secondary",decoration:"underline"},_?K.UNINSTRUMENT:K.DELETE))}),e.createElement(e.Fragment,null,e.createElement(H,{isOpen:!0,onClose:p?Q:J,closeOnEscape:!M&&!F,width:`${i+64}px`,header:{icons:d,iconSrcs:u,title:r,titleTooltip:s,replaceTitleWith:!c&&p?e.createElement(Di,{ref:U,title:r}):void 0,actionButtons:oe,tabs:x},footer:{isOpen:p,leftButtons:[{"data-id":"drawer-save",variant:"primary",onClick:Z,children:K.SAVE},{"data-id":"drawer-cancel",variant:"secondary",onClick:Q,children:K.CANCEL}],rightButtons:f?[{"data-id":"drawer-delete",variant:"tertiary",onClick:X,children:e.createElement(e.Fragment,null,e.createElement(No,null),e.createElement(T,{size:14,color:k.text.error,family:"secondary",decoration:"underline"},K.DELETE))}]:[]}},o),e.createElement(z,{isOpen:M,noOverlay:!0,name:`${D}${r?` (${r})`:""}`,type:D,isLastItem:h,onApprove:()=>{f&&f(),G()},onDeny:G}),e.createElement(W,{isOpen:F,noOverlay:!0,name:"edit mode",onApprove:Y,onDeny:G}))}),Di=i(({title:i},n)=>{const[l,r]=t(i);return o(()=>{r(i)},[i]),a(n,()=>({getTitle:()=>l||i,isTitleDirty:()=>l!==i,clearTitle:()=>r(i)})),e.createElement(x,{"data-id":"title",value:l,onChange:e=>r(e.target.value)})});Di.displayName=Di.name,wi.displayName=wi.name;const Ni=d.div`
17
+ `,ki=({isUpdate:t,action:o,formData:i,formErrors:a,handleFormChange:n})=>{const l=I.useTheme();return e.createElement(xi,null,t&&e.createElement("div",null,e.createElement(Ci,null,"Status"),e.createElement(E,{options:[{icon:ko,label:p.ENABLED,value:!1,selectedBgColor:l.text.success+I.opacity.hex["050"]},{icon:wo,label:p.DISABLED,value:!0,selectedBgColor:l.text.error+I.opacity.hex["050"]}],selected:i.disabled,setSelected:e=>n("disabled",e)})),!t&&e.createElement(O,{title:"",description:o.docsDescription,actionButton:e.createElement(A,{endpoint:o.docsEndpoint})}),e.createElement(M,{title:"Signals for Processing",required:!0,allowedSignals:o.allowedSignals,selectedSignals:i.signals||[],setSelectedSignals:e=>n("signals",e),errorMessage:a.signals}),!t&&e.createElement(x,{title:"Action name",placeholder:"Use a name that describes the action",value:i.name||"",onChange:({target:{value:e}})=>n("name",e),errorMessage:a.name}),e.createElement(bi,{actionType:o.type,value:i.fields,setValue:(e,t)=>n(`fields.${e}`,t),formErrors:a}),e.createElement(F,{title:"Notes",value:i.notes||"",onChange:({target:{value:e}})=>n("notes",e),errorMessage:a.notes}))},wi=i(({children:o,width:i=640,title:r,titleTooltip:s,hideEditTitleFromEdit:c,icons:d,iconSrcs:u,isEdit:p=!1,isFormDirty:m=!1,isLastItem:h=!1,onClose:g,onEdit:y,onSave:v,onDelete:f,onCancel:b,tabs:x,headerActionButtons:C},k)=>{const w=I.useTheme(),{isThisPending:S}=R(),{addNotification:$}=L(),{drawerType:D,drawerEntityId:N,setDrawerType:E,setDrawerEntityId:O}=P();q({key:"Enter",active:p},()=>Z());const[A,M]=t(!1),[F,U]=t(!1),W=a(null),_=D===B.Source,G=()=>{M(!1),U(!1)},J=()=>{G(),y&&y(!1),E(null),O(null),g?.()};n(k,()=>({closeDrawer:J}));const Y=()=>{W.current?.clearTitle(),b&&b(),G()},Q=()=>{const e=W.current?.isTitleDirty();m||e?U(!0):Y()},X=()=>{M(!0)},Z=()=>{v&&v(W.current?.getTitle()||"")},ee=l(()=>!!D&&S({entityType:D,entityId:N}),[D,N]),te=e=>{$({type:H.Warning,title:"Pending",message:`Cannot click ${e}, ${D} is pending`,hideFromHistory:!0})},oe=C||[];return y&&!p&&oe.push({"data-id":"drawer-edit",variant:"tertiary",onClick:ee?()=>te("edit"):()=>y(!0),children:e.createElement(e.Fragment,null,e.createElement(So,null),e.createElement(T,{size:14,family:"secondary",decoration:"underline"},"Edit"))}),f&&!p&&oe.push({"data-id":"drawer-delete",variant:"tertiary",onClick:ee?()=>te(_?"uninstrument":"delete"):X,children:e.createElement(e.Fragment,null,e.createElement($o,null),e.createElement(T,{color:w.text.error,size:14,family:"secondary",decoration:"underline"},_?K.UNINSTRUMENT:K.DELETE))}),e.createElement(e.Fragment,null,e.createElement(j,{isOpen:!0,onClose:p?Q:J,closeOnEscape:!A&&!F,width:`${i+64}px`,header:{icons:d,iconSrcs:u,title:r,titleTooltip:s,replaceTitleWith:!c&&p?e.createElement(Si,{ref:W,title:r}):void 0,actionButtons:oe,tabs:x},footer:{isOpen:p,leftButtons:[{"data-id":"drawer-save",variant:"primary",onClick:Z,children:K.SAVE},{"data-id":"drawer-cancel",variant:"secondary",onClick:Q,children:K.CANCEL}],rightButtons:f?[{"data-id":"drawer-delete",variant:"tertiary",onClick:X,children:e.createElement(e.Fragment,null,e.createElement($o,null),e.createElement(T,{size:14,color:w.text.error,family:"secondary",decoration:"underline"},K.DELETE))}]:[]}},o),e.createElement(V,{isOpen:A,noOverlay:!0,name:`${D}${r?` (${r})`:""}`,type:D,isLastItem:h,onApprove:()=>{f&&f(),G()},onDeny:G}),e.createElement(z,{isOpen:F,noOverlay:!0,name:"edit mode",onApprove:Y,onDeny:G}))}),Si=i(({title:i},a)=>{const[l,r]=t(i);return o(()=>{r(i)},[i]),n(a,()=>({getTitle:()=>l||i,isTitleDirty:()=>l!==i,clearTitle:()=>r(i)})),e.createElement(x,{"data-id":"title",value:l,onChange:e=>r(e.target.value)})});Si.displayName=Si.name,wi.displayName=wi.name;const $i=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
- `,Ti=d.div`
23
+ `,Di=d.div`
24
24
  display: flex;
25
25
  flex-direction: column;
26
26
  gap: 12px;
27
- `,Ii=({updateAction:o,deleteAction:i})=>{const{actions:a}=B(),{drawerType:r,drawerEntityId:s}=P(),c=n(null),d=r!==j.Action,[u,m]=t(!1),[h,g]=t(!1),{formData:y,formErrors:v,handleFormChange:f,resetFormData:b,validateForm:x,loadFormWithDrawerItem:C}=U(),$=l(()=>{if(d)return b();const e=a?.find(e=>e.id===s);return e?C(e):b(),e},[d,s,a]);if(!$)return null;const k=_.find(({type:e})=>e===$.type)||_.find(({label:e})=>"Attributes"===e)?.items?.find(({type:e})=>e===$.type)||_.find(({label:e})=>"Samplers"===e)?.items?.find(({type:e})=>e===$.type);return e.createElement(wi,{ref:c,title:$.name||$.type,icons:[G($.type)],isEdit:u,isFormDirty:h,onEdit:e=>{m("boolean"!=typeof e||e)},onSave:e=>{if(x({withAlert:!0,alertTitle:Q.Update})){const t=e!==$.type?e:"";f("name",t),o(s,{...y,name:t}),m(!1),g(!1)}},onDelete:()=>{i(s,$.type),m(!1),g(!1),c.current?.closeDrawer()},onCancel:()=>{m(!1),g(!1),C($)}},u&&k?e.createElement(Ni,null,e.createElement(Si,{isUpdate:!0,action:k,formData:y,formErrors:v,handleFormChange:(...e)=>{g(!0),f(...e)}})):e.createElement(Ti,null,e.createElement(J,{conditions:$.conditions||[]}),e.createElement(Y,{title:p.ACTION_DETAILS,data:$?ii($):[]})))},Ei=d(X)`
27
+ `,Ni=({updateAction:o,deleteAction:i})=>{const{actions:n}=U(),{drawerType:r,drawerEntityId:s}=P(),c=a(null),d=r!==B.Action,[u,m]=t(!1),[h,g]=t(!1),{formData:y,formErrors:v,handleFormChange:f,resetFormData:b,validateForm:x,loadFormWithDrawerItem:C}=W(),k=l(()=>{if(d)return b();const e=n?.find(e=>e.id===s);return e?C(e):b(),e},[d,s,n]);if(!k)return null;const w=_.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(wi,{ref:c,title:k.name||k.type,icons:[G(k.type)],isEdit:u,isFormDirty:h,onEdit:e=>{m("boolean"!=typeof e||e)},onSave:e=>{if(x({withAlert:!0,alertTitle:Q.Update})){const t=e!==k.type?e:"";f("name",t),o(s,{...y,name:t}),m(!1),g(!1)}},onDelete:()=>{i(s,k.type),m(!1),g(!1),c.current?.closeDrawer()},onCancel:()=>{m(!1),g(!1),C(k)}},u&&w?e.createElement($i,null,e.createElement(ki,{isUpdate:!0,action:w,formData:y,formErrors:v,handleFormChange:(...e)=>{g(!0),f(...e)}})):e.createElement(Di,null,e.createElement(J,{conditions:k.conditions||[]}),e.createElement(Y,{title:p.ACTION_DETAILS,data:k?ti(k):[]})))},Ti=d(X)`
28
28
  margin-top: 24px;
29
29
  gap: 12px;
30
- `,Oi=({createAction:o})=>{const{currentModal:i,setCurrentModal:n}=Z(),a=i===j.Action,{formData:l,formErrors:r,handleFormChange:s,resetFormData:c,validateForm:d}=U(),[u,m]=t(void 0),h=()=>{c(),m(void 0),n("")},g=()=>{if(!d({withAlert:!0,alertTitle:Q.Create}))return null;o(l),h()};return q({key:"Enter",active:a},()=>g()),e.createElement(ee,{isOpen:a,onClose:h,header:{title:"Add Action"},actionComponent:e.createElement(te,{buttons:[{variant:"primary",label:"DONE",onClick:g,disabled:!u}]})},e.createElement(oe,null,e.createElement(O,{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(Ei,null,e.createElement(ie,{type:V.Warning,message:ne.DEFINED_FOR_ALL_STREAMS(p.ACTIONS)}),e.createElement(ae,{options:_,selectedOption:u,onOptionSelect:e=>{return t=e,c(),s("type",t?.type||""),void m(t);var t},autoFocus:!u?.type})),u?.type?e.createElement("div",null,e.createElement(le,{margin:"16px 0"}),e.createElement(Si,{action:u,formData:l,formErrors:r,handleFormChange:s})):null))},Mi=e=>{const{type:t,fields:{collectContainerAttributes:o,collectReplicaSetAttributes:i,collectWorkloadId:n,collectClusterId:a,labelsAttributes:l,annotationsAttributes:r,clusterAttributes:s,overwriteExistingValues:c,attributeNamesToDelete:d,renames:u,piiCategories:p,fallbackSamplingRatio:m,samplingPercentage:y,endpointsFilters:v,attributeFilters:f,servicesNameFilters:b}}=e;let x="";if(t===h.K8sAttributes&&(o&&(x+="Container Attributes, "),i&&(x+="ReplicaSet Attributes, "),n&&(x+="Workload ID, "),a&&(x+="Cluster ID, "),l?.forEach(({labelKey:e,attributeKey:t,from:o},i)=>{x+=`Label: ${e} ${t} ${o||g.Pod} `,i===l.length-1&&(x+=", ")}),r?.forEach(({annotationKey:e,attributeKey:t,from:o},i)=>{x+=`Annotation: ${e} ${t} ${o||g.Pod} `,i===r.length-1&&(x+=", ")})),t===h.AddClusterInfo&&(x+=`Overwrite Existing: ${c}\n`,s?.forEach(({attributeName:e,attributeStringValue:t},o)=>{x+=`${e}: ${t}`,o<s.length-1&&(x+=", ")})),t===h.DeleteAttributes&&d?.forEach((e,t)=>{x+=e,t<d.length-1&&(x+=", ")}),t===h.RenameAttributes){const e=Object.entries(u||{});e.forEach(([t,o],i)=>{x+=`${t}: ${o}`,i<e.length-1&&(x+=", ")})}return t===h.PiiMasking&&p?.forEach((e,t)=>{x+=e,t<p.length-1&&(x+=", ")}),t===h.ErrorSampler&&(x+=String(m)),t===h.ProbabilisticSampler&&(x+=String(y),x+="%"),t===h.LatencySampler&&v?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:o,fallbackSamplingRatio:i},n)=>{x+=`Endpoint${v.length>1?` #${n+1}`:""}=${e}${t}\n`,x+=` Latency=${o}`,x+=` Sampling=${i}`,n<v.length-1&&(x+=", ")}),t===h.ServiceNameSampler&&b?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:o})=>{x+=`Service Name: ${e}, `,x+=`Sampling Ratio: ${t}, `,x+=`Fallback Sampling Ratio: ${o}\n`}),t===h.SpanAttributeSampler&&f?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:o})=>{x+=`Service Name: ${e}, `,x+=`Attribute Key: ${t}, `,x+=`Fallback Sampling Ratio: ${o}\n`}),x},Ai=({conditions:t,id:o})=>{const{errors:i,warnings:n,disableds:a,hasLoadings:r}=l(()=>re(t),[t]),s=i.length>0?i:n.length>0?n:a.length>0?a:[];if(s.length>0)return e.createElement("div",{style:{lineHeight:1}},e.createElement(Fi,{conditions:s,id:o}));const c=r?pe.Loading:V.Success;return e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:c,title:c,withBorder:!0,withIcon:!0}))},Fi=({conditions:t,id:o})=>{const i=I.useTheme();return e.createElement(ce,null,de(t).map(({status:t,type:n,reason:a,message:l,lastTransitionTime:r},s)=>{"loading"!==t&&"disabled"!==t||(t=V.Info);const c=me(t,i);return e.createElement(ue,{key:`condition-${o}-${t}-${n}-${s}`,titleIcon:c,title:n,text:l||a||"",timestamp:r},e.createElement(se,{status:t,title:a||n,withBorder:!0,withIcon:!0}))}))},Ri=({instrumentationRules:e,sources:t,actions:o,destinations:i,searchText:n,selectedCategory:a})=>{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?o.filter(e=>e.type?.toLowerCase().includes(n)||e.name?.toLowerCase().includes(n)):o,c=n?i.filter(e=>e.destinationType.displayName?.toLowerCase().includes(n)||e.name?.toLowerCase().includes(n)):i,d=[{category:j.Source,label:"Sources",count:r.length,entities:[]},{category:j.Action,label:"Actions",count:s.length,entities:[]},{category:j.Destination,label:"Destinations",count:c.length,entities:[]},{category:j.InstrumentationRule,label:"Instrumentation Rules",count: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(a)).map(e=>({...e,entities:e.category===j.InstrumentationRule?l:e.category===j.Source?r:e.category===j.Action?s:e.category===j.Destination?c:[]}));return{categories:d,searchResults:u}},Li=[{key:"icon",title:""},{key:"name",title:p.NAME,sortable:!0},{key:"signals",title:p.MONITORS},{key:"active-status",title:p.STATUS},{key:"conditions",title:"Conditions"},{key:"type",title:p.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:p.NOTES,sortable:!0}],Pi=({maxHeight:t,maxWidth:o})=>{const i=I.useTheme(),n=he(),{actions:a,actionsLoading:r}=B(),{setDrawerType:s,setDrawerEntityId:c}=P(),d=l(()=>Ri({instrumentationRules:[],sources:[],actions:ge(a,n),destinations:[],searchText:n.searchText,selectedCategory:j.Action}).searchResults.find(({category:e})=>e===j.Action)?.entities||[],[a,n]),u=l(()=>d.map(t=>{const{hasErrors:o,hasWarnings:n,hasDisableds:a}=re(t.conditions||[]);return{status:o?V.Error:n?V.Warning:void 0,faded:a,onClick:()=>{s(j.Action),c(t.id)},cells:[{columnKey:"icon",component:()=>e.createElement(ye,{icon:G(t.type)})},{columnKey:"name",value:ve(t,j.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:Mi(t),textColor:i.text.info,withTooltip:!0},{columnKey:"signals",component:()=>e.createElement(fe,{withLabels:!0,monitors:t.signals||[]})},{columnKey:"conditions",component:()=>e.createElement(Ai,{conditions:t.conditions||[],id:t.id})},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:t.disabled?V.Error:V.Success,title:t.disabled?p.DISABLED:p.ENABLED,withIcon:!0,withBorder:!0}))}]}}),[d]),{badge:m,badgeTooltip:h}=l(()=>d.length!==a.length?{badge:`${d.length}/${a.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:a.length,badgeTooltip:void 0},[d,a]);return e.createElement(be,{$maxWidth:o},e.createElement(xe,null,e.createElement(Ce,{icon:$e(j.Action),title:p.ACTIONS,badge:m,badgeTooltip:h,loading:r})),e.createElement(ke,{$maxHeight:t},e.createElement(Se,{columns:Li,rows:u})),!d.length&&e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(De,null)))},qi=d(X)`
30
+ `,Ii=({createAction:o})=>{const{currentModal:i,setCurrentModal:a}=Z(),n=i===B.Action,{formData:l,formErrors:r,handleFormChange:s,resetFormData:c,validateForm:d}=W(),[u,m]=t(void 0),h=()=>{c(),m(void 0),a("")},g=()=>{if(!d({withAlert:!0,alertTitle:Q.Create}))return null;o(l),h()};return q({key:"Enter",active:n},()=>g()),e.createElement(ee,{isOpen:n,onClose:h,header:{title:"Add Action"},actionComponent:e.createElement(te,{buttons:[{variant:"primary",label:"DONE",onClick:g,disabled:!u}]})},e.createElement(oe,null,e.createElement(O,{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(Ti,null,e.createElement(ie,{type:H.Warning,message:ae.DEFINED_FOR_ALL_STREAMS(p.ACTIONS)}),e.createElement(ne,{options:_,selectedOption:u,onOptionSelect:e=>{return t=e,c(),s("type",t?.type||""),void m(t);var t},autoFocus:!u?.type})),u?.type?e.createElement("div",null,e.createElement(le,{margin:"16px 0"}),e.createElement(ki,{action:u,formData:l,formErrors:r,handleFormChange:s})):null))},Ei=e=>{const{type:t,fields:{collectContainerAttributes:o,collectReplicaSetAttributes:i,collectWorkloadId:a,collectClusterId:n,labelsAttributes:l,annotationsAttributes:r,clusterAttributes:s,overwriteExistingValues:c,attributeNamesToDelete:d,renames:u,piiCategories:p,fallbackSamplingRatio:m,samplingPercentage:y,endpointsFilters:v,attributeFilters:f,servicesNameFilters:b}}=e;let x="";if(t===h.K8sAttributes&&(o&&(x+="Container Attributes, "),i&&(x+="ReplicaSet Attributes, "),a&&(x+="Workload ID, "),n&&(x+="Cluster ID, "),l?.forEach(({labelKey:e,attributeKey:t,from:o},i)=>{x+=`Label: ${e} ${t} ${o||g.Pod} `,i===l.length-1&&(x+=", ")}),r?.forEach(({annotationKey:e,attributeKey:t,from:o},i)=>{x+=`Annotation: ${e} ${t} ${o||g.Pod} `,i===r.length-1&&(x+=", ")})),t===h.AddClusterInfo&&(x+=`Overwrite Existing: ${c}\n`,s?.forEach(({attributeName:e,attributeStringValue:t},o)=>{x+=`${e}: ${t}`,o<s.length-1&&(x+=", ")})),t===h.DeleteAttributes&&d?.forEach((e,t)=>{x+=e,t<d.length-1&&(x+=", ")}),t===h.RenameAttributes){const e=Object.entries(u||{});e.forEach(([t,o],i)=>{x+=`${t}: ${o}`,i<e.length-1&&(x+=", ")})}return t===h.PiiMasking&&p?.forEach((e,t)=>{x+=e,t<p.length-1&&(x+=", ")}),t===h.ErrorSampler&&(x+=String(m)),t===h.ProbabilisticSampler&&(x+=String(y),x+="%"),t===h.LatencySampler&&v?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:o,fallbackSamplingRatio:i},a)=>{x+=`Endpoint${v.length>1?` #${a+1}`:""}=${e}${t}\n`,x+=` Latency=${o}`,x+=` Sampling=${i}`,a<v.length-1&&(x+=", ")}),t===h.ServiceNameSampler&&b?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:o})=>{x+=`Service Name: ${e}, `,x+=`Sampling Ratio: ${t}, `,x+=`Fallback Sampling Ratio: ${o}\n`}),t===h.SpanAttributeSampler&&f?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:o})=>{x+=`Service Name: ${e}, `,x+=`Attribute Key: ${t}, `,x+=`Fallback Sampling Ratio: ${o}\n`}),x},Oi=({conditions:t,id:o})=>{const{errors:i,warnings:a,disableds:n,hasLoadings:r}=l(()=>re(t),[t]),s=i.length>0?i:a.length>0?a:n.length>0?n:[];if(s.length>0)return e.createElement("div",{style:{lineHeight:1}},e.createElement(Ai,{conditions:s,id:o}));const c=r?pe.Loading:H.Success;return e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:c,title:c,withBorder:!0,withIcon:!0}))},Ai=({conditions:t,id:o})=>{const i=I.useTheme();return e.createElement(ce,null,de(t).map(({status:t,type:a,reason:n,message:l,lastTransitionTime:r},s)=>{"loading"!==t&&"disabled"!==t||(t=H.Info);const c=me(t,i);return e.createElement(ue,{key:`condition-${o}-${t}-${a}-${s}`,titleIcon:c,title:a,text:l||n||"",timestamp:r},e.createElement(se,{status:t,title:n||a,withBorder:!0,withIcon:!0}))}))},Mi=({instrumentationRules:e,sources:t,actions:o,destinations:i,searchText:a,selectedCategory:n})=>{const l=a?e.filter(e=>e.type?.toLowerCase().includes(a)||e.ruleName?.toLowerCase().includes(a)):e,r=a?t.filter(e=>e.name?.toLowerCase().includes(a)||e.otelServiceName?.toLowerCase().includes(a)||e.namespace?.toLowerCase().includes(a)):t,s=a?o.filter(e=>e.type?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):o,c=a?i.filter(e=>e.destinationType.displayName?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):i,d=[{category:B.Source,label:"Sources",count:r.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: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(n)).map(e=>({...e,entities:e.category===B.InstrumentationRule?l:e.category===B.Source?r:e.category===B.Action?s:e.category===B.Destination?c:[]}));return{categories:d,searchResults:u}},Fi=[{key:"icon",title:""},{key:"name",title:p.NAME,sortable:!0},{key:"signals",title:p.MONITORS},{key:"active-status",title:p.STATUS},{key:"conditions",title:"Conditions"},{key:"type",title:p.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:p.NOTES,sortable:!0}],Ri=({maxHeight:t,maxWidth:o})=>{const i=I.useTheme(),a=he(),{actions:n,actionsLoading:r}=U(),{setDrawerType:s,setDrawerEntityId:c}=P(),d=l(()=>Mi({instrumentationRules:[],sources:[],actions:ge(n,a),destinations:[],searchText:a.searchText,selectedCategory:B.Action}).searchResults.find(({category:e})=>e===B.Action)?.entities||[],[n,a]),u=l(()=>d.map(t=>{const{hasErrors:o,hasWarnings:a,hasDisableds:n}=re(t.conditions||[]);return{status:o?H.Error:a?H.Warning:void 0,faded:n,onClick:()=>{s(B.Action),c(t.id)},cells:[{columnKey:"icon",component:()=>e.createElement(ye,{icon:G(t.type)})},{columnKey:"name",value:ve(t,B.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:Ei(t),textColor:i.text.info,withTooltip:!0},{columnKey:"signals",component:()=>e.createElement(fe,{withLabels:!0,monitors:t.signals||[]})},{columnKey:"conditions",component:()=>e.createElement(Oi,{conditions:t.conditions||[],id:t.id})},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:t.disabled?H.Error:H.Success,title:t.disabled?p.DISABLED:p.ENABLED,withIcon:!0,withBorder:!0}))}]}}),[d]),{badge:m,badgeTooltip:h}=l(()=>d.length!==n.length?{badge:`${d.length}/${n.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:n.length,badgeTooltip:void 0},[d,n]);return e.createElement(be,{$maxWidth:o},e.createElement(xe,null,e.createElement(Ce,{icon:ke(B.Action),title:p.ACTIONS,badge:m,badgeTooltip:h,loading:r})),e.createElement(we,{$maxHeight:t},e.createElement(Se,{columns:Fi,rows:u})),!d.length&&e.createElement($e,{style:{marginTop:"2rem"}},e.createElement(De,null)))},Li=d(X)`
31
31
  // width: 100vw;
32
32
  // height: 100vh;
33
33
  gap: 64px;
34
34
  align-items: center;
35
35
  justify-content: center;
36
- `,Ki=d(X)`
36
+ `,Pi=d(X)`
37
37
  max-width: 400px;
38
38
  gap: 12px;
39
39
  align-items: center;
40
40
  justify-content: center;
41
- `,Hi=d(T)`
41
+ `,qi=d(T)`
42
42
  text-align: center;
43
43
  font-size: 24px;
44
- `,zi=d(T)`
44
+ `,Ki=d(T)`
45
45
  text-align: center;
46
46
  line-height: 26px;
47
47
  color: ${({theme:e})=>e.text.info};
48
- `,Wi=()=>{const[i,n]=t(0);return o(()=>{(async()=>{for(let e=0;e<=100;e+=5)await Ie(500),n(e)})()},[]),e.createElement(qi,null,e.createElement(To,{size:100}),e.createElement(Ne,{width:400}),e.createElement(Ki,null,e.createElement(ce,{$gap:16},e.createElement(Hi,null,"Preparing your workspace..."),e.createElement(Te,{label:`${i}%`})),e.createElement(zi,null,"It can take up to a few minutes. Grab a cup of coffee, look out a window, and enjoy your free moment!")))},{nodeHeight:ji,framePadding:Vi}=Ae,Bi=(e,t)=>{const{theme:o,label:i,isMultiTarget:n,isError:a,animated:l}=t||{},[r,s]=e.split("-to-");return{id:e,type:i?Me.Labeled:"default",source:r,target:s,animated:l,data:{label:i,isMultiTarget:n,isError:a},style:{stroke:a?o?.colors.dark_red:o?.colors.border}}},{nodeWidth:Ui,nodeHeight:_i,framePadding:Gi}=Ae,Ji=e=>{const{hasDisableds:t,priorotizedStatus:o}=re(e.conditions||[]);return{nodeWidth:Ui,nodeHeight:_i,id:e.ruleId,type:j.InstrumentationRule,status:o,faded:t,title:ve(e,j.InstrumentationRule,{prioritizeDisplayName:!0}),subTitle:e.type,icon:Re(e.type),isActive:!e.disabled,raw:e}},{nodeWidth:Yi,nodeHeight:Qi,framePadding:Xi}=Ae,Zi=e=>{const{hasDisableds:t,priorotizedStatus:o}=re(e.conditions||[]);return{nodeWidth:Yi,nodeHeight:Qi,id:e.id,type:j.Action,status:o,faded:t,title:ve(e,j.Action,{prioritizeDisplayName:!0}),subTitle:e.type,icon:G(e.type),monitors:e.signals,isActive:!e.disabled,raw:e}},{nodeWidth:en,nodeHeight:tn,framePadding:on}=Ae,nn=(e,t)=>{const{priorotizedStatus:o,hasDisableds:i}=re(t.conditions||[]);return{nodeWidth:en,nodeHeight:tn,id:{namespace:t.namespace,name:t.name,kind:t.kind},type:j.Source,status:o,faded:i,title:ve(t,j.Source,{extended:!0}),subTitle:e?`${t.kind}`:`${t.namespace} • ${t.kind}`,icons:Le(t.containers),raw:t}},{nodeWidth:an,nodeHeight:ln}=Ae,{nodeWidth:rn,nodeHeight:sn,framePadding:cn}=Ae,dn=e=>{const{hasDisableds:t,priorotizedStatus:o}=re(e.conditions||[]),{icon:i,iconSrc:n}=Ke(e.destinationType.type);return{nodeWidth:rn,nodeHeight:sn,id:e.id,type:j.Destination,status:o,faded:t,title:ve(e,j.Destination,{prioritizeDisplayName:!0}),subTitle:e.destinationType.displayName,icon:i,iconSrc:n,monitors:qe(e.exportedSignals),isActive:!e.disabled,raw:e}},un=d.div`
48
+ `,ji=()=>{const[i,a]=t(0);return o(()=>{(async()=>{for(let e=0;e<=100;e+=5)await Ie(500),a(e)})()},[]),e.createElement(Li,null,e.createElement(Do,{size:100}),e.createElement(Ne,{width:400}),e.createElement(Pi,null,e.createElement(ce,{$gap:16},e.createElement(qi,null,"Preparing your workspace..."),e.createElement(Te,{label:`${i}%`})),e.createElement(Ki,null,"It can take up to a few minutes. Grab a cup of coffee, look out a window, and enjoy your free moment!")))},Vi=d(X)`
49
+ align-items: center !important;
50
+ justify-content: center !important;
51
+ align-self: stretch;
52
+
53
+ min-height: 50px;
54
+ width: calc(100% - 32px);
55
+ padding: 16px;
56
+ gap: 4px;
57
+
58
+ background-color: transparent;
59
+ border-radius: 16px;
60
+ border: 1px dashed ${({theme:e})=>e.colors.border};
61
+ cursor: pointer;
62
+
63
+ &:hover {
64
+ background-color: ${({theme:e})=>e.colors.dropdown_bg_2+I.opacity.hex["030"]};
65
+ }
66
+ `,zi=({entityType:t,description:o})=>{const{setCurrentModal:i}=Z(),{isThisPending:a}=R(),n=a({entityType:t});return e.createElement(Vi,{onClick:()=>i(t)},e.createElement(ce,{$gap:4},e.createElement(No,null),n?e.createElement(Ee,{size:14,weight:600,family:"secondary"},"Adding ",t):e.createElement(T,{size:14,weight:600,family:"secondary",decoration:"underline"},"Add ",t)),e.createElement(T,{size:12,align:"center"},n?"Just a few more seconds...":o))},Bi=d.div`
67
+ position: relative;
49
68
  width: 100%;
50
- height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px)`};
69
+ padding: 12px 0;
70
+ gap: 16px;
71
+ display: flex;
72
+ align-items: center;
73
+ border-bottom: 1px solid ${({theme:e})=>e.colors.border};
74
+ `,Hi=d(ce)`
75
+ margin-left: ${({$marginLeft:e})=>e};
76
+ `,Ui=d(Oe)`
77
+ width: 24px;
78
+ height: 24px;
79
+ padding: 0;
80
+ `,Wi=d.div`
81
+ position: absolute;
82
+ bottom: -2px;
83
+ left: 0;
84
+ background-color: ${({theme:e})=>e.colors.majestic_blue};
85
+ border-radius: 32px;
86
+ height: 4px;
87
+ width: ${({percent:e})=>`${e}%`};
88
+ transition: width 0.3s;
89
+ `,_i=({entityType:t,badge:o,badgeTooltip:i,isLoading:a})=>{const n=I.useTheme(),{sources:r}=U(),{isThisPending:s}=R(),{setCurrentModal:c}=Z(),{selectedSources:d,setSelectedSources:u}=Ae(),{isAwaitingInstrumentation:p,sourcesToCreate:m,sourcesCreated:h,sourcesToDelete:g,sourcesDeleted:y}=Me(),f=ke(t),b=t===B.Source&&p,x=(m?Math.floor(100/m*h):g?Math.floor(100/g*y):0)||1,[C,k]=l(()=>{let e=0;return Object.values(d).forEach(t=>e+=t.length),[0!==e,e]},[d]);return e.createElement(Bi,null,t===B.Source&&e.createElement(Hi,{$marginLeft:"28px"},e.createElement(v,{partiallyChecked:C&&r?.length!==k,value:C&&r?.length===k,onChange:e=>{if(e){const e={};r?.forEach(t=>{const o={namespace:t.namespace,name:t.name,kind:t.kind};s({entityType:B.Source,entityId:o})||(e[t.namespace]?e[t.namespace].push(t):e[t.namespace]=[t])}),u(e)}else u({})},disabled:!r?.length})),e.createElement(Hi,{$marginLeft:t===B.Source?"0":"28px"},e.createElement(Ce,{icon:f,title:`${t}s`,badge:b?`${x}%`:o,badgeTooltip:i,loading:a&&!b})),e.createElement(Hi,{$marginLeft:"auto"},e.createElement(Ui,{"data-id":`add-${t}`,variant:"primary",onClick:()=>c(t)},e.createElement(No,{fill:n.colors.primary,size:18}))),b&&e.createElement(Wi,{percent:x}))},Gi=d.div`
90
+ padding: 2px 6px;
91
+ background-color: ${({theme:e})=>e.colors.primary};
92
+ border-radius: 360px;
93
+ border: 1px solid ${({$isError:e,theme:t})=>e?t.colors.dark_red:t.colors.border};
94
+ color: ${({$isError:e,theme:t})=>e?t.text.error:t.text.light_grey};
95
+ font-family: ${({theme:e})=>e.font_family.secondary};
96
+ font-size: 10px;
97
+ font-weight: 400;
98
+ text-transform: uppercase;
99
+ display: flex;
100
+ gap: 4px;
101
+ align-items: center;
102
+ justify-content: center;
103
+ white-space: nowrap;
104
+ `,Ji=({entityId:t,entityType:o,status:i,faded:a,title:n,subTitle:l,label:r,icon:s,icons:c,iconSrc:d,iconSrcs:u,monitors:p,isActive:m,raw:h})=>{const g=I.useTheme(),y=o===B.Source,v="boolean"==typeof m,{setDrawerType:f,setDrawerEntityId:b}=P(),{isThisPending:x}=R(),C=x({entityType:o,entityId:t}),{selectedSources:k,setSelectedSources:w}=Ae(),S={...k},{namespace:$,name:D,kind:N}=h;y&&!S[$]&&(S[$]=[]);const T=y?S[$].findIndex(e=>e.name===D&&e.kind===N):-1;return e.createElement(Fe,{"data-id":void 0,title:n,subTitle:l,onClick:()=>{f(o),b(t)},renderActions:()=>{const t=y&&(!h.conditions?.length||h.conditions?.some(({status:e})=>"loading"===e)),o=v&&!m?me(H.Info,g):i?me(i,g):void 0,a=C||t?e.createElement(Re,{scale:.8}):o?e.createElement(o,{size:14}):null;return r?e.createElement(Gi,{$isError:i===H.Error},e.createElement(ue,{text:"Heads up! The data-flow metrics you see are calculated over 10-second intervals."},r),a):a||null},iconProps:{icon:s,icons:c,iconSrc:d,iconSrcs:u},visualProps:{status:i,faded:a||v&&!m,monitors:p||void 0},checkboxProps:{withCheckbox:y,isChecked:-1!==T,onCheckboxChange:()=>{-1===T?S[$].push(h):S[$].splice(T,1),w(S)},isCheckboxDisabled:C}})},Yi=d.div`
105
+ height: calc(${({$height:e})=>e}px - 24px);
106
+ width: calc(100% - 24px);
107
+ padding: 12px;
108
+ background: transparent;
109
+ border: 1px dashed ${({theme:e})=>e.colors.border};
110
+ border-radius: 24px;
51
111
  position: relative;
52
- `,pn=({heightToRemove:t,metrics:i})=>{const n=I.useTheme(),{isVm:a}=He(),r=he(),{selectedStreamName:s}=ze(),{isAwaitingInstrumentation:c}=We(),{containerRef:d,containerWidth:u,containerHeight:m}=je(),{sources:h,sourcesLoading:g,destinations:y,destinationsLoading:v,actions:f,actionsLoading:b,instrumentationRules:x,instrumentationRulesLoading:C}=B(),[$,k,S]=Zo([]),[w,D,N]=ei([]);o(()=>D((({theme:e,isVm:t,nodes:o,metrics:i,containerHeight:n})=>{const a=[],l=o.find(({id:e})=>(t?[`${j.Namespace}-${Ee.OdiLogo}`]:[`${j.Action}-${Ee.Frame}`,`${j.Action}-${Ee.Add}`]).includes(e))?.id,r=-ji/2+Vi,s=Math.floor(n/ji)*ji-(ji/2+Vi),c=e=>e===Ee.Base||e===Ee.Edged;return o.forEach(({type:t,id:o,data:{type:n,id:d,status:u},position:p})=>{if(n===j.Source&&c(t)){const{namespace:t,name:n,kind:c}=d,m=i?.sources.find(e=>e.kind===c&&e.name===n&&e.namespace===t);p.y>=r&&p.y<=s&&a.push(Bi(`${o}-to-${l}`,{theme:e,animated:!1,isMultiTarget:!1,label:Oe(m?.throughput),isError:u===V.Error}))}if(n===j.Destination&&c(t)){const t=i?.destinations.find(e=>e.id===d);p.y>=r&&p.y<=s&&a.push(Bi(`${l}-to-${o}`,{theme:e,animated:!1,isMultiTarget:!0,label:Oe(t?.throughput),isError:u===V.Error}))}}),a})({theme:n,isVm:a,nodes:$,metrics:i,containerHeight:m})),[n,a,$,i,m]);const T=l(()=>(({isVm:e,containerWidth:t})=>{const o=(!e&&t<=1500?1500:t)-an-24,i=e=>ln*((e||0)+1),n={[j.Namespace]:{x:0,y:()=>0},[j.InstrumentationRule]:{x:24,y:i},[j.Source]:{x:Pe(t,[[0,1600,o/3.5],[1600,null,o/4]]),y:i},[j.Action]:{x:Pe(t,[[0,1600,o/1.55],[1600,null,o/1.6]]),y:i},[j.Destination]:{x:o,y:i}},a={[j.Namespace]:{x:o/2+100,y:()=>i(2)},[j.InstrumentationRule]:{x:0,y:()=>0},[j.Source]:{x:24,y:i},[j.Action]:{x:0,y:()=>0},[j.Destination]:{x:o,y:i}};return e?a:n})({isVm:a,containerWidth:u}),[a,u]),E=(e,t)=>{k(o=>{const i=[...o].filter(({id:e})=>e.split("-")[0]!==t);return i.push(...e),i})},O=(e,t,o)=>{k(i=>ti(e.filter(e=>"parent"===e.extent&&e.parentId===`${t}-${Ee.Scroll}`).map(e=>({id:e.id,type:"position",position:{...e.position,y:e.position.y-o}})),i))};return o(()=>{const e=Ve(h,s),t=(({isVm:e,loading:t,entities:o,positions:i,unfilteredCount:n,containerHeight:a,onScroll:l})=>{const r=[],s=i[j.Source],c=o.length!==n;return r.push({id:`${j.Source}-${Ee.Header}`,type:Ee.Header,position:{x:i[j.Source].x,y:0},data:{nodeWidth:en,title:p.SOURCES,icon:$e(j.Source),badge:c?`${o.length}/${n}`:n,badgeTooltip:c?p.FILTERED_COUNT_TOOLTIP:void 0,isFetching:t,sources:o}}),o.length?(r.push({id:`${j.Source}-${Ee.Scroll}`,type:Ee.Scroll,position:{x:s.x,y:s.y()-on},style:{zIndex:1},data:{nodeWidth:en,nodeHeight:a-tn+2*on,items:o.map((t,o)=>({id:`${j.Source}-${o}`,data:nn(e,t)})),onScroll:l}}),o.forEach((t,o)=>{r.push({id:`${j.Source}-${o}-hidden`,type:Ee.Edged,extent:"parent",parentId:`${j.Source}-${Ee.Scroll}`,position:{x:on,y:s.y(o)-(tn-on/2)},style:{zIndex:-1},data:nn(e,t)})})):t?r.push({id:`${j.Source}-${Ee.Skeleton}`,type:Ee.Skeleton,position:{x:s.x,y:s.y()},data:{nodeWidth:en}}):r.push({id:`${j.Source}-${Ee.Add}`,type:Ee.Add,position:{x:s.x,y:s.y()},data:{nodeWidth:en,type:Fe.AddSource,title:p.ADD_SOURCE,subTitle:p.TO_COLLECT_OTEL_DATA}}),r})({isVm:a,entities:Be(e,r),loading:g||c,unfilteredCount:e.length,positions:T,containerHeight:m,onScroll:({scrollTop:e})=>O(t,j.Source,e)});E(t,j.Source)},[a,s,h,g,c,T[j.Source],r,m]),o(()=>{const e=Ue(y,s),t=(({loading:e,entities:t,positions:o,unfilteredCount:i,containerHeight:n,onScroll:a})=>{const l=[],r=o[j.Destination];return l.push({id:`${j.Destination}-${Ee.Header}`,type:Ee.Header,position:{x:o[j.Destination].x,y:0},data:{nodeWidth:rn,title:p.DESTINATIONS,icon:$e(j.Destination),badge:i,isFetching:e}}),t.length?(l.push({id:`${j.Destination}-${Ee.Scroll}`,type:Ee.Scroll,position:{x:r.x,y:r.y()-cn},style:{zIndex:1},data:{nodeWidth:rn,nodeHeight:n-sn+2*cn,items:t.map((e,t)=>({id:`${j.Destination}-${t}`,data:dn(e)})),onScroll:a}}),t.forEach((e,t)=>{l.push({id:`${j.Destination}-${t}-hidden`,type:Ee.Edged,extent:"parent",parentId:`${j.Destination}-${Ee.Scroll}`,position:{x:cn,y:r.y(t)-(sn-cn/2)},style:{zIndex:-1},data:dn(e)})})):e?l.push({id:`${j.Destination}-${Ee.Skeleton}`,type:Ee.Skeleton,position:{x:r.x,y:r.y()},data:{nodeWidth:rn}}):l.push({id:`${j.Destination}-${Ee.Add}`,type:Ee.Add,position:{x:r.x,y:r.y()},data:{nodeWidth:rn,type:Fe.AddDestination,title:p.ADD_DESTINATION,subTitle:p.TO_MONITOR_OTEL_DATA}}),l})({entities:_e(e,r),loading:v,unfilteredCount:e.length,positions:T,containerHeight:m,onScroll:({scrollTop:e})=>O(t,j.Destination,e)});E(t,j.Destination)},[a,s,y,v,T[j.Destination],r,m]),o(()=>{const e=a?[]:(({loading:e,entities:t,positions:o,unfilteredCount:i,containerHeight:n,onScroll:a})=>{const l=[],r=o[j.Action];return l.push({id:`${j.Action}-${Ee.Header}`,type:Ee.Header,position:{x:o[j.Action].x,y:0},data:{nodeWidth:Yi,title:p.ACTIONS,icon:$e(j.Action),badge:i,isFetching:e}}),t.length?(l.push({id:`${j.Action}-${Ee.Scroll}`,type:Ee.Scroll,position:{x:r.x,y:r.y()-Xi},style:{zIndex:1},data:{nodeWidth:Yi,nodeHeight:n-Qi+2*Xi,items:t.map((e,t)=>({id:`${j.Action}-${t}`,data:Zi(e)})),onScroll:a}}),t.forEach((e,t)=>{l.push({id:`${j.Action}-${t}-hidden`,type:Ee.Edged,extent:"parent",parentId:`${j.Action}-${Ee.Scroll}`,position:{x:Xi,y:r.y(t)-(Qi-Xi/2)},style:{zIndex:-1},data:Zi(e)})}),l.push({id:`${j.Action}-${Ee.Frame}`,type:Ee.Frame,position:{x:r.x-Xi,y:r.y()-Xi},data:{nodeWidth:Yi+2*Xi,nodeHeight:Math.min(n,Qi*t.length+Xi)}})):e?l.push({id:`${j.Action}-${Ee.Skeleton}`,type:Ee.Skeleton,position:{x:r.x,y:r.y()},data:{nodeWidth:Yi}}):l.push({id:`${j.Action}-${Ee.Add}`,type:Ee.Add,position:{x:r.x,y:r.y()},data:{nodeWidth:Yi,type:Fe.AddAction,title:p.ADD_ACTION,subTitle:p.TO_MODIFY_OTEL_DATA}}),l})({entities:ge(f,r),loading:b,unfilteredCount:f.length,positions:T,containerHeight:m,onScroll:({scrollTop:t})=>O(e,j.Action,t)});E(e,j.Action)},[a,f,b,T[j.Action],r,m]),o(()=>{const e=a?[]:(({loading:e,entities:t,positions:o,unfilteredCount:i,containerHeight:n,onScroll:a})=>{const l=[],r=o[j.InstrumentationRule];return l.push({id:`${j.InstrumentationRule}-${Ee.Header}`,type:Ee.Header,position:{x:o[j.InstrumentationRule].x,y:0},data:{nodeWidth:Ui,title:p.INSTRUMENTATION_RULES,icon:$e(j.InstrumentationRule),badge:i,isFetching:e}}),t.length?(l.push({id:`${j.InstrumentationRule}-${Ee.Scroll}`,type:Ee.Scroll,position:{x:r.x,y:r.y()-Gi},style:{zIndex:1},data:{nodeWidth:Ui,nodeHeight:n-_i+2*Gi,items:t.map((e,t)=>({id:`${j.InstrumentationRule}-${t}`,data:Ji(e)})),onScroll:a}}),t.forEach((e,t)=>{l.push({id:`${j.InstrumentationRule}-${t}-hidden`,type:Ee.Edged,extent:"parent",parentId:`${j.InstrumentationRule}-${Ee.Scroll}`,position:{x:Gi,y:r.y(t)-(_i-Gi/2)},style:{zIndex:-1},data:Ji(e)})})):e?l.push({id:`${j.InstrumentationRule}-${Ee.Skeleton}`,type:Ee.Skeleton,position:{x:r.x,y:r.y()},data:{nodeWidth:Ui}}):l.push({id:`${j.InstrumentationRule}-${Ee.Add}`,type:Ee.Add,position:{x:r.x,y:r.y()},data:{nodeWidth:Ui,type:Fe.AddRule,title:p.ADD_INSTRUMENTATION_RULE,subTitle:p.TO_MODIFY_OTEL_DATA}}),l})({entities:x,loading:C,unfilteredCount:x.length,positions:T,containerHeight:m,onScroll:({scrollTop:t})=>O(e,j.InstrumentationRule,t)});E(e,j.InstrumentationRule)},[a,x,C,T[j.InstrumentationRule],m]),o(()=>{const e=(({isVm:e,positions:t})=>{const o=[];if(!e)return o;const i=t[j.Namespace];return o.push({id:`${j.Namespace}-${Ee.OdiLogo}`,type:Ee.OdiLogo,position:{x:i.x,y:i.y()},data:{}}),o})({isVm:a,positions:T});E(e,j.Namespace)},[a,T[j.Namespace],m]),e.createElement(un,{ref:d,$heightToRemove:t},e.createElement(Ge,{nodes:$,edges:w,onNodesChange:S,onEdgesChange:N}))},mn=d.div`
112
+ `,Qi=d.div`
113
+ position: absolute;
114
+ bottom: 0;
115
+ left: 0;
116
+
117
+ width: 100%;
118
+ height: 100px;
119
+
120
+ background: ${({theme:e,$hide:t})=>t?"transparent":`linear-gradient(to top, ${e.colors.primary}, transparent)`};
121
+ border-radius: 0 0 24px 24px;
122
+ display: flex;
123
+ align-items: flex-end;
124
+ justify-content: center;
125
+
126
+ pointer-events: none;
127
+ `,Xi=({height:t,entityType:o,entities:i,metrics:a,isVm:n})=>{const r=l(()=>i.map(t=>{const i=Le(t);if(!i)return null;const l=[B.Source,B.Destination].includes(o),r=[B.Destination,B.Action].includes(o),s=[B.Destination,B.Action,B.InstrumentationRule].includes(o),c=r?o==B.Destination?Pe(t.exportedSignals):t.signals:void 0,d=l?a?.[`${o.toLowerCase()}s`]?.find(e=>JSON.stringify(Le(e))===JSON.stringify(i)):void 0,u=s?!t.disabled:void 0,p=ve(t,o,{extended:o===B.Source,prioritizeDisplayName:o!==B.Source}),m=((e,t,o)=>{switch(e){case B.Source:return o?`${t.kind}`:`${t.namespace} • ${t.kind}`;case B.Destination:return t.destinationType.displayName;case B.Action:case B.InstrumentationRule:return t.type;default:return""}})(o,t,n),h=l?qe(d?.throughput):void 0,{priorotizedStatus:g,hasDisableds:y}=re(t.conditions||[]),{icons:v,icon:f,iconSrc:b}=((e,t)=>{switch(e){case B.Source:return{icons:ze(t.containers),icon:ke(e)};case B.Destination:return Ve(t.destinationType.type);case B.Action:return{icon:G(t.type)};case B.InstrumentationRule:return{icon:je(t.type)};default:return{icon:ke(e)}}})(o,t);return e.createElement(Ji,{key:JSON.stringify(i),entityType:o,entityId:i,raw:t,title:p,subTitle:m,faded:y,status:g,label:h,icons:v,icon:f,iconSrc:b,monitors:c,isActive:u})}),[i,o,a,n]);return e.createElement(Yi,{$height:t},e.createElement(Ke,{containerHeight:t-24,elementHeight:80,elements:r}),e.createElement(Qi,{$hide:!0}))},Zi=d.div`
128
+ width: ${({$isVm:e})=>e?"45vw":"22vw"};
129
+
130
+ display: flex;
131
+ flex-direction: column;
132
+ gap: 12px;
133
+ `,ea=({entityType:t,entities:o,unfilteredCount:i,metrics:a,loading:n,maxHeight:l,isVm:r})=>{const s=o.length!==i,c=Math.min(l,80*o.length+12);return r&&[B.InstrumentationRule,B.Action].includes(t)?null:e.createElement(Zi,{$isVm:r},e.createElement(_i,{entityType:t,badge:s?`${o.length}/${i}`:i,badgeTooltip:s?p.FILTERED_COUNT_TOOLTIP:void 0,isLoading:n}),o.length?e.createElement(Xi,{height:c,entityType:t,entities:o,metrics:a,isVm:r}):n?e.createElement(Be,{size:3}):e.createElement(zi,{entityType:t,description:p.TO_COLLECT_OTEL_DATA}))},ta=d.div`
134
+ width: 100%;
135
+ height: ${({$height:e})=>e};
136
+
137
+ display: flex;
138
+ justify-content: space-evenly;
139
+ gap: 24px;
140
+ `,oa=({height:i,metrics:a})=>{const{isVm:n}=He(),l=he(),{selectedStreamName:r}=Ue(),{containerRef:s,containerHeight:c}=We(),{sources:d,sourcesLoading:u,destinations:p,destinationsLoading:m,actions:h,actionsLoading:g,instrumentationRules:y,instrumentationRulesLoading:v}=U(),[f,b]=t([]),[x,C]=t([]),[k,w]=t([]),[S,$]=t([]);return o(()=>{b(_e(Ge(d,r),l))},[d,r,l]),o(()=>{C(Je(Ye(p,r),l))},[p,r,l]),o(()=>{w(ge(h,l))},[h,l]),o(()=>{$(y)},[y]),e.createElement(ta,{ref:s,$height:i},e.createElement(ea,{entityType:B.InstrumentationRule,entities:S,unfilteredCount:y.length,loading:v,maxHeight:c,isVm:n}),e.createElement(ea,{entityType:B.Source,entities:f,unfilteredCount:d.length,metrics:a,loading:u,maxHeight:c,isVm:n}),e.createElement(ea,{entityType:B.Action,entities:k,unfilteredCount:h.length,loading:g,maxHeight:c,isVm:n}),e.createElement(ea,{entityType:B.Destination,entities:x,unfilteredCount:p.length,metrics:a,loading:m,maxHeight:c,isVm:n}))},ia=d.div`
53
141
  position: relative;
54
142
  max-width: 200px;
55
143
  `;d.div`
@@ -63,65 +151,65 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
63
151
  background-color: ${({theme:e})=>e.colors.dropdown_bg};
64
152
  border: ${({theme:e})=>`1px solid ${e.colors.border}`};
65
153
  border-radius: 24px;
66
- `;const hn=d.div`
154
+ `;const aa=d.div`
67
155
  display: flex;
68
156
  align-items: center;
69
157
  overflow-x: scroll;
70
- `,gn=({onClose:i})=>{const n=I.useTheme(),{onClickNode:a}=Je(),{searchText:s}=he(),{selectedStreamName:c}=ze(),{sources:d,destinations:u,actions:p,instrumentationRules:m}=B(),{popupRef:h,popupOpen:g,setPopupOpen:y,popupPosition:v,handlePosition:f}=Ye();o(()=>{g||(f(0,50),y(!0))},[g]);const[b,x]=t("all"),{categories:C,searchResults:$}=l(()=>Ri({instrumentationRules:m,sources:Ve(d,c),actions:p,destinations:Ue(u,c),searchText:s,selectedCategory:b}),[m,d,p,u,c,s,b]);return $.length?e.createElement(Qe,{ref:h,isOpen:g,top:v.top,left:v.left,maxWidth:"420px",header:e.createElement(hn,null,C.map(({category:t,label:o,count:i})=>!!i&&e.createElement(Xe,{key:`category-select-${t}`,label:o,badgeLabel:i,isSelected:b===t,onClick:()=>x(t)})))},$.map(({category:t,label:o,entities:l},s)=>!!l.length&&e.createElement(r,{key:`category-list-${t}`},e.createElement(Ze,{style:{maxHeight:"all"!==b?"240px":"140px",padding:"12px 0"}},e.createElement(T,{size:12,family:"secondary",color:n.text.darker_grey,style:{marginLeft:"16px"}},o),l.map((o,n)=>e.createElement(Xe,{key:`entity-${s}-${n}`,icon:$e(t),label:ve(o,t,{extended:!0}),onClick:()=>{const e=et(o);a(null,{data:{type:t,id:e}}),i()},style:{width:"100%",justifyContent:"flex-start"},color:"transparent"}))),e.createElement(le,{thickness:s===$.length-1?0:1,length:"90%",margin:"8px auto"})))):e.createElement(Qe,{ref:h,isOpen:g,top:v.top,left:v.left},e.createElement(De,null))},yn=({preventPopup:o=!1})=>{const{searchText:i,setSearchText:a}=he(),[l,r]=t(!1),s=!!i||l,c=()=>{a(""),r(!1)},d=n(null);return tt(d,c),q({key:"Escape",active:s},c),e.createElement(mn,{ref:d},e.createElement(x,{placeholder:"Search",icon:Io,value:i,onChange:e=>a(e.target.value.toLowerCase()),onFocus:()=>r(!0)}),s&&!o?e.createElement(gn,{onClose:c}):null)},vn=({sources:t,title:o="Condition",value:i,onSelect:n,onDeselect:a,...r})=>{const s=l(()=>{const e=[];return t.forEach(({conditions:t})=>{t?.forEach(({type:t,reason:o})=>{e.find(e=>e.id===`${t}#${o}`)||e.push({id:`${t}#${o}`,value:`${ot(t)} - ${ot(o)}`})})}),e.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[t]);return e.createElement(it,{disabled:!s?.length,title:o,placeholder:"All",options:s,value:i,onSelect:n,onDeselect:a,...r})},fn=({sources:t,title:o="Error Message",value:i,onSelect:n,onDeselect:a,disabled:r,...s})=>{const c=l(()=>{const e=[];return t.forEach(({conditions:t})=>{de(t||[]).forEach(({status:t,message:o,reason:i})=>{t!==V.Error||e.find(e=>e.id===o)||(o?e.find(e=>e.id===o)||e.push({id:o,value:o}):i&&(e.find(e=>e.id===i)||e.push({id:i,value:i})))})}),e},[t]);return e.createElement(it,{disabled:r||!c?.length,title:o,placeholder:"All",options:c,value:i,onSelect:n,onDeselect:a,...s})},bn=({sources:t,title:o="Programming Language",value:i,onSelect:n,onDeselect:a,...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:nt[t]||t})})}),e.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[t]);return e.createElement(it,{disabled:!s?.length,title:o,placeholder:"All",options:s,value:i,onSelect:n,onDeselect:a,...r})},xn=({title:t="Monitors",value:o,onSelect:i,onDeselect:n,...a})=>{const r=l(()=>{const e=[];return at.forEach(({id:t,value:o})=>{e.find(e=>e.id===t)||e.push({id:t,value:o})}),e},[]);return e.createElement(it,{disabled:!r?.length,title:t,placeholder:"All",options:r,value:o,onSelect:i,onDeselect:n,...a})},Cn=({namespaces:t,title:o="Namespace",value:i,onSelect:n,onDeselect:a,...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(it,{disabled:!s?.length,title:o,placeholder:"Select namespace",options:s,value:i,onSelect:n,onDeselect:a,...r})},$n=({sources:t,title:o="Kind",value:i,onSelect:n,onDeselect:a,...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(it,{disabled:!s?.length,title:o,placeholder:"All",options:s,value:i,onSelect:n,onDeselect:a,...r})},kn=d.div`
158
+ `,na=({onClose:i})=>{const a=I.useTheme(),{onClickNode:n}=Qe(),{searchText:s}=he(),{selectedStreamName:c}=Ue(),{sources:d,destinations:u,actions:p,instrumentationRules:m}=U(),{popupRef:h,popupOpen:g,setPopupOpen:y,popupPosition:v,handlePosition:f}=Xe();o(()=>{g||(f(0,50),y(!0))},[g]);const[b,x]=t("all"),{categories:C,searchResults:k}=l(()=>Mi({instrumentationRules:m,sources:Ge(d,c),actions:p,destinations:Ye(u,c),searchText:s,selectedCategory:b}),[m,d,p,u,c,s,b]);return k.length?e.createElement(Ze,{ref:h,isOpen:g,top:v.top,left:v.left,maxWidth:"420px",header:e.createElement(aa,null,C.map(({category:t,label:o,count:i})=>!!i&&e.createElement(et,{key:`category-select-${t}`,label:o,badgeLabel:i,isSelected:b===t,onClick:()=>x(t)})))},k.map(({category:t,label:o,entities:l},s)=>!!l.length&&e.createElement(r,{key:`category-list-${t}`},e.createElement(tt,{style:{maxHeight:"all"!==b?"240px":"140px",padding:"12px 0"}},e.createElement(T,{size:12,family:"secondary",color:a.text.darker_grey,style:{marginLeft:"16px"}},o),l.map((o,a)=>e.createElement(et,{key:`entity-${s}-${a}`,icon:ke(t),label:ve(o,t,{extended:!0}),onClick:()=>{const e=Le(o);n(null,{data:{type:t,id:e}}),i()},style:{width:"100%",justifyContent:"flex-start"},color:"transparent"}))),e.createElement(le,{thickness:s===k.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))},la=({preventPopup:o=!1})=>{const{searchText:i,setSearchText:n}=he(),[l,r]=t(!1),s=!!i||l,c=()=>{n(""),r(!1)},d=a(null);return ot(d,c),q({key:"Escape",active:s},c),e.createElement(ia,{ref:d},e.createElement(x,{placeholder:"Search",icon:To,value:i,onChange:e=>n(e.target.value.toLowerCase()),onFocus:()=>r(!0)}),s&&!o?e.createElement(na,{onClose:c}):null)},ra=({sources:t,title:o="Condition",value:i,onSelect:a,onDeselect:n,...r})=>{const s=l(()=>{const e=[];return t.forEach(({conditions:t})=>{t?.forEach(({type:t,reason:o})=>{e.find(e=>e.id===`${t}#${o}`)||e.push({id:`${t}#${o}`,value:`${it(t)} - ${it(o)}`})})}),e.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[t]);return e.createElement(at,{disabled:!s?.length,title:o,placeholder:"All",options:s,value:i,onSelect:a,onDeselect:n,...r})},sa=({sources:t,title:o="Error Message",value:i,onSelect:a,onDeselect:n,disabled:r,...s})=>{const c=l(()=>{const e=[];return t.forEach(({conditions:t})=>{de(t||[]).forEach(({status:t,message:o,reason:i})=>{t!==H.Error||e.find(e=>e.id===o)||(o?e.find(e=>e.id===o)||e.push({id:o,value:o}):i&&(e.find(e=>e.id===i)||e.push({id:i,value:i})))})}),e},[t]);return e.createElement(at,{disabled:r||!c?.length,title:o,placeholder:"All",options:c,value:i,onSelect:a,onDeselect:n,...s})},ca=({sources:t,title:o="Programming Language",value:i,onSelect:a,onDeselect:n,...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:nt[t]||t})})}),e.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[t]);return e.createElement(at,{disabled:!s?.length,title:o,placeholder:"All",options:s,value:i,onSelect:a,onDeselect:n,...r})},da=({title:t="Monitors",value:o,onSelect:i,onDeselect:a,...n})=>{const r=l(()=>{const e=[];return lt.forEach(({id:t,value:o})=>{e.find(e=>e.id===t)||e.push({id:t,value:o})}),e},[]);return e.createElement(at,{disabled:!r?.length,title:t,placeholder:"All",options:r,value:o,onSelect:i,onDeselect:a,...n})},ua=({namespaces:t,title:o="Namespace",value:i,onSelect:a,onDeselect:n,...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(at,{disabled:!s?.length,title:o,placeholder:"Select namespace",options:s,value:i,onSelect:a,onDeselect:n,...r})},pa=({sources:t,title:o="Kind",value:i,onSelect:a,onDeselect:n,...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(at,{disabled:!s?.length,title:o,placeholder:"All",options:s,value:i,onSelect:a,onDeselect:n,...r})},ma=d.div`
71
159
  display: flex;
72
160
  flex-direction: column;
73
161
  gap: 12px;
74
162
  padding: 12px;
75
- `,Sn=d.div`
163
+ `,ha=d.div`
76
164
  padding: 12px 6px 6px 6px;
77
- `,wn=d(lt)`
165
+ `,ga=d(Oe)`
78
166
  font-size: 14px;
79
167
  ${({$color:e})=>`color: ${e};`}
80
- `,Dn=d.div`
168
+ `,ya=d.div`
81
169
  margin-left: auto;
82
- `,Nn=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},Tn=()=>{const i=I.useTheme(),{isVm:a}=He(),{namespaces:r,sources:s}=B(),{selectedStreamName:c}=ze(),{getItemSS:d,setItemSS:u,removeItemSS:p}=st(),{popupRef:m,popupOpen:h,setPopupOpen:g,popupPosition:y,handlePosition:v}=Ye(),{namespaces:f,kinds:b,monitors:x,languages:C,conditions:$,errors:k,onlyErrors:w,setAll:D,clearAll:N,getEmptyState:T}=he(),E=l(()=>Ve(s,c),[s,c]),[O,M]=t({namespaces:f,kinds:b,monitors:x,languages:C,conditions:$,errors:k,onlyErrors:w}),[A,F]=t(Nn(O));o(()=>{const e=d(rt.OVERVIEW_FILTERS,T());D(e)},[]),o(()=>{if(!h){const e={namespaces:f,kinds:b,monitors:x,languages:C,conditions:$,errors:k,onlyErrors:w};M(e),F(Nn(e))}},[h,f,b,x,C,$,k,w]);const R=()=>{g(!1)},L=n(null);return tt(L,R),q({key:"Escape",active:h},R),e.createElement(mn,{ref:L},e.createElement(Xe,{label:"Filters",icon:Eo,badgeLabel:A,badgeFilled:!!A,withBorder:!0,color:"transparent",onClick:()=>{v(0,50),g(!0)}}),e.createElement(Qe,{ref:m,isOpen:h,top:y.top,left:y.left,width:"420px",footer:e.createElement(ce,null,e.createElement(wn,{variant:"primary",onClick:()=>{u(rt.OVERVIEW_FILTERS,O),D(O),F(Nn(O)),g(!1)}},"Apply"),e.createElement(wn,{variant:"secondary",onClick:R},"Cancel"),e.createElement(Dn,null,e.createElement(wn,{variant:"tertiary",onClick:()=>{p(rt.OVERVIEW_FILTERS),N(),M(T()),F(0),g(!1)},$color:i.text.error},"Reset")))},e.createElement(kn,null,!a&&e.createElement(Cn,{namespaces:r,value:O.namespaces,onSelect:e=>M(t=>({...t,namespaces:[...t.namespaces||[],e]})),onDeselect:e=>M(t=>({...t,namespaces:(t.namespaces||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement($n,{sources:E,value:O.kinds,onSelect:e=>M(t=>({...t,kinds:[...t.kinds||[],e]})),onDeselect:e=>M(t=>({...t,kinds:(t.kinds||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(bn,{sources:E,value:O.languages,onSelect:e=>M(t=>({...t,languages:[...t.languages||[],e]})),onDeselect:e=>M(t=>({...t,languages:(t.languages||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(xn,{value:O.monitors,onSelect:e=>M(t=>({...t,monitors:[...t.monitors||[],e]})),onDeselect:e=>M(t=>({...t,monitors:(t.monitors||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(vn,{sources:E,value:O.conditions,onSelect:e=>M(t=>({...t,conditions:[...t.conditions||[],e]})),onDeselect:e=>M(t=>({...t,conditions:(t.conditions||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(Sn,null,e.createElement(S,{title:"Show only sources with errors",initialValue:O.onlyErrors,onChange:e=>M(t=>({...t,errors:[],onlyErrors:e}))})),e.createElement(fn,{sources:E,value:O.errors,onSelect:e=>M(t=>({...t,errors:[...t.errors||[],e]})),onDeselect:e=>M(t=>({...t,errors:(t.errors||[]).filter(t=>t.id!==e.id)})),disabled:!O.onlyErrors,showSearch:!0,required:!0,isMulti:!0}))))},In=d.div`
170
+ `,va=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},fa=()=>{const i=I.useTheme(),{isVm:n}=He(),{namespaces:r,sources:s}=U(),{selectedStreamName:c}=Ue(),{getItemSS:d,setItemSS:u,removeItemSS:p}=st(),{popupRef:m,popupOpen:h,setPopupOpen:g,popupPosition:y,handlePosition:v}=Xe(),{namespaces:f,kinds:b,monitors:x,languages:C,conditions:k,errors:w,onlyErrors:$,setAll:D,clearAll:N,getEmptyState:T}=he(),E=l(()=>Ge(s,c),[s,c]),[O,A]=t({namespaces:f,kinds:b,monitors:x,languages:C,conditions:k,errors:w,onlyErrors:$}),[M,F]=t(va(O));o(()=>{const e=d(rt.OVERVIEW_FILTERS,T());D(e)},[]),o(()=>{if(!h){const e={namespaces:f,kinds:b,monitors:x,languages:C,conditions:k,errors:w,onlyErrors:$};A(e),F(va(e))}},[h,f,b,x,C,k,w,$]);const R=()=>{g(!1)},L=a(null);return ot(L,R),q({key:"Escape",active:h},R),e.createElement(ia,{ref:L},e.createElement(et,{label:"Filters",icon:Io,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(ce,null,e.createElement(ga,{variant:"primary",onClick:()=>{u(rt.OVERVIEW_FILTERS,O),D(O),F(va(O)),g(!1)}},"Apply"),e.createElement(ga,{variant:"secondary",onClick:R},"Cancel"),e.createElement(ya,null,e.createElement(ga,{variant:"tertiary",onClick:()=>{p(rt.OVERVIEW_FILTERS),N(),A(T()),F(0),g(!1)},$color:i.text.error},"Reset")))},e.createElement(ma,null,!n&&e.createElement(ua,{namespaces:r,value:O.namespaces,onSelect:e=>A(t=>({...t,namespaces:[...t.namespaces||[],e]})),onDeselect:e=>A(t=>({...t,namespaces:(t.namespaces||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(pa,{sources:E,value:O.kinds,onSelect:e=>A(t=>({...t,kinds:[...t.kinds||[],e]})),onDeselect:e=>A(t=>({...t,kinds:(t.kinds||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(ca,{sources:E,value:O.languages,onSelect:e=>A(t=>({...t,languages:[...t.languages||[],e]})),onDeselect:e=>A(t=>({...t,languages:(t.languages||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(da,{value:O.monitors,onSelect:e=>A(t=>({...t,monitors:[...t.monitors||[],e]})),onDeselect:e=>A(t=>({...t,monitors:(t.monitors||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(ra,{sources:E,value:O.conditions,onSelect:e=>A(t=>({...t,conditions:[...t.conditions||[],e]})),onDeselect:e=>A(t=>({...t,conditions:(t.conditions||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(ha,null,e.createElement(S,{title:"Show only sources with errors",initialValue:O.onlyErrors,onChange:e=>A(t=>({...t,errors:[],onlyErrors:e}))})),e.createElement(sa,{sources:E,value:O.errors,onSelect:e=>A(t=>({...t,errors:[...t.errors||[],e]})),onDeselect:e=>A(t=>({...t,errors:(t.errors||[]).filter(t=>t.id!==e.id)})),disabled:!O.onlyErrors,showSearch:!0,required:!0,isMulti:!0}))))},ba=d.div`
83
171
  display: flex;
84
172
  flex-direction: column;
85
173
  gap: 24px;
86
174
  padding: 4px;
87
- `,En=({formData:t,handleFormChange:o,formErrors:i})=>{const{dataStreams:n,selectedStreamName:a}=ze(),r=l(()=>n.find(e=>e.name===t.name&&e.name!==a),[n,t.name,a]);return e.createElement(In,null,e.createElement(x,{name:"name",title:p.STREAM_NAME,placeholder:p.NAME_YOUR_STREAM_PLACEHOLDER,required:!0,value:t.name,onChange:({target:{value:e}})=>o("name",e),errorMessage:i.name}),r&&e.createElement(ie,{type:V.Warning,message:p.DATA_STREAM_EXISTS_WARNING(a,r.name)}))},On=d.div`
175
+ `,xa=({formData:t,handleFormChange:o,formErrors:i})=>{const{dataStreams:a,selectedStreamName:n}=Ue(),r=l(()=>a.find(e=>e.name===t.name&&e.name!==n),[a,t.name,n]);return e.createElement(ba,null,e.createElement(x,{name:"name",title:p.STREAM_NAME,placeholder:p.NAME_YOUR_STREAM_PLACEHOLDER,required:!0,value:t.name,onChange:({target:{value:e}})=>o("name",e),errorMessage:i.name}),r&&e.createElement(ie,{type:H.Warning,message:p.DATA_STREAM_EXISTS_WARNING(n,r.name)}))},Ca=d.div`
88
176
  width: 100%;
89
177
  height: 100%;
90
178
  max-height: calc(100vh - 220px);
91
179
  overflow: overlay;
92
180
  overflow-y: auto;
93
- `,Mn=({isOpen:o,onClose:i,dataStreamName:a,updateDataStream:r})=>{const{dataStreams:c}=ze(),d=n(null),[u,p]=t(!1),{formData:m,handleFormChange:h,formErrors:g,validateForm:y,resetFormData:v,loadFormWithDrawerItem:f}=ct({name:a}),b=l(()=>{if(!o)return v();const e=c?.find(e=>e.name===a);return e?f(e):v(),e},[o,c,a]),x=s((e,t)=>{h(e,t),p(!0)},[h]);return b?e.createElement(wi,{ref:d,title:b.name,icons:[Oo],hideEditTitleFromEdit:!0,isEdit:!0,isFormDirty:u,onSave:()=>{y({withAlert:!0,alertTitle:Q.Update})&&(r(a,m),p(!1),i())},onCancel:()=>{v(),p(!1),i()}},e.createElement(On,null,e.createElement(En,{formData:m,handleFormChange:x,formErrors:g}))):null},An=d.div`
181
+ `,ka=({isOpen:o,onClose:i,dataStreamName:n,updateDataStream:r})=>{const{dataStreams:c}=Ue(),d=a(null),[u,p]=t(!1),{formData:m,handleFormChange:h,formErrors:g,validateForm:y,resetFormData:v,loadFormWithDrawerItem:f}=ct({name:n}),b=l(()=>{if(!o)return v();const e=c?.find(e=>e.name===n);return e?f(e):v(),e},[o,c,n]),x=s((e,t)=>{h(e,t),p(!0)},[h]);return b?e.createElement(wi,{ref:d,title:b.name,icons:[Eo],hideEditTitleFromEdit:!0,isEdit:!0,isFormDirty:u,onSave:()=>{y({withAlert:!0,alertTitle:Q.Update})&&(r(n,m),p(!1),i())},onCancel:()=>{v(),p(!1),i()}},e.createElement(Ca,null,e.createElement(xa,{formData:m,handleFormChange:x,formErrors:g}))):null},wa=d.div`
94
182
  position: relative;
95
- `,Fn=d(ce)`
183
+ `,Sa=d(ce)`
96
184
  border: 1px solid ${({theme:e})=>e.colors.border};
97
185
  border-radius: 32px;
98
186
 
99
187
  & button {
100
188
  max-height: 28px;
101
189
  }
102
- `,Rn=d(T)`
190
+ `,$a=d(T)`
103
191
  text-wrap: nowrap;
104
- `,Ln=d(Ze)`
192
+ `,Da=d(tt)`
105
193
  max-height: 240px;
106
194
  padding: 0px !important;
107
- `,Pn=d(ce)`
195
+ `,Na=d(ce)`
108
196
  width: 100%;
109
- `,qn=d.div`
197
+ `,Ta=d.div`
110
198
  width: 100%;
111
- `,Kn=({onClickNewDataStream:o,updateDataStream:i,deleteDataStream:n})=>{const a=I.useTheme(),{popupRef:r,popupOpen:s,setPopupOpen:c,popupPosition:d,handlePosition:u}=Ye(),{dataStreams:p,selectedStreamName:m,setSelectedStreamName:h}=ze(),{setFetchedAllNamespaces:g,setAvailableSources:y,setConfiguredSources:v,setConfiguredFutureApps:f}=dt(),[b,C]=t(""),[$,k]=t(""),[S,w]=t(""),D=()=>{g(!1),y({}),v({}),f({})},N=l(()=>p.filter(({name:e})=>!S||e.toLowerCase().includes(S.toLowerCase())).map(({name:t})=>e.createElement(Pn,{key:`stream-${t}`},e.createElement(qn,null,e.createElement(Xe,{label:t,isSelected:m===t,onClick:()=>{D(),h(t),c(!1)},color:"transparent",style:{width:"100%",justifyContent:"flex-start"}})),t!==ut&&e.createElement(pt,{onClick:()=>k(t),tooltip:K.DELETE},e.createElement(No,null)),e.createElement(pt,{onClick:()=>C(t),tooltip:K.EDIT},e.createElement(Do,null)))),[p,m,S]);return e.createElement(e.Fragment,null,e.createElement(An,null,e.createElement(Fn,{$gap:0},e.createElement(lt,{variant:"tertiary",onClick:()=>{u(0,50),c(e=>!e)}},e.createElement(Oo,{fill:a.text.info}),e.createElement(Rn,null,"Data Stream: ",m),e.createElement(mt,{extend:s}),e.createElement(Te,{label:p.length})),e.createElement(le,{orientation:"vertical",length:"32px",thickness:2,margin:"0"}),e.createElement(ht,{onClick:()=>{D(),o()},label:K.NEW})),e.createElement(Qe,{ref:r,isOpen:s,top:d.top,left:d.left,header:e.createElement(x,{placeholder:"Search...",icon:Io,value:S,onChange:e=>w(e.target.value)})},e.createElement(Ln,null,N))),e.createElement(z,{isOpen:""!==$,name:$,onApprove:()=>{n($),k("")},onDeny:()=>{k("")}}),e.createElement(Mn,{isOpen:""!==b,onClose:()=>{C("")},dataStreamName:b,updateDataStream:i}))},Hn=d.div`
199
+ `,Ia=({onClickNewDataStream:o,updateDataStream:i,deleteDataStream:a})=>{const n=I.useTheme(),{popupRef:r,popupOpen:s,setPopupOpen:c,popupPosition:d,handlePosition:u}=Xe(),{dataStreams:p,selectedStreamName:m,setSelectedStreamName:h}=Ue(),{setFetchedAllNamespaces:g,setAvailableSources:y,setConfiguredSources:v,setConfiguredFutureApps:f}=dt(),[b,C]=t(""),[k,w]=t(""),[S,$]=t(""),D=()=>{g(!1),y({}),v({}),f({})},N=l(()=>p.filter(({name:e})=>!S||e.toLowerCase().includes(S.toLowerCase())).map(({name:t})=>e.createElement(Na,{key:`stream-${t}`},e.createElement(Ta,null,e.createElement(et,{label:t,isSelected:m===t,onClick:()=>{D(),h(t),c(!1)},color:"transparent",style:{width:"100%",justifyContent:"flex-start"}})),t!==ut&&e.createElement(pt,{onClick:()=>w(t),tooltip:K.DELETE},e.createElement($o,null)),e.createElement(pt,{onClick:()=>C(t),tooltip:K.EDIT},e.createElement(So,null)))),[p,m,S]);return e.createElement(e.Fragment,null,e.createElement(wa,null,e.createElement(Sa,{$gap:0},e.createElement(Oe,{variant:"tertiary",onClick:()=>{u(0,50),c(e=>!e)}},e.createElement(Eo,{fill:n.text.info}),e.createElement($a,null,"Data Stream: ",m),e.createElement(mt,{extend:s}),e.createElement(Te,{label:p.length})),e.createElement(le,{orientation:"vertical",length:"32px",thickness:2,margin:"0"}),e.createElement(ht,{onClick:()=>{D(),o()},label:K.NEW})),e.createElement(Ze,{ref:r,isOpen:s,top:d.top,left:d.left,header:e.createElement(x,{placeholder:"Search...",icon:To,value:S,onChange:e=>$(e.target.value)})},e.createElement(Da,null,N))),e.createElement(V,{isOpen:""!==k,name:k,onApprove:()=>{a(k),w("")},onDeny:()=>{w("")}}),e.createElement(ka,{isOpen:""!==b,onClose:()=>{C("")},dataStreamName:b,updateDataStream:i}))},Ea=d.div`
112
200
  display: flex;
113
201
  align-items: center;
114
202
  margin: 20px 0;
115
203
  padding: 0 16px;
116
204
  gap: 8px;
117
- `,zn=d.div`
205
+ `,Oa=d.div`
118
206
  margin-left: auto;
119
- `,Wn=({addEntity:t,preventSearchPopup:o,onClickNewDataStream:i,updateDataStream:n,deleteDataStream:a})=>{const{setCurrentModal:l}=Z();return e.createElement(Hn,null,e.createElement(Kn,{onClickNewDataStream:i,updateDataStream:n,deleteDataStream:a}),e.createElement(yn,{preventPopup:o}),e.createElement(Tn,null),t&&e.createElement(zn,null,e.createElement(ht,{"data-id":`add-${t}`,onClick:()=>l(t),label:`${K.ADD} ${ot(t)}`,variant:"primary",textProps:{weight:900}})))},jn=i(({isModal:t,onClickSummary:o},i)=>{const{selectedStreamName:n}=ze(),{formData:l,handleFormChange:r,formErrors:s,validateForm:c}=ct({name:n});return a(i,()=>({validateForm:c,getFormValues:()=>l})),e.createElement(oe,{$isNotModal:!t},e.createElement(X,{$gap:24},o&&e.createElement(gt,{onClick:o}),e.createElement(O,{title:p.NAME_YOUR_STREAM,description:p.STREAM_DESCRIPTION}),e.createElement(En,{formData:l,handleFormChange:r,formErrors:s})))});jn.displayName=jn.name;const Vn=({createDataStream:t})=>{const{currentModal:o,setCurrentModal:i}=Z(),{addDataStreams:a,setSelectedStreamName:l}=ze(),r=o===yt.DataStream,s=()=>i(""),c=async()=>{if(d.current&&d.current.validateForm()){const e=d.current.getFormValues();t?t(e):(a([e]),l(e.name)),s()}},d=n(null);return q({key:"Enter",active:r},c),e.createElement(ee,{isOpen:r,onClose:s,header:{title:"Add Data Stream"},actionComponent:e.createElement(te,{buttons:[{label:"DONE",variant:"primary",onClick:c}]})},e.createElement(jn,{ref:d,isModal:!0}))},Bn=e=>Object.keys(e).filter(t=>e[t]).join(", "),Un=(e,t)=>{const{destinationType:o,disabled:i,exportedSignals:n}=e,a=[{title:p.TYPE,value:o.type},{type:m.ActiveStatus,title:p.STATUS,value:String(!i)},{type:m.Monitors,title:p.MONITORS,value:Bn(n)},{title:p.NAME,value:o.displayName}],l=vt(e,t),r=l.map(e=>({name:e.key,value:e.value}));return l.map(({key:e,name:o,value:i})=>{const{secret:l,componentProperties:s,hideFromReadData:c,customReadDataLabels:d}=t.find(t=>t.name===e)||{};if(!c?.length||!ft(c,qe(n),r)){const{type:e}=bt(s,{type:""}),t=(l||"password"===e)&&i.length?new Array(10).fill("•").join(""):"";a.push({type:m.Divider}),d?.length?d.forEach(({condition:e,...t})=>{e==i&&a.push({title:t.title,value:t.value})}):a.push({title:o,value:t||i})}}),a},_n=({signals:t,fields:o,onChange:i,formErrors:n})=>o?.map(a=>{const{componentType:l,renderCondition:r,...s}=a;if(r&&!ft(r,t,o))return null;switch(l){case N.Input:return e.createElement(x,{key:a.name,...s,onChange:e=>i(a.name,e.target.value),errorMessage:n[a.name]});case N.Dropdown:return e.createElement(it,{key:a.name,...s,showSearch:!0,value:{id:s.value||"",value:s.value||""},options:s.options||[],onSelect:e=>i(a.name,e.id),errorMessage:n[a.name]});case N.MultiInput:return e.createElement(D,{key:a.name,...s,value:"string"==typeof s.value?bt(s.value,[]):s.value,onChange:e=>i(a.name,JSON.stringify(e)),errorMessage:n[a.name]});case N.KeyValuePair:return e.createElement(w,{key:a.name,...s,value:"string"==typeof s.value?bt(s.value,[]):s.value,onChange:e=>i(a.name,JSON.stringify(e)),errorMessage:n[a.name]});case N.TextArea:return e.createElement(F,{key:a.name,...s,onChange:e=>i(a.name,e.target.value),errorMessage:n[a.name]});case N.Checkbox:return e.createElement(v,{key:a.name,...s,value:"true"==s.value,onChange:e=>i(a.name,String(e)),errorMessage:n[a.name]});default:return null}}),Gn=d(lt)`
207
+ `,Aa=({addEntity:t,preventSearchPopup:o,onClickNewDataStream:i,updateDataStream:a,deleteDataStream:n})=>{const{setCurrentModal:l}=Z();return e.createElement(Ea,null,e.createElement(Ia,{onClickNewDataStream:i,updateDataStream:a,deleteDataStream:n}),e.createElement(la,{preventPopup:o}),e.createElement(fa,null),t&&e.createElement(Oa,null,e.createElement(ht,{"data-id":`add-${t}`,onClick:()=>l(t),label:`${K.ADD} ${it(t)}`,variant:"primary",textProps:{weight:900}})))},Ma=i(({isModal:t,onClickSummary:o},i)=>{const{selectedStreamName:a}=Ue(),{formData:l,handleFormChange:r,formErrors:s,validateForm:c}=ct({name:a});return n(i,()=>({validateForm:c,getFormValues:()=>l})),e.createElement(oe,{$isNotModal:!t},e.createElement(X,{$gap:24},o&&e.createElement(gt,{onClick:o}),e.createElement(O,{title:p.NAME_YOUR_STREAM,description:p.STREAM_DESCRIPTION}),e.createElement(xa,{formData:l,handleFormChange:r,formErrors:s})))});Ma.displayName=Ma.name;const Fa=({createDataStream:t})=>{const{currentModal:o,setCurrentModal:i}=Z(),{addDataStreams:n,setSelectedStreamName:l}=Ue(),r=o===yt.DataStream,s=()=>i(""),c=async()=>{if(d.current&&d.current.validateForm()){const e=d.current.getFormValues();t?t(e):(n([e]),l(e.name)),s()}},d=a(null);return q({key:"Enter",active:r},c),e.createElement(ee,{isOpen:r,onClose:s,header:{title:"Add Data Stream"},actionComponent:e.createElement(te,{buttons:[{label:"DONE",variant:"primary",onClick:c}]})},e.createElement(Ma,{ref:d,isModal:!0}))},Ra=e=>Object.keys(e).filter(t=>e[t]).join(", "),La=(e,t)=>{const{destinationType:o,disabled:i,exportedSignals:a}=e,n=[{title:p.TYPE,value:o.type},{type:m.ActiveStatus,title:p.STATUS,value:String(!i)},{type:m.Monitors,title:p.MONITORS,value:Ra(a)},{title:p.NAME,value:o.displayName}],l=vt(e,t),r=l.map(e=>({name:e.key,value:e.value}));return l.map(({key:e,name:o,value:i})=>{const{secret:l,componentProperties:s,hideFromReadData:c,customReadDataLabels:d}=t.find(t=>t.name===e)||{};if(!c?.length||!ft(c,Pe(a),r)){const{type:e}=bt(s,{type:""}),t=(l||"password"===e)&&i.length?new Array(10).fill("•").join(""):"";n.push({type:m.Divider}),d?.length?d.forEach(({condition:e,...t})=>{e==i&&n.push({title:t.title,value:t.value})}):n.push({title:o,value:t||i})}}),n},Pa=({signals:t,fields:o,onChange:i,formErrors:a})=>o?.map(n=>{const{componentType:l,renderCondition:r,...s}=n;if(r&&!ft(r,t,o))return null;switch(l){case N.Input:return e.createElement(x,{key:n.name,...s,onChange:e=>i(n.name,e.target.value),errorMessage:a[n.name]});case N.Dropdown:return e.createElement(at,{key:n.name,...s,showSearch:!0,value:{id:s.value||"",value:s.value||""},options:s.options||[],onSelect:e=>i(n.name,e.id),errorMessage:a[n.name]});case N.MultiInput:return e.createElement(D,{key:n.name,...s,value:"string"==typeof s.value?bt(s.value,[]):s.value,onChange:e=>i(n.name,JSON.stringify(e)),errorMessage:a[n.name]});case N.KeyValuePair:return e.createElement($,{key:n.name,...s,value:"string"==typeof s.value?bt(s.value,[]):s.value,onChange:e=>i(n.name,JSON.stringify(e)),errorMessage:a[n.name]});case N.TextArea:return e.createElement(F,{key:n.name,...s,onChange:e=>i(n.name,e.target.value),errorMessage:a[n.name]});case N.Checkbox:return e.createElement(v,{key:n.name,...s,value:"true"==s.value,onChange:e=>i(n.name,String(e)),errorMessage:a[n.name]});default:return null}}),qa=d(Oe)`
120
208
  display: flex;
121
209
  align-items: center;
122
210
  gap: 8px;
123
211
 
124
- ${({$status:e,theme:t})=>e===V.Success?u`
212
+ ${({$status:e,theme:t})=>e===H.Success?u`
125
213
  border-color: transparent;
126
214
  background-color: ${t.colors.success};
127
215
  `:"error"===e?u`
@@ -130,43 +218,43 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
130
218
  `:u`
131
219
  background-color: transparent;
132
220
  `}
133
- `,Jn=({destination:o,validateForm:i,status:n,testConnection:a,onSuccess:l,onError:r})=>{const s=I.useTheme(),{selectedStreamName:c}=ze(),[d,u]=t(!1),p=n?me(n,s):void 0;return e.createElement(Gn,{$status:n,variant:"secondary",onClick:async()=>{if(i()){u(!0);const e=await a({...o,currentStreamName:c});e&&(e.succeeded?l(e):r(e)),u(!1)}}},d?e.createElement(xt,null):p?e.createElement(p,null):null,e.createElement(T,{family:"secondary",decoration:"underline",size:14,color:n?s.text[n]:void 0},d?"Checking":n===V.Success?"Connection OK":"error"===n?"Connection Failed":"Test Connection"))},Yn=d(X)`
221
+ `,Ka=({destination:o,validateForm:i,status:a,testConnection:n,onSuccess:l,onError:r})=>{const s=I.useTheme(),{selectedStreamName:c}=Ue(),[d,u]=t(!1),p=a?me(a,s):void 0;return e.createElement(qa,{$status:a,variant:"secondary",onClick:async()=>{if(i()){u(!0);const e=await n({...o,currentStreamName:c});e&&(e.succeeded?l(e):r(e)),u(!1)}}},d?e.createElement(Re,null):p?e.createElement(p,null):null,e.createElement(T,{family:"secondary",decoration:"underline",size:14,color:a?s.text[a]:void 0},d?"Checking":a===H.Success?"Connection OK":"error"===a?"Connection Failed":"Test Connection"))},ja=d(X)`
134
222
  align-items: unset;
135
223
  padding: 0 4px;
136
- `,Qn=d.div`
224
+ `,Va=d.div`
137
225
  display: flex;
138
226
  flex-direction: column;
139
227
  gap: 12px;
140
- `,Xn=d(ce)`
228
+ `,za=d(ce)`
141
229
  justify-content: space-between;
142
- `,Zn=d(T)`
230
+ `,Ba=d(T)`
143
231
  margin-bottom: 12px;
144
- `,ea=({isUpdate:i,categoryItem:a,formData:r,formErrors:s,validateForm:c,handleFormChange:d,dynamicFields:u,setDynamicFields:m,testConnection:h})=>{const{type:g,displayName:y,supportedSignals:v,testConnectionSupported:f}=a||{},b=I.useTheme(),[C,$]=t(!1),[k,S]=t(!1),[w,D]=t(void 0),N=n(!1);o(()=>{if(u.length&&!N.current){N.current=!0;let e=!1;for(let t=0;t<u.length;t++){const{required:o,value:i}=u[t];if(o){if([void 0,null,""].includes(i)){e=!1;break}e=!0}}$(e)}},[u,k]);const T=l(()=>{const{logs:e,metrics:t,traces:o}=v||{},i=[];return e?.supported&&i.push(Ct.Logs),t?.supported&&i.push(Ct.Metrics),o?.supported&&i.push(Ct.Traces),i},[v]),F=l(()=>{const{logs:e,metrics:t,traces:o}=r.exportedSignals||{},i=[];return e&&i.push(Ct.Logs),t&&i.push(Ct.Metrics),o&&i.push(Ct.Traces),i},[r.exportedSignals]),R=()=>{$(!1),S(!0),D(void 0)};return e.createElement(Yn,{$gap:24},e.createElement(Yn,{$gap:12},e.createElement(O,{title:i?"Update destination":"Create destination",description:`Connect ${y} with Odigos.`,actionButton:f&&e.createElement(Jn,{destination:r,validateForm:c,status:w?.type,testConnection:h,onError:e=>{S(!1),D({type:V.Error,title:e?.reason||"Connection failed",message:e?.message||"Please check your input and try again."})},onSuccess:e=>{S(!1),D({type:V.Success,title:e?.reason||"Connection succeeded",message:e?.message||""})}})}),e.createElement(Qn,null,f&&w&&e.createElement(ie,{type:w.type,title:w.title,message:w.message}),C&&!w&&!i&&e.createElement(ie,{type:V.Default,message:`Odigos autocompleted ${y} destination details.`})),e.createElement(le,null)),e.createElement(Xn,null,e.createElement(A,{title:i?"":"This connection will monitor:",required:!0,allowedSignals:T,selectedSignals:F,setSelectedSignals:e=>{R(),d("exportedSignals",{logs:e.includes(Ct.Logs),metrics:e.includes(Ct.Metrics),traces:e.includes(Ct.Traces)})},errorMessage:s.exportedSignals}),!i&&e.createElement(M,{endpoint:`/backends/${g}`})),i&&e.createElement("div",null,e.createElement(Zn,null,"Status"),e.createElement(E,{options:[{icon:So,label:p.ENABLED,value:!1,selectedBgColor:b.text.success+I.opacity.hex["050"]},{icon:wo,label:p.DISABLED,value:!0,selectedBgColor:b.text.error+I.opacity.hex["050"]}],selected:r.disabled,setSelected:e=>d("disabled",e)})),!i&&e.createElement(x,{title:"Destination name",placeholder:"Enter destination name",value:r.name,onChange:e=>{R(),d("name",e.target.value)},errorMessage:s.name}),e.createElement(_n,{signals:F,fields:u,onChange:(e,t)=>{R(),m(o=>{const i=[...o],n=i.findIndex(t=>t.name===e);return-1!==n&&(i[n]={...i[n],value:t}),i})},formErrors:s}))},ta=d.div`
232
+ `,Ha=({isUpdate:i,categoryItem:n,formData:r,formErrors:s,validateForm:c,handleFormChange:d,dynamicFields:u,setDynamicFields:m,testConnection:h})=>{const{type:g,displayName:y,supportedSignals:v,testConnectionSupported:f}=n||{},b=I.useTheme(),[C,k]=t(!1),[w,S]=t(!1),[$,D]=t(void 0),N=a(!1);o(()=>{if(u.length&&!N.current){N.current=!0;let e=!1;for(let t=0;t<u.length;t++){const{required:o,value:i}=u[t];if(o){if([void 0,null,""].includes(i)){e=!1;break}e=!0}}k(e)}},[u,w]);const T=l(()=>{const{logs:e,metrics:t,traces:o}=v||{},i=[];return e?.supported&&i.push(xt.Logs),t?.supported&&i.push(xt.Metrics),o?.supported&&i.push(xt.Traces),i},[v]),F=l(()=>{const{logs:e,metrics:t,traces:o}=r.exportedSignals||{},i=[];return e&&i.push(xt.Logs),t&&i.push(xt.Metrics),o&&i.push(xt.Traces),i},[r.exportedSignals]),R=()=>{k(!1),S(!0),D(void 0)};return e.createElement(ja,{$gap:24},e.createElement(ja,{$gap:12},e.createElement(O,{title:i?"Update destination":"Create destination",description:`Connect ${y} with Odigos.`,actionButton:f&&e.createElement(Ka,{destination:r,validateForm:c,status:$?.type,testConnection:h,onError:e=>{S(!1),D({type:H.Error,title:e?.reason||"Connection failed",message:e?.message||"Please check your input and try again."})},onSuccess:e=>{S(!1),D({type:H.Success,title:e?.reason||"Connection succeeded",message:e?.message||""})}})}),e.createElement(Va,null,f&&$&&e.createElement(ie,{type:$.type,title:$.title,message:$.message}),C&&!$&&!i&&e.createElement(ie,{type:H.Default,message:`Odigos autocompleted ${y} destination details.`})),e.createElement(le,null)),e.createElement(za,null,e.createElement(M,{title:i?"":"This connection will monitor:",required:!0,allowedSignals:T,selectedSignals:F,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(A,{endpoint:`/backends/${g}`})),i&&e.createElement("div",null,e.createElement(Ba,null,"Status"),e.createElement(E,{options:[{icon:ko,label:p.ENABLED,value:!1,selectedBgColor:b.text.success+I.opacity.hex["050"]},{icon:wo,label:p.DISABLED,value:!0,selectedBgColor:b.text.error+I.opacity.hex["050"]}],selected:r.disabled,setSelected:e=>d("disabled",e)})),!i&&e.createElement(x,{title:"Destination name",placeholder:"Enter destination name",value:r.name,onChange:e=>{R(),d("name",e.target.value)},errorMessage:s.name}),e.createElement(Pa,{signals:F,fields:u,onChange:(e,t)=>{R(),m(o=>{const i=[...o],a=i.findIndex(t=>t.name===e);return-1!==a&&(i[a]={...i[a],value:t}),i})},formErrors:s}))},Ua=d.div`
145
233
  width: 100%;
146
234
  height: 100%;
147
235
  max-height: calc(100vh - 220px);
148
236
  overflow: overlay;
149
237
  overflow-y: auto;
150
- `,oa=d.div`
238
+ `,Wa=d.div`
151
239
  display: flex;
152
240
  flex-direction: column;
153
241
  gap: 12px;
154
- `,ia=({categories:o,updateDestination:i,deleteDestination:a,testConnection:r})=>{const{destinations:s}=B(),{selectedStreamName:c}=ze(),{drawerType:d,drawerEntityId:u}=P(),m=l(()=>Ue(s,c),[s,c]),h=n(null),g=d!==j.Destination,[y,v]=t(!1),[f,b]=t(!1),{formData:x,formErrors:C,handleFormChange:$,resetFormData:k,validateForm:S,loadFormWithDrawerItem:w,yamlFields:D,setYamlFields:N,dynamicFields:T,setDynamicFields:I}=$t({}),E=l(()=>{if(g)return k();const e=m?.find(e=>e.id===u);return e?(w(e),N(kt(o,e))):k(),e},[g,u,m]);if(!E)return null;const O=o.flatMap(e=>e.items).find(e=>e.type===E.destinationType.type),{icon:M,iconSrc:A}=O?Ke(O?.type):{icon:void 0,iconSrc:void 0};return e.createElement(wi,{ref:h,title:E.name||E.destinationType.displayName,icons:M?[M]:void 0,iconSrcs:A?[A]:void 0,isEdit:y,isFormDirty:f,onEdit:e=>{v("boolean"!=typeof e||e)},onSave:async e=>{if(S({withAlert:!0,alertTitle:Q.Update})){const t=e!==E.destinationType.displayName?e:"";$("name",t),i(u,{...x,name:t}),v(!1),b(!1)}},onDelete:async()=>{a(u),v(!1),b(!1),h.current?.closeDrawer()},onCancel:()=>{v(!1),b(!1),w(E)},isLastItem:1===m.length},y?e.createElement(ta,null,e.createElement(ea,{isUpdate:!0,categoryItem:O,formData:x,formErrors:C,handleFormChange:(...e)=>{b(!0),$(...e)},dynamicFields:T,setDynamicFields:(...e)=>{b(!0),I(...e)},validateForm:S,testConnection:r})):e.createElement(oa,null,E.conditions?.length?e.createElement(J,{conditions:E.conditions}):null,e.createElement(Y,{title:p.DESTINATION_DETAILS,data:E?Un(E,D):[]})))},na=d.div`
242
+ `,_a=({categories:o,updateDestination:i,deleteDestination:n,testConnection:r})=>{const{destinations:s}=U(),{selectedStreamName:c}=Ue(),{drawerType:d,drawerEntityId:u}=P(),m=l(()=>Ye(s,c),[s,c]),h=a(null),g=d!==B.Destination,[y,v]=t(!1),[f,b]=t(!1),{formData:x,formErrors:C,handleFormChange:k,resetFormData:w,validateForm:S,loadFormWithDrawerItem:$,yamlFields:D,setYamlFields:N,dynamicFields:T,setDynamicFields:I}=Ct({}),E=l(()=>{if(g)return w();const e=m?.find(e=>e.id===u);return e?($(e),N(kt(o,e))):w(),e},[g,u,m]);if(!E)return null;const O=o.flatMap(e=>e.items).find(e=>e.type===E.destinationType.type),{icon:A,iconSrc:M}=O?Ve(O?.type):{icon:void 0,iconSrc:void 0};return e.createElement(wi,{ref:h,title:E.name||E.destinationType.displayName,icons:A?[A]:void 0,iconSrcs:M?[M]:void 0,isEdit:y,isFormDirty:f,onEdit:e=>{v("boolean"!=typeof e||e)},onSave:async e=>{if(S({withAlert:!0,alertTitle:Q.Update})){const t=e!==E.destinationType.displayName?e:"";k("name",t),i(u,{...x,name:t}),v(!1),b(!1)}},onDelete:async()=>{n(u),v(!1),b(!1),h.current?.closeDrawer()},onCancel:()=>{v(!1),b(!1),$(E)},isLastItem:1===m.length},y?e.createElement(Ua,null,e.createElement(Ha,{isUpdate:!0,categoryItem:O,formData:x,formErrors:C,handleFormChange:(...e)=>{b(!0),k(...e)},dynamicFields:T,setDynamicFields:(...e)=>{b(!0),I(...e)},validateForm:S,testConnection:r})):e.createElement(Wa,null,E.conditions?.length?e.createElement(J,{conditions:E.conditions}):null,e.createElement(Y,{title:p.DESTINATION_DETAILS,data:E?La(E,D):[]})))},Ga=d.div`
155
243
  display: flex;
156
244
  flex-direction: column;
157
245
  gap: 12px;
158
- `,aa=({items:t,onSelectNew:o,onSelectConfigured:i,isLoadingForDestinationIds:n})=>{const{configuredDestinationsUpdateOnly:a}=dt();return t.map(t=>{const l=t.name===Dt.EXISTS.TITLE;return e.createElement(na,{key:`category-${t.name}`},e.createElement(O,{size:"small",icon:t.icon,title:St(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}=Ke(r.type),p=r.selected||a.some(e=>e.id===r.id),m=!!n.find(e=>e===r.id),h=l?()=>i(r.id):()=>o(r);return e.createElement(wt,{key:s,"data-id":s,title:r.displayName,hoverText:K.SELECT,onClick:h,iconProps:{icon:d,iconSrc:u},visualProps:{monitors:c,monitorsWithLabels:!0},checkboxProps:{withCheckbox:l,isChecked:p,isLoading:m,onCheckboxChange:()=>i(r.id)}})}))})},la=d.div`
246
+ `,Ja=({items:t,onSelectNew:o,onSelectConfigured:i,isLoadingForDestinationIds:a})=>{const{configuredDestinationsUpdateOnly:n}=dt();return t.map(t=>{const l=t.name===St.EXISTS.TITLE;return e.createElement(Ga,{key:`category-${t.name}`},e.createElement(O,{size:"small",icon:t.icon,title:wt(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}=Ve(r.type),p=r.selected||n.some(e=>e.id===r.id),m=!!a.find(e=>e===r.id),h=l?()=>i(r.id):()=>o(r);return e.createElement(Fe,{key:s,"data-id":s,title:r.displayName,hoverText:K.SELECT,onClick:h,iconProps:{icon:d,iconSrc:u},visualProps:{monitors:c,monitorsWithLabels:!0},checkboxProps:{withCheckbox:l,isChecked:p,isLoading:m,onCheckboxChange:()=>i(r.id)}})}))})},Ya=d.div`
159
247
  display: flex;
160
248
  flex-direction: column;
161
249
  gap: 24px;
162
- `,ra=d.div`
250
+ `,Qa=d.div`
163
251
  display: flex;
164
252
  align-items: center;
165
253
  gap: 12px;
166
- `,sa=d.div`
254
+ `,Xa=d.div`
167
255
  width: 170px;
168
256
  margin-right: 8px;
169
- `,ca=d.div`
257
+ `,Za=d.div`
170
258
  display: flex;
171
259
  flex-direction: column;
172
260
  align-self: stretch;
@@ -177,18 +265,18 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
177
265
  @media (height < 800px) {
178
266
  max-height: calc(100vh - 400px);
179
267
  }
180
- `,da=d(la)`
268
+ `,en=d(Ya)`
181
269
  margin-top: 80px;
182
- `,{MANAGED:ua,SELF_HOSTED:pa,DETECTED:ma,EXISTS:ha}=Dt,ga=[{value:"All types",id:"all"},{value:ua.TITLE,id:ua.TITLE},{value:pa.TITLE,id:pa.TITLE},{value:ma.TITLE,id:ma.TITLE},{value:ha.TITLE,id:ha.TITLE}],ya=ga[0],va=[Ct.Logs,Ct.Metrics,Ct.Traces],fa=(e,t,o)=>e.map(e=>{const{type:i,displayName:n}=e.destinationType,a=e.dataStreamNames?.includes(t),l=o.has(e.id);return{id:e.id,type:i,displayName:n,selected:a||l,fields:[],testConnectionSupported:!1,supportedSignals:{[Ct.Logs]:{supported:e.exportedSignals.logs},[Ct.Metrics]:{supported:e.exportedSignals.metrics},[Ct.Traces]:{supported:e.exportedSignals.traces}}}}),ba=({hidden:o,categories:i,potentialDestinations:n,onSelectNew:a,onSelectConfigured:r,isLoadingForDestinationIds:s})=>{const{destinations:c}=B(),{selectedStreamName:d}=ze(),{configuredDestinations:u,configuredDestinationsUpdateOnly:p}=dt(),[m,h]=t(""),[g,y]=t(ya),[v,f]=t(va),b=l(()=>{const e=Nt(i);return e.unshift({name:ha.TITLE,description:ha.DESCRIPTION,icon:Mo,items:fa(c,d,new Set(u.concat(p).map(e=>e.id)))}),e.unshift({name:ma.TITLE,description:ma.DESCRIPTION,icon:Ao,items:n}),e.map(e=>{const t=e.items.filter(t=>{const o=!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 o&&i&&n});return{...e,items:t}}).filter(({items:e})=>!!e.length)},[i,n,c,m,g,v,d,u,p]);return o?null:e.createElement(la,null,e.createElement(O,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e.createElement(ra,null,e.createElement(sa,null,e.createElement(x,{placeholder:"Search...",icon:Io,value:m,onChange:({target:{value:e}})=>h(e)})),e.createElement(sa,null,e.createElement(it,{options:ga,value:g,onSelect:y,onDeselect:()=>{}})),e.createElement(A,{title:"",selectedSignals:v,setSelectedSignals:f})),e.createElement(le,null),b.length?e.createElement(ca,null,e.createElement(aa,{items:b,onSelectNew:e=>a(e,v),onSelectConfigured:r,isLoadingForDestinationIds:s})):e.createElement(da,null,e.createElement(De,{title:"No destinations found"})))},xa=d.div`
270
+ `,{MANAGED:tn,SELF_HOSTED:on,DETECTED:an,EXISTS:nn}=St,ln=[{value:"All types",id:"all"},{value:tn.TITLE,id:tn.TITLE},{value:on.TITLE,id:on.TITLE},{value:an.TITLE,id:an.TITLE},{value:nn.TITLE,id:nn.TITLE}],rn=ln[0],sn=[xt.Logs,xt.Metrics,xt.Traces],cn=(e,t,o)=>e.map(e=>{const{type:i,displayName:a}=e.destinationType,n=e.dataStreamNames?.includes(t),l=o.has(e.id);return{id:e.id,type:i,displayName:a,selected:n||l,fields:[],testConnectionSupported:!1,supportedSignals:{[xt.Logs]:{supported:e.exportedSignals.logs},[xt.Metrics]:{supported:e.exportedSignals.metrics},[xt.Traces]:{supported:e.exportedSignals.traces}}}}),dn=({hidden:o,categories:i,potentialDestinations:a,onSelectNew:n,onSelectConfigured:r,isLoadingForDestinationIds:s})=>{const{destinations:c}=U(),{selectedStreamName:d}=Ue(),{configuredDestinations:u,configuredDestinationsUpdateOnly:p}=dt(),[m,h]=t(""),[g,y]=t(rn),[v,f]=t(sn),b=l(()=>{const e=$t(i);return e.unshift({name:nn.TITLE,description:nn.DESCRIPTION,icon:Oo,items:cn(c,d,new Set(u.concat(p).map(e=>e.id)))}),e.unshift({name:an.TITLE,description:an.DESCRIPTION,icon:Ao,items:a}),e.map(e=>{const t=e.items.filter(t=>{const o=!m||t.displayName.toLowerCase().includes(m.toLowerCase()),i="all"===g.id||g.id===e.name,a=v.some(e=>t.supportedSignals[e.toLowerCase()]?.supported);return o&&i&&a});return{...e,items:t}}).filter(({items:e})=>!!e.length)},[i,a,c,m,g,v,d,u,p]);return o?null:e.createElement(Ya,null,e.createElement(O,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e.createElement(Qa,null,e.createElement(Xa,null,e.createElement(x,{placeholder:"Search...",icon:To,value:m,onChange:({target:{value:e}})=>h(e)})),e.createElement(Xa,null,e.createElement(at,{options:ln,value:g,onSelect:y,onDeselect:()=>{}})),e.createElement(M,{title:"",selectedSignals:v,setSelectedSignals:f})),e.createElement(le,null),b.length?e.createElement(Za,null,e.createElement(Ja,{items:b,onSelectNew:e=>n(e,v),onSelectConfigured:r,isLoadingForDestinationIds:s})):e.createElement(en,null,e.createElement(De,{title:"No destinations found"})))},un=d.div`
183
271
  display: flex;
184
- `,Ca=d.div`
272
+ `,pn=d.div`
185
273
  border-right: 1px solid ${({theme:e})=>e.colors.border};
186
274
  padding: 32px;
187
275
  width: 200px;
188
276
  @media (max-width: 1050px) {
189
277
  display: none;
190
278
  }
191
- `,$a=({isOnboarding:o,categories:i,potentialDestinations:n,createDestination:a,updateDestination:l,deleteDestination:r,testConnection:s})=>{const{destinations:c}=B(),{selectedStreamName:d}=ze(),{currentModal:u,setCurrentModal:m}=Z(),{addConfiguredDestination:h,addConfiguredDestinationUpdateOnly:g,removeConfiguredDestinationUpdateOnly:y,configuredDestinationsUpdateOnly:v}=dt(),f=u===j.Destination,[b,x]=t(void 0),{formData:C,formErrors:$,handleFormChange:k,resetFormData:S,validateForm:w,setYamlFields:D,dynamicFields:N,setDynamicFields:T,loadFormWithDrawerItem:I}=$t({supportedSignals:b?.supportedSignals,preLoadedFields:b?.fields}),[E,O]=t([]),M=e=>{const t={};return e||N.forEach(e=>t[e.name]=e.value),{id:e?.id||"",name:e?.name||C.name,disabled:e?.disabled||C.disabled,dataStreamNames:e?.dataStreamNames||[],conditions:e?.conditions||[],exportedSignals:e?.exportedSignals||C.exportedSignals,fields:e?.fields||JSON.stringify(t),destinationType:e?.destinationType||{type:b.type,displayName:b.displayName,supportedSignals:{logs:{supported:!1},metrics:{supported:!1},traces:{supported:!1}}}}},A=async e=>{if(o&&!e){const e=M();h(e)}else if(o&&e){const t=M(e);v.some(t=>t.id===e.id)?y(e):g(t)}else if(o||e){if(!o&&e){const t=M(e),o=t.dataStreamNames.some(e=>e===d);O(t=>[...t,e.id]),o?await r(e.id):await l(e.id,I(t)),O(t=>t.filter(t=>t!==e.id))}}else a(C)},F=()=>{S(),x(void 0),m("")},R=()=>{S(),x(void 0)},L=async()=>{if(b){if(!w({withAlert:!o,alertTitle:Q.Create}))return null;A()}F()};return q({key:"Enter",active:f},()=>L()),e.createElement(ee,{isOpen:f,onClose:F,header:{title:p.ADD_DESTINATION},actionComponent:e.createElement(te,{buttons:(()=>{const e=[{label:"DONE",variant:"primary",onClick:L}];return b&&e.unshift({label:"BACK",icon:Fo,variant:"secondary",onClick:R}),e})()})},e.createElement(xa,null,e.createElement(Ca,null,e.createElement(Tt,{currentStep:b?2:1,data:[{stepNumber:1,title:p.DESTINATIONS},{stepNumber:2,title:p.CONNECTION}]})),e.createElement(oe,{style:{margin:"32px 24px 12px 24px"}},e.createElement(ba,{hidden:void 0!==b,categories:i,potentialDestinations:n,onSelectNew:(e,t)=>{S(),k("type",e?.type||""),k("currentStreamName",d);const o={logs:!1,metrics:!1,traces:!1};t.filter(t=>e.supportedSignals[t].supported).forEach(e=>o[e]=!0),k("exportedSignals",o),D(e?.fields||[]),x(e)},onSelectConfigured:e=>{const t=c.find(t=>t.id===e);t&&A(t)},isLoadingForDestinationIds:E}),b&&e.createElement(ea,{categoryItem:b,formData:C,formErrors:$,handleFormChange:k,dynamicFields:N,setDynamicFields:T,validateForm:w,testConnection:s}))))},ka=d.div`
279
+ `,mn=({isOnboarding:o,categories:i,potentialDestinations:a,createDestination:n,updateDestination:l,deleteDestination:r,testConnection:s})=>{const{destinations:c}=U(),{selectedStreamName:d}=Ue(),{currentModal:u,setCurrentModal:m}=Z(),{addConfiguredDestination:h,addConfiguredDestinationUpdateOnly:g,removeConfiguredDestinationUpdateOnly:y,configuredDestinationsUpdateOnly:v}=dt(),f=u===B.Destination,[b,x]=t(void 0),{formData:C,formErrors:k,handleFormChange:w,resetFormData:S,validateForm:$,setYamlFields:D,dynamicFields:N,setDynamicFields:T,loadFormWithDrawerItem:I}=Ct({supportedSignals:b?.supportedSignals,preLoadedFields:b?.fields}),[E,O]=t([]),A=e=>{const t={};return e||N.forEach(e=>t[e.name]=e.value),{id:e?.id||"",name:e?.name||C.name,disabled:e?.disabled||C.disabled,dataStreamNames:e?.dataStreamNames||[],conditions:e?.conditions||[],exportedSignals:e?.exportedSignals||C.exportedSignals,fields:e?.fields||JSON.stringify(t),destinationType:e?.destinationType||{type:b.type,displayName:b.displayName,supportedSignals:{logs:{supported:!1},metrics:{supported:!1},traces:{supported:!1}}}}},M=async e=>{if(o&&!e){const e=A();h(e)}else if(o&&e){const t=A(e);v.some(t=>t.id===e.id)?y(e):g(t)}else if(o||e){if(!o&&e){const t=A(e),o=t.dataStreamNames.some(e=>e===d);O(t=>[...t,e.id]),o?await r(e.id):await l(e.id,I(t)),O(t=>t.filter(t=>t!==e.id))}}else n(C)},F=()=>{S(),x(void 0),m("")},R=()=>{S(),x(void 0)},L=async()=>{if(b){if(!$({withAlert:!o,alertTitle:Q.Create}))return null;M()}F()};return q({key:"Enter",active:f},()=>L()),e.createElement(ee,{isOpen:f,onClose:F,header:{title:p.ADD_DESTINATION},actionComponent:e.createElement(te,{buttons:(()=>{const e=[{label:"DONE",variant:"primary",onClick:L}];return b&&e.unshift({label:"BACK",icon:Mo,variant:"secondary",onClick:R}),e})()})},e.createElement(un,null,e.createElement(pn,null,e.createElement(Dt,{currentStep:b?2:1,data:[{stepNumber:1,title:p.DESTINATIONS},{stepNumber:2,title:p.CONNECTION}]})),e.createElement(oe,{style:{margin:"32px 24px 12px 24px"}},e.createElement(dn,{hidden:void 0!==b,categories:i,potentialDestinations:a,onSelectNew:(e,t)=>{S(),w("type",e?.type||""),w("currentStreamName",d);const o={logs:!1,metrics:!1,traces:!1};t.filter(t=>e.supportedSignals[t].supported).forEach(e=>o[e]=!0),w("exportedSignals",o),D(e?.fields||[]),x(e)},onSelectConfigured:e=>{const t=c.find(t=>t.id===e);t&&M(t)},isLoadingForDestinationIds:E}),b&&e.createElement(Ha,{categoryItem:b,formData:C,formErrors:k,handleFormChange:w,dynamicFields:N,setDynamicFields:T,validateForm:$,testConnection:s}))))},hn=d.div`
192
280
  display: flex;
193
281
  flex-direction: column;
194
282
  align-items: center;
@@ -197,7 +285,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
197
285
  max-height: calc(100vh - 310px);
198
286
  height: fit-content;
199
287
  overflow-y: scroll;
200
- `,Sa=({categories:t,withDelete:o})=>{const{configuredDestinations:i,configuredDestinationsUpdateOnly:n}=dt();return i.length||n.length?e.createElement(ka,null,i.concat(n).map((a,l)=>e.createElement(wa,{key:`configured-destination-${a.destinationType.type}-${l}`,"data-id":`configured-destination-${a.destinationType.type}`,item:a,yamlFields:kt(t,a),isLastItem:i.length+n.length===1,withDelete:o}))):e.createElement(we,null,e.createElement(De,{title:"No destinations",subTitle:"Please add a destination"}))},wa=({item:o,yamlFields:i,isLastItem:n,withDelete:a})=>{const[r,s]=t(!1),{icon:c,iconSrc:d}=Ke(o.destinationType.type),{removeConfiguredDestination:u,removeConfiguredDestinationUpdateOnly:p}=dt(),m=l(()=>vt(o,i).map(e=>({title:e.name,value:e.value})),[o,i]);return e.createElement(e.Fragment,null,e.createElement(wt,{title:o.name||o.destinationType.displayName,subTitle:o.destinationType.type,iconProps:{icon:c,iconSrc:d},visualProps:{monitors:qe(o.exportedSignals),monitorsWithLabels:!0},extendableProps:{withExtend:!0,renderExtended:()=>e.createElement(It,{data:m})},renderActions:a?()=>e.createElement(pt,{onClick:()=>s(!0)},e.createElement(No,null)):void 0}),a&&e.createElement(z,{isOpen:r,name:o.destinationType.displayName||o.name,type:j.Destination,isLastItem:n,onApprove:()=>{o.id?p(o):u(o)},onDeny:()=>s(!1)}))},Da=d(lt)`
288
+ `,gn=({categories:t,withDelete:o})=>{const{configuredDestinations:i,configuredDestinationsUpdateOnly:a}=dt();return i.length||a.length?e.createElement(hn,null,i.concat(a).map((n,l)=>e.createElement(yn,{key:`configured-destination-${n.destinationType.type}-${l}`,"data-id":`configured-destination-${n.destinationType.type}`,item:n,yamlFields:kt(t,n),isLastItem:i.length+a.length===1,withDelete:o}))):e.createElement($e,null,e.createElement(De,{title:"No destinations",subTitle:"Please add a destination"}))},yn=({item:o,yamlFields:i,isLastItem:a,withDelete:n})=>{const[r,s]=t(!1),{icon:c,iconSrc:d}=Ve(o.destinationType.type),{removeConfiguredDestination:u,removeConfiguredDestinationUpdateOnly:p}=dt(),m=l(()=>vt(o,i).map(e=>({title:e.name,value:e.value})),[o,i]);return e.createElement(e.Fragment,null,e.createElement(Fe,{title:o.name||o.destinationType.displayName,subTitle:o.destinationType.type,iconProps:{icon:c,iconSrc:d},visualProps:{monitors:Pe(o.exportedSignals),monitorsWithLabels:!0},extendableProps:{withExtend:!0,renderExtended:()=>e.createElement(Nt,{data:m})},renderActions:n?()=>e.createElement(pt,{onClick:()=>s(!0)},e.createElement($o,null)):void 0}),n&&e.createElement(V,{isOpen:r,name:o.destinationType.displayName||o.name,type:B.Destination,isLastItem:a,onApprove:()=>{o.id?p(o):u(o)},onDeny:()=>s(!1)}))},vn=d(Oe)`
201
289
  display: flex;
202
290
  align-items: center;
203
291
  justify-content: center;
@@ -206,7 +294,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
206
294
  padding: 32px;
207
295
  border-radius: 16px;
208
296
  border-style: dashed !important;
209
- `,Na=({isSourcesListEmpty:t,goToSources:o,categories:i,potentialDestinations:n,testConnection:a,onClickSummary:l})=>{const r=I.useTheme(),{setCurrentModal:s}=Z(),{configuredDestinations:c,configuredDestinationsUpdateOnly:d}=dt();return e.createElement(e.Fragment,null,e.createElement(oe,{$isNotModal:!0},e.createElement(X,{$gap:12},e.createElement(X,{$gap:24},l&&e.createElement(gt,{onClick:l}),e.createElement(O,{title:p.ADD_DESTINATIONS,badgeLabel:c.length+d.length,description:p.ADD_DESTINATION_DESCRIPTION}),t&&e.createElement(ie,{type:V.Warning,message:p.NO_SOURCES_GO_BACK,action:{label:p.SELECT_SOURCES,onClick:o}}),e.createElement(Da,{variant:"secondary",onClick:()=>s(j.Destination)},e.createElement(Ro,null),e.createElement(T,{color:r.colors.secondary,size:14,decoration:"underline",family:"secondary"},p.ADD_DESTINATION))),e.createElement(Sa,{categories:i,withDelete:!0}))),e.createElement($a,{isOnboarding:!0,categories:i,potentialDestinations:n,updateDestination:async()=>{},createDestination:async()=>{},deleteDestination:async()=>{},testConnection:a}))},Ta=[{key:"icon",title:""},{key:"name",title:p.NAME,sortable:!0},{key:"type",title:p.TYPE,sortable:!0},{key:"signals",title:p.MONITORS},{key:"active-status",title:p.STATUS},{key:"conditions",title:"Conditions"},{key:"throughput",title:"Throughput",sortable:!0}],Ia=({metrics:t,maxHeight:o,maxWidth:i})=>{const n=I.useTheme(),a=he(),{selectedStreamName:r}=ze(),{setDrawerType:s,setDrawerEntityId:c}=P(),{destinations:d,destinationsLoading:u}=B(),m=l(()=>Ue(d,r),[d,r]),h=l(()=>Ri({instrumentationRules:[],sources:[],actions:[],destinations:_e(m,a),searchText:a.searchText,selectedCategory:j.Destination}).searchResults.find(({category:e})=>e===j.Destination)?.entities||[],[m,a]),g=l(()=>h.map(o=>{const{hasErrors:i,hasWarnings:a,hasDisableds:l}=re(o.conditions||[]),{icon:r,iconSrc:d}=Ke(o.destinationType.type);return{status:i?V.Error:a?V.Warning:void 0,faded:l,onClick:()=>{s(j.Destination),c(o.id)},cells:[{columnKey:"icon",component:()=>e.createElement(ye,{icon:r,src:d})},{columnKey:"name",value:ve(o,j.Destination,{prioritizeDisplayName:!0})},{columnKey:"type",value:o.destinationType.type,textColor:n.text.info},{columnKey:"throughput",value:Oe(Et(t,j.Destination,o.id).throughput),textColor:n.text.info},{columnKey:"signals",component:()=>e.createElement(fe,{withLabels:!0,monitors:qe(o.exportedSignals)})},{columnKey:"conditions",component:()=>o.conditions?.length?e.createElement(Ai,{conditions:o.conditions,id:o.id}):null},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:o.disabled?V.Error:V.Success,title:o.disabled?p.DISABLED:p.ENABLED,withIcon:!0,withBorder:!0}))}]}}),[h,t]),{badge:y,badgeTooltip:v}=l(()=>h.length!==m.length?{badge:`${h.length}/${m.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:m.length,badgeTooltip:void 0},[h,m]);return e.createElement(be,{$maxWidth:i},e.createElement(xe,null,e.createElement(Ce,{icon:$e(j.Destination),title:p.DESTINATIONS,badge:y,badgeTooltip:v,loading:u})),e.createElement(ke,{$maxHeight:o},e.createElement(Se,{columns:Ta,rows:g})),!h.length&&e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(De,null)))},Ea=e=>{const{type:t,ruleName:o,notes:i,disabled:n,profileName:a,payloadCollection:l,codeAttributes:r,headersCollection:s,customInstrumentations:c}=e,d=[{title:p.TYPE,value:t},{type:m.ActiveStatus,title:p.STATUS,value:String(!n)},{title:p.NAME,value:o},{title:p.NOTES,value:i},{title:p.MANAGED_BY_PROFILE,value:a},{type:m.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[Ot.HeaderKeys]||[]).filter(e=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(c){const e=(c[At.Java]||[]).map(e=>new Mt(e.className,e.methodName)).map(e=>`• ${e.toString()}`).join("\r\n");e&&d.push({title:p.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:p.GOLANG_CUSTOM_PROBES,value:t})}return d},Oa=d.div`
297
+ `,fn=({isSourcesListEmpty:t,goToSources:o,categories:i,potentialDestinations:a,testConnection:n,onClickSummary:l})=>{const r=I.useTheme(),{setCurrentModal:s}=Z(),{configuredDestinations:c,configuredDestinationsUpdateOnly:d}=dt();return e.createElement(e.Fragment,null,e.createElement(oe,{$isNotModal:!0},e.createElement(X,{$gap:12},e.createElement(X,{$gap:24},l&&e.createElement(gt,{onClick:l}),e.createElement(O,{title:p.ADD_DESTINATIONS,badgeLabel:c.length+d.length,description:p.ADD_DESTINATION_DESCRIPTION}),t&&e.createElement(ie,{type:H.Warning,message:p.NO_SOURCES_GO_BACK,action:{label:p.SELECT_SOURCES,onClick:o}}),e.createElement(vn,{variant:"secondary",onClick:()=>s(B.Destination)},e.createElement(No,null),e.createElement(T,{color:r.colors.secondary,size:14,decoration:"underline",family:"secondary"},p.ADD_DESTINATION))),e.createElement(gn,{categories:i,withDelete:!0}))),e.createElement(mn,{isOnboarding:!0,categories:i,potentialDestinations:a,updateDestination:async()=>{},createDestination:async()=>{},deleteDestination:async()=>{},testConnection:n}))},bn=[{key:"icon",title:""},{key:"name",title:p.NAME,sortable:!0},{key:"type",title:p.TYPE,sortable:!0},{key:"signals",title:p.MONITORS},{key:"active-status",title:p.STATUS},{key:"conditions",title:"Conditions"},{key:"throughput",title:"Throughput",sortable:!0}],xn=({metrics:t,maxHeight:o,maxWidth:i})=>{const a=I.useTheme(),n=he(),{selectedStreamName:r}=Ue(),{setDrawerType:s,setDrawerEntityId:c}=P(),{destinations:d,destinationsLoading:u}=U(),m=l(()=>Ye(d,r),[d,r]),h=l(()=>Mi({instrumentationRules:[],sources:[],actions:[],destinations:Je(m,n),searchText:n.searchText,selectedCategory:B.Destination}).searchResults.find(({category:e})=>e===B.Destination)?.entities||[],[m,n]),g=l(()=>h.map(o=>{const{hasErrors:i,hasWarnings:n,hasDisableds:l}=re(o.conditions||[]),{icon:r,iconSrc:d}=Ve(o.destinationType.type);return{status:i?H.Error:n?H.Warning:void 0,faded:l,onClick:()=>{s(B.Destination),c(o.id)},cells:[{columnKey:"icon",component:()=>e.createElement(ye,{icon:r,src:d})},{columnKey:"name",value:ve(o,B.Destination,{prioritizeDisplayName:!0})},{columnKey:"type",value:o.destinationType.type,textColor:a.text.info},{columnKey:"throughput",value:qe(Tt(t,B.Destination,o.id).throughput),textColor:a.text.info},{columnKey:"signals",component:()=>e.createElement(fe,{withLabels:!0,monitors:Pe(o.exportedSignals)})},{columnKey:"conditions",component:()=>o.conditions?.length?e.createElement(Oi,{conditions:o.conditions,id:o.id}):null},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:o.disabled?H.Error:H.Success,title:o.disabled?p.DISABLED:p.ENABLED,withIcon:!0,withBorder:!0}))}]}}),[h,t]),{badge:y,badgeTooltip:v}=l(()=>h.length!==m.length?{badge:`${h.length}/${m.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:m.length,badgeTooltip:void 0},[h,m]);return e.createElement(be,{$maxWidth:i},e.createElement(xe,null,e.createElement(Ce,{icon:ke(B.Destination),title:p.DESTINATIONS,badge:y,badgeTooltip:v,loading:u})),e.createElement(we,{$maxHeight:o},e.createElement(Se,{columns:bn,rows:g})),!h.length&&e.createElement($e,{style:{marginTop:"2rem"}},e.createElement(De,null)))},Cn=e=>{const{type:t,ruleName:o,notes:i,disabled:a,profileName:n,payloadCollection:l,codeAttributes:r,headersCollection:s,customInstrumentations:c}=e,d=[{title:p.TYPE,value:t},{type:m.ActiveStatus,title:p.STATUS,value:String(!a)},{title:p.NAME,value:o},{title:p.NOTES,value:i},{title:p.MANAGED_BY_PROFILE,value:n},{type:m.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[It.HeaderKeys]||[]).filter(e=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(c){const e=(c[Ot.Java]||[]).map(e=>new Et(e.className,e.methodName)).map(e=>`• ${e.toString()}`).join("\r\n");e&&d.push({title:p.JAVA_CUSTOM_PROBES,value:e});const t=(c[Ot.Golang]||[]).map(e=>new At(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)).map(e=>`• ${e.toString()}`).join("\r\n");t&&d.push({title:p.GOLANG_CUSTOM_PROBES,value:t})}return d},kn=d.div`
210
298
  display: flex;
211
299
  flex-direction: column;
212
300
  gap: 12px;
@@ -216,7 +304,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
216
304
  border-radius: 16px;
217
305
  padding: 8px;
218
306
  `}
219
- `,Ma=[{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."}],Aa=[{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."}],Fa={[At.Java]:[new Mt("","")],[At.Golang]:[new Ft("")]},Ra=["*"],La=d.div`
307
+ `,wn=[{id:Mt.FilePath,label:"Collect File Path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Mt.Function,label:"Collect Function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Mt.LineNumber,label:"Collect Line Number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Sn=[{id:Mt.Column,label:"Collect Column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Mt.Namespace,label:"Collect Namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Mt.StackTrace,label:"Collect Stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],$n={[Ot.Java]:[new Et("","")],[Ot.Golang]:[new At("")]},Dn=["*"],Nn=d.div`
220
308
  display: flex;
221
309
  flex-direction: column;
222
310
  gap: 12px;
@@ -226,27 +314,27 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
226
314
  border-radius: 16px;
227
315
  padding: 8px;
228
316
  `}
229
- `,Pa=[{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"}],qa={[Pt.CodeAttributes]:({value:i,setValue:n,formErrors:a})=>{const r=a.codeAttributes,s=l(()=>Object.entries(i.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]),[c,d]=t(1===s.length);o(()=>{if(!s.length){const e={[Rt.Column]:null,[Rt.FilePath]:!0,[Rt.Function]:!0,[Rt.LineNumber]:!0,[Rt.Namespace]:null,[Rt.StackTrace]:null};n("codeAttributes",e),d(!1)}},[]);const u=(e,t)=>{const o=t?[...s,e]:s.filter(t=>t!==e),i=Object.values(Rt).reduce((e,t)=>(e[t]=!!o.includes(t)||null,e),{});n("codeAttributes",i),d(1===o.length)};return e.createElement(e.Fragment,null,e.createElement("div",null,e.createElement(y,{title:"Recommended data to collect",required:!0}),e.createElement(Oa,{$hasError:!!r},Ma.map(({id:t,label:o,tooltip:i})=>e.createElement(ue,{key:t,text:i,withIcon:!0},e.createElement(v,{title:o,disabled:c&&s.includes(t),value:s.includes(t),onChange:e=>u(t,e)})))),!!r&&e.createElement(f,null,r)),e.createElement("div",null,e.createElement(y,{title:"Verbose data to collect",required:!0}),e.createElement(Oa,{$hasError:!!r},Aa.map(({id:t,label:o,tooltip:i})=>e.createElement(ue,{key:t,text:i,withIcon:!0},e.createElement(v,{title:o,disabled:c&&s.includes(t),value:s.includes(t),onChange:e=>u(t,e)})))),!!r&&e.createElement(f,null,r)))},[Pt.CustomInstrumentation]:({value:t,setValue:i,formErrors:n})=>{const a=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 o={};switch(t){case"java":o[At.Java]=e.map(e=>new Mt(e.className,e.methodName)),o[At.Golang]=s.map(e=>new Ft(e.packageName,e.functionName,e.receiverName,e.receiverMethodName));break;case"golang":o[At.Golang]=e.map(e=>new Ft(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),o[At.Java]=r.map(({key:e,value:t})=>new Mt(e,t))}i("customInstrumentations",o)};return o(()=>{t?.customInstrumentations||i("customInstrumentations",{[At.Golang]:Fa[At.Golang],[At.Java]:Fa[At.Java]})},[i,t]),e.createElement("div",null,e.createElement(k,{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:a,limitFieldsPerRow:2}),e.createElement(w,{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:a,keyPlaceholder:"Class name",valuePlaceholder:"Method name"}))},[Pt.HeadersCollection]:({value:t,setValue:i,formErrors:n})=>{const a=n.headersCollection,r=l(()=>t?.headersCollection?.[Ot.HeaderKeys]||[],[t]),s=e=>{const t={[Ot.HeaderKeys]:e};i("headersCollection",t)};return o(()=>{r.length||s(Ra)},[r]),e.createElement("div",null,r.length>0&&e.createElement(D,{title:"Header Keys",tooltip:"Specify which headers you want to collect, asterisk (*) will collect all headers.",value:r,onChange:e=>s(e),errorMessage:a}))},[Pt.PayloadCollection]:({value:i,setValue:n,formErrors:a})=>{const r=a.payloadCollection,s=l(()=>Object.entries(i.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]),[c,d]=t(1===s.length);return o(()=>{if(!s.length){const e={[Lt.HttpRequest]:{},[Lt.HttpResponse]:{},[Lt.DbQuery]:{},[Lt.Messaging]:{}};n("payloadCollection",e),d(!1)}},[]),e.createElement("div",null,e.createElement(y,{title:"Type of data to collect",required:!0}),e.createElement(La,{$hasError:!!r},Pa.map(({id:t,label:o})=>e.createElement(v,{key:t,title:o,disabled:c&&s.includes(t),value:s.includes(t),onChange:e=>((e,t)=>{const o=t?[...s,e]:s.filter(t=>t!==e),i={[Lt.HttpRequest]:o.includes(Lt.HttpRequest)?{}:null,[Lt.HttpResponse]:o.includes(Lt.HttpResponse)?{}:null,[Lt.DbQuery]:o.includes(Lt.DbQuery)?{}:null,[Lt.Messaging]:o.includes(Lt.Messaging)?{}:null};n("payloadCollection",i),d(1===o.length)})(t,e)}))),!!r&&e.createElement(f,null,r))},[Pt.UnknownType]:null},Ka=({ruleType:t,value:o,setValue:i,formErrors:n})=>{if(!t)return null;const a=qa[t];return a?e.createElement(a,{value:o,setValue:i,formErrors:n}):null},Ha=d.div`
317
+ `,Tn=[{id:Ft.HttpRequest,label:"Collect HTTP Request"},{id:Ft.HttpResponse,label:"Collect HTTP Response"},{id:Ft.DbQuery,label:"Collect DB Query"},{id:Ft.Messaging,label:"Collect Messaging"}],In={[Rt.CodeAttributes]:({value:i,setValue:a,formErrors:n})=>{const r=n.codeAttributes,s=l(()=>Object.entries(i.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]),[c,d]=t(1===s.length);o(()=>{if(!s.length){const e={[Mt.Column]:null,[Mt.FilePath]:!0,[Mt.Function]:!0,[Mt.LineNumber]:!0,[Mt.Namespace]:null,[Mt.StackTrace]:null};a("codeAttributes",e),d(!1)}},[]);const u=(e,t)=>{const o=t?[...s,e]:s.filter(t=>t!==e),i=Object.values(Mt).reduce((e,t)=>(e[t]=!!o.includes(t)||null,e),{});a("codeAttributes",i),d(1===o.length)};return e.createElement(e.Fragment,null,e.createElement("div",null,e.createElement(y,{title:"Recommended data to collect",required:!0}),e.createElement(kn,{$hasError:!!r},wn.map(({id:t,label:o,tooltip:i})=>e.createElement(ue,{key:t,text:i,withIcon:!0},e.createElement(v,{title:o,disabled:c&&s.includes(t),value:s.includes(t),onChange:e=>u(t,e)})))),!!r&&e.createElement(f,null,r)),e.createElement("div",null,e.createElement(y,{title:"Verbose data to collect",required:!0}),e.createElement(kn,{$hasError:!!r},Sn.map(({id:t,label:o,tooltip:i})=>e.createElement(ue,{key:t,text:i,withIcon:!0},e.createElement(v,{title:o,disabled:c&&s.includes(t),value:s.includes(t),onChange:e=>u(t,e)})))),!!r&&e.createElement(f,null,r)))},[Rt.CustomInstrumentation]:({value:t,setValue:i,formErrors:a})=>{const n=a.customInstrumentations,r=l(()=>(t?.customInstrumentations?.[Ot.Java]||[]).map(e=>({key:e.className,value:e.methodName})),[t]),s=l(()=>(t?.customInstrumentations?.[Ot.Golang]||[]).map(e=>new At(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[t]),c=(e,t)=>{const o={};switch(t){case"java":o[Ot.Java]=e.map(e=>new Et(e.className,e.methodName)),o[Ot.Golang]=s.map(e=>new At(e.packageName,e.functionName,e.receiverName,e.receiverMethodName));break;case"golang":o[Ot.Golang]=e.map(e=>new At(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),o[Ot.Java]=r.map(({key:e,value:t})=>new Et(e,t))}i("customInstrumentations",o)};return o(()=>{t?.customInstrumentations||i("customInstrumentations",{[Ot.Golang]:$n[Ot.Golang],[Ot.Java]:$n[Ot.Java]})},[i,t]),e.createElement("div",null,e.createElement(w,{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:n,limitFieldsPerRow:2}),e.createElement($,{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:n,keyPlaceholder:"Class name",valuePlaceholder:"Method name"}))},[Rt.HeadersCollection]:({value:t,setValue:i,formErrors:a})=>{const n=a.headersCollection,r=l(()=>t?.headersCollection?.[It.HeaderKeys]||[],[t]),s=e=>{const t={[It.HeaderKeys]:e};i("headersCollection",t)};return o(()=>{r.length||s(Dn)},[r]),e.createElement("div",null,r.length>0&&e.createElement(D,{title:"Header Keys",tooltip:"Specify which headers you want to collect, asterisk (*) will collect all headers.",value:r,onChange:e=>s(e),errorMessage:n}))},[Rt.PayloadCollection]:({value:i,setValue:a,formErrors:n})=>{const r=n.payloadCollection,s=l(()=>Object.entries(i.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]),[c,d]=t(1===s.length);return o(()=>{if(!s.length){const e={[Ft.HttpRequest]:{},[Ft.HttpResponse]:{},[Ft.DbQuery]:{},[Ft.Messaging]:{}};a("payloadCollection",e),d(!1)}},[]),e.createElement("div",null,e.createElement(y,{title:"Type of data to collect",required:!0}),e.createElement(Nn,{$hasError:!!r},Tn.map(({id:t,label:o})=>e.createElement(v,{key:t,title:o,disabled:c&&s.includes(t),value:s.includes(t),onChange:e=>((e,t)=>{const o=t?[...s,e]:s.filter(t=>t!==e),i={[Ft.HttpRequest]:o.includes(Ft.HttpRequest)?{}:null,[Ft.HttpResponse]:o.includes(Ft.HttpResponse)?{}:null,[Ft.DbQuery]:o.includes(Ft.DbQuery)?{}:null,[Ft.Messaging]:o.includes(Ft.Messaging)?{}:null};a("payloadCollection",i),d(1===o.length)})(t,e)}))),!!r&&e.createElement(f,null,r))},[Rt.UnknownType]:null},En=({ruleType:t,value:o,setValue:i,formErrors:a})=>{if(!t)return null;const n=In[t];return n?e.createElement(n,{value:o,setValue:i,formErrors:a}):null},On=d.div`
230
318
  display: flex;
231
319
  flex-direction: column;
232
320
  gap: 24px;
233
321
  padding: 4px;
234
- `,za=d(T)`
322
+ `,An=d(T)`
235
323
  margin-bottom: 12px;
236
- `,Wa=({isUpdate:t,rule:o,formData:i,formErrors:n,handleFormChange:a})=>{const l=I.useTheme();return e.createElement(Ha,null,e.createElement(ce,null,o.supportedLanguages.map(t=>e.createElement(qt,{key:t,icon:Kt(t),type:V.Info},nt[t]))),t?e.createElement("div",null,e.createElement(za,null,"Status"),e.createElement(E,{options:[{icon:So,label:p.ENABLED,value:!1,selectedBgColor:l.text.success+I.opacity.hex["050"]},{icon:wo,label:p.DISABLED,value:!0,selectedBgColor:l.text.error+I.opacity.hex["050"]}],selected:i.disabled,setSelected:e=>a("disabled",e)})):e.createElement(e.Fragment,null,e.createElement(O,{title:"",description:o.docsDescription,actionButton:e.createElement(M,{endpoint:o.docsEndpoint})}),e.createElement(x,{title:"Rule name",placeholder:"Use a name that describes the rule",value:i.ruleName,onChange:({target:{value:e}})=>a("ruleName",e),errorMessage:n.ruleName})),e.createElement(Ka,{ruleType:o.type,value:i,setValue:(e,t)=>a(e,t),formErrors:n}),e.createElement(F,{title:"Notes",value:i.notes,onChange:({target:{value:e}})=>a("notes",e),errorMessage:n.notes}))},ja=d.div`
324
+ `,Mn=({isUpdate:t,rule:o,formData:i,formErrors:a,handleFormChange:n})=>{const l=I.useTheme();return e.createElement(On,null,e.createElement(ce,null,o.supportedLanguages.map(t=>e.createElement(Lt,{key:t,icon:Pt(t),type:H.Info},nt[t]))),t?e.createElement("div",null,e.createElement(An,null,"Status"),e.createElement(E,{options:[{icon:ko,label:p.ENABLED,value:!1,selectedBgColor:l.text.success+I.opacity.hex["050"]},{icon:wo,label:p.DISABLED,value:!0,selectedBgColor:l.text.error+I.opacity.hex["050"]}],selected:i.disabled,setSelected:e=>n("disabled",e)})):e.createElement(e.Fragment,null,e.createElement(O,{title:"",description:o.docsDescription,actionButton:e.createElement(A,{endpoint:o.docsEndpoint})}),e.createElement(x,{title:"Rule name",placeholder:"Use a name that describes the rule",value:i.ruleName,onChange:({target:{value:e}})=>n("ruleName",e),errorMessage:a.ruleName})),e.createElement(En,{ruleType:o.type,value:i,setValue:(e,t)=>n(e,t),formErrors:a}),e.createElement(F,{title:"Notes",value:i.notes,onChange:({target:{value:e}})=>n("notes",e),errorMessage:a.notes}))},Fn=d.div`
237
325
  width: 100%;
238
326
  height: 100%;
239
327
  max-height: calc(100vh - 220px);
240
328
  overflow: overlay;
241
329
  overflow-y: auto;
242
- `,Va=d.div`
330
+ `,Rn=d.div`
243
331
  display: flex;
244
332
  flex-direction: column;
245
333
  gap: 12px;
246
- `,Ba=({updateInstrumentationRule:o,deleteInstrumentationRule:i})=>{const{instrumentationRules:a}=B(),{addNotification:r}=L(),{drawerType:s,drawerEntityId:c}=P(),d=n(null),u=s!==j.InstrumentationRule,[p,m]=t(!1),[h,g]=t(!1),{formData:y,formErrors:v,handleFormChange:f,resetFormData:b,validateForm:x,loadFormWithDrawerItem:C}=Ht(),$=l(()=>{if(u)return b();const e=a?.find(e=>e.ruleId===c);return e?C(e):b(),e},[u,c,a]);if(!$)return null;const k=zt.find(({type:e})=>e===$.type);return e.createElement(wi,{ref:d,title:$.ruleName||$.type,icons:[Re($.type)],isEdit:p,isFormDirty:h,onEdit:e=>{$.mutable||!e&&void 0!==e?m("boolean"!=typeof e||e):r({type:V.Warning,title:ne.FORBIDDEN,message:ne.CANNOT_EDIT_RULE,crdType:j.InstrumentationRule,target:c,hideFromHistory:!0})},onSave:e=>{if(x()){const t=e!==$.type?e:"";f("ruleName",t),o(c,{...y,ruleName:t}),m(!1),g(!1)}},onDelete:()=>{$.mutable?(i(c),m(!1),g(!1),d.current?.closeDrawer()):r({type:V.Warning,title:ne.FORBIDDEN,message:ne.CANNOT_DELETE_RULE,crdType:j.InstrumentationRule,target:c,hideFromHistory:!0})},onCancel:()=>{m(!1),g(!1),C($)}},p&&k?e.createElement(ja,null,e.createElement(Wa,{isUpdate:!0,rule:k,formData:y,formErrors:v,handleFormChange:(...e)=>{g(!0),f(...e)}})):e.createElement(Va,null,e.createElement(J,{conditions:$.conditions||[]}),e.createElement(Y,{title:"Instrumentation Rule Details",data:$?Ea($):[]})))},Ua=d(X)`
334
+ `,Ln=({updateInstrumentationRule:o,deleteInstrumentationRule:i})=>{const{instrumentationRules:n}=U(),{addNotification:r}=L(),{drawerType:s,drawerEntityId:c}=P(),d=a(null),u=s!==B.InstrumentationRule,[p,m]=t(!1),[h,g]=t(!1),{formData:y,formErrors:v,handleFormChange:f,resetFormData:b,validateForm:x,loadFormWithDrawerItem:C}=qt(),k=l(()=>{if(u)return b();const e=n?.find(e=>e.ruleId===c);return e?C(e):b(),e},[u,c,n]);if(!k)return null;const w=Kt.find(({type:e})=>e===k.type);return e.createElement(wi,{ref:d,title:k.ruleName||k.type,icons:[je(k.type)],isEdit:p,isFormDirty:h,onEdit:e=>{k.mutable||!e&&void 0!==e?m("boolean"!=typeof e||e):r({type:H.Warning,title:ae.FORBIDDEN,message:ae.CANNOT_EDIT_RULE,crdType:B.InstrumentationRule,target:c,hideFromHistory:!0})},onSave:e=>{if(x()){const t=e!==k.type?e:"";f("ruleName",t),o(c,{...y,ruleName:t}),m(!1),g(!1)}},onDelete:()=>{k.mutable?(i(c),m(!1),g(!1),d.current?.closeDrawer()):r({type:H.Warning,title:ae.FORBIDDEN,message:ae.CANNOT_DELETE_RULE,crdType:B.InstrumentationRule,target:c,hideFromHistory:!0})},onCancel:()=>{m(!1),g(!1),C(k)}},p&&w?e.createElement(Fn,null,e.createElement(Mn,{isUpdate:!0,rule:w,formData:y,formErrors:v,handleFormChange:(...e)=>{g(!0),f(...e)}})):e.createElement(Rn,null,e.createElement(J,{conditions:k.conditions||[]}),e.createElement(Y,{title:"Instrumentation Rule Details",data:k?Cn(k):[]})))},Pn=d(X)`
247
335
  margin-top: 24px;
248
336
  gap: 12px;
249
- `,_a=zt,Ga=({isEnterprise:o,createInstrumentationRule:i})=>{const{currentModal:n,setCurrentModal:a}=Z(),l=n===j.InstrumentationRule,{formData:r,formErrors:s,handleFormChange:c,resetFormData:d,validateForm:u}=Ht(),[m,h]=t(void 0),g=()=>{d(),h(void 0),a("")},y=()=>{if(!u())return null;i(r),g()};return q({key:"Enter",active:l},()=>y()),e.createElement(ee,{isOpen:l,onClose:g,header:{title:"Add Instrumentation Rule"},actionComponent:e.createElement(te,{buttons:[{variant:"primary",label:"DONE",onClick:y,disabled:!o||!m,tooltip:o?"":ne.ENTERPRISE_ONLY("Instrumentation Rules")}]})},e.createElement(oe,null,e.createElement(O,{title:"Select Instrumentation Rule",description:"Define how telemetry is recorded from your application. Choose a rule type and configure the details."}),e.createElement(Ua,null,o?e.createElement(ie,{type:V.Warning,message:ne.DEFINED_FOR_ALL_STREAMS(p.INSTRUMENTATION_RULES)}):e.createElement(ie,{type:V.Default,message:ne.ENTERPRISE_ONLY(p.INSTRUMENTATION_RULES)}),e.createElement(ae,{options:_a,selectedOption:m,onOptionSelect:e=>{return t=e,d(),void h(t);var t},autoFocus:!m?.type})),m?.type?e.createElement("div",null,e.createElement(le,{margin:"16px 0"}),e.createElement(Wa,{rule:m,formData:r,formErrors:s,handleFormChange:c})):null))},Ja=e=>{const{payloadCollection:t,codeAttributes:o,customInstrumentations:i}=e;let n="";return t&&(n+=Object.entries(t).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),o&&(n+=Object.entries(o).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},Ya=[{key:"icon",title:""},{key:"name",title:p.NAME,sortable:!0},{key:"profile",title:p.MANAGED_BY_PROFILE,sortable:!0},{key:"active-status",title:p.STATUS},{key:"conditions",title:"Conditions"},{key:"source-count",title:"Applicable Source"},{key:"type",title:p.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:p.NOTES,sortable:!0}],Qa=({maxHeight:t,maxWidth:o})=>{const i=I.useTheme(),n=he(),{setDrawerType:a,setDrawerEntityId:r}=P(),{instrumentationRules:s,instrumentationRulesLoading:c}=B(),d=l(()=>Ri({instrumentationRules:s,sources:[],actions:[],destinations:[],searchText:n.searchText,selectedCategory:j.InstrumentationRule}).searchResults.find(({category:e})=>e===j.InstrumentationRule)?.entities||[],[s,n]),u=l(()=>d.map(t=>{const{hasErrors:o,hasWarnings:n,hasDisableds:l}=re(t.conditions||[]);return{status:o?V.Error:n?V.Warning:void 0,faded:l,onClick:()=>{a(j.InstrumentationRule),r(t.ruleId)},cells:[{columnKey:"icon",component:()=>e.createElement(ye,{icon:Re(t.type)})},{columnKey:"name",value:ve(t,j.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:Ja(t),textColor:i.text.info,withTooltip:!0},{columnKey:"conditions",component:()=>e.createElement(Ai,{conditions:t.conditions||[],id:t.ruleId})},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:t.disabled?V.Error:V.Success,title:t.disabled?p.DISABLED:p.ENABLED,withIcon:!0,withBorder:!0}))},{columnKey:"source-count",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:V.Info,title:"all sources",withBorder:!0}))}]}}),[d]),{badge:m,badgeTooltip:h}=l(()=>d.length!==s.length?{badge:`${d.length}/${s.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:s.length,badgeTooltip:void 0},[d,s]);return e.createElement(be,{$maxWidth:o},e.createElement(xe,null,e.createElement(Ce,{icon:$e(j.Action),title:p.INSTRUMENTATION_RULES,badge:m,badgeTooltip:h,loading:c})),e.createElement(ke,{$maxHeight:t},e.createElement(Se,{columns:Ya,rows:u})),!d.length&&e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(De,null)))},Xa=d.div`
337
+ `,qn=Kt,Kn=({isEnterprise:o,createInstrumentationRule:i})=>{const{currentModal:a,setCurrentModal:n}=Z(),l=a===B.InstrumentationRule,{formData:r,formErrors:s,handleFormChange:c,resetFormData:d,validateForm:u}=qt(),[m,h]=t(void 0),g=()=>{d(),h(void 0),n("")},y=()=>{if(!u())return null;i(r),g()};return q({key:"Enter",active:l},()=>y()),e.createElement(ee,{isOpen:l,onClose:g,header:{title:"Add Instrumentation Rule"},actionComponent:e.createElement(te,{buttons:[{variant:"primary",label:"DONE",onClick:y,disabled:!o||!m,tooltip:o?"":ae.ENTERPRISE_ONLY("Instrumentation Rules")}]})},e.createElement(oe,null,e.createElement(O,{title:"Select Instrumentation Rule",description:"Define how telemetry is recorded from your application. Choose a rule type and configure the details."}),e.createElement(Pn,null,o?e.createElement(ie,{type:H.Warning,message:ae.DEFINED_FOR_ALL_STREAMS(p.INSTRUMENTATION_RULES)}):e.createElement(ie,{type:H.Default,message:ae.ENTERPRISE_ONLY(p.INSTRUMENTATION_RULES)}),e.createElement(ne,{options:qn,selectedOption:m,onOptionSelect:e=>{return t=e,d(),void h(t);var t},autoFocus:!m?.type})),m?.type?e.createElement("div",null,e.createElement(le,{margin:"16px 0"}),e.createElement(Mn,{rule:m,formData:r,formErrors:s,handleFormChange:c})):null))},jn=e=>{const{payloadCollection:t,codeAttributes:o,customInstrumentations:i}=e;let a="";return t&&(a+=Object.entries(t).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),o&&(a+=Object.entries(o).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),i&&Object.values(Ot).forEach(e=>{const t=(i[e]||[]).filter(e=>e).join(", ");t&&(a+=a?`, ${t}`:t)}),a},Vn=[{key:"icon",title:""},{key:"name",title:p.NAME,sortable:!0},{key:"profile",title:p.MANAGED_BY_PROFILE,sortable:!0},{key:"active-status",title:p.STATUS},{key:"conditions",title:"Conditions"},{key:"source-count",title:"Applicable Source"},{key:"type",title:p.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:p.NOTES,sortable:!0}],zn=({maxHeight:t,maxWidth:o})=>{const i=I.useTheme(),a=he(),{setDrawerType:n,setDrawerEntityId:r}=P(),{instrumentationRules:s,instrumentationRulesLoading:c}=U(),d=l(()=>Mi({instrumentationRules:s,sources:[],actions:[],destinations:[],searchText:a.searchText,selectedCategory:B.InstrumentationRule}).searchResults.find(({category:e})=>e===B.InstrumentationRule)?.entities||[],[s,a]),u=l(()=>d.map(t=>{const{hasErrors:o,hasWarnings:a,hasDisableds:l}=re(t.conditions||[]);return{status:o?H.Error:a?H.Warning:void 0,faded:l,onClick:()=>{n(B.InstrumentationRule),r(t.ruleId)},cells:[{columnKey:"icon",component:()=>e.createElement(ye,{icon:je(t.type)})},{columnKey:"name",value:ve(t,B.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:jn(t),textColor:i.text.info,withTooltip:!0},{columnKey:"conditions",component:()=>e.createElement(Oi,{conditions:t.conditions||[],id:t.ruleId})},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:t.disabled?H.Error:H.Success,title:t.disabled?p.DISABLED:p.ENABLED,withIcon:!0,withBorder:!0}))},{columnKey:"source-count",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:H.Info,title:"all sources",withBorder:!0}))}]}}),[d]),{badge:m,badgeTooltip:h}=l(()=>d.length!==s.length?{badge:`${d.length}/${s.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:s.length,badgeTooltip:void 0},[d,s]);return e.createElement(be,{$maxWidth:o},e.createElement(xe,null,e.createElement(Ce,{icon:ke(B.Action),title:p.INSTRUMENTATION_RULES,badge:m,badgeTooltip:h,loading:c})),e.createElement(we,{$maxHeight:t},e.createElement(Se,{columns:Vn,rows:u})),!d.length&&e.createElement($e,{style:{marginTop:"2rem"}},e.createElement(De,null)))},Bn=d.div`
250
338
  position: fixed;
251
339
  bottom: 0;
252
340
  left: 50%;
@@ -259,17 +347,17 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
259
347
  border-radius: 32px;
260
348
  border: 1px solid ${({theme:e})=>e.colors.border};
261
349
  background-color: ${({theme:e})=>e.colors.dropdown_bg};
262
- `,Za=({totalSourceCount:o,uninstrumentSources:i,restartWorkloads:n})=>{const a=I.useTheme(),s=Wt({container:Xa,animateIn:I.animations.slide.in.center,animateOut:I.animations.slide.out.center}),{selectedSources:c,setSelectedSources:d}=jt(),[u,p]=t(!1),m=l(()=>{let e=0;return Object.values(c).forEach(t=>{e+=t.length}),e},[c]),h=()=>{d({})};return e.createElement(r,null,e.createElement(s,{"data-id":"multi-source-control",enter:!!m},e.createElement(T,null,"Selected sources"),e.createElement(Te,{label:m,filled:!0}),e.createElement(le,{orientation:"vertical",length:"16px"}),e.createElement(lt,{variant:"tertiary",onClick:h},e.createElement(T,{family:"secondary",decoration:"underline"},"Deselect")),e.createElement(lt,{variant:"tertiary",onClick:()=>{const e=[];Object.values(c).forEach(t=>{e.push(...t.map(e=>Vt(e)))}),n(e),h()}},e.createElement(Lo,null),e.createElement(T,{family:"secondary",decoration:"underline"},"Restart")),e.createElement(lt,{variant:"tertiary",onClick:()=>p(!0)},e.createElement(No,null),e.createElement(T,{family:"secondary",decoration:"underline",color:a.text.error},"Uninstrument"))),e.createElement(z,{isOpen:u,name:`${m} sources`,type:j.Source,isLastItem:m===o,onApprove:()=>{const e={};Object.entries(c).forEach(([t,o])=>{e[t]=o.map(e=>({...e,selected:!1}))}),i(e),p(!1),h()},onDeny:()=>p(!1)}))},el=d.div`
350
+ `,Hn=({totalSourceCount:o,uninstrumentSources:i,restartWorkloads:a})=>{const n=I.useTheme(),s=jt({container:Bn,animateIn:I.animations.slide.in.center,animateOut:I.animations.slide.out.center}),{selectedSources:c,setSelectedSources:d}=Ae(),[u,p]=t(!1),m=l(()=>{let e=0;return Object.values(c).forEach(t=>{e+=t.length}),e},[c]),h=()=>{d({})};return e.createElement(r,null,e.createElement(s,{"data-id":"multi-source-control",enter:!!m},e.createElement(T,null,"Selected sources"),e.createElement(Te,{label:m,filled:!0}),e.createElement(le,{orientation:"vertical",length:"16px"}),e.createElement(Oe,{variant:"tertiary",onClick:h},e.createElement(T,{family:"secondary",decoration:"underline"},"Deselect")),e.createElement(Oe,{variant:"tertiary",onClick:()=>{const e=[];Object.values(c).forEach(t=>{e.push(...t.map(e=>Vt(e)))}),a(e),h()}},e.createElement(Fo,null),e.createElement(T,{family:"secondary",decoration:"underline"},"Restart")),e.createElement(Oe,{variant:"tertiary",onClick:()=>p(!0)},e.createElement($o,null),e.createElement(T,{family:"secondary",decoration:"underline",color:n.text.error},"Uninstrument"))),e.createElement(V,{isOpen:u,name:`${m} sources`,type:B.Source,isLastItem:m===o,onApprove:()=>{const e={};Object.entries(c).forEach(([t,o])=>{e[t]=o.map(e=>({...e,selected:!1}))}),i(e),p(!1),h()},onDeny:()=>p(!1)}))},Un=d.div`
263
351
  position: relative;
264
352
  width: fit-content;
265
- `,tl=d(ce)`
353
+ `,Wn=d(ce)`
266
354
  gap: 12px;
267
355
  padding: 0 12px;
268
- `,ol=d(X)`
356
+ `,_n=d(X)`
269
357
  gap: 12px;
270
358
  max-height: 400px;
271
359
  overflow-y: auto;
272
- `,il=d.div`
360
+ `,Gn=d.div`
273
361
  position: absolute;
274
362
  bottom: 0;
275
363
  left: 0;
@@ -278,13 +366,13 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
278
366
  border-radius: 0 0 24px 24px;
279
367
  background: ${({theme:e})=>`linear-gradient(to top, ${e.colors.dropdown_bg}, transparent)`};
280
368
  pointer-events: none;
281
- `,nl=d(T)`
369
+ `,Jn=d(T)`
282
370
  background-color: ${({theme:e})=>e.colors.orange_soft};
283
371
  color: ${({theme:e})=>e.text.primary};
284
372
  border-radius: 32px;
285
373
  width: fit-content;
286
374
  padding: 2px 8px;
287
- `,al=()=>{const t=I.useTheme(),{notifications:o,markAsSeen:i}=L(),n=o.filter(({hideFromHistory:e})=>!e),a=n.filter(({seen:e})=>!e),l=a.length,{popupRef:r,popupOpen:s,setPopupOpen:c,popupPosition:d,handlePosition:u}=Ye({defaultClientHeight:420,defaultClientwidth:400,onClickOutside:()=>{l&&a.forEach(({id:e})=>i(e))}});return e.createElement(el,null,e.createElement(pt,{onClick:()=>{u(0,0),c(e=>!e)},tooltip:"Notifications",withPing:!!l,pingColor:t.colors.orange_og},e.createElement(Po,{size:18})),e.createElement(Qe,{ref:r,isOpen:s,right:d.left,maxWidth:"400px",header:e.createElement(tl,null,e.createElement(T,{size:20},"Notifications"),!!l&&e.createElement(nl,{size:12,family:"secondary"},l," new"))},e.createElement(ol,null,n.length?n.map(t=>e.createElement(ul,{key:`notification-${t.id}`,...t,onClick:()=>c(!1)})):e.createElement(De,{title:"No notifications",subTitle:""})),e.createElement(il,null)))},ll=d.div`
375
+ `,Yn=()=>{const t=I.useTheme(),{notifications:o,markAsSeen:i}=L(),a=o.filter(({hideFromHistory:e})=>!e),n=a.filter(({seen:e})=>!e),l=n.length,{popupRef:r,popupOpen:s,setPopupOpen:c,popupPosition:d,handlePosition:u}=Xe({defaultClientHeight:420,defaultClientwidth:400,onClickOutside:()=>{l&&n.forEach(({id:e})=>i(e))}});return e.createElement(Un,null,e.createElement(pt,{onClick:()=>{u(0,0),c(e=>!e)},tooltip:"Notifications",withPing:!!l,pingColor:t.colors.orange_og},e.createElement(Ro,{size:18})),e.createElement(Ze,{ref:r,isOpen:s,right:d.left,maxWidth:"400px",header:e.createElement(Wn,null,e.createElement(T,{size:20},"Notifications"),!!l&&e.createElement(Jn,{size:12,family:"secondary"},l," new"))},e.createElement(_n,null,a.length?a.map(t=>e.createElement(ol,{key:`notification-${t.id}`,...t,onClick:()=>c(!1)})):e.createElement(De,{title:"No notifications",subTitle:""})),e.createElement(Gn,null)))},Qn=d.div`
288
376
  display: flex;
289
377
  align-items: flex-start;
290
378
  gap: 12px;
@@ -298,7 +386,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
298
386
  background-color: ${({theme:e})=>e.colors.dropdown_bg_2};
299
387
  }
300
388
  }
301
- `,rl=d.div`
389
+ `,Xn=d.div`
302
390
  background-color: ${({$type:e,theme:t})=>t.text[e]+I.opacity.hex["015"]};
303
391
  border-radius: 8px;
304
392
  width: 36px;
@@ -306,19 +394,19 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
306
394
  display: flex;
307
395
  align-items: center;
308
396
  justify-content: center;
309
- `,sl=d.div`
397
+ `,Zn=d.div`
310
398
  width: 290px;
311
- `,cl=d.div`
399
+ `,el=d.div`
312
400
  margin-bottom: 6px;
313
- `,dl=d.div`
401
+ `,tl=d.div`
314
402
  display: flex;
315
403
  align-items: center;
316
404
  gap: 6px;
317
- `,ul=({id:t,seen:o,type:i,title:n,message:a,time:l,crdType:r,target:s,onClick:c})=>{const d=I.useTheme(),u=Bt(),{onClickNotification:p}=Ut(),m=!!r&&!!s,h=n?.toLowerCase().includes(Q.Delete.toLowerCase())||!1,g=me(i,d);return e.createElement(ll,{key:`notification-${t}`,className:m?"click-enabled":"",onClick:()=>{m&&(c(),p({id:t,crdType:r,target:s}))}},e.createElement(rl,{$type:h?V.Error:i},h?e.createElement(No,null):e.createElement(g,null)),e.createElement(sl,null,e.createElement(cl,null,e.createElement(T,{size:14},a)),e.createElement(dl,null,e.createElement(T,{size:10,color:d.text.grey},u.format(new Date(l))),!o&&e.createElement(e.Fragment,null,e.createElement(T,{size:10},"·"),e.createElement(T,{size:10,color:d.colors.orange_soft},"new")))))},pl=(e,t,o)=>{const i=e?.serviceName||t?.otelServiceName||t?.name,n=o?[qo]:Le(t?.containers||[]),{priorotizedStatus:a}=re(t?.conditions||[]);return{id:i,title:i,icons:n.length?n:[Ko],status:a,serviceMapEntry:e}},ml=e=>"user"===e?.otelServiceName&&!e?.namespace&&!e?.name&&!e?.kind,hl=d.div`
405
+ `,ol=({id:t,seen:o,type:i,title:a,message:n,time:l,crdType:r,target:s,onClick:c})=>{const d=I.useTheme(),u=zt(),{onClickNotification:p}=Bt(),m=!!r&&!!s,h=a?.toLowerCase().includes(Q.Delete.toLowerCase())||!1,g=me(i,d);return e.createElement(Qn,{key:`notification-${t}`,className:m?"click-enabled":"",onClick:()=>{m&&(c(),p({id:t,crdType:r,target:s}))}},e.createElement(Xn,{$type:h?H.Error:i},h?e.createElement($o,null):e.createElement(g,null)),e.createElement(Zn,null,e.createElement(el,null,e.createElement(T,{size:14},n)),e.createElement(tl,null,e.createElement(T,{size:10,color:d.text.grey},u.format(new Date(l))),!o&&e.createElement(e.Fragment,null,e.createElement(T,{size:10},"·"),e.createElement(T,{size:10,color:d.colors.orange_soft},"new")))))},il=(e,t,o)=>{const i=e?.serviceName||t?.otelServiceName||t?.name,a=o?[Lo]:ze(t?.containers||[]),{priorotizedStatus:n}=re(t?.conditions||[]);return{id:i,title:i,icons:a.length?a:[Po],status:n,serviceMapEntry:e}},al=e=>"user"===e?.otelServiceName&&!e?.namespace&&!e?.name&&!e?.kind,nl=d.div`
318
406
  width: 100%;
319
407
  height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px)`};
320
408
  position: relative;
321
- `,gl={namespace:"",name:"",kind:"",otelServiceName:"user",selected:!0,numberOfInstances:0,dataStreamNames:[],containers:[],conditions:[]},yl=({heightToRemove:t,serviceMap:i})=>{const n=I.useTheme(),{sources:a,sourcesLoading:l}=B(),{containerRef:r,containerHeight:s,containerWidth:c}=je(),[d,u,m]=Zo([]),[h,g,y]=ei([]);return o(()=>{if(s&&c){const t=(({sources:e,serviceMap:t,containerHeight:o,containerWidth:i})=>{const n=[],a=new Map,l=((e,t)=>{const o=new Map,i=new Map,n=new Map,a=new Set;e.forEach(e=>{a.add(e.serviceName),e.services.forEach(e=>{a.add(e.serviceName)})}),a.forEach(e=>{i.set(e,[]),n.set(e,0)}),e.forEach(e=>{e.services.forEach(t=>{i.get(e.serviceName)?.push(t.serviceName);const o=n.get(t.serviceName)||0;n.set(t.serviceName,o+1)})});const l=[],r=[];for(a.forEach(e=>{0===(n.get(e)||0)&&r.push(e)});r.length>0;){const e=[],t=r.length;for(let o=0;o<t;o++){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 a.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,a=150*(e.length-1),l=(t-a)/2;e.forEach((e,t)=>{const i=l+150*t,a=n;o.set(e,{x:i,y:a})})}),o})(t,i);if(t.length&&e.length){t.forEach(t=>{const o=t.serviceName;if(n.find(e=>e.id===`${j.Source}-${o}-${Ee.MapItem}`))return;const i=e.find(e=>o===e.otelServiceName||o===e.name);a.set(o,t),t.services.forEach(e=>a.set(e.serviceName,{serviceName:e.serviceName,services:[]})),n.push({id:`${j.Source}-${o}-${Ee.MapItem}`,type:Ee.MapItem,position:l.get(o),data:pl(t,i,ml(i))})}),a.forEach((t,o)=>{if(n.find(e=>e.id===`${j.Source}-${o}-${Ee.MapItem}`))return;const i=e.find(e=>o===e.otelServiceName||o===e.name);n.push({id:`${j.Source}-${o}-${Ee.MapItem}`,type:Ee.MapItem,position:l.get(o),data:pl(t,i,ml(i))})});let o=50;e.forEach(e=>{const t=e.otelServiceName||e.name;n.find(e=>e.id===`${j.Source}-${t}-${Ee.MapItem}`)||(n.push({id:`${j.Source}-${t}-${Ee.MapItem}`,type:Ee.MapItem,position:{x:o,y:10},data:pl(void 0,e,ml(e))}),o+=110)})}else n.push({id:`${j.Source}-${Ee.NoData}`,type:Ee.NoData,position:{x:i/2-150,y:o/4},data:{subTitle:p.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return n})({serviceMap:i,sources:[gl].concat(a),sourcesLoading:l,containerHeight:s,containerWidth:c});d.length>1?(e=t,u(t=>{const o=e.map(e=>{const o=t.find(t=>t.id===e.id);return e.position=o?.position||e.position,{id:e.id,item:e,type:o?"replace":"add"}});return t.find(e=>e.id===`${j.Source}-${Ee.NoData}`)&&o.push({id:`${j.Source}-${Ee.NoData}`,type:"remove"}),ti(o,t)})):u(t)}var e},[i,a,l,s,c]),o(()=>{g((({theme:e,nodes:t,serviceMap:o})=>{const i=[];return t.forEach(({id:t,data:{id:n,status:a}})=>{const{services:l}=o.find(e=>e.serviceName===n)||{services:[]};l.forEach(o=>{const n=t,l=`${j.Source}-${o.serviceName}-${Ee.MapItem}`,r=a===V.Error;i.push({id:`${n}-to-${l}`,source:n,target:l,markerEnd:{type:oi.ArrowClosed},style:{stroke:r?e?.colors.dark_red:e?.colors.border}})})}),i})({theme:n,nodes:d,serviceMap:i}))},[n,d,i]),e.createElement(hl,{ref:r,$heightToRemove:t},e.createElement(Ge,{nodes:d,edges:h,onNodesChange:m,onEdgesChange:y,zoomOnScroll:!0}))},vl=d.div`
409
+ `,ll={namespace:"",name:"",kind:"",otelServiceName:"user",selected:!0,numberOfInstances:0,dataStreamNames:[],containers:[],conditions:[]},rl=({heightToRemove:t,serviceMap:i})=>{const a=I.useTheme(),{sources:n,sourcesLoading:l}=U(),{containerRef:r,containerHeight:s,containerWidth:c}=We(),[d,u,m]=Xo([]),[h,g,y]=Zo([]);return o(()=>{if(s&&c){const t=(({sources:e,serviceMap:t,containerHeight:o,containerWidth:i})=>{const a=[],n=new Map,l=((e,t)=>{const o=new Map,i=new Map,a=new Map,n=new Set;e.forEach(e=>{n.add(e.serviceName),e.services.forEach(e=>{n.add(e.serviceName)})}),n.forEach(e=>{i.set(e,[]),a.set(e,0)}),e.forEach(e=>{e.services.forEach(t=>{i.get(e.serviceName)?.push(t.serviceName);const o=a.get(t.serviceName)||0;a.set(t.serviceName,o+1)})});const l=[],r=[];for(n.forEach(e=>{0===(a.get(e)||0)&&r.push(e)});r.length>0;){const e=[],t=r.length;for(let o=0;o<t;o++){const t=r.shift();e.push(t),i.get(t)?.forEach(e=>{const t=a.get(e)||0;a.set(e,t-1),t-1==0&&r.push(e)})}e.length>0&&l.push(e)}return n.forEach(e=>{l.flat().includes(e)||(0===l.length?l.push([e]):l[l.length-1].push(e))}),l.forEach((e,i)=>{const a=100+150*i,n=150*(e.length-1),l=(t-n)/2;e.forEach((e,t)=>{const i=l+150*t,n=a;o.set(e,{x:i,y:n})})}),o})(t,i);if(t.length&&e.length){t.forEach(t=>{const o=t.serviceName;if(a.find(e=>e.id===`${B.Source}-${o}-${Ht.MapItem}`))return;const i=e.find(e=>o===e.otelServiceName||o===e.name);n.set(o,t),t.services.forEach(e=>n.set(e.serviceName,{serviceName:e.serviceName,services:[]})),a.push({id:`${B.Source}-${o}-${Ht.MapItem}`,type:Ht.MapItem,position:l.get(o),data:il(t,i,al(i))})}),n.forEach((t,o)=>{if(a.find(e=>e.id===`${B.Source}-${o}-${Ht.MapItem}`))return;const i=e.find(e=>o===e.otelServiceName||o===e.name);a.push({id:`${B.Source}-${o}-${Ht.MapItem}`,type:Ht.MapItem,position:l.get(o),data:il(t,i,al(i))})});let o=50;e.forEach(e=>{const t=e.otelServiceName||e.name;a.find(e=>e.id===`${B.Source}-${t}-${Ht.MapItem}`)||(a.push({id:`${B.Source}-${t}-${Ht.MapItem}`,type:Ht.MapItem,position:{x:o,y:10},data:il(void 0,e,al(e))}),o+=110)})}else a.push({id:`${B.Source}-${Ht.NoData}`,type:Ht.NoData,position:{x:i/2-150,y:o/4},data:{subTitle:p.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return a})({serviceMap:i,sources:[ll].concat(n),sourcesLoading:l,containerHeight:s,containerWidth:c});d.length>1?(e=t,u(t=>{const o=e.map(e=>{const o=t.find(t=>t.id===e.id);return e.position=o?.position||e.position,{id:e.id,item:e,type:o?"replace":"add"}});return t.find(e=>e.id===`${B.Source}-${Ht.NoData}`)&&o.push({id:`${B.Source}-${Ht.NoData}`,type:"remove"}),ei(o,t)})):u(t)}var e},[i,n,l,s,c]),o(()=>{g((({theme:e,nodes:t,serviceMap:o})=>{const i=[];return t.forEach(({id:t,data:{id:a,status:n}})=>{const{services:l}=o.find(e=>e.serviceName===a)||{services:[]};l.forEach(o=>{const a=t,l=`${B.Source}-${o.serviceName}-${Ht.MapItem}`,r=n===H.Error;i.push({id:`${a}-to-${l}`,source:a,target:l,markerEnd:{type:Qo.ArrowClosed},style:{stroke:r?e?.colors.dark_red:e?.colors.border}})})}),i})({theme:a,nodes:d,serviceMap:i}))},[a,d,i]),e.createElement(nl,{ref:r,$heightToRemove:t},e.createElement(Ut,{nodes:d,edges:h,onNodesChange:m,onEdgesChange:y,zoomOnScroll:!0}))},sl=d.div`
322
410
  display: flex;
323
411
  flex-direction: column;
324
412
  align-items: center;
@@ -328,12 +416,12 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
328
416
  max-height: ${({$isModal:e})=>e?"calc(100vh - 510px)":"calc(100vh - 310px)"};
329
417
  height: fit-content;
330
418
  overflow-y: scroll;
331
- `,fl=d.div`
419
+ `,cl=d.div`
332
420
  width: 100%;
333
421
  padding-bottom: ${({$isOpen:e})=>e?"18px":"0"};
334
422
  border-radius: 16px;
335
423
  background-color: ${({$selected:e,theme:t})=>e?t.colors.majestic_blue+I.opacity.hex["024"]:t.colors.dropdown_bg_2+I.opacity.hex["040"]};
336
- `,bl=d.div`
424
+ `,dl=d.div`
337
425
  display: flex;
338
426
  justify-content: space-between;
339
427
  gap: 12px;
@@ -345,26 +433,26 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
345
433
  background-color: ${({$withClick:e,$selected:t,theme:o})=>e&&(t?o.colors.majestic_blue+I.opacity.hex["040"]:o.colors.dropdown_bg_2+I.opacity.hex["080"])};
346
434
  transition: background-color 0.3s;
347
435
  }
348
- `,xl=d(bl)`
436
+ `,ul=d(dl)`
349
437
  width: calc(100% - 100px);
350
438
  margin: 0 auto;
351
439
  padding: 8px;
352
- `,Cl=d.div`
440
+ `,pl=d.div`
353
441
  position: relative;
354
442
  padding-bottom: ${({$addPadding:e})=>e?"16px":"0"};
355
- `,$l=d.div`
443
+ `,ml=d.div`
356
444
  position: absolute;
357
445
  top: 6px;
358
446
  left: 18px;
359
- `,kl=d(we)`
447
+ `,hl=d($e)`
360
448
  padding-bottom: ${({$addPadding:e})=>e?"16px":"0"};
361
- `,Sl=d.div`
449
+ `,gl=d.div`
362
450
  width: ${({$width:e})=>`${e||42}px`};
363
451
  display: flex;
364
452
  align-items: center;
365
453
  justify-content: flex-end;
366
454
  text-align: right;
367
- `,wl=$e(j.Namespace),Dl=({isModal:t=!1,withInstances:o=!0,fetchingNamespace:i,fetchedNamespaces:n,filteredNamespacesAndSources:a,selectedNamespace:l,onSelectNamespace:r,selectedSources:s,onSelectSource:c,selectedFutureApps:d,onSelectFutureApps:u})=>{const m=I.useTheme(),{isVm:h}=He(),{namespacesLoading:g}=B(),y=Object.entries(a||{});return y?.length?e.createElement(vl,{$isModal:t},y.map(([t,a])=>{const y=s?.[t]||[],f=d?.[t]?.selected||!1,b=y.filter(({selected:e})=>e),x=y.length>0,C=l===t,$=b.length>0&&b.length===a.length,k=b.length>0&&b.length!==a.length,w=a.length>0,D=1===a.length;return r||w?e.createElement(fl,{key:`namespace-${t}`,"data-id":`namespace-${t}`,$selected:$,$isOpen:C},e.createElement(bl,{$selected:$,$withClick:!!r,onClick:()=>r?.(t)},e.createElement(ce,{$gap:12},r&&e.createElement(v,{partiallyChecked:k,value:$,onChange:e=>r(t,e)}),e.createElement(wl,null),e.createElement(T,null,t)),e.createElement(ce,{$gap:24},!h&&u&&e.createElement(S,{title:p.FUTURE_APPS_TITLE,tooltip:p.FUTURE_APPS_DESCRIPTION,initialValue:f,onChange:e=>u(e,t),flipHorizontally:!0}),e.createElement(Sl,{$width:108},i!==t||n?.includes(t)?null:e.createElement(_t,{size:10},"Retrieving workloads...")),e.createElement(Sl,null,e.createElement(T,{size:10,color:m.text.grey},x?`${b.length}/${a.length}`:null)),r&&e.createElement(mt,{extend:C}))),(C||!r)&&(w?e.createElement(Cl,{$addPadding:!c},e.createElement($l,null,e.createElement(le,{orientation:"vertical",length:(D?24:34*a.length)+"px"})),a.map(i=>{const n=b.some(({name:e})=>e===i.name);return e.createElement(Nl,{key:`source-${i.name}`,withInstances:o,source:i,namespace:t,isSelected:n,onSelect:c})})):e.createElement(kl,{$addPadding:!c},g||i===t&&!n?.includes(t)?e.createElement(xt,null):e.createElement(De,{title:p.NO_SOURCES_NAMESPACE,subTitle:p.TRY_SEARCH_OR_OTHER_NAMESPACE})))):null})):e.createElement(we,null,g||i?e.createElement(xt,null):e.createElement(De,{title:p.NO_SOURCES,subTitle:!h&&r?p.PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES:p.PLEASE_ADD_SOURCE}))},Nl=({withInstances:t,source:o,namespace:i,isSelected:n,onSelect:a})=>e.createElement(xl,{"data-id":`source-${o.name}`,$selected:n,$withClick:!!a,onClick:()=>a?.(o)},e.createElement(ce,{$gap:12},a&&e.createElement(v,{value:n,onChange:()=>a(o,i)}),e.createElement(ce,{$gap:4},e.createElement(T,null,o.name),e.createElement(T,{opacity:.8,size:10},t?` • ${o.numberOfInstances||0} running instance${1!==o.numberOfInstances?"s":""}`:"",` • ${o.kind}`)))),Tl=d.div`
455
+ `,yl=ke(B.Namespace),vl=({isModal:t=!1,withInstances:o=!0,fetchingNamespace:i,fetchedNamespaces:a,filteredNamespacesAndSources:n,selectedNamespace:l,onSelectNamespace:r,selectedSources:s,onSelectSource:c,selectedFutureApps:d,onSelectFutureApps:u})=>{const m=I.useTheme(),{isVm:h}=He(),{namespacesLoading:g}=U(),y=Object.entries(n||{});return y?.length?e.createElement(sl,{$isModal:t},y.map(([t,n])=>{const y=s?.[t]||[],f=d?.[t]?.selected||!1,b=y.filter(({selected:e})=>e),x=y.length>0,C=l===t,k=b.length>0&&b.length===n.length,w=b.length>0&&b.length!==n.length,$=n.length>0,D=1===n.length;return r||$?e.createElement(cl,{key:`namespace-${t}`,"data-id":`namespace-${t}`,$selected:k,$isOpen:C},e.createElement(dl,{$selected:k,$withClick:!!r,onClick:()=>r?.(t)},e.createElement(ce,{$gap:12},r&&e.createElement(v,{partiallyChecked:w,value:k,onChange:e=>r(t,e)}),e.createElement(yl,null),e.createElement(T,null,t)),e.createElement(ce,{$gap:24},!h&&u&&e.createElement(S,{title:p.FUTURE_APPS_TITLE,tooltip:p.FUTURE_APPS_DESCRIPTION,initialValue:f,onChange:e=>u(e,t),flipHorizontally:!0}),e.createElement(gl,{$width:108},i!==t||a?.includes(t)?null:e.createElement(Ee,{size:10},"Retrieving workloads...")),e.createElement(gl,null,e.createElement(T,{size:10,color:m.text.grey},x?`${b.length}/${n.length}`:null)),r&&e.createElement(mt,{extend:C}))),(C||!r)&&($?e.createElement(pl,{$addPadding:!c},e.createElement(ml,null,e.createElement(le,{orientation:"vertical",length:(D?24:34*n.length)+"px"})),n.map(i=>{const a=b.some(({name:e})=>e===i.name);return e.createElement(fl,{key:`source-${i.name}`,withInstances:o,source:i,namespace:t,isSelected:a,onSelect:c})})):e.createElement(hl,{$addPadding:!c},g||i===t&&!a?.includes(t)?e.createElement(Re,null):e.createElement(De,{title:p.NO_SOURCES_NAMESPACE,subTitle:p.TRY_SEARCH_OR_OTHER_NAMESPACE})))):null})):e.createElement($e,null,g||i?e.createElement(Re,null):e.createElement(De,{title:p.NO_SOURCES,subTitle:!h&&r?p.PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES:p.PLEASE_ADD_SOURCE}))},fl=({withInstances:t,source:o,namespace:i,isSelected:a,onSelect:n})=>e.createElement(ul,{"data-id":`source-${o.name}`,$selected:a,$withClick:!!n,onClick:()=>n?.(o)},e.createElement(ce,{$gap:12},n&&e.createElement(v,{value:a,onChange:()=>n(o,i)}),e.createElement(ce,{$gap:4},e.createElement(T,null,o.name),e.createElement(T,{opacity:.8,size:10},t?` • ${o.numberOfInstances||0} running instance${1!==o.numberOfInstances?"s":""}`:"",` • ${o.kind}`)))),bl=d.div`
368
456
  display: flex;
369
457
  flex-direction: column;
370
458
  align-items: center;
@@ -373,35 +461,35 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
373
461
  max-height: calc(100vh - 200px);
374
462
  height: fit-content;
375
463
  overflow-y: scroll;
376
- `,Il=({onEditStream:t,onEditSources:o,onEditDestinations:i,categories:n})=>{const{selectedStreamName:a}=ze(),{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(oe,{$isNotModal:!0},e.createElement(X,{$gap:12},e.createElement(O,{title:p.SUMMARY,description:p.STREAM_CONFIRM}),e.createElement(Tl,null,e.createElement(Y,{title:p.STREAM_NAME,action:()=>e.createElement(Gt,{onClick:t}),data:[{title:"",value:a}]}),e.createElement(Y,{title:p.SELECTED_SOURCES,titleBadge:d,action:()=>e.createElement(Gt,{onClick:o})},e.createElement(Dl,{filteredNamespacesAndSources:r,withInstances:!1})),e.createElement(Y,{title:p.SELECTED_DESTINATIONS,titleBadge:s.length+c.length,action:()=>e.createElement(Gt,{onClick:i})},e.createElement(Sa,{categories:n})))))};var El;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}(El||(El={}));const Ol=({onClickId:o,defaultSelectedId:i,extendedNavIcons:n})=>{const{isVm:a}=He(),[r,s]=t(i||""),c=l(()=>[{id:El.Overview,icon:Ho,selected:r===El.Overview,onClick:()=>{s(El.Overview),o(El.Overview)},tooltip:"Overview"},...(n||[]).map(e=>({...e,selected:r===e.id,onClick:()=>{s(e.id),e.onClick()}}))],[r]),d=l(()=>{const e=[{id:El.Sources,icon:jo,selected:r===El.Sources,onClick:()=>{s(El.Sources),o(El.Sources)},tooltip:"Sources"},{id:El.Destinations,icon:Vo,selected:r===El.Destinations,onClick:()=>{s(El.Destinations),o(El.Destinations)},tooltip:"Destinations"}];return a||(e.push({id:El.InstrumentationRules,icon:zo,selected:r===El.InstrumentationRules,onClick:()=>{s(El.InstrumentationRules),o(El.InstrumentationRules)},tooltip:"Instrumentation Rules"}),e.push({id:El.Actions,icon:Wo,selected:r===El.Actions,onClick:()=>{s(El.Actions),o(El.Actions)},tooltip:"Actions"})),e},[a,r]);return e.createElement(Jt,{orientation:"vertical",mainIcons:c,subIcons:d})},Ml=({})=>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(Bo,null)),Al=(e,t)=>{const{name:o,kind:i,namespace:n}=e,a=[{title:p.KIND,value:i},{title:p.NAME,value:o,tooltip:"Resource name"}];return t||(a.unshift({title:p.NAMESPACE,value:n}),a.push({type:m.Divider}),a.push({type:m.CopyText,value:`kubectl get ${i} ${o} -n ${n}`.toLowerCase()})),a},Fl=d.div`
464
+ `,xl=({onEditStream:t,onEditSources:o,onEditDestinations:i,categories:a})=>{const{selectedStreamName:n}=Ue(),{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(oe,{$isNotModal:!0},e.createElement(X,{$gap:12},e.createElement(O,{title:p.SUMMARY,description:p.STREAM_CONFIRM}),e.createElement(bl,null,e.createElement(Y,{title:p.STREAM_NAME,action:()=>e.createElement(Wt,{onClick:t}),data:[{title:"",value:n}]}),e.createElement(Y,{title:p.SELECTED_SOURCES,titleBadge:d,action:()=>e.createElement(Wt,{onClick:o})},e.createElement(vl,{filteredNamespacesAndSources:r,withInstances:!1})),e.createElement(Y,{title:p.SELECTED_DESTINATIONS,titleBadge:s.length+c.length,action:()=>e.createElement(Wt,{onClick:i})},e.createElement(gn,{categories:a})))))};var Cl;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}(Cl||(Cl={}));const kl=({onClickId:o,defaultSelectedId:i,extendedNavIcons:a})=>{const{isVm:n}=He(),[r,s]=t(i||""),c=l(()=>[{id:Cl.Overview,icon:qo,selected:r===Cl.Overview,onClick:()=>{s(Cl.Overview),o(Cl.Overview)},tooltip:"Overview"},...(a||[]).map(e=>({...e,selected:r===e.id,onClick:()=>{s(e.id),e.onClick()}}))],[r]),d=l(()=>{const e=[{id:Cl.Sources,icon:Vo,selected:r===Cl.Sources,onClick:()=>{s(Cl.Sources),o(Cl.Sources)},tooltip:"Sources"},{id:Cl.Destinations,icon:zo,selected:r===Cl.Destinations,onClick:()=>{s(Cl.Destinations),o(Cl.Destinations)},tooltip:"Destinations"}];return n||(e.push({id:Cl.InstrumentationRules,icon:Ko,selected:r===Cl.InstrumentationRules,onClick:()=>{s(Cl.InstrumentationRules),o(Cl.InstrumentationRules)},tooltip:"Instrumentation Rules"}),e.push({id:Cl.Actions,icon:jo,selected:r===Cl.Actions,onClick:()=>{s(Cl.Actions),o(Cl.Actions)},tooltip:"Actions"})),e},[n,r]);return e.createElement(_t,{orientation:"vertical",mainIcons:c,subIcons:d})},wl=({})=>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(Bo,null)),Sl=(e,t)=>{const{name:o,kind:i,namespace:a}=e,n=[{title:p.KIND,value:i},{title:p.NAME,value:o,tooltip:"Resource name"}];return t||(n.unshift({title:p.NAMESPACE,value:a}),n.push({type:m.Divider}),n.push({type:m.CopyText,value:`kubectl get ${i} ${o} -n ${a}`.toLowerCase()})),n},$l=d.div`
377
465
  display: flex;
378
466
  flex-direction: column;
379
467
  gap: 24px;
380
468
  padding: 4px;
381
- `,Rl=({formData:t,handleFormChange:o})=>e.createElement(Fl,null,e.createElement(x,{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}})=>o("otelServiceName",e)})),Ll=({workloadOdigosHealthStatus:t})=>{if(!t)return null;const o=Yt(t.status),i=ot(t.reasonEnum),n=t.message;return e.createElement(ce,{$alignItems:"center",$justifyContent:"center"},e.createElement(se,{status:o,title:i,subtitle:n,withBackground:o!==pe.Disabled,withBorder:!0,withIcon:!0,width:"calc(100% - 24px)"}))},Pl=({source:i,fetchSourceDescribe:n})=>{const[a,l]=t(!1),[r,s]=t(null);return o(()=>{i&&n({variables:{namespace:i.namespace,name:i.name,kind:i.kind}}).then(({data:e})=>{e?.describeSource?s(e.describeSource):l(!0)})},[n,i]),r||a?e.createElement(X,{$gap:12},a?e.createElement(we,{$height:"70vh"},e.createElement(De,{subTitle:"Could not fetch describe for this source"})):r?.pods?.length?r.pods.map(({podName:t,nodeName:o,phase:n,agentInjected:a,runningLatestWorkloadRevision:l,containers:s})=>{const d=n.status!==V.Success||Qt(s)?V.Error:V.Success,u=[];return u.push(e.createElement(Xt,{value:`kubectl get pod ${t.value} -n ${r?.namespace?.value||i.namespace}`.toLowerCase()})),u.push(e.createElement(le,{length:"100%",margin:"0"})),u.push(e.createElement(Zt,{title:o.name,tooltip:o.explain||"",value:{status:o.status||void 0,text:o.value}})),u.push(e.createElement(le,{length:"100%",margin:"0"})),u.push(e.createElement(Zt,{title:n.name,tooltip:n.explain||"",value:{status:n.status||void 0,text:n.value}})),u.push(e.createElement(le,{length:"100%",margin:"0"})),u.push(e.createElement(Zt,{title:a.name,tooltip:a.explain||"",value:{status:a.status||void 0,text:a.value}})),u.push(e.createElement(le,{length:"100%",margin:"0"})),l?.name&&(u.push(e.createElement(Zt,{title:l.name,tooltip:l.explain||void 0,value:{status:l.status||void 0,text:l.value}})),u.push(e.createElement(le,{length:"100%",margin:"0"}))),s.forEach(t=>{u.push(e.createElement(eo,{...t}))}),e.createElement(Y,{key:`pod-${t.value}`,title:`Pod: ${t.value}`,withExtend:!0,action:()=>e.createElement(se,{status:d,title:d,withIcon:!0,withBorder:!0})},c.toArray(u))}):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(xt,null))},ql=d(ce)`
469
+ `,Dl=({formData:t,handleFormChange:o})=>e.createElement($l,null,e.createElement(x,{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}})=>o("otelServiceName",e)})),Nl=({workloadOdigosHealthStatus:t})=>{if(!t)return null;const o=Gt(t.status),i=it(t.reasonEnum),a=t.message;return e.createElement(ce,{$alignItems:"center",$justifyContent:"center"},e.createElement(se,{status:o,title:i,subtitle:a,withBackground:o!==pe.Disabled,withBorder:!0,withIcon:!0,width:"calc(100% - 24px)"}))},Tl=({source:i,fetchSourceDescribe:a})=>{const[n,l]=t(!1),[r,s]=t(null);return o(()=>{i&&a({variables:{namespace:i.namespace,name:i.name,kind:i.kind}}).then(({data:e})=>{e?.describeSource?s(e.describeSource):l(!0)})},[a,i]),r||n?e.createElement(X,{$gap:12},n?e.createElement($e,{$height:"70vh"},e.createElement(De,{subTitle:"Could not fetch describe for this source"})):r?.pods?.length?r.pods.map(({podName:t,nodeName:o,phase:a,agentInjected:n,runningLatestWorkloadRevision:l,containers:s})=>{const d=a.status!==H.Success||Jt(s)?H.Error:H.Success,u=[];return u.push(e.createElement(Yt,{value:`kubectl get pod ${t.value} -n ${r?.namespace?.value||i.namespace}`.toLowerCase()})),u.push(e.createElement(le,{length:"100%",margin:"0"})),u.push(e.createElement(Qt,{title:o.name,tooltip:o.explain||"",value:{status:o.status||void 0,text:o.value}})),u.push(e.createElement(le,{length:"100%",margin:"0"})),u.push(e.createElement(Qt,{title:a.name,tooltip:a.explain||"",value:{status:a.status||void 0,text:a.value}})),u.push(e.createElement(le,{length:"100%",margin:"0"})),u.push(e.createElement(Qt,{title:n.name,tooltip:n.explain||"",value:{status:n.status||void 0,text:n.value}})),u.push(e.createElement(le,{length:"100%",margin:"0"})),l?.name&&(u.push(e.createElement(Qt,{title:l.name,tooltip:l.explain||void 0,value:{status:l.status||void 0,text:l.value}})),u.push(e.createElement(le,{length:"100%",margin:"0"}))),s.forEach(t=>{u.push(e.createElement(Xt,{...t}))}),e.createElement(Y,{key:`pod-${t.value}`,title:`Pod: ${t.value}`,withExtend:!0,action:()=>e.createElement(se,{status:d,title:d,withIcon:!0,withBorder:!0})},c.toArray(u))}):e.createElement($e,{$height:"70vh"},e.createElement(De,{subTitle:"Check if you have any running pods and try again"}))):e.createElement($e,{$height:"70vh"},e.createElement(Re,null))},Il=d(ce)`
382
470
  width: 100%;
383
471
  align-items: center;
384
472
  justify-content: space-between;
385
- `,Kl=({source:i,fetchSourceLibraries:n})=>{const a=I.useTheme(),[l,s]=t(!1),[c,d]=t(null);return o(()=>{i&&n({variables:{namespace:i.namespace,name:i.name,kind:i.kind}}).then(({data:e})=>{e?.instrumentationInstanceComponents?d(Nt(e.instrumentationInstanceComponents).sort((e,t)=>e.name.localeCompare(t.name))):s(!0)})},[n,i]),c||l?e.createElement(X,{$gap:12},l?e.createElement(we,{$height:"70vh"},e.createElement(De,{subTitle:"Could not fetch libraries for this source"})):c?.length?e.createElement(Y,{title:"Instrumented Libraries"},c.map(({name:t,nonIdentifyingAttributes:o},i)=>e.createElement(r,{key:`library-${t}`},e.createElement(ql,null,e.createElement(T,{size:12,color:a.text.grey},t),e.createElement(ce,{$gap:4},o.map(({key:o,value:i})=>to(i)&&oo(i)&&"is_standard_lib"===o?e.createElement(se,{key:`${t}-${o}`,status:V.Default,title:"STANDARD",withBorder:!0}):null))),i!==c.length-1&&e.createElement(le,{length:"100%",margin:"0"})))):e.createElement(we,{$height:"70vh",$gap:12},e.createElement(De,{title:"No libraries found",subTitle:""}),e.createElement(ie,{type:V.Warning,message:"This feature is in early development, and has very limited support"}))):e.createElement(we,{$height:"70vh"},e.createElement(xt,null))};var Hl;!function(e){e.Overview="Overview",e.Pods="Pods",e.Libraries="Libraries"}(Hl||(Hl={}));const zl=[ao.Deployment,ao.StatefulSet,ao.DaemonSet,ao.DeploymentConfig],Wl=[lo.Python,lo.Go],jl=d.div`
473
+ `,El=({source:i,fetchSourceLibraries:a})=>{const n=I.useTheme(),[l,s]=t(!1),[c,d]=t(null);return o(()=>{i&&a({variables:{namespace:i.namespace,name:i.name,kind:i.kind}}).then(({data:e})=>{e?.instrumentationInstanceComponents?d($t(e.instrumentationInstanceComponents).sort((e,t)=>e.name.localeCompare(t.name))):s(!0)})},[a,i]),c||l?e.createElement(X,{$gap:12},l?e.createElement($e,{$height:"70vh"},e.createElement(De,{subTitle:"Could not fetch libraries for this source"})):c?.length?e.createElement(Y,{title:"Instrumented Libraries"},c.map(({name:t,nonIdentifyingAttributes:o},i)=>e.createElement(r,{key:`library-${t}`},e.createElement(Il,null,e.createElement(T,{size:12,color:n.text.grey},t),e.createElement(ce,{$gap:4},o.map(({key:o,value:i})=>Zt(i)&&eo(i)&&"is_standard_lib"===o?e.createElement(se,{key:`${t}-${o}`,status:H.Default,title:"STANDARD",withBorder:!0}):null))),i!==c.length-1&&e.createElement(le,{length:"100%",margin:"0"})))):e.createElement($e,{$height:"70vh",$gap:12},e.createElement(De,{title:"No libraries found",subTitle:""}),e.createElement(ie,{type:H.Warning,message:"This feature is in early development, and has very limited support"}))):e.createElement($e,{$height:"70vh"},e.createElement(Re,null))};var Ol;!function(e){e.Overview="Overview",e.Pods="Pods",e.Libraries="Libraries"}(Ol||(Ol={}));const Al=[io.Deployment,io.StatefulSet,io.DaemonSet,io.DeploymentConfig],Ml=[ao.Python,ao.Go],Fl=d.div`
386
474
  width: 100%;
387
475
  height: 100%;
388
476
  max-height: calc(100vh - 220px);
389
477
  overflow: overlay;
390
478
  overflow-y: auto;
391
- `,Vl=d.div`
479
+ `,Rl=d.div`
392
480
  display: flex;
393
481
  flex-direction: column;
394
482
  gap: 12px;
395
- `,Bl=({persistSources:i,updateSource:a,restartWorkloads:r,fetchSourceById:s,fetchSourceDescribe:c,fetchSourceLibraries:d})=>{const{isVm:u}=He(),{sources:m}=B(),{selectedStreamName:h}=ze(),{drawerType:g,drawerEntityId:y}=P(),v=l(()=>Ve(m,h),[m,h]),f=n(null),b=g===j.Source,[x,C]=t(!1),[$,k]=t(!1),[S,w]=t(Hl.Overview),[D,N]=t(null);o(()=>{b&&y&&s(y).then(e=>N(e||null))},[b,y]);const{formData:I,handleFormChange:E,resetFormData:O,loadFormWithDrawerItem:M}=io(),A=l(()=>{if(!b)return O();const e=(D&&JSON.stringify(Vt(D))===JSON.stringify(Vt(y))?D:null)||v?.find(e=>e.namespace===y.namespace&&e.name===y.name&&e.kind===y.kind);return e?M(e):O(),e},[b,y,v,D]),F=l(()=>{const e=A?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===pe.Loading,containers:A?.containers||[]}},[A]),R=l(()=>{const e=[{label:Hl.Overview,onClick:()=>w(Hl.Overview),selected:S===Hl.Overview}];return zl.includes(A?.kind)&&e.push({label:Hl.Pods,onClick:()=>w(Hl.Pods),selected:S===Hl.Pods}),A?.containers?.some(({language:e})=>Wl.includes(e))&&e.push({label:Hl.Libraries,onClick:()=>w(Hl.Libraries),selected:S===Hl.Libraries}),e},[S,A]);return A?e.createElement(wi,{ref:f,onClose:()=>{w(Hl.Overview),N(null)},title:A.otelServiceName||A.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:Le(A.containers),isEdit:x,isFormDirty:$,onEdit:S===Hl.Overview?e=>{C("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=I.otelServiceName!==A.name?I.otelServiceName:"";E("otelServiceName",e),await a(y,{...I,otelServiceName:e}),N(null),k(!1),C(!1)},onDelete:S===Hl.Overview?async()=>{const{namespace:e}=A;i({[e]:[{...A,selected:!1,currentStreamName:h}]},{}),N(null),k(!1),C(!1),f.current?.closeDrawer()}:void 0,onCancel:()=>{k(!1),C(!1),E("otelServiceName",A.otelServiceName||A.name||"")},isLastItem:1===v.length,tabs:R,headerActionButtons:[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>r([y]),children:e.createElement(e.Fragment,null,e.createElement(Lo,null),e.createElement(T,{size:14,family:"secondary",decoration:"underline"},"Restart"))}]},S===Hl.Overview?x?e.createElement(jl,null,e.createElement(Rl,{formData:I,handleFormChange:(...e)=>{k(!0),E(...e),E("currentStreamName",h)}})):e.createElement(Vl,null,e.createElement(Ll,{workloadOdigosHealthStatus:A.workloadOdigosHealthStatus}),e.createElement(J,{conditions:A.conditions||[]}),e.createElement(Y,{title:p.SOURCE_DETAILS,data:A?Al(A,u):[]}),e.createElement(Y,{title:u?p.DETECTED_PROCESSES:p.DETECTED_CONTAINERS,titleBadge:F.isLoading?pe.Loading:F.containers.length,description:F.description||(u?p.DETECTED_PROCESSES_DESCRIPTION:p.DETECTED_CONTAINERS_DESCRIPTION)},F.containers.map(t=>e.createElement(no,{key:`source-container-${t.containerName}`,...t,callbackRuntimeOverride:async e=>await a(y,e)})))):S===Hl.Pods?e.createElement(Pl,{source:A,fetchSourceDescribe:c}):e.createElement(Kl,{source:A,fetchSourceLibraries:d})):null},Ul=d.div`
483
+ `,Ll=({persistSources:i,updateSource:n,restartWorkloads:r,fetchSourceById:s,fetchSourceDescribe:c,fetchSourceLibraries:d})=>{const{isVm:u}=He(),{sources:m}=U(),{selectedStreamName:h}=Ue(),{drawerType:g,drawerEntityId:y}=P(),v=l(()=>Ge(m,h),[m,h]),f=a(null),b=g===B.Source,[x,C]=t(!1),[k,w]=t(!1),[S,$]=t(Ol.Overview),[D,N]=t(null);o(()=>{b&&y&&s(y).then(e=>N(e||null))},[b,y]);const{formData:I,handleFormChange:E,resetFormData:O,loadFormWithDrawerItem:A}=to(),M=l(()=>{if(!b)return O();const e=(D&&JSON.stringify(Vt(D))===JSON.stringify(Vt(y))?D:null)||v?.find(e=>e.namespace===y.namespace&&e.name===y.name&&e.kind===y.kind);return e?A(e):O(),e},[b,y,v,D]),F=l(()=>{const e=M?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===pe.Loading,containers:M?.containers||[]}},[M]),R=l(()=>{const e=[{label:Ol.Overview,onClick:()=>$(Ol.Overview),selected:S===Ol.Overview}];return Al.includes(M?.kind)&&e.push({label:Ol.Pods,onClick:()=>$(Ol.Pods),selected:S===Ol.Pods}),M?.containers?.some(({language:e})=>Ml.includes(e))&&e.push({label:Ol.Libraries,onClick:()=>$(Ol.Libraries),selected:S===Ol.Libraries}),e},[S,M]);return M?e.createElement(wi,{ref:f,onClose:()=>{$(Ol.Overview),N(null)},title:M.otelServiceName||M.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:ze(M.containers),isEdit:x,isFormDirty:k,onEdit:S===Ol.Overview?e=>{C("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=I.otelServiceName!==M.name?I.otelServiceName:"";E("otelServiceName",e),await n(y,{...I,otelServiceName:e}),N(null),w(!1),C(!1)},onDelete:S===Ol.Overview?async()=>{const{namespace:e}=M;i({[e]:[{...M,selected:!1,currentStreamName:h}]},{}),N(null),w(!1),C(!1),f.current?.closeDrawer()}:void 0,onCancel:()=>{w(!1),C(!1),E("otelServiceName",M.otelServiceName||M.name||"")},isLastItem:1===v.length,tabs:R,headerActionButtons:[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>r([y]),children:e.createElement(e.Fragment,null,e.createElement(Fo,null),e.createElement(T,{size:14,family:"secondary",decoration:"underline"},"Restart"))}]},S===Ol.Overview?x?e.createElement(Fl,null,e.createElement(Dl,{formData:I,handleFormChange:(...e)=>{w(!0),E(...e),E("currentStreamName",h)}})):e.createElement(Rl,null,e.createElement(Nl,{workloadOdigosHealthStatus:M.workloadOdigosHealthStatus}),e.createElement(J,{conditions:M.conditions||[]}),e.createElement(Y,{title:p.SOURCE_DETAILS,data:M?Sl(M,u):[]}),e.createElement(Y,{title:u?p.DETECTED_PROCESSES:p.DETECTED_CONTAINERS,titleBadge:F.isLoading?pe.Loading:F.containers.length,description:F.description||(u?p.DETECTED_PROCESSES_DESCRIPTION:p.DETECTED_CONTAINERS_DESCRIPTION)},F.containers.map(t=>e.createElement(oo,{key:`source-container-${t.containerName}`,...t,callbackRuntimeOverride:async e=>await n(y,e)})))):S===Ol.Pods?e.createElement(Tl,{source:M,fetchSourceDescribe:c}):e.createElement(El,{source:M,fetchSourceLibraries:d})):null},Pl=d.div`
396
484
  max-width: ${({$fullWidth:e})=>e?"unset":"420px"};
397
485
  width: 100%;
398
- `,_l=i(({isModal:t,fetchSingleNamespace:o,onClickSummary:i},n)=>{const l=I.useTheme(),{isVm:r}=He(),s=ro({fetchSingleNamespace:o}),{selectedSources:c,fetchingNamespace:d,selectedAllNamespaces:u,onSelectAllNamespaces:m,getApiSourcesPayload:h,getApiFutureAppsPayload:g,searchText:y,setSearchText:v,searchBy:f,setSearchBy:b,showSelectedOnly:C,setShowSelectedOnly:$,showRunningOnly:k,setShowRunningOnly:w}=s;a(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(oe,{$isNotModal:!t},e.createElement(X,{$gap:12},e.createElement(X,{$gap:24},i&&e.createElement(gt,{onClick:i}),e.createElement(O,{title:p.SELECT_SOURCES,badgeLabel:D,description:p.SELECT_SOURCES_DESCRIPTION}),e.createElement(ce,{$justifyContent:"space-between"},e.createElement(Ul,{$fullWidth:r},e.createElement(x,{placeholder:f===j.Source?p.SEARCH_SOURCES:p.SEARCH_NAMESPACES,icon:Io,value:y,onChange:e=>v(e.target.value.toLowerCase())})),!r&&e.createElement(E,{options:[{label:p.SOURCE,value:j.Source,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary},{label:p.NAMESPACE,value:j.Namespace,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary}],selected:f,setSelected:b})),e.createElement(ce,{$gap:36},e.createElement(S,{title:p.SELECT_ALL,initialValue:u,onChange:m,disabled:!!d}),e.createElement(S,{title:p.ONLY_SELECTED,initialValue:C,onChange:$}),e.createElement(S,{title:p.ONLY_RUNNING_INSTANCES,initialValue:k,onChange:w}))),e.createElement(le,null),e.createElement(Dl,{isModal:t,...s})))});_l.displayName=_l.name;const Gl=({fetchSingleNamespace:t,persistSources:o})=>{const{currentModal:i,setCurrentModal:a}=Z(),l=i===j.Source,r=()=>{a("")},s=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();o(e,t),r()}},c=n(null);return q({key:"Enter",active:l},s),l?e.createElement(ee,{isOpen:l,onClose:r,header:{title:"Add Source"},actionComponent:e.createElement(te,{buttons:[{label:"DONE",variant:"primary",onClick:s}]})},e.createElement(_l,{ref:c,isModal:!0,fetchSingleNamespace:t})):null},Jl=e=>{const t=[{key:"checkbox-and-icon",title:""},{key:"name",title:p.NAME,sortable:!0},{key:"kind",title:"Kind",sortable:!0}];return e||t.push({key:"namespace",title:p.NAMESPACE,sortable:!0}),t.push({key:"containers",title:p.DETECTED_CONTAINERS}),t.push({key:"conditions",title:"Conditions"}),t.push({key:"throughput",title:"Throughput",sortable:!0}),t},Yl=({metrics:t,maxHeight:o,maxWidth:i})=>{const n=I.useTheme(),{isVm:a}=He(),r=he(),{isThisPending:c}=R(),{selectedStreamName:d}=ze(),{sources:u,sourcesLoading:m}=B(),{setDrawerType:h,setDrawerEntityId:g}=P(),{selectedSources:y,setSelectedSources:f}=jt(),{isAwaitingInstrumentation:b,sourcesToCreate:x,sourcesCreated:C,sourcesToDelete:$,sourcesDeleted:k}=We(),S=l(()=>{const e=(e,t)=>e>0&&Math.floor(100/e*t)||1;return x?e(x,C):$?e($,k):1},[x,C,$,k]),w=l(()=>Ve(u,d),[u,d]),D=l(()=>Ri({instrumentationRules:[],sources:Be(w,r),actions:[],destinations:[],searchText:r.searchText,selectedCategory:j.Source}).searchResults.find(({category:e})=>e===j.Source)?.entities||[],[w,r]),[N,E]=l(()=>{let e=0;return Object.values(y).forEach(t=>{e+=t.length}),[0!==e,e]},[y]),O=s(e=>{if(e){const e={};D.forEach(t=>{const o={namespace:t.namespace,name:t.name,kind:t.kind};c({entityType:j.Source,entityId:o})||(e[t.namespace]?e[t.namespace].push(t):e[t.namespace]=[t])}),f(e)}else f({})},[D]),M=s(e=>{const{namespace:t,name:o,kind:i}=e,n={...y};n[t]||(n[t]=[]);const a=n[t].findIndex(e=>e.name===o&&e.kind===i);-1===a?n[t].push(e):n[t].splice(a,1),f(n)},[y]),A=l(()=>D.map(o=>{const i=Vt(o),a=JSON.stringify(i),{hasErrors:l,hasWarnings:r,hasDisableds:s}=re(o.conditions||[]),d=c({entityType:j.Source,entityId:i}),u=!!y[i.namespace]?.find(e=>e.namespace===i.namespace&&e.name===i.name&&e.kind===i.kind);return{status:l?V.Error:r?V.Warning:void 0,faded:s,onClick:()=>{h(j.Source),g(i)},cells:[{columnKey:"checkbox-and-icon",component:()=>e.createElement(ce,{$gap:16},e.createElement(v,{disabled:d,value:u,onChange:()=>M(o)}),e.createElement(so,{icons:Le(o.containers),id:a}))},{columnKey:"name",value:ve(o,j.Source,{extended:!0})},{columnKey:"kind",value:o.kind,textColor:n.text.info},{columnKey:"namespace",value:o.namespace,textColor:n.text.info},{columnKey:"throughput",value:Oe(Et(t,j.Source,i).throughput),textColor:n.text.info},{columnKey:"conditions",component:()=>e.createElement(Ai,{conditions:o.conditions||[],id:a})},{columnKey:"containers",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:V.Info,title:co(o.containers),withBorder:!0}))}]}}),[D,y,t,M]),{badge:F,badgeTooltip:L}=l(()=>D.length!==w.length?{badge:`${D.length}/${w.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:w.length,badgeTooltip:void 0},[D,w]);return e.createElement(be,{$maxWidth:i},e.createElement(xe,null,e.createElement(v,{partiallyChecked:N&&D?.length!==E,value:N&&D?.length===E,onChange:O,disabled:!D?.length}),e.createElement(Ce,{icon:$e(j.Source),title:p.SOURCES,badge:F,badgeTooltip:L,loading:m||b})),e.createElement(ke,{$maxHeight:o},e.createElement(Se,{columns:Jl(a),rows:A})),b&&!A.length?e.createElement(we,{style:{marginTop:"2rem",gap:"24px"}},e.createElement(Ne,{width:420}),e.createElement(ce,{$gap:16},e.createElement(T,{color:n.text.info},x?"Instrumenting":"Uninstrumenting"," workloads..."),e.createElement(Te,{label:`${S}%`}))):A.length?null:e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(De,null)))},Ql=({expiresAt:t})=>{const o=I.useTheme(),i=Bt().format(t),n=new Date(t).toDateString().split(" ").slice(1).join(" "),a=uo(t,0)?o.text.error:uo(t,6048e5)?o.text.warning:o.text.success;return e.createElement(T,{size:14,color:a},i," (",n,")")},Xl=d.div`
486
+ `,ql=i(({isModal:t,fetchSingleNamespace:o,onClickSummary:i},a)=>{const l=I.useTheme(),{isVm:r}=He(),s=no({fetchSingleNamespace:o}),{selectedSources:c,fetchingNamespace:d,selectedAllNamespaces:u,onSelectAllNamespaces:m,getApiSourcesPayload:h,getApiFutureAppsPayload:g,searchText:y,setSearchText:v,searchBy:f,setSearchBy:b,showSelectedOnly:C,setShowSelectedOnly:k,showRunningOnly:w,setShowRunningOnly:$}=s;n(a,()=>({getFormValues:()=>({apps:h(),futureApps:g()})}));const D=Object.values(c).reduce((e,t)=>e+t.filter(e=>e.selected).length,0);return e.createElement(oe,{$isNotModal:!t},e.createElement(X,{$gap:12},e.createElement(X,{$gap:24},i&&e.createElement(gt,{onClick:i}),e.createElement(O,{title:p.SELECT_SOURCES,badgeLabel:D,description:p.SELECT_SOURCES_DESCRIPTION}),e.createElement(ce,{$justifyContent:"space-between"},e.createElement(Pl,{$fullWidth:r},e.createElement(x,{placeholder:f===B.Source?p.SEARCH_SOURCES:p.SEARCH_NAMESPACES,icon:To,value:y,onChange:e=>v(e.target.value.toLowerCase())})),!r&&e.createElement(E,{options:[{label:p.SOURCE,value:B.Source,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary},{label:p.NAMESPACE,value:B.Namespace,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary}],selected:f,setSelected:b})),e.createElement(ce,{$gap:36},e.createElement(S,{title:p.SELECT_ALL,initialValue:u,onChange:m,disabled:!!d}),e.createElement(S,{title:p.ONLY_SELECTED,initialValue:C,onChange:k}),e.createElement(S,{title:p.ONLY_RUNNING_INSTANCES,initialValue:w,onChange:$}))),e.createElement(le,null),e.createElement(vl,{isModal:t,...s})))});ql.displayName=ql.name;const Kl=({fetchSingleNamespace:t,persistSources:o})=>{const{currentModal:i,setCurrentModal:n}=Z(),l=i===B.Source,r=()=>{n("")},s=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();o(e,t),r()}},c=a(null);return q({key:"Enter",active:l},s),l?e.createElement(ee,{isOpen:l,onClose:r,header:{title:"Add Source"},actionComponent:e.createElement(te,{buttons:[{label:"DONE",variant:"primary",onClick:s}]})},e.createElement(ql,{ref:c,isModal:!0,fetchSingleNamespace:t})):null},jl=e=>{const t=[{key:"checkbox-and-icon",title:""},{key:"name",title:p.NAME,sortable:!0},{key:"kind",title:"Kind",sortable:!0}];return e||t.push({key:"namespace",title:p.NAMESPACE,sortable:!0}),t.push({key:"containers",title:p.DETECTED_CONTAINERS}),t.push({key:"conditions",title:"Conditions"}),t.push({key:"throughput",title:"Throughput",sortable:!0}),t},Vl=({metrics:t,maxHeight:o,maxWidth:i})=>{const a=I.useTheme(),{isVm:n}=He(),r=he(),{isThisPending:c}=R(),{selectedStreamName:d}=Ue(),{sources:u,sourcesLoading:m}=U(),{setDrawerType:h,setDrawerEntityId:g}=P(),{selectedSources:y,setSelectedSources:f}=Ae(),{isAwaitingInstrumentation:b,sourcesToCreate:x,sourcesCreated:C,sourcesToDelete:k,sourcesDeleted:w}=Me(),S=l(()=>{const e=(e,t)=>e>0&&Math.floor(100/e*t)||1;return x?e(x,C):k?e(k,w):1},[x,C,k,w]),$=l(()=>Ge(u,d),[u,d]),D=l(()=>Mi({instrumentationRules:[],sources:_e($,r),actions:[],destinations:[],searchText:r.searchText,selectedCategory:B.Source}).searchResults.find(({category:e})=>e===B.Source)?.entities||[],[$,r]),[N,E]=l(()=>{let e=0;return Object.values(y).forEach(t=>{e+=t.length}),[0!==e,e]},[y]),O=s(e=>{if(e){const e={};D.forEach(t=>{const o={namespace:t.namespace,name:t.name,kind:t.kind};c({entityType:B.Source,entityId:o})||(e[t.namespace]?e[t.namespace].push(t):e[t.namespace]=[t])}),f(e)}else f({})},[D]),A=s(e=>{const{namespace:t,name:o,kind:i}=e,a={...y};a[t]||(a[t]=[]);const n=a[t].findIndex(e=>e.name===o&&e.kind===i);-1===n?a[t].push(e):a[t].splice(n,1),f(a)},[y]),M=l(()=>D.map(o=>{const i=Vt(o),n=JSON.stringify(i),{hasErrors:l,hasWarnings:r,hasDisableds:s}=re(o.conditions||[]),d=c({entityType:B.Source,entityId:i}),u=!!y[i.namespace]?.find(e=>e.namespace===i.namespace&&e.name===i.name&&e.kind===i.kind);return{status:l?H.Error:r?H.Warning:void 0,faded:s,onClick:()=>{h(B.Source),g(i)},cells:[{columnKey:"checkbox-and-icon",component:()=>e.createElement(ce,{$gap:16},e.createElement(v,{disabled:d,value:u,onChange:()=>A(o)}),e.createElement(lo,{icons:ze(o.containers),id:n}))},{columnKey:"name",value:ve(o,B.Source,{extended:!0})},{columnKey:"kind",value:o.kind,textColor:a.text.info},{columnKey:"namespace",value:o.namespace,textColor:a.text.info},{columnKey:"throughput",value:qe(Tt(t,B.Source,i).throughput),textColor:a.text.info},{columnKey:"conditions",component:()=>e.createElement(Oi,{conditions:o.conditions||[],id:n})},{columnKey:"containers",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:H.Info,title:ro(o.containers),withBorder:!0}))}]}}),[D,y,t,A]),{badge:F,badgeTooltip:L}=l(()=>D.length!==$.length?{badge:`${D.length}/${$.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:$.length,badgeTooltip:void 0},[D,$]);return e.createElement(be,{$maxWidth:i},e.createElement(xe,null,e.createElement(v,{partiallyChecked:N&&D?.length!==E,value:N&&D?.length===E,onChange:O,disabled:!D?.length}),e.createElement(Ce,{icon:ke(B.Source),title:p.SOURCES,badge:F,badgeTooltip:L,loading:m||b})),e.createElement(we,{$maxHeight:o},e.createElement(Se,{columns:jl(n),rows:M})),b&&!M.length?e.createElement($e,{style:{marginTop:"2rem",gap:"24px"}},e.createElement(Ne,{width:420}),e.createElement(ce,{$gap:16},e.createElement(T,{color:a.text.info},x?"Instrumenting":"Uninstrumenting"," workloads..."),e.createElement(Te,{label:`${S}%`}))):M.length?null:e.createElement($e,{style:{marginTop:"2rem"}},e.createElement(De,null)))},zl=({expiresAt:t})=>{const o=I.useTheme(),i=zt().format(t),a=new Date(t).toDateString().split(" ").slice(1).join(" "),n=so(t,0)?o.text.error:so(t,6048e5)?o.text.warning:o.text.success;return e.createElement(T,{size:14,color:n},i," (",a,")")},Bl=d.div`
399
487
  position: relative;
400
- `,Zl=({token:o,saveToken:i})=>{const n=I.useTheme(),{isCopied:a,clickCopy:l}=po(),{formData:r,handleFormChange:s,resetFormData:c}=mo({token:o}),[d,u]=t(!1),p=()=>{u(!1),c()},m=me(V.Success,n);return e.createElement(ce,{$gap:0},e.createElement(pt,{size:32,onClick:()=>l(o)},a?e.createElement(m,null):e.createElement(Uo,null)),e.createElement(le,{orientation:"vertical",length:"12px"}),e.createElement(Xl,null,e.createElement(pt,{size:32,onClick:()=>{u(!0)}},e.createElement(Do,null)),d&&e.createElement(ho,{flipX:!0,clientX:36,isOpen:d,onClose:p,onSave:()=>{i(r.token).then(p)},title:"Enter a new API Token",titleTooltip:"Contact us to generate a new one"},e.createElement(x,{placeholder:"API Token",type:"password",value:r.token,onChange:e=>s("token",e.target.value)}))))},er=({tokens:t,saveToken:o})=>e.createElement(Y,{title:"Authorization Tokens",titleBadge:t.length,data:[{type:m.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:_o},{columnKey:"name",value:t},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>e.createElement(Ql,{expiresAt:n})},{columnKey:"actions",component:()=>e.createElement(Zl,{token:i,saveToken:o})}]}))}}]}),tr=({fetchDescribeOdigos:i})=>{const[n,a]=t(null);if(o(()=>{i().then(({data:e})=>{a(e?.describeOdigos||null)})},[i]),!n)return e.createElement(we,null,e.createElement(xt,null));const l=t=>t?.name?[e.createElement(le,{key:`divider-${t.name}`}),e.createElement(Zt,{key:`describe-row-${t.name}`,title:t.name,subTitle:t.explain||void 0,value:{status:t.status||(to(t.value)?oo(t.value)?V.Success:V.Error:V.Default),text:t.value}})]:[];return e.createElement(e.Fragment,null,e.createElement(Y,{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(Y,{title:"Cluster Collector",withExtend:!0},Object.values(n?.clusterCollector||{}).map(l)),e.createElement(Y,{title:"Node Collector",withExtend:!0},Object.values(n?.nodeCollector||{}).map(l)))},or=d.div`
488
+ `,Hl=({token:o,saveToken:i})=>{const a=I.useTheme(),{isCopied:n,clickCopy:l}=co(),{formData:r,handleFormChange:s,resetFormData:c}=uo({token:o}),[d,u]=t(!1),p=()=>{u(!1),c()},m=me(H.Success,a);return e.createElement(ce,{$gap:0},e.createElement(pt,{size:32,onClick:()=>l(o)},n?e.createElement(m,null):e.createElement(Ho,null)),e.createElement(le,{orientation:"vertical",length:"12px"}),e.createElement(Bl,null,e.createElement(pt,{size:32,onClick:()=>{u(!0)}},e.createElement(So,null)),d&&e.createElement(po,{flipX:!0,clientX:36,isOpen:d,onClose:p,onSave:()=>{i(r.token).then(p)},title:"Enter a new API Token",titleTooltip:"Contact us to generate a new one"},e.createElement(x,{placeholder:"API Token",type:"password",value:r.token,onChange:e=>s("token",e.target.value)}))))},Ul=({tokens:t,saveToken:o})=>e.createElement(Y,{title:"Authorization Tokens",titleBadge:t.length,data:[{type:m.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:a})=>({cells:[{columnKey:"icon",icon:Uo},{columnKey:"name",value:t},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>e.createElement(zl,{expiresAt:a})},{columnKey:"actions",component:()=>e.createElement(Hl,{token:i,saveToken:o})}]}))}}]}),Wl=({fetchDescribeOdigos:i})=>{const[a,n]=t(null);if(o(()=>{i().then(({data:e})=>{n(e?.describeOdigos||null)})},[i]),!a)return e.createElement($e,null,e.createElement(Re,null));const l=t=>t?.name?[e.createElement(le,{key:`divider-${t.name}`}),e.createElement(Qt,{key:`describe-row-${t.name}`,title:t.name,subTitle:t.explain||void 0,value:{status:t.status||(Zt(t.value)?eo(t.value)?H.Success:H.Error:H.Default),text:t.value}})]:[];return e.createElement(e.Fragment,null,e.createElement(Y,{title:"General Information",withExtend:!0,initialExtended:!0,data:[{title:a?.odigosVersion?.name,value:a?.odigosVersion?.value},{title:a?.kubernetesVersion?.name,value:a?.kubernetesVersion?.value},{title:a?.installationMethod?.name,value:a?.installationMethod?.value},{title:a?.tier?.name,value:a?.tier?.value},{title:"# of sources",value:a?.numberOfSources?.toString()},{title:"# of destinations",value:a?.numberOfDestinations?.toString()}]}),e.createElement(Y,{title:"Cluster Collector",withExtend:!0},Object.values(a?.clusterCollector||{}).map(l)),e.createElement(Y,{title:"Node Collector",withExtend:!0},Object.values(a?.nodeCollector||{}).map(l)))},_l=d.div`
401
489
  display: flex;
402
490
  flex-direction: column;
403
491
  gap: 12px;
404
- `,ir="System Overview",nr=({tokens:o,saveToken:i,fetchDescribeOdigos:n})=>{const[a,l]=t(!1),r=()=>l(e=>!e);return e.createElement(e.Fragment,null,e.createElement(pt,{key:ir,onClick:r,tooltip:ir},e.createElement(Go,{size:18})),e.createElement(H,{width:"750px",isOpen:a,onClose:r,header:{icons:[Go],title:ir},footer:{isOpen:!1}},e.createElement(or,null,!!o?.length&&e.createElement(er,{tokens:o,saveToken:i}),e.createElement(tr,{fetchDescribeOdigos:n}))))};var ar;!function(e){e.General="General",e.Ui="UI",e.Rollback="Rollback",e.CollectorNode="Collector Node",e.CollectorGateway="Collector Gateway"}(ar||(ar={}));const lr=d.div`
492
+ `,Gl="System Overview",Jl=({tokens:o,saveToken:i,fetchDescribeOdigos:a})=>{const[n,l]=t(!1),r=()=>l(e=>!e);return e.createElement(e.Fragment,null,e.createElement(pt,{key:Gl,onClick:r,tooltip:Gl},e.createElement(Wo,{size:18})),e.createElement(j,{width:"750px",isOpen:n,onClose:r,header:{icons:[Wo],title:Gl},footer:{isOpen:!1}},e.createElement(_l,null,!!o?.length&&e.createElement(Ul,{tokens:o,saveToken:i}),e.createElement(Wl,{fetchDescribeOdigos:a}))))};var Yl;!function(e){e.General="General",e.Ui="UI",e.Rollback="Rollback",e.CollectorNode="Collector Node",e.CollectorGateway="Collector Gateway"}(Yl||(Yl={}));const Ql=d.div`
405
493
  align-self: stretch;
406
494
  display: flex;
407
495
  flex-direction: column;
@@ -410,25 +498,25 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
410
498
  padding: 16px;
411
499
  border-radius: 24px;
412
500
  background: ${({theme:e})=>e.colors.secondary+I.opacity.hex["004"]};
413
- `,rr=d(T)`
501
+ `,Xl=d(T)`
414
502
  color: ${({theme:e})=>e.text.secondary};
415
503
  font-size: 18px;
416
504
  font-weight: 600;
417
505
  line-height: 20px;
418
- `,sr=d(ce)`
506
+ `,Zl=d(ce)`
419
507
  width: 100%;
420
508
  gap: 12px;
421
509
  align-items: flex-start;
422
510
  justify-content: space-between;
423
- `,cr=i(({isAdvanced:t,formData:o,handleFormChange:i},n)=>e.createElement(lr,{ref:n,id:ar.Ui},e.createElement(sr,null,e.createElement(rr,null,"UI")),e.createElement(x,{title:"Central Backend URL",tooltip:'When running the Centralized UI, you need to specify the URL of the central backend. <a href="https://docs.odigos.io/features/central">Learn more</a>.',required:!0,value:o.centralBackendURL||"",onChange:e=>{const{value:t}=e.target;i("centralBackendURL",t||null)}}),e.createElement(x,{title:"OIDC Tenant URL",tooltip:'If you need to restrict access to the Community UI, you can setup an OIDC provider. To do so you need to specify the URL of the OIDC tenant. <a href="https://docs.odigos.io/features/oidc">Learn more</a>.',required:!0,value:o.oidc?.tenantUrl||"",onChange:e=>{const{value:t}=e.target;i("oidc.tenantUrl",t||null)}}),e.createElement(x,{title:"OIDC Client ID",tooltip:'If you need to restrict access to the Community UI, you can setup an OIDC provider. To do so you need to specify the Client ID of the OIDC application. <a href="https://docs.odigos.io/features/oidc">Learn more</a>.',required:!0,value:o.oidc?.clientId||"",onChange:e=>{const{value:t}=e.target;i("oidc.clientId",t||null)}}),e.createElement(x,{title:"OIDC Client Secret",tooltip:'If you need to restrict access to the Community UI, you can setup an OIDC provider. To do so you need to specify the Client Secret of the OIDC application. <a href="https://docs.odigos.io/features/oidc">Learn more</a>.',type:"password",required:!0,value:o.oidc?.clientSecret||"",onChange:e=>{const{value:t}=e.target;i("oidc.clientSecret",t||null)}}),t&&e.createElement(x,{status:V.Warning,title:"(Advanced) UI Pagination Limit",tooltip:"The pagination limit for fetching data from the UI backend. A larger limit means more data will be fetched at once, reducing the number of requests to the backend. This might increase or decrease the performance of the UI - depending on your environment.",type:"number",required:!0,value:o.uiPaginationLimit?.toString()||"",onChange:e=>{const{value:t}=e.target;i("uiPaginationLimit",""===t?null:Number(t))}})));cr.displayName=cr.name;const dr=[{id:go.VirtualDevice,value:"Virtual Device"},{id:go.HostPath,value:"Host Path"},{id:go.InitContainer,value:"Init Container"}],ur=[{id:yo.Loader,value:"Loader"},{id:yo.PodManifest,value:"Pod Manifest"},{id:yo.LoaderFallbackToPodManifest,value:"Loader Fallback to Pod Manifest"}],pr=[{id:vo.CodeAttributes,value:"Code Attributes"},{id:vo.FullPayloadCollection,value:"Full Payload Collection"},{id:vo.DbPayloadCollection,value:"DB Payload Collection"},{id:vo.QueryOperationDetector,value:"Query Operation Detector"},{id:vo.AllowConcurrentAgents,value:"Allow Concurrent Agents"},{id:vo.JavaEbpfInstrumentations,value:"Java EBPF Instrumentations"},{id:vo.JavaNativeInstrumentations,value:"Java Native Instrumentations"},{id:vo.SizeS,value:"Size S"},{id:vo.SizeM,value:"Size M"},{id:vo.SizeL,value:"Size L"}],mr=i(({isAdvanced:t,formData:o,handleFormChange:i},n)=>e.createElement(lr,{ref:n,id:ar.General},e.createElement(sr,null,e.createElement(rr,null,"General")),e.createElement(x,{title:"Cluster Name",tooltip:'Name of the cluster, this is optional, but required in the Centralized UI. <a href="https://docs.odigos.io/features/central">Learn more</a>.',required:!0,value:o.clusterName||"",onChange:e=>{const{value:t}=e.target;i("clusterName",t||null)}}),e.createElement(S,{title:"Enable the Karpenter Integration",tooltip:'<a href="https://docs.odigos.io/setup/odigos-with-karpenter">Learn how to configure Karpenter</a>. Once the Karpenter tainting setup is complete, inform Odigos to disable node affinity and rely on the taint mechanism.',initialValue:o.karpenterEnabled||!1,onChange:e=>i("karpenterEnabled",e)}),e.createElement(S,{title:"Allow Odigos Alongisde Other Agents",tooltip:"By default Odigos does not instrument applications that are already instrumented by other agents. If you want to allow Odigos to instrument applications that are already instrumented by other agents, enable this option. Note: this is not recommended and should be used only if you know what you are doing.",initialValue:o.allowConcurrentAgents||!1,onChange:e=>i("allowConcurrentAgents",e)}),e.createElement(S,{title:"Disable Automatic Rollout",tooltip:"By default, Odigos automatically rolls out the pods after the instrumentation is complete. If you want to disable rollouts and do it manually, toggle this option.",initialValue:o.rollout?.automaticRolloutDisabled||!1,onChange:e=>i("rollout.automaticRolloutDisabled",e)}),e.createElement(x,{title:"Image Prefix",tooltip:"Docker image prefix for all Odigos components. This is disabled because this setting requires a CLI update.",disabled:!0,required:!0,value:o.imagePrefix||"",onChange:e=>{const{value:t}=e.target;i("imagePrefix",t||null)}}),e.createElement(w,{title:"Node Selector",tooltip:"NodeSelector is a map of key-value Kubernetes NodeSelector labels to apply to all Odigos components. Note that Odigos will only be able to instrument applications on the same node. This setting can be applied only via the CLI.",disabled:!0,required:!0,value:Object.entries(o.nodeSelector||{}).map(([e,t])=>({key:e,value:t}))}),e.createElement(it,{title:"Profiles",tooltip:"Enable custom profiles to customize the Odigos instrumentation.",isMulti:!0,options:pr,value:pr.filter(e=>o.profiles?.includes(e.id)),onSelect:e=>i("profiles",[...o.profiles||[],e.id]),onDeselect:e=>i("profiles",o.profiles?.filter(t=>t!==e.id)||[])}),e.createElement(sr,null,e.createElement(D,{title:"Ignored Namespaces",tooltip:"List of namespaces to exclude from instrumentation. Note: you cannot remove the default namespaces from the list, but you are able to add more namespaces.",required:!0,value:o.ignoredNamespaces||[],onChange:e=>i("ignoredNamespaces",e)}),e.createElement(D,{title:"Ignored Containers",tooltip:"List of container names to exclude from instrumentation, this is a global setting and will be applied to all applications",required:!0,value:o.ignoredContainers||[],onChange:e=>i("ignoredContainers",e)})),t&&e.createElement(e.Fragment,null,e.createElement(it,{status:V.Warning,title:"(Advanced) Mount Method",tooltip:'For Odigos agents to run inside instrumented pod containers, certain files must be mounted into the container. In Kubernetes, these files are mounted under `/var/odigos` directory, with subdirectories for each agent. <a href="https://docs.odigos.io/instrumentations/configuration/mount-method#agent-mount-method">Learn more</a>.',options:dr,required:!0,value:dr.find(e=>e.id===o.mountMethod)||void 0,onSelect:e=>i("mountMethod",e.id)}),e.createElement(it,{status:V.Warning,title:"(Advanced) Agent Envs Injection Method",tooltip:"In order for Odigos to instrument applications, it needs to inject environment variables into the application. This setting controls how Odigos injects these environment variables.",options:ur,required:!0,value:ur.find(e=>e.id===o.agentEnvVarsInjectionMethod)||void 0,onSelect:e=>i("agentEnvVarsInjectionMethod",e.id)}),e.createElement(x,{status:V.Warning,title:"(Advanced) Odiglet Health Probe Port",tooltip:"If the Odiglet is running with a host network, it may conflict with the port of other processes. This setting allows you to specify a different port for the health probe.",type:"number",required:!0,value:o.odigletHealthProbeBindPort?.toString()||"",onChange:e=>{const{value:t}=e.target;i("odigletHealthProbeBindPort",""===t?null:Number(t))}}),e.createElement(x,{status:V.Warning,title:"(Advanced) Custom Container Runtime Socket Path",tooltip:"If containerd is located in a different path than the default supported path by Odigos, then you can specify the socket path here.",required:!0,value:o.customContainerRuntimeSocketPath||"",onChange:e=>{const{value:t}=e.target;i("customContainerRuntimeSocketPath",t||null)}}))));mr.displayName=mr.name;const hr=i(({formData:t,handleFormChange:o},i)=>e.createElement(lr,{ref:i,id:ar.Rollback},e.createElement(rr,null,"Rollback"),e.createElement(S,{title:"Rollback Disabled",tooltip:"Disable rollback",initialValue:t.rollbackDisabled||!1,onChange:e=>o("rollbackDisabled",e)}),e.createElement(sr,null,e.createElement(x,{title:"Rollback Grace Time",tooltip:"This is the amount of time that a pod should be in the `CrashLoopBackoff` state before it is rolled back. Pods that are in the `CrashLoopBackoff` state for longer than this time will be rolled back.",required:!0,value:t.rollbackGraceTime||"",onChange:e=>{const{value:t}=e.target;o("rollbackGraceTime",t||null)}}),e.createElement(x,{title:"Rollback Stability Window",tooltip:"This is the time-window in which the pod should be in the `CrashLoopBackoff` state before it is rolled back. Pods that are in the `CrashLoopBackoff` state after this window will not be rolled back.",required:!0,value:t.rollbackStabilityWindow||"",onChange:e=>{const{value:t}=e.target;o("rollbackStabilityWindow",t||null)}}))));hr.displayName=hr.name;const gr=i(({isAdvanced:t,formData:o,handleFormChange:i},n)=>e.createElement(lr,{ref:n,id:ar.CollectorNode},e.createElement(sr,null,e.createElement(rr,null,"Collector Node")),e.createElement(sr,null,e.createElement(x,{title:"Request Memory",tooltip:"You can optionally specify how much memory the collector node should request (in megabytes).",type:"number",required:!0,value:o.collectorNode?.requestMemoryMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.requestMemoryMiB",""===t?null:Number(t))}}),e.createElement(x,{title:"Limit Memory",tooltip:"You can optionally specify how much memory the collector node should limit (in megabytes).",type:"number",required:!0,value:o.collectorNode?.limitMemoryMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.limitMemoryMiB",""===t?null:Number(t))}})),e.createElement(sr,null,e.createElement(x,{title:"Request CPU",tooltip:"You can optionally specify how much CPU the collector node should request (in millicores).",type:"number",required:!0,value:o.collectorNode?.requestCPUm?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.requestCPUm",""===t?null:Number(t))}}),e.createElement(x,{title:"Limit CPU",tooltip:"You can optionally specify how much CPU the collector node should limit (in millicores).",type:"number",required:!0,value:o.collectorNode?.limitCPUm?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.limitCPUm",""===t?null:Number(t))}})),t&&e.createElement(e.Fragment,null,e.createElement(x,{status:V.Warning,title:"(Advanced) K8s Node Logs Directory",tooltip:"If `/var/log` is a symlink, you can specify the target directory for Kubernetes logs here.",required:!0,value:o.collectorNode?.k8sNodeLogsDirectory||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.k8sNodeLogsDirectory",t||null)}}),e.createElement(x,{status:V.Warning,title:"(Advanced) Own Metrics Port",tooltip:"If the collector node is running with a host network, it may conflict with the port of other processes. This setting allows you to specify a different port for the own metrics.",type:"number",required:!0,value:o.collectorNode?.collectorOwnMetricsPort?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.collectorOwnMetricsPort",""===t?null:Number(t))}}),e.createElement(sr,null,e.createElement(x,{status:V.Warning,title:"(Advanced) Memory Limiter Limit",tooltip:"You can optionally specify how much memory the collector node should limit (in megabytes).",type:"number",required:!0,value:o.collectorNode?.memoryLimiterLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.memoryLimiterLimitMiB",""===t?null:Number(t))}}),e.createElement(x,{status:V.Warning,title:"(Advanced) Memory Limiter Spike Limit",tooltip:"You can optionally specify how much memory the collector node should limit (in megabytes).",type:"number",required:!0,value:o.collectorNode?.memoryLimiterSpikeLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.memoryLimiterSpikeLimitMiB",""===t?null:Number(t))}})),e.createElement(x,{status:V.Warning,title:"(Advanced) Go Memory Limit",tooltip:"Sets the GOMEMLIMIT environment variable to control Go runtime memory usage. This soft memory limit helps the garbage collector prevent out-of-memory conditions in Kubernetes by triggering more aggressive garbage collection as memory usage approaches the limit (in megabytes).",type:"number",required:!0,value:o.collectorNode?.goMemLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.goMemLimitMiB",""===t?null:Number(t))}}))));gr.displayName=gr.name;const yr=i(({isAdvanced:t,formData:o,handleFormChange:i},n)=>e.createElement(lr,{ref:n,id:ar.CollectorGateway},e.createElement(sr,null,e.createElement(rr,null,"Collector Gateway")),e.createElement(sr,null,e.createElement(x,{title:"Autoscaler Min. Replicas",tooltip:"You can optionally specify the minimum number of replicas for the collector gateway.",type:"number",required:!0,value:o.collectorGateway?.minReplicas?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.minReplicas",""===t?null:Number(t))}}),e.createElement(x,{title:"Autoscaler Max. Replicas",tooltip:"You can optionally specify the maximum number of replicas for the collector gateway.",type:"number",required:!0,value:o.collectorGateway?.maxReplicas?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.maxReplicas",""===t?null:Number(t))}})),e.createElement(sr,null,e.createElement(x,{title:"Request Memory",tooltip:"You can optionally specify how much memory the collector gateway should request (in megabytes).",type:"number",required:!0,value:o.collectorGateway?.requestMemoryMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.requestMemoryMiB",""===t?null:Number(t))}}),e.createElement(x,{title:"Limit Memory",tooltip:"You can optionally specify how much memory the collector gateway should limit (in megabytes).",type:"number",required:!0,value:o.collectorGateway?.limitMemoryMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.limitMemoryMiB",""===t?null:Number(t))}})),e.createElement(sr,null,e.createElement(x,{title:"Request CPU",tooltip:"You can optionally specify how much CPU the collector gateway should request (in millicores).",type:"number",required:!0,value:o.collectorGateway?.requestCPUm?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.requestCPUm",""===t?null:Number(t))}}),e.createElement(x,{title:"Limit CPU",tooltip:"You can optionally specify how much CPU the collector gateway should limit (in millicores).",type:"number",required:!0,value:o.collectorGateway?.limitCPUm?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.limitCPUm",""===t?null:Number(t))}})),t&&e.createElement(e.Fragment,null,e.createElement(sr,null,e.createElement(x,{status:V.Warning,title:"(Advanced) Memory Limiter Limit",tooltip:"You can optionally specify how much memory the collector gateway should limit (in megabytes).",type:"number",required:!0,value:o.collectorGateway?.memoryLimiterLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.memoryLimiterLimitMiB",""===t?null:Number(t))}}),e.createElement(x,{status:V.Warning,title:"(Advanced) Memory Limiter Spike Limit",tooltip:"You can optionally specify how much memory the collector gateway should limit (in megabytes).",type:"number",required:!0,value:o.collectorGateway?.memoryLimiterSpikeLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.memoryLimiterSpikeLimitMiB",""===t?null:Number(t))}})),e.createElement(x,{status:V.Warning,title:"(Advanced) Go Memory Limit",tooltip:"Sets the GOMEMLIMIT environment variable to control Go runtime memory usage. This soft memory limit helps the garbage collector prevent out-of-memory conditions in Kubernetes by triggering more aggressive garbage collection as memory usage approaches the limit (in megabytes).",type:"number",required:!0,value:o.collectorGateway?.goMemLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.goMemLimitMiB",""===t?null:Number(t))}}))));yr.displayName=yr.name;const vr=d.div`
511
+ `,er=i(({isAdvanced:t,formData:o,handleFormChange:i},a)=>e.createElement(Ql,{ref:a,id:Yl.Ui},e.createElement(Zl,null,e.createElement(Xl,null,"UI")),e.createElement(x,{title:"Central Backend URL",tooltip:'When running the Centralized UI, you need to specify the URL of the central backend. <a href="https://docs.odigos.io/features/central">Learn more</a>.',required:!0,value:o.centralBackendURL||"",onChange:e=>{const{value:t}=e.target;i("centralBackendURL",t||null)}}),e.createElement(x,{title:"OIDC Tenant URL",tooltip:'If you need to restrict access to the Community UI, you can setup an OIDC provider. To do so you need to specify the URL of the OIDC tenant. <a href="https://docs.odigos.io/features/oidc">Learn more</a>.',required:!0,value:o.oidc?.tenantUrl||"",onChange:e=>{const{value:t}=e.target;i("oidc.tenantUrl",t||null)}}),e.createElement(x,{title:"OIDC Client ID",tooltip:'If you need to restrict access to the Community UI, you can setup an OIDC provider. To do so you need to specify the Client ID of the OIDC application. <a href="https://docs.odigos.io/features/oidc">Learn more</a>.',required:!0,value:o.oidc?.clientId||"",onChange:e=>{const{value:t}=e.target;i("oidc.clientId",t||null)}}),e.createElement(x,{title:"OIDC Client Secret",tooltip:'If you need to restrict access to the Community UI, you can setup an OIDC provider. To do so you need to specify the Client Secret of the OIDC application. <a href="https://docs.odigos.io/features/oidc">Learn more</a>.',type:"password",required:!0,value:o.oidc?.clientSecret||"",onChange:e=>{const{value:t}=e.target;i("oidc.clientSecret",t||null)}}),t&&e.createElement(x,{status:H.Warning,title:"(Advanced) UI Pagination Limit",tooltip:"The pagination limit for fetching data from the UI backend. A larger limit means more data will be fetched at once, reducing the number of requests to the backend. This might increase or decrease the performance of the UI - depending on your environment.",type:"number",required:!0,value:o.uiPaginationLimit?.toString()||"",onChange:e=>{const{value:t}=e.target;i("uiPaginationLimit",""===t?null:Number(t))}})));er.displayName=er.name;const tr=[{id:mo.VirtualDevice,value:"Virtual Device"},{id:mo.HostPath,value:"Host Path"},{id:mo.InitContainer,value:"Init Container"}],or=[{id:ho.Loader,value:"Loader"},{id:ho.PodManifest,value:"Pod Manifest"},{id:ho.LoaderFallbackToPodManifest,value:"Loader Fallback to Pod Manifest"}],ir=[{id:go.CodeAttributes,value:"Code Attributes"},{id:go.FullPayloadCollection,value:"Full Payload Collection"},{id:go.DbPayloadCollection,value:"DB Payload Collection"},{id:go.QueryOperationDetector,value:"Query Operation Detector"},{id:go.AllowConcurrentAgents,value:"Allow Concurrent Agents"},{id:go.JavaEbpfInstrumentations,value:"Java EBPF Instrumentations"},{id:go.JavaNativeInstrumentations,value:"Java Native Instrumentations"},{id:go.SizeS,value:"Size S"},{id:go.SizeM,value:"Size M"},{id:go.SizeL,value:"Size L"}],ar=i(({isAdvanced:t,formData:o,handleFormChange:i},a)=>e.createElement(Ql,{ref:a,id:Yl.General},e.createElement(Zl,null,e.createElement(Xl,null,"General")),e.createElement(x,{title:"Cluster Name",tooltip:'Name of the cluster, this is optional, but required in the Centralized UI. <a href="https://docs.odigos.io/features/central">Learn more</a>.',required:!0,value:o.clusterName||"",onChange:e=>{const{value:t}=e.target;i("clusterName",t||null)}}),e.createElement(S,{title:"Enable the Karpenter Integration",tooltip:'<a href="https://docs.odigos.io/setup/odigos-with-karpenter">Learn how to configure Karpenter</a>. Once the Karpenter tainting setup is complete, inform Odigos to disable node affinity and rely on the taint mechanism.',initialValue:o.karpenterEnabled||!1,onChange:e=>i("karpenterEnabled",e)}),e.createElement(S,{title:"Allow Odigos Alongisde Other Agents",tooltip:"By default Odigos does not instrument applications that are already instrumented by other agents. If you want to allow Odigos to instrument applications that are already instrumented by other agents, enable this option. Note: this is not recommended and should be used only if you know what you are doing.",initialValue:o.allowConcurrentAgents||!1,onChange:e=>i("allowConcurrentAgents",e)}),e.createElement(S,{title:"Disable Automatic Rollout",tooltip:"By default, Odigos automatically rolls out the pods after the instrumentation is complete. If you want to disable rollouts and do it manually, toggle this option.",initialValue:o.rollout?.automaticRolloutDisabled||!1,onChange:e=>i("rollout.automaticRolloutDisabled",e)}),e.createElement(x,{title:"Image Prefix",tooltip:"Docker image prefix for all Odigos components. This is disabled because this setting requires a CLI update.",disabled:!0,required:!0,value:o.imagePrefix||"",onChange:e=>{const{value:t}=e.target;i("imagePrefix",t||null)}}),e.createElement($,{title:"Node Selector",tooltip:"NodeSelector is a map of key-value Kubernetes NodeSelector labels to apply to all Odigos components. Note that Odigos will only be able to instrument applications on the same node. This setting can be applied only via the CLI.",disabled:!0,required:!0,value:Object.entries(o.nodeSelector||{}).map(([e,t])=>({key:e,value:t}))}),e.createElement(at,{title:"Profiles",tooltip:"Enable custom profiles to customize the Odigos instrumentation.",isMulti:!0,options:ir,value:ir.filter(e=>o.profiles?.includes(e.id)),onSelect:e=>i("profiles",[...o.profiles||[],e.id]),onDeselect:e=>i("profiles",o.profiles?.filter(t=>t!==e.id)||[])}),e.createElement(Zl,null,e.createElement(D,{title:"Ignored Namespaces",tooltip:"List of namespaces to exclude from instrumentation. Note: you cannot remove the default namespaces from the list, but you are able to add more namespaces.",required:!0,value:o.ignoredNamespaces||[],onChange:e=>i("ignoredNamespaces",e)}),e.createElement(D,{title:"Ignored Containers",tooltip:"List of container names to exclude from instrumentation, this is a global setting and will be applied to all applications",required:!0,value:o.ignoredContainers||[],onChange:e=>i("ignoredContainers",e)})),t&&e.createElement(e.Fragment,null,e.createElement(at,{status:H.Warning,title:"(Advanced) Mount Method",tooltip:'For Odigos agents to run inside instrumented pod containers, certain files must be mounted into the container. In Kubernetes, these files are mounted under `/var/odigos` directory, with subdirectories for each agent. <a href="https://docs.odigos.io/instrumentations/configuration/mount-method#agent-mount-method">Learn more</a>.',options:tr,required:!0,value:tr.find(e=>e.id===o.mountMethod)||void 0,onSelect:e=>i("mountMethod",e.id)}),e.createElement(at,{status:H.Warning,title:"(Advanced) Agent Envs Injection Method",tooltip:"In order for Odigos to instrument applications, it needs to inject environment variables into the application. This setting controls how Odigos injects these environment variables.",options:or,required:!0,value:or.find(e=>e.id===o.agentEnvVarsInjectionMethod)||void 0,onSelect:e=>i("agentEnvVarsInjectionMethod",e.id)}),e.createElement(x,{status:H.Warning,title:"(Advanced) Odiglet Health Probe Port",tooltip:"If the Odiglet is running with a host network, it may conflict with the port of other processes. This setting allows you to specify a different port for the health probe.",type:"number",required:!0,value:o.odigletHealthProbeBindPort?.toString()||"",onChange:e=>{const{value:t}=e.target;i("odigletHealthProbeBindPort",""===t?null:Number(t))}}),e.createElement(x,{status:H.Warning,title:"(Advanced) Custom Container Runtime Socket Path",tooltip:"If containerd is located in a different path than the default supported path by Odigos, then you can specify the socket path here.",required:!0,value:o.customContainerRuntimeSocketPath||"",onChange:e=>{const{value:t}=e.target;i("customContainerRuntimeSocketPath",t||null)}}))));ar.displayName=ar.name;const nr=i(({formData:t,handleFormChange:o},i)=>e.createElement(Ql,{ref:i,id:Yl.Rollback},e.createElement(Xl,null,"Rollback"),e.createElement(S,{title:"Rollback Disabled",tooltip:"Disable rollback",initialValue:t.rollbackDisabled||!1,onChange:e=>o("rollbackDisabled",e)}),e.createElement(Zl,null,e.createElement(x,{title:"Rollback Grace Time",tooltip:"This is the amount of time that a pod should be in the `CrashLoopBackoff` state before it is rolled back. Pods that are in the `CrashLoopBackoff` state for longer than this time will be rolled back.",required:!0,value:t.rollbackGraceTime||"",onChange:e=>{const{value:t}=e.target;o("rollbackGraceTime",t||null)}}),e.createElement(x,{title:"Rollback Stability Window",tooltip:"This is the time-window in which the pod should be in the `CrashLoopBackoff` state before it is rolled back. Pods that are in the `CrashLoopBackoff` state after this window will not be rolled back.",required:!0,value:t.rollbackStabilityWindow||"",onChange:e=>{const{value:t}=e.target;o("rollbackStabilityWindow",t||null)}}))));nr.displayName=nr.name;const lr=i(({isAdvanced:t,formData:o,handleFormChange:i},a)=>e.createElement(Ql,{ref:a,id:Yl.CollectorNode},e.createElement(Zl,null,e.createElement(Xl,null,"Collector Node")),e.createElement(Zl,null,e.createElement(x,{title:"Request Memory",tooltip:"You can optionally specify how much memory the collector node should request (in megabytes).",type:"number",required:!0,value:o.collectorNode?.requestMemoryMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.requestMemoryMiB",""===t?null:Number(t))}}),e.createElement(x,{title:"Limit Memory",tooltip:"You can optionally specify how much memory the collector node should limit (in megabytes).",type:"number",required:!0,value:o.collectorNode?.limitMemoryMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.limitMemoryMiB",""===t?null:Number(t))}})),e.createElement(Zl,null,e.createElement(x,{title:"Request CPU",tooltip:"You can optionally specify how much CPU the collector node should request (in millicores).",type:"number",required:!0,value:o.collectorNode?.requestCPUm?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.requestCPUm",""===t?null:Number(t))}}),e.createElement(x,{title:"Limit CPU",tooltip:"You can optionally specify how much CPU the collector node should limit (in millicores).",type:"number",required:!0,value:o.collectorNode?.limitCPUm?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.limitCPUm",""===t?null:Number(t))}})),t&&e.createElement(e.Fragment,null,e.createElement(x,{status:H.Warning,title:"(Advanced) K8s Node Logs Directory",tooltip:"If `/var/log` is a symlink, you can specify the target directory for Kubernetes logs here.",required:!0,value:o.collectorNode?.k8sNodeLogsDirectory||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.k8sNodeLogsDirectory",t||null)}}),e.createElement(x,{status:H.Warning,title:"(Advanced) Own Metrics Port",tooltip:"If the collector node is running with a host network, it may conflict with the port of other processes. This setting allows you to specify a different port for the own metrics.",type:"number",required:!0,value:o.collectorNode?.collectorOwnMetricsPort?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.collectorOwnMetricsPort",""===t?null:Number(t))}}),e.createElement(Zl,null,e.createElement(x,{status:H.Warning,title:"(Advanced) Memory Limiter Limit",tooltip:"You can optionally specify how much memory the collector node should limit (in megabytes).",type:"number",required:!0,value:o.collectorNode?.memoryLimiterLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.memoryLimiterLimitMiB",""===t?null:Number(t))}}),e.createElement(x,{status:H.Warning,title:"(Advanced) Memory Limiter Spike Limit",tooltip:"You can optionally specify how much memory the collector node should limit (in megabytes).",type:"number",required:!0,value:o.collectorNode?.memoryLimiterSpikeLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.memoryLimiterSpikeLimitMiB",""===t?null:Number(t))}})),e.createElement(x,{status:H.Warning,title:"(Advanced) Go Memory Limit",tooltip:"Sets the GOMEMLIMIT environment variable to control Go runtime memory usage. This soft memory limit helps the garbage collector prevent out-of-memory conditions in Kubernetes by triggering more aggressive garbage collection as memory usage approaches the limit (in megabytes).",type:"number",required:!0,value:o.collectorNode?.goMemLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorNode.goMemLimitMiB",""===t?null:Number(t))}}))));lr.displayName=lr.name;const rr=i(({isAdvanced:t,formData:o,handleFormChange:i},a)=>e.createElement(Ql,{ref:a,id:Yl.CollectorGateway},e.createElement(Zl,null,e.createElement(Xl,null,"Collector Gateway")),e.createElement(Zl,null,e.createElement(x,{title:"Autoscaler Min. Replicas",tooltip:"You can optionally specify the minimum number of replicas for the collector gateway.",type:"number",required:!0,value:o.collectorGateway?.minReplicas?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.minReplicas",""===t?null:Number(t))}}),e.createElement(x,{title:"Autoscaler Max. Replicas",tooltip:"You can optionally specify the maximum number of replicas for the collector gateway.",type:"number",required:!0,value:o.collectorGateway?.maxReplicas?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.maxReplicas",""===t?null:Number(t))}})),e.createElement(Zl,null,e.createElement(x,{title:"Request Memory",tooltip:"You can optionally specify how much memory the collector gateway should request (in megabytes).",type:"number",required:!0,value:o.collectorGateway?.requestMemoryMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.requestMemoryMiB",""===t?null:Number(t))}}),e.createElement(x,{title:"Limit Memory",tooltip:"You can optionally specify how much memory the collector gateway should limit (in megabytes).",type:"number",required:!0,value:o.collectorGateway?.limitMemoryMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.limitMemoryMiB",""===t?null:Number(t))}})),e.createElement(Zl,null,e.createElement(x,{title:"Request CPU",tooltip:"You can optionally specify how much CPU the collector gateway should request (in millicores).",type:"number",required:!0,value:o.collectorGateway?.requestCPUm?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.requestCPUm",""===t?null:Number(t))}}),e.createElement(x,{title:"Limit CPU",tooltip:"You can optionally specify how much CPU the collector gateway should limit (in millicores).",type:"number",required:!0,value:o.collectorGateway?.limitCPUm?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.limitCPUm",""===t?null:Number(t))}})),t&&e.createElement(e.Fragment,null,e.createElement(Zl,null,e.createElement(x,{status:H.Warning,title:"(Advanced) Memory Limiter Limit",tooltip:"You can optionally specify how much memory the collector gateway should limit (in megabytes).",type:"number",required:!0,value:o.collectorGateway?.memoryLimiterLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.memoryLimiterLimitMiB",""===t?null:Number(t))}}),e.createElement(x,{status:H.Warning,title:"(Advanced) Memory Limiter Spike Limit",tooltip:"You can optionally specify how much memory the collector gateway should limit (in megabytes).",type:"number",required:!0,value:o.collectorGateway?.memoryLimiterSpikeLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.memoryLimiterSpikeLimitMiB",""===t?null:Number(t))}})),e.createElement(x,{status:H.Warning,title:"(Advanced) Go Memory Limit",tooltip:"Sets the GOMEMLIMIT environment variable to control Go runtime memory usage. This soft memory limit helps the garbage collector prevent out-of-memory conditions in Kubernetes by triggering more aggressive garbage collection as memory usage approaches the limit (in megabytes).",type:"number",required:!0,value:o.collectorGateway?.goMemLimitMiB?.toString()||"",onChange:e=>{const{value:t}=e.target;i("collectorGateway.goMemLimitMiB",""===t?null:Number(t))}}))));rr.displayName=rr.name;const sr=d.div`
424
512
  display: flex;
425
513
  flex-direction: column;
426
514
  gap: 12px;
427
515
  max-height: 100vh;
428
516
  overflow-y: auto;
429
- `,fr=d.div`
517
+ `,cr=d.div`
430
518
  position: relative;
431
- `,br="System Settings",xr=({installationMethod:i,fetchSettings:a,onSave:l})=>{const[r,s]=t(void 0),[c,d]=t(!1),[u,p]=t(!1),[m,h]=t(!1),g=()=>h(e=>!e),{popupRef:y,popupOpen:v,setPopupOpen:f}=Ye(),{formData:b,handleFormChange:x,resetFormData:C,isFormDirty:$}=mo(r);o(()=>{m?a().then(s):s(void 0)},[m]);const[k,w]=t(!1),[D,N]=t(null),I=e=>{$?(w(!0),N(()=>e)):e()},[E,O]=t(ar.General),M=n(null),A=n(null),F=n(null),R=n(null),L=n(null),P=n(null),q=[A,F,R,L,P],z=[ar.General,ar.Ui,ar.Rollback,ar.CollectorNode,ar.CollectorGateway];return e.createElement(e.Fragment,null,e.createElement(pt,{key:br,onClick:g,tooltip:br},e.createElement(Jo,{size:18})),e.createElement(H,{width:"750px",isOpen:m,onClose:()=>I(g),header:{icons:[Jo],title:br,tabs:z.map(e=>({label:e,onClick:()=>(e=>{O(e),(e=>{const t=M.current;if(!t)return;let o=0;for(let i=0;i<q.length;i++){const n=q[i].current;if(n&&n.id===e){const e=t.getBoundingClientRect();o=n.getBoundingClientRect().top-e.top+t.scrollTop;break}}t.scrollTo({top:e===ar.General?0:o,behavior:"smooth"})})(e)})(e),selected:E===e})),actions:[e.createElement(fr,{key:"actions"},e.createElement(pt,{withBorder:!0,onClick:()=>f(e=>!e)},e.createElement(T,{size:10},"•••")),e.createElement(Qe,{ref:y,isOpen:v,top:36,right:0,padding:"24px",width:"270px"},e.createElement(S,{title:"Enable Advanced Mode",tooltip:"Show advanced settings. Note: these are not recommended to be changed unless you know what you are doing.",initialValue:u,onChange:()=>p(e=>!e),flipHorizontally:!0})))]},footer:{isOpen:$,centerButtons:[{"data-id":"drawer-cancel",variant:"secondary",onClick:()=>I(C),children:K.CANCEL},{"data-id":"drawer-save",variant:"primary",onClick:async()=>{d(!0),await l(b),s(await a()),d(!1),C(),g()},children:K.SAVE}]}},void 0===b?.imagePrefix||c?e.createElement(we,null,e.createElement(xt,{scale:1.2})):e.createElement(vr,{ref:M},i===fo.Helm&&e.createElement(ie,{type:V.Warning,title:"Helm",message:"Changes won't persist unless you update the `values.yaml` file"}),e.createElement(mr,{ref:A,isAdvanced:u,formData:b,handleFormChange:x}),e.createElement(cr,{ref:F,isAdvanced:u,formData:b,handleFormChange:x}),e.createElement(hr,{ref:R,isAdvanced:u,formData:b,handleFormChange:x}),e.createElement(gr,{ref:L,isAdvanced:u,formData:b,handleFormChange:x}),e.createElement(yr,{ref:P,isAdvanced:u,formData:b,handleFormChange:x}))),e.createElement(W,{isOpen:k,name:br,onApprove:()=>{D?.(),w(!1)},onDeny:()=>{w(!1)}}))},Cr=d.div`
519
+ `,dr="System Settings",ur=({installationMethod:i,fetchSettings:n,onSave:l})=>{const[r,s]=t(void 0),[c,d]=t(!1),[u,p]=t(!1),[m,h]=t(!1),g=()=>h(e=>!e),{popupRef:y,popupOpen:v,setPopupOpen:f}=Xe(),{formData:b,handleFormChange:x,resetFormData:C,isFormDirty:k}=uo(r);o(()=>{m?n().then(s):s(void 0)},[m]);const[w,$]=t(!1),[D,N]=t(null),I=e=>{k?($(!0),N(()=>e)):e()},[E,O]=t(Yl.General),A=a(null),M=a(null),F=a(null),R=a(null),L=a(null),P=a(null),q=[M,F,R,L,P],V=[Yl.General,Yl.Ui,Yl.Rollback,Yl.CollectorNode,Yl.CollectorGateway];return e.createElement(e.Fragment,null,e.createElement(pt,{key:dr,onClick:g,tooltip:dr},e.createElement(_o,{size:18})),e.createElement(j,{width:"750px",isOpen:m,onClose:()=>I(g),header:{icons:[_o],title:dr,tabs:V.map(e=>({label:e,onClick:()=>(e=>{O(e),(e=>{const t=A.current;if(!t)return;let o=0;for(let i=0;i<q.length;i++){const a=q[i].current;if(a&&a.id===e){const e=t.getBoundingClientRect();o=a.getBoundingClientRect().top-e.top+t.scrollTop;break}}t.scrollTo({top:e===Yl.General?0:o,behavior:"smooth"})})(e)})(e),selected:E===e})),actions:[e.createElement(cr,{key:"actions"},e.createElement(pt,{withBorder:!0,onClick:()=>f(e=>!e)},e.createElement(T,{size:10},"•••")),e.createElement(Ze,{ref:y,isOpen:v,top:36,right:0,padding:"24px",width:"270px"},e.createElement(S,{title:"Enable Advanced Mode",tooltip:"Show advanced settings. Note: these are not recommended to be changed unless you know what you are doing.",initialValue:u,onChange:()=>p(e=>!e),flipHorizontally:!0})))]},footer:{isOpen:k,centerButtons:[{"data-id":"drawer-cancel",variant:"secondary",onClick:()=>I(C),children:K.CANCEL},{"data-id":"drawer-save",variant:"primary",onClick:async()=>{d(!0),await l(b),s(await n()),d(!1),C(),g()},children:K.SAVE}]}},void 0===b?.imagePrefix||c?e.createElement($e,null,e.createElement(Re,{scale:1.2})):e.createElement(sr,{ref:A},i===yo.Helm&&e.createElement(ie,{type:H.Warning,title:"Helm",message:"Changes won't persist unless you update the `values.yaml` file"}),e.createElement(ar,{ref:M,isAdvanced:u,formData:b,handleFormChange:x}),e.createElement(er,{ref:F,isAdvanced:u,formData:b,handleFormChange:x}),e.createElement(nr,{ref:R,isAdvanced:u,formData:b,handleFormChange:x}),e.createElement(lr,{ref:L,isAdvanced:u,formData:b,handleFormChange:x}),e.createElement(rr,{ref:P,isAdvanced:u,formData:b,handleFormChange:x}))),e.createElement(z,{isOpen:w,name:dr,onApprove:()=>{D?.(),$(!1)},onDeny:()=>{$(!1)}}))},pr=d.div`
432
520
  position: fixed;
433
521
  bottom: 12px;
434
522
  left: 12px;
@@ -437,7 +525,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
437
525
  flex-direction: column-reverse;
438
526
  gap: 6px;
439
527
  max-width: 600px;
440
- `,$r=()=>{const{notifications:t,markAsDismissed:o,markAsSeen:i}=L(),{onClickNotification:n}=Ut();return e.createElement(Cr,null,t.filter(({dismissed:e})=>!e).map(({id:t,type:a,title:l,message:r,crdType:s,target:c})=>e.createElement(ie,{key:`toast-${t}`,id:t,type:a,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})=>{o(e),t&&i(e)})({id:t,asSeen:!0})})))},kr=d.div`
528
+ `,mr=()=>{const{notifications:t,markAsDismissed:o,markAsSeen:i}=L(),{onClickNotification:a}=Bt();return e.createElement(pr,null,t.filter(({dismissed:e})=>!e).map(({id:t,type:n,title:l,message:r,crdType:s,target:c})=>e.createElement(ie,{key:`toast-${t}`,id:t,type:n,title:l,message:r,action:s&&c?{label:"go to details",onClick:()=>a({id:t,crdType:s,target:c},{dismissToast:!0})}:void 0,onClose:()=>(({id:e,asSeen:t})=>{o(e),t&&i(e)})({id:t,asSeen:!0})})))},hr=d.div`
441
529
  position: relative;
442
530
  display: flex;
443
531
  align-items: center;
@@ -456,7 +544,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
456
544
  stroke: ${({theme:e})=>e.text.secondary};
457
545
  }
458
546
  }
459
- `,Sr=d.div`
547
+ `,gr=d.div`
460
548
  position: absolute;
461
549
  top: 2px;
462
550
  left: ${({$darkMode:e})=>e?"2px":"calc(100% - 2px - 24px)"};
@@ -466,50 +554,50 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
466
554
  background-color: ${({theme:e})=>e.colors.border};
467
555
  border-radius: 100%;
468
556
  transition: all 0.3s;
469
- `,wr=({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})),Dr=()=>{const{darkMode:t,setDarkMode:o}=bo();return e.createElement(kr,{onClick:()=>o(!t)},e.createElement(wr,{path:"M14 7.977A4.333 4.333 0 1 1 8.023 2H8a6 6 0 1 0 6 6v-.023Z"}),e.createElement(wr,{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(Sr,{$darkMode:t}))},Nr=e=>{const{spans:t}=e,o=new Map;t.forEach(e=>{o.set(e.spanID,{...e,spans:[]})});const i=[];return t.forEach(e=>{const t=o.get(e.spanID);let n=!1;if(e.references.length){const t=e.references.find(e=>"CHILD_OF"===e.refType);t&&t.spanID&&o.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=o.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)},Tr=(e,t)=>{const{tags:o}=e,i={},n=[];return o.forEach(e=>{i[e.key]=e.value}),n.push({type:m.Code,value:{language:"json",code:JSON.stringify(i,null,2),pretty:t}}),n},Ir=e=>{const{logs:t}=e,o=[];return t.forEach((e,i)=>{e.fields.forEach(e=>{o.push({title:e.key,value:e.value})}),i!==t.length-1&&o.push({type:m.Divider})}),o},Er=e=>{const{traceID:t,spanID:o,processID:i,operationName:n,duration:a,startTime:l,warnings:r}=e,s=[];return s.push({type:m.CopyText,title:"Trace ID",value:t}),s.push({type:m.CopyText,title:"Span ID",value:o}),s.push({type:m.Divider}),s.push({title:"Service",value:i}),s.push({title:"Operation",value:n}),s.push({title:"Duration",value:xo(a)}),s.push({title:"Start time",value:new Date(l/1e3).toLocaleString()}),r.length&&(s.push({type:m.Divider}),s.push({title:"Warnings",titleIcon:Yo,value:r})),s},Or=(e,t)=>{const{tags:o}=e,i={},n=[];return o.forEach(e=>{i[e.key]=e.value}),n.push({type:m.Code,value:{language:"json",code:JSON.stringify(i,null,2),pretty:t}}),n},Mr=d.div`
557
+ `,yr=({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})),vr=()=>{const{darkMode:t,setDarkMode:o}=vo();return e.createElement(hr,{onClick:()=>o(!t)},e.createElement(yr,{path:"M14 7.977A4.333 4.333 0 1 1 8.023 2H8a6 6 0 1 0 6 6v-.023Z"}),e.createElement(yr,{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(gr,{$darkMode:t}))},fr=e=>{const{spans:t}=e,o=new Map;t.forEach(e=>{o.set(e.spanID,{...e,spans:[]})});const i=[];return t.forEach(e=>{const t=o.get(e.spanID);let a=!1;if(e.references.length){const t=e.references.find(e=>"CHILD_OF"===e.refType);t&&t.spanID&&o.has(t.spanID)||(a=!0)}else a=!0;if(a)i.push(t);else{const i=e.references.find(e=>"CHILD_OF"===e.refType);if(i){const e=o.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)},br=(e,t)=>{const{tags:o}=e,i={},a=[];return o.forEach(e=>{i[e.key]=e.value}),a.push({type:m.Code,value:{language:"json",code:JSON.stringify(i,null,2),pretty:t}}),a},xr=e=>{const{logs:t}=e,o=[];return t.forEach((e,i)=>{e.fields.forEach(e=>{o.push({title:e.key,value:e.value})}),i!==t.length-1&&o.push({type:m.Divider})}),o},Cr=e=>{const{traceID:t,spanID:o,processID:i,operationName:a,duration:n,startTime:l,warnings:r}=e,s=[];return s.push({type:m.CopyText,title:"Trace ID",value:t}),s.push({type:m.CopyText,title:"Span ID",value:o}),s.push({type:m.Divider}),s.push({title:"Service",value:i}),s.push({title:"Operation",value:a}),s.push({title:"Duration",value:fo(n)}),s.push({title:"Start time",value:new Date(l/1e3).toLocaleString()}),r.length&&(s.push({type:m.Divider}),s.push({title:"Warnings",titleIcon:Go,value:r})),s},kr=(e,t)=>{const{tags:o}=e,i={},a=[];return o.forEach(e=>{i[e.key]=e.value}),a.push({type:m.Code,value:{language:"json",code:JSON.stringify(i,null,2),pretty:t}}),a},wr=d.div`
470
558
  display: flex;
471
559
  flex-direction: column;
472
560
  gap: 12px;
473
561
  max-height: 100vh;
474
562
  overflow-y: auto;
475
- `,Ar=({span:o,process:i,onClose:n})=>{const[a,l]=t(!0),[r,s]=t(!0);return e.createElement(H,{width:"750px",isOpen:!0,onClose:n,header:{icons:[Qo],title:o.operationName},footer:{isOpen:!1}},e.createElement(Mr,null,e.createElement(Y,{title:"Details",data:Er(o)}),o.logs.length>0&&e.createElement(Y,{title:"Errors",titleBadge:o.logs.length,titleIcon:Xo,data:Ir(o)}),e.createElement(Y,{title:"Tags",data:Tr(o,a),action:e.createElement(Co,{isPrettyMode:a,setIsPrettyMode:l})}),i&&e.createElement(Y,{title:`Process (${i.serviceName})`,data:Or(i,r),action:e.createElement(Co,{isPrettyMode:r,setIsPrettyMode:s})})))},Fr=370,Rr=["#33DCA7","#50F6E8","#444AD9","#8B55FF","#FF7CA9"].reverse(),Lr=d.div`
563
+ `,Sr=({span:o,process:i,onClose:a})=>{const[n,l]=t(!0),[r,s]=t(!0);return e.createElement(j,{width:"750px",isOpen:!0,onClose:a,header:{icons:[Jo],title:o.operationName},footer:{isOpen:!1}},e.createElement(wr,null,e.createElement(Y,{title:"Details",data:Cr(o)}),o.logs.length>0&&e.createElement(Y,{title:"Errors",titleBadge:o.logs.length,titleIcon:Yo,data:xr(o)}),e.createElement(Y,{title:"Tags",data:br(o,n),action:e.createElement(bo,{isPrettyMode:n,setIsPrettyMode:l})}),i&&e.createElement(Y,{title:`Process (${i.serviceName})`,data:kr(i,r),action:e.createElement(bo,{isPrettyMode:r,setIsPrettyMode:s})})))},$r=370,Dr=["#33DCA7","#50F6E8","#444AD9","#8B55FF","#FF7CA9"].reverse(),Nr=d.div`
476
564
  display: flex;
477
565
  align-items: center;
478
- width: ${Fr}px;
566
+ width: ${$r}px;
479
567
  background-color: ${({$withErrors:e,theme:t})=>e?t.colors.error+I.opacity.hex["042"]:t.colors.dark_grey};
480
568
  &:hover {
481
569
  ${({$withErrors:e,$preventHover:t,theme:o})=>!t&&`background-color: ${e?o.colors.error:o.colors.secondary+I.opacity.hex["010"]};`}
482
570
  cursor: ${({$preventHover:e})=>e?"default":"pointer"};
483
571
  }
484
- `,Pr=d(ce)`
572
+ `,Tr=d(ce)`
485
573
  align-items: center;
486
574
  justify-content: space-between;
487
575
  gap: 4px;
488
576
  padding: 12px;
489
577
  padding-left: ${({$depth:e})=>12*e||12}px;
490
- width: calc(${Fr}px - ${({$depth:e})=>12*e}px);
491
- `,qr=d(ce)`
578
+ width: calc(${$r}px - ${({$depth:e})=>12*e}px);
579
+ `,Ir=d(ce)`
492
580
  align-items: center;
493
581
  gap: 4px;
494
582
  position: absolute;
495
583
  right: 56px;
496
584
  width: calc(100% - ${434}px);
497
- `,Kr=d.div`
585
+ `,Er=d.div`
498
586
  position: absolute;
499
587
  left: ${({$startTime:e,$minStartTime:t,$maxEndTime:o})=>(e-t)/(o-t)*100+"%"};
500
588
  width: ${({$duration:e,$maxDuration:t})=>e/t*100+"%"};
501
589
  height: 12px;
502
590
  border-radius: 32px;
503
- background-color: ${({$indexInMatrix:e})=>Rr[e%Rr.length]};
504
- `,Hr=d(T)`
591
+ background-color: ${({$indexInMatrix:e})=>Dr[e%Dr.length]};
592
+ `,Or=d(T)`
505
593
  padding-left: calc(100% + 8px);
506
594
  font-size: 10px;
507
595
  color: ${({theme:e})=>e.text.darker_grey};
508
596
  font-family: ${({theme:e})=>e.font_family.secondary};
509
597
  white-space: nowrap;
510
- `,zr=({span:o,depth:i,indexInMatrix:n,maxDuration:a,minStartTime:l,maxEndTime:r,withErrors:s,errorTooltip:c,isOpen:d,withToggle:u,onToggleOpen:p,onSelect:m})=>{const h=I.useTheme(),[g,y]=t(!1),v=Fr-12*i-20-(s?12:0),f=s&&(1===i||o.logs.length>0);return e.createElement(Lr,{className:"span-container",$withErrors:s,$preventHover:g,onClick:m},e.createElement(Pr,{$depth:i,className:"span-left"},e.createElement(ce,{$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(ko,{maxWidth:v/2,text:o.processID,textSize:14}),e.createElement(T,{size:12,color:h.text.darker_grey},"•"),e.createElement(ko,{maxWidth:v/2,text:o.operationName,textSize:12,textColor:h.text.darker_grey})),s&&(f?e.createElement(ue,{...c},e.createElement(Xo,{fill:h.text.error})):e.createElement("div",{style:{position:"relative"}},e.createElement("div",{style:{position:"absolute",top:"-24px",right:"8px"}},e.createElement(le,{type:V.Error,orientation:"vertical",thickness:1,length:"48px",margin:"0",opacity:.5}))))),e.createElement(qr,{className:"span-right"},e.createElement(Kr,{$indexInMatrix:n,$duration:o.duration,$maxDuration:a,$startTime:o.startTime,$minStartTime:l,$maxEndTime:r},e.createElement(Hr,null,xo(o.duration)))))},Wr=({spans:t,logs:o,depth:i,indexInMatrix:n,maxDuration:a,minStartTime:l,maxEndTime:r,openSpanIdsState:s,selectedSpanState:c})=>{const d=I.useTheme();return t.map((t,u)=>{const p=t.spanID,m=s.value.includes(p),h=!!t.spans?.length,g=o.length?o:$o(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,f=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(zr,{span:t,depth:i,indexInMatrix:n+u+i,maxDuration:a,minStartTime:l,maxEndTime:r,withErrors:y,errorTooltip:{titleIcon:Xo,title:v,text:f},isOpen:m,withToggle:h,onToggleOpen:()=>s.set(e=>e.some(e=>e===p)?e.filter(e=>e!=p):[...e,p,...$o(t,"spans","spanID")]),onSelect:()=>c.set(e=>e?.spanID===p?null:t)}),m&&h?e.createElement(Wr,{spans:t.spans||[],logs:g,depth:i+1,indexInMatrix:n+u,maxDuration:a,minStartTime:l,maxEndTime:r,openSpanIdsState:s,selectedSpanState:c}):null)})},jr=d.div`
598
+ `,Ar=({span:o,depth:i,indexInMatrix:a,maxDuration:n,minStartTime:l,maxEndTime:r,withErrors:s,errorTooltip:c,isOpen:d,withToggle:u,onToggleOpen:p,onSelect:m})=>{const h=I.useTheme(),[g,y]=t(!1),v=$r-12*i-20-(s?12:0),f=s&&(1===i||o.logs.length>0);return e.createElement(Nr,{className:"span-container",$withErrors:s,$preventHover:g,onClick:m},e.createElement(Tr,{$depth:i,className:"span-left"},e.createElement(ce,{$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(Co,{maxWidth:v/2,text:o.processID,textSize:14}),e.createElement(T,{size:12,color:h.text.darker_grey},"•"),e.createElement(Co,{maxWidth:v/2,text:o.operationName,textSize:12,textColor:h.text.darker_grey})),s&&(f?e.createElement(ue,{...c},e.createElement(Yo,{fill:h.text.error})):e.createElement("div",{style:{position:"relative"}},e.createElement("div",{style:{position:"absolute",top:"-24px",right:"8px"}},e.createElement(le,{type:H.Error,orientation:"vertical",thickness:1,length:"48px",margin:"0",opacity:.5}))))),e.createElement(Ir,{className:"span-right"},e.createElement(Er,{$indexInMatrix:a,$duration:o.duration,$maxDuration:n,$startTime:o.startTime,$minStartTime:l,$maxEndTime:r},e.createElement(Or,null,fo(o.duration)))))},Mr=({spans:t,logs:o,depth:i,indexInMatrix:a,maxDuration:n,minStartTime:l,maxEndTime:r,openSpanIdsState:s,selectedSpanState:c})=>{const d=I.useTheme();return t.map((t,u)=>{const p=t.spanID,m=s.value.includes(p),h=!!t.spans?.length,g=o.length?o:xo(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,f=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(Ar,{span:t,depth:i,indexInMatrix:a+u+i,maxDuration:n,minStartTime:l,maxEndTime:r,withErrors:y,errorTooltip:{titleIcon:Yo,title:v,text:f},isOpen:m,withToggle:h,onToggleOpen:()=>s.set(e=>e.some(e=>e===p)?e.filter(e=>e!=p):[...e,p,...xo(t,"spans","spanID")]),onSelect:()=>c.set(e=>e?.spanID===p?null:t)}),m&&h?e.createElement(Mr,{spans:t.spans||[],logs:g,depth:i+1,indexInMatrix:a+u,maxDuration:n,minStartTime:l,maxEndTime:r,openSpanIdsState:s,selectedSpanState:c}):null)})},Fr=d.div`
511
599
  width: 100%;
512
- `,Vr=d.div`
600
+ `,Rr=d.div`
513
601
  max-height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
514
602
  overflow: auto;
515
603
 
@@ -519,22 +607,22 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
519
607
  border-radius: 24px;
520
608
  border: 1px solid ${({theme:e})=>e.colors.dropdown_bg_2};
521
609
  position: relative;
522
- `,Br=d.div`
610
+ `,Lr=d.div`
523
611
  padding: 12px 12px 12px 24px;
524
- width: calc(${Fr}px - 36px);
612
+ width: calc(${$r}px - 36px);
525
613
  background-color: ${({theme:e})=>e.colors.dark_grey};
526
- `,Ur=d.div`
614
+ `,Pr=d.div`
527
615
  width: 1px;
528
616
  height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
529
617
  background: ${({theme:e})=>`linear-gradient(to bottom, ${e.colors.border}, transparent)`};
530
618
 
531
619
  position: absolute;
532
- left: calc(${Fr}px + ((100% - ${Fr}px) / ${5}) * ${({index:e})=>e});
533
- `,_r=d(T)`
620
+ left: calc(${$r}px + ((100% - ${$r}px) / ${5}) * ${({index:e})=>e});
621
+ `,qr=d(T)`
534
622
  color: ${({theme:e})=>e.text.darker_grey};
535
623
  font-size: 12px;
536
624
  font-family: ${({theme:e})=>e.font_family.secondary};
537
625
  padding-top: 12px;
538
626
  padding-left: 12px;
539
627
  white-space: nowrap;
540
- `,Gr=({heightToRemove:o,traces:i,isLoading:n})=>{const[a,r]=t([]),[s,c]=t(null),d=l(()=>Nt(i).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:Nr(e)})),[i]),u=l(()=>d.reduce((e,t)=>Math.max(e,t.spans.reduce((e,t)=>e+t.duration,0)),0),[d]),m=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(jr,{$heightToRemove:o},n?e.createElement(we,{$height:"50vh"},e.createElement(xt,{scale:1.5})):d.length?e.createElement(Vr,{$heightToRemove:o},e.createElement(Br,null,e.createElement(T,null,"Service & operation")),new Array(5).fill(null).map((t,i)=>e.createElement(Ur,{key:`${i}-divider`,$heightToRemove:o,index:i},e.createElement(_r,null,xo(u/5*i)))),d.map((t,o)=>{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(Wr,{key:`recursive-spans-${t.traceID}`,spans:i,logs:[],depth:1,indexInMatrix:o,maxDuration:u,minStartTime:n,maxEndTime:l,openSpanIdsState:{value:a,set:r},selectedSpanState:{value:s,set:c}})})):e.createElement(we,{$height:"50vh"},e.createElement(De,{title:p.NO_TRACES_FOUND,subTitle:p.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}))),s&&e.createElement(Ar,{span:s,process:m,onClose:()=>c(null)}))};export{Ii as ActionDrawer,Si as ActionForm,Oi as ActionModal,Pi as ActionTable,Wi as AwaitPipeline,vn as ConditionDropdown,pn as DataFlow,Wn as DataFlowActionsMenu,Mn as DataStreamDrawer,En as DataStreamForm,Vn as DataStreamModal,jn as DataStreamSelectionForm,ia as DestinationDrawer,ea as DestinationForm,$a as DestinationModal,Na as DestinationSelectionForm,Ia as DestinationTable,fn as ErrorDropdown,Ba as InstrumentationRuleDrawer,Wa as InstrumentationRuleForm,Ga as InstrumentationRuleModal,Qa as InstrumentationRuleTable,$n as KindDropdown,bn as LanguageDropdown,xn as MonitorDropdown,Za as MultiSourceControl,Cn as NamespaceDropdown,El as NavIconIds,al as NotificationManager,wi as OverviewDrawer,yl as ServiceMap,Il as SetupSummary,Ol as SideNav,Ml as SlackInvite,Bl as SourceDrawer,Rl as SourceForm,Gl as SourceModal,_l as SourceSelectionForm,Yl as SourceTable,nr as SystemOverview,xr as SystemSettings,Ai as TableCellConditions,$r as ToastList,Dr as ToggleDarkMode,Gr as TraceView};
628
+ `,Kr=({heightToRemove:o,traces:i,isLoading:a})=>{const[n,r]=t([]),[s,c]=t(null),d=l(()=>$t(i).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:fr(e)})),[i]),u=l(()=>d.reduce((e,t)=>Math.max(e,t.spans.reduce((e,t)=>e+t.duration,0)),0),[d]),m=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(Fr,{$heightToRemove:o},a?e.createElement($e,{$height:"50vh"},e.createElement(Re,{scale:1.5})):d.length?e.createElement(Rr,{$heightToRemove:o},e.createElement(Lr,null,e.createElement(T,null,"Service & operation")),new Array(5).fill(null).map((t,i)=>e.createElement(Pr,{key:`${i}-divider`,$heightToRemove:o,index:i},e.createElement(qr,null,fo(u/5*i)))),d.map((t,o)=>{const{spans:i}=t,a=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(Mr,{key:`recursive-spans-${t.traceID}`,spans:i,logs:[],depth:1,indexInMatrix:o,maxDuration:u,minStartTime:a,maxEndTime:l,openSpanIdsState:{value:n,set:r},selectedSpanState:{value:s,set:c}})})):e.createElement($e,{$height:"50vh"},e.createElement(De,{title:p.NO_TRACES_FOUND,subTitle:p.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}))),s&&e.createElement(Sr,{span:s,process:m,onClose:()=>c(null)}))};export{Ni as ActionDrawer,ki as ActionForm,Ii as ActionModal,Ri as ActionTable,ji as AwaitPipeline,ra as ConditionDropdown,oa as DataFlow,Aa as DataFlowActionsMenu,ka as DataStreamDrawer,xa as DataStreamForm,Fa as DataStreamModal,Ma as DataStreamSelectionForm,_a as DestinationDrawer,Ha as DestinationForm,mn as DestinationModal,fn as DestinationSelectionForm,xn as DestinationTable,sa as ErrorDropdown,Ln as InstrumentationRuleDrawer,Mn as InstrumentationRuleForm,Kn as InstrumentationRuleModal,zn as InstrumentationRuleTable,pa as KindDropdown,ca as LanguageDropdown,da as MonitorDropdown,Hn as MultiSourceControl,ua as NamespaceDropdown,Cl as NavIconIds,Yn as NotificationManager,wi as OverviewDrawer,rl as ServiceMap,xl as SetupSummary,kl as SideNav,wl as SlackInvite,Ll as SourceDrawer,Dl as SourceForm,Kl as SourceModal,ql as SourceSelectionForm,Vl as SourceTable,Jl as SystemOverview,ur as SystemSettings,Oi as TableCellConditions,mr as ToastList,vr as ToggleDarkMode,Kr as TraceView};