@odigos/ui-kit 0.0.260 → 0.0.262

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 (50) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/lib/chunks/{connections-scope-BLrBW0hm.js → connections-scope-7HTW_FyZ.js} +1 -1
  3. package/lib/chunks/{index-D-8Yak_c.js → index-raAGXSYj.js} +12 -12
  4. package/lib/chunks/odigos-context-nQT2LWDb.js +18 -0
  5. package/lib/chunks/source-instrument-form-context-BDrkrejS.js +1 -0
  6. package/lib/chunks/ui-components-p39Q_a1_.js +1703 -0
  7. package/lib/chunks/use-odigos-api-CPlk79JW.js +5 -0
  8. package/lib/components/_v2/input-table/card-table.d.ts +10 -0
  9. package/lib/components/_v2/input-table/dynamic-field/index.d.ts +1 -0
  10. package/lib/components/_v2/input-table/index.d.ts +2 -0
  11. package/lib/components/_v2/input-table/types.d.ts +13 -1
  12. package/lib/components/v2.js +1 -1
  13. package/lib/components.js +1 -1
  14. package/lib/constants/actions/index.d.ts +5 -1
  15. package/lib/constants/instrumentation-rules/index.d.ts +2 -1
  16. package/lib/constants/sampling/index.d.ts +4 -0
  17. package/lib/constants.js +1 -1
  18. package/lib/containers/_v2/_drawers/edit-source-drawer/sampling/index.d.ts +1 -1
  19. package/lib/containers/_v2/_forms/add-action-form/custom-fields/index.d.ts +3 -1
  20. package/lib/containers/_v2/_forms/add-action-form/dynamic-fields/index.d.ts +21 -0
  21. package/lib/containers/_v2/_forms/add-rule-form/custom-fields/index.d.ts +2 -1
  22. package/lib/containers/v2.js +155 -143
  23. package/lib/containers.js +1 -1
  24. package/lib/contexts/action-form-context.d.ts +1 -1
  25. package/lib/contexts/odigos-api/capabilities.d.ts +2 -0
  26. package/lib/contexts/odigos-api/hooks/use-actions-api.d.ts +12 -1
  27. package/lib/contexts/odigos-api/hooks/use-instrumentation-rules-api.d.ts +13 -1
  28. package/lib/contexts/odigos-api/types.d.ts +3 -1
  29. package/lib/contexts/odigos-api.js +1 -1
  30. package/lib/contexts/rule-form-context.d.ts +1 -1
  31. package/lib/contexts.js +1 -1
  32. package/lib/functions.js +1 -1
  33. package/lib/hooks/useActionFormData.d.ts +1 -1
  34. package/lib/hooks/useInstrumentationRuleFormData.d.ts +1 -1
  35. package/lib/hooks.js +1 -1
  36. package/lib/icons.js +1 -1
  37. package/lib/snippets/v2.js +1 -1
  38. package/lib/snippets.js +1 -1
  39. package/lib/store.js +1 -1
  40. package/lib/theme.js +1 -1
  41. package/lib/types/actions/index.d.ts +40 -4
  42. package/lib/types/common/index.d.ts +3 -1
  43. package/lib/types/instrumentation-rules/index.d.ts +22 -3
  44. package/lib/types.js +1 -1
  45. package/lib/visuals.js +1 -1
  46. package/package.json +1 -1
  47. package/lib/chunks/helpers-45znEVHP.js +0 -19
  48. package/lib/chunks/source-instrument-form-context-D7wjfWpw.js +0 -1
  49. package/lib/chunks/ui-components-CrXELmQx.js +0 -1692
  50. package/lib/chunks/use-odigos-api-CgkEC7if.js +0 -5
@@ -1,4 +1,4 @@
1
- import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect as o,useMemo as a,useRef as i,useCallback as l,useState as s,Fragment as r,forwardRef as c,useImperativeHandle as d,Children as u,createContext as p,useContext as h,useLayoutEffect as m}from"react";import g,{useTheme as f,css as b,keyframes as v}from"styled-components";import{u as y,n as C,C as S,e as w,f as x,h as k,d as T,b as $,c as I,S as E,j as A,R as N,k as O,l as R,a as D,r as P,o as F,p as L,q as _,s as M,t as z,w as B,x as X,y as V,z as U,A as G,B as H}from"../chunks/helpers-45znEVHP.js";import{f as j,a6 as W,a7 as K,V as Y,a8 as J,a9 as q,aa as Z,ab as Q,ac as ee,ad as te,ae as ne,af as oe,b as ae,O as ie,c as le,y as se,B as re,z as ce,L as de,M as ue,ag as pe,ah as he,ai as me,aj as ge,ak as fe,al as be,am as ve,g as ye,N as Ce,an as Se,ao as we,ap as xe,aq as ke,ar as Te,Y as $e,o as Ie,S as Ee,k as Ae,m as Ne,as as Oe,at as Re,au as De,H as Pe,av as Fe,G as Le,J as _e,C as Me,n as ze,R as Be,aw as Xe,ax as Ve,ay as Ue,p as Ge,h as He,az as je,aA as We,aB as Ke,aC as Ye,aD as Je,aE as qe,aF as Ze,aG as Qe,aH as et,aI as tt,aJ as nt,A as ot,aK as at,D as it,aL as lt,aM as st,aN as rt,aO as ct,aP as dt,aQ as ut,e as pt,s as ht,I as mt,E as gt,T as ft,aR as bt,aS as vt,$ as yt,aT as Ct,aU as St,a1 as wt,a3 as xt,aV as kt,aW as Tt,aX as $t,aY as It,aZ as Et,d as At,a_ as Nt,l as Ot,a$ as Rt,b0 as Dt,b1 as Pt,W as Ft,F as Lt,b2 as _t,b3 as Mt,b4 as zt,b5 as Bt,b6 as Xt,b7 as Vt,b8 as Ut,b9 as Gt,ba as Ht,bb as jt,bc as Wt,bd as Kt,be as Yt,U as Jt,Q as qt,bf as Zt,bg as Qt,q as en,r as tn,w as nn,K as on,bh as an,bi as ln,bj as sn,bk as rn,bl as cn,bm as dn,bn as un,bo as pn,bp as hn,bq as mn,br as gn,bs as fn,bt as bn,bu as vn,bv as yn,bw as Cn,bx as Sn,by as wn,bz as xn,bA as kn,bB as Tn,bC as $n,bD as In,bE as En,bF as An,bG as Nn,bH as On,bI as Rn,bJ as Dn,bK as Pn,bL as Fn,bM as Ln,bN as _n,bO as Mn,bP as zn,bQ as Bn,bR as Xn,bS as Vn,bT as Un,bU as Gn,bV as Hn,bW as jn,bX as Wn,bY as Kn,bZ as Yn,b_ as Jn,b$ as qn,c0 as Zn,c1 as Qn,c2 as eo,c3 as to,c4 as no,c5 as oo,c6 as ao,c7 as io,c8 as lo,c9 as so,ca as ro,cb as co,cc as uo,cd as po,ce as ho,cf as mo,cg as go,ch as fo,ci as bo,cj as vo,ck as yo,cl as Co,cm as So,cn as wo,co as xo,cp as ko,cq as To,cr as $o,cs as Io,ct as Eo,cu as Ao,cv as No,cw as Oo,cx as Ro,cy as Do,cz as Po,cA as Fo,cB as Lo,cC as _o,cD as Mo,cE as zo,cF as Bo,cG as Xo,cH as Vo,cI as Uo,cJ as Go,cK as Ho,cL as jo,cM as Wo,cN as Ko,cO as Yo,cP as Jo,cQ as qo,cR as Zo,cS as Qo,cT as ea,cU as ta,cV as na,cW as oa,cX as aa,cY as ia,cZ as la,c_ as sa,c$ as ra,d0 as ca,d1 as da,d2 as ua,d3 as pa,d4 as ha,d5 as ma,d6 as ga,d7 as fa,d8 as ba,d9 as va,da as ya,db as Ca,dc as Sa,x as wa,dd as xa,v as ka,de as Ta,df as $a,dg as Ia,dh as Ea,di as Aa,dj as Na,dk as Oa,dl as Ra,a0 as Da,dm as Pa,dn as Fa,dp as La,dq as _a,dr as Ma,ds as za,dt as Ba,du as Xa,dv as Va,dw as Ua,dx as Ga,dy as Ha,dz as ja,dA as Wa,dB as Ka,dC as Ya,dD as Ja,dE as qa,dF as Za,dG as Qa,dH as ei,dI as ti,dJ as ni,dK as oi,dL as ai,dM as ii}from"../chunks/ui-components-CrXELmQx.js";import{TrashIcon as li,PlusIcon as si,ArrowRightIcon as ri,VSquareIcon as ci,XSquareIcon as di,BookIcon as ui,DeleteIcon as pi,EditIcon as hi,GoLogo as mi,JavaLogo as gi,ChevronRightIcon as fi,ActionIcon as bi,DestinationIcon as vi,ChevronUpIcon as yi,ChevronDownIcon as Ci,VIcon as Si,XIcon as wi,InstrumentationRuleIcon as xi,SourceIcon as ki,NamespacesIcon as Ti,SettingsIcon as $i,PodIcon as Ii,OdigosLogo as Ei,K8sLogo as Ai,RefreshIcon as Ni,ExclamationCircleIcon as Oi,QuestionCircleIcon as Ri,InboundIcon as Di,OutboundIcon as Pi,UserIcon as Fi,TerminalIcon as Li,MinusIcon as _i,SearchIcon as Mi,ExpandIcon as zi,CopyIcon as Bi,DotIcon as Xi,ArrowDownIcon as Vi,DownloadIcon as Ui,RefreshLeftArrowIcon as Gi,VmLogo as Hi,SamplingIcon as ji,ExclamationTriangleIcon as Wi,KeyIcon as Ki,DiagnoseIcon as Yi,StarIcon as Ji,ArrowIcon as qi,ConnectionsIcon as Zi,FilterIcon as Qi,DataStreamIcon as el,PipelineCollectorIcon as tl,ArrowDownSquareIcon as nl,ArrowUpSquareIcon as ol,GatewayIcon as al,YamlIcon as il}from"../icons.js";import{d as ll}from"../chunks/use-odigos-api-CgkEC7if.js";import{S as sl,D as rl,I as cl,a as dl,A as ul,P as pl,b as hl,c as ml,R as gl,O as fl,d as bl,e as vl,f as yl,W as Cl,g as Sl,C as wl,Y as xl,h as kl,i as Tl,U as $l}from"../chunks/index-D-8Yak_c.js";import{O as Il}from"../chunks/connections-scope-BLrBW0hm.js";import{u as El,f as Al,g as Nl,e as Ol,i as Rl,h as Dl,S as Pl,k as Fl,E as Ll,l as _l,m as Ml,j as zl,b as Bl,d as Xl,a as Vl,A as Ul,R as Gl,c as Hl,D as jl}from"../chunks/source-instrument-form-context-D7wjfWpw.js";import{U as Wl}from"../chunks/consts-D6GCMJ6c.js";import{createPortal as Kl}from"react-dom";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"../chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"virtua";import"@apollo/client";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";const Yl=[{id:"CREDIT_CARD",label:"Credit card"}],Jl=[{id:j.CollectContainerAttributes,label:"Collect container attributes"},{id:j.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:j.CollectWorkloadId,label:"Collect workload ID"},{id:j.CollectClusterId,label:"Collect cluster ID"}],ql=[{id:Z.Pod,label:Z.Pod},{id:Z.Namespace,label:Z.Namespace},{id:Z.Node,label:Z.Node}],Zl=[{label:"Label key",keyName:"labelKey",placeholder:"app.kubernetes.io/name"},{label:"Attribute key",keyName:"attributeKey",placeholder:"app.kubernetes.name"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:ql}],Ql=[{label:"Annotation key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt"},{label:"Attribute key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:ql}],es=/^[a-zA-Z]$/,ts=new Set(["*","+","?"]),ns=new Set(["^","$"]),os={group:"rgba(102, 242, 102, 0.5)","anchor-quantifier":"rgba(102, 191, 255, 0.5)","class-bracket":"rgba(255, 153, 153, 0.5)","class-content":"rgba(178, 1, 1, 0.5)",alternation:"rgba(255, 153, 153, 0.5)",literal:"transparent"},as=g.div`
1
+ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect as o,useMemo as a,useRef as i,useCallback as l,useState as r,Fragment as s,forwardRef as c,useImperativeHandle as d,Children as u,createContext as p,useContext as h,useLayoutEffect as m}from"react";import g,{useTheme as f,css as b,keyframes as y}from"styled-components";import{u as v,n as C,C as S,e as w,f as x,h as k,g as T,j as $,k as I,l as E,d as A,b as N,c as O,S as R,o as D,R as P,p as F,q as L,a as M,r as _,s as z,t as B,w as X,x as V,y as U,z as j,A as G,B as H,D as W,E as K,F as Y}from"../chunks/odigos-context-nQT2LWDb.js";import{f as J,a8 as q,a9 as Z,V as Q,aa as ee,ab as te,ac as ne,ad as oe,ae,af as ie,ag as le,ah as re,T as se,O as ce,a as de,y as ue,B as pe,z as he,L as me,M as ge,ai as fe,aj as be,ak as ye,al as ve,am as Ce,an as Se,ao as we,l as xe,ap as ke,s as Te,aq as $e,ar as Ie,g as Ee,N as Ae,as as Ne,at as Oe,au as Re,Y as De,o as Pe,av as Fe,S as Le,k as Me,m as _e,aw as ze,ax as Be,H as Xe,ay as Ve,G as Ue,J as je,C as Ge,n as He,R as We,az as Ke,aA as Ye,aB as Je,p as qe,h as Ze,aC as Qe,aD as et,aE as tt,aF as nt,aG as ot,aH as at,aI as it,aJ as lt,aK as rt,aL as st,aM as ct,aN as dt,aO as ut,aP as pt,aQ as ht,D as mt,aR as gt,aS as ft,aT as bt,aU as yt,aV as vt,aW as Ct,e as St,I as wt,E as xt,b as kt,aX as Tt,aY as $t,$ as It,aZ as Et,a_ as At,a1 as Nt,a4 as Ot,A as Rt,a$ as Dt,b0 as Pt,b1 as Ft,b2 as Lt,d as Mt,b3 as _t,b4 as zt,b5 as Bt,b6 as Xt,W as Vt,F as Ut,b7 as jt,b8 as Gt,b9 as Ht,ba as Wt,bb as Kt,bc as Yt,bd as Jt,be as qt,bf as Zt,bg as Qt,bh as en,bi as tn,bj as nn,U as on,Q as an,bk as ln,bl as rn,q as sn,r as cn,w as dn,K as un,bm as pn,bn as hn,bo as mn,bp as gn,bq as fn,br as bn,bs as yn,bt as vn,bu as Cn,bv as Sn,bw as wn,bx as xn,by as kn,bz as Tn,bA as $n,bB as In,bC as En,bD as An,bE as Nn,bF as On,bG as Rn,bH as Dn,bI as Pn,bJ as Fn,bK as Ln,bL as Mn,bM as _n,bN as zn,bO as Bn,bP as Xn,bQ as Vn,bR as Un,bS as jn,bT as Gn,bU as Hn,bV as Wn,bW as Kn,bX as Yn,bY as Jn,bZ as qn,b_ as Zn,b$ as Qn,c0 as eo,c1 as to,c2 as no,c3 as oo,c4 as ao,c5 as io,c6 as lo,c7 as ro,c8 as so,c9 as co,ca as uo,cb as po,cc as ho,cd as mo,ce as go,cf as fo,cg as bo,ch as yo,ci as vo,cj as Co,ck as So,cl as wo,cm as xo,cn as ko,co as To,cp as $o,cq as Io,cr as Eo,cs as Ao,ct as No,cu as Oo,cv as Ro,cw as Do,cx as Po,cy as Fo,cz as Lo,cA as Mo,cB as _o,cC as zo,cD as Bo,cE as Xo,cF as Vo,cG as Uo,cH as jo,cI as Go,cJ as Ho,cK as Wo,cL as Ko,cM as Yo,cN as Jo,cO as qo,cP as Zo,cQ as Qo,cR as ea,cS as ta,cT as na,cU as oa,cV as aa,cW as ia,cX as la,cY as ra,cZ as sa,c_ as ca,c$ as da,d0 as ua,d1 as pa,d2 as ha,d3 as ma,d4 as ga,d5 as fa,d6 as ba,d7 as ya,d8 as va,d9 as Ca,da as Sa,db as wa,c as xa,dc as ka,dd as Ta,de as $a,df as Ia,dg as Ea,dh as Aa,di as Na,dj as Oa,dk as Ra,x as Da,dl as Pa,v as Fa,dm as La,dn as Ma,dp as _a,dq as za,dr as Ba,ds as Xa,dt as Va,du as Ua,a0 as ja,dv as Ga,dw as Ha,dx as Wa,dy as Ka,dz as Ya,dA as Ja,dB as qa,dC as Za,dD as Qa,dE as ei,dF as ti,dG as ni,dH as oi,dI as ai,dJ as ii,dK as li,dL as ri,dM as si,dN as ci,dO as di,dP as ui,dQ as pi,dR as hi,dS as mi,dT as gi,dU as fi}from"../chunks/ui-components-p39Q_a1_.js";import{TrashIcon as bi,PlusIcon as yi,ArrowRightIcon as vi,VSquareIcon as Ci,XSquareIcon as Si,BookIcon as wi,DeleteIcon as xi,EditIcon as ki,GoLogo as Ti,JavaLogo as $i,ChevronRightIcon as Ii,ActionIcon as Ei,DestinationIcon as Ai,ChevronUpIcon as Ni,ChevronDownIcon as Oi,VIcon as Ri,XIcon as Di,InstrumentationRuleIcon as Pi,SourceIcon as Fi,NamespacesIcon as Li,SettingsIcon as Mi,PodIcon as _i,OdigosLogo as zi,K8sLogo as Bi,RefreshIcon as Xi,ExclamationCircleIcon as Vi,QuestionCircleIcon as Ui,InboundIcon as ji,OutboundIcon as Gi,UserIcon as Hi,TerminalIcon as Wi,MinusIcon as Ki,SearchIcon as Yi,ExpandIcon as Ji,CopyIcon as qi,DotIcon as Zi,ArrowDownIcon as Qi,DownloadIcon as el,RefreshLeftArrowIcon as tl,VmLogo as nl,SamplingIcon as ol,ExclamationTriangleIcon as al,KeyIcon as il,DiagnoseIcon as ll,StarIcon as rl,ArrowIcon as sl,ConnectionsIcon as cl,FilterIcon as dl,DataStreamIcon as ul,PipelineCollectorIcon as pl,ArrowDownSquareIcon as hl,ArrowUpSquareIcon as ml,GatewayIcon as gl,YamlIcon as fl}from"../icons.js";import{d as bl}from"../chunks/use-odigos-api-CPlk79JW.js";import{D as yl,S as vl,I as Cl,a as Sl,A as wl,P as xl,b as kl,c as Tl,R as $l,O as Il,d as El,e as Al,f as Nl,W as Ol,g as Rl,C as Dl,Y as Pl,h as Fl,i as Ll,U as Ml}from"../chunks/index-raAGXSYj.js";import{O as _l}from"../chunks/connections-scope-7HTW_FyZ.js";import{u as zl,f as Bl,g as Xl,e as Vl,i as Ul,h as jl,S as Gl,k as Hl,E as Wl,l as Kl,m as Yl,j as Jl,b as ql,d as Zl,a as Ql,A as er,R as tr,c as nr,D as or}from"../chunks/source-instrument-form-context-BDrkrejS.js";import{U as ar}from"../chunks/consts-D6GCMJ6c.js";import{createPortal as ir}from"react-dom";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"../chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"virtua";import"@apollo/client";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";const lr=[{id:"CREDIT_CARD",label:"Credit card"}],rr=[{id:J.CollectContainerAttributes,label:"Collect container attributes"},{id:J.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:J.CollectWorkloadId,label:"Collect workload ID"},{id:J.CollectClusterId,label:"Collect cluster ID"}],sr=[{id:ne.Pod,label:ne.Pod},{id:ne.Namespace,label:ne.Namespace},{id:ne.Node,label:ne.Node}],cr=[{label:"Label key",keyName:"labelKey",placeholder:"app.kubernetes.io/name"},{label:"Attribute key",keyName:"attributeKey",placeholder:"app.kubernetes.name"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:sr}],dr=[{label:"Annotation key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt"},{label:"Attribute key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:sr}],ur=/^[a-zA-Z]$/,pr=new Set(["*","+","?"]),hr=new Set(["^","$"]),mr={group:"rgba(102, 242, 102, 0.5)","anchor-quantifier":"rgba(102, 191, 255, 0.5)","class-bracket":"rgba(255, 153, 153, 0.5)","class-content":"rgba(178, 1, 1, 0.5)",alternation:"rgba(255, 153, 153, 0.5)",literal:"transparent"},gr=g.div`
2
2
  padding: 8px 16px;
3
3
  border-radius: 6px;
4
4
  border: 1px solid ${({theme:e})=>e.v2.colors.silver[500]};
@@ -18,9 +18,9 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
18
18
  box-decoration-break: clone;
19
19
  -webkit-box-decoration-break: clone;
20
20
  }
21
- `,is=g.span`
22
- background: ${({$kind:e})=>os[e]};
23
- `,ls=({pattern:e,"data-id":n})=>{const o=a(()=>(e=>{const t=[];let n=0,o=!1;const a=(e,n)=>{const o=t[t.length-1];o&&o.kind===n?o.text+=e:t.push({text:e,kind:n})};for(;n<e.length;){const t=e[n];if(o){if("]"===t){a("]","class-bracket"),o=!1,n++;continue}if("\\"===t&&n+1<e.length){a(e.slice(n,n+2),"class-content"),n+=2;continue}a(t,"class-content"),n++}else{if("("===t&&"?"===e[n+1]){let t=2;const o=e[n+2];if(":"===o||"="===o||"!"===o)t=3;else if("<"===o){const o=e[n+3];if("="===o||"!"===o)t=4;else{const o=e.indexOf(">",n+2);-1!==o&&(t=o-n+1)}}a(e.slice(n,n+t),"group"),n+=t;continue}if("("!==t&&")"!==t)if("["!==t)if(ts.has(t)||ns.has(t))a(t,"anchor-quantifier"),n++;else{if("{"===t){const t=e.indexOf("}",n);if(t>n&&/^\{\d+,?\d*\}$/.test(e.slice(n,t+1))){a(e.slice(n,t+1),"anchor-quantifier"),n=t+1;continue}}if("\\"===t&&n+1<e.length){const t=e[n+1];es.test(t)?a(e.slice(n,n+2),"anchor-quantifier"):a(e.slice(n,n+2),"literal"),n+=2;continue}"|"!==t?(a(t,"literal"),n++):(a("|","alternation"),n++)}else"^"===e[n+1]?(a("[^","class-bracket"),n+=2):(a("[","class-bracket"),n++),o=!0;else a(t,"group"),n++}}return t})(e),[e]);return t(as,e?{"data-id":n,children:o.map((e,n)=>t(is,{$kind:e.kind,children:e.text},n))}:{"data-id":n,children:" "})},ss="rgba(102, 191, 255, 0.5)",rs=b`
21
+ `,fr=g.span`
22
+ background: ${({$kind:e})=>mr[e]};
23
+ `,br=({pattern:e,"data-id":n})=>{const o=a(()=>(e=>{const t=[];let n=0,o=!1;const a=(e,n)=>{const o=t[t.length-1];o&&o.kind===n?o.text+=e:t.push({text:e,kind:n})};for(;n<e.length;){const t=e[n];if(o){if("]"===t){a("]","class-bracket"),o=!1,n++;continue}if("\\"===t&&n+1<e.length){a(e.slice(n,n+2),"class-content"),n+=2;continue}a(t,"class-content"),n++}else{if("("===t&&"?"===e[n+1]){let t=2;const o=e[n+2];if(":"===o||"="===o||"!"===o)t=3;else if("<"===o){const o=e[n+3];if("="===o||"!"===o)t=4;else{const o=e.indexOf(">",n+2);-1!==o&&(t=o-n+1)}}a(e.slice(n,n+t),"group"),n+=t;continue}if("("!==t&&")"!==t)if("["!==t)if(pr.has(t)||hr.has(t))a(t,"anchor-quantifier"),n++;else{if("{"===t){const t=e.indexOf("}",n);if(t>n&&/^\{\d+,?\d*\}$/.test(e.slice(n,t+1))){a(e.slice(n,t+1),"anchor-quantifier"),n=t+1;continue}}if("\\"===t&&n+1<e.length){const t=e[n+1];ur.test(t)?a(e.slice(n,n+2),"anchor-quantifier"):a(e.slice(n,n+2),"literal"),n+=2;continue}"|"!==t?(a(t,"literal"),n++):(a("|","alternation"),n++)}else"^"===e[n+1]?(a("[^","class-bracket"),n+=2):(a("[","class-bracket"),n++),o=!0;else a(t,"group"),n++}}return t})(e),[e]);return t(gr,e?{"data-id":n,children:o.map((e,n)=>t(fr,{$kind:e.kind,children:e.text},n))}:{"data-id":n,children:" "})},yr="rgba(102, 191, 255, 0.5)",vr=b`
24
24
  font-family: ${({theme:e})=>e.font_family.code};
25
25
  font-size: 12px;
26
26
  line-height: 20px;
@@ -33,7 +33,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
33
33
  -moz-tab-size: 4;
34
34
  tab-size: 4;
35
35
  margin: 0;
36
- `,cs=g.div`
36
+ `,Cr=g.div`
37
37
  position: relative;
38
38
  width: 100%;
39
39
  min-height: ${({$minHeight:e})=>e}px;
@@ -45,8 +45,8 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
45
45
  &:focus-within {
46
46
  border-color: ${({theme:e})=>e.v2.colors.silver[300]};
47
47
  }
48
- `,ds=g.div`
49
- ${rs}
48
+ `,Sr=g.div`
49
+ ${vr}
50
50
  position: absolute;
51
51
  inset: 0;
52
52
  padding: 12px;
@@ -59,8 +59,8 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
59
59
  box-decoration-break: clone;
60
60
  -webkit-box-decoration-break: clone;
61
61
  }
62
- `,us=g.textarea`
63
- ${rs}
62
+ `,wr=g.textarea`
63
+ ${vr}
64
64
  position: relative;
65
65
  z-index: 1;
66
66
  display: block;
@@ -78,18 +78,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
78
78
  &::placeholder {
79
79
  color: ${({theme:e})=>e.v2.colors.silver[600]};
80
80
  }
81
- `,ps=e=>({before:e,matchPre:"",capture:"",matchPost:"",after:""}),hs=({regex:n,value:o,onChange:s,minHeight:r=240,...c})=>{const d=i(null),u=i(null),p=a(()=>((e,t)=>{if(!e||!t)return ps(t);let n;try{n=new RegExp(e)}catch{return ps(t)}const o=n.exec(t);if(!o)return ps(t);const a=o.index,i=o.index+o[0].length;if(o.length<2||null==o[1])return{before:t.slice(0,a),matchPre:"",capture:t.slice(a,i),matchPost:"",after:t.slice(i)};const l=o[0].indexOf(o[1]),s=l>=0?a+l:a,r=s+o[1].length;return{before:t.slice(0,a),matchPre:t.slice(a,s),capture:t.slice(s,r),matchPost:t.slice(r,i),after:t.slice(i)}})(n,o),[n,o]),h=l(()=>{d.current&&u.current&&(d.current.scrollTop=u.current.scrollTop,d.current.scrollLeft=u.current.scrollLeft)},[]);return e(cs,{$minHeight:r,children:[e(ds,{ref:d,"aria-hidden":!0,children:[p.before,t("span",{style:{background:ss},children:p.matchPre}),t("span",{style:{background:"rgba(102, 242, 102, 0.5)"},children:p.capture}),t("span",{style:{background:ss},children:p.matchPost}),p.after,o.endsWith("\n")?" ":""]}),t(us,{ref:u,$minHeight:r,value:o,onChange:e=>s(e.target.value),onScroll:h,spellCheck:!1,...c})]})},ms=g.div`
81
+ `,xr=e=>({before:e,matchPre:"",capture:"",matchPost:"",after:""}),kr=({regex:n,value:o,onChange:r,minHeight:s=240,...c})=>{const d=i(null),u=i(null),p=a(()=>((e,t)=>{if(!e||!t)return xr(t);let n;try{n=new RegExp(e)}catch{return xr(t)}const o=n.exec(t);if(!o)return xr(t);const a=o.index,i=o.index+o[0].length;if(o.length<2||null==o[1])return{before:t.slice(0,a),matchPre:"",capture:t.slice(a,i),matchPost:"",after:t.slice(i)};const l=o[0].indexOf(o[1]),r=l>=0?a+l:a,s=r+o[1].length;return{before:t.slice(0,a),matchPre:t.slice(a,r),capture:t.slice(r,s),matchPost:t.slice(s,i),after:t.slice(i)}})(n,o),[n,o]),h=l(()=>{d.current&&u.current&&(d.current.scrollTop=u.current.scrollTop,d.current.scrollLeft=u.current.scrollLeft)},[]);return e(Cr,{$minHeight:s,children:[e(Sr,{ref:d,"aria-hidden":!0,children:[p.before,t("span",{style:{background:yr},children:p.matchPre}),t("span",{style:{background:"rgba(102, 242, 102, 0.5)"},children:p.capture}),t("span",{style:{background:yr},children:p.matchPost}),p.after,o.endsWith("\n")?" ":""]}),t(wr,{ref:u,$minHeight:s,value:o,onChange:e=>r(e.target.value),onScroll:h,spellCheck:!1,...c})]})},Tr=g.div`
82
82
  flex: 1;
83
83
  min-height: 0;
84
84
  overflow-y: auto;
85
- `,gs=g.div`
85
+ `,$r=g.div`
86
86
  background: ${({theme:e})=>e.v2.colors.silver[900]};
87
87
  border-radius: 8px;
88
88
  padding: 8px;
89
89
  display: flex;
90
90
  flex-direction: column;
91
91
  gap: 12px;
92
- `,fs=g.div`
92
+ `,Ir=g.div`
93
93
  padding: 8px 16px;
94
94
  border-radius: 8px;
95
95
  background: ${({theme:e})=>e.v2.colors.silver[800]};
@@ -100,7 +100,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
100
100
  word-break: break-all;
101
101
  white-space: pre-wrap;
102
102
  user-select: text;
103
- `,bs=({isOpen:n,regex:o,onClose:i,initialTestString:l=""})=>{const[r,c]=s(l),d=a(()=>((e,t)=>{if(!e)return{ok:!0,isMatch:!1,message:oe.RESULT_EMPTY_REGEX};if(!t)return{ok:!0,isMatch:!1,message:oe.RESULT_EMPTY_INPUT};let n;try{n=new RegExp(e)}catch(e){return{ok:!1,message:e instanceof Error?e.message:oe.RESULT_INVALID_REGEX_FALLBACK}}const o=n.exec(t);return o?{ok:!0,isMatch:!0,message:o.length>1?o[1]:o[0]}:{ok:!0,isMatch:!1,message:oe.RESULT_NO_MATCH}})(o,r),[o,r]),u=d.ok?d.isMatch?"match":"neutral":"error";return t(ne,{isOpen:n,header:{title:oe.TITLE,onClose:()=>{c(""),i()}},children:t(ms,{children:e(gs,{children:[e(W,{$gap:6,children:[t(K,{label:oe.REGEX_LABEL}),t(ls,{pattern:o,"data-id":"regex-tester-regex"}),!o&&t(ae,{size:le.XXS,color:ie.Secondary,children:oe.REGEX_EMPTY_HINT})]}),e(W,{$gap:6,children:[e(se,{$width:"100%",$justifyContent:"space-between",$alignItems:"center",children:[t(K,{label:oe.TEST_STRING_LABEL}),t(re,{"data-id":"regex-tester-unescape",label:oe.UNESCAPE_LABEL,tooltip:oe.UNESCAPE_TOOLTIP,variant:de.Secondary,size:ce.S,onClick:()=>c(e=>(e=>{let t="";for(let n=0;n<e.length;n++){if("\\"===e[n]&&n+1<e.length){const o=e[n+1],a="n"===o?"\n":"t"===o?"\t":"r"===o?"\r":'"'===o?'"':"'"===o?"'":"\\"===o?"\\":null;if(null!=a){t+=a,n++;continue}}t+=e[n]}return t})(e)),disabled:(p=r,!/\\["'\\nrt]/.test(p))})]}),t(hs,{name:"regex-tester-test-string","data-id":"regex-tester-test-string",placeholder:oe.TEST_STRING_PLACEHOLDER,regex:o,value:r,onChange:c,minHeight:240}),t(J,{helpMessage:oe.TEST_STRING_HELP})]}),e(W,{$gap:8,children:[t(K,{label:oe.RESULT_LABEL}),t(fs,{$tone:u,"data-id":"regex-tester-result",children:d.message}),d.ok&&d.isMatch&&t(ae,{size:le.XXS,color:ie.Secondary,children:oe.RESULT_CAPTURE_HINT})]})]})})});var p},vs=j.ExtractAttribute;var ys;!function(e){e.Preset="preset",e.Regex="regex"}(ys||(ys={}));const Cs=[he.JSON,he.SQL,he.ResourcePath],Ss=(e=he.JSON)=>({targetAttributeName:"",lookupKey:"",dataFormat:e,regex:""}),ws=e=>!!e.regex&&!e.lookupKey&&!e.dataFormat,xs=g.div`
103
+ `,Er=({isOpen:n,regex:o,onClose:i,initialTestString:l=""})=>{const[s,c]=r(l),d=a(()=>((e,t)=>{if(!e)return{ok:!0,isMatch:!1,message:re.RESULT_EMPTY_REGEX};if(!t)return{ok:!0,isMatch:!1,message:re.RESULT_EMPTY_INPUT};let n;try{n=new RegExp(e)}catch(e){return{ok:!1,message:e instanceof Error?e.message:re.RESULT_INVALID_REGEX_FALLBACK}}const o=n.exec(t);return o?{ok:!0,isMatch:!0,message:o.length>1?o[1]:o[0]}:{ok:!0,isMatch:!1,message:re.RESULT_NO_MATCH}})(o,s),[o,s]),u=d.ok?d.isMatch?"match":"neutral":"error";return t(le,{isOpen:n,header:{title:re.TITLE,onClose:()=>{c(""),i()}},children:t(Tr,{children:e($r,{children:[e(q,{$gap:6,children:[t(Z,{label:re.REGEX_LABEL}),t(br,{pattern:o,"data-id":"regex-tester-regex"}),!o&&t(se,{size:de.XXS,color:ce.Secondary,children:re.REGEX_EMPTY_HINT})]}),e(q,{$gap:6,children:[e(ue,{$width:"100%",$justifyContent:"space-between",$alignItems:"center",children:[t(Z,{label:re.TEST_STRING_LABEL}),t(pe,{"data-id":"regex-tester-unescape",label:re.UNESCAPE_LABEL,tooltip:re.UNESCAPE_TOOLTIP,variant:me.Secondary,size:he.S,onClick:()=>c(e=>(e=>{let t="";for(let n=0;n<e.length;n++){if("\\"===e[n]&&n+1<e.length){const o=e[n+1],a="n"===o?"\n":"t"===o?"\t":"r"===o?"\r":'"'===o?'"':"'"===o?"'":"\\"===o?"\\":null;if(null!=a){t+=a,n++;continue}}t+=e[n]}return t})(e)),disabled:(p=s,!/\\["'\\nrt]/.test(p))})]}),t(kr,{name:"regex-tester-test-string","data-id":"regex-tester-test-string",placeholder:re.TEST_STRING_PLACEHOLDER,regex:o,value:s,onChange:c,minHeight:240}),t(ee,{helpMessage:re.TEST_STRING_HELP})]}),e(q,{$gap:8,children:[t(Z,{label:re.RESULT_LABEL}),t(Ir,{$tone:u,"data-id":"regex-tester-result",children:d.message}),d.ok&&d.isMatch&&t(se,{size:de.XXS,color:ce.Secondary,children:re.RESULT_CAPTURE_HINT})]})]})})});var p},Ar=J.ExtractAttribute;var Nr;!function(e){e.Preset="preset",e.Regex="regex"}(Nr||(Nr={}));const Or=[be.JSON,be.SQL,be.ResourcePath],Rr=(e=be.JSON)=>({targetAttributeName:"",lookupKey:"",dataFormat:e,regex:""}),Dr=e=>!!e.regex&&!e.lookupKey&&!e.dataFormat,Pr=g.div`
104
104
  width: 100%;
105
105
  background: ${({theme:e})=>e.v2.colors.silver[800]};
106
106
  border-radius: 8px;
@@ -108,13 +108,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
108
108
  display: flex;
109
109
  flex-direction: column;
110
110
  gap: 8px;
111
- `,ks=g.div`
111
+ `,Fr=g.div`
112
112
  flex: 1;
113
113
  min-width: 0;
114
- `,Ts=g.div`
114
+ `,Lr=g.div`
115
115
  /* Pushes the arrow down to sit next to the inputs rather than the field titles. */
116
116
  padding-top: 24px;
117
- `,$s=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),Is=e=>{const t={};return e.forEach(({oldKey:e,newKey:n})=>{t[e]=n}),t},Es=j.UrlTemplatizationRulesGroups,As=[{keyName:"kind",label:"Kind",placeholder:"Any kind",componentType:"dropdown",options:[{id:"Deployment",label:"Deployment"},{id:"StatefulSet",label:"StatefulSet"},{id:"DaemonSet",label:"DaemonSet"}]},{keyName:"name",label:"Name",placeholder:"Any name"}],Ns={[ye.K8sAttributes]:({value:a,setValue:i,formErrors:l})=>(o(()=>{a[j.CollectContainerAttributes]||a[j.CollectReplicaSetAttributes]||a[j.CollectWorkloadId]||a[j.CollectClusterId]||a[j.LabelsAttributes]?.length||a[j.AnnotationsAttributes]?.length||(i(j.CollectContainerAttributes,!0),i(j.CollectReplicaSetAttributes,!0),i(j.CollectWorkloadId,!0),i(j.CollectClusterId,!0),i(j.LabelsAttributes,[]),i(j.AnnotationsAttributes,[]))},[]),e(n,{children:[t(W,{$gap:6,children:Jl.map(({id:n,label:o})=>e(W,{children:[t(Y,{label:o,value:a[n]||!1,onChange:e=>i(n,e)}),t(J,{errorMessage:l[n]})]},n))}),t(q,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:Zl,values:a[j.LabelsAttributes]||[],setValues:e=>i(j.LabelsAttributes,e),errorMessage:l[j.LabelsAttributes]}),t(q,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:Ql,values:a[j.AnnotationsAttributes]||[],setValues:e=>i(j.AnnotationsAttributes,e),errorMessage:l[j.AnnotationsAttributes]})]})),[ye.AddClusterInfo]:({value:o,setValue:a,formErrors:i})=>{const l=f();return e(n,{children:[t(Q,{label:"Overwrite existing values",labelAlign:ee.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:o[j.OverwriteExistingValues]||!1,onChange:e=>a(j.OverwriteExistingValues,e)}),t(q,{name:"clusterAttributes",label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name",placeholder:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value",placeholder:"Attribute value"}],values:o[j.ClusterAttributes]||[],setValues:e=>a(j.ClusterAttributes,e),errorMessage:i[j.ClusterAttributes]})]})},[ye.DeleteAttributes]:({value:e,setValue:n,formErrors:o})=>t(te,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[j.AttributeNamesToDelete]||[],setValues:e=>n(j.AttributeNamesToDelete,e),errorMessage:o[j.AttributeNamesToDelete]}),[ye.RenameAttributes]:({value:e,setValue:n,formErrors:a})=>{const i=e[j.Renames],[l,r]=s(()=>$s(i));return o(()=>{((e,t)=>{const n=Object.keys(e),o=Object.keys(t);return n.length===o.length&&n.every(n=>Object.prototype.hasOwnProperty.call(t,n)&&t[n]===e[n])})(Is(l),i||{})||r($s(i))},[i]),t(q,{name:"renames",label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key",placeholder:"Old key"},{keyName:"newKey",label:"New key",placeholder:"New key"}],values:l,setValues:e=>{const t=e.map(e=>({oldKey:String(e.oldKey??""),newKey:String(e.newKey??"")}));r(t),n(j.Renames,Is(t))},errorMessage:a[j.Renames]})},[ye.PiiMasking]:({value:n,setValue:a,formErrors:i})=>(o(()=>{n[j.PiiCategories]?.length||a(j.PiiCategories,Yl.map(({id:e})=>e))},[]),e(W,{$gap:12,children:[t(K,{label:"Attributes to mask"}),t(W,{$gap:6,children:Yl.map(({id:e,label:o})=>t(Y,{label:o,value:n[j.PiiCategories]?.includes(e)||!1,onChange:t=>{const o=n[j.PiiCategories]||[],i=t?[...o,e]:o.filter(t=>t!==e);a(j.PiiCategories,i)}},e))}),t(J,{errorMessage:i[j.PiiCategories]})]})),[ye.URLTemplatization]:({value:o,setValue:a,formErrors:i})=>{const l=f(),s=o[Es]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>a(Es,e),d=(e,t)=>c(s.map((n,o)=>o===e?{...n,...t}:n));return e(n,{children:[s.map((n,o)=>e(r,{children:[t(ve,{}),e(W,{$gap:12,children:[e(se,{$justifyContent:"space-between",$alignItems:"center",children:[t(K,{label:`Rule Group ${o+1}`}),t(re,{leftIcon:()=>t(li,{fill:l.v2.colors.red[500]}),variant:de.Secondary,size:ce.S,onClick:()=>{return e=o,c(s.filter((t,n)=>n!==e));var e},disabled:1===s.length})]}),t(be,{name:`urlGroup-${o}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:n.filterK8sNamespace||"",onChange:e=>d(o,{filterK8sNamespace:e.target.value})}),t(q,{name:`urlGroup-${o}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:As,values:n.workloadFilters||[],setValues:e=>d(o,{workloadFilters:e})}),t(te,{name:`urlGroup-${o}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:n.templatizationRules.map(e=>e.template),setValues:e=>d(o,{templatizationRules:e.map(e=>({template:e}))})})]}),t(J,{errorMessage:i[Es]})]},`url-templatization-group-${o}`)),t(re,{variant:de.Secondary,label:"Add rule group",leftIcon:si,onClick:()=>c([...s,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(ve,{})]})},[ye.ExtractAttribute]:({value:n,setValue:a,formErrors:i})=>{const l=f(),r=i[vs],c=n[vs]?.extractions||[],[d,u]=s(()=>(e=>e.length&&e.some(ws)?ys.Regex:ys.Preset)(c)),[p,h]=s(null),m=e=>a(vs,{extractions:e});o(()=>{0===c.length&&m([d===ys.Preset?Ss():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const g=(e,t)=>{m(c.map((n,o)=>o===e?{...n,...t}:n))},b=()=>{m([...c,d===ys.Preset?Ss():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},v=d===ys.Preset,y=c.length?c:[v?Ss():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=p&&y[p]?.regex||"";return e(W,{$gap:16,$width:"100%",children:[t(ue,{options:[{value:ys.Preset,label:pe.SEGMENT_PRESET_LABEL,tooltip:pe.SEGMENT_PRESET_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]},{value:ys.Regex,label:pe.SEGMENT_REGEX_LABEL,tooltip:pe.SEGMENT_REGEX_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]}],selected:d,setSelected:e=>{u(e),m([e===ys.Preset?Ss():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(W,{$gap:8,$width:"100%",children:[y.map((n,o)=>{const a=o===y.length-1,i=n.dataFormat||he.JSON,s=ge[i];return e(xs,{"data-id":`extract-row-${o}`,children:[e(se,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(W,{$gap:10,children:[t(K,{label:v?pe.PRESET_ROW_TITLE(o):pe.REGEX_ROW_TITLE(o)}),v&&t(se,{$gap:24,children:Cs.map(e=>t(me,{"data-id":`extract-row-${o}-fmt-${e}`,size:fe.L,label:ge[e].label,value:i===e,onChange:t=>t&&g(o,{dataFormat:e})},`extract-row-${o}-fmt-${e}`))})]}),e(se,{$gap:4,$alignItems:"center",children:[!v&&t(re,{"data-id":`extract-row-${o}-test-regex`,label:pe.TEST_REGEX_LABEL,variant:de.Secondary,size:ce.S,onClick:()=>h(o),disabled:!n.regex?.trim()}),t(re,{"data-id":`extract-row-${o}-delete`,leftIcon:()=>t(li,{fill:l.v2.colors.red[500]}),variant:de.Secondary,size:ce.S,onClick:()=>(e=>{const t=c.filter((t,n)=>n!==e);m(t.length?t:[d===ys.Preset?Ss():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(o)}),a&&t(re,{"data-id":`extract-row-${o}-add`,leftIcon:si,variant:de.Secondary,size:ce.S,onClick:b})]})]}),v?e(se,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(ks,{children:t(be,{name:`extract-row-${o}-lookupKey`,label:s.keyLabel,placeholder:s.placeholder,helpMessage:s.helpMessage,width:"100%",value:n.lookupKey||"",onChange:e=>g(o,{lookupKey:e.target.value})})}),t(Ts,{children:t(ri,{size:24,fill:l.v2.colors.silver[200]})}),t(ks,{children:t(be,{name:`extract-row-${o}-targetAttributeName`,label:pe.TARGET_LABEL,placeholder:pe.TARGET_PLACEHOLDER,helpMessage:pe.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(o,{targetAttributeName:e.target.value})})})]}):e(W,{$gap:12,$width:"100%",children:[t(be,{name:`extract-row-${o}-regex`,label:pe.REGEX_LABEL,placeholder:pe.REGEX_PLACEHOLDER,helpMessage:pe.REGEX_HELP,width:"100%",value:n.regex||"",onChange:e=>g(o,{regex:e.target.value})}),t(be,{name:`extract-row-${o}-targetAttributeName`,label:pe.TARGET_LABEL,placeholder:pe.TARGET_PLACEHOLDER,helpMessage:pe.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(o,{targetAttributeName:e.target.value})})]})]},`extract-row-${o}`)}),t(J,{errorMessage:r})]}),t(bs,{isOpen:null!=p,regex:C,onClose:()=>h(null)})]})}},Os=({actionType:e,value:n,setValue:o,formErrors:a})=>{if(!e)return null;const i=Ns[e];return i?t(i,{value:n,setValue:o,formErrors:a}):null},Rs=()=>{const n=f(),{selectedOption:o,genericForm:a}=El();if(!a||!o)return t(Ce,{title:"No active form"});const{formData:i,handleFormChange:l,formErrors:s}=a;return e(W,{$gap:24,children:[e(se,{$gap:12,$justifyContent:"space-between",children:[t(Se,{size:le.XXXS,maxLines:2,children:o.docsDescription}),e(se,{$gap:12,children:[t(ue,{options:[{icon:ci,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:di,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:we.S,selected:i.disabled,setSelected:e=>l("disabled",e)}),t(re,{leftIcon:ui,variant:de.Secondary,size:ce.S,onClick:()=>window.open(`${xe}${o.docsEndpoint}`,"_blank","noopener noreferrer")})]})]}),t(sl,{title:"Signals for processing",allowedSignals:o.allowedSignals,selectedSignals:i.signals||[],setSelectedSignals:e=>l("signals",e),errorMessage:s.signals}),t(be,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:i.name||"",onChange:({target:{value:e}})=>l("name",e),errorMessage:s.name}),t(Os,{actionType:o.type,value:i.fields,setValue:(e,t)=>l(`fields.${e}`,t),formErrors:s}),t(ke,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:i.notes||"",onChange:({target:{value:e}})=>l("notes",e),errorMessage:s.notes})]})},Ds=({signals:e,fields:n,disabled:o,formData:a,handleFormChange:i,formErrors:l})=>n?.map(({renderCondition:n,componentType:s,type:r,name:c,title:d,tooltip:u,placeholder:p,value:h,required:m,options:g})=>{if(!(!n||Te(n,e,a.fields)))return null;const f=c,b=a.fields.find(e=>e.key===f),v=b?b.value:h;return t(rl,{componentType:s,inputType:r,name:f,label:d,tooltip:u,disabled:o,required:m,placeholder:p,errorMessage:l[f],dropdownOptions:g,value:v||"",setValue:e=>i(f,e)},f)}),Ps=g(se)`
117
+ `,Mr=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),_r=e=>{const t={};return e.forEach(({oldKey:e,newKey:n})=>{t[e]=n}),t},zr=J.UrlTemplatizationRulesGroups,Br=[{keyName:"kind",label:"Kind",placeholder:"Any kind",componentType:"dropdown",options:[{id:"Deployment",label:"Deployment"},{id:"StatefulSet",label:"StatefulSet"},{id:"DaemonSet",label:"DaemonSet"}]},{keyName:"name",label:"Name",placeholder:"Any name"}],Xr=e=>{if(Array.isArray(e))return e.map(e=>"string"==typeof e?{id:e,label:e}:e)},Vr=e=>{if(!Array.isArray(e)||e.length<3)return;const[t,n,o]=e;return e=>{const a=null==e?.[t]?"":String(e[t]);switch(n){case"=":case"==":case"===":return a===o;case"!=":case"!==":return a!==o;default:return!0}}},Ur=e=>{if(Array.isArray(e))return e.map(e=>{const t=e;return{keyName:String(t.keyName??t.name??""),label:t.label??t.displayName,tooltip:t.tooltip,placeholder:t.placeholder,helpMessage:t.helpMessage,componentType:t.componentType,options:Xr(t.options??t.values),fullRow:t.fullRow,defaultValue:t.defaultValue,withRegexTester:t.withRegexTester,separator:t.separator,copyByColumn:t.copyByColumn,renderCondition:Vr(t.renderCondition)}})},jr=e=>{if(Array.isArray(e))return e.map(e=>{if("string"==typeof e)return{id:e,label:e};const t=e;return{id:String(t.id??t.keyName??t.name??""),label:t.label??t.displayName??String(t.id??""),tooltip:t.tooltip,fields:Array.isArray(t.fields)?t.fields.map(Gr):void 0}})},Gr=e=>{const t="string"==typeof e.componentProperties?Te(e.componentProperties,{}):e.componentProps||{};return{name:e.name,componentType:e.componentType,inputType:e.inputType??t.inputType,title:e.displayName,tooltip:t.tooltip,placeholder:t.placeholder,helpMessage:t.helpMessage,required:t.required,initialValue:e.initialValue,renderCondition:e.renderCondition,options:Xr(t.options??t.values),itemWrapperKey:t.itemWrapperKey,columns:Ur(t.columns),limitFieldsPerRow:t.limitFieldsPerRow,variant:t.variant,wrapKey:t.wrapKey,checkboxOptions:jr(t.options??t.values),checkedValue:t.checkedValue??"true",valueMode:t.valueMode??"object",fields:Array.isArray(t.fields)?t.fields.map(Gr):void 0,addLabel:t.addLabel,itemLabel:t.itemLabel,keyLabel:t.titleKey??t.keyLabel,valueLabel:t.titleValue??t.valueLabel}},Hr=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),Wr=e=>Array.isArray(e)?e:[],Kr=e=>{const t={};return e.forEach(e=>{t[String(e.key??"")]=String(e.value??"")}),t},Yr=e=>Hr(e)?Object.entries(e).map(([e,t])=>({key:e,value:String(t??"")})):[],Jr=({field:e,value:n,setValue:a,errorMessage:i,disabled:l})=>{const[s,c]=r(()=>Yr(n));return o(()=>{const e=Hr(n)?n:{};((e,t)=>{const n=Object.keys(e),o=Object.keys(t);return n.length===o.length&&n.every(n=>Object.prototype.hasOwnProperty.call(t,n)&&t[n]===e[n])})(Kr(s),e)||c(Yr(n))},[n]),t(te,{name:e.name,label:e.title,tooltip:e.tooltip,helpMessage:e.helpMessage,required:e.required,disabled:l,limitFieldsPerRow:2,columns:[{keyName:"key",label:e.keyLabel||"Key",placeholder:e.keyLabel||"Key"},{keyName:"value",label:e.valueLabel||"Value",placeholder:e.valueLabel||"Value"}],values:s,setValues:e=>{c(e),a(Kr(e))},errorMessage:i})},qr=({field:o,value:a,setValue:i,errorMessage:l,disabled:s})=>{const{name:c,componentType:d,inputType:u,title:p,tooltip:h,placeholder:m,helpMessage:g,required:f,initialValue:b,options:y,itemWrapperKey:v,columns:C,limitFieldsPerRow:S,variant:w,wrapKey:x,checkboxOptions:k}=o,[T,$]=r({open:!1,value:""});if(d===xe.CheckboxList&&"array"===o.valueMode){const n=Wr(a),o=(e,t)=>i(t?[...n.filter(t=>t!==e),e]:n.filter(t=>t!==e));return e(q,{$gap:12,children:[p&&t(Z,{label:p,tooltip:h,required:f}),t(q,{$gap:8,children:(k||[]).map(e=>{const a=t(Q,{name:e.id,label:e.label,value:n.includes(e.id),disabled:s,onChange:t=>o(e.id,t)},e.id);return e.tooltip?t($e,{text:e.tooltip,withIcon:!0,children:a},e.id):a})}),t(ee,{errorMessage:l,helpMessage:g})]})}if(d===xe.CheckboxList){const n=Hr(a)?a:{},r=(e=>"emptyObject"!==e.checkedValue||{})(o),d=e=>"emptyObject"===o.checkedValue?Hr(e):!!e;return e(q,{$gap:12,children:[p&&t(se,{size:de.XS,color:ce.Secondary,nowrap:!0,children:p}),t(q,{$gap:12,children:(k||[]).map(o=>{const a=n[o.id],l=d(a),u=Hr(a)?a:{},p=t(Q,{label:o.label,value:l,disabled:s,onChange:e=>i({...n,[o.id]:e?Hr(a)?a:r:null})}),h=o.tooltip?t($e,{text:o.tooltip,withIcon:!0,children:p}):p,m=l&&o.fields?.length?t(q,{$gap:12,$padding:"0 0 0 24px",children:o.fields.map(e=>t(qr,{field:e,value:u[e.name],setValue:t=>i({...n,[o.id]:{...u,[e.name]:t}}),disabled:s},`${c}-${o.id}-${e.name}`))}):null;return e(q,{$gap:12,children:[h,m]},o.id)})}),t(ee,{errorMessage:l,helpMessage:g})]})}if(d===xe.MultiTabledInput){const o=Wr(x?a?.[x]:a),r=e=>i(x?{...Hr(a)?a:{},[x]:e}:e),d=(C||[]).some(e=>e.withRegexTester);return e(n,{children:[t("cards"===w?Ie:te,{name:c,label:p,tooltip:h,helpMessage:g,required:f,disabled:s,columns:C||[],limitFieldsPerRow:S,values:o,setValues:r,errorMessage:l,onTestRegex:d?e=>$({open:!0,value:e}):void 0}),d&&t(Er,{isOpen:T.open,regex:T.value,onClose:()=>$({open:!1,value:""})})]})}if(d===xe.MultiInput&&x){const e=Wr(a?.[x]);return t(ie,{name:c,label:p,tooltip:h,helpMessage:g,required:f,disabled:s,placeholder:m,values:e,setValues:e=>i({...Hr(a)?a:{},[x]:e}),errorMessage:l})}if(d===xe.MultiInput&&v){const e=Wr(a).map(e=>String(e?.[v]??""));return t(ie,{name:c,label:p,tooltip:h,helpMessage:g,required:f,disabled:s,placeholder:m,values:e,setValues:e=>i(e.map(e=>({[v]:e}))),errorMessage:l})}if(d===xe.KeyValuePair)return t(Jr,{field:o,value:a,setValue:i,errorMessage:l,disabled:s});return t(yl,{componentType:d,inputType:u,name:c,label:p,tooltip:h,helpMessage:g,disabled:s,required:f,placeholder:m,errorMessage:l,dropdownOptions:y,value:(null==a?b:a)??"",setValue:i})},Zr=({field:o,value:a,setValue:i,disabled:l})=>{const r=f(),c=Wr(a),d=c.length?c:[{}],u=o.fields||[],p=e=>i(e);return e(n,{children:[d.map((n,a)=>e(s,{children:[t(we,{}),e(q,{$gap:12,children:[e(ue,{$justifyContent:"space-between",$alignItems:"center",children:[t(Z,{label:`${o.itemLabel||o.title||"Item"} ${a+1}`}),t(pe,{leftIcon:()=>t(bi,{fill:r.v2.colors.red[500]}),variant:me.Secondary,size:he.S,onClick:()=>(e=>{const t=d.filter((t,n)=>n!==e);p(t)})(a),disabled:l||1===d.length})]}),u.map(e=>t(qr,{field:e,value:n[e.name],setValue:t=>((e,t,n)=>p(d.map((o,a)=>a===e?{...o,[t]:n}:o)))(a,e.name,t),disabled:l},`${o.name}-group-${a}-${e.name}`))]})]},`${o.name}-group-${a}`)),t(pe,{variant:me.Secondary,label:o.addLabel||"Add",leftIcon:yi,onClick:()=>p([...d,{}]),disabled:l}),t(we,{})]})},Qr=({field:n,value:o,setValue:a,errorMessage:i,disabled:l})=>e(q,{$gap:12,children:[n.title&&t(Z,{label:n.title,tooltip:n.tooltip,required:n.required}),t(q,{$gap:8,children:(n.checkboxOptions||[]).map(e=>{const n=t(Q,{name:e.id,label:e.label,value:!0===o?.[e.id],disabled:l,onChange:t=>a(e.id,t)},e.id);return e.tooltip?t($e,{text:e.tooltip,withIcon:!0,children:n},e.id):n})}),t(ee,{errorMessage:i,helpMessage:n.helpMessage})]}),es=({signals:e,fields:a,value:i,setValue:l,formErrors:r,disabled:s,seedInitialValues:c})=>{const d=(a||[]).filter(e=>!!e).map(e=>Gr(e));return o(()=>{if(!c)return;const e=i||{},t={};d.forEach(n=>{const o=(e=>{const t=e.initialValue;if(void 0!==t&&""!==t)return e.componentType===xe.CheckboxList?"array"===e.valueMode?Te(t,[]):Te(t,{}):e.componentType!==xe.MultiInput&&e.componentType!==xe.MultiTabledInput||!e.wrapKey?e.componentType===xe.MultiInput||e.componentType===xe.MultiTabledInput?Te(t,[]):t:{[e.wrapKey]:Te(t,[])}})(n);if(void 0===o)return;if(n.componentType===xe.CheckboxList&&"flatFields"===n.valueMode&&Hr(o))return void Object.entries(o).forEach(([n,o])=>{void 0!==e[n]&&null!==e[n]||(t[n]=o)});const a=e[n.name];null==a&&(t[n.name]=Hr(o)&&Hr(t[n.name])?{...t[n.name],...o}:o)}),Object.entries(t).forEach(([e,t])=>l(e,t))},[]),t(n,{children:d.map(n=>{const o=Object.entries(i||{}).map(([e,t])=>({name:e,value:t}));if(!(!n.renderCondition||ke(n.renderCondition,e,o)))return null;const a=i?.[n.name];if(n.componentType===xe.FieldGroup)return t(Zr,{field:n,value:a,setValue:e=>l(n.name,e),disabled:s},n.name);if(n.componentType===xe.CheckboxList&&"flatFields"===n.valueMode){const e=n.checkboxOptions?.map(e=>r[e.id]).find(Boolean);return t(Qr,{field:n,value:i||{},setValue:l,errorMessage:e,disabled:s},n.name)}return t(qr,{field:n,value:a,setValue:e=>l(n.name,e),errorMessage:r[n.name],disabled:s},n.name)})})},ts={[Ee.K8sAttributes]:({value:a,setValue:i,formErrors:l})=>(o(()=>{a[J.CollectContainerAttributes]||a[J.CollectReplicaSetAttributes]||a[J.CollectWorkloadId]||a[J.CollectClusterId]||a[J.LabelsAttributes]?.length||a[J.AnnotationsAttributes]?.length||(i(J.CollectContainerAttributes,!0),i(J.CollectReplicaSetAttributes,!0),i(J.CollectWorkloadId,!0),i(J.CollectClusterId,!0),i(J.LabelsAttributes,[]),i(J.AnnotationsAttributes,[]))},[]),e(n,{children:[t(q,{$gap:6,children:rr.map(({id:n,label:o})=>e(q,{children:[t(Q,{label:o,value:a[n]||!1,onChange:e=>i(n,e)}),t(ee,{errorMessage:l[n]})]},n))}),t(te,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:cr,values:a[J.LabelsAttributes]||[],setValues:e=>i(J.LabelsAttributes,e),errorMessage:l[J.LabelsAttributes]}),t(te,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:dr,values:a[J.AnnotationsAttributes]||[],setValues:e=>i(J.AnnotationsAttributes,e),errorMessage:l[J.AnnotationsAttributes]})]})),[Ee.AddClusterInfo]:({value:o,setValue:a,formErrors:i})=>{const l=f();return e(n,{children:[t(oe,{label:"Overwrite existing values",labelAlign:ae.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:o[J.OverwriteExistingValues]||!1,onChange:e=>a(J.OverwriteExistingValues,e)}),t(te,{name:"clusterAttributes",label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name",placeholder:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value",placeholder:"Attribute value"}],values:o[J.ClusterAttributes]||[],setValues:e=>a(J.ClusterAttributes,e),errorMessage:i[J.ClusterAttributes]})]})},[Ee.DeleteAttributes]:({value:e,setValue:n,formErrors:o})=>t(ie,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[J.AttributeNamesToDelete]||[],setValues:e=>n(J.AttributeNamesToDelete,e),errorMessage:o[J.AttributeNamesToDelete]}),[Ee.RenameAttributes]:({value:e,setValue:n,formErrors:a})=>{const i=e[J.Renames],[l,s]=r(()=>Mr(i));return o(()=>{((e,t)=>{const n=Object.keys(e),o=Object.keys(t);return n.length===o.length&&n.every(n=>Object.prototype.hasOwnProperty.call(t,n)&&t[n]===e[n])})(_r(l),i||{})||s(Mr(i))},[i]),t(te,{name:"renames",label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key",placeholder:"Old key"},{keyName:"newKey",label:"New key",placeholder:"New key"}],values:l,setValues:e=>{const t=e.map(e=>({oldKey:String(e.oldKey??""),newKey:String(e.newKey??"")}));s(t),n(J.Renames,_r(t))},errorMessage:a[J.Renames]})},[Ee.PiiMasking]:({value:n,setValue:a,formErrors:i})=>(o(()=>{n[J.PiiCategories]?.length||a(J.PiiCategories,lr.map(({id:e})=>e))},[]),e(q,{$gap:12,children:[t(Z,{label:"Attributes to mask"}),t(q,{$gap:6,children:lr.map(({id:e,label:o})=>t(Q,{label:o,value:n[J.PiiCategories]?.includes(e)||!1,onChange:t=>{const o=n[J.PiiCategories]||[],i=t?[...o,e]:o.filter(t=>t!==e);a(J.PiiCategories,i)}},e))}),t(ee,{errorMessage:i[J.PiiCategories]})]})),[Ee.URLTemplatization]:({value:o,setValue:a,formErrors:i})=>{const l=f(),r=o[zr]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>a(zr,e),d=(e,t)=>c(r.map((n,o)=>o===e?{...n,...t}:n));return e(n,{children:[r.map((n,o)=>e(s,{children:[t(we,{}),e(q,{$gap:12,children:[e(ue,{$justifyContent:"space-between",$alignItems:"center",children:[t(Z,{label:`Rule Group ${o+1}`}),t(pe,{leftIcon:()=>t(bi,{fill:l.v2.colors.red[500]}),variant:me.Secondary,size:he.S,onClick:()=>{return e=o,c(r.filter((t,n)=>n!==e));var e},disabled:1===r.length})]}),t(Se,{name:`urlGroup-${o}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:n.filterK8sNamespace||"",onChange:e=>d(o,{filterK8sNamespace:e.target.value})}),t(te,{name:`urlGroup-${o}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:Br,values:n.workloadFilters||[],setValues:e=>d(o,{workloadFilters:e})}),t(ie,{name:`urlGroup-${o}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:n.templatizationRules.map(e=>e.template),setValues:e=>d(o,{templatizationRules:e.map(e=>({template:e}))})})]}),t(ee,{errorMessage:i[zr]})]},`url-templatization-group-${o}`)),t(pe,{variant:me.Secondary,label:"Add rule group",leftIcon:yi,onClick:()=>c([...r,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(we,{})]})},[Ee.ExtractAttribute]:({value:n,setValue:a,formErrors:i})=>{const l=f(),s=i[Ar],c=n[Ar]?.extractions||[],[d,u]=r(()=>(e=>e.length&&e.some(Dr)?Nr.Regex:Nr.Preset)(c)),[p,h]=r(null),m=e=>a(Ar,{extractions:e});o(()=>{0===c.length&&m([d===Nr.Preset?Rr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const g=(e,t)=>{m(c.map((n,o)=>o===e?{...n,...t}:n))},b=()=>{m([...c,d===Nr.Preset?Rr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},y=d===Nr.Preset,v=c.length?c:[y?Rr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=p&&v[p]?.regex||"";return e(q,{$gap:16,$width:"100%",children:[t(ge,{options:[{value:Nr.Preset,label:fe.SEGMENT_PRESET_LABEL,tooltip:fe.SEGMENT_PRESET_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]},{value:Nr.Regex,label:fe.SEGMENT_REGEX_LABEL,tooltip:fe.SEGMENT_REGEX_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]}],selected:d,setSelected:e=>{u(e),m([e===Nr.Preset?Rr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(q,{$gap:8,$width:"100%",children:[v.map((n,o)=>{const a=o===v.length-1,i=n.dataFormat||be.JSON,r=ve[i];return e(Pr,{"data-id":`extract-row-${o}`,children:[e(ue,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(q,{$gap:10,children:[t(Z,{label:y?fe.PRESET_ROW_TITLE(o):fe.REGEX_ROW_TITLE(o)}),y&&t(ue,{$gap:24,children:Or.map(e=>t(ye,{"data-id":`extract-row-${o}-fmt-${e}`,size:Ce.L,label:ve[e].label,value:i===e,onChange:t=>t&&g(o,{dataFormat:e})},`extract-row-${o}-fmt-${e}`))})]}),e(ue,{$gap:4,$alignItems:"center",children:[!y&&t(pe,{"data-id":`extract-row-${o}-test-regex`,label:fe.TEST_REGEX_LABEL,variant:me.Secondary,size:he.S,onClick:()=>h(o),disabled:!n.regex?.trim()}),t(pe,{"data-id":`extract-row-${o}-delete`,leftIcon:()=>t(bi,{fill:l.v2.colors.red[500]}),variant:me.Secondary,size:he.S,onClick:()=>(e=>{const t=c.filter((t,n)=>n!==e);m(t.length?t:[d===Nr.Preset?Rr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(o)}),a&&t(pe,{"data-id":`extract-row-${o}-add`,leftIcon:yi,variant:me.Secondary,size:he.S,onClick:b})]})]}),y?e(ue,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(Fr,{children:t(Se,{name:`extract-row-${o}-lookupKey`,label:r.keyLabel,placeholder:r.placeholder,helpMessage:r.helpMessage,width:"100%",value:n.lookupKey||"",onChange:e=>g(o,{lookupKey:e.target.value})})}),t(Lr,{children:t(vi,{size:24,fill:l.v2.colors.silver[200]})}),t(Fr,{children:t(Se,{name:`extract-row-${o}-targetAttributeName`,label:fe.TARGET_LABEL,placeholder:fe.TARGET_PLACEHOLDER,helpMessage:fe.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(o,{targetAttributeName:e.target.value})})})]}):e(q,{$gap:12,$width:"100%",children:[t(Se,{name:`extract-row-${o}-regex`,label:fe.REGEX_LABEL,placeholder:fe.REGEX_PLACEHOLDER,helpMessage:fe.REGEX_HELP,width:"100%",value:n.regex||"",onChange:e=>g(o,{regex:e.target.value})}),t(Se,{name:`extract-row-${o}-targetAttributeName`,label:fe.TARGET_LABEL,placeholder:fe.TARGET_PLACEHOLDER,helpMessage:fe.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(o,{targetAttributeName:e.target.value})})]})]},`extract-row-${o}`)}),t(ee,{errorMessage:s})]}),t(Er,{isOpen:null!=p,regex:C,onClose:()=>h(null)})]})}},ns=({actionType:e,value:n,setValue:o,formErrors:a,dynamicFields:i,signals:l})=>{if(!e)return null;if(i?.length)return t(es,{fields:i,value:n,setValue:o,formErrors:a||{},signals:l||[],seedInitialValues:!0},e);const r=ts[e];return r?t(r,{value:n,setValue:o,formErrors:a}):null},os=()=>{const n=f(),{selectedOption:o,genericForm:a}=zl();if(!a||!o)return t(Ae,{title:"No active form"});const{formData:i,handleFormChange:l,formErrors:r}=a;return e(q,{$gap:24,children:[e(ue,{$gap:12,$justifyContent:"space-between",children:[t(Ne,{size:de.XXXS,maxLines:2,children:o.description}),e(ue,{$gap:12,children:[t(ge,{options:[{icon:Ci,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:Si,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:Oe.S,selected:i.disabled,setSelected:e=>l("disabled",e)}),t(pe,{leftIcon:wi,variant:me.Secondary,size:he.S,onClick:()=>o.docsUrl&&window.open(o.docsUrl,"_blank","noopener noreferrer")})]})]}),t(vl,{title:"Signals for processing",allowedSignals:o.allowedSignals,selectedSignals:i.signals||[],setSelectedSignals:e=>l("signals",e),errorMessage:r.signals}),t(Se,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:i.name||"",onChange:({target:{value:e}})=>l("name",e),errorMessage:r.name}),t(ns,{actionType:o.type,dynamicFields:o.fields,signals:i.signals||[],value:i.fields,setValue:(e,t)=>l(`fields.${e}`,t),formErrors:r}),t(Re,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:i.notes||"",onChange:({target:{value:e}})=>l("notes",e),errorMessage:r.notes})]})},as=({signals:e,fields:n,disabled:o,formData:a,handleFormChange:i,formErrors:l})=>n?.map(({renderCondition:n,componentType:r,type:s,name:c,title:d,tooltip:u,placeholder:p,value:h,required:m,options:g})=>{if(!(!n||ke(n,e,a.fields)))return null;const f=c,b=a.fields.find(e=>e.key===f),y=b?b.value:h;return t(yl,{componentType:r,inputType:s,name:f,label:d,tooltip:u,disabled:o,required:m,placeholder:p,errorMessage:l[f],dropdownOptions:g,value:y||"",setValue:e=>i(f,e)},f)}),is=g(ue)`
118
118
  position: sticky;
119
119
  bottom: 4px;
120
120
  align-self: center;
@@ -125,17 +125,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
125
125
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
126
126
  box-shadow: 0 4px 16.7px 0 rgba(0, 0, 0, 0.83);
127
127
  z-index: 1;
128
- `,Fs=c(({isEdit:n},a)=>{const i=f(),{isVm:l}=y(),{destinationsApi:r}=ll(),{activeForm:c,genericForm:u,validateFormData:p,thisUnsavedDestination:h,addUnsavedDestination:m,updateUnsavedDestination:g,deleteUnsavedDestination:b}=Al(),[v,C]=s(h?.testResult),[S,w]=s(!!h);o(()=>{h?(C(h.testResult),w(!0)):(C(void 0),w(!1))},[h]);const x=async()=>{if(!c?.option.testConnectionSupported||!u||l)return;const e=await r.testConnection(Oe(u.formData));return C(e),e};return d(a,()=>({testConnection:x,testConnectionSupported:!!c?.option.testConnectionSupported}),[c?.option.testConnectionSupported,u,r]),u&&c?e(W,{$gap:24,style:{minHeight:"100%"},children:[e(se,{$gap:12,$justifyContent:"space-between",children:[v?v.succeeded?t($e,{status:Ie.Success,message:v.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t($e,{status:Ie.Error,message:v.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(se,{$gap:12,children:[!l&&t(ue,{options:[{icon:ci,label:"Enabled",value:!1,selectedBgColor:i.v2.colors.green[800]},{icon:di,label:"Disabled",value:!0,selectedBgColor:i.v2.colors.red[800]}],size:we.S,selected:u.formData.disabled,setSelected:e=>u.handleFormChange("disabled",e),disabled:S}),t(re,{"data-id":"dest-form-docs",leftIcon:ui,variant:de.Secondary,size:ce.S,onClick:()=>window.open(`${xe}/backends/${c.option.type}`,"_blank","noopener noreferrer")})]})]}),t(sl,{title:"This connection will monitor:",allowedSignals:Ne(c.option.supportedSignals),selectedSignals:Ae(u.formData.exportedSignals),setSelectedSignals:e=>u.handleFormChange("exportedSignals",{logs:e.includes(Ee.Logs),metrics:e.includes(Ee.Metrics),traces:e.includes(Ee.Traces),profiles:e.includes(Ee.Profiles)}),disabled:S,errorMessage:u.formErrors.exportedSignals}),t(be,{name:"destinationName",label:"Destination name",placeholder:"Use a name that describes the destination...",value:u.formData.name,onChange:({target:{value:e}})=>u.handleFormChange("name",e),disabled:S,errorMessage:u.formErrors.name}),t(Ds,{signals:Ae(u.formData.exportedSignals),fields:c.dynamicFields,disabled:S,formData:u.formData,handleFormChange:(e,t)=>{u.handleFormChange("fields",u.formData.fields.map(n=>n.key===e?{...n,value:t}:n)),e&&u.formErrors[e]&&u.handleErrorChange(e,void 0)},formErrors:u.formErrors}),!n&&e(Ps,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(re,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:pi,variant:de.Secondary,textColor:i.v2.colors.red[500],onClick:()=>b(c.unsavedIdx)})}),!l&&(!h||h.option.testConnectionSupported&&!S)&&t("div",{style:{width:"150px"},children:t(re,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:de.Secondary,onClick:x})}),h&&t("div",S?{style:{width:"150px"},children:t(re,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:hi,variant:de.Secondary,onClick:()=>w(!1)})}:{style:{width:"150px"},children:t(re,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:de.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),n=!!e&&!e.succeeded;g(c.unsavedIdx,{formData:t,testResult:e},n)}}})}),!h&&t("div",{style:{width:"150px"},children:t(re,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:de.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),n=!!e&&!e.succeeded;m({formData:t,testResult:e},n)}}})})]})]}):t(Ce,{title:"No active form"})});Fs.displayName="AddDestinationForm";const Ls=[{id:Re.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Re.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Re.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],_s=[{id:Re.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Re.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Re.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Ms=["*"],zs=[{id:Fe.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:Fe.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:Fe.DbQuery,label:"Collect DB query",tooltip:""},{id:Fe.Messaging,label:"Collect messaging",tooltip:""}],Bs={[Me.Java]:[new _e("","")],[Me.Golang]:[new Le("")]},Xs={[ze.CodeAttributes]:({value:i,setValue:l,formErrors:s})=>{const r=s.codeAttributes,c=a(()=>Object.entries(i.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]);o(()=>{if(!c.length&&!r){const e={[Re.FilePath]:!0,[Re.Function]:!0,[Re.LineNumber]:!0,[Re.Column]:null,[Re.Namespace]:null,[Re.StackTrace]:null};l("codeAttributes",e)}},[]);const d=(e,t)=>{const n=t?[...c,e]:c.filter(t=>t!==e),o=Object.values(Re).reduce((e,t)=>(e[t]=!!n.includes(t)||null,e),{});l("codeAttributes",o)};return e(n,{children:[e(W,{$gap:12,children:[t(ae,{size:le.XS,color:ie.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(W,{$gap:6,children:Ls.map(({id:e,label:n,tooltip:o})=>t(De,{text:o,withIcon:!0,children:t(Y,{label:n,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(J,{errorMessage:r})]}),e(W,{$gap:12,children:[t(ae,{size:le.XS,color:ie.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(W,{$gap:6,children:_s.map(({id:e,label:n,tooltip:o})=>t(De,{text:o,withIcon:!0,children:t(Y,{label:n,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(J,{errorMessage:r})]})]})},[ze.CustomInstrumentation]:({value:i,setValue:l,formErrors:s})=>{const r=s.customInstrumentations,c=a(()=>(i?.customInstrumentations?.[Me.Golang]||[]).map(e=>new Le(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[i]),d=a(()=>(i?.customInstrumentations?.[Me.Java]||[]).map(e=>new _e(e.className,e.methodName)),[i]);return o(()=>{i?.customInstrumentations||r||l("customInstrumentations",{[Me.Golang]:Bs[Me.Golang],[Me.Java]:Bs[Me.Java]})},[]),e(n,{children:[e(W,{children:[e(se,{$gap:8,children:[t(mi,{}),t(K,{label:"Golang custom probes"})]}),t(q,{name:"golangProbes",columns:[{keyName:"packageName",label:"Package name",placeholder:"e.g. github.com/my-org/my-package",tooltip:"The full import path of the package containing the function or method to be instrumented."},{keyName:"functionName",label:"Function name",placeholder:"e.g. myFunction",tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{keyName:"receiverName",label:"Receiver name",placeholder:"e.g. myReceiver",tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{keyName:"receiverMethodName",label:"Receiver method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],values:c,setValues:e=>{const t={};t[Me.Golang]=e.map(e=>new Le(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[Me.Java]=d,l("customInstrumentations",t)},errorMessage:r,limitFieldsPerRow:2})]}),e(W,{children:[e(se,{$gap:8,children:[t(gi,{}),t(K,{label:"Java custom probes"})]}),t(q,{name:"javaProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. com.example.MyClass",tooltip:"The name of the class to be instrumented."},{keyName:"methodName",label:"Method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented."}],values:d,setValues:e=>{const t={};t[Me.Golang]=c,t[Me.Java]=e.map(e=>new _e(e.className,e.methodName)),l("customInstrumentations",t)},errorMessage:r,limitFieldsPerRow:2})]})]})},[ze.HeadersCollection]:({value:e,setValue:n,formErrors:i})=>{const l=i.headersCollection,s=a(()=>e?.headersCollection?.[Pe.HeaderKeys]||[],[e]),r=e=>{const t={[Pe.HeaderKeys]:e};n("headersCollection",t)};return o(()=>{s.length||l||r(Ms)},[]),t(te,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:s,setValues:r,errorMessage:l})},[ze.PayloadCollection]:({value:n,setValue:i,formErrors:l})=>{const s=l.payloadCollection,r=a(()=>Object.entries(n.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[n]);o(()=>{if(!r.length&&!s){const e={[Fe.HttpRequest]:{},[Fe.HttpResponse]:{},[Fe.DbQuery]:{},[Fe.Messaging]:{}};i("payloadCollection",e)}},[]);return e(W,{$gap:12,children:[t(ae,{size:le.XS,color:ie.Secondary,nowrap:!0,children:"Type of data to collect"}),t(W,{$gap:6,children:zs.map(({id:e,label:n,tooltip:o})=>t(De,{text:o,withIcon:!0,children:t(Y,{label:n,value:r.includes(e),onChange:t=>((e,t)=>{const n=t?[...r,e]:r.filter(t=>t!==e),o={[Fe.HttpRequest]:n.includes(Fe.HttpRequest)?{}:null,[Fe.HttpResponse]:n.includes(Fe.HttpResponse)?{}:null,[Fe.DbQuery]:n.includes(Fe.DbQuery)?{}:null,[Fe.Messaging]:n.includes(Fe.Messaging)?{}:null};i("payloadCollection",o)})(e,t)})},e))}),t(J,{errorMessage:s})]})},[ze.UnknownType]:null},Vs=({ruleType:e,value:n,setValue:o,formErrors:a})=>{if(!e)return null;const i=Xs[e];return i?t(i,{value:n,setValue:o,formErrors:a}):null},Us=()=>{const n=f(),{selectedOption:o,genericForm:a,sourceOptions:i,namespaceOptions:l}=Nl();if(!a||!o)return t(Ce,{title:"No active form"});const{formData:s,handleFormChange:r,formErrors:c}=a;return e(W,{$gap:24,children:[e(se,{$gap:12,$justifyContent:"space-between",children:[t(Se,{size:le.XXXS,maxLines:2,children:o.docsDescription}),e(se,{$gap:12,children:[t(ue,{options:[{icon:ci,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:di,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:we.S,selected:s.disabled,setSelected:e=>r("disabled",e)}),t(re,{leftIcon:ui,variant:de.Secondary,size:ce.S,onClick:()=>window.open(`${xe}${o.docsEndpoint}`,"_blank","noopener noreferrer")})]})]}),t(cl,{option:o,formState:s}),e(se,{$gap:12,children:[t(ae,{size:le.XS,color:ie.Secondary,nowrap:!0,children:"Supported Languages:"}),o.supportedLanguages.map(e=>t(Be,{label:Xe[e],leftIcon:Ve(e),backgroundColor:n.v2.colors.purple[900]},e))]}),t(dl,{scopes:s.sourceScopes,onChange:e=>r("sourceScopes",e),sourceOptions:i,namespaceOptions:l,supportedLanguages:o.type===ze.CustomInstrumentation?[]:o.supportedLanguages,dataIdPrefix:"instrumentation-rule",slim:!0}),t(be,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:s.ruleName,onChange:({target:{value:e}})=>r("ruleName",e),errorMessage:c.ruleName}),t(Vs,{ruleType:o.type,value:s,setValue:(e,t)=>r(e,t),formErrors:c}),t(ke,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:s.notes,onChange:({target:{value:e}})=>r("notes",e),errorMessage:c.notes})]})},Gs=()=>{const{pendingMerge:e,confirmMerge:n,cancelMerge:o}=Ol();if(!e)return null;const{existingName:a,editingName:i}=e;return t(Ue,{isOpen:!0,onClose:o,title:"Merge with existing Data Stream?",description:Ge.DATA_STREAM_MERGE_WARNING(i,a),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:de.Primary,onClick:n},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:de.Secondary,onClick:o}})},Hs=({autoFocus:n})=>{const{dataStreams:o}=He(),{genericForm:i,excludeName:l,editingName:s}=Ol(),{formData:r,formErrors:c,handleFormChange:d}=i,u=r.name,p=a(()=>o.find(e=>e.name===u&&e.name!==l),[o,u,l]);return e(W,{$width:"100%",$gap:12,children:[t(be,{name:"data-stream-name",label:Ge.STREAM_NAME,placeholder:Ge.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:Ge.STREAM_DESCRIPTION,required:!0,autoFocus:n,value:u,onChange:e=>d("name",e.target.value),errorMessage:c.name}),p&&t($e,{status:Ie.Warning,message:Ge.DATA_STREAM_MERGE_WARNING(s,p.name),fullWidth:!0})]})},js=()=>{const{selectedStreamName:e}=He(),{genericForm:n}=Rl();if(!n)return t(Ce,{title:"No active form"});const{formData:o,handleFormChange:a,formErrors:i}=n;return t(be,{name:"sourceName",label:Ge.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:o.otelServiceName,onChange:({target:{value:t}})=>{a("otelServiceName",t),a("currentStreamName",e)},errorMessage:i.otelServiceName})},Ws=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Ks=g.div`
128
+ `,ls=c(({isEdit:n},a)=>{const i=f(),{isVm:l}=v(),{destinationsApi:s}=bl(),{activeForm:c,genericForm:u,validateFormData:p,thisUnsavedDestination:h,addUnsavedDestination:m,updateUnsavedDestination:g,deleteUnsavedDestination:b}=Bl(),[y,C]=r(h?.testResult),[S,w]=r(!!h);o(()=>{h?(C(h.testResult),w(!0)):(C(void 0),w(!1))},[h]);const x=async()=>{if(!c?.option.testConnectionSupported||!u||l)return;const e=await s.testConnection(ze(u.formData));return C(e),e};return d(a,()=>({testConnection:x,testConnectionSupported:!!c?.option.testConnectionSupported}),[c?.option.testConnectionSupported,u,s]),u&&c?e(q,{$gap:24,style:{minHeight:"100%"},children:[e(ue,{$gap:12,$justifyContent:"space-between",children:[y?y.succeeded?t(De,{status:Pe.Success,message:y.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(De,{status:Pe.Error,message:y.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(ue,{$gap:12,children:[!l&&t(ge,{options:[{icon:Ci,label:"Enabled",value:!1,selectedBgColor:i.v2.colors.green[800]},{icon:Si,label:"Disabled",value:!0,selectedBgColor:i.v2.colors.red[800]}],size:Oe.S,selected:u.formData.disabled,setSelected:e=>u.handleFormChange("disabled",e),disabled:S}),t(pe,{"data-id":"dest-form-docs",leftIcon:wi,variant:me.Secondary,size:he.S,onClick:()=>window.open(`${Fe}/backends/${c.option.type}`,"_blank","noopener noreferrer")})]})]}),t(vl,{title:"This connection will monitor:",allowedSignals:_e(c.option.supportedSignals),selectedSignals:Me(u.formData.exportedSignals),setSelectedSignals:e=>u.handleFormChange("exportedSignals",{logs:e.includes(Le.Logs),metrics:e.includes(Le.Metrics),traces:e.includes(Le.Traces),profiles:e.includes(Le.Profiles)}),disabled:S,errorMessage:u.formErrors.exportedSignals}),t(Se,{name:"destinationName",label:"Destination name",placeholder:"Use a name that describes the destination...",value:u.formData.name,onChange:({target:{value:e}})=>u.handleFormChange("name",e),disabled:S,errorMessage:u.formErrors.name}),t(as,{signals:Me(u.formData.exportedSignals),fields:c.dynamicFields,disabled:S,formData:u.formData,handleFormChange:(e,t)=>{u.handleFormChange("fields",u.formData.fields.map(n=>n.key===e?{...n,value:t}:n)),e&&u.formErrors[e]&&u.handleErrorChange(e,void 0)},formErrors:u.formErrors}),!n&&e(is,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(pe,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:xi,variant:me.Secondary,textColor:i.v2.colors.red[500],onClick:()=>b(c.unsavedIdx)})}),!l&&(!h||h.option.testConnectionSupported&&!S)&&t("div",{style:{width:"150px"},children:t(pe,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:me.Secondary,onClick:x})}),h&&t("div",S?{style:{width:"150px"},children:t(pe,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:ki,variant:me.Secondary,onClick:()=>w(!1)})}:{style:{width:"150px"},children:t(pe,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:me.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),n=!!e&&!e.succeeded;g(c.unsavedIdx,{formData:t,testResult:e},n)}}})}),!h&&t("div",{style:{width:"150px"},children:t(pe,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:me.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),n=!!e&&!e.succeeded;m({formData:t,testResult:e},n)}}})})]})]}):t(Ae,{title:"No active form"})});ls.displayName="AddDestinationForm";const rs=[{id:Be.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Be.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Be.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],ss=[{id:Be.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Be.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Be.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],cs=["*"],ds=[{id:Ve.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:Ve.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:Ve.DbQuery,label:"Collect DB query",tooltip:""},{id:Ve.Messaging,label:"Collect messaging",tooltip:""}],us={[Ge.Java]:[new je("","")],[Ge.Golang]:[new Ue("")]},ps={[He.CodeAttributes]:({value:i,setValue:l,formErrors:r})=>{const s=r.codeAttributes,c=a(()=>Object.entries(i.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]);o(()=>{if(!c.length&&!s){const e={[Be.FilePath]:!0,[Be.Function]:!0,[Be.LineNumber]:!0,[Be.Column]:null,[Be.Namespace]:null,[Be.StackTrace]:null};l("codeAttributes",e)}},[]);const d=(e,t)=>{const n=t?[...c,e]:c.filter(t=>t!==e),o=Object.values(Be).reduce((e,t)=>(e[t]=!!n.includes(t)||null,e),{});l("codeAttributes",o)};return e(n,{children:[e(q,{$gap:12,children:[t(se,{size:de.XS,color:ce.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(q,{$gap:6,children:rs.map(({id:e,label:n,tooltip:o})=>t($e,{text:o,withIcon:!0,children:t(Q,{label:n,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(ee,{errorMessage:s})]}),e(q,{$gap:12,children:[t(se,{size:de.XS,color:ce.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(q,{$gap:6,children:ss.map(({id:e,label:n,tooltip:o})=>t($e,{text:o,withIcon:!0,children:t(Q,{label:n,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(ee,{errorMessage:s})]})]})},[He.CustomInstrumentation]:({value:i,setValue:l,formErrors:r})=>{const s=r.customInstrumentations,c=a(()=>(i?.customInstrumentations?.[Ge.Golang]||[]).map(e=>new Ue(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[i]),d=a(()=>(i?.customInstrumentations?.[Ge.Java]||[]).map(e=>new je(e.className,e.methodName)),[i]);return o(()=>{i?.customInstrumentations||s||l("customInstrumentations",{[Ge.Golang]:us[Ge.Golang],[Ge.Java]:us[Ge.Java]})},[]),e(n,{children:[e(q,{children:[e(ue,{$gap:8,children:[t(Ti,{}),t(Z,{label:"Golang custom probes"})]}),t(te,{name:"golangProbes",columns:[{keyName:"packageName",label:"Package name",placeholder:"e.g. github.com/my-org/my-package",tooltip:"The full import path of the package containing the function or method to be instrumented."},{keyName:"functionName",label:"Function name",placeholder:"e.g. myFunction",tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{keyName:"receiverName",label:"Receiver name",placeholder:"e.g. myReceiver",tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{keyName:"receiverMethodName",label:"Receiver method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],values:c,setValues:e=>{const t={};t[Ge.Golang]=e.map(e=>new Ue(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[Ge.Java]=d,l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]}),e(q,{children:[e(ue,{$gap:8,children:[t($i,{}),t(Z,{label:"Java custom probes"})]}),t(te,{name:"javaProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. com.example.MyClass",tooltip:"The name of the class to be instrumented."},{keyName:"methodName",label:"Method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented."}],values:d,setValues:e=>{const t={};t[Ge.Golang]=c,t[Ge.Java]=e.map(e=>new je(e.className,e.methodName)),l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]})]})},[He.HeadersCollection]:({value:e,setValue:n,formErrors:i})=>{const l=i.headersCollection,r=a(()=>e?.headersCollection?.[Xe.HeaderKeys]||[],[e]),s=e=>{const t={[Xe.HeaderKeys]:e};n("headersCollection",t)};return o(()=>{r.length||l||s(cs)},[]),t(ie,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:r,setValues:s,errorMessage:l})},[He.PayloadCollection]:({value:n,setValue:i,formErrors:l})=>{const r=l.payloadCollection,s=a(()=>Object.entries(n.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[n]);o(()=>{if(!s.length&&!r){const e={[Ve.HttpRequest]:{},[Ve.HttpResponse]:{},[Ve.DbQuery]:{},[Ve.Messaging]:{}};i("payloadCollection",e)}},[]);return e(q,{$gap:12,children:[t(se,{size:de.XS,color:ce.Secondary,nowrap:!0,children:"Type of data to collect"}),t(q,{$gap:6,children:ds.map(({id:e,label:n,tooltip:o})=>t($e,{text:o,withIcon:!0,children:t(Q,{label:n,value:s.includes(e),onChange:t=>((e,t)=>{const n=t?[...s,e]:s.filter(t=>t!==e),o={[Ve.HttpRequest]:n.includes(Ve.HttpRequest)?{}:null,[Ve.HttpResponse]:n.includes(Ve.HttpResponse)?{}:null,[Ve.DbQuery]:n.includes(Ve.DbQuery)?{}:null,[Ve.Messaging]:n.includes(Ve.Messaging)?{}:null};i("payloadCollection",o)})(e,t)})},e))}),t(ee,{errorMessage:r})]})},[He.UnknownType]:null},hs=({ruleType:e,value:n,setValue:o,formErrors:a,dynamicFields:i})=>{if(!e)return null;if(i?.length)return t(es,{fields:i,value:n,setValue:o,formErrors:a||{},signals:[],seedInitialValues:!0});const l=ps[e];return l?t(l,{value:n,setValue:o,formErrors:a}):null},ms=()=>{const n=f(),{isVm:o}=v(),{selectedOption:a,genericForm:i,sourceOptions:l,namespaceOptions:r}=Xl();if(!i||!a)return t(Ae,{title:"No active form"});const{formData:s,handleFormChange:c,formErrors:d}=i;return e(q,{$gap:24,children:[e(ue,{$gap:12,$justifyContent:"space-between",children:[t(Ne,{size:de.XXXS,maxLines:2,children:a.description}),e(ue,{$gap:12,children:[t(ge,{options:[{icon:Ci,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:Si,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:Oe.S,selected:s.disabled,setSelected:e=>c("disabled",e)}),t(pe,{leftIcon:wi,variant:me.Secondary,size:he.S,onClick:()=>a.docsUrl&&window.open(a.docsUrl,"_blank","noopener noreferrer")})]})]}),t(Cl,{option:a,formState:s}),e(ue,{$gap:12,children:[t(se,{size:de.XS,color:ce.Secondary,nowrap:!0,children:"Supported Languages:"}),a.supportedLanguages.map(e=>t(We,{label:Ke[e],leftIcon:Ye(e),backgroundColor:n.v2.colors.purple[900]},e))]}),!o&&t(Sl,{scopes:s.sourceScopes,onChange:e=>c("sourceScopes",e),sourceOptions:l,namespaceOptions:r,supportedLanguages:a.type===He.CustomInstrumentation?[]:a.supportedLanguages,dataIdPrefix:"instrumentation-rule",slim:!0}),t(Se,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:s.ruleName,onChange:({target:{value:e}})=>c("ruleName",e),errorMessage:d.ruleName}),t(hs,{ruleType:a.type,dynamicFields:a.fields,value:s,setValue:(e,t)=>c(e,t),formErrors:d}),t(Re,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:s.notes,onChange:({target:{value:e}})=>c("notes",e),errorMessage:d.notes})]})},gs=()=>{const{pendingMerge:e,confirmMerge:n,cancelMerge:o}=Vl();if(!e)return null;const{existingName:a,editingName:i}=e;return t(Je,{isOpen:!0,onClose:o,title:"Merge with existing Data Stream?",description:qe.DATA_STREAM_MERGE_WARNING(i,a),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:me.Primary,onClick:n},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:me.Secondary,onClick:o}})},fs=({autoFocus:n})=>{const{dataStreams:o}=Ze(),{genericForm:i,excludeName:l,editingName:r}=Vl(),{formData:s,formErrors:c,handleFormChange:d}=i,u=s.name,p=a(()=>o.find(e=>e.name===u&&e.name!==l),[o,u,l]);return e(q,{$width:"100%",$gap:12,children:[t(Se,{name:"data-stream-name",label:qe.STREAM_NAME,placeholder:qe.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:qe.STREAM_DESCRIPTION,required:!0,autoFocus:n,value:u,onChange:e=>d("name",e.target.value),errorMessage:c.name}),p&&t(De,{status:Pe.Warning,message:qe.DATA_STREAM_MERGE_WARNING(r,p.name),fullWidth:!0})]})},bs=()=>{const{selectedStreamName:e}=Ze(),{genericForm:n}=Ul();if(!n)return t(Ae,{title:"No active form"});const{formData:o,handleFormChange:a,formErrors:i}=n;return t(Se,{name:"sourceName",label:qe.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:o.otelServiceName,onChange:({target:{value:t}})=>{a("otelServiceName",t),a("currentStreamName",e)},errorMessage:i.otelServiceName})},ys=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],vs=g.div`
129
129
  display: flex;
130
130
  flex-direction: column;
131
131
  gap: 24px;
132
- `,Ys=g.div`
132
+ `,Cs=g.div`
133
133
  display: contents;
134
134
  & > * {
135
135
  opacity: ${({$faded:e})=>e?.4:1};
136
136
  transition: opacity 0.2s ease;
137
137
  }
138
- `,Js=({value:e})=>{const n=f();return t(Be,e?{status:Ie.Success,label:Ze,leftIcon:ci}:{label:Qe,leftIcon:di,backgroundColor:n.v2.colors.silver[500],textColor:n.v2.colors.white[500]})},qs=({value:e,onChange:n})=>{const o=f(),i=a(()=>[{icon:ci,label:Ze,value:!0,selectedBgColor:o.v2.colors.green[800]},{icon:di,label:Qe,value:!1,selectedBgColor:o.v2.colors.silver[500]}],[o]);return t(ue,{options:i,selected:e,setSelected:n??(()=>{}),disabled:!n})},Zs=()=>{const e=Dl();switch(e.formType){case Pl.Create:return t(Qs,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(qs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case Pl.View:return e.data?e.isEditing?t(Qs,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(qs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(er,{data:e.data,renderAction:()=>t(Js,{value:!e.data?.rule.disabled})}):null;case Pl.EditAutoNoisy:return t(tr,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:qe,sectionTitle:Ke,sectionSubTitle:Je,presetLabel:We,customInputName:"sampling-auto-input-custom-percentage",percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(qs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Pl.EditAutoCostReduction:return t(tr,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:Ye,sectionTitle:Ke,presetLabel:We,customInputName:"sampling-cr-auto-input-custom-percentage",showModeToggle:!1,percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(qs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Pl.EditAutoHighlyRelevant:return t(Ks,{children:t(ul,{title:e.localEnabled?void 0:je,summary:e.summary,renderAction:()=>t(qs,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},Qs=({category:n,formData:o,onChange:a,sourceOptions:i,namespaceOptions:l,renderAction:s})=>e(Ks,{children:[t(ml,{category:n,formState:o,renderAction:s}),e(Ys,{$faded:!!o.disabled,children:[t(gl,{category:n,formState:o,onChange:a}),t(dl,{scopes:o.sourceScopes,onChange:e=>a({sourceScopes:e}),sourceOptions:i,namespaceOptions:l,titleNumber:1,dataIdPrefix:"sampling"}),t(fl,{category:n,formState:o,onChange:a}),"highlyRelevant"===n&&t(bl,{formState:o,onChange:a}),"highlyRelevant"===n&&t(vl,{ruleType:o.ruleType,formState:o,onChange:a}),t(yl,{category:n,formState:o,onChange:a})]})]}),er=({data:n,renderAction:o})=>e(Ks,{children:[t(ml,{readOnly:!0,summary:n.summary,renderAction:o}),t(gl,{readOnly:!0,data:n}),t(dl,{readOnly:!0,scopes:C(n.rule.sourceScopes)}),t(fl,{readOnly:!0,data:n}),t(yl,{readOnly:!0,data:n}),"highlyRelevant"===n.category&&t(vl,{readOnly:!0,rule:n.rule})]}),tr=({enabled:n,summary:o,inactiveTitle:a,sectionTitle:i,sectionSubTitle:s,presetLabel:r,customInputName:c,showModeToggle:d=!0,percentageMode:u,setPercentageMode:p,percentagePreset:h,setPercentagePreset:m,customPercentage:g,setCustomPercentage:f,renderAction:b})=>{const v=l(e=>p(e),[p]),y=l(e=>m(e),[m]),C=l(e=>f(e.target.value),[f]),S=!d||"sample"===u;return e(Ks,{children:[t(ul,{title:n?void 0:a,summary:o,renderAction:b}),t(Ys,{$faded:!n,children:e(et,{richTitle:{title:i,subTitle:s},children:[d&&t(W,{$alignItems:"flex-start",children:t(ue,{options:Ws,selected:u,setSelected:v})}),S&&t(pl,{description:r,options:hl,selected:h,onSelect:y,customName:c,customLabel:tt,customPlaceholder:"5%",customValue:g,onCustomChange:C})]})})]})},nr=g.div`
138
+ `,Ss=({value:e})=>{const n=f();return t(We,e?{status:Pe.Success,label:it,leftIcon:Ci}:{label:lt,leftIcon:Si,backgroundColor:n.v2.colors.silver[500],textColor:n.v2.colors.white[500]})},ws=({value:e,onChange:n})=>{const o=f(),i=a(()=>[{icon:Ci,label:it,value:!0,selectedBgColor:o.v2.colors.green[800]},{icon:Si,label:lt,value:!1,selectedBgColor:o.v2.colors.silver[500]}],[o]);return t(ge,{options:i,selected:e,setSelected:n??(()=>{}),disabled:!n})},xs=()=>{const e=jl();switch(e.formType){case Gl.Create:return t(ks,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(ws,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case Gl.View:return e.data?e.isEditing?t(ks,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(ws,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(Ts,{data:e.data,renderAction:()=>t(Ss,{value:!e.data?.rule.disabled})}):null;case Gl.EditAutoNoisy:return t($s,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:at,sectionTitle:tt,sectionSubTitle:ot,presetLabel:et,customInputName:"sampling-auto-input-custom-percentage",percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(ws,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Gl.EditAutoCostReduction:return t($s,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:nt,sectionTitle:tt,presetLabel:et,customInputName:"sampling-cr-auto-input-custom-percentage",showModeToggle:!1,percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(ws,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Gl.EditAutoHighlyRelevant:return t(vs,{children:t(wl,{title:e.localEnabled?void 0:Qe,summary:e.summary,renderAction:()=>t(ws,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},ks=({category:n,formData:o,onChange:a,sourceOptions:i,namespaceOptions:l,renderAction:r})=>e(vs,{children:[t(Tl,{category:n,formState:o,renderAction:r}),e(Cs,{$faded:!!o.disabled,children:[t($l,{category:n,formState:o,onChange:a}),t(Sl,{scopes:o.sourceScopes,onChange:e=>a({sourceScopes:e}),sourceOptions:i,namespaceOptions:l,titleNumber:1,dataIdPrefix:"sampling"}),t(Il,{category:n,formState:o,onChange:a}),"highlyRelevant"===n&&t(El,{formState:o,onChange:a}),"highlyRelevant"===n&&t(Al,{ruleType:o.ruleType,formState:o,onChange:a}),t(Nl,{category:n,formState:o,onChange:a})]})]}),Ts=({data:n,renderAction:o})=>e(vs,{children:[t(Tl,{readOnly:!0,summary:n.summary,renderAction:o}),t($l,{readOnly:!0,data:n}),t(Sl,{readOnly:!0,scopes:C(n.rule.sourceScopes)}),t(Il,{readOnly:!0,data:n}),t(Nl,{readOnly:!0,data:n}),"highlyRelevant"===n.category&&t(Al,{readOnly:!0,rule:n.rule})]}),$s=({enabled:n,summary:o,inactiveTitle:a,sectionTitle:i,sectionSubTitle:r,presetLabel:s,customInputName:c,showModeToggle:d=!0,percentageMode:u,setPercentageMode:p,percentagePreset:h,setPercentagePreset:m,customPercentage:g,setCustomPercentage:f,renderAction:b})=>{const y=l(e=>p(e),[p]),v=l(e=>m(e),[m]),C=l(e=>f(e.target.value),[f]),S=!d||"sample"===u;return e(vs,{children:[t(wl,{title:n?void 0:a,summary:o,renderAction:b}),t(Cs,{$faded:!n,children:e(rt,{richTitle:{title:i,subTitle:r},children:[d&&t(q,{$alignItems:"flex-start",children:t(ge,{options:ys,selected:u,setSelected:y})}),S&&t(xl,{description:s,options:kl,selected:h,onSelect:v,customName:c,customLabel:st,customPlaceholder:"5%",customValue:g,onCustomChange:C})]})})]})},Is=g.div`
139
139
  display: flex;
140
140
  align-items: center;
141
141
  justify-content: space-between;
@@ -148,27 +148,27 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
148
148
  &:hover {
149
149
  background-color: ${({$isSelected:e,$purpleColors:t,theme:n})=>n.v2.colors[t?"purple":"silver"][e?"700":"800"]};
150
150
  }
151
- `,or=g.div`
151
+ `,Es=g.div`
152
152
  display: flex;
153
153
  align-items: center;
154
154
  justify-content: center;
155
155
  padding: 8px;
156
156
  border-radius: 8px;
157
- background-color: ${({theme:e})=>e.v2.colors.white[500]+nt["004"]};
158
- `,ar=({dataId:n,icon:o,title:a,description:i,withCarret:l,purpleColors:s,disabled:r,children:c,isSelected:d,onClick:u,isChecked:p,isPartiallyChecked:h,onCheckboxChange:m})=>e(nr,{"data-id":n||`list-item-${a}`,$isSelected:d,$purpleColors:s,$disabled:r,onClick:()=>!d&&!r&&u(),children:[e(W,{$gap:4,children:[e(se,{$gap:12,children:[m&&t(Y,{partiallyChecked:h||!1,value:p||!1,onChange:e=>m(e)}),o&&t(or,{children:t(o,{size:20})}),t(ae,{size:le.XS,children:a})]}),i&&t(ae,{size:le.XXXS,color:ie.Secondary,children:i})]}),(l||c)&&e(se,{$gap:8,children:[c,l&&t(fi,{size:18})]})]}),ir=({onClose:e,selectedConnectionIds:n,setSelectedConnectionIds:o,withOverlay:l})=>{const{actionsApi:r}=ll(),[c,d]=s(""),u=i(null),{selectedOption:p,onSelectOption:h,genericForm:m,validateFormData:g}=El(),f=a(()=>(c?ot.filter(e=>e?.label?.toLowerCase().includes(c.toLowerCase())):ot).filter(e=>!!e),[c]),b=a(()=>f.map(e=>{const n=p?.type===e.type;return t(ar,{dataId:e.type?`option-${e.type}`:void 0,title:e.label,description:e.description,withCarret:!0,isSelected:n,onClick:()=>{u.current?.clearErrors(),h(e)}},e.type)}),[p?.type,f.length,h]),v=a(()=>p?[t(Rs,{},p.type)]:[t(at,{$height:"100%",children:t(Ce,{icon:bi,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[p]);return t(Cl,{ref:u,isOpen:!0,withOverlay:l,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=g();if(e)return!1;await r.create(t)},disableSave:!p||!m?.isFormDirty,isFormDirty:m?.isFormDirty,hideDirtyNote:!0,progress:{title:Ge.CREATING_ACTION,subTitle:Ge.CREATING_ACTION_SUBTITLE},header:{icon:bi,title:Ge.ADD_ACTION,subTitle:Ge.ADD_ACTION_DESCRIPTION},connectionIds:n&&o?{value:n,setValue:o}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:b},rightColumn:{width:"60%",list:v}})},lr=({destinationsByCategory:o,filters:i,setFilters:l})=>{const s=a(()=>Object.values(it).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})).filter(e=>o[e.id]?.length),[o]),r=a(()=>{const e=Object.values(Ee).map(e=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}));return e.unshift({value:null,label:"All"}),e},[]);return e(n,{children:[t(lt,{placeholder:"Select category",options:s,values:i.categoryType?[i.categoryType]:[],setValues:e=>l({...i,categoryType:i.categoryType===e[0]?null:e[0]})}),t(ue,{options:r,selected:i.signalType,setSelected:e=>l({...i,signalType:e})})]})},sr=g.div`
157
+ background-color: ${({theme:e})=>e.v2.colors.white[500]+ct["004"]};
158
+ `,As=({dataId:n,icon:o,title:a,description:i,withCarret:l,purpleColors:r,disabled:s,children:c,isSelected:d,onClick:u,isChecked:p,isPartiallyChecked:h,onCheckboxChange:m})=>e(Is,{"data-id":n||`list-item-${a}`,$isSelected:d,$purpleColors:r,$disabled:s,onClick:()=>!d&&!s&&u(),children:[e(q,{$gap:4,children:[e(ue,{$gap:12,children:[m&&t(Q,{partiallyChecked:h||!1,value:p||!1,onChange:e=>m(e)}),o&&t(Es,{children:t(o,{size:20})}),t(se,{size:de.XS,children:a})]}),i&&t(se,{size:de.XXXS,color:ce.Secondary,children:i})]}),(l||c)&&e(ue,{$gap:8,children:[c,l&&t(Ii,{size:18})]})]}),Ns=({onClose:e,selectedConnectionIds:n,setSelectedConnectionIds:o,withOverlay:l})=>{const{actionsApi:s}=bl(),{platformType:c,version:d}=v(),[u,p]=r(""),h=i(null),{selectedOption:m,onSelectOption:g,genericForm:f,validateFormData:b}=zl(),{options:y,loading:C}=s.useActionTypes(),S=a(()=>y.length?y:dt(c,d),[y,c,d]),w=a(()=>(u?S.filter(e=>e?.label?.toLowerCase().includes(u.toLowerCase())):S).filter(e=>!!e),[S,u]),x=a(()=>{if(C)return[t(ut,{$padding:"8px 12px",children:t(pt,{size:6})},"loading")];return w.map(e=>{const n=m?.type===e.type;return t(As,{dataId:e.type?`option-${e.type}`:void 0,title:e.label,description:e.description,withCarret:!0,isSelected:n,onClick:()=>{h.current?.clearErrors(),g(e)}},e.type)})},[C,m?.type,w,g]),k=a(()=>C?[t(ut,{$padding:"8px 12px",children:t(pt,{size:4})},"loading")]:m?[t(os,{},m.type)]:[t(ht,{$height:"100%",children:t(Ae,{icon:Ei,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[C,m]);return t(Ol,{ref:h,isOpen:!0,withOverlay:l,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=b();if(e)return!1;await s.create(t)},disableSave:!m||!f?.isFormDirty,isFormDirty:f?.isFormDirty,hideDirtyNote:!0,progress:{title:qe.CREATING_ACTION,subTitle:qe.CREATING_ACTION_SUBTITLE},header:{icon:Ei,title:qe.ADD_ACTION,subTitle:qe.ADD_ACTION_DESCRIPTION},connectionIds:n&&o?{value:n,setValue:o}:void 0,search:{value:u,onChange:p},leftColumn:{width:"40%",list:x},rightColumn:{width:"60%",list:k}})},Os=({destinationsByCategory:o,filters:i,setFilters:l})=>{const r=a(()=>Object.values(mt).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})).filter(e=>o[e.id]?.length),[o]),s=a(()=>{const e=Object.values(Le).map(e=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}));return e.unshift({value:null,label:"All"}),e},[]);return e(n,{children:[t(gt,{placeholder:"Select category",options:r,values:i.categoryType?[i.categoryType]:[],setValues:e=>l({...i,categoryType:i.categoryType===e[0]?null:e[0]})}),t(ge,{options:s,selected:i.signalType,setSelected:e=>l({...i,signalType:e})})]})},Rs=g.div`
159
159
  display: flex;
160
160
  flex-direction: column;
161
161
  padding: 8px;
162
162
  border-radius: 16px;
163
163
  border: ${({$purpleColors:e,theme:t})=>e?`1px solid ${t.v2.colors.purple[500]}`:"1px solid transparent"};
164
164
  background-color: ${({$noBgColor:e,$purpleColors:t,theme:n})=>e?"transparent":t?n.v2.colors.purple[900]:n.v2.colors.silver[800]};
165
- `,rr=g.div`
165
+ `,Ds=g.div`
166
166
  display: flex;
167
167
  align-items: center;
168
168
  justify-content: space-between;
169
169
  gap: 12px;
170
170
  padding: ${({$isOpen:e})=>e?"2px 12px 8px 12px":"2px 12px"};
171
- `,cr=({title:n,tooltip:o,list:a,noBgColor:i,purpleColors:l})=>{const[r,c]=s(!0);return e(sr,{"data-id":`collapse-${n}`,$noBgColor:i,$purpleColors:l,children:[e(rr,{$isOpen:r,children:[e(se,{$gap:10,children:[t(ae,{size:le.XS,children:n}),o&&t(De,{text:o,withIcon:!0}),t(Be,{label:a.length,status:l?Ie.Default:void 0})]}),t(st,{icon:r?yi:Ci,size:rt.M,onClick:()=>c(e=>!e)})]}),r?t(W,{children:a.length?u.toArray(a):t(at,{$padding:"12px 0",children:t(Ce,{})})}):null]})},dr=(e,t,n)=>t||n.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!n.signalType||Ne(e.supportedSignals).includes(n.signalType))):e,ur=({option:e,formData:n,testResult:o,isSelected:a,onSelect:i})=>t(ar,{icon:ut(e.type).icon,title:n?.name||e.displayName,withCarret:!0,purpleColors:!!n,isSelected:a,onClick:()=>i(),children:o&&t(Be,{status:o.succeeded?Ie.Success:Ie.Error,leftIcon:o.succeeded?Si:wi})}),pr=({listType:e,destinationOptions:n,unsavedDestinations:o})=>{const{activeForm:a,onChangeActiveForm:i}=Al();return n?.length?t(cr,{title:dt[e].TITLE,tooltip:dt[e].DESCRIPTION,list:n.map((n,o)=>t(ur,{option:n,isSelected:a?.listType===e&&"number"!=typeof a?.unsavedIdx&&(null!=n.id&&""!==n.id?a?.option.id===n.id:a?.option.type===n.type),onSelect:()=>i({listType:e,option:n})},`${e}-${n.id??n.type}-${o}`))}):o?.length?t(cr,{purpleColors:!0,title:dt[e].TITLE,tooltip:dt[e].DESCRIPTION,list:o.map(({option:n,formData:o,testResult:l},s)=>t(ur,{option:n,formData:o,testResult:l,isSelected:a?.unsavedIdx===s&&a?.listType===e,onSelect:()=>i({listType:e,option:n,unsavedIdx:s})},`${e}-${s}`))},e):void 0};var hr;!function(e){e.SELF_HOSTED="self hosted",e.MANAGED="managed"}(hr||(hr={}));const mr=(e,t)=>{const n=[],o=[],a=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===hr.SELF_HOSTED?o.push(...e.items):e.name===hr.MANAGED&&a.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const o of e?.destinationCategories?.categories||[]){const e=pt(o),a=e.items.findIndex(e=>e.type===t.type);if(-1!==a){const o=ht(t.fields,{});Object.keys(o).length&&(e.items[a].fields=e.items[a].fields.map(e=>({...e,initialValue:o[e.name]})),n.push(e.items[a]))}}}),{[it.DETECTED]:n,[it.SELF_HOSTED]:o,[it.MANAGED]:a}},gr=({onClose:e,onBack:n,onNext:i,selectedConnectionIds:r,setSelectedConnectionIds:c,initialInputs:d,withOverlay:u,disableAnimation:p})=>{const{destinationsApi:h}=ll(),[m,g]=s(""),[f,b]=s({categoryType:null,signalType:null}),{items:v}=h.useDestinations(),{data:y,loading:C}=h.useDestinationCategories(),{data:S,loading:w}=h.usePotentialDestinations(),{activeForm:x,genericForm:k,unsavedDestinations:T,setUnsavedDestinations:$}=Al();o(()=>{d&&$(d)},[d]);const I=C||w,E=a(()=>y?.destinationCategories?.categories??[],[y]),[A,N]=s({[it.ALL]:[],[it.UNSAVED]:[],[it.EXISTS]:[],[it.DETECTED]:[],[it.SELF_HOSTED]:[],[it.MANAGED]:[]});o(()=>{const e=v.map(e=>{let t;for(const n of E){const o=n.items.find(t=>t.type===e.destinationType.type);if(o){t=o;break}}const n=ht(e.fields,{});return{id:e.id,type:e.destinationType.type,displayName:e.name||e.destinationType.displayName,selected:!0,testConnectionSupported:t?.testConnectionSupported??!1,supportedSignals:e.destinationType.supportedSignals,fields:t?t.fields.map(e=>({...e,initialValue:n[e.name]??e.initialValue})):[]}});N(t=>({...t,[it.EXISTS]:e}))},[v,E]),o(()=>{(y||S)&&N(e=>({...e,...mr(y,S)}))},[y,S]);const O=l(async()=>{for(const{option:e,formData:t}of T){const n=Oe(t);if(e.id){const t=Object.fromEntries(e.fields.map(e=>[e.name,e.initialValue??""])),o=Object.fromEntries(n.fields.map(e=>[e.key,e.value??""]));if(!Object.keys(t).some(e=>t[e]!==o[e])){await h.update(e.id,n);continue}}await h.create(n)}},[T,h]),R=(({isFetching:e,destinationsByCategory:n,searchText:o,filters:i})=>{const{unsavedDestinations:l}=Al();return{width:"40%",list:a(()=>{const a=[];l.length&&a.push(t(pr,{listType:it.UNSAVED,unsavedDestinations:l},"unsaved"));for(const e of Object.values(it)){if(i.categoryType&&i.categoryType!==e)continue;const l=dr(n[e],o,i);l.length&&a.push(t(pr,{listType:e,destinationOptions:l},e))}return e&&a.push(t(at,{$height:"100%",children:t(ct,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),a},[l,n,o,i,e])}})({isFetching:I,destinationsByCategory:A,searchText:m,filters:f}),D=(()=>{const{activeForm:e}=Al();return{width:"60%",list:e?[t(Fs,{},e.option.type)]:[t(at,{$height:"100%",children:t(Ce,{icon:vi,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})();return t(Cl,{isOpen:!0,withOverlay:u,disableAnimation:p,onClose:e,onBack:n?()=>n(T):void 0,onNext:i?()=>i(T):void 0,nextIsSkip:!T.length,onSave:O,disableSave:!x&&!T.length,isFetching:I,isFormDirty:T.length>0||k?.isFormDirty,hideDirtyNote:!0,progress:{title:Ge.CREATING_DESTINATION,subTitle:Ge.CREATING_DESTINATION_SUBTITLE},header:{icon:vi,title:Ge.ADD_DESTINATIONS,subTitle:Ge.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:r&&c?{value:r,setValue:c}:void 0,search:{value:m,onChange:g},filters:t(lr,{destinationsByCategory:A,filters:f,setFilters:b}),leftColumn:R,rightColumn:D})},fr=({onClose:e,selectedConnectionIds:n,setSelectedConnectionIds:o,withOverlay:l})=>{const{instrumentationRulesApi:r}=ll(),[c,d]=s(""),u=i(null),{selectedOption:p,onSelectOption:h,genericForm:m,validateFormData:g}=Nl(),f=a(()=>c?mt.filter(e=>e.label.toLowerCase().includes(c.toLowerCase())):mt,[c]),b=a(()=>f.map(e=>{const n=p?.type===e.type;return t(ar,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:n,onClick:()=>{u.current?.clearErrors(),h(e)}},e.type)}),[p,f.length,h]),v=a(()=>p?[t(Us,{},p.type)]:[t(at,{$height:"100%",children:t(Ce,{icon:xi,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[p]);return t(Cl,{ref:u,isOpen:!0,withOverlay:l,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=g();if(e)return!1;await r.create(t,p?.type)},disableSave:!p||!m?.isFormDirty,isFormDirty:m?.isFormDirty,hideDirtyNote:!0,progress:{title:Ge.CREATING_INSTRUMENTATION_RULE,subTitle:Ge.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:xi,title:Ge.ADD_INSTRUMENTATION_RULE,subTitle:Ge.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:n&&o?{value:n,setValue:o}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:b},rightColumn:{width:"60%",list:v}})},br={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:Ge.FETCHING_NAMESPACES,subTitle:Ge.FETCHING_NAMESPACES_SUBTITLE},noGroups:{title:"No namespaces",subTitle:"No namespaces found in this cluster"},noGroupMatchedFilter:e=>`No namespace matched the filter '${e}'`,itemColumnHeader:"Workloads",selectGroupPrompt:{title:Ge.SELECT_NAMESPACE,subTitle:Ge.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},vr={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===gt.Namespace?"kind":"source"),groupColumnHeader:"Kinds",fetchingGroups:{title:"Fetching kinds",subTitle:"Please wait while we fetch the kinds"},noGroups:{title:"No kinds",subTitle:"No kinds found on this host"},noGroupMatchedFilter:e=>`No kind matched the filter '${e}'`,itemColumnHeader:"Sources",selectGroupPrompt:{title:"Select kind from the list",subTitle:"Pick a kind so you can select sources from it."},noItemsInGroupSubTitle:"No sources found in this kind"},yr=e=>e?vr:br,Cr="No matches",Sr="No sources",wr=e=>`No sources matched the filter '${e}'`,xr=e=>(e?"Unselect":"Select")+" all",kr="Show only:",Tr="Selected",$r="Auto",Ir="Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",Er="Enterprise only",Ar=g.div``,Nr=g.div`
171
+ `,Ps=({title:n,tooltip:o,list:a,noBgColor:i,purpleColors:l})=>{const[s,c]=r(!0);return e(Rs,{"data-id":`collapse-${n}`,$noBgColor:i,$purpleColors:l,children:[e(Ds,{$isOpen:s,children:[e(ue,{$gap:10,children:[t(se,{size:de.XS,children:n}),o&&t($e,{text:o,withIcon:!0}),t(We,{label:a.length,status:l?Pe.Default:void 0})]}),t(ft,{icon:s?Ni:Oi,size:bt.M,onClick:()=>c(e=>!e)})]}),s?t(q,{children:a.length?u.toArray(a):t(ht,{$padding:"12px 0",children:t(Ae,{})})}):null]})},Fs=(e,t,n)=>t||n.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!n.signalType||_e(e.supportedSignals).includes(n.signalType))):e,Ls=({option:e,formData:n,testResult:o,isSelected:a,onSelect:i})=>t(As,{icon:Ct(e.type).icon,title:n?.name||e.displayName,withCarret:!0,purpleColors:!!n,isSelected:a,onClick:()=>i(),children:o&&t(We,{status:o.succeeded?Pe.Success:Pe.Error,leftIcon:o.succeeded?Ri:Di})}),Ms=({listType:e,destinationOptions:n,unsavedDestinations:o})=>{const{activeForm:a,onChangeActiveForm:i}=Bl();return n?.length?t(Ps,{title:vt[e].TITLE,tooltip:vt[e].DESCRIPTION,list:n.map((n,o)=>t(Ls,{option:n,isSelected:a?.listType===e&&"number"!=typeof a?.unsavedIdx&&(null!=n.id&&""!==n.id?a?.option.id===n.id:a?.option.type===n.type),onSelect:()=>i({listType:e,option:n})},`${e}-${n.id??n.type}-${o}`))}):o?.length?t(Ps,{purpleColors:!0,title:vt[e].TITLE,tooltip:vt[e].DESCRIPTION,list:o.map(({option:n,formData:o,testResult:l},r)=>t(Ls,{option:n,formData:o,testResult:l,isSelected:a?.unsavedIdx===r&&a?.listType===e,onSelect:()=>i({listType:e,option:n,unsavedIdx:r})},`${e}-${r}`))},e):void 0};var _s;!function(e){e.SELF_HOSTED="self hosted",e.MANAGED="managed"}(_s||(_s={}));const zs=(e,t)=>{const n=[],o=[],a=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===_s.SELF_HOSTED?o.push(...e.items):e.name===_s.MANAGED&&a.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const o of e?.destinationCategories?.categories||[]){const e=St(o),a=e.items.findIndex(e=>e.type===t.type);if(-1!==a){const o=Te(t.fields,{});Object.keys(o).length&&(e.items[a].fields=e.items[a].fields.map(e=>({...e,initialValue:o[e.name]})),n.push(e.items[a]))}}}),{[mt.DETECTED]:n,[mt.SELF_HOSTED]:o,[mt.MANAGED]:a}},Bs=({onClose:e,onBack:n,onNext:i,selectedConnectionIds:s,setSelectedConnectionIds:c,initialInputs:d,withOverlay:u,disableAnimation:p})=>{const{destinationsApi:h}=bl(),[m,g]=r(""),[f,b]=r({categoryType:null,signalType:null}),{items:y}=h.useDestinations(),{data:v,loading:C}=h.useDestinationCategories(),{data:S,loading:w}=h.usePotentialDestinations(),{activeForm:x,genericForm:k,unsavedDestinations:T,setUnsavedDestinations:$}=Bl();o(()=>{d&&$(d)},[d]);const I=C||w,E=a(()=>v?.destinationCategories?.categories??[],[v]),[A,N]=r({[mt.ALL]:[],[mt.UNSAVED]:[],[mt.EXISTS]:[],[mt.DETECTED]:[],[mt.SELF_HOSTED]:[],[mt.MANAGED]:[]});o(()=>{const e=y.map(e=>{let t;for(const n of E){const o=n.items.find(t=>t.type===e.destinationType.type);if(o){t=o;break}}const n=Te(e.fields,{});return{id:e.id,type:e.destinationType.type,displayName:e.name||e.destinationType.displayName,selected:!0,testConnectionSupported:t?.testConnectionSupported??!1,supportedSignals:e.destinationType.supportedSignals,fields:t?t.fields.map(e=>({...e,initialValue:n[e.name]??e.initialValue})):[]}});N(t=>({...t,[mt.EXISTS]:e}))},[y,E]),o(()=>{(v||S)&&N(e=>({...e,...zs(v,S)}))},[v,S]);const O=l(async()=>{for(const{option:e,formData:t}of T){const n=ze(t);if(e.id){const t=Object.fromEntries(e.fields.map(e=>[e.name,e.initialValue??""])),o=Object.fromEntries(n.fields.map(e=>[e.key,e.value??""]));if(!Object.keys(t).some(e=>t[e]!==o[e])){await h.update(e.id,n);continue}}await h.create(n)}},[T,h]),R=(({isFetching:e,destinationsByCategory:n,searchText:o,filters:i})=>{const{unsavedDestinations:l}=Bl();return{width:"40%",list:a(()=>{const a=[];l.length&&a.push(t(Ms,{listType:mt.UNSAVED,unsavedDestinations:l},"unsaved"));for(const e of Object.values(mt)){if(i.categoryType&&i.categoryType!==e)continue;const l=Fs(n[e],o,i);l.length&&a.push(t(Ms,{listType:e,destinationOptions:l},e))}return e&&a.push(t(ht,{$height:"100%",children:t(yt,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),a},[l,n,o,i,e])}})({isFetching:I,destinationsByCategory:A,searchText:m,filters:f}),D=(()=>{const{activeForm:e}=Bl();return{width:"60%",list:e?[t(ls,{},e.option.type)]:[t(ht,{$height:"100%",children:t(Ae,{icon:Ai,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})();return t(Ol,{isOpen:!0,withOverlay:u,disableAnimation:p,onClose:e,onBack:n?()=>n(T):void 0,onNext:i?()=>i(T):void 0,nextIsSkip:!T.length,onSave:O,disableSave:!x&&!T.length,isFetching:I,isFormDirty:T.length>0||k?.isFormDirty,hideDirtyNote:!0,progress:{title:qe.CREATING_DESTINATION,subTitle:qe.CREATING_DESTINATION_SUBTITLE},header:{icon:Ai,title:qe.ADD_DESTINATIONS,subTitle:qe.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:m,onChange:g},filters:t(Os,{destinationsByCategory:A,filters:f,setFilters:b}),leftColumn:R,rightColumn:D})},Xs=({onClose:e,selectedConnectionIds:n,setSelectedConnectionIds:o,withOverlay:l})=>{const{instrumentationRulesApi:s}=bl(),[c,d]=r(""),u=i(null),{selectedOption:p,onSelectOption:h,genericForm:m,validateFormData:g}=Xl(),{options:f,loading:b}=s.useRuleTypes(),y=a(()=>f.length?f:wt,[f]),v=a(()=>c?y.filter(e=>e.label.toLowerCase().includes(c.toLowerCase())):y,[y,c]),C=a(()=>b?[t(ut,{$padding:"8px 12px",children:t(pt,{size:4})},"loading")]:v.map(e=>{const n=p?.type===e.type;return t(As,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:n,onClick:()=>{u.current?.clearErrors(),h(e)}},e.type)}),[b,p?.type,v,h]),S=a(()=>b?[t(ut,{$padding:"8px 12px",children:t(pt,{size:4})},"loading")]:p?[t(ms,{},p.type)]:[t(ht,{$height:"100%",children:t(Ae,{icon:Pi,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[b,p]);return t(Ol,{ref:u,isOpen:!0,withOverlay:l,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=g();if(e)return!1;await s.create(t,p?.type)},disableSave:!p||!m?.isFormDirty,isFormDirty:m?.isFormDirty,hideDirtyNote:!0,progress:{title:qe.CREATING_INSTRUMENTATION_RULE,subTitle:qe.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:Pi,title:qe.ADD_INSTRUMENTATION_RULE,subTitle:qe.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:n&&o?{value:n,setValue:o}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:C},rightColumn:{width:"60%",list:S}})},Vs={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:qe.FETCHING_NAMESPACES,subTitle:qe.FETCHING_NAMESPACES_SUBTITLE},noGroups:{title:"No namespaces",subTitle:"No namespaces found in this cluster"},noGroupMatchedFilter:e=>`No namespace matched the filter '${e}'`,itemColumnHeader:"Workloads",selectGroupPrompt:{title:qe.SELECT_NAMESPACE,subTitle:qe.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},Us={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===xt.Namespace?"kind":"source"),groupColumnHeader:"Kinds",fetchingGroups:{title:"Fetching kinds",subTitle:"Please wait while we fetch the kinds"},noGroups:{title:"No kinds",subTitle:"No kinds found on this host"},noGroupMatchedFilter:e=>`No kind matched the filter '${e}'`,itemColumnHeader:"Sources",selectGroupPrompt:{title:"Select kind from the list",subTitle:"Pick a kind so you can select sources from it."},noItemsInGroupSubTitle:"No sources found in this kind"},js=e=>e?Us:Vs,Gs="No matches",Hs="No sources",Ws=e=>`No sources matched the filter '${e}'`,Ks=e=>(e?"Unselect":"Select")+" all",Ys="Show only:",Js="Selected",qs="Auto",Zs="Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",Qs="Enterprise only",ec=g.div``,tc=g.div`
172
172
  visibility: hidden;
173
173
 
174
174
  transition: visibility 0s;
@@ -176,19 +176,19 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
176
176
  transition-duration: 0s;
177
177
  }
178
178
 
179
- ${Ar}:hover & {
179
+ ${ec}:hover & {
180
180
  visibility: visible;
181
181
  }
182
- `,Or=({workloadName:e,workloadKind:n,isChecked:o,onToggle:a,disabled:i,disabledReason:l})=>{const s=f(),r=()=>{};return t(Ar,{children:t(ar,{dataId:`source-${e}`,title:e,disabled:i,onClick:i?r:a,isChecked:o,onCheckboxChange:i?r:a,children:i&&l?t(Be,{label:l,status:Ie.Default,textSize:le.XXXS}):t(Nr,{children:t(Be,{label:n,status:Ie.Info,textSize:le.XXXS,backgroundColor:s.v2.colors.blue[900]})})})})},Rr=g.div``,Dr=g.div`
182
+ `,nc=({workloadName:e,workloadKind:n,isChecked:o,onToggle:a,disabled:i,disabledReason:l})=>{const r=f(),s=()=>{};return t(ec,{children:t(As,{dataId:`source-${e}`,title:e,disabled:i,onClick:i?s:a,isChecked:o,onCheckboxChange:i?s:a,children:i&&l?t(We,{label:l,status:Pe.Default,textSize:de.XXXS}):t(tc,{children:t(We,{label:n,status:Pe.Info,textSize:de.XXXS,backgroundColor:r.v2.colors.blue[900]})})})})},oc=g.div``,ac=g.div`
183
183
  visibility: ${({$visible:e})=>e?"visible":"hidden"};
184
184
 
185
185
  transition: visibility 0s;
186
186
  ${({$visible:e})=>!e&&"& * {\n transition-duration: 0s !important;\n }"}
187
187
 
188
- ${Rr}:hover & {
188
+ ${oc}:hover & {
189
189
  visibility: visible;
190
190
  }
191
- `,Pr=({clusterId:n,namespaceName:o,checkbox:a,isFutureApps:i,selectedCounts:l,isActive:s,onActive:r,handleSourceChange:c})=>{const{isVm:d}=y(),u=e=>{r(),c({clusterId:n,workloadId:{namespace:o},auto:e.auto,selected:e.all})};return t(Rr,{children:t(ar,{dataId:`namespace-${o}`,withCarret:!0,title:o,isSelected:s,onClick:r,isPartiallyChecked:a.partial,isChecked:a.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(se,{$gap:12,children:[!d&&t(Dr,{$visible:s||i,children:t(De,{text:Ir,children:t(Q,{label:$r,labelAlign:ee.Left,size:bt.S,value:i,onChange:e=>u({auto:e,all:e||void 0})})})}),e(se,{$gap:8,children:[t(ae,{variant:vt.Span,size:le.XXXS,color:ie.Secondary,align:"right",children:Tr}),t(Be,{label:`${l.sourced}/${l.total}`,status:s?Ie.Default:Ie.Unknown,minWidth:"42px"})]})]})})})},Fr=({withCollapse:e,clusterId:n,clusterName:o,namespaces:i,selectedArea:l,setSelectedArea:s,handleSourceChange:r})=>{const c=a(()=>i.map(({name:e,totalWorkloads:a,selectedCount:i,isAllSourced:c,isSomeSourced:d,isFutureApps:u})=>t(Pr,{clusterId:n,namespaceName:e,isFutureApps:u,checkbox:{all:c||u,partial:d},selectedCounts:{sourced:i,total:a},isActive:l.clusterId===n&&l.namespaceName===e,onActive:()=>s({clusterId:n,clusterName:o,namespaceName:e}),handleSourceChange:r},`${n}#${e}`)),[n,o,i,l]);return e?t(cr,{title:o,list:c,noBgColor:!0}):c},Lr=({onClose:n,onBack:i,onNext:l,selectedConnectionIds:r,setSelectedConnectionIds:c,withOverlay:d,disableAnimation:u})=>{const{isVm:p}=y(),{sourcesApi:h,snapshotsApi:m,namespacesApi:g}=ll(),{data:f,loading:b,refetch:v}=m.useSnapshots(),{items:C,loading:S,refetch:w}=g.useNamespaces(),x=yr(p),{selectedStreamName:k}=He(),{progress:T,resetProgress:$}=yt(),{isFetching:I,setIsFetching:E,setSnapshots:A,formData:N,handleSourceChange:O,handleSelectAll:R,formDiff:D,isFormDirty:P}=zl();o(()=>{v(),w()},[]);const F=a(()=>{if(f)return f;const e=C;return e.length?{clusters:[{clusterId:St,clusterName:Ct,namespaces:e.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(k),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,selected:(e.markedForInstrumentation?.markedForInstrumentation??!1)&&(e.dataStreamNames?.includes(k)??!1)}))||[]}))}]}:null},[f,C,k]);o(()=>{E(b||S),F&&A(F)},[F,b,S,E,A]);const[L,_]=s(""),[M,z]=s(gt.Namespace),[B,X]=s({showOnlySelected:!1}),[V,U]=s({clusterId:"",clusterName:"",namespaceName:""}),G=(({isFetching:n,formData:o,handleSourceChange:i,handleSelectAll:l,selectedArea:s,setSelectedArea:r,searchText:c,searchBy:d,filters:u})=>{const{isVm:p}=y(),h=yr(p),m=a(()=>o.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>_l(e,c,u)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...Ml(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[o,c,u]),g=a(()=>{let e=!1;for(const{visibleNamespaces:t}of m)for(const{totalWorkloads:n,selectedCount:o}of t)if(e=!0,o!==n)return!1;return e},[m]),{list:f,withFilterCount:b,filteredCount:v,totalCount:C}=a(()=>{const e=m.map(({clusterId:e,clusterName:n,visibleNamespaces:o})=>o.length?t(Fr,{withCollapse:m.length>1,clusterId:e,clusterName:n,namespaces:o,selectedArea:s,setSelectedArea:r,handleSourceChange:i},e):null).filter(e=>null!==e),n=m.reduce((e,{visibleNamespaces:t})=>e+t.length,0),a=o.reduce((e,{namespaces:t})=>e+t.length,0);return{list:e,withFilterCount:n!==a,filteredCount:n,totalCount:a}},[m,o,s]);return{width:"60%",header:e(se,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(se,{$gap:8,children:[t(ae,{size:le.XS,nowrap:!0,children:h.groupColumnHeader}),t(De,{text:b?Ge.FILTERED_COUNT_TOOLTIP:void 0,children:t(Be,{label:`${b?`${v} / ${C}`:C}`,status:Ie.Unknown})})]}),t(ae,{"data-id":"namespaces-select-all",onClick:()=>l({boolean:!g,searchText:c,searchBy:d,filters:u}),disabled:!f.length,size:le.XS,children:xr(g)})]}),list:f.length?f:n?[t(at,{$height:"100%",children:t(ct,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(at,{$height:"100%",children:t(Ce,c?{icon:Ti,title:Cr,subTitle:h.noGroupMatchedFilter(c)}:{icon:Ti,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:I,formData:N,handleSourceChange:O,handleSelectAll:R,selectedArea:V,setSelectedArea:U,searchText:M===gt.Namespace?L:"",searchBy:M,filters:B}),H=(({formData:n,handleSourceChange:o,handleSelectAll:i,selectedArea:l,searchText:s,searchBy:r,filters:c})=>{const{tier:d,isVm:u}=y(),p=yr(u),h=d===ft.Onprem,m=a(()=>l.value.namespaceName?n.find(({clusterId:e})=>e===l.value.clusterId)?.namespaces.find(({name:e})=>e===l.value.namespaceName):void 0,[n,l.value.clusterId,l.value.namespaceName]),g=a(()=>m?[...m.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Fl(e,s,c)):[],[m,s,c]),f=a(()=>!!g.length&&g.every(({selected:e})=>e),[g]),b=a(()=>{if(!m)return[];const{clusterId:e}=l.value,{name:n}=m;return g.map(({name:a,selected:i,kind:l})=>{const s=!u&&!h&&Ll.has(l);return t(Or,{workloadName:a,workloadKind:l,isChecked:!s&&(i||!1),onToggle:()=>o({clusterId:e,workloadId:{namespace:n,name:a,kind:l}}),disabled:s,disabledReason:Er},`${e}#${n}#${a}#${l}`)})},[g,m,l.value.clusterId]),{withFilterCount:v,filteredCount:C,totalCount:S}=a(()=>{const e=m?.workloads.length??0;return{withFilterCount:g.length!==e,filteredCount:g.length,totalCount:e}},[g,m]);return{width:"40%",header:e(se,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(se,{$gap:8,children:[t(ae,{size:le.XS,nowrap:!0,children:l.value.namespaceName?`${l.value.namespaceName} > ${p.itemColumnHeader}`:p.itemColumnHeader}),t(De,{text:v?Ge.FILTERED_COUNT_TOOLTIP:void 0,children:t(Be,{label:`${v?`${C} / ${S}`:S}`,status:Ie.Unknown})})]}),t(ae,{"data-id":"workloads-select-all",onClick:()=>i({clusterId:l.value.clusterId,namespaceName:l.value.namespaceName,boolean:!f,searchText:s,searchBy:r,filters:c}),disabled:!b.length,size:le.XS,children:xr(f)})]}),list:b.length?b:[t(at,{$height:"100%",children:t(Ce,m?s?{icon:ki,title:Cr,subTitle:wr(s)}:{icon:ki,title:Sr,subTitle:p.noItemsInGroupSubTitle}:{icon:ki,title:p.selectGroupPrompt.title,subTitle:p.selectGroupPrompt.subTitle})},"no-data")]}})({formData:N,handleSourceChange:O,handleSelectAll:R,selectedArea:{value:V},searchText:M===gt.Source?L:"",searchBy:M,filters:B});return t(Cl,{isOpen:!0,withOverlay:d,disableAnimation:u,onClose:n?()=>{$(wt.BulkInstrumenting),n()}:void 0,onBack:i?()=>i(D):void 0,onNext:l?()=>l(D):void 0,nextIsSkip:!P,onSave:()=>h.persistV2(D),header:{icon:ki,title:Ge.ADD_SOURCE,subTitle:Ge.ADD_SOURCES_DESCRIPTION},connectionIds:r&&c?{value:r,setValue:c}:void 0,search:{value:L,onChange:e=>{_(e),M===gt.Namespace&&U({clusterId:"",clusterName:"",namespaceName:""})},placeholder:x.searchPlaceholder(M),segment:{options:[{label:x.groupSegmentLabel,value:gt.Namespace},{label:x.itemSegmentLabel,value:gt.Source}],selected:M,setSelected:z}},filters:e(se,{$gap:8,children:[t(ae,{size:le.XXXS,color:ie.Secondary,nowrap:!0,children:kr}),t(Q,{name:"filter-selected",size:bt.S,label:Tr,value:B.showOnlySelected,onChange:e=>X(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:P,isFetching:I,progress:{title:Ge.CREATING_SOURCES,subTitle:Ge.CREATING_SOURCES_SUBTITLE,percentage:T[wt.BulkInstrumenting]?.percentage||0},leftColumn:G,rightColumn:H})},_r=(e,t)=>{const n=[{id:"type",title:Ge.TYPE,label:t.label},{id:"status",title:Ge.STATUS,badge:{status:e.disabled?Ie.Unknown:Ie.Success,label:e.disabled?Ge.DISABLED:Ge.ENABLED}}],o=e.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return o&&n.push({id:"signals",title:Ge.SIGNALS_FOR_PROCESSING,label:o}),e.name&&n.push({id:"name",title:Ge.NAME,label:e.name}),e.notes&&n.push({id:"notes",title:Ge.NOTES,label:e.notes}),n},Mr=({onClose:i,actionId:r})=>{const c=f(),{actionsApi:d}=ll(),{items:u,refetch:p}=d.useActions(),{selectedOption:h,loadAction:m,validateFormData:g,genericForm:b}=El();o(()=>{p()},[]);const[v,y]=s(!1),[C,S]=s(!1),[w,x]=s(null),k=v&&!!b?.isFormDirty,T=a(()=>u?.find(e=>xt(e)===r),[r,u]),$=a(()=>ot.find(({type:e})=>e===T?.type)??null,[T?.type]);o(()=>{T&&m(T)},[T]);const I=l(()=>{T&&y(!0)},[T]),E=l(()=>{T&&(m(T),y(!1))},[T,m]),A=l(()=>{k?x("close"):i()},[k,i]),N=l(()=>{k?x("cancel"):E()},[k,E]),O=l(()=>{const e=w;x(null),"close"===e?(E(),i()):E()},[w,E,i]),R=l(async()=>{if(T){const{errorMessage:e,preparedFormData:t}=g();e||(await d.update(T.id,t),y(!1))}},[T,g,d]),D=l(()=>{T&&S(!0)},[T]),P=l(async()=>{T&&(await d.remove(T.id,T.type),i())},[T,d,i]);if(!T||!$)return null;const F=(e=>{const t=[],{type:n,fields:o}=e,a=e=>({status:e?Ie.Success:Ie.Unknown,label:e?"True":"False",invertColors:!0});if(n===ye.K8sAttributes&&(t.push({id:"collectContainerAttributes",title:"Collect Container Attributes",badge:a(o.collectContainerAttributes)}),t.push({id:"collectReplicaSetAttributes",title:"Collect ReplicaSet Attributes",badge:a(o.collectReplicaSetAttributes)}),t.push({id:"collectWorkloadId",title:"Collect Workload ID",badge:a(o.collectWorkloadId)}),t.push({id:"collectClusterId",title:"Collect Cluster ID",badge:a(o.collectClusterId)}),o.labelsAttributes?.forEach(({labelKey:e,attributeKey:n,from:a,fromSources:i},l)=>{const s=i?.length?i.join(", "):a||Z.Pod,r=(o.labelsAttributes?.length??0)>1?`Label #${l+1} `:"Label ";t.push({id:`label-${l}-key`,title:`${r}Key`,label:e}),t.push({id:`label-${l}-attr`,title:`${r}Attribute Key`,label:n}),t.push({id:`label-${l}-from`,title:`${r}From`,label:s})}),o.annotationsAttributes?.forEach(({annotationKey:e,attributeKey:n,from:a,fromSources:i},l)=>{const s=i?.length?i.join(", "):a||Z.Pod,r=(o.annotationsAttributes?.length??0)>1?`Annotation #${l+1} `:"Annotation ";t.push({id:`annotation-${l}-key`,title:`${r}Key`,label:e}),t.push({id:`annotation-${l}-attr`,title:`${r}Attribute Key`,label:n}),t.push({id:`annotation-${l}-from`,title:`${r}From`,label:s})})),n===ye.AddClusterInfo&&(t.push({id:"overwriteExistingValues",title:"Overwrite Existing Values",badge:a(o.overwriteExistingValues)}),o.clusterAttributes?.forEach(({attributeName:e,attributeStringValue:n},o)=>{t.push({id:`cluster-attr-${o}`,title:e,label:n})})),n===ye.DeleteAttributes&&o.attributeNamesToDelete?.forEach((e,n)=>{t.push({id:`del-attr-${n}`,title:"Attribute"+((o.attributeNamesToDelete?.length??0)>1?` #${n+1}`:""),label:e})}),n===ye.RenameAttributes&&Object.entries(o.renames||{}).forEach(([e,n],o)=>{t.push({id:`rename-${o}`,title:e,label:n})}),n===ye.PiiMasking&&o.piiCategories?.forEach((e,n)=>{t.push({id:`pii-${n}`,title:"Category"+((o.piiCategories?.length??0)>1?` #${n+1}`:""),label:e})}),n===ye.ExtractAttribute){const e=o.extractAttribute?.extractions??[];e.forEach(({targetAttributeName:n,lookupKey:o,dataFormat:a,regex:i},l)=>{const s=e.length>1?`Extraction #${l+1} `:"Extraction ";t.push({id:`extract-${l}-target`,title:`${s}New Attribute Name`,label:n||"-"}),o&&t.push({id:`extract-${l}-lookupKey`,title:`${s}Lookup Key`,label:o}),a&&t.push({id:`extract-${l}-format`,title:`${s}Data Format`,label:a}),i&&t.push({id:`extract-${l}-regex`,title:`${s}Regex`,label:i})})}return n===ye.URLTemplatization&&o.urlTemplatizationRulesGroups?.forEach((e,n)=>{const a=(o.urlTemplatizationRulesGroups?.length??0)>1?`Group #${n+1} `:"Group ";e.filterK8sNamespace&&t.push({id:`group-${n}-ns`,title:`${a}Namespace`,label:e.filterK8sNamespace}),e.workloadFilters?.forEach((o,i)=>{const l=[o.kind,o.name].filter(Boolean).join("/");l&&t.push({id:`group-${n}-wf-${i}`,title:`${a}Workload${(e.workloadFilters?.length??0)>1?` #${i+1}`:""}`,label:l})});const i=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");i&&t.push({id:`group-${n}-templates`,title:`${a}Templates`,label:i}),e.notes&&t.push({id:`group-${n}-notes`,title:`${a}Notes`,label:e.notes})}),t})(T);return e(n,{children:[t(ne,{isOpen:!0,header:{icon:Et(T.type),title:$.label,onClose:A,actions:[{id:"edit-action-btn-edit",label:kt.EDIT,icon:hi,active:v,onClick:I},{id:"edit-action-btn-delete",label:kt.DELETE,icon:li,color:c.v2.colors.red[500],active:C,onClick:D}]},footer:{actions:v?[{"data-id":"edit-action-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:N},{"data-id":"edit-action-btn-save",label:kt.SAVE,variant:de.Primary,onClick:R}]:[]},children:t(Tt,{$padding:"4px 12px 12px",children:v&&h?t(Rs,{}):t(W,{$gap:16,children:e($t,{bgTint:"1000",children:[e($t,{bgTint:"900",children:[t(It,{conditions:T.conditions||[]}),t($t,{bgTint:"800",cellsPerRow:2,items:_r(T,$)})]}),!!F?.length&&t($t,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t($t,{bgTint:"800",cellsPerRow:2,items:F})})]})})})}),t(Sl,{target:"action",isOpen:C,onClose:()=>S(!1),onApprove:P}),t(wl,{isOpen:null!==w,onClose:()=>x(null),onApprove:O})]})},zr=({onClose:n,connections:l,selectedConnectionIds:r,setSelectedConnectionIds:c})=>{const{configApi:d}=ll(),[u,p]=s(""),[h,m]=s({showOnlySelected:!1}),g=a(()=>l.filter(e=>{const t=!u||e.name.toLowerCase().includes(u.toLowerCase()),n=!h.showOnlySelected||h.showOnlySelected&&r.includes(e.id);return t&&n}),[l.length,r.length,u,h]),f=e=>{c(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=1===r.length?r[0]:void 0,{data:v,loading:y}=d.useEffectiveConfig(b?{id:b}:void 0,{skip:!b}),C=a(()=>{if(b&&v)return{rollout:{automaticRolloutDisabled:v.rollout?.automaticRolloutDisabled??!1}}},[b,v]),{formData:S,handleFormChange:w,areFormValuesEqual:x,resetFormData:k}=At(C||{rollout:{automaticRolloutDisabled:!1}}),T=i(k);T.current=k,o(()=>{C&&T.current(C)},[C]);const $=a(()=>r.length>1||void 0!==C&&!x(C,S),[r.length,C,S]);return t(Cl,{isOpen:!0,onClose:n,onSave:async()=>await(d.applyConfigurations?.(S,r))??void 0,header:{icon:$i,title:"Cluster Configuration"},connectionIds:{value:r,setValue:c},search:{placeholder:"Search by cluster name",value:u,onChange:p},filters:e(se,{$gap:8,children:[t(ae,{size:le.XXXS,color:ie.Secondary,nowrap:!0,children:"Show only:"}),t(Q,{size:bt.S,label:"Selected",value:h.showOnlySelected,onChange:e=>m(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:$,isFetching:y,leftColumn:{width:"35%",header:e(se,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(se,{$gap:8,children:[t(ae,{size:le.XS,children:"Clusters"}),t(Be,{label:g.length,status:Ie.Unknown})]}),e(se,{$gap:8,children:[t(ae,{size:le.XXXS,color:ie.Secondary,align:"right",children:"Selected clusters"}),t(Be,{label:`${r.length}/${g.length}`,status:Ie.Unknown})]})]}),list:g.map(e=>t(ar,{title:e.name,isChecked:r.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(ae,{size:le.XS,children:"Configurations"}),list:[t(Q,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>w("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},Br=e=>{const t=[{id:"type",title:Ge.TYPE,label:e.destinationType.displayName},{id:"status",title:Ge.STATUS,badge:{status:e.disabled?Ie.Unknown:Ie.Success,label:e.disabled?Ge.DISABLED:Ge.ENABLED}}],n=Ae(e.exportedSignals).map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return n&&t.push({id:"monitors",title:Ge.MONITORS,label:n}),e.name&&t.push({id:"name",title:Ge.NAME,label:e.name}),t},Xr=({onClose:r,destinationId:c})=>{const d=f(),{isVm:u}=y(),{destinationsApi:p}=ll(),{selectedStreamName:h}=He(),{items:m,refetch:g}=p.useDestinations(),{data:b,loading:v}=p.useDestinationCategories(),{activeForm:C,loadDestination:S,validateFormData:w,genericForm:x}=Al();o(()=>{g()},[]);const k=i(null),[T,$]=s(!1),[I,E]=s(!1),[A,N]=s(null),O=T&&!!x?.isFormDirty,R=a(()=>Rt(m,h),[m,h]),D=a(()=>R?.find(e=>xt(e)===c),[c,R]),P=b?.destinationCategories?.categories??null;o(()=>{D&&P&&S(D,P)},[D,P]);const F=a(()=>D&&P?Dt(P,D):[],[D,P]),L=l(()=>{D&&$(!0)},[D]),_=l(()=>{D&&P&&(S(D,P),$(!1))},[D,P,S]),M=l(()=>{O?N("close"):r()},[O,r]),z=l(()=>{O?N("cancel"):_()},[O,_]),B=l(()=>{const e=A;N(null),"close"===e?(_(),r()):_()},[A,_,r]),X=l(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=w();e||(await p.update(D.id,Oe(t)),$(!1))}},[D,w,p]),V=l(()=>{D&&E(!0)},[D]),U=l(async()=>{D&&(await p.remove(D.id),r())},[D,p,r]);if(!D)return null;const{icon:G,iconSrc:H}=ut(D.destinationType.type),j=((e,t)=>{const n=[],o=Nt(e,t),a=o.map(e=>({name:e.key,value:e.value})),i=Ae(e.exportedSignals);let l=[];const s=()=>{l.length&&(n.push({kind:"cells",id:`cells-${n.length}`,items:l}),l=[])};return o.forEach(({key:e,name:o,value:r})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:u,componentProperties:p,hideFromReadData:h,customReadDataLabels:m}=c||{};if(h?.length&&Te(h,i,a))return;const{type:g}=ht(p,{type:""}),f=d||"password"===g;if(m?.length)m.forEach(({condition:t,...n},o)=>{t==r&&l.push({id:`${e}-custom-${o}`,title:n.title,label:n.value})});else if(r)if(f)l.push({id:e,title:o,label:new Array(10).fill("•").join("")});else{if(u===Ot.MultiInput){const t=ht(r,null);if(Array.isArray(t)&&t.length)return s(),void n.push({kind:"list",id:e,title:o,items:t.map((t,n)=>({id:`${e}-${n}`,label:String(t)}))})}if(u===Ot.KeyValuePair){const t=ht(r,null);if(Array.isArray(t)&&t.length)return s(),void n.push({kind:"pairs",id:e,title:o,items:t.map((t,n)=>{const o=t&&"object"==typeof t?t:{};return{id:`${e}-${n}`,title:null!=o.key?String(o.key):"",label:null!=o.value?String(o.value):""}})})}l.push({id:e,title:o,label:r})}else l.push({id:e,title:o,label:"-"})}),s(),n})(D,F);return e(n,{children:[t(ne,{isOpen:!0,header:{icon:G,iconSrc:H,title:D.name||D.destinationType.displayName,onClose:M,actions:[{id:"edit-destination-btn-edit",label:kt.EDIT,icon:hi,active:T,onClick:L},{id:"edit-destination-btn-delete",label:kt.DELETE,icon:li,color:d.v2.colors.red[500],active:I,onClick:V}]},footer:{actions:T?[{"data-id":"edit-destination-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:z},...C?.option.testConnectionSupported&&!u?[{"data-id":"edit-destination-btn-test-connection",label:kt.TEST_CONNECTION,variant:de.Secondary,onClick:()=>k.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:kt.SAVE,variant:de.Primary,onClick:X}]:[]},children:t(Tt,{$padding:"4px 12px 12px",children:v?t(at,{$height:"50vh",children:t(ct,{withSpinner:!0})}):T&&C?t(Fs,{ref:k,isEdit:!0}):t(W,{$gap:16,children:e($t,{bgTint:"1000",children:[e($t,{bgTint:"900",children:[!u&&t(It,{conditions:D.conditions||[]}),t($t,{bgTint:"800",cellsPerRow:2,items:Br(D)})]}),!!j.length&&t($t,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:j.map(e=>"cells"===e.kind?t($t,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t($t,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(Sl,{target:"destination",isOpen:I,onClose:()=>E(!1),onApprove:U}),t(wl,{isOpen:null!==A,onClose:()=>N(null),onApprove:B})]})},Vr=(e,t)=>{const n=[{id:"type",title:Ge.TYPE,label:t.label},{id:"status",title:Ge.STATUS,badge:{status:e.disabled?Ie.Unknown:Ie.Success,label:e.disabled?Ge.DISABLED:Ge.ENABLED}}];return e.ruleName&&n.push({id:"name",title:Ge.NAME,label:e.ruleName}),e.profileName&&n.push({id:"profile",title:Ge.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&n.push({id:"notes",title:Ge.NOTES,label:e.notes}),n},Ur=({onClose:i,ruleId:r})=>{const c=f(),{addNotification:d}=Ft(),{instrumentationRulesApi:u}=ll(),{items:p,refetch:h}=u.useRules(),{selectedOption:m,loadRule:g,validateFormData:b,genericForm:v}=Nl();o(()=>{h()},[]);const[y,C]=s(!1),[S,w]=s(!1),[x,k]=s(null),T=y&&!!v?.isFormDirty,$=a(()=>p?.find(e=>xt(e)===r),[r,p]),I=a(()=>mt.find(({type:e})=>e===$?.type)??null,[$?.type]);o(()=>{$&&g($)},[$]);const E=l(()=>{if($){if(!$.mutable)return void d({type:Ie.Warning,title:Lt.FORBIDDEN,message:Lt.CANNOT_EDIT_RULE,crdType:gt.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});C(!0)}},[$,d]),A=l(()=>{$&&(g($),C(!1))},[$,g]),N=l(()=>{T?k("close"):i()},[T,i]),O=l(()=>{T?k("cancel"):A()},[T,A]),R=l(()=>{const e=x;k(null),"close"===e?(A(),i()):A()},[x,A,i]),D=l(async()=>{if($){const{errorMessage:e,preparedFormData:t}=b();e||(await u.update($.ruleId,t,$.type),C(!1))}},[$,b,u]),P=l(()=>{if($){if(!$.mutable)return void d({type:Ie.Warning,title:Lt.FORBIDDEN,message:Lt.CANNOT_DELETE_RULE,crdType:gt.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});w(!0)}},[$,d]),F=l(async()=>{$&&(await u.remove($.ruleId,$.type),i())},[$,u,i]);if(!$||!I)return null;const L=((e,n)=>{const o=[];return e.payloadCollection&&Object.entries(e.payloadCollection).forEach(([e,n])=>{n&&o.push(t(ae,{size:le.XS,children:`• ${Pt(e).toLowerCase()}`},`payload-${e}`))}),e.codeAttributes&&Object.entries(e.codeAttributes).forEach(([e,n])=>{n&&o.push(t(ae,{size:le.XS,children:`• ${Pt(e).toLowerCase()}`},`code-${e}`))}),e.headersCollection?.[Pe.HeaderKeys]?.length&&e.headersCollection[Pe.HeaderKeys].forEach((e,n)=>{e&&o.push(t(ae,{size:le.XS,children:e},`header-${n}-${e}`))}),e.customInstrumentations&&(e.customInstrumentations[Me.Java]?.forEach((e,a)=>{const i=new _e(e.className,e.methodName);if(i.Verify()){0===a&&o.push(t(ae,{size:le.XS,children:"Java Custom Probes:"},"java-custom-probes"));const e=i.toString();o.push(t(ae,{size:le.XXS,color:n.v2.colors.grey[200],children:`• ${e}`},`java-probe-${a}-${e}`))}}),e.customInstrumentations[Me.Golang]?.forEach((e,a)=>{const i=new Le(e.packageName,e.functionName,e.receiverName,e.receiverMethodName);if(i.Verify()){0===a&&o.push(t(ae,{size:le.XS,children:"Golang Custom Probes:"},"golang-custom-probes"));const e=i.toString();o.push(t(ae,{size:le.XXS,color:n.v2.colors.grey[200],children:`• ${e}`},`golang-probe-${a}-${e}`))}})),o})($,c);return e(n,{children:[t(ne,{isOpen:!0,header:{icon:Mt($.type),title:I.label,onClose:N,actions:[{id:"edit-rule-btn-edit",label:kt.EDIT,icon:hi,active:y,onClick:E},{id:"edit-rule-btn-delete",label:kt.DELETE,icon:li,color:c.v2.colors.red[500],active:S,onClick:P}]},footer:{actions:y?[{"data-id":"edit-rule-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:O},{"data-id":"edit-rule-btn-save",label:kt.SAVE,variant:de.Primary,onClick:D}]:[]},children:t(Tt,{$padding:"4px 12px 12px",children:y&&m?t(Us,{}):t(W,{$gap:16,children:e($t,{bgTint:"1000",children:[e($t,{bgTint:"900",children:[t(It,{conditions:$.conditions||[]}),t($t,{bgTint:"800",cellsPerRow:2,items:Vr($,I)})]}),t(dl,{readOnly:!0,scopes:$.sourceScopes??null}),!!L.length&&t($t,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t($t,{bgTint:"800",children:L})}),!!I.supportedLanguages.length&&t($t,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t($t,{bgTint:"800",children:t(se,{$gap:12,$wrap:"wrap",children:I.supportedLanguages.map(e=>t(_t,{label:Xe[e],leftIcon:Ve(e),flex:"0.5"},e))})})})]})})})}),t(Sl,{target:"instrumentation rule",isOpen:S,onClose:()=>w(!1),onApprove:F}),t(wl,{isOpen:null!==x,onClose:()=>k(null),onApprove:R})]})};var Gr;!function(e){e.Overview="overview",e.Pods="pods",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"}(Gr||(Gr={}));const Hr=({collapseIsDefaultOpen:e,isJumpToTarget:n,onClickRestartPod:o,namespace:i,podName:l,nodeName:s,startTime:r,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:u,children:p})=>{const{formatDurationAgo:h}=zt(),m=Bt(!!n),g=a(()=>({title:l,icon:Ii,withCopy:!0}),[l]),f=a(()=>{const e=[],t=Xt(c);t&&e.push(t);const n=Xt(d,Ei,"health");n&&e.push(n);const o=Xt(u,Ai,"health");return o&&e.push(o),e},[c,d,u]),b=a(()=>o?[{id:`restart-pod-${l}`,icon:Ni,label:kt.RESTART_POD,onClick:()=>o(i,l)}]:void 0,[o,i,l]),v=a(()=>[{id:"nodeName",title:Ge.NODE,label:s,withCopy:!0},{id:"age",title:Ge.AGE,label:r?h(r,{style:"short"}):Ge.NOT_RUNNING,labelTooltip:r}],[s,r,h]);return t("div",{ref:m,children:t($t,{bgTint:"900",richTitle:g,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:p})})},jr=g.div`
191
+ `,ic=({clusterId:n,namespaceName:o,checkbox:a,isFutureApps:i,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{isVm:d}=v(),u=e=>{s(),c({clusterId:n,workloadId:{namespace:o},auto:e.auto,selected:e.all})};return t(oc,{children:t(As,{dataId:`namespace-${o}`,withCarret:!0,title:o,isSelected:r,onClick:s,isPartiallyChecked:a.partial,isChecked:a.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(ue,{$gap:12,children:[!d&&t(ac,{$visible:r||i,children:t($e,{text:Zs,children:t(oe,{label:qs,labelAlign:ae.Left,size:Tt.S,value:i,onChange:e=>u({auto:e,all:e||void 0})})})}),e(ue,{$gap:8,children:[t(se,{variant:$t.Span,size:de.XXXS,color:ce.Secondary,align:"right",children:Js}),t(We,{label:`${l.sourced}/${l.total}`,status:r?Pe.Default:Pe.Unknown,minWidth:"42px"})]})]})})})},lc=({withCollapse:e,clusterId:n,clusterName:o,namespaces:i,selectedArea:l,setSelectedArea:r,handleSourceChange:s})=>{const c=a(()=>i.map(({name:e,totalWorkloads:a,selectedCount:i,isAllSourced:c,isSomeSourced:d,isFutureApps:u})=>t(ic,{clusterId:n,namespaceName:e,isFutureApps:u,checkbox:{all:c||u,partial:d},selectedCounts:{sourced:i,total:a},isActive:l.clusterId===n&&l.namespaceName===e,onActive:()=>r({clusterId:n,clusterName:o,namespaceName:e}),handleSourceChange:s},`${n}#${e}`)),[n,o,i,l]);return e?t(Ps,{title:o,list:c,noBgColor:!0}):c},rc=({onClose:n,onBack:i,onNext:l,selectedConnectionIds:s,setSelectedConnectionIds:c,withOverlay:d,disableAnimation:u})=>{const{isVm:p}=v(),{sourcesApi:h,snapshotsApi:m,namespacesApi:g}=bl(),{data:f,loading:b,refetch:y}=m.useSnapshots(),{items:C,loading:S,refetch:w}=g.useNamespaces(),x=js(p),{selectedStreamName:k}=Ze(),{progress:T,resetProgress:$}=It(),{isFetching:I,setIsFetching:E,setSnapshots:A,formData:N,handleSourceChange:O,handleSelectAll:R,formDiff:D,isFormDirty:P}=Jl();o(()=>{y(),w()},[]);const F=a(()=>{if(f)return f;const e=C;return e.length?{clusters:[{clusterId:At,clusterName:Et,namespaces:e.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(k),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,selected:(e.markedForInstrumentation?.markedForInstrumentation??!1)&&(e.dataStreamNames?.includes(k)??!1)}))||[]}))}]}:null},[f,C,k]);o(()=>{E(b||S),F&&A(F)},[F,b,S,E,A]);const[L,M]=r(""),[_,z]=r(xt.Namespace),[B,X]=r({showOnlySelected:!1}),[V,U]=r({clusterId:"",clusterName:"",namespaceName:""}),j=(({isFetching:n,formData:o,handleSourceChange:i,handleSelectAll:l,selectedArea:r,setSelectedArea:s,searchText:c,searchBy:d,filters:u})=>{const{isVm:p}=v(),h=js(p),m=a(()=>o.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Kl(e,c,u)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...Yl(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[o,c,u]),g=a(()=>{let e=!1;for(const{visibleNamespaces:t}of m)for(const{totalWorkloads:n,selectedCount:o}of t)if(e=!0,o!==n)return!1;return e},[m]),{list:f,withFilterCount:b,filteredCount:y,totalCount:C}=a(()=>{const e=m.map(({clusterId:e,clusterName:n,visibleNamespaces:o})=>o.length?t(lc,{withCollapse:m.length>1,clusterId:e,clusterName:n,namespaces:o,selectedArea:r,setSelectedArea:s,handleSourceChange:i},e):null).filter(e=>null!==e),n=m.reduce((e,{visibleNamespaces:t})=>e+t.length,0),a=o.reduce((e,{namespaces:t})=>e+t.length,0);return{list:e,withFilterCount:n!==a,filteredCount:n,totalCount:a}},[m,o,r]);return{width:"60%",header:e(ue,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ue,{$gap:8,children:[t(se,{size:de.XS,nowrap:!0,children:h.groupColumnHeader}),t($e,{text:b?qe.FILTERED_COUNT_TOOLTIP:void 0,children:t(We,{label:`${b?`${y} / ${C}`:C}`,status:Pe.Unknown})})]}),t(se,{"data-id":"namespaces-select-all",onClick:()=>l({boolean:!g,searchText:c,searchBy:d,filters:u}),disabled:!f.length,size:de.XS,children:Ks(g)})]}),list:f.length?f:n?[t(ht,{$height:"100%",children:t(yt,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(ht,{$height:"100%",children:t(Ae,c?{icon:Li,title:Gs,subTitle:h.noGroupMatchedFilter(c)}:{icon:Li,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:I,formData:N,handleSourceChange:O,handleSelectAll:R,selectedArea:V,setSelectedArea:U,searchText:_===xt.Namespace?L:"",searchBy:_,filters:B}),G=(({formData:n,handleSourceChange:o,handleSelectAll:i,selectedArea:l,searchText:r,searchBy:s,filters:c})=>{const{tier:d,isVm:u}=v(),p=js(u),h=d===kt.Onprem,m=a(()=>l.value.namespaceName?n.find(({clusterId:e})=>e===l.value.clusterId)?.namespaces.find(({name:e})=>e===l.value.namespaceName):void 0,[n,l.value.clusterId,l.value.namespaceName]),g=a(()=>m?[...m.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Hl(e,r,c)):[],[m,r,c]),f=a(()=>!!g.length&&g.every(({selected:e})=>e),[g]),b=a(()=>{if(!m)return[];const{clusterId:e}=l.value,{name:n}=m;return g.map(({name:a,selected:i,kind:l})=>{const r=!u&&!h&&Wl.has(l);return t(nc,{workloadName:a,workloadKind:l,isChecked:!r&&(i||!1),onToggle:()=>o({clusterId:e,workloadId:{namespace:n,name:a,kind:l}}),disabled:r,disabledReason:Qs},`${e}#${n}#${a}#${l}`)})},[g,m,l.value.clusterId]),{withFilterCount:y,filteredCount:C,totalCount:S}=a(()=>{const e=m?.workloads.length??0;return{withFilterCount:g.length!==e,filteredCount:g.length,totalCount:e}},[g,m]);return{width:"40%",header:e(ue,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ue,{$gap:8,children:[t(se,{size:de.XS,nowrap:!0,children:l.value.namespaceName?`${l.value.namespaceName} > ${p.itemColumnHeader}`:p.itemColumnHeader}),t($e,{text:y?qe.FILTERED_COUNT_TOOLTIP:void 0,children:t(We,{label:`${y?`${C} / ${S}`:S}`,status:Pe.Unknown})})]}),t(se,{"data-id":"workloads-select-all",onClick:()=>i({clusterId:l.value.clusterId,namespaceName:l.value.namespaceName,boolean:!f,searchText:r,searchBy:s,filters:c}),disabled:!b.length,size:de.XS,children:Ks(f)})]}),list:b.length?b:[t(ht,{$height:"100%",children:t(Ae,m?r?{icon:Fi,title:Gs,subTitle:Ws(r)}:{icon:Fi,title:Hs,subTitle:p.noItemsInGroupSubTitle}:{icon:Fi,title:p.selectGroupPrompt.title,subTitle:p.selectGroupPrompt.subTitle})},"no-data")]}})({formData:N,handleSourceChange:O,handleSelectAll:R,selectedArea:{value:V},searchText:_===xt.Source?L:"",searchBy:_,filters:B});return t(Ol,{isOpen:!0,withOverlay:d,disableAnimation:u,onClose:n?()=>{$(Nt.BulkInstrumenting),n()}:void 0,onBack:i?()=>i(D):void 0,onNext:l?()=>l(D):void 0,nextIsSkip:!P,onSave:()=>h.persistV2(D),header:{icon:Fi,title:qe.ADD_SOURCE,subTitle:qe.ADD_SOURCES_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:L,onChange:e=>{M(e),_===xt.Namespace&&U({clusterId:"",clusterName:"",namespaceName:""})},placeholder:x.searchPlaceholder(_),segment:{options:[{label:x.groupSegmentLabel,value:xt.Namespace},{label:x.itemSegmentLabel,value:xt.Source}],selected:_,setSelected:z}},filters:e(ue,{$gap:8,children:[t(se,{size:de.XXXS,color:ce.Secondary,nowrap:!0,children:Ys}),t(oe,{name:"filter-selected",size:Tt.S,label:Js,value:B.showOnlySelected,onChange:e=>X(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:P,isFetching:I,progress:{title:qe.CREATING_SOURCES,subTitle:qe.CREATING_SOURCES_SUBTITLE,percentage:T[Nt.BulkInstrumenting]?.percentage||0},leftColumn:j,rightColumn:G})},sc=(e,t)=>{const n=[{id:"type",title:qe.TYPE,label:t.label},{id:"status",title:qe.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?qe.DISABLED:qe.ENABLED}}],o=e.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return o&&n.push({id:"signals",title:qe.SIGNALS_FOR_PROCESSING,label:o}),e.name&&n.push({id:"name",title:qe.NAME,label:e.name}),e.notes&&n.push({id:"notes",title:qe.NOTES,label:e.notes}),n},cc=({onClose:i,actionId:s})=>{const c=f(),{isVm:d}=v(),{actionsApi:u}=bl(),{items:p,refetch:h}=u.useActions(),{options:m}=u.useActionTypes(),{selectedOption:g,loadAction:b,validateFormData:y,genericForm:C}=zl();o(()=>{h()},[]);const[S,w]=r(!1),[x,k]=r(!1),[T,$]=r(null),I=S&&!!C?.isFormDirty,E=a(()=>p?.find(e=>Ot(e)===s),[s,p]),A=a(()=>m.find(({type:e})=>e===E?.type)??Rt.find(({type:e})=>e===E?.type)??null,[m,E?.type]);o(()=>{E&&b(E,A)},[E,A]);const N=l(()=>{E&&w(!0)},[E]),O=l(()=>{E&&(b(E,A),w(!1))},[E,A,b]),R=l(()=>{I?$("close"):i()},[I,i]),D=l(()=>{I?$("cancel"):O()},[I,O]),P=l(()=>{const e=T;$(null),"close"===e?(O(),i()):O()},[T,O,i]),F=l(async()=>{if(E){const{errorMessage:e,preparedFormData:t}=y();e||(await u.update(E.id,t),w(!1))}},[E,y,u]),L=l(()=>{E&&k(!0)},[E]),M=l(async()=>{E&&(await u.remove(E.id,E.type),i())},[E,u,i]);if(!E||!A)return null;const _=(e=>{const t=[],{type:n,fields:o}=e,a=e=>({status:e?Pe.Success:Pe.Unknown,label:e?"True":"False",invertColors:!0});if(n===Ee.K8sAttributes&&(t.push({id:"collectContainerAttributes",title:"Collect Container Attributes",badge:a(o.collectContainerAttributes)}),t.push({id:"collectReplicaSetAttributes",title:"Collect ReplicaSet Attributes",badge:a(o.collectReplicaSetAttributes)}),t.push({id:"collectWorkloadId",title:"Collect Workload ID",badge:a(o.collectWorkloadId)}),t.push({id:"collectClusterId",title:"Collect Cluster ID",badge:a(o.collectClusterId)}),o.labelsAttributes?.forEach(({labelKey:e,attributeKey:n,from:a,fromSources:i},l)=>{const r=i?.length?i.join(", "):a||ne.Pod,s=(o.labelsAttributes?.length??0)>1?`Label #${l+1} `:"Label ";t.push({id:`label-${l}-key`,title:`${s}Key`,label:e}),t.push({id:`label-${l}-attr`,title:`${s}Attribute Key`,label:n}),t.push({id:`label-${l}-from`,title:`${s}From`,label:r})}),o.annotationsAttributes?.forEach(({annotationKey:e,attributeKey:n,from:a,fromSources:i},l)=>{const r=i?.length?i.join(", "):a||ne.Pod,s=(o.annotationsAttributes?.length??0)>1?`Annotation #${l+1} `:"Annotation ";t.push({id:`annotation-${l}-key`,title:`${s}Key`,label:e}),t.push({id:`annotation-${l}-attr`,title:`${s}Attribute Key`,label:n}),t.push({id:`annotation-${l}-from`,title:`${s}From`,label:r})})),n===Ee.AddClusterInfo&&(t.push({id:"overwriteExistingValues",title:"Overwrite Existing Values",badge:a(o.overwriteExistingValues)}),o.clusterAttributes?.forEach(({attributeName:e,attributeStringValue:n},o)=>{t.push({id:`cluster-attr-${o}`,title:e,label:n})})),n===Ee.DeleteAttributes&&o.attributeNamesToDelete?.forEach((e,n)=>{t.push({id:`del-attr-${n}`,title:"Attribute"+((o.attributeNamesToDelete?.length??0)>1?` #${n+1}`:""),label:e})}),n===Ee.RenameAttributes&&Object.entries(o.renames||{}).forEach(([e,n],o)=>{t.push({id:`rename-${o}`,title:e,label:n})}),n===Ee.PiiMasking&&o.piiCategories?.forEach((e,n)=>{t.push({id:`pii-${n}`,title:"Category"+((o.piiCategories?.length??0)>1?` #${n+1}`:""),label:e})}),n===Ee.ExtractAttribute){const e=o.extractAttribute?.extractions??[];e.forEach(({targetAttributeName:n,lookupKey:o,dataFormat:a,regex:i},l)=>{const r=e.length>1?`Extraction #${l+1} `:"Extraction ";t.push({id:`extract-${l}-target`,title:`${r}New Attribute Name`,label:n||"-"}),o&&t.push({id:`extract-${l}-lookupKey`,title:`${r}Lookup Key`,label:o}),a&&t.push({id:`extract-${l}-format`,title:`${r}Data Format`,label:a}),i&&t.push({id:`extract-${l}-regex`,title:`${r}Regex`,label:i})})}return n===Ee.URLTemplatization&&o.urlTemplatizationRulesGroups?.forEach((e,n)=>{const a=(o.urlTemplatizationRulesGroups?.length??0)>1?`Group #${n+1} `:"Group ";e.filterK8sNamespace&&t.push({id:`group-${n}-ns`,title:`${a}Namespace`,label:e.filterK8sNamespace}),e.workloadFilters?.forEach((o,i)=>{const l=[o.kind,o.name].filter(Boolean).join("/");l&&t.push({id:`group-${n}-wf-${i}`,title:`${a}Workload${(e.workloadFilters?.length??0)>1?` #${i+1}`:""}`,label:l})});const i=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");i&&t.push({id:`group-${n}-templates`,title:`${a}Templates`,label:i}),e.notes&&t.push({id:`group-${n}-notes`,title:`${a}Notes`,label:e.notes})}),t})(E);return e(n,{children:[t(le,{isOpen:!0,header:{icon:Lt(E.type),title:A.label,onClose:R,actions:[{id:"edit-action-btn-edit",label:Dt.EDIT,icon:ki,active:S,onClick:N},{id:"edit-action-btn-delete",label:Dt.DELETE,icon:bi,color:c.v2.colors.red[500],active:x,onClick:L}]},footer:{actions:S?[{"data-id":"edit-action-btn-cancel",label:Dt.CANCEL,variant:me.Secondary,onClick:D},{"data-id":"edit-action-btn-save",label:Dt.SAVE,variant:me.Primary,onClick:F}]:[]},children:t(ut,{$padding:"4px 12px 12px",children:S&&g?t(os,{}):t(q,{$gap:16,children:e(Pt,{bgTint:"1000",children:[e(Pt,{bgTint:"900",children:[!d&&t(Ft,{conditions:E.conditions||[]}),t(Pt,{bgTint:"800",cellsPerRow:2,items:sc(E,A)})]}),!!_?.length&&t(Pt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Pt,{bgTint:"800",cellsPerRow:2,items:_})})]})})})}),t(Rl,{target:"action",isOpen:x,onClose:()=>k(!1),onApprove:M}),t(Dl,{isOpen:null!==T,onClose:()=>$(null),onApprove:P})]})},dc=({onClose:n,connections:l,selectedConnectionIds:s,setSelectedConnectionIds:c})=>{const{configApi:d}=bl(),[u,p]=r(""),[h,m]=r({showOnlySelected:!1}),g=a(()=>l.filter(e=>{const t=!u||e.name.toLowerCase().includes(u.toLowerCase()),n=!h.showOnlySelected||h.showOnlySelected&&s.includes(e.id);return t&&n}),[l.length,s.length,u,h]),f=e=>{c(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=1===s.length?s[0]:void 0,{data:y,loading:v}=d.useEffectiveConfig(b?{id:b}:void 0,{skip:!b}),C=a(()=>{if(b&&y)return{rollout:{automaticRolloutDisabled:y.rollout?.automaticRolloutDisabled??!1}}},[b,y]),{formData:S,handleFormChange:w,areFormValuesEqual:x,resetFormData:k}=Mt(C||{rollout:{automaticRolloutDisabled:!1}}),T=i(k);T.current=k,o(()=>{C&&T.current(C)},[C]);const $=a(()=>s.length>1||void 0!==C&&!x(C,S),[s.length,C,S]);return t(Ol,{isOpen:!0,onClose:n,onSave:async()=>await(d.applyConfigurations?.(S,s))??void 0,header:{icon:Mi,title:"Cluster Configuration"},connectionIds:{value:s,setValue:c},search:{placeholder:"Search by cluster name",value:u,onChange:p},filters:e(ue,{$gap:8,children:[t(se,{size:de.XXXS,color:ce.Secondary,nowrap:!0,children:"Show only:"}),t(oe,{size:Tt.S,label:"Selected",value:h.showOnlySelected,onChange:e=>m(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:$,isFetching:v,leftColumn:{width:"35%",header:e(ue,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ue,{$gap:8,children:[t(se,{size:de.XS,children:"Clusters"}),t(We,{label:g.length,status:Pe.Unknown})]}),e(ue,{$gap:8,children:[t(se,{size:de.XXXS,color:ce.Secondary,align:"right",children:"Selected clusters"}),t(We,{label:`${s.length}/${g.length}`,status:Pe.Unknown})]})]}),list:g.map(e=>t(As,{title:e.name,isChecked:s.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(se,{size:de.XS,children:"Configurations"}),list:[t(oe,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>w("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},uc=e=>{const t=[{id:"type",title:qe.TYPE,label:e.destinationType.displayName},{id:"status",title:qe.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?qe.DISABLED:qe.ENABLED}}],n=Me(e.exportedSignals).map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return n&&t.push({id:"monitors",title:qe.MONITORS,label:n}),e.name&&t.push({id:"name",title:qe.NAME,label:e.name}),t},pc=({onClose:s,destinationId:c})=>{const d=f(),{isVm:u}=v(),{destinationsApi:p}=bl(),{selectedStreamName:h}=Ze(),{items:m,refetch:g}=p.useDestinations(),{data:b,loading:y}=p.useDestinationCategories(),{activeForm:C,loadDestination:S,validateFormData:w,genericForm:x}=Bl();o(()=>{g()},[]);const k=i(null),[T,$]=r(!1),[I,E]=r(!1),[A,N]=r(null),O=T&&!!x?.isFormDirty,R=a(()=>zt(m,h),[m,h]),D=a(()=>R?.find(e=>Ot(e)===c),[c,R]),P=b?.destinationCategories?.categories??null;o(()=>{D&&P&&S(D,P)},[D,P]);const F=a(()=>D&&P?Bt(P,D):[],[D,P]),L=l(()=>{D&&$(!0)},[D]),M=l(()=>{D&&P&&(S(D,P),$(!1))},[D,P,S]),_=l(()=>{O?N("close"):s()},[O,s]),z=l(()=>{O?N("cancel"):M()},[O,M]),B=l(()=>{const e=A;N(null),"close"===e?(M(),s()):M()},[A,M,s]),X=l(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=w();e||(await p.update(D.id,ze(t)),$(!1))}},[D,w,p]),V=l(()=>{D&&E(!0)},[D]),U=l(async()=>{D&&(await p.remove(D.id),s())},[D,p,s]);if(!D)return null;const{icon:j,iconSrc:G}=Ct(D.destinationType.type),H=((e,t)=>{const n=[],o=_t(e,t),a=o.map(e=>({name:e.key,value:e.value})),i=Me(e.exportedSignals);let l=[];const r=()=>{l.length&&(n.push({kind:"cells",id:`cells-${n.length}`,items:l}),l=[])};return o.forEach(({key:e,name:o,value:s})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:u,componentProperties:p,hideFromReadData:h,customReadDataLabels:m}=c||{};if(h?.length&&ke(h,i,a))return;const{type:g}=Te(p,{type:""}),f=d||"password"===g;if(m?.length)m.forEach(({condition:t,...n},o)=>{t==s&&l.push({id:`${e}-custom-${o}`,title:n.title,label:n.value})});else if(s)if(f)l.push({id:e,title:o,label:new Array(10).fill("•").join("")});else{if(u===xe.MultiInput){const t=Te(s,null);if(Array.isArray(t)&&t.length)return r(),void n.push({kind:"list",id:e,title:o,items:t.map((t,n)=>({id:`${e}-${n}`,label:String(t)}))})}if(u===xe.KeyValuePair){const t=Te(s,null);if(Array.isArray(t)&&t.length)return r(),void n.push({kind:"pairs",id:e,title:o,items:t.map((t,n)=>{const o=t&&"object"==typeof t?t:{};return{id:`${e}-${n}`,title:null!=o.key?String(o.key):"",label:null!=o.value?String(o.value):""}})})}l.push({id:e,title:o,label:s})}else l.push({id:e,title:o,label:"-"})}),r(),n})(D,F);return e(n,{children:[t(le,{isOpen:!0,header:{icon:j,iconSrc:G,title:D.name||D.destinationType.displayName,onClose:_,actions:[{id:"edit-destination-btn-edit",label:Dt.EDIT,icon:ki,active:T,onClick:L},{id:"edit-destination-btn-delete",label:Dt.DELETE,icon:bi,color:d.v2.colors.red[500],active:I,onClick:V}]},footer:{actions:T?[{"data-id":"edit-destination-btn-cancel",label:Dt.CANCEL,variant:me.Secondary,onClick:z},...C?.option.testConnectionSupported&&!u?[{"data-id":"edit-destination-btn-test-connection",label:Dt.TEST_CONNECTION,variant:me.Secondary,onClick:()=>k.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:Dt.SAVE,variant:me.Primary,onClick:X}]:[]},children:t(ut,{$padding:"4px 12px 12px",children:y?t(ht,{$height:"50vh",children:t(yt,{withSpinner:!0})}):T&&C?t(ls,{ref:k,isEdit:!0}):t(q,{$gap:16,children:e(Pt,{bgTint:"1000",children:[e(Pt,{bgTint:"900",children:[!u&&t(Ft,{conditions:D.conditions||[]}),t(Pt,{bgTint:"800",cellsPerRow:2,items:uc(D)})]}),!!H.length&&t(Pt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:H.map(e=>"cells"===e.kind?t(Pt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(Pt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(Rl,{target:"destination",isOpen:I,onClose:()=>E(!1),onApprove:U}),t(Dl,{isOpen:null!==A,onClose:()=>N(null),onApprove:B})]})},hc=(e,t)=>{const n=[{id:"type",title:qe.TYPE,label:t.label},{id:"status",title:qe.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?qe.DISABLED:qe.ENABLED}}];return e.ruleName&&n.push({id:"name",title:qe.NAME,label:e.ruleName}),e.profileName&&n.push({id:"profile",title:qe.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&n.push({id:"notes",title:qe.NOTES,label:e.notes}),n},mc=({onClose:i,ruleId:s})=>{const c=f(),{addNotification:d}=Vt(),{isVm:u}=v(),{instrumentationRulesApi:p}=bl(),{items:h,refetch:m}=p.useRules(),{selectedOption:g,loadRule:b,validateFormData:y,genericForm:C}=Xl();o(()=>{m()},[]);const[S,w]=r(!1),[x,k]=r(!1),[T,$]=r(null),I=S&&!!C?.isFormDirty,E=a(()=>h?.find(e=>Ot(e)===s),[s,h]),A=a(()=>wt.find(({type:e})=>e===E?.type)??null,[E?.type]);o(()=>{E&&b(E)},[E]);const N=l(()=>{if(E){if(!E.mutable)return void d({type:Pe.Warning,title:Ut.FORBIDDEN,message:Ut.CANNOT_EDIT_RULE,crdType:xt.InstrumentationRule,target:E.ruleId,hideFromHistory:!0});w(!0)}},[E,d]),O=l(()=>{E&&(b(E),w(!1))},[E,b]),R=l(()=>{I?$("close"):i()},[I,i]),D=l(()=>{I?$("cancel"):O()},[I,O]),P=l(()=>{const e=T;$(null),"close"===e?(O(),i()):O()},[T,O,i]),F=l(async()=>{if(E){const{errorMessage:e,preparedFormData:t}=y();e||(await p.update(E.ruleId,t,E.type),w(!1))}},[E,y,p]),L=l(()=>{if(E){if(!E.mutable)return void d({type:Pe.Warning,title:Ut.FORBIDDEN,message:Ut.CANNOT_DELETE_RULE,crdType:xt.InstrumentationRule,target:E.ruleId,hideFromHistory:!0});k(!0)}},[E,d]),M=l(async()=>{E&&(await p.remove(E.ruleId,E.type),i())},[E,p,i]);if(!E||!A)return null;const _=((e,n)=>{const o=[];return e.payloadCollection&&Object.entries(e.payloadCollection).forEach(([e,n])=>{n&&o.push(t(se,{size:de.XS,children:`• ${Xt(e).toLowerCase()}`},`payload-${e}`))}),e.codeAttributes&&Object.entries(e.codeAttributes).forEach(([e,n])=>{n&&o.push(t(se,{size:de.XS,children:`• ${Xt(e).toLowerCase()}`},`code-${e}`))}),e.headersCollection?.[Xe.HeaderKeys]?.length&&e.headersCollection[Xe.HeaderKeys].forEach((e,n)=>{e&&o.push(t(se,{size:de.XS,children:e},`header-${n}-${e}`))}),e.customInstrumentations&&(e.customInstrumentations[Ge.Java]?.forEach((e,a)=>{const i=new je(e.className,e.methodName);if(i.Verify()){0===a&&o.push(t(se,{size:de.XS,children:"Java Custom Probes:"},"java-custom-probes"));const e=i.toString();o.push(t(se,{size:de.XXS,color:n.v2.colors.grey[200],children:`• ${e}`},`java-probe-${a}-${e}`))}}),e.customInstrumentations[Ge.Golang]?.forEach((e,a)=>{const i=new Ue(e.packageName,e.functionName,e.receiverName,e.receiverMethodName);if(i.Verify()){0===a&&o.push(t(se,{size:de.XS,children:"Golang Custom Probes:"},"golang-custom-probes"));const e=i.toString();o.push(t(se,{size:de.XXS,color:n.v2.colors.grey[200],children:`• ${e}`},`golang-probe-${a}-${e}`))}})),o})(E,c);return e(n,{children:[t(le,{isOpen:!0,header:{icon:Gt(E.type),title:A.label,onClose:R,actions:[{id:"edit-rule-btn-edit",label:Dt.EDIT,icon:ki,active:S,onClick:N},{id:"edit-rule-btn-delete",label:Dt.DELETE,icon:bi,color:c.v2.colors.red[500],active:x,onClick:L}]},footer:{actions:S?[{"data-id":"edit-rule-btn-cancel",label:Dt.CANCEL,variant:me.Secondary,onClick:D},{"data-id":"edit-rule-btn-save",label:Dt.SAVE,variant:me.Primary,onClick:F}]:[]},children:t(ut,{$padding:"4px 12px 12px",children:S&&g?t(ms,{}):t(q,{$gap:16,children:e(Pt,{bgTint:"1000",children:[e(Pt,{bgTint:"900",children:[!u&&t(Ft,{conditions:E.conditions||[]}),t(Pt,{bgTint:"800",cellsPerRow:2,items:hc(E,A)})]}),!u&&t(Sl,{readOnly:!0,scopes:E.sourceScopes??null}),!!_.length&&t(Pt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Pt,{bgTint:"800",children:_})}),!!A.supportedLanguages.length&&t(Pt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Pt,{bgTint:"800",children:t(ue,{$gap:12,$wrap:"wrap",children:A.supportedLanguages.map(e=>t(jt,{label:Ke[e],leftIcon:Ye(e),flex:"0.5"},e))})})})]})})})}),t(Rl,{target:"instrumentation rule",isOpen:x,onClose:()=>k(!1),onApprove:M}),t(Dl,{isOpen:null!==T,onClose:()=>$(null),onApprove:P})]})};var gc;!function(e){e.Overview="overview",e.Pods="pods",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"}(gc||(gc={}));const fc=({collapseIsDefaultOpen:e,isJumpToTarget:n,onClickRestartPod:o,namespace:i,podName:l,nodeName:r,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:u,children:p})=>{const{formatDurationAgo:h}=Ht(),m=Wt(!!n),g=a(()=>({title:l,icon:_i,withCopy:!0}),[l]),f=a(()=>{const e=[],t=Kt(c);t&&e.push(t);const n=Kt(d,zi,"health");n&&e.push(n);const o=Kt(u,Bi,"health");return o&&e.push(o),e},[c,d,u]),b=a(()=>o?[{id:`restart-pod-${l}`,icon:Xi,label:Dt.RESTART_POD,onClick:()=>o(i,l)}]:void 0,[o,i,l]),y=a(()=>[{id:"nodeName",title:qe.NODE,label:r,withCopy:!0},{id:"age",title:qe.AGE,label:s?h(s,{style:"short"}):qe.NOT_RUNNING,labelTooltip:s}],[r,s,h]);return t("div",{ref:m,children:t(Pt,{bgTint:"900",richTitle:g,badges:f,dropDataActions:b,items:y,withCollapse:!0,collapseIsDefaultOpen:e,children:p})})},bc=g.div`
192
192
  display: flex;
193
193
  align-items: center;
194
194
  justify-content: space-between;
@@ -196,7 +196,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
196
196
  padding: ${({$noPadding:e})=>e?"0":"12px"};
197
197
  border-radius: 12px;
198
198
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
199
- `,Wr=({podsOdigosHealthStatus:n,pods:o,noPadding:i})=>{const l=Gt(n?.status),s=Pt(n?.name),r=n?.message,{totalPodsCount:c,injectionsAsExpectedCount:d,odigosHealthyPodsCount:u,k8sHealthyPodsCount:p}=a(()=>({totalPodsCount:o?.length||0,injectionsAsExpectedCount:o?.reduce((e,t)=>e+(t.agentInjectedStatus?.status===Vt.Success?1:0),0)||0,odigosHealthyPodsCount:o?.reduce((e,t)=>e+(t.odigosHealthStatus?.status===Vt.Success?1:0),0)||0,k8sHealthyPodsCount:o?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===Vt.Success?1:0),0)||0}),[o]);return o?.length&&n&&l?e(jr,{$noPadding:i,children:[t(Ut,{invertColors:!0,hideBackground:!0,status:l,title:s,subTitle:r}),e(se,{$gap:8,children:[t(Yr,{label:Ge.PODS,count:c}),t(Yr,{label:Ge.INJECTIONS_AS_EXPECTED,count:d,total:c}),t(Yr,{label:Ge.ODIGOS_HEALTHY,icon:Ei,count:u,total:c}),t(Yr,{label:Ge.KUBERNETES_HEALTHY,icon:Ai,count:p,total:c})]})]}):null},Kr=g.div`
199
+ `,yc=({podsOdigosHealthStatus:n,pods:o,noPadding:i})=>{const l=qt(n?.status),r=Xt(n?.name),s=n?.message,{totalPodsCount:c,injectionsAsExpectedCount:d,odigosHealthyPodsCount:u,k8sHealthyPodsCount:p}=a(()=>({totalPodsCount:o?.length||0,injectionsAsExpectedCount:o?.reduce((e,t)=>e+(t.agentInjectedStatus?.status===Yt.Success?1:0),0)||0,odigosHealthyPodsCount:o?.reduce((e,t)=>e+(t.odigosHealthStatus?.status===Yt.Success?1:0),0)||0,k8sHealthyPodsCount:o?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===Yt.Success?1:0),0)||0}),[o]);return o?.length&&n&&l?e(bc,{$noPadding:i,children:[t(Jt,{invertColors:!0,hideBackground:!0,status:l,title:r,subTitle:s}),e(ue,{$gap:8,children:[t(Cc,{label:qe.PODS,count:c}),t(Cc,{label:qe.INJECTIONS_AS_EXPECTED,count:d,total:c}),t(Cc,{label:qe.ODIGOS_HEALTHY,icon:zi,count:u,total:c}),t(Cc,{label:qe.KUBERNETES_HEALTHY,icon:Bi,count:p,total:c})]})]}):null},vc=g.div`
200
200
  display: flex;
201
201
  flex-direction: column;
202
202
  justify-content: center;
@@ -207,7 +207,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
207
207
  width: fit-content;
208
208
  border-radius: 8px;
209
209
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
210
- `,Yr=({count:n,total:o,label:a,icon:i})=>{const l=f(),s=void 0===o?void 0:n===o?l.v2.colors.green[500]:l.v2.colors.red[500];return e(Kr,{children:[e(se,{$gap:0,$alignItems:"flex-end",children:[t(ae,{size:le.L,color:s,weight:500,nowrap:!0,children:n}),void 0!==o&&t(ae,{size:le.S,color:s,weight:500,nowrap:!0,children:`/${o}`})]}),e(se,{$alignItems:"center",$gap:4,children:[i&&t(i,{size:16}),t(ae,{size:le.XXXS,nowrap:!0,children:a})]})]})},Jr=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===Ht.PID)??e.identifyingAttributes?.find(({name:e})=>e===Ht.VPID);return t?.value??null};var qr;!function(e){e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"}(qr||(qr={}));const Zr=({overrideProcessNum:n,healthy:i,healthStatus:l,identifyingAttributes:r,instrumentations:c,isJumpToTarget:d})=>{const u=f(),[p,h]=s(qr.IdentifyingAttributes),m=Bt(!!d),{tabOptions:g,firstTabValue:b,bothTabsDisabled:v}=a(()=>{const e=c?.some(e=>!1===e.healthy),n=[{value:qr.IdentifyingAttributes,label:Ge.IDENTIFYING_ATTRIBUTES,disabled:!r?.length,selectedBgColor:u.v2.colors.purple[500]},{value:qr.InstrumentationLibraries,label:Ge.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(Oi,{...e,fill:u.v2.colors.red[500]}):void 0,disabled:!c?.length,selectedBgColor:u.v2.colors.purple[500]}];return{tabOptions:n,firstTabValue:n.find(e=>!e.disabled)?.value||n[0].value,bothTabsDisabled:n.every(e=>e.disabled)}},[r,c]);o(()=>{b&&h(b)},[b]);const y=a(()=>{switch(p){case qr.IdentifyingAttributes:return t(W,{children:r?.map((e,n)=>t(oc,{label:e.name,value:e.value},`attr-${n}-${e.name}`))});case qr.InstrumentationLibraries:return t(W,{children:c?.map((e,n)=>t(oc,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${n}-${e.name}`))});default:return null}},[p,r,c]),C=a(()=>Jr({overrideProcessNum:n,identifyingAttributes:r}),[n,r]);return t("div",{ref:m,children:e($t,{bgTint:"800",richTitle:{title:C?`${Ge.PROCESS} ${Ge.PID(C)}`:Ge.PROCESS_FALLBACK_NAME},renderOnRightSide:t(ae,{color:i?ie.Success:ie.Error,size:le.XXXS,children:l?.message}),badges:[{key:"odigos-healthy",status:i?Ie.Success:Ie.Error,leftIcon:Ei,label:i?Ge.HEALTHY:Ge.NOT_HEALTHY,textSize:le.XXXS,invertColors:!0,useSecondaryTone:!0}],withCollapse:!v,collapseIsDefaultOpen:d,children:[!v&&t(ue,{options:g,selected:p,setSelected:h}),!v&&y]})})},Qr=g.div`
210
+ `,Cc=({count:n,total:o,label:a,icon:i})=>{const l=f(),r=void 0===o?void 0:n===o?l.v2.colors.green[500]:l.v2.colors.red[500];return e(vc,{children:[e(ue,{$gap:0,$alignItems:"flex-end",children:[t(se,{size:de.L,color:r,weight:500,nowrap:!0,children:n}),void 0!==o&&t(se,{size:de.S,color:r,weight:500,nowrap:!0,children:`/${o}`})]}),e(ue,{$alignItems:"center",$gap:4,children:[i&&t(i,{size:16}),t(se,{size:de.XXXS,nowrap:!0,children:a})]})]})},Sc=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===Zt.PID)??e.identifyingAttributes?.find(({name:e})=>e===Zt.VPID);return t?.value??null};var wc;!function(e){e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"}(wc||(wc={}));const xc=({overrideProcessNum:n,healthy:i,healthStatus:l,identifyingAttributes:s,instrumentations:c,isJumpToTarget:d})=>{const u=f(),[p,h]=r(wc.IdentifyingAttributes),m=Wt(!!d),{tabOptions:g,firstTabValue:b,bothTabsDisabled:y}=a(()=>{const e=c?.some(e=>!1===e.healthy),n=[{value:wc.IdentifyingAttributes,label:qe.IDENTIFYING_ATTRIBUTES,disabled:!s?.length,selectedBgColor:u.v2.colors.purple[500]},{value:wc.InstrumentationLibraries,label:qe.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(Vi,{...e,fill:u.v2.colors.red[500]}):void 0,disabled:!c?.length,selectedBgColor:u.v2.colors.purple[500]}];return{tabOptions:n,firstTabValue:n.find(e=>!e.disabled)?.value||n[0].value,bothTabsDisabled:n.every(e=>e.disabled)}},[s,c]);o(()=>{b&&h(b)},[b]);const v=a(()=>{switch(p){case wc.IdentifyingAttributes:return t(q,{children:s?.map((e,n)=>t(Ec,{label:e.name,value:e.value},`attr-${n}-${e.name}`))});case wc.InstrumentationLibraries:return t(q,{children:c?.map((e,n)=>t(Ec,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${n}-${e.name}`))});default:return null}},[p,s,c]),C=a(()=>Sc({overrideProcessNum:n,identifyingAttributes:s}),[n,s]);return t("div",{ref:m,children:e(Pt,{bgTint:"800",richTitle:{title:C?`${qe.PROCESS} ${qe.PID(C)}`:qe.PROCESS_FALLBACK_NAME},renderOnRightSide:t(se,{color:i?ce.Success:ce.Error,size:de.XXXS,children:l?.message}),badges:[{key:"odigos-healthy",status:i?Pe.Success:Pe.Error,leftIcon:zi,label:i?qe.HEALTHY:qe.NOT_HEALTHY,textSize:de.XXXS,invertColors:!0,useSecondaryTone:!0}],withCollapse:!y,collapseIsDefaultOpen:d,children:[!y&&t(ge,{options:g,selected:p,setSelected:h}),!y&&v]})})},kc=g.div`
211
211
  display: flex;
212
212
  align-items: flex-start;
213
213
  gap: 8px;
@@ -216,23 +216,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
216
216
  &:hover {
217
217
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
218
218
  }
219
- `,ec=g(ae)`
219
+ `,Tc=g(se)`
220
220
  flex: 0 0 30%;
221
- `,tc=g(ae)`
221
+ `,$c=g(se)`
222
222
  flex: 1 1 auto;
223
223
  min-width: 0;
224
- `,nc=g(se)`
224
+ `,Ic=g(ue)`
225
225
  flex: 1 1 auto;
226
226
  justify-content: flex-end;
227
227
  min-width: 0;
228
- `,oc=({label:n,value:o,isStandardLibrary:a,healthy:i,message:l})=>{const s="boolean"==typeof i;return e(Qr,{children:[t(ec,{size:le.XXS,color:ie.Secondary,children:n}),o&&t(tc,{size:le.XXS,color:ie.Primary,align:"right",children:o}),(s||a)&&e(nc,{children:[a&&t(Be,{status:Ie.Info,label:Ge.STANDARD,textSize:le.XXXS,invertColors:!0}),s&&t(Be,{status:i?Ie.Success:Ie.Error,label:i?Ge.HEALTHY:Ge.NOT_HEALTHY,textSize:le.XXXS,invertColors:!0,tooltip:l??void 0})]})]})},ac=p(null),ic=({value:e,children:n})=>t(ac.Provider,{value:e,children:n}),lc=({podContainers:e,sourceContainers:n,jumpToTarget:o})=>{const i=e??[],l=a(()=>({title:Ge.CONTAINERS,titleSize:le.XS,badge:{label:i.length}}),[i.length]),s=a(()=>{const e=new Map;return n?.forEach(t=>e.set(t.containerName,t)),e},[n]);return t($t,{bgTint:"800",richTitle:l,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(W,{$gap:8,children:i.map(e=>{const n=o?.containerName===e.containerName;return t(rc,{...e,language:jt(s.get(e.containerName)),jumpToTarget:n?o:null},`pod-container-${e.containerName}`)})})})},sc=g.div`
228
+ `,Ec=({label:n,value:o,isStandardLibrary:a,healthy:i,message:l})=>{const r="boolean"==typeof i;return e(kc,{children:[t(Tc,{size:de.XXS,color:ce.Secondary,children:n}),o&&t($c,{size:de.XXS,color:ce.Primary,align:"right",children:o}),(r||a)&&e(Ic,{children:[a&&t(We,{status:Pe.Info,label:qe.STANDARD,textSize:de.XXXS,invertColors:!0}),r&&t(We,{status:i?Pe.Success:Pe.Error,label:i?qe.HEALTHY:qe.NOT_HEALTHY,textSize:de.XXXS,invertColors:!0,tooltip:l??void 0})]})]})},Ac=p(null),Nc=({value:e,children:n})=>t(Ac.Provider,{value:e,children:n}),Oc=({podContainers:e,sourceContainers:n,jumpToTarget:o})=>{const i=e??[],l=a(()=>({title:qe.CONTAINERS,titleSize:de.XS,badge:{label:i.length}}),[i.length]),r=a(()=>{const e=new Map;return n?.forEach(t=>e.set(t.containerName,t)),e},[n]);return t(Pt,{bgTint:"800",richTitle:l,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(q,{$gap:8,children:i.map(e=>{const n=o?.containerName===e.containerName;return t(Dc,{...e,language:Qt(r.get(e.containerName)),jumpToTarget:n?o:null},`pod-container-${e.containerName}`)})})})},Rc=g.div`
229
229
  display: flex;
230
230
  flex-direction: column;
231
231
  gap: 12px;
232
232
  padding: 8px 12px;
233
233
  border-radius: 8px;
234
234
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
235
- `,rc=({language:n,containerName:o,otelDistroName:i,runningStartedTime:l,started:s,ready:r,restartCount:c,isCrashLoop:d,waitingReasonEnum:u,waitingMessage:p,odigosHealthStatus:h,k8sHealthStatus:m,processes:g,jumpToTarget:f})=>{const b=!!f,v=b&&!f?.processPid,{formatDurationAgo:y}=zt(),C=Bt(v),S=a(()=>({title:o,icon:n?Ve(n):Ri,iconWithWrapper:!0}),[o,n]),w=a(()=>{const e=[],t=Xt({status:i?Vt.Success:Vt.Disabled,reasonEnum:i?Ge.INSTRUMENTED_WITH_DISTRO(i):Ge.UNINSTRUMENTED,message:""});t&&e.push(t);const n=Xt(h,Ei,"health");n&&e.push(n);const o=Xt(m,Ai,"health");return o&&e.push(o),e},[m,h,i]),x=a(()=>[{id:"runningTime",title:Ge.RUNNING_TIME,label:l?y(l,{style:"short"}):Ge.NOT_RUNNING,labelTooltip:`${Ge.RUNNING_TIME_TOOLTIP}. (${l})`},{id:"blank",spacer:!0},{id:"started",badge:{status:s?Ie.Success:Ie.Disabled,leftIcon:s?ci:di,label:s?Ge.STARTED:Ge.NOT_STARTED,textSize:le.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:r?Ie.Success:Ie.Disabled,leftIcon:r?ci:di,label:r?Ge.READY:Ge.NOT_READY,textSize:le.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"isCrashLoop",badge:{status:d?Ie.Error:Ie.Success,leftIcon:d?di:ci,label:d?Ge.CRASHLOOP:Ge.NO_CRASHLOOP,textSize:le.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"restartCount",title:Ge.RESTARTS,badge:{status:c?Ie.Error:void 0,label:c||0,textSize:le.XXXS}}],[l,y,s,r,d,c]),k=a(()=>p?Pt(u):"",[p,u]);return t("div",{ref:C,children:e($t,{bgTint:"750",richTitle:S,badges:w,items:x,withCollapse:!0,collapseIsDefaultOpen:b,children:[p&&t(sc,{children:e(se,{$gap:10,$alignItems:"center",children:[t(_t,{variant:Wt.Pink,leftIcon:Ai,label:k}),t(ae,{size:le.XXXS,color:ie.Error,children:p})]})}),(g??[]).map((e,n)=>{const a=n+1,i=b&&(l=f,s=e,!!l?.processPid&&Jr({identifyingAttributes:s.identifyingAttributes})===l.processPid);var l,s;return t(Zr,{...e,overrideProcessNum:a,isJumpToTarget:i},`pod-container-${o}-process-${a}`)})]})})},cc=({podName:e,namespace:n,hasRestarted:o})=>{const i=a(()=>({title:Ge.DEBUG_COMMANDS,titleSize:le.XS}),[]),l=a(()=>[{label:Ge.GET_POD_YAML,value:`kubectl get pod ${e} -n ${n} -o yaml`},{label:Ge.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${n}`},{label:Ge.GET_POD_LOGS,value:`kubectl logs ${e} -n ${n}${o?" -p":""}`}],[e,n,o]);return t($t,{bgTint:"800",richTitle:i,withCollapse:!0,children:l.map(({label:e,value:n})=>t(Kt,{bgTint:"700",label:e,value:n},e))})},dc=({source:o,onClickRestartPod:i})=>{const{jumpToTarget:l}=(()=>{const e=h(ac);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e})(),s=l?.tab===Gr.Pods?l:null,r=o?.pods??[],c=r.length>0,d=a(()=>r.some(e=>e.containers?.some(e=>e.restartCount&&e.restartCount>0)),[r]),u=a(()=>({title:Ge.PODS,badge:{label:r.length}}),[r.length]);return t(W,{$gap:12,children:c?e(n,{children:[t(Wr,{podsOdigosHealthStatus:o.podsOdigosHealthStatus,pods:r}),t($t,{bgTint:"1000",richTitle:u,children:r.map(n=>{const a=s?.podName===n.podName,l=a&&!s?.containerName;return e(Hr,{...n,namespace:o.id.namespace,onClickRestartPod:i,collapseIsDefaultOpen:a,isJumpToTarget:l,children:[t(cc,{podName:n.podName,namespace:o.id.namespace,hasRestarted:d}),t(lc,{podContainers:n.containers,sourceContainers:o.containers,jumpToTarget:a?s:null})]},`pod-${n.podName}`)})})]}):t(at,{$height:"70vh",children:t(Ce,{title:Ge.NO_RUNNING_PODS,subTitle:Ge.NO_RUNNING_PODS_SUBTITLE})})})},uc=({source:n})=>{const o=a(()=>n.serviceName||n.id.name,[n]),{sourcesApi:i}=ll(),{data:l,loading:s,refetch:r}=i.usePeerSources({serviceName:o},{fetchPolicy:"network-only"}),c=l?.peerSources??null;return!c||s?t(at,s?{$height:"70vh",children:t(ct,{withSpinner:!0})}:{$height:"70vh",children:t(Ce,{subTitle:Ge.COULD_NOT_FETCH_PEER_SOURCES})}):e(se,{$gap:16,$alignItems:"flex-start",children:[t(pc,{icon:Di,title:Ge.INBOUND,subTitle:Ge.INBOUND_DESCRIPTION(o),onRefresh:r,items:c?.inbound??[]}),t(pc,{icon:Pi,title:Ge.OUTBOUND,subTitle:Ge.OUTBOUND_DESCRIPTION(o),onRefresh:r,items:c?.outbound??[]})]})},pc=({icon:n,title:o,subTitle:i,onRefresh:l,items:r})=>{const[c,d]=s(""),u=a(()=>r.filter(e=>e.serviceName.toLowerCase().includes(c.toLowerCase())),[r,c]);return e($t,{bgTint:"1000",richTitle:{icon:n,title:o,titleSize:le.XS,subTitle:i,subTitleSize:le.XXXS,badge:{label:r.length}},actions:[{id:"refresh",type:Yt.Button,buttonProps:{variant:de.Secondary,size:ce.S,leftIcon:Ni,onClick:l}}],children:[t(Jt,{value:c,onChange:d,width:"100%"}),t(qt,{height:"calc(100vh - 284px)",gap:4,elements:u.length||c?!u.length&&c?[t(at,{$height:"50vh",children:t(Ce,{icon:n,title:Ge.NO_RESULTS,subTitle:Ge.NO_RESULTS_FOR_FILTER(c)})},"no-results")]:u.map(e=>t(mc,{...e},`${o}-${e.serviceName}`)):[t(at,{$height:"50vh",children:t(Ce,{icon:n,title:`No ${o} connections yet`,subTitle:o===Ge.INBOUND?Ge.NO_INBOUND_CONNECTIONS_DESCRIPTION:Ge.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},hc=g.div`
235
+ `,Dc=({language:n,containerName:o,otelDistroName:i,runningStartedTime:l,started:r,ready:s,restartCount:c,isCrashLoop:d,waitingReasonEnum:u,waitingMessage:p,odigosHealthStatus:h,k8sHealthStatus:m,processes:g,jumpToTarget:f})=>{const b=!!f,y=b&&!f?.processPid,{formatDurationAgo:v}=Ht(),C=Wt(y),S=a(()=>({title:o,icon:n?Ye(n):Ui,iconWithWrapper:!0}),[o,n]),w=a(()=>{const e=[],t=Kt({status:i?Yt.Success:Yt.Disabled,reasonEnum:i?qe.INSTRUMENTED_WITH_DISTRO(i):qe.UNINSTRUMENTED,message:""});t&&e.push(t);const n=Kt(h,zi,"health");n&&e.push(n);const o=Kt(m,Bi,"health");return o&&e.push(o),e},[m,h,i]),x=a(()=>[{id:"runningTime",title:qe.RUNNING_TIME,label:l?v(l,{style:"short"}):qe.NOT_RUNNING,labelTooltip:`${qe.RUNNING_TIME_TOOLTIP}. (${l})`},{id:"blank",spacer:!0},{id:"started",badge:{status:r?Pe.Success:Pe.Disabled,leftIcon:r?Ci:Si,label:r?qe.STARTED:qe.NOT_STARTED,textSize:de.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:s?Pe.Success:Pe.Disabled,leftIcon:s?Ci:Si,label:s?qe.READY:qe.NOT_READY,textSize:de.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"isCrashLoop",badge:{status:d?Pe.Error:Pe.Success,leftIcon:d?Si:Ci,label:d?qe.CRASHLOOP:qe.NO_CRASHLOOP,textSize:de.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"restartCount",title:qe.RESTARTS,badge:{status:c?Pe.Error:void 0,label:c||0,textSize:de.XXXS}}],[l,v,r,s,d,c]),k=a(()=>p?Xt(u):"",[p,u]);return t("div",{ref:C,children:e(Pt,{bgTint:"750",richTitle:S,badges:w,items:x,withCollapse:!0,collapseIsDefaultOpen:b,children:[p&&t(Rc,{children:e(ue,{$gap:10,$alignItems:"center",children:[t(jt,{variant:en.Pink,leftIcon:Bi,label:k}),t(se,{size:de.XXXS,color:ce.Error,children:p})]})}),(g??[]).map((e,n)=>{const a=n+1,i=b&&(l=f,r=e,!!l?.processPid&&Sc({identifyingAttributes:r.identifyingAttributes})===l.processPid);var l,r;return t(xc,{...e,overrideProcessNum:a,isJumpToTarget:i},`pod-container-${o}-process-${a}`)})]})})},Pc=({podName:e,namespace:n,hasRestarted:o})=>{const i=a(()=>({title:qe.DEBUG_COMMANDS,titleSize:de.XS}),[]),l=a(()=>[{label:qe.GET_POD_YAML,value:`kubectl get pod ${e} -n ${n} -o yaml`},{label:qe.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${n}`},{label:qe.GET_POD_LOGS,value:`kubectl logs ${e} -n ${n}${o?" -p":""}`}],[e,n,o]);return t(Pt,{bgTint:"800",richTitle:i,withCollapse:!0,children:l.map(({label:e,value:n})=>t(tn,{bgTint:"700",label:e,value:n},e))})},Fc=({source:o,onClickRestartPod:i})=>{const{jumpToTarget:l}=(()=>{const e=h(Ac);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e})(),r=l?.tab===gc.Pods?l:null,s=o?.pods??[],c=s.length>0,d=a(()=>s.some(e=>e.containers?.some(e=>e.restartCount&&e.restartCount>0)),[s]),u=a(()=>({title:qe.PODS,badge:{label:s.length}}),[s.length]);return t(q,{$gap:12,children:c?e(n,{children:[t(yc,{podsOdigosHealthStatus:o.podsOdigosHealthStatus,pods:s}),t(Pt,{bgTint:"1000",richTitle:u,children:s.map(n=>{const a=r?.podName===n.podName,l=a&&!r?.containerName;return e(fc,{...n,namespace:o.id.namespace,onClickRestartPod:i,collapseIsDefaultOpen:a,isJumpToTarget:l,children:[t(Pc,{podName:n.podName,namespace:o.id.namespace,hasRestarted:d}),t(Oc,{podContainers:n.containers,sourceContainers:o.containers,jumpToTarget:a?r:null})]},`pod-${n.podName}`)})})]}):t(ht,{$height:"70vh",children:t(Ae,{title:qe.NO_RUNNING_PODS,subTitle:qe.NO_RUNNING_PODS_SUBTITLE})})})},Lc=({source:n})=>{const o=a(()=>n.serviceName||n.id.name,[n]),{sourcesApi:i}=bl(),{data:l,loading:r,refetch:s}=i.usePeerSources({serviceName:o},{fetchPolicy:"network-only"}),c=l?.peerSources??null;return!c||r?t(ht,r?{$height:"70vh",children:t(yt,{withSpinner:!0})}:{$height:"70vh",children:t(Ae,{subTitle:qe.COULD_NOT_FETCH_PEER_SOURCES})}):e(ue,{$gap:16,$alignItems:"flex-start",children:[t(Mc,{icon:ji,title:qe.INBOUND,subTitle:qe.INBOUND_DESCRIPTION(o),onRefresh:s,items:c?.inbound??[]}),t(Mc,{icon:Gi,title:qe.OUTBOUND,subTitle:qe.OUTBOUND_DESCRIPTION(o),onRefresh:s,items:c?.outbound??[]})]})},Mc=({icon:n,title:o,subTitle:i,onRefresh:l,items:s})=>{const[c,d]=r(""),u=a(()=>s.filter(e=>e.serviceName.toLowerCase().includes(c.toLowerCase())),[s,c]);return e(Pt,{bgTint:"1000",richTitle:{icon:n,title:o,titleSize:de.XS,subTitle:i,subTitleSize:de.XXXS,badge:{label:s.length}},actions:[{id:"refresh",type:nn.Button,buttonProps:{variant:me.Secondary,size:he.S,leftIcon:Xi,onClick:l}}],children:[t(on,{value:c,onChange:d,width:"100%"}),t(an,{height:"calc(100vh - 284px)",gap:4,elements:u.length||c?!u.length&&c?[t(ht,{$height:"50vh",children:t(Ae,{icon:n,title:qe.NO_RESULTS,subTitle:qe.NO_RESULTS_FOR_FILTER(c)})},"no-results")]:u.map(e=>t(zc,{...e},`${o}-${e.serviceName}`)):[t(ht,{$height:"50vh",children:t(Ae,{icon:n,title:`No ${o} connections yet`,subTitle:o===qe.INBOUND?qe.NO_INBOUND_CONNECTIONS_DESCRIPTION:qe.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},_c=g.div`
236
236
  display: flex;
237
237
  align-items: center;
238
238
  justify-content: space-between;
@@ -246,9 +246,9 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
246
246
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
247
247
  }
248
248
  `}
249
- `,mc=({serviceName:n,isVirtual:o,nodeAttributes:i})=>{const l=Zt(e=>e.drawerEntityId),{items:s}=ll().sourcesApi.useSources(),r=a(()=>s.find(e=>e.id.name===n||e.serviceName===n),[s,n]),c=a(()=>r&&JSON.stringify(Qt(r))!==JSON.stringify(Qt(l)),[r,l]),d=a(()=>{if(o){const e=Object.fromEntries((i??[]).map(({key:e,value:t})=>[e,t]));return[en({serviceName:n,attributes:e})]}if(n?.toLowerCase()===Wl)return[Fi];const e=r?tn(r):void 0;return e?.length?e:[Ri]},[o,i,n,r]),u=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=Zt.getState();e(gt.Source),t({namespace:r?.id.namespace??"",name:r?.id.name??"",kind:r?.id.kind??""})}:void 0;return e(hc,{onClick:u,$withClick:!!u,children:[e(se,{$gap:8,children:[t(nn,{icons:d}),t(ae,{size:le.XXS,children:n})]}),o&&t(Be,{status:Ie.Info,label:Ge.VIRTUAL,textSize:le.XXXS,invertColors:!0,tooltip:Ge.VIRTUAL_TOOLTIP})]})},gc=e=>{if("string"==typeof e)return e;if(e&&"object"==typeof e){const t=e;if("string"==typeof t.k8sActualManifest)return t.k8sActualManifest;if("string"==typeof t.manifest)return t.manifest}},fc=({source:n})=>{const i=f(),{k8sManifestApi:l}=ll(),[r,c]=s(!0),[d,u]=s(void 0),[p,h]=s(!0),[m,g]=s(void 0);o(()=>{l.fetch({namespace:n.id.namespace,kind:n.id.kind,name:n.id.name}).then(({data:e})=>u(gc(e))).finally(()=>c(!1)),l.fetch({namespace:n.id.namespace,kind:on.InstrumentationConfig,name:`${n.id.kind}-${n.id.name}`.toLowerCase()}).then(({data:e})=>g(gc(e))).finally(()=>h(!1))},[l,n.id.namespace,n.id.kind,n.id.name]);const b=a(()=>[{label:Ge.DESCRIBE_POD,value:`kubectl describe ${n.id.kind} ${n.id.name} -n ${n.id.namespace}`},{label:Ge.GET_POD_YAML,value:`kubectl get ${n.id.kind} ${n.id.name} -n ${n.id.namespace} -o yaml`},{label:Ge.GET_POD_YAML,value:`kubectl get ${on.InstrumentationConfig} ${n.id.kind}-${n.id.name} -n ${n.id.namespace} -o yaml`}],[n.id.kind,n.id.name,n.id.namespace]);return e($t,{bgTint:"1000",children:[t($t,{bgTint:"900",richTitle:{icon:Li,title:Ge.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:b.map(({label:e,value:n},o)=>t(Kt,{label:e,value:n},`debug-cmd-${o}-${e}`))}),r?t(an,{size:1}):t(xl,{bgTint:"800",codeBgColor:i.v2.colors.silver[900],title:`${n.id.kind} YAML`,yaml:d}),p?t(an,{size:1}):t(xl,{bgTint:"800",codeBgColor:i.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:m})]})},bc=({title:n,children:o})=>e(W,{$gap:8,children:[t(ae,{size:le.XXXS,color:ie.Secondary,children:n}),o]}),vc=({source:n})=>{const o=a(()=>{const[e,t]=ln(n.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[n]);return t(bc,{title:Ge.THROUGHPUT_LAST_10_SECONDS,children:e(se,{$alignItems:"flex-end",$gap:4,children:[t(ae,{size:le.L,children:o.value}),t(ae,{size:le.XS,variant:vt.Span,children:o.units})]})})},yc=({source:n})=>{const{CopyButton:o}=sn();return t(bc,{title:Ge.NAMESPACE,children:e(se,{children:[t(_t,{variant:Wt.Blue,label:n.id.namespace}),t(o,{value:n.id.namespace,size:rt.XS})]})})},Cc=({source:e})=>t(bc,{title:Ge.KIND,children:t(se,{children:t(_t,{variant:Wt.Blue,label:e.id.kind})})}),Sc=({source:n})=>{const{CopyButton:o}=sn();return t(bc,{title:Ge.NAME,children:e(se,{children:[t(_t,{variant:Wt.Blue,label:n.id.name}),t(o,{value:n.id.name,size:rt.XS})]})})},wc=({source:n})=>{const{isVm:o}=y();return t($t,{children:e(se,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[!o&&t(vc,{source:n}),!o&&t(yc,{source:n}),t(Cc,{source:n}),t(Sc,{source:n})]})})},xc=({source:e})=>e.pods?.length?t($t,{bgTint:"900",children:t(Wr,{podsOdigosHealthStatus:e.podsOdigosHealthStatus,pods:e.pods,noPadding:!0})}):null,kc=({source:e})=>{const n=a(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?rn(e.workloadOdigosHealthStatus.status):Ie.Unknown,title:Pt(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return n?t(Ut,{...n,width:"100%"}):null},Tc="calc(50% - 6px)",$c=({source:n,onClickRollout:o,onClickRollback:i})=>{const l=a(()=>{const{status:e,reasonEnum:t,message:a}=n.conditions?.rollout||{},i=Gt(e);if(!i)return null;return{status:i,title:t?.toLowerCase().includes("rollout")?Pt(t):`${Ge.ROLLOUT} ${Pt(t)}`,subTitle:a,action:i!==Ie.Success?{icon:Ni,tooltip:Ge.ROLLOUT_RESTART,onClick:o}:void 0}},[n]),s=a(()=>{const{status:e,reasonEnum:t,message:o}=n.autoRollback?.autoRollbackStatus||{},a=Gt(e);if(!a)return null;return{status:a,title:t?.toLowerCase().includes("rollback")?Pt(t):`${Ge.ROLLBACK} ${Pt(t)}`,subTitle:o,action:a!==Ie.Success?{icon:Ni,tooltip:Ge.ROLLBACK_RECOVER,onClick:i}:void 0}},[n]);return l||s?e(se,{$gap:12,$alignItems:"stretch",children:[l&&t(Ut,{invertColors:!0,slim:!0,width:s?Tc:"100%",...l}),s&&t(Ut,{invertColors:!0,slim:!0,width:Tc,...s})]}):null},Ic=p(null),Ec=g.div`
249
+ `,zc=({serviceName:n,isVirtual:o,nodeAttributes:i})=>{const l=ln(e=>e.drawerEntityId),{items:r}=bl().sourcesApi.useSources(),s=a(()=>r.find(e=>e.id.name===n||e.serviceName===n),[r,n]),c=a(()=>s&&JSON.stringify(rn(s))!==JSON.stringify(rn(l)),[s,l]),d=a(()=>{if(o){const e=Object.fromEntries((i??[]).map(({key:e,value:t})=>[e,t]));return[sn({serviceName:n,attributes:e})]}if(n?.toLowerCase()===ar)return[Hi];const e=s?cn(s):void 0;return e?.length?e:[Ui]},[o,i,n,s]),u=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=ln.getState();e(xt.Source),t({namespace:s?.id.namespace??"",name:s?.id.name??"",kind:s?.id.kind??""})}:void 0;return e(_c,{onClick:u,$withClick:!!u,children:[e(ue,{$gap:8,children:[t(dn,{icons:d}),t(se,{size:de.XXS,children:n})]}),o&&t(We,{status:Pe.Info,label:qe.VIRTUAL,textSize:de.XXXS,invertColors:!0,tooltip:qe.VIRTUAL_TOOLTIP})]})},Bc=e=>{if("string"==typeof e)return e;if(e&&"object"==typeof e){const t=e;if("string"==typeof t.k8sActualManifest)return t.k8sActualManifest;if("string"==typeof t.manifest)return t.manifest}},Xc=({source:n})=>{const i=f(),{k8sManifestApi:l}=bl(),[s,c]=r(!0),[d,u]=r(void 0),[p,h]=r(!0),[m,g]=r(void 0);o(()=>{l.fetch({namespace:n.id.namespace,kind:n.id.kind,name:n.id.name}).then(({data:e})=>u(Bc(e))).finally(()=>c(!1)),l.fetch({namespace:n.id.namespace,kind:un.InstrumentationConfig,name:`${n.id.kind}-${n.id.name}`.toLowerCase()}).then(({data:e})=>g(Bc(e))).finally(()=>h(!1))},[l,n.id.namespace,n.id.kind,n.id.name]);const b=a(()=>[{label:qe.DESCRIBE_POD,value:`kubectl describe ${n.id.kind} ${n.id.name} -n ${n.id.namespace}`},{label:qe.GET_POD_YAML,value:`kubectl get ${n.id.kind} ${n.id.name} -n ${n.id.namespace} -o yaml`},{label:qe.GET_POD_YAML,value:`kubectl get ${un.InstrumentationConfig} ${n.id.kind}-${n.id.name} -n ${n.id.namespace} -o yaml`}],[n.id.kind,n.id.name,n.id.namespace]);return e(Pt,{bgTint:"1000",children:[t(Pt,{bgTint:"900",richTitle:{icon:Wi,title:qe.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:b.map(({label:e,value:n},o)=>t(tn,{label:e,value:n},`debug-cmd-${o}-${e}`))}),s?t(pt,{size:1}):t(Pl,{bgTint:"800",codeBgColor:i.v2.colors.silver[900],title:`${n.id.kind} YAML`,yaml:d}),p?t(pt,{size:1}):t(Pl,{bgTint:"800",codeBgColor:i.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:m})]})},Vc=({title:n,children:o})=>e(q,{$gap:8,children:[t(se,{size:de.XXXS,color:ce.Secondary,children:n}),o]}),Uc=({source:n})=>{const o=a(()=>{const[e,t]=pn(n.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[n]);return t(Vc,{title:qe.THROUGHPUT_LAST_10_SECONDS,children:e(ue,{$alignItems:"flex-end",$gap:4,children:[t(se,{size:de.L,children:o.value}),t(se,{size:de.XS,variant:$t.Span,children:o.units})]})})},jc=({source:n})=>{const{CopyButton:o}=hn();return t(Vc,{title:qe.NAMESPACE,children:e(ue,{children:[t(jt,{variant:en.Blue,label:n.id.namespace}),t(o,{value:n.id.namespace,size:bt.XS})]})})},Gc=({source:e})=>t(Vc,{title:qe.KIND,children:t(ue,{children:t(jt,{variant:en.Blue,label:e.id.kind})})}),Hc=({source:n})=>{const{CopyButton:o}=hn();return t(Vc,{title:qe.NAME,children:e(ue,{children:[t(jt,{variant:en.Blue,label:n.id.name}),t(o,{value:n.id.name,size:bt.XS})]})})},Wc=({source:n})=>{const{isVm:o}=v();return t(Pt,{children:e(ue,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[!o&&t(Uc,{source:n}),!o&&t(jc,{source:n}),t(Gc,{source:n}),t(Hc,{source:n})]})})},Kc=({source:e})=>e.pods?.length?t(Pt,{bgTint:"900",children:t(yc,{podsOdigosHealthStatus:e.podsOdigosHealthStatus,pods:e.pods,noPadding:!0})}):null,Yc=({source:e})=>{const n=a(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?mn(e.workloadOdigosHealthStatus.status):Pe.Unknown,title:Xt(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return n?t(Jt,{...n,width:"100%"}):null},Jc="calc(50% - 6px)",qc=({source:n,onClickRollout:o,onClickRollback:i})=>{const l=a(()=>{const{status:e,reasonEnum:t,message:a}=n.conditions?.rollout||{},i=qt(e);if(!i)return null;return{status:i,title:t?.toLowerCase().includes("rollout")?Xt(t):`${qe.ROLLOUT} ${Xt(t)}`,subTitle:a,action:i!==Pe.Success?{icon:Xi,tooltip:qe.ROLLOUT_RESTART,onClick:o}:void 0}},[n]),r=a(()=>{const{status:e,reasonEnum:t,message:o}=n.autoRollback?.autoRollbackStatus||{},a=qt(e);if(!a)return null;return{status:a,title:t?.toLowerCase().includes("rollback")?Xt(t):`${qe.ROLLBACK} ${Xt(t)}`,subTitle:o,action:a!==Pe.Success?{icon:Xi,tooltip:qe.ROLLBACK_RECOVER,onClick:i}:void 0}},[n]);return l||r?e(ue,{$gap:12,$alignItems:"stretch",children:[l&&t(Jt,{invertColors:!0,slim:!0,width:r?Jc:"100%",...l}),r&&t(Jt,{invertColors:!0,slim:!0,width:Jc,...r})]}):null},Zc=p(null),Qc=g.div`
250
250
  position: relative;
251
- `,Ac=({children:e})=>{const n=i(null);return t(Ec,{ref:n,children:t(Ic.Provider,{value:n,children:e})})},Nc=g.div`
251
+ `,ed=({children:e})=>{const n=i(null);return t(Qc,{ref:n,children:t(Zc.Provider,{value:n,children:e})})},td=g.div`
252
252
  position: fixed;
253
253
  top: ${({$coords:e})=>e.top}px;
254
254
  right: ${({$coords:e})=>e.right}px;
@@ -262,14 +262,14 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
262
262
  padding: 12px 16px;
263
263
  border-radius: 12px;
264
264
  background-color: ${({theme:e})=>e.v2.colors.silver[750]};
265
- `,Oc=g.div`
265
+ `,nd=g.div`
266
266
  display: flex;
267
267
  align-items: flex-end;
268
268
  justify-content: space-between;
269
269
  gap: 8px;
270
- `,Rc=g.div`
270
+ `,od=g.div`
271
271
  flex: 1;
272
- `,Dc=({width:n,onClose:o,onSave:a,saveTooltip:i,onDelete:l,deleteTooltip:r,title:c,subTitle:d,warning:u,children:p,pushButtonsWith:g})=>{const b=f(),v=h(Ic),[y,C]=s(null);return cn(v??{current:null},o),m(()=>{const e=v?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[v]),y?Kl(e(Nc,{$coords:y,$width:n,"data-ignore-outside-click":"true",children:[e(W,{$gap:4,children:[t(ae,{size:le.XXS,children:c}),t(ae,{size:le.XXXS,color:ie.Secondary,children:d})]}),e(Oc,{children:[t(Rc,{children:p}),e(se,{$gap:8,$width:"fit-content",$margin:`0 0 ${g||0} 0`,children:[t(re,{variant:de.Secondary,onClick:l,leftIcon:li,tooltip:r,hideTooltipIcon:!0,iconSize:16,size:ce.S,textColor:b.v2.colors.red[500]}),t(re,{variant:de.Primary,onClick:a,leftIcon:Si,tooltip:i,hideTooltipIcon:!0,iconSize:16,size:ce.S})]})]}),t("div",{children:t($e,{status:Ie.Warning,message:u})})]}),document.body):null},Pc=({language:n,overridden:o,onOverride:i,defaultValues:l})=>{const{tier:r}=y(),{formData:c,handleFormChange:d,resetFormData:u}=At(l),p=a(()=>{if(!n)return[];const e=dn[n].community,t=r===ft.Onprem?dn[n].enterprise:[];return e.concat(t).map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})).sort((e,t)=>e.label.localeCompare(t.label))},[n,r]),[h,m]=s(!1),[g,f]=s(!1),b=()=>{h||(g&&u(),f(e=>!e))};return e(se,{$gap:4,$alignItems:"center",children:[o?t(Be,{status:Ie.Info,invertColors:!0,label:Ge.OVERIDDEN}):null,e(Ac,{children:[t(De,{text:Ge.OVERRIDE_OTEL_DISTRO_NAME,children:t(st,{icon:hi,onClick:b})}),g&&t(Dc,{width:"500px",onClose:b,onSave:async()=>{m(!0),await i(c),m(!1),b()},saveTooltip:Ge.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await i({otelDistroName:null}),m(!1),b()},deleteTooltip:Ge.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:Ge.OVERRIDE_OTEL_DISTRO_NAME,subTitle:Ge.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:Ge.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(lt,{label:Ge.OTEL_DISTRO_NAME,options:p,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},Fc=({overridden:n,onOverride:o,defaultValues:i,originalValues:l})=>{const{addNotification:r}=Ft(),{formData:c,handleFormChange:d,resetFormData:u}=At(i),p=a(()=>un.map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})),[]),[h,m]=s(!1),[g,f]=s(!1),b=()=>{h||(g&&u(),f(e=>!e))};return e(se,{children:[n?t(Be,{status:Ie.Info,invertColors:!0,label:Ge.OVERIDDEN}):null,e(Ac,{children:[t(De,{text:Ge.OVERRIDE_RUNTIME_DETAILS,children:t(st,{icon:hi,onClick:b})}),g&&t(Dc,{width:"500px",onClose:b,onSave:async()=>{!c.version||pn(c.version)?(m(!0),await o(c),m(!1),b()):r({type:Ie.Warning,message:Lt.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:Ge.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await o({language:null,version:""}),m(!1),b()},deleteTooltip:Ge.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:Ge.OVERRIDE_RUNTIME_DETAILS,subTitle:Ge.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:Ge.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(se,{$gap:8,children:[t(lt,{label:Ge.LANGUAGE,options:p,values:c.language?[c.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${l.language||"none"}`}),t(be,{label:Ge.RUNTIME_VERSION,placeholder:Ge.VERSION_PLACEHOLDER,value:c.version,onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${l.version||"none"}`})]})})]})]})},Lc=({source:e})=>{const{isVm:n}=y(),{containers:o,containersRichTitle:i}=a(()=>{const t=e?.conditions?.runtimeDetection;return{containers:e?.containers??[],containersRichTitle:{title:n?Ge.DETECTED_PROCESSES:`${e.id.kind} ${Ge.CONTAINERS}`,tooltip:t?.message||(n?Ge.DETECTED_PROCESSES_DESCRIPTION:Ge.DETECTED_CONTAINERS_DESCRIPTION),badge:Gt(t?.status)===Ie.Loading?{status:Ie.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,n]);return t($t,{bgTint:"1000",richTitle:i,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(W,{$gap:8,children:o.map(n=>n&&t(Bc,{...n,sourceId:e.id},`source-container-${n.containerName}`))})})},_c=g.div`
272
+ `,ad=({width:n,onClose:o,onSave:a,saveTooltip:i,onDelete:l,deleteTooltip:s,title:c,subTitle:d,warning:u,children:p,pushButtonsWith:g})=>{const b=f(),y=h(Zc),[v,C]=r(null);return gn(y??{current:null},o),m(()=>{const e=y?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[y]),v?ir(e(td,{$coords:v,$width:n,"data-ignore-outside-click":"true",children:[e(q,{$gap:4,children:[t(se,{size:de.XXS,children:c}),t(se,{size:de.XXXS,color:ce.Secondary,children:d})]}),e(nd,{children:[t(od,{children:p}),e(ue,{$gap:8,$width:"fit-content",$margin:`0 0 ${g||0} 0`,children:[t(pe,{variant:me.Secondary,onClick:l,leftIcon:bi,tooltip:s,hideTooltipIcon:!0,iconSize:16,size:he.S,textColor:b.v2.colors.red[500]}),t(pe,{variant:me.Primary,onClick:a,leftIcon:Ri,tooltip:i,hideTooltipIcon:!0,iconSize:16,size:he.S})]})]}),t("div",{children:t(De,{status:Pe.Warning,message:u})})]}),document.body):null},id=({language:n,overridden:o,onOverride:i,defaultValues:l})=>{const{tier:s}=v(),{formData:c,handleFormChange:d,resetFormData:u}=Mt(l),p=a(()=>{if(!n)return[];const e=fn[n].community,t=s===kt.Onprem?fn[n].enterprise:[];return e.concat(t).map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})).sort((e,t)=>e.label.localeCompare(t.label))},[n,s]),[h,m]=r(!1),[g,f]=r(!1),b=()=>{h||(g&&u(),f(e=>!e))};return e(ue,{$gap:4,$alignItems:"center",children:[o?t(We,{status:Pe.Info,invertColors:!0,label:qe.OVERIDDEN}):null,e(ed,{children:[t($e,{text:qe.OVERRIDE_OTEL_DISTRO_NAME,children:t(ft,{icon:ki,onClick:b})}),g&&t(ad,{width:"500px",onClose:b,onSave:async()=>{m(!0),await i(c),m(!1),b()},saveTooltip:qe.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await i({otelDistroName:null}),m(!1),b()},deleteTooltip:qe.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:qe.OVERRIDE_OTEL_DISTRO_NAME,subTitle:qe.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:qe.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(gt,{label:qe.OTEL_DISTRO_NAME,options:p,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},ld=({overridden:n,onOverride:o,defaultValues:i,originalValues:l})=>{const{addNotification:s}=Vt(),{formData:c,handleFormChange:d,resetFormData:u}=Mt(i),p=a(()=>bn.map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})),[]),[h,m]=r(!1),[g,f]=r(!1),b=()=>{h||(g&&u(),f(e=>!e))};return e(ue,{children:[n?t(We,{status:Pe.Info,invertColors:!0,label:qe.OVERIDDEN}):null,e(ed,{children:[t($e,{text:qe.OVERRIDE_RUNTIME_DETAILS,children:t(ft,{icon:ki,onClick:b})}),g&&t(ad,{width:"500px",onClose:b,onSave:async()=>{!c.version||yn(c.version)?(m(!0),await o(c),m(!1),b()):s({type:Pe.Warning,message:Ut.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:qe.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await o({language:null,version:""}),m(!1),b()},deleteTooltip:qe.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:qe.OVERRIDE_RUNTIME_DETAILS,subTitle:qe.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:qe.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(ue,{$gap:8,children:[t(gt,{label:qe.LANGUAGE,options:p,values:c.language?[c.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${l.language||"none"}`}),t(Se,{label:qe.RUNTIME_VERSION,placeholder:qe.VERSION_PLACEHOLDER,value:c.version,onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${l.version||"none"}`})]})})]})]})},rd=({source:e})=>{const{isVm:n}=v(),{containers:o,containersRichTitle:i}=a(()=>{const t=e?.conditions?.runtimeDetection;return{containers:e?.containers??[],containersRichTitle:{title:n?qe.DETECTED_PROCESSES:`${e.id.kind} ${qe.CONTAINERS}`,tooltip:t?.message||(n?qe.DETECTED_PROCESSES_DESCRIPTION:qe.DETECTED_CONTAINERS_DESCRIPTION),badge:qt(t?.status)===Pe.Loading?{status:Pe.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,n]);return t(Pt,{bgTint:"1000",richTitle:i,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(q,{$gap:8,children:o.map(n=>n&&t(ud,{...n,sourceId:e.id},`source-container-${n.containerName}`))})})},sd=g.div`
273
273
  display: flex;
274
274
  flex-direction: column;
275
275
  align-self: stretch;
@@ -277,26 +277,26 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
277
277
  padding: 8px 12px;
278
278
  border-radius: 8px;
279
279
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
280
- `,Mc=g.div`
280
+ `,cd=g.div`
281
281
  display: flex;
282
282
  align-items: center;
283
283
  justify-content: center;
284
284
  padding: 8px;
285
285
  border-radius: 10px;
286
286
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
287
- `,zc=g.div`
287
+ `,dd=g.div`
288
288
  display: flex;
289
289
  flex-direction: column;
290
290
  gap: 12px;
291
291
  padding: 8px 12px;
292
292
  border-radius: 8px;
293
293
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
294
- `,Bc=({sourceId:n,...o})=>{const{containerName:i,runtimeInfo:l,agentEnabled:s,overrides:r}=o,c=f(),{sourcesApi:d}=ll(),u=a(()=>!!r?.runtimeInfo?.language||!!r?.runtimeInfo?.runtimeVersion,[r]),p=a(()=>({language:jt(o),version:hn(o)||void 0}),[o]),h=a(()=>!!r?.otelDistroName,[r]),m=a(()=>({otelDistroName:r?.otelDistroName||o.agentEnabled?.otelDistroName}),[r,o]),g=a(()=>!l&&!u,[l,u]),b=a(()=>g?Ri:Ve(p.language),[g,p]),v=a(()=>{if(g)return"";const{language:e,version:t}=p;return`${e}${t?` • ${t}`:""}`},[g,p]),y=a(()=>g?{status:Ie.Loading,label:Ge.WAITING_FOR_RUNTIME_DETECTION}:{status:s?.otelDistroName?Ie.Success:Ie.Disabled,leftIcon:s?.otelDistroName?ci:di,label:s?.otelDistroName?`Instrumented | ${s.otelDistroName}`:"Uninstrumented",tooltip:s?.agentEnabledStatus?.message},[g,s]),C=e=>d.update(n,{containerName:i,...h?m:{},...u?p:{},...e}),S=a(()=>{const e=[];return o.agentConfig?.traces?.headSampling?.noisyOperations?.length&&e.push(Ge.HEAD_SAMPLING),(o.collectorConfig?.tailSampling?.noisyOperations?.length||o.collectorConfig?.tailSampling?.highlyRelevantOperations?.length||o.collectorConfig?.tailSampling?.costReductionRules?.length)&&e.push(Ge.TAIL_SAMPLING),e},[o]);return e(_c,{children:[e(se,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(se,{$gap:8,$alignItems:"center",children:[t(Mc,{children:t(b,{size:24,fill:l?void 0:c.v2.colors.grey[400]})}),t(ae,{children:i}),t(_t,v?{variant:Wt.Blue,label:v}:{variant:Wt.Loader,label:Ge.DETECTING_RUNTIME_INFO}),t(Fc,{overridden:u,onOverride:C,defaultValues:p,originalValues:{language:o.runtimeInfo?.language,version:o.runtimeInfo?.runtimeVersion||""}})]}),e(se,{$gap:8,$alignItems:"center",children:[t(Be,{...y,textSize:le.XXXS}),t(Pc,{language:p.language,overridden:h,onOverride:C,defaultValues:m})]})]}),!s||s.agentEnabled||g?null:t(zc,{children:e(se,{$gap:10,$alignItems:"center",children:[t(_t,{variant:Wt.Pink,label:Pt(s.agentEnabledStatus?.reasonEnum)||Ge.NO_AVAILABLE_AGENT}),t(ae,{size:le.XXXS,color:ie.Secondary,children:s?.agentEnabledStatus?.message})]})}),S.length>0&&t(zc,{children:t(se,{$gap:16,$wrap:"wrap",children:S.map((e,n)=>t(Be,{label:e,leftIcon:ci,status:Ie.Success,invertColors:!0,useSecondaryTone:!0},`${i}-rule-${n}`))})})]})},Xc=({source:n,onClickRollout:o,onClickRollback:a})=>{const{isVm:i}=y();return e(W,{$gap:12,children:[t(wc,{source:n}),t(kc,{source:n}),!i&&t($c,{source:n,onClickRollout:o,onClickRollback:a}),!i&&t(Lc,{source:n}),!i&&t(xc,{source:n})]})},Vc=g(W)`
294
+ `,ud=({sourceId:n,...o})=>{const{containerName:i,runtimeInfo:l,agentEnabled:r,overrides:s}=o,c=f(),{sourcesApi:d}=bl(),u=a(()=>!!s?.runtimeInfo?.language||!!s?.runtimeInfo?.runtimeVersion,[s]),p=a(()=>({language:Qt(o),version:vn(o)||void 0}),[o]),h=a(()=>!!s?.otelDistroName,[s]),m=a(()=>({otelDistroName:s?.otelDistroName||o.agentEnabled?.otelDistroName}),[s,o]),g=a(()=>!l&&!u,[l,u]),b=a(()=>g?Ui:Ye(p.language),[g,p]),y=a(()=>{if(g)return"";const{language:e,version:t}=p;return`${e}${t?` • ${t}`:""}`},[g,p]),v=a(()=>g?{status:Pe.Loading,label:qe.WAITING_FOR_RUNTIME_DETECTION}:{status:r?.otelDistroName?Pe.Success:Pe.Disabled,leftIcon:r?.otelDistroName?Ci:Si,label:r?.otelDistroName?`Instrumented | ${r.otelDistroName}`:"Uninstrumented",tooltip:r?.agentEnabledStatus?.message},[g,r]),C=e=>d.update(n,{containerName:i,...h?m:{},...u?p:{},...e}),S=a(()=>{const e=[];return o.agentConfig?.traces?.headSampling?.noisyOperations?.length&&e.push(qe.HEAD_SAMPLING),(o.collectorConfig?.tailSampling?.noisyOperations?.length||o.collectorConfig?.tailSampling?.highlyRelevantOperations?.length||o.collectorConfig?.tailSampling?.costReductionRules?.length)&&e.push(qe.TAIL_SAMPLING),e},[o]);return e(sd,{children:[e(ue,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(ue,{$gap:8,$alignItems:"center",children:[t(cd,{children:t(b,{size:24,fill:l?void 0:c.v2.colors.grey[400]})}),t(se,{children:i}),t(jt,y?{variant:en.Blue,label:y}:{variant:en.Loader,label:qe.DETECTING_RUNTIME_INFO}),t(ld,{overridden:u,onOverride:C,defaultValues:p,originalValues:{language:o.runtimeInfo?.language,version:o.runtimeInfo?.runtimeVersion||""}})]}),e(ue,{$gap:8,$alignItems:"center",children:[t(We,{...v,textSize:de.XXXS}),t(id,{language:p.language,overridden:h,onOverride:C,defaultValues:m})]})]}),!r||r.agentEnabled||g?null:t(dd,{children:e(ue,{$gap:10,$alignItems:"center",children:[t(jt,{variant:en.Pink,label:Xt(r.agentEnabledStatus?.reasonEnum)||qe.NO_AVAILABLE_AGENT}),t(se,{size:de.XXXS,color:ce.Secondary,children:r?.agentEnabledStatus?.message})]})}),S.length>0&&t(dd,{children:t(ue,{$gap:16,$wrap:"wrap",children:S.map((e,n)=>t(We,{label:e,leftIcon:Ci,status:Pe.Success,invertColors:!0,useSecondaryTone:!0},`${i}-rule-${n}`))})})]})},pd=({source:n,onClickRollout:o,onClickRollback:a})=>{const{isVm:i}=v();return e(q,{$gap:12,children:[t(Wc,{source:n}),t(Yc,{source:n}),!i&&t(qc,{source:n,onClickRollout:o,onClickRollback:a}),!i&&t(rd,{source:n}),!i&&t(Kc,{source:n})]})},hd=g(q)`
295
295
  width: 100%;
296
296
  max-height: 320px;
297
297
  overflow-y: auto;
298
298
  gap: 8px;
299
- `,Uc=g(se)`
299
+ `,md=g(ue)`
300
300
  width: 100%;
301
301
  align-items: center;
302
302
  gap: 8px;
@@ -306,14 +306,14 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
306
306
  & > * {
307
307
  font-family: monospace !important;
308
308
  }
309
- `,Gc=({pendingModify:n,onClose:o,onConfirm:a})=>{const i=f();return t(Ue,{isOpen:!!n,title:'Modify the "Profiling Symbols" rule',description:'These changes are applied immediately to a single custom instrumentation rule named "Profiling Symbols".\nSelected symbols are added to it; unchecked symbols are removed from it (the rule is deleted once empty). Symbols managed by other rules are never touched.',onClose:o,denyButton:{variant:de.Secondary,label:"Cancel",onClick:o},approveButton:{variant:de.Primary,label:"Confirm",onClick:a},children:n&&e(Vc,{children:[n.add.map(n=>e(Uc,{children:[t(Be,{leftIcon:si,status:Ie.Success,useSecondaryTone:!0,textColor:i.v2.colors.white[500],textSize:le.XXS}),t(ae,{size:le.XS,color:ie.Primary,children:n})]},`add-${n}`)),n.remove.map(n=>e(Uc,{children:[t(Be,{leftIcon:_i,status:Ie.Error,useSecondaryTone:!0,textColor:i.v2.colors.white[500],textSize:le.XXS}),t(ae,{size:le.XS,color:ie.Primary,children:n})]},`remove-${n}`))]})})};function Hc(e,t){const n=e.names[t];if(null==n)return"";if("string"==typeof n)return n;if("object"==typeof n&&"name"in n){const e=n.name;if("string"==typeof e)return e}return"number"==typeof n||"boolean"==typeof n?String(n):""}function jc(e){const t=Math.abs(e);return t>=1e9?`${Wc(e/1e9)}s`:t>=1e6?`${Wc(e/1e6)}ms`:t>=1e3?`${Wc(e/1e3)}μs`:String(Math.round(e))}function Wc(e){return e.toFixed(2).replace(/\.?0+$/,"")}function Kc(e){const t=[];for(let n=0;n<e.levels.length;n++){const o=e.levels[n];let a=0;for(let e=0;e+3<o.length;e+=4){const i=o[e],l=o[e+1],s=o[e+2],r=o[e+3],c=a+i;t.push({level:n,offset:c,size:l,self:s,nameIndex:r}),a=c+l}}return t}function Yc(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function Jc(e,t){const n=e.reduce((e,t)=>Math.max(e,t.level),t.level),o=new Map;for(const t of e){const e=o.get(t.level);e?e.push(t):o.set(t.level,[t])}const a=[t];for(let e=t.level+1;e<=n;e++){const t=a.filter(t=>t.level===e-1);if(0===t.length)break;const n=o.get(e);if(n?.length)for(const e of n)for(const n of t)if(e.offset>=n.offset&&e.offset+e.size<=n.offset+n.size){a.push(e);break}}return a}function qc(e,t){const n=t.trim().toLowerCase();return!n||e.toLowerCase().includes(n)}function Zc(e,t,n,o,a,i={}){if(0===e.levels.length||t<2||n<2)return null;const{zoomRoot:l=null,shouldKeepName:s,collapseRecursive:r=!1,allRects:c}=i,d=c??Kc(e);let u=l?Jc(d,l):d;if(0===u.length)return null;if(s&&(u=u.filter(t=>s(Hc(e,t.nameIndex))),0===u.length))return null;if(r&&(u=function(e,t){if(0===t.length)return t;const n=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),o=new Map;for(const e of n){const t=o.get(e.level);t?t.push(e):o.set(e.level,[e])}const a=new Set;for(const t of n){const n=o.get(t.level+1);if(!n)continue;const i=n.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==i.length)continue;const l=i[0];l.size===t.size&&Hc(e,l.nameIndex)===Hc(e,t.nameIndex)&&a.add(Yc(l))}if(0===a.size)return n;const i=[];for(const e of n){if(a.has(Yc(e)))continue;let t=0;for(let n=0;n<e.level;n++){const i=o.get(n);if(!i)continue;const l=i.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&a.has(Yc(l))&&t++}i.push({...e,level:e.level-t})}return i}(e,u),0===u.length))return null;const p=l?.level??0,h=l?.offset??0,m=l?.size??e.numTicks;if(m<=0)return null;const g=u.reduce((e,t)=>Math.max(e,t.level-p),0)+1,f=o??Number.POSITIVE_INFINITY,b=Math.max(1,Math.min(n/g,f)),v=a.trim(),y=b>8?1:0;return u.map(n=>{const o=n.level-p,a=(n.offset-h)/m*t,i=Math.max(n.size/m*t,1),l=o*b,s=Math.max(b-y,1),r=Hc(e,n.nameIndex);return{...n,x:a,y:l,w:i,h:s,name:r,matchesSearch:qc(r,v)}})}function Qc(e,t){let n=0;for(let t=0;t<e.length;t++)n=31*n+e.charCodeAt(t)>>>0;const o=t.v2.colors.black[500],a=[{fill:t.v2.colors.purple[300],text:o},{fill:t.v2.colors.green[300],text:o},{fill:t.v2.colors.red[300],text:o},{fill:t.v2.colors.blue[300],text:o},{fill:t.v2.colors.yellow[300],text:o}];return a[n%a.length]}var ed,td;!function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(ed||(ed={})),function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(td||(td={}));function nd(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function od(e,t,n){for(const o of n)if(e>=o.x&&e<o.x+o.w&&t>=o.y&&t<o.y+o.h)return o;return null}function ad(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}const id=({flamebearer:n,maxRowPx:r,searchQuery:c="",shouldKeepName:d,minHostHeight:u=200,onFullscreenChange:p,profilingSlots:h,onFrameClick:g,onZoomedSymbolsChange:b,onResetZoom:v})=>{const y=f(),C=i(null),S=i(null),w=i({x:0,y:0}),x=i(n.numTicks),[k,T]=s({w:0,h:0}),[$,I]=s(""),[E,A]=s(null),[N,O]=s([]),[R,D]=s(!1),[P,F]=s(ed.Fit),[L,_]=s(td.Fit),[M,z]=s(!1),B=Math.max(1,Math.min(Math.floor(k.w*P),8192)),X=Math.max(1,Math.min(Math.floor(k.h*L),8192)),V=N.length>0?N[N.length-1]:null,U=V?.size??n.numTicks,G=a(()=>Kc(n),[n]);o(()=>{x.current!==n.numTicks&&(x.current=n.numTicks,O([]))},[n.numTicks]),o(()=>{if(!b)return;if(!V)return void b(null);const e=Jc(G,V),t=new Set;for(const o of e){const e=Hc(n,o.nameIndex);e&&t.add(e)}b([...t])},[V,n,G,b]),m(()=>{const e=C.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();T({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),o(()=>{if(!R)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[R]),o(()=>(p?.(R),()=>{R&&p?.(!1)}),[R,p]);const H=a(()=>Zc(n,B,X,r,c,{zoomRoot:V,shouldKeepName:d,collapseRecursive:M,allRects:G}),[n,r,c,X,B,V,d,M,G]),j=a(()=>function(e){return[...e].sort((e,t)=>t.level-e.level)}(H?.length?c.trim()?H.filter(e=>e.matchesSearch):H:[]),[H,c]),W=l(e=>{if(B<2||X<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const o=od((e.clientX-t.left)/t.width*B,(e.clientY-t.top)/t.height*X,j);if(o){const e=Yc(o);A(e);const t=U>0?(100*o.size/U).toFixed(1):"0",a=n.numTicks>0?(100*o.size/n.numTicks).toFixed(1):"0";I(`${o.name}\ntotal ${jc(o.size)} (${t}% of view, ${a}% of profile) · self ${jc(o.self)}`)}else A(null),I("")},[j,n.numTicks,X,B,U]),K=l(e=>{W(e)},[W]),Y=l(()=>{A(null),I("")},[]),J=l(e=>{w.current={x:e.clientX,y:e.clientY}},[]),q=l(e=>{const{x:t,y:n}=w.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-n)>3)return;if(B<2||X<2)return;const o=e.currentTarget.getBoundingClientRect();if(o.width<1||o.height<1)return;const a=od((e.clientX-o.left)/o.width*B,(e.clientY-o.top)/o.height*X,j);if(!a)return;g?.(a.name);const i=function(e){return{level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}}(a);O(e=>{const t=e.length>0?e[e.length-1]:null;return t&&function(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}(i,t)?e.slice(0,-1):[...e,i]})},[j,X,B,g]);m(()=>{const e=S.current;if(!e||B<2||X<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,o=Math.max(B,X),a=Math.min(t,16384/o);e.width=Math.floor(B*a),e.height=Math.floor(X*a),e.style.width=`${B}px`,e.style.height=`${X}px`;const i=e.getContext("2d");i&&(i.setTransform(a,0,0,a,0,0),i.clearRect(0,0,B,X),H?.length?function(e,t,n,o,a,i,l,s){const r=i.v2.colors.silver[900];e.fillStyle=r,e.fillRect(0,0,t,n);const c=a.trim().length>0;e.textRendering="optimizeLegibility";for(const t of o){const{x:n,y:o,w:a,h:l,name:r,size:d,matchesSearch:u}=t;if(c&&!u)continue;const{fill:p,text:h}=Qc(r,i);e.fillStyle=p,e.fillRect(n,o,a,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(n+.5,o+.5),e.lineTo(n+a-.5,o+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(n+.5,o+.5,Math.max(a-1,0),Math.max(l-1,0));const m=nd(d,s),g=`${r} (${jc(d)}, ${m}%)`,f=i.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(a>=y&&C>=b){e.font=`${C}px ${i.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=g;for(;t.length>2&&e.measureText(t).width>a-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=a-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,n+v,o+l/2),e.fillStyle=h,e.fillText(t,n+v,o+l/2))}}if(l)for(const t of o){if(Yc(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:n,y:o,w:a,h:i}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(n+1,o+1,Math.max(a-2,0),Math.max(i-2,0));break}}(i,B,X,H,c,y,E,n.numTicks):(i.fillStyle=y.v2.colors.silver[900],i.fillRect(0,0,B,X)))},[H,n.numTicks,E,c,X,B,y]);const Z=l(()=>D(e=>!e),[]),te=n.numTicks>0?Math.max(0,Math.min(100,Math.round(U/n.numTicks*100))):100,ne=a(()=>function(e,t,n){const o=n??Kc(e),a=t?.offset??0,i=a+(t?.size??e.numTicks),l=(t?.level??-1)+1,s=t?.size??e.numTicks;let r=null;for(const e of o)e.level<l||e.offset<a||e.offset+e.size>i||e.size>=s||(!r||e.size>r.size||e.size===r.size&&e.level<r.level)&&(r=e);return r}(n,V,G),[n,V,G]),oe=null!==ne,pe=N.length>0,he=V?Hc(n,V.nameIndex):"",me=l(()=>{O([]),v?.()},[v]),ge=l(()=>O(e=>e.slice(0,-1)),[]),fe=l(()=>{ne&&O(e=>[...e,ne])},[ne]);return e("div",{style:R?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:y.v2.colors.silver[900]}:{flex:1,minHeight:u,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(se,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(Q,{label:"Collapse recursive",tooltip:"Collapse straight-line recursion (parent → single same-name child of equal width) into a single bar. Helps deep recursive call chains fit on screen.",labelAlign:ee.Left,size:bt.S,value:M,onChange:z}),e(se,{$gap:8,children:[e(se,{children:[t(re,{variant:de.Secondary,size:ce.S,label:"Reset zoom",leftIcon:Mi,onClick:me,disabled:!N.length}),t(re,{variant:de.Secondary,size:ce.S,iconSize:20,leftIcon:_i,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!pe,onClick:ge}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(ae,{size:le.XXS,color:ie.Secondary,nowrap:!0,align:"center",children:`${te}%`})}),t(re,{variant:de.Secondary,size:ce.S,iconSize:20,leftIcon:si,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!oe,onClick:fe})]}),e(se,{children:[t(De,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ue,{variant:mn.Filled,options:[{value:ed.Fit,label:"W: Fit"},{value:ed.X10,label:"10x"}],selected:P,setSelected:F})}),t(De,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ue,{variant:mn.Filled,options:[{value:td.Fit,label:"H: Fit"},{value:td.X10,label:"10x"}],selected:L,setSelected:_})})]}),t(re,{variant:de.Secondary,size:ce.S,iconSize:24,leftIcon:R?wi:zi,tooltip:R?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:Z})]})]}),t(De,{fullWidth:!0,keepAlive:!0,text:$,children:t("div",{ref:C,style:{flex:1,minWidth:0,width:"100%",height:R?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflow:"hidden"},children:t("div",{style:{position:"absolute",inset:0,overflowX:P>1?"auto":"hidden",overflowY:L>1?"auto":"hidden"},children:t("div",{style:{width:B||"100%",height:X||"100%",position:"relative"},children:t("canvas",{ref:S,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:E?"pointer":"default"},onPointerDown:J,onPointerMove:K,onPointerLeave:Y,onClick:q})})})})}),e(se,{$justifyContent:"space-between",children:[t(ae,V?{size:le.XXXS,color:y.v2.colors.silver[300],children:`Zoomed: ${he} • ${jc(U)} samples in view`}:{size:le.XXXS,color:y.v2.colors.silver[300],children:g?"Click a frame to zoom in and jump to its row in the symbol table.":"Click a frame to zoom into its subtree (pprof-style)."}),h&&t(ae,{size:le.XXXS,color:y.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${ad(h.totalBytesUsed)} / ${ad(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})},ld=[gn.Go,gn.Java],sd="Profiling Symbols";function rd(e,t){if(0===t.length)return null;const n=1===t.length?t[0]:function(e){return e.includes("/")||/\.\(\*?[^)]+\)\./.test(e)?gn.Go:e.includes(" ")||e.includes("(")?gn.Java:gn.Go}(e);if(n===gn.Go){const t=function(e){let t=e.trim();if(!t)return null;t=t.replace(/\[[^\]]*\]/g,"");const n=t.lastIndexOf("/"),o=t.indexOf(".",n+1);if(-1===o)return null;const a=t.slice(0,o),i=t.slice(o+1);if(!a||!i)return null;const l=i.match(/^\(\*?([^)]+)\)\.(.+)$/);if(l){const e=new Le(a,"",l[1],l[2]);return e.Verify()?e:null}const s=new Le(a,i);return s.Verify()?s:null}(e);return t?{language:n,golang:t}:null}if(n===gn.Java){const t=function(e){let t=e.trim();if(!t)return null;const n=t.indexOf("(");-1!==n&&(t=t.slice(0,n).trim());const o=t.split(/\s+/);t=o[o.length-1]??"";const a=t.lastIndexOf(".");if(-1===a)return null;const i=t.slice(0,a),l=t.slice(a+1),s=new _e(i,l);return s.Verify()?s:null}(e);return t?{language:n,java:t}:null}return null}function cd(e,t){return e.namespace===t.namespace&&e.name===t.name&&e.kind===t.kind}function dd(e,t,n){if(!e)return!0;const{sources:o=[],namespaces:a=[],languages:i=[]}=e,l=!o.length||o.some(e=>cd(e,t.id)),s=!a.length||a.includes(t.id.namespace),r=!i.length||null==n||i.includes(n);return l&&s&&r}function ud(e,t){return e.packageName===t.packageName&&(e.functionName||"")===(t.functionName||"")&&(e.receiverName||"")===(t.receiverName||"")&&(e.receiverMethodName||"")===(t.receiverMethodName||"")}function pd(e,t){return e.className===t.className&&e.methodName===t.methodName}function hd(e,t,n,o){const a=rd(e,n);if(!a)return[];const i=[];for(const e of o){const n=e.customInstrumentations;if(!n)continue;if(!dd(e.sourceScopes,t,a.language))continue;const o=!!a.golang&&!!n[Me.Golang]?.some(e=>ud(e,a.golang)),l=!!a.java&&!!n[Me.Java]?.some(e=>pd(e,a.java));(o||l)&&i.push({rule:e,resolved:a})}return i}function md({source:e,languages:t,rows:n}){const{instrumentationRulesApi:o,capabilities:i}=ll(),{items:r}=o.useRules(),[c,d]=s(new Set),[u,p]=s(new Set),[h,m]=s(null),g=a(()=>function(e){const t=new Set(e??[]);return ld.filter(e=>t.has(e))}(t),[t]),f=i.canCreateInstrumentationRule,b=a(()=>function(e,t){const n=e.filter(e=>e.type===ze.CustomInstrumentation&&e.ruleName===sd&&dd(e.sourceScopes,t));return n.find(e=>e.sourceScopes?.sources?.some(e=>cd(e,t.id)))??n[0]??null}(r,e),[r,e]),v=f&&g.length>0,y=a(()=>{const t=new Map;for(const o of n){const n=!!rd(o.name,g),a=hd(o.name,e,g,r),i=!!b&&a.some(e=>e.rule.ruleId===b.ruleId),l=a.filter(e=>e.rule.ruleId!==b?.ruleId),s=!i&&l.length>0,c=v&&n,d=s;let u;if(s){const e=[...new Set(l.map(e=>e.rule.ruleName))];u=`Managed by ${e.length>1?"rules":"rule"} ${e.map(e=>`“${e}”`).join(", ")}. Edit ${e.length>1?"those rules":"that rule"} to change this symbol.`}let p=!1,h="Add this symbol to the “Profiling Symbols” rule";s?h=u??"Managed by another rule":0===a.length&&(0===g.length?h="Custom instrumentation is only available for Go and Java sources":f?n?p=!0:h="This symbol could not be parsed into a probe automatically":h="You don’t have permission to add custom instrumentation"),t.set(o.name,{parsable:n,inManagedRule:i,otherRules:l,showCheckbox:c,checkboxDisabled:d,checkboxTooltip:u,addEnabled:p,addTooltip:h})}return t},[n,r,e,g,f,v,b]),C=a(()=>{const e=new Set;return y.forEach((t,n)=>{t.inManagedRule&&e.add(n)}),e},[y]),S=a(()=>[...c].filter(e=>y.get(e)?.addEnabled&&!C.has(e)),[c,y,C]),w=a(()=>[...u].filter(e=>C.has(e)),[u,C]),x=S.length+w.length,k=l(e=>{const t=y.get(e);return t?.inManagedRule?!u.has(e):!!(t&&t.otherRules.length>0)||c.has(e)},[y,u,c]),T=l((e,t)=>{const n=y.get(e);n&&!n.checkboxDisabled&&(n.inManagedRule?p(n=>{const o=new Set(n);return t?o.delete(e):o.add(e),o}):d(n=>{const o=new Set(n);return t?o.add(e):o.delete(e),o}))},[y]),$=l(()=>{d(new Set),p(new Set)},[]),I=l(t=>{(async()=>{const n=t.add.map(e=>rd(e,g)).filter(e=>!!e),a=t.remove.map(e=>rd(e,g)).filter(e=>!!e);if(b){const{customInstrumentations:e,isEmpty:t}=function(e,t,n){const o=e.customInstrumentations??{};let a=[...o[Me.Golang]??[]],i=[...o[Me.Java]??[]];for(const e of n)e.golang&&(a=a.filter(t=>!ud(t,e.golang))),e.java&&(i=i.filter(t=>!pd(t,e.java)));for(const e of t)e.golang&&!a.some(t=>ud(t,e.golang))&&a.push(e.golang),e.java&&!i.some(t=>pd(t,e.java))&&i.push(e.java);return{customInstrumentations:{[Me.Golang]:a,[Me.Java]:i},isEmpty:0===a.length&&0===i.length}}(b,n,a);t?await o.remove(b.ruleId,ze.CustomInstrumentation):await o.update(b.ruleId,function(e,t){return{ruleName:e.ruleName,notes:e.notes,disabled:e.disabled,sourceScopes:e.sourceScopes??null,workloads:null,instrumentationLibraries:e.instrumentationLibraries??null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:t}}(b,e),ze.CustomInstrumentation)}else n.length>0&&await o.create(function(e,t){const n=e.map(e=>e.golang).filter(e=>!!e),o=e.map(e=>e.java).filter(e=>!!e),a={sources:[{namespace:t.id.namespace,name:t.id.name,kind:t.id.kind}],namespaces:[],languages:[]};return{ruleName:sd,notes:"Symbols selected from the profiling tab.",disabled:!1,sourceScopes:a,workloads:null,instrumentationLibraries:null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:{[Me.Golang]:n,[Me.Java]:o}}}(n,e),ze.CustomInstrumentation)})()},[b,g,e,o]),E=l(()=>{x&&m({add:S,remove:w})},[x,S,w]),A=l(e=>m({add:[e],remove:[]}),[]),N=l(e=>m({add:[],remove:[e]}),[]),O=l(()=>m(null),[]),R=l(()=>{h&&(I(h),m(null),$())},[h,I,$]),D=l(e=>y.get(e)??{parsable:!1,inManagedRule:!1,otherRules:[],showCheckbox:!1,checkboxDisabled:!1,addEnabled:!1,addTooltip:"Custom instrumentation is only available for Go and Java sources"},[y]);return{instrumentation:a(()=>({getSymbolState:D,onAdd:A,onRemove:N,selectionEnabled:v,isSelected:k,onToggleSymbol:T}),[D,A,N,v,k,T]),pendingCount:x,pendingModify:h,closeModify:O,openBulkModify:E,resetSelection:$,confirmModify:R}}var gd,fd,bd;!function(e){e.Symbol="symbol",e.Self="self",e.Total="total"}(gd||(gd={})),function(e){e.OnlyInstrumentable="only-instrumentable"}(fd||(fd={})),function(e){e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"}(bd||(bd={}));const vd=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function yd(e,t){const n=function(e){return e.split(" ")[0]??""}(e);if(t.includes(bd.FilterOutVoid)&&"void"===n)return!1;if(t.includes(bd.OnlyWithReturnValues)){if(!(e.includes(" ")&&"void"!==n&&vd.test(n)))return!1}return!0}const Cd=({rows:e,languages:n,instrumentation:o,searchQuery:i,filters:s,onFiltersChange:r,zoomedSymbols:c,highlightSymbol:d,scrollSignal:u})=>{const p=!!n?.includes(gn.Java),h=a(()=>{const t=c?new Set(c):null,n=i?.trim().toLowerCase();return e.filter(e=>(!t||t.has(e.name))&&(!n||e.name.toLowerCase().includes(n)))},[e,i,c]),m=a(()=>{const e=[];if(o.selectionEnabled&&e.push({id:fd.OnlyInstrumentable,label:"Only show instrumentable symbols"}),p&&(e.push({id:bd.FilterOutVoid,label:"Filter out void symbols"}),e.push({id:bd.OnlyWithReturnValues,label:"Only show functions with return values"})),0!==e.length)return{options:e,filterRow:(e,t)=>{const n=e.cells.find(e=>e.key===gd.Symbol)?.rawValue?.toString()??"";return!(t.includes(fd.OnlyInstrumentable)&&!o.getSymbolState(n).showCheckbox)&&yd(n,t)}}},[o,p]),g=a(()=>[{key:gd.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:m,noFilter:!m},{key:gd.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:gd.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[m]),f=a(()=>h.map(e=>{const t=o.getSymbolState(e.name),n=t.showCheckbox;return{id:e.name,cells:[{key:gd.Symbol,rawValue:e.name},{key:gd.Self,rawValue:jc(e.self)},{key:gd.Total,rawValue:jc(e.total)}],isSelected:n?o.isSelected(e.name):void 0,onSelect:n?()=>o.onToggleSymbol(e.name,!0):void 0,onDeselect:n?()=>o.onToggleSymbol(e.name,!1):void 0,hideCheckbox:!n,checkboxDisabled:n?t.checkboxDisabled:void 0,checkboxTooltip:n?t.checkboxTooltip:void 0}}),[h,o]),b=l(e=>{const t=e.cells[0].rawValue,n=o.getSymbolState(t),a=[];return n.inManagedRule?a.push({id:`remove-instrumentation-${t}`,label:"",leftIcon:li,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>o.onRemove(t)}):a.push({id:`add-instrumentation-${t}`,label:"",leftIcon:si,tooltip:n.addTooltip,disabled:!n.addEnabled,onClick:()=>o.onAdd(t)}),a.push({id:`copy-${t}`,label:"",leftIcon:Bi,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),a},[o]);return t(fn,{variant:bn.Data,maxHeight:"calc(100vh - 306px)",columns:g,rows:f,withCheckboxes:o.selectionEnabled,filters:s,onFiltersChange:r,activeRowId:d,scrollSignal:u,getRowActions:b})};var Sd;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(Sd||(Sd={}));const wd=g(W)`
309
+ `,gd=({pendingModify:n,onClose:o,onConfirm:a})=>{const i=f();return t(Je,{isOpen:!!n,title:'Modify the "Profiling Symbols" rule',description:'These changes are applied immediately to a single custom instrumentation rule named "Profiling Symbols".\nSelected symbols are added to it; unchecked symbols are removed from it (the rule is deleted once empty). Symbols managed by other rules are never touched.',onClose:o,denyButton:{variant:me.Secondary,label:"Cancel",onClick:o},approveButton:{variant:me.Primary,label:"Confirm",onClick:a},children:n&&e(hd,{children:[n.add.map(n=>e(md,{children:[t(We,{leftIcon:yi,status:Pe.Success,useSecondaryTone:!0,textColor:i.v2.colors.white[500],textSize:de.XXS}),t(se,{size:de.XS,color:ce.Primary,children:n})]},`add-${n}`)),n.remove.map(n=>e(md,{children:[t(We,{leftIcon:Ki,status:Pe.Error,useSecondaryTone:!0,textColor:i.v2.colors.white[500],textSize:de.XXS}),t(se,{size:de.XS,color:ce.Primary,children:n})]},`remove-${n}`))]})})};function fd(e,t){const n=e.names[t];if(null==n)return"";if("string"==typeof n)return n;if("object"==typeof n&&"name"in n){const e=n.name;if("string"==typeof e)return e}return"number"==typeof n||"boolean"==typeof n?String(n):""}function bd(e){const t=Math.abs(e);return t>=1e9?`${yd(e/1e9)}s`:t>=1e6?`${yd(e/1e6)}ms`:t>=1e3?`${yd(e/1e3)}μs`:String(Math.round(e))}function yd(e){return e.toFixed(2).replace(/\.?0+$/,"")}function vd(e){const t=[];for(let n=0;n<e.levels.length;n++){const o=e.levels[n];let a=0;for(let e=0;e+3<o.length;e+=4){const i=o[e],l=o[e+1],r=o[e+2],s=o[e+3],c=a+i;t.push({level:n,offset:c,size:l,self:r,nameIndex:s}),a=c+l}}return t}function Cd(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function Sd(e,t){const n=e.reduce((e,t)=>Math.max(e,t.level),t.level),o=new Map;for(const t of e){const e=o.get(t.level);e?e.push(t):o.set(t.level,[t])}const a=[t];for(let e=t.level+1;e<=n;e++){const t=a.filter(t=>t.level===e-1);if(0===t.length)break;const n=o.get(e);if(n?.length)for(const e of n)for(const n of t)if(e.offset>=n.offset&&e.offset+e.size<=n.offset+n.size){a.push(e);break}}return a}function wd(e,t){const n=t.trim().toLowerCase();return!n||e.toLowerCase().includes(n)}function xd(e,t,n,o,a,i={}){if(0===e.levels.length||t<2||n<2)return null;const{zoomRoot:l=null,shouldKeepName:r,collapseRecursive:s=!1,allRects:c}=i,d=c??vd(e);let u=l?Sd(d,l):d;if(0===u.length)return null;if(r&&(u=u.filter(t=>r(fd(e,t.nameIndex))),0===u.length))return null;if(s&&(u=function(e,t){if(0===t.length)return t;const n=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),o=new Map;for(const e of n){const t=o.get(e.level);t?t.push(e):o.set(e.level,[e])}const a=new Set;for(const t of n){const n=o.get(t.level+1);if(!n)continue;const i=n.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==i.length)continue;const l=i[0];l.size===t.size&&fd(e,l.nameIndex)===fd(e,t.nameIndex)&&a.add(Cd(l))}if(0===a.size)return n;const i=[];for(const e of n){if(a.has(Cd(e)))continue;let t=0;for(let n=0;n<e.level;n++){const i=o.get(n);if(!i)continue;const l=i.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&a.has(Cd(l))&&t++}i.push({...e,level:e.level-t})}return i}(e,u),0===u.length))return null;const p=l?.level??0,h=l?.offset??0,m=l?.size??e.numTicks;if(m<=0)return null;const g=u.reduce((e,t)=>Math.max(e,t.level-p),0)+1,f=o??Number.POSITIVE_INFINITY,b=Math.max(1,Math.min(n/g,f)),y=a.trim(),v=b>8?1:0;return u.map(n=>{const o=n.level-p,a=(n.offset-h)/m*t,i=Math.max(n.size/m*t,1),l=o*b,r=Math.max(b-v,1),s=fd(e,n.nameIndex);return{...n,x:a,y:l,w:i,h:r,name:s,matchesSearch:wd(s,y)}})}function kd(e,t){let n=0;for(let t=0;t<e.length;t++)n=31*n+e.charCodeAt(t)>>>0;const o=t.v2.colors.black[500],a=[{fill:t.v2.colors.purple[300],text:o},{fill:t.v2.colors.green[300],text:o},{fill:t.v2.colors.red[300],text:o},{fill:t.v2.colors.blue[300],text:o},{fill:t.v2.colors.yellow[300],text:o}];return a[n%a.length]}var Td,$d;!function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(Td||(Td={})),function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}($d||($d={}));function Id(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function Ed(e,t,n){for(const o of n)if(e>=o.x&&e<o.x+o.w&&t>=o.y&&t<o.y+o.h)return o;return null}function Ad(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}const Nd=({flamebearer:n,maxRowPx:s,searchQuery:c="",shouldKeepName:d,minHostHeight:u=200,onFullscreenChange:p,profilingSlots:h,onFrameClick:g,onZoomedSymbolsChange:b,onResetZoom:y})=>{const v=f(),C=i(null),S=i(null),w=i({x:0,y:0}),x=i(n.numTicks),[k,T]=r({w:0,h:0}),[$,I]=r(""),[E,A]=r(null),[N,O]=r([]),[R,D]=r(!1),[P,F]=r(Td.Fit),[L,M]=r($d.Fit),[_,z]=r(!1),B=Math.max(1,Math.min(Math.floor(k.w*P),8192)),X=Math.max(1,Math.min(Math.floor(k.h*L),8192)),V=N.length>0?N[N.length-1]:null,U=V?.size??n.numTicks,j=a(()=>vd(n),[n]);o(()=>{x.current!==n.numTicks&&(x.current=n.numTicks,O([]))},[n.numTicks]),o(()=>{if(!b)return;if(!V)return void b(null);const e=Sd(j,V),t=new Set;for(const o of e){const e=fd(n,o.nameIndex);e&&t.add(e)}b([...t])},[V,n,j,b]),m(()=>{const e=C.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();T({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),o(()=>{if(!R)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[R]),o(()=>(p?.(R),()=>{R&&p?.(!1)}),[R,p]);const G=a(()=>xd(n,B,X,s,c,{zoomRoot:V,shouldKeepName:d,collapseRecursive:_,allRects:j}),[n,s,c,X,B,V,d,_,j]),H=a(()=>function(e){return[...e].sort((e,t)=>t.level-e.level)}(G?.length?c.trim()?G.filter(e=>e.matchesSearch):G:[]),[G,c]),W=l(e=>{if(B<2||X<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const o=Ed((e.clientX-t.left)/t.width*B,(e.clientY-t.top)/t.height*X,H);if(o){const e=Cd(o);A(e);const t=U>0?(100*o.size/U).toFixed(1):"0",a=n.numTicks>0?(100*o.size/n.numTicks).toFixed(1):"0";I(`${o.name}\ntotal ${bd(o.size)} (${t}% of view, ${a}% of profile) · self ${bd(o.self)}`)}else A(null),I("")},[H,n.numTicks,X,B,U]),K=l(e=>{W(e)},[W]),Y=l(()=>{A(null),I("")},[]),J=l(e=>{w.current={x:e.clientX,y:e.clientY}},[]),q=l(e=>{const{x:t,y:n}=w.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-n)>3)return;if(B<2||X<2)return;const o=e.currentTarget.getBoundingClientRect();if(o.width<1||o.height<1)return;const a=Ed((e.clientX-o.left)/o.width*B,(e.clientY-o.top)/o.height*X,H);if(!a)return;g?.(a.name);const i=function(e){return{level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}}(a);O(e=>{const t=e.length>0?e[e.length-1]:null;return t&&function(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}(i,t)?e.slice(0,-1):[...e,i]})},[H,X,B,g]);m(()=>{const e=S.current;if(!e||B<2||X<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,o=Math.max(B,X),a=Math.min(t,16384/o);e.width=Math.floor(B*a),e.height=Math.floor(X*a),e.style.width=`${B}px`,e.style.height=`${X}px`;const i=e.getContext("2d");i&&(i.setTransform(a,0,0,a,0,0),i.clearRect(0,0,B,X),G?.length?function(e,t,n,o,a,i,l,r){const s=i.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,n);const c=a.trim().length>0;e.textRendering="optimizeLegibility";for(const t of o){const{x:n,y:o,w:a,h:l,name:s,size:d,matchesSearch:u}=t;if(c&&!u)continue;const{fill:p,text:h}=kd(s,i);e.fillStyle=p,e.fillRect(n,o,a,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(n+.5,o+.5),e.lineTo(n+a-.5,o+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(n+.5,o+.5,Math.max(a-1,0),Math.max(l-1,0));const m=Id(d,r),g=`${s} (${bd(d)}, ${m}%)`,f=i.v2.text.size.xs,b=8,y=5,v=26,C=Math.min(f,Math.floor(l-2));if(a>=v&&C>=b){e.font=`${C}px ${i.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=g;for(;t.length>2&&e.measureText(t).width>a-2*y;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=a-2*y&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,n+y,o+l/2),e.fillStyle=h,e.fillText(t,n+y,o+l/2))}}if(l)for(const t of o){if(Cd(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:n,y:o,w:a,h:i}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(n+1,o+1,Math.max(a-2,0),Math.max(i-2,0));break}}(i,B,X,G,c,v,E,n.numTicks):(i.fillStyle=v.v2.colors.silver[900],i.fillRect(0,0,B,X)))},[G,n.numTicks,E,c,X,B,v]);const Z=l(()=>D(e=>!e),[]),Q=n.numTicks>0?Math.max(0,Math.min(100,Math.round(U/n.numTicks*100))):100,ee=a(()=>function(e,t,n){const o=n??vd(e),a=t?.offset??0,i=a+(t?.size??e.numTicks),l=(t?.level??-1)+1,r=t?.size??e.numTicks;let s=null;for(const e of o)e.level<l||e.offset<a||e.offset+e.size>i||e.size>=r||(!s||e.size>s.size||e.size===s.size&&e.level<s.level)&&(s=e);return s}(n,V,j),[n,V,j]),te=null!==ee,ne=N.length>0,ie=V?fd(n,V.nameIndex):"",le=l(()=>{O([]),y?.()},[y]),re=l(()=>O(e=>e.slice(0,-1)),[]),fe=l(()=>{ee&&O(e=>[...e,ee])},[ee]);return e("div",{style:R?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:v.v2.colors.silver[900]}:{flex:1,minHeight:u,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(ue,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(oe,{label:"Collapse recursive",tooltip:"Collapse straight-line recursion (parent → single same-name child of equal width) into a single bar. Helps deep recursive call chains fit on screen.",labelAlign:ae.Left,size:Tt.S,value:_,onChange:z}),e(ue,{$gap:8,children:[e(ue,{children:[t(pe,{variant:me.Secondary,size:he.S,label:"Reset zoom",leftIcon:Yi,onClick:le,disabled:!N.length}),t(pe,{variant:me.Secondary,size:he.S,iconSize:20,leftIcon:Ki,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!ne,onClick:re}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(se,{size:de.XXS,color:ce.Secondary,nowrap:!0,align:"center",children:`${Q}%`})}),t(pe,{variant:me.Secondary,size:he.S,iconSize:20,leftIcon:yi,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!te,onClick:fe})]}),e(ue,{children:[t($e,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ge,{variant:Cn.Filled,options:[{value:Td.Fit,label:"W: Fit"},{value:Td.X10,label:"10x"}],selected:P,setSelected:F})}),t($e,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ge,{variant:Cn.Filled,options:[{value:$d.Fit,label:"H: Fit"},{value:$d.X10,label:"10x"}],selected:L,setSelected:M})})]}),t(pe,{variant:me.Secondary,size:he.S,iconSize:24,leftIcon:R?Di:Ji,tooltip:R?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:Z})]})]}),t($e,{fullWidth:!0,keepAlive:!0,text:$,children:t("div",{ref:C,style:{flex:1,minWidth:0,width:"100%",height:R?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflow:"hidden"},children:t("div",{style:{position:"absolute",inset:0,overflowX:P>1?"auto":"hidden",overflowY:L>1?"auto":"hidden"},children:t("div",{style:{width:B||"100%",height:X||"100%",position:"relative"},children:t("canvas",{ref:S,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:E?"pointer":"default"},onPointerDown:J,onPointerMove:K,onPointerLeave:Y,onClick:q})})})})}),e(ue,{$justifyContent:"space-between",children:[t(se,V?{size:de.XXXS,color:v.v2.colors.silver[300],children:`Zoomed: ${ie} • ${bd(U)} samples in view`}:{size:de.XXXS,color:v.v2.colors.silver[300],children:g?"Click a frame to zoom in and jump to its row in the symbol table.":"Click a frame to zoom into its subtree (pprof-style)."}),h&&t(se,{size:de.XXXS,color:v.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${Ad(h.totalBytesUsed)} / ${Ad(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})},Od=[Sn.Go,Sn.Java],Rd="Profiling Symbols";function Dd(e,t){if(0===t.length)return null;const n=1===t.length?t[0]:function(e){return e.includes("/")||/\.\(\*?[^)]+\)\./.test(e)?Sn.Go:e.includes(" ")||e.includes("(")?Sn.Java:Sn.Go}(e);if(n===Sn.Go){const t=function(e){let t=e.trim();if(!t)return null;t=t.replace(/\[[^\]]*\]/g,"");const n=t.lastIndexOf("/"),o=t.indexOf(".",n+1);if(-1===o)return null;const a=t.slice(0,o),i=t.slice(o+1);if(!a||!i)return null;const l=i.match(/^\(\*?([^)]+)\)\.(.+)$/);if(l){const e=new Ue(a,"",l[1],l[2]);return e.Verify()?e:null}const r=new Ue(a,i);return r.Verify()?r:null}(e);return t?{language:n,golang:t}:null}if(n===Sn.Java){const t=function(e){let t=e.trim();if(!t)return null;const n=t.indexOf("(");-1!==n&&(t=t.slice(0,n).trim());const o=t.split(/\s+/);t=o[o.length-1]??"";const a=t.lastIndexOf(".");if(-1===a)return null;const i=t.slice(0,a),l=t.slice(a+1),r=new je(i,l);return r.Verify()?r:null}(e);return t?{language:n,java:t}:null}return null}function Pd(e,t){return e.namespace===t.namespace&&e.name===t.name&&e.kind===t.kind}function Fd(e,t,n){if(!e)return!0;const{sources:o=[],namespaces:a=[],languages:i=[]}=e,l=!o.length||o.some(e=>Pd(e,t.id)),r=!a.length||a.includes(t.id.namespace),s=!i.length||null==n||i.includes(n);return l&&r&&s}function Ld(e,t){return e.packageName===t.packageName&&(e.functionName||"")===(t.functionName||"")&&(e.receiverName||"")===(t.receiverName||"")&&(e.receiverMethodName||"")===(t.receiverMethodName||"")}function Md(e,t){return e.className===t.className&&e.methodName===t.methodName}function _d(e,t,n,o){const a=Dd(e,n);if(!a)return[];const i=[];for(const e of o){const n=e.customInstrumentations;if(!n)continue;if(!Fd(e.sourceScopes,t,a.language))continue;const o=!!a.golang&&!!n[Ge.Golang]?.some(e=>Ld(e,a.golang)),l=!!a.java&&!!n[Ge.Java]?.some(e=>Md(e,a.java));(o||l)&&i.push({rule:e,resolved:a})}return i}function zd({source:e,languages:t,rows:n}){const{instrumentationRulesApi:o,capabilities:i}=bl(),{items:s}=o.useRules(),[c,d]=r(new Set),[u,p]=r(new Set),[h,m]=r(null),g=a(()=>function(e){const t=new Set(e??[]);return Od.filter(e=>t.has(e))}(t),[t]),f=i.canCreateInstrumentationRule,b=a(()=>function(e,t){const n=e.filter(e=>e.type===He.CustomInstrumentation&&e.ruleName===Rd&&Fd(e.sourceScopes,t));return n.find(e=>e.sourceScopes?.sources?.some(e=>Pd(e,t.id)))??n[0]??null}(s,e),[s,e]),y=f&&g.length>0,v=a(()=>{const t=new Map;for(const o of n){const n=!!Dd(o.name,g),a=_d(o.name,e,g,s),i=!!b&&a.some(e=>e.rule.ruleId===b.ruleId),l=a.filter(e=>e.rule.ruleId!==b?.ruleId),r=!i&&l.length>0,c=y&&n,d=r;let u;if(r){const e=[...new Set(l.map(e=>e.rule.ruleName))];u=`Managed by ${e.length>1?"rules":"rule"} ${e.map(e=>`“${e}”`).join(", ")}. Edit ${e.length>1?"those rules":"that rule"} to change this symbol.`}let p=!1,h="Add this symbol to the “Profiling Symbols” rule";r?h=u??"Managed by another rule":0===a.length&&(0===g.length?h="Custom instrumentation is only available for Go and Java sources":f?n?p=!0:h="This symbol could not be parsed into a probe automatically":h="You don’t have permission to add custom instrumentation"),t.set(o.name,{parsable:n,inManagedRule:i,otherRules:l,showCheckbox:c,checkboxDisabled:d,checkboxTooltip:u,addEnabled:p,addTooltip:h})}return t},[n,s,e,g,f,y,b]),C=a(()=>{const e=new Set;return v.forEach((t,n)=>{t.inManagedRule&&e.add(n)}),e},[v]),S=a(()=>[...c].filter(e=>v.get(e)?.addEnabled&&!C.has(e)),[c,v,C]),w=a(()=>[...u].filter(e=>C.has(e)),[u,C]),x=S.length+w.length,k=l(e=>{const t=v.get(e);return t?.inManagedRule?!u.has(e):!!(t&&t.otherRules.length>0)||c.has(e)},[v,u,c]),T=l((e,t)=>{const n=v.get(e);n&&!n.checkboxDisabled&&(n.inManagedRule?p(n=>{const o=new Set(n);return t?o.delete(e):o.add(e),o}):d(n=>{const o=new Set(n);return t?o.add(e):o.delete(e),o}))},[v]),$=l(()=>{d(new Set),p(new Set)},[]),I=l(t=>{(async()=>{const n=t.add.map(e=>Dd(e,g)).filter(e=>!!e),a=t.remove.map(e=>Dd(e,g)).filter(e=>!!e);if(b){const{customInstrumentations:e,isEmpty:t}=function(e,t,n){const o=e.customInstrumentations??{};let a=[...o[Ge.Golang]??[]],i=[...o[Ge.Java]??[]];for(const e of n)e.golang&&(a=a.filter(t=>!Ld(t,e.golang))),e.java&&(i=i.filter(t=>!Md(t,e.java)));for(const e of t)e.golang&&!a.some(t=>Ld(t,e.golang))&&a.push(e.golang),e.java&&!i.some(t=>Md(t,e.java))&&i.push(e.java);return{customInstrumentations:{[Ge.Golang]:a,[Ge.Java]:i},isEmpty:0===a.length&&0===i.length}}(b,n,a);t?await o.remove(b.ruleId,He.CustomInstrumentation):await o.update(b.ruleId,function(e,t){return{ruleName:e.ruleName,notes:e.notes,disabled:e.disabled,sourceScopes:e.sourceScopes??null,workloads:null,instrumentationLibraries:e.instrumentationLibraries??null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:t}}(b,e),He.CustomInstrumentation)}else n.length>0&&await o.create(function(e,t){const n=e.map(e=>e.golang).filter(e=>!!e),o=e.map(e=>e.java).filter(e=>!!e),a={sources:[{namespace:t.id.namespace,name:t.id.name,kind:t.id.kind}],namespaces:[],languages:[]};return{ruleName:Rd,notes:"Symbols selected from the profiling tab.",disabled:!1,sourceScopes:a,workloads:null,instrumentationLibraries:null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:{[Ge.Golang]:n,[Ge.Java]:o}}}(n,e),He.CustomInstrumentation)})()},[b,g,e,o]),E=l(()=>{x&&m({add:S,remove:w})},[x,S,w]),A=l(e=>m({add:[e],remove:[]}),[]),N=l(e=>m({add:[],remove:[e]}),[]),O=l(()=>m(null),[]),R=l(()=>{h&&(I(h),m(null),$())},[h,I,$]),D=l(e=>v.get(e)??{parsable:!1,inManagedRule:!1,otherRules:[],showCheckbox:!1,checkboxDisabled:!1,addEnabled:!1,addTooltip:"Custom instrumentation is only available for Go and Java sources"},[v]);return{instrumentation:a(()=>({getSymbolState:D,onAdd:A,onRemove:N,selectionEnabled:y,isSelected:k,onToggleSymbol:T}),[D,A,N,y,k,T]),pendingCount:x,pendingModify:h,closeModify:O,openBulkModify:E,resetSelection:$,confirmModify:R}}var Bd,Xd,Vd;!function(e){e.Symbol="symbol",e.Self="self",e.Total="total"}(Bd||(Bd={})),function(e){e.OnlyInstrumentable="only-instrumentable"}(Xd||(Xd={})),function(e){e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"}(Vd||(Vd={}));const Ud=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function jd(e,t){const n=function(e){return e.split(" ")[0]??""}(e);if(t.includes(Vd.FilterOutVoid)&&"void"===n)return!1;if(t.includes(Vd.OnlyWithReturnValues)){if(!(e.includes(" ")&&"void"!==n&&Ud.test(n)))return!1}return!0}const Gd=({rows:e,languages:n,instrumentation:o,searchQuery:i,filters:r,onFiltersChange:s,zoomedSymbols:c,highlightSymbol:d,scrollSignal:u})=>{const p=!!n?.includes(Sn.Java),h=a(()=>{const t=c?new Set(c):null,n=i?.trim().toLowerCase();return e.filter(e=>(!t||t.has(e.name))&&(!n||e.name.toLowerCase().includes(n)))},[e,i,c]),m=a(()=>{const e=[];if(o.selectionEnabled&&e.push({id:Xd.OnlyInstrumentable,label:"Only show instrumentable symbols"}),p&&(e.push({id:Vd.FilterOutVoid,label:"Filter out void symbols"}),e.push({id:Vd.OnlyWithReturnValues,label:"Only show functions with return values"})),0!==e.length)return{options:e,filterRow:(e,t)=>{const n=e.cells.find(e=>e.key===Bd.Symbol)?.rawValue?.toString()??"";return!(t.includes(Xd.OnlyInstrumentable)&&!o.getSymbolState(n).showCheckbox)&&jd(n,t)}}},[o,p]),g=a(()=>[{key:Bd.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:m,noFilter:!m},{key:Bd.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:Bd.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[m]),f=a(()=>h.map(e=>{const t=o.getSymbolState(e.name),n=t.showCheckbox;return{id:e.name,cells:[{key:Bd.Symbol,rawValue:e.name},{key:Bd.Self,rawValue:bd(e.self)},{key:Bd.Total,rawValue:bd(e.total)}],isSelected:n?o.isSelected(e.name):void 0,onSelect:n?()=>o.onToggleSymbol(e.name,!0):void 0,onDeselect:n?()=>o.onToggleSymbol(e.name,!1):void 0,hideCheckbox:!n,checkboxDisabled:n?t.checkboxDisabled:void 0,checkboxTooltip:n?t.checkboxTooltip:void 0}}),[h,o]),b=l(e=>{const t=e.cells[0].rawValue,n=o.getSymbolState(t),a=[];return n.inManagedRule?a.push({id:`remove-instrumentation-${t}`,label:"",leftIcon:bi,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>o.onRemove(t)}):a.push({id:`add-instrumentation-${t}`,label:"",leftIcon:yi,tooltip:n.addTooltip,disabled:!n.addEnabled,onClick:()=>o.onAdd(t)}),a.push({id:`copy-${t}`,label:"",leftIcon:qi,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),a},[o]);return t(wn,{variant:xn.Data,maxHeight:"calc(100vh - 306px)",columns:g,rows:f,withCheckboxes:o.selectionEnabled,filters:r,onFiltersChange:s,activeRowId:d,scrollSignal:u,getRowActions:b})};var Hd;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(Hd||(Hd={}));const Wd=g(q)`
310
310
  width: 100%;
311
311
  flex: 1;
312
312
  border-radius: 16px;
313
313
  overflow: hidden;
314
314
  background: ${({theme:e})=>e.v2.colors.silver[800]};
315
315
  box-shadow: 0 2px 14.1px 0 rgba(0, 0, 0, 0.25);
316
- `,xd=g.div`
316
+ `,Kd=g.div`
317
317
  display: flex;
318
318
  align-items: center;
319
319
  gap: 10px;
@@ -321,11 +321,11 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
321
321
  padding: 12px 12px 8px;
322
322
  background: ${({theme:e})=>e.v2.colors.silver[800]};
323
323
  border-radius: 16px 16px 0 0;
324
- `,kd=g(se)`
324
+ `,Yd=g(ue)`
325
325
  flex-shrink: 0;
326
326
  align-items: center;
327
327
  gap: 4px;
328
- `,Td=g.div`
328
+ `,Jd=g.div`
329
329
  flex: 1;
330
330
  display: flex;
331
331
  align-items: stretch;
@@ -333,20 +333,20 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
333
333
  padding: 16px;
334
334
  background: ${({theme:e})=>e.v2.colors.silver[800]};
335
335
  border-radius: 0 0 16px 16px;
336
- `,$d=g(W)`
336
+ `,qd=g(q)`
337
337
  flex: ${({$splitWithFlame:e})=>e?"0 0 min(413px, 42%)":"1 1 auto"};
338
338
  width: ${({$splitWithFlame:e})=>e?"auto":"100%"};
339
339
  max-width: ${({$splitWithFlame:e})=>e?"none":"100%"};
340
340
  gap: 10px;
341
- `,Id=g(W)`
341
+ `,Zd=g(q)`
342
342
  flex: ${({$splitWithTable:e})=>e?"1":"1 1 auto"};
343
343
  width: ${({$splitWithTable:e})=>e?"auto":"100%"};
344
344
  gap: 10px;
345
- `,Ed=g(se)`
345
+ `,Qd=g(ue)`
346
346
  width: 100%;
347
347
  min-height: 32px;
348
348
  flex-shrink: 0;
349
- `,Ad=({source:n,onFlameFullscreenChange:c})=>{const d=f(),u=n.id,{profilingApi:p}=ll(),[h,m]=s(!0),[g,b]=s(Sd.Both),[v,y]=s(""),[C,S]=s({}),[w,x]=s(!1),k=i(!1);o(()=>{k.current||(k.current=!0,p.enableProfiling?.(u),x(!0))},[p,u]);const{data:T}=p.useSlots({skip:!w,pollInterval:3e3,fetchPolicy:"network-only"}),{data:$,loading:I,refetch:E}=p.useSourceProfiling(u,{skip:!w,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),A=$?.profileJson??null,N=a(()=>function(e){if(!e?.trim())return null;try{const t=JSON.parse(e),n=t.flamebearer;return!n?.names?.length||!Array.isArray(n.levels)||"number"!=typeof n.numTicks||n.numTicks<=0?null:{flamebearer:n,units:t.metadata?.units}}catch{return null}}(A),[A]),O=a(()=>N?function(e){const t=new Map;for(let n=0;n<e.levels.length;n++){const o=e.levels[n];for(let n=0;n+3<o.length;n+=4){const a=o[n+1],i=o[n+2],l=Hc(e,o[n+3]);if(!l)continue;const s=t.get(l);(!s||a>s.total)&&t.set(l,{self:i,total:a})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)}(N.flamebearer):[],[N]),R=g===Sd.Table||g===Sd.Both,D=g===Sd.Flame||g===Sd.Both,P=R&&D,F=a(()=>n.runtimeInfo?.detectedLanguages||n.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??""),[n]),L=a(()=>function(e,t){if(!t?.includes(gn.Java))return;const n=(e?.[gd.Symbol]?.filter(Boolean)??[]).filter(e=>e===bd.FilterOutVoid||e===bd.OnlyWithReturnValues);return 0!==n.length?e=>yd(e,n):void 0}(C,F),[C,F]),{instrumentation:_,pendingCount:M,pendingModify:z,closeModify:B,openBulkModify:X,resetSelection:V,confirmModify:U}=md({source:n,languages:F,rows:O}),[G,H]=s(null),[j,K]=s(0),[Y,J]=s(null),q=l(e=>{H(e),K(e=>e+1),b(e=>e===Sd.Flame?Sd.Both:e)},[]);return!A&&I?t(at,{$height:"70vh",children:t(ct,{withSpinner:!0})}):e(wd,{$gap:0,$width:"100%",children:[e(xd,{children:[t(De,{text:"Live CPU profile collected from the workload agent. Search symbols, switch between the table and flame graph, or download a JSON snapshot.",withIcon:!0,children:t(kd,{children:t(ae,{size:le.S,weight:500,color:ie.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(se,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(Jt,{value:v,onChange:y,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:d.v2.colors.silver[900],emphasizeBackgroundColor:d.v2.colors.silver[800]})}),t(ue,{variant:mn.Filled,options:[{value:Sd.Table,label:"Top table"},{value:Sd.Flame,label:"Flame graph"},{value:Sd.Both,label:"Both"}],selected:g,setSelected:b}),t(re,h?{variant:de.Secondary,size:ce.S,label:"Live",tooltip:"Odigos profiler works in-memory and doesn't store any data on disk, to keep minimum memory footprint we store only last 10 minutes of data on demand",leftIcon:e=>t(Xi,{...e,size:8,fill:d.v2.colors.green[500]})}:{variant:de.Secondary,size:ce.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(Xi,{...e,size:8,fill:d.v2.colors.red[500]})})]})]}),t(Td,{$gap:R&&D?16:0,children:N?e(r,{children:[R&&e($d,{$splitWithFlame:P,children:[e(Ed,{$justifyContent:"space-between",children:[e(W,{$margin:"0 0 0 20px",children:[t(ae,{size:le.XXXS,nowrap:!0,children:"Please select symbols to"}),e(se,{$gap:8,children:[e(se,{children:[t(Vi,{size:24}),t(ae,{size:le.S,color:ie.Success,nowrap:!0,children:"Custom Instrument"})]}),t(re,{leftIcon:ui,variant:de.Secondary,size:ce.S,onClick:()=>window.open(`${xe}/enterprise/pipeline/rules/custominstrumentation`,"_blank","noopener noreferrer")})]})]}),e(se,{$gap:8,children:[Y&&t(De,{text:"The table is scoped to the symbols inside the flame graph’s current zoom. Use “Reset zoom” on the flame graph to show all symbols again.",children:t(Be,{label:`Zoomed: ${Y.length} symbols`,backgroundColor:d.v2.colors.silver[750],textColor:d.v2.colors.silver[200],textSize:le.XXS})}),t(re,{variant:de.Secondary,size:ce.S,label:"Download snapshot",rightIcon:Ui,onClick:()=>{if(!A)return;const e=new Blob([A],{type:"application/json"}),t=URL.createObjectURL(e),o=document.createElement("a");o.href=t,o.download=`cpu-profile-${n.id.namespace}-${n.id.kind}-${n.id.name}.json`,o.click(),URL.revokeObjectURL(t)},disabled:!A})]})]}),t(Cd,{rows:O,languages:F,instrumentation:_,searchQuery:v,filters:C,onFiltersChange:S,zoomedSymbols:Y,highlightSymbol:G,scrollSignal:j})]}),D&&e(Id,{$splitWithTable:P,children:[e(Ed,{$justifyContent:"space-between",children:[t(Be,{label:N?`Total in view ${jc(N.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:d.v2.colors.silver[750],textColor:d.v2.colors.silver[200],textSize:le.XXS}),e(se,{$gap:12,children:[!h&&t(re,{variant:de.Secondary,size:ce.S,label:"Refresh",leftIcon:Ni,onClick:E}),t(Q,{label:"Auto refresh",labelAlign:ee.Left,size:bt.S,value:h,onChange:m})]})]}),t(id,{flamebearer:N.flamebearer,maxRowPx:24,searchQuery:v,shouldKeepName:L,minHostHeight:280,onFullscreenChange:c,profilingSlots:T??null,onFrameClick:q,onZoomedSymbolsChange:J,onResetZoom:()=>H(null)},g)]})]}):t(at,{children:t(Ce,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})}),t(Gc,{pendingModify:z,onClose:B,onConfirm:U}),t(vn,{isOpen:M>0,richTitle:{icon:xi,title:"Profiling Symbols",badge:{label:M}},actions:[{id:"profiling-bulk-cancel",type:Yt.Button,buttonProps:{variant:de.Secondary,size:ce.S,label:"Cancel",onClick:V}},{id:"profiling-bulk-apply",type:Yt.Button,buttonProps:{variant:de.Primary,size:ce.S,label:"Modify Rule",leftIcon:hi,onClick:X}}]})]})},Nd=g.div`
349
+ `,eu=({source:n,onFlameFullscreenChange:c})=>{const d=f(),u=n.id,{profilingApi:p}=bl(),[h,m]=r(!0),[g,b]=r(Hd.Both),[y,v]=r(""),[C,S]=r({}),[w,x]=r(!1),k=i(!1);o(()=>{k.current||(k.current=!0,p.enableProfiling?.(u),x(!0))},[p,u]);const{data:T}=p.useSlots({skip:!w,pollInterval:3e3,fetchPolicy:"network-only"}),{data:$,loading:I,refetch:E}=p.useSourceProfiling(u,{skip:!w,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),A=$?.profileJson??null,N=a(()=>function(e){if(!e?.trim())return null;try{const t=JSON.parse(e),n=t.flamebearer;return!n?.names?.length||!Array.isArray(n.levels)||"number"!=typeof n.numTicks||n.numTicks<=0?null:{flamebearer:n,units:t.metadata?.units}}catch{return null}}(A),[A]),O=a(()=>N?function(e){const t=new Map;for(let n=0;n<e.levels.length;n++){const o=e.levels[n];for(let n=0;n+3<o.length;n+=4){const a=o[n+1],i=o[n+2],l=fd(e,o[n+3]);if(!l)continue;const r=t.get(l);(!r||a>r.total)&&t.set(l,{self:i,total:a})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)}(N.flamebearer):[],[N]),R=g===Hd.Table||g===Hd.Both,D=g===Hd.Flame||g===Hd.Both,P=R&&D,F=a(()=>n.runtimeInfo?.detectedLanguages||n.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??""),[n]),L=a(()=>function(e,t){if(!t?.includes(Sn.Java))return;const n=(e?.[Bd.Symbol]?.filter(Boolean)??[]).filter(e=>e===Vd.FilterOutVoid||e===Vd.OnlyWithReturnValues);return 0!==n.length?e=>jd(e,n):void 0}(C,F),[C,F]),{instrumentation:M,pendingCount:_,pendingModify:z,closeModify:B,openBulkModify:X,resetSelection:V,confirmModify:U}=zd({source:n,languages:F,rows:O}),[j,G]=r(null),[H,W]=r(0),[K,Y]=r(null),J=l(e=>{G(e),W(e=>e+1),b(e=>e===Hd.Flame?Hd.Both:e)},[]);return!A&&I?t(ht,{$height:"70vh",children:t(yt,{withSpinner:!0})}):e(Wd,{$gap:0,$width:"100%",children:[e(Kd,{children:[t($e,{text:"Live CPU profile collected from the workload agent. Search symbols, switch between the table and flame graph, or download a JSON snapshot.",withIcon:!0,children:t(Yd,{children:t(se,{size:de.S,weight:500,color:ce.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(ue,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(on,{value:y,onChange:v,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:d.v2.colors.silver[900],emphasizeBackgroundColor:d.v2.colors.silver[800]})}),t(ge,{variant:Cn.Filled,options:[{value:Hd.Table,label:"Top table"},{value:Hd.Flame,label:"Flame graph"},{value:Hd.Both,label:"Both"}],selected:g,setSelected:b}),t(pe,h?{variant:me.Secondary,size:he.S,label:"Live",tooltip:"Odigos profiler works in-memory and doesn't store any data on disk, to keep minimum memory footprint we store only last 10 minutes of data on demand",leftIcon:e=>t(Zi,{...e,size:8,fill:d.v2.colors.green[500]})}:{variant:me.Secondary,size:he.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(Zi,{...e,size:8,fill:d.v2.colors.red[500]})})]})]}),t(Jd,{$gap:R&&D?16:0,children:N?e(s,{children:[R&&e(qd,{$splitWithFlame:P,children:[e(Qd,{$justifyContent:"space-between",children:[e(q,{$margin:"0 0 0 20px",children:[t(se,{size:de.XXXS,nowrap:!0,children:"Please select symbols to"}),e(ue,{$gap:8,children:[e(ue,{children:[t(Qi,{size:24}),t(se,{size:de.S,color:ce.Success,nowrap:!0,children:"Custom Instrument"})]}),t(pe,{leftIcon:wi,variant:me.Secondary,size:he.S,onClick:()=>window.open(`${Fe}/enterprise/pipeline/rules/custominstrumentation`,"_blank","noopener noreferrer")})]})]}),e(ue,{$gap:8,children:[K&&t($e,{text:"The table is scoped to the symbols inside the flame graph’s current zoom. Use “Reset zoom” on the flame graph to show all symbols again.",children:t(We,{label:`Zoomed: ${K.length} symbols`,backgroundColor:d.v2.colors.silver[750],textColor:d.v2.colors.silver[200],textSize:de.XXS})}),t(pe,{variant:me.Secondary,size:he.S,label:"Download snapshot",rightIcon:el,onClick:()=>{if(!A)return;const e=new Blob([A],{type:"application/json"}),t=URL.createObjectURL(e),o=document.createElement("a");o.href=t,o.download=`cpu-profile-${n.id.namespace}-${n.id.kind}-${n.id.name}.json`,o.click(),URL.revokeObjectURL(t)},disabled:!A})]})]}),t(Gd,{rows:O,languages:F,instrumentation:M,searchQuery:y,filters:C,onFiltersChange:S,zoomedSymbols:K,highlightSymbol:j,scrollSignal:H})]}),D&&e(Zd,{$splitWithTable:P,children:[e(Qd,{$justifyContent:"space-between",children:[t(We,{label:N?`Total in view ${bd(N.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:d.v2.colors.silver[750],textColor:d.v2.colors.silver[200],textSize:de.XXS}),e(ue,{$gap:12,children:[!h&&t(pe,{variant:me.Secondary,size:he.S,label:"Refresh",leftIcon:Xi,onClick:E}),t(oe,{label:"Auto refresh",labelAlign:ae.Left,size:Tt.S,value:h,onChange:m})]})]}),t(Nd,{flamebearer:N.flamebearer,maxRowPx:24,searchQuery:y,shouldKeepName:L,minHostHeight:280,onFullscreenChange:c,profilingSlots:T??null,onFrameClick:J,onZoomedSymbolsChange:Y,onResetZoom:()=>G(null)},g)]})]}):t(ht,{children:t(Ae,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})}),t(gd,{pendingModify:z,onClose:B,onConfirm:U}),t(kn,{isOpen:_>0,richTitle:{icon:Pi,title:"Profiling Symbols",badge:{label:_}},actions:[{id:"profiling-bulk-cancel",type:nn.Button,buttonProps:{variant:me.Secondary,size:he.S,label:"Cancel",onClick:V}},{id:"profiling-bulk-apply",type:nn.Button,buttonProps:{variant:me.Primary,size:he.S,label:"Modify Rule",leftIcon:ki,onClick:X}}]})]})},tu=g.div`
350
350
  position: relative;
351
351
  display: flex;
352
352
  align-items: center;
@@ -354,17 +354,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
354
354
  padding: 8px 16px;
355
355
  border-radius: 12px;
356
356
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
357
- `,Od=g.div`
357
+ `,nu=g.div`
358
358
  display: flex;
359
359
  flex-direction: column;
360
360
  gap: 4px;
361
361
  flex: 1;
362
362
  min-width: 0;
363
- `,Rd=g.div`
363
+ `,ou=g.div`
364
364
  min-width: 0;
365
365
  white-space: pre;
366
366
  overflow-x: auto;
367
- `,Dd=g.div`
367
+ `,au=g.div`
368
368
  position: absolute;
369
369
  top: 50%;
370
370
  right: 8px;
@@ -373,11 +373,24 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
373
373
  pointer-events: none;
374
374
  transition: opacity 0.15s ease;
375
375
 
376
- ${Nd}:hover & {
376
+ ${tu}:hover & {
377
377
  opacity: 1;
378
378
  pointer-events: auto;
379
379
  }
380
- `,Pd=({name:n,summary:o,onJumpToRule:a})=>e(Nd,{children:[e(Od,{children:[n&&t(ae,{size:le.XXXS,color:ie.Secondary,nowrap:!0,children:n}),t(Rd,{children:t(S,{parts:o})})]}),a&&t(Dd,{children:t(De,{text:Ge.OPEN_IN_SAMPLING_PAGE,children:t(re,{"data-id":"sampling-rule-jump",variant:de.Primary,size:ce.S,leftIcon:zi,onClick:a})})})]}),Fd=({source:e,onRedirectToSampling:n})=>t($t,{bgTint:"1000",richTitle:{title:Ge.SAMPLING},children:e.containers?.map(e=>t(Md,{container:e,onRedirectToSampling:n},e.containerName))});var Ld;!function(e){e.All="all",e.Noisy="noisy",e.HighlyRelevant="highly-relevant",e.CostReduction="cost-reduction"}(Ld||(Ld={}));const _d=e=>"noisy"===e.type?w(e.rule,"source"):"highlyRelevant"===e.type?x(e.rule,"source"):"costReduction"===e.type?k(e.rule,"source"):[],Md=({container:n,onRedirectToSampling:o})=>{const[i,l]=s(Ld.All),r=Zt(e=>e.setPendingViewSamplingRule),c=n.agentConfig?.traces?.headSampling?.noisyOperations??[],d=a(()=>(n.collectorConfig?.tailSampling?.noisyOperations??[]).map(e=>({type:"noisy",rule:e})),[n.agentConfig?.traces?.headSampling?.noisyOperations]),u=a(()=>(n.collectorConfig?.tailSampling?.highlyRelevantOperations??[]).map(e=>({type:"highlyRelevant",rule:e})),[n.collectorConfig?.tailSampling?.highlyRelevantOperations]),p=a(()=>(n.collectorConfig?.tailSampling?.costReductionRules??[]).map(e=>({type:"costReduction",rule:e})),[n.collectorConfig?.tailSampling?.costReductionRules]),h=a(()=>i===Ld.Noisy?d:i===Ld.HighlyRelevant?u:i===Ld.CostReduction?p:[...d,...u,...p],[i,u,p]),m=a(()=>(e,t)=>{r({ruleId:e,category:t}),o()},[o,r]);return e($t,{bgTint:"900",richTitle:{title:n.containerName},withCollapse:!0,collapseIsDefaultOpen:!0,children:[e($t,{bgTint:"800",richTitle:{title:Ge.HEAD_SAMPLING,badge:{label:c.length}},withCollapse:!0,collapseIsDefaultOpen:!!c.length,children:[t(ae,{size:le.XXS,children:Ge.NOISY_OPERATIONS}),t(W,{$gap:4,children:c.length?c.map(e=>t(Pd,{name:e.name,summary:w(e,"source"),onJumpToRule:()=>m(e.ruleId,"noisy")},e.ruleId)):t(Ce,{title:"No sampling rules for noisy operations"})})]}),e($t,{bgTint:"800",richTitle:{title:Ge.TAIL_SAMPLING,badge:{label:d.length+u.length+p.length}},withCollapse:!0,collapseIsDefaultOpen:!!h.length,children:[t(ue,{options:(g=d.length,f=u.length,b=p.length,[{value:Ld.All,label:"All",badge:{label:g+f+b,textSize:le.XXXS}},{value:Ld.Noisy,label:Ge.NOISY_OPERATIONS,badge:{label:g,textSize:le.XXXS}},{value:Ld.HighlyRelevant,label:Ge.HIGHLY_RELEVANT_OPERATIONS,badge:{label:f,textSize:le.XXXS}},{value:Ld.CostReduction,label:Ge.COST_REDUCTION_OPERATIONS,badge:{label:b,textSize:le.XXXS}}]),selected:i,setSelected:l}),t(W,{$gap:4,children:h.length?h.map(e=>t(Pd,{name:e.rule.name,summary:_d(e),onJumpToRule:()=>m(e.rule.ruleId,e.type)},e.rule.ruleId)):t(Ce,{title:`No sampling rules for ${i===Ld.All?`${Ld.Noisy}, ${Ld.HighlyRelevant} and ${Ld.CostReduction}`:i} operations`})})]})]});var g,f,b},zd=[on.Deployment,on.StatefulSet,on.DaemonSet,on.DeploymentConfig,on.Rollout,on.Pod];var Bd;!function(e){e.Workload="Workload",e.Pod="Pod"}(Bd||(Bd={}));const Xd=e=>!!e&&Gt(e.status)===Ie.Error,Vd=e=>Xd(e.healthStatus),Ud=e=>Xd(e.odigosHealthStatus)||(e.processes??[]).some(Vd),Gd=e=>Xd(e.agentInjectedStatus)||Xd(e.odigosHealthStatus)||(e.containers??[]).some(Ud),Hd=({onClose:n,sourceId:r,onRedirectToSampling:c})=>{const d=f(),{isVm:u}=y(),{sourcesApi:p,configApi:h}=ll(),{selectedStreamName:m}=He(),{genericForm:g,loadSource:b,validateFormData:v}=Rl(),{data:C}=h.useEffectiveConfig(),[S,w]=s(!1),[x,k]=s(!1),[T,$]=s(!1),[I,E]=s(Gr.Overview),[A,N]=s(null),[O,R]=s({openFor:null}),D=(()=>{const[e,t]=s(null),n=l(e=>{t({tab:Gr.Pods,podName:e.podName})},[]),o=l((e,n)=>{t({tab:Gr.Pods,podName:e.podName,containerName:n.containerName})},[]),i=l((e,n,o)=>{const a=Jr({identifyingAttributes:o.identifyingAttributes});t({tab:Gr.Pods,podName:e.podName,containerName:n.containerName,processPid:a})},[]),r=l(()=>t(null),[]);return a(()=>({jumpToTarget:e,jumpToPod:n,jumpToContainer:o,jumpToProcess:i,clearJumpToTarget:r}),[e,n,o,i,r])})();o(()=>{D.jumpToTarget&&E(D.jumpToTarget.tab)},[D.jumpToTarget]),o(()=>{A&&JSON.stringify(Qt(r))!==JSON.stringify(Qt(A))&&N(null)},[r,A]);const P=i(!1),F=l(async()=>N(await p.fetchById(r)||null),[r,p]);o(()=>{if(P.current||(F(),P.current=!0),!S){const e=setInterval(()=>F(),3e3);return()=>clearInterval(e)}},[F,S]),o(()=>{A&&b(A)},[A]);const L=A&&zd.includes(A.id.kind),_=a(()=>{const e=[],n=(A?.pods??[]).some(Gd);return e.push({value:Gr.Overview,label:Ge.OVERVIEW}),u||(e.push({value:Gr.Pods,label:Ge.PODS,icon:n?e=>t(Oi,{...e,fill:d.v2.colors.red[500]}):void 0}),e.push({value:Gr.PeerSources,label:Ge.PEER_SOURCES}),C?.profiling?.enabled&&e.push({value:Gr.Profiling,label:Ge.PROFILING}),e.push({value:Gr.Sampling,label:Ge.SAMPLING}),e.push({value:Gr.Debug,label:Ge.DEBUG})),e},[u,C,A?.pods]),M=l(()=>w(!0),[]),z=a(()=>()=>{n(),c()},[n,c]),B=l(()=>{A&&b(A),w(!1)},[A]),X=l(async()=>{if(!A||!g)return;const{errorMessage:e,preparedFormData:t}=v();if(e)return;const n=t.otelServiceName!==A.id.name?t.otelServiceName:"";await p.update(r,{...t,otelServiceName:n}),w(!1)},[A,g,v,r,p]),V=l(()=>k(!0),[]),U=l(async()=>{A&&(await p.persistV2({[St]:[{namespace:A.id.namespace,name:A.id.name,kind:A.id.kind,selected:!1,currentStreamName:m}]}),k(!1),n())},[A,p,m,n]),G=l(()=>{R({openFor:Bd.Workload})},[]),H=l(e=>{E(e),D.clearJumpToTarget()},[D]),j=l(async()=>{await p.recoverFromRollback(r)},[p,r]),K=l(()=>R({openFor:null}),[]),Y=l(async()=>{O.openFor===Bd.Workload?await p.restartWorkloads([r]):O.openFor===Bd.Pod&&O.podNamespace&&O.podName&&await p.restartPod(O.podNamespace,O.podName),K()},[O,p,r,K]),J=a(()=>{const{kind:e,name:t}=r;return{title:`Rollout ${e}`,description:`Are you sure you want to rollout the ${e.toLowerCase()} "${t}"?`}},[r]),q=a(()=>{const e=[];return S||I===Gr.Overview&&(e.push({id:"edit-source-btn-edit",label:kt.EDIT,icon:hi,active:S,onClick:M}),!u&&L&&e.push({id:"edit-source-btn-restart",label:Ge.ROLLOUT,icon:Gi,onClick:G}),e.push({id:"edit-source-btn-delete",label:kt.UNINSTRUMENT,icon:li,color:d.v2.colors.red[500],active:x,onClick:V})),e},[I,S,x,u,L,M,G,V,d]),Z=a(()=>{if(!A)return[];const e=[],t={backgroundColor:"transparent",textSize:le.S};return e.push({...t,label:A.id.name,leftIcon:u?void 0:Ai}),A.serviceName&&A.serviceName!==A.id.name&&e.push({...t,label:A.serviceName,leftIcon:Ei,textColor:d.v2.colors.silver[200]}),e},[A,d,u]);if(!A)return t(ne,{isOpen:!0,children:t(at,{$height:"80vh",children:t(ct,{withSpinner:!0})})});const Q=I===Gr.Profiling?T?"95vw":"fit-content":S?void 0:"60vw";return e(ic,{value:D,children:[t(ne,{isOpen:!0,width:Q,minWidth:"777px",header:{icon:u?Hi:yn(A.containers)[0],titleBadges:Z,onClose:()=>{H(Gr.Overview),N(null),$(!1),n()},actions:q},footer:{actions:S?[{"data-id":"edit-source-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:B},{"data-id":"edit-source-btn-save",label:kt.SAVE,variant:de.Primary,onClick:X}]:[]},children:t(Tt,{$padding:"4px 12px 12px",children:e(W,{$gap:16,children:[!S&&_.length>1&&t(ue,{options:_,selected:I,setSelected:H}),(()=>{switch(I){case Gr.Overview:return S?t(js,{}):t(Xc,{source:A,onClickRollout:G,onClickRollback:j});case Gr.Pods:return t(dc,{source:A,onClickRestartPod:L?(e,t)=>R({openFor:Bd.Pod,podNamespace:e,podName:t}):void 0});case Gr.PeerSources:return t(uc,{source:A});case Gr.Profiling:return t(Ad,{source:A,onFlameFullscreenChange:$});case Gr.Sampling:return t(Fd,{source:A,onRedirectToSampling:z});case Gr.Debug:return t(fc,{source:A});default:return null}})()]})})}),t(Sl,{target:"source",action:"uninstrument",isOpen:x,onClose:()=>k(!1),onApprove:U}),t(Ue,{isOpen:O.openFor===Bd.Workload,title:J.title,description:J.description,onClose:K,denyButton:{label:"Go back",variant:de.Secondary,onClick:K},approveButton:{label:kt.CONFIRM,variant:de.Primary,onClick:Y}}),t(Sl,{target:"pod",action:"restart",description:Ge.ROLLOUT_RESTART_WORKLOADS_DESCRIPTION,isOpen:O.openFor===Bd.Pod,onClose:K,onApprove:Y,overrideApproveButtonLabel:Ge.DELETE_POD_TO_RESTART})]})},jd=g.div`
380
+ `,iu=({name:n,summary:o,onJumpToRule:a})=>e(tu,{children:[e(nu,{children:[n&&t(se,{size:de.XXXS,color:ce.Secondary,nowrap:!0,children:n}),t(ou,{children:t(S,{parts:o})})]}),a&&t(au,{children:t($e,{text:qe.OPEN_IN_SAMPLING_PAGE,children:t(pe,{"data-id":"sampling-rule-jump",variant:me.Primary,size:he.S,leftIcon:Ji,onClick:a})})})]}),lu=g.div`
381
+ opacity: 0;
382
+ pointer-events: none;
383
+ transition: opacity 0.15s ease;
384
+ `,ru=g.div`
385
+ &:hover ${lu} {
386
+ opacity: 1;
387
+ pointer-events: auto;
388
+ }
389
+ `,su=g.div`
390
+ display: flex;
391
+ align-items: center;
392
+ padding: 4px 12px;
393
+ `,cu=({source:e,onRedirectToSampling:n})=>t(Pt,{bgTint:"1000",richTitle:{title:qe.CONTAINERS,badge:{label:e.containers?.length??0}},children:e.containers?.map(e=>t(pu,{container:e,onRedirectToSampling:n},e.containerName))});var du;!function(e){e.All="all",e.Noisy="noisy",e.HighlyRelevant="highly-relevant",e.CostReduction="cost-reduction"}(du||(du={}));const uu=e=>"noisy"===e.type?w(e.rule,"source"):"highlyRelevant"===e.type?x(e.rule,"source"):"costReduction"===e.type?k(e.rule,"source"):[],pu=({container:n,onRedirectToSampling:o})=>{const[i,l]=r(du.All),s=ln(e=>e.setPendingViewSamplingRule),c=n.agentConfig?.traces?.headSampling?.noisyOperations??[],d=a(()=>(n.collectorConfig?.tailSampling?.noisyOperations??[]).map(e=>({type:"noisy",rule:e})),[n.agentConfig?.traces?.headSampling?.noisyOperations]),u=a(()=>(n.collectorConfig?.tailSampling?.highlyRelevantOperations??[]).map(e=>({type:"highlyRelevant",rule:e})),[n.collectorConfig?.tailSampling?.highlyRelevantOperations]),p=a(()=>(n.collectorConfig?.tailSampling?.costReductionRules??[]).map(e=>({type:"costReduction",rule:e})),[n.collectorConfig?.tailSampling?.costReductionRules]),h=a(()=>i===du.Noisy?d:i===du.HighlyRelevant?u:i===du.CostReduction?p:[...d,...u,...p],[i,u,p]),m=d.length+u.length+p.length,g=a(()=>(e,t)=>{s({ruleId:e,category:t}),o()},[o,s]),f=t(lu,{children:t(pe,{"data-id":"sampling-container-create-rule",variant:me.Secondary,size:he.S,label:Tn,rightIcon:yi,onClick:e=>{e.stopPropagation(),o()}})});return t(ru,{children:e(Pt,{bgTint:"900",richTitle:{title:n.containerName},renderOnRightSide:f,withCollapse:!0,collapseIsDefaultOpen:!0,children:[c.length?e(Pt,{bgTint:"800",richTitle:{title:qe.HEAD_SAMPLING,badge:{label:c.length}},children:[t(se,{size:de.XXS,children:qe.NOISY_OPERATIONS}),t(q,{$gap:4,children:c.map(e=>t(iu,{name:e.name,summary:w(e),onJumpToRule:()=>g(e.ruleId,"noisy")},e.ruleId))})]}):t(su,{children:t(se,{size:de.XS,color:ce.Secondary,children:qe.HEAD_SAMPLING})}),m?e(Pt,{bgTint:"800",richTitle:{title:qe.TAIL_SAMPLING,badge:{label:m}},children:[t(ge,{options:(b=d.length,y=u.length,v=p.length,[{value:du.All,label:"All",badge:{label:b+y+v,textSize:de.XXXS}},{value:du.Noisy,label:qe.NOISY_OPERATIONS,badge:{label:b,textSize:de.XXXS}},{value:du.HighlyRelevant,label:qe.HIGHLY_RELEVANT_OPERATIONS,badge:{label:y,textSize:de.XXXS}},{value:du.CostReduction,label:qe.COST_REDUCTION_OPERATIONS,badge:{label:v,textSize:de.XXXS}}]),selected:i,setSelected:l}),t(q,{$gap:4,children:h.length?h.map(e=>t(iu,{name:e.rule.name,summary:uu(e),onJumpToRule:()=>g(e.rule.ruleId,e.type)},e.rule.ruleId)):t(Ae,{title:`No ${i===du.All?`${du.Noisy}, ${du.HighlyRelevant} and ${du.CostReduction}`:i} operations`})})]}):t(su,{children:t(se,{size:de.XS,color:ce.Secondary,children:qe.TAIL_SAMPLING})})]})});var b,y,v},hu=[un.Deployment,un.StatefulSet,un.DaemonSet,un.DeploymentConfig,un.Rollout,un.Pod];var mu;!function(e){e.Workload="Workload",e.Pod="Pod"}(mu||(mu={}));const gu=e=>!!e&&qt(e.status)===Pe.Error,fu=e=>gu(e.healthStatus),bu=e=>gu(e.odigosHealthStatus)||(e.processes??[]).some(fu),yu=e=>gu(e.agentInjectedStatus)||gu(e.odigosHealthStatus)||(e.containers??[]).some(bu),vu=({onClose:n,sourceId:s,onRedirectToSampling:c})=>{const d=f(),{isVm:u}=v(),{sourcesApi:p,configApi:h}=bl(),{selectedStreamName:m}=Ze(),{genericForm:g,loadSource:b,validateFormData:y}=Ul(),{data:C}=h.useEffectiveConfig(),[S,w]=r(!1),[x,k]=r(!1),[T,$]=r(!1),[I,E]=r(gc.Overview),[A,N]=r(null),[O,R]=r({openFor:null}),D=(()=>{const[e,t]=r(null),n=l(e=>{t({tab:gc.Pods,podName:e.podName})},[]),o=l((e,n)=>{t({tab:gc.Pods,podName:e.podName,containerName:n.containerName})},[]),i=l((e,n,o)=>{const a=Sc({identifyingAttributes:o.identifyingAttributes});t({tab:gc.Pods,podName:e.podName,containerName:n.containerName,processPid:a})},[]),s=l(()=>t(null),[]);return a(()=>({jumpToTarget:e,jumpToPod:n,jumpToContainer:o,jumpToProcess:i,clearJumpToTarget:s}),[e,n,o,i,s])})();o(()=>{D.jumpToTarget&&E(D.jumpToTarget.tab)},[D.jumpToTarget]),o(()=>{A&&JSON.stringify(rn(s))!==JSON.stringify(rn(A))&&N(null)},[s,A]);const P=i(!1),F=l(async()=>N(await p.fetchById(s)||null),[s,p]);o(()=>{if(P.current||(F(),P.current=!0),!S){const e=setInterval(()=>F(),3e3);return()=>clearInterval(e)}},[F,S]),o(()=>{A&&b(A)},[A]);const L=A&&hu.includes(A.id.kind),M=a(()=>{const e=[],n=(A?.pods??[]).some(yu);return e.push({value:gc.Overview,label:qe.OVERVIEW}),u||(e.push({value:gc.Pods,label:qe.PODS,icon:n?e=>t(Vi,{...e,fill:d.v2.colors.red[500]}):void 0}),e.push({value:gc.PeerSources,label:qe.PEER_SOURCES}),C?.profiling?.enabled&&e.push({value:gc.Profiling,label:qe.PROFILING}),e.push({value:gc.Sampling,label:qe.SAMPLING}),e.push({value:gc.Debug,label:qe.DEBUG})),e},[u,C,A?.pods]),_=l(()=>w(!0),[]),z=a(()=>()=>{n(),c()},[n,c]),B=l(()=>{A&&b(A),w(!1)},[A]),X=l(async()=>{if(!A||!g)return;const{errorMessage:e,preparedFormData:t}=y();if(e)return;const n=t.otelServiceName!==A.id.name?t.otelServiceName:"";await p.update(s,{...t,otelServiceName:n}),w(!1)},[A,g,y,s,p]),V=l(()=>k(!0),[]),U=l(async()=>{A&&(await p.persistV2({[At]:[{namespace:A.id.namespace,name:A.id.name,kind:A.id.kind,selected:!1,currentStreamName:m}]}),k(!1),n())},[A,p,m,n]),j=l(()=>{R({openFor:mu.Workload})},[]),G=l(e=>{E(e),D.clearJumpToTarget()},[D]),H=l(async()=>{await p.recoverFromRollback(s)},[p,s]),W=l(()=>R({openFor:null}),[]),K=l(async()=>{O.openFor===mu.Workload?await p.restartWorkloads([s]):O.openFor===mu.Pod&&O.podNamespace&&O.podName&&await p.restartPod(O.podNamespace,O.podName),W()},[O,p,s,W]),Y=a(()=>{const{kind:e,name:t}=s;return{title:`Rollout ${e}`,description:`Are you sure you want to rollout the ${e.toLowerCase()} "${t}"?`}},[s]),J=a(()=>{const e=[];return S||I===gc.Overview&&(e.push({id:"edit-source-btn-edit",label:Dt.EDIT,icon:ki,active:S,onClick:_}),!u&&L&&e.push({id:"edit-source-btn-restart",label:qe.ROLLOUT,icon:tl,onClick:j}),e.push({id:"edit-source-btn-delete",label:Dt.UNINSTRUMENT,icon:bi,color:d.v2.colors.red[500],active:x,onClick:V})),e},[I,S,x,u,L,_,j,V,d]),Z=a(()=>{if(!A)return[];const e=[],t={backgroundColor:"transparent",textSize:de.S};return e.push({...t,label:A.id.name,leftIcon:u?void 0:Bi}),A.serviceName&&A.serviceName!==A.id.name&&e.push({...t,label:A.serviceName,leftIcon:zi,textColor:d.v2.colors.silver[200]}),e},[A,d,u]);if(!A)return t(le,{isOpen:!0,children:t(ht,{$height:"80vh",children:t(yt,{withSpinner:!0})})});const Q=I===gc.Profiling?T?"95vw":"fit-content":S?void 0:"60vw";return e(Nc,{value:D,children:[t(le,{isOpen:!0,width:Q,minWidth:"777px",header:{icon:u?nl:$n(A.containers)[0],titleBadges:Z,onClose:()=>{G(gc.Overview),N(null),$(!1),n()},actions:J},footer:{actions:S?[{"data-id":"edit-source-btn-cancel",label:Dt.CANCEL,variant:me.Secondary,onClick:B},{"data-id":"edit-source-btn-save",label:Dt.SAVE,variant:me.Primary,onClick:X}]:[]},children:t(ut,{$padding:"4px 12px 12px",children:e(q,{$gap:16,children:[!S&&M.length>1&&t(ge,{options:M,selected:I,setSelected:G}),(()=>{switch(I){case gc.Overview:return S?t(bs,{}):t(pd,{source:A,onClickRollout:j,onClickRollback:H});case gc.Pods:return t(Fc,{source:A,onClickRestartPod:L?(e,t)=>R({openFor:mu.Pod,podNamespace:e,podName:t}):void 0});case gc.PeerSources:return t(Lc,{source:A});case gc.Profiling:return t(eu,{source:A,onFlameFullscreenChange:$});case gc.Sampling:return t(cu,{source:A,onRedirectToSampling:z});case gc.Debug:return t(Xc,{source:A});default:return null}})()]})})}),t(Rl,{target:"source",action:"uninstrument",isOpen:x,onClose:()=>k(!1),onApprove:U}),t(Je,{isOpen:O.openFor===mu.Workload,title:Y.title,description:Y.description,onClose:W,denyButton:{label:"Go back",variant:me.Secondary,onClick:W},approveButton:{label:Dt.CONFIRM,variant:me.Primary,onClick:K}}),t(Rl,{target:"pod",action:"restart",description:qe.ROLLOUT_RESTART_WORKLOADS_DESCRIPTION,isOpen:O.openFor===mu.Pod,onClose:W,onApprove:K,overrideApproveButtonLabel:qe.DELETE_POD_TO_RESTART})]})},Cu=g.div`
381
394
  display: flex;
382
395
  align-items: center;
383
396
  gap: 8px;
@@ -387,9 +400,9 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
387
400
  &:hover {
388
401
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
389
402
  }
390
- `,Wd=g.div`
403
+ `,Su=g.div`
391
404
  flex: 1;
392
- `,Kd=({onClick:n})=>{const o=f().v2.colors.red[500];return e(jd,{"data-id":"sampling-view-btn-delete",onClick:n,children:[t(ae,{size:le.XS,weight:500,color:o,children:xn}),t(li,{size:16,fill:o})]})};function Yd(o){if(o.isEditing){const{onCancelEdit:a,onSave:i,onDelete:l,duplicateWarning:s}=o;return{children:e(n,{children:[t(Kd,{onClick:l}),s&&t($e,{status:Ie.Warning,message:s.message,action:s.onViewRule?{"data-id":"sampling-view-edit-btn-view-duplicate",label:"View rule",onClick:s.onViewRule}:void 0}),t(Wd,{}),t(re,{"data-id":"sampling-view-edit-btn-cancel",label:Cn,variant:de.Secondary,size:ce.S,onClick:a}),t(re,{"data-id":"sampling-view-edit-btn-save",label:Sn,variant:de.Primary,size:ce.S,onClick:i,disabled:!!s})]})}}const{onDelete:a,onCancel:i,onEdit:l}=o;return{children:e(n,{children:[t(Kd,{onClick:a}),t(Wd,{}),t(re,{"data-id":"sampling-view-btn-cancel",label:Cn,variant:de.Secondary,size:ce.S,onClick:i}),t(re,{"data-id":"sampling-view-btn-edit",label:wn,variant:de.Primary,size:ce.S,onClick:l})]})}}const Jd={[Pl.EditAutoNoisy]:{title:Pn,subTitle:Dn,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[Pl.EditAutoCostReduction]:{title:Rn,subTitle:On,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[Pl.EditAutoHighlyRelevant]:{title:Nn,subTitle:An,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},qd=({isOpen:e,title:n,subTitle:o,onClose:a,footer:i,renderBody:l})=>t(ne,{isOpen:e,width:Ln,header:{icon:ji,title:n,subTitle:o,onClose:a},footer:i,children:l?l():t(Tt,{$padding:"12px",children:t(Zs,{})})}),Zd=({isOpen:e,onClose:n,onSubmit:a,validateForm:i,onNavigateToDuplicate:s})=>{const{category:r,formData:c,resetForm:d,duplicateWarning:u,setDuplicateWarning:p}=Dl(Pl.Create);o(()=>{e&&d()},[e]);const h=l(()=>{if(i){const e=i(c);if(e)return void p(e)}a(c)},[c,a,i,p]),m={note:u?{status:Ie.Warning,message:u.message,action:s?{"data-id":"sampling-create-btn-view-duplicate",label:"View rule",onClick:()=>s(u.ruleId)}:void 0}:void 0,actions:[{"data-id":"sampling-create-btn-cancel",label:Cn,variant:de.Secondary,size:ce.S,onClick:n},{"data-id":"sampling-create-btn-submit",label:In,variant:de.Primary,size:ce.S,onClick:h,disabled:!!u}]};return t(qd,{isOpen:e,title:En[r],subTitle:kn[r],onClose:n,footer:m})},Qd=({onClose:e,onDelete:n,onSaveEdit:o,validateForm:i,onNavigateToDuplicate:s})=>{const{data:r,isEditing:c,formData:d,handleEdit:u,handleCancelEdit:p,duplicateWarning:h,setDuplicateWarning:m}=Dl(Pl.View),g=r?.rule.name||$n,f=c&&r?Tn[r.category]:`${g} preview`,b=l(()=>{if(r&&c){if(i){const e=i(d);if(e)return void m(e)}o(d,r.rule.ruleId,r.samplingId)}},[r,c,d,o,i,m]),v=l(()=>{r&&n(r.rule.ruleId,r.samplingId)},[r,n]),y=a(()=>{if(!r)return;const t=h?{message:h.message,onViewRule:s?()=>s(h.ruleId):void 0}:null;return Yd(c?{isEditing:!0,onCancelEdit:p,onSave:b,onDelete:v,duplicateWarning:t}:{isEditing:!1,onDelete:v,onCancel:e,onEdit:u})},[r,c,h,p,b,v,u,e,s]);return t(qd,{isOpen:!!r,title:f,subTitle:r?kn[r.category]:"",onClose:e,footer:y})},eu=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:a,resolvedPercentage:i}=Dl(Pl.EditAutoNoisy),s=l(()=>o(a,i),[o,a,i]);return t(ou,{formType:Pl.EditAutoNoisy,isOpen:e,onClose:n,onSave:s})},tu=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:a,resolvedPercentage:i}=Dl(Pl.EditAutoCostReduction),s=l(()=>o(a,i),[o,a,i]);return t(ou,{formType:Pl.EditAutoCostReduction,isOpen:e,onClose:n,onSave:s})},nu=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:a}=Dl(Pl.EditAutoHighlyRelevant),i=l(()=>o(a),[o,a]);return t(ou,{formType:Pl.EditAutoHighlyRelevant,isOpen:e,onClose:n,onSave:i})},ou=({formType:e,isOpen:n,onClose:o,onSave:a})=>{const i=Jd[e];return t(qd,{isOpen:n,title:i.title,subTitle:i.subTitle,onClose:o,footer:{actions:[{"data-id":i.cancelId,label:Cn,variant:de.Secondary,size:ce.S,onClick:o},{"data-id":i.saveId,label:Fn,variant:de.Primary,size:ce.S,onClick:a}]}})},au=e=>{switch(e.formType){case Pl.Create:return t(Bl,{formType:Pl.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(Zd,{...e})});case Pl.View:return t(Bl,{formType:Pl.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(Qd,{...e})});case Pl.EditAutoNoisy:return t(Bl,{formType:Pl.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(eu,{...e})});case Pl.EditAutoCostReduction:return t(Bl,{formType:Pl.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(tu,{...e})});case Pl.EditAutoHighlyRelevant:return t(Bl,{formType:Pl.EditAutoHighlyRelevant,enabled:e.enabled,children:t(nu,{...e})})}},iu=({token:o,isLoading:a,isEditing:i,onEdit:l,onCancel:s,onSave:r,formData:c,handleFormChange:d,handleErrorChange:u,formErrors:p})=>{const{CopyButton:h}=sn(),m=!i||a||!c.newToken;return _n({key:"Enter",active:!m},r),e(se,i?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(be,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),u("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:p.newToken}),t(se,{$margin:a?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:a?t(ct,{title:"Saving...",withGradient:!0}):e(n,{children:[t(re,{variant:de.Secondary,size:ce.S,leftIcon:wi,onClick:s,disabled:a}),t(re,{variant:de.Primary,size:ce.S,leftIcon:Si,onClick:r,disabled:m})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(ae,{size:le.XS,children:new Array(55).fill("•").join("")}),e(se,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:o}),t(st,{icon:hi,onClick:l})]})]})},lu=({expiresAt:e,callbackValid:n,callbackExpired:i})=>{const{formatTimeAgo:l}=zt(),s=a(()=>l(e),[e,l]),r=a(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=a(()=>Mn(e,0)?Ie.Error:Mn(e,2592e6)?Ie.Warning:Ie.Success,[e]),d=a(()=>c===Ie.Success?Si:c===Ie.Warning?Wi:Oi,[c]);return o(()=>{c===Ie.Success?n():c===Ie.Error&&i()},[c]),t(De,{text:r,children:t(Be,{leftIcon:d,label:s,status:c,invertColors:!0,useSecondaryTone:!0})})},su=g.div`
405
+ `,wu=({onClick:n})=>{const o=f().v2.colors.red[500];return e(Cu,{"data-id":"sampling-view-btn-delete",onClick:n,children:[t(se,{size:de.XS,weight:500,color:o,children:Nn}),t(bi,{size:16,fill:o})]})};function xu(o){if(o.isEditing){const{onCancelEdit:a,onSave:i,onDelete:l,duplicateWarning:r}=o;return{children:e(n,{children:[t(wu,{onClick:l}),r&&t(De,{status:Pe.Warning,message:r.message,action:r.onViewRule?{"data-id":"sampling-view-edit-btn-view-duplicate",label:"View rule",onClick:r.onViewRule}:void 0}),t(Su,{}),t(pe,{"data-id":"sampling-view-edit-btn-cancel",label:In,variant:me.Secondary,size:he.S,onClick:a}),t(pe,{"data-id":"sampling-view-edit-btn-save",label:En,variant:me.Primary,size:he.S,onClick:i,disabled:!!r})]})}}const{onDelete:a,onCancel:i,onEdit:l}=o;return{children:e(n,{children:[t(wu,{onClick:a}),t(Su,{}),t(pe,{"data-id":"sampling-view-btn-cancel",label:In,variant:me.Secondary,size:he.S,onClick:i}),t(pe,{"data-id":"sampling-view-btn-edit",label:An,variant:me.Primary,size:he.S,onClick:l})]})}}const ku={[Gl.EditAutoNoisy]:{title:jn,subTitle:Un,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[Gl.EditAutoCostReduction]:{title:Vn,subTitle:Xn,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[Gl.EditAutoHighlyRelevant]:{title:Bn,subTitle:zn,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},Tu=({isOpen:e,title:n,subTitle:o,onClose:a,footer:i,renderBody:l})=>t(le,{isOpen:e,width:Hn,header:{icon:ol,title:n,subTitle:o,onClose:a},footer:i,children:l?l():t(ut,{$padding:"12px",children:t(xs,{})})}),$u=({isOpen:i,onClose:s,onSubmit:c,validateForm:d,onNavigateToDuplicate:u})=>{const{category:p,formData:h,resetForm:m,duplicateWarning:g,setDuplicateWarning:f}=jl(Gl.Create),[b,y]=r(!1);o(()=>{i&&(m(),y(!1))},[i]);const v=l(()=>{y(!1),c(h)},[h,c]),C=l(()=>{if(d){const e=d(h);if(e)return void f(e)}!function(e,t){return JSON.stringify(e)===JSON.stringify(T(t))}(h,p)?v():y(!0)},[h,p,d,f,v]),S=a(()=>b?function(e,t){switch(e){case"noisy":return w(E(t));case"highlyRelevant":return x(I(t));case"costReduction":return k($(t))}}(p,h):[],[b,p,h]),A={note:g?{status:Pe.Warning,message:g.message,action:u?{"data-id":"sampling-create-btn-view-duplicate",label:"View rule",onClick:()=>u(g.ruleId)}:void 0}:void 0,actions:[{"data-id":"sampling-create-btn-cancel",label:In,variant:me.Secondary,size:he.S,onClick:s},{"data-id":"sampling-create-btn-submit",label:Tn,variant:me.Primary,size:he.S,onClick:C,disabled:!!g}]};return e(n,{children:[t(Tu,{isOpen:i,title:Pn[p],subTitle:On[p],onClose:s,footer:A}),t(Je,{isOpen:b,title:Mn,description:Ln,onClose:()=>y(!1),denyButton:{"data-id":"sampling-create-default-continue-editing",label:Fn,variant:me.Secondary,onClick:()=>y(!1)},approveButton:{"data-id":"sampling-create-default-confirm",label:Tn,variant:me.Primary,onClick:v},children:e(q,{$gap:8,$alignItems:"flex-start",style:{width:"100%"},children:[t(se,{size:de.XS,weight:500,color:ce.Secondary,children:_n}),t("div",{style:{width:"100%"},children:t(wl,{summary:S})})]})})]})},Iu=({onClose:e,onDelete:n,onSaveEdit:o,validateForm:i,onNavigateToDuplicate:r})=>{const{data:s,isEditing:c,formData:d,handleEdit:u,handleCancelEdit:p,duplicateWarning:h,setDuplicateWarning:m}=jl(Gl.View),g=s?.rule.name||Dn,f=c&&s?Rn[s.category]:`${g} preview`,b=l(()=>{if(s&&c){if(i){const e=i(d);if(e)return void m(e)}o(d,s.rule.ruleId,s.samplingId),p()}},[s,c,d,o,i,m,p]),y=l(()=>{s&&n(s.rule.ruleId,s.samplingId)},[s,n]),v=a(()=>{if(!s)return;const t=h?{message:h.message,onViewRule:r?()=>r(h.ruleId):void 0}:null;return xu(c?{isEditing:!0,onCancelEdit:p,onSave:b,onDelete:y,duplicateWarning:t}:{isEditing:!1,onDelete:y,onCancel:e,onEdit:u})},[s,c,h,p,b,y,u,e,r]);return t(Tu,{isOpen:!!s,title:f,subTitle:s?On[s.category]:"",onClose:e,footer:v})},Eu=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:a,resolvedPercentage:i}=jl(Gl.EditAutoNoisy),r=l(()=>o(a,i),[o,a,i]);return t(Ou,{formType:Gl.EditAutoNoisy,isOpen:e,onClose:n,onSave:r})},Au=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:a,resolvedPercentage:i}=jl(Gl.EditAutoCostReduction),r=l(()=>o(a,i),[o,a,i]);return t(Ou,{formType:Gl.EditAutoCostReduction,isOpen:e,onClose:n,onSave:r})},Nu=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:a}=jl(Gl.EditAutoHighlyRelevant),i=l(()=>o(a),[o,a]);return t(Ou,{formType:Gl.EditAutoHighlyRelevant,isOpen:e,onClose:n,onSave:i})},Ou=({formType:e,isOpen:n,onClose:o,onSave:a})=>{const i=ku[e];return t(Tu,{isOpen:n,title:i.title,subTitle:i.subTitle,onClose:o,footer:{actions:[{"data-id":i.cancelId,label:In,variant:me.Secondary,size:he.S,onClick:o},{"data-id":i.saveId,label:Gn,variant:me.Primary,size:he.S,onClick:a}]}})},Ru=e=>{switch(e.formType){case Gl.Create:return t(ql,{formType:Gl.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t($u,{...e})});case Gl.View:return t(ql,{formType:Gl.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(Iu,{...e})});case Gl.EditAutoNoisy:return t(ql,{formType:Gl.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(Eu,{...e})});case Gl.EditAutoCostReduction:return t(ql,{formType:Gl.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(Au,{...e})});case Gl.EditAutoHighlyRelevant:return t(ql,{formType:Gl.EditAutoHighlyRelevant,enabled:e.enabled,children:t(Nu,{...e})})}},Du=({token:o,isLoading:a,isEditing:i,onEdit:l,onCancel:r,onSave:s,formData:c,handleFormChange:d,handleErrorChange:u,formErrors:p})=>{const{CopyButton:h}=hn(),m=!i||a||!c.newToken;return Wn({key:"Enter",active:!m},s),e(ue,i?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(Se,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),u("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:p.newToken}),t(ue,{$margin:a?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:a?t(yt,{title:"Saving...",withGradient:!0}):e(n,{children:[t(pe,{variant:me.Secondary,size:he.S,leftIcon:Di,onClick:r,disabled:a}),t(pe,{variant:me.Primary,size:he.S,leftIcon:Ri,onClick:s,disabled:m})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(se,{size:de.XS,children:new Array(55).fill("•").join("")}),e(ue,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:o}),t(ft,{icon:ki,onClick:l})]})]})},Pu=({expiresAt:e,callbackValid:n,callbackExpired:i})=>{const{formatTimeAgo:l}=Ht(),r=a(()=>l(e),[e,l]),s=a(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=a(()=>Kn(e,0)?Pe.Error:Kn(e,2592e6)?Pe.Warning:Pe.Success,[e]),d=a(()=>c===Pe.Success?Ri:c===Pe.Warning?al:Vi,[c]);return o(()=>{c===Pe.Success?n():c===Pe.Error&&i()},[c]),t($e,{text:s,children:t(We,{leftIcon:d,label:r,status:c,invertColors:!0,useSecondaryTone:!0})})},Fu=g.div`
393
406
  display: flex;
394
407
  flex-direction: column;
395
408
  gap: 12px;
@@ -397,7 +410,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
397
410
  border-radius: 12px;
398
411
  border: 1px solid ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[500]:e.v2.colors.silver[600]};
399
412
  background-color: ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[1e3]:e.v2.colors.silver[800]};
400
- `,ru=({children:e})=>{const n=f();return t(ae,{size:le.XXXS,color:n.v2.colors.grey[150],children:e})},cu=({token:n})=>{const{tokensApi:o}=ll(),[a,i]=s(!1),[l,r]=s(!1),[c,d]=s(!1),{formData:u,handleFormChange:p,formErrors:h,handleErrorChange:m,resetFormData:g}=At({newToken:""});return t(et,{richTitle:{icon:Ki,title:"Odigos Pro Token"},children:e(su,{$isExpired:c,children:[e(se,{$justifyContent:"space-between",children:[e(W,{$gap:4,children:[t(ru,{children:"Issued for"}),t(ae,{size:le.XS,children:n.name||"N/A"})]}),e(W,{$gap:4,children:[t(ru,{children:"Expiration"}),t(lu,{expiresAt:n.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(W,{})]}),t(se,{children:e(W,{children:[t(ru,{children:"Token"}),t(iu,{token:n.token,newToken:u.newToken,isLoading:a,isEditing:l,onEdit:()=>r(!0),onCancel:()=>(r(!1),void p("newToken","")),onSave:()=>(async()=>{if(!o.updateToken)return;i(!0);const e=await o.updateToken(u.newToken.trim());i(!1),e?.error?m("newToken",e.error):(r(!1),g())})(),formData:u,handleFormChange:p,handleErrorChange:m,formErrors:h})]})})]})})},du=g.div`
413
+ `,Lu=({children:e})=>{const n=f();return t(se,{size:de.XXXS,color:n.v2.colors.grey[150],children:e})},Mu=({token:n})=>{const{tokensApi:o}=bl(),[a,i]=r(!1),[l,s]=r(!1),[c,d]=r(!1),{formData:u,handleFormChange:p,formErrors:h,handleErrorChange:m,resetFormData:g}=Mt({newToken:""});return t(rt,{richTitle:{icon:il,title:"Odigos Pro Token"},children:e(Fu,{$isExpired:c,children:[e(ue,{$justifyContent:"space-between",children:[e(q,{$gap:4,children:[t(Lu,{children:"Issued for"}),t(se,{size:de.XS,children:n.name||"N/A"})]}),e(q,{$gap:4,children:[t(Lu,{children:"Expiration"}),t(Pu,{expiresAt:n.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(q,{})]}),t(ue,{children:e(q,{children:[t(Lu,{children:"Token"}),t(Du,{token:n.token,newToken:u.newToken,isLoading:a,isEditing:l,onEdit:()=>s(!0),onCancel:()=>(s(!1),void p("newToken","")),onSave:()=>(async()=>{if(!o.updateToken)return;i(!0);const e=await o.updateToken(u.newToken.trim());i(!1),e?.error?m("newToken",e.error):(s(!1),g())})(),formData:u,handleFormChange:p,handleErrorChange:m,formErrors:h})]})})]})})},_u=g.div`
401
414
  display: flex;
402
415
  flex-direction: column;
403
416
  align-items: center;
@@ -406,23 +419,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
406
419
  padding: 12px 24px;
407
420
  border-radius: 8px;
408
421
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
409
- `,uu=()=>{const{progress:n}=yt(),{describeApi:o,namespacesApi:a}=ll(),{items:i}=a.useNamespaces(),[l,r]=s(null),{formData:c,handleFormChange:d,resetFormData:u}=At({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(et,{richTitle:{icon:Yi,title:"Diagnose"},children:l?e(du,{children:[t(ct,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof n[wt.DownloadingDiagnose]?.percentage,percentage:n[wt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof n[wt.DownloadingDiagnose]?.percentage,visualIcon:Ui,startedAt:l}),n[wt.DownloadingDiagnose]?.list?.length&&t(W,{$width:"100%",children:n[wt.DownloadingDiagnose].list.map((n,o)=>e(se,{$gap:4,$alignItems:"center",children:[n.status===Ie.Success?t(Si,{size:16}):n.status===Ie.Error?t(wi,{size:16}):t(ct,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(ae,{size:le.XXXS,color:ie.Secondary,children:n.label})]},`diagnose-item-${o}-${n.label}`))})]}):e(W,{$gap:24,children:[t(ae,{size:le.XXS,color:ie.Secondary,children:"Download a tar.gz file with diagnostics from this cluster. Select which data to include before downloading, and share the file with the Odigos support team for troubleshooting."}),e(W,{$gap:16,children:[e(se,{$gap:8,children:[t(Y,{label:"Profiles",value:c.includeProfiles,onChange:e=>d("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(ae,{size:le.XXXS,color:ie.Secondary,children:"Include pprof profiles"})]}),e(se,{$gap:8,children:[t(Y,{label:"Metrics",value:c.includeMetrics,onChange:e=>d("includeMetrics",e)}),t(ae,{size:le.XXXS,color:ie.Secondary,children:"Include Prometheus metrics"})]}),e(se,{$gap:8,children:[t(Y,{label:"Source Workloads",value:c.includeSourceWorkloads,onChange:e=>{d("includeSourceWorkloads",e),e&&d("sourceWorkloadNamespaces",[])}}),t(ae,{size:le.XXXS,color:ie.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(zn,{alignX:Xn.Left,alignY:Bn.Bottom,items:i.map(e=>({id:e.name,label:e.name,withCheckbox:!0})),selectedIds:c.sourceWorkloadNamespaces,setSelectedIds:e=>d("sourceWorkloadNamespaces",e),withMultiSelect:!0,withSearch:!0,fullWidth:!0,buttonProps:{label:(c.sourceWorkloadNamespaces.length?"Selected":"Select")+" Namespaces",variant:de.Secondary,disabled:c.includeSourceWorkloads,leftIcon:c.sourceWorkloadNamespaces.length?()=>t(Be,{label:c.sourceWorkloadNamespaces.length,status:Ie.Default}):void 0}}),t(se,{$justifyContent:"flex-end",children:t(re,{label:"Download Diagnose",rightIcon:Ui,variant:de.Primary,onClick:async()=>{o.downloadDiagnose&&(r(Date.now()),await o.downloadDiagnose(c),r(null),u())},disabled:null!==l})})]})})},pu=()=>{const{platformType:e,version:n,tier:a}=y(),{describeApi:i}=ll(),[l,r]=s(null);return o(()=>{i.fetchDescribeOdigos&&i.fetchDescribeOdigos().then(({data:e})=>r(e?.describeOdigos??null))},[]),t(et,{richTitle:{icon:Li,title:"General Information"},children:t($t,{cellsPerRow:2,items:[{id:Vn(),title:"Odigos Version",label:n},{id:Vn(),title:`${e.toUpperCase()} Version`,label:l?.kubernetesVersion?.value||"-"},{id:Vn(),title:"Installation Method",label:l?.installationMethod?.value||"-"},{id:Vn(),title:"Tier",label:a}]})})},hu=({isOpen:n,onClose:o})=>{const{describeApi:a,tokensApi:i}=ll(),l=i.useTokens().items[0];return e(ne,{isOpen:n,header:{icon:Li,title:"System Overview",onClose:o},children:[a.fetchDescribeOdigos&&t(pu,{}),i.updateToken&&l&&t(cu,{token:l}),a.downloadDiagnose&&t(uu,{})]})},mu=({isOpen:o,onClose:a,onCloseEnd:i})=>{const{addDataStreams:s,setSelectedStreamName:r}=He(),{dataStreamsApi:c}=ll(),{requestSubmit:d}=Ol(),u=l(async e=>{c.create?await c.create(e):(s([e]),r(e.name)),a()},[c,s,r,a]),p=l(()=>d(u),[d,u]);return _n({key:"Enter",active:o},p),e(n,{children:[t(Ue,{isOpen:o,onClose:a,onCloseEnd:i,title:Ge.NAME_YOUR_STREAM,description:Ge.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:kt.DONE,variant:de.Primary,onClick:p},denyButton:{"data-id":"add-stream-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:a},children:t(Hs,{autoFocus:!0})}),t(Gs,{})]})},gu=({isOpen:a,onClose:i,onCloseEnd:s,dataStreamName:r})=>{const{dataStreamsApi:c}=ll(),{genericForm:d,loadDataStream:u,requestSubmit:p}=Ol();o(()=>{a&&r&&u(r)},[a,r]);const h=!!d?.isFormDirty,m=l(async e=>{await c.update(r,e),i()},[c,r,i]),g=l(()=>p(m),[p,m]);return _n({key:"Enter",active:a},g),e(n,{children:[t(Ue,{isOpen:a,onClose:i,onCloseEnd:s,title:Ge.RENAME_STREAM(r),description:Ge.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:kt.SAVE,variant:de.Primary,onClick:g,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:i},children:t(Hs,{autoFocus:!0})}),t(Gs,{})]})},fu=({scale:n=1})=>e("svg",{width:742*n,height:533*n,viewBox:"0 0 742 533",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M0 0H722C733.046 0 742 8.95431 742 20V513C742 524.046 733.046 533 722 533H0V0Z",fill:"url(#paint0_linear_1585_55266)"}),e("g",{clipPath:"url(#clip0_1585_55266)",children:[t("path",{opacity:"0.1",d:"M817.963 1364.02C1052.53 1129.46 1052.53 749.151 817.96 514.585C583.394 280.019 203.089 280.018 -31.4751 514.583C-266.039 749.147 -266.038 1129.45 -31.4725 1364.02C203.093 1598.58 583.398 1598.58 817.963 1364.02Z",fill:"url(#paint1_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M789.266 1335.32C1007.98 1116.61 1007.98 761.998 789.264 543.281C570.547 324.565 215.938 324.563 -2.7781 543.279C-221.494 761.995 -221.493 1116.6 -2.77577 1335.32C215.941 1554.04 570.55 1554.04 789.266 1335.32Z",fill:"url(#paint2_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M736.156 1282.21C925.539 1092.83 925.538 785.776 736.153 596.392C546.769 407.007 239.717 407.006 50.333 596.39C-139.05 785.773 -139.05 1092.83 50.3351 1282.21C239.72 1471.59 546.772 1471.6 736.156 1282.21Z",fill:"url(#paint3_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M628.365 1174.42C758.218 1044.57 758.217 834.036 628.364 704.182C498.51 574.329 287.977 574.328 158.124 704.181C28.2713 834.033 28.272 1044.57 158.125 1174.42C287.979 1304.27 498.512 1304.27 628.365 1174.42Z",fill:"url(#paint4_radial_1585_55266)"}),t("path",{opacity:"0.1",d:"M795.717 29.8993C1030.28 -204.665 1030.28 -584.97 795.714 -819.536C561.148 -1054.1 180.843 -1054.1 -53.7211 -819.539C-288.285 -584.974 -288.284 -204.669 -53.7185 29.8967C180.847 264.462 561.152 264.464 795.717 29.8993Z",fill:"url(#paint5_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M767.02 1.20219C985.736 -217.513 985.734 -572.123 767.017 -790.84C548.301 -1009.56 193.691 -1009.56 -25.0242 -790.842C-243.74 -572.126 -243.739 -217.517 -25.0219 1.19982C193.695 219.917 548.304 219.918 767.02 1.20219Z",fill:"url(#paint6_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M713.909 -51.908C903.293 -241.292 903.292 -548.344 713.907 -737.728C524.523 -927.113 217.47 -927.114 28.0869 -737.731C-161.297 -548.347 -161.296 -241.295 28.089 -51.91C217.474 137.475 524.526 137.476 713.909 -51.908Z",fill:"url(#paint7_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M606.119 -159.699C735.972 -289.552 735.971 -500.085 606.118 -629.939C476.264 -759.792 265.731 -759.793 135.878 -629.94C6.0252 -500.088 6.02586 -289.554 135.879 -159.701C265.733 -29.8472 476.266 -29.8465 606.119 -159.699Z",fill:"url(#paint8_radial_1585_55266)"})]}),e("defs",{children:[e("linearGradient",{id:"paint0_linear_1585_55266",x1:"371",y1:"0",x2:"371",y2:"533",gradientUnits:"userSpaceOnUse",children:[t("stop",{offset:"0.028197",stopColor:"#0B0517"}),t("stop",{offset:"1",stopColor:"#190D31"})]}),e("radialGradient",{id:"paint1_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(334.074 991.405) rotate(-45) scale(599.732 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint2_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(368.968 957.913) rotate(-45) scale(560.978 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint3_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(351.265 971.313) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint4_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(362.239 963.064) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint5_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(311.828 -342.716) rotate(-45) scale(599.733 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint6_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(346.722 -376.208) rotate(-45) scale(560.977 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint7_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(329.019 -362.807) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint8_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(339.993 -371.057) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),t("clipPath",{id:"clip0_1585_55266",children:t("rect",{width:"929.477",height:"667",fill:"white",transform:"translate(-93.7383 -134)"})})]})]}),bu=g.div`
422
+ `,zu=()=>{const{progress:n}=It(),{describeApi:o,namespacesApi:a}=bl(),{items:i}=a.useNamespaces(),[l,s]=r(null),{formData:c,handleFormChange:d,resetFormData:u}=Mt({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(rt,{richTitle:{icon:ll,title:"Diagnose"},children:l?e(_u,{children:[t(yt,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof n[Nt.DownloadingDiagnose]?.percentage,percentage:n[Nt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof n[Nt.DownloadingDiagnose]?.percentage,visualIcon:el,startedAt:l}),n[Nt.DownloadingDiagnose]?.list?.length&&t(q,{$width:"100%",children:n[Nt.DownloadingDiagnose].list.map((n,o)=>e(ue,{$gap:4,$alignItems:"center",children:[n.status===Pe.Success?t(Ri,{size:16}):n.status===Pe.Error?t(Di,{size:16}):t(yt,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(se,{size:de.XXXS,color:ce.Secondary,children:n.label})]},`diagnose-item-${o}-${n.label}`))})]}):e(q,{$gap:24,children:[t(se,{size:de.XXS,color:ce.Secondary,children:"Download a tar.gz file with diagnostics from this cluster. Select which data to include before downloading, and share the file with the Odigos support team for troubleshooting."}),e(q,{$gap:16,children:[e(ue,{$gap:8,children:[t(Q,{label:"Profiles",value:c.includeProfiles,onChange:e=>d("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(se,{size:de.XXXS,color:ce.Secondary,children:"Include pprof profiles"})]}),e(ue,{$gap:8,children:[t(Q,{label:"Metrics",value:c.includeMetrics,onChange:e=>d("includeMetrics",e)}),t(se,{size:de.XXXS,color:ce.Secondary,children:"Include Prometheus metrics"})]}),e(ue,{$gap:8,children:[t(Q,{label:"Source Workloads",value:c.includeSourceWorkloads,onChange:e=>{d("includeSourceWorkloads",e),e&&d("sourceWorkloadNamespaces",[])}}),t(se,{size:de.XXXS,color:ce.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(Yn,{alignX:qn.Left,alignY:Jn.Bottom,items:i.map(e=>({id:e.name,label:e.name,withCheckbox:!0})),selectedIds:c.sourceWorkloadNamespaces,setSelectedIds:e=>d("sourceWorkloadNamespaces",e),withMultiSelect:!0,withSearch:!0,fullWidth:!0,buttonProps:{label:(c.sourceWorkloadNamespaces.length?"Selected":"Select")+" Namespaces",variant:me.Secondary,disabled:c.includeSourceWorkloads,leftIcon:c.sourceWorkloadNamespaces.length?()=>t(We,{label:c.sourceWorkloadNamespaces.length,status:Pe.Default}):void 0}}),t(ue,{$justifyContent:"flex-end",children:t(pe,{label:"Download Diagnose",rightIcon:el,variant:me.Primary,onClick:async()=>{o.downloadDiagnose&&(s(Date.now()),await o.downloadDiagnose(c),s(null),u())},disabled:null!==l})})]})})},Bu=()=>{const{platformType:e,version:n,tier:a}=v(),{describeApi:i}=bl(),[l,s]=r(null);return o(()=>{i.fetchDescribeOdigos&&i.fetchDescribeOdigos().then(({data:e})=>s(e?.describeOdigos??null))},[]),t(rt,{richTitle:{icon:Wi,title:"General Information"},children:t(Pt,{cellsPerRow:2,items:[{id:Zn(),title:"Odigos Version",label:n},{id:Zn(),title:`${e.toUpperCase()} Version`,label:l?.kubernetesVersion?.value||"-"},{id:Zn(),title:"Installation Method",label:l?.installationMethod?.value||"-"},{id:Zn(),title:"Tier",label:a}]})})},Xu=({isOpen:n,onClose:o})=>{const{describeApi:a,tokensApi:i}=bl(),l=i.useTokens().items[0];return e(le,{isOpen:n,header:{icon:Wi,title:"System Overview",onClose:o},children:[a.fetchDescribeOdigos&&t(Bu,{}),i.updateToken&&l&&t(Mu,{token:l}),a.downloadDiagnose&&t(zu,{})]})},Vu=({isOpen:o,onClose:a,onCloseEnd:i})=>{const{addDataStreams:r,setSelectedStreamName:s}=Ze(),{dataStreamsApi:c}=bl(),{requestSubmit:d}=Vl(),u=l(async e=>{c.create?await c.create(e):(r([e]),s(e.name)),a()},[c,r,s,a]),p=l(()=>d(u),[d,u]);return Wn({key:"Enter",active:o},p),e(n,{children:[t(Je,{isOpen:o,onClose:a,onCloseEnd:i,title:qe.NAME_YOUR_STREAM,description:qe.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:Dt.DONE,variant:me.Primary,onClick:p},denyButton:{"data-id":"add-stream-btn-cancel",label:Dt.CANCEL,variant:me.Secondary,onClick:a},children:t(fs,{autoFocus:!0})}),t(gs,{})]})},Uu=({isOpen:a,onClose:i,onCloseEnd:r,dataStreamName:s})=>{const{dataStreamsApi:c}=bl(),{genericForm:d,loadDataStream:u,requestSubmit:p}=Vl();o(()=>{a&&s&&u(s)},[a,s]);const h=!!d?.isFormDirty,m=l(async e=>{await c.update(s,e),i()},[c,s,i]),g=l(()=>p(m),[p,m]);return Wn({key:"Enter",active:a},g),e(n,{children:[t(Je,{isOpen:a,onClose:i,onCloseEnd:r,title:qe.RENAME_STREAM(s),description:qe.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:Dt.SAVE,variant:me.Primary,onClick:g,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:Dt.CANCEL,variant:me.Secondary,onClick:i},children:t(fs,{autoFocus:!0})}),t(gs,{})]})},ju=({scale:n=1})=>e("svg",{width:742*n,height:533*n,viewBox:"0 0 742 533",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M0 0H722C733.046 0 742 8.95431 742 20V513C742 524.046 733.046 533 722 533H0V0Z",fill:"url(#paint0_linear_1585_55266)"}),e("g",{clipPath:"url(#clip0_1585_55266)",children:[t("path",{opacity:"0.1",d:"M817.963 1364.02C1052.53 1129.46 1052.53 749.151 817.96 514.585C583.394 280.019 203.089 280.018 -31.4751 514.583C-266.039 749.147 -266.038 1129.45 -31.4725 1364.02C203.093 1598.58 583.398 1598.58 817.963 1364.02Z",fill:"url(#paint1_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M789.266 1335.32C1007.98 1116.61 1007.98 761.998 789.264 543.281C570.547 324.565 215.938 324.563 -2.7781 543.279C-221.494 761.995 -221.493 1116.6 -2.77577 1335.32C215.941 1554.04 570.55 1554.04 789.266 1335.32Z",fill:"url(#paint2_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M736.156 1282.21C925.539 1092.83 925.538 785.776 736.153 596.392C546.769 407.007 239.717 407.006 50.333 596.39C-139.05 785.773 -139.05 1092.83 50.3351 1282.21C239.72 1471.59 546.772 1471.6 736.156 1282.21Z",fill:"url(#paint3_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M628.365 1174.42C758.218 1044.57 758.217 834.036 628.364 704.182C498.51 574.329 287.977 574.328 158.124 704.181C28.2713 834.033 28.272 1044.57 158.125 1174.42C287.979 1304.27 498.512 1304.27 628.365 1174.42Z",fill:"url(#paint4_radial_1585_55266)"}),t("path",{opacity:"0.1",d:"M795.717 29.8993C1030.28 -204.665 1030.28 -584.97 795.714 -819.536C561.148 -1054.1 180.843 -1054.1 -53.7211 -819.539C-288.285 -584.974 -288.284 -204.669 -53.7185 29.8967C180.847 264.462 561.152 264.464 795.717 29.8993Z",fill:"url(#paint5_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M767.02 1.20219C985.736 -217.513 985.734 -572.123 767.017 -790.84C548.301 -1009.56 193.691 -1009.56 -25.0242 -790.842C-243.74 -572.126 -243.739 -217.517 -25.0219 1.19982C193.695 219.917 548.304 219.918 767.02 1.20219Z",fill:"url(#paint6_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M713.909 -51.908C903.293 -241.292 903.292 -548.344 713.907 -737.728C524.523 -927.113 217.47 -927.114 28.0869 -737.731C-161.297 -548.347 -161.296 -241.295 28.089 -51.91C217.474 137.475 524.526 137.476 713.909 -51.908Z",fill:"url(#paint7_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M606.119 -159.699C735.972 -289.552 735.971 -500.085 606.118 -629.939C476.264 -759.792 265.731 -759.793 135.878 -629.94C6.0252 -500.088 6.02586 -289.554 135.879 -159.701C265.733 -29.8472 476.266 -29.8465 606.119 -159.699Z",fill:"url(#paint8_radial_1585_55266)"})]}),e("defs",{children:[e("linearGradient",{id:"paint0_linear_1585_55266",x1:"371",y1:"0",x2:"371",y2:"533",gradientUnits:"userSpaceOnUse",children:[t("stop",{offset:"0.028197",stopColor:"#0B0517"}),t("stop",{offset:"1",stopColor:"#190D31"})]}),e("radialGradient",{id:"paint1_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(334.074 991.405) rotate(-45) scale(599.732 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint2_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(368.968 957.913) rotate(-45) scale(560.978 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint3_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(351.265 971.313) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint4_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(362.239 963.064) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint5_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(311.828 -342.716) rotate(-45) scale(599.733 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint6_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(346.722 -376.208) rotate(-45) scale(560.977 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint7_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(329.019 -362.807) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint8_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(339.993 -371.057) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),t("clipPath",{id:"clip0_1585_55266",children:t("rect",{width:"929.477",height:"667",fill:"white",transform:"translate(-93.7383 -134)"})})]})]}),Gu=g.div`
410
423
  position: absolute;
411
424
  top: 50%;
412
425
  left: 50%;
413
426
  transform: translate(-50%, -50%);
414
427
  z-index: ${({theme:e})=>e.v2.zIndex.modal};
415
- `,vu="onboarding-done",yu=()=>{const{currentModal:n,setCurrentModal:o}=Un(),a=()=>o("");return e(Gn,{isOpen:n===vu,onClose:a,children:[t(fu,{}),t(bu,{children:e(W,{$gap:32,$alignItems:"center",children:[e(W,{$gap:24,$alignItems:"center",children:[t(ae,{size:le.L,weight:500,children:"Welcome to"}),t(kl,{size:260}),t(ae,{size:le.S,weight:400,children:"Your observability control plane is ready."})]}),t(re,{label:"Get Started",rightIcon:ri,onClick:a})]})})]})},Cu=g.div`
428
+ `,Hu="onboarding-done",Wu=()=>{const{currentModal:n,setCurrentModal:o}=Qn(),a=()=>o("");return e(eo,{isOpen:n===Hu,onClose:a,children:[t(ju,{}),t(Gu,{children:e(q,{$gap:32,$alignItems:"center",children:[e(q,{$gap:24,$alignItems:"center",children:[t(se,{size:de.L,weight:500,children:"Welcome to"}),t(Fl,{size:260}),t(se,{size:de.S,weight:400,children:"Your observability control plane is ready."})]}),t(pe,{label:"Get Started",rightIcon:vi,onClick:a})]})})]})},Ku=g.div`
416
429
  display: flex;
417
430
  flex-direction: column;
418
431
  gap: 8px;
419
432
  padding: 4px 8px;
420
433
  border-radius: 8px;
421
434
  width: 100%;
422
- `,Su=g.div`
435
+ `,Yu=g.div`
423
436
  white-space: pre;
424
437
  overflow-x: auto;
425
- `,wu=({name:n,recommended:o,toggleLabel:a,enabled:i,onEnabledChange:l,summary:s,toggleName:r})=>{const c=f();return e(Cu,{children:[e(se,{$gap:8,$justifyContent:"space-between",children:[e(se,{$gap:4,children:[t(ae,{size:le.XS,color:c.v2.colors.white[500],nowrap:!0,children:n}),o&&t(Be,{label:Hn,leftIcon:Ji,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:le.XXXS})]}),t(Q,{name:r??`sampling-onboarding-toggle-${n}`,label:a,labelAlign:ee.Left,value:i,onChange:l,size:bt.S})]}),t(Su,{children:t(S,{parts:s})})]})},xu=g.div`
438
+ `,Ju=({name:n,recommended:o,toggleLabel:a,enabled:i,onEnabledChange:l,summary:r,toggleName:s})=>{const c=f();return e(Ku,{children:[e(ue,{$gap:8,$justifyContent:"space-between",children:[e(ue,{$gap:4,children:[t(se,{size:de.XS,color:c.v2.colors.white[500],nowrap:!0,children:n}),o&&t(We,{label:to,leftIcon:rl,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:de.XXXS})]}),t(oe,{name:s??`sampling-onboarding-toggle-${n}`,label:a,labelAlign:ae.Left,value:i,onChange:l,size:Tt.S})]}),t(Yu,{children:t(S,{parts:r})})]})},qu=g.div`
426
439
  position: relative;
427
440
  display: flex;
428
441
  align-items: center;
@@ -432,18 +445,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
432
445
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
433
446
  border-top-left-radius: 18px;
434
447
  border-top-right-radius: 18px;
435
- `,ku=g.div`
448
+ `,Zu=g.div`
436
449
  position: absolute;
437
450
  left: 16px;
438
451
  top: 50%;
439
452
  transform: translateY(-50%);
440
- `,Tu=g.div`
453
+ `,Qu=g.div`
441
454
  height: 16px;
442
455
  width: 100%;
443
456
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
444
457
  border-top-left-radius: 18px;
445
458
  border-top-right-radius: 18px;
446
- `,$u=g.div`
459
+ `,ep=g.div`
447
460
  width: ${({$width:e})=>e}px;
448
461
  display: flex;
449
462
  flex-direction: column;
@@ -451,7 +464,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
451
464
  gap: 22px;
452
465
  padding: 8px 32px 32px 32px;
453
466
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
454
- `,Iu=e=>t(qi,{rotate:90,...e}),Eu=({children:n,center:o,onNext:a,nextLabel:i=jn,nextLoading:l})=>e(se,{$gap:8,$justifyContent:o?"center":"flex-end",$padding:"0 16px 16px 16px",children:[n,a&&t(re,{"data-id":"sampling-onboarding-btn-next",label:i,rightIcon:Iu,variant:de.Primary,size:ce.M,onClick:a,loading:l})]}),Au=e=>t(qi,{rotate:-90,...e}),Nu=({title:n,onBack:o})=>{const a=f();return e(xu,{$hasBack:!!o,children:[o&&t(ku,{children:t(st,{"data-id":"sampling-onboarding-back",icon:Au,size:rt.M,onClick:o})}),t(ae,{size:le.M,weight:500,color:a.v2.colors.white[500],align:"center",children:n})]})},Ou=g.div`
467
+ `,tp=e=>t(sl,{rotate:90,...e}),np=({children:n,center:o,onNext:a,nextLabel:i=no,nextLoading:l})=>e(ue,{$gap:8,$justifyContent:o?"center":"flex-end",$padding:"0 16px 16px 16px",children:[n,a&&t(pe,{"data-id":"sampling-onboarding-btn-next",label:i,rightIcon:tp,variant:me.Primary,size:he.M,onClick:a,loading:l})]}),op=e=>t(sl,{rotate:-90,...e}),ap=({title:n,onBack:o})=>{const a=f();return e(qu,{$hasBack:!!o,children:[o&&t(Zu,{children:t(ft,{"data-id":"sampling-onboarding-back",icon:op,size:bt.M,onClick:o})}),t(se,{size:de.M,weight:500,color:a.v2.colors.white[500],align:"center",children:n})]})},ip=g.div`
455
468
  box-sizing: border-box;
456
469
  width: ${({$width:e})=>e??"100%"};
457
470
  ${({$fillHeight:e})=>e&&b`
@@ -464,16 +477,16 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
464
477
  padding: 16px;
465
478
  border-radius: 16px;
466
479
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
467
- `,Ru=({children:e,fillHeight:n,width:o})=>t(Ou,{$fillHeight:n,$width:o,children:e}),Du=g.ul`
480
+ `,lp=({children:e,fillHeight:n,width:o})=>t(ip,{$fillHeight:n,$width:o,children:e}),rp=g.ul`
468
481
  margin: 0;
469
482
  padding: 0;
470
483
  list-style: disc;
471
- `,Pu=g.li`
484
+ `,sp=g.li`
472
485
  margin-left: 18px;
473
486
  & + & {
474
487
  margin-top: 6px;
475
488
  }
476
- `,Fu=({items:e,color:n})=>{const o=f(),a=n||o.v2.colors.silver[200];return t(Du,{children:e.map((e,n)=>t(Pu,{style:{color:a},children:t(ae,{size:le.XXS,color:a,children:e})},n))})},Lu=({items:n})=>{const o=f();return t(W,{$gap:16,children:n.map((n,a)=>e(se,{$gap:8,$alignItems:"flex-start",children:[e(ae,{size:le.XS,color:o.v2.colors.silver[200],weight:400,children:[a+1,"."]}),e(W,{$gap:2,children:[t(ae,{size:le.XS,color:o.v2.colors.white[500],weight:500,children:n.title}),t(ae,{size:le.XS,color:o.v2.colors.silver[200],children:n.description})]})]},a))})},_u=({message:e})=>t($e,{status:Ie.Default,message:e,fullWidth:!0,smallIcon:!0}),Mu=g.div`
489
+ `,cp=({items:e,color:n})=>{const o=f(),a=n||o.v2.colors.silver[200];return t(rp,{children:e.map((e,n)=>t(sp,{style:{color:a},children:t(se,{size:de.XXS,color:a,children:e})},n))})},dp=({items:n})=>{const o=f();return t(q,{$gap:16,children:n.map((n,a)=>e(ue,{$gap:8,$alignItems:"flex-start",children:[e(se,{size:de.XS,color:o.v2.colors.silver[200],weight:400,children:[a+1,"."]}),e(q,{$gap:2,children:[t(se,{size:de.XS,color:o.v2.colors.white[500],weight:500,children:n.title}),t(se,{size:de.XS,color:o.v2.colors.silver[200],children:n.description})]})]},a))})},up=({message:e})=>t(De,{status:Pe.Default,message:e,fullWidth:!0,smallIcon:!0}),pp=g.div`
477
490
  width: 100%;
478
491
  padding: 8px;
479
492
  display: flex;
@@ -481,12 +494,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
481
494
  gap: 4px;
482
495
  border-radius: 16px;
483
496
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
484
- `,zu=g.div`
497
+ `,hp=g.div`
485
498
  display: flex;
486
499
  align-items: center;
487
500
  gap: 8px;
488
501
  padding: 4px 8px 12px 8px;
489
- `,Bu=g.div`
502
+ `,mp=g.div`
490
503
  width: 100%;
491
504
  display: flex;
492
505
  flex-direction: column;
@@ -494,20 +507,20 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
494
507
  padding: 8px;
495
508
  border-radius: 12px;
496
509
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
497
- `,Xu=({children:e})=>{const n=f();return t(ae,{size:le.S,weight:500,color:n.v2.colors.white[500],align:"center",children:e})},Vu=g.div`
510
+ `,gp=({children:e})=>{const n=f();return t(se,{size:de.S,weight:500,color:n.v2.colors.white[500],align:"center",children:e})},fp=g.div`
498
511
  white-space: pre-line;
499
- `,Uu=({enabled:o,onEnabledChange:i,onBack:l,onNext:s})=>{const r=f(),c=a(()=>T({enabled:o,keepPercentage:0}),[o]);return e(n,{children:[t(Nu,{title:Wn,onBack:l}),e($u,{$width:854,children:[t(Xu,{children:Kn}),e(W,{$gap:8,$width:"100%",children:[t(Ru,{children:t(Vu,{children:t(ae,{size:le.XXS,color:r.v2.colors.silver[200],children:Yn})})}),e(W,{$gap:8,$width:"100%",children:[e(Mu,{children:[t(zu,{children:t(ae,{size:le.S,weight:500,color:r.v2.colors.white[500],children:Jn})}),t(Bu,{children:t(wu,{name:Zn,recommended:!0,toggleLabel:qn,enabled:o,onEnabledChange:i,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(_u,{message:Qn})]})]})]}),t(Eu,{onNext:s})]})},Gu=e=>t(qi,{rotate:90,...e}),Hu=({onClose:o})=>{const a=f();return e(n,{children:[t(Tu,{}),e($u,{$width:732,children:[t(eo,{icon:ji}),e(W,{$gap:16,$alignItems:"center",$width:"100%",children:[t(ae,{size:le.M,weight:500,color:a.v2.colors.white[500],children:to}),no.split("\n").map((e,n)=>t(Xu,{children:e},`subtitle-${n}-${e}`)),e(Ru,{children:[t(ae,{size:le.XS,color:a.v2.colors.silver[200],children:oo}),t(Fu,{color:a.v2.colors.white[500],items:[ao,io,lo]})]})]})]}),t(Eu,{center:!0,children:t(re,{"data-id":"sampling-onboarding-btn-go-to",label:so,rightIcon:Gu,variant:de.Primary,size:ce.M,onClick:o})})]})},ju=e=>t(qi,{rotate:90,...e}),Wu=g.div`
512
+ `,bp=({enabled:o,onEnabledChange:i,onBack:l,onNext:r})=>{const s=f(),c=a(()=>A({enabled:o,keepPercentage:0}),[o]);return e(n,{children:[t(ap,{title:oo,onBack:l}),e(ep,{$width:854,children:[t(gp,{children:ao}),e(q,{$gap:8,$width:"100%",children:[t(lp,{children:t(fp,{children:t(se,{size:de.XXS,color:s.v2.colors.silver[200],children:io})})}),e(q,{$gap:8,$width:"100%",children:[e(pp,{children:[t(hp,{children:t(se,{size:de.S,weight:500,color:s.v2.colors.white[500],children:lo})}),t(mp,{children:t(Ju,{name:so,recommended:!0,toggleLabel:ro,enabled:o,onEnabledChange:i,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(up,{message:co})]})]})]}),t(np,{onNext:r})]})},yp=e=>t(sl,{rotate:90,...e}),vp=({onClose:o})=>{const a=f();return e(n,{children:[t(Qu,{}),e(ep,{$width:732,children:[t(uo,{icon:ol}),e(q,{$gap:16,$alignItems:"center",$width:"100%",children:[t(se,{size:de.M,weight:500,color:a.v2.colors.white[500],children:po}),ho.split("\n").map((e,n)=>t(gp,{children:e},`subtitle-${n}-${e}`)),e(lp,{children:[t(se,{size:de.XS,color:a.v2.colors.silver[200],children:mo}),t(cp,{color:a.v2.colors.white[500],items:[go,fo,bo]})]})]})]}),t(np,{center:!0,children:t(pe,{"data-id":"sampling-onboarding-btn-go-to",label:yo,rightIcon:yp,variant:me.Primary,size:he.M,onClick:o})})]})},Cp=e=>t(sl,{rotate:90,...e}),Sp=g.div`
500
513
  display: flex;
501
514
  flex-direction: column;
502
515
  align-items: center;
503
516
  gap: 8px;
504
517
  width: 100%;
505
- `,Ku=({onSkip:o,onNext:a})=>{const i=f();return e(n,{children:[t(Tu,{}),e($u,{$width:732,children:[t(eo,{icon:ji}),e(W,{$gap:16,$alignItems:"center",$width:"100%",children:[e(Wu,{children:[t(ae,{size:le.M,weight:500,color:i.v2.colors.white[500],children:ro}),t(Xu,{children:co})]}),e(Ru,{children:[t(ae,{size:le.XS,color:i.v2.colors.silver[200],children:uo}),t(Lu,{items:[{title:ho,description:po},{title:go,description:mo},{title:bo,description:fo}]}),t(_u,{message:vo})]})]})]}),e(Eu,{center:!0,children:[t(re,{"data-id":"sampling-onboarding-btn-skip",label:yo,variant:de.Secondary,onClick:o}),t(re,{"data-id":"sampling-onboarding-btn-start",label:Co,rightIcon:ju,variant:de.Primary,onClick:a})]})]})},Yu=g.div`
518
+ `,wp=({onSkip:o,onNext:a})=>{const i=f();return e(n,{children:[t(Qu,{}),e(ep,{$width:732,children:[t(uo,{icon:ol}),e(q,{$gap:16,$alignItems:"center",$width:"100%",children:[e(Sp,{children:[t(se,{size:de.M,weight:500,color:i.v2.colors.white[500],children:vo}),t(gp,{children:Co})]}),e(lp,{children:[t(se,{size:de.XS,color:i.v2.colors.silver[200],children:So}),t(dp,{items:[{title:xo,description:wo},{title:To,description:ko},{title:Io,description:$o}]}),t(up,{message:Eo})]})]})]}),e(np,{center:!0,children:[t(pe,{"data-id":"sampling-onboarding-btn-skip",label:Ao,variant:me.Secondary,onClick:o}),t(pe,{"data-id":"sampling-onboarding-btn-start",label:No,rightIcon:Cp,variant:me.Primary,onClick:a})]})]})},xp=g.div`
506
519
  display: flex;
507
520
  align-items: stretch;
508
521
  gap: 16px;
509
522
  width: 100%;
510
- `,Ju=g.div`
523
+ `,kp=g.div`
511
524
  flex: 1;
512
525
  display: flex;
513
526
  flex-direction: column;
@@ -527,18 +540,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
527
540
  background-color: ${t.v2.colors.silver[700]};
528
541
  }
529
542
  `}
530
- `,qu=g.div`
543
+ `,Tp=g.div`
531
544
  display: flex;
532
545
  align-items: center;
533
546
  gap: 8px;
534
547
  padding: 12px 16px;
535
- `,Zu=g.div`
548
+ `,$p=g.div`
536
549
  flex: 1;
537
550
  padding: 8px;
538
551
  display: flex;
539
552
  flex-direction: column;
540
553
  gap: 8px;
541
- `,Qu=g.div`
554
+ `,Ip=g.div`
542
555
  flex: 1;
543
556
  display: flex;
544
557
  flex-direction: column;
@@ -546,17 +559,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
546
559
  padding: 12px;
547
560
  border-radius: 12px;
548
561
  background-color: ${({theme:e,$selected:t})=>t?e.v2.colors.purple[900]:e.v2.colors.silver[900]};
549
- `,ep=g.div`
562
+ `,Ep=g.div`
550
563
  display: flex;
551
564
  justify-content: flex-end;
552
- `,tp=g.div`
565
+ `,Ap=g.div`
553
566
  display: flex;
554
567
  align-items: center;
555
568
  gap: 8px;
556
569
  padding: 4px 12px 4px 4px;
557
570
  border-radius: 8px;
558
571
  background-color: ${({theme:e})=>e.v2.colors.yellow[1e3]};
559
- `,np=g.div`
572
+ `,Np=g.div`
560
573
  display: flex;
561
574
  align-items: center;
562
575
  justify-content: center;
@@ -564,13 +577,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
564
577
  height: 24px;
565
578
  border-radius: 6px;
566
579
  background-color: ${({theme:e})=>e.v2.colors.yellow[900]};
567
- `,op=({selected:n,onSelect:o,name:a,description:i,badgeProps:l,bullets:s,warning:r,onReadMore:c})=>{const d=f(),u=n?d.v2.colors.white[500]:d.v2.colors.silver[200];return e(Ju,{$selected:n,onClick:o,children:[e(qu,{children:[t(me,{"data-id":`sampling-onboarding-radio-${a}`,value:n,onChange:o,size:fe.L}),t(ji,{size:24,fill:d.v2.colors.white[500]}),t(ae,{size:le.S,weight:500,color:d.v2.colors.white[500],children:a})]}),e(Zu,{children:[e(Qu,{$selected:n,children:[e(W,{$gap:8,children:[t(Be,{...l,textSize:le.XXXS}),t(ae,{size:le.XXS,color:u,children:i})]}),s&&s.length>0&&t(Fu,{color:u,items:s}),r&&e(tp,{children:[t(np,{children:t(Wi,{size:18,fill:d.v2.colors.yellow[500]})}),t(ae,{size:le.XXXS,color:d.v2.colors.yellow[500],children:r})]})]}),c&&t(ep,{children:t(re,{"data-id":`sampling-onboarding-btn-read-more-${a}`,label:_o,rightIcon:ui,variant:de.Text,size:ce.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},ap=({strategy:o,onStrategyChange:a,onBack:i,onNext:l,docsUrl:s})=>{const r=f(),c=s?()=>window.open(s,"_blank"):void 0;return e(n,{children:[t(Nu,{title:So,onBack:i}),e($u,{$width:854,children:[t(Xu,{children:wo}),e(Yu,{children:[t(op,{selected:"keep-list"===o,onSelect:()=>a("keep-list"),name:Eo,description:Io,badgeProps:{label:$o,backgroundColor:r.v2.colors.purple[500],textColor:r.v2.colors.white[500]},bullets:[ko,To],warning:xo,onReadMore:c}),t(op,{selected:"drop-list"===o,onSelect:()=>a("drop-list"),name:Do,description:Ro,badgeProps:{label:Oo,backgroundColor:r.v2.colors.green[500],textColor:r.v2.colors.black[500]},bullets:[Ao,No],onReadMore:c}),t(op,{selected:"advanced"===o,onSelect:()=>a("advanced"),name:Lo,description:Fo,badgeProps:{label:Po,backgroundColor:r.v2.colors.blue[700],textColor:r.v2.colors.white[500]},onReadMore:c})]})]}),t(Eu,{onNext:l})]})},ip=({onBack:o,onNext:i,submitting:l})=>{const s=f(),r=a(()=>[{title:Xo,bullets:[Mo,zo,Bo]},{title:Wo,bullets:[Vo,Uo,Go,Ho,jo]}],[]);return e(n,{children:[t(Nu,{title:Ko,onBack:o}),e($u,{$width:854,children:[t(Xu,{children:Yo}),t(se,{$gap:16,$width:"100%",$alignItems:"stretch",children:r.map((n,o)=>e(Ru,{fillHeight:!0,width:"50%",children:[t(ae,{size:le.XS,color:s.v2.colors.white[500],children:n.title}),t(Fu,{items:n.bullets})]},o))}),t(_u,{message:Jo})]}),t(Eu,{onNext:i,nextLoading:l})]})},lp=g.div`
580
+ `,Op=({selected:n,onSelect:o,name:a,description:i,badgeProps:l,bullets:r,warning:s,onReadMore:c})=>{const d=f(),u=n?d.v2.colors.white[500]:d.v2.colors.silver[200];return e(kp,{$selected:n,onClick:o,children:[e(Tp,{children:[t(ye,{"data-id":`sampling-onboarding-radio-${a}`,value:n,onChange:o,size:Ce.L}),t(ol,{size:24,fill:d.v2.colors.white[500]}),t(se,{size:de.S,weight:500,color:d.v2.colors.white[500],children:a})]}),e($p,{children:[e(Ip,{$selected:n,children:[e(q,{$gap:8,children:[t(We,{...l,textSize:de.XXXS}),t(se,{size:de.XXS,color:u,children:i})]}),r&&r.length>0&&t(cp,{color:u,items:r}),s&&e(Ap,{children:[t(Np,{children:t(al,{size:18,fill:d.v2.colors.yellow[500]})}),t(se,{size:de.XXXS,color:d.v2.colors.yellow[500],children:s})]})]}),c&&t(Ep,{children:t(pe,{"data-id":`sampling-onboarding-btn-read-more-${a}`,label:Wo,rightIcon:wi,variant:me.Text,size:he.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},Rp=({strategy:o,onStrategyChange:a,onBack:i,onNext:l,docsUrl:r})=>{const s=f(),c=r?()=>window.open(r,"_blank"):void 0;return e(n,{children:[t(ap,{title:Oo,onBack:i}),e(ep,{$width:854,children:[t(gp,{children:Ro}),e(xp,{children:[t(Op,{selected:"keep-list"===o,onSelect:()=>a("keep-list"),name:_o,description:Mo,badgeProps:{label:Lo,backgroundColor:s.v2.colors.purple[500],textColor:s.v2.colors.white[500]},bullets:[Po,Fo],warning:Do,onReadMore:c}),t(Op,{selected:"drop-list"===o,onSelect:()=>a("drop-list"),name:Uo,description:Vo,badgeProps:{label:Xo,backgroundColor:s.v2.colors.green[500],textColor:s.v2.colors.black[500]},bullets:[zo,Bo],onReadMore:c}),t(Op,{selected:"advanced"===o,onSelect:()=>a("advanced"),name:Ho,description:Go,badgeProps:{label:jo,backgroundColor:s.v2.colors.blue[700],textColor:s.v2.colors.white[500]},onReadMore:c})]})]}),t(np,{onNext:l})]})},Dp=({onBack:o,onNext:i,submitting:l})=>{const r=f(),s=a(()=>[{title:qo,bullets:[Ko,Yo,Jo]},{title:oa,bullets:[Zo,Qo,ea,ta,na]}],[]);return e(n,{children:[t(ap,{title:aa,onBack:o}),e(ep,{$width:854,children:[t(gp,{children:ia}),t(ue,{$gap:16,$width:"100%",$alignItems:"stretch",children:s.map((n,o)=>e(lp,{fillHeight:!0,width:"50%",children:[t(se,{size:de.XS,color:r.v2.colors.white[500],children:n.title}),t(cp,{items:n.bullets})]},o))}),t(up,{message:la})]}),t(np,{onNext:i,nextLoading:l})]})},Pp=g.div`
568
581
  white-space: pre-line;
569
- `,sp=({errorPresetEnabled:o,onErrorPresetChange:i,onBack:l,onNext:s,submitting:r})=>{const c=f(),d=a(()=>$(o?{disabled:!1}:null),[o]);return e(n,{children:[t(Nu,{title:qo,onBack:l}),e($u,{$width:854,children:[t(Xu,{children:Zo}),e(W,{$gap:8,$width:"100%",children:[e(Ru,{children:[t(lp,{children:t(ae,{size:le.XXS,color:c.v2.colors.silver[200],children:Qo})}),t(_u,{message:Jo})]}),e(Mu,{children:[e(zu,{children:[t(ae,{size:le.S,weight:500,color:c.v2.colors.white[500],children:ea}),t(Ri,{size:16,fill:c.v2.colors.silver[200]})]}),t(Bu,{children:t(wu,{name:na,recommended:!0,toggleLabel:ta,enabled:o,onEnabledChange:i,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(Eu,{onNext:s,nextLoading:r})]})},rp=g.div`
582
+ `,Fp=({errorPresetEnabled:o,onErrorPresetChange:i,onBack:l,onNext:r,submitting:s})=>{const c=f(),d=a(()=>N(o?{disabled:!1}:null),[o]);return e(n,{children:[t(ap,{title:ra,onBack:l}),e(ep,{$width:854,children:[t(gp,{children:sa}),e(q,{$gap:8,$width:"100%",children:[e(lp,{children:[t(Pp,{children:t(se,{size:de.XXS,color:c.v2.colors.silver[200],children:ca})}),t(up,{message:la})]}),e(pp,{children:[e(hp,{children:[t(se,{size:de.S,weight:500,color:c.v2.colors.white[500],children:da}),t(Ui,{size:16,fill:c.v2.colors.silver[200]})]}),t(mp,{children:t(Ju,{name:pa,recommended:!0,toggleLabel:ua,enabled:o,onEnabledChange:i,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(np,{onNext:r,nextLoading:s})]})},Lp=g.div`
570
583
  white-space: pre-line;
571
- `,cp=g.div`
584
+ `,Mp=g.div`
572
585
  width: fit-content;
573
- `,dp=["50","25","10","1","0.1"],up=({value:n,onChange:o,label:i})=>{const l=f(),s=a(()=>dp.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e(W,{$gap:8,children:[t(ae,{size:le.XS,color:l.v2.colors.white[500],children:i}),t(cp,{children:t(ue,{"data-id":"sampling-onboarding-ambient",options:s,selected:n,setSelected:o})})]})},pp=({errorPresetEnabled:o,onErrorPresetChange:i,ambientPercentage:l,onAmbientPercentageChange:s,onBack:r,onNext:c,submitting:d})=>{const u=f(),p=a(()=>$(o?{disabled:!1}:null),[o]);return e(n,{children:[t(Nu,{title:oa,onBack:r}),e($u,{$width:854,children:[t(Xu,{children:aa}),e(W,{$gap:8,$width:"100%",children:[e(Ru,{children:[t(rp,{children:t(ae,{size:le.XXS,color:u.v2.colors.silver[200],children:ia})}),t(Fu,{items:[la,sa,ra,ca,da]}),t(_u,{message:Jo})]}),e(Mu,{children:[e(zu,{children:[t(ae,{size:le.S,weight:500,color:u.v2.colors.white[500],children:ua}),t(Ri,{size:16,fill:u.v2.colors.silver[200]})]}),t(Bu,{children:t(wu,{name:na,recommended:!0,toggleLabel:ta,enabled:o,onEnabledChange:i,summary:p,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(Bu,{children:t(up,{value:l,onChange:s,label:pa})})]})]})]}),t(Eu,{onNext:c,nextLoading:d})]})},hp=({isOpen:e,onClose:n,k8sHealthProbesConfig:a,samplingId:i,docsUrl:r})=>{const{samplingApi:c}=ll(),[d,u]=s("welcome"),[p,h]=s(!0),[m,g]=s("keep-list"),[f,b]=s(!0),[v,y]=s("25"),[C,S]=s(!1);o(()=>{e&&(u("welcome"),h(a?.enabled??!0),g("keep-list"),b(!0),y("25"),S(!1))},[e,a?.enabled]);const w=l(async()=>{const e=i??"default",t=[];if(p!==(a?.enabled??!1)){const e=c.updateK8sHealthProbesConfig;e&&t.push(e({enabled:p,keepPercentage:a?.keepPercentage??0}))}if("advanced"!==m&&f){const n=c.createHighlyRelevant;n&&t.push(n({samplingId:e,rule:{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}}))}if("keep-list"===m){const n=c.createCostReduction;n&&t.push(n({samplingId:e,rule:{name:"Onboarding - Ambient sampling",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:parseFloat(v)}}))}S(!0);try{await Promise.all(t),u("success")}catch{}finally{S(!1)}},[i,c,p,a?.enabled,a?.keepPercentage,m,f,v]);let x=null;switch(d){case"welcome":x=t(Ku,{onSkip:n,onNext:()=>u("noisy")});break;case"noisy":x=t(Uu,{enabled:p,onEnabledChange:h,onBack:()=>u("welcome"),onNext:()=>u("strategy")});break;case"strategy":x=t(ap,{strategy:m,onStrategyChange:g,onBack:()=>u("noisy"),onNext:()=>{u("keep-list"===m?"keep-list":"drop-list"===m?"drop-list":"advanced")},docsUrl:r});break;case"keep-list":x=t(pp,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"drop-list":x=t(sp,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"advanced":x=t(ip,{onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"success":x=t(Hu,{onClose:n})}return t(Gn,{isOpen:e,onClose:n,children:x})};var mp,gp;!function(e){e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"}(mp||(mp={})),function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(gp||(gp={}));const fp=[{key:gp.Name,label:"Name"},{key:gp.Type,label:"Type",textAlign:"right"},{key:gp.Status,label:"Status"},{key:gp.OdigosVersion,label:"Odigos Version"},{key:gp.ConnectedSince,label:"Connected Since"},{key:gp.LastActivity,label:"Last Activity"}],bp=(e,t)=>{const n=e.find(e=>e.key===gp.Id)?.rawValue;return t(n?.toString()||"")},vp=e=>{const{connections:t,configMinSupportedVersion:n,snapshotMinSupportedVersion:o,onDelete:a,onAddSource:i,onAddDestination:l,onAddAction:s,onAddInstrumentationRule:r,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===gp.Status)?.rawValue===Ie.Success)(e))return[{id:Vn(),label:"Delete Connection",rightIcon:pi,onClick:()=>bp(e,a)}];const d=bp(e,e=>{const o=t.find(t=>t.id===e);return!!o&&I(o.odigosVersion,n)}),u=bp(e,e=>{const n=t.find(t=>t.id===e);return!!n&&I(n.odigosVersion,o)}),p=[];return i&&p.push({id:Vn(),tooltip:u?Ge.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${o} or later.`,rightIcon:ki,disabled:!u,onClick:()=>bp(e,i)}),l&&p.push({id:Vn(),tooltip:Ge.ADD_DESTINATION,rightIcon:vi,onClick:()=>bp(e,l)}),s&&p.push({id:Vn(),tooltip:Ge.ADD_ACTION,rightIcon:bi,onClick:()=>bp(e,s)}),r&&p.push({id:Vn(),tooltip:Ge.ADD_INSTRUMENTATION_RULE,rightIcon:xi,onClick:()=>bp(e,r)}),c&&p.push({id:Vn(),tooltip:d?"Edit Configuration":`To use this feature, please upgrade to Odigos v${n} or later.`,rightIcon:$i,disabled:!d,onClick:()=>bp(e,c)}),p}},yp=({connections:n,getConnections:i,onClickConnection:r,deleteConnection:c,configMinSupportedVersion:d=0,snapshotMinSupportedVersion:u=0})=>{const p=f(),{formatTimeAgo:h}=zt(),{capabilities:m}=ll(),[g,b]=s(!1),[v,y]=s(n||[]),C=l(async()=>{try{b(!0),y(await i()??[])}catch(e){}finally{b(!1)}},[]);o(()=>{v.length||C()},[]);const[S,w]=s(""),[x,k]=s(null),[T,$]=s([]),E=a(()=>x===mp.BulkConfig?d:x===mp.BulkSource?u:0,[x,d,u]),{supportedConnections:A,supportedConnectionIds:N}=a(()=>{const e=((e,t)=>e.filter(e=>{const n=e.status===Ie.Success,o=I(e.odigosVersion,t);return n&&o}))(v,E);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[v,E]);o(()=>{if(!x||x===mp.Delete)return;const e=T.filter(e=>!N.includes(e));e.length&&$(t=>t.filter(t=>!e.includes(t)))},[x,T.length,N.length]);const O=a(()=>v.filter(e=>!S||e.name.toLowerCase().includes(S.toLowerCase())).map(e=>({cells:[{key:gp.Id,rawValue:e.id},{key:gp.Name,rawValue:e.name},{key:gp.Type,rawValue:e.type},{key:gp.Status,rawValue:e.status,component:()=>(e=>{const n=e===Ie.Success?"Connection live":"Connection lost",o=e===Ie.Success?Si:wi;return t(Be,{status:e,label:n,leftIcon:o})})(e.status)},{key:gp.OdigosVersion,rawValue:e.odigosVersion},{key:gp.ConnectedSince,rawValue:e.connectedAt?h(e.connectedAt):"-"},{key:gp.LastActivity,rawValue:e.lastSeenAt?h(e.lastSeenAt):"-"}],onClick:e.status!==Ie.Success||x?void 0:()=>r(e),isSelected:T.includes(e.id),onSelect:()=>$(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>$(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==Ie.Success||x===mp.BulkConfig&&!I(e.odigosVersion,d)||x===mp.BulkSource&&!I(e.odigosVersion,u)})),[v,T,S,x,d,u,h,r]),R=a(()=>{const e=(e,t)=>{$([e]),k(t)};return vp({connections:v,configMinSupportedVersion:d,snapshotMinSupportedVersion:u,onDelete:t=>e(t,mp.Delete),onAddSource:m.canFetchSnapshots&&m.canBulkPersistSources?t=>e(t,mp.BulkSource):void 0,onAddDestination:m.canFetchDestinationCategories&&m.canFetchPotentialDestinations&&m.canCreateDestination?t=>e(t,mp.BulkDestination):void 0,onAddAction:m.canCreateAction?t=>e(t,mp.BulkAction):void 0,onAddInstrumentationRule:m.canCreateInstrumentationRule?t=>e(t,mp.BulkInstrumentationRule):void 0,onEditConfiguration:m.canApplyEffectiveConfig?t=>e(t,mp.BulkConfig):void 0})},[v,d,u,m]),D=a(()=>(e=>{const{onCancel:t,onAddSource:n,onAddDestination:o,onAddAction:a,onAddInstrumentationRule:i,onManageConfigurations:l}=e,s=[];n&&s.push({id:Vn(),type:Yt.Button,buttonProps:{variant:de.Primary,size:ce.S,label:"Add Sources",rightIcon:ki,onClick:n}});const r=[o?{id:mp.BulkDestination,label:Ge.ADD_DESTINATION,icon:vi}:null,a?{id:mp.BulkAction,label:Ge.ADD_ACTION,icon:bi}:null,i?{id:mp.BulkInstrumentationRule,label:Ge.ADD_INSTRUMENTATION_RULE,icon:xi}:null,l?{id:mp.BulkConfig,label:"Manage Configurations",icon:$i}:null];return r.some(Boolean)&&s.push({id:Vn(),type:Yt.ButtonDropData,buttonProps:{variant:de.Secondary,size:ce.S,label:"Bulk Operations",onClick:e=>{e===mp.BulkSource?n?.():e===mp.BulkDestination?o?.():e===mp.BulkAction?a?.():e===mp.BulkInstrumentationRule?i?.():e===mp.BulkConfig&&l?.()}},dropDataProps:{alignX:Xn.Left,items:r}}),s.push({id:Vn(),type:Yt.Button,buttonProps:{variant:de.Text,size:ce.S,label:kt.CANCEL,onClick:t}}),s})({onCancel:()=>$([]),onAddSource:m.canFetchSnapshots&&m.canBulkPersistSources?()=>k(mp.BulkSource):void 0,onAddDestination:m.canFetchDestinationCategories&&m.canFetchPotentialDestinations&&m.canCreateDestination?()=>k(mp.BulkDestination):void 0,onAddAction:m.canCreateAction?()=>k(mp.BulkAction):void 0,onAddInstrumentationRule:m.canCreateInstrumentationRule?()=>k(mp.BulkInstrumentationRule):void 0,onManageConfigurations:m.canApplyEffectiveConfig?()=>k(mp.BulkConfig):void 0}),[m]);return t(ha,{children:e(et,{fullHeight:!0,richTitle:{icon:Zi,title:Ge.CONNECTIONS,badge:{label:v.length.toString(),status:Ie.Unknown}},search:{placeholder:"Search by cluster name",value:S,onChange:e=>w(e),width:"300px"},actions:[{id:Vn(),type:Yt.Button,buttonProps:{variant:de.Secondary,size:ce.S,leftIcon:Ni,onClick:C,disabled:g}}],children:[t(fn,{variant:bn.Pretty,headerBackgroundColor:p.v2.colors.silver[1e3],isLoading:g,withCheckboxes:!0,columns:fp,rows:O,rowActionsPushRightPosition:x?`calc(${Tl} - 24px)`:void 0,getRowActions:R}),x===mp.BulkConfig&&m.canApplyEffectiveConfig&&t(Il,{connectionIds:T,children:t(zr,{onClose:()=>k(null),connections:A,selectedConnectionIds:T,setSelectedConnectionIds:$})}),x===mp.BulkSource&&m.canFetchSnapshots&&m.canBulkPersistSources&&t(Il,{connectionIds:T,children:t(Xl,{selectedConnectionIds:T,children:t(Lr,{onClose:()=>k(null),selectedConnectionIds:T,setSelectedConnectionIds:$})})}),x===mp.BulkDestination&&m.canFetchDestinationCategories&&m.canFetchPotentialDestinations&&m.canTestConnection&&m.canCreateDestination&&t(Il,{connectionIds:T,children:t(Vl,{children:t(gr,{onClose:()=>k(null),selectedConnectionIds:T,setSelectedConnectionIds:$})})}),x===mp.BulkAction&&m.canCreateAction&&t(Il,{connectionIds:T,children:t(Ul,{children:t(ir,{onClose:()=>k(null),selectedConnectionIds:T,setSelectedConnectionIds:$})})}),x===mp.BulkInstrumentationRule&&m.canCreateInstrumentationRule&&t(Il,{connectionIds:T,children:t(Gl,{children:t(fr,{onClose:()=>k(null),selectedConnectionIds:T,setSelectedConnectionIds:$})})}),t(Sl,{target:"connection",isOpen:x===mp.Delete,onClose:()=>{$([]),k(null)},onApprove:async()=>{const e=T[0];e&&(await c(e),await C())}}),t(vn,{isOpen:!!T.length&&!x,richTitle:{icon:ci,title:"Selected Clusters",badge:{label:T.length}},actions:D})]})})},Cp=g.div`
586
+ `,_p=["50","25","10","1","0.1"],zp=({value:n,onChange:o,label:i})=>{const l=f(),r=a(()=>_p.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e(q,{$gap:8,children:[t(se,{size:de.XS,color:l.v2.colors.white[500],children:i}),t(Mp,{children:t(ge,{"data-id":"sampling-onboarding-ambient",options:r,selected:n,setSelected:o})})]})},Bp=({errorPresetEnabled:o,onErrorPresetChange:i,ambientPercentage:l,onAmbientPercentageChange:r,onBack:s,onNext:c,submitting:d})=>{const u=f(),p=a(()=>N(o?{disabled:!1}:null),[o]);return e(n,{children:[t(ap,{title:ha,onBack:s}),e(ep,{$width:854,children:[t(gp,{children:ma}),e(q,{$gap:8,$width:"100%",children:[e(lp,{children:[t(Lp,{children:t(se,{size:de.XXS,color:u.v2.colors.silver[200],children:ga})}),t(cp,{items:[fa,ba,ya,va,Ca]}),t(up,{message:la})]}),e(pp,{children:[e(hp,{children:[t(se,{size:de.S,weight:500,color:u.v2.colors.white[500],children:Sa}),t(Ui,{size:16,fill:u.v2.colors.silver[200]})]}),t(mp,{children:t(Ju,{name:pa,recommended:!0,toggleLabel:ua,enabled:o,onEnabledChange:i,summary:p,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(mp,{children:t(zp,{value:l,onChange:r,label:wa})})]})]})]}),t(np,{onNext:c,nextLoading:d})]})},Xp=({isOpen:e,onClose:n,k8sHealthProbesConfig:a,samplingId:i,docsUrl:s})=>{const{samplingApi:c}=bl(),[d,u]=r("welcome"),[p,h]=r(!0),[m,g]=r("keep-list"),[f,b]=r(!0),[y,v]=r("25"),[C,S]=r(!1);o(()=>{e&&(u("welcome"),h(a?.enabled??!0),g("keep-list"),b(!0),v("25"),S(!1))},[e,a?.enabled]);const w=l(async()=>{const e=i??"default",t=[];if(p!==(a?.enabled??!1)){const e=c.updateK8sHealthProbesConfig;e&&t.push(e({enabled:p,keepPercentage:a?.keepPercentage??0}))}if("advanced"!==m&&f){const n=c.createHighlyRelevant;n&&t.push(n({samplingId:e,rule:{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}}))}if("keep-list"===m){const n=c.createCostReduction;n&&t.push(n({samplingId:e,rule:{name:"Onboarding - Ambient sampling",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:parseFloat(y)}}))}S(!0);try{await Promise.all(t),u("success")}catch{}finally{S(!1)}},[i,c,p,a?.enabled,a?.keepPercentage,m,f,y]);let x=null;switch(d){case"welcome":x=t(wp,{onSkip:n,onNext:()=>u("noisy")});break;case"noisy":x=t(bp,{enabled:p,onEnabledChange:h,onBack:()=>u("welcome"),onNext:()=>u("strategy")});break;case"strategy":x=t(Rp,{strategy:m,onStrategyChange:g,onBack:()=>u("noisy"),onNext:()=>{u("keep-list"===m?"keep-list":"drop-list"===m?"drop-list":"advanced")},docsUrl:s});break;case"keep-list":x=t(Bp,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:y,onAmbientPercentageChange:v,onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"drop-list":x=t(Fp,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"advanced":x=t(Dp,{onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"success":x=t(vp,{onClose:n})}return t(eo,{isOpen:e,onClose:n,children:x})};var Vp,Up;!function(e){e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"}(Vp||(Vp={})),function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(Up||(Up={}));const jp=[{key:Up.Name,label:"Name"},{key:Up.Type,label:"Type"},{key:Up.Status,label:"Status"},{key:Up.OdigosVersion,label:"Odigos Version"},{key:Up.ConnectedSince,label:"Connected Since"},{key:Up.LastActivity,label:"Last Activity"}],Gp=(e,t)=>{const n=e.find(e=>e.key===Up.Id)?.rawValue;return t(n?.toString()||"")},Hp=e=>{const{connections:t,configMinSupportedVersion:n,snapshotMinSupportedVersion:o,onDelete:a,onAddSource:i,onAddDestination:l,onAddAction:r,onAddInstrumentationRule:s,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===Up.Status)?.rawValue===Pe.Success)(e))return[{id:Zn(),label:"Delete Connection",rightIcon:xi,onClick:()=>Gp(e,a)}];if(!Gp(e,e=>{const n=t.find(t=>t.id===e);return n?.type===xa.K8s}))return[];const d=Gp(e,e=>{const o=t.find(t=>t.id===e);return!!o&&O(o.odigosVersion,n)}),u=Gp(e,e=>{const n=t.find(t=>t.id===e);return!!n&&O(n.odigosVersion,o)}),p=[];return i&&p.push({id:Zn(),tooltip:u?qe.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${o} or later.`,rightIcon:Fi,disabled:!u,onClick:()=>Gp(e,i)}),l&&p.push({id:Zn(),tooltip:qe.ADD_DESTINATION,rightIcon:Ai,onClick:()=>Gp(e,l)}),r&&p.push({id:Zn(),tooltip:qe.ADD_ACTION,rightIcon:Ei,onClick:()=>Gp(e,r)}),s&&p.push({id:Zn(),tooltip:qe.ADD_INSTRUMENTATION_RULE,rightIcon:Pi,onClick:()=>Gp(e,s)}),c&&p.push({id:Zn(),tooltip:d?"Edit Configuration":`To use this feature, please upgrade to Odigos v${n} or later.`,rightIcon:Mi,disabled:!d,onClick:()=>Gp(e,c)}),p}},Wp=({connections:n,getConnections:i,onClickConnection:s,deleteConnection:c,configMinSupportedVersion:d=0,snapshotMinSupportedVersion:u=0})=>{const p=f(),{formatTimeAgo:h}=Ht(),{capabilities:m}=bl(),[g,b]=r(!1),[y,v]=r(n||[]),C=l(async()=>{try{b(!0),v(await i()??[])}catch(e){}finally{b(!1)}},[]);o(()=>{y.length||C()},[]);const[S,w]=r(""),[x,k]=r(null),[T,$]=r([]),I=a(()=>x===Vp.BulkConfig?d:x===Vp.BulkSource?u:0,[x,d,u]),{supportedConnections:E,supportedConnectionIds:A}=a(()=>{const e=((e,t)=>e.filter(e=>{const n=e.status===Pe.Success,o=O(e.odigosVersion,t);return n&&o}))(y,I);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[y,I]);o(()=>{if(!x||x===Vp.Delete)return;const e=T.filter(e=>!A.includes(e));e.length&&$(t=>t.filter(t=>!e.includes(t)))},[x,T.length,A.length]);const N=a(()=>y.filter(e=>!S||e.name.toLowerCase().includes(S.toLowerCase())).map(e=>({cells:[{key:Up.Id,rawValue:e.id},{key:Up.Name,rawValue:e.name},{key:Up.Type,rawValue:e.type},{key:Up.Status,rawValue:e.status,component:()=>(e=>{const n=e===Pe.Success?"Connection live":"Connection lost",o=e===Pe.Success?Ri:Di;return t(We,{status:e,label:n,leftIcon:o})})(e.status)},{key:Up.OdigosVersion,rawValue:e.odigosVersion},{key:Up.ConnectedSince,rawValue:e.connectedAt?h(e.connectedAt):"-"},{key:Up.LastActivity,rawValue:e.lastSeenAt?h(e.lastSeenAt):"-"}],onClick:e.status!==Pe.Success||x?void 0:()=>s(e),isSelected:T.includes(e.id),onSelect:()=>$(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>$(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==Pe.Success||x===Vp.BulkConfig&&!O(e.odigosVersion,d)||x===Vp.BulkSource&&!O(e.odigosVersion,u)})),[y,T,S,x,d,u,h,s]),R=a(()=>y.length>0&&y.every(e=>e.type===xa.K8s),[y]),D=a(()=>{const e=(e,t)=>{$([e]),k(t)};return Hp({connections:y,configMinSupportedVersion:d,snapshotMinSupportedVersion:u,onDelete:t=>e(t,Vp.Delete),onAddSource:m.canFetchSnapshots&&m.canBulkPersistSources?t=>e(t,Vp.BulkSource):void 0,onAddDestination:m.canFetchDestinationCategories&&m.canFetchPotentialDestinations&&m.canCreateDestination?t=>e(t,Vp.BulkDestination):void 0,onAddAction:m.canCreateAction?t=>e(t,Vp.BulkAction):void 0,onAddInstrumentationRule:m.canCreateInstrumentationRule?t=>e(t,Vp.BulkInstrumentationRule):void 0,onEditConfiguration:m.canApplyEffectiveConfig?t=>e(t,Vp.BulkConfig):void 0})},[y,d,u,m]),P=a(()=>(e=>{const{onCancel:t,onAddSource:n,onAddDestination:o,onAddAction:a,onAddInstrumentationRule:i,onManageConfigurations:l}=e,r=[];n&&r.push({id:Zn(),type:nn.Button,buttonProps:{variant:me.Primary,size:he.S,label:"Add Sources",rightIcon:Fi,onClick:n}});const s=[o?{id:Vp.BulkDestination,label:qe.ADD_DESTINATION,icon:Ai}:null,a?{id:Vp.BulkAction,label:qe.ADD_ACTION,icon:Ei}:null,i?{id:Vp.BulkInstrumentationRule,label:qe.ADD_INSTRUMENTATION_RULE,icon:Pi}:null,l?{id:Vp.BulkConfig,label:"Manage Configurations",icon:Mi}:null];return s.some(Boolean)&&r.push({id:Zn(),type:nn.ButtonDropData,buttonProps:{variant:me.Secondary,size:he.S,label:"Bulk Operations",onClick:e=>{e===Vp.BulkSource?n?.():e===Vp.BulkDestination?o?.():e===Vp.BulkAction?a?.():e===Vp.BulkInstrumentationRule?i?.():e===Vp.BulkConfig&&l?.()}},dropDataProps:{alignX:qn.Left,items:s}}),r.push({id:Zn(),type:nn.Button,buttonProps:{variant:me.Text,size:he.S,label:Dt.CANCEL,onClick:t}}),r})({onCancel:()=>$([]),onAddSource:m.canFetchSnapshots&&m.canBulkPersistSources?()=>k(Vp.BulkSource):void 0,onAddDestination:m.canFetchDestinationCategories&&m.canFetchPotentialDestinations&&m.canCreateDestination?()=>k(Vp.BulkDestination):void 0,onAddAction:m.canCreateAction?()=>k(Vp.BulkAction):void 0,onAddInstrumentationRule:m.canCreateInstrumentationRule?()=>k(Vp.BulkInstrumentationRule):void 0,onManageConfigurations:m.canApplyEffectiveConfig?()=>k(Vp.BulkConfig):void 0}),[m]);return t(ka,{children:e(rt,{fullHeight:!0,richTitle:{icon:cl,title:qe.CONNECTIONS,badge:{label:y.length.toString(),status:Pe.Unknown}},search:{placeholder:"Search by cluster name",value:S,onChange:e=>w(e),width:"300px"},actions:[{id:Zn(),type:nn.Button,buttonProps:{variant:me.Secondary,size:he.S,leftIcon:Xi,onClick:C,disabled:g}}],children:[t(wn,{variant:xn.Pretty,headerBackgroundColor:p.v2.colors.silver[1e3],isLoading:g,withCheckboxes:R,columns:jp,rows:N,rowActionsPushRightPosition:x?`calc(${Ll} - 24px)`:void 0,getRowActions:D}),x===Vp.BulkConfig&&m.canApplyEffectiveConfig&&t(_l,{connectionIds:T,children:t(dc,{onClose:()=>k(null),connections:E,selectedConnectionIds:T,setSelectedConnectionIds:$})}),x===Vp.BulkSource&&m.canFetchSnapshots&&m.canBulkPersistSources&&t(_l,{connectionIds:T,children:t(Zl,{selectedConnectionIds:T,children:t(rc,{onClose:()=>k(null),selectedConnectionIds:T,setSelectedConnectionIds:$})})}),x===Vp.BulkDestination&&m.canFetchDestinationCategories&&m.canFetchPotentialDestinations&&m.canTestConnection&&m.canCreateDestination&&t(_l,{connectionIds:T,children:t(Ql,{children:t(Bs,{onClose:()=>k(null),selectedConnectionIds:T,setSelectedConnectionIds:$})})}),x===Vp.BulkAction&&m.canCreateAction&&t(_l,{connectionIds:T,children:t(er,{children:t(Ns,{onClose:()=>k(null),selectedConnectionIds:T,setSelectedConnectionIds:$})})}),x===Vp.BulkInstrumentationRule&&m.canCreateInstrumentationRule&&t(_l,{connectionIds:T,children:t(tr,{children:t(Xs,{onClose:()=>k(null),selectedConnectionIds:T,setSelectedConnectionIds:$})})}),t(Rl,{target:"connection",isOpen:x===Vp.Delete,onClose:()=>{$([]),k(null)},onApprove:async()=>{const e=T[0];e&&(await c(e),await C())}}),t(kn,{isOpen:!!T.length&&!x,richTitle:{icon:Ci,title:"Selected Clusters",badge:{label:T.length}},actions:P})]})})},Kp=g.div`
574
587
  display: flex;
575
588
  align-items: center;
576
589
  justify-content: space-between;
@@ -579,26 +592,26 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
579
592
  width: 100%;
580
593
  border-radius: 16px;
581
594
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
582
- `,Sp=g.div`
595
+ `,Yp=g.div`
583
596
  display: flex;
584
597
  align-items: center;
585
598
  justify-content: center;
586
599
  padding: 8px;
587
600
  border-radius: 8px;
588
- background-color: ${({theme:e})=>e.v2.colors.white[500]+nt["004"]};
589
- `,wp=({setStep:n,onSave:o,sourcesPayload:i,destinationsPayload:l,disableAnimation:s})=>{const r=f(),c=()=>n(2),d=()=>n(3),u=a(()=>Object.values(i||{}).flatMap((n,o)=>n.map((n,a)=>{if(!n.selected)return null;const i=n.kind||gt.Namespace,l=i===gt.Namespace?n.namespace:`${n.namespace} → ${n.name}`;return e(Cp,{children:[t(ae,{nowrap:!0,children:l}),t(Be,{label:i,status:Ie.Info,backgroundColor:r.v2.colors.blue[900]})]},`source-${o}-${a}`)})).filter(Boolean),[i]),p=a(()=>l?.map((n,o)=>{const a=ut(n.option.type).icon;return e(Cp,{children:[e(se,{$gap:8,children:[a&&t(Sp,{children:t(a,{size:24})}),t(ae,{nowrap:!0,children:n.formData.name||n.option.displayName})]}),void 0!==n.testResult&&t(Be,{status:n.testResult.succeeded?Ie.Success:Ie.Error,leftIcon:n.testResult.succeeded?Si:wi})]},`destination-${o}`)})||[],[l]);return t(Cl,{isOpen:!0,disableAnimation:s,onBack:()=>n(3),onSave:o,header:{icon:Ei,title:Ge.SUMMARY,subTitle:Ge.REVIEW_SETUP},leftColumn:{width:"50%",header:e(se,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(se,{$gap:8,children:[t(ki,{size:24}),t(ae,{nowrap:!0,children:Ge.SELECTED_SOURCES}),t(Be,{label:u.length})]}),t(re,{"data-id":"summary-edit-sources",leftIcon:hi,variant:de.Secondary,size:ce.S,onClick:c})]}),list:u.length?u:[t(at,{$height:"100%",children:t(Ce,{icon:ki,title:Ge.NO_SOURCES_SELECTED,subTitle:Ge.ADD_SOURCE_PROMPT,button:{leftIcon:si,label:Ge.ADD_SOURCE,onClick:c}})},"no-sources-data")]},rightColumn:{width:"50%",header:e(se,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(se,{$gap:8,children:[t(vi,{size:24}),t(ae,{nowrap:!0,children:Ge.SELECTED_DESTINATIONS}),t(Be,{label:p.length})]}),t(re,{"data-id":"summary-edit-destinations",leftIcon:hi,variant:de.Secondary,size:ce.S,onClick:d})]}),list:p.length?p:[t(at,{"data-id":"summary-no-destinations",$height:"100%",children:t(Ce,{icon:vi,title:Ge.NO_DESTINATIONS_SELECTED,subTitle:Ge.ADD_DESTINATION_PROMPT,button:{leftIcon:si,label:Ge.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},xp=g.div`
601
+ background-color: ${({theme:e})=>e.v2.colors.white[500]+ct["004"]};
602
+ `,Jp=({setStep:n,onSave:o,sourcesPayload:i,destinationsPayload:l,disableAnimation:r})=>{const s=f(),c=()=>n(2),d=()=>n(3),u=a(()=>Object.values(i||{}).flatMap((n,o)=>n.map((n,a)=>{if(!n.selected)return null;const i=n.kind||xt.Namespace,l=i===xt.Namespace?n.namespace:`${n.namespace} → ${n.name}`;return e(Kp,{children:[t(se,{nowrap:!0,children:l}),t(We,{label:i,status:Pe.Info,backgroundColor:s.v2.colors.blue[900]})]},`source-${o}-${a}`)})).filter(Boolean),[i]),p=a(()=>l?.map((n,o)=>{const a=Ct(n.option.type).icon;return e(Kp,{children:[e(ue,{$gap:8,children:[a&&t(Yp,{children:t(a,{size:24})}),t(se,{nowrap:!0,children:n.formData.name||n.option.displayName})]}),void 0!==n.testResult&&t(We,{status:n.testResult.succeeded?Pe.Success:Pe.Error,leftIcon:n.testResult.succeeded?Ri:Di})]},`destination-${o}`)})||[],[l]);return t(Ol,{isOpen:!0,disableAnimation:r,onBack:()=>n(3),onSave:o,header:{icon:zi,title:qe.SUMMARY,subTitle:qe.REVIEW_SETUP},leftColumn:{width:"50%",header:e(ue,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ue,{$gap:8,children:[t(Fi,{size:24}),t(se,{nowrap:!0,children:qe.SELECTED_SOURCES}),t(We,{label:u.length})]}),t(pe,{"data-id":"summary-edit-sources",leftIcon:ki,variant:me.Secondary,size:he.S,onClick:c})]}),list:u.length?u:[t(ht,{$height:"100%",children:t(Ae,{icon:Fi,title:qe.NO_SOURCES_SELECTED,subTitle:qe.ADD_SOURCE_PROMPT,button:{leftIcon:yi,label:qe.ADD_SOURCE,onClick:c}})},"no-sources-data")]},rightColumn:{width:"50%",header:e(ue,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ue,{$gap:8,children:[t(Ai,{size:24}),t(se,{nowrap:!0,children:qe.SELECTED_DESTINATIONS}),t(We,{label:p.length})]}),t(pe,{"data-id":"summary-edit-destinations",leftIcon:ki,variant:me.Secondary,size:he.S,onClick:d})]}),list:p.length?p:[t(ht,{"data-id":"summary-no-destinations",$height:"100%",children:t(Ae,{icon:Ai,title:qe.NO_DESTINATIONS_SELECTED,subTitle:qe.ADD_DESTINATION_PROMPT,button:{leftIcon:yi,label:qe.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},qp=g.div`
590
603
  position: relative;
591
604
  overflow: hidden;
592
605
  width: 100vw;
593
606
  height: 100vh;
594
607
  box-sizing: border-box;
595
- `,kp=g.svg`
608
+ `,Zp=g.svg`
596
609
  position: absolute;
597
610
  top: 50%;
598
611
  left: 50%;
599
612
  transform: translate(-50%, -50%);
600
613
  z-index: -1;
601
- `,Tp=[{opacity:"0.1"},{offset:"0.31",opacity:"0.11"},{offset:"0.45",opacity:"0.14"},{offset:"0.56",opacity:"0.19"},{offset:"0.65",opacity:"0.26"},{offset:"0.73",opacity:"0.35"},{offset:"0.8",opacity:"0.46"},{offset:"0.86",opacity:"0.6"},{offset:"0.92",opacity:"0.76"},{offset:"0.98",opacity:"0.93"},{offset:"1"}],$p=[{width:1440,height:900,pathOpacity:.1,path:"M719.992 1169.99C322.351 1169.99 0 847.64 0 450C0 52.3591 322.351 -269.992 719.992 -269.992C1117.63 -269.992 1439.98 52.3591 1439.98 450C1439.98 847.64 1117.63 1169.99 719.992 1169.99Z",gradientTransform:"translate(814.309 444.011) rotate(180) scale(718.904)",stops:[{opacity:"0.1"},{offset:"0.41",opacity:"0.11"},{offset:"0.56",opacity:"0.13"},{offset:"0.67",opacity:"0.18"},{offset:"0.75",opacity:"0.25"},{offset:"0.83",opacity:"0.33"},{offset:"0.89",opacity:"0.44"},{offset:"0.95",opacity:"0.56"},{offset:"1",opacity:"0.7"}]},{width:1343,height:900,pathOpacity:.3,path:"M671.344 1121.34C300.571 1121.34 0 820.773 0 450C0 79.2264 300.571 -221.345 671.344 -221.345C1042.12 -221.345 1342.69 79.2264 1342.69 450C1342.69 820.773 1042.12 1121.34 671.344 1121.34Z",gradientTransform:"translate(644.026 441.551) rotate(180) scale(581.31)",stops:Tp},{width:1163,height:900,pathOpacity:.5,path:"M581.31 1031.31C260.261 1031.31 0 771.048 0 449.999C0 128.951 260.261 -131.311 581.31 -131.311C902.358 -131.311 1162.62 128.951 1162.62 449.999C1162.62 771.048 902.358 1031.31 581.31 1031.31Z",gradientTransform:"translate(644.026 441.551) rotate(180) scale(581.31)",stops:Tp},{width:798,height:798,pathOpacity:.7,path:"M398.581 797.162C178.451 797.162 0 618.711 0 398.581C0 178.451 178.451 0 398.581 0C618.711 0 797.162 178.451 797.162 398.581C797.162 618.711 618.711 797.162 398.581 797.162Z",gradientTransform:"translate(445.003 392.441) rotate(180) scale(398.23)",stops:Tp}],Ip=({paddingXAxis:n="0px",paddingYAxis:i="0px",children:l})=>{const[r,c]=s(window.innerWidth),d=a(()=>r/$p[0].width,[r]);return o(()=>{const e=()=>c(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(xp,{$paddingXAxis:n,$paddingYAxis:i,children:[$p.map(({width:n,height:o,pathOpacity:a,path:i,gradientTransform:l,stops:s},r)=>{const c=`purple-ring-${r}`;return e(kp,{width:n*d,height:"100%",viewBox:`0 0 ${n} ${o}`,fill:"none",children:[t("path",{opacity:a,d:i,fill:`url(#${c})`}),t("defs",{children:t("radialGradient",{id:c,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:l,children:s.map(({offset:e,opacity:n},o)=>t("stop",{offset:e,stopColor:"#7C3BFF",stopOpacity:n},o))})})]},c)}),l]})},Ep=g.div`
614
+ `,Qp=[{opacity:"0.1"},{offset:"0.31",opacity:"0.11"},{offset:"0.45",opacity:"0.14"},{offset:"0.56",opacity:"0.19"},{offset:"0.65",opacity:"0.26"},{offset:"0.73",opacity:"0.35"},{offset:"0.8",opacity:"0.46"},{offset:"0.86",opacity:"0.6"},{offset:"0.92",opacity:"0.76"},{offset:"0.98",opacity:"0.93"},{offset:"1"}],eh=[{width:1440,height:900,pathOpacity:.1,path:"M719.992 1169.99C322.351 1169.99 0 847.64 0 450C0 52.3591 322.351 -269.992 719.992 -269.992C1117.63 -269.992 1439.98 52.3591 1439.98 450C1439.98 847.64 1117.63 1169.99 719.992 1169.99Z",gradientTransform:"translate(814.309 444.011) rotate(180) scale(718.904)",stops:[{opacity:"0.1"},{offset:"0.41",opacity:"0.11"},{offset:"0.56",opacity:"0.13"},{offset:"0.67",opacity:"0.18"},{offset:"0.75",opacity:"0.25"},{offset:"0.83",opacity:"0.33"},{offset:"0.89",opacity:"0.44"},{offset:"0.95",opacity:"0.56"},{offset:"1",opacity:"0.7"}]},{width:1343,height:900,pathOpacity:.3,path:"M671.344 1121.34C300.571 1121.34 0 820.773 0 450C0 79.2264 300.571 -221.345 671.344 -221.345C1042.12 -221.345 1342.69 79.2264 1342.69 450C1342.69 820.773 1042.12 1121.34 671.344 1121.34Z",gradientTransform:"translate(644.026 441.551) rotate(180) scale(581.31)",stops:Qp},{width:1163,height:900,pathOpacity:.5,path:"M581.31 1031.31C260.261 1031.31 0 771.048 0 449.999C0 128.951 260.261 -131.311 581.31 -131.311C902.358 -131.311 1162.62 128.951 1162.62 449.999C1162.62 771.048 902.358 1031.31 581.31 1031.31Z",gradientTransform:"translate(644.026 441.551) rotate(180) scale(581.31)",stops:Qp},{width:798,height:798,pathOpacity:.7,path:"M398.581 797.162C178.451 797.162 0 618.711 0 398.581C0 178.451 178.451 0 398.581 0C618.711 0 797.162 178.451 797.162 398.581C797.162 618.711 618.711 797.162 398.581 797.162Z",gradientTransform:"translate(445.003 392.441) rotate(180) scale(398.23)",stops:Qp}],th=({paddingXAxis:n="0px",paddingYAxis:i="0px",children:l})=>{const[s,c]=r(window.innerWidth),d=a(()=>s/eh[0].width,[s]);return o(()=>{const e=()=>c(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(qp,{$paddingXAxis:n,$paddingYAxis:i,children:[eh.map(({width:n,height:o,pathOpacity:a,path:i,gradientTransform:l,stops:r},s)=>{const c=`purple-ring-${s}`;return e(Zp,{width:n*d,height:"100%",viewBox:`0 0 ${n} ${o}`,fill:"none",children:[t("path",{opacity:a,d:i,fill:`url(#${c})`}),t("defs",{children:t("radialGradient",{id:c,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:l,children:r.map(({offset:e,opacity:n},o)=>t("stop",{offset:e,stopColor:"#7C3BFF",stopOpacity:n},o))})})]},c)}),l]})},nh=g.div`
602
615
  display: flex;
603
616
  flex-direction: column;
604
617
  align-items: center;
@@ -609,7 +622,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
609
622
  width: 50vw;
610
623
  border-radius: 16px;
611
624
  background: ${({theme:e})=>e.v2.colors.silver[900]};
612
- `,Ap=g.div`
625
+ `,oh=g.div`
613
626
  display: flex;
614
627
  flex-direction: column;
615
628
  align-items: center;
@@ -619,15 +632,15 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
619
632
  & * {
620
633
  text-align: center;
621
634
  }
622
- `,Np=({onStart:n})=>t(ne,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(at,{$height:"100%",children:e(Ep,{children:[e(Ap,{children:[t(ae,{size:le.L,weight:500,children:Ge.GET_STARTED_WITH}),t(kl,{size:260}),t(ae,{size:le.S,weight:400,children:Ge.GET_STARTED_DESCRIPTION})]}),t(re,{"data-id":"onboarding-get-started",label:kt.GET_STARTED,rightIcon:ri,size:ce.L,onClick:n})]})})}),Op=[{step:1,label:Ge.INSTALLATION,forceDoneBadge:!0},{step:2,label:Ge.SOURCES_SETUP},{step:3,label:Ge.DESTINATIONS_SETUP},{step:4,label:Ge.SUMMARY}],Rp=g.div`
635
+ `,ah=({onStart:n})=>t(le,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(ht,{$height:"100%",children:e(nh,{children:[e(oh,{children:[t(se,{size:de.L,weight:500,children:qe.GET_STARTED_WITH}),t(Fl,{size:260}),t(se,{size:de.S,weight:400,children:qe.GET_STARTED_DESCRIPTION})]}),t(pe,{"data-id":"onboarding-get-started",label:Dt.GET_STARTED,rightIcon:vi,size:he.L,onClick:n})]})})}),ih=[{step:1,label:qe.INSTALLATION,forceDoneBadge:!0},{step:2,label:qe.SOURCES_SETUP},{step:3,label:qe.DESTINATIONS_SETUP},{step:4,label:qe.SUMMARY}],lh=g.div`
623
636
  display: flex;
624
637
  flex-direction: column;
625
638
  gap: 32px;
626
639
  padding: 64px;
627
- `,Dp=({pagePaddingXAxis:n,pagePaddingYAxis:o,onDone:a})=>{const{setCurrentModal:i}=Un(),{sourcesApi:l,destinationsApi:r}=ll(),[c,d]=s(1),[u,p]=s(!1),[h,m]=s(null),[g,f]=s(null),b=()=>d(e=>e+1),v=()=>d(e=>e-1);return e(Ip,{paddingXAxis:n,paddingYAxis:o,children:[e(Rp,{children:[t(kl,{useInline:!0}),t(ma,{currentStep:c,data:Op,gap:32})]}),t(Xl,{initialInputs:h,children:e(Vl,{children:[1===c&&t(Np,{onStart:b}),2===c&&t(Lr,{disableAnimation:!0,onBack:e=>{m(e),v()},onNext:e=>{m(e),b()}}),3===c&&t(gr,{disableAnimation:!0,onBack:e=>{f(e),v()},onNext:e=>{f(e),b()},initialInputs:g}),4===c&&t(wp,{disableAnimation:!0,setStep:d,onSave:async()=>{if(!u){p(!0);try{const e=[];h&&e.push(l.persistV2(h)),g&&e.push(...g.map(e=>r.create(e.formData)));const t=await Promise.allSettled(e),n=[];for(const e of t)"rejected"===e.status?n.push(e.reason?.message||String(e.reason)):e.value&&"object"==typeof e.value&&"error"in e.value&&e.value.error&&n.push(e.value.error);if(n.length)return{error:n.join("\n")};i(vu),a()}catch(e){return p(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:h,destinationsPayload:g})]})})]})},Pp=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),Fp=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},Lp=g.div`
640
+ `,rh=({pagePaddingXAxis:n,pagePaddingYAxis:o,onDone:a})=>{const{setCurrentModal:i}=Qn(),{sourcesApi:l,destinationsApi:s}=bl(),[c,d]=r(1),[u,p]=r(!1),[h,m]=r(null),[g,f]=r(null),b=()=>d(e=>e+1),y=()=>d(e=>e-1);return e(th,{paddingXAxis:n,paddingYAxis:o,children:[e(lh,{children:[t(Fl,{useInline:!0}),t(Ta,{currentStep:c,data:ih,gap:32})]}),t(Zl,{initialInputs:h,children:e(Ql,{children:[1===c&&t(ah,{onStart:b}),2===c&&t(rc,{disableAnimation:!0,onBack:e=>{m(e),y()},onNext:e=>{m(e),b()}}),3===c&&t(Bs,{disableAnimation:!0,onBack:e=>{f(e),y()},onNext:e=>{f(e),b()},initialInputs:g}),4===c&&t(Jp,{disableAnimation:!0,setStep:d,onSave:async()=>{if(!u){p(!0);try{const e=[];h&&e.push(l.persistV2(h)),g&&e.push(...g.map(e=>s.create(e.formData)));const t=await Promise.allSettled(e),n=[];for(const e of t)"rejected"===e.status?n.push(e.reason?.message||String(e.reason)):e.value&&"object"==typeof e.value&&"error"in e.value&&e.value.error&&n.push(e.value.error);if(n.length)return{error:n.join("\n")};i(Hu),a()}catch(e){return p(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:h,destinationsPayload:g})]})})]})},sh=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),ch=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},dh=g.div`
628
641
  position: relative;
629
642
  display: inline-flex;
630
- `,_p=g.button`
643
+ `,uh=g.button`
631
644
  display: inline-flex;
632
645
  align-items: center;
633
646
  gap: 8px;
@@ -640,7 +653,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
640
653
  &:hover {
641
654
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
642
655
  }
643
- `,Mp=g.div`
656
+ `,ph=g.div`
644
657
  position: absolute;
645
658
  top: calc(100% + 8px);
646
659
  right: 0;
@@ -653,25 +666,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
653
666
  border-radius: 12px;
654
667
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
655
668
  box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
656
- `,zp=g.div`
669
+ `,hh=g.div`
657
670
  display: flex;
658
671
  flex-direction: column;
659
672
  gap: 12px;
660
673
  padding: 16px;
661
674
  max-height: 60vh;
662
675
  overflow-y: auto;
663
- `,Bp=g.div`
676
+ `,mh=g.div`
664
677
  display: flex;
665
678
  align-items: center;
666
679
  gap: 8px;
667
680
  padding: 12px 16px;
668
681
  border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
669
- `,Xp=g.div`
682
+ `,gh=g.div`
670
683
  display: flex;
671
684
  align-items: center;
672
685
  gap: 8px;
673
686
  margin-left: auto;
674
- `,Vp=()=>{const n=f(),{sourcesApi:l,namespacesApi:r}=ll(),c=l.useSources().items,d=r.useNamespaces().items,{selectedStreamName:u}=He(),{getItemSS:p,setItemSS:h,removeItemSS:m}=ya(),{namespaces:g,kinds:b,monitors:v,languages:y,onlyErrors:C,podsAgentInjectionStatus:S,setAll:w,clearAll:x,getEmptyState:k}=ga(),T=a(()=>fa(c,u),[c,u]);o(()=>{const e=p(ba.OVERVIEW_FILTERS,k());w(e)},[]);const[$,I]=s({namespaces:g,kinds:b,monitors:v,languages:y,onlyErrors:C,podsAgentInjectionStatus:S}),[E,A]=s(Fp($)),[N,O]=s(!1);o(()=>{if(!N){const e={namespaces:g,kinds:b,monitors:v,languages:y,onlyErrors:C,podsAgentInjectionStatus:S};I(e),A(Fp(e))}},[N,g,b,v,y,C,S]);const R=i(null);cn(R,()=>O(!1)),_n({key:"Escape",active:N},()=>O(!1));const D=a(()=>{const e=new Set,t=[];return d.forEach(({name:n})=>{e.has(n)||(e.add(n),t.push({id:n,label:n,withCheckbox:!0}))}),t},[d]),P=a(()=>{const e=new Set,t=[];return T.forEach(({id:n})=>{const{kind:o}=n;e.has(o)||(e.add(o),t.push({id:o,label:o,withCheckbox:!0}))}),t},[T]),F=a(()=>{const e=new Set,t=[];return T.forEach(({runtimeInfo:n})=>{n?.detectedLanguages?.forEach(n=>{e.has(n)||(e.add(n),t.push({id:n,label:Xe[n]||n,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[T]),L=a(()=>va.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),_=a(()=>{const e=new Set,t=[];return T.forEach(({podsAgentInjectionStatus:n})=>{const{reasonEnum:o,message:a}=n||{};if(o){if(e.has(o))return;e.add(o),t.push({id:o,label:Pt(o)})}else if(a){if(e.has(a))return;e.add(a),t.push({id:a,label:a,withCheckbox:!0})}}),t},[T]),M=(e,t,n)=>{const o=t.filter(e=>n.includes(e.id));I(t=>{return{...t,[e]:(n=o,n.map(({id:e,label:t})=>({id:e,label:t})))};var n})},z=N?yi:Ci,B=a(()=>Pp($.languages),[$.languages]);return e(Lp,{ref:R,children:[e(_p,{"data-id":"filters-trigger",$isOpen:N,type:"button",onClick:()=>O(e=>!e),children:[t(Qi,{size:16,fill:n.v2.colors.white[500]}),t(ae,{size:le.XS,weight:500,nowrap:!0,children:"Filters"}),E>0&&t(Be,{label:E,status:Ie.Unknown,textSize:le.XXXS}),t(z,{size:16,fill:n.v2.colors.silver[200]})]}),N&&e(Mp,{children:[e(zp,{children:[t(lt,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!D.length,options:D,values:Pp($.namespaces),setValues:e=>M("namespaces",D,e)}),t(lt,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!P.length,options:P,values:Pp($.kinds),setValues:e=>M("kinds",P,e)}),t(lt,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!F.length,options:F,values:B,setValues:e=>M("languages",F,e)}),t(lt,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!L.length,options:L,values:Pp($.monitors),setValues:e=>M("monitors",L,e)}),t(lt,{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!_.length,options:_,values:Pp($.podsAgentInjectionStatus),setValues:e=>M("podsAgentInjectionStatus",_,e)}),t(Q,{label:"Show only sources with errors",size:bt.L,value:!!$.onlyErrors,onChange:e=>I(t=>({...t,onlyErrors:e}))})]}),e(Bp,{children:[t(re,{"data-id":"filters-reset",size:ce.S,variant:de.Text,label:"Reset",onClick:()=>{m(ba.OVERVIEW_FILTERS),x(),I(k()),A(0),O(!1)},textColor:n.v2.colors.red[500]}),e(Xp,{children:[t(re,{"data-id":"filters-cancel",size:ce.S,variant:de.Secondary,label:"Cancel",onClick:()=>O(!1)}),t(re,{"data-id":"filters-apply",size:ce.S,variant:de.Primary,label:"Apply",onClick:()=>{h(ba.OVERVIEW_FILTERS,$),w($),A(Fp($)),O(!1)}})]})]})]})]})},Up=g.div`
687
+ `,fh=()=>{const n=f(),{sourcesApi:l,namespacesApi:s}=bl(),c=l.useSources().items,d=s.useNamespaces().items,{selectedStreamName:u}=Ze(),{getItemSS:p,setItemSS:h,removeItemSS:m}=Na(),{namespaces:g,kinds:b,monitors:y,languages:v,onlyErrors:C,podsAgentInjectionStatus:S,setAll:w,clearAll:x,getEmptyState:k}=$a(),T=a(()=>Ia(c,u),[c,u]);o(()=>{const e=p(Ea.OVERVIEW_FILTERS,k());w(e)},[]);const[$,I]=r({namespaces:g,kinds:b,monitors:y,languages:v,onlyErrors:C,podsAgentInjectionStatus:S}),[E,A]=r(ch($)),[N,O]=r(!1);o(()=>{if(!N){const e={namespaces:g,kinds:b,monitors:y,languages:v,onlyErrors:C,podsAgentInjectionStatus:S};I(e),A(ch(e))}},[N,g,b,y,v,C,S]);const R=i(null);gn(R,()=>O(!1)),Wn({key:"Escape",active:N},()=>O(!1));const D=a(()=>{const e=new Set,t=[];return d.forEach(({name:n})=>{e.has(n)||(e.add(n),t.push({id:n,label:n,withCheckbox:!0}))}),t},[d]),P=a(()=>{const e=new Set,t=[];return T.forEach(({id:n})=>{const{kind:o}=n;e.has(o)||(e.add(o),t.push({id:o,label:o,withCheckbox:!0}))}),t},[T]),F=a(()=>{const e=new Set,t=[];return T.forEach(({runtimeInfo:n})=>{n?.detectedLanguages?.forEach(n=>{e.has(n)||(e.add(n),t.push({id:n,label:Ke[n]||n,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[T]),L=a(()=>Aa.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),M=a(()=>{const e=new Set,t=[];return T.forEach(({podsAgentInjectionStatus:n})=>{const{reasonEnum:o,message:a}=n||{};if(o){if(e.has(o))return;e.add(o),t.push({id:o,label:Xt(o)})}else if(a){if(e.has(a))return;e.add(a),t.push({id:a,label:a,withCheckbox:!0})}}),t},[T]),_=(e,t,n)=>{const o=t.filter(e=>n.includes(e.id));I(t=>{return{...t,[e]:(n=o,n.map(({id:e,label:t})=>({id:e,label:t})))};var n})},z=N?Ni:Oi,B=a(()=>sh($.languages),[$.languages]);return e(dh,{ref:R,children:[e(uh,{"data-id":"filters-trigger",$isOpen:N,type:"button",onClick:()=>O(e=>!e),children:[t(dl,{size:16,fill:n.v2.colors.white[500]}),t(se,{size:de.XS,weight:500,nowrap:!0,children:"Filters"}),E>0&&t(We,{label:E,status:Pe.Unknown,textSize:de.XXXS}),t(z,{size:16,fill:n.v2.colors.silver[200]})]}),N&&e(ph,{children:[e(hh,{children:[t(gt,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!D.length,options:D,values:sh($.namespaces),setValues:e=>_("namespaces",D,e)}),t(gt,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!P.length,options:P,values:sh($.kinds),setValues:e=>_("kinds",P,e)}),t(gt,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!F.length,options:F,values:B,setValues:e=>_("languages",F,e)}),t(gt,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!L.length,options:L,values:sh($.monitors),setValues:e=>_("monitors",L,e)}),t(gt,{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!M.length,options:M,values:sh($.podsAgentInjectionStatus),setValues:e=>_("podsAgentInjectionStatus",M,e)}),t(oe,{label:"Show only sources with errors",size:Tt.L,value:!!$.onlyErrors,onChange:e=>I(t=>({...t,onlyErrors:e}))})]}),e(mh,{children:[t(pe,{"data-id":"filters-reset",size:he.S,variant:me.Text,label:"Reset",onClick:()=>{m(Ea.OVERVIEW_FILTERS),x(),I(k()),A(0),O(!1)},textColor:n.v2.colors.red[500]}),e(gh,{children:[t(pe,{"data-id":"filters-cancel",size:he.S,variant:me.Secondary,label:"Cancel",onClick:()=>O(!1)}),t(pe,{"data-id":"filters-apply",size:he.S,variant:me.Primary,label:"Apply",onClick:()=>{h(Ea.OVERVIEW_FILTERS,$),w($),A(ch($)),O(!1)}})]})]})]})]})},bh=g.div`
675
688
  position: relative;
676
689
  display: flex;
677
690
  align-items: center;
@@ -682,7 +695,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
682
695
  box-sizing: border-box;
683
696
  border-radius: 16px 16px 0 0;
684
697
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
685
- `,Gp=g.div`
698
+ `,yh=g.div`
686
699
  position: absolute;
687
700
  bottom: 0;
688
701
  left: 0;
@@ -691,7 +704,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
691
704
  background-color: ${({theme:e})=>e.v2.colors.purple[500]};
692
705
  border-radius: 32px;
693
706
  transition: width 0.3s;
694
- `,Hp=({entityType:n,badge:o,badgeTooltip:a,isLoading:i,refetch:l,partiallySelected:s,allSelected:r,onSelectAll:c,progressPercent:d})=>{const{setCurrentModal:u}=Un();return e(Up,{children:[e(se,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(Y,{size:Ca.S,partiallyChecked:s,value:!!r,onChange:c}),t(ae,{size:le.S,nowrap:!0,children:`${Pt(n)}s`}),t(Be,{label:o,tooltip:a,status:Ie.Unknown,textSize:le.XXXS})]}),e(se,{children:[t(st,{"data-id":`add-${n}`,icon:si,onClick:()=>u(n)}),t(st,{"data-id":`refresh-${n}`,icon:Ni,onClick:l,disabled:i})]}),"number"==typeof d&&t(Gp,{$percent:d})]})},jp=g(W)`
707
+ `,vh=({entityType:n,badge:o,badgeTooltip:a,isLoading:i,refetch:l,partiallySelected:r,allSelected:s,onSelectAll:c,progressPercent:d})=>{const{setCurrentModal:u}=Qn();return e(bh,{children:[e(ue,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(Q,{size:Oa.S,partiallyChecked:r,value:!!s,onChange:c}),t(se,{size:de.S,nowrap:!0,children:`${Xt(n)}s`}),t(We,{label:o,tooltip:a,status:Pe.Unknown,textSize:de.XXXS})]}),e(ue,{children:[t(ft,{"data-id":`add-${n}`,icon:yi,onClick:()=>u(n)}),t(ft,{"data-id":`refresh-${n}`,icon:Xi,onClick:l,disabled:i})]}),"number"==typeof d&&t(yh,{$percent:d})]})},Ch=g(q)`
695
708
  align-items: center !important;
696
709
  justify-content: center !important;
697
710
  align-self: stretch;
@@ -706,7 +719,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
706
719
  &:hover {
707
720
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
708
721
  }
709
- `,Wp=({entityType:n,description:o})=>{const{setCurrentModal:a}=Un();return e(jp,{onClick:()=>a(n),children:[e(se,{$gap:4,children:[t(si,{size:16}),t(ae,{size:le.S,children:`Add ${Pt(n)}`})]}),t(ae,{size:le.XXS,align:"center",children:o})]})},Kp=g.div`
722
+ `,Sh=({entityType:n,description:o})=>{const{setCurrentModal:a}=Qn();return e(Ch,{onClick:()=>a(n),children:[e(ue,{$gap:4,children:[t(yi,{size:16}),t(se,{size:de.S,children:`Add ${Xt(n)}`})]}),t(se,{size:de.XXS,align:"center",children:o})]})},wh=g.div`
710
723
  display: flex;
711
724
  align-items: center;
712
725
  gap: 12px;
@@ -721,10 +734,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
721
734
  &:hover {
722
735
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
723
736
  }
724
- `,Yp=g(se)`
737
+ `,xh=g(ue)`
725
738
  flex: 1;
726
739
  min-width: 0;
727
- `,Jp=({entityId:n,entityType:o,title:i,status:l,faded:s,tooltip:r,throughput:c,icon:d,icons:u,iconSrc:p,isActive:h,raw:m})=>{const g=f(),b=o===gt.Source,v="boolean"==typeof h,y=s||v&&!h,{setDrawerType:C,setDrawerEntityId:S}=Zt(),{selectedSources:w,setSelectedSources:x}=Sa(),k=m,T=b?k.id.namespace:"",$=a(()=>{if(!b)return-1;const e=w[T];return e?.length?e.findIndex(e=>e.id.name===k.id.name&&e.id.kind===k.id.kind):-1},[b,w,T,k.id]),I=v&&!h?wa(Ie.Info,g):l?wa(l,g):void 0,E=b&&"object"==typeof n?`${n.namespace}-${n.name}-${n.kind}`:n;return e(Kp,{"data-id":E,$faded:y,onClick:()=>{C(o),S(n)},children:[b&&t(Y,{size:Ca.S,value:-1!==$,onChange:()=>{const e={...w};e[T]||(e[T]=[]),-1===$?e[T].push(k):e[T].splice($,1),x(e)}}),t(nn,{icons:u,icon:d,iconSrc:p}),e(Yp,{$gap:4,children:[t(Se,{size:le.XS,nowrap:!0,children:i}),t(se,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:c&&t(De,{text:r||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:t(Be,{label:c,status:l&&[Ie.Error,Ie.Warning].includes(l)?l:Ie.Unknown,leftIcon:I,textSize:le.XXXS})})})]})]})};function qp(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===Ie.Loading)?e:{...e,workloadOdigosHealthStatus:{status:Vt.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function Zp(e){const t=Object.values(e.conditions??{}).filter(Boolean),n=t.filter(({status:e})=>e!==Ie.Loading);return n?.length===t?.length?e:{...e,conditions:n?.length?n.reduce((e,t)=>(e[t.name]=t,e),{}):{}}}const Qp=g.div`
740
+ `,kh=({entityId:n,entityType:o,title:i,status:l,faded:r,tooltip:s,throughput:c,icon:d,icons:u,iconSrc:p,isActive:h,raw:m})=>{const g=f(),b=o===xt.Source,y="boolean"==typeof h,v=r||y&&!h,{setDrawerType:C,setDrawerEntityId:S}=ln(),{selectedSources:w,setSelectedSources:x}=Ra(),k=m,T=b?k.id.namespace:"",$=a(()=>{if(!b)return-1;const e=w[T];return e?.length?e.findIndex(e=>e.id.name===k.id.name&&e.id.kind===k.id.kind):-1},[b,w,T,k.id]),I=y&&!h?Da(Pe.Info,g):l?Da(l,g):void 0,E=b&&"object"==typeof n?`${n.namespace}-${n.name}-${n.kind}`:n;return e(wh,{"data-id":E,$faded:v,onClick:()=>{C(o),S(n)},children:[b&&t(Q,{size:Oa.S,value:-1!==$,onChange:()=>{const e={...w};e[T]||(e[T]=[]),-1===$?e[T].push(k):e[T].splice($,1),x(e)}}),t(dn,{icons:u,icon:d,iconSrc:p}),e(xh,{$gap:4,children:[t(Ne,{size:de.XS,nowrap:!0,children:i}),t(ue,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:c&&t($e,{text:s||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:t(We,{label:c,status:l&&[Pe.Error,Pe.Warning].includes(l)?l:Pe.Unknown,leftIcon:I,textSize:de.XXXS})})})]})]})};function Th(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===Pe.Loading)?e:{...e,workloadOdigosHealthStatus:{status:Yt.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function $h(e){const t=Object.values(e.conditions??{}).filter(Boolean),n=t.filter(({status:e})=>e!==Pe.Loading);return n?.length===t?.length?e:{...e,conditions:n?.length?n.reduce((e,t)=>(e[t.name]=t,e),{}):{}}}const Ih=g.div`
728
741
  position: absolute;
729
742
  top: 0;
730
743
  left: 0;
@@ -735,22 +748,21 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
735
748
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
736
749
  border-bottom: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
737
750
  pointer-events: none;
738
- `,eh=g.div`
751
+ `,Eh=g.div`
739
752
  display: flex;
740
753
  align-items: center;
741
754
  gap: 8px;
742
755
  padding: 4px 8px 0;
743
- `,th=g.div`
756
+ `,Ah=g.div`
744
757
  flex: 1;
745
758
  height: 1px;
746
759
  background: ${({theme:e})=>e.v2.colors.silver[700]};
747
- `,nh=({namespace:e})=>{const n=f();return t(Qp,{children:t(ae,{size:le.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:e})})},oh=({namespace:n})=>{const o=f();return e(eh,{children:[t(th,{}),t(ae,{size:le.XXS,nowrap:!0,color:o.v2.colors.grey[300],children:n}),t(th,{})]})},ah={[gt.InstrumentationRule]:Ge.NO_DATA_INSTRUMENTATION_RULES,[gt.Source]:Ge.NO_DATA_SOURCES,[gt.Action]:Ge.NO_DATA_ACTIONS,[gt.Destination]:Ge.NO_DATA_DESTINATIONS},ih=g.div`
760
+ `,Nh=({namespace:e})=>{const n=f();return t(Ih,{children:t(se,{size:de.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:e})})},Oh=({namespace:n})=>{const o=f();return e(Eh,{children:[t(Ah,{}),t(se,{size:de.XXS,nowrap:!0,color:o.v2.colors.grey[300],children:n}),t(Ah,{})]})},Rh={[xt.InstrumentationRule]:qe.NO_DATA_INSTRUMENTATION_RULES,[xt.Source]:qe.NO_DATA_SOURCES,[xt.Action]:qe.NO_DATA_ACTIONS,[xt.Destination]:qe.NO_DATA_DESTINATIONS},Dh=g.div`
748
761
  display: flex;
749
762
  flex-direction: column;
750
763
  flex: 1 0 0;
751
764
  min-width: 0;
752
- ${({$isVm:e})=>e?"width: 45vw;":""}
753
- `,lh=g.div`
765
+ `,Ph=g.div`
754
766
  display: flex;
755
767
  flex-direction: column;
756
768
  align-items: stretch;
@@ -760,7 +772,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
760
772
  border-radius: 0 0 16px 16px;
761
773
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
762
774
  overflow: hidden;
763
- `,sh=g.div`
775
+ `,Fh=g.div`
764
776
  position: relative;
765
777
  display: flex;
766
778
  flex-direction: column;
@@ -772,7 +784,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
772
784
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
773
785
  height: ${({$height:e})=>e}px;
774
786
  overflow: hidden;
775
- `,rh=(e,t,n)=>{const o=xt(e);if(!o)return null;const a=t===gt.Source;let i,l,s=!1,r=e;if(a){const t=function(e){const t=e.workloadOdigosHealthStatus?.status;switch(t){case Vt.Failure:return{status:Ie.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case Vt.Notice:return{status:Ie.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case Vt.Pending:case Vt.Waiting:return{status:void 0,faded:!1,displaySource:qp(e)};case Vt.Unsupported:case Vt.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return{status:void 0,faded:!1,displaySource:Zp(e)}}}(e);i=t.status,s=t.faded,l=t.tooltip,r=t.displaySource}else{const{priorotizedStatus:t,hasDisableds:n}=ka(e.conditions);i=t,s=n}const c=Ta(e,t,{extended:a,prioritizeDisplayName:!a});let d,u,p,h,m;switch(t){case gt.Source:{d=tn(e),u=Ia(gt.Source);const t=n?.get($a(o));h=ln(t);break}case gt.Destination:{const t=ut(e.destinationType.type);u=t.icon,p=t.iconSrc;const a=n?.get($a(o));h=ln(a),m=!e.disabled;break}case gt.Action:u=Et(e.type),m=!e.disabled;break;case gt.InstrumentationRule:u=Mt(e.type),m=!e.disabled}return{key:$a(o),entityId:o,namespace:a?e.id.namespace:void 0,raw:r,itemProps:{entityId:o,entityType:t,title:c,status:i,faded:s,tooltip:l,throughput:h,icon:u,icons:d,iconSrc:p,isActive:m,raw:r}}},ch=({entityType:n,entities:i,unfilteredCount:r,metrics:c,loading:d,maxHeight:u,refetch:p})=>{const{isVm:h}=y(),m=n===gt.Source,g=i.length!==r,f=yt(e=>m?e.progress[wt.Instrumenting]?.percentage:void 0),b=yt(e=>m?e.progress[wt.Uninstrumenting]?.percentage:void 0),v=!m||void 0===f&&void 0===b?void 0:f||b||0,{selectedSources:C,setSelectedSources:S}=Sa(),w=a(()=>m?Object.values(C).reduce((e,t)=>e+t.length,0):0,[m,C]),x=a(()=>{if(!c)return;const e=new Map,t=n===gt.Source?c.sources:n===gt.Destination?c.destinations:void 0;if(t)for(const n of t)e.set(xa(n),n.throughput);return e},[c,n]),k=a(()=>i.map(e=>rh(e,n,x)).filter(Boolean),[i,n,x]),[T,$]=s(""),{elements:I,indexToNamespace:E,multipleNs:A,dividerCount:N}=a(()=>{const e=[],n=[],o=new Set(k.map(e=>e.namespace).filter(Boolean)).size>1;o&&(n.push(""),e.push(t("div",{style:{height:24}},"ns-spacer")));let a=0,i="";for(const o of k)m&&o.namespace&&o.namespace!==i&&(""!==i&&(n.push(o.namespace),e.push(t(oh,{namespace:o.namespace},`ns-divider-${o.namespace}`)),a+=1),i=o.namespace),n.push(o.namespace||""),e.push(t(Jp,{...o.itemProps},o.key));return{elements:e,indexToNamespace:n,multipleNs:o,dividerCount:a}},[k,m]);o(()=>{if(m&&E.length&&!T){const e=E.find(Boolean);e&&$(e)}},[m,E]);const O=l(e=>{if(!E.length)return;const t=E[Math.min(e,E.length-1)];t&&t!==T&&$(t)},[E,T]);if(h&&[gt.InstrumentationRule,gt.Action].includes(n))return null;const R=58*k.length+(A?28:0)+32*N,D=Math.max(0,u-52-16),P=Math.min(D,R)+8,F="number"==typeof v?`${v}%`:g?`${i.length}/${r}`:r;return e(ih,{$isVm:h,children:[t(Hp,{entityType:n,badge:F,badgeTooltip:g?Ge.FILTERED_COUNT_TOOLTIP:void 0,isLoading:d,refetch:p,partiallySelected:w>0&&i?.length!==w,allSelected:w>0&&i?.length===w,onSelectAll:m?e=>{if(m)if(e){const e={};i?.forEach(t=>{const{namespace:n}=t.id;e[n]?e[n].push(t):e[n]=[t]}),S(e)}else S({})}:void 0,progressPercent:v}),t(lh,{children:i.length?e(sh,{$height:P,children:[A&&T&&t(nh,{namespace:T}),t(qt,{gap:4,elements:I,onTopIndexChange:A?O:void 0})]}):d?t(an,{size:3}):t(Wp,{entityType:n,description:ah[n]??Ge.TO_COLLECT_OTEL_DATA})})]})},dh=g.div`
787
+ `,Lh=(e,t,n)=>{const o=Ot(e);if(!o)return null;const a=t===xt.Source;let i,l,r=!1,s=e;if(a){const t=function(e){const t=e.workloadOdigosHealthStatus?.status;switch(t){case Yt.Failure:return{status:Pe.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case Yt.Notice:return{status:Pe.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case Yt.Pending:case Yt.Waiting:return{status:void 0,faded:!1,displaySource:Th(e)};case Yt.Unsupported:case Yt.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return{status:void 0,faded:!1,displaySource:$h(e)}}}(e);i=t.status,r=t.faded,l=t.tooltip,s=t.displaySource}else{const{priorotizedStatus:t,hasDisableds:n}=Fa(e.conditions);i=t,r=n}const c=La(e,t,{extended:a,prioritizeDisplayName:!a});let d,u,p,h,m;switch(t){case xt.Source:{d=cn(e),u=_a(xt.Source);const t=n?.get(Ma(o));h=pn(t);break}case xt.Destination:{const t=Ct(e.destinationType.type);u=t.icon,p=t.iconSrc;const a=n?.get(Ma(o));h=pn(a),m=!e.disabled;break}case xt.Action:u=Lt(e.type),m=!e.disabled;break;case xt.InstrumentationRule:u=Gt(e.type),m=!e.disabled}return{key:Ma(o),entityId:o,namespace:a?e.id.namespace:void 0,raw:s,itemProps:{entityId:o,entityType:t,title:c,status:i,faded:r,tooltip:l,throughput:h,icon:u,icons:d,iconSrc:p,isActive:m,raw:s}}},Mh=({entityType:n,entities:i,unfilteredCount:s,metrics:c,loading:d,maxHeight:u,refetch:p})=>{const h=n===xt.Source,m=i.length!==s,g=It(e=>h?e.progress[Nt.Instrumenting]?.percentage:void 0),f=It(e=>h?e.progress[Nt.Uninstrumenting]?.percentage:void 0),b=!h||void 0===g&&void 0===f?void 0:g||f||0,{selectedSources:y,setSelectedSources:v}=Ra(),C=a(()=>h?Object.values(y).reduce((e,t)=>e+t.length,0):0,[h,y]),S=a(()=>{if(!c)return;const e=new Map,t=n===xt.Source?c.sources:n===xt.Destination?c.destinations:void 0;if(t)for(const n of t)e.set(Pa(n),n.throughput);return e},[c,n]),w=a(()=>i.map(e=>Lh(e,n,S)).filter(Boolean),[i,n,S]),[x,k]=r(""),{elements:T,indexToNamespace:$,multipleNs:I,dividerCount:E}=a(()=>{const e=[],n=[],o=new Set(w.map(e=>e.namespace).filter(Boolean)).size>1;o&&(n.push(""),e.push(t("div",{style:{height:24}},"ns-spacer")));let a=0,i="";for(const o of w)h&&o.namespace&&o.namespace!==i&&(""!==i&&(n.push(o.namespace),e.push(t(Oh,{namespace:o.namespace},`ns-divider-${o.namespace}`)),a+=1),i=o.namespace),n.push(o.namespace||""),e.push(t(kh,{...o.itemProps},o.key));return{elements:e,indexToNamespace:n,multipleNs:o,dividerCount:a}},[w,h]);o(()=>{if(h&&$.length&&!x){const e=$.find(Boolean);e&&k(e)}},[h,$]);const A=l(e=>{if(!$.length)return;const t=$[Math.min(e,$.length-1)];t&&t!==x&&k(t)},[$,x]),N=58*w.length+(I?28:0)+32*E,O=Math.max(0,u-52-16),R=Math.min(O,N)+8,D="number"==typeof b?`${b}%`:m?`${i.length}/${s}`:s;return e(Dh,{children:[t(vh,{entityType:n,badge:D,badgeTooltip:m?qe.FILTERED_COUNT_TOOLTIP:void 0,isLoading:d,refetch:p,partiallySelected:C>0&&i?.length!==C,allSelected:C>0&&i?.length===C,onSelectAll:h?e=>{if(h)if(e){const e={};i?.forEach(t=>{const{namespace:n}=t.id;e[n]?e[n].push(t):e[n]=[t]}),v(e)}else v({})}:void 0,progressPercent:b}),t(Ph,{children:i.length?e(Fh,{$height:R,children:[I&&x&&t(Nh,{namespace:x}),t(an,{gap:4,elements:T,onTopIndexChange:I?A:void 0})]}):d?t(pt,{size:3}):t(Sh,{entityType:n,description:Rh[n]??qe.TO_COLLECT_OTEL_DATA})})]})},_h=g.div`
776
788
  width: 100%;
777
789
  flex: 1;
778
790
  min-height: 0;
@@ -780,10 +792,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
780
792
  display: flex;
781
793
  align-items: stretch;
782
794
  gap: 16px;
783
- `,uh={sources:[],destinations:[]},ph=()=>{const n=ga(),{selectedStreamName:o}=He(),{containerRef:i,containerHeight:l}=Ea(),{sourcesApi:s,destinationsApi:r,actionsApi:c,instrumentationRulesApi:d,metricsApi:u}=ll(),{items:p,loading:h}=s.useSources(),{items:m,loading:g}=r.useDestinations(),{items:f,loading:b}=c.useActions(),{items:v,loading:y}=d.useRules(),C=Zt(e=>e.drawerType),S=Un(e=>e.currentModal),{data:w}=u.useMetrics({skip:!(p.length&&m.length&&!C&&!S),pollInterval:1e4,fetchPolicy:"network-only"}),x=w?.getOverviewMetrics??uh,k=a(()=>fa(p,o),[p,o]),T=a(()=>Rt(m,o),[m,o]),$=a(()=>Aa(k,n),[k,n]),I=a(()=>Na(T,n),[T,n]),E=a(()=>Oa(f,n),[f,n]);return e(dh,{ref:i,children:[t(ch,{entityType:gt.InstrumentationRule,entities:v,unfilteredCount:v.length,loading:y,maxHeight:l,refetch:d.fetchAll}),t(ch,{entityType:gt.Source,entities:$,unfilteredCount:k.length,metrics:x,loading:h,maxHeight:l,refetch:s.fetchAll}),t(ch,{entityType:gt.Action,entities:E,unfilteredCount:f.length,loading:b,maxHeight:l,refetch:c.fetchAll}),t(ch,{entityType:gt.Destination,entities:I,unfilteredCount:T.length,metrics:x,loading:g,maxHeight:l,refetch:r.fetchAll})]})},hh="40vw",mh=g.div`
795
+ `,zh={sources:[],destinations:[]},Bh=()=>{const n=$a(),{selectedStreamName:o}=Ze(),{containerRef:i,containerHeight:l}=za(),{sourcesApi:r,destinationsApi:s,actionsApi:c,instrumentationRulesApi:d,metricsApi:u}=bl(),{items:p,loading:h}=r.useSources(),{items:m,loading:g}=s.useDestinations(),{items:f,loading:b}=c.useActions(),{items:y,loading:v}=d.useRules(),C=ln(e=>e.drawerType),S=Qn(e=>e.currentModal),{data:w}=u.useMetrics({skip:!(p.length&&m.length&&!C&&!S),pollInterval:1e4,fetchPolicy:"network-only"}),x=w?.getOverviewMetrics??zh,k=a(()=>Ia(p,o),[p,o]),T=a(()=>zt(m,o),[m,o]),$=a(()=>Ba(k,n),[k,n]),I=a(()=>Xa(T,n),[T,n]),E=a(()=>Va(f,n),[f,n]);return e(_h,{ref:i,children:[t(Mh,{entityType:xt.InstrumentationRule,entities:y,unfilteredCount:y.length,loading:v,maxHeight:l,refetch:d.fetchAll}),t(Mh,{entityType:xt.Source,entities:$,unfilteredCount:k.length,metrics:x,loading:h,maxHeight:l,refetch:r.fetchAll}),t(Mh,{entityType:xt.Action,entities:E,unfilteredCount:f.length,loading:b,maxHeight:l,refetch:c.fetchAll}),t(Mh,{entityType:xt.Destination,entities:I,unfilteredCount:T.length,metrics:x,loading:g,maxHeight:l,refetch:s.fetchAll})]})},Xh="40vw",Vh=g.div`
784
796
  position: relative;
785
- width: ${hh};
786
- `,gh=g.div`
797
+ width: ${Xh};
798
+ `,Uh=g.div`
787
799
  position: absolute;
788
800
  top: calc(100% + 8px);
789
801
  left: 0;
@@ -792,23 +804,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
792
804
  flex-direction: column;
793
805
  gap: 8px;
794
806
  padding: 8px;
795
- width: calc(${hh} - 16px);
807
+ width: calc(${Xh} - 16px);
796
808
  border-radius: 12px;
797
809
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
798
810
  box-shadow: 0 12px 24px 24px rgba(0, 0, 0, 0.5);
799
- `,fh=g.div`
811
+ `,jh=g.div`
800
812
  display: flex;
801
813
  align-items: center;
802
814
  overflow-x: auto;
803
- `,bh=g.div`
815
+ `,Gh=g.div`
804
816
  display: flex;
805
817
  flex-direction: column;
806
818
  gap: 0;
807
819
  max-height: 60vh;
808
820
  overflow-y: auto;
809
- `,vh=g.div`
821
+ `,Hh=g.div`
810
822
  padding: 8px 12px 4px 12px;
811
- `,yh=g.div`
823
+ `,Wh=g.div`
812
824
  display: flex;
813
825
  align-items: center;
814
826
  gap: 8px;
@@ -818,12 +830,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
818
830
  &:hover {
819
831
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
820
832
  }
821
- `,Ch=g.div`
833
+ `,Kh=g.div`
822
834
  padding: 16px 8px;
823
- `,Sh=({preventPopup:n=!1})=>{const o=f(),{onClickNode:l}=Ra(),{searchText:c,setSearchText:d}=ga(),{selectedStreamName:u}=He(),{sourcesApi:p,destinationsApi:h,actionsApi:m,instrumentationRulesApi:g}=ll(),b=p.useSources().items,v=h.useDestinations().items,y=m.useActions().items,C=g.useRules().items,S=i(null),[w,x]=s(!1),[k,T]=s("all"),$=!n&&(!!c||w),I=()=>{d(""),x(!1),T("all")};cn(S,()=>I()),_n({key:"Escape",active:$},I);const{categories:E,searchResults:A}=a(()=>(({instrumentationRules:e,sources:t,actions:n,destinations:o,searchText:a,selectedCategory:i})=>{const l=a?e.filter(e=>e.type?.toLowerCase().includes(a)||e.ruleName?.toLowerCase().includes(a)):e,s=a?t.filter(e=>e.id.name?.toLowerCase().includes(a)||e.serviceName?.toLowerCase().includes(a)||e.id.namespace?.toLowerCase().includes(a)):t,r=a?n.filter(e=>e.type?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):n,c=a?o.filter(e=>e.destinationType.displayName?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):o,d=[{category:gt.Source,label:"Sources",count:s.length,entities:[]},{category:gt.Action,label:"Actions",count:r.length,entities:[]},{category:gt.Destination,label:"Destinations",count:c.length,entities:[]},{category:gt.InstrumentationRule,label:"Instrumentation Rules",count:l.length,entities:[]}];d.unshift({category:"all",label:"All",count:l.length+s.length+r.length+c.length,entities:[]});const u=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(i)).map(e=>({...e,entities:e.category===gt.InstrumentationRule?l:e.category===gt.Source?s:e.category===gt.Action?r:e.category===gt.Destination?c:[]}));return{categories:d,searchResults:u}})({instrumentationRules:C,sources:fa(b,u),actions:y,destinations:Rt(v,u),searchText:c,selectedCategory:k}),[C,b,y,v,u,c,k]),N=a(()=>E.filter(({count:e,category:t})=>!!e||"all"===t).map(({category:e,label:t,count:n})=>({value:e,label:n?`${t} (${n})`:t})),[E]),O=A.some(({entities:e})=>e.length>0);return e(mh,{ref:S,children:[t(Jt,{value:c,onChange:e=>d(e.toLowerCase()),onFocus:()=>x(!0),width:hh}),$&&e(gh,{children:[N.length>1&&t(fh,{children:t(ue,{options:N,selected:k,setSelected:T})}),O?t(bh,{children:A.map(({category:n,label:a,entities:i},s)=>{if(!i.length)return null;const c=Ia(n);return e(r,{children:[t(vh,{children:t(ae,{size:le.XXS,color:ie.Secondary,children:a})}),i.map((a,i)=>e(yh,{onClick:()=>{const e=xt(a);l(null,{data:{type:n,id:e}}),I()},children:[c&&t(c,{size:16,fill:o.v2.colors.white[500]}),t(ae,{size:le.XS,nowrap:!0,children:Ta(a,n,{extended:!0})})]},`entity-${s}-${i}`))]},`category-list-${n}`)})}):t(Ch,{children:t(Ce,{hideIcon:!0,title:"No results",subTitle:c?`No matches for "${c}"`:"Start typing to search"})})]})]})},wh=({onRedirectToSampling:o})=>{const{sourcesApi:i}=ll(),{items:l}=i.useSources(),{currentModal:s,setCurrentModal:r}=Un(),{drawerType:c,drawerEntityId:d,setDrawerType:u,setDrawerEntityId:p}=Zt(),h=()=>{r("")},m=()=>{u(null),p(null)},g=a(()=>l.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[l]),f=a(()=>Array.from(new Set(l.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[l]);return e(n,{children:[t(yu,{}),s===gt.Source&&t(Xl,{children:t(Lr,{onClose:h,withOverlay:!0})}),s===gt.Destination&&t(Vl,{children:t(gr,{onClose:h,withOverlay:!0})}),s===gt.InstrumentationRule&&t(Gl,{sourceOptions:g,namespaceOptions:f,children:t(fr,{onClose:h,withOverlay:!0})}),s===gt.Action&&t(Ul,{children:t(ir,{onClose:h,withOverlay:!0})}),c===gt.Source&&d&&t(Hl,{children:t(Hd,{onClose:m,sourceId:d,onRedirectToSampling:o})}),c===gt.Destination&&d&&t(Vl,{children:t(Xr,{onClose:m,destinationId:d})}),c===gt.InstrumentationRule&&d&&t(Gl,{sourceOptions:g,namespaceOptions:f,children:t(Ur,{onClose:m,ruleId:d})}),c===gt.Action&&d&&t(Ul,{children:t(Mr,{onClose:m,actionId:d})})]})},xh=e=>`Data Stream: ${e}`,kh="Search streams...",Th="No streams match",$h=g.div`
835
+ `,Yh=({preventPopup:n=!1})=>{const o=f(),{onClickNode:l}=Ua(),{searchText:c,setSearchText:d}=$a(),{selectedStreamName:u}=Ze(),{sourcesApi:p,destinationsApi:h,actionsApi:m,instrumentationRulesApi:g}=bl(),b=p.useSources().items,y=h.useDestinations().items,v=m.useActions().items,C=g.useRules().items,S=i(null),[w,x]=r(!1),[k,T]=r("all"),$=!n&&(!!c||w),I=()=>{d(""),x(!1),T("all")};gn(S,()=>I()),Wn({key:"Escape",active:$},I);const{categories:E,searchResults:A}=a(()=>(({instrumentationRules:e,sources:t,actions:n,destinations:o,searchText:a,selectedCategory:i})=>{const l=a?e.filter(e=>e.type?.toLowerCase().includes(a)||e.ruleName?.toLowerCase().includes(a)):e,r=a?t.filter(e=>e.id.name?.toLowerCase().includes(a)||e.serviceName?.toLowerCase().includes(a)||e.id.namespace?.toLowerCase().includes(a)):t,s=a?n.filter(e=>e.type?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):n,c=a?o.filter(e=>e.destinationType.displayName?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):o,d=[{category:xt.Source,label:"Sources",count:r.length,entities:[]},{category:xt.Action,label:"Actions",count:s.length,entities:[]},{category:xt.Destination,label:"Destinations",count:c.length,entities:[]},{category:xt.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(i)).map(e=>({...e,entities:e.category===xt.InstrumentationRule?l:e.category===xt.Source?r:e.category===xt.Action?s:e.category===xt.Destination?c:[]}));return{categories:d,searchResults:u}})({instrumentationRules:C,sources:Ia(b,u),actions:v,destinations:zt(y,u),searchText:c,selectedCategory:k}),[C,b,v,y,u,c,k]),N=a(()=>E.filter(({count:e,category:t})=>!!e||"all"===t).map(({category:e,label:t,count:n})=>({value:e,label:n?`${t} (${n})`:t})),[E]),O=A.some(({entities:e})=>e.length>0);return e(Vh,{ref:S,children:[t(on,{value:c,onChange:e=>d(e.toLowerCase()),onFocus:()=>x(!0),width:Xh}),$&&e(Uh,{children:[N.length>1&&t(jh,{children:t(ge,{options:N,selected:k,setSelected:T})}),O?t(Gh,{children:A.map(({category:n,label:a,entities:i},r)=>{if(!i.length)return null;const c=_a(n);return e(s,{children:[t(Hh,{children:t(se,{size:de.XXS,color:ce.Secondary,children:a})}),i.map((a,i)=>e(Wh,{onClick:()=>{const e=Ot(a);l(null,{data:{type:n,id:e}}),I()},children:[c&&t(c,{size:16,fill:o.v2.colors.white[500]}),t(se,{size:de.XS,nowrap:!0,children:La(a,n,{extended:!0})})]},`entity-${r}-${i}`))]},`category-list-${n}`)})}):t(Kh,{children:t(Ae,{hideIcon:!0,title:"No results",subTitle:c?`No matches for "${c}"`:"Start typing to search"})})]})]})},Jh=({onRedirectToSampling:o})=>{const{sourcesApi:i}=bl(),{items:l}=i.useSources(),{currentModal:r,setCurrentModal:s}=Qn(),{drawerType:c,drawerEntityId:d,setDrawerType:u,setDrawerEntityId:p}=ln(),h=()=>{s("")},m=()=>{u(null),p(null)},g=a(()=>l.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[l]),f=a(()=>Array.from(new Set(l.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[l]);return e(n,{children:[t(Wu,{}),r===xt.Source&&t(Zl,{children:t(rc,{onClose:h,withOverlay:!0})}),r===xt.Destination&&t(Ql,{children:t(Bs,{onClose:h,withOverlay:!0})}),r===xt.InstrumentationRule&&t(tr,{sourceOptions:g,namespaceOptions:f,children:t(Xs,{onClose:h,withOverlay:!0})}),r===xt.Action&&t(er,{children:t(Ns,{onClose:h,withOverlay:!0})}),c===xt.Source&&d&&t(nr,{children:t(vu,{onClose:m,sourceId:d,onRedirectToSampling:o})}),c===xt.Destination&&d&&t(Ql,{children:t(pc,{onClose:m,destinationId:d})}),c===xt.InstrumentationRule&&d&&t(tr,{sourceOptions:g,namespaceOptions:f,children:t(mc,{onClose:m,ruleId:d})}),c===xt.Action&&d&&t(er,{children:t(cc,{onClose:m,actionId:d})})]})},qh=e=>`Data Stream: ${e}`,Zh="Search streams...",Qh="No streams match",em=g.div`
824
836
  position: relative;
825
837
  display: inline-flex;
826
- `,Ih=g.div`
838
+ `,tm=g.div`
827
839
  display: inline-flex;
828
840
  align-items: center;
829
841
  gap: 6px;
@@ -834,7 +846,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
834
846
  &:hover {
835
847
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
836
848
  }
837
- `,Eh=g.div`
849
+ `,nm=g.div`
838
850
  position: absolute;
839
851
  top: calc(100% + 8px);
840
852
  left: 0;
@@ -848,18 +860,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
848
860
  border-radius: 12px;
849
861
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
850
862
  box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
851
- `,Ah=g.div`
863
+ `,om=g.div`
852
864
  display: flex;
853
865
  align-items: center;
854
866
  gap: 8px;
855
867
  width: 100%;
856
- `,Nh=g.div`
868
+ `,am=g.div`
857
869
  display: flex;
858
870
  flex-direction: column;
859
871
  gap: 0;
860
872
  max-height: 240px;
861
873
  overflow-y: auto;
862
- `,Oh=g.div`
874
+ `,im=g.div`
863
875
  display: flex;
864
876
  align-items: center;
865
877
  gap: 8px;
@@ -870,29 +882,29 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
870
882
  &:hover {
871
883
  background-color: ${({$selected:e,theme:t})=>e?t.v2.colors.silver[600]:t.v2.colors.silver[700]};
872
884
  }
873
- `,Rh=g.div`
885
+ `,lm=g.div`
874
886
  flex: 1;
875
887
  min-width: 0;
876
888
  overflow: hidden;
877
889
  text-overflow: ellipsis;
878
890
  white-space: nowrap;
879
- `,Dh=g.div`
891
+ `,rm=g.div`
880
892
  display: flex;
881
893
  align-items: center;
882
894
  gap: 2px;
883
895
  flex-shrink: 0;
884
- `,Ph=g.div`
896
+ `,sm=g.div`
885
897
  display: flex;
886
898
  padding-top: 4px;
887
899
  border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
888
- `,Fh=()=>{const l=f(),{isVm:r}=y(),{clearStore:c}=Da(),{dataStreamsApi:d}=ll();d.useDataStreams();const{dataStreams:u,selectedStreamName:p,setSelectedStreamName:h}=He(),m=i(null),[g,b]=s(!1),[v,C]=s(""),[S,w]=s(""),[x,k]=s(!1),[T,$]=s(!1),[I,E]=s(!1),[A,N]=s(""),[O,R]=s(!1);cn(m,()=>b(!1)),o(()=>{g||C("")},[g]);const D=a(()=>{if(!v)return u;const e=v.toLowerCase();return u.filter(({name:t})=>t.toLowerCase().includes(e))},[u,v]),P=g?yi:Ci;return r?null:e(n,{children:[e($h,{ref:m,children:[e(Ih,{"data-id":"data-stream-select",$isOpen:g,onClick:()=>b(e=>!e),children:[t(el,{size:24}),t(ae,{size:le.S,weight:500,nowrap:!0,children:xh(p)}),t(Be,{label:u.length,status:Ie.Unknown,textSize:le.XXXS}),t(P,{size:20,fill:l.v2.colors.silver[200]})]}),g&&e(Eh,{children:[t(Ah,{children:t(Jt,{value:v,onChange:C,placeholder:kh,width:"100%"})}),t(Nh,{children:0===D.length?t(Oh,{children:t(ae,{size:le.XS,color:ie.Secondary,children:Th})}):D.map(({name:n})=>{const o=n===Pa;return e(Oh,{"data-id":`stream-row-${n}`,$selected:n===p,onClick:()=>(e=>{e!==p&&(c(),h(e)),b(!1)})(n),children:[t(Rh,{children:t(ae,{size:le.XS,nowrap:!0,children:n})}),e(Dh,{children:[t(st,{"data-id":`stream-edit-${n}`,icon:hi,size:rt.XS,onClick:e=>{e.stopPropagation(),b(!1),w(n),k(!0)}}),!o&&t(st,{"data-id":`stream-delete-${n}`,icon:li,size:rt.XS,onClick:e=>{e.stopPropagation(),b(!1),N(n),R(!0)}})]})]},`stream-${n}`)})}),t(Ph,{children:t(re,{"data-id":"add-stream-trigger",variant:de.Secondary,size:ce.S,leftIcon:si,label:`${kt.NEW} ${Ge.STREAM_NAME}`,fullWidth:!0,onClick:()=>{b(!1),c(),E(!0),$(!0)}})})]})]}),I&&t(jl,{defaultExcludeName:p,children:t(mu,{isOpen:T,onClose:()=>$(!1),onCloseEnd:()=>E(!1)})}),S&&t(jl,{children:t(gu,{isOpen:x,dataStreamName:S,onClose:()=>k(!1),onCloseEnd:()=>w("")})}),t(Sl,{target:`${Ge.STREAM_NAME.toLowerCase()} "${A}"`,isOpen:O,onClose:()=>R(!1),onApprove:async()=>{A&&await d.remove(A)}})]})},Lh="multi-source-deselect",_h="multi-source-restart",Mh="multi-source-uninstrument",zh="Selected sources",Bh="Deselect",Xh="Restart",Vh="Uninstrument",Uh="Rollout Restart Workloads",Gh="Are you sure you want to rollout restart these workloads?",Hh="Go Back",jh="Confirm",Wh=()=>{const{selectedStreamName:i}=He(),{selectedSources:r,setSelectedSources:c}=Sa(),{sourcesApi:d}=ll(),[u,p]=s(!1),[h,m]=s(!1),g=a(()=>Object.values(r).reduce((e,t)=>e+t.length,0),[r]),f=l(()=>{c({})},[c]),b=l(()=>p(!1),[]),v=l(()=>m(!1),[]);o(()=>{f()},[i,f]);const y=l(()=>{d.restartWorkloads(Object.values(r).flat().filter(e=>e.id.kind!==on.StaticPod).map(Qt)),f()},[d,r,f]),C=l(()=>{d.persistV2(Object.fromEntries(Object.entries(r).map(([e,t])=>[e,t.map(({id:e})=>({namespace:e.namespace,name:e.name,kind:e.kind||void 0,selected:!1,currentStreamName:i}))]))),f()},[d,r,i,f]),S=a(()=>[{id:Lh,type:Yt.Button,buttonProps:{variant:de.Text,size:ce.S,label:Bh,onClick:f}},{id:_h,type:Yt.Button,buttonProps:{variant:de.Secondary,size:ce.S,label:Xh,leftIcon:Gi,onClick:()=>p(!0)}},{id:Mh,type:Yt.Button,buttonProps:{variant:de.Primary,size:ce.S,label:Vh,leftIcon:li,onClick:()=>m(!0)}}],[f]);return e(n,{children:[t(vn,{isOpen:g>0,richTitle:{icon:ki,title:zh,badge:{label:g}},actions:S}),t(Ue,{isOpen:u,title:Uh,description:Gh,onClose:b,denyButton:{label:Hh,variant:de.Secondary,onClick:b},approveButton:{label:jh,variant:de.Primary,onClick:()=>{y(),b()}}}),t(Sl,{isOpen:h,action:"uninstrument",target:`${g} source${1===g?"":"s"}`,onClose:v,onDeny:v,onApprove:C})]})},Kh=v`
900
+ `,cm=()=>{const l=f(),{isVm:s}=v(),{clearStore:c}=ja(),{dataStreamsApi:d}=bl();d.useDataStreams();const{dataStreams:u,selectedStreamName:p,setSelectedStreamName:h}=Ze(),m=i(null),[g,b]=r(!1),[y,C]=r(""),[S,w]=r(""),[x,k]=r(!1),[T,$]=r(!1),[I,E]=r(!1),[A,N]=r(""),[O,R]=r(!1);gn(m,()=>b(!1)),o(()=>{g||C("")},[g]);const D=a(()=>{if(!y)return u;const e=y.toLowerCase();return u.filter(({name:t})=>t.toLowerCase().includes(e))},[u,y]),P=g?Ni:Oi;return s?null:e(n,{children:[e(em,{ref:m,children:[e(tm,{"data-id":"data-stream-select",$isOpen:g,onClick:()=>b(e=>!e),children:[t(ul,{size:24}),t(se,{size:de.S,weight:500,nowrap:!0,children:qh(p)}),t(We,{label:u.length,status:Pe.Unknown,textSize:de.XXXS}),t(P,{size:20,fill:l.v2.colors.silver[200]})]}),g&&e(nm,{children:[t(om,{children:t(on,{value:y,onChange:C,placeholder:Zh,width:"100%"})}),t(am,{children:0===D.length?t(im,{children:t(se,{size:de.XS,color:ce.Secondary,children:Qh})}):D.map(({name:n})=>{const o=n===Ga;return e(im,{"data-id":`stream-row-${n}`,$selected:n===p,onClick:()=>(e=>{e!==p&&(c(),h(e)),b(!1)})(n),children:[t(lm,{children:t(se,{size:de.XS,nowrap:!0,children:n})}),e(rm,{children:[t(ft,{"data-id":`stream-edit-${n}`,icon:ki,size:bt.XS,onClick:e=>{e.stopPropagation(),b(!1),w(n),k(!0)}}),!o&&t(ft,{"data-id":`stream-delete-${n}`,icon:bi,size:bt.XS,onClick:e=>{e.stopPropagation(),b(!1),N(n),R(!0)}})]})]},`stream-${n}`)})}),t(sm,{children:t(pe,{"data-id":"add-stream-trigger",variant:me.Secondary,size:he.S,leftIcon:yi,label:`${Dt.NEW} ${qe.STREAM_NAME}`,fullWidth:!0,onClick:()=>{b(!1),c(),E(!0),$(!0)}})})]})]}),I&&t(or,{defaultExcludeName:p,children:t(Vu,{isOpen:T,onClose:()=>$(!1),onCloseEnd:()=>E(!1)})}),S&&t(or,{children:t(Uu,{isOpen:x,dataStreamName:S,onClose:()=>k(!1),onCloseEnd:()=>w("")})}),t(Rl,{target:`${qe.STREAM_NAME.toLowerCase()} "${A}"`,isOpen:O,onClose:()=>R(!1),onApprove:async()=>{A&&await d.remove(A)}})]})},dm="multi-source-deselect",um="multi-source-restart",pm="multi-source-uninstrument",hm="Selected sources",mm="Deselect",gm="Restart",fm="Uninstrument",bm="Rollout Restart Workloads",ym="Are you sure you want to rollout restart these workloads?",vm="Go Back",Cm="Confirm",Sm=()=>{const{selectedStreamName:i}=Ze(),{selectedSources:s,setSelectedSources:c}=Ra(),{sourcesApi:d}=bl(),[u,p]=r(!1),[h,m]=r(!1),g=a(()=>Object.values(s).reduce((e,t)=>e+t.length,0),[s]),f=l(()=>{c({})},[c]),b=l(()=>p(!1),[]),y=l(()=>m(!1),[]);o(()=>{f()},[i,f]);const v=l(()=>{d.restartWorkloads(Object.values(s).flat().filter(e=>e.id.kind!==un.StaticPod).map(rn)),f()},[d,s,f]),C=l(()=>{d.persistV2(Object.fromEntries(Object.entries(s).map(([e,t])=>[e,t.map(({id:e})=>({namespace:e.namespace,name:e.name,kind:e.kind||void 0,selected:!1,currentStreamName:i}))]))),f()},[d,s,i,f]),S=a(()=>[{id:dm,type:nn.Button,buttonProps:{variant:me.Text,size:he.S,label:mm,onClick:f}},{id:um,type:nn.Button,buttonProps:{variant:me.Secondary,size:he.S,label:gm,leftIcon:tl,onClick:()=>p(!0)}},{id:pm,type:nn.Button,buttonProps:{variant:me.Primary,size:he.S,label:fm,leftIcon:bi,onClick:()=>m(!0)}}],[f]);return e(n,{children:[t(kn,{isOpen:g>0,richTitle:{icon:Fi,title:hm,badge:{label:g}},actions:S}),t(Je,{isOpen:u,title:bm,description:ym,onClose:b,denyButton:{label:vm,variant:me.Secondary,onClick:b},approveButton:{label:Cm,variant:me.Primary,onClick:()=>{v(),b()}}}),t(Rl,{isOpen:h,action:"uninstrument",target:`${g} source${1===g?"":"s"}`,onClose:y,onDeny:y,onApprove:C})]})},wm=y`
889
901
  0% {
890
902
  background-position: 200% 50%;
891
903
  }
892
904
  100% {
893
905
  background-position: 0% 50%;
894
906
  }
895
- `,Yh=g.div`
907
+ `,xm=g.div`
896
908
  display: flex;
897
909
  align-items: center;
898
910
  justify-content: space-evenly;
@@ -903,50 +915,50 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
903
915
 
904
916
  background: ${({theme:e})=>`linear-gradient(90deg, ${e.v2.colors.pink[500]} 0%, ${e.v2.colors.purple[400]} 25%, ${e.v2.colors.green[500]} 50%, ${e.v2.colors.purple[400]} 75%, ${e.v2.colors.pink[500]} 100%)`};
905
917
  background-size: 200% 100%;
906
- animation: ${Kh} 15s linear infinite;
907
- `,Jh=[xi,ki,bi,vi],qh=({onRedirectToSampling:n})=>{const o=f();return e(ha,{children:[e(et,{fullHeight:!0,customTitle:t(Fh,{}),customSearch:t(Sh,{}),filters:t(Vp,{}),children:[t(Yh,{children:Jh.map((n,a)=>e(r,{children:[t(n,{size:24}),a<Jh.length-1&&t(fi,{fill:o.v2.colors.white[500]+nt["020"],size:24})]},n.name))}),t(ph,{})]}),t(wh,{onRedirectToSampling:n}),t(Wh,{})]})};var Zh;!function(e){e.Gateway="gateway",e.Node="node"}(Zh||(Zh={}));const Qh=({onClickDownloadDiagnose:n,onClickRefresh:o,loading:i,disabled:l})=>{const s=a(()=>{const e=[];return n&&e.push({id:Vn(),type:Yt.Button,buttonProps:{label:"Download Diagnose",leftIcon:Ui,size:ce.S,variant:de.Text,onClick:n,disabled:l}}),o&&e.push({id:Vn(),type:Yt.Button,buttonProps:{label:"Refresh",leftIcon:Ni,size:ce.S,variant:de.Text,onClick:o,disabled:l,loading:i}}),e},[n,o,l,i]);return e(se,{$alignItems:"center",$justifyContent:"space-between",children:[t(Fa,{icon:tl,title:"Collectors Pipeline"}),t(La,{actions:s})]})},em=({pod:n,onClose:o})=>{const{formatTimeAgo:i}=zt(),{collectorsApi:l}=ll(),{data:s}=l.usePodInfo(n?{namespace:n.namespace,name:n.name}:void 0,{skip:!n}),r=a(()=>[{id:Vn(),title:"Node",label:s?.node??"-",withCopy:!0},{id:Vn(),title:"Status",badge:{status:_a(s?.status),label:s?.status??"-"}}],[s]),c=a(()=>s?.containers?.map(e=>({id:Vn(),items:[{id:Vn(),title:"Container",label:e.name??"-"},{id:Vn(),title:"Status",label:e.startedAt?`${e.status} (since ${i(e.startedAt)})`:e.status},{id:Vn(),title:"Ready",badge:{status:e.ready?Ie.Success:Ie.Error,leftIcon:e.ready?ci:di,label:e.ready?"True":"False",invertColors:!0}},{id:Vn(),title:"Started",badge:{status:e.started?Ie.Success:Ie.Error,leftIcon:e.started?ci:di,label:e.started?"True":"False",invertColors:!0}},{id:Vn(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:Vn(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:Vn(),title:Ge.RESTARTS,label:e.restarts.toString()},{id:Vn(),title:"State Reason",label:e.stateReason??"-"},{id:Vn(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:Vn(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[s]);return t(ne,{isOpen:!!n,header:{icon:Ii,title:"Pod Information",onClose:o},children:s?e($t,{bgTint:"1000",richTitle:{icon:Ii,title:s.name,withCopy:!0},children:[t($t,{bgTint:"900",cellsPerRow:2,items:r}),e($t,{bgTint:"900",richTitle:{icon:Li,title:Ge.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(Kt,{value:`kubectl get pod ${s.name} -n ${s.namespace} -o yaml`}),t(Kt,{value:`kubectl describe pod ${s.name} -n ${s.namespace}`}),t(Kt,{value:`kubectl logs ${s.name} -n ${s.namespace}`})]}),t($t,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:c.length?c.map(({id:e,items:n})=>t($t,{bgTint:"800",cellsPerRow:2,items:n},e)):t(Ce,{title:"No containers",subTitle:"Pod has no containers"})}),t(xl,{bgTint:"900",yaml:s.manifestYAML,defaultOpen:!0})]}):t(at,{$height:"50vh",children:t(ct,{withSpinner:!0})})})};var tm;!function(e){e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropRate="spanDropRate",e.Age="age",e.DockerImage="dockerImage"}(tm||(tm={}));const nm=e=>{const t=[{key:tm.PodName,label:"Pod Name"},{key:tm.Status,label:"Status"},{key:tm.Restarts,label:Ge.RESTARTS},{key:tm.NodeName,label:"Node Name"},{key:tm.Age,label:"Age"},{key:tm.DockerImage,label:"Collector Version"}];return e&&t.splice(4,0,{key:tm.SpanDropRate,label:"Span Drop Rate",noSort:!0,noFilter:!0}),t},om=({isLoading:n,pods:o,withSpanDropRate:i})=>{const l=f(),{formatTimeAgo:r}=zt(),[c,d]=s(null),u=a(()=>o.map(n=>({onClick:()=>d(n),cells:[{key:tm.PodName,rawValue:n.name},{key:tm.Status,rawValue:n.status,component:()=>{return e=n.status,t(Be,{status:_a(e),label:e});var e}},{key:tm.Restarts,rawValue:n.restartsCount.toString()},{key:tm.NodeName,rawValue:n.nodeName},{key:tm.SpanDropRate,rawValue:0,component:()=>{const{collectorMetrics:o}=n;if(!o)return t(ae,{children:"-"});const a=(o?.metricsAcceptedRps??0)+(o?.metricsDroppedRps??0),i=a>0?Math.round((o?.metricsDroppedRps??0)/a*100):0,l=i>0?Ie.Error:Ie.Success,s=(o?.exporterSuccessRps??0)+(o?.exporterFailedRps??0),r=s>0?Math.round((o?.exporterFailedRps??0)/s*100):0,c=r>0?Ie.Error:Ie.Success;return e(se,{$gap:4,children:[t(De,{text:`Accepted: ${o.metricsAcceptedRps.toLocaleString()} spans/s\nDropped: ${o.metricsDroppedRps.toLocaleString()} spans/s`,children:t(Be,{status:l,label:`Receiver ${i}%`,leftIcon:l===Ie.Error?nl:ol,useSecondaryTone:!0,invertColors:!0})}),t(De,{text:`Success: ${o.exporterSuccessRps.toLocaleString()} spans/s\nFailed: ${o.exporterFailedRps.toLocaleString()} spans/s`,children:t(Be,{status:c,label:`Exporter ${r}%`,leftIcon:c===Ie.Error?nl:ol,useSecondaryTone:!0,invertColors:!0})})]})}},{key:tm.Age,rawValue:r(n.creationTimestamp)},{key:tm.DockerImage,rawValue:n.image}]})),[o,l]);return e($t,{fullHeight:!0,bgTint:"1000",moreSpacing:!0,richTitle:{icon:Ii,title:"Pods"},children:[t(fn,{variant:bn.Data,isLoading:n,columns:nm(i),rows:u}),t(em,{pod:c,onClose:()=>d(null)})]})},am=({isOpen:e,onClose:n,title:o,yaml:a})=>t(ne,{isOpen:e,header:{icon:al,title:o,onClose:n},children:t(xl,{yaml:a,defaultOpen:!0})}),im=e=>{switch(e){case Ma.Healthy:return"All desired replicas are updated, available, and ready";case Ma.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case Ma.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case Ma.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case Ma.Down:return"No available replicas";case Ma.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var lm;!function(e){e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"}(lm||(lm={}));const sm=g.div`
918
+ animation: ${wm} 15s linear infinite;
919
+ `,km=[Pi,Fi,Ei,Ai],Tm=({onRedirectToSampling:n})=>{const o=f();return e(ka,{children:[e(rt,{fullHeight:!0,customTitle:t(cm,{}),customSearch:t(Yh,{}),filters:t(fh,{}),children:[t(xm,{children:km.map((n,a)=>e(s,{children:[t(n,{size:24}),a<km.length-1&&t(Ii,{fill:o.v2.colors.white[500]+ct["020"],size:24})]},n.name))}),t(Bh,{})]}),t(Jh,{onRedirectToSampling:n}),t(Sm,{})]})};var $m;!function(e){e.Gateway="gateway",e.Node="node"}($m||($m={}));const Im=({onClickDownloadDiagnose:n,onClickRefresh:o,loading:i,disabled:l})=>{const r=a(()=>{const e=[];return n&&e.push({id:Zn(),type:nn.Button,buttonProps:{label:"Download Diagnose",leftIcon:el,size:he.S,variant:me.Text,onClick:n,disabled:l}}),o&&e.push({id:Zn(),type:nn.Button,buttonProps:{label:"Refresh",leftIcon:Xi,size:he.S,variant:me.Text,onClick:o,disabled:l,loading:i}}),e},[n,o,l,i]);return e(ue,{$alignItems:"center",$justifyContent:"space-between",children:[t(Ha,{icon:pl,title:"Collectors Pipeline"}),t(Wa,{actions:r})]})},Em=({pod:n,onClose:o})=>{const{formatTimeAgo:i}=Ht(),{collectorsApi:l}=bl(),{data:r}=l.usePodInfo(n?{namespace:n.namespace,name:n.name}:void 0,{skip:!n}),s=a(()=>[{id:Zn(),title:"Node",label:r?.node??"-",withCopy:!0},{id:Zn(),title:"Status",badge:{status:Ka(r?.status),label:r?.status??"-"}}],[r]),c=a(()=>r?.containers?.map(e=>({id:Zn(),items:[{id:Zn(),title:"Container",label:e.name??"-"},{id:Zn(),title:"Status",label:e.startedAt?`${e.status} (since ${i(e.startedAt)})`:e.status},{id:Zn(),title:"Ready",badge:{status:e.ready?Pe.Success:Pe.Error,leftIcon:e.ready?Ci:Si,label:e.ready?"True":"False",invertColors:!0}},{id:Zn(),title:"Started",badge:{status:e.started?Pe.Success:Pe.Error,leftIcon:e.started?Ci:Si,label:e.started?"True":"False",invertColors:!0}},{id:Zn(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:Zn(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:Zn(),title:qe.RESTARTS,label:e.restarts.toString()},{id:Zn(),title:"State Reason",label:e.stateReason??"-"},{id:Zn(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:Zn(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[r]);return t(le,{isOpen:!!n,header:{icon:_i,title:"Pod Information",onClose:o},children:r?e(Pt,{bgTint:"1000",richTitle:{icon:_i,title:r.name,withCopy:!0},children:[t(Pt,{bgTint:"900",cellsPerRow:2,items:s}),e(Pt,{bgTint:"900",richTitle:{icon:Wi,title:qe.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(tn,{value:`kubectl get pod ${r.name} -n ${r.namespace} -o yaml`}),t(tn,{value:`kubectl describe pod ${r.name} -n ${r.namespace}`}),t(tn,{value:`kubectl logs ${r.name} -n ${r.namespace}`})]}),t(Pt,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:c.length?c.map(({id:e,items:n})=>t(Pt,{bgTint:"800",cellsPerRow:2,items:n},e)):t(Ae,{title:"No containers",subTitle:"Pod has no containers"})}),t(Pl,{bgTint:"900",yaml:r.manifestYAML,defaultOpen:!0})]}):t(ht,{$height:"50vh",children:t(yt,{withSpinner:!0})})})};var Am;!function(e){e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropRate="spanDropRate",e.Age="age",e.DockerImage="dockerImage"}(Am||(Am={}));const Nm=e=>{const t=[{key:Am.PodName,label:"Pod Name"},{key:Am.Status,label:"Status"},{key:Am.Restarts,label:qe.RESTARTS},{key:Am.NodeName,label:"Node Name"},{key:Am.Age,label:"Age"},{key:Am.DockerImage,label:"Collector Version"}];return e&&t.splice(4,0,{key:Am.SpanDropRate,label:"Span Drop Rate",noSort:!0,noFilter:!0}),t},Om=({isLoading:n,pods:o,withSpanDropRate:i})=>{const l=f(),{formatTimeAgo:s}=Ht(),[c,d]=r(null),u=a(()=>o.map(n=>({onClick:()=>d(n),cells:[{key:Am.PodName,rawValue:n.name},{key:Am.Status,rawValue:n.status,component:()=>{return e=n.status,t(We,{status:Ka(e),label:e});var e}},{key:Am.Restarts,rawValue:n.restartsCount.toString()},{key:Am.NodeName,rawValue:n.nodeName},{key:Am.SpanDropRate,rawValue:0,component:()=>{const{collectorMetrics:o}=n;if(!o)return t(se,{children:"-"});const a=(o?.metricsAcceptedRps??0)+(o?.metricsDroppedRps??0),i=a>0?Math.round((o?.metricsDroppedRps??0)/a*100):0,l=i>0?Pe.Error:Pe.Success,r=(o?.exporterSuccessRps??0)+(o?.exporterFailedRps??0),s=r>0?Math.round((o?.exporterFailedRps??0)/r*100):0,c=s>0?Pe.Error:Pe.Success;return e(ue,{$gap:4,children:[t($e,{text:`Accepted: ${o.metricsAcceptedRps.toLocaleString()} spans/s\nDropped: ${o.metricsDroppedRps.toLocaleString()} spans/s`,children:t(We,{status:l,label:`Receiver ${i}%`,leftIcon:l===Pe.Error?hl:ml,useSecondaryTone:!0,invertColors:!0})}),t($e,{text:`Success: ${o.exporterSuccessRps.toLocaleString()} spans/s\nFailed: ${o.exporterFailedRps.toLocaleString()} spans/s`,children:t(We,{status:c,label:`Exporter ${s}%`,leftIcon:c===Pe.Error?hl:ml,useSecondaryTone:!0,invertColors:!0})})]})}},{key:Am.Age,rawValue:s(n.creationTimestamp)},{key:Am.DockerImage,rawValue:n.image}]})),[o,l]);return e(Pt,{fullHeight:!0,bgTint:"1000",moreSpacing:!0,richTitle:{icon:_i,title:"Pods"},children:[t(wn,{variant:xn.Data,isLoading:n,columns:Nm(i),rows:u}),t(Em,{pod:c,onClose:()=>d(null)})]})},Rm=({isOpen:e,onClose:n,title:o,yaml:a})=>t(le,{isOpen:e,header:{icon:gl,title:o,onClose:n},children:t(Pl,{yaml:a,defaultOpen:!0})}),Dm=e=>{switch(e){case Ya.Healthy:return"All desired replicas are updated, available, and ready";case Ya.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case Ya.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case Ya.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case Ya.Down:return"No available replicas";case Ya.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var Pm;!function(e){e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"}(Pm||(Pm={}));const Fm=g.div`
908
920
  flex: 0.5;
909
921
  padding: 12px;
910
922
  border-radius: 12px;
911
923
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
912
- `,rm=({selectedTab:n,gatewayInfo:o,nodeCollectorInfo:i,isLoading:l})=>{const{formatTimeAgo:r}=zt(),[c,d]=s(null),u=a(()=>(e=>{switch(e){case Zh.Gateway:return"Deployment";case Zh.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(n),[n]),p=a(()=>((e,t,n,o)=>{const a={status:Ie.Disabled,label:"No rollouts yet"};let i=!1,l=null;switch(e){case Zh.Gateway:i=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case Zh.Node:i=n?.rolloutInProgress??!1,l=n?.lastRolloutAt??null;break;default:return a}return i?{status:Ie.Info,label:"Rollout in progress",rightIcon:Ni,useSecondaryTone:!0}:l?{status:Ie.Disabled,label:`Last Rollout: ${o(l)}`}:a})(n,o,i,r),[o,i,n,r]),h=a(()=>((e,t,n,o)=>{let a=o?Ie.Info:Ie.Unknown,i=o?"Loading":Ma.Unknown,l=o?"Fetching data...":im(Ma.Unknown);switch(e){case Zh.Gateway:a=t?.status?_a(t?.status):a,i=t?.status??i,l=t?.status?im(t.status):l;break;case Zh.Node:a=n?.status?_a(n?.status):a,i=n?.status??i,l=n?.status?im(n.status):l}return{status:a,title:i,description:l}})(n,o,i,l),[o,i,n,l]),m=a(()=>((e,t,n)=>{switch(e){case Zh.Gateway:return[{gaugeWidth:128,min:0,max:t?.hpa?.max??0,current:t?.hpa?.current??0,title:"HPA Spec",primaryLabel:"Current replicas",secondaryLabel:"Max replicas"}];case Zh.Node:return[{gaugeWidth:128,min:0,max:n?.nodes?.desired??0,current:n?.nodes?.ready??0,title:"Nodes",primaryLabel:"Ready nodes",secondaryLabel:"Desired nodes"}];default:return[]}})(n,o,i),[o,i,n]),g=a(()=>((e,t,n,o)=>{switch(e){case Zh.Gateway:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${t?.resources?.requests.cpu}/${t?.resources?.limits.cpu}`,isLoading:o},{label:"Memory",value:`${t?.resources?.requests.memory}/${t?.resources?.limits.memory}`,isLoading:o}]}];case Zh.Node:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${n?.resources?.requests.cpu}/${n?.resources?.limits.cpu}`,isLoading:o},{label:"Memory",value:`${n?.resources?.requests.memory}/${n?.resources?.limits.memory}`,isLoading:o}]}];default:return[]}})(n,o,i,l),[o,i,n,l]),f=a(()=>(n===Zh.Gateway?o?.manifestYAML:i?.manifestYAML)??"",[o,i,n]),b=a(()=>(n===Zh.Gateway?o?.configMapYAML:i?.configMapYAML)??"",[o,i,n]);return e($t,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:al,title:u,badge:p},actions:[{id:Vn(),type:Yt.ButtonDropData,buttonProps:{variant:de.Secondary,size:ce.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:lm.ManifestYaml,label:u,icon:il},{id:lm.ConfigMapYaml,label:"ConfigMap",icon:il}]}}],children:[e(se,{$gap:16,children:[t("div",{children:t(za,{...h})}),m.map(e=>t(sm,{children:t("div",{children:t(Ba,{...e})})},e.title)),g.map(e=>t(Xa,{...e},e.title))]}),t(am,{isOpen:c===lm.ManifestYaml,onClose:()=>d(null),title:u,yaml:f}),t(am,{isOpen:c===lm.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},cm=[{value:Zh.Gateway,label:"Gateway"},{value:Zh.Node,label:"Node Collector"}],dm=({minSupportedVersion:n=0})=>{const{isVersionSupported:o,version:i}=y(n),[r,c]=s(Zh.Gateway),d=r===Zh.Gateway,u=r===Zh.Node,{collectorsApi:p,configApi:h}=ll(),{data:m}=h.useEffectiveConfig(),{data:g,loading:f,refetch:b}=p.useGatewayInfo({skip:!d}),{data:v=[],loading:C,refetch:S}=p.useGatewayPods({skip:!d}),{data:w,loading:x,refetch:k}=p.useNodeCollectorInfo({skip:!u}),{data:T=[],loading:$,refetch:I}=p.useNodeCollectorPods({skip:!u}),E=d&&(f||C)||u&&(x||$),A=l(()=>{d?(b(),S()):u&&(k(),I())},[d,u,b,S,k,I]),N=a(()=>d?v:T,[v,T,d]);return e(ha,{children:[t(Qh,{disabled:!o,loading:E,onClickDownloadDiagnose:void 0,onClickRefresh:A}),e(Va,{children:[e(W,{children:[t(ue,{variant:mn.Underline,size:we.L,options:cm,selected:r,setSelected:c}),t(rm,{selectedTab:r,gatewayInfo:g??null,nodeCollectorInfo:w??null,isLoading:E})]}),t(om,{isLoading:E,pods:N,withSpanDropRate:!1===m?.odigosOwnTelemetryStore?.metricsStoreDisabled}),!o&&t($l,{minSupportedVersion:n,currentVersion:i||""})]})]})},um=g.div`
924
+ `,Lm=({selectedTab:n,gatewayInfo:o,nodeCollectorInfo:i,isLoading:l})=>{const{formatTimeAgo:s}=Ht(),[c,d]=r(null),u=a(()=>(e=>{switch(e){case $m.Gateway:return"Deployment";case $m.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(n),[n]),p=a(()=>((e,t,n,o)=>{const a={status:Pe.Disabled,label:"No rollouts yet"};let i=!1,l=null;switch(e){case $m.Gateway:i=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case $m.Node:i=n?.rolloutInProgress??!1,l=n?.lastRolloutAt??null;break;default:return a}return i?{status:Pe.Info,label:"Rollout in progress",rightIcon:Xi,useSecondaryTone:!0}:l?{status:Pe.Disabled,label:`Last Rollout: ${o(l)}`}:a})(n,o,i,s),[o,i,n,s]),h=a(()=>((e,t,n,o)=>{let a=o?Pe.Info:Pe.Unknown,i=o?"Loading":Ya.Unknown,l=o?"Fetching data...":Dm(Ya.Unknown);switch(e){case $m.Gateway:a=t?.status?Ka(t?.status):a,i=t?.status??i,l=t?.status?Dm(t.status):l;break;case $m.Node:a=n?.status?Ka(n?.status):a,i=n?.status??i,l=n?.status?Dm(n.status):l}return{status:a,title:i,description:l}})(n,o,i,l),[o,i,n,l]),m=a(()=>((e,t,n)=>{switch(e){case $m.Gateway:return[{gaugeWidth:128,min:0,max:t?.hpa?.max??0,current:t?.hpa?.current??0,title:"HPA Spec",primaryLabel:"Current replicas",secondaryLabel:"Max replicas"}];case $m.Node:return[{gaugeWidth:128,min:0,max:n?.nodes?.desired??0,current:n?.nodes?.ready??0,title:"Nodes",primaryLabel:"Ready nodes",secondaryLabel:"Desired nodes"}];default:return[]}})(n,o,i),[o,i,n]),g=a(()=>((e,t,n,o)=>{switch(e){case $m.Gateway:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${t?.resources?.requests.cpu}/${t?.resources?.limits.cpu}`,isLoading:o},{label:"Memory",value:`${t?.resources?.requests.memory}/${t?.resources?.limits.memory}`,isLoading:o}]}];case $m.Node:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${n?.resources?.requests.cpu}/${n?.resources?.limits.cpu}`,isLoading:o},{label:"Memory",value:`${n?.resources?.requests.memory}/${n?.resources?.limits.memory}`,isLoading:o}]}];default:return[]}})(n,o,i,l),[o,i,n,l]),f=a(()=>(n===$m.Gateway?o?.manifestYAML:i?.manifestYAML)??"",[o,i,n]),b=a(()=>(n===$m.Gateway?o?.configMapYAML:i?.configMapYAML)??"",[o,i,n]);return e(Pt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:gl,title:u,badge:p},actions:[{id:Zn(),type:nn.ButtonDropData,buttonProps:{variant:me.Secondary,size:he.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:Pm.ManifestYaml,label:u,icon:fl},{id:Pm.ConfigMapYaml,label:"ConfigMap",icon:fl}]}}],children:[e(ue,{$gap:16,children:[t("div",{children:t(Ja,{...h})}),m.map(e=>t(Fm,{children:t("div",{children:t(qa,{...e})})},e.title)),g.map(e=>t(Za,{...e},e.title))]}),t(Rm,{isOpen:c===Pm.ManifestYaml,onClose:()=>d(null),title:u,yaml:f}),t(Rm,{isOpen:c===Pm.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},Mm=[{value:$m.Gateway,label:"Gateway"},{value:$m.Node,label:"Node Collector"}],_m=({minSupportedVersion:n=0})=>{const{isVersionSupported:o,version:i}=v(n),[s,c]=r($m.Gateway),d=s===$m.Gateway,u=s===$m.Node,{collectorsApi:p,configApi:h}=bl(),{data:m}=h.useEffectiveConfig(),{data:g,loading:f,refetch:b}=p.useGatewayInfo({skip:!d}),{data:y=[],loading:C,refetch:S}=p.useGatewayPods({skip:!d}),{data:w,loading:x,refetch:k}=p.useNodeCollectorInfo({skip:!u}),{data:T=[],loading:$,refetch:I}=p.useNodeCollectorPods({skip:!u}),E=d&&(f||C)||u&&(x||$),A=l(()=>{d?(b(),S()):u&&(k(),I())},[d,u,b,S,k,I]),N=a(()=>d?y:T,[y,T,d]);return e(ka,{children:[t(Im,{disabled:!o,loading:E,onClickDownloadDiagnose:void 0,onClickRefresh:A}),e(Qa,{children:[e(q,{children:[t(ge,{variant:Cn.Underline,size:Oe.L,options:Mm,selected:s,setSelected:c}),t(Lm,{selectedTab:s,gatewayInfo:g??null,nodeCollectorInfo:w??null,isLoading:E})]}),t(Om,{isLoading:E,pods:N,withSpanDropRate:!1===m?.odigosOwnTelemetryStore?.metricsStoreDisabled}),!o&&t(Ml,{minSupportedVersion:n,currentVersion:i||""})]})]})},zm=g.div`
913
925
  display: inline-flex;
914
926
  align-items: center;
915
927
  min-width: 0;
916
928
  overflow: hidden;
917
929
  white-space: pre;
918
930
  text-overflow: ellipsis;
919
- `,pm=g.div`
931
+ `,Bm=g.div`
920
932
  display: flex;
921
933
  flex-direction: column;
922
934
  gap: 4px;
923
935
  min-width: 0;
924
936
  flex: 1;
925
937
  opacity: ${({$disabled:e})=>e?.4:1};
926
- `,hm=g(se)`
938
+ `,Xm=g(ue)`
927
939
  flex-shrink: 0;
928
940
  gap: 6px;
929
941
  align-items: center;
930
942
  min-height: 22px;
931
- `;const mm=[{key:"content",label:"Content",noSort:!0,noFilter:!0,flex:1},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],gm=[{value:"all",label:Ga},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],fm=({title:n,items:o,isLoading:i,showTypeFilter:r,onRuleClick:c,onCreateRule:d,onEditRule:u,onDeleteRule:p})=>{const h=f(),[m,g]=s(""),[b,v]=s("all"),y=a(()=>{let e=function(e,t,n){return n&&"all"!==t?e.filter(e=>e.typeBadge===t):e}(o,b,r);return e=function(e,t){if(!t.trim())return e;const n=t.toLowerCase();return e.filter(e=>{const t=e.name?.toLowerCase().includes(n),o=e.summary.map(e=>e.text).join("").toLowerCase();return t||o.includes(n)})}(e,m),e},[o,b,r,m]),C=a(()=>y.map(n=>{const o=n.typeBadge?function(e,t){const n=e.v2.colors;switch(t){case"Relevance":return{bg:n.blue[700],text:n.white[500]};case"Duration":return{bg:n.purple[700],text:n.white[500]};case"Error":return{bg:n.red[500],text:n.black[500]}}}(h,n.typeBadge):void 0;return{cells:[{key:"content",rawValue:n.summary.map(e=>e.text).join(""),component:()=>e(pm,{$disabled:n.disabled,children:[t(um,{children:t(S,{parts:n.summary})}),n.name&&t(ae,{size:le.XXS,color:ie.Secondary,nowrap:!0,children:n.name})]})},{key:"badges",rawValue:n.typeBadge||"",component:()=>e(hm,{children:[n.disabled&&t(Be,{label:Ua,textSize:le.XXXS,backgroundColor:h.v2.colors.grey[700],textColor:h.v2.colors.grey[300]}),n.typeBadge&&o&&t(Be,{label:n.typeBadge,textSize:le.XXXS,backgroundColor:o.bg,textColor:o.text})]})}],onClick:()=>c(n)}}),[y,h,c]),w=a(()=>{const e=e=>t(pi,{...e,fill:h.v2.colors.red[500]});return e.displayName="RedDeleteIcon",e},[h]),x=l(e=>{const t=C.indexOf(e);if(t<0)return[];const n=y[t];return n?[{id:"edit","data-id":"sampling-rule-action-edit",label:wn,leftIcon:hi,onClick:()=>u(n.ruleId,n.samplingId)},{id:"delete","data-id":"sampling-rule-action-delete",label:"",leftIcon:w,onClick:()=>p(n.ruleId,n.samplingId)}]:[]},[C,y,u,p,w]);return t(et,{fullHeight:!0,richTitle:{icon:ji,title:n,badge:{label:o.length,backgroundColor:h.v2.colors.silver[600],textColor:h.v2.colors.white[500]}},search:{"data-id":"sampling-search-rules",value:m,onChange:g,placeholder:"Search..",width:"500px",...r?{segment:{"data-id":"sampling-segment-type-filter",options:gm,selected:b,setSelected:v}}:{}},children:t(fn,{variant:bn.Pretty,hideHeader:!0,isLoading:i,noDataProps:m.trim()?{hideIcon:!0,title:Ha,subTitle:Ka(m)}:{hideIcon:!0,title:Wa,button:{label:ja,onClick:d}},columns:mm,rows:C,getRowActions:x})})},bm=({docsUrl:n})=>{const{samplingApi:r,sourcesApi:c}=ll(),{items:d}=c.useSources(),u=a(()=>d.map(e=>({id:e.id})),[d]),{items:p,loading:h,k8sHealthProbesConfig:m,refetch:g}=r.useSamplingRules(),f=l((e,t)=>r.createNoisy?.({samplingId:e,rule:t}),[r]),b=l((e,t,n)=>r.updateNoisy?.(t,{samplingId:e,rule:n}),[r]),v=l((e,t)=>r.createHighlyRelevant?.({samplingId:e,rule:t}),[r]),y=l((e,t,n)=>r.updateHighlyRelevant?.(t,{samplingId:e,rule:n}),[r]),C=l((e,t)=>r.createCostReduction?.({samplingId:e,rule:t}),[r]),S=l((e,t,n)=>r.updateCostReduction?.(t,{samplingId:e,rule:n}),[r]),w=l((e,t,n)=>"noisy"===n?r.deleteNoisy?.(t,e):"highlyRelevant"===n?r.deleteHighlyRelevant?.(t,e):"costReduction"===n?r.deleteCostReduction?.(t,e):void 0,[r]),x=l((e,t)=>r.updateK8sHealthProbesConfig?.({enabled:e,keepPercentage:t}),[r]),k=a(()=>u.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[u]),I=a(()=>Array.from(new Set(u.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[u]),[j,K]=s(E.Noisy),[Y,J]=s(null),[q,Z]=s(!1),[Q,ee]=s(!1),[te,ne]=s(null),[oe,ae]=s(!1),[ie,le]=s(!1),[pe,he]=s(!1),[me,ge]=s(!1);i(!1),o(()=>{},[h,p]);const{pendingViewSamplingRule:fe,setPendingViewSamplingRule:be}=Zt();o(()=>{if(!fe)return;if(h||0===p.length)return;be(null);const e=A(p,fe.ruleId,fe.category);e&&(K(N[fe.category]),Z(!1),J(e))},[h,p,fe,be]);const ve=a(()=>T(m),[m]),ye=a(()=>O(p),[p]),Ce=a(()=>$(ye?.rule??null),[ye]),Se=a(()=>R(p),[p]),xe=a(()=>D(Se?.rule??null),[Se]),ke=i(Y);ke.current=Y,o(()=>{const e=ke.current;if(!e)return;const t=P(p,e);t?J(t):(J(null),Z(!1))},[p]);const Te=a(()=>{const e=new Set;return ye&&e.add(ye.rule.ruleId),Se&&e.add(Se.rule.ruleId),e},[ye,Se]),Ee=a(()=>F(p,j,Te),[p,j,Te]),Ae=l(()=>ee(!0),[]),Ne=l(()=>ee(!1),[]);l(()=>ge(!1),[]);const Oe=l(async e=>{const t=p[0]?.id??"default";switch(X[j]){case"noisy":await f(t,M(e));break;case"highlyRelevant":await v(t,_(e));break;case"costReduction":await C(t,L(e))}ee(!1)},[p,j,f,v,C]),Re=l(e=>{const t=z(p,e);t&&(Z(!1),J(t))},[p]),De=l(()=>{J(null),Z(!1)},[]),Pe=l((e,t)=>{const n=Y;if(n&&n.rule.ruleId===e&&n.samplingId===t)Z(!0),J({...n});else for(const n of p){if(n.id!==t)continue;const o=[...n.noisyOperations.map(e=>({category:"noisy",rule:e})),...n.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...n.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(o)return Z(!0),void J({category:o.category,rule:o.rule,samplingId:t,summary:B(o.category,o.rule)})}},[Y,p]),Fe=l(async(e,t,n)=>{const o=Y?.category;if(o){switch(o){case"noisy":await b(n,t,M(e));break;case"highlyRelevant":await y(n,t,_(e));break;case"costReduction":await S(n,t,L(e))}Z(!1)}},[Y,b,y,S]),Le=l((e,t)=>{ne({ruleId:e,samplingId:t})},[]),_e=l(async()=>{if(!te)return;const{ruleId:e,samplingId:t}=te,n=Y?.category||X[j];await w(t,e,n),J(null),Z(!1),ne(null)},[te,Y,j,w]),Me=l(()=>ne(null),[]),ze=l(async(e,t)=>{await x(e,t),ae(!1)},[x]),Be=l(async e=>{const t=p[0]?.id??"default",n=ye;n?await y(n.samplingId,n.rule.ruleId,{name:n.rule.name,disabled:!e,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null,notes:n.rule.notes}):e&&await v(t,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}),le(!1)},[p,ye,v,y]),Xe=l(async(e,t)=>{const n=p[0]?.id??"default",o=Se;o?await S(o.samplingId,o.rule.ruleId,{name:o.rule.name,disabled:!e,sourceScopes:null,operation:null,percentageAtMost:t,notes:o.rule.notes}):e&&await C(n,{name:"Auto - Drop Traces Cluster-Wide",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:t}),he(!1)},[p,Se,C,S]),Ve=l(e=>{const t=X[j];let n=null;switch(t){case"noisy":{const o=M(e);n=V(p,t,{sourceScopes:o.sourceScopes,operation:o.operation});break}case"highlyRelevant":{const o=_(e);n=V(p,t,{sourceScopes:o.sourceScopes,operation:o.operation,error:o.error??!1,durationAtLeastMs:o.durationAtLeastMs});break}case"costReduction":{const o=L(e);n=V(p,t,{sourceScopes:o.sourceScopes,operation:o.operation});break}}return n?{message:Ya,ruleId:n}:null},[p,j]),Ge=l(e=>{const t=Y?.category,n=Y?.rule.ruleId;if(!t)return null;let o=null;switch(t){case"noisy":{const a=M(e);o=V(p,t,{sourceScopes:a.sourceScopes,operation:a.operation},n);break}case"highlyRelevant":{const a=_(e);o=V(p,t,{sourceScopes:a.sourceScopes,operation:a.operation,error:a.error??!1,durationAtLeastMs:a.durationAtLeastMs},n);break}case"costReduction":{const a=L(e);o=V(p,t,{sourceScopes:a.sourceScopes,operation:a.operation},n);break}}return o?{message:Ya,ruleId:o}:null},[p,Y]),He=l(e=>{ee(!1);for(const t of p){const n=[...t.noisyOperations.map(e=>({category:"noisy",rule:e})),...t.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...t.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(n)return Z(!0),void J({category:n.category,rule:n.rule,samplingId:t.id,summary:B(n.category,n.rule)})}},[p]),We=a(()=>{const e=[];return n&&e.push({id:Vn(),type:Yt.Button,buttonProps:{"data-id":"sampling-btn-docs",label:Ja,leftIcon:ui,size:ce.S,variant:de.Text,onClick:()=>window.open(n,"_blank")}}),e.push({id:Vn(),type:Yt.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:qa,leftIcon:Ni,size:ce.S,variant:de.Text,onClick:g,loading:h}}),e.push({id:Vn(),type:Yt.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:Za,rightIcon:si,size:ce.S,variant:de.Primary,onClick:Ae}}),e},[n,g,h,Ae]);return e(ha,{children:[e(se,{$gap:12,$justifyContent:"space-between",children:[t(Fa,{icon:ji,title:ei,subTitle:Qa}),t(La,{actions:We})]}),e(W,{$gap:12,$fullHeight:!0,children:[t(ue,{variant:mn.Underline,size:we.L,options:U,selected:j,setSelected:K}),e(se,{$justifyContent:"space-between",children:[t($e,{status:Ie.Default,message:G[j]}),n&&t(re,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:ui,size:ce.S,variant:de.Text,onClick:()=>window.open(n,"_blank")})]}),j===E.Noisy?t(ul,{title:qe,summary:ve,onEdit:()=>ae(!0)}):j===E.HighlyRelevant?t(ul,{title:je,summary:Ce,onEdit:()=>le(!0)}):j===E.CostReduction?t(ul,{title:Ye,summary:xe,onEdit:()=>he(!0)}):null,t(fm,{title:H[j],items:Ee,isLoading:h,showTypeFilter:j===E.HighlyRelevant,onRuleClick:Re,onCreateRule:Ae,onEditRule:Pe,onDeleteRule:Le})]}),t(au,{formType:Pl.View,data:Y,defaultEditMode:q,onClose:De,onDelete:Le,onSaveEdit:Fe,sourceOptions:k,namespaceOptions:I,validateForm:Ge,onNavigateToDuplicate:He}),t(au,{formType:Pl.Create,isOpen:Q,category:X[j],onClose:Ne,onSubmit:Oe,sourceOptions:k,namespaceOptions:I,validateForm:Ve,onNavigateToDuplicate:He}),t(au,{formType:Pl.EditAutoNoisy,isOpen:oe,enabled:m?.enabled??!1,keepPercentage:m?.keepPercentage??0,onClose:()=>ae(!1),onSave:ze}),t(au,{formType:Pl.EditAutoHighlyRelevant,isOpen:ie,enabled:!!ye&&!ye.rule.disabled,onClose:()=>le(!1),onSave:Be}),t(au,{formType:Pl.EditAutoCostReduction,isOpen:pe,enabled:!!Se&&!Se.rule.disabled,dropPercentage:Se?.rule.percentageAtMost??25,onClose:()=>he(!1),onSave:Xe}),t(Ue,{title:ai,description:oi,isOpen:!!te,onClose:Me,denyButton:{label:ni,variant:de.Secondary,onClick:Me},approveButton:{label:ti,variant:de.Primary,onClick:()=>{_e(),Me()}}}),false]})},vm=g.div`
943
+ `;const Vm=[{key:"content",label:"Content",noSort:!0,noFilter:!0,flex:1},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],Um=[{value:"all",label:ti},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],jm=({title:n,items:o,isLoading:i,showTypeFilter:s,onRuleClick:c,onCreateRule:d,onEditRule:u,onDeleteRule:p})=>{const h=f(),[m,g]=r(""),[b,y]=r("all"),v=a(()=>{let e=function(e,t,n){return n&&"all"!==t?e.filter(e=>e.typeBadge===t):e}(o,b,s);return e=function(e,t){if(!t.trim())return e;const n=t.toLowerCase();return e.filter(e=>{const t=e.name?.toLowerCase().includes(n),o=e.summary.map(e=>e.text).join("").toLowerCase();return t||o.includes(n)})}(e,m),e},[o,b,s,m]),C=a(()=>v.map(n=>{const o=n.typeBadge?function(e,t){const n=e.v2.colors;switch(t){case"Relevance":return{bg:n.blue[700],text:n.white[500]};case"Duration":return{bg:n.purple[700],text:n.white[500]};case"Error":return{bg:n.red[500],text:n.black[500]}}}(h,n.typeBadge):void 0;return{cells:[{key:"content",rawValue:n.summary.map(e=>e.text).join(""),component:()=>e(Bm,{$disabled:n.disabled,children:[t(zm,{children:t(S,{parts:n.summary})}),n.name&&t(se,{size:de.XXS,color:ce.Secondary,nowrap:!0,children:n.name})]})},{key:"badges",rawValue:n.typeBadge||"",component:()=>e(Xm,{children:[n.disabled&&t(We,{label:ei,textSize:de.XXXS,backgroundColor:h.v2.colors.grey[700],textColor:h.v2.colors.grey[300]}),n.typeBadge&&o&&t(We,{label:n.typeBadge,textSize:de.XXXS,backgroundColor:o.bg,textColor:o.text})]})}],onClick:()=>c(n)}}),[v,h,c]),w=a(()=>{const e=e=>t(xi,{...e,fill:h.v2.colors.red[500]});return e.displayName="RedDeleteIcon",e},[h]),x=l(e=>{const t=C.indexOf(e);if(t<0)return[];const n=v[t];return n?[{id:"edit","data-id":"sampling-rule-action-edit",label:An,leftIcon:ki,onClick:()=>u(n.ruleId,n.samplingId)},{id:"delete","data-id":"sampling-rule-action-delete",label:"",leftIcon:w,onClick:()=>p(n.ruleId,n.samplingId)}]:[]},[C,v,u,p,w]);return t(rt,{fullHeight:!0,richTitle:{icon:ol,title:n,badge:{label:o.length,backgroundColor:h.v2.colors.silver[600],textColor:h.v2.colors.white[500]}},search:{"data-id":"sampling-search-rules",value:m,onChange:g,placeholder:"Search..",width:"500px",...s?{segment:{"data-id":"sampling-segment-type-filter",options:Um,selected:b,setSelected:y}}:{}},children:t(wn,{variant:xn.Pretty,hideHeader:!0,isLoading:i,noDataProps:m.trim()?{hideIcon:!0,title:ni,subTitle:ii(m)}:{hideIcon:!0,title:ai,button:{label:oi,onClick:d}},columns:Vm,rows:C,getRowActions:x})})},Gm=({docsUrl:n})=>{const{samplingApi:s,sourcesApi:c}=bl(),{items:d}=c.useSources(),u=a(()=>d.map(e=>({id:e.id})),[d]),{items:p,loading:h,k8sHealthProbesConfig:m,refetch:g}=s.useSamplingRules(),f=l((e,t)=>s.createNoisy?.({samplingId:e,rule:t}),[s]),b=l((e,t,n)=>s.updateNoisy?.(t,{samplingId:e,rule:n}),[s]),y=l((e,t)=>s.createHighlyRelevant?.({samplingId:e,rule:t}),[s]),v=l((e,t,n)=>s.updateHighlyRelevant?.(t,{samplingId:e,rule:n}),[s]),C=l((e,t)=>s.createCostReduction?.({samplingId:e,rule:t}),[s]),S=l((e,t,n)=>s.updateCostReduction?.(t,{samplingId:e,rule:n}),[s]),w=l((e,t,n)=>"noisy"===n?s.deleteNoisy?.(t,e):"highlyRelevant"===n?s.deleteHighlyRelevant?.(t,e):"costReduction"===n?s.deleteCostReduction?.(t,e):void 0,[s]),x=l((e,t)=>s.updateK8sHealthProbesConfig?.({enabled:e,keepPercentage:t}),[s]),k=a(()=>u.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[u]),T=a(()=>Array.from(new Set(u.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[u]),[$,I]=r(R.Noisy),[E,O]=r(null),[J,Z]=r(!1),[Q,ee]=r(!1),[te,ne]=r(null),[oe,ae]=r(!1),[ie,le]=r(!1),[re,se]=r(!1),[ce,de]=r(!1);i(!1),o(()=>{},[h,p]);const{pendingViewSamplingRule:fe,setPendingViewSamplingRule:be}=ln();o(()=>{if(!fe)return;if(h||0===p.length)return;be(null);const e=D(p,fe.ruleId,fe.category);e&&(I(P[fe.category]),Z(!1),O(e))},[h,p,fe,be]);const ye=a(()=>A(m),[m]),ve=a(()=>F(p),[p]),Ce=a(()=>N(ve?.rule??null),[ve]),Se=a(()=>L(p),[p]),we=a(()=>M(Se?.rule??null),[Se]),xe=i(E);xe.current=E,o(()=>{const e=xe.current;if(!e)return;const t=_(p,e);t?O(t):(O(null),Z(!1))},[p]);const ke=a(()=>{const e=new Set;return ve&&e.add(ve.rule.ruleId),Se&&e.add(Se.rule.ruleId),e},[ve,Se]),Te=a(()=>z(p,$,ke),[p,$,ke]),$e=l(()=>ee(!0),[]),Ie=l(()=>ee(!1),[]);l(()=>de(!1),[]);const Ee=l(async e=>{const t=p[0]?.id??"default";switch(G[$]){case"noisy":await f(t,V(e));break;case"highlyRelevant":await y(t,X(e));break;case"costReduction":await C(t,B(e))}ee(!1)},[p,$,f,y,C]),Ae=l(e=>{const t=U(p,e);t&&(Z(!1),O(t))},[p]),Ne=l(()=>{O(null),Z(!1)},[]),Re=l((e,t)=>{const n=E;if(n&&n.rule.ruleId===e&&n.samplingId===t)Z(!0),O({...n});else for(const n of p){if(n.id!==t)continue;const o=[...n.noisyOperations.map(e=>({category:"noisy",rule:e})),...n.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...n.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(o)return Z(!0),void O({category:o.category,rule:o.rule,samplingId:t,summary:j(o.category,o.rule)})}},[E,p]),Fe=l(async(e,t,n)=>{const o=E?.category;if(o){switch(o){case"noisy":await b(n,t,V(e));break;case"highlyRelevant":await v(n,t,X(e));break;case"costReduction":await S(n,t,B(e))}Z(!1)}},[E,b,v,S]),Le=l((e,t)=>{ne({ruleId:e,samplingId:t})},[]),Me=l(async()=>{if(!te)return;const{ruleId:e,samplingId:t}=te,n=E?.category||G[$];await w(t,e,n),O(null),Z(!1),ne(null)},[te,E,$,w]),_e=l(()=>ne(null),[]),ze=l(async(e,t)=>{await x(e,t),ae(!1)},[x]),Be=l(async e=>{const t=p[0]?.id??"default",n=ve;n?await v(n.samplingId,n.rule.ruleId,{name:n.rule.name,disabled:!e,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null,notes:n.rule.notes}):e&&await y(t,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}),le(!1)},[p,ve,y,v]),Xe=l(async(e,t)=>{const n=p[0]?.id??"default",o=Se;o?await S(o.samplingId,o.rule.ruleId,{name:o.rule.name,disabled:!e,sourceScopes:null,operation:null,percentageAtMost:t,notes:o.rule.notes}):e&&await C(n,{name:"Auto - Drop Traces Cluster-Wide",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:t}),se(!1)},[p,Se,C,S]),Ve=l(e=>{const t=G[$];let n=null;switch(t){case"noisy":{const o=V(e);n=H(p,t,{sourceScopes:o.sourceScopes,operation:o.operation});break}case"highlyRelevant":{const o=X(e);n=H(p,t,{sourceScopes:o.sourceScopes,operation:o.operation,error:o.error??!1,durationAtLeastMs:o.durationAtLeastMs});break}case"costReduction":{const o=B(e);n=H(p,t,{sourceScopes:o.sourceScopes,operation:o.operation});break}}return n?{message:li,ruleId:n}:null},[p,$]),Ue=l(e=>{const t=E?.category,n=E?.rule.ruleId;if(!t)return null;let o=null;switch(t){case"noisy":{const a=V(e);o=H(p,t,{sourceScopes:a.sourceScopes,operation:a.operation},n);break}case"highlyRelevant":{const a=X(e);o=H(p,t,{sourceScopes:a.sourceScopes,operation:a.operation,error:a.error??!1,durationAtLeastMs:a.durationAtLeastMs},n);break}case"costReduction":{const a=B(e);o=H(p,t,{sourceScopes:a.sourceScopes,operation:a.operation},n);break}}return o?{message:li,ruleId:o}:null},[p,E]),je=l(e=>{ee(!1);for(const t of p){const n=[...t.noisyOperations.map(e=>({category:"noisy",rule:e})),...t.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...t.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(n)return Z(!0),void O({category:n.category,rule:n.rule,samplingId:t.id,summary:j(n.category,n.rule)})}},[p]),Ge=a(()=>{const e=[];return n&&e.push({id:Zn(),type:nn.Button,buttonProps:{"data-id":"sampling-btn-docs",label:ri,leftIcon:wi,size:he.S,variant:me.Text,onClick:()=>window.open(n,"_blank")}}),e.push({id:Zn(),type:nn.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:si,leftIcon:Xi,size:he.S,variant:me.Text,onClick:g,loading:h}}),e.push({id:Zn(),type:nn.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:ci,rightIcon:yi,size:he.S,variant:me.Primary,onClick:$e}}),e},[n,g,h,$e]);return e(ka,{children:[e(ue,{$gap:12,$justifyContent:"space-between",children:[t(Ha,{icon:ol,title:ui,subTitle:di}),t(Wa,{actions:Ge})]}),e(q,{$gap:12,$fullHeight:!0,children:[t(ge,{variant:Cn.Underline,size:Oe.L,options:W,selected:$,setSelected:I}),e(ue,{$justifyContent:"space-between",children:[t(De,{status:Pe.Default,message:K[$]}),n&&t(pe,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:wi,size:he.S,variant:me.Text,onClick:()=>window.open(n,"_blank")})]}),$===R.Noisy?t(wl,{title:at,summary:ye,onEdit:()=>ae(!0)}):$===R.HighlyRelevant?t(wl,{title:Qe,summary:Ce,onEdit:()=>le(!0)}):$===R.CostReduction?t(wl,{title:nt,summary:we,onEdit:()=>se(!0)}):null,t(jm,{title:Y[$],items:Te,isLoading:h,showTypeFilter:$===R.HighlyRelevant,onRuleClick:Ae,onCreateRule:$e,onEditRule:Re,onDeleteRule:Le})]}),t(Ru,{formType:Gl.View,data:E,defaultEditMode:J,onClose:Ne,onDelete:Le,onSaveEdit:Fe,sourceOptions:k,namespaceOptions:T,validateForm:Ue,onNavigateToDuplicate:je}),t(Ru,{formType:Gl.Create,isOpen:Q,category:G[$],onClose:Ie,onSubmit:Ee,sourceOptions:k,namespaceOptions:T,validateForm:Ve,onNavigateToDuplicate:je}),t(Ru,{formType:Gl.EditAutoNoisy,isOpen:oe,enabled:m?.enabled??!1,keepPercentage:m?.keepPercentage??0,onClose:()=>ae(!1),onSave:ze}),t(Ru,{formType:Gl.EditAutoHighlyRelevant,isOpen:ie,enabled:!!ve&&!ve.rule.disabled,onClose:()=>le(!1),onSave:Be}),t(Ru,{formType:Gl.EditAutoCostReduction,isOpen:re,enabled:!!Se&&!Se.rule.disabled,dropPercentage:Se?.rule.percentageAtMost??25,onClose:()=>se(!1),onSave:Xe}),t(Je,{title:gi,description:mi,isOpen:!!te,onClose:_e,denyButton:{label:hi,variant:me.Secondary,onClick:_e},approveButton:{label:pi,variant:me.Primary,onClick:()=>{Me(),_e()}}}),false]})},Hm=g.div`
932
944
  display: flex;
933
945
  align-items: center;
934
946
  justify-content: space-between;
935
947
  padding: 0 12px;
936
- `,ym=({disabled:n,loading:o,tabs:i,selectedTab:l,setSelectedTab:r,onClickReset:c,onClickRefresh:d})=>{const[u,p]=s(!1),h=a(()=>{const e=[];return c&&e.push({id:Vn(),type:Yt.Button,buttonProps:{label:"Reset",leftIcon:li,size:ce.S,variant:de.Text,onClick:()=>p(!0),disabled:n}}),d&&e.push({id:Vn(),type:Yt.Button,buttonProps:{label:"Refresh",leftIcon:Ni,size:ce.S,variant:de.Text,onClick:d,disabled:n,loading:o}}),e},[n,o,d]);return e(vm,{children:[e(se,{$gap:12,$alignItems:"center",children:[t(Fa,{icon:$i,title:"Odigos Settings"}),t(lt,{width:"350px",options:i,values:[l],setValues:e=>r(e[0]),disabled:n})]}),t(La,{actions:h}),t(Ue,{isOpen:u,onClose:()=>p(!1),title:"Reset Settings",description:"Are you sure you want to reset the settings? This will clear the odigos-local-ui-config and reset the settings to the default values.",denyButton:{label:"Deny",variant:de.Secondary,onClick:()=>p(!1)},approveButton:{label:"Approve",variant:de.Primary,onClick:()=>{c?.(),p(!1)}}})]})},Cm=g(se)`
948
+ `,Wm=({disabled:n,loading:o,tabs:i,selectedTab:l,setSelectedTab:s,onClickReset:c,onClickRefresh:d})=>{const[u,p]=r(!1),h=a(()=>{const e=[];return c&&e.push({id:Zn(),type:nn.Button,buttonProps:{label:"Reset",leftIcon:bi,size:he.S,variant:me.Text,onClick:()=>p(!0),disabled:n}}),d&&e.push({id:Zn(),type:nn.Button,buttonProps:{label:"Refresh",leftIcon:Xi,size:he.S,variant:me.Text,onClick:d,disabled:n,loading:o}}),e},[n,o,d]);return e(Hm,{children:[e(ue,{$gap:12,$alignItems:"center",children:[t(Ha,{icon:Mi,title:"Odigos Settings"}),t(gt,{width:"350px",options:i,values:[l],setValues:e=>s(e[0]),disabled:n})]}),t(Wa,{actions:h}),t(Je,{isOpen:u,onClose:()=>p(!1),title:"Reset Settings",description:"Are you sure you want to reset the settings? This will clear the odigos-local-ui-config and reset the settings to the default values.",denyButton:{label:"Deny",variant:me.Secondary,onClick:()=>p(!1)},approveButton:{label:"Approve",variant:me.Primary,onClick:()=>{c?.(),p(!1)}}})]})},Km=g(ue)`
937
949
  flex: 1;
938
950
  min-height: 0;
939
951
  width: 100%;
940
952
  align-self: stretch;
941
- `,Sm=g(W)`
953
+ `,Ym=g(q)`
942
954
  flex: 1;
943
955
  min-height: 0;
944
956
  height: 100%;
945
957
  overflow-y: auto;
946
- `,wm=g(Sm)`
958
+ `,Jm=g(Ym)`
947
959
  > section {
948
960
  min-height: 100%;
949
961
  box-sizing: border-box;
950
962
  flex-shrink: 0;
951
963
  }
952
- `,xm=e=>"general"===e.name?0:"advanced"===e.name?2:1,km=({minSupportedVersion:n=0})=>{const{isVersionSupported:i,version:l,isEnterprise:r}=y(n),{configApi:c}=ll(),{data:d,loading:u}=c.useConfigYamls(),{data:p,loading:h,refetch:m}=c.useEffectiveConfig(),g=d?.configYamls??[],[f,b]=s(!1),v=async()=>{c.resetLocalUiConfigToDefaults&&await c.resetLocalUiConfigToDefaults()},C=a(()=>{if(!p)return{};const{manifestYAML:e,provenance:t,...n}=p;return n},[p]),{formData:S,handleFormChange:w,getNestedValue:x,getFormDiff:k,isFormDirty:T}=At(C);o(()=>{"{}"!==JSON.stringify(C)&&"{}"===JSON.stringify(S)&&w(void 0,void 0,C)},[C,S]);const $=a(()=>[...g].sort((e,t)=>xm(e)-xm(t)),[g]),I=a(()=>(e=>{if(!e)return{};const t={};for(const n of e)t[n.helmPath]=n.reconciledFrom;return t})(p?.provenance),[p?.provenance]),E=a(()=>{const e=new Set;for(const t of g)for(const n of t.fields)n.componentType===Ot.Dropdown&&e.add(n.helmValuePath);return e},[g]),A=a(()=>g.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:x("formData",e.helmValuePath)}))),[g,S,x]),[N,O]=s(!1),R=async()=>{const e=((e,t)=>{const n=(e,t,n)=>{for(let n=0;n<t.length-1;n++){const o=t[n];o in e&&"object"==typeof e[o]&&null!==e[o]||(e[o]={}),e=e[o]}e[t[t.length-1]]=n},o=JSON.parse(JSON.stringify(e));for(const e of t){const t=e.split(".");let a=o;for(const e of t){if(null==a||"object"!=typeof a){a=void 0;break}a=a[e]}"string"==typeof a&&n(o,t,a.replaceAll("-","_"))}return o})(k(C,S),E);await(async e=>{c.updateLocalUiConfig&&(b(!0),await c.updateLocalUiConfig(e),b(!1),await m())})(e),w(void 0,void 0,{})},D=a(()=>[{id:Vn(),type:Yt.Button,buttonProps:{"data-id":"settings-save",variant:de.Primary,size:ce.S,label:"Save Changes",leftIcon:Si,loading:f,onClick:()=>O(!0)}},{id:Vn(),type:Yt.Button,buttonProps:{"data-id":"settings-cancel",variant:de.Secondary,size:ce.S,label:"Cancel",leftIcon:wi,onClick:()=>w(void 0,void 0,C)}}],[f,k,C,S,w]),P=a(()=>$.map(e=>({id:e.name,label:e.displayName})),[$]),F=a(()=>$.map(e=>e.name),[$]),{selectedSection:L,setSelectedSection:_,setSectionRef:M,setScrollContainerRef:z}=ii({sectionNames:F});return e(ha,{$gap:12,children:[t(ym,{disabled:!i,loading:u||h,tabs:P,selectedTab:L,setSelectedTab:_,onClickReset:v?()=>v().then(()=>m?.()):void 0,onClickRefresh:m?()=>m():void 0}),e(Va,{children:[!i&&t($l,{minSupportedVersion:n,currentVersion:l||""}),t(vn,{isOpen:T,richTitle:{icon:$i,title:"Config Settings"},actions:D}),t(Ue,{isOpen:N,title:"Save Changes via UI?",description:"We recommend updating via your Helm values.yaml to ensure changes are version-controlled and go through a proper review process.",onClose:()=>O(!1),denyButton:{label:"Keep editing",variant:de.Secondary,onClick:()=>O(!1)},approveButton:{label:"Save changes",variant:de.Primary,onClick:()=>{R(),O(!1)}}}),e(Cm,{$gap:24,$alignItems:"stretch",children:[t(Sm,{ref:z,$gap:24,$width:"100%",children:g.length?$.map(n=>t(et,{id:n.name,ref:e=>M(n.name,e),richTitle:{icon:$i,title:n.displayName},children:n.fields.map(n=>{if(n.isEnterpriseOnly&&!r)return null;if(n.renderCondition&&!Te(n.renderCondition,[],A))return null;const o=ht(n.componentProps||"{}",{}),a=I[n.helmValuePath];return e(W,{$gap:4,children:[t(rl,{componentType:n.componentType,inputType:o.type,name:n.helmValuePath,label:n.displayName,tooltip:n.description,badge:a?{status:"odigos-local-ui-config"===a?Ie.Warning:Ie.Unknown,label:a,tooltip:`This field is reconciled from the following resource: ${a}`}:void 0,disabled:n.isHelmOnly||f,value:x("formData",n.helmValuePath),setValue:e=>w(n.helmValuePath,e),dropdownOptions:o.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0},n.helmValuePath),n.isHelmOnly?t($e,{status:Ie.Info,smallIcon:!0,message:"This field can only be updated via Helm values.yaml file"}):null]},n.helmValuePath)})},n.name)):u?t(at,{$height:"30vh",children:t(ct,{withSpinner:!0})}):t(et,{richTitle:{icon:$i,title:"Config Settings"},children:t(Ce,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})}),t(wm,{children:h&&!p?.manifestYAML?t(at,{$height:"30vh",children:t(ct,{withSpinner:!0})}):t(xl,{title:"Effective Config YAML",yaml:p?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0})})]})]})]})};export{ir as AddActionDrawer,Rs as AddActionForm,mu as AddDataStreamModal,gr as AddDestinationDrawer,Fs as AddDestinationForm,fr as AddRuleDrawer,Us as AddRuleForm,Lr as AddSourceDrawer,yp as CentralConnections,Hs as DataStreamForm,Gs as DataStreamMergeWarning,Mr as EditActionDrawer,zr as EditConfigDrawer,gu as EditDataStreamModal,Xr as EditDestinationDrawer,Ur as EditRuleDrawer,Hd as EditSourceDrawer,js as EditSourceForm,vu as ONBOARDING_DONE_MODAL_ID,Dp as Onboarding,yu as OnboardingDone,qh as Overview,dm as PipelineCollectors,bs as RegexTesterDrawer,hp as SamplingOnboardingModal,au as SamplingRuleDrawer,Zs as SamplingRuleForm,bm as SamplingRules,km as Settings,hu as SystemDrawer,cm as TABS};
964
+ `,qm=e=>"general"===e.name?0:"advanced"===e.name?2:1,Zm=({minSupportedVersion:n=0})=>{const{isVersionSupported:i,version:l,isEnterprise:s}=v(n),{configApi:c}=bl(),{data:d,loading:u}=c.useConfigYamls(),{data:p,loading:h,refetch:m}=c.useEffectiveConfig(),g=d?.configYamls??[],[f,b]=r(!1),y=async()=>{c.resetLocalUiConfigToDefaults&&await c.resetLocalUiConfigToDefaults()},C=a(()=>{if(!p)return{};const{manifestYAML:e,provenance:t,...n}=p;return n},[p]),{formData:S,handleFormChange:w,getNestedValue:x,getFormDiff:k,isFormDirty:T}=Mt(C);o(()=>{"{}"!==JSON.stringify(C)&&"{}"===JSON.stringify(S)&&w(void 0,void 0,C)},[C,S]);const $=a(()=>[...g].sort((e,t)=>qm(e)-qm(t)),[g]),I=a(()=>(e=>{if(!e)return{};const t={};for(const n of e)t[n.helmPath]=n.reconciledFrom;return t})(p?.provenance),[p?.provenance]),E=a(()=>{const e=new Set;for(const t of g)for(const n of t.fields)n.componentType===xe.Dropdown&&e.add(n.helmValuePath);return e},[g]),A=a(()=>g.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:x("formData",e.helmValuePath)}))),[g,S,x]),[N,O]=r(!1),R=async()=>{const e=((e,t)=>{const n=(e,t,n)=>{for(let n=0;n<t.length-1;n++){const o=t[n];o in e&&"object"==typeof e[o]&&null!==e[o]||(e[o]={}),e=e[o]}e[t[t.length-1]]=n},o=JSON.parse(JSON.stringify(e));for(const e of t){const t=e.split(".");let a=o;for(const e of t){if(null==a||"object"!=typeof a){a=void 0;break}a=a[e]}"string"==typeof a&&n(o,t,a.replaceAll("-","_"))}return o})(k(C,S),E);await(async e=>{c.updateLocalUiConfig&&(b(!0),await c.updateLocalUiConfig(e),b(!1),await m())})(e),w(void 0,void 0,{})},D=a(()=>[{id:Zn(),type:nn.Button,buttonProps:{"data-id":"settings-save",variant:me.Primary,size:he.S,label:"Save Changes",leftIcon:Ri,loading:f,onClick:()=>O(!0)}},{id:Zn(),type:nn.Button,buttonProps:{"data-id":"settings-cancel",variant:me.Secondary,size:he.S,label:"Cancel",leftIcon:Di,onClick:()=>w(void 0,void 0,C)}}],[f,k,C,S,w]),P=a(()=>$.map(e=>({id:e.name,label:e.displayName})),[$]),F=a(()=>$.map(e=>e.name),[$]),{selectedSection:L,setSelectedSection:M,setSectionRef:_,setScrollContainerRef:z}=fi({sectionNames:F});return e(ka,{$gap:12,children:[t(Wm,{disabled:!i,loading:u||h,tabs:P,selectedTab:L,setSelectedTab:M,onClickReset:y?()=>y().then(()=>m?.()):void 0,onClickRefresh:m?()=>m():void 0}),e(Qa,{children:[!i&&t(Ml,{minSupportedVersion:n,currentVersion:l||""}),t(kn,{isOpen:T,richTitle:{icon:Mi,title:"Config Settings"},actions:D}),t(Je,{isOpen:N,title:"Save Changes via UI?",description:"We recommend updating via your Helm values.yaml to ensure changes are version-controlled and go through a proper review process.",onClose:()=>O(!1),denyButton:{label:"Keep editing",variant:me.Secondary,onClick:()=>O(!1)},approveButton:{label:"Save changes",variant:me.Primary,onClick:()=>{R(),O(!1)}}}),e(Km,{$gap:24,$alignItems:"stretch",children:[t(Ym,{ref:z,$gap:24,$width:"100%",children:g.length?$.map(n=>t(rt,{id:n.name,ref:e=>_(n.name,e),richTitle:{icon:Mi,title:n.displayName},children:n.fields.map(n=>{if(n.isEnterpriseOnly&&!s)return null;if(n.renderCondition&&!ke(n.renderCondition,[],A))return null;const o=Te(n.componentProps||"{}",{}),a=I[n.helmValuePath];return e(q,{$gap:4,children:[t(yl,{componentType:n.componentType,inputType:o.type,name:n.helmValuePath,label:n.displayName,tooltip:n.description,badge:a?{status:"odigos-local-ui-config"===a?Pe.Warning:Pe.Unknown,label:a,tooltip:`This field is reconciled from the following resource: ${a}`}:void 0,disabled:n.isHelmOnly||f,value:x("formData",n.helmValuePath),setValue:e=>w(n.helmValuePath,e),dropdownOptions:o.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0},n.helmValuePath),n.isHelmOnly?t(De,{status:Pe.Info,smallIcon:!0,message:"This field can only be updated via Helm values.yaml file"}):null]},n.helmValuePath)})},n.name)):u?t(ht,{$height:"30vh",children:t(yt,{withSpinner:!0})}):t(rt,{richTitle:{icon:Mi,title:"Config Settings"},children:t(Ae,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})}),t(Jm,{children:h&&!p?.manifestYAML?t(ht,{$height:"30vh",children:t(yt,{withSpinner:!0})}):t(Pl,{title:"Effective Config YAML",yaml:p?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0})})]})]})]})};export{Ns as AddActionDrawer,os as AddActionForm,Vu as AddDataStreamModal,Bs as AddDestinationDrawer,ls as AddDestinationForm,Xs as AddRuleDrawer,ms as AddRuleForm,rc as AddSourceDrawer,Wp as CentralConnections,fs as DataStreamForm,gs as DataStreamMergeWarning,cc as EditActionDrawer,dc as EditConfigDrawer,Uu as EditDataStreamModal,pc as EditDestinationDrawer,mc as EditRuleDrawer,vu as EditSourceDrawer,bs as EditSourceForm,Hu as ONBOARDING_DONE_MODAL_ID,rh as Onboarding,Wu as OnboardingDone,Tm as Overview,_m as PipelineCollectors,Er as RegexTesterDrawer,Xp as SamplingOnboardingModal,Ru as SamplingRuleDrawer,xs as SamplingRuleForm,Gm as SamplingRules,Zm as Settings,Xu as SystemDrawer,Mm as TABS};