@odigos/ui-kit 0.0.210 → 0.0.211

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 +1 @@
1
- export{_ as Badge,B as Button,h as ButtonSize,dW as ButtonTab,dX as ButtonTabList,j as ButtonVariants,C as Checkbox,dY as CheckboxList,dZ as CheckboxSize,aM as CliCommand,aB as DataCard,o as Drawer,ay as DropData,aA as DropDataAlignX,az as DropDataAlignY,y as DropDown,b as FieldMessage,a as FieldTitle,d_ as Header,cy as HoverActions,a7 as IconButton,a8 as IconButtonSize,I as Input,f as InputList,d as InputTable,aJ as Island,L as Loader,d$ as Modal,e0 as Navbar,N as NoData,r as Note,e1 as Radio,e2 as RadioGroup,e3 as RadioSize,q as Search,aw as SectionCard,e4 as SectionCardSize,v as Segment,ac as SegmentSize,aP as StatusCard,aH as Table,aI as TableVariant,e5 as Tag,w as TextArea,aQ as TextCard,T as Toggle,e as ToggleLabelAlign,e6 as ToggleList,ak as ToggleSize,e7 as ToggleVariant,t as Typography,p as TypographySize,al as TypographyVariants,W as WarningModal}from"../chunks/ui-components-CxdeQcW1.js";import"../icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"../chunks/vendor-D99eCWta.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
1
+ export{_ as Badge,B as Button,h as ButtonSize,dW as ButtonTab,dX as ButtonTabList,j as ButtonVariants,C as Checkbox,dY as CheckboxList,dZ as CheckboxSize,aM as CliCommand,aB as DataCard,o as Drawer,ay as DropData,aA as DropDataAlignX,az as DropDataAlignY,y as DropDown,b as FieldMessage,a as FieldTitle,d_ as Header,cz as HoverActions,a7 as IconButton,a8 as IconButtonSize,I as Input,f as InputList,d as InputTable,aJ as Island,L as Loader,d$ as Modal,e0 as Navbar,N as NoData,r as Note,e1 as Radio,e2 as RadioGroup,e3 as RadioSize,q as Search,aw as SectionCard,e4 as SectionCardSize,v as Segment,ac as SegmentSize,aP as StatusCard,aH as Table,aI as TableVariant,e5 as Tag,w as TextArea,aQ as TextCard,T as Toggle,e as ToggleLabelAlign,e6 as ToggleList,ak as ToggleSize,e7 as ToggleVariant,t as Typography,p as TypographySize,al as TypographyVariants,W as WarningModal}from"../chunks/ui-components-B5U474B5.js";import"../icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"../chunks/vendor-D99eCWta.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
package/lib/components.js CHANGED
@@ -1 +1 @@
1
- export{bo as AutocompleteInput,bI as Badge,bK as Button,bb as CancelWarning,n as CenterThis,aV as Checkbox,cP as Code,bf as ConditionDetails,bg as DataCard,aT as DataCardFieldTypes,cg as DataCardFields,dG as DataFinger,bM as DataTab,ba as DeleteWarning,cw as DescribeRow,D as Divider,b4 as DocsButton,b9 as Drawer,dH as DrawerFooter,dI as DrawerHeader,c2 as Dropdown,dJ as ErrorBoundary,c7 as ExtendArrow,aL as FadeLoader,aW as FieldError,aU as FieldLabel,F as FlexColumn,g as FlexRow,dK as Header,b0 as IconButton,cH as IconGroup,bC as IconTitleBadge,bx as IconWrapped,cs as IconsNav,dL as ImageControlled,aX as Input,a$ as InputList,aY as InputTable,bF as InteractiveTable,a_ as KeyValueInputsList,dM as LoadingText,bl as Modal,bm as ModalBody,b5 as MonitorsCheckboxes,bz as MonitorsIcons,bp as NavigationButtons,bG as NoDataFound,bn as NotificationNote,dN as Overlay,aG as PageContent,bZ as Popup,cJ as PopupForm,cO as ScrollX,S as ScrollY,b3 as SectionTitle,b2 as Segment,b$ as SelectionButton,bR as SkeletonLoader,br as Status,cf as Stepper,dO as TabList,bA as TableContainer,bB as TableTitleWrap,bE as TableWrap,ci as Tag,b7 as Text,b6 as TextArea,aZ as Toggle,cM as ToggleCodeComponent,O as Tooltip,bH as TraceLoader,aS as UpgradeRequiredWrapper,b_ as VerticalScroll,cl as WarningModal,dP as WhiteSpace,dQ as getLinksFromText,dR as getStrongsFromText,dS as renderText}from"./chunks/ui-components-CxdeQcW1.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-D99eCWta.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
1
+ export{bo as AutocompleteInput,bI as Badge,bK as Button,bb as CancelWarning,n as CenterThis,aV as Checkbox,cQ as Code,bf as ConditionDetails,bg as DataCard,aT as DataCardFieldTypes,cg as DataCardFields,dG as DataFinger,bM as DataTab,ba as DeleteWarning,cx as DescribeRow,D as Divider,b4 as DocsButton,b9 as Drawer,dH as DrawerFooter,dI as DrawerHeader,c2 as Dropdown,dJ as ErrorBoundary,c7 as ExtendArrow,aL as FadeLoader,aW as FieldError,aU as FieldLabel,F as FlexColumn,g as FlexRow,dK as Header,b0 as IconButton,cI as IconGroup,bC as IconTitleBadge,bx as IconWrapped,ct as IconsNav,dL as ImageControlled,aX as Input,a$ as InputList,aY as InputTable,bF as InteractiveTable,a_ as KeyValueInputsList,dM as LoadingText,bl as Modal,bm as ModalBody,b5 as MonitorsCheckboxes,bz as MonitorsIcons,bp as NavigationButtons,bG as NoDataFound,bn as NotificationNote,dN as Overlay,aG as PageContent,bZ as Popup,cK as PopupForm,cP as ScrollX,S as ScrollY,b3 as SectionTitle,b2 as Segment,b$ as SelectionButton,bR as SkeletonLoader,br as Status,cf as Stepper,dO as TabList,bA as TableContainer,bB as TableTitleWrap,bE as TableWrap,ci as Tag,b7 as Text,b6 as TextArea,aZ as Toggle,cN as ToggleCodeComponent,O as Tooltip,bH as TraceLoader,aS as UpgradeRequiredWrapper,b_ as VerticalScroll,cl as WarningModal,dP as WhiteSpace,dQ as getLinksFromText,dR as getStrongsFromText,dS as renderText}from"./chunks/ui-components-B5U474B5.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-D99eCWta.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
package/lib/constants.js CHANGED
@@ -1 +1 @@
1
- export{a2 as ACTION_ATTRIBUTE_OPTIONS,be as ACTION_OPTIONS,a3 as ACTION_SAMPLER_OPTIONS,aF as BUTTON_TEXTS,ap as DEFAULT_DATA_STREAM_NAME,aa as DESTINATION_CATEGORIES,$ as DISPLAY_LANGUAGES,a5 as DISPLAY_TITLES,u as DOCS_BASE_URL,a9 as DestinationCategoryTypes,a6 as FORM_ALERTS,ae as INSTRUMENTATION_RULE_OPTIONS,ds as LANGUAGE_OPTIONS,M as MONITORS_OPTIONS,dt as OTEL_DISTRO_NAME_OPTIONS,c3 as STORAGE_KEYS,du as TOKEN_ABOUT_TO_EXPIRE}from"./chunks/ui-components-CxdeQcW1.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-D99eCWta.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
1
+ export{a2 as ACTION_ATTRIBUTE_OPTIONS,be as ACTION_OPTIONS,a3 as ACTION_SAMPLER_OPTIONS,aF as BUTTON_TEXTS,ap as DEFAULT_DATA_STREAM_NAME,aa as DESTINATION_CATEGORIES,$ as DISPLAY_LANGUAGES,a5 as DISPLAY_TITLES,u as DOCS_BASE_URL,a9 as DestinationCategoryTypes,a6 as FORM_ALERTS,ae as INSTRUMENTATION_RULE_OPTIONS,dt as LANGUAGE_OPTIONS,M as MONITORS_OPTIONS,du as OTEL_DISTRO_NAME_OPTIONS,c3 as STORAGE_KEYS,dv as TOKEN_ABOUT_TO_EXPIRE}from"./chunks/ui-components-B5U474B5.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-D99eCWta.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
@@ -0,0 +1,6 @@
1
+ import type { ServiceMapSources, AggregatedServiceMap } from '@/types';
2
+ export declare const stripLastDimension: (nodeId: string) => {
3
+ graphKey: string;
4
+ detail: string;
5
+ };
6
+ export declare const aggregateServiceMap: (raw: ServiceMapSources) => AggregatedServiceMap;
@@ -1,10 +1,10 @@
1
1
  import { DefaultTheme } from 'styled-components';
