@odigos/ui-kit 0.0.235 → 0.0.237

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 (152) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/lib/chunks/{index-D6lL097V.js → index-92vqd713.js} +14 -14
  3. package/lib/chunks/{index-BmuiyBxZ.js → index-DB_UqHYt.js} +1 -1
  4. package/lib/chunks/index-zOzusnDO.js +77 -0
  5. package/lib/chunks/ui-components-CjDRcQJq.js +2235 -0
  6. package/lib/components/_v2/badge/index.d.ts +2 -2
  7. package/lib/components/_v2/cards/data-card/index.d.ts +7 -1
  8. package/lib/components/_v2/cli-command/index.d.ts +3 -0
  9. package/lib/components/_v2/condition/index.d.ts +13 -2
  10. package/lib/components/_v2/segment/index.d.ts +2 -1
  11. package/lib/components/data-card/data-card-fields/index.d.ts +0 -1
  12. package/lib/components/index.d.ts +0 -20
  13. package/lib/components/v2.js +1 -1
  14. package/lib/components.js +1 -1
  15. package/lib/constants.js +1 -1
  16. package/lib/containers/_v2/overview/search/builder.d.ts +1 -1
  17. package/lib/containers/_v2/overview/search/index.d.ts +0 -1
  18. package/lib/containers/index.d.ts +0 -32
  19. package/lib/containers/source-drawer/index.d.ts +1 -1
  20. package/lib/containers/v2.js +55 -57
  21. package/lib/containers.js +19 -556
  22. package/lib/contexts.js +1 -1
  23. package/lib/functions.js +1 -1
  24. package/lib/hooks/useActionFormData.d.ts +1 -1
  25. package/lib/hooks.js +1 -1
  26. package/lib/snippets/index.d.ts +0 -2
  27. package/lib/snippets/v2.js +1 -1
  28. package/lib/snippets.js +1 -1
  29. package/lib/store.js +1 -1
  30. package/lib/theme.js +1 -1
  31. package/lib/types.js +1 -1
  32. package/lib/visuals.js +1 -1
  33. package/package.json +1 -1
  34. package/lib/chunks/index-pkD-mO1h.js +0 -77
  35. package/lib/chunks/ui-components-B4It5sfa.js +0 -2696
  36. package/lib/components/auto-complete-input/index.d.ts +0 -22
  37. package/lib/components/data-finger/index.d.ts +0 -12
  38. package/lib/components/docs-button/index.d.ts +0 -8
  39. package/lib/components/header/index.d.ts +0 -8
  40. package/lib/components/icon-title-badge/index.d.ts +0 -11
  41. package/lib/components/icons-nav/index.d.ts +0 -17
  42. package/lib/components/input-list/index.d.ts +0 -13
  43. package/lib/components/input-table/index.d.ts +0 -13
  44. package/lib/components/input-table/map-columns-to-fields/index.d.ts +0 -15
  45. package/lib/components/input-table/types.d.ts +0 -15
  46. package/lib/components/interactive-table/index.d.ts +0 -27
  47. package/lib/components/interactive-table/table-row.d.ts +0 -13
  48. package/lib/components/key-value-input-list/index.d.ts +0 -20
  49. package/lib/components/monitors-checkboxes/index.d.ts +0 -13
  50. package/lib/components/navigation-buttons/index.d.ts +0 -16
  51. package/lib/components/section-title/index.d.ts +0 -12
  52. package/lib/components/segment/index.d.ts +0 -17
  53. package/lib/components/selection-button/index.d.ts +0 -17
  54. package/lib/components/stepper/index.d.ts +0 -11
  55. package/lib/components/tag/index.d.ts +0 -9
  56. package/lib/components/textarea/index.d.ts +0 -8
  57. package/lib/components/toggle/index.d.ts +0 -12
  58. package/lib/components/trace-loader/index.d.ts +0 -6
  59. package/lib/containers/action-drawer/build-card.d.ts +0 -3
  60. package/lib/containers/action-drawer/index.d.ts +0 -8
  61. package/lib/containers/action-form/custom-fields/add-cluster-info.d.ts +0 -5
  62. package/lib/containers/action-form/custom-fields/delete-attributes.d.ts +0 -5
  63. package/lib/containers/action-form/custom-fields/error-sampler.d.ts +0 -5
  64. package/lib/containers/action-form/custom-fields/index.d.ts +0 -7
  65. package/lib/containers/action-form/custom-fields/k8s-attributes.d.ts +0 -5
  66. package/lib/containers/action-form/custom-fields/latency-sampler.d.ts +0 -5
  67. package/lib/containers/action-form/custom-fields/pii-masking.d.ts +0 -5
  68. package/lib/containers/action-form/custom-fields/probabilistic-sampler.d.ts +0 -5
  69. package/lib/containers/action-form/custom-fields/rename-attributes.d.ts +0 -5
  70. package/lib/containers/action-form/custom-fields/service-name-sampler.d.ts +0 -5
  71. package/lib/containers/action-form/custom-fields/span-attribute-sampler.d.ts +0 -5
  72. package/lib/containers/action-form/custom-fields/url-templatization.d.ts +0 -5
  73. package/lib/containers/action-form/index.d.ts +0 -11
  74. package/lib/containers/action-modal/index.d.ts +0 -7
  75. package/lib/containers/action-table/build-spec-cell.d.ts +0 -3
  76. package/lib/containers/action-table/index.d.ts +0 -7
  77. package/lib/containers/await-pipeline/index.d.ts +0 -4
  78. package/lib/containers/data-flow/column/add.d.ts +0 -8
  79. package/lib/containers/data-flow/column/base.d.ts +0 -21
  80. package/lib/containers/data-flow/column/frame.d.ts +0 -10
  81. package/lib/containers/data-flow/column/head.d.ts +0 -15
  82. package/lib/containers/data-flow/column/index.d.ts +0 -13
  83. package/lib/containers/data-flow/column/namespace-divider.d.ts +0 -7
  84. package/lib/containers/data-flow/column/source-visual-state.d.ts +0 -9
  85. package/lib/containers/data-flow/index.d.ts +0 -12
  86. package/lib/containers/data-flow-actions-menu/add-entity/index.d.ts +0 -4
  87. package/lib/containers/data-flow-actions-menu/data-stream-select/index.d.ts +0 -9
  88. package/lib/containers/data-flow-actions-menu/filters/index.d.ts +0 -4
  89. package/lib/containers/data-flow-actions-menu/index.d.ts +0 -9
  90. package/lib/containers/data-flow-actions-menu/search/index.d.ts +0 -6
  91. package/lib/containers/data-flow-actions-menu/search/search-results/builder.d.ts +0 -25
  92. package/lib/containers/data-flow-actions-menu/search/search-results/index.d.ts +0 -6
  93. package/lib/containers/data-flow-actions-menu/styled.d.ts +0 -10
  94. package/lib/containers/data-stream-drawer/index.d.ts +0 -10
  95. package/lib/containers/data-stream-form/index.d.ts +0 -11
  96. package/lib/containers/data-stream-modal/index.d.ts +0 -7
  97. package/lib/containers/data-stream-selection-form/index.d.ts +0 -13
  98. package/lib/containers/destination-drawer/build-card.d.ts +0 -3
  99. package/lib/containers/destination-drawer/index.d.ts +0 -10
  100. package/lib/containers/destination-form/dynamic-fields/index.d.ts +0 -10
  101. package/lib/containers/destination-form/index.d.ts +0 -15
  102. package/lib/containers/destination-form/test-connection/index.d.ts +0 -12
  103. package/lib/containers/destination-modal/choose-destination/destinations-list/index.d.ts +0 -10
  104. package/lib/containers/destination-modal/choose-destination/index.d.ts +0 -11
  105. package/lib/containers/destination-modal/index.d.ts +0 -13
  106. package/lib/containers/destination-selection-form/destination-list/index.d.ts +0 -8
  107. package/lib/containers/destination-selection-form/index.d.ts +0 -12
  108. package/lib/containers/destination-table/index.d.ts +0 -9
  109. package/lib/containers/dropdowns/condition-dropdown/index.d.ts +0 -15
  110. package/lib/containers/dropdowns/error-dropdown/index.d.ts +0 -16
  111. package/lib/containers/dropdowns/index.d.ts +0 -7
  112. package/lib/containers/dropdowns/kind-dropdown/index.d.ts +0 -15
  113. package/lib/containers/dropdowns/language-dropdown/index.d.ts +0 -15
  114. package/lib/containers/dropdowns/monitor-dropdown/index.d.ts +0 -13
  115. package/lib/containers/dropdowns/namespace-dropdown/index.d.ts +0 -15
  116. package/lib/containers/dropdowns/pods-agent-injection-status-dropdown/index.d.ts +0 -16
  117. package/lib/containers/instrumentation-rule-drawer/build-card.d.ts +0 -3
  118. package/lib/containers/instrumentation-rule-drawer/index.d.ts +0 -8
  119. package/lib/containers/instrumentation-rule-form/custom-fields/code-attributes.d.ts +0 -5
  120. package/lib/containers/instrumentation-rule-form/custom-fields/custom-instrumentation.d.ts +0 -5
  121. package/lib/containers/instrumentation-rule-form/custom-fields/headers-collection.d.ts +0 -5
  122. package/lib/containers/instrumentation-rule-form/custom-fields/index.d.ts +0 -7
  123. package/lib/containers/instrumentation-rule-form/custom-fields/payload-collection.d.ts +0 -5
  124. package/lib/containers/instrumentation-rule-form/index.d.ts +0 -11
  125. package/lib/containers/instrumentation-rule-modal/index.d.ts +0 -7
  126. package/lib/containers/instrumentation-rule-table/build-spec-cell.d.ts +0 -3
  127. package/lib/containers/instrumentation-rule-table/index.d.ts +0 -7
  128. package/lib/containers/multi-source-control/index.d.ts +0 -10
  129. package/lib/containers/setup-summary/index.d.ts +0 -10
  130. package/lib/containers/side-nav/index.d.ts +0 -16
  131. package/lib/containers/slack-invite/index.d.ts +0 -4
  132. package/lib/containers/source-modal/index.d.ts +0 -8
  133. package/lib/containers/source-selection-form/index.d.ts +0 -16
  134. package/lib/containers/source-selection-form/source-list/index.d.ts +0 -8
  135. package/lib/containers/source-table/index.d.ts +0 -9
  136. package/lib/containers/system-overview/describe/index.d.ts +0 -11
  137. package/lib/containers/system-overview/index.d.ts +0 -7
  138. package/lib/containers/system-overview/tokens/expires-at.d.ts +0 -6
  139. package/lib/containers/system-overview/tokens/index.d.ts +0 -8
  140. package/lib/containers/system-overview/tokens/token-actions.d.ts +0 -7
  141. package/lib/containers/table-cell-conditions/index.d.ts +0 -8
  142. package/lib/containers/toggle-dark-mode/index.d.ts +0 -2
  143. package/lib/containers/trace-view/build-spans.d.ts +0 -2
  144. package/lib/containers/trace-view/index.d.ts +0 -9
  145. package/lib/containers/trace-view/span/index.d.ts +0 -38
  146. package/lib/containers/trace-view/span-drawer/build-details-card.d.ts +0 -3
  147. package/lib/containers/trace-view/span-drawer/build-logs-card.d.ts +0 -3
  148. package/lib/containers/trace-view/span-drawer/build-process-card.d.ts +0 -3
  149. package/lib/containers/trace-view/span-drawer/build-tags-card.d.ts +0 -3
  150. package/lib/containers/trace-view/span-drawer/index.d.ts +0 -9
  151. package/lib/snippets/edit-button/index.d.ts +0 -7
  152. package/lib/snippets/note-back-to-summary/index.d.ts +0 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.0.237](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.236...ui-kit-v0.0.237) (2026-05-19)
