@odigos/ui-kit 0.0.225 → 0.0.227

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 (71) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/lib/chunks/index-B0b5lJH3.js +3 -0
  3. package/lib/chunks/index-C-Z4QHpA.js +149 -0
  4. package/lib/chunks/ui-components-C7i9zbc-.js +2652 -0
  5. package/lib/components/_v2/cards/data-card/index.d.ts +16 -3
  6. package/lib/components/_v2/charts/gauge-chart/index.d.ts +18 -0
  7. package/lib/components/_v2/charts/index.d.ts +1 -0
  8. package/lib/components/_v2/condition/index.d.ts +13 -0
  9. package/lib/components/_v2/conditions/index.d.ts +8 -0
  10. package/lib/components/_v2/drawer/header/index.d.ts +6 -1
  11. package/lib/components/_v2/drop-data/index.d.ts +1 -0
  12. package/lib/components/_v2/icon-button/index.d.ts +1 -0
  13. package/lib/components/_v2/index.d.ts +3 -0
  14. package/lib/components/_v2/tag/index.d.ts +2 -1
  15. package/lib/components/v2.js +1 -1
  16. package/lib/components.js +1 -1
  17. package/lib/constants.js +1 -1
  18. package/lib/containers/_v2/_drawers/add-destination-drawer/index.d.ts +1 -1
  19. package/lib/containers/_v2/_drawers/add-source-drawer/index.d.ts +3 -1
  20. package/lib/containers/_v2/_drawers/edit-action-drawer/helpers.d.ts +12 -0
  21. package/lib/containers/_v2/_drawers/edit-action-drawer/index.d.ts +9 -0
  22. package/lib/containers/_v2/_drawers/edit-destination-drawer/helpers.d.ts +11 -0
  23. package/lib/containers/_v2/_drawers/edit-destination-drawer/index.d.ts +11 -0
  24. package/lib/containers/_v2/_drawers/edit-rule-drawer/helpers.d.ts +13 -0
  25. package/lib/containers/_v2/_drawers/edit-rule-drawer/index.d.ts +9 -0
  26. package/lib/containers/_v2/_drawers/index.d.ts +3 -0
  27. package/lib/containers/_v2/_forms/add-action-form/index.d.ts +0 -1
  28. package/lib/containers/_v2/_forms/add-destination-form/index.d.ts +8 -4
  29. package/lib/containers/_v2/_forms/add-rule-form/index.d.ts +0 -1
  30. package/lib/containers/_v2/_forms/index.d.ts +0 -1
  31. package/lib/containers/_v2/onboarding/summary/index.d.ts +1 -1
  32. package/lib/containers/_v2/pipeline-collectors/enum.d.ts +4 -0
  33. package/lib/containers/_v2/pipeline-collectors/{helpers → general-info/helpers}/get-general-badge.d.ts +1 -1
  34. package/lib/containers/_v2/pipeline-collectors/general-info/helpers/get-general-gauge-cards.d.ts +4 -0
  35. package/lib/containers/_v2/pipeline-collectors/{helpers → general-info/helpers}/get-general-status-card.d.ts +1 -1
  36. package/lib/containers/_v2/pipeline-collectors/{helpers → general-info/helpers}/get-general-text-cards.d.ts +1 -1
  37. package/lib/containers/_v2/pipeline-collectors/{helpers → general-info/helpers}/get-general-title.d.ts +1 -1
  38. package/lib/containers/_v2/pipeline-collectors/{helpers → general-info/helpers}/index.d.ts +2 -1
  39. package/lib/containers/_v2/pipeline-collectors/general-info/index.d.ts +7 -6
  40. package/lib/containers/_v2/pipeline-collectors/index.d.ts +5 -0
  41. package/lib/containers/_v2/pipeline-collectors/toolbar/index.d.ts +1 -11
  42. package/lib/containers/source-drawer/profiling/flamebearer.d.ts +5 -0
  43. package/lib/containers/v2.js +43 -56
  44. package/lib/containers.js +45 -45
  45. package/lib/contexts/action-form-context.d.ts +19 -0
  46. package/lib/{containers/_v2/_forms/add-destination-form/context.d.ts → contexts/destination-form-context.d.ts} +5 -4
  47. package/lib/contexts/index.d.ts +4 -0
  48. package/lib/contexts/rule-form-context.d.ts +19 -0
  49. package/lib/contexts/source-instrument-form-context.d.ts +22 -0
  50. package/lib/contexts.js +1 -1
  51. package/lib/functions/get-status-color/index.d.ts +2 -2
  52. package/lib/functions/get-status-icon/index.d.ts +2 -2
  53. package/lib/functions.js +1 -1
  54. package/lib/hooks.js +1 -1
  55. package/lib/snippets/_v2/yaml-section-card/index.d.ts +2 -0
  56. package/lib/snippets/v2.js +1 -1
  57. package/lib/snippets.js +1 -1
  58. package/lib/store.js +1 -1
  59. package/lib/theme.js +1 -1
  60. package/lib/types/common/index.d.ts +36 -0
  61. package/lib/types.js +1 -1
  62. package/lib/visuals.js +1 -1
  63. package/package.json +1 -1
  64. package/lib/chunks/index-BMJ_MZzY.js +0 -149
  65. package/lib/chunks/index-Dlnglk_e.js +0 -3
  66. package/lib/chunks/ui-components-BqdkaDt2.js +0 -2543
  67. package/lib/components/_v2/cards/section-part-card/index.d.ts +0 -11
  68. package/lib/containers/_v2/_forms/add-action-form/context.d.ts +0 -18
  69. package/lib/containers/_v2/_forms/add-rule-form/context.d.ts +0 -18
  70. package/lib/containers/_v2/_forms/add-source-form/context.d.ts +0 -21
  71. package/lib/containers/_v2/_forms/add-source-form/index.d.ts +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.0.227](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.226...ui-kit-v0.0.227) (2026-05-03)
