@odigos/ui-kit 0.0.271 → 0.0.273

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.
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 o,{useEffect as i,useState as a,Fragment as l,forwardRef as r,useImperativeHandle as s,useMemo 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 _,S as P,s as L,R as F,t as M,w as z,o as B,x as X,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-pQ9OGZgF.js";import{bn as Q,F as ee,d as te,C as ne,k as oe,I as ie,bx as ae,o as le,p as re,w as se,Y as ce,by as de,h as pe,bz as ue,ar as he,bA as me,bB as ge,B as fe,i as be,j as ve,x as ye,a4 as Ce,bo as Se,b0 as xe,bC as we,g as Te,bD as ke,u as Ie,N as Ne,S as Ee,bE as Oe,bt as $e,bu as Ae,bs as Re,bF as De,e as _e,f as Pe,af as Le,T as Fe,ad as Me,ae as ze,ab as Be,aa as Xe,ac as Ue,a9 as Ve,b7 as He,a8 as je,bG as Ge,bH as We,bI as Ke,bJ as Ye,bK as Je,W as qe,m as Ze,bb as Qe,bL as et,bM as tt,bN as nt,bO as ot,bP as it,bQ as at,bR as lt,bS as rt,Q as st,bT as ct,bU as dt,bV as pt,bW as ut,bX as ht,a$ as mt,br as gt,s as ft,bY as bt,bZ as vt,b1 as yt,b_ as Ct,b$ as St,aY as xt,v as wt,bv as Tt,ba as kt,b as It,q as Nt,c0 as Et,bc as Ot,c1 as $t,c2 as At,be as Rt,c3 as Dt,b3 as _t,c4 as Pt,l as Lt,y as Ft,D as Mt,c5 as zt,n as Bt,bh as Xt,bm as Ut,z as Vt,c6 as Ht,c7 as jt,bl as Gt,c8 as Wt,a3 as Kt,c9 as Yt,ca as Jt,b6 as qt,H as Zt,cb as Qt,cc as en,cd as tn,ce as nn,ag as on,cf as an,cg as ln,ch as rn,ci as sn,cj as cn,O as dn,ck as pn,cl as un,A as hn,b2 as mn,a_ as gn,cm as fn,cn as bn,co as vn,cp as yn,cq as Cn,cr as Sn,bw as xn,cs as wn,ct as Tn,cu as kn,cv as In,cw as Nn,cx as En,cy as On,cz as $n,cA as An,cB as Rn,M as Dn,cC as _n,cD as Pn,cE as Ln,cF as Fn,cG as Mn,cH as zn,cI as Bn,cJ as Xn,cK as Un,cL as Vn,cM as Hn,cN as jn,cO as Gn,aO as Wn,cP as Kn,cQ as Yn,cR as Jn,cS as qn,cT as Zn,cU as Qn,cV as eo,cW as to,cX as no,cY as oo,cZ as io,c_ as ao,c$ as lo,d0 as ro,d1 as so,ax as co,d2 as po,d3 as uo,b4 as ho,d4 as mo,d5 as go,d6 as fo,d7 as bo,d8 as vo,d9 as yo,da as Co,db as So,dc as xo,dd as wo,de as To,df as ko,dg as Io,dh as No,di as Eo,dj as Oo,dk as $o,dl as Ao,dm as Ro,dn as Do,dp as _o,dq as Po,dr as Lo,ds as Fo,dt as Mo,du as zo,dv as Bo,dw as Xo,dx as Uo,dy as Vo,dz as Ho,dA as jo,dB as Go,dC as Wo,dD as Ko,dE as Yo,dF as Jo,dG as qo,dH as Zo,dI as Qo,dJ as ei,dK as ti,dL as ni,dM as oi,dN as ii,dO as ai,dP as li,dQ as ri,dR as si,dS as ci,dT as di,dU as pi,dV as ui,dW as hi,dX as mi,dY as gi,dZ as fi,d_ as bi,d$ as vi,e0 as yi,e1 as Ci,e2 as Si,e3 as xi,e4 as wi,e5 as Ti,e6 as ki,e7 as Ii,e8 as Ni,e9 as Ei,ea as Oi,eb as $i,ec as Ai,ed as Ri,ee as Di,ef as _i,eg as Pi,eh as Li,P as Fi,ei as Mi,ej as zi,ek as Bi,el as Xi,em as Ui,en as Vi,eo as Hi,aZ as ji,ep as Gi,$ as Wi,eq as Ki,er as Yi,es as Ji,et as qi,eu as Zi,ev as Qi,ew as ea,ex as ta,ey as na,ez as oa,eA as ia,bd as aa,eB as la,R as ra,a as sa,eC as ca,eD as da,eE as pa,eF as ua,eG as ha,eH as ma,eI as ga,eJ as fa,eK as ba,eL 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}from"./chunks/ui-components-BzgG1abD.js";import{TrashIcon as Aa,PlusIcon as Ra,ArrowRightIcon as Da,VSquareIcon as _a,XSquareIcon as Pa,BookIcon as La,DeleteIcon as Fa,EditIcon as Ma,GoLogo as za,JavaLogo as Ba,PhpLogo as Xa,ChevronRightIcon as Ua,ActionIcon as Va,DestinationIcon as Ha,ChevronUpIcon as ja,ChevronDownIcon as Ga,VIcon as Wa,XIcon as Ka,InstrumentationRuleIcon as Ya,SourceIcon as Ja,NamespacesIcon as qa,AzureIcon as Za,GoogleCloudPlatformLogo as Qa,AwsLogo as el,CloudConnectorIcon as tl,EyeOpenIcon as nl,CloudConnectorPolicyIcon as ol,ArrowLeftIcon as il,ISquareIcon as al,RefreshIcon as ll,SettingsIcon as rl,PodIcon as sl,OdigosLogo as cl,K8sLogo as dl,ExclamationCircleIcon as pl,QuestionCircleIcon as ul,InboundIcon as hl,OutboundIcon as ml,UserIcon as gl,TerminalIcon as fl,RefreshLeftArrowIcon as bl,MinusIcon as vl,SearchIcon as yl,ExpandIcon as Cl,CopyIcon as Sl,DotIcon as xl,ArrowDownIcon as wl,DownloadIcon as Tl,VmLogo as kl,SamplingIcon as Il,ExclamationTriangleIcon as Nl,KeyIcon as El,DiagnoseIcon as Ol,StarIcon as $l,ArrowIcon as Al,ConnectionsIcon as Rl,FilterIcon as Dl,DataStreamIcon as _l,PipelineCollectorIcon as Pl,ArrowDownSquareIcon as Ll,ArrowUpSquareIcon as Fl,GatewayIcon as Ml,YamlIcon as zl,ImageErrorIcon as Bl,LockIcon as Xl}from"./icons.js";import{h as Ul,o as Vl,n as Hl,q as jl,m as Gl,t as Wl,s as Kl,S as Yl,w as Jl,E as ql,x as Zl,y as Ql,v as er,l as tr,d as nr,O as or,f as ir,b as ar,A as lr,R as rr,C as sr,e as cr,D as dr}from"./chunks/source-instrument-form-context-DB1VZT-P.js";import{n as pr,f as ur,k as hr,I as mr,l as gr,A as fr,i as br,P as vr,S as yr,R as Cr,g as Sr,j as xr,c as wr,h as Tr,m as kr,W as Ir,C as Nr,b as Er,Y as Or,O as $r,a as Ar,U as Rr,e as Dr}from"./chunks/index-BD_WHo50.js";import{createPortal as _r}from"react-dom";import{MarkerType as Pr,useNodesState as Lr,useEdgesState as Fr,Handle as Mr,Position as zr,getSmoothStepPath as Br,BaseEdge as Xr,EdgeLabelRenderer as Ur,ReactFlowProvider as Vr,ReactFlow as Hr,Background as jr,Controls as Gr,ControlButton as Wr,useReactFlow as Kr}from"@xyflow/react";import Yr 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 Jr=[{id:"CREDIT_CARD",label:"Credit card"}],qr=[{id:Q.CollectContainerAttributes,label:"Collect container attributes"},{id:Q.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:Q.CollectWorkloadId,label:"Collect workload ID"},{id:Q.CollectClusterId,label:"Collect cluster ID"}],Zr=[{id:ae.Pod,label:ae.Pod},{id:ae.Namespace,label:ae.Namespace},{id:ae.Node,label:ae.Node}],Qr=[{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:Zr}],es=[{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:Zr}],ts=Q.ExtractAttribute;var ns;(e=>{e.Preset="preset",e.Regex="regex"})(ns||(ns={}));const os=[ue.JSON,ue.SQL,ue.ResourcePath],is=(e=ue.JSON)=>({targetAttributeName:"",lookupKey:"",dataFormat:e,regex:""}),as=e=>!!e.regex&&!e.lookupKey&&!e.dataFormat,ls=b.div`
1
+ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEffect as i,useState as a,Fragment as l,forwardRef as r,useImperativeHandle as s,useMemo 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 _,S as P,s as L,R as F,t as M,w as z,o as B,x as X,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-B3Ne2tBs.js";import{bn as Q,F as ee,d as te,C as ne,k as oe,I as ie,bx as ae,o as le,p as re,w as se,Y as ce,by as de,h as pe,bz as ue,ar as he,bA as me,bB as ge,B as fe,i as be,j as ve,x as ye,a4 as Ce,bo as Se,b0 as xe,bC as we,g as Te,bD as ke,u as Ie,N as Ne,S as Ee,bE as Oe,bt as $e,bu as Ae,bs as Re,bF as De,e as _e,f as Pe,af as Le,T as Fe,ad as Me,ae as ze,ab as Be,aa as Xe,ac as Ue,a9 as Ve,b7 as He,a8 as je,bG as Ge,bH as We,bI as Ke,bJ as Ye,bK as Je,W as qe,m as Ze,bb as Qe,bL as et,bM as tt,bN as nt,bO as ot,bP as it,bQ as at,bR as lt,bS as rt,Q as st,bT as ct,bU as dt,bV as pt,bW as ut,bX as ht,a$ as mt,br as gt,s as ft,bY as bt,bZ as vt,b1 as yt,b_ as Ct,b$ as St,aY as xt,v as wt,bv as Tt,ba as kt,b as It,q as Nt,c0 as Et,bc as Ot,c1 as $t,c2 as At,be as Rt,c3 as Dt,b3 as _t,c4 as Pt,l as Lt,y as Ft,D as Mt,c5 as zt,ag as Bt,c6 as Xt,c7 as Ut,n as Vt,bh as Ht,bm as jt,z as Gt,c8 as Wt,c9 as Kt,bl as Yt,ca as Jt,a3 as qt,cb as Zt,cc as Qt,b6 as en,H as tn,cd as nn,ce as on,cf as an,cg as ln,ch as rn,ci as sn,cj as cn,ck as dn,O as pn,cl as un,cm as hn,A as mn,b2 as gn,a_ as fn,cn as bn,co as vn,cp as yn,cq as Cn,cr as Sn,cs as xn,bw as wn,ct as Tn,cu as kn,cv as In,cw as Nn,cx as En,cy as On,cz as $n,cA as An,cB as Rn,cC as Dn,M as _n,cD as Pn,cE as Ln,cF as Fn,cG as Mn,cH as zn,cI as Bn,cJ as Xn,cK as Un,cL as Vn,cM as Hn,cN as jn,cO as Gn,cP as Wn,aO as Kn,cQ as Yn,cR as Jn,cS as qn,cT as Zn,cU as Qn,cV as eo,cW as to,cX as no,cY as oo,cZ as io,c_ as ao,c$ as lo,d0 as ro,d1 as so,d2 as co,ax as po,d3 as uo,d4 as ho,b4 as mo,d5 as go,d6 as fo,d7 as bo,d8 as vo,d9 as yo,da as Co,db as So,dc as xo,dd as wo,de as To,df as ko,dg as Io,dh as No,di as Eo,dj as Oo,dk as $o,dl as Ao,dm as Ro,dn as Do,dp as _o,dq as Po,dr as Lo,ds as Fo,dt as Mo,du as zo,dv as Bo,dw as Xo,dx as Uo,dy as Vo,dz as Ho,dA as jo,dB as Go,dC as Wo,dD as Ko,dE as Yo,dF as Jo,dG as qo,dH as Zo,dI as Qo,dJ as ei,dK as ti,dL as ni,dM as oi,dN as ii,dO as ai,dP as li,dQ as ri,dR as si,dS as ci,dT as di,dU as pi,dV as ui,dW as hi,dX as mi,dY as gi,dZ as fi,d_ as bi,d$ as vi,e0 as yi,e1 as Ci,e2 as Si,e3 as xi,e4 as wi,e5 as Ti,e6 as ki,e7 as Ii,e8 as Ni,e9 as Ei,ea as Oi,eb as $i,ec as Ai,ed as Ri,ee as Di,ef as _i,eg as Pi,eh as Li,ei as Fi,P as Mi,ej as zi,ek as Bi,el as Xi,em as Ui,en as Vi,eo as Hi,ep as ji,aZ as Gi,eq as Wi,$ as Ki,er as Yi,es as Ji,et as qi,eu as Zi,ev as Qi,ew as ea,ex as ta,ey as na,ez as oa,eA as ia,eB as aa,eC as la,bd as ra,eD as sa,R as ca,a as da,eE as pa,eF as ua,eG as ha,eH as ma,eI as ga,eJ as fa,eK as ba,eL 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}from"./chunks/ui-components-Cz05Wzh4.js";import{TrashIcon as Da,PlusIcon as _a,ArrowRightIcon as Pa,VSquareIcon as La,XSquareIcon as Fa,BookIcon as Ma,DeleteIcon as za,EditIcon as Ba,GoLogo as Xa,JavaLogo as Ua,PhpLogo as Va,ChevronRightIcon as Ha,ActionIcon as ja,DestinationIcon as Ga,ChevronUpIcon as Wa,ChevronDownIcon as Ka,VIcon as Ya,XIcon as Ja,InstrumentationRuleIcon as qa,SourceIcon as Za,NamespacesIcon as Qa,AzureIcon as el,GoogleCloudPlatformLogo as tl,AwsLogo as nl,CloudConnectorIcon as ol,EyeOpenIcon as il,CloudConnectorPolicyIcon as al,ArrowLeftIcon as ll,ISquareIcon as rl,RefreshIcon as sl,SettingsIcon as cl,PodIcon as dl,OdigosLogo as pl,K8sLogo as ul,ExclamationCircleIcon as hl,QuestionCircleIcon as ml,InboundIcon as gl,OutboundIcon as fl,UserIcon as bl,TerminalIcon as vl,RefreshLeftArrowIcon as yl,MinusIcon as Cl,SearchIcon as Sl,ExpandIcon as xl,CopyIcon as wl,DotIcon as Tl,ArrowDownIcon as kl,DownloadIcon as Il,VmLogo as Nl,SamplingIcon as El,ExclamationTriangleIcon as Ol,KeyIcon as $l,DiagnoseIcon as Al,StarIcon as Rl,ArrowIcon as Dl,ConnectionsIcon as _l,FilterIcon as Pl,DataStreamIcon as Ll,PipelineCollectorIcon as Fl,ArrowDownSquareIcon as Ml,ArrowUpSquareIcon as zl,GatewayIcon as Bl,YamlIcon as Xl,ImageErrorIcon as Ul,LockIcon as Vl}from"./icons.js";import{h as Hl,o as jl,n as Gl,q as Wl,m as Kl,t as Yl,s as Jl,S as ql,w as Zl,E as Ql,x as er,y as tr,v as nr,l as or,d as ir,O as ar,f as lr,b as rr,A as sr,R as cr,C as dr,e as pr,D as ur}from"./chunks/source-instrument-form-context-DsVdhWzt.js";import{n as hr,f as mr,k as gr,I as fr,l as br,A as vr,i as yr,P as Cr,S as Sr,R as xr,g as wr,j as Tr,c as kr,h as Ir,m as Nr,W as Er,C as Or,b as $r,Y as Ar,O as Rr,a as Dr,U as _r,e as Pr}from"./chunks/index-C18_FX5i.js";import{createPortal as Lr}from"react-dom";import{MarkerType as Fr,useNodesState as Mr,useEdgesState as zr,Handle as Br,Position as Xr,getSmoothStepPath as Ur,BaseEdge as Vr,EdgeLabelRenderer as Hr,ReactFlowProvider as jr,ReactFlow as Gr,Background as Wr,Controls as Kr,ControlButton as Yr,useReactFlow as Jr}from"@xyflow/react";import qr 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 Zr=[{id:"CREDIT_CARD",label:"Credit card"}],Qr=[{id:Q.CollectContainerAttributes,label:"Collect container attributes"},{id:Q.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:Q.CollectWorkloadId,label:"Collect workload ID"},{id:Q.CollectClusterId,label:"Collect cluster ID"}],es=[{id:ae.Pod,label:ae.Pod},{id:ae.Namespace,label:ae.Namespace},{id:ae.Node,label:ae.Node}],ts=[{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:es}],ns=[{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:es}],os=Q.ExtractAttribute;var is;(e=>{e.Preset="preset",e.Regex="regex"})(is||(is={}));const as=[ue.JSON,ue.SQL,ue.ResourcePath],ls=(e=ue.JSON)=>({targetAttributeName:"",lookupKey:"",dataFormat:e,regex:""}),rs=e=>!!e.regex&&!e.lookupKey&&!e.dataFormat,ss=b.div`
2
2
  width: 100%;
3
3
  background: ${({theme:e})=>e.v2.colors.silver[800]};
4
4
  border-radius: 8px;
@@ -6,13 +6,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
6
6
  display: flex;
7
7
  flex-direction: column;
8
8
  gap: 8px;
9
- `,rs=b.div`
9
+ `,cs=b.div`
10
10
  flex: 1;
11
11
  min-width: 0;
12
- `,ss=b.div`
12
+ `,ds=b.div`
13
13
  /* Pushes the arrow down to sit next to the inputs rather than the field titles. */
14
14
  padding-top: 24px;
15
- `,cs=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),ds=e=>{const t={};return e.forEach(({oldKey:e,newKey:n})=>{t[e]=n}),t},ps=Q.UrlTemplatizationRulesGroups,us=[{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"}],hs={[Se.K8sAttributes]:({value:o,setValue:a,formErrors:l})=>(i(()=>{o[Q.CollectContainerAttributes]||o[Q.CollectReplicaSetAttributes]||o[Q.CollectWorkloadId]||o[Q.CollectClusterId]||o[Q.LabelsAttributes]?.length||o[Q.AnnotationsAttributes]?.length||(a(Q.CollectContainerAttributes,!0),a(Q.CollectReplicaSetAttributes,!0),a(Q.CollectWorkloadId,!0),a(Q.CollectClusterId,!0),a(Q.LabelsAttributes,[]),a(Q.AnnotationsAttributes,[]))},[]),e(n,{children:[t(ee,{$gap:6,children:qr.map(({id:n,label:i})=>e(ee,{children:[t(ne,{label:i,value:o[n]||!1,onChange:e=>a(n,e)}),t(oe,{errorMessage:l[n]})]},n))}),t(ie,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:Qr,values:o[Q.LabelsAttributes]||[],setValues:e=>a(Q.LabelsAttributes,e),errorMessage:l[Q.LabelsAttributes]}),t(ie,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:es,values:o[Q.AnnotationsAttributes]||[],setValues:e=>a(Q.AnnotationsAttributes,e),errorMessage:l[Q.AnnotationsAttributes]})]})),[Se.AddClusterInfo]:({value:o,setValue:i,formErrors:a})=>{const l=v();return e(n,{children:[t(le,{label:"Overwrite existing values",labelAlign:re.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:o[Q.OverwriteExistingValues]||!1,onChange:e=>i(Q.OverwriteExistingValues,e)}),t(ie,{name:"clusterAttributes",label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name",placeholder:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value",placeholder:"Attribute value"}],values:o[Q.ClusterAttributes]||[],setValues:e=>i(Q.ClusterAttributes,e),errorMessage:a[Q.ClusterAttributes]})]})},[Se.DeleteAttributes]:({value:e,setValue:n,formErrors:o})=>t(se,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[Q.AttributeNamesToDelete]||[],setValues:e=>n(Q.AttributeNamesToDelete,e),errorMessage:o[Q.AttributeNamesToDelete]}),[Se.RenameAttributes]:({value:e,setValue:n,formErrors:o})=>{const l=e[Q.Renames],[r,s]=a(()=>cs(l));return i(()=>{((e,t)=>{const n=Object.keys(e),o=Object.keys(t);return n.length===o.length&&n.every(n=>Object.prototype.hasOwnProperty.call(t,n)&&t[n]===e[n])})(ds(r),l||{})||s(cs(l))},[l]),t(ie,{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(Q.Renames,ds(t))},errorMessage:o[Q.Renames]})},[Se.PiiMasking]:({value:n,setValue:o,formErrors:a})=>(i(()=>{n[Q.PiiCategories]?.length||o(Q.PiiCategories,Jr.map(({id:e})=>e))},[]),e(ee,{$gap:12,children:[t(te,{label:"Attributes to mask"}),t(ee,{$gap:6,children:Jr.map(({id:e,label:i})=>t(ne,{label:i,value:n[Q.PiiCategories]?.includes(e)||!1,onChange:t=>{const i=n[Q.PiiCategories]||[],a=t?[...i,e]:i.filter(t=>t!==e);o(Q.PiiCategories,a)}},e))}),t(oe,{errorMessage:a[Q.PiiCategories]})]})),[Se.URLTemplatization]:({value:o,setValue:i,formErrors:a})=>{const r=v(),s=o[ps]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>i(ps,e),d=(e,t)=>c(s.map((n,o)=>o===e?{...n,...t}:n));return e(n,{children:[s.map((n,o)=>e(l,{children:[t(Ce,{}),e(ee,{$gap:12,children:[e(pe,{$justifyContent:"space-between",$alignItems:"center",children:[t(te,{label:`Rule Group ${o+1}`}),t(fe,{leftIcon:()=>t(Aa,{fill:r.v2.colors.red[500]}),variant:ve.Secondary,size:be.S,onClick:()=>{return e=o,c(s.filter((t,n)=>n!==e));var e},disabled:1===s.length})]}),t(ye,{name:`urlGroup-${o}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:n.filterK8sNamespace||"",onChange:e=>d(o,{filterK8sNamespace:e.target.value})}),t(ie,{name:`urlGroup-${o}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:us,values:n.workloadFilters||[],setValues:e=>d(o,{workloadFilters:e})}),t(se,{name:`urlGroup-${o}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:n.templatizationRules.map(e=>e.template),setValues:e=>d(o,{templatizationRules:e.map(e=>({template:e}))})})]}),t(oe,{errorMessage:a[ps]})]},`url-templatization-group-${o}`)),t(fe,{variant:ve.Secondary,label:"Add rule group",leftIcon:Ra,onClick:()=>c([...s,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(Ce,{})]})},[Se.ExtractAttribute]:({value:n,setValue:o,formErrors:l})=>{const r=v(),s=l[ts],c=n[ts]?.extractions||[],[d,p]=a(()=>(e=>e.length&&e.some(as)?ns.Regex:ns.Preset)(c)),[u,h]=a(null),m=e=>o(ts,{extractions:e});i(()=>{0===c.length&&m([d===ns.Preset?is():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const g=(e,t)=>{m(c.map((n,o)=>o===e?{...n,...t}:n))},f=()=>{m([...c,d===ns.Preset?is():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},b=d===ns.Preset,y=c.length?c:[b?is():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=u&&y[u]?.regex||"";return e(ee,{$gap:16,$width:"100%",children:[t(ce,{options:[{value:ns.Preset,label:de.SEGMENT_PRESET_LABEL,tooltip:de.SEGMENT_PRESET_TOOLTIP,selectedBgColor:r.v2.colors.purple[500]},{value:ns.Regex,label:de.SEGMENT_REGEX_LABEL,tooltip:de.SEGMENT_REGEX_TOOLTIP,selectedBgColor:r.v2.colors.purple[500]}],selected:d,setSelected:e=>{p(e),m([e===ns.Preset?is():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(ee,{$gap:8,$width:"100%",children:[y.map((n,o)=>{const i=o===y.length-1,a=n.dataFormat||ue.JSON,l=me[a];return e(ls,{"data-id":`extract-row-${o}`,children:[e(pe,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(ee,{$gap:10,children:[t(te,{label:b?de.PRESET_ROW_TITLE(o):de.REGEX_ROW_TITLE(o)}),b&&t(pe,{$gap:24,children:os.map(e=>t(he,{"data-id":`extract-row-${o}-fmt-${e}`,size:ge.L,label:me[e].label,value:a===e,onChange:t=>t&&g(o,{dataFormat:e})},`extract-row-${o}-fmt-${e}`))})]}),e(pe,{$gap:4,$alignItems:"center",children:[!b&&t(fe,{"data-id":`extract-row-${o}-test-regex`,label:de.TEST_REGEX_LABEL,variant:ve.Secondary,size:be.S,onClick:()=>h(o),disabled:!n.regex?.trim()}),t(fe,{"data-id":`extract-row-${o}-delete`,leftIcon:()=>t(Aa,{fill:r.v2.colors.red[500]}),variant:ve.Secondary,size:be.S,onClick:()=>(e=>{const t=c.filter((t,n)=>n!==e);m(t.length?t:[d===ns.Preset?is():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(o)}),i&&t(fe,{"data-id":`extract-row-${o}-add`,leftIcon:Ra,variant:ve.Secondary,size:be.S,onClick:f})]})]}),b?e(pe,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(rs,{children:t(ye,{name:`extract-row-${o}-lookupKey`,label:l.keyLabel,placeholder:l.placeholder,helpMessage:l.helpMessage,width:"100%",value:n.lookupKey||"",onChange:e=>g(o,{lookupKey:e.target.value})})}),t(ss,{children:t(Da,{size:24,fill:r.v2.colors.silver[200]})}),t(rs,{children:t(ye,{name:`extract-row-${o}-targetAttributeName`,label:de.TARGET_LABEL,placeholder:de.TARGET_PLACEHOLDER,helpMessage:de.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(o,{targetAttributeName:e.target.value})})})]}):e(ee,{$gap:12,$width:"100%",children:[t(ye,{name:`extract-row-${o}-regex`,label:de.REGEX_LABEL,placeholder:de.REGEX_PLACEHOLDER,helpMessage:de.REGEX_HELP,width:"100%",value:n.regex||"",onChange:e=>g(o,{regex:e.target.value})}),t(ye,{name:`extract-row-${o}-targetAttributeName`,label:de.TARGET_LABEL,placeholder:de.TARGET_PLACEHOLDER,helpMessage:de.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(o,{targetAttributeName:e.target.value})})]})]},`extract-row-${o}`)}),t(oe,{errorMessage:s})]}),t(pr,{isOpen:null!=u,regex:C,onClose:()=>h(null)})]})},[Se.DbQueryTemplatization]:null,[Se.InferDbAttributes]:null},ms=({actionType:e,value:n,setValue:o,formErrors:i,dynamicFields:a,signals:l,sourceOptions:r,namespaceOptions:s})=>{if(!e)return null;if(a?.length)return t(ur,{fields:a,value:n||{},setValue:o,formErrors:i||{},signals:l||[],seedInitialValues:!0,keyValuePersistAs:"map",sourceOptions:r,namespaceOptions:s},e);const c=hs[e];return c?t(c,{value:n,setValue:o,formErrors:i}):null},gs=()=>{const n=v(),{selectedOption:o,genericForm:i,sourceOptions:a,namespaceOptions:l}=Ul();if(!i||!o)return t(xe,{title:"No active form"});const{formData:r,handleFormChange:s,formErrors:c}=i;return e(ee,{$gap:24,children:[e(pe,{$gap:12,$justifyContent:"space-between",children:[t(we,{size:Te.XXXS,maxLines:2,children:o.description}),e(pe,{$gap:12,children:[t(ce,{options:[{icon:_a,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:Pa,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:ke.S,selected:r.disabled,setSelected:e=>s("disabled",e)}),t(fe,{leftIcon:La,variant:ve.Secondary,size:be.S,onClick:()=>o.docsUrl&&window.open(o.docsUrl,"_blank","noopener noreferrer")})]})]}),t(hr,{title:"Signals for processing",allowedSignals:o.allowedSignals,selectedSignals:r.signals||[],setSelectedSignals:e=>s("signals",e),errorMessage:c.signals}),t(ye,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:r.name||"",onChange:({target:{value:e}})=>s("name",e),errorMessage:c.name}),t(ms,{actionType:o.type,dynamicFields:o.fields,signals:r.signals||[],value:r.fields,setValue:(e,t)=>s(`fields.${e}`,t),formErrors:c,sourceOptions:a,namespaceOptions:l}),t(Ie,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:r.notes||"",onChange:({target:{value:e}})=>s("notes",e),errorMessage:c.notes})]})},fs=b(pe)`
15
+ `,ps=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),us=e=>{const t={};return e.forEach(({oldKey:e,newKey:n})=>{t[e]=n}),t},hs=Q.UrlTemplatizationRulesGroups,ms=[{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"}],gs={[Se.K8sAttributes]:({value:o,setValue:a,formErrors:l})=>(i(()=>{o[Q.CollectContainerAttributes]||o[Q.CollectReplicaSetAttributes]||o[Q.CollectWorkloadId]||o[Q.CollectClusterId]||o[Q.LabelsAttributes]?.length||o[Q.AnnotationsAttributes]?.length||(a(Q.CollectContainerAttributes,!0),a(Q.CollectReplicaSetAttributes,!0),a(Q.CollectWorkloadId,!0),a(Q.CollectClusterId,!0),a(Q.LabelsAttributes,[]),a(Q.AnnotationsAttributes,[]))},[]),e(n,{children:[t(ee,{$gap:6,children:Qr.map(({id:n,label:i})=>e(ee,{children:[t(ne,{label:i,value:o[n]||!1,onChange:e=>a(n,e)}),t(oe,{errorMessage:l[n]})]},n))}),t(ie,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:ts,values:o[Q.LabelsAttributes]||[],setValues:e=>a(Q.LabelsAttributes,e),errorMessage:l[Q.LabelsAttributes]}),t(ie,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:ns,values:o[Q.AnnotationsAttributes]||[],setValues:e=>a(Q.AnnotationsAttributes,e),errorMessage:l[Q.AnnotationsAttributes]})]})),[Se.AddClusterInfo]:({value:o,setValue:i,formErrors:a})=>{const l=v();return e(n,{children:[t(le,{label:"Overwrite existing values",labelAlign:re.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:o[Q.OverwriteExistingValues]||!1,onChange:e=>i(Q.OverwriteExistingValues,e)}),t(ie,{name:"clusterAttributes",label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name",placeholder:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value",placeholder:"Attribute value"}],values:o[Q.ClusterAttributes]||[],setValues:e=>i(Q.ClusterAttributes,e),errorMessage:a[Q.ClusterAttributes]})]})},[Se.DeleteAttributes]:({value:e,setValue:n,formErrors:o})=>t(se,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[Q.AttributeNamesToDelete]||[],setValues:e=>n(Q.AttributeNamesToDelete,e),errorMessage:o[Q.AttributeNamesToDelete]}),[Se.RenameAttributes]:({value:e,setValue:n,formErrors:o})=>{const l=e[Q.Renames],[r,s]=a(()=>ps(l));return i(()=>{((e,t)=>{const n=Object.keys(e),o=Object.keys(t);return n.length===o.length&&n.every(n=>Object.prototype.hasOwnProperty.call(t,n)&&t[n]===e[n])})(us(r),l||{})||s(ps(l))},[l]),t(ie,{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(Q.Renames,us(t))},errorMessage:o[Q.Renames]})},[Se.PiiMasking]:({value:n,setValue:o,formErrors:a})=>(i(()=>{n[Q.PiiCategories]?.length||o(Q.PiiCategories,Zr.map(({id:e})=>e))},[]),e(ee,{$gap:12,children:[t(te,{label:"Attributes to mask"}),t(ee,{$gap:6,children:Zr.map(({id:e,label:i})=>t(ne,{label:i,value:n[Q.PiiCategories]?.includes(e)||!1,onChange:t=>{const i=n[Q.PiiCategories]||[],a=t?[...i,e]:i.filter(t=>t!==e);o(Q.PiiCategories,a)}},e))}),t(oe,{errorMessage:a[Q.PiiCategories]})]})),[Se.URLTemplatization]:({value:o,setValue:i,formErrors:a})=>{const r=v(),s=o[hs]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>i(hs,e),d=(e,t)=>c(s.map((n,o)=>o===e?{...n,...t}:n));return e(n,{children:[s.map((n,o)=>e(l,{children:[t(Ce,{}),e(ee,{$gap:12,children:[e(pe,{$justifyContent:"space-between",$alignItems:"center",children:[t(te,{label:`Rule Group ${o+1}`}),t(fe,{leftIcon:()=>t(Da,{fill:r.v2.colors.red[500]}),variant:ve.Secondary,size:be.S,onClick:()=>{return e=o,c(s.filter((t,n)=>n!==e));var e},disabled:1===s.length})]}),t(ye,{name:`urlGroup-${o}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:n.filterK8sNamespace||"",onChange:e=>d(o,{filterK8sNamespace:e.target.value})}),t(ie,{name:`urlGroup-${o}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:ms,values:n.workloadFilters||[],setValues:e=>d(o,{workloadFilters:e})}),t(se,{name:`urlGroup-${o}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:n.templatizationRules.map(e=>e.template),setValues:e=>d(o,{templatizationRules:e.map(e=>({template:e}))})})]}),t(oe,{errorMessage:a[hs]})]},`url-templatization-group-${o}`)),t(fe,{variant:ve.Secondary,label:"Add rule group",leftIcon:_a,onClick:()=>c([...s,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(Ce,{})]})},[Se.ExtractAttribute]:({value:n,setValue:o,formErrors:l})=>{const r=v(),s=l[os],c=n[os]?.extractions||[],[d,p]=a(()=>(e=>e.length&&e.some(rs)?is.Regex:is.Preset)(c)),[u,h]=a(null),m=e=>o(os,{extractions:e});i(()=>{0===c.length&&m([d===is.Preset?ls():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const g=(e,t)=>{m(c.map((n,o)=>o===e?{...n,...t}:n))},f=()=>{m([...c,d===is.Preset?ls():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},b=d===is.Preset,y=c.length?c:[b?ls():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=u&&y[u]?.regex||"";return e(ee,{$gap:16,$width:"100%",children:[t(ce,{options:[{value:is.Preset,label:de.SEGMENT_PRESET_LABEL,tooltip:de.SEGMENT_PRESET_TOOLTIP,selectedBgColor:r.v2.colors.purple[500]},{value:is.Regex,label:de.SEGMENT_REGEX_LABEL,tooltip:de.SEGMENT_REGEX_TOOLTIP,selectedBgColor:r.v2.colors.purple[500]}],selected:d,setSelected:e=>{p(e),m([e===is.Preset?ls():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(ee,{$gap:8,$width:"100%",children:[y.map((n,o)=>{const i=o===y.length-1,a=n.dataFormat||ue.JSON,l=me[a];return e(ss,{"data-id":`extract-row-${o}`,children:[e(pe,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(ee,{$gap:10,children:[t(te,{label:b?de.PRESET_ROW_TITLE(o):de.REGEX_ROW_TITLE(o)}),b&&t(pe,{$gap:24,children:as.map(e=>t(he,{"data-id":`extract-row-${o}-fmt-${e}`,size:ge.L,label:me[e].label,value:a===e,onChange:t=>t&&g(o,{dataFormat:e})},`extract-row-${o}-fmt-${e}`))})]}),e(pe,{$gap:4,$alignItems:"center",children:[!b&&t(fe,{"data-id":`extract-row-${o}-test-regex`,label:de.TEST_REGEX_LABEL,variant:ve.Secondary,size:be.S,onClick:()=>h(o),disabled:!n.regex?.trim()}),t(fe,{"data-id":`extract-row-${o}-delete`,leftIcon:()=>t(Da,{fill:r.v2.colors.red[500]}),variant:ve.Secondary,size:be.S,onClick:()=>(e=>{const t=c.filter((t,n)=>n!==e);m(t.length?t:[d===is.Preset?ls():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(o)}),i&&t(fe,{"data-id":`extract-row-${o}-add`,leftIcon:_a,variant:ve.Secondary,size:be.S,onClick:f})]})]}),b?e(pe,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(cs,{children:t(ye,{name:`extract-row-${o}-lookupKey`,label:l.keyLabel,placeholder:l.placeholder,helpMessage:l.helpMessage,width:"100%",value:n.lookupKey||"",onChange:e=>g(o,{lookupKey:e.target.value})})}),t(ds,{children:t(Pa,{size:24,fill:r.v2.colors.silver[200]})}),t(cs,{children:t(ye,{name:`extract-row-${o}-targetAttributeName`,label:de.TARGET_LABEL,placeholder:de.TARGET_PLACEHOLDER,helpMessage:de.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(o,{targetAttributeName:e.target.value})})})]}):e(ee,{$gap:12,$width:"100%",children:[t(ye,{name:`extract-row-${o}-regex`,label:de.REGEX_LABEL,placeholder:de.REGEX_PLACEHOLDER,helpMessage:de.REGEX_HELP,width:"100%",value:n.regex||"",onChange:e=>g(o,{regex:e.target.value})}),t(ye,{name:`extract-row-${o}-targetAttributeName`,label:de.TARGET_LABEL,placeholder:de.TARGET_PLACEHOLDER,helpMessage:de.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(o,{targetAttributeName:e.target.value})})]})]},`extract-row-${o}`)}),t(oe,{errorMessage:s})]}),t(hr,{isOpen:null!=u,regex:C,onClose:()=>h(null)})]})},[Se.DbQueryTemplatization]:null,[Se.InferDbAttributes]:null},fs=({actionType:e,value:n,setValue:o,formErrors:i,dynamicFields:a,signals:l,sourceOptions:r,namespaceOptions:s})=>{if(!e)return null;if(a?.length)return t(mr,{fields:a,value:n||{},setValue:o,formErrors:i||{},signals:l||[],seedInitialValues:!0,keyValuePersistAs:"map",sourceOptions:r,namespaceOptions:s},e);const c=gs[e];return c?t(c,{value:n,setValue:o,formErrors:i}):null},bs=()=>{const n=v(),{selectedOption:o,genericForm:i,sourceOptions:a,namespaceOptions:l}=Hl();if(!i||!o)return t(xe,{title:"No active form"});const{formData:r,handleFormChange:s,formErrors:c}=i;return e(ee,{$gap:24,children:[e(pe,{$gap:12,$justifyContent:"space-between",children:[t(we,{size:Te.XXXS,maxLines:2,children:o.description}),e(pe,{$gap:12,children:[t(ce,{options:[{icon:La,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:Fa,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:ke.S,selected:r.disabled,setSelected:e=>s("disabled",e)}),t(fe,{leftIcon:Ma,variant:ve.Secondary,size:be.S,onClick:()=>o.docsUrl&&window.open(o.docsUrl,"_blank","noopener noreferrer")})]})]}),t(gr,{title:"Signals for processing",allowedSignals:o.allowedSignals,selectedSignals:r.signals||[],setSelectedSignals:e=>s("signals",e),errorMessage:c.signals}),t(ye,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:r.name||"",onChange:({target:{value:e}})=>s("name",e),errorMessage:c.name}),t(fs,{actionType:o.type,dynamicFields:o.fields,signals:r.signals||[],value:r.fields,setValue:(e,t)=>s(`fields.${e}`,t),formErrors:c,sourceOptions:a,namespaceOptions:l}),t(Ie,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:r.notes||"",onChange:({target:{value:e}})=>s("notes",e),errorMessage:c.notes})]})},vs=b(pe)`
16
16
  position: sticky;
17
17
  bottom: 4px;
18
18
  align-self: center;
@@ -23,17 +23,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
23
23
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
24
24
  box-shadow: 0 4px 16.7px 0 rgba(0, 0, 0, 0.83);
25
25
  z-index: 1;
26
- `,bs=r(({isEdit:n},o)=>{const l=v(),{isVm:r}=S(),{destinationsApi:c}=Vl(),{activeForm:d,genericForm:p,validateFormData:u,thisUnsavedDestination:h,addUnsavedDestination:m,updateUnsavedDestination:g,deleteUnsavedDestination:f}=Hl(),[b,y]=a(h?.testResult),[C,x]=a(!!h);i(()=>{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 c.testConnection(De(p.formData));return y(e),e};return s(o,()=>({testConnection:w,testConnectionSupported:!!d?.option.testConnectionSupported}),[d?.option.testConnectionSupported,p,c]),p&&d?e(ee,{$gap:24,style:{minHeight:"100%"},children:[e(pe,{$gap:12,$justifyContent:"space-between",children:[b?b.succeeded?t(Ne,{status:Ee.Success,message:b.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(Ne,{status:Ee.Error,message:b.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(pe,{$gap:12,children:[!r&&t(ce,{options:[{icon:_a,label:"Enabled",value:!1,selectedBgColor:l.v2.colors.green[800]},{icon:Pa,label:"Disabled",value:!0,selectedBgColor:l.v2.colors.red[800]}],size:ke.S,selected:p.formData.disabled,setSelected:e=>p.handleFormChange("disabled",e),disabled:C}),t(fe,{"data-id":"dest-form-docs",leftIcon:La,variant:ve.Secondary,size:be.S,onClick:()=>window.open(`${Oe}/backends/${d.option.type}`,"_blank","noopener noreferrer")})]})]}),t(hr,{title:"This connection will monitor:",allowedSignals:Re(d.option.supportedSignals),selectedSignals:Ae(p.formData.exportedSignals),setSelectedSignals:e=>p.handleFormChange("exportedSignals",{logs:e.includes($e.Logs),metrics:e.includes($e.Metrics),traces:e.includes($e.Traces),profiles:e.includes($e.Profiles)}),disabled:C,errorMessage:p.formErrors.exportedSignals}),t(ye,{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(ur,{signals:Ae(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(fs,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(fe,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:Fa,variant:ve.Secondary,textColor:l.v2.colors.red[500],onClick:()=>f(d.unsavedIdx)})}),!r&&(!h||h.option.testConnectionSupported&&!C)&&t("div",{style:{width:"150px"},children:t(fe,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:ve.Secondary,onClick:w})}),h&&t("div",C?{style:{width:"150px"},children:t(fe,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:Ma,variant:ve.Secondary,onClick:()=>x(!1)})}:{style:{width:"150px"},children:t(fe,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:ve.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(fe,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:ve.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(xe,{title:"No active form"})});bs.displayName="AddDestinationForm";const vs=[{id:Le.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Le.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Le.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],ys=[{id:Le.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Le.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Le.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Cs=["*"],Ss=[{id:ze.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:ze.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:ze.DbQuery,label:"Collect DB query",tooltip:""},{id:ze.Messaging,label:"Collect messaging",tooltip:""}],xs={[Ve.Java]:[new Xe("","")],[Ve.Golang]:[new Be("")],[Ve.Php]:[new Ue("","")]},ws={[je.CodeAttributes]:({value:o,setValue:a,formErrors:l})=>{const r=l.codeAttributes,s=c(()=>Object.entries(o.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]);i(()=>{if(!s.length&&!r){const e={[Le.FilePath]:!0,[Le.Function]:!0,[Le.LineNumber]:!0,[Le.Column]:null,[Le.Namespace]:null,[Le.StackTrace]:null};a("codeAttributes",e)}},[]);const d=(e,t)=>{const n=t?[...s,e]:s.filter(t=>t!==e),o=Object.values(Le).reduce((e,t)=>(e[t]=!!n.includes(t)||null,e),{});a("codeAttributes",o)};return e(n,{children:[e(ee,{$gap:12,children:[t(_e,{size:Te.XS,color:Pe.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(ee,{$gap:6,children:vs.map(({id:e,label:n,tooltip:o})=>t(Fe,{text:o,withIcon:!0,children:t(ne,{label:n,value:s.includes(e),onChange:t=>d(e,t)})},e))}),t(oe,{errorMessage:r})]}),e(ee,{$gap:12,children:[t(_e,{size:Te.XS,color:Pe.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(ee,{$gap:6,children:ys.map(({id:e,label:n,tooltip:o})=>t(Fe,{text:o,withIcon:!0,children:t(ne,{label:n,value:s.includes(e),onChange:t=>d(e,t)})},e))}),t(oe,{errorMessage:r})]})]})},[je.CustomInstrumentation]:({value:o,setValue:a,formErrors:l})=>{const r=l.customInstrumentations,s=c(()=>(o?.customInstrumentations?.[Ve.Golang]||[]).map(e=>new Be(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[o]),d=c(()=>(o?.customInstrumentations?.[Ve.Java]||[]).map(e=>new Xe(e.className,e.methodName)),[o]),p=c(()=>(o?.customInstrumentations?.[Ve.Php]||[]).map(e=>new Ue(e.className,e.functionName)),[o]);return i(()=>{o?.customInstrumentations||r||a("customInstrumentations",{[Ve.Golang]:xs[Ve.Golang],[Ve.Java]:xs[Ve.Java],[Ve.Php]:xs[Ve.Php]})},[]),e(n,{children:[e(ee,{children:[e(pe,{$gap:8,children:[t(za,{}),t(te,{label:"Golang custom probes"})]}),t(ie,{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:s,setValues:e=>{const t={};t[Ve.Golang]=e.map(e=>new Be(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[Ve.Java]=d,t[Ve.Php]=p,a("customInstrumentations",t)},errorMessage:r,limitFieldsPerRow:2})]}),e(ee,{children:[e(pe,{$gap:8,children:[t(Ba,{}),t(te,{label:"Java custom probes"})]}),t(ie,{name:"javaProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. com.example.MyClass",tooltip:"The name of the class to be instrumented."},{keyName:"methodName",label:"Method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented."}],values:d,setValues:e=>{const t={};t[Ve.Golang]=s,t[Ve.Java]=e.map(e=>new Xe(e.className,e.methodName)),t[Ve.Php]=p,a("customInstrumentations",t)},errorMessage:r,limitFieldsPerRow:2})]}),e(ee,{children:[e(pe,{$gap:8,children:[t(Xa,{}),t(te,{label:"PHP custom probes"})]}),t(Ne,{status:Ee.Warning,message:He.PHP_CUSTOM_INSTRUMENTATION_RESTART,fullWidth:!0}),t(ie,{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:p,setValues:e=>{const t={};t[Ve.Golang]=s,t[Ve.Java]=d,t[Ve.Php]=e.map(e=>new Ue(e.className,e.functionName)),a("customInstrumentations",t)},errorMessage:r,limitFieldsPerRow:2})]})]})},[je.HeadersCollection]:({value:e,setValue:n,formErrors:o})=>{const a=o.headersCollection,l=c(()=>e?.headersCollection?.[Me.HeaderKeys]||[],[e]),r=e=>{const t={[Me.HeaderKeys]:e};n("headersCollection",t)};return i(()=>{l.length||a||r(Cs)},[]),t(se,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:l,setValues:r,errorMessage:a})},[je.PayloadCollection]:({value:n,setValue:o,formErrors:a})=>{const l=a.payloadCollection,r=c(()=>Object.entries(n.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[n]);return i(()=>{if(!r.length&&!l){const e={[ze.HttpRequest]:{},[ze.HttpResponse]:{},[ze.DbQuery]:{},[ze.Messaging]:{}};o("payloadCollection",e)}},[]),e(ee,{$gap:12,children:[t(_e,{size:Te.XS,color:Pe.Secondary,nowrap:!0,children:"Type of data to collect"}),t(ee,{$gap:6,children:Ss.map(({id:e,label:n,tooltip:i})=>t(Fe,{text:i,withIcon:!0,children:t(ne,{label:n,value:r.includes(e),onChange:t=>((e,t)=>{const n=t?[...r,e]:r.filter(t=>t!==e),i={[ze.HttpRequest]:n.includes(ze.HttpRequest)?{}:null,[ze.HttpResponse]:n.includes(ze.HttpResponse)?{}:null,[ze.DbQuery]:n.includes(ze.DbQuery)?{}:null,[ze.Messaging]:n.includes(ze.Messaging)?{}:null};o("payloadCollection",i)})(e,t)})},e))}),t(oe,{errorMessage:l})]})},[je.UnknownType]:null},Ts=({ruleType:e,value:n,setValue:o,formErrors:i,dynamicFields:a})=>{if(!e)return null;if(a?.length)return t(ur,{fields:a,value:n||{},setValue:o,formErrors:i||{},signals:[],seedInitialValues:!0,keyValuePersistAs:"map"},e);const l=ws[e];return l?t(l,{value:n,setValue:o,formErrors:i}):null},ks=()=>{const n=v(),{isVm:o}=S(),{selectedOption:i,genericForm:a,sourceOptions:l,namespaceOptions:r}=jl(),s=c(()=>Ge(i?.supportedLanguages),[i?.supportedLanguages]),d=c(()=>{if(i)return i.type===je.CustomInstrumentation?[]:We(i.supportedLanguages)},[i]);if(!a||!i)return t(xe,{title:"No active form"});const{formData:p,handleFormChange:u,formErrors:h}=a;return e(ee,{$gap:24,children:[e(pe,{$gap:12,$justifyContent:"space-between",children:[t(we,{size:Te.XXXS,maxLines:2,children:i.description}),e(pe,{$gap:12,children:[t(ce,{options:[{icon:_a,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:Pa,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:ke.S,selected:p.disabled,setSelected:e=>u("disabled",e)}),t(fe,{leftIcon:La,variant:ve.Secondary,size:be.S,onClick:()=>i.docsUrl&&window.open(i.docsUrl,"_blank","noopener noreferrer")})]})]}),t(mr,{option:i,formState:p}),!!s.length&&e(pe,{$gap:12,children:[t(_e,{size:Te.XS,color:Pe.Secondary,nowrap:!0,children:"Supported Languages:"}),s.map(e=>t(Ke,{label:Je(e),leftIcon:Ye(e),backgroundColor:n.v2.colors.purple[900]},e))]}),!o&&t(gr,{scopes:p.sourceScopes,onChange:e=>u("sourceScopes",e),sourceOptions:l,namespaceOptions:r,supportedLanguages:d,dataIdPrefix:"instrumentation-rule",slim:!0}),t(ye,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:p.ruleName,onChange:({target:{value:e}})=>u("ruleName",e),errorMessage:h.ruleName}),t(Ts,{ruleType:i.type,dynamicFields:i.fields,value:p,setValue:(e,t)=>u(e,t),formErrors:h}),t(Ie,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:p.notes,onChange:({target:{value:e}})=>u("notes",e),errorMessage:h.notes})]})},Is=()=>{const{pendingMerge:e,confirmMerge:n,cancelMerge:o}=Gl();if(!e)return null;const{existingName:i,editingName:a}=e;return t(qe,{isOpen:!0,onClose:o,title:"Merge with existing Data Stream?",description:Ze.DATA_STREAM_MERGE_WARNING(a,i),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:ve.Primary,onClick:n},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:ve.Secondary,onClick:o}})},Ns=({autoFocus:n})=>{const{dataStreams:o}=Qe(),{genericForm:i,excludeName:a,editingName:l}=Gl(),{formData:r,formErrors:s,handleFormChange:d}=i,p=r.name,u=c(()=>o.find(e=>e.name===p&&e.name!==a),[o,p,a]);return e(ee,{$width:"100%",$gap:12,children:[t(ye,{name:"data-stream-name",label:Ze.STREAM_NAME,placeholder:Ze.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:Ze.STREAM_DESCRIPTION,required:!0,autoFocus:n,value:p,onChange:e=>d("name",e.target.value),errorMessage:s.name}),u&&t(Ne,{status:Ee.Warning,message:Ze.DATA_STREAM_MERGE_WARNING(l,u.name),fullWidth:!0})]})},Es=()=>{const{selectedStreamName:e}=Qe(),{genericForm:n}=Wl();if(!n)return t(xe,{title:"No active form"});const{formData:o,handleFormChange:i,formErrors:a}=n;return t(ye,{name:"sourceName",label:Ze.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:o.otelServiceName,onChange:({target:{value:t}})=>{i("otelServiceName",t),i("currentStreamName",e)},errorMessage:a.otelServiceName})},Os=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],$s=b.div`
26
+ `,ys=r(({isEdit:n},o)=>{const l=v(),{isVm:r}=S(),{destinationsApi:c}=jl(),{activeForm:d,genericForm:p,validateFormData:u,thisUnsavedDestination:h,addUnsavedDestination:m,updateUnsavedDestination:g,deleteUnsavedDestination:f}=Gl(),[b,y]=a(h?.testResult),[C,x]=a(!!h);i(()=>{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 c.testConnection(De(p.formData));return y(e),e};return s(o,()=>({testConnection:w,testConnectionSupported:!!d?.option.testConnectionSupported}),[d?.option.testConnectionSupported,p,c]),p&&d?e(ee,{$gap:24,style:{minHeight:"100%"},children:[e(pe,{$gap:12,$justifyContent:"space-between",children:[b?b.succeeded?t(Ne,{status:Ee.Success,message:b.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(Ne,{status:Ee.Error,message:b.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(pe,{$gap:12,children:[!r&&t(ce,{options:[{icon:La,label:"Enabled",value:!1,selectedBgColor:l.v2.colors.green[800]},{icon:Fa,label:"Disabled",value:!0,selectedBgColor:l.v2.colors.red[800]}],size:ke.S,selected:p.formData.disabled,setSelected:e=>p.handleFormChange("disabled",e),disabled:C}),t(fe,{"data-id":"dest-form-docs",leftIcon:Ma,variant:ve.Secondary,size:be.S,onClick:()=>window.open(`${Oe}/backends/${d.option.type}`,"_blank","noopener noreferrer")})]})]}),t(gr,{title:"This connection will monitor:",allowedSignals:Re(d.option.supportedSignals),selectedSignals:Ae(p.formData.exportedSignals),setSelectedSignals:e=>p.handleFormChange("exportedSignals",{logs:e.includes($e.Logs),metrics:e.includes($e.Metrics),traces:e.includes($e.Traces),profiles:e.includes($e.Profiles)}),disabled:C,errorMessage:p.formErrors.exportedSignals}),t(ye,{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(mr,{signals:Ae(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(vs,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(fe,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:za,variant:ve.Secondary,textColor:l.v2.colors.red[500],onClick:()=>f(d.unsavedIdx)})}),!r&&(!h||h.option.testConnectionSupported&&!C)&&t("div",{style:{width:"150px"},children:t(fe,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:ve.Secondary,onClick:w})}),h&&t("div",C?{style:{width:"150px"},children:t(fe,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:Ba,variant:ve.Secondary,onClick:()=>x(!1)})}:{style:{width:"150px"},children:t(fe,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:ve.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(fe,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:ve.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(xe,{title:"No active form"})});ys.displayName="AddDestinationForm";const Cs=[{id:Le.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Le.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Le.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Ss=[{id:Le.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Le.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Le.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],xs=["*"],ws=[{id:ze.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:ze.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:ze.DbQuery,label:"Collect DB query",tooltip:""},{id:ze.Messaging,label:"Collect messaging",tooltip:""}],Ts={[Ve.Java]:[new Xe("","")],[Ve.Golang]:[new Be("")],[Ve.Php]:[new Ue("","")]},ks={[je.CodeAttributes]:({value:o,setValue:a,formErrors:l,disabled:r})=>{const s=l.codeAttributes,d=c(()=>Object.entries(o.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]);i(()=>{if(!d.length&&!s){const e={[Le.FilePath]:!0,[Le.Function]:!0,[Le.LineNumber]:!0,[Le.Column]:null,[Le.Namespace]:null,[Le.StackTrace]:null};a("codeAttributes",e)}},[]);const p=(e,t)=>{const n=t?[...d,e]:d.filter(t=>t!==e),o=Object.values(Le).reduce((e,t)=>(e[t]=!!n.includes(t)||null,e),{});a("codeAttributes",o)};return e(n,{children:[e(ee,{$gap:12,children:[t(_e,{size:Te.XS,color:Pe.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(ee,{$gap:6,children:Cs.map(({id:e,label:n,tooltip:o})=>t(Fe,{text:o,withIcon:!0,children:t(ne,{label:n,value:d.includes(e),onChange:t=>p(e,t),disabled:r})},e))}),t(oe,{errorMessage:s})]}),e(ee,{$gap:12,children:[t(_e,{size:Te.XS,color:Pe.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(ee,{$gap:6,children:Ss.map(({id:e,label:n,tooltip:o})=>t(Fe,{text:o,withIcon:!0,children:t(ne,{label:n,value:d.includes(e),onChange:t=>p(e,t),disabled:r})},e))}),t(oe,{errorMessage:s})]})]})},[je.CustomInstrumentation]:({value:o,setValue:a,formErrors:l,disabled:r})=>{const s=l.customInstrumentations,d=c(()=>(o?.customInstrumentations?.[Ve.Golang]||[]).map(e=>new Be(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[o]),p=c(()=>(o?.customInstrumentations?.[Ve.Java]||[]).map(e=>new Xe(e.className,e.methodName)),[o]),u=c(()=>(o?.customInstrumentations?.[Ve.Php]||[]).map(e=>new Ue(e.className,e.functionName)),[o]);return i(()=>{o?.customInstrumentations||s||a("customInstrumentations",{[Ve.Golang]:Ts[Ve.Golang],[Ve.Java]:Ts[Ve.Java],[Ve.Php]:Ts[Ve.Php]})},[]),e(n,{children:[e(ee,{children:[e(pe,{$gap:8,children:[t(Xa,{}),t(te,{label:"Golang custom probes"})]}),t(ie,{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[Ve.Golang]=e.map(e=>new Be(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[Ve.Java]=p,t[Ve.Php]=u,a("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2,disabled:r})]}),e(ee,{children:[e(pe,{$gap:8,children:[t(Ua,{}),t(te,{label:"Java custom probes"})]}),t(ie,{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[Ve.Golang]=d,t[Ve.Java]=e.map(e=>new Xe(e.className,e.methodName)),t[Ve.Php]=u,a("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2,disabled:r})]}),e(ee,{children:[e(pe,{$gap:8,children:[t(Va,{}),t(te,{label:"PHP custom probes"})]}),t(Ne,{status:Ee.Warning,message:He.PHP_CUSTOM_INSTRUMENTATION_RESTART,fullWidth:!0}),t(ie,{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[Ve.Golang]=d,t[Ve.Java]=p,t[Ve.Php]=e.map(e=>new Ue(e.className,e.functionName)),a("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]})]})},[je.HeadersCollection]:({value:e,setValue:n,formErrors:o,disabled:a})=>{const l=o.headersCollection,r=c(()=>e?.headersCollection?.[Me.HeaderKeys]||[],[e]),s=e=>{const t={[Me.HeaderKeys]:e};n("headersCollection",t)};return i(()=>{r.length||l||s(xs)},[]),t(se,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:r,setValues:s,errorMessage:l,disabled:a})},[je.PayloadCollection]:({value:n,setValue:o,formErrors:a,disabled:l})=>{const r=a.payloadCollection,s=c(()=>Object.entries(n.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[n]);return i(()=>{if(!s.length&&!r){const e={[ze.HttpRequest]:{},[ze.HttpResponse]:{},[ze.DbQuery]:{},[ze.Messaging]:{}};o("payloadCollection",e)}},[]),e(ee,{$gap:12,children:[t(_e,{size:Te.XS,color:Pe.Secondary,nowrap:!0,children:"Type of data to collect"}),t(ee,{$gap:6,children:ws.map(({id:e,label:n,tooltip:i})=>t(Fe,{text:i,withIcon:!0,children:t(ne,{label:n,value:s.includes(e),onChange:t=>((e,t)=>{const n=t?[...s,e]:s.filter(t=>t!==e),i={[ze.HttpRequest]:n.includes(ze.HttpRequest)?{}:null,[ze.HttpResponse]:n.includes(ze.HttpResponse)?{}:null,[ze.DbQuery]:n.includes(ze.DbQuery)?{}:null,[ze.Messaging]:n.includes(ze.Messaging)?{}:null};o("payloadCollection",i)})(e,t),disabled:l})},e))}),t(oe,{errorMessage:r})]})},[je.UnknownType]:null},Is=({ruleType:e,value:n,setValue:o,formErrors:i,dynamicFields:a,disabled:l})=>{if(!e)return null;if(a?.length)return t(mr,{fields:a,value:n||{},setValue:o,formErrors:i||{},signals:[],seedInitialValues:!0,keyValuePersistAs:"map",disabled:l},e);const r=ks[e];return r?t(r,{value:n,setValue:o,formErrors:i,disabled:l}):null},Ns=()=>{const n=v(),{isEnterprise:o,isVm:i}=S(),{selectedOption:a,genericForm:l,sourceOptions:r,namespaceOptions:s}=Wl(),d=c(()=>Ge(a?.supportedLanguages),[a?.supportedLanguages]),p=c(()=>{if(a)return a.type===je.CustomInstrumentation?[]:We(a.supportedLanguages)},[a]);if(!l||!a)return t(xe,{title:"No active form"});const{formData:u,handleFormChange:h,formErrors:m}=l;return e(ee,{$gap:24,children:[e(pe,{$gap:12,$justifyContent:"space-between",children:[t(we,{size:Te.XXXS,maxLines:2,children:a.description}),e(pe,{$gap:12,children:[t(ce,{options:[{icon:La,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:Fa,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:ke.S,selected:u.disabled,setSelected:e=>h("disabled",e),disabled:!o}),t(fe,{leftIcon:Ma,variant:ve.Secondary,size:be.S,onClick:()=>a.docsUrl&&window.open(a.docsUrl,"_blank","noopener noreferrer")})]})]}),t(fr,{option:a,formState:u}),!!d.length&&e(pe,{$gap:12,children:[t(_e,{size:Te.XS,color:Pe.Secondary,nowrap:!0,children:"Supported Languages:"}),d.map(e=>t(Ke,{label:Je(e),leftIcon:Ye(e),backgroundColor:n.v2.colors.purple[900]},e))]}),!i&&t(br,{scopes:u.sourceScopes,onChange:e=>h("sourceScopes",e),sourceOptions:r,namespaceOptions:s,supportedLanguages:p,dataIdPrefix:"instrumentation-rule",slim:!0,disabled:!o}),t(ye,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:u.ruleName,onChange:({target:{value:e}})=>h("ruleName",e),errorMessage:m.ruleName,disabled:!o}),t(Is,{ruleType:a.type,dynamicFields:a.fields,value:u,setValue:(e,t)=>h(e,t),formErrors:m,disabled:!o}),t(Ie,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:u.notes,onChange:({target:{value:e}})=>h("notes",e),errorMessage:m.notes,disabled:!o})]})},Es=()=>{const{pendingMerge:e,confirmMerge:n,cancelMerge:o}=Kl();if(!e)return null;const{existingName:i,editingName:a}=e;return t(qe,{isOpen:!0,onClose:o,title:"Merge with existing Data Stream?",description:Ze.DATA_STREAM_MERGE_WARNING(a,i),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:ve.Primary,onClick:n},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:ve.Secondary,onClick:o}})},Os=({autoFocus:n})=>{const{dataStreams:o}=Qe(),{genericForm:i,excludeName:a,editingName:l}=Kl(),{formData:r,formErrors:s,handleFormChange:d}=i,p=r.name,u=c(()=>o.find(e=>e.name===p&&e.name!==a),[o,p,a]);return e(ee,{$width:"100%",$gap:12,children:[t(ye,{name:"data-stream-name",label:Ze.STREAM_NAME,placeholder:Ze.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:Ze.STREAM_DESCRIPTION,required:!0,autoFocus:n,value:p,onChange:e=>d("name",e.target.value),errorMessage:s.name}),u&&t(Ne,{status:Ee.Warning,message:Ze.DATA_STREAM_MERGE_WARNING(l,u.name),fullWidth:!0})]})},$s=()=>{const{selectedStreamName:e}=Qe(),{genericForm:n}=Yl();if(!n)return t(xe,{title:"No active form"});const{formData:o,handleFormChange:i,formErrors:a}=n;return t(ye,{name:"sourceName",label:Ze.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:o.otelServiceName,onChange:({target:{value:t}})=>{i("otelServiceName",t),i("currentStreamName",e)},errorMessage:a.otelServiceName})},As=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Rs=b.div`
27
27
  display: flex;
28
28
  flex-direction: column;
29
29
  gap: 24px;
30
- `,As=b.div`
30
+ `,Ds=b.div`
31
31
  display: contents;
32
32
  & > * {
33
33
  opacity: ${({$faded:e})=>e?.4:1};
34
34
  transition: opacity 0.2s ease;
35
35
  }
36
- `,Rs=({value:e})=>{const n=v();return t(Ke,e?{status:Ee.Success,label:lt,leftIcon:_a}:{label:rt,leftIcon:Pa,backgroundColor:n.v2.colors.silver[500],textColor:n.v2.colors.white[500]})},Ds=({value:e,onChange:n})=>{const o=v(),i=c(()=>[{icon:_a,label:lt,value:!0,selectedBgColor:o.v2.colors.green[800]},{icon:Pa,label:rt,value:!1,selectedBgColor:o.v2.colors.silver[500]}],[o]);return t(ce,{options:i,selected:e,setSelected:n??(()=>{}),disabled:!n})},_s=()=>{const e=Kl();switch(e.formType){case Yl.Create:return t(Ps,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Ds,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case Yl.View:return e.data?e.isEditing?t(Ps,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Ds,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(Ls,{data:e.data,renderAction:()=>t(Rs,{value:!e.data?.rule.disabled})}):null;case Yl.EditAutoNoisy:return t(Fs,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:at,sectionTitle:nt,sectionSubTitle:it,presetLabel:tt,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(Ds,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Yl.EditAutoCostReduction:return t(Fs,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:ot,sectionTitle:nt,presetLabel:tt,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(Ds,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Yl.EditAutoHighlyRelevant:return t($s,{children:t(fr,{title:e.localEnabled?void 0:et,summary:e.summary,renderAction:()=>t(Ds,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},Ps=({category:n,formData:o,onChange:i,sourceOptions:a,namespaceOptions:l,renderAction:r})=>e($s,{children:[t(yr,{category:n,formState:o,renderAction:r}),e(As,{$faded:!!o.disabled,children:[t(Cr,{category:n,formState:o,onChange:i}),t(gr,{scopes:o.sourceScopes,onChange:e=>i({sourceScopes:e}),sourceOptions:a,namespaceOptions:l,titleNumber:1,dataIdPrefix:"sampling"}),t(Sr,{category:n,formState:o,onChange:i}),"highlyRelevant"===n&&t(xr,{formState:o,onChange:i}),"highlyRelevant"===n&&t(wr,{ruleType:o.ruleType,formState:o,onChange:i}),t(Tr,{category:n,formState:o,onChange:i})]})]}),Ls=({data:n,renderAction:o})=>e($s,{children:[t(yr,{readOnly:!0,summary:n.summary,renderAction:o}),t(Cr,{readOnly:!0,data:n}),t(gr,{readOnly:!0,scopes:x(n.rule.sourceScopes)}),t(Sr,{readOnly:!0,data:n}),t(Tr,{readOnly:!0,data:n}),"highlyRelevant"===n.category&&t(wr,{readOnly:!0,rule:n.rule})]}),Fs=({enabled:n,summary:o,inactiveTitle:i,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($s,{children:[t(fr,{title:n?void 0:i,summary:o,renderAction:b}),t(As,{$faded:!n,children:e(st,{richTitle:{title:a,subTitle:l},children:[c&&t(ee,{$alignItems:"flex-start",children:t(ce,{options:Os,selected:p,setSelected:v})}),S&&t(br,{description:r,options:vr,selected:h,onSelect:y,customName:s,customLabel:ct,customPlaceholder:"5%",customValue:g,onCustomChange:C})]})})]})},Ms=b.div`
36
+ `,_s=({value:e})=>{const n=v();return t(Ke,e?{status:Ee.Success,label:lt,leftIcon:La}:{label:rt,leftIcon:Fa,backgroundColor:n.v2.colors.silver[500],textColor:n.v2.colors.white[500]})},Ps=({value:e,onChange:n})=>{const o=v(),i=c(()=>[{icon:La,label:lt,value:!0,selectedBgColor:o.v2.colors.green[800]},{icon:Fa,label:rt,value:!1,selectedBgColor:o.v2.colors.silver[500]}],[o]);return t(ce,{options:i,selected:e,setSelected:n??(()=>{}),disabled:!n})},Ls=()=>{const e=Jl();switch(e.formType){case ql.Create:return t(Fs,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Ps,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case ql.View:return e.data?e.isEditing?t(Fs,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Ps,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(Ms,{data:e.data,renderAction:()=>t(_s,{value:!e.data?.rule.disabled})}):null;case ql.EditAutoNoisy:return t(zs,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:at,sectionTitle:nt,sectionSubTitle:it,presetLabel:tt,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(Ps,{value:e.localEnabled,onChange:e.setLocalEnabled})});case ql.EditAutoCostReduction:return t(zs,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:ot,sectionTitle:nt,presetLabel:tt,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(Ps,{value:e.localEnabled,onChange:e.setLocalEnabled})});case ql.EditAutoHighlyRelevant:return t(Rs,{children:t(vr,{title:e.localEnabled?void 0:et,summary:e.summary,renderAction:()=>t(Ps,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},Fs=({category:n,formData:o,onChange:i,sourceOptions:a,namespaceOptions:l,renderAction:r})=>e(Rs,{children:[t(Sr,{category:n,formState:o,renderAction:r}),e(Ds,{$faded:!!o.disabled,children:[t(xr,{category:n,formState:o,onChange:i}),t(br,{scopes:o.sourceScopes,onChange:e=>i({sourceScopes:e}),sourceOptions:a,namespaceOptions:l,titleNumber:1,dataIdPrefix:"sampling"}),t(wr,{category:n,formState:o,onChange:i}),"highlyRelevant"===n&&t(Tr,{formState:o,onChange:i}),"highlyRelevant"===n&&t(kr,{ruleType:o.ruleType,formState:o,onChange:i}),t(Ir,{category:n,formState:o,onChange:i})]})]}),Ms=({data:n,renderAction:o})=>e(Rs,{children:[t(Sr,{readOnly:!0,summary:n.summary,renderAction:o}),t(xr,{readOnly:!0,data:n}),t(br,{readOnly:!0,scopes:x(n.rule.sourceScopes)}),t(wr,{readOnly:!0,data:n}),t(Ir,{readOnly:!0,data:n}),"highlyRelevant"===n.category&&t(kr,{readOnly:!0,rule:n.rule})]}),zs=({enabled:n,summary:o,inactiveTitle:i,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(Rs,{children:[t(vr,{title:n?void 0:i,summary:o,renderAction:b}),t(Ds,{$faded:!n,children:e(st,{richTitle:{title:a,subTitle:l},children:[c&&t(ee,{$alignItems:"flex-start",children:t(ce,{options:As,selected:p,setSelected:v})}),S&&t(yr,{description:r,options:Cr,selected:h,onSelect:y,customName:s,customLabel:ct,customPlaceholder:"5%",customValue:g,onCustomChange:C})]})})]})},Bs=b.div`
37
37
  display: flex;
38
38
  align-items: center;
39
39
  justify-content: space-between;
@@ -46,38 +46,38 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
46
46
  &:hover {
47
47
  background-color: ${({$isSelected:e,$purpleColors:t,theme:n})=>n.v2.colors[t?"purple":"silver"][e?"700":"800"]};
48
48
  }
49
- `,zs=b.div`
49
+ `,Xs=b.div`
50
50
  display: flex;
51
51
  align-items: center;
52
52
  justify-content: center;
53
53
  padding: 8px;
54
54
  border-radius: 8px;
55
55
  background-color: ${({theme:e})=>e.v2.colors.white[500]+dt["004"]};
56
- `,Bs=b(ee)`
56
+ `,Us=b(ee)`
57
57
  flex: 1;
58
58
  min-width: 0;
59
- `,Xs=b(pe)`
59
+ `,Vs=b(pe)`
60
60
  min-width: 0;
61
61
  width: 100%;
62
- `,Us=b(_e)`
62
+ `,Hs=b(_e)`
63
63
  flex: 1;
64
64
  min-width: 0;
65
- `,Vs=b(pe)`
65
+ `,js=b(pe)`
66
66
  flex-shrink: 0;
67
- `,Hs=({dataId:n,icon:o,title:i,description:a,withCarret:l,purpleColors:r,disabled:s,children:c,isSelected:d,onClick:p,isChecked:u,isPartiallyChecked:h,onCheckboxChange:m})=>e(Ms,{"data-id":n||`list-item-${i}`,$isSelected:d,$purpleColors:r,$disabled:s,onClick:()=>!d&&!s&&p(),children:[e(Bs,{$gap:4,children:[e(Xs,{$gap:12,children:[m&&t(ne,{partiallyChecked:h||!1,value:u||!1,onChange:e=>m(e)}),o&&t(zs,{children:t(o,{size:20})}),t(Us,{size:Te.XS,nowrap:!0,children:i})]}),a&&t(_e,{size:Te.XXXS,color:Pe.Secondary,nowrap:!0,children:a})]}),(l||c)&&e(Vs,{$gap:8,children:[c,l&&t(Ua,{size:18})]})]}),js=({onClose:e,selectedConnectionIds:n,setSelectedConnectionIds:o,withOverlay:i})=>{const{actionsApi:l}=Vl(),{platformType:r,version:s}=S(),[d,u]=a(""),h=p(null),{selectedOption:m,onSelectOption:g,genericForm:f,validateFormData:b}=Ul(),{options:v,loading:y}=l.useActionTypes(),C=c(()=>v.length?v:pt(r,s),[v,r,s]),x=c(()=>(d?C.filter(e=>e?.label?.toLowerCase().includes(d.toLowerCase())):C).filter(e=>!!e),[C,d]),w=c(()=>y?[t(ut,{$padding:"8px 12px",children:t(ht,{size:6})},"loading")]:x.map(e=>{const n=m?.type===e.type;return t(Hs,{dataId:e.type?`option-${e.type}`:void 0,title:e.label,description:e.description,withCarret:!0,isSelected:n,onClick:()=>{h.current?.clearErrors(),g(e)}},e.type)}),[y,m?.type,x,g]),T=c(()=>y?[t(ut,{$padding:"8px 12px",children:t(ht,{size:4})},"loading")]:m?[t(gs,{},m.type)]:[t(mt,{$height:"100%",children:t(xe,{icon:Va,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[y,m]);return t(kr,{ref:h,isOpen:!0,withOverlay:i,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=b();if(e)return!1;await l.create(t)},disableSave:!m||!f?.isFormDirty,isFormDirty:f?.isFormDirty,hideDirtyNote:!0,progress:{title:Ze.CREATING_ACTION,subTitle:Ze.CREATING_ACTION_SUBTITLE},header:{icon:Va,title:Ze.ADD_ACTION,subTitle:Ze.ADD_ACTION_DESCRIPTION},connectionIds:n&&o?{value:n,setValue:o}:void 0,search:{value:d,onChange:u},leftColumn:{width:"40%",list:w},rightColumn:{width:"60%",list:T}})},Gs=({destinationsByCategory:o,filters:i,setFilters:a})=>{const l=c(()=>Object.values(gt).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})).filter(e=>o[e.id]?.length),[o]),r=c(()=>{const e=Object.values($e).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(ft,{placeholder:"Select category",options:l,values:i.categoryType?[i.categoryType]:[],setValues:e=>a({...i,categoryType:i.categoryType===e[0]?null:e[0]})}),t(ce,{options:r,selected:i.signalType,setSelected:e=>a({...i,signalType:e})})]})},Ws=b.div`
67
+ `,Gs=({dataId:n,icon:o,title:i,description:a,withCarret:l,purpleColors:r,disabled:s,children:c,isSelected:d,onClick:p,isChecked:u,isPartiallyChecked:h,onCheckboxChange:m})=>e(Bs,{"data-id":n||`list-item-${i}`,$isSelected:d,$purpleColors:r,$disabled:s,onClick:()=>!d&&!s&&p(),children:[e(Us,{$gap:4,children:[e(Vs,{$gap:12,children:[m&&t(ne,{partiallyChecked:h||!1,value:u||!1,onChange:e=>m(e)}),o&&t(Xs,{children:t(o,{size:20})}),t(Hs,{size:Te.XS,nowrap:!0,children:i})]}),a&&t(_e,{size:Te.XXXS,color:Pe.Secondary,nowrap:!0,children:a})]}),(l||c)&&e(js,{$gap:8,children:[c,l&&t(Ha,{size:18})]})]}),Ws=({onClose:e,selectedConnectionIds:n,setSelectedConnectionIds:o,withOverlay:i})=>{const{actionsApi:l}=jl(),{platformType:r,version:s}=S(),[d,u]=a(""),h=p(null),{selectedOption:m,onSelectOption:g,genericForm:f,validateFormData:b}=Hl(),{options:v,loading:y}=l.useActionTypes(),C=c(()=>v.length?v:pt(r,s),[v,r,s]),x=c(()=>(d?C.filter(e=>e?.label?.toLowerCase().includes(d.toLowerCase())):C).filter(e=>!!e),[C,d]),w=c(()=>y?[t(ut,{$padding:"8px 12px",children:t(ht,{size:6})},"loading")]:x.map(e=>{const n=m?.type===e.type;return t(Gs,{dataId:e.type?`option-${e.type}`:void 0,title:e.label,description:e.description,withCarret:!0,isSelected:n,onClick:()=>{h.current?.clearErrors(),g(e)}},e.type)}),[y,m?.type,x,g]),T=c(()=>y?[t(ut,{$padding:"8px 12px",children:t(ht,{size:4})},"loading")]:m?[t(bs,{},m.type)]:[t(mt,{$height:"100%",children:t(xe,{icon:ja,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[y,m]);return t(Nr,{ref:h,isOpen:!0,withOverlay:i,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=b();if(e)return!1;await l.create(t)},disableSave:!m||!f?.isFormDirty,isFormDirty:f?.isFormDirty,hideDirtyNote:!0,progress:{title:Ze.CREATING_ACTION,subTitle:Ze.CREATING_ACTION_SUBTITLE},header:{icon:ja,title:Ze.ADD_ACTION,subTitle:Ze.ADD_ACTION_DESCRIPTION},connectionIds:n&&o?{value:n,setValue:o}:void 0,search:{value:d,onChange:u},leftColumn:{width:"40%",list:w},rightColumn:{width:"60%",list:T}})},Ks=({destinationsByCategory:o,filters:i,setFilters:a})=>{const l=c(()=>Object.values(gt).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})).filter(e=>o[e.id]?.length),[o]),r=c(()=>{const e=Object.values($e).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(ft,{placeholder:"Select category",options:l,values:i.categoryType?[i.categoryType]:[],setValues:e=>a({...i,categoryType:i.categoryType===e[0]?null:e[0]})}),t(ce,{options:r,selected:i.signalType,setSelected:e=>a({...i,signalType:e})})]})},Ys=b.div`
68
68
  display: flex;
69
69
  flex-direction: column;
70
70
  padding: 8px;
71
71
  border-radius: 16px;
72
72
  border: ${({$purpleColors:e,theme:t})=>e?`1px solid ${t.v2.colors.purple[500]}`:"1px solid transparent"};
73
73
  background-color: ${({$noBgColor:e,$purpleColors:t,theme:n})=>e?"transparent":t?n.v2.colors.purple[900]:n.v2.colors.silver[800]};
74
- `,Ks=b.div`
74
+ `,Js=b.div`
75
75
  display: flex;
76
76
  align-items: center;
77
77
  justify-content: space-between;
78
78
  gap: 12px;
79
79
  padding: ${({$isOpen:e})=>e?"2px 12px 8px 12px":"2px 12px"};
80
- `,Ys=({title:n,tooltip:o,list:i,noBgColor:l,purpleColors:r})=>{const[s,c]=a(!0);return e(Ws,{"data-id":`collapse-${n}`,$noBgColor:l,$purpleColors:r,children:[e(Ks,{$isOpen:s,children:[e(pe,{$gap:10,children:[t(_e,{size:Te.XS,children:n}),o&&t(Fe,{text:o,withIcon:!0}),t(Ke,{label:i.length,status:r?Ee.Default:void 0})]}),t(bt,{icon:s?ja:Ga,size:vt.M,onClick:()=>c(e=>!e)})]}),s?t(ee,{children:i.length?u.toArray(i):t(mt,{$padding:"12px 0",children:t(xe,{})})}):null]})},Js=(e,t,n)=>t||n.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!n.signalType||Re(e.supportedSignals).includes(n.signalType))):e,qs=({option:e,formData:n,testResult:o,isSelected:i,onSelect:a})=>t(Hs,{icon:St(e.type).icon,title:n?.name||e.displayName,withCarret:!0,purpleColors:!!n,isSelected:i,onClick:()=>a(),children:o&&t(Ke,{status:o.succeeded?Ee.Success:Ee.Error,leftIcon:o.succeeded?Wa:Ka})}),Zs=({listType:e,destinationOptions:n,unsavedDestinations:o})=>{const{activeForm:i,onChangeActiveForm:a}=Hl();return n?.length?t(Ys,{title:Ct[e].TITLE,tooltip:Ct[e].DESCRIPTION,list:n.map((n,o)=>t(qs,{option:n,isSelected:i?.listType===e&&"number"!=typeof i?.unsavedIdx&&(null!=n.id&&""!==n.id?i?.option.id===n.id:i?.option.type===n.type),onSelect:()=>a({listType:e,option:n})},`${e}-${n.id??n.type}-${o}`))}):o?.length?t(Ys,{purpleColors:!0,title:Ct[e].TITLE,tooltip:Ct[e].DESCRIPTION,list:o.map(({option:n,formData:o,testResult:l},r)=>t(qs,{option:n,formData:o,testResult:l,isSelected:i?.unsavedIdx===r&&i?.listType===e,onSelect:()=>a({listType:e,option:n,unsavedIdx:r})},`${e}-${r}`))},e):void 0};var Qs;(e=>{e.SELF_HOSTED="self hosted",e.MANAGED="managed"})(Qs||(Qs={}));const ec=(e,t)=>{const n=[],o=[],i=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===Qs.SELF_HOSTED?o.push(...e.items):e.name===Qs.MANAGED&&i.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const o of e?.destinationCategories?.categories||[]){const e=xt(o),i=e.items.findIndex(e=>e.type===t.type);if(-1!==i){const o=wt(t.fields,{});Object.keys(o).length&&(e.items[i].fields=e.items[i].fields.map(e=>({...e,initialValue:o[e.name]})),n.push(e.items[i]))}}}),{[gt.DETECTED]:n,[gt.SELF_HOSTED]:o,[gt.MANAGED]:i}},tc=({onClose:e,onBack:n,onNext:o,selectedConnectionIds:l,setSelectedConnectionIds:r,initialInputs:s,withOverlay:p,disableAnimation:u})=>{const{destinationsApi:h}=Vl(),[m,g]=a(""),[f,b]=a({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}=Hl();i(()=>{s&&I(s)},[s]);const N=C||x,E=c(()=>y?.destinationCategories?.categories??[],[y]),[O,$]=a({[gt.ALL]:[],[gt.UNSAVED]:[],[gt.EXISTS]:[],[gt.DETECTED]:[],[gt.SELF_HOSTED]:[],[gt.MANAGED]:[]});i(()=>{const e=v.map(e=>{let t;for(const n of E){const o=n.items.find(t=>t.type===e.destinationType.type);if(o){t=o;break}}const n=wt(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,[gt.EXISTS]:e}))},[v,E]),i(()=>{(y||S)&&$(e=>({...e,...ec(y,S)}))},[y,S]);const A=d(async()=>{for(const{option:e,formData:t}of k){const n=De(t);if(e.id){const t=Object.fromEntries(e.fields.map(e=>[e.name,e.initialValue??""])),o=Object.fromEntries(n.fields.map(e=>[e.key,e.value??""]));if(!Object.keys(t).some(e=>t[e]!==o[e])){await h.update(e.id,n);continue}}await h.create(n)}},[k,h]),R=(({isFetching:e,destinationsByCategory:n,searchText:o,filters:i})=>{const{unsavedDestinations:a}=Hl();return{width:"40%",list:c(()=>{const l=[];a.length&&l.push(t(Zs,{listType:gt.UNSAVED,unsavedDestinations:a},"unsaved"));for(const e of Object.values(gt)){if(i.categoryType&&i.categoryType!==e)continue;const a=Js(n[e],o,i);a.length&&l.push(t(Zs,{listType:e,destinationOptions:a},e))}return e&&l.push(t(mt,{$height:"100%",children:t(yt,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),l},[a,n,o,i,e])}})({isFetching:N,destinationsByCategory:O,searchText:m,filters:f}),D=(()=>{const{activeForm:e}=Hl();return{width:"60%",list:e?[t(bs,{},e.option.type)]:[t(mt,{$height:"100%",children:t(xe,{icon:Ha,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})();return t(kr,{isOpen:!0,withOverlay:p,disableAnimation:u,onClose:e,onBack:n?()=>n(k):void 0,onNext:o?()=>o(k):void 0,nextIsSkip:!k.length,onSave:A,disableSave:!w&&!k.length,isFetching:N,isFormDirty:k.length>0||T?.isFormDirty,hideDirtyNote:!0,progress:{title:Ze.CREATING_DESTINATION,subTitle:Ze.CREATING_DESTINATION_SUBTITLE},header:{icon:Ha,title:Ze.ADD_DESTINATIONS,subTitle:Ze.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:l&&r?{value:l,setValue:r}:void 0,search:{value:m,onChange:g},filters:t(Gs,{destinationsByCategory:O,filters:f,setFilters:b}),leftColumn:R,rightColumn:D})},nc=({onClose:e,selectedConnectionIds:n,setSelectedConnectionIds:o,withOverlay:i})=>{const{instrumentationRulesApi:l}=Vl(),[r,s]=a(""),d=p(null),{selectedOption:u,onSelectOption:h,genericForm:m,validateFormData:g}=jl(),{options:f,loading:b}=l.useRuleTypes(),v=c(()=>f.length?f:Tt,[f]),y=c(()=>r?v.filter(e=>e.label.toLowerCase().includes(r.toLowerCase())):v,[v,r]),C=c(()=>b?[t(ut,{$padding:"8px 12px",children:t(ht,{size:4})},"loading")]:y.map(e=>{const n=u?.type===e.type;return t(Hs,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:n,onClick:()=>{d.current?.clearErrors(),h(e)}},e.type)}),[b,u?.type,y,h]),S=c(()=>b?[t(ut,{$padding:"8px 12px",children:t(ht,{size:4})},"loading")]:u?[t(ks,{},u.type)]:[t(mt,{$height:"100%",children:t(xe,{icon:Ya,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[b,u]);return t(kr,{ref:d,isOpen:!0,withOverlay:i,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=g();if(e)return!1;await l.create(t,u?.type)},disableSave:!u||!m?.isFormDirty,isFormDirty:m?.isFormDirty,hideDirtyNote:!0,progress:{title:Ze.CREATING_INSTRUMENTATION_RULE,subTitle:Ze.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:Ya,title:Ze.ADD_INSTRUMENTATION_RULE,subTitle:Ze.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:n&&o?{value:n,setValue:o}:void 0,search:{value:r,onChange:s},leftColumn:{width:"40%",list:C},rightColumn:{width:"60%",list:S}})},oc={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:Ze.FETCHING_NAMESPACES,subTitle:Ze.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:Ze.SELECT_NAMESPACE,subTitle:Ze.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},ic={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===kt.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"},ac=e=>e?ic:oc,lc="No matches",rc=e=>(e?"Unselect":"Select")+" all",sc="Selected",cc=b.div``,dc=b.div`
80
+ `,qs=({title:n,tooltip:o,list:i,noBgColor:l,purpleColors:r})=>{const[s,c]=a(!0);return e(Ys,{"data-id":`collapse-${n}`,$noBgColor:l,$purpleColors:r,children:[e(Js,{$isOpen:s,children:[e(pe,{$gap:10,children:[t(_e,{size:Te.XS,children:n}),o&&t(Fe,{text:o,withIcon:!0}),t(Ke,{label:i.length,status:r?Ee.Default:void 0})]}),t(bt,{icon:s?Wa:Ka,size:vt.M,onClick:()=>c(e=>!e)})]}),s?t(ee,{children:i.length?u.toArray(i):t(mt,{$padding:"12px 0",children:t(xe,{})})}):null]})},Zs=(e,t,n)=>t||n.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!n.signalType||Re(e.supportedSignals).includes(n.signalType))):e,Qs=({option:e,formData:n,testResult:o,isSelected:i,onSelect:a})=>t(Gs,{icon:St(e.type).icon,title:n?.name||e.displayName,withCarret:!0,purpleColors:!!n,isSelected:i,onClick:()=>a(),children:o&&t(Ke,{status:o.succeeded?Ee.Success:Ee.Error,leftIcon:o.succeeded?Ya:Ja})}),ec=({listType:e,destinationOptions:n,unsavedDestinations:o})=>{const{activeForm:i,onChangeActiveForm:a}=Gl();return n?.length?t(qs,{title:Ct[e].TITLE,tooltip:Ct[e].DESCRIPTION,list:n.map((n,o)=>t(Qs,{option:n,isSelected:i?.listType===e&&"number"!=typeof i?.unsavedIdx&&(null!=n.id&&""!==n.id?i?.option.id===n.id:i?.option.type===n.type),onSelect:()=>a({listType:e,option:n})},`${e}-${n.id??n.type}-${o}`))}):o?.length?t(qs,{purpleColors:!0,title:Ct[e].TITLE,tooltip:Ct[e].DESCRIPTION,list:o.map(({option:n,formData:o,testResult:l},r)=>t(Qs,{option:n,formData:o,testResult:l,isSelected:i?.unsavedIdx===r&&i?.listType===e,onSelect:()=>a({listType:e,option:n,unsavedIdx:r})},`${e}-${r}`))},e):void 0};var tc;(e=>{e.SELF_HOSTED="self hosted",e.MANAGED="managed"})(tc||(tc={}));const nc=(e,t)=>{const n=[],o=[],i=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===tc.SELF_HOSTED?o.push(...e.items):e.name===tc.MANAGED&&i.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const o of e?.destinationCategories?.categories||[]){const e=xt(o),i=e.items.findIndex(e=>e.type===t.type);if(-1!==i){const o=wt(t.fields,{});Object.keys(o).length&&(e.items[i].fields=e.items[i].fields.map(e=>({...e,initialValue:o[e.name]})),n.push(e.items[i]))}}}),{[gt.DETECTED]:n,[gt.SELF_HOSTED]:o,[gt.MANAGED]:i}},oc=({onClose:e,onBack:n,onNext:o,selectedConnectionIds:l,setSelectedConnectionIds:r,initialInputs:s,withOverlay:p,disableAnimation:u})=>{const{destinationsApi:h}=jl(),[m,g]=a(""),[f,b]=a({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}=Gl();i(()=>{s&&I(s)},[s]);const N=C||x,E=c(()=>y?.destinationCategories?.categories??[],[y]),[O,$]=a({[gt.ALL]:[],[gt.UNSAVED]:[],[gt.EXISTS]:[],[gt.DETECTED]:[],[gt.SELF_HOSTED]:[],[gt.MANAGED]:[]});i(()=>{const e=v.map(e=>{let t;for(const n of E){const o=n.items.find(t=>t.type===e.destinationType.type);if(o){t=o;break}}const n=wt(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,[gt.EXISTS]:e}))},[v,E]),i(()=>{(y||S)&&$(e=>({...e,...nc(y,S)}))},[y,S]);const A=d(async()=>{for(const{option:e,formData:t}of k){const n=De(t);if(e.id){const t=Object.fromEntries(e.fields.map(e=>[e.name,e.initialValue??""])),o=Object.fromEntries(n.fields.map(e=>[e.key,e.value??""]));if(!Object.keys(t).some(e=>t[e]!==o[e])){await h.update(e.id,n);continue}}await h.create(n)}},[k,h]),R=(({isFetching:e,destinationsByCategory:n,searchText:o,filters:i})=>{const{unsavedDestinations:a}=Gl();return{width:"40%",list:c(()=>{const l=[];a.length&&l.push(t(ec,{listType:gt.UNSAVED,unsavedDestinations:a},"unsaved"));for(const e of Object.values(gt)){if(i.categoryType&&i.categoryType!==e)continue;const a=Zs(n[e],o,i);a.length&&l.push(t(ec,{listType:e,destinationOptions:a},e))}return e&&l.push(t(mt,{$height:"100%",children:t(yt,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),l},[a,n,o,i,e])}})({isFetching:N,destinationsByCategory:O,searchText:m,filters:f}),D=(()=>{const{activeForm:e}=Gl();return{width:"60%",list:e?[t(ys,{},e.option.type)]:[t(mt,{$height:"100%",children:t(xe,{icon:Ga,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})();return t(Nr,{isOpen:!0,withOverlay:p,disableAnimation:u,onClose:e,onBack:n?()=>n(k):void 0,onNext:o?()=>o(k):void 0,nextIsSkip:!k.length,onSave:A,disableSave:!w&&!k.length,isFetching:N,isFormDirty:k.length>0||T?.isFormDirty,hideDirtyNote:!0,progress:{title:Ze.CREATING_DESTINATION,subTitle:Ze.CREATING_DESTINATION_SUBTITLE},header:{icon:Ga,title:Ze.ADD_DESTINATIONS,subTitle:Ze.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:l&&r?{value:l,setValue:r}:void 0,search:{value:m,onChange:g},filters:t(Ks,{destinationsByCategory:O,filters:f,setFilters:b}),leftColumn:R,rightColumn:D})},ic=({onClose:e,selectedConnectionIds:n,setSelectedConnectionIds:o,withOverlay:i})=>{const{isEnterprise:l}=S(),{instrumentationRulesApi:r}=jl(),[s,d]=a(""),u=p(null),{selectedOption:h,onSelectOption:m,genericForm:g,validateFormData:f}=Wl(),{options:b,loading:v}=r.useRuleTypes(),y=c(()=>b.length?b:Tt,[b]),C=c(()=>s?y.filter(e=>e.label.toLowerCase().includes(s.toLowerCase())):y,[y,s]),x=c(()=>v?[t(ut,{$padding:"8px 12px",children:t(ht,{size:4})},"loading")]:C.map(e=>{const n=h?.type===e.type;return t(Gs,{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=c(()=>v?[t(ut,{$padding:"8px 12px",children:t(ht,{size:4})},"loading")]:h?[t(Ns,{},h.type)]:[t(mt,{$height:"100%",children:t(xe,{icon:qa,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[v,h]);return t(Nr,{ref:u,isOpen:!0,withOverlay:i,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=f();if(e)return!1;await r.create(t,h?.type)},disableSave:!h||!g?.isFormDirty||!l,isFormDirty:g?.isFormDirty,hideDirtyNote:!0,forcedNote:{fullWidth:!0,status:Ee.Warning,message:"This feature is only supported for OnPrem (Enterprise) installations"},progress:{title:Ze.CREATING_INSTRUMENTATION_RULE,subTitle:Ze.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:qa,title:Ze.ADD_INSTRUMENTATION_RULE,subTitle:Ze.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:n&&o?{value:n,setValue:o}:void 0,search:{value:s,onChange:d},leftColumn:{width:"40%",list:x},rightColumn:{width:"60%",list:w}})},ac={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:Ze.FETCHING_NAMESPACES,subTitle:Ze.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:Ze.SELECT_NAMESPACE,subTitle:Ze.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},lc={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===kt.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"},rc=e=>e?lc:ac,sc="No matches",cc=e=>(e?"Unselect":"Select")+" all",dc="Selected",pc=b.div``,uc=b.div`
81
81
  visibility: hidden;
82
82
 
83
83
  transition: visibility 0s;
@@ -85,17 +85,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
85
85
  transition-duration: 0s;
86
86
  }
87
87
 
88
- ${cc}:hover & {
88
+ ${pc}:hover & {
89
89
  visibility: visible;
90
90
  }
91
- `,pc=({workloadName:e,workloadKind:n,isChecked:o,onToggle:i,disabled:a})=>{const l=v(),r=()=>{};return t(cc,{children:t(Hs,{dataId:`source-${e}`,title:e,disabled:a,onClick:a?r:i,isChecked:o,onCheckboxChange:a?r:i,children:a?t(Fe,{text:"Static pods can only be instrumented with Odigos Enterprise.",children:t(Ke,{label:"Enterprise only",status:Ee.Default,textSize:Te.XXXS})}):t(dc,{children:t(Ke,{label:n,status:Ee.Info,textSize:Te.XXXS,backgroundColor:l.v2.colors.blue[900]})})})})},uc=b.div``,hc=b.div`
91
+ `,hc=({workloadName:e,workloadKind:n,isChecked:o,onToggle:i,disabled:a})=>{const l=v(),r=()=>{};return t(pc,{children:t(Gs,{dataId:`source-${e}`,title:e,disabled:a,onClick:a?r:i,isChecked:o,onCheckboxChange:a?r:i,children:a?t(Fe,{text:"Static pods can only be instrumented with Odigos Enterprise.",children:t(Ke,{label:"Enterprise only",status:Ee.Default,textSize:Te.XXXS})}):t(uc,{children:t(Ke,{label:n,status:Ee.Info,textSize:Te.XXXS,backgroundColor:l.v2.colors.blue[900]})})})})},mc=b.div``,gc=b.div`
92
92
  display: grid;
93
93
  /* Auto: "Auto" label + S toggle ≈ 72px. Selected: label + count badge ≈ 110px. */
94
94
  grid-template-columns: ${({$withAuto:e})=>e?"72px 110px":"110px"};
95
95
  align-items: center;
96
96
  column-gap: 12px;
97
97
  flex-shrink: 0;
98
- `,mc=b.div`
98
+ `,fc=b.div`
99
99
  display: flex;
100
100
  justify-content: flex-end;
101
101
  align-items: center;
@@ -110,17 +110,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
110
110
  transition: visibility 0s;
111
111
  ${({$visible:e})=>!e&&"& * {\n transition-duration: 0s !important;\n }"}
112
112
 
113
- ${uc}:hover & {
113
+ ${mc}:hover & {
114
114
  visibility: visible;
115
115
  pointer-events: auto;
116
116
  }
117
- `,gc=b(pe)`
117
+ `,bc=b(pe)`
118
118
  width: 100%;
119
119
  gap: 8px;
120
120
  justify-content: flex-end;
121
121
  align-items: center;
122
122
  min-width: 0;
123
- `,fc=({clusterId:n,namespaceName:o,checkbox:i,isFutureApps:a,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{capabilities:d}=Vl(),p=d.canInstrumentNamespaces,u=e=>{s(),c({clusterId:n,workloadId:{namespace:o},auto:e.auto,selected:e.all})};return t(uc,{children:t(Hs,{dataId:`namespace-${o}`,withCarret:!0,title:o,isSelected:r,onClick:s,isPartiallyChecked:i.partial,isChecked:i.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(hc,{$withAuto:p,children:[p&&t(mc,{$visible:r||a,children:t(Fe,{text:"Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",children:t(le,{label:"Auto",labelAlign:re.Left,size:Nt.S,value:a,onChange:e=>u({auto:e,all:e||void 0})})})}),e(gc,{children:[t(_e,{variant:Et.Span,size:Te.XXXS,color:Pe.Secondary,align:"right",nowrap:!0,children:sc}),t(Ke,{label:`${l.sourced}/${l.total}`,status:r?Ee.Default:Ee.Unknown,minWidth:"42px"})]})]})})})},bc=({withCollapse:e,clusterId:n,clusterName:o,namespaces:i,selectedArea:a,setSelectedArea:l,handleSourceChange:r})=>{const s=c(()=>i.map(({name:e,totalWorkloads:i,selectedCount:s,isAllSourced:c,isSomeSourced:d,isFutureApps:p})=>t(fc,{clusterId:n,namespaceName:e,isFutureApps:p,checkbox:{all:c||p,partial:d},selectedCounts:{sourced:s,total:i},isActive:a.clusterId===n&&a.namespaceName===e,onActive:()=>l({clusterId:n,clusterName:o,namespaceName:e}),handleSourceChange:r},`${n}#${e}`)),[n,o,i,a]);return e?t(Ys,{title:o,list:s,noBgColor:!0}):s},vc=({onClose:n,onBack:o,onNext:l,selectedConnectionIds:r,setSelectedConnectionIds:s,withOverlay:d,disableAnimation:p})=>{const{isVm:u,isConnector:h}=S(),{sourcesApi:m,snapshotsApi:g,namespacesApi:f}=Vl(),{data:b,loading:v,refetch:y}=g.useSnapshots(),{items:C,loading:x,refetch:w}=f.useNamespaces(),T=ac(u||!!h),{selectedStreamName:k}=Qe(),{progress:I,resetProgress:N}=Ot(),{isFetching:E,setIsFetching:O,setSnapshots:$,formData:A,handleSourceChange:R,handleSelectAll:D,formDiff:_,isFormDirty:P}=er();i(()=>{y(),w()},[]);const L=c(()=>{if(b)return b;const e=C;return e.length?{clusters:[{clusterId:At,clusterName:$t,namespaces:e.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(k),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,region:e.id.region,selected:(e.markedForInstrumentation?.markedForInstrumentation??!1)&&(e.dataStreamNames?.includes(k)??!1)}))||[]}))}]}:null},[b,C,k]);i(()=>{O(v||x),L&&$(L)},[L,v,x,O,$]);const[F,M]=a(""),[z,B]=a(kt.Namespace),[X,U]=a({showOnlySelected:!1}),[V,H]=a({clusterId:"",clusterName:"",namespaceName:""}),j=(({isFetching:n,formData:o,handleSourceChange:i,handleSelectAll:a,selectedArea:l,setSelectedArea:r,searchText:s,searchBy:d,filters:p})=>{const{isVm:u,isConnector:h}=S(),m=ac(u||!!h),g=c(()=>o.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Zl(e,s,p)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...Ql(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[o,s,p]),f=c(()=>{let e=!1;for(const{visibleNamespaces:t}of g)for(const{totalWorkloads:n,selectedCount:o}of t)if(e=!0,o!==n)return!1;return e},[g]),{list:b,withFilterCount:v,filteredCount:y,totalCount:C}=c(()=>{const e=g.map(({clusterId:e,clusterName:n,visibleNamespaces:o})=>o.length?t(bc,{withCollapse:g.length>1,clusterId:e,clusterName:n,namespaces:o,selectedArea:l,setSelectedArea:r,handleSourceChange:i},e):null).filter(e=>null!==e),n=g.reduce((e,{visibleNamespaces:t})=>e+t.length,0),a=o.reduce((e,{namespaces:t})=>e+t.length,0);return{list:e,withFilterCount:n!==a,filteredCount:n,totalCount:a}},[g,o,l]);return{width:"60%",header:e(pe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(pe,{$gap:8,children:[t(_e,{size:Te.XS,nowrap:!0,children:m.groupColumnHeader}),t(Fe,{text:v?Ze.FILTERED_COUNT_TOOLTIP:void 0,children:t(Ke,{label:`${v?`${y} / ${C}`:C}`,status:Ee.Unknown})})]}),t(_e,{"data-id":"namespaces-select-all",onClick:()=>a({boolean:!f,searchText:s,searchBy:d,filters:p}),disabled:!b.length,size:Te.XS,children:rc(f)})]}),list:b.length?b:n?[t(mt,{$height:"100%",children:t(yt,{title:m.fetchingGroups.title,subTitle:m.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(mt,{$height:"100%",children:t(xe,s?{icon:qa,title:lc,subTitle:m.noGroupMatchedFilter(s)}:{icon:qa,title:m.noGroups.title,subTitle:m.noGroups.subTitle})},"no-data")]}})({isFetching:E,formData:A,handleSourceChange:R,handleSelectAll:D,selectedArea:V,setSelectedArea:H,searchText:z===kt.Namespace?F:"",searchBy:z,filters:X}),G=(({formData:n,handleSourceChange:o,handleSelectAll:i,selectedArea:a,searchText:l,searchBy:r,filters:s})=>{const{tier:d,isVm:p,isConnector:u,isK8s:h}=S(),m=ac(p||!!u),g=d===It.Onprem,f=c(()=>a.value.namespaceName?n.find(({clusterId:e})=>e===a.value.clusterId)?.namespaces.find(({name:e})=>e===a.value.namespaceName):void 0,[n,a.value.clusterId,a.value.namespaceName]),b=c(()=>f?[...f.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Jl(e,l,s)):[],[f,l,s]),v=c(()=>!!b.length&&b.every(({selected:e})=>e),[b]),y=c(()=>{if(!f)return[];const{clusterId:e}=a.value,{name:n}=f;return b.map(({name:i,selected:a,kind:l,region:r})=>{const s=h&&!g&&ql.has(l);return t(pc,{workloadName:i,workloadKind:l,isChecked:!s&&(a||!1),onToggle:()=>o({clusterId:e,workloadId:{namespace:n,name:i,kind:l,region:r}}),disabled:s},`${e}#${n}#${i}#${l}#${r??""}`)})},[b,f,a.value.clusterId,o,h,g]),{withFilterCount:C,filteredCount:x,totalCount:w}=c(()=>{const e=f?.workloads.length??0;return{withFilterCount:b.length!==e,filteredCount:b.length,totalCount:e}},[b,f]);return{width:"40%",header:e(pe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(pe,{$gap:8,children:[t(_e,{size:Te.XS,nowrap:!0,children:a.value.namespaceName?`${a.value.namespaceName} > ${m.itemColumnHeader}`:m.itemColumnHeader}),t(Fe,{text:C?Ze.FILTERED_COUNT_TOOLTIP:void 0,children:t(Ke,{label:`${C?`${x} / ${w}`:w}`,status:Ee.Unknown})})]}),t(_e,{"data-id":"workloads-select-all",onClick:()=>i({clusterId:a.value.clusterId,namespaceName:a.value.namespaceName,boolean:!v,searchText:l,searchBy:r,filters:s}),disabled:!y.length,size:Te.XS,children:rc(v)})]}),list:y.length?y:[t(mt,{$height:"100%",children:t(xe,f?l?{icon:Ja,title:lc,subTitle:(T=l,`No sources matched the filter '${T}'`)}:{icon:Ja,title:"No sources",subTitle:m.noItemsInGroupSubTitle}:{icon:Ja,title:m.selectGroupPrompt.title,subTitle:m.selectGroupPrompt.subTitle})},"no-data")]};var T})({formData:A,handleSourceChange:R,handleSelectAll:D,selectedArea:{value:V},searchText:z===kt.Source?F:"",searchBy:z,filters:X});return t(kr,{isOpen:!0,withOverlay:d,disableAnimation:p,onClose:n?()=>{N(Rt.BulkInstrumenting),n()}:void 0,onBack:o?()=>o(_):void 0,onNext:l?()=>l(_):void 0,nextIsSkip:!P,onSave:()=>m.persistV2(_),header:{icon:Ja,title:Ze.ADD_SOURCE,subTitle:Ze.ADD_SOURCES_DESCRIPTION},connectionIds:r&&s?{value:r,setValue:s}:void 0,search:{value:F,onChange:e=>{M(e),z===kt.Namespace&&H({clusterId:"",clusterName:"",namespaceName:""})},placeholder:T.searchPlaceholder(z),segment:{options:[{label:T.groupSegmentLabel,value:kt.Namespace},{label:T.itemSegmentLabel,value:kt.Source}],selected:z,setSelected:B}},filters:e(pe,{$gap:8,children:[t(_e,{size:Te.XXXS,color:Pe.Secondary,nowrap:!0,children:"Show only:"}),t(le,{name:"filter-selected",size:Nt.S,label:sc,value:X.showOnlySelected,onChange:e=>U(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:P,isFetching:E,progress:{title:Ze.CREATING_SOURCES,subTitle:Ze.CREATING_SOURCES_SUBTITLE,percentage:I[Rt.BulkInstrumenting]?.percentage||0},leftColumn:j,rightColumn:G})},yc={aws:el,gcp:Qa,azure:Za},Cc={lambda:"Lambda","fargate-task":"ECS","fargate-cluster":"ECS","ecs-cluster":"ECS",eks:"EKS",ec2:"EC2"},Sc=e=>e.split(/[-_]/).map(e=>e?e[0].toUpperCase()+e.slice(1):e).join(" "),xc=e=>e.provider.toUpperCase(),wc=b.div`
123
+ `,vc=({clusterId:n,namespaceName:o,checkbox:i,isFutureApps:a,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{capabilities:d}=jl(),p=d.canInstrumentNamespaces,u=e=>{s(),c({clusterId:n,workloadId:{namespace:o},auto:e.auto,selected:e.all})};return t(mc,{children:t(Gs,{dataId:`namespace-${o}`,withCarret:!0,title:o,isSelected:r,onClick:s,isPartiallyChecked:i.partial,isChecked:i.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(gc,{$withAuto:p,children:[p&&t(fc,{$visible:r||a,children:t(Fe,{text:"Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",children:t(le,{label:"Auto",labelAlign:re.Left,size:Nt.S,value:a,onChange:e=>u({auto:e,all:e||void 0})})})}),e(bc,{children:[t(_e,{variant:Et.Span,size:Te.XXXS,color:Pe.Secondary,align:"right",nowrap:!0,children:dc}),t(Ke,{label:`${l.sourced}/${l.total}`,status:r?Ee.Default:Ee.Unknown,minWidth:"42px"})]})]})})})},yc=({withCollapse:e,clusterId:n,clusterName:o,namespaces:i,selectedArea:a,setSelectedArea:l,handleSourceChange:r})=>{const s=c(()=>i.map(({name:e,totalWorkloads:i,selectedCount:s,isAllSourced:c,isSomeSourced:d,isFutureApps:p})=>t(vc,{clusterId:n,namespaceName:e,isFutureApps:p,checkbox:{all:c||p,partial:d},selectedCounts:{sourced:s,total:i},isActive:a.clusterId===n&&a.namespaceName===e,onActive:()=>l({clusterId:n,clusterName:o,namespaceName:e}),handleSourceChange:r},`${n}#${e}`)),[n,o,i,a]);return e?t(qs,{title:o,list:s,noBgColor:!0}):s},Cc=({onClose:n,onBack:o,onNext:l,selectedConnectionIds:r,setSelectedConnectionIds:s,withOverlay:d,disableAnimation:p})=>{const{isVm:u,isConnector:h}=S(),{sourcesApi:m,snapshotsApi:g,namespacesApi:f}=jl(),{data:b,loading:v,refetch:y}=g.useSnapshots(),{items:C,loading:x,refetch:w}=f.useNamespaces(),T=rc(u||!!h),{selectedStreamName:k}=Qe(),{progress:I,resetProgress:N}=Ot(),{isFetching:E,setIsFetching:O,setSnapshots:$,formData:A,handleSourceChange:R,handleSelectAll:D,formDiff:_,isFormDirty:P}=nr();i(()=>{y(),w()},[]);const L=c(()=>{if(b)return b;const e=C;return e.length?{clusters:[{clusterId:At,clusterName:$t,namespaces:e.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(k),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,region:e.id.region,selected:(e.markedForInstrumentation?.markedForInstrumentation??!1)&&(e.dataStreamNames?.includes(k)??!1)}))||[]}))}]}:null},[b,C,k]);i(()=>{O(v||x),L&&$(L)},[L,v,x,O,$]);const[F,M]=a(""),[z,B]=a(kt.Namespace),[X,U]=a({showOnlySelected:!1}),[V,H]=a({clusterId:"",clusterName:"",namespaceName:""}),j=(({isFetching:n,formData:o,handleSourceChange:i,handleSelectAll:a,selectedArea:l,setSelectedArea:r,searchText:s,searchBy:d,filters:p})=>{const{isVm:u,isConnector:h}=S(),m=rc(u||!!h),g=c(()=>o.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>er(e,s,p)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...tr(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[o,s,p]),f=c(()=>{let e=!1;for(const{visibleNamespaces:t}of g)for(const{totalWorkloads:n,selectedCount:o}of t)if(e=!0,o!==n)return!1;return e},[g]),{list:b,withFilterCount:v,filteredCount:y,totalCount:C}=c(()=>{const e=g.map(({clusterId:e,clusterName:n,visibleNamespaces:o})=>o.length?t(yc,{withCollapse:g.length>1,clusterId:e,clusterName:n,namespaces:o,selectedArea:l,setSelectedArea:r,handleSourceChange:i},e):null).filter(e=>null!==e),n=g.reduce((e,{visibleNamespaces:t})=>e+t.length,0),a=o.reduce((e,{namespaces:t})=>e+t.length,0);return{list:e,withFilterCount:n!==a,filteredCount:n,totalCount:a}},[g,o,l]);return{width:"60%",header:e(pe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(pe,{$gap:8,children:[t(_e,{size:Te.XS,nowrap:!0,children:m.groupColumnHeader}),t(Fe,{text:v?Ze.FILTERED_COUNT_TOOLTIP:void 0,children:t(Ke,{label:`${v?`${y} / ${C}`:C}`,status:Ee.Unknown})})]}),t(_e,{"data-id":"namespaces-select-all",onClick:()=>a({boolean:!f,searchText:s,searchBy:d,filters:p}),disabled:!b.length,size:Te.XS,children:cc(f)})]}),list:b.length?b:n?[t(mt,{$height:"100%",children:t(yt,{title:m.fetchingGroups.title,subTitle:m.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(mt,{$height:"100%",children:t(xe,s?{icon:Qa,title:sc,subTitle:m.noGroupMatchedFilter(s)}:{icon:Qa,title:m.noGroups.title,subTitle:m.noGroups.subTitle})},"no-data")]}})({isFetching:E,formData:A,handleSourceChange:R,handleSelectAll:D,selectedArea:V,setSelectedArea:H,searchText:z===kt.Namespace?F:"",searchBy:z,filters:X}),G=(({formData:n,handleSourceChange:o,handleSelectAll:i,selectedArea:a,searchText:l,searchBy:r,filters:s})=>{const{tier:d,isVm:p,isConnector:u,isK8s:h}=S(),m=rc(p||!!u),g=d===It.Onprem,f=c(()=>a.value.namespaceName?n.find(({clusterId:e})=>e===a.value.clusterId)?.namespaces.find(({name:e})=>e===a.value.namespaceName):void 0,[n,a.value.clusterId,a.value.namespaceName]),b=c(()=>f?[...f.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Zl(e,l,s)):[],[f,l,s]),v=c(()=>!!b.length&&b.every(({selected:e})=>e),[b]),y=c(()=>{if(!f)return[];const{clusterId:e}=a.value,{name:n}=f;return b.map(({name:i,selected:a,kind:l,region:r})=>{const s=h&&!g&&Ql.has(l);return t(hc,{workloadName:i,workloadKind:l,isChecked:!s&&(a||!1),onToggle:()=>o({clusterId:e,workloadId:{namespace:n,name:i,kind:l,region:r}}),disabled:s},`${e}#${n}#${i}#${l}#${r??""}`)})},[b,f,a.value.clusterId,o,h,g]),{withFilterCount:C,filteredCount:x,totalCount:w}=c(()=>{const e=f?.workloads.length??0;return{withFilterCount:b.length!==e,filteredCount:b.length,totalCount:e}},[b,f]);return{width:"40%",header:e(pe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(pe,{$gap:8,children:[t(_e,{size:Te.XS,nowrap:!0,children:a.value.namespaceName?`${a.value.namespaceName} > ${m.itemColumnHeader}`:m.itemColumnHeader}),t(Fe,{text:C?Ze.FILTERED_COUNT_TOOLTIP:void 0,children:t(Ke,{label:`${C?`${x} / ${w}`:w}`,status:Ee.Unknown})})]}),t(_e,{"data-id":"workloads-select-all",onClick:()=>i({clusterId:a.value.clusterId,namespaceName:a.value.namespaceName,boolean:!v,searchText:l,searchBy:r,filters:s}),disabled:!y.length,size:Te.XS,children:cc(v)})]}),list:y.length?y:[t(mt,{$height:"100%",children:t(xe,f?l?{icon:Za,title:sc,subTitle:(T=l,`No sources matched the filter '${T}'`)}:{icon:Za,title:"No sources",subTitle:m.noItemsInGroupSubTitle}:{icon:Za,title:m.selectGroupPrompt.title,subTitle:m.selectGroupPrompt.subTitle})},"no-data")]};var T})({formData:A,handleSourceChange:R,handleSelectAll:D,selectedArea:{value:V},searchText:z===kt.Source?F:"",searchBy:z,filters:X});return t(Nr,{isOpen:!0,withOverlay:d,disableAnimation:p,onClose:n?()=>{N(Rt.BulkInstrumenting),n()}:void 0,onBack:o?()=>o(_):void 0,onNext:l?()=>l(_):void 0,nextIsSkip:!P,onSave:()=>m.persistV2(_),header:{icon:Za,title:Ze.ADD_SOURCE,subTitle:Ze.ADD_SOURCES_DESCRIPTION},connectionIds:r&&s?{value:r,setValue:s}:void 0,search:{value:F,onChange:e=>{M(e),z===kt.Namespace&&H({clusterId:"",clusterName:"",namespaceName:""})},placeholder:T.searchPlaceholder(z),segment:{options:[{label:T.groupSegmentLabel,value:kt.Namespace},{label:T.itemSegmentLabel,value:kt.Source}],selected:z,setSelected:B}},filters:e(pe,{$gap:8,children:[t(_e,{size:Te.XXXS,color:Pe.Secondary,nowrap:!0,children:"Show only:"}),t(le,{name:"filter-selected",size:Nt.S,label:dc,value:X.showOnlySelected,onChange:e=>U(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:P,isFetching:E,progress:{title:Ze.CREATING_SOURCES,subTitle:Ze.CREATING_SOURCES_SUBTITLE,percentage:I[Rt.BulkInstrumenting]?.percentage||0},leftColumn:j,rightColumn:G})},Sc={aws:nl,gcp:tl,azure:el},xc={lambda:"Lambda","fargate-task":"ECS","fargate-cluster":"ECS","ecs-cluster":"ECS",eks:"EKS",ec2:"EC2"},wc=e=>e.split(/[-_]/).map(e=>e?e[0].toUpperCase()+e.slice(1):e).join(" "),Tc=e=>e.provider.toUpperCase(),kc=b.div`
124
124
  display: flex;
125
125
  flex-direction: column;
126
126
  gap: 8px;
@@ -128,7 +128,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
128
128
  padding: 8px 12px;
129
129
  border-radius: 16px 0 0 16px;
130
130
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
131
- `,Tc=b.button`
131
+ `,Ic=b.button`
132
132
  display: flex;
133
133
  align-items: center;
134
134
  gap: 12px;
@@ -144,7 +144,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
144
144
  &:hover {
145
145
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
146
146
  }
147
- `,kc=b.div`
147
+ `,Nc=b.div`
148
148
  display: flex;
149
149
  align-items: center;
150
150
  justify-content: center;
@@ -153,13 +153,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
153
153
  border-radius: 8px;
154
154
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
155
155
  flex-shrink: 0;
156
- `,Ic=b.div`
156
+ `,Ec=b.div`
157
157
  display: flex;
158
158
  flex-direction: column;
159
159
  gap: 2px;
160
160
  flex: 1;
161
161
  min-width: 0;
162
- `,Nc=({providers:n,selectedProvider:o,onSelect:i})=>{const a=v();return n.length?t(wc,{children:n.map(n=>{const l=(e=>yc[e.provider]??tl)(n),r=n.provider===o,s=(e=>{const t=e.features.find(e=>e.key===Dt.Discovery);if(!t)return"";const n=[],o=new Set;for(const e of t.types){const t=e.name.includes(".")?e.name.slice(e.name.indexOf(".")+1):e.name,i=Cc[t]??Sc(t);o.has(i)||(o.add(i),n.push(i))}return n.join(", ")})(n);return e(Tc,{type:"button",$selected:r,onClick:()=>i(n.provider),"data-id":`cloud-connector-provider-${n.provider}`,children:[t(kc,{children:t(l,{size:24})}),e(Ic,{children:[t(_e,{size:Te.S,weight:400,lineHeight:"24px",color:Pe.Primary,children:xc(n)}),s&&t(_e,{size:Te.XXXS,weight:400,lineHeight:"normal",color:Pe.Secondary,children:s})]}),t(Ua,{size:18,fill:a.v2.colors.silver[300]})]},n.provider)})}):t(_e,{size:Te.XS,color:Pe.Secondary,children:"No providers available."})},Ec=b.div`
162
+ `,Oc=({providers:n,selectedProvider:o,onSelect:i})=>{const a=v();return n.length?t(kc,{children:n.map(n=>{const l=(e=>Sc[e.provider]??ol)(n),r=n.provider===o,s=(e=>{const t=e.features.find(e=>e.key===Dt.Discovery);if(!t)return"";const n=[],o=new Set;for(const e of t.types){const t=e.name.includes(".")?e.name.slice(e.name.indexOf(".")+1):e.name,i=xc[t]??wc(t);o.has(i)||(o.add(i),n.push(i))}return n.join(", ")})(n);return e(Ic,{type:"button",$selected:r,onClick:()=>i(n.provider),"data-id":`cloud-connector-provider-${n.provider}`,children:[t(Nc,{children:t(l,{size:24})}),e(Ec,{children:[t(_e,{size:Te.S,weight:400,lineHeight:"24px",color:Pe.Primary,children:Tc(n)}),s&&t(_e,{size:Te.XXXS,weight:400,lineHeight:"normal",color:Pe.Secondary,children:s})]}),t(Ha,{size:18,fill:a.v2.colors.silver[300]})]},n.provider)})}):t(_e,{size:Te.XS,color:Pe.Secondary,children:"No providers available."})},$c=b.div`
163
163
  display: flex;
164
164
  flex-direction: column;
165
165
  gap: 8px;
@@ -169,15 +169,15 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
169
169
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
170
170
  border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
171
171
  cursor: default;
172
- `,Oc=b.div`
172
+ `,Ac=b.div`
173
173
  display: flex;
174
174
  align-items: center;
175
175
  gap: 4px;
176
176
  width: 100%;
177
- `,$c=b.div`
177
+ `,Rc=b.div`
178
178
  flex: 1;
179
179
  min-width: 0;
180
- `,Ac=b.div`
180
+ `,Dc=b.div`
181
181
  width: 100%;
182
182
  max-height: 145px;
183
183
  overflow: auto;
@@ -199,39 +199,39 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
199
199
  transition: background-color 0.2s ease;
200
200
  }
201
201
 
202
- ${Ec}:hover & {
202
+ ${$c}:hover & {
203
203
  scrollbar-color: ${({theme:e})=>e.v2.colors.silver[300]} transparent;
204
204
  }
205
205
 
206
- ${Ec}:hover &::-webkit-scrollbar-thumb {
206
+ ${$c}:hover &::-webkit-scrollbar-thumb {
207
207
  background-color: ${({theme:e})=>e.v2.colors.silver[300]};
208
208
  }
209
- `,Rc=b.pre`
209
+ `,_c=b.pre`
210
210
  margin: 0;
211
211
  font-family: ${({theme:e})=>e.font_family.code};
212
212
  font-size: 12px;
213
213
  line-height: 20px;
214
214
  color: ${({theme:e})=>e.v2.colors.green[400]};
215
215
  white-space: pre;
216
- `,Dc=({policy:n})=>{const o=v(),{CopyButton:i}=_t();return e(Ec,{children:[e(Oc,{children:[t(nl,{size:16,fill:o.v2.colors.silver[200]}),t($c,{children:t(_e,{size:Te.XXS,color:Pe.Primary,children:Ze.CLOUD_CONNECTOR_POLICY_PREVIEW})}),t(i,{value:n,size:vt.XS})]}),t(Ac,{children:t(Rc,{children:n})})]})};var _c;(e=>{e.DiscoveryOnly="discovery-only",e.DiscoveryInstrumentation="discovery-instrumentation",e.Custom="custom"})(_c||(_c={}));const Pc=[{id:_c.DiscoveryOnly,title:Ze.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_TITLE,description:Ze.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_DESC,featureKeys:[Dt.Discovery]},{id:_c.DiscoveryInstrumentation,title:Ze.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_TITLE,description:Ze.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_DESC,featureKeys:[Dt.Discovery,Dt.Instrumentation]},{id:_c.Custom,title:Ze.CLOUD_CONNECTOR_PERMISSION_CUSTOM_TITLE,description:Ze.CLOUD_CONNECTOR_PERMISSION_CUSTOM_DESC,featureKeys:[]}],Lc=(e,t)=>e.features?.find(e=>e.key===t),Fc=e=>{if(!e)return[];const t=Lc(e,Dt.Discovery),n=Lc(e,Dt.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}}):[]},Mc=()=>{const e=new Set,t=[];return{out:t,add:n=>n?.forEach(n=>{n&&!e.has(n)&&(e.add(n),t.push(n))})}},zc=(e,t,n)=>{const o=t===_c.Custom?((e,t)=>{if(!e)return[];const n=Fc(e),o=Lc(e,Dt.Discovery),i=n.some(e=>t[e.typeName]?.discovery),{out:a,add:l}=Mc();return l(e.auth?.permissions),i&&l(o?.permissions),n.forEach(e=>{const n=t[e.typeName];n?.discovery&&l(e.discoveryPermissions),n?.instrumentation&&l(e.instrumentationPermissions)}),a})(e,n??{}):((e,t)=>{if(!e)return[];const n=Pc.find(e=>e.id===t)?.featureKeys??[],{out:o,add:i}=Mc();return i(e.auth?.permissions),e.features?.forEach(e=>{e.enabled&&n.includes(e.key)&&(i(e.permissions),e.types?.forEach(e=>{!1!==e.implemented&&i(e.permissions)}))}),o})(e,t),i={Version:"2012-10-17",Statement:[{Sid:"OdigosCloudConnector",Effect:"Allow",Action:o,Resource:"*"}]};return JSON.stringify(i,null,2)},Bc=b.div`
216
+ `,Pc=({policy:n})=>{const o=v(),{CopyButton:i}=_t();return e($c,{children:[e(Ac,{children:[t(il,{size:16,fill:o.v2.colors.silver[200]}),t(Rc,{children:t(_e,{size:Te.XXS,color:Pe.Primary,children:Ze.CLOUD_CONNECTOR_POLICY_PREVIEW})}),t(i,{value:n,size:vt.XS})]}),t(Dc,{children:t(_c,{children:n})})]})};var Lc;(e=>{e.DiscoveryOnly="discovery-only",e.DiscoveryInstrumentation="discovery-instrumentation",e.Custom="custom"})(Lc||(Lc={}));const Fc=[{id:Lc.DiscoveryOnly,title:Ze.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_TITLE,description:Ze.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_DESC,featureKeys:[Dt.Discovery]},{id:Lc.DiscoveryInstrumentation,title:Ze.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_TITLE,description:Ze.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_DESC,featureKeys:[Dt.Discovery,Dt.Instrumentation]},{id:Lc.Custom,title:Ze.CLOUD_CONNECTOR_PERMISSION_CUSTOM_TITLE,description:Ze.CLOUD_CONNECTOR_PERMISSION_CUSTOM_DESC,featureKeys:[]}],Mc=(e,t)=>e.features?.find(e=>e.key===t),zc=e=>{if(!e)return[];const t=Mc(e,Dt.Discovery),n=Mc(e,Dt.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}}):[]},Bc=()=>{const e=new Set,t=[];return{out:t,add:n=>n?.forEach(n=>{n&&!e.has(n)&&(e.add(n),t.push(n))})}},Xc=(e,t,n)=>{const o=t===Lc.Custom?((e,t)=>{if(!e)return[];const n=zc(e),o=Mc(e,Dt.Discovery),i=n.some(e=>t[e.typeName]?.discovery),{out:a,add:l}=Bc();return l(e.auth?.permissions),i&&l(o?.permissions),n.forEach(e=>{const n=t[e.typeName];n?.discovery&&l(e.discoveryPermissions),n?.instrumentation&&l(e.instrumentationPermissions)}),a})(e,n??{}):((e,t)=>{if(!e)return[];const n=Fc.find(e=>e.id===t)?.featureKeys??[],{out:o,add:i}=Bc();return i(e.auth?.permissions),e.features?.forEach(e=>{e.enabled&&n.includes(e.key)&&(i(e.permissions),e.types?.forEach(e=>{!1!==e.implemented&&i(e.permissions)}))}),o})(e,t),i={Version:"2012-10-17",Statement:[{Sid:"OdigosCloudConnector",Effect:"Allow",Action:o,Resource:"*"}]};return JSON.stringify(i,null,2)},Uc=b.div`
217
217
  width: 100%;
218
218
  padding: 12px 16px;
219
219
  border-radius: 12px;
220
220
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
221
221
  border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
222
- `,Xc=b.div`
222
+ `,Vc=b.div`
223
223
  display: grid;
224
224
  grid-template-columns: minmax(0, 1fr) 120px 150px;
225
225
  align-items: center;
226
226
  row-gap: 16px;
227
227
  column-gap: 8px;
228
- `,Uc=b.div`
228
+ `,Hc=b.div`
229
229
  display: flex;
230
230
  align-items: center;
231
231
  min-width: 0;
232
- `,Vc=b(Uc)`
232
+ `,jc=b(Hc)`
233
233
  justify-content: center;
234
- `,Hc={discovery:!1,instrumentation:!1},jc=({provider:n,capabilities:i,onCapabilitiesChange:a})=>{const l=Fc(n),r=(e,t)=>{a({...i,[e]:t})};return l.length?t(Bc,{children:e(Xc,{children:[t(Uc,{children:t(_e,{size:Te.XXS,color:Pe.Secondary,children:Ze.CLOUD_CONNECTOR_CUSTOM_COL_TYPE})}),t(Vc,{children:t(_e,{size:Te.XXS,color:Pe.Secondary,children:Ze.CLOUD_CONNECTOR_CUSTOM_COL_DISCOVERY})}),t(Vc,{children:t(_e,{size:Te.XXS,color:Pe.Secondary,children:Ze.CLOUD_CONNECTOR_CUSTOM_COL_INSTRUMENTATION})}),l.map(n=>{const a=i[n.typeName]??Hc,l=void 0!==n.instrumentationPermissions,s=a.instrumentation||a.discovery;return e(o.Fragment,{children:[t(Uc,{children:t(_e,{size:Te.XXS,weight:400,lineHeight:"normal",color:Pe.Primary,children:n.displayName})}),t(Vc,{children:t(le,{name:`cloud-connector-custom-${n.typeName}-discovery`,size:Nt.S,value:s,disabled:a.instrumentation,onChange:e=>r(n.typeName,{discovery:e,instrumentation:a.instrumentation})})}),t(Vc,{children:t(le,{name:`cloud-connector-custom-${n.typeName}-instrumentation`,size:Nt.S,value:a.instrumentation,disabled:!l,onChange:e=>r(n.typeName,{discovery:!!e||a.discovery,instrumentation:e})})})]},n.typeName)})]})}):null},Gc=b.div`
234
+ `,Gc={discovery:!1,instrumentation:!1},Wc=({provider:n,capabilities:i,onCapabilitiesChange:a})=>{const l=zc(n),r=(e,t)=>{a({...i,[e]:t})};return l.length?t(Uc,{children:e(Vc,{children:[t(Hc,{children:t(_e,{size:Te.XXS,color:Pe.Secondary,children:Ze.CLOUD_CONNECTOR_CUSTOM_COL_TYPE})}),t(jc,{children:t(_e,{size:Te.XXS,color:Pe.Secondary,children:Ze.CLOUD_CONNECTOR_CUSTOM_COL_DISCOVERY})}),t(jc,{children:t(_e,{size:Te.XXS,color:Pe.Secondary,children:Ze.CLOUD_CONNECTOR_CUSTOM_COL_INSTRUMENTATION})}),l.map(n=>{const a=i[n.typeName]??Gc,l=void 0!==n.instrumentationPermissions,s=a.instrumentation||a.discovery;return e(o.Fragment,{children:[t(Hc,{children:t(_e,{size:Te.XXS,weight:400,lineHeight:"normal",color:Pe.Primary,children:n.displayName})}),t(jc,{children:t(le,{name:`cloud-connector-custom-${n.typeName}-discovery`,size:Nt.S,value:s,disabled:a.instrumentation,onChange:e=>r(n.typeName,{discovery:e,instrumentation:a.instrumentation})})}),t(jc,{children:t(le,{name:`cloud-connector-custom-${n.typeName}-instrumentation`,size:Nt.S,value:a.instrumentation,disabled:!l,onChange:e=>r(n.typeName,{discovery:!!e||a.discovery,instrumentation:e})})})]},n.typeName)})]})}):null},Kc=b.div`
235
235
  display: flex;
236
236
  flex-direction: column;
237
237
  gap: 8px;
@@ -240,12 +240,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
240
240
  padding: 8px;
241
241
  border-radius: 0 16px 16px 0;
242
242
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
243
- `,Wc=b.div`
243
+ `,Yc=b.div`
244
244
  display: flex;
245
245
  flex-direction: column;
246
246
  gap: 8px;
247
247
  width: 100%;
248
- `,Kc=b.div`
248
+ `,Jc=b.div`
249
249
  display: flex;
250
250
  align-items: center;
251
251
  gap: 10px;
@@ -253,7 +253,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
253
253
  padding: 4px 12px 4px 4px;
254
254
  border-radius: 8px;
255
255
  background-color: ${({theme:e})=>e.v2.colors.purple[900]};
256
- `,Yc=b.div`
256
+ `,qc=b.div`
257
257
  display: flex;
258
258
  align-items: center;
259
259
  justify-content: center;
@@ -262,30 +262,30 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
262
262
  border-radius: 6px;
263
263
  flex-shrink: 0;
264
264
  background-color: ${({theme:e})=>e.v2.colors.purple[800]};
265
- `,Jc=({message:n})=>{const o=v();return e(Kc,{children:[t(Yc,{children:t(ol,{size:24})}),t(_e,{size:Te.XXS,color:o.v2.colors.purple[300],children:n})]})},qc=({provider:n,selectedPermission:o,onSelect:i,capabilities:a,onCapabilitiesChange:l})=>t(Gc,{children:Pc.map(r=>{const s=r.id===o,c=r.id===_c.Custom,d=s?e(Wc,{children:[c&&t(jc,{provider:n,capabilities:a,onCapabilitiesChange:l}),t(Dc,{policy:zc(n,r.id,a)})]}):void 0,p=s?t(Jc,{message:c?Ze.CLOUD_CONNECTOR_POLICY_NOTE_CUSTOM:Ze.CLOUD_CONNECTOR_POLICY_NOTE}):void 0;return t(Pt,{"data-id":`cloud-connector-permission-${r.id}`,title:r.title,description:r.description,checked:s,onChange:()=>i(r.id),body:d,footerNote:p},r.id)})}),Zc=b.div`
265
+ `,Zc=({message:n})=>{const o=v();return e(Jc,{children:[t(qc,{children:t(al,{size:24})}),t(_e,{size:Te.XXS,color:o.v2.colors.purple[300],children:n})]})},Qc=({provider:n,selectedPermission:o,onSelect:i,capabilities:a,onCapabilitiesChange:l})=>t(Kc,{children:Fc.map(r=>{const s=r.id===o,c=r.id===Lc.Custom,d=s?e(Yc,{children:[c&&t(Wc,{provider:n,capabilities:a,onCapabilitiesChange:l}),t(Pc,{policy:Xc(n,r.id,a)})]}):void 0,p=s?t(Zc,{message:c?Ze.CLOUD_CONNECTOR_POLICY_NOTE_CUSTOM:Ze.CLOUD_CONNECTOR_POLICY_NOTE}):void 0;return t(Pt,{"data-id":`cloud-connector-permission-${r.id}`,title:r.title,description:r.description,checked:s,onChange:()=>i(r.id),body:d,footerNote:p},r.id)})}),ed=b.div`
266
266
  display: flex;
267
267
  flex-direction: column;
268
268
  padding: 16px;
269
- `,Qc=b.div`
269
+ `,td=b.div`
270
270
  display: flex;
271
271
  flex-direction: column;
272
272
  gap: 16px;
273
273
  padding: 16px;
274
274
  border-radius: 16px;
275
275
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
276
- `,ed=b.div`
276
+ `,nd=b.div`
277
277
  display: flex;
278
278
  flex-direction: column;
279
279
  gap: 4px;
280
- `,td=b.div`
280
+ `,od=b.div`
281
281
  display: flex;
282
282
  align-items: stretch;
283
283
  width: 100%;
284
- `,nd=b.div`
284
+ `,id=b.div`
285
285
  display: flex;
286
286
  flex: 0 0 40%;
287
287
  min-width: 0;
288
- `,od=()=>{const{providers:n,genericForm:o}=tr(),[l,r]=a(!0),s=c(()=>n.find(e=>e.provider===o.formData.provider),[n,o.formData.provider]);return i(()=>{!o.formData.provider&&n.length>0&&o.handleFormChange("provider",n[0].provider)},[n,o.formData.provider,o]),i(()=>{o.formData.permission||o.handleFormChange("permission",_c.DiscoveryInstrumentation)},[o.formData.permission,o]),t(Zc,{children:e(Qc,{children:[e(ed,{children:[t(_e,{size:Te.S,weight:500,lineHeight:"24px",color:Pe.Primary,children:Ze.CLOUD_CONNECTOR_SELECT_PROVIDER_TITLE}),t(_e,{size:Te.XXS,weight:400,lineHeight:"normal",color:Pe.Secondary,children:Ze.CLOUD_CONNECTOR_SELECT_PROVIDER_SUBTITLE})]}),l&&t(Ne,{fullWidth:!0,smallIcon:!0,status:Ee.Info,message:Ze.CLOUD_CONNECTOR_PERMISSIONS_NOTE,action:{"data-id":"cloud-connector-permissions-note-close",label:Lt.CLOSE,onClick:()=>r(!1)}}),e(td,{children:[t(nd,{children:t(Nc,{providers:n,selectedProvider:o.formData.provider,onSelect:e=>o.handleFormChange("provider",e)})}),t(qc,{provider:s,selectedPermission:o.formData.permission,onSelect:e=>o.handleFormChange("permission",e),capabilities:o.formData.customCapabilities,onCapabilitiesChange:e=>o.handleFormChange("customCapabilities",e)})]})]})})},id=b.div`
288
+ `,ad=()=>{const{providers:n,genericForm:o}=or(),[l,r]=a(!0),s=c(()=>n.find(e=>e.provider===o.formData.provider),[n,o.formData.provider]);return i(()=>{!o.formData.provider&&n.length>0&&o.handleFormChange("provider",n[0].provider)},[n,o.formData.provider,o]),i(()=>{o.formData.permission||o.handleFormChange("permission",Lc.DiscoveryInstrumentation)},[o.formData.permission,o]),t(ed,{children:e(td,{children:[e(nd,{children:[t(_e,{size:Te.S,weight:500,lineHeight:"24px",color:Pe.Primary,children:Ze.CLOUD_CONNECTOR_SELECT_PROVIDER_TITLE}),t(_e,{size:Te.XXS,weight:400,lineHeight:"normal",color:Pe.Secondary,children:Ze.CLOUD_CONNECTOR_SELECT_PROVIDER_SUBTITLE})]}),l&&t(Ne,{fullWidth:!0,smallIcon:!0,status:Ee.Info,message:Ze.CLOUD_CONNECTOR_PERMISSIONS_NOTE,action:{"data-id":"cloud-connector-permissions-note-close",label:Lt.CLOSE,onClick:()=>r(!1)}}),e(od,{children:[t(id,{children:t(Oc,{providers:n,selectedProvider:o.formData.provider,onSelect:e=>o.handleFormChange("provider",e)})}),t(Qc,{provider:s,selectedPermission:o.formData.permission,onSelect:e=>o.handleFormChange("permission",e),capabilities:o.formData.customCapabilities,onCapabilitiesChange:e=>o.handleFormChange("customCapabilities",e)})]})]})})},ld=b.div`
289
289
  display: flex;
290
290
  flex-direction: column;
291
291
  gap: 16px;
@@ -293,12 +293,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
293
293
  padding: 12px;
294
294
  border-radius: 8px;
295
295
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
296
- `,ad=b.div`
296
+ `,rd=b.div`
297
297
  display: flex;
298
298
  align-items: center;
299
299
  gap: 12px;
300
300
  width: 100%;
301
- `,ld=b.div`
301
+ `,sd=b.div`
302
302
  display: flex;
303
303
  align-items: center;
304
304
  justify-content: center;
@@ -307,41 +307,41 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
307
307
  height: 24px;
308
308
  border-radius: 16px;
309
309
  background-color: ${({theme:e})=>e.v2.colors.purple[500]};
310
- `,rd=b.div`
310
+ `,cd=b.div`
311
311
  display: flex;
312
312
  flex: 1;
313
313
  flex-direction: column;
314
314
  gap: 2px;
315
315
  min-width: 0;
316
- `,sd=b.div`
316
+ `,dd=b.div`
317
317
  display: flex;
318
318
  flex-direction: column;
319
319
  gap: 10px;
320
320
  width: 100%;
321
321
  padding-left: 32px;
322
- `,cd=({"data-id":n,step:o,title:i,description:a,children:l})=>e(id,{"data-id":n,children:[e(ad,{children:[t(ld,{children:t(_e,{size:Te.XXS,weight:400,lineHeight:"20px",color:Pe.Primary,children:o})}),e(rd,{children:[t(_e,{size:Te.S,weight:400,lineHeight:"24px",color:Pe.Primary,children:i}),t(_e,{size:Te.XXS,weight:400,lineHeight:"normal",color:Pe.Secondary,children:a})]})]}),l&&t(sd,{children:l})]});var dd,pd;(e=>{e.AssumeRole="assume-role",e.StaticKeys="static-keys"})(dd||(dd={})),(e=>{e.CloudFormation="cloudformation",e.Terraform="terraform",e.AwsCli="aws-cli",e.Manual="manual"})(pd||(pd={}));const ud=[{id:dd.AssumeRole,label:Ze.CLOUD_CONNECTOR_AUTH_ASSUME_ROLE,note:Ze.CLOUD_CONNECTOR_AUTH_ASSUME_ROLE_NOTE},{id:dd.StaticKeys,label:Ze.CLOUD_CONNECTOR_AUTH_STATIC_KEYS,note:Ze.CLOUD_CONNECTOR_AUTH_STATIC_KEYS_NOTE}],hd=[{id:pd.CloudFormation,label:Ze.CLOUD_CONNECTOR_SETUP_METHOD_CLOUDFORMATION},{id:pd.Terraform,label:Ze.CLOUD_CONNECTOR_SETUP_METHOD_TERRAFORM},{id:pd.AwsCli,label:Ze.CLOUD_CONNECTOR_SETUP_METHOD_AWS_CLI},{id:pd.Manual,label:Ze.CLOUD_CONNECTOR_SETUP_METHOD_MANUAL}],md={[pd.CloudFormation]:{description:"Launch the stack in your AWS account. It creates the IAM role with the policy above and returns the Role ARN.",steps:["Open the AWS CloudFormation console.","Choose Create stack → With new resources.","Upload the template below as the stack template.","Review the permissions, then deploy the stack.","Open the stack's Outputs tab.","Copy the RoleArn value and paste it below."],code:["aws cloudformation deploy \\"," --stack-name odigos-connector \\"," --template-file odigos-connector.yaml \\"," --capabilities CAPABILITY_NAMED_IAM"].join("\n")},[pd.Terraform]:{description:"Run the Odigos connector module to provision the IAM role as code and expose the Role ARN as an output.",steps:["Add the odigos-connector module to your configuration.","Run terraform init to download the module.","Run terraform apply and confirm the plan.","Read the role_arn value from the apply output.","Copy the Role ARN and paste it below."],code:["terraform init","terraform apply","terraform output -raw role_arn"].join("\n")},[pd.AwsCli]:{description:"Create the IAM role from your terminal using the AWS CLI, then return the Role ARN.",steps:["Make sure the AWS CLI is configured (aws configure).","Create the role with the trust policy.","Attach the permissions policy to the role.","Copy the ARN from the create-role output and paste it below."],code:["aws iam get-role \\"," --role-name OdigosConnectorRole \\"," --query 'Role.Arn' \\"," --output text"].join("\n")},[pd.Manual]:{description:"Create the IAM role by hand in the AWS Console using the trust policy below, then return the Role ARN.",steps:["Open the AWS Console → IAM → Roles → Create role.","Select Custom trust policy.","Paste the trust policy below.","Attach the permissions policy from the previous step.","Name the role and create it.","Open the role summary and copy the Role ARN below."],code:["{",' "Version": "2012-10-17",',' "Statement": ['," {",' "Effect": "Allow",',' "Principal": { "AWS": "arn:aws:iam::657451249928:root" },',' "Action": "sts:AssumeRole",',' "Condition": {',' "StringEquals": { "sts:ExternalId": "odigos-connector" }'," }"," }"," ]","}"].join("\n")}},gd=b.div`
322
+ `,pd=({"data-id":n,step:o,title:i,description:a,children:l})=>e(ld,{"data-id":n,children:[e(rd,{children:[t(sd,{children:t(_e,{size:Te.XXS,weight:400,lineHeight:"20px",color:Pe.Primary,children:o})}),e(cd,{children:[t(_e,{size:Te.S,weight:400,lineHeight:"24px",color:Pe.Primary,children:i}),t(_e,{size:Te.XXS,weight:400,lineHeight:"normal",color:Pe.Secondary,children:a})]})]}),l&&t(dd,{children:l})]});var ud,hd;(e=>{e.AssumeRole="assume-role",e.StaticKeys="static-keys"})(ud||(ud={})),(e=>{e.CloudFormation="cloudformation",e.Terraform="terraform",e.AwsCli="aws-cli",e.Manual="manual"})(hd||(hd={}));const md=[{id:ud.AssumeRole,label:Ze.CLOUD_CONNECTOR_AUTH_ASSUME_ROLE,note:Ze.CLOUD_CONNECTOR_AUTH_ASSUME_ROLE_NOTE},{id:ud.StaticKeys,label:Ze.CLOUD_CONNECTOR_AUTH_STATIC_KEYS,note:Ze.CLOUD_CONNECTOR_AUTH_STATIC_KEYS_NOTE}],gd=[{id:hd.CloudFormation,label:Ze.CLOUD_CONNECTOR_SETUP_METHOD_CLOUDFORMATION},{id:hd.Terraform,label:Ze.CLOUD_CONNECTOR_SETUP_METHOD_TERRAFORM},{id:hd.AwsCli,label:Ze.CLOUD_CONNECTOR_SETUP_METHOD_AWS_CLI},{id:hd.Manual,label:Ze.CLOUD_CONNECTOR_SETUP_METHOD_MANUAL}],fd={[hd.CloudFormation]:{description:"Launch the stack in your AWS account. It creates the IAM role with the policy above and returns the Role ARN.",steps:["Open the AWS CloudFormation console.","Choose Create stack → With new resources.","Upload the template below as the stack template.","Review the permissions, then deploy the stack.","Open the stack's Outputs tab.","Copy the RoleArn value and paste it below."],code:["aws cloudformation deploy \\"," --stack-name odigos-connector \\"," --template-file odigos-connector.yaml \\"," --capabilities CAPABILITY_NAMED_IAM"].join("\n")},[hd.Terraform]:{description:"Run the Odigos connector module to provision the IAM role as code and expose the Role ARN as an output.",steps:["Add the odigos-connector module to your configuration.","Run terraform init to download the module.","Run terraform apply and confirm the plan.","Read the role_arn value from the apply output.","Copy the Role ARN and paste it below."],code:["terraform init","terraform apply","terraform output -raw role_arn"].join("\n")},[hd.AwsCli]:{description:"Create the IAM role from your terminal using the AWS CLI, then return the Role ARN.",steps:["Make sure the AWS CLI is configured (aws configure).","Create the role with the trust policy.","Attach the permissions policy to the role.","Copy the ARN from the create-role output and paste it below."],code:["aws iam get-role \\"," --role-name OdigosConnectorRole \\"," --query 'Role.Arn' \\"," --output text"].join("\n")},[hd.Manual]:{description:"Create the IAM role by hand in the AWS Console using the trust policy below, then return the Role ARN.",steps:["Open the AWS Console → IAM → Roles → Create role.","Select Custom trust policy.","Paste the trust policy below.","Attach the permissions policy from the previous step.","Name the role and create it.","Open the role summary and copy the Role ARN below."],code:["{",' "Version": "2012-10-17",',' "Statement": ['," {",' "Effect": "Allow",',' "Principal": { "AWS": "arn:aws:iam::657451249928:root" },',' "Action": "sts:AssumeRole",',' "Condition": {',' "StringEquals": { "sts:ExternalId": "odigos-connector" }'," }"," }"," ]","}"].join("\n")}},bd=b.div`
323
323
  display: flex;
324
324
  align-items: stretch;
325
325
  gap: 10px;
326
326
  width: 100%;
327
- `,fd=b.div`
327
+ `,vd=b.div`
328
328
  display: flex;
329
329
  flex: 2 1 0;
330
330
  flex-direction: column;
331
331
  gap: 12px;
332
332
  min-width: 0;
333
333
  padding: 12px 0;
334
- `,bd=b.div`
334
+ `,yd=b.div`
335
335
  display: flex;
336
336
  flex-direction: column;
337
337
  gap: 8px;
338
338
  width: 100%;
339
- `,vd=b.div`
339
+ `,Cd=b.div`
340
340
  display: flex;
341
341
  align-items: center;
342
342
  gap: 12px;
343
343
  width: 100%;
344
- `,yd=b.div`
344
+ `,Sd=b.div`
345
345
  display: flex;
346
346
  align-items: center;
347
347
  justify-content: center;
@@ -350,7 +350,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
350
350
  height: 24px;
351
351
  border-radius: 16px;
352
352
  background-color: ${({theme:e})=>e.v2.colors.purple[700]};
353
- `,Cd=b.div`
353
+ `,xd=b.div`
354
354
  display: flex;
355
355
  flex: 3 1 0;
356
356
  flex-direction: column;
@@ -359,60 +359,60 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
359
359
  border-radius: 12px;
360
360
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
361
361
  border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
362
- `,Sd=b.div`
362
+ `,wd=b.div`
363
363
  display: flex;
364
364
  align-items: center;
365
365
  justify-content: flex-end;
366
366
  width: 100%;
367
- `,xd=b.div`
367
+ `,Td=b.div`
368
368
  flex: 1;
369
369
  width: 100%;
370
370
  min-height: 200px;
371
371
  max-height: 260px;
372
372
  overflow: auto;
373
373
  padding: 0 12px 12px;
374
- `,wd=b.pre`
374
+ `,kd=b.pre`
375
375
  margin: 0;
376
376
  font-family: ${({theme:e})=>e.font_family.code};
377
377
  font-size: 12px;
378
378
  line-height: 20px;
379
379
  color: ${({theme:e})=>e.v2.colors.green[400]};
380
380
  white-space: pre;
381
- `,Td=({step:n,setupMethod:o})=>{const i=v(),{CopyButton:a}=_t(),{description:l,steps:r,code:s}=(e=>md[e]??md[pd.CloudFormation])(o);return t(cd,{"data-id":"cloud-connector-create-role",step:n,title:Ze.CLOUD_CONNECTOR_CREATE_ROLE_TITLE,description:l,children:e(gd,{children:[e(fd,{children:[t(_e,{size:Te.XXS,weight:400,lineHeight:"20px",color:Pe.Primary,children:Ze.CLOUD_CONNECTOR_CREATE_ROLE_STEPS_HEADING}),t(bd,{children:r.map((n,a)=>e(vd,{children:[t(yd,{children:t(_e,{size:Te.XXS,weight:400,lineHeight:"20px",color:i.v2.colors.purple[200],children:a+1})}),t(_e,{size:Te.XXS,weight:400,lineHeight:"20px",color:Pe.Primary,children:n})]},`${o}-step-${a}`))})]}),e(Cd,{children:[t(Sd,{children:t(a,{value:s,size:vt.XS})}),t(xd,{children:t(wd,{children:s})})]})]})})},kd=b.div`
381
+ `,Id=({step:n,setupMethod:o})=>{const i=v(),{CopyButton:a}=_t(),{description:l,steps:r,code:s}=(e=>fd[e]??fd[hd.CloudFormation])(o);return t(pd,{"data-id":"cloud-connector-create-role",step:n,title:Ze.CLOUD_CONNECTOR_CREATE_ROLE_TITLE,description:l,children:e(bd,{children:[e(vd,{children:[t(_e,{size:Te.XXS,weight:400,lineHeight:"20px",color:Pe.Primary,children:Ze.CLOUD_CONNECTOR_CREATE_ROLE_STEPS_HEADING}),t(yd,{children:r.map((n,a)=>e(Cd,{children:[t(Sd,{children:t(_e,{size:Te.XXS,weight:400,lineHeight:"20px",color:i.v2.colors.purple[200],children:a+1})}),t(_e,{size:Te.XXS,weight:400,lineHeight:"20px",color:Pe.Primary,children:n})]},`${o}-step-${a}`))})]}),e(xd,{children:[t(wd,{children:t(a,{value:s,size:vt.XS})}),t(Td,{children:t(kd,{children:s})})]})]})})},Nd=b.div`
382
382
  display: flex;
383
383
  flex-direction: column;
384
384
  gap: 16px;
385
385
  width: 100%;
386
- `,Id=b.div`
386
+ `,Ed=b.div`
387
387
  display: flex;
388
388
  flex-wrap: wrap;
389
389
  gap: 24px;
390
390
  width: 100%;
391
- `,Nd=b.div`
391
+ `,Od=b.div`
392
392
  display: flex;
393
393
  flex: 1 1 calc(50% - 12px);
394
394
  min-width: 0;
395
- `,Ed=b.div`
395
+ `,$d=b.div`
396
396
  display: flex;
397
397
  width: 100%;
398
398
  max-width: 479px;
399
- `,Od=({step:n})=>{const{genericForm:o,providers:i}=tr(),{provider:a,authMethod:l,awsAccountId:r,credentials:s}=o.formData,d=c(()=>i.find(e=>e.provider===a),[i,a]),p=c(()=>((e,t)=>{const n=e?.auth?.methods?.find(e=>e.id===t);if(!n)return[];const o=new Map(e?.auth?.methods?.map(e=>[e.id,e])),i=new Set,a=[],l=e=>e?.forEach(e=>{e.name&&!i.has(e.name)&&(i.add(e.name),a.push(e))});return n.baseMethods?.forEach(e=>l(o.get(e)?.fields)),l(n.fields),a})(d,l),[d,l]);return t(cd,{"data-id":"cloud-connector-enter-arn",step:n,title:Ze.CLOUD_CONNECTOR_ENTER_ARN_TITLE,description:Ze.CLOUD_CONNECTOR_ENTER_ARN_SUBTITLE,children:e(kd,{children:[t(Ed,{children:t(ye,{name:"cloud-connector-aws-account-id",width:"100%",label:Ze.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_LABEL,placeholder:Ze.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_PLACEHOLDER,helpMessage:Ze.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_HELP,value:r,onChange:e=>o.handleFormChange("awsAccountId",e.target.value)})}),p.length>0&&t(Id,{children:p.map(e=>t(Nd,{children:t(ye,{name:`cloud-connector-credential-${e.name}`,width:"100%",type:e.secret?Ft.Password:Ft.Text,label:e.displayName||e.name,required:e.required,tooltip:e.tooltip||void 0,helpMessage:e.tooltip||void 0,placeholder:e.displayName||e.name,value:s[e.name]??"",onChange:t=>{return n=e.name,i=t.target.value,void o.handleFormChange("credentials",{...s,[n]:i});var n,i}})},e.name))})]})})},$d=b.div`
399
+ `,Ad=({step:n})=>{const{genericForm:o,providers:i}=or(),{provider:a,authMethod:l,awsAccountId:r,credentials:s}=o.formData,d=c(()=>i.find(e=>e.provider===a),[i,a]),p=c(()=>((e,t)=>{const n=e?.auth?.methods?.find(e=>e.id===t);if(!n)return[];const o=new Map(e?.auth?.methods?.map(e=>[e.id,e])),i=new Set,a=[],l=e=>e?.forEach(e=>{e.name&&!i.has(e.name)&&(i.add(e.name),a.push(e))});return n.baseMethods?.forEach(e=>l(o.get(e)?.fields)),l(n.fields),a})(d,l),[d,l]);return t(pd,{"data-id":"cloud-connector-enter-arn",step:n,title:Ze.CLOUD_CONNECTOR_ENTER_ARN_TITLE,description:Ze.CLOUD_CONNECTOR_ENTER_ARN_SUBTITLE,children:e(Nd,{children:[t($d,{children:t(ye,{name:"cloud-connector-aws-account-id",width:"100%",label:Ze.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_LABEL,placeholder:Ze.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_PLACEHOLDER,helpMessage:Ze.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_HELP,value:r,onChange:e=>o.handleFormChange("awsAccountId",e.target.value)})}),p.length>0&&t(Ed,{children:p.map(e=>t(Od,{children:t(ye,{name:`cloud-connector-credential-${e.name}`,width:"100%",type:e.secret?Ft.Password:Ft.Text,label:e.displayName||e.name,required:e.required,tooltip:e.tooltip||void 0,helpMessage:e.tooltip||void 0,placeholder:e.displayName||e.name,value:s[e.name]??"",onChange:t=>{return n=e.name,i=t.target.value,void o.handleFormChange("credentials",{...s,[n]:i});var n,i}})},e.name))})]})})},Rd=b.div`
400
400
  display: flex;
401
401
  flex-direction: column;
402
402
  padding: 16px;
403
- `,Ad=b.div`
403
+ `,Dd=b.div`
404
404
  display: flex;
405
405
  flex-direction: column;
406
406
  gap: 12px;
407
407
  padding: 16px 16px 12px;
408
408
  border-radius: 16px;
409
409
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
410
- `,Rd=b.div`
410
+ `,_d=b.div`
411
411
  display: flex;
412
412
  align-items: center;
413
413
  gap: 8px;
414
414
  width: 100%;
415
- `,Dd=b.button`
415
+ `,Pd=b.button`
416
416
  display: flex;
417
417
  align-items: center;
418
418
  justify-content: center;
@@ -429,24 +429,24 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
429
429
  &:hover {
430
430
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
431
431
  }
432
- `,_d=b.div`
432
+ `,Ld=b.div`
433
433
  display: flex;
434
434
  flex: 1;
435
435
  flex-direction: column;
436
436
  gap: 4px;
437
437
  min-width: 0;
438
- `,Pd=b.div`
438
+ `,Fd=b.div`
439
439
  display: flex;
440
440
  align-items: center;
441
441
  gap: 4px;
442
442
  padding: 8px 0 8px 2px;
443
- `,Ld=({onBack:n})=>{const o=v(),{genericForm:a}=tr(),l=a.formData.authMethod,r=a.formData.setupMethod;i(()=>{l||a.handleFormChange("authMethod",dd.AssumeRole)},[l,a]),i(()=>{r||a.handleFormChange("setupMethod",pd.CloudFormation)},[r,a]);const s=ud.find(e=>e.id===l)?.note;return t($d,{children:e(Ad,{children:[e(Rd,{children:[t(Dd,{"data-id":"cloud-connector-setup-back",type:"button",onClick:n,"aria-label":Ze.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE,children:t(il,{size:24})}),e(_d,{children:[t(_e,{size:Te.S,weight:500,lineHeight:"24px",color:Pe.Primary,children:Ze.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE}),t(_e,{size:Te.XXS,weight:400,lineHeight:"normal",color:Pe.Secondary,children:Ze.CLOUD_CONNECTOR_SETUP_CREDENTIALS_SUBTITLE})]})]}),e(cd,{"data-id":"cloud-connector-auth-method",step:1,title:Ze.CLOUD_CONNECTOR_AUTH_TITLE,description:Ze.CLOUD_CONNECTOR_AUTH_SUBTITLE,children:[t(ce,{"data-id":"cloud-connector-auth-method-segment",size:ke.S,selected:l,setSelected:e=>a.handleFormChange("authMethod",e),options:ud.map(e=>({value:e.id,label:e.label}))}),s&&e(Pd,{children:[t(al,{size:16,fill:o.v2.colors.silver[200]}),t(_e,{size:Te.XXXS,weight:400,lineHeight:"normal",color:Pe.Secondary,children:s})]})]}),t(cd,{"data-id":"cloud-connector-setup-method",step:2,title:Ze.CLOUD_CONNECTOR_SETUP_METHOD_TITLE,description:Ze.CLOUD_CONNECTOR_SETUP_METHOD_SUBTITLE,children:t(ce,{"data-id":"cloud-connector-setup-method-segment",size:ke.S,selected:r,setSelected:e=>a.handleFormChange("setupMethod",e),options:hd.map(e=>({value:e.id,label:e.label}))})}),t(Td,{step:3,setupMethod:r}),t(Od,{step:4})]})})},Fd=b.div`
443
+ `,Md=({onBack:n})=>{const o=v(),{genericForm:a}=or(),l=a.formData.authMethod,r=a.formData.setupMethod;i(()=>{l||a.handleFormChange("authMethod",ud.AssumeRole)},[l,a]),i(()=>{r||a.handleFormChange("setupMethod",hd.CloudFormation)},[r,a]);const s=md.find(e=>e.id===l)?.note;return t(Rd,{children:e(Dd,{children:[e(_d,{children:[t(Pd,{"data-id":"cloud-connector-setup-back",type:"button",onClick:n,"aria-label":Ze.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE,children:t(ll,{size:24})}),e(Ld,{children:[t(_e,{size:Te.S,weight:500,lineHeight:"24px",color:Pe.Primary,children:Ze.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE}),t(_e,{size:Te.XXS,weight:400,lineHeight:"normal",color:Pe.Secondary,children:Ze.CLOUD_CONNECTOR_SETUP_CREDENTIALS_SUBTITLE})]})]}),e(pd,{"data-id":"cloud-connector-auth-method",step:1,title:Ze.CLOUD_CONNECTOR_AUTH_TITLE,description:Ze.CLOUD_CONNECTOR_AUTH_SUBTITLE,children:[t(ce,{"data-id":"cloud-connector-auth-method-segment",size:ke.S,selected:l,setSelected:e=>a.handleFormChange("authMethod",e),options:md.map(e=>({value:e.id,label:e.label}))}),s&&e(Fd,{children:[t(rl,{size:16,fill:o.v2.colors.silver[200]}),t(_e,{size:Te.XXXS,weight:400,lineHeight:"normal",color:Pe.Secondary,children:s})]})]}),t(pd,{"data-id":"cloud-connector-setup-method",step:2,title:Ze.CLOUD_CONNECTOR_SETUP_METHOD_TITLE,description:Ze.CLOUD_CONNECTOR_SETUP_METHOD_SUBTITLE,children:t(ce,{"data-id":"cloud-connector-setup-method-segment",size:ke.S,selected:r,setSelected:e=>a.handleFormChange("setupMethod",e),options:gd.map(e=>({value:e.id,label:e.label}))})}),t(Id,{step:3,setupMethod:r}),t(Ad,{step:4})]})})},zd=b.div`
444
444
  display: flex;
445
445
  flex-direction: column;
446
446
  flex: 1;
447
447
  min-height: 0;
448
448
  padding: 16px;
449
- `,Md=b.div`
449
+ `,Bd=b.div`
450
450
  display: flex;
451
451
  flex-direction: column;
452
452
  flex: 1;
@@ -454,13 +454,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
454
454
  padding: 16px;
455
455
  border-radius: 16px;
456
456
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
457
- `,zd=b.div`
457
+ `,Xd=b.div`
458
458
  display: flex;
459
459
  flex: 1;
460
460
  align-items: center;
461
461
  justify-content: center;
462
462
  width: 100%;
463
- `,Bd=b.div`
463
+ `,Ud=b.div`
464
464
  display: flex;
465
465
  flex-direction: column;
466
466
  align-items: center;
@@ -470,7 +470,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
470
470
  padding: 24px 8px;
471
471
  border-radius: 8px;
472
472
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
473
- `,Xd=b.div`
473
+ `,Vd=b.div`
474
474
  display: flex;
475
475
  flex-direction: column;
476
476
  align-items: center;
@@ -479,7 +479,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
479
479
  padding: 16px;
480
480
  border-radius: 12px;
481
481
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
482
- `,Ud=b.div`
482
+ `,Hd=b.div`
483
483
  display: flex;
484
484
  align-items: center;
485
485
  justify-content: center;
@@ -488,7 +488,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
488
488
  height: 39px;
489
489
  border-radius: 20px;
490
490
  background-color: ${({theme:e})=>e.v2.colors.red[500]};
491
- `,Vd=b.div`
491
+ `,jd=b.div`
492
492
  display: flex;
493
493
  align-items: flex-start;
494
494
  gap: 8px;
@@ -498,7 +498,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
498
498
  padding: 12px;
499
499
  border-radius: 8px;
500
500
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
501
- `,Hd=b.pre`
501
+ `,Gd=b.pre`
502
502
  flex: 1;
503
503
  min-width: 0;
504
504
  margin: 0;
@@ -508,25 +508,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
508
508
  color: ${({theme:e})=>e.v2.colors.silver[200]};
509
509
  white-space: pre-wrap;
510
510
  word-break: break-word;
511
- `,jd=b.div`
511
+ `,Wd=b.div`
512
512
  display: flex;
513
513
  flex-direction: column;
514
514
  gap: 12px;
515
515
  width: 100%;
516
- `,Gd=b.div`
516
+ `,Kd=b.div`
517
517
  display: flex;
518
518
  flex-wrap: wrap;
519
519
  gap: 24px;
520
520
  padding: 0 2px;
521
- `,Wd=b.div`
521
+ `,Yd=b.div`
522
522
  display: flex;
523
523
  gap: 6px;
524
524
  min-width: 0;
525
- `,Kd=b.div`
525
+ `,Jd=b.div`
526
526
  display: flex;
527
527
  flex-direction: column;
528
528
  gap: 8px;
529
- `,Yd=b.div`
529
+ `,qd=b.div`
530
530
  display: flex;
531
531
  flex-direction: column;
532
532
  gap: 6px;
@@ -534,7 +534,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
534
534
  border-radius: 12px;
535
535
  border: 1px solid ${({theme:e,$passed:t})=>t?e.v2.colors.silver[700]:e.v2.colors.red[800]};
536
536
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
537
- `,Jd=({isTesting:n,error:o,result:i})=>{const a=v(),{CopyButton:l}=_t(),r=c(()=>i?.checks.filter(e=>!e.passed)??[],[i]),s=!(n||!o&&(!i||i.success)),d=o?Ze.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT:r[0]?.remediation||r[0]?.message||Ze.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT,p=o||r.map(e=>e.message).filter(Boolean).join("\n");return t(Fd,{children:t(Md,{children:n?t(zd,{children:t(Bd,{children:t(yt,{withVisual:!0,withGradient:!0,title:Ze.CLOUD_CONNECTOR_TESTING_TITLE,titleSize:Te.XS})})}):s?t(zd,{children:e(Xd,{children:[t(Ud,{children:t(Ka,{size:20,fill:a.v2.colors.black[500]})}),t(_e,{size:Te.XS,weight:400,lineHeight:"20px",color:Pe.Primary,children:Ze.CLOUD_CONNECTOR_CONNECTION_FAILED_TITLE}),t(_e,{align:"center",size:Te.XXXS,weight:400,lineHeight:"normal",color:Pe.Secondary,children:d}),p&&e(Vd,{children:[t(Hd,{children:p}),t(l,{value:p,size:vt.XS})]})]})}):i?e(jd,{children:[t(Ke,{status:Ee.Success,label:Ze.CLOUD_CONNECTOR_VALIDATE_SUCCESS,leftIcon:Wa,fullWidth:!0}),(i.accountId||i.identity)&&e(Gd,{children:[i.accountId&&e(Wd,{children:[e(_e,{size:Te.XXS,weight:500,color:Pe.Secondary,children:[Ze.CLOUD_CONNECTOR_VALIDATE_ACCOUNT,":"]}),t(_e,{size:Te.XXS,weight:400,color:Pe.Primary,children:i.accountId})]}),i.identity&&e(Wd,{children:[e(_e,{size:Te.XXS,weight:500,color:Pe.Secondary,children:[Ze.CLOUD_CONNECTOR_VALIDATE_IDENTITY,":"]}),t(_e,{size:Te.XXS,weight:400,color:Pe.Primary,children:i.identity})]})]}),i.checks.length>0&&t(Kd,{children:i.checks.map(n=>e(Yd,{$passed:n.passed,children:[t(Ke,{status:n.passed?Ee.Success:Ee.Error,label:n.displayName,leftIcon:n.passed?Wa:Ka}),n.message&&t(_e,{size:Te.XXS,weight:400,lineHeight:"normal",color:Pe.Secondary,children:n.message}),!n.passed&&n.remediation&&t(_e,{size:Te.XXS,weight:400,lineHeight:"normal",color:Pe.Primary,children:n.remediation})]},n.name))})]}):t(zd,{children:t(_e,{size:Te.XXS,weight:400,color:Pe.Secondary,children:Ze.CLOUD_CONNECTOR_VALIDATE_EMPTY})})})})};var qd;(e=>{e[e.SelectProvider=1]="SelectProvider",e[e.Config=2]="Config",e[e.Validate=3]="Validate"})(qd||(qd={}));const Zd=qd.SelectProvider,Qd=qd.Validate,ep=({onClose:n,withOverlay:o,onCreateCloudConnector:i,onCreated:l})=>{const{providers:r,genericForm:s}=tr(),[p,u]=a(Zd),[h,m]=a(!1),[g,f]=a(!1),[b,v]=a(void 0),[y,C]=a(void 0),[S,x]=a(void 0),w=s.isFormDirty,T=p===Zd,k=p===Qd,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>Zd?e-1:e)},[]),E=d(()=>{if(x(void 0),p===qd.SelectProvider){if(!s.formData.provider)return void x("Please select a cloud provider");if(!s.formData.permission)return void x("Please select a permission level")}u(e=>e<Qd?e+1:e)},[p,s.formData.provider,s.formData.permission]),O=d(async()=>{if(x(void 0),C(void 0),v(void 0),u(qd.Validate),!i)return;const{provider:e,permission:t,customCapabilities:n,awsAccountId:o,credentials:a,name:c}=s.formData,d=((e,t,n)=>{const o=Fc(e),i=[];return o.forEach(e=>{const o=void 0!==e.instrumentationPermissions;let a=!1,l=!1;switch(t){case _c.DiscoveryOnly:a=!0;break;case _c.DiscoveryInstrumentation:a=!0,l=o;break;case _c.Custom:{const t=n[e.typeName];a=!!t?.discovery,l=!!t?.instrumentation;break}}(a||l)&&i.push({type:e.typeName,discovery:a,instrumentation:l,computePlatforms:!1})}),i})(r.find(t=>t.provider===e),t,n);f(!0);try{const t=await i({provider:e,displayName:c,credentials:a,expectedAccountId:o,capabilities:d});if(t.created)return void l?.(t.connectorId);v(t.test)}catch(e){C(e instanceof Error?e.message:"Failed to create connector")}finally{f(!1)}},[i,l,s.formData,r]),$=g,A=k&&!g&&(!!y||!!b&&!b.success),R=c(()=>S?{status:Ee.Error,message:S}:void 0,[S]),D=c(()=>T?{"data-id":"cloud-connector-cancel",label:Lt.CANCEL,variant:ve.Secondary,onClick:I,disabled:$}:{"data-id":"cloud-connector-back",label:Lt.BACK,variant:ve.Text,leftIcon:il,onClick:N,disabled:$},[T,I,N,$]),_=c(()=>{if(k){if(g)return;return A?{"data-id":"cloud-connector-retry",label:Lt.RETRY,variant:ve.Primary,rightIcon:ll,onClick:O}:void 0}return p===qd.Config?{"data-id":"cloud-connector-verify",label:Lt.VERIFY_AND_CREATE_CONNECTOR,variant:ve.Primary,onClick:O,disabled:$}:{"data-id":"cloud-connector-next",label:Lt.NEXT,variant:ve.Primary,onClick:E,disabled:$}},[k,g,A,p,O,E,$]),P=c(()=>[D,_].filter(Boolean),[D,_]);return e(Mt,{width:Ir,isOpen:!0,hideOverlay:!$&&!o,header:{icon:tl,title:Ze.CREATE_CLOUD_CONNECTOR,onClose:n?I:void 0,onCloseDisabled:$},footer:{note:R,actions:P},children:[p===qd.SelectProvider&&t(od,{}),p===qd.Config&&t(Ld,{onBack:N}),p===qd.Validate&&t(Jd,{isTesting:g,error:y,result:b}),t(Nr,{isOpen:h,onClose:()=>m(!1),onApprove:()=>n?.()})]})},tp=(e,t)=>{const n=[{id:"type",title:Ze.TYPE,label:t.label},{id:"status",title:Ze.STATUS,badge:{status:e.disabled?Ee.Unknown:Ee.Success,label:e.disabled?Ze.DISABLED:Ze.ENABLED}}],o=e.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return o&&n.push({id:"signals",title:Ze.SIGNALS_FOR_PROCESSING,label:o}),e.name&&n.push({id:"name",title:Ze.NAME,label:e.name}),e.notes&&n.push({id:"notes",title:Ze.NOTES,label:e.notes}),n},np=({onClose:o,actionId:l})=>{const r=v(),{isVm:s}=S(),{actionsApi:p}=Vl(),{items:u,refetch:h}=p.useActions(),{options:m}=p.useActionTypes(),{selectedOption:g,loadAction:f,validateFormData:b,genericForm:y}=Ul();i(()=>{h()},[]);const[C,x]=a(!1),[w,T]=a(!1),[k,I]=a(null),N=C&&!!y?.isFormDirty,E=c(()=>u?.find(e=>Xt(e)===l),[l,u]),O=c(()=>m.find(({type:e})=>e===E?.type)??Ut.find(({type:e})=>e===E?.type)??null,[m,E?.type]);i(()=>{E&&f(E,O)},[E,O]);const $=d(()=>{E&&x(!0)},[E]),A=d(()=>{E&&(f(E,O),x(!1))},[E,O,f]),R=d(()=>{N?I("close"):o()},[N,o]),D=d(()=>{N?I("cancel"):A()},[N,A]),_=d(()=>{const e=k;I(null),"close"===e?(A(),o()):A()},[k,A,o]),P=d(async()=>{if(E){const{errorMessage:e,preparedFormData:t}=b();e||(await p.update(E.id,t),x(!1))}},[E,b,p]),L=d(()=>{E&&T(!0)},[E]),F=d(async()=>{E&&(await p.remove(E.id,E.type),o())},[E,p,o]);if(!E||!O)return null;const M=(z=E,B=O,B?.fields?.length?zt(z.fields||{},B.fields,{signals:z.signals||[],skipComponentTypes:[Bt.SourceScopes]}):[]);var z,B;const X=O.fields?.find(e=>e.componentType===Bt.SourceScopes),U=X?.name||Q.Scopes,V=E.fields?.[U]??null,H=!(s||!X&&void 0===E.fields?.scopes);return e(n,{children:[t(Mt,{isOpen:!0,header:{icon:jt(E.type),title:O.label,onClose:R,actions:[{id:"edit-action-btn-edit",label:Lt.EDIT,icon:Ma,active:C,onClick:$},{id:"edit-action-btn-delete",label:Lt.DELETE,icon:Aa,color:r.v2.colors.red[500],active:w,onClick:L}]},footer:{actions:C?[{"data-id":"edit-action-btn-cancel",label:Lt.CANCEL,variant:ve.Secondary,onClick:D},{"data-id":"edit-action-btn-save",label:Lt.SAVE,variant:ve.Primary,onClick:P}]:[]},children:t(ut,{$padding:"4px 12px 12px",children:C&&g?t(gs,{}):t(ee,{$gap:16,children:e(Vt,{bgTint:"1000",children:[e(Vt,{bgTint:"900",children:[!s&&t(Ht,{conditions:E.conditions||[]}),t(Vt,{bgTint:"800",cellsPerRow:2,items:tp(E,O)})]}),H&&t(gr,{readOnly:!0,scopes:V}),!!M?.length&&t(Vt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Vt,{bgTint:"800",cellsPerRow:2,items:M})})]})})})}),t(Er,{target:"action",isOpen:w,onClose:()=>T(!1),onApprove:F}),t(Nr,{isOpen:null!==k,onClose:()=>I(null),onApprove:_})]})},op=({onClose:n,connections:o,selectedConnectionIds:l,setSelectedConnectionIds:r})=>{const{configApi:s}=Vl(),[d,u]=a(""),[h,m]=a({showOnlySelected:!1}),g=c(()=>o.filter(e=>{const t=!d||e.name.toLowerCase().includes(d.toLowerCase()),n=!h.showOnlySelected||h.showOnlySelected&&l.includes(e.id);return t&&n}),[o.length,l.length,d,h]),f=e=>{r(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=1===l.length?l[0]:void 0,{data:v,loading:y}=s.useEffectiveConfig(b?{id:b}:void 0,{skip:!b}),C=c(()=>{if(b&&v)return{rollout:{automaticRolloutDisabled:v.rollout?.automaticRolloutDisabled??!1}}},[b,v]),{formData:S,handleFormChange:x,areFormValuesEqual:w,resetFormData:T}=Gt(C||{rollout:{automaticRolloutDisabled:!1}}),k=p(T);k.current=T,i(()=>{C&&k.current(C)},[C]);const I=c(()=>l.length>1||void 0!==C&&!w(C,S),[l.length,C,S]);return t(kr,{isOpen:!0,onClose:n,onSave:async()=>await(s.applyConfigurations?.(S,l))??void 0,header:{icon:rl,title:"Cluster Configuration"},connectionIds:{value:l,setValue:r},search:{placeholder:"Search by cluster name",value:d,onChange:u},filters:e(pe,{$gap:8,children:[t(_e,{size:Te.XXXS,color:Pe.Secondary,nowrap:!0,children:"Show only:"}),t(le,{size:Nt.S,label:"Selected",value:h.showOnlySelected,onChange:e=>m(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:I,isFetching:y,leftColumn:{width:"35%",header:e(pe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(pe,{$gap:8,children:[t(_e,{size:Te.XS,children:"Clusters"}),t(Ke,{label:g.length,status:Ee.Unknown})]}),e(pe,{$gap:8,children:[t(_e,{size:Te.XXXS,color:Pe.Secondary,align:"right",children:"Selected clusters"}),t(Ke,{label:`${l.length}/${g.length}`,status:Ee.Unknown})]})]}),list:g.map(e=>t(Hs,{title:e.name,isChecked:l.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(_e,{size:Te.XS,children:"Configurations"}),list:[t(le,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>x("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},ip=e=>{const t=[{id:"type",title:Ze.TYPE,label:e.destinationType.displayName},{id:"status",title:Ze.STATUS,badge:{status:e.disabled?Ee.Unknown:Ee.Success,label:e.disabled?Ze.DISABLED:Ze.ENABLED}}],n=Ae(e.exportedSignals).map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return n&&t.push({id:"monitors",title:Ze.MONITORS,label:n}),e.name&&t.push({id:"name",title:Ze.NAME,label:e.name}),t},ap=({onClose:o,destinationId:l})=>{const r=v(),{isVm:s}=S(),{destinationsApi:u}=Vl(),{selectedStreamName:h}=Qe(),{items:m,refetch:g}=u.useDestinations(),{data:f,loading:b}=u.useDestinationCategories(),{activeForm:y,loadDestination:C,validateFormData:x,genericForm:w}=Hl();i(()=>{g()},[]);const T=p(null),[k,I]=a(!1),[N,E]=a(!1),[O,$]=a(null),A=k&&!!w?.isFormDirty,R=c(()=>Yt(m,h),[m,h]),D=c(()=>R?.find(e=>Xt(e)===l),[l,R]),_=f?.destinationCategories?.categories??null;i(()=>{D&&_&&C(D,_)},[D,_]);const P=c(()=>D&&_?Jt(_,D):[],[D,_]),L=d(()=>{D&&I(!0)},[D]),F=d(()=>{D&&_&&(C(D,_),I(!1))},[D,_,C]),M=d(()=>{A?$("close"):o()},[A,o]),z=d(()=>{A?$("cancel"):F()},[A,F]),B=d(()=>{const e=O;$(null),"close"===e?(F(),o()):F()},[O,F,o]),X=d(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=x();e||(await u.update(D.id,De(t)),I(!1))}},[D,x,u]),U=d(()=>{D&&E(!0)},[D]),V=d(async()=>{D&&(await u.remove(D.id),o())},[D,u,o]);if(!D)return null;const{icon:H,iconSrc:j}=St(D.destinationType.type),G=((e,t)=>{const n=[],o=Wt(e,t),i=o.map(e=>({name:e.key,value:e.value})),a=Ae(e.exportedSignals);let l=[];const r=()=>{l.length&&(n.push({kind:"cells",id:`cells-${n.length}`,items:l}),l=[])};return o.forEach(({key:e,name:o,value:s})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:p,componentProperties:u,hideFromReadData:h,customReadDataLabels:m}=c||{};if(h?.length&&Kt(h,a,i))return;const{type:g}=wt(u,{type:""}),f=d||"password"===g;if(m?.length)m.forEach(({condition:t,...n},o)=>{t==s&&l.push({id:`${e}-custom-${o}`,title:n.title,label:n.value})});else if(s)if(f)l.push({id:e,title:o,label:new Array(10).fill("•").join("")});else{if(p===Bt.MultiInput){const t=wt(s,null);if(Array.isArray(t)&&t.length)return r(),void n.push({kind:"list",id:e,title:o,items:t.map((t,n)=>({id:`${e}-${n}`,label:String(t)}))})}if(p===Bt.KeyValuePair){const t=wt(s,null);if(Array.isArray(t)&&t.length)return r(),void n.push({kind:"pairs",id:e,title:o,items:t.map((t,n)=>{const o=t&&"object"==typeof t?t:{};return{id:`${e}-${n}`,title:null!=o.key?String(o.key):"",label:null!=o.value?String(o.value):""}})})}l.push({id:e,title:o,label:s})}else l.push({id:e,title:o,label:"-"})}),r(),n})(D,P);return e(n,{children:[t(Mt,{isOpen:!0,header:{icon:H,iconSrc:j,title:D.name||D.destinationType.displayName,onClose:M,actions:[{id:"edit-destination-btn-edit",label:Lt.EDIT,icon:Ma,active:k,onClick:L},{id:"edit-destination-btn-delete",label:Lt.DELETE,icon:Aa,color:r.v2.colors.red[500],active:N,onClick:U}]},footer:{actions:k?[{"data-id":"edit-destination-btn-cancel",label:Lt.CANCEL,variant:ve.Secondary,onClick:z},...y?.option.testConnectionSupported&&!s?[{"data-id":"edit-destination-btn-test-connection",label:Lt.TEST_CONNECTION,variant:ve.Secondary,onClick:()=>T.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:Lt.SAVE,variant:ve.Primary,onClick:X}]:[]},children:t(ut,{$padding:"4px 12px 12px",children:b?t(mt,{$height:"50vh",children:t(yt,{withSpinner:!0})}):k&&y?t(bs,{ref:T,isEdit:!0}):t(ee,{$gap:16,children:e(Vt,{bgTint:"1000",children:[e(Vt,{bgTint:"900",children:[!s&&t(Ht,{conditions:D.conditions||[]}),t(Vt,{bgTint:"800",cellsPerRow:2,items:ip(D)})]}),!!G.length&&t(Vt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:G.map(e=>"cells"===e.kind?t(Vt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(Vt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(Er,{target:"destination",isOpen:N,onClose:()=>E(!1),onApprove:V}),t(Nr,{isOpen:null!==O,onClose:()=>$(null),onApprove:B})]})},lp=(e,t)=>{const n=[{id:"type",title:Ze.TYPE,label:t.label},{id:"status",title:Ze.STATUS,badge:{status:e.disabled?Ee.Unknown:Ee.Success,label:e.disabled?Ze.DISABLED:Ze.ENABLED}}];return e.ruleName&&n.push({id:"name",title:Ze.NAME,label:e.ruleName}),e.profileName&&n.push({id:"profile",title:Ze.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&n.push({id:"notes",title:Ze.NOTES,label:e.notes}),n},rp=({onClose:o,ruleId:l})=>{const r=v(),{addNotification:s}=qt(),{isVm:p}=S(),{instrumentationRulesApi:u}=Vl(),{items:h,refetch:m}=u.useRules(),{selectedOption:g,loadRule:f,validateFormData:b,genericForm:y}=jl();i(()=>{m()},[]);const[C,x]=a(!1),[w,T]=a(!1),[k,I]=a(null),N=C&&!!y?.isFormDirty,{options:E}=u.useRuleTypes(),O=c(()=>E.length?E:Tt,[E]),$=c(()=>h?.find(e=>Xt(e)===l),[l,h]),A=c(()=>O.find(({type:e})=>e===$?.type)??null,[O,$?.type]),R=c(()=>Ge(A?.supportedLanguages),[A?.supportedLanguages]);i(()=>{$&&A&&f($,A)},[$,A]);const D=d(()=>{if($){if(!$.mutable)return void s({type:Ee.Warning,title:He.FORBIDDEN,message:He.CANNOT_EDIT_RULE,crdType:kt.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});x(!0)}},[$,s]),_=d(()=>{$&&A&&(f($,A),x(!1))},[$,A,f]),P=d(()=>{N?I("close"):o()},[N,o]),L=d(()=>{N?I("cancel"):_()},[N,_]),F=d(()=>{const e=k;I(null),"close"===e?(_(),o()):_()},[k,_,o]),M=d(async()=>{if($){const{errorMessage:e,preparedFormData:t}=b();e||(await u.update($.ruleId,t,$.type),x(!1))}},[$,b,u]),z=d(()=>{if($){if(!$.mutable)return void s({type:Ee.Warning,title:He.FORBIDDEN,message:He.CANNOT_DELETE_RULE,crdType:kt.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});T(!0)}},[$,s]),B=d(async()=>{$&&(await u.remove($.ruleId,$.type),o())},[$,u,o]);if(!$||!A)return null;const X=(U=$,V=A,V?.fields?.length?zt(U,V.fields,{skipComponentTypes:[Bt.SourceScopes]}):[]);var U,V;return e(n,{children:[t(Mt,{isOpen:!0,header:{icon:Qt($.type),title:A.label,onClose:P,actions:[{id:"edit-rule-btn-edit",label:Lt.EDIT,icon:Ma,active:C,onClick:D},{id:"edit-rule-btn-delete",label:Lt.DELETE,icon:Aa,color:r.v2.colors.red[500],active:w,onClick:z}]},footer:{actions:C?[{"data-id":"edit-rule-btn-cancel",label:Lt.CANCEL,variant:ve.Secondary,onClick:L},{"data-id":"edit-rule-btn-save",label:Lt.SAVE,variant:ve.Primary,onClick:M}]:[]},children:t(ut,{$padding:"4px 12px 12px",children:C&&g?t(ks,{}):t(ee,{$gap:16,children:e(Vt,{bgTint:"1000",children:[e(Vt,{bgTint:"900",children:[!p&&t(Ht,{conditions:$.conditions||[]}),t(Vt,{bgTint:"800",cellsPerRow:2,items:lp($,A)})]}),!p&&t(gr,{readOnly:!0,scopes:$.sourceScopes??null}),A.type===je.CustomInstrumentation&&!!$.customInstrumentations?.[Ve.Php]?.length&&t(Ne,{status:Ee.Warning,message:He.PHP_CUSTOM_INSTRUMENTATION_RESTART,fullWidth:!0}),!!X?.length&&t(Vt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Vt,{bgTint:"800",cellsPerRow:2,items:X})}),!!R.length&&t(Vt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Vt,{bgTint:"800",children:t(pe,{$gap:12,$wrap:"wrap",children:R.map(e=>t(Zt,{label:Je(e),leftIcon:Ye(e),flex:R.length>1?"0.5":"1"},e))})})})]})})})}),t(Er,{target:"instrumentation rule",isOpen:w,onClose:()=>T(!1),onApprove:B}),t(Nr,{isOpen:null!==k,onClose:()=>I(null),onApprove:F})]})};var sp;(e=>{e.Overview="overview",e.Pods="pods",e.Libraries="libraries",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"})(sp||(sp={}));const cp=({collapseIsDefaultOpen:e,isJumpToTarget:n,onClickRestartPod:o,namespace:i,podName:a,nodeName:l,startTime:r,agentInjectedStatus:s,odigosHealthStatus:d,k8sHealthStatus:p,children:u})=>{const{formatDurationAgo:h}=en(),m=tn(!!n),g=c(()=>({title:a,icon:sl,withCopy:!0}),[a]),f=c(()=>{const e=[],t=nn(s);t&&e.push(t);const n=nn(d,cl,"health");n&&e.push(n);const o=nn(p,dl,"health");return o&&e.push(o),e},[s,d,p]),b=c(()=>o?[{id:`restart-pod-${a}`,icon:ll,label:Lt.RESTART_POD,onClick:()=>o(i,a)}]:void 0,[o,i,a]),v=c(()=>[{id:"nodeName",title:Ze.NODE,label:l,withCopy:!0},{id:"age",title:Ze.AGE,label:r?h(r,{style:"short"}):Ze.NOT_RUNNING,labelTooltip:r}],[l,r,h]);return t("div",{ref:m,children:t(Vt,{bgTint:"900",richTitle:g,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:u})})},dp=b.div`
537
+ `,Zd=({isTesting:n,error:o,result:i})=>{const a=v(),{CopyButton:l}=_t(),r=c(()=>i?.checks.filter(e=>!e.passed)??[],[i]),s=!(n||!o&&(!i||i.success)),d=o?Ze.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT:r[0]?.remediation||r[0]?.message||Ze.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT,p=o||r.map(e=>e.message).filter(Boolean).join("\n");return t(zd,{children:t(Bd,{children:n?t(Xd,{children:t(Ud,{children:t(yt,{withVisual:!0,withGradient:!0,title:Ze.CLOUD_CONNECTOR_TESTING_TITLE,titleSize:Te.XS})})}):s?t(Xd,{children:e(Vd,{children:[t(Hd,{children:t(Ja,{size:20,fill:a.v2.colors.black[500]})}),t(_e,{size:Te.XS,weight:400,lineHeight:"20px",color:Pe.Primary,children:Ze.CLOUD_CONNECTOR_CONNECTION_FAILED_TITLE}),t(_e,{align:"center",size:Te.XXXS,weight:400,lineHeight:"normal",color:Pe.Secondary,children:d}),p&&e(jd,{children:[t(Gd,{children:p}),t(l,{value:p,size:vt.XS})]})]})}):i?e(Wd,{children:[t(Ke,{status:Ee.Success,label:Ze.CLOUD_CONNECTOR_VALIDATE_SUCCESS,leftIcon:Ya,fullWidth:!0}),(i.accountId||i.identity)&&e(Kd,{children:[i.accountId&&e(Yd,{children:[e(_e,{size:Te.XXS,weight:500,color:Pe.Secondary,children:[Ze.CLOUD_CONNECTOR_VALIDATE_ACCOUNT,":"]}),t(_e,{size:Te.XXS,weight:400,color:Pe.Primary,children:i.accountId})]}),i.identity&&e(Yd,{children:[e(_e,{size:Te.XXS,weight:500,color:Pe.Secondary,children:[Ze.CLOUD_CONNECTOR_VALIDATE_IDENTITY,":"]}),t(_e,{size:Te.XXS,weight:400,color:Pe.Primary,children:i.identity})]})]}),i.checks.length>0&&t(Jd,{children:i.checks.map(n=>e(qd,{$passed:n.passed,children:[t(Ke,{status:n.passed?Ee.Success:Ee.Error,label:n.displayName,leftIcon:n.passed?Ya:Ja}),n.message&&t(_e,{size:Te.XXS,weight:400,lineHeight:"normal",color:Pe.Secondary,children:n.message}),!n.passed&&n.remediation&&t(_e,{size:Te.XXS,weight:400,lineHeight:"normal",color:Pe.Primary,children:n.remediation})]},n.name))})]}):t(Xd,{children:t(_e,{size:Te.XXS,weight:400,color:Pe.Secondary,children:Ze.CLOUD_CONNECTOR_VALIDATE_EMPTY})})})})};var Qd;(e=>{e[e.SelectProvider=1]="SelectProvider",e[e.Config=2]="Config",e[e.Validate=3]="Validate"})(Qd||(Qd={}));const ep=Qd.SelectProvider,tp=Qd.Validate,np=({onClose:n,withOverlay:o,onCreateCloudConnector:i,onCreated:l})=>{const{providers:r,genericForm:s}=or(),[p,u]=a(ep),[h,m]=a(!1),[g,f]=a(!1),[b,v]=a(void 0),[y,C]=a(void 0),[S,x]=a(void 0),w=s.isFormDirty,T=p===ep,k=p===tp,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>ep?e-1:e)},[]),E=d(()=>{if(x(void 0),p===Qd.SelectProvider){if(!s.formData.provider)return void x("Please select a cloud provider");if(!s.formData.permission)return void x("Please select a permission level")}u(e=>e<tp?e+1:e)},[p,s.formData.provider,s.formData.permission]),O=d(async()=>{if(x(void 0),C(void 0),v(void 0),u(Qd.Validate),!i)return;const{provider:e,permission:t,customCapabilities:n,awsAccountId:o,credentials:a,name:c}=s.formData,d=((e,t,n)=>{const o=zc(e),i=[];return o.forEach(e=>{const o=void 0!==e.instrumentationPermissions;let a=!1,l=!1;switch(t){case Lc.DiscoveryOnly:a=!0;break;case Lc.DiscoveryInstrumentation:a=!0,l=o;break;case Lc.Custom:{const t=n[e.typeName];a=!!t?.discovery,l=!!t?.instrumentation;break}}(a||l)&&i.push({type:e.typeName,discovery:a,instrumentation:l,computePlatforms:!1})}),i})(r.find(t=>t.provider===e),t,n);f(!0);try{const t=await i({provider:e,displayName:c,credentials:a,expectedAccountId:o,capabilities:d});if(t.created)return void l?.(t.connectorId);v(t.test)}catch(e){C(e instanceof Error?e.message:"Failed to create connector")}finally{f(!1)}},[i,l,s.formData,r]),$=g,A=k&&!g&&(!!y||!!b&&!b.success),R=c(()=>S?{status:Ee.Error,message:S}:void 0,[S]),D=c(()=>T?{"data-id":"cloud-connector-cancel",label:Lt.CANCEL,variant:ve.Secondary,onClick:I,disabled:$}:{"data-id":"cloud-connector-back",label:Lt.BACK,variant:ve.Text,leftIcon:ll,onClick:N,disabled:$},[T,I,N,$]),_=c(()=>{if(k){if(g)return;return A?{"data-id":"cloud-connector-retry",label:Lt.RETRY,variant:ve.Primary,rightIcon:sl,onClick:O}:void 0}return p===Qd.Config?{"data-id":"cloud-connector-verify",label:Lt.VERIFY_AND_CREATE_CONNECTOR,variant:ve.Primary,onClick:O,disabled:$}:{"data-id":"cloud-connector-next",label:Lt.NEXT,variant:ve.Primary,onClick:E,disabled:$}},[k,g,A,p,O,E,$]),P=c(()=>[D,_].filter(Boolean),[D,_]);return e(Mt,{width:Er,isOpen:!0,hideOverlay:!$&&!o,header:{icon:ol,title:Ze.CREATE_CLOUD_CONNECTOR,onClose:n?I:void 0,onCloseDisabled:$},footer:{note:R,actions:P},children:[p===Qd.SelectProvider&&t(ad,{}),p===Qd.Config&&t(Md,{onBack:N}),p===Qd.Validate&&t(Zd,{isTesting:g,error:y,result:b}),t(Or,{isOpen:h,onClose:()=>m(!1),onApprove:()=>n?.()})]})},op=({statuses:e})=>{const n=c(()=>zt(e).map(({status:e,type:t,reason:n,message:o})=>({status:e,title:Bt(n||t),subTitle:o??void 0})),[e]);return n.length?t(ee,{$gap:12,children:n.map(e=>t(Xt,{invertColors:!0,slim:!0,width:"100%",...e},e.title))}):null},ip=(e,t)=>{const n=[{id:"type",title:Ze.TYPE,label:t.label},{id:"status",title:Ze.STATUS,badge:{status:e.disabled?Ee.Unknown:Ee.Success,label:e.disabled?Ze.DISABLED:Ze.ENABLED}}],o=e.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return o&&n.push({id:"signals",title:Ze.SIGNALS_FOR_PROCESSING,label:o}),e.name&&n.push({id:"name",title:Ze.NAME,label:e.name}),e.notes&&n.push({id:"notes",title:Ze.NOTES,label:e.notes}),n},ap=({onClose:o,actionId:l})=>{const r=v(),{isVm:s}=S(),{actionsApi:u}=jl(),{items:h,refetch:m}=u.useActions(),{options:g}=u.useActionTypes(),{selectedOption:f,loadAction:b,validateFormData:y,genericForm:C}=Hl(),x=p(m);x.current=m,i(()=>{x.current()},[]);const[w,T]=a(!1),[k,I]=a(!1),[N,E]=a(null),O=w&&!!C?.isFormDirty;i(()=>{if(w)return;const e=setInterval(()=>x.current(),3e3);return()=>clearInterval(e)},[w]);const $=c(()=>h?.find(e=>Ht(e)===l),[l,h]),A=c(()=>g.find(({type:e})=>e===$?.type)??jt.find(({type:e})=>e===$?.type)??null,[g,$?.type]),R=Array.isArray($?.statuses)?$.statuses:null;i(()=>{$&&b($,A)},[$,A]);const D=d(()=>{$&&T(!0)},[$]),_=d(()=>{$&&(b($,A),T(!1))},[$,A,b]),P=d(()=>{O?E("close"):o()},[O,o]),L=d(()=>{O?E("cancel"):_()},[O,_]),F=d(()=>{const e=N;E(null),"close"===e?(_(),o()):_()},[N,_,o]),M=d(async()=>{if($){const{errorMessage:e,preparedFormData:t}=y();e||(await u.update($.id,t),T(!1))}},[$,y,u]),z=d(()=>{$&&I(!0)},[$]),B=d(async()=>{$&&(await u.remove($.id,$.type),o())},[$,u,o]);if(!$||!A)return null;const X=(U=$,V=A,V?.fields?.length?Ut(U.fields||{},V.fields,{signals:U.signals||[],skipComponentTypes:[Vt.SourceScopes]}):[]);var U,V;const H=A.fields?.find(e=>e.componentType===Vt.SourceScopes),j=H?.name||Q.Scopes,G=$.fields?.[j]??null,W=!(s||!H&&void 0===$.fields?.scopes);return e(n,{children:[t(Mt,{isOpen:!0,header:{icon:Kt($.type),title:A.label,onClose:P,actions:[{id:"edit-action-btn-edit",label:Lt.EDIT,icon:Ba,active:w,onClick:D},{id:"edit-action-btn-delete",label:Lt.DELETE,icon:Da,color:r.v2.colors.red[500],active:k,onClick:z}]},footer:{actions:w?[{"data-id":"edit-action-btn-cancel",label:Lt.CANCEL,variant:ve.Secondary,onClick:L},{"data-id":"edit-action-btn-save",label:Lt.SAVE,variant:ve.Primary,onClick:M}]:[]},children:t(ut,{$padding:"4px 12px 12px",children:w&&f?t(bs,{}):t(ee,{$gap:16,children:e(Gt,{bgTint:"1000",children:[!s&&(R?t(op,{statuses:R}):t(Wt,{conditions:$.conditions||[]})),t(Gt,{bgTint:"800",cellsPerRow:2,items:ip($,A)}),W&&t(br,{readOnly:!0,scopes:G}),!!X?.length&&t(Gt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Gt,{bgTint:"800",cellsPerRow:2,items:X})})]})})})}),t($r,{target:"action",isOpen:k,onClose:()=>I(!1),onApprove:B}),t(Or,{isOpen:null!==N,onClose:()=>E(null),onApprove:F})]})},lp=({onClose:n,connections:o,selectedConnectionIds:l,setSelectedConnectionIds:r})=>{const{configApi:s}=jl(),[d,u]=a(""),[h,m]=a({showOnlySelected:!1}),g=c(()=>o.filter(e=>{const t=!d||e.name.toLowerCase().includes(d.toLowerCase()),n=!h.showOnlySelected||h.showOnlySelected&&l.includes(e.id);return t&&n}),[o.length,l.length,d,h]),f=e=>{r(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=1===l.length?l[0]:void 0,{data:v,loading:y}=s.useEffectiveConfig(b?{id:b}:void 0,{skip:!b}),C=c(()=>{if(b&&v)return{rollout:{automaticRolloutDisabled:v.rollout?.automaticRolloutDisabled??!1}}},[b,v]),{formData:S,handleFormChange:x,areFormValuesEqual:w,resetFormData:T}=Yt(C||{rollout:{automaticRolloutDisabled:!1}}),k=p(T);k.current=T,i(()=>{C&&k.current(C)},[C]);const I=c(()=>l.length>1||void 0!==C&&!w(C,S),[l.length,C,S]);return t(Nr,{isOpen:!0,onClose:n,onSave:async()=>await(s.applyConfigurations?.(S,l))??void 0,header:{icon:cl,title:"Cluster Configuration"},connectionIds:{value:l,setValue:r},search:{placeholder:"Search by cluster name",value:d,onChange:u},filters:e(pe,{$gap:8,children:[t(_e,{size:Te.XXXS,color:Pe.Secondary,nowrap:!0,children:"Show only:"}),t(le,{size:Nt.S,label:"Selected",value:h.showOnlySelected,onChange:e=>m(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:I,isFetching:y,leftColumn:{width:"35%",header:e(pe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(pe,{$gap:8,children:[t(_e,{size:Te.XS,children:"Clusters"}),t(Ke,{label:g.length,status:Ee.Unknown})]}),e(pe,{$gap:8,children:[t(_e,{size:Te.XXXS,color:Pe.Secondary,align:"right",children:"Selected clusters"}),t(Ke,{label:`${l.length}/${g.length}`,status:Ee.Unknown})]})]}),list:g.map(e=>t(Gs,{title:e.name,isChecked:l.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(_e,{size:Te.XS,children:"Configurations"}),list:[t(le,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>x("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},rp=e=>{const t=[{id:"type",title:Ze.TYPE,label:e.destinationType.displayName},{id:"status",title:Ze.STATUS,badge:{status:e.disabled?Ee.Unknown:Ee.Success,label:e.disabled?Ze.DISABLED:Ze.ENABLED}}],n=Ae(e.exportedSignals).map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return n&&t.push({id:"monitors",title:Ze.MONITORS,label:n}),e.name&&t.push({id:"name",title:Ze.NAME,label:e.name}),t},sp=({onClose:o,destinationId:l})=>{const r=v(),{isVm:s}=S(),{destinationsApi:u}=jl(),{selectedStreamName:h}=Qe(),{items:m,refetch:g}=u.useDestinations(),{data:f,loading:b}=u.useDestinationCategories(),{activeForm:y,loadDestination:C,validateFormData:x,genericForm:w}=Gl();i(()=>{g()},[]);const T=p(null),[k,I]=a(!1),[N,E]=a(!1),[O,$]=a(null),A=k&&!!w?.isFormDirty,R=c(()=>Zt(m,h),[m,h]),D=c(()=>R?.find(e=>Ht(e)===l),[l,R]),_=f?.destinationCategories?.categories??null;i(()=>{D&&_&&C(D,_)},[D,_]);const P=c(()=>D&&_?Qt(_,D):[],[D,_]),L=d(()=>{D&&I(!0)},[D]),F=d(()=>{D&&_&&(C(D,_),I(!1))},[D,_,C]),M=d(()=>{A?$("close"):o()},[A,o]),z=d(()=>{A?$("cancel"):F()},[A,F]),B=d(()=>{const e=O;$(null),"close"===e?(F(),o()):F()},[O,F,o]),X=d(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=x();e||(await u.update(D.id,De(t)),I(!1))}},[D,x,u]),U=d(()=>{D&&E(!0)},[D]),V=d(async()=>{D&&(await u.remove(D.id),o())},[D,u,o]);if(!D)return null;const{icon:H,iconSrc:j}=St(D.destinationType.type),G=((e,t)=>{const n=[],o=Jt(e,t),i=o.map(e=>({name:e.key,value:e.value})),a=Ae(e.exportedSignals);let l=[];const r=()=>{l.length&&(n.push({kind:"cells",id:`cells-${n.length}`,items:l}),l=[])};return o.forEach(({key:e,name:o,value:s})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:p,componentProperties:u,hideFromReadData:h,customReadDataLabels:m}=c||{};if(h?.length&&qt(h,a,i))return;const{type:g}=wt(u,{type:""}),f=d||"password"===g;if(m?.length)m.forEach(({condition:t,...n},o)=>{t==s&&l.push({id:`${e}-custom-${o}`,title:n.title,label:n.value})});else if(s)if(f)l.push({id:e,title:o,label:new Array(10).fill("•").join("")});else{if(p===Vt.MultiInput){const t=wt(s,null);if(Array.isArray(t)&&t.length)return r(),void n.push({kind:"list",id:e,title:o,items:t.map((t,n)=>({id:`${e}-${n}`,label:String(t)}))})}if(p===Vt.KeyValuePair){const t=wt(s,null);if(Array.isArray(t)&&t.length)return r(),void n.push({kind:"pairs",id:e,title:o,items:t.map((t,n)=>{const o=t&&"object"==typeof t?t:{};return{id:`${e}-${n}`,title:null!=o.key?String(o.key):"",label:null!=o.value?String(o.value):""}})})}l.push({id:e,title:o,label:s})}else l.push({id:e,title:o,label:"-"})}),r(),n})(D,P);return e(n,{children:[t(Mt,{isOpen:!0,header:{icon:H,iconSrc:j,title:D.name||D.destinationType.displayName,onClose:M,actions:[{id:"edit-destination-btn-edit",label:Lt.EDIT,icon:Ba,active:k,onClick:L},{id:"edit-destination-btn-delete",label:Lt.DELETE,icon:Da,color:r.v2.colors.red[500],active:N,onClick:U}]},footer:{actions:k?[{"data-id":"edit-destination-btn-cancel",label:Lt.CANCEL,variant:ve.Secondary,onClick:z},...y?.option.testConnectionSupported&&!s?[{"data-id":"edit-destination-btn-test-connection",label:Lt.TEST_CONNECTION,variant:ve.Secondary,onClick:()=>T.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:Lt.SAVE,variant:ve.Primary,onClick:X}]:[]},children:t(ut,{$padding:"4px 12px 12px",children:b?t(mt,{$height:"50vh",children:t(yt,{withSpinner:!0})}):k&&y?t(ys,{ref:T,isEdit:!0}):t(ee,{$gap:16,children:e(Gt,{bgTint:"1000",children:[e(Gt,{bgTint:"900",children:[!s&&t(Wt,{conditions:D.conditions||[]}),t(Gt,{bgTint:"800",cellsPerRow:2,items:rp(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($r,{target:"destination",isOpen:N,onClose:()=>E(!1),onApprove:V}),t(Or,{isOpen:null!==O,onClose:()=>$(null),onApprove:B})]})},cp=(e,t)=>{const n=[{id:"type",title:Ze.TYPE,label:t.label},{id:"status",title:Ze.STATUS,badge:{status:e.disabled?Ee.Unknown:Ee.Success,label:e.disabled?Ze.DISABLED:Ze.ENABLED}}];return e.ruleName&&n.push({id:"name",title:Ze.NAME,label:e.ruleName}),e.profileName&&n.push({id:"profile",title:Ze.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&n.push({id:"notes",title:Ze.NOTES,label:e.notes}),n},dp=({onClose:o,ruleId:l})=>{const r=v(),{addNotification:s}=en(),{isVm:p}=S(),{instrumentationRulesApi:u}=jl(),{items:h,refetch:m}=u.useRules(),{selectedOption:g,loadRule:f,validateFormData:b,genericForm:y}=Wl();i(()=>{m()},[]);const[C,x]=a(!1),[w,T]=a(!1),[k,I]=a(null),N=C&&!!y?.isFormDirty,{options:E}=u.useRuleTypes(),O=c(()=>E.length?E:Tt,[E]),$=c(()=>h?.find(e=>Ht(e)===l),[l,h]),A=c(()=>O.find(({type:e})=>e===$?.type)??null,[O,$?.type]),R=c(()=>Ge(A?.supportedLanguages),[A?.supportedLanguages]);i(()=>{$&&A&&f($,A)},[$,A]);const D=d(()=>{if($){if(!$.mutable)return void s({type:Ee.Warning,title:He.FORBIDDEN,message:He.CANNOT_EDIT_RULE,crdType:kt.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});x(!0)}},[$,s]),_=d(()=>{$&&A&&(f($,A),x(!1))},[$,A,f]),P=d(()=>{N?I("close"):o()},[N,o]),L=d(()=>{N?I("cancel"):_()},[N,_]),F=d(()=>{const e=k;I(null),"close"===e?(_(),o()):_()},[k,_,o]),M=d(async()=>{if($){const{errorMessage:e,preparedFormData:t}=b();e||(await u.update($.ruleId,t,$.type),x(!1))}},[$,b,u]),z=d(()=>{if($){if(!$.mutable)return void s({type:Ee.Warning,title:He.FORBIDDEN,message:He.CANNOT_DELETE_RULE,crdType:kt.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});T(!0)}},[$,s]),B=d(async()=>{$&&(await u.remove($.ruleId,$.type),o())},[$,u,o]);if(!$||!A)return null;const X=(U=$,V=A,V?.fields?.length?Ut(U,V.fields,{skipComponentTypes:[Vt.SourceScopes]}):[]);var U,V;return e(n,{children:[t(Mt,{isOpen:!0,header:{icon:nn($.type),title:A.label,onClose:P,actions:[{id:"edit-rule-btn-edit",label:Lt.EDIT,icon:Ba,active:C,onClick:D},{id:"edit-rule-btn-delete",label:Lt.DELETE,icon:Da,color:r.v2.colors.red[500],active:w,onClick:z}]},footer:{actions:C?[{"data-id":"edit-rule-btn-cancel",label:Lt.CANCEL,variant:ve.Secondary,onClick:L},{"data-id":"edit-rule-btn-save",label:Lt.SAVE,variant:ve.Primary,onClick:M}]:[]},children:t(ut,{$padding:"4px 12px 12px",children:C&&g?t(Ns,{}):t(ee,{$gap:16,children:e(Gt,{bgTint:"1000",children:[e(Gt,{bgTint:"900",children:[!p&&t(Wt,{conditions:$.conditions||[]}),t(Gt,{bgTint:"800",cellsPerRow:2,items:cp($,A)})]}),!p&&t(br,{readOnly:!0,scopes:$.sourceScopes??null}),A.type===je.CustomInstrumentation&&!!$.customInstrumentations?.[Ve.Php]?.length&&t(Ne,{status:Ee.Warning,message:He.PHP_CUSTOM_INSTRUMENTATION_RESTART,fullWidth:!0}),!!X?.length&&t(Gt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Gt,{bgTint:"800",cellsPerRow:2,items:X})}),!!R.length&&t(Gt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Gt,{bgTint:"800",children:t(pe,{$gap:12,$wrap:"wrap",children:R.map(e=>t(tn,{label:Je(e),leftIcon:Ye(e),flex:R.length>1?"0.5":"1"},e))})})})]})})})}),t($r,{target:"instrumentation rule",isOpen:w,onClose:()=>T(!1),onApprove:B}),t(Or,{isOpen:null!==k,onClose:()=>I(null),onApprove:F})]})};var pp;(e=>{e.Overview="overview",e.Pods="pods",e.Libraries="libraries",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"})(pp||(pp={}));const up=({collapseIsDefaultOpen:e,isJumpToTarget:n,onClickRestartPod:o,namespace:i,podName:a,nodeName:l,startTime:r,agentInjectedStatus:s,odigosHealthStatus:d,k8sHealthStatus:p,children:u})=>{const{formatDurationAgo:h}=on(),m=an(!!n),g=c(()=>({title:a,icon:dl,withCopy:!0}),[a]),f=c(()=>{const e=[],t=ln(s);t&&e.push(t);const n=ln(d,pl,"health");n&&e.push(n);const o=ln(p,ul,"health");return o&&e.push(o),e},[s,d,p]),b=c(()=>o?[{id:`restart-pod-${a}`,icon:sl,label:Lt.RESTART_POD,onClick:()=>o(i,a)}]:void 0,[o,i,a]),v=c(()=>[{id:"nodeName",title:Ze.NODE,label:l,withCopy:!0},{id:"age",title:Ze.AGE,label:r?h(r,{style:"short"}):Ze.NOT_RUNNING,labelTooltip:r}],[l,r,h]);return t("div",{ref:m,children:t(Gt,{bgTint:"900",richTitle:g,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:u})})},hp=b.div`
538
538
  display: flex;
539
539
  align-items: center;
540
540
  justify-content: space-between;
@@ -542,7 +542,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
542
542
  padding: ${({$noPadding:e})=>e?"0":"12px"};
543
543
  border-radius: 12px;
544
544
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
545
- `,pp=({podsOdigosHealthStatus:n,pods:o,noPadding:i})=>{const a=rn(n?.status),l=on(n?.name),r=n?.message,{totalPodsCount:s,odigosHealthyPodsCount:d,k8sHealthyPodsCount:p}=c(()=>({totalPodsCount:o?.length||0,odigosHealthyPodsCount:o?.reduce((e,t)=>e+(t.odigosHealthStatus?.status===an.Success?1:0),0)||0,k8sHealthyPodsCount:o?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===an.Success?1:0),0)||0}),[o]);return o?.length&&n&&a?e(dp,{$noPadding:i,children:[t(ln,{invertColors:!0,hideBackground:!0,status:a,title:l,subTitle:r}),e(pe,{$gap:8,children:[t(hp,{label:Ze.PODS,count:s}),t(hp,{label:Ze.ODIGOS_HEALTHY,icon:cl,count:d,total:s}),t(hp,{label:Ze.KUBERNETES_HEALTHY,icon:dl,count:p,total:s})]})]}):null},up=b.div`
545
+ `,mp=({podsOdigosHealthStatus:n,pods:o,noPadding:i})=>{const a=sn(n?.status),l=Bt(n?.name),r=n?.message,{totalPodsCount:s,odigosHealthyPodsCount:d,k8sHealthyPodsCount:p}=c(()=>({totalPodsCount:o?.length||0,odigosHealthyPodsCount:o?.reduce((e,t)=>e+(t.odigosHealthStatus?.status===rn.Success?1:0),0)||0,k8sHealthyPodsCount:o?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===rn.Success?1:0),0)||0}),[o]);return o?.length&&n&&a?e(hp,{$noPadding:i,children:[t(Xt,{invertColors:!0,hideBackground:!0,status:a,title:l,subTitle:r}),e(pe,{$gap:8,children:[t(fp,{label:Ze.PODS,count:s}),t(fp,{label:Ze.ODIGOS_HEALTHY,icon:pl,count:d,total:s}),t(fp,{label:Ze.KUBERNETES_HEALTHY,icon:ul,count:p,total:s})]})]}):null},gp=b.div`
546
546
  display: flex;
547
547
  flex-direction: column;
548
548
  justify-content: center;
@@ -553,7 +553,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
553
553
  width: fit-content;
554
554
  border-radius: 8px;
555
555
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
556
- `,hp=({count:n,total:o,label:i,icon:a})=>{const l=v(),r=void 0===o?void 0:n===o?l.v2.colors.green[500]:l.v2.colors.red[500];return e(up,{children:[e(pe,{$gap:0,$alignItems:"flex-end",children:[t(_e,{size:Te.L,color:r,weight:500,nowrap:!0,children:n}),void 0!==o&&t(_e,{size:Te.S,color:r,weight:500,nowrap:!0,children:`/${o}`})]}),e(pe,{$alignItems:"center",$gap:4,children:[a&&t(a,{size:16}),t(_e,{size:Te.XXXS,nowrap:!0,children:i})]})]})},mp=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===sn.PID)??e.identifyingAttributes?.find(({name:e})=>e===sn.VPID);return t?.value??null};var gp;(e=>{e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"})(gp||(gp={}));const fp=({overrideProcessNum:n,healthy:o,healthStatus:l,identifyingAttributes:r,instrumentations:s,isJumpToTarget:d})=>{const p=v(),[u,h]=a(gp.IdentifyingAttributes),m=tn(!!d),{tabOptions:g,firstTabValue:f,bothTabsDisabled:b}=c(()=>{const e=s?.some(e=>!1===e.healthy),n=[{value:gp.IdentifyingAttributes,label:Ze.IDENTIFYING_ATTRIBUTES,disabled:!r?.length,selectedBgColor:p.v2.colors.purple[500]},{value:gp.InstrumentationLibraries,label:Ze.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(pl,{...e,fill:p.v2.colors.red[500]}):void 0,disabled:!s?.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)}},[r,s]);i(()=>{f&&h(f)},[f]);const y=c(()=>{switch(u){case gp.IdentifyingAttributes:return t(ee,{children:r?.map((e,n)=>t(Sp,{label:e.name,value:e.value},`attr-${n}-${e.name}`))});case gp.InstrumentationLibraries:return t(ee,{children:s?.map((e,n)=>t(Sp,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${n}-${e.name}`))});default:return null}},[u,r,s]),C=c(()=>mp({overrideProcessNum:n,identifyingAttributes:r}),[n,r]);return t("div",{ref:m,children:e(Vt,{bgTint:"800",richTitle:{title:C?`${Ze.PROCESS} ${Ze.PID(C)}`:Ze.PROCESS_FALLBACK_NAME},renderOnRightSide:t(_e,{color:o?Pe.Success:Pe.Error,size:Te.XXXS,children:l?.message}),badges:[{key:"odigos-healthy",status:o?Ee.Success:Ee.Error,leftIcon:cl,label:o?Ze.HEALTHY:Ze.NOT_HEALTHY,textSize:Te.XXXS,invertColors:!0,useSecondaryTone:!0}],withCollapse:!b,collapseIsDefaultOpen:d,children:[!b&&t(ce,{options:g,selected:u,setSelected:h}),!b&&y]})})},bp=b.div`
556
+ `,fp=({count:n,total:o,label:i,icon:a})=>{const l=v(),r=void 0===o?void 0:n===o?l.v2.colors.green[500]:l.v2.colors.red[500];return e(gp,{children:[e(pe,{$gap:0,$alignItems:"flex-end",children:[t(_e,{size:Te.L,color:r,weight:500,nowrap:!0,children:n}),void 0!==o&&t(_e,{size:Te.S,color:r,weight:500,nowrap:!0,children:`/${o}`})]}),e(pe,{$alignItems:"center",$gap:4,children:[a&&t(a,{size:16}),t(_e,{size:Te.XXXS,nowrap:!0,children:i})]})]})},bp=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===cn.PID)??e.identifyingAttributes?.find(({name:e})=>e===cn.VPID);return t?.value??null};var vp;(e=>{e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"})(vp||(vp={}));const yp=({overrideProcessNum:n,healthy:o,healthStatus:l,identifyingAttributes:r,instrumentations:s,isJumpToTarget:d})=>{const p=v(),[u,h]=a(vp.IdentifyingAttributes),m=an(!!d),{tabOptions:g,firstTabValue:f,bothTabsDisabled:b}=c(()=>{const e=s?.some(e=>!1===e.healthy),n=[{value:vp.IdentifyingAttributes,label:Ze.IDENTIFYING_ATTRIBUTES,disabled:!r?.length,selectedBgColor:p.v2.colors.purple[500]},{value:vp.InstrumentationLibraries,label:Ze.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(hl,{...e,fill:p.v2.colors.red[500]}):void 0,disabled:!s?.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)}},[r,s]);i(()=>{f&&h(f)},[f]);const y=c(()=>{switch(u){case vp.IdentifyingAttributes:return t(ee,{children:r?.map((e,n)=>t(Tp,{label:e.name,value:e.value},`attr-${n}-${e.name}`))});case vp.InstrumentationLibraries:return t(ee,{children:s?.map((e,n)=>t(Tp,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${n}-${e.name}`))});default:return null}},[u,r,s]),C=c(()=>bp({overrideProcessNum:n,identifyingAttributes:r}),[n,r]);return t("div",{ref:m,children:e(Gt,{bgTint:"800",richTitle:{title:C?`${Ze.PROCESS} ${Ze.PID(C)}`:Ze.PROCESS_FALLBACK_NAME},renderOnRightSide:t(_e,{color:o?Pe.Success:Pe.Error,size:Te.XXXS,children:l?.message}),badges:[{key:"odigos-healthy",status:o?Ee.Success:Ee.Error,leftIcon:pl,label:o?Ze.HEALTHY:Ze.NOT_HEALTHY,textSize:Te.XXXS,invertColors:!0,useSecondaryTone:!0}],withCollapse:!b,collapseIsDefaultOpen:d,children:[!b&&t(ce,{options:g,selected:u,setSelected:h}),!b&&y]})})},Cp=b.div`
557
557
  display: flex;
558
558
  align-items: ${({$withHealthBadge:e})=>e?"center":"flex-start"};
559
559
  gap: 8px;
@@ -562,23 +562,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
562
562
  &:hover {
563
563
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
564
564
  }
565
- `,vp=b(_e)`
565
+ `,Sp=b(_e)`
566
566
  flex: 0 0 ${({$withHealthBadge:e})=>e?"auto":"30%"};
567
- `,yp=b(_e)`
567
+ `,xp=b(_e)`
568
568
  flex: 1 1 auto;
569
569
  min-width: 0;
570
- `,Cp=b(pe)`
570
+ `,wp=b(pe)`
571
571
  flex: 1 1 auto;
572
572
  justify-content: flex-end;
573
573
  min-width: 0;
574
- `,Sp=({label:n,value:o,isStandardLibrary:i,healthy:a,message:l})=>{const r="boolean"==typeof a;return e(bp,{$withHealthBadge:r,children:[t(vp,{size:Te.XXS,color:Pe.Secondary,$withHealthBadge:r,children:n}),o&&t(yp,{size:Te.XXS,color:Pe.Primary,align:"right",children:o}),(i||r)&&e(Cp,{children:[i&&t(Ke,{status:Ee.Info,label:Ze.STANDARD,textSize:Te.XXXS,invertColors:!0}),r&&e(pe,{$gap:4,children:[l&&t(yp,{size:Te.XXXS,color:Pe.Error,align:"right",children:l}),t(Ke,{status:a?Ee.Success:Ee.Error,label:a?Ze.HEALTHY:Ze.NOT_HEALTHY,leftIcon:cl,textSize:Te.XXXS,invertColors:!0,tooltip:l??void 0})]})]})]})},xp=h(null),wp=({value:e,children:n})=>t(xp.Provider,{value:e,children:n}),Tp=({podContainers:e,sourceContainers:n,jumpToTarget:o})=>{const i=e??[],a=c(()=>({title:Ze.CONTAINERS,titleSize:Te.XS,badge:{label:i.length}}),[i.length]),l=c(()=>{const e=new Map;return n?.forEach(t=>e.set(t.containerName,t)),e},[n]);return t(Vt,{bgTint:"800",richTitle:a,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ee,{$gap:8,children:i.map(e=>{const n=o?.containerName===e.containerName;return t(Ip,{...e,language:cn(l.get(e.containerName)),jumpToTarget:n?o:null},`pod-container-${e.containerName}`)})})})},kp=b.div`
574
+ `,Tp=({label:n,value:o,isStandardLibrary:i,healthy:a,message:l})=>{const r="boolean"==typeof a;return e(Cp,{$withHealthBadge:r,children:[t(Sp,{size:Te.XXS,color:Pe.Secondary,$withHealthBadge:r,children:n}),o&&t(xp,{size:Te.XXS,color:Pe.Primary,align:"right",children:o}),(i||r)&&e(wp,{children:[i&&t(Ke,{status:Ee.Info,label:Ze.STANDARD,textSize:Te.XXXS,invertColors:!0}),r&&e(pe,{$gap:4,children:[l&&t(xp,{size:Te.XXXS,color:Pe.Error,align:"right",children:l}),t(Ke,{status:a?Ee.Success:Ee.Error,label:a?Ze.HEALTHY:Ze.NOT_HEALTHY,leftIcon:pl,textSize:Te.XXXS,invertColors:!0,tooltip:l??void 0})]})]})]})},kp=h(null),Ip=({value:e,children:n})=>t(kp.Provider,{value:e,children:n}),Np=({podContainers:e,sourceContainers:n,jumpToTarget:o})=>{const i=e??[],a=c(()=>({title:Ze.CONTAINERS,titleSize:Te.XS,badge:{label:i.length}}),[i.length]),l=c(()=>{const e=new Map;return n?.forEach(t=>e.set(t.containerName,t)),e},[n]);return t(Gt,{bgTint:"800",richTitle:a,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ee,{$gap:8,children:i.map(e=>{const n=o?.containerName===e.containerName;return t(Op,{...e,language:dn(l.get(e.containerName)),jumpToTarget:n?o:null},`pod-container-${e.containerName}`)})})})},Ep=b.div`
575
575
  display: flex;
576
576
  flex-direction: column;
577
577
  gap: 12px;
578
578
  padding: 8px 12px;
579
579
  border-radius: 8px;
580
580
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
581
- `,Ip=({language:n,containerName:o,otelDistroName:i,runningStartedTime:a,started:l,ready:r,restartCount:s,isCrashLoop:d,waitingReasonEnum:p,waitingMessage:u,odigosHealthStatus:h,k8sHealthStatus:m,processes:g,jumpToTarget:f})=>{const b=!!f,v=b&&!f?.processPid,{formatDurationAgo:y}=en(),C=tn(v),S=c(()=>({title:o,icon:n?dn(n):ul,iconWithWrapper:!0}),[o,n]),x=c(()=>{const e=[],t=nn({status:i?an.Success:an.Disabled,reasonEnum:i?Ze.INSTRUMENTED_WITH_DISTRO(i):Ze.UNINSTRUMENTED,message:""});t&&e.push(t);const n=nn(h,cl,"health");n&&e.push(n);const o=nn(m,dl,"health");return o&&e.push(o),e},[m,h,i]),w=c(()=>[{id:"runningTime",title:Ze.RUNNING_TIME,label:a?y(a,{style:"short"}):Ze.NOT_RUNNING,labelTooltip:`${Ze.RUNNING_TIME_TOOLTIP}. (${a})`},{id:"blank",spacer:!0},{id:"started",badge:{status:l?Ee.Success:Ee.Disabled,leftIcon:l?_a:Pa,label:l?Ze.STARTED:Ze.NOT_STARTED,textSize:Te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:r?Ee.Success:Ee.Disabled,leftIcon:r?_a:Pa,label:r?Ze.READY:Ze.NOT_READY,textSize:Te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"isCrashLoop",badge:{status:d?Ee.Error:Ee.Success,leftIcon:d?Pa:_a,label:d?Ze.CRASHLOOP:Ze.NO_CRASHLOOP,textSize:Te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"restartCount",title:Ze.RESTARTS,badge:{status:s?Ee.Error:void 0,label:s||0,textSize:Te.XXXS}}],[a,y,l,r,d,s]),T=c(()=>u?on(p):"",[u,p]);return t("div",{ref:C,children:e(Vt,{bgTint:"750",richTitle:S,badges:x,items:w,withCollapse:!0,collapseIsDefaultOpen:b,children:[u&&t(kp,{children:e(pe,{$gap:10,$alignItems:"center",children:[t(Zt,{variant:pn.Pink,leftIcon:dl,label:T}),t(_e,{size:Te.XXXS,color:Pe.Error,children:u})]})}),(g??[]).map((e,n)=>{const i=n+1,a=b&&(l=f,r=e,!!l?.processPid&&mp({identifyingAttributes:r.identifyingAttributes})===l.processPid);var l,r;return t(fp,{...e,overrideProcessNum:i,isJumpToTarget:a},`pod-container-${o}-process-${i}`)})]})})},Np=({podName:e,namespace:n,hasRestarted:o})=>{const i=c(()=>({title:Ze.DEBUG_COMMANDS,titleSize:Te.XS}),[]),a=c(()=>[{label:Ze.GET_POD_YAML,value:`kubectl get pod ${e} -n ${n} -o yaml`},{label:Ze.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${n}`},{label:Ze.GET_POD_LOGS,value:`kubectl logs ${e} -n ${n}${o?" -p":""}`}],[e,n,o]);return t(Vt,{bgTint:"800",richTitle:i,withCollapse:!0,children:a.map(({label:e,value:n})=>t(un,{bgTint:"700",label:e,value:n},e))})},Ep=({source:o,onClickRestartPod:i})=>{const{jumpToTarget:a}=(()=>{const e=m(xp);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e})(),l=a?.tab===sp.Pods?a:null,r=o?.pods??[],s=r.length>0,d=c(()=>r.some(e=>e.containers?.some(e=>e.restartCount&&e.restartCount>0)),[r]),p=c(()=>({title:Ze.PODS,badge:{label:r.length}}),[r.length]);return t(ee,{$gap:12,children:s?e(n,{children:[t(pp,{podsOdigosHealthStatus:o.podsOdigosHealthStatus,pods:r}),t(Vt,{bgTint:"1000",richTitle:p,children:r.map(n=>{const a=l?.podName===n.podName,r=a&&!l?.containerName;return e(cp,{...n,namespace:o.id.namespace,onClickRestartPod:i,collapseIsDefaultOpen:a,isJumpToTarget:r,children:[t(Np,{podName:n.podName,namespace:o.id.namespace,hasRestarted:d}),t(Tp,{podContainers:n.containers,sourceContainers:o.containers,jumpToTarget:a?l:null})]},`pod-${n.podName}`)})})]}):t(mt,{$height:"70vh",children:t(xe,{title:Ze.NO_RUNNING_PODS,subTitle:Ze.NO_RUNNING_PODS_SUBTITLE})})})},Op="user",$p=({source:n})=>{const o=c(()=>n.serviceName||n.id.name,[n]),{sourcesApi:i}=Vl(),{data:a,loading:l,refetch:r}=i.usePeerSources({serviceName:o},{fetchPolicy:"network-only"}),s=a?.peerSources??null;return!s||l?t(mt,l?{$height:"70vh",children:t(yt,{withSpinner:!0})}:{$height:"70vh",children:t(xe,{subTitle:Ze.COULD_NOT_FETCH_PEER_SOURCES})}):e(pe,{$gap:16,$alignItems:"flex-start",children:[t(Ap,{icon:hl,title:Ze.INBOUND,subTitle:Ze.INBOUND_DESCRIPTION(o),onRefresh:r,items:s?.inbound??[]}),t(Ap,{icon:ml,title:Ze.OUTBOUND,subTitle:Ze.OUTBOUND_DESCRIPTION(o),onRefresh:r,items:s?.outbound??[]})]})},Ap=({icon:n,title:o,subTitle:i,onRefresh:l,items:r})=>{const[s,d]=a(""),p=c(()=>r.filter(e=>e.serviceName.toLowerCase().includes(s.toLowerCase())),[r,s]);return e(Vt,{bgTint:"1000",richTitle:{icon:n,title:o,titleSize:Te.XS,subTitle:i,subTitleSize:Te.XXXS,badge:{label:r.length}},actions:[{id:"refresh",type:hn.Button,buttonProps:{variant:ve.Secondary,size:be.S,leftIcon:ll,onClick:l}}],children:[t(mn,{value:s,onChange:d,width:"100%"}),t(gn,{height:"calc(100vh - 284px)",gap:4,elements:p.length||s?!p.length&&s?[t(mt,{$height:"50vh",children:t(xe,{icon:n,title:Ze.NO_RESULTS,subTitle:Ze.NO_RESULTS_FOR_FILTER(s)})},"no-results")]:p.map(e=>t(Dp,{...e},`${o}-${e.serviceName}`)):[t(mt,{$height:"50vh",children:t(xe,{icon:n,title:`No ${o} connections yet`,subTitle:o===Ze.INBOUND?Ze.NO_INBOUND_CONNECTIONS_DESCRIPTION:Ze.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},Rp=b.div`
581
+ `,Op=({language:n,containerName:o,otelDistroName:i,runningStartedTime:a,started:l,ready:r,restartCount:s,isCrashLoop:d,waitingReasonEnum:p,waitingMessage:u,odigosHealthStatus:h,k8sHealthStatus:m,processes:g,jumpToTarget:f})=>{const b=!!f,v=b&&!f?.processPid,{formatDurationAgo:y}=on(),C=an(v),S=c(()=>({title:o,icon:n?pn(n):ml,iconWithWrapper:!0}),[o,n]),x=c(()=>{const e=[],t=ln({status:i?rn.Success:rn.Disabled,reasonEnum:i?Ze.INSTRUMENTED_WITH_DISTRO(i):Ze.UNINSTRUMENTED,message:""});t&&e.push(t);const n=ln(h,pl,"health");n&&e.push(n);const o=ln(m,ul,"health");return o&&e.push(o),e},[m,h,i]),w=c(()=>[{id:"runningTime",title:Ze.RUNNING_TIME,label:a?y(a,{style:"short"}):Ze.NOT_RUNNING,labelTooltip:`${Ze.RUNNING_TIME_TOOLTIP}. (${a})`},{id:"blank",spacer:!0},{id:"started",badge:{status:l?Ee.Success:Ee.Disabled,leftIcon:l?La:Fa,label:l?Ze.STARTED:Ze.NOT_STARTED,textSize:Te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:r?Ee.Success:Ee.Disabled,leftIcon:r?La:Fa,label:r?Ze.READY:Ze.NOT_READY,textSize:Te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"isCrashLoop",badge:{status:d?Ee.Error:Ee.Success,leftIcon:d?Fa:La,label:d?Ze.CRASHLOOP:Ze.NO_CRASHLOOP,textSize:Te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"restartCount",title:Ze.RESTARTS,badge:{status:s?Ee.Error:void 0,label:s||0,textSize:Te.XXXS}}],[a,y,l,r,d,s]),T=c(()=>u?Bt(p):"",[u,p]);return t("div",{ref:C,children:e(Gt,{bgTint:"750",richTitle:S,badges:x,items:w,withCollapse:!0,collapseIsDefaultOpen:b,children:[u&&t(Ep,{children:e(pe,{$gap:10,$alignItems:"center",children:[t(tn,{variant:un.Pink,leftIcon:ul,label:T}),t(_e,{size:Te.XXXS,color:Pe.Error,children:u})]})}),(g??[]).map((e,n)=>{const i=n+1,a=b&&(l=f,r=e,!!l?.processPid&&bp({identifyingAttributes:r.identifyingAttributes})===l.processPid);var l,r;return t(yp,{...e,overrideProcessNum:i,isJumpToTarget:a},`pod-container-${o}-process-${i}`)})]})})},$p=({podName:e,namespace:n,hasRestarted:o})=>{const i=c(()=>({title:Ze.DEBUG_COMMANDS,titleSize:Te.XS}),[]),a=c(()=>[{label:Ze.GET_POD_YAML,value:`kubectl get pod ${e} -n ${n} -o yaml`},{label:Ze.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${n}`},{label:Ze.GET_POD_LOGS,value:`kubectl logs ${e} -n ${n}${o?" -p":""}`}],[e,n,o]);return t(Gt,{bgTint:"800",richTitle:i,withCollapse:!0,children:a.map(({label:e,value:n})=>t(hn,{bgTint:"700",label:e,value:n},e))})},Ap=({source:o,onClickRestartPod:i})=>{const{jumpToTarget:a}=(()=>{const e=m(kp);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e})(),l=a?.tab===pp.Pods?a:null,r=o?.pods??[],s=r.length>0,d=c(()=>r.some(e=>e.containers?.some(e=>e.restartCount&&e.restartCount>0)),[r]),p=c(()=>({title:Ze.PODS,badge:{label:r.length}}),[r.length]);return t(ee,{$gap:12,children:s?e(n,{children:[t(mp,{podsOdigosHealthStatus:o.podsOdigosHealthStatus,pods:r}),t(Gt,{bgTint:"1000",richTitle:p,children:r.map(n=>{const a=l?.podName===n.podName,r=a&&!l?.containerName;return e(up,{...n,namespace:o.id.namespace,onClickRestartPod:i,collapseIsDefaultOpen:a,isJumpToTarget:r,children:[t($p,{podName:n.podName,namespace:o.id.namespace,hasRestarted:d}),t(Np,{podContainers:n.containers,sourceContainers:o.containers,jumpToTarget:a?l:null})]},`pod-${n.podName}`)})})]}):t(mt,{$height:"70vh",children:t(xe,{title:Ze.NO_RUNNING_PODS,subTitle:Ze.NO_RUNNING_PODS_SUBTITLE})})})},Rp="user",Dp=({source:n})=>{const o=c(()=>n.serviceName||n.id.name,[n]),{sourcesApi:i}=jl(),{data:a,loading:l,refetch:r}=i.usePeerSources({serviceName:o},{fetchPolicy:"network-only"}),s=a?.peerSources??null;return!s||l?t(mt,l?{$height:"70vh",children:t(yt,{withSpinner:!0})}:{$height:"70vh",children:t(xe,{subTitle:Ze.COULD_NOT_FETCH_PEER_SOURCES})}):e(pe,{$gap:16,$alignItems:"flex-start",children:[t(_p,{icon:gl,title:Ze.INBOUND,subTitle:Ze.INBOUND_DESCRIPTION(o),onRefresh:r,items:s?.inbound??[]}),t(_p,{icon:fl,title:Ze.OUTBOUND,subTitle:Ze.OUTBOUND_DESCRIPTION(o),onRefresh:r,items:s?.outbound??[]})]})},_p=({icon:n,title:o,subTitle:i,onRefresh:l,items:r})=>{const[s,d]=a(""),p=c(()=>r.filter(e=>e.serviceName.toLowerCase().includes(s.toLowerCase())),[r,s]);return e(Gt,{bgTint:"1000",richTitle:{icon:n,title:o,titleSize:Te.XS,subTitle:i,subTitleSize:Te.XXXS,badge:{label:r.length}},actions:[{id:"refresh",type:mn.Button,buttonProps:{variant:ve.Secondary,size:be.S,leftIcon:sl,onClick:l}}],children:[t(gn,{value:s,onChange:d,width:"100%"}),t(fn,{height:"calc(100vh - 284px)",gap:4,elements:p.length||s?!p.length&&s?[t(mt,{$height:"50vh",children:t(xe,{icon:n,title:Ze.NO_RESULTS,subTitle:Ze.NO_RESULTS_FOR_FILTER(s)})},"no-results")]:p.map(e=>t(Lp,{...e},`${o}-${e.serviceName}`)):[t(mt,{$height:"50vh",children:t(xe,{icon:n,title:`No ${o} connections yet`,subTitle:o===Ze.INBOUND?Ze.NO_INBOUND_CONNECTIONS_DESCRIPTION:Ze.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},Pp=b.div`
582
582
  display: flex;
583
583
  align-items: center;
584
584
  justify-content: space-between;
@@ -592,7 +592,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
592
592
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
593
593
  }
594
594
  `}
595
- `,Dp=({serviceName:n,isVirtual:o,nodeAttributes:i})=>{const a=fn(e=>e.drawerEntityId),{items:l}=Vl().sourcesApi.useSources(),r=c(()=>l.find(e=>e.id.name===n||e.serviceName===n),[l,n]),s=c(()=>r&&JSON.stringify(bn(r))!==JSON.stringify(bn(a)),[r,a]),d=c(()=>{if(o){const e=Object.fromEntries((i??[]).map(({key:e,value:t})=>[e,t]));return[vn({serviceName:n,attributes:e})]}if(n?.toLowerCase()===Op)return[gl];const e=r?yn(r):void 0;return e?.length?e:[ul]},[o,i,n,r]),p=s?()=>{const{setDrawerType:e,setDrawerEntityId:t}=fn.getState();e(Sn(kt.Source)),t({namespace:r?.id.namespace??"",name:r?.id.name??"",kind:r?.id.kind??"",region:r?.id.region??""})}:void 0;return e(Rp,{onClick:p,$withClick:!!p,children:[e(pe,{$gap:8,children:[t(Cn,{icons:d}),t(_e,{size:Te.XXS,children:n})]}),o&&t(Ke,{status:Ee.Info,label:Ze.VIRTUAL,textSize:Te.XXXS,invertColors:!0,tooltip:Ze.VIRTUAL_TOOLTIP})]})},_p=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}},Pp=({source:n})=>{const o=v(),{k8sManifestApi:l}=Vl(),[r,s]=a(!0),[d,p]=a(void 0),[u,h]=a(!0),[m,g]=a(void 0),[f,b]=a(!0),[y,C]=a({}),S=n.pods??[],x=S.map(e=>e.podName).join(",");i(()=>{l.fetch({namespace:n.id.namespace,kind:n.id.kind,name:n.id.name}).then(({data:e})=>p(_p(e))).finally(()=>s(!1)),l.fetch({namespace:n.id.namespace,kind:xn.InstrumentationConfig,name:`${n.id.kind}-${n.id.name}`.toLowerCase()}).then(({data:e})=>g(_p(e))).finally(()=>h(!1))},[l,n.id.namespace,n.id.kind,n.id.name]),i(()=>{const e=x?x.split(","):[];if(0===e.length)return C({}),void b(!1);let t=!1;return b(!0),Promise.all(e.map(async e=>{const{data:t}=await l.fetch({namespace:n.id.namespace,kind:xn.Pod,name:e});return[e,_p(t)]})).then(e=>{t||C(Object.fromEntries(e))}).finally(()=>{t||b(!1)}),()=>{t=!0}},[l,n.id.namespace,x]);const w=c(()=>[{label:Ze.DESCRIBE_POD,value:`kubectl describe ${n.id.kind} ${n.id.name} -n ${n.id.namespace}`},{label:Ze.GET_POD_YAML,value:`kubectl get ${n.id.kind} ${n.id.name} -n ${n.id.namespace} -o yaml`},{label:Ze.GET_POD_YAML,value:`kubectl get ${xn.InstrumentationConfig} ${n.id.kind}-${n.id.name} -n ${n.id.namespace} -o yaml`}],[n.id.kind,n.id.name,n.id.namespace]);return e(Vt,{bgTint:"1000",children:[t(Vt,{bgTint:"900",richTitle:{icon:fl,title:Ze.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:w.map(({label:e,value:n},o)=>t(un,{label:e,value:n},`debug-cmd-${o}-${e}`))}),r?t(ht,{size:1}):t(Or,{bgTint:"800",codeBgColor:o.v2.colors.silver[900],title:`${n.id.kind} YAML`,yaml:d}),u?t(ht,{size:1}):t(Or,{bgTint:"800",codeBgColor:o.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:m}),S.map(e=>f?t(ht,{size:1},e.podName):t(Or,{bgTint:"800",codeBgColor:o.v2.colors.silver[900],title:`Pod ${e.podName} YAML`,yaml:y[e.podName]},e.podName))]})},Lp=({title:n,children:o})=>e(ee,{$gap:8,children:[t(_e,{size:Te.XXXS,color:Pe.Secondary,children:n}),o]}),Fp=({source:n})=>{const o=c(()=>{const[e,t]=Tn(n.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[n]);return t(Lp,{title:Ze.THROUGHPUT_LAST_10_SECONDS,children:e(pe,{$alignItems:"flex-end",$gap:4,children:[t(_e,{size:Te.L,children:o.value}),t(_e,{size:Te.XS,variant:Et.Span,children:o.units})]})})},Mp=({source:n})=>{const{CopyButton:o}=_t();return t(Lp,{title:Ze.NAMESPACE,children:e(pe,{children:[t(Zt,{variant:pn.Blue,label:n.id.namespace}),t(o,{value:n.id.namespace,size:vt.XS})]})})},zp=({source:n})=>{const{CopyButton:o}=_t(),i=n.id.region;return i?t(Lp,{title:Ze.REGION,children:e(pe,{children:[t(Zt,{variant:pn.Blue,label:i}),t(o,{value:i,size:vt.XS})]})}):null},Bp=({source:e})=>{const n=e.markedForInstrumentation?.markedForInstrumentation??!1;return t(Lp,{title:Ze.ENABLED,children:t(pe,{children:t(Zt,{variant:n?pn.Green:pn.Default,label:n?Ze.ENABLED:Ze.DISABLED})})})},Xp=({source:e,label:n})=>t(Lp,{title:Ze.KIND,children:t(pe,{children:t(Zt,{variant:pn.Blue,label:n||e.id.kind})})}),Up=({source:n})=>{const{CopyButton:o}=_t();return t(Lp,{title:Ze.NAME,children:e(pe,{children:[t(Zt,{variant:pn.Blue,label:n.id.name}),t(o,{value:n.id.name,size:vt.XS})]})})},Vp=({source:n})=>{const{CopyButton:o}=_t(),i=n.serviceName||n.id.name;return t(Lp,{title:Ze.SERVICE_NAME,children:e(pe,{children:[t(Zt,{variant:pn.Blue,label:i}),t(o,{value:i,size:vt.XS})]})})},Hp=({source:n})=>{const{isVm:o,isConnector:i,isK8s:a}=S(),l=c(()=>wn(n.id.kind),[n.id.kind]);return t(Vt,{children:e(pe,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[a&&t(Fp,{source:n}),a&&t(Mp,{source:n}),i&&t(zp,{source:n}),i&&t(Bp,{source:n}),t(Xp,{source:n,label:l}),t(Up,{source:n}),(i||o)&&t(Vp,{source:n})]})})},jp=({source:e})=>e.pods?.length&&e.podsOdigosHealthStatus?t(Vt,{bgTint:"900",children:t(pp,{podsOdigosHealthStatus:e.podsOdigosHealthStatus,pods:e.pods,noPadding:!0})}):null,Gp=({source:e})=>{const n=c(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?kn(e.workloadOdigosHealthStatus.status):Ee.Unknown,title:on(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return n?t(ln,{...n,width:"100%"}):null},Wp="100%",Kp=b(pe)`
595
+ `,Lp=({serviceName:n,isVirtual:o,nodeAttributes:i})=>{const a=bn(e=>e.drawerEntityId),{items:l}=jl().sourcesApi.useSources(),r=c(()=>l.find(e=>e.id.name===n||e.serviceName===n),[l,n]),s=c(()=>r&&JSON.stringify(vn(r))!==JSON.stringify(vn(a)),[r,a]),d=c(()=>{if(o){const e=Object.fromEntries((i??[]).map(({key:e,value:t})=>[e,t]));return[yn({serviceName:n,attributes:e})]}if(n?.toLowerCase()===Rp)return[bl];const e=r?Cn(r):void 0;return e?.length?e:[ml]},[o,i,n,r]),p=s?()=>{const{setDrawerType:e,setDrawerEntityId:t}=bn.getState();e(xn(kt.Source)),t({namespace:r?.id.namespace??"",name:r?.id.name??"",kind:r?.id.kind??"",region:r?.id.region??""})}:void 0;return e(Pp,{onClick:p,$withClick:!!p,children:[e(pe,{$gap:8,children:[t(Sn,{icons:d}),t(_e,{size:Te.XXS,children:n})]}),o&&t(Ke,{status:Ee.Info,label:Ze.VIRTUAL,textSize:Te.XXXS,invertColors:!0,tooltip:Ze.VIRTUAL_TOOLTIP})]})},Fp=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}},Mp=({source:n})=>{const o=v(),{k8sManifestApi:l}=jl(),[r,s]=a(!0),[d,p]=a(void 0),[u,h]=a(!0),[m,g]=a(void 0),[f,b]=a(!0),[y,C]=a({}),S=n.pods??[],x=S.map(e=>e.podName).join(",");i(()=>{l.fetch({namespace:n.id.namespace,kind:n.id.kind,name:n.id.name}).then(({data:e})=>p(Fp(e))).finally(()=>s(!1)),l.fetch({namespace:n.id.namespace,kind:wn.InstrumentationConfig,name:`${n.id.kind}-${n.id.name}`.toLowerCase()}).then(({data:e})=>g(Fp(e))).finally(()=>h(!1))},[l,n.id.namespace,n.id.kind,n.id.name]),i(()=>{const e=x?x.split(","):[];if(0===e.length)return C({}),void b(!1);let t=!1;return b(!0),Promise.all(e.map(async e=>{const{data:t}=await l.fetch({namespace:n.id.namespace,kind:wn.Pod,name:e});return[e,Fp(t)]})).then(e=>{t||C(Object.fromEntries(e))}).finally(()=>{t||b(!1)}),()=>{t=!0}},[l,n.id.namespace,x]);const w=c(()=>[{label:Ze.DESCRIBE_POD,value:`kubectl describe ${n.id.kind} ${n.id.name} -n ${n.id.namespace}`},{label:Ze.GET_POD_YAML,value:`kubectl get ${n.id.kind} ${n.id.name} -n ${n.id.namespace} -o yaml`},{label:Ze.GET_POD_YAML,value:`kubectl get ${wn.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:vl,title:Ze.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:w.map(({label:e,value:n},o)=>t(hn,{label:e,value:n},`debug-cmd-${o}-${e}`))}),r?t(ht,{size:1}):t(Ar,{bgTint:"800",codeBgColor:o.v2.colors.silver[900],title:`${n.id.kind} YAML`,yaml:d}),u?t(ht,{size:1}):t(Ar,{bgTint:"800",codeBgColor:o.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:m}),S.map(e=>f?t(ht,{size:1},e.podName):t(Ar,{bgTint:"800",codeBgColor:o.v2.colors.silver[900],title:`Pod ${e.podName} YAML`,yaml:y[e.podName]},e.podName))]})},zp=({title:n,children:o})=>e(ee,{$gap:8,children:[t(_e,{size:Te.XXXS,color:Pe.Secondary,children:n}),o]}),Bp=({source:n})=>{const o=c(()=>{const[e,t]=kn(n.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[n]);return t(zp,{title:Ze.THROUGHPUT_LAST_10_SECONDS,children:e(pe,{$alignItems:"flex-end",$gap:4,children:[t(_e,{size:Te.L,children:o.value}),t(_e,{size:Te.XS,variant:Et.Span,children:o.units})]})})},Xp=({source:n})=>{const{CopyButton:o}=_t();return t(zp,{title:Ze.NAMESPACE,children:e(pe,{children:[t(tn,{variant:un.Blue,label:n.id.namespace}),t(o,{value:n.id.namespace,size:vt.XS})]})})},Up=({source:n})=>{const{CopyButton:o}=_t(),i=n.id.region;return i?t(zp,{title:Ze.REGION,children:e(pe,{children:[t(tn,{variant:un.Blue,label:i}),t(o,{value:i,size:vt.XS})]})}):null},Vp=({source:e})=>{const n=e.markedForInstrumentation?.markedForInstrumentation??!1;return t(zp,{title:Ze.ENABLED,children:t(pe,{children:t(tn,{variant:n?un.Green:un.Default,label:n?Ze.ENABLED:Ze.DISABLED})})})},Hp=({source:e,label:n})=>t(zp,{title:Ze.KIND,children:t(pe,{children:t(tn,{variant:un.Blue,label:n||e.id.kind})})}),jp=({source:n})=>{const{CopyButton:o}=_t();return t(zp,{title:Ze.NAME,children:e(pe,{children:[t(tn,{variant:un.Blue,label:n.id.name}),t(o,{value:n.id.name,size:vt.XS})]})})},Gp=({source:n})=>{const{CopyButton:o}=_t(),i=n.serviceName||n.id.name;return t(zp,{title:Ze.SERVICE_NAME,children:e(pe,{children:[t(tn,{variant:un.Blue,label:i}),t(o,{value:i,size:vt.XS})]})})},Wp=({source:n})=>{const{isVm:o,isConnector:i,isK8s:a}=S(),l=c(()=>Tn(n.id.kind),[n.id.kind]);return t(Gt,{children:e(pe,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[a&&t(Bp,{source:n}),a&&t(Xp,{source:n}),i&&t(Up,{source:n}),i&&t(Vp,{source:n}),t(Hp,{source:n,label:l}),t(jp,{source:n}),(i||o)&&t(Gp,{source:n})]})})},Kp=({source:e})=>e.pods?.length&&e.podsOdigosHealthStatus?t(Gt,{bgTint:"900",children:t(mp,{podsOdigosHealthStatus:e.podsOdigosHealthStatus,pods:e.pods,noPadding:!0})}):null,Yp=({source:e})=>{const n=c(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?In(e.workloadOdigosHealthStatus.status):Ee.Unknown,title:Bt(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return n?t(Xt,{...n,width:"100%"}):null},Jp="100%",qp=b(pe)`
596
596
  @media (max-width: 1099px) {
597
597
  flex-direction: column;
598
598
 
@@ -600,14 +600,14 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
600
600
  width: 100%;
601
601
  }
602
602
  }
603
- `,Yp=(e,t)=>e?e.toLowerCase().includes(t.toLowerCase())?on(e):`${t} ${on(e)}`:t,Jp=b(pe)`
603
+ `,Zp=(e,t)=>e?e.toLowerCase().includes(t.toLowerCase())?Bt(e):`${t} ${Bt(e)}`:t,Qp=b(pe)`
604
604
  width: fit-content;
605
605
  padding: 2px 6px;
606
606
  border-radius: 8px;
607
607
  background-color: ${({theme:e})=>e.v2.colors.silver[750]};
608
- `,qp=({overview:n,status:o})=>{const i=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(Jp,{$gap:12,$wrap:"wrap",children:a.map(({id:a,count:l,ok:r,label:s})=>{const c=r?Ee.Success:o,d=Nn(c,i);return e(pe,{$gap:2,children:[t(d,{size:16,fill:In(i,c,"300")}),t(_e,{size:Te.XXXS,color:Pe.Secondary,children:`${l}/${n?.totalPods??0} ${s}`})]},a)})}):null},Zp=({changedTime:e})=>{const{formatTimeAgo:n}=en();return t(_e,{size:Te.XXXS,color:Pe.Disable,nowrap:!0,children:`Agent Assignment Updated · ${n(e)}`})},Qp=({source:n,onClickRollout:o,onClickRollback:i})=>{const a=n.rollout?.podsManifestInjectionStatus??n.conditions?.rollout,l=c(()=>{const{status:e,reasonEnum:i,message:l,actionItems:r}=a||{},s=rn(e);if(!s)return null;const c=Yp(i,Ze.ROLLOUT),d=l,p=(r??[]).flatMap(e=>[{"data-id":`rollout-action-${e.type}`,label:e.buttonText,hideTooltipIcon:!0,leftIcon:bl,onClick:o}]);return{status:s,title:c,subTitle:d,details:t(qp,{overview:n.rollout?.podsManifestInjectionOverview,status:s}),actionDetails:n.rollout?.agentsMetaHashChangedTime?t(Zp,{changedTime:n.rollout.agentsMetaHashChangedTime}):void 0,actionButtons:p}},[n.rollout,a,o]),r=c(()=>{const{status:e,reasonEnum:t,message:o,actionItems:a}=n.autoRollback?.autoRollbackStatus||{},l=rn(e);if(!l)return null;const r=Yp(t,Ze.ROLLBACK),s=o,c=(a??[]).flatMap(e=>[{"data-id":`rollback-action-${e.type}`,label:e.buttonText,hideTooltipIcon:!0,leftIcon:ll,onClick:i}]);return c.length||l===Ee.Success||c.push({"data-id":"rollback-action",label:Ze.ROLLBACK,tooltip:"Recover the workload from the last rollback",hideTooltipIcon:!0,leftIcon:ll,onClick:i}),{status:l,title:r,subTitle:s,actionButtons:c}},[n,i]);return l||r?e(Kp,{$gap:12,$alignItems:"stretch",children:[l&&t(ln,{invertColors:!0,slim:!0,width:r?"calc(60% - 6px)":Wp,...l}),r&&t(ln,{invertColors:!0,slim:!0,width:l?"calc(40% - 6px)":Wp,...r})]}):null},eu=h(null),tu=b.div`
608
+ `,eu=({overview:n,status:o})=>{const i=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(Qp,{$gap:12,$wrap:"wrap",children:a.map(({id:a,count:l,ok:r,label:s})=>{const c=r?Ee.Success:o,d=En(c,i);return e(pe,{$gap:2,children:[t(d,{size:16,fill:Nn(i,c,"300")}),t(_e,{size:Te.XXXS,color:Pe.Secondary,children:`${l}/${n?.totalPods??0} ${s}`})]},a)})}):null},tu=({changedTime:e})=>{const{formatTimeAgo:n}=on();return t(_e,{size:Te.XXXS,color:Pe.Disable,nowrap:!0,children:`Agent Assignment Updated · ${n(e)}`})},nu=({source:n,onClickRollout:o,onClickRollback:i})=>{const a=n.rollout?.podsManifestInjectionStatus??n.conditions?.rollout,l=c(()=>{const{status:e,reasonEnum:i,message:l,actionItems:r}=a||{},s=sn(e);if(!s)return null;const c=Zp(i,Ze.ROLLOUT),d=l,p=(r??[]).flatMap(e=>[{"data-id":`rollout-action-${e.type}`,label:e.buttonText,hideTooltipIcon:!0,leftIcon:yl,onClick:o}]);return{status:s,title:c,subTitle:d,details:t(eu,{overview:n.rollout?.podsManifestInjectionOverview,status:s}),actionDetails:n.rollout?.agentsMetaHashChangedTime?t(tu,{changedTime:n.rollout.agentsMetaHashChangedTime}):void 0,actionButtons:p}},[n.rollout,a,o]),r=c(()=>{const{status:e,reasonEnum:t,message:o,actionItems:a}=n.autoRollback?.autoRollbackStatus||{},l=sn(e);if(!l)return null;const r=Zp(t,Ze.ROLLBACK),s=o,c=(a??[]).flatMap(e=>[{"data-id":`rollback-action-${e.type}`,label:e.buttonText,hideTooltipIcon:!0,leftIcon:sl,onClick:i}]);return c.length||l===Ee.Success||c.push({"data-id":"rollback-action",label:Ze.ROLLBACK,tooltip:"Recover the workload from the last rollback",hideTooltipIcon:!0,leftIcon:sl,onClick:i}),{status:l,title:r,subTitle:s,actionButtons:c}},[n,i]);return l||r?e(qp,{$gap:12,$alignItems:"stretch",children:[l&&t(Xt,{invertColors:!0,slim:!0,width:r?"calc(60% - 6px)":Jp,...l}),r&&t(Xt,{invertColors:!0,slim:!0,width:l?"calc(40% - 6px)":Jp,...r})]}):null},ou=h(null),iu=b.div`
609
609
  position: relative;
610
- `,nu=({children:e})=>{const n=p(null);return t(tu,{ref:n,children:t(eu.Provider,{value:n,children:e})})},ou=b.div`
610
+ `,au=({children:e})=>{const n=p(null);return t(iu,{ref:n,children:t(ou.Provider,{value:n,children:e})})},lu=b.div`
611
611
  position: fixed;
612
612
  top: ${({$coords:e})=>e.top}px;
613
613
  right: ${({$coords:e})=>e.right}px;
@@ -621,14 +621,14 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
621
621
  padding: 12px 16px;
622
622
  border-radius: 12px;
623
623
  background-color: ${({theme:e})=>e.v2.colors.silver[750]};
624
- `,iu=b.div`
624
+ `,ru=b.div`
625
625
  display: flex;
626
626
  align-items: flex-end;
627
627
  justify-content: space-between;
628
628
  gap: 8px;
629
- `,au=b.div`
629
+ `,su=b.div`
630
630
  flex: 1;
631
- `,lu=({width:n,onClose:o,onSave:i,saveTooltip:l,onDelete:r,deleteTooltip:s,title:c,subTitle:d,warning:p,children:u,pushButtonsWith:h})=>{const f=v(),b=m(eu),[y,C]=a(null);return En(b??{current:null},o),g(()=>{const e=b?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[b]),y?_r(e(ou,{$coords:y,$width:n,"data-ignore-outside-click":"true",children:[e(ee,{$gap:4,children:[t(_e,{size:Te.XXS,children:c}),t(_e,{size:Te.XXXS,color:Pe.Secondary,children:d})]}),e(iu,{children:[t(au,{children:u}),e(pe,{$gap:8,$width:"fit-content",$margin:`0 0 ${h||0} 0`,children:[t(fe,{variant:ve.Secondary,onClick:r,leftIcon:Aa,tooltip:s,hideTooltipIcon:!0,iconSize:16,size:be.S,textColor:f.v2.colors.red[500]}),t(fe,{variant:ve.Primary,onClick:i,leftIcon:Wa,tooltip:l,hideTooltipIcon:!0,iconSize:16,size:be.S})]})]}),t("div",{children:t(Ne,{status:Ee.Warning,message:p})})]}),document.body):null},ru=({language:n,overridden:o,onOverride:i,defaultValues:l})=>{const{tier:r}=S(),{formData:s,handleFormChange:d,resetFormData:p}=Gt(l),u=c(()=>{if(!n)return[];const e=On[n].community,t=r===It.Onprem?On[n].enterprise:[];return e.concat(t).map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})).sort((e,t)=>e.label.localeCompare(t.label))},[n,r]),[h,m]=a(!1),[g,f]=a(!1),b=()=>{h||(g&&p(),f(e=>!e))};return e(pe,{$gap:4,$alignItems:"center",children:[o?t(Ke,{status:Ee.Info,invertColors:!0,label:Ze.OVERIDDEN}):null,e(nu,{children:[t(Fe,{text:Ze.OVERRIDE_OTEL_DISTRO_NAME,children:t(bt,{icon:Ma,onClick:b})}),g&&t(lu,{width:"500px",onClose:b,onSave:async()=>{m(!0),await i(s),m(!1),b()},saveTooltip:Ze.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await i({otelDistroName:null}),m(!1),b()},deleteTooltip:Ze.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:Ze.OVERRIDE_OTEL_DISTRO_NAME,subTitle:Ze.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:Ze.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(ft,{label:Ze.OTEL_DISTRO_NAME,options:u,values:s.otelDistroName?[s.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},su=({overridden:n,onOverride:o,defaultValues:i,originalValues:l})=>{const{addNotification:r}=qt(),{formData:s,handleFormChange:d,resetFormData:p}=Gt(i),u=c(()=>$n.map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})),[]),[h,m]=a(!1),[g,f]=a(!1),b=()=>{h||(g&&p(),f(e=>!e))};return e(pe,{children:[n?t(Ke,{status:Ee.Info,invertColors:!0,label:Ze.OVERIDDEN}):null,e(nu,{children:[t(Fe,{text:Ze.OVERRIDE_RUNTIME_DETAILS,children:t(bt,{icon:Ma,onClick:b})}),g&&t(lu,{width:"500px",onClose:b,onSave:async()=>{!s.version||An(s.version)?(m(!0),await o(s),m(!1),b()):r({type:Ee.Warning,message:He.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:Ze.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await o({language:null,version:""}),m(!1),b()},deleteTooltip:Ze.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:Ze.OVERRIDE_RUNTIME_DETAILS,subTitle:Ze.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:Ze.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(pe,{$gap:8,children:[t(ft,{label:Ze.LANGUAGE,options:u,values:s.language?[s.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${l.language||"none"}`}),t(ye,{label:Ze.RUNTIME_VERSION,placeholder:Ze.VERSION_PLACEHOLDER,value:s.version,onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${l.version||"none"}`})]})})]})]})},cu=({source:e})=>{const{isVm:n}=S(),{containers:o,containersRichTitle:i}=c(()=>{const t=e?.conditions?.runtimeDetection;return{containers:e?.containers??[],containersRichTitle:{title:n?Ze.DETECTED_PROCESSES:`${e.id.kind} ${Ze.CONTAINERS}`,tooltip:t?.message||(n?Ze.DETECTED_PROCESSES_DESCRIPTION:Ze.DETECTED_CONTAINERS_DESCRIPTION),badge:rn(t?.status)===Ee.Loading?{status:Ee.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,n]);return t(Vt,{bgTint:"1000",richTitle:i,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ee,{$gap:8,children:o.map(n=>n&&t(hu,{...n,sourceId:e.id},`source-container-${n.containerName}`))})})},du=b.div`
631
+ `,cu=({width:n,onClose:o,onSave:i,saveTooltip:l,onDelete:r,deleteTooltip:s,title:c,subTitle:d,warning:p,children:u,pushButtonsWith:h})=>{const f=v(),b=m(ou),[y,C]=a(null);return On(b??{current:null},o),g(()=>{const e=b?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[b]),y?Lr(e(lu,{$coords:y,$width:n,"data-ignore-outside-click":"true",children:[e(ee,{$gap:4,children:[t(_e,{size:Te.XXS,children:c}),t(_e,{size:Te.XXXS,color:Pe.Secondary,children:d})]}),e(ru,{children:[t(su,{children:u}),e(pe,{$gap:8,$width:"fit-content",$margin:`0 0 ${h||0} 0`,children:[t(fe,{variant:ve.Secondary,onClick:r,leftIcon:Da,tooltip:s,hideTooltipIcon:!0,iconSize:16,size:be.S,textColor:f.v2.colors.red[500]}),t(fe,{variant:ve.Primary,onClick:i,leftIcon:Ya,tooltip:l,hideTooltipIcon:!0,iconSize:16,size:be.S})]})]}),t("div",{children:t(Ne,{status:Ee.Warning,message:p})})]}),document.body):null},du=({language:n,overridden:o,onOverride:i,defaultValues:l})=>{const{tier:r}=S(),{formData:s,handleFormChange:d,resetFormData:p}=Yt(l),u=c(()=>{if(!n)return[];const e=$n[n].community,t=r===It.Onprem?$n[n].enterprise:[];return e.concat(t).map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})).sort((e,t)=>e.label.localeCompare(t.label))},[n,r]),[h,m]=a(!1),[g,f]=a(!1),b=()=>{h||(g&&p(),f(e=>!e))};return e(pe,{$gap:4,$alignItems:"center",children:[o?t(Ke,{status:Ee.Info,invertColors:!0,label:Ze.OVERIDDEN}):null,e(au,{children:[t(Fe,{text:Ze.OVERRIDE_OTEL_DISTRO_NAME,children:t(bt,{icon:Ba,onClick:b})}),g&&t(cu,{width:"500px",onClose:b,onSave:async()=>{m(!0),await i(s),m(!1),b()},saveTooltip:Ze.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await i({otelDistroName:null}),m(!1),b()},deleteTooltip:Ze.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:Ze.OVERRIDE_OTEL_DISTRO_NAME,subTitle:Ze.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:Ze.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(ft,{label:Ze.OTEL_DISTRO_NAME,options:u,values:s.otelDistroName?[s.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},pu=({overridden:n,onOverride:o,defaultValues:i,originalValues:l})=>{const{addNotification:r}=en(),{formData:s,handleFormChange:d,resetFormData:p}=Yt(i),u=c(()=>An.map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})),[]),[h,m]=a(!1),[g,f]=a(!1),b=()=>{h||(g&&p(),f(e=>!e))};return e(pe,{children:[n?t(Ke,{status:Ee.Info,invertColors:!0,label:Ze.OVERIDDEN}):null,e(au,{children:[t(Fe,{text:Ze.OVERRIDE_RUNTIME_DETAILS,children:t(bt,{icon:Ba,onClick:b})}),g&&t(cu,{width:"500px",onClose:b,onSave:async()=>{!s.version||Rn(s.version)?(m(!0),await o(s),m(!1),b()):r({type:Ee.Warning,message:He.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:Ze.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await o({language:null,version:""}),m(!1),b()},deleteTooltip:Ze.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:Ze.OVERRIDE_RUNTIME_DETAILS,subTitle:Ze.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:Ze.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(pe,{$gap:8,children:[t(ft,{label:Ze.LANGUAGE,options:u,values:s.language?[s.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${l.language||"none"}`}),t(ye,{label:Ze.RUNTIME_VERSION,placeholder:Ze.VERSION_PLACEHOLDER,value:s.version,onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${l.version||"none"}`})]})})]})]})},uu=({source:e})=>{const{isVm:n}=S(),{containers:o,containersRichTitle:i}=c(()=>{const t=e?.conditions?.runtimeDetection;return{containers:e?.containers??[],containersRichTitle:{title:n?Ze.DETECTED_PROCESSES:`${e.id.kind} ${Ze.CONTAINERS}`,tooltip:t?.message||(n?Ze.DETECTED_PROCESSES_DESCRIPTION:Ze.DETECTED_CONTAINERS_DESCRIPTION),badge:sn(t?.status)===Ee.Loading?{status:Ee.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,n]);return t(Gt,{bgTint:"1000",richTitle:i,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ee,{$gap:8,children:o.map(n=>n&&t(fu,{...n,sourceId:e.id},`source-container-${n.containerName}`))})})},hu=b.div`
632
632
  display: flex;
633
633
  flex-direction: column;
634
634
  align-self: stretch;
@@ -636,32 +636,32 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
636
636
  padding: 8px 12px;
637
637
  border-radius: 8px;
638
638
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
639
- `,pu=b.div`
639
+ `,mu=b.div`
640
640
  display: flex;
641
641
  align-items: center;
642
642
  justify-content: center;
643
643
  padding: 8px;
644
644
  border-radius: 10px;
645
645
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
646
- `,uu=b.div`
646
+ `,gu=b.div`
647
647
  display: flex;
648
648
  flex-direction: column;
649
649
  gap: 12px;
650
650
  padding: 8px 12px;
651
651
  border-radius: 8px;
652
652
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
653
- `,hu=({sourceId:n,...o})=>{const{containerName:i,runtimeInfo:a,agentEnabled:l,overrides:r}=o,s=v(),{sourcesApi:d}=Vl(),p=c(()=>!!r?.runtimeInfo?.language||!!r?.runtimeInfo?.runtimeVersion,[r]),u=c(()=>({language:cn(o),version:Rn(o)||void 0}),[o]),h=c(()=>!!r?.otelDistroName,[r]),m=c(()=>({otelDistroName:r?.otelDistroName||o.agentEnabled?.otelDistroName}),[r,o]),g=c(()=>!a&&!p,[a,p]),f=c(()=>g?ul:dn(u.language),[g,u]),b=c(()=>{if(g)return"";const{language:e,version:t}=u;return`${e}${t?` • ${t}`:""}`},[g,u]),y=c(()=>g?{status:Ee.Loading,label:Ze.WAITING_FOR_RUNTIME_DETECTION}:{status:l?.otelDistroName?Ee.Success:Ee.Disabled,leftIcon:l?.otelDistroName?_a:Pa,label:l?.otelDistroName?`Instrumented | ${l.otelDistroName}`:"Uninstrumented",tooltip:l?.agentEnabledStatus?.message},[g,l]),C=e=>d.update(n,{containerName:i,...h?m:{},...p?u:{},...e}),S=c(()=>{const e=[];return o.agentConfig?.traces?.headSampling?.noisyOperations?.length&&e.push(Ze.HEAD_SAMPLING),(o.collectorConfig?.tailSampling?.noisyOperations?.length||o.collectorConfig?.tailSampling?.highlyRelevantOperations?.length||o.collectorConfig?.tailSampling?.costReductionRules?.length)&&e.push(Ze.TAIL_SAMPLING),e},[o]);return e(du,{children:[e(pe,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(pe,{$gap:8,$alignItems:"center",children:[t(pu,{children:t(f,{size:24,fill:a?void 0:s.v2.colors.grey[400]})}),t(_e,{children:i}),t(Zt,b?{variant:pn.Blue,label:b}:{variant:pn.Loader,label:Ze.DETECTING_RUNTIME_INFO}),t(su,{overridden:p,onOverride:C,defaultValues:u,originalValues:{language:o.runtimeInfo?.language,version:o.runtimeInfo?.runtimeVersion||""}})]}),e(pe,{$gap:8,$alignItems:"center",children:[t(Ke,{...y,textSize:Te.XXXS}),t(ru,{language:u.language,overridden:h,onOverride:C,defaultValues:m})]})]}),!l||l.agentEnabled||g?null:t(uu,{children:e(pe,{$gap:10,$alignItems:"center",children:[t(Zt,{variant:pn.Pink,label:on(l.agentEnabledStatus?.reasonEnum)||Ze.NO_AVAILABLE_AGENT}),t(_e,{size:Te.XXXS,color:Pe.Secondary,children:l?.agentEnabledStatus?.message})]})}),S.length>0&&t(uu,{children:t(pe,{$gap:16,$wrap:"wrap",children:S.map((e,n)=>t(Ke,{label:e,leftIcon:_a,status:Ee.Success,invertColors:!0,useSecondaryTone:!0},`${i}-rule-${n}`))})})]})},mu=b.div`
653
+ `,fu=({sourceId:n,...o})=>{const{containerName:i,runtimeInfo:a,agentEnabled:l,overrides:r}=o,s=v(),{sourcesApi:d}=jl(),p=c(()=>!!r?.runtimeInfo?.language||!!r?.runtimeInfo?.runtimeVersion,[r]),u=c(()=>({language:dn(o),version:Dn(o)||void 0}),[o]),h=c(()=>!!r?.otelDistroName,[r]),m=c(()=>({otelDistroName:r?.otelDistroName||o.agentEnabled?.otelDistroName}),[r,o]),g=c(()=>!a&&!p,[a,p]),f=c(()=>g?ml:pn(u.language),[g,u]),b=c(()=>{if(g)return"";const{language:e,version:t}=u;return`${e}${t?` • ${t}`:""}`},[g,u]),y=c(()=>g?{status:Ee.Loading,label:Ze.WAITING_FOR_RUNTIME_DETECTION}:{status:l?.otelDistroName?Ee.Success:Ee.Disabled,leftIcon:l?.otelDistroName?La:Fa,label:l?.otelDistroName?`Instrumented | ${l.otelDistroName}`:"Uninstrumented",tooltip:l?.agentEnabledStatus?.message},[g,l]),C=e=>d.update(n,{containerName:i,...h?m:{},...p?u:{},...e}),S=c(()=>{const e=[];return o.agentConfig?.traces?.headSampling?.noisyOperations?.length&&e.push(Ze.HEAD_SAMPLING),(o.collectorConfig?.tailSampling?.noisyOperations?.length||o.collectorConfig?.tailSampling?.highlyRelevantOperations?.length||o.collectorConfig?.tailSampling?.costReductionRules?.length)&&e.push(Ze.TAIL_SAMPLING),e},[o]);return e(hu,{children:[e(pe,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(pe,{$gap:8,$alignItems:"center",children:[t(mu,{children:t(f,{size:24,fill:a?void 0:s.v2.colors.grey[400]})}),t(_e,{children:i}),t(tn,b?{variant:un.Blue,label:b}:{variant:un.Loader,label:Ze.DETECTING_RUNTIME_INFO}),t(pu,{overridden:p,onOverride:C,defaultValues:u,originalValues:{language:o.runtimeInfo?.language,version:o.runtimeInfo?.runtimeVersion||""}})]}),e(pe,{$gap:8,$alignItems:"center",children:[t(Ke,{...y,textSize:Te.XXXS}),t(du,{language:u.language,overridden:h,onOverride:C,defaultValues:m})]})]}),!l||l.agentEnabled||g?null:t(gu,{children:e(pe,{$gap:10,$alignItems:"center",children:[t(tn,{variant:un.Pink,label:Bt(l.agentEnabledStatus?.reasonEnum)||Ze.NO_AVAILABLE_AGENT}),t(_e,{size:Te.XXXS,color:Pe.Secondary,children:l?.agentEnabledStatus?.message})]})}),S.length>0&&t(gu,{children:t(pe,{$gap:16,$wrap:"wrap",children:S.map((e,n)=>t(Ke,{label:e,leftIcon:La,status:Ee.Success,invertColors:!0,useSecondaryTone:!0},`${i}-rule-${n}`))})})]})},bu=b.div`
654
654
  display: flex;
655
655
  flex-direction: column;
656
656
  gap: 10px;
657
657
  padding: 10px 12px 10px 20px;
658
658
  border-radius: 8px;
659
659
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
660
- `,gu=b.div`
660
+ `,vu=b.div`
661
661
  display: flex;
662
662
  flex-wrap: wrap;
663
663
  gap: 12px 24px;
664
- `,fu=({title:n,children:o})=>e(ee,{$gap:4,children:[t(_e,{size:Te.XXXS,color:Pe.Secondary,children:n}),o]}),bu=({processes:n})=>{const o=c(()=>[...n].sort((e,t)=>e.pid-t.pid),[n]);return o.length?e(ee,{$gap:6,children:[t(_e,{size:Te.XXXS,color:Pe.Secondary,children:`${Ze.PROCESSES} (${o.length})`}),o.map(n=>{const o=n.exe?.trim()||null,i=n.cmdline?.trim()||null;return e(mu,{children:[t(gu,{children:t(fu,{title:Ze.PROCESS_PID,children:t(_e,{size:Te.XS,children:String(n.pid)})})}),o?t(un,{label:Ze.EXECUTABLE,value:o,bgTint:"900"}):null,i&&i!==o?t(un,{label:Ze.COMMAND,value:i,bgTint:"900"}):null]},n.pid)})]}):null},vu=b.div`
664
+ `,yu=({title:n,children:o})=>e(ee,{$gap:4,children:[t(_e,{size:Te.XXXS,color:Pe.Secondary,children:n}),o]}),Cu=({processes:n})=>{const o=c(()=>[...n].sort((e,t)=>e.pid-t.pid),[n]);return o.length?e(ee,{$gap:6,children:[t(_e,{size:Te.XXXS,color:Pe.Secondary,children:`${Ze.PROCESSES} (${o.length})`}),o.map(n=>{const o=n.exe?.trim()||null,i=n.cmdline?.trim()||null;return e(bu,{children:[t(vu,{children:t(yu,{title:Ze.PROCESS_PID,children:t(_e,{size:Te.XS,children:String(n.pid)})})}),o?t(hn,{label:Ze.EXECUTABLE,value:o,bgTint:"900"}):null,i&&i!==o?t(hn,{label:Ze.COMMAND,value:i,bgTint:"900"}):null]},n.pid)})]}):null},Su=b.div`
665
665
  display: flex;
666
666
  flex-direction: column;
667
667
  align-self: stretch;
@@ -669,19 +669,19 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
669
669
  padding: 8px 12px;
670
670
  border-radius: 8px;
671
671
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
672
- `,yu=b.div`
672
+ `,xu=b.div`
673
673
  display: flex;
674
674
  align-items: center;
675
675
  justify-content: center;
676
676
  padding: 8px;
677
677
  border-radius: 10px;
678
678
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
679
- `,Cu=e=>{if(!e)return Dn.Unknown;const t=e.trim().toLowerCase();return{go:Dn.Go,golang:Dn.Go,javascript:Dn.JavaScript,js:Dn.JavaScript,node:Dn.JavaScript,nodejs:Dn.JavaScript,typescript:Dn.JavaScript,python:Dn.Python,java:Dn.Java,dotnet:Dn.DotNet,csharp:Dn.CSharp,php:Dn.Php,ruby:Dn.Ruby,rust:Dn.Rust,swift:Dn.Swift,elixir:Dn.Elixir}[t]??Dn.Unknown},Su=({source:n})=>{const o=v(),{isConnector:i,isVm:a}=S(),{sourcesApi:l}=Vl(),r=n.instrumentationReport,s=n.sourceConfig,d=a?r?.processes:null,p=c(()=>!(!s?.runtimeOverride?.language&&!s?.runtimeOverride?.version),[s]),u=c(()=>{const e=Cu(r?.runtimeLanguage);return e!==Dn.Unknown?e:n.runtimeInfo?.detectedLanguages?.[0]??Dn.Unknown},[r?.runtimeLanguage,n.runtimeInfo?.detectedLanguages]),h=r?.runtimeVersion?.trim()||"",m=c(()=>{const e=Cu(s?.runtimeOverride?.language);return{language:e!==Dn.Unknown?e:u,version:s?.runtimeOverride?.version?.trim()||h||void 0}},[s,u,h]),g=c(()=>!!s?.distroOverride?.otelDistroName,[s]),f=c(()=>({otelDistroName:s?.distroOverride?.otelDistroName||void 0}),[s]),b=c(()=>{const{language:e,version:t}=m;return e!==Dn.Unknown||t?e!==Dn.Unknown&&t?`${e} • ${t}`:e!==Dn.Unknown?e:t||null:null},[m]),y=!b&&!p&&"Instrumenting"===r?.state,C=c(()=>y||m.language===Dn.Unknown?ul:dn(m.language),[y,m.language]),x=c(()=>{const e=r?.state??"",t=r?.instrumented||"Instrumented"===e,n=s?.distroOverride?.otelDistroName?.trim()||r?.sdkType?.trim();return"Instrumenting"===e?{status:Ee.Loading,label:on(r?.progressStage||e)||e}:"NotImplemented"===e||"Unsupported"===e?{status:Ee.Disabled,leftIcon:Pa,label:on(e)||e}:"Error"===e?{status:Ee.Error,leftIcon:Pa,label:"Error"}:t?{status:Ee.Success,leftIcon:_a,label:n?`Instrumented | ${n}`:"Instrumented"}:{status:Ee.Disabled,leftIcon:Pa,label:Ze.UNINSTRUMENTED}},[r,s]),w=e=>l.update(n.id,{...g?f:{},...p?{language:m.language!==Dn.Unknown?m.language:void 0,version:m.version}:{},...e});return(i||a)&&r?t(Vt,{bgTint:"1000",richTitle:{title:Ze.INSTRUMENTATION,tooltip:Ze.INSTRUMENTATION_DESCRIPTION,badge:{label:1}},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ee,{$gap:8,children:e(vu,{children:[e(pe,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(pe,{$gap:8,$alignItems:"center",children:[t(yu,{children:t(C,{size:24,fill:y||m.language===Dn.Unknown?o.v2.colors.grey[400]:void 0})}),t(_e,{children:n.id.name}),y?t(Zt,{variant:pn.Loader,label:Ze.DETECTING_RUNTIME_INFO}):b?t(Zt,{variant:pn.Blue,label:b}):null,t(su,{overridden:p,onOverride:w,defaultValues:{language:m.language!==Dn.Unknown?m.language:void 0,version:m.version||""},originalValues:{language:u!==Dn.Unknown?u:void 0,version:h}})]}),e(pe,{$gap:8,$alignItems:"center",children:[t(Ke,{...x,textSize:Te.XXXS}),t(ru,{language:m.language!==Dn.Unknown?m.language:null,overridden:g,onOverride:w,defaultValues:f})]})]}),d?.length?t(bu,{processes:d}):null]})})}):null},xu=({source:n,onClickRollout:o,onClickRollback:i})=>{const{isK8s:a,isConnector:l,isVm:r}=S();return e(ee,{$gap:12,children:[t(Hp,{source:n}),t(Gp,{source:n}),a&&t(Qp,{source:n,onClickRollout:o,onClickRollback:i}),a&&t(cu,{source:n}),(l||r)&&t(Su,{source:n}),a&&t(jp,{source:n})]})},wu=({source:e})=>{const n=e.containers||[];return t(Vt,{bgTint:"1000",richTitle:{title:Ze.INSTRUMENTED_LIBRARIES},children:n.length?n.map(e=>{const n=e.instrumentations||[];return t(Vt,{bgTint:"800",richTitle:{title:e.containerName,badge:{label:n.length}},withCollapse:!0,collapseIsDefaultOpen:!!n?.length,children:n?.length?t(ee,{children:n.map((e,n)=>t(Sp,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${n}-${e.name}`))}):t(xe,{title:"No libraries found"})},e.containerName)}):t(xe,{title:"No containers found"})})},Tu=b(ee)`
679
+ `,wu=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},Tu=({source:n})=>{const o=v(),{isConnector:i,isVm:a}=S(),{sourcesApi:l}=jl(),r=n.instrumentationReport,s=n.sourceConfig,d=a?r?.processes:null,p=c(()=>!(!s?.runtimeOverride?.language&&!s?.runtimeOverride?.version),[s]),u=c(()=>{const e=wu(r?.runtimeLanguage);return e!==_n.Unknown?e:n.runtimeInfo?.detectedLanguages?.[0]??_n.Unknown},[r?.runtimeLanguage,n.runtimeInfo?.detectedLanguages]),h=r?.runtimeVersion?.trim()||"",m=c(()=>{const e=wu(s?.runtimeOverride?.language);return{language:e!==_n.Unknown?e:u,version:s?.runtimeOverride?.version?.trim()||h||void 0}},[s,u,h]),g=c(()=>!!s?.distroOverride?.otelDistroName,[s]),f=c(()=>({otelDistroName:s?.distroOverride?.otelDistroName||void 0}),[s]),b=c(()=>{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"===r?.state,C=c(()=>y||m.language===_n.Unknown?ml:pn(m.language),[y,m.language]),x=c(()=>{const e=r?.state??"",t=r?.instrumented||"Instrumented"===e,n=s?.distroOverride?.otelDistroName?.trim()||r?.sdkType?.trim();return"Instrumenting"===e?{status:Ee.Loading,label:Bt(r?.progressStage||e)||e}:"NotImplemented"===e||"Unsupported"===e?{status:Ee.Disabled,leftIcon:Fa,label:Bt(e)||e}:"Error"===e?{status:Ee.Error,leftIcon:Fa,label:"Error"}:t?{status:Ee.Success,leftIcon:La,label:n?`Instrumented | ${n}`:"Instrumented"}:{status:Ee.Disabled,leftIcon:Fa,label:Ze.UNINSTRUMENTED}},[r,s]),w=e=>l.update(n.id,{...g?f:{},...p?{language:m.language!==_n.Unknown?m.language:void 0,version:m.version}:{},...e});return(i||a)&&r?t(Gt,{bgTint:"1000",richTitle:{title:Ze.INSTRUMENTATION,tooltip:Ze.INSTRUMENTATION_DESCRIPTION,badge:{label:1}},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ee,{$gap:8,children:e(Su,{children:[e(pe,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(pe,{$gap:8,$alignItems:"center",children:[t(xu,{children:t(C,{size:24,fill:y||m.language===_n.Unknown?o.v2.colors.grey[400]:void 0})}),t(_e,{children:n.id.name}),y?t(tn,{variant:un.Loader,label:Ze.DETECTING_RUNTIME_INFO}):b?t(tn,{variant:un.Blue,label:b}):null,t(pu,{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(pe,{$gap:8,$alignItems:"center",children:[t(Ke,{...x,textSize:Te.XXXS}),t(du,{language:m.language!==_n.Unknown?m.language:null,overridden:g,onOverride:w,defaultValues:f})]})]}),d?.length?t(Cu,{processes:d}):null]})})}):null},ku=({source:n,onClickRollout:o,onClickRollback:i})=>{const{isK8s:a,isConnector:l,isVm:r}=S();return e(ee,{$gap:12,children:[t(Wp,{source:n}),t(Yp,{source:n}),a&&t(nu,{source:n,onClickRollout:o,onClickRollback:i}),a&&t(uu,{source:n}),(l||r)&&t(Tu,{source:n}),a&&t(Kp,{source:n})]})},Iu=({source:e})=>{const n=e.containers||[];return t(Gt,{bgTint:"1000",richTitle:{title:Ze.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(ee,{children:n.map((e,n)=>t(Tp,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${n}-${e.name}`))}):t(xe,{title:"No libraries found"})},e.containerName)}):t(xe,{title:"No containers found"})})},Nu=b(ee)`
680
680
  width: 100%;
681
681
  max-height: 320px;
682
682
  overflow-y: auto;
683
683
  gap: 8px;
684
- `,ku=b(pe)`
684
+ `,Eu=b(pe)`
685
685
  width: 100%;
686
686
  align-items: center;
687
687
  gap: 8px;
@@ -691,14 +691,14 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
691
691
  & > * {
692
692
  font-family: monospace !important;
693
693
  }
694
- `,Iu=({pendingModify:n,onClose:o,onConfirm:i})=>{const a=v();return t(qe,{isOpen:!!n,title:'Modify the "Profiling Symbols" rule',description:'These changes are applied immediately to a single custom instrumentation rule named "Profiling Symbols".\nSelected symbols are added to it; unchecked symbols are removed from it (the rule is deleted once empty). Symbols managed by other rules are never touched.',onClose:o,denyButton:{variant:ve.Secondary,label:"Cancel",onClick:o},approveButton:{variant:ve.Primary,label:"Confirm",onClick:i},children:n&&e(Tu,{children:[n.add.map(n=>e(ku,{children:[t(Ke,{leftIcon:Ra,status:Ee.Success,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:Te.XXS}),t(_e,{size:Te.XS,color:Pe.Primary,children:n})]},`add-${n}`)),n.remove.map(n=>e(ku,{children:[t(Ke,{leftIcon:vl,status:Ee.Error,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:Te.XXS}),t(_e,{size:Te.XS,color:Pe.Primary,children:n})]},`remove-${n}`))]})})};function Nu(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 Eu(e){const t=Math.abs(e);return t>=1e9?`${Ou(e/1e9)}s`:t>=1e6?`${Ou(e/1e6)}ms`:t>=1e3?`${Ou(e/1e3)}μs`:String(Math.round(e))}function Ou(e){return e.toFixed(2).replace(/\.?0+$/,"")}function $u(e){const t=[];for(let n=0;n<e.levels.length;n++){const o=e.levels[n];let i=0;for(let e=0;e+3<o.length;e+=4){const a=o[e],l=o[e+1],r=o[e+2],s=o[e+3],c=i+a;t.push({level:n,offset:c,size:l,self:r,nameIndex:s}),i=c+l}}return t}function Au(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function Ru(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}function Du(e,t,n){return((e,t)=>{const n=[];for(let o=0;o<=t.level;o++){let i;for(const n of e)if(n.level===o&&t.offset>=n.offset&&t.offset+t.size<=n.offset+n.size){i=n;break}if(!i)return n;n.push(i)}return n})(t,n).map(t=>Nu(e,t.nameIndex))}function _u(e,t,n){if(0===n.length)return null;let o=null,i=null;for(let a=0;a<n.length;a++){const l=n[a];let r=null;for(const n of t)n.level===a&&Nu(e,n.nameIndex)===l&&(o&&(n.offset<o.offset||n.offset+n.size>o.offset+o.size)||(!r||n.size>r.size)&&(r=n));if(!r)return null;o=r,i=r}return i}function Pu(e,t){const n=e.reduce((e,t)=>Math.max(e,t.level),t.level),o=new Map;for(const t of e){const e=o.get(t.level);e?e.push(t):o.set(t.level,[t])}const i=[t];for(let e=t.level+1;e<=n;e++){const t=i.filter(t=>t.level===e-1);if(0===t.length)break;const n=o.get(e);if(n?.length)for(const e of n)for(const n of t)if(e.offset>=n.offset&&e.offset+e.size<=n.offset+n.size){i.push(e);break}}return i}function Lu(e,t){const n=t.trim().toLowerCase();return!n||e.toLowerCase().includes(n)}function Fu(e,t){let n=0;for(let t=0;t<e.length;t++)n=31*n+e.charCodeAt(t)>>>0;const o=t.v2.colors.black[500],i=[{fill:t.v2.colors.purple[300],text:o},{fill:t.v2.colors.green[300],text:o},{fill:t.v2.colors.red[300],text:o},{fill:t.v2.colors.blue[300],text:o},{fill:t.v2.colors.yellow[300],text:o}];return i[n%i.length]}var Mu,zu;function Bu(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function Xu(e,t,n){for(const o of n)if(e>=o.x&&e<o.x+o.w&&t>=o.y&&t<o.y+o.h)return o;return null}function Uu(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"})(Mu||(Mu={})),(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(zu||(zu={}));const Vu=({flamebearer:n,maxRowPx:o,searchQuery:l="",shouldKeepName:r,minHostHeight:s=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]=a({w:0,h:0}),[k,I]=a(""),[N,E]=a(null),[O,$]=a([]),[A,R]=a(!1),[D,_]=a(Mu.Fit),[P,L]=a(zu.Fit),[F,M]=a(!1),z=Math.max(1,Math.min(Math.floor(w.w*D),8192)),B=Math.max(1,Math.min(Math.floor(w.h*P),8192)),X=O.length>0?O[O.length-1]:null,U=X?.size??n.numTicks,V=c(()=>$u(n),[n]),H=p({fb:n,rects:V});i(()=>{const e=H.current;e.fb!==n&&(H.current={fb:n,rects:V},$(t=>{if(0===t.length)return t;const o=((e,t,n,o,i)=>{const a=[];for(const l of i){const i=Du(e,t,l);if(0===i.length)break;const r=_u(n,o,i);if(!r)break;a.push(r)}return a})(e.fb,e.rects,n,V,t);return o.length===t.length&&o.every((e,n)=>Ru(e,t[n]))?t:o}))},[n,V]),i(()=>{if(!f)return;if(!X)return void f(null);const e=Pu(V,X),t=new Set;for(const o of e){const e=Nu(n,o.nameIndex);e&&t.add(e)}f([...t])},[X,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()},[]),i(()=>{if(!A)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[A]),i(()=>(u?.(A),()=>{A&&u?.(!1)}),[A,u]);const j=c(()=>function(e,t,n,o,i,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??$u(e);let p=l?Pu(d,l):d;if(0===p.length)return null;if(r&&(p=p.filter(t=>r(Nu(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),o=new Map;for(const e of n){const t=o.get(e.level);t?t.push(e):o.set(e.level,[e])}const i=new Set;for(const t of n){const n=o.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&&Nu(e,l.nameIndex)===Nu(e,t.nameIndex)&&i.add(Au(l))}if(0===i.size)return n;const a=[];for(const e of n){if(i.has(Au(e)))continue;let t=0;for(let n=0;n<e.level;n++){const a=o.get(n);if(!a)continue;const l=a.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&i.has(Au(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=o??Number.POSITIVE_INFINITY,b=Math.max(1,Math.min(n/g,f)),v=i.trim(),y=b>8?1:0;return p.map(n=>{const o=n.level-u,i=(n.offset-h)/m*t,a=Math.max(n.size/m*t,1),l=o*b,r=Math.max(b-y,1),s=Nu(e,n.nameIndex);return{...n,x:i,y:l,w:a,h:r,name:s,matchesSearch:Lu(s,v)}})}(n,z,B,o,l,{zoomRoot:X,shouldKeepName:r,collapseRecursive:F,allRects:V}),[n,o,l,B,z,X,r,F,V]),G=c(()=>(e=>[...e].sort((e,t)=>t.level-e.level))(j?.length?l.trim()?j.filter(e=>e.matchesSearch):j:[]),[j,l]),W=d(e=>{if(z<2||B<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const o=Xu((e.clientX-t.left)/t.width*z,(e.clientY-t.top)/t.height*B,G);if(o){const e=Au(o);E(e);const t=U>0?(100*o.size/U).toFixed(1):"0",i=n.numTicks>0?(100*o.size/n.numTicks).toFixed(1):"0";I(`${o.name}\ntotal ${Eu(o.size)} (${t}% of view, ${i}% of profile) · self ${Eu(o.self)}`)}else E(null),I("")},[G,n.numTicks,B,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||B<2)return;const o=e.currentTarget.getBoundingClientRect();if(o.width<1||o.height<1)return;const i=Xu((e.clientX-o.left)/o.width*z,(e.clientY-o.top)/o.height*B,G);if(!i)return;m?.(i.name);const a=(e=>({level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}))(i);$(e=>{const t=e.length>0?e[e.length-1]:null;return t&&Ru(a,t)?e.slice(0,-1):[...e,a]})},[G,B,z,m]);g(()=>{const e=S.current;if(!e||z<2||B<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,o=Math.max(z,B),i=Math.min(t,16384/o);e.width=Math.floor(z*i),e.height=Math.floor(B*i),e.style.width=`${z}px`,e.style.height=`${B}px`;const a=e.getContext("2d");a&&(a.setTransform(i,0,0,i,0,0),a.clearRect(0,0,z,B),j?.length?((e,t,n,o,i,a,l,r)=>{const s=a.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,n);const c=i.trim().length>0;e.textRendering="optimizeLegibility";for(const t of o){const{x:n,y:o,w:i,h:l,name:s,size:d,matchesSearch:p}=t;if(c&&!p)continue;const{fill:u,text:h}=Fu(s,a);e.fillStyle=u,e.fillRect(n,o,i,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(n+.5,o+.5),e.lineTo(n+i-.5,o+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(n+.5,o+.5,Math.max(i-1,0),Math.max(l-1,0));const m=Bu(d,r),g=`${s} (${Eu(d)}, ${m}%)`,f=a.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(i>=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>i-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=i-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,n+v,o+l/2),e.fillStyle=h,e.fillText(t,n+v,o+l/2))}}if(l)for(const t of o){if(Au(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:n,y:o,w:i,h:a}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(n+1,o+1,Math.max(i-2,0),Math.max(a-2,0));break}})(a,z,B,j,l,y,N,n.numTicks):(a.fillStyle=y.v2.colors.silver[900],a.fillRect(0,0,z,B)))},[j,n.numTicks,N,l,B,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,ee=c(()=>((e,t,n)=>{const o=n??$u(e),i=t?.offset??0,a=i+(t?.size??e.numTicks),l=(t?.level??-1)+1,r=t?.size??e.numTicks;let s=null;for(const e of o)e.level<l||e.offset<i||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,X,V),[n,X,V]),te=null!==ee,ne=O.length>0,oe=X?Nu(n,X.nameIndex):"",ie=d(()=>{$([]),b?.()},[b]),ae=d(()=>$(e=>e.slice(0,-1)),[]),se=d(()=>{ee&&$(e=>[...e,ee])},[ee]);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:s,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(pe,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(le,{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:re.Left,size:Nt.S,value:F,onChange:M}),e(pe,{$gap:8,children:[e(pe,{children:[t(fe,{variant:ve.Secondary,size:be.S,label:"Reset zoom",leftIcon:yl,onClick:ie,disabled:!O.length}),t(fe,{variant:ve.Secondary,size:be.S,iconSize:20,leftIcon:vl,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!ne,onClick:ae}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(_e,{size:Te.XXS,color:Pe.Secondary,nowrap:!0,align:"center",children:`${Q}%`})}),t(fe,{variant:ve.Secondary,size:be.S,iconSize:20,leftIcon:Ra,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!te,onClick:se})]}),e(pe,{children:[t(Fe,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ce,{variant:_n.Filled,options:[{value:Mu.Fit,label:"W: Fit"},{value:Mu.X10,label:"10x"}],selected:D,setSelected:_})}),t(Fe,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ce,{variant:_n.Filled,options:[{value:zu.Fit,label:"H: Fit"},{value:zu.X10,label:"10x"}],selected:P,setSelected:L})})]}),t(fe,{variant:ve.Secondary,size:be.S,iconSize:24,leftIcon:A?Ka:Cl,tooltip:A?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:Z})]})]}),t(Fe,{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:P>1?"auto":"hidden"},children:t("div",{style:{width:z||"100%",height:B||"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(pe,{$justifyContent:"space-between",children:[t(_e,X?{size:Te.XXXS,color:y.v2.colors.silver[300],children:`Zoomed: ${oe} • ${Eu(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(_e,{size:Te.XXXS,color:y.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${Uu(h.totalBytesUsed)} / ${Uu(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})},Hu=[Dn.Go,Dn.Java],ju="Profiling Symbols";function Gu(e,t){if(0===t.length)return null;const n=1===t.length?t[0]:(e=>e.includes("/")||/\.\(\*?[^)]+\)\./.test(e)?Dn.Go:e.includes(" ")||e.includes("(")?Dn.Java:Dn.Go)(e);if(n===Dn.Go){const t=(e=>{let t=e.trim();if(!t)return null;t=t.replace(/\[[^\]]*\]/g,"");const n=t.lastIndexOf("/"),o=t.indexOf(".",n+1);if(-1===o)return null;const i=t.slice(0,o),a=t.slice(o+1);if(!i||!a)return null;const l=a.match(/^\(\*?([^)]+)\)\.(.+)$/);if(l){const e=new Be(i,"",l[1],l[2]);return e.Verify()?e:null}const r=new Be(i,a);return r.Verify()?r:null})(e);return t?{language:n,golang:t}:null}if(n===Dn.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 o=t.split(/\s+/);t=o[o.length-1]??"";const i=t.lastIndexOf(".");if(-1===i)return null;const a=t.slice(0,i),l=t.slice(i+1),r=new Xe(a,l);return r.Verify()?r:null})(e);return t?{language:n,java:t}:null}return null}function Wu(e,t){return e.namespace===t.namespace&&e.name===t.name&&e.kind===t.kind}function Ku(e,t,n){if(!e)return!0;const{sources:o=[],namespaces:i=[],languages:a=[]}=e,l=!o.length||o.some(e=>Wu(e,t.id)),r=!i.length||i.includes(t.id.namespace),s=!a.length||null==n||a.includes(n);return l&&r&&s}function Yu(e,t){return e.packageName===t.packageName&&(e.functionName||"")===(t.functionName||"")&&(e.receiverName||"")===(t.receiverName||"")&&(e.receiverMethodName||"")===(t.receiverMethodName||"")}function Ju(e,t){return e.className===t.className&&e.methodName===t.methodName}function qu(e,t,n,o){const i=Gu(e,n);if(!i)return[];const a=[];for(const e of o){const n=e.customInstrumentations;if(!n)continue;if(!Ku(e.sourceScopes,t,i.language))continue;const o=!!i.golang&&!!n[Ve.Golang]?.some(e=>Yu(e,i.golang)),l=!!i.java&&!!n[Ve.Java]?.some(e=>Ju(e,i.java));(o||l)&&a.push({rule:e,resolved:i})}return a}var Zu,Qu,eh;(e=>{e.Symbol="symbol",e.Self="self",e.Total="total"})(Zu||(Zu={})),(e=>{e.OnlyInstrumentable="only-instrumentable"})(Qu||(Qu={})),(e=>{e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"})(eh||(eh={}));const th=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function nh(e,t){const n=(e=>e.split(" ")[0]??"")(e);return(!t.includes(eh.FilterOutVoid)||"void"!==n)&&!!(!t.includes(eh.OnlyWithReturnValues)||e.includes(" ")&&"void"!==n&&th.test(n))}const oh=({rows:e,languages:n,instrumentation:o,searchQuery:i,filters:a,onFiltersChange:l,zoomedSymbols:r,highlightSymbol:s,scrollSignal:p})=>{const u=!!n?.includes(Dn.Java),h=c(()=>{const t=r?new Set(r):null,n=i?.trim().toLowerCase();return e.filter(e=>(!t||t.has(e.name))&&(!n||e.name.toLowerCase().includes(n)))},[e,i,r]),m=c(()=>{const e=[];if(o.selectionEnabled&&e.push({id:Qu.OnlyInstrumentable,label:"Only show instrumentable symbols"}),u&&(e.push({id:eh.FilterOutVoid,label:"Filter out void symbols"}),e.push({id:eh.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===Zu.Symbol)?.rawValue?.toString()??"";return!(t.includes(Qu.OnlyInstrumentable)&&!o.getSymbolState(n).showCheckbox)&&nh(n,t)}}},[o,u]),g=c(()=>[{key:Zu.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:m,noFilter:!m},{key:Zu.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:Zu.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[m]),f=c(()=>h.map(e=>{const t=o.getSymbolState(e.name),n=t.showCheckbox;return{id:e.name,cells:[{key:Zu.Symbol,rawValue:e.name},{key:Zu.Self,rawValue:Eu(e.self)},{key:Zu.Total,rawValue:Eu(e.total)}],isSelected:n?o.isSelected(e.name):void 0,onSelect:n?()=>o.onToggleSymbol(e.name,!0):void 0,onDeselect:n?()=>o.onToggleSymbol(e.name,!1):void 0,hideCheckbox:!n,checkboxDisabled:n?t.checkboxDisabled:void 0,checkboxTooltip:n?t.checkboxTooltip:void 0}}),[h,o]),b=d(e=>{const t=e.cells[0].rawValue,n=o.getSymbolState(t),i=[];return n.inManagedRule?i.push({id:`remove-instrumentation-${t}`,label:"",leftIcon:Aa,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>o.onRemove(t)}):i.push({id:`add-instrumentation-${t}`,label:"",leftIcon:Ra,tooltip:n.addTooltip,disabled:!n.addEnabled,onClick:()=>o.onAdd(t)}),i.push({id:`copy-${t}`,label:"",leftIcon:Sl,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),i},[o]);return t(Pn,{variant:Ln.Data,maxHeight:"calc(100vh - 306px)",columns:g,rows:f,withCheckboxes:o.selectionEnabled,filters:a,onFiltersChange:l,activeRowId:s,scrollSignal:p,getRowActions:b})};var ih;(e=>{e.Table="table",e.Flame="flame",e.Both="both"})(ih||(ih={}));const ah=b(ee)`
694
+ `,Ou=({pendingModify:n,onClose:o,onConfirm:i})=>{const a=v();return t(qe,{isOpen:!!n,title:'Modify the "Profiling Symbols" rule',description:'These changes are applied immediately to a single custom instrumentation rule named "Profiling Symbols".\nSelected symbols are added to it; unchecked symbols are removed from it (the rule is deleted once empty). Symbols managed by other rules are never touched.',onClose:o,denyButton:{variant:ve.Secondary,label:"Cancel",onClick:o},approveButton:{variant:ve.Primary,label:"Confirm",onClick:i},children:n&&e(Nu,{children:[n.add.map(n=>e(Eu,{children:[t(Ke,{leftIcon:_a,status:Ee.Success,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:Te.XXS}),t(_e,{size:Te.XS,color:Pe.Primary,children:n})]},`add-${n}`)),n.remove.map(n=>e(Eu,{children:[t(Ke,{leftIcon:Cl,status:Ee.Error,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:Te.XXS}),t(_e,{size:Te.XS,color:Pe.Primary,children:n})]},`remove-${n}`))]})})};function $u(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 Au(e){const t=Math.abs(e);return t>=1e9?`${Ru(e/1e9)}s`:t>=1e6?`${Ru(e/1e6)}ms`:t>=1e3?`${Ru(e/1e3)}μs`:String(Math.round(e))}function Ru(e){return e.toFixed(2).replace(/\.?0+$/,"")}function Du(e){const t=[];for(let n=0;n<e.levels.length;n++){const o=e.levels[n];let i=0;for(let e=0;e+3<o.length;e+=4){const a=o[e],l=o[e+1],r=o[e+2],s=o[e+3],c=i+a;t.push({level:n,offset:c,size:l,self:r,nameIndex:s}),i=c+l}}return t}function _u(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function Pu(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}function Lu(e,t,n){return((e,t)=>{const n=[];for(let o=0;o<=t.level;o++){let i;for(const n of e)if(n.level===o&&t.offset>=n.offset&&t.offset+t.size<=n.offset+n.size){i=n;break}if(!i)return n;n.push(i)}return n})(t,n).map(t=>$u(e,t.nameIndex))}function Fu(e,t,n){if(0===n.length)return null;let o=null,i=null;for(let a=0;a<n.length;a++){const l=n[a];let r=null;for(const n of t)n.level===a&&$u(e,n.nameIndex)===l&&(o&&(n.offset<o.offset||n.offset+n.size>o.offset+o.size)||(!r||n.size>r.size)&&(r=n));if(!r)return null;o=r,i=r}return i}function Mu(e,t){const n=e.reduce((e,t)=>Math.max(e,t.level),t.level),o=new Map;for(const t of e){const e=o.get(t.level);e?e.push(t):o.set(t.level,[t])}const i=[t];for(let e=t.level+1;e<=n;e++){const t=i.filter(t=>t.level===e-1);if(0===t.length)break;const n=o.get(e);if(n?.length)for(const e of n)for(const n of t)if(e.offset>=n.offset&&e.offset+e.size<=n.offset+n.size){i.push(e);break}}return i}function zu(e,t){const n=t.trim().toLowerCase();return!n||e.toLowerCase().includes(n)}function Bu(e,t){let n=0;for(let t=0;t<e.length;t++)n=31*n+e.charCodeAt(t)>>>0;const o=t.v2.colors.black[500],i=[{fill:t.v2.colors.purple[300],text:o},{fill:t.v2.colors.green[300],text:o},{fill:t.v2.colors.red[300],text:o},{fill:t.v2.colors.blue[300],text:o},{fill:t.v2.colors.yellow[300],text:o}];return i[n%i.length]}var Xu,Uu;function Vu(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function Hu(e,t,n){for(const o of n)if(e>=o.x&&e<o.x+o.w&&t>=o.y&&t<o.y+o.h)return o;return null}function ju(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"})(Xu||(Xu={})),(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(Uu||(Uu={}));const Gu=({flamebearer:n,maxRowPx:o,searchQuery:l="",shouldKeepName:r,minHostHeight:s=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]=a({w:0,h:0}),[k,I]=a(""),[N,E]=a(null),[O,$]=a([]),[A,R]=a(!1),[D,_]=a(Xu.Fit),[P,L]=a(Uu.Fit),[F,M]=a(!1),z=Math.max(1,Math.min(Math.floor(w.w*D),8192)),B=Math.max(1,Math.min(Math.floor(w.h*P),8192)),X=O.length>0?O[O.length-1]:null,U=X?.size??n.numTicks,V=c(()=>Du(n),[n]),H=p({fb:n,rects:V});i(()=>{const e=H.current;e.fb!==n&&(H.current={fb:n,rects:V},$(t=>{if(0===t.length)return t;const o=((e,t,n,o,i)=>{const a=[];for(const l of i){const i=Lu(e,t,l);if(0===i.length)break;const r=Fu(n,o,i);if(!r)break;a.push(r)}return a})(e.fb,e.rects,n,V,t);return o.length===t.length&&o.every((e,n)=>Pu(e,t[n]))?t:o}))},[n,V]),i(()=>{if(!f)return;if(!X)return void f(null);const e=Mu(V,X),t=new Set;for(const o of e){const e=$u(n,o.nameIndex);e&&t.add(e)}f([...t])},[X,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()},[]),i(()=>{if(!A)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[A]),i(()=>(u?.(A),()=>{A&&u?.(!1)}),[A,u]);const j=c(()=>function(e,t,n,o,i,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??Du(e);let p=l?Mu(d,l):d;if(0===p.length)return null;if(r&&(p=p.filter(t=>r($u(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),o=new Map;for(const e of n){const t=o.get(e.level);t?t.push(e):o.set(e.level,[e])}const i=new Set;for(const t of n){const n=o.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&&$u(e,l.nameIndex)===$u(e,t.nameIndex)&&i.add(_u(l))}if(0===i.size)return n;const a=[];for(const e of n){if(i.has(_u(e)))continue;let t=0;for(let n=0;n<e.level;n++){const a=o.get(n);if(!a)continue;const l=a.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&i.has(_u(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=o??Number.POSITIVE_INFINITY,b=Math.max(1,Math.min(n/g,f)),v=i.trim(),y=b>8?1:0;return p.map(n=>{const o=n.level-u,i=(n.offset-h)/m*t,a=Math.max(n.size/m*t,1),l=o*b,r=Math.max(b-y,1),s=$u(e,n.nameIndex);return{...n,x:i,y:l,w:a,h:r,name:s,matchesSearch:zu(s,v)}})}(n,z,B,o,l,{zoomRoot:X,shouldKeepName:r,collapseRecursive:F,allRects:V}),[n,o,l,B,z,X,r,F,V]),G=c(()=>(e=>[...e].sort((e,t)=>t.level-e.level))(j?.length?l.trim()?j.filter(e=>e.matchesSearch):j:[]),[j,l]),W=d(e=>{if(z<2||B<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const o=Hu((e.clientX-t.left)/t.width*z,(e.clientY-t.top)/t.height*B,G);if(o){const e=_u(o);E(e);const t=U>0?(100*o.size/U).toFixed(1):"0",i=n.numTicks>0?(100*o.size/n.numTicks).toFixed(1):"0";I(`${o.name}\ntotal ${Au(o.size)} (${t}% of view, ${i}% of profile) · self ${Au(o.self)}`)}else E(null),I("")},[G,n.numTicks,B,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||B<2)return;const o=e.currentTarget.getBoundingClientRect();if(o.width<1||o.height<1)return;const i=Hu((e.clientX-o.left)/o.width*z,(e.clientY-o.top)/o.height*B,G);if(!i)return;m?.(i.name);const a=(e=>({level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}))(i);$(e=>{const t=e.length>0?e[e.length-1]:null;return t&&Pu(a,t)?e.slice(0,-1):[...e,a]})},[G,B,z,m]);g(()=>{const e=S.current;if(!e||z<2||B<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,o=Math.max(z,B),i=Math.min(t,16384/o);e.width=Math.floor(z*i),e.height=Math.floor(B*i),e.style.width=`${z}px`,e.style.height=`${B}px`;const a=e.getContext("2d");a&&(a.setTransform(i,0,0,i,0,0),a.clearRect(0,0,z,B),j?.length?((e,t,n,o,i,a,l,r)=>{const s=a.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,n);const c=i.trim().length>0;e.textRendering="optimizeLegibility";for(const t of o){const{x:n,y:o,w:i,h:l,name:s,size:d,matchesSearch:p}=t;if(c&&!p)continue;const{fill:u,text:h}=Bu(s,a);e.fillStyle=u,e.fillRect(n,o,i,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(n+.5,o+.5),e.lineTo(n+i-.5,o+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(n+.5,o+.5,Math.max(i-1,0),Math.max(l-1,0));const m=Vu(d,r),g=`${s} (${Au(d)}, ${m}%)`,f=a.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(i>=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>i-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=i-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,n+v,o+l/2),e.fillStyle=h,e.fillText(t,n+v,o+l/2))}}if(l)for(const t of o){if(_u(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:n,y:o,w:i,h:a}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(n+1,o+1,Math.max(i-2,0),Math.max(a-2,0));break}})(a,z,B,j,l,y,N,n.numTicks):(a.fillStyle=y.v2.colors.silver[900],a.fillRect(0,0,z,B)))},[j,n.numTicks,N,l,B,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,ee=c(()=>((e,t,n)=>{const o=n??Du(e),i=t?.offset??0,a=i+(t?.size??e.numTicks),l=(t?.level??-1)+1,r=t?.size??e.numTicks;let s=null;for(const e of o)e.level<l||e.offset<i||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,X,V),[n,X,V]),te=null!==ee,ne=O.length>0,oe=X?$u(n,X.nameIndex):"",ie=d(()=>{$([]),b?.()},[b]),ae=d(()=>$(e=>e.slice(0,-1)),[]),se=d(()=>{ee&&$(e=>[...e,ee])},[ee]);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:s,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(pe,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(le,{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:re.Left,size:Nt.S,value:F,onChange:M}),e(pe,{$gap:8,children:[e(pe,{children:[t(fe,{variant:ve.Secondary,size:be.S,label:"Reset zoom",leftIcon:Sl,onClick:ie,disabled:!O.length}),t(fe,{variant:ve.Secondary,size:be.S,iconSize:20,leftIcon:Cl,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!ne,onClick:ae}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(_e,{size:Te.XXS,color:Pe.Secondary,nowrap:!0,align:"center",children:`${Q}%`})}),t(fe,{variant:ve.Secondary,size:be.S,iconSize:20,leftIcon:_a,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!te,onClick:se})]}),e(pe,{children:[t(Fe,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ce,{variant:Pn.Filled,options:[{value:Xu.Fit,label:"W: Fit"},{value:Xu.X10,label:"10x"}],selected:D,setSelected:_})}),t(Fe,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ce,{variant:Pn.Filled,options:[{value:Uu.Fit,label:"H: Fit"},{value:Uu.X10,label:"10x"}],selected:P,setSelected:L})})]}),t(fe,{variant:ve.Secondary,size:be.S,iconSize:24,leftIcon:A?Ja:xl,tooltip:A?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:Z})]})]}),t(Fe,{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:P>1?"auto":"hidden"},children:t("div",{style:{width:z||"100%",height:B||"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(pe,{$justifyContent:"space-between",children:[t(_e,X?{size:Te.XXXS,color:y.v2.colors.silver[300],children:`Zoomed: ${oe} • ${Au(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(_e,{size:Te.XXXS,color:y.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${ju(h.totalBytesUsed)} / ${ju(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})},Wu=[_n.Go,_n.Java],Ku="Profiling Symbols";function Yu(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("/"),o=t.indexOf(".",n+1);if(-1===o)return null;const i=t.slice(0,o),a=t.slice(o+1);if(!i||!a)return null;const l=a.match(/^\(\*?([^)]+)\)\.(.+)$/);if(l){const e=new Be(i,"",l[1],l[2]);return e.Verify()?e:null}const r=new Be(i,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 o=t.split(/\s+/);t=o[o.length-1]??"";const i=t.lastIndexOf(".");if(-1===i)return null;const a=t.slice(0,i),l=t.slice(i+1),r=new Xe(a,l);return r.Verify()?r:null})(e);return t?{language:n,java:t}:null}return null}function Ju(e,t){return e.namespace===t.namespace&&e.name===t.name&&e.kind===t.kind}function qu(e,t,n){if(!e)return!0;const{sources:o=[],namespaces:i=[],languages:a=[]}=e,l=!o.length||o.some(e=>Ju(e,t.id)),r=!i.length||i.includes(t.id.namespace),s=!a.length||null==n||a.includes(n);return l&&r&&s}function Zu(e,t){return e.packageName===t.packageName&&(e.functionName||"")===(t.functionName||"")&&(e.receiverName||"")===(t.receiverName||"")&&(e.receiverMethodName||"")===(t.receiverMethodName||"")}function Qu(e,t){return e.className===t.className&&e.methodName===t.methodName}function eh(e,t,n,o){const i=Yu(e,n);if(!i)return[];const a=[];for(const e of o){const n=e.customInstrumentations;if(!n)continue;if(!qu(e.sourceScopes,t,i.language))continue;const o=!!i.golang&&!!n[Ve.Golang]?.some(e=>Zu(e,i.golang)),l=!!i.java&&!!n[Ve.Java]?.some(e=>Qu(e,i.java));(o||l)&&a.push({rule:e,resolved:i})}return a}var th,nh,oh;(e=>{e.Symbol="symbol",e.Self="self",e.Total="total"})(th||(th={})),(e=>{e.OnlyInstrumentable="only-instrumentable"})(nh||(nh={})),(e=>{e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"})(oh||(oh={}));const ih=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function ah(e,t){const n=(e=>e.split(" ")[0]??"")(e);return(!t.includes(oh.FilterOutVoid)||"void"!==n)&&!!(!t.includes(oh.OnlyWithReturnValues)||e.includes(" ")&&"void"!==n&&ih.test(n))}const lh=({rows:e,languages:n,instrumentation:o,searchQuery:i,filters:a,onFiltersChange:l,zoomedSymbols:r,highlightSymbol:s,scrollSignal:p})=>{const u=!!n?.includes(_n.Java),h=c(()=>{const t=r?new Set(r):null,n=i?.trim().toLowerCase();return e.filter(e=>(!t||t.has(e.name))&&(!n||e.name.toLowerCase().includes(n)))},[e,i,r]),m=c(()=>{const e=[];if(o.selectionEnabled&&e.push({id:nh.OnlyInstrumentable,label:"Only show instrumentable symbols"}),u&&(e.push({id:oh.FilterOutVoid,label:"Filter out void symbols"}),e.push({id:oh.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===th.Symbol)?.rawValue?.toString()??"";return!(t.includes(nh.OnlyInstrumentable)&&!o.getSymbolState(n).showCheckbox)&&ah(n,t)}}},[o,u]),g=c(()=>[{key:th.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:m,noFilter:!m},{key:th.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:th.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[m]),f=c(()=>h.map(e=>{const t=o.getSymbolState(e.name),n=t.showCheckbox;return{id:e.name,cells:[{key:th.Symbol,rawValue:e.name},{key:th.Self,rawValue:Au(e.self)},{key:th.Total,rawValue:Au(e.total)}],isSelected:n?o.isSelected(e.name):void 0,onSelect:n?()=>o.onToggleSymbol(e.name,!0):void 0,onDeselect:n?()=>o.onToggleSymbol(e.name,!1):void 0,hideCheckbox:!n,checkboxDisabled:n?t.checkboxDisabled:void 0,checkboxTooltip:n?t.checkboxTooltip:void 0}}),[h,o]),b=d(e=>{const t=e.cells[0].rawValue,n=o.getSymbolState(t),i=[];return n.inManagedRule?i.push({id:`remove-instrumentation-${t}`,label:"",leftIcon:Da,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>o.onRemove(t)}):i.push({id:`add-instrumentation-${t}`,label:"",leftIcon:_a,tooltip:n.addTooltip,disabled:!n.addEnabled,onClick:()=>o.onAdd(t)}),i.push({id:`copy-${t}`,label:"",leftIcon:wl,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),i},[o]);return t(Ln,{variant:Fn.Data,maxHeight:"calc(100vh - 306px)",columns:g,rows:f,withCheckboxes:o.selectionEnabled,filters:a,onFiltersChange:l,activeRowId:s,scrollSignal:p,getRowActions:b})};var rh;(e=>{e.Table="table",e.Flame="flame",e.Both="both"})(rh||(rh={}));const sh=b(ee)`
695
695
  width: 100%;
696
696
  flex: 1;
697
697
  border-radius: 16px;
698
698
  overflow: hidden;
699
699
  background: ${({theme:e})=>e.v2.colors.silver[800]};
700
700
  box-shadow: 0 2px 14.1px 0 rgba(0, 0, 0, 0.25);
701
- `,lh=b.div`
701
+ `,ch=b.div`
702
702
  display: flex;
703
703
  align-items: center;
704
704
  gap: 10px;
@@ -706,11 +706,11 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
706
706
  padding: 12px 12px 8px;
707
707
  background: ${({theme:e})=>e.v2.colors.silver[800]};
708
708
  border-radius: 16px 16px 0 0;
709
- `,rh=b(pe)`
709
+ `,dh=b(pe)`
710
710
  flex-shrink: 0;
711
711
  align-items: center;
712
712
  gap: 4px;
713
- `,sh=b.div`
713
+ `,ph=b.div`
714
714
  flex: 1;
715
715
  display: flex;
716
716
  align-items: stretch;
@@ -718,20 +718,20 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
718
718
  padding: 16px;
719
719
  background: ${({theme:e})=>e.v2.colors.silver[800]};
720
720
  border-radius: 0 0 16px 16px;
721
- `,ch=b(ee)`
721
+ `,uh=b(ee)`
722
722
  flex: ${({$splitWithFlame:e})=>e?"0 0 min(413px, 42%)":"1 1 auto"};
723
723
  width: ${({$splitWithFlame:e})=>e?"auto":"100%"};
724
724
  max-width: ${({$splitWithFlame:e})=>e?"none":"100%"};
725
725
  gap: 10px;
726
- `,dh=b(ee)`
726
+ `,hh=b(ee)`
727
727
  flex: ${({$splitWithTable:e})=>e?"1":"1 1 auto"};
728
728
  width: ${({$splitWithTable:e})=>e?"auto":"100%"};
729
729
  gap: 10px;
730
- `,ph=b(pe)`
730
+ `,mh=b(pe)`
731
731
  width: 100%;
732
732
  min-height: 32px;
733
733
  flex-shrink: 0;
734
- `,uh=({source:n,onFlameFullscreenChange:o})=>{const r=v(),s=n.id,{profilingApi:u}=Vl(),[h,m]=a(!0),[g,f]=a(ih.Both),[b,y]=a(""),[C,S]=a({}),[x,w]=a(!1),T=p(!1);i(()=>{T.current||(T.current=!0,u.enableProfiling?.(s),w(!0))},[u,s]);const{data:k}=u.useSlots({skip:!x,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),{data:I,loading:N,refetch:E}=u.useSourceProfiling(s,{skip:!x,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),O=I?.profileJson??null,$=c(()=>(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=c(()=>$?(e=>{const t=new Map;for(let n=0;n<e.levels.length;n++){const o=e.levels[n];for(let n=0;n+3<o.length;n+=4){const i=o[n+1],a=o[n+2],l=Nu(e,o[n+3]);if(!l)continue;const r=t.get(l);(!r||i>r.total)&&t.set(l,{self:a,total:i})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)})($.flamebearer):[],[$]),R=g===ih.Table||g===ih.Both,D=g===ih.Flame||g===ih.Both,_=R&&D,P=n.runtimeInfo?.detectedLanguages?.join("\0")??"",L=n.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??"").join("\0")??"",F=c(()=>P?P.split("\0"):L?L.split("\0"):void 0,[P,L]),M=c(()=>((e,t)=>{if(!t?.includes(Dn.Java))return;const n=(e?.[Zu.Symbol]?.filter(Boolean)??[]).filter(e=>e===eh.FilterOutVoid||e===eh.OnlyWithReturnValues);return 0!==n.length?e=>nh(e,n):void 0})(C,F),[C,F]),{instrumentation:z,pendingCount:B,pendingModify:X,closeModify:U,openBulkModify:V,resetSelection:H,confirmModify:j}=function({source:e,languages:t,rows:n}){const{instrumentationRulesApi:o,capabilities:i}=Vl(),{items:l}=o.useRules(),[r,s]=a(new Set),[p,u]=a(new Set),[h,m]=a(null),g=c(()=>(e=>{const t=new Set(e??[]);return Hu.filter(e=>t.has(e))})(t),[t]),f=i.canCreateInstrumentationRule,b=`${e.id.namespace}\0${e.id.kind}\0${e.id.name}`,v=c(()=>((e,t)=>{const n=e.filter(e=>e.type===je.CustomInstrumentation&&e.ruleName===ju&&Ku(e.sourceScopes,t));return n.find(e=>e.sourceScopes?.sources?.some(e=>Wu(e,t.id)))??n[0]??null})(l,e),[l,b]),y=f&&g.length>0,C=c(()=>{const t=new Map;for(const o of n){const n=!!Gu(o.name,g),i=qu(o.name,e,g,l),a=!!v&&i.some(e=>e.rule.ruleId===v.ruleId),r=i.filter(e=>e.rule.ruleId!==v?.ruleId),s=!a&&r.length>0,c=y&&n,d=s;let p;if(s){const e=[...new Set(r.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===i.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(o.name,{parsable:n,inManagedRule:a,otherRules:r,showCheckbox:c,checkboxDisabled:d,checkboxTooltip:p,addEnabled:u,addTooltip:h})}return t},[n,l,b,g,f,y,v]),S=c(()=>{const e=new Set;return C.forEach((t,n)=>{t.inManagedRule&&e.add(n)}),e},[C]),x=c(()=>[...r].filter(e=>C.get(e)?.addEnabled&&!S.has(e)),[r,C,S]),w=c(()=>[...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)||r.has(e)},[C,p,r]),I=d((e,t)=>{const n=C.get(e);n&&!n.checkboxDisabled&&(n.inManagedRule?u(n=>{const o=new Set(n);return t?o.delete(e):o.add(e),o}):s(n=>{const o=new Set(n);return t?o.add(e):o.delete(e),o}))},[C]),N=d(()=>{s(new Set),u(new Set)},[]),E=d(t=>{(async()=>{const n=t.add.map(e=>Gu(e,g)).filter(e=>!!e),i=t.remove.map(e=>Gu(e,g)).filter(e=>!!e);if(v){const{customInstrumentations:e,isEmpty:t}=((e,t,n)=>{const o=e.customInstrumentations??{};let i=[...o[Ve.Golang]??[]],a=[...o[Ve.Java]??[]];for(const e of n)e.golang&&(i=i.filter(t=>!Yu(t,e.golang))),e.java&&(a=a.filter(t=>!Ju(t,e.java)));for(const e of t)e.golang&&!i.some(t=>Yu(t,e.golang))&&i.push(e.golang),e.java&&!a.some(t=>Ju(t,e.java))&&a.push(e.java);return{customInstrumentations:{[Ve.Golang]:i,[Ve.Java]:a},isEmpty:0===i.length&&0===a.length}})(v,n,i);t?await o.remove(v.ruleId,je.CustomInstrumentation):await o.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),je.CustomInstrumentation)}else n.length>0&&await o.create(((e,t)=>{const n=e.map(e=>e.golang).filter(e=>!!e),o=e.map(e=>e.java).filter(e=>!!e),i={sources:[{namespace:t.id.namespace,name:t.id.name,kind:t.id.kind}],namespaces:[],languages:[]};return{ruleName:ju,notes:"Symbols selected from the profiling tab.",disabled:!1,sourceScopes:i,workloads:null,instrumentationLibraries:null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:{[Ve.Golang]:n,[Ve.Java]:o}}})(n,e),je.CustomInstrumentation)})()},[v,g,e,o]),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]),_=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:c(()=>({getSymbolState:_,onAdd:$,onRemove:A,selectionEnabled:y,isSelected:k,onToggleSymbol:I}),[_,$,A,y,k,I]),pendingCount:T,pendingModify:h,closeModify:R,openBulkModify:O,resetSelection:N,confirmModify:D}}({source:n,languages:F,rows:A}),[G,W]=a(null),[K,Y]=a(0),[J,q]=a(null),Z=d(e=>{W(e),Y(e=>e+1),f(e=>e===ih.Flame?ih.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})},[]),te=d(()=>W(null),[]);return!O&&N?t(mt,{$height:"70vh",children:t(yt,{withSpinner:!0})}):e(ah,{$gap:0,$width:"100%",children:[e(lh,{children:[t(Fe,{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(rh,{children:t(_e,{size:Te.S,weight:500,color:Pe.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(pe,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(mn,{value:b,onChange:y,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:r.v2.colors.silver[900],emphasizeBackgroundColor:r.v2.colors.silver[800]})}),t(ce,{variant:_n.Filled,options:[{value:ih.Table,label:"Top table"},{value:ih.Flame,label:"Flame graph"},{value:ih.Both,label:"Both"}],selected:g,setSelected:f}),t(fe,h?{variant:ve.Secondary,size:be.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(xl,{...e,size:8,fill:r.v2.colors.green[500]})}:{variant:ve.Secondary,size:be.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(xl,{...e,size:8,fill:r.v2.colors.red[500]})})]})]}),t(sh,{$gap:R&&D?16:0,children:$?e(l,{children:[R&&e(ch,{$splitWithFlame:_,children:[e(ph,{$justifyContent:"space-between",children:[e(ee,{$margin:"0 0 0 20px",children:[t(_e,{size:Te.XXXS,nowrap:!0,children:"Please select symbols to"}),e(pe,{$gap:8,children:[e(pe,{children:[t(wl,{size:24}),t(_e,{size:Te.S,color:Pe.Success,nowrap:!0,children:"Custom Instrument"})]}),t(fe,{leftIcon:La,variant:ve.Secondary,size:be.S,onClick:()=>window.open(`${Oe}/enterprise/pipeline/rules/custominstrumentation`,"_blank","noopener noreferrer")})]})]}),e(pe,{$gap:8,children:[J&&t(Fe,{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(Ke,{label:`Zoomed: ${J.length} symbols`,backgroundColor:r.v2.colors.silver[750],textColor:r.v2.colors.silver[200],textSize:Te.XXS})}),t(fe,{variant:ve.Secondary,size:be.S,label:"Download snapshot",rightIcon:Tl,onClick:()=>{if(!O)return;const e=new Blob([O],{type:"application/json"}),t=URL.createObjectURL(e),o=document.createElement("a");o.href=t,o.download=`cpu-profile-${n.id.namespace}-${n.id.kind}-${n.id.name}.json`,o.click(),URL.revokeObjectURL(t)},disabled:!O})]})]}),t(oh,{rows:A,languages:F,instrumentation:z,searchQuery:b,filters:C,onFiltersChange:S,zoomedSymbols:J,highlightSymbol:G,scrollSignal:K})]}),D&&e(dh,{$splitWithTable:_,children:[e(ph,{$justifyContent:"space-between",children:[t(Ke,{label:$?`Total in view ${Eu($.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:r.v2.colors.silver[750],textColor:r.v2.colors.silver[200],textSize:Te.XXS}),e(pe,{$gap:12,children:[!h&&t(fe,{variant:ve.Secondary,size:be.S,label:"Refresh",leftIcon:ll,onClick:E}),t(le,{label:"Auto refresh",labelAlign:re.Left,size:Nt.S,value:h,onChange:m})]})]}),t(Vu,{flamebearer:$.flamebearer,maxRowPx:24,searchQuery:b,shouldKeepName:M,minHostHeight:280,onFullscreenChange:o,profilingSlots:k??null,onFrameClick:Z,onZoomedSymbolsChange:Q,onResetZoom:te})]})]}):t(mt,{children:t(xe,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})}),t(Iu,{pendingModify:X,onClose:U,onConfirm:j}),t(Fn,{isOpen:B>0,richTitle:{icon:Ya,title:"Profiling Symbols",badge:{label:B}},actions:[{id:"profiling-bulk-cancel",type:hn.Button,buttonProps:{variant:ve.Secondary,size:be.S,label:"Cancel",onClick:H}},{id:"profiling-bulk-apply",type:hn.Button,buttonProps:{variant:ve.Primary,size:be.S,label:"Modify Rule",leftIcon:Ma,onClick:V}}]})]})},hh=b.div`
734
+ `,gh=({source:n,onFlameFullscreenChange:o})=>{const r=v(),s=n.id,{profilingApi:u}=jl(),[h,m]=a(!0),[g,f]=a(rh.Both),[b,y]=a(""),[C,S]=a({}),[x,w]=a(!1),T=p(!1);i(()=>{T.current||(T.current=!0,u.enableProfiling?.(s),w(!0))},[u,s]);const{data:k}=u.useSlots({skip:!x,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),{data:I,loading:N,refetch:E}=u.useSourceProfiling(s,{skip:!x,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),O=I?.profileJson??null,$=c(()=>(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=c(()=>$?(e=>{const t=new Map;for(let n=0;n<e.levels.length;n++){const o=e.levels[n];for(let n=0;n+3<o.length;n+=4){const i=o[n+1],a=o[n+2],l=$u(e,o[n+3]);if(!l)continue;const r=t.get(l);(!r||i>r.total)&&t.set(l,{self:a,total:i})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)})($.flamebearer):[],[$]),R=g===rh.Table||g===rh.Both,D=g===rh.Flame||g===rh.Both,_=R&&D,P=n.runtimeInfo?.detectedLanguages?.join("\0")??"",L=n.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??"").join("\0")??"",F=c(()=>P?P.split("\0"):L?L.split("\0"):void 0,[P,L]),M=c(()=>((e,t)=>{if(!t?.includes(_n.Java))return;const n=(e?.[th.Symbol]?.filter(Boolean)??[]).filter(e=>e===oh.FilterOutVoid||e===oh.OnlyWithReturnValues);return 0!==n.length?e=>ah(e,n):void 0})(C,F),[C,F]),{instrumentation:z,pendingCount:B,pendingModify:X,closeModify:U,openBulkModify:V,resetSelection:H,confirmModify:j}=function({source:e,languages:t,rows:n}){const{instrumentationRulesApi:o,capabilities:i}=jl(),{items:l}=o.useRules(),[r,s]=a(new Set),[p,u]=a(new Set),[h,m]=a(null),g=c(()=>(e=>{const t=new Set(e??[]);return Wu.filter(e=>t.has(e))})(t),[t]),f=i.canCreateInstrumentationRule,b=`${e.id.namespace}\0${e.id.kind}\0${e.id.name}`,v=c(()=>((e,t)=>{const n=e.filter(e=>e.type===je.CustomInstrumentation&&e.ruleName===Ku&&qu(e.sourceScopes,t));return n.find(e=>e.sourceScopes?.sources?.some(e=>Ju(e,t.id)))??n[0]??null})(l,e),[l,b]),y=f&&g.length>0,C=c(()=>{const t=new Map;for(const o of n){const n=!!Yu(o.name,g),i=eh(o.name,e,g,l),a=!!v&&i.some(e=>e.rule.ruleId===v.ruleId),r=i.filter(e=>e.rule.ruleId!==v?.ruleId),s=!a&&r.length>0,c=y&&n,d=s;let p;if(s){const e=[...new Set(r.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===i.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(o.name,{parsable:n,inManagedRule:a,otherRules:r,showCheckbox:c,checkboxDisabled:d,checkboxTooltip:p,addEnabled:u,addTooltip:h})}return t},[n,l,b,g,f,y,v]),S=c(()=>{const e=new Set;return C.forEach((t,n)=>{t.inManagedRule&&e.add(n)}),e},[C]),x=c(()=>[...r].filter(e=>C.get(e)?.addEnabled&&!S.has(e)),[r,C,S]),w=c(()=>[...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)||r.has(e)},[C,p,r]),I=d((e,t)=>{const n=C.get(e);n&&!n.checkboxDisabled&&(n.inManagedRule?u(n=>{const o=new Set(n);return t?o.delete(e):o.add(e),o}):s(n=>{const o=new Set(n);return t?o.add(e):o.delete(e),o}))},[C]),N=d(()=>{s(new Set),u(new Set)},[]),E=d(t=>{(async()=>{const n=t.add.map(e=>Yu(e,g)).filter(e=>!!e),i=t.remove.map(e=>Yu(e,g)).filter(e=>!!e);if(v){const{customInstrumentations:e,isEmpty:t}=((e,t,n)=>{const o=e.customInstrumentations??{};let i=[...o[Ve.Golang]??[]],a=[...o[Ve.Java]??[]];for(const e of n)e.golang&&(i=i.filter(t=>!Zu(t,e.golang))),e.java&&(a=a.filter(t=>!Qu(t,e.java)));for(const e of t)e.golang&&!i.some(t=>Zu(t,e.golang))&&i.push(e.golang),e.java&&!a.some(t=>Qu(t,e.java))&&a.push(e.java);return{customInstrumentations:{[Ve.Golang]:i,[Ve.Java]:a},isEmpty:0===i.length&&0===a.length}})(v,n,i);t?await o.remove(v.ruleId,je.CustomInstrumentation):await o.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),je.CustomInstrumentation)}else n.length>0&&await o.create(((e,t)=>{const n=e.map(e=>e.golang).filter(e=>!!e),o=e.map(e=>e.java).filter(e=>!!e),i={sources:[{namespace:t.id.namespace,name:t.id.name,kind:t.id.kind}],namespaces:[],languages:[]};return{ruleName:Ku,notes:"Symbols selected from the profiling tab.",disabled:!1,sourceScopes:i,workloads:null,instrumentationLibraries:null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:{[Ve.Golang]:n,[Ve.Java]:o}}})(n,e),je.CustomInstrumentation)})()},[v,g,e,o]),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]),_=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:c(()=>({getSymbolState:_,onAdd:$,onRemove:A,selectionEnabled:y,isSelected:k,onToggleSymbol:I}),[_,$,A,y,k,I]),pendingCount:T,pendingModify:h,closeModify:R,openBulkModify:O,resetSelection:N,confirmModify:D}}({source:n,languages:F,rows:A}),[G,W]=a(null),[K,Y]=a(0),[J,q]=a(null),Z=d(e=>{W(e),Y(e=>e+1),f(e=>e===rh.Flame?rh.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})},[]),te=d(()=>W(null),[]);return!O&&N?t(mt,{$height:"70vh",children:t(yt,{withSpinner:!0})}):e(sh,{$gap:0,$width:"100%",children:[e(ch,{children:[t(Fe,{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(dh,{children:t(_e,{size:Te.S,weight:500,color:Pe.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(pe,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(gn,{value:b,onChange:y,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:r.v2.colors.silver[900],emphasizeBackgroundColor:r.v2.colors.silver[800]})}),t(ce,{variant:Pn.Filled,options:[{value:rh.Table,label:"Top table"},{value:rh.Flame,label:"Flame graph"},{value:rh.Both,label:"Both"}],selected:g,setSelected:f}),t(fe,h?{variant:ve.Secondary,size:be.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(Tl,{...e,size:8,fill:r.v2.colors.green[500]})}:{variant:ve.Secondary,size:be.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(Tl,{...e,size:8,fill:r.v2.colors.red[500]})})]})]}),t(ph,{$gap:R&&D?16:0,children:$?e(l,{children:[R&&e(uh,{$splitWithFlame:_,children:[e(mh,{$justifyContent:"space-between",children:[e(ee,{$margin:"0 0 0 20px",children:[t(_e,{size:Te.XXXS,nowrap:!0,children:"Please select symbols to"}),e(pe,{$gap:8,children:[e(pe,{children:[t(kl,{size:24}),t(_e,{size:Te.S,color:Pe.Success,nowrap:!0,children:"Custom Instrument"})]}),t(fe,{leftIcon:Ma,variant:ve.Secondary,size:be.S,onClick:()=>window.open(`${Oe}/enterprise/pipeline/rules/custominstrumentation`,"_blank","noopener noreferrer")})]})]}),e(pe,{$gap:8,children:[J&&t(Fe,{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(Ke,{label:`Zoomed: ${J.length} symbols`,backgroundColor:r.v2.colors.silver[750],textColor:r.v2.colors.silver[200],textSize:Te.XXS})}),t(fe,{variant:ve.Secondary,size:be.S,label:"Download snapshot",rightIcon:Il,onClick:()=>{if(!O)return;const e=new Blob([O],{type:"application/json"}),t=URL.createObjectURL(e),o=document.createElement("a");o.href=t,o.download=`cpu-profile-${n.id.namespace}-${n.id.kind}-${n.id.name}.json`,o.click(),URL.revokeObjectURL(t)},disabled:!O})]})]}),t(lh,{rows:A,languages:F,instrumentation:z,searchQuery:b,filters:C,onFiltersChange:S,zoomedSymbols:J,highlightSymbol:G,scrollSignal:K})]}),D&&e(hh,{$splitWithTable:_,children:[e(mh,{$justifyContent:"space-between",children:[t(Ke,{label:$?`Total in view ${Au($.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:r.v2.colors.silver[750],textColor:r.v2.colors.silver[200],textSize:Te.XXS}),e(pe,{$gap:12,children:[!h&&t(fe,{variant:ve.Secondary,size:be.S,label:"Refresh",leftIcon:sl,onClick:E}),t(le,{label:"Auto refresh",labelAlign:re.Left,size:Nt.S,value:h,onChange:m})]})]}),t(Gu,{flamebearer:$.flamebearer,maxRowPx:24,searchQuery:b,shouldKeepName:M,minHostHeight:280,onFullscreenChange:o,profilingSlots:k??null,onFrameClick:Z,onZoomedSymbolsChange:Q,onResetZoom:te})]})]}):t(mt,{children:t(xe,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})}),t(Ou,{pendingModify:X,onClose:U,onConfirm:j}),t(Mn,{isOpen:B>0,richTitle:{icon:qa,title:"Profiling Symbols",badge:{label:B}},actions:[{id:"profiling-bulk-cancel",type:mn.Button,buttonProps:{variant:ve.Secondary,size:be.S,label:"Cancel",onClick:H}},{id:"profiling-bulk-apply",type:mn.Button,buttonProps:{variant:ve.Primary,size:be.S,label:"Modify Rule",leftIcon:Ba,onClick:V}}]})]})},fh=b.div`
735
735
  position: relative;
736
736
  display: flex;
737
737
  align-items: center;
@@ -739,23 +739,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
739
739
  padding: 8px 16px;
740
740
  border-radius: 12px;
741
741
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
742
- `,mh=b.div`
742
+ `,bh=b.div`
743
743
  display: flex;
744
744
  flex-direction: column;
745
745
  gap: 4px;
746
746
  flex: 1;
747
747
  min-width: 0;
748
748
  opacity: ${({$disabled:e})=>e?.4:1};
749
- `,gh=b.div`
749
+ `,vh=b.div`
750
750
  flex-shrink: 0;
751
751
  display: flex;
752
752
  align-items: center;
753
753
  margin-right: ${({$reserveJumpSpace:e})=>e?"32px":"0"};
754
- `,fh=b.div`
754
+ `,yh=b.div`
755
755
  min-width: 0;
756
756
  white-space: pre;
757
757
  overflow-x: auto;
758
- `,bh=b.div`
758
+ `,Ch=b.div`
759
759
  position: absolute;
760
760
  top: 50%;
761
761
  right: 8px;
@@ -764,24 +764,24 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
764
764
  pointer-events: none;
765
765
  transition: opacity 0.15s ease;
766
766
 
767
- ${hh}:hover & {
767
+ ${fh}:hover & {
768
768
  opacity: 1;
769
769
  pointer-events: auto;
770
770
  }
771
- `,vh=({name:n,summary:o,disabled:i=!1,onJumpToRule:a})=>{const l=v();return e(hh,{children:[e(mh,{$disabled:i,children:[n&&t(_e,{size:Te.XXXS,color:Pe.Secondary,nowrap:!0,children:n}),t(fh,{children:t(w,{parts:o})})]}),i&&t(gh,{$reserveJumpSpace:!!a,children:t(Ke,{label:Mn,textSize:Te.XXXS,backgroundColor:l.v2.colors.grey[700],textColor:l.v2.colors.grey[300]})}),a&&t(bh,{children:t(Fe,{text:Ze.OPEN_IN_SAMPLING_PAGE,children:t(fe,{"data-id":"sampling-rule-jump",variant:ve.Primary,size:be.S,leftIcon:Cl,onClick:a})})})]})},yh=b.div`
771
+ `,Sh=({name:n,summary:o,disabled:i=!1,onJumpToRule:a})=>{const l=v();return e(fh,{children:[e(bh,{$disabled:i,children:[n&&t(_e,{size:Te.XXXS,color:Pe.Secondary,nowrap:!0,children:n}),t(yh,{children:t(w,{parts:o})})]}),i&&t(vh,{$reserveJumpSpace:!!a,children:t(Ke,{label:zn,textSize:Te.XXXS,backgroundColor:l.v2.colors.grey[700],textColor:l.v2.colors.grey[300]})}),a&&t(Ch,{children:t(Fe,{text:Ze.OPEN_IN_SAMPLING_PAGE,children:t(fe,{"data-id":"sampling-rule-jump",variant:ve.Primary,size:be.S,leftIcon:xl,onClick:a})})})]})},xh=b.div`
772
772
  opacity: 0;
773
773
  pointer-events: none;
774
774
  transition: opacity 0.15s ease;
775
- `,Ch=b.div`
776
- &:hover ${yh} {
775
+ `,wh=b.div`
776
+ &:hover ${xh} {
777
777
  opacity: 1;
778
778
  pointer-events: auto;
779
779
  }
780
- `,Sh=b.div`
780
+ `,Th=b.div`
781
781
  display: flex;
782
782
  align-items: center;
783
783
  padding: 4px 12px;
784
- `,xh=({source:e,onRedirectToSampling:n})=>t(Vt,{bgTint:"1000",richTitle:{title:Ze.CONTAINERS,badge:{label:e.containers?.length??0}},children:e.containers?.map(e=>t(kh,{container:e,onRedirectToSampling:n},e.containerName))});var wh;(e=>{e.All="all",e.Noisy="noisy",e.HighlyRelevant="highly-relevant",e.CostReduction="cost-reduction"})(wh||(wh={}));const Th=e=>"noisy"===e.type?T(e.rule,"source"):"highlyRelevant"===e.type?k(e.rule,"source"):"costReduction"===e.type?I(e.rule,"source"):[],kh=({container:n,onRedirectToSampling:o})=>{const[i,l]=a(wh.All),r=fn(e=>e.setPendingViewSamplingRule),s=n.agentConfig?.traces?.headSampling?.noisyOperations??[],d=c(()=>(n.collectorConfig?.tailSampling?.noisyOperations??[]).map(e=>({type:"noisy",rule:e})),[n.agentConfig?.traces?.headSampling?.noisyOperations]),p=c(()=>(n.collectorConfig?.tailSampling?.highlyRelevantOperations??[]).map(e=>({type:"highlyRelevant",rule:e})),[n.collectorConfig?.tailSampling?.highlyRelevantOperations]),u=c(()=>(n.collectorConfig?.tailSampling?.costReductionRules??[]).map(e=>({type:"costReduction",rule:e})),[n.collectorConfig?.tailSampling?.costReductionRules]),h=c(()=>i===wh.Noisy?d:i===wh.HighlyRelevant?p:i===wh.CostReduction?u:[...d,...p,...u],[i,p,u]),m=d.length+p.length+u.length,g=c(()=>(e,t)=>{r({ruleId:e,category:t}),o()},[o,r]),f=t(yh,{children:t(fe,{"data-id":"sampling-container-create-rule",variant:ve.Secondary,size:be.S,label:zn,rightIcon:Ra,onClick:e=>{e.stopPropagation(),o()}})});return t(Ch,{children:e(Vt,{bgTint:"900",richTitle:{title:n.containerName},renderOnRightSide:f,withCollapse:!0,collapseIsDefaultOpen:!0,children:[s.length?e(Vt,{bgTint:"800",richTitle:{title:Ze.HEAD_SAMPLING,badge:{label:s.length}},children:[t(_e,{size:Te.XXS,children:Ze.NOISY_OPERATIONS}),t(ee,{$gap:4,children:s.map(e=>t(vh,{name:e.name,summary:T(e),disabled:e.disabled,onJumpToRule:()=>g(e.ruleId,"noisy")},e.ruleId))})]}):t(Sh,{children:t(_e,{size:Te.XS,color:Pe.Secondary,children:Ze.HEAD_SAMPLING})}),m?e(Vt,{bgTint:"800",richTitle:{title:Ze.TAIL_SAMPLING,badge:{label:m}},children:[t(ce,{options:(b=d.length,v=p.length,y=u.length,[{value:wh.All,label:"All",badge:{label:b+v+y,textSize:Te.XXXS}},{value:wh.Noisy,label:Ze.NOISY_OPERATIONS,badge:{label:b,textSize:Te.XXXS}},{value:wh.HighlyRelevant,label:Ze.HIGHLY_RELEVANT_OPERATIONS,badge:{label:v,textSize:Te.XXXS}},{value:wh.CostReduction,label:Ze.COST_REDUCTION_OPERATIONS,badge:{label:y,textSize:Te.XXXS}}]),selected:i,setSelected:l}),t(ee,{$gap:4,children:h.length?h.map(e=>t(vh,{name:e.rule.name,summary:Th(e),disabled:e.rule.disabled,onJumpToRule:()=>g(e.rule.ruleId,e.type)},e.rule.ruleId)):t(xe,{title:`No ${i===wh.All?`${wh.Noisy}, ${wh.HighlyRelevant} and ${wh.CostReduction}`:i} operations`})})]}):t(Sh,{children:t(_e,{size:Te.XS,color:Pe.Secondary,children:Ze.TAIL_SAMPLING})})]})});var b,v,y},Ih=[xn.Deployment,xn.StatefulSet,xn.DaemonSet,xn.DeploymentConfig,xn.Rollout,xn.Pod];var Nh;(e=>{e.Workload="Workload",e.Pod="Pod"})(Nh||(Nh={}));const Eh=e=>!!e&&rn(e.status)===Ee.Error,Oh=e=>Eh(e.healthStatus),$h=e=>Eh(e.odigosHealthStatus)||(e.processes??[]).some(Oh),Ah=e=>Eh(e.agentInjectedStatus)||Eh(e.odigosHealthStatus)||(e.containers??[]).some($h),Rh=({onClose:n,sourceId:o,onRedirectToSampling:l})=>{const r=v(),{isVm:s,isConnector:u,isK8s:h}=S(),{sourcesApi:m,configApi:g}=Vl(),{selectedStreamName:f}=Qe(),{genericForm:b,loadSource:y,validateFormData:C}=Wl(),{data:x}=g.useEffectiveConfig(),[w,T]=a(!1),[k,I]=a(!1),[N,E]=a(!1),[O,$]=a(sp.Overview),[A,R]=a(null),[D,_]=a({openFor:null}),P=(()=>{const[e,t]=a(null),n=d(e=>{t({tab:sp.Pods,podName:e.podName})},[]),o=d((e,n)=>{t({tab:sp.Pods,podName:e.podName,containerName:n.containerName})},[]),i=d((e,n,o)=>{const i=mp({identifyingAttributes:o.identifyingAttributes});t({tab:sp.Pods,podName:e.podName,containerName:n.containerName,processPid:i})},[]),l=d(()=>t(null),[]);return c(()=>({jumpToTarget:e,jumpToPod:n,jumpToContainer:o,jumpToProcess:i,clearJumpToTarget:l}),[e,n,o,i,l])})();i(()=>{P.jumpToTarget&&$(P.jumpToTarget.tab)},[P.jumpToTarget]),i(()=>{A&&JSON.stringify(bn(o))!==JSON.stringify(bn(A))&&R(null)},[o,A]);const L=p(!1),F=d(async()=>R(await m.fetchById(o)||null),[o,m]);i(()=>{if(L.current||(F(),L.current=!0),!w){const e=setInterval(()=>F(),3e3);return()=>clearInterval(e)}},[F,w]),i(()=>{A&&y(A)},[A]);const M=A&&Ih.includes(A.id.kind),z=c(()=>{const e=[],n=(A?.pods??[]).some(Ah),o=(i=A,(i?.containers??[]).some(e=>(e.instrumentations??[]).some(e=>!1===e.healthy)));var i;const a=e=>t(pl,{...e,fill:r.v2.colors.red[500]});return e.push({value:sp.Overview,label:Ze.OVERVIEW}),h?(e.push({value:sp.Pods,label:Ze.PODS,icon:n?a:void 0}),e.push({value:sp.Libraries,label:Ze.LIBRARIES,icon:o?a:void 0}),e.push({value:sp.PeerSources,label:Ze.PEER_SOURCES}),x?.profiling?.enabled&&e.push({value:sp.Profiling,label:Ze.PROFILING}),e.push({value:sp.Sampling,label:Ze.SAMPLING}),e.push({value:sp.Debug,label:Ze.DEBUG}),e):e},[h,x,A?.pods,r]),B=d(()=>T(!0),[]),X=c(()=>()=>{n(),l()},[n,l]),U=d(()=>{A&&y(A),T(!1)},[A]),V=d(async()=>{if(!A||!b)return;const{errorMessage:e,preparedFormData:t}=C();if(e)return;const n=t.otelServiceName!==A.id.name?t.otelServiceName:"";await m.update(o,{...t,otelServiceName:n}),T(!1)},[A,b,C,o,m]),H=d(()=>I(!0),[]),j=d(async()=>{A&&(await m.persistV2({[At]:[{namespace:A.id.namespace,name:A.id.name,kind:A.id.kind,region:A.id.region??"",selected:!1,currentStreamName:f}]}),I(!1),n())},[A,m,f,n]),G=d(()=>{_({openFor:Nh.Workload})},[]),W=d(e=>{$(e),P.clearJumpToTarget()},[P]),K=d(async()=>{await m.recoverFromRollback(o)},[m,o]),Y=d(()=>_({openFor:null}),[]),J=d(async()=>{D.openFor===Nh.Workload?await m.restartWorkloads([o]):D.openFor===Nh.Pod&&D.podNamespace&&D.podName&&await m.restartPod(D.podNamespace,D.podName),Y()},[D,m,o,Y]),q=c(()=>{const{kind:e,name:t}=o;return{title:`Rollout ${e}`,description:`Are you sure you want to rollout the ${e.toLowerCase()} "${t}"?`}},[o]),Z=c(()=>{const e=[];return w||O===sp.Overview&&(e.push({id:"edit-source-btn-edit",label:Lt.EDIT,icon:Ma,active:w,onClick:B}),h&&M&&e.push({id:"edit-source-btn-restart",label:Ze.ROLLOUT_RESTART,icon:bl,onClick:G}),e.push({id:"edit-source-btn-delete",label:Lt.UNINSTRUMENT,icon:Aa,color:r.v2.colors.red[500],active:k,onClick:H})),e},[O,w,k,h,M,B,G,H,r]),Q=c(()=>{if(!A)return[];const e=[],t={backgroundColor:"transparent",textSize:Te.S};return e.push({...t,label:A.id.name,leftIcon:h?dl:void 0}),A.serviceName&&A.serviceName!==A.id.name&&e.push({...t,label:A.serviceName,leftIcon:cl,textColor:r.v2.colors.silver[200]}),e},[A,r,h]);if(!A)return t(Mt,{isOpen:!0,children:t(mt,{$height:"80vh",children:t(yt,{withSpinner:!0})})});const te=O===sp.Profiling?N?"95vw":"fit-content":w?void 0:"60vw",ne=s?kl:u?tl:Bn(A.containers)[0];return e(wp,{value:P,children:[t(Mt,{isOpen:!0,width:te,minWidth:"min(1100px, 100vw)",header:{icon:ne,titleBadges:Q,onClose:()=>{W(sp.Overview),R(null),E(!1),n()},actions:Z},footer:{actions:w?[{"data-id":"edit-source-btn-cancel",label:Lt.CANCEL,variant:ve.Secondary,onClick:U},{"data-id":"edit-source-btn-save",label:Lt.SAVE,variant:ve.Primary,onClick:V}]:[]},children:t(ut,{$padding:"4px 12px 12px",children:e(ee,{$gap:16,children:[!w&&z.length>1&&t(ce,{options:z,selected:O,setSelected:W}),(()=>{switch(O){case sp.Overview:return w?t(Es,{}):t(xu,{source:A,onClickRollout:G,onClickRollback:K});case sp.Pods:return t(Ep,{source:A,onClickRestartPod:M?(e,t)=>_({openFor:Nh.Pod,podNamespace:e,podName:t}):void 0});case sp.Libraries:return t(wu,{source:A});case sp.PeerSources:return t($p,{source:A});case sp.Profiling:return t(uh,{source:A,onFlameFullscreenChange:E});case sp.Sampling:return t(xh,{source:A,onRedirectToSampling:X});case sp.Debug:return t(Pp,{source:A});default:return null}})()]})})}),t(Er,{target:"source",action:"uninstrument",isOpen:k,onClose:()=>I(!1),onApprove:j}),t(qe,{isOpen:D.openFor===Nh.Workload,title:q.title,description:q.description,onClose:Y,denyButton:{label:"Go back",variant:ve.Secondary,onClick:Y},approveButton:{label:Lt.CONFIRM,variant:ve.Primary,onClick:J}}),t(Er,{target:"pod",action:"restart",description:Ze.ROLLOUT_RESTART_WORKLOADS_DESCRIPTION,isOpen:D.openFor===Nh.Pod,onClose:Y,onApprove:J,overrideApproveButtonLabel:Ze.DELETE_POD_TO_RESTART})]})},Dh=b.div`
784
+ `,kh=({source:e,onRedirectToSampling:n})=>t(Gt,{bgTint:"1000",richTitle:{title:Ze.CONTAINERS,badge:{label:e.containers?.length??0}},children:e.containers?.map(e=>t(Eh,{container:e,onRedirectToSampling:n},e.containerName))});var Ih;(e=>{e.All="all",e.Noisy="noisy",e.HighlyRelevant="highly-relevant",e.CostReduction="cost-reduction"})(Ih||(Ih={}));const Nh=e=>"noisy"===e.type?T(e.rule,"source"):"highlyRelevant"===e.type?k(e.rule,"source"):"costReduction"===e.type?I(e.rule,"source"):[],Eh=({container:n,onRedirectToSampling:o})=>{const[i,l]=a(Ih.All),r=bn(e=>e.setPendingViewSamplingRule),s=n.agentConfig?.traces?.headSampling?.noisyOperations??[],d=c(()=>(n.collectorConfig?.tailSampling?.noisyOperations??[]).map(e=>({type:"noisy",rule:e})),[n.agentConfig?.traces?.headSampling?.noisyOperations]),p=c(()=>(n.collectorConfig?.tailSampling?.highlyRelevantOperations??[]).map(e=>({type:"highlyRelevant",rule:e})),[n.collectorConfig?.tailSampling?.highlyRelevantOperations]),u=c(()=>(n.collectorConfig?.tailSampling?.costReductionRules??[]).map(e=>({type:"costReduction",rule:e})),[n.collectorConfig?.tailSampling?.costReductionRules]),h=c(()=>i===Ih.Noisy?d:i===Ih.HighlyRelevant?p:i===Ih.CostReduction?u:[...d,...p,...u],[i,p,u]),m=d.length+p.length+u.length,g=c(()=>(e,t)=>{r({ruleId:e,category:t}),o()},[o,r]),f=t(xh,{children:t(fe,{"data-id":"sampling-container-create-rule",variant:ve.Secondary,size:be.S,label:Bn,rightIcon:_a,onClick:e=>{e.stopPropagation(),o()}})});return t(wh,{children:e(Gt,{bgTint:"900",richTitle:{title:n.containerName},renderOnRightSide:f,withCollapse:!0,collapseIsDefaultOpen:!0,children:[s.length?e(Gt,{bgTint:"800",richTitle:{title:Ze.HEAD_SAMPLING,badge:{label:s.length}},children:[t(_e,{size:Te.XXS,children:Ze.NOISY_OPERATIONS}),t(ee,{$gap:4,children:s.map(e=>t(Sh,{name:e.name,summary:T(e),disabled:e.disabled,onJumpToRule:()=>g(e.ruleId,"noisy")},e.ruleId))})]}):t(Th,{children:t(_e,{size:Te.XS,color:Pe.Secondary,children:Ze.HEAD_SAMPLING})}),m?e(Gt,{bgTint:"800",richTitle:{title:Ze.TAIL_SAMPLING,badge:{label:m}},children:[t(ce,{options:(b=d.length,v=p.length,y=u.length,[{value:Ih.All,label:"All",badge:{label:b+v+y,textSize:Te.XXXS}},{value:Ih.Noisy,label:Ze.NOISY_OPERATIONS,badge:{label:b,textSize:Te.XXXS}},{value:Ih.HighlyRelevant,label:Ze.HIGHLY_RELEVANT_OPERATIONS,badge:{label:v,textSize:Te.XXXS}},{value:Ih.CostReduction,label:Ze.COST_REDUCTION_OPERATIONS,badge:{label:y,textSize:Te.XXXS}}]),selected:i,setSelected:l}),t(ee,{$gap:4,children:h.length?h.map(e=>t(Sh,{name:e.rule.name,summary:Nh(e),disabled:e.rule.disabled,onJumpToRule:()=>g(e.rule.ruleId,e.type)},e.rule.ruleId)):t(xe,{title:`No ${i===Ih.All?`${Ih.Noisy}, ${Ih.HighlyRelevant} and ${Ih.CostReduction}`:i} operations`})})]}):t(Th,{children:t(_e,{size:Te.XS,color:Pe.Secondary,children:Ze.TAIL_SAMPLING})})]})});var b,v,y},Oh=[wn.Deployment,wn.StatefulSet,wn.DaemonSet,wn.DeploymentConfig,wn.Rollout,wn.Pod];var $h;(e=>{e.Workload="Workload",e.Pod="Pod"})($h||($h={}));const Ah=e=>!!e&&sn(e.status)===Ee.Error,Rh=e=>Ah(e.healthStatus),Dh=e=>Ah(e.odigosHealthStatus)||(e.processes??[]).some(Rh),_h=e=>Ah(e.agentInjectedStatus)||Ah(e.odigosHealthStatus)||(e.containers??[]).some(Dh),Ph=({onClose:n,sourceId:o,onRedirectToSampling:l})=>{const r=v(),{isVm:s,isConnector:u,isK8s:h}=S(),{sourcesApi:m,configApi:g}=jl(),{selectedStreamName:f}=Qe(),{genericForm:b,loadSource:y,validateFormData:C}=Yl(),{data:x}=g.useEffectiveConfig(),[w,T]=a(!1),[k,I]=a(!1),[N,E]=a(!1),[O,$]=a(pp.Overview),[A,R]=a(null),[D,_]=a({openFor:null}),P=(()=>{const[e,t]=a(null),n=d(e=>{t({tab:pp.Pods,podName:e.podName})},[]),o=d((e,n)=>{t({tab:pp.Pods,podName:e.podName,containerName:n.containerName})},[]),i=d((e,n,o)=>{const i=bp({identifyingAttributes:o.identifyingAttributes});t({tab:pp.Pods,podName:e.podName,containerName:n.containerName,processPid:i})},[]),l=d(()=>t(null),[]);return c(()=>({jumpToTarget:e,jumpToPod:n,jumpToContainer:o,jumpToProcess:i,clearJumpToTarget:l}),[e,n,o,i,l])})();i(()=>{P.jumpToTarget&&$(P.jumpToTarget.tab)},[P.jumpToTarget]),i(()=>{A&&JSON.stringify(vn(o))!==JSON.stringify(vn(A))&&R(null)},[o,A]);const L=p(!1),F=d(async()=>R(await m.fetchById(o)||null),[o,m]);i(()=>{if(L.current||(F(),L.current=!0),!w){const e=setInterval(()=>F(),3e3);return()=>clearInterval(e)}},[F,w]),i(()=>{A&&y(A)},[A]);const M=A&&Oh.includes(A.id.kind),z=c(()=>{const e=[],n=(A?.pods??[]).some(_h),o=(i=A,(i?.containers??[]).some(e=>(e.instrumentations??[]).some(e=>!1===e.healthy)));var i;const a=e=>t(hl,{...e,fill:r.v2.colors.red[500]});return e.push({value:pp.Overview,label:Ze.OVERVIEW}),h?(e.push({value:pp.Pods,label:Ze.PODS,icon:n?a:void 0}),e.push({value:pp.Libraries,label:Ze.LIBRARIES,icon:o?a:void 0}),e.push({value:pp.PeerSources,label:Ze.PEER_SOURCES}),x?.profiling?.enabled&&e.push({value:pp.Profiling,label:Ze.PROFILING}),e.push({value:pp.Sampling,label:Ze.SAMPLING}),e.push({value:pp.Debug,label:Ze.DEBUG}),e):e},[h,x,A?.pods,r]),B=d(()=>T(!0),[]),X=c(()=>()=>{n(),l()},[n,l]),U=d(()=>{A&&y(A),T(!1)},[A]),V=d(async()=>{if(!A||!b)return;const{errorMessage:e,preparedFormData:t}=C();if(e)return;const n=t.otelServiceName!==A.id.name?t.otelServiceName:"";await m.update(o,{...t,otelServiceName:n}),T(!1)},[A,b,C,o,m]),H=d(()=>I(!0),[]),j=d(async()=>{A&&(await m.persistV2({[At]:[{namespace:A.id.namespace,name:A.id.name,kind:A.id.kind,region:A.id.region??"",selected:!1,currentStreamName:f}]}),I(!1),n())},[A,m,f,n]),G=d(()=>{_({openFor:$h.Workload})},[]),W=d(e=>{$(e),P.clearJumpToTarget()},[P]),K=d(async()=>{await m.recoverFromRollback(o)},[m,o]),Y=d(()=>_({openFor:null}),[]),J=d(async()=>{D.openFor===$h.Workload?await m.restartWorkloads([o]):D.openFor===$h.Pod&&D.podNamespace&&D.podName&&await m.restartPod(D.podNamespace,D.podName),Y()},[D,m,o,Y]),q=c(()=>{const{kind:e,name:t}=o;return{title:`Rollout ${e}`,description:`Are you sure you want to rollout the ${e.toLowerCase()} "${t}"?`}},[o]),Z=c(()=>{const e=[];return w||O===pp.Overview&&(e.push({id:"edit-source-btn-edit",label:Lt.EDIT,icon:Ba,active:w,onClick:B}),h&&M&&e.push({id:"edit-source-btn-restart",label:Ze.ROLLOUT_RESTART,icon:yl,onClick:G}),e.push({id:"edit-source-btn-delete",label:Lt.UNINSTRUMENT,icon:Da,color:r.v2.colors.red[500],active:k,onClick:H})),e},[O,w,k,h,M,B,G,H,r]),Q=c(()=>{if(!A)return[];const e=[],t={backgroundColor:"transparent",textSize:Te.S};return e.push({...t,label:A.id.name,leftIcon:h?ul:void 0}),A.serviceName&&A.serviceName!==A.id.name&&e.push({...t,label:A.serviceName,leftIcon:pl,textColor:r.v2.colors.silver[200]}),e},[A,r,h]);if(!A)return t(Mt,{isOpen:!0,children:t(mt,{$height:"80vh",children:t(yt,{withSpinner:!0})})});const te=O===pp.Profiling?N?"95vw":"fit-content":w?void 0:"60vw",ne=s?Nl:u?ol:Xn(A.containers)[0];return e(Ip,{value:P,children:[t(Mt,{isOpen:!0,width:te,minWidth:"min(1100px, 100vw)",header:{icon:ne,titleBadges:Q,onClose:()=>{W(pp.Overview),R(null),E(!1),n()},actions:Z},footer:{actions:w?[{"data-id":"edit-source-btn-cancel",label:Lt.CANCEL,variant:ve.Secondary,onClick:U},{"data-id":"edit-source-btn-save",label:Lt.SAVE,variant:ve.Primary,onClick:V}]:[]},children:t(ut,{$padding:"4px 12px 12px",children:e(ee,{$gap:16,children:[!w&&z.length>1&&t(ce,{options:z,selected:O,setSelected:W}),(()=>{switch(O){case pp.Overview:return w?t($s,{}):t(ku,{source:A,onClickRollout:G,onClickRollback:K});case pp.Pods:return t(Ap,{source:A,onClickRestartPod:M?(e,t)=>_({openFor:$h.Pod,podNamespace:e,podName:t}):void 0});case pp.Libraries:return t(Iu,{source:A});case pp.PeerSources:return t(Dp,{source:A});case pp.Profiling:return t(gh,{source:A,onFlameFullscreenChange:E});case pp.Sampling:return t(kh,{source:A,onRedirectToSampling:X});case pp.Debug:return t(Mp,{source:A});default:return null}})()]})})}),t($r,{target:"source",action:"uninstrument",isOpen:k,onClose:()=>I(!1),onApprove:j}),t(qe,{isOpen:D.openFor===$h.Workload,title:q.title,description:q.description,onClose:Y,denyButton:{label:"Go back",variant:ve.Secondary,onClick:Y},approveButton:{label:Lt.CONFIRM,variant:ve.Primary,onClick:J}}),t($r,{target:"pod",action:"restart",description:Ze.ROLLOUT_RESTART_WORKLOADS_DESCRIPTION,isOpen:D.openFor===$h.Pod,onClose:Y,onApprove:J,overrideApproveButtonLabel:Ze.DELETE_POD_TO_RESTART})]})},Lh=b.div`
785
785
  display: flex;
786
786
  align-items: center;
787
787
  gap: 8px;
@@ -791,9 +791,9 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
791
791
  &:hover {
792
792
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
793
793
  }
794
- `,_h=b.div`
794
+ `,Fh=b.div`
795
795
  flex: 1;
796
- `,Ph=({onClick:n})=>{const o=v().v2.colors.red[500];return e(Dh,{"data-id":"sampling-view-btn-delete",onClick:n,children:[t(_e,{size:Te.XS,weight:500,color:o,children:Hn}),t(Aa,{size:16,fill:o})]})};const Lh={[Yl.EditAutoNoisy]:{title:io,subTitle:oo,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[Yl.EditAutoCostReduction]:{title:no,subTitle:to,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[Yl.EditAutoHighlyRelevant]:{title:eo,subTitle:Qn,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},Fh=({isOpen:e,title:n,subTitle:o,onClose:i,footer:a,renderBody:l})=>t(Mt,{isOpen:e,width:lo,header:{icon:Il,title:n,subTitle:o,onClose:i},footer:a,children:l?l():t(ut,{$padding:"12px",children:t(_s,{})})}),Mh=({isOpen:o,onClose:l,onSubmit:r,validateForm:s,onNavigateToDuplicate:p})=>{const{category:u,formData:h,resetForm:m,duplicateWarning:g,setDuplicateWarning:f}=Kl(Yl.Create),[b,v]=a(!1);i(()=>{o&&(m(),v(!1))},[o]);const y=d(()=>{v(!1),r(h)},[h,r]),C=d(()=>{if(s){const e=s(h);if(e)return void f(e)}((e,t)=>JSON.stringify(e)===JSON.stringify(N(t)))(h,u)?v(!0):y()},[h,u,s,f,y]),S=c(()=>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:Ee.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:Xn,variant:ve.Secondary,size:be.S,onClick:l},{"data-id":"sampling-create-btn-submit",label:zn,variant:ve.Primary,size:be.S,onClick:C,disabled:!!g}]};return e(n,{children:[t(Fh,{isOpen:o,title:Kn[u],subTitle:jn[u],onClose:l,footer:x}),t(qe,{isOpen:b,title:qn,description:Jn,onClose:()=>v(!1),denyButton:{"data-id":"sampling-create-default-continue-editing",label:Yn,variant:ve.Secondary,onClick:()=>v(!1)},approveButton:{"data-id":"sampling-create-default-confirm",label:zn,variant:ve.Primary,onClick:y},children:e(ee,{$gap:8,$alignItems:"flex-start",style:{width:"100%"},children:[t(_e,{size:Te.XS,weight:500,color:Pe.Secondary,children:Zn}),t("div",{style:{width:"100%"},children:t(fr,{summary:S})})]})})]})},zh=({onClose:o,onDelete:i,onSaveEdit:a,validateForm:l,onNavigateToDuplicate:r})=>{const{data:s,isEditing:p,formData:u,handleEdit:h,handleCancelEdit:m,duplicateWarning:g,setDuplicateWarning:f}=Kl(Yl.View),b=s?.rule.name||Wn,v=p&&s?Gn[s.category]:`${b} preview`,y=d(()=>{if(s&&p){if(l){const e=l(u);if(e)return void f(e)}a(u,s.rule.ruleId,s.samplingId),m()}},[s,p,u,a,l,f,m]),C=d(()=>{s&&i(s.rule.ruleId,s.samplingId)},[s,i]),S=c(()=>{if(!s)return;const i=g?{message:g.message,onViewRule:r?()=>r(g.ruleId):void 0}:null;return function(o){if(o.isEditing){const{onCancelEdit:i,onSave:a,onDelete:l,duplicateWarning:r}=o;return{children:e(n,{children:[t(Ph,{onClick:l}),r&&t(Ne,{status:Ee.Warning,message:r.message,action:r.onViewRule?{"data-id":"sampling-view-edit-btn-view-duplicate",label:"View rule",onClick:r.onViewRule}:void 0}),t(_h,{}),t(fe,{"data-id":"sampling-view-edit-btn-cancel",label:Xn,variant:ve.Secondary,size:be.S,onClick:i}),t(fe,{"data-id":"sampling-view-edit-btn-save",label:Un,variant:ve.Primary,size:be.S,onClick:a,disabled:!!r})]})}}const{onDelete:i,onCancel:a,onEdit:l}=o;return{children:e(n,{children:[t(Ph,{onClick:i}),t(_h,{}),t(fe,{"data-id":"sampling-view-btn-cancel",label:Xn,variant:ve.Secondary,size:be.S,onClick:a}),t(fe,{"data-id":"sampling-view-btn-edit",label:Vn,variant:ve.Primary,size:be.S,onClick:l})]})}}(p?{isEditing:!0,onCancelEdit:m,onSave:y,onDelete:C,duplicateWarning:i}:{isEditing:!1,onDelete:C,onCancel:o,onEdit:h})},[s,p,g,m,y,C,h,o,r]);return t(Fh,{isOpen:!!s,title:v,subTitle:s?jn[s.category]:"",onClose:o,footer:S})},Bh=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:i,resolvedPercentage:a}=Kl(Yl.EditAutoNoisy),l=d(()=>o(i,a),[o,i,a]);return t(Vh,{formType:Yl.EditAutoNoisy,isOpen:e,onClose:n,onSave:l})},Xh=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:i,resolvedPercentage:a}=Kl(Yl.EditAutoCostReduction),l=d(()=>o(i,a),[o,i,a]);return t(Vh,{formType:Yl.EditAutoCostReduction,isOpen:e,onClose:n,onSave:l})},Uh=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:i}=Kl(Yl.EditAutoHighlyRelevant),a=d(()=>o(i),[o,i]);return t(Vh,{formType:Yl.EditAutoHighlyRelevant,isOpen:e,onClose:n,onSave:a})},Vh=({formType:e,isOpen:n,onClose:o,onSave:i})=>{const a=Lh[e];return t(Fh,{isOpen:n,title:a.title,subTitle:a.subTitle,onClose:o,footer:{actions:[{"data-id":a.cancelId,label:Xn,variant:ve.Secondary,size:be.S,onClick:o},{"data-id":a.saveId,label:ao,variant:ve.Primary,size:be.S,onClick:i}]}})},Hh=e=>{switch(e.formType){case Yl.Create:return t(nr,{formType:Yl.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(Mh,{...e})});case Yl.View:return t(nr,{formType:Yl.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(zh,{...e})});case Yl.EditAutoNoisy:return t(nr,{formType:Yl.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(Bh,{...e})});case Yl.EditAutoCostReduction:return t(nr,{formType:Yl.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(Xh,{...e})});case Yl.EditAutoHighlyRelevant:return t(nr,{formType:Yl.EditAutoHighlyRelevant,enabled:e.enabled,children:t(Uh,{...e})})}},jh=({token:o,isLoading:i,isEditing:a,onEdit:l,onCancel:r,onSave:s,formData:c,handleFormChange:d,handleErrorChange:p,formErrors:u})=>{const{CopyButton:h}=_t(),m=!a||i||!c.newToken;return ro({key:"Enter",active:!m},s),e(pe,a?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(ye,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),p("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:u.newToken}),t(pe,{$margin:i?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:i?t(yt,{title:"Saving...",withGradient:!0}):e(n,{children:[t(fe,{variant:ve.Secondary,size:be.S,leftIcon:Ka,onClick:r,disabled:i}),t(fe,{variant:ve.Primary,size:be.S,leftIcon:Wa,onClick:s,disabled:m})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(_e,{size:Te.XS,children:new Array(55).fill("•").join("")}),e(pe,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:o}),t(bt,{icon:Ma,onClick:l})]})]})},Gh=({expiresAt:e,callbackValid:n,callbackExpired:o})=>{const{formatTimeAgo:a}=en(),l=c(()=>a(e),[e,a]),r=c(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),s=c(()=>so(e,0)?Ee.Error:so(e,2592e6)?Ee.Warning:Ee.Success,[e]),d=c(()=>s===Ee.Success?Wa:s===Ee.Warning?Nl:pl,[s]);return i(()=>{s===Ee.Success?n():s===Ee.Error&&o()},[s]),t(Fe,{text:r,children:t(Ke,{leftIcon:d,label:l,status:s,invertColors:!0,useSecondaryTone:!0})})},Wh=b.div`
796
+ `,Mh=({onClick:n})=>{const o=v().v2.colors.red[500];return e(Lh,{"data-id":"sampling-view-btn-delete",onClick:n,children:[t(_e,{size:Te.XS,weight:500,color:o,children:jn}),t(Da,{size:16,fill:o})]})};const zh={[ql.EditAutoNoisy]:{title:ao,subTitle:io,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[ql.EditAutoCostReduction]:{title:oo,subTitle:no,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[ql.EditAutoHighlyRelevant]:{title:to,subTitle:eo,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},Bh=({isOpen:e,title:n,subTitle:o,onClose:i,footer:a,renderBody:l})=>t(Mt,{isOpen:e,width:ro,header:{icon:El,title:n,subTitle:o,onClose:i},footer:a,children:l?l():t(ut,{$padding:"12px",children:t(Ls,{})})}),Xh=({isOpen:o,onClose:l,onSubmit:r,validateForm:s,onNavigateToDuplicate:p})=>{const{category:u,formData:h,resetForm:m,duplicateWarning:g,setDuplicateWarning:f}=Jl(ql.Create),[b,v]=a(!1);i(()=>{o&&(m(),v(!1))},[o]);const y=d(()=>{v(!1),r(h)},[h,r]),C=d(()=>{if(s){const e=s(h);if(e)return void f(e)}((e,t)=>JSON.stringify(e)===JSON.stringify(N(t)))(h,u)?v(!0):y()},[h,u,s,f,y]),S=c(()=>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:Ee.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:Un,variant:ve.Secondary,size:be.S,onClick:l},{"data-id":"sampling-create-btn-submit",label:Bn,variant:ve.Primary,size:be.S,onClick:C,disabled:!!g}]};return e(n,{children:[t(Bh,{isOpen:o,title:Yn[u],subTitle:Gn[u],onClose:l,footer:x}),t(qe,{isOpen:b,title:Zn,description:qn,onClose:()=>v(!1),denyButton:{"data-id":"sampling-create-default-continue-editing",label:Jn,variant:ve.Secondary,onClick:()=>v(!1)},approveButton:{"data-id":"sampling-create-default-confirm",label:Bn,variant:ve.Primary,onClick:y},children:e(ee,{$gap:8,$alignItems:"flex-start",style:{width:"100%"},children:[t(_e,{size:Te.XS,weight:500,color:Pe.Secondary,children:Qn}),t("div",{style:{width:"100%"},children:t(vr,{summary:S})})]})})]})},Uh=({onClose:o,onDelete:i,onSaveEdit:a,validateForm:l,onNavigateToDuplicate:r})=>{const{data:s,isEditing:p,formData:u,handleEdit:h,handleCancelEdit:m,duplicateWarning:g,setDuplicateWarning:f}=Jl(ql.View),b=s?.rule.name||Kn,v=p&&s?Wn[s.category]:`${b} preview`,y=d(()=>{if(s&&p){if(l){const e=l(u);if(e)return void f(e)}a(u,s.rule.ruleId,s.samplingId),m()}},[s,p,u,a,l,f,m]),C=d(()=>{s&&i(s.rule.ruleId,s.samplingId)},[s,i]),S=c(()=>{if(!s)return;const i=g?{message:g.message,onViewRule:r?()=>r(g.ruleId):void 0}:null;return function(o){if(o.isEditing){const{onCancelEdit:i,onSave:a,onDelete:l,duplicateWarning:r}=o;return{children:e(n,{children:[t(Mh,{onClick:l}),r&&t(Ne,{status:Ee.Warning,message:r.message,action:r.onViewRule?{"data-id":"sampling-view-edit-btn-view-duplicate",label:"View rule",onClick:r.onViewRule}:void 0}),t(Fh,{}),t(fe,{"data-id":"sampling-view-edit-btn-cancel",label:Un,variant:ve.Secondary,size:be.S,onClick:i}),t(fe,{"data-id":"sampling-view-edit-btn-save",label:Vn,variant:ve.Primary,size:be.S,onClick:a,disabled:!!r})]})}}const{onDelete:i,onCancel:a,onEdit:l}=o;return{children:e(n,{children:[t(Mh,{onClick:i}),t(Fh,{}),t(fe,{"data-id":"sampling-view-btn-cancel",label:Un,variant:ve.Secondary,size:be.S,onClick:a}),t(fe,{"data-id":"sampling-view-btn-edit",label:Hn,variant:ve.Primary,size:be.S,onClick:l})]})}}(p?{isEditing:!0,onCancelEdit:m,onSave:y,onDelete:C,duplicateWarning:i}:{isEditing:!1,onDelete:C,onCancel:o,onEdit:h})},[s,p,g,m,y,C,h,o,r]);return t(Bh,{isOpen:!!s,title:v,subTitle:s?Gn[s.category]:"",onClose:o,footer:S})},Vh=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:i,resolvedPercentage:a}=Jl(ql.EditAutoNoisy),l=d(()=>o(i,a),[o,i,a]);return t(Gh,{formType:ql.EditAutoNoisy,isOpen:e,onClose:n,onSave:l})},Hh=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:i,resolvedPercentage:a}=Jl(ql.EditAutoCostReduction),l=d(()=>o(i,a),[o,i,a]);return t(Gh,{formType:ql.EditAutoCostReduction,isOpen:e,onClose:n,onSave:l})},jh=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:i}=Jl(ql.EditAutoHighlyRelevant),a=d(()=>o(i),[o,i]);return t(Gh,{formType:ql.EditAutoHighlyRelevant,isOpen:e,onClose:n,onSave:a})},Gh=({formType:e,isOpen:n,onClose:o,onSave:i})=>{const a=zh[e];return t(Bh,{isOpen:n,title:a.title,subTitle:a.subTitle,onClose:o,footer:{actions:[{"data-id":a.cancelId,label:Un,variant:ve.Secondary,size:be.S,onClick:o},{"data-id":a.saveId,label:lo,variant:ve.Primary,size:be.S,onClick:i}]}})},Wh=e=>{switch(e.formType){case ql.Create:return t(ir,{formType:ql.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(Xh,{...e})});case ql.View:return t(ir,{formType:ql.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(Uh,{...e})});case ql.EditAutoNoisy:return t(ir,{formType:ql.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(Vh,{...e})});case ql.EditAutoCostReduction:return t(ir,{formType:ql.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(Hh,{...e})});case ql.EditAutoHighlyRelevant:return t(ir,{formType:ql.EditAutoHighlyRelevant,enabled:e.enabled,children:t(jh,{...e})})}},Kh=({token:o,isLoading:i,isEditing:a,onEdit:l,onCancel:r,onSave:s,formData:c,handleFormChange:d,handleErrorChange:p,formErrors:u})=>{const{CopyButton:h}=_t(),m=!a||i||!c.newToken;return so({key:"Enter",active:!m},s),e(pe,a?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(ye,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),p("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:u.newToken}),t(pe,{$margin:i?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:i?t(yt,{title:"Saving...",withGradient:!0}):e(n,{children:[t(fe,{variant:ve.Secondary,size:be.S,leftIcon:Ja,onClick:r,disabled:i}),t(fe,{variant:ve.Primary,size:be.S,leftIcon:Ya,onClick:s,disabled:m})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(_e,{size:Te.XS,children:new Array(55).fill("•").join("")}),e(pe,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:o}),t(bt,{icon:Ba,onClick:l})]})]})},Yh=({expiresAt:e,callbackValid:n,callbackExpired:o})=>{const{formatTimeAgo:a}=on(),l=c(()=>a(e),[e,a]),r=c(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),s=c(()=>co(e,0)?Ee.Error:co(e,2592e6)?Ee.Warning:Ee.Success,[e]),d=c(()=>s===Ee.Success?Ya:s===Ee.Warning?Ol:hl,[s]);return i(()=>{s===Ee.Success?n():s===Ee.Error&&o()},[s]),t(Fe,{text:r,children:t(Ke,{leftIcon:d,label:l,status:s,invertColors:!0,useSecondaryTone:!0})})},Jh=b.div`
797
797
  display: flex;
798
798
  flex-direction: column;
799
799
  gap: 12px;
@@ -801,7 +801,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
801
801
  border-radius: 12px;
802
802
  border: 1px solid ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[500]:e.v2.colors.silver[600]};
803
803
  background-color: ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[1e3]:e.v2.colors.silver[800]};
804
- `,Kh=({children:e})=>{const n=v();return t(_e,{size:Te.XXXS,color:n.v2.colors.grey[150],children:e})},Yh=({token:n})=>{const{tokensApi:o}=Vl(),[i,l]=a(!1),[r,s]=a(!1),[c,d]=a(!1),{formData:p,handleFormChange:u,formErrors:h,handleErrorChange:m,resetFormData:g}=Gt({newToken:""});return t(st,{richTitle:{icon:El,title:"Odigos Pro Token"},children:e(Wh,{$isExpired:c,children:[e(pe,{$justifyContent:"space-between",children:[e(ee,{$gap:4,children:[t(Kh,{children:"Issued for"}),t(_e,{size:Te.XS,children:n.name||"N/A"})]}),e(ee,{$gap:4,children:[t(Kh,{children:"Expiration"}),t(Gh,{expiresAt:n.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(ee,{})]}),t(pe,{children:e(ee,{children:[t(Kh,{children:"Token"}),t(jh,{token:n.token,newToken:p.newToken,isLoading:i,isEditing:r,onEdit:()=>s(!0),onCancel:()=>(s(!1),void u("newToken","")),onSave:()=>(async()=>{if(!o.updateToken)return;l(!0);const e=await o.updateToken(p.newToken.trim());l(!1),e?.error?m("newToken",e.error):(s(!1),g())})(),formData:p,handleFormChange:u,handleErrorChange:m,formErrors:h})]})})]})})},Jh=b.div`
804
+ `,qh=({children:e})=>{const n=v();return t(_e,{size:Te.XXXS,color:n.v2.colors.grey[150],children:e})},Zh=({token:n})=>{const{tokensApi:o}=jl(),[i,l]=a(!1),[r,s]=a(!1),[c,d]=a(!1),{formData:p,handleFormChange:u,formErrors:h,handleErrorChange:m,resetFormData:g}=Yt({newToken:""});return t(st,{richTitle:{icon:$l,title:"Odigos Pro Token"},children:e(Jh,{$isExpired:c,children:[e(pe,{$justifyContent:"space-between",children:[e(ee,{$gap:4,children:[t(qh,{children:"Issued for"}),t(_e,{size:Te.XS,children:n.name||"N/A"})]}),e(ee,{$gap:4,children:[t(qh,{children:"Expiration"}),t(Yh,{expiresAt:n.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(ee,{})]}),t(pe,{children:e(ee,{children:[t(qh,{children:"Token"}),t(Kh,{token:n.token,newToken:p.newToken,isLoading:i,isEditing:r,onEdit:()=>s(!0),onCancel:()=>(s(!1),void u("newToken","")),onSave:()=>(async()=>{if(!o.updateToken)return;l(!0);const e=await o.updateToken(p.newToken.trim());l(!1),e?.error?m("newToken",e.error):(s(!1),g())})(),formData:p,handleFormChange:u,handleErrorChange:m,formErrors:h})]})})]})})},Qh=b.div`
805
805
  display: flex;
806
806
  flex-direction: column;
807
807
  align-items: center;
@@ -810,23 +810,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
810
810
  padding: 12px 24px;
811
811
  border-radius: 8px;
812
812
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
813
- `,qh=()=>{const{progress:n}=Ot(),{describeApi:o,namespacesApi:i}=Vl(),{items:l}=i.useNamespaces(),[r,s]=a(null),{formData:c,handleFormChange:d,resetFormData:p}=Gt({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(st,{richTitle:{icon:Ol,title:"Diagnose"},children:r?e(Jh,{children:[t(yt,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof n[Rt.DownloadingDiagnose]?.percentage,percentage:n[Rt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof n[Rt.DownloadingDiagnose]?.percentage,visualIcon:Tl,startedAt:r}),n[Rt.DownloadingDiagnose]?.list?.length&&t(ee,{$width:"100%",children:n[Rt.DownloadingDiagnose].list.map((n,o)=>e(pe,{$gap:4,$alignItems:"center",children:[n.status===Ee.Success?t(Wa,{size:16}):n.status===Ee.Error?t(Ka,{size:16}):t(yt,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(_e,{size:Te.XXXS,color:Pe.Secondary,children:n.label})]},`diagnose-item-${o}-${n.label}`))})]}):e(ee,{$gap:24,children:[t(_e,{size:Te.XXS,color:Pe.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(ee,{$gap:16,children:[e(pe,{$gap:8,children:[t(ne,{label:"Profiles",value:c.includeProfiles,onChange:e=>d("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(_e,{size:Te.XXXS,color:Pe.Secondary,children:"Include pprof profiles"})]}),e(pe,{$gap:8,children:[t(ne,{label:"Metrics",value:c.includeMetrics,onChange:e=>d("includeMetrics",e)}),t(_e,{size:Te.XXXS,color:Pe.Secondary,children:"Include Prometheus metrics"})]}),e(pe,{$gap:8,children:[t(ne,{label:"Source Workloads",value:c.includeSourceWorkloads,onChange:e=>{d("includeSourceWorkloads",e),e&&d("sourceWorkloadNamespaces",[])}}),t(_e,{size:Te.XXXS,color:Pe.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(co,{alignX:uo.Left,alignY:po.Bottom,items:l.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:ve.Secondary,disabled:c.includeSourceWorkloads,leftIcon:c.sourceWorkloadNamespaces.length?()=>t(Ke,{label:c.sourceWorkloadNamespaces.length,status:Ee.Default}):void 0}}),t(pe,{$justifyContent:"flex-end",children:t(fe,{label:"Download Diagnose",rightIcon:Tl,variant:ve.Primary,onClick:async()=>{o.downloadDiagnose&&(s(Date.now()),await o.downloadDiagnose(c),s(null),p())},disabled:null!==r})})]})})},Zh=()=>{const{platformType:e,version:n,tier:o}=S(),{describeApi:l}=Vl(),[r,s]=a(null);return i(()=>{l.fetchDescribeOdigos&&l.fetchDescribeOdigos().then(({data:e})=>s(e?.describeOdigos??null))},[]),t(st,{richTitle:{icon:fl,title:"General Information"},children:t(Vt,{cellsPerRow:2,items:[{id:ho(),title:"Odigos Version",label:n},{id:ho(),title:`${e.toUpperCase()} Version`,label:r?.kubernetesVersion?.value||"-"},{id:ho(),title:"Installation Method",label:r?.installationMethod?.value||"-"},{id:ho(),title:"Tier",label:o}]})})},Qh=({isOpen:n,onClose:o})=>{const{describeApi:i,tokensApi:a}=Vl(),l=a.useTokens().items[0];return e(Mt,{isOpen:n,header:{icon:fl,title:"System Overview",onClose:o},children:[i.fetchDescribeOdigos&&t(Zh,{}),a.updateToken&&l&&t(Yh,{token:l}),i.downloadDiagnose&&t(qh,{})]})},em=({isOpen:o,onClose:i,onCloseEnd:a})=>{const{addDataStreams:l,setSelectedStreamName:r}=Qe(),{dataStreamsApi:s}=Vl(),{requestSubmit:c}=Gl(),p=d(async e=>{s.create?await s.create(e):(l([e]),r(e.name)),i()},[s,l,r,i]),u=d(()=>c(p),[c,p]);return ro({key:"Enter",active:o},u),e(n,{children:[t(qe,{isOpen:o,onClose:i,onCloseEnd:a,title:Ze.NAME_YOUR_STREAM,description:Ze.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:Lt.DONE,variant:ve.Primary,onClick:u},denyButton:{"data-id":"add-stream-btn-cancel",label:Lt.CANCEL,variant:ve.Secondary,onClick:i},children:t(Ns,{autoFocus:!0})}),t(Is,{})]})},tm=({isOpen:o,onClose:a,onCloseEnd:l,dataStreamName:r})=>{const{dataStreamsApi:s}=Vl(),{genericForm:c,loadDataStream:p,requestSubmit:u}=Gl();i(()=>{o&&r&&p(r)},[o,r]);const h=!!c?.isFormDirty,m=d(async e=>{await s.update(r,e),a()},[s,r,a]),g=d(()=>u(m),[u,m]);return ro({key:"Enter",active:o},g),e(n,{children:[t(qe,{isOpen:o,onClose:a,onCloseEnd:l,title:Ze.RENAME_STREAM(r),description:Ze.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:Lt.SAVE,variant:ve.Primary,onClick:g,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:Lt.CANCEL,variant:ve.Secondary,onClick:a},children:t(Ns,{autoFocus:!0})}),t(Is,{})]})},nm=({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)"})})]})]}),om=b.div`
813
+ `,em=()=>{const{progress:n}=Ot(),{describeApi:o,namespacesApi:i}=jl(),{items:l}=i.useNamespaces(),[r,s]=a(null),{formData:c,handleFormChange:d,resetFormData:p}=Yt({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(st,{richTitle:{icon:Al,title:"Diagnose"},children:r?e(Qh,{children:[t(yt,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof n[Rt.DownloadingDiagnose]?.percentage,percentage:n[Rt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof n[Rt.DownloadingDiagnose]?.percentage,visualIcon:Il,startedAt:r}),n[Rt.DownloadingDiagnose]?.list?.length&&t(ee,{$width:"100%",children:n[Rt.DownloadingDiagnose].list.map((n,o)=>e(pe,{$gap:4,$alignItems:"center",children:[n.status===Ee.Success?t(Ya,{size:16}):n.status===Ee.Error?t(Ja,{size:16}):t(yt,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(_e,{size:Te.XXXS,color:Pe.Secondary,children:n.label})]},`diagnose-item-${o}-${n.label}`))})]}):e(ee,{$gap:24,children:[t(_e,{size:Te.XXS,color:Pe.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(ee,{$gap:16,children:[e(pe,{$gap:8,children:[t(ne,{label:"Profiles",value:c.includeProfiles,onChange:e=>d("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(_e,{size:Te.XXXS,color:Pe.Secondary,children:"Include pprof profiles"})]}),e(pe,{$gap:8,children:[t(ne,{label:"Metrics",value:c.includeMetrics,onChange:e=>d("includeMetrics",e)}),t(_e,{size:Te.XXXS,color:Pe.Secondary,children:"Include Prometheus metrics"})]}),e(pe,{$gap:8,children:[t(ne,{label:"Source Workloads",value:c.includeSourceWorkloads,onChange:e=>{d("includeSourceWorkloads",e),e&&d("sourceWorkloadNamespaces",[])}}),t(_e,{size:Te.XXXS,color:Pe.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(po,{alignX:ho.Left,alignY:uo.Bottom,items:l.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:ve.Secondary,disabled:c.includeSourceWorkloads,leftIcon:c.sourceWorkloadNamespaces.length?()=>t(Ke,{label:c.sourceWorkloadNamespaces.length,status:Ee.Default}):void 0}}),t(pe,{$justifyContent:"flex-end",children:t(fe,{label:"Download Diagnose",rightIcon:Il,variant:ve.Primary,onClick:async()=>{o.downloadDiagnose&&(s(Date.now()),await o.downloadDiagnose(c),s(null),p())},disabled:null!==r})})]})})},tm=()=>{const{platformType:e,version:n,tier:o}=S(),{describeApi:l}=jl(),[r,s]=a(null);return i(()=>{l.fetchDescribeOdigos&&l.fetchDescribeOdigos().then(({data:e})=>s(e?.describeOdigos??null))},[]),t(st,{richTitle:{icon:vl,title:"General Information"},children:t(Gt,{cellsPerRow:2,items:[{id:mo(),title:"Odigos Version",label:n},{id:mo(),title:`${e.toUpperCase()} Version`,label:r?.kubernetesVersion?.value||"-"},{id:mo(),title:"Installation Method",label:r?.installationMethod?.value||"-"},{id:mo(),title:"Tier",label:o}]})})},nm=({isOpen:n,onClose:o})=>{const{describeApi:i,tokensApi:a}=jl(),l=a.useTokens().items[0];return e(Mt,{isOpen:n,header:{icon:vl,title:"System Overview",onClose:o},children:[i.fetchDescribeOdigos&&t(tm,{}),a.updateToken&&l&&t(Zh,{token:l}),i.downloadDiagnose&&t(em,{})]})},om=({isOpen:o,onClose:i,onCloseEnd:a})=>{const{addDataStreams:l,setSelectedStreamName:r}=Qe(),{dataStreamsApi:s}=jl(),{requestSubmit:c}=Kl(),p=d(async e=>{s.create?await s.create(e):(l([e]),r(e.name)),i()},[s,l,r,i]),u=d(()=>c(p),[c,p]);return so({key:"Enter",active:o},u),e(n,{children:[t(qe,{isOpen:o,onClose:i,onCloseEnd:a,title:Ze.NAME_YOUR_STREAM,description:Ze.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:Lt.DONE,variant:ve.Primary,onClick:u},denyButton:{"data-id":"add-stream-btn-cancel",label:Lt.CANCEL,variant:ve.Secondary,onClick:i},children:t(Os,{autoFocus:!0})}),t(Es,{})]})},im=({isOpen:o,onClose:a,onCloseEnd:l,dataStreamName:r})=>{const{dataStreamsApi:s}=jl(),{genericForm:c,loadDataStream:p,requestSubmit:u}=Kl();i(()=>{o&&r&&p(r)},[o,r]);const h=!!c?.isFormDirty,m=d(async e=>{await s.update(r,e),a()},[s,r,a]),g=d(()=>u(m),[u,m]);return so({key:"Enter",active:o},g),e(n,{children:[t(qe,{isOpen:o,onClose:a,onCloseEnd:l,title:Ze.RENAME_STREAM(r),description:Ze.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:Lt.SAVE,variant:ve.Primary,onClick:g,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:Lt.CANCEL,variant:ve.Secondary,onClick:a},children:t(Os,{autoFocus:!0})}),t(Es,{})]})},am=({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)"})})]})]}),lm=b.div`
814
814
  position: absolute;
815
815
  top: 50%;
816
816
  left: 50%;
817
817
  transform: translate(-50%, -50%);
818
818
  z-index: ${({theme:e})=>e.v2.zIndex.modal};
819
- `,im=()=>{const{drawerType:n,setDrawerType:o}=fn(),i=n===go.OnboardingDone,a=()=>o(null);return e(mo,{isOpen:i,onClose:a,children:[t(nm,{}),t(om,{children:e(ee,{$gap:32,$alignItems:"center",children:[e(ee,{$gap:24,$alignItems:"center",children:[t(_e,{size:Te.L,weight:500,children:"Welcome to"}),t($r,{size:260}),t(_e,{size:Te.S,weight:400,children:"Your observability control plane is ready."})]}),t(fe,{label:"Get Started",rightIcon:Da,onClick:a})]})})]})},am=b.div`
819
+ `,rm=()=>{const{drawerType:n,setDrawerType:o}=bn(),i=n===fo.OnboardingDone,a=()=>o(null);return e(go,{isOpen:i,onClose:a,children:[t(am,{}),t(lm,{children:e(ee,{$gap:32,$alignItems:"center",children:[e(ee,{$gap:24,$alignItems:"center",children:[t(_e,{size:Te.L,weight:500,children:"Welcome to"}),t(Rr,{size:260}),t(_e,{size:Te.S,weight:400,children:"Your observability control plane is ready."})]}),t(fe,{label:"Get Started",rightIcon:Pa,onClick:a})]})})]})},sm=b.div`
820
820
  display: flex;
821
821
  flex-direction: column;
822
822
  gap: 8px;
823
823
  padding: 4px 8px;
824
824
  border-radius: 8px;
825
825
  width: 100%;
826
- `,lm=b.div`
826
+ `,cm=b.div`
827
827
  white-space: pre;
828
828
  overflow-x: auto;
829
- `,rm=({name:n,recommended:o,toggleLabel:i,enabled:a,onEnabledChange:l,summary:r,toggleName:s})=>{const c=v();return e(am,{children:[e(pe,{$gap:8,$justifyContent:"space-between",children:[e(pe,{$gap:4,children:[t(_e,{size:Te.XS,color:c.v2.colors.white[500],nowrap:!0,children:n}),o&&t(Ke,{label:fo,leftIcon:$l,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:Te.XXXS})]}),t(le,{name:s??`sampling-onboarding-toggle-${n}`,label:i,labelAlign:re.Left,value:a,onChange:l,size:Nt.S})]}),t(lm,{children:t(w,{parts:r})})]})},sm=b.div`
829
+ `,dm=({name:n,recommended:o,toggleLabel:i,enabled:a,onEnabledChange:l,summary:r,toggleName:s})=>{const c=v();return e(sm,{children:[e(pe,{$gap:8,$justifyContent:"space-between",children:[e(pe,{$gap:4,children:[t(_e,{size:Te.XS,color:c.v2.colors.white[500],nowrap:!0,children:n}),o&&t(Ke,{label:bo,leftIcon:Rl,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:Te.XXXS})]}),t(le,{name:s??`sampling-onboarding-toggle-${n}`,label:i,labelAlign:re.Left,value:a,onChange:l,size:Nt.S})]}),t(cm,{children:t(w,{parts:r})})]})},pm=b.div`
830
830
  position: relative;
831
831
  display: flex;
832
832
  align-items: center;
@@ -836,18 +836,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
836
836
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
837
837
  border-top-left-radius: 18px;
838
838
  border-top-right-radius: 18px;
839
- `,cm=b.div`
839
+ `,um=b.div`
840
840
  position: absolute;
841
841
  left: 16px;
842
842
  top: 50%;
843
843
  transform: translateY(-50%);
844
- `,dm=b.div`
844
+ `,hm=b.div`
845
845
  height: 16px;
846
846
  width: 100%;
847
847
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
848
848
  border-top-left-radius: 18px;
849
849
  border-top-right-radius: 18px;
850
- `,pm=b.div`
850
+ `,mm=b.div`
851
851
  width: ${({$width:e})=>e}px;
852
852
  display: flex;
853
853
  flex-direction: column;
@@ -855,7 +855,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
855
855
  gap: 22px;
856
856
  padding: 8px 32px 32px 32px;
857
857
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
858
- `,um=e=>t(Al,{rotate:90,...e}),hm=({children:n,center:o,onNext:i,nextLabel:a=bo,nextLoading:l})=>e(pe,{$gap:8,$justifyContent:o?"center":"flex-end",$padding:"0 16px 16px 16px",children:[n,i&&t(fe,{"data-id":"sampling-onboarding-btn-next",label:a,rightIcon:um,variant:ve.Primary,size:be.M,onClick:i,loading:l})]}),mm=e=>t(Al,{rotate:-90,...e}),gm=({title:n,onBack:o})=>{const i=v();return e(sm,{$hasBack:!!o,children:[o&&t(cm,{children:t(bt,{"data-id":"sampling-onboarding-back",icon:mm,size:vt.M,onClick:o})}),t(_e,{size:Te.M,weight:500,color:i.v2.colors.white[500],align:"center",children:n})]})},fm=b.div`
858
+ `,gm=e=>t(Dl,{rotate:90,...e}),fm=({children:n,center:o,onNext:i,nextLabel:a=vo,nextLoading:l})=>e(pe,{$gap:8,$justifyContent:o?"center":"flex-end",$padding:"0 16px 16px 16px",children:[n,i&&t(fe,{"data-id":"sampling-onboarding-btn-next",label:a,rightIcon:gm,variant:ve.Primary,size:be.M,onClick:i,loading:l})]}),bm=e=>t(Dl,{rotate:-90,...e}),vm=({title:n,onBack:o})=>{const i=v();return e(pm,{$hasBack:!!o,children:[o&&t(um,{children:t(bt,{"data-id":"sampling-onboarding-back",icon:bm,size:vt.M,onClick:o})}),t(_e,{size:Te.M,weight:500,color:i.v2.colors.white[500],align:"center",children:n})]})},ym=b.div`
859
859
  box-sizing: border-box;
860
860
  width: ${({$width:e})=>e??"100%"};
861
861
  ${({$fillHeight:e})=>e&&y`
@@ -868,16 +868,16 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
868
868
  padding: 16px;
869
869
  border-radius: 16px;
870
870
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
871
- `,bm=({children:e,fillHeight:n,width:o})=>t(fm,{$fillHeight:n,$width:o,children:e}),vm=b.ul`
871
+ `,Cm=({children:e,fillHeight:n,width:o})=>t(ym,{$fillHeight:n,$width:o,children:e}),Sm=b.ul`
872
872
  margin: 0;
873
873
  padding: 0;
874
874
  list-style: disc;
875
- `,ym=b.li`
875
+ `,xm=b.li`
876
876
  margin-left: 18px;
877
877
  & + & {
878
878
  margin-top: 6px;
879
879
  }
880
- `,Cm=({items:e,color:n})=>{const o=v(),i=n||o.v2.colors.silver[200];return t(vm,{children:e.map((e,n)=>t(ym,{style:{color:i},children:t(_e,{size:Te.XXS,color:i,children:e})},n))})},Sm=({items:n})=>{const o=v();return t(ee,{$gap:16,children:n.map((n,i)=>e(pe,{$gap:8,$alignItems:"flex-start",children:[e(_e,{size:Te.XS,color:o.v2.colors.silver[200],weight:400,children:[i+1,"."]}),e(ee,{$gap:2,children:[t(_e,{size:Te.XS,color:o.v2.colors.white[500],weight:500,children:n.title}),t(_e,{size:Te.XS,color:o.v2.colors.silver[200],children:n.description})]})]},i))})},xm=({message:e})=>t(Ne,{status:Ee.Default,message:e,fullWidth:!0,smallIcon:!0}),wm=b.div`
880
+ `,wm=({items:e,color:n})=>{const o=v(),i=n||o.v2.colors.silver[200];return t(Sm,{children:e.map((e,n)=>t(xm,{style:{color:i},children:t(_e,{size:Te.XXS,color:i,children:e})},n))})},Tm=({items:n})=>{const o=v();return t(ee,{$gap:16,children:n.map((n,i)=>e(pe,{$gap:8,$alignItems:"flex-start",children:[e(_e,{size:Te.XS,color:o.v2.colors.silver[200],weight:400,children:[i+1,"."]}),e(ee,{$gap:2,children:[t(_e,{size:Te.XS,color:o.v2.colors.white[500],weight:500,children:n.title}),t(_e,{size:Te.XS,color:o.v2.colors.silver[200],children:n.description})]})]},i))})},km=({message:e})=>t(Ne,{status:Ee.Default,message:e,fullWidth:!0,smallIcon:!0}),Im=b.div`
881
881
  width: 100%;
882
882
  padding: 8px;
883
883
  display: flex;
@@ -885,12 +885,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
885
885
  gap: 4px;
886
886
  border-radius: 16px;
887
887
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
888
- `,Tm=b.div`
888
+ `,Nm=b.div`
889
889
  display: flex;
890
890
  align-items: center;
891
891
  gap: 8px;
892
892
  padding: 4px 8px 12px 8px;
893
- `,km=b.div`
893
+ `,Em=b.div`
894
894
  width: 100%;
895
895
  display: flex;
896
896
  flex-direction: column;
@@ -898,20 +898,20 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
898
898
  padding: 8px;
899
899
  border-radius: 12px;
900
900
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
901
- `,Im=({children:e})=>{const n=v();return t(_e,{size:Te.S,weight:500,color:n.v2.colors.white[500],align:"center",children:e})},Nm=b.div`
901
+ `,Om=({children:e})=>{const n=v();return t(_e,{size:Te.S,weight:500,color:n.v2.colors.white[500],align:"center",children:e})},$m=b.div`
902
902
  white-space: pre-line;
903
- `,Em=({enabled:o,onEnabledChange:i,onBack:a,onNext:l})=>{const r=v(),s=c(()=>A({enabled:o,keepPercentage:0}),[o]);return e(n,{children:[t(gm,{title:vo,onBack:a}),e(pm,{$width:854,children:[t(Im,{children:yo}),e(ee,{$gap:8,$width:"100%",children:[t(bm,{children:t(Nm,{children:t(_e,{size:Te.XXS,color:r.v2.colors.silver[200],children:Co})})}),e(ee,{$gap:8,$width:"100%",children:[e(wm,{children:[t(Tm,{children:t(_e,{size:Te.S,weight:500,color:r.v2.colors.white[500],children:So})}),t(km,{children:t(rm,{name:wo,recommended:!0,toggleLabel:xo,enabled:o,onEnabledChange:i,summary:s,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(xm,{message:To})]})]})]}),t(hm,{onNext:l})]})},Om=e=>t(Al,{rotate:90,...e}),$m=({onClose:o})=>{const i=v();return e(n,{children:[t(dm,{}),e(pm,{$width:732,children:[t(ko,{icon:Il}),e(ee,{$gap:16,$alignItems:"center",$width:"100%",children:[t(_e,{size:Te.M,weight:500,color:i.v2.colors.white[500],children:Io}),No.split("\n").map((e,n)=>t(Im,{children:e},`subtitle-${n}-${e}`)),e(bm,{children:[t(_e,{size:Te.XS,color:i.v2.colors.silver[200],children:Eo}),t(Cm,{color:i.v2.colors.white[500],items:[Oo,$o,Ao]})]})]})]}),t(hm,{center:!0,children:t(fe,{"data-id":"sampling-onboarding-btn-go-to",label:Ro,rightIcon:Om,variant:ve.Primary,size:be.M,onClick:o})})]})},Am=e=>t(Al,{rotate:90,...e}),Rm=b.div`
903
+ `,Am=({enabled:o,onEnabledChange:i,onBack:a,onNext:l})=>{const r=v(),s=c(()=>A({enabled:o,keepPercentage:0}),[o]);return e(n,{children:[t(vm,{title:yo,onBack:a}),e(mm,{$width:854,children:[t(Om,{children:Co}),e(ee,{$gap:8,$width:"100%",children:[t(Cm,{children:t($m,{children:t(_e,{size:Te.XXS,color:r.v2.colors.silver[200],children:So})})}),e(ee,{$gap:8,$width:"100%",children:[e(Im,{children:[t(Nm,{children:t(_e,{size:Te.S,weight:500,color:r.v2.colors.white[500],children:xo})}),t(Em,{children:t(dm,{name:To,recommended:!0,toggleLabel:wo,enabled:o,onEnabledChange:i,summary:s,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(km,{message:ko})]})]})]}),t(fm,{onNext:l})]})},Rm=e=>t(Dl,{rotate:90,...e}),Dm=({onClose:o})=>{const i=v();return e(n,{children:[t(hm,{}),e(mm,{$width:732,children:[t(Io,{icon:El}),e(ee,{$gap:16,$alignItems:"center",$width:"100%",children:[t(_e,{size:Te.M,weight:500,color:i.v2.colors.white[500],children:No}),Eo.split("\n").map((e,n)=>t(Om,{children:e},`subtitle-${n}-${e}`)),e(Cm,{children:[t(_e,{size:Te.XS,color:i.v2.colors.silver[200],children:Oo}),t(wm,{color:i.v2.colors.white[500],items:[$o,Ao,Ro]})]})]})]}),t(fm,{center:!0,children:t(fe,{"data-id":"sampling-onboarding-btn-go-to",label:Do,rightIcon:Rm,variant:ve.Primary,size:be.M,onClick:o})})]})},_m=e=>t(Dl,{rotate:90,...e}),Pm=b.div`
904
904
  display: flex;
905
905
  flex-direction: column;
906
906
  align-items: center;
907
907
  gap: 8px;
908
908
  width: 100%;
909
- `,Dm=({onSkip:o,onNext:i})=>{const a=v();return e(n,{children:[t(dm,{}),e(pm,{$width:732,children:[t(ko,{icon:Il}),e(ee,{$gap:16,$alignItems:"center",$width:"100%",children:[e(Rm,{children:[t(_e,{size:Te.M,weight:500,color:a.v2.colors.white[500],children:Do}),t(Im,{children:_o})]}),e(bm,{children:[t(_e,{size:Te.XS,color:a.v2.colors.silver[200],children:Po}),t(Sm,{items:[{title:Fo,description:Lo},{title:zo,description:Mo},{title:Xo,description:Bo}]}),t(xm,{message:Uo})]})]})]}),e(hm,{center:!0,children:[t(fe,{"data-id":"sampling-onboarding-btn-skip",label:Vo,variant:ve.Secondary,onClick:o}),t(fe,{"data-id":"sampling-onboarding-btn-start",label:Ho,rightIcon:Am,variant:ve.Primary,onClick:i})]})]})},_m=b.div`
909
+ `,Lm=({onSkip:o,onNext:i})=>{const a=v();return e(n,{children:[t(hm,{}),e(mm,{$width:732,children:[t(Io,{icon:El}),e(ee,{$gap:16,$alignItems:"center",$width:"100%",children:[e(Pm,{children:[t(_e,{size:Te.M,weight:500,color:a.v2.colors.white[500],children:_o}),t(Om,{children:Po})]}),e(Cm,{children:[t(_e,{size:Te.XS,color:a.v2.colors.silver[200],children:Lo}),t(Tm,{items:[{title:Mo,description:Fo},{title:Bo,description:zo},{title:Uo,description:Xo}]}),t(km,{message:Vo})]})]})]}),e(fm,{center:!0,children:[t(fe,{"data-id":"sampling-onboarding-btn-skip",label:Ho,variant:ve.Secondary,onClick:o}),t(fe,{"data-id":"sampling-onboarding-btn-start",label:jo,rightIcon:_m,variant:ve.Primary,onClick:i})]})]})},Fm=b.div`
910
910
  display: flex;
911
911
  align-items: stretch;
912
912
  gap: 16px;
913
913
  width: 100%;
914
- `,Pm=b.div`
914
+ `,Mm=b.div`
915
915
  flex: 1;
916
916
  display: flex;
917
917
  flex-direction: column;
@@ -931,18 +931,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
931
931
  background-color: ${t.v2.colors.silver[700]};
932
932
  }
933
933
  `}
934
- `,Lm=b.div`
934
+ `,zm=b.div`
935
935
  display: flex;
936
936
  align-items: center;
937
937
  gap: 8px;
938
938
  padding: 12px 16px;
939
- `,Fm=b.div`
939
+ `,Bm=b.div`
940
940
  flex: 1;
941
941
  padding: 8px;
942
942
  display: flex;
943
943
  flex-direction: column;
944
944
  gap: 8px;
945
- `,Mm=b.div`
945
+ `,Xm=b.div`
946
946
  flex: 1;
947
947
  display: flex;
948
948
  flex-direction: column;
@@ -950,17 +950,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
950
950
  padding: 12px;
951
951
  border-radius: 12px;
952
952
  background-color: ${({theme:e,$selected:t})=>t?e.v2.colors.purple[900]:e.v2.colors.silver[900]};
953
- `,zm=b.div`
953
+ `,Um=b.div`
954
954
  display: flex;
955
955
  justify-content: flex-end;
956
- `,Bm=b.div`
956
+ `,Vm=b.div`
957
957
  display: flex;
958
958
  align-items: center;
959
959
  gap: 8px;
960
960
  padding: 4px 12px 4px 4px;
961
961
  border-radius: 8px;
962
962
  background-color: ${({theme:e})=>e.v2.colors.yellow[1e3]};
963
- `,Xm=b.div`
963
+ `,Hm=b.div`
964
964
  display: flex;
965
965
  align-items: center;
966
966
  justify-content: center;
@@ -968,13 +968,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
968
968
  height: 24px;
969
969
  border-radius: 6px;
970
970
  background-color: ${({theme:e})=>e.v2.colors.yellow[900]};
971
- `,Um=({selected:n,onSelect:o,name:i,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(Pm,{$selected:n,onClick:o,children:[e(Lm,{children:[t(he,{"data-id":`sampling-onboarding-radio-${i}`,value:n,onChange:o,size:ge.L}),t(Il,{size:24,fill:d.v2.colors.white[500]}),t(_e,{size:Te.S,weight:500,color:d.v2.colors.white[500],children:i})]}),e(Fm,{children:[e(Mm,{$selected:n,children:[e(ee,{$gap:8,children:[t(Ke,{...l,textSize:Te.XXXS}),t(_e,{size:Te.XXS,color:p,children:a})]}),r&&r.length>0&&t(Cm,{color:p,items:r}),s&&e(Bm,{children:[t(Xm,{children:t(Nl,{size:18,fill:d.v2.colors.yellow[500]})}),t(_e,{size:Te.XXXS,color:d.v2.colors.yellow[500],children:s})]})]}),c&&t(zm,{children:t(fe,{"data-id":`sampling-onboarding-btn-read-more-${i}`,label:ri,rightIcon:La,variant:ve.Text,size:be.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},Vm=({strategy:o,onStrategyChange:i,onBack:a,onNext:l,docsUrl:r})=>{const s=v(),c=r?()=>window.open(r,"_blank"):void 0;return e(n,{children:[t(gm,{title:jo,onBack:a}),e(pm,{$width:854,children:[t(Im,{children:Go}),e(_m,{children:[t(Um,{selected:"keep-list"===o,onSelect:()=>i("keep-list"),name:Zo,description:qo,badgeProps:{label:Jo,backgroundColor:s.v2.colors.purple[500],textColor:s.v2.colors.white[500]},bullets:[Ko,Yo],warning:Wo,onReadMore:c}),t(Um,{selected:"drop-list"===o,onSelect:()=>i("drop-list"),name:oi,description:ni,badgeProps:{label:ti,backgroundColor:s.v2.colors.green[500],textColor:s.v2.colors.black[500]},bullets:[Qo,ei],onReadMore:c}),t(Um,{selected:"advanced"===o,onSelect:()=>i("advanced"),name:li,description:ai,badgeProps:{label:ii,backgroundColor:s.v2.colors.blue[700],textColor:s.v2.colors.white[500]},onReadMore:c})]})]}),t(hm,{onNext:l})]})},Hm=({onBack:o,onNext:i,submitting:a})=>{const l=v(),r=c(()=>[{title:pi,bullets:[si,ci,di]},{title:bi,bullets:[ui,hi,mi,gi,fi]}],[]);return e(n,{children:[t(gm,{title:vi,onBack:o}),e(pm,{$width:854,children:[t(Im,{children:yi}),t(pe,{$gap:16,$width:"100%",$alignItems:"stretch",children:r.map((n,o)=>e(bm,{fillHeight:!0,width:"50%",children:[t(_e,{size:Te.XS,color:l.v2.colors.white[500],children:n.title}),t(Cm,{items:n.bullets})]},o))}),t(xm,{message:Ci})]}),t(hm,{onNext:i,nextLoading:a})]})},jm=b.div`
971
+ `,jm=({selected:n,onSelect:o,name:i,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(Mm,{$selected:n,onClick:o,children:[e(zm,{children:[t(he,{"data-id":`sampling-onboarding-radio-${i}`,value:n,onChange:o,size:ge.L}),t(El,{size:24,fill:d.v2.colors.white[500]}),t(_e,{size:Te.S,weight:500,color:d.v2.colors.white[500],children:i})]}),e(Bm,{children:[e(Xm,{$selected:n,children:[e(ee,{$gap:8,children:[t(Ke,{...l,textSize:Te.XXXS}),t(_e,{size:Te.XXS,color:p,children:a})]}),r&&r.length>0&&t(wm,{color:p,items:r}),s&&e(Vm,{children:[t(Hm,{children:t(Ol,{size:18,fill:d.v2.colors.yellow[500]})}),t(_e,{size:Te.XXXS,color:d.v2.colors.yellow[500],children:s})]})]}),c&&t(Um,{children:t(fe,{"data-id":`sampling-onboarding-btn-read-more-${i}`,label:si,rightIcon:Ma,variant:ve.Text,size:be.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},Gm=({strategy:o,onStrategyChange:i,onBack:a,onNext:l,docsUrl:r})=>{const s=v(),c=r?()=>window.open(r,"_blank"):void 0;return e(n,{children:[t(vm,{title:Go,onBack:a}),e(mm,{$width:854,children:[t(Om,{children:Wo}),e(Fm,{children:[t(jm,{selected:"keep-list"===o,onSelect:()=>i("keep-list"),name:Qo,description:Zo,badgeProps:{label:qo,backgroundColor:s.v2.colors.purple[500],textColor:s.v2.colors.white[500]},bullets:[Yo,Jo],warning:Ko,onReadMore:c}),t(jm,{selected:"drop-list"===o,onSelect:()=>i("drop-list"),name:ii,description:oi,badgeProps:{label:ni,backgroundColor:s.v2.colors.green[500],textColor:s.v2.colors.black[500]},bullets:[ei,ti],onReadMore:c}),t(jm,{selected:"advanced"===o,onSelect:()=>i("advanced"),name:ri,description:li,badgeProps:{label:ai,backgroundColor:s.v2.colors.blue[700],textColor:s.v2.colors.white[500]},onReadMore:c})]})]}),t(fm,{onNext:l})]})},Wm=({onBack:o,onNext:i,submitting:a})=>{const l=v(),r=c(()=>[{title:ui,bullets:[ci,di,pi]},{title:vi,bullets:[hi,mi,gi,fi,bi]}],[]);return e(n,{children:[t(vm,{title:yi,onBack:o}),e(mm,{$width:854,children:[t(Om,{children:Ci}),t(pe,{$gap:16,$width:"100%",$alignItems:"stretch",children:r.map((n,o)=>e(Cm,{fillHeight:!0,width:"50%",children:[t(_e,{size:Te.XS,color:l.v2.colors.white[500],children:n.title}),t(wm,{items:n.bullets})]},o))}),t(km,{message:Si})]}),t(fm,{onNext:i,nextLoading:a})]})},Km=b.div`
972
972
  white-space: pre-line;
973
- `,Gm=({errorPresetEnabled:o,onErrorPresetChange:i,onBack:a,onNext:l,submitting:r})=>{const s=v(),d=c(()=>R(o?{disabled:!1}:null),[o]);return e(n,{children:[t(gm,{title:Si,onBack:a}),e(pm,{$width:854,children:[t(Im,{children:xi}),e(ee,{$gap:8,$width:"100%",children:[e(bm,{children:[t(jm,{children:t(_e,{size:Te.XXS,color:s.v2.colors.silver[200],children:wi})}),t(xm,{message:Ci})]}),e(wm,{children:[e(Tm,{children:[t(_e,{size:Te.S,weight:500,color:s.v2.colors.white[500],children:Ti}),t(ul,{size:16,fill:s.v2.colors.silver[200]})]}),t(km,{children:t(rm,{name:Ii,recommended:!0,toggleLabel:ki,enabled:o,onEnabledChange:i,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(hm,{onNext:l,nextLoading:r})]})},Wm=b.div`
973
+ `,Ym=({errorPresetEnabled:o,onErrorPresetChange:i,onBack:a,onNext:l,submitting:r})=>{const s=v(),d=c(()=>R(o?{disabled:!1}:null),[o]);return e(n,{children:[t(vm,{title:xi,onBack:a}),e(mm,{$width:854,children:[t(Om,{children:wi}),e(ee,{$gap:8,$width:"100%",children:[e(Cm,{children:[t(Km,{children:t(_e,{size:Te.XXS,color:s.v2.colors.silver[200],children:Ti})}),t(km,{message:Si})]}),e(Im,{children:[e(Nm,{children:[t(_e,{size:Te.S,weight:500,color:s.v2.colors.white[500],children:ki}),t(ml,{size:16,fill:s.v2.colors.silver[200]})]}),t(Em,{children:t(dm,{name:Ni,recommended:!0,toggleLabel:Ii,enabled:o,onEnabledChange:i,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(fm,{onNext:l,nextLoading:r})]})},Jm=b.div`
974
974
  white-space: pre-line;
975
- `,Km=b.div`
975
+ `,qm=b.div`
976
976
  width: fit-content;
977
- `,Ym=["50","25","10","1","0.1"],Jm=({value:n,onChange:o,label:i})=>{const a=v(),l=c(()=>Ym.map(e=>({value:e,label:`${e}%`,selectedBgColor:a.v2.colors.purple[900],selectedBorderColor:a.v2.colors.purple[400]})),[a]);return e(ee,{$gap:8,children:[t(_e,{size:Te.XS,color:a.v2.colors.white[500],children:i}),t(Km,{children:t(ce,{"data-id":"sampling-onboarding-ambient",options:l,selected:n,setSelected:o})})]})},qm=({errorPresetEnabled:o,onErrorPresetChange:i,ambientPercentage:a,onAmbientPercentageChange:l,onBack:r,onNext:s,submitting:d})=>{const p=v(),u=c(()=>R(o?{disabled:!1}:null),[o]);return e(n,{children:[t(gm,{title:Ni,onBack:r}),e(pm,{$width:854,children:[t(Im,{children:Ei}),e(ee,{$gap:8,$width:"100%",children:[e(bm,{children:[t(Wm,{children:t(_e,{size:Te.XXS,color:p.v2.colors.silver[200],children:Oi})}),t(Cm,{items:[$i,Ai,Ri,Di,_i]}),t(xm,{message:Ci})]}),e(wm,{children:[e(Tm,{children:[t(_e,{size:Te.S,weight:500,color:p.v2.colors.white[500],children:Pi}),t(ul,{size:16,fill:p.v2.colors.silver[200]})]}),t(km,{children:t(rm,{name:Ii,recommended:!0,toggleLabel:ki,enabled:o,onEnabledChange:i,summary:u,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(km,{children:t(Jm,{value:a,onChange:l,label:Li})})]})]})]}),t(hm,{onNext:s,nextLoading:d})]})},Zm=({isOpen:e,onClose:n,k8sHealthProbesConfig:o,samplingId:l,docsUrl:r})=>{const{samplingApi:s}=Vl(),[c,p]=a("welcome"),[u,h]=a(!0),[m,g]=a("keep-list"),[f,b]=a(!0),[v,y]=a("25"),[C,S]=a(!1);i(()=>{e&&(p("welcome"),h(o?.enabled??!0),g("keep-list"),b(!0),y("25"),S(!1))},[e,o?.enabled]);const x=d(async()=>{const e=l??"default",t=[];if(u!==(o?.enabled??!1)){const e=s.updateK8sHealthProbesConfig;e&&t.push(e({enabled:u,keepPercentage:o?.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)}},[l,s,u,o?.enabled,o?.keepPercentage,m,f,v]);let w=null;switch(c){case"welcome":w=t(Dm,{onSkip:n,onNext:()=>p("noisy")});break;case"noisy":w=t(Em,{enabled:u,onEnabledChange:h,onBack:()=>p("welcome"),onNext:()=>p("strategy")});break;case"strategy":w=t(Vm,{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(qm,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"drop-list":w=t(Gm,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"advanced":w=t(Hm,{onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"success":w=t($m,{onClose:n})}return t(mo,{isOpen:e,onClose:n,children:w})};var Qm,eg;(e=>{e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"})(Qm||(Qm={})),(e=>{e.K8s="k8s",e.VmAgent="vm-agent",e.CloudConnector="cloud-connector"})(eg||(eg={}));const tg=[{id:eg.CloudConnector,label:"Cloud Connector"}];var ng;(e=>{e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"})(ng||(ng={}));const og=[{key:ng.Name,label:"Name"},{key:ng.Type,label:"Type"},{key:ng.Status,label:"Status"},{key:ng.OdigosVersion,label:"Odigos Version"},{key:ng.ConnectedSince,label:"Connected Since"},{key:ng.LastActivity,label:"Last Activity"}],ig=(e,t)=>{const n=e.find(e=>e.key===ng.Id)?.rawValue;return t(n?.toString()||"")},ag={[Ee.Success]:"Connected",[Ee.Warning]:"Degraded",[Ee.Error]:"Error",[Ee.Disabled]:"Disabled",[Ee.Info]:"Pending"},lg={[Fi.K8s]:pn.Purple,[Fi.Vm]:pn.Blue,[Fi.Connector]:pn.Green},rg=({connections:n,getConnections:o,onClickConnection:l,deleteConnection:r,onCreateNew:s,cloudConnectorProviders:p,onCreateCloudConnector:u,configMinSupportedVersion:h=0,snapshotMinSupportedVersion:m=0})=>{const g=v(),{formatTimeAgo:f}=en(),{capabilities:b}=Vl(),[y,C]=a(!1),[S,x]=a(n||[]),w=d(async()=>{try{C(!0),x(await o()??[])}catch(e){}finally{C(!1)}},[]);i(()=>{S.length||w()},[]);const[T,k]=a(""),[I,N]=a(null),[E,O]=a([]),[$,A]=a(!1),[R,P]=a(!1),L=d(()=>{A(!1),P(!0),w()},[w]),F=d(e=>{e===eg.CloudConnector?A(!0):s?.(e)},[s]),M=c(()=>I===Qm.BulkConfig?h:I===Qm.BulkSource?m:0,[I,h,m]),{supportedConnections:z,supportedConnectionIds:B}=c(()=>{const e=((e,t)=>e.filter(e=>{const n=e.status===Ee.Success,o=D(e.odigosVersion,t,e.type);return n&&o}))(S,M);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[S,M]);i(()=>{if(!I||I===Qm.Delete)return;const e=E.filter(e=>!B.includes(e));e.length&&O(t=>t.filter(t=>!e.includes(t)))},[I,E.length,B.length]);const X=c(()=>S.filter(e=>!T||e.name.toLowerCase().includes(T.toLowerCase())).map(e=>({cells:[{key:ng.Id,rawValue:e.id},{key:ng.Name,rawValue:e.name},{key:ng.Type,rawValue:e.type,component:()=>t(Zt,{variant:lg[e.type]??pn.Default,label:Mi(e.type)})},{key:ng.Status,rawValue:e.status,component:()=>(e=>{if(e.type===Fi.Connector){const n=ag[e.status]??"Pending",o=e.status===Ee.Success?Wa:e.status===Ee.Error?Ka:void 0;return t(Ke,{status:e.status,label:n,leftIcon:o})}const n=e.status===Ee.Success?"Connection live":"Connection lost",o=e.status===Ee.Success?Wa:Ka;return t(Ke,{status:e.status,label:n,leftIcon:o})})(e)},{key:ng.OdigosVersion,rawValue:e.odigosVersion},{key:ng.ConnectedSince,rawValue:e.connectedAt?f(e.connectedAt):"-"},{key:ng.LastActivity,rawValue:e.lastSeenAt?f(e.lastSeenAt):"-"}],onClick:e.status!==Ee.Success||I?void 0:()=>l(e),isSelected:E.includes(e.id),onSelect:()=>O(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>O(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==Ee.Success||I===Qm.BulkConfig&&!D(e.odigosVersion,h,e.type)||I===Qm.BulkSource&&!D(e.odigosVersion,m,e.type)})),[S,E,T,I,h,m,f,l]),U=c(()=>S.length>0&&S.every(e=>e.type===Fi.K8s),[S]),V=c(()=>{const e=(e,t)=>{O([e]),N(t)};return(e=>{const{connections:t,configMinSupportedVersion:n,snapshotMinSupportedVersion:o,onDelete:i,onAddSource:a,onAddDestination:l,onAddAction:r,onAddInstrumentationRule:s,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===ng.Status)?.rawValue===Ee.Success)(e))return[{id:ho(),label:"Delete Connection",rightIcon:Fa,onClick:()=>ig(e,i)}];const d=ig(e,e=>t.find(t=>t.id===e));if(d?.type!==Fi.K8s)return[];const p=!!d&&D(d.odigosVersion,n,d.type),u=!!d&&D(d.odigosVersion,o,d.type),h=_(n,d?.type),m=_(o,d?.type),g=[];return a&&g.push({id:ho(),tooltip:u?Ze.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${m} or later.`,rightIcon:Ja,disabled:!u,onClick:()=>ig(e,a)}),l&&g.push({id:ho(),tooltip:Ze.ADD_DESTINATION,rightIcon:Ha,onClick:()=>ig(e,l)}),r&&g.push({id:ho(),tooltip:Ze.ADD_ACTION,rightIcon:Va,onClick:()=>ig(e,r)}),s&&g.push({id:ho(),tooltip:Ze.ADD_INSTRUMENTATION_RULE,rightIcon:Ya,onClick:()=>ig(e,s)}),c&&g.push({id:ho(),tooltip:p?"Edit Configuration":`To use this feature, please upgrade to Odigos v${h} or later.`,rightIcon:rl,disabled:!p,onClick:()=>ig(e,c)}),g}})({connections:S,configMinSupportedVersion:h,snapshotMinSupportedVersion:m,onDelete:t=>e(t,Qm.Delete),onAddSource:b.canFetchSnapshots&&b.canBulkPersistSources?t=>e(t,Qm.BulkSource):void 0,onAddDestination:b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canCreateDestination?t=>e(t,Qm.BulkDestination):void 0,onAddAction:b.canCreateAction?t=>e(t,Qm.BulkAction):void 0,onAddInstrumentationRule:b.canCreateInstrumentationRule?t=>e(t,Qm.BulkInstrumentationRule):void 0,onEditConfiguration:b.canApplyEffectiveConfig?t=>e(t,Qm.BulkConfig):void 0})},[S,h,m,b]),H=c(()=>(e=>{const{onCancel:t,onAddSource:n,onAddDestination:o,onAddAction:i,onAddInstrumentationRule:a,onManageConfigurations:l}=e,r=[];n&&r.push({id:ho(),type:hn.Button,buttonProps:{variant:ve.Primary,size:be.S,label:"Add Sources",rightIcon:Ja,onClick:n}});const s=[o?{id:Qm.BulkDestination,label:Ze.ADD_DESTINATION,icon:Ha}:null,i?{id:Qm.BulkAction,label:Ze.ADD_ACTION,icon:Va}:null,a?{id:Qm.BulkInstrumentationRule,label:Ze.ADD_INSTRUMENTATION_RULE,icon:Ya}:null,l?{id:Qm.BulkConfig,label:"Manage Configurations",icon:rl}:null];return s.some(Boolean)&&r.push({id:ho(),type:hn.ButtonDropData,buttonProps:{variant:ve.Secondary,size:be.S,label:"Bulk Operations",onClick:e=>{e===Qm.BulkSource?n?.():e===Qm.BulkDestination?o?.():e===Qm.BulkAction?i?.():e===Qm.BulkInstrumentationRule?a?.():e===Qm.BulkConfig&&l?.()}},dropDataProps:{alignX:uo.Left,items:s}}),r.push({id:ho(),type:hn.Button,buttonProps:{variant:ve.Text,size:be.S,label:Lt.CANCEL,onClick:t}}),r})({onCancel:()=>O([]),onAddSource:b.canFetchSnapshots&&b.canBulkPersistSources?()=>N(Qm.BulkSource):void 0,onAddDestination:b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canCreateDestination?()=>N(Qm.BulkDestination):void 0,onAddAction:b.canCreateAction?()=>N(Qm.BulkAction):void 0,onAddInstrumentationRule:b.canCreateInstrumentationRule?()=>N(Qm.BulkInstrumentationRule):void 0,onManageConfigurations:b.canApplyEffectiveConfig?()=>N(Qm.BulkConfig):void 0}),[b]),j=c(()=>t(co,{items:tg,withMultiSelect:!1,selectedIds:[],setSelectedIds:e=>F(e[0]),buttonProps:{variant:ve.Primary,size:be.S,label:Lt.CREATE_NEW}}),[F]),G=c(()=>T.trim()&&S.length>0?{hideIcon:!0,title:Ze.NO_RESULTS,subTitle:Ze.NO_RESULTS_FOR_FILTER(T)}:{icon:Rl,title:Ze.NO_CONNECTIONS,action:j},[T,S.length,j]);return t(zi,{children:e(st,{fullHeight:!0,richTitle:{icon:Rl,title:Ze.CONNECTIONS,badge:{label:S.length.toString(),status:Ee.Unknown}},search:{placeholder:"Search by cluster name",value:T,onChange:e=>k(e),width:"300px"},actions:[{id:"connections-refresh",type:hn.Button,buttonProps:{variant:ve.Secondary,size:be.S,leftIcon:ll,onClick:w,disabled:y}},{id:"connections-create-new",type:hn.ButtonDropData,buttonProps:{variant:ve.Primary,size:be.S,label:Lt.CREATE_NEW,onClick:e=>F(e)},dropDataProps:{alignX:uo.Right,items:tg}}],children:[t(Pn,{variant:Ln.Pretty,headerBackgroundColor:g.v2.colors.silver[1e3],isLoading:y,withCheckboxes:U,columns:og,rows:X,noDataProps:G,rowActionsPushRightPosition:I?`calc(${Ir} - 24px)`:void 0,getRowActions:V}),I===Qm.BulkConfig&&b.canApplyEffectiveConfig&&t(or,{connectionIds:E,children:t(op,{onClose:()=>N(null),connections:z,selectedConnectionIds:E,setSelectedConnectionIds:O})}),I===Qm.BulkSource&&b.canFetchSnapshots&&b.canBulkPersistSources&&t(or,{connectionIds:E,children:t(ir,{selectedConnectionIds:E,children:t(vc,{onClose:()=>N(null),selectedConnectionIds:E,setSelectedConnectionIds:O})})}),I===Qm.BulkDestination&&b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canTestConnection&&b.canCreateDestination&&t(or,{connectionIds:E,children:t(ar,{children:t(tc,{onClose:()=>N(null),selectedConnectionIds:E,setSelectedConnectionIds:O})})}),I===Qm.BulkAction&&b.canCreateAction&&t(or,{connectionIds:E,children:t(lr,{children:t(js,{onClose:()=>N(null),selectedConnectionIds:E,setSelectedConnectionIds:O})})}),I===Qm.BulkInstrumentationRule&&b.canCreateInstrumentationRule&&t(or,{connectionIds:E,children:t(rr,{children:t(nc,{onClose:()=>N(null),selectedConnectionIds:E,setSelectedConnectionIds:O})})}),$&&t(sr,{providers:p,children:t(ep,{onClose:()=>A(!1),withOverlay:!0,onCreateCloudConnector:u,onCreated:L})}),t(Ar,{isOpen:R,onClose:()=>P(!1)}),t(Er,{target:"connection",isOpen:I===Qm.Delete,onClose:()=>{O([]),N(null)},onApprove:async()=>{const e=E[0];e&&(await r(e),await w())}}),t(Fn,{isOpen:!!E.length&&!I,richTitle:{icon:_a,title:"Selected Clusters",badge:{label:E.length}},actions:H})]})})},sg=b.div`
977
+ `,Zm=["50","25","10","1","0.1"],Qm=({value:n,onChange:o,label:i})=>{const a=v(),l=c(()=>Zm.map(e=>({value:e,label:`${e}%`,selectedBgColor:a.v2.colors.purple[900],selectedBorderColor:a.v2.colors.purple[400]})),[a]);return e(ee,{$gap:8,children:[t(_e,{size:Te.XS,color:a.v2.colors.white[500],children:i}),t(qm,{children:t(ce,{"data-id":"sampling-onboarding-ambient",options:l,selected:n,setSelected:o})})]})},eg=({errorPresetEnabled:o,onErrorPresetChange:i,ambientPercentage:a,onAmbientPercentageChange:l,onBack:r,onNext:s,submitting:d})=>{const p=v(),u=c(()=>R(o?{disabled:!1}:null),[o]);return e(n,{children:[t(vm,{title:Ei,onBack:r}),e(mm,{$width:854,children:[t(Om,{children:Oi}),e(ee,{$gap:8,$width:"100%",children:[e(Cm,{children:[t(Jm,{children:t(_e,{size:Te.XXS,color:p.v2.colors.silver[200],children:$i})}),t(wm,{items:[Ai,Ri,Di,_i,Pi]}),t(km,{message:Si})]}),e(Im,{children:[e(Nm,{children:[t(_e,{size:Te.S,weight:500,color:p.v2.colors.white[500],children:Li}),t(ml,{size:16,fill:p.v2.colors.silver[200]})]}),t(Em,{children:t(dm,{name:Ni,recommended:!0,toggleLabel:Ii,enabled:o,onEnabledChange:i,summary:u,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(Em,{children:t(Qm,{value:a,onChange:l,label:Fi})})]})]})]}),t(fm,{onNext:s,nextLoading:d})]})},tg=({isOpen:e,onClose:n,k8sHealthProbesConfig:o,samplingId:l,docsUrl:r})=>{const{samplingApi:s}=jl(),[c,p]=a("welcome"),[u,h]=a(!0),[m,g]=a("keep-list"),[f,b]=a(!0),[v,y]=a("25"),[C,S]=a(!1);i(()=>{e&&(p("welcome"),h(o?.enabled??!0),g("keep-list"),b(!0),y("25"),S(!1))},[e,o?.enabled]);const x=d(async()=>{const e=l??"default",t=[];if(u!==(o?.enabled??!1)){const e=s.updateK8sHealthProbesConfig;e&&t.push(e({enabled:u,keepPercentage:o?.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)}},[l,s,u,o?.enabled,o?.keepPercentage,m,f,v]);let w=null;switch(c){case"welcome":w=t(Lm,{onSkip:n,onNext:()=>p("noisy")});break;case"noisy":w=t(Am,{enabled:u,onEnabledChange:h,onBack:()=>p("welcome"),onNext:()=>p("strategy")});break;case"strategy":w=t(Gm,{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(eg,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"drop-list":w=t(Ym,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"advanced":w=t(Wm,{onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"success":w=t(Dm,{onClose:n})}return t(go,{isOpen:e,onClose:n,children:w})};var ng,og;(e=>{e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"})(ng||(ng={})),(e=>{e.K8s="k8s",e.VmAgent="vm-agent",e.CloudConnector="cloud-connector"})(og||(og={}));const ig=[{id:og.CloudConnector,label:"Cloud Connector"}];var ag;(e=>{e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"})(ag||(ag={}));const lg=[{key:ag.Name,label:"Name"},{key:ag.Type,label:"Type"},{key:ag.Status,label:"Status"},{key:ag.OdigosVersion,label:"Odigos Version"},{key:ag.ConnectedSince,label:"Connected Since"},{key:ag.LastActivity,label:"Last Activity"}],rg=(e,t)=>{const n=e.find(e=>e.key===ag.Id)?.rawValue;return t(n?.toString()||"")},sg={[Ee.Success]:"Connected",[Ee.Warning]:"Degraded",[Ee.Error]:"Error",[Ee.Disabled]:"Disabled",[Ee.Info]:"Pending"},cg={[Mi.K8s]:un.Purple,[Mi.Vm]:un.Blue,[Mi.Connector]:un.Green},dg=({connections:n,getConnections:o,onClickConnection:l,deleteConnection:r,onCreateNew:s,cloudConnectorProviders:p,onCreateCloudConnector:u,configMinSupportedVersion:h=0,snapshotMinSupportedVersion:m=0})=>{const g=v(),{formatTimeAgo:f}=on(),{capabilities:b}=jl(),[y,C]=a(!1),[S,x]=a(n||[]),w=d(async()=>{try{C(!0),x(await o()??[])}catch(e){}finally{C(!1)}},[]);i(()=>{S.length||w()},[]);const[T,k]=a(""),[I,N]=a(null),[E,O]=a([]),[$,A]=a(!1),[R,P]=a(!1),L=d(()=>{A(!1),P(!0),w()},[w]),F=d(e=>{e===og.CloudConnector?A(!0):s?.(e)},[s]),M=c(()=>I===ng.BulkConfig?h:I===ng.BulkSource?m:0,[I,h,m]),{supportedConnections:z,supportedConnectionIds:B}=c(()=>{const e=((e,t)=>e.filter(e=>{const n=e.status===Ee.Success,o=D(e.odigosVersion,t,e.type);return n&&o}))(S,M);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[S,M]);i(()=>{if(!I||I===ng.Delete)return;const e=E.filter(e=>!B.includes(e));e.length&&O(t=>t.filter(t=>!e.includes(t)))},[I,E.length,B.length]);const X=c(()=>S.filter(e=>!T||e.name.toLowerCase().includes(T.toLowerCase())).map(e=>({cells:[{key:ag.Id,rawValue:e.id},{key:ag.Name,rawValue:e.name},{key:ag.Type,rawValue:e.type,component:()=>t(tn,{variant:cg[e.type]??un.Default,label:zi(e.type)})},{key:ag.Status,rawValue:e.status,component:()=>(e=>{if(e.type===Mi.Connector){const n=sg[e.status]??"Pending",o=e.status===Ee.Success?Ya:e.status===Ee.Error?Ja:void 0;return t(Ke,{status:e.status,label:n,leftIcon:o})}const n=e.status===Ee.Success?"Connection live":"Connection lost",o=e.status===Ee.Success?Ya:Ja;return t(Ke,{status:e.status,label:n,leftIcon:o})})(e)},{key:ag.OdigosVersion,rawValue:e.odigosVersion},{key:ag.ConnectedSince,rawValue:e.connectedAt?f(e.connectedAt):"-"},{key:ag.LastActivity,rawValue:e.lastSeenAt?f(e.lastSeenAt):"-"}],onClick:e.status!==Ee.Success||I?void 0:()=>l(e),isSelected:E.includes(e.id),onSelect:()=>O(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>O(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==Ee.Success||I===ng.BulkConfig&&!D(e.odigosVersion,h,e.type)||I===ng.BulkSource&&!D(e.odigosVersion,m,e.type)})),[S,E,T,I,h,m,f,l]),U=c(()=>S.length>0&&S.every(e=>e.type===Mi.K8s),[S]),V=c(()=>{const e=(e,t)=>{O([e]),N(t)};return(e=>{const{connections:t,configMinSupportedVersion:n,snapshotMinSupportedVersion:o,onDelete:i,onAddSource:a,onAddDestination:l,onAddAction:r,onAddInstrumentationRule:s,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===ag.Status)?.rawValue===Ee.Success)(e))return[{id:mo(),label:"Delete Connection",rightIcon:za,onClick:()=>rg(e,i)}];const d=rg(e,e=>t.find(t=>t.id===e));if(d?.type!==Mi.K8s)return[];const p=!!d&&D(d.odigosVersion,n,d.type),u=!!d&&D(d.odigosVersion,o,d.type),h=_(n,d?.type),m=_(o,d?.type),g=[];return a&&g.push({id:mo(),tooltip:u?Ze.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${m} or later.`,rightIcon:Za,disabled:!u,onClick:()=>rg(e,a)}),l&&g.push({id:mo(),tooltip:Ze.ADD_DESTINATION,rightIcon:Ga,onClick:()=>rg(e,l)}),r&&g.push({id:mo(),tooltip:Ze.ADD_ACTION,rightIcon:ja,onClick:()=>rg(e,r)}),s&&g.push({id:mo(),tooltip:Ze.ADD_INSTRUMENTATION_RULE,rightIcon:qa,onClick:()=>rg(e,s)}),c&&g.push({id:mo(),tooltip:p?"Edit Configuration":`To use this feature, please upgrade to Odigos v${h} or later.`,rightIcon:cl,disabled:!p,onClick:()=>rg(e,c)}),g}})({connections:S,configMinSupportedVersion:h,snapshotMinSupportedVersion:m,onDelete:t=>e(t,ng.Delete),onAddSource:b.canFetchSnapshots&&b.canBulkPersistSources?t=>e(t,ng.BulkSource):void 0,onAddDestination:b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canCreateDestination?t=>e(t,ng.BulkDestination):void 0,onAddAction:b.canCreateAction?t=>e(t,ng.BulkAction):void 0,onAddInstrumentationRule:b.canCreateInstrumentationRule?t=>e(t,ng.BulkInstrumentationRule):void 0,onEditConfiguration:b.canApplyEffectiveConfig?t=>e(t,ng.BulkConfig):void 0})},[S,h,m,b]),H=c(()=>(e=>{const{onCancel:t,onAddSource:n,onAddDestination:o,onAddAction:i,onAddInstrumentationRule:a,onManageConfigurations:l}=e,r=[];n&&r.push({id:mo(),type:mn.Button,buttonProps:{variant:ve.Primary,size:be.S,label:"Add Sources",rightIcon:Za,onClick:n}});const s=[o?{id:ng.BulkDestination,label:Ze.ADD_DESTINATION,icon:Ga}:null,i?{id:ng.BulkAction,label:Ze.ADD_ACTION,icon:ja}:null,a?{id:ng.BulkInstrumentationRule,label:Ze.ADD_INSTRUMENTATION_RULE,icon:qa}:null,l?{id:ng.BulkConfig,label:"Manage Configurations",icon:cl}:null];return s.some(Boolean)&&r.push({id:mo(),type:mn.ButtonDropData,buttonProps:{variant:ve.Secondary,size:be.S,label:"Bulk Operations",onClick:e=>{e===ng.BulkSource?n?.():e===ng.BulkDestination?o?.():e===ng.BulkAction?i?.():e===ng.BulkInstrumentationRule?a?.():e===ng.BulkConfig&&l?.()}},dropDataProps:{alignX:ho.Left,items:s}}),r.push({id:mo(),type:mn.Button,buttonProps:{variant:ve.Text,size:be.S,label:Lt.CANCEL,onClick:t}}),r})({onCancel:()=>O([]),onAddSource:b.canFetchSnapshots&&b.canBulkPersistSources?()=>N(ng.BulkSource):void 0,onAddDestination:b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canCreateDestination?()=>N(ng.BulkDestination):void 0,onAddAction:b.canCreateAction?()=>N(ng.BulkAction):void 0,onAddInstrumentationRule:b.canCreateInstrumentationRule?()=>N(ng.BulkInstrumentationRule):void 0,onManageConfigurations:b.canApplyEffectiveConfig?()=>N(ng.BulkConfig):void 0}),[b]),j=c(()=>t(po,{items:ig,withMultiSelect:!1,selectedIds:[],setSelectedIds:e=>F(e[0]),buttonProps:{variant:ve.Primary,size:be.S,label:Lt.CREATE_NEW}}),[F]),G=c(()=>T.trim()&&S.length>0?{hideIcon:!0,title:Ze.NO_RESULTS,subTitle:Ze.NO_RESULTS_FOR_FILTER(T)}:{icon:_l,title:Ze.NO_CONNECTIONS,action:j},[T,S.length,j]);return t(Bi,{children:e(st,{fullHeight:!0,richTitle:{icon:_l,title:Ze.CONNECTIONS,badge:{label:S.length.toString(),status:Ee.Unknown}},search:{placeholder:"Search by cluster name",value:T,onChange:e=>k(e),width:"300px"},actions:[{id:"connections-refresh",type:mn.Button,buttonProps:{variant:ve.Secondary,size:be.S,leftIcon:sl,onClick:w,disabled:y}},{id:"connections-create-new",type:mn.ButtonDropData,buttonProps:{variant:ve.Primary,size:be.S,label:Lt.CREATE_NEW,onClick:e=>F(e)},dropDataProps:{alignX:ho.Right,items:ig}}],children:[t(Ln,{variant:Fn.Pretty,headerBackgroundColor:g.v2.colors.silver[1e3],isLoading:y,withCheckboxes:U,columns:lg,rows:X,noDataProps:G,rowActionsPushRightPosition:I?`calc(${Er} - 24px)`:void 0,getRowActions:V}),I===ng.BulkConfig&&b.canApplyEffectiveConfig&&t(ar,{connectionIds:E,children:t(lp,{onClose:()=>N(null),connections:z,selectedConnectionIds:E,setSelectedConnectionIds:O})}),I===ng.BulkSource&&b.canFetchSnapshots&&b.canBulkPersistSources&&t(ar,{connectionIds:E,children:t(lr,{selectedConnectionIds:E,children:t(Cc,{onClose:()=>N(null),selectedConnectionIds:E,setSelectedConnectionIds:O})})}),I===ng.BulkDestination&&b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canTestConnection&&b.canCreateDestination&&t(ar,{connectionIds:E,children:t(rr,{children:t(oc,{onClose:()=>N(null),selectedConnectionIds:E,setSelectedConnectionIds:O})})}),I===ng.BulkAction&&b.canCreateAction&&t(ar,{connectionIds:E,children:t(sr,{children:t(Ws,{onClose:()=>N(null),selectedConnectionIds:E,setSelectedConnectionIds:O})})}),I===ng.BulkInstrumentationRule&&b.canCreateInstrumentationRule&&t(ar,{connectionIds:E,children:t(cr,{children:t(ic,{onClose:()=>N(null),selectedConnectionIds:E,setSelectedConnectionIds:O})})}),$&&t(dr,{providers:p,children:t(np,{onClose:()=>A(!1),withOverlay:!0,onCreateCloudConnector:u,onCreated:L})}),t(Dr,{isOpen:R,onClose:()=>P(!1)}),t($r,{target:"connection",isOpen:I===ng.Delete,onClose:()=>{O([]),N(null)},onApprove:async()=>{const e=E[0];e&&(await r(e),await w())}}),t(Mn,{isOpen:!!E.length&&!I,richTitle:{icon:La,title:"Selected Clusters",badge:{label:E.length}},actions:H})]})})},pg=b.div`
978
978
  display: flex;
979
979
  align-items: center;
980
980
  justify-content: space-between;
@@ -983,26 +983,26 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
983
983
  width: 100%;
984
984
  border-radius: 16px;
985
985
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
986
- `,cg=b.div`
986
+ `,ug=b.div`
987
987
  display: flex;
988
988
  align-items: center;
989
989
  justify-content: center;
990
990
  padding: 8px;
991
991
  border-radius: 8px;
992
992
  background-color: ${({theme:e})=>e.v2.colors.white[500]+dt["004"]};
993
- `,dg=({setStep:n,onSave:o,sourcesPayload:i,destinationsPayload:a,disableAnimation:l})=>{const r=v(),s=()=>n(2),d=()=>n(3),p=c(()=>Object.values(i||{}).flatMap((n,o)=>n.map((n,i)=>{if(!n.selected)return null;const a=n.kind||kt.Namespace,l=a===kt.Namespace?n.namespace:`${n.namespace} → ${n.name}`;return e(sg,{children:[t(_e,{nowrap:!0,children:l}),t(Ke,{label:a,status:Ee.Info,backgroundColor:r.v2.colors.blue[900]})]},`source-${o}-${i}`)})).filter(Boolean),[i]),u=c(()=>a?.map((n,o)=>{const i=St(n.option.type).icon;return e(sg,{children:[e(pe,{$gap:8,children:[i&&t(cg,{children:t(i,{size:24})}),t(_e,{nowrap:!0,children:n.formData.name||n.option.displayName})]}),void 0!==n.testResult&&t(Ke,{status:n.testResult.succeeded?Ee.Success:Ee.Error,leftIcon:n.testResult.succeeded?Wa:Ka})]},`destination-${o}`)})||[],[a]);return t(kr,{isOpen:!0,disableAnimation:l,onBack:()=>n(3),onSave:o,header:{icon:cl,title:Ze.SUMMARY,subTitle:Ze.REVIEW_SETUP},leftColumn:{width:"50%",header:e(pe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(pe,{$gap:8,children:[t(Ja,{size:24}),t(_e,{nowrap:!0,children:Ze.SELECTED_SOURCES}),t(Ke,{label:p.length})]}),t(fe,{"data-id":"summary-edit-sources",leftIcon:Ma,variant:ve.Secondary,size:be.S,onClick:s})]}),list:p.length?p:[t(mt,{$height:"100%",children:t(xe,{icon:Ja,title:Ze.NO_SOURCES_SELECTED,subTitle:Ze.ADD_SOURCE_PROMPT,button:{leftIcon:Ra,label:Ze.ADD_SOURCE,onClick:s}})},"no-sources-data")]},rightColumn:{width:"50%",header:e(pe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(pe,{$gap:8,children:[t(Ha,{size:24}),t(_e,{nowrap:!0,children:Ze.SELECTED_DESTINATIONS}),t(Ke,{label:u.length})]}),t(fe,{"data-id":"summary-edit-destinations",leftIcon:Ma,variant:ve.Secondary,size:be.S,onClick:d})]}),list:u.length?u:[t(mt,{"data-id":"summary-no-destinations",$height:"100%",children:t(xe,{icon:Ha,title:Ze.NO_DESTINATIONS_SELECTED,subTitle:Ze.ADD_DESTINATION_PROMPT,button:{leftIcon:Ra,label:Ze.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},pg=b.div`
993
+ `,hg=({setStep:n,onSave:o,sourcesPayload:i,destinationsPayload:a,disableAnimation:l})=>{const r=v(),s=()=>n(2),d=()=>n(3),p=c(()=>Object.values(i||{}).flatMap((n,o)=>n.map((n,i)=>{if(!n.selected)return null;const a=n.kind||kt.Namespace,l=a===kt.Namespace?n.namespace:`${n.namespace} → ${n.name}`;return e(pg,{children:[t(_e,{nowrap:!0,children:l}),t(Ke,{label:a,status:Ee.Info,backgroundColor:r.v2.colors.blue[900]})]},`source-${o}-${i}`)})).filter(Boolean),[i]),u=c(()=>a?.map((n,o)=>{const i=St(n.option.type).icon;return e(pg,{children:[e(pe,{$gap:8,children:[i&&t(ug,{children:t(i,{size:24})}),t(_e,{nowrap:!0,children:n.formData.name||n.option.displayName})]}),void 0!==n.testResult&&t(Ke,{status:n.testResult.succeeded?Ee.Success:Ee.Error,leftIcon:n.testResult.succeeded?Ya:Ja})]},`destination-${o}`)})||[],[a]);return t(Nr,{isOpen:!0,disableAnimation:l,onBack:()=>n(3),onSave:o,header:{icon:pl,title:Ze.SUMMARY,subTitle:Ze.REVIEW_SETUP},leftColumn:{width:"50%",header:e(pe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(pe,{$gap:8,children:[t(Za,{size:24}),t(_e,{nowrap:!0,children:Ze.SELECTED_SOURCES}),t(Ke,{label:p.length})]}),t(fe,{"data-id":"summary-edit-sources",leftIcon:Ba,variant:ve.Secondary,size:be.S,onClick:s})]}),list:p.length?p:[t(mt,{$height:"100%",children:t(xe,{icon:Za,title:Ze.NO_SOURCES_SELECTED,subTitle:Ze.ADD_SOURCE_PROMPT,button:{leftIcon:_a,label:Ze.ADD_SOURCE,onClick:s}})},"no-sources-data")]},rightColumn:{width:"50%",header:e(pe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(pe,{$gap:8,children:[t(Ga,{size:24}),t(_e,{nowrap:!0,children:Ze.SELECTED_DESTINATIONS}),t(Ke,{label:u.length})]}),t(fe,{"data-id":"summary-edit-destinations",leftIcon:Ba,variant:ve.Secondary,size:be.S,onClick:d})]}),list:u.length?u:[t(mt,{"data-id":"summary-no-destinations",$height:"100%",children:t(xe,{icon:Ga,title:Ze.NO_DESTINATIONS_SELECTED,subTitle:Ze.ADD_DESTINATION_PROMPT,button:{leftIcon:_a,label:Ze.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},mg=b.div`
994
994
  position: relative;
995
995
  overflow: hidden;
996
996
  width: 100vw;
997
997
  height: 100vh;
998
998
  box-sizing: border-box;
999
- `,ug=b.svg`
999
+ `,gg=b.svg`
1000
1000
  position: absolute;
1001
1001
  top: 50%;
1002
1002
  left: 50%;
1003
1003
  transform: translate(-50%, -50%);
1004
1004
  z-index: -1;
1005
- `,hg=[{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"}],mg=[{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:hg},{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:hg},{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:hg}],gg=({paddingXAxis:n="0px",paddingYAxis:o="0px",children:l})=>{const[r,s]=a(window.innerWidth),d=c(()=>r/mg[0].width,[r]);return i(()=>{const e=()=>s(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(pg,{$paddingXAxis:n,$paddingYAxis:o,children:[mg.map(({width:n,height:o,pathOpacity:i,path:a,gradientTransform:l,stops:r},s)=>{const c=`purple-ring-${s}`;return e(ug,{width:n*d,height:"100%",viewBox:`0 0 ${n} ${o}`,fill:"none",children:[t("path",{opacity:i,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},o)=>t("stop",{offset:e,stopColor:"#7C3BFF",stopOpacity:n},o))})})]},c)}),l]})},fg=b.div`
1005
+ `,fg=[{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"}],bg=[{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:fg},{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:fg},{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:fg}],vg=({paddingXAxis:n="0px",paddingYAxis:o="0px",children:l})=>{const[r,s]=a(window.innerWidth),d=c(()=>r/bg[0].width,[r]);return i(()=>{const e=()=>s(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(mg,{$paddingXAxis:n,$paddingYAxis:o,children:[bg.map(({width:n,height:o,pathOpacity:i,path:a,gradientTransform:l,stops:r},s)=>{const c=`purple-ring-${s}`;return e(gg,{width:n*d,height:"100%",viewBox:`0 0 ${n} ${o}`,fill:"none",children:[t("path",{opacity:i,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},o)=>t("stop",{offset:e,stopColor:"#7C3BFF",stopOpacity:n},o))})})]},c)}),l]})},yg=b.div`
1006
1006
  display: flex;
1007
1007
  flex-direction: column;
1008
1008
  align-items: center;
@@ -1013,7 +1013,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1013
1013
  width: 50vw;
1014
1014
  border-radius: 16px;
1015
1015
  background: ${({theme:e})=>e.v2.colors.silver[900]};
1016
- `,bg=b.div`
1016
+ `,Cg=b.div`
1017
1017
  display: flex;
1018
1018
  flex-direction: column;
1019
1019
  align-items: center;
@@ -1023,15 +1023,15 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1023
1023
  & * {
1024
1024
  text-align: center;
1025
1025
  }
1026
- `,vg=({onStart:n})=>t(Mt,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(mt,{$height:"100%",children:e(fg,{children:[e(bg,{children:[t(_e,{size:Te.L,weight:500,children:Ze.GET_STARTED_WITH}),t($r,{size:260}),t(_e,{size:Te.S,weight:400,children:Ze.GET_STARTED_DESCRIPTION})]}),t(fe,{"data-id":"onboarding-get-started",label:Lt.GET_STARTED,rightIcon:Da,size:be.L,onClick:n})]})})}),yg=[{step:1,label:Ze.INSTALLATION,forceDoneBadge:!0},{step:2,label:Ze.SOURCES_SETUP},{step:3,label:Ze.DESTINATIONS_SETUP},{step:4,label:Ze.SUMMARY}],Cg=b.div`
1026
+ `,Sg=({onStart:n})=>t(Mt,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(mt,{$height:"100%",children:e(yg,{children:[e(Cg,{children:[t(_e,{size:Te.L,weight:500,children:Ze.GET_STARTED_WITH}),t(Rr,{size:260}),t(_e,{size:Te.S,weight:400,children:Ze.GET_STARTED_DESCRIPTION})]}),t(fe,{"data-id":"onboarding-get-started",label:Lt.GET_STARTED,rightIcon:Pa,size:be.L,onClick:n})]})})}),xg=[{step:1,label:Ze.INSTALLATION,forceDoneBadge:!0},{step:2,label:Ze.SOURCES_SETUP},{step:3,label:Ze.DESTINATIONS_SETUP},{step:4,label:Ze.SUMMARY}],wg=b.div`
1027
1027
  display: flex;
1028
1028
  flex-direction: column;
1029
1029
  gap: 32px;
1030
1030
  padding: 64px;
1031
- `,Sg=({pagePaddingXAxis:n,pagePaddingYAxis:o,onDone:i})=>{const{setDrawerType:l}=fn(),{sourcesApi:r,destinationsApi:s}=Vl(),[c,d]=a(1),[p,u]=a(!1),[h,m]=a(null),[g,f]=a(null),b=()=>d(e=>e+1),v=()=>d(e=>e-1);return e(gg,{paddingXAxis:n,paddingYAxis:o,children:[e(Cg,{children:[t($r,{useInline:!0}),t(Bi,{currentStep:c,data:yg,gap:32})]}),t(ir,{initialInputs:h,children:e(ar,{children:[1===c&&t(vg,{onStart:b}),2===c&&t(vc,{disableAnimation:!0,onBack:e=>{m(e),v()},onNext:e=>{m(e),b()}}),3===c&&t(tc,{disableAnimation:!0,onBack:e=>{f(e),v()},onNext:e=>{f(e),b()},initialInputs:g}),4===c&&t(dg,{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")};l(go.OnboardingDone),i()}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)),wg=e=>e.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,e=>e.toUpperCase()),Tg=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},kg=b.div`
1031
+ `,Tg=({pagePaddingXAxis:n,pagePaddingYAxis:o,onDone:i})=>{const{setDrawerType:l}=bn(),{sourcesApi:r,destinationsApi:s}=jl(),[c,d]=a(1),[p,u]=a(!1),[h,m]=a(null),[g,f]=a(null),b=()=>d(e=>e+1),v=()=>d(e=>e-1);return e(vg,{paddingXAxis:n,paddingYAxis:o,children:[e(wg,{children:[t(Rr,{useInline:!0}),t(Xi,{currentStep:c,data:xg,gap:32})]}),t(lr,{initialInputs:h,children:e(rr,{children:[1===c&&t(Sg,{onStart:b}),2===c&&t(Cc,{disableAnimation:!0,onBack:e=>{m(e),v()},onNext:e=>{m(e),b()}}),3===c&&t(oc,{disableAnimation:!0,onBack:e=>{f(e),v()},onNext:e=>{f(e),b()},initialInputs:g}),4===c&&t(hg,{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")};l(fo.OnboardingDone),i()}catch(e){return u(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:h,destinationsPayload:g})]})})]})},kg=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),Ig=e=>e.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,e=>e.toUpperCase()),Ng=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},Eg=b.div`
1032
1032
  position: relative;
1033
1033
  display: inline-flex;
1034
- `,Ig=b.button`
1034
+ `,Og=b.button`
1035
1035
  display: inline-flex;
1036
1036
  align-items: center;
1037
1037
  gap: 8px;
@@ -1044,7 +1044,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1044
1044
  &:hover {
1045
1045
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
1046
1046
  }
1047
- `,Ng=b.div`
1047
+ `,$g=b.div`
1048
1048
  position: absolute;
1049
1049
  top: calc(100% + 8px);
1050
1050
  right: 0;
@@ -1057,25 +1057,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1057
1057
  border-radius: 12px;
1058
1058
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1059
1059
  box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
1060
- `,Eg=b.div`
1060
+ `,Ag=b.div`
1061
1061
  display: flex;
1062
1062
  flex-direction: column;
1063
1063
  gap: 12px;
1064
1064
  padding: 16px;
1065
1065
  max-height: 60vh;
1066
1066
  overflow-y: auto;
1067
- `,Og=b.div`
1067
+ `,Rg=b.div`
1068
1068
  display: flex;
1069
1069
  align-items: center;
1070
1070
  gap: 8px;
1071
1071
  padding: 12px 16px;
1072
1072
  border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
1073
- `,$g=b.div`
1073
+ `,Dg=b.div`
1074
1074
  display: flex;
1075
1075
  align-items: center;
1076
1076
  gap: 8px;
1077
1077
  margin-left: auto;
1078
- `,Ag=()=>{const n=v(),{sourcesApi:o,namespacesApi:l,capabilities:r}=Vl(),{isK8s:s,isVm:d,isConnector:u}=r,h=s?"k8s":d?"vm":"connector",m=o.useSources().items,g=l.useNamespaces().items,{selectedStreamName:f}=Qe(),{getItemSS:b,setItemSS:y,removeItemSS:C}=Gi(),{statuses:S,namespaces:x,regions:w,kinds:T,monitors:k,languages:I,onlyErrors:N,podsAgentInjectionStatus:E,setAll:O,clearFilters:$,getEmptyState:A}=Xi(),R=c(()=>Ui(m,f),[m,f]);i(()=>{const e=b(Vi.OVERVIEW_FILTERS,A());O(e)},[]);const[D,_]=a({statuses:S,namespaces:x,regions:w,kinds:T,monitors:k,languages:I,onlyErrors:N,podsAgentInjectionStatus:E}),[P,L]=a(Tg(D)),[F,M]=a(!1),z=p(h);i(()=>{if(!F){const e={statuses:S,namespaces:x,regions:w,kinds:T,monitors:k,languages:I,onlyErrors:N,podsAgentInjectionStatus:E};_(e),L(Tg(e))}},[F,S,x,w,T,k,I,N,E]),i(()=>{z.current!==h&&(z.current=h,C(Vi.OVERVIEW_FILTERS),$(),_(A()),L(0),M(!1))},[h]);const B=p(null);En(B,()=>M(!1)),ro({key:"Escape",active:F},()=>M(!1));const X=c(()=>{const e=new Set,t=[];return g.forEach(({name:n})=>{e.has(n)||(e.add(n),t.push({id:n,label:n,withCheckbox:!0}))}),t},[g]),U=c(()=>{const e=new Set,t=[];return R.forEach(({id:n})=>{const{kind:o}=n;e.has(o)||(e.add(o),t.push({id:o,label:wn(o),withCheckbox:!0}))}),t},[R]),V=c(()=>{const e=new Set,t=[];return R.forEach(({id:n})=>{const o=n.region?.trim();o&&!e.has(o)&&(e.add(o),t.push({id:o,label:o,withCheckbox:!0}))}),t.sort((e,t)=>e.id.localeCompare(t.id))},[R]),H=c(()=>{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:Hi[n]||n,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[R]),j=c(()=>ji.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),G=c(()=>{const e=new Set,t=[];return R.forEach(({instrumentationReport:n})=>{const o=n?.state||n?.progressStage;o&&!e.has(o)&&(e.add(o),t.push({id:o,label:wg(o),withCheckbox:!0}))}),t.sort((e,t)=>e.label.localeCompare(t.label))},[R]),W=c(()=>{const e=new Set,t=[];return R.forEach(({podsAgentInjectionStatus:n})=>{const{reasonEnum:o,message:i}=n||{};if(o){if(e.has(o))return;e.add(o),t.push({id:o,label:on(o),withCheckbox:!0})}else if(i){if(e.has(i))return;e.add(i),t.push({id:i,label:i,withCheckbox:!0})}}),t},[R]),K=(e,t,n)=>{const o=t.filter(e=>n.includes(e.id));_(t=>{return{...t,[e]:(n=o,n.map(({id:e,label:t})=>({id:e,label:t})))};var n})},Y=F?ja:Ga,J=c(()=>xg(D.languages),[D.languages]);return e(kg,{ref:B,children:[e(Ig,{"data-id":"filters-trigger",$isOpen:F,type:"button",onClick:()=>M(e=>!e),children:[t(Dl,{size:16,fill:n.v2.colors.white[500]}),t(_e,{size:Te.XS,weight:500,nowrap:!0,children:"Filters"}),P>0&&t(Ke,{label:P,status:Ee.Unknown,textSize:Te.XXXS}),t(Y,{size:16,fill:n.v2.colors.silver[200]})]}),F&&e(Ng,{children:[e(Eg,{children:[s&&t(ft,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!X.length,options:X,values:xg(D.namespaces),setValues:e=>K("namespaces",X,e)}),u&&t(ft,{label:"Region",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!V.length,options:V,values:xg(D.regions),setValues:e=>K("regions",V,e)}),t(ft,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!U.length,options:U,values:xg(D.kinds),setValues:e=>K("kinds",U,e)}),t(ft,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!H.length,options:H,values:J,setValues:e=>K("languages",H,e)}),t(ft,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!j.length,options:j,values:xg(D.monitors),setValues:e=>K("monitors",j,e)}),t(ft,s?{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!W.length,options:W,values:xg(D.podsAgentInjectionStatus),setValues:e=>K("podsAgentInjectionStatus",W,e)}:{label:"Instrumentation Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!G.length,options:G,values:xg(D.statuses),setValues:e=>K("statuses",G,e)}),t(le,{label:"Show only sources with errors",size:Nt.L,value:!!D.onlyErrors,onChange:e=>_(t=>({...t,onlyErrors:e}))})]}),e(Og,{children:[t(fe,{"data-id":"filters-reset",size:be.S,variant:ve.Text,label:"Reset",onClick:()=>{C(Vi.OVERVIEW_FILTERS),$(),_(A()),L(0),M(!1)},textColor:n.v2.colors.red[500]}),e($g,{children:[t(fe,{"data-id":"filters-cancel",size:be.S,variant:ve.Secondary,label:"Cancel",onClick:()=>M(!1)}),t(fe,{"data-id":"filters-apply",size:be.S,variant:ve.Primary,label:"Apply",onClick:()=>{y(Vi.OVERVIEW_FILTERS,D),O(D),L(Tg(D)),M(!1)}})]})]})]})]})},Rg=b.div`
1078
+ `,_g=()=>{const n=v(),{sourcesApi:o,namespacesApi:l,capabilities:r}=jl(),{isK8s:s,isVm:d,isConnector:u}=r,h=s?"k8s":d?"vm":"connector",m=o.useSources().items,g=l.useNamespaces().items,{selectedStreamName:f}=Qe(),{getItemSS:b,setItemSS:y,removeItemSS:C}=Wi(),{statuses:S,namespaces:x,regions:w,kinds:T,monitors:k,languages:I,onlyErrors:N,podsAgentInjectionStatus:E,setAll:O,clearFilters:$,getEmptyState:A}=Ui(),R=c(()=>Vi(m,f),[m,f]);i(()=>{const e=b(Hi.OVERVIEW_FILTERS,A());O(e)},[]);const[D,_]=a({statuses:S,namespaces:x,regions:w,kinds:T,monitors:k,languages:I,onlyErrors:N,podsAgentInjectionStatus:E}),[P,L]=a(Ng(D)),[F,M]=a(!1),z=p(h);i(()=>{if(!F){const e={statuses:S,namespaces:x,regions:w,kinds:T,monitors:k,languages:I,onlyErrors:N,podsAgentInjectionStatus:E};_(e),L(Ng(e))}},[F,S,x,w,T,k,I,N,E]),i(()=>{z.current!==h&&(z.current=h,C(Hi.OVERVIEW_FILTERS),$(),_(A()),L(0),M(!1))},[h]);const B=p(null);On(B,()=>M(!1)),so({key:"Escape",active:F},()=>M(!1));const X=c(()=>{const e=new Set,t=[];return g.forEach(({name:n})=>{e.has(n)||(e.add(n),t.push({id:n,label:n,withCheckbox:!0}))}),t},[g]),U=c(()=>{const e=new Set,t=[];return R.forEach(({id:n})=>{const{kind:o}=n;e.has(o)||(e.add(o),t.push({id:o,label:Tn(o),withCheckbox:!0}))}),t},[R]),V=c(()=>{const e=new Set,t=[];return R.forEach(({id:n})=>{const o=n.region?.trim();o&&!e.has(o)&&(e.add(o),t.push({id:o,label:o,withCheckbox:!0}))}),t.sort((e,t)=>e.id.localeCompare(t.id))},[R]),H=c(()=>{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:ji[n]||n,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[R]),j=c(()=>Gi.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),G=c(()=>{const e=new Set,t=[];return R.forEach(({instrumentationReport:n})=>{const o=n?.state||n?.progressStage;o&&!e.has(o)&&(e.add(o),t.push({id:o,label:Ig(o),withCheckbox:!0}))}),t.sort((e,t)=>e.label.localeCompare(t.label))},[R]),W=c(()=>{const e=new Set,t=[];return R.forEach(({podsAgentInjectionStatus:n})=>{const{reasonEnum:o,message:i}=n||{};if(o){if(e.has(o))return;e.add(o),t.push({id:o,label:Bt(o),withCheckbox:!0})}else if(i){if(e.has(i))return;e.add(i),t.push({id:i,label:i,withCheckbox:!0})}}),t},[R]),K=(e,t,n)=>{const o=t.filter(e=>n.includes(e.id));_(t=>{return{...t,[e]:(n=o,n.map(({id:e,label:t})=>({id:e,label:t})))};var n})},Y=F?Wa:Ka,J=c(()=>kg(D.languages),[D.languages]);return e(Eg,{ref:B,children:[e(Og,{"data-id":"filters-trigger",$isOpen:F,type:"button",onClick:()=>M(e=>!e),children:[t(Pl,{size:16,fill:n.v2.colors.white[500]}),t(_e,{size:Te.XS,weight:500,nowrap:!0,children:"Filters"}),P>0&&t(Ke,{label:P,status:Ee.Unknown,textSize:Te.XXXS}),t(Y,{size:16,fill:n.v2.colors.silver[200]})]}),F&&e($g,{children:[e(Ag,{children:[s&&t(ft,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!X.length,options:X,values:kg(D.namespaces),setValues:e=>K("namespaces",X,e)}),u&&t(ft,{label:"Region",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!V.length,options:V,values:kg(D.regions),setValues:e=>K("regions",V,e)}),t(ft,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!U.length,options:U,values:kg(D.kinds),setValues:e=>K("kinds",U,e)}),t(ft,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!H.length,options:H,values:J,setValues:e=>K("languages",H,e)}),t(ft,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!j.length,options:j,values:kg(D.monitors),setValues:e=>K("monitors",j,e)}),t(ft,s?{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!W.length,options:W,values:kg(D.podsAgentInjectionStatus),setValues:e=>K("podsAgentInjectionStatus",W,e)}:{label:"Instrumentation Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!G.length,options:G,values:kg(D.statuses),setValues:e=>K("statuses",G,e)}),t(le,{label:"Show only sources with errors",size:Nt.L,value:!!D.onlyErrors,onChange:e=>_(t=>({...t,onlyErrors:e}))})]}),e(Rg,{children:[t(fe,{"data-id":"filters-reset",size:be.S,variant:ve.Text,label:"Reset",onClick:()=>{C(Hi.OVERVIEW_FILTERS),$(),_(A()),L(0),M(!1)},textColor:n.v2.colors.red[500]}),e(Dg,{children:[t(fe,{"data-id":"filters-cancel",size:be.S,variant:ve.Secondary,label:"Cancel",onClick:()=>M(!1)}),t(fe,{"data-id":"filters-apply",size:be.S,variant:ve.Primary,label:"Apply",onClick:()=>{y(Hi.OVERVIEW_FILTERS,D),O(D),L(Ng(D)),M(!1)}})]})]})]})]})},Pg=b.div`
1079
1079
  position: relative;
1080
1080
  display: flex;
1081
1081
  align-items: center;
@@ -1086,7 +1086,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1086
1086
  box-sizing: border-box;
1087
1087
  border-radius: 16px 16px 0 0;
1088
1088
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
1089
- `,Dg=b.div`
1089
+ `,Lg=b.div`
1090
1090
  position: absolute;
1091
1091
  bottom: 0;
1092
1092
  left: 0;
@@ -1095,7 +1095,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1095
1095
  background-color: ${({theme:e})=>e.v2.colors.purple[500]};
1096
1096
  border-radius: 32px;
1097
1097
  transition: width 0.3s;
1098
- `,_g=({entityType:n,badge:o,badgeTooltip:i,isLoading:a,refetch:l,partiallySelected:r,allSelected:s,onSelectAll:c,progressPercent:d})=>{const{setDrawerType:p}=fn();return e(Rg,{children:[e(pe,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(ne,{size:Wi.S,partiallyChecked:r,value:!!s,onChange:c}),t(_e,{size:Te.S,nowrap:!0,children:`${on(n)}s`}),t(Ke,{label:o,tooltip:i,status:Ee.Unknown,textSize:Te.XXXS})]}),e(pe,{children:[t(bt,{"data-id":`add-${n}`,icon:Ra,onClick:()=>p(Ki(n))}),t(bt,{"data-id":`refresh-${n}`,icon:ll,onClick:l,disabled:a})]}),"number"==typeof d&&t(Dg,{$percent:d})]})},Pg=b(ee)`
1098
+ `,Fg=({entityType:n,badge:o,badgeTooltip:i,isLoading:a,refetch:l,partiallySelected:r,allSelected:s,onSelectAll:c,progressPercent:d})=>{const{setDrawerType:p}=bn();return e(Pg,{children:[e(pe,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(ne,{size:Ki.S,partiallyChecked:r,value:!!s,onChange:c}),t(_e,{size:Te.S,nowrap:!0,children:`${Bt(n)}s`}),t(Ke,{label:o,tooltip:i,status:Ee.Unknown,textSize:Te.XXXS})]}),e(pe,{children:[t(bt,{"data-id":`add-${n}`,icon:_a,onClick:()=>p(Yi(n))}),t(bt,{"data-id":`refresh-${n}`,icon:sl,onClick:l,disabled:a})]}),"number"==typeof d&&t(Lg,{$percent:d})]})},Mg=b(ee)`
1099
1099
  align-items: center !important;
1100
1100
  justify-content: center !important;
1101
1101
  align-self: stretch;
@@ -1110,7 +1110,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1110
1110
  &:hover {
1111
1111
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
1112
1112
  }
1113
- `,Lg=({entityType:n,description:o})=>{const{setDrawerType:i}=fn();return e(Pg,{onClick:()=>i(Ki(n)),children:[e(pe,{$gap:4,children:[t(Ra,{size:16}),t(_e,{size:Te.S,children:`Add ${on(n)}`})]}),t(_e,{size:Te.XXS,align:"center",children:o})]})},Fg=b.div`
1113
+ `,zg=({entityType:n,description:o})=>{const{setDrawerType:i}=bn();return e(Mg,{onClick:()=>i(Yi(n)),children:[e(pe,{$gap:4,children:[t(_a,{size:16}),t(_e,{size:Te.S,children:`Add ${Bt(n)}`})]}),t(_e,{size:Te.XXS,align:"center",children:o})]})},Bg=b.div`
1114
1114
  display: flex;
1115
1115
  align-items: center;
1116
1116
  gap: 12px;
@@ -1125,10 +1125,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1125
1125
  &:hover {
1126
1126
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
1127
1127
  }
1128
- `,Mg=b(pe)`
1128
+ `,Xg=b(pe)`
1129
1129
  flex: 1;
1130
1130
  min-width: 0;
1131
- `,zg=({entityId:n,entityType:o,title:i,status:a,faded:l,tooltip:r,throughput:s,icon:d,icons:p,iconSrc:u,isActive:h,raw:m})=>{const g=v(),f=o===kt.Source,b="boolean"==typeof h,y=l||b&&!h,{setDrawerType:C,setDrawerEntityId:S}=fn(),{selectedSources:x,setSelectedSources:w}=Yi(),T=m,k=f?T.id.namespace:"",I=c(()=>{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?Nn(Ee.Info,g):a?Nn(a,g):void 0,E=f&&"object"==typeof n?`${n.namespace}-${n.name}-${n.kind}${n.region?`-${n.region}`:""}`:n;return e(Fg,{"data-id":E,$faded:y,onClick:()=>{C(Sn(o)),S(n)},children:[f&&t(ne,{size:Wi.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(Cn,{icons:p,icon:d,iconSrc:u}),e(Mg,{$gap:4,children:[t(we,{size:Te.XS,nowrap:!0,children:i}),t(pe,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:s&&t(Fe,{text:r||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:t(Ke,{label:s,status:a&&[Ee.Error,Ee.Warning].includes(a)?a:Ee.Unknown,leftIcon:N,textSize:Te.XXXS})})})]})]})};function Bg(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===Ee.Loading)?e:{...e,workloadOdigosHealthStatus:{status:an.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function Xg(e){const t=Object.values(e.conditions??{}).filter(Boolean),n=t.filter(({status:e})=>e!==Ee.Loading);return n?.length===t?.length?e:{...e,conditions:n?.length?n.reduce((e,t)=>(e[t.name]=t,e),{}):{}}}const Ug=b.div`
1131
+ `,Ug=({entityId:n,entityType:o,title:i,status:a,faded:l,tooltip:r,throughput:s,icon:d,icons:p,iconSrc:u,isActive:h,raw:m})=>{const g=v(),f=o===kt.Source,b="boolean"==typeof h,y=l||b&&!h,{setDrawerType:C,setDrawerEntityId:S}=bn(),{selectedSources:x,setSelectedSources:w}=Ji(),T=m,k=f?T.id.namespace:"",I=c(()=>{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?En(Ee.Info,g):a?En(a,g):void 0,E=f&&"object"==typeof n?`${n.namespace}-${n.name}-${n.kind}${n.region?`-${n.region}`:""}`:n;return e(Bg,{"data-id":E,$faded:y,onClick:()=>{C(xn(o)),S(n)},children:[f&&t(ne,{size:Ki.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(Sn,{icons:p,icon:d,iconSrc:u}),e(Xg,{$gap:4,children:[t(we,{size:Te.XS,nowrap:!0,children:i}),t(pe,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:s&&t(Fe,{text:r||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:t(Ke,{label:s,status:a&&[Ee.Error,Ee.Warning].includes(a)?a:Ee.Unknown,leftIcon:N,textSize:Te.XXXS})})})]})]})};function Vg(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===Ee.Loading)?e:{...e,workloadOdigosHealthStatus:{status:rn.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function Hg(e){const t=Object.values(e.conditions??{}).filter(Boolean),n=t.filter(({status:e})=>e!==Ee.Loading);return n?.length===t?.length?e:{...e,conditions:n?.length?n.reduce((e,t)=>(e[t.name]=t,e),{}):{}}}const jg=b.div`
1132
1132
  position: absolute;
1133
1133
  top: 0;
1134
1134
  left: 0;
@@ -1139,21 +1139,21 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1139
1139
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1140
1140
  border-bottom: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
1141
1141
  pointer-events: none;
1142
- `,Vg=b.div`
1142
+ `,Gg=b.div`
1143
1143
  display: flex;
1144
1144
  align-items: center;
1145
1145
  gap: 8px;
1146
1146
  padding: 4px 8px 0;
1147
- `,Hg=b.div`
1147
+ `,Wg=b.div`
1148
1148
  flex: 1;
1149
1149
  height: 1px;
1150
1150
  background: ${({theme:e})=>e.v2.colors.silver[700]};
1151
- `,jg=({namespace:e})=>{const n=v();return t(Ug,{children:t(_e,{size:Te.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:e})})},Gg=({namespace:n})=>{const o=v();return e(Vg,{children:[t(Hg,{}),t(_e,{size:Te.XXS,nowrap:!0,color:o.v2.colors.grey[300],children:n}),t(Hg,{})]})},Wg={[kt.InstrumentationRule]:Ze.NO_DATA_INSTRUMENTATION_RULES,[kt.Source]:Ze.NO_DATA_SOURCES,[kt.Action]:Ze.NO_DATA_ACTIONS,[kt.Destination]:Ze.NO_DATA_DESTINATIONS},Kg=b.div`
1151
+ `,Kg=({namespace:e})=>{const n=v();return t(jg,{children:t(_e,{size:Te.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:e})})},Yg=({namespace:n})=>{const o=v();return e(Gg,{children:[t(Wg,{}),t(_e,{size:Te.XXS,nowrap:!0,color:o.v2.colors.grey[300],children:n}),t(Wg,{})]})},Jg={[kt.InstrumentationRule]:Ze.NO_DATA_INSTRUMENTATION_RULES,[kt.Source]:Ze.NO_DATA_SOURCES,[kt.Action]:Ze.NO_DATA_ACTIONS,[kt.Destination]:Ze.NO_DATA_DESTINATIONS},qg=b.div`
1152
1152
  display: flex;
1153
1153
  flex-direction: column;
1154
1154
  flex: 1 0 0;
1155
1155
  min-width: 0;
1156
- `,Yg=b.div`
1156
+ `,Zg=b.div`
1157
1157
  display: flex;
1158
1158
  flex-direction: column;
1159
1159
  align-items: stretch;
@@ -1163,7 +1163,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1163
1163
  border-radius: 0 0 16px 16px;
1164
1164
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
1165
1165
  overflow: hidden;
1166
- `,Jg=b.div`
1166
+ `,Qg=b.div`
1167
1167
  position: relative;
1168
1168
  display: flex;
1169
1169
  flex-direction: column;
@@ -1175,7 +1175,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1175
1175
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1176
1176
  height: ${({$height:e})=>e}px;
1177
1177
  overflow: hidden;
1178
- `,qg=({entityType:n,entities:o,unfilteredCount:l,metrics:r,loading:s,maxHeight:p,refetch:u})=>{const h=n===kt.Source,m=o.length!==l,g=Ot(e=>h?e.progress[Rt.Instrumenting]?.percentage:void 0),f=Ot(e=>h?e.progress[Rt.Uninstrumenting]?.percentage:void 0),b=!h||void 0===g&&void 0===f?void 0:g||f||0,{selectedSources:v,setSelectedSources:y}=Yi(),C=c(()=>h?Object.values(v).reduce((e,t)=>e+t.length,0):0,[h,v]),S=c(()=>{if(!r)return;const e=new Map,t=n===kt.Source?r.sources:n===kt.Destination?r.destinations:void 0;if(t)for(const n of t)e.set(Ji(n),n.throughput);return e},[r,n]),x=c(()=>o.map(e=>((e,t,n)=>{const o=Xt(e);if(!o)return null;const i=t===kt.Source;let a,l,r=!1,s=e;if(i){const t=(e=>{const t=e.workloadOdigosHealthStatus?.status;switch(t){case an.Failure:return{status:Ee.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case an.Notice:return{status:Ee.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case an.Pending:case an.Waiting:return{status:void 0,faded:!1,displaySource:Bg(e)};case an.Unsupported:case an.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return{status:void 0,faded:!1,displaySource:Xg(e)}}})(e);a=t.status,r=t.faded,l=t.tooltip,s=t.displaySource}else{const{priorotizedStatus:t,hasDisableds:n}=qi(e.conditions);a=t,r=n}const c=Zi(e,t,{extended:i,prioritizeDisplayName:!i});let d,p,u,h,m;switch(t){case kt.Source:{d=yn(e),p=ea(kt.Source);const t=n?.get(Qi(o));h=Tn(t);break}case kt.Destination:{const t=St(e.destinationType.type);p=t.icon,u=t.iconSrc;const i=n?.get(Qi(o));h=Tn(i),m=!e.disabled;break}case kt.Action:p=jt(e.type),m=!e.disabled;break;case kt.InstrumentationRule:p=Qt(e.type),m=!e.disabled}return{key:Qi(o),entityId:o,namespace:i?e.id.namespace:void 0,raw:s,itemProps:{entityId:o,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),[o,n,S]),[w,T]=a(""),{elements:k,indexToNamespace:I,multipleNs:N,dividerCount:E}=c(()=>{const e=[],n=[],o=new Set(x.map(e=>e.namespace).filter(Boolean)).size>1;o&&(n.push(""),e.push(t("div",{style:{height:24}},"ns-spacer")));let i=0,a="";for(const o of x)h&&o.namespace&&o.namespace!==a&&(""!==a&&(n.push(o.namespace),e.push(t(Gg,{namespace:o.namespace},`ns-divider-${o.namespace}`)),i+=1),a=o.namespace),n.push(o.namespace||""),e.push(t(zg,{...o.itemProps},o.key));return{elements:e,indexToNamespace:n,multipleNs:o,dividerCount:i}},[x,h]);i(()=>{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?`${o.length}/${l}`:l;return e(Kg,{children:[t(_g,{entityType:n,badge:D,badgeTooltip:m?Ze.FILTERED_COUNT_TOOLTIP:void 0,isLoading:s,refetch:u,partiallySelected:C>0&&o?.length!==C,allSelected:C>0&&o?.length===C,onSelectAll:h?e=>{if(h)if(e){const e={};o?.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(Yg,{children:o.length?e(Jg,{$height:R,children:[N&&w&&t(jg,{namespace:w}),t(gn,{gap:4,elements:k,onTopIndexChange:N?O:void 0})]}):s?t(ht,{size:3}):t(Lg,{entityType:n,description:Wg[n]??Ze.TO_COLLECT_OTEL_DATA})})]})},Zg=b.div`
1178
+ `,ef=({entityType:n,entities:o,unfilteredCount:l,metrics:r,loading:s,maxHeight:p,refetch:u})=>{const h=n===kt.Source,m=o.length!==l,g=Ot(e=>h?e.progress[Rt.Instrumenting]?.percentage:void 0),f=Ot(e=>h?e.progress[Rt.Uninstrumenting]?.percentage:void 0),b=!h||void 0===g&&void 0===f?void 0:g||f||0,{selectedSources:v,setSelectedSources:y}=Ji(),C=c(()=>h?Object.values(v).reduce((e,t)=>e+t.length,0):0,[h,v]),S=c(()=>{if(!r)return;const e=new Map,t=n===kt.Source?r.sources:n===kt.Destination?r.destinations:void 0;if(t)for(const n of t)e.set(qi(n),n.throughput);return e},[r,n]),x=c(()=>o.map(e=>((e,t,n)=>{const o=Ht(e);if(!o)return null;const i=t===kt.Source;let a,l,r=!1,s=e;if(i){const t=(e=>{const t=e.workloadOdigosHealthStatus?.status;switch(t){case rn.Failure:return{status:Ee.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case rn.Notice:return{status:Ee.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case rn.Pending:case rn.Waiting:return{status:void 0,faded:!1,displaySource:Vg(e)};case rn.Unsupported:case rn.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return{status:void 0,faded:!1,displaySource:Hg(e)}}})(e);a=t.status,r=t.faded,l=t.tooltip,s=t.displaySource}else{const n=t===kt.Action?Zi(e):e.conditions,{priorotizedStatus:o,hasDisableds:i}=Qi(n);a=o,r=i}const c=ea(e,t,{extended:i,prioritizeDisplayName:!i});let d,p,u,h,m;switch(t){case kt.Source:{d=Cn(e),p=na(kt.Source);const t=n?.get(ta(o));h=kn(t);break}case kt.Destination:{const t=St(e.destinationType.type);p=t.icon,u=t.iconSrc;const i=n?.get(ta(o));h=kn(i),m=!e.disabled;break}case kt.Action:p=Kt(e.type),m=!e.disabled;break;case kt.InstrumentationRule:p=nn(e.type),m=!e.disabled}return{key:ta(o),entityId:o,namespace:i?e.id.namespace:void 0,raw:s,itemProps:{entityId:o,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),[o,n,S]),[w,T]=a(""),{elements:k,indexToNamespace:I,multipleNs:N,dividerCount:E}=c(()=>{const e=[],n=[],o=new Set(x.map(e=>e.namespace).filter(Boolean)).size>1;o&&(n.push(""),e.push(t("div",{style:{height:24}},"ns-spacer")));let i=0,a="";for(const o of x)h&&o.namespace&&o.namespace!==a&&(""!==a&&(n.push(o.namespace),e.push(t(Yg,{namespace:o.namespace},`ns-divider-${o.namespace}`)),i+=1),a=o.namespace),n.push(o.namespace||""),e.push(t(Ug,{...o.itemProps},o.key));return{elements:e,indexToNamespace:n,multipleNs:o,dividerCount:i}},[x,h]);i(()=>{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?`${o.length}/${l}`:l;return e(qg,{children:[t(Fg,{entityType:n,badge:D,badgeTooltip:m?Ze.FILTERED_COUNT_TOOLTIP:void 0,isLoading:s,refetch:u,partiallySelected:C>0&&o?.length!==C,allSelected:C>0&&o?.length===C,onSelectAll:h?e=>{if(h)if(e){const e={};o?.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(Zg,{children:o.length?e(Qg,{$height:R,children:[N&&w&&t(Kg,{namespace:w}),t(fn,{gap:4,elements:k,onTopIndexChange:N?O:void 0})]}):s?t(ht,{size:3}):t(zg,{entityType:n,description:Jg[n]??Ze.TO_COLLECT_OTEL_DATA})})]})},tf=b.div`
1179
1179
  width: 100%;
1180
1180
  flex: 1;
1181
1181
  min-height: 0;
@@ -1183,10 +1183,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1183
1183
  display: flex;
1184
1184
  align-items: stretch;
1185
1185
  gap: 16px;
1186
- `,Qg={sources:[],destinations:[]},ef=()=>{const n=Xi(),{selectedStreamName:o}=Qe(),{containerRef:i,containerHeight:a}=ta(),{sourcesApi:l,destinationsApi:r,actionsApi:s,instrumentationRulesApi:d,metricsApi:p}=Vl(),{items:u,loading:h}=l.useSources(),{items:m,loading:g}=r.useDestinations(),{items:f,loading:b}=s.useActions(),{items:v,loading:y}=d.useRules(),C=fn(e=>e.drawerType),{data:S}=p.useMetrics({skip:!u.length||!m.length||!!C,pollInterval:1e4,fetchPolicy:"network-only"}),x=S?.getOverviewMetrics??Qg,w=c(()=>Ui(u,o),[u,o]),T=c(()=>Yt(m,o),[m,o]),k=c(()=>na(w,n),[w,n]),I=c(()=>oa(T,n),[T,n]),N=c(()=>ia(f,n),[f,n]);return e(Zg,{ref:i,children:[t(qg,{entityType:kt.InstrumentationRule,entities:v,unfilteredCount:v.length,loading:y,maxHeight:a,refetch:d.fetchAll}),t(qg,{entityType:kt.Source,entities:k,unfilteredCount:w.length,metrics:x,loading:h,maxHeight:a,refetch:l.fetchAll}),t(qg,{entityType:kt.Action,entities:N,unfilteredCount:f.length,loading:b,maxHeight:a,refetch:s.fetchAll}),t(qg,{entityType:kt.Destination,entities:I,unfilteredCount:T.length,metrics:x,loading:g,maxHeight:a,refetch:r.fetchAll})]})},tf="40vw",nf=b.div`
1186
+ `,nf={sources:[],destinations:[]},of=()=>{const n=Ui(),{selectedStreamName:o}=Qe(),{containerRef:i,containerHeight:a}=oa(),{sourcesApi:l,destinationsApi:r,actionsApi:s,instrumentationRulesApi:d,metricsApi:p}=jl(),{items:u,loading:h}=l.useSources(),{items:m,loading:g}=r.useDestinations(),{items:f,loading:b}=s.useActions(),{items:v,loading:y}=d.useRules(),C=bn(e=>e.drawerType),{data:S}=p.useMetrics({skip:!u.length||!m.length||!!C,pollInterval:1e4,fetchPolicy:"network-only"}),x=S?.getOverviewMetrics??nf,w=c(()=>Vi(u,o),[u,o]),T=c(()=>Zt(m,o),[m,o]),k=c(()=>ia(w,n),[w,n]),I=c(()=>aa(T,n),[T,n]),N=c(()=>la(f,n),[f,n]);return e(tf,{ref:i,children:[t(ef,{entityType:kt.InstrumentationRule,entities:v,unfilteredCount:v.length,loading:y,maxHeight:a,refetch:d.fetchAll}),t(ef,{entityType:kt.Source,entities:k,unfilteredCount:w.length,metrics:x,loading:h,maxHeight:a,refetch:l.fetchAll}),t(ef,{entityType:kt.Action,entities:N,unfilteredCount:f.length,loading:b,maxHeight:a,refetch:s.fetchAll}),t(ef,{entityType:kt.Destination,entities:I,unfilteredCount:T.length,metrics:x,loading:g,maxHeight:a,refetch:r.fetchAll})]})},af="40vw",lf=b.div`
1187
1187
  position: relative;
1188
- width: ${tf};
1189
- `,of=b.div`
1188
+ width: ${af};
1189
+ `,rf=b.div`
1190
1190
  position: absolute;
1191
1191
  top: calc(100% + 8px);
1192
1192
  left: 0;
@@ -1195,23 +1195,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1195
1195
  flex-direction: column;
1196
1196
  gap: 8px;
1197
1197
  padding: 8px;
1198
- width: calc(${tf} - 16px);
1198
+ width: calc(${af} - 16px);
1199
1199
  border-radius: 12px;
1200
1200
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1201
1201
  box-shadow: 0 12px 24px 24px rgba(0, 0, 0, 0.5);
1202
- `,af=b.div`
1202
+ `,sf=b.div`
1203
1203
  display: flex;
1204
1204
  align-items: center;
1205
1205
  overflow-x: auto;
1206
- `,lf=b.div`
1206
+ `,cf=b.div`
1207
1207
  display: flex;
1208
1208
  flex-direction: column;
1209
1209
  gap: 0;
1210
1210
  max-height: 60vh;
1211
1211
  overflow-y: auto;
1212
- `,rf=b.div`
1212
+ `,df=b.div`
1213
1213
  padding: 8px 12px 4px 12px;
1214
- `,sf=b.div`
1214
+ `,pf=b.div`
1215
1215
  display: flex;
1216
1216
  align-items: center;
1217
1217
  gap: 8px;
@@ -1221,12 +1221,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1221
1221
  &:hover {
1222
1222
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
1223
1223
  }
1224
- `,cf=b.div`
1224
+ `,uf=b.div`
1225
1225
  padding: 16px 8px;
1226
- `,df=({preventPopup:n=!1})=>{const o=v(),{selectedStreamName:i}=Qe(),{searchText:r,setSearchText:s}=Xi(),{setDrawerType:d,setDrawerEntityId:u}=fn(),{sourcesApi:h,destinationsApi:m,actionsApi:g,instrumentationRulesApi:f}=Vl(),b=h.useSources().items,y=m.useDestinations().items,C=g.useActions().items,S=f.useRules().items,x=p(null),[w,T]=a(!1),[k,I]=a("all"),N=!n&&(!!r||w),E=()=>{s(""),T(!1),I("all")};En(x,()=>E()),ro({key:"Escape",active:N},E);const{categories:O,searchResults:$}=c(()=>(({instrumentationRules:e,sources:t,actions:n,destinations:o,searchText:i,selectedCategory:a})=>{const l=i?e.filter(e=>e.type?.toLowerCase().includes(i)||e.ruleName?.toLowerCase().includes(i)):e,r=i?t.filter(e=>e.id.name?.toLowerCase().includes(i)||e.serviceName?.toLowerCase().includes(i)||e.id.namespace?.toLowerCase().includes(i)):t,s=i?n.filter(e=>e.type?.toLowerCase().includes(i)||e.name?.toLowerCase().includes(i)):n,c=i?o.filter(e=>e.destinationType.displayName?.toLowerCase().includes(i)||e.name?.toLowerCase().includes(i)):o,d=[{category:kt.Source,label:"Sources",count:r.length,entities:[]},{category:kt.Action,label:"Actions",count:s.length,entities:[]},{category:kt.Destination,label:"Destinations",count:c.length,entities:[]},{category:kt.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===kt.InstrumentationRule?l:e.category===kt.Source?r:e.category===kt.Action?s:e.category===kt.Destination?c:[]}));return{categories:d,searchResults:p}})({instrumentationRules:S,sources:Ui(b,i),actions:C,destinations:Yt(y,i),searchText:r,selectedCategory:k}),[S,b,C,y,i,r,k]),A=c(()=>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(nf,{ref:x,children:[t(mn,{value:r,onChange:e=>s(e.toLowerCase()),onFocus:()=>T(!0),width:tf}),N&&e(of,{children:[A.length>1&&t(af,{children:t(ce,{options:A,selected:k,setSelected:I})}),R?t(lf,{children:$.map(({category:n,label:i,entities:a},r)=>{if(!a.length)return null;const s=ea(n);return e(l,{children:[t(rf,{children:t(_e,{size:Te.XXS,color:Pe.Secondary,children:i})}),a.map((i,a)=>e(sf,{onClick:()=>{const e=Xt(i);e&&(d(Sn(n)),u(e),E())},children:[s&&t(s,{size:16,fill:o.v2.colors.white[500]}),t(_e,{size:Te.XS,nowrap:!0,children:Zi(i,n,{extended:!0})})]},`entity-${r}-${a}`))]},`category-list-${n}`)})}):t(cf,{children:t(xe,{hideIcon:!0,title:"No results",subTitle:r?`No matches for "${r}"`:"Start typing to search"})})]})]})},pf=({onRedirectToSampling:o})=>{const{sourcesApi:i}=Vl(),{items:a}=i.useSources(),{drawerType:l,drawerEntityId:r,setDrawerType:s,setDrawerEntityId:d}=fn(),p=()=>{s(null),d(null)},u=c(()=>a.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[a]),h=c(()=>Array.from(new Set(a.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[a]);return e(n,{children:[t(im,{}),l===go.AddSource&&t(ir,{children:t(vc,{onClose:p,withOverlay:!0})}),l===go.AddDestination&&t(ar,{children:t(tc,{onClose:p,withOverlay:!0})}),l===go.AddInstrumentationRule&&t(rr,{sourceOptions:u,namespaceOptions:h,children:t(nc,{onClose:p,withOverlay:!0})}),l===go.AddAction&&t(lr,{sourceOptions:u,namespaceOptions:h,children:t(js,{onClose:p,withOverlay:!0})}),l===go.EditSource&&t(cr,{children:t(Rh,{onClose:p,sourceId:r,onRedirectToSampling:o})}),l===go.EditDestination&&t(ar,{children:t(ap,{onClose:p,destinationId:r})}),l===go.EditInstrumentationRule&&t(rr,{sourceOptions:u,namespaceOptions:h,children:t(rp,{onClose:p,ruleId:r})}),l===go.EditAction&&t(lr,{sourceOptions:u,namespaceOptions:h,children:t(np,{onClose:p,actionId:r})})]})},uf=b.div`
1226
+ `,hf=({preventPopup:n=!1})=>{const o=v(),{selectedStreamName:i}=Qe(),{searchText:r,setSearchText:s}=Ui(),{setDrawerType:d,setDrawerEntityId:u}=bn(),{sourcesApi:h,destinationsApi:m,actionsApi:g,instrumentationRulesApi:f}=jl(),b=h.useSources().items,y=m.useDestinations().items,C=g.useActions().items,S=f.useRules().items,x=p(null),[w,T]=a(!1),[k,I]=a("all"),N=!n&&(!!r||w),E=()=>{s(""),T(!1),I("all")};On(x,()=>E()),so({key:"Escape",active:N},E);const{categories:O,searchResults:$}=c(()=>(({instrumentationRules:e,sources:t,actions:n,destinations:o,searchText:i,selectedCategory:a})=>{const l=i?e.filter(e=>e.type?.toLowerCase().includes(i)||e.ruleName?.toLowerCase().includes(i)):e,r=i?t.filter(e=>e.id.name?.toLowerCase().includes(i)||e.serviceName?.toLowerCase().includes(i)||e.id.namespace?.toLowerCase().includes(i)):t,s=i?n.filter(e=>e.type?.toLowerCase().includes(i)||e.name?.toLowerCase().includes(i)):n,c=i?o.filter(e=>e.destinationType.displayName?.toLowerCase().includes(i)||e.name?.toLowerCase().includes(i)):o,d=[{category:kt.Source,label:"Sources",count:r.length,entities:[]},{category:kt.Action,label:"Actions",count:s.length,entities:[]},{category:kt.Destination,label:"Destinations",count:c.length,entities:[]},{category:kt.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===kt.InstrumentationRule?l:e.category===kt.Source?r:e.category===kt.Action?s:e.category===kt.Destination?c:[]}));return{categories:d,searchResults:p}})({instrumentationRules:S,sources:Vi(b,i),actions:C,destinations:Zt(y,i),searchText:r,selectedCategory:k}),[S,b,C,y,i,r,k]),A=c(()=>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(lf,{ref:x,children:[t(gn,{value:r,onChange:e=>s(e.toLowerCase()),onFocus:()=>T(!0),width:af}),N&&e(rf,{children:[A.length>1&&t(sf,{children:t(ce,{options:A,selected:k,setSelected:I})}),R?t(cf,{children:$.map(({category:n,label:i,entities:a},r)=>{if(!a.length)return null;const s=na(n);return e(l,{children:[t(df,{children:t(_e,{size:Te.XXS,color:Pe.Secondary,children:i})}),a.map((i,a)=>e(pf,{onClick:()=>{const e=Ht(i);e&&(d(xn(n)),u(e),E())},children:[s&&t(s,{size:16,fill:o.v2.colors.white[500]}),t(_e,{size:Te.XS,nowrap:!0,children:ea(i,n,{extended:!0})})]},`entity-${r}-${a}`))]},`category-list-${n}`)})}):t(uf,{children:t(xe,{hideIcon:!0,title:"No results",subTitle:r?`No matches for "${r}"`:"Start typing to search"})})]})]})},mf=({onRedirectToSampling:o})=>{const{sourcesApi:i}=jl(),{items:a}=i.useSources(),{drawerType:l,drawerEntityId:r,setDrawerType:s,setDrawerEntityId:d}=bn(),p=()=>{s(null),d(null)},u=c(()=>a.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[a]),h=c(()=>Array.from(new Set(a.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[a]);return e(n,{children:[t(rm,{}),l===fo.AddSource&&t(lr,{children:t(Cc,{onClose:p,withOverlay:!0})}),l===fo.AddDestination&&t(rr,{children:t(oc,{onClose:p,withOverlay:!0})}),l===fo.AddInstrumentationRule&&t(cr,{sourceOptions:u,namespaceOptions:h,children:t(ic,{onClose:p,withOverlay:!0})}),l===fo.AddAction&&t(sr,{sourceOptions:u,namespaceOptions:h,children:t(Ws,{onClose:p,withOverlay:!0})}),l===fo.EditSource&&t(pr,{children:t(Ph,{onClose:p,sourceId:r,onRedirectToSampling:o})}),l===fo.EditDestination&&t(rr,{children:t(sp,{onClose:p,destinationId:r})}),l===fo.EditInstrumentationRule&&t(cr,{sourceOptions:u,namespaceOptions:h,children:t(dp,{onClose:p,ruleId:r})}),l===fo.EditAction&&t(sr,{sourceOptions:u,namespaceOptions:h,children:t(ap,{onClose:p,actionId:r})})]})},gf=b.div`
1227
1227
  position: relative;
1228
1228
  display: inline-flex;
1229
- `,hf=b.div`
1229
+ `,ff=b.div`
1230
1230
  display: inline-flex;
1231
1231
  align-items: center;
1232
1232
  gap: 6px;
@@ -1237,7 +1237,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1237
1237
  &:hover {
1238
1238
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
1239
1239
  }
1240
- `,mf=b.div`
1240
+ `,bf=b.div`
1241
1241
  position: absolute;
1242
1242
  top: calc(100% + 8px);
1243
1243
  left: 0;
@@ -1251,18 +1251,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1251
1251
  border-radius: 12px;
1252
1252
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1253
1253
  box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
1254
- `,gf=b.div`
1254
+ `,vf=b.div`
1255
1255
  display: flex;
1256
1256
  align-items: center;
1257
1257
  gap: 8px;
1258
1258
  width: 100%;
1259
- `,ff=b.div`
1259
+ `,yf=b.div`
1260
1260
  display: flex;
1261
1261
  flex-direction: column;
1262
1262
  gap: 0;
1263
1263
  max-height: 240px;
1264
1264
  overflow-y: auto;
1265
- `,bf=b.div`
1265
+ `,Cf=b.div`
1266
1266
  display: flex;
1267
1267
  align-items: center;
1268
1268
  gap: 8px;
@@ -1273,29 +1273,29 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1273
1273
  &:hover {
1274
1274
  background-color: ${({$selected:e,theme:t})=>e?t.v2.colors.silver[600]:t.v2.colors.silver[700]};
1275
1275
  }
1276
- `,vf=b.div`
1276
+ `,Sf=b.div`
1277
1277
  flex: 1;
1278
1278
  min-width: 0;
1279
1279
  overflow: hidden;
1280
1280
  text-overflow: ellipsis;
1281
1281
  white-space: nowrap;
1282
- `,yf=b.div`
1282
+ `,xf=b.div`
1283
1283
  display: flex;
1284
1284
  align-items: center;
1285
1285
  gap: 2px;
1286
1286
  flex-shrink: 0;
1287
- `,Cf=b.div`
1287
+ `,wf=b.div`
1288
1288
  display: flex;
1289
1289
  padding-top: 4px;
1290
1290
  border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
1291
- `,Sf=()=>{const o=v(),{isVm:l}=S(),{clearStore:r}=aa(),{dataStreamsApi:s}=Vl();s.useDataStreams();const{dataStreams:d,selectedStreamName:u,setSelectedStreamName:h}=Qe(),m=p(null),[g,f]=a(!1),[b,y]=a(""),[C,x]=a(""),[w,T]=a(!1),[k,I]=a(!1),[N,E]=a(!1),[O,$]=a(""),[A,R]=a(!1);En(m,()=>f(!1)),i(()=>{g||y("")},[g]);const D=c(()=>{if(!b)return d;const e=b.toLowerCase();return d.filter(({name:t})=>t.toLowerCase().includes(e))},[d,b]),_=g?ja:Ga;return l?null:e(n,{children:[e(uf,{ref:m,children:[e(hf,{"data-id":"data-stream-select",$isOpen:g,onClick:()=>f(e=>!e),children:[t(_l,{size:24}),t(_e,{size:Te.S,weight:500,nowrap:!0,children:(P=u,`Data Stream: ${P}`)}),t(Ke,{label:d.length,status:Ee.Unknown,textSize:Te.XXXS}),t(_,{size:20,fill:o.v2.colors.silver[200]})]}),g&&e(mf,{children:[t(gf,{children:t(mn,{value:b,onChange:y,placeholder:"Search streams...",width:"100%"})}),t(ff,{children:0===D.length?t(bf,{children:t(_e,{size:Te.XS,color:Pe.Secondary,children:"No streams match"})}):D.map(({name:n})=>{const o=n===la;return e(bf,{"data-id":`stream-row-${n}`,$selected:n===u,onClick:()=>(e=>{e!==u&&(r(),h(e)),f(!1)})(n),children:[t(vf,{children:t(_e,{size:Te.XS,nowrap:!0,children:n})}),e(yf,{children:[t(bt,{"data-id":`stream-edit-${n}`,icon:Ma,size:vt.XS,onClick:e=>{e.stopPropagation(),f(!1),x(n),T(!0)}}),!o&&t(bt,{"data-id":`stream-delete-${n}`,icon:Aa,size:vt.XS,onClick:e=>{e.stopPropagation(),f(!1),$(n),R(!0)}})]})]},`stream-${n}`)})}),t(Cf,{children:t(fe,{"data-id":"add-stream-trigger",variant:ve.Secondary,size:be.S,leftIcon:Ra,label:`${Lt.NEW} ${Ze.STREAM_NAME}`,fullWidth:!0,onClick:()=>{f(!1),r(),E(!0),I(!0)}})})]})]}),N&&t(dr,{defaultExcludeName:u,children:t(em,{isOpen:k,onClose:()=>I(!1),onCloseEnd:()=>E(!1)})}),C&&t(dr,{children:t(tm,{isOpen:w,dataStreamName:C,onClose:()=>T(!1),onCloseEnd:()=>x("")})}),t(Er,{target:`${Ze.STREAM_NAME.toLowerCase()} "${O}"`,isOpen:A,onClose:()=>R(!1),onApprove:async()=>{O&&await s.remove(O)}})]});var P},xf=()=>{const{selectedStreamName:o}=Qe(),{selectedSources:l,setSelectedSources:r}=Yi(),{sourcesApi:s}=Vl(),[p,u]=a(!1),[h,m]=a(!1),g=c(()=>Object.values(l).reduce((e,t)=>e+t.length,0),[l]),f=d(()=>{r({})},[r]),b=d(()=>u(!1),[]),v=d(()=>m(!1),[]);i(()=>{f()},[o,f]);const y=d(()=>{s.restartWorkloads(Object.values(l).flat().filter(e=>e.id.kind!==xn.StaticPod).map(bn)),f()},[s,l,f]),C=d(()=>{s.persistV2(Object.fromEntries(Object.entries(l).map(([e,t])=>[e,t.map(({id:e})=>({namespace:e.namespace,name:e.name,kind:e.kind||void 0,region:e.region,selected:!1,currentStreamName:o}))]))),f()},[s,l,o,f]),S=c(()=>[{id:"multi-source-deselect",type:hn.Button,buttonProps:{variant:ve.Text,size:be.S,label:"Deselect",onClick:f}},{id:"multi-source-restart",type:hn.Button,buttonProps:{variant:ve.Secondary,size:be.S,label:"Restart",leftIcon:bl,onClick:()=>u(!0)}},{id:"multi-source-uninstrument",type:hn.Button,buttonProps:{variant:ve.Primary,size:be.S,label:"Uninstrument",leftIcon:Aa,onClick:()=>m(!0)}}],[f]);return e(n,{children:[t(Fn,{isOpen:g>0,richTitle:{icon:Ja,title:"Selected sources",badge:{label:g}},actions:S}),t(qe,{isOpen:p,title:"Rollout Restart Workloads",description:"Are you sure you want to rollout restart these workloads?",onClose:b,denyButton:{label:"Go Back",variant:ve.Secondary,onClick:b},approveButton:{label:"Confirm",variant:ve.Primary,onClick:()=>{y(),b()}}}),t(Er,{isOpen:h,action:"uninstrument",target:`${g} source${1===g?"":"s"}`,onClose:v,onDeny:v,onApprove:C})]})},wf=C`
1291
+ `,Tf=()=>{const o=v(),{isVm:l}=S(),{clearStore:r}=ra(),{dataStreamsApi:s}=jl();s.useDataStreams();const{dataStreams:d,selectedStreamName:u,setSelectedStreamName:h}=Qe(),m=p(null),[g,f]=a(!1),[b,y]=a(""),[C,x]=a(""),[w,T]=a(!1),[k,I]=a(!1),[N,E]=a(!1),[O,$]=a(""),[A,R]=a(!1);On(m,()=>f(!1)),i(()=>{g||y("")},[g]);const D=c(()=>{if(!b)return d;const e=b.toLowerCase();return d.filter(({name:t})=>t.toLowerCase().includes(e))},[d,b]),_=g?Wa:Ka;return l?null:e(n,{children:[e(gf,{ref:m,children:[e(ff,{"data-id":"data-stream-select",$isOpen:g,onClick:()=>f(e=>!e),children:[t(Ll,{size:24}),t(_e,{size:Te.S,weight:500,nowrap:!0,children:(P=u,`Data Stream: ${P}`)}),t(Ke,{label:d.length,status:Ee.Unknown,textSize:Te.XXXS}),t(_,{size:20,fill:o.v2.colors.silver[200]})]}),g&&e(bf,{children:[t(vf,{children:t(gn,{value:b,onChange:y,placeholder:"Search streams...",width:"100%"})}),t(yf,{children:0===D.length?t(Cf,{children:t(_e,{size:Te.XS,color:Pe.Secondary,children:"No streams match"})}):D.map(({name:n})=>{const o=n===sa;return e(Cf,{"data-id":`stream-row-${n}`,$selected:n===u,onClick:()=>(e=>{e!==u&&(r(),h(e)),f(!1)})(n),children:[t(Sf,{children:t(_e,{size:Te.XS,nowrap:!0,children:n})}),e(xf,{children:[t(bt,{"data-id":`stream-edit-${n}`,icon:Ba,size:vt.XS,onClick:e=>{e.stopPropagation(),f(!1),x(n),T(!0)}}),!o&&t(bt,{"data-id":`stream-delete-${n}`,icon:Da,size:vt.XS,onClick:e=>{e.stopPropagation(),f(!1),$(n),R(!0)}})]})]},`stream-${n}`)})}),t(wf,{children:t(fe,{"data-id":"add-stream-trigger",variant:ve.Secondary,size:be.S,leftIcon:_a,label:`${Lt.NEW} ${Ze.STREAM_NAME}`,fullWidth:!0,onClick:()=>{f(!1),r(),E(!0),I(!0)}})})]})]}),N&&t(ur,{defaultExcludeName:u,children:t(om,{isOpen:k,onClose:()=>I(!1),onCloseEnd:()=>E(!1)})}),C&&t(ur,{children:t(im,{isOpen:w,dataStreamName:C,onClose:()=>T(!1),onCloseEnd:()=>x("")})}),t($r,{target:`${Ze.STREAM_NAME.toLowerCase()} "${O}"`,isOpen:A,onClose:()=>R(!1),onApprove:async()=>{O&&await s.remove(O)}})]});var P},kf=()=>{const{selectedStreamName:o}=Qe(),{selectedSources:l,setSelectedSources:r}=Ji(),{sourcesApi:s}=jl(),[p,u]=a(!1),[h,m]=a(!1),g=c(()=>Object.values(l).reduce((e,t)=>e+t.length,0),[l]),f=d(()=>{r({})},[r]),b=d(()=>u(!1),[]),v=d(()=>m(!1),[]);i(()=>{f()},[o,f]);const y=d(()=>{s.restartWorkloads(Object.values(l).flat().filter(e=>e.id.kind!==wn.StaticPod).map(vn)),f()},[s,l,f]),C=d(()=>{s.persistV2(Object.fromEntries(Object.entries(l).map(([e,t])=>[e,t.map(({id:e})=>({namespace:e.namespace,name:e.name,kind:e.kind||void 0,region:e.region,selected:!1,currentStreamName:o}))]))),f()},[s,l,o,f]),S=c(()=>[{id:"multi-source-deselect",type:mn.Button,buttonProps:{variant:ve.Text,size:be.S,label:"Deselect",onClick:f}},{id:"multi-source-restart",type:mn.Button,buttonProps:{variant:ve.Secondary,size:be.S,label:"Restart",leftIcon:yl,onClick:()=>u(!0)}},{id:"multi-source-uninstrument",type:mn.Button,buttonProps:{variant:ve.Primary,size:be.S,label:"Uninstrument",leftIcon:Da,onClick:()=>m(!0)}}],[f]);return e(n,{children:[t(Mn,{isOpen:g>0,richTitle:{icon:Za,title:"Selected sources",badge:{label:g}},actions:S}),t(qe,{isOpen:p,title:"Rollout Restart Workloads",description:"Are you sure you want to rollout restart these workloads?",onClose:b,denyButton:{label:"Go Back",variant:ve.Secondary,onClick:b},approveButton:{label:"Confirm",variant:ve.Primary,onClick:()=>{y(),b()}}}),t($r,{isOpen:h,action:"uninstrument",target:`${g} source${1===g?"":"s"}`,onClose:v,onDeny:v,onApprove:C})]})},If=C`
1292
1292
  0% {
1293
1293
  background-position: 200% 50%;
1294
1294
  }
1295
1295
  100% {
1296
1296
  background-position: 0% 50%;
1297
1297
  }
1298
- `,Tf=b.div`
1298
+ `,Nf=b.div`
1299
1299
  display: flex;
1300
1300
  align-items: center;
1301
1301
  justify-content: space-evenly;
@@ -1306,43 +1306,43 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1306
1306
 
1307
1307
  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%)`};
1308
1308
  background-size: 200% 100%;
1309
- animation: ${wf} 15s linear infinite;
1310
- `,kf=[Ya,Ja,Va,Ha],If=({onRedirectToSampling:n})=>{const o=v();return e(zi,{children:[e(st,{fullHeight:!0,customTitle:t(Sf,{}),customSearch:t(df,{}),filters:t(Ag,{}),children:[t(Tf,{children:kf.map((n,i)=>e(l,{children:[t(n,{size:24}),i<kf.length-1&&t(Ua,{fill:o.v2.colors.white[500]+dt["020"],size:24})]},n.name))}),t(ef,{})]}),t(pf,{onRedirectToSampling:n}),t(xf,{})]})};var Nf;(e=>{e.Gateway="gateway",e.Node="node"})(Nf||(Nf={}));const Ef=({onClickDownloadDiagnose:n,onClickRefresh:o,loading:i,disabled:a})=>{const l=c(()=>{const e=[];return n&&e.push({id:ho(),type:hn.Button,buttonProps:{label:"Download Diagnose",leftIcon:Tl,size:be.S,variant:ve.Text,onClick:n,disabled:a}}),o&&e.push({id:ho(),type:hn.Button,buttonProps:{label:"Refresh",leftIcon:ll,size:be.S,variant:ve.Text,onClick:o,disabled:a,loading:i}}),e},[n,o,a,i]);return e(pe,{$alignItems:"center",$justifyContent:"space-between",children:[t(ra,{icon:Pl,title:"Collectors Pipeline"}),t(sa,{actions:l})]})},Of=({pod:n,onClose:o})=>{const{formatTimeAgo:i}=en(),{collectorsApi:a}=Vl(),{data:l}=a.usePodInfo(n?{namespace:n.namespace,name:n.name}:void 0,{skip:!n}),r=c(()=>[{id:ho(),title:"Node",label:l?.node??"-",withCopy:!0},{id:ho(),title:"Status",badge:{status:ca(l?.status),label:l?.status??"-"}}],[l]),s=c(()=>l?.containers?.map(e=>({id:ho(),items:[{id:ho(),title:"Container",label:e.name??"-"},{id:ho(),title:"Status",label:e.startedAt?`${e.status} (since ${i(e.startedAt)})`:e.status},{id:ho(),title:"Ready",badge:{status:e.ready?Ee.Success:Ee.Error,leftIcon:e.ready?_a:Pa,label:e.ready?"True":"False",invertColors:!0}},{id:ho(),title:"Started",badge:{status:e.started?Ee.Success:Ee.Error,leftIcon:e.started?_a:Pa,label:e.started?"True":"False",invertColors:!0}},{id:ho(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:ho(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:ho(),title:Ze.RESTARTS,label:e.restarts.toString()},{id:ho(),title:"State Reason",label:e.stateReason??"-"},{id:ho(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:ho(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[l]);return t(Mt,{isOpen:!!n,header:{icon:sl,title:"Pod Information",onClose:o},children:l?e(Vt,{bgTint:"1000",richTitle:{icon:sl,title:l.name,withCopy:!0},children:[t(Vt,{bgTint:"900",cellsPerRow:2,items:r}),e(Vt,{bgTint:"900",richTitle:{icon:fl,title:Ze.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(un,{value:`kubectl get pod ${l.name} -n ${l.namespace} -o yaml`}),t(un,{value:`kubectl describe pod ${l.name} -n ${l.namespace}`}),t(un,{value:`kubectl logs ${l.name} -n ${l.namespace}`})]}),t(Vt,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:s.length?s.map(({id:e,items:n})=>t(Vt,{bgTint:"800",cellsPerRow:2,items:n},e)):t(xe,{title:"No containers",subTitle:"Pod has no containers"})}),t(Or,{bgTint:"900",yaml:l.manifestYAML,defaultOpen:!0})]}):t(mt,{$height:"50vh",children:t(yt,{withSpinner:!0})})})};var $f;(e=>{e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropRate="spanDropRate",e.Age="age",e.DockerImage="dockerImage"})($f||($f={}));const Af=e=>{const t=[{key:$f.PodName,label:"Pod Name"},{key:$f.Status,label:"Status"},{key:$f.Restarts,label:Ze.RESTARTS},{key:$f.NodeName,label:"Node Name"},{key:$f.Age,label:"Age"},{key:$f.DockerImage,label:"Collector Version"}];return e&&t.splice(4,0,{key:$f.SpanDropRate,label:"Span Drop Rate",noSort:!0,noFilter:!0}),t},Rf=({isLoading:n,pods:o,withSpanDropRate:i})=>{const l=v(),{formatTimeAgo:r}=en(),[s,d]=a(null),p=c(()=>o.map(n=>({onClick:()=>d(n),cells:[{key:$f.PodName,rawValue:n.name},{key:$f.Status,rawValue:n.status,component:()=>{return e=n.status,t(Ke,{status:ca(e),label:e});var e}},{key:$f.Restarts,rawValue:n.restartsCount.toString()},{key:$f.NodeName,rawValue:n.nodeName},{key:$f.SpanDropRate,rawValue:0,component:()=>{const{collectorMetrics:o}=n;if(!o)return t(_e,{children:"-"});const i=(o?.metricsAcceptedRps??0)+(o?.metricsDroppedRps??0),a=i>0?Math.round((o?.metricsDroppedRps??0)/i*100):0,l=a>0?Ee.Error:Ee.Success,r=(o?.exporterSuccessRps??0)+(o?.exporterFailedRps??0),s=r>0?Math.round((o?.exporterFailedRps??0)/r*100):0,c=s>0?Ee.Error:Ee.Success;return e(pe,{$gap:4,children:[t(Fe,{text:`Accepted: ${o.metricsAcceptedRps.toLocaleString()} spans/s\nDropped: ${o.metricsDroppedRps.toLocaleString()} spans/s`,children:t(Ke,{status:l,label:`Receiver ${a}%`,leftIcon:l===Ee.Error?Ll:Fl,useSecondaryTone:!0,invertColors:!0})}),t(Fe,{text:`Success: ${o.exporterSuccessRps.toLocaleString()} spans/s\nFailed: ${o.exporterFailedRps.toLocaleString()} spans/s`,children:t(Ke,{status:c,label:`Exporter ${s}%`,leftIcon:c===Ee.Error?Ll:Fl,useSecondaryTone:!0,invertColors:!0})})]})}},{key:$f.Age,rawValue:r(n.creationTimestamp)},{key:$f.DockerImage,rawValue:n.image}]})),[o,l]);return e(Vt,{fullHeight:!0,bgTint:"1000",moreSpacing:!0,richTitle:{icon:sl,title:"Pods"},children:[t(Pn,{variant:Ln.Data,isLoading:n,columns:Af(i),rows:p}),t(Of,{pod:s,onClose:()=>d(null)})]})},Df=({isOpen:e,onClose:n,title:o,yaml:i})=>t(Mt,{isOpen:e,header:{icon:Ml,title:o,onClose:n},children:t(Or,{yaml:i,defaultOpen:!0})}),_f=e=>{switch(e){case da.Healthy:return"All desired replicas are updated, available, and ready";case da.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case da.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case da.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case da.Down:return"No available replicas";case da.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var Pf;(e=>{e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"})(Pf||(Pf={}));const Lf=b.div`
1309
+ animation: ${If} 15s linear infinite;
1310
+ `,Ef=[qa,Za,ja,Ga],Of=({onRedirectToSampling:n})=>{const o=v();return e(Bi,{children:[e(st,{fullHeight:!0,customTitle:t(Tf,{}),customSearch:t(hf,{}),filters:t(_g,{}),children:[t(Nf,{children:Ef.map((n,i)=>e(l,{children:[t(n,{size:24}),i<Ef.length-1&&t(Ha,{fill:o.v2.colors.white[500]+dt["020"],size:24})]},n.name))}),t(of,{})]}),t(mf,{onRedirectToSampling:n}),t(kf,{})]})};var $f;(e=>{e.Gateway="gateway",e.Node="node"})($f||($f={}));const Af=({onClickDownloadDiagnose:n,onClickRefresh:o,loading:i,disabled:a})=>{const l=c(()=>{const e=[];return n&&e.push({id:mo(),type:mn.Button,buttonProps:{label:"Download Diagnose",leftIcon:Il,size:be.S,variant:ve.Text,onClick:n,disabled:a}}),o&&e.push({id:mo(),type:mn.Button,buttonProps:{label:"Refresh",leftIcon:sl,size:be.S,variant:ve.Text,onClick:o,disabled:a,loading:i}}),e},[n,o,a,i]);return e(pe,{$alignItems:"center",$justifyContent:"space-between",children:[t(ca,{icon:Fl,title:"Collectors Pipeline"}),t(da,{actions:l})]})},Rf=({pod:n,onClose:o})=>{const{formatTimeAgo:i}=on(),{collectorsApi:a}=jl(),{data:l}=a.usePodInfo(n?{namespace:n.namespace,name:n.name}:void 0,{skip:!n}),r=c(()=>[{id:mo(),title:"Node",label:l?.node??"-",withCopy:!0},{id:mo(),title:"Status",badge:{status:pa(l?.status),label:l?.status??"-"}}],[l]),s=c(()=>l?.containers?.map(e=>({id:mo(),items:[{id:mo(),title:"Container",label:e.name??"-"},{id:mo(),title:"Status",label:e.startedAt?`${e.status} (since ${i(e.startedAt)})`:e.status},{id:mo(),title:"Ready",badge:{status:e.ready?Ee.Success:Ee.Error,leftIcon:e.ready?La:Fa,label:e.ready?"True":"False",invertColors:!0}},{id:mo(),title:"Started",badge:{status:e.started?Ee.Success:Ee.Error,leftIcon:e.started?La:Fa,label:e.started?"True":"False",invertColors:!0}},{id:mo(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:mo(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:mo(),title:Ze.RESTARTS,label:e.restarts.toString()},{id:mo(),title:"State Reason",label:e.stateReason??"-"},{id:mo(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:mo(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[l]);return t(Mt,{isOpen:!!n,header:{icon:dl,title:"Pod Information",onClose:o},children:l?e(Gt,{bgTint:"1000",richTitle:{icon:dl,title:l.name,withCopy:!0},children:[t(Gt,{bgTint:"900",cellsPerRow:2,items:r}),e(Gt,{bgTint:"900",richTitle:{icon:vl,title:Ze.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(hn,{value:`kubectl get pod ${l.name} -n ${l.namespace} -o yaml`}),t(hn,{value:`kubectl describe pod ${l.name} -n ${l.namespace}`}),t(hn,{value:`kubectl logs ${l.name} -n ${l.namespace}`})]}),t(Gt,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:s.length?s.map(({id:e,items:n})=>t(Gt,{bgTint:"800",cellsPerRow:2,items:n},e)):t(xe,{title:"No containers",subTitle:"Pod has no containers"})}),t(Ar,{bgTint:"900",yaml:l.manifestYAML,defaultOpen:!0})]}):t(mt,{$height:"50vh",children:t(yt,{withSpinner:!0})})})};var Df;(e=>{e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropRate="spanDropRate",e.Age="age",e.DockerImage="dockerImage"})(Df||(Df={}));const _f=e=>{const t=[{key:Df.PodName,label:"Pod Name"},{key:Df.Status,label:"Status"},{key:Df.Restarts,label:Ze.RESTARTS},{key:Df.NodeName,label:"Node Name"},{key:Df.Age,label:"Age"},{key:Df.DockerImage,label:"Collector Version"}];return e&&t.splice(4,0,{key:Df.SpanDropRate,label:"Span Drop Rate",noSort:!0,noFilter:!0}),t},Pf=({isLoading:n,pods:o,withSpanDropRate:i})=>{const l=v(),{formatTimeAgo:r}=on(),[s,d]=a(null),p=c(()=>o.map(n=>({onClick:()=>d(n),cells:[{key:Df.PodName,rawValue:n.name},{key:Df.Status,rawValue:n.status,component:()=>{return e=n.status,t(Ke,{status:pa(e),label:e});var e}},{key:Df.Restarts,rawValue:n.restartsCount.toString()},{key:Df.NodeName,rawValue:n.nodeName},{key:Df.SpanDropRate,rawValue:0,component:()=>{const{collectorMetrics:o}=n;if(!o)return t(_e,{children:"-"});const i=(o?.metricsAcceptedRps??0)+(o?.metricsDroppedRps??0),a=i>0?Math.round((o?.metricsDroppedRps??0)/i*100):0,l=a>0?Ee.Error:Ee.Success,r=(o?.exporterSuccessRps??0)+(o?.exporterFailedRps??0),s=r>0?Math.round((o?.exporterFailedRps??0)/r*100):0,c=s>0?Ee.Error:Ee.Success;return e(pe,{$gap:4,children:[t(Fe,{text:`Accepted: ${o.metricsAcceptedRps.toLocaleString()} spans/s\nDropped: ${o.metricsDroppedRps.toLocaleString()} spans/s`,children:t(Ke,{status:l,label:`Receiver ${a}%`,leftIcon:l===Ee.Error?Ml:zl,useSecondaryTone:!0,invertColors:!0})}),t(Fe,{text:`Success: ${o.exporterSuccessRps.toLocaleString()} spans/s\nFailed: ${o.exporterFailedRps.toLocaleString()} spans/s`,children:t(Ke,{status:c,label:`Exporter ${s}%`,leftIcon:c===Ee.Error?Ml:zl,useSecondaryTone:!0,invertColors:!0})})]})}},{key:Df.Age,rawValue:r(n.creationTimestamp)},{key:Df.DockerImage,rawValue:n.image}]})),[o,l]);return e(Gt,{fullHeight:!0,bgTint:"1000",moreSpacing:!0,richTitle:{icon:dl,title:"Pods"},children:[t(Ln,{variant:Fn.Data,isLoading:n,columns:_f(i),rows:p}),t(Rf,{pod:s,onClose:()=>d(null)})]})},Lf=({isOpen:e,onClose:n,title:o,yaml:i})=>t(Mt,{isOpen:e,header:{icon:Bl,title:o,onClose:n},children:t(Ar,{yaml:i,defaultOpen:!0})}),Ff=e=>{switch(e){case ua.Healthy:return"All desired replicas are updated, available, and ready";case ua.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case ua.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case ua.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case ua.Down:return"No available replicas";case ua.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var Mf;(e=>{e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"})(Mf||(Mf={}));const zf=b.div`
1311
1311
  flex: 0.5;
1312
1312
  padding: 12px;
1313
1313
  border-radius: 12px;
1314
1314
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
1315
- `,Ff=({selectedTab:n,gatewayInfo:o,nodeCollectorInfo:i,isLoading:l})=>{const{formatTimeAgo:r}=en(),[s,d]=a(null),p=c(()=>(e=>{switch(e){case Nf.Gateway:return"Deployment";case Nf.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(n),[n]),u=c(()=>((e,t,n,o)=>{const i={status:Ee.Disabled,label:"No rollouts yet"};let a=!1,l=null;switch(e){case Nf.Gateway:a=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case Nf.Node:a=n?.rolloutInProgress??!1,l=n?.lastRolloutAt??null;break;default:return i}return a?{status:Ee.Info,label:"Rollout in progress",rightIcon:ll,useSecondaryTone:!0}:l?{status:Ee.Disabled,label:`Last Rollout: ${o(l)}`}:i})(n,o,i,r),[o,i,n,r]),h=c(()=>((e,t,n,o)=>{let i=o?Ee.Info:Ee.Unknown,a=o?"Loading":da.Unknown,l=o?"Fetching data...":_f(da.Unknown);switch(e){case Nf.Gateway:i=t?.status?ca(t?.status):i,a=t?.status??a,l=t?.status?_f(t.status):l;break;case Nf.Node:i=n?.status?ca(n?.status):i,a=n?.status??a,l=n?.status?_f(n.status):l}return{status:i,title:a,description:l}})(n,o,i,l),[o,i,n,l]),m=c(()=>((e,t,n)=>{switch(e){case Nf.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 Nf.Node:return[{gaugeWidth:128,min:0,max:n?.nodes?.desired??0,current:n?.nodes?.ready??0,title:"Nodes",primaryLabel:"Ready nodes",secondaryLabel:"Desired nodes"}];default:return[]}})(n,o,i),[o,i,n]),g=c(()=>((e,t,n,o)=>{switch(e){case Nf.Gateway:return[{title:"Data throughput",cells:[{label:"Traces data",value:Tn(t?.throughputTracesBytesPerSec??0),isLoading:o},{label:"Metrics data",value:Tn(t?.throughputMetricsBytesPerSec??0),isLoading:o},{label:"Logs data",value:Tn(t?.throughputLogsBytesPerSec??0),isLoading:o}]},{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${t?.resources?.requests.cpu}/${t?.resources?.limits.cpu}`,isLoading:o},{label:"Memory",value:`${t?.resources?.requests.memory}/${t?.resources?.limits.memory}`,isLoading:o}]}];case Nf.Node:return[{title:"Data Throughput",cells:[{label:"Traces data",value:Tn(n?.throughputTracesBytesPerSec??0),isLoading:o},{label:"Metrics data",value:Tn(n?.throughputMetricsBytesPerSec??0),isLoading:o},{label:"Logs data",value:Tn(n?.throughputLogsBytesPerSec??0),isLoading:o}]},{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${n?.resources?.requests.cpu}/${n?.resources?.limits.cpu}`,isLoading:o},{label:"Memory",value:`${n?.resources?.requests.memory}/${n?.resources?.limits.memory}`,isLoading:o}]}];default:return[]}})(n,o,i,l),[o,i,n,l]),f=c(()=>(n===Nf.Gateway?o?.manifestYAML:i?.manifestYAML)??"",[o,i,n]),b=c(()=>(n===Nf.Gateway?o?.configMapYAML:i?.configMapYAML)??"",[o,i,n]);return e(Vt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:Ml,title:p,badge:u},actions:[{id:ho(),type:hn.ButtonDropData,buttonProps:{variant:ve.Secondary,size:be.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:Pf.ManifestYaml,label:p,icon:zl},{id:Pf.ConfigMapYaml,label:"ConfigMap",icon:zl}]}}],children:[e(pe,{$gap:16,children:[t("div",{children:t(pa,{...h})}),m.map(e=>t(Lf,{children:t("div",{children:t(ua,{...e})})},e.title)),g.map(e=>t(ha,{...e},e.title))]}),t(Df,{isOpen:s===Pf.ManifestYaml,onClose:()=>d(null),title:p,yaml:f}),t(Df,{isOpen:s===Pf.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},Mf=[{value:Nf.Gateway,label:"Gateway"},{value:Nf.Node,label:"Node Collector"}],zf=({minSupportedVersion:n})=>{const{isVersionSupported:o,version:i,minSupportedVersion:l}=S(n),[r,s]=a(Nf.Gateway),p=r===Nf.Gateway,u=r===Nf.Node,{collectorsApi:h,configApi:m}=Vl(),{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=c(()=>p?y:I,[y,I,p]);return e(zi,{children:[t(Ef,{disabled:!o,loading:O,onClickDownloadDiagnose:void 0,onClickRefresh:$}),e(ma,{children:[e(ee,{children:[t(ce,{variant:_n.Underline,size:ke.L,options:Mf,selected:r,setSelected:s}),t(Ff,{selectedTab:r,gatewayInfo:f??null,nodeCollectorInfo:w??null,isLoading:O})]}),t(Rf,{isLoading:O,pods:A,withSpanDropRate:!1===g?.odigosOwnTelemetryStore?.metricsStoreDisabled}),!o&&t(Rr,{minSupportedVersion:l,currentVersion:i||""})]})]})},Bf=b.div`
1315
+ `,Bf=({selectedTab:n,gatewayInfo:o,nodeCollectorInfo:i,isLoading:l})=>{const{formatTimeAgo:r}=on(),[s,d]=a(null),p=c(()=>(e=>{switch(e){case $f.Gateway:return"Deployment";case $f.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(n),[n]),u=c(()=>((e,t,n,o)=>{const i={status:Ee.Disabled,label:"No rollouts yet"};let a=!1,l=null;switch(e){case $f.Gateway:a=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case $f.Node:a=n?.rolloutInProgress??!1,l=n?.lastRolloutAt??null;break;default:return i}return a?{status:Ee.Info,label:"Rollout in progress",rightIcon:sl,useSecondaryTone:!0}:l?{status:Ee.Disabled,label:`Last Rollout: ${o(l)}`}:i})(n,o,i,r),[o,i,n,r]),h=c(()=>((e,t,n,o)=>{let i=o?Ee.Info:Ee.Unknown,a=o?"Loading":ua.Unknown,l=o?"Fetching data...":Ff(ua.Unknown);switch(e){case $f.Gateway:i=t?.status?pa(t?.status):i,a=t?.status??a,l=t?.status?Ff(t.status):l;break;case $f.Node:i=n?.status?pa(n?.status):i,a=n?.status??a,l=n?.status?Ff(n.status):l}return{status:i,title:a,description:l}})(n,o,i,l),[o,i,n,l]),m=c(()=>((e,t,n)=>{switch(e){case $f.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 $f.Node:return[{gaugeWidth:128,min:0,max:n?.nodes?.desired??0,current:n?.nodes?.ready??0,title:"Nodes",primaryLabel:"Ready nodes",secondaryLabel:"Desired nodes"}];default:return[]}})(n,o,i),[o,i,n]),g=c(()=>((e,t,n,o)=>{switch(e){case $f.Gateway:return[{title:"Data throughput",cells:[{label:"Traces data",value:kn(t?.throughputTracesBytesPerSec??0),isLoading:o},{label:"Metrics data",value:kn(t?.throughputMetricsBytesPerSec??0),isLoading:o},{label:"Logs data",value:kn(t?.throughputLogsBytesPerSec??0),isLoading:o}]},{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${t?.resources?.requests.cpu}/${t?.resources?.limits.cpu}`,isLoading:o},{label:"Memory",value:`${t?.resources?.requests.memory}/${t?.resources?.limits.memory}`,isLoading:o}]}];case $f.Node:return[{title:"Data Throughput",cells:[{label:"Traces data",value:kn(n?.throughputTracesBytesPerSec??0),isLoading:o},{label:"Metrics data",value:kn(n?.throughputMetricsBytesPerSec??0),isLoading:o},{label:"Logs data",value:kn(n?.throughputLogsBytesPerSec??0),isLoading:o}]},{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${n?.resources?.requests.cpu}/${n?.resources?.limits.cpu}`,isLoading:o},{label:"Memory",value:`${n?.resources?.requests.memory}/${n?.resources?.limits.memory}`,isLoading:o}]}];default:return[]}})(n,o,i,l),[o,i,n,l]),f=c(()=>(n===$f.Gateway?o?.manifestYAML:i?.manifestYAML)??"",[o,i,n]),b=c(()=>(n===$f.Gateway?o?.configMapYAML:i?.configMapYAML)??"",[o,i,n]);return e(Gt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:Bl,title:p,badge:u},actions:[{id:mo(),type:mn.ButtonDropData,buttonProps:{variant:ve.Secondary,size:be.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:Mf.ManifestYaml,label:p,icon:Xl},{id:Mf.ConfigMapYaml,label:"ConfigMap",icon:Xl}]}}],children:[e(pe,{$gap:16,children:[t("div",{children:t(ha,{...h})}),m.map(e=>t(zf,{children:t("div",{children:t(ma,{...e})})},e.title)),g.map(e=>t(ga,{...e},e.title))]}),t(Lf,{isOpen:s===Mf.ManifestYaml,onClose:()=>d(null),title:p,yaml:f}),t(Lf,{isOpen:s===Mf.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},Xf=[{value:$f.Gateway,label:"Gateway"},{value:$f.Node,label:"Node Collector"}],Uf=({minSupportedVersion:n})=>{const{isVersionSupported:o,version:i,minSupportedVersion:l}=S(n),[r,s]=a($f.Gateway),p=r===$f.Gateway,u=r===$f.Node,{collectorsApi:h,configApi:m}=jl(),{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=c(()=>p?y:I,[y,I,p]);return e(Bi,{children:[t(Af,{disabled:!o,loading:O,onClickDownloadDiagnose:void 0,onClickRefresh:$}),e(fa,{children:[e(ee,{children:[t(ce,{variant:Pn.Underline,size:ke.L,options:Xf,selected:r,setSelected:s}),t(Bf,{selectedTab:r,gatewayInfo:f??null,nodeCollectorInfo:w??null,isLoading:O})]}),t(Pf,{isLoading:O,pods:A,withSpanDropRate:!1===g?.odigosOwnTelemetryStore?.metricsStoreDisabled}),!o&&t(_r,{minSupportedVersion:l,currentVersion:i||""})]})]})},Vf=b.div`
1316
1316
  display: inline-flex;
1317
1317
  align-items: center;
1318
1318
  min-width: 0;
1319
1319
  overflow: hidden;
1320
1320
  white-space: pre;
1321
1321
  text-overflow: ellipsis;
1322
- `,Xf=b.div`
1322
+ `,Hf=b.div`
1323
1323
  display: flex;
1324
1324
  flex-direction: column;
1325
1325
  gap: 4px;
1326
1326
  min-width: 0;
1327
1327
  flex: 1;
1328
1328
  opacity: ${({$disabled:e})=>e?.4:1};
1329
- `,Uf=b(pe)`
1329
+ `,jf=b(pe)`
1330
1330
  flex-shrink: 0;
1331
1331
  gap: 6px;
1332
1332
  align-items: center;
1333
1333
  min-height: 22px;
1334
- `,Vf=[{key:"content",label:"Content",noSort:!0,noFilter:!0,flex:1},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],Hf=[{value:"all",label:ga},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],jf=({title:n,items:o,isLoading:i,showTypeFilter:l,onRuleClick:r,onCreateRule:s,onEditRule:p,onDeleteRule:u})=>{const h=v(),[m,g]=a(""),[f,b]=a("all"),y=c(()=>{let e=((e,t,n)=>n&&"all"!==t?e.filter(e=>e.typeBadge===t):e)(o,f,l);return e=((e,t)=>{if(!t.trim())return e;const n=t.toLowerCase();return e.filter(e=>{const t=e.name?.toLowerCase().includes(n),o=e.summary.map(e=>e.text).join("").toLowerCase();return t||o.includes(n)})})(e,m),e},[o,f,l,m]),C=c(()=>y.map(n=>{const o=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(Xf,{$disabled:n.disabled,children:[t(Bf,{children:t(w,{parts:n.summary})}),n.name&&t(_e,{size:Te.XXS,color:Pe.Secondary,nowrap:!0,children:n.name})]})},{key:"badges",rawValue:n.typeBadge||"",component:()=>e(Uf,{children:[n.disabled&&t(Ke,{label:Mn,textSize:Te.XXXS,backgroundColor:h.v2.colors.grey[700],textColor:h.v2.colors.grey[300]}),n.typeBadge&&o&&t(Ke,{label:n.typeBadge,textSize:Te.XXXS,backgroundColor:o.bg,textColor:o.text})]})}],onClick:()=>r(n)}}),[y,h,r]),S=c(()=>{const e=e=>t(Fa,{...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:Vn,leftIcon:Ma,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(st,{fullHeight:!0,richTitle:{icon:Il,title:n,badge:{label:o.length,backgroundColor:h.v2.colors.silver[600],textColor:h.v2.colors.white[500]}},search:{"data-id":"sampling-search-rules",value:m,onChange:g,placeholder:"Search..",width:"500px",...l?{segment:{"data-id":"sampling-segment-type-filter",options:Hf,selected:f,setSelected:b}}:{}},children:t(Pn,{variant:Ln.Pretty,hideHeader:!0,isLoading:i,noDataProps:m.trim()?{hideIcon:!0,title:fa,subTitle:ya(m)}:{hideIcon:!0,title:va,button:{label:ba,onClick:s}},columns:Vf,rows:C,getRowActions:x})})},Gf=({docsUrl:n})=>{const{samplingApi:o,sourcesApi:l}=Vl(),{items:r}=l.useSources(),s=c(()=>r.map(e=>({id:e.id})),[r]),{items:u,loading:h,k8sHealthProbesConfig:m,refetch:g}=o.useSamplingRules(),f=d((e,t)=>o.createNoisy?.({samplingId:e,rule:t}),[o]),b=d((e,t,n)=>o.updateNoisy?.(t,{samplingId:e,rule:n}),[o]),v=d((e,t)=>o.createHighlyRelevant?.({samplingId:e,rule:t}),[o]),y=d((e,t,n)=>o.updateHighlyRelevant?.(t,{samplingId:e,rule:n}),[o]),C=d((e,t)=>o.createCostReduction?.({samplingId:e,rule:t}),[o]),S=d((e,t,n)=>o.updateCostReduction?.(t,{samplingId:e,rule:n}),[o]),x=d((e,t,n)=>"noisy"===n?o.deleteNoisy?.(t,e):"highlyRelevant"===n?o.deleteHighlyRelevant?.(t,e):"costReduction"===n?o.deleteCostReduction?.(t,e):void 0,[o]),w=d((e,t)=>o.updateK8sHealthProbesConfig?.({enabled:e,keepPercentage:t}),[o]),T=c(()=>s.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[s]),k=c(()=>Array.from(new Set(s.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[s]),[I,N]=a(P.Noisy),[E,O]=a(null),[$,D]=a(!1),[_,Q]=a(!1),[te,ne]=a(null),[oe,ie]=a(!1),[ae,le]=a(!1),[re,se]=a(!1),[de,ue]=a(!1);p(!1),i(()=>{},[h,u]);const{pendingViewSamplingRule:he,setPendingViewSamplingRule:me}=fn();i(()=>{if(!he)return;if(h||0===u.length)return;me(null);const e=L(u,he.ruleId,he.category);e&&(N(F[he.category]),D(!1),O(e))},[h,u,he,me]);const ge=c(()=>A(m),[m]),ye=c(()=>M(u),[u]),Ce=c(()=>R(ye?.rule??null),[ye]),Se=c(()=>z(u),[u]),xe=c(()=>B(Se?.rule??null),[Se]),we=p(E);we.current=E,i(()=>{const e=we.current;if(!e)return;const t=X(u,e);t?O(t):(O(null),D(!1))},[u]);const Te=c(()=>{const e=new Set;return ye&&e.add(ye.rule.ruleId),Se&&e.add(Se.rule.ruleId),e},[ye,Se]),Ie=c(()=>U(u,I,Te),[u,I,Te]),Oe=d(()=>Q(!0),[]),$e=d(()=>Q(!1),[]);d(()=>ue(!1),[]);const Ae=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]),Re=d(e=>{const t=G(u,e);t&&(D(!1),O(t))},[u]),De=d(()=>{O(null),D(!1)},[]),_e=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 o=[...n.noisyOperations.map(e=>({category:"noisy",rule:e})),...n.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...n.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(o)return D(!0),void O({category:o.category,rule:o.rule,samplingId:t,summary:W(o.category,o.rule)})}},[E,u]),Pe=d(async(e,t,n)=>{const o=E?.category;if(o){switch(o){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]),Le=d((e,t)=>{ne({ruleId:e,samplingId:t})},[]),Fe=d(async()=>{if(!te)return;const{ruleId:e,samplingId:t}=te,n=E?.category||K[I];await x(t,e,n),O(null),D(!1),ne(null)},[te,E,I,x]),Me=d(()=>ne(null),[]),ze=d(async(e,t)=>{await w(e,t),ie(!1)},[w]),Be=d(async e=>{const t=u[0]?.id??"default",n=ye;n?await y(n.samplingId,n.rule.ruleId,{name:n.rule.name,disabled:!e,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null,notes:n.rule.notes}):e&&await v(t,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}),le(!1)},[u,ye,v,y]),Xe=d(async(e,t)=>{const n=u[0]?.id??"default",o=Se;o?await S(o.samplingId,o.rule.ruleId,{name:o.rule.name,disabled:!e,sourceScopes:null,operation:null,percentageAtMost:t,notes:o.rule.notes}):e&&await C(n,{name:"Auto - Drop Traces Cluster-Wide",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:t}),se(!1)},[u,Se,C,S]),Ue=d(e=>{const t=K[I];let n=null;switch(t){case"noisy":{const o=j(e);n=Y(u,t,{sourceScopes:o.sourceScopes,operation:o.operation});break}case"highlyRelevant":{const o=H(e);n=Y(u,t,{sourceScopes:o.sourceScopes,operation:o.operation,error:o.error??!1,durationAtLeastMs:o.durationAtLeastMs});break}case"costReduction":{const o=V(e);n=Y(u,t,{sourceScopes:o.sourceScopes,operation:o.operation});break}}return n?{message:Ca,ruleId:n}:null},[u,I]),Ve=d(e=>{const t=E?.category,n=E?.rule.ruleId;if(!t)return null;let o=null;switch(t){case"noisy":{const i=j(e);o=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation},n);break}case"highlyRelevant":{const i=H(e);o=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation,error:i.error??!1,durationAtLeastMs:i.durationAtLeastMs},n);break}case"costReduction":{const i=V(e);o=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation},n);break}}return o?{message:Ca,ruleId:o}:null},[u,E]),He=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]),je=c(()=>{const e=[];return n&&e.push({id:ho(),type:hn.Button,buttonProps:{"data-id":"sampling-btn-docs",label:Sa,leftIcon:La,size:be.S,variant:ve.Text,onClick:()=>window.open(n,"_blank")}}),e.push({id:ho(),type:hn.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:xa,leftIcon:ll,size:be.S,variant:ve.Text,onClick:g,loading:h}}),e.push({id:ho(),type:hn.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:wa,rightIcon:Ra,size:be.S,variant:ve.Primary,onClick:Oe}}),e},[n,g,h,Oe]);return e(zi,{children:[e(pe,{$gap:12,$justifyContent:"space-between",children:[t(ra,{icon:Il,title:ka,subTitle:Ta}),t(sa,{actions:je})]}),e(ee,{$gap:12,$fullHeight:!0,children:[t(ce,{variant:_n.Underline,size:ke.L,options:J,selected:I,setSelected:N}),e(pe,{$justifyContent:"space-between",children:[t(Ne,{status:Ee.Default,message:q[I]}),n&&t(fe,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:La,size:be.S,variant:ve.Text,onClick:()=>window.open(n,"_blank")})]}),I===P.Noisy?t(fr,{title:at,summary:ge,onEdit:()=>ie(!0)}):I===P.HighlyRelevant?t(fr,{title:et,summary:Ce,onEdit:()=>le(!0)}):I===P.CostReduction?t(fr,{title:ot,summary:xe,onEdit:()=>se(!0)}):null,t(jf,{title:Z[I],items:Ie,isLoading:h,showTypeFilter:I===P.HighlyRelevant,onRuleClick:Re,onCreateRule:Oe,onEditRule:_e,onDeleteRule:Le})]}),t(Hh,{formType:Yl.View,data:E,defaultEditMode:$,onClose:De,onDelete:Le,onSaveEdit:Pe,sourceOptions:T,namespaceOptions:k,validateForm:Ve,onNavigateToDuplicate:He}),t(Hh,{formType:Yl.Create,isOpen:_,category:K[I],onClose:$e,onSubmit:Ae,sourceOptions:T,namespaceOptions:k,validateForm:Ue,onNavigateToDuplicate:He}),t(Hh,{formType:Yl.EditAutoNoisy,isOpen:oe,enabled:m?.enabled??!1,keepPercentage:m?.keepPercentage??0,onClose:()=>ie(!1),onSave:ze}),t(Hh,{formType:Yl.EditAutoHighlyRelevant,isOpen:ae,enabled:!!ye&&!ye.rule.disabled,onClose:()=>le(!1),onSave:Be}),t(Hh,{formType:Yl.EditAutoCostReduction,isOpen:re,enabled:!!Se&&!Se.rule.disabled,dropPercentage:Se?.rule.percentageAtMost??25,onClose:()=>se(!1),onSave:Xe}),t(qe,{title:Oa,description:Ea,isOpen:!!te,onClose:Me,denyButton:{label:Na,variant:ve.Secondary,onClick:Me},approveButton:{label:Ia,variant:ve.Primary,onClick:()=>{Fe(),Me()}}}),!1]})},Wf=b.div`
1334
+ `,Gf=[{key:"content",label:"Content",noSort:!0,noFilter:!0,flex:1},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],Wf=[{value:"all",label:ba},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],Kf=({title:n,items:o,isLoading:i,showTypeFilter:l,onRuleClick:r,onCreateRule:s,onEditRule:p,onDeleteRule:u})=>{const h=v(),[m,g]=a(""),[f,b]=a("all"),y=c(()=>{let e=((e,t,n)=>n&&"all"!==t?e.filter(e=>e.typeBadge===t):e)(o,f,l);return e=((e,t)=>{if(!t.trim())return e;const n=t.toLowerCase();return e.filter(e=>{const t=e.name?.toLowerCase().includes(n),o=e.summary.map(e=>e.text).join("").toLowerCase();return t||o.includes(n)})})(e,m),e},[o,f,l,m]),C=c(()=>y.map(n=>{const o=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(Hf,{$disabled:n.disabled,children:[t(Vf,{children:t(w,{parts:n.summary})}),n.name&&t(_e,{size:Te.XXS,color:Pe.Secondary,nowrap:!0,children:n.name})]})},{key:"badges",rawValue:n.typeBadge||"",component:()=>e(jf,{children:[n.disabled&&t(Ke,{label:zn,textSize:Te.XXXS,backgroundColor:h.v2.colors.grey[700],textColor:h.v2.colors.grey[300]}),n.typeBadge&&o&&t(Ke,{label:n.typeBadge,textSize:Te.XXXS,backgroundColor:o.bg,textColor:o.text})]})}],onClick:()=>r(n)}}),[y,h,r]),S=c(()=>{const e=e=>t(za,{...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:Hn,leftIcon:Ba,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(st,{fullHeight:!0,richTitle:{icon:El,title:n,badge:{label:o.length,backgroundColor:h.v2.colors.silver[600],textColor:h.v2.colors.white[500]}},search:{"data-id":"sampling-search-rules",value:m,onChange:g,placeholder:"Search..",width:"500px",...l?{segment:{"data-id":"sampling-segment-type-filter",options:Wf,selected:f,setSelected:b}}:{}},children:t(Ln,{variant:Fn.Pretty,hideHeader:!0,isLoading:i,noDataProps:m.trim()?{hideIcon:!0,title:va,subTitle:Sa(m)}:{hideIcon:!0,title:Ca,button:{label:ya,onClick:s}},columns:Gf,rows:C,getRowActions:x})})},Yf=({docsUrl:n})=>{const{samplingApi:o,sourcesApi:l}=jl(),{items:r}=l.useSources(),s=c(()=>r.map(e=>({id:e.id})),[r]),{items:u,loading:h,k8sHealthProbesConfig:m,refetch:g}=o.useSamplingRules(),f=d((e,t)=>o.createNoisy?.({samplingId:e,rule:t}),[o]),b=d((e,t,n)=>o.updateNoisy?.(t,{samplingId:e,rule:n}),[o]),v=d((e,t)=>o.createHighlyRelevant?.({samplingId:e,rule:t}),[o]),y=d((e,t,n)=>o.updateHighlyRelevant?.(t,{samplingId:e,rule:n}),[o]),C=d((e,t)=>o.createCostReduction?.({samplingId:e,rule:t}),[o]),S=d((e,t,n)=>o.updateCostReduction?.(t,{samplingId:e,rule:n}),[o]),x=d((e,t,n)=>"noisy"===n?o.deleteNoisy?.(t,e):"highlyRelevant"===n?o.deleteHighlyRelevant?.(t,e):"costReduction"===n?o.deleteCostReduction?.(t,e):void 0,[o]),w=d((e,t)=>o.updateK8sHealthProbesConfig?.({enabled:e,keepPercentage:t}),[o]),T=c(()=>s.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[s]),k=c(()=>Array.from(new Set(s.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[s]),[I,N]=a(P.Noisy),[E,O]=a(null),[$,D]=a(!1),[_,Q]=a(!1),[te,ne]=a(null),[oe,ie]=a(!1),[ae,le]=a(!1),[re,se]=a(!1),[de,ue]=a(!1);p(!1),i(()=>{},[h,u]);const{pendingViewSamplingRule:he,setPendingViewSamplingRule:me}=bn();i(()=>{if(!he)return;if(h||0===u.length)return;me(null);const e=L(u,he.ruleId,he.category);e&&(N(F[he.category]),D(!1),O(e))},[h,u,he,me]);const ge=c(()=>A(m),[m]),ye=c(()=>M(u),[u]),Ce=c(()=>R(ye?.rule??null),[ye]),Se=c(()=>z(u),[u]),xe=c(()=>B(Se?.rule??null),[Se]),we=p(E);we.current=E,i(()=>{const e=we.current;if(!e)return;const t=X(u,e);t?O(t):(O(null),D(!1))},[u]);const Te=c(()=>{const e=new Set;return ye&&e.add(ye.rule.ruleId),Se&&e.add(Se.rule.ruleId),e},[ye,Se]),Ie=c(()=>U(u,I,Te),[u,I,Te]),Oe=d(()=>Q(!0),[]),$e=d(()=>Q(!1),[]);d(()=>ue(!1),[]);const Ae=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]),Re=d(e=>{const t=G(u,e);t&&(D(!1),O(t))},[u]),De=d(()=>{O(null),D(!1)},[]),_e=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 o=[...n.noisyOperations.map(e=>({category:"noisy",rule:e})),...n.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...n.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(o)return D(!0),void O({category:o.category,rule:o.rule,samplingId:t,summary:W(o.category,o.rule)})}},[E,u]),Pe=d(async(e,t,n)=>{const o=E?.category;if(o){switch(o){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]),Le=d((e,t)=>{ne({ruleId:e,samplingId:t})},[]),Fe=d(async()=>{if(!te)return;const{ruleId:e,samplingId:t}=te,n=E?.category||K[I];await x(t,e,n),O(null),D(!1),ne(null)},[te,E,I,x]),Me=d(()=>ne(null),[]),ze=d(async(e,t)=>{await w(e,t),ie(!1)},[w]),Be=d(async e=>{const t=u[0]?.id??"default",n=ye;n?await y(n.samplingId,n.rule.ruleId,{name:n.rule.name,disabled:!e,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null,notes:n.rule.notes}):e&&await v(t,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}),le(!1)},[u,ye,v,y]),Xe=d(async(e,t)=>{const n=u[0]?.id??"default",o=Se;o?await S(o.samplingId,o.rule.ruleId,{name:o.rule.name,disabled:!e,sourceScopes:null,operation:null,percentageAtMost:t,notes:o.rule.notes}):e&&await C(n,{name:"Auto - Drop Traces Cluster-Wide",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:t}),se(!1)},[u,Se,C,S]),Ue=d(e=>{const t=K[I];let n=null;switch(t){case"noisy":{const o=j(e);n=Y(u,t,{sourceScopes:o.sourceScopes,operation:o.operation});break}case"highlyRelevant":{const o=H(e);n=Y(u,t,{sourceScopes:o.sourceScopes,operation:o.operation,error:o.error??!1,durationAtLeastMs:o.durationAtLeastMs});break}case"costReduction":{const o=V(e);n=Y(u,t,{sourceScopes:o.sourceScopes,operation:o.operation});break}}return n?{message:xa,ruleId:n}:null},[u,I]),Ve=d(e=>{const t=E?.category,n=E?.rule.ruleId;if(!t)return null;let o=null;switch(t){case"noisy":{const i=j(e);o=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation},n);break}case"highlyRelevant":{const i=H(e);o=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation,error:i.error??!1,durationAtLeastMs:i.durationAtLeastMs},n);break}case"costReduction":{const i=V(e);o=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation},n);break}}return o?{message:xa,ruleId:o}:null},[u,E]),He=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]),je=c(()=>{const e=[];return n&&e.push({id:mo(),type:mn.Button,buttonProps:{"data-id":"sampling-btn-docs",label:wa,leftIcon:Ma,size:be.S,variant:ve.Text,onClick:()=>window.open(n,"_blank")}}),e.push({id:mo(),type:mn.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:Ta,leftIcon:sl,size:be.S,variant:ve.Text,onClick:g,loading:h}}),e.push({id:mo(),type:mn.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:ka,rightIcon:_a,size:be.S,variant:ve.Primary,onClick:Oe}}),e},[n,g,h,Oe]);return e(Bi,{children:[e(pe,{$gap:12,$justifyContent:"space-between",children:[t(ca,{icon:El,title:Na,subTitle:Ia}),t(da,{actions:je})]}),e(ee,{$gap:12,$fullHeight:!0,children:[t(ce,{variant:Pn.Underline,size:ke.L,options:J,selected:I,setSelected:N}),e(pe,{$justifyContent:"space-between",children:[t(Ne,{status:Ee.Default,message:q[I]}),n&&t(fe,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:Ma,size:be.S,variant:ve.Text,onClick:()=>window.open(n,"_blank")})]}),I===P.Noisy?t(vr,{title:at,summary:ge,onEdit:()=>ie(!0)}):I===P.HighlyRelevant?t(vr,{title:et,summary:Ce,onEdit:()=>le(!0)}):I===P.CostReduction?t(vr,{title:ot,summary:xe,onEdit:()=>se(!0)}):null,t(Kf,{title:Z[I],items:Ie,isLoading:h,showTypeFilter:I===P.HighlyRelevant,onRuleClick:Re,onCreateRule:Oe,onEditRule:_e,onDeleteRule:Le})]}),t(Wh,{formType:ql.View,data:E,defaultEditMode:$,onClose:De,onDelete:Le,onSaveEdit:Pe,sourceOptions:T,namespaceOptions:k,validateForm:Ve,onNavigateToDuplicate:He}),t(Wh,{formType:ql.Create,isOpen:_,category:K[I],onClose:$e,onSubmit:Ae,sourceOptions:T,namespaceOptions:k,validateForm:Ue,onNavigateToDuplicate:He}),t(Wh,{formType:ql.EditAutoNoisy,isOpen:oe,enabled:m?.enabled??!1,keepPercentage:m?.keepPercentage??0,onClose:()=>ie(!1),onSave:ze}),t(Wh,{formType:ql.EditAutoHighlyRelevant,isOpen:ae,enabled:!!ye&&!ye.rule.disabled,onClose:()=>le(!1),onSave:Be}),t(Wh,{formType:ql.EditAutoCostReduction,isOpen:re,enabled:!!Se&&!Se.rule.disabled,dropPercentage:Se?.rule.percentageAtMost??25,onClose:()=>se(!1),onSave:Xe}),t(qe,{title:Aa,description:$a,isOpen:!!te,onClose:Me,denyButton:{label:Oa,variant:ve.Secondary,onClick:Me},approveButton:{label:Ea,variant:ve.Primary,onClick:()=>{Fe(),Me()}}}),!1]})},Jf=b.div`
1335
1335
  padding: 12px;
1336
1336
  border-radius: 12px;
1337
1337
  background-color: ${({theme:e})=>e.v2.colors.silver[750]};
1338
- `,Kf=f(({id:e,data:n})=>t(Wf,{"data-id":e,children:t(xe,{...n})}));var Yf,Jf;Kf.displayName=Kf.name,(e=>{e.MapItem="map-item",e.NoData="no-data"})(Yf||(Yf={})),(e=>{e.AnimatedTraffic="animated-traffic"})(Jf||(Jf={}));const qf=(e,t,n)=>{if(n)return{icons:[gl],aggService:e,selected:!0};const o=e.isVirtual,i=o?[vn(e)]:t?yn(t):[Bl],{priorotizedStatus:a}=o?{priorotizedStatus:void 0}:qi(t?.conditions||[]);return{icons:i,status:a,isVirtual:o,aggService:e,selected:!0}},Zf=e=>!(!e||e.serviceName!==Op||e.id.namespace||e.id.name||e.id.kind),Qf=new Yr,eb={"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"},tb=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},nb={id:{namespace:"",name:"",kind:""},serviceName:Op,markedForInstrumentation:{markedForInstrumentation:!0}},ob=h(null),ib=()=>{const e=m(ob);if(!e)throw new Error("useServiceMapContext must be used within a ServiceMapProvider");return e},ab=({serviceMap:e,children:n})=>{const o=v(),{sourcesApi:l}=Vl(),{items:r}=l.useSources(),[s,p,u]=Lr([]),[h,m,g]=Fr([]),[f,b]=a(0),y=d(()=>b(e=>e+1),[]),[C,S]=a(""),[x,w]=a(null),[T,k]=a(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===Yf.MapItem&&n.has(e.id)?{...e,data:{...e.data,selected:t}}:e))},[p]);i(()=>{let t=!1;const n=(e=>{const t=new Map,n=new Set,o=(e,n,o=!1)=>{let i=t.get(e);return i||(i={serviceName:n,isVirtual:o,attributes:{},connectionMap:new Map},t.set(e,i)),i},i=(e,t)=>{if(t)for(const{key:n,value:o}of t)n in e||(e[n]=o)};for(const t of e){const{graphKey:e}=tb(t.nodeId),a=o(e,t.serviceName);a.isVirtual=!1;for(const e of t.services){const{graphKey:t,detail:l}=tb(e?.nodeId??"");e.isVirtual&&(n.add(t),i(o(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[i,a]of e)t.has(i)||o(i,a.targetServiceName,n.has(i));const l=[];for(const[e,{serviceName:n,isVirtual:o,attributes:i,connectionMap:a}]of t){const t=[...a.values()];t.sort((e,t)=>e.targetGraphKey.localeCompare(t.targetGraphKey)),l.push({graphKey:e,serviceName:n,isVirtual:o,connections:t,attributes:i})}return l.sort((e,t)=>e.graphKey.localeCompare(t.graphKey)),l})(e),i=(({sources:e,aggregatedServiceMap:t})=>{const n=[],o={x:0,y:0};if(t.length&&e.length)for(const i of t){const t=e.find(e=>i.serviceName===e.serviceName||i.serviceName===e.id.name),a=Zf(t);n.push({id:i.graphKey,type:Yf.MapItem,position:o,data:qf(i,t,a),measured:{width:80,height:80}})}else n.push({id:Yf.NoData,type:Yf.NoData,position:o,data:{subTitle:Ze.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return n})({aggregatedServiceMap:n,sources:[nb].concat(r)});if(1===i.length&&i[0].id===Yf.NoData)return p(i),m([]),S(""),void y();const a=(({theme:e,nodes:t,aggregatedServiceMap:n})=>{const o=[],i=new Map(t.map(e=>[e.id,e]));for(const t of n){const n=t.graphKey,a=i.get(n);if(!a)continue;const l=a.data?.status===Ee.Error;for(const a of t.connections){const r=a.targetGraphKey;i.has(r)&&o.push({id:`${n}-to-${r}`,type:"smoothstep",source:n,target:r,data:{sourceGraphKey:t.graphKey,targetGraphKey:a.targetGraphKey},markerEnd:{type:Pr.ArrowClosed},style:{stroke:l?e?.colors.dark_red:e?.colors.border}})}}return o})({theme:o,nodes:i,aggregatedServiceMap:n});m(a);const l=i.map(e=>e.id).sort().join("|");if(l!==C)return(async(e,t,n={})=>{const o={id:"root",layoutOptions:{...eb,...n},children:e.map(e=>({id:e.id,width:80,height:80,...e.id===Op?{layoutOptions:{"elk.layered.layering.layerConstraint":"FIRST","elk.alignment":"CENTER"}}:{}})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},i=await Qf.layout(o),a=new Map;return i.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}})(i,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 i.map(e=>{const n=t.get(e.id);return n?e.type===Yf.MapItem&&n.type===Yf.MapItem?{...e,position:n.position,data:{...e.data,selected:n.data.selected}}:{...e,position:n.position}:e})})},[o,e,r,C]);const O=c(()=>x||T?h.map(e=>{if(e.source===x||e.target===x||e.source===T||e.target===T)return{...e,type:Jf.AnimatedTraffic};const t={opacity:.3};return{...e,style:{...e.style,...t},labelStyle:{...e.labelStyle,...t},labelBgStyle:{...e.labelBgStyle,...t}}}):h,[h,x,T]),$=c(()=>({nodes:s,edges:O,onNodesChange:u,onEdgesChange:g,setNodesSelected:E,fitViewTrigger:f,hoveredNodeId:x,setHoveredNodeId:w,activeNodeId:T,toggleActiveNode:I,resetActiveNode:N}),[s,O,u,g,E,f,x,T,I,N]);return t(ob.Provider,{value:$,children:n})},lb=b.div`
1338
+ `,qf=f(({id:e,data:n})=>t(Jf,{"data-id":e,children:t(xe,{...n})}));var Zf,Qf;qf.displayName=qf.name,(e=>{e.MapItem="map-item",e.NoData="no-data"})(Zf||(Zf={})),(e=>{e.AnimatedTraffic="animated-traffic"})(Qf||(Qf={}));const eb=(e,t,n)=>{if(n)return{icons:[bl],aggService:e,selected:!0};const o=e.isVirtual,i=o?[yn(e)]:t?Cn(t):[Ul],{priorotizedStatus:a}=o?{priorotizedStatus:void 0}:Qi(t?.conditions||[]);return{icons:i,status:a,isVirtual:o,aggService:e,selected:!0}},tb=e=>!(!e||e.serviceName!==Rp||e.id.namespace||e.id.name||e.id.kind),nb=new qr,ob={"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"},ib=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},ab={id:{namespace:"",name:"",kind:""},serviceName:Rp,markedForInstrumentation:{markedForInstrumentation:!0}},lb=h(null),rb=()=>{const e=m(lb);if(!e)throw new Error("useServiceMapContext must be used within a ServiceMapProvider");return e},sb=({serviceMap:e,children:n})=>{const o=v(),{sourcesApi:l}=jl(),{items:r}=l.useSources(),[s,p,u]=Mr([]),[h,m,g]=zr([]),[f,b]=a(0),y=d(()=>b(e=>e+1),[]),[C,S]=a(""),[x,w]=a(null),[T,k]=a(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===Zf.MapItem&&n.has(e.id)?{...e,data:{...e.data,selected:t}}:e))},[p]);i(()=>{let t=!1;const n=(e=>{const t=new Map,n=new Set,o=(e,n,o=!1)=>{let i=t.get(e);return i||(i={serviceName:n,isVirtual:o,attributes:{},connectionMap:new Map},t.set(e,i)),i},i=(e,t)=>{if(t)for(const{key:n,value:o}of t)n in e||(e[n]=o)};for(const t of e){const{graphKey:e}=ib(t.nodeId),a=o(e,t.serviceName);a.isVirtual=!1;for(const e of t.services){const{graphKey:t,detail:l}=ib(e?.nodeId??"");e.isVirtual&&(n.add(t),i(o(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[i,a]of e)t.has(i)||o(i,a.targetServiceName,n.has(i));const l=[];for(const[e,{serviceName:n,isVirtual:o,attributes:i,connectionMap:a}]of t){const t=[...a.values()];t.sort((e,t)=>e.targetGraphKey.localeCompare(t.targetGraphKey)),l.push({graphKey:e,serviceName:n,isVirtual:o,connections:t,attributes:i})}return l.sort((e,t)=>e.graphKey.localeCompare(t.graphKey)),l})(e),i=(({sources:e,aggregatedServiceMap:t})=>{const n=[],o={x:0,y:0};if(t.length&&e.length)for(const i of t){const t=e.find(e=>i.serviceName===e.serviceName||i.serviceName===e.id.name),a=tb(t);n.push({id:i.graphKey,type:Zf.MapItem,position:o,data:eb(i,t,a),measured:{width:80,height:80}})}else n.push({id:Zf.NoData,type:Zf.NoData,position:o,data:{subTitle:Ze.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return n})({aggregatedServiceMap:n,sources:[ab].concat(r)});if(1===i.length&&i[0].id===Zf.NoData)return p(i),m([]),S(""),void y();const a=(({theme:e,nodes:t,aggregatedServiceMap:n})=>{const o=[],i=new Map(t.map(e=>[e.id,e]));for(const t of n){const n=t.graphKey,a=i.get(n);if(!a)continue;const l=a.data?.status===Ee.Error;for(const a of t.connections){const r=a.targetGraphKey;i.has(r)&&o.push({id:`${n}-to-${r}`,type:"smoothstep",source:n,target:r,data:{sourceGraphKey:t.graphKey,targetGraphKey:a.targetGraphKey},markerEnd:{type:Fr.ArrowClosed},style:{stroke:l?e?.colors.dark_red:e?.colors.border}})}}return o})({theme:o,nodes:i,aggregatedServiceMap:n});m(a);const l=i.map(e=>e.id).sort().join("|");if(l!==C)return(async(e,t,n={})=>{const o={id:"root",layoutOptions:{...ob,...n},children:e.map(e=>({id:e.id,width:80,height:80,...e.id===Rp?{layoutOptions:{"elk.layered.layering.layerConstraint":"FIRST","elk.alignment":"CENTER"}}:{}})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},i=await nb.layout(o),a=new Map;return i.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}})(i,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 i.map(e=>{const n=t.get(e.id);return n?e.type===Zf.MapItem&&n.type===Zf.MapItem?{...e,position:n.position,data:{...e.data,selected:n.data.selected}}:{...e,position:n.position}:e})})},[o,e,r,C]);const O=c(()=>x||T?h.map(e=>{if(e.source===x||e.target===x||e.source===T||e.target===T)return{...e,type:Qf.AnimatedTraffic};const t={opacity:.3};return{...e,style:{...e.style,...t},labelStyle:{...e.labelStyle,...t},labelBgStyle:{...e.labelBgStyle,...t}}}):h,[h,x,T]),$=c(()=>({nodes:s,edges:O,onNodesChange:u,onEdgesChange:g,setNodesSelected:E,fitViewTrigger:f,hoveredNodeId:x,setHoveredNodeId:w,activeNodeId:T,toggleActiveNode:I,resetActiveNode:N}),[s,O,u,g,E,f,x,T,I,N]);return t(lb.Provider,{value:$,children:n})},cb=b.div`
1339
1339
  border: 1px ${({theme:e,$isSelected:t,$isVirtual:n})=>t?`solid ${e.v2.colors.blue[300]}`:n?`dashed ${e.v2.colors.silver[300]}`:"solid transparent"};
1340
1340
  border-radius: 8px;
1341
1341
  cursor: pointer;
1342
1342
  opacity: ${({$isVirtual:e})=>e?.8:1};
1343
- `,rb=b.div`
1343
+ `,db=b.div`
1344
1344
  position: relative;
1345
- `,sb=b.div`
1345
+ `,pb=b.div`
1346
1346
  position: absolute;
1347
1347
  top: 100%;
1348
1348
  left: 50%;
@@ -1351,7 +1351,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1351
1351
  align-items: center;
1352
1352
  gap: 4px;
1353
1353
  margin-top: 4px;
1354
- `,cb=f(({id:o,data:i})=>{const{icons:a,status:l,isVirtual:r}=i,s=v(),{activeNodeId:d,hoveredNodeId:p}=ib(),{isUserSource:u,isNodeSelected:h,isHovered:m}=c(()=>({isUserSource:o===Op,isNodeSelected:d===o,isHovered:p===o}),[o,d,p,o]),{isSelected:g,isHighlighted:f}=c(()=>({isSelected:h||u,isHighlighted:h||m||u}),[h,m,u]),b=l?Nn(l,s):null;return e(n,{children:[t(Mr,{type:"source",position:zr.Right,style:{visibility:"hidden"}}),t(Mr,{type:"target",position:zr.Left,style:{visibility:"hidden"}}),e(rb,{"data-id":o,children:[t(lb,{$isSelected:g,$isVirtual:r,children:t(Cn,{padding:12,icons:a,status:f?Ee.Info:l})}),e(sb,{children:[b&&t(b,{}),t(_e,{size:Te.XXS,nowrap:!0,children:o})]})]})]})});cb.displayName=cb.name;const db=b.div`
1354
+ `,ub=f(({id:o,data:i})=>{const{icons:a,status:l,isVirtual:r}=i,s=v(),{activeNodeId:d,hoveredNodeId:p}=rb(),{isUserSource:u,isNodeSelected:h,isHovered:m}=c(()=>({isUserSource:o===Rp,isNodeSelected:d===o,isHovered:p===o}),[o,d,p,o]),{isSelected:g,isHighlighted:f}=c(()=>({isSelected:h||u,isHighlighted:h||m||u}),[h,m,u]),b=l?En(l,s):null;return e(n,{children:[t(Br,{type:"source",position:Xr.Right,style:{visibility:"hidden"}}),t(Br,{type:"target",position:Xr.Left,style:{visibility:"hidden"}}),e(db,{"data-id":o,children:[t(cb,{$isSelected:g,$isVirtual:r,children:t(Sn,{padding:12,icons:a,status:f?Ee.Info:l})}),e(pb,{children:[b&&t(b,{}),t(_e,{size:Te.XXS,nowrap:!0,children:o})]})]})]})});ub.displayName=ub.name;const hb=b.div`
1355
1355
  display: flex;
1356
1356
  flex-direction: column;
1357
1357
  gap: 12px;
@@ -1364,10 +1364,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1364
1364
  top: 16px;
1365
1365
  left: 8px;
1366
1366
  z-index: ${({theme:e})=>e.v2.zIndex.drawer};
1367
- `,pb=({children:e})=>t(db,{children:e});var ub,hb;(e=>{e.All="All",e.Inbound="Inbound",e.Outbound="Outbound"})(ub||(ub={})),(e=>{e.Inbound="Inbound",e.Outbound="Outbound"})(hb||(hb={}));const mb=b.div`
1367
+ `,mb=({children:e})=>t(hb,{children:e});var gb,fb;(e=>{e.All="All",e.Inbound="Inbound",e.Outbound="Outbound"})(gb||(gb={})),(e=>{e.Inbound="Inbound",e.Outbound="Outbound"})(fb||(fb={}));const bb=b.div`
1368
1368
  flex: 1 1 auto;
1369
1369
  min-height: 0;
1370
- `,gb=()=>{const{nodes:n,activeNodeId:o,resetActiveNode:i}=ib(),[l,r]=a(ub.All),s=c(()=>{const e=new Map;for(const t of n)t.type===Yf.MapItem&&e.set(t.id,t);return e},[n]),d=c(()=>s.get(o??""),[s,o]),{inbound:p,outbound:u}=c(()=>{const e=[],t=[];if(!d)return{inbound:e,outbound:t};for(const e of d.data.aggService?.connections??[])t.push({peerId:e.targetGraphKey,direction:hb.Outbound,totalRequests:e.totalRequests});for(const t of s.values())if(t.id!==d.id)for(const n of t.data.aggService?.connections??[])n.targetGraphKey===d.id&&e.push({peerId:t.id,direction:hb.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,s]);if(!d)return null;const h=[ub.All,ub.Inbound].includes(l)&&p.length>0,m=[ub.All,ub.Outbound].includes(l)&&u.length>0;return e(pb,{children:[e(pe,{$width:"100%",$gap:8,children:[t(fe,{variant:ve.Text,size:be.S,leftIcon:il,onClick:i}),t(Cn,{icons:d.data.icons}),t(_e,{size:Te.XS,children:d.id})]}),t(ce,{fullWidth:!0,options:[{label:`${ub.All}`,value:ub.All,badge:{label:`${p.length+u.length}`}},{label:`${ub.Inbound}`,value:ub.Inbound,badge:{label:`${p.length}`}},{label:`${ub.Outbound}`,value:ub.Outbound,badge:{label:`${u.length}`}}],selected:l,setSelected:r}),h&&t(bb,{halfHeight:m,title:"Inbound",icon:hl,connections:p,mapNodesById:s}),m&&t(bb,{halfHeight:h,title:"Outbound",icon:ml,connections:u,mapNodesById:s})]})},fb=b.div`
1370
+ `,vb=()=>{const{nodes:n,activeNodeId:o,resetActiveNode:i}=rb(),[l,r]=a(gb.All),s=c(()=>{const e=new Map;for(const t of n)t.type===Zf.MapItem&&e.set(t.id,t);return e},[n]),d=c(()=>s.get(o??""),[s,o]),{inbound:p,outbound:u}=c(()=>{const e=[],t=[];if(!d)return{inbound:e,outbound:t};for(const e of d.data.aggService?.connections??[])t.push({peerId:e.targetGraphKey,direction:fb.Outbound,totalRequests:e.totalRequests});for(const t of s.values())if(t.id!==d.id)for(const n of t.data.aggService?.connections??[])n.targetGraphKey===d.id&&e.push({peerId:t.id,direction:fb.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,s]);if(!d)return null;const h=[gb.All,gb.Inbound].includes(l)&&p.length>0,m=[gb.All,gb.Outbound].includes(l)&&u.length>0;return e(mb,{children:[e(pe,{$width:"100%",$gap:8,children:[t(fe,{variant:ve.Text,size:be.S,leftIcon:ll,onClick:i}),t(Sn,{icons:d.data.icons}),t(_e,{size:Te.XS,children:d.id})]}),t(ce,{fullWidth:!0,options:[{label:`${gb.All}`,value:gb.All,badge:{label:`${p.length+u.length}`}},{label:`${gb.Inbound}`,value:gb.Inbound,badge:{label:`${p.length}`}},{label:`${gb.Outbound}`,value:gb.Outbound,badge:{label:`${u.length}`}}],selected:l,setSelected:r}),h&&t(Cb,{halfHeight:m,title:"Inbound",icon:gl,connections:p,mapNodesById:s}),m&&t(Cb,{halfHeight:h,title:"Outbound",icon:fl,connections:u,mapNodesById:s})]})},yb=b.div`
1371
1371
  display: flex;
1372
1372
  flex-direction: column;
1373
1373
  gap: 8px;
@@ -1375,17 +1375,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1375
1375
  border-radius: 12px;
1376
1376
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1377
1377
  height: ${({$halfHeight:e})=>e?"48%":"100%"};
1378
- `,bb=({halfHeight:n,title:o,icon:i,connections:a,mapNodesById:l})=>{const r=v();return e(fb,{$halfHeight:n,children:[e(pe,{children:[t(i,{size:16,fill:r.v2.colors.grey[300]}),t(_e,{size:Te.XXS,color:Pe.Secondary,children:o})]}),t(mb,{children:t(gn,{gap:4,elements:a.map(e=>t(yb,{connection:e,peerNode:l.get(e.peerId)},`${e.direction}-${e.peerId}`))})})]})},vb=b.div`
1378
+ `,Cb=({halfHeight:n,title:o,icon:i,connections:a,mapNodesById:l})=>{const r=v();return e(yb,{$halfHeight:n,children:[e(pe,{children:[t(i,{size:16,fill:r.v2.colors.grey[300]}),t(_e,{size:Te.XXS,color:Pe.Secondary,children:o})]}),t(bb,{children:t(fn,{gap:4,elements:a.map(e=>t(xb,{connection:e,peerNode:l.get(e.peerId)},`${e.direction}-${e.peerId}`))})})]})},Sb=b.div`
1379
1379
  display: flex;
1380
1380
  align-items: center;
1381
1381
  gap: 8px;
1382
1382
  padding: 8px;
1383
1383
  border-radius: 8px;
1384
1384
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1385
- `,yb=({connection:n,peerNode:o})=>e(vb,{children:[o&&t(Cn,{icons:o.data.icons}),e(pe,{$gap:4,$width:"100%",$justifyContent:"space-between",children:[t(_e,{size:Te.XXS,children:n.peerId}),t(Ke,{label:n.totalRequests,tooltip:"Total requests"})]})]}),Cb="0;0.5;1",Sb=f(({id:o,sourceX:i,sourceY:a,targetX:l,targetY:r,sourcePosition:s,targetPosition:c,markerEnd:d})=>{const p=v(),[u]=Br({sourceX:i,sourceY:a,targetX:l,targetY:r,sourcePosition:s,targetPosition:c}),h=`${o}__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(Xr,{id:o,path:u,markerEnd:d,style:{stroke:m,strokeWidth:1}}),t(Ur,{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,o)=>{const i=`-${(.8*o).toFixed(3)}s`;return e("circle",{r:0,fill:g,children:[t("animateMotion",{dur:b,begin:i,repeatCount:"indefinite",children:t("mpath",{href:`#${h}`})}),t("animate",{attributeName:"r",dur:b,begin:i,repeatCount:"indefinite",keyTimes:Cb,values:"0;3.5;3.5"}),t("animate",{attributeName:"fill",dur:b,begin:i,repeatCount:"indefinite",keyTimes:Cb,values:`${g};${f};${f}`})]},o)})]})})]})});Sb.displayName=Sb.name;const xb=b.div`
1385
+ `,xb=({connection:n,peerNode:o})=>e(Sb,{children:[o&&t(Sn,{icons:o.data.icons}),e(pe,{$gap:4,$width:"100%",$justifyContent:"space-between",children:[t(_e,{size:Te.XXS,children:n.peerId}),t(Ke,{label:n.totalRequests,tooltip:"Total requests"})]})]}),wb="0;0.5;1",Tb=f(({id:o,sourceX:i,sourceY:a,targetX:l,targetY:r,sourcePosition:s,targetPosition:c,markerEnd:d})=>{const p=v(),[u]=Ur({sourceX:i,sourceY:a,targetX:l,targetY:r,sourcePosition:s,targetPosition:c}),h=`${o}__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(Vr,{id:o,path:u,markerEnd:d,style:{stroke:m,strokeWidth:1}}),t(Hr,{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,o)=>{const i=`-${(.8*o).toFixed(3)}s`;return e("circle",{r:0,fill:g,children:[t("animateMotion",{dur:b,begin:i,repeatCount:"indefinite",children:t("mpath",{href:`#${h}`})}),t("animate",{attributeName:"r",dur:b,begin:i,repeatCount:"indefinite",keyTimes:wb,values:"0;3.5;3.5"}),t("animate",{attributeName:"fill",dur:b,begin:i,repeatCount:"indefinite",keyTimes:wb,values:`${g};${f};${f}`})]},o)})]})})]})});Tb.displayName=Tb.name;const kb=b.div`
1386
1386
  flex: 1 1 auto;
1387
1387
  min-height: 0;
1388
- `,wb=({})=>{const{nodes:n,setNodesSelected:o,resetActiveNode:i}=ib(),[l,r]=a(""),s=c(()=>n.filter(e=>e.type===Yf.MapItem).sort((e,t)=>e.id.localeCompare(t.id)),[n]),p=c(()=>s.filter(e=>e.data.selected),[s]),u=c(()=>s.filter(e=>e.id.toLowerCase().includes(l.toLowerCase())),[s,l]),h=c(()=>u.every(e=>e.data.selected),[u]),m=d(()=>{const e=!h;o(u.map(e=>e.id),e),e||i()},[u,h,o,i]);return s.length?e(pb,{children:[e(pe,{$width:"100%",$gap:8,children:[t(_e,{size:Te.XS,children:"Services"}),t(Ke,{label:s.length})]}),t(mn,{width:"100%",value:l,onChange:r}),e(pe,{$width:"100%",$justifyContent:"space-between",children:[t(_e,{size:Te.XXXS,children:`Showing ${p.length} out of ${s.length}`}),t(_e,{"data-id":"namespaces-select-all",onClick:m,disabled:!u.length,size:Te.XS,children:h?Ze.UNSELECT_ALL:Ze.SELECT_ALL})]}),t(xb,{children:t(gn,{gap:4,elements:u.map(e=>t(kb,{node:e},e.id))})})]}):null},Tb=b.div`
1388
+ `,Ib=({})=>{const{nodes:n,setNodesSelected:o,resetActiveNode:i}=rb(),[l,r]=a(""),s=c(()=>n.filter(e=>e.type===Zf.MapItem).sort((e,t)=>e.id.localeCompare(t.id)),[n]),p=c(()=>s.filter(e=>e.data.selected),[s]),u=c(()=>s.filter(e=>e.id.toLowerCase().includes(l.toLowerCase())),[s,l]),h=c(()=>u.every(e=>e.data.selected),[u]),m=d(()=>{const e=!h;o(u.map(e=>e.id),e),e||i()},[u,h,o,i]);return s.length?e(mb,{children:[e(pe,{$width:"100%",$gap:8,children:[t(_e,{size:Te.XS,children:"Services"}),t(Ke,{label:s.length})]}),t(gn,{width:"100%",value:l,onChange:r}),e(pe,{$width:"100%",$justifyContent:"space-between",children:[t(_e,{size:Te.XXXS,children:`Showing ${p.length} out of ${s.length}`}),t(_e,{"data-id":"namespaces-select-all",onClick:m,disabled:!u.length,size:Te.XS,children:h?Ze.UNSELECT_ALL:Ze.SELECT_ALL})]}),t(kb,{children:t(fn,{gap:4,elements:u.map(e=>t(Eb,{node:e},e.id))})})]}):null},Nb=b.div`
1389
1389
  display: flex;
1390
1390
  align-items: center;
1391
1391
  gap: 8px;
@@ -1393,7 +1393,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1393
1393
  border-radius: 8px;
1394
1394
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1395
1395
  cursor: pointer;
1396
- `,kb=({node:n})=>{const{setNodesSelected:o,activeNodeId:i,resetActiveNode:a}=ib(),l=d(()=>{const e=!n.data.selected,t=i===n.id;o([n.id],e),!e&&t&&a()},[n,i,o,a]);return e(Tb,{onClick:l,children:[t(ne,{value:n.data.selected||!1,onChange:l}),t(Cn,{icons:n.data.icons}),t(_e,{size:Te.XXS,children:n.id})]},n.id)},Ib=b.div`
1396
+ `,Eb=({node:n})=>{const{setNodesSelected:o,activeNodeId:i,resetActiveNode:a}=rb(),l=d(()=>{const e=!n.data.selected,t=i===n.id;o([n.id],e),!e&&t&&a()},[n,i,o,a]);return e(Nb,{onClick:l,children:[t(ne,{value:n.data.selected||!1,onChange:l}),t(Sn,{icons:n.data.icons}),t(_e,{size:Te.XXS,children:n.id})]},n.id)},Ob=b.div`
1397
1397
  position: relative;
1398
1398
  height: 100%;
1399
1399
  .react-flow__attribution {
@@ -1402,7 +1402,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1402
1402
  * {
1403
1403
  transition: none;
1404
1404
  }
1405
- `,Nb=b.div`
1405
+ `,$b=b.div`
1406
1406
  .react-flow__controls {
1407
1407
  display: flex;
1408
1408
  align-items: center;
@@ -1428,33 +1428,33 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1428
1428
  }
1429
1429
  }
1430
1430
  }
1431
- `,Eb={[Yf.MapItem]:cb,[Yf.NoData]:Kf},Ob={[Jf.AnimatedTraffic]:Sb},$b={duration:300,padding:.1,includeHiddenNodes:!0,maxZoom:1},Ab=({trigger:e})=>{const{fitView:t}=Kr(),n=p(!0);return i(()=>{n.current?n.current=!1:e>0&&requestAnimationFrame(()=>t($b))},[e,t]),null},Rb=({onRefresh:n})=>{const{nodes:o,edges:i,fitViewTrigger:a,onNodesChange:l,onEdgesChange:r,setHoveredNodeId:s,toggleActiveNode:d}=ib(),p=c(()=>{const e=new Set(o.filter(e=>e.type===Yf.MapItem&&e.data.selected).map(e=>e.id)),t=new Set;for(const n of i)e.has(n.source)&&t.add(n.target),e.has(n.target)&&t.add(n.source);return o.filter(e=>e.type!==Yf.MapItem||e.data.selected||t.has(e.id))},[o,i]);return e(Hr,{zoomOnScroll:!0,nodes:p,nodeTypes:Eb,edges:i,edgeTypes:Ob,onNodeClick:(e,t)=>d(t.id),onNodeMouseEnter:(e,t)=>s(t.id),onNodeMouseLeave:()=>s(null),onNodesChange:l,onEdgesChange:r,children:[t(jr,{}),t(Ab,{trigger:a}),t(Nb,{children:t(Gr,{position:"top-right",orientation:"horizontal",showInteractive:!1,showZoom:!0,showFitView:!0,fitViewOptions:$b,children:t(Wr,{onClick:n,children:t(ll,{})})})})]})},Db=n=>t(Vr,{children:e(Ib,{children:[t(Rb,{...n}),t(wb,{}),t(gb,{})]})}),_b=b.div`
1431
+ `,Ab={[Zf.MapItem]:ub,[Zf.NoData]:qf},Rb={[Qf.AnimatedTraffic]:Tb},Db={duration:300,padding:.1,includeHiddenNodes:!0,maxZoom:1},_b=({trigger:e})=>{const{fitView:t}=Jr(),n=p(!0);return i(()=>{n.current?n.current=!1:e>0&&requestAnimationFrame(()=>t(Db))},[e,t]),null},Pb=({onRefresh:n})=>{const{nodes:o,edges:i,fitViewTrigger:a,onNodesChange:l,onEdgesChange:r,setHoveredNodeId:s,toggleActiveNode:d}=rb(),p=c(()=>{const e=new Set(o.filter(e=>e.type===Zf.MapItem&&e.data.selected).map(e=>e.id)),t=new Set;for(const n of i)e.has(n.source)&&t.add(n.target),e.has(n.target)&&t.add(n.source);return o.filter(e=>e.type!==Zf.MapItem||e.data.selected||t.has(e.id))},[o,i]);return e(Gr,{zoomOnScroll:!0,nodes:p,nodeTypes:Ab,edges:i,edgeTypes:Rb,onNodeClick:(e,t)=>d(t.id),onNodeMouseEnter:(e,t)=>s(t.id),onNodeMouseLeave:()=>s(null),onNodesChange:l,onEdgesChange:r,children:[t(Wr,{}),t(_b,{trigger:a}),t($b,{children:t(Kr,{position:"top-right",orientation:"horizontal",showInteractive:!1,showZoom:!0,showFitView:!0,fitViewOptions:Db,children:t(Yr,{onClick:n,children:t(sl,{})})})})]})},Lb=n=>t(jr,{children:e(Ob,{children:[t(Pb,{...n}),t(Ib,{}),t(vb,{})]})}),Fb=b.div`
1432
1432
  width: 100%;
1433
1433
  flex: 1;
1434
1434
  align-self: stretch;
1435
1435
  min-height: 0;
1436
1436
  height: 100%;
1437
1437
  position: relative;
1438
- `,Pb=()=>{const{serviceMapApi:e}=Vl(),{data:n,refetch:o}=e.useServiceMap({pollInterval:5e3,fetchPolicy:"cache-and-network"});return t(ab,{serviceMap:n?.serviceMap??[],children:t(_b,{children:t(Db,{onRefresh:o})})})},Lb=b.div`
1438
+ `,Mb=()=>{const{serviceMapApi:e}=jl(),{data:n,refetch:o}=e.useServiceMap({pollInterval:5e3,fetchPolicy:"cache-and-network"});return t(sb,{serviceMap:n?.serviceMap??[],children:t(Fb,{children:t(Lb,{onRefresh:o})})})},zb=b.div`
1439
1439
  display: flex;
1440
1440
  align-items: center;
1441
1441
  justify-content: space-between;
1442
1442
  padding: 0 12px;
1443
- `,Fb=b.div`
1443
+ `,Bb=b.div`
1444
1444
  display: flex;
1445
1445
  align-items: center;
1446
1446
  gap: 8px;
1447
- `,Mb=b.div`
1447
+ `,Xb=b.div`
1448
1448
  width: 1px;
1449
1449
  height: 20px;
1450
1450
  background-color: ${({theme:e})=>e.v2.colors.silver[500]};
1451
- `,zb=({disabled:n,loading:o,onClickShowYaml:i,onClickReset:l,onClickRefresh:r})=>{const s=v(),[d,p]=a(!1),u=c(()=>i?[{id:ho(),type:hn.Button,buttonProps:{label:"Show Config YAML",leftIcon:zl,size:be.S,variant:ve.Secondary,onClick:i,disabled:n}}]:[],[i,n]),h=c(()=>{const e=[];return r&&e.push({id:ho(),type:hn.Button,buttonProps:{leftIcon:ll,tooltip:"Refresh",hideTooltipIcon:!0,size:be.S,variant:ve.Text,onClick:r,disabled:n,loading:o}}),l&&e.push({id:ho(),type:hn.Button,buttonProps:{leftIcon:Aa,tooltip:"Reset to defaults",hideTooltipIcon:!0,size:be.S,variant:ve.Text,textColor:s.v2.colors.red[500],onClick:()=>p(!0),disabled:n}}),e},[n,o,l,r,s]),m=u.length>0,g=h.length>0;return e(Lb,{children:[t(ra,{icon:rl,title:"Odigos Settings"}),e(Fb,{children:[m&&t(sa,{actions:u}),m&&g&&t(Mb,{}),g&&t(sa,{actions:h})]}),t(qe,{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:ve.Secondary,onClick:()=>p(!1)},approveButton:{label:"Approve",variant:ve.Primary,onClick:()=>{l?.(),p(!1)}}})]})},Bb=b(ee)`
1451
+ `,Ub=({disabled:n,loading:o,onClickShowYaml:i,onClickReset:l,onClickRefresh:r})=>{const s=v(),[d,p]=a(!1),u=c(()=>i?[{id:mo(),type:mn.Button,buttonProps:{label:"Show Config YAML",leftIcon:Xl,size:be.S,variant:ve.Secondary,onClick:i,disabled:n}}]:[],[i,n]),h=c(()=>{const e=[];return r&&e.push({id:mo(),type:mn.Button,buttonProps:{leftIcon:sl,tooltip:"Refresh",hideTooltipIcon:!0,size:be.S,variant:ve.Text,onClick:r,disabled:n,loading:o}}),l&&e.push({id:mo(),type:mn.Button,buttonProps:{leftIcon:Da,tooltip:"Reset to defaults",hideTooltipIcon:!0,size:be.S,variant:ve.Text,textColor:s.v2.colors.red[500],onClick:()=>p(!0),disabled:n}}),e},[n,o,l,r,s]),m=u.length>0,g=h.length>0;return e(zb,{children:[t(ca,{icon:cl,title:"Odigos Settings"}),e(Bb,{children:[m&&t(da,{actions:u}),m&&g&&t(Xb,{}),g&&t(da,{actions:h})]}),t(qe,{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:ve.Secondary,onClick:()=>p(!1)},approveButton:{label:"Approve",variant:ve.Primary,onClick:()=>{l?.(),p(!1)}}})]})},Vb=b(ee)`
1452
1452
  width: 220px;
1453
1453
  flex-shrink: 0;
1454
1454
  height: 100%;
1455
1455
  gap: 4px;
1456
1456
  overflow-y: auto;
1457
- `,Xb=({options:e,selected:n,setSelected:o,disabled:i})=>t(Bb,{children:e.map(e=>t(Hs,{dataId:`settings-nav-${e.id}`,title:e.label,isSelected:n===e.id,disabled:i,onClick:()=>o(e.id)},e.id))}),Ub=b(ee)`
1457
+ `,Hb=({options:e,selected:n,setSelected:o,disabled:i})=>t(Vb,{children:e.map(e=>t(Gs,{dataId:`settings-nav-${e.id}`,title:e.label,isSelected:n===e.id,disabled:i,onClick:()=>o(e.id)},e.id))}),jb=b(ee)`
1458
1458
  width: 100%;
1459
1459
  /* side menu (220) + gap (24) + form (600) = 844, so content fills exactly with no dead space */
1460
1460
  max-width: 844px;
@@ -1464,25 +1464,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1464
1464
  gap: 24px;
1465
1465
  flex: 1;
1466
1466
  min-height: 0;
1467
- `,Vb=b(pe)`
1467
+ `,Gb=b(pe)`
1468
1468
  flex: 1;
1469
1469
  min-height: 0;
1470
1470
  width: 100%;
1471
1471
  align-self: stretch;
1472
- `,Hb=b(ee)`
1472
+ `,Wb=b(ee)`
1473
1473
  flex: 1;
1474
1474
  min-height: 0;
1475
1475
  height: 100%;
1476
1476
  max-width: 600px;
1477
1477
  overflow-y: auto;
1478
- `,jb=b(pe)`
1478
+ `,Kb=b(pe)`
1479
1479
  gap: 8px;
1480
1480
  width: 100%;
1481
1481
  align-items: center;
1482
- `,Gb=b.div`
1482
+ `,Yb=b.div`
1483
1483
  flex: 1;
1484
1484
  min-width: 0;
1485
- `,Wb=e=>"general"===e.name?0:"advanced"===e.name?2:1,Kb=({minSupportedVersion:o})=>{const{isVersionSupported:l,version:r,isEnterprise:s,minSupportedVersion:d}=S(o),{configApi:p}=Vl(),{data:u,loading:h}=p.useConfigYamls(),{data:m,loading:g,refetch:f}=p.useEffectiveConfig(),b=u?.configYamls??[],[v,y]=a(!1),C=c(()=>{if(!m)return{};const{manifestYAML:e,provenance:t,...n}=m;return n},[m]),{formData:x,handleFormChange:w,getNestedValue:T,getFormDiff:k,isFormDirty:I}=Gt(C);i(()=>{"{}"!==JSON.stringify(C)&&"{}"===JSON.stringify(x)&&w(void 0,void 0,C)},[C,x]);const N=c(()=>[...b].sort((e,t)=>Wb(e)-Wb(t)),[b]),E=c(()=>(e=>{if(!e)return{};const t={};for(const n of e)t[n.helmPath]=n.reconciledFrom;return t})(m?.provenance),[m?.provenance]),O=c(()=>{const e=new Set;for(const t of b)for(const n of t.fields)n.componentType===Bt.Dropdown&&e.add(n.helmValuePath);return e},[b]),$=c(()=>b.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:T("formData",e.helmValuePath)}))),[b,x,T]),[A,R]=a(!1),[D,_]=a(!1),P=c(()=>[{id:ho(),type:hn.Button,buttonProps:{"data-id":"settings-save",variant:ve.Primary,size:be.S,label:"Save Changes",leftIcon:Wa,loading:v,onClick:()=>R(!0)}},{id:ho(),type:hn.Button,buttonProps:{"data-id":"settings-cancel",variant:ve.Secondary,size:be.S,label:"Cancel",leftIcon:Ka,onClick:()=>w(void 0,void 0,C)}}],[v,k,C,x,w]),L=c(()=>N.map(e=>({id:e.name,label:e.displayName})),[N]),F=c(()=>N.map(e=>e.name),[N]),{selectedSection:M,setSelectedSection:z,setSectionRef:B,setScrollContainerRef:X}=$a({sectionNames:F});return t(zi,{$gap:24,children:e(Ub,{children:[t(zb,{disabled:!l,loading:h||g,onClickShowYaml:()=>_(!0),onClickReset:async()=>{await(async()=>{p.resetLocalUiConfigToDefaults&&await p.resetLocalUiConfigToDefaults()})(),await(f?.()),w(void 0,void 0,{})},onClickRefresh:f?()=>f():void 0}),e(ma,{children:[!l&&t(Rr,{minSupportedVersion:d,currentVersion:r||""}),t(Fn,{isOpen:I,richTitle:{icon:rl,title:"Config Settings"},actions:P}),t(qe,{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:ve.Secondary,onClick:()=>R(!1)},approveButton:{label:"Save changes",variant:ve.Primary,onClick:()=>{(async()=>{const e=((e,t)=>{const n=(e,t,n)=>{for(let n=0;n<t.length-1;n++){const o=t[n];o in e&&"object"==typeof e[o]&&null!==e[o]||(e[o]={}),e=e[o]}e[t[t.length-1]]=n},o=JSON.parse(JSON.stringify(e));for(const e of t){const t=e.split(".");let i=o;for(const e of t){if(null==i||"object"!=typeof i){i=void 0;break}i=i[e]}"string"==typeof i&&n(o,t,i.replaceAll("-","_"))}return o})(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(Vb,{$gap:24,$alignItems:"stretch",children:[!!b.length&&t(Xb,{options:L,selected:M,setSelected:z,disabled:!l}),t(Hb,{ref:X,$gap:24,$width:"100%",children:b.length?N.map(o=>t(st,{id:o.name,bordered:!0,ref:e=>B(o.name,e),customTitle:t(_e,{size:Te.M,weight:500,color:Pe.Primary,children:o.displayName}),children:t(ee,{$gap:24,children:o.fields.map(o=>{if(o.isEnterpriseOnly&&!s)return null;if(o.renderCondition&&!Kt(o.renderCondition,[],$))return null;const i=wt(o.componentProps||"{}",{}),a=E[o.helmValuePath],l=o.componentType===Bt.Toggle,r=t(_e,{size:Te.XS,weight:500,color:Pe.Primary,children:o.displayName}),c=(e=>{if(e)return"odigos-local-ui-config"===e?{status:Ee.Warning,label:"Edited in UI",tooltip:`Reconciled from ${e}`}:"odigos-configuration"===e?{status:Ee.Unknown,useSecondaryTone:!0,label:"Cluster config",tooltip:`Reconciled from ${e}`}:{status:Ee.Unknown,useSecondaryTone:!0,label:e,tooltip:`Reconciled from ${e}`}})(a),d=c?t(Ke,{...c}):null,p=o.description?t(_e,{size:Te.XXS,color:Pe.Secondary,children:o.description}):null,u=e(ee,{$gap:4,children:[e(pe,{$gap:8,$alignItems:"center",children:[r,d]}),p]}),h=t(Dr,{componentType:o.componentType,inputType:i.type,name:o.helmValuePath,disabled:o.isHelmOnly||v,value:T("formData",o.helmValuePath),setValue:e=>w(o.helmValuePath,e),dropdownOptions:i.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0,toggleSize:Nt.S},o.helmValuePath),m=o.isHelmOnly?t(Fe,{text:"This field can only be updated via the Helm values.yaml file",children:t(Xl,{})}):null;return t(ee,{$gap:8,children:l?e(pe,{$gap:12,$justifyContent:"space-between",$alignItems:"flex-start",children:[u,e(pe,{$gap:8,$alignItems:"center",children:[m,h]})]}):e(n,{children:[u,e(jb,{children:[t(Gb,{children:h}),m]})]})},o.helmValuePath)})})},o.name)):h?t(mt,{$height:"30vh",children:t(yt,{withSpinner:!0})}):t(st,{richTitle:{icon:rl,title:"Config Settings"},children:t(xe,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})]}),t(Mt,{isOpen:D,width:"40vw",minWidth:"480px",header:{icon:zl,title:"Effective Config YAML",onClose:()=>_(!1)},children:g&&!m?.manifestYAML?t(mt,{$height:"30vh",children:t(yt,{withSpinner:!0})}):t(Or,{yaml:m?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0,fullHeight:!0})})]})]})})},Yb=b.div`
1485
+ `,Jb=e=>"general"===e.name?0:"advanced"===e.name?2:1,qb=({minSupportedVersion:o})=>{const{isVersionSupported:l,version:r,isEnterprise:s,minSupportedVersion:d}=S(o),{configApi:p}=jl(),{data:u,loading:h}=p.useConfigYamls(),{data:m,loading:g,refetch:f}=p.useEffectiveConfig(),b=u?.configYamls??[],[v,y]=a(!1),C=c(()=>{if(!m)return{};const{manifestYAML:e,provenance:t,...n}=m;return n},[m]),{formData:x,handleFormChange:w,getNestedValue:T,getFormDiff:k,isFormDirty:I}=Yt(C);i(()=>{"{}"!==JSON.stringify(C)&&"{}"===JSON.stringify(x)&&w(void 0,void 0,C)},[C,x]);const N=c(()=>[...b].sort((e,t)=>Jb(e)-Jb(t)),[b]),E=c(()=>(e=>{if(!e)return{};const t={};for(const n of e)t[n.helmPath]=n.reconciledFrom;return t})(m?.provenance),[m?.provenance]),O=c(()=>{const e=new Set;for(const t of b)for(const n of t.fields)n.componentType===Vt.Dropdown&&e.add(n.helmValuePath);return e},[b]),$=c(()=>b.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:T("formData",e.helmValuePath)}))),[b,x,T]),[A,R]=a(!1),[D,_]=a(!1),P=c(()=>[{id:mo(),type:mn.Button,buttonProps:{"data-id":"settings-save",variant:ve.Primary,size:be.S,label:"Save Changes",leftIcon:Ya,loading:v,onClick:()=>R(!0)}},{id:mo(),type:mn.Button,buttonProps:{"data-id":"settings-cancel",variant:ve.Secondary,size:be.S,label:"Cancel",leftIcon:Ja,onClick:()=>w(void 0,void 0,C)}}],[v,k,C,x,w]),L=c(()=>N.map(e=>({id:e.name,label:e.displayName})),[N]),F=c(()=>N.map(e=>e.name),[N]),{selectedSection:M,setSelectedSection:z,setSectionRef:B,setScrollContainerRef:X}=Ra({sectionNames:F});return t(Bi,{$gap:24,children:e(jb,{children:[t(Ub,{disabled:!l,loading:h||g,onClickShowYaml:()=>_(!0),onClickReset:async()=>{await(async()=>{p.resetLocalUiConfigToDefaults&&await p.resetLocalUiConfigToDefaults()})(),await(f?.()),w(void 0,void 0,{})},onClickRefresh:f?()=>f():void 0}),e(fa,{children:[!l&&t(_r,{minSupportedVersion:d,currentVersion:r||""}),t(Mn,{isOpen:I,richTitle:{icon:cl,title:"Config Settings"},actions:P}),t(qe,{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:ve.Secondary,onClick:()=>R(!1)},approveButton:{label:"Save changes",variant:ve.Primary,onClick:()=>{(async()=>{const e=((e,t)=>{const n=(e,t,n)=>{for(let n=0;n<t.length-1;n++){const o=t[n];o in e&&"object"==typeof e[o]&&null!==e[o]||(e[o]={}),e=e[o]}e[t[t.length-1]]=n},o=JSON.parse(JSON.stringify(e));for(const e of t){const t=e.split(".");let i=o;for(const e of t){if(null==i||"object"!=typeof i){i=void 0;break}i=i[e]}"string"==typeof i&&n(o,t,i.replaceAll("-","_"))}return o})(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(Gb,{$gap:24,$alignItems:"stretch",children:[!!b.length&&t(Hb,{options:L,selected:M,setSelected:z,disabled:!l}),t(Wb,{ref:X,$gap:24,$width:"100%",children:b.length?N.map(o=>t(st,{id:o.name,bordered:!0,ref:e=>B(o.name,e),customTitle:t(_e,{size:Te.M,weight:500,color:Pe.Primary,children:o.displayName}),children:t(ee,{$gap:24,children:o.fields.map(o=>{if(o.isEnterpriseOnly&&!s)return null;if(o.renderCondition&&!qt(o.renderCondition,[],$))return null;const i=wt(o.componentProps||"{}",{}),a=E[o.helmValuePath],l=o.componentType===Vt.Toggle,r=t(_e,{size:Te.XS,weight:500,color:Pe.Primary,children:o.displayName}),c=(e=>{if(e)return"odigos-local-ui-config"===e?{status:Ee.Warning,label:"Edited in UI",tooltip:`Reconciled from ${e}`}:"odigos-configuration"===e?{status:Ee.Unknown,useSecondaryTone:!0,label:"Cluster config",tooltip:`Reconciled from ${e}`}:{status:Ee.Unknown,useSecondaryTone:!0,label:e,tooltip:`Reconciled from ${e}`}})(a),d=c?t(Ke,{...c}):null,p=o.description?t(_e,{size:Te.XXS,color:Pe.Secondary,children:o.description}):null,u=e(ee,{$gap:4,children:[e(pe,{$gap:8,$alignItems:"center",children:[r,d]}),p]}),h=t(Pr,{componentType:o.componentType,inputType:i.type,name:o.helmValuePath,disabled:o.isHelmOnly||v,value:T("formData",o.helmValuePath),setValue:e=>w(o.helmValuePath,e),dropdownOptions:i.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0,toggleSize:Nt.S},o.helmValuePath),m=o.isHelmOnly?t(Fe,{text:"This field can only be updated via the Helm values.yaml file",children:t(Vl,{})}):null;return t(ee,{$gap:8,children:l?e(pe,{$gap:12,$justifyContent:"space-between",$alignItems:"flex-start",children:[u,e(pe,{$gap:8,$alignItems:"center",children:[m,h]})]}):e(n,{children:[u,e(Kb,{children:[t(Yb,{children:h}),m]})]})},o.helmValuePath)})})},o.name)):h?t(mt,{$height:"30vh",children:t(yt,{withSpinner:!0})}):t(st,{richTitle:{icon:cl,title:"Config Settings"},children:t(xe,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})]}),t(Mt,{isOpen:D,width:"40vw",minWidth:"480px",header:{icon:Xl,title:"Effective Config YAML",onClose:()=>_(!1)},children:g&&!m?.manifestYAML?t(mt,{$height:"30vh",children:t(yt,{withSpinner:!0})}):t(Ar,{yaml:m?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0,fullHeight:!0})})]})]})})},Zb=b.div`
1486
1486
  position: fixed;
1487
1487
  bottom: 12px;
1488
1488
  left: 12px;
@@ -1491,4 +1491,4 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useEff
1491
1491
  flex-direction: column-reverse;
1492
1492
  gap: 6px;
1493
1493
  max-width: 600px;
1494
- `,Jb=()=>{const{notifications:e,markAsDismissed:n,markAsSeen:o}=qt(),i=e.filter(({dismissed:e})=>!e);return t(Yb,{children:i.map(({id:e,type:a,title:l,message:r},s)=>{const c=r||l;if(!c)return null;const d=i.length-s;return t(Ne,{status:a,message:c,onClose:({asSeen:t})=>(({id:e,asSeen:t})=>{n(e),t&&o(e)})({id:e,asSeen:t}),zIndex:d},`toast-${e}`)})})};export{js as AddActionDrawer,gs as AddActionForm,em as AddDataStreamModal,tc as AddDestinationDrawer,bs as AddDestinationForm,nc as AddRuleDrawer,ks as AddRuleForm,vc as AddSourceDrawer,rg as CentralConnections,qd as CloudConnectorStep,ep as CreateCloudConnectorDrawer,eg as CreateNewType,Ns as DataStreamForm,Is as DataStreamMergeWarning,np as EditActionDrawer,op as EditConfigDrawer,tm as EditDataStreamModal,ap as EditDestinationDrawer,rp as EditRuleDrawer,Rh as EditSourceDrawer,Es as EditSourceForm,Sg as Onboarding,im as OnboardingDone,If as Overview,zf as PipelineCollectors,pr as RegexTesterDrawer,Zm as SamplingOnboardingModal,Hh as SamplingRuleDrawer,_s as SamplingRuleForm,Gf as SamplingRules,Pb as ServiceMap,Kb as Settings,Qh as SystemDrawer,Mf as TABS,Jb as ToastList};
1494
+ `,Qb=()=>{const{notifications:e,markAsDismissed:n,markAsSeen:o}=en(),i=e.filter(({dismissed:e})=>!e);return t(Zb,{children:i.map(({id:e,type:a,title:l,message:r},s)=>{const c=r||l;if(!c)return null;const d=i.length-s;return t(Ne,{status:a,message:c,onClose:({asSeen:t})=>(({id:e,asSeen:t})=>{n(e),t&&o(e)})({id:e,asSeen:t}),zIndex:d},`toast-${e}`)})})};export{Ws as AddActionDrawer,bs as AddActionForm,om as AddDataStreamModal,oc as AddDestinationDrawer,ys as AddDestinationForm,ic as AddRuleDrawer,Ns as AddRuleForm,Cc as AddSourceDrawer,dg as CentralConnections,Qd as CloudConnectorStep,np as CreateCloudConnectorDrawer,og as CreateNewType,Os as DataStreamForm,Es as DataStreamMergeWarning,ap as EditActionDrawer,lp as EditConfigDrawer,im as EditDataStreamModal,sp as EditDestinationDrawer,dp as EditRuleDrawer,Ph as EditSourceDrawer,$s as EditSourceForm,Tg as Onboarding,rm as OnboardingDone,Of as Overview,Uf as PipelineCollectors,hr as RegexTesterDrawer,tg as SamplingOnboardingModal,Wh as SamplingRuleDrawer,Ls as SamplingRuleForm,Yf as SamplingRules,Mb as ServiceMap,qb as Settings,nm as SystemDrawer,Xf as TABS,Qb as ToastList};