2
2
  import { type Edge, type Node } from '@xyflow/react';
3
- import { type ServiceMapSources } from '@/types';
3
+ import { type AggregatedServiceMap } from '@/types';
4
4
  interface Params {
5
5
  theme: DefaultTheme;
6
6
  nodes: Node[];
7
- serviceMap: ServiceMapSources;
7
+ aggregatedServiceMap: AggregatedServiceMap;
8
8
  }
9
- export declare const buildEdges: ({ theme, nodes, serviceMap }: Params) => Edge[];
9
+ export declare const buildEdges: ({ theme, nodes, aggregatedServiceMap }: Params) => Edge[];
10
10
  export {};
@@ -1,8 +1,9 @@
1
1
  import type { Node } from '@xyflow/react';
2
- import { type Source, type ServiceMapSources } from '@/types';
2
+ import { type Source, type AggregatedServiceMap } from '@/types';
3
+ export declare const toFlowNodeId: (graphKey: string) => string;
3
4
  interface Params {
4
5
  sources: Source[];
5
- serviceMap: ServiceMapSources;
6
+ aggregatedServiceMap: AggregatedServiceMap;
6
7
  }
7
- export declare const buildMapNodes: ({ sources, serviceMap }: Params) => Node[];
8
+ export declare const buildMapNodes: ({ sources, aggregatedServiceMap }: Params) => Node[];
8
9
  export {};