4
+
5
+
6
+ ### Features
7
+
8
+ * delete some old code ([#905](https://github.com/odigos-io/ui-kit/issues/905)) ([049f30b](https://github.com/odigos-io/ui-kit/commit/049f30b2530d6aa907052aa0b24b11b3e75dd34f))
9
+
10
+ ## [0.0.236](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.235...ui-kit-v0.0.236) (2026-05-18)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * **Filters:** use detectedLanguages instead of containers for language options ([#899](https://github.com/odigos-io/ui-kit/issues/899)) ([80735cc](https://github.com/odigos-io/ui-kit/commit/80735cc89daa7120215ac8dfa4507bb254e1d8c2))
16
+ * hide Conditions panel on VM destinations ([#907](https://github.com/odigos-io/ui-kit/issues/907)) ([0ba78c7](https://github.com/odigos-io/ui-kit/commit/0ba78c70233fc9828e942fe8c757aa194df4fcf9))
17
+ * hide data stream selector on VM ([#904](https://github.com/odigos-io/ui-kit/issues/904)) ([ff8356f](https://github.com/odigos-io/ui-kit/commit/ff8356f8c001aa323702bf2344f004d97ed22d4c))
18
+ * hide Enabled/Disabled toggle on VM destinations ([#906](https://github.com/odigos-io/ui-kit/issues/906)) ([05af0bc](https://github.com/odigos-io/ui-kit/commit/05af0bc10afa9f23f49dddea7545fff2d3f4d4ed))
19
+ * hide Test Connection button on VM destinations ([#903](https://github.com/odigos-io/ui-kit/issues/903)) ([1bfd694](https://github.com/odigos-io/ui-kit/commit/1bfd694abe61078a43130c3f00efaf98c7f6a88a))
20
+ * minor design feedbacks ([#900](https://github.com/odigos-io/ui-kit/issues/900)) ([d27d2a5](https://github.com/odigos-io/ui-kit/commit/d27d2a5e1d99e810644ad6d2818f803d78f1f56b))
21
+ * remove Java from "libraries" supported languages ([#901](https://github.com/odigos-io/ui-kit/issues/901)) ([52c9d38](https://github.com/odigos-io/ui-kit/commit/52c9d3812b46514b10f6949fc23a104079e0b81f))
22
+
3
23
  ## [0.0.235](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.234...ui-kit-v0.0.235) (2026-05-13)
4
24
 
5
25
 
@@ -1,7 +1,7 @@
1
- import{cA as e,a,as as t,j as l,l as r,fs as i,cn as s,cP as n,cu as o,cq as d,bC as c,cr as u,cp as p,ak as h,a4 as g,b_ as m,F as v,y as f,cm as b,S as y,s as x,cL as S,ft as C,fu as k,k as w,fv as T,n as $,fw as P,o as A,p as M,fx as L,fy as O,fz as z,fA as X,fB as R,fC as D,fD as I,e5 as N,fE as E,fF as H,fG as B,fH as V,fI as j,di as q,B as U,fJ as G,fK as J,fL as K,fM as W,fN as F,fO as Z,fP as Y,fQ as _,fR as Q,fS as ee,cF as ae,fT as te,fU as le,cM as re,fV as ie,fW as se,fX as ne,fY as oe,fZ as de,d7 as ce,f_ as ue,f$ as pe,g0 as he,g1 as ge,g2 as me,g3 as ve,g4 as fe,g5 as be,g6 as ye,dm as xe,m as Se,g7 as Ce,g8 as ke,g9 as we,ga as Te,gb as $e,gc as Pe,gd as Ae,ge as Me,gf as Le,gg as Oe,gh as ze,cw as Xe,gi as Re,R as De,gj as Ie,gk as Ne,gl as Ee,gm as He,gn as Be,eL as Ve,bW as je,P as qe,$ as Ue,br as Ge,co as Je,go as Ke,b6 as We,b as Fe,N as Ze,c4 as Ye,L as _e,eO as Qe,w as ea}from"./ui-components-B4It5sfa.js";import{jsx as aa,jsxs as ta,Fragment as la}from"react/jsx-runtime";import{OdigosLogoTextEnterprise as ra,OdigosLogoTextCommunity as ia,EditIcon as sa,ArrowLeftIcon as na,ArrowRightIcon as oa,VSquareIcon as da}from"../icons.js";import{useCallback as ca,useMemo as ua,useState as pa,useRef as ha,useEffect as ga,forwardRef as ma,useImperativeHandle as va}from"react";import fa from"styled-components";import"./index-BmuiyBxZ.js";const ba=({isOpen:t,onClose:l,onDeny:r,onApprove:i})=>aa(e,{title:"Discard changes?",description:"You have unsaved changes.\nIf you cancel now, your changes won't be saved.",isOpen:t,onClose:l,denyButton:{label:"Keep editing",variant:a.Secondary,onClick:()=>{r?.(),l()}},approveButton:{label:"Discard changes",variant:a.Primary,onClick:()=>{i?.(),l()}}}),ya=({isOpen:t,onClose:l,onDeny:r,onApprove:i,action:s="delete",target:n})=>{const o=s.charAt(0).toUpperCase()+s.substring(1),d=n?.endsWith("s")?"these":"this";return aa(e,{title:`${o}${n?` ${n}`:""}?`,description:`Are you sure you want to ${s}${n?` ${d} ${n}`:""}?`,isOpen:t,onClose:l,denyButton:{label:"Go back",variant:a.Secondary,onClick:()=>{r?.(),l()}},approveButton:{label:o,variant:a.Primary,onClick:()=>{i?.(),l()}}})},xa=({componentType:e,inputType:a,name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,value:S,setValue:C,errorMessage:k,warnMessage:w,helpMessage:T,dropdownOptions:$,dropdownNoSearch:P,dropdownNoCheckbox:A,timeUnits:M,timeDefaultUnit:L})=>{switch(e){case t.Input:return aa(p,{name:g,type:a,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,value:S??"",onChange:e=>{const t=e.target.value;C(a===h.Number?""===t?null:Number(t):t)},errorMessage:k,warnMessage:w,helpMessage:T},g);case t.MultiInput:return aa(u,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,values:Array.isArray(S)?S:c(S,[]),setValues:e=>C(e),errorMessage:k,warnMessage:w,helpMessage:T},g);case t.KeyValuePair:return aa(d,{name:g,label:m,tooltip:v,badge:f,required:y,disabled:x,limitFieldsPerRow:2,columns:[{keyName:"key",label:"Key"},{keyName:"value",label:"Value"}],values:Array.isArray(S)?S:c(S,[]),setValues:e=>C(e),errorMessage:k,warnMessage:w,helpMessage:T},g);case t.TextArea:return aa(o,{name:g,label:m,tooltip:v,badge:f,required:y,disabled:x,placeholder:b,value:S??"",onChange:e=>C(e.target.value),errorMessage:k,warnMessage:w,helpMessage:T},g);case t.Dropdown:return aa(n,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,withSearch:!P,options:$?.map(e=>({id:e.id||"",label:e.value||"",withCheckbox:!A}))||[],values:S?[String(S)]:[],setValues:e=>C(e[0]),errorMessage:k,warnMessage:w,helpMessage:T},g);case t.Checkbox:return aa(s,{name:g,label:m,tooltip:v,badge:f,value:!0===S||"true"===S,onChange:e=>C(e),disabled:x,errorMessage:k,warnMessage:w,helpMessage:T},g);case t.Time:return aa(i,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,value:S??"",setValue:e=>C(e),units:M,defaultUnit:L,errorMessage:k,warnMessage:w,helpMessage:T},g);case t.Toggle:return aa(l,{name:g,labelAlign:r.Right,label:m,tooltip:v,badge:f,value:!0===S||"true"===S,onChange:e=>C(e),disabled:x,errorMessage:k,warnMessage:w,helpMessage:T},g);default:return null}},Sa=({size:e=200})=>{const{tier:a}=g();return a===m.Onprem?aa(ra,{size:e}):aa(ia,{size:e})},Ca=[{value:"50",label:"50%"},{value:"25",label:"25%"},{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"custom",label:"Custom"}],ka=[{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"0.5",label:"0.5%"},{value:"0.1",label:"0.1%"},{value:"custom",label:"Custom"}],wa=[{value:"5000",label:"5s"},{value:"1000",label:"1s"},{value:"500",label:"500ms"},{value:"100",label:"100ms"},{value:"50",label:"50ms"},{value:"custom",label:"Custom"}],Ta=({description:e,options:a,selected:t,onSelect:l,customName:r,customLabel:i,customPlaceholder:s,customValue:n,onCustomChange:o})=>ta(v,{$gap:16,$alignItems:"flex-end",children:[ta(f,{$gap:6,children:[aa(b,{label:e}),aa(y,{size:x.S,options:a,selected:t,setSelected:l})]}),"custom"===t&&aa(p,{name:r,label:i,placeholder:s,type:h.Number,value:n,onChange:o,width:160})]}),$a=()=>{},Pa=e=>e.readOnly?aa(Aa,{rule:e.rule}):aa(Ma,{ruleType:e.ruleType,formState:e.formState,onChange:e.onChange}),Aa=({rule:e})=>{const a=null!=e.durationAtLeastMs;return e.error?aa(S,{richTitle:{title:C},children:aa(l,{name:"sampling-view-toggle-keep-errors",onChange:$a,value:!0,size:w.S,label:k,labelAlign:r.Right})}):a?aa(S,{richTitle:{title:T},children:ta("div",{children:[aa($,{size:M.XXXS,color:A.Secondary,children:P}),aa($,{size:M.XS,children:`${e.durationAtLeastMs}ms`})]})}):null},Ma=({ruleType:e,formState:a,onChange:t})=>{const i=ca(e=>t({durationPreset:e}),[t]),s=ca(e=>t({customDurationMs:e.target.value}),[t]);return"Error"===e?aa(S,{richTitle:{title:C,subTitle:L},children:aa(l,{name:"sampling-toggle-keep-errors",value:!0,onChange:$a,size:w.S,label:k,labelAlign:r.Right})}):"Duration"===e?aa(S,{richTitle:{title:T,subTitle:O},children:aa(Ta,{description:P,options:wa,selected:a.durationPreset,onSelect:i,customName:"sampling-input-custom-duration",customLabel:z,customPlaceholder:"200ms",customValue:a.customDurationMs,onCustomChange:s})}):null},La=fa.div`
1
+ import{a$ as e,a,aE as t,a3 as l,a5 as r,ew as i,aw as s,bf as n,aI as o,aB as d,bk as c,aD as u,ay as p,az as h,ak as g,bp as m,j as v,F as f,av as b,ab as y,ad as x,ba as S,ex as C,ey as k,a4 as w,ez as T,a7 as $,eA as P,a8 as A,a9 as M,eB as O,eC as L,eD as z,eE as X,eF as D,eG as R,eH as I,cO as N,eI as E,eJ as H,eK as B,eL as V,eM as j,c0 as q,B as U,eN as G,eO as J,eP as K,eQ as W,eR as F,eS as Z,eT as Q,eU as Y,eV as _,eW as ee,b4 as ae,eX as te,eY as le,bb as re,eZ as ie,e_ as se,e$ as ne,f0 as oe,f1 as de,bQ as ce,f2 as ue,f3 as pe,f4 as he,f5 as ge,f6 as me,f7 as ve,f8 as fe,f9 as be,fa as ye,c4 as xe,a6 as Se,fb as Ce,fc as ke,fd as we,fe as Te,ff as $e,fg as Pe,fh as Ae,fi as Me,fj as Oe,fk as Le,fl as ze,aL as Xe,fm as De,S as Re,fn as Ie,fo as Ne,fp as Ee,fq as He,fr as Be,dC as Ve,aZ as je,ae as qe,a0 as Ue,dw as Ge,ax as Je,fs as Ke,dH as We,b as Fe,N as Ze,r as Qe,ah as Ye,dS as _e,ai as ea}from"./ui-components-CjDRcQJq.js";import{jsx as aa,jsxs as ta,Fragment as la}from"react/jsx-runtime";import{OdigosLogoTextEnterprise as ra,OdigosLogoTextCommunity as ia,EditIcon as sa,ArrowLeftIcon as na,ArrowRightIcon as oa,VSquareIcon as da}from"../icons.js";import{useCallback as ca,useMemo as ua,useState as pa,useRef as ha,useEffect as ga,forwardRef as ma,useImperativeHandle as va}from"react";import fa from"styled-components";import"./index-DB_UqHYt.js";const ba=({isOpen:t,onClose:l,onDeny:r,onApprove:i})=>aa(e,{title:"Discard changes?",description:"You have unsaved changes.\nIf you cancel now, your changes won't be saved.",isOpen:t,onClose:l,denyButton:{label:"Keep editing",variant:a.Secondary,onClick:()=>{r?.(),l()}},approveButton:{label:"Discard changes",variant:a.Primary,onClick:()=>{i?.(),l()}}}),ya=({isOpen:t,onClose:l,onDeny:r,onApprove:i,action:s="delete",target:n})=>{const o=s.charAt(0).toUpperCase()+s.substring(1),d=n?.endsWith("s")?"these":"this";return aa(e,{title:`${o}${n?` ${n}`:""}?`,description:`Are you sure you want to ${s}${n?` ${d} ${n}`:""}?`,isOpen:t,onClose:l,denyButton:{label:"Go back",variant:a.Secondary,onClick:()=>{r?.(),l()}},approveButton:{label:o,variant:a.Primary,onClick:()=>{i?.(),l()}}})},xa=({componentType:e,inputType:a,name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,value:S,setValue:C,errorMessage:k,warnMessage:w,helpMessage:T,dropdownOptions:$,dropdownNoSearch:P,dropdownNoCheckbox:A,timeUnits:M,timeDefaultUnit:O})=>{switch(e){case t.Input:return aa(p,{name:g,type:a,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,value:S??"",onChange:e=>{const t=e.target.value;C(a===h.Number?""===t?null:Number(t):t)},errorMessage:k,warnMessage:w,helpMessage:T},g);case t.MultiInput:return aa(u,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,values:Array.isArray(S)?S:c(S,[]),setValues:e=>C(e),errorMessage:k,warnMessage:w,helpMessage:T},g);case t.KeyValuePair:return aa(d,{name:g,label:m,tooltip:v,badge:f,required:y,disabled:x,limitFieldsPerRow:2,columns:[{keyName:"key",label:"Key"},{keyName:"value",label:"Value"}],values:Array.isArray(S)?S:c(S,[]),setValues:e=>C(e),errorMessage:k,warnMessage:w,helpMessage:T},g);case t.TextArea:return aa(o,{name:g,label:m,tooltip:v,badge:f,required:y,disabled:x,placeholder:b,value:S??"",onChange:e=>C(e.target.value),errorMessage:k,warnMessage:w,helpMessage:T},g);case t.Dropdown:return aa(n,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,withSearch:!P,options:$?.map(e=>({id:e.id||"",label:e.value||"",withCheckbox:!A}))||[],values:S?[String(S)]:[],setValues:e=>C(e[0]),errorMessage:k,warnMessage:w,helpMessage:T},g);case t.Checkbox:return aa(s,{name:g,label:m,tooltip:v,badge:f,value:!0===S||"true"===S,onChange:e=>C(e),disabled:x,errorMessage:k,warnMessage:w,helpMessage:T},g);case t.Time:return aa(i,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,value:S??"",setValue:e=>C(e),units:M,defaultUnit:O,errorMessage:k,warnMessage:w,helpMessage:T},g);case t.Toggle:return aa(l,{name:g,labelAlign:r.Right,label:m,tooltip:v,badge:f,value:!0===S||"true"===S,onChange:e=>C(e),disabled:x,errorMessage:k,warnMessage:w,helpMessage:T},g);default:return null}},Sa=({size:e=200})=>{const{tier:a}=g();return a===m.Onprem?aa(ra,{size:e}):aa(ia,{size:e})},Ca=[{value:"50",label:"50%"},{value:"25",label:"25%"},{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"custom",label:"Custom"}],ka=[{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"0.5",label:"0.5%"},{value:"0.1",label:"0.1%"},{value:"custom",label:"Custom"}],wa=[{value:"5000",label:"5s"},{value:"1000",label:"1s"},{value:"500",label:"500ms"},{value:"100",label:"100ms"},{value:"50",label:"50ms"},{value:"custom",label:"Custom"}],Ta=({description:e,options:a,selected:t,onSelect:l,customName:r,customLabel:i,customPlaceholder:s,customValue:n,onCustomChange:o})=>ta(v,{$gap:16,$alignItems:"flex-end",children:[ta(f,{$gap:6,children:[aa(b,{label:e}),aa(y,{size:x.S,options:a,selected:t,setSelected:l})]}),"custom"===t&&aa(p,{name:r,label:i,placeholder:s,type:h.Number,value:n,onChange:o,width:160})]}),$a=()=>{},Pa=e=>e.readOnly?aa(Aa,{rule:e.rule}):aa(Ma,{ruleType:e.ruleType,formState:e.formState,onChange:e.onChange}),Aa=({rule:e})=>{const a=null!=e.durationAtLeastMs;return e.error?aa(S,{richTitle:{title:C},children:aa(l,{name:"sampling-view-toggle-keep-errors",onChange:$a,value:!0,size:w.S,label:k,labelAlign:r.Right})}):a?aa(S,{richTitle:{title:T},children:ta("div",{children:[aa($,{size:M.XXXS,color:A.Secondary,children:P}),aa($,{size:M.XS,children:`${e.durationAtLeastMs}ms`})]})}):null},Ma=({ruleType:e,formState:a,onChange:t})=>{const i=ca(e=>t({durationPreset:e}),[t]),s=ca(e=>t({customDurationMs:e.target.value}),[t]);return"Error"===e?aa(S,{richTitle:{title:C,subTitle:O},children:aa(l,{name:"sampling-toggle-keep-errors",value:!0,onChange:$a,size:w.S,label:k,labelAlign:r.Right})}):"Duration"===e?aa(S,{richTitle:{title:T,subTitle:L},children:aa(Ta,{description:P,options:wa,selected:a.durationPreset,onSelect:i,customName:"sampling-input-custom-duration",customLabel:z,customPlaceholder:"200ms",customValue:a.customDurationMs,onCustomChange:s})}):null},Oa=fa.div`
2
2
  display: flex;
3
3
  gap: 32px;
4
- `,Oa=fa.div`
4
+ `,La=fa.div`
5
5
  display: flex;
6
6
  flex-direction: column;
7
7
  gap: 4px;
@@ -17,12 +17,12 @@ import{cA as e,a,as as t,j as l,l as r,fs as i,cn as s,cP as n,cu as o,cq as d,b
17
17
  padding: 12px 16px;
18
18
  border-radius: 8px;
19
19
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
20
- `,Ra=fa.div`
20
+ `,Da=fa.div`
21
21
  display: flex;
22
22
  align-items: flex-end;
23
23
  gap: 10px;
24
24
  flex: 1;
25
- `,Da=fa.div`
25
+ `,Ra=fa.div`
26
26
  display: flex;
27
27
  align-items: center;
28
28
  height: 32px;
@@ -31,17 +31,17 @@ import{cA as e,a,as as t,j as l,l as r,fs as i,cn as s,cP as n,cu as o,cq as d,b
31
31
  align-items: flex-end;
32
32
  gap: 16px;
33
33
  margin-bottom: 12px;
34
- `,Na="Any",Ea="Kafka topic",Ha=()=>aa("div",{style:{marginBottom:"8px"},children:aa($,{size:M.XS,weight:500,children:"And"})}),Ba=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"httpClient",label:"HTTP Client"}],Va=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"kafkaConsumer",label:"Kafka Consumer"},{value:"kafkaProducer",label:"Kafka Producer"}],ja=[{id:"",label:Na},{id:"GET",label:"GET"},{id:"POST",label:"POST"},{id:"PUT",label:"PUT"},{id:"DELETE",label:"DELETE"},{id:"PATCH",label:"PATCH"}];const qa=e=>e.readOnly?aa(Ua,{data:e.data}):aa(Ga,{category:e.category,formState:e.formState,onChange:e.onChange}),Ua=({data:e})=>{const a=ua(()=>function(e){if("noisy"===e.category){const a=e.rule.operation;if(a?.httpServer)return[{id:"type",title:W,value:K},{id:"route",title:B,value:a.httpServer.route||a.httpServer.routePrefix||F},{id:"method",title:G,value:a.httpServer.method||Na}];if(a?.httpClient){const e=[{id:"type",title:W,value:Z}];return a.httpClient.serverAddress&&e.push({id:"serverAddress",title:"Server address",value:a.httpClient.serverAddress}),e.push({id:"route",title:B,value:a.httpClient.templatedPath||a.httpClient.templatedPathPrefix||F}),e.push({id:"method",title:G,value:a.httpClient.method||Na}),e}return[{id:"type",title:W,value:Y}]}const a=e.rule.operation;return a?.httpServer?[{id:"type",title:W,value:K},{id:"route",title:B,value:a.httpServer.route||a.httpServer.routePrefix||F},{id:"method",title:G,value:a.httpServer.method||Na}]:a?.kafkaConsumer?[{id:"type",title:W,value:_},{id:"topic",title:Ea,value:a.kafkaConsumer.kafkaTopic||F}]:a?.kafkaProducer?[{id:"type",title:W,value:Q},{id:"topic",title:Ea,value:a.kafkaProducer.kafkaTopic||F}]:[{id:"type",title:W,value:Y}]}(e),[e]);return aa(S,{richTitle:{title:X},children:aa(La,{children:a.map(({id:e,title:a,value:t})=>ta(Oa,{children:[aa($,{size:M.XXXS,color:A.Secondary,nowrap:!0,children:a}),aa($,{size:M.XS,nowrap:!0,children:t})]},e))})})},Ga=({category:e,formState:t,onChange:l})=>{const r=ua(()=>"noisy"===e?Ba:Va,[e]),i=ca(e=>l({operationType:e,route:"",serverAddress:"",method:"",kafkaTopic:""}),[l]),s=ca(e=>a=>{a&&l({routeType:e,route:""})},[l]),n=ca(e=>l({route:e.target.value}),[l]),o=ca(e=>l({serverAddress:e.target.value}),[l]),d=ca(e=>l({method:e[0]||""}),[l]),c=ca(e=>l({kafkaTopic:e.target.value}),[l]),u="httpServer"===t.operationType||"httpClient"===t.operationType,h="kafkaConsumer"===t.operationType||"kafkaProducer"===t.operationType,g="httpClient"===t.operationType?H:B,m="httpClient"===t.operationType?V:j;return ta(S,{richTitle:{title:`2. ${X}`,subTitle:R},children:[aa(f,{$alignItems:"flex-start",children:aa(y,{size:x.S,options:r,selected:t.operationType,setSelected:i})}),u&&ta(za,{children:["httpClient"===t.operationType&&ta(Ia,{children:[aa(p,{name:"sampling-input-server-address",label:I,placeholder:D,value:t.serverAddress,onChange:o}),aa(Ha,{})]}),ta(Xa,{children:[ta(Ra,{children:[aa(Da,{children:aa(N,{"data-id":"sampling-radio-route",value:"route"===t.routeType,onChange:s("route")})}),aa(p,{name:"sampling-input-route",label:g,placeholder:E,value:"route"===t.routeType?t.route:"",onChange:n,disabled:"route"!==t.routeType})]}),ta(Ra,{children:[aa(Da,{children:aa(N,{"data-id":"sampling-radio-route-prefix",value:"routePrefix"===t.routeType,onChange:s("routePrefix")})}),aa(p,{name:"sampling-input-route-prefix",label:m,placeholder:E,value:"routePrefix"===t.routeType?t.route:"",onChange:n,disabled:"routePrefix"!==t.routeType})]})]}),ta(Ia,{children:[aa(Ha,{}),aa(q,{label:G,items:ja,selectedIds:[t.method||""],setSelectedIds:e=>d(e),buttonProps:{"data-id":"sampling-btn-method",label:ja.find(e=>e.id===t.method)?.label||Na,size:U.S,variant:a.Secondary}})]})]}),h&&aa(p,{name:"sampling-input-kafka-topic",label:J,placeholder:"Type kafka topic",value:t.kafkaTopic,onChange:c,width:"320px"})]})},Ja=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Ka=[{value:"all",label:"Keep All"},{value:"sample",label:"Sample"}];const Wa=e=>e.readOnly?aa(Fa,{data:e.data}):aa(Za,{category:e.category,formState:e.formState,onChange:e.onChange}),Fa=({data:e})=>{const a=ua(()=>function(e){switch(e.category){case"highlyRelevant":return null!=e.rule.percentageAtLeast?{title:te,method:ne,description:ie,value:`${e.rule.percentageAtLeast}%`}:{title:te,method:de,description:null,value:null};case"noisy":return null!=e.rule.percentageAtMost?{title:le,method:ne,description:se,value:`${e.rule.percentageAtMost}%`}:{title:le,method:oe,description:null,value:null};case"costReduction":return{title:le,method:ne,description:se,value:`${e.rule.percentageAtMost}%`}}}(e),[e]),t=[{id:"method",title:G,value:a.method},...null!=a.description?[{id:"value",title:a.description,value:a.value}]:[]];return aa(S,{richTitle:{title:a.title},children:aa(La,{children:t.map(({id:e,title:a,value:t})=>ta(Oa,{children:[aa($,{size:M.XXXS,color:A.Secondary,nowrap:!0,children:a}),aa($,{size:M.XS,nowrap:!0,children:t})]},e))})})},Za=({category:e,formState:a,onChange:t})=>{const l="highlyRelevant"===e,r=l?Ka:Ja,i=`${l?4:3}. ${l?te:le}`,s=l?ee:ae,n=l?ie:se,o="noisy"===e?ka:Ca,d=ca(e=>t({percentageMode:e}),[t]),c=ca(e=>t({percentagePreset:e}),[t]),u=ca(e=>t({customPercentage:e.target.value}),[t]);return ta(S,{richTitle:{title:i,subTitle:s},children:["costReduction"!==e&&aa(f,{$alignItems:"flex-start",children:aa(y,{size:x.S,options:r,selected:a.percentageMode,setSelected:d})}),("costReduction"===e||"sample"===a.percentageMode)&&aa(Ta,{description:n,options:o,selected:a.percentagePreset,onSelect:c,customName:"sampling-input-custom-percentage",customLabel:re,customPlaceholder:"5%",customValue:a.customPercentage,onCustomChange:u})]})},Ya=fa.div`
34
+ `,Na="Any",Ea="Kafka topic",Ha=()=>aa("div",{style:{marginBottom:"8px"},children:aa($,{size:M.XS,weight:500,children:"And"})}),Ba=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"httpClient",label:"HTTP Client"}],Va=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"kafkaConsumer",label:"Kafka Consumer"},{value:"kafkaProducer",label:"Kafka Producer"}],ja=[{id:"",label:Na},{id:"GET",label:"GET"},{id:"POST",label:"POST"},{id:"PUT",label:"PUT"},{id:"DELETE",label:"DELETE"},{id:"PATCH",label:"PATCH"}];const qa=e=>e.readOnly?aa(Ua,{data:e.data}):aa(Ga,{category:e.category,formState:e.formState,onChange:e.onChange}),Ua=({data:e})=>{const a=ua(()=>function(e){if("noisy"===e.category){const a=e.rule.operation;if(a?.httpServer)return[{id:"type",title:W,value:K},{id:"route",title:B,value:a.httpServer.route||a.httpServer.routePrefix||F},{id:"method",title:G,value:a.httpServer.method||Na}];if(a?.httpClient){const e=[{id:"type",title:W,value:Z}];return a.httpClient.serverAddress&&e.push({id:"serverAddress",title:"Server address",value:a.httpClient.serverAddress}),e.push({id:"route",title:B,value:a.httpClient.templatedPath||a.httpClient.templatedPathPrefix||F}),e.push({id:"method",title:G,value:a.httpClient.method||Na}),e}return[{id:"type",title:W,value:Q}]}const a=e.rule.operation;return a?.httpServer?[{id:"type",title:W,value:K},{id:"route",title:B,value:a.httpServer.route||a.httpServer.routePrefix||F},{id:"method",title:G,value:a.httpServer.method||Na}]:a?.kafkaConsumer?[{id:"type",title:W,value:Y},{id:"topic",title:Ea,value:a.kafkaConsumer.kafkaTopic||F}]:a?.kafkaProducer?[{id:"type",title:W,value:_},{id:"topic",title:Ea,value:a.kafkaProducer.kafkaTopic||F}]:[{id:"type",title:W,value:Q}]}(e),[e]);return aa(S,{richTitle:{title:X},children:aa(Oa,{children:a.map(({id:e,title:a,value:t})=>ta(La,{children:[aa($,{size:M.XXXS,color:A.Secondary,nowrap:!0,children:a}),aa($,{size:M.XS,nowrap:!0,children:t})]},e))})})},Ga=({category:e,formState:t,onChange:l})=>{const r=ua(()=>"noisy"===e?Ba:Va,[e]),i=ca(e=>l({operationType:e,route:"",serverAddress:"",method:"",kafkaTopic:""}),[l]),s=ca(e=>a=>{a&&l({routeType:e,route:""})},[l]),n=ca(e=>l({route:e.target.value}),[l]),o=ca(e=>l({serverAddress:e.target.value}),[l]),d=ca(e=>l({method:e[0]||""}),[l]),c=ca(e=>l({kafkaTopic:e.target.value}),[l]),u="httpServer"===t.operationType||"httpClient"===t.operationType,h="kafkaConsumer"===t.operationType||"kafkaProducer"===t.operationType,g="httpClient"===t.operationType?H:B,m="httpClient"===t.operationType?V:j;return ta(S,{richTitle:{title:`2. ${X}`,subTitle:D},children:[aa(f,{$alignItems:"flex-start",children:aa(y,{size:x.S,options:r,selected:t.operationType,setSelected:i})}),u&&ta(za,{children:["httpClient"===t.operationType&&ta(Ia,{children:[aa(p,{name:"sampling-input-server-address",label:I,placeholder:R,value:t.serverAddress,onChange:o}),aa(Ha,{})]}),ta(Xa,{children:[ta(Da,{children:[aa(Ra,{children:aa(N,{"data-id":"sampling-radio-route",value:"route"===t.routeType,onChange:s("route")})}),aa(p,{name:"sampling-input-route",label:g,placeholder:E,value:"route"===t.routeType?t.route:"",onChange:n,disabled:"route"!==t.routeType})]}),ta(Da,{children:[aa(Ra,{children:aa(N,{"data-id":"sampling-radio-route-prefix",value:"routePrefix"===t.routeType,onChange:s("routePrefix")})}),aa(p,{name:"sampling-input-route-prefix",label:m,placeholder:E,value:"routePrefix"===t.routeType?t.route:"",onChange:n,disabled:"routePrefix"!==t.routeType})]})]}),ta(Ia,{children:[aa(Ha,{}),aa(q,{label:G,items:ja,selectedIds:[t.method||""],setSelectedIds:e=>d(e),buttonProps:{"data-id":"sampling-btn-method",label:ja.find(e=>e.id===t.method)?.label||Na,size:U.S,variant:a.Secondary}})]})]}),h&&aa(p,{name:"sampling-input-kafka-topic",label:J,placeholder:"Type kafka topic",value:t.kafkaTopic,onChange:c,width:"320px"})]})},Ja=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Ka=[{value:"all",label:"Keep All"},{value:"sample",label:"Sample"}];const Wa=e=>e.readOnly?aa(Fa,{data:e.data}):aa(Za,{category:e.category,formState:e.formState,onChange:e.onChange}),Fa=({data:e})=>{const a=ua(()=>function(e){switch(e.category){case"highlyRelevant":return null!=e.rule.percentageAtLeast?{title:te,method:ne,description:ie,value:`${e.rule.percentageAtLeast}%`}:{title:te,method:de,description:null,value:null};case"noisy":return null!=e.rule.percentageAtMost?{title:le,method:ne,description:se,value:`${e.rule.percentageAtMost}%`}:{title:le,method:oe,description:null,value:null};case"costReduction":return{title:le,method:ne,description:se,value:`${e.rule.percentageAtMost}%`}}}(e),[e]),t=[{id:"method",title:G,value:a.method},...null!=a.description?[{id:"value",title:a.description,value:a.value}]:[]];return aa(S,{richTitle:{title:a.title},children:aa(Oa,{children:t.map(({id:e,title:a,value:t})=>ta(La,{children:[aa($,{size:M.XXXS,color:A.Secondary,nowrap:!0,children:a}),aa($,{size:M.XS,nowrap:!0,children:t})]},e))})})},Za=({category:e,formState:a,onChange:t})=>{const l="highlyRelevant"===e,r=l?Ka:Ja,i=`${l?4:3}. ${l?te:le}`,s=l?ee:ae,n=l?ie:se,o="noisy"===e?ka:Ca,d=ca(e=>t({percentageMode:e}),[t]),c=ca(e=>t({percentagePreset:e}),[t]),u=ca(e=>t({customPercentage:e.target.value}),[t]);return ta(S,{richTitle:{title:i,subTitle:s},children:["costReduction"!==e&&aa(f,{$alignItems:"flex-start",children:aa(y,{size:x.S,options:r,selected:a.percentageMode,setSelected:d})}),("costReduction"===e||"sample"===a.percentageMode)&&aa(Ta,{description:n,options:o,selected:a.percentagePreset,onSelect:c,customName:"sampling-input-custom-percentage",customLabel:re,customPlaceholder:"5%",customValue:a.customPercentage,onCustomChange:u})]})},Qa=fa.div`
35
35
  display: flex;
36
36
  align-items: flex-end;
37
37
  gap: 16px;
38
- `,_a=fa.div`
38
+ `,Ya=fa.div`
39
39
  width: 280px;
40
40
  flex-shrink: 0;
41
- `,Qa=fa.div`
41
+ `,_a=fa.div`
42
42
  flex: 1;
43
43
  min-width: 0;
44
- `;function et(e){return"highlyRelevant"===e.category?e.rule.error?"Error":null!=e.rule.durationAtLeastMs?"Duration":"Relevance":fe[e.category]}const at=e=>e.readOnly?aa(tt,{data:e.data}):aa(lt,{formState:e.formState,onChange:e.onChange}),tt=({data:e})=>{const a=ua(()=>[{id:"name",title:ue,value:e.rule.name||ce},{id:"type",title:pe,value:et(e)}],[e]),t=e.rule.notes||F;return ta(S,{children:[aa(La,{children:a.map(({id:e,title:a,value:t})=>ta(Oa,{children:[aa($,{size:M.XXXS,color:A.Secondary,nowrap:!0,children:a}),aa($,{size:M.XS,nowrap:!0,children:t})]},e))}),ta(Oa,{children:[aa($,{size:M.XXXS,color:A.Secondary,children:he}),aa($,{size:M.XS,children:t})]})]})},lt=({formState:e,onChange:a})=>{const t=ca(e=>a({name:e.target.value}),[a]),l=ca(e=>a({notes:e.target.value}),[a]);return aa(S,{children:ta(Ya,{children:[aa(_a,{children:aa(p,{name:"sampling-input-rule-name",label:ue,tooltip:"Optional. Give this rule a name for easier identification.",placeholder:ge,value:e.name,onChange:t})}),aa(Qa,{children:aa(p,{name:"sampling-input-note",label:he,tooltip:ve,placeholder:me,value:e.notes,onChange:l})})]})})},rt=[{value:"Relevance",label:"Relevance"},{value:"Error",label:"Error"},{value:"Duration",label:"Duration"}],it=({formState:e,onChange:a})=>{const t=ca(e=>a({ruleType:e,keepErrors:"Error"===e}),[a]);return aa(S,{richTitle:{title:`3. ${pe}`,subTitle:be},children:aa(f,{$alignItems:"flex-start",children:aa(y,{size:x.S,options:rt,selected:e.ruleType,setSelected:t})})})},st=fa.div`
44
+ `;function et(e){return"highlyRelevant"===e.category?e.rule.error?"Error":null!=e.rule.durationAtLeastMs?"Duration":"Relevance":fe[e.category]}const at=e=>e.readOnly?aa(tt,{data:e.data}):aa(lt,{formState:e.formState,onChange:e.onChange}),tt=({data:e})=>{const a=ua(()=>[{id:"name",title:ue,value:e.rule.name||ce},{id:"type",title:pe,value:et(e)}],[e]),t=e.rule.notes||F;return ta(S,{children:[aa(Oa,{children:a.map(({id:e,title:a,value:t})=>ta(La,{children:[aa($,{size:M.XXXS,color:A.Secondary,nowrap:!0,children:a}),aa($,{size:M.XS,nowrap:!0,children:t})]},e))}),ta(La,{children:[aa($,{size:M.XXXS,color:A.Secondary,children:he}),aa($,{size:M.XS,children:t})]})]})},lt=({formState:e,onChange:a})=>{const t=ca(e=>a({name:e.target.value}),[a]),l=ca(e=>a({notes:e.target.value}),[a]);return aa(S,{children:ta(Qa,{children:[aa(Ya,{children:aa(p,{name:"sampling-input-rule-name",label:ue,tooltip:"Optional. Give this rule a name for easier identification.",placeholder:ge,value:e.name,onChange:t})}),aa(_a,{children:aa(p,{name:"sampling-input-note",label:he,tooltip:ve,placeholder:me,value:e.notes,onChange:l})})]})})},rt=[{value:"Relevance",label:"Relevance"},{value:"Error",label:"Error"},{value:"Duration",label:"Duration"}],it=({formState:e,onChange:a})=>{const t=ca(e=>a({ruleType:e,keepErrors:"Error"===e}),[a]);return aa(S,{richTitle:{title:`3. ${pe}`,subTitle:be},children:aa(f,{$alignItems:"flex-start",children:aa(y,{size:x.S,options:rt,selected:e.ruleType,setSelected:t})})})},st=fa.div`
45
45
  display: flex;
46
46
  align-items: center;
47
47
  gap: 24px;
@@ -53,7 +53,7 @@ import{cA as e,a,as as t,j as l,l as r,fs as i,cn as s,cP as n,cu as o,cq as d,b
53
53
  min-width: 0;
54
54
  white-space: pre;
55
55
  overflow-x: auto;
56
- `,ot=({title:e,summary:t,onEdit:l,renderAction:r})=>{const i=ua(()=>{const a=[];return e&&(a.push({text:e,variant:ye.Default}),a.push({text:" - ",variant:ye.Default})),a.push(...t),a},[e,t]);return ta(st,{children:[aa(nt,{children:aa(xe,{parts:i})}),r&&r(),l&&aa(Se,{"data-id":"sampling-btn-edit-auto-rule",label:Ce,rightIcon:sa,variant:a.Text,size:U.S,onClick:l})]})},dt=e=>{const a=ua(()=>{if(e.readOnly)return e.summary;switch(e.category){case"noisy":return Te(Le(e.formState));case"highlyRelevant":return we(Me(e.formState));case"costReduction":return ke(Ae(e.formState))}},[e]);if(e.readOnly)return aa(ot,{title:$e,summary:a,renderAction:e.renderAction});const t=1===a.length&&"default"===a[0].variant;return aa(ot,{title:t?Pe:$e,summary:t?[]:a,renderAction:e.renderAction})},ct=fa.div`
56
+ `,ot=({title:e,summary:t,onEdit:l,renderAction:r})=>{const i=ua(()=>{const a=[];return e&&(a.push({text:e,variant:ye.Default}),a.push({text:" - ",variant:ye.Default})),a.push(...t),a},[e,t]);return ta(st,{children:[aa(nt,{children:aa(xe,{parts:i})}),r&&r(),l&&aa(Se,{"data-id":"sampling-btn-edit-auto-rule",label:Ce,rightIcon:sa,variant:a.Text,size:U.S,onClick:l})]})},dt=e=>{const a=ua(()=>{if(e.readOnly)return e.summary;switch(e.category){case"noisy":return Te(Oe(e.formState));case"highlyRelevant":return we(Me(e.formState));case"costReduction":return ke(Ae(e.formState))}},[e]);if(e.readOnly)return aa(ot,{title:$e,summary:a,renderAction:e.renderAction});const t=1===a.length&&"default"===a[0].variant;return aa(ot,{title:t?Pe:$e,summary:t?[]:a,renderAction:e.renderAction})},ct=fa.div`
57
57
  display: flex;
58
58
  flex-wrap: wrap;
59
59
  gap: 8px;
@@ -95,7 +95,7 @@ import{cA as e,a,as as t,j as l,l as r,fs as i,cn as s,cP as n,cu as o,cq as d,b
95
95
  justify-content: center;
96
96
  align-items: center;
97
97
  flex-shrink: 0;
98
- `,vt={[qe.JavaScript]:"Node.js",[qe.DotNet]:".NET",[qe.Php]:"PHP",[qe.Java]:"Java",[qe.Go]:"Go",[qe.Python]:"Python",[qe.Ruby]:"Ruby",[qe.Rust]:"Rust"},ft=[qe.Python,qe.Java,qe.JavaScript,qe.DotNet,qe.Php,qe.Ruby,qe.Go].map(e=>({id:e,label:vt[e]??e.charAt(0).toUpperCase()+e.slice(1),Icon:je(e)})),bt=[{value:"all",label:"Entire Cluster"},{value:"source",label:"Specific Source"},{value:"namespace",label:"Specific Namespace"},{value:"language",label:"Specific Programming Language"}];function yt(e){const a=vt[e];return a||e.charAt(0).toUpperCase()+e.slice(1)}const xt=e=>e.readOnly?aa(St,{scopes:e.scopes}):aa(Ct,{formState:e.formState,onChange:e.onChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions}),St=({scopes:e})=>{if(Oe(e))return aa(S,{richTitle:{title:ze},children:aa(Xe,{status:De.Default,message:Re,fullWidth:!0})});const a=e.sources??[],t=e.namespaces??[],l=e.languages??[];return aa(S,{richTitle:{title:ze},children:ta(ht,{children:[a.map((e,a)=>{const t=[e.namespace,e.kind,e.name].filter(Boolean),l=t.length?t.join(" / "):Ie;return aa(gt,{children:aa($,{size:M.XS,color:A.Primary,children:l})},`src-${a}`)}),t.map((e,a)=>aa(gt,{children:aa($,{size:M.XS,color:A.Primary,children:e})},`ns-${a}`)),l.map((e,a)=>{const t=je(e);return ta(gt,{children:[t&&aa(mt,{children:aa(t,{size:18})}),aa($,{size:M.XS,color:A.Primary,children:yt(e)})]},`lang-${a}`)})]})})},Ct=({formState:e,onChange:a,sourceOptions:t=[],namespaceOptions:l=[]})=>{const[r,i]=pa("all"),{sources:n,namespaces:o,languages:d}=e.sourceScopes,c=n.length>0||o.length>0||d.length>0,u=ua(()=>bt.map(e=>({...e,disabled:"all"===e.value&&c})),[c]),p=ua(()=>n.map(e=>{return a=e.namespace,t=e.kind,l=e.name,`${a}/${t}/${l}`;var a,t,l}),[n]),h=ua(()=>[...o],[o]),g=ua(()=>new Set(d),[d]),m=ca(e=>{i(e)},[]),v=ca(t=>{const l=t.map(e=>function(e){const a=e.split("/");return 3!==a.length?null:{namespace:a[0],kind:a[1],name:a[2]}}(e)).filter(e=>null!==e).map(e=>({namespace:e.namespace,kind:e.kind,name:e.name}));a({sourceScopes:{...e.sourceScopes,sources:l}})},[e.sourceScopes,a]),b=ca(t=>{a({sourceScopes:{...e.sourceScopes,namespaces:t}})},[e.sourceScopes,a]),C=ca(t=>{const l=e.sourceScopes.languages,r=l.includes(t)?l.filter(e=>e!==t):[...l,t];a({sourceScopes:{...e.sourceScopes,languages:r}})},[e.sourceScopes,a]);return ta(S,{richTitle:{title:`1. ${ze}`,subTitle:Ne},children:[aa(Xe,!c&&"all"===r?{status:De.Default,message:Re,fullWidth:!0,smallIcon:!0}:{status:De.Info,message:Ee,fullWidth:!0,smallIcon:!0}),aa(f,{$alignItems:"flex-start",children:aa(y,{size:x.S,options:u,selected:r,setSelected:m})}),"source"===r&&aa(He,{multiple:!0,"data-id":"sampling-autocomplete-source",options:t,value:p,onSelect:v,placeholder:Be}),"namespace"===r&&aa(He,{multiple:!0,"data-id":"sampling-autocomplete-namespace",options:l,value:h,onSelect:b,placeholder:"Search namespace"}),"language"===r&&aa(ct,{children:ft.map(({id:e,label:a,Icon:t})=>{const l=g.has(e);return ta(ut,{$selected:l,onClick:()=>C(e),children:[aa(s,{name:`sampling-scope-lang-${e}`,size:Ve.S,value:l,onChange:()=>C(e)}),aa(pt,{children:aa(t,{size:20})}),aa($,{size:M.XS,nowrap:!0,children:a})]},e)})})]})},kt=(e,a)=>!a?.length||!!a?.find(a=>a===e),wt=({title:e="Signals",required:a,errorMessage:t,allowedSignals:l,selectedSignals:r,setSelectedSignals:i,disabled:n})=>{const[o,d]=pa(1===r.length),c=ha(JSON.stringify(r));ga(()=>{let e=Ue(r).filter(e=>kt(e,l));e.length||(e=Ge.filter(({id:e})=>kt(e,l)).map(({id:e})=>e));const a=JSON.stringify(e);c.current!==a&&(c.current=a,i(e),d(1===e.length))},[l,r]);return ta(f,{$gap:12,children:[aa(b,{label:e,required:a}),aa(v,{$gap:12,children:Ge.map(e=>{const a=kt(e.id,l),t=((e,a)=>!!a?.find(a=>a===e))(e.id,r);return a?aa(s,{label:e.value,disabled:n||!a||o&&t,value:t,onChange:a=>((e,a)=>{const t=e,l=a?[...r,t]:r.filter(e=>e!==t);i(l),d(1===l.length)})(e.id,a)},e.id):null})}),aa(Je,{errorMessage:t})]})},Tt=({minSupportedVersion:a,currentVersion:t})=>aa(e,{isOpen:!0,onClose:()=>{},relativeToParent:!0,visual:()=>aa(Ke,{scale:2.4,icon:()=>aa("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"21",viewBox:"0 0 22 21",fill:"none",children:aa("path",{fill:"#151618",d:"M9.4844 0.730003C9.99694 -0.243259 11.4076 -0.24341 11.92 0.730003L11.9685 0.831353L14.3039 6.22012L20.153 6.77755C21.3553 6.89211 21.841 8.38683 20.9358 9.18621L16.5314 13.0731L17.8091 18.8079C18.0716 19.9868 16.8005 20.9109 15.7605 20.2969L10.7017 17.3093L5.64282 20.2969C4.60289 20.9104 3.33173 19.9866 3.59427 18.8079L4.87192 13.0741L0.468608 9.18621C-0.43662 8.38693 0.0482932 6.8924 1.25029 6.77755L7.09837 6.22012L9.43588 0.831353L9.4844 0.730003ZM8.55284 7.02876C8.35287 7.48992 7.9179 7.80589 7.41751 7.85357L2.03952 8.36571L6.09027 11.941C6.46691 12.2737 6.63296 12.7852 6.5237 13.2758L5.34956 18.5459L10.0008 15.8009L10.1669 15.7179C10.5087 15.574 10.8945 15.5741 11.2364 15.7179L11.4036 15.8009L16.0538 18.5459L14.8807 13.2758C14.7714 12.7851 14.9374 12.2737 15.3141 11.941L19.3627 8.36571L13.9858 7.85357C13.4855 7.80587 13.0505 7.4899 12.8505 7.02876L10.7017 2.07342L8.55284 7.02876Z"})})}),title:"Upgrade Required",description:`To use this feature, please upgrade to Odigos v${a} or later.\nCurrent version: ${t}.`}),$t=fa.div`
98
+ `,vt={[qe.JavaScript]:"Node.js",[qe.DotNet]:".NET",[qe.Php]:"PHP",[qe.Java]:"Java",[qe.Go]:"Go",[qe.Python]:"Python",[qe.Ruby]:"Ruby",[qe.Rust]:"Rust"},ft=[qe.Python,qe.Java,qe.JavaScript,qe.DotNet,qe.Php,qe.Ruby,qe.Go].map(e=>({id:e,label:vt[e]??e.charAt(0).toUpperCase()+e.slice(1),Icon:je(e)})),bt=[{value:"all",label:"Entire Cluster"},{value:"source",label:"Specific Source"},{value:"namespace",label:"Specific Namespace"},{value:"language",label:"Specific Programming Language"}];function yt(e){const a=vt[e];return a||e.charAt(0).toUpperCase()+e.slice(1)}const xt=e=>e.readOnly?aa(St,{scopes:e.scopes}):aa(Ct,{formState:e.formState,onChange:e.onChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions}),St=({scopes:e})=>{if(Le(e))return aa(S,{richTitle:{title:ze},children:aa(Xe,{status:Re.Default,message:De,fullWidth:!0})});const a=e.sources??[],t=e.namespaces??[],l=e.languages??[];return aa(S,{richTitle:{title:ze},children:ta(ht,{children:[a.map((e,a)=>{const t=[e.namespace,e.kind,e.name].filter(Boolean),l=t.length?t.join(" / "):Ie;return aa(gt,{children:aa($,{size:M.XS,color:A.Primary,children:l})},`src-${a}`)}),t.map((e,a)=>aa(gt,{children:aa($,{size:M.XS,color:A.Primary,children:e})},`ns-${a}`)),l.map((e,a)=>{const t=je(e);return ta(gt,{children:[t&&aa(mt,{children:aa(t,{size:18})}),aa($,{size:M.XS,color:A.Primary,children:yt(e)})]},`lang-${a}`)})]})})},Ct=({formState:e,onChange:a,sourceOptions:t=[],namespaceOptions:l=[]})=>{const[r,i]=pa("all"),{sources:n,namespaces:o,languages:d}=e.sourceScopes,c=n.length>0||o.length>0||d.length>0,u=ua(()=>bt.map(e=>({...e,disabled:"all"===e.value&&c})),[c]),p=ua(()=>n.map(e=>{return a=e.namespace,t=e.kind,l=e.name,`${a}/${t}/${l}`;var a,t,l}),[n]),h=ua(()=>[...o],[o]),g=ua(()=>new Set(d),[d]),m=ca(e=>{i(e)},[]),v=ca(t=>{const l=t.map(e=>function(e){const a=e.split("/");return 3!==a.length?null:{namespace:a[0],kind:a[1],name:a[2]}}(e)).filter(e=>null!==e).map(e=>({namespace:e.namespace,kind:e.kind,name:e.name}));a({sourceScopes:{...e.sourceScopes,sources:l}})},[e.sourceScopes,a]),b=ca(t=>{a({sourceScopes:{...e.sourceScopes,namespaces:t}})},[e.sourceScopes,a]),C=ca(t=>{const l=e.sourceScopes.languages,r=l.includes(t)?l.filter(e=>e!==t):[...l,t];a({sourceScopes:{...e.sourceScopes,languages:r}})},[e.sourceScopes,a]);return ta(S,{richTitle:{title:`1. ${ze}`,subTitle:Ne},children:[aa(Xe,!c&&"all"===r?{status:Re.Default,message:De,fullWidth:!0,smallIcon:!0}:{status:Re.Info,message:Ee,fullWidth:!0,smallIcon:!0}),aa(f,{$alignItems:"flex-start",children:aa(y,{size:x.S,options:u,selected:r,setSelected:m})}),"source"===r&&aa(He,{multiple:!0,"data-id":"sampling-autocomplete-source",options:t,value:p,onSelect:v,placeholder:Be}),"namespace"===r&&aa(He,{multiple:!0,"data-id":"sampling-autocomplete-namespace",options:l,value:h,onSelect:b,placeholder:"Search namespace"}),"language"===r&&aa(ct,{children:ft.map(({id:e,label:a,Icon:t})=>{const l=g.has(e);return ta(ut,{$selected:l,onClick:()=>C(e),children:[aa(s,{name:`sampling-scope-lang-${e}`,size:Ve.S,value:l,onChange:()=>C(e)}),aa(pt,{children:aa(t,{size:20})}),aa($,{size:M.XS,nowrap:!0,children:a})]},e)})})]})},kt=(e,a)=>!a?.length||!!a?.find(a=>a===e),wt=({title:e="Signals",required:a,errorMessage:t,allowedSignals:l,selectedSignals:r,setSelectedSignals:i,disabled:n})=>{const[o,d]=pa(1===r.length),c=ha(JSON.stringify(r));ga(()=>{let e=Ue(r).filter(e=>kt(e,l));e.length||(e=Ge.filter(({id:e})=>kt(e,l)).map(({id:e})=>e));const a=JSON.stringify(e);c.current!==a&&(c.current=a,i(e),d(1===e.length))},[l,r]);return ta(f,{$gap:12,children:[aa(b,{label:e,required:a}),aa(v,{$gap:12,children:Ge.map(e=>{const a=kt(e.id,l),t=((e,a)=>!!a?.find(a=>a===e))(e.id,r);return a?aa(s,{label:e.value,disabled:n||!a||o&&t,value:t,onChange:a=>((e,a)=>{const t=e,l=a?[...r,t]:r.filter(e=>e!==t);i(l),d(1===l.length)})(e.id,a)},e.id):null})}),aa(Je,{errorMessage:t})]})},Tt=({minSupportedVersion:a,currentVersion:t})=>aa(e,{isOpen:!0,onClose:()=>{},relativeToParent:!0,visual:()=>aa(Ke,{scale:2.4,icon:()=>aa("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"21",viewBox:"0 0 22 21",fill:"none",children:aa("path",{fill:"#151618",d:"M9.4844 0.730003C9.99694 -0.243259 11.4076 -0.24341 11.92 0.730003L11.9685 0.831353L14.3039 6.22012L20.153 6.77755C21.3553 6.89211 21.841 8.38683 20.9358 9.18621L16.5314 13.0731L17.8091 18.8079C18.0716 19.9868 16.8005 20.9109 15.7605 20.2969L10.7017 17.3093L5.64282 20.2969C4.60289 20.9104 3.33173 19.9866 3.59427 18.8079L4.87192 13.0741L0.468608 9.18621C-0.43662 8.38693 0.0482932 6.8924 1.25029 6.77755L7.09837 6.22012L9.43588 0.831353L9.4844 0.730003ZM8.55284 7.02876C8.35287 7.48992 7.9179 7.80589 7.41751 7.85357L2.03952 8.36571L6.09027 11.941C6.46691 12.2737 6.63296 12.7852 6.5237 13.2758L5.34956 18.5459L10.0008 15.8009L10.1669 15.7179C10.5087 15.574 10.8945 15.5741 11.2364 15.7179L11.4036 15.8009L16.0538 18.5459L14.8807 13.2758C14.7714 12.7851 14.9374 12.2737 15.3141 11.941L19.3627 8.36571L13.9858 7.85357C13.4855 7.80587 13.0505 7.4899 12.8505 7.02876L10.7017 2.07342L8.55284 7.02876Z"})})}),title:"Upgrade Required",description:`To use this feature, please upgrade to Odigos v${a} or later.\nCurrent version: ${t}.`}),$t=fa.div`
99
99
  display: flex;
100
100
  flex-direction: column;
101
101
  justify-content: flex-end;
@@ -119,7 +119,7 @@ import{cA as e,a,as as t,j as l,l as r,fs as i,cn as s,cP as n,cu as o,cq as d,b
119
119
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
120
120
  overflow-y: auto;
121
121
  overflow-x: hidden;
122
- `,Mt=({isLeft:e,isRight:a,heightOffset:t=0,width:l,header:r,list:i})=>ta($t,{$width:l,$columnHasHeader:!!r,children:[r&&aa(Pt,{children:r}),aa(At,{$gap:8,$isLeft:e,$isRight:a,$heightOffset:t,$columnHasHeader:!!r,children:i.length?i.length>1?aa(We,{gap:8,elements:i}):aa(la,{children:i[0]}):aa(Fe,{$height:"100%",children:aa(Ze,{})})})]}),Lt="75vw",Ot=fa.div`
122
+ `,Mt=({isLeft:e,isRight:a,heightOffset:t=0,width:l,header:r,list:i})=>ta($t,{$width:l,$columnHasHeader:!!r,children:[r&&aa(Pt,{children:r}),aa(At,{$gap:8,$isLeft:e,$isRight:a,$heightOffset:t,$columnHasHeader:!!r,children:i.length?i.length>1?aa(We,{gap:8,elements:i}):aa(la,{children:i[0]}):aa(Fe,{$height:"100%",children:aa(Ze,{})})})]}),Ot="75vw",Lt=fa.div`
123
123
  display: flex;
124
124
  flex-direction: column;
125
125
  border-radius: 16px;
@@ -134,12 +134,12 @@ import{cA as e,a,as as t,j as l,l as r,fs as i,cn as s,cP as n,cu as o,cq as d,b
134
134
  top: 0;
135
135
  `,Xt=fa.div`
136
136
  padding: 12px 12px 0 12px;
137
- `,Rt=fa.div`
137
+ `,Dt=fa.div`
138
138
  display: flex;
139
139
  gap: 12px;
140
140
  padding: 16px;
141
- `,Dt=fa.div`
141
+ `,Rt=fa.div`
142
142
  padding: 5vh 10vw;
143
143
  border-radius: 12px;
144
144
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
145
- `,It=ma(({isOpen:t,withOverlay:l,disableAnimation:r,onClose:i,onBack:s,onNext:n,nextIsSkip:o,onSave:d,disableSave:c,connectionIds:u,header:p,subHeader:h,leftColumn:g,rightColumn:m,search:v,filters:f,errorMessage:b,isFormDirty:y,hideDirtyNote:x,isFetching:S,progress:C},k)=>{const[w,T]=pa(!1),[$,P]=pa(!1),[A,L]=pa(void 0);va(k,()=>({clearErrors:()=>L(void 0)}));const O=$,z=ca(()=>{y&&!w?T(!0):(T(!1),i?.())},[y,w,i]),X=c||$||"boolean"==typeof y&&!y,R=ca(async()=>{P(!0);const e=await d();P(!1),e?.error?L(e.error):(u?.setValue([]),i?.())},[d,u,i]),D=!!v||!!u||!!f,I=!!h,N=(D?48:0)+(I?50:0),E=ua(()=>S?{status:De.Info,message:"Fetching Data..."}:$&&!C?{status:De.Info,message:"Saving Changes..."}:A||b?{status:De.Error,message:A||b}:"boolean"==typeof y&&y&&!x?{status:De.Info,message:'The values don\'t reflect the current configurations of the selected clusters.\n"Save" will override the current configurations.'}:"boolean"!=typeof y||y||x?void 0:{status:De.Success,message:"The values reflect the current configuration of the selected cluster."},[S,$,C,A,b,y,x]),H=ua(()=>s?{label:"Back",leftIcon:na,variant:a.Secondary,onClick:s}:{label:"Cancel",variant:a.Secondary,onClick:z,disabled:O},[s,z,O]),[B,V]=pa(!1),j=ua(()=>n?o?{"data-id":"wide-drawer-skip",label:"Skip",rightIcon:oa,variant:a.Secondary,onClick:()=>V(!0)}:{"data-id":"wide-drawer-next",label:"Next",rightIcon:oa,variant:a.Primary,onClick:n}:{"data-id":"wide-drawer-save",label:"Save",variant:a.Primary,onClick:R,disabled:X},[n,o,R,X]);return ta(Ye,{width:Lt,isOpen:t,disableAnimation:r,hideOverlay:!$&&!l,header:{...p,onClose:i?z:void 0,onCloseDisabled:O},footer:{note:E,actions:[H,j]},children:[$?aa(Fe,{$height:"calc(100vh - 136px)",children:aa(Dt,{children:aa(_e,{titleSize:M.S,subTitleSize:M.XXXS,withGradient:!0,withSpinner:!0,...C})})}):ta(Ot,{children:[D&&ta(zt,{children:[u&&aa(Qe,{icon:da,title:"Selected Clusters",badge:{label:u.value.length}}),v&&aa(ea,{width:"100%",...v}),f]}),I&&aa(Xt,{children:aa(Qe,{icon:h.icon,title:h.title,subTitle:h.description,badge:h.badge})}),ta(Rt,{children:[aa(Mt,{isLeft:!0,heightOffset:N,...g}),aa(Mt,{isRight:!0,heightOffset:N,...m})]})]}),aa(ba,{isOpen:w,onClose:()=>T(!1),onApprove:z}),aa(e,{title:"Skip setup?",description:"Without completing setup, Odigos won't be able to collect and send your telemetry data. This may interrupt your data flow and limit the platform's ability to provide value.",isOpen:B,onClose:()=>V(!1),denyButton:{label:"Go Back",variant:a.Secondary,onClick:()=>V(!1)},approveButton:{label:"Skip",variant:a.Primary,onClick:()=>{n?.(),V(!1)}}})]})});It.displayName=It.name;export{ot as A,ba as C,xa as D,ka as N,qa as O,Ta as P,at as R,wt as S,Tt as U,It as W,Ca as a,dt as b,xt as c,it as d,Pa as e,Wa as f,ya as g,Lt as h,Sa as i,wa as j};
145
+ `,It=ma(({isOpen:t,withOverlay:l,disableAnimation:r,onClose:i,onBack:s,onNext:n,nextIsSkip:o,onSave:d,disableSave:c,connectionIds:u,header:p,subHeader:h,leftColumn:g,rightColumn:m,search:v,filters:f,errorMessage:b,isFormDirty:y,hideDirtyNote:x,isFetching:S,progress:C},k)=>{const[w,T]=pa(!1),[$,P]=pa(!1),[A,O]=pa(void 0);va(k,()=>({clearErrors:()=>O(void 0)}));const L=$,z=ca(()=>{y&&!w?T(!0):(T(!1),i?.())},[y,w,i]),X=c||$||"boolean"==typeof y&&!y,D=ca(async()=>{P(!0);const e=await d();P(!1),e?.error?O(e.error):(u?.setValue([]),i?.())},[d,u,i]),R=!!v||!!u||!!f,I=!!h,N=(R?48:0)+(I?50:0),E=ua(()=>S?{status:Re.Info,message:"Fetching Data..."}:$&&!C?{status:Re.Info,message:"Saving Changes..."}:A||b?{status:Re.Error,message:A||b}:"boolean"==typeof y&&y&&!x?{status:Re.Info,message:'The values don\'t reflect the current configurations of the selected clusters.\n"Save" will override the current configurations.'}:"boolean"!=typeof y||y||x?void 0:{status:Re.Success,message:"The values reflect the current configuration of the selected cluster."},[S,$,C,A,b,y,x]),H=ua(()=>s?{label:"Back",leftIcon:na,variant:a.Secondary,onClick:s}:{label:"Cancel",variant:a.Secondary,onClick:z,disabled:L},[s,z,L]),[B,V]=pa(!1),j=ua(()=>n?o?{"data-id":"wide-drawer-skip",label:"Skip",rightIcon:oa,variant:a.Secondary,onClick:()=>V(!0)}:{"data-id":"wide-drawer-next",label:"Next",rightIcon:oa,variant:a.Primary,onClick:n}:{"data-id":"wide-drawer-save",label:"Save",variant:a.Primary,onClick:D,disabled:X},[n,o,D,X]);return ta(Qe,{width:Ot,isOpen:t,disableAnimation:r,hideOverlay:!$&&!l,header:{...p,onClose:i?z:void 0,onCloseDisabled:L},footer:{note:E,actions:[H,j]},children:[$?aa(Fe,{$height:"calc(100vh - 136px)",children:aa(Rt,{children:aa(Ye,{titleSize:M.S,subTitleSize:M.XXXS,withGradient:!0,withSpinner:!0,...C})})}):ta(Lt,{children:[R&&ta(zt,{children:[u&&aa(_e,{icon:da,title:"Selected Clusters",badge:{label:u.value.length}}),v&&aa(ea,{width:"100%",...v}),f]}),I&&aa(Xt,{children:aa(_e,{icon:h.icon,title:h.title,subTitle:h.description,badge:h.badge})}),ta(Dt,{children:[aa(Mt,{isLeft:!0,heightOffset:N,...g}),aa(Mt,{isRight:!0,heightOffset:N,...m})]})]}),aa(ba,{isOpen:w,onClose:()=>T(!1),onApprove:z}),aa(e,{title:"Skip setup?",description:"Without completing setup, Odigos won't be able to collect and send your telemetry data. This may interrupt your data flow and limit the platform's ability to provide value.",isOpen:B,onClose:()=>V(!1),denyButton:{label:"Go Back",variant:a.Secondary,onClick:()=>V(!1)},approveButton:{label:"Skip",variant:a.Primary,onClick:()=>{n?.(),V(!1)}}})]})});It.displayName=It.name;export{ot as A,ba as C,xa as D,ka as N,qa as O,Ta as P,at as R,wt as S,Tt as U,It as W,Ca as a,dt as b,xt as c,it as d,Pa as e,Wa as f,ya as g,Ot as h,Sa as i,wa as j};
@@ -1,3 +1,3 @@
1
- import{jsx as t}from"react/jsx-runtime";import{useMemo as e}from"react";import i from"styled-components";import{u as o,B as s,a,A as n,g as l,D as r,C as c,b as p,N as m}from"./ui-components-B4It5sfa.js";import{VIcon as d,CopyIcon as u,YamlIcon as f}from"../icons.js";const h=i.div`
1
+ import{jsx as t}from"react/jsx-runtime";import{useMemo as e}from"react";import i from"styled-components";import{u as o,B as s,a,A as n,g as l,D as r,C as c,b as p,N as m}from"./ui-components-CjDRcQJq.js";import{VIcon as d,CopyIcon as u,YamlIcon as f}from"../icons.js";const h=i.div`
2
2
  padding: 0 12px;
3
3
  `,g=({title:i="YAML",yaml:g,defaultOpen:b,fullHeight:T,bgTint:y="1000"})=>{const{clickCopy:C,isCopied:x}=o(),A=e(()=>g?[{id:l(),type:n.Button,buttonProps:{variant:a.Text,size:s.S,leftIcon:x?d:u,onClick:()=>C(g||""),disabled:x}}]:[],[g,x]);return t(r,{bgTint:y,richTitle:{icon:f,title:i},actions:A,withCollapse:!0,collapseIsDefaultOpen:b,fullHeight:T,children:t(h,{children:g?t(c,{code:g,language:"yaml",theme:"duotoneDark"}):t(p,{children:t(m,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})})};export{g as Y};
@@ -0,0 +1,77 @@
1
+ import{jsxs as e,Fragment as t,jsx as n}from"react/jsx-runtime";import{forwardRef as i,useState as o,useRef as l,useImperativeHandle as r,useEffect as a,Children as s,Fragment as c,useLayoutEffect as d,useMemo as u,useCallback as h}from"react";import f,{useTheme as m}from"styled-components";import{y as p,z as g,T as v,G as y,H as b,J as x,K as w,E as S,L as k,n as $,M as C,O as T,j as z,Q as I,R as N,U as F,b as P,V as E,F as O,e as R,S as L,W as D,X as M,s as A,Y as B,Z as W,_ as X,$ as j,g as V,a0 as Y,x as H,a1 as _,a2 as U,a3 as J,a4 as K,a5 as Z,a6 as G,B as q,a as Q,a7 as ee,a8 as te,a9 as ne,aa as ie,ab as oe,ac as le,ad as re,ae,af as se,ag as ce,ah as de,ai as ue,N as he,aj as fe,t as me,ak as pe,al as ge,am as ve,an as ye,ao as be,ap as xe,aq as we,ar as Se,as as ke,at as $e}from"./ui-components-CjDRcQJq.js";import{Y as Ce}from"./index-DB_UqHYt.js";import{EditIcon as Te,TrashIcon as ze,RefreshIcon as Ie,SearchIcon as Ne,MinusIcon as Fe,PlusIcon as Pe,XIcon as Ee,ExpandIcon as Oe,CopyIcon as Re,DotIcon as Le,DownloadIcon as De,RefreshLeftArrowIcon as Me}from"../icons.js";const Ae=i(({children:i,width:a=640,title:s,titleTooltip:c,hideEditTitleFromEdit:d,icons:u,iconSrcs:h,isEdit:f=!1,isFormDirty:k=!1,isLastItem:$=!1,onClose:C,onEdit:T,onSave:z,onDelete:I,onCancel:N,tabs:F,headerActionButtons:P},E)=>{const O=m(),{drawerType:R,setDrawerType:L,setDrawerEntityId:D}=p();g({key:"Enter",active:f},()=>J());const[M,A]=o(!1),[B,W]=o(!1),X=l(null),j=R===S.Source,V=()=>{A(!1),W(!1)},Y=()=>{V(),T&&T(!1),L(null),D(null),C?.()};r(E,()=>({closeDrawer:Y}));const H=()=>{X.current?.clearTitle(),N&&N(),V()},_=()=>{const e=X.current?.isTitleDirty();k||e?W(!0):H()},U=()=>{A(!0)},J=()=>{z&&z(X.current?.getTitle()||"")},K=P||[];return T&&!f&&K.push({"data-id":"drawer-edit",variant:"tertiary",onClick:()=>T(!0),children:e(t,{children:[n(Te,{}),n(v,{size:14,family:"secondary",decoration:"underline",children:"Edit"})]})}),I&&!f&&K.push({"data-id":"drawer-delete",variant:"tertiary",onClick:U,children:e(t,{children:[n(ze,{}),n(v,{color:O.text.error,size:14,family:"secondary",decoration:"underline",children:j?y.UNINSTRUMENT:y.DELETE})]})}),e(t,{children:[n(b,{isOpen:!0,onClose:f?_:Y,closeOnEscape:!M&&!B,width:"number"==typeof a?`${a+64}px`:a,header:{icons:u,iconSrcs:h,title:s,titleTooltip:c,replaceTitleWith:!d&&f?n(Be,{ref:X,title:s}):void 0,actionButtons:K,tabs:F},footer:{isOpen:f,leftButtons:[{"data-id":"drawer-save",variant:"primary",onClick:J,children:y.SAVE},{"data-id":"drawer-cancel",variant:"secondary",onClick:_,children:y.CANCEL}],rightButtons:I?[{"data-id":"drawer-delete",variant:"tertiary",onClick:U,children:e(t,{children:[n(ze,{}),n(v,{size:14,color:O.text.error,family:"secondary",decoration:"underline",children:y.DELETE})]})}]:[]},children:i}),n(x,{isOpen:M,noOverlay:!0,name:`${R}${s?` (${s})`:""}`,type:R,isLastItem:$,onApprove:()=>{I&&I(),V()},onDeny:V}),n(w,{isOpen:B,noOverlay:!0,name:"edit mode",onApprove:H,onDeny:V})]})}),Be=i(({title:e},t)=>{const[i,l]=o(e);return a(()=>{l(e)},[e]),r(t,()=>({getTitle:()=>i||e,isTitleDirty:()=>i!==e,clearTitle:()=>l(e)})),n(k,{"data-id":"title",value:i,onChange:e=>l(e.target.value)})});Be.displayName=Be.name,Ae.displayName=Ae.name;const We=(e,t)=>{const{name:n,kind:i,namespace:o}=e,l=[{title:$.KIND,value:i},{title:$.NAME,value:n,tooltip:"Resource name"}];return t||(l.unshift({title:$.NAMESPACE,value:o}),l.push({type:C.Divider}),l.push({type:C.CopyText,value:`kubectl get ${i} ${n} -n ${o}`.toLowerCase()})),l},Xe=f.div`
2
+ display: flex;
3
+ flex-direction: column;
4
+ gap: 24px;
5
+ padding: 4px;
6
+ `,je=({formData:e,handleFormChange:t})=>n(Xe,{children:n(k,{name:"sourceName",title:"Source name",tooltip:"This overrides the default service name that runs in your cluster.",placeholder:"Use a name that overrides the source name",value:e.otelServiceName,onChange:({target:{value:e}})=>t("otelServiceName",e)})}),Ve=({workloadOdigosHealthStatus:e})=>{if(!e)return null;const t=F(e?.status),i=T(e?.reasonEnum),o=e?.message;return n(z,{$alignItems:"center",$justifyContent:"center",children:n(I,{status:t,title:i,subtitle:o,withBackground:t!==N.Disabled,withBorder:!0,withIcon:!0,width:"calc(100% - 24px)"})})},Ye=({source:t,fetchSourceDescribe:i,onClickRestartPod:l})=>{const[r,c]=o(!1),[d,u]=o(null);return a(()=>{t&&i({namespace:t.namespace,name:t.name,kind:t.kind}).then(({data:e})=>{e?.describeSource?u(e.describeSource):c(!0)})},[t.namespace,t.name,t.kind]),d||r?n(O,{$gap:12,children:r?n(P,{$height:"70vh",children:n(R,{subTitle:"Could not fetch describe for this source"})}):d?.pods?.length?d.pods.map(({podName:i,nodeName:o,phase:r,agentInjected:a,runningLatestWorkloadRevision:c,containers:u,manifestYAML:h})=>{const f=r.status!==L.Success||D(u)?L.Error:L.Success,m=[];return m.push(n(M,{value:`kubectl get pod ${i.value} -n ${d?.namespace?.value||t.namespace}`.toLowerCase()},"copy-text")),m.push(n(A,{length:"100%",margin:"0"},"divider-1")),m.push(n(B,{title:o.name,tooltip:o.explain||"",value:{status:o.status||void 0,text:o.value}},"describe-row-1")),m.push(n(A,{length:"100%",margin:"0"},"divider-2")),m.push(n(B,{title:r.name,tooltip:r.explain||"",value:{status:r.status||void 0,text:r.value}},"describe-row-2")),m.push(n(A,{length:"100%",margin:"0"},"divider-3")),m.push(n(B,{title:a.name,tooltip:a.explain||"",value:{status:a.status||void 0,text:a.value}},"describe-row-3")),m.push(n(A,{length:"100%",margin:"0"},"divider-4")),c?.name&&(m.push(n(B,{title:c.name,tooltip:c.explain||void 0,value:{status:c.status||void 0,text:c.value}},"describe-row-4")),m.push(n(A,{length:"100%",margin:"0"},"divider-5"))),u.forEach(e=>{m.push(n(W,{...e},`pod-container-${e.containerName.value}`))}),h&&(m.push(n(A,{length:"100%",margin:"0"},"divider-6")),m.push(n(Ce,{yaml:h},"yaml-section-card"))),n(X,{title:`Pod: ${i.value}`,withExtend:!0,action:({hovered:o})=>e("div",{style:{position:"relative"},children:[n(I,{status:f,title:f,withIcon:!0,withBorder:!0},"status"),o&&n(j,{isOpen:!0,positionRight:"calc(100% + 12px)",actions:l?[{id:V(),label:"Restart",rightIcon:Ie,onClick:()=>l(d?.namespace?.value||t.namespace,i.value)}]:[]},"hover-actions")]}),children:s.toArray(m)},`pod-${i.value}`)}):n(P,{$height:"70vh",children:n(R,{subTitle:"Check if you have any running pods and try again"})})}):n(P,{$height:"70vh",children:n(E,{})})},He=f(z)`
7
+ width: 100%;
8
+ align-items: center;
9
+ justify-content: space-between;
10
+ `,_e=({source:t,fetchSourceLibraries:i})=>{const l=m(),[r,s]=o(!1),[d,u]=o(null);return a(()=>{t&&i({namespace:t.namespace,name:t.name,kind:t.kind}).then(({data:e})=>{e?.instrumentationInstanceComponents?u(Y(e.instrumentationInstanceComponents).sort((e,t)=>e.name.localeCompare(t.name))):s(!0)})},[t.namespace,t.name,t.kind]),d||r?n(O,{$gap:12,children:r?n(P,{$height:"70vh",children:n(R,{subTitle:"Could not fetch libraries for this source"})}):d?.length?n(X,{title:"Instrumented Libraries",children:d.map(({name:t,healthy:i,message:o,nonIdentifyingAttributes:r},a)=>e(c,{children:[e(O,{$gap:4,$width:"100%",children:[e(He,{$width:"100%",children:[n(v,{size:12,color:l.text.grey,children:t}),e(z,{$gap:4,children:[r.map(({key:e,value:i})=>_(i)&&U(i)&&"is_standard_lib"===e?n(I,{status:L.Default,title:"STANDARD",withBorder:!0},`${t}-${e}`):null),"boolean"==typeof i&&n(I,{status:i?L.Success:L.Error,title:i?"HEALTHY":"UNHEALTHY",withBorder:!0})]})]}),o&&n(v,{size:10,color:l.text.error,align:"right",children:o})]}),a!==d.length-1&&n(A,{length:"100%",margin:"0"})]},`library-${t}`))}):e(P,{$height:"70vh",$gap:12,children:[n(R,{title:"No libraries found",subTitle:""}),n(H,{type:L.Warning,message:"This feature is in early development, and has very limited support"})]})}):n(P,{$height:"70vh",children:n(E,{})})};function Ue(e,t){const n=e.names[t];if(null==n)return"";if("string"==typeof n)return n;if("object"==typeof n&&"name"in n){const e=n.name;if("string"==typeof e)return e}return"number"==typeof n||"boolean"==typeof n?String(n):""}function Je(e){const t=Math.abs(e);return t>=1e9?`${Ke(e/1e9)}s`:t>=1e6?`${Ke(e/1e6)}ms`:t>=1e3?`${Ke(e/1e3)}μs`:String(Math.round(e))}function Ke(e){return e.toFixed(2).replace(/\.?0+$/,"")}function Ze(e){const t=[];for(let n=0;n<e.levels.length;n++){const i=e.levels[n];let o=0;for(let e=0;e+3<i.length;e+=4){const l=i[e],r=i[e+1],a=i[e+2],s=i[e+3],c=o+l;t.push({level:n,offset:c,size:r,self:a,nameIndex:s}),o=c+r}}return t}function Ge(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function qe(e,t){const n=t.trim().toLowerCase();return!n||e.toLowerCase().includes(n)}function Qe(e,t,n,i,o,l={}){if(0===e.levels.length||t<2||n<2)return null;const{zoomRoot:r=null,shouldKeepName:a,collapseRecursive:s=!1}=l,c=Ze(e);let d=r?function(e,t){const n=e.reduce((e,t)=>Math.max(e,t.level),t.level),i=new Map;for(const t of e){const e=i.get(t.level);e?e.push(t):i.set(t.level,[t])}const o=[t];for(let e=t.level+1;e<=n;e++){const t=o.filter(t=>t.level===e-1);if(0===t.length)break;const n=i.get(e);if(n?.length)for(const e of n)for(const n of t)if(e.offset>=n.offset&&e.offset+e.size<=n.offset+n.size){o.push(e);break}}return o}(c,r):c;if(0===d.length)return null;if(a&&(d=d.filter(t=>a(Ue(e,t.nameIndex))),0===d.length))return null;if(s&&(d=function(e,t){if(0===t.length)return t;const n=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),i=new Map;for(const e of n){const t=i.get(e.level);t?t.push(e):i.set(e.level,[e])}const o=new Set;for(const t of n){const n=i.get(t.level+1);if(!n)continue;const l=n.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==l.length)continue;const r=l[0];r.size===t.size&&Ue(e,r.nameIndex)===Ue(e,t.nameIndex)&&o.add(Ge(r))}if(0===o.size)return n;const l=[];for(const e of n){if(o.has(Ge(e)))continue;let t=0;for(let n=0;n<e.level;n++){const l=i.get(n);if(!l)continue;const r=l.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);r&&o.has(Ge(r))&&t++}l.push({...e,level:e.level-t})}return l}(e,d),0===d.length))return null;const u=r?.level??0,h=r?.offset??0,f=r?.size??e.numTicks;if(f<=0)return null;const m=d.reduce((e,t)=>Math.max(e,t.level-u),0)+1,p=i??Number.POSITIVE_INFINITY,g=Math.max(1,Math.min(n/m,p)),v=o.trim(),y=g>8?1:0;return d.map(n=>{const i=n.level-u,o=(n.offset-h)/f*t,l=Math.max(n.size/f*t,1),r=i*g,a=Math.max(g-y,1),s=Ue(e,n.nameIndex);return{...n,x:o,y:r,w:l,h:a,name:s,matchesSearch:qe(s,v)}})}function et(e,t){let n=0;for(let t=0;t<e.length;t++)n=31*n+e.charCodeAt(t)>>>0;const i=t.v2.colors.black[500],o=[{fill:t.v2.colors.purple[300],text:i},{fill:t.v2.colors.green[300],text:i},{fill:t.v2.colors.red[300],text:i},{fill:t.v2.colors.blue[300],text:i},{fill:t.v2.colors.yellow[300],text:i}];return o[n%o.length]}var tt,nt;!function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(tt||(tt={})),function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(nt||(nt={}));function it(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function ot(e,t,n){for(const i of n)if(e>=i.x&&e<i.x+i.w&&t>=i.y&&t<i.y+i.h)return i;return null}function lt(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 rt=({flamebearer:t,maxRowPx:i,searchQuery:r="",shouldKeepName:s,minHostHeight:c=200,onFullscreenChange:f,profilingSlots:p})=>{const g=m(),v=l(null),y=l(null),b=l({x:0,y:0}),x=l(t.numTicks),[w,S]=o({w:0,h:0}),[k,$]=o(""),[C,T]=o(null),[I,N]=o([]),[F,P]=o(!1),[E,O]=o(tt.Fit),[R,L]=o(nt.Fit),[D,M]=o(!1),A=Math.max(1,Math.min(Math.floor(w.w*E),8192)),B=Math.max(1,Math.min(Math.floor(w.h*R),8192)),W=I.length>0?I[I.length-1]:null,X=W?.size??t.numTicks;a(()=>{x.current!==t.numTicks&&(x.current=t.numTicks,N([]))},[t.numTicks]),d(()=>{const e=v.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();S({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),a(()=>{if(!F)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[F]),a(()=>(f?.(F),()=>{F&&f?.(!1)}),[F,f]);const j=u(()=>Qe(t,A,B,i,r,{zoomRoot:W,shouldKeepName:s,collapseRecursive:D}),[t,i,r,B,A,W,s,D]),V=u(()=>function(e){return[...e].sort((e,t)=>t.level-e.level)}(j?.length?r.trim()?j.filter(e=>e.matchesSearch):j:[]),[j,r]),Y=h(e=>{if(A<2||B<2)return;const n=e.currentTarget.getBoundingClientRect();if(n.width<1||n.height<1)return;const i=ot((e.clientX-n.left)/n.width*A,(e.clientY-n.top)/n.height*B,V);if(i){const e=Ge(i);T(e);const n=X>0?(100*i.size/X).toFixed(1):"0",o=t.numTicks>0?(100*i.size/t.numTicks).toFixed(1):"0";$(`${i.name}\ntotal ${Je(i.size)} (${n}% of view, ${o}% of profile) · self ${Je(i.self)}`)}else T(null),$("")},[V,t.numTicks,B,A,X]),H=h(e=>{Y(e)},[Y]),_=h(()=>{T(null),$("")},[]),U=h(e=>{b.current={x:e.clientX,y:e.clientY}},[]),ae=h(e=>{const{x:t,y:n}=b.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-n)>3)return;if(A<2||B<2)return;const i=e.currentTarget.getBoundingClientRect();if(i.width<1||i.height<1)return;const o=ot((e.clientX-i.left)/i.width*A,(e.clientY-i.top)/i.height*B,V);if(!o)return;const l=function(e){return{level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}}(o);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}(l,t)?e.slice(0,-1):[...e,l]})},[V,B,A]);d(()=>{const e=y.current;if(!e||A<2||B<2)return;const n="undefined"!=typeof window&&window.devicePixelRatio||1,i=Math.max(A,B),o=Math.min(n,16384/i);e.width=Math.floor(A*o),e.height=Math.floor(B*o),e.style.width=`${A}px`,e.style.height=`${B}px`;const l=e.getContext("2d");l&&(l.setTransform(o,0,0,o,0,0),l.clearRect(0,0,A,B),j?.length?function(e,t,n,i,o,l,r,a){const s=l.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,n);const c=o.trim().length>0;e.textRendering="optimizeLegibility";for(const t of i){const{x:n,y:i,w:o,h:r,name:s,size:d,matchesSearch:u}=t;if(c&&!u)continue;const{fill:h,text:f}=et(s,l);e.fillStyle=h,e.fillRect(n,i,o,r),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(n+.5,i+.5),e.lineTo(n+o-.5,i+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(n+.5,i+.5,Math.max(o-1,0),Math.max(r-1,0));const m=it(d,a),p=`${s} (${Je(d)}, ${m}%)`,g=l.v2.text.size.xs,v=8,y=5,b=26,x=Math.min(g,Math.floor(r-2));if(o>=b&&x>=v){e.font=`${x}px ${l.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=p;for(;t.length>2&&e.measureText(t).width>o-2*y;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=o-2*y&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,n+y,i+r/2),e.fillStyle=f,e.fillText(t,n+y,i+r/2))}}if(r)for(const t of i){if(Ge(t)!==r)continue;if(c&&!t.matchesSearch)continue;const{x:n,y:i,w:o,h:l}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(n+1,i+1,Math.max(o-2,0),Math.max(l-2,0));break}}(l,A,B,j,r,g,C,t.numTicks):(l.fillStyle=g.v2.colors.silver[900],l.fillRect(0,0,A,B)))},[j,t.numTicks,C,r,B,A,g]);const se=h(()=>P(e=>!e),[]),ce=t.numTicks>0?Math.max(0,Math.min(100,Math.round(X/t.numTicks*100))):100,de=u(()=>function(e,t){const n=Ze(e),i=t?.offset??0,o=i+(t?.size??e.numTicks),l=(t?.level??-1)+1,r=t?.size??e.numTicks;let a=null;for(const e of n)e.level<l||e.offset<i||e.offset+e.size>o||e.size>=r||(!a||e.size>a.size||e.size===a.size&&e.level<a.level)&&(a=e);return a}(t,W),[t,W]),ue=null!==de,he=I.length>0,fe=W?Ue(t,W.nameIndex):"",me=h(()=>N([]),[]),pe=h(()=>N(e=>e.slice(0,-1)),[]),ge=h(()=>{de&&N(e=>[...e,de])},[de]);return e("div",{style:F?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:g.v2.colors.silver[900]}:{flex:1,minHeight:c,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(z,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[n(J,{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:K.S,value:D,onChange:M}),e(z,{$gap:8,children:[e(z,{children:[n(G,{variant:Q.Secondary,size:q.S,label:"Reset zoom",leftIcon:Ne,onClick:me,disabled:!I.length}),n(G,{variant:Q.Secondary,size:q.S,iconSize:20,leftIcon:Fe,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!he,onClick:pe}),n("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:n(ee,{size:ne.XXS,color:te.Secondary,nowrap:!0,align:"center",children:`${ce}%`})}),n(G,{variant:Q.Secondary,size:q.S,iconSize:20,leftIcon:Pe,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!ue,onClick:ge})]}),e(z,{children:[n(ie,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:n(oe,{size:re.S,variant:le.Filled,options:[{value:tt.Fit,label:"W: Fit"},{value:tt.X10,label:"10x"}],selected:E,setSelected:O})}),n(ie,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:n(oe,{size:re.S,variant:le.Filled,options:[{value:nt.Fit,label:"H: Fit"},{value:nt.X10,label:"10x"}],selected:R,setSelected:L})})]}),n(G,{variant:Q.Secondary,size:q.S,iconSize:24,leftIcon:F?Ee:Oe,tooltip:F?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:se})]})]}),n(ie,{fullWidth:!0,keepAlive:!0,text:k,children:n("div",{ref:v,style:{flex:1,minWidth:0,width:"100%",height:F?"calc(100vh - 80px)":"calc(100vh - 370px)",position:"relative",overflowX:E>1?"auto":"hidden",overflowY:R>1?"auto":"hidden"},children:n("div",{style:{width:A||"100%",height:B||"100%",position:"relative"},children:n("canvas",{ref:y,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:C?"pointer":"default"},onPointerDown:U,onPointerMove:H,onPointerLeave:_,onClick:ae})})})}),e(z,{$justifyContent:"space-between",children:[n(ee,W?{size:ne.XXXS,color:g.v2.colors.silver[300],children:`Zoomed: ${fe} • ${Je(X)} samples in view`}:{size:ne.XXXS,color:g.v2.colors.silver[300],children:"Click a frame to zoom into its subtree (pprof-style)."}),p&&n(ee,{size:ne.XXXS,color:g.v2.colors.silver[300],children:`${p.activeKeys.length} / ${p.maxSlots} profiling slots · ${lt(p.totalBytesUsed)} / ${lt(p.maxTotalBytesBudget)} budget · TTL ${p.slotTtlSeconds}s`})]})]})};var at,st;!function(e){e.Symbol="symbol",e.Self="self",e.Total="total"}(at||(at={})),function(e){e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"}(st||(st={}));const ct=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function dt(e,t){const n=function(e){return e.split(" ")[0]??""}(e);if(t.includes(st.FilterOutVoid)&&"void"===n)return!1;if(t.includes(st.OnlyWithReturnValues)){if(!(e.includes(" ")&&"void"!==n&&ct.test(n)))return!1}return!0}const ut={options:[{id:st.FilterOutVoid,label:"Filter out void symbols"},{id:st.OnlyWithReturnValues,label:"Only show functions with return values"}],filterRow:(e,t)=>dt(e.cells.find(e=>e.key===at.Symbol)?.rawValue?.toString()??"",t)},ht=({rows:e,languages:t,filters:i,onFiltersChange:o})=>{const l=u(()=>[{key:at.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:t?.includes(ae.Java)?ut:void 0,noFilter:!t?.includes(ae.Java)},{key:at.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:at.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[t]),r=u(()=>e.map(e=>({cells:[{key:at.Symbol,rawValue:e.name},{key:at.Self,rawValue:Je(e.self)},{key:at.Total,rawValue:Je(e.total)}]})),[e]);return n(se,{variant:ce.Data,maxHeight:"calc(100vh - 306px)",columns:l,rows:r,filters:i,onFiltersChange:o,rowActionsPushLeftPosition:"12px",getRowActions:e=>[{id:`copy-${e.cells[0].rawValue}`,label:"",rightIcon:Re,onClick:()=>{navigator.clipboard.writeText(e.cells[0].rawValue)}}]})};var ft;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(ft||(ft={}));const mt=f(O)`
11
+ width: 100%;
12
+ min-height: 0;
13
+ flex: 1;
14
+ border-radius: 16px;
15
+ overflow: hidden;
16
+ background: ${({theme:e})=>e.v2.colors.silver[800]};
17
+ box-shadow: 0 2px 14.1px 0 rgba(0, 0, 0, 0.25);
18
+ `,pt=f.div`
19
+ display: flex;
20
+ align-items: center;
21
+ gap: 10px;
22
+ flex-wrap: wrap;
23
+ padding: 12px 12px 8px;
24
+ background: ${({theme:e})=>e.v2.colors.silver[800]};
25
+ border-radius: 16px 16px 0 0;
26
+ `,gt=f(z)`
27
+ flex-shrink: 0;
28
+ align-items: center;
29
+ gap: 4px;
30
+ `,vt=f.div`
31
+ display: flex;
32
+ flex: 1;
33
+ align-items: stretch;
34
+ gap: ${({$gap:e})=>e}px;
35
+ padding: 16px;
36
+ min-height: 0;
37
+ background: ${({theme:e})=>e.v2.colors.silver[800]};
38
+ border-radius: 0 0 16px 16px;
39
+ `,yt=f(O)`
40
+ flex: ${({$splitWithFlame:e})=>e?"0 0 min(413px, 42%)":"1 1 auto"};
41
+ width: ${({$splitWithFlame:e})=>e?"auto":"100%"};
42
+ max-width: ${({$splitWithFlame:e})=>e?"none":"100%"};
43
+ min-width: 0;
44
+ min-height: 0;
45
+ gap: 10px;
46
+ `,bt=f(O)`
47
+ flex: ${({$splitWithTable:e})=>e?"1":"1 1 auto"};
48
+ width: ${({$splitWithTable:e})=>e?"auto":"100%"};
49
+ min-width: 0;
50
+ min-height: 0;
51
+ gap: 10px;
52
+ `,xt=f(z)`
53
+ width: 100%;
54
+ min-height: 32px;
55
+ flex-shrink: 0;
56
+ `,wt=({source:t,fetchProfilingSlots:i,enableProfiling:r,fetchSourceProfiling:s,onFlameFullscreenChange:d})=>{const f=m(),p=u(()=>({namespace:t.namespace,kind:t.kind,name:t.name}),[t.namespace,t.kind,t.name]),[g,v]=o(!0),[y,b]=o(null),[x,w]=o(null),[S,k]=o(0),[$,C]=o(ft.Both),[T,I]=o(""),[N,F]=o({}),E=l(null),O=h(async()=>{try{const e=[i()];g&&e.push(s(p));const[t,n]=await Promise.all(e);t&&b(t),n?.profileJson&&w(n.profileJson)}finally{k(e=>e+1)}},[i,s,p]);a(()=>{let e=!1;return(async()=>{await r(p),e||(await O(),e||(E.current=setInterval(O,3e3)))})(),()=>{e=!0,E.current&&clearInterval(E.current)}},[r,O,p]);const R=u(()=>function(e){if(!e?.trim())return null;try{const t=JSON.parse(e),n=t.flamebearer;return!n?.names?.length||!Array.isArray(n.levels)||"number"!=typeof n.numTicks||n.numTicks<=0?null:{flamebearer:n,units:t.metadata?.units}}catch{return null}}(x),[x]),L=u(()=>R?function(e){const t=new Map;for(let n=0;n<e.levels.length;n++){const i=e.levels[n];for(let n=0;n+3<i.length;n+=4){const o=i[n+1],l=i[n+2],r=Ue(e,i[n+3]);if(!r)continue;const a=t.get(r);(!a||o>a.total)&&t.set(r,{self:l,total:o})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)}(R.flamebearer):[],[R]),D=u(()=>{const e=T.trim().toLowerCase();return e?L.filter(t=>t.name.toLowerCase().includes(e)):L},[L,T]),M=$===ft.Table||$===ft.Both,A=$===ft.Flame||$===ft.Both,B=M&&A,W=t.detectedLanguages||t.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??""),X=u(()=>function(e,t){if(!t?.includes(ae.Java))return;const n=e?.[at.Symbol]?.filter(Boolean)??[];return 0!==n.length?e=>dt(e,n):void 0}(N,W),[N,W]);return S<2?n(P,{$height:"70vh",children:n(de,{withSpinner:!0})}):e(mt,{$gap:0,$width:"100%",children:[e(pt,{children:[n(ie,{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:n(gt,{children:n(ee,{size:ne.S,weight:500,color:te.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(z,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[n("div",{style:{flex:"1 1 220px",minWidth:180},children:n(ue,{value:T,onChange:I,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:f.v2.colors.silver[900],emphasizeBackgroundColor:f.v2.colors.silver[800]})}),n(oe,{size:re.S,variant:le.Filled,options:[{value:ft.Table,label:"Top table"},{value:ft.Flame,label:"Flame graph"},{value:ft.Both,label:"Both"}],selected:$,setSelected:C}),n(G,g?{variant:Q.Secondary,size:q.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=>n(Le,{...e,size:8,fill:f.v2.colors.green[500]})}:{variant:Q.Secondary,size:q.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>n(Le,{...e,size:8,fill:f.v2.colors.red[500]})})]})]}),n(vt,{$gap:M&&A?16:0,children:R?e(c,{children:[M&&e(yt,{$splitWithFlame:B,children:[n(xt,{$justifyContent:"flex-end",children:n(G,{variant:Q.Secondary,size:q.S,label:"Download snapshot",rightIcon:De,onClick:()=>{if(!x)return;const e=new Blob([x],{type:"application/json"}),n=URL.createObjectURL(e),i=document.createElement("a");i.href=n,i.download=`cpu-profile-${t.namespace}-${t.kind}-${t.name}.json`,i.click(),URL.revokeObjectURL(n)},disabled:!x})}),n(ht,{rows:D,languages:W,filters:N,onFiltersChange:F})]}),A&&e(bt,{$splitWithTable:B,children:[e(xt,{$justifyContent:"space-between",children:[n(fe,{label:R?`Total in view ${Je(R.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:f.v2.colors.silver[750],textColor:f.v2.colors.silver[200],textSize:ne.XXS}),e(z,{$gap:12,children:[!g&&n(G,{variant:Q.Secondary,size:q.S,label:"Refresh",leftIcon:Ie,onClick:O}),n(J,{label:"Auto refresh",labelAlign:Z.Left,size:K.S,value:g,onChange:v})]})]}),n(rt,{flamebearer:R.flamebearer,maxRowPx:24,searchQuery:T,shouldKeepName:X,minHostHeight:280,onFullscreenChange:d,profilingSlots:y},$)]})]}):n(P,{children:n(he,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})})]})},St="70vh",kt=(e,t)=>e.serviceName.localeCompare(t.serviceName),$t=f(v)`
57
+ cursor: ${({$clickable:e})=>e?"pointer":"default"};
58
+ text-decoration: ${({$clickable:e})=>e?"underline":"none"};
59
+ &:hover {
60
+ opacity: ${({$clickable:e})=>e?.7:1};
61
+ }
62
+ `,Ct=f(z)`
63
+ justify-content: flex-end;
64
+ align-items: center;
65
+ gap: 6px;
66
+ cursor: pointer;
67
+ `,Tt=({items:i,emptyMessage:o,keyPrefix:l,findSource:r,onNavigate:a})=>{const s=m();return i.length?n(t,{children:i.map(({serviceName:t},o)=>{const d=!!r(t);return e(c,{children:[n($t,{size:13,color:d?s.text.secondary:s.text.grey,$clickable:d,onClick:()=>a(t),children:t}),o!==i.length-1&&n(A,{length:"100%",margin:"0"})]},`${l}-${t}`)})}):n(v,{size:13,color:s.text.grey,children:o})},zt=({source:t,fetchPeerSources:i})=>{const l=m(),{setDrawerType:r,setDrawerEntityId:s}=p(),c=me(e=>e.sources),[d,u]=o(!1),[f,g]=o(!1),[y,b]=o(null),x=t.otelServiceName||t.name,w=h(()=>{x&&(g(!0),u(!1),i(x).then(({data:e})=>{e?.peerSources?b(e.peerSources):u(!0)}).finally(()=>g(!1)))},[x]);a(()=>{w()},[w]);const k=h(e=>c.find(t=>t.otelServiceName===e||t.name===e),[c]),$=h(e=>{const t=k(e);t&&(r(S.Source),s({namespace:t.namespace,name:t.name,kind:t.kind}))},[k,r,s]);if(!y&&!d&&f)return n(P,{$height:St,children:n(E,{})});if(d)return n(P,{$height:St,children:n(R,{subTitle:"Could not fetch peer sources"})});const C=y?.inbound?[...y.inbound].sort(kt):[],T=y?.outbound?[...y.outbound].sort(kt):[];return e(O,{$gap:12,children:[n(X,{title:"Inbound",titleBadge:C.length,description:`Services that send requests to ${x}`,children:n(Tt,{items:C,emptyMessage:"No inbound connections",keyPrefix:"inbound",findSource:k,onNavigate:$})}),n(X,{title:"Outbound",titleBadge:T.length,description:`Services that ${x} sends requests to`,children:n(Tt,{items:T,emptyMessage:"No outbound connections",keyPrefix:"outbound",findSource:k,onNavigate:$})}),e(Ct,{onClick:w,children:[n(Ie,{size:14}),n(v,{size:12,color:l.text.grey,decoration:"underline",children:"Refresh"})]})]})};var It;!function(e){e.Overview="Overview",e.Pods="Pods",e.Libraries="Libraries",e.PeerSources="Peer Sources",e.Profiling="Profiling"}(It||(It={}));const Nt=[xe.Deployment,xe.StatefulSet,xe.DaemonSet,xe.DeploymentConfig,xe.Rollout,xe.StaticPod],Ft=[xe.Deployment,xe.StatefulSet,xe.DaemonSet,xe.DeploymentConfig,xe.Rollout,xe.Pod],Pt=[ae.Python,ae.Go],Et=f.div`
68
+ width: 100%;
69
+ height: 100%;
70
+ max-height: calc(100vh - 220px);
71
+ overflow: overlay;
72
+ overflow-y: auto;
73
+ `,Ot=f.div`
74
+ display: flex;
75
+ flex-direction: column;
76
+ gap: 12px;
77
+ `;var Rt;!function(e){e.Workload="Workload",e.Pod="Pod"}(Rt||(Rt={}));const Lt=({persistSources:i,updateSource:r,restartWorkloads:s,fetchSourceById:c,fetchSourceDescribe:d,fetchSourceLibraries:h,fetchPeerSources:f,restartPod:m,recoverFromRollback:g,profilingEnabled:y,fetchProfilingSlots:b,enableProfiling:x,fetchSourceProfiling:w})=>{const{isVm:k}=pe(),C=me(e=>e.sources),{selectedStreamName:T}=ge(),{drawerType:z,drawerEntityId:I}=p(),F=u(()=>ve(C,T),[C,T]),P=l(null),E=z===S.Source,[O,R]=o(!1),[D,M]=o(!1),[A,B]=o(It.Overview),[W,j]=o(null),[V,Y]=o(!1);a(()=>{E&&I&&c(I).then(e=>j(e||null))},[E,I]);const{formData:_,handleFormChange:U,resetFormData:J,loadFormWithDrawerItem:K}=ye(),Z=u(()=>{if(I)return W&&JSON.stringify(be(W))===JSON.stringify(be(I))?W:F?.find(e=>JSON.stringify(be(e))===JSON.stringify(be(I)))},[I,F,W]);a(()=>{E&&Z?K(Z):J()},[E,Z]);const G=u(()=>{const e=Z?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===N.Loading,containers:Z?.containers||[]}},[Z]),q=u(()=>!!Z?.rollbackOccurred,[Z?.rollbackOccurred]),Q=u(()=>{const e=[{label:It.Overview,onClick:()=>B(It.Overview),selected:A===It.Overview}];return k||(Nt.includes(Z?.kind)&&e.push({label:It.Pods,onClick:()=>B(It.Pods),selected:A===It.Pods}),Z?.containers?.some(e=>Pt.includes(e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language))&&e.push({label:It.Libraries,onClick:()=>B(It.Libraries),selected:A===It.Libraries}),e.push({label:It.PeerSources,onClick:()=>B(It.PeerSources),selected:A===It.PeerSources}),y&&b&&x&&w&&e.push({label:It.Profiling,onClick:()=>B(It.Profiling),selected:A===It.Profiling})),e},[A,Z,k,y,b,x,w]),ee=Ft.includes(Z?.kind),[te,ne]=o({openFor:null,workloadId:void 0,podNamespace:void 0,podName:void 0});if(!Z)return null;return e(Ae,{ref:P,width:V?"95vw":A===It.Profiling?"80vw":void 0,onClose:()=>{B(It.Overview),j(null),Y(!1)},title:Z.otelServiceName||Z.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:$e(Z.containers),isEdit:O,isFormDirty:D,onEdit:A===It.Overview?e=>{R("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=_.otelServiceName!==Z.name?_.otelServiceName:"";U("otelServiceName",e),await r(I,{..._,otelServiceName:e}),j(null),M(!1),R(!1)},onDelete:A===It.Overview?async()=>{const{namespace:e,name:t,kind:n}=Z;i({[e]:[{namespace:e,name:t,kind:n||void 0,selected:!1,currentStreamName:T}]}),j(null),M(!1),R(!1),P.current?.closeDrawer()}:void 0,onCancel:()=>{M(!1),R(!1),U("otelServiceName",Z.otelServiceName||Z.name||"")},isLastItem:1===F.length,tabs:Q,headerActionButtons:k?[]:ee?[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>ne({openFor:Rt.Workload,workloadId:I}),children:e(t,{children:[n(Me,{}),n(v,{size:14,family:"secondary",decoration:"underline",children:"Restart"})]})}]:[],children:[A===It.Overview?O?n(Et,{children:n(je,{formData:_,handleFormChange:(...e)=>{M(!0),U(...e),U("currentStreamName",T)}})}):e(Ot,{children:[n(Ve,{workloadOdigosHealthStatus:Z.workloadOdigosHealthStatus}),q&&n(H,{type:L.Warning,message:$.ROLLBACK_OCCURRED_MESSAGE,action:{label:$.ROLLBACK_RECOVER,onClick:async()=>{await g(I);const e=await c(I);e&&j(e)}}}),n(we,{conditions:Z.conditions||[]}),n(X,{title:$.SOURCE_DETAILS,data:Z?We(Z,k):[]}),n(X,{title:k?$.DETECTED_PROCESSES:$.DETECTED_CONTAINERS,titleBadge:G.isLoading?N.Loading:G.containers.length,description:G.description||(k?$.DETECTED_PROCESSES_DESCRIPTION:$.DETECTED_CONTAINERS_DESCRIPTION),children:G.containers.map(e=>n(Se,{...e,callbackRuntimeOverride:e=>r(I,e)},`source-container-${e.containerName}`))}),Z.manifestYAML&&n(Ce,{title:`${Z.kind} YAML`,yaml:Z.manifestYAML,defaultOpen:!Z.instrumentationConfigYAML}),Z.instrumentationConfigYAML&&n(Ce,{title:"Instrumentation Config YAML",yaml:Z.instrumentationConfigYAML,defaultOpen:!Z.manifestYAML})]}):A===It.Pods?n(Ye,{source:Z,fetchSourceDescribe:d,onClickRestartPod:ee?(e,t)=>ne({openFor:Rt.Pod,podNamespace:e,podName:t}):void 0}):A===It.Libraries?n(_e,{source:Z,fetchSourceLibraries:h}):A===It.PeerSources?n(zt,{source:Z,fetchPeerSources:f}):A===It.Profiling&&y&&b&&x&&w?n(wt,{source:Z,fetchProfilingSlots:b,enableProfiling:x,fetchSourceProfiling:w,onFlameFullscreenChange:Y}):null,n(ke,{isOpen:!!te.openFor,title:`Rollout Restart ${te.openFor}`,description:`Are you sure you want to rollout restart this ${te.openFor?.toLowerCase()}?`,approveButton:{text:"Confirm",variant:L.Warning,onClick:()=>{te.openFor===Rt.Workload&&te.workloadId?s([te.workloadId]):te.openFor===Rt.Pod&&te.podNamespace&&te.podName&&m(te.podNamespace,te.podName),ne({openFor:null})}},denyButton:{text:"Go Back",onClick:()=>{ne({openFor:null})}}})]})};export{Ae as O,Lt as S,je as a};