@odigos/ui-kit 0.0.233 → 0.0.235

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.
@@ -1,9 +1,9 @@
1
1
  import { type FC } from 'react';
2
- import { type SourcesScope, type SamplingRuleFormState } from '@/types';
2
+ import { type SourcesScopes, type SamplingRuleFormState } from '@/types';
3
3
  import { type AutocompleteOption } from '@/components/_v2';
4
4
  export type SourceScopeSectionProps = {
5
5
  readOnly: true;
6
- scopes: SourcesScope[];
6
+ scopes: SourcesScopes | null;
7
7
  } | {
8
8
  readOnly?: false;
9
9
  formState: SamplingRuleFormState;
@@ -1 +1 @@
1
- export{A as ActionType,eP as Actions,dm as ColoredSpan,g6 as ColoredSpanVariant,eO as RichTitle}from"../chunks/ui-components-DD1EWBzE.js";export{C as CancelModal,j as DURATION_OPTIONS,g as DeleteModal,e as DurationErrorsSection,D as DynamicField,N as NOISY_PERCENTAGE_OPTIONS,i as OdigosLogoTextByTier,O as OperationSection,a as PERCENTAGE_OPTIONS,f as PercentageSection,P as PresetWithCustomInput,R as RuleInfoSection,d as RuleTypeSection,b as SamplingPreviewSection,S as SignalsCheckboxList,c as SourceScopeSection,U as UpgradeModal,h as WIDE_DRAWER_WIDTH,W as WideDrawer}from"../chunks/index-Di5tcvgi.js";export{Y as YamlSectionCard}from"../chunks/index-D65aqUr3.js";import"react/jsx-runtime";import"styled-components";import"../icons.js";import"zustand";import"react";import"javascript-time-ago";import"../chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
1
+ export{A as ActionType,eP as Actions,dm as ColoredSpan,g6 as ColoredSpanVariant,eO as RichTitle}from"../chunks/ui-components-B4It5sfa.js";export{C as CancelModal,j as DURATION_OPTIONS,g as DeleteModal,e as DurationErrorsSection,D as DynamicField,N as NOISY_PERCENTAGE_OPTIONS,i as OdigosLogoTextByTier,O as OperationSection,a as PERCENTAGE_OPTIONS,f as PercentageSection,P as PresetWithCustomInput,R as RuleInfoSection,d as RuleTypeSection,b as SamplingPreviewSection,S as SignalsCheckboxList,c as SourceScopeSection,U as UpgradeModal,h as WIDE_DRAWER_WIDTH,W as WideDrawer}from"../chunks/index-D6lL097V.js";export{Y as YamlSectionCard}from"../chunks/index-BmuiyBxZ.js";import"react/jsx-runtime";import"styled-components";import"../icons.js";import"zustand";import"react";import"javascript-time-ago";import"../chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
package/lib/snippets.js CHANGED
@@ -1 +1 @@
1
- export{ar as AddButton,V as CopyText,c8 as EditButton,c6 as Flow,hn as MapItemNode,ho as NoDataNode,by as NoteBackToSummary,Y as PodContainer,ab as SourceContainer}from"./chunks/ui-components-DD1EWBzE.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
1
+ export{ar as AddButton,V as CopyText,c8 as EditButton,c6 as Flow,hp as MapItemNode,hq as NoDataNode,by as NoteBackToSummary,Y as PodContainer,ab as SourceContainer}from"./chunks/ui-components-B4It5sfa.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
package/lib/store.js CHANGED
@@ -1 +1 @@
1
- export{bd as ProgressKeys,c5 as useActiveNodeStore,ch as useDarkMode,a5 as useDataStreamStore,c as useDrawerStore,a3 as useEntityStore,aO as useFilterStore,aE as useModalStore,bX as useNotificationStore,bc as useProgressStore,b1 as useSelectedStore,bv as useSetupStore}from"./chunks/ui-components-DD1EWBzE.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
1
+ export{bd as ProgressKeys,c5 as useActiveNodeStore,ch as useDarkMode,a5 as useDataStreamStore,c as useDrawerStore,a3 as useEntityStore,aO as useFilterStore,aE as useModalStore,bX as useNotificationStore,bc as useProgressStore,b1 as useSelectedStore,bv as useSetupStore}from"./chunks/ui-components-B4It5sfa.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
package/lib/theme.js CHANGED
@@ -1 +1 @@
1
- export{he as Provider,hf as animations,hg as opacity,hh as palettes}from"./chunks/ui-components-DD1EWBzE.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
1
+ export{hg as Provider,hh as animations,hi as opacity,hj as palettes}from"./chunks/ui-components-B4It5sfa.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
@@ -68,7 +68,8 @@ export declare enum DestinationTypes {
68
68
  Uptrace = "uptrace",
69
69
  VictoriaMetrics = "victoriametrics",
70
70
  VictoriaMetricsCloud = "victoriametricscloud",
71
- XRay = "xray"
71
+ XRay = "xray",
72
+ Pyroscope = "pyroscope"
72
73
  }
73
74
  export interface Destination {
74
75
  id: string;
@@ -79,6 +80,7 @@ export interface Destination {
79
80
  traces: boolean;
80
81
  metrics: boolean;
81
82
  logs: boolean;
83
+ profiles: boolean;
82
84
  };
83
85
  fields: string;
84
86
  conditions: Condition[] | null;
@@ -95,6 +97,9 @@ export interface Destination {
95
97
  traces: {
96
98
  supported: boolean;
97
99
  };
100
+ profiles: {
101
+ supported: boolean;
102
+ };
98
103
  };
99
104
  };
100
105
  }
@@ -1,9 +1,21 @@
1
1
  import type { ColoredSpanPart } from '@/snippets/_v2';
