@odigos/ui-kit 0.0.295 → 0.0.297
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/lib/chunks/{helpers-CVRjhvw4.js → helpers-BAKrBm6o.js} +1 -1
- package/lib/chunks/index-CmgxyAds.js +358 -0
- package/lib/chunks/{source-instrument-form-context-CgGshOFa.js → source-instrument-form-context-D_S8tMme.js} +2 -2
- package/lib/chunks/ui-components-ChTo9ZLp.js +2163 -0
- package/lib/components/_cards/data-card/index.d.ts +3 -0
- package/lib/components/field-title/index.d.ts +1 -1
- package/lib/components/fullscreen/index.d.ts +21 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/components/info-row/index.d.ts +4 -0
- package/lib/components/input/index.d.ts +3 -1
- package/lib/components/ping/index.d.ts +2 -1
- package/lib/components/table/types.d.ts +1 -0
- package/lib/components/trace-view/index.d.ts +1 -1
- package/lib/components/trace-view/styled.d.ts +12 -5
- package/lib/components/trace-view/types.d.ts +9 -4
- package/lib/components.js +1 -1
- package/lib/constants/insights/system.d.ts +2 -2
- package/lib/constants.js +1 -1
- package/lib/containers/_drawers/edit-source-drawer/profiling/flame-graph-canvas.d.ts +1 -1
- package/lib/containers/_drawers/edit-source-drawer/profiling/index.d.ts +0 -2
- package/lib/containers/insights/findings/drawer/anomaly/anomaly-trace-compare/helpers.d.ts +10 -2
- package/lib/containers/insights/findings/drawer/index.d.ts +2 -2
- package/lib/containers/insights/insights-context.d.ts +11 -6
- package/lib/containers.js +531 -531
- package/lib/contexts/odigos-api/types.d.ts +1 -0
- package/lib/contexts.js +1 -1
- package/lib/functions/parse-raw-otlp/index.d.ts +2 -1
- package/lib/functions.js +1 -1
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/useFullscreen.d.ts +14 -0
- package/lib/hooks.js +1 -1
- package/lib/icons.js +1 -1
- package/lib/snippets/blast-radius/helpers.d.ts +5 -5
- package/lib/snippets/blast-radius/types.d.ts +0 -4
- package/lib/snippets/graph-flow/types.d.ts +4 -0
- package/lib/snippets.js +1 -1
- package/lib/store.js +1 -1
- package/lib/theme/palettes/index.d.ts +1 -0
- package/lib/theme.js +1 -1
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +1 -1
- package/lib/chunks/index-B13xWqwt.js +0 -342
- package/lib/chunks/ui-components-DwtaxXwl.js +0 -2120
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Edge } from '@xyflow/react';
|
|
2
2
|
import type { DefaultTheme } from 'styled-components';
|
|
3
|
-
import { type
|
|
3
|
+
import { type BlastRadiusServiceNode } from './types';
|
|
4
4
|
import type { InsightsBlastRadiusNode, InsightsBlastRadiusSubgraph } from '../../types';
|
|
5
5
|
export declare const NODE_WIDTH = 120;
|
|
6
6
|
export declare const NODE_HEIGHT = 58;
|
|
@@ -16,12 +16,12 @@ export declare const findAttackerNodeId: (rootId: string, nodes: Array<{
|
|
|
16
16
|
id: string;
|
|
17
17
|
service: string;
|
|
18
18
|
}>) => string | null;
|
|
19
|
-
export declare const buildBlastRadiusNodes: (subgraph: InsightsBlastRadiusSubgraph
|
|
20
|
-
export declare const buildBlastRadiusEdges: (subgraph: InsightsBlastRadiusSubgraph, theme: DefaultTheme, nodeIds: Set<string
|
|
19
|
+
export declare const buildBlastRadiusNodes: (subgraph: InsightsBlastRadiusSubgraph) => BlastRadiusServiceNode[];
|
|
20
|
+
export declare const buildBlastRadiusEdges: (subgraph: InsightsBlastRadiusSubgraph, theme: DefaultTheme, nodeIds: Set<string>) => Edge[];
|
|
21
21
|
/**
|
|
22
|
-
* Center-out layout: root in the middle,
|
|
22
|
+
* Center-out layout: root in the middle, user caller fan left, callees fan right.
|
|
23
23
|
* Keeps the graph wide/short to match the blast-radius frame (unlike service-map's vertical fan).
|
|
24
|
-
* The
|
|
24
|
+
* The user is pulled out of the L/R fans and parked next to its connected targets.
|
|
25
25
|
*/
|
|
26
26
|
export declare const getBlastRadiusLayout: (nodes: BlastRadiusServiceNode[], edges: Edge[]) => {
|
|
27
27
|
nodes: BlastRadiusServiceNode[];
|
|
@@ -10,10 +10,6 @@ export type BlastRadiusNodeData = {
|
|
|
10
10
|
namespace: string;
|
|
11
11
|
isVirtual: boolean;
|
|
12
12
|
isRoot: boolean;
|
|
13
|
-
isAttacker: boolean;
|
|
14
13
|
isUser: boolean;
|
|
15
14
|
};
|
|
16
|
-
export type BlastRadiusEdgeData = {
|
|
17
|
-
isAttacker: boolean;
|
|
18
|
-
};
|
|
19
15
|
export type BlastRadiusServiceNode = Node<BlastRadiusNodeData, BlastRadiusNodeTypes.Service>;
|
|
@@ -50,6 +50,10 @@ export interface GraphFlowProps<N extends Node = Node> {
|
|
|
50
50
|
showBackground?: boolean;
|
|
51
51
|
/** Soften node focus/selection chrome (baselines). Default true when not interactive. */
|
|
52
52
|
suppressNodeFocusStyle?: boolean;
|
|
53
|
+
/** Show an expand control that portals the map to a full-viewport overlay. Default true. */
|
|
54
|
+
withFullscreen?: boolean;
|
|
55
|
+
/** Notifies the parent whenever the user toggles fullscreen. */
|
|
56
|
+
onFullscreenChange?: (isFullscreen: boolean) => void;
|
|
53
57
|
onNodesChange?: OnNodesChange<N>;
|
|
54
58
|
onEdgesChange?: OnEdgesChange;
|
|
55
59
|
onNodeClick?: NodeMouseHandler<N>;
|
package/lib/snippets.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{A as ActionType,a as Actions,R as RichTitle}from"./chunks/ui-components-
|
|
1
|
+
export{A as ActionType,a as Actions,R as RichTitle}from"./chunks/ui-components-ChTo9ZLp.js";export{A as AnimatedCollapse,a as AnimatedGraphEdge,b as AutoFitView,B as BlastRadius,C as CancelModal,c as ConnectorCreatedModal,D as DEFAULT_GRAPH_FIT_VIEW_OPTIONS,d as DURATION_OPTIONS,e as DeleteModal,f as DurationErrorsSection,g as DynamicActionFields,h as DynamicField,i as DynamicFields,E as EnableDisableSegment,G as GRAPH_FLOW_ANIMATED_EDGE,j as GraphFlow,k as GraphFlowComponent,I as InstrumentationPreviewSection,N as NOISY_PERCENTAGE_OPTIONS,O as OdigosLogoTextByTier,l as OperationSection,P as PERCENTAGE_OPTIONS,m as PercentageSection,n as PresetWithCustomInput,R as RuleInfoSection,o as RuleTypeSection,S as SamplingPreviewSection,p as SignalsCheckboxList,q as SourceScopeSection,U as UpgradeModal,W as WIDE_DRAWER_WIDTH,r as WideDrawer,Y as YamlSectionCard,s as getElkLayoutedElements,t as getGraphEdgePath}from"./chunks/index-CmgxyAds.js";export{C as ColoredSpan,a as ColoredSpanVariant}from"./chunks/helpers-BAKrBm6o.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"virtua";import"elkjs/lib/elk.bundled.js";import"@xyflow/react";import"@xyflow/react/dist/style.css";
|
package/lib/store.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{ht as DrawerType,bj as ProgressKeys,jx as getDrawerTypeForAdd,eS as getDrawerTypeForEdit,bg as useDataStreamStore,eN as useDrawerStore,js as useFilterStore,bb as useNotificationStore,bh as useProgressStore,jy as useSelectedStore,bi as useSetupStore}from"./chunks/ui-components-ChTo9ZLp.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"virtua";
|
package/lib/theme.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{nI as Provider,nJ as animations,nK as opacity,nL as palettes}from"./chunks/ui-components-ChTo9ZLp.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"virtua";
|
package/lib/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{ek as ActionCategoryTypes,by as ActionKeyTypes,bz as ActionType,kP as AgentInjectedReason,kQ as BooleanOperation,es as CloudConnectorFeatureKey,am as CodeAttributesKeyTypes,kR as ConditionType,be as Crud,ag as CustomInstrumentationsKeyTypes,f1 as DesiredConditionActionItemType,eH as DesiredStateProgress,kS as DestinationTypes,bf as EntityTypes,c8 as ExtractionDataFormat,q as FieldTypes,ai as GolangCustomProbe,ak as HeadersCollectionKeyTypes,J as InputTypes,kT as InsightsAnomalyClassFindingKind,iP as InsightsAnomalyResolution,iM as InsightsAnomalyStatus,kU as InsightsBaselineHistogramUnit,iQ as InsightsBaselineLearningPhase,iO as InsightsBulkResolution,bT as InsightsDeviationClass,bn as InsightsEntityTypes,iN as InsightsFindingKind,bV as InsightsLearningConditionType,bX as InsightsLearningMode,bS as InsightsPolicyScope,bM as InsightsRuleMode,i$ as InsightsSampleReason,e9 as InsightsSeverity,jp as InsightsStorageDiskStatus,kV as InsightsStorageHealthStatus,kW as InsightsTransactionKind,iL as InsightsViolationStatus,kX as InstallationMethod,kY as InstallationStatus,af as InstrumentationRuleType,kZ as IntrumentationStatus,ah as JavaCustomProbe,k_ as JsonOperation,c6 as K8sAttributesFrom,c0 as K8sResourceKind,k$ as K8sWorkloadContainerAgentConfigTracesHeadSamplingSpanMetricsMode,l0 as ListDirection,l1 as NumberOperation,l2 as OtelDistroName,l3 as OtherEntityTypes,al as PayloadCollectionKeyTypes,aj as PhpCustomProbe,P as PlatformType,l4 as PodContainerLifecycleStatus,l5 as PodContainerStatus,l6 as PodPhase,l7 as Profile,_ as ProgrammingLanguages,fc as RecommendationApplyExampleType,fd as RecommendationRemediationType,fb as RecommendationState,l8 as RecommendationType,l9 as SIGNAL_KEY_TO_TYPE,la as SIGNAL_TYPE_TO_KEY,lb as SignalKey,bE as SignalType,lc as SortDirection,S as StatusType,ld as StringOperation,b as Tier,le as WorkloadRolloutReason,jL as WorkloadRolloutStatus}from"./chunks/ui-components-ChTo9ZLp.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"virtua";
|
package/lib/visuals.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{lf as VISUAL_ODIGOS_LOGO_HEIGHT,lg as VISUAL_ODIGOS_LOGO_WIDTH,V as VisualGreenRings,lh as VisualOdigosLogo,hD as VisualPurpleRings}from"./chunks/ui-components-ChTo9ZLp.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"virtua";
|
package/package.json
CHANGED
|
@@ -1,342 +0,0 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import r,{css as l,useTheme as n}from"styled-components";import i from"elkjs/lib/elk.bundled.js";import o,{useMemo as s,useRef as d,useCallback as c,useState as u,memo as p,useEffect as h,Fragment as g,forwardRef as m,useImperativeHandle as v}from"react";import{Handle as f,Position as b,useReactFlow as y,ReactFlowProvider as x,ReactFlow as $,Background as k,getSmoothStepPath as C,BaseEdge as w,EdgeLabelRenderer as S,MarkerType as T}from"@xyflow/react";import{D as M,c as L,F as A,d as P,e as O,f as E,g as N,h as I,B as R,i as V,j as D,k as X,C as z,N as _,W as H,l as B,m as j,V as q,n as U,o as F,p as G,q as W,r as K,s as Y,u as Z,v as J,I as Q,w as ee,x as te,y as ae,z as re,E as le,G as ne,H as ie,S as oe,J as se,K as de,U as ce,L as ue,M as pe,O as he,Q as ge,X as me,Y as ve,Z as fe,_ as be,$ as ye,a0 as xe,a1 as $e,a2 as ke,a3 as Ce,a4 as we,a5 as Se,a6 as Te,T as Me,a7 as Le,a8 as Ae,a9 as Pe,aa as Oe,ab as Ee,ac as Ne,ad as Ie,ae as Re,af as Ve,ag as De,ah as Xe,ai as ze,aj as _e,b as He,ak as Be,al as je,am as qe,an as Ue,ao as Fe,ap as Ge,aq as We,ar as Ke,as as Ye,at as Ze,au as Je,av as Qe,aw as et,ax as tt,ay as at,az as rt,aA as lt,aB as nt,aC as it,aD as ot,aE as st,aF as dt,aG as ct,aH as ut,aI as pt,aJ as ht,aK as gt,aL as mt,aM as vt,aN as ft,aO as bt,aP as yt,aQ as xt,aR as $t,aS as kt,aT as Ct,aU as wt,aV as St,aW as Tt,aX as Mt,aY as Lt,aZ as At,a_ as Pt,a$ as Ot,b0 as Et,b1 as Nt,b2 as It,R as Rt,b3 as Vt,b4 as Dt,A as Xt,b5 as zt,b6 as _t}from"./ui-components-DwtaxXwl.js";import{UserIcon as Ht,DestinationIcon as Bt,HomeIcon as jt,VIcon as qt,TrashIcon as Ut,PlusIcon as Ft,VSquareIcon as Gt,XSquareIcon as Wt,EditIcon as Kt,OdigosLogoTextCentral as Yt,OdigosLogoTextEnterprise as Zt,OdigosLogoTextCommunity as Jt,OdigosLogoTextColoredCentral as Qt,OdigosLogoTextColoredEnterprise as ea,OdigosLogoTextColoredCommunity as ta,ArrowLeftIcon as aa,ArrowRightIcon as ra,CopyIcon as la,YamlIcon as na}from"../icons.js";import"@xyflow/react/dist/style.css";import{i as ia,m as oa,u as sa,n as da,a as ca,C as ua,b as pa,d as ha,e as ga,f as ma,g as va,h as fa,j as ba,k as ya}from"./helpers-CVRjhvw4.js";const xa=/^[a-zA-Z]$/,$a=new Set(["*","+","?"]),ka=new Set(["^","$"]),Ca={group:"rgba(102, 242, 102, 0.5)","anchor-quantifier":"rgba(102, 191, 255, 0.5)","class-bracket":"rgba(255, 153, 153, 0.5)","class-content":"rgba(178, 1, 1, 0.5)",alternation:"rgba(255, 153, 153, 0.5)",literal:"transparent"},wa=r.div`
|
|
2
|
-
padding: 8px 16px;
|
|
3
|
-
border-radius: 6px;
|
|
4
|
-
border: 1px solid ${({theme:e})=>e.v2.colors.silver[500]};
|
|
5
|
-
background: ${({theme:e})=>e.v2.colors.black[500]};
|
|
6
|
-
font-family: ${({theme:e})=>e.font_family.code};
|
|
7
|
-
font-size: 12px;
|
|
8
|
-
line-height: 20px;
|
|
9
|
-
color: ${({theme:e})=>e.v2.colors.white[500]};
|
|
10
|
-
word-break: break-all;
|
|
11
|
-
white-space: pre-wrap;
|
|
12
|
-
user-select: text;
|
|
13
|
-
|
|
14
|
-
/* Wraps the background tightly to each visual fragment when a colored
|
|
15
|
-
token gets split across two visual lines. Without this the highlight
|
|
16
|
-
stretches all the way to the right edge of the container. */
|
|
17
|
-
& > span {
|
|
18
|
-
box-decoration-break: clone;
|
|
19
|
-
-webkit-box-decoration-break: clone;
|
|
20
|
-
}
|
|
21
|
-
`,Sa=r.span`
|
|
22
|
-
background: ${({$kind:e})=>Ca[e]};
|
|
23
|
-
`,Ta=({pattern:t,"data-id":a})=>{const r=s(()=>(e=>{const t=[];let a=0,r=!1;const l=(e,a)=>{const r=t[t.length-1];r&&r.kind===a?r.text+=e:t.push({text:e,kind:a})};for(;a<e.length;){const t=e[a];if(r){if("]"===t){l("]","class-bracket"),r=!1,a++;continue}if("\\"===t&&a+1<e.length){l(e.slice(a,a+2),"class-content"),a+=2;continue}l(t,"class-content"),a++}else{if("("===t&&"?"===e[a+1]){let t=2;const r=e[a+2];if(":"===r||"="===r||"!"===r)t=3;else if("<"===r){const r=e[a+3];if("="===r||"!"===r)t=4;else{const r=e.indexOf(">",a+2);-1!==r&&(t=r-a+1)}}l(e.slice(a,a+t),"group"),a+=t;continue}if("("!==t&&")"!==t)if("["!==t)if($a.has(t)||ka.has(t))l(t,"anchor-quantifier"),a++;else{if("{"===t){const t=e.indexOf("}",a);if(t>a&&/^\{\d+,?\d*\}$/.test(e.slice(a,t+1))){l(e.slice(a,t+1),"anchor-quantifier"),a=t+1;continue}}if("\\"===t&&a+1<e.length){const t=e[a+1];xa.test(t)?l(e.slice(a,a+2),"anchor-quantifier"):l(e.slice(a,a+2),"literal"),a+=2;continue}"|"!==t?(l(t,"literal"),a++):(l("|","alternation"),a++)}else"^"===e[a+1]?(l("[^","class-bracket"),a+=2):(l("[","class-bracket"),a++),r=!0;else l(t,"group"),a++}}return t})(t),[t]);return e(wa,t?{"data-id":a,children:r.map((t,a)=>e(Sa,{$kind:t.kind,children:t.text},a))}:{"data-id":a,children:" "})},Ma="rgba(102, 191, 255, 0.5)",La=l`
|
|
24
|
-
font-family: ${({theme:e})=>e.font_family.code};
|
|
25
|
-
font-size: 12px;
|
|
26
|
-
line-height: 20px;
|
|
27
|
-
letter-spacing: 0;
|
|
28
|
-
white-space: pre-wrap;
|
|
29
|
-
word-wrap: break-word;
|
|
30
|
-
overflow-wrap: break-word;
|
|
31
|
-
/* tab-size keeps tabs visually consistent across the two layers — some
|
|
32
|
-
browsers default to 8 on a textarea but 4 on a div. */
|
|
33
|
-
-moz-tab-size: 4;
|
|
34
|
-
tab-size: 4;
|
|
35
|
-
margin: 0;
|
|
36
|
-
`,Aa=r.div`
|
|
37
|
-
position: relative;
|
|
38
|
-
width: 100%;
|
|
39
|
-
min-height: ${({$minHeight:e})=>e}px;
|
|
40
|
-
border-radius: 6px;
|
|
41
|
-
border: 1px solid ${({theme:e})=>e.v2.colors.silver[500]};
|
|
42
|
-
background: ${({theme:e})=>e.v2.colors.black[500]};
|
|
43
|
-
|
|
44
|
-
&:hover,
|
|
45
|
-
&:focus-within {
|
|
46
|
-
border-color: ${({theme:e})=>e.v2.colors.silver[300]};
|
|
47
|
-
}
|
|
48
|
-
`,Pa=r.div`
|
|
49
|
-
${La}
|
|
50
|
-
position: absolute;
|
|
51
|
-
inset: 0;
|
|
52
|
-
padding: 12px;
|
|
53
|
-
pointer-events: none;
|
|
54
|
-
color: transparent;
|
|
55
|
-
overflow: hidden;
|
|
56
|
-
|
|
57
|
-
/* Mandatory for backgrounds that wrap across visual lines. */
|
|
58
|
-
& > span {
|
|
59
|
-
box-decoration-break: clone;
|
|
60
|
-
-webkit-box-decoration-break: clone;
|
|
61
|
-
}
|
|
62
|
-
`,Oa=r.textarea`
|
|
63
|
-
${La}
|
|
64
|
-
position: relative;
|
|
65
|
-
z-index: 1;
|
|
66
|
-
display: block;
|
|
67
|
-
width: 100%;
|
|
68
|
-
min-height: ${({$minHeight:e})=>e}px;
|
|
69
|
-
padding: 12px;
|
|
70
|
-
border: 0;
|
|
71
|
-
background: transparent;
|
|
72
|
-
outline: none;
|
|
73
|
-
resize: vertical;
|
|
74
|
-
color: ${({theme:e})=>e.v2.colors.white[500]};
|
|
75
|
-
caret-color: ${({theme:e})=>e.v2.colors.white[500]};
|
|
76
|
-
box-sizing: border-box;
|
|
77
|
-
|
|
78
|
-
&::placeholder {
|
|
79
|
-
color: ${({theme:e})=>e.v2.colors.silver[600]};
|
|
80
|
-
}
|
|
81
|
-
`,Ea=e=>({before:e,matchPre:"",capture:"",matchPost:"",after:""}),Na=({regex:a,value:r,onChange:l,minHeight:n=240,...i})=>{const o=d(null),u=d(null),p=s(()=>((e,t)=>{if(!e||!t)return Ea(t);let a;try{a=new RegExp(e)}catch{return Ea(t)}const r=a.exec(t);if(!r)return Ea(t);const l=r.index,n=r.index+r[0].length;if(r.length<2||null==r[1])return{before:t.slice(0,l),matchPre:"",capture:t.slice(l,n),matchPost:"",after:t.slice(n)};const i=r[0].indexOf(r[1]),o=i>=0?l+i:l,s=o+r[1].length;return{before:t.slice(0,l),matchPre:t.slice(l,o),capture:t.slice(o,s),matchPost:t.slice(s,n),after:t.slice(n)}})(a,r),[a,r]),h=c(()=>{o.current&&u.current&&(o.current.scrollTop=u.current.scrollTop,o.current.scrollLeft=u.current.scrollLeft)},[]);return t(Aa,{$minHeight:n,children:[t(Pa,{ref:o,"aria-hidden":!0,children:[p.before,e("span",{style:{background:Ma},children:p.matchPre}),e("span",{style:{background:"rgba(102, 242, 102, 0.5)"},children:p.capture}),e("span",{style:{background:Ma},children:p.matchPost}),p.after,r.endsWith("\n")?" ":""]}),e(Oa,{ref:u,$minHeight:n,value:r,onChange:e=>l(e.target.value),onScroll:h,spellCheck:!1,...i})]})},Ia=r.div`
|
|
82
|
-
flex: 1;
|
|
83
|
-
min-height: 0;
|
|
84
|
-
overflow-y: auto;
|
|
85
|
-
`,Ra=r.div`
|
|
86
|
-
background: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
87
|
-
border-radius: 8px;
|
|
88
|
-
padding: 8px;
|
|
89
|
-
display: flex;
|
|
90
|
-
flex-direction: column;
|
|
91
|
-
gap: 12px;
|
|
92
|
-
`,Va=r.div`
|
|
93
|
-
padding: 8px 16px;
|
|
94
|
-
border-radius: 8px;
|
|
95
|
-
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
96
|
-
font-family: ${({theme:e})=>e.font_family.code};
|
|
97
|
-
font-size: 12px;
|
|
98
|
-
line-height: 20px;
|
|
99
|
-
color: ${({theme:e,$tone:t})=>"error"===t?e.v2.colors.red[500]:"match"===t?e.v2.colors.white[500]:e.v2.colors.silver[200]};
|
|
100
|
-
word-break: break-all;
|
|
101
|
-
white-space: pre-wrap;
|
|
102
|
-
user-select: text;
|
|
103
|
-
`,Da=({isOpen:a,regex:r,onClose:l,initialTestString:n=""})=>{const[i,o]=u(n),d=s(()=>((e,t)=>{if(!e)return{ok:!0,isMatch:!1,message:L.RESULT_EMPTY_REGEX};if(!t)return{ok:!0,isMatch:!1,message:L.RESULT_EMPTY_INPUT};let a;try{a=new RegExp(e)}catch(e){return{ok:!1,message:e instanceof Error?e.message:L.RESULT_INVALID_REGEX_FALLBACK}}const r=a.exec(t);return r?{ok:!0,isMatch:!0,message:r.length>1?r[1]:r[0]}:{ok:!0,isMatch:!1,message:L.RESULT_NO_MATCH}})(r,i),[r,i]),c=d.ok?d.isMatch?"match":"neutral":"error";return e(M,{isOpen:a,header:{title:L.TITLE,onClose:()=>{o(""),l()}},children:e(Ia,{children:t(Ra,{children:[t(A,{$gap:6,children:[e(P,{label:L.REGEX_LABEL}),e(Ta,{pattern:r,"data-id":"regex-tester-regex"}),!r&&e(O,{size:N.XXS,color:E.Secondary,children:L.REGEX_EMPTY_HINT})]}),t(A,{$gap:6,children:[t(I,{$width:"100%",$justifyContent:"space-between",$alignItems:"center",children:[e(P,{label:L.TEST_STRING_LABEL}),e(R,{"data-id":"regex-tester-unescape",label:L.UNESCAPE_LABEL,tooltip:L.UNESCAPE_TOOLTIP,variant:D.Secondary,size:V.S,onClick:()=>o(e=>(e=>{let t="";for(let a=0;a<e.length;a++){if("\\"===e[a]&&a+1<e.length){const r=e[a+1],l="n"===r?"\n":"t"===r?"\t":"r"===r?"\r":'"'===r?'"':"'"===r?"'":"\\"===r?"\\":null;if(null!=l){t+=l,a++;continue}}t+=e[a]}return t})(e)),disabled:(p=i,!/\\["'\\nrt]/.test(p))})]}),e(Na,{name:"regex-tester-test-string","data-id":"regex-tester-test-string",placeholder:L.TEST_STRING_PLACEHOLDER,regex:r,value:i,onChange:o,minHeight:240}),e(X,{helpMessage:L.TEST_STRING_HELP})]}),t(A,{$gap:8,children:[e(P,{label:L.RESULT_LABEL}),e(Va,{$tone:c,"data-id":"regex-tester-result",children:d.message}),d.ok&&d.isMatch&&e(O,{size:N.XXS,color:E.Secondary,children:L.RESULT_CAPTURE_HINT})]})]})})});var p},Xa=r.div`
|
|
104
|
-
display: grid;
|
|
105
|
-
grid-template-rows: ${({$open:e})=>e?"1fr":"0fr"};
|
|
106
|
-
opacity: ${({$open:e})=>e?1:0};
|
|
107
|
-
margin-bottom: ${({$open:e,$gapCancelPx:t})=>e?"0":`-${t}px`};
|
|
108
|
-
transition:
|
|
109
|
-
grid-template-rows ${220}ms ease,
|
|
110
|
-
opacity ${220}ms ease ${({$open:e,$delayInMs:t})=>e?`${t}ms`:"0ms"},
|
|
111
|
-
margin-bottom ${220}ms ease;
|
|
112
|
-
pointer-events: ${({$open:e})=>e?"auto":"none"};
|
|
113
|
-
|
|
114
|
-
> .animated-collapse-inner {
|
|
115
|
-
overflow: hidden;
|
|
116
|
-
min-height: 0;
|
|
117
|
-
}
|
|
118
|
-
`,za=({open:t,children:a,delayInMs:r=0,gapCancelPx:l=0})=>e(Xa,{$open:t,$delayInMs:r,$gapCancelPx:l,"aria-hidden":!t,children:e("div",{className:"animated-collapse-inner",children:a})}),_a=r.div`
|
|
119
|
-
box-sizing: border-box;
|
|
120
|
-
min-width: 109px;
|
|
121
|
-
max-width: 160px;
|
|
122
|
-
padding: 12px;
|
|
123
|
-
border-radius: 8px;
|
|
124
|
-
display: flex;
|
|
125
|
-
flex-direction: column;
|
|
126
|
-
gap: 8px;
|
|
127
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
128
|
-
border: 1px
|
|
129
|
-
${({theme:e,$isRoot:t,$isVirtual:a})=>t?`solid ${e.v2.colors.purple[400]}`:a?`dashed ${e.v2.colors.silver[300]}`:`solid ${e.v2.colors.silver[200]}`};
|
|
130
|
-
opacity: ${({$isVirtual:e,$isRoot:t})=>e&&!t?.85:1};
|
|
131
|
-
`,Ha=r.div`
|
|
132
|
-
display: flex;
|
|
133
|
-
align-items: center;
|
|
134
|
-
gap: 4px;
|
|
135
|
-
min-width: 0;
|
|
136
|
-
`,Ba=r.div`
|
|
137
|
-
flex-shrink: 0;
|
|
138
|
-
width: 16px;
|
|
139
|
-
height: 16px;
|
|
140
|
-
display: flex;
|
|
141
|
-
align-items: center;
|
|
142
|
-
justify-content: center;
|
|
143
|
-
`,ja={visibility:"hidden"},qa=p(({data:r})=>{const l=n(),{service:i,namespace:o,isVirtual:s,isRoot:d,isAttacker:c,isUser:u}=r,p=((e,t)=>"user"===e?Ht:t?Bt:jt)(i,s),h=d?l.v2.colors.purple[400]:l.v2.colors.silver[200],g=d?E.Link:E.Secondary,m=o?`${o}/${i}`:i,v=s?"virtual":"-";return t(a,{children:[e(f,c||u?{type:"source",position:b.Bottom,style:ja}:{type:"source",position:b.Top,style:ja}),e(f,c||u?{type:"target",position:b.Right,style:ja}:{type:"target",position:b.Left,style:ja}),t(_a,{$isRoot:d,$isVirtual:s,children:[t(Ha,{children:[e(Ba,{children:e(p,{size:16,fill:h})}),e(O,{size:N.XXXS,color:g,nowrap:!0,children:m})]}),e(O,{size:N.XXXS,color:g,nowrap:!0,children:v})]})]})});qa.displayName=qa.name;const Ua={duration:300,padding:.2,includeHiddenNodes:!0,maxZoom:1},Fa=({trigger:e,options:t=Ua})=>{const{fitView:a}=y(),r=d(!0);return h(()=>{r.current?r.current=!1:e>0&&requestAnimationFrame(()=>a(t))},[e,a,t]),null},Ga=r.div`
|
|
144
|
-
position: relative;
|
|
145
|
-
width: 100%;
|
|
146
|
-
height: ${({$height:e})=>e};
|
|
147
|
-
border-radius: 8px;
|
|
148
|
-
overflow: hidden;
|
|
149
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
150
|
-
|
|
151
|
-
.react-flow__attribution {
|
|
152
|
-
visibility: hidden;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
${({$lockPointerEvents:e})=>e?"\n .react-flow__node {\n cursor: default;\n pointer-events: none;\n }\n ":""}
|
|
156
|
-
|
|
157
|
-
${({$suppressFocus:e})=>e?"\n .react-flow__node:focus,\n .react-flow__node:focus-visible,\n .react-flow__node.selected {\n outline: none;\n box-shadow: none;\n }\n ":""}
|
|
158
|
-
|
|
159
|
-
* {
|
|
160
|
-
transition: none;
|
|
161
|
-
}
|
|
162
|
-
`,Wa=e=>"number"==typeof e?`${e}px`:e;function Ka({nodes:a,edges:r,nodeTypes:l,edgeTypes:i,height:o=420,interactive:d=!1,minZoom:c=.2,maxZoom:u=1.5,fitViewPadding:p=.2,fitViewTrigger:h=0,showBackground:g=!0,suppressNodeFocusStyle:m,onNodesChange:v,onEdgesChange:f,onNodeClick:b,onNodeMouseEnter:y,onNodeMouseLeave:x,className:C,style:w,children:S}){const T=n(),M=!d,L=m??M,A=s(()=>({...Ua,padding:p,maxZoom:Math.min(Ua.maxZoom??1,u)}),[p,u]);return e(Ga,{className:C,style:w,$height:Wa(o),$lockPointerEvents:M,$suppressFocus:L,children:t($,{nodes:a,edges:r,nodeTypes:l,edgeTypes:i,onNodesChange:v,onEdgesChange:f,onNodeClick:b,onNodeMouseEnter:y,onNodeMouseLeave:x,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,nodesFocusable:!M,edgesFocusable:!1,panOnDrag:!0,zoomOnScroll:!0,minZoom:c,maxZoom:u,proOptions:{hideAttribution:!0},children:[g&&e(k,{color:T.v2.colors.silver[600],gap:17,size:1}),e(Fa,{trigger:h,options:A}),S]})})}function Ya(t){return e(x,{children:e(Ka,{...t})})}const Za=t=>e(Ya,{...t}),Ja=({sourceX:e,sourceY:t,targetX:a,targetY:r,sourcePosition:l=b.Right,targetPosition:n=b.Left,isSelfLoop:i,selfLoopNodeHeight:o})=>i?(({sourceX:e,sourceY:t,targetX:a,targetY:r,selfLoopNodeHeight:l=80})=>{const n=(e+a)/2,i=l/2+40,o=Math.min(t,r)-i;return[`M ${e},${t} C ${e+28},${t} ${e+28},${o} ${n},${o} C ${a-28},${o} ${a-28},${r} ${a},${r}`,n,o,0,0]})({sourceX:e,sourceY:t,targetX:a,targetY:r,selfLoopNodeHeight:o}):C({sourceX:e,sourceY:t,targetX:a,targetY:r,sourcePosition:l,targetPosition:n}),Qa=new i,er=async(e,t,a)=>{const{nodeWidth:r,nodeHeight:l,rootIds:n=[],rootLayerConstraint:i="FIRST",rootAlignCenter:o="FIRST"===i,spacing:s,direction:d,extraOptions:c}=a,u=new Set(n),p=(({direction:e="RIGHT",spacing:t,extraOptions:a})=>({"elk.algorithm":"layered","elk.direction":e,"elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.spacing.nodeNodeBetweenLayers":String(t?.betweenLayers??120),"elk.spacing.nodeNode":String(t?.nodeNode??24),"elk.layered.spacing.edgeEdgeBetweenLayers":String(t?.edgeEdge??24),"elk.layered.spacing.edgeNodeBetweenLayers":String(t?.edgeNode??32),...a}))({direction:d,spacing:s,extraOptions:c}),h={id:"root",layoutOptions:p,children:e.map(e=>({id:e.id,width:r,height:l,...u.has(e.id)?{layoutOptions:{"elk.layered.layering.layerConstraint":i,...o?{"elk.alignment":"CENTER"}:{}}}:{}})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},g=await Qa.layout(h),m=new Map;return g.children?.forEach(e=>{m.set(e.id,{x:e.x??0,y:e.y??0})}),{nodes:e.map(e=>({...e,position:m.get(e.id)??e.position})),edges:t}},tr="0;0.5;1",ar=p(({id:r,source:l,target:i,sourceX:o,sourceY:d,targetX:c,targetY:u,sourcePosition:p,targetPosition:h,markerEnd:g,style:m,data:v})=>{const f=n(),b=v?.mode??"fixed",y=l===i||Boolean(v?.isSelfLoop),[x]=Ja({sourceX:o,sourceY:d,targetX:c,targetY:u,sourcePosition:p,targetPosition:h,isSelfLoop:y,selfLoopNodeHeight:v?.selfLoopNodeHeight}),$=`${r}__graph-flow-motion`,k=Boolean(v?.isAttacker),C=v?.trackColor??("string"==typeof m?.stroke?m.stroke:k?f.v2.colors.red[500]:"path-length"===b?f.v2.colors.silver[400]:f.v2.colors.blue[700]),T=v?.ballColorSmall??(k?f.v2.colors.red[700]:"path-length"===b?f.v2.colors.silver[600]:f.v2.colors.blue[900]),M=v?.ballColorLarge??(k?f.v2.colors.red[400]:"path-length"===b?f.v2.colors.silver[200]:f.v2.colors.blue[500]),{travelDuration:L,ballCount:A}=s(()=>{if("fixed"===b)return{travelDuration:4,ballCount:5};const e=Math.hypot(c-o,u-d),t=((e,t)=>{if("undefined"==typeof document)return t;const a=document.createElementNS("http://www.w3.org/2000/svg","path");return a.setAttribute("d",e),a.getTotalLength()||t})(x,e);return{travelDuration:Math.max(1.2,t/100),ballCount:Math.min(10,Math.max(3,Math.round(t/72)))}},[b,x,o,d,c,u]),P=`${L.toFixed(3)}s`;return t(a,{children:[e(w,{id:r,path:x,markerEnd:g,style:{...m,stroke:C,strokeWidth:1}}),e(S,{children:t("svg",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"visible",pointerEvents:"none"},children:[e("path",{id:$,d:x,fill:"none",stroke:"none"}),Array.from({length:A}).map((a,r)=>{const l=`-${(L/A*r).toFixed(3)}s`;return t("circle",{r:0,fill:T,children:[e("animateMotion",{dur:P,begin:l,repeatCount:"indefinite",children:e("mpath",{href:`#${$}`})}),e("animate",{attributeName:"r",dur:P,begin:l,repeatCount:"indefinite",keyTimes:tr,values:"0;3.5;3.5"}),e("animate",{attributeName:"fill",dur:P,begin:l,repeatCount:"indefinite",keyTimes:tr,values:`${T};${M};${M}`})]},r)})]})})]})});ar.displayName=ar.name;const rr="graph-flow-animated";var lr,nr;(e=>{e.Service="blast-radius-service"})(lr||(lr={})),(e=>{e.Animated="blast-radius-animated"})(nr||(nr={}));const ir=(e,t)=>{const a=(e||"").trim();return a?`${a}/${t}`:t},or=e=>ir(e.namespace,e.service),sr="user",dr=(e,t,a)=>{const r=new Set(e),l=[...e];for(;l.length;){const e=l.shift();for(const n of a.get(e)??[])n===t||r.has(n)||(r.add(n),l.push(n))}return r},cr=(e,t,a)=>{const r=new Map;if(!e.length)return r;const l=[];for(let t=0;t<e.length;t+=6)l.push(e.slice(t,t+6));const n=-72*(l.length-1)/2;return l.forEach((e,l)=>{const i=n+72*l;e.forEach((e,l)=>{const n=t+a*(l+1)*160;r.set(e,{x:n,y:i})})}),r},ur=(e,t,a)=>{const r=t.map(e=>a.get(e)).filter(e=>!!e);if(!r.length)return{x:0,y:72};const l={x:r.reduce((e,t)=>e+t.x,0)/r.length,y:r.reduce((e,t)=>e+t.y,0)/r.length+72},n=new Set([...a.entries()].filter(([t])=>t!==e).map(([,e])=>`${e.x},${e.y}`));let i=l;for(;n.has(`${i.x},${i.y}`);)i={x:i.x,y:i.y+72};return i},pr={[lr.Service]:qa},hr={[nr.Animated]:ar,[rr]:ar},gr=({subgraph:t})=>{const a=n(),[r,l]=u([]),[i,o]=u([]),[d,c]=u(0),[p,g]=u(null),m=s(()=>{const e=t.nodes.map(e=>`${e.namespace||""}/${e.service}:${e.isVirtual?1:0}`).join("|"),a=t.edges.map(e=>`${e.clientNamespace||""}/${e.clientService}->${e.serverNamespace||""}/${e.serverService}`).join("|");return`${(e=>`${e.root.namespace||""}/${e.root.service}`)(t)}::${e}::${a}`},[t]);h(()=>{const e=((e,t)=>{const a=t.find(t=>t.service===sr&&t.id!==e);return a?.id??null})(or(t.root),t.nodes.map(e=>({id:or(e),service:e.service}))),r=((e,t)=>{const a=or(e.root);return e.nodes.map(e=>{const r=or(e);return{id:r,type:lr.Service,position:{x:0,y:0},data:{service:e.service,namespace:e.namespace||"",isVirtual:e.isVirtual,isRoot:r===a,isAttacker:r===t,isUser:e.service===sr},measured:{width:120,height:58}}})})(t,e),n=new Set(r.map(e=>e.id)),i=((e,t,a,r)=>{const l=t.v2.colors.silver[400],n=t.v2.colors.red[500],i=or(e.root);return e.edges.flatMap(e=>{const t=(e=>ir(e.clientNamespace,e.clientService))(e),o=(e=>ir(e.serverNamespace,e.serverService))(e);if(!a.has(t)||!a.has(o))return[];const s=!!r&&(t===r&&o===i||t===i&&o===r),d=s?n:l;return[{id:`${t}->${o}`,type:"smoothstep",source:t,target:o,data:{isAttacker:s},markerEnd:{type:T.ArrowClosed,color:d,width:16,height:16},style:{stroke:d,strokeWidth:1}}]})})(t,a,n,e),s=((e,t)=>{if(!e.length)return{nodes:e,edges:t};const a=(e.find(e=>e.data.isRoot)??e[0]).id,r=e.find(e=>e.data.isAttacker)?.id??null,l=new Map,n=new Map,i=new Map;for(const t of e)l.set(t.id,[]),n.set(t.id,[]),i.set(t.id,[]);for(const e of t)l.get(e.source)?.push(e.target),n.get(e.target)?.push(e.source),i.get(e.source)?.push(e.target),i.get(e.target)?.push(e.source);const o=dr((n.get(a)??[]).filter(e=>e!==r),a,i),s=dr((l.get(a)??[]).filter(e=>e!==r&&!o.has(e)),a,i);r&&(o.delete(r),s.delete(r));const d=((e,t)=>{const a=new Map([[e,0]]),r=[e];for(;r.length;){const e=r.shift(),l=(a.get(e)??0)+1;for(const n of t.get(e)??[])a.has(n)||(a.set(n,l),r.push(n))}return a})(a,i),c=[...o].sort((e,t)=>{const a=(d.get(t)??0)-(d.get(e)??0);return 0!==a?a:e.localeCompare(t)}),u=[...s].filter(e=>!o.has(e)).sort((e,t)=>{const a=(d.get(e)??0)-(d.get(t)??0);return 0!==a?a:e.localeCompare(t)});for(const t of e)t.id===a||t.id===r||o.has(t.id)||s.has(t.id)||c.push(t.id);const p=new Map([[a,{x:0,y:0}]]);for(const[e,t]of cr(c,0,-1))p.set(e,t);for(const[e,t]of cr(u,0,1))p.set(e,t);return r&&p.set(r,ur(r,i.get(r)??[],p)),{nodes:e.map(e=>({...e,position:p.get(e.id)??e.position})),edges:t}})(r,i);l(s.nodes),o(s.edges),g(null),c(e=>e+1)},[m,t,a]);const v=s(()=>p?i.map(e=>{if(e.source===p||e.target===p)return{...e,type:nr.Animated,data:{...e.data,mode:"path-length"}};const t={opacity:.3};return{...e,style:{...e.style,...t},labelStyle:{...e.labelStyle,...t},labelBgStyle:{...e.labelBgStyle,...t}}}):i,[i,p]);return e(Ya,{height:286,interactive:!0,nodeTypes:pr,edgeTypes:hr,nodes:r,edges:v,fitViewTrigger:d,fitViewPadding:.2,minZoom:.4,maxZoom:1.5,onNodeMouseEnter:(e,t)=>g(t.id),onNodeMouseLeave:()=>g(null)})},mr=({blastRadius:t})=>t?.nodes?.length?e(gr,{subgraph:t}):e(z,{children:e(_,{subTitle:"No blast-radius neighborhood for this service yet."})}),vr=({isOpen:t,onClose:a,onDeny:r,onApprove:l})=>e(H,{title:"Discard changes?",description:"You have unsaved changes.\nIf you cancel now, your changes won't be saved.",isOpen:t,onClose:a,denyButton:{label:"Keep editing",variant:D.Secondary,onClick:()=>{r?.(),a()}},approveButton:{label:"Discard changes",variant:D.Primary,onClick:()=>{l?.(),a()}}}),fr=({isOpen:t,onClose:a,onViewConnector:r})=>e(H,{isOpen:t,onClose:a,visual:()=>e(q,{scale:1.2,icon:qt}),title:j.CLOUD_CONNECTOR_CREATED_MODAL_TITLE,description:j.CLOUD_CONNECTOR_CREATED_MODAL_DESC,denyButton:{label:B.STAY_ON_CONNECTIONS,variant:D.Secondary,onClick:a},approveButton:{label:B.GO_TO_CONNECTOR_OVERVIEW,variant:D.Primary,onClick:r??a}}),br=({isOpen:t,onClose:a,onDeny:r,onApprove:l,action:n="delete",target:i,description:o,overrideApproveButtonLabel:s,overrideDenyButtonLabel:d})=>{const c=n.charAt(0).toUpperCase()+n.substring(1),u=i?.endsWith("s")?"these":"this";return e(H,{title:`${c}${i?` ${i}`:""}?`,description:o??`Are you sure you want to ${n}${i?` ${u} ${i}`:""}?`,isOpen:t,onClose:a,denyButton:{label:d??"Go back",variant:D.Secondary,onClick:()=>{r?.(),a()}},approveButton:{label:s??c,variant:D.Primary,onClick:()=>{l?.(),a()}}})},yr=({componentType:t,inputType:a,name:r,label:l,tooltip:n,badge:i,placeholder:o,required:s,disabled:d,value:c,setValue:u,errorMessage:p,warnMessage:h,helpMessage:g,dropdownOptions:m,dropdownNoSearch:v,dropdownNoCheckbox:f,timeUnits:b,timeDefaultUnit:y,toggleSize:x=W.L,keyLabel:$,valueLabel:k})=>{switch(t){case U.Input:return e(ae,{name:r,type:a,label:l,tooltip:n,badge:i,placeholder:o,required:s,disabled:d,value:c??"",onChange:e=>{const t=e.target.value;u(a===re.Number?""===t?null:Number(t):t)},errorMessage:p,warnMessage:h,helpMessage:g},r);case U.MultiInput:return e(te,{name:r,label:l,tooltip:n,badge:i,placeholder:o,required:s,disabled:d,values:Array.isArray(c)?c:ee(c,[]),setValues:e=>u(e),errorMessage:p,warnMessage:h,helpMessage:g,plain:!0},r);case U.KeyValuePair:return e(Q,{name:r,label:l,tooltip:n,badge:i,required:s,disabled:d,limitFieldsPerRow:2,columns:[{keyName:"key",label:$||"Key",placeholder:$||"Key"},{keyName:"value",label:k||"Value",placeholder:k||"Value"}],values:Array.isArray(c)?c:ee(c,[]),setValues:e=>u(e),errorMessage:p,warnMessage:h,helpMessage:g},r);case U.TextArea:return e(J,{name:r,label:l,tooltip:n,badge:i,required:s,disabled:d,placeholder:o,value:c??"",onChange:e=>u(e.target.value),errorMessage:p,warnMessage:h,helpMessage:g},r);case U.Dropdown:return e(Z,{name:r,label:l,tooltip:n,badge:i,placeholder:o,required:s,disabled:d,withSearch:!v,options:m?.map(e=>({id:e.id||"",label:e.label||"",withCheckbox:!f}))||[],values:c?[String(c)]:[],setValues:e=>u(e[0]),errorMessage:p,warnMessage:h,helpMessage:g},r);case U.Checkbox:return e(Y,{name:r,label:l,tooltip:n,badge:i,value:!0===c||"true"===c,onChange:e=>u(e),disabled:d,errorMessage:p,warnMessage:h,helpMessage:g},r);case U.Time:return e(K,{name:r,label:l,tooltip:n,badge:i,placeholder:o,required:s,disabled:d,value:c??"",setValue:e=>u(e),units:b,defaultUnit:y,errorMessage:p,warnMessage:h,helpMessage:g},r);case U.Toggle:return e(F,{name:r,size:x,labelAlign:G.Right,label:l,tooltip:n,badge:i,value:!0===c||"true"===c,onChange:e=>u(e),disabled:d,errorMessage:p,warnMessage:h,helpMessage:g},r);default:return null}},xr=r.div`
|
|
163
|
-
display: flex;
|
|
164
|
-
flex-wrap: wrap;
|
|
165
|
-
gap: 8px;
|
|
166
|
-
`,$r=r.div`
|
|
167
|
-
display: flex;
|
|
168
|
-
align-items: center;
|
|
169
|
-
gap: 8px;
|
|
170
|
-
padding: 8px 12px;
|
|
171
|
-
border-radius: 8px;
|
|
172
|
-
cursor: pointer;
|
|
173
|
-
background: ${({theme:e,$selected:t})=>t?e.v2.colors.silver[700]:e.v2.colors.silver[800]};
|
|
174
|
-
border: 1px solid ${({theme:e,$selected:t})=>t?e.v2.colors.silver[500]:e.v2.colors.silver[750]};
|
|
175
|
-
|
|
176
|
-
&:hover {
|
|
177
|
-
background: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
178
|
-
}
|
|
179
|
-
`,kr=r.div`
|
|
180
|
-
display: flex;
|
|
181
|
-
width: 32px;
|
|
182
|
-
height: 32px;
|
|
183
|
-
justify-content: center;
|
|
184
|
-
align-items: center;
|
|
185
|
-
flex-shrink: 0;
|
|
186
|
-
`,Cr=r.div`
|
|
187
|
-
display: flex;
|
|
188
|
-
flex-direction: column;
|
|
189
|
-
gap: 12px;
|
|
190
|
-
`,wr=r.div`
|
|
191
|
-
display: flex;
|
|
192
|
-
flex-wrap: wrap;
|
|
193
|
-
gap: 6px;
|
|
194
|
-
`,Sr=r.div`
|
|
195
|
-
display: flex;
|
|
196
|
-
align-items: center;
|
|
197
|
-
gap: 8px;
|
|
198
|
-
&::before,
|
|
199
|
-
&::after {
|
|
200
|
-
content: '';
|
|
201
|
-
flex: 1;
|
|
202
|
-
height: 1px;
|
|
203
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
204
|
-
}
|
|
205
|
-
`,Tr=r.div`
|
|
206
|
-
padding: 2px 10px;
|
|
207
|
-
border-radius: 999px;
|
|
208
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
209
|
-
border: 1px solid ${({theme:e})=>e.v2.colors.silver[600]};
|
|
210
|
-
`,Mr={[ge.JavaScript]:"Node.js",[ge.DotNet]:".NET",[ge.Php]:"PHP",[ge.Java]:"Java",[ge.Go]:"Go",[ge.Python]:"Python",[ge.Ruby]:"Ruby",[ge.Rust]:"Rust"},Lr=[ge.Python,ge.Java,ge.JavaScript,ge.DotNet,ge.Php,ge.Ruby,ge.Go],Ar=[{value:"all",label:"Entire Cluster"},{value:"source",label:"Specific Source"},{value:"namespace",label:"Specific Namespace"},{value:"language",label:"Specific Programming Language"}];function Pr(e){return Mr[e]||e.charAt(0).toUpperCase()+e.slice(1)}function Or(e){return null!=e?`${e}. ${we}`:we}const Er=({readOnly:t,...a})=>e(t?Rr:Dr,{...a}),Nr=({title:a,count:r,children:l})=>t(A,{$gap:6,children:[t(I,{$gap:8,$alignItems:"center",children:[e(O,{size:N.XS,color:E.Primary,nowrap:!0,children:a}),r>1&&e(O,{size:N.XXS,color:E.Secondary,nowrap:!0,children:`(${ke})`})]}),e(wr,{children:l})]}),Ir=()=>{const t=n();return e(Sr,{children:e(Tr,{children:e(O,{size:N.XXS,color:t.v2.colors.white[500],nowrap:!0,children:Ce})})})},Rr=({scopes:a,titleNumber:r,title:l,subTitle:n,icon:i,bgTint:s="900",entireClusterWarningMessage:d})=>{const c=l??Or(r),u={icon:i,title:c,subTitle:n,alignItems:n||i?"flex-start":void 0};if(ia(a))return e(le,{bgTint:s,richTitle:u,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(A,{$gap:8,children:[e(ne,{status:oe.Default,message:ie,fullWidth:!0}),d&&e(ne,{status:oe.Warning,message:d,fullWidth:!0,smallIcon:!0})]})});const p=a.sources??[],h=a.namespaces??[],g=a.languages??[],m=[];p.length&&m.push({kind:"sources",node:e(Nr,{title:se,count:p.length,children:p.map((t,a)=>{const r=[t.namespace,t.kind,t.name].filter(Boolean),l=r.length?r.join(" / "):ce;return e(de,{label:l},`src-${a}-${l}`)})})}),h.length&&m.push({kind:"namespaces",node:e(Nr,{title:ue,count:h.length,children:h.map((t,a)=>e(de,{label:t},`ns-${a}-${t}`))})}),g.length&&m.push({kind:"languages",node:e(Nr,{title:pe,count:g.length,children:g.map((t,a)=>{const r=me(t);return e(de,{label:Pr(t),leftIcon:r},`lang-${a}-${t}`)})})});const v=n??(m.length>1?he:void 0);return e(le,{bgTint:s,richTitle:{icon:i,title:c,subTitle:v,alignItems:v||i?"flex-start":void 0},withCollapse:!0,collapseIsDefaultOpen:!0,children:e(le,{bgTint:"800",children:e(Cr,{children:m.map((a,r)=>t(o.Fragment,{children:[r>0&&e(Ir,{}),a.node]},a.kind))})})})},Vr=(e,t="all")=>e.sources.length>0?"source":e.namespaces.length>0?"namespace":e.languages.length>0?"language":t,Dr=({scopes:r,onChange:l,sourceOptions:n=[],namespaceOptions:i=[],supportedLanguages:o,titleNumber:d,title:p,subTitle:g,icon:m,dataIdPrefix:v="source-scope",slim:f,disabled:b,hideLogicNote:y,hideEntireClusterNote:x,entireClusterWarningMessage:$,defaultScopeTab:k="all"})=>{const C=r??oa(),[w,S]=u(()=>Vr(C,k)),{sources:T,namespaces:M,languages:L}=C,P=T.length>0||M.length>0||L.length>0;h(()=>{P&&"all"===w&&S(Vr(C,k))},[k,P,w,C]);const I=s(()=>Ar.map(e=>"language"===e.value&&0===o?.length?null:{...e,disabled:"all"===e.value&&P}).filter(Boolean),[P]),R=s(()=>T.map(e=>`${e.namespace}/${e.kind}/${e.name}`),[T]),V=s(()=>[...M],[M]),D=s(()=>new Set(L),[L]),X=c(e=>{S(e)},[]),z=c(e=>{const t=e.map(e=>(e=>{const t=e.split("/");return 3!==t.length?null:{namespace:t[0],kind:t[1],name:t[2]}})(e)).filter(e=>null!=e).map(e=>({namespace:e.namespace,kind:e.kind,name:e.name}));l({...C,sources:t})},[C,l]),_=c(e=>{l({...C,namespaces:e})},[C,l]),H=c(e=>{const t=C.languages,a=t.includes(e)?t.filter(t=>t!==e):[...t,e];l({...C,languages:a})},[C,l]),B=!P&&"all"===w,j=(o||Lr).map(e=>({id:e,label:Mr[e]??e.charAt(0).toUpperCase()+e.slice(1),Icon:me(e)})),q=p??Or(d),U=g??fe;return e(ve,{richTitle:f?{icon:m,title:q,titleSize:N.XS,titleColor:E.Secondary,tooltip:U,alignItems:m?"flex-start":void 0}:{icon:m,title:q,subTitle:U,subTitleWrap:!0,alignItems:m||U?"flex-start":void 0},backgroundColor:f?"transparent":void 0,padding:f?0:void 0,children:t(A,{$gap:16,children:[B?t(a,{children:[!x&&e(ne,{status:oe.Default,message:ie,fullWidth:!0,smallIcon:!0}),$&&e(ne,{status:oe.Warning,message:$,fullWidth:!0,smallIcon:!0})]}):!y&&e(ne,{status:oe.Info,message:he,fullWidth:!0,smallIcon:!0}),e(A,{$alignItems:"flex-start",children:e(be,{options:I,selected:w,setSelected:X,disabled:b})}),"source"===w&&e(ye,{multiple:!0,"data-id":`${v}-autocomplete-source`,options:n,value:R,onSelect:z,placeholder:xe,disabled:b}),"namespace"===w&&e(ye,{multiple:!0,"data-id":`${v}-autocomplete-namespace`,options:i,value:V,onSelect:_,placeholder:"Search namespace",disabled:b}),"language"===w&&j.length>0&&e(xr,{children:j.map(({id:a,label:r,Icon:l})=>{const n=D.has(a);return t($r,{$selected:n,onClick:()=>H(a),children:[e(Y,{name:`${v}-lang-${a}`,size:$e.S,value:n,onChange:()=>H(a),disabled:b}),e(kr,{children:e(l,{size:20})}),e(O,{size:N.XS,nowrap:!0,children:r})]},a)})})]})})},Xr=e=>{if(null!=e){if(!Array.isArray(e)&&"object"==typeof e)return Object.entries(e).map(([e,t])=>({id:e,label:null==t?e:String(t)}));if(Array.isArray(e))return e.map(e=>"string"==typeof e?{id:e,label:e}:e)}},zr=e=>{if(!Array.isArray(e)||e.length<3)return;const[t,a,r]=e;return e=>{const l=null==e?.[t]?"":String(e[t]);switch(a){case"=":case"==":case"===":return l===r;case"!=":case"!==":return l!==r;default:return!0}}},_r=e=>{if(Array.isArray(e))return e.map(e=>{const t=e;return{keyName:String(t.keyName??t.name??""),label:t.label??t.displayName,tooltip:t.tooltip,placeholder:t.placeholder,helpMessage:t.helpMessage,componentType:t.componentType,options:Xr(t.options??t.values),fullRow:t.fullRow,defaultValue:t.defaultValue,withRegexTester:t.withRegexTester,separator:t.separator,copyByColumn:t.copyByColumn,renderCondition:zr(t.renderCondition)}})},Hr=e=>{if(Array.isArray(e))return e.map(e=>{if("string"==typeof e)return{id:e,label:e};const t=e;return{id:String(t.id??t.keyName??t.name??""),label:t.label??t.displayName??String(t.id??""),tooltip:t.tooltip,fields:Array.isArray(t.fields)?t.fields.map(Br):void 0}})},Br=e=>{const t="string"==typeof e.componentProperties?ee(e.componentProperties,{}):e.componentProps||{};return{name:e.name,componentType:e.componentType,inputType:e.inputType??t.inputType??t.type,title:e.displayName,tooltip:t.tooltip,placeholder:t.placeholder,helpMessage:t.helpMessage,required:t.required,initialValue:e.initialValue,renderCondition:e.renderCondition,options:Xr(t.options??t.values),itemWrapperKey:t.itemWrapperKey,columns:_r(t.columns),limitFieldsPerRow:t.limitFieldsPerRow,variant:t.variant,wrapKey:t.wrapKey,checkboxOptions:Hr(t.options??t.values),checkedValue:t.checkedValue??"true",valueMode:t.valueMode??"object",fields:Array.isArray(t.fields)?t.fields.map(Br):void 0,addLabel:t.addLabel,itemLabel:t.itemLabel,keyLabel:t.titleKey??t.keyLabel,valueLabel:t.titleValue??t.valueLabel,persistAs:t.persistAs}},jr=e=>{const t=e.initialValue;if(void 0!==t&&""!==t)return e.componentType===U.CheckboxList?"array"===e.valueMode?ee(t,[]):ee(t,{}):e.componentType!==U.MultiInput&&e.componentType!==U.MultiTabledInput||!e.wrapKey?e.componentType===U.MultiInput||e.componentType===U.MultiTabledInput?ee(t,[]):e.componentType===U.SourceScopes?"null"===t||"{}"===t?oa():da(ee(t,null)):e.componentType===U.Toggle||e.componentType===U.Checkbox?"true"===t:t:{[e.wrapKey]:ee(t,[])}},qr=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),Ur=e=>Array.isArray(e)?e:[],Fr=e=>{const t={};return e.forEach(e=>{t[String(e.key??"")]=String(e.value??"")}),t},Gr=e=>qr(e)?Object.entries(e).map(([e,t])=>({key:e,value:String(t??"")})):[],Wr=({field:t,value:a,setValue:r,errorMessage:l,disabled:n})=>{const[i,o]=u(()=>Gr(a));return h(()=>{const e=qr(a)?a:{};((e,t)=>{const a=Object.keys(e),r=Object.keys(t);return a.length===r.length&&a.every(a=>Object.prototype.hasOwnProperty.call(t,a)&&t[a]===e[a])})(Fr(i),e)||o(Gr(a))},[a]),e(Q,{name:t.name,label:t.title,tooltip:t.tooltip,helpMessage:t.helpMessage,required:t.required,disabled:n,limitFieldsPerRow:2,columns:[{keyName:"key",label:t.keyLabel||"Key",placeholder:t.keyLabel||"Key"},{keyName:"value",label:t.valueLabel||"Value",placeholder:t.valueLabel||"Value"}],values:i,setValues:e=>{o(e),r(Fr(e))},errorMessage:l})},Kr=({field:r,value:l,setValue:n,errorMessage:i,disabled:o,keyValuePersistAs:s,sourceOptions:d,namespaceOptions:c})=>{const{name:p,componentType:h,inputType:g,title:m,tooltip:v,placeholder:f,helpMessage:b,required:y,initialValue:x,options:$,itemWrapperKey:k,columns:C,limitFieldsPerRow:w,variant:S,wrapKey:T,checkboxOptions:M}=r,[L,I]=u({open:!1,value:""});if(h===U.SourceScopes)return e(Er,{scopes:da(l),onChange:e=>n(e),sourceOptions:d,namespaceOptions:c,dataIdPrefix:`dynamic-field-${p}`,slim:!0});if(h===U.CheckboxList&&"array"===r.valueMode){const a=Ur(l),r=(e,t)=>n(t?[...a.filter(t=>t!==e),e]:a.filter(t=>t!==e));return t(A,{$gap:12,children:[m&&e(P,{label:m,tooltip:v,required:y}),e(A,{$gap:8,children:(M||[]).map(t=>{const l=e(Y,{name:t.id,label:t.label,value:a.includes(t.id),disabled:o,onChange:e=>r(t.id,e)},t.id);return t.tooltip?e(Me,{text:t.tooltip,withIcon:!0,children:l},t.id):l})}),e(X,{errorMessage:i,helpMessage:b})]})}if(h===U.CheckboxList){const a=qr(l)?l:{},d=(e=>"emptyObject"!==e.checkedValue||{})(r),c=e=>"emptyObject"===r.checkedValue?qr(e):!!e;return t(A,{$gap:12,children:[m&&e(O,{size:N.XS,color:E.Secondary,nowrap:!0,children:m}),e(A,{$gap:12,children:(M||[]).map(r=>{const l=a[r.id],i=c(l),u=qr(l)?l:{},h=e(Y,{label:r.label,value:i,disabled:o,onChange:e=>n({...a,[r.id]:e?qr(l)?l:d:null})}),g=r.tooltip?e(Me,{text:r.tooltip,withIcon:!0,children:h}):h,m=i&&r.fields?.length?e(A,{$gap:12,$padding:"0 0 0 24px",children:r.fields.map(t=>e(Kr,{field:t,value:u[t.name],setValue:e=>n({...a,[r.id]:{...u,[t.name]:e}}),disabled:o,keyValuePersistAs:s},`${p}-${r.id}-${t.name}`))}):null;return t(A,{$gap:12,children:[g,m]},r.id)})}),e(X,{errorMessage:i,helpMessage:b})]})}if(h===U.MultiTabledInput){const r=Ur(T?l?.[T]:l),s=e=>n(T?{...qr(l)?l:{},[T]:e}:e),d=(C||[]).some(e=>e.withRegexTester);return t(a,{children:[e("cards"===S?Le:Q,{name:p,label:m,tooltip:v,helpMessage:b,required:y,disabled:o,columns:C||[],limitFieldsPerRow:w,values:r,setValues:s,errorMessage:i,onTestRegex:d?e=>I({open:!0,value:e}):void 0}),d&&e(Da,{isOpen:L.open,regex:L.value,onClose:()=>I({open:!1,value:""})})]})}if(h===U.MultiInput&&T){const t=Ur(l?.[T]);return e(te,{name:p,label:m,tooltip:v,helpMessage:b,required:y,disabled:o,placeholder:f,values:t,setValues:e=>n({...qr(l)?l:{},[T]:e}),errorMessage:i})}if(h===U.MultiInput&&k){const t=Ur(l).map(e=>String(e?.[k]??""));return e(te,{name:p,label:m,tooltip:v,helpMessage:b,required:y,disabled:o,placeholder:f,values:t,setValues:e=>n(e.map(e=>({[k]:e}))),errorMessage:i})}return h===U.KeyValuePair?"map"===(r.persistAs??s)?e(Wr,{field:r,value:l,setValue:n,errorMessage:i,disabled:o}):e(yr,{componentType:h,name:p,label:m,tooltip:v,helpMessage:b,disabled:o,required:y,errorMessage:i,keyLabel:r.keyLabel,valueLabel:r.valueLabel,value:l??[],setValue:n}):e(yr,{componentType:h,inputType:g,name:p,label:m,tooltip:v,helpMessage:b,disabled:o,required:y,placeholder:f,errorMessage:i,dropdownOptions:$,value:(null==l?x:l)??"",setValue:n})},Yr=({field:r,value:l,setValue:i,disabled:o,keyValuePersistAs:s,sourceOptions:d,namespaceOptions:c})=>{const u=n(),p=Ur(l),h=p.length?p:[{}],m=r.fields||[],v=e=>i(e);return t(a,{children:[h.map((a,l)=>t(g,{children:[e(Te,{}),t(A,{$gap:12,children:[t(I,{$justifyContent:"space-between",$alignItems:"center",children:[e(P,{label:`${r.itemLabel||r.title||"Item"} ${l+1}`}),e(R,{leftIcon:()=>e(Ut,{fill:u.v2.colors.red[500]}),variant:D.Secondary,size:V.S,onClick:()=>(e=>{const t=h.filter((t,a)=>a!==e);v(t)})(l),disabled:o||1===h.length})]}),m.map(t=>e(Kr,{field:t,value:a[t.name],setValue:e=>((e,t,a)=>v(h.map((r,l)=>l===e?{...r,[t]:a}:r)))(l,t.name,e),disabled:o,keyValuePersistAs:s,sourceOptions:d,namespaceOptions:c},`${r.name}-group-${l}-${t.name}`))]})]},`${r.name}-group-${l}`)),e(R,{variant:D.Secondary,label:r.addLabel||"Add",leftIcon:Ft,onClick:()=>v([...h,{}]),disabled:o}),e(Te,{})]})},Zr=({field:a,value:r,setValue:l,errorMessage:n,disabled:i})=>t(A,{$gap:12,children:[a.title&&e(P,{label:a.title,tooltip:a.tooltip,required:a.required}),e(A,{$gap:8,children:(a.checkboxOptions||[]).map(t=>{const a=e(Y,{name:t.id,label:t.label,value:!0===r?.[t.id],disabled:i,onChange:e=>l(t.id,e)},t.id);return t.tooltip?e(Me,{text:t.tooltip,withIcon:!0,children:a},t.id):a})}),e(X,{errorMessage:n,helpMessage:a.helpMessage})]}),Jr=({signals:t,fields:r,value:l,setValue:n,formErrors:i,disabled:o,seedInitialValues:s,keyValuePersistAs:d="map",sourceOptions:c,namespaceOptions:u})=>{const{isK8s:p}=sa(),g=(r||[]).filter(e=>!!e).map(e=>Br(e));return h(()=>{if(!s)return;const e=l||{},t={};g.forEach(a=>{if(a.componentType===U.SourceScopes&&!p)return;const r=a.componentType===U.SourceScopes?jr(a)??oa():jr(a);if(void 0===r)return;if(a.componentType===U.CheckboxList&&"flatFields"===a.valueMode&&qr(r))return void Object.entries(r).forEach(([a,r])=>{void 0!==e[a]&&null!==e[a]||(t[a]=r)});const l=e[a.name];if(a.componentType===U.SourceScopes){if(void 0!==l)return}else if(null!=l)return;t[a.name]=qr(r)&&qr(t[a.name])?{...t[a.name],...r}:r}),Object.entries(t).forEach(([e,t])=>n(e,t))},[]),e(a,{children:g.map((a,r)=>{const s=Object.entries(l||{}).map(([e,t])=>({name:e,key:e,value:t}));if(a.renderCondition&&!Se(a.renderCondition,t,s))return null;if(a.componentType===U.SourceScopes&&!p)return null;const h=l?.[a.name],g=`${a.name}-${r}`;if(a.componentType===U.FieldGroup)return e(Yr,{field:a,value:h,setValue:e=>n(a.name,e),disabled:o,keyValuePersistAs:d,sourceOptions:c,namespaceOptions:u},g);if(a.componentType===U.CheckboxList&&"flatFields"===a.valueMode){const t=a.checkboxOptions?.map(e=>i[e.id]).find(Boolean);return e(Zr,{field:a,value:l||{},setValue:n,errorMessage:t,disabled:o},g)}return e(Kr,{field:a,value:h,setValue:e=>n(a.name,e),errorMessage:i[a.name],disabled:o,keyValuePersistAs:d,sourceOptions:c,namespaceOptions:u},g)})})},Qr=Jr,el=({isEnabled:t,setIsEnabled:a,fieldDisabled:r})=>{const l=n();return e(be,{options:[{icon:Gt,label:"Enable",value:!0,selectedBgColor:l.v2.colors.green[1e3],selectedBorderColor:l.v2.colors.green[400],selectedTextColor:l.v2.colors.green[400]},{icon:Wt,label:"Disable",value:!1,selectedBgColor:l.v2.colors.red[1e3],selectedBorderColor:l.v2.colors.red[500],selectedTextColor:l.v2.colors.red[400]}],size:Ae.S,selected:t,setSelected:a,disabled:r})},tl=r.div`
|
|
211
|
-
display: flex;
|
|
212
|
-
align-items: center;
|
|
213
|
-
gap: 24px;
|
|
214
|
-
padding: 8px 16px;
|
|
215
|
-
border-radius: 12px;
|
|
216
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
217
|
-
`,al=r.div`
|
|
218
|
-
flex: 1;
|
|
219
|
-
min-width: 0;
|
|
220
|
-
white-space: pre;
|
|
221
|
-
overflow-x: auto;
|
|
222
|
-
`,rl=({title:a,summary:r,onEdit:l,renderAction:n})=>{const i=s(()=>{const e=[];return a&&(e.push({text:a,variant:ca.Default}),e.push({text:" - ",variant:ca.Default})),e.push(...r),e},[a,r]);return t(tl,{children:[e(al,{children:e(ua,{parts:i})}),n&&n(),l&&e(R,{"data-id":"sampling-btn-edit-auto-rule",label:Pe,rightIcon:Kt,variant:D.Text,size:V.S,onClick:l})]})},ll={[Xe.HttpRequest]:"HTTP request",[Xe.HttpResponse]:"HTTP response",[Xe.DbQuery]:"DB query",[Xe.Messaging]:"messaging"};function nl(e,t,a){return 1===e?t:a??`${t}s`}function il(e,t){const a=[],r=e.slice(0,3),l=e.slice(3);return r.forEach((e,r)=>{r>0&&a.push({text:", ",variant:ca.Default}),a.push({text:e,variant:t})}),l.length>0&&a.push({text:` + ${l.length} more`,variant:ca.Default,tooltipItems:l}),a}const ol=({option:t,formState:a,renderAction:r})=>{const l=s(()=>{const e=function(e,t){switch(e){case Ee.CodeAttributes:return(e=>{const t=Object.values(ze).filter(t=>!!e.codeAttributes?.[t]).map(e=>_e(e).toLowerCase());return t.length?[{text:"Collect",variant:ca.Action},{text:" ",variant:ca.Default},...il(t,ca.Endpoint)]:null})(t);case Ee.PayloadCollection:return(e=>{const t=Object.values(Xe).filter(t=>null!=e.payloadCollection?.[t]).map(e=>ll[e]);return t.length?[{text:"Collect",variant:ca.Action},{text:" ",variant:ca.Default},...il(t,ca.Endpoint)]:null})(t);case Ee.HeadersCollection:return(e=>{const t=(e.headersCollection?.[De.HeaderKeys]??[]).map(e=>e.trim()).filter(e=>e.length>0);if(!t.length)return null;const a=nl(t.length,"HTTP header");return[{text:`Collect ${t.length} ${a}`,variant:ca.Action},{text:"",variant:ca.Default,tooltipItems:t}]})(t);case Ee.CustomInstrumentation:return(e=>{const t=(e.customInstrumentations?.[Ne.Java]??[]).map(e=>new Ie(e.className,e.methodName)).filter(e=>e.Verify()),a=(e.customInstrumentations?.[Ne.Golang]??[]).map(e=>new Re(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)).filter(e=>e.Verify()),r=(e.customInstrumentations?.[Ne.Php]??[]).map(e=>new Ve(e.className,e.functionName)).filter(e=>e.Verify());if(!(t.length+a.length+r.length))return null;const l=[];t.length&&l.push(`${t.length} Java ${nl(t.length,"probe")}`),a.length&&l.push(`${a.length} Go ${nl(a.length,"probe")}`),r.length&&l.push(`${r.length} PHP ${nl(r.length,"probe")}`);const n=[...t.map(e=>`Java: ${e.toString()}`),...a.map(e=>`Go: ${e.toString()}`),...r.map(e=>`PHP: ${e.toString()}`)];return[{text:`Apply ${l.join(" + ")}`,variant:ca.Action},{text:"",variant:ca.Default,tooltipItems:n}]})(t);case Ee.NetworkMetrics:return[{text:"Collect",variant:ca.Action},{text:" ",variant:ca.Default},{text:"network flow and TCP stats metrics",variant:ca.Endpoint}];default:return null}}(t?.type,a);return e?[...e,...pa(a.sourceScopes)]:[]},[t?.type,a]),n=0===l.length;return e(rl,{title:n?Oe:"Instrumentation Rule Preview",summary:l,renderAction:r})},sl=({size:t=200,central:a=!1,useInline:r=!1})=>{const{tier:l}=sa();if(r){if(a)return e(Yt,{size:t});switch(l){case He.Community:return e(Jt,{size:t});case He.Onprem:return e(Zt,{size:t});default:return null}}if(a)return e(Qt,{size:t});switch(l){case He.Community:return e(ta,{size:t});case He.Onprem:return e(ea,{size:t});default:return null}},dl=[{value:"50",label:"50%"},{value:"25",label:"25%"},{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"custom",label:"Custom"}],cl=[{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"0.5",label:"0.5%"},{value:"0.1",label:"0.1%"},{value:"custom",label:"Custom"}],ul=[{value:"5000",label:"5s"},{value:"1000",label:"1s"},{value:"500",label:"500ms"},{value:"100",label:"100ms"},{value:"50",label:"50ms"},{value:"custom",label:"Custom"}],pl=({description:a,options:r,selected:l,onSelect:n,customName:i,customLabel:o,customPlaceholder:s,customValue:d,onCustomChange:c,customInputType:u=re.Number,customMin:p,customMax:h})=>t(A,{$gap:6,children:[e(P,{label:a}),t(I,{$gap:8,$alignItems:"flex-end",children:[e(be,{options:r,selected:l,setSelected:n}),"custom"===l&&e(ae,{name:i,label:o,placeholder:s,type:u,value:d,onChange:c,width:160,min:p,max:h})]})]}),hl=()=>{},gl=t=>t.readOnly?e(ml,{rule:t.rule}):e(vl,{ruleType:t.ruleType,formState:t.formState,onChange:t.onChange}),ml=({rule:a})=>{const r=null!=a.durationAtLeastMs;return a.error?e(ve,{richTitle:{title:Be},children:e(F,{name:"sampling-view-toggle-keep-errors",onChange:hl,value:!0,size:W.S,label:je,labelAlign:G.Right})}):r?e(ve,{richTitle:{title:qe},children:t("div",{children:[e(O,{size:N.XXXS,color:E.Secondary,children:Ue}),e(O,{size:N.XS,children:`${a.durationAtLeastMs}ms`})]})}):null},vl=({ruleType:t,formState:a,onChange:r})=>{const l=c(e=>r({durationPreset:e}),[r]),n=c(e=>r({customDurationMs:e.target.value}),[r]);return"Duration"===t?e(ve,{richTitle:{title:qe,subTitle:Fe},children:e(pl,{description:Ue,options:ul,selected:a.durationPreset,onSelect:l,customName:"sampling-input-custom-duration",customLabel:Ge,customPlaceholder:"200ms",customValue:a.customDurationMs,onCustomChange:n})}):null},fl=r.div`
|
|
223
|
-
display: flex;
|
|
224
|
-
gap: 32px;
|
|
225
|
-
`,bl=r.div`
|
|
226
|
-
display: flex;
|
|
227
|
-
flex-direction: column;
|
|
228
|
-
gap: 4px;
|
|
229
|
-
`,yl=r.div`
|
|
230
|
-
display: flex;
|
|
231
|
-
flex-wrap: wrap;
|
|
232
|
-
align-items: flex-end;
|
|
233
|
-
gap: 16px;
|
|
234
|
-
`,xl=r.div`
|
|
235
|
-
display: flex;
|
|
236
|
-
align-items: flex-end;
|
|
237
|
-
gap: 16px;
|
|
238
|
-
padding: 12px 16px;
|
|
239
|
-
border-radius: 8px;
|
|
240
|
-
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
241
|
-
`,$l=r.div`
|
|
242
|
-
display: flex;
|
|
243
|
-
align-items: flex-end;
|
|
244
|
-
gap: 10px;
|
|
245
|
-
flex: 1;
|
|
246
|
-
`,kl=r.div`
|
|
247
|
-
display: flex;
|
|
248
|
-
align-items: center;
|
|
249
|
-
height: 32px;
|
|
250
|
-
`,Cl=r.div`
|
|
251
|
-
display: flex;
|
|
252
|
-
align-items: flex-end;
|
|
253
|
-
gap: 16px;
|
|
254
|
-
margin-bottom: 12px;
|
|
255
|
-
`,wl="Any",Sl="Kafka topic",Tl=()=>e("div",{style:{marginBottom:"8px"},children:e(O,{size:N.XS,weight:500,children:"And"})}),Ml=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"httpClient",label:"HTTP Client"}],Ll=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"kafkaConsumer",label:"Kafka Consumer"},{value:"kafkaProducer",label:"Kafka Producer"}],Al=[{id:"",label:wl},{id:"GET",label:"GET"},{id:"POST",label:"POST"},{id:"PUT",label:"PUT"},{id:"DELETE",label:"DELETE"},{id:"PATCH",label:"PATCH"}],Pl=t=>t.readOnly?e(Ol,{data:t.data}):e(El,{category:t.category,formState:t.formState,onChange:t.onChange}),Ol=({data:a})=>{const r=s(()=>(e=>{if("noisy"===e.category){const t=e.rule.operation;if(t?.httpServer)return[{id:"type",title:st,value:ot},{id:"route",title:tt,value:t.httpServer.route||t.httpServer.routePrefix||dt},{id:"method",title:nt,value:t.httpServer.method||wl}];if(t?.httpClient){const e=[{id:"type",title:st,value:ct}];return t.httpClient.serverAddress&&e.push({id:"serverAddress",title:"Server address",value:t.httpClient.serverAddress}),e.push({id:"route",title:tt,value:t.httpClient.templatedPath||t.httpClient.templatedPathPrefix||dt}),e.push({id:"method",title:nt,value:t.httpClient.method||wl}),e}return[{id:"type",title:st,value:ut}]}const t=e.rule.operation;return t?.httpServer?[{id:"type",title:st,value:ot},{id:"route",title:tt,value:t.httpServer.route||t.httpServer.routePrefix||dt},{id:"method",title:nt,value:t.httpServer.method||wl}]:t?.kafkaConsumer?[{id:"type",title:st,value:pt},{id:"topic",title:Sl,value:t.kafkaConsumer.kafkaTopic||dt}]:t?.kafkaProducer?[{id:"type",title:st,value:ht},{id:"topic",title:Sl,value:t.kafkaProducer.kafkaTopic||dt}]:[{id:"type",title:st,value:ut}]})(a),[a]);return e(ve,{richTitle:{title:We},children:e(fl,{children:r.map(({id:a,title:r,value:l})=>t(bl,{children:[e(O,{size:N.XXXS,color:E.Secondary,nowrap:!0,children:r}),e(O,{size:N.XS,nowrap:!0,children:l})]},a))})})},El=({category:a,formState:r,onChange:l})=>{const n=s(()=>"noisy"===a?Ml:Ll,[a]),i=c(e=>l({operationType:e,route:"",serverAddress:"",method:"",kafkaTopic:""}),[l]),o=c(e=>t=>{t&&l({routeType:e,route:""})},[l]),d=c(e=>l({route:e.target.value}),[l]),u=c(e=>l({serverAddress:e.target.value}),[l]),p=c(e=>l({method:e[0]||""}),[l]),h=c(e=>l({kafkaTopic:e.target.value}),[l]),g="httpServer"===r.operationType||"httpClient"===r.operationType,m="kafkaConsumer"===r.operationType||"kafkaProducer"===r.operationType,v="httpClient"===r.operationType?et:tt,f="httpClient"===r.operationType?at:rt;return t(ve,{richTitle:{title:`2. ${We}`,subTitle:Ke},children:[e(A,{$alignItems:"flex-start",children:e(be,{options:n,selected:r.operationType,setSelected:i})}),g&&t(yl,{children:["httpClient"===r.operationType&&t(Cl,{children:[e(ae,{name:"sampling-input-server-address",label:Ze,placeholder:Ye,value:r.serverAddress,onChange:u}),e(Tl,{})]}),t(xl,{children:[t($l,{children:[e(kl,{children:e(Je,{"data-id":"sampling-radio-route",value:"route"===r.routeType,onChange:o("route")})}),e(ae,{name:"sampling-input-route",label:v,placeholder:Qe,value:"route"===r.routeType?r.route:"",onChange:d,disabled:"route"!==r.routeType})]}),t($l,{children:[e(kl,{children:e(Je,{"data-id":"sampling-radio-route-prefix",value:"routePrefix"===r.routeType,onChange:o("routePrefix")})}),e(ae,{name:"sampling-input-route-prefix",label:f,placeholder:Qe,value:"routePrefix"===r.routeType?r.route:"",onChange:d,disabled:"routePrefix"!==r.routeType})]})]}),t(Cl,{children:[e(Tl,{}),e(lt,{label:nt,items:Al,selectedIds:[r.method||""],setSelectedIds:e=>p(e),buttonProps:{"data-id":"sampling-btn-method",label:Al.find(e=>e.id===r.method)?.label||wl,size:V.S,variant:D.Secondary}})]})]}),m&&e(ae,{name:"sampling-input-kafka-topic",label:it,placeholder:"Type kafka topic",value:r.kafkaTopic,onChange:h,width:"320px"})]})},Nl=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Il=[{value:"all",label:"Keep All"},{value:"sample",label:"Sample"}],Rl=t=>t.readOnly?e(Vl,{data:t.data}):e(Dl,{category:t.category,formState:t.formState,onChange:t.onChange}),Vl=({data:a})=>{const r=s(()=>(e=>{switch(e.category){case"highlyRelevant":return null!=e.rule.percentageAtLeast?{title:mt,method:bt,description:vt,value:`${e.rule.percentageAtLeast}%`}:{title:mt,method:xt,description:null,value:null};case"noisy":return ha(e.rule.percentageAtMost)?{title:mt,method:yt,description:null,value:null}:{title:mt,method:bt,description:ft,value:`${e.rule.percentageAtMost}%`};case"costReduction":return{title:mt,method:bt,description:ft,value:`${e.rule.percentageAtMost}%`}}})(a),[a]),l=[{id:"method",title:nt,value:r.method},...null!=r.description?[{id:"value",title:r.description,value:r.value}]:[]];return e(ve,{richTitle:{title:r.title},children:e(fl,{children:l.map(({id:a,title:r,value:l})=>t(bl,{children:[e(O,{size:N.XXXS,color:E.Secondary,nowrap:!0,children:r}),e(O,{size:N.XS,nowrap:!0,children:l})]},a))})})},Dl=({category:a,formState:r,onChange:l})=>{const n="highlyRelevant"===a,i=n?Il:Nl,o=`${n?4:3}. ${mt}`,s=gt[a],d=n?vt:ft,u="noisy"===a?cl:dl,p=c(e=>l({percentageMode:e}),[l]),h=c(e=>l({percentagePreset:e}),[l]),g=c(e=>l({customPercentage:e.target.value}),[l]);return t(ve,{richTitle:{title:o,subTitle:s},children:["costReduction"!==a&&e(A,{$alignItems:"flex-start",children:e(be,{options:i,selected:r.percentageMode,setSelected:p})}),("costReduction"===a||"sample"===r.percentageMode)&&e(pl,{description:d,options:u,selected:r.percentagePreset,onSelect:h,customName:"sampling-input-custom-percentage",customPlaceholder:"5%",customValue:r.customPercentage,onCustomChange:g,customInputType:re.Decimal,customMin:0,customMax:100})]})},Xl=r.div`
|
|
256
|
-
display: flex;
|
|
257
|
-
align-items: flex-end;
|
|
258
|
-
gap: 16px;
|
|
259
|
-
`,zl=r.div`
|
|
260
|
-
width: 280px;
|
|
261
|
-
flex-shrink: 0;
|
|
262
|
-
`,_l=r.div`
|
|
263
|
-
flex: 1;
|
|
264
|
-
min-width: 0;
|
|
265
|
-
`;function Hl(e){return"highlyRelevant"===e.category?e.rule.error?"Error":null!=e.rule.durationAtLeastMs?"Duration":"Relevance":Lt[e.category]}const Bl=t=>t.readOnly?e(jl,{data:t.data}):e(ql,{formState:t.formState,onChange:t.onChange}),jl=({data:a})=>{const r=s(()=>[{id:"name",title:kt,value:a.rule.name||$t},{id:"type",title:Ct,value:Hl(a)}],[a]),l=a.rule.notes||dt;return t(ve,{children:[e(fl,{children:r.map(({id:a,title:r,value:l})=>t(bl,{children:[e(O,{size:N.XXXS,color:E.Secondary,nowrap:!0,children:r}),e(O,{size:N.XS,nowrap:!0,children:l})]},a))}),t(bl,{children:[e(O,{size:N.XXXS,color:E.Secondary,children:wt}),e(O,{size:N.XS,children:l})]})]})},ql=({formState:a,onChange:r})=>{const l=c(e=>r({name:e.target.value}),[r]),n=c(e=>r({notes:e.target.value}),[r]);return e(ve,{children:t(Xl,{children:[e(zl,{children:e(ae,{name:"sampling-input-rule-name",label:kt,tooltip:"Optional. Give this rule a name for easier identification.",placeholder:St,value:a.name,onChange:l})}),e(_l,{children:e(ae,{name:"sampling-input-note",label:wt,tooltip:Mt,placeholder:Tt,value:a.notes,onChange:n})})]})})},Ul=[{value:"Relevance",label:"Relevance"},{value:"Error",label:"Error"},{value:"Duration",label:"Duration"}],Fl=({formState:t,onChange:a})=>{const r=c(e=>a({ruleType:e,keepErrors:"Error"===e}),[a]);return e(ve,{richTitle:{title:`3. ${Ct}`,subTitle:At},children:e(A,{$alignItems:"flex-start",children:e(be,{options:Ul,selected:t.ruleType,setSelected:r})})})},Gl=t=>{const a=s(()=>{if(t.readOnly)return t.summary;switch(t.category){case"noisy":return va(ya(t.formState));case"highlyRelevant":return ma(ba(t.formState));case"costReduction":return ga(fa(t.formState))}},[t]);if(t.readOnly)return e(rl,{title:Pt,summary:a,renderAction:t.renderAction});const r=1===a.length&&"default"===a[0].variant;return e(rl,{title:r?Oe:Pt,summary:r?[]:a,renderAction:t.renderAction})},Wl=(e,t)=>!t?.length||!!t?.find(t=>t===e),Kl=({title:a="Signals",required:r,errorMessage:l,allowedSignals:n,selectedSignals:i,setSelectedSignals:o,disabled:s})=>{const[c,p]=u(1===i.length),g=d(JSON.stringify(i));return h(()=>{let e=Ot(i).filter(e=>Wl(e,n));e.length||(e=Et.filter(({id:e})=>Wl(e,n)).map(({id:e})=>e));const t=JSON.stringify(e);g.current!==t&&(g.current=t,o(e),p(1===e.length))},[n,i]),t(A,{$gap:12,children:[e(P,{label:a,required:r}),e(I,{$gap:12,children:Et.map(t=>{const a=Wl(t.id,n),r=((e,t)=>!!t?.find(t=>t===e))(t.id,i);return a?e(Y,{label:t.value,disabled:s||!a||c&&r,value:r,onChange:e=>((e,t)=>{const a=e,r=t?[...i,a]:i.filter(e=>e!==a);o(r),p(1===r.length)})(t.id,e)},t.id):null})}),e(X,{errorMessage:l})]})},Yl=({minSupportedVersion:t,currentVersion:a})=>e(H,{isOpen:!0,onClose:()=>{},relativeToParent:!0,visual:()=>e(q,{scale:2.4,icon:()=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"21",viewBox:"0 0 22 21",fill:"none",children:e("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:j.UPGRADE_REQUIRED,description:`${j.UPGRADE_TO_USE_FEATURE(t)}\n${j.CURRENT_VERSION(a)}`}),Zl=r.div`
|
|
266
|
-
display: flex;
|
|
267
|
-
flex-direction: column;
|
|
268
|
-
justify-content: flex-end;
|
|
269
|
-
width: ${({$width:e})=>e};
|
|
270
|
-
gap: ${({$columnHasHeader:e})=>e?"0":"12px"};
|
|
271
|
-
`,Jl=r.div`
|
|
272
|
-
display: flex;
|
|
273
|
-
align-items: center;
|
|
274
|
-
min-height: 24px;
|
|
275
|
-
padding: 12px;
|
|
276
|
-
border-radius: 16px 16px 0 0;
|
|
277
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
278
|
-
`,Ql=r.div`
|
|
279
|
-
display: flex;
|
|
280
|
-
flex-direction: column;
|
|
281
|
-
gap: ${({$gap:e})=>e}px;
|
|
282
|
-
padding: 12px 12px 0 12px;
|
|
283
|
-
width: 100%;
|
|
284
|
-
height: ${({$heightOffset:e,$columnHasHeader:t})=>`calc(100vh - 180px - ${e}px ${t?"- 48px":""})`};
|
|
285
|
-
border-radius: ${({$columnHasHeader:e,$isLeft:t,$isRight:a})=>e?t?"0 0 0 16px":a?"0 16px 0 0":"0":t?"16px 0 0 16px":a?"0 16px 16px 0":"16px"};
|
|
286
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
287
|
-
overflow-y: auto;
|
|
288
|
-
overflow-x: hidden;
|
|
289
|
-
`,en=({isLeft:r,isRight:l,heightOffset:n=0,width:i,header:o,list:s})=>t(Zl,{$width:i,$columnHasHeader:!!o,children:[o&&e(Jl,{children:o}),e(Ql,{$gap:8,$isLeft:r,$isRight:l,$heightOffset:n,$columnHasHeader:!!o,children:s.length?s.length>1?e(Nt,{gap:8,elements:s}):e(a,{children:s[0]}):e(z,{$height:"100%",children:e(_,{})})})]}),tn="75vw",an=r.div`
|
|
290
|
-
display: flex;
|
|
291
|
-
flex-direction: column;
|
|
292
|
-
border-radius: 16px;
|
|
293
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
294
|
-
overflow: hidden;
|
|
295
|
-
`,rn=r.div`
|
|
296
|
-
display: flex;
|
|
297
|
-
gap: 12px;
|
|
298
|
-
padding: 16px 16px 0 16px;
|
|
299
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
300
|
-
position: sticky;
|
|
301
|
-
top: 0;
|
|
302
|
-
`,ln=r.div`
|
|
303
|
-
padding: 12px 12px 0 12px;
|
|
304
|
-
`,nn=r.div`
|
|
305
|
-
display: flex;
|
|
306
|
-
gap: 12px;
|
|
307
|
-
padding: 16px;
|
|
308
|
-
`,on=r.div`
|
|
309
|
-
padding: 5vh 10vw;
|
|
310
|
-
border-radius: 12px;
|
|
311
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
312
|
-
`,sn=m(({isOpen:a,withOverlay:r,disableAnimation:l,onClose:n,onBack:i,onNext:o,nextIsSkip:d,onSave:p,disableSave:h,connectionIds:g,header:m,subHeader:f,leftColumn:b,rightColumn:y,search:x,filters:$,errorMessage:k,isFormDirty:C,allowSaveWhenPristine:w,hideDirtyNote:S,forcedNote:T,isFetching:L,progress:A},P)=>{const[O,E]=u(!1),[I,R]=u(!1),[V,X]=u(void 0);v(P,()=>({clearErrors:()=>X(void 0)}));const _=I,B=c(()=>{C&&!O?E(!0):(E(!1),n?.())},[C,O,n]),j=h||I||!w&&"boolean"==typeof C&&!C,q=c(async()=>{R(!0);const e=await p();R(!1),!1!==e&&(e?.error?X(e.error):(g?.setValue([]),n?.()))},[p,g,n]),U=!!x||!!g||!!$,F=!!f,G=(U?48:0)+(F?50:0),W=s(()=>T||(L?{status:oe.Info,message:"Fetching Data..."}:I&&!A?{status:oe.Info,message:"Saving Changes..."}:V||k?{status:oe.Error,message:V||k}:"boolean"!=typeof C||S?void 0:C?{status:oe.Info,message:'The values don\'t reflect the current configurations of the selected clusters.\n"Save" will override the current configurations.'}:{status:oe.Success,message:"The values reflect the current configuration of the selected cluster."}),[L,I,A,V,k,C,S,T]),K=s(()=>i?{label:"Back",leftIcon:aa,variant:D.Secondary,onClick:i}:{label:"Cancel",variant:D.Secondary,onClick:B,disabled:_},[i,B,_]),[Y,Z]=u(!1),J=s(()=>o?d?{"data-id":"wide-drawer-skip",label:"Skip",rightIcon:ra,variant:D.Secondary,onClick:()=>Z(!0)}:{"data-id":"wide-drawer-next",label:"Next",rightIcon:ra,variant:D.Primary,onClick:o}:{"data-id":"wide-drawer-save",label:"Save",variant:D.Primary,onClick:q,disabled:j},[o,d,q,j]);return t(M,{width:tn,isOpen:a,disableAnimation:l,hideOverlay:!I&&!r,header:{...m,onClose:n?B:void 0,onCloseDisabled:_},footer:{note:W,actions:[K,J]},children:[I?e(z,{$height:"calc(100vh - 136px)",children:e(on,{children:e(It,{titleSize:N.S,subTitleSize:N.XXXS,withGradient:!0,withSpinner:!0,...A})})}):t(an,{children:[U&&t(rn,{children:[g&&e(Rt,{icon:Gt,title:"Selected Clusters",badge:{label:g.value.length}}),x&&e(Vt,{...x,width:x.width??"100%"}),$]}),F&&e(ln,{children:e(Rt,{icon:f.icon,title:f.title,subTitle:f.description,badge:f.badge})}),t(nn,{children:[e(en,{isLeft:!0,heightOffset:G,...b}),e(en,{isRight:!0,heightOffset:G,...y})]})]}),e(vr,{isOpen:O,onClose:()=>E(!1),onApprove:B}),e(H,{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:Y,onClose:()=>Z(!1),denyButton:{label:"Go Back",variant:D.Secondary,onClick:()=>Z(!1)},approveButton:{label:"Skip",variant:D.Primary,onClick:()=>{o?.(),Z(!1)}}})]})});sn.displayName=sn.name;const dn=r.div`
|
|
313
|
-
padding: 0 24px;
|
|
314
|
-
border-radius: 12px;
|
|
315
|
-
background-color: ${({$codeBgColor:e})=>e||"transparent"};
|
|
316
|
-
`,cn=r.div`
|
|
317
|
-
display: flex;
|
|
318
|
-
flex-direction: column;
|
|
319
|
-
gap: 8px;
|
|
320
|
-
width: 100%;
|
|
321
|
-
padding: 8px;
|
|
322
|
-
border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
323
|
-
border-radius: 12px;
|
|
324
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
325
|
-
`,un=r.div`
|
|
326
|
-
display: flex;
|
|
327
|
-
align-items: center;
|
|
328
|
-
gap: 4px;
|
|
329
|
-
width: 100%;
|
|
330
|
-
`,pn=r.div`
|
|
331
|
-
flex: 1;
|
|
332
|
-
min-width: 0;
|
|
333
|
-
`,hn=r.div`
|
|
334
|
-
width: 100%;
|
|
335
|
-
max-height: 180px;
|
|
336
|
-
overflow: auto;
|
|
337
|
-
padding: 0 12px;
|
|
338
|
-
|
|
339
|
-
pre {
|
|
340
|
-
margin: 0;
|
|
341
|
-
}
|
|
342
|
-
`,gn=({title:a="YAML",yaml:r,defaultOpen:l,fullHeight:n,bgTint:i="1000",codeBgColor:o,compact:d})=>{const{clickCopy:c,isCopied:u,CopyButton:p}=Dt(),h=s(()=>r?[{id:zt(),type:Xt.Button,buttonProps:{variant:D.Text,size:V.S,leftIcon:u?qt:la,onClick:()=>c(r||""),disabled:u}}]:[],[r,u]);return d?t(cn,{children:[t(un,{children:[e(na,{size:16}),e(pn,{children:e(O,{size:N.XXS,color:E.Primary,children:a})}),r&&e(p,{value:r})]}),r?e(hn,{children:e(_t,{code:r,language:"yaml",theme:"duotoneDark"})}):e(_,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})]}):e(le,{bgTint:i,richTitle:{icon:na,title:a},actions:h,withCollapse:!0,collapseIsDefaultOpen:l,fullHeight:n,children:e(dn,{$codeBgColor:o,children:r?e(_t,{code:r,language:"yaml",theme:"duotoneDark"}):e(z,{children:e(_,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})})};export{za as A,mr as B,vr as C,Ua as D,el as E,rr as G,ol as I,cl as N,sl as O,dl as P,Bl as R,Gl as S,Yl as U,tn as W,gn as Y,ar as a,Fa as b,fr as c,ul as d,br as e,gl as f,Qr as g,yr as h,Jr as i,Ya as j,Za as k,Pl as l,Rl as m,pl as n,Fl as o,Kl as p,Er as q,sn as r,er as s,Ja as t,Da as u,rl as v};
|