@odigos/ui-kit 0.0.239 → 0.0.240

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/lib/chunks/helpers-D-6cJlOn.js +19 -0
  3. package/lib/chunks/index-RUJS9Blu.js +147 -0
  4. package/lib/chunks/source-instrument-form-context-CEgbaSRi.js +1 -0
  5. package/lib/chunks/ui-components-B0BVzW_z.js +1570 -0
  6. package/lib/chunks/{vendor-C150cdxb.js → vendor-Be0cOokr.js} +1 -1
  7. package/lib/components/_v2/button/index.d.ts +1 -1
  8. package/lib/components/_v2/condition/index.d.ts +1 -0
  9. package/lib/components/_v2/drop-data/index.d.ts +2 -2
  10. package/lib/components/_v2/input-table/types.d.ts +2 -0
  11. package/lib/components/index.d.ts +0 -22
  12. package/lib/components/v2.js +1 -1
  13. package/lib/components.js +1 -1
  14. package/lib/constants/sources/index.d.ts +5 -5
  15. package/lib/constants/strings/index.d.ts +3 -0
  16. package/lib/constants.js +1 -1
  17. package/lib/containers/_v2/_drawers/add-source-drawer/strings.d.ts +54 -0
  18. package/lib/containers/_v2/_drawers/edit-source-drawer/helpers.d.ts +3 -3
  19. package/lib/containers/_v2/_drawers/edit-source-drawer/index.d.ts +3 -3
  20. package/lib/containers/_v2/_drawers/edit-source-drawer/overview/containers-card/index.d.ts +2 -2
  21. package/lib/containers/_v2/_drawers/edit-source-drawer/overview/health-card.d.ts +2 -2
  22. package/lib/containers/_v2/_drawers/edit-source-drawer/overview/index.d.ts +3 -2
  23. package/lib/containers/_v2/_drawers/edit-source-drawer/overview/main-card.d.ts +2 -2
  24. package/lib/containers/_v2/_drawers/edit-source-drawer/overview/pods-card/index.d.ts +2 -2
  25. package/lib/containers/_v2/_drawers/edit-source-drawer/overview/pods-card/pods-list/helpers.d.ts +5 -2
  26. package/lib/containers/_v2/_drawers/edit-source-drawer/overview/pods-card/pods-list/process-row.d.ts +1 -0
  27. package/lib/containers/_v2/_drawers/edit-source-drawer/overview/statuses-card.d.ts +3 -2
  28. package/lib/containers/_v2/_drawers/edit-source-drawer/peers/index.d.ts +2 -2
  29. package/lib/containers/_v2/_drawers/edit-source-drawer/pods/containers-card/index.d.ts +2 -2
  30. package/lib/containers/_v2/_drawers/edit-source-drawer/pods/containers-card/process-card.d.ts +3 -1
  31. package/lib/containers/_v2/_drawers/edit-source-drawer/pods/index.d.ts +2 -2
  32. package/lib/containers/_v2/_drawers/edit-source-drawer/profiling/index.d.ts +2 -2
  33. package/lib/containers/_v2/overview/columns/column/index.d.ts +2 -2
  34. package/lib/containers/_v2/overview/columns/column/list-item.d.ts +2 -2
  35. package/lib/containers/_v2/overview/columns/column/source-visual-state.d.ts +3 -3
  36. package/lib/containers/_v2/overview/drawers/index.d.ts +1 -1
  37. package/lib/containers/_v2/overview/search/builder.d.ts +4 -4
  38. package/lib/containers/index.d.ts +0 -3
  39. package/lib/containers/service-map/helpers/build-map-nodes.d.ts +2 -2
  40. package/lib/containers/v2.js +162 -122
  41. package/lib/containers.js +19 -49
  42. package/lib/contexts/source-edit-form-context.d.ts +2 -2
  43. package/lib/contexts.js +1 -1
  44. package/lib/functions/filter-sources/index.d.ts +2 -2
  45. package/lib/functions/filter-sources-by-stream/index.d.ts +2 -2
  46. package/lib/functions/get-conditions-booleans/index.d.ts +5 -3
  47. package/lib/functions/get-containers-counts/index.d.ts +2 -2
  48. package/lib/functions/get-containers-icons/index.d.ts +5 -5
  49. package/lib/functions/get-entity-id/index.d.ts +8 -4
  50. package/lib/functions/get-main-container-language/index.d.ts +2 -2
  51. package/lib/functions/get-workload-id/index.d.ts +2 -2
  52. package/lib/functions/is-pod-injected-with-agent/index.d.ts +1 -0
  53. package/lib/functions/map-desired-status-to-condition-status/index.d.ts +1 -1
  54. package/lib/functions.js +1 -1
  55. package/lib/hooks/index.d.ts +0 -1
  56. package/lib/hooks/useActionFormData.d.ts +1 -1
  57. package/lib/hooks/useSourceFormData.d.ts +2 -2
  58. package/lib/hooks/useTimeAgo.d.ts +11 -0
  59. package/lib/hooks.js +1 -1
  60. package/lib/mock-data/index.d.ts +0 -1
  61. package/lib/mock-data/sources/index.d.ts +4 -7
  62. package/lib/snippets/_v2/delete-modal/index.d.ts +3 -0
  63. package/lib/snippets/_v2/dynamic-field/index.d.ts +2 -3
  64. package/lib/snippets/index.d.ts +0 -4
  65. package/lib/snippets/v2.js +1 -1
  66. package/lib/snippets.js +49 -1
  67. package/lib/store/useEntityStore.d.ts +2 -2
  68. package/lib/store/useFilterStore.d.ts +8 -14
  69. package/lib/store/useSelectedStore.d.ts +2 -2
  70. package/lib/store/useSetupStore.d.ts +10 -15
  71. package/lib/store.js +1 -1
  72. package/lib/theme.js +1 -1
  73. package/lib/types/destinations/index.d.ts +3 -3
  74. package/lib/types/namespaces/index.d.ts +3 -3
  75. package/lib/types/sources/index.d.ts +3 -44
  76. package/lib/types/workload/index.d.ts +16 -51
  77. package/lib/types.js +1 -1
  78. package/lib/visuals.js +1 -1
  79. package/package.json +1 -1
  80. package/lib/chunks/index-B5PgIL40.js +0 -3
  81. package/lib/chunks/index-Dy4pkeq6.js +0 -145
  82. package/lib/chunks/index-uXyrp4Xe.js +0 -41
  83. package/lib/chunks/ui-components-BPdnIOmj.js +0 -2248
  84. package/lib/components/badge/index.d.ts +0 -11
  85. package/lib/components/button/index.d.ts +0 -6
  86. package/lib/components/cancel-warning/index.d.ts +0 -10
  87. package/lib/components/checkbox/index.d.ts +0 -15
  88. package/lib/components/condition-details/index.d.ts +0 -10
  89. package/lib/components/data-card/data-card-fields/index.d.ts +0 -23
  90. package/lib/components/data-card/index.d.ts +0 -17
  91. package/lib/components/data-tab/index.d.ts +0 -43
  92. package/lib/components/delete-warning/index.d.ts +0 -13
  93. package/lib/components/describe-row/index.d.ts +0 -13
  94. package/lib/components/drawer/drawer-footer/index.d.ts +0 -16
  95. package/lib/components/drawer/drawer-header/index.d.ts +0 -24
  96. package/lib/components/drawer/index.d.ts +0 -15
  97. package/lib/components/dropdown/index.d.ts +0 -25
  98. package/lib/components/extend-arrow/index.d.ts +0 -8
  99. package/lib/components/field-error/index.d.ts +0 -4
  100. package/lib/components/field-label/index.d.ts +0 -11
  101. package/lib/components/input/index.d.ts +0 -15
  102. package/lib/components/modal/index.d.ts +0 -14
  103. package/lib/components/monitors-icons/index.d.ts +0 -11
  104. package/lib/components/no-data-found/index.d.ts +0 -6
  105. package/lib/components/popup-form/index.d.ts +0 -18
  106. package/lib/components/status/index.d.ts +0 -17
  107. package/lib/components/tab-list/index.d.ts +0 -18
  108. package/lib/components/warning-modal/index.d.ts +0 -24
  109. package/lib/containers/overview-drawer/index.d.ts +0 -27
  110. package/lib/containers/source-drawer/build-card.d.ts +0 -3
  111. package/lib/containers/source-drawer/describe/index.d.ts +0 -13
  112. package/lib/containers/source-drawer/index.d.ts +0 -23
  113. package/lib/containers/source-drawer/libraries/index.d.ts +0 -12
  114. package/lib/containers/source-drawer/odigos-health/index.d.ts +0 -5
  115. package/lib/containers/source-drawer/peers/index.d.ts +0 -12
  116. package/lib/containers/source-form/index.d.ts +0 -8
  117. package/lib/hooks/useSourceSelectionFormData.d.ts +0 -32
  118. package/lib/mock-data/workload/index.d.ts +0 -2
  119. package/lib/snippets/add-button/index.d.ts +0 -9
  120. package/lib/snippets/copy-text/index.d.ts +0 -7
  121. package/lib/snippets/pod-container/index.d.ts +0 -5
  122. package/lib/snippets/source-container/index.d.ts +0 -6
  123. package/lib/snippets/source-container/override-runtime.d.ts +0 -10
@@ -1,4 +1,4 @@
1
- import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect as o,Fragment as n,forwardRef as i,useState as l,useImperativeHandle as s,useMemo as r,useCallback as c,useRef as d,Children as p,useContext as u,useLayoutEffect as h,createContext as g}from"react";import m,{useTheme as b,css as f,keyframes as v}from"styled-components";import{au as y,q as C,av as S,aw as w,ax as k,ay as x,az as T,aA as E,aB as N,aC as $,T as I,d as A,aD as O,a0 as D,F as R,e as F,B as P,a as L,aE as _,aF as B,aG as M,N as z,f as X,i as V,aH as U,S as H,aI as j,aJ as W,ak as G,aK as K,aL as Y,E as J,aM as q,aN as Z,aO as Q,aP as ee,h as te,aQ as ae,j as oe,aR as ne,aS as ie,aT as le,aU as se,aV as re,aW as ce,aX as de,p as pe,aY as ue,aZ as he,a_ as ge,a$ as me,X as be,al as fe,b0 as ve,b1 as ye,b2 as Ce,b3 as Se,b4 as we,b5 as ke,b6 as xe,b7 as Te,b8 as Ee,b9 as Ne,ba as $e,l as Ie,bb as Ae,bc as Oe,bd as De,G as Re,be as Fe,bf as Pe,b as Le,bg as _e,bh as Be,bi as Me,bj as ze,L as Xe,bk as Ve,bl as Ue,ag as He,bm as je,a1 as We,bn as Ge,bo as Ke,bp as Ye,bq as Je,br as qe,c as Ze,bs as Qe,bt as et,bu as tt,bv as at,bw as ot,U as nt,bx as it,by as lt,bz as st,bA as rt,$ as ct,M as dt,bB as pt,D as ut,bC as ht,bD as gt,bE as mt,bF as bt,bG as ft,bH as vt,a5 as yt,r as Ct,bI as St,bJ as wt,bK as kt,x as xt,bL as Tt,bM as Et,bN as Nt,bO as $t,bP as It,bQ as At,bR as Ot,a7 as Dt,bS as Rt,v as Ft,A as Pt,o as Lt,bT as _t,J as Bt,ao as Mt,Y as zt,Z as Xt,bU as Vt,bV as Ut,a8 as Ht,bW as jt,bX as Wt,bY as Gt,bZ as Kt,b_ as Yt,b$ as Jt,c0 as qt,c1 as Zt,at as Qt,ap as ea,c2 as ta,c3 as aa,c4 as oa,c5 as na,c6 as ia,c7 as la,c8 as sa,c9 as ra,ca,cb as da,cc as pa,cd as ua,ce as ha,cf as ga,cg as ma,ch as ba,ci as fa,cj as va,u as ya,K as Ca,ck as Sa,cl as wa,cm as ka,cn as xa,g as Ta,co as Ea,cp as Na,cq as $a,cr as Ia,cs as Aa,ct as Oa,cu as Da,cv as Ra,cw as Fa,cx as Pa,cy as La,cz as _a,cA as Ba,cB as Ma,cC as za,cD as Xa,cE as Va,cF as Ua,cG as Ha,cH as ja,cI as Wa,cJ as Ga,cK as Ka,cL as Ya,cM as Ja,cN as qa,cO as Za,cP as Qa,cQ as eo,cR as to,cS as ao,cT as oo,cU as no,cV as io,cW as lo,cX as so,cY as ro,cZ as co,c_ as po,c$ as uo,d0 as ho,d1 as go,d2 as mo,d3 as bo,d4 as fo,d5 as vo,d6 as yo,d7 as Co,d8 as So,d9 as wo,da as ko,db as xo,dc as To,dd as Eo,de as No,df as $o,dg as Io,dh as Ao,di as Oo,dj as Do,dk as Ro,dl as Fo,dm as Po,dn as Lo,dp as _o,dq as Bo,dr as Mo,ds as zo,dt as Xo,du as Vo,dv as Uo,dw as Ho,dx as jo,dy as Wo,dz as Go,dA as Ko,dB as Yo,dC as Jo,dD as qo,dE as Zo,dF as Qo,dG as en,dH as tn,dI as an,m as on,n as nn,dJ as ln,dK as sn,dL as rn,dM as cn,dN as dn,dO as pn,dP as un,am as hn,dQ as gn,dR as mn,dS as bn,dT as fn,dU as vn,dV as yn,dW as Cn,dX as Sn,dY as wn,H as kn,dZ as xn,d_ as Tn,_ as En,d$ as Nn,e0 as $n,e1 as In,e2 as An,e3 as On,e4 as Dn,e5 as Rn,e6 as Fn,e7 as Pn,e8 as Ln,e9 as _n,ea as Bn,eb as Mn,ec as zn,ed as Xn,ee as Vn,ef as Un,k as Hn,eg as jn,eh as Wn,ei as Gn,ej as Kn,ek as Yn,el as Jn,em as qn,en as Zn,eo as Qn,ep as ei,eq as ti,er as ai,es as oi,et as ni,eu as ii,ev as li,ew as si,ex as ri,ey as ci,ez as di,eA as pi,eB as ui,eC as hi,eD as gi,eE as mi,eF as bi,eG as fi,eH as vi,eI as yi,eJ as Ci,eK as Si,eL as wi,eM as ki}from"../chunks/ui-components-BPdnIOmj.js";import{TrashIcon as xi,PlusIcon as Ti,BookIcon as Ei,VSquareIcon as Ni,XSquareIcon as $i,DeleteIcon as Ii,EditIcon as Ai,GoLogo as Oi,JavaLogo as Di,ChevronRightIcon as Ri,ActionIcon as Fi,DestinationIcon as Pi,ChevronUpIcon as Li,ChevronDownIcon as _i,VIcon as Bi,XIcon as Mi,InstrumentationRuleIcon as zi,SourceIcon as Xi,NamespacesIcon as Vi,SettingsIcon as Ui,PodIcon as Hi,K8sLogo as ji,RefreshIcon as Wi,QuestionCircleIcon as Gi,OdigosLogo as Ki,ExpandIcon as Yi,ExclamationTriangleIcon as Ji,RefreshLeftArrowIcon as qi,SamplingIcon as Zi,ExclamationCircleIcon as Qi,KeyIcon as el,DiagnoseIcon as tl,DownloadIcon as al,TerminalIcon as ol,ArrowRightIcon as nl,StarIcon as il,ArrowIcon as ll,ConnectionsIcon as sl,FilterIcon as rl,DataStreamIcon as cl,PipelineCollectorIcon as dl,ArrowDownSquareIcon as pl,ArrowUpSquareIcon as ul,GatewayIcon as hl,YamlIcon as gl}from"../icons.js";import{S as ml,D as bl,A as fl,P as vl,a as yl,b as Cl,R as Sl,c as wl,O as kl,d as xl,e as Tl,f as El,W as Nl,g as $l,C as Il,h as Al,i as Ol,U as Dl}from"../chunks/index-Dy4pkeq6.js";import{createPortal as Rl}from"react-dom";import{P as Fl}from"../chunks/index-uXyrp4Xe.js";import{Y as Pl}from"../chunks/index-B5PgIL40.js";import"zustand";import"javascript-time-ago";import"../chunks/vendor-C150cdxb.js";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"virtua";const Ll=[{id:"CREDIT_CARD",label:"Credit card"}],_l=[{id:y.CollectContainerAttributes,label:"Collect container attributes"},{id:y.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:y.CollectWorkloadId,label:"Collect workload ID"},{id:y.CollectClusterId,label:"Collect cluster ID"}],Bl=[{id:$.Pod,label:$.Pod},{id:$.Namespace,label:$.Namespace},{id:$.Node,label:$.Node}],Ml=[{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:Bl}],zl=[{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:Bl}],Xl=[{label:"Service",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Service name: The rule applies to a specific service name. Only traces originating from this service’s root span will be considered."},{label:"HTTP route",keyName:"httpRoute",placeholder:"e.g. /api/v1/users",tooltip:"HTTP route: The specific HTTP route prefix to match for sampling. Only traces with routes beginning with this prefix will be considered. For instance, configuring /buy will also match /buy/product."},{label:"Threshold",keyName:"minimumLatencyThreshold",placeholder:"e.g. 1000",tooltip:"Minimum latency threshold (ms): Specifies the minimum latency in milliseconds; traces with latency below this threshold are ignored.",inputType:T.Number},{label:"Fallback",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Fallback sampling ratio: Specifies the percentage of traces that meet the service/http_route filter but fall below the threshold that you still want to retain. For example, if a rule is set for service A and http_route B with a minimum latency threshold of 1 second, you might still want to keep some traces below this threshold. Setting the ratio to 20% ensures that 20% of these traces will be retained.",inputType:T.Number}],Vl=y.UrlTemplatizationRulesGroups,Ul=[{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"}],Hl=[{label:"Service name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (Across all available spans)."},{label:"Sampling ratio",keyName:"samplingRatio",placeholder:"e.g. 10",tooltip:"Specifies the sample rate for all traces.",inputType:T.Number},{label:"Fallback sampling ratio",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Specifies the percentage of traces that don’t meet the service name filter and that you still like to retain.",inputType:T.Number}],jl=[{label:"Service name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (across all available spans)."},{label:"Attribute key",keyName:"attributeKey",placeholder:"e.g. http.request.method",tooltip:"Specifies the attribute key inside of the span."},{label:"Fallback sampling ratio",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Specifies the percentage of traces that don’t meet the service name filter and that you still like to retain.",inputType:T.Number},{label:"Condition",keyName:"condition",tooltip:"An object representing the filters for span attributes filters.",componentType:_.Dropdown,options:[{id:"stringCondition",label:"String condition"},{id:"numberCondition",label:"Number condition"},{id:"booleanCondition",label:"Boolean condition"},{id:"jsonCondition",label:"JSON condition"}]},{label:"Operation",keyName:"operation",tooltip:"Specifies the operation to run against the attribute.",componentType:_.Dropdown,options:[{id:"exists",label:"Exists"},{id:"equals",label:"Equals"},{id:"not_equals",label:"Not equals"},{id:"contains",label:"Contains"},{id:"not_contains",label:"Not contains"},{id:"regex",label:"Regex"},{id:"greater_than",label:"Greater than"},{id:"less_than",label:"Less than"},{id:"greater_than_or_equal",label:"Greater than or equal"},{id:"less_than_or_equal",label:"Less than or equal"},{id:"is_valid_json",label:"Is valid JSON"},{id:"is_invalid_json",label:"Is invalid JSON"},{id:"jsonpath_exists",label:"JSON path exists"},{id:"key_equals",label:"Key equals"},{id:"key_not_equals",label:"Key not equals"}]},{label:"Expected value",keyName:"expectedValue",placeholder:"e.g. GET",tooltip:"The values to test the attribute against."},{label:"JSON path",keyName:"jsonPath",placeholder:"e.g. $.user.role",tooltip:"An expression used to navigate the JSON structure.",renderCondition:e=>"jsonCondition"===e.condition}],Wl={[B.K8sAttributes]:({value:n,setValue:i,formErrors:l})=>(o(()=>{n[y.CollectContainerAttributes]||n[y.CollectReplicaSetAttributes]||n[y.CollectWorkloadId]||n[y.CollectClusterId]||n[y.LabelsAttributes]?.length||n[y.AnnotationsAttributes]?.length||(i(y.CollectContainerAttributes,!0),i(y.CollectReplicaSetAttributes,!0),i(y.CollectWorkloadId,!0),i(y.CollectClusterId,!0),i(y.LabelsAttributes,[]),i(y.AnnotationsAttributes,[]))},[]),e(a,{children:[t(C,{$gap:6,children:_l.map(({id:a,label:o})=>e(C,{children:[t(w,{label:o,value:n[a]||!1,onChange:e=>i(a,e)}),t(k,{errorMessage:l[a]})]},a))}),t(N,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:Ml,values:n[y.LabelsAttributes]||[],setValues:e=>i(y.LabelsAttributes,e),errorMessage:l[y.LabelsAttributes]}),t(N,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:zl,values:n[y.AnnotationsAttributes]||[],setValues:e=>i(y.AnnotationsAttributes,e),errorMessage:l[y.AnnotationsAttributes]})]})),[B.AddClusterInfo]:({value:o,setValue:n,formErrors:i})=>{const l=b();return e(a,{children:[t(I,{label:"Overwrite existing values",labelAlign:A.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:o[y.OverwriteExistingValues]||!1,onChange:e=>n(y.OverwriteExistingValues,e)}),t(N,{name:"clusterAttributes",label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value"}],values:o[y.ClusterAttributes]||[],setValues:e=>n(y.ClusterAttributes,e),errorMessage:i[y.ClusterAttributes]})]})},[B.DeleteAttributes]:({value:e,setValue:a,formErrors:o})=>t(O,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[y.AttributeNamesToDelete]||[],setValues:e=>a(y.AttributeNamesToDelete,e),errorMessage:o[y.AttributeNamesToDelete]}),[B.RenameAttributes]:({value:e,setValue:a,formErrors:o})=>t(N,{name:"renames",label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key"},{keyName:"newKey",label:"New key"}],values:Object.entries(e[y.Renames]||{}).map(([e,t])=>({oldKey:e,newKey:t})),setValues:e=>{const t={};e.forEach(e=>t[e.oldKey]=e.newKey),a(y.Renames,t)},errorMessage:o[y.Renames]}),[B.PiiMasking]:({value:a,setValue:n,formErrors:i})=>(o(()=>{a[y.PiiCategories]?.length||n(y.PiiCategories,Ll.map(({id:e})=>e))},[]),e(C,{$gap:12,children:[t(S,{label:"Attributes to mask"}),t(C,{$gap:6,children:Ll.map(({id:e,label:o})=>t(w,{label:o,value:a[y.PiiCategories]?.includes(e)||!1,onChange:t=>{const o=a[y.PiiCategories]||[],i=t?[...o,e]:o.filter(t=>t!==e);n(y.PiiCategories,i)}},e))}),t(k,{errorMessage:i[y.PiiCategories]})]})),[B.ErrorSampler]:({value:e,setValue:a,formErrors:o})=>{const n=o[y.FallbackSamplingRatio],i=E(e[y.FallbackSamplingRatio])?"":String(e[y.FallbackSamplingRatio]);return t(x,{name:"fallbackSamplingRatio",label:"Fallback sampling ratio",type:T.Number,min:0,max:100,value:i,placeholder:"0-100",onChange:e=>{return t=e.target.value,a(y.FallbackSamplingRatio,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:n})},[B.ProbabilisticSampler]:({value:e,setValue:a,formErrors:o})=>{const n=o[y.SamplingPercentage],i=E(e[y.SamplingPercentage])?"":String(e[y.SamplingPercentage]);return t(x,{name:"samplingPercentage",label:"Sampling percentage",type:T.Number,min:0,max:100,value:i,placeholder:"0-100",onChange:e=>{return t=e.target.value,a(y.SamplingPercentage,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:n})},[B.LatencySampler]:({value:e,setValue:a,formErrors:o})=>{const n=o[y.EndpointsFilters],i=e[y.EndpointsFilters]||[];return t(N,{name:"endpointsFilters",limitFieldsPerRow:2,columns:Xl,values:i,setValues:e=>{a(y.EndpointsFilters,e.map(({serviceName:e,httpRoute:t,minimumLatencyThreshold:a,fallbackSamplingRatio:o})=>({serviceName:e,httpRoute:t,minimumLatencyThreshold:Number(a),fallbackSamplingRatio:Number(o)})))},errorMessage:n})},[B.ServiceNameSampler]:({value:e,setValue:a,formErrors:o})=>{const n=o[y.ServicesNameFilters],i=e[y.ServicesNameFilters]||[];return t(N,{name:"servicesNameFilters",limitFieldsPerRow:2,columns:Hl,values:i,setValues:e=>{a(y.ServicesNameFilters,e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:a})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(a)})))},errorMessage:n})},[B.SpanAttributeSampler]:({value:e,setValue:a,formErrors:o})=>{const n=o[y.AttributeFilters],i=(e[y.AttributeFilters]||[]).map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:a,condition:o})=>{const n=Object.entries(o).filter(([e,t])=>t)[0][0];return{serviceName:e,attributeKey:t,fallbackSamplingRatio:a,condition:n,operation:o[n]?.operation,expectedValue:o[n]?.expectedValue,jsonPath:o[n]?.jsonPath}});return t(N,{name:"attributeFilters",limitFieldsPerRow:2,columns:jl,values:i,setValues:e=>{a(y.AttributeFilters,e.map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:a,condition:o,operation:n,expectedValue:i,jsonPath:l})=>{const s={serviceName:e,attributeKey:t,fallbackSamplingRatio:Number(a),condition:{[o]:{operation:n,expectedValue:i}}};return l&&(s.condition[o].jsonPath=l),s}))},errorMessage:n})},[B.URLTemplatization]:({value:o,setValue:i,formErrors:l})=>{const s=b(),r=o[Vl]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>i(Vl,e),d=(e,t)=>c(r.map((a,o)=>o===e?{...a,...t}:a));return e(a,{children:[r.map((a,o)=>e(n,{children:[t(D,{}),e(C,{$gap:12,children:[e(R,{$justifyContent:"space-between",$alignItems:"center",children:[t(S,{label:`Rule Group ${o+1}`}),t(F,{leftIcon:()=>t(xi,{fill:s.v2.colors.red[500]}),variant:L.Secondary,size:P.S,onClick:()=>{return e=o,c(r.filter((t,a)=>a!==e));var e},disabled:1===r.length})]}),t(x,{name:`urlGroup-${o}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:a.filterK8sNamespace||"",onChange:e=>d(o,{filterK8sNamespace:e.target.value})}),t(N,{name:`urlGroup-${o}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:Ul,values:a.workloadFilters||[],setValues:e=>d(o,{workloadFilters:e})}),t(O,{name:`urlGroup-${o}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:a.templatizationRules.map(e=>e.template),setValues:e=>d(o,{templatizationRules:e.map(e=>({template:e}))})})]}),t(k,{errorMessage:l[Vl]})]},`url-templatization-group-${o}`)),t(F,{variant:L.Secondary,label:"Add rule group",leftIcon:Ti,onClick:()=>c([...r,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(D,{})]})}},Gl=({actionType:e,value:a,setValue:o,formErrors:n})=>{if(!e)return null;const i=Wl[e];return i?t(i,{value:a,setValue:o,formErrors:n}):null},Kl=()=>{const a=b(),{selectedOption:o,genericForm:n}=M();if(!n||!o)return t(z,{title:"No active form"});const{formData:i,handleFormChange:l,formErrors:s}=n;return e(C,{$gap:24,children:[e(R,{$gap:12,$justifyContent:"space-between",children:[t(X,{size:V.XXS,children:o.docsDescription}),t(F,{label:"Docs",leftIcon:Ei,variant:L.Text,size:P.S,onClick:()=>window.open(`${U}${o.docsEndpoint}`,"_blank","noopener noreferrer")})]}),t(H,{options:[{icon:Ni,label:"Enabled",value:!1,selectedBgColor:a.v2.colors.green[800]},{icon:$i,label:"Disabled",value:!0,selectedBgColor:a.v2.colors.red[800]}],selected:i.disabled,setSelected:e=>l("disabled",e)}),t(ml,{title:"Signals for processing",allowedSignals:o.allowedSignals,selectedSignals:i.signals||[],setSelectedSignals:e=>l("signals",e),errorMessage:s.signals}),t(x,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:i.name||"",onChange:({target:{value:e}})=>l("name",e),errorMessage:s.name}),t(Gl,{actionType:o.type,value:i.fields,setValue:(e,t)=>l(`fields.${e}`,t),formErrors:s}),t(j,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:i.notes||"",onChange:({target:{value:e}})=>l("notes",e),errorMessage:s.notes})]})},Yl=({signals:e,fields:a,disabled:o,formData:n,handleFormChange:i,formErrors:l})=>a?.map(({renderCondition:a,componentType:s,type:r,name:c,title:d,tooltip:p,placeholder:u,value:h,required:g,options:m})=>{if(!(!a||W(a,e,n.fields)))return null;const b=c,f=n.fields.find(e=>e.key===b),v=f?f.value:h;return t(bl,{componentType:s,inputType:r,name:b,label:d,tooltip:p,disabled:o,required:g,placeholder:u,errorMessage:l[b],dropdownOptions:m,value:v||"",setValue:e=>i(b,e)},b)}),Jl=m(R)`
1
+ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect as n,Fragment as a,forwardRef as i,useState as l,useImperativeHandle as s,useMemo as r,useCallback as c,useRef as d,Children as u,useContext as p,useLayoutEffect as h,createContext as m}from"react";import g,{useTheme as f,css as b,keyframes as v}from"styled-components";import{u as y,n as C,C as S,d as w,b as x,c as k,S as T,f as $,e as E,a as N,r as I,h as A,i as O,j as D,k as R,l as F,m as P,o as L,p as _,q as z,s as M,t as B}from"../chunks/helpers-D-6cJlOn.js";import{y as X,F as V,$ as U,a0 as H,a1 as j,a2 as G,a3 as W,G as K,a4 as Y,a5 as J,a6 as q,a7 as Z,a8 as Q,p as ee,h as te,a9 as oe,aa as ne,ab as ae,R as ie,z as le,N as se,b as re,c as ce,ac as de,ad as ue,ae as pe,af as he,ag as me,S as ge,M as fe,Q as be,L as ve,ah as ye,ai as Ce,aj as Se,ak as we,V as xe,al as ke,X as Te,Y as $e,W as Ee,Z as Ne,am as Ie,an as Ae,ao as Oe,ap as De,D as Re,H as Fe,aq as Pe,ar as Le,as as _e,at as ze,au as Me,av as Be,aw as Xe,ax as Ve,ay as Ue,az as He,i as je,A as Ge,x as We,aA as Ke,K as Ye,aB as Je,aC as qe,aD as Ze,aE as Qe,aF as et,aG as tt,w as ot,O as nt,q as at,U as it,E as lt,aH as st,T as rt,aI as ct,aJ as dt,aK as ut,aL as pt,aM as ht,aN as mt,aO as gt,o as ft,aP as bt,aQ as vt,aR as yt,aS as Ct,aT as St,v as wt,aU as xt,aV as kt,aW as Tt,aX as $t,d as Et,B as Nt,aY as It,aZ as At,f as Ot,a_ as Dt,a$ as Rt,b0 as Ft,b1 as Pt,b2 as Lt,b3 as _t,b4 as zt,b5 as Mt,b6 as Bt,b7 as Xt,b8 as Vt,b9 as Ut,ba as Ht,bb as jt,l as Gt,m as Wt,bc as Kt,bd as Yt,be as Jt,bf as qt,bg as Zt,bh as Qt,bi as eo,bj as to,bk as oo,bl as no,bm as ao,bn as io,bo as lo,bp as so,bq as ro,br as co,_ as uo,bs as po,bt as ho,bu as mo,bv as go,bw as fo,bx as bo,by as vo,bz as yo,bA as Co,bB as So,bC as wo,bD as xo,bE as ko,bF as To,bG as $o,bH as Eo,bI as No,bJ as Io,bK as Ao,bL as Oo,bM as Do,bN as Ro,bO as Fo,bP as Po,bQ as Lo,bR as _o,bS as zo,bT as Mo,bU as Bo,bV as Xo,bW as Vo,bX as Uo,bY as Ho,bZ as jo,b_ as Go,b$ as Wo,c0 as Ko,c1 as Yo,c2 as Jo,c3 as qo,c4 as Zo,c5 as Qo,c6 as en,c7 as tn,c8 as on,c9 as nn,ca as an,cb as ln,cc as sn,cd as rn,ce as cn,cf as dn,cg as un,ch as pn,ci as hn,cj as mn,ck as gn,cl as fn,cm as bn,cn as vn,co as yn,cp as Cn,cq as Sn,cr as wn,cs as xn,ct as kn,cu as Tn,cv as $n,cw as En,cx as Nn,cy as In,cz as An,cA as On,cB as Dn,cC as Rn,cD as Fn,cE as Pn,cF as Ln,cG as _n,cH as zn,cI as Mn,cJ as Bn,cK as Xn,cL as Vn,cM as Un,cN as Hn,cO as jn,cP as Gn,cQ as Wn,cR as Kn,cS as Yn,cT as Jn,cU as qn,cV as Zn,cW as Qn,cX as ea,cY as ta,cZ as oa,c_ as na,c$ as aa,d0 as ia,d1 as la,d2 as sa,d3 as ra,d4 as ca,d5 as da,d6 as ua,d7 as pa,d8 as ha,d9 as ma,da as ga,db as fa,dc as ba,dd as va,de as ya,df as Ca,j as Sa,dg as wa,dh as xa,n as ka,di as Ta,dj as $a,dk as Ea,dl as Na,dm as Ia,dn as Aa,dp as Oa,dq as Da,dr as Ra,ds as Fa,dt as Pa,du as La,dv as _a,dw as za,dx as Ma,dy as Ba,dz as Xa,dA as Va,dB as Ua,dC as Ha,dD as ja,dE as Ga,dF as Wa,dG as Ka,dH as Ya,dI as Ja,dJ as qa,dK as Za,dL as Qa,dM as ei,dN as ti,dO as oi,dP as ni}from"../chunks/ui-components-B0BVzW_z.js";import{TrashIcon as ai,PlusIcon as ii,BookIcon as li,VSquareIcon as si,XSquareIcon as ri,DeleteIcon as ci,EditIcon as di,GoLogo as ui,JavaLogo as pi,ChevronRightIcon as hi,ActionIcon as mi,DestinationIcon as gi,ChevronUpIcon as fi,ChevronDownIcon as bi,VIcon as vi,XIcon as yi,InstrumentationRuleIcon as Ci,SourceIcon as Si,NamespacesIcon as wi,SettingsIcon as xi,PodIcon as ki,K8sLogo as Ti,RefreshIcon as $i,OdigosLogo as Ei,QuestionCircleIcon as Ni,ExpandIcon as Ii,SearchIcon as Ai,MinusIcon as Oi,CopyIcon as Di,DotIcon as Ri,DownloadIcon as Fi,ExclamationTriangleIcon as Pi,RefreshLeftArrowIcon as Li,SamplingIcon as _i,ExclamationCircleIcon as zi,KeyIcon as Mi,DiagnoseIcon as Bi,TerminalIcon as Xi,ArrowRightIcon as Vi,StarIcon as Ui,ArrowIcon as Hi,ConnectionsIcon as ji,FilterIcon as Gi,DataStreamIcon as Wi,PipelineCollectorIcon as Ki,ArrowDownSquareIcon as Yi,ArrowUpSquareIcon as Ji,GatewayIcon as qi,YamlIcon as Zi}from"../icons.js";import{S as Qi,D as el,A as tl,P as ol,a as nl,b as al,R as il,c as ll,O as sl,d as rl,e as cl,f as dl,W as ul,g as pl,C as hl,h as ml,i as gl,Y as fl,U as bl}from"../chunks/index-RUJS9Blu.js";import{u as vl,f as yl,g as Cl,e as Sl,i as wl,h as xl,S as kl,k as Tl,E as $l,l as El,m as Nl,j as Il,b as Al,d as Ol,a as Dl,A as Rl,R as Fl,c as Pl,D as Ll}from"../chunks/source-instrument-form-context-CEgbaSRi.js";import{createPortal as _l}from"react-dom";import"zustand";import"javascript-time-ago";import"../chunks/vendor-Be0cOokr.js";import"prism-react-renderer";import"react-error-boundary";import"virtua";const zl=[{id:"CREDIT_CARD",label:"Credit card"}],Ml=[{id:X.CollectContainerAttributes,label:"Collect container attributes"},{id:X.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:X.CollectWorkloadId,label:"Collect workload ID"},{id:X.CollectClusterId,label:"Collect cluster ID"}],Bl=[{id:J.Pod,label:J.Pod},{id:J.Namespace,label:J.Namespace},{id:J.Node,label:J.Node}],Xl=[{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:Bl}],Vl=[{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:Bl}],Ul=[{label:"Service",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Service name: The rule applies to a specific service name. Only traces originating from this service’s root span will be considered."},{label:"HTTP route",keyName:"httpRoute",placeholder:"e.g. /api/v1/users",tooltip:"HTTP route: The specific HTTP route prefix to match for sampling. Only traces with routes beginning with this prefix will be considered. For instance, configuring /buy will also match /buy/product."},{label:"Threshold",keyName:"minimumLatencyThreshold",placeholder:"e.g. 1000",tooltip:"Minimum latency threshold (ms): Specifies the minimum latency in milliseconds; traces with latency below this threshold are ignored.",inputType:W.Number,min:0},{label:"Fallback",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Fallback sampling ratio: Specifies the percentage of traces that meet the service/http_route filter but fall below the threshold that you still want to retain. For example, if a rule is set for service A and http_route B with a minimum latency threshold of 1 second, you might still want to keep some traces below this threshold. Setting the ratio to 20% ensures that 20% of these traces will be retained.",inputType:W.Number,min:0,max:100}],Hl=X.UrlTemplatizationRulesGroups,jl=[{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"}],Gl=[{label:"Service name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (Across all available spans)."},{label:"Sampling ratio",keyName:"samplingRatio",placeholder:"e.g. 10",tooltip:"Specifies the sample rate for all traces.",inputType:W.Number,min:0,max:100},{label:"Fallback sampling ratio",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Specifies the percentage of traces that don’t meet the service name filter and that you still like to retain.",inputType:W.Number,min:0,max:100}],Wl=[{label:"Service name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (across all available spans)."},{label:"Attribute key",keyName:"attributeKey",placeholder:"e.g. http.request.method",tooltip:"Specifies the attribute key inside of the span."},{label:"Fallback sampling ratio",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Specifies the percentage of traces that don’t meet the service name filter and that you still like to retain.",inputType:W.Number,min:0,max:100},{label:"Condition",keyName:"condition",tooltip:"An object representing the filters for span attributes filters.",componentType:ie.Dropdown,options:[{id:"stringCondition",label:"String condition"},{id:"numberCondition",label:"Number condition"},{id:"booleanCondition",label:"Boolean condition"},{id:"jsonCondition",label:"JSON condition"}]},{label:"Operation",keyName:"operation",tooltip:"Specifies the operation to run against the attribute.",componentType:ie.Dropdown,options:[{id:"exists",label:"Exists"},{id:"equals",label:"Equals"},{id:"not_equals",label:"Not equals"},{id:"contains",label:"Contains"},{id:"not_contains",label:"Not contains"},{id:"regex",label:"Regex"},{id:"greater_than",label:"Greater than"},{id:"less_than",label:"Less than"},{id:"greater_than_or_equal",label:"Greater than or equal"},{id:"less_than_or_equal",label:"Less than or equal"},{id:"is_valid_json",label:"Is valid JSON"},{id:"is_invalid_json",label:"Is invalid JSON"},{id:"jsonpath_exists",label:"JSON path exists"},{id:"key_equals",label:"Key equals"},{id:"key_not_equals",label:"Key not equals"}]},{label:"Expected value",keyName:"expectedValue",placeholder:"e.g. GET",tooltip:"The values to test the attribute against."},{label:"JSON path",keyName:"jsonPath",placeholder:"e.g. $.user.role",tooltip:"An expression used to navigate the JSON structure.",renderCondition:e=>"jsonCondition"===e.condition}],Kl={[le.K8sAttributes]:({value:a,setValue:i,formErrors:l})=>(n(()=>{a[X.CollectContainerAttributes]||a[X.CollectReplicaSetAttributes]||a[X.CollectWorkloadId]||a[X.CollectClusterId]||a[X.LabelsAttributes]?.length||a[X.AnnotationsAttributes]?.length||(i(X.CollectContainerAttributes,!0),i(X.CollectReplicaSetAttributes,!0),i(X.CollectWorkloadId,!0),i(X.CollectClusterId,!0),i(X.LabelsAttributes,[]),i(X.AnnotationsAttributes,[]))},[]),e(o,{children:[t(V,{$gap:6,children:Ml.map(({id:o,label:n})=>e(V,{children:[t(H,{label:n,value:a[o]||!1,onChange:e=>i(o,e)}),t(j,{errorMessage:l[o]})]},o))}),t(Y,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:Xl,values:a[X.LabelsAttributes]||[],setValues:e=>i(X.LabelsAttributes,e),errorMessage:l[X.LabelsAttributes]}),t(Y,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:Vl,values:a[X.AnnotationsAttributes]||[],setValues:e=>i(X.AnnotationsAttributes,e),errorMessage:l[X.AnnotationsAttributes]})]})),[le.AddClusterInfo]:({value:n,setValue:a,formErrors:i})=>{const l=f();return e(o,{children:[t(q,{label:"Overwrite existing values",labelAlign:Z.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:n[X.OverwriteExistingValues]||!1,onChange:e=>a(X.OverwriteExistingValues,e)}),t(Y,{name:"clusterAttributes",label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value"}],values:n[X.ClusterAttributes]||[],setValues:e=>a(X.ClusterAttributes,e),errorMessage:i[X.ClusterAttributes]})]})},[le.DeleteAttributes]:({value:e,setValue:o,formErrors:n})=>t(Q,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[X.AttributeNamesToDelete]||[],setValues:e=>o(X.AttributeNamesToDelete,e),errorMessage:n[X.AttributeNamesToDelete]}),[le.RenameAttributes]:({value:e,setValue:o,formErrors:n})=>t(Y,{name:"renames",label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key"},{keyName:"newKey",label:"New key"}],values:Object.entries(e[X.Renames]||{}).map(([e,t])=>({oldKey:e,newKey:t})),setValues:e=>{const t={};e.forEach(e=>t[e.oldKey]=e.newKey),o(X.Renames,t)},errorMessage:n[X.Renames]}),[le.PiiMasking]:({value:o,setValue:a,formErrors:i})=>(n(()=>{o[X.PiiCategories]?.length||a(X.PiiCategories,zl.map(({id:e})=>e))},[]),e(V,{$gap:12,children:[t(U,{label:"Attributes to mask"}),t(V,{$gap:6,children:zl.map(({id:e,label:n})=>t(H,{label:n,value:o[X.PiiCategories]?.includes(e)||!1,onChange:t=>{const n=o[X.PiiCategories]||[],i=t?[...n,e]:n.filter(t=>t!==e);a(X.PiiCategories,i)}},e))}),t(j,{errorMessage:i[X.PiiCategories]})]})),[le.ErrorSampler]:({value:e,setValue:o,formErrors:n})=>{const a=n[X.FallbackSamplingRatio],i=K(e[X.FallbackSamplingRatio])?"":String(e[X.FallbackSamplingRatio]);return t(G,{name:"fallbackSamplingRatio",label:"Fallback sampling ratio",type:W.Number,min:0,max:100,value:i,placeholder:"0-100",onChange:e=>{return t=e.target.value,o(X.FallbackSamplingRatio,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[le.ProbabilisticSampler]:({value:e,setValue:o,formErrors:n})=>{const a=n[X.SamplingPercentage],i=K(e[X.SamplingPercentage])?"":String(e[X.SamplingPercentage]);return t(G,{name:"samplingPercentage",label:"Sampling percentage",type:W.Number,min:0,max:100,value:i,placeholder:"0-100",onChange:e=>{return t=e.target.value,o(X.SamplingPercentage,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[le.LatencySampler]:({value:e,setValue:o,formErrors:n})=>{const a=n[X.EndpointsFilters],i=e[X.EndpointsFilters]||[];return t(Y,{name:"endpointsFilters",limitFieldsPerRow:2,columns:Ul,values:i,setValues:e=>{o(X.EndpointsFilters,e.map(({serviceName:e,httpRoute:t,minimumLatencyThreshold:o,fallbackSamplingRatio:n})=>({serviceName:e,httpRoute:t,minimumLatencyThreshold:Number(o),fallbackSamplingRatio:Number(n)})))},errorMessage:a})},[le.ServiceNameSampler]:({value:e,setValue:o,formErrors:n})=>{const a=n[X.ServicesNameFilters],i=e[X.ServicesNameFilters]||[];return t(Y,{name:"servicesNameFilters",limitFieldsPerRow:2,columns:Gl,values:i,setValues:e=>{o(X.ServicesNameFilters,e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:o})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(o)})))},errorMessage:a})},[le.SpanAttributeSampler]:({value:e,setValue:o,formErrors:n})=>{const a=n[X.AttributeFilters],i=(e[X.AttributeFilters]||[]).map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:n})=>{const a=Object.entries(n).filter(([e,t])=>t)[0][0];return{serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:a,operation:n[a]?.operation,expectedValue:n[a]?.expectedValue,jsonPath:n[a]?.jsonPath}});return t(Y,{name:"attributeFilters",limitFieldsPerRow:2,columns:Wl,values:i,setValues:e=>{o(X.AttributeFilters,e.map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:n,operation:a,expectedValue:i,jsonPath:l})=>{const s={serviceName:e,attributeKey:t,fallbackSamplingRatio:Number(o),condition:{[n]:{operation:a,expectedValue:i}}};return l&&(s.condition[n].jsonPath=l),s}))},errorMessage:a})},[le.URLTemplatization]:({value:n,setValue:i,formErrors:l})=>{const s=f(),r=n[Hl]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>i(Hl,e),d=(e,t)=>c(r.map((o,n)=>n===e?{...o,...t}:o));return e(o,{children:[r.map((o,n)=>e(a,{children:[t(ee,{}),e(V,{$gap:12,children:[e(te,{$justifyContent:"space-between",$alignItems:"center",children:[t(U,{label:`Rule Group ${n+1}`}),t(oe,{leftIcon:()=>t(ai,{fill:s.v2.colors.red[500]}),variant:ae.Secondary,size:ne.S,onClick:()=>{return e=n,c(r.filter((t,o)=>o!==e));var e},disabled:1===r.length})]}),t(G,{name:`urlGroup-${n}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:o.filterK8sNamespace||"",onChange:e=>d(n,{filterK8sNamespace:e.target.value})}),t(Y,{name:`urlGroup-${n}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:jl,values:o.workloadFilters||[],setValues:e=>d(n,{workloadFilters:e})}),t(Q,{name:`urlGroup-${n}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:o.templatizationRules.map(e=>e.template),setValues:e=>d(n,{templatizationRules:e.map(e=>({template:e}))})})]}),t(j,{errorMessage:l[Hl]})]},`url-templatization-group-${n}`)),t(oe,{variant:ae.Secondary,label:"Add rule group",leftIcon:ii,onClick:()=>c([...r,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(ee,{})]})}},Yl=({actionType:e,value:o,setValue:n,formErrors:a})=>{if(!e)return null;const i=Kl[e];return i?t(i,{value:o,setValue:n,formErrors:a}):null},Jl=()=>{const o=f(),{selectedOption:n,genericForm:a}=vl();if(!a||!n)return t(se,{title:"No active form"});const{formData:i,handleFormChange:l,formErrors:s}=a;return e(V,{$gap:24,children:[e(te,{$gap:12,$justifyContent:"space-between",children:[t(re,{size:ce.XXS,children:n.docsDescription}),t(oe,{label:"Docs",leftIcon:li,variant:ae.Text,size:ne.S,onClick:()=>window.open(`${de}${n.docsEndpoint}`,"_blank","noopener noreferrer")})]}),t(ue,{options:[{icon:si,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:ri,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],selected:i.disabled,setSelected:e=>l("disabled",e)}),t(Qi,{title:"Signals for processing",allowedSignals:n.allowedSignals,selectedSignals:i.signals||[],setSelectedSignals:e=>l("signals",e),errorMessage:s.signals}),t(G,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:i.name||"",onChange:({target:{value:e}})=>l("name",e),errorMessage:s.name}),t(Yl,{actionType:n.type,value:i.fields,setValue:(e,t)=>l(`fields.${e}`,t),formErrors:s}),t(pe,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:i.notes||"",onChange:({target:{value:e}})=>l("notes",e),errorMessage:s.notes})]})},ql=({signals:e,fields:o,disabled:n,formData:a,handleFormChange:i,formErrors:l})=>o?.map(({renderCondition:o,componentType:s,type:r,name:c,title:d,tooltip:u,placeholder:p,value:h,required:m,options:g})=>{if(!(!o||he(o,e,a.fields)))return null;const f=c,b=a.fields.find(e=>e.key===f),v=b?b.value:h;return t(el,{componentType:s,inputType:r,name:f,label:d,tooltip:u,disabled:n,required:m,placeholder:p,errorMessage:l[f],dropdownOptions:g,value:v||"",setValue:e=>i(f,e)},f)}),Zl=g(te)`
2
2
  position: sticky;
3
3
  bottom: 4px;
4
4
  align-self: center;
@@ -9,55 +9,55 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
9
9
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
10
10
  box-shadow: 0 4px 16.7px 0 rgba(0, 0, 0, 0.83);
11
11
  z-index: 1;
12
- `,ql=i(({testConnection:a,isEdit:n},i)=>{const r=b(),{isVm:c}=G(),{activeForm:d,genericForm:p,validateFormData:u,thisUnsavedDestination:h,addUnsavedDestination:g,updateUnsavedDestination:m,deleteUnsavedDestination:f}=K(),[v,y]=l(h?.testResult),[S,w]=l(!!h);o(()=>{h?(y(h.testResult),w(!0)):(y(void 0),w(!1))},[h]);const k=async()=>{if(!d?.option.testConnectionSupported||!p||c)return;const e=await a(ee(p.formData));return y(e),e};return s(i,()=>({testConnection:k,testConnectionSupported:!!d?.option.testConnectionSupported}),[d?.option.testConnectionSupported,p,a]),p&&d?e(C,{$gap:24,style:{minHeight:"100%"},children:[e(R,{$gap:12,$justifyContent:"space-between",children:[v?v.succeeded?t(Y,{status:J.Success,message:v.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(Y,{status:J.Error,message:v.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),t(F,{"data-id":"dest-form-docs",label:"Docs",leftIcon:Ei,variant:L.Text,size:P.S,onClick:()=>window.open(`${U}/backends/${d.option.type}`,"_blank","noopener noreferrer")})]}),!c&&t(H,{options:[{icon:Ni,label:"Enabled",value:!1,selectedBgColor:r.v2.colors.green[800]},{icon:$i,label:"Disabled",value:!0,selectedBgColor:r.v2.colors.red[800]}],selected:p.formData.disabled,setSelected:e=>p.handleFormChange("disabled",e),disabled:S}),t(ml,{title:"This connection will monitor:",allowedSignals:Q(d.option.supportedSignals),selectedSignals:Z(p.formData.exportedSignals),setSelectedSignals:e=>p.handleFormChange("exportedSignals",{logs:e.includes(q.Logs),metrics:e.includes(q.Metrics),traces:e.includes(q.Traces),profiles:e.includes(q.Profiles)}),disabled:S,errorMessage:p.formErrors.exportedSignals}),t(x,{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:S,errorMessage:p.formErrors.name}),t(Yl,{signals:Z(p.formData.exportedSignals),fields:d.dynamicFields,disabled:S,formData:p.formData,handleFormChange:(e,t)=>{p.handleFormChange("fields",p.formData.fields.map(a=>a.key===e?{...a,value:t}:a)),e&&p.formErrors[e]&&p.handleErrorChange(e,void 0)},formErrors:p.formErrors}),!n&&e(Jl,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(F,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:Ii,variant:L.Secondary,textColor:r.v2.colors.red[500],onClick:()=>f(d.unsavedIdx)})}),!c&&(!h||h.option.testConnectionSupported&&!S)&&t("div",{style:{width:"150px"},children:t(F,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:L.Secondary,onClick:k})}),h&&t("div",S?{style:{width:"150px"},children:t(F,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:Ai,variant:L.Secondary,onClick:()=>w(!1)})}:{style:{width:"150px"},children:t(F,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:L.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=u();if(!e){const e=await k(),a=!!e&&!e.succeeded;m(d.unsavedIdx,{formData:t,testResult:e},a)}}})}),!h&&t("div",{style:{width:"150px"},children:t(F,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:L.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=u();if(!e){const e=await k(),a=!!e&&!e.succeeded;g({formData:t,testResult:e},a)}}})})]})]}):t(z,{title:"No active form"})});ql.displayName="AddDestinationForm";const Zl=[{id:ae.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:ae.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:ae.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Ql=[{id:ae.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:ae.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:ae.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],es=["*"],ts=[{id:ie.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:ie.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:ie.DbQuery,label:"Collect DB query",tooltip:""},{id:ie.Messaging,label:"Collect messaging",tooltip:""}],as={[re.Java]:[new se("","")],[re.Golang]:[new le("")]},os={[ce.CodeAttributes]:({value:n,setValue:i,formErrors:l})=>{const s=l.codeAttributes,c=r(()=>Object.entries(n.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[n]);o(()=>{if(!c.length&&!s){const e={[ae.FilePath]:!0,[ae.Function]:!0,[ae.LineNumber]:!0,[ae.Column]:null,[ae.Namespace]:null,[ae.StackTrace]:null};i("codeAttributes",e)}},[]);const d=(e,t)=>{const a=t?[...c,e]:c.filter(t=>t!==e),o=Object.values(ae).reduce((e,t)=>(e[t]=!!a.includes(t)||null,e),{});i("codeAttributes",o)};return e(a,{children:[e(C,{$gap:12,children:[t(X,{size:V.XS,color:te.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(C,{$gap:6,children:Zl.map(({id:e,label:a,tooltip:o})=>t(oe,{text:o,withIcon:!0,children:t(w,{label:a,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(k,{errorMessage:s})]}),e(C,{$gap:12,children:[t(X,{size:V.XS,color:te.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(C,{$gap:6,children:Ql.map(({id:e,label:a,tooltip:o})=>t(oe,{text:o,withIcon:!0,children:t(w,{label:a,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(k,{errorMessage:s})]})]})},[ce.CustomInstrumentation]:({value:n,setValue:i,formErrors:l})=>{const s=l.customInstrumentations,c=r(()=>(n?.customInstrumentations?.[re.Golang]||[]).map(e=>new le(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[n]),d=r(()=>(n?.customInstrumentations?.[re.Java]||[]).map(e=>new se(e.className,e.methodName)),[n]);return o(()=>{n?.customInstrumentations||s||i("customInstrumentations",{[re.Golang]:as[re.Golang],[re.Java]:as[re.Java]})},[]),e(a,{children:[e(C,{children:[e(R,{$gap:8,children:[t(Oi,{}),t(S,{label:"Golang custom probes"})]}),t(N,{name:"golangProbes",columns:[{keyName:"packageName",label:"Package name",placeholder:"e.g. github.com/my-org/my-package",tooltip:"The full import path of the package containing the function or method to be instrumented."},{keyName:"functionName",label:"Function name",placeholder:"e.g. myFunction",tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{keyName:"receiverName",label:"Receiver name",placeholder:"e.g. myReceiver",tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{keyName:"receiverMethodName",label:"Receiver method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],values:c,setValues:e=>{const t={};t[re.Golang]=e.map(e=>new le(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[re.Java]=d,i("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]}),e(C,{children:[e(R,{$gap:8,children:[t(Di,{}),t(S,{label:"Java custom probes"})]}),t(N,{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[re.Golang]=c,t[re.Java]=e.map(e=>new se(e.className,e.methodName)),i("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]})]})},[ce.HeadersCollection]:({value:e,setValue:a,formErrors:n})=>{const i=n.headersCollection,l=r(()=>e?.headersCollection?.[ne.HeaderKeys]||[],[e]),s=e=>{const t={[ne.HeaderKeys]:e};a("headersCollection",t)};return o(()=>{l.length||i||s(es)},[]),t(O,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:l,setValues:s,errorMessage:i})},[ce.PayloadCollection]:({value:a,setValue:n,formErrors:i})=>{const l=i.payloadCollection,s=r(()=>Object.entries(a.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[a]);o(()=>{if(!s.length&&!l){const e={[ie.HttpRequest]:{},[ie.HttpResponse]:{},[ie.DbQuery]:{},[ie.Messaging]:{}};n("payloadCollection",e)}},[]);return e(C,{$gap:12,children:[t(X,{size:V.XS,color:te.Secondary,nowrap:!0,children:"Type of data to collect"}),t(C,{$gap:6,children:ts.map(({id:e,label:a,tooltip:o})=>t(oe,{text:o,withIcon:!0,children:t(w,{label:a,value:s.includes(e),onChange:t=>((e,t)=>{const a=t?[...s,e]:s.filter(t=>t!==e),o={[ie.HttpRequest]:a.includes(ie.HttpRequest)?{}:null,[ie.HttpResponse]:a.includes(ie.HttpResponse)?{}:null,[ie.DbQuery]:a.includes(ie.DbQuery)?{}:null,[ie.Messaging]:a.includes(ie.Messaging)?{}:null};n("payloadCollection",o)})(e,t)})},e))}),t(k,{errorMessage:l})]})},[ce.UnknownType]:null},ns=({ruleType:e,value:a,setValue:o,formErrors:n})=>{if(!e)return null;const i=os[e];return i?t(i,{value:a,setValue:o,formErrors:n}):null},is=()=>{const a=b(),{selectedOption:o,genericForm:n}=de();if(!n||!o)return t(z,{title:"No active form"});const{formData:i,handleFormChange:l,formErrors:s}=n;return e(C,{$gap:24,children:[e(R,{$gap:12,$justifyContent:"space-between",children:[t(X,{size:V.XXS,children:o.docsDescription}),t(F,{label:"Docs",leftIcon:Ei,variant:L.Text,size:P.S,onClick:()=>window.open(`${U}${o.docsEndpoint}`,"_blank","noopener noreferrer")})]}),e(R,{$gap:12,children:[t(X,{size:V.XS,color:te.Secondary,nowrap:!0,children:"Supported Languages:"}),o.supportedLanguages.map(e=>t(pe,{label:ue[e],leftIcon:he(e),status:J.Default,useSecondaryTone:!0},e))]}),t(H,{options:[{icon:Ni,label:"Enabled",value:!1,selectedBgColor:a.v2.colors.green[800]},{icon:$i,label:"Disabled",value:!0,selectedBgColor:a.v2.colors.red[800]}],selected:i.disabled,setSelected:e=>l("disabled",e)}),t(x,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:i.ruleName,onChange:({target:{value:e}})=>l("ruleName",e),errorMessage:s.ruleName}),t(ns,{ruleType:o.type,value:i,setValue:(e,t)=>l(e,t),formErrors:s}),t(j,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:i.notes,onChange:({target:{value:e}})=>l("notes",e),errorMessage:s.notes})]})},ls=()=>{const{pendingMerge:e,confirmMerge:a,cancelMerge:o}=ge();if(!e)return null;const{existingName:n,editingName:i}=e;return t(me,{isOpen:!0,onClose:o,title:"Merge with existing Data Stream?",description:be.DATA_STREAM_MERGE_WARNING(i,n),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:L.Primary,onClick:a},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:L.Secondary,onClick:o}})},ss=({autoFocus:a})=>{const{dataStreams:o}=fe(),{genericForm:n,excludeName:i,editingName:l}=ge(),{formData:s,formErrors:c,handleFormChange:d}=n,p=s.name,u=r(()=>o.find(e=>e.name===p&&e.name!==i),[o,p,i]);return e(C,{$width:"100%",$gap:12,children:[t(x,{name:"data-stream-name",label:be.STREAM_NAME,placeholder:be.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:be.STREAM_DESCRIPTION,required:!0,autoFocus:a,value:p,onChange:e=>d("name",e.target.value),errorMessage:c.name}),u&&t(Y,{status:J.Warning,message:be.DATA_STREAM_MERGE_WARNING(l,u.name),fullWidth:!0})]})},rs=()=>{const{selectedStreamName:e}=fe(),{genericForm:a}=ve();if(!a)return t(z,{title:"No active form"});const{formData:o,handleFormChange:n,formErrors:i}=a;return t(x,{name:"sourceName",label:be.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}})=>{n("otelServiceName",t),n("currentStreamName",e)},errorMessage:i.otelServiceName})},cs=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],ds=m.div`
12
+ `,Ql=i(({testConnection:o,isEdit:a},i)=>{const r=f(),{isVm:c}=y(),{activeForm:d,genericForm:u,validateFormData:p,thisUnsavedDestination:h,addUnsavedDestination:m,updateUnsavedDestination:g,deleteUnsavedDestination:b}=yl(),[v,C]=l(h?.testResult),[S,w]=l(!!h);n(()=>{h?(C(h.testResult),w(!0)):(C(void 0),w(!1))},[h]);const x=async()=>{if(!d?.option.testConnectionSupported||!u||c)return;const e=await o(ye(u.formData));return C(e),e};return s(i,()=>({testConnection:x,testConnectionSupported:!!d?.option.testConnectionSupported}),[d?.option.testConnectionSupported,u,o]),u&&d?e(V,{$gap:24,style:{minHeight:"100%"},children:[e(te,{$gap:12,$justifyContent:"space-between",children:[v?v.succeeded?t(me,{status:ge.Success,message:v.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(me,{status:ge.Error,message:v.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),t(oe,{"data-id":"dest-form-docs",label:"Docs",leftIcon:li,variant:ae.Text,size:ne.S,onClick:()=>window.open(`${de}/backends/${d.option.type}`,"_blank","noopener noreferrer")})]}),!c&&t(ue,{options:[{icon:si,label:"Enabled",value:!1,selectedBgColor:r.v2.colors.green[800]},{icon:ri,label:"Disabled",value:!0,selectedBgColor:r.v2.colors.red[800]}],selected:u.formData.disabled,setSelected:e=>u.handleFormChange("disabled",e),disabled:S}),t(Qi,{title:"This connection will monitor:",allowedSignals:ve(d.option.supportedSignals),selectedSignals:be(u.formData.exportedSignals),setSelectedSignals:e=>u.handleFormChange("exportedSignals",{logs:e.includes(fe.Logs),metrics:e.includes(fe.Metrics),traces:e.includes(fe.Traces),profiles:e.includes(fe.Profiles)}),disabled:S,errorMessage:u.formErrors.exportedSignals}),t(G,{name:"destinationName",label:"Destination name",placeholder:"Use a name that describes the destination...",value:u.formData.name,onChange:({target:{value:e}})=>u.handleFormChange("name",e),disabled:S,errorMessage:u.formErrors.name}),t(ql,{signals:be(u.formData.exportedSignals),fields:d.dynamicFields,disabled:S,formData:u.formData,handleFormChange:(e,t)=>{u.handleFormChange("fields",u.formData.fields.map(o=>o.key===e?{...o,value:t}:o)),e&&u.formErrors[e]&&u.handleErrorChange(e,void 0)},formErrors:u.formErrors}),!a&&e(Zl,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(oe,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:ci,variant:ae.Secondary,textColor:r.v2.colors.red[500],onClick:()=>b(d.unsavedIdx)})}),!c&&(!h||h.option.testConnectionSupported&&!S)&&t("div",{style:{width:"150px"},children:t(oe,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:ae.Secondary,onClick:x})}),h&&t("div",S?{style:{width:"150px"},children:t(oe,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:di,variant:ae.Secondary,onClick:()=>w(!1)})}:{style:{width:"150px"},children:t(oe,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:ae.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),o=!!e&&!e.succeeded;g(d.unsavedIdx,{formData:t,testResult:e},o)}}})}),!h&&t("div",{style:{width:"150px"},children:t(oe,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:ae.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),o=!!e&&!e.succeeded;m({formData:t,testResult:e},o)}}})})]})]}):t(se,{title:"No active form"})});Ql.displayName="AddDestinationForm";const es=[{id:Se.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Se.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Se.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],ts=[{id:Se.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Se.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Se.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],os=["*"],ns=[{id:ke.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:ke.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:ke.DbQuery,label:"Collect DB query",tooltip:""},{id:ke.Messaging,label:"Collect messaging",tooltip:""}],as={[Ee.Java]:[new $e("","")],[Ee.Golang]:[new Te("")]},is={[Ne.CodeAttributes]:({value:a,setValue:i,formErrors:l})=>{const s=l.codeAttributes,c=r(()=>Object.entries(a.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[a]);n(()=>{if(!c.length&&!s){const e={[Se.FilePath]:!0,[Se.Function]:!0,[Se.LineNumber]:!0,[Se.Column]:null,[Se.Namespace]:null,[Se.StackTrace]:null};i("codeAttributes",e)}},[]);const d=(e,t)=>{const o=t?[...c,e]:c.filter(t=>t!==e),n=Object.values(Se).reduce((e,t)=>(e[t]=!!o.includes(t)||null,e),{});i("codeAttributes",n)};return e(o,{children:[e(V,{$gap:12,children:[t(re,{size:ce.XS,color:Ce.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(V,{$gap:6,children:es.map(({id:e,label:o,tooltip:n})=>t(we,{text:n,withIcon:!0,children:t(H,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(j,{errorMessage:s})]}),e(V,{$gap:12,children:[t(re,{size:ce.XS,color:Ce.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(V,{$gap:6,children:ts.map(({id:e,label:o,tooltip:n})=>t(we,{text:n,withIcon:!0,children:t(H,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(j,{errorMessage:s})]})]})},[Ne.CustomInstrumentation]:({value:a,setValue:i,formErrors:l})=>{const s=l.customInstrumentations,c=r(()=>(a?.customInstrumentations?.[Ee.Golang]||[]).map(e=>new Te(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[a]),d=r(()=>(a?.customInstrumentations?.[Ee.Java]||[]).map(e=>new $e(e.className,e.methodName)),[a]);return n(()=>{a?.customInstrumentations||s||i("customInstrumentations",{[Ee.Golang]:as[Ee.Golang],[Ee.Java]:as[Ee.Java]})},[]),e(o,{children:[e(V,{children:[e(te,{$gap:8,children:[t(ui,{}),t(U,{label:"Golang custom probes"})]}),t(Y,{name:"golangProbes",columns:[{keyName:"packageName",label:"Package name",placeholder:"e.g. github.com/my-org/my-package",tooltip:"The full import path of the package containing the function or method to be instrumented."},{keyName:"functionName",label:"Function name",placeholder:"e.g. myFunction",tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{keyName:"receiverName",label:"Receiver name",placeholder:"e.g. myReceiver",tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{keyName:"receiverMethodName",label:"Receiver method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],values:c,setValues:e=>{const t={};t[Ee.Golang]=e.map(e=>new Te(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[Ee.Java]=d,i("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]}),e(V,{children:[e(te,{$gap:8,children:[t(pi,{}),t(U,{label:"Java custom probes"})]}),t(Y,{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[Ee.Golang]=c,t[Ee.Java]=e.map(e=>new $e(e.className,e.methodName)),i("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]})]})},[Ne.HeadersCollection]:({value:e,setValue:o,formErrors:a})=>{const i=a.headersCollection,l=r(()=>e?.headersCollection?.[xe.HeaderKeys]||[],[e]),s=e=>{const t={[xe.HeaderKeys]:e};o("headersCollection",t)};return n(()=>{l.length||i||s(os)},[]),t(Q,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:l,setValues:s,errorMessage:i})},[Ne.PayloadCollection]:({value:o,setValue:a,formErrors:i})=>{const l=i.payloadCollection,s=r(()=>Object.entries(o.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]);n(()=>{if(!s.length&&!l){const e={[ke.HttpRequest]:{},[ke.HttpResponse]:{},[ke.DbQuery]:{},[ke.Messaging]:{}};a("payloadCollection",e)}},[]);return e(V,{$gap:12,children:[t(re,{size:ce.XS,color:Ce.Secondary,nowrap:!0,children:"Type of data to collect"}),t(V,{$gap:6,children:ns.map(({id:e,label:o,tooltip:n})=>t(we,{text:n,withIcon:!0,children:t(H,{label:o,value:s.includes(e),onChange:t=>((e,t)=>{const o=t?[...s,e]:s.filter(t=>t!==e),n={[ke.HttpRequest]:o.includes(ke.HttpRequest)?{}:null,[ke.HttpResponse]:o.includes(ke.HttpResponse)?{}:null,[ke.DbQuery]:o.includes(ke.DbQuery)?{}:null,[ke.Messaging]:o.includes(ke.Messaging)?{}:null};a("payloadCollection",n)})(e,t)})},e))}),t(j,{errorMessage:l})]})},[Ne.UnknownType]:null},ls=({ruleType:e,value:o,setValue:n,formErrors:a})=>{if(!e)return null;const i=is[e];return i?t(i,{value:o,setValue:n,formErrors:a}):null},ss=()=>{const o=f(),{selectedOption:n,genericForm:a}=Cl();if(!a||!n)return t(se,{title:"No active form"});const{formData:i,handleFormChange:l,formErrors:s}=a;return e(V,{$gap:24,children:[e(te,{$gap:12,$justifyContent:"space-between",children:[t(re,{size:ce.XXS,children:n.docsDescription}),t(oe,{label:"Docs",leftIcon:li,variant:ae.Text,size:ne.S,onClick:()=>window.open(`${de}${n.docsEndpoint}`,"_blank","noopener noreferrer")})]}),e(te,{$gap:12,children:[t(re,{size:ce.XS,color:Ce.Secondary,nowrap:!0,children:"Supported Languages:"}),n.supportedLanguages.map(e=>t(Ie,{label:Ae[e],leftIcon:Oe(e),status:ge.Default,useSecondaryTone:!0},e))]}),t(ue,{options:[{icon:si,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:ri,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],selected:i.disabled,setSelected:e=>l("disabled",e)}),t(G,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:i.ruleName,onChange:({target:{value:e}})=>l("ruleName",e),errorMessage:s.ruleName}),t(ls,{ruleType:n.type,value:i,setValue:(e,t)=>l(e,t),formErrors:s}),t(pe,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:i.notes,onChange:({target:{value:e}})=>l("notes",e),errorMessage:s.notes})]})},rs=()=>{const{pendingMerge:e,confirmMerge:o,cancelMerge:n}=Sl();if(!e)return null;const{existingName:a,editingName:i}=e;return t(De,{isOpen:!0,onClose:n,title:"Merge with existing Data Stream?",description:Re.DATA_STREAM_MERGE_WARNING(i,a),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:ae.Primary,onClick:o},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:ae.Secondary,onClick:n}})},cs=({autoFocus:o})=>{const{dataStreams:n}=Fe(),{genericForm:a,excludeName:i,editingName:l}=Sl(),{formData:s,formErrors:c,handleFormChange:d}=a,u=s.name,p=r(()=>n.find(e=>e.name===u&&e.name!==i),[n,u,i]);return e(V,{$width:"100%",$gap:12,children:[t(G,{name:"data-stream-name",label:Re.STREAM_NAME,placeholder:Re.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:Re.STREAM_DESCRIPTION,required:!0,autoFocus:o,value:u,onChange:e=>d("name",e.target.value),errorMessage:c.name}),p&&t(me,{status:ge.Warning,message:Re.DATA_STREAM_MERGE_WARNING(l,p.name),fullWidth:!0})]})},ds=()=>{const{selectedStreamName:e}=Fe(),{genericForm:o}=wl();if(!o)return t(se,{title:"No active form"});const{formData:n,handleFormChange:a,formErrors:i}=o;return t(G,{name:"sourceName",label:Re.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:n.otelServiceName,onChange:({target:{value:t}})=>{a("otelServiceName",t),a("currentStreamName",e)},errorMessage:i.otelServiceName})},us=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],ps=g.div`
13
13
  display: flex;
14
14
  flex-direction: column;
15
15
  gap: 24px;
16
- `,ps=m.div`
16
+ `,hs=g.div`
17
17
  display: contents;
18
18
  & > * {
19
19
  opacity: ${({$faded:e})=>e?.4:1};
20
20
  transition: opacity 0.2s ease;
21
21
  }
22
- `,us=({value:e})=>{const a=b();return t(pe,e?{status:J.Success,label:Ne,leftIcon:Ni}:{label:$e,leftIcon:$i,backgroundColor:a.v2.colors.silver[500],textColor:a.v2.colors.white[500]})},hs=({value:e,onChange:a})=>{const o=b(),n=r(()=>[{icon:Ni,label:Ne,value:!0,selectedBgColor:o.v2.colors.green[800]},{icon:$i,label:$e,value:!1,selectedBgColor:o.v2.colors.silver[500]}],[o]);return t(H,{size:Ie.S,options:n,selected:e,setSelected:a??(()=>{}),disabled:!a})},gs=()=>{const e=ye();switch(e.formType){case Ce.Create:return t(ms,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(hs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case Ce.View:return e.data?e.isEditing?t(ms,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(hs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(bs,{data:e.data,renderAction:()=>t(us,{value:!e.data?.rule.disabled})}):null;case Ce.EditAutoNoisy:return t(fs,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:Ee,sectionTitle:ke,sectionSubTitle:Te,presetLabel:we,customInputName:"sampling-auto-input-custom-percentage",percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(hs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Ce.EditAutoCostReduction:return t(fs,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:xe,sectionTitle:ke,presetLabel:we,customInputName:"sampling-cr-auto-input-custom-percentage",showModeToggle:!1,percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(hs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Ce.EditAutoHighlyRelevant:return t(ds,{children:t(fl,{title:e.localEnabled?void 0:Se,summary:e.summary,renderAction:()=>t(hs,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},ms=({category:a,formData:o,onChange:n,sourceOptions:i,namespaceOptions:l,renderAction:s})=>e(ds,{children:[t(Cl,{category:a,formState:o,renderAction:s}),e(ps,{$faded:!!o.disabled,children:[t(Sl,{category:a,formState:o,onChange:n}),t(wl,{formState:o,onChange:n,sourceOptions:i,namespaceOptions:l}),t(kl,{category:a,formState:o,onChange:n}),"highlyRelevant"===a&&t(xl,{formState:o,onChange:n}),"highlyRelevant"===a&&t(Tl,{ruleType:o.ruleType,formState:o,onChange:n}),t(El,{category:a,formState:o,onChange:n})]})]}),bs=({data:a,renderAction:o})=>e(ds,{children:[t(Cl,{readOnly:!0,summary:a.summary,renderAction:o}),t(Sl,{readOnly:!0,data:a}),t(wl,{readOnly:!0,scopes:De(a.rule.sourceScopes)}),t(kl,{readOnly:!0,data:a}),t(El,{readOnly:!0,data:a}),"highlyRelevant"===a.category&&t(Tl,{readOnly:!0,rule:a.rule})]}),fs=({enabled:a,summary:o,inactiveTitle:n,sectionTitle:i,sectionSubTitle:l,presetLabel:s,customInputName:r,showModeToggle:d=!0,percentageMode:p,setPercentageMode:u,percentagePreset:h,setPercentagePreset:g,customPercentage:m,setCustomPercentage:b,renderAction:f})=>{const v=c(e=>u(e),[u]),y=c(e=>g(e),[g]),S=c(e=>b(e.target.value),[b]),w=!d||"sample"===p;return e(ds,{children:[t(fl,{title:a?void 0:n,summary:o,renderAction:f}),t(ps,{$faded:!a,children:e(Ae,{richTitle:{title:i,subTitle:l},children:[d&&t(C,{$alignItems:"flex-start",children:t(H,{size:Ie.S,options:cs,selected:p,setSelected:v})}),w&&t(vl,{description:s,options:yl,selected:h,onSelect:y,customName:r,customLabel:Oe,customPlaceholder:"5%",customValue:m,onCustomChange:S})]})})]})},vs=m.div`
22
+ `,ms=({value:e})=>{const o=f();return t(Ie,e?{status:ge.Success,label:Xe,leftIcon:si}:{label:Ve,leftIcon:ri,backgroundColor:o.v2.colors.silver[500],textColor:o.v2.colors.white[500]})},gs=({value:e,onChange:o})=>{const n=f(),a=r(()=>[{icon:si,label:Xe,value:!0,selectedBgColor:n.v2.colors.green[800]},{icon:ri,label:Ve,value:!1,selectedBgColor:n.v2.colors.silver[500]}],[n]);return t(ue,{options:a,selected:e,setSelected:o??(()=>{}),disabled:!o})},fs=()=>{const e=xl();switch(e.formType){case kl.Create:return t(bs,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(gs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case kl.View:return e.data?e.isEditing?t(bs,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(gs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(vs,{data:e.data,renderAction:()=>t(ms,{value:!e.data?.rule.disabled})}):null;case kl.EditAutoNoisy:return t(ys,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:Be,sectionTitle:_e,sectionSubTitle:Me,presetLabel:Le,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(gs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case kl.EditAutoCostReduction:return t(ys,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:ze,sectionTitle:_e,presetLabel:Le,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(gs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case kl.EditAutoHighlyRelevant:return t(ps,{children:t(tl,{title:e.localEnabled?void 0:Pe,summary:e.summary,renderAction:()=>t(gs,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},bs=({category:o,formData:n,onChange:a,sourceOptions:i,namespaceOptions:l,renderAction:s})=>e(ps,{children:[t(al,{category:o,formState:n,renderAction:s}),e(hs,{$faded:!!n.disabled,children:[t(il,{category:o,formState:n,onChange:a}),t(ll,{formState:n,onChange:a,sourceOptions:i,namespaceOptions:l}),t(sl,{category:o,formState:n,onChange:a}),"highlyRelevant"===o&&t(rl,{formState:n,onChange:a}),"highlyRelevant"===o&&t(cl,{ruleType:n.ruleType,formState:n,onChange:a}),t(dl,{category:o,formState:n,onChange:a})]})]}),vs=({data:o,renderAction:n})=>e(ps,{children:[t(al,{readOnly:!0,summary:o.summary,renderAction:n}),t(il,{readOnly:!0,data:o}),t(ll,{readOnly:!0,scopes:C(o.rule.sourceScopes)}),t(sl,{readOnly:!0,data:o}),t(dl,{readOnly:!0,data:o}),"highlyRelevant"===o.category&&t(cl,{readOnly:!0,rule:o.rule})]}),ys=({enabled:o,summary:n,inactiveTitle:a,sectionTitle:i,sectionSubTitle:l,presetLabel:s,customInputName:r,showModeToggle:d=!0,percentageMode:u,setPercentageMode:p,percentagePreset:h,setPercentagePreset:m,customPercentage:g,setCustomPercentage:f,renderAction:b})=>{const v=c(e=>p(e),[p]),y=c(e=>m(e),[m]),C=c(e=>f(e.target.value),[f]),S=!d||"sample"===u;return e(ps,{children:[t(tl,{title:o?void 0:a,summary:n,renderAction:b}),t(hs,{$faded:!o,children:e(Ue,{richTitle:{title:i,subTitle:l},children:[d&&t(V,{$alignItems:"flex-start",children:t(ue,{options:us,selected:u,setSelected:v})}),S&&t(ol,{description:s,options:nl,selected:h,onSelect:y,customName:r,customLabel:He,customPlaceholder:"5%",customValue:g,onCustomChange:C})]})})]})},Cs=g.div`
23
23
  display: flex;
24
24
  align-items: center;
25
25
  justify-content: space-between;
26
26
  gap: 12px;
27
27
  padding: 8px 12px;
28
28
  border-radius: 12px;
29
- background-color: ${({$isSelected:e,$purpleColors:t,theme:a})=>e?t?a.v2.colors.purple[800]:a.v2.colors.silver[600]:t?a.v2.colors.purple[900]:"transparent"};
29
+ background-color: ${({$isSelected:e,$purpleColors:t,theme:o})=>e?t?o.v2.colors.purple[800]:o.v2.colors.silver[600]:t?o.v2.colors.purple[900]:"transparent"};
30
30
  cursor: ${({$disabled:e})=>e?"not-allowed":"pointer"};
31
31
  opacity: ${({$disabled:e})=>e?.5:1};
32
32
  &:hover {
33
- background-color: ${({$isSelected:e,$purpleColors:t,theme:a})=>e?t?a.v2.colors.purple[700]:a.v2.colors.silver[600]:t?a.v2.colors.purple[800]:a.v2.colors.silver[700]};
33
+ background-color: ${({$isSelected:e,$purpleColors:t,theme:o})=>e?t?o.v2.colors.purple[700]:o.v2.colors.silver[600]:t?o.v2.colors.purple[800]:o.v2.colors.silver[700]};
34
34
  }
35
- `,ys=m.div`
35
+ `,Ss=g.div`
36
36
  display: flex;
37
37
  align-items: center;
38
38
  justify-content: center;
39
39
  padding: 8px;
40
40
  border-radius: 8px;
41
- background-color: ${({theme:e})=>e.v2.colors.white[500]+Re["004"]};
42
- `,Cs=({dataId:a,icon:o,title:n,description:i,withCarret:l,purpleColors:s,disabled:r,children:c,isSelected:d,onClick:p,isChecked:u,isPartiallyChecked:h,onCheckboxChange:g})=>e(vs,{"data-id":a||`list-item-${n}`,$isSelected:d,$purpleColors:s,$disabled:r,onClick:()=>!d&&!r&&p(),children:[e(C,{$gap:4,children:[e(R,{$gap:12,children:[g&&t(w,{partiallyChecked:h||!1,value:u||!1,onChange:e=>g(e)}),o&&t(ys,{children:t(o,{size:20})}),t(X,{size:V.XS,children:n})]}),i&&t(X,{size:V.XXXS,color:te.Secondary,children:i})]}),(l||c)&&e(R,{$gap:8,children:[c,l&&t(Ri,{size:18})]})]}),Ss=m.div`
41
+ background-color: ${({theme:e})=>e.v2.colors.white[500]+je["004"]};
42
+ `,ws=({dataId:o,icon:n,title:a,description:i,withCarret:l,purpleColors:s,disabled:r,children:c,isSelected:d,onClick:u,isChecked:p,isPartiallyChecked:h,onCheckboxChange:m})=>e(Cs,{"data-id":o||`list-item-${a}`,$isSelected:d,$purpleColors:s,$disabled:r,onClick:()=>!d&&!r&&u(),children:[e(V,{$gap:4,children:[e(te,{$gap:12,children:[m&&t(H,{partiallyChecked:h||!1,value:p||!1,onChange:e=>m(e)}),n&&t(Ss,{children:t(n,{size:20})}),t(re,{size:ce.XS,children:a})]}),i&&t(re,{size:ce.XXXS,color:Ce.Secondary,children:i})]}),(l||c)&&e(te,{$gap:8,children:[c,l&&t(hi,{size:18})]})]}),xs=g.div`
43
43
  display: flex;
44
44
  align-items: center;
45
45
  gap: 8px;
46
46
  padding: 8px;
47
- `,ws=({onClose:a,selectedConnectionIds:o,setSelectedConnectionIds:n,createAction:i,withOverlay:s})=>{const[c,p]=l(""),u=d(null),{selectedOption:h,onSelectOption:g,genericForm:m,validateFormData:b}=M(),f=r(()=>(c?Fe.filter(e=>e?.label?.toLowerCase().includes(c.toLowerCase())):Fe).filter(e=>!!e),[c]),v=r(()=>(c?Pe.filter(e=>e?.label?.toLowerCase().includes(c.toLowerCase())):Pe).filter(e=>!!e),[c]),y=r(()=>{const a=(a,o)=>e(Ss,{children:[t(X,{size:V.XS,color:te.Secondary,children:a}),t(pe,{label:o.toString()})]},a),o=e=>{const a=h?.type===e.type;return t(Cs,{dataId:e.type?`option-${e.type}`:void 0,title:e.label,description:e.description,withCarret:!0,isSelected:a,onClick:()=>{u.current?.clearErrors(),g(e)}},e.type)};return[a("Attributes",f.length),...f.map(o),a("Samplers",v.length),...v.map(o)]},[h?.type,f.length,v.length,g]),C=r(()=>h?[t(Kl,{},h.type)]:[t(Le,{$height:"100%",children:t(z,{icon:Fi,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[h]);return t(Nl,{ref:u,isOpen:!0,withOverlay:s,onClose:a,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=b();return!e&&await i(t)},disableSave:!h||!m?.isFormDirty,isFormDirty:m?.isFormDirty,hideDirtyNote:!0,progress:{title:be.CREATING_ACTION,subTitle:be.CREATING_ACTION_SUBTITLE},header:{icon:Fi,title:be.ADD_ACTION,subTitle:be.ADD_ACTION_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:c,onChange:p},leftColumn:{width:"40%",list:y},rightColumn:{width:"60%",list:C}})},ks=({destinationsByCategory:o,filters:n,setFilters:i})=>{const l=r(()=>Object.values(_e).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})).filter(e=>o[e.id]?.length),[o]),s=r(()=>{const e=Object.values(q).map(e=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}));return e.unshift({value:null,label:"All"}),e},[]);return e(a,{children:[t(Be,{placeholder:"Select category",options:l,values:n.categoryType?[n.categoryType]:[],setValues:e=>i({...n,categoryType:n.categoryType===e[0]?null:e[0]})}),t(H,{size:Ie.S,options:s,selected:n.signalType,setSelected:e=>i({...n,signalType:e})})]})},xs=m.div`
47
+ `,ks=({onClose:o,selectedConnectionIds:n,setSelectedConnectionIds:a,createAction:i,withOverlay:s})=>{const[c,u]=l(""),p=d(null),{selectedOption:h,onSelectOption:m,genericForm:g,validateFormData:f}=vl(),b=r(()=>(c?Ge.filter(e=>e?.label?.toLowerCase().includes(c.toLowerCase())):Ge).filter(e=>!!e),[c]),v=r(()=>(c?We.filter(e=>e?.label?.toLowerCase().includes(c.toLowerCase())):We).filter(e=>!!e),[c]),y=r(()=>{const o=(o,n)=>e(xs,{children:[t(re,{size:ce.XS,color:Ce.Secondary,children:o}),t(Ie,{label:n.toString()})]},o),n=e=>{const o=h?.type===e.type;return t(ws,{dataId:e.type?`option-${e.type}`:void 0,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{p.current?.clearErrors(),m(e)}},e.type)};return[o("Attributes",b.length),...b.map(n),o("Samplers",v.length),...v.map(n)]},[h?.type,b.length,v.length,m]),C=r(()=>h?[t(Jl,{},h.type)]:[t(Ke,{$height:"100%",children:t(se,{icon:mi,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[h]);return t(ul,{ref:p,isOpen:!0,withOverlay:s,onClose:o,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=f();return!e&&await i(t)},disableSave:!h||!g?.isFormDirty,isFormDirty:g?.isFormDirty,hideDirtyNote:!0,progress:{title:Re.CREATING_ACTION,subTitle:Re.CREATING_ACTION_SUBTITLE},header:{icon:mi,title:Re.ADD_ACTION,subTitle:Re.ADD_ACTION_DESCRIPTION},connectionIds:n&&a?{value:n,setValue:a}:void 0,search:{value:c,onChange:u},leftColumn:{width:"40%",list:y},rightColumn:{width:"60%",list:C}})},Ts=({destinationsByCategory:n,filters:a,setFilters:i})=>{const l=r(()=>Object.values(Ye).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})).filter(e=>n[e.id]?.length),[n]),s=r(()=>{const e=Object.values(fe).map(e=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}));return e.unshift({value:null,label:"All"}),e},[]);return e(o,{children:[t(Je,{placeholder:"Select category",options:l,values:a.categoryType?[a.categoryType]:[],setValues:e=>i({...a,categoryType:a.categoryType===e[0]?null:e[0]})}),t(ue,{options:s,selected:a.signalType,setSelected:e=>i({...a,signalType:e})})]})},$s=g.div`
48
48
  display: flex;
49
49
  flex-direction: column;
50
50
  padding: 8px;
51
51
  border-radius: 16px;
52
52
  border: ${({$purpleColors:e,theme:t})=>e?`1px solid ${t.v2.colors.purple[500]}`:"1px solid transparent"};
53
- background-color: ${({$noBgColor:e,$purpleColors:t,theme:a})=>e?"transparent":t?a.v2.colors.purple[900]:a.v2.colors.silver[800]};
54
- `,Ts=m.div`
53
+ background-color: ${({$noBgColor:e,$purpleColors:t,theme:o})=>e?"transparent":t?o.v2.colors.purple[900]:o.v2.colors.silver[800]};
54
+ `,Es=g.div`
55
55
  display: flex;
56
56
  align-items: center;
57
57
  justify-content: space-between;
58
58
  gap: 12px;
59
59
  padding: ${({$isOpen:e})=>e?"2px 12px 8px 12px":"2px 12px"};
60
- `,Es=({title:a,tooltip:o,list:n,noBgColor:i,purpleColors:s})=>{const[r,c]=l(!0);return e(xs,{"data-id":`collapse-${a}`,$noBgColor:i,$purpleColors:s,children:[e(Ts,{$isOpen:r,children:[e(R,{$gap:10,children:[t(X,{size:V.XS,children:a}),o&&t(oe,{text:o,withIcon:!0}),t(pe,{label:n.length,status:s?J.Default:void 0})]}),t(Me,{icon:r?Li:_i,size:ze.M,onClick:()=>c(e=>!e)})]}),r?t(C,{children:n.length?p.toArray(n):t(Le,{$padding:"12px 0",children:t(z,{})})}):null]})},Ns=(e,t,a)=>t||a.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!a.signalType||Q(e.supportedSignals).includes(a.signalType))):e,$s=({option:e,formData:a,testResult:o,isSelected:n,onSelect:i})=>t(Cs,{icon:Ue(e.type).icon,title:a?.name||e.displayName,withCarret:!0,purpleColors:!!a,isSelected:n,onClick:()=>i(),children:o&&t(pe,{status:o.succeeded?J.Success:J.Error,leftIcon:o.succeeded?Bi:Mi})}),Is=({listType:e,destinationOptions:a,unsavedDestinations:o})=>{const{activeForm:n,onChangeActiveForm:i}=K();return a?.length?t(Es,{title:Ve[e].TITLE,tooltip:Ve[e].DESCRIPTION,list:a.map((a,o)=>t($s,{option:a,isSelected:n?.listType===e&&"number"!=typeof n?.unsavedIdx&&(null!=a.id&&""!==a.id?n?.option.id===a.id:n?.option.type===a.type),onSelect:()=>i({listType:e,option:a})},`${e}-${a.id??a.type}-${o}`))}):o?.length?t(Es,{purpleColors:!0,title:Ve[e].TITLE,tooltip:Ve[e].DESCRIPTION,list:o.map(({option:a,formData:o,testResult:l},s)=>t($s,{option:a,formData:o,testResult:l,isSelected:n?.unsavedIdx===s&&n?.listType===e,onSelect:()=>i({listType:e,option:a,unsavedIdx:s})},`${e}-${s}`))},e):void 0};var As;!function(e){e.SELF_HOSTED="self hosted",e.MANAGED="managed"}(As||(As={}));const Os=(e,t)=>{const a=[],o=[],n=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===As.SELF_HOSTED?o.push(...e.items):e.name===As.MANAGED&&n.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const o of e?.destinationCategories?.categories||[]){const e=He(o),n=e.items.findIndex(e=>e.type===t.type);if(-1!==n){const o=je(t.fields,{});Object.keys(o).length&&(e.items[n].fields=e.items[n].fields.map(e=>({...e,initialValue:o[e.name]})),a.push(e.items[n]))}}}),{[_e.DETECTED]:a,[_e.SELF_HOSTED]:o,[_e.MANAGED]:n}},Ds=({onClose:e,onBack:a,onNext:n,selectedConnectionIds:i,setSelectedConnectionIds:s,getDestinationCategories:d,getPotentialDestinations:p,initialInputs:u,testConnection:h,createDestination:g,updateDestination:m,withOverlay:b,disableAnimation:f})=>{const[v,y]=l(""),[C,S]=l({categoryType:null,signalType:null}),{destinations:w}=We(),{activeForm:k,genericForm:x,unsavedDestinations:T,setUnsavedDestinations:E}=K();o(()=>{u&&E(u)},[u]);const[N,$]=l(!0),[I,A]=l([]),[O,D]=l({[_e.ALL]:[],[_e.UNSAVED]:[],[_e.EXISTS]:[],[_e.DETECTED]:[],[_e.SELF_HOSTED]:[],[_e.MANAGED]:[]});o(()=>{const e=w.map(e=>{let t;for(const a of I){const o=a.items.find(t=>t.type===e.destinationType.type);if(o){t=o;break}}const a=je(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:a[e.name]??e.initialValue})):[]}});D(t=>({...t,[_e.EXISTS]:e}))},[w,I]);const R=c(async()=>{try{$(!0);const[e,t]=await Promise.all([d(),p()]);e&&A(e.destinationCategories.categories),D(a=>({...a,...Os(e,t)}))}catch(e){}finally{$(!1)}},[]);o(()=>{R()},[]);const F=c(async()=>{const e=(await Promise.all(T.map(({option:e,formData:t})=>{const a=ee(t);if(e.id){const t=Object.fromEntries(e.fields.map(e=>[e.name,e.initialValue??""])),o=Object.fromEntries(a.fields.map(e=>[e.key,e.value??""]));if(!Object.keys(t).some(e=>t[e]!==o[e]))return m(e.id,a,i)}return g(a,i)}))).filter(e=>e?.error);if(e.length)return{error:e.map(e=>e?.error).join("\n")}},[T,i,g,m]),P=(({isFetching:e,destinationsByCategory:a,searchText:o,filters:n})=>{const{unsavedDestinations:i}=K();return{width:"40%",list:r(()=>{const l=[];i.length&&l.push(t(Is,{listType:_e.UNSAVED,unsavedDestinations:i},"unsaved"));for(const e of Object.values(_e)){if(n.categoryType&&n.categoryType!==e)continue;const i=Ns(a[e],o,n);i.length&&l.push(t(Is,{listType:e,destinationOptions:i},e))}return e&&l.push(t(Le,{$height:"100%",children:t(Xe,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),l},[i,a,o,n,e])}})({isFetching:N,destinationsByCategory:O,searchText:v,filters:C}),L=(({testConnection:e})=>{const{activeForm:a}=K();return{width:"60%",list:a?[t(ql,{testConnection:e},a.option.type)]:[t(Le,{$height:"100%",children:t(z,{icon:Pi,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})({testConnection:h});return t(Nl,{isOpen:!0,withOverlay:b,disableAnimation:f,onClose:e,onBack:a?()=>a(T):void 0,onNext:n?()=>n(T):void 0,nextIsSkip:!T.length,onSave:F,disableSave:!k&&!T.length,isFetching:N,isFormDirty:T.length>0||x?.isFormDirty,hideDirtyNote:!0,progress:{title:be.CREATING_DESTINATION,subTitle:be.CREATING_DESTINATION_SUBTITLE},header:{icon:Pi,title:be.ADD_DESTINATIONS,subTitle:be.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:i&&s?{value:i,setValue:s}:void 0,search:{value:v,onChange:y},filters:t(ks,{destinationsByCategory:O,filters:C,setFilters:S}),leftColumn:P,rightColumn:L})},Rs=({onClose:e,selectedConnectionIds:a,setSelectedConnectionIds:o,createInstrumentationRule:n,withOverlay:i})=>{const[s,c]=l(""),p=d(null),{selectedOption:u,onSelectOption:h,genericForm:g,validateFormData:m}=de(),b=r(()=>s?Ge.filter(e=>e.label.toLowerCase().includes(s.toLowerCase())):Ge,[s]),f=r(()=>b.map(e=>{const a=u?.type===e.type;return t(Cs,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:a,onClick:()=>{p.current?.clearErrors(),h(e)}},e.type)}),[u,b.length,h]),v=r(()=>u?[t(is,{},u.type)]:[t(Le,{$height:"100%",children:t(z,{icon:zi,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[u]);return t(Nl,{ref:p,isOpen:!0,withOverlay:i,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=m();return!e&&await n(t)},disableSave:!u||!g?.isFormDirty,isFormDirty:g?.isFormDirty,hideDirtyNote:!0,progress:{title:be.CREATING_INSTRUMENTATION_RULE,subTitle:be.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:zi,title:be.ADD_INSTRUMENTATION_RULE,subTitle:be.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:a&&o?{value:a,setValue:o}:void 0,search:{value:s,onChange:c},leftColumn:{width:"40%",list:f},rightColumn:{width:"60%",list:v}})},Fs=m.div``,Ps=m.div`
60
+ `,Ns=({title:o,tooltip:n,list:a,noBgColor:i,purpleColors:s})=>{const[r,c]=l(!0);return e($s,{"data-id":`collapse-${o}`,$noBgColor:i,$purpleColors:s,children:[e(Es,{$isOpen:r,children:[e(te,{$gap:10,children:[t(re,{size:ce.XS,children:o}),n&&t(we,{text:n,withIcon:!0}),t(Ie,{label:a.length,status:s?ge.Default:void 0})]}),t(qe,{icon:r?fi:bi,size:Ze.M,onClick:()=>c(e=>!e)})]}),r?t(V,{children:a.length?u.toArray(a):t(Ke,{$padding:"12px 0",children:t(se,{})})}):null]})},Is=(e,t,o)=>t||o.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!o.signalType||ve(e.supportedSignals).includes(o.signalType))):e,As=({option:e,formData:o,testResult:n,isSelected:a,onSelect:i})=>t(ws,{icon:tt(e.type).icon,title:o?.name||e.displayName,withCarret:!0,purpleColors:!!o,isSelected:a,onClick:()=>i(),children:n&&t(Ie,{status:n.succeeded?ge.Success:ge.Error,leftIcon:n.succeeded?vi:yi})}),Os=({listType:e,destinationOptions:o,unsavedDestinations:n})=>{const{activeForm:a,onChangeActiveForm:i}=yl();return o?.length?t(Ns,{title:et[e].TITLE,tooltip:et[e].DESCRIPTION,list:o.map((o,n)=>t(As,{option:o,isSelected:a?.listType===e&&"number"!=typeof a?.unsavedIdx&&(null!=o.id&&""!==o.id?a?.option.id===o.id:a?.option.type===o.type),onSelect:()=>i({listType:e,option:o})},`${e}-${o.id??o.type}-${n}`))}):n?.length?t(Ns,{purpleColors:!0,title:et[e].TITLE,tooltip:et[e].DESCRIPTION,list:n.map(({option:o,formData:n,testResult:l},s)=>t(As,{option:o,formData:n,testResult:l,isSelected:a?.unsavedIdx===s&&a?.listType===e,onSelect:()=>i({listType:e,option:o,unsavedIdx:s})},`${e}-${s}`))},e):void 0};var Ds;!function(e){e.SELF_HOSTED="self hosted",e.MANAGED="managed"}(Ds||(Ds={}));const Rs=(e,t)=>{const o=[],n=[],a=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===Ds.SELF_HOSTED?n.push(...e.items):e.name===Ds.MANAGED&&a.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const n of e?.destinationCategories?.categories||[]){const e=ot(n),a=e.items.findIndex(e=>e.type===t.type);if(-1!==a){const n=nt(t.fields,{});Object.keys(n).length&&(e.items[a].fields=e.items[a].fields.map(e=>({...e,initialValue:n[e.name]})),o.push(e.items[a]))}}}),{[Ye.DETECTED]:o,[Ye.SELF_HOSTED]:n,[Ye.MANAGED]:a}},Fs=({onClose:e,onBack:o,onNext:a,selectedConnectionIds:i,setSelectedConnectionIds:s,getDestinationCategories:d,getPotentialDestinations:u,initialInputs:p,testConnection:h,createDestination:m,updateDestination:g,withOverlay:f,disableAnimation:b})=>{const[v,y]=l(""),[C,S]=l({categoryType:null,signalType:null}),{destinations:w}=at(),{activeForm:x,genericForm:k,unsavedDestinations:T,setUnsavedDestinations:$}=yl();n(()=>{p&&$(p)},[p]);const[E,N]=l(!0),[I,A]=l([]),[O,D]=l({[Ye.ALL]:[],[Ye.UNSAVED]:[],[Ye.EXISTS]:[],[Ye.DETECTED]:[],[Ye.SELF_HOSTED]:[],[Ye.MANAGED]:[]});n(()=>{const e=w.map(e=>{let t;for(const o of I){const n=o.items.find(t=>t.type===e.destinationType.type);if(n){t=n;break}}const o=nt(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:o[e.name]??e.initialValue})):[]}});D(t=>({...t,[Ye.EXISTS]:e}))},[w,I]);const R=c(async()=>{try{N(!0);const[e,t]=await Promise.all([d(),u()]);e&&A(e.destinationCategories.categories),D(o=>({...o,...Rs(e,t)}))}catch(e){}finally{N(!1)}},[]);n(()=>{R()},[]);const F=c(async()=>{const e=(await Promise.all(T.map(({option:e,formData:t})=>{const o=ye(t);if(e.id){const t=Object.fromEntries(e.fields.map(e=>[e.name,e.initialValue??""])),n=Object.fromEntries(o.fields.map(e=>[e.key,e.value??""]));if(!Object.keys(t).some(e=>t[e]!==n[e]))return g(e.id,o,i)}return m(o,i)}))).filter(e=>e?.error);if(e.length)return{error:e.map(e=>e?.error).join("\n")}},[T,i,m,g]),P=(({isFetching:e,destinationsByCategory:o,searchText:n,filters:a})=>{const{unsavedDestinations:i}=yl();return{width:"40%",list:r(()=>{const l=[];i.length&&l.push(t(Os,{listType:Ye.UNSAVED,unsavedDestinations:i},"unsaved"));for(const e of Object.values(Ye)){if(a.categoryType&&a.categoryType!==e)continue;const i=Is(o[e],n,a);i.length&&l.push(t(Os,{listType:e,destinationOptions:i},e))}return e&&l.push(t(Ke,{$height:"100%",children:t(Qe,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),l},[i,o,n,a,e])}})({isFetching:E,destinationsByCategory:O,searchText:v,filters:C}),L=(({testConnection:e})=>{const{activeForm:o}=yl();return{width:"60%",list:o?[t(Ql,{testConnection:e},o.option.type)]:[t(Ke,{$height:"100%",children:t(se,{icon:gi,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})({testConnection:h});return t(ul,{isOpen:!0,withOverlay:f,disableAnimation:b,onClose:e,onBack:o?()=>o(T):void 0,onNext:a?()=>a(T):void 0,nextIsSkip:!T.length,onSave:F,disableSave:!x&&!T.length,isFetching:E,isFormDirty:T.length>0||k?.isFormDirty,hideDirtyNote:!0,progress:{title:Re.CREATING_DESTINATION,subTitle:Re.CREATING_DESTINATION_SUBTITLE},header:{icon:gi,title:Re.ADD_DESTINATIONS,subTitle:Re.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:i&&s?{value:i,setValue:s}:void 0,search:{value:v,onChange:y},filters:t(Ts,{destinationsByCategory:O,filters:C,setFilters:S}),leftColumn:P,rightColumn:L})},Ps=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,createInstrumentationRule:a,withOverlay:i})=>{const[s,c]=l(""),u=d(null),{selectedOption:p,onSelectOption:h,genericForm:m,validateFormData:g}=Cl(),f=r(()=>s?it.filter(e=>e.label.toLowerCase().includes(s.toLowerCase())):it,[s]),b=r(()=>f.map(e=>{const o=p?.type===e.type;return t(ws,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{u.current?.clearErrors(),h(e)}},e.type)}),[p,f.length,h]),v=r(()=>p?[t(ss,{},p.type)]:[t(Ke,{$height:"100%",children:t(se,{icon:Ci,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[p]);return t(ul,{ref:u,isOpen:!0,withOverlay:i,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=g();return!e&&await a(t)},disableSave:!p||!m?.isFormDirty,isFormDirty:m?.isFormDirty,hideDirtyNote:!0,progress:{title:Re.CREATING_INSTRUMENTATION_RULE,subTitle:Re.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:Ci,title:Re.ADD_INSTRUMENTATION_RULE,subTitle:Re.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:s,onChange:c},leftColumn:{width:"40%",list:b},rightColumn:{width:"60%",list:v}})},Ls={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:Re.FETCHING_NAMESPACES,subTitle:Re.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:Re.SELECT_NAMESPACE,subTitle:Re.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},_s={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===lt.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"},zs=e=>e?_s:Ls,Ms="No matches",Bs="No sources",Xs=e=>`No sources matched the filter '${e}'`,Vs=e=>(e?"Unselect":"Select")+" all",Us="Show only:",Hs="Selected",js="Auto",Gs="Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",Ws="Enterprise only",Ks=g.div``,Ys=g.div`
61
61
  visibility: hidden;
62
62
 
63
63
  transition: visibility 0s;
@@ -65,19 +65,19 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
65
65
  transition-duration: 0s;
66
66
  }
67
67
 
68
- ${Fs}:hover & {
68
+ ${Ks}:hover & {
69
69
  visibility: visible;
70
70
  }
71
- `,Ls=({workloadName:e,workloadKind:a,isChecked:o,onToggle:n,disabled:i,disabledReason:l})=>{const s=b(),r=()=>{};return t(Fs,{children:t(Cs,{dataId:`source-${e}`,title:e,disabled:i,onClick:i?r:n,isChecked:o,onCheckboxChange:i?r:n,children:i&&l?t(pe,{label:l,status:J.Default,textSize:V.XXXS}):t(Ps,{children:t(pe,{label:a,status:J.Info,textSize:V.XXXS,backgroundColor:s.v2.colors.blue[900]})})})})},_s=m.div``,Bs=m.div`
71
+ `,Js=({workloadName:e,workloadKind:o,isChecked:n,onToggle:a,disabled:i,disabledReason:l})=>{const s=f(),r=()=>{};return t(Ks,{children:t(ws,{dataId:`source-${e}`,title:e,disabled:i,onClick:i?r:a,isChecked:n,onCheckboxChange:i?r:a,children:i&&l?t(Ie,{label:l,status:ge.Default,textSize:ce.XXXS}):t(Ys,{children:t(Ie,{label:o,status:ge.Info,textSize:ce.XXXS,backgroundColor:s.v2.colors.blue[900]})})})})},qs=g.div``,Zs=g.div`
72
72
  visibility: ${({$visible:e})=>e?"visible":"hidden"};
73
73
 
74
74
  transition: visibility 0s;
75
75
  ${({$visible:e})=>!e&&"& * {\n transition-duration: 0s !important;\n }"}
76
76
 
77
- ${_s}:hover & {
77
+ ${qs}:hover & {
78
78
  visibility: visible;
79
79
  }
80
- `,Ms=({clusterId:a,namespaceName:o,checkbox:n,isFutureApps:i,selectedCounts:l,isActive:s,onActive:r,handleSourceChange:c})=>{const d=e=>{r(),c({clusterId:a,workloadId:{namespace:o},auto:e.auto,selected:e.all})};return t(_s,{children:t(Cs,{dataId:`namespace-${o}`,withCarret:!0,title:o,isSelected:s,onClick:r,isPartiallyChecked:n.partial,isChecked:n.all,onCheckboxChange:e=>d({auto:e,all:e}),children:e(R,{$gap:12,children:[t(Bs,{$visible:s||i,children:t(oe,{text:"Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",children:t(I,{label:"Auto",labelAlign:A.Left,size:Ze.S,value:i,onChange:e=>d({auto:e,all:e||void 0})})})}),e(R,{$gap:8,children:[t(X,{variant:Qe.Span,size:V.XXXS,color:te.Secondary,align:"right",children:"Selected"}),t(pe,{label:`${l.sourced}/${l.total}`,status:s?J.Default:Je.Unknown,minWidth:"42px"})]})]})})})},zs=({withCollapse:e,clusterId:a,clusterName:o,namespaces:n,selectedArea:i,setSelectedArea:l,handleSourceChange:s})=>{const c=r(()=>n.map(({name:e,totalWorkloads:n,selectedCount:r,isAllSourced:c,isSomeSourced:d,isFutureApps:p})=>t(Ms,{clusterId:a,namespaceName:e,isFutureApps:p,checkbox:{all:c||p,partial:d},selectedCounts:{sourced:r,total:n},isActive:i.clusterId===a&&i.namespaceName===e,onActive:()=>l({clusterId:a,clusterName:o,namespaceName:e}),handleSourceChange:s},`${a}#${e}`)),[a,o,n,i]);return e?t(Es,{title:o,list:c,noBgColor:!0}):c},Xs=({onClose:a,onBack:n,onNext:i,selectedConnectionIds:s,setSelectedConnectionIds:c,persistSources:d,getAllClusterSnapshots:p,fetchNamespacesWithWorkloads:u,withOverlay:h,disableAnimation:g})=>{const{progress:m,resetProgress:b}=at(),{isFetching:f,setIsFetching:v,setSnapshots:y,formData:C,handleSourceChange:S,handleSelectAll:w,formDiff:k,isFormDirty:x}=ot();o(()=>{let e=!1;v(!0);return(async()=>{try{if(p){const t=await p();!e&&t&&y(t)}else if(u){const t=await u();if(!e&&t.data?.length){const e={clusters:[{clusterId:st,clusterName:lt,namespaces:t.data.map(e=>({name:e.name,selected:e.selected,workloads:e.sources?.map(e=>({namespace:e.namespace,name:e.name,kind:e.kind,selected:e.selected}))||[]}))}]};y(e)}}}catch(e){}finally{e||v(!1)}})(),()=>{e=!0}},[]);const[T,E]=l(""),[N,$]=l(nt.Namespace),[A,O]=l({showOnlySelected:!1}),[D,F]=l({clusterId:"",clusterName:"",namespaceName:""}),P=(({isFetching:a,formData:o,handleSourceChange:n,handleSelectAll:i,selectedArea:l,setSelectedArea:s,searchText:c,searchBy:d,filters:p})=>{const u=r(()=>o.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>et(e,c,p)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...tt(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[o,c,p]),h=r(()=>{let e=!1;for(const{visibleNamespaces:t}of u)for(const{totalWorkloads:a,selectedCount:o}of t)if(e=!0,o!==a)return!1;return e},[u]),{list:g,withFilterCount:m,filteredCount:b,totalCount:f}=r(()=>{const e=u.map(({clusterId:e,clusterName:a,visibleNamespaces:o})=>o.length?t(zs,{withCollapse:u.length>1,clusterId:e,clusterName:a,namespaces:o,selectedArea:l,setSelectedArea:s,handleSourceChange:n},e):null),a=e.filter(e=>null!==e);return{list:a,withFilterCount:a.length!==e.length,filteredCount:a.length,totalCount:e.length}},[u,l]);return{width:"60%",header:e(R,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(R,{$gap:8,children:[t(X,{size:V.XS,nowrap:!0,children:"Namespaces"}),t(oe,{text:m?be.FILTERED_COUNT_TOOLTIP:void 0,children:t(pe,{label:`${m?`${b} / ${f}`:f}`,status:Je.Unknown})})]}),t(X,{"data-id":"namespaces-select-all",onClick:()=>i({boolean:!h,searchText:c,searchBy:d,filters:p}),disabled:!g.length,size:V.XS,children:(h?"Unselect":"Select")+" all"})]}),list:g.length?g:a?[t(Le,{$height:"100%",children:t(Xe,{title:be.FETCHING_NAMESPACES,subTitle:be.FETCHING_NAMESPACES_SUBTITLE,withSpinner:!0})},"loading")]:[t(Le,{$height:"100%",children:t(z,c?{icon:Vi,title:"No matches",subTitle:`No namespace matched the filter '${c}'`}:{icon:Vi,title:"No namespaces",subTitle:"No namespaces found in this cluster"})},"no-data")]}})({isFetching:f,formData:C,handleSourceChange:S,handleSelectAll:w,selectedArea:D,setSelectedArea:F,searchText:N===nt.Namespace?T:"",searchBy:N,filters:A}),L=(({formData:a,handleSourceChange:o,handleSelectAll:n,selectedArea:i,searchText:l,searchBy:s,filters:c})=>{const{tier:d}=G(),p=d===qe.Onprem,u=r(()=>i.value.namespaceName?a.find(({clusterId:e})=>e===i.value.clusterId)?.namespaces.find(({name:e})=>e===i.value.namespaceName):void 0,[a,i.value.clusterId,i.value.namespaceName]),h=r(()=>u?[...u.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Ke(e,l,c)):[],[u,l,c]),g=r(()=>!!h.length&&h.every(({selected:e})=>e),[h]),m=r(()=>{if(!u)return[];const{clusterId:e}=i.value,{name:a}=u;return h.map(({name:n,selected:i,kind:l})=>{const s=!p&&Ye.has(l);return t(Ls,{workloadName:n,workloadKind:l,isChecked:!s&&(i||!1),onToggle:()=>o({clusterId:e,workloadId:{namespace:a,name:n,kind:l}}),disabled:s,disabledReason:"Enterprise only"},`${e}#${a}#${n}#${l}`)})},[h,u,i.value.clusterId]),{withFilterCount:b,filteredCount:f,totalCount:v}=r(()=>{const e=u?.workloads.length??0;return{withFilterCount:h.length!==e,filteredCount:h.length,totalCount:e}},[h,u]);return{width:"40%",header:e(R,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(R,{$gap:8,children:[t(X,{size:V.XS,nowrap:!0,children:i.value.namespaceName?`${i.value.namespaceName} > Workloads`:"Workloads"}),t(oe,{text:b?be.FILTERED_COUNT_TOOLTIP:void 0,children:t(pe,{label:`${b?`${f} / ${v}`:v}`,status:Je.Unknown})})]}),t(X,{"data-id":"workloads-select-all",onClick:()=>n({clusterId:i.value.clusterId,namespaceName:i.value.namespaceName,boolean:!g,searchText:l,searchBy:s,filters:c}),disabled:!m.length,size:V.XS,children:(g?"Unselect":"Select")+" all"})]}),list:m.length?m:[t(Le,{$height:"100%",children:t(z,u?l?{icon:Xi,title:"No matches",subTitle:`No sources matched the filter '${l}'`}:{icon:Xi,title:"No sources",subTitle:"No sources found in this namespace"}:{icon:Xi,title:be.SELECT_NAMESPACE,subTitle:be.SELECT_NAMESPACE_SUBTITLE})},"no-data")]}})({formData:C,handleSourceChange:S,handleSelectAll:w,selectedArea:{value:D},searchText:N===nt.Source?T:"",searchBy:N,filters:A});return t(Nl,{isOpen:!0,withOverlay:h,disableAnimation:g,onClose:a?()=>{b(it.BulkInstrumenting),a()}:void 0,onBack:n?()=>n(k):void 0,onNext:i?()=>i(k):void 0,nextIsSkip:!x,onSave:()=>d(k),header:{icon:Xi,title:be.ADD_SOURCE,subTitle:be.ADD_SOURCES_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:T,onChange:e=>{E(e),N===nt.Namespace&&F({clusterId:"",clusterName:"",namespaceName:""})},segment:{options:[{label:"Namespace",value:nt.Namespace},{label:"Source",value:nt.Source}],selected:N,setSelected:$}},filters:e(R,{$gap:8,children:[t(X,{size:V.XXXS,color:te.Secondary,nowrap:!0,children:"Show only:"}),t(I,{name:"filter-selected",size:Ze.S,label:"Selected",value:A.showOnlySelected,onChange:e=>O(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:x,isFetching:f,progress:{title:be.CREATING_SOURCES,subTitle:be.CREATING_SOURCES_SUBTITLE,percentage:m[it.BulkInstrumenting]?.percentage||0},leftColumn:P,rightColumn:L})},Vs=({onClose:n,actionId:i,updateAction:s,deleteAction:d})=>{const p=b(),{actions:u}=We(),{selectedOption:h,loadAction:g,validateFormData:m,genericForm:f}=M(),[v,y]=l(!1),[S,w]=l(!1),[k,x]=l(null),T=v&&!!f?.isFormDirty,E=r(()=>u?.find(e=>rt(e)===i),[i,u]),N=r(()=>Fe.find(({type:e})=>e===E?.type)??Pe.find(({type:e})=>e===E?.type)??null,[E?.type]);o(()=>{E&&g(E)},[E]);const I=c(()=>{E&&y(!0)},[E]),A=c(()=>{E&&(g(E),y(!1))},[E,g]),O=c(()=>{T?x("close"):n()},[T,n]),D=c(()=>{T?x("cancel"):A()},[T,A]),R=c(()=>{const e=k;x(null),"close"===e?(A(),n()):A()},[k,A,n]),F=c(async()=>{if(E){const{errorMessage:e,preparedFormData:t}=m();e||(await s(E.id,t),y(!1))}},[E,m,s]),P=c(()=>{E&&w(!0)},[E]),_=c(async()=>{E&&(await d(E.id,E.type),n())},[E,d,n]);if(!E||!N)return null;const z=(e=>{const t=[],{type:a,fields:o}=e,n=e=>({status:e?J.Success:Je.Unknown,label:e?"True":"False",invertColors:!0});return a===B.K8sAttributes&&(t.push({id:"collectContainerAttributes",title:"Collect Container Attributes",badge:n(o.collectContainerAttributes)}),t.push({id:"collectReplicaSetAttributes",title:"Collect ReplicaSet Attributes",badge:n(o.collectReplicaSetAttributes)}),t.push({id:"collectWorkloadId",title:"Collect Workload ID",badge:n(o.collectWorkloadId)}),t.push({id:"collectClusterId",title:"Collect Cluster ID",badge:n(o.collectClusterId)}),o.labelsAttributes?.forEach(({labelKey:e,attributeKey:a,from:n,fromSources:i},l)=>{const s=i?.length?i.join(", "):n||$.Pod,r=(o.labelsAttributes?.length??0)>1?`Label #${l+1} `:"Label ";t.push({id:`label-${l}-key`,title:`${r}Key`,label:e}),t.push({id:`label-${l}-attr`,title:`${r}Attribute Key`,label:a}),t.push({id:`label-${l}-from`,title:`${r}From`,label:s})}),o.annotationsAttributes?.forEach(({annotationKey:e,attributeKey:a,from:n,fromSources:i},l)=>{const s=i?.length?i.join(", "):n||$.Pod,r=(o.annotationsAttributes?.length??0)>1?`Annotation #${l+1} `:"Annotation ";t.push({id:`annotation-${l}-key`,title:`${r}Key`,label:e}),t.push({id:`annotation-${l}-attr`,title:`${r}Attribute Key`,label:a}),t.push({id:`annotation-${l}-from`,title:`${r}From`,label:s})})),a===B.AddClusterInfo&&(t.push({id:"overwriteExistingValues",title:"Overwrite Existing Values",badge:n(o.overwriteExistingValues)}),o.clusterAttributes?.forEach(({attributeName:e,attributeStringValue:a},o)=>{t.push({id:`cluster-attr-${o}`,title:e,label:a})})),a===B.DeleteAttributes&&o.attributeNamesToDelete?.forEach((e,a)=>{t.push({id:`del-attr-${a}`,title:"Attribute"+((o.attributeNamesToDelete?.length??0)>1?` #${a+1}`:""),label:e})}),a===B.RenameAttributes&&Object.entries(o.renames||{}).forEach(([e,a],o)=>{t.push({id:`rename-${o}`,title:e,label:a})}),a===B.PiiMasking&&o.piiCategories?.forEach((e,a)=>{t.push({id:`pii-${a}`,title:"Category"+((o.piiCategories?.length??0)>1?` #${a+1}`:""),label:e})}),a===B.ErrorSampler&&t.push({id:"fallbackSamplingRatio",title:"Sampling Ratio",label:String(o.fallbackSamplingRatio??"-")}),a===B.ProbabilisticSampler&&t.push({id:"samplingPercentage",title:"Sampling Percentage",label:String(o.samplingPercentage??"-")}),a===B.LatencySampler&&o.endpointsFilters?.forEach(({serviceName:e,httpRoute:a,minimumLatencyThreshold:n,fallbackSamplingRatio:i},l)=>{const s=(o.endpointsFilters?.length??0)>1?`Endpoint #${l+1} `:"Endpoint ";t.push({id:`endpoint-${l}-service`,title:`${s}Service Name`,label:e}),t.push({id:`endpoint-${l}-route`,title:`${s}HTTP Route`,label:a}),t.push({id:`endpoint-${l}-latency`,title:`${s}Min. Latency`,label:String(n)}),t.push({id:`endpoint-${l}-fallback`,title:`${s}Fallback Sampling Ratio`,label:String(i)})}),a===B.ServiceNameSampler&&o.servicesNameFilters?.forEach(({serviceName:e,samplingRatio:a,fallbackSamplingRatio:n},i)=>{const l=(o.servicesNameFilters?.length??0)>1?`Filter #${i+1} `:"Filter ";t.push({id:`service-${i}-name`,title:`${l}Service Name`,label:e}),t.push({id:`service-${i}-ratio`,title:`${l}Sampling Ratio`,label:String(a)}),t.push({id:`service-${i}-fallback`,title:`${l}Fallback Sampling Ratio`,label:String(n)})}),a===B.SpanAttributeSampler&&o.attributeFilters?.forEach(({serviceName:e,attributeKey:a,fallbackSamplingRatio:n,condition:i},l)=>{const s=Object.keys(i)[0],r=i[s],c=(o.attributeFilters?.length??0)>1?`Filter #${l+1} `:"Filter ";t.push({id:`attr-${l}-service`,title:`${c}Service Name`,label:e}),t.push({id:`attr-${l}-key`,title:`${c}Attribute Key`,label:a}),t.push({id:`attr-${l}-fallback`,title:`${c}Fallback Sampling Ratio`,label:String(n)}),t.push({id:`attr-${l}-condition`,title:`${c}Condition`,label:s}),t.push({id:`attr-${l}-operation`,title:`${c}Operation`,label:r?.operation??"-"}),t.push({id:`attr-${l}-expected`,title:`${c}Expected Value`,label:String(r?.expectedValue??"-")}),"jsonCondition"===s&&t.push({id:`attr-${l}-jsonpath`,title:`${c}JSON Path`,label:r?.jsonPath??"-"})}),a===B.URLTemplatization&&o.urlTemplatizationRulesGroups?.forEach((e,a)=>{const n=(o.urlTemplatizationRulesGroups?.length??0)>1?`Group #${a+1} `:"Group ";e.filterK8sNamespace&&t.push({id:`group-${a}-ns`,title:`${n}Namespace`,label:e.filterK8sNamespace}),e.workloadFilters?.forEach((o,i)=>{const l=[o.kind,o.name].filter(Boolean).join("/");l&&t.push({id:`group-${a}-wf-${i}`,title:`${n}Workload${(e.workloadFilters?.length??0)>1?` #${i+1}`:""}`,label:l})});const i=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");i&&t.push({id:`group-${a}-templates`,title:`${n}Templates`,label:i}),e.notes&&t.push({id:`group-${a}-notes`,title:`${n}Notes`,label:e.notes})}),t})(E);return e(a,{children:[t(ct,{isOpen:!0,header:{icon:gt(E.type),title:N.label,onClose:O,actions:[{id:"edit-action-btn-edit",label:dt.EDIT,icon:Ai,active:v,onClick:I},{id:"edit-action-btn-delete",label:dt.DELETE,icon:xi,color:p.v2.colors.red[500],active:S,onClick:P}]},footer:{actions:v?[{"data-id":"edit-action-btn-cancel",label:dt.CANCEL,variant:L.Secondary,onClick:D},{"data-id":"edit-action-btn-save",label:dt.SAVE,variant:L.Primary,onClick:F}]:[]},children:t(pt,{$padding:"4px 12px 12px",children:v&&h?t(Kl,{}):t(C,{$gap:16,children:e(ut,{bgTint:"1000",children:[e(ut,{bgTint:"900",children:[t(ht,{conditions:E.conditions||[]}),t(ut,{bgTint:"800",cellsPerRow:2,items:(X=E,V=N,[{id:"type",title:be.TYPE,label:V.label},{id:"status",title:be.STATUS,badge:{status:X.disabled?Je.Unknown:J.Success,label:X.disabled?be.DISABLED:be.ENABLED}},{id:"signals",title:be.SIGNALS_FOR_PROCESSING,label:X.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ")||"-"},{id:"name",title:be.NAME,label:X.name||"-"},{id:"notes",title:be.NOTES,label:X.notes||"-"}])})]}),!!z?.length&&t(ut,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ut,{bgTint:"800",cellsPerRow:2,items:z})})]})})})}),t($l,{target:"action",isOpen:S,onClose:()=>w(!1),onApprove:_}),t(Il,{isOpen:null!==k,onClose:()=>x(null),onApprove:R})]});var X,V},Us=({onClose:a,connections:n,selectedConnectionIds:i,setSelectedConnectionIds:s,getEffectiveConfig:c,onApply:d})=>{const[p,u]=l(""),[h,g]=l({showOnlySelected:!1}),m=r(()=>n.filter(e=>{const t=!p||e.name.toLowerCase().includes(p.toLowerCase()),a=!h.showOnlySelected||h.showOnlySelected&&i.includes(e.id);return t&&a}),[n.length,i.length,p,h]),b=e=>{s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[f,v]=l(!1),[y,C]=l(void 0),{formData:S,handleFormChange:w,areFormValuesEqual:k,resetFormData:x}=mt(y||{rollout:{automaticRolloutDisabled:!1}}),T=r(()=>i.length>1||void 0!==y&&!k(y,S),[i.length,y,S]);return o(()=>{1===i.length?(async e=>{if(f)return;v(!0);const t=await c(e);if(t){const e={rollout:{automaticRolloutDisabled:t.rollout?.automaticRolloutDisabled??!1}};C(e),x(e)}v(!1)})(i[0]):C(void 0)},[i.length]),t(Nl,{isOpen:!0,onClose:a,onSave:()=>d(S,i),header:{icon:Ui,title:"Cluster Configuration"},connectionIds:{value:i,setValue:s},search:{placeholder:"Search by cluster name",value:p,onChange:u},filters:e(R,{$gap:8,children:[t(X,{size:V.XXXS,color:te.Secondary,nowrap:!0,children:"Show only:"}),t(I,{size:Ze.S,label:"Selected",value:h.showOnlySelected,onChange:e=>g(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:T,isFetching:f,leftColumn:{width:"35%",header:e(R,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(R,{$gap:8,children:[t(X,{size:V.XS,children:"Clusters"}),t(pe,{label:m.length,status:Je.Unknown})]}),e(R,{$gap:8,children:[t(X,{size:V.XXXS,color:te.Secondary,align:"right",children:"Selected clusters"}),t(pe,{label:`${i.length}/${m.length}`,status:Je.Unknown})]})]}),list:m.map(e=>t(Cs,{title:e.name,isChecked:i.includes(e.id),onClick:()=>b(e.id),onCheckboxChange:()=>b(e.id)},e.id))},rightColumn:{width:"65%",header:t(X,{size:V.XS,children:"Configurations"}),list:[t(I,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>w("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},Hs=({onClose:n,destinationId:i,getDestinationCategories:s,testConnection:p,updateDestination:u,deleteDestination:h})=>{const g=b(),{isVm:m}=G(),{destinations:f}=We(),{selectedStreamName:v}=fe(),{activeForm:y,loadDestination:S,validateFormData:w,genericForm:k}=K(),x=d(null),[T,E]=l(!1),[N,$]=l(!1),[I,A]=l(null),[O,D]=l(!0),[R,F]=l(null),P=T&&!!k?.isFormDirty,B=r(()=>ft(f,v),[f,v]),M=r(()=>B?.find(e=>rt(e)===i),[i,B]);o(()=>{let e=!1;return D(!0),s().then(t=>{e||A(t?.destinationCategories.categories??[])}).catch(t=>{e||A([])}).finally(()=>{e||D(!1)}),()=>{e=!0}},[]),o(()=>{M&&I&&S(M,I)},[M,I]);const z=r(()=>M&&I?vt(I,M):[],[M,I]),X=c(()=>{M&&E(!0)},[M]),V=c(()=>{M&&I&&(S(M,I),E(!1))},[M,I,S]),U=c(()=>{P?F("close"):n()},[P,n]),H=c(()=>{P?F("cancel"):V()},[P,V]),j=c(()=>{const e=R;F(null),"close"===e?(V(),n()):V()},[R,V,n]),Y=c(async()=>{if(M){const{errorMessage:e,preparedFormData:t}=w();e||(await u(M.id,ee(t)),E(!1))}},[M,w,u]),q=c(()=>{M&&$(!0)},[M]),Q=c(async()=>{M&&(await h(M.id),n())},[M,h,n]);if(!M)return null;const{icon:te,iconSrc:ae}=Ue(M.destinationType.type),oe=((e,t)=>{const a=[],o=bt(e,t),n=o.map(e=>({name:e.key,value:e.value})),i=Z(e.exportedSignals);let l=[];const s=()=>{l.length&&(a.push({kind:"cells",id:`cells-${a.length}`,items:l}),l=[])};return o.forEach(({key:e,name:o,value:r})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:p,componentProperties:u,hideFromReadData:h,customReadDataLabels:g}=c||{};if(h?.length&&W(h,i,n))return;const{type:m}=je(u,{type:""}),b=d||"password"===m;if(g?.length)g.forEach(({condition:t,...a},o)=>{t==r&&l.push({id:`${e}-custom-${o}`,title:a.title,label:a.value})});else if(r)if(b)l.push({id:e,title:o,label:new Array(10).fill("•").join("")});else{if(p===_.MultiInput){const t=je(r,null);if(Array.isArray(t)&&t.length)return s(),void a.push({kind:"list",id:e,title:o,items:t.map((t,a)=>({id:`${e}-${a}`,label:String(t)}))})}if(p===_.KeyValuePair){const t=je(r,null);if(Array.isArray(t)&&t.length)return s(),void a.push({kind:"pairs",id:e,title:o,items:t.map((t,a)=>{const o=t&&"object"==typeof t?t:{};return{id:`${e}-${a}`,title:null!=o.key?String(o.key):"",label:null!=o.value?String(o.value):""}})})}l.push({id:e,title:o,label:r})}else l.push({id:e,title:o,label:"-"})}),s(),a})(M,z);return e(a,{children:[t(ct,{isOpen:!0,header:{icon:te,iconSrc:ae,title:M.name||M.destinationType.displayName,onClose:U,actions:[{id:"edit-destination-btn-edit",label:dt.EDIT,icon:Ai,active:T,onClick:X},{id:"edit-destination-btn-delete",label:dt.DELETE,icon:xi,color:g.v2.colors.red[500],active:N,onClick:q}]},footer:{actions:T?[{"data-id":"edit-destination-btn-cancel",label:dt.CANCEL,variant:L.Secondary,onClick:H},...y?.option.testConnectionSupported&&!m?[{"data-id":"edit-destination-btn-test-connection",label:dt.TEST_CONNECTION,variant:L.Secondary,onClick:()=>x.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:dt.SAVE,variant:L.Primary,onClick:Y}]:[]},children:t(pt,{$padding:"4px 12px 12px",children:O?t(Le,{$height:"50vh",children:t(Xe,{withSpinner:!0})}):T&&y?t(ql,{ref:x,isEdit:!0,testConnection:p}):t(C,{$gap:16,children:e(ut,{bgTint:"1000",children:[e(ut,{bgTint:"900",children:[!m&&t(ht,{conditions:M.conditions||[]}),t(ut,{bgTint:"800",cellsPerRow:2,items:(ne=M,[{id:"type",title:be.TYPE,label:ne.destinationType.displayName},{id:"status",title:be.STATUS,badge:{status:ne.disabled?Je.Unknown:J.Success,label:ne.disabled?be.DISABLED:be.ENABLED}},{id:"monitors",title:be.MONITORS,label:Z(ne.exportedSignals).map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ")||"-"},{id:"name",title:be.NAME,label:ne.name||"-"}])})]}),!!oe.length&&t(ut,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:oe.map(e=>"cells"===e.kind?t(ut,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(ut,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t($l,{target:"destination",isOpen:N,onClose:()=>$(!1),onApprove:Q}),t(Il,{isOpen:null!==R,onClose:()=>F(null),onApprove:j})]});var ne},js=({onClose:n,ruleId:i,updateInstrumentationRule:s,deleteInstrumentationRule:d})=>{const p=b(),{instrumentationRules:u}=We(),{addNotification:h}=Ct(),{selectedOption:g,loadRule:m,validateFormData:f,genericForm:v}=de(),[y,S]=l(!1),[w,k]=l(!1),[x,T]=l(null),E=y&&!!v?.isFormDirty,N=r(()=>u?.find(e=>rt(e)===i),[i,u]),$=r(()=>Ge.find(({type:e})=>e===N?.type)??null,[N?.type]);o(()=>{N&&m(N)},[N]);const I=c(()=>{if(N){if(!N.mutable)return void h({type:J.Warning,title:St.FORBIDDEN,message:St.CANNOT_EDIT_RULE,crdType:nt.InstrumentationRule,target:N.ruleId,hideFromHistory:!0});S(!0)}},[N,h]),A=c(()=>{N&&(m(N),S(!1))},[N,m]),O=c(()=>{E?T("close"):n()},[E,n]),D=c(()=>{E?T("cancel"):A()},[E,A]),F=c(()=>{const e=x;T(null),"close"===e?(A(),n()):A()},[x,A,n]),P=c(async()=>{if(N){const{errorMessage:e,preparedFormData:t}=f();e||(await s(N.ruleId,t),S(!1))}},[N,f,s]),_=c(()=>{if(N){if(!N.mutable)return void h({type:J.Warning,title:St.FORBIDDEN,message:St.CANNOT_DELETE_RULE,crdType:nt.InstrumentationRule,target:N.ruleId,hideFromHistory:!0});k(!0)}},[N,h]),B=c(async()=>{N&&(await d(N.ruleId),n())},[N,d,n]);if(!N||!$)return null;const M=((e,a)=>{const o=[];return e.payloadCollection&&Object.entries(e.payloadCollection).forEach(([e,a])=>{a&&o.push(t(X,{size:V.XS,children:`• ${yt(e).toLowerCase()}`},e))}),e.codeAttributes&&Object.entries(e.codeAttributes).forEach(([e,a])=>{a&&o.push(t(X,{size:V.XS,children:`• ${yt(e).toLowerCase()}`},e))}),e.headersCollection?.[ne.HeaderKeys]?.length&&e.headersCollection[ne.HeaderKeys].forEach(e=>{e&&o.push(t(X,{size:V.XS,children:e},e))}),e.customInstrumentations&&(e.customInstrumentations[re.Java]?.forEach((e,n)=>{const i=new se(e.className,e.methodName);if(i.Verify()){0===n&&o.push(t(X,{size:V.XS,children:"Java Custom Probes:"},"java-custom-probes"));const e=i.toString();o.push(t(X,{size:V.XXS,color:a.v2.colors.grey[200],children:`• ${e}`},e))}}),e.customInstrumentations[re.Golang]?.forEach((e,n)=>{const i=new le(e.packageName,e.functionName,e.receiverName,e.receiverMethodName);if(i.Verify()){0===n&&o.push(t(X,{size:V.XS,children:"Golang Custom Probes:"},"golang-custom-probes"));const e=i.toString();o.push(t(X,{size:V.XXS,color:a.v2.colors.grey[200],children:`• ${e}`},e))}})),o})(N,p);return e(a,{children:[t(ct,{isOpen:!0,header:{icon:kt(N.type),title:$.label,onClose:O,actions:[{id:"edit-rule-btn-edit",label:dt.EDIT,icon:Ai,active:y,onClick:I},{id:"edit-rule-btn-delete",label:dt.DELETE,icon:xi,color:p.v2.colors.red[500],active:w,onClick:_}]},footer:{actions:y?[{"data-id":"edit-rule-btn-cancel",label:dt.CANCEL,variant:L.Secondary,onClick:D},{"data-id":"edit-rule-btn-save",label:dt.SAVE,variant:L.Primary,onClick:P}]:[]},children:t(pt,{$padding:"4px 12px 12px",children:y&&g?t(is,{}):t(C,{$gap:16,children:e(ut,{bgTint:"1000",children:[e(ut,{bgTint:"900",children:[t(ht,{conditions:N.conditions||[]}),t(ut,{bgTint:"800",cellsPerRow:2,items:(z=N,U=$,[{id:"type",title:be.TYPE,label:U.label},{id:"status",title:be.STATUS,badge:{status:z.disabled?Je.Unknown:J.Success,label:z.disabled?be.DISABLED:be.ENABLED}},{id:"name",title:be.NAME,label:z.ruleName||"-"},{id:"profile",title:be.MANAGED_BY_PROFILE,label:z.profileName||"-"},{id:"notes",title:be.NOTES,label:z.notes||"-"}])})]}),!!M.length&&t(ut,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ut,{bgTint:"800",children:M})}),!!$.supportedLanguages.length&&t(ut,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ut,{bgTint:"800",children:t(R,{$gap:12,$wrap:"wrap",children:$.supportedLanguages.map(e=>t(wt,{label:ue[e],leftIcon:he(e),flex:"0.5"},e))})})})]})})})}),t($l,{target:"instrumentation rule",isOpen:w,onClose:()=>k(!1),onApprove:B}),t(Il,{isOpen:null!==x,onClose:()=>T(null),onApprove:F})]});var z,U},Ws=({onClickRestartPod:e,namespace:a,podName:o,nodeName:n,startTime:i,agentInjected:l,agentInjectedStatus:s,podHealthStatus:c,children:d})=>{const{formatTimeAgo:p}=xt(),u=r(()=>Tt({agentInjected:l,agentInjectedStatus:s}),[l,s]),h=r(()=>Et(c.status)===J.Success,[c.status]),g=r(()=>({title:o,icon:Hi,withCopy:!0}),[o]),m=r(()=>[{key:`pod-${o}-agent-injected`,status:u?J.Success:J.Error,leftIcon:u?Ni:$i,label:u?be.AGENT_INJECTED:be.AGENT_NOT_INJECTED,tooltip:s.message,textSize:V.XXXS,invertColors:!0,useSecondaryTone:!0},{key:`pod-${o}-health`,status:h?J.Success:J.Error,leftIcon:ji,label:h?be.HEALTHY:be.NOT_HEALTHY,tooltip:c.message,textSize:V.XXXS,invertColors:!0,useSecondaryTone:!0}],[o,u,s.message,h,c.message]),b=r(()=>e?[{id:`restart-pod-${o}`,icon:Wi,label:dt.RESTART_POD,onClick:()=>e(a,o)}]:void 0,[e,a,o]),f=r(()=>[{id:"nodeName",title:be.NODE,label:n,withCopy:!0},{id:"startTime",title:be.START_TIME,label:p(i),labelTooltip:i}],[n,i,p]);return t(ut,{bgTint:"900",richTitle:g,badges:m,dropDataActions:b,items:f,withCollapse:!0,children:d})},Gs=m.div`
80
+ `,Qs=({clusterId:o,namespaceName:n,checkbox:a,isFutureApps:i,selectedCounts:l,isActive:s,onActive:r,handleSourceChange:c})=>{const{isVm:d}=y(),u=e=>{r(),c({clusterId:o,workloadId:{namespace:n},auto:e.auto,selected:e.all})};return t(qs,{children:t(ws,{dataId:`namespace-${n}`,withCarret:!0,title:n,isSelected:s,onClick:r,isPartiallyChecked:a.partial,isChecked:a.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(te,{$gap:12,children:[!d&&t(Zs,{$visible:s||i,children:t(we,{text:Gs,children:t(q,{label:js,labelAlign:Z.Left,size:ct.S,value:i,onChange:e=>u({auto:e,all:e||void 0})})})}),e(te,{$gap:8,children:[t(re,{variant:dt.Span,size:ce.XXXS,color:Ce.Secondary,align:"right",children:Hs}),t(Ie,{label:`${l.sourced}/${l.total}`,status:s?ge.Default:st.Unknown,minWidth:"42px"})]})]})})})},er=({withCollapse:e,clusterId:o,clusterName:n,namespaces:a,selectedArea:i,setSelectedArea:l,handleSourceChange:s})=>{const c=r(()=>a.map(({name:e,totalWorkloads:a,selectedCount:r,isAllSourced:c,isSomeSourced:d,isFutureApps:u})=>t(Qs,{clusterId:o,namespaceName:e,isFutureApps:u,checkbox:{all:c||u,partial:d},selectedCounts:{sourced:r,total:a},isActive:i.clusterId===o&&i.namespaceName===e,onActive:()=>l({clusterId:o,clusterName:n,namespaceName:e}),handleSourceChange:s},`${o}#${e}`)),[o,n,a,i]);return e?t(Ns,{title:n,list:c,noBgColor:!0}):c},tr=({onClose:o,onBack:a,onNext:i,selectedConnectionIds:s,setSelectedConnectionIds:c,persistSources:d,getAllClusterSnapshots:u,fetchNamespacesWithWorkloads:p,withOverlay:h,disableAnimation:m})=>{const{isVm:g}=y(),f=zs(g),{selectedStreamName:b}=Fe(),{progress:v,resetProgress:C}=ut(),{isFetching:S,setIsFetching:w,setSnapshots:x,formData:k,handleSourceChange:T,handleSelectAll:$,formDiff:E,isFormDirty:N}=Il();n(()=>{let e=!1;w(!0);return(async()=>{try{if(u){const t=await u();!e&&t&&x(t)}else if(p){const t=await p();if(!e&&t.data?.length){const e={clusters:[{clusterId:mt,clusterName:ht,namespaces:t.data.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(b),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,selected:e.markedForInstrumentation?.markedForInstrumentation??!1}))||[]}))}]};x(e)}}}catch(e){}finally{e||w(!1)}})(),()=>{e=!0}},[b]);const[I,A]=l(""),[O,D]=l(lt.Namespace),[R,F]=l({showOnlySelected:!1}),[P,L]=l({clusterId:"",clusterName:"",namespaceName:""}),_=(({isFetching:o,formData:n,handleSourceChange:a,handleSelectAll:i,selectedArea:l,setSelectedArea:s,searchText:c,searchBy:d,filters:u})=>{const{isVm:p}=y(),h=zs(p),m=r(()=>n.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>El(e,c,u)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...Nl(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[n,c,u]),g=r(()=>{let e=!1;for(const{visibleNamespaces:t}of m)for(const{totalWorkloads:o,selectedCount:n}of t)if(e=!0,n!==o)return!1;return e},[m]),{list:f,withFilterCount:b,filteredCount:v,totalCount:C}=r(()=>{const e=m.map(({clusterId:e,clusterName:o,visibleNamespaces:n})=>n.length?t(er,{withCollapse:m.length>1,clusterId:e,clusterName:o,namespaces:n,selectedArea:l,setSelectedArea:s,handleSourceChange:a},e):null),o=e.filter(e=>null!==e);return{list:o,withFilterCount:o.length!==e.length,filteredCount:o.length,totalCount:e.length}},[m,l]);return{width:"60%",header:e(te,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(te,{$gap:8,children:[t(re,{size:ce.XS,nowrap:!0,children:h.groupColumnHeader}),t(we,{text:b?Re.FILTERED_COUNT_TOOLTIP:void 0,children:t(Ie,{label:`${b?`${v} / ${C}`:C}`,status:st.Unknown})})]}),t(re,{"data-id":"namespaces-select-all",onClick:()=>i({boolean:!g,searchText:c,searchBy:d,filters:u}),disabled:!f.length,size:ce.XS,children:Vs(g)})]}),list:f.length?f:o?[t(Ke,{$height:"100%",children:t(Qe,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(Ke,{$height:"100%",children:t(se,c?{icon:wi,title:Ms,subTitle:h.noGroupMatchedFilter(c)}:{icon:wi,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:S,formData:k,handleSourceChange:T,handleSelectAll:$,selectedArea:P,setSelectedArea:L,searchText:O===lt.Namespace?I:"",searchBy:O,filters:R}),z=(({formData:o,handleSourceChange:n,handleSelectAll:a,selectedArea:i,searchText:l,searchBy:s,filters:c})=>{const{tier:d,isVm:u}=y(),p=zs(u),h=d===rt.Onprem,m=r(()=>i.value.namespaceName?o.find(({clusterId:e})=>e===i.value.clusterId)?.namespaces.find(({name:e})=>e===i.value.namespaceName):void 0,[o,i.value.clusterId,i.value.namespaceName]),g=r(()=>m?[...m.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Tl(e,l,c)):[],[m,l,c]),f=r(()=>!!g.length&&g.every(({selected:e})=>e),[g]),b=r(()=>{if(!m)return[];const{clusterId:e}=i.value,{name:o}=m;return g.map(({name:a,selected:i,kind:l})=>{const s=!u&&!h&&$l.has(l);return t(Js,{workloadName:a,workloadKind:l,isChecked:!s&&(i||!1),onToggle:()=>n({clusterId:e,workloadId:{namespace:o,name:a,kind:l}}),disabled:s,disabledReason:Ws},`${e}#${o}#${a}#${l}`)})},[g,m,i.value.clusterId]),{withFilterCount:v,filteredCount:C,totalCount:S}=r(()=>{const e=m?.workloads.length??0;return{withFilterCount:g.length!==e,filteredCount:g.length,totalCount:e}},[g,m]);return{width:"40%",header:e(te,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(te,{$gap:8,children:[t(re,{size:ce.XS,nowrap:!0,children:i.value.namespaceName?`${i.value.namespaceName} > ${p.itemColumnHeader}`:p.itemColumnHeader}),t(we,{text:v?Re.FILTERED_COUNT_TOOLTIP:void 0,children:t(Ie,{label:`${v?`${C} / ${S}`:S}`,status:st.Unknown})})]}),t(re,{"data-id":"workloads-select-all",onClick:()=>a({clusterId:i.value.clusterId,namespaceName:i.value.namespaceName,boolean:!f,searchText:l,searchBy:s,filters:c}),disabled:!b.length,size:ce.XS,children:Vs(f)})]}),list:b.length?b:[t(Ke,{$height:"100%",children:t(se,m?l?{icon:Si,title:Ms,subTitle:Xs(l)}:{icon:Si,title:Bs,subTitle:p.noItemsInGroupSubTitle}:{icon:Si,title:p.selectGroupPrompt.title,subTitle:p.selectGroupPrompt.subTitle})},"no-data")]}})({formData:k,handleSourceChange:T,handleSelectAll:$,selectedArea:{value:P},searchText:O===lt.Source?I:"",searchBy:O,filters:R});return t(ul,{isOpen:!0,withOverlay:h,disableAnimation:m,onClose:o?()=>{C(pt.BulkInstrumenting),o()}:void 0,onBack:a?()=>a(E):void 0,onNext:i?()=>i(E):void 0,nextIsSkip:!N,onSave:()=>d(E),header:{icon:Si,title:Re.ADD_SOURCE,subTitle:Re.ADD_SOURCES_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:I,onChange:e=>{A(e),O===lt.Namespace&&L({clusterId:"",clusterName:"",namespaceName:""})},placeholder:f.searchPlaceholder(O),segment:{options:[{label:f.groupSegmentLabel,value:lt.Namespace},{label:f.itemSegmentLabel,value:lt.Source}],selected:O,setSelected:D}},filters:e(te,{$gap:8,children:[t(re,{size:ce.XXXS,color:Ce.Secondary,nowrap:!0,children:Us}),t(q,{name:"filter-selected",size:ct.S,label:Hs,value:R.showOnlySelected,onChange:e=>F(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:N,isFetching:S,progress:{title:Re.CREATING_SOURCES,subTitle:Re.CREATING_SOURCES_SUBTITLE,percentage:v[pt.BulkInstrumenting]?.percentage||0},leftColumn:_,rightColumn:z})},or=({onClose:a,actionId:i,updateAction:s,deleteAction:d})=>{const u=f(),{actions:p}=at(),{selectedOption:h,loadAction:m,validateFormData:g,genericForm:b}=vl(),[v,y]=l(!1),[C,S]=l(!1),[w,x]=l(null),k=v&&!!b?.isFormDirty,T=r(()=>p?.find(e=>gt(e)===i),[i,p]),$=r(()=>Ge.find(({type:e})=>e===T?.type)??We.find(({type:e})=>e===T?.type)??null,[T?.type]);n(()=>{T&&m(T)},[T]);const E=c(()=>{T&&y(!0)},[T]),N=c(()=>{T&&(m(T),y(!1))},[T,m]),I=c(()=>{k?x("close"):a()},[k,a]),A=c(()=>{k?x("cancel"):N()},[k,N]),O=c(()=>{const e=w;x(null),"close"===e?(N(),a()):N()},[w,N,a]),D=c(async()=>{if(T){const{errorMessage:e,preparedFormData:t}=g();e||(await s(T.id,t),y(!1))}},[T,g,s]),R=c(()=>{T&&S(!0)},[T]),F=c(async()=>{T&&(await d(T.id,T.type),a())},[T,d,a]);if(!T||!$)return null;const P=(e=>{const t=[],{type:o,fields:n}=e,a=e=>({status:e?ge.Success:st.Unknown,label:e?"True":"False",invertColors:!0});return o===le.K8sAttributes&&(t.push({id:"collectContainerAttributes",title:"Collect Container Attributes",badge:a(n.collectContainerAttributes)}),t.push({id:"collectReplicaSetAttributes",title:"Collect ReplicaSet Attributes",badge:a(n.collectReplicaSetAttributes)}),t.push({id:"collectWorkloadId",title:"Collect Workload ID",badge:a(n.collectWorkloadId)}),t.push({id:"collectClusterId",title:"Collect Cluster ID",badge:a(n.collectClusterId)}),n.labelsAttributes?.forEach(({labelKey:e,attributeKey:o,from:a,fromSources:i},l)=>{const s=i?.length?i.join(", "):a||J.Pod,r=(n.labelsAttributes?.length??0)>1?`Label #${l+1} `:"Label ";t.push({id:`label-${l}-key`,title:`${r}Key`,label:e}),t.push({id:`label-${l}-attr`,title:`${r}Attribute Key`,label:o}),t.push({id:`label-${l}-from`,title:`${r}From`,label:s})}),n.annotationsAttributes?.forEach(({annotationKey:e,attributeKey:o,from:a,fromSources:i},l)=>{const s=i?.length?i.join(", "):a||J.Pod,r=(n.annotationsAttributes?.length??0)>1?`Annotation #${l+1} `:"Annotation ";t.push({id:`annotation-${l}-key`,title:`${r}Key`,label:e}),t.push({id:`annotation-${l}-attr`,title:`${r}Attribute Key`,label:o}),t.push({id:`annotation-${l}-from`,title:`${r}From`,label:s})})),o===le.AddClusterInfo&&(t.push({id:"overwriteExistingValues",title:"Overwrite Existing Values",badge:a(n.overwriteExistingValues)}),n.clusterAttributes?.forEach(({attributeName:e,attributeStringValue:o},n)=>{t.push({id:`cluster-attr-${n}`,title:e,label:o})})),o===le.DeleteAttributes&&n.attributeNamesToDelete?.forEach((e,o)=>{t.push({id:`del-attr-${o}`,title:"Attribute"+((n.attributeNamesToDelete?.length??0)>1?` #${o+1}`:""),label:e})}),o===le.RenameAttributes&&Object.entries(n.renames||{}).forEach(([e,o],n)=>{t.push({id:`rename-${n}`,title:e,label:o})}),o===le.PiiMasking&&n.piiCategories?.forEach((e,o)=>{t.push({id:`pii-${o}`,title:"Category"+((n.piiCategories?.length??0)>1?` #${o+1}`:""),label:e})}),o===le.ErrorSampler&&t.push({id:"fallbackSamplingRatio",title:"Sampling Ratio",label:String(n.fallbackSamplingRatio??"-")}),o===le.ProbabilisticSampler&&t.push({id:"samplingPercentage",title:"Sampling Percentage",label:String(n.samplingPercentage??"-")}),o===le.LatencySampler&&n.endpointsFilters?.forEach(({serviceName:e,httpRoute:o,minimumLatencyThreshold:a,fallbackSamplingRatio:i},l)=>{const s=(n.endpointsFilters?.length??0)>1?`Endpoint #${l+1} `:"Endpoint ";t.push({id:`endpoint-${l}-service`,title:`${s}Service Name`,label:e}),t.push({id:`endpoint-${l}-route`,title:`${s}HTTP Route`,label:o}),t.push({id:`endpoint-${l}-latency`,title:`${s}Min. Latency`,label:String(a)}),t.push({id:`endpoint-${l}-fallback`,title:`${s}Fallback Sampling Ratio`,label:String(i)})}),o===le.ServiceNameSampler&&n.servicesNameFilters?.forEach(({serviceName:e,samplingRatio:o,fallbackSamplingRatio:a},i)=>{const l=(n.servicesNameFilters?.length??0)>1?`Filter #${i+1} `:"Filter ";t.push({id:`service-${i}-name`,title:`${l}Service Name`,label:e}),t.push({id:`service-${i}-ratio`,title:`${l}Sampling Ratio`,label:String(o)}),t.push({id:`service-${i}-fallback`,title:`${l}Fallback Sampling Ratio`,label:String(a)})}),o===le.SpanAttributeSampler&&n.attributeFilters?.forEach(({serviceName:e,attributeKey:o,fallbackSamplingRatio:a,condition:i},l)=>{const s=Object.keys(i)[0],r=i[s],c=(n.attributeFilters?.length??0)>1?`Filter #${l+1} `:"Filter ";t.push({id:`attr-${l}-service`,title:`${c}Service Name`,label:e}),t.push({id:`attr-${l}-key`,title:`${c}Attribute Key`,label:o}),t.push({id:`attr-${l}-fallback`,title:`${c}Fallback Sampling Ratio`,label:String(a)}),t.push({id:`attr-${l}-condition`,title:`${c}Condition`,label:s}),t.push({id:`attr-${l}-operation`,title:`${c}Operation`,label:r?.operation??"-"}),t.push({id:`attr-${l}-expected`,title:`${c}Expected Value`,label:String(r?.expectedValue??"-")}),"jsonCondition"===s&&t.push({id:`attr-${l}-jsonpath`,title:`${c}JSON Path`,label:r?.jsonPath??"-"})}),o===le.URLTemplatization&&n.urlTemplatizationRulesGroups?.forEach((e,o)=>{const a=(n.urlTemplatizationRulesGroups?.length??0)>1?`Group #${o+1} `:"Group ";e.filterK8sNamespace&&t.push({id:`group-${o}-ns`,title:`${a}Namespace`,label:e.filterK8sNamespace}),e.workloadFilters?.forEach((n,i)=>{const l=[n.kind,n.name].filter(Boolean).join("/");l&&t.push({id:`group-${o}-wf-${i}`,title:`${a}Workload${(e.workloadFilters?.length??0)>1?` #${i+1}`:""}`,label:l})});const i=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");i&&t.push({id:`group-${o}-templates`,title:`${a}Templates`,label:i}),e.notes&&t.push({id:`group-${o}-notes`,title:`${a}Notes`,label:e.notes})}),t})(T);return e(o,{children:[t(ft,{isOpen:!0,header:{icon:St(T.type),title:$.label,onClose:I,actions:[{id:"edit-action-btn-edit",label:bt.EDIT,icon:di,active:v,onClick:E},{id:"edit-action-btn-delete",label:bt.DELETE,icon:ai,color:u.v2.colors.red[500],active:C,onClick:R}]},footer:{actions:v?[{"data-id":"edit-action-btn-cancel",label:bt.CANCEL,variant:ae.Secondary,onClick:A},{"data-id":"edit-action-btn-save",label:bt.SAVE,variant:ae.Primary,onClick:D}]:[]},children:t(vt,{$padding:"4px 12px 12px",children:v&&h?t(Jl,{}):t(V,{$gap:16,children:e(yt,{bgTint:"1000",children:[e(yt,{bgTint:"900",children:[t(Ct,{conditions:T.conditions||[]}),t(yt,{bgTint:"800",cellsPerRow:2,items:(L=T,_=$,[{id:"type",title:Re.TYPE,label:_.label},{id:"status",title:Re.STATUS,badge:{status:L.disabled?st.Unknown:ge.Success,label:L.disabled?Re.DISABLED:Re.ENABLED}},{id:"signals",title:Re.SIGNALS_FOR_PROCESSING,label:L.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ")||"-"},{id:"name",title:Re.NAME,label:L.name||"-"},{id:"notes",title:Re.NOTES,label:L.notes||"-"}])})]}),!!P?.length&&t(yt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(yt,{bgTint:"800",cellsPerRow:2,items:P})})]})})})}),t(pl,{target:"action",isOpen:C,onClose:()=>S(!1),onApprove:F}),t(hl,{isOpen:null!==w,onClose:()=>x(null),onApprove:O})]});var L,_},nr=({onClose:o,connections:a,selectedConnectionIds:i,setSelectedConnectionIds:s,getEffectiveConfig:c,onApply:d})=>{const[u,p]=l(""),[h,m]=l({showOnlySelected:!1}),g=r(()=>a.filter(e=>{const t=!u||e.name.toLowerCase().includes(u.toLowerCase()),o=!h.showOnlySelected||h.showOnlySelected&&i.includes(e.id);return t&&o}),[a.length,i.length,u,h]),f=e=>{s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[b,v]=l(!1),[y,C]=l(void 0),{formData:S,handleFormChange:w,areFormValuesEqual:x,resetFormData:k}=wt(y||{rollout:{automaticRolloutDisabled:!1}}),T=r(()=>i.length>1||void 0!==y&&!x(y,S),[i.length,y,S]);return n(()=>{1===i.length?(async e=>{if(b)return;v(!0);const t=await c(e);if(t){const e={rollout:{automaticRolloutDisabled:t.rollout?.automaticRolloutDisabled??!1}};C(e),k(e)}v(!1)})(i[0]):C(void 0)},[i.length]),t(ul,{isOpen:!0,onClose:o,onSave:()=>d(S,i),header:{icon:xi,title:"Cluster Configuration"},connectionIds:{value:i,setValue:s},search:{placeholder:"Search by cluster name",value:u,onChange:p},filters:e(te,{$gap:8,children:[t(re,{size:ce.XXXS,color:Ce.Secondary,nowrap:!0,children:"Show only:"}),t(q,{size:ct.S,label:"Selected",value:h.showOnlySelected,onChange:e=>m(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:T,isFetching:b,leftColumn:{width:"35%",header:e(te,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(te,{$gap:8,children:[t(re,{size:ce.XS,children:"Clusters"}),t(Ie,{label:g.length,status:st.Unknown})]}),e(te,{$gap:8,children:[t(re,{size:ce.XXXS,color:Ce.Secondary,align:"right",children:"Selected clusters"}),t(Ie,{label:`${i.length}/${g.length}`,status:st.Unknown})]})]}),list:g.map(e=>t(ws,{title:e.name,isChecked:i.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(re,{size:ce.XS,children:"Configurations"}),list:[t(q,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>w("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},ar=({onClose:a,destinationId:i,getDestinationCategories:s,testConnection:u,updateDestination:p,deleteDestination:h})=>{const m=f(),{isVm:g}=y(),{destinations:b}=at(),{selectedStreamName:v}=Fe(),{activeForm:C,loadDestination:S,validateFormData:w,genericForm:x}=yl(),k=d(null),[T,$]=l(!1),[E,N]=l(!1),[I,A]=l(null),[O,D]=l(!0),[R,F]=l(null),P=T&&!!x?.isFormDirty,L=r(()=>kt(b,v),[b,v]),_=r(()=>L?.find(e=>gt(e)===i),[i,L]);n(()=>{let e=!1;return D(!0),s().then(t=>{e||A(t?.destinationCategories.categories??[])}).catch(t=>{e||A([])}).finally(()=>{e||D(!1)}),()=>{e=!0}},[]),n(()=>{_&&I&&S(_,I)},[_,I]);const z=r(()=>_&&I?Tt(I,_):[],[_,I]),M=c(()=>{_&&$(!0)},[_]),B=c(()=>{_&&I&&(S(_,I),$(!1))},[_,I,S]),X=c(()=>{P?F("close"):a()},[P,a]),U=c(()=>{P?F("cancel"):B()},[P,B]),H=c(()=>{const e=R;F(null),"close"===e?(B(),a()):B()},[R,B,a]),j=c(async()=>{if(_){const{errorMessage:e,preparedFormData:t}=w();e||(await p(_.id,ye(t)),$(!1))}},[_,w,p]),G=c(()=>{_&&N(!0)},[_]),W=c(async()=>{_&&(await h(_.id),a())},[_,h,a]);if(!_)return null;const{icon:K,iconSrc:Y}=tt(_.destinationType.type),J=((e,t)=>{const o=[],n=xt(e,t),a=n.map(e=>({name:e.key,value:e.value})),i=be(e.exportedSignals);let l=[];const s=()=>{l.length&&(o.push({kind:"cells",id:`cells-${o.length}`,items:l}),l=[])};return n.forEach(({key:e,name:n,value:r})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:u,componentProperties:p,hideFromReadData:h,customReadDataLabels:m}=c||{};if(h?.length&&he(h,i,a))return;const{type:g}=nt(p,{type:""}),f=d||"password"===g;if(m?.length)m.forEach(({condition:t,...o},n)=>{t==r&&l.push({id:`${e}-custom-${n}`,title:o.title,label:o.value})});else if(r)if(f)l.push({id:e,title:n,label:new Array(10).fill("•").join("")});else{if(u===ie.MultiInput){const t=nt(r,null);if(Array.isArray(t)&&t.length)return s(),void o.push({kind:"list",id:e,title:n,items:t.map((t,o)=>({id:`${e}-${o}`,label:String(t)}))})}if(u===ie.KeyValuePair){const t=nt(r,null);if(Array.isArray(t)&&t.length)return s(),void o.push({kind:"pairs",id:e,title:n,items:t.map((t,o)=>{const n=t&&"object"==typeof t?t:{};return{id:`${e}-${o}`,title:null!=n.key?String(n.key):"",label:null!=n.value?String(n.value):""}})})}l.push({id:e,title:n,label:r})}else l.push({id:e,title:n,label:"-"})}),s(),o})(_,z);return e(o,{children:[t(ft,{isOpen:!0,header:{icon:K,iconSrc:Y,title:_.name||_.destinationType.displayName,onClose:X,actions:[{id:"edit-destination-btn-edit",label:bt.EDIT,icon:di,active:T,onClick:M},{id:"edit-destination-btn-delete",label:bt.DELETE,icon:ai,color:m.v2.colors.red[500],active:E,onClick:G}]},footer:{actions:T?[{"data-id":"edit-destination-btn-cancel",label:bt.CANCEL,variant:ae.Secondary,onClick:U},...C?.option.testConnectionSupported&&!g?[{"data-id":"edit-destination-btn-test-connection",label:bt.TEST_CONNECTION,variant:ae.Secondary,onClick:()=>k.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:bt.SAVE,variant:ae.Primary,onClick:j}]:[]},children:t(vt,{$padding:"4px 12px 12px",children:O?t(Ke,{$height:"50vh",children:t(Qe,{withSpinner:!0})}):T&&C?t(Ql,{ref:k,isEdit:!0,testConnection:u}):t(V,{$gap:16,children:e(yt,{bgTint:"1000",children:[e(yt,{bgTint:"900",children:[!g&&t(Ct,{conditions:_.conditions||[]}),t(yt,{bgTint:"800",cellsPerRow:2,items:(q=_,[{id:"type",title:Re.TYPE,label:q.destinationType.displayName},{id:"status",title:Re.STATUS,badge:{status:q.disabled?st.Unknown:ge.Success,label:q.disabled?Re.DISABLED:Re.ENABLED}},{id:"monitors",title:Re.MONITORS,label:be(q.exportedSignals).map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ")||"-"},{id:"name",title:Re.NAME,label:q.name||"-"}])})]}),!!J.length&&t(yt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:J.map(e=>"cells"===e.kind?t(yt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(yt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(pl,{target:"destination",isOpen:E,onClose:()=>N(!1),onApprove:W}),t(hl,{isOpen:null!==R,onClose:()=>F(null),onApprove:H})]});var q},ir=({onClose:a,ruleId:i,updateInstrumentationRule:s,deleteInstrumentationRule:d})=>{const u=f(),{instrumentationRules:p}=at(),{addNotification:h}=Et(),{selectedOption:m,loadRule:g,validateFormData:b,genericForm:v}=Cl(),[y,C]=l(!1),[S,w]=l(!1),[x,k]=l(null),T=y&&!!v?.isFormDirty,$=r(()=>p?.find(e=>gt(e)===i),[i,p]),E=r(()=>it.find(({type:e})=>e===$?.type)??null,[$?.type]);n(()=>{$&&g($)},[$]);const N=c(()=>{if($){if(!$.mutable)return void h({type:ge.Warning,title:Nt.FORBIDDEN,message:Nt.CANNOT_EDIT_RULE,crdType:lt.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});C(!0)}},[$,h]),I=c(()=>{$&&(g($),C(!1))},[$,g]),A=c(()=>{T?k("close"):a()},[T,a]),O=c(()=>{T?k("cancel"):I()},[T,I]),D=c(()=>{const e=x;k(null),"close"===e?(I(),a()):I()},[x,I,a]),R=c(async()=>{if($){const{errorMessage:e,preparedFormData:t}=b();e||(await s($.ruleId,t),C(!1))}},[$,b,s]),F=c(()=>{if($){if(!$.mutable)return void h({type:ge.Warning,title:Nt.FORBIDDEN,message:Nt.CANNOT_DELETE_RULE,crdType:lt.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});w(!0)}},[$,h]),P=c(async()=>{$&&(await d($.ruleId),a())},[$,d,a]);if(!$||!E)return null;const L=((e,o)=>{const n=[];return e.payloadCollection&&Object.entries(e.payloadCollection).forEach(([e,o])=>{o&&n.push(t(re,{size:ce.XS,children:`• ${$t(e).toLowerCase()}`},e))}),e.codeAttributes&&Object.entries(e.codeAttributes).forEach(([e,o])=>{o&&n.push(t(re,{size:ce.XS,children:`• ${$t(e).toLowerCase()}`},e))}),e.headersCollection?.[xe.HeaderKeys]?.length&&e.headersCollection[xe.HeaderKeys].forEach(e=>{e&&n.push(t(re,{size:ce.XS,children:e},e))}),e.customInstrumentations&&(e.customInstrumentations[Ee.Java]?.forEach((e,a)=>{const i=new $e(e.className,e.methodName);if(i.Verify()){0===a&&n.push(t(re,{size:ce.XS,children:"Java Custom Probes:"},"java-custom-probes"));const e=i.toString();n.push(t(re,{size:ce.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},e))}}),e.customInstrumentations[Ee.Golang]?.forEach((e,a)=>{const i=new Te(e.packageName,e.functionName,e.receiverName,e.receiverMethodName);if(i.Verify()){0===a&&n.push(t(re,{size:ce.XS,children:"Golang Custom Probes:"},"golang-custom-probes"));const e=i.toString();n.push(t(re,{size:ce.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},e))}})),n})($,u);return e(o,{children:[t(ft,{isOpen:!0,header:{icon:At($.type),title:E.label,onClose:A,actions:[{id:"edit-rule-btn-edit",label:bt.EDIT,icon:di,active:y,onClick:N},{id:"edit-rule-btn-delete",label:bt.DELETE,icon:ai,color:u.v2.colors.red[500],active:S,onClick:F}]},footer:{actions:y?[{"data-id":"edit-rule-btn-cancel",label:bt.CANCEL,variant:ae.Secondary,onClick:O},{"data-id":"edit-rule-btn-save",label:bt.SAVE,variant:ae.Primary,onClick:R}]:[]},children:t(vt,{$padding:"4px 12px 12px",children:y&&m?t(ss,{}):t(V,{$gap:16,children:e(yt,{bgTint:"1000",children:[e(yt,{bgTint:"900",children:[t(Ct,{conditions:$.conditions||[]}),t(yt,{bgTint:"800",cellsPerRow:2,items:(_=$,z=E,[{id:"type",title:Re.TYPE,label:z.label},{id:"status",title:Re.STATUS,badge:{status:_.disabled?st.Unknown:ge.Success,label:_.disabled?Re.DISABLED:Re.ENABLED}},{id:"name",title:Re.NAME,label:_.ruleName||"-"},{id:"profile",title:Re.MANAGED_BY_PROFILE,label:_.profileName||"-"},{id:"notes",title:Re.NOTES,label:_.notes||"-"}])})]}),!!L.length&&t(yt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(yt,{bgTint:"800",children:L})}),!!E.supportedLanguages.length&&t(yt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(yt,{bgTint:"800",children:t(te,{$gap:12,$wrap:"wrap",children:E.supportedLanguages.map(e=>t(It,{label:Ae[e],leftIcon:Oe(e),flex:"0.5"},e))})})})]})})})}),t(pl,{target:"instrumentation rule",isOpen:S,onClose:()=>w(!1),onApprove:P}),t(hl,{isOpen:null!==x,onClose:()=>k(null),onApprove:D})]});var _,z},lr=({onClickRestartPod:e,namespace:o,podName:n,nodeName:a,startTime:i,agentInjected:l,agentInjectedStatus:s,podHealthStatus:c,children:d})=>{const{formatDurationAgo:u}=Ot(),p=r(()=>Dt({agentInjected:l,agentInjectedStatus:s}),[l,s]),h=r(()=>Rt(c?.status)===ge.Success,[c?.status]),m=r(()=>({title:n,icon:ki,withCopy:!0}),[n]),g=r(()=>[{key:`pod-${n}-agent-injected`,status:p?ge.Success:ge.Error,leftIcon:p?si:ri,label:p?Re.AGENT_INJECTED:Re.AGENT_NOT_INJECTED,tooltip:s?.message,textSize:ce.XXXS,invertColors:!0,useSecondaryTone:!0},{key:`pod-${n}-health`,status:h?ge.Success:ge.Error,leftIcon:Ti,label:h?Re.HEALTHY:Re.NOT_HEALTHY,tooltip:c?.message,textSize:ce.XXXS,invertColors:!0,useSecondaryTone:!0}],[n,p,s?.message,h,c?.message]),f=r(()=>e?[{id:`restart-pod-${n}`,icon:$i,label:bt.RESTART_POD,onClick:()=>e(o,n)}]:void 0,[e,o,n]),b=r(()=>[{id:"nodeName",title:Re.NODE,label:a,withCopy:!0},{id:"startTime",title:Re.START_TIME,label:i?u(i,{style:"short"}):Re.NOT_RUNNING,labelTooltip:i}],[a,i,u]);return t(yt,{bgTint:"900",richTitle:m,badges:g,dropDataActions:f,items:b,withCollapse:!0,children:d})},sr=g.div`
81
81
  display: flex;
82
82
  align-items: center;
83
83
  justify-content: space-between;
@@ -85,7 +85,7 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
85
85
  padding: ${({$noPadding:e})=>e?"0":"12px"};
86
86
  border-radius: 12px;
87
87
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
88
- `,Ks=({podsHealthStatus:a,pods:o,noPadding:n})=>{if(!a)return null;const i=Et(a.status),l=i===J.Success?be.PODS_HEALTHY:be.PODS_NOT_HEALTHY,s=a.message,r=o?.length||0,c=o?.reduce((e,t)=>e+(Tt(t)?1:0),0)||0,d=o?.reduce((e,t)=>e+(t.podHealthStatus.status===Nt.Success?1:0),0)||0;return e(Gs,{$noPadding:n,children:[t($t,{invertColors:!0,hideBackground:!0,status:i,title:l,subTitle:s}),e(R,{$gap:8,children:[t(Js,{label:be.PODS,count:r}),t(Js,{label:be.AGENT_INJECTED,count:c,total:r}),t(Js,{label:be.KUBERNETES_HEALTHY,count:d,total:r})]})]})},Ys=m.div`
88
+ `,rr=({podsHealthStatus:o,pods:n,noPadding:a})=>{if(!o)return null;const i=Rt(o.status),l=i===ge.Success?Re.PODS_HEALTHY:Re.PODS_NOT_HEALTHY,s=o.message,r=n?.length||0,c=n?.reduce((e,t)=>e+(Dt(t)?1:0),0)||0,d=n?.reduce((e,t)=>e+(t.podHealthStatus?.status===Ft.Success?1:0),0)||0;return e(sr,{$noPadding:a,children:[t(Pt,{invertColors:!0,hideBackground:!0,status:i,title:l,subTitle:s}),e(te,{$gap:8,children:[t(dr,{label:Re.PODS,count:r}),t(dr,{label:Re.AGENT_INJECTED,count:c,total:r}),t(dr,{label:Re.KUBERNETES_HEALTHY,count:d,total:r})]})]})},cr=g.div`
89
89
  display: flex;
90
90
  flex-direction: column;
91
91
  justify-content: center;
@@ -96,18 +96,18 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
96
96
  width: fit-content;
97
97
  border-radius: 8px;
98
98
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
99
- `,Js=({count:a,total:o,label:n})=>{const i=b(),l=void 0===o?void 0:a===o?i.v2.colors.green[500]:i.v2.colors.red[500];return e(Ys,{children:[e(R,{$gap:0,$alignItems:"flex-end",children:[t(X,{size:V.L,color:l,weight:500,children:a}),void 0!==o&&t(X,{size:V.S,color:l,weight:500,children:`/${o}`})]}),t(X,{size:V.XXXS,children:n})]})},qs=({podName:e,namespace:a})=>{const o=r(()=>({title:be.DEBUG_COMMANDS,titleSize:V.XS}),[]),n=r(()=>[{label:be.GET_POD,value:`kubectl get pod ${e} -n ${a}`},{label:be.GET_POD_YAML,value:`kubectl get pod ${e} -n ${a} -o yaml`},{label:be.GET_POD_JSON,value:`kubectl get pod ${e} -n ${a} -o json`},{label:be.GET_POD_DESCRIBE,value:`kubectl describe pod ${e} -n ${a}`},{label:be.GET_POD_LOGS,value:`kubectl logs ${e} -n ${a}`}],[e,a]);return t(ut,{bgTint:"800",richTitle:o,withCollapse:!0,children:n.map(({label:e,value:a})=>t(It,{bgTint:"700",label:e,value:a},e))})},Zs=12,Qs=24,er=12,tr=24,ar=40,or=e=>{const t=e.identifyingAttributes?.find(({name:e})=>e===At.PID)??e.identifyingAttributes?.find(({name:e})=>e===At.VPID);return t?.value??null};var nr;!function(e){e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"}(nr||(nr={}));const ir=({healthy:a,healthStatus:n,identifyingAttributes:i,instrumentations:s})=>{const c=b(),[d,p]=l(nr.IdentifyingAttributes),{tabOptions:u,firstTabValue:h,bothTabsDisabled:g}=r(()=>{const e=[{value:nr.IdentifyingAttributes,label:be.IDENTIFYING_ATTRIBUTES,disabled:!i?.length,selectedBgColor:c.v2.colors.purple[500]},{value:nr.InstrumentationLibraries,label:be.INSTRUMENTATION_LIBRARIES,disabled:!s?.length,selectedBgColor:c.v2.colors.purple[500]}];return{tabOptions:e,firstTabValue:e.find(e=>!e.disabled)?.value||e[0].value,bothTabsDisabled:e.every(e=>e.disabled)}},[i,s]);o(()=>{h&&p(h)},[h]);const m=r(()=>{switch(d){case nr.IdentifyingAttributes:return t(C,{children:i?.map(e=>t(sr,{label:e.name,value:e.value},e.name))});case nr.InstrumentationLibraries:return t(C,{children:s?.map(e=>t(sr,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},e.name))});default:return null}},[d,i,s]),f=r(()=>or({identifyingAttributes:i}),[i]);return e(ut,{bgTint:"800",richTitle:{title:f?be.PID(f):be.PROCESS_FALLBACK_NAME},badges:[{key:"k8s-healthy",status:a?J.Success:J.Error,leftIcon:ji,label:a?be.HEALTHY:be.NOT_HEALTHY,tooltip:n.message,textSize:V.XXXS,invertColors:!0,useSecondaryTone:!0}],withCollapse:!g,children:[!g&&t(H,{options:u,selected:d,setSelected:p}),!g&&m]})},lr=m.div`
99
+ `,dr=({count:o,total:n,label:a})=>{const i=f(),l=void 0===n?void 0:o===n?i.v2.colors.green[500]:i.v2.colors.red[500];return e(cr,{children:[e(te,{$gap:0,$alignItems:"flex-end",children:[t(re,{size:ce.L,color:l,weight:500,children:o}),void 0!==n&&t(re,{size:ce.S,color:l,weight:500,children:`/${n}`})]}),t(re,{size:ce.XXXS,children:a})]})},ur=({podName:e,namespace:o})=>{const n=r(()=>({title:Re.DEBUG_COMMANDS,titleSize:ce.XS}),[]),a=r(()=>[{label:Re.GET_POD,value:`kubectl get pod ${e} -n ${o}`},{label:Re.GET_POD_YAML,value:`kubectl get pod ${e} -n ${o} -o yaml`},{label:Re.GET_POD_JSON,value:`kubectl get pod ${e} -n ${o} -o json`},{label:Re.GET_POD_DESCRIBE,value:`kubectl describe pod ${e} -n ${o}`},{label:Re.GET_POD_LOGS,value:`kubectl logs ${e} -n ${o}`}],[e,o]);return t(yt,{bgTint:"800",richTitle:n,withCollapse:!0,children:a.map(({label:e,value:o})=>t(Lt,{bgTint:"700",label:e,value:o},e))})},pr=12,hr=24,mr=12,gr=24,fr=40,br=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===_t.PID)??e.identifyingAttributes?.find(({name:e})=>e===_t.VPID);return t?.value??null},vr=(e,t)=>e===ge.Success?Re.HEALTHY:e===ge.Error?Re.NOT_HEALTHY:$t(t);var yr;!function(e){e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"}(yr||(yr={}));const Cr=({overrideProcessNum:o,healthy:a,healthStatus:i,identifyingAttributes:s,instrumentations:c})=>{const d=f(),[u,p]=l(yr.IdentifyingAttributes),{tabOptions:h,firstTabValue:m,bothTabsDisabled:g}=r(()=>{const e=[{value:yr.IdentifyingAttributes,label:Re.IDENTIFYING_ATTRIBUTES,disabled:!s?.length,selectedBgColor:d.v2.colors.purple[500]},{value:yr.InstrumentationLibraries,label:Re.INSTRUMENTATION_LIBRARIES,disabled:!c?.length,selectedBgColor:d.v2.colors.purple[500]}];return{tabOptions:e,firstTabValue:e.find(e=>!e.disabled)?.value||e[0].value,bothTabsDisabled:e.every(e=>e.disabled)}},[s,c]);n(()=>{m&&p(m)},[m]);const b=r(()=>{switch(u){case yr.IdentifyingAttributes:return t(V,{children:s?.map(e=>t(wr,{label:e.name,value:e.value},e.name))});case yr.InstrumentationLibraries:return t(V,{children:c?.map(e=>t(wr,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},e.name))});default:return null}},[u,s,c]),v=r(()=>br({overrideProcessNum:o,identifyingAttributes:s}),[o,s]);return e(yt,{bgTint:"800",richTitle:{title:v?`${Re.PROCESS} ${Re.PID(v)}`:Re.PROCESS_FALLBACK_NAME},badges:[{key:"odigos-healthy",status:a?ge.Success:ge.Error,leftIcon:Ei,label:a?Re.HEALTHY:Re.NOT_HEALTHY,tooltip:i?.message,textSize:ce.XXXS,invertColors:!0,useSecondaryTone:!0}],withCollapse:!g,children:[!g&&t(ue,{options:h,selected:u,setSelected:p}),!g&&b]})},Sr=g.div`
100
100
  display: flex;
101
101
  justify-content: space-between;
102
102
  min-height: 24px;
103
- `,sr=({label:a,value:o,isStandardLibrary:n,healthy:i,message:l})=>{const s="boolean"==typeof i;return e(lr,{children:[t(X,{size:V.XXXS,color:te.Secondary,children:a}),o&&t(X,{size:V.XXS,color:te.Primary,children:o}),(s||n)&&e(R,{children:[n&&t(pe,{status:J.Info,label:be.STANDARD,textSize:V.XXXS,invertColors:!0}),s&&t(pe,{status:i?J.Success:J.Error,label:i?be.HEALTHY:be.NOT_HEALTHY,textSize:V.XXXS,invertColors:!0,tooltip:l??void 0})]})]})},rr=({podContainers:e,sourceContainers:a})=>{const o=e??[],n=r(()=>({title:be.CONTAINERS,titleSize:V.XS,badge:{label:o.length}}),[o.length]),i=r(()=>{const e=new Map;return a?.forEach(t=>e.set(t.containerName,t)),e},[a]);return t(ut,{bgTint:"800",richTitle:n,withCollapse:!0,collapseIsDefaultOpen:!0,children:o.map(e=>t(dr,{...e,language:Ot(i.get(e.containerName))},`pod-container-${e.containerName}`))})},cr=m.div`
103
+ `,wr=({label:o,value:n,isStandardLibrary:a,healthy:i,message:l})=>{const s="boolean"==typeof i;return e(Sr,{children:[t(re,{size:ce.XXXS,color:Ce.Secondary,children:o}),n&&t(re,{size:ce.XXS,color:Ce.Primary,children:n}),(s||a)&&e(te,{children:[a&&t(Ie,{status:ge.Info,label:Re.STANDARD,textSize:ce.XXXS,invertColors:!0}),s&&t(Ie,{status:i?ge.Success:ge.Error,label:i?Re.HEALTHY:Re.NOT_HEALTHY,textSize:ce.XXXS,invertColors:!0,tooltip:l??void 0})]})]})},xr=({podContainers:e,sourceContainers:o})=>{const n=e??[],a=r(()=>({title:Re.CONTAINERS,titleSize:ce.XS,badge:{label:n.length}}),[n.length]),i=r(()=>{const e=new Map;return o?.forEach(t=>e.set(t.containerName,t)),e},[o]);return t(yt,{bgTint:"800",richTitle:a,withCollapse:!0,collapseIsDefaultOpen:!0,children:n.map(e=>t(Tr,{...e,language:zt(i.get(e.containerName))},`pod-container-${e.containerName}`))})},kr=g.div`
104
104
  display: flex;
105
105
  flex-direction: column;
106
106
  gap: 12px;
107
107
  padding: 8px 12px;
108
108
  border-radius: 8px;
109
109
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
110
- `,dr=({language:a,containerName:o,otelDistroName:n,runningStartedTime:i,started:l,ready:s,restartCount:c,isCrashLoop:d,waitingReasonEnum:p,waitingMessage:u,healthStatus:h,processes:g})=>{const{formatTimeAgo:m}=xt(),b=r(()=>a?he(a):Gi,[a]),f=r(()=>Et(h.status),[h.status]),v=f===J.Success,y=r(()=>({title:o,icon:b,iconWithWrapper:!0}),[o,b]),C=r(()=>[{key:"k8s-healthy",status:f,leftIcon:ji,label:v?be.HEALTHY:be.NOT_HEALTHY,tooltip:h.message,textSize:V.XXXS,invertColors:!0,useSecondaryTone:!0},{key:"instrumented",status:n?J.Success:Dt.Disabled,leftIcon:n?Ni:$i,label:n?be.INSTRUMENTED_WITH_DISTRO(n):be.UNINSTRUMENTED,tooltip:be.INSTRUMENTED,textSize:V.XXXS}],[f,v,h.message,n]),S=r(()=>[{id:"startTime",title:be.START_TIME,label:i?m(i):"",labelTooltip:i||""},{id:"blank",spacer:!0},{id:"started",badge:{status:l?J.Success:Dt.Disabled,leftIcon:l?Ni:$i,label:l?be.STARTED:be.NOT_STARTED,textSize:V.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:s?J.Success:Dt.Disabled,leftIcon:s?Ni:$i,label:s?be.READY:be.NOT_READY,textSize:V.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"isCrashLoop",badge:{status:d?J.Error:J.Success,leftIcon:d?$i:Ni,label:d?be.CRASHLOOP:be.NO_CRASHLOOP,textSize:V.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"restartCount",title:be.RESTARTS,badge:{label:c||0}}],[i,m,l,s,d,c]),w=r(()=>u?yt(p):"",[u,p]);return e(ut,{bgTint:"750",richTitle:y,badges:C,items:S,withCollapse:!0,children:[u&&t(cr,{children:e(R,{$gap:10,$alignItems:"center",children:[t(wt,{variant:Rt.Pink,leftIcon:ji,label:w}),t(X,{size:V.XXXS,color:te.Error,children:u})]})}),(g??[]).map((e,a)=>t(ir,{...e},`pod-container-${o}-process-${a}`))]})},pr=({source:o,onClickRestartPod:n})=>{const i=o?.pods??[],l=i.length>0,s=r(()=>({title:be.PODS,badge:{label:i.length}}),[i.length]);return t(C,{$gap:12,children:l?e(a,{children:[t(Ks,{podsHealthStatus:o.podsHealthStatus,pods:i}),t(ut,{bgTint:"1000",richTitle:s,children:i.map(a=>e(Ws,{...a,namespace:o.namespace,onClickRestartPod:n,children:[t(qs,{podName:a.podName,namespace:o.namespace}),t(rr,{podContainers:a.containers,sourceContainers:o.containers})]},`pod-${a.podName}`))})]}):t(Le,{$height:"70vh",children:t(Ft,{subTitle:be.NO_RUNNING_PODS})})})},ur=({source:a,fetchPeerSources:n})=>{const i=r(()=>a.otelServiceName||a.name,[a]),[s,d]=l(!1),[p,u]=l(null),h=c(()=>{d(!0),n(i).then(({data:e})=>u(e?.peerSources??null)).finally(()=>d(!1))},[i]);return o(()=>{h()},[h]),!p||s?t(Le,s?{$height:"70vh",children:t(Xe,{withSpinner:!0})}:{$height:"70vh",children:t(Ft,{subTitle:be.COULD_NOT_FETCH_PEER_SOURCES})}):e(R,{$gap:16,$alignItems:"flex-start",children:[t(hr,{icon:Ki,title:be.INBOUND,subTitle:be.INBOUND_DESCRIPTION(i),onRefresh:h,items:p?.inbound??[]}),t(hr,{icon:Ki,title:be.OUTBOUND,subTitle:be.OUTBOUND_DESCRIPTION(i),onRefresh:h,items:p?.outbound??[]})]})},hr=({icon:a,title:o,subTitle:n,onRefresh:i,items:s})=>{const[c,d]=l(""),p=r(()=>s.filter(e=>e.serviceName.toLowerCase().includes(c.toLowerCase())),[s,c]);return e(ut,{bgTint:"1000",richTitle:{icon:a,title:o,titleSize:V.XS,subTitle:n,subTitleSize:V.XXXS,badge:{label:s.length}},actions:[{id:"refresh",type:Pt.Button,buttonProps:{variant:L.Secondary,size:P.S,leftIcon:Wi,onClick:i}}],children:[t(Lt,{value:c,onChange:d,width:"100%"}),t(_t,{height:"calc(100vh - 284px)",gap:4,elements:p.length||c?!p.length&&c?[t(z,{title:be.NO_RESULTS,subTitle:be.NO_RESULTS_FOR_FILTER(c)},"no-results")]:p.map(e=>t(mr,{...e},`${o}-${e.serviceName}`)):[t(z,{},"no-data")]})]})},gr=m.div`
110
+ `,Tr=({language:o,containerName:n,otelDistroName:a,runningStartedTime:i,started:l,ready:s,restartCount:c,isCrashLoop:d,waitingReasonEnum:u,waitingMessage:p,healthStatus:h,processes:m})=>{const{formatDurationAgo:g}=Ot(),f=r(()=>({title:n,icon:o?Oe(o):Ni,iconWithWrapper:!0}),[n,o]),b=r(()=>{const e=Rt(h?.status);return[{key:"k8s-healthy",status:e,leftIcon:Ti,label:vr(e,h?.reasonEnum),tooltip:h?.message,textSize:ce.XXXS,invertColors:!0,useSecondaryTone:!0},{key:"instrumented",status:a?ge.Success:Mt.Disabled,leftIcon:a?si:ri,label:a?Re.INSTRUMENTED_WITH_DISTRO(a):Re.UNINSTRUMENTED,tooltip:Re.INSTRUMENTED,textSize:ce.XXXS}]},[h,a]),v=r(()=>[{id:"startTime",title:Re.START_TIME,label:i?g(i,{style:"short"}):Re.NOT_RUNNING,labelTooltip:i||""},{id:"blank",spacer:!0},{id:"started",badge:{status:l?ge.Success:Mt.Disabled,leftIcon:l?si:ri,label:l?Re.STARTED:Re.NOT_STARTED,textSize:ce.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:s?ge.Success:Mt.Disabled,leftIcon:s?si:ri,label:s?Re.READY:Re.NOT_READY,textSize:ce.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"isCrashLoop",badge:{status:d?ge.Error:ge.Success,leftIcon:d?ri:si,label:d?Re.CRASHLOOP:Re.NO_CRASHLOOP,textSize:ce.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"restartCount",title:Re.RESTARTS,badge:{status:c?ge.Error:void 0,label:c||0,textSize:ce.XXXS}}],[i,g,l,s,d,c]),y=r(()=>p?$t(u):"",[p,u]);return e(yt,{bgTint:"750",richTitle:f,badges:b,items:v,withCollapse:!0,children:[p&&t(kr,{children:e(te,{$gap:10,$alignItems:"center",children:[t(It,{variant:Bt.Pink,leftIcon:Ti,label:y}),t(re,{size:ce.XXXS,color:Ce.Error,children:p})]})}),(m??[]).map((e,o)=>{const a=o+1;return t(Cr,{...e,overrideProcessNum:a},`pod-container-${n}-process-${a}`)})]})},$r=({source:n,onClickRestartPod:a})=>{const i=n?.pods??[],l=i.length>0,s=r(()=>({title:Re.PODS,badge:{label:i.length}}),[i.length]);return t(V,{$gap:12,children:l?e(o,{children:[t(rr,{podsHealthStatus:n.podsHealthStatus,pods:i}),t(yt,{bgTint:"1000",richTitle:s,children:i.map(o=>e(lr,{...o,namespace:n.id.namespace,onClickRestartPod:a,children:[t(ur,{podName:o.podName,namespace:n.id.namespace}),t(xr,{podContainers:o.containers,sourceContainers:n.containers})]},`pod-${o.podName}`))})]}):t(Ke,{$height:"70vh",children:t(se,{subTitle:Re.NO_RUNNING_PODS})})})},Er=({source:o,fetchPeerSources:a})=>{const i=r(()=>o.serviceName||o.id.name,[o]),[s,d]=l(!1),[u,p]=l(null),h=c(()=>{d(!0),a(i).then(({data:e})=>p(e?.peerSources??null)).finally(()=>d(!1))},[i]);return n(()=>{h()},[h]),!u||s?t(Ke,s?{$height:"70vh",children:t(Qe,{withSpinner:!0})}:{$height:"70vh",children:t(se,{subTitle:Re.COULD_NOT_FETCH_PEER_SOURCES})}):e(te,{$gap:16,$alignItems:"flex-start",children:[t(Nr,{icon:Ei,title:Re.INBOUND,subTitle:Re.INBOUND_DESCRIPTION(i),onRefresh:h,items:u?.inbound??[]}),t(Nr,{icon:Ei,title:Re.OUTBOUND,subTitle:Re.OUTBOUND_DESCRIPTION(i),onRefresh:h,items:u?.outbound??[]})]})},Nr=({icon:o,title:n,subTitle:a,onRefresh:i,items:s})=>{const[c,d]=l(""),u=r(()=>s.filter(e=>e.serviceName.toLowerCase().includes(c.toLowerCase())),[s,c]);return e(yt,{bgTint:"1000",richTitle:{icon:o,title:n,titleSize:ce.XS,subTitle:a,subTitleSize:ce.XXXS,badge:{label:s.length}},actions:[{id:"refresh",type:Xt.Button,buttonProps:{variant:ae.Secondary,size:ne.S,leftIcon:$i,onClick:i}}],children:[t(Vt,{value:c,onChange:d,width:"100%"}),t(Ut,{height:"calc(100vh - 284px)",gap:4,elements:u.length||c?!u.length&&c?[t(se,{title:Re.NO_RESULTS,subTitle:Re.NO_RESULTS_FOR_FILTER(c)},"no-results")]:u.map(e=>t(Ar,{...e},`${n}-${e.serviceName}`)):[t(se,{},"no-data")]})]})},Ir=g.div`
111
111
  display: flex;
112
112
  align-items: center;
113
113
  justify-content: space-between;
@@ -115,13 +115,13 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
115
115
  padding: 8px;
116
116
  border-radius: 8px;
117
117
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
118
- ${({$withClick:e})=>e&&f`
118
+ ${({$withClick:e})=>e&&b`
119
119
  cursor: pointer;
120
120
  &:hover {
121
121
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
122
122
  }
123
123
  `}
124
- `,mr=({serviceName:a,isVirtual:o,nodeAttributes:n})=>{const i=Bt(e=>e.drawerEntityId),l=We(e=>e.sources),s=r(()=>l.find(e=>e.name===a||e.otelServiceName===a),[l,a]),c=r(()=>s&&JSON.stringify(Mt(s))!==JSON.stringify(Mt(i)),[s,i]),d=r(()=>{if(o){const e=Object.fromEntries((n??[]).map(({key:e,value:t})=>[e,t]));return[zt({serviceName:a,attributes:e})]}const e=s?Xt(s):void 0;return e?.length?e:[Gi]},[o,n,a,s]),p=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=Bt.getState();e(nt.Source),t({namespace:s?.namespace??"",name:s?.name??"",kind:s?.kind??""})}:void 0;return e(gr,{onClick:p,$withClick:!!p,children:[e(R,{$gap:8,children:[t(Vt,{icons:d}),t(X,{size:V.XXS,children:a})]}),o&&t(pe,{status:J.Info,label:be.VIRTUAL,textSize:V.XXXS,invertColors:!0,tooltip:be.VIRTUAL_TOOLTIP})]})},br=({title:a,children:o})=>e(C,{$gap:8,children:[t(X,{size:V.XXXS,color:te.Secondary,children:a}),o]}),fr=({source:a})=>{const o=r(()=>{const[e,t]=Ut(a.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[a]);return t(ut,{children:e(R,{$gap:24,$alignItems:"flex-start",$justifyContent:"space-between",$wrap:"wrap",children:[t(br,{title:be.THROUGHPUT_LAST_10_SECONDS,children:e(R,{$alignItems:"flex-end",$gap:4,children:[t(X,{size:V.L,children:o.value}),t(X,{size:V.XS,variant:Qe.Span,children:o.units})]})}),t(br,{title:be.NAMESPACE,children:t(wt,{variant:Rt.Blue,label:a.namespace})}),t(br,{title:be.KIND,children:t(wt,{variant:Rt.Blue,label:a.kind})}),t(br,{title:be.NAME,children:t(wt,{variant:Rt.Blue,label:a.name})}),t(br,{title:"",children:""})]})})},vr=m.div`
124
+ `,Ar=({serviceName:o,isVirtual:n,nodeAttributes:a})=>{const i=Ht(e=>e.drawerEntityId),l=at(e=>e.sources),s=r(()=>l.find(e=>e.id.name===o||e.serviceName===o),[l,o]),c=r(()=>s&&JSON.stringify(jt(s))!==JSON.stringify(jt(i)),[s,i]),d=r(()=>{if(n){const e=Object.fromEntries((a??[]).map(({key:e,value:t})=>[e,t]));return[Gt({serviceName:o,attributes:e})]}const e=s?Wt(s):void 0;return e?.length?e:[Ni]},[n,a,o,s]),u=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=Ht.getState();e(lt.Source),t({namespace:s?.id.namespace??"",name:s?.id.name??"",kind:s?.id.kind??""})}:void 0;return e(Ir,{onClick:u,$withClick:!!u,children:[e(te,{$gap:8,children:[t(Kt,{icons:d}),t(re,{size:ce.XXS,children:o})]}),n&&t(Ie,{status:ge.Info,label:Re.VIRTUAL,textSize:ce.XXXS,invertColors:!0,tooltip:Re.VIRTUAL_TOOLTIP})]})},Or=({title:o,children:n})=>e(V,{$gap:8,children:[t(re,{size:ce.XXXS,color:Ce.Secondary,children:o}),n]}),Dr=({source:o})=>{const n=r(()=>{const[e,t]=Yt(o.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[o]);return t(Or,{title:Re.THROUGHPUT_LAST_10_SECONDS,children:e(te,{$alignItems:"flex-end",$gap:4,children:[t(re,{size:ce.L,children:n.value}),t(re,{size:ce.XS,variant:dt.Span,children:n.units})]})})},Rr=({source:o})=>{const{CopyButton:n}=Jt();return t(Or,{title:Re.NAMESPACE,children:e(te,{children:[t(It,{variant:Bt.Blue,label:o.id.namespace}),t(n,{value:o.id.namespace,size:Ze.XS})]})})},Fr=({source:e})=>t(Or,{title:Re.KIND,children:t(te,{children:t(It,{variant:Bt.Blue,label:e.id.kind})})}),Pr=({source:o})=>{const{CopyButton:n}=Jt();return t(Or,{title:Re.NAME,children:e(te,{children:[t(It,{variant:Bt.Blue,label:o.id.name}),t(n,{value:o.id.name,size:Ze.XS})]})})},Lr=({source:o})=>t(yt,{children:e(te,{$gap:64,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[t(Dr,{source:o}),t(Rr,{source:o}),t(Fr,{source:o}),t(Pr,{source:o})]})}),_r=g.div`
125
125
  display: flex;
126
126
  align-items: center;
127
127
  gap: 6px;
@@ -130,33 +130,33 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
130
130
  cursor: ${({$clickable:e})=>e?"pointer":"default"};
131
131
  transition: background-color 0.15s ease;
132
132
  ${({$clickable:e,theme:t})=>e&&`\n &:hover {\n background-color: ${t.v2.colors.silver[700]};\n }\n `}
133
- `,yr=m.div`
133
+ `,zr=g.div`
134
134
  display: flex;
135
135
  align-items: center;
136
136
  justify-content: center;
137
137
  flex-shrink: 0;
138
138
  width: 18px;
139
139
  height: 18px;
140
- `,Cr=m.div`
140
+ `,Mr=g.div`
141
141
  flex: 1;
142
142
  min-width: 0;
143
143
  display: flex;
144
- `,Sr=({chevron:a,onClick:o,label:n,name:i,badges:l,action:s,paddingLeft:r})=>{const c=b();return e(vr,{$clickable:!!o,$paddingLeft:r,onClick:o,children:[a&&t(yr,{children:t(a,{size:18,fill:c.v2.colors.silver[200]})}),t(X,{size:V.XXXS,color:te.Secondary,nowrap:!0,children:n}),t(Cr,{children:t(X,{size:V.XS,nowrap:!0,children:i})}),s&&t(oe,{text:s.tooltip,children:t(Me,{icon:s.icon,size:ze.XS,onClick:s.onClick})}),l.map(({key:e,...a})=>t(wr,{...a},e))]})},wr=({status:e,icon:a,label:o,tooltip:n})=>{const i=a||(e===J.Success?Ni:$i);return t(pe,{status:e,leftIcon:i,label:o,tooltip:n,textSize:V.XXXS,invertColors:!0,useSecondaryTone:!0})},kr=({pod:e,container:a,process:o,onJumpToProcess:n})=>{const i=r(()=>or(o),[o]),l=Et(o.healthStatus.status);return t(Sr,{label:be.PROCESS,name:i?be.PID(i):be.PROCESS_FALLBACK_NAME,paddingLeft:ar,action:n?{icon:Yi,onClick:()=>n(e,a,o),tooltip:be.OPEN_IN_POD_TAB}:void 0,badges:[{key:"process-health",status:l,icon:ji,label:l===J.Success?be.HEALTHY:be.NOT_HEALTHY,tooltip:o.healthStatus.message}]})},xr=m.div`
144
+ `,Br=({chevron:o,onClick:n,label:a,name:i,badges:l,action:s,paddingLeft:r})=>{const c=f();return e(_r,{$clickable:!!n,$paddingLeft:r,onClick:n,children:[o&&t(zr,{children:t(o,{size:18,fill:c.v2.colors.silver[200]})}),t(re,{size:ce.XXXS,color:Ce.Secondary,nowrap:!0,children:a}),t(Mr,{children:t(re,{size:ce.XS,nowrap:!0,children:i})}),s&&t(we,{text:s.tooltip,children:t(qe,{icon:s.icon,size:Ze.XS,onClick:s.onClick})}),l.map(({key:e,...o})=>t(Xr,{...o},e))]})},Xr=({status:e,icon:o,label:n,tooltip:a})=>{const i=o||(e===ge.Success?si:ri);return t(Ie,{status:e,leftIcon:i,label:n,tooltip:a,textSize:ce.XXXS,invertColors:!0,useSecondaryTone:!0})},Vr=({overrideProcessNum:e,pod:o,container:n,process:a,onJumpToProcess:i})=>{const l=r(()=>br({overrideProcessNum:e,identifyingAttributes:a.identifyingAttributes}),[e,a.identifyingAttributes]),s=Rt(a.healthStatus?.status);return t(Br,{label:Re.PROCESS,name:l?Re.PID(l):Re.PROCESS_FALLBACK_NAME,paddingLeft:fr,action:i?{icon:Ii,onClick:()=>i(o,n,a),tooltip:Re.OPEN_IN_POD_TAB}:void 0,badges:[{key:"process-health",status:s,icon:Ei,label:vr(s,a.healthStatus?.reasonEnum),tooltip:a.healthStatus?.message}]})},Ur=g.div`
145
145
  display: flex;
146
146
  flex-direction: column;
147
147
  align-self: stretch;
148
148
  border-radius: 8px;
149
149
  background-color: ${({theme:e,$isExpanded:t})=>t?e.v2.colors.silver[750]:"transparent"};
150
- `,Tr=({pod:a,container:o,onJumpToProcess:n})=>{const[i,s]=l(!1),r=Et(o.healthStatus.status),c=o.processes??[],d=c.length>0;return e(xr,{$isExpanded:i,children:[t(Sr,{chevron:d?i?_i:Ri:void 0,onClick:d?()=>s(e=>!e):void 0,label:be.CONTAINER,name:o.containerName,paddingLeft:tr,badges:[{key:"container-health",status:r,icon:ji,label:r===J.Success?be.HEALTHY:be.NOT_HEALTHY,tooltip:o.healthStatus.message}]}),d&&i&&t(C,{$gap:0,$padding:`0 ${Qs}px`,children:c.map((e,i)=>t(kr,{pod:a,container:o,process:e,onJumpToProcess:n},`pod-${a.podName}-container-${o.containerName}-process-${i}`))})]})},Er=m.div`
150
+ `,Hr=({pod:o,container:n,onJumpToProcess:a})=>{const[i,s]=l(!1),r=Rt(n.healthStatus?.status),c=n.processes??[],d=c.length>0;return e(Ur,{$isExpanded:i,children:[t(Br,{chevron:d?i?bi:hi:void 0,onClick:d?()=>s(e=>!e):void 0,label:Re.CONTAINER,name:n.containerName,paddingLeft:gr+(d?0:24),badges:[{key:"container-health",status:r,icon:Ti,label:vr(r,n.healthStatus?.reasonEnum),tooltip:n.healthStatus?.message}]}),d&&i&&t(V,{$gap:0,$padding:`0 ${hr}px`,children:c.map((e,i)=>{const l=i+1;return t(Vr,{overrideProcessNum:l,pod:o,container:n,process:e,onJumpToProcess:a},`pod-${o.podName}-container-${n.containerName}-process-${l}`)})})]})},jr=g.div`
151
151
  display: flex;
152
152
  flex-direction: column;
153
153
  align-self: stretch;
154
154
  border-radius: 8px;
155
155
  background-color: ${({theme:e,$isExpanded:t})=>t?e.v2.colors.silver[800]:"transparent"};
156
156
  padding-bottom: ${({$isExpanded:e})=>e?"12px":"0"};
157
- `,Nr=({pod:a,onJumpToProcess:o})=>{const[n,i]=l(!1),s=Et(a.podHealthStatus.status),r=Tt(a),c=r?J.Success:J.Error,d=a.containers??[],p=d.length>0;return e(Er,{$isExpanded:n,children:[t(Sr,{chevron:p?n?_i:Ri:void 0,onClick:p?()=>i(e=>!e):void 0,label:be.POD,name:a.podName,paddingLeft:er,badges:[{key:"agent",status:c,label:r?be.AGENT_INJECTED:be.AGENT_NOT_INJECTED,tooltip:a.agentInjectedStatus.message},{key:"pod-health",status:s,icon:ji,label:s===J.Success?be.HEALTHY:be.NOT_HEALTHY,tooltip:a.podHealthStatus.message}]}),n&&p&&t(C,{$gap:0,$padding:`0 ${Zs}px`,children:d.map(e=>t(Tr,{pod:a,container:e,onJumpToProcess:o},`pod-${a.podName}-container-${e.containerName}`))})]})},$r=({pods:e,onJumpToProcess:a})=>e?.length?t(C,{$gap:4,children:e.map(e=>t(Nr,{pod:e,onJumpToProcess:a},`pod-${e.podName}`))}):null,Ir=({source:a})=>t(ut,{bgTint:"1000",richTitle:{title:be.PODS,badge:{label:a.pods?.length||0}},withCollapse:!0,collapseIsDefaultOpen:!0,children:e(ut,{bgTint:"900",children:[t(Ks,{podsHealthStatus:a.podsHealthStatus,pods:a.pods,noPadding:!0}),t($r,{pods:a.pods})]})}),Ar=({source:e})=>{const a=r(()=>e.workloadOdigosHealthStatus?{status:Ht(e.workloadOdigosHealthStatus.status),title:yt(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return a?t($t,{...a,width:"calc(100% - 32px)"}):null},Or=({source:a,onClickRollout:o,onClickRollback:n})=>{const i=r(()=>{const e=a.conditions?.find(e=>e.name===jt.WorkloadRollout),t=a.conditions?.find(e=>e.name===jt.AgentInjected);return e?.reason===Wt.NotRequired?{status:J.Info,title:be.ROLLOUT_NOT_REQUIRED,subTitle:be.ROLLOUT_NOT_REQUIRED_MESSAGE}:e?.status===J.Error?{status:J.Error,title:be.ROLLOUT_FAILED,subTitle:e.message||yt(e.reason)||yt(e.type)}:e?.reason===Wt.PreviousRolloutOngoing?{status:Dt.Loading,title:yt(e.reason)||be.ROLLOUT_PREVIOUS_ONGOING,subTitle:e.message||be.ROLLOUT_PREVIOUS_ONGOING_MESSAGE}:e?.reason===Wt.Disabled&&t?.reason===Gt.SomePodsAgentNotInjectedRolloutNeeded?{status:J.Warning,title:be.ROLLOUT_AUTO_DISABLED,subTitle:be.ROLLOUT_AUTO_DISABLED_MESSAGE,action:{icon:Wi,tooltip:be.ROLLOUT_RESTART,onClick:o}}:{status:J.Success,title:be.ROLLOUT_FINISHED,subTitle:be.ROLLOUT_FINISHED_MESSAGE}},[a]),l=r(()=>a.rollbackOccurred?{status:J.Warning,title:be.ROLLBACK_OCCURRED,subTitle:be.ROLLBACK_OCCURRED_MESSAGE,action:{icon:Wi,tooltip:be.ROLLBACK_RECOVER,onClick:n}}:{status:J.Success,title:be.ROLLBACK_SUCCESS},[a]);return t(ut,{bgTint:"1000",children:e(R,{$gap:12,$alignItems:"stretch",children:[t(ut,{bgTint:"900",children:t($t,{invertColors:!0,...i})}),t(ut,{bgTint:"900",children:t($t,{invertColors:!0,...l})})]})})},Dr=g(null),Rr=m.div`
157
+ `,Gr=({pod:o,onJumpToProcess:n})=>{const[a,i]=l(!1),s=Rt(o.podHealthStatus?.status),r=Dt(o),c=r?ge.Success:ge.Error,d=o.containers??[],u=d.length>0;return e(jr,{$isExpanded:a,children:[t(Br,{chevron:u?a?bi:hi:void 0,onClick:u?()=>i(e=>!e):void 0,label:Re.POD,name:o.podName,paddingLeft:mr+(u?0:24),badges:[{key:"agent",status:c,label:r?Re.AGENT_INJECTED:Re.AGENT_NOT_INJECTED,tooltip:o.agentInjectedStatus?.message},{key:"pod-health",status:s,icon:Ti,label:vr(s,o.podHealthStatus?.reasonEnum),tooltip:o.podHealthStatus?.message}]}),a&&u&&t(V,{$gap:0,$padding:`0 ${pr}px`,children:d.map(e=>t(Hr,{pod:o,container:e,onJumpToProcess:n},`pod-${o.podName}-container-${e.containerName}`))})]})},Wr=({pods:e,onJumpToProcess:o})=>e?.length?t(V,{$gap:4,children:e.map(e=>t(Gr,{pod:e,onJumpToProcess:o},`pod-${e.podName}`))}):null,Kr=({source:o})=>t(yt,{bgTint:"1000",richTitle:{title:Re.PODS,badge:{label:o.pods?.length||0}},withCollapse:!0,collapseIsDefaultOpen:!0,children:e(yt,{bgTint:"900",children:[t(rr,{podsHealthStatus:o.podsHealthStatus,pods:o.pods,noPadding:!0}),t(Wr,{pods:o.pods})]})}),Yr=({source:e})=>{const o=r(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?qt(e.workloadOdigosHealthStatus.status):st.Unknown,title:$t(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return o?t(Pt,{...o,width:"calc(100% - 32px)"}):null},Jr="calc(50% - 6px)",qr=({rollbackEnabled:o,source:n,onClickRollout:a,onClickRollback:i})=>{const l=r(()=>{const e=n.conditions?.rollout,t=n.conditions?.agentInjected,o=Rt(e?.status);return e?.reasonEnum===Zt.NotRequired?{status:ge.Info,title:Re.ROLLOUT_NOT_REQUIRED,subTitle:e?.message||Re.ROLLOUT_NOT_REQUIRED_MESSAGE}:o===ge.Error?{status:ge.Error,title:Re.ROLLOUT_FAILED,subTitle:e?.message||$t(e?.reasonEnum)||$t(e?.name)}:e?.reasonEnum===Zt.PreviousRolloutOngoing?{status:Mt.Loading,title:$t(e?.reasonEnum)||Re.ROLLOUT_PREVIOUS_ONGOING,subTitle:e.message||Re.ROLLOUT_PREVIOUS_ONGOING_MESSAGE}:e?.reasonEnum===Zt.Disabled&&t?.reasonEnum===Qt.SomePodsAgentNotInjectedRolloutNeeded?{status:ge.Warning,title:Re.ROLLOUT_AUTO_DISABLED,subTitle:e?.message||Re.ROLLOUT_AUTO_DISABLED_MESSAGE,action:{icon:$i,tooltip:Re.ROLLOUT_RESTART,onClick:a}}:{status:ge.Success,title:Re.ROLLOUT_FINISHED,subTitle:e?.message||Re.ROLLOUT_FINISHED_MESSAGE}},[n]),s=r(()=>o?n.rollbackOccurred?{status:ge.Warning,title:Re.ROLLBACK_OCCURRED,subTitle:Re.ROLLBACK_OCCURRED_MESSAGE,action:{icon:$i,tooltip:Re.ROLLBACK_RECOVER,onClick:i}}:{status:ge.Success,title:Re.ROLLBACK_SUCCESS}:null,[n,o]);return t(yt,{bgTint:"1000",children:e(te,{$gap:12,$alignItems:"stretch",children:[t(Pt,{invertColors:!0,slim:!0,width:s?Jr:"100%",...l}),s&&t(Pt,{invertColors:!0,slim:!0,width:Jr,...s})]})})},Zr=m(null),Qr=g.div`
158
158
  position: relative;
159
- `,Fr=({children:e})=>{const a=d(null);return t(Rr,{ref:a,children:t(Dr.Provider,{value:a,children:e})})},Pr=m.div`
159
+ `,ec=({children:e})=>{const o=d(null);return t(Qr,{ref:o,children:t(Zr.Provider,{value:o,children:e})})},tc=g.div`
160
160
  position: fixed;
161
161
  top: ${({$coords:e})=>e.top}px;
162
162
  right: ${({$coords:e})=>e.right}px;
@@ -170,34 +170,74 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
170
170
  padding: 12px 16px;
171
171
  border-radius: 12px;
172
172
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
173
- `,Lr=m.div``,_r=m.div``,Br=m.div`
173
+ `,oc=g.div``,nc=g.div``,ac=g.div`
174
174
  display: flex;
175
175
  gap: 8px;
176
176
  align-items: flex-end;
177
177
  justify-content: space-between;
178
- `,Mr=({width:a,onClose:o,onSave:n,onDelete:i,title:s,warning:r,children:c})=>{const d=b(),p=u(Dr),[g,m]=l(null);return Kt(p??{current:null},o),h(()=>{const e=p?.current?.getBoundingClientRect();e&&m({top:e.bottom+4,right:window.innerWidth-e.left-24})},[p]),g?Rl(e(Pr,{$coords:g,$width:a,"data-ignore-outside-click":"true",children:[t(Lr,{children:t(X,{size:V.XXS,children:s})}),e(Br,{children:[c,e(R,{$gap:8,children:[t(F,{variant:L.Secondary,onClick:i,leftIcon:xi,iconSize:16,size:P.S,textColor:d.v2.colors.red[500]}),t(F,{variant:L.Primary,onClick:n,leftIcon:Bi,iconSize:16,size:P.S})]})]}),t(_r,{children:t(Y,{status:J.Warning,message:r})})]}),document.body):null},zr=({language:a,overridden:o,onOverride:n,defaultValues:i})=>{const{tier:s}=G(),{formData:c,handleFormChange:d,resetFormData:p}=mt(i),u=r(()=>{if(!a)return[];const e=Yt[a].community,t=s===qe.Onprem?Yt[a].enterprise:[];return e.concat(t).map(e=>({id:e.id,label:e.value,icon:e.icon||void 0}))},[a,s]),[h,g]=l(!1),[m,b]=l(!1),f=()=>{h||(m&&p(),b(e=>!e))};return e(R,{$gap:4,$alignItems:"center",children:[o?t(pe,{status:J.Info,invertColors:!0,label:be.OVERIDDEN}):null,e(Fr,{children:[t(oe,{text:be.OVERRIDE_OTEL_DISTRO_NAME,children:t(Me,{icon:Ai,onClick:f})}),m&&t(Mr,{width:"300px",onClose:f,onSave:async()=>{g(!0),await n(c),g(!1),f()},onDelete:async()=>{g(!0),await n({otelDistroName:null}),g(!1),f()},title:be.OVERRIDE_OTEL_DISTRO_NAME,warning:be.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(Be,{label:be.OTEL_DISTRO_NAME,options:u,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},Xr=({overridden:a,onOverride:o,defaultValues:n})=>{const{addNotification:i}=Ct(),{formData:s,handleFormChange:c,resetFormData:d}=mt(n),p=r(()=>Jt.map(e=>({id:e.id,label:e.value,icon:e.icon||void 0})),[]),[u,h]=l(!1),[g,m]=l(!1),b=()=>{u||(g&&d(),m(e=>!e))};return e(R,{children:[a?t(pe,{status:J.Info,invertColors:!0,label:be.OVERIDDEN}):null,e(Fr,{children:[t(oe,{text:be.OVERRIDE_RUNTIME_DETAILS,children:t(Me,{icon:Ai,onClick:b})}),g&&e(Mr,{width:"500px",onClose:b,onSave:async()=>{!s.version||qt(s.version)?(h(!0),await o(s),h(!1),b()):i({type:J.Warning,message:St.INVALID_VERSION,hideFromHistory:!0})},onDelete:async()=>{h(!0),await o({language:null,version:""}),h(!1),b()},title:be.OVERRIDE_RUNTIME_DETAILS,warning:be.OVERRIDE_RUNTIME_WARNING,children:[t(Be,{label:be.LANGUAGE,options:p,values:s.language?[s.language]:[],setValues:e=>c("language",e[0])}),t(x,{label:be.RUNTIME_VERSION,placeholder:be.VERSION_PLACEHOLDER,value:s.version,onChange:e=>c("version",e.target.value)})]})]})]})},Vr=({source:e,onOverride:a})=>{const{isVm:o}=G(),{containers:n,containersRichTitle:i}=r(()=>{const t=e?.conditions?.find(({type:e})=>e===jt.RuntimeDetection);return{containers:e?.containers??[],containersRichTitle:{title:o?be.DETECTED_PROCESSES:`${e.kind} ${be.CONTAINERS}`,tooltip:t?.message||(o?be.DETECTED_PROCESSES_DESCRIPTION:be.DETECTED_CONTAINERS_DESCRIPTION),badge:t?.status===Dt.Loading?{status:Dt.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,o]);return t(ut,{bgTint:"1000",richTitle:i,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(C,{$gap:8,children:n.map(e=>t(Wr,{...e,onOverride:a},`source-container-${e.containerName}`))})})},Ur=m.div`
178
+ `,ic=({width:o,onClose:n,onSave:a,onDelete:i,title:s,warning:r,children:c})=>{const d=f(),u=p(Zr),[m,g]=l(null);return eo(u??{current:null},n),h(()=>{const e=u?.current?.getBoundingClientRect();e&&g({top:e.bottom+4,right:window.innerWidth-e.left-24})},[u]),m?_l(e(tc,{$coords:m,$width:o,"data-ignore-outside-click":"true",children:[t(oc,{children:t(re,{size:ce.XXS,children:s})}),e(ac,{children:[c,e(te,{$gap:8,children:[t(oe,{variant:ae.Secondary,onClick:i,leftIcon:ai,iconSize:16,size:ne.S,textColor:d.v2.colors.red[500]}),t(oe,{variant:ae.Primary,onClick:a,leftIcon:vi,iconSize:16,size:ne.S})]})]}),t(nc,{children:t(me,{status:ge.Warning,message:r})})]}),document.body):null},lc=({language:o,overridden:n,onOverride:a,defaultValues:i})=>{const{tier:s}=y(),{formData:c,handleFormChange:d,resetFormData:u}=wt(i),p=r(()=>{if(!o)return[];const e=to[o].community,t=s===rt.Onprem?to[o].enterprise:[];return e.concat(t).map(e=>({id:e.id,label:e.label,icon:e.icon||void 0}))},[o,s]),[h,m]=l(!1),[g,f]=l(!1),b=()=>{h||(g&&u(),f(e=>!e))};return e(te,{$gap:4,$alignItems:"center",children:[n?t(Ie,{status:ge.Info,invertColors:!0,label:Re.OVERIDDEN}):null,e(ec,{children:[t(we,{text:Re.OVERRIDE_OTEL_DISTRO_NAME,children:t(qe,{icon:di,onClick:b})}),g&&t(ic,{width:"300px",onClose:b,onSave:async()=>{m(!0),await a(c),m(!1),b()},onDelete:async()=>{m(!0),await a({otelDistroName:null}),m(!1),b()},title:Re.OVERRIDE_OTEL_DISTRO_NAME,warning:Re.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(Je,{label:Re.OTEL_DISTRO_NAME,options:p,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},sc=({overridden:o,onOverride:n,defaultValues:a})=>{const{addNotification:i}=Et(),{formData:s,handleFormChange:c,resetFormData:d}=wt(a),u=r(()=>oo.map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})),[]),[p,h]=l(!1),[m,g]=l(!1),f=()=>{p||(m&&d(),g(e=>!e))};return e(te,{children:[o?t(Ie,{status:ge.Info,invertColors:!0,label:Re.OVERIDDEN}):null,e(ec,{children:[t(we,{text:Re.OVERRIDE_RUNTIME_DETAILS,children:t(qe,{icon:di,onClick:f})}),m&&e(ic,{width:"500px",onClose:f,onSave:async()=>{!s.version||no(s.version)?(h(!0),await n(s),h(!1),f()):i({type:ge.Warning,message:Nt.INVALID_VERSION,hideFromHistory:!0})},onDelete:async()=>{h(!0),await n({language:null,version:""}),h(!1),f()},title:Re.OVERRIDE_RUNTIME_DETAILS,warning:Re.OVERRIDE_RUNTIME_WARNING,children:[t(Je,{label:Re.LANGUAGE,options:u,values:s.language?[s.language]:[],setValues:e=>c("language",e[0])}),t(G,{label:Re.RUNTIME_VERSION,placeholder:Re.VERSION_PLACEHOLDER,value:s.version,onChange:e=>c("version",e.target.value)})]})]})]})},rc=({source:e,onOverride:o})=>{const{isVm:n}=y(),{containers:a,containersRichTitle:i}=r(()=>{const t=e?.conditions?.runtimeDetection;return{containers:e?.containers??[],containersRichTitle:{title:n?Re.DETECTED_PROCESSES:`${e.id.kind} ${Re.CONTAINERS}`,tooltip:t?.message||(n?Re.DETECTED_PROCESSES_DESCRIPTION:Re.DETECTED_CONTAINERS_DESCRIPTION),badge:Rt(t?.status)===Mt.Loading?{status:Mt.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,n]);return t(yt,{bgTint:"1000",richTitle:i,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(V,{$gap:8,children:a.map(e=>e&&t(pc,{...e,onOverride:o},`source-container-${e.containerName}`))})})},cc=g.div`
179
179
  display: flex;
180
180
  flex-direction: column;
181
181
  align-self: stretch;
182
182
  gap: 12px;
183
- padding: 8px 12px 16px 12px;
183
+ padding: 8px 12px;
184
184
  border-radius: 8px;
185
185
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
186
- `,Hr=m.div`
186
+ `,dc=g.div`
187
187
  display: flex;
188
188
  align-items: center;
189
189
  justify-content: center;
190
190
  padding: 8px;
191
191
  border-radius: 10px;
192
192
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
193
- `,jr=m.div`
193
+ `,uc=g.div`
194
194
  display: flex;
195
195
  flex-direction: column;
196
196
  gap: 12px;
197
197
  padding: 8px 12px;
198
198
  border-radius: 8px;
199
199
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
200
- `,Wr=({onOverride:a,...o})=>{const{containerName:n,runtimeInfo:i,agentEnabled:l,overrides:s}=o,c=b(),d=r(()=>!!s?.runtimeInfo?.language||!!s?.runtimeInfo?.runtimeVersion,[s]),p=r(()=>({language:Ot(o),version:Zt(o)||void 0}),[o]),u=r(()=>!!s?.otelDistroName,[s]),h=r(()=>s?.otelDistroName?{otelDistroName:s.otelDistroName}:{},[s]),g=r(()=>!i&&!d,[i,d]),m=r(()=>g?Gi:he(p.language),[g,p]),f=r(()=>{if(g)return"";const{language:e,version:t}=p;return`${e}${t?` • ${t}`:""}`},[g,p]),v=r(()=>g?{status:Dt.Loading,label:be.WAITING_FOR_RUNTIME_DETECTION}:{status:l?.otelDistroName?J.Success:Dt.Disabled,leftIcon:l?.otelDistroName?Ni:$i,label:l?.otelDistroName?`Instrumented | ${l.otelDistroName}`:"Uninstrumented",tooltip:l?.agentEnabledStatus?.message},[g,l]),y=e=>a({containerName:n,...u?h:{},...d?p:{},...e});return e(Ur,{children:[e(R,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(R,{$gap:8,$alignItems:"center",children:[t(Hr,{children:t(m,{size:24,fill:i?void 0:c.v2.colors.grey[400]})}),t(X,{children:n}),t(wt,f?{variant:Rt.Blue,label:f}:{variant:Rt.Loader,label:be.DETECTING_RUNTIME_INFO}),t(Xr,{overridden:d,onOverride:y,defaultValues:p})]}),e(R,{$gap:8,$alignItems:"center",children:[t(pe,{...v,textSize:V.XXXS}),t(zr,{language:p.language,overridden:u,onOverride:y,defaultValues:h})]})]}),l?.agentEnabled?null:t(jr,{children:e(R,{$gap:10,$alignItems:"center",children:[t(wt,{variant:Rt.Pink,label:be.NO_AVAILABLE_AGENT}),t(X,{size:V.XXXS,color:te.Secondary,children:l?.agentEnabledStatus?.message})]})})]})},Gr=({source:a,onClickRollout:o,onClickRollback:n,onOverride:i})=>e(C,{$gap:12,children:[t(fr,{source:a}),t(Ar,{source:a}),t(Or,{source:a,onClickRollout:o,onClickRollback:n}),t(Vr,{source:a,onOverride:i}),t(Ir,{source:a})]});var Kr;!function(e){e.Overview="overview",e.Pods="pods",e.PeerSources="peer-sources",e.Profiling="profiling"}(Kr||(Kr={}));const Yr=[ea.Deployment,ea.StatefulSet,ea.DaemonSet,ea.DeploymentConfig,ea.Rollout,ea.Pod];var Jr;!function(e){e.Workload="Workload",e.Pod="Pod"}(Jr||(Jr={}));const qr=({onClose:n,sourceId:i,fetchSourceById:s,persistSources:p,updateSource:u,restartWorkloads:h,restartPod:g,recoverFromRollback:m,fetchPeerSources:f,profilingFeatureIsConfigured:v,enableProfiling:y,fetchProfilingSlots:S,fetchSourceProfiling:w})=>{const k=b(),{isVm:x}=G(),{selectedStreamName:T}=fe(),{genericForm:E,loadSource:N,validateFormData:$}=ve(),[I,A]=l(!1),[O,D]=l(!1),[R,F]=l(!1),[P,_]=l(Kr.Overview),[B,M]=l(null),[z,X]=l({openFor:null});o(()=>{B&&JSON.stringify(Mt(i))!==JSON.stringify(Mt(B))&&M(null)},[i,B]);const U=d(!1),j=c(async()=>M(await s(i)||null),[i]);o(()=>{if(U.current||(j(),U.current=!0),!I){const e=setInterval(()=>j(),3e3);return()=>clearInterval(e)}},[j,I]),o(()=>{B&&N(B)},[B]);const W=Yr.includes(B?.kind),K=r(()=>(B?.pods??[]).some(e=>Et(e.agentInjectedStatus.status)!==J.Success||Et(e.podHealthStatus.status)!==J.Success||(e.containers??[]).some(e=>Et(e.healthStatus.status)!==J.Success||(e.processes??[]).some(e=>Et(e.healthStatus.status)!==J.Success))),[B?.pods]),Y=r(()=>{const e=[];return e.push({value:Kr.Overview,label:be.OVERVIEW}),e.push({value:Kr.Pods,label:be.PODS,icon:K?e=>t(Ji,{...e,fill:k.v2.colors.red[500]}):void 0}),x||e.push({value:Kr.PeerSources,label:be.PEER_SOURCES}),v&&e.push({value:Kr.Profiling,label:be.PROFILING}),e},[x,K,v]),q=c(()=>A(!0),[]),Z=c(()=>{B&&N(B),A(!1)},[B]),Q=c(async()=>{if(!B||!E)return;const{errorMessage:e,preparedFormData:t}=$();if(e)return;const a=t.otelServiceName!==B.name?t.otelServiceName:"";await u(i,{...t,otelServiceName:a}),A(!1)},[B,E,$,i,u]),ee=c(()=>D(!0),[]),te=c(async()=>{B&&(await p({[st]:[{namespace:B.namespace,name:B.name,kind:B.kind,selected:!1,currentStreamName:T}]}),D(!1),n())},[B,p,T,n]),ae=c(()=>{X({openFor:Jr.Workload})},[]),oe=c(async()=>{await m(i)},[m,i]),ne=c(async()=>{z.openFor===Jr.Workload?await h([i]):z.openFor===Jr.Pod&&z.podNamespace&&z.podName&&await g(z.podNamespace,z.podName),X({openFor:null})},[z,h,g,i]),ie=r(()=>{const e=[];return I||P===Kr.Overview&&(e.push({id:"edit-source-btn-edit",label:dt.EDIT,icon:Ai,active:I,onClick:q}),!x&&W&&e.push({id:"edit-source-btn-restart",label:dt.RESTART,icon:qi,onClick:ae}),e.push({id:"edit-source-btn-delete",label:dt.DELETE,icon:xi,color:k.v2.colors.red[500],active:O,onClick:ee})),e},[P,I,O,x,W,q,ae,ee,k]),le=r(()=>{if(!B)return[];const e=[],t={backgroundColor:"transparent",textSize:V.S};return e.push({...t,label:B.name,leftIcon:ji}),B.otelServiceName&&B.otelServiceName!==B.name&&e.push({...t,label:B.otelServiceName,leftIcon:Ki,textColor:k.v2.colors.silver[200]}),e},[B,k]);if(!B)return t(ct,{isOpen:!0,children:t(Le,{$height:"80vh",children:t(Xe,{withSpinner:!0})})});const se=P===Kr.Profiling&&R?"95vw":I?void 0:"75vw";return e(a,{children:[t(ct,{isOpen:!0,width:se,header:{icon:Qt(B.containers)[0],titleBadges:le,onClose:()=>{_(Kr.Overview),M(null),F(!1),n()},actions:ie},footer:{actions:I?[{"data-id":"edit-source-btn-cancel",label:dt.CANCEL,variant:L.Secondary,onClick:Z},{"data-id":"edit-source-btn-save",label:dt.SAVE,variant:L.Primary,onClick:Q}]:[]},children:t(pt,{$padding:"4px 12px 12px",children:e(C,{$gap:16,children:[!I&&Y.length>1&&t(H,{fullWidth:!0,options:Y,size:Ie.S,selected:P,setSelected:_}),P===Kr.Overview?I?t(rs,{}):t(Gr,{source:B,onClickRollout:ae,onClickRollback:oe,onOverride:e=>u(i,e)}):P===Kr.Pods?t(pr,{source:B,onClickRestartPod:W?(e,t)=>X({openFor:Jr.Pod,podNamespace:e,podName:t}):void 0}):P===Kr.PeerSources?t(ur,{source:B,fetchPeerSources:f}):P===Kr.Profiling?t(Fl,{source:B,fetchProfilingSlots:S,enableProfiling:y,fetchSourceProfiling:w,onFlameFullscreenChange:F}):null]})})}),t($l,{target:"source",action:"uninstrument",isOpen:O,onClose:()=>D(!1),onApprove:te}),t($l,{target:`${z.openFor?.toLowerCase()??""}`,action:"restart",isOpen:!!z.openFor,onClose:()=>X({openFor:null}),onApprove:ne})]})},Zr=m.div`
200
+ `,pc=({onOverride:o,...n})=>{const{containerName:a,runtimeInfo:i,agentEnabled:l,overrides:s}=n,c=f(),d=r(()=>!!s?.runtimeInfo?.language||!!s?.runtimeInfo?.runtimeVersion,[s]),u=r(()=>({language:zt(n),version:ao(n)||void 0}),[n]),p=r(()=>!!s?.otelDistroName,[s]),h=r(()=>s?.otelDistroName?{otelDistroName:s.otelDistroName}:{},[s]),m=r(()=>!i&&!d,[i,d]),g=r(()=>m?Ni:Oe(u.language),[m,u]),b=r(()=>{if(m)return"";const{language:e,version:t}=u;return`${e}${t?` • ${t}`:""}`},[m,u]),v=r(()=>m?{status:Mt.Loading,label:Re.WAITING_FOR_RUNTIME_DETECTION}:{status:l?.otelDistroName?ge.Success:Mt.Disabled,leftIcon:l?.otelDistroName?si:ri,label:l?.otelDistroName?`Instrumented | ${l.otelDistroName}`:"Uninstrumented",tooltip:l?.agentEnabledStatus?.message},[m,l]),y=e=>o({containerName:a,...p?h:{},...d?u:{},...e});return e(cc,{children:[e(te,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(te,{$gap:8,$alignItems:"center",children:[t(dc,{children:t(g,{size:24,fill:i?void 0:c.v2.colors.grey[400]})}),t(re,{children:a}),t(It,b?{variant:Bt.Blue,label:b}:{variant:Bt.Loader,label:Re.DETECTING_RUNTIME_INFO}),t(sc,{overridden:d,onOverride:y,defaultValues:u})]}),e(te,{$gap:8,$alignItems:"center",children:[t(Ie,{...v,textSize:ce.XXXS}),t(lc,{language:u.language,overridden:p,onOverride:y,defaultValues:h})]})]}),!l||l.agentEnabled||m?null:t(uc,{children:e(te,{$gap:10,$alignItems:"center",children:[t(It,{variant:Bt.Pink,label:Re.NO_AVAILABLE_AGENT}),t(re,{size:ce.XXXS,color:Ce.Secondary,children:l?.agentEnabledStatus?.message})]})})]})},hc=({effectiveConfig:o,source:n,onClickRollout:a,onClickRollback:i,onOverride:l})=>{const s=!0!==o?.autoRollback?.disabled;return e(V,{$gap:12,children:[t(Lr,{source:n}),t(Yr,{source:n}),t(qr,{rollbackEnabled:s,source:n,onClickRollout:a,onClickRollback:i}),t(rc,{source:n,onOverride:l}),t(Kr,{source:n})]})};function mc(e,t){const o=e.names[t];if(null==o)return"";if("string"==typeof o)return o;if("object"==typeof o&&"name"in o){const e=o.name;if("string"==typeof e)return e}return"number"==typeof o||"boolean"==typeof o?String(o):""}function gc(e){const t=Math.abs(e);return t>=1e9?`${fc(e/1e9)}s`:t>=1e6?`${fc(e/1e6)}ms`:t>=1e3?`${fc(e/1e3)}μs`:String(Math.round(e))}function fc(e){return e.toFixed(2).replace(/\.?0+$/,"")}function bc(e){const t=[];for(let o=0;o<e.levels.length;o++){const n=e.levels[o];let a=0;for(let e=0;e+3<n.length;e+=4){const i=n[e],l=n[e+1],s=n[e+2],r=n[e+3],c=a+i;t.push({level:o,offset:c,size:l,self:s,nameIndex:r}),a=c+l}}return t}function vc(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function yc(e,t){const o=t.trim().toLowerCase();return!o||e.toLowerCase().includes(o)}function Cc(e,t,o,n,a,i={}){if(0===e.levels.length||t<2||o<2)return null;const{zoomRoot:l=null,shouldKeepName:s,collapseRecursive:r=!1}=i,c=bc(e);let d=l?function(e,t){const o=e.reduce((e,t)=>Math.max(e,t.level),t.level),n=new Map;for(const t of e){const e=n.get(t.level);e?e.push(t):n.set(t.level,[t])}const a=[t];for(let e=t.level+1;e<=o;e++){const t=a.filter(t=>t.level===e-1);if(0===t.length)break;const o=n.get(e);if(o?.length)for(const e of o)for(const o of t)if(e.offset>=o.offset&&e.offset+e.size<=o.offset+o.size){a.push(e);break}}return a}(c,l):c;if(0===d.length)return null;if(s&&(d=d.filter(t=>s(mc(e,t.nameIndex))),0===d.length))return null;if(r&&(d=function(e,t){if(0===t.length)return t;const o=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),n=new Map;for(const e of o){const t=n.get(e.level);t?t.push(e):n.set(e.level,[e])}const a=new Set;for(const t of o){const o=n.get(t.level+1);if(!o)continue;const i=o.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==i.length)continue;const l=i[0];l.size===t.size&&mc(e,l.nameIndex)===mc(e,t.nameIndex)&&a.add(vc(l))}if(0===a.size)return o;const i=[];for(const e of o){if(a.has(vc(e)))continue;let t=0;for(let o=0;o<e.level;o++){const i=n.get(o);if(!i)continue;const l=i.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&a.has(vc(l))&&t++}i.push({...e,level:e.level-t})}return i}(e,d),0===d.length))return null;const u=l?.level??0,p=l?.offset??0,h=l?.size??e.numTicks;if(h<=0)return null;const m=d.reduce((e,t)=>Math.max(e,t.level-u),0)+1,g=n??Number.POSITIVE_INFINITY,f=Math.max(1,Math.min(o/m,g)),b=a.trim(),v=f>8?1:0;return d.map(o=>{const n=o.level-u,a=(o.offset-p)/h*t,i=Math.max(o.size/h*t,1),l=n*f,s=Math.max(f-v,1),r=mc(e,o.nameIndex);return{...o,x:a,y:l,w:i,h:s,name:r,matchesSearch:yc(r,b)}})}function Sc(e,t){let o=0;for(let t=0;t<e.length;t++)o=31*o+e.charCodeAt(t)>>>0;const n=t.v2.colors.black[500],a=[{fill:t.v2.colors.purple[300],text:n},{fill:t.v2.colors.green[300],text:n},{fill:t.v2.colors.red[300],text:n},{fill:t.v2.colors.blue[300],text:n},{fill:t.v2.colors.yellow[300],text:n}];return a[o%a.length]}var wc,xc;!function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(wc||(wc={})),function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(xc||(xc={}));function kc(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function Tc(e,t,o){for(const n of o)if(e>=n.x&&e<n.x+n.w&&t>=n.y&&t<n.y+n.h)return n;return null}function $c(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}const Ec=({flamebearer:o,maxRowPx:a,searchQuery:i="",shouldKeepName:s,minHostHeight:u=200,onFullscreenChange:p,profilingSlots:m})=>{const g=f(),b=d(null),v=d(null),y=d({x:0,y:0}),C=d(o.numTicks),[S,w]=l({w:0,h:0}),[x,k]=l(""),[T,$]=l(null),[E,N]=l([]),[I,A]=l(!1),[O,D]=l(wc.Fit),[R,F]=l(xc.Fit),[P,L]=l(!1),_=Math.max(1,Math.min(Math.floor(S.w*O),8192)),z=Math.max(1,Math.min(Math.floor(S.h*R),8192)),M=E.length>0?E[E.length-1]:null,B=M?.size??o.numTicks;n(()=>{C.current!==o.numTicks&&(C.current=o.numTicks,N([]))},[o.numTicks]),h(()=>{const e=b.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();w({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),n(()=>{if(!I)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[I]),n(()=>(p?.(I),()=>{I&&p?.(!1)}),[I,p]);const X=r(()=>Cc(o,_,z,a,i,{zoomRoot:M,shouldKeepName:s,collapseRecursive:P}),[o,a,i,z,_,M,s,P]),V=r(()=>function(e){return[...e].sort((e,t)=>t.level-e.level)}(X?.length?i.trim()?X.filter(e=>e.matchesSearch):X:[]),[X,i]),U=c(e=>{if(_<2||z<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const n=Tc((e.clientX-t.left)/t.width*_,(e.clientY-t.top)/t.height*z,V);if(n){const e=vc(n);$(e);const t=B>0?(100*n.size/B).toFixed(1):"0",a=o.numTicks>0?(100*n.size/o.numTicks).toFixed(1):"0";k(`${n.name}\ntotal ${gc(n.size)} (${t}% of view, ${a}% of profile) · self ${gc(n.self)}`)}else $(null),k("")},[V,o.numTicks,z,_,B]),H=c(e=>{U(e)},[U]),j=c(()=>{$(null),k("")},[]),G=c(e=>{y.current={x:e.clientX,y:e.clientY}},[]),W=c(e=>{const{x:t,y:o}=y.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-o)>3)return;if(_<2||z<2)return;const n=e.currentTarget.getBoundingClientRect();if(n.width<1||n.height<1)return;const a=Tc((e.clientX-n.left)/n.width*_,(e.clientY-n.top)/n.height*z,V);if(!a)return;const i=function(e){return{level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}}(a);N(e=>{const t=e.length>0?e[e.length-1]:null;return t&&function(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}(i,t)?e.slice(0,-1):[...e,i]})},[V,z,_]);h(()=>{const e=v.current;if(!e||_<2||z<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,n=Math.max(_,z),a=Math.min(t,16384/n);e.width=Math.floor(_*a),e.height=Math.floor(z*a),e.style.width=`${_}px`,e.style.height=`${z}px`;const l=e.getContext("2d");l&&(l.setTransform(a,0,0,a,0,0),l.clearRect(0,0,_,z),X?.length?function(e,t,o,n,a,i,l,s){const r=i.v2.colors.silver[900];e.fillStyle=r,e.fillRect(0,0,t,o);const c=a.trim().length>0;e.textRendering="optimizeLegibility";for(const t of n){const{x:o,y:n,w:a,h:l,name:r,size:d,matchesSearch:u}=t;if(c&&!u)continue;const{fill:p,text:h}=Sc(r,i);e.fillStyle=p,e.fillRect(o,n,a,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(o+.5,n+.5),e.lineTo(o+a-.5,n+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(o+.5,n+.5,Math.max(a-1,0),Math.max(l-1,0));const m=kc(d,s),g=`${r} (${gc(d)}, ${m}%)`,f=i.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(a>=y&&C>=b){e.font=`${C}px ${i.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=g;for(;t.length>2&&e.measureText(t).width>a-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=a-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,o+v,n+l/2),e.fillStyle=h,e.fillText(t,o+v,n+l/2))}}if(l)for(const t of n){if(vc(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:o,y:n,w:a,h:i}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(o+1,n+1,Math.max(a-2,0),Math.max(i-2,0));break}}(l,_,z,X,i,g,T,o.numTicks):(l.fillStyle=g.v2.colors.silver[900],l.fillRect(0,0,_,z)))},[X,o.numTicks,T,i,z,_,g]);const K=c(()=>A(e=>!e),[]),Y=o.numTicks>0?Math.max(0,Math.min(100,Math.round(B/o.numTicks*100))):100,J=r(()=>function(e,t){const o=bc(e),n=t?.offset??0,a=n+(t?.size??e.numTicks),i=(t?.level??-1)+1,l=t?.size??e.numTicks;let s=null;for(const e of o)e.level<i||e.offset<n||e.offset+e.size>a||e.size>=l||(!s||e.size>s.size||e.size===s.size&&e.level<s.level)&&(s=e);return s}(o,M),[o,M]),Q=null!==J,ee=E.length>0,ie=M?mc(o,M.nameIndex):"",le=c(()=>N([]),[]),se=c(()=>N(e=>e.slice(0,-1)),[]),de=c(()=>{J&&N(e=>[...e,J])},[J]);return e("div",{style:I?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:g.v2.colors.silver[900]}:{flex:1,minHeight:u,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(te,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(q,{label:"Collapse recursive",tooltip:"Collapse straight-line recursion (parent → single same-name child of equal width) into a single bar. Helps deep recursive call chains fit on screen.",labelAlign:Z.Left,size:ct.S,value:P,onChange:L}),e(te,{$gap:8,children:[e(te,{children:[t(oe,{variant:ae.Secondary,size:ne.S,label:"Reset zoom",leftIcon:Ai,onClick:le,disabled:!E.length}),t(oe,{variant:ae.Secondary,size:ne.S,iconSize:20,leftIcon:Oi,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!ee,onClick:se}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(re,{size:ce.XXS,color:Ce.Secondary,nowrap:!0,align:"center",children:`${Y}%`})}),t(oe,{variant:ae.Secondary,size:ne.S,iconSize:20,leftIcon:ii,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!Q,onClick:de})]}),e(te,{children:[t(we,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ue,{variant:io.Filled,options:[{value:wc.Fit,label:"W: Fit"},{value:wc.X10,label:"10x"}],selected:O,setSelected:D})}),t(we,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ue,{variant:io.Filled,options:[{value:xc.Fit,label:"H: Fit"},{value:xc.X10,label:"10x"}],selected:R,setSelected:F})})]}),t(oe,{variant:ae.Secondary,size:ne.S,iconSize:24,leftIcon:I?yi:Ii,tooltip:I?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:K})]})]}),t(we,{fullWidth:!0,keepAlive:!0,text:x,children:t("div",{ref:b,style:{flex:1,minWidth:0,width:"100%",height:I?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflowX:O>1?"auto":"hidden",overflowY:R>1?"auto":"hidden"},children:t("div",{style:{width:_||"100%",height:z||"100%",position:"relative"},children:t("canvas",{ref:v,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:T?"pointer":"default"},onPointerDown:G,onPointerMove:H,onPointerLeave:j,onClick:W})})})}),e(te,{$justifyContent:"space-between",children:[t(re,M?{size:ce.XXXS,color:g.v2.colors.silver[300],children:`Zoomed: ${ie} • ${gc(B)} samples in view`}:{size:ce.XXXS,color:g.v2.colors.silver[300],children:"Click a frame to zoom into its subtree (pprof-style)."}),m&&t(re,{size:ce.XXXS,color:g.v2.colors.silver[300],children:`${m.activeKeys.length} / ${m.maxSlots} profiling slots · ${$c(m.totalBytesUsed)} / ${$c(m.maxTotalBytesBudget)} budget · TTL ${m.slotTtlSeconds}s`})]})]})};var Nc,Ic;!function(e){e.Symbol="symbol",e.Self="self",e.Total="total"}(Nc||(Nc={})),function(e){e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"}(Ic||(Ic={}));const Ac=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function Oc(e,t){const o=function(e){return e.split(" ")[0]??""}(e);if(t.includes(Ic.FilterOutVoid)&&"void"===o)return!1;if(t.includes(Ic.OnlyWithReturnValues)){if(!(e.includes(" ")&&"void"!==o&&Ac.test(o)))return!1}return!0}const Dc={options:[{id:Ic.FilterOutVoid,label:"Filter out void symbols"},{id:Ic.OnlyWithReturnValues,label:"Only show functions with return values"}],filterRow:(e,t)=>Oc(e.cells.find(e=>e.key===Nc.Symbol)?.rawValue?.toString()??"",t)},Rc=({rows:e,languages:o,filters:n,onFiltersChange:a})=>{const i=r(()=>[{key:Nc.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:o?.includes(lo.Java)?Dc:void 0,noFilter:!o?.includes(lo.Java)},{key:Nc.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:Nc.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[o]),l=r(()=>e.map(e=>({cells:[{key:Nc.Symbol,rawValue:e.name},{key:Nc.Self,rawValue:gc(e.self)},{key:Nc.Total,rawValue:gc(e.total)}]})),[e]);return t(so,{variant:ro.Data,maxHeight:"calc(100vh - 306px)",columns:i,rows:l,filters:n,onFiltersChange:a,rowActionsPushLeftPosition:"12px",getRowActions:e=>[{id:`copy-${e.cells[0].rawValue}`,label:"",rightIcon:Di,onClick:()=>{navigator.clipboard.writeText(e.cells[0].rawValue)}}]})};var Fc;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(Fc||(Fc={}));const Pc=g(V)`
201
+ width: 100%;
202
+ flex: 1;
203
+ border-radius: 16px;
204
+ overflow: hidden;
205
+ background: ${({theme:e})=>e.v2.colors.silver[800]};
206
+ box-shadow: 0 2px 14.1px 0 rgba(0, 0, 0, 0.25);
207
+ `,Lc=g.div`
208
+ display: flex;
209
+ align-items: center;
210
+ gap: 10px;
211
+ flex-wrap: wrap;
212
+ padding: 12px 12px 8px;
213
+ background: ${({theme:e})=>e.v2.colors.silver[800]};
214
+ border-radius: 16px 16px 0 0;
215
+ `,_c=g(te)`
216
+ flex-shrink: 0;
217
+ align-items: center;
218
+ gap: 4px;
219
+ `,zc=g.div`
220
+ flex: 1;
221
+ display: flex;
222
+ align-items: stretch;
223
+ gap: ${({$gap:e})=>e}px;
224
+ padding: 16px;
225
+ background: ${({theme:e})=>e.v2.colors.silver[800]};
226
+ border-radius: 0 0 16px 16px;
227
+ `,Mc=g(V)`
228
+ flex: ${({$splitWithFlame:e})=>e?"0 0 min(413px, 42%)":"1 1 auto"};
229
+ width: ${({$splitWithFlame:e})=>e?"auto":"100%"};
230
+ max-width: ${({$splitWithFlame:e})=>e?"none":"100%"};
231
+ gap: 10px;
232
+ `,Bc=g(V)`
233
+ flex: ${({$splitWithTable:e})=>e?"1":"1 1 auto"};
234
+ width: ${({$splitWithTable:e})=>e?"auto":"100%"};
235
+ gap: 10px;
236
+ `,Xc=g(te)`
237
+ width: 100%;
238
+ min-height: 32px;
239
+ flex-shrink: 0;
240
+ `,Vc=({source:o,fetchProfilingSlots:i,enableProfiling:s,fetchSourceProfiling:u,onFlameFullscreenChange:p})=>{const h=f(),m=o.id,[g,b]=l(!0),[v,y]=l(null),[C,S]=l(null),[w,x]=l(0),[k,T]=l(Fc.Both),[$,E]=l(""),[N,I]=l({}),A=d(null),O=c(async()=>{try{const e=[i()];g&&e.push(u(m));const[t,o]=await Promise.all(e);t&&y(t),o?.profileJson&&S(o.profileJson)}finally{x(e=>e+1)}},[i,u,m]);n(()=>{let e=!1;return(async()=>{await s(m),e||(await O(),e||(A.current=setInterval(O,3e3)))})(),()=>{e=!0,A.current&&clearInterval(A.current)}},[s,O,m]);const D=r(()=>function(e){if(!e?.trim())return null;try{const t=JSON.parse(e),o=t.flamebearer;return!o?.names?.length||!Array.isArray(o.levels)||"number"!=typeof o.numTicks||o.numTicks<=0?null:{flamebearer:o,units:t.metadata?.units}}catch{return null}}(C),[C]),R=r(()=>D?function(e){const t=new Map;for(let o=0;o<e.levels.length;o++){const n=e.levels[o];for(let o=0;o+3<n.length;o+=4){const a=n[o+1],i=n[o+2],l=mc(e,n[o+3]);if(!l)continue;const s=t.get(l);(!s||a>s.total)&&t.set(l,{self:i,total:a})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)}(D.flamebearer):[],[D]),F=r(()=>{const e=$.trim().toLowerCase();return e?R.filter(t=>t.name.toLowerCase().includes(e)):R},[R,$]),P=k===Fc.Table||k===Fc.Both,L=k===Fc.Flame||k===Fc.Both,_=P&&L,z=o.runtimeInfo?.detectedLanguages||o.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??""),M=r(()=>function(e,t){if(!t?.includes(lo.Java))return;const o=e?.[Nc.Symbol]?.filter(Boolean)??[];return 0!==o.length?e=>Oc(e,o):void 0}(N,z),[N,z]);return!C&&w<2?t(Ke,{$height:"70vh",children:t(Qe,{withSpinner:!0})}):e(Pc,{$gap:0,$width:"100%",children:[e(Lc,{children:[t(we,{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(_c,{children:t(re,{size:ce.S,weight:500,color:Ce.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(te,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(Vt,{value:$,onChange:E,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:h.v2.colors.silver[900],emphasizeBackgroundColor:h.v2.colors.silver[800]})}),t(ue,{variant:io.Filled,options:[{value:Fc.Table,label:"Top table"},{value:Fc.Flame,label:"Flame graph"},{value:Fc.Both,label:"Both"}],selected:k,setSelected:T}),t(oe,g?{variant:ae.Secondary,size:ne.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(Ri,{...e,size:8,fill:h.v2.colors.green[500]})}:{variant:ae.Secondary,size:ne.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(Ri,{...e,size:8,fill:h.v2.colors.red[500]})})]})]}),t(zc,{$gap:P&&L?16:0,children:D?e(a,{children:[P&&e(Mc,{$splitWithFlame:_,children:[t(Xc,{$justifyContent:"flex-end",children:t(oe,{variant:ae.Secondary,size:ne.S,label:"Download snapshot",rightIcon:Fi,onClick:()=>{if(!C)return;const e=new Blob([C],{type:"application/json"}),t=URL.createObjectURL(e),n=document.createElement("a");n.href=t,n.download=`cpu-profile-${o.id.namespace}-${o.id.kind}-${o.id.name}.json`,n.click(),URL.revokeObjectURL(t)},disabled:!C})}),t(Rc,{rows:F,languages:z,filters:N,onFiltersChange:I})]}),L&&e(Bc,{$splitWithTable:_,children:[e(Xc,{$justifyContent:"space-between",children:[t(Ie,{label:D?`Total in view ${gc(D.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:h.v2.colors.silver[750],textColor:h.v2.colors.silver[200],textSize:ce.XXS}),e(te,{$gap:12,children:[!g&&t(oe,{variant:ae.Secondary,size:ne.S,label:"Refresh",leftIcon:$i,onClick:O}),t(q,{label:"Auto refresh",labelAlign:Z.Left,size:ct.S,value:g,onChange:b})]})]}),t(Ec,{flamebearer:D.flamebearer,maxRowPx:24,searchQuery:$,shouldKeepName:M,minHostHeight:280,onFullscreenChange:p,profilingSlots:v},k)]})]}):t(Ke,{children:t(se,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})})]})};var Uc;!function(e){e.Overview="overview",e.Pods="pods",e.PeerSources="peer-sources",e.Profiling="profiling"}(Uc||(Uc={}));const Hc=[uo.Deployment,uo.StatefulSet,uo.DaemonSet,uo.DeploymentConfig,uo.Rollout,uo.Pod];var jc;!function(e){e.Workload="Workload",e.Pod="Pod"}(jc||(jc={}));const Gc=({onClose:a,effectiveConfig:i,sourceId:s,fetchSourceById:u,persistSources:p,updateSource:h,restartWorkloads:m,restartPod:g,recoverFromRollback:b,fetchPeerSources:v,enableProfiling:C,fetchProfilingSlots:S,fetchSourceProfiling:w})=>{const x=f(),{isVm:k}=y(),{selectedStreamName:T}=Fe(),{genericForm:$,loadSource:E,validateFormData:N}=wl(),[I,A]=l(!1),[O,D]=l(!1),[R,F]=l(!1),[P,L]=l(Uc.Overview),[_,z]=l(null),[M,B]=l({openFor:null});n(()=>{_&&JSON.stringify(jt(s))!==JSON.stringify(jt(_))&&z(null)},[s,_]);const X=d(!1),U=c(async()=>z(await u(s)||null),[s]);n(()=>{if(X.current||(U(),X.current=!0),!I){const e=setInterval(()=>U(),3e3);return()=>clearInterval(e)}},[U,I]),n(()=>{_&&E(_)},[_]);const H=_&&Hc.includes(_.id.kind),j=r(()=>(_?.pods??[]).some(e=>Rt(e.agentInjectedStatus?.status)!==ge.Success||(e.containers??[]).some(e=>(e.processes??[]).some(e=>Rt(e.healthStatus?.status)!==ge.Success))),[_?.pods]),G=r(()=>{const e=[];return e.push({value:Uc.Overview,label:Re.OVERVIEW}),e.push({value:Uc.Pods,label:Re.PODS,icon:j?e=>t(Pi,{...e,fill:x.v2.colors.red[500]}):void 0}),k||e.push({value:Uc.PeerSources,label:Re.PEER_SOURCES}),i?.profiling?.enabled&&e.push({value:Uc.Profiling,label:Re.PROFILING}),e},[k,j,i]),W=c(()=>A(!0),[]),K=c(()=>{_&&E(_),A(!1)},[_]),Y=c(async()=>{if(!_||!$)return;const{errorMessage:e,preparedFormData:t}=N();if(e)return;const o=t.otelServiceName!==_.id.name?t.otelServiceName:"";await h(s,{...t,otelServiceName:o}),A(!1)},[_,$,N,s,h]),J=c(()=>D(!0),[]),q=c(async()=>{_&&(await p({[mt]:[{namespace:_.id.namespace,name:_.id.name,kind:_.id.kind,selected:!1,currentStreamName:T}]}),D(!1),a())},[_,p,T,a]),Z=c(()=>{B({openFor:jc.Workload})},[]),Q=c(async()=>{await b(s)},[b,s]),ee=c(async()=>{M.openFor===jc.Workload?await m([s]):M.openFor===jc.Pod&&M.podNamespace&&M.podName&&await g(M.podNamespace,M.podName),B({openFor:null})},[M,m,g,s]),te=r(()=>{const e=[];return I||P===Uc.Overview&&(e.push({id:"edit-source-btn-edit",label:bt.EDIT,icon:di,active:I,onClick:W}),!k&&H&&e.push({id:"edit-source-btn-restart",label:bt.RESTART,icon:Li,onClick:Z}),e.push({id:"edit-source-btn-delete",label:bt.DELETE,icon:ai,color:x.v2.colors.red[500],active:O,onClick:J})),e},[P,I,O,k,H,W,Z,J,x]),oe=r(()=>{if(!_)return[];const e=[],t={backgroundColor:"transparent",textSize:ce.S};return e.push({...t,label:_.id.name,leftIcon:Ti}),_.serviceName&&_.serviceName!==_.id.name&&e.push({...t,label:_.serviceName,leftIcon:Ei,textColor:x.v2.colors.silver[200]}),e},[_,x]);if(!_)return t(ft,{isOpen:!0,children:t(Ke,{$height:"80vh",children:t(Qe,{withSpinner:!0})})});const ne=P===Uc.Profiling?R?"95vw":"80vw":I?void 0:"60vw";return e(o,{children:[t(ft,{isOpen:!0,width:ne,header:{icon:co(_.containers)[0],titleBadges:oe,onClose:()=>{L(Uc.Overview),z(null),F(!1),a()},actions:te},footer:{actions:I?[{"data-id":"edit-source-btn-cancel",label:bt.CANCEL,variant:ae.Secondary,onClick:K},{"data-id":"edit-source-btn-save",label:bt.SAVE,variant:ae.Primary,onClick:Y}]:[]},children:t(vt,{$padding:"4px 12px 12px",children:e(V,{$gap:16,children:[!I&&G.length>1&&t(ue,{options:G,selected:P,setSelected:L}),(()=>{switch(P){case Uc.Overview:return I?t(ds,{}):t(hc,{effectiveConfig:i,source:_,onClickRollout:Z,onClickRollback:Q,onOverride:e=>h(s,e)});case Uc.Pods:return t($r,{source:_,onClickRestartPod:H?(e,t)=>B({openFor:jc.Pod,podNamespace:e,podName:t}):void 0});case Uc.PeerSources:return t(Er,{source:_,fetchPeerSources:v});case Uc.Profiling:return t(Vc,{source:_,fetchProfilingSlots:S,enableProfiling:C,fetchSourceProfiling:w,onFlameFullscreenChange:F});default:return null}})()]})})}),t(pl,{target:"source",action:"uninstrument",isOpen:O,onClose:()=>D(!1),onApprove:q}),t(pl,{target:`${M.openFor?.toLowerCase()??""}`,action:"restart",description:Re.RESTART_POD_DESCRIPTION,isOpen:!!M.openFor,onClose:()=>B({openFor:null}),onApprove:ee,overrideApproveButtonLabel:Re.DELETE_POD_TO_RESTART})]})},Wc=g.div`
201
241
  display: flex;
202
242
  align-items: center;
203
243
  gap: 8px;
@@ -207,9 +247,9 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
207
247
  &:hover {
208
248
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
209
249
  }
210
- `,Qr=m.div`
250
+ `,Kc=g.div`
211
251
  flex: 1;
212
- `,ec=({onClick:a})=>{const o=b().v2.colors.red[500];return e(Zr,{"data-id":"sampling-view-btn-delete",onClick:a,children:[t(X,{size:V.XS,weight:500,color:o,children:na}),t(xi,{size:16,fill:o})]})};function tc(o){if(o.isEditing){const{onCancelEdit:n,onSave:i,onDelete:l,duplicateWarning:s}=o;return{children:e(a,{children:[t(ec,{onClick:l}),s&&t(Y,{status:J.Warning,message:s.message,action:s.onViewRule?{"data-id":"sampling-view-edit-btn-view-duplicate",label:"View rule",onClick:s.onViewRule}:void 0}),t(Qr,{}),t(F,{"data-id":"sampling-view-edit-btn-cancel",label:ta,variant:L.Secondary,size:P.S,onClick:n}),t(F,{"data-id":"sampling-view-edit-btn-save",label:aa,variant:L.Primary,size:P.S,onClick:i,disabled:!!s})]})}}const{onDelete:n,onCancel:i,onEdit:l}=o;return{children:e(a,{children:[t(ec,{onClick:n}),t(Qr,{}),t(F,{"data-id":"sampling-view-btn-cancel",label:ta,variant:L.Secondary,size:P.S,onClick:i}),t(F,{"data-id":"sampling-view-btn-edit",label:oa,variant:L.Primary,size:P.S,onClick:l})]})}}const ac={[Ce.EditAutoNoisy]:{title:ba,subTitle:ma,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[Ce.EditAutoCostReduction]:{title:ga,subTitle:ha,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[Ce.EditAutoHighlyRelevant]:{title:ua,subTitle:pa,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},oc=({isOpen:e,title:a,subTitle:o,onClose:n,footer:i,renderBody:l})=>t(ct,{isOpen:e,width:va,header:{icon:Zi,title:a,subTitle:o,onClose:n},footer:i,children:l?l():t(pt,{$padding:"12px",children:t(gs,{})})}),nc=({isOpen:e,onClose:a,onSubmit:n,validateForm:i,onNavigateToDuplicate:l})=>{const{category:s,formData:r,resetForm:d,duplicateWarning:p,setDuplicateWarning:u}=ye(Ce.Create);o(()=>{e&&d()},[e]);const h=c(()=>{if(i){const e=i(r);if(e)return void u(e)}n(r)},[r,n,i,u]),g={note:p?{status:J.Warning,message:p.message,action:l?{"data-id":"sampling-create-btn-view-duplicate",label:"View rule",onClick:()=>l(p.ruleId)}:void 0}:void 0,actions:[{"data-id":"sampling-create-btn-cancel",label:ta,variant:L.Secondary,size:P.S,onClick:a},{"data-id":"sampling-create-btn-submit",label:ca,variant:L.Primary,size:P.S,onClick:h,disabled:!!p}]};return t(oc,{isOpen:e,title:da[s],subTitle:la[s],onClose:a,footer:g})},ic=({onClose:e,onDelete:a,onSaveEdit:o,validateForm:n,onNavigateToDuplicate:i})=>{const{data:l,isEditing:s,formData:d,handleEdit:p,handleCancelEdit:u,duplicateWarning:h,setDuplicateWarning:g}=ye(Ce.View),m=l?.rule.name||ra,b=s&&l?sa[l.category]:`${m} preview`,f=c(()=>{if(l&&s){if(n){const e=n(d);if(e)return void g(e)}o(d,l.rule.ruleId,l.samplingId)}},[l,s,d,o,n,g]),v=c(()=>{l&&a(l.rule.ruleId,l.samplingId)},[l,a]),y=r(()=>{if(!l)return;const t=h?{message:h.message,onViewRule:i?()=>i(h.ruleId):void 0}:null;return tc(s?{isEditing:!0,onCancelEdit:u,onSave:f,onDelete:v,duplicateWarning:t}:{isEditing:!1,onDelete:v,onCancel:e,onEdit:p})},[l,s,h,u,f,v,p,e,i]);return t(oc,{isOpen:!!l,title:b,subTitle:l?la[l.category]:"",onClose:e,footer:y})},lc=({isOpen:e,onClose:a,onSave:o})=>{const{localEnabled:n,resolvedPercentage:i}=ye(Ce.EditAutoNoisy),l=c(()=>o(n,i),[o,n,i]);return t(cc,{formType:Ce.EditAutoNoisy,isOpen:e,onClose:a,onSave:l})},sc=({isOpen:e,onClose:a,onSave:o})=>{const{localEnabled:n,resolvedPercentage:i}=ye(Ce.EditAutoCostReduction),l=c(()=>o(n,i),[o,n,i]);return t(cc,{formType:Ce.EditAutoCostReduction,isOpen:e,onClose:a,onSave:l})},rc=({isOpen:e,onClose:a,onSave:o})=>{const{localEnabled:n}=ye(Ce.EditAutoHighlyRelevant),i=c(()=>o(n),[o,n]);return t(cc,{formType:Ce.EditAutoHighlyRelevant,isOpen:e,onClose:a,onSave:i})},cc=({formType:e,isOpen:a,onClose:o,onSave:n})=>{const i=ac[e];return t(oc,{isOpen:a,title:i.title,subTitle:i.subTitle,onClose:o,footer:{actions:[{"data-id":i.cancelId,label:ta,variant:L.Secondary,size:P.S,onClick:o},{"data-id":i.saveId,label:fa,variant:L.Primary,size:P.S,onClick:n}]}})},dc=e=>{switch(e.formType){case Ce.Create:return t(ia,{formType:Ce.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(nc,{...e})});case Ce.View:return t(ia,{formType:Ce.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(ic,{...e})});case Ce.EditAutoNoisy:return t(ia,{formType:Ce.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(lc,{...e})});case Ce.EditAutoCostReduction:return t(ia,{formType:Ce.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(sc,{...e})});case Ce.EditAutoHighlyRelevant:return t(ia,{formType:Ce.EditAutoHighlyRelevant,enabled:e.enabled,children:t(rc,{...e})})}},pc=({token:o,isLoading:n,isEditing:i,onEdit:l,onCancel:s,onSave:r,formData:c,handleFormChange:d,handleErrorChange:p,formErrors:u})=>{const{CopyButton:h}=ya(),g=!i||n||!c.newToken;return Ca({key:"Enter",active:!g},r),e(R,i?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(x,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),p("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:u.newToken}),t(R,{$margin:n?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:n?t(Xe,{title:"Saving...",withGradient:!0}):e(a,{children:[t(F,{variant:L.Secondary,size:P.S,leftIcon:Mi,onClick:s,disabled:n}),t(F,{variant:L.Primary,size:P.S,leftIcon:Bi,onClick:r,disabled:g})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(X,{size:V.XS,children:new Array(55).fill("•").join("")}),e(R,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:o}),t(Me,{icon:Ai,onClick:l})]})]})},uc=({expiresAt:e,callbackValid:a,callbackExpired:n})=>{const{formatTimeAgo:i}=xt(),l=r(()=>i(e),[e]),s=r(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=r(()=>Sa(e,0)?J.Error:Sa(e,2592e6)?J.Warning:J.Success,[e]),d=r(()=>c===J.Success?Bi:c===J.Warning?Ji:Qi,[c]);return o(()=>{c===J.Success?a():c===J.Error&&n()},[c]),t(oe,{text:s,children:t(pe,{leftIcon:d,label:l,status:c,invertColors:!0,useSecondaryTone:!0})})},hc=m.div`
252
+ `,Yc=({onClick:o})=>{const n=f().v2.colors.red[500];return e(Wc,{"data-id":"sampling-view-btn-delete",onClick:o,children:[t(re,{size:ce.XS,weight:500,color:n,children:go}),t(ai,{size:16,fill:n})]})};function Jc(n){if(n.isEditing){const{onCancelEdit:a,onSave:i,onDelete:l,duplicateWarning:s}=n;return{children:e(o,{children:[t(Yc,{onClick:l}),s&&t(me,{status:ge.Warning,message:s.message,action:s.onViewRule?{"data-id":"sampling-view-edit-btn-view-duplicate",label:"View rule",onClick:s.onViewRule}:void 0}),t(Kc,{}),t(oe,{"data-id":"sampling-view-edit-btn-cancel",label:po,variant:ae.Secondary,size:ne.S,onClick:a}),t(oe,{"data-id":"sampling-view-edit-btn-save",label:ho,variant:ae.Primary,size:ne.S,onClick:i,disabled:!!s})]})}}const{onDelete:a,onCancel:i,onEdit:l}=n;return{children:e(o,{children:[t(Yc,{onClick:a}),t(Kc,{}),t(oe,{"data-id":"sampling-view-btn-cancel",label:po,variant:ae.Secondary,size:ne.S,onClick:i}),t(oe,{"data-id":"sampling-view-btn-edit",label:mo,variant:ae.Primary,size:ne.S,onClick:l})]})}}const qc={[kl.EditAutoNoisy]:{title:$o,subTitle:To,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[kl.EditAutoCostReduction]:{title:ko,subTitle:xo,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[kl.EditAutoHighlyRelevant]:{title:wo,subTitle:So,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},Zc=({isOpen:e,title:o,subTitle:n,onClose:a,footer:i,renderBody:l})=>t(ft,{isOpen:e,width:No,header:{icon:_i,title:o,subTitle:n,onClose:a},footer:i,children:l?l():t(vt,{$padding:"12px",children:t(fs,{})})}),Qc=({isOpen:e,onClose:o,onSubmit:a,validateForm:i,onNavigateToDuplicate:l})=>{const{category:s,formData:r,resetForm:d,duplicateWarning:u,setDuplicateWarning:p}=xl(kl.Create);n(()=>{e&&d()},[e]);const h=c(()=>{if(i){const e=i(r);if(e)return void p(e)}a(r)},[r,a,i,p]),m={note:u?{status:ge.Warning,message:u.message,action:l?{"data-id":"sampling-create-btn-view-duplicate",label:"View rule",onClick:()=>l(u.ruleId)}:void 0}:void 0,actions:[{"data-id":"sampling-create-btn-cancel",label:po,variant:ae.Secondary,size:ne.S,onClick:o},{"data-id":"sampling-create-btn-submit",label:yo,variant:ae.Primary,size:ne.S,onClick:h,disabled:!!u}]};return t(Zc,{isOpen:e,title:Co[s],subTitle:fo[s],onClose:o,footer:m})},ed=({onClose:e,onDelete:o,onSaveEdit:n,validateForm:a,onNavigateToDuplicate:i})=>{const{data:l,isEditing:s,formData:d,handleEdit:u,handleCancelEdit:p,duplicateWarning:h,setDuplicateWarning:m}=xl(kl.View),g=l?.rule.name||vo,f=s&&l?bo[l.category]:`${g} preview`,b=c(()=>{if(l&&s){if(a){const e=a(d);if(e)return void m(e)}n(d,l.rule.ruleId,l.samplingId)}},[l,s,d,n,a,m]),v=c(()=>{l&&o(l.rule.ruleId,l.samplingId)},[l,o]),y=r(()=>{if(!l)return;const t=h?{message:h.message,onViewRule:i?()=>i(h.ruleId):void 0}:null;return Jc(s?{isEditing:!0,onCancelEdit:p,onSave:b,onDelete:v,duplicateWarning:t}:{isEditing:!1,onDelete:v,onCancel:e,onEdit:u})},[l,s,h,p,b,v,u,e,i]);return t(Zc,{isOpen:!!l,title:f,subTitle:l?fo[l.category]:"",onClose:e,footer:y})},td=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a,resolvedPercentage:i}=xl(kl.EditAutoNoisy),l=c(()=>n(a,i),[n,a,i]);return t(ad,{formType:kl.EditAutoNoisy,isOpen:e,onClose:o,onSave:l})},od=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a,resolvedPercentage:i}=xl(kl.EditAutoCostReduction),l=c(()=>n(a,i),[n,a,i]);return t(ad,{formType:kl.EditAutoCostReduction,isOpen:e,onClose:o,onSave:l})},nd=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a}=xl(kl.EditAutoHighlyRelevant),i=c(()=>n(a),[n,a]);return t(ad,{formType:kl.EditAutoHighlyRelevant,isOpen:e,onClose:o,onSave:i})},ad=({formType:e,isOpen:o,onClose:n,onSave:a})=>{const i=qc[e];return t(Zc,{isOpen:o,title:i.title,subTitle:i.subTitle,onClose:n,footer:{actions:[{"data-id":i.cancelId,label:po,variant:ae.Secondary,size:ne.S,onClick:n},{"data-id":i.saveId,label:Eo,variant:ae.Primary,size:ne.S,onClick:a}]}})},id=e=>{switch(e.formType){case kl.Create:return t(Al,{formType:kl.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(Qc,{...e})});case kl.View:return t(Al,{formType:kl.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(ed,{...e})});case kl.EditAutoNoisy:return t(Al,{formType:kl.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(td,{...e})});case kl.EditAutoCostReduction:return t(Al,{formType:kl.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(od,{...e})});case kl.EditAutoHighlyRelevant:return t(Al,{formType:kl.EditAutoHighlyRelevant,enabled:e.enabled,children:t(nd,{...e})})}},ld=({token:n,isLoading:a,isEditing:i,onEdit:l,onCancel:s,onSave:r,formData:c,handleFormChange:d,handleErrorChange:u,formErrors:p})=>{const{CopyButton:h}=Jt(),m=!i||a||!c.newToken;return Io({key:"Enter",active:!m},r),e(te,i?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(G,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),u("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:p.newToken}),t(te,{$margin:a?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:a?t(Qe,{title:"Saving...",withGradient:!0}):e(o,{children:[t(oe,{variant:ae.Secondary,size:ne.S,leftIcon:yi,onClick:s,disabled:a}),t(oe,{variant:ae.Primary,size:ne.S,leftIcon:vi,onClick:r,disabled:m})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(re,{size:ce.XS,children:new Array(55).fill("•").join("")}),e(te,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:n}),t(qe,{icon:di,onClick:l})]})]})},sd=({expiresAt:e,callbackValid:o,callbackExpired:a})=>{const{formatTimeAgo:i}=Ot(),l=r(()=>i(e),[e,i]),s=r(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=r(()=>Ao(e,0)?ge.Error:Ao(e,2592e6)?ge.Warning:ge.Success,[e]),d=r(()=>c===ge.Success?vi:c===ge.Warning?Pi:zi,[c]);return n(()=>{c===ge.Success?o():c===ge.Error&&a()},[c]),t(we,{text:s,children:t(Ie,{leftIcon:d,label:l,status:c,invertColors:!0,useSecondaryTone:!0})})},rd=g.div`
213
253
  display: flex;
214
254
  flex-direction: column;
215
255
  gap: 12px;
@@ -217,7 +257,7 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
217
257
  border-radius: 12px;
218
258
  border: 1px solid ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[500]:e.v2.colors.silver[600]};
219
259
  background-color: ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[1e3]:e.v2.colors.silver[800]};
220
- `,gc=({children:e})=>{const a=b();return t(X,{size:V.XXXS,color:a.v2.colors.grey[150],children:e})},mc=({token:a,updateToken:o})=>{const[n,i]=l(!1),[s,r]=l(!1),[c,d]=l(!1),{formData:p,handleFormChange:u,formErrors:h,handleErrorChange:g,resetFormData:m}=mt({newToken:""});return t(Ae,{richTitle:{icon:el,title:"Odigos Pro Token"},children:e(hc,{$isExpired:c,children:[e(R,{$justifyContent:"space-between",children:[e(C,{$gap:4,children:[t(gc,{children:"Issued for"}),t(X,{size:V.XS,children:a.name||"N/A"})]}),e(C,{$gap:4,children:[t(gc,{children:"Expiration"}),t(uc,{expiresAt:a.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(C,{})]}),t(R,{children:e(C,{children:[t(gc,{children:"Token"}),t(pc,{token:a.token,newToken:p.newToken,isLoading:s,isEditing:n,onEdit:()=>i(!0),onCancel:()=>(i(!1),r(!1),void u("newToken","")),onSave:()=>(async()=>{r(!0);const e=await o(p.newToken.trim());r(!1),e?.error?g("newToken",e.error):(i(!1),m())})(),formData:p,handleFormChange:u,handleErrorChange:g,formErrors:h})]})})]})})},bc=m.div`
260
+ `,cd=({children:e})=>{const o=f();return t(re,{size:ce.XXXS,color:o.v2.colors.grey[150],children:e})},dd=({token:o,updateToken:n})=>{const[a,i]=l(!1),[s,r]=l(!1),[c,d]=l(!1),{formData:u,handleFormChange:p,formErrors:h,handleErrorChange:m,resetFormData:g}=wt({newToken:""});return t(Ue,{richTitle:{icon:Mi,title:"Odigos Pro Token"},children:e(rd,{$isExpired:c,children:[e(te,{$justifyContent:"space-between",children:[e(V,{$gap:4,children:[t(cd,{children:"Issued for"}),t(re,{size:ce.XS,children:o.name||"N/A"})]}),e(V,{$gap:4,children:[t(cd,{children:"Expiration"}),t(sd,{expiresAt:o.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(V,{})]}),t(te,{children:e(V,{children:[t(cd,{children:"Token"}),t(ld,{token:o.token,newToken:u.newToken,isLoading:s,isEditing:a,onEdit:()=>i(!0),onCancel:()=>(i(!1),r(!1),void p("newToken","")),onSave:()=>(async()=>{r(!0);const e=await n(u.newToken.trim());r(!1),e?.error?m("newToken",e.error):(i(!1),g())})(),formData:u,handleFormChange:p,handleErrorChange:m,formErrors:h})]})})]})})},ud=g.div`
221
261
  display: flex;
222
262
  flex-direction: column;
223
263
  align-items: center;
@@ -226,23 +266,23 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
226
266
  padding: 12px 24px;
227
267
  border-radius: 8px;
228
268
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
229
- `,fc=({downloadDiagnose:a})=>{const{progress:o}=at(),{namespaces:n}=We(),[i,s]=l(null),{formData:r,handleFormChange:c,resetFormData:d}=mt({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(Ae,{richTitle:{icon:tl,title:"Diagnose"},children:i?e(bc,{children:[t(Xe,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof o[it.DownloadingDiagnose]?.percentage,percentage:o[it.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof o[it.DownloadingDiagnose]?.percentage,visualIcon:al,startedAt:i}),o[it.DownloadingDiagnose]?.list?.length&&t(C,{$width:"100%",children:o[it.DownloadingDiagnose].list.map(a=>e(R,{$gap:4,$alignItems:"center",children:[a.status===J.Success?t(Bi,{size:16}):a.status===J.Error?t(Mi,{size:16}):t(Xe,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(X,{size:V.XXXS,color:te.Secondary,children:a.label})]},a.label))})]}):e(C,{$gap:24,children:[t(X,{size:V.XXS,color:te.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(C,{$gap:16,children:[e(R,{$gap:8,children:[t(w,{label:"Profiles",value:r.includeProfiles,onChange:e=>c("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(X,{size:V.XXXS,color:te.Secondary,children:"Include pprof profiles"})]}),e(R,{$gap:8,children:[t(w,{label:"Metrics",value:r.includeMetrics,onChange:e=>c("includeMetrics",e)}),t(X,{size:V.XXXS,color:te.Secondary,children:"Include Prometheus metrics"})]}),e(R,{$gap:8,children:[t(w,{label:"Source Workloads",value:r.includeSourceWorkloads,onChange:e=>{c("includeSourceWorkloads",e),e&&c("sourceWorkloadNamespaces",[])}}),t(X,{size:V.XXXS,color:te.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(wa,{alignX:xa.Left,alignY:ka.Bottom,items:n.map(e=>({id:e.name,label:e.name,withCheckbox:!0})),selectedIds:r.sourceWorkloadNamespaces,setSelectedIds:e=>c("sourceWorkloadNamespaces",e),withMultiSelect:!0,withSearch:!0,fullWidth:!0,buttonProps:{label:(r.sourceWorkloadNamespaces.length?"Selected":"Select")+" Namespaces",variant:L.Secondary,disabled:r.includeSourceWorkloads,leftIcon:r.sourceWorkloadNamespaces.length?()=>t(pe,{label:r.sourceWorkloadNamespaces.length,status:J.Default}):void 0}}),t(R,{$justifyContent:"flex-end",children:t(F,{label:"Download Diagnose",rightIcon:al,variant:L.Primary,onClick:async()=>{s(Date.now()),await a(r),s(null),d()},disabled:null!==i})})]})})},vc=({fetchDescribeOdigos:e})=>{const{platformType:a,version:n,tier:i}=G(),[s,r]=l(null);return o(()=>{e().then(({data:e})=>r(e?.describeOdigos||null))},[]),t(Ae,{richTitle:{icon:ol,title:"General Information"},children:t(ut,{cellsPerRow:2,items:[{id:Ta(),title:"Odigos Version",label:n},{id:Ta(),title:`${a.toUpperCase()} Version`,label:s?.kubernetesVersion?.value||"-"},{id:Ta(),title:"Installation Method",label:s?.installationMethod?.value||"-"},{id:Ta(),title:"Tier",label:i}]})})},yc=({isOpen:a,onClose:o,token:n,updateToken:i,fetchDescribeOdigos:l,downloadDiagnose:s})=>e(ct,{isOpen:a,header:{icon:ol,title:"System Overview",onClose:o},children:[l&&t(vc,{fetchDescribeOdigos:l}),i&&n&&t(mc,{token:n,updateToken:i}),s&&t(fc,{downloadDiagnose:s})]}),Cc=({isOpen:o,onClose:n,onCloseEnd:i,createDataStream:l})=>{const{addDataStreams:s,setSelectedStreamName:r}=fe(),{requestSubmit:d}=ge(),p=c(async e=>{l?await l(e):(s([e]),r(e.name)),n()},[l,s,r,n]),u=c(()=>d(p),[d,p]);return Ca({key:"Enter",active:o},u),e(a,{children:[t(me,{isOpen:o,onClose:n,onCloseEnd:i,title:be.NAME_YOUR_STREAM,description:be.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:dt.DONE,variant:L.Primary,onClick:u},denyButton:{"data-id":"add-stream-btn-cancel",label:dt.CANCEL,variant:L.Secondary,onClick:n},children:t(ss,{autoFocus:!0})}),t(ls,{})]})},Sc=({isOpen:n,onClose:i,onCloseEnd:l,dataStreamName:s,updateDataStream:r})=>{const{genericForm:d,loadDataStream:p,requestSubmit:u}=ge();o(()=>{n&&s&&p(s)},[n,s]);const h=!!d?.isFormDirty,g=c(async e=>{await r(s,e),i()},[r,s,i]),m=c(()=>u(g),[u,g]);return Ca({key:"Enter",active:n},m),e(a,{children:[t(me,{isOpen:n,onClose:i,onCloseEnd:l,title:be.RENAME_STREAM(s),description:be.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:dt.SAVE,variant:L.Primary,onClick:m,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:dt.CANCEL,variant:L.Secondary,onClick:i},children:t(ss,{autoFocus:!0})}),t(ls,{})]})},wc=({scale:a=1})=>e("svg",{width:742*a,height:533*a,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)"})})]})]}),kc=m.div`
269
+ `,pd=({downloadDiagnose:o})=>{const{progress:n}=ut(),{namespaces:a}=at(),[i,s]=l(null),{formData:r,handleFormChange:c,resetFormData:d}=wt({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(Ue,{richTitle:{icon:Bi,title:"Diagnose"},children:i?e(ud,{children:[t(Qe,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof n[pt.DownloadingDiagnose]?.percentage,percentage:n[pt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof n[pt.DownloadingDiagnose]?.percentage,visualIcon:Fi,startedAt:i}),n[pt.DownloadingDiagnose]?.list?.length&&t(V,{$width:"100%",children:n[pt.DownloadingDiagnose].list.map(o=>e(te,{$gap:4,$alignItems:"center",children:[o.status===ge.Success?t(vi,{size:16}):o.status===ge.Error?t(yi,{size:16}):t(Qe,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(re,{size:ce.XXXS,color:Ce.Secondary,children:o.label})]},o.label))})]}):e(V,{$gap:24,children:[t(re,{size:ce.XXS,color:Ce.Secondary,children:"Download a tar.gz file with diagnostics from this cluster. Select which data to include before downloading, and share the file with the Odigos support team for troubleshooting."}),e(V,{$gap:16,children:[e(te,{$gap:8,children:[t(H,{label:"Profiles",value:r.includeProfiles,onChange:e=>c("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(re,{size:ce.XXXS,color:Ce.Secondary,children:"Include pprof profiles"})]}),e(te,{$gap:8,children:[t(H,{label:"Metrics",value:r.includeMetrics,onChange:e=>c("includeMetrics",e)}),t(re,{size:ce.XXXS,color:Ce.Secondary,children:"Include Prometheus metrics"})]}),e(te,{$gap:8,children:[t(H,{label:"Source Workloads",value:r.includeSourceWorkloads,onChange:e=>{c("includeSourceWorkloads",e),e&&c("sourceWorkloadNamespaces",[])}}),t(re,{size:ce.XXXS,color:Ce.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(Oo,{alignX:Ro.Left,alignY:Do.Bottom,items:a.map(e=>({id:e.name,label:e.name,withCheckbox:!0})),selectedIds:r.sourceWorkloadNamespaces,setSelectedIds:e=>c("sourceWorkloadNamespaces",e),withMultiSelect:!0,withSearch:!0,fullWidth:!0,buttonProps:{label:(r.sourceWorkloadNamespaces.length?"Selected":"Select")+" Namespaces",variant:ae.Secondary,disabled:r.includeSourceWorkloads,leftIcon:r.sourceWorkloadNamespaces.length?()=>t(Ie,{label:r.sourceWorkloadNamespaces.length,status:ge.Default}):void 0}}),t(te,{$justifyContent:"flex-end",children:t(oe,{label:"Download Diagnose",rightIcon:Fi,variant:ae.Primary,onClick:async()=>{s(Date.now()),await o(r),s(null),d()},disabled:null!==i})})]})})},hd=({fetchDescribeOdigos:e})=>{const{platformType:o,version:a,tier:i}=y(),[s,r]=l(null);return n(()=>{e().then(({data:e})=>r(e?.describeOdigos||null))},[]),t(Ue,{richTitle:{icon:Xi,title:"General Information"},children:t(yt,{cellsPerRow:2,items:[{id:Fo(),title:"Odigos Version",label:a},{id:Fo(),title:`${o.toUpperCase()} Version`,label:s?.kubernetesVersion?.value||"-"},{id:Fo(),title:"Installation Method",label:s?.installationMethod?.value||"-"},{id:Fo(),title:"Tier",label:i}]})})},md=({isOpen:o,onClose:n,token:a,updateToken:i,fetchDescribeOdigos:l,downloadDiagnose:s})=>e(ft,{isOpen:o,header:{icon:Xi,title:"System Overview",onClose:n},children:[l&&t(hd,{fetchDescribeOdigos:l}),i&&a&&t(dd,{token:a,updateToken:i}),s&&t(pd,{downloadDiagnose:s})]}),gd=({isOpen:n,onClose:a,onCloseEnd:i,createDataStream:l})=>{const{addDataStreams:s,setSelectedStreamName:r}=Fe(),{requestSubmit:d}=Sl(),u=c(async e=>{l?await l(e):(s([e]),r(e.name)),a()},[l,s,r,a]),p=c(()=>d(u),[d,u]);return Io({key:"Enter",active:n},p),e(o,{children:[t(De,{isOpen:n,onClose:a,onCloseEnd:i,title:Re.NAME_YOUR_STREAM,description:Re.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:bt.DONE,variant:ae.Primary,onClick:p},denyButton:{"data-id":"add-stream-btn-cancel",label:bt.CANCEL,variant:ae.Secondary,onClick:a},children:t(cs,{autoFocus:!0})}),t(rs,{})]})},fd=({isOpen:a,onClose:i,onCloseEnd:l,dataStreamName:s,updateDataStream:r})=>{const{genericForm:d,loadDataStream:u,requestSubmit:p}=Sl();n(()=>{a&&s&&u(s)},[a,s]);const h=!!d?.isFormDirty,m=c(async e=>{await r(s,e),i()},[r,s,i]),g=c(()=>p(m),[p,m]);return Io({key:"Enter",active:a},g),e(o,{children:[t(De,{isOpen:a,onClose:i,onCloseEnd:l,title:Re.RENAME_STREAM(s),description:Re.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:bt.SAVE,variant:ae.Primary,onClick:g,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:bt.CANCEL,variant:ae.Secondary,onClick:i},children:t(cs,{autoFocus:!0})}),t(rs,{})]})},bd=({scale:o=1})=>e("svg",{width:742*o,height:533*o,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)"})})]})]}),vd=g.div`
230
270
  position: absolute;
231
271
  top: 50%;
232
272
  left: 50%;
233
273
  transform: translate(-50%, -50%);
234
274
  z-index: ${({theme:e})=>e.v2.zIndex.modal};
235
- `,xc="onboarding-done",Tc=()=>{const{currentModal:a,setCurrentModal:o}=Ea(),n=()=>o("");return e(Na,{isOpen:a===xc,onClose:n,children:[t(wc,{}),t(kc,{children:e(C,{$gap:32,$alignItems:"center",children:[e(C,{$gap:24,$alignItems:"center",children:[t(X,{size:V.L,weight:500,children:"Welcome to"}),t(Al,{size:260}),t(X,{size:V.S,weight:400,children:"Your observability control plane is ready."})]}),t(F,{label:"Get Started",rightIcon:nl,onClick:n})]})})]})},Ec=m.div`
275
+ `,yd="onboarding-done",Cd=()=>{const{currentModal:o,setCurrentModal:n}=Po(),a=()=>n("");return e(Lo,{isOpen:o===yd,onClose:a,children:[t(bd,{}),t(vd,{children:e(V,{$gap:32,$alignItems:"center",children:[e(V,{$gap:24,$alignItems:"center",children:[t(re,{size:ce.L,weight:500,children:"Welcome to"}),t(ml,{size:260}),t(re,{size:ce.S,weight:400,children:"Your observability control plane is ready."})]}),t(oe,{label:"Get Started",rightIcon:Vi,onClick:a})]})})]})},Sd=g.div`
236
276
  display: flex;
237
277
  flex-direction: column;
238
278
  gap: 8px;
239
279
  padding: 4px 8px;
240
280
  border-radius: 8px;
241
281
  width: calc(100% - 16px);
242
- `,Nc=m.div`
282
+ `,wd=g.div`
243
283
  white-space: pre;
244
284
  overflow-x: auto;
245
- `,$c=({name:a,recommended:o,toggleLabel:n,enabled:i,onEnabledChange:l,summary:s,toggleName:r})=>{const c=b();return e(Ec,{children:[e(R,{$gap:8,$justifyContent:"space-between",children:[e(R,{$gap:4,children:[t(X,{size:V.XS,color:c.v2.colors.white[500],nowrap:!0,children:a}),o&&t(pe,{label:$a,leftIcon:il,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:V.XXXS})]}),t(I,{name:r??`sampling-onboarding-toggle-${a}`,label:n,labelAlign:A.Left,value:i,onChange:l,size:Ze.S})]}),t(Nc,{children:t(Ia,{parts:s})})]})},Ic=m.div`
285
+ `,xd=({name:o,recommended:n,toggleLabel:a,enabled:i,onEnabledChange:l,summary:s,toggleName:r})=>{const c=f();return e(Sd,{children:[e(te,{$gap:8,$justifyContent:"space-between",children:[e(te,{$gap:4,children:[t(re,{size:ce.XS,color:c.v2.colors.white[500],nowrap:!0,children:o}),n&&t(Ie,{label:_o,leftIcon:Ui,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:ce.XXXS})]}),t(q,{name:r??`sampling-onboarding-toggle-${o}`,label:a,labelAlign:Z.Left,value:i,onChange:l,size:ct.S})]}),t(wd,{children:t(S,{parts:s})})]})},kd=g.div`
246
286
  position: relative;
247
287
  display: flex;
248
288
  align-items: center;
@@ -252,18 +292,18 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
252
292
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
253
293
  border-top-left-radius: 18px;
254
294
  border-top-right-radius: 18px;
255
- `,Ac=m.div`
295
+ `,Td=g.div`
256
296
  position: absolute;
257
297
  left: 16px;
258
298
  top: 50%;
259
299
  transform: translateY(-50%);
260
- `,Oc=m.div`
300
+ `,$d=g.div`
261
301
  height: 16px;
262
302
  width: 100%;
263
303
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
264
304
  border-top-left-radius: 18px;
265
305
  border-top-right-radius: 18px;
266
- `,Dc=m.div`
306
+ `,Ed=g.div`
267
307
  width: ${({$width:e})=>e}px;
268
308
  display: flex;
269
309
  flex-direction: column;
@@ -271,10 +311,10 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
271
311
  gap: 22px;
272
312
  padding: 8px 32px 32px 32px;
273
313
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
274
- `,Rc=e=>t(ll,{rotate:90,...e}),Fc=({children:a,center:o,onNext:n,nextLabel:i=Aa,nextLoading:l})=>e(R,{$gap:8,$justifyContent:o?"center":"flex-end",$padding:"0 16px 16px 16px",children:[a,n&&t(F,{"data-id":"sampling-onboarding-btn-next",label:i,rightIcon:Rc,variant:L.Primary,size:P.M,onClick:n,loading:l})]}),Pc=e=>t(ll,{rotate:-90,...e}),Lc=({title:a,onBack:o})=>{const n=b();return e(Ic,{$hasBack:!!o,children:[o&&t(Ac,{children:t(Me,{"data-id":"sampling-onboarding-back",icon:Pc,size:ze.M,onClick:o})}),t(X,{size:V.M,weight:500,color:n.v2.colors.white[500],align:"center",children:a})]})},_c=m.div`
314
+ `,Nd=e=>t(Hi,{rotate:90,...e}),Id=({children:o,center:n,onNext:a,nextLabel:i=zo,nextLoading:l})=>e(te,{$gap:8,$justifyContent:n?"center":"flex-end",$padding:"0 16px 16px 16px",children:[o,a&&t(oe,{"data-id":"sampling-onboarding-btn-next",label:i,rightIcon:Nd,variant:ae.Primary,size:ne.M,onClick:a,loading:l})]}),Ad=e=>t(Hi,{rotate:-90,...e}),Od=({title:o,onBack:n})=>{const a=f();return e(kd,{$hasBack:!!n,children:[n&&t(Td,{children:t(qe,{"data-id":"sampling-onboarding-back",icon:Ad,size:Ze.M,onClick:n})}),t(re,{size:ce.M,weight:500,color:a.v2.colors.white[500],align:"center",children:o})]})},Dd=g.div`
275
315
  box-sizing: border-box;
276
316
  width: ${({$width:e})=>e??"100%"};
277
- ${({$fillHeight:e})=>e&&f`
317
+ ${({$fillHeight:e})=>e&&b`
278
318
  align-self: stretch;
279
319
  height: auto;
280
320
  `}
@@ -284,16 +324,16 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
284
324
  padding: 16px;
285
325
  border-radius: 16px;
286
326
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
287
- `,Bc=({children:e,fillHeight:a,width:o})=>t(_c,{$fillHeight:a,$width:o,children:e}),Mc=m.ul`
327
+ `,Rd=({children:e,fillHeight:o,width:n})=>t(Dd,{$fillHeight:o,$width:n,children:e}),Fd=g.ul`
288
328
  margin: 0;
289
329
  padding: 0;
290
330
  list-style: disc;
291
- `,zc=m.li`
331
+ `,Pd=g.li`
292
332
  margin-left: 18px;
293
333
  & + & {
294
334
  margin-top: 6px;
295
335
  }
296
- `,Xc=({items:e,color:a})=>{const o=b(),n=a||o.v2.colors.silver[200];return t(Mc,{children:e.map((e,a)=>t(zc,{style:{color:n},children:t(X,{size:V.XXS,color:n,children:e})},a))})},Vc=({items:a})=>{const o=b();return t(C,{$gap:16,children:a.map((a,n)=>e(R,{$gap:8,$alignItems:"flex-start",children:[e(X,{size:V.XS,color:o.v2.colors.silver[200],weight:400,children:[n+1,"."]}),e(C,{$gap:2,children:[t(X,{size:V.XS,color:o.v2.colors.white[500],weight:500,children:a.title}),t(X,{size:V.XS,color:o.v2.colors.silver[200],children:a.description})]})]},n))})},Uc=({message:e})=>t(Y,{status:J.Default,message:e,fullWidth:!0,smallIcon:!0}),Hc=m.div`
336
+ `,Ld=({items:e,color:o})=>{const n=f(),a=o||n.v2.colors.silver[200];return t(Fd,{children:e.map((e,o)=>t(Pd,{style:{color:a},children:t(re,{size:ce.XXS,color:a,children:e})},o))})},_d=({items:o})=>{const n=f();return t(V,{$gap:16,children:o.map((o,a)=>e(te,{$gap:8,$alignItems:"flex-start",children:[e(re,{size:ce.XS,color:n.v2.colors.silver[200],weight:400,children:[a+1,"."]}),e(V,{$gap:2,children:[t(re,{size:ce.XS,color:n.v2.colors.white[500],weight:500,children:o.title}),t(re,{size:ce.XS,color:n.v2.colors.silver[200],children:o.description})]})]},a))})},zd=({message:e})=>t(me,{status:ge.Default,message:e,fullWidth:!0,smallIcon:!0}),Md=g.div`
297
337
  width: calc(100% - 16px);
298
338
  padding: 8px;
299
339
  display: flex;
@@ -301,12 +341,12 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
301
341
  gap: 4px;
302
342
  border-radius: 16px;
303
343
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
304
- `,jc=m.div`
344
+ `,Bd=g.div`
305
345
  display: flex;
306
346
  align-items: center;
307
347
  gap: 8px;
308
348
  padding: 4px 8px 12px 8px;
309
- `,Wc=m.div`
349
+ `,Xd=g.div`
310
350
  width: calc(100% - 16px);
311
351
  display: flex;
312
352
  flex-direction: column;
@@ -314,20 +354,20 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
314
354
  padding: 8px;
315
355
  border-radius: 12px;
316
356
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
317
- `,Gc=({children:e})=>{const a=b();return t(X,{size:V.S,weight:500,color:a.v2.colors.white[500],align:"center",children:e})},Kc=m.div`
357
+ `,Vd=({children:e})=>{const o=f();return t(re,{size:ce.S,weight:500,color:o.v2.colors.white[500],align:"center",children:e})},Ud=g.div`
318
358
  white-space: pre-line;
319
- `,Yc=({enabled:o,onEnabledChange:n,onBack:i,onNext:l})=>{const s=b(),c=r(()=>Oa({enabled:o,keepPercentage:0}),[o]);return e(a,{children:[t(Lc,{title:Da,onBack:i}),e(Dc,{$width:854,children:[t(Gc,{children:Ra}),e(C,{$gap:8,$width:"100%",children:[t(Bc,{children:t(Kc,{children:t(X,{size:V.XXS,color:s.v2.colors.silver[200],children:Fa})})}),e(C,{$gap:8,$width:"100%",children:[e(Hc,{children:[t(jc,{children:t(X,{size:V.S,weight:500,color:s.v2.colors.white[500],children:Pa})}),t(Wc,{children:t($c,{name:_a,recommended:!0,toggleLabel:La,enabled:o,onEnabledChange:n,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(Uc,{message:Ba})]})]})]}),t(Fc,{onNext:l})]})},Jc=e=>t(ll,{rotate:90,...e}),qc=({onClose:o})=>{const n=b();return e(a,{children:[t(Oc,{}),e(Dc,{$width:732,children:[t(Ma,{icon:Zi}),e(C,{$gap:16,$alignItems:"center",$width:"100%",children:[t(X,{size:V.M,weight:500,color:n.v2.colors.white[500],children:za}),Xa.split("\n").map(e=>t(Gc,{children:e},e)),e(Bc,{children:[t(X,{size:V.XS,color:n.v2.colors.silver[200],children:Va}),t(Xc,{color:n.v2.colors.white[500],items:[Ua,Ha,ja]})]})]})]}),t(Fc,{center:!0,children:t(F,{"data-id":"sampling-onboarding-btn-go-to",label:Wa,rightIcon:Jc,variant:L.Primary,size:P.M,onClick:o})})]})},Zc=e=>t(ll,{rotate:90,...e}),Qc=m.div`
359
+ `,Hd=({enabled:n,onEnabledChange:a,onBack:i,onNext:l})=>{const s=f(),c=r(()=>w({enabled:n,keepPercentage:0}),[n]);return e(o,{children:[t(Od,{title:Mo,onBack:i}),e(Ed,{$width:854,children:[t(Vd,{children:Bo}),e(V,{$gap:8,$width:"100%",children:[t(Rd,{children:t(Ud,{children:t(re,{size:ce.XXS,color:s.v2.colors.silver[200],children:Xo})})}),e(V,{$gap:8,$width:"100%",children:[e(Md,{children:[t(Bd,{children:t(re,{size:ce.S,weight:500,color:s.v2.colors.white[500],children:Vo})}),t(Xd,{children:t(xd,{name:Ho,recommended:!0,toggleLabel:Uo,enabled:n,onEnabledChange:a,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(zd,{message:jo})]})]})]}),t(Id,{onNext:l})]})},jd=e=>t(Hi,{rotate:90,...e}),Gd=({onClose:n})=>{const a=f();return e(o,{children:[t($d,{}),e(Ed,{$width:732,children:[t(Go,{icon:_i}),e(V,{$gap:16,$alignItems:"center",$width:"100%",children:[t(re,{size:ce.M,weight:500,color:a.v2.colors.white[500],children:Wo}),Ko.split("\n").map(e=>t(Vd,{children:e},e)),e(Rd,{children:[t(re,{size:ce.XS,color:a.v2.colors.silver[200],children:Yo}),t(Ld,{color:a.v2.colors.white[500],items:[Jo,qo,Zo]})]})]})]}),t(Id,{center:!0,children:t(oe,{"data-id":"sampling-onboarding-btn-go-to",label:Qo,rightIcon:jd,variant:ae.Primary,size:ne.M,onClick:n})})]})},Wd=e=>t(Hi,{rotate:90,...e}),Kd=g.div`
320
360
  display: flex;
321
361
  flex-direction: column;
322
362
  align-items: center;
323
363
  gap: 8px;
324
364
  width: 100%;
325
- `,ed=({onSkip:o,onNext:n})=>{const i=b();return e(a,{children:[t(Oc,{}),e(Dc,{$width:732,children:[t(Ma,{icon:Zi}),e(C,{$gap:16,$alignItems:"center",$width:"100%",children:[e(Qc,{children:[t(X,{size:V.M,weight:500,color:i.v2.colors.white[500],children:Ga}),t(Gc,{children:Ka})]}),e(Bc,{children:[t(X,{size:V.XS,color:i.v2.colors.silver[200],children:Ya}),t(Vc,{items:[{title:qa,description:Ja},{title:Qa,description:Za},{title:to,description:eo}]}),t(Uc,{message:ao})]})]})]}),e(Fc,{center:!0,children:[t(F,{"data-id":"sampling-onboarding-btn-skip",label:oo,variant:L.Secondary,onClick:o}),t(F,{"data-id":"sampling-onboarding-btn-start",label:no,rightIcon:Zc,variant:L.Primary,onClick:n})]})]})},td=m.div`
365
+ `,Yd=({onSkip:n,onNext:a})=>{const i=f();return e(o,{children:[t($d,{}),e(Ed,{$width:732,children:[t(Go,{icon:_i}),e(V,{$gap:16,$alignItems:"center",$width:"100%",children:[e(Kd,{children:[t(re,{size:ce.M,weight:500,color:i.v2.colors.white[500],children:en}),t(Vd,{children:tn})]}),e(Rd,{children:[t(re,{size:ce.XS,color:i.v2.colors.silver[200],children:on}),t(_d,{items:[{title:an,description:nn},{title:sn,description:ln},{title:cn,description:rn}]}),t(zd,{message:dn})]})]})]}),e(Id,{center:!0,children:[t(oe,{"data-id":"sampling-onboarding-btn-skip",label:un,variant:ae.Secondary,onClick:n}),t(oe,{"data-id":"sampling-onboarding-btn-start",label:pn,rightIcon:Wd,variant:ae.Primary,onClick:a})]})]})},Jd=g.div`
326
366
  display: flex;
327
367
  align-items: stretch;
328
368
  gap: 16px;
329
369
  width: 100%;
330
- `,ad=m.div`
370
+ `,qd=g.div`
331
371
  flex: 1;
332
372
  display: flex;
333
373
  flex-direction: column;
@@ -339,26 +379,26 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
339
379
  background-color 0.15s ease,
340
380
  border-color 0.15s ease;
341
381
 
342
- ${({$selected:e,theme:t})=>e?f`
382
+ ${({$selected:e,theme:t})=>e?b`
343
383
  background-color: ${t.v2.colors.purple[900]};
344
384
  border-color: ${t.v2.colors.purple[400]};
345
- `:f`
385
+ `:b`
346
386
  &:hover {
347
387
  background-color: ${t.v2.colors.silver[700]};
348
388
  }
349
389
  `}
350
- `,od=m.div`
390
+ `,Zd=g.div`
351
391
  display: flex;
352
392
  align-items: center;
353
393
  gap: 8px;
354
394
  padding: 12px 16px;
355
- `,nd=m.div`
395
+ `,Qd=g.div`
356
396
  flex: 1;
357
397
  padding: 8px;
358
398
  display: flex;
359
399
  flex-direction: column;
360
400
  gap: 8px;
361
- `,id=m.div`
401
+ `,eu=g.div`
362
402
  flex: 1;
363
403
  display: flex;
364
404
  flex-direction: column;
@@ -366,17 +406,17 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
366
406
  padding: 12px;
367
407
  border-radius: 12px;
368
408
  background-color: ${({theme:e,$selected:t})=>t?e.v2.colors.purple[900]:e.v2.colors.silver[900]};
369
- `,ld=m.div`
409
+ `,tu=g.div`
370
410
  display: flex;
371
411
  justify-content: flex-end;
372
- `,sd=m.div`
412
+ `,ou=g.div`
373
413
  display: flex;
374
414
  align-items: center;
375
415
  gap: 8px;
376
416
  padding: 4px 12px 4px 4px;
377
417
  border-radius: 8px;
378
418
  background-color: ${({theme:e})=>e.v2.colors.yellow[1e3]};
379
- `,rd=m.div`
419
+ `,nu=g.div`
380
420
  display: flex;
381
421
  align-items: center;
382
422
  justify-content: center;
@@ -384,13 +424,13 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
384
424
  height: 24px;
385
425
  border-radius: 6px;
386
426
  background-color: ${({theme:e})=>e.v2.colors.yellow[900]};
387
- `,cd=({selected:a,onSelect:o,name:n,description:i,badgeProps:l,bullets:s,warning:r,onReadMore:c})=>{const d=b(),p=a?d.v2.colors.white[500]:d.v2.colors.silver[200];return e(ad,{$selected:a,onClick:o,children:[e(od,{children:[t(wo,{"data-id":`sampling-onboarding-radio-${n}`,value:a,onChange:o,size:ko.L}),t(Zi,{size:24,fill:d.v2.colors.white[500]}),t(X,{size:V.S,weight:500,color:d.v2.colors.white[500],children:n})]}),e(nd,{children:[e(id,{$selected:a,children:[e(C,{$gap:8,children:[t(pe,{...l,textSize:V.XXXS}),t(X,{size:V.XXS,color:p,children:i})]}),s&&s.length>0&&t(Xc,{color:p,items:s}),r&&e(sd,{children:[t(rd,{children:t(Ji,{size:18,fill:d.v2.colors.yellow[500]})}),t(X,{size:V.XXXS,color:d.v2.colors.yellow[500],children:r})]})]}),c&&t(ld,{children:t(F,{"data-id":`sampling-onboarding-btn-read-more-${n}`,label:xo,rightIcon:Ei,variant:L.Text,size:P.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},dd=({strategy:o,onStrategyChange:n,onBack:i,onNext:l,docsUrl:s})=>{const r=b(),c=s?()=>window.open(s,"_blank"):void 0;return e(a,{children:[t(Lc,{title:io,onBack:i}),e(Dc,{$width:854,children:[t(Gc,{children:lo}),e(td,{children:[t(cd,{selected:"keep-list"===o,onSelect:()=>n("keep-list"),name:ho,description:uo,badgeProps:{label:po,backgroundColor:r.v2.colors.purple[500],textColor:r.v2.colors.white[500]},bullets:[ro,co],warning:so,onReadMore:c}),t(cd,{selected:"drop-list"===o,onSelect:()=>n("drop-list"),name:vo,description:fo,badgeProps:{label:bo,backgroundColor:r.v2.colors.green[500],textColor:r.v2.colors.black[500]},bullets:[go,mo],onReadMore:c}),t(cd,{selected:"advanced"===o,onSelect:()=>n("advanced"),name:So,description:Co,badgeProps:{label:yo,backgroundColor:r.v2.colors.blue[700],textColor:r.v2.colors.white[500]},onReadMore:c})]})]}),t(Fc,{onNext:l})]})},pd=({onBack:o,onNext:n,submitting:i})=>{const l=b(),s=r(()=>[{title:$o,bullets:[To,Eo,No]},{title:Fo,bullets:[Io,Ao,Oo,Do,Ro]}],[]);return e(a,{children:[t(Lc,{title:Po,onBack:o}),e(Dc,{$width:854,children:[t(Gc,{children:Lo}),t(R,{$gap:16,$width:"100%",$alignItems:"stretch",children:s.map((a,o)=>e(Bc,{fillHeight:!0,width:"50%",children:[t(X,{size:V.XS,color:l.v2.colors.white[500],children:a.title}),t(Xc,{items:a.bullets})]},o))}),t(Uc,{message:_o})]}),t(Fc,{onNext:n,nextLoading:i})]})},ud=m.div`
427
+ `,au=({selected:o,onSelect:n,name:a,description:i,badgeProps:l,bullets:s,warning:r,onReadMore:c})=>{const d=f(),u=o?d.v2.colors.white[500]:d.v2.colors.silver[200];return e(qd,{$selected:o,onClick:n,children:[e(Zd,{children:[t(In,{"data-id":`sampling-onboarding-radio-${a}`,value:o,onChange:n,size:An.L}),t(_i,{size:24,fill:d.v2.colors.white[500]}),t(re,{size:ce.S,weight:500,color:d.v2.colors.white[500],children:a})]}),e(Qd,{children:[e(eu,{$selected:o,children:[e(V,{$gap:8,children:[t(Ie,{...l,textSize:ce.XXXS}),t(re,{size:ce.XXS,color:u,children:i})]}),s&&s.length>0&&t(Ld,{color:u,items:s}),r&&e(ou,{children:[t(nu,{children:t(Pi,{size:18,fill:d.v2.colors.yellow[500]})}),t(re,{size:ce.XXXS,color:d.v2.colors.yellow[500],children:r})]})]}),c&&t(tu,{children:t(oe,{"data-id":`sampling-onboarding-btn-read-more-${a}`,label:On,rightIcon:li,variant:ae.Text,size:ne.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},iu=({strategy:n,onStrategyChange:a,onBack:i,onNext:l,docsUrl:s})=>{const r=f(),c=s?()=>window.open(s,"_blank"):void 0;return e(o,{children:[t(Od,{title:hn,onBack:i}),e(Ed,{$width:854,children:[t(Vd,{children:mn}),e(Jd,{children:[t(au,{selected:"keep-list"===n,onSelect:()=>a("keep-list"),name:Cn,description:yn,badgeProps:{label:vn,backgroundColor:r.v2.colors.purple[500],textColor:r.v2.colors.white[500]},bullets:[fn,bn],warning:gn,onReadMore:c}),t(au,{selected:"drop-list"===n,onSelect:()=>a("drop-list"),name:Tn,description:kn,badgeProps:{label:xn,backgroundColor:r.v2.colors.green[500],textColor:r.v2.colors.black[500]},bullets:[Sn,wn],onReadMore:c}),t(au,{selected:"advanced"===n,onSelect:()=>a("advanced"),name:Nn,description:En,badgeProps:{label:$n,backgroundColor:r.v2.colors.blue[700],textColor:r.v2.colors.white[500]},onReadMore:c})]})]}),t(Id,{onNext:l})]})},lu=({onBack:n,onNext:a,submitting:i})=>{const l=f(),s=r(()=>[{title:Pn,bullets:[Dn,Rn,Fn]},{title:Xn,bullets:[Ln,_n,zn,Mn,Bn]}],[]);return e(o,{children:[t(Od,{title:Vn,onBack:n}),e(Ed,{$width:854,children:[t(Vd,{children:Un}),t(te,{$gap:16,$width:"100%",$alignItems:"stretch",children:s.map((o,n)=>e(Rd,{fillHeight:!0,width:"50%",children:[t(re,{size:ce.XS,color:l.v2.colors.white[500],children:o.title}),t(Ld,{items:o.bullets})]},n))}),t(zd,{message:Hn})]}),t(Id,{onNext:a,nextLoading:i})]})},su=g.div`
388
428
  white-space: pre-line;
389
- `,hd=({errorPresetEnabled:o,onErrorPresetChange:n,onBack:i,onNext:l,submitting:s})=>{const c=b(),d=r(()=>Bo(o?{disabled:!1}:null),[o]);return e(a,{children:[t(Lc,{title:Mo,onBack:i}),e(Dc,{$width:854,children:[t(Gc,{children:zo}),e(C,{$gap:8,$width:"100%",children:[e(Bc,{children:[t(ud,{children:t(X,{size:V.XXS,color:c.v2.colors.silver[200],children:Xo})}),t(Uc,{message:_o})]}),e(Hc,{children:[e(jc,{children:[t(X,{size:V.S,weight:500,color:c.v2.colors.white[500],children:Vo}),t(Gi,{size:16,fill:c.v2.colors.silver[200]})]}),t(Wc,{children:t($c,{name:Ho,recommended:!0,toggleLabel:Uo,enabled:o,onEnabledChange:n,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(Fc,{onNext:l,nextLoading:s})]})},gd=m.div`
429
+ `,ru=({errorPresetEnabled:n,onErrorPresetChange:a,onBack:i,onNext:l,submitting:s})=>{const c=f(),d=r(()=>x(n?{disabled:!1}:null),[n]);return e(o,{children:[t(Od,{title:jn,onBack:i}),e(Ed,{$width:854,children:[t(Vd,{children:Gn}),e(V,{$gap:8,$width:"100%",children:[e(Rd,{children:[t(su,{children:t(re,{size:ce.XXS,color:c.v2.colors.silver[200],children:Wn})}),t(zd,{message:Hn})]}),e(Md,{children:[e(Bd,{children:[t(re,{size:ce.S,weight:500,color:c.v2.colors.white[500],children:Kn}),t(Ni,{size:16,fill:c.v2.colors.silver[200]})]}),t(Xd,{children:t(xd,{name:Jn,recommended:!0,toggleLabel:Yn,enabled:n,onEnabledChange:a,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(Id,{onNext:l,nextLoading:s})]})},cu=g.div`
390
430
  white-space: pre-line;
391
- `,md=m.div`
431
+ `,du=g.div`
392
432
  width: fit-content;
393
- `,bd=["50","25","10","1","0.1"],fd=({value:a,onChange:o,label:n})=>{const i=b(),l=r(()=>bd.map(e=>({value:e,label:`${e}%`,selectedBgColor:i.v2.colors.purple[900],selectedBorderColor:i.v2.colors.purple[400]})),[i]);return e(C,{$gap:8,children:[t(X,{size:V.XS,color:i.v2.colors.white[500],children:n}),t(md,{children:t(H,{"data-id":"sampling-onboarding-ambient",size:Ie.L,options:l,selected:a,setSelected:o})})]})},vd=({errorPresetEnabled:o,onErrorPresetChange:n,ambientPercentage:i,onAmbientPercentageChange:l,onBack:s,onNext:c,submitting:d})=>{const p=b(),u=r(()=>Bo(o?{disabled:!1}:null),[o]);return e(a,{children:[t(Lc,{title:jo,onBack:s}),e(Dc,{$width:854,children:[t(Gc,{children:Wo}),e(C,{$gap:8,$width:"100%",children:[e(Bc,{children:[t(gd,{children:t(X,{size:V.XXS,color:p.v2.colors.silver[200],children:Go})}),t(Xc,{items:[Ko,Yo,Jo,qo,Zo]}),t(Uc,{message:_o})]}),e(Hc,{children:[e(jc,{children:[t(X,{size:V.S,weight:500,color:p.v2.colors.white[500],children:Qo}),t(Gi,{size:16,fill:p.v2.colors.silver[200]})]}),t(Wc,{children:t($c,{name:Ho,recommended:!0,toggleLabel:Uo,enabled:o,onEnabledChange:n,summary:u,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(Wc,{children:t(fd,{value:i,onChange:l,label:en})})]})]})]}),t(Fc,{onNext:c,nextLoading:d})]})},yd=({isOpen:e,onClose:a,k8sHealthProbesConfig:n,samplingId:i,docsUrl:s,updateK8sHealthProbesConfig:r,createHighlyRelevantOperationRule:d,createCostReductionRule:p})=>{const[u,h]=l("welcome"),[g,m]=l(!0),[b,f]=l("keep-list"),[v,y]=l(!0),[C,S]=l("25"),[w,k]=l(!1);o(()=>{e&&(h("welcome"),m(n?.enabled??!0),f("keep-list"),y(!0),S("25"),k(!1))},[e,n?.enabled]);const x=c(async()=>{const e=i??"default",t=[];g!==(n?.enabled??!1)&&t.push(r(g,n?.keepPercentage??0)),"advanced"!==b&&v&&t.push(d(e,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null})),"keep-list"===b&&t.push(p(e,{name:"Onboarding - Ambient sampling",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:parseFloat(C)})),k(!0);try{await Promise.all(t),h("success")}catch{}finally{k(!1)}},[i,r,g,n?.enabled,n?.keepPercentage,b,v,C,d,p]);let T=null;switch(u){case"welcome":T=t(ed,{onSkip:a,onNext:()=>h("noisy")});break;case"noisy":T=t(Yc,{enabled:g,onEnabledChange:m,onBack:()=>h("welcome"),onNext:()=>h("strategy")});break;case"strategy":T=t(dd,{strategy:b,onStrategyChange:f,onBack:()=>h("noisy"),onNext:()=>{h("keep-list"===b?"keep-list":"drop-list"===b?"drop-list":"advanced")},docsUrl:s});break;case"keep-list":T=t(vd,{errorPresetEnabled:v,onErrorPresetChange:y,ambientPercentage:C,onAmbientPercentageChange:S,onBack:()=>h("strategy"),onNext:x,submitting:w});break;case"drop-list":T=t(hd,{errorPresetEnabled:v,onErrorPresetChange:y,onBack:()=>h("strategy"),onNext:x,submitting:w});break;case"advanced":T=t(pd,{onBack:()=>h("strategy"),onNext:x,submitting:w});break;case"success":T=t(qc,{onClose:a})}return t(Na,{isOpen:e,onClose:a,children:T})};var Cd,Sd;!function(e){e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"}(Cd||(Cd={})),function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(Sd||(Sd={}));const wd=[{key:Sd.Name,label:"Name"},{key:Sd.Type,label:"Type",textAlign:"right"},{key:Sd.Status,label:"Status"},{key:Sd.OdigosVersion,label:"Odigos Version"},{key:Sd.ConnectedSince,label:"Connected Since"},{key:Sd.LastActivity,label:"Last Activity"}],kd=(e,t)=>{const a=e.find(e=>e.key===Sd.Id)?.rawValue;return t(a?.toString()||"")},xd=e=>{const{connections:t,configMinSupportedVersion:a,snapshotMinSupportedVersion:o,onDelete:n,onAddSource:i,onAddDestination:l,onAddAction:s,onAddInstrumentationRule:r,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===Sd.Status)?.rawValue===J.Success)(e))return[{id:Ta(),label:"Delete Connection",rightIcon:Ii,onClick:()=>kd(e,n)}];const d=kd(e,e=>{const o=t.find(t=>t.id===e);return!!o&&tn(o.odigosVersion,a)}),p=kd(e,e=>{const a=t.find(t=>t.id===e);return!!a&&tn(a.odigosVersion,o)}),u=[];return i&&u.push({id:Ta(),tooltip:p?be.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${o} or later.`,rightIcon:Xi,disabled:!p,onClick:()=>kd(e,i)}),l&&u.push({id:Ta(),tooltip:be.ADD_DESTINATION,rightIcon:Pi,onClick:()=>kd(e,l)}),s&&u.push({id:Ta(),tooltip:be.ADD_ACTION,rightIcon:Fi,onClick:()=>kd(e,s)}),r&&u.push({id:Ta(),tooltip:be.ADD_INSTRUMENTATION_RULE,rightIcon:zi,onClick:()=>kd(e,r)}),c&&u.push({id:Ta(),tooltip:d?"Edit Configuration":`To use this feature, please upgrade to Odigos v${a} or later.`,rightIcon:Ui,disabled:!d,onClick:()=>kd(e,c)}),u}},Td=({tableRowsMaxHeight:a,connections:n,getConnections:i,onClickConnection:s,deleteConnection:d,configMinSupportedVersion:p=0,getEffectiveConfig:u,applyConfigurations:h,snapshotMinSupportedVersion:g=0,getAllClusterSnapshots:m,persistSources:f,getDestinationCategories:v,getPotentialDestinations:y,testConnection:C,createDestination:S,updateDestination:w,createAction:k,createInstrumentationRule:x})=>{const T=b(),{isVm:E}=G(),{formatTimeAgo:N}=xt(),[$,I]=l(!1),[A,O]=l(n||[]),D=c(async()=>{try{I(!0),O(await i()??[])}catch(e){}finally{I(!1)}},[]);o(()=>{A.length||D()},[]);const[R,F]=l(""),[_,B]=l(null),[M,z]=l([]),X=r(()=>_===Cd.BulkConfig?p:_===Cd.BulkSource?g:0,[_,p,g]),{supportedConnections:V,supportedConnectionIds:U}=r(()=>{const e=((e,t)=>e.filter(e=>{const a=e.status===J.Success,o=tn(e.odigosVersion,t);return a&&o}))(A,X);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[A.length,X]);o(()=>{if(!_||_===Cd.Delete)return;const e=M.filter(e=>!U.includes(e));e.length&&z(t=>t.filter(t=>!e.includes(t)))},[_,M.length,U.length]);const H=r(()=>A.filter(e=>!R||e.name.toLowerCase().includes(R.toLowerCase())).map(e=>({cells:[{key:Sd.Id,rawValue:e.id},{key:Sd.Name,rawValue:e.name},{key:Sd.Type,rawValue:e.type},{key:Sd.Status,rawValue:e.status,component:()=>(e=>{const a=e===J.Success?"Connection live":"Connection lost",o=e===J.Success?Bi:Mi;return t(pe,{status:e,label:a,leftIcon:o})})(e.status)},{key:Sd.OdigosVersion,rawValue:e.odigosVersion},{key:Sd.ConnectedSince,rawValue:e.connectedAt?N(e.connectedAt):"-"},{key:Sd.LastActivity,rawValue:e.lastSeenAt?N(e.lastSeenAt):"-"}],onClick:e.status!==J.Success||_?void 0:()=>s(e),isSelected:M.includes(e.id),onSelect:()=>z(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>z(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==J.Success||_===Cd.BulkConfig&&!tn(e.odigosVersion,p)||_===Cd.BulkSource&&!tn(e.odigosVersion,g)})),[A,M,R,_,p,g]),j=r(()=>{const e=(e,t)=>{z([e]),B(t)};return xd({connections:A,configMinSupportedVersion:p,snapshotMinSupportedVersion:g,onDelete:t=>e(t,Cd.Delete),onAddSource:!E&&m&&f?t=>e(t,Cd.BulkSource):void 0,onAddDestination:!E&&v&&y&&S?t=>e(t,Cd.BulkDestination):void 0,onAddAction:!E&&k?t=>e(t,Cd.BulkAction):void 0,onAddInstrumentationRule:!E&&x?t=>e(t,Cd.BulkInstrumentationRule):void 0,onEditConfiguration:!E&&u&&h?t=>e(t,Cd.BulkConfig):void 0})},[E,A,p,u,h,g,m,f,v,y,S,k,x]),W=r(()=>(e=>{const{onCancel:t,onAddSource:a,onAddDestination:o,onAddAction:n,onAddInstrumentationRule:i,onManageConfigurations:l}=e,s=[];a&&s.push({id:Ta(),type:Pt.Button,buttonProps:{variant:L.Primary,size:P.S,label:"Add Sources",rightIcon:Xi,onClick:a}});const r=[o?{id:Cd.BulkDestination,label:be.ADD_DESTINATION,icon:Pi}:null,n?{id:Cd.BulkAction,label:be.ADD_ACTION,icon:Fi}:null,i?{id:Cd.BulkInstrumentationRule,label:be.ADD_INSTRUMENTATION_RULE,icon:zi}:null,l?{id:Cd.BulkConfig,label:"Manage Configurations",icon:Ui}:null];return r.some(Boolean)&&s.push({id:Ta(),type:Pt.ButtonDropData,buttonProps:{variant:L.Secondary,size:P.S,label:"Bulk Operations",onClick:e=>{e===Cd.BulkSource?a?.():e===Cd.BulkDestination?o?.():e===Cd.BulkAction?n?.():e===Cd.BulkInstrumentationRule?i?.():e===Cd.BulkConfig&&l?.()}},dropDataProps:{alignX:xa.Left,items:r}}),s.push({id:Ta(),type:Pt.Button,buttonProps:{variant:L.Text,size:P.S,label:dt.CANCEL,onClick:t}}),s})({onCancel:()=>z([]),onAddSource:!E&&m&&f?()=>B(Cd.BulkSource):void 0,onAddDestination:!E&&v&&y&&S?()=>B(Cd.BulkDestination):void 0,onAddAction:!E&&k?()=>B(Cd.BulkAction):void 0,onAddInstrumentationRule:!E&&x?()=>B(Cd.BulkInstrumentationRule):void 0,onManageConfigurations:!E&&u&&h?()=>B(Cd.BulkConfig):void 0}),[E,u,h,m,f,v,y,S,k,x]);return t(an,{children:e(Ae,{richTitle:{icon:sl,title:be.CONNECTIONS,badge:{label:A.length.toString(),status:Je.Unknown}},search:{placeholder:"Search by cluster name",value:R,onChange:e=>F(e),width:"300px"},actions:[{id:Ta(),type:Pt.Button,buttonProps:{variant:L.Secondary,size:P.S,leftIcon:Wi,onClick:D,disabled:$}}],children:[t(on,{variant:nn.Pretty,maxHeight:a,headerBackgroundColor:T.v2.colors.silver[1e3],isLoading:$,withCheckboxes:!0,columns:wd,rows:H,rowActionsPushRightPosition:_?`calc(${Ol} - 24px)`:void 0,getRowActions:j}),_===Cd.BulkConfig&&u&&h&&t(Us,{onClose:()=>B(null),connections:V,selectedConnectionIds:M,setSelectedConnectionIds:z,getEffectiveConfig:u,onApply:h}),_===Cd.BulkSource&&m&&f&&t(ln,{selectedConnectionIds:M,children:t(Xs,{onClose:()=>B(null),selectedConnectionIds:M,setSelectedConnectionIds:z,getAllClusterSnapshots:m,persistSources:async e=>await(f?.(e))})}),_===Cd.BulkDestination&&v&&y&&C&&S&&w&&t(sn,{children:t(Ds,{onClose:()=>B(null),selectedConnectionIds:M,setSelectedConnectionIds:z,getDestinationCategories:v,getPotentialDestinations:y,testConnection:e=>C(e,M),createDestination:e=>S(e,M),updateDestination:(e,t)=>w(e,t,M)})}),_===Cd.BulkAction&&k&&t(rn,{children:t(ws,{onClose:()=>B(null),selectedConnectionIds:M,setSelectedConnectionIds:z,createAction:e=>k(e,M)})}),_===Cd.BulkInstrumentationRule&&x&&t(cn,{children:t(Rs,{onClose:()=>B(null),selectedConnectionIds:M,setSelectedConnectionIds:z,createInstrumentationRule:e=>x(e,M)})}),t($l,{target:"connection",isOpen:_===Cd.Delete,onClose:()=>{z([]),B(null)},onApprove:async()=>{const e=M[0];e&&(await d(e),await D())}}),t(dn,{isOpen:!!M.length&&!_,richTitle:{icon:Ni,title:"Selected Clusters",badge:{label:M.length}},actions:W})]})})},Ed=m.div`
433
+ `,uu=["50","25","10","1","0.1"],pu=({value:o,onChange:n,label:a})=>{const i=f(),l=r(()=>uu.map(e=>({value:e,label:`${e}%`,selectedBgColor:i.v2.colors.purple[900],selectedBorderColor:i.v2.colors.purple[400]})),[i]);return e(V,{$gap:8,children:[t(re,{size:ce.XS,color:i.v2.colors.white[500],children:a}),t(du,{children:t(ue,{"data-id":"sampling-onboarding-ambient",options:l,selected:o,setSelected:n})})]})},hu=({errorPresetEnabled:n,onErrorPresetChange:a,ambientPercentage:i,onAmbientPercentageChange:l,onBack:s,onNext:c,submitting:d})=>{const u=f(),p=r(()=>x(n?{disabled:!1}:null),[n]);return e(o,{children:[t(Od,{title:qn,onBack:s}),e(Ed,{$width:854,children:[t(Vd,{children:Zn}),e(V,{$gap:8,$width:"100%",children:[e(Rd,{children:[t(cu,{children:t(re,{size:ce.XXS,color:u.v2.colors.silver[200],children:Qn})}),t(Ld,{items:[ea,ta,oa,na,aa]}),t(zd,{message:Hn})]}),e(Md,{children:[e(Bd,{children:[t(re,{size:ce.S,weight:500,color:u.v2.colors.white[500],children:ia}),t(Ni,{size:16,fill:u.v2.colors.silver[200]})]}),t(Xd,{children:t(xd,{name:Jn,recommended:!0,toggleLabel:Yn,enabled:n,onEnabledChange:a,summary:p,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(Xd,{children:t(pu,{value:i,onChange:l,label:la})})]})]})]}),t(Id,{onNext:c,nextLoading:d})]})},mu=({isOpen:e,onClose:o,k8sHealthProbesConfig:a,samplingId:i,docsUrl:s,updateK8sHealthProbesConfig:r,createHighlyRelevantOperationRule:d,createCostReductionRule:u})=>{const[p,h]=l("welcome"),[m,g]=l(!0),[f,b]=l("keep-list"),[v,y]=l(!0),[C,S]=l("25"),[w,x]=l(!1);n(()=>{e&&(h("welcome"),g(a?.enabled??!0),b("keep-list"),y(!0),S("25"),x(!1))},[e,a?.enabled]);const k=c(async()=>{const e=i??"default",t=[];m!==(a?.enabled??!1)&&t.push(r(m,a?.keepPercentage??0)),"advanced"!==f&&v&&t.push(d(e,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null})),"keep-list"===f&&t.push(u(e,{name:"Onboarding - Ambient sampling",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:parseFloat(C)})),x(!0);try{await Promise.all(t),h("success")}catch{}finally{x(!1)}},[i,r,m,a?.enabled,a?.keepPercentage,f,v,C,d,u]);let T=null;switch(p){case"welcome":T=t(Yd,{onSkip:o,onNext:()=>h("noisy")});break;case"noisy":T=t(Hd,{enabled:m,onEnabledChange:g,onBack:()=>h("welcome"),onNext:()=>h("strategy")});break;case"strategy":T=t(iu,{strategy:f,onStrategyChange:b,onBack:()=>h("noisy"),onNext:()=>{h("keep-list"===f?"keep-list":"drop-list"===f?"drop-list":"advanced")},docsUrl:s});break;case"keep-list":T=t(hu,{errorPresetEnabled:v,onErrorPresetChange:y,ambientPercentage:C,onAmbientPercentageChange:S,onBack:()=>h("strategy"),onNext:k,submitting:w});break;case"drop-list":T=t(ru,{errorPresetEnabled:v,onErrorPresetChange:y,onBack:()=>h("strategy"),onNext:k,submitting:w});break;case"advanced":T=t(lu,{onBack:()=>h("strategy"),onNext:k,submitting:w});break;case"success":T=t(Gd,{onClose:o})}return t(Lo,{isOpen:e,onClose:o,children:T})};var gu,fu;!function(e){e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"}(gu||(gu={})),function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(fu||(fu={}));const bu=[{key:fu.Name,label:"Name"},{key:fu.Type,label:"Type",textAlign:"right"},{key:fu.Status,label:"Status"},{key:fu.OdigosVersion,label:"Odigos Version"},{key:fu.ConnectedSince,label:"Connected Since"},{key:fu.LastActivity,label:"Last Activity"}],vu=(e,t)=>{const o=e.find(e=>e.key===fu.Id)?.rawValue;return t(o?.toString()||"")},yu=e=>{const{connections:t,configMinSupportedVersion:o,snapshotMinSupportedVersion:n,onDelete:a,onAddSource:i,onAddDestination:l,onAddAction:s,onAddInstrumentationRule:r,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===fu.Status)?.rawValue===ge.Success)(e))return[{id:Fo(),label:"Delete Connection",rightIcon:ci,onClick:()=>vu(e,a)}];const d=vu(e,e=>{const n=t.find(t=>t.id===e);return!!n&&k(n.odigosVersion,o)}),u=vu(e,e=>{const o=t.find(t=>t.id===e);return!!o&&k(o.odigosVersion,n)}),p=[];return i&&p.push({id:Fo(),tooltip:u?Re.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${n} or later.`,rightIcon:Si,disabled:!u,onClick:()=>vu(e,i)}),l&&p.push({id:Fo(),tooltip:Re.ADD_DESTINATION,rightIcon:gi,onClick:()=>vu(e,l)}),s&&p.push({id:Fo(),tooltip:Re.ADD_ACTION,rightIcon:mi,onClick:()=>vu(e,s)}),r&&p.push({id:Fo(),tooltip:Re.ADD_INSTRUMENTATION_RULE,rightIcon:Ci,onClick:()=>vu(e,r)}),c&&p.push({id:Fo(),tooltip:d?"Edit Configuration":`To use this feature, please upgrade to Odigos v${o} or later.`,rightIcon:xi,disabled:!d,onClick:()=>vu(e,c)}),p}},Cu=({tableRowsMaxHeight:o,connections:a,getConnections:i,onClickConnection:s,deleteConnection:d,configMinSupportedVersion:u=0,getEffectiveConfig:p,applyConfigurations:h,snapshotMinSupportedVersion:m=0,getAllClusterSnapshots:g,persistSources:b,getDestinationCategories:v,getPotentialDestinations:C,testConnection:S,createDestination:w,updateDestination:x,createAction:T,createInstrumentationRule:$})=>{const E=f(),{isVm:N}=y(),{formatTimeAgo:I}=Ot(),[A,O]=l(!1),[D,R]=l(a||[]),F=c(async()=>{try{O(!0),R(await i()??[])}catch(e){}finally{O(!1)}},[]);n(()=>{D.length||F()},[]);const[P,L]=l(""),[_,z]=l(null),[M,B]=l([]),X=r(()=>_===gu.BulkConfig?u:_===gu.BulkSource?m:0,[_,u,m]),{supportedConnections:V,supportedConnectionIds:U}=r(()=>{const e=((e,t)=>e.filter(e=>{const o=e.status===ge.Success,n=k(e.odigosVersion,t);return o&&n}))(D,X);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[D.length,X]);n(()=>{if(!_||_===gu.Delete)return;const e=M.filter(e=>!U.includes(e));e.length&&B(t=>t.filter(t=>!e.includes(t)))},[_,M.length,U.length]);const H=r(()=>D.filter(e=>!P||e.name.toLowerCase().includes(P.toLowerCase())).map(e=>({cells:[{key:fu.Id,rawValue:e.id},{key:fu.Name,rawValue:e.name},{key:fu.Type,rawValue:e.type},{key:fu.Status,rawValue:e.status,component:()=>(e=>{const o=e===ge.Success?"Connection live":"Connection lost",n=e===ge.Success?vi:yi;return t(Ie,{status:e,label:o,leftIcon:n})})(e.status)},{key:fu.OdigosVersion,rawValue:e.odigosVersion},{key:fu.ConnectedSince,rawValue:e.connectedAt?I(e.connectedAt):"-"},{key:fu.LastActivity,rawValue:e.lastSeenAt?I(e.lastSeenAt):"-"}],onClick:e.status!==ge.Success||_?void 0:()=>s(e),isSelected:M.includes(e.id),onSelect:()=>B(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>B(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==ge.Success||_===gu.BulkConfig&&!k(e.odigosVersion,u)||_===gu.BulkSource&&!k(e.odigosVersion,m)})),[D,M,P,_,u,m]),j=r(()=>{const e=(e,t)=>{B([e]),z(t)};return yu({connections:D,configMinSupportedVersion:u,snapshotMinSupportedVersion:m,onDelete:t=>e(t,gu.Delete),onAddSource:!N&&g&&b?t=>e(t,gu.BulkSource):void 0,onAddDestination:!N&&v&&C&&w?t=>e(t,gu.BulkDestination):void 0,onAddAction:!N&&T?t=>e(t,gu.BulkAction):void 0,onAddInstrumentationRule:!N&&$?t=>e(t,gu.BulkInstrumentationRule):void 0,onEditConfiguration:!N&&p&&h?t=>e(t,gu.BulkConfig):void 0})},[N,D,u,p,h,m,g,b,v,C,w,T,$]),G=r(()=>(e=>{const{onCancel:t,onAddSource:o,onAddDestination:n,onAddAction:a,onAddInstrumentationRule:i,onManageConfigurations:l}=e,s=[];o&&s.push({id:Fo(),type:Xt.Button,buttonProps:{variant:ae.Primary,size:ne.S,label:"Add Sources",rightIcon:Si,onClick:o}});const r=[n?{id:gu.BulkDestination,label:Re.ADD_DESTINATION,icon:gi}:null,a?{id:gu.BulkAction,label:Re.ADD_ACTION,icon:mi}:null,i?{id:gu.BulkInstrumentationRule,label:Re.ADD_INSTRUMENTATION_RULE,icon:Ci}:null,l?{id:gu.BulkConfig,label:"Manage Configurations",icon:xi}:null];return r.some(Boolean)&&s.push({id:Fo(),type:Xt.ButtonDropData,buttonProps:{variant:ae.Secondary,size:ne.S,label:"Bulk Operations",onClick:e=>{e===gu.BulkSource?o?.():e===gu.BulkDestination?n?.():e===gu.BulkAction?a?.():e===gu.BulkInstrumentationRule?i?.():e===gu.BulkConfig&&l?.()}},dropDataProps:{alignX:Ro.Left,items:r}}),s.push({id:Fo(),type:Xt.Button,buttonProps:{variant:ae.Text,size:ne.S,label:bt.CANCEL,onClick:t}}),s})({onCancel:()=>B([]),onAddSource:!N&&g&&b?()=>z(gu.BulkSource):void 0,onAddDestination:!N&&v&&C&&w?()=>z(gu.BulkDestination):void 0,onAddAction:!N&&T?()=>z(gu.BulkAction):void 0,onAddInstrumentationRule:!N&&$?()=>z(gu.BulkInstrumentationRule):void 0,onManageConfigurations:!N&&p&&h?()=>z(gu.BulkConfig):void 0}),[N,p,h,g,b,v,C,w,T,$]);return t(sa,{children:e(Ue,{richTitle:{icon:ji,title:Re.CONNECTIONS,badge:{label:D.length.toString(),status:st.Unknown}},search:{placeholder:"Search by cluster name",value:P,onChange:e=>L(e),width:"300px"},actions:[{id:Fo(),type:Xt.Button,buttonProps:{variant:ae.Secondary,size:ne.S,leftIcon:$i,onClick:F,disabled:A}}],children:[t(so,{variant:ro.Pretty,maxHeight:o,headerBackgroundColor:E.v2.colors.silver[1e3],isLoading:A,withCheckboxes:!0,columns:bu,rows:H,rowActionsPushRightPosition:_?`calc(${gl} - 24px)`:void 0,getRowActions:j}),_===gu.BulkConfig&&p&&h&&t(nr,{onClose:()=>z(null),connections:V,selectedConnectionIds:M,setSelectedConnectionIds:B,getEffectiveConfig:p,onApply:h}),_===gu.BulkSource&&g&&b&&t(Ol,{selectedConnectionIds:M,children:t(tr,{onClose:()=>z(null),selectedConnectionIds:M,setSelectedConnectionIds:B,getAllClusterSnapshots:g,persistSources:async e=>await(b?.(e))})}),_===gu.BulkDestination&&v&&C&&S&&w&&x&&t(Dl,{children:t(Fs,{onClose:()=>z(null),selectedConnectionIds:M,setSelectedConnectionIds:B,getDestinationCategories:v,getPotentialDestinations:C,testConnection:e=>S(e,M),createDestination:e=>w(e,M),updateDestination:(e,t)=>x(e,t,M)})}),_===gu.BulkAction&&T&&t(Rl,{children:t(ks,{onClose:()=>z(null),selectedConnectionIds:M,setSelectedConnectionIds:B,createAction:e=>T(e,M)})}),_===gu.BulkInstrumentationRule&&$&&t(Fl,{children:t(Ps,{onClose:()=>z(null),selectedConnectionIds:M,setSelectedConnectionIds:B,createInstrumentationRule:e=>$(e,M)})}),t(pl,{target:"connection",isOpen:_===gu.Delete,onClose:()=>{B([]),z(null)},onApprove:async()=>{const e=M[0];e&&(await d(e),await F())}}),t(ra,{isOpen:!!M.length&&!_,richTitle:{icon:si,title:"Selected Clusters",badge:{label:M.length}},actions:G})]})})},Su=g.div`
394
434
  display: flex;
395
435
  align-items: center;
396
436
  justify-content: space-between;
@@ -399,26 +439,26 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
399
439
  width: calc(100% - 32px);
400
440
  border-radius: 16px;
401
441
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
402
- `,Nd=m.div`
442
+ `,wu=g.div`
403
443
  display: flex;
404
444
  align-items: center;
405
445
  justify-content: center;
406
446
  padding: 8px;
407
447
  border-radius: 8px;
408
- background-color: ${({theme:e})=>e.v2.colors.white[500]+Re["004"]};
409
- `,$d=({setStep:a,onSave:o,sourcesPayload:n,destinationsPayload:i,disableAnimation:l})=>{const s=b(),c=()=>a(2),d=()=>a(3),p=r(()=>Object.values(n||{}).flatMap((a,o)=>a.map((a,n)=>{if(!a.selected)return null;const i=a.kind||nt.Namespace,l=i===nt.Namespace?a.namespace:`${a.namespace} → ${a.name}`;return e(Ed,{children:[t(X,{nowrap:!0,children:l}),t(pe,{label:i,status:J.Info,backgroundColor:s.v2.colors.blue[900]})]},`source-${o}-${n}`)})).filter(Boolean),[n]),u=r(()=>i?.map((a,o)=>{const n=Ue(a.option.type).icon;return e(Ed,{children:[e(R,{$gap:8,children:[n&&t(Nd,{children:t(n,{size:24})}),t(X,{nowrap:!0,children:a.formData.name||a.option.displayName})]}),void 0!==a.testResult&&t(pe,{status:a.testResult.succeeded?J.Success:J.Error,leftIcon:a.testResult.succeeded?Bi:Mi})]},`destination-${o}`)})||[],[i]);return t(Nl,{isOpen:!0,disableAnimation:l,onBack:()=>a(3),onSave:o,header:{icon:Ki,title:be.SUMMARY,subTitle:be.REVIEW_SETUP},leftColumn:{width:"50%",header:e(R,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(R,{$gap:8,children:[t(Xi,{size:24}),t(X,{nowrap:!0,children:be.SELECTED_SOURCES}),t(pe,{label:p.length})]}),t(F,{"data-id":"summary-edit-sources",leftIcon:Ai,variant:L.Secondary,size:P.S,onClick:c})]}),list:p.length?p:[t(Le,{$height:"100%",children:t(z,{icon:Xi,title:be.NO_SOURCES_SELECTED,subTitle:be.ADD_SOURCE_PROMPT,button:{leftIcon:Ti,label:be.ADD_SOURCE,onClick:c}})},"no-sources-data")]},rightColumn:{width:"50%",header:e(R,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(R,{$gap:8,children:[t(Pi,{size:24}),t(X,{nowrap:!0,children:be.SELECTED_DESTINATIONS}),t(pe,{label:u.length})]}),t(F,{"data-id":"summary-edit-destinations",leftIcon:Ai,variant:L.Secondary,size:P.S,onClick:d})]}),list:u.length?u:[t(Le,{"data-id":"summary-no-destinations",$height:"100%",children:t(z,{icon:Pi,title:be.NO_DESTINATIONS_SELECTED,subTitle:be.ADD_DESTINATION_PROMPT,button:{leftIcon:Ti,label:be.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},Id=m.div`
448
+ background-color: ${({theme:e})=>e.v2.colors.white[500]+je["004"]};
449
+ `,xu=({setStep:o,onSave:n,sourcesPayload:a,destinationsPayload:i,disableAnimation:l})=>{const s=f(),c=()=>o(2),d=()=>o(3),u=r(()=>Object.values(a||{}).flatMap((o,n)=>o.map((o,a)=>{if(!o.selected)return null;const i=o.kind||lt.Namespace,l=i===lt.Namespace?o.namespace:`${o.namespace} → ${o.name}`;return e(Su,{children:[t(re,{nowrap:!0,children:l}),t(Ie,{label:i,status:ge.Info,backgroundColor:s.v2.colors.blue[900]})]},`source-${n}-${a}`)})).filter(Boolean),[a]),p=r(()=>i?.map((o,n)=>{const a=tt(o.option.type).icon;return e(Su,{children:[e(te,{$gap:8,children:[a&&t(wu,{children:t(a,{size:24})}),t(re,{nowrap:!0,children:o.formData.name||o.option.displayName})]}),void 0!==o.testResult&&t(Ie,{status:o.testResult.succeeded?ge.Success:ge.Error,leftIcon:o.testResult.succeeded?vi:yi})]},`destination-${n}`)})||[],[i]);return t(ul,{isOpen:!0,disableAnimation:l,onBack:()=>o(3),onSave:n,header:{icon:Ei,title:Re.SUMMARY,subTitle:Re.REVIEW_SETUP},leftColumn:{width:"50%",header:e(te,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(te,{$gap:8,children:[t(Si,{size:24}),t(re,{nowrap:!0,children:Re.SELECTED_SOURCES}),t(Ie,{label:u.length})]}),t(oe,{"data-id":"summary-edit-sources",leftIcon:di,variant:ae.Secondary,size:ne.S,onClick:c})]}),list:u.length?u:[t(Ke,{$height:"100%",children:t(se,{icon:Si,title:Re.NO_SOURCES_SELECTED,subTitle:Re.ADD_SOURCE_PROMPT,button:{leftIcon:ii,label:Re.ADD_SOURCE,onClick:c}})},"no-sources-data")]},rightColumn:{width:"50%",header:e(te,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(te,{$gap:8,children:[t(gi,{size:24}),t(re,{nowrap:!0,children:Re.SELECTED_DESTINATIONS}),t(Ie,{label:p.length})]}),t(oe,{"data-id":"summary-edit-destinations",leftIcon:di,variant:ae.Secondary,size:ne.S,onClick:d})]}),list:p.length?p:[t(Ke,{"data-id":"summary-no-destinations",$height:"100%",children:t(se,{icon:gi,title:Re.NO_DESTINATIONS_SELECTED,subTitle:Re.ADD_DESTINATION_PROMPT,button:{leftIcon:ii,label:Re.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},ku=g.div`
410
450
  position: relative;
411
451
  overflow: hidden;
412
452
  width: calc(100vw - ${({$paddingXAxis:e})=>e});
413
453
  height: calc(100vh - ${({$paddingYAxis:e})=>e});
414
454
  box-sizing: border-box;
415
- `,Ad=m.svg`
455
+ `,Tu=g.svg`
416
456
  position: absolute;
417
457
  top: 50%;
418
458
  left: 50%;
419
459
  transform: translate(-50%, -50%);
420
460
  z-index: -1;
421
- `,Od=[{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"}],Dd=[{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:Od},{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:Od},{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:Od}],Rd=({paddingXAxis:a="0px",paddingYAxis:n="0px",children:i})=>{const[s,c]=l(window.innerWidth),d=r(()=>s/Dd[0].width,[s]);return o(()=>{const e=()=>c(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(Id,{$paddingXAxis:a,$paddingYAxis:n,children:[Dd.map(({width:a,height:o,pathOpacity:n,path:i,gradientTransform:l,stops:s},r)=>{const c=`purple-ring-${r}`;return e(Ad,{width:a*d,height:"100%",viewBox:`0 0 ${a} ${o}`,fill:"none",children:[t("path",{opacity:n,d:i,fill:`url(#${c})`}),t("defs",{children:t("radialGradient",{id:c,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:l,children:s.map(({offset:e,opacity:a},o)=>t("stop",{offset:e,stopColor:"#7C3BFF",stopOpacity:a},o))})})]},c)}),i]})},Fd=m.div`
461
+ `,$u=[{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"}],Eu=[{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:$u},{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:$u},{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:$u}],Nu=({paddingXAxis:o="0px",paddingYAxis:a="0px",children:i})=>{const[s,c]=l(window.innerWidth),d=r(()=>s/Eu[0].width,[s]);return n(()=>{const e=()=>c(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(ku,{$paddingXAxis:o,$paddingYAxis:a,children:[Eu.map(({width:o,height:n,pathOpacity:a,path:i,gradientTransform:l,stops:s},r)=>{const c=`purple-ring-${r}`;return e(Tu,{width:o*d,height:"100%",viewBox:`0 0 ${o} ${n}`,fill:"none",children:[t("path",{opacity:a,d:i,fill:`url(#${c})`}),t("defs",{children:t("radialGradient",{id:c,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:l,children:s.map(({offset:e,opacity:o},n)=>t("stop",{offset:e,stopColor:"#7C3BFF",stopOpacity:o},n))})})]},c)}),i]})},Iu=g.div`
422
462
  display: flex;
423
463
  flex-direction: column;
424
464
  align-items: center;
@@ -429,7 +469,7 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
429
469
  width: 50vw;
430
470
  border-radius: 16px;
431
471
  background: ${({theme:e})=>e.v2.colors.silver[900]};
432
- `,Pd=m.div`
472
+ `,Au=g.div`
433
473
  display: flex;
434
474
  flex-direction: column;
435
475
  align-items: center;
@@ -439,15 +479,15 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
439
479
  & * {
440
480
  text-align: center;
441
481
  }
442
- `,Ld=({onStart:a})=>t(ct,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(Le,{$height:"100%",children:e(Fd,{children:[e(Pd,{children:[t(X,{size:V.L,weight:500,children:be.GET_STARTED_WITH}),t(Al,{size:260}),t(X,{size:V.S,weight:400,children:be.GET_STARTED_DESCRIPTION})]}),t(F,{"data-id":"onboarding-get-started",label:dt.GET_STARTED,rightIcon:nl,size:P.L,onClick:a})]})})}),_d=[{step:1,label:be.INSTALLATION,forceDoneBadge:!0},{step:2,label:be.SOURCES_SETUP},{step:3,label:be.DESTINATIONS_SETUP},{step:4,label:be.SUMMARY}],Bd=m.div`
482
+ `,Ou=({onStart:o})=>t(ft,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(Ke,{$height:"100%",children:e(Iu,{children:[e(Au,{children:[t(re,{size:ce.L,weight:500,children:Re.GET_STARTED_WITH}),t(ml,{size:260}),t(re,{size:ce.S,weight:400,children:Re.GET_STARTED_DESCRIPTION})]}),t(oe,{"data-id":"onboarding-get-started",label:bt.GET_STARTED,rightIcon:Vi,size:ne.L,onClick:o})]})})}),Du=[{step:1,label:Re.INSTALLATION,forceDoneBadge:!0},{step:2,label:Re.SOURCES_SETUP},{step:3,label:Re.DESTINATIONS_SETUP},{step:4,label:Re.SUMMARY}],Ru=g.div`
443
483
  display: flex;
444
484
  flex-direction: column;
445
485
  gap: 32px;
446
486
  padding: 64px;
447
- `,Md=({pagePaddingXAxis:a,pagePaddingYAxis:o,fetchNamespacesWithWorkloads:n,persistSources:i,getDestinationCategories:s,getPotentialDestinations:r,testConnection:c,createDestination:d,updateDestination:p,onDone:u})=>{const{setCurrentModal:h}=Ea(),[g,m]=l(1),[b,f]=l(!1),[v,y]=l(null),[C,S]=l(null),w=()=>m(e=>e+1),k=()=>m(e=>e-1);return e(Rd,{paddingXAxis:a,paddingYAxis:o,children:[e(Bd,{children:[t(Al,{useInline:!0}),t(pn,{currentStep:g,data:_d,gap:32})]}),t(ln,{initialInputs:v,children:e(sn,{children:[1===g&&t(Ld,{onStart:w}),2===g&&t(Xs,{disableAnimation:!0,onBack:e=>{y(e),k()},onNext:e=>{y(e),w()},fetchNamespacesWithWorkloads:n,persistSources:i}),3===g&&t(Ds,{disableAnimation:!0,onBack:e=>{S(e),k()},onNext:e=>{S(e),w()},getDestinationCategories:s,getPotentialDestinations:r,initialInputs:C,testConnection:c,createDestination:d,updateDestination:p}),4===g&&t($d,{disableAnimation:!0,setStep:m,onSave:async()=>{if(!b){f(!0);try{const e=[];v&&e.push(i(v)),C&&e.push(...C.map(e=>d(e.formData)));const t=await Promise.allSettled(e),a=[];for(const e of t)"rejected"===e.status?a.push(e.reason?.message||String(e.reason)):e.value?.error&&a.push(e.value.error);if(a.length)return{error:a.join("\n")};h(xc),u()}catch(e){return f(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:v,destinationsPayload:C})]})})]})},zd=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),Xd=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},Vd=m.div`
487
+ `,Fu=({pagePaddingXAxis:o,pagePaddingYAxis:n,fetchNamespacesWithWorkloads:a,persistSources:i,getDestinationCategories:s,getPotentialDestinations:r,testConnection:c,createDestination:d,updateDestination:u,onDone:p})=>{const{setCurrentModal:h}=Po(),[m,g]=l(1),[f,b]=l(!1),[v,y]=l(null),[C,S]=l(null),w=()=>g(e=>e+1),x=()=>g(e=>e-1);return e(Nu,{paddingXAxis:o,paddingYAxis:n,children:[e(Ru,{children:[t(ml,{useInline:!0}),t(ca,{currentStep:m,data:Du,gap:32})]}),t(Ol,{initialInputs:v,children:e(Dl,{children:[1===m&&t(Ou,{onStart:w}),2===m&&t(tr,{disableAnimation:!0,onBack:e=>{y(e),x()},onNext:e=>{y(e),w()},fetchNamespacesWithWorkloads:a,persistSources:i}),3===m&&t(Fs,{disableAnimation:!0,onBack:e=>{S(e),x()},onNext:e=>{S(e),w()},getDestinationCategories:s,getPotentialDestinations:r,initialInputs:C,testConnection:c,createDestination:d,updateDestination:u}),4===m&&t(xu,{disableAnimation:!0,setStep:g,onSave:async()=>{if(!f){b(!0);try{const e=[];v&&e.push(i(v)),C&&e.push(...C.map(e=>d(e.formData)));const t=await Promise.allSettled(e),o=[];for(const e of t)"rejected"===e.status?o.push(e.reason?.message||String(e.reason)):e.value?.error&&o.push(e.value.error);if(o.length)return{error:o.join("\n")};h(yd),p()}catch(e){return b(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:v,destinationsPayload:C})]})})]})},Pu=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),Lu=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},_u=g.div`
448
488
  position: relative;
449
489
  display: inline-flex;
450
- `,Ud=m.button`
490
+ `,zu=g.button`
451
491
  display: inline-flex;
452
492
  align-items: center;
453
493
  gap: 8px;
@@ -460,7 +500,7 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
460
500
  &:hover {
461
501
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
462
502
  }
463
- `,Hd=m.div`
503
+ `,Mu=g.div`
464
504
  position: absolute;
465
505
  top: calc(100% + 8px);
466
506
  right: 0;
@@ -473,28 +513,28 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
473
513
  border-radius: 12px;
474
514
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
475
515
  box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
476
- `,jd=m.div`
516
+ `,Bu=g.div`
477
517
  display: flex;
478
518
  flex-direction: column;
479
519
  gap: 12px;
480
520
  padding: 16px;
481
521
  max-height: 60vh;
482
522
  overflow-y: auto;
483
- `,Wd=m.div`
523
+ `,Xu=g.div`
484
524
  display: flex;
485
525
  align-items: center;
486
526
  gap: 8px;
487
527
  padding: 12px 16px;
488
528
  border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
489
- `,Gd=m.div`
529
+ `,Vu=g.div`
490
530
  display: flex;
491
531
  align-items: center;
492
532
  gap: 8px;
493
533
  margin-left: auto;
494
- `,Kd=()=>{const a=b(),n=We(e=>e.sources),i=We(e=>e.namespaces),{selectedStreamName:s}=fe(),{getItemSS:c,setItemSS:p,removeItemSS:u}=bn(),{namespaces:h,kinds:g,monitors:m,languages:f,onlyErrors:v,podsAgentInjectionStatus:y,setAll:C,clearAll:S,getEmptyState:w}=un(),k=r(()=>hn(n,s),[n,s]);o(()=>{const e=c(gn.OVERVIEW_FILTERS,w());C(e)},[]);const[x,T]=l({namespaces:h,kinds:g,monitors:m,languages:f,onlyErrors:v,podsAgentInjectionStatus:y}),[E,N]=l(Xd(x)),[$,A]=l(!1);o(()=>{if(!$){const e={namespaces:h,kinds:g,monitors:m,languages:f,onlyErrors:v,podsAgentInjectionStatus:y};T(e),N(Xd(e))}},[$,h,g,m,f,v,y]);const O=d(null);Kt(O,()=>A(!1)),Ca({key:"Escape",active:$},()=>A(!1));const D=r(()=>{const e=new Set,t=[];return i.forEach(({name:a})=>{e.has(a)||(e.add(a),t.push({id:a,label:a,withCheckbox:!0}))}),t},[i]),R=r(()=>{const e=new Set,t=[];return k.forEach(({kind:a})=>{e.has(a)||(e.add(a),t.push({id:a,label:a,withCheckbox:!0}))}),t},[k]),_=r(()=>{const e=new Set,t=[];return k.forEach(({detectedLanguages:a})=>{a?.forEach(a=>{e.has(a)||(e.add(a),t.push({id:a,label:ue[a]||a,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[k]),B=r(()=>mn.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),M=r(()=>{const e=new Set,t=[];return k.forEach(({podsAgentInjectionStatus:a})=>{const{reasonEnum:o,message:n}=a||{};if(o){if(e.has(o))return;e.add(o),t.push({id:o,label:yt(o)})}else if(n){if(e.has(n))return;e.add(n),t.push({id:n,label:n,withCheckbox:!0})}}),t},[k]),z=(e,t,a)=>{const o=t.filter(e=>a.includes(e.id));T(t=>{return{...t,[e]:(a=o,a.map(({id:e,label:t})=>({id:e,label:t})))};var a})},U=$?Li:_i,H=r(()=>zd(x.languages),[x.languages]);return e(Vd,{ref:O,children:[e(Ud,{"data-id":"filters-trigger",$isOpen:$,type:"button",onClick:()=>A(e=>!e),children:[t(rl,{size:16,fill:a.v2.colors.white[500]}),t(X,{size:V.XS,weight:500,nowrap:!0,children:"Filters"}),E>0&&t(pe,{label:E,status:Je.Unknown,textSize:V.XXXS}),t(U,{size:16,fill:a.v2.colors.silver[200]})]}),$&&e(Hd,{children:[e(jd,{children:[t(Be,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!D.length,options:D,values:zd(x.namespaces),setValues:e=>z("namespaces",D,e)}),t(Be,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!R.length,options:R,values:zd(x.kinds),setValues:e=>z("kinds",R,e)}),t(Be,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!_.length,options:_,values:H,setValues:e=>z("languages",_,e)}),t(Be,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!B.length,options:B,values:zd(x.monitors),setValues:e=>z("monitors",B,e)}),t(Be,{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!M.length,options:M,values:zd(x.podsAgentInjectionStatus),setValues:e=>z("podsAgentInjectionStatus",M,e)}),t(I,{label:"Show only sources with errors",size:Ze.L,value:!!x.onlyErrors,onChange:e=>T(t=>({...t,onlyErrors:e}))})]}),e(Wd,{children:[t(F,{"data-id":"filters-reset",size:P.S,variant:L.Text,label:"Reset",onClick:()=>{u(gn.OVERVIEW_FILTERS),S(),T(w()),N(0),A(!1)},textColor:a.v2.colors.red[500]}),e(Gd,{children:[t(F,{"data-id":"filters-cancel",size:P.S,variant:L.Secondary,label:"Cancel",onClick:()=>A(!1)}),t(F,{"data-id":"filters-apply",size:P.S,variant:L.Primary,label:"Apply",onClick:()=>{p(gn.OVERVIEW_FILTERS,x),C(x),N(Xd(x)),A(!1)}})]})]})]})]})},Yd="40vw",Jd=m.div`
534
+ `,Uu=()=>{const o=f(),a=at(e=>e.sources),i=at(e=>e.namespaces),{selectedStreamName:s}=Fe(),{getItemSS:c,setItemSS:u,removeItemSS:p}=ma(),{namespaces:h,kinds:m,monitors:g,languages:b,onlyErrors:v,podsAgentInjectionStatus:y,setAll:C,clearAll:S,getEmptyState:w}=da(),x=r(()=>ua(a,s),[a,s]);n(()=>{const e=c(pa.OVERVIEW_FILTERS,w());C(e)},[]);const[k,T]=l({namespaces:h,kinds:m,monitors:g,languages:b,onlyErrors:v,podsAgentInjectionStatus:y}),[$,E]=l(Lu(k)),[N,I]=l(!1);n(()=>{if(!N){const e={namespaces:h,kinds:m,monitors:g,languages:b,onlyErrors:v,podsAgentInjectionStatus:y};T(e),E(Lu(e))}},[N,h,m,g,b,v,y]);const A=d(null);eo(A,()=>I(!1)),Io({key:"Escape",active:N},()=>I(!1));const O=r(()=>{const e=new Set,t=[];return i.forEach(({name:o})=>{e.has(o)||(e.add(o),t.push({id:o,label:o,withCheckbox:!0}))}),t},[i]),D=r(()=>{const e=new Set,t=[];return x.forEach(({id:o})=>{const{kind:n}=o;e.has(n)||(e.add(n),t.push({id:n,label:n,withCheckbox:!0}))}),t},[x]),R=r(()=>{const e=new Set,t=[];return x.forEach(({runtimeInfo:o})=>{o?.detectedLanguages?.forEach(o=>{e.has(o)||(e.add(o),t.push({id:o,label:Ae[o]||o,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[x]),F=r(()=>ha.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),P=r(()=>{const e=new Set,t=[];return x.forEach(({podsAgentInjectionStatus:o})=>{const{reasonEnum:n,message:a}=o||{};if(n){if(e.has(n))return;e.add(n),t.push({id:n,label:$t(n)})}else if(a){if(e.has(a))return;e.add(a),t.push({id:a,label:a,withCheckbox:!0})}}),t},[x]),L=(e,t,o)=>{const n=t.filter(e=>o.includes(e.id));T(t=>{return{...t,[e]:(o=n,o.map(({id:e,label:t})=>({id:e,label:t})))};var o})},_=N?fi:bi,z=r(()=>Pu(k.languages),[k.languages]);return e(_u,{ref:A,children:[e(zu,{"data-id":"filters-trigger",$isOpen:N,type:"button",onClick:()=>I(e=>!e),children:[t(Gi,{size:16,fill:o.v2.colors.white[500]}),t(re,{size:ce.XS,weight:500,nowrap:!0,children:"Filters"}),$>0&&t(Ie,{label:$,status:st.Unknown,textSize:ce.XXXS}),t(_,{size:16,fill:o.v2.colors.silver[200]})]}),N&&e(Mu,{children:[e(Bu,{children:[t(Je,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!O.length,options:O,values:Pu(k.namespaces),setValues:e=>L("namespaces",O,e)}),t(Je,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!D.length,options:D,values:Pu(k.kinds),setValues:e=>L("kinds",D,e)}),t(Je,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!R.length,options:R,values:z,setValues:e=>L("languages",R,e)}),t(Je,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!F.length,options:F,values:Pu(k.monitors),setValues:e=>L("monitors",F,e)}),t(Je,{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!P.length,options:P,values:Pu(k.podsAgentInjectionStatus),setValues:e=>L("podsAgentInjectionStatus",P,e)}),t(q,{label:"Show only sources with errors",size:ct.L,value:!!k.onlyErrors,onChange:e=>T(t=>({...t,onlyErrors:e}))})]}),e(Xu,{children:[t(oe,{"data-id":"filters-reset",size:ne.S,variant:ae.Text,label:"Reset",onClick:()=>{p(pa.OVERVIEW_FILTERS),S(),T(w()),E(0),I(!1)},textColor:o.v2.colors.red[500]}),e(Vu,{children:[t(oe,{"data-id":"filters-cancel",size:ne.S,variant:ae.Secondary,label:"Cancel",onClick:()=>I(!1)}),t(oe,{"data-id":"filters-apply",size:ne.S,variant:ae.Primary,label:"Apply",onClick:()=>{u(pa.OVERVIEW_FILTERS,k),C(k),E(Lu(k)),I(!1)}})]})]})]})]})},Hu="40vw",ju=g.div`
495
535
  position: relative;
496
- width: ${Yd};
497
- `,qd=m.div`
536
+ width: ${Hu};
537
+ `,Gu=g.div`
498
538
  position: absolute;
499
539
  top: calc(100% + 8px);
500
540
  left: 0;
@@ -503,23 +543,23 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
503
543
  flex-direction: column;
504
544
  gap: 8px;
505
545
  padding: 8px;
506
- width: calc(${Yd} - 16px);
546
+ width: calc(${Hu} - 16px);
507
547
  border-radius: 12px;
508
548
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
509
549
  box-shadow: 0 12px 24px 24px rgba(0, 0, 0, 0.5);
510
- `,Zd=m.div`
550
+ `,Wu=g.div`
511
551
  display: flex;
512
552
  align-items: center;
513
553
  overflow-x: auto;
514
- `,Qd=m.div`
554
+ `,Ku=g.div`
515
555
  display: flex;
516
556
  flex-direction: column;
517
557
  gap: 0;
518
558
  max-height: 60vh;
519
559
  overflow-y: auto;
520
- `,ep=m.div`
560
+ `,Yu=g.div`
521
561
  padding: 8px 12px 4px 12px;
522
- `,tp=m.div`
562
+ `,Ju=g.div`
523
563
  display: flex;
524
564
  align-items: center;
525
565
  gap: 8px;
@@ -529,9 +569,9 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
529
569
  &:hover {
530
570
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
531
571
  }
532
- `,ap=m.div`
572
+ `,qu=g.div`
533
573
  padding: 16px 8px;
534
- `,op=({preventPopup:a=!1})=>{const o=b(),{onClickNode:i}=fn(),{searchText:s,setSearchText:c}=un(),{selectedStreamName:p}=fe(),u=We(e=>e.sources),h=We(e=>e.destinations),g=We(e=>e.actions),m=We(e=>e.instrumentationRules),f=d(null),[v,y]=l(!1),[C,S]=l("all"),w=!a&&(!!s||v),k=()=>{c(""),y(!1),S("all")};Kt(f,()=>k()),Ca({key:"Escape",active:w},k);const{categories:x,searchResults:T}=r(()=>(({instrumentationRules:e,sources:t,actions:a,destinations:o,searchText:n,selectedCategory:i})=>{const l=n?e.filter(e=>e.type?.toLowerCase().includes(n)||e.ruleName?.toLowerCase().includes(n)):e,s=n?t.filter(e=>e.name?.toLowerCase().includes(n)||e.otelServiceName?.toLowerCase().includes(n)||e.namespace?.toLowerCase().includes(n)):t,r=n?a.filter(e=>e.type?.toLowerCase().includes(n)||e.name?.toLowerCase().includes(n)):a,c=n?o.filter(e=>e.destinationType.displayName?.toLowerCase().includes(n)||e.name?.toLowerCase().includes(n)):o,d=[{category:nt.Source,label:"Sources",count:s.length,entities:[]},{category:nt.Action,label:"Actions",count:r.length,entities:[]},{category:nt.Destination,label:"Destinations",count:c.length,entities:[]},{category:nt.InstrumentationRule,label:"Instrumentation Rules",count:l.length,entities:[]}];d.unshift({category:"all",label:"All",count:l.length+s.length+r.length+c.length,entities:[]});const p=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(i)).map(e=>({...e,entities:e.category===nt.InstrumentationRule?l:e.category===nt.Source?s:e.category===nt.Action?r:e.category===nt.Destination?c:[]}));return{categories:d,searchResults:p}})({instrumentationRules:m,sources:hn(u,p),actions:g,destinations:ft(h,p),searchText:s,selectedCategory:C}),[m,u,g,h,p,s,C]),E=r(()=>x.filter(({count:e,category:t})=>!!e||"all"===t).map(({category:e,label:t,count:a})=>({value:e,label:a?`${t} (${a})`:t})),[x]),N=T.some(({entities:e})=>e.length>0);return e(Jd,{ref:f,children:[t(Lt,{value:s,onChange:e=>c(e.toLowerCase()),onFocus:()=>y(!0),width:Yd}),w&&e(qd,{children:[E.length>1&&t(Zd,{children:t(H,{size:Ie.S,fullWidth:!0,options:E,selected:C,setSelected:S})}),N?t(Qd,{children:T.map(({category:a,label:l,entities:s},r)=>{if(!s.length)return null;const c=yn(a);return e(n,{children:[t(ep,{children:t(X,{size:V.XXS,color:te.Secondary,children:l})}),s.map((n,l)=>e(tp,{onClick:()=>{const e=rt(n);i(null,{data:{type:a,id:e}}),k()},children:[c&&t(c,{size:16,fill:o.v2.colors.white[500]}),t(X,{size:V.XS,nowrap:!0,children:vn(n,a,{extended:!0})})]},`entity-${r}-${l}`))]},`category-list-${a}`)})}):t(ap,{children:t(z,{hideIcon:!0,title:"No results",subTitle:s?`No matches for "${s}"`:"Start typing to search"})})]})]})},np=m.div`
574
+ `,Zu=({preventPopup:o=!1})=>{const n=f(),{onClickNode:i}=ga(),{searchText:s,setSearchText:c}=da(),{selectedStreamName:u}=Fe(),p=at(e=>e.sources),h=at(e=>e.destinations),m=at(e=>e.actions),g=at(e=>e.instrumentationRules),b=d(null),[v,y]=l(!1),[C,S]=l("all"),w=!o&&(!!s||v),x=()=>{c(""),y(!1),S("all")};eo(b,()=>x()),Io({key:"Escape",active:w},x);const{categories:k,searchResults:T}=r(()=>(({instrumentationRules:e,sources:t,actions:o,destinations:n,searchText:a,selectedCategory:i})=>{const l=a?e.filter(e=>e.type?.toLowerCase().includes(a)||e.ruleName?.toLowerCase().includes(a)):e,s=a?t.filter(e=>e.id.name?.toLowerCase().includes(a)||e.serviceName?.toLowerCase().includes(a)||e.id.namespace?.toLowerCase().includes(a)):t,r=a?o.filter(e=>e.type?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):o,c=a?n.filter(e=>e.destinationType.displayName?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):n,d=[{category:lt.Source,label:"Sources",count:s.length,entities:[]},{category:lt.Action,label:"Actions",count:r.length,entities:[]},{category:lt.Destination,label:"Destinations",count:c.length,entities:[]},{category:lt.InstrumentationRule,label:"Instrumentation Rules",count:l.length,entities:[]}];d.unshift({category:"all",label:"All",count:l.length+s.length+r.length+c.length,entities:[]});const u=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(i)).map(e=>({...e,entities:e.category===lt.InstrumentationRule?l:e.category===lt.Source?s:e.category===lt.Action?r:e.category===lt.Destination?c:[]}));return{categories:d,searchResults:u}})({instrumentationRules:g,sources:ua(p,u),actions:m,destinations:kt(h,u),searchText:s,selectedCategory:C}),[g,p,m,h,u,s,C]),$=r(()=>k.filter(({count:e,category:t})=>!!e||"all"===t).map(({category:e,label:t,count:o})=>({value:e,label:o?`${t} (${o})`:t})),[k]),E=T.some(({entities:e})=>e.length>0);return e(ju,{ref:b,children:[t(Vt,{value:s,onChange:e=>c(e.toLowerCase()),onFocus:()=>y(!0),width:Hu}),w&&e(Gu,{children:[$.length>1&&t(Wu,{children:t(ue,{options:$,selected:C,setSelected:S})}),E?t(Ku,{children:T.map(({category:o,label:l,entities:s},r)=>{if(!s.length)return null;const c=ba(o);return e(a,{children:[t(Yu,{children:t(re,{size:ce.XXS,color:Ce.Secondary,children:l})}),s.map((a,l)=>e(Ju,{onClick:()=>{const e=gt(a);i(null,{data:{type:o,id:e}}),x()},children:[c&&t(c,{size:16,fill:n.v2.colors.white[500]}),t(re,{size:ce.XS,nowrap:!0,children:fa(a,o,{extended:!0})})]},`entity-${r}-${l}`))]},`category-list-${o}`)})}):t(qu,{children:t(se,{hideIcon:!0,title:"No results",subTitle:s?`No matches for "${s}"`:"Start typing to search"})})]})]})},Qu=g.div`
535
575
  position: relative;
536
576
  display: flex;
537
577
  align-items: center;
@@ -542,7 +582,7 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
542
582
  box-sizing: border-box;
543
583
  border-radius: 16px 16px 0 0;
544
584
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
545
- `,ip=m.div`
585
+ `,ep=g.div`
546
586
  position: absolute;
547
587
  bottom: 0;
548
588
  left: 0;
@@ -551,7 +591,7 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
551
591
  background-color: ${({theme:e})=>e.v2.colors.purple[500]};
552
592
  border-radius: 32px;
553
593
  transition: width 0.3s;
554
- `,lp=({entityType:a,badge:o,badgeTooltip:n,isLoading:i,refetch:l,partiallySelected:s,allSelected:r,onSelectAll:c,progressPercent:d})=>{const{setCurrentModal:p}=Ea();return e(np,{children:[e(R,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(w,{size:Cn.S,partiallyChecked:s,value:!!r,onChange:c}),t(X,{size:V.S,nowrap:!0,children:`${yt(a)}s`}),t(pe,{label:o,tooltip:n,status:Je.Unknown,textSize:V.XXXS})]}),e(R,{children:[t(Me,{"data-id":`add-${a}`,icon:Ti,onClick:()=>p(a)}),t(Me,{"data-id":`refresh-${a}`,icon:Wi,onClick:l,disabled:i})]}),"number"==typeof d&&t(ip,{$percent:d})]})},sp=m(C)`
594
+ `,tp=({entityType:o,badge:n,badgeTooltip:a,isLoading:i,refetch:l,partiallySelected:s,allSelected:r,onSelectAll:c,progressPercent:d})=>{const{setCurrentModal:u}=Po();return e(Qu,{children:[e(te,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(H,{size:va.S,partiallyChecked:s,value:!!r,onChange:c}),t(re,{size:ce.S,nowrap:!0,children:`${$t(o)}s`}),t(Ie,{label:n,tooltip:a,status:st.Unknown,textSize:ce.XXXS})]}),e(te,{children:[t(qe,{"data-id":`add-${o}`,icon:ii,onClick:()=>u(o)}),t(qe,{"data-id":`refresh-${o}`,icon:$i,onClick:l,disabled:i})]}),"number"==typeof d&&t(ep,{$percent:d})]})},op=g(V)`
555
595
  align-items: center !important;
556
596
  justify-content: center !important;
557
597
  align-self: stretch;
@@ -566,7 +606,7 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
566
606
  &:hover {
567
607
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
568
608
  }
569
- `,rp=({entityType:a,description:o})=>{const{setCurrentModal:n}=Ea();return e(sp,{onClick:()=>n(a),children:[e(R,{$gap:4,children:[t(Ti,{size:16}),t(X,{size:V.S,children:`Add ${yt(a)}`})]}),t(X,{size:V.XXS,align:"center",children:o})]})},cp=m.div`
609
+ `,np=({entityType:o,description:n})=>{const{setCurrentModal:a}=Po();return e(op,{onClick:()=>a(o),children:[e(te,{$gap:4,children:[t(ii,{size:16}),t(re,{size:ce.S,children:`Add ${$t(o)}`})]}),t(re,{size:ce.XXS,align:"center",children:n})]})},ap=g.div`
570
610
  display: flex;
571
611
  align-items: center;
572
612
  gap: 12px;
@@ -581,10 +621,10 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
581
621
  &:hover {
582
622
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
583
623
  }
584
- `,dp=m(R)`
624
+ `,ip=g(te)`
585
625
  flex: 1;
586
626
  min-width: 0;
587
- `,pp=({entityId:a,entityType:o,title:n,status:i,faded:l,tooltip:s,throughput:c,icon:d,icons:p,iconSrc:u,isActive:h,raw:g})=>{const m=b(),f=o===nt.Source,v="boolean"==typeof h,y=l||v&&!h,{setDrawerType:C,setDrawerEntityId:S}=Bt(),{selectedSources:k,setSelectedSources:x}=Sn(),T=g,E=f?T.namespace:"",N=r(()=>{if(!f)return-1;const e=k[E];return e?.length?e.findIndex(e=>e.name===T.name&&e.kind===T.kind):-1},[f,k,E,T.name,T.kind]),$=v&&!h?kn(J.Info,m):i?kn(i,m):void 0,I=f&&"object"==typeof a?`${a.namespace}-${a.name}-${a.kind}`:a;return e(cp,{"data-id":I,$faded:y,onClick:()=>{C(o),S(a)},children:[f&&t(w,{size:Cn.S,value:-1!==N,onChange:()=>{const e={...k};e[E]||(e[E]=[]),-1===N?e[E].push(T):e[E].splice(N,1),x(e)}}),t(Vt,{icons:p,icon:d,iconSrc:u}),e(dp,{$gap:4,children:[t(wn,{size:V.XS,nowrap:!0,children:n}),t(R,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:c&&t(oe,{text:s||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:t(pe,{label:c,status:i&&[J.Error,J.Warning].includes(i)?i:Je.Unknown,leftIcon:$,textSize:V.XXXS})})})]})]})};function up(e){const t=e.conditions?.some(({status:e})=>e===Dt.Loading);return t?e:{...e,conditions:[{status:Dt.Loading,type:"Pending",message:""}]}}function hp(e){const t=e.conditions?.filter(({status:e})=>e!==Dt.Loading);return t?.length===e.conditions?.length?e:{...e,conditions:t?.length?t:[]}}const gp=m.div`
627
+ `,lp=({entityId:o,entityType:n,title:a,status:i,faded:l,tooltip:s,throughput:c,icon:d,icons:u,iconSrc:p,isActive:h,raw:m})=>{const g=f(),b=n===lt.Source,v="boolean"==typeof h,y=l||v&&!h,{setDrawerType:C,setDrawerEntityId:S}=Ht(),{selectedSources:w,setSelectedSources:x}=ya(),k=m,T=b?k.id.namespace:"",$=r(()=>{if(!b)return-1;const e=w[T];return e?.length?e.findIndex(e=>e.id.name===k.id.name&&e.id.kind===k.id.kind):-1},[b,w,T,k.id]),E=v&&!h?Sa(ge.Info,g):i?Sa(i,g):void 0,N=b&&"object"==typeof o?`${o.namespace}-${o.name}-${o.kind}`:o;return e(ap,{"data-id":N,$faded:y,onClick:()=>{C(n),S(o)},children:[b&&t(H,{size:va.S,value:-1!==$,onChange:()=>{const e={...w};e[T]||(e[T]=[]),-1===$?e[T].push(k):e[T].splice($,1),x(e)}}),t(Kt,{icons:u,icon:d,iconSrc:p}),e(ip,{$gap:4,children:[t(Ca,{size:ce.XS,nowrap:!0,children:a}),t(te,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:c&&t(we,{text:s||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:t(Ie,{label:c,status:i&&[ge.Error,ge.Warning].includes(i)?i:st.Unknown,leftIcon:E,textSize:ce.XXXS})})})]})]})};function sp(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===Mt.Loading)?e:{...e,workloadOdigosHealthStatus:{status:Ft.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function rp(e){const t=Object.values(e.conditions??{}).filter(Boolean),o=t.filter(({status:e})=>e!==Mt.Loading);return o?.length===t?.length?e:{...e,conditions:o?.length?o.reduce((e,t)=>(e[t.name]=t,e),{}):{}}}const cp=g.div`
588
628
  position: absolute;
589
629
  top: 0;
590
630
  left: 0;
@@ -595,22 +635,22 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
595
635
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
596
636
  border-bottom: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
597
637
  pointer-events: none;
598
- `,mp=m.div`
638
+ `,dp=g.div`
599
639
  display: flex;
600
640
  align-items: center;
601
641
  gap: 8px;
602
642
  padding: 4px 8px 0;
603
- `,bp=m.div`
643
+ `,up=g.div`
604
644
  flex: 1;
605
645
  height: 1px;
606
646
  background: ${({theme:e})=>e.v2.colors.silver[700]};
607
- `,fp=({namespace:e})=>{const a=b();return t(gp,{children:t(X,{size:V.XXS,nowrap:!0,color:a.v2.colors.grey[300],children:e})})},vp=({namespace:a})=>{const o=b();return e(mp,{children:[t(bp,{}),t(X,{size:V.XXS,nowrap:!0,color:o.v2.colors.grey[300],children:a}),t(bp,{})]})},yp={[nt.InstrumentationRule]:be.NO_DATA_INSTRUMENTATION_RULES,[nt.Source]:be.NO_DATA_SOURCES,[nt.Action]:be.NO_DATA_ACTIONS,[nt.Destination]:be.NO_DATA_DESTINATIONS},Cp=m.div`
647
+ `,pp=({namespace:e})=>{const o=f();return t(cp,{children:t(re,{size:ce.XXS,nowrap:!0,color:o.v2.colors.grey[300],children:e})})},hp=({namespace:o})=>{const n=f();return e(dp,{children:[t(up,{}),t(re,{size:ce.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:o}),t(up,{})]})},mp={[lt.InstrumentationRule]:Re.NO_DATA_INSTRUMENTATION_RULES,[lt.Source]:Re.NO_DATA_SOURCES,[lt.Action]:Re.NO_DATA_ACTIONS,[lt.Destination]:Re.NO_DATA_DESTINATIONS},gp=g.div`
608
648
  display: flex;
609
649
  flex-direction: column;
610
650
  flex: 1 0 0;
611
651
  min-width: 0;
612
652
  ${({$isVm:e})=>e?"width: 45vw;":""}
613
- `,Sp=m.div`
653
+ `,fp=g.div`
614
654
  display: flex;
615
655
  flex-direction: column;
616
656
  align-items: stretch;
@@ -620,7 +660,7 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
620
660
  border-radius: 0 0 16px 16px;
621
661
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
622
662
  overflow: hidden;
623
- `,wp=m.div`
663
+ `,bp=g.div`
624
664
  position: relative;
625
665
  display: flex;
626
666
  flex-direction: column;
@@ -632,16 +672,16 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
632
672
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
633
673
  height: ${({$height:e})=>e}px;
634
674
  overflow: hidden;
635
- `,kp=(e,t,a,o)=>{const n=rt(e);if(!n)return null;const i=t===nt.Source;let l,s,r=!1,c=e;if(i){const t=function(e){const t=e.workloadOdigosHealthStatus?.status;switch(t){case Nt.Failure:return{status:J.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case Nt.Notice:return{status:J.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case Nt.Pending:case Nt.Waiting:return{status:void 0,faded:!1,displaySource:up(e)};case Nt.Unsupported:case Nt.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return{status:void 0,faded:!1,displaySource:hp(e)}}}(e);l=t.status,r=t.faded,s=t.tooltip,c=t.displaySource}else{const{priorotizedStatus:t,hasDisableds:a}=En(e.conditions||[]);l=t,r=a}const d=vn(e,t,{extended:i,prioritizeDisplayName:!i});let p,u,h,g,m;switch(t){case nt.Source:{p=Xt(e),u=yn(nt.Source);const t=o?.get(Nn(n));g=Ut(t);break}case nt.Destination:{const t=Ue(e.destinationType.type);u=t.icon,h=t.iconSrc;const a=o?.get(Nn(n));g=Ut(a),m=!e.disabled;break}case nt.Action:u=gt(e.type),m=!e.disabled;break;case nt.InstrumentationRule:u=kt(e.type),m=!e.disabled}return{key:Nn(n),entityId:n,namespace:i?e.namespace:void 0,raw:c,itemProps:{entityId:n,entityType:t,title:d,status:l,faded:r,tooltip:s,throughput:g,icon:u,icons:p,iconSrc:h,isActive:m,raw:c}}},xp=({entityType:a,entities:n,unfilteredCount:i,metrics:s,loading:d,maxHeight:p,refetch:u})=>{const{isVm:h}=G(),g=a===nt.Source,m=n.length!==i,b=at(e=>g?e.progress[it.Instrumenting]?.percentage:void 0),f=at(e=>g?e.progress[it.Uninstrumenting]?.percentage:void 0),v=!g||void 0===b&&void 0===f?void 0:b||f||0,{selectedSources:y,setSelectedSources:C}=Sn(),S=r(()=>g?Object.values(y).reduce((e,t)=>e+t.length,0):0,[g,y]),w=r(()=>{if(!s)return;const e=new Map,t=a===nt.Source?s.sources:a===nt.Destination?s.destinations:void 0;if(t)for(const a of t)e.set(xn(a),a.throughput);return e},[s,a]),k=r(()=>n.map(e=>kp(e,a,0,w)).filter(Boolean),[n,a,w,h]),[x,T]=l(""),{elements:E,indexToNamespace:N,multipleNs:$,dividerCount:I}=r(()=>{const e=[],a=[],o=new Set(k.map(e=>e.namespace).filter(Boolean)).size>1;o&&(a.push(""),e.push(t("div",{style:{height:24}},"ns-spacer")));let n=0,i="";for(const o of k)g&&o.namespace&&o.namespace!==i&&(""!==i&&(a.push(o.namespace),e.push(t(vp,{namespace:o.namespace},`ns-divider-${o.namespace}`)),n+=1),i=o.namespace),a.push(o.namespace||""),e.push(t(pp,{...o.itemProps},o.key));return{elements:e,indexToNamespace:a,multipleNs:o,dividerCount:n}},[k,g]);o(()=>{if(g&&N.length&&!x){const e=N.find(Boolean);e&&T(e)}},[g,N]);const A=c(e=>{if(!N.length)return;const t=N[Math.min(e,N.length-1)];t&&t!==x&&T(t)},[N,x]);if(h&&[nt.InstrumentationRule,nt.Action].includes(a))return null;const O=58*k.length+($?28:0)+32*I,D=Math.max(0,p-52-16),R=Math.min(D,O)+8,F="number"==typeof v?`${v}%`:m?`${n.length}/${i}`:i;return e(Cp,{$isVm:h,children:[t(lp,{entityType:a,badge:F,badgeTooltip:m?be.FILTERED_COUNT_TOOLTIP:void 0,isLoading:d,refetch:u,partiallySelected:S>0&&n?.length!==S,allSelected:S>0&&n?.length===S,onSelectAll:g?e=>{if(g)if(e){const e={};n?.forEach(t=>{const{namespace:a}=t;e[a]?e[a].push(t):e[a]=[t]}),C(e)}else C({})}:void 0,progressPercent:v}),t(Sp,{children:n.length?e(wp,{$height:R,children:[$&&x&&t(fp,{namespace:x}),t(_t,{gap:4,elements:E,onTopIndexChange:$?A:void 0})]}):d?t(Tn,{size:3}):t(rp,{entityType:a,description:yp[a]??be.TO_COLLECT_OTEL_DATA})})]})},Tp=m.div`
675
+ `,vp=(e,t,o,n)=>{const a=gt(e);if(!a)return null;const i=t===lt.Source;let l,s,r=!1,c=e;if(i){const t=function(e){const t=e.workloadOdigosHealthStatus?.status;switch(t){case Ft.Failure:return{status:ge.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case Ft.Notice:return{status:ge.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case Ft.Pending:case Ft.Waiting:return{status:void 0,faded:!1,displaySource:sp(e)};case Ft.Unsupported:case Ft.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return{status:void 0,faded:!1,displaySource:rp(e)}}}(e);l=t.status,r=t.faded,s=t.tooltip,c=t.displaySource}else{const{priorotizedStatus:t,hasDisableds:o}=ka(e.conditions);l=t,r=o}const d=fa(e,t,{extended:i,prioritizeDisplayName:!i});let u,p,h,m,g;switch(t){case lt.Source:{u=Wt(e),p=ba(lt.Source);const t=n?.get(Ta(a));m=Yt(t);break}case lt.Destination:{const t=tt(e.destinationType.type);p=t.icon,h=t.iconSrc;const o=n?.get(Ta(a));m=Yt(o),g=!e.disabled;break}case lt.Action:p=St(e.type),g=!e.disabled;break;case lt.InstrumentationRule:p=At(e.type),g=!e.disabled}return{key:Ta(a),entityId:a,namespace:i?e.id.namespace:void 0,raw:c,itemProps:{entityId:a,entityType:t,title:d,status:l,faded:r,tooltip:s,throughput:m,icon:p,icons:u,iconSrc:h,isActive:g,raw:c}}},yp=({entityType:o,entities:a,unfilteredCount:i,metrics:s,loading:d,maxHeight:u,refetch:p})=>{const{isVm:h}=y(),m=o===lt.Source,g=a.length!==i,f=ut(e=>m?e.progress[pt.Instrumenting]?.percentage:void 0),b=ut(e=>m?e.progress[pt.Uninstrumenting]?.percentage:void 0),v=!m||void 0===f&&void 0===b?void 0:f||b||0,{selectedSources:C,setSelectedSources:S}=ya(),w=r(()=>m?Object.values(C).reduce((e,t)=>e+t.length,0):0,[m,C]),x=r(()=>{if(!s)return;const e=new Map,t=o===lt.Source?s.sources:o===lt.Destination?s.destinations:void 0;if(t)for(const o of t)e.set(wa(o),o.throughput);return e},[s,o]),k=r(()=>a.map(e=>vp(e,o,0,x)).filter(Boolean),[a,o,x,h]),[T,$]=l(""),{elements:E,indexToNamespace:N,multipleNs:I,dividerCount:A}=r(()=>{const e=[],o=[],n=new Set(k.map(e=>e.namespace).filter(Boolean)).size>1;n&&(o.push(""),e.push(t("div",{style:{height:24}},"ns-spacer")));let a=0,i="";for(const n of k)m&&n.namespace&&n.namespace!==i&&(""!==i&&(o.push(n.namespace),e.push(t(hp,{namespace:n.namespace},`ns-divider-${n.namespace}`)),a+=1),i=n.namespace),o.push(n.namespace||""),e.push(t(lp,{...n.itemProps},n.key));return{elements:e,indexToNamespace:o,multipleNs:n,dividerCount:a}},[k,m]);n(()=>{if(m&&N.length&&!T){const e=N.find(Boolean);e&&$(e)}},[m,N]);const O=c(e=>{if(!N.length)return;const t=N[Math.min(e,N.length-1)];t&&t!==T&&$(t)},[N,T]);if(h&&[lt.InstrumentationRule,lt.Action].includes(o))return null;const D=58*k.length+(I?28:0)+32*A,R=Math.max(0,u-52-16),F=Math.min(R,D)+8,P="number"==typeof v?`${v}%`:g?`${a.length}/${i}`:i;return e(gp,{$isVm:h,children:[t(tp,{entityType:o,badge:P,badgeTooltip:g?Re.FILTERED_COUNT_TOOLTIP:void 0,isLoading:d,refetch:p,partiallySelected:w>0&&a?.length!==w,allSelected:w>0&&a?.length===w,onSelectAll:m?e=>{if(m)if(e){const e={};a?.forEach(t=>{const{namespace:o}=t.id;e[o]?e[o].push(t):e[o]=[t]}),S(e)}else S({})}:void 0,progressPercent:v}),t(fp,{children:a.length?e(bp,{$height:F,children:[I&&T&&t(pp,{namespace:T}),t(Ut,{gap:4,elements:E,onTopIndexChange:I?O:void 0})]}):d?t(xa,{size:3}):t(np,{entityType:o,description:mp[o]??Re.TO_COLLECT_OTEL_DATA})})]})},Cp=g.div`
636
676
  width: 100%;
637
677
  height: ${({$height:e})=>e||"auto"};
638
678
  display: flex;
639
679
  align-items: stretch;
640
680
  gap: 16px;
641
- `,Ep=({height:a,metrics:o,refetchSources:n,refetchDestinations:i,refetchActions:l,refetchInstrumentationRules:s})=>{const c=un(),{selectedStreamName:d}=fe(),{containerRef:p,containerHeight:u}=$n(),h=We(e=>e.sources),g=We(e=>e.sourcesLoading),m=We(e=>e.destinations),b=We(e=>e.destinationsLoading),f=We(e=>e.actions),v=We(e=>e.actionsLoading),y=We(e=>e.instrumentationRules),C=We(e=>e.instrumentationRulesLoading),S=r(()=>hn(h,d),[h,d]),w=r(()=>ft(m,d),[m,d]),k=r(()=>In(S,c),[S,c]),x=r(()=>An(w,c),[w,c]),T=r(()=>On(f,c),[f,c]);return e(Tp,{ref:p,$height:a,children:[t(xp,{entityType:nt.InstrumentationRule,entities:y,unfilteredCount:y.length,loading:C,maxHeight:u,refetch:s}),t(xp,{entityType:nt.Source,entities:k,unfilteredCount:S.length,metrics:o,loading:g,maxHeight:u,refetch:n}),t(xp,{entityType:nt.Action,entities:T,unfilteredCount:f.length,loading:v,maxHeight:u,refetch:l}),t(xp,{entityType:nt.Destination,entities:x,unfilteredCount:w.length,metrics:o,loading:b,maxHeight:u,refetch:i})]})},Np=({effectiveConfig:o,fetchNamespacesWithWorkloads:n,persistSources:i,restartWorkloads:l,restartPod:s,recoverFromRollback:r,updateSource:c,fetchSourceById:d,fetchPeerSources:p,enableProfiling:u,fetchProfilingSlots:h,fetchSourceProfiling:g,getDestinationCategories:m,getPotentialDestinations:b,testConnection:f,createDestination:v,updateDestination:y,deleteDestination:C,createInstrumentationRule:S,updateInstrumentationRule:w,deleteInstrumentationRule:k,createAction:x,updateAction:T,deleteAction:E})=>{const{currentModal:N,setCurrentModal:$}=Ea(),{drawerType:I,drawerEntityId:A,setDrawerType:O,setDrawerEntityId:D}=Bt(),R=()=>{$(""),O(null),D(null)};return e(a,{children:[t(Tc,{}),N===nt.Source&&t(ln,{children:t(Xs,{onClose:R,fetchNamespacesWithWorkloads:n,persistSources:i,withOverlay:!0})}),N===nt.Destination&&t(sn,{children:t(Ds,{onClose:R,getDestinationCategories:m,getPotentialDestinations:b,testConnection:f,createDestination:v,updateDestination:y,withOverlay:!0})}),N===nt.InstrumentationRule&&t(cn,{children:t(Rs,{onClose:R,createInstrumentationRule:S,withOverlay:!0})}),N===nt.Action&&t(rn,{children:t(ws,{onClose:R,createAction:x,withOverlay:!0})}),I===nt.Source&&A&&t(Dn,{children:t(qr,{onClose:R,sourceId:A,persistSources:i,restartWorkloads:l,restartPod:s,recoverFromRollback:r,updateSource:c,fetchSourceById:d,fetchPeerSources:p,profilingFeatureIsConfigured:o?.profiling?.enabled||!1,enableProfiling:u,fetchSourceProfiling:g,fetchProfilingSlots:h})}),I===nt.Destination&&A&&t(sn,{children:t(Hs,{onClose:R,destinationId:A,getDestinationCategories:m,testConnection:f,updateDestination:y,deleteDestination:C})}),I===nt.InstrumentationRule&&A&&t(cn,{children:t(js,{onClose:R,ruleId:A,updateInstrumentationRule:w,deleteInstrumentationRule:k})}),I===nt.Action&&A&&t(rn,{children:t(Vs,{onClose:R,actionId:A,updateAction:T,deleteAction:E})})]})},$p="multi-source-deselect",Ip="multi-source-restart",Ap="multi-source-uninstrument",Op="Selected sources",Dp="Deselect",Rp="Restart",Fp="Uninstrument",Pp="Rollout Restart Workloads",Lp="Are you sure you want to rollout restart these workloads?",_p="Go Back",Bp="Confirm",Mp=({restartWorkloads:n,persistSources:i})=>{const{selectedStreamName:s}=fe(),{selectedSources:d,setSelectedSources:p}=Sn(),[u,h]=l(!1),[g,m]=l(!1),b=r(()=>Object.values(d).reduce((e,t)=>e+t.length,0),[d]),f=c(()=>{p({})},[p]),v=c(()=>h(!1),[]),y=c(()=>m(!1),[]);o(()=>{f()},[s,f]);const C=c(()=>{n(Object.values(d).flat().filter(e=>e.kind!==ea.StaticPod).map(Mt)),f()},[n,d,f]),S=c(()=>{i(Object.fromEntries(Object.entries(d).map(([e,t])=>[e,t.map(({namespace:e,name:t,kind:a})=>({namespace:e,name:t,kind:a||void 0,selected:!1,currentStreamName:s}))]))),f()},[i,d,s,f]),w=r(()=>[{id:$p,type:Pt.Button,buttonProps:{variant:L.Text,size:P.S,label:Dp,onClick:f}},{id:Ip,type:Pt.Button,buttonProps:{variant:L.Secondary,size:P.S,label:Rp,leftIcon:qi,onClick:()=>h(!0)}},{id:Ap,type:Pt.Button,buttonProps:{variant:L.Primary,size:P.S,label:Fp,leftIcon:xi,onClick:()=>m(!0)}}],[f]);return e(a,{children:[t(dn,{isOpen:b>0,richTitle:{icon:Xi,title:Op,badge:{label:b}},actions:w}),t(me,{isOpen:u,title:Pp,description:Lp,onClose:v,denyButton:{label:_p,variant:L.Secondary,onClick:v},approveButton:{label:Bp,variant:L.Primary,onClick:()=>{C(),v()}}}),t($l,{isOpen:g,action:"uninstrument",target:`${b} source${1===b?"":"s"}`,onClose:y,onDeny:y,onApprove:S})]})},zp=e=>`Data Stream: ${e}`,Xp="Search streams...",Vp="No streams match",Up=m.div`
681
+ `,Sp=({height:o,metrics:n,refetchSources:a,refetchDestinations:i,refetchActions:l,refetchInstrumentationRules:s})=>{const c=da(),{selectedStreamName:d}=Fe(),{containerRef:u,containerHeight:p}=$a(),h=at(e=>e.sources),m=at(e=>e.sourcesLoading),g=at(e=>e.destinations),f=at(e=>e.destinationsLoading),b=at(e=>e.actions),v=at(e=>e.actionsLoading),y=at(e=>e.instrumentationRules),C=at(e=>e.instrumentationRulesLoading),S=r(()=>ua(h,d),[h,d]),w=r(()=>kt(g,d),[g,d]),x=r(()=>Ea(S,c),[S,c]),k=r(()=>Na(w,c),[w,c]),T=r(()=>Ia(b,c),[b,c]);return e(Cp,{ref:u,$height:o,children:[t(yp,{entityType:lt.InstrumentationRule,entities:y,unfilteredCount:y.length,loading:C,maxHeight:p,refetch:s}),t(yp,{entityType:lt.Source,entities:x,unfilteredCount:S.length,metrics:n,loading:m,maxHeight:p,refetch:a}),t(yp,{entityType:lt.Action,entities:T,unfilteredCount:b.length,loading:v,maxHeight:p,refetch:l}),t(yp,{entityType:lt.Destination,entities:k,unfilteredCount:w.length,metrics:n,loading:f,maxHeight:p,refetch:i})]})},wp=({effectiveConfig:n,fetchNamespacesWithWorkloads:a,persistSources:i,restartWorkloads:l,restartPod:s,recoverFromRollback:r,updateSource:c,fetchSourceById:d,fetchPeerSources:u,enableProfiling:p,fetchProfilingSlots:h,fetchSourceProfiling:m,getDestinationCategories:g,getPotentialDestinations:f,testConnection:b,createDestination:v,updateDestination:y,deleteDestination:C,createInstrumentationRule:S,updateInstrumentationRule:w,deleteInstrumentationRule:x,createAction:k,updateAction:T,deleteAction:$})=>{const{currentModal:E,setCurrentModal:N}=Po(),{drawerType:I,drawerEntityId:A,setDrawerType:O,setDrawerEntityId:D}=Ht(),R=()=>{N(""),O(null),D(null)};return e(o,{children:[t(Cd,{}),E===lt.Source&&t(Ol,{children:t(tr,{onClose:R,fetchNamespacesWithWorkloads:a,persistSources:i,withOverlay:!0})}),E===lt.Destination&&t(Dl,{children:t(Fs,{onClose:R,getDestinationCategories:g,getPotentialDestinations:f,testConnection:b,createDestination:v,updateDestination:y,withOverlay:!0})}),E===lt.InstrumentationRule&&t(Fl,{children:t(Ps,{onClose:R,createInstrumentationRule:S,withOverlay:!0})}),E===lt.Action&&t(Rl,{children:t(ks,{onClose:R,createAction:k,withOverlay:!0})}),I===lt.Source&&A&&t(Pl,{children:t(Gc,{onClose:R,effectiveConfig:n,sourceId:A,persistSources:i,restartWorkloads:l,restartPod:s,recoverFromRollback:r,updateSource:c,fetchSourceById:d,fetchPeerSources:u,enableProfiling:p,fetchSourceProfiling:m,fetchProfilingSlots:h})}),I===lt.Destination&&A&&t(Dl,{children:t(ar,{onClose:R,destinationId:A,getDestinationCategories:g,testConnection:b,updateDestination:y,deleteDestination:C})}),I===lt.InstrumentationRule&&A&&t(Fl,{children:t(ir,{onClose:R,ruleId:A,updateInstrumentationRule:w,deleteInstrumentationRule:x})}),I===lt.Action&&A&&t(Rl,{children:t(or,{onClose:R,actionId:A,updateAction:T,deleteAction:$})})]})},xp="multi-source-deselect",kp="multi-source-restart",Tp="multi-source-uninstrument",$p="Selected sources",Ep="Deselect",Np="Restart",Ip="Uninstrument",Ap="Rollout Restart Workloads",Op="Are you sure you want to rollout restart these workloads?",Dp="Go Back",Rp="Confirm",Fp=({restartWorkloads:a,persistSources:i})=>{const{selectedStreamName:s}=Fe(),{selectedSources:d,setSelectedSources:u}=ya(),[p,h]=l(!1),[m,g]=l(!1),f=r(()=>Object.values(d).reduce((e,t)=>e+t.length,0),[d]),b=c(()=>{u({})},[u]),v=c(()=>h(!1),[]),y=c(()=>g(!1),[]);n(()=>{b()},[s,b]);const C=c(()=>{a(Object.values(d).flat().filter(e=>e.id.kind!==uo.StaticPod).map(jt)),b()},[a,d,b]),S=c(()=>{i(Object.fromEntries(Object.entries(d).map(([e,t])=>[e,t.map(({id:e})=>({namespace:e.namespace,name:e.name,kind:e.kind||void 0,selected:!1,currentStreamName:s}))]))),b()},[i,d,s,b]),w=r(()=>[{id:xp,type:Xt.Button,buttonProps:{variant:ae.Text,size:ne.S,label:Ep,onClick:b}},{id:kp,type:Xt.Button,buttonProps:{variant:ae.Secondary,size:ne.S,label:Np,leftIcon:Li,onClick:()=>h(!0)}},{id:Tp,type:Xt.Button,buttonProps:{variant:ae.Primary,size:ne.S,label:Ip,leftIcon:ai,onClick:()=>g(!0)}}],[b]);return e(o,{children:[t(ra,{isOpen:f>0,richTitle:{icon:Si,title:$p,badge:{label:f}},actions:w}),t(De,{isOpen:p,title:Ap,description:Op,onClose:v,denyButton:{label:Dp,variant:ae.Secondary,onClick:v},approveButton:{label:Rp,variant:ae.Primary,onClick:()=>{C(),v()}}}),t(pl,{isOpen:m,action:"uninstrument",target:`${f} source${1===f?"":"s"}`,onClose:y,onDeny:y,onApprove:S})]})},Pp=e=>`Data Stream: ${e}`,Lp="Search streams...",_p="No streams match",zp=g.div`
642
682
  position: relative;
643
683
  display: inline-flex;
644
- `,Hp=m.div`
684
+ `,Mp=g.div`
645
685
  display: inline-flex;
646
686
  align-items: center;
647
687
  gap: 6px;
@@ -652,7 +692,7 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
652
692
  &:hover {
653
693
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
654
694
  }
655
- `,jp=m.div`
695
+ `,Bp=g.div`
656
696
  position: absolute;
657
697
  top: calc(100% + 8px);
658
698
  left: 0;
@@ -666,18 +706,18 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
666
706
  border-radius: 12px;
667
707
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
668
708
  box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
669
- `,Wp=m.div`
709
+ `,Xp=g.div`
670
710
  display: flex;
671
711
  align-items: center;
672
712
  gap: 8px;
673
713
  width: 100%;
674
- `,Gp=m.div`
714
+ `,Vp=g.div`
675
715
  display: flex;
676
716
  flex-direction: column;
677
717
  gap: 0;
678
718
  max-height: 240px;
679
719
  overflow-y: auto;
680
- `,Kp=m.div`
720
+ `,Up=g.div`
681
721
  display: flex;
682
722
  align-items: center;
683
723
  gap: 8px;
@@ -688,29 +728,29 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
688
728
  &:hover {
689
729
  background-color: ${({$selected:e,theme:t})=>e?t.v2.colors.silver[600]:t.v2.colors.silver[700]};
690
730
  }
691
- `,Yp=m.div`
731
+ `,Hp=g.div`
692
732
  flex: 1;
693
733
  min-width: 0;
694
734
  overflow: hidden;
695
735
  text-overflow: ellipsis;
696
736
  white-space: nowrap;
697
- `,Jp=m.div`
737
+ `,jp=g.div`
698
738
  display: flex;
699
739
  align-items: center;
700
740
  gap: 2px;
701
741
  flex-shrink: 0;
702
- `,qp=m.div`
742
+ `,Gp=g.div`
703
743
  display: flex;
704
744
  padding-top: 4px;
705
745
  border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
706
- `,Zp=({updateDataStream:n,deleteDataStream:i,createDataStream:s})=>{const c=b(),{isVm:p}=G(),{clearStore:u}=Rn(),{dataStreams:h,selectedStreamName:g,setSelectedStreamName:m}=fe(),f=d(null),[v,y]=l(!1),[C,S]=l(""),[w,k]=l(""),[x,T]=l(!1),[E,N]=l(!1),[$,I]=l(!1),[A,O]=l(""),[D,R]=l(!1);Kt(f,()=>y(!1)),o(()=>{v||S("")},[v]);const _=r(()=>{if(!C)return h;const e=C.toLowerCase();return h.filter(({name:t})=>t.toLowerCase().includes(e))},[h,C]),B=v?Li:_i;return p?null:e(a,{children:[e(Up,{ref:f,children:[e(Hp,{"data-id":"data-stream-select",$isOpen:v,onClick:()=>y(e=>!e),children:[t(cl,{size:24}),t(X,{size:V.S,weight:500,nowrap:!0,children:zp(g)}),t(pe,{label:h.length,status:Je.Unknown,textSize:V.XXXS}),t(B,{size:20,fill:c.v2.colors.silver[200]})]}),v&&e(jp,{children:[t(Wp,{children:t(Lt,{value:C,onChange:S,placeholder:Xp,width:"100%"})}),t(Gp,{children:0===_.length?t(Kp,{children:t(X,{size:V.XS,color:te.Secondary,children:Vp})}):_.map(({name:a})=>{const o=a===Pn;return e(Kp,{"data-id":`stream-row-${a}`,$selected:a===g,onClick:()=>(e=>{e!==g&&(u(),m(e)),y(!1)})(a),children:[t(Yp,{children:t(X,{size:V.XS,nowrap:!0,children:a})}),e(Jp,{children:[t(Me,{"data-id":`stream-edit-${a}`,icon:Ai,size:ze.XS,onClick:e=>{e.stopPropagation(),y(!1),k(a),T(!0)}}),!o&&t(Me,{"data-id":`stream-delete-${a}`,icon:xi,size:ze.XS,onClick:e=>{e.stopPropagation(),y(!1),O(a),R(!0)}})]})]},`stream-${a}`)})}),t(qp,{children:t(F,{"data-id":"add-stream-trigger",variant:L.Secondary,size:P.S,leftIcon:Ti,label:`${dt.NEW} ${be.STREAM_NAME}`,fullWidth:!0,onClick:()=>{y(!1),u(),I(!0),N(!0)}})})]})]}),$&&t(Fn,{defaultExcludeName:g,children:t(Cc,{isOpen:E,onClose:()=>N(!1),onCloseEnd:()=>I(!1),createDataStream:s})}),w&&t(Fn,{children:t(Sc,{isOpen:x,dataStreamName:w,onClose:()=>T(!1),onCloseEnd:()=>k(""),updateDataStream:n})}),t($l,{target:`${be.STREAM_NAME.toLowerCase()} "${A}"`,isOpen:D,onClose:()=>R(!1),onApprove:async()=>{A&&await i(A)}})]})},Qp=v`
746
+ `,Wp=({updateDataStream:a,deleteDataStream:i,createDataStream:s})=>{const c=f(),{isVm:u}=y(),{clearStore:p}=Aa(),{dataStreams:h,selectedStreamName:m,setSelectedStreamName:g}=Fe(),b=d(null),[v,C]=l(!1),[S,w]=l(""),[x,k]=l(""),[T,$]=l(!1),[E,N]=l(!1),[I,A]=l(!1),[O,D]=l(""),[R,F]=l(!1);eo(b,()=>C(!1)),n(()=>{v||w("")},[v]);const P=r(()=>{if(!S)return h;const e=S.toLowerCase();return h.filter(({name:t})=>t.toLowerCase().includes(e))},[h,S]),L=v?fi:bi;return u?null:e(o,{children:[e(zp,{ref:b,children:[e(Mp,{"data-id":"data-stream-select",$isOpen:v,onClick:()=>C(e=>!e),children:[t(Wi,{size:24}),t(re,{size:ce.S,weight:500,nowrap:!0,children:Pp(m)}),t(Ie,{label:h.length,status:st.Unknown,textSize:ce.XXXS}),t(L,{size:20,fill:c.v2.colors.silver[200]})]}),v&&e(Bp,{children:[t(Xp,{children:t(Vt,{value:S,onChange:w,placeholder:Lp,width:"100%"})}),t(Vp,{children:0===P.length?t(Up,{children:t(re,{size:ce.XS,color:Ce.Secondary,children:_p})}):P.map(({name:o})=>{const n=o===Oa;return e(Up,{"data-id":`stream-row-${o}`,$selected:o===m,onClick:()=>(e=>{e!==m&&(p(),g(e)),C(!1)})(o),children:[t(Hp,{children:t(re,{size:ce.XS,nowrap:!0,children:o})}),e(jp,{children:[t(qe,{"data-id":`stream-edit-${o}`,icon:di,size:Ze.XS,onClick:e=>{e.stopPropagation(),C(!1),k(o),$(!0)}}),!n&&t(qe,{"data-id":`stream-delete-${o}`,icon:ai,size:Ze.XS,onClick:e=>{e.stopPropagation(),C(!1),D(o),F(!0)}})]})]},`stream-${o}`)})}),t(Gp,{children:t(oe,{"data-id":"add-stream-trigger",variant:ae.Secondary,size:ne.S,leftIcon:ii,label:`${bt.NEW} ${Re.STREAM_NAME}`,fullWidth:!0,onClick:()=>{C(!1),p(),A(!0),N(!0)}})})]})]}),I&&t(Ll,{defaultExcludeName:m,children:t(gd,{isOpen:E,onClose:()=>N(!1),onCloseEnd:()=>A(!1),createDataStream:s})}),x&&t(Ll,{children:t(fd,{isOpen:T,dataStreamName:x,onClose:()=>$(!1),onCloseEnd:()=>k(""),updateDataStream:a})}),t(pl,{target:`${Re.STREAM_NAME.toLowerCase()} "${O}"`,isOpen:R,onClose:()=>F(!1),onApprove:async()=>{O&&await i(O)}})]})},Kp=v`
707
747
  0% {
708
748
  background-position: 200% 50%;
709
749
  }
710
750
  100% {
711
751
  background-position: 0% 50%;
712
752
  }
713
- `,eu=m.div`
753
+ `,Yp=g.div`
714
754
  display: flex;
715
755
  align-items: center;
716
756
  justify-content: space-evenly;
@@ -721,44 +761,44 @@ import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useEffect
721
761
 
722
762
  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%)`};
723
763
  background-size: 200% 100%;
724
- animation: ${Qp} 15s linear infinite;
725
- `,tu=[zi,Xi,Fi,Pi],au=({columnsMaxHeight:a,metrics:o,refetchSources:i,refetchDestinations:l,refetchActions:s,refetchInstrumentationRules:r,updateDataStream:c,deleteDataStream:d,createDataStream:p,...u})=>{const h=b();return e(an,{children:[e(Ae,{customTitle:t(Zp,{updateDataStream:c,deleteDataStream:d,createDataStream:p}),customSearch:t(op,{}),filters:t(Kd,{}),children:[t(eu,{children:tu.map((a,o)=>e(n,{children:[t(a,{size:24}),o<tu.length-1&&t(Ri,{fill:h.v2.colors.white[500]+Re["020"],size:24})]},a.name))}),t(Ep,{height:a,metrics:o,refetchSources:i,refetchDestinations:l,refetchActions:s,refetchInstrumentationRules:r})]}),t(Np,{...u}),t(Mp,{restartWorkloads:u.restartWorkloads,persistSources:u.persistSources})]})};var ou;!function(e){e.Gateway="gateway",e.Node="node"}(ou||(ou={}));const nu=({onClickDownloadDiagnose:a,onClickRefresh:o,loading:n,disabled:i})=>{const l=r(()=>{const e=[];return a&&e.push({id:Ta(),type:Pt.Button,buttonProps:{label:"Download Diagnose",leftIcon:al,size:P.S,variant:L.Text,onClick:a,disabled:i}}),o&&e.push({id:Ta(),type:Pt.Button,buttonProps:{label:"Refresh",leftIcon:Wi,size:P.S,variant:L.Text,onClick:o,disabled:i,loading:n}}),e},[a,o,i,n]);return e(R,{$alignItems:"center",$justifyContent:"space-between",children:[t(Ln,{icon:dl,title:"Collectors Pipeline"}),t(_n,{actions:l})]})},iu=({pod:a,getExtendedPodInfo:n,onClose:i})=>{const{formatTimeAgo:s}=xt(),[c,d]=l(null);o(()=>{a?n(a.namespace,a.name).then(e=>d(e??null)):d(null)},[a]);const p=r(()=>[{id:Ta(),title:"Node",label:c?.node??"-",withCopy:!0},{id:Ta(),title:"Status",badge:{status:Bn(c?.status),label:c?.status??"-"}}],[c]),u=r(()=>c?.containers?.map(e=>({id:Ta(),items:[{id:Ta(),title:"Container",label:e.name??"-"},{id:Ta(),title:"Status",label:e.startedAt?`${e.status} (since ${s(e.startedAt)})`:e.status},{id:Ta(),title:"Ready",badge:{status:e.ready?J.Success:J.Error,leftIcon:e.ready?Ni:$i,label:e.ready?"True":"False",invertColors:!0}},{id:Ta(),title:"Started",badge:{status:e.started?J.Success:J.Error,leftIcon:e.started?Ni:$i,label:e.started?"True":"False",invertColors:!0}},{id:Ta(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:Ta(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:Ta(),title:"Restarts",label:e.restarts.toString()},{id:Ta(),title:"State Reason",label:e.stateReason??"-"},{id:Ta(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:Ta(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[c]);return t(ct,{isOpen:!!a,header:{icon:Hi,title:"Pod Information",onClose:i},children:c?e(ut,{bgTint:"1000",richTitle:{icon:Hi,title:c.name,withCopy:!0},children:[t(ut,{bgTint:"900",cellsPerRow:2,items:p}),e(ut,{bgTint:"900",richTitle:{icon:ol,title:"Kubectl Commands"},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(It,{value:`kubectl get pod ${c.name} -n ${c.namespace} -o yaml`}),t(It,{value:`kubectl describe pod ${c.name} -n ${c.namespace}`}),t(It,{value:`kubectl logs ${c.name} -n ${c.namespace}`})]}),t(ut,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:u.length?u.map(({id:e,items:a})=>t(ut,{bgTint:"800",cellsPerRow:2,items:a},e)):t(z,{title:"No containers",subTitle:"Pod has no containers"})}),t(Pl,{bgTint:"900",yaml:c.manifestYAML,defaultOpen:!0})]}):t(Le,{$height:"50vh",children:t(Xe,{withSpinner:!0})})})};var lu;!function(e){e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropDrate="spanDropDrate",e.Age="age",e.DockerImage="dockerImage"}(lu||(lu={}));const su=[{key:lu.PodName,label:"Pod Name"},{key:lu.Status,label:"Status"},{key:lu.Restarts,label:"Restarts"},{key:lu.NodeName,label:"Node Name"},{key:lu.Age,label:"Age"},{key:lu.DockerImage,label:"Collector Version"}],ru=({isLoading:a,tableRowsMaxHeight:o,pods:n,getExtendedPodInfo:i})=>{const s=b(),{formatTimeAgo:c}=xt(),[d,p]=l(null),u=r(()=>n.map(a=>({onClick:()=>p(a),cells:[{key:lu.PodName,rawValue:a.name},{key:lu.Status,rawValue:a.status,component:()=>{return e=a.status,t(pe,{status:Bn(e),label:e});var e}},{key:lu.Restarts,rawValue:a.restartsCount.toString()},{key:lu.NodeName,rawValue:a.nodeName},{key:lu.SpanDropDrate,rawValue:0,component:()=>{const{collectorMetrics:o}=a;if(!o)return t(X,{children:"-"});const n=(o?.metricsAcceptedRps??0)+(o?.metricsDroppedRps??0),i=n>0?Math.round((o?.metricsDroppedRps??0)/n*100):0,l=i>0?J.Error:J.Success,s=(o?.exporterSuccessRps??0)+(o?.exporterFailedRps??0),r=s>0?Math.round((o?.exporterFailedRps??0)/s*100):0,c=r>0?J.Error:J.Success;return e(R,{$gap:4,children:[t(oe,{text:`Accepted: ${o.metricsAcceptedRps.toLocaleString()}, Dropped: ${o.metricsDroppedRps.toLocaleString()}`,children:t(pe,{status:l,label:`Receiver ${i}%`,leftIcon:l===J.Error?pl:ul,useSecondaryTone:!0,invertColors:!0})}),t(oe,{text:`Success: ${o.exporterSuccessRps.toLocaleString()}, Failed: ${o.exporterFailedRps.toLocaleString()}`,children:t(pe,{status:c,label:`Exporter ${r}%`,leftIcon:c===J.Error?pl:ul,useSecondaryTone:!0,invertColors:!0})})]})}},{key:lu.Age,rawValue:c(a.creationTimestamp)},{key:lu.DockerImage,rawValue:a.image}]})),[n,s]);return e(ut,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:Hi,title:"Pods"},children:[t(on,{variant:nn.Data,maxHeight:o,isLoading:a,columns:su,rows:u}),t(iu,{pod:d,getExtendedPodInfo:i,onClose:()=>p(null)})]})},cu=({isOpen:e,onClose:a,title:o,yaml:n})=>t(ct,{isOpen:e,header:{icon:hl,title:o,onClose:a},children:t(Pl,{yaml:n,defaultOpen:!0})}),du=e=>{switch(e){case Mn.Healthy:return"All desired replicas are updated, available, and ready";case Mn.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case Mn.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case Mn.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case Mn.Down:return"No available replicas";case Mn.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var pu;!function(e){e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"}(pu||(pu={}));const uu=m.div`
764
+ animation: ${Kp} 15s linear infinite;
765
+ `,Jp=[Ci,Si,mi,gi],qp=({columnsMaxHeight:o,metrics:n,refetchSources:i,refetchDestinations:l,refetchActions:s,refetchInstrumentationRules:r,updateDataStream:c,deleteDataStream:d,createDataStream:u,...p})=>{const h=f();return e(sa,{children:[e(Ue,{customTitle:t(Wp,{updateDataStream:c,deleteDataStream:d,createDataStream:u}),customSearch:t(Zu,{}),filters:t(Uu,{}),children:[t(Yp,{children:Jp.map((o,n)=>e(a,{children:[t(o,{size:24}),n<Jp.length-1&&t(hi,{fill:h.v2.colors.white[500]+je["020"],size:24})]},o.name))}),t(Sp,{height:o,metrics:n,refetchSources:i,refetchDestinations:l,refetchActions:s,refetchInstrumentationRules:r})]}),t(wp,{...p}),t(Fp,{restartWorkloads:p.restartWorkloads,persistSources:p.persistSources})]})};var Zp;!function(e){e.Gateway="gateway",e.Node="node"}(Zp||(Zp={}));const Qp=({onClickDownloadDiagnose:o,onClickRefresh:n,loading:a,disabled:i})=>{const l=r(()=>{const e=[];return o&&e.push({id:Fo(),type:Xt.Button,buttonProps:{label:"Download Diagnose",leftIcon:Fi,size:ne.S,variant:ae.Text,onClick:o,disabled:i}}),n&&e.push({id:Fo(),type:Xt.Button,buttonProps:{label:"Refresh",leftIcon:$i,size:ne.S,variant:ae.Text,onClick:n,disabled:i,loading:a}}),e},[o,n,i,a]);return e(te,{$alignItems:"center",$justifyContent:"space-between",children:[t(Da,{icon:Ki,title:"Collectors Pipeline"}),t(Ra,{actions:l})]})},eh=({pod:o,getExtendedPodInfo:a,onClose:i})=>{const{formatTimeAgo:s}=Ot(),[c,d]=l(null);n(()=>{o?a(o.namespace,o.name).then(e=>d(e??null)):d(null)},[o]);const u=r(()=>[{id:Fo(),title:"Node",label:c?.node??"-",withCopy:!0},{id:Fo(),title:"Status",badge:{status:Fa(c?.status),label:c?.status??"-"}}],[c]),p=r(()=>c?.containers?.map(e=>({id:Fo(),items:[{id:Fo(),title:"Container",label:e.name??"-"},{id:Fo(),title:"Status",label:e.startedAt?`${e.status} (since ${s(e.startedAt)})`:e.status},{id:Fo(),title:"Ready",badge:{status:e.ready?ge.Success:ge.Error,leftIcon:e.ready?si:ri,label:e.ready?"True":"False",invertColors:!0}},{id:Fo(),title:"Started",badge:{status:e.started?ge.Success:ge.Error,leftIcon:e.started?si:ri,label:e.started?"True":"False",invertColors:!0}},{id:Fo(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:Fo(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:Fo(),title:Re.RESTARTS,label:e.restarts.toString()},{id:Fo(),title:"State Reason",label:e.stateReason??"-"},{id:Fo(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:Fo(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[c]);return t(ft,{isOpen:!!o,header:{icon:ki,title:"Pod Information",onClose:i},children:c?e(yt,{bgTint:"1000",richTitle:{icon:ki,title:c.name,withCopy:!0},children:[t(yt,{bgTint:"900",cellsPerRow:2,items:u}),e(yt,{bgTint:"900",richTitle:{icon:Xi,title:"Kubectl Commands"},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(Lt,{value:`kubectl get pod ${c.name} -n ${c.namespace} -o yaml`}),t(Lt,{value:`kubectl describe pod ${c.name} -n ${c.namespace}`}),t(Lt,{value:`kubectl logs ${c.name} -n ${c.namespace}`})]}),t(yt,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:p.length?p.map(({id:e,items:o})=>t(yt,{bgTint:"800",cellsPerRow:2,items:o},e)):t(se,{title:"No containers",subTitle:"Pod has no containers"})}),t(fl,{bgTint:"900",yaml:c.manifestYAML,defaultOpen:!0})]}):t(Ke,{$height:"50vh",children:t(Qe,{withSpinner:!0})})})};var th;!function(e){e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropDrate="spanDropDrate",e.Age="age",e.DockerImage="dockerImage"}(th||(th={}));const oh=[{key:th.PodName,label:"Pod Name"},{key:th.Status,label:"Status"},{key:th.Restarts,label:Re.RESTARTS},{key:th.NodeName,label:"Node Name"},{key:th.Age,label:"Age"},{key:th.DockerImage,label:"Collector Version"}],nh=({isLoading:o,tableRowsMaxHeight:n,pods:a,getExtendedPodInfo:i})=>{const s=f(),{formatTimeAgo:c}=Ot(),[d,u]=l(null),p=r(()=>a.map(o=>({onClick:()=>u(o),cells:[{key:th.PodName,rawValue:o.name},{key:th.Status,rawValue:o.status,component:()=>{return e=o.status,t(Ie,{status:Fa(e),label:e});var e}},{key:th.Restarts,rawValue:o.restartsCount.toString()},{key:th.NodeName,rawValue:o.nodeName},{key:th.SpanDropDrate,rawValue:0,component:()=>{const{collectorMetrics:n}=o;if(!n)return t(re,{children:"-"});const a=(n?.metricsAcceptedRps??0)+(n?.metricsDroppedRps??0),i=a>0?Math.round((n?.metricsDroppedRps??0)/a*100):0,l=i>0?ge.Error:ge.Success,s=(n?.exporterSuccessRps??0)+(n?.exporterFailedRps??0),r=s>0?Math.round((n?.exporterFailedRps??0)/s*100):0,c=r>0?ge.Error:ge.Success;return e(te,{$gap:4,children:[t(we,{text:`Accepted: ${n.metricsAcceptedRps.toLocaleString()}, Dropped: ${n.metricsDroppedRps.toLocaleString()}`,children:t(Ie,{status:l,label:`Receiver ${i}%`,leftIcon:l===ge.Error?Yi:Ji,useSecondaryTone:!0,invertColors:!0})}),t(we,{text:`Success: ${n.exporterSuccessRps.toLocaleString()}, Failed: ${n.exporterFailedRps.toLocaleString()}`,children:t(Ie,{status:c,label:`Exporter ${r}%`,leftIcon:c===ge.Error?Yi:Ji,useSecondaryTone:!0,invertColors:!0})})]})}},{key:th.Age,rawValue:c(o.creationTimestamp)},{key:th.DockerImage,rawValue:o.image}]})),[a,s]);return e(yt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:ki,title:"Pods"},children:[t(so,{variant:ro.Data,maxHeight:n,isLoading:o,columns:oh,rows:p}),t(eh,{pod:d,getExtendedPodInfo:i,onClose:()=>u(null)})]})},ah=({isOpen:e,onClose:o,title:n,yaml:a})=>t(ft,{isOpen:e,header:{icon:qi,title:n,onClose:o},children:t(fl,{yaml:a,defaultOpen:!0})}),ih=e=>{switch(e){case Pa.Healthy:return"All desired replicas are updated, available, and ready";case Pa.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case Pa.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case Pa.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case Pa.Down:return"No available replicas";case Pa.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var lh;!function(e){e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"}(lh||(lh={}));const sh=g.div`
726
766
  flex: 0.5;
727
767
  padding: 12px;
728
768
  border-radius: 12px;
729
769
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
730
- `,hu=({selectedTab:a,gatewayInfo:o,nodeCollectorInfo:n,isLoading:i})=>{const{formatTimeAgo:s}=xt(),[c,d]=l(null),p=r(()=>(e=>{switch(e){case ou.Gateway:return"Deployment";case ou.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(a),[a]),u=r(()=>((e,t,a,o)=>{const n={status:Je.Disabled,label:"No rollouts yet"};let i=!1,l=null;switch(e){case ou.Gateway:i=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case ou.Node:i=a?.rolloutInProgress??!1,l=a?.lastRolloutAt??null;break;default:return n}return i?{status:J.Info,label:"Rollout in progress",rightIcon:Wi,useSecondaryTone:!0}:l?{status:Je.Disabled,label:`Last Rollout: ${o(l)}`}:n})(a,o,n,s),[o,n,a,s]),h=r(()=>((e,t,a,o)=>{let n=o?J.Info:Je.Unknown,i=o?"Loading":Mn.Unknown,l=o?"Fetching data...":du(Mn.Unknown);switch(e){case ou.Gateway:n=t?.status?Bn(t?.status):n,i=t?.status??i,l=t?.status?du(t.status):l;break;case ou.Node:n=a?.status?Bn(a?.status):n,i=a?.status??i,l=a?.status?du(a.status):l}return{status:n,title:i,description:l}})(a,o,n,i),[o,n,a,i]),g=r(()=>((e,t,a)=>{switch(e){case ou.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 ou.Node:return[{gaugeWidth:128,min:0,max:a?.nodes?.desired??0,current:a?.nodes?.ready??0,title:"Nodes",primaryLabel:"Ready nodes",secondaryLabel:"Desired nodes"}];default:return[]}})(a,o,n),[o,n,a]),m=r(()=>((e,t,a,o)=>{switch(e){case ou.Gateway:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${t?.resources?.requests.cpu}/${t?.resources?.limits.cpu}`,isLoading:o},{label:"Memory",value:`${t?.resources?.requests.memory}/${t?.resources?.limits.memory}`,isLoading:o}]}];case ou.Node:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${a?.resources?.requests.cpu}/${a?.resources?.limits.cpu}`,isLoading:o},{label:"Memory",value:`${a?.resources?.requests.memory}/${a?.resources?.limits.memory}`,isLoading:o}]}];default:return[]}})(a,o,n,i),[o,n,a,i]),b=r(()=>(a===ou.Gateway?o?.manifestYAML:n?.manifestYAML)??"",[o,n,a]),f=r(()=>(a===ou.Gateway?o?.configMapYAML:n?.configMapYAML)??"",[o,n,a]);return e(ut,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:hl,title:p,badge:u},actions:[{id:Ta(),type:Pt.ButtonDropData,buttonProps:{variant:L.Secondary,size:P.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:pu.ManifestYaml,label:p,icon:gl},{id:pu.ConfigMapYaml,label:"ConfigMap",icon:gl}]}}],children:[e(R,{$gap:16,children:[t("div",{children:t(zn,{...h})}),g.map(e=>t(uu,{children:t("div",{children:t(Xn,{...e})})},e.title)),m.map(e=>t(Vn,{...e},e.title))]}),t(cu,{isOpen:c===pu.ManifestYaml,onClose:()=>d(null),title:p,yaml:b}),t(cu,{isOpen:c===pu.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:f})]})},gu=[{value:ou.Gateway,label:"Gateway"},{value:ou.Node,label:"Node Collector"}],mu=({minSupportedVersion:a=0,tableRowsMaxHeight:n,getGatewayInfo:i,getGatewayPods:s,getNodeCollectorInfo:d,getNodeCollectorPods:p,getExtendedPodInfo:u})=>{const{isVersionSupported:h,version:g}=G(a),[m,b]=l(!1),[f,v]=l(ou.Gateway),[y,S]=l(null),[w,k]=l([]),[x,T]=l(null),[E,N]=l([]),$=c(async()=>{b(!0);try{switch(f){case ou.Gateway:S(await i()??null),k(await s()??[]);break;case ou.Node:T(await d()??null),N(await p()??[])}}catch(e){}b(!1)},[f]);o(()=>{$()},[$]);const I=r(()=>f===ou.Gateway?w:E,[w,E,f]);return e(an,{children:[t(nu,{disabled:!h,loading:m,onClickDownloadDiagnose:void 0,onClickRefresh:$}),e(Un,{children:[e(C,{children:[t(H,{variant:Hn.Underline,options:gu,selected:f,setSelected:v}),t(hu,{selectedTab:f,gatewayInfo:y,nodeCollectorInfo:x,isLoading:m})]}),t(ru,{isLoading:m,tableRowsMaxHeight:n,pods:I,getExtendedPodInfo:u}),!h&&t(Dl,{minSupportedVersion:a,currentVersion:g||""})]})]})},bu=m.div`
770
+ `,rh=({selectedTab:o,gatewayInfo:n,nodeCollectorInfo:a,isLoading:i})=>{const{formatTimeAgo:s}=Ot(),[c,d]=l(null),u=r(()=>(e=>{switch(e){case Zp.Gateway:return"Deployment";case Zp.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(o),[o]),p=r(()=>((e,t,o,n)=>{const a={status:st.Disabled,label:"No rollouts yet"};let i=!1,l=null;switch(e){case Zp.Gateway:i=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case Zp.Node:i=o?.rolloutInProgress??!1,l=o?.lastRolloutAt??null;break;default:return a}return i?{status:ge.Info,label:"Rollout in progress",rightIcon:$i,useSecondaryTone:!0}:l?{status:st.Disabled,label:`Last Rollout: ${n(l)}`}:a})(o,n,a,s),[n,a,o,s]),h=r(()=>((e,t,o,n)=>{let a=n?ge.Info:st.Unknown,i=n?"Loading":Pa.Unknown,l=n?"Fetching data...":ih(Pa.Unknown);switch(e){case Zp.Gateway:a=t?.status?Fa(t?.status):a,i=t?.status??i,l=t?.status?ih(t.status):l;break;case Zp.Node:a=o?.status?Fa(o?.status):a,i=o?.status??i,l=o?.status?ih(o.status):l}return{status:a,title:i,description:l}})(o,n,a,i),[n,a,o,i]),m=r(()=>((e,t,o)=>{switch(e){case Zp.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 Zp.Node:return[{gaugeWidth:128,min:0,max:o?.nodes?.desired??0,current:o?.nodes?.ready??0,title:"Nodes",primaryLabel:"Ready nodes",secondaryLabel:"Desired nodes"}];default:return[]}})(o,n,a),[n,a,o]),g=r(()=>((e,t,o,n)=>{switch(e){case Zp.Gateway:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${t?.resources?.requests.cpu}/${t?.resources?.limits.cpu}`,isLoading:n},{label:"Memory",value:`${t?.resources?.requests.memory}/${t?.resources?.limits.memory}`,isLoading:n}]}];case Zp.Node:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${o?.resources?.requests.cpu}/${o?.resources?.limits.cpu}`,isLoading:n},{label:"Memory",value:`${o?.resources?.requests.memory}/${o?.resources?.limits.memory}`,isLoading:n}]}];default:return[]}})(o,n,a,i),[n,a,o,i]),f=r(()=>(o===Zp.Gateway?n?.manifestYAML:a?.manifestYAML)??"",[n,a,o]),b=r(()=>(o===Zp.Gateway?n?.configMapYAML:a?.configMapYAML)??"",[n,a,o]);return e(yt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:qi,title:u,badge:p},actions:[{id:Fo(),type:Xt.ButtonDropData,buttonProps:{variant:ae.Secondary,size:ne.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:lh.ManifestYaml,label:u,icon:Zi},{id:lh.ConfigMapYaml,label:"ConfigMap",icon:Zi}]}}],children:[e(te,{$gap:16,children:[t("div",{children:t(La,{...h})}),m.map(e=>t(sh,{children:t("div",{children:t(_a,{...e})})},e.title)),g.map(e=>t(za,{...e},e.title))]}),t(ah,{isOpen:c===lh.ManifestYaml,onClose:()=>d(null),title:u,yaml:f}),t(ah,{isOpen:c===lh.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},ch=[{value:Zp.Gateway,label:"Gateway"},{value:Zp.Node,label:"Node Collector"}],dh=({minSupportedVersion:o=0,tableRowsMaxHeight:a,getGatewayInfo:i,getGatewayPods:s,getNodeCollectorInfo:d,getNodeCollectorPods:u,getExtendedPodInfo:p})=>{const{isVersionSupported:h,version:m}=y(o),[g,f]=l(!1),[b,v]=l(Zp.Gateway),[C,S]=l(null),[w,x]=l([]),[k,T]=l(null),[$,E]=l([]),N=c(async()=>{f(!0);try{switch(b){case Zp.Gateway:S(await i()??null),x(await s()??[]);break;case Zp.Node:T(await d()??null),E(await u()??[])}}catch(e){}f(!1)},[b]);n(()=>{N()},[N]);const I=r(()=>b===Zp.Gateway?w:$,[w,$,b]);return e(sa,{children:[t(Qp,{disabled:!h,loading:g,onClickDownloadDiagnose:void 0,onClickRefresh:N}),e(Ma,{children:[e(V,{children:[t(ue,{variant:io.Underline,size:Ba.L,options:ch,selected:b,setSelected:v}),t(rh,{selectedTab:b,gatewayInfo:C,nodeCollectorInfo:k,isLoading:g})]}),t(nh,{isLoading:g,tableRowsMaxHeight:a,pods:I,getExtendedPodInfo:p}),!h&&t(bl,{minSupportedVersion:o,currentVersion:m||""})]})]})},uh=g.div`
731
771
  display: inline-flex;
732
772
  align-items: center;
733
773
  min-width: 0;
734
774
  overflow: hidden;
735
775
  white-space: pre;
736
776
  text-overflow: ellipsis;
737
- `,fu=m.div`
777
+ `,ph=g.div`
738
778
  display: flex;
739
779
  flex-direction: column;
740
780
  gap: 4px;
741
781
  min-width: 0;
742
782
  flex: 1;
743
783
  opacity: ${({$disabled:e})=>e?.4:1};
744
- `,vu=m(R)`
784
+ `,hh=g(te)`
745
785
  flex-shrink: 0;
746
786
  gap: 6px;
747
787
  align-items: center;
748
788
  min-height: 22px;
749
- `;const yu=[{key:"content",label:"Content",noSort:!0,noFilter:!0},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],Cu=[{value:"all",label:Wn},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],Su=({title:a,items:o,isLoading:n,showTypeFilter:i,tableRowsMaxHeight:s,onRuleClick:d,onCreateRule:p,onEditRule:u,onDeleteRule:h})=>{const g=b(),[m,f]=l(""),[v,y]=l("all"),C=r(()=>{let e=function(e,t,a){return a&&"all"!==t?e.filter(e=>e.typeBadge===t):e}(o,v,i);return e=function(e,t){if(!t.trim())return e;const a=t.toLowerCase();return e.filter(e=>{const t=e.name?.toLowerCase().includes(a),o=e.summary.map(e=>e.text).join("").toLowerCase();return t||o.includes(a)})}(e,m),e},[o,v,i,m]),S=r(()=>C.map(a=>{const o=a.typeBadge?function(e,t){const a=e.v2.colors;switch(t){case"Relevance":return{bg:a.blue[700],text:a.white[500]};case"Duration":return{bg:a.purple[700],text:a.white[500]};case"Error":return{bg:a.red[500],text:a.black[500]}}}(g,a.typeBadge):void 0;return{cells:[{key:"content",rawValue:a.summary.map(e=>e.text).join(""),component:()=>e(fu,{$disabled:a.disabled,children:[t(bu,{children:t(Ia,{parts:a.summary})}),a.name&&t(X,{size:V.XXS,color:te.Secondary,nowrap:!0,children:a.name})]})},{key:"badges",rawValue:a.typeBadge||"",component:()=>e(vu,{children:[a.disabled&&t(pe,{label:jn,textSize:V.XXXS,backgroundColor:g.v2.colors.grey[700],textColor:g.v2.colors.grey[300]}),a.typeBadge&&o&&t(pe,{label:a.typeBadge,textSize:V.XXXS,backgroundColor:o.bg,textColor:o.text})]})}],onClick:()=>d(a)}}),[C,g,d]),w=r(()=>{const e=e=>t(Ii,{...e,fill:g.v2.colors.red[500]});return e.displayName="RedDeleteIcon",e},[g]),k=c(e=>{const t=S.indexOf(e);if(t<0)return[];const a=C[t];return a?[{id:"edit","data-id":"sampling-rule-action-edit",label:oa,leftIcon:Ai,onClick:()=>u(a.ruleId,a.samplingId)},{id:"delete","data-id":"sampling-rule-action-delete",label:"",leftIcon:w,onClick:()=>h(a.ruleId,a.samplingId)}]:[]},[S,C,u,h,w]);return t(Ae,{fullHeight:!0,richTitle:{icon:Zi,title:a,badge:{label:o.length,backgroundColor:g.v2.colors.silver[600],textColor:g.v2.colors.white[500]}},search:{"data-id":"sampling-search-rules",value:m,onChange:f,placeholder:"Search..",width:"500px",...i?{segment:{"data-id":"sampling-segment-type-filter",options:Cu,selected:v,setSelected:y}}:{}},children:t(on,{variant:nn.Pretty,hideHeader:!0,maxHeight:s,isLoading:n,noDataProps:m.trim()?{hideIcon:!0,title:Gn,subTitle:Jn(m)}:{hideIcon:!0,title:Yn,button:{label:Kn,onClick:p}},columns:yu,rows:S,getRowActions:k})})},wu=({workloads:a,samplingRules:n,k8sHealthProbesConfig:i,loading:s,docsUrl:p,tableRowsMaxHeight:u,fetchSamplingRules:h,createNoisyOperationRule:g,updateNoisyOperationRule:m,createHighlyRelevantOperationRule:b,updateHighlyRelevantOperationRule:f,createCostReductionRule:v,updateCostReductionRule:y,deleteSamplingRule:S,updateK8sHealthProbesConfig:w})=>{const k=r(()=>a.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:`${e.namespace} / ${e.kind} / ${e.name}`})),[a]),x=r(()=>Array.from(new Set(a.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[a]),[T,E]=l(qn.Noisy),[N,$]=l(null),[I,A]=l(!1),[O,D]=l(!1),[_,B]=l(null),[M,z]=l(!1),[X,V]=l(!1),[U,j]=l(!1),[W,G]=l(!1),K=d(!1);o(()=>{K.current||s||(K.current=!0,0===n.length&&G(!0))},[s,n]);const q=r(()=>Oa(i),[i]),Z=r(()=>Zn(n),[n]),Q=r(()=>Bo(Z?.rule??null),[Z]),ee=r(()=>Qn(n),[n]),te=r(()=>ei(ee?.rule??null),[ee]),ae=d(N);ae.current=N,o(()=>{const e=ae.current;if(!e)return;const t=ti(n,e);t?$(t):($(null),A(!1))},[n]);const oe=r(()=>{const e=new Set;return Z&&e.add(Z.rule.ruleId),ee&&e.add(ee.rule.ruleId),e},[Z,ee]),ne=r(()=>ai(n,T,oe),[n,T,oe]),ie=c(()=>D(!0),[]),le=c(()=>D(!1),[]),se=c(()=>G(!1),[]),re=c(async e=>{const t=n[0]?.id??"default";switch(ri[T]){case"noisy":await g(t,ii(e));break;case"highlyRelevant":await b(t,ni(e));break;case"costReduction":await v(t,oi(e))}D(!1)},[n,T,g,b,v]),ce=c(e=>{const t=li(n,e);t&&(A(!1),$(t))},[n]),de=c(()=>{$(null),A(!1)},[]),pe=c((e,t)=>{const a=N;if(a&&a.rule.ruleId===e&&a.samplingId===t)A(!0),$({...a});else for(const a of n){if(a.id!==t)continue;const o=[...a.noisyOperations.map(e=>({category:"noisy",rule:e})),...a.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...a.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(o)return A(!0),void $({category:o.category,rule:o.rule,samplingId:t,summary:si(o.category,o.rule)})}},[N,n]),ue=c(async(e,t,a)=>{const o=N?.category;if(o){switch(o){case"noisy":await m(a,t,ii(e));break;case"highlyRelevant":await f(a,t,ni(e));break;case"costReduction":await y(a,t,oi(e))}A(!1)}},[N,m,f,y]),he=c((e,t)=>{B({ruleId:e,samplingId:t})},[]),ge=c(async()=>{if(!_)return;const{ruleId:e,samplingId:t}=_,a=N?.category||ri[T];await S(t,e,a),$(null),A(!1),B(null)},[_,N,T,S]),be=c(()=>B(null),[]),fe=c(async(e,t)=>{await w(e,t),z(!1)},[w]),ve=c(async e=>{const t=n[0]?.id??"default",a=Z;a?await f(a.samplingId,a.rule.ruleId,{name:a.rule.name,disabled:!e,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null,notes:a.rule.notes}):e&&await b(t,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}),V(!1)},[n,Z,b,f]),ye=c(async(e,t)=>{const a=n[0]?.id??"default",o=ee;o?await y(o.samplingId,o.rule.ruleId,{name:o.rule.name,disabled:!e,sourceScopes:null,operation:null,percentageAtMost:t,notes:o.rule.notes}):e&&await v(a,{name:"Auto - Drop Traces Cluster-Wide",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:t}),j(!1)},[n,ee,v,y]),we=c(e=>{const t=ri[T];let a=null;switch(t){case"noisy":{const o=ii(e);a=ci(n,t,{sourceScopes:o.sourceScopes,operation:o.operation});break}case"highlyRelevant":{const o=ni(e);a=ci(n,t,{sourceScopes:o.sourceScopes,operation:o.operation,error:o.error??!1,durationAtLeastMs:o.durationAtLeastMs});break}case"costReduction":{const o=oi(e);a=ci(n,t,{sourceScopes:o.sourceScopes,operation:o.operation});break}}return a?{message:di,ruleId:a}:null},[n,T]),ke=c(e=>{const t=N?.category,a=N?.rule.ruleId;if(!t)return null;let o=null;switch(t){case"noisy":{const i=ii(e);o=ci(n,t,{sourceScopes:i.sourceScopes,operation:i.operation},a);break}case"highlyRelevant":{const i=ni(e);o=ci(n,t,{sourceScopes:i.sourceScopes,operation:i.operation,error:i.error??!1,durationAtLeastMs:i.durationAtLeastMs},a);break}case"costReduction":{const i=oi(e);o=ci(n,t,{sourceScopes:i.sourceScopes,operation:i.operation},a);break}}return o?{message:di,ruleId:o}:null},[n,N]),Te=c(e=>{D(!1);for(const t of n){const a=[...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(a)return A(!0),void $({category:a.category,rule:a.rule,samplingId:t.id,summary:si(a.category,a.rule)})}},[n]),Ne=r(()=>{const e=[];return p&&e.push({id:Ta(),type:Pt.Button,buttonProps:{"data-id":"sampling-btn-docs",label:pi,leftIcon:Ei,size:P.S,variant:L.Text,onClick:()=>window.open(p,"_blank")}}),e.push({id:Ta(),type:Pt.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:ui,leftIcon:Wi,size:P.S,variant:L.Text,onClick:h,loading:s}}),e.push({id:Ta(),type:Pt.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:hi,rightIcon:Ti,size:P.S,variant:L.Primary,onClick:ie}}),e},[p,h,s,ie]);return e(an,{children:[e(R,{$gap:12,$justifyContent:"space-between",children:[t(Ln,{icon:Zi,title:mi,subTitle:gi}),t(_n,{actions:Ne})]}),e(C,{$gap:12,children:[t(H,{variant:Hn.Underline,options:bi,selected:T,setSelected:E}),e(R,{$justifyContent:"space-between",children:[t(Y,{status:J.Default,message:fi[T]}),p&&t(F,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:Ei,size:P.S,variant:L.Text,onClick:()=>window.open(p,"_blank")})]}),T===qn.Noisy?t(fl,{title:Ee,summary:q,onEdit:()=>z(!0)}):T===qn.HighlyRelevant?t(fl,{title:Se,summary:Q,onEdit:()=>V(!0)}):T===qn.CostReduction?t(fl,{title:xe,summary:te,onEdit:()=>j(!0)}):null,t(Su,{title:vi[T],items:ne,isLoading:s,showTypeFilter:T===qn.HighlyRelevant,tableRowsMaxHeight:u,onRuleClick:ce,onCreateRule:ie,onEditRule:pe,onDeleteRule:he})]}),t(dc,{formType:Ce.View,data:N,defaultEditMode:I,onClose:de,onDelete:he,onSaveEdit:ue,sourceOptions:k,namespaceOptions:x,validateForm:ke,onNavigateToDuplicate:Te}),t(dc,{formType:Ce.Create,isOpen:O,category:ri[T],onClose:le,onSubmit:re,sourceOptions:k,namespaceOptions:x,validateForm:we,onNavigateToDuplicate:Te}),t(dc,{formType:Ce.EditAutoNoisy,isOpen:M,enabled:i?.enabled??!1,keepPercentage:i?.keepPercentage??0,onClose:()=>z(!1),onSave:fe}),t(dc,{formType:Ce.EditAutoHighlyRelevant,isOpen:X,enabled:!!Z&&!Z.rule.disabled,onClose:()=>V(!1),onSave:ve}),t(dc,{formType:Ce.EditAutoCostReduction,isOpen:U,enabled:!!ee&&!ee.rule.disabled,dropPercentage:ee?.rule.percentageAtMost??25,onClose:()=>j(!1),onSave:ye}),t(me,{title:wi,description:Si,isOpen:!!_,onClose:be,denyButton:{label:Ci,variant:L.Secondary,onClick:be},approveButton:{label:yi,variant:L.Primary,onClick:()=>{ge(),be()}}}),t(yd,{isOpen:W,onClose:se,k8sHealthProbesConfig:i,samplingId:n[0]?.id,docsUrl:p,updateK8sHealthProbesConfig:w,createHighlyRelevantOperationRule:b,createCostReductionRule:v})]})},ku=m.div`
789
+ `;const mh=[{key:"content",label:"Content",noSort:!0,noFilter:!0},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],gh=[{value:"all",label:Va},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],fh=({title:o,items:n,isLoading:a,showTypeFilter:i,tableRowsMaxHeight:s,onRuleClick:d,onCreateRule:u,onEditRule:p,onDeleteRule:h})=>{const m=f(),[g,b]=l(""),[v,y]=l("all"),C=r(()=>{let e=function(e,t,o){return o&&"all"!==t?e.filter(e=>e.typeBadge===t):e}(n,v,i);return e=function(e,t){if(!t.trim())return e;const o=t.toLowerCase();return e.filter(e=>{const t=e.name?.toLowerCase().includes(o),n=e.summary.map(e=>e.text).join("").toLowerCase();return t||n.includes(o)})}(e,g),e},[n,v,i,g]),w=r(()=>C.map(o=>{const n=o.typeBadge?function(e,t){const o=e.v2.colors;switch(t){case"Relevance":return{bg:o.blue[700],text:o.white[500]};case"Duration":return{bg:o.purple[700],text:o.white[500]};case"Error":return{bg:o.red[500],text:o.black[500]}}}(m,o.typeBadge):void 0;return{cells:[{key:"content",rawValue:o.summary.map(e=>e.text).join(""),component:()=>e(ph,{$disabled:o.disabled,children:[t(uh,{children:t(S,{parts:o.summary})}),o.name&&t(re,{size:ce.XXS,color:Ce.Secondary,nowrap:!0,children:o.name})]})},{key:"badges",rawValue:o.typeBadge||"",component:()=>e(hh,{children:[o.disabled&&t(Ie,{label:Xa,textSize:ce.XXXS,backgroundColor:m.v2.colors.grey[700],textColor:m.v2.colors.grey[300]}),o.typeBadge&&n&&t(Ie,{label:o.typeBadge,textSize:ce.XXXS,backgroundColor:n.bg,textColor:n.text})]})}],onClick:()=>d(o)}}),[C,m,d]),x=r(()=>{const e=e=>t(ci,{...e,fill:m.v2.colors.red[500]});return e.displayName="RedDeleteIcon",e},[m]),k=c(e=>{const t=w.indexOf(e);if(t<0)return[];const o=C[t];return o?[{id:"edit","data-id":"sampling-rule-action-edit",label:mo,leftIcon:di,onClick:()=>p(o.ruleId,o.samplingId)},{id:"delete","data-id":"sampling-rule-action-delete",label:"",leftIcon:x,onClick:()=>h(o.ruleId,o.samplingId)}]:[]},[w,C,p,h,x]);return t(Ue,{fullHeight:!0,richTitle:{icon:_i,title:o,badge:{label:n.length,backgroundColor:m.v2.colors.silver[600],textColor:m.v2.colors.white[500]}},search:{"data-id":"sampling-search-rules",value:g,onChange:b,placeholder:"Search..",width:"500px",...i?{segment:{"data-id":"sampling-segment-type-filter",options:gh,selected:v,setSelected:y}}:{}},children:t(so,{variant:ro.Pretty,hideHeader:!0,maxHeight:s,isLoading:a,noDataProps:g.trim()?{hideIcon:!0,title:Ua,subTitle:Ga(g)}:{hideIcon:!0,title:ja,button:{label:Ha,onClick:u}},columns:mh,rows:w,getRowActions:k})})},bh=({workloads:o,samplingRules:a,k8sHealthProbesConfig:i,loading:s,docsUrl:u,tableRowsMaxHeight:p,fetchSamplingRules:h,createNoisyOperationRule:m,updateNoisyOperationRule:g,createHighlyRelevantOperationRule:f,updateHighlyRelevantOperationRule:b,createCostReductionRule:v,updateCostReductionRule:y,deleteSamplingRule:C,updateK8sHealthProbesConfig:S})=>{const k=r(()=>o.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:`${e.namespace} / ${e.kind} / ${e.name}`})),[o]),X=r(()=>Array.from(new Set(o.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[o]),[U,H]=l(T.Noisy),[j,G]=l(null),[W,K]=l(!1),[Y,J]=l(!1),[q,Z]=l(null),[Q,ee]=l(!1),[ie,le]=l(!1),[se,re]=l(!1),[ce,de]=l(!1),pe=d(!1);n(()=>{pe.current||s||(pe.current=!0,0===a.length&&de(!0))},[s,a]);const he=r(()=>w(i),[i]),fe=r(()=>$(a),[a]),be=r(()=>x(fe?.rule??null),[fe]),ve=r(()=>E(a),[a]),ye=r(()=>N(ve?.rule??null),[ve]),Ce=d(j);Ce.current=j,n(()=>{const e=Ce.current;if(!e)return;const t=I(a,e);t?G(t):(G(null),K(!1))},[a]);const Se=r(()=>{const e=new Set;return fe&&e.add(fe.rule.ruleId),ve&&e.add(ve.rule.ruleId),e},[fe,ve]),we=r(()=>A(a,U,Se),[a,U,Se]),xe=c(()=>J(!0),[]),ke=c(()=>J(!1),[]),Te=c(()=>de(!1),[]),$e=c(async e=>{const t=a[0]?.id??"default";switch(L[U]){case"noisy":await m(t,R(e));break;case"highlyRelevant":await f(t,D(e));break;case"costReduction":await v(t,O(e))}J(!1)},[a,U,m,f,v]),Ee=c(e=>{const t=F(a,e);t&&(K(!1),G(t))},[a]),Ne=c(()=>{G(null),K(!1)},[]),Ie=c((e,t)=>{const o=j;if(o&&o.rule.ruleId===e&&o.samplingId===t)K(!0),G({...o});else for(const o of a){if(o.id!==t)continue;const n=[...o.noisyOperations.map(e=>({category:"noisy",rule:e})),...o.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...o.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(n)return K(!0),void G({category:n.category,rule:n.rule,samplingId:t,summary:P(n.category,n.rule)})}},[j,a]),Ae=c(async(e,t,o)=>{const n=j?.category;if(n){switch(n){case"noisy":await g(o,t,R(e));break;case"highlyRelevant":await b(o,t,D(e));break;case"costReduction":await y(o,t,O(e))}K(!1)}},[j,g,b,y]),Oe=c((e,t)=>{Z({ruleId:e,samplingId:t})},[]),Re=c(async()=>{if(!q)return;const{ruleId:e,samplingId:t}=q,o=j?.category||L[U];await C(t,e,o),G(null),K(!1),Z(null)},[q,j,U,C]),Fe=c(()=>Z(null),[]),Le=c(async(e,t)=>{await S(e,t),ee(!1)},[S]),_e=c(async e=>{const t=a[0]?.id??"default",o=fe;o?await b(o.samplingId,o.rule.ruleId,{name:o.rule.name,disabled:!e,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null,notes:o.rule.notes}):e&&await f(t,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}),le(!1)},[a,fe,f,b]),Me=c(async(e,t)=>{const o=a[0]?.id??"default",n=ve;n?await y(n.samplingId,n.rule.ruleId,{name:n.rule.name,disabled:!e,sourceScopes:null,operation:null,percentageAtMost:t,notes:n.rule.notes}):e&&await v(o,{name:"Auto - Drop Traces Cluster-Wide",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:t}),re(!1)},[a,ve,v,y]),Xe=c(e=>{const t=L[U];let o=null;switch(t){case"noisy":{const n=R(e);o=_(a,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}case"highlyRelevant":{const n=D(e);o=_(a,t,{sourceScopes:n.sourceScopes,operation:n.operation,error:n.error??!1,durationAtLeastMs:n.durationAtLeastMs});break}case"costReduction":{const n=O(e);o=_(a,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}}return o?{message:Wa,ruleId:o}:null},[a,U]),Ve=c(e=>{const t=j?.category,o=j?.rule.ruleId;if(!t)return null;let n=null;switch(t){case"noisy":{const i=R(e);n=_(a,t,{sourceScopes:i.sourceScopes,operation:i.operation},o);break}case"highlyRelevant":{const i=D(e);n=_(a,t,{sourceScopes:i.sourceScopes,operation:i.operation,error:i.error??!1,durationAtLeastMs:i.durationAtLeastMs},o);break}case"costReduction":{const i=O(e);n=_(a,t,{sourceScopes:i.sourceScopes,operation:i.operation},o);break}}return n?{message:Wa,ruleId:n}:null},[a,j]),Ue=c(e=>{J(!1);for(const t of a){const o=[...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(o)return K(!0),void G({category:o.category,rule:o.rule,samplingId:t.id,summary:P(o.category,o.rule)})}},[a]),He=r(()=>{const e=[];return u&&e.push({id:Fo(),type:Xt.Button,buttonProps:{"data-id":"sampling-btn-docs",label:Ka,leftIcon:li,size:ne.S,variant:ae.Text,onClick:()=>window.open(u,"_blank")}}),e.push({id:Fo(),type:Xt.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:Ya,leftIcon:$i,size:ne.S,variant:ae.Text,onClick:h,loading:s}}),e.push({id:Fo(),type:Xt.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:Ja,rightIcon:ii,size:ne.S,variant:ae.Primary,onClick:xe}}),e},[u,h,s,xe]);return e(sa,{children:[e(te,{$gap:12,$justifyContent:"space-between",children:[t(Da,{icon:_i,title:Za,subTitle:qa}),t(Ra,{actions:He})]}),e(V,{$gap:12,children:[t(ue,{variant:io.Underline,size:Ba.L,options:z,selected:U,setSelected:H}),e(te,{$justifyContent:"space-between",children:[t(me,{status:ge.Default,message:M[U]}),u&&t(oe,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:li,size:ne.S,variant:ae.Text,onClick:()=>window.open(u,"_blank")})]}),U===T.Noisy?t(tl,{title:Be,summary:he,onEdit:()=>ee(!0)}):U===T.HighlyRelevant?t(tl,{title:Pe,summary:be,onEdit:()=>le(!0)}):U===T.CostReduction?t(tl,{title:ze,summary:ye,onEdit:()=>re(!0)}):null,t(fh,{title:B[U],items:we,isLoading:s,showTypeFilter:U===T.HighlyRelevant,tableRowsMaxHeight:p,onRuleClick:Ee,onCreateRule:xe,onEditRule:Ie,onDeleteRule:Oe})]}),t(id,{formType:kl.View,data:j,defaultEditMode:W,onClose:Ne,onDelete:Oe,onSaveEdit:Ae,sourceOptions:k,namespaceOptions:X,validateForm:Ve,onNavigateToDuplicate:Ue}),t(id,{formType:kl.Create,isOpen:Y,category:L[U],onClose:ke,onSubmit:$e,sourceOptions:k,namespaceOptions:X,validateForm:Xe,onNavigateToDuplicate:Ue}),t(id,{formType:kl.EditAutoNoisy,isOpen:Q,enabled:i?.enabled??!1,keepPercentage:i?.keepPercentage??0,onClose:()=>ee(!1),onSave:Le}),t(id,{formType:kl.EditAutoHighlyRelevant,isOpen:ie,enabled:!!fe&&!fe.rule.disabled,onClose:()=>le(!1),onSave:_e}),t(id,{formType:kl.EditAutoCostReduction,isOpen:se,enabled:!!ve&&!ve.rule.disabled,dropPercentage:ve?.rule.percentageAtMost??25,onClose:()=>re(!1),onSave:Me}),t(De,{title:oi,description:ti,isOpen:!!q,onClose:Fe,denyButton:{label:ei,variant:ae.Secondary,onClick:Fe},approveButton:{label:Qa,variant:ae.Primary,onClick:()=>{Re(),Fe()}}}),t(mu,{isOpen:ce,onClose:Te,k8sHealthProbesConfig:i,samplingId:a[0]?.id,docsUrl:u,updateK8sHealthProbesConfig:S,createHighlyRelevantOperationRule:f,createCostReductionRule:v})]})},vh=g.div`
750
790
  display: flex;
751
791
  align-items: center;
752
792
  justify-content: space-between;
753
793
  padding: 0 12px;
754
- `,xu=({disabled:a,loading:o,tabs:n,selectedTab:i,setSelectedTab:s,onClickReset:c,onClickRefresh:d})=>{const[p,u]=l(!1),h=r(()=>{const e=[];return c&&e.push({id:Ta(),type:Pt.Button,buttonProps:{label:"Reset",leftIcon:xi,size:P.S,variant:L.Text,onClick:()=>u(!0),disabled:a}}),d&&e.push({id:Ta(),type:Pt.Button,buttonProps:{label:"Refresh",leftIcon:Wi,size:P.S,variant:L.Text,onClick:d,disabled:a,loading:o}}),e},[a,o,d]);return e(ku,{children:[e(R,{$gap:12,$alignItems:"center",children:[t(Ln,{icon:Ui,title:"Odigos Settings"}),t(Be,{width:"350px",options:n,values:[i],setValues:e=>s(e[0]),disabled:a})]}),t(_n,{actions:h}),t(me,{isOpen:p,onClose:()=>u(!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:L.Secondary,onClick:()=>u(!1)},approveButton:{label:"Approve",variant:L.Primary,onClick:()=>{c?.(),u(!1)}}})]})},Tu=m(R)`
794
+ `,yh=({disabled:o,loading:n,tabs:a,selectedTab:i,setSelectedTab:s,onClickReset:c,onClickRefresh:d})=>{const[u,p]=l(!1),h=r(()=>{const e=[];return c&&e.push({id:Fo(),type:Xt.Button,buttonProps:{label:"Reset",leftIcon:ai,size:ne.S,variant:ae.Text,onClick:()=>p(!0),disabled:o}}),d&&e.push({id:Fo(),type:Xt.Button,buttonProps:{label:"Refresh",leftIcon:$i,size:ne.S,variant:ae.Text,onClick:d,disabled:o,loading:n}}),e},[o,n,d]);return e(vh,{children:[e(te,{$gap:12,$alignItems:"center",children:[t(Da,{icon:xi,title:"Odigos Settings"}),t(Je,{width:"350px",options:a,values:[i],setValues:e=>s(e[0]),disabled:o})]}),t(Ra,{actions:h}),t(De,{isOpen:u,onClose:()=>p(!1),title:"Reset Settings",description:"Are you sure you want to reset the settings? This will clear the odigos-local-ui-config and reset the settings to the default values.",denyButton:{label:"Deny",variant:ae.Secondary,onClick:()=>p(!1)},approveButton:{label:"Approve",variant:ae.Primary,onClick:()=>{c?.(),p(!1)}}})]})},Ch=g(te)`
755
795
  flex: 1;
756
796
  min-height: 0;
757
797
  width: 100%;
758
798
  align-self: stretch;
759
- `,Eu=m(C)`
799
+ `,Sh=g(V)`
760
800
  flex: 1;
761
801
  min-height: 0;
762
802
  height: 100%;
763
803
  overflow-y: auto;
764
- `,Nu=e=>"general"===e.name?0:"advanced"===e.name?2:1,$u=({minSupportedVersion:a=0,pageHeightOffset:n=0,configYamls:i,configYamlsLoading:s,effectiveConfig:c,effectiveConfigLoading:d,refetch:p,factoryReset:u,onSave:h,saveLoading:g})=>{const{isVersionSupported:m,version:b,isEnterprise:f}=G(a),v=r(()=>{if(!c)return{};const{manifestYAML:e,provenance:t,...a}=c;return a},[c]),{formData:y,handleFormChange:S,getNestedValue:w,getFormDiff:k,isFormDirty:x}=mt(v);o(()=>{"{}"!==JSON.stringify(v)&&"{}"===JSON.stringify(y)&&S(void 0,void 0,v)},[v,y]);const T=r(()=>[...i].sort((e,t)=>Nu(e)-Nu(t)),[i]),E=r(()=>(e=>{if(!e)return{};const t={};for(const a of e)t[a.helmPath]=a.reconciledFrom;return t})(c?.provenance),[c?.provenance]),N=r(()=>{const e=new Set;for(const t of i)for(const a of t.fields)a.componentType===_.Dropdown&&e.add(a.helmValuePath);return e},[i]),$=r(()=>i.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:w("formData",e.helmValuePath)}))),[i,y,w]),[I,A]=l(!1),O=async()=>{const e=((e,t)=>{const a=(e,t,a)=>{for(let a=0;a<t.length-1;a++){const o=t[a];o in e&&"object"==typeof e[o]&&null!==e[o]||(e[o]={}),e=e[o]}e[t[t.length-1]]=a},o=JSON.parse(JSON.stringify(e));for(const e of t){const t=e.split(".");let n=o;for(const e of t){if(null==n||"object"!=typeof n){n=void 0;break}n=n[e]}"string"==typeof n&&a(o,t,n.replaceAll("-","_"))}return o})(k(v,y),N);await(h?.(e)),S(void 0,void 0,{})},D=r(()=>[{id:Ta(),type:Pt.Button,buttonProps:{"data-id":"settings-save",variant:L.Primary,size:P.S,label:"Save Changes",leftIcon:Bi,loading:g,onClick:()=>A(!0)}},{id:Ta(),type:Pt.Button,buttonProps:{"data-id":"settings-cancel",variant:L.Secondary,size:P.S,label:"Cancel",leftIcon:Mi,onClick:()=>S(void 0,void 0,v)}}],[g,k,v,y,S]),R=r(()=>T.map(e=>({id:e.name,label:e.displayName})),[T]),F=r(()=>T.map(e=>e.name),[T]),{selectedSection:B,setSelectedSection:M,setSectionRef:X,setScrollContainerRef:V}=ki({sectionNames:F});return e(an,{$heightOffset:n,$gap:12,children:[t(xu,{disabled:!m,loading:s||d,tabs:R,selectedTab:B,setSelectedTab:M,onClickReset:u?()=>u().then(()=>p?.()):void 0,onClickRefresh:p?()=>p():void 0}),e(Un,{children:[!m&&t(Dl,{minSupportedVersion:a,currentVersion:b||""}),t(dn,{isOpen:x,richTitle:{icon:Ui,title:"Config Settings"},actions:D}),t(me,{isOpen:I,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:()=>A(!1),denyButton:{label:"Keep editing",variant:L.Secondary,onClick:()=>A(!1)},approveButton:{label:"Save changes",variant:L.Primary,onClick:()=>{O(),A(!1)}}}),e(Tu,{$gap:24,$alignItems:"stretch",children:[t(Eu,{ref:V,$gap:24,$width:"100%",children:i.length?T.map(a=>t(Ae,{id:a.name,ref:e=>X(a.name,e),richTitle:{icon:Ui,title:a.displayName},children:a.fields.map(a=>{if(a.isEnterpriseOnly&&!f)return null;if(a.renderCondition&&!W(a.renderCondition,[],$))return null;const o=je(a.componentProps||"{}",{}),n=E[a.helmValuePath];return e(C,{$gap:4,children:[t(bl,{componentType:a.componentType,inputType:o.type,name:a.helmValuePath,label:a.displayName,tooltip:a.description,badge:n?{status:"odigos-local-ui-config"===n?J.Warning:Je.Unknown,label:n,tooltip:`This field is reconciled from the following resource: ${n}`}:void 0,disabled:a.isHelmOnly||g,value:w("formData",a.helmValuePath),setValue:e=>S(a.helmValuePath,e),dropdownOptions:o.options?.map(e=>({id:e,value:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0},a.helmValuePath),a.isHelmOnly?t(Y,{status:J.Info,smallIcon:!0,message:"This field can only be updated via Helm values.yaml file"}):null]},a.helmValuePath)})},a.name)):s?t(Le,{$height:"30vh",children:t(Xe,{withSpinner:!0})}):t(Ae,{richTitle:{icon:Ui,title:"Config Settings"},children:t(z,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})}),t(Eu,{children:d&&!c?.manifestYAML?t(Le,{$height:"30vh",children:t(Xe,{withSpinner:!0})}):t(Pl,{title:"Effective Config YAML",yaml:c?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0,fullHeight:!0})})]})]})]})};export{ws as AddActionDrawer,Kl as AddActionForm,Cc as AddDataStreamModal,Ds as AddDestinationDrawer,ql as AddDestinationForm,Rs as AddRuleDrawer,is as AddRuleForm,Xs as AddSourceDrawer,Td as CentralConnections,ss as DataStreamForm,ls as DataStreamMergeWarning,Vs as EditActionDrawer,Us as EditConfigDrawer,Sc as EditDataStreamModal,Hs as EditDestinationDrawer,js as EditRuleDrawer,qr as EditSourceDrawer,rs as EditSourceForm,xc as ONBOARDING_DONE_MODAL_ID,Md as Onboarding,Tc as OnboardingDone,au as Overview,mu as PipelineCollectors,yd as SamplingOnboardingModal,dc as SamplingRuleDrawer,gs as SamplingRuleForm,wu as SamplingRules,$u as Settings,yc as SystemDrawer,gu as TABS};
804
+ `,wh=e=>"general"===e.name?0:"advanced"===e.name?2:1,xh=({minSupportedVersion:o=0,pageHeightOffset:a=0,configYamls:i,configYamlsLoading:s,effectiveConfig:c,effectiveConfigLoading:d,refetch:u,factoryReset:p,onSave:h,saveLoading:m})=>{const{isVersionSupported:g,version:f,isEnterprise:b}=y(o),v=r(()=>{if(!c)return{};const{manifestYAML:e,provenance:t,...o}=c;return o},[c]),{formData:C,handleFormChange:S,getNestedValue:w,getFormDiff:x,isFormDirty:k}=wt(v);n(()=>{"{}"!==JSON.stringify(v)&&"{}"===JSON.stringify(C)&&S(void 0,void 0,v)},[v,C]);const T=r(()=>[...i].sort((e,t)=>wh(e)-wh(t)),[i]),$=r(()=>(e=>{if(!e)return{};const t={};for(const o of e)t[o.helmPath]=o.reconciledFrom;return t})(c?.provenance),[c?.provenance]),E=r(()=>{const e=new Set;for(const t of i)for(const o of t.fields)o.componentType===ie.Dropdown&&e.add(o.helmValuePath);return e},[i]),N=r(()=>i.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:w("formData",e.helmValuePath)}))),[i,C,w]),[I,A]=l(!1),O=async()=>{const e=((e,t)=>{const o=(e,t,o)=>{for(let o=0;o<t.length-1;o++){const n=t[o];n in e&&"object"==typeof e[n]&&null!==e[n]||(e[n]={}),e=e[n]}e[t[t.length-1]]=o},n=JSON.parse(JSON.stringify(e));for(const e of t){const t=e.split(".");let a=n;for(const e of t){if(null==a||"object"!=typeof a){a=void 0;break}a=a[e]}"string"==typeof a&&o(n,t,a.replaceAll("-","_"))}return n})(x(v,C),E);await(h?.(e)),S(void 0,void 0,{})},D=r(()=>[{id:Fo(),type:Xt.Button,buttonProps:{"data-id":"settings-save",variant:ae.Primary,size:ne.S,label:"Save Changes",leftIcon:vi,loading:m,onClick:()=>A(!0)}},{id:Fo(),type:Xt.Button,buttonProps:{"data-id":"settings-cancel",variant:ae.Secondary,size:ne.S,label:"Cancel",leftIcon:yi,onClick:()=>S(void 0,void 0,v)}}],[m,x,v,C,S]),R=r(()=>T.map(e=>({id:e.name,label:e.displayName})),[T]),F=r(()=>T.map(e=>e.name),[T]),{selectedSection:P,setSelectedSection:L,setSectionRef:_,setScrollContainerRef:z}=ni({sectionNames:F});return e(sa,{$heightOffset:a,$gap:12,children:[t(yh,{disabled:!g,loading:s||d,tabs:R,selectedTab:P,setSelectedTab:L,onClickReset:p?()=>p().then(()=>u?.()):void 0,onClickRefresh:u?()=>u():void 0}),e(Ma,{children:[!g&&t(bl,{minSupportedVersion:o,currentVersion:f||""}),t(ra,{isOpen:k,richTitle:{icon:xi,title:"Config Settings"},actions:D}),t(De,{isOpen:I,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:()=>A(!1),denyButton:{label:"Keep editing",variant:ae.Secondary,onClick:()=>A(!1)},approveButton:{label:"Save changes",variant:ae.Primary,onClick:()=>{O(),A(!1)}}}),e(Ch,{$gap:24,$alignItems:"stretch",children:[t(Sh,{ref:z,$gap:24,$width:"100%",children:i.length?T.map(o=>t(Ue,{id:o.name,ref:e=>_(o.name,e),richTitle:{icon:xi,title:o.displayName},children:o.fields.map(o=>{if(o.isEnterpriseOnly&&!b)return null;if(o.renderCondition&&!he(o.renderCondition,[],N))return null;const n=nt(o.componentProps||"{}",{}),a=$[o.helmValuePath];return e(V,{$gap:4,children:[t(el,{componentType:o.componentType,inputType:n.type,name:o.helmValuePath,label:o.displayName,tooltip:o.description,badge:a?{status:"odigos-local-ui-config"===a?ge.Warning:st.Unknown,label:a,tooltip:`This field is reconciled from the following resource: ${a}`}:void 0,disabled:o.isHelmOnly||m,value:w("formData",o.helmValuePath),setValue:e=>S(o.helmValuePath,e),dropdownOptions:n.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0},o.helmValuePath),o.isHelmOnly?t(me,{status:ge.Info,smallIcon:!0,message:"This field can only be updated via Helm values.yaml file"}):null]},o.helmValuePath)})},o.name)):s?t(Ke,{$height:"30vh",children:t(Qe,{withSpinner:!0})}):t(Ue,{richTitle:{icon:xi,title:"Config Settings"},children:t(se,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})}),t(Sh,{children:d&&!c?.manifestYAML?t(Ke,{$height:"30vh",children:t(Qe,{withSpinner:!0})}):t(fl,{title:"Effective Config YAML",yaml:c?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0,fullHeight:!0})})]})]})]})};export{ks as AddActionDrawer,Jl as AddActionForm,gd as AddDataStreamModal,Fs as AddDestinationDrawer,Ql as AddDestinationForm,Ps as AddRuleDrawer,ss as AddRuleForm,tr as AddSourceDrawer,Cu as CentralConnections,cs as DataStreamForm,rs as DataStreamMergeWarning,or as EditActionDrawer,nr as EditConfigDrawer,fd as EditDataStreamModal,ar as EditDestinationDrawer,ir as EditRuleDrawer,Gc as EditSourceDrawer,ds as EditSourceForm,yd as ONBOARDING_DONE_MODAL_ID,Fu as Onboarding,Cd as OnboardingDone,qp as Overview,dh as PipelineCollectors,mu as SamplingOnboardingModal,id as SamplingRuleDrawer,fs as SamplingRuleForm,bh as SamplingRules,xh as Settings,md as SystemDrawer,ch as TABS};