2
- export interface SourcesScope {
3
- workloadName?: string | null;
4
- workloadKind?: string | null;
5
- workloadNamespace?: string | null;
6
- workloadLanguage?: string | null;
2
+ import type { K8sResourceKind } from './enum';
3
+ export interface K8sWorkloadId {
4
+ namespace: string;
5
+ name: string;
6
+ kind: K8sResourceKind;
7
+ }
8
+ export type K8sSourceId = K8sWorkloadId;
9
+ export type SamplingWorkloadLanguage = string;
10
+ export interface SourcesScopes {
11
+ sources: K8sWorkloadId[];
12
+ namespaces: string[];
13
+ languages: SamplingWorkloadLanguage[];
14
+ }
15
+ export interface SourcesScopesInput {
16
+ sources: K8sSourceId[];
17
+ namespaces: string[];
18
+ languages: SamplingWorkloadLanguage[];
7
19
  }
8
20
  export interface HeadSamplingHttpServerMatcher {
9
21
  route?: string | null;
@@ -37,7 +49,7 @@ export interface NoisyOperationRule {
37
49
  ruleId: string;
38
50
  name?: string | null;
39
51
  disabled: boolean;
40
- sourceScopes?: SourcesScope[] | null;
52
+ sourceScopes?: SourcesScopes | null;
41
53
  operation?: HeadSamplingOperationMatcher | null;
42
54
  percentageAtMost?: number | null;
43
55
  notes?: string | null;
@@ -46,7 +58,7 @@ export interface HighlyRelevantOperationRule {
46
58
  ruleId: string;
47
59
  name?: string | null;
48
60
  disabled: boolean;
49
- sourceScopes?: SourcesScope[] | null;
61
+ sourceScopes?: SourcesScopes | null;
50
62
  error: boolean;
51
63
  durationAtLeastMs?: number | null;
52
64
  operation?: TailSamplingOperationMatcher | null;
@@ -57,7 +69,7 @@ export interface CostReductionRule {
57
69
  ruleId: string;
58
70
  name?: string | null;
59
71
  disabled: boolean;
60
- sourceScopes?: SourcesScope[] | null;
72
+ sourceScopes?: SourcesScopes | null;
61
73
  operation?: TailSamplingOperationMatcher | null;
62
74
  percentageAtMost: number;
63
75
  notes?: string | null;
@@ -70,16 +82,10 @@ export interface SamplingRules {
70
82
  costReductionRules: CostReductionRule[];
71
83
  }
72
84
  export type SamplingRule = NoisyOperationRule | HighlyRelevantOperationRule | CostReductionRule;
73
- export interface SourcesScopeInput {
74
- workloadName?: string | null;
75
- workloadKind?: string | null;
76
- workloadNamespace?: string | null;
77
- workloadLanguage?: string | null;
78
- }
79
85
  export interface NoisyOperationRuleInput {
80
86
  name?: string | null;
81
87
  disabled?: boolean | null;
82
- sourceScopes?: SourcesScopeInput[] | null;
88
+ sourceScopes?: SourcesScopesInput | null;
83
89
  operation?: HeadSamplingOperationMatcher | null;
84
90
  percentageAtMost?: number | null;
85
91
  notes?: string | null;
@@ -87,7 +93,7 @@ export interface NoisyOperationRuleInput {
87
93
  export interface HighlyRelevantOperationRuleInput {
88
94
  name?: string | null;
89
95
  disabled?: boolean | null;
90
- sourceScopes?: SourcesScopeInput[] | null;
96
+ sourceScopes?: SourcesScopesInput | null;
91
97
  error?: boolean | null;
92
98
  durationAtLeastMs?: number | null;
93
99
  operation?: TailSamplingOperationMatcher | null;
@@ -97,7 +103,7 @@ export interface HighlyRelevantOperationRuleInput {
97
103
  export interface CostReductionRuleInput {
98
104
  name?: string | null;
99
105
  disabled?: boolean | null;
100
- sourceScopes?: SourcesScopeInput[] | null;
106
+ sourceScopes?: SourcesScopesInput | null;
101
107
  operation?: TailSamplingOperationMatcher | null;
102
108
  percentageAtMost: number;
103
109
  notes?: string | null;
@@ -141,25 +147,17 @@ export interface SamplingRulesK8sHealthConfig {
141
147
  enabled: boolean | null;
142
148
  keepPercentage: number | null;
143
149
  }
144
- export type ScopeType = 'all' | 'source' | 'namespace' | 'language';
145
150
  export type OperationType = 'all' | 'httpServer' | 'httpClient' | 'kafkaConsumer' | 'kafkaProducer';
146
151
  export type PercentageMode = 'all' | 'sample';
147
152
  export type RouteType = 'route' | 'routePrefix';
148
153
  export type DurationPreset = '5000' | '1000' | '500' | '100' | '50' | 'custom';
149
154
  export type PercentagePreset = '50' | '25' | '10' | '1' | '0.5' | '0.1' | '0' | 'custom';
150
- export interface SourceScopeEntry {
151
- scopeType: ScopeType;
152
- workloadName: string;
153
- workloadKind: string;
154
- workloadNamespace: string;
155
- workloadLanguage: string;
156
- }
157
155
  export interface SamplingRuleFormState {
158
156
  name: string;
159
157
  notes: string;
160
158
  disabled: boolean;
161
159
  ruleType: HighlyRelevantBadgeType;
162
- sourceScopes: SourceScopeEntry[];
160
+ sourceScopes: SourcesScopes;
163
161
  operationType: OperationType;
164
162
  routeType: RouteType;
165
163
  route: string;
@@ -1,12 +1,14 @@
1
1
  export declare enum SignalType {
2
2
  Logs = "LOGS",
3
3
  Metrics = "METRICS",
4
- Traces = "TRACES"
4
+ Traces = "TRACES",
5
+ Profiles = "PROFILES"
5
6
  }
6
7
  export declare enum SignalKey {
7
8
  Logs = "logs",
8
9
  Metrics = "metrics",
9
- Traces = "traces"
10
+ Traces = "traces",
11
+ Profiles = "profiles"
10
12
  }
11
13
  export declare const SIGNAL_TYPE_TO_KEY: Record<SignalType, SignalKey>;
12
14
  export declare const SIGNAL_KEY_TO_TYPE: Record<SignalKey, SignalType>;
package/lib/types.js CHANGED
@@ -1 +1 @@
1
- export{gn as ActionCategory,ag as ActionKeyTypes,ae as ActionType,go as AddNodeTypes,gp as BooleanOperation,bS as CodeAttributesKeyTypes,aD as Crud,bQ as CustomInstrumentationsKeyTypes,b3 as DesiredStateProgress,gq as DestinationTypes,gr as EdgeTypes,E as EntityTypes,as as FieldTypes,bR as GolangCustomProbe,bO as HeadersCollectionKeyTypes,ak as InputTypes,gs as InstallationMethod,bU as InstrumentationRuleType,gt as IntrumentationStatus,bP as JavaCustomProbe,gu as JsonOperation,af as K8sAttributesFrom,a9 as K8sResourceKind,gv as ListDirection,c2 as NodeTypes,gw as NumberOperation,gx as OtelDistroName,bz as OtherEntityTypes,O as OtherStatus,cS as OtherStatusType,bT as PayloadCollectionKeyTypes,gy as PlatformType,gz as PodContainerLifecycleStatus,gA as PodContainerStatus,gB as PodPhase,gC as Profile,P as ProgrammingLanguages,gD as SIGNAL_KEY_TO_TYPE,bK as SIGNAL_TYPE_TO_KEY,gE as SignalKey,bD as SignalType,gF as SortDirection,R as StatusType,gG as StringOperation,b_ as Tier,eS as WorkloadRolloutStatus}from"./chunks/ui-components-DD1EWBzE.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
1
+ export{gp as ActionCategory,ag as ActionKeyTypes,ae as ActionType,gq as AddNodeTypes,gr as BooleanOperation,bS as CodeAttributesKeyTypes,aD as Crud,bQ as CustomInstrumentationsKeyTypes,b3 as DesiredStateProgress,gs as DestinationTypes,gt as EdgeTypes,E as EntityTypes,as as FieldTypes,bR as GolangCustomProbe,bO as HeadersCollectionKeyTypes,ak as InputTypes,gu as InstallationMethod,bU as InstrumentationRuleType,gv as IntrumentationStatus,bP as JavaCustomProbe,gw as JsonOperation,af as K8sAttributesFrom,a9 as K8sResourceKind,gx as ListDirection,c2 as NodeTypes,gy as NumberOperation,gz as OtelDistroName,bz as OtherEntityTypes,O as OtherStatus,cS as OtherStatusType,bT as PayloadCollectionKeyTypes,gA as PlatformType,gB as PodContainerLifecycleStatus,gC as PodContainerStatus,gD as PodPhase,gE as Profile,P as ProgrammingLanguages,gF as SIGNAL_KEY_TO_TYPE,bK as SIGNAL_TYPE_TO_KEY,gG as SignalKey,bD as SignalType,gH as SortDirection,R as StatusType,gI as StringOperation,b_ as Tier,eS as WorkloadRolloutStatus}from"./chunks/ui-components-B4It5sfa.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
package/lib/visuals.js CHANGED
@@ -1 +1 @@
1
- export{gH as VISUAL_ODIGOS_LOGO_HEIGHT,gI as VISUAL_ODIGOS_LOGO_WIDTH,gm as VisualGreenRings,gJ as VisualOdigosLogo,dx as VisualPurpleRings}from"./chunks/ui-components-DD1EWBzE.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
1
+ export{gJ as VISUAL_ODIGOS_LOGO_HEIGHT,gK as VISUAL_ODIGOS_LOGO_WIDTH,go as VisualGreenRings,gL as VisualOdigosLogo,dx as VisualPurpleRings}from"./chunks/ui-components-B4It5sfa.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odigos/ui-kit",
3
- "version": "0.0.233",
3
+ "version": "0.0.235",
4
4
  "author": "Odigos",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,145 +0,0 @@
1
- import{cA as e,a,as as t,j as l,l as r,fs as o,cn as s,cP as i,cu as n,cq as d,bC as c,cr as p,cp as u,ak as h,a4 as g,b_ as m,F as v,y as f,cm as b,S as y,s as S,cL as x,ft as k,fu as C,k as w,fv as T,n as $,fw as P,o as L,p as A,fx as M,fy as O,fz as N,fA as z,fB as R,fC as X,fD as D,e5 as I,fE as E,fF as H,fG as B,fH as V,fI as K,di as j,B as U,fJ as q,fK as G,fL as J,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 oe,fW as se,fX as ie,fY as ne,fZ as de,d7 as ce,f_ as pe,f$ as ue,g0 as he,g1 as ge,g2 as me,g3 as ve,g4 as fe,g5 as be,g6 as ye,dm as Se,m as xe,g7 as ke,g8 as Ce,g9 as we,ga as Te,gb as $e,gc as Pe,gd as Le,ge as Ae,gf as Me,gg as Oe,cw as Ne,gh as ze,R as Re,gi as Xe,gj as De,gk as Ie,gl as Ee,eL as He,P as Be,bW as Ve,$ as Ke,br as je,co as Ue,gm as qe,b6 as Ge,b as Je,N as We,c4 as Fe,L as Ze,eO as Ye,w as _e}from"./ui-components-DD1EWBzE.js";import{jsx as Qe,jsxs as ea,Fragment as aa}from"react/jsx-runtime";import{OdigosLogoTextEnterprise as ta,OdigosLogoTextCommunity as la,EditIcon as ra,ArrowLeftIcon as oa,ArrowRightIcon as sa,VSquareIcon as ia}from"../icons.js";import{useCallback as na,useMemo as da,useState as ca,useRef as pa,useEffect as ua,forwardRef as ha,useImperativeHandle as ga}from"react";import ma from"styled-components";import"./index-D65aqUr3.js";const va=({isOpen:t,onClose:l,onDeny:r,onApprove:o})=>Qe(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:()=>{o?.(),l()}}}),fa=({isOpen:t,onClose:l,onDeny:r,onApprove:o,action:s="delete",target:i})=>{const n=s.charAt(0).toUpperCase()+s.substring(1),d=i?.endsWith("s")?"these":"this";return Qe(e,{title:`${n}${i?` ${i}`:""}?`,description:`Are you sure you want to ${s}${i?` ${d} ${i}`:""}?`,isOpen:t,onClose:l,denyButton:{label:"Go back",variant:a.Secondary,onClick:()=>{r?.(),l()}},approveButton:{label:n,variant:a.Primary,onClick:()=>{o?.(),l()}}})},ba=({componentType:e,inputType:a,name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:S,value:x,setValue:k,errorMessage:C,warnMessage:w,helpMessage:T,dropdownOptions:$,dropdownNoSearch:P,dropdownNoCheckbox:L,timeUnits:A,timeDefaultUnit:M})=>{switch(e){case t.Input:return Qe(u,{name:g,type:a,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:S,value:x??"",onChange:e=>{const t=e.target.value;k(a===h.Number?""===t?null:Number(t):t)},errorMessage:C,warnMessage:w,helpMessage:T},g);case t.MultiInput:return Qe(p,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:S,values:Array.isArray(x)?x:c(x,[]),setValues:e=>k(e),errorMessage:C,warnMessage:w,helpMessage:T},g);case t.KeyValuePair:return Qe(d,{name:g,label:m,tooltip:v,badge:f,required:y,disabled:S,limitFieldsPerRow:2,columns:[{keyName:"key",label:"Key"},{keyName:"value",label:"Value"}],values:Array.isArray(x)?x:c(x,[]),setValues:e=>k(e),errorMessage:C,warnMessage:w,helpMessage:T},g);case t.TextArea:return Qe(n,{name:g,label:m,tooltip:v,badge:f,required:y,disabled:S,placeholder:b,value:x??"",onChange:e=>k(e.target.value),errorMessage:C,warnMessage:w,helpMessage:T},g);case t.Dropdown:return Qe(i,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:S,withSearch:!P,options:$?.map(e=>({id:e.id||"",label:e.value||"",withCheckbox:!L}))||[],values:x?[String(x)]:[],setValues:e=>k(e[0]),errorMessage:C,warnMessage:w,helpMessage:T},g);case t.Checkbox:return Qe(s,{name:g,label:m,tooltip:v,badge:f,value:!0===x||"true"===x,onChange:e=>k(e),disabled:S,errorMessage:C,warnMessage:w,helpMessage:T},g);case t.Time:return Qe(o,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:S,value:x??"",setValue:e=>k(e),units:A,defaultUnit:M,errorMessage:C,warnMessage:w,helpMessage:T},g);case t.Toggle:return Qe(l,{name:g,labelAlign:r.Right,label:m,tooltip:v,badge:f,value:!0===x||"true"===x,onChange:e=>k(e),disabled:S,errorMessage:C,warnMessage:w,helpMessage:T},g);default:return null}},ya=({size:e=200})=>{const{tier:a}=g();return a===m.Onprem?Qe(ta,{size:e}):Qe(la,{size:e})},Sa=[{value:"50",label:"50%"},{value:"25",label:"25%"},{value:"10",label:"10%"},{value:"1",label:"1%"},{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:"custom",label:"Custom"}],ka=[{value:"5000",label:"5s"},{value:"1000",label:"1s"},{value:"500",label:"500ms"},{value:"100",label:"100ms"},{value:"50",label:"50ms"},{value:"custom",label:"Custom"}],Ca=({description:e,options:a,selected:t,onSelect:l,customName:r,customLabel:o,customPlaceholder:s,customValue:i,onCustomChange:n})=>ea(v,{$gap:16,$alignItems:"flex-end",children:[ea(f,{$gap:6,children:[Qe(b,{label:e}),Qe(y,{size:S.S,options:a,selected:t,setSelected:l})]}),"custom"===t&&Qe(u,{name:r,label:o,placeholder:s,type:h.Number,value:i,onChange:n,width:160})]}),wa=()=>{},Ta=e=>e.readOnly?Qe($a,{rule:e.rule}):Qe(Pa,{ruleType:e.ruleType,formState:e.formState,onChange:e.onChange}),$a=({rule:e})=>{const a=null!=e.durationAtLeastMs;return e.error?Qe(x,{richTitle:{title:k},children:Qe(l,{name:"sampling-view-toggle-keep-errors",onChange:wa,value:!0,size:w.S,label:C,labelAlign:r.Right})}):a?Qe(x,{richTitle:{title:T},children:ea("div",{children:[Qe($,{size:A.XXXS,color:L.Secondary,children:P}),Qe($,{size:A.XS,children:`${e.durationAtLeastMs}ms`})]})}):null},Pa=({ruleType:e,formState:a,onChange:t})=>{const o=na(e=>t({durationPreset:e}),[t]),s=na(e=>t({customDurationMs:e.target.value}),[t]);return"Error"===e?Qe(x,{richTitle:{title:k,subTitle:M},children:Qe(l,{name:"sampling-toggle-keep-errors",value:!0,onChange:wa,size:w.S,label:C,labelAlign:r.Right})}):"Duration"===e?Qe(x,{richTitle:{title:T,subTitle:O},children:Qe(Ca,{description:P,options:ka,selected:a.durationPreset,onSelect:o,customName:"sampling-input-custom-duration",customLabel:N,customPlaceholder:"200ms",customValue:a.customDurationMs,onCustomChange:s})}):null},La=ma.div`
2
- display: flex;
3
- gap: 32px;
4
- `,Aa=ma.div`
5
- display: flex;
6
- flex-direction: column;
7
- gap: 4px;
8
- `,Ma=ma.div`
9
- display: flex;
10
- flex-wrap: wrap;
11
- align-items: flex-end;
12
- gap: 16px;
13
- `,Oa=ma.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
- `,Na=ma.div`
21
- display: flex;
22
- align-items: flex-end;
23
- gap: 10px;
24
- flex: 1;
25
- `,za=ma.div`
26
- display: flex;
27
- align-items: center;
28
- height: 32px;
29
- `,Ra=ma.div`
30
- display: flex;
31
- align-items: flex-end;
32
- gap: 16px;
33
- margin-bottom: 12px;
34
- `,Xa="Any",Da="Kafka topic",Ia=()=>Qe("div",{style:{marginBottom:"8px"},children:Qe($,{size:A.XS,weight:500,children:"And"})}),Ea=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"httpClient",label:"HTTP Client"}],Ha=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"kafkaConsumer",label:"Kafka Consumer"},{value:"kafkaProducer",label:"Kafka Producer"}],Ba=[{id:"",label:Xa},{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?Qe(Ka,{data:e.data}):Qe(ja,{category:e.category,formState:e.formState,onChange:e.onChange}),Ka=({data:e})=>{const a=da(()=>function(e){if("noisy"===e.category){const a=e.rule.operation;if(a?.httpServer)return[{id:"type",title:W,value:J},{id:"route",title:B,value:a.httpServer.route||a.httpServer.routePrefix||F},{id:"method",title:q,value:a.httpServer.method||Xa}];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:q,value:a.httpClient.method||Xa}),e}return[{id:"type",title:W,value:Y}]}const a=e.rule.operation;return a?.httpServer?[{id:"type",title:W,value:J},{id:"route",title:B,value:a.httpServer.route||a.httpServer.routePrefix||F},{id:"method",title:q,value:a.httpServer.method||Xa}]:a?.kafkaConsumer?[{id:"type",title:W,value:_},{id:"topic",title:Da,value:a.kafkaConsumer.kafkaTopic||F}]:a?.kafkaProducer?[{id:"type",title:W,value:Q},{id:"topic",title:Da,value:a.kafkaProducer.kafkaTopic||F}]:[{id:"type",title:W,value:Y}]}(e),[e]);return Qe(x,{richTitle:{title:z},children:Qe(La,{children:a.map(({id:e,title:a,value:t})=>ea(Aa,{children:[Qe($,{size:A.XXXS,color:L.Secondary,nowrap:!0,children:a}),Qe($,{size:A.XS,nowrap:!0,children:t})]},e))})})},ja=({category:e,formState:t,onChange:l})=>{const r=da(()=>"noisy"===e?Ea:Ha,[e]),o=na(e=>l({operationType:e,route:"",serverAddress:"",method:"",kafkaTopic:""}),[l]),s=na(e=>a=>{a&&l({routeType:e,route:""})},[l]),i=na(e=>l({route:e.target.value}),[l]),n=na(e=>l({serverAddress:e.target.value}),[l]),d=na(e=>l({method:e[0]||""}),[l]),c=na(e=>l({kafkaTopic:e.target.value}),[l]),p="httpServer"===t.operationType||"httpClient"===t.operationType,h="kafkaConsumer"===t.operationType||"kafkaProducer"===t.operationType,g="httpClient"===t.operationType?H:B,m="httpClient"===t.operationType?V:K;return ea(x,{richTitle:{title:`2. ${z}`,subTitle:R},children:[Qe(f,{$alignItems:"flex-start",children:Qe(y,{size:S.S,options:r,selected:t.operationType,setSelected:o})}),p&&ea(Ma,{children:["httpClient"===t.operationType&&ea(Ra,{children:[Qe(u,{name:"sampling-input-server-address",label:D,placeholder:X,value:t.serverAddress,onChange:n}),Qe(Ia,{})]}),ea(Oa,{children:[ea(Na,{children:[Qe(za,{children:Qe(I,{"data-id":"sampling-radio-route",value:"route"===t.routeType,onChange:s("route")})}),Qe(u,{name:"sampling-input-route",label:g,placeholder:E,value:"route"===t.routeType?t.route:"",onChange:i,disabled:"route"!==t.routeType})]}),ea(Na,{children:[Qe(za,{children:Qe(I,{"data-id":"sampling-radio-route-prefix",value:"routePrefix"===t.routeType,onChange:s("routePrefix")})}),Qe(u,{name:"sampling-input-route-prefix",label:m,placeholder:E,value:"routePrefix"===t.routeType?t.route:"",onChange:i,disabled:"routePrefix"!==t.routeType})]})]}),ea(Ra,{children:[Qe(Ia,{}),Qe(j,{label:q,items:Ba,selectedIds:[t.method||""],setSelectedIds:e=>d(e),buttonProps:{"data-id":"sampling-btn-method",label:Ba.find(e=>e.id===t.method)?.label||Xa,size:U.S,variant:a.Secondary}})]})]}),h&&Qe(u,{name:"sampling-input-kafka-topic",label:G,placeholder:"Type kafka topic",value:t.kafkaTopic,onChange:c,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?Qe(Ja,{data:e.data}):Qe(Wa,{category:e.category,formState:e.formState,onChange:e.onChange}),Ja=({data:e})=>{const a=da(()=>function(e){switch(e.category){case"highlyRelevant":return null!=e.rule.percentageAtLeast?{title:te,method:ie,description:oe,value:`${e.rule.percentageAtLeast}%`}:{title:te,method:de,description:null,value:null};case"noisy":return null!=e.rule.percentageAtMost?{title:le,method:ie,description:se,value:`${e.rule.percentageAtMost}%`}:{title:le,method:ne,description:null,value:null};case"costReduction":return{title:le,method:ie,description:se,value:`${e.rule.percentageAtMost}%`}}}(e),[e]),t=[{id:"method",title:q,value:a.method},...null!=a.description?[{id:"value",title:a.description,value:a.value}]:[]];return Qe(x,{richTitle:{title:a.title},children:Qe(La,{children:t.map(({id:e,title:a,value:t})=>ea(Aa,{children:[Qe($,{size:A.XXXS,color:L.Secondary,nowrap:!0,children:a}),Qe($,{size:A.XS,nowrap:!0,children:t})]},e))})})},Wa=({category:e,formState:a,onChange:t})=>{const l="highlyRelevant"===e,r=l?qa:Ua,o=`${l?4:3}. ${l?te:le}`,s=l?ee:ae,i=l?oe:se,n="noisy"===e?xa:Sa,d=na(e=>t({percentageMode:e}),[t]),c=na(e=>t({percentagePreset:e}),[t]),p=na(e=>t({customPercentage:e.target.value}),[t]);return ea(x,{richTitle:{title:o,subTitle:s},children:["costReduction"!==e&&Qe(f,{$alignItems:"flex-start",children:Qe(y,{size:S.S,options:r,selected:a.percentageMode,setSelected:d})}),("costReduction"===e||"sample"===a.percentageMode)&&Qe(Ca,{description:i,options:n,selected:a.percentagePreset,onSelect:c,customName:"sampling-input-custom-percentage",customLabel:re,customPlaceholder:"5%",customValue:a.customPercentage,onCustomChange:p})]})},Fa=ma.div`
35
- display: flex;
36
- align-items: flex-end;
37
- gap: 16px;
38
- `,Za=ma.div`
39
- width: 280px;
40
- flex-shrink: 0;
41
- `,Ya=ma.div`
42
- flex: 1;
43
- min-width: 0;
44
- `;function _a(e){return"highlyRelevant"===e.category?e.rule.error?"Error":null!=e.rule.durationAtLeastMs?"Duration":"Relevance":fe[e.category]}const Qa=e=>e.readOnly?Qe(et,{data:e.data}):Qe(at,{formState:e.formState,onChange:e.onChange}),et=({data:e})=>{const a=da(()=>[{id:"name",title:pe,value:e.rule.name||ce},{id:"type",title:ue,value:_a(e)}],[e]),t=e.rule.notes||F;return ea(x,{children:[Qe(La,{children:a.map(({id:e,title:a,value:t})=>ea(Aa,{children:[Qe($,{size:A.XXXS,color:L.Secondary,nowrap:!0,children:a}),Qe($,{size:A.XS,nowrap:!0,children:t})]},e))}),ea(Aa,{children:[Qe($,{size:A.XXXS,color:L.Secondary,children:he}),Qe($,{size:A.XS,children:t})]})]})},at=({formState:e,onChange:a})=>{const t=na(e=>a({name:e.target.value}),[a]),l=na(e=>a({notes:e.target.value}),[a]);return Qe(x,{children:ea(Fa,{children:[Qe(Za,{children:Qe(u,{name:"sampling-input-rule-name",label:pe,tooltip:"Optional. Give this rule a name for easier identification.",placeholder:ge,value:e.name,onChange:t})}),Qe(Ya,{children:Qe(u,{name:"sampling-input-note",label:he,tooltip:ve,placeholder:me,value:e.notes,onChange:l})})]})})},tt=[{value:"Relevance",label:"Relevance"},{value:"Error",label:"Error"},{value:"Duration",label:"Duration"}],lt=({formState:e,onChange:a})=>{const t=na(e=>a({ruleType:e,keepErrors:"Error"===e}),[a]);return Qe(x,{richTitle:{title:`3. ${ue}`,subTitle:be},children:Qe(f,{$alignItems:"flex-start",children:Qe(y,{size:S.S,options:tt,selected:e.ruleType,setSelected:t})})})},rt=ma.div`
45
- display: flex;
46
- align-items: center;
47
- gap: 24px;
48
- padding: 8px 16px;
49
- border-radius: 12px;
50
- background-color: ${({theme:e})=>e.v2.colors.silver[800]};
51
- `,ot=ma.div`
52
- flex: 1;
53
- min-width: 0;
54
- white-space: pre;
55
- overflow-x: auto;
56
- `,st=({title:e,summary:t,onEdit:l,renderAction:r})=>{const o=da(()=>{const a=[];return e&&(a.push({text:e,variant:ye.Default}),a.push({text:" - ",variant:ye.Default})),a.push(...t),a},[e,t]);return ea(rt,{children:[Qe(ot,{children:Qe(Se,{parts:o})}),r&&r(),l&&Qe(xe,{"data-id":"sampling-btn-edit-auto-rule",label:ke,rightIcon:ra,variant:a.Text,size:U.S,onClick:l})]})},it=e=>{const a=da(()=>{if(e.readOnly)return e.summary;switch(e.category){case"noisy":return Pe(Le(e.formState));case"highlyRelevant":return Te($e(e.formState));case"costReduction":return Ce(we(e.formState))}},[e]);if(e.readOnly)return Qe(st,{title:Ae,summary:a,renderAction:e.renderAction});const t=1===a.length&&"default"===a[0].variant;return Qe(st,{title:t?Me:Ae,summary:t?[]:a,renderAction:e.renderAction})},nt=ma.div`
57
- display: flex;
58
- flex-wrap: wrap;
59
- gap: 8px;
60
- `,dt=ma.div`
61
- display: flex;
62
- align-items: center;
63
- gap: 8px;
64
- padding: 8px 12px;
65
- border-radius: 8px;
66
- cursor: pointer;
67
- background: ${({theme:e,$selected:a})=>a?e.v2.colors.silver[700]:e.v2.colors.silver[900]};
68
- border: 1px solid ${({theme:e,$selected:a})=>a?e.v2.colors.silver[500]:e.v2.colors.silver[800]};
69
-
70
- &:hover {
71
- background: ${({theme:e})=>e.v2.colors.silver[700]};
72
- }
73
- `,ct=ma.div`
74
- display: flex;
75
- width: 32px;
76
- height: 32px;
77
- justify-content: center;
78
- align-items: center;
79
- flex-shrink: 0;
80
- `,pt=ma.div`
81
- display: flex;
82
- flex-direction: column;
83
- gap: 4px;
84
- `,ut=ma.div`
85
- display: flex;
86
- align-items: center;
87
- gap: 8px;
88
- padding: 8px;
89
- border-radius: 8px;
90
- background-color: ${({theme:e})=>e.v2.colors.silver[900]};
91
- `,ht=ma.div`
92
- display: flex;
93
- width: 24px;
94
- height: 24px;
95
- justify-content: center;
96
- align-items: center;
97
- flex-shrink: 0;
98
- `,gt={[Be.JavaScript]:"Node.js",[Be.DotNet]:".NET",[Be.Php]:"PHP",[Be.Java]:"Java",[Be.Go]:"Go",[Be.Python]:"Python",[Be.Ruby]:"Ruby",[Be.Rust]:"Rust"},mt=[Be.Python,Be.Java,Be.JavaScript,Be.DotNet,Be.Php,Be.Ruby,Be.Go].map(e=>({id:e,label:gt[e]??e.charAt(0).toUpperCase()+e.slice(1),Icon:Ve(e)})),vt=[{value:"all",label:"Entire Cluster"},{value:"source",label:"Specific Source"},{value:"namespace",label:"Specific Namespace"},{value:"language",label:"Specific Programming Language"}];function ft(e){const a=gt[e];return a||e.charAt(0).toUpperCase()+e.slice(1)}const bt=e=>e.readOnly?Qe(yt,{scopes:e.scopes}):Qe(St,{formState:e.formState,onChange:e.onChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions}),yt=({scopes:e})=>Qe(x,{richTitle:{title:Oe},children:e.length?Qe(pt,{children:e.map((e,a)=>((e,a)=>{if(e.workloadLanguage){const t=Ve(e.workloadLanguage);return ea(ut,{children:[t&&Qe(ht,{children:Qe(t,{size:18})}),Qe($,{size:A.XS,color:L.Primary,children:ft(e.workloadLanguage)})]},a)}const t=[e.workloadNamespace,e.workloadKind,e.workloadName].filter(Boolean),l=t.length?t.join(" / "):"Unknown scope";return Qe(ut,{children:Qe($,{size:A.XS,color:L.Primary,children:l})},a)})(e,a))}):Qe(Ne,{status:Re.Default,message:ze,fullWidth:!0})}),St=({formState:e,onChange:a,sourceOptions:t=[],namespaceOptions:l=[]})=>{const[r,o]=ca("all"),i=e.sourceScopes.length>0,n=da(()=>vt.map(e=>({...e,disabled:"all"===e.value&&i})),[i]),d=da(()=>e.sourceScopes.filter(e=>"source"===e.scopeType).map(e=>{return a=e.workloadNamespace,t=e.workloadKind,l=e.workloadName,`${a}/${t}/${l}`;var a,t,l}),[e.sourceScopes]),c=da(()=>e.sourceScopes.filter(e=>"namespace"===e.scopeType).map(e=>e.workloadNamespace),[e.sourceScopes]),p=da(()=>new Set(e.sourceScopes.filter(e=>"language"===e.scopeType).map(e=>e.workloadLanguage)),[e.sourceScopes]),u=na(e=>{o(e)},[]),h=na(t=>{const l=e.sourceScopes.filter(e=>"source"!==e.scopeType),r=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=>({scopeType:"source",workloadName:e.name,workloadKind:e.kind,workloadNamespace:e.namespace,workloadLanguage:""}));a({sourceScopes:[...l,...r]})},[e.sourceScopes,a]),g=na(t=>{const l=e.sourceScopes.filter(e=>"namespace"!==e.scopeType),r=t.map(e=>({scopeType:"namespace",workloadName:"",workloadKind:"",workloadNamespace:e,workloadLanguage:""}));a({sourceScopes:[...l,...r]})},[e.sourceScopes,a]),m=na(t=>{if(e.sourceScopes.some(e=>"language"===e.scopeType&&e.workloadLanguage===t))a({sourceScopes:e.sourceScopes.filter(e=>!("language"===e.scopeType&&e.workloadLanguage===t))});else{const l={scopeType:"language",workloadName:"",workloadKind:"",workloadNamespace:"",workloadLanguage:t};a({sourceScopes:[...e.sourceScopes,l]})}},[e.sourceScopes,a]);return ea(x,{richTitle:{title:`1. ${Oe}`,subTitle:Xe},children:[Qe(Ne,!i&&"all"===r?{status:Re.Default,message:ze,fullWidth:!0,smallIcon:!0}:{status:Re.Info,message:De,fullWidth:!0,smallIcon:!0}),Qe(f,{$alignItems:"flex-start",children:Qe(y,{size:S.S,options:n,selected:r,setSelected:u})}),"source"===r&&Qe(Ie,{multiple:!0,"data-id":"sampling-autocomplete-source",options:t,value:d,onSelect:h,placeholder:Ee}),"namespace"===r&&Qe(Ie,{multiple:!0,"data-id":"sampling-autocomplete-namespace",options:l,value:c,onSelect:g,placeholder:"Search namespace"}),"language"===r&&Qe(nt,{children:mt.map(({id:e,label:a,Icon:t})=>{const l=p.has(e);return ea(dt,{$selected:l,onClick:()=>m(e),children:[Qe(s,{name:`sampling-scope-lang-${e}`,size:He.S,value:l,onChange:()=>m(e)}),Qe(ct,{children:Qe(t,{size:20})}),Qe($,{size:A.XS,nowrap:!0,children:a})]},e)})})]})},xt=(e,a)=>!a?.length||!!a?.find(a=>a===e),kt=({title:e="Signals",required:a,errorMessage:t,allowedSignals:l,selectedSignals:r,setSelectedSignals:o,disabled:i})=>{const[n,d]=ca(1===r.length),c=pa(JSON.stringify(r));ua(()=>{const e=Ke(r);e.length||je.forEach(({id:a})=>{xt(a,l)&&e.push(a)});const a=JSON.stringify(e);c.current!==a&&(c.current=a,o(e),d(1===e.length))},[l,r]);return ea(f,{$gap:12,children:[Qe(b,{label:e,required:a}),Qe(v,{$gap:12,children:je.map(e=>{const a=xt(e.id,l),t=((e,a)=>!!a?.find(a=>a===e))(e.id,r);return a?Qe(s,{label:e.value,disabled:i||!a||n&&t,value:t,onChange:a=>((e,a)=>{const t=e,l=a?[...r,t]:r.filter(e=>e!==t);o(l),d(1===l.length)})(e.id,a)},e.id):null})}),Qe(Ue,{errorMessage:t})]})},Ct=({minSupportedVersion:a,currentVersion:t})=>Qe(e,{isOpen:!0,onClose:()=>{},relativeToParent:!0,visual:()=>Qe(qe,{scale:2.4,icon:()=>Qe("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"21",viewBox:"0 0 22 21",fill:"none",children:Qe("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}.`}),wt=ma.div`
99
- display: flex;
100
- flex-direction: column;
101
- justify-content: flex-end;
102
- width: ${({$width:e})=>e};
103
- gap: ${({$columnHasHeader:e})=>e?"0":"12px"};
104
- `,Tt=ma.div`
105
- display: flex;
106
- align-items: center;
107
- min-height: 24px;
108
- padding: 12px;
109
- border-radius: 16px 16px 0 0;
110
- background-color: ${({theme:e})=>e.v2.colors.silver[800]};
111
- `,$t=ma.div`
112
- display: flex;
113
- flex-direction: column;
114
- gap: ${({$gap:e})=>e}px;
115
- padding: 12px 12px 0 12px;
116
- width: calc(100% - 24px);
117
- height: ${({$heightOffset:e,$columnHasHeader:a})=>`calc(100vh - 180px - ${e}px ${a?"- 48px":""})`};
118
- border-radius: ${({$columnHasHeader:e,$isLeft:a,$isRight:t})=>e?a?"0 0 0 16px":t?"0 16px 0 0":"0":a?"16px 0 0 16px":t?"0 16px 16px 0":"16px"};
119
- background-color: ${({theme:e})=>e.v2.colors.silver[900]};
120
- overflow-y: auto;
121
- overflow-x: hidden;
122
- `,Pt=({isLeft:e,isRight:a,heightOffset:t=0,width:l,header:r,list:o})=>ea(wt,{$width:l,$columnHasHeader:!!r,children:[r&&Qe(Tt,{children:r}),Qe($t,{$gap:8,$isLeft:e,$isRight:a,$heightOffset:t,$columnHasHeader:!!r,children:o.length?o.length>1?Qe(Ge,{gap:8,elements:o}):Qe(aa,{children:o[0]}):Qe(Je,{$height:"100%",children:Qe(We,{})})})]}),Lt="75vw",At=ma.div`
123
- display: flex;
124
- flex-direction: column;
125
- border-radius: 16px;
126
- background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
127
- overflow: hidden;
128
- `,Mt=ma.div`
129
- display: flex;
130
- gap: 12px;
131
- padding: 16px 16px 0 16px;
132
- background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
133
- position: sticky;
134
- top: 0;
135
- `,Ot=ma.div`
136
- padding: 12px 12px 0 12px;
137
- `,Nt=ma.div`
138
- display: flex;
139
- gap: 12px;
140
- padding: 16px;
141
- `,zt=ma.div`
142
- padding: 5vh 10vw;
143
- border-radius: 12px;
144
- background-color: ${({theme:e})=>e.v2.colors.silver[800]};
145
- `,Rt=ha(({isOpen:t,withOverlay:l,disableAnimation:r,onClose:o,onBack:s,onNext:i,nextIsSkip:n,onSave:d,disableSave:c,connectionIds:p,header:u,subHeader:h,leftColumn:g,rightColumn:m,search:v,filters:f,errorMessage:b,isFormDirty:y,hideDirtyNote:S,isFetching:x,progress:k},C)=>{const[w,T]=ca(!1),[$,P]=ca(!1),[L,M]=ca(void 0);ga(C,()=>({clearErrors:()=>M(void 0)}));const O=$,N=na(()=>{y&&!w?T(!0):(T(!1),o?.())},[y,w,o]),z=c||$||"boolean"==typeof y&&!y,R=na(async()=>{P(!0);const e=await d();P(!1),e?.error?M(e.error):(p?.setValue([]),o?.())},[d,p,o]),X=!!v||!!p||!!f,D=!!h,I=(X?48:0)+(D?50:0),E=da(()=>x?{status:Re.Info,message:"Fetching Data..."}:$&&!k?{status:Re.Info,message:"Saving Changes..."}:L||b?{status:Re.Error,message:L||b}:"boolean"==typeof y&&y&&!S?{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||S?void 0:{status:Re.Success,message:"The values reflect the current configuration of the selected cluster."},[x,$,k,L,b,y,S]),H=da(()=>s?{label:"Back",leftIcon:oa,variant:a.Secondary,onClick:s}:{label:"Cancel",variant:a.Secondary,onClick:N,disabled:O},[s,N,O]),[B,V]=ca(!1),K=da(()=>i?n?{"data-id":"wide-drawer-skip",label:"Skip",rightIcon:sa,variant:a.Secondary,onClick:()=>V(!0)}:{"data-id":"wide-drawer-next",label:"Next",rightIcon:sa,variant:a.Primary,onClick:i}:{"data-id":"wide-drawer-save",label:"Save",variant:a.Primary,onClick:R,disabled:z},[i,n,R,z]);return ea(Fe,{width:Lt,isOpen:t,disableAnimation:r,hideOverlay:!$&&!l,header:{...u,onClose:o?N:void 0,onCloseDisabled:O},footer:{note:E,actions:[H,K]},children:[$?Qe(Je,{$height:"calc(100vh - 136px)",children:Qe(zt,{children:Qe(Ze,{titleSize:A.S,subTitleSize:A.XXXS,withGradient:!0,withSpinner:!0,...k})})}):ea(At,{children:[X&&ea(Mt,{children:[p&&Qe(Ye,{icon:ia,title:"Selected Clusters",badge:{label:p.value.length}}),v&&Qe(_e,{width:"100%",...v}),f]}),D&&Qe(Ot,{children:Qe(Ye,{icon:h.icon,title:h.title,subTitle:h.description,badge:h.badge})}),ea(Nt,{children:[Qe(Pt,{isLeft:!0,heightOffset:I,...g}),Qe(Pt,{isRight:!0,heightOffset:I,...m})]})]}),Qe(va,{isOpen:w,onClose:()=>T(!1),onApprove:N}),Qe(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:()=>{i?.(),V(!1)}}})]})});Rt.displayName=Rt.name;export{st as A,va as C,ba as D,xa as N,Va as O,Ca as P,Qa as R,kt as S,Ct as U,Rt as W,Sa as a,it as b,bt as c,lt as d,Ta as e,Ga as f,fa as g,Lt as h,ya as i,ka as j};