@odigos/ui-kit 0.0.284 → 0.0.286

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 +28 -0
  2. package/lib/chunks/{helpers-DqYXvhEu.js → helpers-C5bkjRbO.js} +1 -1
  3. package/lib/chunks/index-DBZ1mLhG.js +298 -0
  4. package/lib/chunks/source-instrument-form-context-CnRKQq6W.js +5 -0
  5. package/lib/chunks/ui-components-Ci-Vq1Dl.js +1620 -0
  6. package/lib/components.js +1 -1
  7. package/lib/constants/index.d.ts +1 -0
  8. package/lib/constants/recommendations/index.d.ts +31 -0
  9. package/lib/constants/strings/index.d.ts +3 -0
  10. package/lib/constants.js +1 -1
  11. package/lib/containers/_drawers/edit-source-drawer/overview/runtime-card.d.ts +5 -2
  12. package/lib/containers/_drawers/index.d.ts +1 -0
  13. package/lib/containers/_drawers/recommendations-drawer/helpers.d.ts +22 -0
  14. package/lib/containers/_drawers/recommendations-drawer/index.d.ts +9 -0
  15. package/lib/containers/_drawers/recommendations-drawer/manual-examples.d.ts +6 -0
  16. package/lib/containers/_drawers/recommendations-drawer/recommendation-card.d.ts +13 -0
  17. package/lib/containers/_drawers/recommendations-drawer/remediation-actions.d.ts +9 -0
  18. package/lib/containers/_drawers/recommendations-drawer/remediation-methods.d.ts +13 -0
  19. package/lib/containers/overview/search/builder.d.ts +3 -1
  20. package/lib/containers.js +295 -227
  21. package/lib/contexts/odigos-api/capabilities.d.ts +3 -0
  22. package/lib/contexts/odigos-api/hooks/use-actions-api.d.ts +3 -1
  23. package/lib/contexts/odigos-api/hooks/use-recommendations-api.d.ts +32 -0
  24. package/lib/contexts/odigos-api/index.d.ts +2 -1
  25. package/lib/contexts/odigos-api/types.d.ts +23 -1
  26. package/lib/contexts/odigos-api/use-odigos-api.d.ts +2 -0
  27. package/lib/contexts.js +1 -1
  28. package/lib/functions.js +1 -1
  29. package/lib/hooks.js +1 -1
  30. package/lib/icons/common/index.d.ts +1 -0
  31. package/lib/icons/common/recommendations-icon/index.d.ts +2 -0
  32. package/lib/icons.js +1 -1
  33. package/lib/snippets/animated-collapse/index.d.ts +10 -0
  34. package/lib/snippets/index.d.ts +1 -0
  35. package/lib/snippets/rich-title/index.d.ts +4 -1
  36. package/lib/snippets/yaml-section-card/index.d.ts +1 -0
  37. package/lib/snippets.js +1 -1
  38. package/lib/store.js +1 -1
  39. package/lib/theme.js +1 -1
  40. package/lib/types/common/index.d.ts +2 -1
  41. package/lib/types/destinations/index.d.ts +1 -0
  42. package/lib/types/index.d.ts +1 -0
  43. package/lib/types/recommendations.d.ts +73 -0
  44. package/lib/types/workload/index.d.ts +14 -0
  45. package/lib/types.js +1 -1
  46. package/lib/visuals.js +1 -1
  47. package/package.json +1 -1
  48. package/lib/chunks/index-DxXpZafj.js +0 -257
  49. package/lib/chunks/source-instrument-form-context-BPXm6ufr.js +0 -5
  50. package/lib/chunks/ui-components-M0c3qdR2.js +0 -1601
package/lib/containers.js CHANGED
@@ -1,4 +1,4 @@
1
- import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMemo as o,useEffect as a,useState as l,Fragment as r,forwardRef as s,useImperativeHandle as c,useCallback as d,useRef as p,Children as u,createContext as h,useContext as m,useLayoutEffect as g,memo as f}from"react";import b,{useTheme as v,css as y,keyframes as C}from"styled-components";import{u as S,n as x,C as w,g as T,f as k,e as I,q as N,h as E,j as O,k as $,p as A,l as R,c as D,r as P,S as _,s as L,R as F,t as M,w as z,o as X,x as B,y as U,z as V,A as H,B as j,D as G,E as W,F as K,G as Y,H as J,I as q,J as Z}from"./chunks/helpers-DqYXvhEu.js";import{C as Q,e as ee,g as te,f as ne,h as ie,by as oe,F as ae,bz as le,bA as re,bB as se,bC as ce,bo as de,d as pe,k as ue,I as he,bD as me,o as ge,p as fe,w as be,Y as ve,bE as ye,bF as Ce,as as Se,bG as xe,bH as we,B as Te,i as ke,j as Ie,x as Ne,a4 as Ee,bp as Oe,b1 as $e,bI as Ae,u as Re,N as De,S as Pe,bJ as _e,bu as Le,bv as Fe,bt as Me,bK as ze,ag as Xe,T as Be,ae as Ue,af as Ve,ac as He,ab as je,ad as Ge,aa as We,b8 as Ke,a9 as Ye,bL as Je,bM as qe,bN as Ze,bO as Qe,bP as et,W as tt,m as nt,bc as it,bQ as ot,bR as at,bS as lt,bT as rt,bU as st,bV as ct,bW as dt,bX as pt,Q as ut,bY as ht,bZ as mt,b_ as gt,b0 as ft,bs as bt,s as vt,b$ as yt,c0 as Ct,b2 as St,c1 as xt,c2 as wt,aZ as Tt,v as kt,bw as It,bb as Nt,q as Et,c3 as Ot,bd as $t,c4 as At,c5 as Rt,bf as Dt,c6 as Pt,b4 as _t,c7 as Lt,l as Ft,a6 as Mt,y as zt,D as Xt,c8 as Bt,ah as Ut,c9 as Vt,ca as Ht,n as jt,z as Gt,bi as Wt,bn as Kt,cb as Yt,cc as Jt,bm as qt,cd as Zt,a3 as Qt,ce as en,cf as tn,b7 as nn,H as on,cg as an,ch as ln,ci as rn,cj as sn,ck as cn,cl as dn,cm as pn,cn as un,co as hn,O as mn,cp as gn,cq as fn,A as bn,b3 as vn,a$ as yn,cr as Cn,cs as Sn,ct as xn,cu as wn,cv as Tn,cw as kn,bx as In,cx as Nn,cy as En,cz as On,cA as $n,cB as An,b as Rn,cC as Dn,cD as Pn,M as _n,cE as Ln,cF as Fn,cG as Mn,cH as zn,cI as Xn,cJ as Bn,cK as Un,cL as Vn,cM as Hn,cN as jn,cO as Gn,cP as Wn,cQ as Kn,cR as Yn,cS as Jn,cT as qn,cU as Zn,cV as Qn,cW as ei,cX as ti,aP as ni,cY as ii,cZ as oi,c_ as ai,c$ as li,d0 as ri,d1 as si,d2 as ci,d3 as di,d4 as pi,d5 as ui,d6 as hi,d7 as mi,d8 as gi,d9 as fi,da as bi,ay as vi,db as yi,dc as Ci,b5 as Si,dd as xi,de as wi,df as Ti,dg as ki,dh as Ii,di as Ni,dj as Ei,dk as Oi,dl as $i,dm as Ai,dn as Ri,dp as Di,dq as Pi,dr as _i,ds as Li,dt as Fi,du as Mi,dv as zi,dw as Xi,dx as Bi,dy as Ui,dz as Vi,dA as Hi,dB as ji,dC as Gi,dD as Wi,dE as Ki,dF as Yi,dG as Ji,dH as qi,dI as Zi,dJ as Qi,dK as eo,dL as to,dM as no,dN as io,dO as oo,dP as ao,dQ as lo,dR as ro,dS as so,dT as co,dU as po,dV as uo,dW as ho,dX as mo,dY as go,dZ as fo,d_ as bo,d$ as vo,e0 as yo,e1 as Co,e2 as So,e3 as xo,e4 as wo,e5 as To,e6 as ko,e7 as Io,e8 as No,e9 as Eo,ea as Oo,eb as $o,ec as Ao,ed as Ro,ee as Do,ef as Po,eg as _o,eh as Lo,ei as Fo,ej as Mo,ek as zo,el as Xo,em as Bo,en as Uo,eo as Vo,ep as Ho,eq as jo,P as Go,er as Wo,es as Ko,et as Yo,eu as Jo,ev as qo,ew as Zo,ex as Qo,a_ as ea,ey as ta,$ as na,ez as ia,eA as oa,eB as aa,eC as la,eD as ra,eE as sa,eF as ca,eG as da,eH as pa,eI as ua,eJ as ha,eK as ma,be as ga,eL as fa,R as ba,a as va,eM as ya,eN as Ca,eO as Sa,eP as xa,eQ as wa,eR as Ta,eS as ka,eT as Ia,eU as Na,eV as Ea,eW as Oa,eX as $a,eY as Aa,eZ as Ra,e_ as Da,e$ as Pa,f0 as _a,f1 as La,f2 as Fa,f3 as Ma,f4 as za,f5 as Xa}from"./chunks/ui-components-M0c3qdR2.js";import{ChevronRightIcon as Ba,ActionIcon as Ua,TrashIcon as Va,PlusIcon as Ha,ArrowRightIcon as ja,BookIcon as Ga,DeleteIcon as Wa,EditIcon as Ka,GoLogo as Ya,JavaLogo as Ja,PhpLogo as qa,VSquareIcon as Za,XSquareIcon as Qa,DestinationIcon as el,ChevronUpIcon as tl,ChevronDownIcon as nl,VIcon as il,XIcon as ol,InstrumentationRuleIcon as al,SourceIcon as ll,NamespacesIcon as rl,AzureIcon as sl,GoogleCloudPlatformLogo as cl,AwsLogo as dl,CloudConnectorIcon as pl,EyeOpenIcon as ul,OdigosLogo as hl,ArrowLeftIcon as ml,ISquareIcon as gl,RefreshIcon as fl,SettingsIcon as bl,PodIcon as vl,K8sLogo as yl,ExclamationCircleIcon as Cl,QuestionCircleIcon as Sl,InboundIcon as xl,OutboundIcon as wl,UserIcon as Tl,TerminalIcon as kl,RefreshLeftArrowIcon as Il,MinusIcon as Nl,SearchIcon as El,ExpandIcon as Ol,CopyIcon as $l,DotIcon as Al,ArrowDownIcon as Rl,DownloadIcon as Dl,SamplingIcon as Pl,ExclamationTriangleIcon as _l,KeyIcon as Ll,DiagnoseIcon as Fl,StarIcon as Ml,ArrowIcon as zl,ConnectionsIcon as Xl,FilterIcon as Bl,DataStreamIcon as Ul,PipelineCollectorIcon as Vl,ArrowDownSquareIcon as Hl,ArrowUpSquareIcon as jl,GatewayIcon as Gl,YamlIcon as Wl,ImageErrorIcon as Kl,LockIcon as Yl}from"./icons.js";import{n as Jl,f as ql,E as Zl,k as Ql,I as er,l as tr,A as nr,i as ir,P as or,S as ar,R as lr,g as rr,j as sr,c as cr,h as dr,m as pr,W as ur,C as hr,b as mr,Y as gr,O as fr,a as br,U as vr,e as yr}from"./chunks/index-DxXpZafj.js";import{h as Cr,o as Sr,n as xr,q as wr,m as Tr,t as kr,s as Ir,S as Nr,w as Er,E as Or,x as $r,y as Ar,v as Rr,l as Dr,d as Pr,C as _r,O as Lr,f as Fr,b as Mr,R as zr,A as Xr,e as Br,D as Ur}from"./chunks/source-instrument-form-context-BPXm6ufr.js";import{createPortal as Vr}from"react-dom";import{MarkerType as Hr,useNodesState as jr,useEdgesState as Gr,Handle as Wr,Position as Kr,getSmoothStepPath as Yr,BaseEdge as Jr,EdgeLabelRenderer as qr,ReactFlowProvider as Zr,ReactFlow as Qr,Background as es,Controls as ts,ControlButton as ns,useReactFlow as is}from"@xyflow/react";import os from"elkjs/lib/elk.bundled.js";import"@xyflow/react/dist/style.css";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";import"@apollo/client/react";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";import"@apollo/client/errors";import"@apollo/client";const as=b.div`
1
+ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMemo as o,useEffect as a,useState as l,Fragment as r,forwardRef as s,useImperativeHandle as c,useCallback as d,useRef as p,Children as u,createContext as h,useContext as m,useLayoutEffect as g,memo as f}from"react";import b,{useTheme as v,css as y,keyframes as C}from"styled-components";import{u as S,n as x,C as w,g as T,f as k,e as I,q as N,h as E,j as $,k as O,p as A,l as R,c as D,r as P,S as _,s as L,R as F,t as z,w as M,o as X,x as B,y as U,z as V,A as H,B as j,D as G,E as W,F as K,G as Y,H as J,I as q,J as Z}from"./chunks/helpers-C5bkjRbO.js";import{C as Q,e as ee,g as te,f as ne,h as ie,bD as oe,F as ae,bE as le,bF as re,bG as se,bH as ce,bt as de,d as pe,k as ue,I as he,bI as me,o as ge,p as fe,w as be,Y as ve,bJ as ye,bK as Ce,as as Se,bL as xe,bM as we,B as Te,i as ke,j as Ie,x as Ne,a4 as Ee,bu as $e,b1 as Oe,bN as Ae,u as Re,N as De,S as Pe,bO as _e,bz as Le,bA as Fe,by as ze,bP as Me,ag as Xe,T as Be,ae as Ue,af as Ve,ac as He,ab as je,ad as Ge,aa as We,b9 as Ke,a9 as Ye,bQ as Je,bR as qe,bS as Ze,bT as Qe,bU as et,W as tt,m as nt,bd as it,bV as ot,bW as at,bX as lt,bY as rt,bZ as st,b_ as ct,b$ as dt,c0 as pt,Q as ut,c1 as ht,c2 as mt,c3 as gt,b0 as ft,bx as bt,s as vt,c4 as yt,b6 as Ct,b2 as St,c5 as xt,c6 as wt,aZ as Tt,v as kt,bB as It,bc as Nt,q as Et,c7 as $t,be as Ot,c8 as At,c9 as Rt,bg as Dt,ca as Pt,b4 as _t,cb as Lt,l as Ft,a6 as zt,y as Mt,D as Xt,cc as Bt,ah as Ut,cd as Vt,ce as Ht,n as jt,z as Gt,bj as Wt,bs as Kt,cf as Yt,cg as Jt,br as qt,ch as Zt,a3 as Qt,ci as en,cj as tn,b8 as nn,H as on,ck as an,cl as ln,cm as rn,cn as sn,co as cn,cp as dn,cq as pn,cr as un,cs as hn,O as mn,ct as gn,cu as fn,A as bn,b3 as vn,a$ as yn,cv as Cn,cw as Sn,cx as xn,cy as wn,cz as Tn,cA as kn,bC as In,cB as Nn,cC as En,cD as $n,cE as On,cF as An,b as Rn,cG as Dn,cH as Pn,M as _n,cI as Ln,cJ as Fn,cK as zn,cL as Mn,cM as Xn,cN as Bn,cO as Un,cP as Vn,cQ as Hn,cR as jn,cS as Gn,cT as Wn,cU as Kn,cV as Yn,cW as Jn,cX as qn,cY as Zn,cZ as Qn,c_ as ei,c$ as ti,d0 as ni,d1 as ii,d2 as oi,d3 as ai,d4 as li,d5 as ri,d6 as si,d7 as ci,d8 as di,d9 as pi,da as ui,db as hi,dc as mi,dd as gi,de as fi,df as bi,dg as vi,dh as yi,di as Ci,dj as Si,dk as xi,dl as wi,dm as Ti,dn as ki,dp as Ii,aP as Ni,dq as Ei,dr as $i,ds as Oi,dt as Ai,du as Ri,dv as Di,dw as Pi,dx as _i,dy as Li,dz as Fi,dA as zi,dB as Mi,dC as Xi,dD as Bi,dE as Ui,ay as Vi,dF as Hi,dG as ji,b5 as Gi,dH as Wi,dI as Ki,dJ as Yi,dK as Ji,dL as qi,dM as Zi,dN as Qi,dO as eo,dP as to,dQ as no,dR as io,dS as oo,dT as ao,dU as lo,dV as ro,dW as so,dX as co,dY as po,dZ as uo,d_ as ho,d$ as mo,e0 as go,e1 as fo,e2 as bo,e3 as vo,e4 as yo,e5 as Co,e6 as So,e7 as xo,e8 as wo,e9 as To,ea as ko,eb as Io,ec as No,ed as Eo,ee as $o,ef as Oo,eg as Ao,eh as Ro,ei as Do,ej as Po,ek as _o,el as Lo,em as Fo,en as zo,eo as Mo,ep as Xo,eq as Bo,er as Uo,es as Vo,et as Ho,eu as jo,ev as Go,ew as Wo,ex as Ko,ey as Yo,ez as Jo,eA as qo,eB as Zo,eC as Qo,eD as ea,eE as ta,eF as na,eG as ia,eH as oa,eI as aa,eJ as la,eK as ra,eL as sa,eM as ca,eN as da,eO as pa,eP as ua,eQ as ha,eR as ma,eS as ga,eT as fa,P as ba,eU as va,eV as ya,eW as Ca,eX as Sa,eY as xa,eZ as wa,e_ as Ta,a_ as ka,e$ as Ia,$ as Na,f0 as Ea,f1 as $a,f2 as Oa,f3 as Aa,f4 as Ra,f5 as Da,f6 as Pa,f7 as _a,f8 as La,f9 as Fa,fa as za,fb as Ma,bf as Xa,fc as Ba,R as Ua,a as Va,fd as Ha,fe as ja,ff as Ga,fg as Wa,fh as Ka,fi as Ya,fj as Ja,fk as qa,fl as Za,fm as Qa,fn as el,fo as tl,fp as nl,fq as il,fr as ol,fs as al,ft as ll,fu as rl,fv as sl,fw as cl,fx as dl,fy as pl}from"./chunks/ui-components-Ci-Vq1Dl.js";import{ChevronRightIcon as ul,ActionIcon as hl,TrashIcon as ml,PlusIcon as gl,ArrowRightIcon as fl,BookIcon as bl,DeleteIcon as vl,EditIcon as yl,GoLogo as Cl,JavaLogo as Sl,PhpLogo as xl,VSquareIcon as wl,XSquareIcon as Tl,DestinationIcon as kl,ChevronUpIcon as Il,ChevronDownIcon as Nl,VIcon as El,XIcon as $l,InstrumentationRuleIcon as Ol,SourceIcon as Al,NamespacesIcon as Rl,AzureIcon as Dl,GoogleCloudPlatformLogo as Pl,AwsLogo as _l,CloudConnectorIcon as Ll,EyeOpenIcon as Fl,OdigosLogo as zl,ArrowLeftIcon as Ml,ISquareIcon as Xl,RefreshIcon as Bl,SettingsIcon as Ul,PodIcon as Vl,K8sLogo as Hl,ExclamationCircleIcon as jl,QuestionCircleIcon as Gl,InboundIcon as Wl,OutboundIcon as Kl,UserIcon as Yl,TerminalIcon as Jl,RefreshLeftArrowIcon as ql,MinusIcon as Zl,SearchIcon as Ql,ExpandIcon as er,CopyIcon as tr,DotIcon as nr,ArrowDownIcon as ir,DownloadIcon as or,MetricsIcon as ar,EnrichmentIcon as lr,NormalizationIcon as rr,SamplingIcon as sr,RecommendationsIcon as cr,ExclamationTriangleIcon as dr,KeyIcon as pr,DiagnoseIcon as ur,StarIcon as hr,ArrowIcon as mr,ConnectionsIcon as gr,FilterIcon as fr,DataStreamIcon as br,PipelineCollectorIcon as vr,ArrowDownSquareIcon as yr,ArrowUpSquareIcon as Cr,GatewayIcon as Sr,YamlIcon as xr,ImageErrorIcon as wr,LockIcon as Tr}from"./icons.js";import{n as kr,f as Ir,E as Nr,k as Er,I as $r,l as Or,o as Ar,i as Rr,P as Dr,S as Pr,R as _r,g as Lr,j as Fr,c as zr,h as Mr,m as Xr,W as Br,C as Ur,b as Vr,Y as Hr,A as jr,O as Gr,a as Wr,U as Kr,e as Yr}from"./chunks/index-DBZ1mLhG.js";import{h as Jr,o as qr,n as Zr,q as Qr,m as es,t as ts,s as ns,S as is,w as os,E as as,x as ls,y as rs,v as ss,l as cs,d as ds,C as ps,O as us,f as hs,b as ms,R as gs,A as fs,e as bs,D as vs}from"./chunks/source-instrument-form-context-CnRKQq6W.js";import{createPortal as ys}from"react-dom";import{MarkerType as Cs,useNodesState as Ss,useEdgesState as xs,Handle as ws,Position as Ts,getSmoothStepPath as ks,BaseEdge as Is,EdgeLabelRenderer as Ns,ReactFlowProvider as Es,ReactFlow as $s,Background as Os,Controls as As,ControlButton as Rs,useReactFlow as Ds}from"@xyflow/react";import Ps from"elkjs/lib/elk.bundled.js";import"@xyflow/react/dist/style.css";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";import"@apollo/client/react";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";import"@apollo/client/errors";import"@apollo/client";const _s=b.div`
2
2
  display: flex;
3
3
  align-items: center;
4
4
  justify-content: space-between;
@@ -11,24 +11,24 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
11
11
  &:hover {
12
12
  background-color: ${({$isSelected:e,$purpleColors:t,theme:n})=>n.v2.colors[t?"purple":"silver"][e?"700":"800"]};
13
13
  }
14
- `,ls=b.div`
14
+ `,Ls=b.div`
15
15
  display: flex;
16
16
  align-items: center;
17
17
  justify-content: center;
18
18
  padding: 8px;
19
19
  border-radius: 8px;
20
20
  background-color: ${({theme:e})=>e.v2.colors.white[500]+oe["004"]};
21
- `,rs=b(ie)`
21
+ `,Fs=b(ie)`
22
22
  flex: 1;
23
23
  min-width: 0;
24
- `,ss=b(ae)`
24
+ `,zs=b(ae)`
25
25
  flex: 1;
26
26
  min-width: 0;
27
- `,cs=b(ie)`
27
+ `,Ms=b(ie)`
28
28
  flex-shrink: 0;
29
- `,ds=({dataId:n,icon:i,title:o,description:a,withCarret:l,purpleColors:r,disabled:s,children:c,isSelected:d,onClick:p,isChecked:u,isPartiallyChecked:h,onCheckboxChange:m})=>e(as,{"data-id":n||`list-item-${o}`,$isSelected:d,$purpleColors:r,$disabled:s,onClick:()=>!d&&!s&&p(),children:[e(rs,{$gap:12,children:[m&&t(Q,{partiallyChecked:h||!1,value:u||!1,onChange:e=>m(e)}),i&&t(ls,{children:t(i,{size:20})}),e(ss,{$gap:4,children:[t(ee,{size:te.XS,nowrap:!0,children:o}),a&&t(ee,{size:te.XXXS,color:ne.Secondary,nowrap:!0,children:a})]})]}),(l||c)&&e(cs,{$gap:8,children:[c,l&&t(Ba,{size:18})]})]}),ps="other",us={...se,[ps]:{TITLE:"Other",ICON:Ua}},hs=b(ie)`
29
+ `,Xs=({dataId:n,icon:i,title:o,description:a,withCarret:l,purpleColors:r,disabled:s,children:c,isSelected:d,onClick:p,isChecked:u,isPartiallyChecked:h,onCheckboxChange:m})=>e(_s,{"data-id":n||`list-item-${o}`,$isSelected:d,$purpleColors:r,$disabled:s,onClick:()=>!d&&!s&&p(),children:[e(Fs,{$gap:12,children:[m&&t(Q,{partiallyChecked:h||!1,value:u||!1,onChange:e=>m(e)}),i&&t(Ls,{children:t(i,{size:20})}),e(zs,{$gap:4,children:[t(ee,{size:te.XS,nowrap:!0,children:o}),a&&t(ee,{size:te.XXXS,color:ne.Secondary,nowrap:!0,children:a})]})]}),(l||c)&&e(Ms,{$gap:8,children:[c,l&&t(ul,{size:18})]})]}),Bs="other",Us={...se,[Bs]:{TITLE:"Other",ICON:hl}},Vs=b(ie)`
30
30
  padding: 8px 12px 4px 12px;
31
- `,ms=({bucket:n,options:i,selectedType:o,onSelectOption:a})=>{const l=v(),{TITLE:r,ICON:s}=us[n],c=l.v2.colors.purple[200];return e("div",{"data-id":`action-category-${n}`,children:[e(hs,{$gap:8,children:[t(s,{fill:c}),t(ee,{size:te.XXS,color:c,children:r}),t(ce,{label:i.length})]}),i.map(e=>t(ds,{dataId:e.type?`option-${e.type}`:void 0,icon:e.icon,title:e.label,description:e.subtitle||e.description,withCarret:!0,isSelected:o===e.type,onClick:()=>a(e)},e.type))]})},gs=[{id:"CREDIT_CARD",label:"Credit card"}],fs=[{id:de.CollectContainerAttributes,label:"Collect container attributes"},{id:de.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:de.CollectWorkloadId,label:"Collect workload ID"},{id:de.CollectClusterId,label:"Collect cluster ID"}],bs=[{id:me.Pod,label:me.Pod},{id:me.Namespace,label:me.Namespace},{id:me.Node,label:me.Node}],vs=[{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:bs}],ys=[{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:bs}],Cs=de.ExtractAttribute;var Ss;(e=>{e.Preset="preset",e.Regex="regex"})(Ss||(Ss={}));const xs=[Ce.JSON,Ce.SQL,Ce.ResourcePath],ws=(e=Ce.JSON)=>({targetAttributeName:"",lookupKey:"",dataFormat:e,regex:""}),Ts=e=>!!e.regex&&!e.lookupKey&&!e.dataFormat,ks=b.div`
31
+ `,Hs=({bucket:n,options:i,selectedType:o,onSelectOption:a})=>{const l=v(),{TITLE:r,ICON:s}=Us[n],c=l.v2.colors.purple[200];return e("div",{"data-id":`action-category-${n}`,children:[e(Vs,{$gap:8,children:[t(s,{fill:c}),t(ee,{size:te.XXS,color:c,children:r}),t(ce,{label:i.length})]}),i.map(e=>t(Xs,{dataId:e.type?`option-${e.type}`:void 0,icon:e.icon,title:e.label,description:e.subtitle||e.description,withCarret:!0,isSelected:o===e.type,onClick:()=>a(e)},e.type))]})},js=[{id:"CREDIT_CARD",label:"Credit card"}],Gs=[{id:de.CollectContainerAttributes,label:"Collect container attributes"},{id:de.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:de.CollectWorkloadId,label:"Collect workload ID"},{id:de.CollectClusterId,label:"Collect cluster ID"}],Ws=[{id:me.Pod,label:me.Pod},{id:me.Namespace,label:me.Namespace},{id:me.Node,label:me.Node}],Ks=[{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:Ws}],Ys=[{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:Ws}],Js=de.ExtractAttribute;var qs;(e=>{e.Preset="preset",e.Regex="regex"})(qs||(qs={}));const Zs=[Ce.JSON,Ce.SQL,Ce.ResourcePath],Qs=(e=Ce.JSON)=>({targetAttributeName:"",lookupKey:"",dataFormat:e,regex:""}),ec=e=>!!e.regex&&!e.lookupKey&&!e.dataFormat,tc=b.div`
32
32
  width: 100%;
33
33
  background: ${({theme:e})=>e.v2.colors.silver[800]};
34
34
  border-radius: 8px;
@@ -36,13 +36,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
36
36
  display: flex;
37
37
  flex-direction: column;
38
38
  gap: 8px;
39
- `,Is=b.div`
39
+ `,nc=b.div`
40
40
  flex: 1;
41
41
  min-width: 0;
42
- `,Ns=b.div`
42
+ `,ic=b.div`
43
43
  /* Pushes the arrow down to sit next to the inputs rather than the field titles. */
44
44
  padding-top: 24px;
45
- `,Es=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),Os=e=>{const t={};return e.forEach(({oldKey:e,newKey:n})=>{t[e]=n}),t},$s=de.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"}],Rs={[Oe.K8sAttributes]:({value:i,setValue:o,formErrors:l})=>(a(()=>{i[de.CollectContainerAttributes]||i[de.CollectReplicaSetAttributes]||i[de.CollectWorkloadId]||i[de.CollectClusterId]||i[de.LabelsAttributes]?.length||i[de.AnnotationsAttributes]?.length||(o(de.CollectContainerAttributes,!0),o(de.CollectReplicaSetAttributes,!0),o(de.CollectWorkloadId,!0),o(de.CollectClusterId,!0),o(de.LabelsAttributes,[]),o(de.AnnotationsAttributes,[]))},[]),e(n,{children:[t(ae,{$gap:6,children:fs.map(({id:n,label:a})=>e(ae,{children:[t(Q,{label:a,value:i[n]||!1,onChange:e=>o(n,e)}),t(ue,{errorMessage:l[n]})]},n))}),t(he,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:vs,values:i[de.LabelsAttributes]||[],setValues:e=>o(de.LabelsAttributes,e),errorMessage:l[de.LabelsAttributes]}),t(he,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:ys,values:i[de.AnnotationsAttributes]||[],setValues:e=>o(de.AnnotationsAttributes,e),errorMessage:l[de.AnnotationsAttributes]})]})),[Oe.AddClusterInfo]:({value:i,setValue:o,formErrors:a})=>{const l=v();return e(n,{children:[t(ge,{label:"Overwrite existing values",labelAlign:fe.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:i[de.OverwriteExistingValues]||!1,onChange:e=>o(de.OverwriteExistingValues,e)}),t(he,{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:i[de.ClusterAttributes]||[],setValues:e=>o(de.ClusterAttributes,e),errorMessage:a[de.ClusterAttributes]})]})},[Oe.DeleteAttributes]:({value:e,setValue:n,formErrors:i})=>t(be,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[de.AttributeNamesToDelete]||[],setValues:e=>n(de.AttributeNamesToDelete,e),errorMessage:i[de.AttributeNamesToDelete]}),[Oe.RenameAttributes]:({value:e,setValue:n,formErrors:i})=>{const o=e[de.Renames],[r,s]=l(()=>Es(o));return a(()=>{((e,t)=>{const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&n.every(n=>Object.prototype.hasOwnProperty.call(t,n)&&t[n]===e[n])})(Os(r),o||{})||s(Es(o))},[o]),t(he,{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:r,setValues:e=>{const t=e.map(e=>({oldKey:String(e.oldKey??""),newKey:String(e.newKey??"")}));s(t),n(de.Renames,Os(t))},errorMessage:i[de.Renames]})},[Oe.PiiMasking]:({value:n,setValue:i,formErrors:o})=>(a(()=>{n[de.PiiCategories]?.length||i(de.PiiCategories,gs.map(({id:e})=>e))},[]),e(ae,{$gap:12,children:[t(pe,{label:"Attributes to mask"}),t(ae,{$gap:6,children:gs.map(({id:e,label:o})=>t(Q,{label:o,value:n[de.PiiCategories]?.includes(e)||!1,onChange:t=>{const o=n[de.PiiCategories]||[],a=t?[...o,e]:o.filter(t=>t!==e);i(de.PiiCategories,a)}},e))}),t(ue,{errorMessage:o[de.PiiCategories]})]})),[Oe.URLTemplatization]:({value:i,setValue:o,formErrors:a})=>{const l=v(),s=i[$s]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>o($s,e),d=(e,t)=>c(s.map((n,i)=>i===e?{...n,...t}:n));return e(n,{children:[s.map((n,i)=>e(r,{children:[t(Ee,{}),e(ae,{$gap:12,children:[e(ie,{$justifyContent:"space-between",$alignItems:"center",children:[t(pe,{label:`Rule Group ${i+1}`}),t(Te,{leftIcon:()=>t(Va,{fill:l.v2.colors.red[500]}),variant:Ie.Secondary,size:ke.S,onClick:()=>{return e=i,c(s.filter((t,n)=>n!==e));var e},disabled:1===s.length})]}),t(Ne,{name:`urlGroup-${i}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:n.filterK8sNamespace||"",onChange:e=>d(i,{filterK8sNamespace:e.target.value})}),t(he,{name:`urlGroup-${i}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:As,values:n.workloadFilters||[],setValues:e=>d(i,{workloadFilters:e})}),t(be,{name:`urlGroup-${i}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:n.templatizationRules.map(e=>e.template),setValues:e=>d(i,{templatizationRules:e.map(e=>({template:e}))})})]}),t(ue,{errorMessage:a[$s]})]},`url-templatization-group-${i}`)),t(Te,{variant:Ie.Secondary,label:"Add rule group",leftIcon:Ha,onClick:()=>c([...s,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(Ee,{})]})},[Oe.ExtractAttribute]:({value:n,setValue:i,formErrors:o})=>{const r=v(),s=o[Cs],c=n[Cs]?.extractions||[],[d,p]=l(()=>(e=>e.length&&e.some(Ts)?Ss.Regex:Ss.Preset)(c)),[u,h]=l(null),m=e=>i(Cs,{extractions:e});a(()=>{0===c.length&&m([d===Ss.Preset?ws():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const g=(e,t)=>{m(c.map((n,i)=>i===e?{...n,...t}:n))},f=()=>{m([...c,d===Ss.Preset?ws():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},b=d===Ss.Preset,y=c.length?c:[b?ws():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=u&&y[u]?.regex||"";return e(ae,{$gap:16,$width:"100%",children:[t(ve,{options:[{value:Ss.Preset,label:ye.SEGMENT_PRESET_LABEL,tooltip:ye.SEGMENT_PRESET_TOOLTIP,selectedBgColor:r.v2.colors.purple[500]},{value:Ss.Regex,label:ye.SEGMENT_REGEX_LABEL,tooltip:ye.SEGMENT_REGEX_TOOLTIP,selectedBgColor:r.v2.colors.purple[500]}],selected:d,setSelected:e=>{p(e),m([e===Ss.Preset?ws():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(ae,{$gap:8,$width:"100%",children:[y.map((n,i)=>{const o=i===y.length-1,a=n.dataFormat||Ce.JSON,l=xe[a];return e(ks,{"data-id":`extract-row-${i}`,children:[e(ie,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(ae,{$gap:10,children:[t(pe,{label:b?ye.PRESET_ROW_TITLE(i):ye.REGEX_ROW_TITLE(i)}),b&&t(ie,{$gap:24,children:xs.map(e=>t(Se,{"data-id":`extract-row-${i}-fmt-${e}`,size:we.L,label:xe[e].label,value:a===e,onChange:t=>t&&g(i,{dataFormat:e})},`extract-row-${i}-fmt-${e}`))})]}),e(ie,{$gap:4,$alignItems:"center",children:[!b&&t(Te,{"data-id":`extract-row-${i}-test-regex`,label:ye.TEST_REGEX_LABEL,variant:Ie.Secondary,size:ke.S,onClick:()=>h(i),disabled:!n.regex?.trim()}),t(Te,{"data-id":`extract-row-${i}-delete`,leftIcon:()=>t(Va,{fill:r.v2.colors.red[500]}),variant:Ie.Secondary,size:ke.S,onClick:()=>(e=>{const t=c.filter((t,n)=>n!==e);m(t.length?t:[d===Ss.Preset?ws():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(i)}),o&&t(Te,{"data-id":`extract-row-${i}-add`,leftIcon:Ha,variant:Ie.Secondary,size:ke.S,onClick:f})]})]}),b?e(ie,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(Is,{children:t(Ne,{name:`extract-row-${i}-lookupKey`,label:l.keyLabel,placeholder:l.placeholder,helpMessage:l.helpMessage,width:"100%",value:n.lookupKey||"",onChange:e=>g(i,{lookupKey:e.target.value})})}),t(Ns,{children:t(ja,{size:24,fill:r.v2.colors.silver[200]})}),t(Is,{children:t(Ne,{name:`extract-row-${i}-targetAttributeName`,label:ye.TARGET_LABEL,placeholder:ye.TARGET_PLACEHOLDER,helpMessage:ye.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(i,{targetAttributeName:e.target.value})})})]}):e(ae,{$gap:12,$width:"100%",children:[t(Ne,{name:`extract-row-${i}-regex`,label:ye.REGEX_LABEL,placeholder:ye.REGEX_PLACEHOLDER,helpMessage:ye.REGEX_HELP,width:"100%",value:n.regex||"",onChange:e=>g(i,{regex:e.target.value})}),t(Ne,{name:`extract-row-${i}-targetAttributeName`,label:ye.TARGET_LABEL,placeholder:ye.TARGET_PLACEHOLDER,helpMessage:ye.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(i,{targetAttributeName:e.target.value})})]})]},`extract-row-${i}`)}),t(ue,{errorMessage:s})]}),t(Jl,{isOpen:null!=u,regex:C,onClose:()=>h(null)})]})},[Oe.DbQueryTemplatization]:null,[Oe.InferDbAttributes]:null},Ds=({actionType:e,value:n,setValue:i,formErrors:o,dynamicFields:a,signals:l,sourceOptions:r,namespaceOptions:s})=>{if(!e)return null;if(a?.length)return t(ql,{fields:a,value:n||{},setValue:i,formErrors:o||{},signals:l||[],seedInitialValues:!0,keyValuePersistAs:"map",sourceOptions:r,namespaceOptions:s},e);const c=Rs[e];return c?t(c,{value:n,setValue:i,formErrors:o}):null},Ps=()=>{const{selectedOption:n,genericForm:i,sourceOptions:o,namespaceOptions:a}=Cr();if(!i||!n)return t($e,{title:"No active form"});const{formData:l,handleFormChange:r,formErrors:s}=i;return e(ae,{$gap:24,children:[e(ie,{$gap:12,$justifyContent:"space-between",children:[t(Ae,{size:te.XXXS,maxLines:2,children:n.description}),e(ie,{$gap:12,children:[t(Zl,{isEnabled:!l.disabled,setIsEnabled:e=>r("disabled",!e)}),t(Te,{leftIcon:Ga,variant:Ie.Secondary,size:ke.S,onClick:()=>n.docsUrl&&window.open(n.docsUrl,"_blank","noopener noreferrer")})]})]}),t(Ql,{title:"Signals for processing",allowedSignals:n.allowedSignals,selectedSignals:l.signals||[],setSelectedSignals:e=>r("signals",e),errorMessage:s.signals}),t(Ne,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:l.name||"",onChange:({target:{value:e}})=>r("name",e),errorMessage:s.name}),t(Ds,{actionType:n.type,dynamicFields:n.fields,signals:l.signals||[],value:l.fields,setValue:(e,t)=>r(`fields.${e}`,t),formErrors:s,sourceOptions:o,namespaceOptions:a}),t(Re,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:l.notes||"",onChange:({target:{value:e}})=>r("notes",e),errorMessage:s.notes})]})},_s=b(ie)`
45
+ `,oc=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),ac=e=>{const t={};return e.forEach(({oldKey:e,newKey:n})=>{t[e]=n}),t},lc=de.UrlTemplatizationRulesGroups,rc=[{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"}],sc={[$e.K8sAttributes]:({value:i,setValue:o,formErrors:l})=>(a(()=>{i[de.CollectContainerAttributes]||i[de.CollectReplicaSetAttributes]||i[de.CollectWorkloadId]||i[de.CollectClusterId]||i[de.LabelsAttributes]?.length||i[de.AnnotationsAttributes]?.length||(o(de.CollectContainerAttributes,!0),o(de.CollectReplicaSetAttributes,!0),o(de.CollectWorkloadId,!0),o(de.CollectClusterId,!0),o(de.LabelsAttributes,[]),o(de.AnnotationsAttributes,[]))},[]),e(n,{children:[t(ae,{$gap:6,children:Gs.map(({id:n,label:a})=>e(ae,{children:[t(Q,{label:a,value:i[n]||!1,onChange:e=>o(n,e)}),t(ue,{errorMessage:l[n]})]},n))}),t(he,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:Ks,values:i[de.LabelsAttributes]||[],setValues:e=>o(de.LabelsAttributes,e),errorMessage:l[de.LabelsAttributes]}),t(he,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:Ys,values:i[de.AnnotationsAttributes]||[],setValues:e=>o(de.AnnotationsAttributes,e),errorMessage:l[de.AnnotationsAttributes]})]})),[$e.AddClusterInfo]:({value:i,setValue:o,formErrors:a})=>{const l=v();return e(n,{children:[t(ge,{label:"Overwrite existing values",labelAlign:fe.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:i[de.OverwriteExistingValues]||!1,onChange:e=>o(de.OverwriteExistingValues,e)}),t(he,{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:i[de.ClusterAttributes]||[],setValues:e=>o(de.ClusterAttributes,e),errorMessage:a[de.ClusterAttributes]})]})},[$e.DeleteAttributes]:({value:e,setValue:n,formErrors:i})=>t(be,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[de.AttributeNamesToDelete]||[],setValues:e=>n(de.AttributeNamesToDelete,e),errorMessage:i[de.AttributeNamesToDelete]}),[$e.RenameAttributes]:({value:e,setValue:n,formErrors:i})=>{const o=e[de.Renames],[r,s]=l(()=>oc(o));return a(()=>{((e,t)=>{const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&n.every(n=>Object.prototype.hasOwnProperty.call(t,n)&&t[n]===e[n])})(ac(r),o||{})||s(oc(o))},[o]),t(he,{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:r,setValues:e=>{const t=e.map(e=>({oldKey:String(e.oldKey??""),newKey:String(e.newKey??"")}));s(t),n(de.Renames,ac(t))},errorMessage:i[de.Renames]})},[$e.PiiMasking]:({value:n,setValue:i,formErrors:o})=>(a(()=>{n[de.PiiCategories]?.length||i(de.PiiCategories,js.map(({id:e})=>e))},[]),e(ae,{$gap:12,children:[t(pe,{label:"Attributes to mask"}),t(ae,{$gap:6,children:js.map(({id:e,label:o})=>t(Q,{label:o,value:n[de.PiiCategories]?.includes(e)||!1,onChange:t=>{const o=n[de.PiiCategories]||[],a=t?[...o,e]:o.filter(t=>t!==e);i(de.PiiCategories,a)}},e))}),t(ue,{errorMessage:o[de.PiiCategories]})]})),[$e.URLTemplatization]:({value:i,setValue:o,formErrors:a})=>{const l=v(),s=i[lc]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>o(lc,e),d=(e,t)=>c(s.map((n,i)=>i===e?{...n,...t}:n));return e(n,{children:[s.map((n,i)=>e(r,{children:[t(Ee,{}),e(ae,{$gap:12,children:[e(ie,{$justifyContent:"space-between",$alignItems:"center",children:[t(pe,{label:`Rule Group ${i+1}`}),t(Te,{leftIcon:()=>t(ml,{fill:l.v2.colors.red[500]}),variant:Ie.Secondary,size:ke.S,onClick:()=>{return e=i,c(s.filter((t,n)=>n!==e));var e},disabled:1===s.length})]}),t(Ne,{name:`urlGroup-${i}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:n.filterK8sNamespace||"",onChange:e=>d(i,{filterK8sNamespace:e.target.value})}),t(he,{name:`urlGroup-${i}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:rc,values:n.workloadFilters||[],setValues:e=>d(i,{workloadFilters:e})}),t(be,{name:`urlGroup-${i}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:n.templatizationRules.map(e=>e.template),setValues:e=>d(i,{templatizationRules:e.map(e=>({template:e}))})})]}),t(ue,{errorMessage:a[lc]})]},`url-templatization-group-${i}`)),t(Te,{variant:Ie.Secondary,label:"Add rule group",leftIcon:gl,onClick:()=>c([...s,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(Ee,{})]})},[$e.ExtractAttribute]:({value:n,setValue:i,formErrors:o})=>{const r=v(),s=o[Js],c=n[Js]?.extractions||[],[d,p]=l(()=>(e=>e.length&&e.some(ec)?qs.Regex:qs.Preset)(c)),[u,h]=l(null),m=e=>i(Js,{extractions:e});a(()=>{0===c.length&&m([d===qs.Preset?Qs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const g=(e,t)=>{m(c.map((n,i)=>i===e?{...n,...t}:n))},f=()=>{m([...c,d===qs.Preset?Qs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},b=d===qs.Preset,y=c.length?c:[b?Qs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=u&&y[u]?.regex||"";return e(ae,{$gap:16,$width:"100%",children:[t(ve,{options:[{value:qs.Preset,label:ye.SEGMENT_PRESET_LABEL,tooltip:ye.SEGMENT_PRESET_TOOLTIP,selectedBgColor:r.v2.colors.purple[500]},{value:qs.Regex,label:ye.SEGMENT_REGEX_LABEL,tooltip:ye.SEGMENT_REGEX_TOOLTIP,selectedBgColor:r.v2.colors.purple[500]}],selected:d,setSelected:e=>{p(e),m([e===qs.Preset?Qs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(ae,{$gap:8,$width:"100%",children:[y.map((n,i)=>{const o=i===y.length-1,a=n.dataFormat||Ce.JSON,l=xe[a];return e(tc,{"data-id":`extract-row-${i}`,children:[e(ie,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(ae,{$gap:10,children:[t(pe,{label:b?ye.PRESET_ROW_TITLE(i):ye.REGEX_ROW_TITLE(i)}),b&&t(ie,{$gap:24,children:Zs.map(e=>t(Se,{"data-id":`extract-row-${i}-fmt-${e}`,size:we.L,label:xe[e].label,value:a===e,onChange:t=>t&&g(i,{dataFormat:e})},`extract-row-${i}-fmt-${e}`))})]}),e(ie,{$gap:4,$alignItems:"center",children:[!b&&t(Te,{"data-id":`extract-row-${i}-test-regex`,label:ye.TEST_REGEX_LABEL,variant:Ie.Secondary,size:ke.S,onClick:()=>h(i),disabled:!n.regex?.trim()}),t(Te,{"data-id":`extract-row-${i}-delete`,leftIcon:()=>t(ml,{fill:r.v2.colors.red[500]}),variant:Ie.Secondary,size:ke.S,onClick:()=>(e=>{const t=c.filter((t,n)=>n!==e);m(t.length?t:[d===qs.Preset?Qs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(i)}),o&&t(Te,{"data-id":`extract-row-${i}-add`,leftIcon:gl,variant:Ie.Secondary,size:ke.S,onClick:f})]})]}),b?e(ie,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(nc,{children:t(Ne,{name:`extract-row-${i}-lookupKey`,label:l.keyLabel,placeholder:l.placeholder,helpMessage:l.helpMessage,width:"100%",value:n.lookupKey||"",onChange:e=>g(i,{lookupKey:e.target.value})})}),t(ic,{children:t(fl,{size:24,fill:r.v2.colors.silver[200]})}),t(nc,{children:t(Ne,{name:`extract-row-${i}-targetAttributeName`,label:ye.TARGET_LABEL,placeholder:ye.TARGET_PLACEHOLDER,helpMessage:ye.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(i,{targetAttributeName:e.target.value})})})]}):e(ae,{$gap:12,$width:"100%",children:[t(Ne,{name:`extract-row-${i}-regex`,label:ye.REGEX_LABEL,placeholder:ye.REGEX_PLACEHOLDER,helpMessage:ye.REGEX_HELP,width:"100%",value:n.regex||"",onChange:e=>g(i,{regex:e.target.value})}),t(Ne,{name:`extract-row-${i}-targetAttributeName`,label:ye.TARGET_LABEL,placeholder:ye.TARGET_PLACEHOLDER,helpMessage:ye.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(i,{targetAttributeName:e.target.value})})]})]},`extract-row-${i}`)}),t(ue,{errorMessage:s})]}),t(kr,{isOpen:null!=u,regex:C,onClose:()=>h(null)})]})},[$e.DbQueryTemplatization]:null,[$e.InferDbAttributes]:null},cc=({actionType:e,value:n,setValue:i,formErrors:o,dynamicFields:a,signals:l,sourceOptions:r,namespaceOptions:s})=>{if(!e)return null;if(a?.length)return t(Ir,{fields:a,value:n||{},setValue:i,formErrors:o||{},signals:l||[],seedInitialValues:!0,keyValuePersistAs:"map",sourceOptions:r,namespaceOptions:s},e);const c=sc[e];return c?t(c,{value:n,setValue:i,formErrors:o}):null},dc=()=>{const{selectedOption:n,genericForm:i,sourceOptions:o,namespaceOptions:a}=Jr();if(!i||!n)return t(Oe,{title:"No active form"});const{formData:l,handleFormChange:r,formErrors:s}=i;return e(ae,{$gap:24,children:[e(ie,{$gap:12,$justifyContent:"space-between",children:[t(Ae,{size:te.XXXS,maxLines:2,children:n.description}),e(ie,{$gap:12,children:[t(Nr,{isEnabled:!l.disabled,setIsEnabled:e=>r("disabled",!e)}),t(Te,{leftIcon:bl,variant:Ie.Secondary,size:ke.S,onClick:()=>n.docsUrl&&window.open(n.docsUrl,"_blank","noopener noreferrer")})]})]}),t(Er,{title:"Signals for processing",allowedSignals:n.allowedSignals,selectedSignals:l.signals||[],setSelectedSignals:e=>r("signals",e),errorMessage:s.signals}),t(Ne,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:l.name||"",onChange:({target:{value:e}})=>r("name",e),errorMessage:s.name}),t(cc,{actionType:n.type,dynamicFields:n.fields,signals:l.signals||[],value:l.fields,setValue:(e,t)=>r(`fields.${e}`,t),formErrors:s,sourceOptions:o,namespaceOptions:a}),t(Re,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:l.notes||"",onChange:({target:{value:e}})=>r("notes",e),errorMessage:s.notes})]})},pc=b(ie)`
46
46
  position: sticky;
47
47
  bottom: 4px;
48
48
  align-self: center;
@@ -53,30 +53,30 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
53
53
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
54
54
  box-shadow: 0 4px 16.7px 0 rgba(0, 0, 0, 0.83);
55
55
  z-index: 1;
56
- `,Ls=s(({isEdit:n},i)=>{const o=v(),{isK8s:r}=S(),{destinationsApi:s}=Sr(),{activeForm:d,genericForm:p,validateFormData:u,thisUnsavedDestination:h,addUnsavedDestination:m,updateUnsavedDestination:g,deleteUnsavedDestination:f}=xr(),[b,y]=l(h?.testResult),[C,x]=l(!!h);a(()=>{h?(y(h.testResult),x(!0)):(y(void 0),x(!1))},[h]);const w=async()=>{if(!d?.option.testConnectionSupported||!p||!r)return;const e=await s.testConnection(ze(p.formData));return y(e),e};return c(i,()=>({testConnection:w,testConnectionSupported:!!d?.option.testConnectionSupported}),[d?.option.testConnectionSupported,p,s]),p&&d?e(ae,{$gap:24,style:{minHeight:"100%"},children:[e(ie,{$gap:12,$justifyContent:"space-between",children:[b?b.succeeded?t(De,{status:Pe.Success,message:b.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(De,{status:Pe.Error,message:b.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(ie,{$gap:12,children:[r&&t(Zl,{isEnabled:!p.formData.disabled,setIsEnabled:e=>p.handleFormChange("disabled",!e),fieldDisabled:C}),t(Te,{"data-id":"dest-form-docs",leftIcon:Ga,variant:Ie.Secondary,size:ke.S,onClick:()=>window.open(`${_e}/backends/${d.option.type}`,"_blank","noopener noreferrer")})]})]}),t(Ql,{title:"This connection will monitor:",allowedSignals:Me(d.option.supportedSignals),selectedSignals:Fe(p.formData.exportedSignals),setSelectedSignals:e=>p.handleFormChange("exportedSignals",{logs:e.includes(Le.Logs),metrics:e.includes(Le.Metrics),traces:e.includes(Le.Traces),profiles:e.includes(Le.Profiles)}),disabled:C,errorMessage:p.formErrors.exportedSignals}),t(Ne,{name:"destinationName",label:"Destination name",placeholder:"Use a name that describes the destination...",value:p.formData.name,onChange:({target:{value:e}})=>p.handleFormChange("name",e),disabled:C,errorMessage:p.formErrors.name}),t(ql,{signals:Fe(p.formData.exportedSignals),fields:d.option.fields,disabled:C,value:Object.fromEntries(p.formData.fields.map(e=>[e.key,e.value])),setValue:(e,t)=>{const n=p.formData.fields.some(t=>t.key===e);p.handleFormChange("fields",n?p.formData.fields.map(n=>n.key===e?{...n,value:t}:n):[...p.formData.fields,{key:e,value:t}]),e&&p.formErrors[e]&&p.handleErrorChange(e,void 0)},formErrors:p.formErrors,keyValuePersistAs:"array"}),!n&&e(_s,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:Wa,variant:Ie.Secondary,textColor:o.v2.colors.red[500],onClick:()=>f(d.unsavedIdx)})}),r&&(!h||h.option.testConnectionSupported&&!C)&&t("div",{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:Ie.Secondary,onClick:w})}),h&&t("div",C?{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:Ka,variant:Ie.Secondary,onClick:()=>x(!1)})}:{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:Ie.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=u();if(!e){const e=await w(),n=!!e&&!e.succeeded;g(d.unsavedIdx,{formData:t,testResult:e},n)}}})}),!h&&t("div",{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:Ie.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=u();if(!e){const e=await w(),n=!!e&&!e.succeeded;m({formData:t,testResult:e},n)}}})})]})]}):t($e,{title:"No active form"})});Ls.displayName="AddDestinationForm";const Fs=[{id:Xe.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Xe.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Xe.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Ms=[{id:Xe.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Xe.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Xe.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],zs=["*"],Xs=[{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:""}],Bs={[We.Java]:[new je("","")],[We.Golang]:[new He("")],[We.Php]:[new Ge("","")]},Us={[Ye.CodeAttributes]:({value:i,setValue:l,formErrors:r,disabled:s})=>{const c=r.codeAttributes,d=o(()=>Object.entries(i.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]);a(()=>{if(!d.length&&!c){const e={[Xe.FilePath]:!0,[Xe.Function]:!0,[Xe.LineNumber]:!0,[Xe.Column]:null,[Xe.Namespace]:null,[Xe.StackTrace]:null};l("codeAttributes",e)}},[]);const p=(e,t)=>{const n=t?[...d,e]:d.filter(t=>t!==e),i=Object.values(Xe).reduce((e,t)=>(e[t]=!!n.includes(t)||null,e),{});l("codeAttributes",i)};return e(n,{children:[e(ae,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(ae,{$gap:6,children:Fs.map(({id:e,label:n,tooltip:i})=>t(Be,{text:i,withIcon:!0,children:t(Q,{label:n,value:d.includes(e),onChange:t=>p(e,t),disabled:s})},e))}),t(ue,{errorMessage:c})]}),e(ae,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(ae,{$gap:6,children:Ms.map(({id:e,label:n,tooltip:i})=>t(Be,{text:i,withIcon:!0,children:t(Q,{label:n,value:d.includes(e),onChange:t=>p(e,t),disabled:s})},e))}),t(ue,{errorMessage:c})]})]})},[Ye.CustomInstrumentation]:({value:i,setValue:l,formErrors:r,disabled:s})=>{const c=r.customInstrumentations,d=o(()=>(i?.customInstrumentations?.[We.Golang]||[]).map(e=>new He(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[i]),p=o(()=>(i?.customInstrumentations?.[We.Java]||[]).map(e=>new je(e.className,e.methodName)),[i]),u=o(()=>(i?.customInstrumentations?.[We.Php]||[]).map(e=>new Ge(e.className,e.functionName)),[i]);return a(()=>{i?.customInstrumentations||c||l("customInstrumentations",{[We.Golang]:Bs[We.Golang],[We.Java]:Bs[We.Java],[We.Php]:Bs[We.Php]})},[]),e(n,{children:[e(ae,{children:[e(ie,{$gap:8,children:[t(Ya,{}),t(pe,{label:"Golang custom probes"})]}),t(he,{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:d,setValues:e=>{const t={};t[We.Golang]=e.map(e=>new He(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[We.Java]=p,t[We.Php]=u,l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2,disabled:s})]}),e(ae,{children:[e(ie,{$gap:8,children:[t(Ja,{}),t(pe,{label:"Java custom probes"})]}),t(he,{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:p,setValues:e=>{const t={};t[We.Golang]=d,t[We.Java]=e.map(e=>new je(e.className,e.methodName)),t[We.Php]=u,l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2,disabled:s})]}),e(ae,{children:[e(ie,{$gap:8,children:[t(qa,{}),t(pe,{label:"PHP custom probes"})]}),t(De,{status:Pe.Warning,message:Ke.PHP_CUSTOM_INSTRUMENTATION_RESTART,fullWidth:!0}),t(he,{name:"phpProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. App\\Service\\OrderService",tooltip:"The fully qualified class name to instrument. Leave empty for a global function."},{keyName:"functionName",label:"Function name",placeholder:"e.g. processOrder",tooltip:"The name of the function or method to instrument."}],values:u,setValues:e=>{const t={};t[We.Golang]=d,t[We.Java]=p,t[We.Php]=e.map(e=>new Ge(e.className,e.functionName)),l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2})]})]})},[Ye.HeadersCollection]:({value:e,setValue:n,formErrors:i,disabled:l})=>{const r=i.headersCollection,s=o(()=>e?.headersCollection?.[Ue.HeaderKeys]||[],[e]),c=e=>{const t={[Ue.HeaderKeys]:e};n("headersCollection",t)};return a(()=>{s.length||r||c(zs)},[]),t(be,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:s,setValues:c,errorMessage:r,disabled:l})},[Ye.PayloadCollection]:({value:n,setValue:i,formErrors:l,disabled:r})=>{const s=l.payloadCollection,c=o(()=>Object.entries(n.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[n]);return a(()=>{if(!c.length&&!s){const e={[Ve.HttpRequest]:{},[Ve.HttpResponse]:{},[Ve.DbQuery]:{},[Ve.Messaging]:{}};i("payloadCollection",e)}},[]),e(ae,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Type of data to collect"}),t(ae,{$gap:6,children:Xs.map(({id:e,label:n,tooltip:o})=>t(Be,{text:o,withIcon:!0,children:t(Q,{label:n,value:c.includes(e),onChange:t=>((e,t)=>{const n=t?[...c,e]:c.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),disabled:r})},e))}),t(ue,{errorMessage:s})]})},[Ye.UnknownType]:null},Vs=({ruleType:e,value:n,setValue:i,formErrors:o,dynamicFields:a,disabled:l})=>{if(!e)return null;if(a?.length)return t(ql,{fields:a,value:n||{},setValue:i,formErrors:o||{},signals:[],seedInitialValues:!0,keyValuePersistAs:"map",disabled:l},e);const r=Us[e];return r?t(r,{value:n,setValue:i,formErrors:o,disabled:l}):null},Hs=()=>{const n=v(),{isEnterprise:i,platformType:a,version:l}=S(),r=Je(a,l),{selectedOption:s,genericForm:c,sourceOptions:d,namespaceOptions:p}=wr(),u=o(()=>qe(s?.supportedLanguages),[s?.supportedLanguages]),h=o(()=>{if(s)return s.type===Ye.CustomInstrumentation?[]:Ze(s.supportedLanguages)},[s]);if(!c||!s)return t($e,{title:"No active form"});const{formData:m,handleFormChange:g,formErrors:f}=c;return e(ae,{$gap:24,children:[e(ie,{$gap:12,$justifyContent:"space-between",children:[t(Ae,{size:te.XXXS,maxLines:2,children:s.description}),e(ie,{$gap:12,children:[t(Zl,{isEnabled:!m.disabled,setIsEnabled:e=>g("disabled",!e),fieldDisabled:!i}),t(Te,{leftIcon:Ga,variant:Ie.Secondary,size:ke.S,onClick:()=>s.docsUrl&&window.open(s.docsUrl,"_blank","noopener noreferrer")})]})]}),t(er,{option:s,formState:m}),!!u.length&&e(ie,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Supported Languages:"}),u.map(e=>t(ce,{label:et(e),leftIcon:Qe(e),backgroundColor:n.v2.colors.purple[900]},e))]}),r&&t(tr,{scopes:m.sourceScopes,onChange:e=>g("sourceScopes",e),sourceOptions:d,namespaceOptions:p,supportedLanguages:h,dataIdPrefix:"instrumentation-rule",slim:!0,disabled:!i}),t(Ne,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:m.ruleName,onChange:({target:{value:e}})=>g("ruleName",e),errorMessage:f.ruleName,disabled:!i}),t(Vs,{ruleType:s.type,dynamicFields:s.fields,value:m,setValue:(e,t)=>g(e,t),formErrors:f,disabled:!i}),t(Re,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:m.notes,onChange:({target:{value:e}})=>g("notes",e),errorMessage:f.notes,disabled:!i})]})},js=()=>{const{pendingMerge:e,confirmMerge:n,cancelMerge:i}=Tr();if(!e)return null;const{existingName:o,editingName:a}=e;return t(tt,{isOpen:!0,onClose:i,title:"Merge with existing Data Stream?",description:nt.DATA_STREAM_MERGE_WARNING(a,o),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:Ie.Primary,onClick:n},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:Ie.Secondary,onClick:i}})},Gs=({autoFocus:n})=>{const{dataStreams:i}=it(),{genericForm:a,excludeName:l,editingName:r}=Tr(),{formData:s,formErrors:c,handleFormChange:d}=a,p=s.name,u=o(()=>i.find(e=>e.name===p&&e.name!==l),[i,p,l]);return e(ae,{$width:"100%",$gap:12,children:[t(Ne,{name:"data-stream-name",label:nt.STREAM_NAME,placeholder:nt.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:nt.STREAM_DESCRIPTION,required:!0,autoFocus:n,value:p,onChange:e=>d("name",e.target.value),errorMessage:c.name}),u&&t(De,{status:Pe.Warning,message:nt.DATA_STREAM_MERGE_WARNING(r,u.name),fullWidth:!0})]})},Ws=()=>{const{selectedStreamName:e}=it(),{genericForm:n}=kr();if(!n)return t($e,{title:"No active form"});const{formData:i,handleFormChange:o,formErrors:a}=n;return t(Ne,{name:"sourceName",label:nt.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:i.otelServiceName,onChange:({target:{value:t}})=>{o("otelServiceName",t),o("currentStreamName",e)},errorMessage:a.otelServiceName})},Ks=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Ys=b.div`
56
+ `,uc=s(({isEdit:n},i)=>{const o=v(),{isK8s:r}=S(),{destinationsApi:s}=qr(),{activeForm:d,genericForm:p,validateFormData:u,thisUnsavedDestination:h,addUnsavedDestination:m,updateUnsavedDestination:g,deleteUnsavedDestination:f}=Zr(),[b,y]=l(h?.testResult),[C,x]=l(!!h);a(()=>{h?(y(h.testResult),x(!0)):(y(void 0),x(!1))},[h]);const w=async()=>{if(!d?.option.testConnectionSupported||!p||!r)return;const e=await s.testConnection(Me(p.formData));return y(e),e};return c(i,()=>({testConnection:w,testConnectionSupported:!!d?.option.testConnectionSupported}),[d?.option.testConnectionSupported,p,s]),p&&d?e(ae,{$gap:24,style:{minHeight:"100%"},children:[e(ie,{$gap:12,$justifyContent:"space-between",children:[b?b.succeeded?t(De,{status:Pe.Success,message:b.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(De,{status:Pe.Error,message:b.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(ie,{$gap:12,children:[r&&t(Nr,{isEnabled:!p.formData.disabled,setIsEnabled:e=>p.handleFormChange("disabled",!e),fieldDisabled:C}),t(Te,{"data-id":"dest-form-docs",leftIcon:bl,variant:Ie.Secondary,size:ke.S,onClick:()=>window.open(`${_e}/backends/${d.option.type}`,"_blank","noopener noreferrer")})]})]}),t(Er,{title:"This connection will monitor:",allowedSignals:ze(d.option.supportedSignals),selectedSignals:Fe(p.formData.exportedSignals),setSelectedSignals:e=>p.handleFormChange("exportedSignals",{logs:e.includes(Le.Logs),metrics:e.includes(Le.Metrics),traces:e.includes(Le.Traces),profiles:e.includes(Le.Profiles)}),disabled:C,errorMessage:p.formErrors.exportedSignals}),t(Ne,{name:"destinationName",label:"Destination name",placeholder:"Use a name that describes the destination...",value:p.formData.name,onChange:({target:{value:e}})=>p.handleFormChange("name",e),disabled:C,errorMessage:p.formErrors.name}),t(Ir,{signals:Fe(p.formData.exportedSignals),fields:d.option.fields,disabled:C,value:Object.fromEntries(p.formData.fields.map(e=>[e.key,e.value])),setValue:(e,t)=>{const n=p.formData.fields.some(t=>t.key===e);p.handleFormChange("fields",n?p.formData.fields.map(n=>n.key===e?{...n,value:t}:n):[...p.formData.fields,{key:e,value:t}]),e&&p.formErrors[e]&&p.handleErrorChange(e,void 0)},formErrors:p.formErrors,keyValuePersistAs:"array"}),!n&&e(pc,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:vl,variant:Ie.Secondary,textColor:o.v2.colors.red[500],onClick:()=>f(d.unsavedIdx)})}),r&&(!h||h.option.testConnectionSupported&&!C)&&t("div",{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:Ie.Secondary,onClick:w})}),h&&t("div",C?{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:yl,variant:Ie.Secondary,onClick:()=>x(!1)})}:{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:Ie.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=u();if(!e){const e=await w(),n=!!e&&!e.succeeded;g(d.unsavedIdx,{formData:t,testResult:e},n)}}})}),!h&&t("div",{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:Ie.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=u();if(!e){const e=await w(),n=!!e&&!e.succeeded;m({formData:t,testResult:e},n)}}})})]})]}):t(Oe,{title:"No active form"})});uc.displayName="AddDestinationForm";const hc=[{id:Xe.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Xe.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Xe.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],mc=[{id:Xe.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Xe.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Xe.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],gc=["*"],fc=[{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:""}],bc={[We.Java]:[new je("","")],[We.Golang]:[new He("")],[We.Php]:[new Ge("","")]},vc={[Ye.CodeAttributes]:({value:i,setValue:l,formErrors:r,disabled:s})=>{const c=r.codeAttributes,d=o(()=>Object.entries(i.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]);a(()=>{if(!d.length&&!c){const e={[Xe.FilePath]:!0,[Xe.Function]:!0,[Xe.LineNumber]:!0,[Xe.Column]:null,[Xe.Namespace]:null,[Xe.StackTrace]:null};l("codeAttributes",e)}},[]);const p=(e,t)=>{const n=t?[...d,e]:d.filter(t=>t!==e),i=Object.values(Xe).reduce((e,t)=>(e[t]=!!n.includes(t)||null,e),{});l("codeAttributes",i)};return e(n,{children:[e(ae,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(ae,{$gap:6,children:hc.map(({id:e,label:n,tooltip:i})=>t(Be,{text:i,withIcon:!0,children:t(Q,{label:n,value:d.includes(e),onChange:t=>p(e,t),disabled:s})},e))}),t(ue,{errorMessage:c})]}),e(ae,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(ae,{$gap:6,children:mc.map(({id:e,label:n,tooltip:i})=>t(Be,{text:i,withIcon:!0,children:t(Q,{label:n,value:d.includes(e),onChange:t=>p(e,t),disabled:s})},e))}),t(ue,{errorMessage:c})]})]})},[Ye.CustomInstrumentation]:({value:i,setValue:l,formErrors:r,disabled:s})=>{const c=r.customInstrumentations,d=o(()=>(i?.customInstrumentations?.[We.Golang]||[]).map(e=>new He(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[i]),p=o(()=>(i?.customInstrumentations?.[We.Java]||[]).map(e=>new je(e.className,e.methodName)),[i]),u=o(()=>(i?.customInstrumentations?.[We.Php]||[]).map(e=>new Ge(e.className,e.functionName)),[i]);return a(()=>{i?.customInstrumentations||c||l("customInstrumentations",{[We.Golang]:bc[We.Golang],[We.Java]:bc[We.Java],[We.Php]:bc[We.Php]})},[]),e(n,{children:[e(ae,{children:[e(ie,{$gap:8,children:[t(Cl,{}),t(pe,{label:"Golang custom probes"})]}),t(he,{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:d,setValues:e=>{const t={};t[We.Golang]=e.map(e=>new He(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[We.Java]=p,t[We.Php]=u,l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2,disabled:s})]}),e(ae,{children:[e(ie,{$gap:8,children:[t(Sl,{}),t(pe,{label:"Java custom probes"})]}),t(he,{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:p,setValues:e=>{const t={};t[We.Golang]=d,t[We.Java]=e.map(e=>new je(e.className,e.methodName)),t[We.Php]=u,l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2,disabled:s})]}),e(ae,{children:[e(ie,{$gap:8,children:[t(xl,{}),t(pe,{label:"PHP custom probes"})]}),t(De,{status:Pe.Warning,message:Ke.PHP_CUSTOM_INSTRUMENTATION_RESTART,fullWidth:!0}),t(he,{name:"phpProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. App\\Service\\OrderService",tooltip:"The fully qualified class name to instrument. Leave empty for a global function."},{keyName:"functionName",label:"Function name",placeholder:"e.g. processOrder",tooltip:"The name of the function or method to instrument."}],values:u,setValues:e=>{const t={};t[We.Golang]=d,t[We.Java]=p,t[We.Php]=e.map(e=>new Ge(e.className,e.functionName)),l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2})]})]})},[Ye.HeadersCollection]:({value:e,setValue:n,formErrors:i,disabled:l})=>{const r=i.headersCollection,s=o(()=>e?.headersCollection?.[Ue.HeaderKeys]||[],[e]),c=e=>{const t={[Ue.HeaderKeys]:e};n("headersCollection",t)};return a(()=>{s.length||r||c(gc)},[]),t(be,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:s,setValues:c,errorMessage:r,disabled:l})},[Ye.PayloadCollection]:({value:n,setValue:i,formErrors:l,disabled:r})=>{const s=l.payloadCollection,c=o(()=>Object.entries(n.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[n]);return a(()=>{if(!c.length&&!s){const e={[Ve.HttpRequest]:{},[Ve.HttpResponse]:{},[Ve.DbQuery]:{},[Ve.Messaging]:{}};i("payloadCollection",e)}},[]),e(ae,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Type of data to collect"}),t(ae,{$gap:6,children:fc.map(({id:e,label:n,tooltip:o})=>t(Be,{text:o,withIcon:!0,children:t(Q,{label:n,value:c.includes(e),onChange:t=>((e,t)=>{const n=t?[...c,e]:c.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),disabled:r})},e))}),t(ue,{errorMessage:s})]})},[Ye.UnknownType]:null},yc=({ruleType:e,value:n,setValue:i,formErrors:o,dynamicFields:a,disabled:l})=>{if(!e)return null;if(a?.length)return t(Ir,{fields:a,value:n||{},setValue:i,formErrors:o||{},signals:[],seedInitialValues:!0,keyValuePersistAs:"map",disabled:l},e);const r=vc[e];return r?t(r,{value:n,setValue:i,formErrors:o,disabled:l}):null},Cc=()=>{const n=v(),{isEnterprise:i,platformType:a,version:l}=S(),r=Je(a,l),{selectedOption:s,genericForm:c,sourceOptions:d,namespaceOptions:p}=Qr(),u=o(()=>qe(s?.supportedLanguages),[s?.supportedLanguages]),h=o(()=>{if(s)return s.type===Ye.CustomInstrumentation?[]:Ze(s.supportedLanguages)},[s]);if(!c||!s)return t(Oe,{title:"No active form"});const{formData:m,handleFormChange:g,formErrors:f}=c;return e(ae,{$gap:24,children:[e(ie,{$gap:12,$justifyContent:"space-between",children:[t(Ae,{size:te.XXXS,maxLines:2,children:s.description}),e(ie,{$gap:12,children:[t(Nr,{isEnabled:!m.disabled,setIsEnabled:e=>g("disabled",!e),fieldDisabled:!i}),t(Te,{leftIcon:bl,variant:Ie.Secondary,size:ke.S,onClick:()=>s.docsUrl&&window.open(s.docsUrl,"_blank","noopener noreferrer")})]})]}),t($r,{option:s,formState:m}),!!u.length&&e(ie,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Supported Languages:"}),u.map(e=>t(ce,{label:et(e),leftIcon:Qe(e),backgroundColor:n.v2.colors.purple[900]},e))]}),r&&t(Or,{scopes:m.sourceScopes,onChange:e=>g("sourceScopes",e),sourceOptions:d,namespaceOptions:p,supportedLanguages:h,dataIdPrefix:"instrumentation-rule",slim:!0,disabled:!i}),t(Ne,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:m.ruleName,onChange:({target:{value:e}})=>g("ruleName",e),errorMessage:f.ruleName,disabled:!i}),t(yc,{ruleType:s.type,dynamicFields:s.fields,value:m,setValue:(e,t)=>g(e,t),formErrors:f,disabled:!i}),t(Re,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:m.notes,onChange:({target:{value:e}})=>g("notes",e),errorMessage:f.notes,disabled:!i})]})},Sc=()=>{const{pendingMerge:e,confirmMerge:n,cancelMerge:i}=es();if(!e)return null;const{existingName:o,editingName:a}=e;return t(tt,{isOpen:!0,onClose:i,title:"Merge with existing Data Stream?",description:nt.DATA_STREAM_MERGE_WARNING(a,o),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:Ie.Primary,onClick:n},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:Ie.Secondary,onClick:i}})},xc=({autoFocus:n})=>{const{dataStreams:i}=it(),{genericForm:a,excludeName:l,editingName:r}=es(),{formData:s,formErrors:c,handleFormChange:d}=a,p=s.name,u=o(()=>i.find(e=>e.name===p&&e.name!==l),[i,p,l]);return e(ae,{$width:"100%",$gap:12,children:[t(Ne,{name:"data-stream-name",label:nt.STREAM_NAME,placeholder:nt.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:nt.STREAM_DESCRIPTION,required:!0,autoFocus:n,value:p,onChange:e=>d("name",e.target.value),errorMessage:c.name}),u&&t(De,{status:Pe.Warning,message:nt.DATA_STREAM_MERGE_WARNING(r,u.name),fullWidth:!0})]})},wc=()=>{const{selectedStreamName:e}=it(),{genericForm:n}=ts();if(!n)return t(Oe,{title:"No active form"});const{formData:i,handleFormChange:o,formErrors:a}=n;return t(Ne,{name:"sourceName",label:nt.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:i.otelServiceName,onChange:({target:{value:t}})=>{o("otelServiceName",t),o("currentStreamName",e)},errorMessage:a.otelServiceName})},Tc=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],kc=b.div`
57
57
  display: flex;
58
58
  flex-direction: column;
59
59
  gap: 24px;
60
- `,Js=b.div`
60
+ `,Ic=b.div`
61
61
  display: contents;
62
62
  & > * {
63
63
  opacity: ${({$faded:e})=>e?.4:1};
64
64
  transition: opacity 0.2s ease;
65
65
  }
66
- `,qs=({value:e})=>{const n=v();return t(ce,e?{status:Pe.Success,label:dt,leftIcon:Za}:{label:pt,leftIcon:Qa,backgroundColor:n.v2.colors.silver[500],textColor:n.v2.colors.white[500]})},Zs=({value:e,onChange:n})=>{const i=v(),a=o(()=>[{icon:Za,label:dt,value:!0,selectedBgColor:i.v2.colors.green[800]},{icon:Qa,label:pt,value:!1,selectedBgColor:i.v2.colors.silver[500]}],[i]);return t(ve,{options:a,selected:e,setSelected:n??(()=>{}),disabled:!n})},Qs=()=>{const e=Ir();switch(e.formType){case Nr.Create:return t(ec,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Zs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case Nr.View:return e.data?e.isEditing?t(ec,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Zs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(tc,{data:e.data,renderAction:()=>t(qs,{value:!e.data?.rule.disabled})}):null;case Nr.EditAutoNoisy:return t(nc,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:ct,sectionTitle:lt,sectionSubTitle:st,presetLabel:at,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(Zs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Nr.EditAutoCostReduction:return t(nc,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:rt,sectionTitle:lt,presetLabel:at,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(Zs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Nr.EditAutoHighlyRelevant:return t(Ys,{children:t(nr,{title:e.localEnabled?void 0:ot,summary:e.summary,renderAction:()=>t(Zs,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},ec=({category:n,formData:i,onChange:o,sourceOptions:a,namespaceOptions:l,renderAction:r})=>e(Ys,{children:[t(ar,{category:n,formState:i,renderAction:r}),e(Js,{$faded:!!i.disabled,children:[t(lr,{category:n,formState:i,onChange:o}),t(tr,{scopes:i.sourceScopes,onChange:e=>o({sourceScopes:e}),sourceOptions:a,namespaceOptions:l,titleNumber:1,dataIdPrefix:"sampling"}),t(rr,{category:n,formState:i,onChange:o}),"highlyRelevant"===n&&t(sr,{formState:i,onChange:o}),"highlyRelevant"===n&&t(cr,{ruleType:i.ruleType,formState:i,onChange:o}),t(dr,{category:n,formState:i,onChange:o})]})]}),tc=({data:n,renderAction:i})=>e(Ys,{children:[t(ar,{readOnly:!0,summary:n.summary,renderAction:i}),t(lr,{readOnly:!0,data:n}),t(tr,{readOnly:!0,scopes:x(n.rule.sourceScopes)}),t(rr,{readOnly:!0,data:n}),t(dr,{readOnly:!0,data:n}),"highlyRelevant"===n.category&&t(cr,{readOnly:!0,rule:n.rule})]}),nc=({enabled:n,summary:i,inactiveTitle:o,sectionTitle:a,sectionSubTitle:l,presetLabel:r,customInputName:s,showModeToggle:c=!0,percentageMode:p,setPercentageMode:u,percentagePreset:h,setPercentagePreset:m,customPercentage:g,setCustomPercentage:f,renderAction:b})=>{const v=d(e=>u(e),[u]),y=d(e=>m(e),[m]),C=d(e=>f(e.target.value),[f]),S=!c||"sample"===p;return e(Ys,{children:[t(nr,{title:n?void 0:o,summary:i,renderAction:b}),t(Js,{$faded:!n,children:e(ut,{richTitle:{title:a,subTitle:l},children:[c&&t(ae,{$alignItems:"flex-start",children:t(ve,{options:Ks,selected:p,setSelected:v})}),S&&t(ir,{description:r,options:or,selected:h,onSelect:y,customName:s,customLabel:ht,customPlaceholder:"5%",customValue:g,onCustomChange:C})]})})]})},ic=({onClose:n,selectedConnectionIds:i,setSelectedConnectionIds:a,withOverlay:r})=>{const{actionsApi:s}=Sr(),{platformType:c,version:u}=S(),[h,m]=l(""),[g,f]=l(null),b=p(null),{selectedOption:v,onSelectOption:y,genericForm:C,validateFormData:x}=Cr(),{options:w,loading:T}=s.useActionTypes(),k=o(()=>w.length?w:mt(c,u),[w,c,u]),I=o(()=>(h?k.filter(e=>e?.label?.toLowerCase().includes(h.toLowerCase())):k).filter(e=>!!e),[k,h]),N=d(e=>{b.current?.clearErrors(),y(e)},[y]),E=(({isLoading:e,options:n,selectedCategory:i,selectedType:a,onSelectOption:l})=>({width:"40%",list:o(()=>{if(e)return[t(le,{$padding:"8px 12px",children:t(re,{size:6})},"loading")];const o=n.reduce((e,t)=>{const n=t.category&&t.category in us?t.category:ps;return(e[n]||=[]).push(t),e},{});return Object.keys(us).filter(e=>o[e]?.length&&(!i||i===e)).map(e=>t(ms,{bucket:e,options:o[e],selectedType:a,onSelectOption:l},e))},[e,n,i,a,l])}))({isLoading:T,options:I,selectedCategory:g,selectedType:v?.type,onSelectOption:N}),O=o(()=>{const e=new Set(k.map(e=>e.category));return[{value:null,label:"All Actions"},...Object.values(gt).filter(t=>e.has(t)).map(e=>({value:e,label:se[e].TITLE}))]},[k]),$=o(()=>T?[t(le,{$padding:"8px 12px",children:t(re,{size:4})},"loading")]:v?[t(Ps,{},v.type)]:[t(ft,{$height:"100%",children:t($e,{icon:Ua,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[T,v]);return t(pr,{ref:b,isOpen:!0,withOverlay:r,onClose:n,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=x();if(e)return!1;await s.create(t)},disableSave:!v||!C?.isFormDirty,isFormDirty:C?.isFormDirty,hideDirtyNote:!0,progress:{title:nt.CREATING_ACTION,subTitle:nt.CREATING_ACTION_SUBTITLE},header:{icon:Ua,title:nt.ADD_ACTION,subTitle:nt.ADD_ACTION_DESCRIPTION},connectionIds:i&&a?{value:i,setValue:a}:void 0,search:{value:h,onChange:m,placeholder:"Search by action name",width:"370px"},filters:e(ie,{$gap:8,children:[t(ee,{size:te.XXS,color:ne.Secondary,nowrap:!0,children:"Show"}),t(ve,{options:O,selected:g,setSelected:f})]}),leftColumn:E,rightColumn:{width:"60%",list:$}})},oc=({destinationsByCategory:i,filters:a,setFilters:l})=>{const r=o(()=>Object.values(bt).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})).filter(e=>i[e.id]?.length),[i]),s=o(()=>{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(vt,{placeholder:"Select category",options:r,values:a.categoryType?[a.categoryType]:[],setValues:e=>l({...a,categoryType:a.categoryType===e[0]?null:e[0]})}),t(ve,{options:s,selected:a.signalType,setSelected:e=>l({...a,signalType:e})})]})},ac=b.div`
66
+ `,Nc=({value:e})=>{const n=v();return t(ce,e?{status:Pe.Success,label:dt,leftIcon:wl}:{label:pt,leftIcon:Tl,backgroundColor:n.v2.colors.silver[500],textColor:n.v2.colors.white[500]})},Ec=({value:e,onChange:n})=>{const i=v(),a=o(()=>[{icon:wl,label:dt,value:!0,selectedBgColor:i.v2.colors.green[800]},{icon:Tl,label:pt,value:!1,selectedBgColor:i.v2.colors.silver[500]}],[i]);return t(ve,{options:a,selected:e,setSelected:n??(()=>{}),disabled:!n})},$c=()=>{const e=ns();switch(e.formType){case is.Create:return t(Oc,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Ec,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case is.View:return e.data?e.isEditing?t(Oc,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Ec,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(Ac,{data:e.data,renderAction:()=>t(Nc,{value:!e.data?.rule.disabled})}):null;case is.EditAutoNoisy:return t(Rc,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:ct,sectionTitle:lt,sectionSubTitle:st,presetLabel:at,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(Ec,{value:e.localEnabled,onChange:e.setLocalEnabled})});case is.EditAutoCostReduction:return t(Rc,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:rt,sectionTitle:lt,presetLabel:at,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(Ec,{value:e.localEnabled,onChange:e.setLocalEnabled})});case is.EditAutoHighlyRelevant:return t(kc,{children:t(Ar,{title:e.localEnabled?void 0:ot,summary:e.summary,renderAction:()=>t(Ec,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},Oc=({category:n,formData:i,onChange:o,sourceOptions:a,namespaceOptions:l,renderAction:r})=>e(kc,{children:[t(Pr,{category:n,formState:i,renderAction:r}),e(Ic,{$faded:!!i.disabled,children:[t(_r,{category:n,formState:i,onChange:o}),t(Or,{scopes:i.sourceScopes,onChange:e=>o({sourceScopes:e}),sourceOptions:a,namespaceOptions:l,titleNumber:1,dataIdPrefix:"sampling"}),t(Lr,{category:n,formState:i,onChange:o}),"highlyRelevant"===n&&t(Fr,{formState:i,onChange:o}),"highlyRelevant"===n&&t(zr,{ruleType:i.ruleType,formState:i,onChange:o}),t(Mr,{category:n,formState:i,onChange:o})]})]}),Ac=({data:n,renderAction:i})=>e(kc,{children:[t(Pr,{readOnly:!0,summary:n.summary,renderAction:i}),t(_r,{readOnly:!0,data:n}),t(Or,{readOnly:!0,scopes:x(n.rule.sourceScopes)}),t(Lr,{readOnly:!0,data:n}),t(Mr,{readOnly:!0,data:n}),"highlyRelevant"===n.category&&t(zr,{readOnly:!0,rule:n.rule})]}),Rc=({enabled:n,summary:i,inactiveTitle:o,sectionTitle:a,sectionSubTitle:l,presetLabel:r,customInputName:s,showModeToggle:c=!0,percentageMode:p,setPercentageMode:u,percentagePreset:h,setPercentagePreset:m,customPercentage:g,setCustomPercentage:f,renderAction:b})=>{const v=d(e=>u(e),[u]),y=d(e=>m(e),[m]),C=d(e=>f(e.target.value),[f]),S=!c||"sample"===p;return e(kc,{children:[t(Ar,{title:n?void 0:o,summary:i,renderAction:b}),t(Ic,{$faded:!n,children:e(ut,{richTitle:{title:a,subTitle:l},children:[c&&t(ae,{$alignItems:"flex-start",children:t(ve,{options:Tc,selected:p,setSelected:v})}),S&&t(Rr,{description:r,options:Dr,selected:h,onSelect:y,customName:s,customLabel:ht,customPlaceholder:"5%",customValue:g,onCustomChange:C})]})})]})},Dc=({onClose:n,selectedConnectionIds:i,setSelectedConnectionIds:a,withOverlay:r})=>{const{actionsApi:s}=qr(),{platformType:c,version:u}=S(),[h,m]=l(""),[g,f]=l(null),b=p(null),{selectedOption:v,onSelectOption:y,genericForm:C,validateFormData:x}=Jr(),{options:w,loading:T}=s.useActionTypes(),k=o(()=>w.length?w:mt(c,u),[w,c,u]),I=o(()=>(h?k.filter(e=>e?.label?.toLowerCase().includes(h.toLowerCase())):k).filter(e=>!!e),[k,h]),N=d(e=>{b.current?.clearErrors(),y(e)},[y]),E=(({isLoading:e,options:n,selectedCategory:i,selectedType:a,onSelectOption:l})=>({width:"40%",list:o(()=>{if(e)return[t(le,{$padding:"8px 12px",children:t(re,{size:6})},"loading")];const o=n.reduce((e,t)=>{const n=t.category&&t.category in Us?t.category:Bs;return(e[n]||=[]).push(t),e},{});return Object.keys(Us).filter(e=>o[e]?.length&&(!i||i===e)).map(e=>t(Hs,{bucket:e,options:o[e],selectedType:a,onSelectOption:l},e))},[e,n,i,a,l])}))({isLoading:T,options:I,selectedCategory:g,selectedType:v?.type,onSelectOption:N}),$=o(()=>{const e=new Set(k.map(e=>e.category));return[{value:null,label:"All Actions"},...Object.values(gt).filter(t=>e.has(t)).map(e=>({value:e,label:se[e].TITLE}))]},[k]),O=o(()=>T?[t(le,{$padding:"8px 12px",children:t(re,{size:4})},"loading")]:v?[t(dc,{},v.type)]:[t(ft,{$height:"100%",children:t(Oe,{icon:hl,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[T,v]);return t(Xr,{ref:b,isOpen:!0,withOverlay:r,onClose:n,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=x();if(e)return!1;await s.create(t)},disableSave:!v||!C?.isFormDirty,isFormDirty:C?.isFormDirty,hideDirtyNote:!0,progress:{title:nt.CREATING_ACTION,subTitle:nt.CREATING_ACTION_SUBTITLE},header:{icon:hl,title:nt.ADD_ACTION,subTitle:nt.ADD_ACTION_DESCRIPTION},connectionIds:i&&a?{value:i,setValue:a}:void 0,search:{value:h,onChange:m,placeholder:"Search by action name",width:"370px"},filters:e(ie,{$gap:8,children:[t(ee,{size:te.XXS,color:ne.Secondary,nowrap:!0,children:"Show"}),t(ve,{options:$,selected:g,setSelected:f})]}),leftColumn:E,rightColumn:{width:"60%",list:O}})},Pc=({destinationsByCategory:i,filters:a,setFilters:l})=>{const r=o(()=>Object.values(bt).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})).filter(e=>i[e.id]?.length),[i]),s=o(()=>{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(vt,{placeholder:"Select category",options:r,values:a.categoryType?[a.categoryType]:[],setValues:e=>l({...a,categoryType:a.categoryType===e[0]?null:e[0]})}),t(ve,{options:s,selected:a.signalType,setSelected:e=>l({...a,signalType:e})})]})},_c=b.div`
67
67
  display: flex;
68
68
  flex-direction: column;
69
69
  padding: 8px;
70
70
  border-radius: 16px;
71
71
  border: ${({$purpleColors:e,theme:t})=>e?`1px solid ${t.v2.colors.purple[500]}`:"1px solid transparent"};
72
72
  background-color: ${({$noBgColor:e,$purpleColors:t,theme:n})=>e?"transparent":t?n.v2.colors.purple[900]:n.v2.colors.silver[800]};
73
- `,lc=b.div`
73
+ `,Lc=b.div`
74
74
  display: flex;
75
75
  align-items: center;
76
76
  justify-content: space-between;
77
77
  gap: 12px;
78
78
  padding: ${({$isOpen:e})=>e?"2px 12px 8px 12px":"2px 12px"};
79
- `,rc=({title:n,tooltip:i,list:o,noBgColor:a,purpleColors:r})=>{const[s,c]=l(!0);return e(ac,{"data-id":`collapse-${n}`,$noBgColor:a,$purpleColors:r,children:[e(lc,{$isOpen:s,children:[e(ie,{$gap:10,children:[t(ee,{size:te.XS,children:n}),i&&t(Be,{text:i,withIcon:!0}),t(ce,{label:o.length,status:r?Pe.Default:void 0})]}),t(yt,{icon:s?tl:nl,size:Ct.M,onClick:()=>c(e=>!e)})]}),s?t(ae,{children:o.length?u.toArray(o):t(ft,{$padding:"12px 0",children:t($e,{})})}):null]})},sc=(e,t,n)=>t||n.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!n.signalType||Me(e.supportedSignals).includes(n.signalType))):e,cc=({option:e,formData:n,testResult:i,isSelected:o,onSelect:a})=>t(ds,{icon:wt(e.type).icon,title:n?.name||e.displayName,withCarret:!0,purpleColors:!!n,isSelected:o,onClick:()=>a(),children:i&&t(ce,{status:i.succeeded?Pe.Success:Pe.Error,leftIcon:i.succeeded?il:ol})}),dc=({listType:e,destinationOptions:n,unsavedDestinations:i})=>{const{activeForm:o,onChangeActiveForm:a}=xr();return n?.length?t(rc,{title:xt[e].TITLE,tooltip:xt[e].DESCRIPTION,list:n.map((n,i)=>t(cc,{option:n,isSelected:o?.listType===e&&"number"!=typeof o?.unsavedIdx&&(null!=n.id&&""!==n.id?o?.option.id===n.id:o?.option.type===n.type),onSelect:()=>a({listType:e,option:n})},`${e}-${n.id??n.type}-${i}`))}):i?.length?t(rc,{purpleColors:!0,title:xt[e].TITLE,tooltip:xt[e].DESCRIPTION,list:i.map(({option:n,formData:i,testResult:l},r)=>t(cc,{option:n,formData:i,testResult:l,isSelected:o?.unsavedIdx===r&&o?.listType===e,onSelect:()=>a({listType:e,option:n,unsavedIdx:r})},`${e}-${r}`))},e):void 0};var pc;(e=>{e.SELF_HOSTED="self hosted",e.MANAGED="managed"})(pc||(pc={}));const uc=(e,t)=>{const n=[],i=[],o=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===pc.SELF_HOSTED?i.push(...e.items):e.name===pc.MANAGED&&o.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const i of e?.destinationCategories?.categories||[]){const e=Tt(i),o=e.items.findIndex(e=>e.type===t.type);if(-1!==o){const i=kt(t.fields,{});Object.keys(i).length&&(e.items[o].fields=e.items[o].fields.map(e=>({...e,initialValue:i[e.name]})),n.push(e.items[o]))}}}),{[bt.DETECTED]:n,[bt.SELF_HOSTED]:i,[bt.MANAGED]:o}},hc=({onClose:e,onBack:n,onNext:i,selectedConnectionIds:r,setSelectedConnectionIds:s,initialInputs:c,withOverlay:p,disableAnimation:u})=>{const{destinationsApi:h}=Sr(),[m,g]=l(""),[f,b]=l({categoryType:null,signalType:null}),{items:v}=h.useDestinations(),{data:y,loading:C}=h.useDestinationCategories(),{data:S,loading:x}=h.usePotentialDestinations(),{activeForm:w,genericForm:T,unsavedDestinations:k,setUnsavedDestinations:I}=xr();a(()=>{c&&I(c)},[c]);const N=C||x,E=o(()=>y?.destinationCategories?.categories??[],[y]),[O,$]=l({[bt.ALL]:[],[bt.UNSAVED]:[],[bt.EXISTS]:[],[bt.DETECTED]:[],[bt.SELF_HOSTED]:[],[bt.MANAGED]:[]});a(()=>{const e=v.map(e=>{let t;for(const n of E){const i=n.items.find(t=>t.type===e.destinationType.type);if(i){t=i;break}}const n=kt(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})):[]}});$(t=>({...t,[bt.EXISTS]:e}))},[v,E]),a(()=>{(y||S)&&$(e=>({...e,...uc(y,S)}))},[y,S]);const A=d(async()=>{for(const{option:e,formData:t}of k){const n=ze(t);if(e.id){const t=Object.fromEntries(e.fields.map(e=>[e.name,e.initialValue??""])),i=Object.fromEntries(n.fields.map(e=>[e.key,e.value??""]));if(!Object.keys(t).some(e=>t[e]!==i[e])){await h.update(e.id,n);continue}}await h.create(n)}},[k,h]),R=(({isFetching:e,destinationsByCategory:n,searchText:i,filters:a})=>{const{unsavedDestinations:l}=xr();return{width:"40%",list:o(()=>{const o=[];l.length&&o.push(t(dc,{listType:bt.UNSAVED,unsavedDestinations:l},"unsaved"));for(const e of Object.values(bt)){if(a.categoryType&&a.categoryType!==e)continue;const l=sc(n[e],i,a);l.length&&o.push(t(dc,{listType:e,destinationOptions:l},e))}return e&&o.push(t(ft,{$height:"100%",children:t(St,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),o},[l,n,i,a,e])}})({isFetching:N,destinationsByCategory:O,searchText:m,filters:f}),D=(()=>{const{activeForm:e}=xr();return{width:"60%",list:e?[t(Ls,{},e.option.type)]:[t(ft,{$height:"100%",children:t($e,{icon:el,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})();return t(pr,{isOpen:!0,withOverlay:p,disableAnimation:u,onClose:e,onBack:n?()=>n(k):void 0,onNext:i?()=>i(k):void 0,nextIsSkip:!k.length,onSave:A,disableSave:!w&&!k.length,isFetching:N,isFormDirty:k.length>0||T?.isFormDirty,hideDirtyNote:!0,progress:{title:nt.CREATING_DESTINATION,subTitle:nt.CREATING_DESTINATION_SUBTITLE},header:{icon:el,title:nt.ADD_DESTINATIONS,subTitle:nt.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:r&&s?{value:r,setValue:s}:void 0,search:{value:m,onChange:g},filters:t(oc,{destinationsByCategory:O,filters:f,setFilters:b}),leftColumn:R,rightColumn:D})},mc=({onClose:e,selectedConnectionIds:n,setSelectedConnectionIds:i,withOverlay:a})=>{const{isEnterprise:r}=S(),{instrumentationRulesApi:s}=Sr(),[c,d]=l(""),u=p(null),{selectedOption:h,onSelectOption:m,genericForm:g,validateFormData:f}=wr(),{options:b,loading:v}=s.useRuleTypes(),y=o(()=>b.length?b:It,[b]),C=o(()=>c?y.filter(e=>e.label.toLowerCase().includes(c.toLowerCase())):y,[y,c]),x=o(()=>v?[t(le,{$padding:"8px 12px",children:t(re,{size:4})},"loading")]:C.map(e=>{const n=h?.type===e.type;return t(ds,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:n,onClick:()=>{u.current?.clearErrors(),m(e)}},e.type)}),[v,h?.type,C,m]),w=o(()=>v?[t(le,{$padding:"8px 12px",children:t(re,{size:4})},"loading")]:h?[t(Hs,{},h.type)]:[t(ft,{$height:"100%",children:t($e,{icon:al,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[v,h]);return t(pr,{ref:u,isOpen:!0,withOverlay:a,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=f();if(e)return!1;await s.create(t,h?.type)},disableSave:!h||!g?.isFormDirty||!r,isFormDirty:g?.isFormDirty,hideDirtyNote:!0,forcedNote:r?void 0:{fullWidth:!0,status:Pe.Warning,message:"This feature is only supported for OnPrem (Enterprise) installations"},progress:{title:nt.CREATING_INSTRUMENTATION_RULE,subTitle:nt.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:al,title:nt.ADD_INSTRUMENTATION_RULE,subTitle:nt.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:n&&i?{value:n,setValue:i}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:x},rightColumn:{width:"60%",list:w}})},gc={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:nt.FETCHING_NAMESPACES,subTitle:nt.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:nt.SELECT_NAMESPACE,subTitle:nt.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},fc={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===Nt.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"},bc=e=>e?fc:gc,vc="No matches",yc=e=>(e?"Unselect":"Select")+" all",Cc="Selected",Sc=b.div``,xc=b.div`
79
+ `,Fc=({title:n,tooltip:i,list:o,noBgColor:a,purpleColors:r})=>{const[s,c]=l(!0);return e(_c,{"data-id":`collapse-${n}`,$noBgColor:a,$purpleColors:r,children:[e(Lc,{$isOpen:s,children:[e(ie,{$gap:10,children:[t(ee,{size:te.XS,children:n}),i&&t(Be,{text:i,withIcon:!0}),t(ce,{label:o.length,status:r?Pe.Default:void 0})]}),t(yt,{icon:s?Il:Nl,size:Ct.M,onClick:()=>c(e=>!e)})]}),s?t(ae,{children:o.length?u.toArray(o):t(ft,{$padding:"12px 0",children:t(Oe,{})})}):null]})},zc=(e,t,n)=>t||n.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!n.signalType||ze(e.supportedSignals).includes(n.signalType))):e,Mc=({option:e,formData:n,testResult:i,isSelected:o,onSelect:a})=>t(Xs,{icon:wt(e.type).icon,title:n?.name||e.displayName,withCarret:!0,purpleColors:!!n,isSelected:o,onClick:()=>a(),children:i&&t(ce,{status:i.succeeded?Pe.Success:Pe.Error,leftIcon:i.succeeded?El:$l})}),Xc=({listType:e,destinationOptions:n,unsavedDestinations:i})=>{const{activeForm:o,onChangeActiveForm:a}=Zr();return n?.length?t(Fc,{title:xt[e].TITLE,tooltip:xt[e].DESCRIPTION,list:n.map((n,i)=>t(Mc,{option:n,isSelected:o?.listType===e&&"number"!=typeof o?.unsavedIdx&&(null!=n.id&&""!==n.id?o?.option.id===n.id:o?.option.type===n.type),onSelect:()=>a({listType:e,option:n})},`${e}-${n.id??n.type}-${i}`))}):i?.length?t(Fc,{purpleColors:!0,title:xt[e].TITLE,tooltip:xt[e].DESCRIPTION,list:i.map(({option:n,formData:i,testResult:l},r)=>t(Mc,{option:n,formData:i,testResult:l,isSelected:o?.unsavedIdx===r&&o?.listType===e,onSelect:()=>a({listType:e,option:n,unsavedIdx:r})},`${e}-${r}`))},e):void 0};var Bc;(e=>{e.SELF_HOSTED="self hosted",e.MANAGED="managed"})(Bc||(Bc={}));const Uc=(e,t)=>{const n=[],i=[],o=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===Bc.SELF_HOSTED?i.push(...e.items):e.name===Bc.MANAGED&&o.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const i of e?.destinationCategories?.categories||[]){const e=Tt(i),o=e.items.findIndex(e=>e.type===t.type);if(-1!==o){const i=kt(t.fields,{});Object.keys(i).length&&(e.items[o].fields=e.items[o].fields.map(e=>({...e,initialValue:i[e.name]})),n.push(e.items[o]))}}}),{[bt.DETECTED]:n,[bt.SELF_HOSTED]:i,[bt.MANAGED]:o}},Vc=({onClose:e,onBack:n,onNext:i,selectedConnectionIds:r,setSelectedConnectionIds:s,initialInputs:c,withOverlay:p,disableAnimation:u})=>{const{destinationsApi:h}=qr(),[m,g]=l(""),[f,b]=l({categoryType:null,signalType:null}),{items:v}=h.useDestinations(),{data:y,loading:C}=h.useDestinationCategories(),{data:S,loading:x}=h.usePotentialDestinations(),{activeForm:w,genericForm:T,unsavedDestinations:k,setUnsavedDestinations:I}=Zr();a(()=>{c&&I(c)},[c]);const N=C||x,E=o(()=>y?.destinationCategories?.categories??[],[y]),[$,O]=l({[bt.ALL]:[],[bt.UNSAVED]:[],[bt.EXISTS]:[],[bt.DETECTED]:[],[bt.SELF_HOSTED]:[],[bt.MANAGED]:[]});a(()=>{const e=v.map(e=>{let t;for(const n of E){const i=n.items.find(t=>t.type===e.destinationType.type);if(i){t=i;break}}const n=kt(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})):[]}});O(t=>({...t,[bt.EXISTS]:e}))},[v,E]),a(()=>{(y||S)&&O(e=>({...e,...Uc(y,S)}))},[y,S]);const A=d(async()=>{for(const{option:e,formData:t}of k){const n=Me(t);if(e.id){const t=Object.fromEntries(e.fields.map(e=>[e.name,e.initialValue??""])),i=Object.fromEntries(n.fields.map(e=>[e.key,e.value??""]));if(!Object.keys(t).some(e=>t[e]!==i[e])){await h.update(e.id,n);continue}}await h.create(n)}},[k,h]),R=(({isFetching:e,destinationsByCategory:n,searchText:i,filters:a})=>{const{unsavedDestinations:l}=Zr();return{width:"40%",list:o(()=>{const o=[];l.length&&o.push(t(Xc,{listType:bt.UNSAVED,unsavedDestinations:l},"unsaved"));for(const e of Object.values(bt)){if(a.categoryType&&a.categoryType!==e)continue;const l=zc(n[e],i,a);l.length&&o.push(t(Xc,{listType:e,destinationOptions:l},e))}return e&&o.push(t(ft,{$height:"100%",children:t(St,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),o},[l,n,i,a,e])}})({isFetching:N,destinationsByCategory:$,searchText:m,filters:f}),D=(()=>{const{activeForm:e}=Zr();return{width:"60%",list:e?[t(uc,{},e.option.type)]:[t(ft,{$height:"100%",children:t(Oe,{icon:kl,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})();return t(Xr,{isOpen:!0,withOverlay:p,disableAnimation:u,onClose:e,onBack:n?()=>n(k):void 0,onNext:i?()=>i(k):void 0,nextIsSkip:!k.length,onSave:A,disableSave:!w&&!k.length,isFetching:N,isFormDirty:k.length>0||T?.isFormDirty,hideDirtyNote:!0,progress:{title:nt.CREATING_DESTINATION,subTitle:nt.CREATING_DESTINATION_SUBTITLE},header:{icon:kl,title:nt.ADD_DESTINATIONS,subTitle:nt.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:r&&s?{value:r,setValue:s}:void 0,search:{value:m,onChange:g},filters:t(Pc,{destinationsByCategory:$,filters:f,setFilters:b}),leftColumn:R,rightColumn:D})},Hc=({onClose:e,selectedConnectionIds:n,setSelectedConnectionIds:i,withOverlay:a})=>{const{isEnterprise:r}=S(),{instrumentationRulesApi:s}=qr(),[c,d]=l(""),u=p(null),{selectedOption:h,onSelectOption:m,genericForm:g,validateFormData:f}=Qr(),{options:b,loading:v}=s.useRuleTypes(),y=o(()=>b.length?b:It,[b]),C=o(()=>c?y.filter(e=>e.label.toLowerCase().includes(c.toLowerCase())):y,[y,c]),x=o(()=>v?[t(le,{$padding:"8px 12px",children:t(re,{size:4})},"loading")]:C.map(e=>{const n=h?.type===e.type;return t(Xs,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:n,onClick:()=>{u.current?.clearErrors(),m(e)}},e.type)}),[v,h?.type,C,m]),w=o(()=>v?[t(le,{$padding:"8px 12px",children:t(re,{size:4})},"loading")]:h?[t(Cc,{},h.type)]:[t(ft,{$height:"100%",children:t(Oe,{icon:Ol,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[v,h]);return t(Xr,{ref:u,isOpen:!0,withOverlay:a,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=f();if(e)return!1;await s.create(t,h?.type)},disableSave:!h||!g?.isFormDirty||!r,isFormDirty:g?.isFormDirty,hideDirtyNote:!0,forcedNote:r?void 0:{fullWidth:!0,status:Pe.Warning,message:"This feature is only supported for OnPrem (Enterprise) installations"},progress:{title:nt.CREATING_INSTRUMENTATION_RULE,subTitle:nt.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:Ol,title:nt.ADD_INSTRUMENTATION_RULE,subTitle:nt.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:n&&i?{value:n,setValue:i}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:x},rightColumn:{width:"60%",list:w}})},jc={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:nt.FETCHING_NAMESPACES,subTitle:nt.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:nt.SELECT_NAMESPACE,subTitle:nt.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},Gc={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===Nt.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"},Wc=e=>e?Gc:jc,Kc="No matches",Yc=e=>(e?"Unselect":"Select")+" all",Jc="Selected",qc=b.div``,Zc=b.div`
80
80
  visibility: hidden;
81
81
 
82
82
  transition: visibility 0s;
@@ -84,17 +84,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
84
84
  transition-duration: 0s;
85
85
  }
86
86
 
87
- ${Sc}:hover & {
87
+ ${qc}:hover & {
88
88
  visibility: visible;
89
89
  }
90
- `,wc=({workloadName:e,workloadKind:n,isChecked:i,onToggle:o,disabled:a})=>{const l=v(),r=()=>{};return t(Sc,{children:t(ds,{dataId:`source-${e}`,title:e,disabled:a,onClick:a?r:o,isChecked:i,onCheckboxChange:a?r:o,children:a?t(Be,{text:"Static pods can only be instrumented with Odigos Enterprise.",children:t(ce,{label:"Enterprise only",status:Pe.Default,textSize:te.XXXS})}):t(xc,{children:t(ce,{label:n,status:Pe.Info,textSize:te.XXXS,backgroundColor:l.v2.colors.blue[900]})})})})},Tc=b.div``,kc=b.div`
90
+ `,Qc=({workloadName:e,workloadKind:n,isChecked:i,onToggle:o,disabled:a})=>{const l=v(),r=()=>{};return t(qc,{children:t(Xs,{dataId:`source-${e}`,title:e,disabled:a,onClick:a?r:o,isChecked:i,onCheckboxChange:a?r:o,children:a?t(Be,{text:"Static pods can only be instrumented with Odigos Enterprise.",children:t(ce,{label:"Enterprise only",status:Pe.Default,textSize:te.XXXS})}):t(Zc,{children:t(ce,{label:n,status:Pe.Info,textSize:te.XXXS,backgroundColor:l.v2.colors.blue[900]})})})})},ed=b.div``,td=b.div`
91
91
  display: grid;
92
92
  /* Auto: "Auto" label + S toggle ≈ 72px. Selected: label + count badge ≈ 110px. */
93
93
  grid-template-columns: ${({$withAuto:e})=>e?"72px 110px":"110px"};
94
94
  align-items: center;
95
95
  column-gap: 12px;
96
96
  flex-shrink: 0;
97
- `,Ic=b.div`
97
+ `,nd=b.div`
98
98
  display: flex;
99
99
  justify-content: flex-end;
100
100
  align-items: center;
@@ -109,17 +109,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
109
109
  transition: visibility 0s;
110
110
  ${({$visible:e})=>!e&&"& * {\n transition-duration: 0s !important;\n }"}
111
111
 
112
- ${Tc}:hover & {
112
+ ${ed}:hover & {
113
113
  visibility: visible;
114
114
  pointer-events: auto;
115
115
  }
116
- `,Nc=b(ie)`
116
+ `,id=b(ie)`
117
117
  width: 100%;
118
118
  gap: 8px;
119
119
  justify-content: flex-end;
120
120
  align-items: center;
121
121
  min-width: 0;
122
- `,Ec=({clusterId:n,namespaceName:i,checkbox:o,isFutureApps:a,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{capabilities:d}=Sr(),p=d.canInstrumentNamespaces,u=e=>{s(),c({clusterId:n,workloadId:{namespace:i},auto:e.auto,selected:e.all})};return t(Tc,{children:t(ds,{dataId:`namespace-${i}`,withCarret:!0,title:i,isSelected:r,onClick:s,isPartiallyChecked:o.partial,isChecked:o.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(kc,{$withAuto:p,children:[p&&t(Ic,{$visible:r||a,children:t(Be,{text:"Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",children:t(ge,{label:"Auto",labelAlign:fe.Left,size:Et.S,value:a,onChange:e=>u({auto:e,all:e||void 0})})})}),e(Nc,{children:[t(ee,{variant:Ot.Span,size:te.XXXS,color:ne.Secondary,align:"right",nowrap:!0,children:Cc}),t(ce,{label:`${l.sourced}/${l.total}`,status:r?Pe.Default:Pe.Unknown,minWidth:"42px"})]})]})})})},Oc=({withCollapse:e,clusterId:n,clusterName:i,namespaces:a,selectedArea:l,setSelectedArea:r,handleSourceChange:s})=>{const c=o(()=>a.map(({name:e,totalWorkloads:o,selectedCount:a,isAllSourced:c,isSomeSourced:d,isFutureApps:p})=>t(Ec,{clusterId:n,namespaceName:e,isFutureApps:p,checkbox:{all:c||p,partial:d},selectedCounts:{sourced:a,total:o},isActive:l.clusterId===n&&l.namespaceName===e,onActive:()=>r({clusterId:n,clusterName:i,namespaceName:e}),handleSourceChange:s},`${n}#${e}`)),[n,i,a,l]);return e?t(rc,{title:i,list:c,noBgColor:!0}):c},$c=({onClose:n,onBack:i,onNext:r,selectedConnectionIds:s,setSelectedConnectionIds:c,withOverlay:d,disableAnimation:p})=>{const{isK8s:u}=S(),{sourcesApi:h,snapshotsApi:m,namespacesApi:g}=Sr(),{data:f,loading:b,pending:v,refetch:y}=m.useSnapshots(),{items:C,loading:x}=g.useNamespaces({skip:v||!!f}),w=bc(!u),{selectedStreamName:T}=it(),{progress:k,resetProgress:I}=$t(),{isFetching:N,setIsFetching:E,setSnapshots:O,formData:$,handleSourceChange:A,handleSelectAll:R,formDiff:D,isFormDirty:P}=Rr();a(()=>{y()},[]);const _=o(()=>{if(f)return f;const e=C;return e.length?{clusters:[{clusterId:Rt,clusterName:At,namespaces:e.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(T),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,region:e.id.region,selected:(e.markedForInstrumentation?.markedForInstrumentation??!1)&&(e.dataStreamNames?.includes(T)??!1)}))||[]}))}]}:null},[f,C,T]);a(()=>{E(b||x),_&&O(_)},[_,b,x,E,O]);const[L,F]=l(""),[M,z]=l(Nt.Namespace),[X,B]=l({showOnlySelected:!1}),[U,V]=l({clusterId:"",clusterName:"",namespaceName:""}),H=(({isFetching:n,formData:i,handleSourceChange:a,handleSelectAll:l,selectedArea:r,setSelectedArea:s,searchText:c,searchBy:d,filters:p})=>{const{isK8s:u}=S(),h=bc(!u),m=o(()=>i.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>$r(e,c,p)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...Ar(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[i,c,p]),g=o(()=>{let e=!1;for(const{visibleNamespaces:t}of m)for(const{totalWorkloads:n,selectedCount:i}of t)if(e=!0,i!==n)return!1;return e},[m]),{list:f,withFilterCount:b,filteredCount:v,totalCount:y}=o(()=>{const e=m.map(({clusterId:e,clusterName:n,visibleNamespaces:i})=>i.length?t(Oc,{withCollapse:m.length>1,clusterId:e,clusterName:n,namespaces:i,selectedArea:r,setSelectedArea:s,handleSourceChange:a},e):null).filter(e=>null!==e),n=m.reduce((e,{visibleNamespaces:t})=>e+t.length,0),o=i.reduce((e,{namespaces:t})=>e+t.length,0);return{list:e,withFilterCount:n!==o,filteredCount:n,totalCount:o}},[m,i,r]);return{width:"60%",header:e(ie,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ie,{$gap:8,children:[t(ee,{size:te.XS,nowrap:!0,children:h.groupColumnHeader}),t(Be,{text:b?nt.FILTERED_COUNT_TOOLTIP:void 0,children:t(ce,{label:`${b?`${v} / ${y}`:y}`,status:Pe.Unknown})})]}),t(ee,{"data-id":"namespaces-select-all",onClick:()=>l({boolean:!g,searchText:c,searchBy:d,filters:p}),disabled:!f.length,size:te.XS,children:yc(g)})]}),list:f.length?f:n?[t(ft,{$height:"100%",children:t(St,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(ft,{$height:"100%",children:t($e,c?{icon:rl,title:vc,subTitle:h.noGroupMatchedFilter(c)}:{icon:rl,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:N,formData:$,handleSourceChange:A,handleSelectAll:R,selectedArea:U,setSelectedArea:V,searchText:M===Nt.Namespace?L:"",searchBy:M,filters:X}),j=(({formData:n,handleSourceChange:i,handleSelectAll:a,selectedArea:l,searchText:r,searchBy:s,filters:c})=>{const{isK8s:d,isEnterprise:p}=S(),u=bc(!d),h=o(()=>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]),m=o(()=>h?[...h.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Er(e,r,c)):[],[h,r,c]),g=o(()=>!!m.length&&m.every(({selected:e})=>e),[m]),f=o(()=>{if(!h)return[];const{clusterId:e}=l.value,{name:n}=h;return m.map(({name:o,selected:a,kind:l,region:r})=>{const s=d&&!p&&Or.has(l);return t(wc,{workloadName:o,workloadKind:l,isChecked:!s&&(a||!1),onToggle:()=>i({clusterId:e,workloadId:{namespace:n,name:o,kind:l,region:r}}),disabled:s},`${e}#${n}#${o}#${l}#${r??""}`)})},[m,h,l.value.clusterId,i,d,p]),{withFilterCount:b,filteredCount:v,totalCount:y}=o(()=>{const e=h?.workloads.length??0;return{withFilterCount:m.length!==e,filteredCount:m.length,totalCount:e}},[m,h]);return{width:"40%",header:e(ie,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ie,{$gap:8,children:[t(ee,{size:te.XS,nowrap:!0,children:l.value.namespaceName?`${l.value.namespaceName} > ${u.itemColumnHeader}`:u.itemColumnHeader}),t(Be,{text:b?nt.FILTERED_COUNT_TOOLTIP:void 0,children:t(ce,{label:`${b?`${v} / ${y}`:y}`,status:Pe.Unknown})})]}),t(ee,{"data-id":"workloads-select-all",onClick:()=>a({clusterId:l.value.clusterId,namespaceName:l.value.namespaceName,boolean:!g,searchText:r,searchBy:s,filters:c}),disabled:!f.length,size:te.XS,children:yc(g)})]}),list:f.length?f:[t(ft,{$height:"100%",children:t($e,h?r?{icon:ll,title:vc,subTitle:(C=r,`No sources matched the filter '${C}'`)}:{icon:ll,title:"No sources",subTitle:u.noItemsInGroupSubTitle}:{icon:ll,title:u.selectGroupPrompt.title,subTitle:u.selectGroupPrompt.subTitle})},"no-data")]};var C})({formData:$,handleSourceChange:A,handleSelectAll:R,selectedArea:{value:U},searchText:M===Nt.Source?L:"",searchBy:M,filters:X});return t(pr,{isOpen:!0,withOverlay:d,disableAnimation:p,onClose:n?()=>{I(Dt.BulkInstrumenting),n()}:void 0,onBack:i?()=>i(D):void 0,onNext:r?()=>r(D):void 0,nextIsSkip:!P,onSave:()=>h.persistV2(D),header:{icon:ll,title:nt.ADD_SOURCE,subTitle:nt.ADD_SOURCES_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:L,onChange:e=>{F(e),M===Nt.Namespace&&V({clusterId:"",clusterName:"",namespaceName:""})},placeholder:w.searchPlaceholder(M),segment:{options:[{label:w.groupSegmentLabel,value:Nt.Namespace},{label:w.itemSegmentLabel,value:Nt.Source}],selected:M,setSelected:z}},filters:e(ie,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,nowrap:!0,children:"Show only:"}),t(ge,{name:"filter-selected",size:Et.S,label:Cc,value:X.showOnlySelected,onChange:e=>B(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:P,isFetching:N,progress:{title:nt.CREATING_SOURCES,subTitle:nt.CREATING_SOURCES_SUBTITLE,percentage:k[Dt.BulkInstrumenting]?.percentage||0},leftColumn:H,rightColumn:j})},Ac={aws:dl,gcp:cl,azure:sl},Rc={lambda:"Lambda","fargate-task":"ECS","fargate-cluster":"ECS","ecs-cluster":"ECS",eks:"EKS",ec2:"EC2"},Dc=e=>e.split(/[-_]/).map(e=>e?e[0].toUpperCase()+e.slice(1):e).join(" "),Pc=e=>e.provider.toUpperCase(),_c=b.div`
122
+ `,od=({clusterId:n,namespaceName:i,checkbox:o,isFutureApps:a,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{capabilities:d}=qr(),p=d.canInstrumentNamespaces,u=e=>{s(),c({clusterId:n,workloadId:{namespace:i},auto:e.auto,selected:e.all})};return t(ed,{children:t(Xs,{dataId:`namespace-${i}`,withCarret:!0,title:i,isSelected:r,onClick:s,isPartiallyChecked:o.partial,isChecked:o.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(td,{$withAuto:p,children:[p&&t(nd,{$visible:r||a,children:t(Be,{text:"Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",children:t(ge,{label:"Auto",labelAlign:fe.Left,size:Et.S,value:a,onChange:e=>u({auto:e,all:e||void 0})})})}),e(id,{children:[t(ee,{variant:$t.Span,size:te.XXXS,color:ne.Secondary,align:"right",nowrap:!0,children:Jc}),t(ce,{label:`${l.sourced}/${l.total}`,status:r?Pe.Default:Pe.Unknown,minWidth:"42px"})]})]})})})},ad=({withCollapse:e,clusterId:n,clusterName:i,namespaces:a,selectedArea:l,setSelectedArea:r,handleSourceChange:s})=>{const c=o(()=>a.map(({name:e,totalWorkloads:o,selectedCount:a,isAllSourced:c,isSomeSourced:d,isFutureApps:p})=>t(od,{clusterId:n,namespaceName:e,isFutureApps:p,checkbox:{all:c||p,partial:d},selectedCounts:{sourced:a,total:o},isActive:l.clusterId===n&&l.namespaceName===e,onActive:()=>r({clusterId:n,clusterName:i,namespaceName:e}),handleSourceChange:s},`${n}#${e}`)),[n,i,a,l]);return e?t(Fc,{title:i,list:c,noBgColor:!0}):c},ld=({onClose:n,onBack:i,onNext:r,selectedConnectionIds:s,setSelectedConnectionIds:c,withOverlay:d,disableAnimation:p})=>{const{isK8s:u}=S(),{sourcesApi:h,snapshotsApi:m,namespacesApi:g}=qr(),{data:f,loading:b,pending:v,refetch:y}=m.useSnapshots(),{items:C,loading:x}=g.useNamespaces({skip:v||!!f}),w=Wc(!u),{selectedStreamName:T}=it(),{progress:k,resetProgress:I}=Ot(),{isFetching:N,setIsFetching:E,setSnapshots:$,formData:O,handleSourceChange:A,handleSelectAll:R,formDiff:D,isFormDirty:P}=ss();a(()=>{y()},[]);const _=o(()=>{if(f)return f;const e=C;return e.length?{clusters:[{clusterId:Rt,clusterName:At,namespaces:e.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(T),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,region:e.id.region,selected:(e.markedForInstrumentation?.markedForInstrumentation??!1)&&(e.dataStreamNames?.includes(T)??!1)}))||[]}))}]}:null},[f,C,T]);a(()=>{E(b||x),_&&$(_)},[_,b,x,E,$]);const[L,F]=l(""),[z,M]=l(Nt.Namespace),[X,B]=l({showOnlySelected:!1}),[U,V]=l({clusterId:"",clusterName:"",namespaceName:""}),H=(({isFetching:n,formData:i,handleSourceChange:a,handleSelectAll:l,selectedArea:r,setSelectedArea:s,searchText:c,searchBy:d,filters:p})=>{const{isK8s:u}=S(),h=Wc(!u),m=o(()=>i.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>ls(e,c,p)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...rs(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[i,c,p]),g=o(()=>{let e=!1;for(const{visibleNamespaces:t}of m)for(const{totalWorkloads:n,selectedCount:i}of t)if(e=!0,i!==n)return!1;return e},[m]),{list:f,withFilterCount:b,filteredCount:v,totalCount:y}=o(()=>{const e=m.map(({clusterId:e,clusterName:n,visibleNamespaces:i})=>i.length?t(ad,{withCollapse:m.length>1,clusterId:e,clusterName:n,namespaces:i,selectedArea:r,setSelectedArea:s,handleSourceChange:a},e):null).filter(e=>null!==e),n=m.reduce((e,{visibleNamespaces:t})=>e+t.length,0),o=i.reduce((e,{namespaces:t})=>e+t.length,0);return{list:e,withFilterCount:n!==o,filteredCount:n,totalCount:o}},[m,i,r]);return{width:"60%",header:e(ie,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ie,{$gap:8,children:[t(ee,{size:te.XS,nowrap:!0,children:h.groupColumnHeader}),t(Be,{text:b?nt.FILTERED_COUNT_TOOLTIP:void 0,children:t(ce,{label:`${b?`${v} / ${y}`:y}`,status:Pe.Unknown})})]}),t(ee,{"data-id":"namespaces-select-all",onClick:()=>l({boolean:!g,searchText:c,searchBy:d,filters:p}),disabled:!f.length,size:te.XS,children:Yc(g)})]}),list:f.length?f:n?[t(ft,{$height:"100%",children:t(St,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(ft,{$height:"100%",children:t(Oe,c?{icon:Rl,title:Kc,subTitle:h.noGroupMatchedFilter(c)}:{icon:Rl,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:N,formData:O,handleSourceChange:A,handleSelectAll:R,selectedArea:U,setSelectedArea:V,searchText:z===Nt.Namespace?L:"",searchBy:z,filters:X}),j=(({formData:n,handleSourceChange:i,handleSelectAll:a,selectedArea:l,searchText:r,searchBy:s,filters:c})=>{const{isK8s:d,isEnterprise:p}=S(),u=Wc(!d),h=o(()=>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]),m=o(()=>h?[...h.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>os(e,r,c)):[],[h,r,c]),g=o(()=>!!m.length&&m.every(({selected:e})=>e),[m]),f=o(()=>{if(!h)return[];const{clusterId:e}=l.value,{name:n}=h;return m.map(({name:o,selected:a,kind:l,region:r})=>{const s=d&&!p&&as.has(l);return t(Qc,{workloadName:o,workloadKind:l,isChecked:!s&&(a||!1),onToggle:()=>i({clusterId:e,workloadId:{namespace:n,name:o,kind:l,region:r}}),disabled:s},`${e}#${n}#${o}#${l}#${r??""}`)})},[m,h,l.value.clusterId,i,d,p]),{withFilterCount:b,filteredCount:v,totalCount:y}=o(()=>{const e=h?.workloads.length??0;return{withFilterCount:m.length!==e,filteredCount:m.length,totalCount:e}},[m,h]);return{width:"40%",header:e(ie,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ie,{$gap:8,children:[t(ee,{size:te.XS,nowrap:!0,children:l.value.namespaceName?`${l.value.namespaceName} > ${u.itemColumnHeader}`:u.itemColumnHeader}),t(Be,{text:b?nt.FILTERED_COUNT_TOOLTIP:void 0,children:t(ce,{label:`${b?`${v} / ${y}`:y}`,status:Pe.Unknown})})]}),t(ee,{"data-id":"workloads-select-all",onClick:()=>a({clusterId:l.value.clusterId,namespaceName:l.value.namespaceName,boolean:!g,searchText:r,searchBy:s,filters:c}),disabled:!f.length,size:te.XS,children:Yc(g)})]}),list:f.length?f:[t(ft,{$height:"100%",children:t(Oe,h?r?{icon:Al,title:Kc,subTitle:(C=r,`No sources matched the filter '${C}'`)}:{icon:Al,title:"No sources",subTitle:u.noItemsInGroupSubTitle}:{icon:Al,title:u.selectGroupPrompt.title,subTitle:u.selectGroupPrompt.subTitle})},"no-data")]};var C})({formData:O,handleSourceChange:A,handleSelectAll:R,selectedArea:{value:U},searchText:z===Nt.Source?L:"",searchBy:z,filters:X});return t(Xr,{isOpen:!0,withOverlay:d,disableAnimation:p,onClose:n?()=>{I(Dt.BulkInstrumenting),n()}:void 0,onBack:i?()=>i(D):void 0,onNext:r?()=>r(D):void 0,nextIsSkip:!P,onSave:()=>h.persistV2(D),header:{icon:Al,title:nt.ADD_SOURCE,subTitle:nt.ADD_SOURCES_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:L,onChange:e=>{F(e),z===Nt.Namespace&&V({clusterId:"",clusterName:"",namespaceName:""})},placeholder:w.searchPlaceholder(z),segment:{options:[{label:w.groupSegmentLabel,value:Nt.Namespace},{label:w.itemSegmentLabel,value:Nt.Source}],selected:z,setSelected:M}},filters:e(ie,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,nowrap:!0,children:"Show only:"}),t(ge,{name:"filter-selected",size:Et.S,label:Jc,value:X.showOnlySelected,onChange:e=>B(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:P,isFetching:N,progress:{title:nt.CREATING_SOURCES,subTitle:nt.CREATING_SOURCES_SUBTITLE,percentage:k[Dt.BulkInstrumenting]?.percentage||0},leftColumn:H,rightColumn:j})},rd={aws:_l,gcp:Pl,azure:Dl},sd={lambda:"Lambda","fargate-task":"ECS","fargate-cluster":"ECS","ecs-cluster":"ECS",eks:"EKS",ec2:"EC2"},cd=e=>e.split(/[-_]/).map(e=>e?e[0].toUpperCase()+e.slice(1):e).join(" "),dd=e=>e.provider.toUpperCase(),pd=b.div`
123
123
  display: flex;
124
124
  flex-direction: column;
125
125
  gap: 8px;
@@ -127,7 +127,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
127
127
  padding: 8px 12px;
128
128
  border-radius: 16px 0 0 16px;
129
129
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
130
- `,Lc=b.button`
130
+ `,ud=b.button`
131
131
  display: flex;
132
132
  align-items: center;
133
133
  gap: 12px;
@@ -143,7 +143,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
143
143
  &:hover {
144
144
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
145
145
  }
146
- `,Fc=b.div`
146
+ `,hd=b.div`
147
147
  display: flex;
148
148
  align-items: center;
149
149
  justify-content: center;
@@ -152,13 +152,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
152
152
  border-radius: 8px;
153
153
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
154
154
  flex-shrink: 0;
155
- `,Mc=b.div`
155
+ `,md=b.div`
156
156
  display: flex;
157
157
  flex-direction: column;
158
158
  gap: 2px;
159
159
  flex: 1;
160
160
  min-width: 0;
161
- `,zc=({providers:n,selectedProvider:i,onSelect:o})=>{const a=v();return n.length?t(_c,{children:n.map(n=>{const l=(e=>Ac[e.provider]??pl)(n),r=n.provider===i,s=(e=>{const t=e.features.find(e=>e.key===Pt.Discovery);if(!t)return"";const n=[],i=new Set;for(const e of t.types){const t=e.name.includes(".")?e.name.slice(e.name.indexOf(".")+1):e.name,o=Rc[t]??Dc(t);i.has(o)||(i.add(o),n.push(o))}return n.join(", ")})(n);return e(Lc,{type:"button",$selected:r,onClick:()=>o(n.provider),"data-id":`cloud-connector-provider-${n.provider}`,children:[t(Fc,{children:t(l,{size:24})}),e(Mc,{children:[t(ee,{size:te.S,weight:400,lineHeight:"24px",color:ne.Primary,children:Pc(n)}),s&&t(ee,{size:te.XXXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:s})]}),t(Ba,{size:18,fill:a.v2.colors.silver[300]})]},n.provider)})}):t(ee,{size:te.XS,color:ne.Secondary,children:"No providers available."})},Xc=b.div`
161
+ `,gd=({providers:n,selectedProvider:i,onSelect:o})=>{const a=v();return n.length?t(pd,{children:n.map(n=>{const l=(e=>rd[e.provider]??Ll)(n),r=n.provider===i,s=(e=>{const t=e.features.find(e=>e.key===Pt.Discovery);if(!t)return"";const n=[],i=new Set;for(const e of t.types){const t=e.name.includes(".")?e.name.slice(e.name.indexOf(".")+1):e.name,o=sd[t]??cd(t);i.has(o)||(i.add(o),n.push(o))}return n.join(", ")})(n);return e(ud,{type:"button",$selected:r,onClick:()=>o(n.provider),"data-id":`cloud-connector-provider-${n.provider}`,children:[t(hd,{children:t(l,{size:24})}),e(md,{children:[t(ee,{size:te.S,weight:400,lineHeight:"24px",color:ne.Primary,children:dd(n)}),s&&t(ee,{size:te.XXXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:s})]}),t(ul,{size:18,fill:a.v2.colors.silver[300]})]},n.provider)})}):t(ee,{size:te.XS,color:ne.Secondary,children:"No providers available."})},fd=b.div`
162
162
  display: flex;
163
163
  flex-direction: column;
164
164
  gap: 8px;
@@ -168,15 +168,15 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
168
168
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
169
169
  border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
170
170
  cursor: default;
171
- `,Bc=b.div`
171
+ `,bd=b.div`
172
172
  display: flex;
173
173
  align-items: center;
174
174
  gap: 4px;
175
175
  width: 100%;
176
- `,Uc=b.div`
176
+ `,vd=b.div`
177
177
  flex: 1;
178
178
  min-width: 0;
179
- `,Vc=b.div`
179
+ `,yd=b.div`
180
180
  width: 100%;
181
181
  max-height: 145px;
182
182
  overflow: auto;
@@ -198,39 +198,43 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
198
198
  transition: background-color 0.2s ease;
199
199
  }
200
200
 
201
- ${Xc}:hover & {
201
+ ${fd}:hover & {
202
202
  scrollbar-color: ${({theme:e})=>e.v2.colors.silver[300]} transparent;
203
203
  }
204
204
 
205
- ${Xc}:hover &::-webkit-scrollbar-thumb {
205
+ ${fd}:hover &::-webkit-scrollbar-thumb {
206
206
  background-color: ${({theme:e})=>e.v2.colors.silver[300]};
207
207
  }
208
- `,Hc=b.pre`
208
+ `,Cd=b.pre`
209
209
  margin: 0;
210
210
  font-family: ${({theme:e})=>e.font_family.code};
211
211
  font-size: 12px;
212
212
  line-height: 20px;
213
213
  color: ${({theme:e})=>e.v2.colors.green[400]};
214
214
  white-space: pre;
215
- `,jc=({policy:n})=>{const i=v(),{CopyButton:o}=_t();return e(Xc,{children:[e(Bc,{children:[t(ul,{size:16,fill:i.v2.colors.silver[200]}),t(Uc,{children:t(ee,{size:te.XXS,color:ne.Primary,children:nt.CLOUD_CONNECTOR_POLICY_PREVIEW})}),t(o,{value:n,size:Ct.XS})]}),t(Vc,{children:t(Hc,{children:n})})]})},Gc="{{permissions}}",Wc=/\{\{(\w+)\}\}/g,Kc="create-role",Yc=(e,t,n)=>(e?.setup?.artifacts??[]).find(e=>e.section===t&&(!n||e.id===n)),Jc=(e,t)=>(e?.setup?.artifacts??[]).filter(e=>e.section===t),qc=(e,t)=>{const n=new Set,i=[];return Jc(e,t).forEach(e=>{e.variant&&!n.has(e.variant)&&(n.add(e.variant),i.push({id:e.variant,label:e.variantLabel||e.variant}))}),i},Zc=(e,t,n)=>Jc(e,t).find(e=>e.variant===n),Qc=(e,t={})=>{const n=((e,t,n)=>{const i=e.split("\n"),o=i.findIndex(e=>e.includes(Gc));if(-1===o)return e;const a=i[o],l=a.slice(0,a.indexOf(Gc)),r=t.itemTemplate||"{{permission}}",s=t.itemSeparator??"\n";return 0===n.length?i.splice(o,1):i[o]=n.map(e=>{return l+(t=e,r.split("{{permission}}").join(t));var t}).join(s),i.join("\n")})(e.template??"",e,t.permissions??[]);return((e,t)=>e.replace(Wc,(e,n)=>Object.prototype.hasOwnProperty.call(t,n)?t[n]:e))(n,t.vars??{})};var ed;(e=>{e.DiscoveryOnly="discovery-only",e.DiscoveryInstrumentation="discovery-instrumentation",e.Custom="custom"})(ed||(ed={}));const td=[{id:ed.DiscoveryOnly,title:nt.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_TITLE,description:nt.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_DESC,featureKeys:[Pt.Discovery]},{id:ed.DiscoveryInstrumentation,title:nt.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_TITLE,description:nt.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_DESC,featureKeys:[Pt.Discovery,Pt.Instrumentation]},{id:ed.Custom,title:nt.CLOUD_CONNECTOR_PERMISSION_CUSTOM_TITLE,description:nt.CLOUD_CONNECTOR_PERMISSION_CUSTOM_DESC,featureKeys:[]}],nd=(e,t)=>e.features?.find(e=>e.key===t),id=e=>{if(!e)return[];const t=nd(e,Pt.Discovery),n=nd(e,Pt.Instrumentation);return t?t.types.map(e=>{const t=n?.types.find(t=>t.name===e.name);return{typeName:e.name,displayName:e.displayName||e.name,discoveryPermissions:e.permissions??[],instrumentationPermissions:t?t.permissions??[]:void 0}}):[]},od=()=>{const e=new Set,t=[];return{out:t,add:n=>n?.forEach(n=>{n&&!e.has(n)&&(e.add(n),t.push(n))})}},ad=(e,t)=>{if(!e)return[];const n=td.find(e=>e.id===t)?.featureKeys??[],{out:i,add:o}=od();return o(e.auth?.permissions),e.features?.forEach(e=>{e.enabled&&n.includes(e.key)&&(o(e.permissions),e.types?.forEach(e=>{!1!==e.implemented&&o(e.permissions)}))}),i},ld=(e,t)=>{if(!e)return[];const n=id(e),i=nd(e,Pt.Discovery),o=n.some(e=>t[e.typeName]?.discovery),{out:a,add:l}=od();return l(e.auth?.permissions),o&&l(i?.permissions),n.forEach(e=>{const n=t[e.typeName];n?.discovery&&l(e.discoveryPermissions),n?.instrumentation&&l(e.instrumentationPermissions)}),a},rd=(e,t,n)=>{const i=t===ed.Custom?ld(e,n??{}):ad(e,t),o=Yc(e,"permissions","policy-preview");return o?Qc(o,{permissions:i}):""},sd=b.div`
215
+ `,Sd=({policy:n})=>{const i=v(),{CopyButton:o}=_t();return e(fd,{children:[e(bd,{children:[t(Fl,{size:16,fill:i.v2.colors.silver[200]}),t(vd,{children:t(ee,{size:te.XXS,color:ne.Primary,children:nt.CLOUD_CONNECTOR_POLICY_PREVIEW})}),t(o,{value:n,size:Ct.XS})]}),t(yd,{children:t(Cd,{children:n})})]})},xd="{{permissions}}",wd=/\{\{(\w+)\}\}/g,Td="create-role",kd=(e,t,n)=>(e?.setup?.artifacts??[]).find(e=>e.section===t&&(!n||e.id===n)),Id=(e,t)=>(e?.setup?.artifacts??[]).filter(e=>e.section===t),Nd=(e,t)=>{const n=new Set,i=[];return Id(e,t).forEach(e=>{e.variant&&!n.has(e.variant)&&(n.add(e.variant),i.push({id:e.variant,label:e.variantLabel||e.variant}))}),i},Ed=(e,t,n)=>Id(e,t).find(e=>e.variant===n),$d=(e,t={})=>{const n=((e,t,n)=>{const i=e.split("\n"),o=i.findIndex(e=>e.includes(xd));if(-1===o)return e;const a=i[o],l=a.slice(0,a.indexOf(xd)),r=t.itemTemplate||"{{permission}}",s=t.itemSeparator??"\n";return 0===n.length?i.splice(o,1):i[o]=n.map(e=>{return l+(t=e,r.split("{{permission}}").join(t));var t}).join(s),i.join("\n")})(e.template??"",e,t.permissions??[]);return((e,t)=>e.replace(wd,(e,n)=>Object.prototype.hasOwnProperty.call(t,n)?t[n]:e))(n,t.vars??{})};var Od;(e=>{e.DiscoveryOnly="discovery-only",e.DiscoveryInstrumentation="discovery-instrumentation",e.Custom="custom"})(Od||(Od={}));const Ad=[{id:Od.DiscoveryOnly,title:nt.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_TITLE,description:nt.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_DESC,featureKeys:[Pt.Discovery]},{id:Od.DiscoveryInstrumentation,title:nt.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_TITLE,description:nt.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_DESC,featureKeys:[Pt.Discovery,Pt.Instrumentation]},{id:Od.Custom,title:nt.CLOUD_CONNECTOR_PERMISSION_CUSTOM_TITLE,description:nt.CLOUD_CONNECTOR_PERMISSION_CUSTOM_DESC,featureKeys:[]}],Rd=(e,t)=>e.features?.find(e=>e.key===t),Dd=e=>{if(!e)return[];const t=Rd(e,Pt.Discovery),n=Rd(e,Pt.Instrumentation);return t?t.types.map(e=>{const t=n?.types.find(t=>t.name===e.name);return{typeName:e.name,displayName:e.displayName||e.name,discoveryPermissions:e.permissions??[],instrumentationPermissions:t?t.permissions??[]:void 0}}):[]},Pd=()=>{const e=new Set,t=[];return{out:t,add:n=>n?.forEach(n=>{n&&!e.has(n)&&(e.add(n),t.push(n))})}},_d=(e,t)=>{if(!e)return[];const n=Ad.find(e=>e.id===t)?.featureKeys??[],{out:i,add:o}=Pd();return o(e.auth?.permissions),e.features?.forEach(e=>{e.enabled&&n.includes(e.key)&&(o(e.permissions),e.types?.forEach(e=>{!1!==e.implemented&&o(e.permissions)}))}),i},Ld=(e,t)=>{if(!e)return[];const n=Dd(e),i=Rd(e,Pt.Discovery),o=n.some(e=>t[e.typeName]?.discovery),{out:a,add:l}=Pd();return l(e.auth?.permissions),o&&l(i?.permissions),n.forEach(e=>{const n=t[e.typeName];n?.discovery&&l(e.discoveryPermissions),n?.instrumentation&&l(e.instrumentationPermissions)}),a},Fd=(e,t,n)=>{const i=t===Od.Custom?Ld(e,n??{}):_d(e,t),o=kd(e,"permissions","policy-preview");return o?$d(o,{permissions:i}):""},zd=b.div`
216
216
  width: 100%;
217
217
  padding: 12px 16px;
218
218
  border-radius: 12px;
219
219
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
220
220
  border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
221
- `,cd=b.div`
221
+ `,Md=b.div`
222
222
  display: grid;
223
- grid-template-columns: minmax(0, 1fr) 120px 150px;
223
+ grid-template-columns: minmax(0, 1fr) 100px minmax(200px, 1.4fr);
224
224
  align-items: center;
225
225
  row-gap: 16px;
226
226
  column-gap: 8px;
227
- `,dd=b.div`
227
+ `,Xd=b.div`
228
228
  display: flex;
229
229
  align-items: center;
230
230
  min-width: 0;
231
- `,pd=b(dd)`
231
+ `,Bd=b(Xd)`
232
232
  justify-content: center;
233
- `,ud={discovery:!1,instrumentation:!1},hd=({provider:n,capabilities:o,onCapabilitiesChange:a})=>{const l=id(n),r=(e,t)=>{a({...o,[e]:t})};return l.length?t(sd,{children:e(cd,{children:[t(dd,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:nt.CLOUD_CONNECTOR_CUSTOM_COL_TYPE})}),t(pd,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:nt.CLOUD_CONNECTOR_CUSTOM_COL_DISCOVERY})}),t(pd,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:nt.CLOUD_CONNECTOR_CUSTOM_COL_INSTRUMENTATION})}),l.map(n=>{const a=o[n.typeName]??ud,l=void 0!==n.instrumentationPermissions,s=a.instrumentation||a.discovery;return e(i.Fragment,{children:[t(dd,{children:t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Primary,children:n.displayName})}),t(pd,{children:t(ge,{name:`cloud-connector-custom-${n.typeName}-discovery`,size:Et.S,value:s,disabled:a.instrumentation,onChange:e=>r(n.typeName,{discovery:e,instrumentation:a.instrumentation})})}),t(pd,{children:t(ge,{name:`cloud-connector-custom-${n.typeName}-instrumentation`,size:Et.S,value:a.instrumentation,disabled:!l,onChange:e=>r(n.typeName,{discovery:!!e||a.discovery,instrumentation:e})})})]},n.typeName)})]})}):null},md=b.div`
233
+ `,Ud=b(Xd)`
234
+ justify-content: flex-start;
235
+ `,Vd=b(Xd)`
236
+ gap: 4px;
237
+ `,Hd={discovery:!1,instrumentation:!1},jd=({provider:n,capabilities:o,onCapabilitiesChange:a})=>{const l=v(),r=Dd(n),s=(e,t)=>{a({...o,[e]:t})};return r.length?t(zd,{children:e(Md,{children:[t(Xd,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:nt.CLOUD_CONNECTOR_CUSTOM_COL_TYPE})}),t(Bd,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:nt.CLOUD_CONNECTOR_CUSTOM_COL_DISCOVERY})}),e(Vd,{children:[t(ee,{size:te.XXS,color:ne.Secondary,children:nt.CLOUD_CONNECTOR_CUSTOM_COL_INSTRUMENTATION}),t(Be,{text:nt.CLOUD_CONNECTOR_CUSTOM_COL_INSTRUMENTATION_TOOLTIP,withIcon:!0})]}),r.map(n=>{const a=o[n.typeName]??Hd,r=void 0!==n.instrumentationPermissions,c=a.instrumentation||a.discovery;return e(i.Fragment,{children:[t(Xd,{children:t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Primary,children:n.displayName})}),t(Bd,{children:t(ge,{name:`cloud-connector-custom-${n.typeName}-discovery`,size:Et.S,value:c,disabled:a.instrumentation,onChange:e=>s(n.typeName,{discovery:e,instrumentation:a.instrumentation})})}),t(Ud,{children:t(ge,{name:`cloud-connector-custom-${n.typeName}-instrumentation`,size:Et.S,value:a.instrumentation,disabled:!r,label:a.instrumentation?nt.CLOUD_CONNECTOR_INSTRUMENTATION_MANAGED_BY_ODIGOS:nt.CLOUD_CONNECTOR_INSTRUMENTATION_SELF_MANAGED,labelColor:a.instrumentation?l.v2.colors.purple[400]:l.v2.colors.silver[200],onChange:e=>s(n.typeName,{discovery:!!e||a.discovery,instrumentation:e})})})]},n.typeName)})]})}):null},Gd=b.div`
234
238
  display: flex;
235
239
  flex-direction: column;
236
240
  gap: 8px;
@@ -239,12 +243,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
239
243
  padding: 8px;
240
244
  border-radius: 0 16px 16px 0;
241
245
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
242
- `,gd=b.div`
246
+ `,Wd=b.div`
243
247
  display: flex;
244
248
  flex-direction: column;
245
249
  gap: 8px;
246
250
  width: 100%;
247
- `,fd=b.div`
251
+ `,Kd=b.div`
248
252
  display: flex;
249
253
  align-items: center;
250
254
  gap: 10px;
@@ -252,7 +256,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
252
256
  padding: 4px 12px 4px 4px;
253
257
  border-radius: 8px;
254
258
  background-color: ${({theme:e})=>e.v2.colors.purple[900]};
255
- `,bd=b.div`
259
+ `,Yd=b.div`
256
260
  display: flex;
257
261
  align-items: center;
258
262
  justify-content: center;
@@ -261,30 +265,30 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
261
265
  border-radius: 6px;
262
266
  flex-shrink: 0;
263
267
  background-color: ${({theme:e})=>e.v2.colors.purple[800]};
264
- `,vd=({message:n})=>{const i=v();return e(fd,{children:[t(bd,{children:t(hl,{fill:"#B08BFD",size:24})}),t(ee,{size:te.XXS,color:i.v2.colors.purple[300],children:n})]})},yd=({provider:n,selectedPermission:i,onSelect:o,capabilities:a,onCapabilitiesChange:l})=>t(md,{children:td.map(r=>{const s=r.id===i,c=r.id===ed.Custom,d=s?e(gd,{children:[c&&t(hd,{provider:n,capabilities:a,onCapabilitiesChange:l}),t(jc,{policy:rd(n,r.id,a)})]}):void 0,p=s?t(vd,{message:c?nt.CLOUD_CONNECTOR_POLICY_NOTE_CUSTOM:nt.CLOUD_CONNECTOR_POLICY_NOTE}):void 0;return t(Lt,{"data-id":`cloud-connector-permission-${r.id}`,title:r.title,description:r.description,checked:s,onChange:()=>o(r.id),body:d,footerNote:p},r.id)})}),Cd=b.div`
268
+ `,Jd=({message:n})=>{const i=v();return e(Kd,{children:[t(Yd,{children:t(zl,{fill:"#B08BFD",size:24})}),t(ee,{size:te.XXS,color:i.v2.colors.purple[300],children:n})]})},qd=({provider:n,selectedPermission:i,onSelect:o,capabilities:a,onCapabilitiesChange:l})=>t(Gd,{children:Ad.map(r=>{const s=r.id===i,c=r.id===Od.Custom,d=s?e(Wd,{children:[c&&t(jd,{provider:n,capabilities:a,onCapabilitiesChange:l}),t(Sd,{policy:Fd(n,r.id,a)})]}):void 0,p=s?t(Jd,{message:c?nt.CLOUD_CONNECTOR_POLICY_NOTE_CUSTOM:nt.CLOUD_CONNECTOR_POLICY_NOTE}):void 0;return t(Lt,{"data-id":`cloud-connector-permission-${r.id}`,title:r.title,description:r.description,checked:s,onChange:()=>o(r.id),body:d,footerNote:p},r.id)})}),Zd=b.div`
265
269
  display: flex;
266
270
  flex-direction: column;
267
271
  padding: 16px;
268
- `,Sd=b.div`
272
+ `,Qd=b.div`
269
273
  display: flex;
270
274
  flex-direction: column;
271
275
  gap: 16px;
272
276
  padding: 16px;
273
277
  border-radius: 16px;
274
278
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
275
- `,xd=b.div`
279
+ `,ep=b.div`
276
280
  display: flex;
277
281
  flex-direction: column;
278
282
  gap: 4px;
279
- `,wd=b.div`
283
+ `,tp=b.div`
280
284
  display: flex;
281
285
  align-items: stretch;
282
286
  width: 100%;
283
- `,Td=b.div`
287
+ `,np=b.div`
284
288
  display: flex;
285
289
  flex: 0 0 40%;
286
290
  min-width: 0;
287
- `,kd=()=>{const{providers:n,genericForm:i}=Dr(),[r,s]=l(!0),c=o(()=>n.find(e=>e.provider===i.formData.provider),[n,i.formData.provider]),p=d(e=>{e!==i.formData.provider&&i.handleFormChange(void 0,void 0,{...i.formData,provider:e,authMethod:"",setupMethod:"",accountId:"",credentials:{},customCapabilities:{}})},[i]);return a(()=>{!i.formData.provider&&n.length>0&&p(n[0].provider)},[n,i.formData.provider,p]),a(()=>{i.formData.permission||i.handleFormChange("permission",ed.DiscoveryInstrumentation)},[i.formData.permission,i]),t(Cd,{children:e(Sd,{children:[e(xd,{children:[t(ee,{size:te.S,weight:500,lineHeight:"24px",color:ne.Primary,children:nt.CLOUD_CONNECTOR_SELECT_PROVIDER_TITLE}),t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:nt.CLOUD_CONNECTOR_SELECT_PROVIDER_SUBTITLE})]}),r&&t(De,{fullWidth:!0,maxWidth:"800px",smallIcon:!0,status:Pe.Info,message:nt.CLOUD_CONNECTOR_PERMISSIONS_NOTE,action:{"data-id":"cloud-connector-permissions-note-close",label:Ft.CLOSE,onClick:()=>s(!1)}}),e(wd,{children:[t(Td,{children:t(zc,{providers:n,selectedProvider:i.formData.provider,onSelect:p})}),t(yd,{provider:c,selectedPermission:i.formData.permission,onSelect:e=>i.handleFormChange("permission",e),capabilities:i.formData.customCapabilities,onCapabilitiesChange:e=>i.handleFormChange("customCapabilities",e)})]})]})})},Id=b.div`
291
+ `,ip=()=>{const{providers:n,genericForm:i}=cs(),[r,s]=l(!0),c=o(()=>n.find(e=>e.provider===i.formData.provider),[n,i.formData.provider]),p=d(e=>{e!==i.formData.provider&&i.handleFormChange(void 0,void 0,{...i.formData,provider:e,authMethod:"",setupMethod:"",accountId:"",credentials:{},customCapabilities:{}})},[i]);return a(()=>{!i.formData.provider&&n.length>0&&p(n[0].provider)},[n,i.formData.provider,p]),a(()=>{i.formData.permission||i.handleFormChange("permission",Od.DiscoveryInstrumentation)},[i.formData.permission,i]),t(Zd,{children:e(Qd,{children:[e(ep,{children:[t(ee,{size:te.S,weight:500,lineHeight:"24px",color:ne.Primary,children:nt.CLOUD_CONNECTOR_SELECT_PROVIDER_TITLE}),t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:nt.CLOUD_CONNECTOR_SELECT_PROVIDER_SUBTITLE})]}),r&&t(De,{fullWidth:!0,maxWidth:"800px",smallIcon:!0,status:Pe.Info,message:nt.CLOUD_CONNECTOR_PERMISSIONS_NOTE,action:{"data-id":"cloud-connector-permissions-note-close",label:Ft.CLOSE,onClick:()=>s(!1)}}),e(tp,{children:[t(np,{children:t(gd,{providers:n,selectedProvider:i.formData.provider,onSelect:p})}),t(qd,{provider:c,selectedPermission:i.formData.permission,onSelect:e=>i.handleFormChange("permission",e),capabilities:i.formData.customCapabilities,onCapabilitiesChange:e=>i.handleFormChange("customCapabilities",e)})]})]})})},op=b.div`
288
292
  display: flex;
289
293
  flex-direction: column;
290
294
  gap: 16px;
@@ -292,12 +296,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
292
296
  padding: 12px;
293
297
  border-radius: 8px;
294
298
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
295
- `,Nd=b.div`
299
+ `,ap=b.div`
296
300
  display: flex;
297
301
  align-items: center;
298
302
  gap: 12px;
299
303
  width: 100%;
300
- `,Ed=b.div`
304
+ `,lp=b.div`
301
305
  display: flex;
302
306
  align-items: center;
303
307
  justify-content: center;
@@ -306,41 +310,41 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
306
310
  height: 24px;
307
311
  border-radius: 16px;
308
312
  background-color: ${({theme:e})=>e.v2.colors.purple[500]};
309
- `,Od=b.div`
313
+ `,rp=b.div`
310
314
  display: flex;
311
315
  flex: 1;
312
316
  flex-direction: column;
313
317
  gap: 2px;
314
318
  min-width: 0;
315
- `,$d=b.div`
319
+ `,sp=b.div`
316
320
  display: flex;
317
321
  flex-direction: column;
318
322
  gap: 10px;
319
323
  width: 100%;
320
324
  padding-left: 32px;
321
- `,Ad=({"data-id":n,step:i,title:o,description:a,children:l})=>e(Id,{"data-id":n,children:[e(Nd,{children:[t(Ed,{children:t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:ne.Primary,children:i})}),e(Od,{children:[t(ee,{size:te.S,weight:400,lineHeight:"24px",color:ne.Primary,children:o}),t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:a})]})]}),l&&t($d,{children:l})]}),Rd=b.div`
325
+ `,cp=({"data-id":n,step:i,title:o,description:a,children:l})=>e(op,{"data-id":n,children:[e(ap,{children:[t(lp,{children:t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:ne.Primary,children:i})}),e(rp,{children:[t(ee,{size:te.S,weight:400,lineHeight:"24px",color:ne.Primary,children:o}),t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:a})]})]}),l&&t(sp,{children:l})]}),dp=b.div`
322
326
  display: flex;
323
327
  align-items: stretch;
324
328
  gap: 10px;
325
329
  width: 100%;
326
- `,Dd=b.div`
330
+ `,pp=b.div`
327
331
  display: flex;
328
332
  flex: 2 1 0;
329
333
  flex-direction: column;
330
334
  gap: 12px;
331
335
  min-width: 0;
332
336
  padding: 12px 0;
333
- `,Pd=b.div`
337
+ `,up=b.div`
334
338
  display: flex;
335
339
  flex-direction: column;
336
340
  gap: 8px;
337
341
  width: 100%;
338
- `,_d=b.div`
342
+ `,hp=b.div`
339
343
  display: flex;
340
344
  align-items: center;
341
345
  gap: 12px;
342
346
  width: 100%;
343
- `,Ld=b.div`
347
+ `,mp=b.div`
344
348
  display: flex;
345
349
  align-items: center;
346
350
  justify-content: center;
@@ -349,7 +353,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
349
353
  height: 24px;
350
354
  border-radius: 16px;
351
355
  background-color: ${({theme:e})=>e.v2.colors.purple[700]};
352
- `,Fd=b.div`
356
+ `,gp=b.div`
353
357
  display: flex;
354
358
  flex: 3 1 0;
355
359
  flex-direction: column;
@@ -358,42 +362,42 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
358
362
  border-radius: 12px;
359
363
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
360
364
  border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
361
- `,Md=b.div`
365
+ `,fp=b.div`
362
366
  display: flex;
363
367
  align-items: center;
364
368
  justify-content: flex-end;
365
369
  width: 100%;
366
- `,zd=b.div`
370
+ `,bp=b.div`
367
371
  flex: 1;
368
372
  width: 100%;
369
373
  min-height: 200px;
370
374
  max-height: 260px;
371
375
  overflow: auto;
372
376
  padding: 0 12px 12px;
373
- `,Xd=b.pre`
377
+ `,vp=b.pre`
374
378
  margin: 0;
375
379
  font-family: ${({theme:e})=>e.font_family.code};
376
380
  font-size: 12px;
377
381
  line-height: 20px;
378
382
  color: ${({theme:e})=>e.v2.colors.green[400]};
379
383
  white-space: pre;
380
- `,Bd=({step:n,artifact:i,code:o})=>{const a=v(),{CopyButton:l}=_t(),r=i.steps??[];return t(Ad,{"data-id":"cloud-connector-create-role",step:n,title:i.title||nt.CLOUD_CONNECTOR_CREATE_ROLE_TITLE,description:i.description,children:e(Rd,{children:[r.length>0&&e(Dd,{children:[t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:ne.Primary,children:nt.CLOUD_CONNECTOR_CREATE_ROLE_STEPS_HEADING}),t(Pd,{children:r.map((n,o)=>e(_d,{children:[t(Ld,{children:t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:a.v2.colors.purple[200],children:o+1})}),t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:ne.Primary,children:n})]},`${i.id}-step-${o}`))})]}),o&&e(Fd,{children:[t(Md,{children:t(l,{value:o,size:Ct.XS})}),t(zd,{children:t(Xd,{children:o})})]})]})})},Ud=b.div`
384
+ `,yp=({step:n,artifact:i,code:o})=>{const a=v(),{CopyButton:l}=_t(),r=i.steps??[];return t(cp,{"data-id":"cloud-connector-create-role",step:n,title:i.title||nt.CLOUD_CONNECTOR_CREATE_ROLE_TITLE,description:i.description,children:e(dp,{children:[r.length>0&&e(pp,{children:[t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:ne.Primary,children:nt.CLOUD_CONNECTOR_CREATE_ROLE_STEPS_HEADING}),t(up,{children:r.map((n,o)=>e(hp,{children:[t(mp,{children:t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:a.v2.colors.purple[200],children:o+1})}),t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:ne.Primary,children:n})]},`${i.id}-step-${o}`))})]}),o&&e(gp,{children:[t(fp,{children:t(l,{value:o,size:Ct.XS})}),t(bp,{children:t(vp,{children:o})})]})]})})},Cp=b.div`
381
385
  display: flex;
382
386
  flex-direction: column;
383
387
  padding: 16px;
384
- `,Vd=b.div`
388
+ `,Sp=b.div`
385
389
  display: flex;
386
390
  flex-direction: column;
387
391
  gap: 12px;
388
392
  padding: 16px 16px 12px;
389
393
  border-radius: 16px;
390
394
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
391
- `,Hd=b.div`
395
+ `,xp=b.div`
392
396
  display: flex;
393
397
  align-items: center;
394
398
  gap: 8px;
395
399
  width: 100%;
396
- `,jd=b.button`
400
+ `,wp=b.button`
397
401
  display: flex;
398
402
  align-items: center;
399
403
  justify-content: center;
@@ -410,38 +414,38 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
410
414
  &:hover {
411
415
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
412
416
  }
413
- `,Gd=b.div`
417
+ `,Tp=b.div`
414
418
  display: flex;
415
419
  flex: 1;
416
420
  flex-direction: column;
417
421
  gap: 4px;
418
422
  min-width: 0;
419
- `,Wd=b.div`
423
+ `,kp=b.div`
420
424
  display: flex;
421
425
  align-items: center;
422
426
  gap: 4px;
423
427
  padding: 8px 0 8px 2px;
424
- `,Kd=b.div`
428
+ `,Ip=b.div`
425
429
  display: flex;
426
430
  flex-direction: column;
427
431
  gap: 16px;
428
432
  width: 100%;
429
- `,Yd=b.div`
433
+ `,Np=b.div`
430
434
  display: flex;
431
435
  flex-wrap: wrap;
432
436
  gap: 24px;
433
437
  width: 100%;
434
- `,Jd=b.div`
438
+ `,Ep=b.div`
435
439
  display: flex;
436
440
  flex: 1 1 calc(50% - 12px);
437
441
  min-width: 0;
438
- `,qd=({field:e,value:n,onChange:i})=>{const o=`cloud-connector-credential-${e.name}`,a=e.displayName||e.name,l={name:o,label:a,required:e.required,tooltip:e.tooltip||void 0,helpMessage:e.tooltip||void 0,placeholder:a,value:n};return"textarea"===e.componentType||"credentialsJson"===e.name?t(Re,{...l,minHeight:"120px",onChange:e=>i(e.target.value)}):t(Ne,{...l,width:"100%",type:e.secret?zt.Password:zt.Text,onChange:e=>i(e.target.value)})},Zd=({onBack:n})=>{const i=v(),{providers:l,genericForm:r}=Dr(),{provider:s,authMethod:c,setupMethod:d,accountId:p,credentials:u,permission:h,customCapabilities:m}=r.formData,g=o(()=>l.find(e=>e.provider===s),[l,s]),f=g?.connectorFields?.[0],b=o(()=>(e=>{const t=e?.auth?.defaultMethod?.trim();return t&&e?.auth?.methods?.some(e=>e.id===t)?t:e?.auth?.methods?.find(e=>e.fields?.some(e=>e.required))?.id??e?.auth?.methods?.[0]?.id??""})(g),[g]),y=o(()=>g?.auth?.methods?.find(e=>e.id===c),[g,c]),C=o(()=>((e,t)=>{const n=e?.auth?.methods?.find(e=>e.id===t);if(!n)return[];const i=new Map(e?.auth?.methods?.map(e=>[e.id,e])),o=new Set,a=[],l=e=>e?.forEach(e=>{e.name&&!o.has(e.name)&&(o.add(e.name),a.push(e))});return n.baseMethods?.forEach(e=>l(i.get(e)?.fields)),l(n.fields),a})(g,c),[g,c]),S=o(()=>qc(g,Kc),[g]),x=S.length>0,w=o(()=>{if(x)return Zc(g,Kc,d)??(e=>{const t=qc(e,Kc);return t[0]?Zc(e,Kc,t[0].id):void 0})(g)},[g,d,x]),T=o(()=>Yc(g,"credentials"),[g]),k=o(()=>{const e=h;return e===ed.Custom?ld(g,m??{}):ad(g,e)},[g,h,m]),I=o(()=>w?Qc(w,{permissions:k,vars:{accountId:p??"",externalId:u.externalId?.trim()||"odigos-connector",projectId:p??"",subscriptionId:p??"",...u}}):"",[w,k,p,u]);a(()=>{if(!g)return;const e=g.auth?.methods?.some(e=>e.id===c);e||r.handleFormChange("authMethod",b)},[g,c,b,r]),a(()=>{x&&(S.some(e=>e.id===d)||r.handleFormChange("setupMethod",S[0].id))},[x,S,d,r]);let N=1;const E=f?N++:0,O=N++,$=x?N++:0,A=x?N++:0,R=N,D=g?.setup?.subtitle||(g?.displayName?`Configure the ${g.displayName} account and authentication details.`:"Configure the account and authentication details."),P=f?`Enter ${f.displayName||f.name}`:"Enter account details",_=f?.tooltip||"Enter the provider account identifier that contains the resources Odigos should discover.",L=T?.title||"Enter credentials",F=T?.description||y?.description||"Enter the credentials required by the selected authentication method.";return t(Ud,{children:e(Vd,{children:[e(Hd,{children:[t(jd,{"data-id":"cloud-connector-setup-back",type:"button",onClick:n,"aria-label":nt.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE,children:t(ml,{size:24})}),e(Gd,{children:[t(ee,{size:te.S,weight:500,lineHeight:"24px",color:ne.Primary,children:nt.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE}),t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:D})]})]}),f&&t(Ad,{"data-id":"cloud-connector-account",step:E,title:P,description:_,children:t(Ne,{name:`cloud-connector-account-${f.name}`,width:"100%",label:f.displayName||f.name,required:f.required,tooltip:f.tooltip||void 0,helpMessage:f.tooltip||void 0,placeholder:f.displayName||f.name,value:p,onChange:e=>r.handleFormChange("accountId",e.target.value)})}),e(Ad,{"data-id":"cloud-connector-auth-method",step:O,title:nt.CLOUD_CONNECTOR_AUTH_TITLE,description:"Choose how the connector authenticates with this provider.",children:[t(ve,{"data-id":"cloud-connector-auth-method-segment",size:Mt.S,selected:c,setSelected:e=>{r.handleFormChange(void 0,void 0,{...r.formData,authMethod:e,credentials:{}})},options:(g?.auth?.methods??[]).map(e=>({value:e.id,label:e.displayName}))}),y?.description&&e(Wd,{children:[t(gl,{size:16,fill:i.v2.colors.silver[200]}),t(ee,{size:te.XXXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:y.description})]})]}),x&&t(Ad,{"data-id":"cloud-connector-setup-method",step:$,title:nt.CLOUD_CONNECTOR_SETUP_METHOD_TITLE,description:nt.CLOUD_CONNECTOR_SETUP_METHOD_SUBTITLE,children:t(ve,{"data-id":"cloud-connector-setup-method-segment",size:Mt.S,selected:d,setSelected:e=>r.handleFormChange("setupMethod",e),options:S.map(e=>({value:e.id,label:e.label}))})}),x&&w&&t(Bd,{step:A,artifact:w,code:I}),t(Ad,{"data-id":"cloud-connector-credentials",step:R,title:L,description:F,children:C.length>0?t(Kd,{children:t(Yd,{children:C.map(e=>{const n="textarea"===e.componentType||"credentialsJson"===e.name;return t(Jd,{style:n?{flex:"1 1 100%"}:void 0,children:t(qd,{field:e,value:u[e.name]??"",onChange:t=>((e,t)=>{r.handleFormChange("credentials",{...u,[e]:t})})(e.name,t)})},e.name)})})}):t(ee,{size:te.XXXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:"No stored credentials are required for this authentication method."})})]})})},Qd=b.div`
442
+ `,$p=({field:e,value:n,onChange:i})=>{const o=`cloud-connector-credential-${e.name}`,a=e.displayName||e.name,l={name:o,label:a,required:e.required,tooltip:e.tooltip||void 0,helpMessage:e.tooltip||void 0,placeholder:a,value:n};return"textarea"===e.componentType||"credentialsJson"===e.name?t(Re,{...l,minHeight:"120px",onChange:e=>i(e.target.value)}):t(Ne,{...l,width:"100%",type:e.secret?Mt.Password:Mt.Text,onChange:e=>i(e.target.value)})},Op=({onBack:n})=>{const i=v(),{providers:l,genericForm:r}=cs(),{provider:s,authMethod:c,setupMethod:d,accountId:p,credentials:u,permission:h,customCapabilities:m}=r.formData,g=o(()=>l.find(e=>e.provider===s),[l,s]),f=g?.connectorFields?.[0],b=o(()=>(e=>{const t=e?.auth?.defaultMethod?.trim();return t&&e?.auth?.methods?.some(e=>e.id===t)?t:e?.auth?.methods?.find(e=>e.fields?.some(e=>e.required))?.id??e?.auth?.methods?.[0]?.id??""})(g),[g]),y=o(()=>g?.auth?.methods?.find(e=>e.id===c),[g,c]),C=o(()=>((e,t)=>{const n=e?.auth?.methods?.find(e=>e.id===t);if(!n)return[];const i=new Map(e?.auth?.methods?.map(e=>[e.id,e])),o=new Set,a=[],l=e=>e?.forEach(e=>{e.name&&!o.has(e.name)&&(o.add(e.name),a.push(e))});return n.baseMethods?.forEach(e=>l(i.get(e)?.fields)),l(n.fields),a})(g,c),[g,c]),S=o(()=>Nd(g,Td),[g]),x=S.length>0,w=o(()=>{if(x)return Ed(g,Td,d)??(e=>{const t=Nd(e,Td);return t[0]?Ed(e,Td,t[0].id):void 0})(g)},[g,d,x]),T=o(()=>kd(g,"credentials"),[g]),k=o(()=>{const e=h;return e===Od.Custom?Ld(g,m??{}):_d(g,e)},[g,h,m]),I=o(()=>w?$d(w,{permissions:k,vars:{accountId:p??"",externalId:u.externalId?.trim()||"odigos-connector",projectId:p??"",subscriptionId:p??"",...u}}):"",[w,k,p,u]);a(()=>{if(!g)return;const e=g.auth?.methods?.some(e=>e.id===c);e||r.handleFormChange("authMethod",b)},[g,c,b,r]),a(()=>{x&&(S.some(e=>e.id===d)||r.handleFormChange("setupMethod",S[0].id))},[x,S,d,r]);let N=1;const E=f?N++:0,$=N++,O=x?N++:0,A=x?N++:0,R=N,D=g?.setup?.subtitle||(g?.displayName?`Configure the ${g.displayName} account and authentication details.`:"Configure the account and authentication details."),P=f?`Enter ${f.displayName||f.name}`:"Enter account details",_=f?.tooltip||"Enter the provider account identifier that contains the resources Odigos should discover.",L=T?.title||"Enter credentials",F=T?.description||y?.description||"Enter the credentials required by the selected authentication method.";return t(Cp,{children:e(Sp,{children:[e(xp,{children:[t(wp,{"data-id":"cloud-connector-setup-back",type:"button",onClick:n,"aria-label":nt.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE,children:t(Ml,{size:24})}),e(Tp,{children:[t(ee,{size:te.S,weight:500,lineHeight:"24px",color:ne.Primary,children:nt.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE}),t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:D})]})]}),f&&t(cp,{"data-id":"cloud-connector-account",step:E,title:P,description:_,children:t(Ne,{name:`cloud-connector-account-${f.name}`,width:"100%",label:f.displayName||f.name,required:f.required,tooltip:f.tooltip||void 0,helpMessage:f.tooltip||void 0,placeholder:f.displayName||f.name,value:p,onChange:e=>r.handleFormChange("accountId",e.target.value)})}),e(cp,{"data-id":"cloud-connector-auth-method",step:$,title:nt.CLOUD_CONNECTOR_AUTH_TITLE,description:"Choose how the connector authenticates with this provider.",children:[t(ve,{"data-id":"cloud-connector-auth-method-segment",size:zt.S,selected:c,setSelected:e=>{r.handleFormChange(void 0,void 0,{...r.formData,authMethod:e,credentials:{}})},options:(g?.auth?.methods??[]).map(e=>({value:e.id,label:e.displayName}))}),y?.description&&e(kp,{children:[t(Xl,{size:16,fill:i.v2.colors.silver[200]}),t(ee,{size:te.XXXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:y.description})]})]}),x&&t(cp,{"data-id":"cloud-connector-setup-method",step:O,title:nt.CLOUD_CONNECTOR_SETUP_METHOD_TITLE,description:nt.CLOUD_CONNECTOR_SETUP_METHOD_SUBTITLE,children:t(ve,{"data-id":"cloud-connector-setup-method-segment",size:zt.S,selected:d,setSelected:e=>r.handleFormChange("setupMethod",e),options:S.map(e=>({value:e.id,label:e.label}))})}),x&&w&&t(yp,{step:A,artifact:w,code:I}),t(cp,{"data-id":"cloud-connector-credentials",step:R,title:L,description:F,children:C.length>0?t(Ip,{children:t(Np,{children:C.map(e=>{const n="textarea"===e.componentType||"credentialsJson"===e.name;return t(Ep,{style:n?{flex:"1 1 100%"}:void 0,children:t($p,{field:e,value:u[e.name]??"",onChange:t=>((e,t)=>{r.handleFormChange("credentials",{...u,[e]:t})})(e.name,t)})},e.name)})})}):t(ee,{size:te.XXXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:"No stored credentials are required for this authentication method."})})]})})},Ap=b.div`
439
443
  display: flex;
440
444
  flex-direction: column;
441
445
  flex: 1;
442
446
  min-height: 0;
443
447
  padding: 16px;
444
- `,ep=b.div`
448
+ `,Rp=b.div`
445
449
  display: flex;
446
450
  flex-direction: column;
447
451
  flex: 1;
@@ -449,13 +453,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
449
453
  padding: 16px;
450
454
  border-radius: 16px;
451
455
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
452
- `,tp=b.div`
456
+ `,Dp=b.div`
453
457
  display: flex;
454
458
  flex: 1;
455
459
  align-items: center;
456
460
  justify-content: center;
457
461
  width: 100%;
458
- `,np=b.div`
462
+ `,Pp=b.div`
459
463
  display: flex;
460
464
  flex-direction: column;
461
465
  align-items: center;
@@ -465,7 +469,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
465
469
  padding: 24px 8px;
466
470
  border-radius: 8px;
467
471
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
468
- `,ip=b.div`
472
+ `,_p=b.div`
469
473
  display: flex;
470
474
  flex-direction: column;
471
475
  align-items: center;
@@ -474,7 +478,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
474
478
  padding: 16px;
475
479
  border-radius: 12px;
476
480
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
477
- `,op=b.div`
481
+ `,Lp=b.div`
478
482
  display: flex;
479
483
  align-items: center;
480
484
  justify-content: center;
@@ -483,7 +487,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
483
487
  height: 39px;
484
488
  border-radius: 20px;
485
489
  background-color: ${({theme:e})=>e.v2.colors.red[500]};
486
- `,ap=b.div`
490
+ `,Fp=b.div`
487
491
  display: flex;
488
492
  align-items: flex-start;
489
493
  gap: 8px;
@@ -493,7 +497,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
493
497
  padding: 12px;
494
498
  border-radius: 8px;
495
499
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
496
- `,lp=b.pre`
500
+ `,zp=b.pre`
497
501
  flex: 1;
498
502
  min-width: 0;
499
503
  margin: 0;
@@ -503,25 +507,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
503
507
  color: ${({theme:e})=>e.v2.colors.silver[200]};
504
508
  white-space: pre-wrap;
505
509
  word-break: break-word;
506
- `,rp=b.div`
510
+ `,Mp=b.div`
507
511
  display: flex;
508
512
  flex-direction: column;
509
513
  gap: 12px;
510
514
  width: 100%;
511
- `,sp=b.div`
515
+ `,Xp=b.div`
512
516
  display: flex;
513
517
  flex-wrap: wrap;
514
518
  gap: 24px;
515
519
  padding: 0 2px;
516
- `,cp=b.div`
520
+ `,Bp=b.div`
517
521
  display: flex;
518
522
  gap: 6px;
519
523
  min-width: 0;
520
- `,dp=b.div`
524
+ `,Up=b.div`
521
525
  display: flex;
522
526
  flex-direction: column;
523
527
  gap: 8px;
524
- `,pp=b.div`
528
+ `,Vp=b.div`
525
529
  display: flex;
526
530
  flex-direction: column;
527
531
  gap: 6px;
@@ -529,7 +533,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
529
533
  border-radius: 12px;
530
534
  border: 1px solid ${({theme:e,$passed:t})=>t?e.v2.colors.silver[700]:e.v2.colors.red[800]};
531
535
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
532
- `,up=({isTesting:n,error:i,result:a})=>{const l=v(),{CopyButton:r}=_t(),s=o(()=>a?.checks.filter(e=>!e.passed)??[],[a]),c=!(n||!i&&(!a||a.success)),d=i?nt.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT:s[0]?.remediation||s[0]?.message||nt.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT,p=i||s.map(e=>e.message).filter(Boolean).join("\n");return t(Qd,{children:t(ep,{children:n?t(tp,{children:t(np,{children:t(St,{withVisual:!0,withGradient:!0,title:nt.CLOUD_CONNECTOR_TESTING_TITLE,titleSize:te.XS})})}):c?t(tp,{children:e(ip,{children:[t(op,{children:t(ol,{size:20,fill:l.v2.colors.black[500]})}),t(ee,{size:te.XS,weight:400,lineHeight:"20px",color:ne.Primary,children:nt.CLOUD_CONNECTOR_CONNECTION_FAILED_TITLE}),t(ee,{align:"center",size:te.XXXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:d}),p&&e(ap,{children:[t(lp,{children:p}),t(r,{value:p,size:Ct.XS})]})]})}):a?e(rp,{children:[t(ce,{status:Pe.Success,label:nt.CLOUD_CONNECTOR_VALIDATE_SUCCESS,leftIcon:il,fullWidth:!0}),(a.accountId||a.identity)&&e(sp,{children:[a.accountId&&e(cp,{children:[e(ee,{size:te.XXS,weight:500,color:ne.Secondary,children:[nt.CLOUD_CONNECTOR_VALIDATE_ACCOUNT,":"]}),t(ee,{size:te.XXS,weight:400,color:ne.Primary,children:a.accountId})]}),a.identity&&e(cp,{children:[e(ee,{size:te.XXS,weight:500,color:ne.Secondary,children:[nt.CLOUD_CONNECTOR_VALIDATE_IDENTITY,":"]}),t(ee,{size:te.XXS,weight:400,color:ne.Primary,children:a.identity})]})]}),a.checks.length>0&&t(dp,{children:a.checks.map(n=>e(pp,{$passed:n.passed,children:[t(ce,{status:n.passed?Pe.Success:Pe.Error,label:n.displayName,leftIcon:n.passed?il:ol}),n.message&&t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:n.message}),!n.passed&&n.remediation&&t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Primary,children:n.remediation})]},n.name))})]}):t(tp,{children:t(ee,{size:te.XXS,weight:400,color:ne.Secondary,children:nt.CLOUD_CONNECTOR_VALIDATE_EMPTY})})})})};var hp;(e=>{e[e.SelectProvider=1]="SelectProvider",e[e.Config=2]="Config",e[e.Validate=3]="Validate"})(hp||(hp={}));const mp=hp.SelectProvider,gp=hp.Validate,fp=({onClose:n,withOverlay:i,onCreateCloudConnector:a,onCreated:r})=>{const{providers:s,genericForm:c}=Dr(),[p,u]=l(mp),[h,m]=l(!1),[g,f]=l(!1),[b,v]=l(void 0),[y,C]=l(void 0),[S,x]=l(void 0),w=c.isFormDirty,T=p===mp,k=p===gp,I=d(()=>{w&&!h?m(!0):(m(!1),n?.())},[w,h,n]),N=d(()=>{x(void 0),C(void 0),v(void 0),u(e=>e>mp?e-1:e)},[]),E=d(()=>{if(x(void 0),p===hp.SelectProvider){if(!c.formData.provider)return void x("Please select a cloud provider");if(!c.formData.permission)return void x("Please select a permission level")}u(e=>e<gp?e+1:e)},[p,c.formData.provider,c.formData.permission]),O=d(async()=>{if(x(void 0),C(void 0),v(void 0),!a)return;const{provider:e,permission:t,customCapabilities:n,accountId:i,authMethod:o,credentials:l,name:d}=c.formData,p=s.find(t=>t.provider===e),h=p?.connectorFields?.[0];if(h?.required&&!i.trim())return void x(`Please enter ${h.displayName||h.name}`);if(!o)return void x("Please select an authentication method");const m=((e,t,n)=>{const i=e?.auth?.methods?.find(e=>e.id===t);if(!i)return;const o=e=>!!n[e]?.trim(),a=e=>e?.find(e=>e.required&&!o(e.name)),l=a(i.fields);if(l)return l;if(!i.baseMethods?.length)return;const r=new Map(e?.auth?.methods?.map(e=>[e.id,e])),s=i.baseMethods.some(e=>{const t=r.get(e);return!(!t||t.fields&&0!==t.fields.length)});for(const e of i.baseMethods){const t=r.get(e);if(t?.fields?.length&&(t.fields.some(e=>o(e.name))||!s)){const e=a(t.fields);if(e)return e}}})(p,o,l);if(m)return void x(`Please enter ${m.displayName||m.name}`);const g=((e,t,n)=>{const i=id(e),o=[];return i.forEach(e=>{const i=void 0!==e.instrumentationPermissions;let a=!1,l=!1;switch(t){case ed.DiscoveryOnly:a=!0;break;case ed.DiscoveryInstrumentation:a=!0,l=i;break;case ed.Custom:{const t=n[e.typeName];a=!!t?.discovery,l=!!t?.instrumentation;break}}(a||l)&&o.push({type:e.typeName,discovery:a,instrumentation:l,computePlatforms:!1})}),o})(p,t,n);u(hp.Validate),f(!0);try{const t=await a({provider:e,displayName:d,credentials:l,expectedAccountId:i.trim(),capabilities:g});if(t.created)return void r?.(t.connectorId);v(t.test)}catch(e){C(e instanceof Error?e.message:"Failed to create connector")}finally{f(!1)}},[a,r,c.formData,s]),$=g,A=k&&!g&&(!!y||!!b&&!b.success),R=o(()=>S?{status:Pe.Error,message:S}:void 0,[S]),D=o(()=>T?{"data-id":"cloud-connector-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:I,disabled:$}:{"data-id":"cloud-connector-back",label:Ft.BACK,variant:Ie.Text,leftIcon:ml,onClick:N,disabled:$},[T,I,N,$]),P=o(()=>{if(k){if(g)return;return A?{"data-id":"cloud-connector-retry",label:Ft.RETRY,variant:Ie.Primary,rightIcon:fl,onClick:O}:void 0}return p===hp.Config?{"data-id":"cloud-connector-verify",label:Ft.VERIFY_AND_CREATE_CONNECTOR,variant:Ie.Primary,onClick:O,disabled:$}:{"data-id":"cloud-connector-next",label:Ft.NEXT,variant:Ie.Primary,onClick:E,disabled:$}},[k,g,A,p,O,E,$]),_=o(()=>[D,P].filter(Boolean),[D,P]);return e(Xt,{width:ur,isOpen:!0,hideOverlay:!$&&!i,header:{icon:pl,title:nt.CREATE_CLOUD_CONNECTOR,onClose:n?I:void 0,onCloseDisabled:$},footer:{note:R,actions:_},children:[p===hp.SelectProvider&&t(kd,{}),p===hp.Config&&t(Zd,{onBack:N}),p===hp.Validate&&t(up,{isTesting:g,error:y,result:b}),t(hr,{isOpen:h,onClose:()=>m(!1),onApprove:()=>n?.()})]})},bp=({statuses:e})=>{const n=o(()=>Bt(e).map(({status:e,type:t,reason:n,message:i})=>({status:e,title:Ut(n||t),subTitle:i??void 0})),[e]);return n.length?t(ae,{$gap:12,children:n.map(e=>t(Vt,{invertColors:!0,slim:!0,width:"100%",...e},e.title))}):null},vp=(e,t)=>{const n=[{id:"type",title:nt.TYPE,label:t.label},{id:"status",title:nt.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?nt.DISABLED:nt.ENABLED}}],i=e.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return i&&n.push({id:"signals",title:nt.SIGNALS_FOR_PROCESSING,label:i}),e.name&&n.push({id:"name",title:nt.NAME,label:e.name}),e.notes&&n.push({id:"notes",title:nt.NOTES,label:e.notes}),n},yp=e=>e.map(e=>"cells"===e.kind?t(Gt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):"list"===e.kind||"pairs"===e.kind?t(Gt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id):t(Gt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:e.items?.length?2:void 0,items:e.items,children:e.segments?.length?yp(e.segments):null},e.id)),Cp=({onClose:i,actionId:r})=>{const s=v(),{isK8s:c,platformType:u,version:h}=S(),{actionsApi:m}=Sr(),{items:g,refetch:f}=m.useActions(),{options:b}=m.useActionTypes(),{selectedOption:y,loadAction:C,validateFormData:x,genericForm:w}=Cr(),T=p(f);T.current=f,a(()=>{T.current()},[]);const[k,I]=l(!1),[N,E]=l(!1),[O,$]=l(null),A=k&&!!w?.isFormDirty;a(()=>{if(k)return;const e=setInterval(()=>T.current(),3e3);return()=>clearInterval(e)},[k]);const R=o(()=>g?.find(e=>Wt(e)===r),[r,g]),D=o(()=>b.find(({type:e})=>e===R?.type)??mt(u,h).find(({type:e})=>e===R?.type)??Kt.find(({type:e})=>e===R?.type)??null,[b,R?.type,u,h]),P=R?.statuses&&Array.isArray(R.statuses)?R.statuses:null;a(()=>{R&&C(R,D)},[R,D]);const _=d(()=>{R&&I(!0)},[R]),L=d(()=>{R&&(C(R,D),I(!1))},[R,D,C]),F=d(()=>{A?$("close"):i()},[A,i]),M=d(()=>{A?$("cancel"):L()},[A,L]),z=d(()=>{const e=O;$(null),"close"===e?(L(),i()):L()},[O,L,i]),X=d(async()=>{if(R){const{errorMessage:e,preparedFormData:t}=x();e||(await m.update(R.id,t),I(!1))}},[R,x,m]),B=d(()=>{R&&E(!0)},[R]),U=d(async()=>{R&&(await m.remove(R.id,R.type),i())},[R,m,i]);if(!R||!D)return null;const V=(H=R,j=D,j?.fields?.length?Ht(H.fields||{},j.fields,{signals:H.signals||[],skipComponentTypes:[jt.SourceScopes]}):[]);var H,j;const G=D.fields?.find(e=>e.componentType===jt.SourceScopes),W=G?.name||de.Scopes,K=R.fields?.[W]??null,Y=c&&(!!G||void 0!==R.fields?.scopes);return e(n,{children:[t(Xt,{isOpen:!0,header:{icon:Jt(R.type),title:D.label,onClose:F,actions:[{id:"edit-action-btn-edit",label:Ft.EDIT,icon:Ka,active:k,onClick:_},{id:"edit-action-btn-delete",label:Ft.DELETE,icon:Va,color:s.v2.colors.red[500],active:N,onClick:B}]},footer:{actions:k?[{"data-id":"edit-action-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:M},{"data-id":"edit-action-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:X}]:[]},children:t(le,{$padding:"4px 12px 12px",children:k&&y?t(Ps,{}):t(ae,{$gap:16,children:e(Gt,{bgTint:"1000",children:[c&&(P?t(bp,{statuses:P}):t(Yt,{conditions:R.conditions||[]})),t(Gt,{bgTint:"800",cellsPerRow:2,items:vp(R,D)}),Y&&t(tr,{readOnly:!0,scopes:K}),!!V.length&&t(Gt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:yp(V)})]})})})}),t(mr,{target:"action",isOpen:N,onClose:()=>E(!1),onApprove:U}),t(hr,{isOpen:null!==O,onClose:()=>$(null),onApprove:z})]})},Sp=({onClose:n,connections:i,selectedConnectionIds:r,setSelectedConnectionIds:s})=>{const{configApi:c}=Sr(),[d,p]=l(""),[u,h]=l({showOnlySelected:!1}),m=o(()=>i.filter(e=>{const t=!d||e.name.toLowerCase().includes(d.toLowerCase()),n=!u.showOnlySelected||u.showOnlySelected&&r.includes(e.id);return t&&n}),[i.length,r.length,d,u]),g=e=>{s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},f=1===r.length?r[0]:void 0,{data:b,loading:v}=c.useEffectiveConfig({id:f},{skip:!f}),y=o(()=>({rollout:{automaticRolloutDisabled:b?.rollout?.automaticRolloutDisabled??!1}}),[b]),{formData:C,areFormValuesEqual:S,handleFormChange:x,resetFormData:w}=qt(y);a(()=>{y&&w(y)},[y]);const T=o(()=>r.length>1||!S(y,C),[r.length,y,C]);return t(pr,{isOpen:!0,onClose:n,onSave:async()=>await(c.applyConfigurations?.(C,r))??void 0,header:{icon:bl,title:"Cluster Configuration"},connectionIds:{value:r,setValue:s},search:{placeholder:"Search by cluster name",value:d,onChange:p},filters:e(ie,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,nowrap:!0,children:"Show only:"}),t(ge,{size:Et.S,label:"Selected",value:u.showOnlySelected,onChange:e=>h(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:T,isFetching:v,leftColumn:{width:"35%",header:e(ie,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ie,{$gap:8,children:[t(ee,{size:te.XS,children:"Clusters"}),t(ce,{label:m.length,status:Pe.Unknown})]}),e(ie,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,align:"right",children:"Selected clusters"}),t(ce,{label:`${r.length}/${m.length}`,status:Pe.Unknown})]})]}),list:m.map(e=>t(ds,{title:e.name,isChecked:r.includes(e.id),onClick:()=>g(e.id),onCheckboxChange:()=>g(e.id)},e.id))},rightColumn:{width:"65%",header:t(ee,{size:te.XS,children:"Configurations"}),list:[t(ge,{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:C.rollout?.automaticRolloutDisabled||!1,onChange:e=>x("rollout.automaticRolloutDisabled",e),size:Et.S},"automatic-rollout-disabled")]}})},xp=e=>{const t=[{id:"type",title:nt.TYPE,label:e.destinationType.displayName},{id:"status",title:nt.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?nt.DISABLED:nt.ENABLED}}],n=Fe(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:nt.MONITORS,label:n}),e.name&&t.push({id:"name",title:nt.NAME,label:e.name}),t},wp=({onClose:i,destinationId:r})=>{const s=v(),{isK8s:c}=S(),{destinationsApi:u}=Sr(),{selectedStreamName:h}=it(),{items:m,refetch:g}=u.useDestinations(),{data:f,loading:b}=u.useDestinationCategories(),{activeForm:y,loadDestination:C,validateFormData:x,genericForm:w}=xr();a(()=>{g()},[]);const T=p(null),[k,I]=l(!1),[N,E]=l(!1),[O,$]=l(null),A=k&&!!w?.isFormDirty,R=o(()=>en(m,h),[m,h]),D=o(()=>R?.find(e=>Wt(e)===r),[r,R]),P=f?.destinationCategories?.categories??null;a(()=>{D&&P&&C(D,P)},[D,P]);const _=o(()=>D&&P?tn(P,D):[],[D,P]),L=d(()=>{D&&I(!0)},[D]),F=d(()=>{D&&P&&(C(D,P),I(!1))},[D,P,C]),M=d(()=>{A?$("close"):i()},[A,i]),z=d(()=>{A?$("cancel"):F()},[A,F]),X=d(()=>{const e=O;$(null),"close"===e?(F(),i()):F()},[O,F,i]),B=d(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=x();e||(await u.update(D.id,ze(t)),I(!1))}},[D,x,u]),U=d(()=>{D&&E(!0)},[D]),V=d(async()=>{D&&(await u.remove(D.id),i())},[D,u,i]);if(!D)return null;const{icon:H,iconSrc:j}=wt(D.destinationType.type),G=((e,t)=>{const n=[],i=Zt(e,t),o=i.map(e=>({name:e.key,value:e.value})),a=Fe(e.exportedSignals);let l=[];const r=()=>{l.length&&(n.push({kind:"cells",id:`cells-${n.length}`,items:l}),l=[])};return i.forEach(({key:e,name:i,value:s})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:p,componentProperties:u,hideFromReadData:h,customReadDataLabels:m}=c||{};if(h?.length&&Qt(h,a,o))return;const{type:g}=kt(u,{type:""}),f=d||"password"===g;if(m?.length)m.forEach(({condition:t,...n},i)=>{t==s&&l.push({id:`${e}-custom-${i}`,title:n.title,label:n.value})});else if(s)if(f)l.push({id:e,title:i,label:new Array(10).fill("•").join("")});else{if(p===jt.MultiInput){const t=kt(s,null);if(Array.isArray(t)&&t.length)return r(),void n.push({kind:"list",id:e,title:i,items:t.map((t,n)=>({id:`${e}-${n}`,label:String(t)}))})}if(p===jt.KeyValuePair){const t=kt(s,null);if(Array.isArray(t)&&t.length)return r(),void n.push({kind:"pairs",id:e,title:i,items:t.map((t,n)=>{const i=t&&"object"==typeof t?t:{};return{id:`${e}-${n}`,title:null!=i.key?String(i.key):"",label:null!=i.value?String(i.value):""}})})}l.push({id:e,title:i,label:s})}else l.push({id:e,title:i,label:"-"})}),r(),n})(D,_);return e(n,{children:[t(Xt,{isOpen:!0,header:{icon:H,iconSrc:j,title:D.name||D.destinationType.displayName,onClose:M,actions:[{id:"edit-destination-btn-edit",label:Ft.EDIT,icon:Ka,active:k,onClick:L},{id:"edit-destination-btn-delete",label:Ft.DELETE,icon:Va,color:s.v2.colors.red[500],active:N,onClick:U}]},footer:{actions:k?[{"data-id":"edit-destination-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:z},...y?.option.testConnectionSupported&&c?[{"data-id":"edit-destination-btn-test-connection",label:Ft.TEST_CONNECTION,variant:Ie.Secondary,onClick:()=>T.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:B}]:[]},children:t(le,{$padding:"4px 12px 12px",children:b?t(ft,{$height:"50vh",children:t(St,{withSpinner:!0})}):k&&y?t(Ls,{ref:T,isEdit:!0}):t(ae,{$gap:16,children:e(Gt,{bgTint:"1000",children:[e(Gt,{bgTint:"900",children:[c&&t(Yt,{conditions:D.conditions||[]}),t(Gt,{bgTint:"800",cellsPerRow:2,items:xp(D)})]}),!!G.length&&t(Gt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:G.map(e=>"cells"===e.kind?t(Gt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(Gt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(mr,{target:"destination",isOpen:N,onClose:()=>E(!1),onApprove:V}),t(hr,{isOpen:null!==O,onClose:()=>$(null),onApprove:X})]})},Tp=(e,t)=>{const n=[{id:"type",title:nt.TYPE,label:t.label},{id:"status",title:nt.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?nt.DISABLED:nt.ENABLED}}];return e.ruleName&&n.push({id:"name",title:nt.NAME,label:e.ruleName}),e.profileName&&n.push({id:"profile",title:nt.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&n.push({id:"notes",title:nt.NOTES,label:e.notes}),n},kp=({onClose:i,ruleId:r})=>{const s=v(),{addNotification:c}=nn(),{isK8s:p,platformType:u,version:h}=S(),m=Je(u,h),{instrumentationRulesApi:g}=Sr(),{items:f,refetch:b}=g.useRules(),{selectedOption:y,loadRule:C,validateFormData:x,genericForm:w}=wr();a(()=>{b()},[]);const[T,k]=l(!1),[I,N]=l(!1),[E,O]=l(null),$=T&&!!w?.isFormDirty,{options:A}=g.useRuleTypes(),R=o(()=>A.length?A:It,[A]),D=o(()=>f?.find(e=>Wt(e)===r),[r,f]),P=o(()=>R.find(({type:e})=>e===D?.type)??null,[R,D?.type]),_=o(()=>qe(P?.supportedLanguages),[P?.supportedLanguages]);a(()=>{D&&P&&C(D,P)},[D,P]);const L=d(()=>{if(D){if(!D.mutable)return void c({type:Pe.Warning,title:Ke.FORBIDDEN,message:Ke.CANNOT_EDIT_RULE,crdType:Nt.InstrumentationRule,target:D.ruleId,hideFromHistory:!0});k(!0)}},[D,c]),F=d(()=>{D&&P&&(C(D,P),k(!1))},[D,P,C]),M=d(()=>{$?O("close"):i()},[$,i]),z=d(()=>{$?O("cancel"):F()},[$,F]),X=d(()=>{const e=E;O(null),"close"===e?(F(),i()):F()},[E,F,i]),B=d(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=x();e||(await g.update(D.ruleId,t,D.type),k(!1))}},[D,x,g]),U=d(()=>{if(D){if(!D.mutable)return void c({type:Pe.Warning,title:Ke.FORBIDDEN,message:Ke.CANNOT_DELETE_RULE,crdType:Nt.InstrumentationRule,target:D.ruleId,hideFromHistory:!0});N(!0)}},[D,c]),V=d(async()=>{D&&(await g.remove(D.ruleId,D.type),i())},[D,g,i]);if(!D||!P)return null;const H=(j=D,G=P,G?.fields?.length?Ht(j,G.fields,{skipComponentTypes:[jt.SourceScopes]}):[]);var j,G;return e(n,{children:[t(Xt,{isOpen:!0,header:{icon:an(D.type),title:P.label,onClose:M,actions:[{id:"edit-rule-btn-edit",label:Ft.EDIT,icon:Ka,active:T,onClick:L},{id:"edit-rule-btn-delete",label:Ft.DELETE,icon:Va,color:s.v2.colors.red[500],active:I,onClick:U}]},footer:{actions:T?[{"data-id":"edit-rule-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:z},{"data-id":"edit-rule-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:B}]:[]},children:t(le,{$padding:"4px 12px 12px",children:T&&y?t(Hs,{}):t(ae,{$gap:16,children:e(Gt,{bgTint:"1000",children:[p&&t(Yt,{conditions:D.conditions||[]}),t(Gt,{bgTint:"800",cellsPerRow:2,items:Tp(D,P)}),m&&t(tr,{readOnly:!0,scopes:D.sourceScopes??null}),P.type===Ye.CustomInstrumentation&&!!D.customInstrumentations?.[We.Php]?.length&&t(De,{status:Pe.Warning,message:Ke.PHP_CUSTOM_INSTRUMENTATION_RESTART,fullWidth:!0}),!!H.length&&t(Gt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:yp(H)}),!!_.length&&t(Gt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Gt,{bgTint:"800",children:t(ie,{$gap:12,$wrap:"wrap",children:_.map(e=>t(on,{label:et(e),leftIcon:Qe(e),flex:_.length>1?"0.5":"1"},e))})})})]})})})}),t(mr,{target:"instrumentation rule",isOpen:I,onClose:()=>N(!1),onApprove:V}),t(hr,{isOpen:null!==E,onClose:()=>O(null),onApprove:X})]})};var Ip;(e=>{e.Overview="overview",e.Pods="pods",e.Libraries="libraries",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"})(Ip||(Ip={}));const Np=({collapseIsDefaultOpen:e,isJumpToTarget:n,onClickRestartPod:i,namespace:a,podName:l,nodeName:r,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:p,children:u})=>{const{formatDurationAgo:h}=ln(),{platformType:m,version:g}=S(),f=rn(m,g),b=sn(!!n),v=o(()=>({title:l,icon:vl,withCopy:!0}),[l]),y=o(()=>{const e=[],t=cn(c);t&&e.push(t);const n=cn(d,hl,"health");n&&e.push(n);const i=cn(p,yl,"health");return i&&e.push(i),e},[c,d,p]),C=o(()=>i?[{id:`restart-pod-${l}`,icon:fl,label:Ft.RESTART_POD,onClick:()=>i(a,l)}]:void 0,[i,a,l]),x=o(()=>[{id:"nodeName",title:nt.NODE,label:r,withCopy:!0},{id:"age",title:nt.AGE,label:s?h(s,{style:"short"}):f?nt.NOT_RUNNING:nt.UNKNOWN_VALUE,labelTooltip:s||(f?void 0:nt.START_TIME_UNAVAILABLE)}],[r,s,h,f]);return t("div",{ref:b,children:t(Gt,{bgTint:"900",richTitle:v,badges:y,dropDataActions:C,items:x,withCollapse:!0,collapseIsDefaultOpen:e,children:u})})},Ep=b.div`
536
+ `,Hp=({isTesting:n,error:i,result:a})=>{const l=v(),{CopyButton:r}=_t(),s=o(()=>a?.checks.filter(e=>!e.passed)??[],[a]),c=!(n||!i&&(!a||a.success)),d=i?nt.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT:s[0]?.remediation||s[0]?.message||nt.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT,p=i||s.map(e=>e.message).filter(Boolean).join("\n");return t(Ap,{children:t(Rp,{children:n?t(Dp,{children:t(Pp,{children:t(St,{withVisual:!0,withGradient:!0,title:nt.CLOUD_CONNECTOR_TESTING_TITLE,titleSize:te.XS})})}):c?t(Dp,{children:e(_p,{children:[t(Lp,{children:t($l,{size:20,fill:l.v2.colors.black[500]})}),t(ee,{size:te.XS,weight:400,lineHeight:"20px",color:ne.Primary,children:nt.CLOUD_CONNECTOR_CONNECTION_FAILED_TITLE}),t(ee,{align:"center",size:te.XXXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:d}),p&&e(Fp,{children:[t(zp,{children:p}),t(r,{value:p,size:Ct.XS})]})]})}):a?e(Mp,{children:[t(ce,{status:Pe.Success,label:nt.CLOUD_CONNECTOR_VALIDATE_SUCCESS,leftIcon:El,fullWidth:!0}),(a.accountId||a.identity)&&e(Xp,{children:[a.accountId&&e(Bp,{children:[e(ee,{size:te.XXS,weight:500,color:ne.Secondary,children:[nt.CLOUD_CONNECTOR_VALIDATE_ACCOUNT,":"]}),t(ee,{size:te.XXS,weight:400,color:ne.Primary,children:a.accountId})]}),a.identity&&e(Bp,{children:[e(ee,{size:te.XXS,weight:500,color:ne.Secondary,children:[nt.CLOUD_CONNECTOR_VALIDATE_IDENTITY,":"]}),t(ee,{size:te.XXS,weight:400,color:ne.Primary,children:a.identity})]})]}),a.checks.length>0&&t(Up,{children:a.checks.map(n=>e(Vp,{$passed:n.passed,children:[t(ce,{status:n.passed?Pe.Success:Pe.Error,label:n.displayName,leftIcon:n.passed?El:$l}),n.message&&t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:n.message}),!n.passed&&n.remediation&&t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Primary,children:n.remediation})]},n.name))})]}):t(Dp,{children:t(ee,{size:te.XXS,weight:400,color:ne.Secondary,children:nt.CLOUD_CONNECTOR_VALIDATE_EMPTY})})})})};var jp;(e=>{e[e.SelectProvider=1]="SelectProvider",e[e.Config=2]="Config",e[e.Validate=3]="Validate"})(jp||(jp={}));const Gp=jp.SelectProvider,Wp=jp.Validate,Kp=({onClose:n,withOverlay:i,onCreateCloudConnector:a,onCreated:r})=>{const{providers:s,genericForm:c}=cs(),[p,u]=l(Gp),[h,m]=l(!1),[g,f]=l(!1),[b,v]=l(void 0),[y,C]=l(void 0),[S,x]=l(void 0),w=c.isFormDirty,T=p===Gp,k=p===Wp,I=d(()=>{w&&!h?m(!0):(m(!1),n?.())},[w,h,n]),N=d(()=>{x(void 0),C(void 0),v(void 0),u(e=>e>Gp?e-1:e)},[]),E=d(()=>{if(x(void 0),p===jp.SelectProvider){if(!c.formData.provider)return void x("Please select a cloud provider");if(!c.formData.permission)return void x("Please select a permission level")}u(e=>e<Wp?e+1:e)},[p,c.formData.provider,c.formData.permission]),$=d(async()=>{if(x(void 0),C(void 0),v(void 0),!a)return;const{provider:e,permission:t,customCapabilities:n,accountId:i,authMethod:o,credentials:l,name:d}=c.formData,p=s.find(t=>t.provider===e),h=p?.connectorFields?.[0];if(h?.required&&!i.trim())return void x(`Please enter ${h.displayName||h.name}`);if(!o)return void x("Please select an authentication method");const m=((e,t,n)=>{const i=e?.auth?.methods?.find(e=>e.id===t);if(!i)return;const o=e=>!!n[e]?.trim(),a=e=>e?.find(e=>e.required&&!o(e.name)),l=a(i.fields);if(l)return l;if(!i.baseMethods?.length)return;const r=new Map(e?.auth?.methods?.map(e=>[e.id,e])),s=i.baseMethods.some(e=>{const t=r.get(e);return!(!t||t.fields&&0!==t.fields.length)});for(const e of i.baseMethods){const t=r.get(e);if(t?.fields?.length&&(t.fields.some(e=>o(e.name))||!s)){const e=a(t.fields);if(e)return e}}})(p,o,l);if(m)return void x(`Please enter ${m.displayName||m.name}`);const g=((e,t,n)=>{const i=Dd(e),o=[];return i.forEach(e=>{const i=void 0!==e.instrumentationPermissions;let a=!1,l=!1;switch(t){case Od.DiscoveryOnly:a=!0;break;case Od.DiscoveryInstrumentation:a=!0,l=i;break;case Od.Custom:{const t=n[e.typeName];a=!!t?.discovery,l=!!t?.instrumentation;break}}(a||l)&&o.push({type:e.typeName,discovery:a,instrumentation:l,computePlatforms:!1})}),o})(p,t,n);u(jp.Validate),f(!0);try{const t=await a({provider:e,displayName:d,credentials:l,expectedAccountId:i.trim(),capabilities:g});if(t.created)return void r?.(t.connectorId);v(t.test)}catch(e){C(e instanceof Error?e.message:"Failed to create connector")}finally{f(!1)}},[a,r,c.formData,s]),O=g,A=k&&!g&&(!!y||!!b&&!b.success),R=o(()=>S?{status:Pe.Error,message:S}:void 0,[S]),D=o(()=>T?{"data-id":"cloud-connector-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:I,disabled:O}:{"data-id":"cloud-connector-back",label:Ft.BACK,variant:Ie.Text,leftIcon:Ml,onClick:N,disabled:O},[T,I,N,O]),P=o(()=>{if(k){if(g)return;return A?{"data-id":"cloud-connector-retry",label:Ft.RETRY,variant:Ie.Primary,rightIcon:Bl,onClick:$}:void 0}return p===jp.Config?{"data-id":"cloud-connector-verify",label:Ft.VERIFY_AND_CREATE_CONNECTOR,variant:Ie.Primary,onClick:$,disabled:O}:{"data-id":"cloud-connector-next",label:Ft.NEXT,variant:Ie.Primary,onClick:E,disabled:O}},[k,g,A,p,$,E,O]),_=o(()=>[D,P].filter(Boolean),[D,P]);return e(Xt,{width:Br,isOpen:!0,hideOverlay:!O&&!i,header:{icon:Ll,title:nt.CREATE_CLOUD_CONNECTOR,onClose:n?I:void 0,onCloseDisabled:O},footer:{note:R,actions:_},children:[p===jp.SelectProvider&&t(ip,{}),p===jp.Config&&t(Op,{onBack:N}),p===jp.Validate&&t(Hp,{isTesting:g,error:y,result:b}),t(Ur,{isOpen:h,onClose:()=>m(!1),onApprove:()=>n?.()})]})},Yp=({statuses:e})=>{const n=o(()=>Bt(e).map(({status:e,type:t,reason:n,message:i})=>({status:e,title:Ut(n||t),subTitle:i??void 0})),[e]);return n.length?t(ae,{$gap:12,children:n.map(e=>t(Vt,{invertColors:!0,slim:!0,width:"100%",...e},e.title))}):null},Jp=(e,t)=>{const n=[{id:"type",title:nt.TYPE,label:t.label},{id:"status",title:nt.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?nt.DISABLED:nt.ENABLED}}],i=e.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return i&&n.push({id:"signals",title:nt.SIGNALS_FOR_PROCESSING,label:i}),e.name&&n.push({id:"name",title:nt.NAME,label:e.name}),e.notes&&n.push({id:"notes",title:nt.NOTES,label:e.notes}),n},qp=e=>e.map(e=>"cells"===e.kind?t(Gt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):"list"===e.kind||"pairs"===e.kind?t(Gt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id):t(Gt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:e.items?.length?2:void 0,items:e.items,children:e.segments?.length?qp(e.segments):null},e.id)),Zp=({onClose:i,actionId:r})=>{const s=v(),{isK8s:c,platformType:u,version:h}=S(),{actionsApi:m}=qr(),{items:g,refetch:f}=m.useActions(),{options:b}=m.useActionTypes(),{selectedOption:y,loadAction:C,validateFormData:x,genericForm:w}=Jr(),T=p(f);T.current=f,a(()=>{T.current()},[]);const[k,I]=l(!1),[N,E]=l(!1),[$,O]=l(null),A=k&&!!w?.isFormDirty;a(()=>{if(k)return;const e=setInterval(()=>T.current(),3e3);return()=>clearInterval(e)},[k]);const R=o(()=>g?.find(e=>Wt(e)===r),[r,g]),D=o(()=>b.find(({type:e})=>e===R?.type)??mt(u,h).find(({type:e})=>e===R?.type)??Kt.find(({type:e})=>e===R?.type)??null,[b,R?.type,u,h]),P=R?.statuses&&Array.isArray(R.statuses)?R.statuses:null;a(()=>{R&&C(R,D)},[R,D]);const _=d(()=>{R&&I(!0)},[R]),L=d(()=>{R&&(C(R,D),I(!1))},[R,D,C]),F=d(()=>{A?O("close"):i()},[A,i]),z=d(()=>{A?O("cancel"):L()},[A,L]),M=d(()=>{const e=$;O(null),"close"===e?(L(),i()):L()},[$,L,i]),X=d(async()=>{if(R){const{errorMessage:e,preparedFormData:t}=x();e||(await m.update(R.id,t),I(!1))}},[R,x,m]),B=d(()=>{R&&E(!0)},[R]),U=d(async()=>{R&&(await m.remove(R.id,R.type),i())},[R,m,i]);if(!R||!D)return null;const V=(H=R,j=D,j?.fields?.length?Ht(H.fields||{},j.fields,{signals:H.signals||[],skipComponentTypes:[jt.SourceScopes]}):[]);var H,j;const G=D.fields?.find(e=>e.componentType===jt.SourceScopes),W=G?.name||de.Scopes,K=R.fields?.[W]??null,Y=c&&(!!G||void 0!==R.fields?.scopes);return e(n,{children:[t(Xt,{isOpen:!0,header:{icon:Jt(R.type),title:D.label,onClose:F,actions:[{id:"edit-action-btn-edit",label:Ft.EDIT,icon:yl,active:k,onClick:_},{id:"edit-action-btn-delete",label:Ft.DELETE,icon:ml,color:s.v2.colors.red[500],active:N,onClick:B}]},footer:{actions:k?[{"data-id":"edit-action-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:z},{"data-id":"edit-action-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:X}]:[]},children:t(le,{$padding:"4px 12px 12px",children:k&&y?t(dc,{}):t(ae,{$gap:16,children:e(Gt,{bgTint:"1000",children:[c&&(P?t(Yp,{statuses:P}):t(Yt,{conditions:R.conditions||[]})),t(Gt,{bgTint:"800",cellsPerRow:2,items:Jp(R,D)}),Y&&t(Or,{readOnly:!0,scopes:K}),!!V.length&&t(Gt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:qp(V)})]})})})}),t(Vr,{target:"action",isOpen:N,onClose:()=>E(!1),onApprove:U}),t(Ur,{isOpen:null!==$,onClose:()=>O(null),onApprove:M})]})},Qp=({onClose:n,connections:i,selectedConnectionIds:r,setSelectedConnectionIds:s})=>{const{configApi:c}=qr(),[d,p]=l(""),[u,h]=l({showOnlySelected:!1}),m=o(()=>i.filter(e=>{const t=!d||e.name.toLowerCase().includes(d.toLowerCase()),n=!u.showOnlySelected||u.showOnlySelected&&r.includes(e.id);return t&&n}),[i.length,r.length,d,u]),g=e=>{s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},f=1===r.length?r[0]:void 0,{data:b,loading:v}=c.useEffectiveConfig({id:f},{skip:!f}),y=o(()=>({rollout:{automaticRolloutDisabled:b?.rollout?.automaticRolloutDisabled??!1}}),[b]),{formData:C,areFormValuesEqual:S,handleFormChange:x,resetFormData:w}=qt(y);a(()=>{y&&w(y)},[y]);const T=o(()=>r.length>1||!S(y,C),[r.length,y,C]);return t(Xr,{isOpen:!0,onClose:n,onSave:async()=>await(c.applyConfigurations?.(C,r))??void 0,header:{icon:Ul,title:"Cluster Configuration"},connectionIds:{value:r,setValue:s},search:{placeholder:"Search by cluster name",value:d,onChange:p},filters:e(ie,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,nowrap:!0,children:"Show only:"}),t(ge,{size:Et.S,label:"Selected",value:u.showOnlySelected,onChange:e=>h(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:T,isFetching:v,leftColumn:{width:"35%",header:e(ie,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ie,{$gap:8,children:[t(ee,{size:te.XS,children:"Clusters"}),t(ce,{label:m.length,status:Pe.Unknown})]}),e(ie,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,align:"right",children:"Selected clusters"}),t(ce,{label:`${r.length}/${m.length}`,status:Pe.Unknown})]})]}),list:m.map(e=>t(Xs,{title:e.name,isChecked:r.includes(e.id),onClick:()=>g(e.id),onCheckboxChange:()=>g(e.id)},e.id))},rightColumn:{width:"65%",header:t(ee,{size:te.XS,children:"Configurations"}),list:[t(ge,{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:C.rollout?.automaticRolloutDisabled||!1,onChange:e=>x("rollout.automaticRolloutDisabled",e),size:Et.S},"automatic-rollout-disabled")]}})},eu=e=>{const t=[{id:"type",title:nt.TYPE,label:e.destinationType.displayName},{id:"status",title:nt.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?nt.DISABLED:nt.ENABLED}}],n=Fe(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:nt.MONITORS,label:n}),e.name&&t.push({id:"name",title:nt.NAME,label:e.name}),t},tu=({onClose:i,destinationId:r})=>{const s=v(),{isK8s:c}=S(),{destinationsApi:u}=qr(),{selectedStreamName:h}=it(),{items:m,refetch:g}=u.useDestinations(),{data:f,loading:b}=u.useDestinationCategories(),{activeForm:y,loadDestination:C,validateFormData:x,genericForm:w}=Zr();a(()=>{g()},[]);const T=p(null),[k,I]=l(!1),[N,E]=l(!1),[$,O]=l(null),A=k&&!!w?.isFormDirty,R=o(()=>en(m,h),[m,h]),D=o(()=>R?.find(e=>Wt(e)===r),[r,R]),P=f?.destinationCategories?.categories??null;a(()=>{D&&P&&C(D,P)},[D,P]);const _=o(()=>D&&P?tn(P,D):[],[D,P]),L=d(()=>{D&&I(!0)},[D]),F=d(()=>{D&&P&&(C(D,P),I(!1))},[D,P,C]),z=d(()=>{A?O("close"):i()},[A,i]),M=d(()=>{A?O("cancel"):F()},[A,F]),X=d(()=>{const e=$;O(null),"close"===e?(F(),i()):F()},[$,F,i]),B=d(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=x();e||(await u.update(D.id,Me(t)),I(!1))}},[D,x,u]),U=d(()=>{D&&E(!0)},[D]),V=d(async()=>{D&&(await u.remove(D.id),i())},[D,u,i]);if(!D)return null;const{icon:H,iconSrc:j}=wt(D.destinationType.type),G=((e,t)=>{const n=[],i=Zt(e,t),o=i.map(e=>({name:e.key,value:e.value})),a=Fe(e.exportedSignals);let l=[];const r=()=>{l.length&&(n.push({kind:"cells",id:`cells-${n.length}`,items:l}),l=[])};return i.forEach(({key:e,name:i,value:s})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:p,componentProperties:u,hideFromReadData:h,customReadDataLabels:m}=c||{};if(h?.length&&Qt(h,a,o))return;const{type:g}=kt(u,{type:""}),f=d||"password"===g;if(m?.length)m.forEach(({condition:t,...n},i)=>{t==s&&l.push({id:`${e}-custom-${i}`,title:n.title,label:n.value})});else if(s)if(f)l.push({id:e,title:i,label:new Array(10).fill("•").join("")});else{if(p===jt.MultiInput){const t=kt(s,null);if(Array.isArray(t)&&t.length)return r(),void n.push({kind:"list",id:e,title:i,items:t.map((t,n)=>({id:`${e}-${n}`,label:String(t)}))})}if(p===jt.KeyValuePair){const t=kt(s,null);if(Array.isArray(t)&&t.length)return r(),void n.push({kind:"pairs",id:e,title:i,items:t.map((t,n)=>{const i=t&&"object"==typeof t?t:{};return{id:`${e}-${n}`,title:null!=i.key?String(i.key):"",label:null!=i.value?String(i.value):""}})})}l.push({id:e,title:i,label:s})}else l.push({id:e,title:i,label:"-"})}),r(),n})(D,_);return e(n,{children:[t(Xt,{isOpen:!0,header:{icon:H,iconSrc:j,title:D.name||D.destinationType.displayName,onClose:z,actions:[{id:"edit-destination-btn-edit",label:Ft.EDIT,icon:yl,active:k,onClick:L},{id:"edit-destination-btn-delete",label:Ft.DELETE,icon:ml,color:s.v2.colors.red[500],active:N,onClick:U}]},footer:{actions:k?[{"data-id":"edit-destination-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:M},...y?.option.testConnectionSupported&&c?[{"data-id":"edit-destination-btn-test-connection",label:Ft.TEST_CONNECTION,variant:Ie.Secondary,onClick:()=>T.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:B}]:[]},children:t(le,{$padding:"4px 12px 12px",children:b?t(ft,{$height:"50vh",children:t(St,{withSpinner:!0})}):k&&y?t(uc,{ref:T,isEdit:!0}):t(ae,{$gap:16,children:e(Gt,{bgTint:"1000",children:[e(Gt,{bgTint:"900",children:[c&&t(Yt,{conditions:D.conditions||[]}),t(Gt,{bgTint:"800",cellsPerRow:2,items:eu(D)})]}),!!G.length&&t(Gt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:G.map(e=>"cells"===e.kind?t(Gt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(Gt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(Vr,{target:"destination",isOpen:N,onClose:()=>E(!1),onApprove:V}),t(Ur,{isOpen:null!==$,onClose:()=>O(null),onApprove:X})]})},nu=(e,t)=>{const n=[{id:"type",title:nt.TYPE,label:t.label},{id:"status",title:nt.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?nt.DISABLED:nt.ENABLED}}];return e.ruleName&&n.push({id:"name",title:nt.NAME,label:e.ruleName}),e.profileName&&n.push({id:"profile",title:nt.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&n.push({id:"notes",title:nt.NOTES,label:e.notes}),n},iu=({onClose:i,ruleId:r})=>{const s=v(),{addNotification:c}=nn(),{isK8s:p,platformType:u,version:h}=S(),m=Je(u,h),{instrumentationRulesApi:g}=qr(),{items:f,refetch:b}=g.useRules(),{selectedOption:y,loadRule:C,validateFormData:x,genericForm:w}=Qr();a(()=>{b()},[]);const[T,k]=l(!1),[I,N]=l(!1),[E,$]=l(null),O=T&&!!w?.isFormDirty,{options:A}=g.useRuleTypes(),R=o(()=>A.length?A:It,[A]),D=o(()=>f?.find(e=>Wt(e)===r),[r,f]),P=o(()=>R.find(({type:e})=>e===D?.type)??null,[R,D?.type]),_=o(()=>qe(P?.supportedLanguages),[P?.supportedLanguages]);a(()=>{D&&P&&C(D,P)},[D,P]);const L=d(()=>{if(D){if(!D.mutable)return void c({type:Pe.Warning,title:Ke.FORBIDDEN,message:Ke.CANNOT_EDIT_RULE,crdType:Nt.InstrumentationRule,target:D.ruleId,hideFromHistory:!0});k(!0)}},[D,c]),F=d(()=>{D&&P&&(C(D,P),k(!1))},[D,P,C]),z=d(()=>{O?$("close"):i()},[O,i]),M=d(()=>{O?$("cancel"):F()},[O,F]),X=d(()=>{const e=E;$(null),"close"===e?(F(),i()):F()},[E,F,i]),B=d(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=x();e||(await g.update(D.ruleId,t,D.type),k(!1))}},[D,x,g]),U=d(()=>{if(D){if(!D.mutable)return void c({type:Pe.Warning,title:Ke.FORBIDDEN,message:Ke.CANNOT_DELETE_RULE,crdType:Nt.InstrumentationRule,target:D.ruleId,hideFromHistory:!0});N(!0)}},[D,c]),V=d(async()=>{D&&(await g.remove(D.ruleId,D.type),i())},[D,g,i]);if(!D||!P)return null;const H=(j=D,G=P,G?.fields?.length?Ht(j,G.fields,{skipComponentTypes:[jt.SourceScopes]}):[]);var j,G;return e(n,{children:[t(Xt,{isOpen:!0,header:{icon:an(D.type),title:P.label,onClose:z,actions:[{id:"edit-rule-btn-edit",label:Ft.EDIT,icon:yl,active:T,onClick:L},{id:"edit-rule-btn-delete",label:Ft.DELETE,icon:ml,color:s.v2.colors.red[500],active:I,onClick:U}]},footer:{actions:T?[{"data-id":"edit-rule-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:M},{"data-id":"edit-rule-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:B}]:[]},children:t(le,{$padding:"4px 12px 12px",children:T&&y?t(Cc,{}):t(ae,{$gap:16,children:e(Gt,{bgTint:"1000",children:[p&&t(Yt,{conditions:D.conditions||[]}),t(Gt,{bgTint:"800",cellsPerRow:2,items:nu(D,P)}),m&&t(Or,{readOnly:!0,scopes:D.sourceScopes??null}),P.type===Ye.CustomInstrumentation&&!!D.customInstrumentations?.[We.Php]?.length&&t(De,{status:Pe.Warning,message:Ke.PHP_CUSTOM_INSTRUMENTATION_RESTART,fullWidth:!0}),!!H.length&&t(Gt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:qp(H)}),!!_.length&&t(Gt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Gt,{bgTint:"800",children:t(ie,{$gap:12,$wrap:"wrap",children:_.map(e=>t(on,{label:et(e),leftIcon:Qe(e),flex:_.length>1?"0.5":"1"},e))})})})]})})})}),t(Vr,{target:"instrumentation rule",isOpen:I,onClose:()=>N(!1),onApprove:V}),t(Ur,{isOpen:null!==E,onClose:()=>$(null),onApprove:X})]})};var ou;(e=>{e.Overview="overview",e.Pods="pods",e.Libraries="libraries",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"})(ou||(ou={}));const au=({collapseIsDefaultOpen:e,isJumpToTarget:n,onClickRestartPod:i,namespace:a,podName:l,nodeName:r,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:p,children:u})=>{const{formatDurationAgo:h}=ln(),{platformType:m,version:g}=S(),f=rn(m,g),b=sn(!!n),v=o(()=>({title:l,icon:Vl,withCopy:!0}),[l]),y=o(()=>{const e=[],t=cn(c);t&&e.push(t);const n=cn(d,zl,"health");n&&e.push(n);const i=cn(p,Hl,"health");return i&&e.push(i),e},[c,d,p]),C=o(()=>i?[{id:`restart-pod-${l}`,icon:Bl,label:Ft.RESTART_POD,onClick:()=>i(a,l)}]:void 0,[i,a,l]),x=o(()=>[{id:"nodeName",title:nt.NODE,label:r,withCopy:!0},{id:"age",title:nt.AGE,label:s?h(s,{style:"short"}):f?nt.NOT_RUNNING:nt.UNKNOWN_VALUE,labelTooltip:s||(f?void 0:nt.START_TIME_UNAVAILABLE)}],[r,s,h,f]);return t("div",{ref:b,children:t(Gt,{bgTint:"900",richTitle:v,badges:y,dropDataActions:C,items:x,withCollapse:!0,collapseIsDefaultOpen:e,children:u})})},lu=b.div`
533
537
  display: flex;
534
538
  align-items: center;
535
539
  justify-content: space-between;
@@ -537,7 +541,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
537
541
  padding: ${({$noPadding:e})=>e?"0":"12px"};
538
542
  border-radius: 12px;
539
543
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
540
- `,Op=({podsOdigosHealthStatus:n,pods:i,noPadding:a})=>{const l=pn(n?.status),r=Ut(n?.name),s=n?.message,{totalPodsCount:c,odigosHealthyPodsCount:d,k8sHealthyPodsCount:p}=o(()=>({totalPodsCount:i?.length||0,odigosHealthyPodsCount:i?.reduce((e,t)=>e+(t.odigosHealthStatus?.status===dn.Success?1:0),0)||0,k8sHealthyPodsCount:i?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===dn.Success?1:0),0)||0}),[i]);return i?.length&&n&&l?e(Ep,{$noPadding:a,children:[t(Vt,{invertColors:!0,hideBackground:!0,status:l,title:r,subTitle:s}),e(ie,{$gap:8,children:[t(Ap,{label:nt.PODS,count:c}),t(Ap,{label:nt.ODIGOS_HEALTHY,icon:hl,count:d,total:c}),t(Ap,{label:nt.KUBERNETES_HEALTHY,icon:yl,count:p,total:c})]})]}):null},$p=b.div`
544
+ `,ru=({podsOdigosHealthStatus:n,pods:i,noPadding:a})=>{const l=pn(n?.status),r=Ut(n?.name),s=n?.message,{totalPodsCount:c,odigosHealthyPodsCount:d,k8sHealthyPodsCount:p}=o(()=>({totalPodsCount:i?.length||0,odigosHealthyPodsCount:i?.reduce((e,t)=>e+(t.odigosHealthStatus?.status===dn.Success?1:0),0)||0,k8sHealthyPodsCount:i?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===dn.Success?1:0),0)||0}),[i]);return i?.length&&n&&l?e(lu,{$noPadding:a,children:[t(Vt,{invertColors:!0,hideBackground:!0,status:l,title:r,subTitle:s}),e(ie,{$gap:8,children:[t(cu,{label:nt.PODS,count:c}),t(cu,{label:nt.ODIGOS_HEALTHY,icon:zl,count:d,total:c}),t(cu,{label:nt.KUBERNETES_HEALTHY,icon:Hl,count:p,total:c})]})]}):null},su=b.div`
541
545
  display: flex;
542
546
  flex-direction: column;
543
547
  justify-content: center;
@@ -548,7 +552,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
548
552
  width: fit-content;
549
553
  border-radius: 8px;
550
554
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
551
- `,Ap=({count:n,total:i,label:o,icon:a})=>{const l=v(),r=void 0===i?void 0:n===i?l.v2.colors.green[500]:l.v2.colors.red[500];return e($p,{children:[e(ie,{$gap:0,$alignItems:"flex-end",children:[t(ee,{size:te.L,color:r,weight:500,nowrap:!0,children:n}),void 0!==i&&t(ee,{size:te.S,color:r,weight:500,nowrap:!0,children:`/${i}`})]}),e(ie,{$alignItems:"center",$gap:4,children:[a&&t(a,{size:16}),t(ee,{size:te.XXXS,nowrap:!0,children:o})]})]})},Rp=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===un.PID)??e.identifyingAttributes?.find(({name:e})=>e===un.VPID);return t?.value??null};var Dp;(e=>{e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"})(Dp||(Dp={}));const Pp=({overrideProcessNum:n,healthy:i,healthStatus:r,identifyingAttributes:s,instrumentations:c,isJumpToTarget:d})=>{const p=v(),[u,h]=l(Dp.IdentifyingAttributes),m=sn(!!d),{tabOptions:g,firstTabValue:f,bothTabsDisabled:b}=o(()=>{const e=c?.some(e=>!1===e.healthy),n=[{value:Dp.IdentifyingAttributes,label:nt.IDENTIFYING_ATTRIBUTES,disabled:!s?.length,selectedBgColor:p.v2.colors.purple[500]},{value:Dp.InstrumentationLibraries,label:nt.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(Cl,{...e,fill:p.v2.colors.red[500]}):void 0,disabled:!c?.length,selectedBgColor:p.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]);a(()=>{f&&h(f)},[f]);const y=o(()=>{switch(u){case Dp.IdentifyingAttributes:return t(ae,{children:s?.map((e,n)=>t(zp,{label:e.name,value:e.value},`attr-${n}-${e.name}`))});case Dp.InstrumentationLibraries:return t(ae,{children:c?.map((e,n)=>t(zp,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${n}-${e.name}`))});default:return null}},[u,s,c]),C=o(()=>Rp({overrideProcessNum:n,identifyingAttributes:s}),[n,s]);return t("div",{ref:m,children:e(Gt,{bgTint:"800",richTitle:{title:C?`${nt.PROCESS} ${nt.PID(C)}`:nt.PROCESS_FALLBACK_NAME},renderOnRightSide:t(ee,{color:i?ne.Success:ne.Error,size:te.XXXS,children:r?.message}),badges:[{key:"odigos-healthy",status:i?Pe.Success:Pe.Error,leftIcon:hl,label:i?nt.HEALTHY:nt.NOT_HEALTHY,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}],withCollapse:!b,collapseIsDefaultOpen:d,children:[!b&&t(ve,{options:g,selected:u,setSelected:h}),!b&&y]})})},_p=b.div`
555
+ `,cu=({count:n,total:i,label:o,icon:a})=>{const l=v(),r=void 0===i?void 0:n===i?l.v2.colors.green[500]:l.v2.colors.red[500];return e(su,{children:[e(ie,{$gap:0,$alignItems:"flex-end",children:[t(ee,{size:te.L,color:r,weight:500,nowrap:!0,children:n}),void 0!==i&&t(ee,{size:te.S,color:r,weight:500,nowrap:!0,children:`/${i}`})]}),e(ie,{$alignItems:"center",$gap:4,children:[a&&t(a,{size:16}),t(ee,{size:te.XXXS,nowrap:!0,children:o})]})]})},du=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===un.PID)??e.identifyingAttributes?.find(({name:e})=>e===un.VPID);return t?.value??null};var pu;(e=>{e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"})(pu||(pu={}));const uu=({overrideProcessNum:n,healthy:i,healthStatus:r,identifyingAttributes:s,instrumentations:c,isJumpToTarget:d})=>{const p=v(),[u,h]=l(pu.IdentifyingAttributes),m=sn(!!d),{tabOptions:g,firstTabValue:f,bothTabsDisabled:b}=o(()=>{const e=c?.some(e=>!1===e.healthy),n=[{value:pu.IdentifyingAttributes,label:nt.IDENTIFYING_ATTRIBUTES,disabled:!s?.length,selectedBgColor:p.v2.colors.purple[500]},{value:pu.InstrumentationLibraries,label:nt.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(jl,{...e,fill:p.v2.colors.red[500]}):void 0,disabled:!c?.length,selectedBgColor:p.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]);a(()=>{f&&h(f)},[f]);const y=o(()=>{switch(u){case pu.IdentifyingAttributes:return t(ae,{children:s?.map((e,n)=>t(bu,{label:e.name,value:e.value},`attr-${n}-${e.name}`))});case pu.InstrumentationLibraries:return t(ae,{children:c?.map((e,n)=>t(bu,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${n}-${e.name}`))});default:return null}},[u,s,c]),C=o(()=>du({overrideProcessNum:n,identifyingAttributes:s}),[n,s]);return t("div",{ref:m,children:e(Gt,{bgTint:"800",richTitle:{title:C?`${nt.PROCESS} ${nt.PID(C)}`:nt.PROCESS_FALLBACK_NAME},renderOnRightSide:t(ee,{color:i?ne.Success:ne.Error,size:te.XXXS,children:r?.message}),badges:[{key:"odigos-healthy",status:i?Pe.Success:Pe.Error,leftIcon:zl,label:i?nt.HEALTHY:nt.NOT_HEALTHY,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}],withCollapse:!b,collapseIsDefaultOpen:d,children:[!b&&t(ve,{options:g,selected:u,setSelected:h}),!b&&y]})})},hu=b.div`
552
556
  display: flex;
553
557
  align-items: ${({$withHealthBadge:e})=>e?"center":"flex-start"};
554
558
  gap: 8px;
@@ -557,23 +561,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
557
561
  &:hover {
558
562
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
559
563
  }
560
- `,Lp=b(ee)`
564
+ `,mu=b(ee)`
561
565
  flex: 0 0 ${({$withHealthBadge:e})=>e?"auto":"30%"};
562
- `,Fp=b(ee)`
566
+ `,gu=b(ee)`
563
567
  flex: 1 1 auto;
564
568
  min-width: 0;
565
- `,Mp=b(ie)`
569
+ `,fu=b(ie)`
566
570
  flex: 1 1 auto;
567
571
  justify-content: flex-end;
568
572
  min-width: 0;
569
- `,zp=({label:n,value:i,isStandardLibrary:o,healthy:a,message:l})=>{const r="boolean"==typeof a;return e(_p,{$withHealthBadge:r,children:[t(Lp,{size:te.XXS,color:ne.Secondary,$withHealthBadge:r,children:n}),i&&t(Fp,{size:te.XXS,color:ne.Primary,align:"right",children:i}),(o||r)&&e(Mp,{children:[o&&t(ce,{status:Pe.Info,label:nt.STANDARD,textSize:te.XXXS,invertColors:!0}),r&&e(ie,{$gap:4,children:[l&&t(Fp,{size:te.XXXS,color:ne.Error,align:"right",children:l}),t(ce,{status:a?Pe.Success:Pe.Error,label:a?nt.HEALTHY:nt.NOT_HEALTHY,leftIcon:hl,textSize:te.XXXS,invertColors:!0,tooltip:l??void 0})]})]})]})},Xp=h(null),Bp=({value:e,children:n})=>t(Xp.Provider,{value:e,children:n}),Up=({podContainers:e,sourceContainers:n,jumpToTarget:i})=>{const a=e??[],l=o(()=>({title:nt.CONTAINERS,titleSize:te.XS,badge:{label:a.length}}),[a.length]),r=o(()=>{const e=new Map;return n?.forEach(t=>e.set(t.containerName,t)),e},[n]);return t(Gt,{bgTint:"800",richTitle:l,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ae,{$gap:8,children:a.map(e=>{const n=i?.containerName===e.containerName;return t(Hp,{...e,language:hn(r.get(e.containerName)),jumpToTarget:n?i:null},`pod-container-${e.containerName}`)})})})},Vp=b.div`
573
+ `,bu=({label:n,value:i,isStandardLibrary:o,healthy:a,message:l})=>{const r="boolean"==typeof a;return e(hu,{$withHealthBadge:r,children:[t(mu,{size:te.XXS,color:ne.Secondary,$withHealthBadge:r,children:n}),i&&t(gu,{size:te.XXS,color:ne.Primary,align:"right",children:i}),(o||r)&&e(fu,{children:[o&&t(ce,{status:Pe.Info,label:nt.STANDARD,textSize:te.XXXS,invertColors:!0}),r&&e(ie,{$gap:4,children:[l&&t(gu,{size:te.XXXS,color:ne.Error,align:"right",children:l}),t(ce,{status:a?Pe.Success:Pe.Error,label:a?nt.HEALTHY:nt.NOT_HEALTHY,leftIcon:zl,textSize:te.XXXS,invertColors:!0,tooltip:l??void 0})]})]})]})},vu=h(null),yu=({value:e,children:n})=>t(vu.Provider,{value:e,children:n}),Cu=({podContainers:e,sourceContainers:n,jumpToTarget:i})=>{const a=e??[],l=o(()=>({title:nt.CONTAINERS,titleSize:te.XS,badge:{label:a.length}}),[a.length]),r=o(()=>{const e=new Map;return n?.forEach(t=>e.set(t.containerName,t)),e},[n]);return t(Gt,{bgTint:"800",richTitle:l,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ae,{$gap:8,children:a.map(e=>{const n=i?.containerName===e.containerName;return t(xu,{...e,language:hn(r.get(e.containerName)),jumpToTarget:n?i:null},`pod-container-${e.containerName}`)})})})},Su=b.div`
570
574
  display: flex;
571
575
  flex-direction: column;
572
576
  gap: 12px;
573
577
  padding: 8px 12px;
574
578
  border-radius: 8px;
575
579
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
576
- `,Hp=({language:n,containerName:i,otelDistroName:a,runningStartedTime:l,started:r,ready:s,restartCount:c,isCrashLoop:d,waitingReasonEnum:p,waitingMessage:u,odigosHealthStatus:h,k8sHealthStatus:m,processes:g,jumpToTarget:f})=>{const b=!!f,v=b&&!f?.processPid,{formatDurationAgo:y}=ln(),{platformType:C,version:x}=S(),w=rn(C,x),T=sn(v),k=o(()=>({title:i,icon:n?mn(n):Sl,iconWithWrapper:!0}),[i,n]),I=o(()=>{const e=[],t=cn({status:a?dn.Success:dn.Disabled,reasonEnum:a?nt.INSTRUMENTED_WITH_DISTRO(a):nt.UNINSTRUMENTED,message:""});t&&e.push(t);const n=cn(h,hl,"health");n&&e.push(n);const i=cn(m,yl,"health");return i&&e.push(i),e},[m,h,a]),N=o(()=>{const e=[{id:"runningTime",title:nt.RUNNING_TIME,label:l?y(l,{style:"short"}):w?nt.NOT_RUNNING:nt.UNKNOWN_VALUE,labelTooltip:l?`${nt.RUNNING_TIME_TOOLTIP}. (${l})`:w?nt.RUNNING_TIME_TOOLTIP:nt.START_TIME_UNAVAILABLE},{id:"blank",spacer:!0},{id:"started",badge:{status:r?Pe.Success:Pe.Disabled,leftIcon:r?Za:Qa,label:r?nt.STARTED:nt.NOT_STARTED,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:s?Pe.Success:Pe.Disabled,leftIcon:s?Za:Qa,label:s?nt.READY:nt.NOT_READY,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}}];return d&&e.push({id:"isCrashLoop",badge:{status:Pe.Error,leftIcon:Qa,label:nt.CRASHLOOP,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}}),e.push({id:"restartCount",title:nt.RESTARTS,badge:{status:c?Pe.Error:void 0,label:c||0,textSize:te.XXXS}}),e},[l,y,r,s,d,c,w]),E=o(()=>u?Ut(p):"",[u,p]);return t("div",{ref:T,children:e(Gt,{bgTint:"750",richTitle:k,badges:I,items:N,withCollapse:!0,collapseIsDefaultOpen:b,children:[u&&t(Vp,{children:e(ie,{$gap:10,$alignItems:"center",children:[t(on,{variant:gn.Pink,leftIcon:yl,label:E}),t(ee,{size:te.XXXS,color:ne.Error,children:u})]})}),(g??[]).map((e,n)=>{const o=n+1,a=b&&(l=f,r=e,!!l?.processPid&&Rp({identifyingAttributes:r.identifyingAttributes})===l.processPid);var l,r;return t(Pp,{...e,overrideProcessNum:o,isJumpToTarget:a},`pod-container-${i}-process-${o}`)})]})})},jp=({podName:e,namespace:n,hasRestarted:i})=>{const a=o(()=>({title:nt.DEBUG_COMMANDS,titleSize:te.XS}),[]),l=o(()=>[{label:nt.GET_POD_YAML,value:`kubectl get pod ${e} -n ${n} -o yaml`},{label:nt.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${n}`},{label:nt.GET_POD_LOGS,value:`kubectl logs ${e} -n ${n}${i?" -p":""}`}],[e,n,i]);return t(Gt,{bgTint:"800",richTitle:a,withCollapse:!0,children:l.map(({label:e,value:n})=>t(fn,{bgTint:"700",label:e,value:n},e))})},Gp=({source:i,onClickRestartPod:a})=>{const{jumpToTarget:l}=(()=>{const e=m(Xp);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e})(),r=l?.tab===Ip.Pods?l:null,s=i?.pods??[],c=s.length>0,d=o(()=>s.some(e=>e.containers?.some(e=>e.restartCount&&e.restartCount>0)),[s]),p=o(()=>({title:nt.PODS,badge:{label:s.length}}),[s.length]);return t(ae,{$gap:12,children:c?e(n,{children:[t(Op,{podsOdigosHealthStatus:i.podsOdigosHealthStatus,pods:s}),t(Gt,{bgTint:"1000",richTitle:p,children:s.map(n=>{const o=r?.podName===n.podName,l=o&&!r?.containerName;return e(Np,{...n,namespace:i.id.namespace,onClickRestartPod:a,collapseIsDefaultOpen:o,isJumpToTarget:l,children:[t(jp,{podName:n.podName,namespace:i.id.namespace,hasRestarted:d}),t(Up,{podContainers:n.containers,sourceContainers:i.containers,jumpToTarget:o?r:null})]},`pod-${n.podName}`)})})]}):t(ft,{$height:"70vh",children:t($e,{title:nt.NO_RUNNING_PODS,subTitle:nt.NO_RUNNING_PODS_SUBTITLE})})})},Wp="user",Kp=({source:n})=>{const i=o(()=>n.serviceName||n.id.name,[n]),{sourcesApi:a}=Sr(),{data:l,loading:r,refetch:s}=a.usePeerSources({serviceName:i},{fetchPolicy:"network-only"}),c=l?.peerSources??null;return!c||r?t(ft,r?{$height:"70vh",children:t(St,{withSpinner:!0})}:{$height:"70vh",children:t($e,{subTitle:nt.COULD_NOT_FETCH_PEER_SOURCES})}):e(ie,{$gap:16,$alignItems:"flex-start",children:[t(Yp,{icon:xl,title:nt.INBOUND,subTitle:nt.INBOUND_DESCRIPTION(i),onRefresh:s,items:c?.inbound??[]}),t(Yp,{icon:wl,title:nt.OUTBOUND,subTitle:nt.OUTBOUND_DESCRIPTION(i),onRefresh:s,items:c?.outbound??[]})]})},Yp=({icon:n,title:i,subTitle:a,onRefresh:r,items:s})=>{const[c,d]=l(""),p=o(()=>s.filter(e=>e.serviceName.toLowerCase().includes(c.toLowerCase())),[s,c]);return e(Gt,{bgTint:"1000",richTitle:{icon:n,title:i,titleSize:te.XS,subTitle:a,subTitleSize:te.XXXS,badge:{label:s.length}},actions:[{id:"refresh",type:bn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,leftIcon:fl,onClick:r}}],children:[t(vn,{value:c,onChange:d,width:"100%"}),t(yn,{height:"calc(100vh - 284px)",gap:4,elements:p.length||c?!p.length&&c?[t(ft,{$height:"50vh",children:t($e,{icon:n,title:nt.NO_RESULTS,subTitle:nt.NO_RESULTS_FOR_FILTER(c)})},"no-results")]:p.map(e=>t(qp,{...e},`${i}-${e.serviceName}`)):[t(ft,{$height:"50vh",children:t($e,{icon:n,title:`No ${i} connections yet`,subTitle:i===nt.INBOUND?nt.NO_INBOUND_CONNECTIONS_DESCRIPTION:nt.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},Jp=b.div`
580
+ `,xu=({language:n,containerName:i,otelDistroName:a,runningStartedTime:l,started:r,ready:s,restartCount:c,isCrashLoop:d,waitingReasonEnum:p,waitingMessage:u,odigosHealthStatus:h,k8sHealthStatus:m,processes:g,jumpToTarget:f})=>{const b=!!f,v=b&&!f?.processPid,{formatDurationAgo:y}=ln(),{platformType:C,version:x}=S(),w=rn(C,x),T=sn(v),k=o(()=>({title:i,icon:n?mn(n):Gl,iconWithWrapper:!0}),[i,n]),I=o(()=>{const e=[],t=cn({status:a?dn.Success:dn.Disabled,reasonEnum:a?nt.INSTRUMENTED_WITH_DISTRO(a):nt.UNINSTRUMENTED,message:""});t&&e.push(t);const n=cn(h,zl,"health");n&&e.push(n);const i=cn(m,Hl,"health");return i&&e.push(i),e},[m,h,a]),N=o(()=>{const e=[{id:"runningTime",title:nt.RUNNING_TIME,label:l?y(l,{style:"short"}):w?nt.NOT_RUNNING:nt.UNKNOWN_VALUE,labelTooltip:l?`${nt.RUNNING_TIME_TOOLTIP}. (${l})`:w?nt.RUNNING_TIME_TOOLTIP:nt.START_TIME_UNAVAILABLE},{id:"blank",spacer:!0},{id:"started",badge:{status:r?Pe.Success:Pe.Disabled,leftIcon:r?wl:Tl,label:r?nt.STARTED:nt.NOT_STARTED,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:s?Pe.Success:Pe.Disabled,leftIcon:s?wl:Tl,label:s?nt.READY:nt.NOT_READY,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}}];return d&&e.push({id:"isCrashLoop",badge:{status:Pe.Error,leftIcon:Tl,label:nt.CRASHLOOP,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}}),e.push({id:"restartCount",title:nt.RESTARTS,badge:{status:c?Pe.Error:void 0,label:c||0,textSize:te.XXXS}}),e},[l,y,r,s,d,c,w]),E=o(()=>u?Ut(p):"",[u,p]);return t("div",{ref:T,children:e(Gt,{bgTint:"750",richTitle:k,badges:I,items:N,withCollapse:!0,collapseIsDefaultOpen:b,children:[u&&t(Su,{children:e(ie,{$gap:10,$alignItems:"center",children:[t(on,{variant:gn.Pink,leftIcon:Hl,label:E}),t(ee,{size:te.XXXS,color:ne.Error,children:u})]})}),(g??[]).map((e,n)=>{const o=n+1,a=b&&(l=f,r=e,!!l?.processPid&&du({identifyingAttributes:r.identifyingAttributes})===l.processPid);var l,r;return t(uu,{...e,overrideProcessNum:o,isJumpToTarget:a},`pod-container-${i}-process-${o}`)})]})})},wu=({podName:e,namespace:n,hasRestarted:i})=>{const a=o(()=>({title:nt.DEBUG_COMMANDS,titleSize:te.XS}),[]),l=o(()=>[{label:nt.GET_POD_YAML,value:`kubectl get pod ${e} -n ${n} -o yaml`},{label:nt.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${n}`},{label:nt.GET_POD_LOGS,value:`kubectl logs ${e} -n ${n}${i?" -p":""}`}],[e,n,i]);return t(Gt,{bgTint:"800",richTitle:a,withCollapse:!0,children:l.map(({label:e,value:n})=>t(fn,{bgTint:"700",label:e,value:n},e))})},Tu=({source:i,onClickRestartPod:a})=>{const{jumpToTarget:l}=(()=>{const e=m(vu);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e})(),r=l?.tab===ou.Pods?l:null,s=i?.pods??[],c=s.length>0,d=o(()=>s.some(e=>e.containers?.some(e=>e.restartCount&&e.restartCount>0)),[s]),p=o(()=>({title:nt.PODS,badge:{label:s.length}}),[s.length]);return t(ae,{$gap:12,children:c?e(n,{children:[t(ru,{podsOdigosHealthStatus:i.podsOdigosHealthStatus,pods:s}),t(Gt,{bgTint:"1000",richTitle:p,children:s.map(n=>{const o=r?.podName===n.podName,l=o&&!r?.containerName;return e(au,{...n,namespace:i.id.namespace,onClickRestartPod:a,collapseIsDefaultOpen:o,isJumpToTarget:l,children:[t(wu,{podName:n.podName,namespace:i.id.namespace,hasRestarted:d}),t(Cu,{podContainers:n.containers,sourceContainers:i.containers,jumpToTarget:o?r:null})]},`pod-${n.podName}`)})})]}):t(ft,{$height:"70vh",children:t(Oe,{title:nt.NO_RUNNING_PODS,subTitle:nt.NO_RUNNING_PODS_SUBTITLE})})})},ku="user",Iu=({source:n})=>{const i=o(()=>n.serviceName||n.id.name,[n]),{sourcesApi:a}=qr(),{data:l,loading:r,refetch:s}=a.usePeerSources({serviceName:i},{fetchPolicy:"network-only"}),c=l?.peerSources??null;return!c||r?t(ft,r?{$height:"70vh",children:t(St,{withSpinner:!0})}:{$height:"70vh",children:t(Oe,{subTitle:nt.COULD_NOT_FETCH_PEER_SOURCES})}):e(ie,{$gap:16,$alignItems:"flex-start",children:[t(Nu,{icon:Wl,title:nt.INBOUND,subTitle:nt.INBOUND_DESCRIPTION(i),onRefresh:s,items:c?.inbound??[]}),t(Nu,{icon:Kl,title:nt.OUTBOUND,subTitle:nt.OUTBOUND_DESCRIPTION(i),onRefresh:s,items:c?.outbound??[]})]})},Nu=({icon:n,title:i,subTitle:a,onRefresh:r,items:s})=>{const[c,d]=l(""),p=o(()=>s.filter(e=>e.serviceName.toLowerCase().includes(c.toLowerCase())),[s,c]);return e(Gt,{bgTint:"1000",richTitle:{icon:n,title:i,titleSize:te.XS,subTitle:a,subTitleSize:te.XXXS,badge:{label:s.length}},actions:[{id:"refresh",type:bn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,leftIcon:Bl,onClick:r}}],children:[t(vn,{value:c,onChange:d,width:"100%"}),t(yn,{height:"calc(100vh - 284px)",gap:4,elements:p.length||c?!p.length&&c?[t(ft,{$height:"50vh",children:t(Oe,{icon:n,title:nt.NO_RESULTS,subTitle:nt.NO_RESULTS_FOR_FILTER(c)})},"no-results")]:p.map(e=>t($u,{...e},`${i}-${e.serviceName}`)):[t(ft,{$height:"50vh",children:t(Oe,{icon:n,title:`No ${i} connections yet`,subTitle:i===nt.INBOUND?nt.NO_INBOUND_CONNECTIONS_DESCRIPTION:nt.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},Eu=b.div`
577
581
  display: flex;
578
582
  align-items: center;
579
583
  justify-content: space-between;
@@ -587,9 +591,9 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
587
591
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
588
592
  }
589
593
  `}
590
- `,qp=({serviceName:n,isVirtual:i,nodeAttributes:a})=>{const l=Cn(e=>e.drawerEntityId),{items:r}=Sr().sourcesApi.useSources(),s=o(()=>r.find(e=>e.id.name===n||e.serviceName===n),[r,n]),c=o(()=>s&&JSON.stringify(Sn(s))!==JSON.stringify(Sn(l)),[s,l]),d=o(()=>{if(i){const e=Object.fromEntries((a??[]).map(({key:e,value:t})=>[e,t]));return[xn({serviceName:n,attributes:e})]}if(n?.toLowerCase()===Wp)return[Tl];const e=s?wn(s):void 0;return e?.length?e:[Sl]},[i,a,n,s]),p=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=Cn.getState();e(kn(Nt.Source)),t({namespace:s?.id.namespace??"",name:s?.id.name??"",kind:s?.id.kind??"",region:s?.id.region??""})}:void 0;return e(Jp,{onClick:p,$withClick:!!p,children:[e(ie,{$gap:8,children:[t(Tn,{icons:d}),t(ee,{size:te.XXS,children:n})]}),i&&t(ce,{status:Pe.Info,label:nt.VIRTUAL,textSize:te.XXXS,invertColors:!0,tooltip:nt.VIRTUAL_TOOLTIP})]})},Zp=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}},Qp=({source:n})=>{const i=v(),{k8sManifestApi:r}=Sr(),[s,c]=l(!0),[d,u]=l(void 0),[h,m]=l(!0),[g,f]=l(void 0),[b,y]=l(!0),[C,S]=l({}),x=p(r);x.current=r,a(()=>{x.current.fetch({namespace:n.id.namespace,kind:n.id.kind,name:n.id.name}).then(({data:e})=>u(Zp(e))).finally(()=>c(!1)),x.current.fetch({namespace:n.id.namespace,kind:In.InstrumentationConfig,name:`${n.id.kind}-${n.id.name}`.toLowerCase()}).then(({data:e})=>f(Zp(e))).finally(()=>m(!1))},[n.id.namespace,n.id.kind,n.id.name]);const w=o(()=>(n.pods??[]).map(e=>e.podName).join(","),[n.pods]);a(()=>{if(Object.keys(C).length>0)return;const e=w?w.split(","):[];if(0===e.length)return S({}),void y(!1);let t=!1;return y(!0),Promise.all(e.map(async e=>{const{data:t}=await x.current.fetch({namespace:n.id.namespace,kind:In.Pod,name:e});return[e,Zp(t)]})).then(e=>{t||S(Object.fromEntries(e))}).finally(()=>{t||y(!1)}),()=>{t=!0}},[C,w,n.id.namespace]);const T=o(()=>[{label:nt.DESCRIBE_POD,value:`kubectl describe ${n.id.kind} ${n.id.name} -n ${n.id.namespace}`},{label:nt.GET_POD_YAML,value:`kubectl get ${n.id.kind} ${n.id.name} -n ${n.id.namespace} -o yaml`},{label:nt.GET_POD_YAML,value:`kubectl get ${In.InstrumentationConfig} ${n.id.kind}-${n.id.name} -n ${n.id.namespace} -o yaml`}],[n.id.kind,n.id.name,n.id.namespace]);return e(Gt,{bgTint:"1000",children:[t(Gt,{bgTint:"900",richTitle:{icon:kl,title:nt.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:T.map(({label:e,value:n},i)=>t(fn,{label:e,value:n},`debug-cmd-${i}-${e}`))}),s?t(re,{size:1}):t(gr,{bgTint:"800",codeBgColor:i.v2.colors.silver[900],title:`${n.id.kind} YAML`,yaml:d}),h?t(re,{size:1}):t(gr,{bgTint:"800",codeBgColor:i.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:g}),n.pods?.map(e=>b?t(re,{size:1},e.podName):t(gr,{bgTint:"800",codeBgColor:i.v2.colors.silver[900],title:`Pod ${e.podName} YAML`,yaml:C[e.podName]},e.podName))]})},eu=({title:n,children:i})=>e(ae,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,children:n}),i]}),tu=({source:n})=>{const i=o(()=>{const[e,t]=En(n.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[n]);return t(eu,{title:nt.THROUGHPUT_LAST_10_SECONDS,children:e(ie,{$alignItems:"flex-end",$gap:4,children:[t(ee,{size:te.L,children:i.value}),t(ee,{size:te.XS,variant:Ot.Span,children:i.units})]})})},nu=({source:n})=>{const{CopyButton:i}=_t();return t(eu,{title:nt.NAMESPACE,children:e(ie,{children:[t(on,{variant:gn.Blue,label:n.id.namespace}),t(i,{value:n.id.namespace,size:Ct.XS})]})})},iu=({source:n})=>{const{CopyButton:i}=_t(),o=n.id.region;return o?t(eu,{title:nt.REGION,children:e(ie,{children:[t(on,{variant:gn.Blue,label:o}),t(i,{value:o,size:Ct.XS})]})}):null},ou=({source:e})=>{const n=e.markedForInstrumentation?.markedForInstrumentation??!1;return t(eu,{title:nt.ENABLED,children:t(ie,{children:t(on,{variant:n?gn.Green:gn.Default,label:n?nt.ENABLED:nt.DISABLED})})})},au=({source:e,label:n})=>t(eu,{title:nt.KIND,children:t(ie,{children:t(on,{variant:gn.Blue,label:n||e.id.kind})})}),lu=({source:n})=>{const{CopyButton:i}=_t();return t(eu,{title:nt.NAME,children:e(ie,{children:[t(on,{variant:gn.Blue,label:n.id.name}),t(i,{value:n.id.name,size:Ct.XS})]})})},ru=({source:n})=>{const{CopyButton:i}=_t(),o=n.serviceName||n.id.name;return t(eu,{title:nt.SERVICE_NAME,children:e(ie,{children:[t(on,{variant:gn.Blue,label:o}),t(i,{value:o,size:Ct.XS})]})})},su=({source:n})=>{const{isK8s:i,isConnector:a}=S(),l=o(()=>Nn(n.id.kind),[n.id.kind]);return t(Gt,{children:e(ie,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[i&&t(tu,{source:n}),t(ou,{source:n}),a&&t(iu,{source:n}),i&&t(nu,{source:n}),t(au,{source:n,label:l}),t(lu,{source:n}),!i&&t(ru,{source:n})]})})},cu=({source:e})=>e.pods?.length&&e.podsOdigosHealthStatus?t(Gt,{bgTint:"900",children:t(Op,{podsOdigosHealthStatus:e.podsOdigosHealthStatus,pods:e.pods,noPadding:!0})}):null,du=({source:e})=>{const n=o(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?On(e.workloadOdigosHealthStatus.status):Pe.Unknown,title:Ut(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return n?t(Vt,{...n,width:"100%"}):null},pu=h(null),uu=b.div`
594
+ `,$u=({serviceName:n,isVirtual:i,nodeAttributes:a})=>{const l=Cn(e=>e.drawerEntityId),{items:r}=qr().sourcesApi.useSources(),s=o(()=>r.find(e=>e.id.name===n||e.serviceName===n),[r,n]),c=o(()=>s&&JSON.stringify(Sn(s))!==JSON.stringify(Sn(l)),[s,l]),d=o(()=>{if(i){const e=Object.fromEntries((a??[]).map(({key:e,value:t})=>[e,t]));return[xn({serviceName:n,attributes:e})]}if(n?.toLowerCase()===ku)return[Yl];const e=s?wn(s):void 0;return e?.length?e:[Gl]},[i,a,n,s]),p=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=Cn.getState();e(kn(Nt.Source)),t({namespace:s?.id.namespace??"",name:s?.id.name??"",kind:s?.id.kind??"",region:s?.id.region??""})}:void 0;return e(Eu,{onClick:p,$withClick:!!p,children:[e(ie,{$gap:8,children:[t(Tn,{icons:d}),t(ee,{size:te.XXS,children:n})]}),i&&t(ce,{status:Pe.Info,label:nt.VIRTUAL,textSize:te.XXXS,invertColors:!0,tooltip:nt.VIRTUAL_TOOLTIP})]})},Ou=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}},Au=({source:n})=>{const i=v(),{k8sManifestApi:r}=qr(),[s,c]=l(!0),[d,u]=l(void 0),[h,m]=l(!0),[g,f]=l(void 0),[b,y]=l(!0),[C,S]=l({}),x=p(r);x.current=r,a(()=>{x.current.fetch({namespace:n.id.namespace,kind:n.id.kind,name:n.id.name}).then(({data:e})=>u(Ou(e))).finally(()=>c(!1)),x.current.fetch({namespace:n.id.namespace,kind:In.InstrumentationConfig,name:`${n.id.kind}-${n.id.name}`.toLowerCase()}).then(({data:e})=>f(Ou(e))).finally(()=>m(!1))},[n.id.namespace,n.id.kind,n.id.name]);const w=o(()=>(n.pods??[]).map(e=>e.podName).join(","),[n.pods]);a(()=>{if(Object.keys(C).length>0)return;const e=w?w.split(","):[];if(0===e.length)return S({}),void y(!1);let t=!1;return y(!0),Promise.all(e.map(async e=>{const{data:t}=await x.current.fetch({namespace:n.id.namespace,kind:In.Pod,name:e});return[e,Ou(t)]})).then(e=>{t||S(Object.fromEntries(e))}).finally(()=>{t||y(!1)}),()=>{t=!0}},[C,w,n.id.namespace]);const T=o(()=>[{label:nt.DESCRIBE_POD,value:`kubectl describe ${n.id.kind} ${n.id.name} -n ${n.id.namespace}`},{label:nt.GET_POD_YAML,value:`kubectl get ${n.id.kind} ${n.id.name} -n ${n.id.namespace} -o yaml`},{label:nt.GET_POD_YAML,value:`kubectl get ${In.InstrumentationConfig} ${n.id.kind}-${n.id.name} -n ${n.id.namespace} -o yaml`}],[n.id.kind,n.id.name,n.id.namespace]);return e(Gt,{bgTint:"1000",children:[t(Gt,{bgTint:"900",richTitle:{icon:Jl,title:nt.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:T.map(({label:e,value:n},i)=>t(fn,{label:e,value:n},`debug-cmd-${i}-${e}`))}),s?t(re,{size:1}):t(Hr,{bgTint:"800",codeBgColor:i.v2.colors.silver[900],title:`${n.id.kind} YAML`,yaml:d}),h?t(re,{size:1}):t(Hr,{bgTint:"800",codeBgColor:i.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:g}),n.pods?.map(e=>b?t(re,{size:1},e.podName):t(Hr,{bgTint:"800",codeBgColor:i.v2.colors.silver[900],title:`Pod ${e.podName} YAML`,yaml:C[e.podName]},e.podName))]})},Ru=({title:n,children:i})=>e(ae,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,children:n}),i]}),Du=({source:n})=>{const i=o(()=>{const[e,t]=En(n.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[n]);return t(Ru,{title:nt.THROUGHPUT_LAST_10_SECONDS,children:e(ie,{$alignItems:"flex-end",$gap:4,children:[t(ee,{size:te.L,children:i.value}),t(ee,{size:te.XS,variant:$t.Span,children:i.units})]})})},Pu=({source:n})=>{const{CopyButton:i}=_t();return t(Ru,{title:nt.NAMESPACE,children:e(ie,{children:[t(on,{variant:gn.Blue,label:n.id.namespace}),t(i,{value:n.id.namespace,size:Ct.XS})]})})},_u=({source:n})=>{const{CopyButton:i}=_t(),o=n.id.region;return o?t(Ru,{title:nt.REGION,children:e(ie,{children:[t(on,{variant:gn.Blue,label:o}),t(i,{value:o,size:Ct.XS})]})}):null},Lu=({source:e})=>{const n=e.markedForInstrumentation?.markedForInstrumentation??!1;return t(Ru,{title:nt.ENABLED,children:t(ie,{children:t(on,{variant:n?gn.Green:gn.Default,label:n?nt.ENABLED:nt.DISABLED})})})},Fu=({source:e,label:n})=>t(Ru,{title:nt.KIND,children:t(ie,{children:t(on,{variant:gn.Blue,label:n||e.id.kind})})}),zu=({source:n})=>{const{CopyButton:i}=_t();return t(Ru,{title:nt.NAME,children:e(ie,{children:[t(on,{variant:gn.Blue,label:n.id.name}),t(i,{value:n.id.name,size:Ct.XS})]})})},Mu=({source:n})=>{const{CopyButton:i}=_t(),o=n.serviceName||n.id.name;return t(Ru,{title:nt.SERVICE_NAME,children:e(ie,{children:[t(on,{variant:gn.Blue,label:o}),t(i,{value:o,size:Ct.XS})]})})},Xu=({source:n})=>{const{isK8s:i,isConnector:a}=S(),l=o(()=>Nn(n.id.kind),[n.id.kind]);return t(Gt,{children:e(ie,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[i&&t(Du,{source:n}),t(Lu,{source:n}),a&&t(_u,{source:n}),i&&t(Pu,{source:n}),t(Fu,{source:n,label:l}),t(zu,{source:n}),!i&&t(Mu,{source:n})]})})},Bu=({source:e})=>e.pods?.length&&e.podsOdigosHealthStatus?t(Gt,{bgTint:"900",children:t(ru,{podsOdigosHealthStatus:e.podsOdigosHealthStatus,pods:e.pods,noPadding:!0})}):null,Uu=({source:e})=>{const n=o(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?$n(e.workloadOdigosHealthStatus.status):Pe.Unknown,title:Ut(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return n?t(Vt,{...n,width:"100%"}):null},Vu=h(null),Hu=b.div`
591
595
  position: relative;
592
- `,hu=({children:e})=>{const n=p(null);return t(uu,{ref:n,children:t(pu.Provider,{value:n,children:e})})},mu=b.div`
596
+ `,ju=({children:e})=>{const n=p(null);return t(Hu,{ref:n,children:t(Vu.Provider,{value:n,children:e})})},Gu=b.div`
593
597
  position: fixed;
594
598
  top: ${({$coords:e})=>e.top}px;
595
599
  right: ${({$coords:e})=>e.right}px;
@@ -603,25 +607,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
603
607
  padding: 12px 16px;
604
608
  border-radius: 12px;
605
609
  background-color: ${({theme:e})=>e.v2.colors.silver[750]};
606
- `,gu=b.div`
610
+ `,Wu=b.div`
607
611
  display: flex;
608
612
  align-items: flex-end;
609
613
  justify-content: space-between;
610
614
  gap: 8px;
611
- `,fu=b.div`
615
+ `,Ku=b.div`
612
616
  flex: 1;
613
- `,bu=({width:n,onClose:i,onSave:o,saveTooltip:a,onDelete:r,deleteTooltip:s,title:c,subTitle:d,warning:p,children:u,pushButtonsWith:h})=>{const f=v(),b=m(pu),[y,C]=l(null);return $n(b??{current:null},i),g(()=>{const e=b?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[b]),y?Vr(e(mu,{$coords:y,$width:n,"data-ignore-outside-click":"true",children:[e(ae,{$gap:4,children:[t(ee,{size:te.XXS,children:c}),t(ee,{size:te.XXXS,color:ne.Secondary,children:d})]}),e(gu,{children:[t(fu,{children:u}),e(ie,{$gap:8,$width:"fit-content",$margin:`0 0 ${h||0} 0`,children:[t(Te,{variant:Ie.Secondary,onClick:r,leftIcon:Va,tooltip:s,hideTooltipIcon:!0,iconSize:16,size:ke.S,textColor:f.v2.colors.red[500]}),t(Te,{variant:Ie.Primary,onClick:o,leftIcon:il,tooltip:a,hideTooltipIcon:!0,iconSize:16,size:ke.S})]})]}),t("div",{children:t(De,{status:Pe.Warning,message:p})})]}),document.body):null},vu=({language:n,overridden:i,onOverride:a,defaultValues:r})=>{const{tier:s}=S(),{formData:c,handleFormChange:d,resetFormData:p}=qt(r),u=o(()=>{if(!n)return[];const e=An[n].community,t=s===Rn.Onprem?An[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]=l(!1),[g,f]=l(!1),b=()=>{h||(g&&p(),f(e=>!e))};return e(ie,{$gap:4,$alignItems:"center",children:[i?t(ce,{status:Pe.Info,invertColors:!0,label:nt.OVERIDDEN}):null,e(hu,{children:[t(Be,{text:nt.OVERRIDE_OTEL_DISTRO_NAME,children:t(yt,{icon:Ka,onClick:b})}),g&&t(bu,{width:"500px",onClose:b,onSave:async()=>{m(!0),await a(c),m(!1),b()},saveTooltip:nt.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await a({otelDistroName:null}),m(!1),b()},deleteTooltip:nt.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:nt.OVERRIDE_OTEL_DISTRO_NAME,subTitle:nt.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:nt.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(vt,{label:nt.OTEL_DISTRO_NAME,options:u,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},yu=({overridden:n,onOverride:i,defaultValues:a,originalValues:r})=>{const{addNotification:s}=nn(),{formData:c,handleFormChange:d,resetFormData:p}=qt(a),u=o(()=>Dn.map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})),[]),[h,m]=l(!1),[g,f]=l(!1),b=()=>{h||(g&&p(),f(e=>!e))};return e(ie,{children:[n?t(ce,{status:Pe.Info,invertColors:!0,label:nt.OVERIDDEN}):null,e(hu,{children:[t(Be,{text:nt.OVERRIDE_RUNTIME_DETAILS,children:t(yt,{icon:Ka,onClick:b})}),g&&t(bu,{width:"500px",onClose:b,onSave:async()=>{!c.version||Pn(c.version)?(m(!0),await i(c),m(!1),b()):s({type:Pe.Warning,message:Ke.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:nt.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await i({language:null,version:""}),m(!1),b()},deleteTooltip:nt.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:nt.OVERRIDE_RUNTIME_DETAILS,subTitle:nt.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:nt.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(ie,{$gap:8,children:[t(vt,{label:nt.LANGUAGE,options:u,values:c.language?[c.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${r.language||"none"}`}),t(Ne,{label:nt.RUNTIME_VERSION,placeholder:nt.VERSION_PLACEHOLDER,value:c.version,onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${r.version||"none"}`})]})})]})]})},Cu=b.div`
617
+ `,Yu=({width:n,onClose:i,onSave:o,saveTooltip:a,onDelete:r,deleteTooltip:s,title:c,subTitle:d,warning:p,children:u,pushButtonsWith:h})=>{const f=v(),b=m(Vu),[y,C]=l(null);return On(b??{current:null},i),g(()=>{const e=b?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[b]),y?ys(e(Gu,{$coords:y,$width:n,"data-ignore-outside-click":"true",children:[e(ae,{$gap:4,children:[t(ee,{size:te.XXS,children:c}),t(ee,{size:te.XXXS,color:ne.Secondary,children:d})]}),e(Wu,{children:[t(Ku,{children:u}),e(ie,{$gap:8,$width:"fit-content",$margin:`0 0 ${h||0} 0`,children:[t(Te,{variant:Ie.Secondary,onClick:r,leftIcon:ml,tooltip:s,hideTooltipIcon:!0,iconSize:16,size:ke.S,textColor:f.v2.colors.red[500]}),t(Te,{variant:Ie.Primary,onClick:o,leftIcon:El,tooltip:a,hideTooltipIcon:!0,iconSize:16,size:ke.S})]})]}),t("div",{children:t(De,{status:Pe.Warning,message:p})})]}),document.body):null},Ju=({language:n,overridden:i,onOverride:a,defaultValues:r})=>{const{tier:s}=S(),{formData:c,handleFormChange:d,resetFormData:p}=qt(r),u=o(()=>{if(!n)return[];const e=An[n].community,t=s===Rn.Onprem?An[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]=l(!1),[g,f]=l(!1),b=()=>{h||(g&&p(),f(e=>!e))};return e(ie,{$gap:4,$alignItems:"center",children:[i?t(ce,{status:Pe.Info,invertColors:!0,label:nt.OVERIDDEN}):null,e(ju,{children:[t(Be,{text:nt.OVERRIDE_OTEL_DISTRO_NAME,children:t(yt,{icon:yl,onClick:b})}),g&&t(Yu,{width:"500px",onClose:b,onSave:async()=>{m(!0),await a(c),m(!1),b()},saveTooltip:nt.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await a({otelDistroName:null}),m(!1),b()},deleteTooltip:nt.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:nt.OVERRIDE_OTEL_DISTRO_NAME,subTitle:nt.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:nt.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(vt,{label:nt.OTEL_DISTRO_NAME,options:u,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},qu=({overridden:n,onOverride:i,defaultValues:a,originalValues:r})=>{const{addNotification:s}=nn(),{formData:c,handleFormChange:d,resetFormData:p}=qt(a),u=o(()=>Dn.map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})),[]),[h,m]=l(!1),[g,f]=l(!1),b=()=>{h||(g&&p(),f(e=>!e))};return e(ie,{children:[n?t(ce,{status:Pe.Info,invertColors:!0,label:nt.OVERIDDEN}):null,e(ju,{children:[t(Be,{text:nt.OVERRIDE_RUNTIME_DETAILS,children:t(yt,{icon:yl,onClick:b})}),g&&t(Yu,{width:"500px",onClose:b,onSave:async()=>{!c.version||Pn(c.version)?(m(!0),await i(c),m(!1),b()):s({type:Pe.Warning,message:Ke.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:nt.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await i({language:null,version:""}),m(!1),b()},deleteTooltip:nt.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:nt.OVERRIDE_RUNTIME_DETAILS,subTitle:nt.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:nt.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(ie,{$gap:8,children:[t(vt,{label:nt.LANGUAGE,options:u,values:c.language?[c.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${r.language||"none"}`}),t(Ne,{label:nt.RUNTIME_VERSION,placeholder:nt.VERSION_PLACEHOLDER,value:c.version??"",onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${r.version||"none"}`})]})})]})]})},Zu=b.div`
614
618
  display: flex;
615
619
  flex-direction: column;
616
620
  gap: 10px;
617
621
  padding: 10px 12px 10px 20px;
618
622
  border-radius: 8px;
619
623
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
620
- `,Su=b.div`
624
+ `,Qu=b.div`
621
625
  display: flex;
622
626
  flex-wrap: wrap;
623
627
  gap: 12px 24px;
624
- `,xu=({title:n,children:i})=>e(ae,{$gap:4,children:[t(ee,{size:te.XXXS,color:ne.Secondary,children:n}),i]}),wu=({processes:n})=>{const i=o(()=>[...n].sort((e,t)=>e.pid-t.pid),[n]);return i.length?e(ae,{$gap:6,children:[t(ee,{size:te.XXXS,color:ne.Secondary,children:`${nt.PROCESSES} (${i.length})`}),i.map(n=>{const i=n.exe?.trim()||null,o=n.cmdline?.trim()||null;return e(Cu,{children:[t(Su,{children:t(xu,{title:nt.PROCESS_PID,children:t(ee,{size:te.XS,children:String(n.pid)})})}),i?t(fn,{label:nt.EXECUTABLE,value:i,bgTint:"900"}):null,o&&o!==i?t(fn,{label:nt.COMMAND,value:o,bgTint:"900"}):null]},n.pid)})]}):null},Tu=b.div`
628
+ `,eh=({title:n,children:i})=>e(ae,{$gap:4,children:[t(ee,{size:te.XXXS,color:ne.Secondary,children:n}),i]}),th=({processes:n})=>{const i=o(()=>[...n].sort((e,t)=>e.pid-t.pid),[n]);return i.length?e(ae,{$gap:6,children:[t(ee,{size:te.XXXS,color:ne.Secondary,children:`${nt.PROCESSES} (${i.length})`}),i.map(n=>{const i=n.exe?.trim()||null,o=n.cmdline?.trim()||null;return e(Zu,{children:[t(Qu,{children:t(eh,{title:nt.PROCESS_PID,children:t(ee,{size:te.XS,children:String(n.pid)})})}),i?t(fn,{label:nt.EXECUTABLE,value:i,bgTint:"900"}):null,o&&o!==i?t(fn,{label:nt.COMMAND,value:o,bgTint:"900"}):null]},n.pid)})]}):null},nh=b.div`
625
629
  display: flex;
626
630
  flex-direction: column;
627
631
  align-self: stretch;
@@ -629,14 +633,14 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
629
633
  padding: 8px 12px;
630
634
  border-radius: 8px;
631
635
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
632
- `,ku=b.div`
636
+ `,ih=b.div`
633
637
  display: flex;
634
638
  align-items: center;
635
639
  justify-content: center;
636
640
  padding: 8px;
637
641
  border-radius: 10px;
638
642
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
639
- `,Iu=e=>{if(!e)return _n.Unknown;const t=e.trim().toLowerCase();return{go:_n.Go,golang:_n.Go,javascript:_n.JavaScript,js:_n.JavaScript,node:_n.JavaScript,nodejs:_n.JavaScript,typescript:_n.JavaScript,python:_n.Python,java:_n.Java,dotnet:_n.DotNet,csharp:_n.CSharp,php:_n.Php,ruby:_n.Ruby,rust:_n.Rust,swift:_n.Swift,elixir:_n.Elixir}[t]??_n.Unknown},Nu=({source:n})=>{const i=v(),{isK8s:a,isVm:l}=S(),{sourcesApi:r}=Sr(),s=n.instrumentationReport,c=n.sourceConfig,d=l?s?.processes:null,p=o(()=>!(!c?.runtimeOverride?.language&&!c?.runtimeOverride?.version),[c]),u=o(()=>{const e=Iu(s?.runtimeLanguage);return e!==_n.Unknown?e:n.runtimeInfo?.detectedLanguages?.[0]??_n.Unknown},[s?.runtimeLanguage,n.runtimeInfo?.detectedLanguages]),h=s?.runtimeVersion?.trim()||"",m=o(()=>{const e=Iu(c?.runtimeOverride?.language);return{language:e!==_n.Unknown?e:u,version:c?.runtimeOverride?.version?.trim()||h||void 0}},[c,u,h]),g=o(()=>!!c?.distroOverride?.otelDistroName,[c]),f=o(()=>({otelDistroName:c?.distroOverride?.otelDistroName||void 0}),[c]),b=o(()=>{const{language:e,version:t}=m;return e!==_n.Unknown||t?e!==_n.Unknown&&t?`${e} • ${t}`:e!==_n.Unknown?e:t||null:null},[m]),y=!b&&!p&&"Instrumenting"===s?.state,C=o(()=>y||m.language===_n.Unknown?Sl:mn(m.language),[y,m.language]),x=o(()=>{const e=s?.state??"",t=s?.instrumented||"Instrumented"===e,n=c?.distroOverride?.otelDistroName?.trim()||s?.sdkType?.trim();return"Instrumenting"===e?{status:Pe.Loading,label:Ut(s?.progressStage||e)||e}:"NotImplemented"===e||"Unsupported"===e?{status:Pe.Disabled,leftIcon:Qa,label:Ut(e)||e}:"Error"===e?{status:Pe.Error,leftIcon:Qa,label:"Error"}:t?{status:Pe.Success,leftIcon:Za,label:n?`Instrumented | ${n}`:"Instrumented"}:{status:Pe.Disabled,leftIcon:Qa,label:nt.UNINSTRUMENTED}},[s,c]),w=e=>r.update(n.id,{...g?f:{},...p?{language:m.language!==_n.Unknown?m.language:void 0,version:m.version}:{},...e});return a?null:s?t(Gt,{bgTint:"1000",richTitle:{title:nt.INSTRUMENTATION,tooltip:nt.INSTRUMENTATION_DESCRIPTION,badge:{label:1}},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ae,{$gap:8,children:e(Tu,{children:[e(ie,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(ie,{$gap:8,$alignItems:"center",children:[t(ku,{children:t(C,{size:24,fill:y||m.language===_n.Unknown?i.v2.colors.grey[400]:void 0})}),t(ee,{children:n.id.name}),y?t(on,{variant:gn.Loader,label:nt.DETECTING_RUNTIME_INFO}):b?t(on,{variant:gn.Blue,label:b}):null,t(yu,{overridden:p,onOverride:w,defaultValues:{language:m.language!==_n.Unknown?m.language:void 0,version:m.version||""},originalValues:{language:u!==_n.Unknown?u:void 0,version:h}})]}),e(ie,{$gap:8,$alignItems:"center",children:[t(ce,{...x,textSize:te.XXXS}),t(vu,{language:m.language!==_n.Unknown?m.language:null,overridden:g,onOverride:w,defaultValues:f})]})]}),d?.length?t(wu,{processes:d}):null]})})}):null},Eu="100%",Ou=b(ie)`
643
+ `,oh=e=>{if(!e)return _n.Unknown;const t=e.trim().toLowerCase();return{go:_n.Go,golang:_n.Go,javascript:_n.JavaScript,js:_n.JavaScript,node:_n.JavaScript,nodejs:_n.JavaScript,typescript:_n.JavaScript,python:_n.Python,java:_n.Java,dotnet:_n.DotNet,csharp:_n.CSharp,php:_n.Php,ruby:_n.Ruby,rust:_n.Rust,swift:_n.Swift,elixir:_n.Elixir}[t]??_n.Unknown},ah=({source:n})=>{const i=v(),{isK8s:a,isVm:l}=S(),{sourcesApi:r}=qr(),s=n.instrumentationReport,c=n.sourceConfig,d=l?s?.processes:null,p=o(()=>!(!c?.runtimeOverride?.language&&!c?.runtimeOverride?.version),[c]),u=o(()=>{const e=oh(s?.runtimeLanguage);return e!==_n.Unknown?e:n.runtimeInfo?.detectedLanguages?.[0]??_n.Unknown},[s?.runtimeLanguage,n.runtimeInfo?.detectedLanguages]),h=s?.runtimeVersion?.trim()||"",m=o(()=>{const e=oh(c?.runtimeOverride?.language);return{language:e!==_n.Unknown?e:u,version:c?.runtimeOverride?.version?.trim()||h||void 0}},[c,u,h]),g=o(()=>!!c?.distroOverride?.otelDistroName,[c]),f=o(()=>({otelDistroName:c?.distroOverride?.otelDistroName||void 0}),[c]),b=o(()=>{const{language:e,version:t}=m;return e!==_n.Unknown||t?e!==_n.Unknown&&t?`${e} • ${t}`:e!==_n.Unknown?e:t||null:null},[m]),y=!b&&!p&&"Instrumenting"===s?.state,C=o(()=>y||m.language===_n.Unknown?Gl:mn(m.language),[y,m.language]),x=o(()=>{const e=s?.state??"",t=s?.instrumented||"Instrumented"===e,n=c?.distroOverride?.otelDistroName?.trim()||s?.sdkType?.trim();return"Instrumenting"===e?{status:Pe.Loading,label:Ut(s?.progressStage||e)||e}:"NotImplemented"===e||"Unsupported"===e?{status:Pe.Disabled,leftIcon:Tl,label:Ut(e)||e}:"Error"===e?{status:Pe.Error,leftIcon:Tl,label:"Error"}:t?{status:Pe.Success,leftIcon:wl,label:n?`Instrumented | ${n}`:"Instrumented"}:{status:Pe.Disabled,leftIcon:Tl,label:nt.UNINSTRUMENTED}},[s,c]),w=e=>r.update(n.id,{...g?f:{},...p?{language:m.language!==_n.Unknown?m.language:void 0,version:m.version}:{},...e});return a?null:s?t(Gt,{bgTint:"1000",richTitle:{title:nt.INSTRUMENTATION,tooltip:nt.INSTRUMENTATION_DESCRIPTION,badge:{label:1}},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ae,{$gap:8,children:e(nh,{children:[e(ie,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(ie,{$gap:8,$alignItems:"center",children:[t(ih,{children:t(C,{size:24,fill:y||m.language===_n.Unknown?i.v2.colors.grey[400]:void 0})}),t(ee,{children:n.id.name}),y?t(on,{variant:gn.Loader,label:nt.DETECTING_RUNTIME_INFO}):b?t(on,{variant:gn.Blue,label:b}):null,t(qu,{overridden:p,onOverride:w,defaultValues:{language:m.language!==_n.Unknown?m.language:void 0,version:m.version||""},originalValues:{language:u!==_n.Unknown?u:void 0,version:h}})]}),e(ie,{$gap:8,$alignItems:"center",children:[t(ce,{...x,textSize:te.XXXS}),t(Ju,{language:m.language!==_n.Unknown?m.language:null,overridden:g,onOverride:w,defaultValues:f})]})]}),d?.length?t(th,{processes:d}):null]})})}):null},lh="100%",rh=b(ie)`
640
644
  @media (max-width: 1099px) {
641
645
  flex-direction: column;
642
646
 
@@ -644,12 +648,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
644
648
  width: 100%;
645
649
  }
646
650
  }
647
- `,$u=(e,t)=>e?e.toLowerCase().includes(t.toLowerCase())?Ut(e):`${t} ${Ut(e)}`:t,Au=b(ie)`
651
+ `,sh=(e,t)=>e?e.toLowerCase().includes(t.toLowerCase())?Ut(e):`${t} ${Ut(e)}`:t,ch=b(ie)`
648
652
  width: fit-content;
649
653
  padding: 2px 6px;
650
654
  border-radius: 8px;
651
655
  background-color: ${({theme:e})=>e.v2.colors.silver[750]};
652
- `,Ru=({overview:n,status:i})=>{const o=v(),a=n?[{id:"applied",count:n.totalAgentAppliedPods,ok:n.agentAppliedOk,label:"Agent applied"},{id:"out-of-date",count:n.totalAgentOutOfDatePods,ok:n.agentOutOfDateOk,label:"Agent out of date"},{id:"not-applied",count:n.totalAgentNotAppliedPods,ok:n.agentNotAppliedOk,label:"No agent applied"}].filter(({count:e})=>e>0):[];return a.length?t(Au,{$gap:12,$wrap:"wrap",children:a.map(({id:a,count:l,ok:r,label:s})=>{const c=r?Pe.Success:i,d=Fn(c,o);return e(ie,{$gap:2,children:[t(d,{size:16,fill:Ln(o,c,"300")}),t(ee,{size:te.XXXS,color:ne.Secondary,children:`${l}/${n?.totalPods??0} ${s}`})]},a)})}):null},Du=({changedTime:e})=>{const{formatTimeAgo:n}=ln();return t(ee,{size:te.XXXS,color:ne.Disable,nowrap:!0,children:`Agent Assignment Updated · ${n(e)}`})},Pu=({source:n,onClickRollout:i,onClickRollback:a})=>{const l=n.rollout?.podsManifestInjectionStatus??n.conditions?.rollout,r=o(()=>{const{status:e,reasonEnum:o,message:a,actionItems:r}=l||{},s=pn(e);if(!s)return null;const c=$u(o,nt.ROLLOUT),d=a,p=(r??[]).flatMap(e=>[{"data-id":`rollout-action-${e.type}`,label:e.buttonText,hideTooltipIcon:!0,leftIcon:Il,onClick:i}]);return{status:s,title:c,subTitle:d,details:t(Ru,{overview:n.rollout?.podsManifestInjectionOverview,status:s}),actionDetails:n.rollout?.agentsMetaHashChangedTime?t(Du,{changedTime:n.rollout.agentsMetaHashChangedTime}):void 0,actionButtons:p}},[n.rollout,l,i]),s=o(()=>{const{status:e,reasonEnum:t,message:i,actionItems:o}=n.autoRollback?.autoRollbackStatus||{},l=pn(e);if(!l)return null;const r=$u(t,nt.ROLLBACK),s=i,c=(o??[]).flatMap(e=>[{"data-id":`rollback-action-${e.type}`,label:e.buttonText,hideTooltipIcon:!0,leftIcon:fl,onClick:a}]);return c.length||l===Pe.Success||c.push({"data-id":"rollback-action",label:nt.ROLLBACK,tooltip:"Recover the workload from the last rollback",hideTooltipIcon:!0,leftIcon:fl,onClick:a}),{status:l,title:r,subTitle:s,actionButtons:c}},[n,a]);return r||s?e(Ou,{$gap:12,$alignItems:"stretch",children:[r&&t(Vt,{invertColors:!0,slim:!0,width:s?"calc(60% - 6px)":Eu,...r}),s&&t(Vt,{invertColors:!0,slim:!0,width:r?"calc(40% - 6px)":Eu,...s})]}):null},_u=({source:e})=>{const{isK8s:n}=S(),{containers:i,containersRichTitle:a}=o(()=>{const t=e?.conditions?.runtimeDetection;return{containers:e?.containers??[],containersRichTitle:{title:n?`${e.id.kind} ${nt.CONTAINERS}`:nt.DETECTED_PROCESSES,tooltip:t?.message||(n?nt.DETECTED_CONTAINERS_DESCRIPTION:nt.DETECTED_PROCESSES_DESCRIPTION),badge:pn(t?.status)===Pe.Loading?{status:Pe.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,n]);return i.length?t(Gt,{bgTint:"1000",richTitle:a,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ae,{$gap:8,children:i.map(n=>n&&t(zu,{...n,sourceId:e.id},`source-container-${n.containerName}`))})}):null},Lu=b.div`
656
+ `,dh=({overview:n,status:i})=>{const o=v(),a=n?[{id:"applied",count:n.totalAgentAppliedPods,ok:n.agentAppliedOk,label:"Agent applied"},{id:"out-of-date",count:n.totalAgentOutOfDatePods,ok:n.agentOutOfDateOk,label:"Agent out of date"},{id:"not-applied",count:n.totalAgentNotAppliedPods,ok:n.agentNotAppliedOk,label:"No agent applied"}].filter(({count:e})=>e>0):[];return a.length?t(ch,{$gap:12,$wrap:"wrap",children:a.map(({id:a,count:l,ok:r,label:s})=>{const c=r?Pe.Success:i,d=Fn(c,o);return e(ie,{$gap:2,children:[t(d,{size:16,fill:Ln(o,c,"300")}),t(ee,{size:te.XXXS,color:ne.Secondary,children:`${l}/${n?.totalPods??0} ${s}`})]},a)})}):null},ph=({changedTime:e})=>{const{formatTimeAgo:n}=ln();return t(ee,{size:te.XXXS,color:ne.Disable,nowrap:!0,children:`Agent Assignment Updated · ${n(e)}`})},uh=({source:n,onClickRollout:i,onClickRollback:a})=>{const l=n.rollout?.podsManifestInjectionStatus??n.conditions?.rollout,r=o(()=>{const{status:e,reasonEnum:o,message:a,actionItems:r}=l||{},s=pn(e);if(!s)return null;const c=sh(o,nt.ROLLOUT),d=a,p=(r??[]).flatMap(e=>[{"data-id":`rollout-action-${e.type}`,label:e.buttonText,hideTooltipIcon:!0,leftIcon:ql,onClick:i}]);return{status:s,title:c,subTitle:d,details:t(dh,{overview:n.rollout?.podsManifestInjectionOverview,status:s}),actionDetails:n.rollout?.agentsMetaHashChangedTime?t(ph,{changedTime:n.rollout.agentsMetaHashChangedTime}):void 0,actionButtons:p}},[n.rollout,l,i]),s=o(()=>{const{status:e,reasonEnum:t,message:i,actionItems:o}=n.autoRollback?.autoRollbackStatus||{},l=pn(e);if(!l)return null;const r=sh(t,nt.ROLLBACK),s=i,c=(o??[]).flatMap(e=>[{"data-id":`rollback-action-${e.type}`,label:e.buttonText,hideTooltipIcon:!0,leftIcon:Bl,onClick:a}]);return c.length||l===Pe.Success||c.push({"data-id":"rollback-action",label:nt.ROLLBACK,tooltip:"Recover the workload from the last rollback",hideTooltipIcon:!0,leftIcon:Bl,onClick:a}),{status:l,title:r,subTitle:s,actionButtons:c}},[n,a]);return r||s?e(rh,{$gap:12,$alignItems:"stretch",children:[r&&t(Vt,{invertColors:!0,slim:!0,width:s?"calc(60% - 6px)":lh,...r}),s&&t(Vt,{invertColors:!0,slim:!0,width:r?"calc(40% - 6px)":lh,...s})]}):null},hh="Instrumented",mh=({source:e})=>{const{isK8s:n}=S(),{containers:i,containersRichTitle:a}=o(()=>{const t=e?.conditions?.runtimeDetection,i=n?`${e.id.kind} ${nt.CONTAINERS}`:nt.CONTAINERS;return{containers:e?.containers??[],containersRichTitle:{title:i,tooltip:t?.message||nt.DETECTED_CONTAINERS_DESCRIPTION,badge:pn(t?.status)===Pe.Loading?{status:Pe.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,n]);return i.length?t(Gt,{bgTint:"1000",richTitle:a,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ae,{$gap:8,children:i.map(n=>n&&t(vh,{...n,sourceId:e.id},`source-container-${n.containerName}`))})}):null},gh=b.div`
653
657
  display: flex;
654
658
  flex-direction: column;
655
659
  align-self: stretch;
@@ -657,26 +661,26 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
657
661
  padding: 8px 12px;
658
662
  border-radius: 8px;
659
663
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
660
- `,Fu=b.div`
664
+ `,fh=b.div`
661
665
  display: flex;
662
666
  align-items: center;
663
667
  justify-content: center;
664
668
  padding: 8px;
665
669
  border-radius: 10px;
666
670
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
667
- `,Mu=b.div`
671
+ `,bh=b.div`
668
672
  display: flex;
669
673
  flex-direction: column;
670
674
  gap: 12px;
671
675
  padding: 8px 12px;
672
676
  border-radius: 8px;
673
677
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
674
- `,zu=({sourceId:n,...i})=>{const{containerName:a,runtimeInfo:r,agentEnabled:s,overrides:c}=i,d=v(),{sourcesApi:p}=Sr(),[u,h]=l(!1),m=o(()=>!!c?.runtimeInfo?.language||!!c?.runtimeInfo?.runtimeVersion,[c]),g=o(()=>({language:hn(i),version:Mn(i)||void 0}),[i]),f=o(()=>!!c?.otelDistroName,[c]),b=o(()=>({otelDistroName:c?.otelDistroName||i.agentEnabled?.otelDistroName}),[c,i]),y=o(()=>!r&&!m,[r,m]),C=o(()=>y?Sl:mn(g.language),[y,g]),S=o(()=>{if(y)return"";const{language:e,version:t}=g;return`${e}${t?` • ${t}`:""}`},[y,g]),x=o(()=>y?{status:Pe.Loading,label:nt.WAITING_FOR_RUNTIME_DETECTION}:{status:s?.otelDistroName?Pe.Success:Pe.Disabled,leftIcon:s?.otelDistroName?Za:Qa,label:s?.otelDistroName?`Instrumented | ${s.otelDistroName}`:"Uninstrumented",tooltip:s?.agentEnabledStatus?.message},[y,s]),w=e=>p.update(n,{containerName:a,...f?b:{},...m?g:{},...null!=c?.allowConcurrentAgents?{allowConcurrentAgents:c.allowConcurrentAgents}:{},...e}),T=(s?.agentEnabledStatus?.actionItems??[]).flatMap(e=>{let t;if(e.type===zn.AllowConcurrentAgentsForContainer)t=!0;else{if(e.type!==zn.DisallowConcurrentAgentsForContainer)return[];t=!1}return[{type:e.type,label:e.buttonText,onClick:t?()=>h(!0):()=>w({allowConcurrentAgents:!1})}]}),k=o(()=>{const e=[];return i.agentConfig?.traces?.headSampling?.noisyOperations?.length&&e.push(nt.HEAD_SAMPLING),(i.collectorConfig?.tailSampling?.noisyOperations?.length||i.collectorConfig?.tailSampling?.highlyRelevantOperations?.length||i.collectorConfig?.tailSampling?.costReductionRules?.length)&&e.push(nt.TAIL_SAMPLING),e},[i]);return e(Lu,{children:[e(ie,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(ie,{$gap:8,$alignItems:"center",children:[t(Fu,{children:t(C,{size:24,fill:r?void 0:d.v2.colors.grey[400]})}),t(ee,{children:a}),t(on,S?{variant:gn.Blue,label:S}:{variant:gn.Loader,label:nt.DETECTING_RUNTIME_INFO}),t(yu,{overridden:m,onOverride:w,defaultValues:g,originalValues:{language:i.runtimeInfo?.language,version:i.runtimeInfo?.runtimeVersion||""}})]}),e(ie,{$gap:8,$alignItems:"center",children:[t(ce,{...x,textSize:te.XXXS}),t(vu,{language:g.language,overridden:f,onOverride:w,defaultValues:b})]})]}),s&&(!s.agentEnabled||T.length>0)&&!y?t(Mu,{children:e(ie,{$gap:10,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(ie,{$gap:10,$alignItems:"center",children:[t(on,{variant:gn.Pink,label:Ut(s.agentEnabledStatus?.reasonEnum)||nt.NO_AVAILABLE_AGENT}),t(ee,{size:te.XXXS,color:ne.Secondary,children:s?.agentEnabledStatus?.message})]}),T.map(e=>t(Te,{"data-id":`container-action-${e.type}`,label:e.label,variant:Ie.Secondary,size:ke.S,onClick:e.onClick},e.type))]})}):null,k.length>0&&t(Mu,{children:t(ie,{$gap:16,$wrap:"wrap",children:k.map((e,n)=>t(ce,{label:e,leftIcon:Za,status:Pe.Success,invertColors:!0,useSecondaryTone:!0},`${a}-rule-${n}`))})}),t(tt,{isOpen:u,title:"Run Odigos with other agents?",description:"Running multiple instrumentation agents in the same container is not recommended and may affect performance or reliability.",onClose:()=>h(!1),denyButton:{label:"Cancel",variant:Ie.Secondary,onClick:()=>h(!1)},approveButton:{label:"Run Odigos With Other Agents",variant:Ie.Primary,onClick:async()=>{await w({allowConcurrentAgents:!0}),h(!1)}}})]})},Xu=({source:n,onClickRollout:i,onClickRollback:a})=>{const{isK8s:l,platformType:r,version:s}=S(),c=o(()=>Xn(r,s)?Bt(Bn(n.conditions)):[],[r,s,n.conditions]);return e(ae,{$gap:12,children:[t(su,{source:n}),t(du,{source:n}),l&&t(Pu,{source:n,onClickRollout:i,onClickRollback:a}),!!c.length&&t(Yt,{conditions:c,title:nt.INSTRUMENTATION_LIFECYCLE}),l&&t(_u,{source:n}),!l&&t(Nu,{source:n}),l&&t(cu,{source:n})]})},Bu=({source:e})=>{const n=e.containers||[];return t(Gt,{bgTint:"1000",richTitle:{title:nt.INSTRUMENTED_LIBRARIES},children:n.length?n.map(e=>{const n=e.instrumentations||[];return t(Gt,{bgTint:"800",richTitle:{title:e.containerName,badge:{label:n.length}},withCollapse:!0,collapseIsDefaultOpen:!!n?.length,children:n?.length?t(ae,{children:n.map((e,n)=>t(zp,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${n}-${e.name}`))}):t($e,{title:"No libraries found"})},e.containerName)}):t($e,{title:"No containers found"})})},Uu=b(ae)`
678
+ `,vh=({sourceId:n,...i})=>{const{containerName:a,runtimeInfo:r,agentEnabled:s,overrides:c}=i,d=v(),{isK8s:p}=S(),{sourcesApi:u}=qr(),[h,m]=l(!1),g=o(()=>!!c?.runtimeInfo?.language||!!c?.runtimeInfo?.runtimeVersion,[c]),f=o(()=>({language:hn(i),version:zn(i)||""}),[i]),b=o(()=>!!c?.otelDistroName,[c]),y=o(()=>({otelDistroName:c?.otelDistroName||i.agentEnabled?.otelDistroName}),[c,i]),C=o(()=>!r&&!g,[r,g]),x=o(()=>C?Gl:mn(f.language),[C,f]),w=o(()=>{if(C)return"";const{language:e,version:t}=f;return`${e}${t?` • ${t}`:""}`},[C,f]),T=o(()=>{if(C)return{status:Pe.Loading,label:nt.WAITING_FOR_RUNTIME_DETECTION};const e=s?.otelDistroName?.trim(),t=p?!!e:!!s?.agentEnabled;return{status:t?Pe.Success:Pe.Disabled,leftIcon:t?wl:Tl,label:t?e?`${hh} | ${e}`:hh:"Uninstrumented",tooltip:s?.agentEnabledStatus?.message}},[C,s,p]),k=e=>u.update(n,{containerName:a,...b?y:{},...g?f:{},...null!=c?.allowConcurrentAgents?{allowConcurrentAgents:c.allowConcurrentAgents}:{},...e}),I=(s?.agentEnabledStatus?.actionItems??[]).flatMap(e=>{let t;if(e.type===Mn.AllowConcurrentAgentsForContainer)t=!0;else{if(e.type!==Mn.DisallowConcurrentAgentsForContainer)return[];t=!1}return[{type:e.type,label:e.buttonText,onClick:t?()=>m(!0):()=>k({allowConcurrentAgents:!1})}]}),N=o(()=>{const e=[];return i.agentConfig?.traces?.headSampling?.noisyOperations?.length&&e.push(nt.HEAD_SAMPLING),(i.collectorConfig?.tailSampling?.noisyOperations?.length||i.collectorConfig?.tailSampling?.highlyRelevantOperations?.length||i.collectorConfig?.tailSampling?.costReductionRules?.length)&&e.push(nt.TAIL_SAMPLING),e},[i]);return e(gh,{children:[e(ie,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(ie,{$gap:8,$alignItems:"center",children:[t(fh,{children:t(x,{size:24,fill:r?void 0:d.v2.colors.grey[400]})}),t(ee,{children:a}),t(on,w?{variant:gn.Blue,label:w}:{variant:gn.Loader,label:nt.DETECTING_RUNTIME_INFO}),t(qu,{overridden:g,onOverride:k,defaultValues:f,originalValues:{language:i.runtimeInfo?.language,version:i.runtimeInfo?.runtimeVersion||""}})]}),e(ie,{$gap:8,$alignItems:"center",children:[t(ce,{...T,textSize:te.XXXS}),t(Ju,{language:f.language,overridden:b,onOverride:k,defaultValues:y})]})]}),s&&(!s.agentEnabled||I.length>0)&&!C?t(bh,{children:e(ie,{$gap:10,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(ie,{$gap:10,$alignItems:"center",children:[t(on,{variant:gn.Pink,label:Ut(s.agentEnabledStatus?.reasonEnum)||nt.NO_AVAILABLE_AGENT}),t(ee,{size:te.XXXS,color:ne.Secondary,children:s?.agentEnabledStatus?.message})]}),I.map(e=>t(Te,{"data-id":`container-action-${e.type}`,label:e.label,variant:Ie.Secondary,size:ke.S,onClick:e.onClick},e.type))]})}):null,N.length>0&&t(bh,{children:t(ie,{$gap:16,$wrap:"wrap",children:N.map((e,n)=>t(ce,{label:e,leftIcon:wl,status:Pe.Success,invertColors:!0,useSecondaryTone:!0},`${a}-rule-${n}`))})}),t(tt,{isOpen:h,title:"Run Odigos with other agents?",description:"Running multiple instrumentation agents in the same container is not recommended and may affect performance or reliability.",onClose:()=>m(!1),denyButton:{label:"Cancel",variant:Ie.Secondary,onClick:()=>m(!1)},approveButton:{label:"Run Odigos With Other Agents",variant:Ie.Primary,onClick:async()=>{await k({allowConcurrentAgents:!0}),m(!1)}}})]})},yh=({source:n,onClickRollout:i,onClickRollback:a})=>{const{isK8s:l,platformType:r,version:s}=S(),c=o(()=>Xn(r,s)?Bt(Bn(n.conditions)):[],[r,s,n.conditions]);return e(ae,{$gap:12,children:[t(Xu,{source:n}),t(Uu,{source:n}),l&&t(uh,{source:n,onClickRollout:i,onClickRollback:a}),!!c.length&&t(Yt,{conditions:c,title:nt.INSTRUMENTATION_LIFECYCLE}),t(mh,{source:n}),!l&&!n.containers?.length&&t(ah,{source:n}),l&&t(Bu,{source:n})]})},Ch=({source:e})=>{const n=e.containers||[];return t(Gt,{bgTint:"1000",richTitle:{title:nt.INSTRUMENTED_LIBRARIES},children:n.length?n.map(e=>{const n=e.instrumentations||[];return t(Gt,{bgTint:"800",richTitle:{title:e.containerName,badge:{label:n.length}},withCollapse:!0,collapseIsDefaultOpen:!!n?.length,children:n?.length?t(ae,{children:n.map((e,n)=>t(bu,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${n}-${e.name}`))}):t(Oe,{title:"No libraries found"})},e.containerName)}):t(Oe,{title:"No containers found"})})},Sh=b(ae)`
675
679
  width: 100%;
676
680
  max-height: 320px;
677
681
  overflow-y: auto;
678
682
  gap: 8px;
679
- `,Vu=b(ie)`
683
+ `,xh=b(ie)`
680
684
  width: 100%;
681
685
  align-items: center;
682
686
  gap: 8px;
@@ -686,14 +690,14 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
686
690
  & > * {
687
691
  font-family: monospace !important;
688
692
  }
689
- `,Hu=({pendingModify:n,onClose:i,onConfirm:o})=>{const a=v();return t(tt,{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:i,denyButton:{variant:Ie.Secondary,label:"Cancel",onClick:i},approveButton:{variant:Ie.Primary,label:"Confirm",onClick:o},children:n&&e(Uu,{children:[n.add.map(n=>e(Vu,{children:[t(ce,{leftIcon:Ha,status:Pe.Success,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:te.XXS}),t(ee,{size:te.XS,color:ne.Primary,children:n})]},`add-${n}`)),n.remove.map(n=>e(Vu,{children:[t(ce,{leftIcon:Nl,status:Pe.Error,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:te.XXS}),t(ee,{size:te.XS,color:ne.Primary,children:n})]},`remove-${n}`))]})})};function ju(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 Gu(e){const t=Math.abs(e);return t>=1e9?`${Wu(e/1e9)}s`:t>=1e6?`${Wu(e/1e6)}ms`:t>=1e3?`${Wu(e/1e3)}μs`:String(Math.round(e))}function Wu(e){return e.toFixed(2).replace(/\.?0+$/,"")}function Ku(e){const t=[];for(let n=0;n<e.levels.length;n++){const i=e.levels[n];let o=0;for(let e=0;e+3<i.length;e+=4){const a=i[e],l=i[e+1],r=i[e+2],s=i[e+3],c=o+a;t.push({level:n,offset:c,size:l,self:r,nameIndex:s}),o=c+l}}return t}function Yu(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function Ju(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}function qu(e,t,n){return((e,t)=>{const n=[];for(let i=0;i<=t.level;i++){let o;for(const n of e)if(n.level===i&&t.offset>=n.offset&&t.offset+t.size<=n.offset+n.size){o=n;break}if(!o)return n;n.push(o)}return n})(t,n).map(t=>ju(e,t.nameIndex))}function Zu(e,t,n){if(0===n.length)return null;let i=null,o=null;for(let a=0;a<n.length;a++){const l=n[a];let r=null;for(const n of t)n.level===a&&ju(e,n.nameIndex)===l&&(i&&(n.offset<i.offset||n.offset+n.size>i.offset+i.size)||(!r||n.size>r.size)&&(r=n));if(!r)return null;i=r,o=r}return o}function Qu(e,t){const n=e.reduce((e,t)=>Math.max(e,t.level),t.level),i=new Map;for(const t of e){const e=i.get(t.level);e?e.push(t):i.set(t.level,[t])}const o=[t];for(let e=t.level+1;e<=n;e++){const t=o.filter(t=>t.level===e-1);if(0===t.length)break;const n=i.get(e);if(n?.length)for(const e of n)for(const n of t)if(e.offset>=n.offset&&e.offset+e.size<=n.offset+n.size){o.push(e);break}}return o}function eh(e,t){const n=t.trim().toLowerCase();return!n||e.toLowerCase().includes(n)}function th(e,t){let n=0;for(let t=0;t<e.length;t++)n=31*n+e.charCodeAt(t)>>>0;const i=t.v2.colors.black[500],o=[{fill:t.v2.colors.purple[300],text:i},{fill:t.v2.colors.green[300],text:i},{fill:t.v2.colors.red[300],text:i},{fill:t.v2.colors.blue[300],text:i},{fill:t.v2.colors.yellow[300],text:i}];return o[n%o.length]}var nh,ih;function oh(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function ah(e,t,n){for(const i of n)if(e>=i.x&&e<i.x+i.w&&t>=i.y&&t<i.y+i.h)return i;return null}function lh(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`}(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(nh||(nh={})),(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(ih||(ih={}));const rh=({flamebearer:n,maxRowPx:i,searchQuery:r="",shouldKeepName:s,minHostHeight:c=200,onFullscreenChange:u,profilingSlots:h,onFrameClick:m,onZoomedSymbolsChange:f,onResetZoom:b})=>{const y=v(),C=p(null),S=p(null),x=p({x:0,y:0}),[w,T]=l({w:0,h:0}),[k,I]=l(""),[N,E]=l(null),[O,$]=l([]),[A,R]=l(!1),[D,P]=l(nh.Fit),[_,L]=l(ih.Fit),[F,M]=l(!1),z=Math.max(1,Math.min(Math.floor(w.w*D),8192)),X=Math.max(1,Math.min(Math.floor(w.h*_),8192)),B=O.length>0?O[O.length-1]:null,U=B?.size??n.numTicks,V=o(()=>Ku(n),[n]),H=p({fb:n,rects:V});a(()=>{const e=H.current;e.fb!==n&&(H.current={fb:n,rects:V},$(t=>{if(0===t.length)return t;const i=((e,t,n,i,o)=>{const a=[];for(const l of o){const o=qu(e,t,l);if(0===o.length)break;const r=Zu(n,i,o);if(!r)break;a.push(r)}return a})(e.fb,e.rects,n,V,t);return i.length===t.length&&i.every((e,n)=>Ju(e,t[n]))?t:i}))},[n,V]),a(()=>{if(!f)return;if(!B)return void f(null);const e=Qu(V,B),t=new Set;for(const i of e){const e=ju(n,i.nameIndex);e&&t.add(e)}f([...t])},[B,n,V,f]),g(()=>{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()},[]),a(()=>{if(!A)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[A]),a(()=>(u?.(A),()=>{A&&u?.(!1)}),[A,u]);const j=o(()=>function(e,t,n,i,o,a={}){if(0===e.levels.length||t<2||n<2)return null;const{zoomRoot:l=null,shouldKeepName:r,collapseRecursive:s=!1,allRects:c}=a,d=c??Ku(e);let p=l?Qu(d,l):d;if(0===p.length)return null;if(r&&(p=p.filter(t=>r(ju(e,t.nameIndex))),0===p.length))return null;if(s&&(p=((e,t)=>{if(0===t.length)return t;const n=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),i=new Map;for(const e of n){const t=i.get(e.level);t?t.push(e):i.set(e.level,[e])}const o=new Set;for(const t of n){const n=i.get(t.level+1);if(!n)continue;const a=n.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==a.length)continue;const l=a[0];l.size===t.size&&ju(e,l.nameIndex)===ju(e,t.nameIndex)&&o.add(Yu(l))}if(0===o.size)return n;const a=[];for(const e of n){if(o.has(Yu(e)))continue;let t=0;for(let n=0;n<e.level;n++){const a=i.get(n);if(!a)continue;const l=a.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&o.has(Yu(l))&&t++}a.push({...e,level:e.level-t})}return a})(e,p),0===p.length))return null;const u=l?.level??0,h=l?.offset??0,m=l?.size??e.numTicks;if(m<=0)return null;const g=p.reduce((e,t)=>Math.max(e,t.level-u),0)+1,f=i??Number.POSITIVE_INFINITY,b=Math.max(1,Math.min(n/g,f)),v=o.trim(),y=b>8?1:0;return p.map(n=>{const i=n.level-u,o=(n.offset-h)/m*t,a=Math.max(n.size/m*t,1),l=i*b,r=Math.max(b-y,1),s=ju(e,n.nameIndex);return{...n,x:o,y:l,w:a,h:r,name:s,matchesSearch:eh(s,v)}})}(n,z,X,i,r,{zoomRoot:B,shouldKeepName:s,collapseRecursive:F,allRects:V}),[n,i,r,X,z,B,s,F,V]),G=o(()=>(e=>[...e].sort((e,t)=>t.level-e.level))(j?.length?r.trim()?j.filter(e=>e.matchesSearch):j:[]),[j,r]),W=d(e=>{if(z<2||X<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const i=ah((e.clientX-t.left)/t.width*z,(e.clientY-t.top)/t.height*X,G);if(i){const e=Yu(i);E(e);const t=U>0?(100*i.size/U).toFixed(1):"0",o=n.numTicks>0?(100*i.size/n.numTicks).toFixed(1):"0";I(`${i.name}\ntotal ${Gu(i.size)} (${t}% of view, ${o}% of profile) · self ${Gu(i.self)}`)}else E(null),I("")},[G,n.numTicks,X,z,U]),K=d(e=>{W(e)},[W]),Y=d(()=>{E(null),I("")},[]),J=d(e=>{x.current={x:e.clientX,y:e.clientY}},[]),q=d(e=>{const{x:t,y:n}=x.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-n)>3)return;if(z<2||X<2)return;const i=e.currentTarget.getBoundingClientRect();if(i.width<1||i.height<1)return;const o=ah((e.clientX-i.left)/i.width*z,(e.clientY-i.top)/i.height*X,G);if(!o)return;m?.(o.name);const a=(e=>({level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}))(o);$(e=>{const t=e.length>0?e[e.length-1]:null;return t&&Ju(a,t)?e.slice(0,-1):[...e,a]})},[G,X,z,m]);g(()=>{const e=S.current;if(!e||z<2||X<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,i=Math.max(z,X),o=Math.min(t,16384/i);e.width=Math.floor(z*o),e.height=Math.floor(X*o),e.style.width=`${z}px`,e.style.height=`${X}px`;const a=e.getContext("2d");a&&(a.setTransform(o,0,0,o,0,0),a.clearRect(0,0,z,X),j?.length?((e,t,n,i,o,a,l,r)=>{const s=a.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,n);const c=o.trim().length>0;e.textRendering="optimizeLegibility";for(const t of i){const{x:n,y:i,w:o,h:l,name:s,size:d,matchesSearch:p}=t;if(c&&!p)continue;const{fill:u,text:h}=th(s,a);e.fillStyle=u,e.fillRect(n,i,o,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(n+.5,i+.5),e.lineTo(n+o-.5,i+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(n+.5,i+.5,Math.max(o-1,0),Math.max(l-1,0));const m=oh(d,r),g=`${s} (${Gu(d)}, ${m}%)`,f=a.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(o>=y&&C>=b){e.font=`${C}px ${a.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>o-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=o-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,n+v,i+l/2),e.fillStyle=h,e.fillText(t,n+v,i+l/2))}}if(l)for(const t of i){if(Yu(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:n,y:i,w:o,h:a}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(n+1,i+1,Math.max(o-2,0),Math.max(a-2,0));break}})(a,z,X,j,r,y,N,n.numTicks):(a.fillStyle=y.v2.colors.silver[900],a.fillRect(0,0,z,X)))},[j,n.numTicks,N,r,X,z,y]);const Z=d(()=>R(e=>!e),[]),Q=n.numTicks>0?Math.max(0,Math.min(100,Math.round(U/n.numTicks*100))):100,oe=o(()=>((e,t,n)=>{const i=n??Ku(e),o=t?.offset??0,a=o+(t?.size??e.numTicks),l=(t?.level??-1)+1,r=t?.size??e.numTicks;let s=null;for(const e of i)e.level<l||e.offset<o||e.offset+e.size>a||e.size>=r||(!s||e.size>s.size||e.size===s.size&&e.level<s.level)&&(s=e);return s})(n,B,V),[n,B,V]),ae=null!==oe,le=O.length>0,re=B?ju(n,B.nameIndex):"",se=d(()=>{$([]),b?.()},[b]),ce=d(()=>$(e=>e.slice(0,-1)),[]),de=d(()=>{oe&&$(e=>[...e,oe])},[oe]);return e("div",{style:A?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:y.v2.colors.silver[900]}:{flex:1,minHeight:c,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(ie,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(ge,{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:fe.Left,size:Et.S,value:F,onChange:M}),e(ie,{$gap:8,children:[e(ie,{children:[t(Te,{variant:Ie.Secondary,size:ke.S,label:"Reset zoom",leftIcon:El,onClick:se,disabled:!O.length}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:20,leftIcon:Nl,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!le,onClick:ce}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(ee,{size:te.XXS,color:ne.Secondary,nowrap:!0,align:"center",children:`${Q}%`})}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:20,leftIcon:Ha,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!ae,onClick:de})]}),e(ie,{children:[t(Be,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ve,{variant:Un.Filled,options:[{value:nh.Fit,label:"W: Fit"},{value:nh.X10,label:"10x"}],selected:D,setSelected:P})}),t(Be,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ve,{variant:Un.Filled,options:[{value:ih.Fit,label:"H: Fit"},{value:ih.X10,label:"10x"}],selected:_,setSelected:L})})]}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:24,leftIcon:A?ol:Ol,tooltip:A?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:Z})]})]}),t(Be,{fullWidth:!0,keepAlive:!0,text:k,children:t("div",{ref:C,style:{flex:1,minWidth:0,width:"100%",height:A?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflow:"hidden"},children:t("div",{style:{position:"absolute",inset:0,overflowX:D>1?"auto":"hidden",overflowY:_>1?"auto":"hidden"},children:t("div",{style:{width:z||"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:N?"pointer":"default"},onPointerDown:J,onPointerMove:K,onPointerLeave:Y,onClick:q})})})})}),e(ie,{$justifyContent:"space-between",children:[t(ee,B?{size:te.XXXS,color:y.v2.colors.silver[300],children:`Zoomed: ${re} • ${Gu(U)} samples in view`}:{size:te.XXXS,color:y.v2.colors.silver[300],children:m?"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(ee,{size:te.XXXS,color:y.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${lh(h.totalBytesUsed)} / ${lh(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})},sh=[_n.Go,_n.Java],ch="Profiling Symbols";function dh(e,t){if(0===t.length)return null;const n=1===t.length?t[0]:(e=>e.includes("/")||/\.\(\*?[^)]+\)\./.test(e)?_n.Go:e.includes(" ")||e.includes("(")?_n.Java:_n.Go)(e);if(n===_n.Go){const t=(e=>{let t=e.trim();if(!t)return null;t=t.replace(/\[[^\]]*\]/g,"");const n=t.lastIndexOf("/"),i=t.indexOf(".",n+1);if(-1===i)return null;const o=t.slice(0,i),a=t.slice(i+1);if(!o||!a)return null;const l=a.match(/^\(\*?([^)]+)\)\.(.+)$/);if(l){const e=new He(o,"",l[1],l[2]);return e.Verify()?e:null}const r=new He(o,a);return r.Verify()?r:null})(e);return t?{language:n,golang:t}:null}if(n===_n.Java){const t=(e=>{let t=e.trim();if(!t)return null;const n=t.indexOf("(");-1!==n&&(t=t.slice(0,n).trim());const i=t.split(/\s+/);t=i[i.length-1]??"";const o=t.lastIndexOf(".");if(-1===o)return null;const a=t.slice(0,o),l=t.slice(o+1),r=new je(a,l);return r.Verify()?r:null})(e);return t?{language:n,java:t}:null}return null}function ph(e,t){return e.namespace===t.namespace&&e.name===t.name&&e.kind===t.kind}function uh(e,t,n){if(!e)return!0;const{sources:i=[],namespaces:o=[],languages:a=[]}=e,l=!i.length||i.some(e=>ph(e,t.id)),r=!o.length||o.includes(t.id.namespace),s=!a.length||null==n||a.includes(n);return l&&r&&s}function hh(e,t){return e.packageName===t.packageName&&(e.functionName||"")===(t.functionName||"")&&(e.receiverName||"")===(t.receiverName||"")&&(e.receiverMethodName||"")===(t.receiverMethodName||"")}function mh(e,t){return e.className===t.className&&e.methodName===t.methodName}function gh(e,t,n,i){const o=dh(e,n);if(!o)return[];const a=[];for(const e of i){const n=e.customInstrumentations;if(!n)continue;if(!uh(e.sourceScopes,t,o.language))continue;const i=!!o.golang&&!!n[We.Golang]?.some(e=>hh(e,o.golang)),l=!!o.java&&!!n[We.Java]?.some(e=>mh(e,o.java));(i||l)&&a.push({rule:e,resolved:o})}return a}var fh,bh,vh;(e=>{e.Symbol="symbol",e.Self="self",e.Total="total"})(fh||(fh={})),(e=>{e.OnlyInstrumentable="only-instrumentable"})(bh||(bh={})),(e=>{e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"})(vh||(vh={}));const yh=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function Ch(e,t){const n=(e=>e.split(" ")[0]??"")(e);return(!t.includes(vh.FilterOutVoid)||"void"!==n)&&!!(!t.includes(vh.OnlyWithReturnValues)||e.includes(" ")&&"void"!==n&&yh.test(n))}const Sh=({rows:e,languages:n,instrumentation:i,searchQuery:a,filters:l,onFiltersChange:r,zoomedSymbols:s,highlightSymbol:c,scrollSignal:p})=>{const u=!!n?.includes(_n.Java),h=o(()=>{const t=s?new Set(s):null,n=a?.trim().toLowerCase();return e.filter(e=>(!t||t.has(e.name))&&(!n||e.name.toLowerCase().includes(n)))},[e,a,s]),m=o(()=>{const e=[];if(i.selectionEnabled&&e.push({id:bh.OnlyInstrumentable,label:"Only show instrumentable symbols"}),u&&(e.push({id:vh.FilterOutVoid,label:"Filter out void symbols"}),e.push({id:vh.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===fh.Symbol)?.rawValue?.toString()??"";return!(t.includes(bh.OnlyInstrumentable)&&!i.getSymbolState(n).showCheckbox)&&Ch(n,t)}}},[i,u]),g=o(()=>[{key:fh.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:m,noFilter:!m},{key:fh.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:fh.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[m]),f=o(()=>h.map(e=>{const t=i.getSymbolState(e.name),n=t.showCheckbox;return{id:e.name,cells:[{key:fh.Symbol,rawValue:e.name},{key:fh.Self,rawValue:Gu(e.self)},{key:fh.Total,rawValue:Gu(e.total)}],isSelected:n?i.isSelected(e.name):void 0,onSelect:n?()=>i.onToggleSymbol(e.name,!0):void 0,onDeselect:n?()=>i.onToggleSymbol(e.name,!1):void 0,hideCheckbox:!n,checkboxDisabled:n?t.checkboxDisabled:void 0,checkboxTooltip:n?t.checkboxTooltip:void 0}}),[h,i]),b=d(e=>{const t=e.cells[0].rawValue,n=i.getSymbolState(t),o=[];return n.inManagedRule?o.push({id:`remove-instrumentation-${t}`,label:"",leftIcon:Va,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>i.onRemove(t)}):o.push({id:`add-instrumentation-${t}`,label:"",leftIcon:Ha,tooltip:n.addTooltip,disabled:!n.addEnabled,onClick:()=>i.onAdd(t)}),o.push({id:`copy-${t}`,label:"",leftIcon:$l,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),o},[i]);return t(Vn,{variant:Hn.Data,maxHeight:"calc(100vh - 306px)",columns:g,rows:f,withCheckboxes:i.selectionEnabled,filters:l,onFiltersChange:r,activeRowId:c,scrollSignal:p,getRowActions:b})};var xh;(e=>{e.Table="table",e.Flame="flame",e.Both="both"})(xh||(xh={}));const wh=b(ae)`
693
+ `,wh=({pendingModify:n,onClose:i,onConfirm:o})=>{const a=v();return t(tt,{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:i,denyButton:{variant:Ie.Secondary,label:"Cancel",onClick:i},approveButton:{variant:Ie.Primary,label:"Confirm",onClick:o},children:n&&e(Sh,{children:[n.add.map(n=>e(xh,{children:[t(ce,{leftIcon:gl,status:Pe.Success,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:te.XXS}),t(ee,{size:te.XS,color:ne.Primary,children:n})]},`add-${n}`)),n.remove.map(n=>e(xh,{children:[t(ce,{leftIcon:Zl,status:Pe.Error,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:te.XXS}),t(ee,{size:te.XS,color:ne.Primary,children:n})]},`remove-${n}`))]})})};function Th(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 kh(e){const t=Math.abs(e);return t>=1e9?`${Ih(e/1e9)}s`:t>=1e6?`${Ih(e/1e6)}ms`:t>=1e3?`${Ih(e/1e3)}μs`:String(Math.round(e))}function Ih(e){return e.toFixed(2).replace(/\.?0+$/,"")}function Nh(e){const t=[];for(let n=0;n<e.levels.length;n++){const i=e.levels[n];let o=0;for(let e=0;e+3<i.length;e+=4){const a=i[e],l=i[e+1],r=i[e+2],s=i[e+3],c=o+a;t.push({level:n,offset:c,size:l,self:r,nameIndex:s}),o=c+l}}return t}function Eh(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function $h(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}function Oh(e,t,n){return((e,t)=>{const n=[];for(let i=0;i<=t.level;i++){let o;for(const n of e)if(n.level===i&&t.offset>=n.offset&&t.offset+t.size<=n.offset+n.size){o=n;break}if(!o)return n;n.push(o)}return n})(t,n).map(t=>Th(e,t.nameIndex))}function Ah(e,t,n){if(0===n.length)return null;let i=null,o=null;for(let a=0;a<n.length;a++){const l=n[a];let r=null;for(const n of t)n.level===a&&Th(e,n.nameIndex)===l&&(i&&(n.offset<i.offset||n.offset+n.size>i.offset+i.size)||(!r||n.size>r.size)&&(r=n));if(!r)return null;i=r,o=r}return o}function Rh(e,t){const n=e.reduce((e,t)=>Math.max(e,t.level),t.level),i=new Map;for(const t of e){const e=i.get(t.level);e?e.push(t):i.set(t.level,[t])}const o=[t];for(let e=t.level+1;e<=n;e++){const t=o.filter(t=>t.level===e-1);if(0===t.length)break;const n=i.get(e);if(n?.length)for(const e of n)for(const n of t)if(e.offset>=n.offset&&e.offset+e.size<=n.offset+n.size){o.push(e);break}}return o}function Dh(e,t){const n=t.trim().toLowerCase();return!n||e.toLowerCase().includes(n)}function Ph(e,t){let n=0;for(let t=0;t<e.length;t++)n=31*n+e.charCodeAt(t)>>>0;const i=t.v2.colors.black[500],o=[{fill:t.v2.colors.purple[300],text:i},{fill:t.v2.colors.green[300],text:i},{fill:t.v2.colors.red[300],text:i},{fill:t.v2.colors.blue[300],text:i},{fill:t.v2.colors.yellow[300],text:i}];return o[n%o.length]}var _h,Lh;function Fh(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function zh(e,t,n){for(const i of n)if(e>=i.x&&e<i.x+i.w&&t>=i.y&&t<i.y+i.h)return i;return null}function Mh(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`}(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(_h||(_h={})),(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(Lh||(Lh={}));const Xh=({flamebearer:n,maxRowPx:i,searchQuery:r="",shouldKeepName:s,minHostHeight:c=200,onFullscreenChange:u,profilingSlots:h,onFrameClick:m,onZoomedSymbolsChange:f,onResetZoom:b})=>{const y=v(),C=p(null),S=p(null),x=p({x:0,y:0}),[w,T]=l({w:0,h:0}),[k,I]=l(""),[N,E]=l(null),[$,O]=l([]),[A,R]=l(!1),[D,P]=l(_h.Fit),[_,L]=l(Lh.Fit),[F,z]=l(!1),M=Math.max(1,Math.min(Math.floor(w.w*D),8192)),X=Math.max(1,Math.min(Math.floor(w.h*_),8192)),B=$.length>0?$[$.length-1]:null,U=B?.size??n.numTicks,V=o(()=>Nh(n),[n]),H=p({fb:n,rects:V});a(()=>{const e=H.current;e.fb!==n&&(H.current={fb:n,rects:V},O(t=>{if(0===t.length)return t;const i=((e,t,n,i,o)=>{const a=[];for(const l of o){const o=Oh(e,t,l);if(0===o.length)break;const r=Ah(n,i,o);if(!r)break;a.push(r)}return a})(e.fb,e.rects,n,V,t);return i.length===t.length&&i.every((e,n)=>$h(e,t[n]))?t:i}))},[n,V]),a(()=>{if(!f)return;if(!B)return void f(null);const e=Rh(V,B),t=new Set;for(const i of e){const e=Th(n,i.nameIndex);e&&t.add(e)}f([...t])},[B,n,V,f]),g(()=>{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()},[]),a(()=>{if(!A)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[A]),a(()=>(u?.(A),()=>{A&&u?.(!1)}),[A,u]);const j=o(()=>function(e,t,n,i,o,a={}){if(0===e.levels.length||t<2||n<2)return null;const{zoomRoot:l=null,shouldKeepName:r,collapseRecursive:s=!1,allRects:c}=a,d=c??Nh(e);let p=l?Rh(d,l):d;if(0===p.length)return null;if(r&&(p=p.filter(t=>r(Th(e,t.nameIndex))),0===p.length))return null;if(s&&(p=((e,t)=>{if(0===t.length)return t;const n=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),i=new Map;for(const e of n){const t=i.get(e.level);t?t.push(e):i.set(e.level,[e])}const o=new Set;for(const t of n){const n=i.get(t.level+1);if(!n)continue;const a=n.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==a.length)continue;const l=a[0];l.size===t.size&&Th(e,l.nameIndex)===Th(e,t.nameIndex)&&o.add(Eh(l))}if(0===o.size)return n;const a=[];for(const e of n){if(o.has(Eh(e)))continue;let t=0;for(let n=0;n<e.level;n++){const a=i.get(n);if(!a)continue;const l=a.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&o.has(Eh(l))&&t++}a.push({...e,level:e.level-t})}return a})(e,p),0===p.length))return null;const u=l?.level??0,h=l?.offset??0,m=l?.size??e.numTicks;if(m<=0)return null;const g=p.reduce((e,t)=>Math.max(e,t.level-u),0)+1,f=i??Number.POSITIVE_INFINITY,b=Math.max(1,Math.min(n/g,f)),v=o.trim(),y=b>8?1:0;return p.map(n=>{const i=n.level-u,o=(n.offset-h)/m*t,a=Math.max(n.size/m*t,1),l=i*b,r=Math.max(b-y,1),s=Th(e,n.nameIndex);return{...n,x:o,y:l,w:a,h:r,name:s,matchesSearch:Dh(s,v)}})}(n,M,X,i,r,{zoomRoot:B,shouldKeepName:s,collapseRecursive:F,allRects:V}),[n,i,r,X,M,B,s,F,V]),G=o(()=>(e=>[...e].sort((e,t)=>t.level-e.level))(j?.length?r.trim()?j.filter(e=>e.matchesSearch):j:[]),[j,r]),W=d(e=>{if(M<2||X<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const i=zh((e.clientX-t.left)/t.width*M,(e.clientY-t.top)/t.height*X,G);if(i){const e=Eh(i);E(e);const t=U>0?(100*i.size/U).toFixed(1):"0",o=n.numTicks>0?(100*i.size/n.numTicks).toFixed(1):"0";I(`${i.name}\ntotal ${kh(i.size)} (${t}% of view, ${o}% of profile) · self ${kh(i.self)}`)}else E(null),I("")},[G,n.numTicks,X,M,U]),K=d(e=>{W(e)},[W]),Y=d(()=>{E(null),I("")},[]),J=d(e=>{x.current={x:e.clientX,y:e.clientY}},[]),q=d(e=>{const{x:t,y:n}=x.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-n)>3)return;if(M<2||X<2)return;const i=e.currentTarget.getBoundingClientRect();if(i.width<1||i.height<1)return;const o=zh((e.clientX-i.left)/i.width*M,(e.clientY-i.top)/i.height*X,G);if(!o)return;m?.(o.name);const a=(e=>({level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}))(o);O(e=>{const t=e.length>0?e[e.length-1]:null;return t&&$h(a,t)?e.slice(0,-1):[...e,a]})},[G,X,M,m]);g(()=>{const e=S.current;if(!e||M<2||X<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,i=Math.max(M,X),o=Math.min(t,16384/i);e.width=Math.floor(M*o),e.height=Math.floor(X*o),e.style.width=`${M}px`,e.style.height=`${X}px`;const a=e.getContext("2d");a&&(a.setTransform(o,0,0,o,0,0),a.clearRect(0,0,M,X),j?.length?((e,t,n,i,o,a,l,r)=>{const s=a.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,n);const c=o.trim().length>0;e.textRendering="optimizeLegibility";for(const t of i){const{x:n,y:i,w:o,h:l,name:s,size:d,matchesSearch:p}=t;if(c&&!p)continue;const{fill:u,text:h}=Ph(s,a);e.fillStyle=u,e.fillRect(n,i,o,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(n+.5,i+.5),e.lineTo(n+o-.5,i+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(n+.5,i+.5,Math.max(o-1,0),Math.max(l-1,0));const m=Fh(d,r),g=`${s} (${kh(d)}, ${m}%)`,f=a.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(o>=y&&C>=b){e.font=`${C}px ${a.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>o-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=o-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,n+v,i+l/2),e.fillStyle=h,e.fillText(t,n+v,i+l/2))}}if(l)for(const t of i){if(Eh(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:n,y:i,w:o,h:a}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(n+1,i+1,Math.max(o-2,0),Math.max(a-2,0));break}})(a,M,X,j,r,y,N,n.numTicks):(a.fillStyle=y.v2.colors.silver[900],a.fillRect(0,0,M,X)))},[j,n.numTicks,N,r,X,M,y]);const Z=d(()=>R(e=>!e),[]),Q=n.numTicks>0?Math.max(0,Math.min(100,Math.round(U/n.numTicks*100))):100,oe=o(()=>((e,t,n)=>{const i=n??Nh(e),o=t?.offset??0,a=o+(t?.size??e.numTicks),l=(t?.level??-1)+1,r=t?.size??e.numTicks;let s=null;for(const e of i)e.level<l||e.offset<o||e.offset+e.size>a||e.size>=r||(!s||e.size>s.size||e.size===s.size&&e.level<s.level)&&(s=e);return s})(n,B,V),[n,B,V]),ae=null!==oe,le=$.length>0,re=B?Th(n,B.nameIndex):"",se=d(()=>{O([]),b?.()},[b]),ce=d(()=>O(e=>e.slice(0,-1)),[]),de=d(()=>{oe&&O(e=>[...e,oe])},[oe]);return e("div",{style:A?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:y.v2.colors.silver[900]}:{flex:1,minHeight:c,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(ie,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(ge,{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:fe.Left,size:Et.S,value:F,onChange:z}),e(ie,{$gap:8,children:[e(ie,{children:[t(Te,{variant:Ie.Secondary,size:ke.S,label:"Reset zoom",leftIcon:Ql,onClick:se,disabled:!$.length}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:20,leftIcon:Zl,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!le,onClick:ce}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(ee,{size:te.XXS,color:ne.Secondary,nowrap:!0,align:"center",children:`${Q}%`})}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:20,leftIcon:gl,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!ae,onClick:de})]}),e(ie,{children:[t(Be,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ve,{variant:Un.Filled,options:[{value:_h.Fit,label:"W: Fit"},{value:_h.X10,label:"10x"}],selected:D,setSelected:P})}),t(Be,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ve,{variant:Un.Filled,options:[{value:Lh.Fit,label:"H: Fit"},{value:Lh.X10,label:"10x"}],selected:_,setSelected:L})})]}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:24,leftIcon:A?$l:er,tooltip:A?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:Z})]})]}),t(Be,{fullWidth:!0,keepAlive:!0,text:k,children:t("div",{ref:C,style:{flex:1,minWidth:0,width:"100%",height:A?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflow:"hidden"},children:t("div",{style:{position:"absolute",inset:0,overflowX:D>1?"auto":"hidden",overflowY:_>1?"auto":"hidden"},children:t("div",{style:{width:M||"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:N?"pointer":"default"},onPointerDown:J,onPointerMove:K,onPointerLeave:Y,onClick:q})})})})}),e(ie,{$justifyContent:"space-between",children:[t(ee,B?{size:te.XXXS,color:y.v2.colors.silver[300],children:`Zoomed: ${re} • ${kh(U)} samples in view`}:{size:te.XXXS,color:y.v2.colors.silver[300],children:m?"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(ee,{size:te.XXXS,color:y.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${Mh(h.totalBytesUsed)} / ${Mh(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})},Bh=[_n.Go,_n.Java],Uh="Profiling Symbols";function Vh(e,t){if(0===t.length)return null;const n=1===t.length?t[0]:(e=>e.includes("/")||/\.\(\*?[^)]+\)\./.test(e)?_n.Go:e.includes(" ")||e.includes("(")?_n.Java:_n.Go)(e);if(n===_n.Go){const t=(e=>{let t=e.trim();if(!t)return null;t=t.replace(/\[[^\]]*\]/g,"");const n=t.lastIndexOf("/"),i=t.indexOf(".",n+1);if(-1===i)return null;const o=t.slice(0,i),a=t.slice(i+1);if(!o||!a)return null;const l=a.match(/^\(\*?([^)]+)\)\.(.+)$/);if(l){const e=new He(o,"",l[1],l[2]);return e.Verify()?e:null}const r=new He(o,a);return r.Verify()?r:null})(e);return t?{language:n,golang:t}:null}if(n===_n.Java){const t=(e=>{let t=e.trim();if(!t)return null;const n=t.indexOf("(");-1!==n&&(t=t.slice(0,n).trim());const i=t.split(/\s+/);t=i[i.length-1]??"";const o=t.lastIndexOf(".");if(-1===o)return null;const a=t.slice(0,o),l=t.slice(o+1),r=new je(a,l);return r.Verify()?r:null})(e);return t?{language:n,java:t}:null}return null}function Hh(e,t){return e.namespace===t.namespace&&e.name===t.name&&e.kind===t.kind}function jh(e,t,n){if(!e)return!0;const{sources:i=[],namespaces:o=[],languages:a=[]}=e,l=!i.length||i.some(e=>Hh(e,t.id)),r=!o.length||o.includes(t.id.namespace),s=!a.length||null==n||a.includes(n);return l&&r&&s}function Gh(e,t){return e.packageName===t.packageName&&(e.functionName||"")===(t.functionName||"")&&(e.receiverName||"")===(t.receiverName||"")&&(e.receiverMethodName||"")===(t.receiverMethodName||"")}function Wh(e,t){return e.className===t.className&&e.methodName===t.methodName}function Kh(e,t,n,i){const o=Vh(e,n);if(!o)return[];const a=[];for(const e of i){const n=e.customInstrumentations;if(!n)continue;if(!jh(e.sourceScopes,t,o.language))continue;const i=!!o.golang&&!!n[We.Golang]?.some(e=>Gh(e,o.golang)),l=!!o.java&&!!n[We.Java]?.some(e=>Wh(e,o.java));(i||l)&&a.push({rule:e,resolved:o})}return a}var Yh,Jh,qh;(e=>{e.Symbol="symbol",e.Self="self",e.Total="total"})(Yh||(Yh={})),(e=>{e.OnlyInstrumentable="only-instrumentable"})(Jh||(Jh={})),(e=>{e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"})(qh||(qh={}));const Zh=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function Qh(e,t){const n=(e=>e.split(" ")[0]??"")(e);return(!t.includes(qh.FilterOutVoid)||"void"!==n)&&!!(!t.includes(qh.OnlyWithReturnValues)||e.includes(" ")&&"void"!==n&&Zh.test(n))}const em=({rows:e,languages:n,instrumentation:i,searchQuery:a,filters:l,onFiltersChange:r,zoomedSymbols:s,highlightSymbol:c,scrollSignal:p})=>{const u=!!n?.includes(_n.Java),h=o(()=>{const t=s?new Set(s):null,n=a?.trim().toLowerCase();return e.filter(e=>(!t||t.has(e.name))&&(!n||e.name.toLowerCase().includes(n)))},[e,a,s]),m=o(()=>{const e=[];if(i.selectionEnabled&&e.push({id:Jh.OnlyInstrumentable,label:"Only show instrumentable symbols"}),u&&(e.push({id:qh.FilterOutVoid,label:"Filter out void symbols"}),e.push({id:qh.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===Yh.Symbol)?.rawValue?.toString()??"";return!(t.includes(Jh.OnlyInstrumentable)&&!i.getSymbolState(n).showCheckbox)&&Qh(n,t)}}},[i,u]),g=o(()=>[{key:Yh.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:m,noFilter:!m},{key:Yh.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:Yh.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[m]),f=o(()=>h.map(e=>{const t=i.getSymbolState(e.name),n=t.showCheckbox;return{id:e.name,cells:[{key:Yh.Symbol,rawValue:e.name},{key:Yh.Self,rawValue:kh(e.self)},{key:Yh.Total,rawValue:kh(e.total)}],isSelected:n?i.isSelected(e.name):void 0,onSelect:n?()=>i.onToggleSymbol(e.name,!0):void 0,onDeselect:n?()=>i.onToggleSymbol(e.name,!1):void 0,hideCheckbox:!n,checkboxDisabled:n?t.checkboxDisabled:void 0,checkboxTooltip:n?t.checkboxTooltip:void 0}}),[h,i]),b=d(e=>{const t=e.cells[0].rawValue,n=i.getSymbolState(t),o=[];return n.inManagedRule?o.push({id:`remove-instrumentation-${t}`,label:"",leftIcon:ml,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>i.onRemove(t)}):o.push({id:`add-instrumentation-${t}`,label:"",leftIcon:gl,tooltip:n.addTooltip,disabled:!n.addEnabled,onClick:()=>i.onAdd(t)}),o.push({id:`copy-${t}`,label:"",leftIcon:tr,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),o},[i]);return t(Vn,{variant:Hn.Data,maxHeight:"calc(100vh - 306px)",columns:g,rows:f,withCheckboxes:i.selectionEnabled,filters:l,onFiltersChange:r,activeRowId:c,scrollSignal:p,getRowActions:b})};var tm;(e=>{e.Table="table",e.Flame="flame",e.Both="both"})(tm||(tm={}));const nm=b(ae)`
690
694
  width: 100%;
691
695
  flex: 1;
692
696
  border-radius: 16px;
693
697
  overflow: hidden;
694
698
  background: ${({theme:e})=>e.v2.colors.silver[800]};
695
699
  box-shadow: 0 2px 14.1px 0 rgba(0, 0, 0, 0.25);
696
- `,Th=b.div`
700
+ `,im=b.div`
697
701
  display: flex;
698
702
  align-items: center;
699
703
  gap: 10px;
@@ -701,11 +705,11 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
701
705
  padding: 12px 12px 8px;
702
706
  background: ${({theme:e})=>e.v2.colors.silver[800]};
703
707
  border-radius: 16px 16px 0 0;
704
- `,kh=b(ie)`
708
+ `,om=b(ie)`
705
709
  flex-shrink: 0;
706
710
  align-items: center;
707
711
  gap: 4px;
708
- `,Ih=b.div`
712
+ `,am=b.div`
709
713
  flex: 1;
710
714
  display: flex;
711
715
  align-items: stretch;
@@ -713,20 +717,20 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
713
717
  padding: 16px;
714
718
  background: ${({theme:e})=>e.v2.colors.silver[800]};
715
719
  border-radius: 0 0 16px 16px;
716
- `,Nh=b(ae)`
720
+ `,lm=b(ae)`
717
721
  flex: ${({$splitWithFlame:e})=>e?"0 0 min(413px, 42%)":"1 1 auto"};
718
722
  width: ${({$splitWithFlame:e})=>e?"auto":"100%"};
719
723
  max-width: ${({$splitWithFlame:e})=>e?"none":"100%"};
720
724
  gap: 10px;
721
- `,Eh=b(ae)`
725
+ `,rm=b(ae)`
722
726
  flex: ${({$splitWithTable:e})=>e?"1":"1 1 auto"};
723
727
  width: ${({$splitWithTable:e})=>e?"auto":"100%"};
724
728
  gap: 10px;
725
- `,Oh=b(ie)`
729
+ `,sm=b(ie)`
726
730
  width: 100%;
727
731
  min-height: 32px;
728
732
  flex-shrink: 0;
729
- `,$h=({source:n,onFlameFullscreenChange:i})=>{const s=v(),{profilingApi:c}=Sr(),u=o(()=>({namespace:n.id.namespace,name:n.id.name,kind:n.id.kind,region:n.id.region,serviceName:n.serviceName}),[n.id.namespace,n.id.name,n.id.kind,n.id.region,n.serviceName]),[h,m]=l(!0),[g,f]=l(xh.Both),[b,y]=l(""),[C,S]=l({}),[x,w]=l(!1),T=p(!1);a(()=>{T.current||(T.current=!0,c.enableProfiling?.(u),w(!0))},[c,u]);const{data:k}=c.useSlots({skip:!x,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),{data:I,loading:N,refetch:E}=c.useSourceProfiling(u,{skip:!x,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),O=I?.profileJson??null,$=o(()=>(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}})(O),[O]),A=o(()=>$?(e=>{const t=new Map;for(let n=0;n<e.levels.length;n++){const i=e.levels[n];for(let n=0;n+3<i.length;n+=4){const o=i[n+1],a=i[n+2],l=ju(e,i[n+3]);if(!l)continue;const r=t.get(l);(!r||o>r.total)&&t.set(l,{self:a,total:o})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)})($.flamebearer):[],[$]),R=g===xh.Table||g===xh.Both,D=g===xh.Flame||g===xh.Both,P=R&&D,_=n.runtimeInfo?.detectedLanguages?.join("\0")??"",L=n.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??"").join("\0")??"",F=o(()=>_?_.split("\0"):L?L.split("\0"):void 0,[_,L]),M=o(()=>((e,t)=>{if(!t?.includes(_n.Java))return;const n=(e?.[fh.Symbol]?.filter(Boolean)??[]).filter(e=>e===vh.FilterOutVoid||e===vh.OnlyWithReturnValues);return 0!==n.length?e=>Ch(e,n):void 0})(C,F),[C,F]),{instrumentation:z,pendingCount:X,pendingModify:B,closeModify:U,openBulkModify:V,resetSelection:H,confirmModify:j}=function({source:e,languages:t,rows:n}){const{instrumentationRulesApi:i,capabilities:a}=Sr(),{items:r}=i.useRules(),[s,c]=l(new Set),[p,u]=l(new Set),[h,m]=l(null),g=o(()=>(e=>{const t=new Set(e??[]);return sh.filter(e=>t.has(e))})(t),[t]),f=a.canCreateInstrumentationRule,b=`${e.id.namespace}\0${e.id.kind}\0${e.id.name}`,v=o(()=>((e,t)=>{const n=e.filter(e=>e.type===Ye.CustomInstrumentation&&e.ruleName===ch&&uh(e.sourceScopes,t));return n.find(e=>e.sourceScopes?.sources?.some(e=>ph(e,t.id)))??n[0]??null})(r,e),[r,b]),y=f&&g.length>0,C=o(()=>{const t=new Map;for(const i of n){const n=!!dh(i.name,g),o=gh(i.name,e,g,r),a=!!v&&o.some(e=>e.rule.ruleId===v.ruleId),l=o.filter(e=>e.rule.ruleId!==v?.ruleId),s=!a&&l.length>0,c=y&&n,d=s;let p;if(s){const e=[...new Set(l.map(e=>e.rule.ruleName))];p=`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 u=!1,h="Add this symbol to the “Profiling Symbols” rule";s?h=p??"Managed by another rule":0===o.length&&(0===g.length?h="Custom instrumentation is only available for Go and Java sources":f?n?u=!0:h="This symbol could not be parsed into a probe automatically":h="You don’t have permission to add custom instrumentation"),t.set(i.name,{parsable:n,inManagedRule:a,otherRules:l,showCheckbox:c,checkboxDisabled:d,checkboxTooltip:p,addEnabled:u,addTooltip:h})}return t},[n,r,b,g,f,y,v]),S=o(()=>{const e=new Set;return C.forEach((t,n)=>{t.inManagedRule&&e.add(n)}),e},[C]),x=o(()=>[...s].filter(e=>C.get(e)?.addEnabled&&!S.has(e)),[s,C,S]),w=o(()=>[...p].filter(e=>S.has(e)),[p,S]),T=x.length+w.length,k=d(e=>{const t=C.get(e);return t?.inManagedRule?!p.has(e):!!(t&&t.otherRules.length>0)||s.has(e)},[C,p,s]),I=d((e,t)=>{const n=C.get(e);n&&!n.checkboxDisabled&&(n.inManagedRule?u(n=>{const i=new Set(n);return t?i.delete(e):i.add(e),i}):c(n=>{const i=new Set(n);return t?i.add(e):i.delete(e),i}))},[C]),N=d(()=>{c(new Set),u(new Set)},[]),E=d(t=>{(async()=>{const n=t.add.map(e=>dh(e,g)).filter(e=>!!e),o=t.remove.map(e=>dh(e,g)).filter(e=>!!e);if(v){const{customInstrumentations:e,isEmpty:t}=((e,t,n)=>{const i=e.customInstrumentations??{};let o=[...i[We.Golang]??[]],a=[...i[We.Java]??[]];for(const e of n)e.golang&&(o=o.filter(t=>!hh(t,e.golang))),e.java&&(a=a.filter(t=>!mh(t,e.java)));for(const e of t)e.golang&&!o.some(t=>hh(t,e.golang))&&o.push(e.golang),e.java&&!a.some(t=>mh(t,e.java))&&a.push(e.java);return{customInstrumentations:{[We.Golang]:o,[We.Java]:a},isEmpty:0===o.length&&0===a.length}})(v,n,o);t?await i.remove(v.ruleId,Ye.CustomInstrumentation):await i.update(v.ruleId,((e,t)=>({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}))(v,e),Ye.CustomInstrumentation)}else n.length>0&&await i.create(((e,t)=>{const n=e.map(e=>e.golang).filter(e=>!!e),i=e.map(e=>e.java).filter(e=>!!e),o={sources:[{namespace:t.id.namespace,name:t.id.name,kind:t.id.kind}],namespaces:[],languages:[]};return{ruleName:ch,notes:"Symbols selected from the profiling tab.",disabled:!1,sourceScopes:o,workloads:null,instrumentationLibraries:null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:{[We.Golang]:n,[We.Java]:i}}})(n,e),Ye.CustomInstrumentation)})()},[v,g,e,i]),O=d(()=>{T&&m({add:x,remove:w})},[T,x,w]),$=d(e=>m({add:[e],remove:[]}),[]),A=d(e=>m({add:[],remove:[e]}),[]),R=d(()=>m(null),[]),D=d(()=>{h&&(E(h),m(null),N())},[h,E,N]),P=d(e=>C.get(e)??{parsable:!1,inManagedRule:!1,otherRules:[],showCheckbox:!1,checkboxDisabled:!1,addEnabled:!1,addTooltip:"Custom instrumentation is only available for Go and Java sources"},[C]);return{instrumentation:o(()=>({getSymbolState:P,onAdd:$,onRemove:A,selectionEnabled:y,isSelected:k,onToggleSymbol:I}),[P,$,A,y,k,I]),pendingCount:T,pendingModify:h,closeModify:R,openBulkModify:O,resetSelection:N,confirmModify:D}}({source:n,languages:F,rows:A}),[G,W]=l(null),[K,Y]=l(0),[J,q]=l(null),Z=d(e=>{W(e),Y(e=>e+1),f(e=>e===xh.Flame?xh.Both:e)},[]),Q=d(e=>{q(t=>{if(null===e)return null===t?t:null;if(t&&t.length===e.length){const n=new Set(t);if(e.every(e=>n.has(e)))return t}return e})},[]),oe=d(()=>W(null),[]);return!O&&N?t(ft,{$height:"70vh",children:t(St,{withSpinner:!0})}):e(wh,{$gap:0,$width:"100%",children:[e(Th,{children:[t(Be,{text:"Live CPU profile collected from the workload agent. Search symbols, switch between the table and flame graph, or download a JSON snapshot.",withIcon:!0,children:t(kh,{children:t(ee,{size:te.S,weight:500,color:ne.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(ie,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(vn,{value:b,onChange:y,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:s.v2.colors.silver[900],emphasizeBackgroundColor:s.v2.colors.silver[800]})}),t(ve,{variant:Un.Filled,options:[{value:xh.Table,label:"Top table"},{value:xh.Flame,label:"Flame graph"},{value:xh.Both,label:"Both"}],selected:g,setSelected:f}),t(Te,h?{variant:Ie.Secondary,size:ke.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(Al,{...e,size:8,fill:s.v2.colors.green[500]})}:{variant:Ie.Secondary,size:ke.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(Al,{...e,size:8,fill:s.v2.colors.red[500]})})]})]}),t(Ih,{$gap:R&&D?16:0,children:$?e(r,{children:[R&&e(Nh,{$splitWithFlame:P,children:[e(Oh,{$justifyContent:"space-between",children:[e(ae,{$margin:"0 0 0 20px",children:[t(ee,{size:te.XXXS,nowrap:!0,children:"Please select symbols to"}),e(ie,{$gap:8,children:[e(ie,{children:[t(Rl,{size:24}),t(ee,{size:te.S,color:ne.Success,nowrap:!0,children:"Custom Instrument"})]}),t(Te,{leftIcon:Ga,variant:Ie.Secondary,size:ke.S,onClick:()=>window.open(`${_e}/enterprise/pipeline/rules/custominstrumentation`,"_blank","noopener noreferrer")})]})]}),e(ie,{$gap:8,children:[J&&t(Be,{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(ce,{label:`Zoomed: ${J.length} symbols`,backgroundColor:s.v2.colors.silver[750],textColor:s.v2.colors.silver[200],textSize:te.XXS})}),t(Te,{variant:Ie.Secondary,size:ke.S,label:"Download snapshot",rightIcon:Dl,onClick:()=>{if(!O)return;const e=new Blob([O],{type:"application/json"}),t=URL.createObjectURL(e),i=document.createElement("a");i.href=t,i.download=`cpu-profile-${n.id.namespace}-${n.id.kind}-${n.id.name}.json`,i.click(),URL.revokeObjectURL(t)},disabled:!O})]})]}),t(Sh,{rows:A,languages:F,instrumentation:z,searchQuery:b,filters:C,onFiltersChange:S,zoomedSymbols:J,highlightSymbol:G,scrollSignal:K})]}),D&&e(Eh,{$splitWithTable:P,children:[e(Oh,{$justifyContent:"space-between",children:[t(ce,{label:$?`Total in view ${Gu($.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:s.v2.colors.silver[750],textColor:s.v2.colors.silver[200],textSize:te.XXS}),e(ie,{$gap:12,children:[!h&&t(Te,{variant:Ie.Secondary,size:ke.S,label:"Refresh",leftIcon:fl,onClick:E}),t(ge,{label:"Auto refresh",labelAlign:fe.Left,size:Et.S,value:h,onChange:m})]})]}),t(rh,{flamebearer:$.flamebearer,maxRowPx:24,searchQuery:b,shouldKeepName:M,minHostHeight:280,onFullscreenChange:i,profilingSlots:k??null,onFrameClick:Z,onZoomedSymbolsChange:Q,onResetZoom:oe})]})]}):t(ft,{children:t($e,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})}),t(Hu,{pendingModify:B,onClose:U,onConfirm:j}),t(jn,{isOpen:X>0,richTitle:{icon:al,title:"Profiling Symbols",badge:{label:X}},actions:[{id:"profiling-bulk-cancel",type:bn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"Cancel",onClick:H}},{id:"profiling-bulk-apply",type:bn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Modify Rule",leftIcon:Ka,onClick:V}}]})]})},Ah=b.div`
733
+ `,cm=({source:n,onFlameFullscreenChange:i})=>{const s=v(),{profilingApi:c}=qr(),u=o(()=>({namespace:n.id.namespace,name:n.id.name,kind:n.id.kind,region:n.id.region,serviceName:n.serviceName}),[n.id.namespace,n.id.name,n.id.kind,n.id.region,n.serviceName]),[h,m]=l(!0),[g,f]=l(tm.Both),[b,y]=l(""),[C,S]=l({}),[x,w]=l(!1),T=p(!1);a(()=>{T.current||(T.current=!0,c.enableProfiling?.(u),w(!0))},[c,u]);const{data:k}=c.useSlots({skip:!x,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),{data:I,loading:N,refetch:E}=c.useSourceProfiling(u,{skip:!x,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),$=I?.profileJson??null,O=o(()=>(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=o(()=>O?(e=>{const t=new Map;for(let n=0;n<e.levels.length;n++){const i=e.levels[n];for(let n=0;n+3<i.length;n+=4){const o=i[n+1],a=i[n+2],l=Th(e,i[n+3]);if(!l)continue;const r=t.get(l);(!r||o>r.total)&&t.set(l,{self:a,total:o})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)})(O.flamebearer):[],[O]),R=g===tm.Table||g===tm.Both,D=g===tm.Flame||g===tm.Both,P=R&&D,_=n.runtimeInfo?.detectedLanguages?.join("\0")??"",L=n.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??"").join("\0")??"",F=o(()=>_?_.split("\0"):L?L.split("\0"):void 0,[_,L]),z=o(()=>((e,t)=>{if(!t?.includes(_n.Java))return;const n=(e?.[Yh.Symbol]?.filter(Boolean)??[]).filter(e=>e===qh.FilterOutVoid||e===qh.OnlyWithReturnValues);return 0!==n.length?e=>Qh(e,n):void 0})(C,F),[C,F]),{instrumentation:M,pendingCount:X,pendingModify:B,closeModify:U,openBulkModify:V,resetSelection:H,confirmModify:j}=function({source:e,languages:t,rows:n}){const{instrumentationRulesApi:i,capabilities:a}=qr(),{items:r}=i.useRules(),[s,c]=l(new Set),[p,u]=l(new Set),[h,m]=l(null),g=o(()=>(e=>{const t=new Set(e??[]);return Bh.filter(e=>t.has(e))})(t),[t]),f=a.canCreateInstrumentationRule,b=`${e.id.namespace}\0${e.id.kind}\0${e.id.name}`,v=o(()=>((e,t)=>{const n=e.filter(e=>e.type===Ye.CustomInstrumentation&&e.ruleName===Uh&&jh(e.sourceScopes,t));return n.find(e=>e.sourceScopes?.sources?.some(e=>Hh(e,t.id)))??n[0]??null})(r,e),[r,b]),y=f&&g.length>0,C=o(()=>{const t=new Map;for(const i of n){const n=!!Vh(i.name,g),o=Kh(i.name,e,g,r),a=!!v&&o.some(e=>e.rule.ruleId===v.ruleId),l=o.filter(e=>e.rule.ruleId!==v?.ruleId),s=!a&&l.length>0,c=y&&n,d=s;let p;if(s){const e=[...new Set(l.map(e=>e.rule.ruleName))];p=`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 u=!1,h="Add this symbol to the “Profiling Symbols” rule";s?h=p??"Managed by another rule":0===o.length&&(0===g.length?h="Custom instrumentation is only available for Go and Java sources":f?n?u=!0:h="This symbol could not be parsed into a probe automatically":h="You don’t have permission to add custom instrumentation"),t.set(i.name,{parsable:n,inManagedRule:a,otherRules:l,showCheckbox:c,checkboxDisabled:d,checkboxTooltip:p,addEnabled:u,addTooltip:h})}return t},[n,r,b,g,f,y,v]),S=o(()=>{const e=new Set;return C.forEach((t,n)=>{t.inManagedRule&&e.add(n)}),e},[C]),x=o(()=>[...s].filter(e=>C.get(e)?.addEnabled&&!S.has(e)),[s,C,S]),w=o(()=>[...p].filter(e=>S.has(e)),[p,S]),T=x.length+w.length,k=d(e=>{const t=C.get(e);return t?.inManagedRule?!p.has(e):!!(t&&t.otherRules.length>0)||s.has(e)},[C,p,s]),I=d((e,t)=>{const n=C.get(e);n&&!n.checkboxDisabled&&(n.inManagedRule?u(n=>{const i=new Set(n);return t?i.delete(e):i.add(e),i}):c(n=>{const i=new Set(n);return t?i.add(e):i.delete(e),i}))},[C]),N=d(()=>{c(new Set),u(new Set)},[]),E=d(t=>{(async()=>{const n=t.add.map(e=>Vh(e,g)).filter(e=>!!e),o=t.remove.map(e=>Vh(e,g)).filter(e=>!!e);if(v){const{customInstrumentations:e,isEmpty:t}=((e,t,n)=>{const i=e.customInstrumentations??{};let o=[...i[We.Golang]??[]],a=[...i[We.Java]??[]];for(const e of n)e.golang&&(o=o.filter(t=>!Gh(t,e.golang))),e.java&&(a=a.filter(t=>!Wh(t,e.java)));for(const e of t)e.golang&&!o.some(t=>Gh(t,e.golang))&&o.push(e.golang),e.java&&!a.some(t=>Wh(t,e.java))&&a.push(e.java);return{customInstrumentations:{[We.Golang]:o,[We.Java]:a},isEmpty:0===o.length&&0===a.length}})(v,n,o);t?await i.remove(v.ruleId,Ye.CustomInstrumentation):await i.update(v.ruleId,((e,t)=>({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}))(v,e),Ye.CustomInstrumentation)}else n.length>0&&await i.create(((e,t)=>{const n=e.map(e=>e.golang).filter(e=>!!e),i=e.map(e=>e.java).filter(e=>!!e),o={sources:[{namespace:t.id.namespace,name:t.id.name,kind:t.id.kind}],namespaces:[],languages:[]};return{ruleName:Uh,notes:"Symbols selected from the profiling tab.",disabled:!1,sourceScopes:o,workloads:null,instrumentationLibraries:null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:{[We.Golang]:n,[We.Java]:i}}})(n,e),Ye.CustomInstrumentation)})()},[v,g,e,i]),$=d(()=>{T&&m({add:x,remove:w})},[T,x,w]),O=d(e=>m({add:[e],remove:[]}),[]),A=d(e=>m({add:[],remove:[e]}),[]),R=d(()=>m(null),[]),D=d(()=>{h&&(E(h),m(null),N())},[h,E,N]),P=d(e=>C.get(e)??{parsable:!1,inManagedRule:!1,otherRules:[],showCheckbox:!1,checkboxDisabled:!1,addEnabled:!1,addTooltip:"Custom instrumentation is only available for Go and Java sources"},[C]);return{instrumentation:o(()=>({getSymbolState:P,onAdd:O,onRemove:A,selectionEnabled:y,isSelected:k,onToggleSymbol:I}),[P,O,A,y,k,I]),pendingCount:T,pendingModify:h,closeModify:R,openBulkModify:$,resetSelection:N,confirmModify:D}}({source:n,languages:F,rows:A}),[G,W]=l(null),[K,Y]=l(0),[J,q]=l(null),Z=d(e=>{W(e),Y(e=>e+1),f(e=>e===tm.Flame?tm.Both:e)},[]),Q=d(e=>{q(t=>{if(null===e)return null===t?t:null;if(t&&t.length===e.length){const n=new Set(t);if(e.every(e=>n.has(e)))return t}return e})},[]),oe=d(()=>W(null),[]);return!$&&N?t(ft,{$height:"70vh",children:t(St,{withSpinner:!0})}):e(nm,{$gap:0,$width:"100%",children:[e(im,{children:[t(Be,{text:"Live CPU profile collected from the workload agent. Search symbols, switch between the table and flame graph, or download a JSON snapshot.",withIcon:!0,children:t(om,{children:t(ee,{size:te.S,weight:500,color:ne.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(ie,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(vn,{value:b,onChange:y,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:s.v2.colors.silver[900],emphasizeBackgroundColor:s.v2.colors.silver[800]})}),t(ve,{variant:Un.Filled,options:[{value:tm.Table,label:"Top table"},{value:tm.Flame,label:"Flame graph"},{value:tm.Both,label:"Both"}],selected:g,setSelected:f}),t(Te,h?{variant:Ie.Secondary,size:ke.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(nr,{...e,size:8,fill:s.v2.colors.green[500]})}:{variant:Ie.Secondary,size:ke.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(nr,{...e,size:8,fill:s.v2.colors.red[500]})})]})]}),t(am,{$gap:R&&D?16:0,children:O?e(r,{children:[R&&e(lm,{$splitWithFlame:P,children:[e(sm,{$justifyContent:"space-between",children:[e(ae,{$margin:"0 0 0 20px",children:[t(ee,{size:te.XXXS,nowrap:!0,children:"Please select symbols to"}),e(ie,{$gap:8,children:[e(ie,{children:[t(ir,{size:24}),t(ee,{size:te.S,color:ne.Success,nowrap:!0,children:"Custom Instrument"})]}),t(Te,{leftIcon:bl,variant:Ie.Secondary,size:ke.S,onClick:()=>window.open(`${_e}/enterprise/pipeline/rules/custominstrumentation`,"_blank","noopener noreferrer")})]})]}),e(ie,{$gap:8,children:[J&&t(Be,{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(ce,{label:`Zoomed: ${J.length} symbols`,backgroundColor:s.v2.colors.silver[750],textColor:s.v2.colors.silver[200],textSize:te.XXS})}),t(Te,{variant:Ie.Secondary,size:ke.S,label:"Download snapshot",rightIcon:or,onClick:()=>{if(!$)return;const e=new Blob([$],{type:"application/json"}),t=URL.createObjectURL(e),i=document.createElement("a");i.href=t,i.download=`cpu-profile-${n.id.namespace}-${n.id.kind}-${n.id.name}.json`,i.click(),URL.revokeObjectURL(t)},disabled:!$})]})]}),t(em,{rows:A,languages:F,instrumentation:M,searchQuery:b,filters:C,onFiltersChange:S,zoomedSymbols:J,highlightSymbol:G,scrollSignal:K})]}),D&&e(rm,{$splitWithTable:P,children:[e(sm,{$justifyContent:"space-between",children:[t(ce,{label:O?`Total in view ${kh(O.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:s.v2.colors.silver[750],textColor:s.v2.colors.silver[200],textSize:te.XXS}),e(ie,{$gap:12,children:[!h&&t(Te,{variant:Ie.Secondary,size:ke.S,label:"Refresh",leftIcon:Bl,onClick:E}),t(ge,{label:"Auto refresh",labelAlign:fe.Left,size:Et.S,value:h,onChange:m})]})]}),t(Xh,{flamebearer:O.flamebearer,maxRowPx:24,searchQuery:b,shouldKeepName:z,minHostHeight:280,onFullscreenChange:i,profilingSlots:k??null,onFrameClick:Z,onZoomedSymbolsChange:Q,onResetZoom:oe})]})]}):t(ft,{children:t(Oe,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})}),t(wh,{pendingModify:B,onClose:U,onConfirm:j}),t(jn,{isOpen:X>0,richTitle:{icon:Ol,title:"Profiling Symbols",badge:{label:X}},actions:[{id:"profiling-bulk-cancel",type:bn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"Cancel",onClick:H}},{id:"profiling-bulk-apply",type:bn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Modify Rule",leftIcon:yl,onClick:V}}]})]})},dm=b.div`
730
734
  position: relative;
731
735
  display: flex;
732
736
  align-items: center;
@@ -734,23 +738,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
734
738
  padding: 8px 16px;
735
739
  border-radius: 12px;
736
740
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
737
- `,Rh=b.div`
741
+ `,pm=b.div`
738
742
  display: flex;
739
743
  flex-direction: column;
740
744
  gap: 4px;
741
745
  flex: 1;
742
746
  min-width: 0;
743
747
  opacity: ${({$disabled:e})=>e?.4:1};
744
- `,Dh=b.div`
748
+ `,um=b.div`
745
749
  flex-shrink: 0;
746
750
  display: flex;
747
751
  align-items: center;
748
752
  margin-right: ${({$reserveJumpSpace:e})=>e?"32px":"0"};
749
- `,Ph=b.div`
753
+ `,hm=b.div`
750
754
  min-width: 0;
751
755
  white-space: pre;
752
756
  overflow-x: auto;
753
- `,_h=b.div`
757
+ `,mm=b.div`
754
758
  position: absolute;
755
759
  top: 50%;
756
760
  right: 8px;
@@ -759,24 +763,88 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
759
763
  pointer-events: none;
760
764
  transition: opacity 0.15s ease;
761
765
 
762
- ${Ah}:hover & {
766
+ ${dm}:hover & {
763
767
  opacity: 1;
764
768
  pointer-events: auto;
765
769
  }
766
- `,Lh=({name:n,summary:i,disabled:o=!1,onJumpToRule:a})=>{const l=v();return e(Ah,{children:[e(Rh,{$disabled:o,children:[n&&t(ee,{size:te.XXXS,color:ne.Secondary,nowrap:!0,children:n}),t(Ph,{children:t(w,{parts:i})})]}),o&&t(Dh,{$reserveJumpSpace:!!a,children:t(ce,{label:Gn,textSize:te.XXXS,backgroundColor:l.v2.colors.grey[700],textColor:l.v2.colors.grey[300]})}),a&&t(_h,{children:t(Be,{text:nt.OPEN_IN_SAMPLING_PAGE,children:t(Te,{"data-id":"sampling-rule-jump",variant:Ie.Primary,size:ke.S,leftIcon:Ol,onClick:a})})})]})},Fh=b.div`
770
+ `,gm=({name:n,summary:i,disabled:o=!1,onJumpToRule:a})=>{const l=v();return e(dm,{children:[e(pm,{$disabled:o,children:[n&&t(ee,{size:te.XXXS,color:ne.Secondary,nowrap:!0,children:n}),t(hm,{children:t(w,{parts:i})})]}),o&&t(um,{$reserveJumpSpace:!!a,children:t(ce,{label:Gn,textSize:te.XXXS,backgroundColor:l.v2.colors.grey[700],textColor:l.v2.colors.grey[300]})}),a&&t(mm,{children:t(Be,{text:nt.OPEN_IN_SAMPLING_PAGE,children:t(Te,{"data-id":"sampling-rule-jump",variant:Ie.Primary,size:ke.S,leftIcon:er,onClick:a})})})]})},fm=b.div`
767
771
  opacity: 0;
768
772
  pointer-events: none;
769
773
  transition: opacity 0.15s ease;
770
- `,Mh=b.div`
771
- &:hover ${Fh} {
774
+ `,bm=b.div`
775
+ &:hover ${fm} {
772
776
  opacity: 1;
773
777
  pointer-events: auto;
774
778
  }
775
- `,zh=b.div`
779
+ `,vm=b.div`
776
780
  display: flex;
777
781
  align-items: center;
778
782
  padding: 4px 12px;
779
- `,Xh=({source:e,onRedirectToSampling:n})=>t(Gt,{bgTint:"1000",richTitle:{title:nt.CONTAINERS,badge:{label:e.containers?.length??0}},children:e.containers?.map(e=>t(Vh,{container:e,onRedirectToSampling:n},e.containerName))});var Bh;(e=>{e.All="all",e.Noisy="noisy",e.HighlyRelevant="highly-relevant",e.CostReduction="cost-reduction"})(Bh||(Bh={}));const Uh=e=>"noisy"===e.type?T(e.rule,"source"):"highlyRelevant"===e.type?k(e.rule,"source"):"costReduction"===e.type?I(e.rule,"source"):[],Vh=({container:n,onRedirectToSampling:i})=>{const[a,r]=l(Bh.All),s=Cn(e=>e.setPendingViewSamplingRule),c=n.agentConfig?.traces?.headSampling?.noisyOperations??[],d=o(()=>(n.collectorConfig?.tailSampling?.noisyOperations??[]).map(e=>({type:"noisy",rule:e})),[n.agentConfig?.traces?.headSampling?.noisyOperations]),p=o(()=>(n.collectorConfig?.tailSampling?.highlyRelevantOperations??[]).map(e=>({type:"highlyRelevant",rule:e})),[n.collectorConfig?.tailSampling?.highlyRelevantOperations]),u=o(()=>(n.collectorConfig?.tailSampling?.costReductionRules??[]).map(e=>({type:"costReduction",rule:e})),[n.collectorConfig?.tailSampling?.costReductionRules]),h=o(()=>a===Bh.Noisy?d:a===Bh.HighlyRelevant?p:a===Bh.CostReduction?u:[...d,...p,...u],[a,p,u]),m=d.length+p.length+u.length,g=o(()=>(e,t)=>{s({ruleId:e,category:t}),i()},[i,s]),f=t(Fh,{children:t(Te,{"data-id":"sampling-container-create-rule",variant:Ie.Secondary,size:ke.S,label:Wn,rightIcon:Ha,onClick:e=>{e.stopPropagation(),i()}})});return t(Mh,{children:e(Gt,{bgTint:"900",richTitle:{title:n.containerName},renderOnRightSide:f,withCollapse:!0,collapseIsDefaultOpen:!0,children:[c.length?e(Gt,{bgTint:"800",richTitle:{title:nt.HEAD_SAMPLING,badge:{label:c.length}},children:[t(ee,{size:te.XXS,children:nt.NOISY_OPERATIONS}),t(ae,{$gap:4,children:c.map(e=>t(Lh,{name:e.name,summary:T(e),disabled:e.disabled,onJumpToRule:()=>g(e.ruleId,"noisy")},e.ruleId))})]}):t(zh,{children:t(ee,{size:te.XS,color:ne.Secondary,children:nt.HEAD_SAMPLING})}),m?e(Gt,{bgTint:"800",richTitle:{title:nt.TAIL_SAMPLING,badge:{label:m}},children:[t(ve,{options:(b=d.length,v=p.length,y=u.length,[{value:Bh.All,label:"All",badge:{label:b+v+y,textSize:te.XXXS}},{value:Bh.Noisy,label:nt.NOISY_OPERATIONS,badge:{label:b,textSize:te.XXXS}},{value:Bh.HighlyRelevant,label:nt.HIGHLY_RELEVANT_OPERATIONS,badge:{label:v,textSize:te.XXXS}},{value:Bh.CostReduction,label:nt.COST_REDUCTION_OPERATIONS,badge:{label:y,textSize:te.XXXS}}]),selected:a,setSelected:r}),t(ae,{$gap:4,children:h.length?h.map(e=>t(Lh,{name:e.rule.name,summary:Uh(e),disabled:e.rule.disabled,onJumpToRule:()=>g(e.rule.ruleId,e.type)},e.rule.ruleId)):t($e,{title:`No ${a===Bh.All?`${Bh.Noisy}, ${Bh.HighlyRelevant} and ${Bh.CostReduction}`:a} operations`})})]}):t(zh,{children:t(ee,{size:te.XS,color:ne.Secondary,children:nt.TAIL_SAMPLING})})]})});var b,v,y},Hh=[In.Deployment,In.StatefulSet,In.DaemonSet,In.DeploymentConfig,In.Rollout,In.Pod];var jh;(e=>{e.Workload="Workload",e.Pod="Pod"})(jh||(jh={}));const Gh=e=>!!e&&pn(e.status)===Pe.Error,Wh=e=>Gh(e.healthStatus),Kh=e=>Gh(e.odigosHealthStatus)||(e.processes??[]).some(Wh),Yh=e=>Gh(e.agentInjectedStatus)||Gh(e.odigosHealthStatus)||(e.containers??[]).some(Kh),Jh=({onClose:n,sourceId:i,onRedirectToSampling:r})=>{const s=v(),{isK8s:c,isVm:u,platformType:h}=S(),{selectedStreamName:m}=it(),{sourcesApi:g,configApi:f,capabilities:b}=Sr(),{genericForm:y,loadSource:C,validateFormData:x}=kr(),{data:w}=f.useEffectiveConfig(),[T,k]=l(!1),[I,N]=l(!1),[E,O]=l(!1),[$,A]=l(Ip.Overview),[R,D]=l(null),[P,_]=l({openFor:null}),L=(()=>{const[e,t]=l(null),n=d(e=>{t({tab:Ip.Pods,podName:e.podName})},[]),i=d((e,n)=>{t({tab:Ip.Pods,podName:e.podName,containerName:n.containerName})},[]),a=d((e,n,i)=>{const o=Rp({identifyingAttributes:i.identifyingAttributes});t({tab:Ip.Pods,podName:e.podName,containerName:n.containerName,processPid:o})},[]),r=d(()=>t(null),[]);return o(()=>({jumpToTarget:e,jumpToPod:n,jumpToContainer:i,jumpToProcess:a,clearJumpToTarget:r}),[e,n,i,a,r])})();a(()=>{L.jumpToTarget&&A(L.jumpToTarget.tab)},[L.jumpToTarget]),a(()=>{R&&JSON.stringify(Sn(i))!==JSON.stringify(Sn(R))&&D(null)},[i,R]);const F=p(!1),M=d(async()=>D(await g.fetchById(i)||null),[i,g]);a(()=>{if(F.current||(M(),F.current=!0),!T){const e=setInterval(()=>M(),3e3);return()=>clearInterval(e)}},[M,T]),a(()=>{R&&C(R)},[R]);const z=R&&Hh.includes(R.id.kind),X=o(()=>{const e=[],n=(R?.pods??[]).some(Yh),i=(o=R,(o?.containers??[]).some(e=>(e.instrumentations??[]).some(e=>!1===e.healthy)));var o;const a=e=>t(Cl,{...e,fill:s.v2.colors.red[500]});return e.push({value:Ip.Overview,label:nt.OVERVIEW}),c?(e.push({value:Ip.Pods,label:nt.PODS,icon:n?a:void 0}),e.push({value:Ip.Libraries,label:nt.LIBRARIES,icon:i?a:void 0}),e.push({value:Ip.PeerSources,label:nt.PEER_SOURCES}),w?.profiling?.enabled&&e.push({value:Ip.Profiling,label:nt.PROFILING}),e.push({value:Ip.Sampling,label:nt.SAMPLING}),e.push({value:Ip.Debug,label:nt.DEBUG}),e):(u&&b.canFetchProfiling&&e.push({value:Ip.Profiling,label:nt.PROFILING}),e)},[c,u,b.canFetchProfiling,w,R?.pods,s]),B=d(()=>k(!0),[]),U=o(()=>()=>{n(),r()},[n,r]),V=d(()=>{R&&C(R),k(!1)},[R]),H=d(async()=>{if(!R||!y)return;const{errorMessage:e,preparedFormData:t}=x();if(e)return;const n=t.otelServiceName!==R.id.name?t.otelServiceName:"";await g.update(i,{...t,otelServiceName:n}),k(!1)},[R,y,x,i,g]),j=!1===R?.markedForInstrumentation?.markedForInstrumentation,G=d(()=>N(!0),[]),W=d(async()=>{if(!R)return;const e=!1===R.markedForInstrumentation?.markedForInstrumentation;await g.persistV2({[Rt]:[{namespace:R.id.namespace,name:R.id.name,kind:R.id.kind,...R.id.region?{region:R.id.region}:{},selected:e,currentStreamName:m}]}),N(!1),e||n()},[R,g,m,n]),K=d(()=>{_({openFor:jh.Workload})},[]),Y=d(e=>{A(e),L.clearJumpToTarget()},[L]),J=d(async()=>{await g.recoverFromRollback(i)},[g,i]),q=d(()=>_({openFor:null}),[]),Z=d(async()=>{P.openFor===jh.Workload?await g.restartWorkloads([i]):P.openFor===jh.Pod&&P.podNamespace&&P.podName&&await g.restartPod(P.podNamespace,P.podName),q()},[P,g,i,q]),Q=o(()=>{const{kind:e,name:t}=i;return{title:`Rollout ${e}`,description:`Are you sure you want to rollout the ${e.toLowerCase()} "${t}"?`}},[i]),ee=o(()=>{const e=[];return T||$===Ip.Overview&&(e.push({id:"edit-source-btn-edit",label:Ft.EDIT,icon:Ka,active:T,onClick:B}),c&&z&&e.push({id:"edit-source-btn-restart",label:nt.ROLLOUT_RESTART,icon:Il,onClick:K}),e.push(j?{id:"edit-source-btn-instrument",label:Ft.INSTRUMENT,icon:Ha,color:s.v2.colors.green[500],active:I,onClick:G}:{id:"edit-source-btn-delete",label:Ft.UNINSTRUMENT,icon:Va,color:s.v2.colors.red[500],active:I,onClick:G})),e},[$,T,I,j,c,z,B,K,G,s]),ne=o(()=>{if(!R)return[];const e=[],t={backgroundColor:"transparent",textSize:te.S};return e.push({...t,label:R.id.name,leftIcon:c?yl:void 0}),R.serviceName&&R.serviceName!==R.id.name&&e.push({...t,label:R.serviceName,leftIcon:hl,textColor:s.v2.colors.silver[200]}),e},[R,s,c]);if(!R)return t(Xt,{isOpen:!0,children:t(ft,{$height:"80vh",children:t(St,{withSpinner:!0})})});const ie=$===Ip.Profiling?E?"95vw":"fit-content":T?void 0:"60vw",oe=c?Yn(R.containers)[0]:Kn(h);return e(Bp,{value:L,children:[t(Xt,{isOpen:!0,width:ie,minWidth:"min(1100px, 100vw)",header:{icon:oe,titleBadges:ne,onClose:()=>{Y(Ip.Overview),D(null),O(!1),n()},actions:ee},footer:{actions:T?[{"data-id":"edit-source-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:V},{"data-id":"edit-source-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:H}]:[]},children:t(le,{$padding:"4px 12px 12px",children:e(ae,{$gap:16,children:[!T&&X.length>1&&t(ve,{options:X,selected:$,setSelected:Y}),(()=>{switch($){case Ip.Overview:return T?t(Ws,{}):t(Xu,{source:R,onClickRollout:K,onClickRollback:J});case Ip.Pods:return t(Gp,{source:R,onClickRestartPod:z?(e,t)=>_({openFor:jh.Pod,podNamespace:e,podName:t}):void 0});case Ip.Libraries:return t(Bu,{source:R});case Ip.PeerSources:return t(Kp,{source:R});case Ip.Profiling:return t($h,{source:R,onFlameFullscreenChange:O});case Ip.Sampling:return t(Xh,{source:R,onRedirectToSampling:U});case Ip.Debug:return t(Qp,{source:R});default:return null}})()]})})}),t(mr,{target:"source",action:j?"instrument":"uninstrument",isOpen:I,onClose:()=>N(!1),onApprove:W}),t(tt,{isOpen:P.openFor===jh.Workload,title:Q.title,description:Q.description,onClose:q,denyButton:{label:"Go back",variant:Ie.Secondary,onClick:q},approveButton:{label:Ft.CONFIRM,variant:Ie.Primary,onClick:Z}}),t(mr,{target:"pod",action:"restart",description:nt.ROLLOUT_RESTART_WORKLOADS_DESCRIPTION,isOpen:P.openFor===jh.Pod,onClose:q,onApprove:Z,overrideApproveButtonLabel:nt.DELETE_POD_TO_RESTART})]})},qh=b.div`
783
+ `,ym=({source:e,onRedirectToSampling:n})=>t(Gt,{bgTint:"1000",richTitle:{title:nt.CONTAINERS,badge:{label:e.containers?.length??0}},children:e.containers?.map(e=>t(xm,{container:e,onRedirectToSampling:n},e.containerName))});var Cm;(e=>{e.All="all",e.Noisy="noisy",e.HighlyRelevant="highly-relevant",e.CostReduction="cost-reduction"})(Cm||(Cm={}));const Sm=e=>"noisy"===e.type?T(e.rule,"source"):"highlyRelevant"===e.type?k(e.rule,"source"):"costReduction"===e.type?I(e.rule,"source"):[],xm=({container:n,onRedirectToSampling:i})=>{const[a,r]=l(Cm.All),s=Cn(e=>e.setPendingViewSamplingRule),c=n.agentConfig?.traces?.headSampling?.noisyOperations??[],d=o(()=>(n.collectorConfig?.tailSampling?.noisyOperations??[]).map(e=>({type:"noisy",rule:e})),[n.agentConfig?.traces?.headSampling?.noisyOperations]),p=o(()=>(n.collectorConfig?.tailSampling?.highlyRelevantOperations??[]).map(e=>({type:"highlyRelevant",rule:e})),[n.collectorConfig?.tailSampling?.highlyRelevantOperations]),u=o(()=>(n.collectorConfig?.tailSampling?.costReductionRules??[]).map(e=>({type:"costReduction",rule:e})),[n.collectorConfig?.tailSampling?.costReductionRules]),h=o(()=>a===Cm.Noisy?d:a===Cm.HighlyRelevant?p:a===Cm.CostReduction?u:[...d,...p,...u],[a,p,u]),m=d.length+p.length+u.length,g=o(()=>(e,t)=>{s({ruleId:e,category:t}),i()},[i,s]),f=t(fm,{children:t(Te,{"data-id":"sampling-container-create-rule",variant:Ie.Secondary,size:ke.S,label:Wn,rightIcon:gl,onClick:e=>{e.stopPropagation(),i()}})});return t(bm,{children:e(Gt,{bgTint:"900",richTitle:{title:n.containerName},renderOnRightSide:f,withCollapse:!0,collapseIsDefaultOpen:!0,children:[c.length?e(Gt,{bgTint:"800",richTitle:{title:nt.HEAD_SAMPLING,badge:{label:c.length}},children:[t(ee,{size:te.XXS,children:nt.NOISY_OPERATIONS}),t(ae,{$gap:4,children:c.map(e=>t(gm,{name:e.name,summary:T(e),disabled:e.disabled,onJumpToRule:()=>g(e.ruleId,"noisy")},e.ruleId))})]}):t(vm,{children:t(ee,{size:te.XS,color:ne.Secondary,children:nt.HEAD_SAMPLING})}),m?e(Gt,{bgTint:"800",richTitle:{title:nt.TAIL_SAMPLING,badge:{label:m}},children:[t(ve,{options:(b=d.length,v=p.length,y=u.length,[{value:Cm.All,label:"All",badge:{label:b+v+y,textSize:te.XXXS}},{value:Cm.Noisy,label:nt.NOISY_OPERATIONS,badge:{label:b,textSize:te.XXXS}},{value:Cm.HighlyRelevant,label:nt.HIGHLY_RELEVANT_OPERATIONS,badge:{label:v,textSize:te.XXXS}},{value:Cm.CostReduction,label:nt.COST_REDUCTION_OPERATIONS,badge:{label:y,textSize:te.XXXS}}]),selected:a,setSelected:r}),t(ae,{$gap:4,children:h.length?h.map(e=>t(gm,{name:e.rule.name,summary:Sm(e),disabled:e.rule.disabled,onJumpToRule:()=>g(e.rule.ruleId,e.type)},e.rule.ruleId)):t(Oe,{title:`No ${a===Cm.All?`${Cm.Noisy}, ${Cm.HighlyRelevant} and ${Cm.CostReduction}`:a} operations`})})]}):t(vm,{children:t(ee,{size:te.XS,color:ne.Secondary,children:nt.TAIL_SAMPLING})})]})});var b,v,y},wm=[In.Deployment,In.StatefulSet,In.DaemonSet,In.DeploymentConfig,In.Rollout,In.Pod];var Tm;(e=>{e.Workload="Workload",e.Pod="Pod"})(Tm||(Tm={}));const km=e=>!!e&&pn(e.status)===Pe.Error,Im=e=>km(e.healthStatus),Nm=e=>km(e.odigosHealthStatus)||(e.processes??[]).some(Im),Em=e=>km(e.agentInjectedStatus)||km(e.odigosHealthStatus)||(e.containers??[]).some(Nm),$m=({onClose:n,sourceId:i,onRedirectToSampling:r})=>{const s=v(),{isK8s:c,isVm:u,platformType:h}=S(),{selectedStreamName:m}=it(),{sourcesApi:g,configApi:f,capabilities:b}=qr(),{genericForm:y,loadSource:C,validateFormData:x}=ts(),{data:w}=f.useEffectiveConfig(),[T,k]=l(!1),[I,N]=l(!1),[E,$]=l(!1),[O,A]=l(ou.Overview),[R,D]=l(null),[P,_]=l({openFor:null}),L=(()=>{const[e,t]=l(null),n=d(e=>{t({tab:ou.Pods,podName:e.podName})},[]),i=d((e,n)=>{t({tab:ou.Pods,podName:e.podName,containerName:n.containerName})},[]),a=d((e,n,i)=>{const o=du({identifyingAttributes:i.identifyingAttributes});t({tab:ou.Pods,podName:e.podName,containerName:n.containerName,processPid:o})},[]),r=d(()=>t(null),[]);return o(()=>({jumpToTarget:e,jumpToPod:n,jumpToContainer:i,jumpToProcess:a,clearJumpToTarget:r}),[e,n,i,a,r])})();a(()=>{L.jumpToTarget&&A(L.jumpToTarget.tab)},[L.jumpToTarget]),a(()=>{R&&JSON.stringify(Sn(i))!==JSON.stringify(Sn(R))&&D(null)},[i,R]);const F=p(!1),z=d(async()=>D(await g.fetchById(i)||null),[i,g]);a(()=>{if(F.current||(z(),F.current=!0),!T){const e=setInterval(()=>z(),3e3);return()=>clearInterval(e)}},[z,T]),a(()=>{R&&C(R)},[R]);const M=R&&wm.includes(R.id.kind),X=o(()=>{const e=[],n=(R?.pods??[]).some(Em),i=(o=R,(o?.containers??[]).some(e=>(e.instrumentations??[]).some(e=>!1===e.healthy)));var o;const a=e=>t(jl,{...e,fill:s.v2.colors.red[500]});return e.push({value:ou.Overview,label:nt.OVERVIEW}),c?(e.push({value:ou.Pods,label:nt.PODS,icon:n?a:void 0}),e.push({value:ou.Libraries,label:nt.LIBRARIES,icon:i?a:void 0}),e.push({value:ou.PeerSources,label:nt.PEER_SOURCES}),w?.profiling?.enabled&&e.push({value:ou.Profiling,label:nt.PROFILING}),e.push({value:ou.Sampling,label:nt.SAMPLING}),e.push({value:ou.Debug,label:nt.DEBUG}),e):(u&&b.canFetchProfiling&&e.push({value:ou.Profiling,label:nt.PROFILING}),e)},[c,u,b.canFetchProfiling,w,R?.pods,s]),B=d(()=>k(!0),[]),U=o(()=>()=>{n(),r()},[n,r]),V=d(()=>{R&&C(R),k(!1)},[R]),H=d(async()=>{if(!R||!y)return;const{errorMessage:e,preparedFormData:t}=x();if(e)return;const n=t.otelServiceName!==R.id.name?t.otelServiceName:"";await g.update(i,{...t,otelServiceName:n}),k(!1)},[R,y,x,i,g]),j=!1===R?.markedForInstrumentation?.markedForInstrumentation,G=d(()=>N(!0),[]),W=d(async()=>{if(!R)return;const e=!1===R.markedForInstrumentation?.markedForInstrumentation;await g.persistV2({[Rt]:[{namespace:R.id.namespace,name:R.id.name,kind:R.id.kind,...R.id.region?{region:R.id.region}:{},selected:e,currentStreamName:m}]}),N(!1),e||n()},[R,g,m,n]),K=d(()=>{_({openFor:Tm.Workload})},[]),Y=d(e=>{A(e),L.clearJumpToTarget()},[L]),J=d(async()=>{await g.recoverFromRollback(i)},[g,i]),q=d(()=>_({openFor:null}),[]),Z=d(async()=>{P.openFor===Tm.Workload?await g.restartWorkloads([i]):P.openFor===Tm.Pod&&P.podNamespace&&P.podName&&await g.restartPod(P.podNamespace,P.podName),q()},[P,g,i,q]),Q=o(()=>{const{kind:e,name:t}=i;return{title:`Rollout ${e}`,description:`Are you sure you want to rollout the ${e.toLowerCase()} "${t}"?`}},[i]),ee=o(()=>{const e=[];return T||O===ou.Overview&&(e.push({id:"edit-source-btn-edit",label:Ft.EDIT,icon:yl,active:T,onClick:B}),c&&M&&e.push({id:"edit-source-btn-restart",label:nt.ROLLOUT_RESTART,icon:ql,onClick:K}),e.push(j?{id:"edit-source-btn-instrument",label:Ft.INSTRUMENT,icon:gl,color:s.v2.colors.green[500],active:I,onClick:G}:{id:"edit-source-btn-delete",label:Ft.UNINSTRUMENT,icon:ml,color:s.v2.colors.red[500],active:I,onClick:G})),e},[O,T,I,j,c,M,B,K,G,s]),ne=o(()=>{if(!R)return[];const e=[],t={backgroundColor:"transparent",textSize:te.S};return e.push({...t,label:R.id.name,leftIcon:c?Hl:void 0}),R.serviceName&&R.serviceName!==R.id.name&&e.push({...t,label:R.serviceName,leftIcon:zl,textColor:s.v2.colors.silver[200]}),e},[R,s,c]);if(!R)return t(Xt,{isOpen:!0,children:t(ft,{$height:"80vh",children:t(St,{withSpinner:!0})})});const ie=O===ou.Profiling?E?"95vw":"fit-content":T?void 0:"60vw",oe=c?Yn(R.containers)[0]:Kn(h);return e(yu,{value:L,children:[t(Xt,{isOpen:!0,width:ie,minWidth:"min(1100px, 100vw)",header:{icon:oe,titleBadges:ne,onClose:()=>{Y(ou.Overview),D(null),$(!1),n()},actions:ee},footer:{actions:T?[{"data-id":"edit-source-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:V},{"data-id":"edit-source-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:H}]:[]},children:t(le,{$padding:"4px 12px 12px",children:e(ae,{$gap:16,children:[!T&&X.length>1&&t(ve,{options:X,selected:O,setSelected:Y}),(()=>{switch(O){case ou.Overview:return T?t(wc,{}):t(yh,{source:R,onClickRollout:K,onClickRollback:J});case ou.Pods:return t(Tu,{source:R,onClickRestartPod:M?(e,t)=>_({openFor:Tm.Pod,podNamespace:e,podName:t}):void 0});case ou.Libraries:return t(Ch,{source:R});case ou.PeerSources:return t(Iu,{source:R});case ou.Profiling:return t(cm,{source:R,onFlameFullscreenChange:$});case ou.Sampling:return t(ym,{source:R,onRedirectToSampling:U});case ou.Debug:return t(Au,{source:R});default:return null}})()]})})}),t(Vr,{target:"source",action:j?"instrument":"uninstrument",isOpen:I,onClose:()=>N(!1),onApprove:W}),t(tt,{isOpen:P.openFor===Tm.Workload,title:Q.title,description:Q.description,onClose:q,denyButton:{label:"Go back",variant:Ie.Secondary,onClick:q},approveButton:{label:Ft.CONFIRM,variant:Ie.Primary,onClick:Z}}),t(Vr,{target:"pod",action:"restart",description:nt.ROLLOUT_RESTART_WORKLOADS_DESCRIPTION,isOpen:P.openFor===Tm.Pod,onClose:q,onApprove:Z,overrideApproveButtonLabel:nt.DELETE_POD_TO_RESTART})]})},Om={"Cost Optimization":{icon:sr,status:Pe.Warning},Normalization:{icon:rr,status:Pe.Default},Enrichment:{icon:lr,status:Pe.Info},Maintenance:{icon:Bl,status:Pe.Warning},Reliability:{icon:Ol,status:Pe.Success},Usability:{icon:ar,status:Pe.Info}},Am={icon:cr,status:Pe.Unknown},Rm={[Jn.Recommended]:Pe.Info,[Jn.Applied]:Pe.Success,[Jn.Dismissed]:Pe.Disabled,[Jn.NotApplicable]:Pe.Unknown},Dm="Created from recommendation",Pm={[Zn.EnableUrlTemplatization]:()=>({type:$e.URLTemplatization,name:"URL Templatization",notes:Dm,disabled:!1,signals:[Le.Traces],fields:{}}),[Zn.EnableInferDbAttributes]:()=>({type:$e.InferDbAttributes,name:"Infer DB Attributes",notes:Dm,disabled:!1,signals:[Le.Traces],fields:{}})},_m=e=>e.applyExamples.some(({type:e})=>e===qn.OdigosAction),Lm=e=>_m(e)?Pm[e.type]?.():void 0,Fm=e=>e.applied?Jn.Applied:e.conditionsMet?e.dismissed?Jn.Dismissed:Jn.Recommended:Jn.NotApplicable,zm=e=>{const t={[Jn.Recommended]:[],[Jn.Applied]:[],[Jn.Dismissed]:[],[Jn.NotApplicable]:[]};for(const n of e)t[Fm(n)].push(n);return t},Mm=e=>{let t=0;for(const n of e)Fm(n)===Jn.Recommended&&(t+=1);return t},Xm=[Jn.Recommended,Jn.Applied,Jn.Dismissed,Jn.NotApplicable],Bm={[qn.HelmValues]:"Helm values",[qn.OdigosAction]:"Odigos Action"},Um=({remediations:n})=>{const i=n.flatMap(e=>e.applyExamples.map((t,i)=>({key:`${e.type}-${t.type}-${i}`,title:n.length>1?`${Bm[t.type]||t.type} — ${e.buttonText}`:Bm[t.type]||t.type,content:t.content})));return i.length?e(ae,{$gap:8,children:[e(ae,{$gap:2,children:[t(ee,{size:te.XS,color:ne.Primary,weight:500,children:Qn}),t(ee,{size:te.XXS,color:ne.Secondary,children:ei})]}),i.map(e=>t(Hr,{title:e.title,yaml:e.content,compact:!0},e.key))]}):null},Vm=({recommendation:n,onApplyServerRemediation:i,onCreateAction:o,onApplied:a})=>{const[r,s]=l(),c=n.remediations.filter(e=>_m(e)?!!Lm(e)&&!!o:!!i);return c.length?e(ae,{$gap:8,children:[e(ae,{$gap:2,children:[t(ee,{size:te.XS,color:ne.Primary,weight:500,children:ti}),t(ee,{size:te.XXS,color:ne.Secondary,children:ni})]}),t(De,{status:Pe.Default,message:ii,fullWidth:!0,smallIcon:!0}),t(ie,{$gap:8,$wrap:"wrap",children:c.map(e=>t(Te,{"data-id":`apply-recommendation-${e.type}`,label:e.buttonText,tooltip:e.tooltip,size:ke.S,variant:Ie.Primary,loading:r===e.type,disabled:!!r,onClick:()=>(async e=>{if(!r){s(e.type);try{(_m(e)?await(o?.(e)):await(i?.(e.type)))&&a?.()}finally{s(void 0)}}})(e)},e.type))})]}):null};var Hm;(e=>{e.Ui="ui",e.GitOps="gitops"})(Hm||(Hm={}));const jm=({recommendation:n,onDismiss:i,onAcceptedChange:o,onApplyServerRemediation:r,onCreateAction:s,onApplied:c})=>{const p=!n.requireOdigosDeployment&&n.remediations.some(e=>_m(e)?!!Lm(e)&&!!s:!!r),u=n.remediations.some(({applyExamples:e})=>e.length>0),[h,m]=l(!1),[g,f]=l(!1),[b,v]=l(()=>p?Hm.Ui:Hm.GitOps),y=[...p?[{value:Hm.Ui,label:ci}]:[],...u?[{value:Hm.GitOps,label:di}]:[]],C=y.length>1;a(()=>()=>o?.(!1),[o]);const S=d(()=>{m(!0),o?.(!0)},[o]),x=d(async()=>{if(i&&!g){f(!0);try{await i(n.name,!0)}finally{f(!1)}}},[g,i,n.name]);return p||u?e(ae,{$gap:0,children:[t(jr,{open:!h,gapCancelPx:0,children:e(ae,{$gap:12,children:[e(ae,{$gap:4,children:[t(ee,{size:te.XS,color:ne.Primary,weight:500,children:oi}),t(ee,{size:te.XXS,color:ne.Secondary,children:ai})]}),e(ie,{$gap:8,children:[t(Te,{"data-id":"recommendation-accept",label:li,size:ke.S,variant:Ie.Primary,onClick:S}),i&&t(Te,{"data-id":"recommendation-dismiss",label:ri,size:ke.S,variant:Ie.Secondary,disabled:g,onClick:x})]})]})}),t(jr,{open:h,delayInMs:40,children:e(ae,{$gap:20,children:[C&&e(ae,{$gap:4,children:[t(ee,{size:te.XS,color:ne.Primary,weight:500,children:oi}),t(ee,{size:te.XXS,color:ne.Secondary,children:si}),t(ve,{"data-id":"recommendation-installation-method",size:zt.S,fullWidth:!0,selected:b,setSelected:v,options:y})]}),b===Hm.Ui&&p?t(Vm,{recommendation:n,onApplyServerRemediation:r,onCreateAction:s,onApplied:c}):t(Um,{remediations:n.remediations})]})})]}):null},Gm=b.ul`
784
+ margin: 0;
785
+ padding-left: 18px;
786
+ display: flex;
787
+ flex-direction: column;
788
+ gap: 4px;
789
+ `,Wm=b.li`
790
+ color: ${({theme:e})=>e.v2.colors.grey[300]};
791
+ `,Km=b.div`
792
+ display: grid;
793
+ grid-template-columns: 1fr;
794
+ gap: 16px;
795
+ width: 100%;
796
+ padding-top: 16px;
797
+ border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
798
+ `,Ym=b(ae)`
799
+ min-width: 0;
800
+ `,Jm=b.div`
801
+ display: flex;
802
+ align-items: center;
803
+ justify-content: center;
804
+ width: 16px;
805
+ height: 16px;
806
+ flex-shrink: 0;
807
+ border: 1px solid ${({theme:e})=>e.v2.colors.green[600]};
808
+ border-radius: 50%;
809
+ `,qm=b.div`
810
+ width: 100%;
811
+ min-width: 0;
812
+
813
+ > section {
814
+ min-height: 96px;
815
+ transition:
816
+ background-color 0.15s ease,
817
+ transform 0.15s ease,
818
+ box-shadow 0.15s ease;
819
+ }
820
+
821
+ &:hover > section {
822
+ background-color: ${({theme:e})=>e.v2.colors.silver[800]};
823
+ box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
824
+ transform: translateY(-1px);
825
+ }
826
+ `,Zm=b(ie)`
827
+ width: 100%;
828
+ padding-top: 4px;
829
+ `,Qm=({recommendation:n,state:i,onDismiss:o,onApplyServerRemediation:a,onCreateAction:r,onRemediationApplied:s})=>{const c=v(),[p,u]=l(!1),[h,m]=l(!1),g=i===Jn.NotApplicable?pi:n.summary,f=n.description.trim().split(/\n\s*\n/).map(e=>e.replace(/\s+/g," ").trim()).filter(Boolean),b=(y=n.categories[0])&&Om[y]||Am;var y;const C=i===Jn.Recommended&&n.conditionsMet,S=C&&!h,x=i===Jn.Recommended&&!!o&&!S,w=i===Jn.Dismissed&&!!o,T=i===Jn.Recommended?void 0:{key:i,label:ui[i],status:Rm[i],useSecondaryTone:!0,textSize:te.XXXS},k=d(async()=>{if(o&&!p){u(!0);try{await o(n.name,i!==Jn.Dismissed)}finally{u(!1)}}},[o,p,n.name,i]);return t(qm,{children:t(Gt,{bgTint:"900",moreSpacing:!0,withCollapse:!0,badges:T?[T]:[],richTitle:{icon:b.icon,title:n.title,titleSize:te.S,titleWrap:!0,titleMeta:n.categories.join(" · "),subTitle:g,subTitleSize:te.XXS,subTitleWrap:!0,textGap:6,alignItems:"flex-start"},children:e(ae,{$gap:16,children:[t(jr,{open:!h,gapCancelPx:16,children:e(ae,{$gap:16,children:[f.length>0&&t(ae,{$gap:8,children:f.map(e=>t(ee,{size:te.XS,color:ne.Secondary,lineHeight:"20px",children:e},e))}),(n.pros.length>0||n.cons.length>0)&&e(Km,{children:[n.pros.length>0&&e(Ym,{$gap:8,children:[e(ie,{$gap:8,children:[t(Jm,{children:t(El,{size:10,fill:c.v2.colors.green[600]})}),t(ee,{size:te.XS,weight:400,color:ne.Primary,children:hi})]}),t(Gm,{children:n.pros.slice(0,3).map(e=>t(Wm,{children:t(ee,{size:te.XXS,color:ne.Secondary,variant:$t.Span,children:e})},e))})]}),n.cons.length>0&&e(Ym,{$gap:8,children:[e(ie,{$gap:8,children:[t(jl,{size:18,fill:c.v2.colors.orange[600]}),t(ee,{size:te.XS,weight:400,color:ne.Primary,children:mi})]}),t(Gm,{children:n.cons.slice(0,3).map(e=>t(Wm,{children:t(ee,{size:te.XXS,color:ne.Secondary,variant:$t.Span,children:e})},e))})]})]})]})}),C&&t(jm,{recommendation:n,onDismiss:o,onAcceptedChange:m,onApplyServerRemediation:a,onCreateAction:r,onApplied:s}),e(Zm,{$gap:8,$justifyContent:"flex-end",children:[n.docsUrl&&t(Te,{label:gi,leftIcon:bl,size:ke.S,variant:Ie.Text,onClick:()=>window.open(n.docsUrl,"_blank","noopener noreferrer")}),x&&t(Te,{label:ri,size:ke.S,variant:Ie.Secondary,disabled:p,onClick:k}),w&&t(Te,{label:fi,size:ke.S,variant:Ie.Secondary,disabled:p,onClick:k})]})]})})})},eg=b.div`
830
+ width: 100%;
831
+ min-width: 0;
832
+ max-width: 100%;
833
+ padding: 8px 16px 20px;
834
+ `,tg=b(ae)`
835
+ opacity: ${({$state:e})=>e===Jn.Applied?.78:1};
836
+ transition: opacity 0.15s ease;
837
+
838
+ &:hover {
839
+ opacity: 1;
840
+ }
841
+ `,ng=b(ie)`
842
+ width: 100%;
843
+ min-height: 28px;
844
+ padding-left: 10px;
845
+ border-left: 2px solid
846
+ ${({theme:e,$state:t})=>t===Jn.Recommended?e.v2.colors.purple[500]:t===Jn.Applied?e.v2.colors.green[500]:e.v2.colors.grey[500]};
847
+ `,ig=({isOpen:n,onClose:i})=>{const{actionsApi:l,capabilities:r,recommendationsApi:s}=qr(),{items:c,loading:u,refetch:h}=s.useRecommendations(),m=p([]),g=p(h);g.current=h,a(()=>{n&&g.current()},[n]),a(()=>()=>{m.current.forEach(clearTimeout)},[]);const f=d(()=>{m.current.forEach(clearTimeout),m.current=[2e3,5e3,1e4].map(e=>setTimeout(()=>{g.current()},e))},[]),b=d(async(e,t)=>{if(!s.applyRemediation)return!1;const n=await s.applyRemediation(e,t);return!n?.error},[s]),v=d(async e=>{const t=Lm(e);if(!t)return!1;const n=await l.create(t);return!n?.error},[l]),y=o(()=>zm(c),[c]),C=c.length>0;return t(Xt,{isOpen:n,width:"min(700px, 100vw)",header:{icon:cr,title:vi,subTitle:bi,onClose:i},children:t(eg,{children:u&&!C?t(re,{size:3}):C?t(ae,{$gap:28,$width:"100%",children:Xm.map(n=>{const i=y[n];return 0===i.length?null:e(tg,{$state:n,$gap:12,$width:"100%",children:[e(ng,{$state:n,$gap:8,$justifyContent:"space-between",children:[t(ee,{size:te.XS,weight:600,color:n===Jn.Recommended?ne.Primary:ne.Secondary,children:ui[n]}),t(ce,{label:i.length,status:Rm[n],useSecondaryTone:!0,textSize:te.XXXS})]}),t(ae,{$gap:12,$width:"100%",children:i.map(e=>t(Qm,{recommendation:e,state:n,onDismiss:s.setDismissed,onApplyServerRemediation:s.applyRemediation?t=>b(e.type,t):void 0,onCreateAction:r.canCreateAction?v:void 0,onRemediationApplied:f},e.name))})]},n)})}):t(Oe,{icon:cr,title:Ci,subTitle:yi})})})},og=b.div`
780
848
  display: flex;
781
849
  align-items: center;
782
850
  gap: 8px;
@@ -786,9 +854,9 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
786
854
  &:hover {
787
855
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
788
856
  }
789
- `,Zh=b.div`
857
+ `,ag=b.div`
790
858
  flex: 1;
791
- `,Qh=({onClick:n})=>{const i=v().v2.colors.red[500];return e(qh,{"data-id":"sampling-view-btn-delete",onClick:n,children:[t(ee,{size:te.XS,weight:500,color:i,children:Qn}),t(Va,{size:16,fill:i})]})};const em={[Nr.EditAutoNoisy]:{title:hi,subTitle:ui,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[Nr.EditAutoCostReduction]:{title:pi,subTitle:di,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[Nr.EditAutoHighlyRelevant]:{title:ci,subTitle:si,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},tm=({isOpen:e,title:n,subTitle:i,onClose:o,footer:a,renderBody:l})=>t(Xt,{isOpen:e,width:gi,header:{icon:Pl,title:n,subTitle:i,onClose:o},footer:a,children:l?l():t(le,{$padding:"12px",children:t(Qs,{})})}),nm=({isOpen:i,onClose:r,onSubmit:s,validateForm:c,onNavigateToDuplicate:p})=>{const{category:u,formData:h,resetForm:m,duplicateWarning:g,setDuplicateWarning:f}=Ir(Nr.Create),[b,v]=l(!1);a(()=>{i&&(m(),v(!1))},[i]);const y=d(()=>{v(!1),s(h)},[h,s]),C=d(()=>{if(c){const e=c(h);if(e)return void f(e)}((e,t)=>JSON.stringify(e)===JSON.stringify(N(t)))(h,u)?v(!0):y()},[h,u,c,f,y]),S=o(()=>b?((e,t)=>{switch(e){case"noisy":return T($(t));case"highlyRelevant":return k(O(t));case"costReduction":return I(E(t))}})(u,h):[],[b,u,h]),x={note:g?{status:Pe.Warning,message:g.message,action:p?{"data-id":"sampling-create-btn-view-duplicate",label:"View rule",onClick:()=>p(g.ruleId)}:void 0}:void 0,actions:[{"data-id":"sampling-create-btn-cancel",label:Jn,variant:Ie.Secondary,size:ke.S,onClick:r},{"data-id":"sampling-create-btn-submit",label:Wn,variant:Ie.Primary,size:ke.S,onClick:C,disabled:!!g}]};return e(n,{children:[t(tm,{isOpen:i,title:ii[u],subTitle:ei[u],onClose:r,footer:x}),t(tt,{isOpen:b,title:li,description:ai,onClose:()=>v(!1),denyButton:{"data-id":"sampling-create-default-continue-editing",label:oi,variant:Ie.Secondary,onClick:()=>v(!1)},approveButton:{"data-id":"sampling-create-default-confirm",label:Wn,variant:Ie.Primary,onClick:y},children:e(ae,{$gap:8,$alignItems:"flex-start",style:{width:"100%"},children:[t(ee,{size:te.XS,weight:500,color:ne.Secondary,children:ri}),t("div",{style:{width:"100%"},children:t(nr,{summary:S})})]})})]})},im=({onClose:i,onDelete:a,onSaveEdit:l,validateForm:r,onNavigateToDuplicate:s})=>{const{data:c,isEditing:p,formData:u,handleEdit:h,handleCancelEdit:m,duplicateWarning:g,setDuplicateWarning:f}=Ir(Nr.View),b=c?.rule.name||ni,v=p&&c?ti[c.category]:`${b} preview`,y=d(()=>{if(c&&p){if(r){const e=r(u);if(e)return void f(e)}l(u,c.rule.ruleId,c.samplingId),m()}},[c,p,u,l,r,f,m]),C=d(()=>{c&&a(c.rule.ruleId,c.samplingId)},[c,a]),S=o(()=>{if(!c)return;const o=g?{message:g.message,onViewRule:s?()=>s(g.ruleId):void 0}:null;return function(i){if(i.isEditing){const{onCancelEdit:o,onSave:a,onDelete:l,duplicateWarning:r}=i;return{children:e(n,{children:[t(Qh,{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(Zh,{}),t(Te,{"data-id":"sampling-view-edit-btn-cancel",label:Jn,variant:Ie.Secondary,size:ke.S,onClick:o}),t(Te,{"data-id":"sampling-view-edit-btn-save",label:qn,variant:Ie.Primary,size:ke.S,onClick:a,disabled:!!r})]})}}const{onDelete:o,onCancel:a,onEdit:l}=i;return{children:e(n,{children:[t(Qh,{onClick:o}),t(Zh,{}),t(Te,{"data-id":"sampling-view-btn-cancel",label:Jn,variant:Ie.Secondary,size:ke.S,onClick:a}),t(Te,{"data-id":"sampling-view-btn-edit",label:Zn,variant:Ie.Primary,size:ke.S,onClick:l})]})}}(p?{isEditing:!0,onCancelEdit:m,onSave:y,onDelete:C,duplicateWarning:o}:{isEditing:!1,onDelete:C,onCancel:i,onEdit:h})},[c,p,g,m,y,C,h,i,s]);return t(tm,{isOpen:!!c,title:v,subTitle:c?ei[c.category]:"",onClose:i,footer:S})},om=({isOpen:e,onClose:n,onSave:i})=>{const{localEnabled:o,resolvedPercentage:a}=Ir(Nr.EditAutoNoisy),l=d(()=>i(o,a),[i,o,a]);return t(rm,{formType:Nr.EditAutoNoisy,isOpen:e,onClose:n,onSave:l})},am=({isOpen:e,onClose:n,onSave:i})=>{const{localEnabled:o,resolvedPercentage:a}=Ir(Nr.EditAutoCostReduction),l=d(()=>i(o,a),[i,o,a]);return t(rm,{formType:Nr.EditAutoCostReduction,isOpen:e,onClose:n,onSave:l})},lm=({isOpen:e,onClose:n,onSave:i})=>{const{localEnabled:o}=Ir(Nr.EditAutoHighlyRelevant),a=d(()=>i(o),[i,o]);return t(rm,{formType:Nr.EditAutoHighlyRelevant,isOpen:e,onClose:n,onSave:a})},rm=({formType:e,isOpen:n,onClose:i,onSave:o})=>{const a=em[e];return t(tm,{isOpen:n,title:a.title,subTitle:a.subTitle,onClose:i,footer:{actions:[{"data-id":a.cancelId,label:Jn,variant:Ie.Secondary,size:ke.S,onClick:i},{"data-id":a.saveId,label:mi,variant:Ie.Primary,size:ke.S,onClick:o}]}})},sm=e=>{switch(e.formType){case Nr.Create:return t(Pr,{formType:Nr.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(nm,{...e})});case Nr.View:return t(Pr,{formType:Nr.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(im,{...e})});case Nr.EditAutoNoisy:return t(Pr,{formType:Nr.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(om,{...e})});case Nr.EditAutoCostReduction:return t(Pr,{formType:Nr.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(am,{...e})});case Nr.EditAutoHighlyRelevant:return t(Pr,{formType:Nr.EditAutoHighlyRelevant,enabled:e.enabled,children:t(lm,{...e})})}},cm=({token:i,isLoading:o,isEditing:a,onEdit:l,onCancel:r,onSave:s,formData:c,handleFormChange:d,handleErrorChange:p,formErrors:u})=>{const{CopyButton:h}=_t(),m=!a||o||!c.newToken;return fi({key:"Enter",active:!m},s),e(ie,a?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(Ne,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),p("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:u.newToken}),t(ie,{$margin:o?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:o?t(St,{title:"Saving...",withGradient:!0}):e(n,{children:[t(Te,{variant:Ie.Secondary,size:ke.S,leftIcon:ol,onClick:r,disabled:o}),t(Te,{variant:Ie.Primary,size:ke.S,leftIcon:il,onClick:s,disabled:m})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(ee,{size:te.XS,children:new Array(55).fill("•").join("")}),e(ie,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:i}),t(yt,{icon:Ka,onClick:l})]})]})},dm=({expiresAt:e,callbackValid:n,callbackExpired:i})=>{const{formatTimeAgo:l}=ln(),r=o(()=>l(e),[e,l]),s=o(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=o(()=>bi(e,0)?Pe.Error:bi(e,2592e6)?Pe.Warning:Pe.Success,[e]),d=o(()=>c===Pe.Success?il:c===Pe.Warning?_l:Cl,[c]);return a(()=>{c===Pe.Success?n():c===Pe.Error&&i()},[c]),t(Be,{text:s,children:t(ce,{leftIcon:d,label:r,status:c,invertColors:!0,useSecondaryTone:!0})})},pm=b.div`
859
+ `,lg=({onClick:n})=>{const i=v().v2.colors.red[500];return e(og,{"data-id":"sampling-view-btn-delete",onClick:n,children:[t(ee,{size:te.XS,weight:500,color:i,children:Ti}),t(ml,{size:16,fill:i})]})};const rg={[is.EditAutoNoisy]:{title:zi,subTitle:Fi,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[is.EditAutoCostReduction]:{title:Li,subTitle:_i,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[is.EditAutoHighlyRelevant]:{title:Pi,subTitle:Di,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},sg=({isOpen:e,title:n,subTitle:i,onClose:o,footer:a,renderBody:l})=>t(Xt,{isOpen:e,width:Xi,header:{icon:sr,title:n,subTitle:i,onClose:o},footer:a,children:l?l():t(le,{$padding:"12px",children:t($c,{})})}),cg=({isOpen:i,onClose:r,onSubmit:s,validateForm:c,onNavigateToDuplicate:p})=>{const{category:u,formData:h,resetForm:m,duplicateWarning:g,setDuplicateWarning:f}=ns(is.Create),[b,v]=l(!1);a(()=>{i&&(m(),v(!1))},[i]);const y=d(()=>{v(!1),s(h)},[h,s]),C=d(()=>{if(c){const e=c(h);if(e)return void f(e)}((e,t)=>JSON.stringify(e)===JSON.stringify(N(t)))(h,u)?v(!0):y()},[h,u,c,f,y]),S=o(()=>b?((e,t)=>{switch(e){case"noisy":return T(O(t));case"highlyRelevant":return k($(t));case"costReduction":return I(E(t))}})(u,h):[],[b,u,h]),x={note:g?{status:Pe.Warning,message:g.message,action:p?{"data-id":"sampling-create-btn-view-duplicate",label:"View rule",onClick:()=>p(g.ruleId)}:void 0}:void 0,actions:[{"data-id":"sampling-create-btn-cancel",label:Si,variant:Ie.Secondary,size:ke.S,onClick:r},{"data-id":"sampling-create-btn-submit",label:Wn,variant:Ie.Primary,size:ke.S,onClick:C,disabled:!!g}]};return e(n,{children:[t(sg,{isOpen:i,title:Ei[u],subTitle:ki[u],onClose:r,footer:x}),t(tt,{isOpen:b,title:Ai,description:Oi,onClose:()=>v(!1),denyButton:{"data-id":"sampling-create-default-continue-editing",label:$i,variant:Ie.Secondary,onClick:()=>v(!1)},approveButton:{"data-id":"sampling-create-default-confirm",label:Wn,variant:Ie.Primary,onClick:y},children:e(ae,{$gap:8,$alignItems:"flex-start",style:{width:"100%"},children:[t(ee,{size:te.XS,weight:500,color:ne.Secondary,children:Ri}),t("div",{style:{width:"100%"},children:t(Ar,{summary:S})})]})})]})},dg=({onClose:i,onDelete:a,onSaveEdit:l,validateForm:r,onNavigateToDuplicate:s})=>{const{data:c,isEditing:p,formData:u,handleEdit:h,handleCancelEdit:m,duplicateWarning:g,setDuplicateWarning:f}=ns(is.View),b=c?.rule.name||Ni,v=p&&c?Ii[c.category]:`${b} preview`,y=d(()=>{if(c&&p){if(r){const e=r(u);if(e)return void f(e)}l(u,c.rule.ruleId,c.samplingId),m()}},[c,p,u,l,r,f,m]),C=d(()=>{c&&a(c.rule.ruleId,c.samplingId)},[c,a]),S=o(()=>{if(!c)return;const o=g?{message:g.message,onViewRule:s?()=>s(g.ruleId):void 0}:null;return function(i){if(i.isEditing){const{onCancelEdit:o,onSave:a,onDelete:l,duplicateWarning:r}=i;return{children:e(n,{children:[t(lg,{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(ag,{}),t(Te,{"data-id":"sampling-view-edit-btn-cancel",label:Si,variant:Ie.Secondary,size:ke.S,onClick:o}),t(Te,{"data-id":"sampling-view-edit-btn-save",label:xi,variant:Ie.Primary,size:ke.S,onClick:a,disabled:!!r})]})}}const{onDelete:o,onCancel:a,onEdit:l}=i;return{children:e(n,{children:[t(lg,{onClick:o}),t(ag,{}),t(Te,{"data-id":"sampling-view-btn-cancel",label:Si,variant:Ie.Secondary,size:ke.S,onClick:a}),t(Te,{"data-id":"sampling-view-btn-edit",label:wi,variant:Ie.Primary,size:ke.S,onClick:l})]})}}(p?{isEditing:!0,onCancelEdit:m,onSave:y,onDelete:C,duplicateWarning:o}:{isEditing:!1,onDelete:C,onCancel:i,onEdit:h})},[c,p,g,m,y,C,h,i,s]);return t(sg,{isOpen:!!c,title:v,subTitle:c?ki[c.category]:"",onClose:i,footer:S})},pg=({isOpen:e,onClose:n,onSave:i})=>{const{localEnabled:o,resolvedPercentage:a}=ns(is.EditAutoNoisy),l=d(()=>i(o,a),[i,o,a]);return t(mg,{formType:is.EditAutoNoisy,isOpen:e,onClose:n,onSave:l})},ug=({isOpen:e,onClose:n,onSave:i})=>{const{localEnabled:o,resolvedPercentage:a}=ns(is.EditAutoCostReduction),l=d(()=>i(o,a),[i,o,a]);return t(mg,{formType:is.EditAutoCostReduction,isOpen:e,onClose:n,onSave:l})},hg=({isOpen:e,onClose:n,onSave:i})=>{const{localEnabled:o}=ns(is.EditAutoHighlyRelevant),a=d(()=>i(o),[i,o]);return t(mg,{formType:is.EditAutoHighlyRelevant,isOpen:e,onClose:n,onSave:a})},mg=({formType:e,isOpen:n,onClose:i,onSave:o})=>{const a=rg[e];return t(sg,{isOpen:n,title:a.title,subTitle:a.subTitle,onClose:i,footer:{actions:[{"data-id":a.cancelId,label:Si,variant:Ie.Secondary,size:ke.S,onClick:i},{"data-id":a.saveId,label:Mi,variant:Ie.Primary,size:ke.S,onClick:o}]}})},gg=e=>{switch(e.formType){case is.Create:return t(ds,{formType:is.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(cg,{...e})});case is.View:return t(ds,{formType:is.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(dg,{...e})});case is.EditAutoNoisy:return t(ds,{formType:is.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(pg,{...e})});case is.EditAutoCostReduction:return t(ds,{formType:is.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(ug,{...e})});case is.EditAutoHighlyRelevant:return t(ds,{formType:is.EditAutoHighlyRelevant,enabled:e.enabled,children:t(hg,{...e})})}},fg=({token:i,isLoading:o,isEditing:a,onEdit:l,onCancel:r,onSave:s,formData:c,handleFormChange:d,handleErrorChange:p,formErrors:u})=>{const{CopyButton:h}=_t(),m=!a||o||!c.newToken;return Bi({key:"Enter",active:!m},s),e(ie,a?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(Ne,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),p("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:u.newToken}),t(ie,{$margin:o?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:o?t(St,{title:"Saving...",withGradient:!0}):e(n,{children:[t(Te,{variant:Ie.Secondary,size:ke.S,leftIcon:$l,onClick:r,disabled:o}),t(Te,{variant:Ie.Primary,size:ke.S,leftIcon:El,onClick:s,disabled:m})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(ee,{size:te.XS,children:new Array(55).fill("•").join("")}),e(ie,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:i}),t(yt,{icon:yl,onClick:l})]})]})},bg=({expiresAt:e,callbackValid:n,callbackExpired:i})=>{const{formatTimeAgo:l}=ln(),r=o(()=>l(e),[e,l]),s=o(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=o(()=>Ui(e,0)?Pe.Error:Ui(e,2592e6)?Pe.Warning:Pe.Success,[e]),d=o(()=>c===Pe.Success?El:c===Pe.Warning?dr:jl,[c]);return a(()=>{c===Pe.Success?n():c===Pe.Error&&i()},[c]),t(Be,{text:s,children:t(ce,{leftIcon:d,label:r,status:c,invertColors:!0,useSecondaryTone:!0})})},vg=b.div`
792
860
  display: flex;
793
861
  flex-direction: column;
794
862
  gap: 12px;
@@ -796,7 +864,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
796
864
  border-radius: 12px;
797
865
  border: 1px solid ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[500]:e.v2.colors.silver[600]};
798
866
  background-color: ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[1e3]:e.v2.colors.silver[800]};
799
- `,um=({children:e})=>{const n=v();return t(ee,{size:te.XXXS,color:n.v2.colors.grey[150],children:e})},hm=({token:n})=>{const{tokensApi:i}=Sr(),[o,a]=l(!1),[r,s]=l(!1),[c,d]=l(!1),{formData:p,handleFormChange:u,formErrors:h,handleErrorChange:m,resetFormData:g}=qt({newToken:""});return t(ut,{richTitle:{icon:Ll,title:"Odigos Pro Token"},children:e(pm,{$isExpired:c,children:[e(ie,{$justifyContent:"space-between",children:[e(ae,{$gap:4,children:[t(um,{children:"Issued for"}),t(ee,{size:te.XS,children:n.name||"N/A"})]}),e(ae,{$gap:4,children:[t(um,{children:"Expiration"}),t(dm,{expiresAt:n.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(ae,{})]}),t(ie,{children:e(ae,{children:[t(um,{children:"Token"}),t(cm,{token:n.token,newToken:p.newToken,isLoading:o,isEditing:r,onEdit:()=>s(!0),onCancel:()=>(s(!1),void u("newToken","")),onSave:()=>(async()=>{if(!i.updateToken)return;a(!0);const e=await i.updateToken(p.newToken.trim());a(!1),e?.error?m("newToken",e.error):(s(!1),g())})(),formData:p,handleFormChange:u,handleErrorChange:m,formErrors:h})]})})]})})},mm=b.div`
867
+ `,yg=({children:e})=>{const n=v();return t(ee,{size:te.XXXS,color:n.v2.colors.grey[150],children:e})},Cg=({token:n})=>{const{tokensApi:i}=qr(),[o,a]=l(!1),[r,s]=l(!1),[c,d]=l(!1),{formData:p,handleFormChange:u,formErrors:h,handleErrorChange:m,resetFormData:g}=qt({newToken:""});return t(ut,{richTitle:{icon:pr,title:"Odigos Pro Token"},children:e(vg,{$isExpired:c,children:[e(ie,{$justifyContent:"space-between",children:[e(ae,{$gap:4,children:[t(yg,{children:"Issued for"}),t(ee,{size:te.XS,children:n.name||"N/A"})]}),e(ae,{$gap:4,children:[t(yg,{children:"Expiration"}),t(bg,{expiresAt:n.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(ae,{})]}),t(ie,{children:e(ae,{children:[t(yg,{children:"Token"}),t(fg,{token:n.token,newToken:p.newToken,isLoading:o,isEditing:r,onEdit:()=>s(!0),onCancel:()=>(s(!1),void u("newToken","")),onSave:()=>(async()=>{if(!i.updateToken)return;a(!0);const e=await i.updateToken(p.newToken.trim());a(!1),e?.error?m("newToken",e.error):(s(!1),g())})(),formData:p,handleFormChange:u,handleErrorChange:m,formErrors:h})]})})]})})},Sg=b.div`
800
868
  display: flex;
801
869
  flex-direction: column;
802
870
  align-items: center;
@@ -805,23 +873,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
805
873
  padding: 12px 24px;
806
874
  border-radius: 8px;
807
875
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
808
- `,gm=()=>{const{progress:n}=$t(),{describeApi:i,namespacesApi:o}=Sr(),{items:a}=o.useNamespaces(),[r,s]=l(null),{formData:c,handleFormChange:d,resetFormData:p}=qt({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(ut,{richTitle:{icon:Fl,title:"Diagnose"},children:r?e(mm,{children:[t(St,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof n[Dt.DownloadingDiagnose]?.percentage,percentage:n[Dt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof n[Dt.DownloadingDiagnose]?.percentage,visualIcon:Dl,startedAt:r}),n[Dt.DownloadingDiagnose]?.list?.length&&t(ae,{$width:"100%",children:n[Dt.DownloadingDiagnose].list.map((n,i)=>e(ie,{$gap:4,$alignItems:"center",children:[n.status===Pe.Success?t(il,{size:16}):n.status===Pe.Error?t(ol,{size:16}):t(St,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(ee,{size:te.XXXS,color:ne.Secondary,children:n.label})]},`diagnose-item-${i}-${n.label}`))})]}):e(ae,{$gap:24,children:[t(ee,{size:te.XXS,color:ne.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(ae,{$gap:16,children:[e(ie,{$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(ee,{size:te.XXXS,color:ne.Secondary,children:"Include pprof profiles"})]}),e(ie,{$gap:8,children:[t(Q,{label:"Metrics",value:c.includeMetrics,onChange:e=>d("includeMetrics",e)}),t(ee,{size:te.XXXS,color:ne.Secondary,children:"Include Prometheus metrics"})]}),e(ie,{$gap:8,children:[t(Q,{label:"Source Workloads",value:c.includeSourceWorkloads,onChange:e=>d("includeSourceWorkloads",e)}),t(ee,{size:te.XXXS,color:ne.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(vi,{alignX:Ci.Left,alignY:yi.Bottom,items:a.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:Ie.Secondary,leftIcon:c.sourceWorkloadNamespaces.length?()=>t(ce,{label:c.sourceWorkloadNamespaces.length,status:Pe.Default}):void 0}}),t(ie,{$justifyContent:"flex-end",children:t(Te,{label:"Download Diagnose",rightIcon:Dl,variant:Ie.Primary,onClick:async()=>{i.downloadDiagnose&&(s(Date.now()),await i.downloadDiagnose(c),s(null),p())},disabled:null!==r})})]})})},fm=()=>{const{platformType:e,version:n,tier:i}=S(),{describeApi:o}=Sr(),[r,s]=l(null);return a(()=>{o.fetchDescribeOdigos&&o.fetchDescribeOdigos().then(({data:e})=>s(e?.describeOdigos??null))},[]),t(ut,{richTitle:{icon:kl,title:"General Information"},children:t(Gt,{cellsPerRow:2,items:[{id:Si(),title:"Odigos Version",label:n},{id:Si(),title:`${e.toUpperCase()} Version`,label:r?.kubernetesVersion?.value||"-"},{id:Si(),title:"Installation Method",label:r?.installationMethod?.value||"-"},{id:Si(),title:"Tier",label:i}]})})},bm=({isOpen:n,onClose:i})=>{const{describeApi:o,tokensApi:a}=Sr(),l=a.useTokens().items[0];return e(Xt,{isOpen:n,header:{icon:kl,title:"System Overview",onClose:i},children:[o.fetchDescribeOdigos&&t(fm,{}),a.updateToken&&l&&t(hm,{token:l}),o.downloadDiagnose&&t(gm,{})]})},vm=({isOpen:i,onClose:o,onCloseEnd:a})=>{const{addDataStreams:l,setSelectedStreamName:r}=it(),{dataStreamsApi:s}=Sr(),{requestSubmit:c}=Tr(),p=d(async e=>{s.create?await s.create(e):(l([e]),r(e.name)),o()},[s,l,r,o]),u=d(()=>c(p),[c,p]);return fi({key:"Enter",active:i},u),e(n,{children:[t(tt,{isOpen:i,onClose:o,onCloseEnd:a,title:nt.NAME_YOUR_STREAM,description:nt.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:Ft.DONE,variant:Ie.Primary,onClick:u},denyButton:{"data-id":"add-stream-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:o},children:t(Gs,{autoFocus:!0})}),t(js,{})]})},ym=({isOpen:i,onClose:o,onCloseEnd:l,dataStreamName:r})=>{const{dataStreamsApi:s}=Sr(),{genericForm:c,loadDataStream:p,requestSubmit:u}=Tr();a(()=>{i&&r&&p(r)},[i,r]);const h=!!c?.isFormDirty,m=d(async e=>{await s.update(r,e),o()},[s,r,o]),g=d(()=>u(m),[u,m]);return fi({key:"Enter",active:i},g),e(n,{children:[t(tt,{isOpen:i,onClose:o,onCloseEnd:l,title:nt.RENAME_STREAM(r),description:nt.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:g,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:o},children:t(Gs,{autoFocus:!0})}),t(js,{})]})},Cm=({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)"})})]})]}),Sm=b.div`
876
+ `,xg=()=>{const{progress:n}=Ot(),{describeApi:i,namespacesApi:o}=qr(),{items:a}=o.useNamespaces(),[r,s]=l(null),{formData:c,handleFormChange:d,resetFormData:p}=qt({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(ut,{richTitle:{icon:ur,title:"Diagnose"},children:r?e(Sg,{children:[t(St,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof n[Dt.DownloadingDiagnose]?.percentage,percentage:n[Dt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof n[Dt.DownloadingDiagnose]?.percentage,visualIcon:or,startedAt:r}),n[Dt.DownloadingDiagnose]?.list?.length&&t(ae,{$width:"100%",children:n[Dt.DownloadingDiagnose].list.map((n,i)=>e(ie,{$gap:4,$alignItems:"center",children:[n.status===Pe.Success?t(El,{size:16}):n.status===Pe.Error?t($l,{size:16}):t(St,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(ee,{size:te.XXXS,color:ne.Secondary,children:n.label})]},`diagnose-item-${i}-${n.label}`))})]}):e(ae,{$gap:24,children:[t(ee,{size:te.XXS,color:ne.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(ae,{$gap:16,children:[e(ie,{$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(ee,{size:te.XXXS,color:ne.Secondary,children:"Include pprof profiles"})]}),e(ie,{$gap:8,children:[t(Q,{label:"Metrics",value:c.includeMetrics,onChange:e=>d("includeMetrics",e)}),t(ee,{size:te.XXXS,color:ne.Secondary,children:"Include Prometheus metrics"})]}),e(ie,{$gap:8,children:[t(Q,{label:"Source Workloads",value:c.includeSourceWorkloads,onChange:e=>d("includeSourceWorkloads",e)}),t(ee,{size:te.XXXS,color:ne.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(Vi,{alignX:ji.Left,alignY:Hi.Bottom,items:a.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:Ie.Secondary,leftIcon:c.sourceWorkloadNamespaces.length?()=>t(ce,{label:c.sourceWorkloadNamespaces.length,status:Pe.Default}):void 0}}),t(ie,{$justifyContent:"flex-end",children:t(Te,{label:"Download Diagnose",rightIcon:or,variant:Ie.Primary,onClick:async()=>{i.downloadDiagnose&&(s(Date.now()),await i.downloadDiagnose(c),s(null),p())},disabled:null!==r})})]})})},wg=()=>{const{platformType:e,version:n,tier:i}=S(),{describeApi:o}=qr(),[r,s]=l(null);return a(()=>{o.fetchDescribeOdigos&&o.fetchDescribeOdigos().then(({data:e})=>s(e?.describeOdigos??null))},[]),t(ut,{richTitle:{icon:Jl,title:"General Information"},children:t(Gt,{cellsPerRow:2,items:[{id:Gi(),title:"Odigos Version",label:n},{id:Gi(),title:`${e.toUpperCase()} Version`,label:r?.kubernetesVersion?.value||"-"},{id:Gi(),title:"Installation Method",label:r?.installationMethod?.value||"-"},{id:Gi(),title:"Tier",label:i}]})})},Tg=({isOpen:n,onClose:i})=>{const{describeApi:o,tokensApi:a}=qr(),l=a.useTokens().items[0];return e(Xt,{isOpen:n,header:{icon:Jl,title:"System Overview",onClose:i},children:[o.fetchDescribeOdigos&&t(wg,{}),a.updateToken&&l&&t(Cg,{token:l}),o.downloadDiagnose&&t(xg,{})]})},kg=({isOpen:i,onClose:o,onCloseEnd:a})=>{const{addDataStreams:l,setSelectedStreamName:r}=it(),{dataStreamsApi:s}=qr(),{requestSubmit:c}=es(),p=d(async e=>{s.create?await s.create(e):(l([e]),r(e.name)),o()},[s,l,r,o]),u=d(()=>c(p),[c,p]);return Bi({key:"Enter",active:i},u),e(n,{children:[t(tt,{isOpen:i,onClose:o,onCloseEnd:a,title:nt.NAME_YOUR_STREAM,description:nt.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:Ft.DONE,variant:Ie.Primary,onClick:u},denyButton:{"data-id":"add-stream-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:o},children:t(xc,{autoFocus:!0})}),t(Sc,{})]})},Ig=({isOpen:i,onClose:o,onCloseEnd:l,dataStreamName:r})=>{const{dataStreamsApi:s}=qr(),{genericForm:c,loadDataStream:p,requestSubmit:u}=es();a(()=>{i&&r&&p(r)},[i,r]);const h=!!c?.isFormDirty,m=d(async e=>{await s.update(r,e),o()},[s,r,o]),g=d(()=>u(m),[u,m]);return Bi({key:"Enter",active:i},g),e(n,{children:[t(tt,{isOpen:i,onClose:o,onCloseEnd:l,title:nt.RENAME_STREAM(r),description:nt.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:g,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:o},children:t(xc,{autoFocus:!0})}),t(Sc,{})]})},Ng=({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)"})})]})]}),Eg=b.div`
809
877
  position: absolute;
810
878
  top: 50%;
811
879
  left: 50%;
812
880
  transform: translate(-50%, -50%);
813
881
  z-index: ${({theme:e})=>e.v2.zIndex.modal};
814
- `,xm=()=>{const{drawerType:n,setDrawerType:i}=Cn(),o=n===wi.OnboardingDone,a=()=>i(null);return e(xi,{isOpen:o,onClose:a,children:[t(Cm,{}),t(Sm,{children:e(ae,{$gap:32,$alignItems:"center",children:[e(ae,{$gap:24,$alignItems:"center",children:[t(ee,{size:te.L,weight:500,children:"Welcome to"}),t(fr,{size:260}),t(ee,{size:te.S,weight:400,children:"Your observability control plane is ready."})]}),t(Te,{label:"Get Started",rightIcon:ja,onClick:a})]})})]})},wm=b.div`
882
+ `,$g=()=>{const{drawerType:n,setDrawerType:i}=Cn(),o=n===Ki.OnboardingDone,a=()=>i(null);return e(Wi,{isOpen:o,onClose:a,children:[t(Ng,{}),t(Eg,{children:e(ae,{$gap:32,$alignItems:"center",children:[e(ae,{$gap:24,$alignItems:"center",children:[t(ee,{size:te.L,weight:500,children:"Welcome to"}),t(Gr,{size:260}),t(ee,{size:te.S,weight:400,children:"Your observability control plane is ready."})]}),t(Te,{label:"Get Started",rightIcon:fl,onClick:a})]})})]})},Og=b.div`
815
883
  display: flex;
816
884
  flex-direction: column;
817
885
  gap: 8px;
818
886
  padding: 4px 8px;
819
887
  border-radius: 8px;
820
888
  width: 100%;
821
- `,Tm=b.div`
889
+ `,Ag=b.div`
822
890
  white-space: pre;
823
891
  overflow-x: auto;
824
- `,km=({name:n,recommended:i,toggleLabel:o,enabled:a,onEnabledChange:l,summary:r,toggleName:s})=>{const c=v();return e(wm,{children:[e(ie,{$gap:8,$justifyContent:"space-between",children:[e(ie,{$gap:4,children:[t(ee,{size:te.XS,color:c.v2.colors.white[500],nowrap:!0,children:n}),i&&t(ce,{label:Ti,leftIcon:Ml,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:te.XXXS})]}),t(ge,{name:s??`sampling-onboarding-toggle-${n}`,label:o,labelAlign:fe.Left,value:a,onChange:l,size:Et.S})]}),t(Tm,{children:t(w,{parts:r})})]})},Im=b.div`
892
+ `,Rg=({name:n,recommended:i,toggleLabel:o,enabled:a,onEnabledChange:l,summary:r,toggleName:s})=>{const c=v();return e(Og,{children:[e(ie,{$gap:8,$justifyContent:"space-between",children:[e(ie,{$gap:4,children:[t(ee,{size:te.XS,color:c.v2.colors.white[500],nowrap:!0,children:n}),i&&t(ce,{label:Yi,leftIcon:hr,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:te.XXXS})]}),t(ge,{name:s??`sampling-onboarding-toggle-${n}`,label:o,labelAlign:fe.Left,value:a,onChange:l,size:Et.S})]}),t(Ag,{children:t(w,{parts:r})})]})},Dg=b.div`
825
893
  position: relative;
826
894
  display: flex;
827
895
  align-items: center;
@@ -831,18 +899,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
831
899
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
832
900
  border-top-left-radius: 18px;
833
901
  border-top-right-radius: 18px;
834
- `,Nm=b.div`
902
+ `,Pg=b.div`
835
903
  position: absolute;
836
904
  left: 16px;
837
905
  top: 50%;
838
906
  transform: translateY(-50%);
839
- `,Em=b.div`
907
+ `,_g=b.div`
840
908
  height: 16px;
841
909
  width: 100%;
842
910
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
843
911
  border-top-left-radius: 18px;
844
912
  border-top-right-radius: 18px;
845
- `,Om=b.div`
913
+ `,Lg=b.div`
846
914
  width: ${({$width:e})=>e}px;
847
915
  display: flex;
848
916
  flex-direction: column;
@@ -850,7 +918,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
850
918
  gap: 22px;
851
919
  padding: 8px 32px 32px 32px;
852
920
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
853
- `,$m=e=>t(zl,{rotate:90,...e}),Am=({children:n,center:i,onNext:o,nextLabel:a=ki,nextLoading:l})=>e(ie,{$gap:8,$justifyContent:i?"center":"flex-end",$padding:"0 16px 16px 16px",children:[n,o&&t(Te,{"data-id":"sampling-onboarding-btn-next",label:a,rightIcon:$m,variant:Ie.Primary,size:ke.M,onClick:o,loading:l})]}),Rm=e=>t(zl,{rotate:-90,...e}),Dm=({title:n,onBack:i})=>{const o=v();return e(Im,{$hasBack:!!i,children:[i&&t(Nm,{children:t(yt,{"data-id":"sampling-onboarding-back",icon:Rm,size:Ct.M,onClick:i})}),t(ee,{size:te.M,weight:500,color:o.v2.colors.white[500],align:"center",children:n})]})},Pm=b.div`
921
+ `,Fg=e=>t(mr,{rotate:90,...e}),zg=({children:n,center:i,onNext:o,nextLabel:a=Ji,nextLoading:l})=>e(ie,{$gap:8,$justifyContent:i?"center":"flex-end",$padding:"0 16px 16px 16px",children:[n,o&&t(Te,{"data-id":"sampling-onboarding-btn-next",label:a,rightIcon:Fg,variant:Ie.Primary,size:ke.M,onClick:o,loading:l})]}),Mg=e=>t(mr,{rotate:-90,...e}),Xg=({title:n,onBack:i})=>{const o=v();return e(Dg,{$hasBack:!!i,children:[i&&t(Pg,{children:t(yt,{"data-id":"sampling-onboarding-back",icon:Mg,size:Ct.M,onClick:i})}),t(ee,{size:te.M,weight:500,color:o.v2.colors.white[500],align:"center",children:n})]})},Bg=b.div`
854
922
  box-sizing: border-box;
855
923
  width: ${({$width:e})=>e??"100%"};
856
924
  ${({$fillHeight:e})=>e&&y`
@@ -863,16 +931,16 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
863
931
  padding: 16px;
864
932
  border-radius: 16px;
865
933
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
866
- `,_m=({children:e,fillHeight:n,width:i})=>t(Pm,{$fillHeight:n,$width:i,children:e}),Lm=b.ul`
934
+ `,Ug=({children:e,fillHeight:n,width:i})=>t(Bg,{$fillHeight:n,$width:i,children:e}),Vg=b.ul`
867
935
  margin: 0;
868
936
  padding: 0;
869
937
  list-style: disc;
870
- `,Fm=b.li`
938
+ `,Hg=b.li`
871
939
  margin-left: 18px;
872
940
  & + & {
873
941
  margin-top: 6px;
874
942
  }
875
- `,Mm=({items:e,color:n})=>{const i=v(),o=n||i.v2.colors.silver[200];return t(Lm,{children:e.map((e,n)=>t(Fm,{style:{color:o},children:t(ee,{size:te.XXS,color:o,children:e})},n))})},zm=({items:n})=>{const i=v();return t(ae,{$gap:16,children:n.map((n,o)=>e(ie,{$gap:8,$alignItems:"flex-start",children:[e(ee,{size:te.XS,color:i.v2.colors.silver[200],weight:400,children:[o+1,"."]}),e(ae,{$gap:2,children:[t(ee,{size:te.XS,color:i.v2.colors.white[500],weight:500,children:n.title}),t(ee,{size:te.XS,color:i.v2.colors.silver[200],children:n.description})]})]},o))})},Xm=({message:e})=>t(De,{status:Pe.Default,message:e,fullWidth:!0,smallIcon:!0}),Bm=b.div`
943
+ `,jg=({items:e,color:n})=>{const i=v(),o=n||i.v2.colors.silver[200];return t(Vg,{children:e.map((e,n)=>t(Hg,{style:{color:o},children:t(ee,{size:te.XXS,color:o,children:e})},n))})},Gg=({items:n})=>{const i=v();return t(ae,{$gap:16,children:n.map((n,o)=>e(ie,{$gap:8,$alignItems:"flex-start",children:[e(ee,{size:te.XS,color:i.v2.colors.silver[200],weight:400,children:[o+1,"."]}),e(ae,{$gap:2,children:[t(ee,{size:te.XS,color:i.v2.colors.white[500],weight:500,children:n.title}),t(ee,{size:te.XS,color:i.v2.colors.silver[200],children:n.description})]})]},o))})},Wg=({message:e})=>t(De,{status:Pe.Default,message:e,fullWidth:!0,smallIcon:!0}),Kg=b.div`
876
944
  width: 100%;
877
945
  padding: 8px;
878
946
  display: flex;
@@ -880,12 +948,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
880
948
  gap: 4px;
881
949
  border-radius: 16px;
882
950
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
883
- `,Um=b.div`
951
+ `,Yg=b.div`
884
952
  display: flex;
885
953
  align-items: center;
886
954
  gap: 8px;
887
955
  padding: 4px 8px 12px 8px;
888
- `,Vm=b.div`
956
+ `,Jg=b.div`
889
957
  width: 100%;
890
958
  display: flex;
891
959
  flex-direction: column;
@@ -893,20 +961,20 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
893
961
  padding: 8px;
894
962
  border-radius: 12px;
895
963
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
896
- `,Hm=({children:e})=>{const n=v();return t(ee,{size:te.S,weight:500,color:n.v2.colors.white[500],align:"center",children:e})},jm=b.div`
964
+ `,qg=({children:e})=>{const n=v();return t(ee,{size:te.S,weight:500,color:n.v2.colors.white[500],align:"center",children:e})},Zg=b.div`
897
965
  white-space: pre-line;
898
- `,Gm=({enabled:i,onEnabledChange:a,onBack:l,onNext:r})=>{const s=v(),c=o(()=>A({enabled:i,keepPercentage:0}),[i]);return e(n,{children:[t(Dm,{title:Ii,onBack:l}),e(Om,{$width:854,children:[t(Hm,{children:Ni}),e(ae,{$gap:8,$width:"100%",children:[t(_m,{children:t(jm,{children:t(ee,{size:te.XXS,color:s.v2.colors.silver[200],children:Ei})})}),e(ae,{$gap:8,$width:"100%",children:[e(Bm,{children:[t(Um,{children:t(ee,{size:te.S,weight:500,color:s.v2.colors.white[500],children:Oi})}),t(Vm,{children:t(km,{name:Ai,recommended:!0,toggleLabel:$i,enabled:i,onEnabledChange:a,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(Xm,{message:Ri})]})]})]}),t(Am,{onNext:r})]})},Wm=e=>t(zl,{rotate:90,...e}),Km=({onClose:i})=>{const o=v();return e(n,{children:[t(Em,{}),e(Om,{$width:732,children:[t(Di,{icon:Pl}),e(ae,{$gap:16,$alignItems:"center",$width:"100%",children:[t(ee,{size:te.M,weight:500,color:o.v2.colors.white[500],children:Pi}),_i.split("\n").map((e,n)=>t(Hm,{children:e},`subtitle-${n}-${e}`)),e(_m,{children:[t(ee,{size:te.XS,color:o.v2.colors.silver[200],children:Li}),t(Mm,{color:o.v2.colors.white[500],items:[Fi,Mi,zi]})]})]})]}),t(Am,{center:!0,children:t(Te,{"data-id":"sampling-onboarding-btn-go-to",label:Xi,rightIcon:Wm,variant:Ie.Primary,size:ke.M,onClick:i})})]})},Ym=e=>t(zl,{rotate:90,...e}),Jm=b.div`
966
+ `,Qg=({enabled:i,onEnabledChange:a,onBack:l,onNext:r})=>{const s=v(),c=o(()=>A({enabled:i,keepPercentage:0}),[i]);return e(n,{children:[t(Xg,{title:qi,onBack:l}),e(Lg,{$width:854,children:[t(qg,{children:Zi}),e(ae,{$gap:8,$width:"100%",children:[t(Ug,{children:t(Zg,{children:t(ee,{size:te.XXS,color:s.v2.colors.silver[200],children:Qi})})}),e(ae,{$gap:8,$width:"100%",children:[e(Kg,{children:[t(Yg,{children:t(ee,{size:te.S,weight:500,color:s.v2.colors.white[500],children:eo})}),t(Jg,{children:t(Rg,{name:no,recommended:!0,toggleLabel:to,enabled:i,onEnabledChange:a,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(Wg,{message:io})]})]})]}),t(zg,{onNext:r})]})},ef=e=>t(mr,{rotate:90,...e}),tf=({onClose:i})=>{const o=v();return e(n,{children:[t(_g,{}),e(Lg,{$width:732,children:[t(oo,{icon:sr}),e(ae,{$gap:16,$alignItems:"center",$width:"100%",children:[t(ee,{size:te.M,weight:500,color:o.v2.colors.white[500],children:ao}),lo.split("\n").map((e,n)=>t(qg,{children:e},`subtitle-${n}-${e}`)),e(Ug,{children:[t(ee,{size:te.XS,color:o.v2.colors.silver[200],children:ro}),t(jg,{color:o.v2.colors.white[500],items:[so,co,po]})]})]})]}),t(zg,{center:!0,children:t(Te,{"data-id":"sampling-onboarding-btn-go-to",label:uo,rightIcon:ef,variant:Ie.Primary,size:ke.M,onClick:i})})]})},nf=e=>t(mr,{rotate:90,...e}),of=b.div`
899
967
  display: flex;
900
968
  flex-direction: column;
901
969
  align-items: center;
902
970
  gap: 8px;
903
971
  width: 100%;
904
- `,qm=({onSkip:i,onNext:o})=>{const a=v();return e(n,{children:[t(Em,{}),e(Om,{$width:732,children:[t(Di,{icon:Pl}),e(ae,{$gap:16,$alignItems:"center",$width:"100%",children:[e(Jm,{children:[t(ee,{size:te.M,weight:500,color:a.v2.colors.white[500],children:Bi}),t(Hm,{children:Ui})]}),e(_m,{children:[t(ee,{size:te.XS,color:a.v2.colors.silver[200],children:Vi}),t(zm,{items:[{title:ji,description:Hi},{title:Wi,description:Gi},{title:Yi,description:Ki}]}),t(Xm,{message:Ji})]})]})]}),e(Am,{center:!0,children:[t(Te,{"data-id":"sampling-onboarding-btn-skip",label:qi,variant:Ie.Secondary,onClick:i}),t(Te,{"data-id":"sampling-onboarding-btn-start",label:Zi,rightIcon:Ym,variant:Ie.Primary,onClick:o})]})]})},Zm=b.div`
972
+ `,af=({onSkip:i,onNext:o})=>{const a=v();return e(n,{children:[t(_g,{}),e(Lg,{$width:732,children:[t(oo,{icon:sr}),e(ae,{$gap:16,$alignItems:"center",$width:"100%",children:[e(of,{children:[t(ee,{size:te.M,weight:500,color:a.v2.colors.white[500],children:ho}),t(qg,{children:mo})]}),e(Ug,{children:[t(ee,{size:te.XS,color:a.v2.colors.silver[200],children:go}),t(Gg,{items:[{title:bo,description:fo},{title:yo,description:vo},{title:So,description:Co}]}),t(Wg,{message:xo})]})]})]}),e(zg,{center:!0,children:[t(Te,{"data-id":"sampling-onboarding-btn-skip",label:wo,variant:Ie.Secondary,onClick:i}),t(Te,{"data-id":"sampling-onboarding-btn-start",label:To,rightIcon:nf,variant:Ie.Primary,onClick:o})]})]})},lf=b.div`
905
973
  display: flex;
906
974
  align-items: stretch;
907
975
  gap: 16px;
908
976
  width: 100%;
909
- `,Qm=b.div`
977
+ `,rf=b.div`
910
978
  flex: 1;
911
979
  display: flex;
912
980
  flex-direction: column;
@@ -926,18 +994,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
926
994
  background-color: ${t.v2.colors.silver[700]};
927
995
  }
928
996
  `}
929
- `,eg=b.div`
997
+ `,sf=b.div`
930
998
  display: flex;
931
999
  align-items: center;
932
1000
  gap: 8px;
933
1001
  padding: 12px 16px;
934
- `,tg=b.div`
1002
+ `,cf=b.div`
935
1003
  flex: 1;
936
1004
  padding: 8px;
937
1005
  display: flex;
938
1006
  flex-direction: column;
939
1007
  gap: 8px;
940
- `,ng=b.div`
1008
+ `,df=b.div`
941
1009
  flex: 1;
942
1010
  display: flex;
943
1011
  flex-direction: column;
@@ -945,17 +1013,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
945
1013
  padding: 12px;
946
1014
  border-radius: 12px;
947
1015
  background-color: ${({theme:e,$selected:t})=>t?e.v2.colors.purple[900]:e.v2.colors.silver[900]};
948
- `,ig=b.div`
1016
+ `,pf=b.div`
949
1017
  display: flex;
950
1018
  justify-content: flex-end;
951
- `,og=b.div`
1019
+ `,uf=b.div`
952
1020
  display: flex;
953
1021
  align-items: center;
954
1022
  gap: 8px;
955
1023
  padding: 4px 12px 4px 4px;
956
1024
  border-radius: 8px;
957
1025
  background-color: ${({theme:e})=>e.v2.colors.yellow[1e3]};
958
- `,ag=b.div`
1026
+ `,hf=b.div`
959
1027
  display: flex;
960
1028
  align-items: center;
961
1029
  justify-content: center;
@@ -963,13 +1031,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
963
1031
  height: 24px;
964
1032
  border-radius: 6px;
965
1033
  background-color: ${({theme:e})=>e.v2.colors.yellow[900]};
966
- `,lg=({selected:n,onSelect:i,name:o,description:a,badgeProps:l,bullets:r,warning:s,onReadMore:c})=>{const d=v(),p=n?d.v2.colors.white[500]:d.v2.colors.silver[200];return e(Qm,{$selected:n,onClick:i,children:[e(eg,{children:[t(Se,{"data-id":`sampling-onboarding-radio-${o}`,value:n,onChange:i,size:we.L}),t(Pl,{size:24,fill:d.v2.colors.white[500]}),t(ee,{size:te.S,weight:500,color:d.v2.colors.white[500],children:o})]}),e(tg,{children:[e(ng,{$selected:n,children:[e(ae,{$gap:8,children:[t(ce,{...l,textSize:te.XXXS}),t(ee,{size:te.XXS,color:p,children:a})]}),r&&r.length>0&&t(Mm,{color:p,items:r}),s&&e(og,{children:[t(ag,{children:t(_l,{size:18,fill:d.v2.colors.yellow[500]})}),t(ee,{size:te.XXXS,color:d.v2.colors.yellow[500],children:s})]})]}),c&&t(ig,{children:t(Te,{"data-id":`sampling-onboarding-btn-read-more-${o}`,label:fo,rightIcon:Ga,variant:Ie.Text,size:ke.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},rg=({strategy:i,onStrategyChange:o,onBack:a,onNext:l,docsUrl:r})=>{const s=v(),c=r?()=>window.open(r,"_blank"):void 0;return e(n,{children:[t(Dm,{title:Qi,onBack:a}),e(Om,{$width:854,children:[t(Hm,{children:eo}),e(Zm,{children:[t(lg,{selected:"keep-list"===i,onSelect:()=>o("keep-list"),name:lo,description:ao,badgeProps:{label:oo,backgroundColor:s.v2.colors.purple[500],textColor:s.v2.colors.white[500]},bullets:[no,io],warning:to,onReadMore:c}),t(lg,{selected:"drop-list"===i,onSelect:()=>o("drop-list"),name:uo,description:po,badgeProps:{label:co,backgroundColor:s.v2.colors.green[500],textColor:s.v2.colors.black[500]},bullets:[ro,so],onReadMore:c}),t(lg,{selected:"advanced"===i,onSelect:()=>o("advanced"),name:go,description:mo,badgeProps:{label:ho,backgroundColor:s.v2.colors.blue[700],textColor:s.v2.colors.white[500]},onReadMore:c})]})]}),t(Am,{onNext:l})]})},sg=({onBack:i,onNext:a,submitting:l})=>{const r=v(),s=o(()=>[{title:Co,bullets:[bo,vo,yo]},{title:Io,bullets:[So,xo,wo,To,ko]}],[]);return e(n,{children:[t(Dm,{title:No,onBack:i}),e(Om,{$width:854,children:[t(Hm,{children:Eo}),t(ie,{$gap:16,$width:"100%",$alignItems:"stretch",children:s.map((n,i)=>e(_m,{fillHeight:!0,width:"50%",children:[t(ee,{size:te.XS,color:r.v2.colors.white[500],children:n.title}),t(Mm,{items:n.bullets})]},i))}),t(Xm,{message:Oo})]}),t(Am,{onNext:a,nextLoading:l})]})},cg=b.div`
1034
+ `,mf=({selected:n,onSelect:i,name:o,description:a,badgeProps:l,bullets:r,warning:s,onReadMore:c})=>{const d=v(),p=n?d.v2.colors.white[500]:d.v2.colors.silver[200];return e(rf,{$selected:n,onClick:i,children:[e(sf,{children:[t(Se,{"data-id":`sampling-onboarding-radio-${o}`,value:n,onChange:i,size:we.L}),t(sr,{size:24,fill:d.v2.colors.white[500]}),t(ee,{size:te.S,weight:500,color:d.v2.colors.white[500],children:o})]}),e(cf,{children:[e(df,{$selected:n,children:[e(ae,{$gap:8,children:[t(ce,{...l,textSize:te.XXXS}),t(ee,{size:te.XXS,color:p,children:a})]}),r&&r.length>0&&t(jg,{color:p,items:r}),s&&e(uf,{children:[t(hf,{children:t(dr,{size:18,fill:d.v2.colors.yellow[500]})}),t(ee,{size:te.XXXS,color:d.v2.colors.yellow[500],children:s})]})]}),c&&t(pf,{children:t(Te,{"data-id":`sampling-onboarding-btn-read-more-${o}`,label:Bo,rightIcon:bl,variant:Ie.Text,size:ke.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},gf=({strategy:i,onStrategyChange:o,onBack:a,onNext:l,docsUrl:r})=>{const s=v(),c=r?()=>window.open(r,"_blank"):void 0;return e(n,{children:[t(Xg,{title:ko,onBack:a}),e(Lg,{$width:854,children:[t(qg,{children:Io}),e(lf,{children:[t(mf,{selected:"keep-list"===i,onSelect:()=>o("keep-list"),name:Ro,description:Ao,badgeProps:{label:Oo,backgroundColor:s.v2.colors.purple[500],textColor:s.v2.colors.white[500]},bullets:[Eo,$o],warning:No,onReadMore:c}),t(mf,{selected:"drop-list"===i,onSelect:()=>o("drop-list"),name:Fo,description:Lo,badgeProps:{label:_o,backgroundColor:s.v2.colors.green[500],textColor:s.v2.colors.black[500]},bullets:[Do,Po],onReadMore:c}),t(mf,{selected:"advanced"===i,onSelect:()=>o("advanced"),name:Xo,description:Mo,badgeProps:{label:zo,backgroundColor:s.v2.colors.blue[700],textColor:s.v2.colors.white[500]},onReadMore:c})]})]}),t(zg,{onNext:l})]})},ff=({onBack:i,onNext:a,submitting:l})=>{const r=v(),s=o(()=>[{title:jo,bullets:[Uo,Vo,Ho]},{title:qo,bullets:[Go,Wo,Ko,Yo,Jo]}],[]);return e(n,{children:[t(Xg,{title:Zo,onBack:i}),e(Lg,{$width:854,children:[t(qg,{children:Qo}),t(ie,{$gap:16,$width:"100%",$alignItems:"stretch",children:s.map((n,i)=>e(Ug,{fillHeight:!0,width:"50%",children:[t(ee,{size:te.XS,color:r.v2.colors.white[500],children:n.title}),t(jg,{items:n.bullets})]},i))}),t(Wg,{message:ea})]}),t(zg,{onNext:a,nextLoading:l})]})},bf=b.div`
967
1035
  white-space: pre-line;
968
- `,dg=({errorPresetEnabled:i,onErrorPresetChange:a,onBack:l,onNext:r,submitting:s})=>{const c=v(),d=o(()=>R(i?{disabled:!1}:null),[i]);return e(n,{children:[t(Dm,{title:$o,onBack:l}),e(Om,{$width:854,children:[t(Hm,{children:Ao}),e(ae,{$gap:8,$width:"100%",children:[e(_m,{children:[t(cg,{children:t(ee,{size:te.XXS,color:c.v2.colors.silver[200],children:Ro})}),t(Xm,{message:Oo})]}),e(Bm,{children:[e(Um,{children:[t(ee,{size:te.S,weight:500,color:c.v2.colors.white[500],children:Do}),t(Sl,{size:16,fill:c.v2.colors.silver[200]})]}),t(Vm,{children:t(km,{name:_o,recommended:!0,toggleLabel:Po,enabled:i,onEnabledChange:a,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(Am,{onNext:r,nextLoading:s})]})},pg=b.div`
1036
+ `,vf=({errorPresetEnabled:i,onErrorPresetChange:a,onBack:l,onNext:r,submitting:s})=>{const c=v(),d=o(()=>R(i?{disabled:!1}:null),[i]);return e(n,{children:[t(Xg,{title:ta,onBack:l}),e(Lg,{$width:854,children:[t(qg,{children:na}),e(ae,{$gap:8,$width:"100%",children:[e(Ug,{children:[t(bf,{children:t(ee,{size:te.XXS,color:c.v2.colors.silver[200],children:ia})}),t(Wg,{message:ea})]}),e(Kg,{children:[e(Yg,{children:[t(ee,{size:te.S,weight:500,color:c.v2.colors.white[500],children:oa}),t(Gl,{size:16,fill:c.v2.colors.silver[200]})]}),t(Jg,{children:t(Rg,{name:la,recommended:!0,toggleLabel:aa,enabled:i,onEnabledChange:a,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(zg,{onNext:r,nextLoading:s})]})},yf=b.div`
969
1037
  white-space: pre-line;
970
- `,ug=b.div`
1038
+ `,Cf=b.div`
971
1039
  width: fit-content;
972
- `,hg=["50","25","10","1","0.1"],mg=({value:n,onChange:i,label:a})=>{const l=v(),r=o(()=>hg.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e(ae,{$gap:8,children:[t(ee,{size:te.XS,color:l.v2.colors.white[500],children:a}),t(ug,{children:t(ve,{"data-id":"sampling-onboarding-ambient",options:r,selected:n,setSelected:i})})]})},gg=({errorPresetEnabled:i,onErrorPresetChange:a,ambientPercentage:l,onAmbientPercentageChange:r,onBack:s,onNext:c,submitting:d})=>{const p=v(),u=o(()=>R(i?{disabled:!1}:null),[i]);return e(n,{children:[t(Dm,{title:Lo,onBack:s}),e(Om,{$width:854,children:[t(Hm,{children:Fo}),e(ae,{$gap:8,$width:"100%",children:[e(_m,{children:[t(pg,{children:t(ee,{size:te.XXS,color:p.v2.colors.silver[200],children:Mo})}),t(Mm,{items:[zo,Xo,Bo,Uo,Vo]}),t(Xm,{message:Oo})]}),e(Bm,{children:[e(Um,{children:[t(ee,{size:te.S,weight:500,color:p.v2.colors.white[500],children:Ho}),t(Sl,{size:16,fill:p.v2.colors.silver[200]})]}),t(Vm,{children:t(km,{name:_o,recommended:!0,toggleLabel:Po,enabled:i,onEnabledChange:a,summary:u,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(Vm,{children:t(mg,{value:l,onChange:r,label:jo})})]})]})]}),t(Am,{onNext:c,nextLoading:d})]})},fg=({isOpen:e,onClose:n,k8sHealthProbesConfig:i,samplingId:o,docsUrl:r})=>{const{samplingApi:s}=Sr(),[c,p]=l("welcome"),[u,h]=l(!0),[m,g]=l("keep-list"),[f,b]=l(!0),[v,y]=l("25"),[C,S]=l(!1);a(()=>{e&&(p("welcome"),h(i?.enabled??!0),g("keep-list"),b(!0),y("25"),S(!1))},[e,i?.enabled]);const x=d(async()=>{const e=o??"default",t=[];if(u!==(i?.enabled??!1)){const e=s.updateK8sHealthProbesConfig;e&&t.push(e({enabled:u,keepPercentage:i?.keepPercentage??0}))}if("advanced"!==m&&f){const n=s.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=s.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),p("success")}catch{}finally{S(!1)}},[o,s,u,i?.enabled,i?.keepPercentage,m,f,v]);let w=null;switch(c){case"welcome":w=t(qm,{onSkip:n,onNext:()=>p("noisy")});break;case"noisy":w=t(Gm,{enabled:u,onEnabledChange:h,onBack:()=>p("welcome"),onNext:()=>p("strategy")});break;case"strategy":w=t(rg,{strategy:m,onStrategyChange:g,onBack:()=>p("noisy"),onNext:()=>{p("keep-list"===m?"keep-list":"drop-list"===m?"drop-list":"advanced")},docsUrl:r});break;case"keep-list":w=t(gg,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"drop-list":w=t(dg,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"advanced":w=t(sg,{onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"success":w=t(Km,{onClose:n})}return t(xi,{isOpen:e,onClose:n,children:w})};var bg,vg;(e=>{e.BulkConfig="bulk-config",e.Delete="delete"})(bg||(bg={})),(e=>{e.K8s="k8s",e.VmAgent="vm-agent",e.CloudConnector="cloud-connector",e.AwsEcsAgent="aws-ecs-agent"})(vg||(vg={}));const yg=[{id:vg.CloudConnector,label:"Cloud Connector"}];var Cg;(e=>{e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"})(Cg||(Cg={}));const Sg=[{key:Cg.Name,label:"Name"},{key:Cg.Type,label:"Type"},{key:Cg.Status,label:"Status"},{key:Cg.OdigosVersion,label:"Odigos Version"},{key:Cg.ConnectedSince,label:"Connected Since"},{key:Cg.LastActivity,label:"Last Activity"}],xg=(e,t)=>{const n=e.find(e=>e.key===Cg.Id)?.rawValue;return t(n?.toString()||"")},wg={[Pe.Success]:"Connected",[Pe.Warning]:"Degraded",[Pe.Error]:"Error",[Pe.Disabled]:"Disabled",[Pe.Info]:"Pending"},Tg={[Go.K8s]:gn.Purple,[Go.Vm]:gn.Blue,[Go.Connector]:gn.Green,[Go.AwsEcs]:gn.Yellow},kg=({connections:n,getConnections:i,onClickConnection:r,deleteConnection:s,onCreateNew:c,cloudConnectorProviders:p,onCreateCloudConnector:u,configMinSupportedVersion:h=0})=>{const m=v(),{formatTimeAgo:g}=ln(),[f,b]=l(!n?.length),[y,C]=l(n||[]),S=d(async()=>{try{b(!0),C(await i()??[])}catch(e){}finally{b(!1)}},[]);a(()=>{y.length||S()},[]);const[x,w]=l(""),[T,k]=l(null),[I,N]=l([]),[E,O]=l(!1),[$,A]=l(!1),R=d(()=>{O(!1),A(!0),S()},[S]),_=d(e=>{e===vg.CloudConnector?O(!0):c?.(e)},[c]),{supportedConnections:L,supportedConnectionIds:F}=o(()=>{const e=((e,t)=>e.filter(e=>{const n=e.status===Pe.Success,i=D(e.odigosVersion,t,e.type);return n&&i}))(y,h);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[y,h]),M=o(()=>I.map(e=>y.find(t=>t.id===e)).filter(e=>!!e),[y,I]);a(()=>{if(!T||T===bg.Delete)return;const e=I.filter(e=>!F.includes(e));e.length&&N(t=>t.filter(t=>!e.includes(t)))},[T,I.length,F.length]);const z=o(()=>y.filter(e=>!x||e.name.toLowerCase().includes(x.toLowerCase())).map(e=>({cells:[{key:Cg.Id,rawValue:e.id},{key:Cg.Name,rawValue:e.name},{key:Cg.Type,rawValue:e.type,component:()=>t(on,{variant:Tg[e.type]??gn.Default,label:Wo(e.type),leftIcon:Kn(e.type)})},{key:Cg.Status,rawValue:e.status,component:()=>(e=>{if(e.type===Go.Connector){const n=wg[e.status]??"Pending",i=e.status===Pe.Success?il:e.status===Pe.Error?ol:void 0;return t(ce,{status:e.status,label:n,leftIcon:i})}const n=e.status===Pe.Success?"Connection live":"Connection lost",i=e.status===Pe.Success?il:ol;return t(ce,{status:e.status,label:n,leftIcon:i})})(e)},{key:Cg.OdigosVersion,rawValue:e.odigosVersion},{key:Cg.ConnectedSince,rawValue:e.connectedAt?g(e.connectedAt):"-"},{key:Cg.LastActivity,rawValue:e.lastSeenAt?g(e.lastSeenAt):"-"}],onClick:e.status!==Pe.Success||T?void 0:()=>r(e),isSelected:I.includes(e.id),onSelect:()=>N(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>N(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.type!==Go.K8s||e.status!==Pe.Success||!D(e.odigosVersion,h,e.type)})),[y,I,x,T,h,g,r]),X=o(()=>z.some(e=>!e.hideCheckbox),[z]),B=o(()=>{const e=(e,t)=>{N([e]),k(t)};return(e=>{const{connections:t,configMinSupportedVersion:n,onDelete:i,onEditConfiguration:o}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===Cg.Status)?.rawValue===Pe.Success)(e))return[{id:Si(),label:"Delete Connection",rightIcon:Wa,onClick:()=>xg(e,i)}];const a=xg(e,e=>t.find(t=>t.id===e));if(a?.type!==Go.K8s)return[];const l=!!a&&D(a.odigosVersion,n,a.type),r=P(n,a?.type),s=[];return o&&s.push({id:Si(),tooltip:l?"Edit Configuration":`To use this feature, please upgrade to Odigos v${r} or later.`,rightIcon:bl,disabled:!l,onClick:()=>xg(e,o)}),s}})({connections:y,configMinSupportedVersion:h,onDelete:t=>e(t,bg.Delete),onEditConfiguration:t=>e(t,bg.BulkConfig)})},[y,h]),U=o(()=>(e=>{const{onCancel:t,onManageConfigurations:n}=e,i=[];return n&&i.push({id:bg.BulkConfig,type:bn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,leftIcon:bl,label:"Manage Configurations",onClick:n}}),i.push({id:Si(),type:bn.Button,buttonProps:{variant:Ie.Text,size:ke.S,label:Ft.CANCEL,onClick:t}}),i})({onCancel:()=>N([]),onManageConfigurations:()=>k(bg.BulkConfig)}),[]),V=o(()=>t(vi,{items:yg,withMultiSelect:!1,selectedIds:[],setSelectedIds:e=>_(e[0]),buttonProps:{variant:Ie.Primary,size:ke.S,label:Ft.CREATE_NEW}}),[_]),H=o(()=>x.trim()&&y.length>0?{hideIcon:!0,title:nt.NO_RESULTS,subTitle:nt.NO_RESULTS_FOR_FILTER(x)}:{icon:Xl,title:nt.NO_CONNECTIONS,action:V},[x,y.length,V]);return t(Ko,{children:e(ut,{fullHeight:!0,richTitle:{icon:Xl,title:nt.CONNECTIONS,badge:{label:y.length.toString(),status:Pe.Unknown}},search:{placeholder:"Search by cluster name",value:x,onChange:e=>w(e),width:"300px"},actions:[{id:"connections-refresh",type:bn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,leftIcon:fl,onClick:S,disabled:f}},{id:"connections-create-new",type:bn.ButtonDropData,buttonProps:{variant:Ie.Primary,size:ke.S,label:Ft.CREATE_NEW,onClick:e=>_(e)},dropDataProps:{alignX:Ci.Right,items:yg}}],children:[t(Vn,{variant:Hn.Pretty,headerBackgroundColor:m.v2.colors.silver[1e3],isLoading:f,withCheckboxes:X,columns:Sg,rows:z,noDataProps:H,rowActionsPushRightPosition:T?`calc(${ur} - 24px)`:void 0,getRowActions:B}),E&&t(_r,{providers:p,children:t(fp,{onClose:()=>O(!1),withOverlay:!0,onCreateCloudConnector:u,onCreated:R})}),t(br,{isOpen:$,onClose:()=>A(!1)}),t(jn,{isOpen:!!I.length&&!T,richTitle:{icon:Za,title:"Selected Clusters",badge:{label:I.length}},actions:U}),T===bg.BulkConfig&&t(Lr,{connections:M,children:t(Sp,{onClose:()=>k(null),connections:L,selectedConnectionIds:I,setSelectedConnectionIds:N})}),t(mr,{target:"connection",isOpen:T===bg.Delete,onClose:()=>{N([]),k(null)},onApprove:async()=>{const e=I[0];e&&(await s(e),await S())}})]})})},Ig=b.div`
1040
+ `,Sf=["50","25","10","1","0.1"],xf=({value:n,onChange:i,label:a})=>{const l=v(),r=o(()=>Sf.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e(ae,{$gap:8,children:[t(ee,{size:te.XS,color:l.v2.colors.white[500],children:a}),t(Cf,{children:t(ve,{"data-id":"sampling-onboarding-ambient",options:r,selected:n,setSelected:i})})]})},wf=({errorPresetEnabled:i,onErrorPresetChange:a,ambientPercentage:l,onAmbientPercentageChange:r,onBack:s,onNext:c,submitting:d})=>{const p=v(),u=o(()=>R(i?{disabled:!1}:null),[i]);return e(n,{children:[t(Xg,{title:ra,onBack:s}),e(Lg,{$width:854,children:[t(qg,{children:sa}),e(ae,{$gap:8,$width:"100%",children:[e(Ug,{children:[t(yf,{children:t(ee,{size:te.XXS,color:p.v2.colors.silver[200],children:ca})}),t(jg,{items:[da,pa,ua,ha,ma]}),t(Wg,{message:ea})]}),e(Kg,{children:[e(Yg,{children:[t(ee,{size:te.S,weight:500,color:p.v2.colors.white[500],children:ga}),t(Gl,{size:16,fill:p.v2.colors.silver[200]})]}),t(Jg,{children:t(Rg,{name:la,recommended:!0,toggleLabel:aa,enabled:i,onEnabledChange:a,summary:u,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(Jg,{children:t(xf,{value:l,onChange:r,label:fa})})]})]})]}),t(zg,{onNext:c,nextLoading:d})]})},Tf=({isOpen:e,onClose:n,k8sHealthProbesConfig:i,samplingId:o,docsUrl:r})=>{const{samplingApi:s}=qr(),[c,p]=l("welcome"),[u,h]=l(!0),[m,g]=l("keep-list"),[f,b]=l(!0),[v,y]=l("25"),[C,S]=l(!1);a(()=>{e&&(p("welcome"),h(i?.enabled??!0),g("keep-list"),b(!0),y("25"),S(!1))},[e,i?.enabled]);const x=d(async()=>{const e=o??"default",t=[];if(u!==(i?.enabled??!1)){const e=s.updateK8sHealthProbesConfig;e&&t.push(e({enabled:u,keepPercentage:i?.keepPercentage??0}))}if("advanced"!==m&&f){const n=s.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=s.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),p("success")}catch{}finally{S(!1)}},[o,s,u,i?.enabled,i?.keepPercentage,m,f,v]);let w=null;switch(c){case"welcome":w=t(af,{onSkip:n,onNext:()=>p("noisy")});break;case"noisy":w=t(Qg,{enabled:u,onEnabledChange:h,onBack:()=>p("welcome"),onNext:()=>p("strategy")});break;case"strategy":w=t(gf,{strategy:m,onStrategyChange:g,onBack:()=>p("noisy"),onNext:()=>{p("keep-list"===m?"keep-list":"drop-list"===m?"drop-list":"advanced")},docsUrl:r});break;case"keep-list":w=t(wf,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"drop-list":w=t(vf,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"advanced":w=t(ff,{onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"success":w=t(tf,{onClose:n})}return t(Wi,{isOpen:e,onClose:n,children:w})};var kf,If;(e=>{e.BulkConfig="bulk-config",e.Delete="delete"})(kf||(kf={})),(e=>{e.K8s="k8s",e.VmAgent="vm-agent",e.CloudConnector="cloud-connector",e.AwsEcsAgent="aws-ecs-agent"})(If||(If={}));const Nf=[{id:If.CloudConnector,label:"Cloud Connector"}];var Ef;(e=>{e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"})(Ef||(Ef={}));const $f=[{key:Ef.Name,label:"Name"},{key:Ef.Type,label:"Type"},{key:Ef.Status,label:"Status"},{key:Ef.OdigosVersion,label:"Odigos Version"},{key:Ef.ConnectedSince,label:"Connected Since"},{key:Ef.LastActivity,label:"Last Activity"}],Of=(e,t)=>{const n=e.find(e=>e.key===Ef.Id)?.rawValue;return t(n?.toString()||"")},Af={[Pe.Success]:"Connected",[Pe.Warning]:"Degraded",[Pe.Error]:"Error",[Pe.Disabled]:"Disabled",[Pe.Info]:"Pending"},Rf={[ba.K8s]:gn.Purple,[ba.Vm]:gn.Blue,[ba.Connector]:gn.Green,[ba.AwsEcs]:gn.Yellow},Df=({connections:n,getConnections:i,onClickConnection:r,deleteConnection:s,onCreateNew:c,cloudConnectorProviders:p,onCreateCloudConnector:u,configMinSupportedVersion:h=0})=>{const m=v(),{formatTimeAgo:g}=ln(),[f,b]=l(!n?.length),[y,C]=l(n||[]),S=d(async()=>{try{b(!0),C(await i()??[])}catch(e){}finally{b(!1)}},[]);a(()=>{y.length||S()},[]);const[x,w]=l(""),[T,k]=l(null),[I,N]=l([]),[E,$]=l(!1),[O,A]=l(!1),R=d(()=>{$(!1),A(!0),S()},[S]),_=d(e=>{e===If.CloudConnector?$(!0):c?.(e)},[c]),{supportedConnections:L,supportedConnectionIds:F}=o(()=>{const e=((e,t)=>e.filter(e=>{const n=e.status===Pe.Success,i=D(e.odigosVersion,t,e.type);return n&&i}))(y,h);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[y,h]),z=o(()=>I.map(e=>y.find(t=>t.id===e)).filter(e=>!!e),[y,I]);a(()=>{if(!T||T===kf.Delete)return;const e=I.filter(e=>!F.includes(e));e.length&&N(t=>t.filter(t=>!e.includes(t)))},[T,I.length,F.length]);const M=o(()=>y.filter(e=>!x||e.name.toLowerCase().includes(x.toLowerCase())).map(e=>({cells:[{key:Ef.Id,rawValue:e.id},{key:Ef.Name,rawValue:e.name},{key:Ef.Type,rawValue:e.type,component:()=>t(on,{variant:Rf[e.type]??gn.Default,label:va(e.type),leftIcon:Kn(e.type)})},{key:Ef.Status,rawValue:e.status,component:()=>(e=>{if(e.type===ba.Connector){const n=Af[e.status]??"Pending",i=e.status===Pe.Success?El:e.status===Pe.Error?$l:void 0;return t(ce,{status:e.status,label:n,leftIcon:i})}const n=e.status===Pe.Success?"Connection live":"Connection lost",i=e.status===Pe.Success?El:$l;return t(ce,{status:e.status,label:n,leftIcon:i})})(e)},{key:Ef.OdigosVersion,rawValue:e.odigosVersion},{key:Ef.ConnectedSince,rawValue:e.connectedAt?g(e.connectedAt):"-"},{key:Ef.LastActivity,rawValue:e.lastSeenAt?g(e.lastSeenAt):"-"}],onClick:e.status!==Pe.Success||T?void 0:()=>r(e),isSelected:I.includes(e.id),onSelect:()=>N(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>N(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.type!==ba.K8s||e.status!==Pe.Success||!D(e.odigosVersion,h,e.type)})),[y,I,x,T,h,g,r]),X=o(()=>M.some(e=>!e.hideCheckbox),[M]),B=o(()=>{const e=(e,t)=>{N([e]),k(t)};return(e=>{const{connections:t,configMinSupportedVersion:n,onDelete:i,onEditConfiguration:o}=e;return({cells:e})=>{const a=Of(e,e=>t.find(t=>t.id===e)),l={id:Gi(),label:"Delete Connection",rightIcon:vl,onClick:()=>Of(e,i)};if(!(e=>e.find(e=>e.key===Ef.Status)?.rawValue===Pe.Success)(e)||a?.type===ba.Connector)return[l];if(a?.type!==ba.K8s)return[];const r=!!a&&D(a.odigosVersion,n,a.type),s=P(n,a?.type),c=[];return o&&c.push({id:Gi(),tooltip:r?"Edit Configuration":`To use this feature, please upgrade to Odigos v${s} or later.`,rightIcon:Ul,disabled:!r,onClick:()=>Of(e,o)}),c}})({connections:y,configMinSupportedVersion:h,onDelete:t=>e(t,kf.Delete),onEditConfiguration:t=>e(t,kf.BulkConfig)})},[y,h]),U=o(()=>(e=>{const{onCancel:t,onManageConfigurations:n}=e,i=[];return n&&i.push({id:kf.BulkConfig,type:bn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,leftIcon:Ul,label:"Manage Configurations",onClick:n}}),i.push({id:Gi(),type:bn.Button,buttonProps:{variant:Ie.Text,size:ke.S,label:Ft.CANCEL,onClick:t}}),i})({onCancel:()=>N([]),onManageConfigurations:()=>k(kf.BulkConfig)}),[]),V=o(()=>t(Vi,{items:Nf,withMultiSelect:!1,selectedIds:[],setSelectedIds:e=>_(e[0]),buttonProps:{variant:Ie.Primary,size:ke.S,label:Ft.CREATE_NEW}}),[_]),H=o(()=>x.trim()&&y.length>0?{hideIcon:!0,title:nt.NO_RESULTS,subTitle:nt.NO_RESULTS_FOR_FILTER(x)}:{icon:gr,title:nt.NO_CONNECTIONS,action:V},[x,y.length,V]);return t(ya,{children:e(ut,{fullHeight:!0,richTitle:{icon:gr,title:nt.CONNECTIONS,badge:{label:y.length.toString(),status:Pe.Unknown}},search:{placeholder:"Search by cluster name",value:x,onChange:e=>w(e),width:"300px"},actions:[{id:"connections-refresh",type:bn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,leftIcon:Bl,onClick:S,disabled:f}},{id:"connections-create-new",type:bn.ButtonDropData,buttonProps:{variant:Ie.Primary,size:ke.S,label:Ft.CREATE_NEW,onClick:e=>_(e)},dropDataProps:{alignX:ji.Right,items:Nf}}],children:[t(Vn,{variant:Hn.Pretty,headerBackgroundColor:m.v2.colors.silver[1e3],isLoading:f,withCheckboxes:X,columns:$f,rows:M,noDataProps:H,rowActionsPushRightPosition:T?`calc(${Br} - 24px)`:void 0,getRowActions:B}),E&&t(ps,{providers:p,children:t(Kp,{onClose:()=>$(!1),withOverlay:!0,onCreateCloudConnector:u,onCreated:R})}),t(Wr,{isOpen:O,onClose:()=>A(!1)}),t(jn,{isOpen:!!I.length&&!T,richTitle:{icon:wl,title:"Selected Clusters",badge:{label:I.length}},actions:U}),T===kf.BulkConfig&&t(us,{connections:z,children:t(Qp,{onClose:()=>k(null),connections:L,selectedConnectionIds:I,setSelectedConnectionIds:N})}),t(Vr,{target:"connection",isOpen:T===kf.Delete,onClose:()=>{N([]),k(null)},onApprove:async()=>{const e=I[0];e&&(await s(e),await S())}})]})})},Pf=b.div`
973
1041
  display: flex;
974
1042
  align-items: center;
975
1043
  justify-content: space-between;
@@ -978,26 +1046,26 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
978
1046
  width: 100%;
979
1047
  border-radius: 16px;
980
1048
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
981
- `,Ng=b.div`
1049
+ `,_f=b.div`
982
1050
  display: flex;
983
1051
  align-items: center;
984
1052
  justify-content: center;
985
1053
  padding: 8px;
986
1054
  border-radius: 8px;
987
1055
  background-color: ${({theme:e})=>e.v2.colors.white[500]+oe["004"]};
988
- `,Eg=({setStep:n,onSave:i,sourcesPayload:a,destinationsPayload:l,disableAnimation:r})=>{const s=v(),c=()=>n(2),d=()=>n(3),p=o(()=>Object.values(a||{}).flatMap((n,i)=>n.map((n,o)=>{if(!n.selected)return null;const a=n.kind||Nt.Namespace,l=a===Nt.Namespace?n.namespace:`${n.namespace} → ${n.name}`;return e(Ig,{children:[t(ee,{nowrap:!0,children:l}),t(ce,{label:a,status:Pe.Info,backgroundColor:s.v2.colors.blue[900]})]},`source-${i}-${o}`)})).filter(Boolean),[a]),u=o(()=>l?.map((n,i)=>{const o=wt(n.option.type).icon;return e(Ig,{children:[e(ie,{$gap:8,children:[o&&t(Ng,{children:t(o,{size:24})}),t(ee,{nowrap:!0,children:n.formData.name||n.option.displayName})]}),void 0!==n.testResult&&t(ce,{status:n.testResult.succeeded?Pe.Success:Pe.Error,leftIcon:n.testResult.succeeded?il:ol})]},`destination-${i}`)})||[],[l]);return t(pr,{isOpen:!0,disableAnimation:r,onBack:()=>n(3),onSave:i,header:{icon:hl,title:nt.SUMMARY,subTitle:nt.REVIEW_SETUP},leftColumn:{width:"50%",header:e(ie,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ie,{$gap:8,children:[t(ll,{size:24}),t(ee,{nowrap:!0,children:nt.SELECTED_SOURCES}),t(ce,{label:p.length})]}),t(Te,{"data-id":"summary-edit-sources",leftIcon:Ka,variant:Ie.Secondary,size:ke.S,onClick:c})]}),list:p.length?p:[t(ft,{$height:"100%",children:t($e,{icon:ll,title:nt.NO_SOURCES_SELECTED,subTitle:nt.ADD_SOURCE_PROMPT,button:{leftIcon:Ha,label:nt.ADD_SOURCE,onClick:c}})},"no-sources-data")]},rightColumn:{width:"50%",header:e(ie,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ie,{$gap:8,children:[t(el,{size:24}),t(ee,{nowrap:!0,children:nt.SELECTED_DESTINATIONS}),t(ce,{label:u.length})]}),t(Te,{"data-id":"summary-edit-destinations",leftIcon:Ka,variant:Ie.Secondary,size:ke.S,onClick:d})]}),list:u.length?u:[t(ft,{"data-id":"summary-no-destinations",$height:"100%",children:t($e,{icon:el,title:nt.NO_DESTINATIONS_SELECTED,subTitle:nt.ADD_DESTINATION_PROMPT,button:{leftIcon:Ha,label:nt.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},Og=b.div`
1056
+ `,Lf=({setStep:n,onSave:i,sourcesPayload:a,destinationsPayload:l,disableAnimation:r})=>{const s=v(),c=()=>n(2),d=()=>n(3),p=o(()=>Object.values(a||{}).flatMap((n,i)=>n.map((n,o)=>{if(!n.selected)return null;const a=n.kind||Nt.Namespace,l=a===Nt.Namespace?n.namespace:`${n.namespace} → ${n.name}`;return e(Pf,{children:[t(ee,{nowrap:!0,children:l}),t(ce,{label:a,status:Pe.Info,backgroundColor:s.v2.colors.blue[900]})]},`source-${i}-${o}`)})).filter(Boolean),[a]),u=o(()=>l?.map((n,i)=>{const o=wt(n.option.type).icon;return e(Pf,{children:[e(ie,{$gap:8,children:[o&&t(_f,{children:t(o,{size:24})}),t(ee,{nowrap:!0,children:n.formData.name||n.option.displayName})]}),void 0!==n.testResult&&t(ce,{status:n.testResult.succeeded?Pe.Success:Pe.Error,leftIcon:n.testResult.succeeded?El:$l})]},`destination-${i}`)})||[],[l]);return t(Xr,{isOpen:!0,disableAnimation:r,onBack:()=>n(3),onSave:i,header:{icon:zl,title:nt.SUMMARY,subTitle:nt.REVIEW_SETUP},leftColumn:{width:"50%",header:e(ie,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ie,{$gap:8,children:[t(Al,{size:24}),t(ee,{nowrap:!0,children:nt.SELECTED_SOURCES}),t(ce,{label:p.length})]}),t(Te,{"data-id":"summary-edit-sources",leftIcon:yl,variant:Ie.Secondary,size:ke.S,onClick:c})]}),list:p.length?p:[t(ft,{$height:"100%",children:t(Oe,{icon:Al,title:nt.NO_SOURCES_SELECTED,subTitle:nt.ADD_SOURCE_PROMPT,button:{leftIcon:gl,label:nt.ADD_SOURCE,onClick:c}})},"no-sources-data")]},rightColumn:{width:"50%",header:e(ie,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ie,{$gap:8,children:[t(kl,{size:24}),t(ee,{nowrap:!0,children:nt.SELECTED_DESTINATIONS}),t(ce,{label:u.length})]}),t(Te,{"data-id":"summary-edit-destinations",leftIcon:yl,variant:Ie.Secondary,size:ke.S,onClick:d})]}),list:u.length?u:[t(ft,{"data-id":"summary-no-destinations",$height:"100%",children:t(Oe,{icon:kl,title:nt.NO_DESTINATIONS_SELECTED,subTitle:nt.ADD_DESTINATION_PROMPT,button:{leftIcon:gl,label:nt.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},Ff=b.div`
989
1057
  position: relative;
990
1058
  overflow: hidden;
991
1059
  width: 100vw;
992
1060
  height: 100vh;
993
1061
  box-sizing: border-box;
994
- `,$g=b.svg`
1062
+ `,zf=b.svg`
995
1063
  position: absolute;
996
1064
  top: 50%;
997
1065
  left: 50%;
998
1066
  transform: translate(-50%, -50%);
999
1067
  z-index: -1;
1000
- `,Ag=[{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"}],Rg=[{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:Ag},{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:Ag},{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:Ag}],Dg=({paddingXAxis:n="0px",paddingYAxis:i="0px",children:r})=>{const[s,c]=l(window.innerWidth),d=o(()=>s/Rg[0].width,[s]);return a(()=>{const e=()=>c(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(Og,{$paddingXAxis:n,$paddingYAxis:i,children:[Rg.map(({width:n,height:i,pathOpacity:o,path:a,gradientTransform:l,stops:r},s)=>{const c=`purple-ring-${s}`;return e($g,{width:n*d,height:"100%",viewBox:`0 0 ${n} ${i}`,fill:"none",children:[t("path",{opacity:o,d:a,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},i)=>t("stop",{offset:e,stopColor:"#7C3BFF",stopOpacity:n},i))})})]},c)}),r]})},Pg=b.div`
1068
+ `,Mf=[{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"}],Xf=[{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:Mf},{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:Mf},{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:Mf}],Bf=({paddingXAxis:n="0px",paddingYAxis:i="0px",children:r})=>{const[s,c]=l(window.innerWidth),d=o(()=>s/Xf[0].width,[s]);return a(()=>{const e=()=>c(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(Ff,{$paddingXAxis:n,$paddingYAxis:i,children:[Xf.map(({width:n,height:i,pathOpacity:o,path:a,gradientTransform:l,stops:r},s)=>{const c=`purple-ring-${s}`;return e(zf,{width:n*d,height:"100%",viewBox:`0 0 ${n} ${i}`,fill:"none",children:[t("path",{opacity:o,d:a,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},i)=>t("stop",{offset:e,stopColor:"#7C3BFF",stopOpacity:n},i))})})]},c)}),r]})},Uf=b.div`
1001
1069
  display: flex;
1002
1070
  flex-direction: column;
1003
1071
  align-items: center;
@@ -1008,7 +1076,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
1008
1076
  width: 50vw;
1009
1077
  border-radius: 16px;
1010
1078
  background: ${({theme:e})=>e.v2.colors.silver[900]};
1011
- `,_g=b.div`
1079
+ `,Vf=b.div`
1012
1080
  display: flex;
1013
1081
  flex-direction: column;
1014
1082
  align-items: center;
@@ -1018,15 +1086,15 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
1018
1086
  & * {
1019
1087
  text-align: center;
1020
1088
  }
1021
- `,Lg=({onStart:n})=>t(Xt,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(ft,{$height:"100%",children:e(Pg,{children:[e(_g,{children:[t(ee,{size:te.L,weight:500,children:nt.GET_STARTED_WITH}),t(fr,{size:260}),t(ee,{size:te.S,weight:400,children:nt.GET_STARTED_DESCRIPTION})]}),t(Te,{"data-id":"onboarding-get-started",label:Ft.GET_STARTED,rightIcon:ja,size:ke.L,onClick:n})]})})}),Fg=[{step:1,label:nt.INSTALLATION,forceDoneBadge:!0},{step:2,label:nt.SOURCES_SETUP},{step:3,label:nt.DESTINATIONS_SETUP},{step:4,label:nt.SUMMARY}],Mg=b.div`
1089
+ `,Hf=({onStart:n})=>t(Xt,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(ft,{$height:"100%",children:e(Uf,{children:[e(Vf,{children:[t(ee,{size:te.L,weight:500,children:nt.GET_STARTED_WITH}),t(Gr,{size:260}),t(ee,{size:te.S,weight:400,children:nt.GET_STARTED_DESCRIPTION})]}),t(Te,{"data-id":"onboarding-get-started",label:Ft.GET_STARTED,rightIcon:fl,size:ke.L,onClick:n})]})})}),jf=[{step:1,label:nt.INSTALLATION,forceDoneBadge:!0},{step:2,label:nt.SOURCES_SETUP},{step:3,label:nt.DESTINATIONS_SETUP},{step:4,label:nt.SUMMARY}],Gf=b.div`
1022
1090
  display: flex;
1023
1091
  flex-direction: column;
1024
1092
  gap: 32px;
1025
1093
  padding: 64px;
1026
- `,zg=({pagePaddingXAxis:n,pagePaddingYAxis:i,onDone:o})=>{const{setDrawerType:a}=Cn(),{sourcesApi:r,destinationsApi:s}=Sr(),[c,d]=l(1),[p,u]=l(!1),[h,m]=l(null),[g,f]=l(null),b=()=>d(e=>e+1),v=()=>d(e=>e-1);return e(Dg,{paddingXAxis:n,paddingYAxis:i,children:[e(Mg,{children:[t(fr,{useInline:!0}),t(Yo,{currentStep:c,data:Fg,gap:32})]}),t(Fr,{initialInputs:h,children:e(Mr,{children:[1===c&&t(Lg,{onStart:b}),2===c&&t($c,{disableAnimation:!0,onBack:e=>{m(e),v()},onNext:e=>{m(e),b()}}),3===c&&t(hc,{disableAnimation:!0,onBack:e=>{f(e),v()},onNext:e=>{f(e),b()},initialInputs:g}),4===c&&t(Eg,{disableAnimation:!0,setStep:d,onSave:async()=>{if(!p){u(!0);try{const e=[];h&&e.push(r.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")};a(wi.OnboardingDone),o()}catch(e){return u(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:h,destinationsPayload:g})]})})]})},Xg=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),Bg=e=>e.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,e=>e.toUpperCase()),Ug=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},Vg=b.div`
1094
+ `,Wf=({pagePaddingXAxis:n,pagePaddingYAxis:i,onDone:o})=>{const{setDrawerType:a}=Cn(),{sourcesApi:r,destinationsApi:s}=qr(),[c,d]=l(1),[p,u]=l(!1),[h,m]=l(null),[g,f]=l(null),b=()=>d(e=>e+1),v=()=>d(e=>e-1);return e(Bf,{paddingXAxis:n,paddingYAxis:i,children:[e(Gf,{children:[t(Gr,{useInline:!0}),t(Ca,{currentStep:c,data:jf,gap:32})]}),t(hs,{initialInputs:h,children:e(ms,{children:[1===c&&t(Hf,{onStart:b}),2===c&&t(ld,{disableAnimation:!0,onBack:e=>{m(e),v()},onNext:e=>{m(e),b()}}),3===c&&t(Vc,{disableAnimation:!0,onBack:e=>{f(e),v()},onNext:e=>{f(e),b()},initialInputs:g}),4===c&&t(Lf,{disableAnimation:!0,setStep:d,onSave:async()=>{if(!p){u(!0);try{const e=[];h&&e.push(r.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")};a(Ki.OnboardingDone),o()}catch(e){return u(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:h,destinationsPayload:g})]})})]})},Kf=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),Yf=e=>e.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,e=>e.toUpperCase()),Jf=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},qf=b.div`
1027
1095
  position: relative;
1028
1096
  display: inline-flex;
1029
- `,Hg=b.button`
1097
+ `,Zf=b.button`
1030
1098
  display: inline-flex;
1031
1099
  align-items: center;
1032
1100
  gap: 8px;
@@ -1039,7 +1107,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
1039
1107
  &:hover {
1040
1108
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
1041
1109
  }
1042
- `,jg=b.div`
1110
+ `,Qf=b.div`
1043
1111
  position: absolute;
1044
1112
  top: calc(100% + 8px);
1045
1113
  right: 0;
@@ -1052,25 +1120,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
1052
1120
  border-radius: 12px;
1053
1121
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1054
1122
  box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
1055
- `,Gg=b.div`
1123
+ `,eb=b.div`
1056
1124
  display: flex;
1057
1125
  flex-direction: column;
1058
1126
  gap: 12px;
1059
1127
  padding: 16px;
1060
1128
  max-height: 60vh;
1061
1129
  overflow-y: auto;
1062
- `,Wg=b.div`
1130
+ `,tb=b.div`
1063
1131
  display: flex;
1064
1132
  align-items: center;
1065
1133
  gap: 8px;
1066
1134
  padding: 12px 16px;
1067
1135
  border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
1068
- `,Kg=b.div`
1136
+ `,nb=b.div`
1069
1137
  display: flex;
1070
1138
  align-items: center;
1071
1139
  gap: 8px;
1072
1140
  margin-left: auto;
1073
- `,Yg=()=>{const n=v(),{platformType:i,isK8s:r,isConnector:s}=S(),{sourcesApi:c,namespacesApi:d}=Sr(),u=c.useSources().items,h=d.useNamespaces().items,{selectedStreamName:m}=it(),{getItemSS:g,setItemSS:f,removeItemSS:b}=ta(),{statuses:y,namespaces:C,regions:x,kinds:w,monitors:T,languages:k,onlyErrors:I,podsAgentInjectionStatus:N,enabledStatuses:E,setAll:O,clearFilters:$,getEmptyState:A}=Jo(),R=o(()=>qo(u,m),[u,m]);a(()=>{const e=g(Zo.OVERVIEW_FILTERS,A());O(e)},[]);const[D,P]=l({statuses:y,namespaces:C,regions:x,kinds:w,monitors:T,languages:k,onlyErrors:I,podsAgentInjectionStatus:N,enabledStatuses:E}),[_,L]=l(Ug(D)),[F,M]=l(!1),z=p(i);a(()=>{if(!F){const e={statuses:y,namespaces:C,regions:x,kinds:w,monitors:T,languages:k,onlyErrors:I,podsAgentInjectionStatus:N,enabledStatuses:E};P(e),L(Ug(e))}},[F,y,C,x,w,T,k,I,N,E]),a(()=>{z.current!==i&&(z.current=i,b(Zo.OVERVIEW_FILTERS),$(),P(A()),L(0),M(!1))},[i]);const X=p(null);$n(X,()=>M(!1)),fi({key:"Escape",active:F},()=>M(!1));const B=o(()=>{const e=new Set,t=[];return h.forEach(({name:n})=>{e.has(n)||(e.add(n),t.push({id:n,label:n,withCheckbox:!0}))}),t},[h]),U=o(()=>{const e=new Set,t=[];return R.forEach(({id:n})=>{const{kind:i}=n;e.has(i)||(e.add(i),t.push({id:i,label:Nn(i),withCheckbox:!0}))}),t},[R]),V=o(()=>{const e=new Set,t=[];return R.forEach(({id:n})=>{const i=n.region?.trim();i&&!e.has(i)&&(e.add(i),t.push({id:i,label:i,withCheckbox:!0}))}),t.sort((e,t)=>e.id.localeCompare(t.id))},[R]),H=o(()=>{const e=new Set,t=[];return R.forEach(({runtimeInfo:n})=>{n?.detectedLanguages?.forEach(n=>{e.has(n)||(e.add(n),t.push({id:n,label:Qo[n]||n,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[R]),j=o(()=>ea.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),G=o(()=>{const e=new Set,t=[];return R.forEach(({instrumentationReport:n})=>{const i=n?.state||n?.progressStage;i&&!e.has(i)&&(e.add(i),t.push({id:i,label:Bg(i),withCheckbox:!0}))}),t.sort((e,t)=>e.label.localeCompare(t.label))},[R]),W=o(()=>{const e=new Set,t=[];return R.forEach(({podsAgentInjectionStatus:n})=>{const{reasonEnum:i,message:o}=n||{};if(i){if(e.has(i))return;e.add(i),t.push({id:i,label:Ut(i),withCheckbox:!0})}else if(o){if(e.has(o))return;e.add(o),t.push({id:o,label:o,withCheckbox:!0})}}),t},[R]),K=o(()=>[{id:"enabled",label:nt.ENABLED,withCheckbox:!0},{id:"disabled",label:nt.DISABLED,withCheckbox:!0}],[]),Y=(e,t,n)=>{const i=t.filter(e=>n.includes(e.id));P(t=>{return{...t,[e]:(n=i,n.map(({id:e,label:t})=>({id:e,label:t})))};var n})},J=F?tl:nl,q=o(()=>Xg(D.languages),[D.languages]);return e(Vg,{ref:X,children:[e(Hg,{"data-id":"filters-trigger",$isOpen:F,type:"button",onClick:()=>M(e=>!e),children:[t(Bl,{size:16,fill:n.v2.colors.white[500]}),t(ee,{size:te.XS,weight:500,nowrap:!0,children:"Filters"}),_>0&&t(ce,{label:_,status:Pe.Unknown,textSize:te.XXXS}),t(J,{size:16,fill:n.v2.colors.silver[200]})]}),F&&e(jg,{children:[e(Gg,{children:[r&&t(vt,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!B.length,options:B,values:Xg(D.namespaces),setValues:e=>Y("namespaces",B,e)}),s&&t(vt,{label:"Region",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!V.length,options:V,values:Xg(D.regions),setValues:e=>Y("regions",V,e)}),t(vt,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!U.length,options:U,values:Xg(D.kinds),setValues:e=>Y("kinds",U,e)}),t(vt,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!H.length,options:H,values:q,setValues:e=>Y("languages",H,e)}),t(vt,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!j.length,options:j,values:Xg(D.monitors),setValues:e=>Y("monitors",j,e)}),t(vt,r?{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!W.length,options:W,values:Xg(D.podsAgentInjectionStatus),setValues:e=>Y("podsAgentInjectionStatus",W,e)}:{label:"Instrumentation Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!G.length,options:G,values:Xg(D.statuses),setValues:e=>Y("statuses",G,e)}),t(vt,{label:"Enabled Status",placeholder:"All",withMultiSelect:!0,options:K,values:Xg(D.enabledStatuses),setValues:e=>Y("enabledStatuses",K,e)}),t(ge,{label:"Show only sources with errors",size:Et.L,value:!!D.onlyErrors,onChange:e=>P(t=>({...t,onlyErrors:e}))})]}),e(Wg,{children:[t(Te,{"data-id":"filters-reset",size:ke.S,variant:Ie.Text,label:"Reset",onClick:()=>{b(Zo.OVERVIEW_FILTERS),$(),P(A()),L(0),M(!1)},textColor:n.v2.colors.red[500]}),e(Kg,{children:[t(Te,{"data-id":"filters-cancel",size:ke.S,variant:Ie.Secondary,label:"Cancel",onClick:()=>M(!1)}),t(Te,{"data-id":"filters-apply",size:ke.S,variant:Ie.Primary,label:"Apply",onClick:()=>{f(Zo.OVERVIEW_FILTERS,D),O(D),L(Ug(D)),M(!1)}})]})]})]})]})},Jg=b.div`
1141
+ `,ib=()=>{const n=v(),{platformType:i,isK8s:r,isConnector:s}=S(),{sourcesApi:c,namespacesApi:d}=qr(),u=c.useSources().items,h=d.useNamespaces().items,{selectedStreamName:m}=it(),{getItemSS:g,setItemSS:f,removeItemSS:b}=Ia(),{statuses:y,namespaces:C,regions:x,kinds:w,monitors:T,languages:k,onlyErrors:I,podsAgentInjectionStatus:N,enabledStatuses:E,setAll:$,clearFilters:O,getEmptyState:A}=Sa(),R=o(()=>xa(u,m),[u,m]);a(()=>{const e=g(wa.OVERVIEW_FILTERS,A());$(e)},[]);const[D,P]=l({statuses:y,namespaces:C,regions:x,kinds:w,monitors:T,languages:k,onlyErrors:I,podsAgentInjectionStatus:N,enabledStatuses:E}),[_,L]=l(Jf(D)),[F,z]=l(!1),M=p(i);a(()=>{if(!F){const e={statuses:y,namespaces:C,regions:x,kinds:w,monitors:T,languages:k,onlyErrors:I,podsAgentInjectionStatus:N,enabledStatuses:E};P(e),L(Jf(e))}},[F,y,C,x,w,T,k,I,N,E]),a(()=>{M.current!==i&&(M.current=i,b(wa.OVERVIEW_FILTERS),O(),P(A()),L(0),z(!1))},[i]);const X=p(null);On(X,()=>z(!1)),Bi({key:"Escape",active:F},()=>z(!1));const B=o(()=>{const e=new Set,t=[];return h.forEach(({name:n})=>{e.has(n)||(e.add(n),t.push({id:n,label:n,withCheckbox:!0}))}),t},[h]),U=o(()=>{const e=new Set,t=[];return R.forEach(({id:n})=>{const{kind:i}=n;e.has(i)||(e.add(i),t.push({id:i,label:Nn(i),withCheckbox:!0}))}),t},[R]),V=o(()=>{const e=new Set,t=[];return R.forEach(({id:n})=>{const i=n.region?.trim();i&&!e.has(i)&&(e.add(i),t.push({id:i,label:i,withCheckbox:!0}))}),t.sort((e,t)=>e.id.localeCompare(t.id))},[R]),H=o(()=>{const e=new Set,t=[];return R.forEach(({runtimeInfo:n})=>{n?.detectedLanguages?.forEach(n=>{e.has(n)||(e.add(n),t.push({id:n,label:Ta[n]||n,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[R]),j=o(()=>ka.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),G=o(()=>{const e=new Set,t=[];return R.forEach(({instrumentationReport:n})=>{const i=n?.state||n?.progressStage;i&&!e.has(i)&&(e.add(i),t.push({id:i,label:Yf(i),withCheckbox:!0}))}),t.sort((e,t)=>e.label.localeCompare(t.label))},[R]),W=o(()=>{const e=new Set,t=[];return R.forEach(({podsAgentInjectionStatus:n})=>{const{reasonEnum:i,message:o}=n||{};if(i){if(e.has(i))return;e.add(i),t.push({id:i,label:Ut(i),withCheckbox:!0})}else if(o){if(e.has(o))return;e.add(o),t.push({id:o,label:o,withCheckbox:!0})}}),t},[R]),K=o(()=>[{id:"enabled",label:nt.ENABLED,withCheckbox:!0},{id:"disabled",label:nt.DISABLED,withCheckbox:!0}],[]),Y=(e,t,n)=>{const i=t.filter(e=>n.includes(e.id));P(t=>{return{...t,[e]:(n=i,n.map(({id:e,label:t})=>({id:e,label:t})))};var n})},J=F?Il:Nl,q=o(()=>Kf(D.languages),[D.languages]);return e(qf,{ref:X,children:[e(Zf,{"data-id":"filters-trigger",$isOpen:F,type:"button",onClick:()=>z(e=>!e),children:[t(fr,{size:16,fill:n.v2.colors.white[500]}),t(ee,{size:te.XS,weight:500,nowrap:!0,children:"Filters"}),_>0&&t(ce,{label:_,status:Pe.Unknown,textSize:te.XXXS}),t(J,{size:16,fill:n.v2.colors.silver[200]})]}),F&&e(Qf,{children:[e(eb,{children:[r&&t(vt,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!B.length,options:B,values:Kf(D.namespaces),setValues:e=>Y("namespaces",B,e)}),s&&t(vt,{label:"Region",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!V.length,options:V,values:Kf(D.regions),setValues:e=>Y("regions",V,e)}),t(vt,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!U.length,options:U,values:Kf(D.kinds),setValues:e=>Y("kinds",U,e)}),t(vt,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!H.length,options:H,values:q,setValues:e=>Y("languages",H,e)}),t(vt,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!j.length,options:j,values:Kf(D.monitors),setValues:e=>Y("monitors",j,e)}),t(vt,r?{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!W.length,options:W,values:Kf(D.podsAgentInjectionStatus),setValues:e=>Y("podsAgentInjectionStatus",W,e)}:{label:"Instrumentation Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!G.length,options:G,values:Kf(D.statuses),setValues:e=>Y("statuses",G,e)}),t(vt,{label:"Enabled Status",placeholder:"All",withMultiSelect:!0,options:K,values:Kf(D.enabledStatuses),setValues:e=>Y("enabledStatuses",K,e)}),t(ge,{label:"Show only sources with errors",size:Et.L,value:!!D.onlyErrors,onChange:e=>P(t=>({...t,onlyErrors:e}))})]}),e(tb,{children:[t(Te,{"data-id":"filters-reset",size:ke.S,variant:Ie.Text,label:"Reset",onClick:()=>{b(wa.OVERVIEW_FILTERS),O(),P(A()),L(0),z(!1)},textColor:n.v2.colors.red[500]}),e(nb,{children:[t(Te,{"data-id":"filters-cancel",size:ke.S,variant:Ie.Secondary,label:"Cancel",onClick:()=>z(!1)}),t(Te,{"data-id":"filters-apply",size:ke.S,variant:Ie.Primary,label:"Apply",onClick:()=>{f(wa.OVERVIEW_FILTERS,D),$(D),L(Jf(D)),z(!1)}})]})]})]})]})},ob=b.div`
1074
1142
  position: relative;
1075
1143
  display: flex;
1076
1144
  align-items: center;
@@ -1081,7 +1149,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
1081
1149
  box-sizing: border-box;
1082
1150
  border-radius: 16px 16px 0 0;
1083
1151
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
1084
- `,qg=b.div`
1152
+ `,ab=b.div`
1085
1153
  position: absolute;
1086
1154
  bottom: 0;
1087
1155
  left: 0;
@@ -1090,7 +1158,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
1090
1158
  background-color: ${({theme:e})=>e.v2.colors.purple[500]};
1091
1159
  border-radius: 32px;
1092
1160
  transition: width 0.3s;
1093
- `,Zg=({entityType:n,badge:i,badgeTooltip:o,isLoading:a,refetch:l,partiallySelected:r,allSelected:s,onSelectAll:c,progressPercent:d})=>{const{setDrawerType:p}=Cn();return e(Jg,{children:[e(ie,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(Q,{size:na.S,partiallyChecked:r,value:!!s,onChange:c}),t(ee,{size:te.S,nowrap:!0,children:`${Ut(n)}s`}),t(ce,{label:i,tooltip:o,status:Pe.Unknown,textSize:te.XXXS})]}),e(ie,{children:[t(yt,{"data-id":`add-${n}`,icon:Ha,onClick:()=>p(ia(n))}),t(yt,{"data-id":`refresh-${n}`,icon:fl,onClick:l,disabled:a})]}),"number"==typeof d&&t(qg,{$percent:d})]})},Qg=b(ae)`
1161
+ `,lb=({entityType:n,badge:i,badgeTooltip:o,isLoading:a,refetch:l,partiallySelected:r,allSelected:s,onSelectAll:c,progressPercent:d})=>{const{setDrawerType:p}=Cn();return e(ob,{children:[e(ie,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(Q,{size:Na.S,partiallyChecked:r,value:!!s,onChange:c}),t(ee,{size:te.S,nowrap:!0,children:`${Ut(n)}s`}),t(ce,{label:i,tooltip:o,status:Pe.Unknown,textSize:te.XXXS})]}),e(ie,{children:[t(yt,{"data-id":`add-${n}`,icon:gl,onClick:()=>p(Ea(n))}),t(yt,{"data-id":`refresh-${n}`,icon:Bl,onClick:l,disabled:a})]}),"number"==typeof d&&t(ab,{$percent:d})]})},rb=b(ae)`
1094
1162
  align-items: center !important;
1095
1163
  justify-content: center !important;
1096
1164
  align-self: stretch;
@@ -1105,7 +1173,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
1105
1173
  &:hover {
1106
1174
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
1107
1175
  }
1108
- `,ef=({entityType:n,description:i})=>{const{setDrawerType:o}=Cn();return e(Qg,{onClick:()=>o(ia(n)),children:[e(ie,{$gap:4,children:[t(Ha,{size:16}),t(ee,{size:te.S,children:`Add ${Ut(n)}`})]}),t(ee,{size:te.XXS,align:"center",children:i})]})},tf=b.div`
1176
+ `,sb=({entityType:n,description:i})=>{const{setDrawerType:o}=Cn();return e(rb,{onClick:()=>o(Ea(n)),children:[e(ie,{$gap:4,children:[t(gl,{size:16}),t(ee,{size:te.S,children:`Add ${Ut(n)}`})]}),t(ee,{size:te.XXS,align:"center",children:i})]})},cb=b.div`
1109
1177
  display: flex;
1110
1178
  align-items: center;
1111
1179
  gap: 12px;
@@ -1120,10 +1188,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
1120
1188
  &:hover {
1121
1189
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
1122
1190
  }
1123
- `,nf=b(ie)`
1191
+ `,db=b(ie)`
1124
1192
  flex: 1;
1125
1193
  min-width: 0;
1126
- `,of=({entityId:n,entityType:i,title:a,status:l,faded:r,tooltip:s,throughput:c,icon:d,icons:p,iconSrc:u,isActive:h,raw:m})=>{const g=v(),f=i===Nt.Source,b="boolean"==typeof h,y=r||b&&!h,{setDrawerType:C,setDrawerEntityId:S}=Cn(),{selectedSources:x,setSelectedSources:w}=oa(),T=m,k=f?T.id.namespace:"",I=o(()=>{if(!f)return-1;const e=x[k];return e?.length?e.findIndex(e=>e.id.name===T.id.name&&e.id.kind===T.id.kind&&(e.id.region??"")===(T.id.region??"")):-1},[f,x,k,T.id]),N=b&&!h?Fn(Pe.Info,g):l?Fn(l,g):void 0,E=f&&"object"==typeof n?`${n.namespace}-${n.name}-${n.kind}${n.region?`-${n.region}`:""}`:n;return e(tf,{"data-id":E,$faded:y,onClick:()=>{C(kn(i)),S(n)},children:[f&&t(Q,{size:na.S,value:-1!==I,onChange:()=>{const e={...x};e[k]||(e[k]=[]),-1===I?e[k].push(T):e[k].splice(I,1),w(e)}}),t(Tn,{icons:p,icon:d,iconSrc:u}),e(nf,{$gap:4,children:[t(Ae,{size:te.XS,nowrap:!0,children:a}),t(ie,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:(c||b&&!h)&&t(Be,{text:s||(b&&!h?nt.DISABLED:"Heads up! The data-flow metrics you see are calculated over 10-second intervals."),children:t(ce,{label:c||nt.DISABLED,status:l&&[Pe.Error,Pe.Warning].includes(l)?l:Pe.Unknown,leftIcon:N,textSize:te.XXXS})})})]})]})};function af(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===Pe.Loading)?e:{...e,workloadOdigosHealthStatus:{status:dn.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function lf(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 rf=b.div`
1194
+ `,pb=({entityId:n,entityType:i,title:a,status:l,faded:r,tooltip:s,throughput:c,icon:d,icons:p,iconSrc:u,isActive:h,raw:m})=>{const g=v(),f=i===Nt.Source,b="boolean"==typeof h,y=r||b&&!h,{setDrawerType:C,setDrawerEntityId:S}=Cn(),{selectedSources:x,setSelectedSources:w}=$a(),T=m,k=f?T.id.namespace:"",I=o(()=>{if(!f)return-1;const e=x[k];return e?.length?e.findIndex(e=>e.id.name===T.id.name&&e.id.kind===T.id.kind&&(e.id.region??"")===(T.id.region??"")):-1},[f,x,k,T.id]),N=b&&!h?Fn(Pe.Info,g):l?Fn(l,g):void 0,E=f&&"object"==typeof n?`${n.namespace}-${n.name}-${n.kind}${n.region?`-${n.region}`:""}`:n;return e(cb,{"data-id":E,$faded:y,onClick:()=>{C(kn(i)),S(n)},children:[f&&t(Q,{size:Na.S,value:-1!==I,onChange:()=>{const e={...x};e[k]||(e[k]=[]),-1===I?e[k].push(T):e[k].splice(I,1),w(e)}}),t(Tn,{icons:p,icon:d,iconSrc:u}),e(db,{$gap:4,children:[t(Ae,{size:te.XS,nowrap:!0,children:a}),t(ie,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:(c||b&&!h)&&t(Be,{text:s||(b&&!h?nt.DISABLED:"Heads up! The data-flow metrics you see are calculated over 10-second intervals."),children:t(ce,{label:c||nt.DISABLED,status:l&&[Pe.Error,Pe.Warning].includes(l)?l:Pe.Unknown,leftIcon:N,textSize:te.XXXS})})})]})]})};function ub(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===Pe.Loading)?e:{...e,workloadOdigosHealthStatus:{status:dn.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function hb(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 mb=b.div`
1127
1195
  position: absolute;
1128
1196
  top: 0;
1129
1197
  left: 0;
@@ -1134,21 +1202,21 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
1134
1202
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1135
1203
  border-bottom: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
1136
1204
  pointer-events: none;
1137
- `,sf=b.div`
1205
+ `,gb=b.div`
1138
1206
  display: flex;
1139
1207
  align-items: center;
1140
1208
  gap: 8px;
1141
1209
  padding: 4px 8px 0;
1142
- `,cf=b.div`
1210
+ `,fb=b.div`
1143
1211
  flex: 1;
1144
1212
  height: 1px;
1145
1213
  background: ${({theme:e})=>e.v2.colors.silver[700]};
1146
- `,df=({namespace:e})=>{const n=v();return t(rf,{children:t(ee,{size:te.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:e})})},pf=({namespace:n})=>{const i=v();return e(sf,{children:[t(cf,{}),t(ee,{size:te.XXS,nowrap:!0,color:i.v2.colors.grey[300],children:n}),t(cf,{})]})},uf={[Nt.InstrumentationRule]:nt.NO_DATA_INSTRUMENTATION_RULES,[Nt.Source]:nt.NO_DATA_SOURCES,[Nt.Action]:nt.NO_DATA_ACTIONS,[Nt.Destination]:nt.NO_DATA_DESTINATIONS},hf=b.div`
1214
+ `,bb=({namespace:e})=>{const n=v();return t(mb,{children:t(ee,{size:te.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:e})})},vb=({namespace:n})=>{const i=v();return e(gb,{children:[t(fb,{}),t(ee,{size:te.XXS,nowrap:!0,color:i.v2.colors.grey[300],children:n}),t(fb,{})]})},yb={[Nt.InstrumentationRule]:nt.NO_DATA_INSTRUMENTATION_RULES,[Nt.Source]:nt.NO_DATA_SOURCES,[Nt.Action]:nt.NO_DATA_ACTIONS,[Nt.Destination]:nt.NO_DATA_DESTINATIONS},Cb=b.div`
1147
1215
  display: flex;
1148
1216
  flex-direction: column;
1149
1217
  flex: 1 0 0;
1150
1218
  min-width: 0;
1151
- `,mf=b.div`
1219
+ `,Sb=b.div`
1152
1220
  display: flex;
1153
1221
  flex-direction: column;
1154
1222
  align-items: stretch;
@@ -1158,7 +1226,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
1158
1226
  border-radius: 0 0 16px 16px;
1159
1227
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
1160
1228
  overflow: hidden;
1161
- `,gf=b.div`
1229
+ `,xb=b.div`
1162
1230
  position: relative;
1163
1231
  display: flex;
1164
1232
  flex-direction: column;
@@ -1170,7 +1238,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
1170
1238
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1171
1239
  height: ${({$height:e})=>e}px;
1172
1240
  overflow: hidden;
1173
- `,ff=({entityType:n,entities:i,unfilteredCount:r,metrics:s,loading:c,maxHeight:p,refetch:u})=>{const h=n===Nt.Source,m=i.length!==r,g=$t(e=>h?e.progress[Dt.Instrumenting]?.percentage:void 0),f=$t(e=>h?e.progress[Dt.Uninstrumenting]?.percentage:void 0),b=!h||void 0===g&&void 0===f?void 0:g||f||0,{selectedSources:v,setSelectedSources:y}=oa(),C=o(()=>h?Object.values(v).reduce((e,t)=>e+t.length,0):0,[h,v]),S=o(()=>{if(!s)return;const e=new Map,t=n===Nt.Source?s.sources:n===Nt.Destination?s.destinations:void 0;if(t)for(const n of t)e.set(aa(n),n.throughput);return e},[s,n]),x=o(()=>i.map(e=>((e,t,n)=>{const i=Wt(e);if(!i)return null;const o=t===Nt.Source;let a,l,r=!1,s=e;if(o){const t=(e=>{const t=e.workloadOdigosHealthStatus?.status,n=!1===e.markedForInstrumentation?.markedForInstrumentation;switch(t){case dn.Failure:return{status:Pe.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case dn.Notice:return{status:Pe.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case dn.Pending:case dn.Waiting:return{status:void 0,faded:!1,displaySource:af(e)};case dn.Unsupported:case dn.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return n?{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e}:{status:void 0,faded:!1,displaySource:lf(e)}}})(e);a=t.status,r=t.faded,l=t.tooltip,s=t.displaySource}else{const n=t===Nt.Action?la(e):e.conditions,{priorotizedStatus:i,hasDisableds:o}=ra(n);a=i,r=o}const c=sa(e,t,{extended:o,prioritizeDisplayName:!o});let d,p,u,h,m;switch(t){case Nt.Source:{d=wn(e),p=da(Nt.Source);const t=n?.get(ca(i));h=En(t);const o=e.markedForInstrumentation?.markedForInstrumentation;"boolean"==typeof o&&(m=o);break}case Nt.Destination:{const t=wt(e.destinationType.type);p=t.icon,u=t.iconSrc;const o=n?.get(ca(i));h=En(o),m=!e.disabled;break}case Nt.Action:p=Jt(e.type),m=!e.disabled;break;case Nt.InstrumentationRule:p=an(e.type),m=!e.disabled}return{key:ca(i),entityId:i,namespace:o?e.id.namespace:void 0,raw:s,itemProps:{entityId:i,entityType:t,title:c,status:a,faded:r,tooltip:l,throughput:h,icon:p,icons:d,iconSrc:u,isActive:m,raw:s}}})(e,n,S)).filter(Boolean),[i,n,S]),[w,T]=l(""),{elements:k,indexToNamespace:I,multipleNs:N,dividerCount:E}=o(()=>{const e=[],n=[],i=new Set(x.map(e=>e.namespace).filter(Boolean)).size>1;i&&(n.push(""),e.push(t("div",{style:{height:24}},"ns-spacer")));let o=0,a="";for(const i of x)h&&i.namespace&&i.namespace!==a&&(""!==a&&(n.push(i.namespace),e.push(t(pf,{namespace:i.namespace},`ns-divider-${i.namespace}`)),o+=1),a=i.namespace),n.push(i.namespace||""),e.push(t(of,{...i.itemProps},i.key));return{elements:e,indexToNamespace:n,multipleNs:i,dividerCount:o}},[x,h]);a(()=>{if(h&&I.length&&!w){const e=I.find(Boolean);e&&T(e)}},[h,I]);const O=d(e=>{if(!I.length)return;const t=I[Math.min(e,I.length-1)];t&&t!==w&&T(t)},[I,w]),$=58*x.length+(N?28:0)+32*E,A=Math.max(0,p-52-16),R=Math.min(A,$)+8,D="number"==typeof b?`${b}%`:m?`${i.length}/${r}`:r;return e(hf,{children:[t(Zg,{entityType:n,badge:D,badgeTooltip:m?nt.FILTERED_COUNT_TOOLTIP:void 0,isLoading:c,refetch:u,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]}),y(e)}else y({})}:void 0,progressPercent:b}),t(mf,{children:i.length?e(gf,{$height:R,children:[N&&w&&t(df,{namespace:w}),t(yn,{gap:4,elements:k,onTopIndexChange:N?O:void 0})]}):c?t(re,{size:3}):t(ef,{entityType:n,description:uf[n]??nt.TO_COLLECT_OTEL_DATA})})]})},bf=b.div`
1241
+ `,wb=({entityType:n,entities:i,unfilteredCount:r,metrics:s,loading:c,maxHeight:p,refetch:u})=>{const h=n===Nt.Source,m=i.length!==r,g=Ot(e=>h?e.progress[Dt.Instrumenting]?.percentage:void 0),f=Ot(e=>h?e.progress[Dt.Uninstrumenting]?.percentage:void 0),b=!h||void 0===g&&void 0===f?void 0:g||f||0,{selectedSources:v,setSelectedSources:y}=$a(),C=o(()=>h?Object.values(v).reduce((e,t)=>e+t.length,0):0,[h,v]),S=o(()=>{if(!s)return;const e=new Map,t=n===Nt.Source?s.sources:n===Nt.Destination?s.destinations:void 0;if(t)for(const n of t)e.set(Oa(n),n.throughput);return e},[s,n]),x=o(()=>i.map(e=>((e,t,n)=>{const i=Wt(e);if(!i)return null;const o=t===Nt.Source;let a,l,r=!1,s=e;if(o){const t=(e=>{const t=e.workloadOdigosHealthStatus?.status,n=!1===e.markedForInstrumentation?.markedForInstrumentation;switch(t){case dn.Failure:return{status:Pe.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case dn.Notice:return{status:Pe.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case dn.Pending:case dn.Waiting:return{status:void 0,faded:!1,displaySource:ub(e)};case dn.Unsupported:case dn.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return n?{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e}:{status:void 0,faded:!1,displaySource:hb(e)}}})(e);a=t.status,r=t.faded,l=t.tooltip,s=t.displaySource}else{const n=t===Nt.Action?Aa(e):e.conditions,{priorotizedStatus:i,hasDisableds:o}=Ra(n);a=i,r=o}const c=Da(e,t,{extended:o,prioritizeDisplayName:!o});let d,p,u,h,m;switch(t){case Nt.Source:{d=wn(e),p=_a(Nt.Source);const t=n?.get(Pa(i));h=En(t);const o=e.markedForInstrumentation?.markedForInstrumentation;"boolean"==typeof o&&(m=o);break}case Nt.Destination:{const t=wt(e.destinationType.type);p=t.icon,u=t.iconSrc;const o=n?.get(Pa(i));h=En(o),m=!e.disabled;break}case Nt.Action:p=Jt(e.type),m=!e.disabled;break;case Nt.InstrumentationRule:p=an(e.type),m=!e.disabled}return{key:Pa(i),entityId:i,namespace:o?e.id.namespace:void 0,raw:s,itemProps:{entityId:i,entityType:t,title:c,status:a,faded:r,tooltip:l,throughput:h,icon:p,icons:d,iconSrc:u,isActive:m,raw:s}}})(e,n,S)).filter(Boolean),[i,n,S]),[w,T]=l(""),{elements:k,indexToNamespace:I,multipleNs:N,dividerCount:E}=o(()=>{const e=[],n=[],i=new Set(x.map(e=>e.namespace).filter(Boolean)).size>1;i&&(n.push(""),e.push(t("div",{style:{height:24}},"ns-spacer")));let o=0,a="";for(const i of x)h&&i.namespace&&i.namespace!==a&&(""!==a&&(n.push(i.namespace),e.push(t(vb,{namespace:i.namespace},`ns-divider-${i.namespace}`)),o+=1),a=i.namespace),n.push(i.namespace||""),e.push(t(pb,{...i.itemProps},i.key));return{elements:e,indexToNamespace:n,multipleNs:i,dividerCount:o}},[x,h]);a(()=>{if(h&&I.length&&!w){const e=I.find(Boolean);e&&T(e)}},[h,I]);const $=d(e=>{if(!I.length)return;const t=I[Math.min(e,I.length-1)];t&&t!==w&&T(t)},[I,w]),O=58*x.length+(N?28:0)+32*E,A=Math.max(0,p-52-16),R=Math.min(A,O)+8,D="number"==typeof b?`${b}%`:m?`${i.length}/${r}`:r;return e(Cb,{children:[t(lb,{entityType:n,badge:D,badgeTooltip:m?nt.FILTERED_COUNT_TOOLTIP:void 0,isLoading:c,refetch:u,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]}),y(e)}else y({})}:void 0,progressPercent:b}),t(Sb,{children:i.length?e(xb,{$height:R,children:[N&&w&&t(bb,{namespace:w}),t(yn,{gap:4,elements:k,onTopIndexChange:N?$:void 0})]}):c?t(re,{size:3}):t(sb,{entityType:n,description:yb[n]??nt.TO_COLLECT_OTEL_DATA})})]})},Tb=b.div`
1174
1242
  width: 100%;
1175
1243
  flex: 1;
1176
1244
  min-height: 0;
@@ -1178,10 +1246,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
1178
1246
  display: flex;
1179
1247
  align-items: stretch;
1180
1248
  gap: 16px;
1181
- `,vf={sources:[],destinations:[]},yf=()=>{const n=Jo(),{selectedStreamName:i}=it(),{containerRef:a,containerHeight:l}=pa(),{sourcesApi:r,destinationsApi:s,actionsApi:c,instrumentationRulesApi:d,metricsApi:p}=Sr(),{items:u,loading:h}=r.useSources(),{items:m,loading:g}=s.useDestinations(),{items:f,loading:b}=c.useActions(),{items:v,loading:y}=d.useRules(),C=Cn(e=>e.drawerType),{data:S}=p.useMetrics({skip:!u.length||!m.length||!!C,pollInterval:1e4,fetchPolicy:"network-only"}),x=S?.getOverviewMetrics??vf,w=o(()=>qo(u,i),[u,i]),T=o(()=>en(m,i),[m,i]),k=o(()=>ua(w,n),[w,n]),I=o(()=>ha(T,n),[T,n]),N=o(()=>ma(f,n),[f,n]);return e(bf,{ref:a,children:[t(ff,{entityType:Nt.InstrumentationRule,entities:v,unfilteredCount:v.length,loading:y,maxHeight:l,refetch:d.fetchAll}),t(ff,{entityType:Nt.Source,entities:k,unfilteredCount:w.length,metrics:x,loading:h,maxHeight:l,refetch:r.fetchAll}),t(ff,{entityType:Nt.Action,entities:N,unfilteredCount:f.length,loading:b,maxHeight:l,refetch:c.fetchAll}),t(ff,{entityType:Nt.Destination,entities:I,unfilteredCount:T.length,metrics:x,loading:g,maxHeight:l,refetch:s.fetchAll})]})},Cf="40vw",Sf=b.div`
1249
+ `,kb={sources:[],destinations:[]},Ib=()=>{const n=Sa(),{selectedStreamName:i}=it(),{containerRef:a,containerHeight:l}=La(),{sourcesApi:r,destinationsApi:s,actionsApi:c,instrumentationRulesApi:d,metricsApi:p,capabilities:u}=qr(),{items:h,loading:m}=r.useSources(),{items:g,loading:f}=s.useDestinations(),{items:b,loading:v}=c.useActions(),{items:y,loading:C}=d.useRules(),S=Cn(e=>e.drawerType),{data:x}=p.useMetrics({skip:!h.length||!g.length||!!S,pollInterval:1e4,fetchPolicy:"network-only"}),w=x?.getOverviewMetrics??kb,T=o(()=>xa(h,i),[h,i]),k=o(()=>en(g,i),[g,i]),I=o(()=>Fa(T,n),[T,n]),N=o(()=>za(k,n),[k,n]),E=o(()=>Ma(b,n),[b,n]);return e(Tb,{ref:a,children:[u.canManageInstrumentationRules&&t(wb,{entityType:Nt.InstrumentationRule,entities:y,unfilteredCount:y.length,loading:C,maxHeight:l,refetch:d.fetchAll}),t(wb,{entityType:Nt.Source,entities:I,unfilteredCount:T.length,metrics:w,loading:m,maxHeight:l,refetch:r.fetchAll}),u.canManageActions&&t(wb,{entityType:Nt.Action,entities:E,unfilteredCount:b.length,loading:v,maxHeight:l,refetch:c.fetchAll}),t(wb,{entityType:Nt.Destination,entities:N,unfilteredCount:k.length,metrics:w,loading:f,maxHeight:l,refetch:s.fetchAll})]})},Nb="40vw",Eb=b.div`
1182
1250
  position: relative;
1183
- width: ${Cf};
1184
- `,xf=b.div`
1251
+ width: ${Nb};
1252
+ `,$b=b.div`
1185
1253
  position: absolute;
1186
1254
  top: calc(100% + 8px);
1187
1255
  left: 0;
@@ -1190,23 +1258,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
1190
1258
  flex-direction: column;
1191
1259
  gap: 8px;
1192
1260
  padding: 8px;
1193
- width: calc(${Cf} - 16px);
1261
+ width: calc(${Nb} - 16px);
1194
1262
  border-radius: 12px;
1195
1263
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1196
1264
  box-shadow: 0 12px 24px 24px rgba(0, 0, 0, 0.5);
1197
- `,wf=b.div`
1265
+ `,Ob=b.div`
1198
1266
  display: flex;
1199
1267
  align-items: center;
1200
1268
  overflow-x: auto;
1201
- `,Tf=b.div`
1269
+ `,Ab=b.div`
1202
1270
  display: flex;
1203
1271
  flex-direction: column;
1204
1272
  gap: 0;
1205
1273
  max-height: 60vh;
1206
1274
  overflow-y: auto;
1207
- `,kf=b.div`
1275
+ `,Rb=b.div`
1208
1276
  padding: 8px 12px 4px 12px;
1209
- `,If=b.div`
1277
+ `,Db=b.div`
1210
1278
  display: flex;
1211
1279
  align-items: center;
1212
1280
  gap: 8px;
@@ -1216,12 +1284,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
1216
1284
  &:hover {
1217
1285
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
1218
1286
  }
1219
- `,Nf=b.div`
1287
+ `,Pb=b.div`
1220
1288
  padding: 16px 8px;
1221
- `,Ef=({preventPopup:n=!1})=>{const i=v(),{selectedStreamName:a}=it(),{searchText:s,setSearchText:c}=Jo(),{setDrawerType:d,setDrawerEntityId:u}=Cn(),{sourcesApi:h,destinationsApi:m,actionsApi:g,instrumentationRulesApi:f}=Sr(),b=h.useSources().items,y=m.useDestinations().items,C=g.useActions().items,S=f.useRules().items,x=p(null),[w,T]=l(!1),[k,I]=l("all"),N=!n&&(!!s||w),E=()=>{c(""),T(!1),I("all")};$n(x,()=>E()),fi({key:"Escape",active:N},E);const{categories:O,searchResults:$}=o(()=>(({instrumentationRules:e,sources:t,actions:n,destinations:i,searchText:o,selectedCategory:a})=>{const l=o?e.filter(e=>e.type?.toLowerCase().includes(o)||e.ruleName?.toLowerCase().includes(o)):e,r=o?t.filter(e=>e.id.name?.toLowerCase().includes(o)||e.serviceName?.toLowerCase().includes(o)||e.id.namespace?.toLowerCase().includes(o)):t,s=o?n.filter(e=>e.type?.toLowerCase().includes(o)||e.name?.toLowerCase().includes(o)):n,c=o?i.filter(e=>e.destinationType.displayName?.toLowerCase().includes(o)||e.name?.toLowerCase().includes(o)):i,d=[{category:Nt.Source,label:"Sources",count:r.length,entities:[]},{category:Nt.Action,label:"Actions",count:s.length,entities:[]},{category:Nt.Destination,label:"Destinations",count:c.length,entities:[]},{category:Nt.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 p=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(a)).map(e=>({...e,entities:e.category===Nt.InstrumentationRule?l:e.category===Nt.Source?r:e.category===Nt.Action?s:e.category===Nt.Destination?c:[]}));return{categories:d,searchResults:p}})({instrumentationRules:S,sources:qo(b,a),actions:C,destinations:en(y,a),searchText:s,selectedCategory:k}),[S,b,C,y,a,s,k]),A=o(()=>O.filter(({count:e,category:t})=>!!e||"all"===t).map(({category:e,label:t,count:n})=>({value:e,label:n?`${t} (${n})`:t})),[O]),R=$.some(({entities:e})=>e.length>0);return e(Sf,{ref:x,children:[t(vn,{value:s,onChange:e=>c(e.toLowerCase()),onFocus:()=>T(!0),width:Cf}),N&&e(xf,{children:[A.length>1&&t(wf,{children:t(ve,{options:A,selected:k,setSelected:I})}),R?t(Tf,{children:$.map(({category:n,label:o,entities:a},l)=>{if(!a.length)return null;const s=da(n);return e(r,{children:[t(kf,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:o})}),a.map((o,a)=>e(If,{onClick:()=>{const e=Wt(o);e&&(d(kn(n)),u(e),E())},children:[s&&t(s,{size:16,fill:i.v2.colors.white[500]}),t(ee,{size:te.XS,nowrap:!0,children:sa(o,n,{extended:!0})})]},`entity-${l}-${a}`))]},`category-list-${n}`)})}):t(Nf,{children:t($e,{hideIcon:!0,title:"No results",subTitle:s?`No matches for "${s}"`:"Start typing to search"})})]})]})},Of=({onRedirectToSampling:i})=>{const{sourcesApi:a}=Sr(),{items:l}=a.useSources(),{drawerType:r,drawerEntityId:s,setDrawerType:c,setDrawerEntityId:d}=Cn(),p=()=>{c(null),d(null)},u=o(()=>l.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[l]),h=o(()=>Array.from(new Set(l.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[l]);return e(n,{children:[t(xm,{}),r===wi.AddSource&&t(Fr,{children:t($c,{onClose:p,withOverlay:!0})}),r===wi.AddDestination&&t(Mr,{children:t(hc,{onClose:p,withOverlay:!0})}),r===wi.AddInstrumentationRule&&t(zr,{sourceOptions:u,namespaceOptions:h,children:t(mc,{onClose:p,withOverlay:!0})}),r===wi.AddAction&&t(Xr,{sourceOptions:u,namespaceOptions:h,children:t(ic,{onClose:p,withOverlay:!0})}),r===wi.EditSource&&t(Br,{children:t(Jh,{onClose:p,sourceId:s,onRedirectToSampling:i})}),r===wi.EditDestination&&t(Mr,{children:t(wp,{onClose:p,destinationId:s})}),r===wi.EditInstrumentationRule&&t(zr,{sourceOptions:u,namespaceOptions:h,children:t(kp,{onClose:p,ruleId:s})}),r===wi.EditAction&&t(Xr,{sourceOptions:u,namespaceOptions:h,children:t(Cp,{onClose:p,actionId:s})})]})},$f=b.div`
1289
+ `,_b=({preventPopup:n=!1})=>{const i=v(),{selectedStreamName:a}=it(),{searchText:s,setSearchText:c}=Sa(),{setDrawerType:d,setDrawerEntityId:u}=Cn(),{sourcesApi:h,destinationsApi:m,actionsApi:g,instrumentationRulesApi:f,capabilities:b}=qr(),y=h.useSources().items,C=m.useDestinations().items,S=g.useActions().items,x=f.useRules().items,w=p(null),[T,k]=l(!1),[I,N]=l("all"),E=!n&&(!!s||T),$=()=>{c(""),k(!1),N("all")};On(w,()=>$()),Bi({key:"Escape",active:E},$);const{categories:O,searchResults:A}=o(()=>(({instrumentationRules:e,sources:t,actions:n,destinations:i,searchText:o,selectedCategory:a,includeActions:l=!0,includeInstrumentationRules:r=!0})=>{const s=r?o?e.filter(e=>e.type?.toLowerCase().includes(o)||e.ruleName?.toLowerCase().includes(o)):e:[],c=o?t.filter(e=>e.id.name?.toLowerCase().includes(o)||e.serviceName?.toLowerCase().includes(o)||e.id.namespace?.toLowerCase().includes(o)):t,d=l?o?n.filter(e=>e.type?.toLowerCase().includes(o)||e.name?.toLowerCase().includes(o)):n:[],p=o?i.filter(e=>e.destinationType.displayName?.toLowerCase().includes(o)||e.name?.toLowerCase().includes(o)):i,u=[{category:Nt.Source,label:"Sources",count:c.length,entities:[]},...l?[{category:Nt.Action,label:"Actions",count:d.length,entities:[]}]:[],{category:Nt.Destination,label:"Destinations",count:p.length,entities:[]},...r?[{category:Nt.InstrumentationRule,label:"Instrumentation Rules",count:s.length,entities:[]}]:[]];u.unshift({category:"all",label:"All",count:s.length+c.length+d.length+p.length,entities:[]});const h=u.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(a)).map(e=>({...e,entities:e.category===Nt.InstrumentationRule?s:e.category===Nt.Source?c:e.category===Nt.Action?d:e.category===Nt.Destination?p:[]}));return{categories:u,searchResults:h}})({instrumentationRules:x,sources:xa(y,a),actions:S,destinations:en(C,a),searchText:s,selectedCategory:I,includeActions:b.canManageActions,includeInstrumentationRules:b.canManageInstrumentationRules}),[x,y,S,C,a,s,I,b.canManageActions,b.canManageInstrumentationRules]),R=o(()=>O.filter(({count:e,category:t})=>!!e||"all"===t).map(({category:e,label:t,count:n})=>({value:e,label:n?`${t} (${n})`:t})),[O]),D=A.some(({entities:e})=>e.length>0);return e(Eb,{ref:w,children:[t(vn,{value:s,onChange:e=>c(e.toLowerCase()),onFocus:()=>k(!0),width:Nb}),E&&e($b,{children:[R.length>1&&t(Ob,{children:t(ve,{options:R,selected:I,setSelected:N})}),D?t(Ab,{children:A.map(({category:n,label:o,entities:a},l)=>{if(!a.length)return null;const s=_a(n);return e(r,{children:[t(Rb,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:o})}),a.map((o,a)=>e(Db,{onClick:()=>{const e=Wt(o);e&&(d(kn(n)),u(e),$())},children:[s&&t(s,{size:16,fill:i.v2.colors.white[500]}),t(ee,{size:te.XS,nowrap:!0,children:Da(o,n,{extended:!0})})]},`entity-${l}-${a}`))]},`category-list-${n}`)})}):t(Pb,{children:t(Oe,{hideIcon:!0,title:"No results",subTitle:s?`No matches for "${s}"`:"Start typing to search"})})]})]})},Lb=({onRedirectToSampling:i})=>{const{sourcesApi:a}=qr(),{items:l}=a.useSources(),{drawerType:r,drawerEntityId:s,setDrawerType:c,setDrawerEntityId:d}=Cn(),p=()=>{c(null),d(null)},u=o(()=>l.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[l]),h=o(()=>Array.from(new Set(l.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[l]);return e(n,{children:[t($g,{}),r===Ki.AddSource&&t(hs,{children:t(ld,{onClose:p,withOverlay:!0})}),r===Ki.AddDestination&&t(ms,{children:t(Vc,{onClose:p,withOverlay:!0})}),r===Ki.AddInstrumentationRule&&t(gs,{sourceOptions:u,namespaceOptions:h,children:t(Hc,{onClose:p,withOverlay:!0})}),r===Ki.AddAction&&t(fs,{sourceOptions:u,namespaceOptions:h,children:t(Dc,{onClose:p,withOverlay:!0})}),r===Ki.EditSource&&t(bs,{children:t($m,{onClose:p,sourceId:s,onRedirectToSampling:i})}),r===Ki.EditDestination&&t(ms,{children:t(tu,{onClose:p,destinationId:s})}),r===Ki.EditInstrumentationRule&&t(gs,{sourceOptions:u,namespaceOptions:h,children:t(iu,{onClose:p,ruleId:s})}),r===Ki.EditAction&&t(fs,{sourceOptions:u,namespaceOptions:h,children:t(Zp,{onClose:p,actionId:s})})]})},Fb=b.div`
1222
1290
  position: relative;
1223
1291
  display: inline-flex;
1224
- `,Af=b.div`
1292
+ `,zb=b.div`
1225
1293
  display: inline-flex;
1226
1294
  align-items: center;
1227
1295
  gap: 6px;
@@ -1232,7 +1300,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
1232
1300
  &:hover {
1233
1301
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
1234
1302
  }
1235
- `,Rf=b.div`
1303
+ `,Mb=b.div`
1236
1304
  position: absolute;
1237
1305
  top: calc(100% + 8px);
1238
1306
  left: 0;
@@ -1246,18 +1314,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
1246
1314
  border-radius: 12px;
1247
1315
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1248
1316
  box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
1249
- `,Df=b.div`
1317
+ `,Xb=b.div`
1250
1318
  display: flex;
1251
1319
  align-items: center;
1252
1320
  gap: 8px;
1253
1321
  width: 100%;
1254
- `,Pf=b.div`
1322
+ `,Bb=b.div`
1255
1323
  display: flex;
1256
1324
  flex-direction: column;
1257
1325
  gap: 0;
1258
1326
  max-height: 240px;
1259
1327
  overflow-y: auto;
1260
- `,_f=b.div`
1328
+ `,Ub=b.div`
1261
1329
  display: flex;
1262
1330
  align-items: center;
1263
1331
  gap: 8px;
@@ -1268,41 +1336,41 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
1268
1336
  &:hover {
1269
1337
  background-color: ${({$selected:e,theme:t})=>e?t.v2.colors.silver[600]:t.v2.colors.silver[700]};
1270
1338
  }
1271
- `,Lf=b.div`
1339
+ `,Vb=b.div`
1272
1340
  flex: 1;
1273
1341
  min-width: 0;
1274
1342
  overflow: hidden;
1275
1343
  text-overflow: ellipsis;
1276
1344
  white-space: nowrap;
1277
- `,Ff=b.div`
1345
+ `,Hb=b.div`
1278
1346
  display: flex;
1279
1347
  align-items: center;
1280
1348
  gap: 2px;
1281
1349
  flex-shrink: 0;
1282
- `,Mf=b.div`
1350
+ `,jb=b.div`
1283
1351
  display: flex;
1284
1352
  padding-top: 4px;
1285
1353
  border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
1286
- `,zf=()=>{const i=v(),{isK8s:r}=S(),{clearStore:s}=ga(),{dataStreamsApi:c}=Sr();c.useDataStreams();const{dataStreams:d,selectedStreamName:u,setSelectedStreamName:h}=it(),m=p(null),[g,f]=l(!1),[b,y]=l(""),[C,x]=l(""),[w,T]=l(!1),[k,I]=l(!1),[N,E]=l(!1),[O,$]=l(""),[A,R]=l(!1);$n(m,()=>f(!1)),a(()=>{g||y("")},[g]);const D=o(()=>{if(!b)return d;const e=b.toLowerCase();return d.filter(({name:t})=>t.toLowerCase().includes(e))},[d,b]),P=g?tl:nl;return r?e(n,{children:[e($f,{ref:m,children:[e(Af,{"data-id":"data-stream-select",$isOpen:g,onClick:()=>f(e=>!e),children:[t(Ul,{size:24}),t(ee,{size:te.S,weight:500,nowrap:!0,children:(_=u,`Data Stream: ${_}`)}),t(ce,{label:d.length,status:Pe.Unknown,textSize:te.XXXS}),t(P,{size:20,fill:i.v2.colors.silver[200]})]}),g&&e(Rf,{children:[t(Df,{children:t(vn,{value:b,onChange:y,placeholder:"Search streams...",width:"100%"})}),t(Pf,{children:0===D.length?t(_f,{children:t(ee,{size:te.XS,color:ne.Secondary,children:"No streams match"})}):D.map(({name:n})=>{const i=n===fa;return e(_f,{"data-id":`stream-row-${n}`,$selected:n===u,onClick:()=>(e=>{e!==u&&(s(),h(e)),f(!1)})(n),children:[t(Lf,{children:t(ee,{size:te.XS,nowrap:!0,children:n})}),e(Ff,{children:[t(yt,{"data-id":`stream-edit-${n}`,icon:Ka,size:Ct.XS,onClick:e=>{e.stopPropagation(),f(!1),x(n),T(!0)}}),!i&&t(yt,{"data-id":`stream-delete-${n}`,icon:Va,size:Ct.XS,onClick:e=>{e.stopPropagation(),f(!1),$(n),R(!0)}})]})]},`stream-${n}`)})}),t(Mf,{children:t(Te,{"data-id":"add-stream-trigger",variant:Ie.Secondary,size:ke.S,leftIcon:Ha,label:`${Ft.NEW} ${nt.STREAM_NAME}`,fullWidth:!0,onClick:()=>{f(!1),s(),E(!0),I(!0)}})})]})]}),N&&t(Ur,{defaultExcludeName:u,children:t(vm,{isOpen:k,onClose:()=>I(!1),onCloseEnd:()=>E(!1)})}),C&&t(Ur,{children:t(ym,{isOpen:w,dataStreamName:C,onClose:()=>T(!1),onCloseEnd:()=>x("")})}),t(mr,{target:`${nt.STREAM_NAME.toLowerCase()} "${O}"`,isOpen:A,onClose:()=>R(!1),onApprove:async()=>{O&&await c.remove(O)}})]}):null;var _},Xf=b(ae)`
1354
+ `,Gb=()=>{const i=v(),{isK8s:r}=S(),{clearStore:s}=Xa(),{dataStreamsApi:c}=qr();c.useDataStreams();const{dataStreams:d,selectedStreamName:u,setSelectedStreamName:h}=it(),m=p(null),[g,f]=l(!1),[b,y]=l(""),[C,x]=l(""),[w,T]=l(!1),[k,I]=l(!1),[N,E]=l(!1),[$,O]=l(""),[A,R]=l(!1);On(m,()=>f(!1)),a(()=>{g||y("")},[g]);const D=o(()=>{if(!b)return d;const e=b.toLowerCase();return d.filter(({name:t})=>t.toLowerCase().includes(e))},[d,b]),P=g?Il:Nl;return r?e(n,{children:[e(Fb,{ref:m,children:[e(zb,{"data-id":"data-stream-select",$isOpen:g,onClick:()=>f(e=>!e),children:[t(br,{size:24}),t(ee,{size:te.S,weight:500,nowrap:!0,children:(_=u,`Data Stream: ${_}`)}),t(ce,{label:d.length,status:Pe.Unknown,textSize:te.XXXS}),t(P,{size:20,fill:i.v2.colors.silver[200]})]}),g&&e(Mb,{children:[t(Xb,{children:t(vn,{value:b,onChange:y,placeholder:"Search streams...",width:"100%"})}),t(Bb,{children:0===D.length?t(Ub,{children:t(ee,{size:te.XS,color:ne.Secondary,children:"No streams match"})}):D.map(({name:n})=>{const i=n===Ba;return e(Ub,{"data-id":`stream-row-${n}`,$selected:n===u,onClick:()=>(e=>{e!==u&&(s(),h(e)),f(!1)})(n),children:[t(Vb,{children:t(ee,{size:te.XS,nowrap:!0,children:n})}),e(Hb,{children:[t(yt,{"data-id":`stream-edit-${n}`,icon:yl,size:Ct.XS,onClick:e=>{e.stopPropagation(),f(!1),x(n),T(!0)}}),!i&&t(yt,{"data-id":`stream-delete-${n}`,icon:ml,size:Ct.XS,onClick:e=>{e.stopPropagation(),f(!1),O(n),R(!0)}})]})]},`stream-${n}`)})}),t(jb,{children:t(Te,{"data-id":"add-stream-trigger",variant:Ie.Secondary,size:ke.S,leftIcon:gl,label:`${Ft.NEW} ${nt.STREAM_NAME}`,fullWidth:!0,onClick:()=>{f(!1),s(),E(!0),I(!0)}})})]})]}),N&&t(vs,{defaultExcludeName:u,children:t(kg,{isOpen:k,onClose:()=>I(!1),onCloseEnd:()=>E(!1)})}),C&&t(vs,{children:t(Ig,{isOpen:w,dataStreamName:C,onClose:()=>T(!1),onCloseEnd:()=>x("")})}),t(Vr,{target:`${nt.STREAM_NAME.toLowerCase()} "${$}"`,isOpen:A,onClose:()=>R(!1),onApprove:async()=>{$&&await c.remove($)}})]}):null;var _},Wb=b(ae)`
1287
1355
  width: 100%;
1288
1356
  max-height: 320px;
1289
1357
  overflow-y: auto;
1290
1358
  gap: 8px;
1291
- `,Bf=b(ie)`
1359
+ `,Kb=b(ie)`
1292
1360
  width: 100%;
1293
1361
  align-items: center;
1294
1362
  gap: 8px;
1295
1363
  padding: 8px 12px;
1296
1364
  border-radius: 8px;
1297
1365
  background: ${({theme:e})=>e.v2.colors.silver[900]};
1298
- `,Uf=()=>{const i=v(),{selectedStreamName:r}=it(),{selectedSources:s,setSelectedSources:c}=oa(),{sourcesApi:p}=Sr(),[u,h]=l(!1),[m,g]=l(!1),[f,b]=l(!1),[y,C]=l(!1),{toInstrument:S,toUninstrument:x,totalSelected:w}=o(()=>{const e=[],t=[];return Object.values(s).forEach(n=>{n.forEach(n=>{(e=>!1===e.markedForInstrumentation?.markedForInstrumentation)(n)?e.push(n):t.push(n)})}),{toInstrument:e,toUninstrument:t,totalSelected:e.length+t.length}},[s]),T=d(()=>{c({})},[c]),k=d(()=>h(!1),[]),I=d(()=>g(!1),[]),N=d(()=>b(!1),[]),E=d(()=>C(!1),[]);a(()=>{T()},[r,T]);const O=d((e,t)=>{if(!e.length)return;const n=new Map;e.forEach(e=>{const t=e.id.namespace,i=n.get(t)??[];i.push(e),n.set(t,i)}),p.persistV2(Object.fromEntries([...n.entries()].map(([e,n])=>[e,n.map(({id:e})=>({namespace:e.namespace,name:e.name,kind:e.kind||void 0,...e.region?{region:e.region}:{},selected:t,currentStreamName:r}))])))},[p,r]),$=d(()=>{p.restartWorkloads(Object.values(s).flat().filter(e=>e.id.kind!==In.StaticPod).map(Sn)),T()},[p,s,T]),A=d(()=>{O(S,!0),T()},[O,S,T]),R=d(()=>{O(x,!1),T()},[O,x,T]),D=d(()=>{O(S,!0),O(x,!1),T()},[O,S,x,T]),P=S.length>0,_=x.length>0,L=P&&_,F=o(()=>{const e=[{id:"multi-source-deselect",type:bn.Button,buttonProps:{variant:Ie.Text,size:ke.S,label:"Deselect",onClick:T}},{id:"multi-source-restart",type:bn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"Restart",leftIcon:Il,onClick:()=>h(!0)}}];return L?e.push({id:"multi-source-apply",type:bn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Apply Changes",leftIcon:Ha,onClick:()=>C(!0)}}):P?e.push({id:"multi-source-instrument",type:bn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Instrument",leftIcon:Ha,onClick:()=>b(!0)}}):_&&e.push({id:"multi-source-uninstrument",type:bn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Uninstrument",leftIcon:Va,onClick:()=>g(!0)}}),e},[T,L,P,_]),M=e=>sa(e,Nt.Source,{extended:!0})||e.id.name;return e(n,{children:[t(jn,{isOpen:w>0,richTitle:{icon:ll,title:"Selected sources",badge:{label:w}},actions:F}),t(tt,{isOpen:u,title:"Rollout Restart Workloads",description:"Are you sure you want to rollout restart these workloads?",onClose:k,denyButton:{label:"Go Back",variant:Ie.Secondary,onClick:k},approveButton:{label:"Confirm",variant:Ie.Primary,onClick:()=>{$(),k()}}}),t(mr,{isOpen:f,action:"instrument",target:`${S.length} source${1===S.length?"":"s"}`,onClose:N,onDeny:N,onApprove:A}),t(mr,{isOpen:m,action:"uninstrument",target:`${x.length} source${1===x.length?"":"s"}`,onClose:I,onDeny:I,onApprove:R}),t(tt,{isOpen:y,title:"Modify selected sources",description:"These changes are applied immediately. Disabled sources are re-instrumented; enabled sources are uninstrumented.",onClose:E,denyButton:{variant:Ie.Secondary,label:"Cancel",onClick:E},approveButton:{variant:Ie.Primary,label:"Confirm",onClick:()=>{D(),E()}},children:e(Xf,{children:[S.map(n=>e(Bf,{children:[t(ce,{leftIcon:Ha,status:Pe.Success,useSecondaryTone:!0,textColor:i.v2.colors.white[500],textSize:te.XXS}),t(ee,{size:te.XS,color:ne.Primary,children:M(n)})]},`instrument-${n.id.namespace}-${n.id.kind}-${n.id.name}-${n.id.region??""}`)),x.map(n=>e(Bf,{children:[t(ce,{leftIcon:Nl,status:Pe.Error,useSecondaryTone:!0,textColor:i.v2.colors.white[500],textSize:te.XXS}),t(ee,{size:te.XS,color:ne.Primary,children:M(n)})]},`uninstrument-${n.id.namespace}-${n.id.kind}-${n.id.name}-${n.id.region??""}`))]})})]})},Vf=C`
1366
+ `,Yb=()=>{const i=v(),{selectedStreamName:r}=it(),{selectedSources:s,setSelectedSources:c}=$a(),{sourcesApi:p}=qr(),[u,h]=l(!1),[m,g]=l(!1),[f,b]=l(!1),[y,C]=l(!1),{toInstrument:S,toUninstrument:x,totalSelected:w}=o(()=>{const e=[],t=[];return Object.values(s).forEach(n=>{n.forEach(n=>{(e=>!1===e.markedForInstrumentation?.markedForInstrumentation)(n)?e.push(n):t.push(n)})}),{toInstrument:e,toUninstrument:t,totalSelected:e.length+t.length}},[s]),T=d(()=>{c({})},[c]),k=d(()=>h(!1),[]),I=d(()=>g(!1),[]),N=d(()=>b(!1),[]),E=d(()=>C(!1),[]);a(()=>{T()},[r,T]);const $=d((e,t)=>{if(!e.length)return;const n=new Map;e.forEach(e=>{const t=e.id.namespace,i=n.get(t)??[];i.push(e),n.set(t,i)}),p.persistV2(Object.fromEntries([...n.entries()].map(([e,n])=>[e,n.map(({id:e})=>({namespace:e.namespace,name:e.name,kind:e.kind||void 0,...e.region?{region:e.region}:{},selected:t,currentStreamName:r}))])))},[p,r]),O=d(()=>{p.restartWorkloads(Object.values(s).flat().filter(e=>e.id.kind!==In.StaticPod).map(Sn)),T()},[p,s,T]),A=d(()=>{$(S,!0),T()},[$,S,T]),R=d(()=>{$(x,!1),T()},[$,x,T]),D=d(()=>{$(S,!0),$(x,!1),T()},[$,S,x,T]),P=S.length>0,_=x.length>0,L=P&&_,F=o(()=>{const e=[{id:"multi-source-deselect",type:bn.Button,buttonProps:{variant:Ie.Text,size:ke.S,label:"Deselect",onClick:T}},{id:"multi-source-restart",type:bn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"Restart",leftIcon:ql,onClick:()=>h(!0)}}];return L?e.push({id:"multi-source-apply",type:bn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Apply Changes",leftIcon:gl,onClick:()=>C(!0)}}):P?e.push({id:"multi-source-instrument",type:bn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Instrument",leftIcon:gl,onClick:()=>b(!0)}}):_&&e.push({id:"multi-source-uninstrument",type:bn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Uninstrument",leftIcon:ml,onClick:()=>g(!0)}}),e},[T,L,P,_]),z=e=>Da(e,Nt.Source,{extended:!0})||e.id.name;return e(n,{children:[t(jn,{isOpen:w>0,richTitle:{icon:Al,title:"Selected sources",badge:{label:w}},actions:F}),t(tt,{isOpen:u,title:"Rollout Restart Workloads",description:"Are you sure you want to rollout restart these workloads?",onClose:k,denyButton:{label:"Go Back",variant:Ie.Secondary,onClick:k},approveButton:{label:"Confirm",variant:Ie.Primary,onClick:()=>{O(),k()}}}),t(Vr,{isOpen:f,action:"instrument",target:`${S.length} source${1===S.length?"":"s"}`,onClose:N,onDeny:N,onApprove:A}),t(Vr,{isOpen:m,action:"uninstrument",target:`${x.length} source${1===x.length?"":"s"}`,onClose:I,onDeny:I,onApprove:R}),t(tt,{isOpen:y,title:"Modify selected sources",description:"These changes are applied immediately. Disabled sources are re-instrumented; enabled sources are uninstrumented.",onClose:E,denyButton:{variant:Ie.Secondary,label:"Cancel",onClick:E},approveButton:{variant:Ie.Primary,label:"Confirm",onClick:()=>{D(),E()}},children:e(Wb,{children:[S.map(n=>e(Kb,{children:[t(ce,{leftIcon:gl,status:Pe.Success,useSecondaryTone:!0,textColor:i.v2.colors.white[500],textSize:te.XXS}),t(ee,{size:te.XS,color:ne.Primary,children:z(n)})]},`instrument-${n.id.namespace}-${n.id.kind}-${n.id.name}-${n.id.region??""}`)),x.map(n=>e(Kb,{children:[t(ce,{leftIcon:Zl,status:Pe.Error,useSecondaryTone:!0,textColor:i.v2.colors.white[500],textSize:te.XXS}),t(ee,{size:te.XS,color:ne.Primary,children:z(n)})]},`uninstrument-${n.id.namespace}-${n.id.kind}-${n.id.name}-${n.id.region??""}`))]})})]})},Jb=C`
1299
1367
  0% {
1300
1368
  background-position: 200% 50%;
1301
1369
  }
1302
1370
  100% {
1303
1371
  background-position: 0% 50%;
1304
1372
  }
1305
- `,Hf=b.div`
1373
+ `,qb=b.div`
1306
1374
  display: flex;
1307
1375
  align-items: center;
1308
1376
  justify-content: space-evenly;
@@ -1313,43 +1381,43 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
1313
1381
 
1314
1382
  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%)`};
1315
1383
  background-size: 200% 100%;
1316
- animation: ${Vf} 15s linear infinite;
1317
- `,jf=[al,ll,Ua,el],Gf=({onRedirectToSampling:n})=>{const i=v();return e(Ko,{children:[e(ut,{fullHeight:!0,customTitle:t(zf,{}),customSearch:t(Ef,{}),filters:t(Yg,{}),children:[t(Hf,{children:jf.map((n,o)=>e(r,{children:[t(n,{size:24}),o<jf.length-1&&t(Ba,{fill:i.v2.colors.white[500]+oe["020"],size:24})]},n.name))}),t(yf,{})]}),t(Of,{onRedirectToSampling:n}),t(Uf,{})]})};var Wf;(e=>{e.Gateway="gateway",e.Node="node"})(Wf||(Wf={}));const Kf=({onClickDownloadDiagnose:n,onClickRefresh:i,loading:a,disabled:l})=>{const r=o(()=>{const e=[];return n&&e.push({id:Si(),type:bn.Button,buttonProps:{label:"Download Diagnose",leftIcon:Dl,size:ke.S,variant:Ie.Text,onClick:n,disabled:l}}),i&&e.push({id:Si(),type:bn.Button,buttonProps:{label:"Refresh",leftIcon:fl,size:ke.S,variant:Ie.Text,onClick:i,disabled:l,loading:a}}),e},[n,i,l,a]);return e(ie,{$alignItems:"center",$justifyContent:"space-between",children:[t(ba,{icon:Vl,title:"Collectors Pipeline"}),t(va,{actions:r})]})},Yf=({pod:n,onClose:i})=>{const{formatTimeAgo:a}=ln(),{collectorsApi:l}=Sr(),{data:r}=l.usePodInfo(n?{namespace:n.namespace,name:n.name}:void 0,{skip:!n}),s=o(()=>[{id:Si(),title:"Node",label:r?.node??"-",withCopy:!0},{id:Si(),title:"Status",badge:{status:ya(r?.status),label:r?.status??"-"}}],[r]),c=o(()=>r?.containers?.map(e=>({id:Si(),items:[{id:Si(),title:"Container",label:e.name??"-"},{id:Si(),title:"Status",label:e.startedAt?`${e.status} (since ${a(e.startedAt)})`:e.status},{id:Si(),title:"Ready",badge:{status:e.ready?Pe.Success:Pe.Error,leftIcon:e.ready?Za:Qa,label:e.ready?"True":"False",invertColors:!0}},{id:Si(),title:"Started",badge:{status:e.started?Pe.Success:Pe.Error,leftIcon:e.started?Za:Qa,label:e.started?"True":"False",invertColors:!0}},{id:Si(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:Si(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:Si(),title:nt.RESTARTS,label:e.restarts.toString()},{id:Si(),title:"State Reason",label:e.stateReason??"-"},{id:Si(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:Si(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[r]);return t(Xt,{isOpen:!!n,header:{icon:vl,title:"Pod Information",onClose:i},children:r?e(Gt,{bgTint:"1000",richTitle:{icon:vl,title:r.name,withCopy:!0},children:[t(Gt,{bgTint:"900",cellsPerRow:2,items:s}),e(Gt,{bgTint:"900",richTitle:{icon:kl,title:nt.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(fn,{value:`kubectl get pod ${r.name} -n ${r.namespace} -o yaml`}),t(fn,{value:`kubectl describe pod ${r.name} -n ${r.namespace}`}),t(fn,{value:`kubectl logs ${r.name} -n ${r.namespace}`})]}),t(Gt,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:c.length?c.map(({id:e,items:n})=>t(Gt,{bgTint:"800",cellsPerRow:2,items:n},e)):t($e,{title:"No containers",subTitle:"Pod has no containers"})}),t(gr,{bgTint:"900",yaml:r.manifestYAML,defaultOpen:!0})]}):t(ft,{$height:"50vh",children:t(St,{withSpinner:!0})})})};var Jf;(e=>{e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropRate="spanDropRate",e.Age="age",e.DockerImage="dockerImage"})(Jf||(Jf={}));const qf=e=>{const t=[{key:Jf.PodName,label:"Pod Name"},{key:Jf.Status,label:"Status"},{key:Jf.Restarts,label:nt.RESTARTS},{key:Jf.NodeName,label:"Node Name"},{key:Jf.Age,label:"Age"},{key:Jf.DockerImage,label:"Collector Version"}];return e&&t.splice(4,0,{key:Jf.SpanDropRate,label:"Span Drop Rate",noSort:!0,noFilter:!0}),t},Zf=({isLoading:n,pods:i,withSpanDropRate:a})=>{const r=v(),{formatTimeAgo:s}=ln(),[c,d]=l(null),p=o(()=>i.map(n=>({onClick:()=>d(n),cells:[{key:Jf.PodName,rawValue:n.name},{key:Jf.Status,rawValue:n.status,component:()=>{return e=n.status,t(ce,{status:ya(e),label:e});var e}},{key:Jf.Restarts,rawValue:n.restartsCount.toString()},{key:Jf.NodeName,rawValue:n.nodeName},{key:Jf.SpanDropRate,rawValue:0,component:()=>{const{collectorMetrics:i}=n;if(!i)return t(ee,{children:"-"});const o=(i?.metricsAcceptedRps??0)+(i?.metricsDroppedRps??0),a=o>0?Math.round((i?.metricsDroppedRps??0)/o*100):0,l=a>0?Pe.Error:Pe.Success,r=(i?.exporterSuccessRps??0)+(i?.exporterFailedRps??0),s=r>0?Math.round((i?.exporterFailedRps??0)/r*100):0,c=s>0?Pe.Error:Pe.Success;return e(ie,{$gap:4,children:[t(Be,{text:`Accepted: ${i.metricsAcceptedRps.toLocaleString()} spans/s\nDropped: ${i.metricsDroppedRps.toLocaleString()} spans/s`,children:t(ce,{status:l,label:`Receiver ${a}%`,leftIcon:l===Pe.Error?Hl:jl,useSecondaryTone:!0,invertColors:!0})}),t(Be,{text:`Success: ${i.exporterSuccessRps.toLocaleString()} spans/s\nFailed: ${i.exporterFailedRps.toLocaleString()} spans/s`,children:t(ce,{status:c,label:`Exporter ${s}%`,leftIcon:c===Pe.Error?Hl:jl,useSecondaryTone:!0,invertColors:!0})})]})}},{key:Jf.Age,rawValue:s(n.creationTimestamp)},{key:Jf.DockerImage,rawValue:n.image}]})),[i,r]);return e(Gt,{fullHeight:!0,bgTint:"1000",moreSpacing:!0,richTitle:{icon:vl,title:"Pods"},children:[t(Vn,{variant:Hn.Data,isLoading:n,columns:qf(a),rows:p}),t(Yf,{pod:c,onClose:()=>d(null)})]})},Qf=({isOpen:e,onClose:n,title:i,yaml:o})=>t(Xt,{isOpen:e,header:{icon:Gl,title:i,onClose:n},children:t(gr,{yaml:o,defaultOpen:!0})}),eb=e=>{switch(e){case Ca.Healthy:return"All desired replicas are updated, available, and ready";case Ca.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case Ca.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case Ca.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case Ca.Down:return"No available replicas";case Ca.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var tb;(e=>{e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"})(tb||(tb={}));const nb=b.div`
1384
+ animation: ${Jb} 15s linear infinite;
1385
+ `,Zb=({onRedirectToSampling:n})=>{const i=v(),{capabilities:a}=qr(),l=o(()=>{const e=[];return a.canManageInstrumentationRules&&e.push(Ol),e.push(Al),a.canManageActions&&e.push(hl),e.push(kl),e},[a.canManageActions,a.canManageInstrumentationRules]);return e(ya,{children:[e(ut,{fullHeight:!0,customTitle:t(Gb,{}),customSearch:t(_b,{}),filters:t(ib,{}),children:[t(qb,{children:l.map((n,o)=>e(r,{children:[t(n,{size:24}),o<l.length-1&&t(ul,{fill:i.v2.colors.white[500]+oe["020"],size:24})]},n.name))}),t(Ib,{})]}),t(Lb,{onRedirectToSampling:n}),t(Yb,{})]})};var Qb;(e=>{e.Gateway="gateway",e.Node="node"})(Qb||(Qb={}));const ev=({onClickDownloadDiagnose:n,onClickRefresh:i,loading:a,disabled:l})=>{const r=o(()=>{const e=[];return n&&e.push({id:Gi(),type:bn.Button,buttonProps:{label:"Download Diagnose",leftIcon:or,size:ke.S,variant:Ie.Text,onClick:n,disabled:l}}),i&&e.push({id:Gi(),type:bn.Button,buttonProps:{label:"Refresh",leftIcon:Bl,size:ke.S,variant:Ie.Text,onClick:i,disabled:l,loading:a}}),e},[n,i,l,a]);return e(ie,{$alignItems:"center",$justifyContent:"space-between",children:[t(Ua,{icon:vr,title:"Collectors Pipeline"}),t(Va,{actions:r})]})},tv=({pod:n,onClose:i})=>{const{formatTimeAgo:a}=ln(),{collectorsApi:l}=qr(),{data:r}=l.usePodInfo(n?{namespace:n.namespace,name:n.name}:void 0,{skip:!n}),s=o(()=>[{id:Gi(),title:"Node",label:r?.node??"-",withCopy:!0},{id:Gi(),title:"Status",badge:{status:Ha(r?.status),label:r?.status??"-"}}],[r]),c=o(()=>r?.containers?.map(e=>({id:Gi(),items:[{id:Gi(),title:"Container",label:e.name??"-"},{id:Gi(),title:"Status",label:e.startedAt?`${e.status} (since ${a(e.startedAt)})`:e.status},{id:Gi(),title:"Ready",badge:{status:e.ready?Pe.Success:Pe.Error,leftIcon:e.ready?wl:Tl,label:e.ready?"True":"False",invertColors:!0}},{id:Gi(),title:"Started",badge:{status:e.started?Pe.Success:Pe.Error,leftIcon:e.started?wl:Tl,label:e.started?"True":"False",invertColors:!0}},{id:Gi(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:Gi(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:Gi(),title:nt.RESTARTS,label:e.restarts.toString()},{id:Gi(),title:"State Reason",label:e.stateReason??"-"},{id:Gi(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:Gi(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[r]);return t(Xt,{isOpen:!!n,header:{icon:Vl,title:"Pod Information",onClose:i},children:r?e(Gt,{bgTint:"1000",richTitle:{icon:Vl,title:r.name,withCopy:!0},children:[t(Gt,{bgTint:"900",cellsPerRow:2,items:s}),e(Gt,{bgTint:"900",richTitle:{icon:Jl,title:nt.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(fn,{value:`kubectl get pod ${r.name} -n ${r.namespace} -o yaml`}),t(fn,{value:`kubectl describe pod ${r.name} -n ${r.namespace}`}),t(fn,{value:`kubectl logs ${r.name} -n ${r.namespace}`})]}),t(Gt,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:c.length?c.map(({id:e,items:n})=>t(Gt,{bgTint:"800",cellsPerRow:2,items:n},e)):t(Oe,{title:"No containers",subTitle:"Pod has no containers"})}),t(Hr,{bgTint:"900",yaml:r.manifestYAML,defaultOpen:!0})]}):t(ft,{$height:"50vh",children:t(St,{withSpinner:!0})})})};var nv;(e=>{e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropRate="spanDropRate",e.Age="age",e.DockerImage="dockerImage"})(nv||(nv={}));const iv=e=>{const t=[{key:nv.PodName,label:"Pod Name"},{key:nv.Status,label:"Status"},{key:nv.Restarts,label:nt.RESTARTS},{key:nv.NodeName,label:"Node Name"},{key:nv.Age,label:"Age"},{key:nv.DockerImage,label:"Collector Version"}];return e&&t.splice(4,0,{key:nv.SpanDropRate,label:"Span Drop Rate",noSort:!0,noFilter:!0}),t},ov=({isLoading:n,pods:i,withSpanDropRate:a})=>{const r=v(),{formatTimeAgo:s}=ln(),[c,d]=l(null),p=o(()=>i.map(n=>({onClick:()=>d(n),cells:[{key:nv.PodName,rawValue:n.name},{key:nv.Status,rawValue:n.status,component:()=>{return e=n.status,t(ce,{status:Ha(e),label:e});var e}},{key:nv.Restarts,rawValue:n.restartsCount.toString()},{key:nv.NodeName,rawValue:n.nodeName},{key:nv.SpanDropRate,rawValue:0,component:()=>{const{collectorMetrics:i}=n;if(!i)return t(ee,{children:"-"});const o=(i?.metricsAcceptedRps??0)+(i?.metricsDroppedRps??0),a=o>0?Math.round((i?.metricsDroppedRps??0)/o*100):0,l=a>0?Pe.Error:Pe.Success,r=(i?.exporterSuccessRps??0)+(i?.exporterFailedRps??0),s=r>0?Math.round((i?.exporterFailedRps??0)/r*100):0,c=s>0?Pe.Error:Pe.Success;return e(ie,{$gap:4,children:[t(Be,{text:`Accepted: ${i.metricsAcceptedRps.toLocaleString()} spans/s\nDropped: ${i.metricsDroppedRps.toLocaleString()} spans/s`,children:t(ce,{status:l,label:`Receiver ${a}%`,leftIcon:l===Pe.Error?yr:Cr,useSecondaryTone:!0,invertColors:!0})}),t(Be,{text:`Success: ${i.exporterSuccessRps.toLocaleString()} spans/s\nFailed: ${i.exporterFailedRps.toLocaleString()} spans/s`,children:t(ce,{status:c,label:`Exporter ${s}%`,leftIcon:c===Pe.Error?yr:Cr,useSecondaryTone:!0,invertColors:!0})})]})}},{key:nv.Age,rawValue:s(n.creationTimestamp)},{key:nv.DockerImage,rawValue:n.image}]})),[i,r]);return e(Gt,{fullHeight:!0,bgTint:"1000",moreSpacing:!0,richTitle:{icon:Vl,title:"Pods"},children:[t(Vn,{variant:Hn.Data,isLoading:n,columns:iv(a),rows:p}),t(tv,{pod:c,onClose:()=>d(null)})]})},av=({isOpen:e,onClose:n,title:i,yaml:o})=>t(Xt,{isOpen:e,header:{icon:Sr,title:i,onClose:n},children:t(Hr,{yaml:o,defaultOpen:!0})}),lv=e=>{switch(e){case ja.Healthy:return"All desired replicas are updated, available, and ready";case ja.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case ja.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case ja.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case ja.Down:return"No available replicas";case ja.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var rv;(e=>{e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"})(rv||(rv={}));const sv=b.div`
1318
1386
  flex: 0.5;
1319
1387
  padding: 12px;
1320
1388
  border-radius: 12px;
1321
1389
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
1322
- `,ib=({selectedTab:n,gatewayInfo:i,nodeCollectorInfo:a,isLoading:r})=>{const{formatTimeAgo:s}=ln(),[c,d]=l(null),p=o(()=>(e=>{switch(e){case Wf.Gateway:return"Deployment";case Wf.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(n),[n]),u=o(()=>((e,t,n,i)=>{const o={status:Pe.Disabled,label:"No rollouts yet"};let a=!1,l=null;switch(e){case Wf.Gateway:a=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case Wf.Node:a=n?.rolloutInProgress??!1,l=n?.lastRolloutAt??null;break;default:return o}return a?{status:Pe.Info,label:"Rollout in progress",rightIcon:fl,useSecondaryTone:!0}:l?{status:Pe.Disabled,label:`Last Rollout: ${i(l)}`}:o})(n,i,a,s),[i,a,n,s]),h=o(()=>((e,t,n,i)=>{let o=i?Pe.Info:Pe.Unknown,a=i?"Loading":Ca.Unknown,l=i?"Fetching data...":eb(Ca.Unknown);switch(e){case Wf.Gateway:o=t?.status?ya(t?.status):o,a=t?.status??a,l=t?.status?eb(t.status):l;break;case Wf.Node:o=n?.status?ya(n?.status):o,a=n?.status??a,l=n?.status?eb(n.status):l}return{status:o,title:a,description:l}})(n,i,a,r),[i,a,n,r]),m=o(()=>((e,t,n)=>{switch(e){case Wf.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 Wf.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,i,a),[i,a,n]),g=o(()=>((e,t,n,i)=>{switch(e){case Wf.Gateway:return[{title:"Data throughput",cells:[{label:"Traces data",value:En(t?.throughputTracesBytesPerSec??0),isLoading:i},{label:"Metrics data",value:En(t?.throughputMetricsBytesPerSec??0),isLoading:i},{label:"Logs data",value:En(t?.throughputLogsBytesPerSec??0),isLoading:i}]},{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${t?.resources?.requests.cpu}/${t?.resources?.limits.cpu}`,isLoading:i},{label:"Memory",value:`${t?.resources?.requests.memory}/${t?.resources?.limits.memory}`,isLoading:i}]}];case Wf.Node:return[{title:"Data Throughput",cells:[{label:"Traces data",value:En(n?.throughputTracesBytesPerSec??0),isLoading:i},{label:"Metrics data",value:En(n?.throughputMetricsBytesPerSec??0),isLoading:i},{label:"Logs data",value:En(n?.throughputLogsBytesPerSec??0),isLoading:i}]},{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${n?.resources?.requests.cpu}/${n?.resources?.limits.cpu}`,isLoading:i},{label:"Memory",value:`${n?.resources?.requests.memory}/${n?.resources?.limits.memory}`,isLoading:i}]}];default:return[]}})(n,i,a,r),[i,a,n,r]),f=o(()=>(n===Wf.Gateway?i?.manifestYAML:a?.manifestYAML)??"",[i,a,n]),b=o(()=>(n===Wf.Gateway?i?.configMapYAML:a?.configMapYAML)??"",[i,a,n]);return e(Gt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:Gl,title:p,badge:u},actions:[{id:Si(),type:bn.ButtonDropData,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:tb.ManifestYaml,label:p,icon:Wl},{id:tb.ConfigMapYaml,label:"ConfigMap",icon:Wl}]}}],children:[e(ie,{$gap:16,children:[t("div",{children:t(Sa,{...h})}),m.map(e=>t(nb,{children:t("div",{children:t(xa,{...e})})},e.title)),g.map(e=>t(wa,{...e},e.title))]}),t(Qf,{isOpen:c===tb.ManifestYaml,onClose:()=>d(null),title:p,yaml:f}),t(Qf,{isOpen:c===tb.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},ob=[{value:Wf.Gateway,label:"Gateway"},{value:Wf.Node,label:"Node Collector"}],ab=({minSupportedVersion:n})=>{const{isVersionSupported:i,version:a,minSupportedVersion:r}=S(n),[s,c]=l(Wf.Gateway),p=s===Wf.Gateway,u=s===Wf.Node,{collectorsApi:h,configApi:m}=Sr(),{data:g}=m.useEffectiveConfig(),{data:f,loading:b,refetch:v}=h.useGatewayInfo({skip:!p}),{data:y=[],loading:C,refetch:x}=h.useGatewayPods({skip:!p}),{data:w,loading:T,refetch:k}=h.useNodeCollectorInfo({skip:!u}),{data:I=[],loading:N,refetch:E}=h.useNodeCollectorPods({skip:!u}),O=p&&(b||C)||u&&(T||N),$=d(()=>{p?(v(),x()):u&&(k(),E())},[p,u,v,x,k,E]),A=o(()=>p?y:I,[y,I,p]);return e(Ko,{children:[t(Kf,{disabled:!i,loading:O,onClickDownloadDiagnose:void 0,onClickRefresh:$}),e(Ta,{children:[e(ae,{children:[t(ve,{variant:Un.Underline,size:Mt.L,options:ob,selected:s,setSelected:c}),t(ib,{selectedTab:s,gatewayInfo:f??null,nodeCollectorInfo:w??null,isLoading:O})]}),t(Zf,{isLoading:O,pods:A,withSpanDropRate:!1===g?.odigosOwnTelemetryStore?.metricsStoreDisabled}),!i&&t(vr,{minSupportedVersion:r,currentVersion:a||""})]})]})},lb=b.div`
1390
+ `,cv=({selectedTab:n,gatewayInfo:i,nodeCollectorInfo:a,isLoading:r})=>{const{formatTimeAgo:s}=ln(),[c,d]=l(null),p=o(()=>(e=>{switch(e){case Qb.Gateway:return"Deployment";case Qb.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(n),[n]),u=o(()=>((e,t,n,i)=>{const o={status:Pe.Disabled,label:"No rollouts yet"};let a=!1,l=null;switch(e){case Qb.Gateway:a=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case Qb.Node:a=n?.rolloutInProgress??!1,l=n?.lastRolloutAt??null;break;default:return o}return a?{status:Pe.Info,label:"Rollout in progress",rightIcon:Bl,useSecondaryTone:!0}:l?{status:Pe.Disabled,label:`Last Rollout: ${i(l)}`}:o})(n,i,a,s),[i,a,n,s]),h=o(()=>((e,t,n,i)=>{let o=i?Pe.Info:Pe.Unknown,a=i?"Loading":ja.Unknown,l=i?"Fetching data...":lv(ja.Unknown);switch(e){case Qb.Gateway:o=t?.status?Ha(t?.status):o,a=t?.status??a,l=t?.status?lv(t.status):l;break;case Qb.Node:o=n?.status?Ha(n?.status):o,a=n?.status??a,l=n?.status?lv(n.status):l}return{status:o,title:a,description:l}})(n,i,a,r),[i,a,n,r]),m=o(()=>((e,t,n)=>{switch(e){case Qb.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 Qb.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,i,a),[i,a,n]),g=o(()=>((e,t,n,i)=>{switch(e){case Qb.Gateway:return[{title:"Data throughput",cells:[{label:"Traces data",value:En(t?.throughputTracesBytesPerSec??0),isLoading:i},{label:"Metrics data",value:En(t?.throughputMetricsBytesPerSec??0),isLoading:i},{label:"Logs data",value:En(t?.throughputLogsBytesPerSec??0),isLoading:i}]},{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${t?.resources?.requests.cpu}/${t?.resources?.limits.cpu}`,isLoading:i},{label:"Memory",value:`${t?.resources?.requests.memory}/${t?.resources?.limits.memory}`,isLoading:i}]}];case Qb.Node:return[{title:"Data Throughput",cells:[{label:"Traces data",value:En(n?.throughputTracesBytesPerSec??0),isLoading:i},{label:"Metrics data",value:En(n?.throughputMetricsBytesPerSec??0),isLoading:i},{label:"Logs data",value:En(n?.throughputLogsBytesPerSec??0),isLoading:i}]},{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${n?.resources?.requests.cpu}/${n?.resources?.limits.cpu}`,isLoading:i},{label:"Memory",value:`${n?.resources?.requests.memory}/${n?.resources?.limits.memory}`,isLoading:i}]}];default:return[]}})(n,i,a,r),[i,a,n,r]),f=o(()=>(n===Qb.Gateway?i?.manifestYAML:a?.manifestYAML)??"",[i,a,n]),b=o(()=>(n===Qb.Gateway?i?.configMapYAML:a?.configMapYAML)??"",[i,a,n]);return e(Gt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:Sr,title:p,badge:u},actions:[{id:Gi(),type:bn.ButtonDropData,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:rv.ManifestYaml,label:p,icon:xr},{id:rv.ConfigMapYaml,label:"ConfigMap",icon:xr}]}}],children:[e(ie,{$gap:16,children:[t("div",{children:t(Ga,{...h})}),m.map(e=>t(sv,{children:t("div",{children:t(Wa,{...e})})},e.title)),g.map(e=>t(Ka,{...e},e.title))]}),t(av,{isOpen:c===rv.ManifestYaml,onClose:()=>d(null),title:p,yaml:f}),t(av,{isOpen:c===rv.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},dv=[{value:Qb.Gateway,label:"Gateway"},{value:Qb.Node,label:"Node Collector"}],pv=({minSupportedVersion:n})=>{const{isVersionSupported:i,version:a,minSupportedVersion:r}=S(n),[s,c]=l(Qb.Gateway),p=s===Qb.Gateway,u=s===Qb.Node,{collectorsApi:h,configApi:m}=qr(),{data:g}=m.useEffectiveConfig(),{data:f,loading:b,refetch:v}=h.useGatewayInfo({skip:!p}),{data:y=[],loading:C,refetch:x}=h.useGatewayPods({skip:!p}),{data:w,loading:T,refetch:k}=h.useNodeCollectorInfo({skip:!u}),{data:I=[],loading:N,refetch:E}=h.useNodeCollectorPods({skip:!u}),$=p&&(b||C)||u&&(T||N),O=d(()=>{p?(v(),x()):u&&(k(),E())},[p,u,v,x,k,E]),A=o(()=>p?y:I,[y,I,p]);return e(ya,{children:[t(ev,{disabled:!i,loading:$,onClickDownloadDiagnose:void 0,onClickRefresh:O}),e(Ya,{children:[e(ae,{children:[t(ve,{variant:Un.Underline,size:zt.L,options:dv,selected:s,setSelected:c}),t(cv,{selectedTab:s,gatewayInfo:f??null,nodeCollectorInfo:w??null,isLoading:$})]}),t(ov,{isLoading:$,pods:A,withSpanDropRate:!1===g?.odigosOwnTelemetryStore?.metricsStoreDisabled}),!i&&t(Kr,{minSupportedVersion:r,currentVersion:a||""})]})]})},uv=b.div`
1323
1391
  display: inline-flex;
1324
1392
  align-items: center;
1325
1393
  min-width: 0;
1326
1394
  overflow: hidden;
1327
1395
  white-space: pre;
1328
1396
  text-overflow: ellipsis;
1329
- `,rb=b.div`
1397
+ `,hv=b.div`
1330
1398
  display: flex;
1331
1399
  flex-direction: column;
1332
1400
  gap: 4px;
1333
1401
  min-width: 0;
1334
1402
  flex: 1;
1335
1403
  opacity: ${({$disabled:e})=>e?.4:1};
1336
- `,sb=b(ie)`
1404
+ `,mv=b(ie)`
1337
1405
  flex-shrink: 0;
1338
1406
  gap: 6px;
1339
1407
  align-items: center;
1340
1408
  min-height: 22px;
1341
- `,cb=[{key:"content",label:"Content",noSort:!0,noFilter:!0,flex:1},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],db=[{value:"all",label:ka},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],pb=({title:n,items:i,isLoading:a,showTypeFilter:r,onRuleClick:s,onCreateRule:c,onEditRule:p,onDeleteRule:u})=>{const h=v(),[m,g]=l(""),[f,b]=l("all"),y=o(()=>{let e=((e,t,n)=>n&&"all"!==t?e.filter(e=>e.typeBadge===t):e)(i,f,r);return e=((e,t)=>{if(!t.trim())return e;const n=t.toLowerCase();return e.filter(e=>{const t=e.name?.toLowerCase().includes(n),i=e.summary.map(e=>e.text).join("").toLowerCase();return t||i.includes(n)})})(e,m),e},[i,f,r,m]),C=o(()=>y.map(n=>{const i=n.typeBadge?((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(rb,{$disabled:n.disabled,children:[t(lb,{children:t(w,{parts:n.summary})}),n.name&&t(ee,{size:te.XXS,color:ne.Secondary,nowrap:!0,children:n.name})]})},{key:"badges",rawValue:n.typeBadge||"",component:()=>e(sb,{children:[n.disabled&&t(ce,{label:Gn,textSize:te.XXXS,backgroundColor:h.v2.colors.grey[700],textColor:h.v2.colors.grey[300]}),n.typeBadge&&i&&t(ce,{label:n.typeBadge,textSize:te.XXXS,backgroundColor:i.bg,textColor:i.text})]})}],onClick:()=>s(n)}}),[y,h,s]),S=o(()=>{const e=e=>t(Wa,{...e,fill:h.v2.colors.red[500]});return e.displayName="RedDeleteIcon",e},[h]),x=d(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:Zn,leftIcon:Ka,onClick:()=>p(n.ruleId,n.samplingId)},{id:"delete","data-id":"sampling-rule-action-delete",label:"",leftIcon:S,onClick:()=>u(n.ruleId,n.samplingId)}]:[]},[C,y,p,u,S]);return t(ut,{fullHeight:!0,richTitle:{icon:Pl,title:n,badge:{label:i.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:db,selected:f,setSelected:b}}:{}},children:t(Vn,{variant:Hn.Pretty,hideHeader:!0,isLoading:a,noDataProps:m.trim()?{hideIcon:!0,title:Ia,subTitle:Oa(m)}:{hideIcon:!0,title:Ea,button:{label:Na,onClick:c}},columns:cb,rows:C,getRowActions:x})})},ub=({docsUrl:n})=>{const{samplingApi:i,sourcesApi:r}=Sr(),{items:s}=r.useSources(),c=o(()=>s.map(e=>({id:e.id})),[s]),{items:u,loading:h,k8sHealthProbesConfig:m,refetch:g}=i.useSamplingRules(),f=d((e,t)=>i.createNoisy?.({samplingId:e,rule:t}),[i]),b=d((e,t,n)=>i.updateNoisy?.(t,{samplingId:e,rule:n}),[i]),v=d((e,t)=>i.createHighlyRelevant?.({samplingId:e,rule:t}),[i]),y=d((e,t,n)=>i.updateHighlyRelevant?.(t,{samplingId:e,rule:n}),[i]),C=d((e,t)=>i.createCostReduction?.({samplingId:e,rule:t}),[i]),S=d((e,t,n)=>i.updateCostReduction?.(t,{samplingId:e,rule:n}),[i]),x=d((e,t,n)=>"noisy"===n?i.deleteNoisy?.(t,e):"highlyRelevant"===n?i.deleteHighlyRelevant?.(t,e):"costReduction"===n?i.deleteCostReduction?.(t,e):void 0,[i]),w=d((e,t)=>i.updateK8sHealthProbesConfig?.({enabled:e,keepPercentage:t}),[i]),T=o(()=>c.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[c]),k=o(()=>Array.from(new Set(c.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[c]),[I,N]=l(_.Noisy),[E,O]=l(null),[$,D]=l(!1),[P,Q]=l(!1),[ee,te]=l(null),[ne,oe]=l(!1),[le,re]=l(!1),[se,ce]=l(!1),[de,pe]=l(!1);p(!1),a(()=>{},[h,u]);const{pendingViewSamplingRule:ue,setPendingViewSamplingRule:he}=Cn();a(()=>{if(!ue)return;if(h||0===u.length)return;he(null);const e=L(u,ue.ruleId,ue.category);e&&(N(F[ue.category]),D(!1),O(e))},[h,u,ue,he]);const me=o(()=>A(m),[m]),ge=o(()=>M(u),[u]),fe=o(()=>R(ge?.rule??null),[ge]),be=o(()=>z(u),[u]),ye=o(()=>X(be?.rule??null),[be]),Ce=p(E);Ce.current=E,a(()=>{const e=Ce.current;if(!e)return;const t=B(u,e);t?O(t):(O(null),D(!1))},[u]);const Se=o(()=>{const e=new Set;return ge&&e.add(ge.rule.ruleId),be&&e.add(be.rule.ruleId),e},[ge,be]),xe=o(()=>U(u,I,Se),[u,I,Se]),we=d(()=>Q(!0),[]),Ne=d(()=>Q(!1),[]);d(()=>pe(!1),[]);const Ee=d(async e=>{const t=u[0]?.id??"default";switch(K[I]){case"noisy":await f(t,j(e));break;case"highlyRelevant":await v(t,H(e));break;case"costReduction":await C(t,V(e))}Q(!1)},[u,I,f,v,C]),Oe=d(e=>{const t=G(u,e);t&&(D(!1),O(t))},[u]),$e=d(()=>{O(null),D(!1)},[]),Ae=d((e,t)=>{const n=E;if(n&&n.rule.ruleId===e&&n.samplingId===t)D(!0),O({...n});else for(const n of u){if(n.id!==t)continue;const i=[...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(i)return D(!0),void O({category:i.category,rule:i.rule,samplingId:t,summary:W(i.category,i.rule)})}},[E,u]),Re=d(async(e,t,n)=>{const i=E?.category;if(i){switch(i){case"noisy":await b(n,t,j(e));break;case"highlyRelevant":await y(n,t,H(e));break;case"costReduction":await S(n,t,V(e))}D(!1)}},[E,b,y,S]),_e=d((e,t)=>{te({ruleId:e,samplingId:t})},[]),Le=d(async()=>{if(!ee)return;const{ruleId:e,samplingId:t}=ee,n=E?.category||K[I];await x(t,e,n),O(null),D(!1),te(null)},[ee,E,I,x]),Fe=d(()=>te(null),[]),Me=d(async(e,t)=>{await w(e,t),oe(!1)},[w]),ze=d(async e=>{const t=u[0]?.id??"default",n=ge;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}),re(!1)},[u,ge,v,y]),Xe=d(async(e,t)=>{const n=u[0]?.id??"default",i=be;i?await S(i.samplingId,i.rule.ruleId,{name:i.rule.name,disabled:!e,sourceScopes:null,operation:null,percentageAtMost:t,notes:i.rule.notes}):e&&await C(n,{name:"Auto - Drop Traces Cluster-Wide",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:t}),ce(!1)},[u,be,C,S]),Be=d(e=>{const t=K[I];let n=null;switch(t){case"noisy":{const i=j(e);n=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation});break}case"highlyRelevant":{const i=H(e);n=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation,error:i.error??!1,durationAtLeastMs:i.durationAtLeastMs});break}case"costReduction":{const i=V(e);n=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation});break}}return n?{message:$a,ruleId:n}:null},[u,I]),Ue=d(e=>{const t=E?.category,n=E?.rule.ruleId;if(!t)return null;let i=null;switch(t){case"noisy":{const o=j(e);i=Y(u,t,{sourceScopes:o.sourceScopes,operation:o.operation},n);break}case"highlyRelevant":{const o=H(e);i=Y(u,t,{sourceScopes:o.sourceScopes,operation:o.operation,error:o.error??!1,durationAtLeastMs:o.durationAtLeastMs},n);break}case"costReduction":{const o=V(e);i=Y(u,t,{sourceScopes:o.sourceScopes,operation:o.operation},n);break}}return i?{message:$a,ruleId:i}:null},[u,E]),Ve=d(e=>{Q(!1);for(const t of u){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 D(!0),void O({category:n.category,rule:n.rule,samplingId:t.id,summary:W(n.category,n.rule)})}},[u]),He=o(()=>{const e=[];return n&&e.push({id:Si(),type:bn.Button,buttonProps:{"data-id":"sampling-btn-docs",label:Aa,leftIcon:Ga,size:ke.S,variant:Ie.Text,onClick:()=>window.open(n,"_blank")}}),e.push({id:Si(),type:bn.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:Ra,leftIcon:fl,size:ke.S,variant:Ie.Text,onClick:g,loading:h}}),e.push({id:Si(),type:bn.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:Da,rightIcon:Ha,size:ke.S,variant:Ie.Primary,onClick:we}}),e},[n,g,h,we]);return e(Ko,{children:[e(ie,{$gap:12,$justifyContent:"space-between",children:[t(ba,{icon:Pl,title:_a,subTitle:Pa}),t(va,{actions:He})]}),e(ae,{$gap:12,$fullHeight:!0,children:[t(ve,{variant:Un.Underline,size:Mt.L,options:J,selected:I,setSelected:N}),e(ie,{$justifyContent:"space-between",children:[t(De,{status:Pe.Default,message:q[I]}),n&&t(Te,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:Ga,size:ke.S,variant:Ie.Text,onClick:()=>window.open(n,"_blank")})]}),I===_.Noisy?t(nr,{title:ct,summary:me,onEdit:()=>oe(!0)}):I===_.HighlyRelevant?t(nr,{title:ot,summary:fe,onEdit:()=>re(!0)}):I===_.CostReduction?t(nr,{title:rt,summary:ye,onEdit:()=>ce(!0)}):null,t(pb,{title:Z[I],items:xe,isLoading:h,showTypeFilter:I===_.HighlyRelevant,onRuleClick:Oe,onCreateRule:we,onEditRule:Ae,onDeleteRule:_e})]}),t(sm,{formType:Nr.View,data:E,defaultEditMode:$,onClose:$e,onDelete:_e,onSaveEdit:Re,sourceOptions:T,namespaceOptions:k,validateForm:Ue,onNavigateToDuplicate:Ve}),t(sm,{formType:Nr.Create,isOpen:P,category:K[I],onClose:Ne,onSubmit:Ee,sourceOptions:T,namespaceOptions:k,validateForm:Be,onNavigateToDuplicate:Ve}),t(sm,{formType:Nr.EditAutoNoisy,isOpen:ne,enabled:m?.enabled??!1,keepPercentage:m?.keepPercentage??0,onClose:()=>oe(!1),onSave:Me}),t(sm,{formType:Nr.EditAutoHighlyRelevant,isOpen:le,enabled:!!ge&&!ge.rule.disabled,onClose:()=>re(!1),onSave:ze}),t(sm,{formType:Nr.EditAutoCostReduction,isOpen:se,enabled:!!be&&!be.rule.disabled,dropPercentage:be?.rule.percentageAtMost??25,onClose:()=>ce(!1),onSave:Xe}),t(tt,{title:za,description:Ma,isOpen:!!ee,onClose:Fe,denyButton:{label:Fa,variant:Ie.Secondary,onClick:Fe},approveButton:{label:La,variant:Ie.Primary,onClick:()=>{Le(),Fe()}}}),!1]})},hb=b.div`
1409
+ `,gv=[{key:"content",label:"Content",noSort:!0,noFilter:!0,flex:1},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],fv=[{value:"all",label:Ja},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],bv=({title:n,items:i,isLoading:a,showTypeFilter:r,onRuleClick:s,onCreateRule:c,onEditRule:p,onDeleteRule:u})=>{const h=v(),[m,g]=l(""),[f,b]=l("all"),y=o(()=>{let e=((e,t,n)=>n&&"all"!==t?e.filter(e=>e.typeBadge===t):e)(i,f,r);return e=((e,t)=>{if(!t.trim())return e;const n=t.toLowerCase();return e.filter(e=>{const t=e.name?.toLowerCase().includes(n),i=e.summary.map(e=>e.text).join("").toLowerCase();return t||i.includes(n)})})(e,m),e},[i,f,r,m]),C=o(()=>y.map(n=>{const i=n.typeBadge?((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(hv,{$disabled:n.disabled,children:[t(uv,{children:t(w,{parts:n.summary})}),n.name&&t(ee,{size:te.XXS,color:ne.Secondary,nowrap:!0,children:n.name})]})},{key:"badges",rawValue:n.typeBadge||"",component:()=>e(mv,{children:[n.disabled&&t(ce,{label:Gn,textSize:te.XXXS,backgroundColor:h.v2.colors.grey[700],textColor:h.v2.colors.grey[300]}),n.typeBadge&&i&&t(ce,{label:n.typeBadge,textSize:te.XXXS,backgroundColor:i.bg,textColor:i.text})]})}],onClick:()=>s(n)}}),[y,h,s]),S=o(()=>{const e=e=>t(vl,{...e,fill:h.v2.colors.red[500]});return e.displayName="RedDeleteIcon",e},[h]),x=d(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:wi,leftIcon:yl,onClick:()=>p(n.ruleId,n.samplingId)},{id:"delete","data-id":"sampling-rule-action-delete",label:"",leftIcon:S,onClick:()=>u(n.ruleId,n.samplingId)}]:[]},[C,y,p,u,S]);return t(ut,{fullHeight:!0,richTitle:{icon:sr,title:n,badge:{label:i.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:fv,selected:f,setSelected:b}}:{}},children:t(Vn,{variant:Hn.Pretty,hideHeader:!0,isLoading:a,noDataProps:m.trim()?{hideIcon:!0,title:qa,subTitle:el(m)}:{hideIcon:!0,title:Qa,button:{label:Za,onClick:c}},columns:gv,rows:C,getRowActions:x})})},vv=({docsUrl:n})=>{const{samplingApi:i,sourcesApi:r}=qr(),{items:s}=r.useSources(),c=o(()=>s.map(e=>({id:e.id})),[s]),{items:u,loading:h,k8sHealthProbesConfig:m,refetch:g}=i.useSamplingRules(),f=d((e,t)=>i.createNoisy?.({samplingId:e,rule:t}),[i]),b=d((e,t,n)=>i.updateNoisy?.(t,{samplingId:e,rule:n}),[i]),v=d((e,t)=>i.createHighlyRelevant?.({samplingId:e,rule:t}),[i]),y=d((e,t,n)=>i.updateHighlyRelevant?.(t,{samplingId:e,rule:n}),[i]),C=d((e,t)=>i.createCostReduction?.({samplingId:e,rule:t}),[i]),S=d((e,t,n)=>i.updateCostReduction?.(t,{samplingId:e,rule:n}),[i]),x=d((e,t,n)=>"noisy"===n?i.deleteNoisy?.(t,e):"highlyRelevant"===n?i.deleteHighlyRelevant?.(t,e):"costReduction"===n?i.deleteCostReduction?.(t,e):void 0,[i]),w=d((e,t)=>i.updateK8sHealthProbesConfig?.({enabled:e,keepPercentage:t}),[i]),T=o(()=>c.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[c]),k=o(()=>Array.from(new Set(c.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[c]),[I,N]=l(_.Noisy),[E,$]=l(null),[O,D]=l(!1),[P,Q]=l(!1),[ee,te]=l(null),[ne,oe]=l(!1),[le,re]=l(!1),[se,ce]=l(!1),[de,pe]=l(!1);p(!1),a(()=>{},[h,u]);const{pendingViewSamplingRule:ue,setPendingViewSamplingRule:he}=Cn();a(()=>{if(!ue)return;if(h||0===u.length)return;he(null);const e=L(u,ue.ruleId,ue.category);e&&(N(F[ue.category]),D(!1),$(e))},[h,u,ue,he]);const me=o(()=>A(m),[m]),ge=o(()=>z(u),[u]),fe=o(()=>R(ge?.rule??null),[ge]),be=o(()=>M(u),[u]),ye=o(()=>X(be?.rule??null),[be]),Ce=p(E);Ce.current=E,a(()=>{const e=Ce.current;if(!e)return;const t=B(u,e);t?$(t):($(null),D(!1))},[u]);const Se=o(()=>{const e=new Set;return ge&&e.add(ge.rule.ruleId),be&&e.add(be.rule.ruleId),e},[ge,be]),xe=o(()=>U(u,I,Se),[u,I,Se]),we=d(()=>Q(!0),[]),Ne=d(()=>Q(!1),[]);d(()=>pe(!1),[]);const Ee=d(async e=>{const t=u[0]?.id??"default";switch(K[I]){case"noisy":await f(t,j(e));break;case"highlyRelevant":await v(t,H(e));break;case"costReduction":await C(t,V(e))}Q(!1)},[u,I,f,v,C]),$e=d(e=>{const t=G(u,e);t&&(D(!1),$(t))},[u]),Oe=d(()=>{$(null),D(!1)},[]),Ae=d((e,t)=>{const n=E;if(n&&n.rule.ruleId===e&&n.samplingId===t)D(!0),$({...n});else for(const n of u){if(n.id!==t)continue;const i=[...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(i)return D(!0),void $({category:i.category,rule:i.rule,samplingId:t,summary:W(i.category,i.rule)})}},[E,u]),Re=d(async(e,t,n)=>{const i=E?.category;if(i){switch(i){case"noisy":await b(n,t,j(e));break;case"highlyRelevant":await y(n,t,H(e));break;case"costReduction":await S(n,t,V(e))}D(!1)}},[E,b,y,S]),_e=d((e,t)=>{te({ruleId:e,samplingId:t})},[]),Le=d(async()=>{if(!ee)return;const{ruleId:e,samplingId:t}=ee,n=E?.category||K[I];await x(t,e,n),$(null),D(!1),te(null)},[ee,E,I,x]),Fe=d(()=>te(null),[]),ze=d(async(e,t)=>{await w(e,t),oe(!1)},[w]),Me=d(async e=>{const t=u[0]?.id??"default",n=ge;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}),re(!1)},[u,ge,v,y]),Xe=d(async(e,t)=>{const n=u[0]?.id??"default",i=be;i?await S(i.samplingId,i.rule.ruleId,{name:i.rule.name,disabled:!e,sourceScopes:null,operation:null,percentageAtMost:t,notes:i.rule.notes}):e&&await C(n,{name:"Auto - Drop Traces Cluster-Wide",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:t}),ce(!1)},[u,be,C,S]),Be=d(e=>{const t=K[I];let n=null;switch(t){case"noisy":{const i=j(e);n=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation});break}case"highlyRelevant":{const i=H(e);n=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation,error:i.error??!1,durationAtLeastMs:i.durationAtLeastMs});break}case"costReduction":{const i=V(e);n=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation});break}}return n?{message:tl,ruleId:n}:null},[u,I]),Ue=d(e=>{const t=E?.category,n=E?.rule.ruleId;if(!t)return null;let i=null;switch(t){case"noisy":{const o=j(e);i=Y(u,t,{sourceScopes:o.sourceScopes,operation:o.operation},n);break}case"highlyRelevant":{const o=H(e);i=Y(u,t,{sourceScopes:o.sourceScopes,operation:o.operation,error:o.error??!1,durationAtLeastMs:o.durationAtLeastMs},n);break}case"costReduction":{const o=V(e);i=Y(u,t,{sourceScopes:o.sourceScopes,operation:o.operation},n);break}}return i?{message:tl,ruleId:i}:null},[u,E]),Ve=d(e=>{Q(!1);for(const t of u){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 D(!0),void $({category:n.category,rule:n.rule,samplingId:t.id,summary:W(n.category,n.rule)})}},[u]),He=o(()=>{const e=[];return n&&e.push({id:Gi(),type:bn.Button,buttonProps:{"data-id":"sampling-btn-docs",label:nl,leftIcon:bl,size:ke.S,variant:Ie.Text,onClick:()=>window.open(n,"_blank")}}),e.push({id:Gi(),type:bn.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:il,leftIcon:Bl,size:ke.S,variant:Ie.Text,onClick:g,loading:h}}),e.push({id:Gi(),type:bn.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:ol,rightIcon:gl,size:ke.S,variant:Ie.Primary,onClick:we}}),e},[n,g,h,we]);return e(ya,{children:[e(ie,{$gap:12,$justifyContent:"space-between",children:[t(Ua,{icon:sr,title:ll,subTitle:al}),t(Va,{actions:He})]}),e(ae,{$gap:12,$fullHeight:!0,children:[t(ve,{variant:Un.Underline,size:zt.L,options:J,selected:I,setSelected:N}),e(ie,{$justifyContent:"space-between",children:[t(De,{status:Pe.Default,message:q[I]}),n&&t(Te,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:bl,size:ke.S,variant:Ie.Text,onClick:()=>window.open(n,"_blank")})]}),I===_.Noisy?t(Ar,{title:ct,summary:me,onEdit:()=>oe(!0)}):I===_.HighlyRelevant?t(Ar,{title:ot,summary:fe,onEdit:()=>re(!0)}):I===_.CostReduction?t(Ar,{title:rt,summary:ye,onEdit:()=>ce(!0)}):null,t(bv,{title:Z[I],items:xe,isLoading:h,showTypeFilter:I===_.HighlyRelevant,onRuleClick:$e,onCreateRule:we,onEditRule:Ae,onDeleteRule:_e})]}),t(gg,{formType:is.View,data:E,defaultEditMode:O,onClose:Oe,onDelete:_e,onSaveEdit:Re,sourceOptions:T,namespaceOptions:k,validateForm:Ue,onNavigateToDuplicate:Ve}),t(gg,{formType:is.Create,isOpen:P,category:K[I],onClose:Ne,onSubmit:Ee,sourceOptions:T,namespaceOptions:k,validateForm:Be,onNavigateToDuplicate:Ve}),t(gg,{formType:is.EditAutoNoisy,isOpen:ne,enabled:m?.enabled??!1,keepPercentage:m?.keepPercentage??0,onClose:()=>oe(!1),onSave:ze}),t(gg,{formType:is.EditAutoHighlyRelevant,isOpen:le,enabled:!!ge&&!ge.rule.disabled,onClose:()=>re(!1),onSave:Me}),t(gg,{formType:is.EditAutoCostReduction,isOpen:se,enabled:!!be&&!be.rule.disabled,dropPercentage:be?.rule.percentageAtMost??25,onClose:()=>ce(!1),onSave:Xe}),t(tt,{title:dl,description:cl,isOpen:!!ee,onClose:Fe,denyButton:{label:sl,variant:Ie.Secondary,onClick:Fe},approveButton:{label:rl,variant:Ie.Primary,onClick:()=>{Le(),Fe()}}}),!1]})},yv=b.div`
1342
1410
  padding: 12px;
1343
1411
  border-radius: 12px;
1344
1412
  background-color: ${({theme:e})=>e.v2.colors.silver[750]};
1345
- `,mb=f(({id:e,data:n})=>t(hb,{"data-id":e,children:t($e,{...n})}));var gb,fb;mb.displayName=mb.name,(e=>{e.MapItem="map-item",e.NoData="no-data"})(gb||(gb={})),(e=>{e.AnimatedTraffic="animated-traffic"})(fb||(fb={}));const bb=(e,t,n)=>{if(n)return{icons:[Tl],aggService:e,selected:!0};const i=e.isVirtual,o=i?[xn(e)]:t?wn(t):[Kl],{priorotizedStatus:a}=i?{priorotizedStatus:void 0}:ra(t?.conditions||[]);return{icons:o,status:a,isVirtual:i,aggService:e,selected:!0}},vb=e=>!(!e||e.serviceName!==Wp||e.id.namespace||e.id.name||e.id.kind),yb=new os,Cb={"elk.algorithm":"layered","elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"150","elk.spacing.nodeNode":"120","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.spacing.edgeEdgeBetweenLayers":"30","elk.layered.spacing.edgeNodeBetweenLayers":"40"},Sb=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},xb={id:{namespace:"",name:"",kind:""},serviceName:Wp,markedForInstrumentation:{markedForInstrumentation:!0}},wb=h(null),Tb=()=>{const e=m(wb);if(!e)throw new Error("useServiceMapContext must be used within a ServiceMapProvider");return e},kb=({serviceMap:e,children:n})=>{const i=v(),{sourcesApi:r}=Sr(),{items:s}=r.useSources(),[c,p,u]=jr([]),[h,m,g]=Gr([]),[f,b]=l(0),y=d(()=>b(e=>e+1),[]),[C,S]=l(""),[x,w]=l(null),[T,k]=l(null),I=d(e=>k(t=>t===e?null:e),[]),N=d(()=>k(null),[]),E=d((e,t)=>{const n=new Set(e);p(e=>e.map(e=>e.type===gb.MapItem&&n.has(e.id)?{...e,data:{...e.data,selected:t}}:e))},[p]);a(()=>{let t=!1;const n=(e=>{const t=new Map,n=new Set,i=(e,n,i=!1)=>{let o=t.get(e);return o||(o={serviceName:n,isVirtual:i,attributes:{},connectionMap:new Map},t.set(e,o)),o},o=(e,t)=>{if(t)for(const{key:n,value:i}of t)n in e||(e[n]=i)};for(const t of e){const{graphKey:e}=Sb(t.nodeId),a=i(e,t.serviceName);a.isVirtual=!1;for(const e of t.services){const{graphKey:t,detail:l}=Sb(e?.nodeId??"");e.isVirtual&&(n.add(t),o(i(t,e.serviceName,!0).attributes,e.nodeAttributes));let r=a.connectionMap.get(t);if(r||(r={targetGraphKey:t,targetServiceName:e.serviceName,totalRequests:0,lastDateTime:e.dateTime,details:[]},a.connectionMap.set(t,r)),r.totalRequests+=e.requests,e.dateTime>r.lastDateTime&&(r.lastDateTime=e.dateTime),l){const t=r.details.find(e=>e.value===l);t?(t.requests+=e.requests,e.dateTime>t.dateTime&&(t.dateTime=e.dateTime)):r.details.push({value:l,requests:e.requests,dateTime:e.dateTime})}}}const a=[...t.entries()];for(const[,{connectionMap:e}]of a)for(const[o,a]of e)t.has(o)||i(o,a.targetServiceName,n.has(o));const l=[];for(const[e,{serviceName:n,isVirtual:i,attributes:o,connectionMap:a}]of t){const t=[...a.values()];t.sort((e,t)=>e.targetGraphKey.localeCompare(t.targetGraphKey)),l.push({graphKey:e,serviceName:n,isVirtual:i,connections:t,attributes:o})}return l.sort((e,t)=>e.graphKey.localeCompare(t.graphKey)),l})(e),o=(({sources:e,aggregatedServiceMap:t})=>{const n=[],i={x:0,y:0};if(t.length&&e.length)for(const o of t){const t=e.find(e=>o.serviceName===e.serviceName||o.serviceName===e.id.name),a=vb(t);n.push({id:o.graphKey,type:gb.MapItem,position:i,data:bb(o,t,a),measured:{width:80,height:80}})}else n.push({id:gb.NoData,type:gb.NoData,position:i,data:{subTitle:nt.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return n})({aggregatedServiceMap:n,sources:[xb].concat(s)});if(1===o.length&&o[0].id===gb.NoData)return p(o),m([]),S(""),void y();const a=(({theme:e,nodes:t,aggregatedServiceMap:n})=>{const i=[],o=new Map(t.map(e=>[e.id,e]));for(const t of n){const n=t.graphKey,a=o.get(n);if(!a)continue;const l=a.data?.status===Pe.Error;for(const a of t.connections){const r=a.targetGraphKey;o.has(r)&&i.push({id:`${n}-to-${r}`,type:"smoothstep",source:n,target:r,data:{sourceGraphKey:t.graphKey,targetGraphKey:a.targetGraphKey},markerEnd:{type:Hr.ArrowClosed},style:{stroke:l?e?.colors.dark_red:e?.colors.border}})}}return i})({theme:i,nodes:o,aggregatedServiceMap:n});m(a);const l=o.map(e=>e.id).sort().join("|");if(l!==C)return(async(e,t,n={})=>{const i={id:"root",layoutOptions:{...Cb,...n},children:e.map(e=>({id:e.id,width:80,height:80,...e.id===Wp?{layoutOptions:{"elk.layered.layering.layerConstraint":"FIRST","elk.alignment":"CENTER"}}:{}})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},o=await yb.layout(i),a=new Map;return o.children?.forEach(e=>{a.set(e.id,{x:e.x??0,y:e.y??0})}),{nodes:e.map(e=>({...e,position:a.get(e.id)??e.position})),edges:t}})(o,a).then(({nodes:e})=>{t||(p(e),S(l),y())}),()=>{t=!0};p(e=>{const t=new Map(e.map(e=>[e.id,e]));return o.map(e=>{const n=t.get(e.id);return n?e.type===gb.MapItem&&n.type===gb.MapItem?{...e,position:n.position,data:{...e.data,selected:n.data.selected}}:{...e,position:n.position}:e})})},[i,e,s,C]);const O=o(()=>x||T?h.map(e=>{if(e.source===x||e.target===x||e.source===T||e.target===T)return{...e,type:fb.AnimatedTraffic};const t={opacity:.3};return{...e,style:{...e.style,...t},labelStyle:{...e.labelStyle,...t},labelBgStyle:{...e.labelBgStyle,...t}}}):h,[h,x,T]),$=o(()=>({nodes:c,edges:O,onNodesChange:u,onEdgesChange:g,setNodesSelected:E,fitViewTrigger:f,hoveredNodeId:x,setHoveredNodeId:w,activeNodeId:T,toggleActiveNode:I,resetActiveNode:N}),[c,O,u,g,E,f,x,T,I,N]);return t(wb.Provider,{value:$,children:n})},Ib=b.div`
1413
+ `,Cv=f(({id:e,data:n})=>t(yv,{"data-id":e,children:t(Oe,{...n})}));var Sv,xv;Cv.displayName=Cv.name,(e=>{e.MapItem="map-item",e.NoData="no-data"})(Sv||(Sv={})),(e=>{e.AnimatedTraffic="animated-traffic"})(xv||(xv={}));const wv=(e,t,n)=>{if(n)return{icons:[Yl],aggService:e,selected:!0};const i=e.isVirtual,o=i?[xn(e)]:t?wn(t):[wr],{priorotizedStatus:a}=i?{priorotizedStatus:void 0}:Ra(t?.conditions||[]);return{icons:o,status:a,isVirtual:i,aggService:e,selected:!0}},Tv=e=>!(!e||e.serviceName!==ku||e.id.namespace||e.id.name||e.id.kind),kv=new Ps,Iv={"elk.algorithm":"layered","elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"150","elk.spacing.nodeNode":"120","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.spacing.edgeEdgeBetweenLayers":"30","elk.layered.spacing.edgeNodeBetweenLayers":"40"},Nv=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},Ev={id:{namespace:"",name:"",kind:""},serviceName:ku,markedForInstrumentation:{markedForInstrumentation:!0}},$v=h(null),Ov=()=>{const e=m($v);if(!e)throw new Error("useServiceMapContext must be used within a ServiceMapProvider");return e},Av=({serviceMap:e,children:n})=>{const i=v(),{sourcesApi:r}=qr(),{items:s}=r.useSources(),[c,p,u]=Ss([]),[h,m,g]=xs([]),[f,b]=l(0),y=d(()=>b(e=>e+1),[]),[C,S]=l(""),[x,w]=l(null),[T,k]=l(null),I=d(e=>k(t=>t===e?null:e),[]),N=d(()=>k(null),[]),E=d((e,t)=>{const n=new Set(e);p(e=>e.map(e=>e.type===Sv.MapItem&&n.has(e.id)?{...e,data:{...e.data,selected:t}}:e))},[p]);a(()=>{let t=!1;const n=(e=>{const t=new Map,n=new Set,i=(e,n,i=!1)=>{let o=t.get(e);return o||(o={serviceName:n,isVirtual:i,attributes:{},connectionMap:new Map},t.set(e,o)),o},o=(e,t)=>{if(t)for(const{key:n,value:i}of t)n in e||(e[n]=i)};for(const t of e){const{graphKey:e}=Nv(t.nodeId),a=i(e,t.serviceName);a.isVirtual=!1;for(const e of t.services){const{graphKey:t,detail:l}=Nv(e?.nodeId??"");e.isVirtual&&(n.add(t),o(i(t,e.serviceName,!0).attributes,e.nodeAttributes));let r=a.connectionMap.get(t);if(r||(r={targetGraphKey:t,targetServiceName:e.serviceName,totalRequests:0,lastDateTime:e.dateTime,details:[]},a.connectionMap.set(t,r)),r.totalRequests+=e.requests,e.dateTime>r.lastDateTime&&(r.lastDateTime=e.dateTime),l){const t=r.details.find(e=>e.value===l);t?(t.requests+=e.requests,e.dateTime>t.dateTime&&(t.dateTime=e.dateTime)):r.details.push({value:l,requests:e.requests,dateTime:e.dateTime})}}}const a=[...t.entries()];for(const[,{connectionMap:e}]of a)for(const[o,a]of e)t.has(o)||i(o,a.targetServiceName,n.has(o));const l=[];for(const[e,{serviceName:n,isVirtual:i,attributes:o,connectionMap:a}]of t){const t=[...a.values()];t.sort((e,t)=>e.targetGraphKey.localeCompare(t.targetGraphKey)),l.push({graphKey:e,serviceName:n,isVirtual:i,connections:t,attributes:o})}return l.sort((e,t)=>e.graphKey.localeCompare(t.graphKey)),l})(e),o=(({sources:e,aggregatedServiceMap:t})=>{const n=[],i={x:0,y:0};if(t.length&&e.length)for(const o of t){const t=e.find(e=>o.serviceName===e.serviceName||o.serviceName===e.id.name),a=Tv(t);n.push({id:o.graphKey,type:Sv.MapItem,position:i,data:wv(o,t,a),measured:{width:80,height:80}})}else n.push({id:Sv.NoData,type:Sv.NoData,position:i,data:{subTitle:nt.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return n})({aggregatedServiceMap:n,sources:[Ev].concat(s)});if(1===o.length&&o[0].id===Sv.NoData)return p(o),m([]),S(""),void y();const a=(({theme:e,nodes:t,aggregatedServiceMap:n})=>{const i=[],o=new Map(t.map(e=>[e.id,e]));for(const t of n){const n=t.graphKey,a=o.get(n);if(!a)continue;const l=a.data?.status===Pe.Error;for(const a of t.connections){const r=a.targetGraphKey;o.has(r)&&i.push({id:`${n}-to-${r}`,type:"smoothstep",source:n,target:r,data:{sourceGraphKey:t.graphKey,targetGraphKey:a.targetGraphKey},markerEnd:{type:Cs.ArrowClosed},style:{stroke:l?e?.colors.dark_red:e?.colors.border}})}}return i})({theme:i,nodes:o,aggregatedServiceMap:n});m(a);const l=o.map(e=>e.id).sort().join("|");if(l!==C)return(async(e,t,n={})=>{const i={id:"root",layoutOptions:{...Iv,...n},children:e.map(e=>({id:e.id,width:80,height:80,...e.id===ku?{layoutOptions:{"elk.layered.layering.layerConstraint":"FIRST","elk.alignment":"CENTER"}}:{}})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},o=await kv.layout(i),a=new Map;return o.children?.forEach(e=>{a.set(e.id,{x:e.x??0,y:e.y??0})}),{nodes:e.map(e=>({...e,position:a.get(e.id)??e.position})),edges:t}})(o,a).then(({nodes:e})=>{t||(p(e),S(l),y())}),()=>{t=!0};p(e=>{const t=new Map(e.map(e=>[e.id,e]));return o.map(e=>{const n=t.get(e.id);return n?e.type===Sv.MapItem&&n.type===Sv.MapItem?{...e,position:n.position,data:{...e.data,selected:n.data.selected}}:{...e,position:n.position}:e})})},[i,e,s,C]);const $=o(()=>x||T?h.map(e=>{if(e.source===x||e.target===x||e.source===T||e.target===T)return{...e,type:xv.AnimatedTraffic};const t={opacity:.3};return{...e,style:{...e.style,...t},labelStyle:{...e.labelStyle,...t},labelBgStyle:{...e.labelBgStyle,...t}}}):h,[h,x,T]),O=o(()=>({nodes:c,edges:$,onNodesChange:u,onEdgesChange:g,setNodesSelected:E,fitViewTrigger:f,hoveredNodeId:x,setHoveredNodeId:w,activeNodeId:T,toggleActiveNode:I,resetActiveNode:N}),[c,$,u,g,E,f,x,T,I,N]);return t($v.Provider,{value:O,children:n})},Rv=b.div`
1346
1414
  border: 1px ${({theme:e,$isSelected:t,$isVirtual:n})=>t?`solid ${e.v2.colors.blue[300]}`:n?`dashed ${e.v2.colors.silver[300]}`:"solid transparent"};
1347
1415
  border-radius: 8px;
1348
1416
  cursor: pointer;
1349
1417
  opacity: ${({$isVirtual:e})=>e?.8:1};
1350
- `,Nb=b.div`
1418
+ `,Dv=b.div`
1351
1419
  position: relative;
1352
- `,Eb=b.div`
1420
+ `,Pv=b.div`
1353
1421
  position: absolute;
1354
1422
  top: 100%;
1355
1423
  left: 50%;
@@ -1358,7 +1426,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
1358
1426
  align-items: center;
1359
1427
  gap: 4px;
1360
1428
  margin-top: 4px;
1361
- `,Ob=f(({id:i,data:a})=>{const{icons:l,status:r,isVirtual:s}=a,c=v(),{activeNodeId:d,hoveredNodeId:p}=Tb(),{isUserSource:u,isNodeSelected:h,isHovered:m}=o(()=>({isUserSource:i===Wp,isNodeSelected:d===i,isHovered:p===i}),[i,d,p,i]),{isSelected:g,isHighlighted:f}=o(()=>({isSelected:h||u,isHighlighted:h||m||u}),[h,m,u]),b=r?Fn(r,c):null;return e(n,{children:[t(Wr,{type:"source",position:Kr.Right,style:{visibility:"hidden"}}),t(Wr,{type:"target",position:Kr.Left,style:{visibility:"hidden"}}),e(Nb,{"data-id":i,children:[t(Ib,{$isSelected:g,$isVirtual:s,children:t(Tn,{padding:12,icons:l,status:f?Pe.Info:r})}),e(Eb,{children:[b&&t(b,{}),t(ee,{size:te.XXS,nowrap:!0,children:i})]})]})]})});Ob.displayName=Ob.name;const $b=b.div`
1429
+ `,_v=f(({id:i,data:a})=>{const{icons:l,status:r,isVirtual:s}=a,c=v(),{activeNodeId:d,hoveredNodeId:p}=Ov(),{isUserSource:u,isNodeSelected:h,isHovered:m}=o(()=>({isUserSource:i===ku,isNodeSelected:d===i,isHovered:p===i}),[i,d,p,i]),{isSelected:g,isHighlighted:f}=o(()=>({isSelected:h||u,isHighlighted:h||m||u}),[h,m,u]),b=r?Fn(r,c):null;return e(n,{children:[t(ws,{type:"source",position:Ts.Right,style:{visibility:"hidden"}}),t(ws,{type:"target",position:Ts.Left,style:{visibility:"hidden"}}),e(Dv,{"data-id":i,children:[t(Rv,{$isSelected:g,$isVirtual:s,children:t(Tn,{padding:12,icons:l,status:f?Pe.Info:r})}),e(Pv,{children:[b&&t(b,{}),t(ee,{size:te.XXS,nowrap:!0,children:i})]})]})]})});_v.displayName=_v.name;const Lv=b.div`
1362
1430
  display: flex;
1363
1431
  flex-direction: column;
1364
1432
  gap: 12px;
@@ -1371,10 +1439,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
1371
1439
  top: 16px;
1372
1440
  left: 8px;
1373
1441
  z-index: ${({theme:e})=>e.v2.zIndex.drawer};
1374
- `,Ab=({children:e})=>t($b,{children:e});var Rb,Db;(e=>{e.All="All",e.Inbound="Inbound",e.Outbound="Outbound"})(Rb||(Rb={})),(e=>{e.Inbound="Inbound",e.Outbound="Outbound"})(Db||(Db={}));const Pb=b.div`
1442
+ `,Fv=({children:e})=>t(Lv,{children:e});var zv,Mv;(e=>{e.All="All",e.Inbound="Inbound",e.Outbound="Outbound"})(zv||(zv={})),(e=>{e.Inbound="Inbound",e.Outbound="Outbound"})(Mv||(Mv={}));const Xv=b.div`
1375
1443
  flex: 1 1 auto;
1376
1444
  min-height: 0;
1377
- `,_b=()=>{const{nodes:n,activeNodeId:i,resetActiveNode:a}=Tb(),[r,s]=l(Rb.All),c=o(()=>{const e=new Map;for(const t of n)t.type===gb.MapItem&&e.set(t.id,t);return e},[n]),d=o(()=>c.get(i??""),[c,i]),{inbound:p,outbound:u}=o(()=>{const e=[],t=[];if(!d)return{inbound:e,outbound:t};for(const e of d.data.aggService?.connections??[])t.push({peerId:e.targetGraphKey,direction:Db.Outbound,totalRequests:e.totalRequests});for(const t of c.values())if(t.id!==d.id)for(const n of t.data.aggService?.connections??[])n.targetGraphKey===d.id&&e.push({peerId:t.id,direction:Db.Inbound,totalRequests:n.totalRequests});return e.sort((e,t)=>e.peerId.localeCompare(t.peerId)),t.sort((e,t)=>e.peerId.localeCompare(t.peerId)),{inbound:e,outbound:t}},[d,c]);if(!d)return null;const h=[Rb.All,Rb.Inbound].includes(r)&&p.length>0,m=[Rb.All,Rb.Outbound].includes(r)&&u.length>0;return e(Ab,{children:[e(ie,{$width:"100%",$gap:8,children:[t(Te,{variant:Ie.Text,size:ke.S,leftIcon:ml,onClick:a}),t(Tn,{icons:d.data.icons}),t(ee,{size:te.XS,children:d.id})]}),t(ve,{fullWidth:!0,options:[{label:`${Rb.All}`,value:Rb.All,badge:{label:`${p.length+u.length}`}},{label:`${Rb.Inbound}`,value:Rb.Inbound,badge:{label:`${p.length}`}},{label:`${Rb.Outbound}`,value:Rb.Outbound,badge:{label:`${u.length}`}}],selected:r,setSelected:s}),h&&t(Fb,{halfHeight:m,title:"Inbound",icon:xl,connections:p,mapNodesById:c}),m&&t(Fb,{halfHeight:h,title:"Outbound",icon:wl,connections:u,mapNodesById:c})]})},Lb=b.div`
1445
+ `,Bv=()=>{const{nodes:n,activeNodeId:i,resetActiveNode:a}=Ov(),[r,s]=l(zv.All),c=o(()=>{const e=new Map;for(const t of n)t.type===Sv.MapItem&&e.set(t.id,t);return e},[n]),d=o(()=>c.get(i??""),[c,i]),{inbound:p,outbound:u}=o(()=>{const e=[],t=[];if(!d)return{inbound:e,outbound:t};for(const e of d.data.aggService?.connections??[])t.push({peerId:e.targetGraphKey,direction:Mv.Outbound,totalRequests:e.totalRequests});for(const t of c.values())if(t.id!==d.id)for(const n of t.data.aggService?.connections??[])n.targetGraphKey===d.id&&e.push({peerId:t.id,direction:Mv.Inbound,totalRequests:n.totalRequests});return e.sort((e,t)=>e.peerId.localeCompare(t.peerId)),t.sort((e,t)=>e.peerId.localeCompare(t.peerId)),{inbound:e,outbound:t}},[d,c]);if(!d)return null;const h=[zv.All,zv.Inbound].includes(r)&&p.length>0,m=[zv.All,zv.Outbound].includes(r)&&u.length>0;return e(Fv,{children:[e(ie,{$width:"100%",$gap:8,children:[t(Te,{variant:Ie.Text,size:ke.S,leftIcon:Ml,onClick:a}),t(Tn,{icons:d.data.icons}),t(ee,{size:te.XS,children:d.id})]}),t(ve,{fullWidth:!0,options:[{label:`${zv.All}`,value:zv.All,badge:{label:`${p.length+u.length}`}},{label:`${zv.Inbound}`,value:zv.Inbound,badge:{label:`${p.length}`}},{label:`${zv.Outbound}`,value:zv.Outbound,badge:{label:`${u.length}`}}],selected:r,setSelected:s}),h&&t(Vv,{halfHeight:m,title:"Inbound",icon:Wl,connections:p,mapNodesById:c}),m&&t(Vv,{halfHeight:h,title:"Outbound",icon:Kl,connections:u,mapNodesById:c})]})},Uv=b.div`
1378
1446
  display: flex;
1379
1447
  flex-direction: column;
1380
1448
  gap: 8px;
@@ -1382,17 +1450,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
1382
1450
  border-radius: 12px;
1383
1451
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1384
1452
  height: ${({$halfHeight:e})=>e?"48%":"100%"};
1385
- `,Fb=({halfHeight:n,title:i,icon:o,connections:a,mapNodesById:l})=>{const r=v();return e(Lb,{$halfHeight:n,children:[e(ie,{children:[t(o,{size:16,fill:r.v2.colors.grey[300]}),t(ee,{size:te.XXS,color:ne.Secondary,children:i})]}),t(Pb,{children:t(yn,{gap:4,elements:a.map(e=>t(zb,{connection:e,peerNode:l.get(e.peerId)},`${e.direction}-${e.peerId}`))})})]})},Mb=b.div`
1453
+ `,Vv=({halfHeight:n,title:i,icon:o,connections:a,mapNodesById:l})=>{const r=v();return e(Uv,{$halfHeight:n,children:[e(ie,{children:[t(o,{size:16,fill:r.v2.colors.grey[300]}),t(ee,{size:te.XXS,color:ne.Secondary,children:i})]}),t(Xv,{children:t(yn,{gap:4,elements:a.map(e=>t(jv,{connection:e,peerNode:l.get(e.peerId)},`${e.direction}-${e.peerId}`))})})]})},Hv=b.div`
1386
1454
  display: flex;
1387
1455
  align-items: center;
1388
1456
  gap: 8px;
1389
1457
  padding: 8px;
1390
1458
  border-radius: 8px;
1391
1459
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1392
- `,zb=({connection:n,peerNode:i})=>e(Mb,{children:[i&&t(Tn,{icons:i.data.icons}),e(ie,{$gap:4,$width:"100%",$justifyContent:"space-between",children:[t(ee,{size:te.XXS,children:n.peerId}),t(ce,{label:n.totalRequests,tooltip:"Total requests"})]})]}),Xb="0;0.5;1",Bb=f(({id:i,sourceX:o,sourceY:a,targetX:l,targetY:r,sourcePosition:s,targetPosition:c,markerEnd:d})=>{const p=v(),[u]=Yr({sourceX:o,sourceY:a,targetX:l,targetY:r,sourcePosition:s,targetPosition:c}),h=`${i}__animated-traffic-motion`,m=p.v2.colors.blue[700],g=p.v2.colors.blue[900],f=p.v2.colors.blue[500],b="4s";return e(n,{children:[t(Jr,{id:i,path:u,markerEnd:d,style:{stroke:m,strokeWidth:1}}),t(qr,{children:e("svg",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"visible",pointerEvents:"none"},children:[t("path",{id:h,d:u,fill:"none",stroke:"none"}),Array.from({length:5}).map((n,i)=>{const o=`-${(.8*i).toFixed(3)}s`;return e("circle",{r:0,fill:g,children:[t("animateMotion",{dur:b,begin:o,repeatCount:"indefinite",children:t("mpath",{href:`#${h}`})}),t("animate",{attributeName:"r",dur:b,begin:o,repeatCount:"indefinite",keyTimes:Xb,values:"0;3.5;3.5"}),t("animate",{attributeName:"fill",dur:b,begin:o,repeatCount:"indefinite",keyTimes:Xb,values:`${g};${f};${f}`})]},i)})]})})]})});Bb.displayName=Bb.name;const Ub=b.div`
1460
+ `,jv=({connection:n,peerNode:i})=>e(Hv,{children:[i&&t(Tn,{icons:i.data.icons}),e(ie,{$gap:4,$width:"100%",$justifyContent:"space-between",children:[t(ee,{size:te.XXS,children:n.peerId}),t(ce,{label:n.totalRequests,tooltip:"Total requests"})]})]}),Gv="0;0.5;1",Wv=f(({id:i,sourceX:o,sourceY:a,targetX:l,targetY:r,sourcePosition:s,targetPosition:c,markerEnd:d})=>{const p=v(),[u]=ks({sourceX:o,sourceY:a,targetX:l,targetY:r,sourcePosition:s,targetPosition:c}),h=`${i}__animated-traffic-motion`,m=p.v2.colors.blue[700],g=p.v2.colors.blue[900],f=p.v2.colors.blue[500],b="4s";return e(n,{children:[t(Is,{id:i,path:u,markerEnd:d,style:{stroke:m,strokeWidth:1}}),t(Ns,{children:e("svg",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"visible",pointerEvents:"none"},children:[t("path",{id:h,d:u,fill:"none",stroke:"none"}),Array.from({length:5}).map((n,i)=>{const o=`-${(.8*i).toFixed(3)}s`;return e("circle",{r:0,fill:g,children:[t("animateMotion",{dur:b,begin:o,repeatCount:"indefinite",children:t("mpath",{href:`#${h}`})}),t("animate",{attributeName:"r",dur:b,begin:o,repeatCount:"indefinite",keyTimes:Gv,values:"0;3.5;3.5"}),t("animate",{attributeName:"fill",dur:b,begin:o,repeatCount:"indefinite",keyTimes:Gv,values:`${g};${f};${f}`})]},i)})]})})]})});Wv.displayName=Wv.name;const Kv=b.div`
1393
1461
  flex: 1 1 auto;
1394
1462
  min-height: 0;
1395
- `,Vb=({})=>{const{nodes:n,setNodesSelected:i,resetActiveNode:a}=Tb(),[r,s]=l(""),c=o(()=>n.filter(e=>e.type===gb.MapItem).sort((e,t)=>e.id.localeCompare(t.id)),[n]),p=o(()=>c.filter(e=>e.data.selected),[c]),u=o(()=>c.filter(e=>e.id.toLowerCase().includes(r.toLowerCase())),[c,r]),h=o(()=>u.every(e=>e.data.selected),[u]),m=d(()=>{const e=!h;i(u.map(e=>e.id),e),e||a()},[u,h,i,a]);return c.length?e(Ab,{children:[e(ie,{$width:"100%",$gap:8,children:[t(ee,{size:te.XS,children:"Services"}),t(ce,{label:c.length})]}),t(vn,{width:"100%",value:r,onChange:s}),e(ie,{$width:"100%",$justifyContent:"space-between",children:[t(ee,{size:te.XXXS,children:`Showing ${p.length} out of ${c.length}`}),t(ee,{"data-id":"namespaces-select-all",onClick:m,disabled:!u.length,size:te.XS,children:h?nt.UNSELECT_ALL:nt.SELECT_ALL})]}),t(Ub,{children:t(yn,{gap:4,elements:u.map(e=>t(jb,{node:e},e.id))})})]}):null},Hb=b.div`
1463
+ `,Yv=({})=>{const{nodes:n,setNodesSelected:i,resetActiveNode:a}=Ov(),[r,s]=l(""),c=o(()=>n.filter(e=>e.type===Sv.MapItem).sort((e,t)=>e.id.localeCompare(t.id)),[n]),p=o(()=>c.filter(e=>e.data.selected),[c]),u=o(()=>c.filter(e=>e.id.toLowerCase().includes(r.toLowerCase())),[c,r]),h=o(()=>u.every(e=>e.data.selected),[u]),m=d(()=>{const e=!h;i(u.map(e=>e.id),e),e||a()},[u,h,i,a]);return c.length?e(Fv,{children:[e(ie,{$width:"100%",$gap:8,children:[t(ee,{size:te.XS,children:"Services"}),t(ce,{label:c.length})]}),t(vn,{width:"100%",value:r,onChange:s}),e(ie,{$width:"100%",$justifyContent:"space-between",children:[t(ee,{size:te.XXXS,children:`Showing ${p.length} out of ${c.length}`}),t(ee,{"data-id":"namespaces-select-all",onClick:m,disabled:!u.length,size:te.XS,children:h?nt.UNSELECT_ALL:nt.SELECT_ALL})]}),t(Kv,{children:t(yn,{gap:4,elements:u.map(e=>t(qv,{node:e},e.id))})})]}):null},Jv=b.div`
1396
1464
  display: flex;
1397
1465
  align-items: center;
1398
1466
  gap: 8px;
@@ -1400,7 +1468,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
1400
1468
  border-radius: 8px;
1401
1469
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1402
1470
  cursor: pointer;
1403
- `,jb=({node:n})=>{const{setNodesSelected:i,activeNodeId:o,resetActiveNode:a}=Tb(),l=d(()=>{const e=!n.data.selected,t=o===n.id;i([n.id],e),!e&&t&&a()},[n,o,i,a]);return e(Hb,{onClick:l,children:[t(Q,{value:n.data.selected||!1,onChange:l}),t(Tn,{icons:n.data.icons}),t(ee,{size:te.XXS,children:n.id})]},n.id)},Gb=b.div`
1471
+ `,qv=({node:n})=>{const{setNodesSelected:i,activeNodeId:o,resetActiveNode:a}=Ov(),l=d(()=>{const e=!n.data.selected,t=o===n.id;i([n.id],e),!e&&t&&a()},[n,o,i,a]);return e(Jv,{onClick:l,children:[t(Q,{value:n.data.selected||!1,onChange:l}),t(Tn,{icons:n.data.icons}),t(ee,{size:te.XXS,children:n.id})]},n.id)},Zv=b.div`
1404
1472
  position: relative;
1405
1473
  height: 100%;
1406
1474
  .react-flow__attribution {
@@ -1409,7 +1477,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
1409
1477
  * {
1410
1478
  transition: none;
1411
1479
  }
1412
- `,Wb=b.div`
1480
+ `,Qv=b.div`
1413
1481
  .react-flow__controls {
1414
1482
  display: flex;
1415
1483
  align-items: center;
@@ -1435,33 +1503,33 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
1435
1503
  }
1436
1504
  }
1437
1505
  }
1438
- `,Kb={[gb.MapItem]:Ob,[gb.NoData]:mb},Yb={[fb.AnimatedTraffic]:Bb},Jb={duration:300,padding:.1,includeHiddenNodes:!0,maxZoom:1},qb=({trigger:e})=>{const{fitView:t}=is(),n=p(!0);return a(()=>{n.current?n.current=!1:e>0&&requestAnimationFrame(()=>t(Jb))},[e,t]),null},Zb=({onRefresh:n})=>{const{nodes:i,edges:a,fitViewTrigger:l,onNodesChange:r,onEdgesChange:s,setHoveredNodeId:c,toggleActiveNode:d}=Tb(),p=o(()=>{const e=new Set(i.filter(e=>e.type===gb.MapItem&&e.data.selected).map(e=>e.id)),t=new Set;for(const n of a)e.has(n.source)&&t.add(n.target),e.has(n.target)&&t.add(n.source);return i.filter(e=>e.type!==gb.MapItem||e.data.selected||t.has(e.id))},[i,a]);return e(Qr,{zoomOnScroll:!0,nodes:p,nodeTypes:Kb,edges:a,edgeTypes:Yb,onNodeClick:(e,t)=>d(t.id),onNodeMouseEnter:(e,t)=>c(t.id),onNodeMouseLeave:()=>c(null),onNodesChange:r,onEdgesChange:s,children:[t(es,{}),t(qb,{trigger:l}),t(Wb,{children:t(ts,{position:"top-right",orientation:"horizontal",showInteractive:!1,showZoom:!0,showFitView:!0,fitViewOptions:Jb,children:t(ns,{onClick:n,children:t(fl,{})})})})]})},Qb=n=>t(Zr,{children:e(Gb,{children:[t(Zb,{...n}),t(Vb,{}),t(_b,{})]})}),ev=b.div`
1506
+ `,ey={[Sv.MapItem]:_v,[Sv.NoData]:Cv},ty={[xv.AnimatedTraffic]:Wv},ny={duration:300,padding:.1,includeHiddenNodes:!0,maxZoom:1},iy=({trigger:e})=>{const{fitView:t}=Ds(),n=p(!0);return a(()=>{n.current?n.current=!1:e>0&&requestAnimationFrame(()=>t(ny))},[e,t]),null},oy=({onRefresh:n})=>{const{nodes:i,edges:a,fitViewTrigger:l,onNodesChange:r,onEdgesChange:s,setHoveredNodeId:c,toggleActiveNode:d}=Ov(),p=o(()=>{const e=new Set(i.filter(e=>e.type===Sv.MapItem&&e.data.selected).map(e=>e.id)),t=new Set;for(const n of a)e.has(n.source)&&t.add(n.target),e.has(n.target)&&t.add(n.source);return i.filter(e=>e.type!==Sv.MapItem||e.data.selected||t.has(e.id))},[i,a]);return e($s,{zoomOnScroll:!0,nodes:p,nodeTypes:ey,edges:a,edgeTypes:ty,onNodeClick:(e,t)=>d(t.id),onNodeMouseEnter:(e,t)=>c(t.id),onNodeMouseLeave:()=>c(null),onNodesChange:r,onEdgesChange:s,children:[t(Os,{}),t(iy,{trigger:l}),t(Qv,{children:t(As,{position:"top-right",orientation:"horizontal",showInteractive:!1,showZoom:!0,showFitView:!0,fitViewOptions:ny,children:t(Rs,{onClick:n,children:t(Bl,{})})})})]})},ay=n=>t(Es,{children:e(Zv,{children:[t(oy,{...n}),t(Yv,{}),t(Bv,{})]})}),ly=b.div`
1439
1507
  width: 100%;
1440
1508
  flex: 1;
1441
1509
  align-self: stretch;
1442
1510
  min-height: 0;
1443
1511
  height: 100%;
1444
1512
  position: relative;
1445
- `,tv=()=>{const{serviceMapApi:e}=Sr(),{data:n,refetch:i}=e.useServiceMap({pollInterval:5e3,fetchPolicy:"cache-and-network"});return t(kb,{serviceMap:n?.serviceMap??[],children:t(ev,{children:t(Qb,{onRefresh:i})})})},nv=b.div`
1513
+ `,ry=()=>{const{serviceMapApi:e}=qr(),{data:n,refetch:i}=e.useServiceMap({pollInterval:5e3,fetchPolicy:"cache-and-network"});return t(Av,{serviceMap:n?.serviceMap??[],children:t(ly,{children:t(ay,{onRefresh:i})})})},sy=b.div`
1446
1514
  display: flex;
1447
1515
  align-items: center;
1448
1516
  justify-content: space-between;
1449
1517
  padding: 0 12px;
1450
- `,iv=b.div`
1518
+ `,cy=b.div`
1451
1519
  display: flex;
1452
1520
  align-items: center;
1453
1521
  gap: 8px;
1454
- `,ov=b.div`
1522
+ `,dy=b.div`
1455
1523
  width: 1px;
1456
1524
  height: 20px;
1457
1525
  background-color: ${({theme:e})=>e.v2.colors.silver[500]};
1458
- `,av=({disabled:n,loading:i,onClickShowYaml:a,onClickReset:r,onClickRefresh:s})=>{const c=v(),[d,p]=l(!1),u=o(()=>a?[{id:Si(),type:bn.Button,buttonProps:{label:"Show Config YAML",leftIcon:Wl,size:ke.S,variant:Ie.Secondary,onClick:a,disabled:n}}]:[],[a,n]),h=o(()=>{const e=[];return s&&e.push({id:Si(),type:bn.Button,buttonProps:{leftIcon:fl,tooltip:"Refresh",hideTooltipIcon:!0,size:ke.S,variant:Ie.Text,onClick:s,disabled:n,loading:i}}),r&&e.push({id:Si(),type:bn.Button,buttonProps:{leftIcon:Va,tooltip:"Reset to defaults",hideTooltipIcon:!0,size:ke.S,variant:Ie.Text,textColor:c.v2.colors.red[500],onClick:()=>p(!0),disabled:n}}),e},[n,i,r,s,c]),m=u.length>0,g=h.length>0;return e(nv,{children:[t(ba,{icon:bl,title:"Odigos Settings"}),e(iv,{children:[m&&t(va,{actions:u}),m&&g&&t(ov,{}),g&&t(va,{actions:h})]}),t(tt,{isOpen:d,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:Ie.Secondary,onClick:()=>p(!1)},approveButton:{label:"Approve",variant:Ie.Primary,onClick:()=>{r?.(),p(!1)}}})]})},lv=b(ae)`
1526
+ `,py=({disabled:n,loading:i,onClickShowYaml:a,onClickReset:r,onClickRefresh:s})=>{const c=v(),[d,p]=l(!1),u=o(()=>a?[{id:Gi(),type:bn.Button,buttonProps:{label:"Show Config YAML",leftIcon:xr,size:ke.S,variant:Ie.Secondary,onClick:a,disabled:n}}]:[],[a,n]),h=o(()=>{const e=[];return s&&e.push({id:Gi(),type:bn.Button,buttonProps:{leftIcon:Bl,tooltip:"Refresh",hideTooltipIcon:!0,size:ke.S,variant:Ie.Text,onClick:s,disabled:n,loading:i}}),r&&e.push({id:Gi(),type:bn.Button,buttonProps:{leftIcon:ml,tooltip:"Reset to defaults",hideTooltipIcon:!0,size:ke.S,variant:Ie.Text,textColor:c.v2.colors.red[500],onClick:()=>p(!0),disabled:n}}),e},[n,i,r,s,c]),m=u.length>0,g=h.length>0;return e(sy,{children:[t(Ua,{icon:Ul,title:"Odigos Settings"}),e(cy,{children:[m&&t(Va,{actions:u}),m&&g&&t(dy,{}),g&&t(Va,{actions:h})]}),t(tt,{isOpen:d,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:Ie.Secondary,onClick:()=>p(!1)},approveButton:{label:"Approve",variant:Ie.Primary,onClick:()=>{r?.(),p(!1)}}})]})},uy=b(ae)`
1459
1527
  width: 220px;
1460
1528
  flex-shrink: 0;
1461
1529
  height: 100%;
1462
1530
  gap: 4px;
1463
1531
  overflow-y: auto;
1464
- `,rv=({options:e,selected:n,setSelected:i,disabled:o})=>t(lv,{children:e.map(e=>t(ds,{dataId:`settings-nav-${e.id}`,title:e.label,isSelected:n===e.id,disabled:o,onClick:()=>i(e.id)},e.id))}),sv=b(ae)`
1532
+ `,hy=({options:e,selected:n,setSelected:i,disabled:o})=>t(uy,{children:e.map(e=>t(Xs,{dataId:`settings-nav-${e.id}`,title:e.label,isSelected:n===e.id,disabled:o,onClick:()=>i(e.id)},e.id))}),my=b(ae)`
1465
1533
  width: 100%;
1466
1534
  /* side menu (220) + gap (24) + form (600) = 844, so content fills exactly with no dead space */
1467
1535
  max-width: 844px;
@@ -1471,25 +1539,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
1471
1539
  gap: 24px;
1472
1540
  flex: 1;
1473
1541
  min-height: 0;
1474
- `,cv=b(ie)`
1542
+ `,gy=b(ie)`
1475
1543
  flex: 1;
1476
1544
  min-height: 0;
1477
1545
  width: 100%;
1478
1546
  align-self: stretch;
1479
- `,dv=b(ae)`
1547
+ `,fy=b(ae)`
1480
1548
  flex: 1;
1481
1549
  min-height: 0;
1482
1550
  height: 100%;
1483
1551
  max-width: 600px;
1484
1552
  overflow-y: auto;
1485
- `,pv=b(ie)`
1553
+ `,by=b(ie)`
1486
1554
  gap: 8px;
1487
1555
  width: 100%;
1488
1556
  align-items: center;
1489
- `,uv=b.div`
1557
+ `,vy=b.div`
1490
1558
  flex: 1;
1491
1559
  min-width: 0;
1492
- `,hv=e=>"general"===e.name?0:"advanced"===e.name?2:1,mv=({minSupportedVersion:i})=>{const{isVersionSupported:r,version:s,isEnterprise:c,minSupportedVersion:d}=S(i),{configApi:p}=Sr(),{data:u,loading:h}=p.useConfigYamls(),{data:m,loading:g,refetch:f}=p.useEffectiveConfig(),b=u?.configYamls??[],[v,y]=l(!1),C=o(()=>{if(!m)return{};const{manifestYAML:e,provenance:t,...n}=m;return n},[m]),{formData:x,handleFormChange:w,getNestedValue:T,getFormDiff:k,isFormDirty:I}=qt(C);a(()=>{"{}"!==JSON.stringify(C)&&"{}"===JSON.stringify(x)&&w(void 0,void 0,C)},[C,x]);const N=o(()=>[...b].sort((e,t)=>hv(e)-hv(t)),[b]),E=o(()=>(e=>{if(!e)return{};const t={};for(const n of e)t[n.helmPath]=n.reconciledFrom;return t})(m?.provenance),[m?.provenance]),O=o(()=>{const e=new Set;for(const t of b)for(const n of t.fields)n.componentType===jt.Dropdown&&e.add(n.helmValuePath);return e},[b]),$=o(()=>b.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:T("formData",e.helmValuePath)}))),[b,x,T]),[A,R]=l(!1),[D,P]=l(!1),_=o(()=>[{id:Si(),type:bn.Button,buttonProps:{"data-id":"settings-save",variant:Ie.Primary,size:ke.S,label:"Save Changes",leftIcon:il,loading:v,onClick:()=>R(!0)}},{id:Si(),type:bn.Button,buttonProps:{"data-id":"settings-cancel",variant:Ie.Secondary,size:ke.S,label:"Cancel",leftIcon:ol,onClick:()=>w(void 0,void 0,C)}}],[v,k,C,x,w]),L=o(()=>N.map(e=>({id:e.name,label:e.displayName})),[N]),F=o(()=>N.map(e=>e.name),[N]),{selectedSection:M,setSelectedSection:z,setSectionRef:X,setScrollContainerRef:B}=Xa({sectionNames:F});return t(Ko,{$gap:24,children:e(sv,{children:[t(av,{disabled:!r,loading:h||g,onClickShowYaml:()=>P(!0),onClickReset:async()=>{await(async()=>{p.resetLocalUiConfigToDefaults&&await p.resetLocalUiConfigToDefaults()})(),await(f?.()),w(void 0,void 0,{})},onClickRefresh:f?()=>f():void 0}),e(Ta,{children:[!r&&t(vr,{minSupportedVersion:d,currentVersion:s||""}),t(jn,{isOpen:I,richTitle:{icon:bl,title:"Config Settings"},actions:_}),t(tt,{isOpen:A,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:()=>R(!1),denyButton:{label:"Keep editing",variant:Ie.Secondary,onClick:()=>R(!1)},approveButton:{label:"Save changes",variant:Ie.Primary,onClick:()=>{(async()=>{const e=((e,t)=>{const n=(e,t,n)=>{for(let n=0;n<t.length-1;n++){const i=t[n];i in e&&"object"==typeof e[i]&&null!==e[i]||(e[i]={}),e=e[i]}e[t[t.length-1]]=n},i=JSON.parse(JSON.stringify(e));for(const e of t){const t=e.split(".");let o=i;for(const e of t){if(null==o||"object"!=typeof o){o=void 0;break}o=o[e]}"string"==typeof o&&n(i,t,o.replaceAll("-","_"))}return i})(k(C,x),O);await(async e=>{p.updateLocalUiConfig&&(y(!0),await p.updateLocalUiConfig(e),y(!1),await f())})(e),w(void 0,void 0,{})})(),R(!1)}}}),e(cv,{$gap:24,$alignItems:"stretch",children:[!!b.length&&t(rv,{options:L,selected:M,setSelected:z,disabled:!r}),t(dv,{ref:B,$gap:24,$width:"100%",children:b.length?N.map(i=>t(ut,{id:i.name,bordered:!0,ref:e=>X(i.name,e),customTitle:t(ee,{size:te.M,weight:500,color:ne.Primary,children:i.displayName}),children:t(ae,{$gap:24,children:i.fields.map(i=>{if(i.isEnterpriseOnly&&!c)return null;if(i.renderCondition&&!Qt(i.renderCondition,[],$))return null;const o=kt(i.componentProps||"{}",{}),a=E[i.helmValuePath],l=i.componentType===jt.Toggle,r=t(ee,{size:te.XS,weight:500,color:ne.Primary,children:i.displayName}),s=(e=>{if(e)return"odigos-local-ui-config"===e?{status:Pe.Warning,label:"Edited in UI",tooltip:`Reconciled from ${e}`}:"odigos-configuration"===e?{status:Pe.Unknown,useSecondaryTone:!0,label:"Cluster config",tooltip:`Reconciled from ${e}`}:{status:Pe.Unknown,useSecondaryTone:!0,label:e,tooltip:`Reconciled from ${e}`}})(a),d=s?t(ce,{...s}):null,p=i.description?t(ee,{size:te.XXS,color:ne.Secondary,children:i.description}):null,u=e(ae,{$gap:4,children:[e(ie,{$gap:8,$alignItems:"center",children:[r,d]}),p]}),h=t(yr,{componentType:i.componentType,inputType:o.type,name:i.helmValuePath,disabled:i.isHelmOnly||v,value:T("formData",i.helmValuePath),setValue:e=>w(i.helmValuePath,e),dropdownOptions:o.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0,toggleSize:Et.S},i.helmValuePath),m=i.isHelmOnly?t(Be,{text:"This field can only be updated via the Helm values.yaml file",children:t(Yl,{})}):null;return t(ae,{$gap:8,children:l?e(ie,{$gap:12,$justifyContent:"space-between",$alignItems:"flex-start",children:[u,e(ie,{$gap:8,$alignItems:"center",children:[m,h]})]}):e(n,{children:[u,e(pv,{children:[t(uv,{children:h}),m]})]})},i.helmValuePath)})})},i.name)):h?t(ft,{$height:"30vh",children:t(St,{withSpinner:!0})}):t(ut,{richTitle:{icon:bl,title:"Config Settings"},children:t($e,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})]}),t(Xt,{isOpen:D,width:"40vw",minWidth:"480px",header:{icon:Wl,title:"Effective Config YAML",onClose:()=>P(!1)},children:g&&!m?.manifestYAML?t(ft,{$height:"30vh",children:t(St,{withSpinner:!0})}):t(gr,{yaml:m?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0,fullHeight:!0})})]})]})})},gv=b.div`
1560
+ `,yy=e=>"general"===e.name?0:"advanced"===e.name?2:1,Cy=({minSupportedVersion:i})=>{const{isVersionSupported:r,version:s,isEnterprise:c,minSupportedVersion:d}=S(i),{configApi:p}=qr(),{data:u,loading:h}=p.useConfigYamls(),{data:m,loading:g,refetch:f}=p.useEffectiveConfig(),b=u?.configYamls??[],[v,y]=l(!1),C=o(()=>{if(!m)return{};const{manifestYAML:e,provenance:t,...n}=m;return n},[m]),{formData:x,handleFormChange:w,getNestedValue:T,getFormDiff:k,isFormDirty:I}=qt(C);a(()=>{"{}"!==JSON.stringify(C)&&"{}"===JSON.stringify(x)&&w(void 0,void 0,C)},[C,x]);const N=o(()=>[...b].sort((e,t)=>yy(e)-yy(t)),[b]),E=o(()=>(e=>{if(!e)return{};const t={};for(const n of e)t[n.helmPath]=n.reconciledFrom;return t})(m?.provenance),[m?.provenance]),$=o(()=>{const e=new Set;for(const t of b)for(const n of t.fields)n.componentType===jt.Dropdown&&e.add(n.helmValuePath);return e},[b]),O=o(()=>b.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:T("formData",e.helmValuePath)}))),[b,x,T]),[A,R]=l(!1),[D,P]=l(!1),_=o(()=>[{id:Gi(),type:bn.Button,buttonProps:{"data-id":"settings-save",variant:Ie.Primary,size:ke.S,label:"Save Changes",leftIcon:El,loading:v,onClick:()=>R(!0)}},{id:Gi(),type:bn.Button,buttonProps:{"data-id":"settings-cancel",variant:Ie.Secondary,size:ke.S,label:"Cancel",leftIcon:$l,onClick:()=>w(void 0,void 0,C)}}],[v,k,C,x,w]),L=o(()=>N.map(e=>({id:e.name,label:e.displayName})),[N]),F=o(()=>N.map(e=>e.name),[N]),{selectedSection:z,setSelectedSection:M,setSectionRef:X,setScrollContainerRef:B}=pl({sectionNames:F});return t(ya,{$gap:24,children:e(my,{children:[t(py,{disabled:!r,loading:h||g,onClickShowYaml:()=>P(!0),onClickReset:async()=>{await(async()=>{p.resetLocalUiConfigToDefaults&&await p.resetLocalUiConfigToDefaults()})(),await(f?.()),w(void 0,void 0,{})},onClickRefresh:f?()=>f():void 0}),e(Ya,{children:[!r&&t(Kr,{minSupportedVersion:d,currentVersion:s||""}),t(jn,{isOpen:I,richTitle:{icon:Ul,title:"Config Settings"},actions:_}),t(tt,{isOpen:A,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:()=>R(!1),denyButton:{label:"Keep editing",variant:Ie.Secondary,onClick:()=>R(!1)},approveButton:{label:"Save changes",variant:Ie.Primary,onClick:()=>{(async()=>{const e=((e,t)=>{const n=(e,t,n)=>{for(let n=0;n<t.length-1;n++){const i=t[n];i in e&&"object"==typeof e[i]&&null!==e[i]||(e[i]={}),e=e[i]}e[t[t.length-1]]=n},i=JSON.parse(JSON.stringify(e));for(const e of t){const t=e.split(".");let o=i;for(const e of t){if(null==o||"object"!=typeof o){o=void 0;break}o=o[e]}"string"==typeof o&&n(i,t,o.replaceAll("-","_"))}return i})(k(C,x),$);await(async e=>{p.updateLocalUiConfig&&(y(!0),await p.updateLocalUiConfig(e),y(!1),await f())})(e),w(void 0,void 0,{})})(),R(!1)}}}),e(gy,{$gap:24,$alignItems:"stretch",children:[!!b.length&&t(hy,{options:L,selected:z,setSelected:M,disabled:!r}),t(fy,{ref:B,$gap:24,$width:"100%",children:b.length?N.map(i=>t(ut,{id:i.name,bordered:!0,ref:e=>X(i.name,e),customTitle:t(ee,{size:te.M,weight:500,color:ne.Primary,children:i.displayName}),children:t(ae,{$gap:24,children:i.fields.map(i=>{if(i.isEnterpriseOnly&&!c)return null;if(i.renderCondition&&!Qt(i.renderCondition,[],O))return null;const o=kt(i.componentProps||"{}",{}),a=E[i.helmValuePath],l=i.componentType===jt.Toggle,r=t(ee,{size:te.XS,weight:500,color:ne.Primary,children:i.displayName}),s=(e=>{if(e)return"odigos-local-ui-config"===e?{status:Pe.Warning,label:"Edited in UI",tooltip:`Reconciled from ${e}`}:"odigos-configuration"===e?{status:Pe.Unknown,useSecondaryTone:!0,label:"Cluster config",tooltip:`Reconciled from ${e}`}:{status:Pe.Unknown,useSecondaryTone:!0,label:e,tooltip:`Reconciled from ${e}`}})(a),d=s?t(ce,{...s}):null,p=i.description?t(ee,{size:te.XXS,color:ne.Secondary,children:i.description}):null,u=e(ae,{$gap:4,children:[e(ie,{$gap:8,$alignItems:"center",children:[r,d]}),p]}),h=t(Yr,{componentType:i.componentType,inputType:o.type,name:i.helmValuePath,disabled:i.isHelmOnly||v,value:T("formData",i.helmValuePath),setValue:e=>w(i.helmValuePath,e),dropdownOptions:o.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0,toggleSize:Et.S},i.helmValuePath),m=i.isHelmOnly?t(Be,{text:"This field can only be updated via the Helm values.yaml file",children:t(Tr,{})}):null;return t(ae,{$gap:8,children:l?e(ie,{$gap:12,$justifyContent:"space-between",$alignItems:"flex-start",children:[u,e(ie,{$gap:8,$alignItems:"center",children:[m,h]})]}):e(n,{children:[u,e(by,{children:[t(vy,{children:h}),m]})]})},i.helmValuePath)})})},i.name)):h?t(ft,{$height:"30vh",children:t(St,{withSpinner:!0})}):t(ut,{richTitle:{icon:Ul,title:"Config Settings"},children:t(Oe,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})]}),t(Xt,{isOpen:D,width:"40vw",minWidth:"480px",header:{icon:xr,title:"Effective Config YAML",onClose:()=>P(!1)},children:g&&!m?.manifestYAML?t(ft,{$height:"30vh",children:t(St,{withSpinner:!0})}):t(Hr,{yaml:m?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0,fullHeight:!0})})]})]})})},Sy=b.div`
1493
1561
  position: fixed;
1494
1562
  bottom: 12px;
1495
1563
  left: 12px;
@@ -1498,4 +1566,4 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i,{useMem
1498
1566
  flex-direction: column-reverse;
1499
1567
  gap: 6px;
1500
1568
  max-width: 600px;
1501
- `,fv=()=>{const{notifications:e,markAsDismissed:n,markAsSeen:i}=nn(),o=e.filter(({dismissed:e})=>!e);return t(gv,{children:o.map(({id:e,type:a,title:l,message:r},s)=>{const c=r||l;if(!c)return null;const d=o.length-s;return t(De,{status:a,message:c,onClose:({asSeen:t})=>(({id:e,asSeen:t})=>{n(e),t&&i(e)})({id:e,asSeen:t}),zIndex:d},`toast-${e}`)})})};export{ic as AddActionDrawer,Ps as AddActionForm,vm as AddDataStreamModal,hc as AddDestinationDrawer,Ls as AddDestinationForm,mc as AddRuleDrawer,Hs as AddRuleForm,$c as AddSourceDrawer,kg as CentralConnections,hp as CloudConnectorStep,fp as CreateCloudConnectorDrawer,vg as CreateNewType,Gs as DataStreamForm,js as DataStreamMergeWarning,Cp as EditActionDrawer,Sp as EditConfigDrawer,ym as EditDataStreamModal,wp as EditDestinationDrawer,kp as EditRuleDrawer,Jh as EditSourceDrawer,Ws as EditSourceForm,zg as Onboarding,xm as OnboardingDone,Gf as Overview,ab as PipelineCollectors,Jl as RegexTesterDrawer,fg as SamplingOnboardingModal,sm as SamplingRuleDrawer,Qs as SamplingRuleForm,ub as SamplingRules,tv as ServiceMap,mv as Settings,bm as SystemDrawer,ob as TABS,fv as ToastList};
1569
+ `,xy=()=>{const{notifications:e,markAsDismissed:n,markAsSeen:i}=nn(),o=e.filter(({dismissed:e})=>!e);return t(Sy,{children:o.map(({id:e,type:a,title:l,message:r},s)=>{const c=r||l;if(!c)return null;const d=o.length-s;return t(De,{status:a,message:c,onClose:({asSeen:t})=>(({id:e,asSeen:t})=>{n(e),t&&i(e)})({id:e,asSeen:t}),zIndex:d},`toast-${e}`)})})};export{Dc as AddActionDrawer,dc as AddActionForm,kg as AddDataStreamModal,Vc as AddDestinationDrawer,uc as AddDestinationForm,Hc as AddRuleDrawer,Cc as AddRuleForm,ld as AddSourceDrawer,Df as CentralConnections,jp as CloudConnectorStep,Kp as CreateCloudConnectorDrawer,If as CreateNewType,xc as DataStreamForm,Sc as DataStreamMergeWarning,Zp as EditActionDrawer,Qp as EditConfigDrawer,Ig as EditDataStreamModal,tu as EditDestinationDrawer,iu as EditRuleDrawer,$m as EditSourceDrawer,wc as EditSourceForm,Wf as Onboarding,$g as OnboardingDone,Zb as Overview,pv as PipelineCollectors,ig as RecommendationsDrawer,kr as RegexTesterDrawer,Xm as SECTION_ORDER,Tf as SamplingOnboardingModal,gg as SamplingRuleDrawer,$c as SamplingRuleForm,vv as SamplingRules,ry as ServiceMap,Cy as Settings,Tg as SystemDrawer,dv as TABS,xy as ToastList,Mm as countRecommended,Fm as getRecommendationState,zm as groupRecommendations};