4
+
5
+
6
+ ### Features
7
+
8
+ * **profling:** minor improvements to the Source Drawer Profiling tab ([#835](https://github.com/odigos-io/ui-kit/issues/835)) ([6606137](https://github.com/odigos-io/ui-kit/commit/6606137233a79262173b90cbd0f1aea372eb4a21))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * close rollout warning-modal after restarting workloads in MultiSourceControl ([#837](https://github.com/odigos-io/ui-kit/issues/837)) ([6063194](https://github.com/odigos-io/ui-kit/commit/60631944e6e9628b2879bbb7caffb8ec939ee016))
14
+ * **pipeline-collectors:** design based on feedback ([#831](https://github.com/odigos-io/ui-kit/issues/831)) ([0ca640e](https://github.com/odigos-io/ui-kit/commit/0ca640e5f5553ee4ec6cce112353b249c540d820))
15
+ * **settings:** add missing fields to EffectiveConfig query ([#840](https://github.com/odigos-io/ui-kit/issues/840)) ([300aca0](https://github.com/odigos-io/ui-kit/commit/300aca069ea12c55b701ddcefd6d6709932e4009))
16
+
17
+ ## [0.0.226](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.225...ui-kit-v0.0.226) (2026-04-30)
18
+
19
+
20
+ ### Features
21
+
22
+ * design v2 for read/edit/delete actions drawer ([#826](https://github.com/odigos-io/ui-kit/issues/826)) ([80c7e2f](https://github.com/odigos-io/ui-kit/commit/80c7e2f62fb1ee9014452aa362ee95c83cfc3988))
23
+ * design v2 for read/edit/delete destinations drawer ([#827](https://github.com/odigos-io/ui-kit/issues/827)) ([5e48cf4](https://github.com/odigos-io/ui-kit/commit/5e48cf42a7b48488ee225949864e2b92fe2c6af0))
24
+ * design v2 for read/edit/delete instrumentations-rules drawer ([#824](https://github.com/odigos-io/ui-kit/issues/824)) ([b597945](https://github.com/odigos-io/ui-kit/commit/b5979458faea8b349f5304be806ade99052f761c))
25
+
26
+
27
+ ### Bug Fixes
28
+
29
+ * cherry-pick fixes & improvements for V2 drawers to separate PR ([#830](https://github.com/odigos-io/ui-kit/issues/830)) ([88b8600](https://github.com/odigos-io/ui-kit/commit/88b86003362baf1adfbcf015cfef56b6f6b3be75))
30
+
3
31
  ## [0.0.225](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.224...ui-kit-v0.0.225) (2026-04-28)
4
32
 
5
33
 
@@ -0,0 +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-C7i9zbc-.js";import{VIcon as d,CopyIcon as u,YamlIcon as f}from"../icons.js";const h=i.div`
2
+ padding: 0 12px;
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,149 @@
1
+ import{c5 as e,p as a,T as l,k as t,e9 as r,e as s,am as o,w as i,j as n,ap as d,l as c,I as p,h as u,as as h,aw as g,n as m,F as v,d as f,S as b,an as y,aa as x,ea as S,eb as w,ax as C,ec as k,s as T,ed as $,t as L,ee as P,ef as M,eg as A,eh as O,ei as N,ej as z,ek as D,el as R,em as X,en as I,eo as E,ep as H,eq as V,bj as j,a as K,B as U,er as q,es as G,et as J,eu as B,ev as F,ew as W,ex as Z,ey as Y,ez as _,a7 as Q,a3 as ee,eA as ae,eB as le,ab as te,a6 as re,eC as se,eD as oe,eE as ie,eF as ne,b2 as de,eG as ce,eH as pe,eI as ue,eJ as he,eK as ge,eL as me,eM as ve,eN as fe,bG as be,o as ye,eO as xe,eP as Se,eQ as we,eR as Ce,eS as ke,eT as Te,eU as $e,eV as Le,eW as Pe,eX as Me,z as Ae,eY as Oe,E as Ne,eZ as ze,e_ as De,e$ as Re,f0 as Xe,f1 as Ie,dO as Ee,_ as He,ao as Ve,dm as je,f as Ke,f2 as Ue,d7 as qe,b as Ge,N as Je,aI as Be,aj as Fe,bw as We,dP as Ze}from"./ui-components-C7i9zbc-.js";import{jsx as Ye,jsxs as _e,Fragment as Qe}from"react/jsx-runtime";import{OdigosLogoTextEnterprise as ea,OdigosLogoTextCommunity as aa,EditIcon as la,ArrowLeftIcon as ta,ArrowRightIcon as ra,VSquareIcon as sa}from"../icons.js";import{useCallback as oa,useMemo as ia,useState as na,useRef as da,useEffect as ca,forwardRef as pa,useImperativeHandle as ua}from"react";import ha,{useTheme as ga}from"styled-components";import"./index-B0b5lJH3.js";const ma=({isOpen:a,onClose:l,onDeny:t,onApprove:r})=>Ye(e,{title:"Discard changes?",description:"You have unsaved changes.\nIf you cancel now, your changes won't be saved.",isOpen:a,onClose:l,onDeny:t,denyLabel:"Keep editing",onApprove:r,approveLabel:"Discard changes"}),va=({isOpen:a,onClose:l,onDeny:t,onApprove:r,action:s="delete",target:o})=>{const i=s.charAt(0).toUpperCase()+s.substring(1),n=o?.endsWith("s")?"these":"this";return Ye(e,{title:`${i}${o?` ${o}`:""}?`,description:`Are you sure you want to ${s}${o?` ${n} ${o}`:""}?`,isOpen:a,onClose:l,onDeny:t,denyLabel:"Go back",onApprove:r,approveLabel:i})},fa=({componentType:e,inputType:h,name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,value:S,setValue:w,errorMessage:C,warnMessage:k,helpMessage:T,dropdownOptions:$,dropdownNoSearch:L,dropdownNoCheckbox:P,timeUnits:M,timeDefaultUnit:A})=>{switch(e){case a.Input:return Ye(p,{name:g,type:h,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,value:S??"",onChange:e=>{const a=e.target.value;w(h===u.Number?""===a?null:Number(a):a)},errorMessage:C,warnMessage:k,helpMessage:T},g);case a.MultiInput:return Ye(c,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,values:Array.isArray(S)?S:d(S,[]),setValues:e=>w(e),errorMessage:C,warnMessage:k,helpMessage:T},g);case a.KeyValuePair:return Ye(n,{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:d(S,[]),setValues:e=>w(e),errorMessage:C,warnMessage:k,helpMessage:T},g);case a.TextArea:return Ye(i,{name:g,label:m,tooltip:v,badge:f,required:y,disabled:x,placeholder:b,value:S??"",onChange:e=>w(e.target.value),errorMessage:C,warnMessage:k,helpMessage:T},g);case a.Dropdown:return Ye(o,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,withSearch:!L,options:$?.map(e=>({id:e.id||"",label:e.value||"",withCheckbox:!P}))||[],values:S?[String(S)]:[],setValues:e=>w(e[0]),errorMessage:C,warnMessage:k,helpMessage:T},g);case a.Checkbox:return Ye(s,{name:g,label:m,tooltip:v,badge:f,value:!0===S||"true"===S,onChange:e=>w(e),disabled:x,errorMessage:C,warnMessage:k,helpMessage:T},g);case a.Time:return Ye(r,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,value:S??"",setValue:e=>w(e),units:M,defaultUnit:A,errorMessage:C,warnMessage:k,helpMessage:T},g);case a.Toggle:return Ye(l,{name:g,labelAlign:t.Right,label:m,tooltip:v,badge:f,value:!0===S||"true"===S,onChange:e=>w(e),disabled:x,errorMessage:C,warnMessage:k,helpMessage:T},g);default:return null}},ba=({size:e=200})=>{const{tier:a}=h();return a===g.Onprem?Ye(ea,{size:e}):Ye(aa,{size:e})},ya=[{value:"50",label:"50%"},{value:"25",label:"25%"},{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"0",label:"0%"},{value:"custom",label:"Custom"}],xa=[{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"0.5",label:"0.5%"},{value:"0.1",label:"0.1%"},{value:"0",label:"0%"},{value:"custom",label:"Custom"}],Sa=[{value:"5000",label:"5s"},{value:"1000",label:"1s"},{value:"500",label:"500ms"},{value:"100",label:"100ms"},{value:"50",label:"50ms"},{value:"custom",label:"Custom"}],wa=({description:e,options:a,selected:l,onSelect:t,customName:r,customLabel:s,customPlaceholder:o,customValue:i,onCustomChange:n})=>_e(m,{$gap:16,$alignItems:"flex-end",children:[_e(v,{$gap:6,children:[Ye(f,{label:e}),Ye(b,{size:y.S,options:a,selected:l,setSelected:t})]}),"custom"===l&&Ye(p,{name:r,label:s,placeholder:o,type:u.Number,value:i,onChange:n,width:160})]}),Ca=()=>{},ka=e=>e.readOnly?Ye(Ta,{rule:e.rule}):Ye($a,{ruleType:e.ruleType,formState:e.formState,onChange:e.onChange}),Ta=({rule:e})=>{const a=ga(),r=null!=e.durationAtLeastMs;return e.error?Ye(x,{richTitle:{title:S},children:Ye(l,{name:"sampling-view-toggle-keep-errors",onChange:Ca,value:!0,size:C.S,label:w,labelAlign:t.Right})}):r?Ye(x,{richTitle:{title:k},children:_e("div",{children:[Ye(T,{size:L.XXXS,color:a.v2.colors.silver[200],children:$}),Ye(T,{size:L.XS,children:`${e.durationAtLeastMs}ms`})]})}):null},$a=({ruleType:e,formState:a,onChange:r})=>{const s=oa(e=>r({durationPreset:e}),[r]),o=oa(e=>r({customDurationMs:e.target.value}),[r]);return"Error"===e?Ye(x,{richTitle:{title:S,subTitle:P},children:Ye(l,{name:"sampling-toggle-keep-errors",value:!0,onChange:Ca,size:C.S,label:w,labelAlign:t.Right})}):"Duration"===e?Ye(x,{richTitle:{title:k,subTitle:M},children:Ye(wa,{description:$,options:Sa,selected:a.durationPreset,onSelect:s,customName:"sampling-input-custom-duration",customLabel:A,customPlaceholder:"200ms",customValue:a.customDurationMs,onCustomChange:o})}):null},La=ha.div`
2
+ display: flex;
3
+ gap: 32px;
4
+ `,Pa=ha.div`
5
+ display: flex;
6
+ flex-direction: column;
7
+ gap: 4px;
8
+ `,Ma=ha.div`
9
+ display: flex;
10
+ flex-wrap: wrap;
11
+ align-items: flex-end;
12
+ gap: 16px;
13
+ `,Aa=ha.div`
14
+ display: flex;
15
+ align-items: flex-end;
16
+ gap: 16px;
17
+ padding: 12px 16px;
18
+ border-radius: 8px;
19
+ background-color: ${({theme:e})=>e.v2.colors.black[500]};
20
+ `,Oa=ha.div`
21
+ display: flex;
22
+ align-items: flex-end;
23
+ gap: 10px;
24
+ flex: 1;
25
+ `,Na=ha.div`
26
+ display: flex;
27
+ align-items: center;
28
+ height: 32px;
29
+ `,za=ha.div`
30
+ display: flex;
31
+ align-items: flex-end;
32
+ gap: 16px;
33
+ margin-bottom: 12px;
34
+ `,Da="Any",Ra="Kafka topic",Xa=()=>Ye("div",{style:{marginBottom:"8px"},children:Ye(T,{size:L.XS,weight:500,children:"And"})}),Ia=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"httpClient",label:"HTTP Client"}],Ea=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"kafkaConsumer",label:"Kafka Consumer"},{value:"kafkaProducer",label:"Kafka Producer"}],Ha=[{id:"",label:Da},{id:"GET",label:"GET"},{id:"POST",label:"POST"},{id:"PUT",label:"PUT"},{id:"DELETE",label:"DELETE"},{id:"PATCH",label:"PATCH"}];const Va=e=>e.readOnly?Ye(ja,{data:e.data}):Ye(Ka,{category:e.category,formState:e.formState,onChange:e.onChange}),ja=({data:e})=>{const a=ga(),l=ia(()=>function(e){if("noisy"===e.category){const a=e.rule.operation;if(a?.httpServer)return[{id:"type",title:B,value:J},{id:"route",title:E,value:a.httpServer.route||a.httpServer.routePrefix||F},{id:"method",title:q,value:a.httpServer.method||Da}];if(a?.httpClient){const e=[{id:"type",title:B,value:W}];return a.httpClient.serverAddress&&e.push({id:"serverAddress",title:"Server address",value:a.httpClient.serverAddress}),e.push({id:"route",title:E,value:a.httpClient.templatedPath||a.httpClient.templatedPathPrefix||F}),e.push({id:"method",title:q,value:a.httpClient.method||Da}),e}return[{id:"type",title:B,value:Z}]}const a=e.rule.operation;return a?.httpServer?[{id:"type",title:B,value:J},{id:"route",title:E,value:a.httpServer.route||a.httpServer.routePrefix||F},{id:"method",title:q,value:a.httpServer.method||Da}]:a?.kafkaConsumer?[{id:"type",title:B,value:Y},{id:"topic",title:Ra,value:a.kafkaConsumer.kafkaTopic||F}]:a?.kafkaProducer?[{id:"type",title:B,value:_},{id:"topic",title:Ra,value:a.kafkaProducer.kafkaTopic||F}]:[{id:"type",title:B,value:Z}]}(e),[e]);return Ye(x,{richTitle:{title:O},children:Ye(La,{children:l.map(({id:e,title:l,value:t})=>_e(Pa,{children:[Ye(T,{size:L.XXXS,color:a.v2.colors.silver[200],nowrap:!0,children:l}),Ye(T,{size:L.XS,nowrap:!0,children:t})]},e))})})},Ka=({category:e,formState:a,onChange:l})=>{const t=ia(()=>"noisy"===e?Ia:Ea,[e]),r=oa(e=>l({operationType:e,route:"",serverAddress:"",method:"",kafkaTopic:""}),[l]),s=oa(e=>a=>{a&&l({routeType:e,route:""})},[l]),o=oa(e=>l({route:e.target.value}),[l]),i=oa(e=>l({serverAddress:e.target.value}),[l]),n=oa(e=>l({method:e[0]||""}),[l]),d=oa(e=>l({kafkaTopic:e.target.value}),[l]),c="httpServer"===a.operationType||"httpClient"===a.operationType,u="kafkaConsumer"===a.operationType||"kafkaProducer"===a.operationType,h="httpClient"===a.operationType?I:E,g="httpClient"===a.operationType?H:V;return _e(x,{richTitle:{title:`2. ${O}`,subTitle:N},children:[Ye(v,{$alignItems:"flex-start",children:Ye(b,{size:y.S,options:t,selected:a.operationType,setSelected:r})}),c&&_e(Ma,{children:["httpClient"===a.operationType&&_e(za,{children:[Ye(p,{name:"sampling-input-server-address",label:D,placeholder:z,value:a.serverAddress,onChange:i}),Ye(Xa,{})]}),_e(Aa,{children:[_e(Oa,{children:[Ye(Na,{children:Ye(R,{"data-id":"sampling-radio-route",value:"route"===a.routeType,onChange:s("route")})}),Ye(p,{name:"sampling-input-route",label:h,placeholder:X,value:"route"===a.routeType?a.route:"",onChange:o,disabled:"route"!==a.routeType})]}),_e(Oa,{children:[Ye(Na,{children:Ye(R,{"data-id":"sampling-radio-route-prefix",value:"routePrefix"===a.routeType,onChange:s("routePrefix")})}),Ye(p,{name:"sampling-input-route-prefix",label:g,placeholder:X,value:"routePrefix"===a.routeType?a.route:"",onChange:o,disabled:"routePrefix"!==a.routeType})]})]}),_e(za,{children:[Ye(Xa,{}),Ye(j,{label:q,items:Ha,selectedIds:[a.method||""],setSelectedIds:e=>n(e),buttonProps:{"data-id":"sampling-btn-method",label:Ha.find(e=>e.id===a.method)?.label||Da,size:U.S,variant:K.Secondary}})]})]}),u&&Ye(p,{name:"sampling-input-kafka-topic",label:G,placeholder:"Type kafka topic",value:a.kafkaTopic,onChange:d,width:"320px"})]})},Ua=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],qa=[{value:"all",label:"Keep All"},{value:"sample",label:"Sample"}];const Ga=e=>e.readOnly?Ye(Ja,{data:e.data}):Ye(Ba,{category:e.category,formState:e.formState,onChange:e.onChange}),Ja=({data:e})=>{const a=ga(),l=ia(()=>function(e){switch(e.category){case"highlyRelevant":return null!=e.rule.percentageAtLeast?{title:ae,method:oe,description:re,value:`${e.rule.percentageAtLeast}%`}:{title:ae,method:ne,description:null,value:null};case"noisy":return null!=e.rule.percentageAtMost?{title:le,method:oe,description:se,value:`${e.rule.percentageAtMost}%`}:{title:le,method:ie,description:null,value:null};case"costReduction":return{title:le,method:oe,description:se,value:`${e.rule.percentageAtMost}%`}}}(e),[e]),t=[{id:"method",title:q,value:l.method},...null!=l.description?[{id:"value",title:l.description,value:l.value}]:[]];return Ye(x,{richTitle:{title:l.title},children:Ye(La,{children:t.map(({id:e,title:l,value:t})=>_e(Pa,{children:[Ye(T,{size:L.XXXS,color:a.v2.colors.silver[200],nowrap:!0,children:l}),Ye(T,{size:L.XS,nowrap:!0,children:t})]},e))})})},Ba=({category:e,formState:a,onChange:l})=>{const t="highlyRelevant"===e,r=t?qa:Ua,s=`3. ${t?ae:le}`,o=t?Q:ee,i=t?re:se,n="noisy"===e?xa:ya,d=oa(e=>l({percentageMode:e}),[l]),c=oa(e=>l({percentagePreset:e}),[l]),p=oa(e=>l({customPercentage:e.target.value}),[l]);return _e(x,{richTitle:{title:s,subTitle:o},children:["costReduction"!==e&&Ye(v,{$alignItems:"flex-start",children:Ye(b,{size:y.S,options:r,selected:a.percentageMode,setSelected:d})}),("costReduction"===e||"sample"===a.percentageMode)&&Ye(wa,{description:i,options:n,selected:a.percentagePreset,onSelect:c,customName:"sampling-input-custom-percentage",customLabel:te,customPlaceholder:"5%",customValue:a.customPercentage,onCustomChange:p})]})},Fa=ha.div`
35
+ display: flex;
36
+ align-items: flex-end;
37
+ gap: 16px;
38
+ `,Wa=ha.div`
39
+ width: 280px;
40
+ flex-shrink: 0;
41
+ `,Za=ha.div`
42
+ display: flex;
43
+ flex-direction: column;
44
+ gap: 4px;
45
+ `,Ya=ha.div`
46
+ flex: 1;
47
+ min-width: 0;
48
+ `,_a=[{value:"Relevance",label:"Relevance"},{value:"Error",label:"Error"},{value:"Duration",label:"Duration"}];function Qa(e){return"highlyRelevant"===e.category?e.rule.error?"Error":null!=e.rule.durationAtLeastMs?"Duration":"Relevance":ve[e.category]}const el=e=>e.readOnly?Ye(al,{data:e.data}):Ye(ll,{category:e.category,formState:e.formState,onChange:e.onChange}),al=({data:e})=>{const a=ga(),l=ia(()=>[{id:"name",title:ce,value:e.rule.name||de},{id:"type",title:pe,value:Qa(e)}],[e]),t=e.rule.notes||F;return _e(x,{children:[Ye(La,{children:l.map(({id:e,title:l,value:t})=>_e(Pa,{children:[Ye(T,{size:L.XXXS,color:a.v2.colors.silver[200],nowrap:!0,children:l}),Ye(T,{size:L.XS,nowrap:!0,children:t})]},e))}),_e(Pa,{children:[Ye(T,{size:L.XXXS,color:a.v2.colors.silver[200],children:ue}),Ye(T,{size:L.XS,children:t})]})]})},ll=({category:e,formState:a,onChange:l})=>{const t=oa(e=>l({name:e.target.value}),[l]),r=oa(e=>l({notes:e.target.value}),[l]),s=oa(e=>{l({ruleType:e,keepErrors:"Error"===e})},[l]);return Ye(x,{children:_e(Fa,{children:[Ye(Wa,{children:Ye(p,{name:"sampling-input-rule-name",label:ce,tooltip:"Optional. Give this rule a name for easier identification.",placeholder:he,value:a.name,onChange:t})}),"highlyRelevant"===e&&_e(Za,{children:[Ye(f,{label:pe}),Ye(b,{size:y.S,options:_a,selected:a.ruleType,setSelected:s})]}),Ye(Ya,{children:Ye(p,{name:"sampling-input-note",label:ue,tooltip:me,placeholder:ge,value:a.notes,onChange:r})})]})})},tl=ha.div`
49
+ display: flex;
50
+ align-items: center;
51
+ gap: 24px;
52
+ padding: 8px 16px;
53
+ border-radius: 12px;
54
+ background-color: ${({theme:e})=>e.v2.colors.silver[800]};
55
+ `,rl=ha.div`
56
+ flex: 1;
57
+ min-width: 0;
58
+ white-space: pre;
59
+ overflow-x: auto;
60
+ `,sl=({title:e,summary:a,onEdit:l,renderAction:t})=>{const r=ia(()=>{const l=[];return e&&(l.push({text:e,variant:fe.Default}),l.push({text:" - ",variant:fe.Default})),l.push(...a),l},[e,a]);return _e(tl,{children:[Ye(rl,{children:Ye(be,{parts:r})}),t&&t(),l&&Ye(ye,{"data-id":"sampling-btn-edit-auto-rule",label:xe,rightIcon:la,variant:K.Text,size:U.S,onClick:l})]})},ol=e=>{const a=ia(()=>{if(e.readOnly)return e.summary;switch(e.category){case"noisy":return Te($e(e.formState));case"highlyRelevant":return Ce(ke(e.formState));case"costReduction":return Se(we(e.formState))}},[e]);if(e.readOnly)return Ye(sl,{title:Le,summary:a});const l=1===a.length&&"default"===a[0].variant;return Ye(sl,{title:l?Pe:Le,summary:l?[]:a})},il=ha.div`
61
+ display: flex;
62
+ flex-wrap: wrap;
63
+ gap: 8px;
64
+ `,nl=ha.div`
65
+ display: flex;
66
+ align-items: center;
67
+ gap: 8px;
68
+ padding: 8px 12px;
69
+ border-radius: 8px;
70
+ cursor: pointer;
71
+ background: ${({theme:e,$selected:a})=>a?e.v2.colors.silver[700]:e.v2.colors.silver[900]};
72
+ border: 1px solid ${({theme:e,$selected:a})=>a?e.v2.colors.silver[500]:e.v2.colors.silver[800]};
73
+
74
+ &:hover {
75
+ background: ${({theme:e})=>e.v2.colors.silver[700]};
76
+ }
77
+ `,dl=ha.div`
78
+ display: flex;
79
+ width: 32px;
80
+ height: 32px;
81
+ justify-content: center;
82
+ align-items: center;
83
+ flex-shrink: 0;
84
+ `,cl=ha.div`
85
+ display: flex;
86
+ flex-direction: column;
87
+ gap: 4px;
88
+ `,pl=ha.div`
89
+ display: flex;
90
+ align-items: center;
91
+ gap: 8px;
92
+ padding: 8px;
93
+ border-radius: 8px;
94
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
95
+ `,ul=ha.div`
96
+ display: flex;
97
+ width: 24px;
98
+ height: 24px;
99
+ justify-content: center;
100
+ align-items: center;
101
+ flex-shrink: 0;
102
+ `,hl={[Ee.JavaScript]:"Node.js",[Ee.DotNet]:".NET",[Ee.Php]:"PHP",[Ee.Java]:"Java",[Ee.Go]:"Go",[Ee.Python]:"Python",[Ee.Ruby]:"Ruby",[Ee.Rust]:"Rust"},gl=[Ee.Python,Ee.Java,Ee.JavaScript,Ee.DotNet,Ee.Php,Ee.Ruby,Ee.Go].map(e=>({id:e,label:hl[e]??e.charAt(0).toUpperCase()+e.slice(1),Icon:He(e)})),ml=[{value:"all",label:"Entire Cluster"},{value:"source",label:"Specific Source"},{value:"namespace",label:"Specific Namespace"},{value:"language",label:"Specific Programming Language"}];function vl(e){const a=hl[e];return a||e.charAt(0).toUpperCase()+e.slice(1)}const fl=e=>e.readOnly?Ye(bl,{scopes:e.scopes}):Ye(yl,{formState:e.formState,onChange:e.onChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions}),bl=({scopes:e})=>{const a=ga();return Ye(x,{richTitle:{title:Me},children:e.length?Ye(cl,{children:e.map((e,l)=>((e,l)=>{if(e.workloadLanguage){const t=He(e.workloadLanguage);return _e(pl,{children:[t&&Ye(ul,{children:Ye(t,{size:18})}),Ye(T,{size:L.XS,color:a.v2.colors.white[500],children:vl(e.workloadLanguage)})]},l)}const t=[e.workloadNamespace,e.workloadKind,e.workloadName].filter(Boolean),r=t.length?t.join(" / "):"Unknown scope";return Ye(pl,{children:Ye(T,{size:L.XS,color:a.v2.colors.white[500],children:r})},l)})(e,l))}):Ye(Ae,{status:Ne.Default,message:Oe,fullWidth:!0})})},yl=({formState:e,onChange:a,sourceOptions:l=[],namespaceOptions:t=[]})=>{const[r,o]=na("all"),i=e.sourceScopes.length>0,n=ia(()=>ml.map(e=>({...e,disabled:"all"===e.value&&i})),[i]),d=ia(()=>e.sourceScopes.filter(e=>"source"===e.scopeType).map(e=>{return a=e.workloadNamespace,l=e.workloadKind,t=e.workloadName,`${a}/${l}/${t}`;var a,l,t}),[e.sourceScopes]),c=ia(()=>e.sourceScopes.filter(e=>"namespace"===e.scopeType).map(e=>e.workloadNamespace),[e.sourceScopes]),p=ia(()=>new Set(e.sourceScopes.filter(e=>"language"===e.scopeType).map(e=>e.workloadLanguage)),[e.sourceScopes]),u=oa(e=>{o(e)},[]),h=oa(l=>{const t=e.sourceScopes.filter(e=>"source"!==e.scopeType),r=l.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=>({scopeType:"source",workloadName:e.name,workloadKind:e.kind,workloadNamespace:e.namespace,workloadLanguage:""}));a({sourceScopes:[...t,...r]})},[e.sourceScopes,a]),g=oa(l=>{const t=e.sourceScopes.filter(e=>"namespace"!==e.scopeType),r=l.map(e=>({scopeType:"namespace",workloadName:"",workloadKind:"",workloadNamespace:e,workloadLanguage:""}));a({sourceScopes:[...t,...r]})},[e.sourceScopes,a]),m=oa(l=>{if(e.sourceScopes.some(e=>"language"===e.scopeType&&e.workloadLanguage===l))a({sourceScopes:e.sourceScopes.filter(e=>!("language"===e.scopeType&&e.workloadLanguage===l))});else{const t={scopeType:"language",workloadName:"",workloadKind:"",workloadNamespace:"",workloadLanguage:l};a({sourceScopes:[...e.sourceScopes,t]})}},[e.sourceScopes,a]);return _e(x,{richTitle:{title:`1. ${Me}`,subTitle:ze},children:[Ye(Ae,!i&&"all"===r?{status:Ne.Default,message:Oe,fullWidth:!0,smallIcon:!0}:{status:Ne.Info,message:De,fullWidth:!0,smallIcon:!0}),Ye(v,{$alignItems:"flex-start",children:Ye(b,{size:y.S,options:n,selected:r,setSelected:u})}),"source"===r&&Ye(Re,{multiple:!0,"data-id":"sampling-autocomplete-source",options:l,value:d,onSelect:h,placeholder:Xe}),"namespace"===r&&Ye(Re,{multiple:!0,"data-id":"sampling-autocomplete-namespace",options:t,value:c,onSelect:g,placeholder:"Search namespace"}),"language"===r&&Ye(il,{children:gl.map(({id:e,label:a,Icon:l})=>{const t=p.has(e);return _e(nl,{$selected:t,onClick:()=>m(e),children:[Ye(s,{name:`sampling-scope-lang-${e}`,size:Ie.S,value:t,onChange:()=>m(e)}),Ye(dl,{children:Ye(l,{size:20})}),Ye(T,{size:L.XS,nowrap:!0,children:a})]},e)})})]})},xl=(e,a)=>!a?.length||!!a?.find(a=>a===e),Sl=({title:e="Signals",required:a,errorMessage:l,allowedSignals:t,selectedSignals:r,setSelectedSignals:o,disabled:i})=>{const[n,d]=na(1===r.length),c=da(JSON.stringify(r));ca(()=>{const e=Ve(r);e.length||je.forEach(({id:a})=>{xl(a,t)&&e.push(a)});const a=JSON.stringify(e);c.current!==a&&(c.current=a,o(e),d(1===e.length))},[t,r]);return _e(v,{$gap:12,children:[Ye(f,{label:e,required:a}),Ye(m,{$gap:12,children:je.map(e=>{const a=xl(e.id,t),l=((e,a)=>!!a?.find(a=>a===e))(e.id,r);return a?Ye(s,{label:e.value,disabled:i||!a||n&&l,value:l,onChange:a=>((e,a)=>{const l=e,t=a?[...r,l]:r.filter(e=>e!==l);o(t),d(1===t.length)})(e.id,a)},e.id):null})}),Ye(Ke,{errorMessage:l})]})},wl=({minSupportedVersion:a,currentVersion:l})=>Ye(e,{isOpen:!0,onClose:()=>{},relativeToParent:!0,visual:()=>Ye(Ue,{scale:2.4,icon:()=>Ye("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"21",viewBox:"0 0 22 21",fill:"none",children:Ye("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: ${l}.`}),Cl=ha.div`
103
+ display: flex;
104
+ flex-direction: column;
105
+ justify-content: flex-end;
106
+ width: ${({$width:e})=>e};
107
+ gap: ${({$columnHasHeader:e})=>e?"0":"12px"};
108
+ `,kl=ha.div`
109
+ display: flex;
110
+ align-items: center;
111
+ min-height: 24px;
112
+ padding: 12px;
113
+ border-radius: 16px 16px 0 0;
114
+ background-color: ${({theme:e})=>e.v2.colors.silver[800]};
115
+ `,Tl=ha.div`
116
+ display: flex;
117
+ flex-direction: column;
118
+ gap: ${({$gap:e})=>e}px;
119
+ padding: 12px 12px 0 12px;
120
+ width: calc(100% - 24px);
121
+ height: ${({$heightOffset:e,$columnHasHeader:a})=>`calc(100vh - 180px - ${e}px ${a?"- 48px":""})`};
122
+ border-radius: ${({$columnHasHeader:e,$isLeft:a,$isRight:l})=>e?a?"0 0 0 16px":l?"0 16px 0 0":"0":a?"16px 0 0 16px":l?"0 16px 16px 0":"16px"};
123
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
124
+ overflow-y: auto;
125
+ overflow-x: hidden;
126
+ `,$l=({isLeft:e,isRight:a,heightOffset:l=0,width:t,header:r,list:s})=>_e(Cl,{$width:t,$columnHasHeader:!!r,children:[r&&Ye(kl,{children:r}),Ye(Tl,{$gap:8,$isLeft:e,$isRight:a,$heightOffset:l,$columnHasHeader:!!r,children:s.length?s.length>1?Ye(qe,{gap:8,elements:s}):Ye(Qe,{children:s[0]}):Ye(Ge,{$height:"100%",children:Ye(Je,{})})})]}),Ll="75vw",Pl=ha.div`
127
+ display: flex;
128
+ flex-direction: column;
129
+ border-radius: 16px;
130
+ background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
131
+ overflow: hidden;
132
+ `,Ml=ha.div`
133
+ display: flex;
134
+ gap: 12px;
135
+ padding: 16px 16px 0 16px;
136
+ background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
137
+ position: sticky;
138
+ top: 0;
139
+ `,Al=ha.div`
140
+ padding: 12px 12px 0 12px;
141
+ `,Ol=ha.div`
142
+ display: flex;
143
+ gap: 12px;
144
+ padding: 16px;
145
+ `,Nl=ha.div`
146
+ padding: 5vh 10vw;
147
+ border-radius: 12px;
148
+ background-color: ${({theme:e})=>e.v2.colors.silver[800]};
149
+ `,zl=pa(({isOpen:e,withOverlay:a,disableAnimation:l,onClose:t,onBack:r,onNext:s,nextIsSkip:o,onSave:i,disableSave:n,connectionIds:d,header:c,subHeader:p,leftColumn:u,rightColumn:h,search:g,filters:m,errorMessage:v,isFormDirty:f,hideDirtyNote:b,isFetching:y,progress:x},S)=>{const[w,C]=na(!1),[k,T]=na(!1),[$,P]=na(void 0);ua(S,()=>({clearErrors:()=>P(void 0)}));const M=k,A=oa(()=>{f&&!w?C(!0):(C(!1),t?.())},[f,w,t]),O=n||k||"boolean"==typeof f&&!f,N=oa(async()=>{T(!0);const e=await i();T(!1),e?.error?P(e.error):(d?.setValue([]),t?.())},[i,d,t]),z=!!g||!!d||!!m,D=!!p,R=(z?48:0)+(D?50:0),X=ia(()=>y?{status:Ne.Info,message:"Fetching Data..."}:k&&!x?{status:Ne.Info,message:"Saving Changes..."}:$||v?{status:Ne.Error,message:$||v}:"boolean"==typeof f&&f&&!b?{status:Ne.Info,message:'The values don\'t reflect the current configurations of the selected clusters.\n"Save" will override the current configurations.'}:"boolean"!=typeof f||f||b?void 0:{status:Ne.Success,message:"The values reflect the current configuration of the selected cluster."},[y,k,x,$,v,f,b]),I=ia(()=>r?{label:"Back",leftIcon:ta,variant:K.Secondary,onClick:r}:{label:"Cancel",variant:K.Secondary,onClick:A,disabled:M},[r,A,M]),E=ia(()=>s?o?{"data-id":"wide-drawer-skip",label:"Skip",rightIcon:ra,variant:K.Secondary,onClick:s}:{"data-id":"wide-drawer-next",label:"Next",rightIcon:ra,variant:K.Primary,onClick:s}:{"data-id":"wide-drawer-save",label:"Save",variant:K.Primary,onClick:N,disabled:O},[s,o,N,O]);return _e(Be,{width:Ll,isOpen:e,disableAnimation:l,hideOverlay:!k&&!a,header:{...c,onClose:t?A:void 0,onCloseDisabled:M},footer:{note:X,actions:[I,E]},children:[k?Ye(Ge,{$height:"calc(100vh - 136px)",children:Ye(Nl,{children:Ye(Fe,{titleSize:L.S,subTitleSize:L.XXXS,withGradient:!0,withSpinner:!0,...x})})}):_e(Pl,{children:[z&&_e(Ml,{children:[d&&Ye(We,{icon:sa,title:"Selected Clusters",badge:{label:d.value.length}}),g&&Ye(Ze,{width:"100%",...g}),m]}),D&&Ye(Al,{children:Ye(We,{icon:p.icon,title:p.title,subTitle:p.description,badge:p.badge})}),_e(Ol,{children:[Ye($l,{isLeft:!0,heightOffset:R,...u}),Ye($l,{isRight:!0,heightOffset:R,...h})]})]}),Ye(ma,{isOpen:w,onClose:()=>C(!1),onApprove:A})]})});zl.displayName=zl.name;export{sl as A,ma as C,fa as D,xa as N,Va as O,wa as P,el as R,Sl as S,wl as U,zl as W,ya as a,ol as b,fl as c,Ga as d,ka as e,va as f,Ll as g,ba as h,Sa as i};