@@ -0,0 +1,17 @@
1
+ import { type FC } from 'react';
2
+ import type { AggregatedServiceMap } from '@/types';
3
+ export type DrawerState = {
4
+ type: 'node';
5
+ graphKey: string;
6
+ } | {
7
+ type: 'edge';
8
+ sourceKey: string;
9
+ targetKey: string;
10
+ } | null;
11
+ interface Props {
12
+ drawerState: DrawerState;
13
+ aggregatedData: AggregatedServiceMap;
14
+ onClose: () => void;
15
+ }
16
+ export declare const ServiceMapDrawer: FC<Props>;
17
+ export {};
@@ -1,4 +1,4 @@
1
- import{jsxs as e,jsx as t,Fragment as l}from"react/jsx-runtime";import{useEffect as a,Fragment as n,useState as o,useRef as i,forwardRef as r,useImperativeHandle as s,useMemo as c,Children as d,useCallback as u}from"react";import p,{useTheme as h}from"styled-components";import{A as m,F as g,a as b,C as f,b as C,I as y,c as v,i as k,d as w,K as S,T as $,e as x,f as I,D as N,g as T,B as A,h as D,j as O,k as V,l as F,W as R,m as M,M as P,V as L,S as E,n as z,N as j,o as q,L as H,p as K,R as B,q as W,r as _,s as G,t as J,u as U,v as Y,w as X,x as Z,y as Q,z as ee,E as te,G as le,H as ae,J as ne,O as oe,P as ie,Q as re,U as se,X as ce,Y as de,Z as ue,_ as pe,$ as he,a0 as me,a1 as ge,a2 as be,a3 as fe,a4 as Ce,a5 as ye,a6 as ve,a7 as ke,a8 as we,a9 as Se,aa as $e,ab as xe,ac as Ie,ad as Ne,ae as Te,af as Ae,ag as De,ah as Oe,ai as Ve,aj as Fe,ak as Re,al as Me,am as Pe,an as Le,ao as Ee,ap as ze,aq as je,ar as qe,as as He,at as Ke,au as Be,av as We,aw as _e,ax as Ge,ay as Je,az as Ue,aA as Ye,aB as Xe,aC as Ze,aD as Qe,aE as et,aF as tt,aG as lt,aH as at,aI as nt,aJ as ot,aK as it,aL as rt,aM as st,aN as ct,aO as dt,aP as ut,aQ as pt,aR as ht,aS as mt}from"../chunks/ui-components-CxdeQcW1.js";import{TrashIcon as gt,PlusIcon as bt,VSquareIcon as ft,OdigosLogo as Ct,ArrowLeftIcon as yt,ArrowRightIcon as vt,BookIcon as kt,XSquareIcon as wt,GoLogo as St,JavaLogo as $t,ChevronRightIcon as xt,ActionIcon as It,DestinationIcon as Nt,ChevronUpIcon as Tt,ChevronDownIcon as At,InstrumentationRuleIcon as Dt,SourceIcon as Ot,SettingsIcon as Vt,XIcon as Ft,VIcon as Rt,EditIcon as Mt,ExclamationTriangleIcon as Pt,ExclamationCircleIcon as Lt,KeyIcon as Et,DiagnoseIcon as zt,DownloadIcon as jt,TerminalIcon as qt,DeleteIcon as Ht,RefreshIcon as Kt,ConnectionsIcon as Bt,PodIcon as Wt,ArrowDownSquareIcon as _t,ArrowUpSquareIcon as Gt,PipelineCollectorIcon as Jt,GatewayIcon as Ut,YamlIcon as Yt}from"../icons.js";import{Y as Xt}from"../chunks/index-C27kJv0Y.js";import"zustand";import"javascript-time-ago";import"../chunks/vendor-D99eCWta.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";const Zt=[{id:"CREDIT_CARD",label:"Credit card"}],Qt=[{id:m.CollectContainerAttributes,label:"Collect container attributes"},{id:m.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:m.CollectWorkloadId,label:"Collect workload ID"},{id:m.CollectClusterId,label:"Collect cluster ID"}],el=[{id:S.Pod,label:S.Pod},{id:S.Namespace,label:S.Namespace},{id:S.Node,label:S.Node}],tl=[{label:"Label key",keyName:"labelKey",placeholder:"app.kubernetes.io/name"},{label:"Attribute key",keyName:"attributeKey",placeholder:"app.kubernetes.name"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:el}],ll=[{label:"Annotation key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt"},{label:"Attribute key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:el}],al=[{label:"Service",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Service name: The rule applies to a specific service name. Only traces originating from this service’s root span will be considered."},{label:"HTTP route",keyName:"httpRoute",placeholder:"e.g. /api/v1/users",tooltip:"HTTP route: The specific HTTP route prefix to match for sampling. Only traces with routes beginning with this prefix will be considered. For instance, configuring /buy will also match /buy/product."},{label:"Threshold",keyName:"minimumLatencyThreshold",placeholder:"e.g. 1000",tooltip:"Minimum latency threshold (ms): Specifies the minimum latency in milliseconds; traces with latency below this threshold are ignored.",inputType:v.Number},{label:"Fallback",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Fallback sampling ratio: Specifies the percentage of traces that meet the service/http_route filter but fall below the threshold that you still want to retain. For example, if a rule is set for service A and http_route B with a minimum latency threshold of 1 second, you might still want to keep some traces below this threshold. Setting the ratio to 20% ensures that 20% of these traces will be retained.",inputType:v.Number}],nl=m.UrlTemplatizationRulesGroups,ol=[{keyName:"kind",label:"Kind",placeholder:"Any kind",componentType:"dropdown",options:[{id:"Deployment",label:"Deployment"},{id:"StatefulSet",label:"StatefulSet"},{id:"DaemonSet",label:"DaemonSet"}]},{keyName:"name",label:"Name",placeholder:"Any name"}],il=[{label:"Service name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (Across all available spans)."},{label:"Sampling ratio",keyName:"samplingRatio",placeholder:"e.g. 10",tooltip:"Specifies the sample rate for all traces.",inputType:v.Number},{label:"Fallback sampling ratio",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Specifies the percentage of traces that don’t meet the service name filter and that you still like to retain.",inputType:v.Number}],rl=[{label:"Service name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (across all available spans)."},{label:"Attribute key",keyName:"attributeKey",placeholder:"e.g. http.request.method",tooltip:"Specifies the attribute key inside of the span."},{label:"Fallback sampling ratio",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Specifies the percentage of traces that don’t meet the service name filter and that you still like to retain.",inputType:v.Number},{label:"Condition",keyName:"condition",tooltip:"An object representing the filters for span attributes filters.",componentType:V.Dropdown,options:[{id:"stringCondition",label:"String condition"},{id:"numberCondition",label:"Number condition"},{id:"booleanCondition",label:"Boolean condition"},{id:"jsonCondition",label:"JSON condition"}]},{label:"Operation",keyName:"operation",tooltip:"Specifies the operation to run against the attribute.",componentType:V.Dropdown,options:[{id:"exists",label:"Exists"},{id:"equals",label:"Equals"},{id:"not_equals",label:"Not equals"},{id:"contains",label:"Contains"},{id:"not_contains",label:"Not contains"},{id:"regex",label:"Regex"},{id:"greater_than",label:"Greater than"},{id:"less_than",label:"Less than"},{id:"greater_than_or_equal",label:"Greater than or equal"},{id:"less_than_or_equal",label:"Less than or equal"},{id:"is_valid_json",label:"Is valid JSON"},{id:"is_invalid_json",label:"Is invalid JSON"},{id:"jsonpath_exists",label:"JSON path exists"},{id:"key_equals",label:"Key equals"},{id:"key_not_equals",label:"Key not equals"}]},{label:"Expected value",keyName:"expectedValue",placeholder:"e.g. GET",tooltip:"The values to test the attribute against."},{label:"JSON path",keyName:"jsonPath",placeholder:"e.g. $.user.role",tooltip:"An expression used to navigate the JSON structure.",renderCondition:e=>"jsonCondition"===e.condition}],sl={[F.K8sAttributes]:({value:n,setValue:o,formErrors:i})=>(a(()=>{n[m.CollectContainerAttributes]||n[m.CollectReplicaSetAttributes]||n[m.CollectWorkloadId]||n[m.CollectClusterId]||n[m.LabelsAttributes]?.length||n[m.AnnotationsAttributes]?.length||(o(m.CollectContainerAttributes,!0),o(m.CollectReplicaSetAttributes,!0),o(m.CollectWorkloadId,!0),o(m.CollectClusterId,!0),o(m.LabelsAttributes,[]),o(m.AnnotationsAttributes,[]))},[]),e(l,{children:[t(g,{$gap:6,children:Qt.map(({id:l,label:a})=>e(g,{children:[t(f,{label:a,value:n[l]||!1,onChange:e=>o(l,e)}),t(C,{errorMessage:i[l]})]},l))}),t(w,{label:"Label attributes",limitFieldsPerRow:2,columns:tl,values:n[m.LabelsAttributes]||[],setValues:e=>o(m.LabelsAttributes,e),errorMessage:i[m.LabelsAttributes]}),t(w,{label:"Annotation attributes",limitFieldsPerRow:2,columns:ll,values:n[m.AnnotationsAttributes]||[],setValues:e=>o(m.AnnotationsAttributes,e),errorMessage:i[m.AnnotationsAttributes]})]})),[F.AddClusterInfo]:({value:a,setValue:n,formErrors:o})=>{const i=h();return e(l,{children:[t($,{label:"Overwrite existing values",labelAlign:x.Left,labelColor:i.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:a[m.OverwriteExistingValues]||!1,onChange:e=>n(m.OverwriteExistingValues,e)}),t(w,{label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value"}],values:a[m.ClusterAttributes]||[],setValues:e=>n(m.ClusterAttributes,e),errorMessage:o[m.ClusterAttributes]})]})},[F.DeleteAttributes]:({value:e,setValue:l,formErrors:a})=>t(I,{label:"Attributes to delete",values:e[m.AttributeNamesToDelete]||[],setValues:e=>l(m.AttributeNamesToDelete,e),errorMessage:a[m.AttributeNamesToDelete]}),[F.RenameAttributes]:({value:e,setValue:l,formErrors:a})=>t(w,{label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key"},{keyName:"newKey",label:"New key"}],values:Object.entries(e[m.Renames]||{}).map(([e,t])=>({oldKey:e,newKey:t})),setValues:e=>{const t={};e.forEach(e=>t[e.oldKey]=e.newKey),l(m.Renames,t)},errorMessage:a[m.Renames]}),[F.PiiMasking]:({value:l,setValue:n,formErrors:o})=>(a(()=>{l[m.PiiCategories]?.length||n(m.PiiCategories,Zt.map(({id:e})=>e))},[]),e(g,{$gap:12,children:[t(b,{label:"Attributes to mask"}),t(g,{$gap:6,children:Zt.map(({id:e,label:a})=>t(f,{label:a,value:l[m.PiiCategories]?.includes(e)||!1,onChange:t=>{const a=l[m.PiiCategories]||[],o=t?[...a,e]:a.filter(t=>t!==e);n(m.PiiCategories,o)}},e))}),t(C,{errorMessage:o[m.PiiCategories]})]})),[F.ErrorSampler]:({value:e,setValue:l,formErrors:a})=>{const n=a[m.FallbackSamplingRatio],o=k(e[m.FallbackSamplingRatio])?"":String(e[m.FallbackSamplingRatio]);return t(y,{label:"Fallback sampling ratio",type:v.Number,min:0,max:100,value:o,placeholder:"0-100",onChange:e=>{return t=e.target.value,l(m.FallbackSamplingRatio,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:n})},[F.ProbabilisticSampler]:({value:e,setValue:l,formErrors:a})=>{const n=a[m.SamplingPercentage],o=k(e[m.SamplingPercentage])?"":String(e[m.SamplingPercentage]);return t(y,{label:"Sampling percentage",type:v.Number,min:0,max:100,value:o,placeholder:"0-100",onChange:e=>{return t=e.target.value,l(m.SamplingPercentage,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:n})},[F.LatencySampler]:({value:e,setValue:l,formErrors:a})=>{const n=a[m.EndpointsFilters],o=e[m.EndpointsFilters]||[];return t(w,{limitFieldsPerRow:2,columns:al,values:o,setValues:e=>{l(m.EndpointsFilters,e.map(({serviceName:e,httpRoute:t,minimumLatencyThreshold:l,fallbackSamplingRatio:a})=>({serviceName:e,httpRoute:t,minimumLatencyThreshold:Number(l),fallbackSamplingRatio:Number(a)})))},errorMessage:n})},[F.ServiceNameSampler]:({value:e,setValue:l,formErrors:a})=>{const n=a[m.ServicesNameFilters],o=e[m.ServicesNameFilters]||[];return t(w,{limitFieldsPerRow:2,columns:il,values:o,setValues:e=>{l(m.ServicesNameFilters,e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:l})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(l)})))},errorMessage:n})},[F.SpanAttributeSampler]:({value:e,setValue:l,formErrors:a})=>{const n=a[m.AttributeFilters],o=(e[m.AttributeFilters]||[]).map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:l,condition:a})=>{const n=Object.entries(a).filter(([e,t])=>t)[0][0];return{serviceName:e,attributeKey:t,fallbackSamplingRatio:l,condition:n,operation:a[n]?.operation,expectedValue:a[n]?.expectedValue,jsonPath:a[n]?.jsonPath}});return t(w,{limitFieldsPerRow:2,columns:rl,values:o,setValues:e=>{l(m.AttributeFilters,e.map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:l,condition:a,operation:n,expectedValue:o,jsonPath:i})=>{const r={serviceName:e,attributeKey:t,fallbackSamplingRatio:Number(l),condition:{[a]:{operation:n,expectedValue:o}}};return i&&(r.condition[a].jsonPath=i),r}))},errorMessage:n})},[F.URLTemplatization]:({value:a,setValue:o,formErrors:i})=>{const r=h(),s=a[nl]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>o(nl,e),d=(e,t)=>c(s.map((l,a)=>a===e?{...l,...t}:l));return e(l,{children:[s.map((l,a)=>e(n,{children:[t(N,{}),e(g,{$gap:12,children:[e(T,{$justifyContent:"space-between",$alignItems:"center",children:[t(b,{label:`Rule Group ${a+1}`}),t(A,{leftIcon:()=>t(gt,{fill:r.v2.colors.red[500]}),variant:O.Secondary,size:D.S,onClick:()=>{return e=a,c(s.filter((t,l)=>l!==e));var e},disabled:1===s.length})]}),t(y,{label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:l.filterK8sNamespace||"",onChange:e=>d(a,{filterK8sNamespace:e.target.value})}),t(w,{label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:ol,values:l.workloadFilters||[],setValues:e=>d(a,{workloadFilters:e})}),t(I,{label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:l.templatizationRules.map(e=>e.template),setValues:e=>d(a,{templatizationRules:e.map(e=>({template:e}))})})]}),t(C,{errorMessage:i[nl]})]},`url-templatization-group-${a}`)),t(A,{variant:O.Secondary,label:"Add rule group",leftIcon:bt,onClick:()=>c([...s,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(N,{})]})}},cl=({actionType:e,value:l,setValue:a,formErrors:n})=>{if(!e)return null;const o=sl[e];return o?t(o,{value:l,setValue:a,formErrors:n}):null},dl=({isOpen:e,onClose:l,onDeny:a,onApprove:n})=>t(R,{title:"Discard changes?",description:"You have unsaved changes.\nIf you cancel now, your changes won't be saved.",isOpen:e,onClose:l,onDeny:a,denyLabel:"Keep editing",onApprove:n,approveLabel:"Discard changes"}),ul=({isOpen:e,onClose:l,onDeny:a,onApprove:n,action:o="delete",target:i})=>{const r=o.charAt(0).toUpperCase()+o.substring(1),s=i?.endsWith("s")?"these":"this";return t(R,{title:`${r}${i?` ${i}`:""}?`,description:`Are you sure you want to ${o}${i?` ${s} ${i}`:""}?`,isOpen:e,onClose:l,onDeny:a,denyLabel:"Go back",onApprove:n,approveLabel:r})},pl=(e,t)=>!t?.length||!!t?.find(t=>t===e),hl=({title:l="Signals",required:n,errorMessage:r,allowedSignals:s,selectedSignals:c,setSelectedSignals:d,disabled:u})=>{const[p,h]=o(1===c.length),m=i(JSON.stringify(c));return a(()=>{const e=M(c);e.length||P.forEach(({id:t})=>{pl(t,s)&&e.push(t)});const t=JSON.stringify(e);m.current!==t&&(m.current=t,d(e),h(1===e.length))},[s,c]),e(g,{$gap:12,children:[t(b,{label:l,required:n}),t(T,{$gap:12,children:P.map(e=>{const l=pl(e.id,s),a=((e,t)=>!!t?.find(t=>t===e))(e.id,c);return l?t(f,{label:e.value,disabled:u||!l||p&&a,value:a,onChange:t=>((e,t)=>{const l=e,a=t?[...c,l]:c.filter(e=>e!==l);d(a),h(1===a.length)})(e.id,t)},e.id):null})}),t(C,{errorMessage:r})]})},ml=({minSupportedVersion:e,currentVersion:l})=>t(R,{isOpen:!0,onClose:()=>{},relativeToParent:!0,visual:()=>t(L,{scale:2.4,icon:()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"21",viewBox:"0 0 22 21",fill:"none",children:t("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${e} or later.\nCurrent version: ${l}.`}),gl=p.div`
1
+ import{jsxs as e,jsx as t,Fragment as l}from"react/jsx-runtime";import{useEffect as a,Fragment as n,useState as o,useRef as i,forwardRef as r,useImperativeHandle as s,useMemo as c,Children as d,useCallback as u}from"react";import p,{useTheme as h}from"styled-components";import{A as m,F as g,a as b,C as f,b as C,I as y,c as v,i as k,d as w,K as S,T as $,e as x,f as I,D as N,g as T,B as A,h as D,j as O,k as V,l as F,W as R,m as M,M as P,V as L,S as E,n as z,N as j,o as q,L as H,p as K,R as B,q as W,r as _,s as G,t as J,u as U,v as Y,w as X,x as Z,y as Q,z as ee,E as te,G as le,H as ae,J as ne,O as oe,P as ie,Q as re,U as se,X as ce,Y as de,Z as ue,_ as pe,$ as he,a0 as me,a1 as ge,a2 as be,a3 as fe,a4 as Ce,a5 as ye,a6 as ve,a7 as ke,a8 as we,a9 as Se,aa as $e,ab as xe,ac as Ie,ad as Ne,ae as Te,af as Ae,ag as De,ah as Oe,ai as Ve,aj as Fe,ak as Re,al as Me,am as Pe,an as Le,ao as Ee,ap as ze,aq as je,ar as qe,as as He,at as Ke,au as Be,av as We,aw as _e,ax as Ge,ay as Je,az as Ue,aA as Ye,aB as Xe,aC as Ze,aD as Qe,aE as et,aF as tt,aG as lt,aH as at,aI as nt,aJ as ot,aK as it,aL as rt,aM as st,aN as ct,aO as dt,aP as ut,aQ as pt,aR as ht,aS as mt}from"../chunks/ui-components-B5U474B5.js";import{TrashIcon as gt,PlusIcon as bt,VSquareIcon as ft,OdigosLogo as Ct,ArrowLeftIcon as yt,ArrowRightIcon as vt,BookIcon as kt,XSquareIcon as wt,GoLogo as St,JavaLogo as $t,ChevronRightIcon as xt,ActionIcon as It,DestinationIcon as Nt,ChevronUpIcon as Tt,ChevronDownIcon as At,InstrumentationRuleIcon as Dt,SourceIcon as Ot,SettingsIcon as Vt,XIcon as Ft,VIcon as Rt,EditIcon as Mt,ExclamationTriangleIcon as Pt,ExclamationCircleIcon as Lt,KeyIcon as Et,DiagnoseIcon as zt,DownloadIcon as jt,TerminalIcon as qt,DeleteIcon as Ht,RefreshIcon as Kt,ConnectionsIcon as Bt,PodIcon as Wt,ArrowDownSquareIcon as _t,ArrowUpSquareIcon as Gt,PipelineCollectorIcon as Jt,GatewayIcon as Ut,YamlIcon as Yt}from"../icons.js";import{Y as Xt}from"../chunks/index-BURQQLWb.js";import"zustand";import"javascript-time-ago";import"../chunks/vendor-D99eCWta.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";const Zt=[{id:"CREDIT_CARD",label:"Credit card"}],Qt=[{id:m.CollectContainerAttributes,label:"Collect container attributes"},{id:m.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:m.CollectWorkloadId,label:"Collect workload ID"},{id:m.CollectClusterId,label:"Collect cluster ID"}],el=[{id:S.Pod,label:S.Pod},{id:S.Namespace,label:S.Namespace},{id:S.Node,label:S.Node}],tl=[{label:"Label key",keyName:"labelKey",placeholder:"app.kubernetes.io/name"},{label:"Attribute key",keyName:"attributeKey",placeholder:"app.kubernetes.name"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:el}],ll=[{label:"Annotation key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt"},{label:"Attribute key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:el}],al=[{label:"Service",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Service name: The rule applies to a specific service name. Only traces originating from this service’s root span will be considered."},{label:"HTTP route",keyName:"httpRoute",placeholder:"e.g. /api/v1/users",tooltip:"HTTP route: The specific HTTP route prefix to match for sampling. Only traces with routes beginning with this prefix will be considered. For instance, configuring /buy will also match /buy/product."},{label:"Threshold",keyName:"minimumLatencyThreshold",placeholder:"e.g. 1000",tooltip:"Minimum latency threshold (ms): Specifies the minimum latency in milliseconds; traces with latency below this threshold are ignored.",inputType:v.Number},{label:"Fallback",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Fallback sampling ratio: Specifies the percentage of traces that meet the service/http_route filter but fall below the threshold that you still want to retain. For example, if a rule is set for service A and http_route B with a minimum latency threshold of 1 second, you might still want to keep some traces below this threshold. Setting the ratio to 20% ensures that 20% of these traces will be retained.",inputType:v.Number}],nl=m.UrlTemplatizationRulesGroups,ol=[{keyName:"kind",label:"Kind",placeholder:"Any kind",componentType:"dropdown",options:[{id:"Deployment",label:"Deployment"},{id:"StatefulSet",label:"StatefulSet"},{id:"DaemonSet",label:"DaemonSet"}]},{keyName:"name",label:"Name",placeholder:"Any name"}],il=[{label:"Service name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (Across all available spans)."},{label:"Sampling ratio",keyName:"samplingRatio",placeholder:"e.g. 10",tooltip:"Specifies the sample rate for all traces.",inputType:v.Number},{label:"Fallback sampling ratio",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Specifies the percentage of traces that don’t meet the service name filter and that you still like to retain.",inputType:v.Number}],rl=[{label:"Service name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (across all available spans)."},{label:"Attribute key",keyName:"attributeKey",placeholder:"e.g. http.request.method",tooltip:"Specifies the attribute key inside of the span."},{label:"Fallback sampling ratio",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Specifies the percentage of traces that don’t meet the service name filter and that you still like to retain.",inputType:v.Number},{label:"Condition",keyName:"condition",tooltip:"An object representing the filters for span attributes filters.",componentType:V.Dropdown,options:[{id:"stringCondition",label:"String condition"},{id:"numberCondition",label:"Number condition"},{id:"booleanCondition",label:"Boolean condition"},{id:"jsonCondition",label:"JSON condition"}]},{label:"Operation",keyName:"operation",tooltip:"Specifies the operation to run against the attribute.",componentType:V.Dropdown,options:[{id:"exists",label:"Exists"},{id:"equals",label:"Equals"},{id:"not_equals",label:"Not equals"},{id:"contains",label:"Contains"},{id:"not_contains",label:"Not contains"},{id:"regex",label:"Regex"},{id:"greater_than",label:"Greater than"},{id:"less_than",label:"Less than"},{id:"greater_than_or_equal",label:"Greater than or equal"},{id:"less_than_or_equal",label:"Less than or equal"},{id:"is_valid_json",label:"Is valid JSON"},{id:"is_invalid_json",label:"Is invalid JSON"},{id:"jsonpath_exists",label:"JSON path exists"},{id:"key_equals",label:"Key equals"},{id:"key_not_equals",label:"Key not equals"}]},{label:"Expected value",keyName:"expectedValue",placeholder:"e.g. GET",tooltip:"The values to test the attribute against."},{label:"JSON path",keyName:"jsonPath",placeholder:"e.g. $.user.role",tooltip:"An expression used to navigate the JSON structure.",renderCondition:e=>"jsonCondition"===e.condition}],sl={[F.K8sAttributes]:({value:n,setValue:o,formErrors:i})=>(a(()=>{n[m.CollectContainerAttributes]||n[m.CollectReplicaSetAttributes]||n[m.CollectWorkloadId]||n[m.CollectClusterId]||n[m.LabelsAttributes]?.length||n[m.AnnotationsAttributes]?.length||(o(m.CollectContainerAttributes,!0),o(m.CollectReplicaSetAttributes,!0),o(m.CollectWorkloadId,!0),o(m.CollectClusterId,!0),o(m.LabelsAttributes,[]),o(m.AnnotationsAttributes,[]))},[]),e(l,{children:[t(g,{$gap:6,children:Qt.map(({id:l,label:a})=>e(g,{children:[t(f,{label:a,value:n[l]||!1,onChange:e=>o(l,e)}),t(C,{errorMessage:i[l]})]},l))}),t(w,{label:"Label attributes",limitFieldsPerRow:2,columns:tl,values:n[m.LabelsAttributes]||[],setValues:e=>o(m.LabelsAttributes,e),errorMessage:i[m.LabelsAttributes]}),t(w,{label:"Annotation attributes",limitFieldsPerRow:2,columns:ll,values:n[m.AnnotationsAttributes]||[],setValues:e=>o(m.AnnotationsAttributes,e),errorMessage:i[m.AnnotationsAttributes]})]})),[F.AddClusterInfo]:({value:a,setValue:n,formErrors:o})=>{const i=h();return e(l,{children:[t($,{label:"Overwrite existing values",labelAlign:x.Left,labelColor:i.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:a[m.OverwriteExistingValues]||!1,onChange:e=>n(m.OverwriteExistingValues,e)}),t(w,{label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value"}],values:a[m.ClusterAttributes]||[],setValues:e=>n(m.ClusterAttributes,e),errorMessage:o[m.ClusterAttributes]})]})},[F.DeleteAttributes]:({value:e,setValue:l,formErrors:a})=>t(I,{label:"Attributes to delete",values:e[m.AttributeNamesToDelete]||[],setValues:e=>l(m.AttributeNamesToDelete,e),errorMessage:a[m.AttributeNamesToDelete]}),[F.RenameAttributes]:({value:e,setValue:l,formErrors:a})=>t(w,{label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key"},{keyName:"newKey",label:"New key"}],values:Object.entries(e[m.Renames]||{}).map(([e,t])=>({oldKey:e,newKey:t})),setValues:e=>{const t={};e.forEach(e=>t[e.oldKey]=e.newKey),l(m.Renames,t)},errorMessage:a[m.Renames]}),[F.PiiMasking]:({value:l,setValue:n,formErrors:o})=>(a(()=>{l[m.PiiCategories]?.length||n(m.PiiCategories,Zt.map(({id:e})=>e))},[]),e(g,{$gap:12,children:[t(b,{label:"Attributes to mask"}),t(g,{$gap:6,children:Zt.map(({id:e,label:a})=>t(f,{label:a,value:l[m.PiiCategories]?.includes(e)||!1,onChange:t=>{const a=l[m.PiiCategories]||[],o=t?[...a,e]:a.filter(t=>t!==e);n(m.PiiCategories,o)}},e))}),t(C,{errorMessage:o[m.PiiCategories]})]})),[F.ErrorSampler]:({value:e,setValue:l,formErrors:a})=>{const n=a[m.FallbackSamplingRatio],o=k(e[m.FallbackSamplingRatio])?"":String(e[m.FallbackSamplingRatio]);return t(y,{label:"Fallback sampling ratio",type:v.Number,min:0,max:100,value:o,placeholder:"0-100",onChange:e=>{return t=e.target.value,l(m.FallbackSamplingRatio,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:n})},[F.ProbabilisticSampler]:({value:e,setValue:l,formErrors:a})=>{const n=a[m.SamplingPercentage],o=k(e[m.SamplingPercentage])?"":String(e[m.SamplingPercentage]);return t(y,{label:"Sampling percentage",type:v.Number,min:0,max:100,value:o,placeholder:"0-100",onChange:e=>{return t=e.target.value,l(m.SamplingPercentage,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:n})},[F.LatencySampler]:({value:e,setValue:l,formErrors:a})=>{const n=a[m.EndpointsFilters],o=e[m.EndpointsFilters]||[];return t(w,{limitFieldsPerRow:2,columns:al,values:o,setValues:e=>{l(m.EndpointsFilters,e.map(({serviceName:e,httpRoute:t,minimumLatencyThreshold:l,fallbackSamplingRatio:a})=>({serviceName:e,httpRoute:t,minimumLatencyThreshold:Number(l),fallbackSamplingRatio:Number(a)})))},errorMessage:n})},[F.ServiceNameSampler]:({value:e,setValue:l,formErrors:a})=>{const n=a[m.ServicesNameFilters],o=e[m.ServicesNameFilters]||[];return t(w,{limitFieldsPerRow:2,columns:il,values:o,setValues:e=>{l(m.ServicesNameFilters,e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:l})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(l)})))},errorMessage:n})},[F.SpanAttributeSampler]:({value:e,setValue:l,formErrors:a})=>{const n=a[m.AttributeFilters],o=(e[m.AttributeFilters]||[]).map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:l,condition:a})=>{const n=Object.entries(a).filter(([e,t])=>t)[0][0];return{serviceName:e,attributeKey:t,fallbackSamplingRatio:l,condition:n,operation:a[n]?.operation,expectedValue:a[n]?.expectedValue,jsonPath:a[n]?.jsonPath}});return t(w,{limitFieldsPerRow:2,columns:rl,values:o,setValues:e=>{l(m.AttributeFilters,e.map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:l,condition:a,operation:n,expectedValue:o,jsonPath:i})=>{const r={serviceName:e,attributeKey:t,fallbackSamplingRatio:Number(l),condition:{[a]:{operation:n,expectedValue:o}}};return i&&(r.condition[a].jsonPath=i),r}))},errorMessage:n})},[F.URLTemplatization]:({value:a,setValue:o,formErrors:i})=>{const r=h(),s=a[nl]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>o(nl,e),d=(e,t)=>c(s.map((l,a)=>a===e?{...l,...t}:l));return e(l,{children:[s.map((l,a)=>e(n,{children:[t(N,{}),e(g,{$gap:12,children:[e(T,{$justifyContent:"space-between",$alignItems:"center",children:[t(b,{label:`Rule Group ${a+1}`}),t(A,{leftIcon:()=>t(gt,{fill:r.v2.colors.red[500]}),variant:O.Secondary,size:D.S,onClick:()=>{return e=a,c(s.filter((t,l)=>l!==e));var e},disabled:1===s.length})]}),t(y,{label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:l.filterK8sNamespace||"",onChange:e=>d(a,{filterK8sNamespace:e.target.value})}),t(w,{label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:ol,values:l.workloadFilters||[],setValues:e=>d(a,{workloadFilters:e})}),t(I,{label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:l.templatizationRules.map(e=>e.template),setValues:e=>d(a,{templatizationRules:e.map(e=>({template:e}))})})]}),t(C,{errorMessage:i[nl]})]},`url-templatization-group-${a}`)),t(A,{variant:O.Secondary,label:"Add rule group",leftIcon:bt,onClick:()=>c([...s,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(N,{})]})}},cl=({actionType:e,value:l,setValue:a,formErrors:n})=>{if(!e)return null;const o=sl[e];return o?t(o,{value:l,setValue:a,formErrors:n}):null},dl=({isOpen:e,onClose:l,onDeny:a,onApprove:n})=>t(R,{title:"Discard changes?",description:"You have unsaved changes.\nIf you cancel now, your changes won't be saved.",isOpen:e,onClose:l,onDeny:a,denyLabel:"Keep editing",onApprove:n,approveLabel:"Discard changes"}),ul=({isOpen:e,onClose:l,onDeny:a,onApprove:n,action:o="delete",target:i})=>{const r=o.charAt(0).toUpperCase()+o.substring(1),s=i?.endsWith("s")?"these":"this";return t(R,{title:`${r}${i?` ${i}`:""}?`,description:`Are you sure you want to ${o}${i?` ${s} ${i}`:""}?`,isOpen:e,onClose:l,onDeny:a,denyLabel:"Go back",onApprove:n,approveLabel:r})},pl=(e,t)=>!t?.length||!!t?.find(t=>t===e),hl=({title:l="Signals",required:n,errorMessage:r,allowedSignals:s,selectedSignals:c,setSelectedSignals:d,disabled:u})=>{const[p,h]=o(1===c.length),m=i(JSON.stringify(c));return a(()=>{const e=M(c);e.length||P.forEach(({id:t})=>{pl(t,s)&&e.push(t)});const t=JSON.stringify(e);m.current!==t&&(m.current=t,d(e),h(1===e.length))},[s,c]),e(g,{$gap:12,children:[t(b,{label:l,required:n}),t(T,{$gap:12,children:P.map(e=>{const l=pl(e.id,s),a=((e,t)=>!!t?.find(t=>t===e))(e.id,c);return l?t(f,{label:e.value,disabled:u||!l||p&&a,value:a,onChange:t=>((e,t)=>{const l=e,a=t?[...c,l]:c.filter(e=>e!==l);d(a),h(1===a.length)})(e.id,t)},e.id):null})}),t(C,{errorMessage:r})]})},ml=({minSupportedVersion:e,currentVersion:l})=>t(R,{isOpen:!0,onClose:()=>{},relativeToParent:!0,visual:()=>t(L,{scale:2.4,icon:()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"21",viewBox:"0 0 22 21",fill:"none",children:t("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${e} or later.\nCurrent version: ${l}.`}),gl=p.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  justify-content: flex-end;