@odigos/ui-kit 0.0.121 → 0.0.123

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,5 +1,6 @@
1
1
  export * from './button';
2
2
  export * from './button-tab';
3
3
  export * from './input';
4
+ export * from './modal';
4
5
  export * from './note';
5
6
  export * from './typography';
@@ -1 +1 @@
1
- export{co as Button,cn as ButtonSize,cp as ButtonTab,cm as ButtonVariants,cq as Input,cr as Note,cv as Typography,cu as TypographyAlign,ct as TypographySize,cs as TypographyVariants}from"../chunks/ui-components-3c494332.js";import"../icons.js";import"react";import"zustand";import"javascript-time-ago";import"../chunks/vendor-1dea551d.js";import"styled-components";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
1
+ export{co as Button,cn as ButtonSize,cp as ButtonTab,cm as ButtonVariants,cq as Input,cr as Modal,cs as Note,cw as Typography,cv as TypographyAlign,cu as TypographySize,ct as TypographyVariants}from"../chunks/ui-components-16ba4841.js";import"../icons.js";import"react";import"zustand";import"javascript-time-ago";import"../chunks/vendor-1dea551d.js";import"styled-components";import"react-dom";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
package/lib/components.js CHANGED
@@ -1 +1 @@
1
- export{V as AutocompleteInput,ag as Badge,aM as Button,t as CancelWarning,ad as CenterThis,C as Checkbox,cG as Code,G as ConditionDetails,H as DataCard,a as DataCardFieldTypes,b7 as DataCardFields,cH as DataFinger,b3 as DataTab,s as DeleteWarning,bv as DescribeRow,W as Divider,m as DocsButton,r as Drawer,cJ as DrawerFooter,cI as DrawerHeader,aJ as Dropdown,cK as ErrorBoundary,aS as ExtendArrow,aZ as FadeLoader,b as FieldError,F as FieldLabel,L as FlexColumn,Z as FlexRow,cL as Header,aR as IconButton,bE as IconGroup,a9 as IconTitleBadge,a4 as IconWrapped,br as IconsNav,cM as ImageControlled,I as Input,h as InputList,e as InputTable,ac as InteractiveTable,g as KeyValueInputsList,bp as LoadingText,O as Modal,Q as ModalBody,M as MonitorsCheckboxes,a6 as MonitorsIcons,P as NavigationButtons,ae as NoDataFound,R as NotificationNote,cT as Overlay,aD as Popup,bJ as PopupForm,bS as ScrollX,l as SectionTitle,S as Segment,aE as SelectionButton,cN as SkeletonLoader,Y as Status,b6 as Stepper,cO as TabList,a7 as TableContainer,a8 as TableTitleWrap,ab as TableWrap,bg as Tag,k as Text,n as TextArea,f as Toggle,bQ as ToggleCodeComponent,$ as Tooltip,af as TraceLoader,aF as VerticalScroll,cS as WarningModal,cP as getLinksFromText,cQ as getStrongsFromText,cR as renderText}from"./chunks/ui-components-3c494332.js";import"./icons.js";import"react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-1dea551d.js";import"styled-components";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
1
+ export{V as AutocompleteInput,ag as Badge,aM as Button,t as CancelWarning,ad as CenterThis,C as Checkbox,cH as Code,G as ConditionDetails,H as DataCard,a as DataCardFieldTypes,b7 as DataCardFields,cI as DataFinger,b3 as DataTab,s as DeleteWarning,bv as DescribeRow,W as Divider,m as DocsButton,r as Drawer,cK as DrawerFooter,cJ as DrawerHeader,aJ as Dropdown,cL as ErrorBoundary,aT as ExtendArrow,a_ as FadeLoader,b as FieldError,F as FieldLabel,L as FlexColumn,Z as FlexRow,cM as Header,aS as IconButton,bE as IconGroup,a9 as IconTitleBadge,a4 as IconWrapped,br as IconsNav,cN as ImageControlled,I as Input,h as InputList,e as InputTable,ac as InteractiveTable,g as KeyValueInputsList,bp as LoadingText,O as Modal,Q as ModalBody,M as MonitorsCheckboxes,a6 as MonitorsIcons,P as NavigationButtons,ae as NoDataFound,R as NotificationNote,cU as Overlay,aD as Popup,bJ as PopupForm,bS as ScrollX,l as SectionTitle,S as Segment,aE as SelectionButton,cO as SkeletonLoader,Y as Status,b6 as Stepper,cP as TabList,a7 as TableContainer,a8 as TableTitleWrap,ab as TableWrap,bg as Tag,k as Text,n as TextArea,f as Toggle,bQ as ToggleCodeComponent,$ as Tooltip,af as TraceLoader,aF as VerticalScroll,cT as WarningModal,cQ as getLinksFromText,cR as getStrongsFromText,cS as renderText}from"./chunks/ui-components-16ba4841.js";import"./icons.js";import"react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-1dea551d.js";import"styled-components";import"react-dom";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
package/lib/constants.js CHANGED
@@ -1 +1 @@
1
- export{y as ACTION_OPTIONS,B as BUTTON_TEXTS,aQ as DEFAULT_DATA_STREAM_NAME,b4 as DESTINATION_CATEGORIES,aK as DISPLAY_LANGUAGES,D as DISPLAY_TITLES,U as FORM_ALERTS,bj as INSTRUMENTATION_RULE_OPTIONS,ci as LANGUAGE_OPTIONS,aL as MONITORS_OPTIONS,aN as STORAGE_KEYS,cj as TOKEN_ABOUT_TO_EXPIRE}from"./chunks/ui-components-3c494332.js";import"./icons.js";import"react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-1dea551d.js";import"styled-components";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
1
+ export{y as ACTION_OPTIONS,B as BUTTON_TEXTS,aR as DEFAULT_DATA_STREAM_NAME,b4 as DESTINATION_CATEGORIES,aK as DISPLAY_LANGUAGES,D as DISPLAY_TITLES,U as FORM_ALERTS,bj as INSTRUMENTATION_RULE_OPTIONS,ci as LANGUAGE_OPTIONS,aL as MONITORS_OPTIONS,aN as STORAGE_KEYS,cj as TOKEN_ABOUT_TO_EXPIRE}from"./chunks/ui-components-16ba4841.js";import"./icons.js";import"react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-1dea551d.js";import"styled-components";import"react-dom";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
package/lib/containers.js CHANGED
@@ -1,4 +1,4 @@
1
- import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperativeHandle as a,useMemo as l,Fragment as r,useCallback as s,Children as c}from"react";import d,{css as u}from"styled-components";import{D as p,a as m,A as h,K as g,F as y,C as v,b as f,c as b,I as x,d as C,i as $,e as k,f as S,g as w,h as D,j as N,k as T,T as I,S as E,l as O,m as M,M as A,n as F,u as R,o as L,p as P,q,B as K,r as H,s as z,t as W,E as j,v as V,w as B,x as U,y as _,z as G,G as J,H as Y,J as Q,L as X,N as Z,O as ee,P as te,Q as oe,R as ie,U as ne,V as ae,W as le,X as re,Y as se,Z as ce,_ as de,$ as ue,a0 as pe,a1 as me,a2 as he,a3 as ge,a4 as ye,a5 as ve,a6 as fe,a7 as be,a8 as xe,a9 as Ce,aa as $e,ab as ke,ac as Se,ad as we,ae as De,af as Ne,ag as Te,ah as Ie,ai as Ee,aj as Oe,ak as Me,al as Ae,am as Fe,an as Re,ao as Le,ap as Pe,aq as qe,ar as Ke,as as He,at as ze,au as We,av as je,aw as Ve,ax as Be,ay as Ue,az as _e,aA as Ge,aB as Je,aC as Ye,aD as Qe,aE as Xe,aF as Ze,aG as et,aH as tt,aI as ot,aJ as it,aK as nt,aL as at,aM as lt,aN as rt,aO as st,aP as ct,aQ as dt,aR as ut,aS as pt,aT as mt,aU as ht,aV as gt,aW as yt,aX as vt,aY as ft,aZ as bt,a_ as xt,a$ as Ct,b0 as $t,b1 as kt,b2 as St,b3 as wt,b4 as Dt,b5 as Nt,b6 as Tt,b7 as It,b8 as Et,b9 as Ot,ba as Mt,bb as At,bc as Ft,bd as Rt,be as Lt,bf as Pt,bg as qt,bh as Kt,bi as Ht,bj as zt,bk as Wt,bl as jt,bm as Vt,bn as Bt,bo as Ut,bp as _t,bq as Gt,br as Jt,bs as Yt,bt as Qt,bu as Xt,bv as Zt,bw as eo,bx as to,by as oo,bz as io,bA as no,bB as ao,bC as lo,bD as ro,bE as so,bF as co,bG as uo,bH as po,bI as mo,bJ as ho,bK as go,bL as yo,bM as vo,bN as fo,bO as bo,bP as xo,bQ as Co,bR as $o,bS as ko}from"./chunks/ui-components-3c494332.js";import{CheckCircledIcon as So,CrossCircledIcon as wo,EditIcon as Do,TrashIcon as No,OdigosLogoText as To,SearchIcon as Io,FilterIcon as Eo,DataStreamsIcon as Oo,CheckIcon as Mo,OdigosLogo as Ao,ArrowIcon as Fo,PlusIcon as Ro,RefreshLeftArrowIcon as Lo,NotificationIcon as Po,UserIcon as qo,ImageErrorIcon as Ko,OverviewIcon as Ho,RulesIcon as zo,ActionsIcon as Wo,SourcesIcon as jo,DestinationsIcon as Vo,SlackLogo as Bo,CopyIcon as Uo,KeyIcon as _o,TerminalIcon as Go,GearIcon as Jo,WarningTriangleIcon as Yo,TraceViewIcon as Qo,ErrorTriangleIcon as Xo}from"./icons.js";import{useNodesState as Zo,useEdgesState as ei,applyNodeChanges as ti,MarkerType as oi}from"@xyflow/react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-1dea551d.js";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";const ii=e=>{const{type:t,name:o,notes:i,signals:n,disabled:a,fields:{collectContainerAttributes:l,collectReplicaSetAttributes:r,collectWorkloadId:s,collectClusterId:c,labelsAttributes:d,annotationsAttributes:u,clusterAttributes:y,overwriteExistingValues:v,attributeNamesToDelete:f,renames:b,piiCategories:x,fallbackSamplingRatio:C,samplingPercentage:$,endpointsFilters:k,servicesNameFilters:S,attributeFilters:w}}=e,D=[{title:p.TYPE,value:t},{type:m.ActiveStatus,title:p.STATUS,value:String(!a)},{type:m.Monitors,title:p.SIGNALS_FOR_PROCESSING,value:n?.map(e=>e.toLowerCase()).join(", ")||""},{title:p.NAME,value:o||""},{title:p.NOTES,value:i||""},{type:m.Divider}];if(t===h.K8sAttributes&&(D.push({title:"Collect Container Attributes",value:String(l)}),D.push({title:"Collect ReplicaSet Attributes",value:String(r)}),D.push({title:"Collect Workload ID",value:String(s)}),D.push({title:"Collect Cluster ID",value:String(c)}),d?.length&&D.push({type:m.Divider}),d?.forEach(({labelKey:e,attributeKey:t,from:o},i)=>{let n="";n+=`Label Key: ${e}\n`,n+=`Attribute Key: ${t}\n`,n+=`From: ${o||g.Pod}\n`,D.push({title:"Label"+(d.length>1?` #${i+1}`:""),value:n})}),u?.length&&D.push({type:m.Divider}),u?.forEach(({annotationKey:e,attributeKey:t,from:o},i)=>{let n="";n+=`Annotation Key: ${e}\n`,n+=`Attribute Key: ${t}\n`,n+=`From: ${o||g.Pod}\n`,D.push({title:"Annotation"+(u.length>1?` #${i+1}`:""),value:n})})),t===h.AddClusterInfo){D.push({title:"Overwrite Existing Values",value:String(v||!1)});let e="";y?.forEach(({attributeName:t,attributeStringValue:o},i)=>{e+=`${t}: ${o}`,i<y.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===h.DeleteAttributes){let e="";f?.forEach((t,o)=>{e+=t,o<f.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===h.RenameAttributes){let e="";const t=Object.entries(b||{});t.forEach(([o,i],n)=>{e+=`${o}: ${i}`,n<t.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===h.PiiMasking){let e="";x?.forEach((t,o)=>{e+=t,o<x.length-1&&(e+=", ")}),D.push({title:"Categories",value:e})}return t===h.ErrorSampler&&D.push({title:"Sampling Ratio",value:String(C)}),t===h.ProbabilisticSampler&&D.push({title:"Sampling Percentage",value:String($)}),t===h.LatencySampler&&k?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:o,fallbackSamplingRatio:i},n)=>{let a="";a+=`Service Name: ${e}\n`,a+=`HTTP Route: ${t}\n`,a+=`Min. Latency: ${o}\n`,a+=`Fallback Sampling Ratio: ${i}`,D.push({title:"Endpoint"+(k.length>1?` #${n+1}`:""),value:a})}),t===h.ServiceNameSampler&&S?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:o},i)=>{let n="";n+=`Service Name: ${e}\n`,n+=`Sampling Ratio: ${t}\n`,n+=`Fallback Sampling Ratio: ${o}`,D.push({title:"Filter"+(S.length>1?` #${i+1}`:""),value:n})}),t===h.SpanAttributeSampler&&w?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:i},n)=>{let a="";a+=`Service Name: ${e}\n`,a+=`Attribute Key: ${t}\n`,a+=`Fallback Sampling Ratio: ${o}\n`;const l=Object.keys(i)[0];a+=`Condition: ${l}\n`,a+=`Operation: ${i[l]?.operation}\n`,a+=`Expected Value: ${i[l]?.expectedValue}`,"jsonCondition"===l&&(a+=`\nJSON Path: ${i[l].jsonPath}`),D.push({title:"Filter"+(w.length>1?` #${n+1}`:""),value:a})}),D},ni=b.PiiCategories,ai=d.div`
1
+ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperativeHandle as a,useMemo as l,Fragment as r,useCallback as s,Children as c}from"react";import d,{css as u}from"styled-components";import{D as p,a as m,A as h,K as g,F as y,C as v,b as f,c as b,I as x,d as C,i as $,e as k,f as S,g as w,h as D,j as N,k as T,T as I,S as E,l as O,m as M,M as A,n as F,u as R,o as L,p as P,q,B as K,r as H,s as z,t as W,E as j,v as V,w as B,x as U,y as _,z as G,G as J,H as Y,J as Q,L as X,N as Z,O as ee,P as te,Q as oe,R as ie,U as ne,V as ae,W as le,X as re,Y as se,Z as ce,_ as de,$ as ue,a0 as pe,a1 as me,a2 as he,a3 as ge,a4 as ye,a5 as ve,a6 as fe,a7 as be,a8 as xe,a9 as Ce,aa as $e,ab as ke,ac as Se,ad as we,ae as De,af as Ne,ag as Te,ah as Ie,ai as Ee,aj as Oe,ak as Me,al as Ae,am as Fe,an as Re,ao as Le,ap as Pe,aq as qe,ar as Ke,as as He,at as ze,au as We,av as je,aw as Ve,ax as Be,ay as Ue,az as _e,aA as Ge,aB as Je,aC as Ye,aD as Qe,aE as Xe,aF as Ze,aG as et,aH as tt,aI as ot,aJ as it,aK as nt,aL as at,aM as lt,aN as rt,aO as st,aP as ct,aQ as dt,aR as ut,aS as pt,aT as mt,aU as ht,aV as gt,aW as yt,aX as vt,aY as ft,aZ as bt,a_ as xt,a$ as Ct,b0 as $t,b1 as kt,b2 as St,b3 as wt,b4 as Dt,b5 as Nt,b6 as Tt,b7 as It,b8 as Et,b9 as Ot,ba as Mt,bb as At,bc as Ft,bd as Rt,be as Lt,bf as Pt,bg as qt,bh as Kt,bi as Ht,bj as zt,bk as Wt,bl as jt,bm as Vt,bn as Bt,bo as Ut,bp as _t,bq as Gt,br as Jt,bs as Yt,bt as Qt,bu as Xt,bv as Zt,bw as eo,bx as to,by as oo,bz as io,bA as no,bB as ao,bC as lo,bD as ro,bE as so,bF as co,bG as uo,bH as po,bI as mo,bJ as ho,bK as go,bL as yo,bM as vo,bN as fo,bO as bo,bP as xo,bQ as Co,bR as $o,bS as ko}from"./chunks/ui-components-16ba4841.js";import{CheckCircledIcon as So,CrossCircledIcon as wo,EditIcon as Do,TrashIcon as No,OdigosLogoText as To,SearchIcon as Io,FilterIcon as Eo,DataStreamsIcon as Oo,CheckIcon as Mo,OdigosLogo as Ao,ArrowIcon as Fo,PlusIcon as Ro,RefreshLeftArrowIcon as Lo,NotificationIcon as Po,UserIcon as qo,ImageErrorIcon as Ko,OverviewIcon as Ho,RulesIcon as zo,ActionsIcon as Wo,SourcesIcon as jo,DestinationsIcon as Vo,SlackLogo as Bo,CopyIcon as Uo,KeyIcon as _o,TerminalIcon as Go,GearIcon as Jo,WarningTriangleIcon as Yo,TraceViewIcon as Qo,ErrorTriangleIcon as Xo}from"./icons.js";import{useNodesState as Zo,useEdgesState as ei,applyNodeChanges as ti,MarkerType as oi}from"@xyflow/react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-1dea551d.js";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";const ii=e=>{const{type:t,name:o,notes:i,signals:n,disabled:a,fields:{collectContainerAttributes:l,collectReplicaSetAttributes:r,collectWorkloadId:s,collectClusterId:c,labelsAttributes:d,annotationsAttributes:u,clusterAttributes:y,overwriteExistingValues:v,attributeNamesToDelete:f,renames:b,piiCategories:x,fallbackSamplingRatio:C,samplingPercentage:$,endpointsFilters:k,servicesNameFilters:S,attributeFilters:w}}=e,D=[{title:p.TYPE,value:t},{type:m.ActiveStatus,title:p.STATUS,value:String(!a)},{type:m.Monitors,title:p.SIGNALS_FOR_PROCESSING,value:n?.map(e=>e.toLowerCase()).join(", ")||""},{title:p.NAME,value:o||""},{title:p.NOTES,value:i||""},{type:m.Divider}];if(t===h.K8sAttributes&&(D.push({title:"Collect Container Attributes",value:String(l)}),D.push({title:"Collect ReplicaSet Attributes",value:String(r)}),D.push({title:"Collect Workload ID",value:String(s)}),D.push({title:"Collect Cluster ID",value:String(c)}),d?.length&&D.push({type:m.Divider}),d?.forEach(({labelKey:e,attributeKey:t,from:o},i)=>{let n="";n+=`Label Key: ${e}\n`,n+=`Attribute Key: ${t}\n`,n+=`From: ${o||g.Pod}\n`,D.push({title:"Label"+(d.length>1?` #${i+1}`:""),value:n})}),u?.length&&D.push({type:m.Divider}),u?.forEach(({annotationKey:e,attributeKey:t,from:o},i)=>{let n="";n+=`Annotation Key: ${e}\n`,n+=`Attribute Key: ${t}\n`,n+=`From: ${o||g.Pod}\n`,D.push({title:"Annotation"+(u.length>1?` #${i+1}`:""),value:n})})),t===h.AddClusterInfo){D.push({title:"Overwrite Existing Values",value:String(v||!1)});let e="";y?.forEach(({attributeName:t,attributeStringValue:o},i)=>{e+=`${t}: ${o}`,i<y.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===h.DeleteAttributes){let e="";f?.forEach((t,o)=>{e+=t,o<f.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===h.RenameAttributes){let e="";const t=Object.entries(b||{});t.forEach(([o,i],n)=>{e+=`${o}: ${i}`,n<t.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===h.PiiMasking){let e="";x?.forEach((t,o)=>{e+=t,o<x.length-1&&(e+=", ")}),D.push({title:"Categories",value:e})}return t===h.ErrorSampler&&D.push({title:"Sampling Ratio",value:String(C)}),t===h.ProbabilisticSampler&&D.push({title:"Sampling Percentage",value:String($)}),t===h.LatencySampler&&k?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:o,fallbackSamplingRatio:i},n)=>{let a="";a+=`Service Name: ${e}\n`,a+=`HTTP Route: ${t}\n`,a+=`Min. Latency: ${o}\n`,a+=`Fallback Sampling Ratio: ${i}`,D.push({title:"Endpoint"+(k.length>1?` #${n+1}`:""),value:a})}),t===h.ServiceNameSampler&&S?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:o},i)=>{let n="";n+=`Service Name: ${e}\n`,n+=`Sampling Ratio: ${t}\n`,n+=`Fallback Sampling Ratio: ${o}`,D.push({title:"Filter"+(S.length>1?` #${i+1}`:""),value:n})}),t===h.SpanAttributeSampler&&w?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:i},n)=>{let a="";a+=`Service Name: ${e}\n`,a+=`Attribute Key: ${t}\n`,a+=`Fallback Sampling Ratio: ${o}\n`;const l=Object.keys(i)[0];a+=`Condition: ${l}\n`,a+=`Operation: ${i[l]?.operation}\n`,a+=`Expected Value: ${i[l]?.expectedValue}`,"jsonCondition"===l&&(a+=`\nJSON Path: ${i[l].jsonPath}`),D.push({title:"Filter"+(w.length>1?` #${n+1}`:""),value:a})}),D},ni=b.PiiCategories,ai=d.div`
2
2
  display: flex;
3
3
  flex-direction: row;
4
4
  gap: 32px;
@@ -108,7 +108,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
108
108
  width: 100%;
109
109
  `,qn=d.div`
110
110
  width: 100%;
111
- `,Kn=({onClickNewDataStream:o,updateDataStream:i,deleteDataStream:n})=>{const a=I.useTheme(),{dataStreams:r,selectedStreamName:s,setSelectedStreamName:c}=ze(),{popupRef:d,popupOpen:u,setPopupOpen:p,popupPosition:m,handlePosition:h}=Ye(),[g,y]=t(""),[v,f]=t(""),[b,C]=t(""),$=l(()=>r.filter(({name:e})=>!b||e.toLowerCase().includes(b.toLowerCase())).map(({name:t})=>e.createElement(Pn,{key:`stream-${t}`},e.createElement(qn,null,e.createElement(Xe,{label:t,isSelected:s===t,onClick:()=>{c(t),p(!1)},color:"transparent",style:{width:"100%",justifyContent:"flex-start"}})),t!==dt&&e.createElement(ut,{onClick:()=>f(t),tooltip:K.DELETE},e.createElement(No,null)),e.createElement(ut,{onClick:()=>y(t),tooltip:K.EDIT},e.createElement(Do,null)))),[r,s,b]);return e.createElement(e.Fragment,null,e.createElement(An,null,e.createElement(Fn,{$gap:0},e.createElement(lt,{variant:"tertiary",onClick:()=>{h(0,50),p(e=>!e)}},e.createElement(Oo,{fill:a.text.info}),e.createElement(Rn,null,"Data Stream: ",s),e.createElement(pt,{extend:u}),e.createElement(Te,{label:r.length})),e.createElement(le,{orientation:"vertical",length:"32px",thickness:2,margin:"0"}),e.createElement(mt,{onClick:()=>o(),label:K.NEW})),e.createElement(Qe,{ref:d,isOpen:u,top:m.top,left:m.left,header:e.createElement(x,{placeholder:"Search...",icon:Io,value:b,onChange:e=>C(e.target.value)})},e.createElement(Ln,null,$))),e.createElement(z,{isOpen:""!==v,name:v,onApprove:()=>{n(v),f("")},onDeny:()=>{f("")}}),e.createElement(Mn,{isOpen:""!==g,onClose:()=>{y("")},dataStreamName:g,updateDataStream:i}))},Hn=d.div`
111
+ `,Kn=({onClickNewDataStream:o,updateDataStream:i,deleteDataStream:n})=>{const a=I.useTheme(),{popupRef:r,popupOpen:s,setPopupOpen:c,popupPosition:d,handlePosition:u}=Ye(),{dataStreams:p,selectedStreamName:m,setSelectedStreamName:h}=ze(),{setFetchedAllNamespaces:g,setAvailableSources:y,setConfiguredSources:v,setConfiguredFutureApps:f}=dt(),[b,C]=t(""),[$,k]=t(""),[S,w]=t(""),D=()=>{g(!1),y({}),v({}),f({})},N=l(()=>p.filter(({name:e})=>!S||e.toLowerCase().includes(S.toLowerCase())).map(({name:t})=>e.createElement(Pn,{key:`stream-${t}`},e.createElement(qn,null,e.createElement(Xe,{label:t,isSelected:m===t,onClick:()=>{D(),h(t),c(!1)},color:"transparent",style:{width:"100%",justifyContent:"flex-start"}})),t!==ut&&e.createElement(pt,{onClick:()=>k(t),tooltip:K.DELETE},e.createElement(No,null)),e.createElement(pt,{onClick:()=>C(t),tooltip:K.EDIT},e.createElement(Do,null)))),[p,m,S]);return e.createElement(e.Fragment,null,e.createElement(An,null,e.createElement(Fn,{$gap:0},e.createElement(lt,{variant:"tertiary",onClick:()=>{u(0,50),c(e=>!e)}},e.createElement(Oo,{fill:a.text.info}),e.createElement(Rn,null,"Data Stream: ",m),e.createElement(mt,{extend:s}),e.createElement(Te,{label:p.length})),e.createElement(le,{orientation:"vertical",length:"32px",thickness:2,margin:"0"}),e.createElement(ht,{onClick:()=>{D(),o()},label:K.NEW})),e.createElement(Qe,{ref:r,isOpen:s,top:d.top,left:d.left,header:e.createElement(x,{placeholder:"Search...",icon:Io,value:S,onChange:e=>w(e.target.value)})},e.createElement(Ln,null,N))),e.createElement(z,{isOpen:""!==$,name:$,onApprove:()=>{n($),k("")},onDeny:()=>{k("")}}),e.createElement(Mn,{isOpen:""!==b,onClose:()=>{C("")},dataStreamName:b,updateDataStream:i}))},Hn=d.div`
112
112
  display: flex;
113
113
  align-items: center;
114
114
  margin: 20px 0;
@@ -116,7 +116,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
116
116
  gap: 8px;
117
117
  `,zn=d.div`
118
118
  margin-left: auto;
119
- `,Wn=({addEntity:t,preventSearchPopup:o,onClickNewDataStream:i,updateDataStream:n,deleteDataStream:a})=>{const{setCurrentModal:l}=Z();return e.createElement(Hn,null,e.createElement(Kn,{onClickNewDataStream:i,updateDataStream:n,deleteDataStream:a}),e.createElement(yn,{preventPopup:o}),e.createElement(Tn,null),t&&e.createElement(zn,null,e.createElement(mt,{"data-id":`add-${t}`,onClick:()=>l(t),label:`${K.ADD} ${ot(t)}`,variant:"primary",textProps:{weight:900}})))},jn=i(({isModal:t,onClickSummary:o},i)=>{const{selectedStreamName:n}=ze(),{formData:l,handleFormChange:r,formErrors:s,validateForm:c}=ct({name:n});return a(i,()=>({validateForm:c,getFormValues:()=>l})),e.createElement(oe,{$isNotModal:!t},e.createElement(X,{$gap:24},o&&e.createElement(ht,{onClick:o}),e.createElement(O,{title:p.NAME_YOUR_STREAM,description:p.STREAM_DESCRIPTION}),e.createElement(En,{formData:l,handleFormChange:r,formErrors:s})))});jn.displayName=jn.name;const Vn=({createDataStream:t})=>{const{currentModal:o,setCurrentModal:i}=Z(),{addDataStreams:a,setSelectedStreamName:l}=ze(),r=o===gt.DataStream,s=()=>i(""),c=async()=>{if(d.current&&d.current.validateForm()){const e=d.current.getFormValues();t?t(e):(a([e]),l(e.name)),s()}},d=n(null);return q({key:"Enter",active:r},c),e.createElement(ee,{isOpen:r,onClose:s,header:{title:"Add Data Stream"},actionComponent:e.createElement(te,{buttons:[{label:"DONE",variant:"primary",onClick:c}]})},e.createElement(jn,{ref:d,isModal:!0}))},Bn=e=>Object.keys(e).filter(t=>e[t]).join(", "),Un=(e,t)=>{const{destinationType:o,disabled:i,exportedSignals:n}=e,a=[{title:p.TYPE,value:o.type},{type:m.ActiveStatus,title:p.STATUS,value:String(!i)},{type:m.Monitors,title:p.MONITORS,value:Bn(n)},{title:p.NAME,value:o.displayName}],l=yt(e,t),r=l.map(e=>({name:e.key,value:e.value}));return l.map(({key:e,name:o,value:i})=>{const{secret:l,componentProperties:s,hideFromReadData:c,customReadDataLabels:d}=t.find(t=>t.name===e)||{};if(!c?.length||!vt(c,qe(n),r)){const{type:e}=ft(s,{type:""}),t=(l||"password"===e)&&i.length?new Array(10).fill("•").join(""):"";a.push({type:m.Divider}),d?.length?d.forEach(({condition:e,...t})=>{e==i&&a.push({title:t.title,value:t.value})}):a.push({title:o,value:t||i})}}),a},_n=({signals:t,fields:o,onChange:i,formErrors:n})=>o?.map(a=>{const{componentType:l,renderCondition:r,...s}=a;if(r&&!vt(r,t,o))return null;switch(l){case N.Input:return e.createElement(x,{key:a.name,...s,onChange:e=>i(a.name,e.target.value),errorMessage:n[a.name]});case N.Dropdown:return e.createElement(it,{key:a.name,...s,showSearch:!0,value:{id:s.value||"",value:s.value||""},options:s.options||[],onSelect:e=>i(a.name,e.id),errorMessage:n[a.name]});case N.MultiInput:return e.createElement(D,{key:a.name,...s,value:"string"==typeof s.value?ft(s.value,[]):s.value,onChange:e=>i(a.name,JSON.stringify(e)),errorMessage:n[a.name]});case N.KeyValuePair:return e.createElement(w,{key:a.name,...s,value:"string"==typeof s.value?ft(s.value,[]):s.value,onChange:e=>i(a.name,JSON.stringify(e)),errorMessage:n[a.name]});case N.TextArea:return e.createElement(F,{key:a.name,...s,onChange:e=>i(a.name,e.target.value),errorMessage:n[a.name]});case N.Checkbox:return e.createElement(v,{key:a.name,...s,value:"true"==s.value,onChange:e=>i(a.name,String(e)),errorMessage:n[a.name]});default:return null}}),Gn=d(lt)`
119
+ `,Wn=({addEntity:t,preventSearchPopup:o,onClickNewDataStream:i,updateDataStream:n,deleteDataStream:a})=>{const{setCurrentModal:l}=Z();return e.createElement(Hn,null,e.createElement(Kn,{onClickNewDataStream:i,updateDataStream:n,deleteDataStream:a}),e.createElement(yn,{preventPopup:o}),e.createElement(Tn,null),t&&e.createElement(zn,null,e.createElement(ht,{"data-id":`add-${t}`,onClick:()=>l(t),label:`${K.ADD} ${ot(t)}`,variant:"primary",textProps:{weight:900}})))},jn=i(({isModal:t,onClickSummary:o},i)=>{const{selectedStreamName:n}=ze(),{formData:l,handleFormChange:r,formErrors:s,validateForm:c}=ct({name:n});return a(i,()=>({validateForm:c,getFormValues:()=>l})),e.createElement(oe,{$isNotModal:!t},e.createElement(X,{$gap:24},o&&e.createElement(gt,{onClick:o}),e.createElement(O,{title:p.NAME_YOUR_STREAM,description:p.STREAM_DESCRIPTION}),e.createElement(En,{formData:l,handleFormChange:r,formErrors:s})))});jn.displayName=jn.name;const Vn=({createDataStream:t})=>{const{currentModal:o,setCurrentModal:i}=Z(),{addDataStreams:a,setSelectedStreamName:l}=ze(),r=o===yt.DataStream,s=()=>i(""),c=async()=>{if(d.current&&d.current.validateForm()){const e=d.current.getFormValues();t?t(e):(a([e]),l(e.name)),s()}},d=n(null);return q({key:"Enter",active:r},c),e.createElement(ee,{isOpen:r,onClose:s,header:{title:"Add Data Stream"},actionComponent:e.createElement(te,{buttons:[{label:"DONE",variant:"primary",onClick:c}]})},e.createElement(jn,{ref:d,isModal:!0}))},Bn=e=>Object.keys(e).filter(t=>e[t]).join(", "),Un=(e,t)=>{const{destinationType:o,disabled:i,exportedSignals:n}=e,a=[{title:p.TYPE,value:o.type},{type:m.ActiveStatus,title:p.STATUS,value:String(!i)},{type:m.Monitors,title:p.MONITORS,value:Bn(n)},{title:p.NAME,value:o.displayName}],l=vt(e,t),r=l.map(e=>({name:e.key,value:e.value}));return l.map(({key:e,name:o,value:i})=>{const{secret:l,componentProperties:s,hideFromReadData:c,customReadDataLabels:d}=t.find(t=>t.name===e)||{};if(!c?.length||!ft(c,qe(n),r)){const{type:e}=bt(s,{type:""}),t=(l||"password"===e)&&i.length?new Array(10).fill("•").join(""):"";a.push({type:m.Divider}),d?.length?d.forEach(({condition:e,...t})=>{e==i&&a.push({title:t.title,value:t.value})}):a.push({title:o,value:t||i})}}),a},_n=({signals:t,fields:o,onChange:i,formErrors:n})=>o?.map(a=>{const{componentType:l,renderCondition:r,...s}=a;if(r&&!ft(r,t,o))return null;switch(l){case N.Input:return e.createElement(x,{key:a.name,...s,onChange:e=>i(a.name,e.target.value),errorMessage:n[a.name]});case N.Dropdown:return e.createElement(it,{key:a.name,...s,showSearch:!0,value:{id:s.value||"",value:s.value||""},options:s.options||[],onSelect:e=>i(a.name,e.id),errorMessage:n[a.name]});case N.MultiInput:return e.createElement(D,{key:a.name,...s,value:"string"==typeof s.value?bt(s.value,[]):s.value,onChange:e=>i(a.name,JSON.stringify(e)),errorMessage:n[a.name]});case N.KeyValuePair:return e.createElement(w,{key:a.name,...s,value:"string"==typeof s.value?bt(s.value,[]):s.value,onChange:e=>i(a.name,JSON.stringify(e)),errorMessage:n[a.name]});case N.TextArea:return e.createElement(F,{key:a.name,...s,onChange:e=>i(a.name,e.target.value),errorMessage:n[a.name]});case N.Checkbox:return e.createElement(v,{key:a.name,...s,value:"true"==s.value,onChange:e=>i(a.name,String(e)),errorMessage:n[a.name]});default:return null}}),Gn=d(lt)`
120
120
  display: flex;
121
121
  align-items: center;
122
122
  gap: 8px;
@@ -130,7 +130,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
130
130
  `:u`
131
131
  background-color: transparent;
132
132
  `}
133
- `,Jn=({destination:o,validateForm:i,status:n,testConnection:a,onSuccess:l,onError:r})=>{const s=I.useTheme(),{selectedStreamName:c}=ze(),[d,u]=t(!1),p=n?me(n,s):void 0;return e.createElement(Gn,{$status:n,variant:"secondary",onClick:async()=>{if(i()){u(!0);const e=await a({...o,currentStreamName:c});e&&(e.succeeded?l(e):r(e)),u(!1)}}},d?e.createElement(bt,null):p?e.createElement(p,null):null,e.createElement(T,{family:"secondary",decoration:"underline",size:14,color:n?s.text[n]:void 0},d?"Checking":n===V.Success?"Connection OK":"error"===n?"Connection Failed":"Test Connection"))},Yn=d(X)`
133
+ `,Jn=({destination:o,validateForm:i,status:n,testConnection:a,onSuccess:l,onError:r})=>{const s=I.useTheme(),{selectedStreamName:c}=ze(),[d,u]=t(!1),p=n?me(n,s):void 0;return e.createElement(Gn,{$status:n,variant:"secondary",onClick:async()=>{if(i()){u(!0);const e=await a({...o,currentStreamName:c});e&&(e.succeeded?l(e):r(e)),u(!1)}}},d?e.createElement(xt,null):p?e.createElement(p,null):null,e.createElement(T,{family:"secondary",decoration:"underline",size:14,color:n?s.text[n]:void 0},d?"Checking":n===V.Success?"Connection OK":"error"===n?"Connection Failed":"Test Connection"))},Yn=d(X)`
134
134
  align-items: unset;
135
135
  padding: 0 4px;
136
136
  `,Qn=d.div`
@@ -141,7 +141,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
141
141
  justify-content: space-between;
142
142
  `,Zn=d(T)`
143
143
  margin-bottom: 12px;
144
- `,ea=({isUpdate:i,categoryItem:a,formData:r,formErrors:s,validateForm:c,handleFormChange:d,dynamicFields:u,setDynamicFields:m,testConnection:h})=>{const{type:g,displayName:y,supportedSignals:v,testConnectionSupported:f}=a||{},b=I.useTheme(),[C,$]=t(!1),[k,S]=t(!1),[w,D]=t(void 0),N=n(!1);o(()=>{if(u.length&&!N.current){N.current=!0;let e=!1;for(let t=0;t<u.length;t++){const{required:o,value:i}=u[t];if(o){if([void 0,null,""].includes(i)){e=!1;break}e=!0}}$(e)}},[u,k]);const T=l(()=>{const{logs:e,metrics:t,traces:o}=v||{},i=[];return e?.supported&&i.push(xt.Logs),t?.supported&&i.push(xt.Metrics),o?.supported&&i.push(xt.Traces),i},[v]),F=l(()=>{const{logs:e,metrics:t,traces:o}=r.exportedSignals||{},i=[];return e&&i.push(xt.Logs),t&&i.push(xt.Metrics),o&&i.push(xt.Traces),i},[r.exportedSignals]),R=()=>{$(!1),S(!0),D(void 0)};return e.createElement(Yn,{$gap:24},e.createElement(Yn,{$gap:12},e.createElement(O,{title:i?"Update destination":"Create destination",description:`Connect ${y} with Odigos.`,actionButton:f&&e.createElement(Jn,{destination:r,validateForm:c,status:w?.type,testConnection:h,onError:e=>{S(!1),D({type:V.Error,title:e?.reason||"Connection failed",message:e?.message||"Please check your input and try again."})},onSuccess:e=>{S(!1),D({type:V.Success,title:e?.reason||"Connection succeeded",message:e?.message||""})}})}),e.createElement(Qn,null,f&&w&&e.createElement(ie,{type:w.type,title:w.title,message:w.message}),C&&!w&&!i&&e.createElement(ie,{type:V.Default,message:`Odigos autocompleted ${y} destination details.`})),e.createElement(le,null)),e.createElement(Xn,null,e.createElement(A,{title:i?"":"This connection will monitor:",required:!0,allowedSignals:T,selectedSignals:F,setSelectedSignals:e=>{R(),d("exportedSignals",{logs:e.includes(xt.Logs),metrics:e.includes(xt.Metrics),traces:e.includes(xt.Traces)})},errorMessage:s.exportedSignals}),!i&&e.createElement(M,{endpoint:`/backends/${g}`})),i&&e.createElement("div",null,e.createElement(Zn,null,"Status"),e.createElement(E,{options:[{icon:So,label:p.ENABLED,value:!1,selectedBgColor:b.text.success+I.opacity.hex["050"]},{icon:wo,label:p.DISABLED,value:!0,selectedBgColor:b.text.error+I.opacity.hex["050"]}],selected:r.disabled,setSelected:e=>d("disabled",e)})),!i&&e.createElement(x,{title:"Destination name",placeholder:"Enter destination name",value:r.name,onChange:e=>{R(),d("name",e.target.value)},errorMessage:s.name}),e.createElement(_n,{signals:F,fields:u,onChange:(e,t)=>{R(),m(o=>{const i=[...o],n=i.findIndex(t=>t.name===e);return-1!==n&&(i[n]={...i[n],value:t}),i})},formErrors:s}))},ta=d.div`
144
+ `,ea=({isUpdate:i,categoryItem:a,formData:r,formErrors:s,validateForm:c,handleFormChange:d,dynamicFields:u,setDynamicFields:m,testConnection:h})=>{const{type:g,displayName:y,supportedSignals:v,testConnectionSupported:f}=a||{},b=I.useTheme(),[C,$]=t(!1),[k,S]=t(!1),[w,D]=t(void 0),N=n(!1);o(()=>{if(u.length&&!N.current){N.current=!0;let e=!1;for(let t=0;t<u.length;t++){const{required:o,value:i}=u[t];if(o){if([void 0,null,""].includes(i)){e=!1;break}e=!0}}$(e)}},[u,k]);const T=l(()=>{const{logs:e,metrics:t,traces:o}=v||{},i=[];return e?.supported&&i.push(Ct.Logs),t?.supported&&i.push(Ct.Metrics),o?.supported&&i.push(Ct.Traces),i},[v]),F=l(()=>{const{logs:e,metrics:t,traces:o}=r.exportedSignals||{},i=[];return e&&i.push(Ct.Logs),t&&i.push(Ct.Metrics),o&&i.push(Ct.Traces),i},[r.exportedSignals]),R=()=>{$(!1),S(!0),D(void 0)};return e.createElement(Yn,{$gap:24},e.createElement(Yn,{$gap:12},e.createElement(O,{title:i?"Update destination":"Create destination",description:`Connect ${y} with Odigos.`,actionButton:f&&e.createElement(Jn,{destination:r,validateForm:c,status:w?.type,testConnection:h,onError:e=>{S(!1),D({type:V.Error,title:e?.reason||"Connection failed",message:e?.message||"Please check your input and try again."})},onSuccess:e=>{S(!1),D({type:V.Success,title:e?.reason||"Connection succeeded",message:e?.message||""})}})}),e.createElement(Qn,null,f&&w&&e.createElement(ie,{type:w.type,title:w.title,message:w.message}),C&&!w&&!i&&e.createElement(ie,{type:V.Default,message:`Odigos autocompleted ${y} destination details.`})),e.createElement(le,null)),e.createElement(Xn,null,e.createElement(A,{title:i?"":"This connection will monitor:",required:!0,allowedSignals:T,selectedSignals:F,setSelectedSignals:e=>{R(),d("exportedSignals",{logs:e.includes(Ct.Logs),metrics:e.includes(Ct.Metrics),traces:e.includes(Ct.Traces)})},errorMessage:s.exportedSignals}),!i&&e.createElement(M,{endpoint:`/backends/${g}`})),i&&e.createElement("div",null,e.createElement(Zn,null,"Status"),e.createElement(E,{options:[{icon:So,label:p.ENABLED,value:!1,selectedBgColor:b.text.success+I.opacity.hex["050"]},{icon:wo,label:p.DISABLED,value:!0,selectedBgColor:b.text.error+I.opacity.hex["050"]}],selected:r.disabled,setSelected:e=>d("disabled",e)})),!i&&e.createElement(x,{title:"Destination name",placeholder:"Enter destination name",value:r.name,onChange:e=>{R(),d("name",e.target.value)},errorMessage:s.name}),e.createElement(_n,{signals:F,fields:u,onChange:(e,t)=>{R(),m(o=>{const i=[...o],n=i.findIndex(t=>t.name===e);return-1!==n&&(i[n]={...i[n],value:t}),i})},formErrors:s}))},ta=d.div`
145
145
  width: 100%;
146
146
  height: 100%;
147
147
  max-height: calc(100vh - 220px);
@@ -151,11 +151,11 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
151
151
  display: flex;
152
152
  flex-direction: column;
153
153
  gap: 12px;
154
- `,ia=({categories:o,updateDestination:i,deleteDestination:a,testConnection:r})=>{const{destinations:s}=B(),{selectedStreamName:c}=ze(),{drawerType:d,drawerEntityId:u}=P(),m=l(()=>Ue(s,c),[s,c]),h=n(null),g=d!==j.Destination,[y,v]=t(!1),[f,b]=t(!1),{formData:x,formErrors:C,handleFormChange:$,resetFormData:k,validateForm:S,loadFormWithDrawerItem:w,yamlFields:D,setYamlFields:N,dynamicFields:T,setDynamicFields:I}=Ct({}),E=l(()=>{if(g)return k();const e=m?.find(e=>e.id===u);return e?(w(e),N($t(o,e))):k(),e},[g,u,m]);if(!E)return null;const O=o.flatMap(e=>e.items).find(e=>e.type===E.destinationType.type),{icon:M,iconSrc:A}=O?Ke(O?.type):{icon:void 0,iconSrc:void 0};return e.createElement(wi,{ref:h,title:E.name||E.destinationType.displayName,icons:M?[M]:void 0,iconSrcs:A?[A]:void 0,isEdit:y,isFormDirty:f,onEdit:e=>{v("boolean"!=typeof e||e)},onSave:async e=>{if(S({withAlert:!0,alertTitle:Q.Update})){const t=e!==E.destinationType.displayName?e:"";$("name",t),i(u,{...x,name:t}),v(!1),b(!1)}},onDelete:async()=>{a(u),v(!1),b(!1),h.current?.closeDrawer()},onCancel:()=>{v(!1),b(!1),w(E)},isLastItem:1===m.length},y?e.createElement(ta,null,e.createElement(ea,{isUpdate:!0,categoryItem:O,formData:x,formErrors:C,handleFormChange:(...e)=>{b(!0),$(...e)},dynamicFields:T,setDynamicFields:(...e)=>{b(!0),I(...e)},validateForm:S,testConnection:r})):e.createElement(oa,null,E.conditions?.length?e.createElement(J,{conditions:E.conditions}):null,e.createElement(Y,{title:p.DESTINATION_DETAILS,data:E?Un(E,D):[]})))},na=d.div`
154
+ `,ia=({categories:o,updateDestination:i,deleteDestination:a,testConnection:r})=>{const{destinations:s}=B(),{selectedStreamName:c}=ze(),{drawerType:d,drawerEntityId:u}=P(),m=l(()=>Ue(s,c),[s,c]),h=n(null),g=d!==j.Destination,[y,v]=t(!1),[f,b]=t(!1),{formData:x,formErrors:C,handleFormChange:$,resetFormData:k,validateForm:S,loadFormWithDrawerItem:w,yamlFields:D,setYamlFields:N,dynamicFields:T,setDynamicFields:I}=$t({}),E=l(()=>{if(g)return k();const e=m?.find(e=>e.id===u);return e?(w(e),N(kt(o,e))):k(),e},[g,u,m]);if(!E)return null;const O=o.flatMap(e=>e.items).find(e=>e.type===E.destinationType.type),{icon:M,iconSrc:A}=O?Ke(O?.type):{icon:void 0,iconSrc:void 0};return e.createElement(wi,{ref:h,title:E.name||E.destinationType.displayName,icons:M?[M]:void 0,iconSrcs:A?[A]:void 0,isEdit:y,isFormDirty:f,onEdit:e=>{v("boolean"!=typeof e||e)},onSave:async e=>{if(S({withAlert:!0,alertTitle:Q.Update})){const t=e!==E.destinationType.displayName?e:"";$("name",t),i(u,{...x,name:t}),v(!1),b(!1)}},onDelete:async()=>{a(u),v(!1),b(!1),h.current?.closeDrawer()},onCancel:()=>{v(!1),b(!1),w(E)},isLastItem:1===m.length},y?e.createElement(ta,null,e.createElement(ea,{isUpdate:!0,categoryItem:O,formData:x,formErrors:C,handleFormChange:(...e)=>{b(!0),$(...e)},dynamicFields:T,setDynamicFields:(...e)=>{b(!0),I(...e)},validateForm:S,testConnection:r})):e.createElement(oa,null,E.conditions?.length?e.createElement(J,{conditions:E.conditions}):null,e.createElement(Y,{title:p.DESTINATION_DETAILS,data:E?Un(E,D):[]})))},na=d.div`
155
155
  display: flex;
156
156
  flex-direction: column;
157
157
  gap: 12px;
158
- `,aa=({items:t,onSelectNew:o,onSelectConfigured:i,isLoadingForDestinationIds:n})=>{const{configuredDestinationsUpdateOnly:a}=kt();return t.map(t=>{const l=t.name===Dt.EXISTS.TITLE;return e.createElement(na,{key:`category-${t.name}`},e.createElement(O,{size:"small",icon:t.icon,title:St(t.name),description:t.description}),t.items.map(r=>{const s=`select-${t.name.replaceAll(" ","")}-destination-${r.type}`,c=Object.keys(r.supportedSignals).filter(e=>r.supportedSignals[e].supported),{icon:d,iconSrc:u}=Ke(r.type),p=r.selected||a.some(e=>e.id===r.id),m=!!n.find(e=>e===r.id),h=l?()=>i(r.id):()=>o(r);return e.createElement(wt,{key:s,"data-id":s,title:r.displayName,hoverText:K.SELECT,onClick:h,iconProps:{icon:d,iconSrc:u},visualProps:{monitors:c,monitorsWithLabels:!0},checkboxProps:{withCheckbox:l,isChecked:p,isLoading:m,onCheckboxChange:()=>i(r.id)}})}))})},la=d.div`
158
+ `,aa=({items:t,onSelectNew:o,onSelectConfigured:i,isLoadingForDestinationIds:n})=>{const{configuredDestinationsUpdateOnly:a}=dt();return t.map(t=>{const l=t.name===Dt.EXISTS.TITLE;return e.createElement(na,{key:`category-${t.name}`},e.createElement(O,{size:"small",icon:t.icon,title:St(t.name),description:t.description}),t.items.map(r=>{const s=`select-${t.name.replaceAll(" ","")}-destination-${r.type}`,c=Object.keys(r.supportedSignals).filter(e=>r.supportedSignals[e].supported),{icon:d,iconSrc:u}=Ke(r.type),p=r.selected||a.some(e=>e.id===r.id),m=!!n.find(e=>e===r.id),h=l?()=>i(r.id):()=>o(r);return e.createElement(wt,{key:s,"data-id":s,title:r.displayName,hoverText:K.SELECT,onClick:h,iconProps:{icon:d,iconSrc:u},visualProps:{monitors:c,monitorsWithLabels:!0},checkboxProps:{withCheckbox:l,isChecked:p,isLoading:m,onCheckboxChange:()=>i(r.id)}})}))})},la=d.div`
159
159
  display: flex;
160
160
  flex-direction: column;
161
161
  gap: 24px;
@@ -179,7 +179,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
179
179
  }
180
180
  `,da=d(la)`
181
181
  margin-top: 80px;
182
- `,{MANAGED:ua,SELF_HOSTED:pa,DETECTED:ma,EXISTS:ha}=Dt,ga=[{value:"All types",id:"all"},{value:ua.TITLE,id:ua.TITLE},{value:pa.TITLE,id:pa.TITLE},{value:ma.TITLE,id:ma.TITLE},{value:ha.TITLE,id:ha.TITLE}],ya=ga[0],va=[xt.Logs,xt.Metrics,xt.Traces],fa=(e,t,o)=>e.map(e=>{const{type:i,displayName:n}=e.destinationType,a=e.dataStreamNames?.includes(t),l=o.has(e.id);return{id:e.id,type:i,displayName:n,selected:a||l,fields:[],testConnectionSupported:!1,supportedSignals:{[xt.Logs]:{supported:e.exportedSignals.logs},[xt.Metrics]:{supported:e.exportedSignals.metrics},[xt.Traces]:{supported:e.exportedSignals.traces}}}}),ba=({hidden:o,categories:i,potentialDestinations:n,onSelectNew:a,onSelectConfigured:r,isLoadingForDestinationIds:s})=>{const{destinations:c}=B(),{selectedStreamName:d}=ze(),{configuredDestinations:u,configuredDestinationsUpdateOnly:p}=kt(),[m,h]=t(""),[g,y]=t(ya),[v,f]=t(va),b=l(()=>{const e=Nt(i);return e.unshift({name:ha.TITLE,description:ha.DESCRIPTION,icon:Mo,items:fa(c,d,new Set(u.concat(p).map(e=>e.id)))}),e.unshift({name:ma.TITLE,description:ma.DESCRIPTION,icon:Ao,items:n}),e.map(e=>{const t=e.items.filter(t=>{const o=!m||t.displayName.toLowerCase().includes(m.toLowerCase()),i="all"===g.id||g.id===e.name,n=v.some(e=>t.supportedSignals[e.toLowerCase()]?.supported);return o&&i&&n});return{...e,items:t}}).filter(({items:e})=>!!e.length)},[i,n,c,m,g,v,d,u,p]);return o?null:e.createElement(la,null,e.createElement(O,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e.createElement(ra,null,e.createElement(sa,null,e.createElement(x,{placeholder:"Search...",icon:Io,value:m,onChange:({target:{value:e}})=>h(e)})),e.createElement(sa,null,e.createElement(it,{options:ga,value:g,onSelect:y,onDeselect:()=>{}})),e.createElement(A,{title:"",selectedSignals:v,setSelectedSignals:f})),e.createElement(le,null),b.length?e.createElement(ca,null,e.createElement(aa,{items:b,onSelectNew:e=>a(e,v),onSelectConfigured:r,isLoadingForDestinationIds:s})):e.createElement(da,null,e.createElement(De,{title:"No destinations found"})))},xa=d.div`
182
+ `,{MANAGED:ua,SELF_HOSTED:pa,DETECTED:ma,EXISTS:ha}=Dt,ga=[{value:"All types",id:"all"},{value:ua.TITLE,id:ua.TITLE},{value:pa.TITLE,id:pa.TITLE},{value:ma.TITLE,id:ma.TITLE},{value:ha.TITLE,id:ha.TITLE}],ya=ga[0],va=[Ct.Logs,Ct.Metrics,Ct.Traces],fa=(e,t,o)=>e.map(e=>{const{type:i,displayName:n}=e.destinationType,a=e.dataStreamNames?.includes(t),l=o.has(e.id);return{id:e.id,type:i,displayName:n,selected:a||l,fields:[],testConnectionSupported:!1,supportedSignals:{[Ct.Logs]:{supported:e.exportedSignals.logs},[Ct.Metrics]:{supported:e.exportedSignals.metrics},[Ct.Traces]:{supported:e.exportedSignals.traces}}}}),ba=({hidden:o,categories:i,potentialDestinations:n,onSelectNew:a,onSelectConfigured:r,isLoadingForDestinationIds:s})=>{const{destinations:c}=B(),{selectedStreamName:d}=ze(),{configuredDestinations:u,configuredDestinationsUpdateOnly:p}=dt(),[m,h]=t(""),[g,y]=t(ya),[v,f]=t(va),b=l(()=>{const e=Nt(i);return e.unshift({name:ha.TITLE,description:ha.DESCRIPTION,icon:Mo,items:fa(c,d,new Set(u.concat(p).map(e=>e.id)))}),e.unshift({name:ma.TITLE,description:ma.DESCRIPTION,icon:Ao,items:n}),e.map(e=>{const t=e.items.filter(t=>{const o=!m||t.displayName.toLowerCase().includes(m.toLowerCase()),i="all"===g.id||g.id===e.name,n=v.some(e=>t.supportedSignals[e.toLowerCase()]?.supported);return o&&i&&n});return{...e,items:t}}).filter(({items:e})=>!!e.length)},[i,n,c,m,g,v,d,u,p]);return o?null:e.createElement(la,null,e.createElement(O,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e.createElement(ra,null,e.createElement(sa,null,e.createElement(x,{placeholder:"Search...",icon:Io,value:m,onChange:({target:{value:e}})=>h(e)})),e.createElement(sa,null,e.createElement(it,{options:ga,value:g,onSelect:y,onDeselect:()=>{}})),e.createElement(A,{title:"",selectedSignals:v,setSelectedSignals:f})),e.createElement(le,null),b.length?e.createElement(ca,null,e.createElement(aa,{items:b,onSelectNew:e=>a(e,v),onSelectConfigured:r,isLoadingForDestinationIds:s})):e.createElement(da,null,e.createElement(De,{title:"No destinations found"})))},xa=d.div`
183
183
  display: flex;
184
184
  `,Ca=d.div`
185
185
  border-right: 1px solid ${({theme:e})=>e.colors.border};
@@ -188,7 +188,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
188
188
  @media (max-width: 1050px) {
189
189
  display: none;
190
190
  }
191
- `,$a=({isOnboarding:o,categories:i,potentialDestinations:n,createDestination:a,updateDestination:l,deleteDestination:r,testConnection:s})=>{const{destinations:c}=B(),{selectedStreamName:d}=ze(),{currentModal:u,setCurrentModal:m}=Z(),{addConfiguredDestination:h,addConfiguredDestinationUpdateOnly:g,removeConfiguredDestinationUpdateOnly:y,configuredDestinationsUpdateOnly:v}=kt(),f=u===j.Destination,[b,x]=t(void 0),{formData:C,formErrors:$,handleFormChange:k,resetFormData:S,validateForm:w,setYamlFields:D,dynamicFields:N,setDynamicFields:T,loadFormWithDrawerItem:I}=Ct({supportedSignals:b?.supportedSignals,preLoadedFields:b?.fields}),[E,O]=t([]),M=e=>{const t={};return e||N.forEach(e=>t[e.name]=e.value),{id:e?.id||"",name:e?.name||C.name,disabled:e?.disabled||C.disabled,dataStreamNames:e?.dataStreamNames||[],conditions:e?.conditions||[],exportedSignals:e?.exportedSignals||C.exportedSignals,fields:e?.fields||JSON.stringify(t),destinationType:e?.destinationType||{type:b.type,displayName:b.displayName,supportedSignals:{logs:{supported:!1},metrics:{supported:!1},traces:{supported:!1}}}}},A=async e=>{if(o&&!e){const e=M();h(e)}else if(o&&e){const t=M(e);v.some(t=>t.id===e.id)?y(e):g(t)}else if(o||e){if(!o&&e){const t=M(e),o=t.dataStreamNames.some(e=>e===d);O(t=>[...t,e.id]),o?await r(e.id):await l(e.id,I(t)),O(t=>t.filter(t=>t!==e.id))}}else a(C)},F=()=>{S(),x(void 0),m("")},R=()=>{S(),x(void 0)},L=async()=>{if(b){if(!w({withAlert:!o,alertTitle:Q.Create}))return null;A()}F()};return q({key:"Enter",active:f},()=>L()),e.createElement(ee,{isOpen:f,onClose:F,header:{title:p.ADD_DESTINATION},actionComponent:e.createElement(te,{buttons:(()=>{const e=[{label:"DONE",variant:"primary",onClick:L}];return b&&e.unshift({label:"BACK",icon:Fo,variant:"secondary",onClick:R}),e})()})},e.createElement(xa,null,e.createElement(Ca,null,e.createElement(Tt,{currentStep:b?2:1,data:[{stepNumber:1,title:p.DESTINATIONS},{stepNumber:2,title:p.CONNECTION}]})),e.createElement(oe,{style:{margin:"32px 24px 12px 24px"}},e.createElement(ba,{hidden:void 0!==b,categories:i,potentialDestinations:n,onSelectNew:(e,t)=>{S(),k("type",e?.type||""),k("currentStreamName",d);const o={logs:!1,metrics:!1,traces:!1};t.filter(t=>e.supportedSignals[t].supported).forEach(e=>o[e]=!0),k("exportedSignals",o),D(e?.fields||[]),x(e)},onSelectConfigured:e=>{const t=c.find(t=>t.id===e);t&&A(t)},isLoadingForDestinationIds:E}),b&&e.createElement(ea,{categoryItem:b,formData:C,formErrors:$,handleFormChange:k,dynamicFields:N,setDynamicFields:T,validateForm:w,testConnection:s}))))},ka=d.div`
191
+ `,$a=({isOnboarding:o,categories:i,potentialDestinations:n,createDestination:a,updateDestination:l,deleteDestination:r,testConnection:s})=>{const{destinations:c}=B(),{selectedStreamName:d}=ze(),{currentModal:u,setCurrentModal:m}=Z(),{addConfiguredDestination:h,addConfiguredDestinationUpdateOnly:g,removeConfiguredDestinationUpdateOnly:y,configuredDestinationsUpdateOnly:v}=dt(),f=u===j.Destination,[b,x]=t(void 0),{formData:C,formErrors:$,handleFormChange:k,resetFormData:S,validateForm:w,setYamlFields:D,dynamicFields:N,setDynamicFields:T,loadFormWithDrawerItem:I}=$t({supportedSignals:b?.supportedSignals,preLoadedFields:b?.fields}),[E,O]=t([]),M=e=>{const t={};return e||N.forEach(e=>t[e.name]=e.value),{id:e?.id||"",name:e?.name||C.name,disabled:e?.disabled||C.disabled,dataStreamNames:e?.dataStreamNames||[],conditions:e?.conditions||[],exportedSignals:e?.exportedSignals||C.exportedSignals,fields:e?.fields||JSON.stringify(t),destinationType:e?.destinationType||{type:b.type,displayName:b.displayName,supportedSignals:{logs:{supported:!1},metrics:{supported:!1},traces:{supported:!1}}}}},A=async e=>{if(o&&!e){const e=M();h(e)}else if(o&&e){const t=M(e);v.some(t=>t.id===e.id)?y(e):g(t)}else if(o||e){if(!o&&e){const t=M(e),o=t.dataStreamNames.some(e=>e===d);O(t=>[...t,e.id]),o?await r(e.id):await l(e.id,I(t)),O(t=>t.filter(t=>t!==e.id))}}else a(C)},F=()=>{S(),x(void 0),m("")},R=()=>{S(),x(void 0)},L=async()=>{if(b){if(!w({withAlert:!o,alertTitle:Q.Create}))return null;A()}F()};return q({key:"Enter",active:f},()=>L()),e.createElement(ee,{isOpen:f,onClose:F,header:{title:p.ADD_DESTINATION},actionComponent:e.createElement(te,{buttons:(()=>{const e=[{label:"DONE",variant:"primary",onClick:L}];return b&&e.unshift({label:"BACK",icon:Fo,variant:"secondary",onClick:R}),e})()})},e.createElement(xa,null,e.createElement(Ca,null,e.createElement(Tt,{currentStep:b?2:1,data:[{stepNumber:1,title:p.DESTINATIONS},{stepNumber:2,title:p.CONNECTION}]})),e.createElement(oe,{style:{margin:"32px 24px 12px 24px"}},e.createElement(ba,{hidden:void 0!==b,categories:i,potentialDestinations:n,onSelectNew:(e,t)=>{S(),k("type",e?.type||""),k("currentStreamName",d);const o={logs:!1,metrics:!1,traces:!1};t.filter(t=>e.supportedSignals[t].supported).forEach(e=>o[e]=!0),k("exportedSignals",o),D(e?.fields||[]),x(e)},onSelectConfigured:e=>{const t=c.find(t=>t.id===e);t&&A(t)},isLoadingForDestinationIds:E}),b&&e.createElement(ea,{categoryItem:b,formData:C,formErrors:$,handleFormChange:k,dynamicFields:N,setDynamicFields:T,validateForm:w,testConnection:s}))))},ka=d.div`
192
192
  display: flex;
193
193
  flex-direction: column;
194
194
  align-items: center;
@@ -197,7 +197,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
197
197
  max-height: calc(100vh - 310px);
198
198
  height: fit-content;
199
199
  overflow-y: scroll;
200
- `,Sa=({categories:t,withDelete:o})=>{const{configuredDestinations:i,configuredDestinationsUpdateOnly:n}=kt();return i.length||n.length?e.createElement(ka,null,i.concat(n).map((a,l)=>e.createElement(wa,{key:`configured-destination-${a.destinationType.type}-${l}`,"data-id":`configured-destination-${a.destinationType.type}`,item:a,yamlFields:$t(t,a),isLastItem:i.length+n.length===1,withDelete:o}))):e.createElement(we,null,e.createElement(De,{title:"No destinations",subTitle:"Please add a destination"}))},wa=({item:o,yamlFields:i,isLastItem:n,withDelete:a})=>{const[r,s]=t(!1),{icon:c,iconSrc:d}=Ke(o.destinationType.type),{removeConfiguredDestination:u,removeConfiguredDestinationUpdateOnly:p}=kt(),m=l(()=>yt(o,i).map(e=>({title:e.name,value:e.value})),[o,i]);return e.createElement(e.Fragment,null,e.createElement(wt,{title:o.name||o.destinationType.displayName,subTitle:o.destinationType.type,iconProps:{icon:c,iconSrc:d},visualProps:{monitors:qe(o.exportedSignals),monitorsWithLabels:!0},extendableProps:{withExtend:!0,renderExtended:()=>e.createElement(It,{data:m})},renderActions:a?()=>e.createElement(ut,{onClick:()=>s(!0)},e.createElement(No,null)):void 0}),a&&e.createElement(z,{isOpen:r,name:o.destinationType.displayName||o.name,type:j.Destination,isLastItem:n,onApprove:()=>{o.id?p(o):u(o)},onDeny:()=>s(!1)}))},Da=d(lt)`
200
+ `,Sa=({categories:t,withDelete:o})=>{const{configuredDestinations:i,configuredDestinationsUpdateOnly:n}=dt();return i.length||n.length?e.createElement(ka,null,i.concat(n).map((a,l)=>e.createElement(wa,{key:`configured-destination-${a.destinationType.type}-${l}`,"data-id":`configured-destination-${a.destinationType.type}`,item:a,yamlFields:kt(t,a),isLastItem:i.length+n.length===1,withDelete:o}))):e.createElement(we,null,e.createElement(De,{title:"No destinations",subTitle:"Please add a destination"}))},wa=({item:o,yamlFields:i,isLastItem:n,withDelete:a})=>{const[r,s]=t(!1),{icon:c,iconSrc:d}=Ke(o.destinationType.type),{removeConfiguredDestination:u,removeConfiguredDestinationUpdateOnly:p}=dt(),m=l(()=>vt(o,i).map(e=>({title:e.name,value:e.value})),[o,i]);return e.createElement(e.Fragment,null,e.createElement(wt,{title:o.name||o.destinationType.displayName,subTitle:o.destinationType.type,iconProps:{icon:c,iconSrc:d},visualProps:{monitors:qe(o.exportedSignals),monitorsWithLabels:!0},extendableProps:{withExtend:!0,renderExtended:()=>e.createElement(It,{data:m})},renderActions:a?()=>e.createElement(pt,{onClick:()=>s(!0)},e.createElement(No,null)):void 0}),a&&e.createElement(z,{isOpen:r,name:o.destinationType.displayName||o.name,type:j.Destination,isLastItem:n,onApprove:()=>{o.id?p(o):u(o)},onDeny:()=>s(!1)}))},Da=d(lt)`
201
201
  display: flex;
202
202
  align-items: center;
203
203
  justify-content: center;
@@ -206,7 +206,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
206
206
  padding: 32px;
207
207
  border-radius: 16px;
208
208
  border-style: dashed !important;
209
- `,Na=({isSourcesListEmpty:t,goToSources:o,categories:i,potentialDestinations:n,testConnection:a,onClickSummary:l})=>{const r=I.useTheme(),{setCurrentModal:s}=Z(),{configuredDestinations:c,configuredDestinationsUpdateOnly:d}=kt();return e.createElement(e.Fragment,null,e.createElement(oe,{$isNotModal:!0},e.createElement(X,{$gap:12},e.createElement(X,{$gap:24},l&&e.createElement(ht,{onClick:l}),e.createElement(O,{title:p.ADD_DESTINATIONS,badgeLabel:c.length+d.length,description:p.ADD_DESTINATION_DESCRIPTION}),t&&e.createElement(ie,{type:V.Warning,message:p.NO_SOURCES_GO_BACK,action:{label:p.SELECT_SOURCES,onClick:o}}),e.createElement(Da,{variant:"secondary",onClick:()=>s(j.Destination)},e.createElement(Ro,null),e.createElement(T,{color:r.colors.secondary,size:14,decoration:"underline",family:"secondary"},p.ADD_DESTINATION))),e.createElement(Sa,{categories:i,withDelete:!0}))),e.createElement($a,{isOnboarding:!0,categories:i,potentialDestinations:n,updateDestination:async()=>{},createDestination:async()=>{},deleteDestination:async()=>{},testConnection:a}))},Ta=[{key:"icon",title:""},{key:"name",title:p.NAME,sortable:!0},{key:"type",title:p.TYPE,sortable:!0},{key:"signals",title:p.MONITORS},{key:"active-status",title:p.STATUS},{key:"conditions",title:"Conditions"},{key:"throughput",title:"Throughput",sortable:!0}],Ia=({metrics:t,maxHeight:o,maxWidth:i})=>{const n=I.useTheme(),a=he(),{selectedStreamName:r}=ze(),{setDrawerType:s,setDrawerEntityId:c}=P(),{destinations:d,destinationsLoading:u}=B(),m=l(()=>Ue(d,r),[d,r]),h=l(()=>Ri({instrumentationRules:[],sources:[],actions:[],destinations:_e(m,a),searchText:a.searchText,selectedCategory:j.Destination}).searchResults.find(({category:e})=>e===j.Destination)?.entities||[],[m,a]),g=l(()=>h.map(o=>{const{hasErrors:i,hasWarnings:a,hasDisableds:l}=re(o.conditions||[]),{icon:r,iconSrc:d}=Ke(o.destinationType.type);return{status:i?V.Error:a?V.Warning:void 0,faded:l,onClick:()=>{s(j.Destination),c(o.id)},cells:[{columnKey:"icon",component:()=>e.createElement(ye,{icon:r,src:d})},{columnKey:"name",value:ve(o,j.Destination,{prioritizeDisplayName:!0})},{columnKey:"type",value:o.destinationType.type,textColor:n.text.info},{columnKey:"throughput",value:Oe(Et(t,j.Destination,o.id).throughput),textColor:n.text.info},{columnKey:"signals",component:()=>e.createElement(fe,{withLabels:!0,monitors:qe(o.exportedSignals)})},{columnKey:"conditions",component:()=>o.conditions?.length?e.createElement(Ai,{conditions:o.conditions,id:o.id}):null},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:o.disabled?V.Error:V.Success,title:o.disabled?p.DISABLED:p.ENABLED,withIcon:!0,withBorder:!0}))}]}}),[h,t]),{badge:y,badgeTooltip:v}=l(()=>h.length!==m.length?{badge:`${h.length}/${m.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:m.length,badgeTooltip:void 0},[h,m]);return e.createElement(be,{$maxWidth:i},e.createElement(xe,null,e.createElement(Ce,{icon:$e(j.Destination),title:p.DESTINATIONS,badge:y,badgeTooltip:v,loading:u})),e.createElement(ke,{$maxHeight:o},e.createElement(Se,{columns:Ta,rows:g})),!h.length&&e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(De,null)))},Ea=e=>{const{type:t,ruleName:o,notes:i,disabled:n,profileName:a,payloadCollection:l,codeAttributes:r,headersCollection:s,customInstrumentations:c}=e,d=[{title:p.TYPE,value:t},{type:m.ActiveStatus,title:p.STATUS,value:String(!n)},{title:p.NAME,value:o},{title:p.NOTES,value:i},{title:p.MANAGED_BY_PROFILE,value:a},{type:m.Divider}];if(l){const e=Object.entries(l).filter(([e,t])=>t).map(([e,t])=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(r){const e=Object.entries(r).filter(([e,t])=>t).map(([e,t])=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(s){const e=(s[Ot.HeaderKeys]||[]).filter(e=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(c){const e=(c[At.Java]||[]).map(e=>new Mt(e.className,e.methodName)).map(e=>`• ${e.toString()}`).join("\r\n");e&&d.push({title:p.JAVA_CUSTOM_PROBES,value:e});const t=(c[At.Golang]||[]).map(e=>new Ft(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)).map(e=>`• ${e.toString()}`).join("\r\n");t&&d.push({title:p.GOLANG_CUSTOM_PROBES,value:t})}return d},Oa=d.div`
209
+ `,Na=({isSourcesListEmpty:t,goToSources:o,categories:i,potentialDestinations:n,testConnection:a,onClickSummary:l})=>{const r=I.useTheme(),{setCurrentModal:s}=Z(),{configuredDestinations:c,configuredDestinationsUpdateOnly:d}=dt();return e.createElement(e.Fragment,null,e.createElement(oe,{$isNotModal:!0},e.createElement(X,{$gap:12},e.createElement(X,{$gap:24},l&&e.createElement(gt,{onClick:l}),e.createElement(O,{title:p.ADD_DESTINATIONS,badgeLabel:c.length+d.length,description:p.ADD_DESTINATION_DESCRIPTION}),t&&e.createElement(ie,{type:V.Warning,message:p.NO_SOURCES_GO_BACK,action:{label:p.SELECT_SOURCES,onClick:o}}),e.createElement(Da,{variant:"secondary",onClick:()=>s(j.Destination)},e.createElement(Ro,null),e.createElement(T,{color:r.colors.secondary,size:14,decoration:"underline",family:"secondary"},p.ADD_DESTINATION))),e.createElement(Sa,{categories:i,withDelete:!0}))),e.createElement($a,{isOnboarding:!0,categories:i,potentialDestinations:n,updateDestination:async()=>{},createDestination:async()=>{},deleteDestination:async()=>{},testConnection:a}))},Ta=[{key:"icon",title:""},{key:"name",title:p.NAME,sortable:!0},{key:"type",title:p.TYPE,sortable:!0},{key:"signals",title:p.MONITORS},{key:"active-status",title:p.STATUS},{key:"conditions",title:"Conditions"},{key:"throughput",title:"Throughput",sortable:!0}],Ia=({metrics:t,maxHeight:o,maxWidth:i})=>{const n=I.useTheme(),a=he(),{selectedStreamName:r}=ze(),{setDrawerType:s,setDrawerEntityId:c}=P(),{destinations:d,destinationsLoading:u}=B(),m=l(()=>Ue(d,r),[d,r]),h=l(()=>Ri({instrumentationRules:[],sources:[],actions:[],destinations:_e(m,a),searchText:a.searchText,selectedCategory:j.Destination}).searchResults.find(({category:e})=>e===j.Destination)?.entities||[],[m,a]),g=l(()=>h.map(o=>{const{hasErrors:i,hasWarnings:a,hasDisableds:l}=re(o.conditions||[]),{icon:r,iconSrc:d}=Ke(o.destinationType.type);return{status:i?V.Error:a?V.Warning:void 0,faded:l,onClick:()=>{s(j.Destination),c(o.id)},cells:[{columnKey:"icon",component:()=>e.createElement(ye,{icon:r,src:d})},{columnKey:"name",value:ve(o,j.Destination,{prioritizeDisplayName:!0})},{columnKey:"type",value:o.destinationType.type,textColor:n.text.info},{columnKey:"throughput",value:Oe(Et(t,j.Destination,o.id).throughput),textColor:n.text.info},{columnKey:"signals",component:()=>e.createElement(fe,{withLabels:!0,monitors:qe(o.exportedSignals)})},{columnKey:"conditions",component:()=>o.conditions?.length?e.createElement(Ai,{conditions:o.conditions,id:o.id}):null},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:o.disabled?V.Error:V.Success,title:o.disabled?p.DISABLED:p.ENABLED,withIcon:!0,withBorder:!0}))}]}}),[h,t]),{badge:y,badgeTooltip:v}=l(()=>h.length!==m.length?{badge:`${h.length}/${m.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:m.length,badgeTooltip:void 0},[h,m]);return e.createElement(be,{$maxWidth:i},e.createElement(xe,null,e.createElement(Ce,{icon:$e(j.Destination),title:p.DESTINATIONS,badge:y,badgeTooltip:v,loading:u})),e.createElement(ke,{$maxHeight:o},e.createElement(Se,{columns:Ta,rows:g})),!h.length&&e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(De,null)))},Ea=e=>{const{type:t,ruleName:o,notes:i,disabled:n,profileName:a,payloadCollection:l,codeAttributes:r,headersCollection:s,customInstrumentations:c}=e,d=[{title:p.TYPE,value:t},{type:m.ActiveStatus,title:p.STATUS,value:String(!n)},{title:p.NAME,value:o},{title:p.NOTES,value:i},{title:p.MANAGED_BY_PROFILE,value:a},{type:m.Divider}];if(l){const e=Object.entries(l).filter(([e,t])=>t).map(([e,t])=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(r){const e=Object.entries(r).filter(([e,t])=>t).map(([e,t])=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(s){const e=(s[Ot.HeaderKeys]||[]).filter(e=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(c){const e=(c[At.Java]||[]).map(e=>new Mt(e.className,e.methodName)).map(e=>`• ${e.toString()}`).join("\r\n");e&&d.push({title:p.JAVA_CUSTOM_PROBES,value:e});const t=(c[At.Golang]||[]).map(e=>new Ft(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)).map(e=>`• ${e.toString()}`).join("\r\n");t&&d.push({title:p.GOLANG_CUSTOM_PROBES,value:t})}return d},Oa=d.div`
210
210
  display: flex;
211
211
  flex-direction: column;
212
212
  gap: 12px;
@@ -284,7 +284,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
284
284
  border-radius: 32px;
285
285
  width: fit-content;
286
286
  padding: 2px 8px;
287
- `,al=()=>{const t=I.useTheme(),{notifications:o,markAsSeen:i}=L(),n=o.filter(({hideFromHistory:e})=>!e),a=n.filter(({seen:e})=>!e),l=a.length,{popupRef:r,popupOpen:s,setPopupOpen:c,popupPosition:d,handlePosition:u}=Ye({defaultClientHeight:420,defaultClientwidth:400,onClickOutside:()=>{l&&a.forEach(({id:e})=>i(e))}});return e.createElement(el,null,e.createElement(ut,{onClick:()=>{u(0,0),c(e=>!e)},tooltip:"Notifications",withPing:!!l,pingColor:t.colors.orange_og},e.createElement(Po,{size:18})),e.createElement(Qe,{ref:r,isOpen:s,right:d.left,maxWidth:"400px",header:e.createElement(tl,null,e.createElement(T,{size:20},"Notifications"),!!l&&e.createElement(nl,{size:12,family:"secondary"},l," new"))},e.createElement(ol,null,n.length?n.map(t=>e.createElement(ul,{key:`notification-${t.id}`,...t,onClick:()=>c(!1)})):e.createElement(De,{title:"No notifications",subTitle:""})),e.createElement(il,null)))},ll=d.div`
287
+ `,al=()=>{const t=I.useTheme(),{notifications:o,markAsSeen:i}=L(),n=o.filter(({hideFromHistory:e})=>!e),a=n.filter(({seen:e})=>!e),l=a.length,{popupRef:r,popupOpen:s,setPopupOpen:c,popupPosition:d,handlePosition:u}=Ye({defaultClientHeight:420,defaultClientwidth:400,onClickOutside:()=>{l&&a.forEach(({id:e})=>i(e))}});return e.createElement(el,null,e.createElement(pt,{onClick:()=>{u(0,0),c(e=>!e)},tooltip:"Notifications",withPing:!!l,pingColor:t.colors.orange_og},e.createElement(Po,{size:18})),e.createElement(Qe,{ref:r,isOpen:s,right:d.left,maxWidth:"400px",header:e.createElement(tl,null,e.createElement(T,{size:20},"Notifications"),!!l&&e.createElement(nl,{size:12,family:"secondary"},l," new"))},e.createElement(ol,null,n.length?n.map(t=>e.createElement(ul,{key:`notification-${t.id}`,...t,onClick:()=>c(!1)})):e.createElement(De,{title:"No notifications",subTitle:""})),e.createElement(il,null)))},ll=d.div`
288
288
  display: flex;
289
289
  align-items: flex-start;
290
290
  gap: 12px;
@@ -364,7 +364,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
364
364
  align-items: center;
365
365
  justify-content: flex-end;
366
366
  text-align: right;
367
- `,wl=$e(j.Namespace),Dl=({isModal:t=!1,withInstances:o=!0,fetchingNamespace:i,fetchedNamespaces:n,filteredNamespacesAndSources:a,selectedNamespace:l,onSelectNamespace:r,selectedSources:s,onSelectSource:c,selectedFutureApps:d,onSelectFutureApps:u})=>{const m=I.useTheme(),{isVm:h}=He(),{namespacesLoading:g}=B(),y=Object.entries(a||{});return y?.length?e.createElement(vl,{$isModal:t},y.map(([t,a])=>{const y=s?.[t]||[],f=d?.[t]?.selected||!1,b=y.filter(({selected:e})=>e),x=y.length>0,C=l===t,$=b.length>0&&b.length===a.length,k=b.length>0&&b.length!==a.length,w=a.length>0,D=1===a.length;return r||w?e.createElement(fl,{key:`namespace-${t}`,"data-id":`namespace-${t}`,$selected:$,$isOpen:C},e.createElement(bl,{$selected:$,$withClick:!!r,onClick:()=>r?.(t)},e.createElement(ce,{$gap:12},r&&e.createElement(v,{partiallyChecked:k,value:$,onChange:e=>r(t,e)}),e.createElement(wl,null),e.createElement(T,null,t)),e.createElement(ce,{$gap:24},!h&&u&&e.createElement(S,{title:p.FUTURE_APPS_TITLE,tooltip:p.FUTURE_APPS_DESCRIPTION,initialValue:f,onChange:e=>u(e,t),flipHorizontally:!0}),e.createElement(Sl,{$width:108},i!==t||n?.includes(t)?null:e.createElement(_t,{size:10},"Retrieving workloads...")),e.createElement(Sl,null,e.createElement(T,{size:10,color:m.text.grey},x?`${b.length}/${a.length}`:null)),r&&e.createElement(pt,{extend:C}))),(C||!r)&&(w?e.createElement(Cl,{$addPadding:!c},e.createElement($l,null,e.createElement(le,{orientation:"vertical",length:(D?24:34*a.length)+"px"})),a.map(i=>{const n=b.some(({name:e})=>e===i.name);return e.createElement(Nl,{key:`source-${i.name}`,withInstances:o,source:i,namespace:t,isSelected:n,onSelect:c})})):e.createElement(kl,{$addPadding:!c},g||i===t&&!n?.includes(t)?e.createElement(bt,null):e.createElement(De,{title:p.NO_SOURCES_NAMESPACE,subTitle:p.TRY_SEARCH_OR_OTHER_NAMESPACE})))):null})):e.createElement(we,null,g||i?e.createElement(bt,null):e.createElement(De,{title:p.NO_SOURCES,subTitle:!h&&r?p.PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES:p.PLEASE_ADD_SOURCE}))},Nl=({withInstances:t,source:o,namespace:i,isSelected:n,onSelect:a})=>e.createElement(xl,{"data-id":`source-${o.name}`,$selected:n,$withClick:!!a,onClick:()=>a?.(o)},e.createElement(ce,{$gap:12},a&&e.createElement(v,{value:n,onChange:()=>a(o,i)}),e.createElement(ce,{$gap:4},e.createElement(T,null,o.name),e.createElement(T,{opacity:.8,size:10},t?` • ${o.numberOfInstances||0} running instance${1!==o.numberOfInstances?"s":""}`:"",` • ${o.kind}`)))),Tl=d.div`
367
+ `,wl=$e(j.Namespace),Dl=({isModal:t=!1,withInstances:o=!0,fetchingNamespace:i,fetchedNamespaces:n,filteredNamespacesAndSources:a,selectedNamespace:l,onSelectNamespace:r,selectedSources:s,onSelectSource:c,selectedFutureApps:d,onSelectFutureApps:u})=>{const m=I.useTheme(),{isVm:h}=He(),{namespacesLoading:g}=B(),y=Object.entries(a||{});return y?.length?e.createElement(vl,{$isModal:t},y.map(([t,a])=>{const y=s?.[t]||[],f=d?.[t]?.selected||!1,b=y.filter(({selected:e})=>e),x=y.length>0,C=l===t,$=b.length>0&&b.length===a.length,k=b.length>0&&b.length!==a.length,w=a.length>0,D=1===a.length;return r||w?e.createElement(fl,{key:`namespace-${t}`,"data-id":`namespace-${t}`,$selected:$,$isOpen:C},e.createElement(bl,{$selected:$,$withClick:!!r,onClick:()=>r?.(t)},e.createElement(ce,{$gap:12},r&&e.createElement(v,{partiallyChecked:k,value:$,onChange:e=>r(t,e)}),e.createElement(wl,null),e.createElement(T,null,t)),e.createElement(ce,{$gap:24},!h&&u&&e.createElement(S,{title:p.FUTURE_APPS_TITLE,tooltip:p.FUTURE_APPS_DESCRIPTION,initialValue:f,onChange:e=>u(e,t),flipHorizontally:!0}),e.createElement(Sl,{$width:108},i!==t||n?.includes(t)?null:e.createElement(_t,{size:10},"Retrieving workloads...")),e.createElement(Sl,null,e.createElement(T,{size:10,color:m.text.grey},x?`${b.length}/${a.length}`:null)),r&&e.createElement(mt,{extend:C}))),(C||!r)&&(w?e.createElement(Cl,{$addPadding:!c},e.createElement($l,null,e.createElement(le,{orientation:"vertical",length:(D?24:34*a.length)+"px"})),a.map(i=>{const n=b.some(({name:e})=>e===i.name);return e.createElement(Nl,{key:`source-${i.name}`,withInstances:o,source:i,namespace:t,isSelected:n,onSelect:c})})):e.createElement(kl,{$addPadding:!c},g||i===t&&!n?.includes(t)?e.createElement(xt,null):e.createElement(De,{title:p.NO_SOURCES_NAMESPACE,subTitle:p.TRY_SEARCH_OR_OTHER_NAMESPACE})))):null})):e.createElement(we,null,g||i?e.createElement(xt,null):e.createElement(De,{title:p.NO_SOURCES,subTitle:!h&&r?p.PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES:p.PLEASE_ADD_SOURCE}))},Nl=({withInstances:t,source:o,namespace:i,isSelected:n,onSelect:a})=>e.createElement(xl,{"data-id":`source-${o.name}`,$selected:n,$withClick:!!a,onClick:()=>a?.(o)},e.createElement(ce,{$gap:12},a&&e.createElement(v,{value:n,onChange:()=>a(o,i)}),e.createElement(ce,{$gap:4},e.createElement(T,null,o.name),e.createElement(T,{opacity:.8,size:10},t?` • ${o.numberOfInstances||0} running instance${1!==o.numberOfInstances?"s":""}`:"",` • ${o.kind}`)))),Tl=d.div`
368
368
  display: flex;
369
369
  flex-direction: column;
370
370
  align-items: center;
@@ -373,16 +373,16 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
373
373
  max-height: calc(100vh - 200px);
374
374
  height: fit-content;
375
375
  overflow-y: scroll;
376
- `,Il=({onEditStream:t,onEditSources:o,onEditDestinations:i,categories:n})=>{const{selectedStreamName:a}=ze(),{configuredSources:r,configuredDestinations:s,configuredDestinationsUpdateOnly:c}=kt(),d=l(()=>Object.values(r).reduce((e,t)=>e+t.filter(e=>e.selected).length,0),[r]);return e.createElement(oe,{$isNotModal:!0},e.createElement(X,{$gap:12},e.createElement(O,{title:p.SUMMARY,description:p.STREAM_CONFIRM}),e.createElement(Tl,null,e.createElement(Y,{title:p.STREAM_NAME,action:()=>e.createElement(Gt,{onClick:t}),data:[{title:"",value:a}]}),e.createElement(Y,{title:p.SELECTED_SOURCES,titleBadge:d,action:()=>e.createElement(Gt,{onClick:o})},e.createElement(Dl,{filteredNamespacesAndSources:r,withInstances:!1})),e.createElement(Y,{title:p.SELECTED_DESTINATIONS,titleBadge:s.length+c.length,action:()=>e.createElement(Gt,{onClick:i})},e.createElement(Sa,{categories:n})))))};var El;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}(El||(El={}));const Ol=({onClickId:o,defaultSelectedId:i,extendedNavIcons:n})=>{const{isVm:a}=He(),[r,s]=t(i||""),c=l(()=>[{id:El.Overview,icon:Ho,selected:r===El.Overview,onClick:()=>{s(El.Overview),o(El.Overview)},tooltip:"Overview"},...(n||[]).map(e=>({...e,selected:r===e.id,onClick:()=>{s(e.id),e.onClick()}}))],[r]),d=l(()=>{const e=[{id:El.Sources,icon:jo,selected:r===El.Sources,onClick:()=>{s(El.Sources),o(El.Sources)},tooltip:"Sources"},{id:El.Destinations,icon:Vo,selected:r===El.Destinations,onClick:()=>{s(El.Destinations),o(El.Destinations)},tooltip:"Destinations"}];return a||(e.push({id:El.InstrumentationRules,icon:zo,selected:r===El.InstrumentationRules,onClick:()=>{s(El.InstrumentationRules),o(El.InstrumentationRules)},tooltip:"Instrumentation Rules"}),e.push({id:El.Actions,icon:Wo,selected:r===El.Actions,onClick:()=>{s(El.Actions),o(El.Actions)},tooltip:"Actions"})),e},[a,r]);return e.createElement(Jt,{orientation:"vertical",mainIcons:c,subIcons:d})},Ml=({})=>e.createElement(ut,{onClick:()=>window.open("https://join.slack.com/t/odigos/shared_invite/zt-2wc6gm4j9-EhcVFYrLwHqvcIErO9sVzw","_blank","noopener noreferrer"),tooltip:"Join our Slack community"},e.createElement(Bo,null)),Al=(e,t)=>{const{name:o,kind:i,namespace:n}=e,a=[{title:p.KIND,value:i},{title:p.NAME,value:o,tooltip:"Resource name"}];return t||(a.unshift({title:p.NAMESPACE,value:n}),a.push({type:m.Divider}),a.push({type:m.CopyText,value:`kubectl get ${i} ${o} -n ${n}`.toLowerCase()})),a},Fl=d.div`
376
+ `,Il=({onEditStream:t,onEditSources:o,onEditDestinations:i,categories:n})=>{const{selectedStreamName:a}=ze(),{configuredSources:r,configuredDestinations:s,configuredDestinationsUpdateOnly:c}=dt(),d=l(()=>Object.values(r).reduce((e,t)=>e+t.filter(e=>e.selected).length,0),[r]);return e.createElement(oe,{$isNotModal:!0},e.createElement(X,{$gap:12},e.createElement(O,{title:p.SUMMARY,description:p.STREAM_CONFIRM}),e.createElement(Tl,null,e.createElement(Y,{title:p.STREAM_NAME,action:()=>e.createElement(Gt,{onClick:t}),data:[{title:"",value:a}]}),e.createElement(Y,{title:p.SELECTED_SOURCES,titleBadge:d,action:()=>e.createElement(Gt,{onClick:o})},e.createElement(Dl,{filteredNamespacesAndSources:r,withInstances:!1})),e.createElement(Y,{title:p.SELECTED_DESTINATIONS,titleBadge:s.length+c.length,action:()=>e.createElement(Gt,{onClick:i})},e.createElement(Sa,{categories:n})))))};var El;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}(El||(El={}));const Ol=({onClickId:o,defaultSelectedId:i,extendedNavIcons:n})=>{const{isVm:a}=He(),[r,s]=t(i||""),c=l(()=>[{id:El.Overview,icon:Ho,selected:r===El.Overview,onClick:()=>{s(El.Overview),o(El.Overview)},tooltip:"Overview"},...(n||[]).map(e=>({...e,selected:r===e.id,onClick:()=>{s(e.id),e.onClick()}}))],[r]),d=l(()=>{const e=[{id:El.Sources,icon:jo,selected:r===El.Sources,onClick:()=>{s(El.Sources),o(El.Sources)},tooltip:"Sources"},{id:El.Destinations,icon:Vo,selected:r===El.Destinations,onClick:()=>{s(El.Destinations),o(El.Destinations)},tooltip:"Destinations"}];return a||(e.push({id:El.InstrumentationRules,icon:zo,selected:r===El.InstrumentationRules,onClick:()=>{s(El.InstrumentationRules),o(El.InstrumentationRules)},tooltip:"Instrumentation Rules"}),e.push({id:El.Actions,icon:Wo,selected:r===El.Actions,onClick:()=>{s(El.Actions),o(El.Actions)},tooltip:"Actions"})),e},[a,r]);return e.createElement(Jt,{orientation:"vertical",mainIcons:c,subIcons:d})},Ml=({})=>e.createElement(pt,{onClick:()=>window.open("https://join.slack.com/t/odigos/shared_invite/zt-2wc6gm4j9-EhcVFYrLwHqvcIErO9sVzw","_blank","noopener noreferrer"),tooltip:"Join our Slack community"},e.createElement(Bo,null)),Al=(e,t)=>{const{name:o,kind:i,namespace:n}=e,a=[{title:p.KIND,value:i},{title:p.NAME,value:o,tooltip:"Resource name"}];return t||(a.unshift({title:p.NAMESPACE,value:n}),a.push({type:m.Divider}),a.push({type:m.CopyText,value:`kubectl get ${i} ${o} -n ${n}`.toLowerCase()})),a},Fl=d.div`
377
377
  display: flex;
378
378
  flex-direction: column;
379
379
  gap: 24px;
380
380
  padding: 4px;
381
- `,Rl=({formData:t,handleFormChange:o})=>e.createElement(Fl,null,e.createElement(x,{name:"sourceName",title:"Source name",tooltip:"This overrides the default service name that runs in your cluster.",placeholder:"Use a name that overrides the source name",value:t.otelServiceName,onChange:({target:{value:e}})=>o("otelServiceName",e)})),Ll=({workloadOdigosHealthStatus:t})=>{if(!t)return null;const o=Yt(t.status),i=ot(t.reasonEnum),n=t.message;return e.createElement(ce,{$alignItems:"center",$justifyContent:"center"},e.createElement(se,{status:o,title:i,subtitle:n,withBackground:o!==pe.Disabled,withBorder:!0,withIcon:!0,width:"calc(100% - 24px)"}))},Pl=({source:i,fetchSourceDescribe:n})=>{const[a,l]=t(!1),[r,s]=t(null);return o(()=>{i&&n({variables:{namespace:i.namespace,name:i.name,kind:i.kind}}).then(({data:e})=>{e?.describeSource?s(e.describeSource):l(!0)})},[n,i]),r||a?e.createElement(X,{$gap:12},a?e.createElement(we,{$height:"70vh"},e.createElement(De,{subTitle:"Could not fetch describe for this source"})):r?.pods?.length?r.pods.map(({podName:t,nodeName:o,phase:n,agentInjected:a,runningLatestWorkloadRevision:l,containers:s})=>{const d=n.status!==V.Success||Qt(s)?V.Error:V.Success,u=[];return u.push(e.createElement(Xt,{value:`kubectl get pod ${t.value} -n ${r?.namespace?.value||i.namespace}`.toLowerCase()})),u.push(e.createElement(le,{length:"100%",margin:"0"})),u.push(e.createElement(Zt,{title:o.name,tooltip:o.explain||"",value:{status:o.status||void 0,text:o.value}})),u.push(e.createElement(le,{length:"100%",margin:"0"})),u.push(e.createElement(Zt,{title:n.name,tooltip:n.explain||"",value:{status:n.status||void 0,text:n.value}})),u.push(e.createElement(le,{length:"100%",margin:"0"})),u.push(e.createElement(Zt,{title:a.name,tooltip:a.explain||"",value:{status:a.status||void 0,text:a.value}})),u.push(e.createElement(le,{length:"100%",margin:"0"})),l?.name&&(u.push(e.createElement(Zt,{title:l.name,tooltip:l.explain||void 0,value:{status:l.status||void 0,text:l.value}})),u.push(e.createElement(le,{length:"100%",margin:"0"}))),s.forEach(t=>{u.push(e.createElement(eo,{...t}))}),e.createElement(Y,{key:`pod-${t.value}`,title:`Pod: ${t.value}`,withExtend:!0,action:()=>e.createElement(se,{status:d,title:d,withIcon:!0,withBorder:!0})},c.toArray(u))}):e.createElement(we,{$height:"70vh"},e.createElement(De,{subTitle:"Check if you have any running pods and try again"}))):e.createElement(we,{$height:"70vh"},e.createElement(bt,null))},ql=d(ce)`
381
+ `,Rl=({formData:t,handleFormChange:o})=>e.createElement(Fl,null,e.createElement(x,{name:"sourceName",title:"Source name",tooltip:"This overrides the default service name that runs in your cluster.",placeholder:"Use a name that overrides the source name",value:t.otelServiceName,onChange:({target:{value:e}})=>o("otelServiceName",e)})),Ll=({workloadOdigosHealthStatus:t})=>{if(!t)return null;const o=Yt(t.status),i=ot(t.reasonEnum),n=t.message;return e.createElement(ce,{$alignItems:"center",$justifyContent:"center"},e.createElement(se,{status:o,title:i,subtitle:n,withBackground:o!==pe.Disabled,withBorder:!0,withIcon:!0,width:"calc(100% - 24px)"}))},Pl=({source:i,fetchSourceDescribe:n})=>{const[a,l]=t(!1),[r,s]=t(null);return o(()=>{i&&n({variables:{namespace:i.namespace,name:i.name,kind:i.kind}}).then(({data:e})=>{e?.describeSource?s(e.describeSource):l(!0)})},[n,i]),r||a?e.createElement(X,{$gap:12},a?e.createElement(we,{$height:"70vh"},e.createElement(De,{subTitle:"Could not fetch describe for this source"})):r?.pods?.length?r.pods.map(({podName:t,nodeName:o,phase:n,agentInjected:a,runningLatestWorkloadRevision:l,containers:s})=>{const d=n.status!==V.Success||Qt(s)?V.Error:V.Success,u=[];return u.push(e.createElement(Xt,{value:`kubectl get pod ${t.value} -n ${r?.namespace?.value||i.namespace}`.toLowerCase()})),u.push(e.createElement(le,{length:"100%",margin:"0"})),u.push(e.createElement(Zt,{title:o.name,tooltip:o.explain||"",value:{status:o.status||void 0,text:o.value}})),u.push(e.createElement(le,{length:"100%",margin:"0"})),u.push(e.createElement(Zt,{title:n.name,tooltip:n.explain||"",value:{status:n.status||void 0,text:n.value}})),u.push(e.createElement(le,{length:"100%",margin:"0"})),u.push(e.createElement(Zt,{title:a.name,tooltip:a.explain||"",value:{status:a.status||void 0,text:a.value}})),u.push(e.createElement(le,{length:"100%",margin:"0"})),l?.name&&(u.push(e.createElement(Zt,{title:l.name,tooltip:l.explain||void 0,value:{status:l.status||void 0,text:l.value}})),u.push(e.createElement(le,{length:"100%",margin:"0"}))),s.forEach(t=>{u.push(e.createElement(eo,{...t}))}),e.createElement(Y,{key:`pod-${t.value}`,title:`Pod: ${t.value}`,withExtend:!0,action:()=>e.createElement(se,{status:d,title:d,withIcon:!0,withBorder:!0})},c.toArray(u))}):e.createElement(we,{$height:"70vh"},e.createElement(De,{subTitle:"Check if you have any running pods and try again"}))):e.createElement(we,{$height:"70vh"},e.createElement(xt,null))},ql=d(ce)`
382
382
  width: 100%;
383
383
  align-items: center;
384
384
  justify-content: space-between;
385
- `,Kl=({source:i,fetchSourceLibraries:n})=>{const a=I.useTheme(),[l,s]=t(!1),[c,d]=t(null);return o(()=>{i&&n({variables:{namespace:i.namespace,name:i.name,kind:i.kind}}).then(({data:e})=>{e?.instrumentationInstanceComponents?d(Nt(e.instrumentationInstanceComponents).sort((e,t)=>e.name.localeCompare(t.name))):s(!0)})},[n,i]),c||l?e.createElement(X,{$gap:12},l?e.createElement(we,{$height:"70vh"},e.createElement(De,{subTitle:"Could not fetch libraries for this source"})):c?.length?e.createElement(Y,{title:"Instrumented Libraries"},c.map(({name:t,nonIdentifyingAttributes:o},i)=>e.createElement(r,{key:`library-${t}`},e.createElement(ql,null,e.createElement(T,{size:12,color:a.text.grey},t),e.createElement(ce,{$gap:4},o.map(({key:o,value:i})=>to(i)&&oo(i)&&"is_standard_lib"===o?e.createElement(se,{key:`${t}-${o}`,status:V.Default,title:"STANDARD",withBorder:!0}):null))),i!==c.length-1&&e.createElement(le,{length:"100%",margin:"0"})))):e.createElement(we,{$height:"70vh",$gap:12},e.createElement(De,{title:"No libraries found",subTitle:""}),e.createElement(ie,{type:V.Warning,message:"This feature is in early development, and has very limited support"}))):e.createElement(we,{$height:"70vh"},e.createElement(bt,null))};var Hl;!function(e){e.Overview="Overview",e.Pods="Pods",e.Libraries="Libraries"}(Hl||(Hl={}));const zl=[ao.Deployment,ao.StatefulSet,ao.DaemonSet,ao.DeploymentConfig],Wl=[lo.Python,lo.Go],jl=d.div`
385
+ `,Kl=({source:i,fetchSourceLibraries:n})=>{const a=I.useTheme(),[l,s]=t(!1),[c,d]=t(null);return o(()=>{i&&n({variables:{namespace:i.namespace,name:i.name,kind:i.kind}}).then(({data:e})=>{e?.instrumentationInstanceComponents?d(Nt(e.instrumentationInstanceComponents).sort((e,t)=>e.name.localeCompare(t.name))):s(!0)})},[n,i]),c||l?e.createElement(X,{$gap:12},l?e.createElement(we,{$height:"70vh"},e.createElement(De,{subTitle:"Could not fetch libraries for this source"})):c?.length?e.createElement(Y,{title:"Instrumented Libraries"},c.map(({name:t,nonIdentifyingAttributes:o},i)=>e.createElement(r,{key:`library-${t}`},e.createElement(ql,null,e.createElement(T,{size:12,color:a.text.grey},t),e.createElement(ce,{$gap:4},o.map(({key:o,value:i})=>to(i)&&oo(i)&&"is_standard_lib"===o?e.createElement(se,{key:`${t}-${o}`,status:V.Default,title:"STANDARD",withBorder:!0}):null))),i!==c.length-1&&e.createElement(le,{length:"100%",margin:"0"})))):e.createElement(we,{$height:"70vh",$gap:12},e.createElement(De,{title:"No libraries found",subTitle:""}),e.createElement(ie,{type:V.Warning,message:"This feature is in early development, and has very limited support"}))):e.createElement(we,{$height:"70vh"},e.createElement(xt,null))};var Hl;!function(e){e.Overview="Overview",e.Pods="Pods",e.Libraries="Libraries"}(Hl||(Hl={}));const zl=[ao.Deployment,ao.StatefulSet,ao.DaemonSet,ao.DeploymentConfig],Wl=[lo.Python,lo.Go],jl=d.div`
386
386
  width: 100%;
387
387
  height: 100%;
388
388
  max-height: calc(100vh - 220px);
@@ -395,13 +395,13 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
395
395
  `,Bl=({persistSources:i,updateSource:a,restartWorkloads:r,fetchSourceById:s,fetchSourceDescribe:c,fetchSourceLibraries:d})=>{const{isVm:u}=He(),{sources:m}=B(),{selectedStreamName:h}=ze(),{drawerType:g,drawerEntityId:y}=P(),v=l(()=>Ve(m,h),[m,h]),f=n(null),b=g===j.Source,[x,C]=t(!1),[$,k]=t(!1),[S,w]=t(Hl.Overview),[D,N]=t(null);o(()=>{b&&y&&s(y).then(e=>N(e||null))},[b,y]);const{formData:I,handleFormChange:E,resetFormData:O,loadFormWithDrawerItem:M}=io(),A=l(()=>{if(!b)return O();const e=(D&&JSON.stringify(Vt(D))===JSON.stringify(Vt(y))?D:null)||v?.find(e=>e.namespace===y.namespace&&e.name===y.name&&e.kind===y.kind);return e?M(e):O(),e},[b,y,v,D]),F=l(()=>{const e=A?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===pe.Loading,containers:A?.containers||[]}},[A]),R=l(()=>{const e=[{label:Hl.Overview,onClick:()=>w(Hl.Overview),selected:S===Hl.Overview}];return zl.includes(A?.kind)&&e.push({label:Hl.Pods,onClick:()=>w(Hl.Pods),selected:S===Hl.Pods}),A?.containers?.some(({language:e})=>Wl.includes(e))&&e.push({label:Hl.Libraries,onClick:()=>w(Hl.Libraries),selected:S===Hl.Libraries}),e},[S,A]);return A?e.createElement(wi,{ref:f,onClose:()=>{w(Hl.Overview),N(null)},title:A.otelServiceName||A.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:Le(A.containers),isEdit:x,isFormDirty:$,onEdit:S===Hl.Overview?e=>{C("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=I.otelServiceName!==A.name?I.otelServiceName:"";E("otelServiceName",e),await a(y,{...I,otelServiceName:e}),N(null),k(!1),C(!1)},onDelete:S===Hl.Overview?async()=>{const{namespace:e}=A;i({[e]:[{...A,selected:!1,currentStreamName:h}]},{}),N(null),k(!1),C(!1),f.current?.closeDrawer()}:void 0,onCancel:()=>{k(!1),C(!1),E("otelServiceName",A.otelServiceName||A.name||"")},isLastItem:1===v.length,tabs:R,headerActionButtons:[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>r([y]),children:e.createElement(e.Fragment,null,e.createElement(Lo,null),e.createElement(T,{size:14,family:"secondary",decoration:"underline"},"Restart"))}]},S===Hl.Overview?x?e.createElement(jl,null,e.createElement(Rl,{formData:I,handleFormChange:(...e)=>{k(!0),E(...e),E("currentStreamName",h)}})):e.createElement(Vl,null,e.createElement(Ll,{workloadOdigosHealthStatus:A.workloadOdigosHealthStatus}),e.createElement(J,{conditions:A.conditions||[]}),e.createElement(Y,{title:p.SOURCE_DETAILS,data:A?Al(A,u):[]}),e.createElement(Y,{title:u?p.DETECTED_PROCESSES:p.DETECTED_CONTAINERS,titleBadge:F.isLoading?pe.Loading:F.containers.length,description:F.description||(u?p.DETECTED_PROCESSES_DESCRIPTION:p.DETECTED_CONTAINERS_DESCRIPTION)},F.containers.map(t=>e.createElement(no,{key:`source-container-${t.containerName}`,...t,callbackRuntimeOverride:async e=>await a(y,e)})))):S===Hl.Pods?e.createElement(Pl,{source:A,fetchSourceDescribe:c}):e.createElement(Kl,{source:A,fetchSourceLibraries:d})):null},Ul=d.div`
396
396
  max-width: ${({$fullWidth:e})=>e?"unset":"420px"};
397
397
  width: 100%;
398
- `,_l=i(({isModal:t,fetchSingleNamespace:o,onClickSummary:i},n)=>{const l=I.useTheme(),{isVm:r}=He(),s=ro({fetchSingleNamespace:o}),{selectedSources:c,fetchingNamespace:d,selectedAllNamespaces:u,onSelectAllNamespaces:m,getApiSourcesPayload:h,getApiFutureAppsPayload:g,searchText:y,setSearchText:v,searchBy:f,setSearchBy:b,showSelectedOnly:C,setShowSelectedOnly:$,showRunningOnly:k,setShowRunningOnly:w}=s;a(n,()=>({getFormValues:()=>({apps:h(),futureApps:g()})}));const D=Object.values(c).reduce((e,t)=>e+t.filter(e=>e.selected).length,0);return e.createElement(oe,{$isNotModal:!t},e.createElement(X,{$gap:12},e.createElement(X,{$gap:24},i&&e.createElement(ht,{onClick:i}),e.createElement(O,{title:p.SELECT_SOURCES,badgeLabel:D,description:p.SELECT_SOURCES_DESCRIPTION}),e.createElement(ce,{$justifyContent:"space-between"},e.createElement(Ul,{$fullWidth:r},e.createElement(x,{placeholder:f===j.Source?p.SEARCH_SOURCES:p.SEARCH_NAMESPACES,icon:Io,value:y,onChange:e=>v(e.target.value.toLowerCase())})),!r&&e.createElement(E,{options:[{label:p.SOURCE,value:j.Source,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary},{label:p.NAMESPACE,value:j.Namespace,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary}],selected:f,setSelected:b})),e.createElement(ce,{$gap:36},e.createElement(S,{title:p.SELECT_ALL,initialValue:u,onChange:m,disabled:!!d}),e.createElement(S,{title:p.ONLY_SELECTED,initialValue:C,onChange:$}),e.createElement(S,{title:p.ONLY_RUNNING_INSTANCES,initialValue:k,onChange:w}))),e.createElement(le,null),e.createElement(Dl,{isModal:t,...s})))});_l.displayName=_l.name;const Gl=({fetchSingleNamespace:t,persistSources:o})=>{const{currentModal:i,setCurrentModal:a}=Z(),l=i===j.Source,r=()=>{a("")},s=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();o(e,t),r()}},c=n(null);return q({key:"Enter",active:l},s),l?e.createElement(ee,{isOpen:l,onClose:r,header:{title:"Add Source"},actionComponent:e.createElement(te,{buttons:[{label:"DONE",variant:"primary",onClick:s}]})},e.createElement(_l,{ref:c,isModal:!0,fetchSingleNamespace:t})):null},Jl=e=>{const t=[{key:"checkbox-and-icon",title:""},{key:"name",title:p.NAME,sortable:!0},{key:"kind",title:"Kind",sortable:!0}];return e||t.push({key:"namespace",title:p.NAMESPACE,sortable:!0}),t.push({key:"containers",title:p.DETECTED_CONTAINERS}),t.push({key:"conditions",title:"Conditions"}),t.push({key:"throughput",title:"Throughput",sortable:!0}),t},Yl=({metrics:t,maxHeight:o,maxWidth:i})=>{const n=I.useTheme(),{isVm:a}=He(),r=he(),{isThisPending:c}=R(),{selectedStreamName:d}=ze(),{sources:u,sourcesLoading:m}=B(),{setDrawerType:h,setDrawerEntityId:g}=P(),{selectedSources:y,setSelectedSources:f}=jt(),{isAwaitingInstrumentation:b,sourcesToCreate:x,sourcesCreated:C,sourcesToDelete:$,sourcesDeleted:k}=We(),S=l(()=>{const e=(e,t)=>e>0&&Math.floor(100/e*t)||1;return x?e(x,C):$?e($,k):1},[x,C,$,k]),w=l(()=>Ve(u,d),[u,d]),D=l(()=>Ri({instrumentationRules:[],sources:Be(w,r),actions:[],destinations:[],searchText:r.searchText,selectedCategory:j.Source}).searchResults.find(({category:e})=>e===j.Source)?.entities||[],[w,r]),[N,E]=l(()=>{let e=0;return Object.values(y).forEach(t=>{e+=t.length}),[0!==e,e]},[y]),O=s(e=>{if(e){const e={};D.forEach(t=>{const o={namespace:t.namespace,name:t.name,kind:t.kind};c({entityType:j.Source,entityId:o})||(e[t.namespace]?e[t.namespace].push(t):e[t.namespace]=[t])}),f(e)}else f({})},[D]),M=s(e=>{const{namespace:t,name:o,kind:i}=e,n={...y};n[t]||(n[t]=[]);const a=n[t].findIndex(e=>e.name===o&&e.kind===i);-1===a?n[t].push(e):n[t].splice(a,1),f(n)},[y]),A=l(()=>D.map(o=>{const i=Vt(o),a=JSON.stringify(i),{hasErrors:l,hasWarnings:r,hasDisableds:s}=re(o.conditions||[]),d=c({entityType:j.Source,entityId:i}),u=!!y[i.namespace]?.find(e=>e.namespace===i.namespace&&e.name===i.name&&e.kind===i.kind);return{status:l?V.Error:r?V.Warning:void 0,faded:s,onClick:()=>{h(j.Source),g(i)},cells:[{columnKey:"checkbox-and-icon",component:()=>e.createElement(ce,{$gap:16},e.createElement(v,{disabled:d,value:u,onChange:()=>M(o)}),e.createElement(so,{icons:Le(o.containers),id:a}))},{columnKey:"name",value:ve(o,j.Source,{extended:!0})},{columnKey:"kind",value:o.kind,textColor:n.text.info},{columnKey:"namespace",value:o.namespace,textColor:n.text.info},{columnKey:"throughput",value:Oe(Et(t,j.Source,i).throughput),textColor:n.text.info},{columnKey:"conditions",component:()=>e.createElement(Ai,{conditions:o.conditions||[],id:a})},{columnKey:"containers",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:V.Info,title:co(o.containers),withBorder:!0}))}]}}),[D,y,t,M]),{badge:F,badgeTooltip:L}=l(()=>D.length!==w.length?{badge:`${D.length}/${w.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:w.length,badgeTooltip:void 0},[D,w]);return e.createElement(be,{$maxWidth:i},e.createElement(xe,null,e.createElement(v,{partiallyChecked:N&&D?.length!==E,value:N&&D?.length===E,onChange:O,disabled:!D?.length}),e.createElement(Ce,{icon:$e(j.Source),title:p.SOURCES,badge:F,badgeTooltip:L,loading:m||b})),e.createElement(ke,{$maxHeight:o},e.createElement(Se,{columns:Jl(a),rows:A})),b&&!A.length?e.createElement(we,{style:{marginTop:"2rem",gap:"24px"}},e.createElement(Ne,{width:420}),e.createElement(ce,{$gap:16},e.createElement(T,{color:n.text.info},x?"Instrumenting":"Uninstrumenting"," workloads..."),e.createElement(Te,{label:`${S}%`}))):A.length?null:e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(De,null)))},Ql=({expiresAt:t})=>{const o=I.useTheme(),i=Bt().format(t),n=new Date(t).toDateString().split(" ").slice(1).join(" "),a=uo(t,0)?o.text.error:uo(t,6048e5)?o.text.warning:o.text.success;return e.createElement(T,{size:14,color:a},i," (",n,")")},Xl=d.div`
398
+ `,_l=i(({isModal:t,fetchSingleNamespace:o,onClickSummary:i},n)=>{const l=I.useTheme(),{isVm:r}=He(),s=ro({fetchSingleNamespace:o}),{selectedSources:c,fetchingNamespace:d,selectedAllNamespaces:u,onSelectAllNamespaces:m,getApiSourcesPayload:h,getApiFutureAppsPayload:g,searchText:y,setSearchText:v,searchBy:f,setSearchBy:b,showSelectedOnly:C,setShowSelectedOnly:$,showRunningOnly:k,setShowRunningOnly:w}=s;a(n,()=>({getFormValues:()=>({apps:h(),futureApps:g()})}));const D=Object.values(c).reduce((e,t)=>e+t.filter(e=>e.selected).length,0);return e.createElement(oe,{$isNotModal:!t},e.createElement(X,{$gap:12},e.createElement(X,{$gap:24},i&&e.createElement(gt,{onClick:i}),e.createElement(O,{title:p.SELECT_SOURCES,badgeLabel:D,description:p.SELECT_SOURCES_DESCRIPTION}),e.createElement(ce,{$justifyContent:"space-between"},e.createElement(Ul,{$fullWidth:r},e.createElement(x,{placeholder:f===j.Source?p.SEARCH_SOURCES:p.SEARCH_NAMESPACES,icon:Io,value:y,onChange:e=>v(e.target.value.toLowerCase())})),!r&&e.createElement(E,{options:[{label:p.SOURCE,value:j.Source,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary},{label:p.NAMESPACE,value:j.Namespace,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary}],selected:f,setSelected:b})),e.createElement(ce,{$gap:36},e.createElement(S,{title:p.SELECT_ALL,initialValue:u,onChange:m,disabled:!!d}),e.createElement(S,{title:p.ONLY_SELECTED,initialValue:C,onChange:$}),e.createElement(S,{title:p.ONLY_RUNNING_INSTANCES,initialValue:k,onChange:w}))),e.createElement(le,null),e.createElement(Dl,{isModal:t,...s})))});_l.displayName=_l.name;const Gl=({fetchSingleNamespace:t,persistSources:o})=>{const{currentModal:i,setCurrentModal:a}=Z(),l=i===j.Source,r=()=>{a("")},s=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();o(e,t),r()}},c=n(null);return q({key:"Enter",active:l},s),l?e.createElement(ee,{isOpen:l,onClose:r,header:{title:"Add Source"},actionComponent:e.createElement(te,{buttons:[{label:"DONE",variant:"primary",onClick:s}]})},e.createElement(_l,{ref:c,isModal:!0,fetchSingleNamespace:t})):null},Jl=e=>{const t=[{key:"checkbox-and-icon",title:""},{key:"name",title:p.NAME,sortable:!0},{key:"kind",title:"Kind",sortable:!0}];return e||t.push({key:"namespace",title:p.NAMESPACE,sortable:!0}),t.push({key:"containers",title:p.DETECTED_CONTAINERS}),t.push({key:"conditions",title:"Conditions"}),t.push({key:"throughput",title:"Throughput",sortable:!0}),t},Yl=({metrics:t,maxHeight:o,maxWidth:i})=>{const n=I.useTheme(),{isVm:a}=He(),r=he(),{isThisPending:c}=R(),{selectedStreamName:d}=ze(),{sources:u,sourcesLoading:m}=B(),{setDrawerType:h,setDrawerEntityId:g}=P(),{selectedSources:y,setSelectedSources:f}=jt(),{isAwaitingInstrumentation:b,sourcesToCreate:x,sourcesCreated:C,sourcesToDelete:$,sourcesDeleted:k}=We(),S=l(()=>{const e=(e,t)=>e>0&&Math.floor(100/e*t)||1;return x?e(x,C):$?e($,k):1},[x,C,$,k]),w=l(()=>Ve(u,d),[u,d]),D=l(()=>Ri({instrumentationRules:[],sources:Be(w,r),actions:[],destinations:[],searchText:r.searchText,selectedCategory:j.Source}).searchResults.find(({category:e})=>e===j.Source)?.entities||[],[w,r]),[N,E]=l(()=>{let e=0;return Object.values(y).forEach(t=>{e+=t.length}),[0!==e,e]},[y]),O=s(e=>{if(e){const e={};D.forEach(t=>{const o={namespace:t.namespace,name:t.name,kind:t.kind};c({entityType:j.Source,entityId:o})||(e[t.namespace]?e[t.namespace].push(t):e[t.namespace]=[t])}),f(e)}else f({})},[D]),M=s(e=>{const{namespace:t,name:o,kind:i}=e,n={...y};n[t]||(n[t]=[]);const a=n[t].findIndex(e=>e.name===o&&e.kind===i);-1===a?n[t].push(e):n[t].splice(a,1),f(n)},[y]),A=l(()=>D.map(o=>{const i=Vt(o),a=JSON.stringify(i),{hasErrors:l,hasWarnings:r,hasDisableds:s}=re(o.conditions||[]),d=c({entityType:j.Source,entityId:i}),u=!!y[i.namespace]?.find(e=>e.namespace===i.namespace&&e.name===i.name&&e.kind===i.kind);return{status:l?V.Error:r?V.Warning:void 0,faded:s,onClick:()=>{h(j.Source),g(i)},cells:[{columnKey:"checkbox-and-icon",component:()=>e.createElement(ce,{$gap:16},e.createElement(v,{disabled:d,value:u,onChange:()=>M(o)}),e.createElement(so,{icons:Le(o.containers),id:a}))},{columnKey:"name",value:ve(o,j.Source,{extended:!0})},{columnKey:"kind",value:o.kind,textColor:n.text.info},{columnKey:"namespace",value:o.namespace,textColor:n.text.info},{columnKey:"throughput",value:Oe(Et(t,j.Source,i).throughput),textColor:n.text.info},{columnKey:"conditions",component:()=>e.createElement(Ai,{conditions:o.conditions||[],id:a})},{columnKey:"containers",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:V.Info,title:co(o.containers),withBorder:!0}))}]}}),[D,y,t,M]),{badge:F,badgeTooltip:L}=l(()=>D.length!==w.length?{badge:`${D.length}/${w.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:w.length,badgeTooltip:void 0},[D,w]);return e.createElement(be,{$maxWidth:i},e.createElement(xe,null,e.createElement(v,{partiallyChecked:N&&D?.length!==E,value:N&&D?.length===E,onChange:O,disabled:!D?.length}),e.createElement(Ce,{icon:$e(j.Source),title:p.SOURCES,badge:F,badgeTooltip:L,loading:m||b})),e.createElement(ke,{$maxHeight:o},e.createElement(Se,{columns:Jl(a),rows:A})),b&&!A.length?e.createElement(we,{style:{marginTop:"2rem",gap:"24px"}},e.createElement(Ne,{width:420}),e.createElement(ce,{$gap:16},e.createElement(T,{color:n.text.info},x?"Instrumenting":"Uninstrumenting"," workloads..."),e.createElement(Te,{label:`${S}%`}))):A.length?null:e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(De,null)))},Ql=({expiresAt:t})=>{const o=I.useTheme(),i=Bt().format(t),n=new Date(t).toDateString().split(" ").slice(1).join(" "),a=uo(t,0)?o.text.error:uo(t,6048e5)?o.text.warning:o.text.success;return e.createElement(T,{size:14,color:a},i," (",n,")")},Xl=d.div`
399
399
  position: relative;
400
- `,Zl=({token:o,saveToken:i})=>{const n=I.useTheme(),{isCopied:a,clickCopy:l}=po(),{formData:r,handleFormChange:s,resetFormData:c}=mo({token:o}),[d,u]=t(!1),p=()=>{u(!1),c()},m=me(V.Success,n);return e.createElement(ce,{$gap:0},e.createElement(ut,{size:32,onClick:()=>l(o)},a?e.createElement(m,null):e.createElement(Uo,null)),e.createElement(le,{orientation:"vertical",length:"12px"}),e.createElement(Xl,null,e.createElement(ut,{size:32,onClick:()=>{u(!0)}},e.createElement(Do,null)),d&&e.createElement(ho,{flipX:!0,clientX:36,isOpen:d,onClose:p,onSave:()=>{i(r.token).then(p)},title:"Enter a new API Token",titleTooltip:"Contact us to generate a new one"},e.createElement(x,{placeholder:"API Token",type:"password",value:r.token,onChange:e=>s("token",e.target.value)}))))},er=({tokens:t,saveToken:o})=>e.createElement(Y,{title:"Authorization Tokens",titleBadge:t.length,data:[{type:m.Table,value:{columns:[{key:"icon",title:""},{key:"name",title:"Name"},{key:"expires_at",title:"Expires"},{key:"token",title:"Token"},{key:"actions",title:""}],rows:t.map(({name:t,token:i,expiresAt:n})=>({cells:[{columnKey:"icon",icon:_o},{columnKey:"name",value:t},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>e.createElement(Ql,{expiresAt:n})},{columnKey:"actions",component:()=>e.createElement(Zl,{token:i,saveToken:o})}]}))}}]}),tr=({fetchDescribeOdigos:i})=>{const[n,a]=t(null);if(o(()=>{i().then(({data:e})=>{a(e?.describeOdigos||null)})},[i]),!n)return e.createElement(we,null,e.createElement(bt,null));const l=t=>t?.name?[e.createElement(le,{key:`divider-${t.name}`}),e.createElement(Zt,{key:`describe-row-${t.name}`,title:t.name,subTitle:t.explain||void 0,value:{status:t.status||(to(t.value)?oo(t.value)?V.Success:V.Error:V.Default),text:t.value}})]:[];return e.createElement(e.Fragment,null,e.createElement(Y,{title:"General Information",withExtend:!0,initialExtended:!0,data:[{title:n?.odigosVersion?.name,value:n?.odigosVersion?.value},{title:n?.kubernetesVersion?.name,value:n?.kubernetesVersion?.value},{title:n?.installationMethod?.name,value:n?.installationMethod?.value},{title:n?.tier?.name,value:n?.tier?.value},{title:"# of sources",value:n?.numberOfSources?.toString()},{title:"# of destinations",value:n?.numberOfDestinations?.toString()}]}),e.createElement(Y,{title:"Cluster Collector",withExtend:!0},Object.values(n?.clusterCollector||{}).map(l)),e.createElement(Y,{title:"Node Collector",withExtend:!0},Object.values(n?.nodeCollector||{}).map(l)))},or=d.div`
400
+ `,Zl=({token:o,saveToken:i})=>{const n=I.useTheme(),{isCopied:a,clickCopy:l}=po(),{formData:r,handleFormChange:s,resetFormData:c}=mo({token:o}),[d,u]=t(!1),p=()=>{u(!1),c()},m=me(V.Success,n);return e.createElement(ce,{$gap:0},e.createElement(pt,{size:32,onClick:()=>l(o)},a?e.createElement(m,null):e.createElement(Uo,null)),e.createElement(le,{orientation:"vertical",length:"12px"}),e.createElement(Xl,null,e.createElement(pt,{size:32,onClick:()=>{u(!0)}},e.createElement(Do,null)),d&&e.createElement(ho,{flipX:!0,clientX:36,isOpen:d,onClose:p,onSave:()=>{i(r.token).then(p)},title:"Enter a new API Token",titleTooltip:"Contact us to generate a new one"},e.createElement(x,{placeholder:"API Token",type:"password",value:r.token,onChange:e=>s("token",e.target.value)}))))},er=({tokens:t,saveToken:o})=>e.createElement(Y,{title:"Authorization Tokens",titleBadge:t.length,data:[{type:m.Table,value:{columns:[{key:"icon",title:""},{key:"name",title:"Name"},{key:"expires_at",title:"Expires"},{key:"token",title:"Token"},{key:"actions",title:""}],rows:t.map(({name:t,token:i,expiresAt:n})=>({cells:[{columnKey:"icon",icon:_o},{columnKey:"name",value:t},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>e.createElement(Ql,{expiresAt:n})},{columnKey:"actions",component:()=>e.createElement(Zl,{token:i,saveToken:o})}]}))}}]}),tr=({fetchDescribeOdigos:i})=>{const[n,a]=t(null);if(o(()=>{i().then(({data:e})=>{a(e?.describeOdigos||null)})},[i]),!n)return e.createElement(we,null,e.createElement(xt,null));const l=t=>t?.name?[e.createElement(le,{key:`divider-${t.name}`}),e.createElement(Zt,{key:`describe-row-${t.name}`,title:t.name,subTitle:t.explain||void 0,value:{status:t.status||(to(t.value)?oo(t.value)?V.Success:V.Error:V.Default),text:t.value}})]:[];return e.createElement(e.Fragment,null,e.createElement(Y,{title:"General Information",withExtend:!0,initialExtended:!0,data:[{title:n?.odigosVersion?.name,value:n?.odigosVersion?.value},{title:n?.kubernetesVersion?.name,value:n?.kubernetesVersion?.value},{title:n?.installationMethod?.name,value:n?.installationMethod?.value},{title:n?.tier?.name,value:n?.tier?.value},{title:"# of sources",value:n?.numberOfSources?.toString()},{title:"# of destinations",value:n?.numberOfDestinations?.toString()}]}),e.createElement(Y,{title:"Cluster Collector",withExtend:!0},Object.values(n?.clusterCollector||{}).map(l)),e.createElement(Y,{title:"Node Collector",withExtend:!0},Object.values(n?.nodeCollector||{}).map(l)))},or=d.div`
401
401
  display: flex;
402
402
  flex-direction: column;
403
403
  gap: 12px;
404
- `,ir="System Overview",nr=({tokens:o,saveToken:i,fetchDescribeOdigos:n})=>{const[a,l]=t(!1),r=()=>l(e=>!e);return e.createElement(e.Fragment,null,e.createElement(ut,{key:ir,onClick:r,tooltip:ir},e.createElement(Go,{size:18})),e.createElement(H,{width:"750px",isOpen:a,onClose:r,header:{icons:[Go],title:ir},footer:{isOpen:!1}},e.createElement(or,null,!!o?.length&&e.createElement(er,{tokens:o,saveToken:i}),e.createElement(tr,{fetchDescribeOdigos:n}))))};var ar;!function(e){e.General="General",e.Ui="UI",e.Rollback="Rollback",e.CollectorNode="Collector Node",e.CollectorGateway="Collector Gateway"}(ar||(ar={}));const lr=d.div`
404
+ `,ir="System Overview",nr=({tokens:o,saveToken:i,fetchDescribeOdigos:n})=>{const[a,l]=t(!1),r=()=>l(e=>!e);return e.createElement(e.Fragment,null,e.createElement(pt,{key:ir,onClick:r,tooltip:ir},e.createElement(Go,{size:18})),e.createElement(H,{width:"750px",isOpen:a,onClose:r,header:{icons:[Go],title:ir},footer:{isOpen:!1}},e.createElement(or,null,!!o?.length&&e.createElement(er,{tokens:o,saveToken:i}),e.createElement(tr,{fetchDescribeOdigos:n}))))};var ar;!function(e){e.General="General",e.Ui="UI",e.Rollback="Rollback",e.CollectorNode="Collector Node",e.CollectorGateway="Collector Gateway"}(ar||(ar={}));const lr=d.div`
405
405
  align-self: stretch;
406
406
  display: flex;
407
407
  flex-direction: column;
@@ -428,7 +428,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
428
428
  overflow-y: auto;
429
429
  `,fr=d.div`
430
430
  position: relative;
431
- `,br="System Settings",xr=({installationMethod:i,fetchSettings:a,onSave:l})=>{const[r,s]=t(void 0),[c,d]=t(!1),[u,p]=t(!1),[m,h]=t(!1),g=()=>h(e=>!e),{popupRef:y,popupOpen:v,setPopupOpen:f}=Ye(),{formData:b,handleFormChange:x,resetFormData:C,isFormDirty:$}=mo(r);o(()=>{m?a().then(s):s(void 0)},[m]);const[k,w]=t(!1),[D,N]=t(null),I=e=>{$?(w(!0),N(()=>e)):e()},[E,O]=t(ar.General),M=n(null),A=n(null),F=n(null),R=n(null),L=n(null),P=n(null),q=[A,F,R,L,P],z=[ar.General,ar.Ui,ar.Rollback,ar.CollectorNode,ar.CollectorGateway];return e.createElement(e.Fragment,null,e.createElement(ut,{key:br,onClick:g,tooltip:br},e.createElement(Jo,{size:18})),e.createElement(H,{width:"750px",isOpen:m,onClose:()=>I(g),header:{icons:[Jo],title:br,tabs:z.map(e=>({label:e,onClick:()=>(e=>{O(e),(e=>{const t=M.current;if(!t)return;let o=0;for(let i=0;i<q.length;i++){const n=q[i].current;if(n&&n.id===e){const e=t.getBoundingClientRect();o=n.getBoundingClientRect().top-e.top+t.scrollTop;break}}t.scrollTo({top:e===ar.General?0:o,behavior:"smooth"})})(e)})(e),selected:E===e})),actions:[e.createElement(fr,{key:"actions"},e.createElement(ut,{withBorder:!0,onClick:()=>f(e=>!e)},e.createElement(T,{size:10},"•••")),e.createElement(Qe,{ref:y,isOpen:v,top:36,right:0,padding:"24px",width:"270px"},e.createElement(S,{title:"Enable Advanced Mode",tooltip:"Show advanced settings. Note: these are not recommended to be changed unless you know what you are doing.",initialValue:u,onChange:()=>p(e=>!e),flipHorizontally:!0})))]},footer:{isOpen:$,centerButtons:[{"data-id":"drawer-cancel",variant:"secondary",onClick:()=>I(C),children:K.CANCEL},{"data-id":"drawer-save",variant:"primary",onClick:async()=>{d(!0),await l(b),s(await a()),d(!1),C(),g()},children:K.SAVE}]}},void 0===b?.imagePrefix||c?e.createElement(we,null,e.createElement(bt,{scale:1.2})):e.createElement(vr,{ref:M},i===fo.Helm&&e.createElement(ie,{type:V.Warning,title:"Helm",message:"Changes won't persist unless you update the `values.yaml` file"}),e.createElement(mr,{ref:A,isAdvanced:u,formData:b,handleFormChange:x}),e.createElement(cr,{ref:F,isAdvanced:u,formData:b,handleFormChange:x}),e.createElement(hr,{ref:R,isAdvanced:u,formData:b,handleFormChange:x}),e.createElement(gr,{ref:L,isAdvanced:u,formData:b,handleFormChange:x}),e.createElement(yr,{ref:P,isAdvanced:u,formData:b,handleFormChange:x}))),e.createElement(W,{isOpen:k,name:br,onApprove:()=>{D?.(),w(!1)},onDeny:()=>{w(!1)}}))},Cr=d.div`
431
+ `,br="System Settings",xr=({installationMethod:i,fetchSettings:a,onSave:l})=>{const[r,s]=t(void 0),[c,d]=t(!1),[u,p]=t(!1),[m,h]=t(!1),g=()=>h(e=>!e),{popupRef:y,popupOpen:v,setPopupOpen:f}=Ye(),{formData:b,handleFormChange:x,resetFormData:C,isFormDirty:$}=mo(r);o(()=>{m?a().then(s):s(void 0)},[m]);const[k,w]=t(!1),[D,N]=t(null),I=e=>{$?(w(!0),N(()=>e)):e()},[E,O]=t(ar.General),M=n(null),A=n(null),F=n(null),R=n(null),L=n(null),P=n(null),q=[A,F,R,L,P],z=[ar.General,ar.Ui,ar.Rollback,ar.CollectorNode,ar.CollectorGateway];return e.createElement(e.Fragment,null,e.createElement(pt,{key:br,onClick:g,tooltip:br},e.createElement(Jo,{size:18})),e.createElement(H,{width:"750px",isOpen:m,onClose:()=>I(g),header:{icons:[Jo],title:br,tabs:z.map(e=>({label:e,onClick:()=>(e=>{O(e),(e=>{const t=M.current;if(!t)return;let o=0;for(let i=0;i<q.length;i++){const n=q[i].current;if(n&&n.id===e){const e=t.getBoundingClientRect();o=n.getBoundingClientRect().top-e.top+t.scrollTop;break}}t.scrollTo({top:e===ar.General?0:o,behavior:"smooth"})})(e)})(e),selected:E===e})),actions:[e.createElement(fr,{key:"actions"},e.createElement(pt,{withBorder:!0,onClick:()=>f(e=>!e)},e.createElement(T,{size:10},"•••")),e.createElement(Qe,{ref:y,isOpen:v,top:36,right:0,padding:"24px",width:"270px"},e.createElement(S,{title:"Enable Advanced Mode",tooltip:"Show advanced settings. Note: these are not recommended to be changed unless you know what you are doing.",initialValue:u,onChange:()=>p(e=>!e),flipHorizontally:!0})))]},footer:{isOpen:$,centerButtons:[{"data-id":"drawer-cancel",variant:"secondary",onClick:()=>I(C),children:K.CANCEL},{"data-id":"drawer-save",variant:"primary",onClick:async()=>{d(!0),await l(b),s(await a()),d(!1),C(),g()},children:K.SAVE}]}},void 0===b?.imagePrefix||c?e.createElement(we,null,e.createElement(xt,{scale:1.2})):e.createElement(vr,{ref:M},i===fo.Helm&&e.createElement(ie,{type:V.Warning,title:"Helm",message:"Changes won't persist unless you update the `values.yaml` file"}),e.createElement(mr,{ref:A,isAdvanced:u,formData:b,handleFormChange:x}),e.createElement(cr,{ref:F,isAdvanced:u,formData:b,handleFormChange:x}),e.createElement(hr,{ref:R,isAdvanced:u,formData:b,handleFormChange:x}),e.createElement(gr,{ref:L,isAdvanced:u,formData:b,handleFormChange:x}),e.createElement(yr,{ref:P,isAdvanced:u,formData:b,handleFormChange:x}))),e.createElement(W,{isOpen:k,name:br,onApprove:()=>{D?.(),w(!1)},onDeny:()=>{w(!1)}}))},Cr=d.div`
432
432
  position: fixed;
433
433
  bottom: 12px;
434
434
  left: 12px;
@@ -507,7 +507,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
507
507
  color: ${({theme:e})=>e.text.darker_grey};
508
508
  font-family: ${({theme:e})=>e.font_family.secondary};
509
509
  white-space: nowrap;
510
- `,zr=({span:o,depth:i,indexInMatrix:n,maxDuration:a,minStartTime:l,maxEndTime:r,withErrors:s,errorTooltip:c,isOpen:d,withToggle:u,onToggleOpen:p,onSelect:m})=>{const h=I.useTheme(),[g,y]=t(!1),v=Fr-12*i-20-(s?12:0),f=s&&(1===i||o.logs.length>0);return e.createElement(Lr,{className:"span-container",$withErrors:s,$preventHover:g,onClick:m},e.createElement(Pr,{$depth:i,className:"span-left"},e.createElement(ce,{$gap:4,$alignItems:"center"},u?e.createElement("div",{onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1)},e.createElement(ut,{onClick:e=>{e.stopPropagation(),p?.()},size:24},e.createElement(pt,{extend:d??!1}))):e.createElement("div",{style:{width:"24px"}}),e.createElement(ko,{maxWidth:v/2,text:o.processID,textSize:14}),e.createElement(T,{size:12,color:h.text.darker_grey},"•"),e.createElement(ko,{maxWidth:v/2,text:o.operationName,textSize:12,textColor:h.text.darker_grey})),s&&(f?e.createElement(ue,{...c},e.createElement(Xo,{fill:h.text.error})):e.createElement("div",{style:{position:"relative"}},e.createElement("div",{style:{position:"absolute",top:"-24px",right:"8px"}},e.createElement(le,{type:V.Error,orientation:"vertical",thickness:1,length:"48px",margin:"0",opacity:.5}))))),e.createElement(qr,{className:"span-right"},e.createElement(Kr,{$indexInMatrix:n,$duration:o.duration,$maxDuration:a,$startTime:o.startTime,$minStartTime:l,$maxEndTime:r},e.createElement(Hr,null,xo(o.duration)))))},Wr=({spans:t,logs:o,depth:i,indexInMatrix:n,maxDuration:a,minStartTime:l,maxEndTime:r,openSpanIdsState:s,selectedSpanState:c})=>{const d=I.useTheme();return t.map((t,u)=>{const p=t.spanID,m=s.value.includes(p),h=!!t.spans?.length,g=o.length?o:$o(t,"spans","logs"),y=g.length>0,v=y?g.length>1?`(${g.length}) errors`:g[0].fields.find(e=>"exception.message"===e.key)?.value:void 0,f=y?g.length>1?void 0:g[0].fields.find(e=>"exception.stacktrace"===e.key)?.value:void 0;return e.createElement("div",{key:`span-${p}`,style:{borderBottom:1===i?`1px dotted ${d.colors.border}`:"none"}},e.createElement(zr,{span:t,depth:i,indexInMatrix:n+u+i,maxDuration:a,minStartTime:l,maxEndTime:r,withErrors:y,errorTooltip:{titleIcon:Xo,title:v,text:f},isOpen:m,withToggle:h,onToggleOpen:()=>s.set(e=>e.some(e=>e===p)?e.filter(e=>e!=p):[...e,p,...$o(t,"spans","spanID")]),onSelect:()=>c.set(e=>e?.spanID===p?null:t)}),m&&h?e.createElement(Wr,{spans:t.spans||[],logs:g,depth:i+1,indexInMatrix:n+u,maxDuration:a,minStartTime:l,maxEndTime:r,openSpanIdsState:s,selectedSpanState:c}):null)})},jr=d.div`
510
+ `,zr=({span:o,depth:i,indexInMatrix:n,maxDuration:a,minStartTime:l,maxEndTime:r,withErrors:s,errorTooltip:c,isOpen:d,withToggle:u,onToggleOpen:p,onSelect:m})=>{const h=I.useTheme(),[g,y]=t(!1),v=Fr-12*i-20-(s?12:0),f=s&&(1===i||o.logs.length>0);return e.createElement(Lr,{className:"span-container",$withErrors:s,$preventHover:g,onClick:m},e.createElement(Pr,{$depth:i,className:"span-left"},e.createElement(ce,{$gap:4,$alignItems:"center"},u?e.createElement("div",{onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1)},e.createElement(pt,{onClick:e=>{e.stopPropagation(),p?.()},size:24},e.createElement(mt,{extend:d??!1}))):e.createElement("div",{style:{width:"24px"}}),e.createElement(ko,{maxWidth:v/2,text:o.processID,textSize:14}),e.createElement(T,{size:12,color:h.text.darker_grey},"•"),e.createElement(ko,{maxWidth:v/2,text:o.operationName,textSize:12,textColor:h.text.darker_grey})),s&&(f?e.createElement(ue,{...c},e.createElement(Xo,{fill:h.text.error})):e.createElement("div",{style:{position:"relative"}},e.createElement("div",{style:{position:"absolute",top:"-24px",right:"8px"}},e.createElement(le,{type:V.Error,orientation:"vertical",thickness:1,length:"48px",margin:"0",opacity:.5}))))),e.createElement(qr,{className:"span-right"},e.createElement(Kr,{$indexInMatrix:n,$duration:o.duration,$maxDuration:a,$startTime:o.startTime,$minStartTime:l,$maxEndTime:r},e.createElement(Hr,null,xo(o.duration)))))},Wr=({spans:t,logs:o,depth:i,indexInMatrix:n,maxDuration:a,minStartTime:l,maxEndTime:r,openSpanIdsState:s,selectedSpanState:c})=>{const d=I.useTheme();return t.map((t,u)=>{const p=t.spanID,m=s.value.includes(p),h=!!t.spans?.length,g=o.length?o:$o(t,"spans","logs"),y=g.length>0,v=y?g.length>1?`(${g.length}) errors`:g[0].fields.find(e=>"exception.message"===e.key)?.value:void 0,f=y?g.length>1?void 0:g[0].fields.find(e=>"exception.stacktrace"===e.key)?.value:void 0;return e.createElement("div",{key:`span-${p}`,style:{borderBottom:1===i?`1px dotted ${d.colors.border}`:"none"}},e.createElement(zr,{span:t,depth:i,indexInMatrix:n+u+i,maxDuration:a,minStartTime:l,maxEndTime:r,withErrors:y,errorTooltip:{titleIcon:Xo,title:v,text:f},isOpen:m,withToggle:h,onToggleOpen:()=>s.set(e=>e.some(e=>e===p)?e.filter(e=>e!=p):[...e,p,...$o(t,"spans","spanID")]),onSelect:()=>c.set(e=>e?.spanID===p?null:t)}),m&&h?e.createElement(Wr,{spans:t.spans||[],logs:g,depth:i+1,indexInMatrix:n+u,maxDuration:a,minStartTime:l,maxEndTime:r,openSpanIdsState:s,selectedSpanState:c}):null)})},jr=d.div`
511
511
  width: 100%;
512
512
  `,Vr=d.div`
513
513
  max-height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
@@ -537,4 +537,4 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
537
537
  padding-top: 12px;
538
538
  padding-left: 12px;
539
539
  white-space: nowrap;
540
- `,Gr=({heightToRemove:o,traces:i,isLoading:n})=>{const[a,r]=t([]),[s,c]=t(null),d=l(()=>Nt(i).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:Nr(e)})),[i]),u=l(()=>d.reduce((e,t)=>Math.max(e,t.spans.reduce((e,t)=>e+t.duration,0)),0),[d]),m=l(()=>{const e=d.find(e=>e.spans.some(e=>e.spanID===s?.spanID)),t=e?.processes.find(e=>e.serviceName===s?.processID);return t},[d,s]);return e.createElement(e.Fragment,null,e.createElement(jr,{$heightToRemove:o},n?e.createElement(we,{$height:"50vh"},e.createElement(bt,{scale:1.5})):d.length?e.createElement(Vr,{$heightToRemove:o},e.createElement(Br,null,e.createElement(T,null,"Service & operation")),new Array(5).fill(null).map((t,i)=>e.createElement(Ur,{key:`${i}-divider`,$heightToRemove:o,index:i},e.createElement(_r,null,xo(u/5*i)))),d.map((t,o)=>{const{spans:i}=t,n=i.reduce((e,t)=>Math.min(e,t.startTime),Number.MAX_SAFE_INTEGER),l=i.reduce((e,t)=>Math.max(e,t.startTime+t.duration),0);return e.createElement(Wr,{key:`recursive-spans-${t.traceID}`,spans:i,logs:[],depth:1,indexInMatrix:o,maxDuration:u,minStartTime:n,maxEndTime:l,openSpanIdsState:{value:a,set:r},selectedSpanState:{value:s,set:c}})})):e.createElement(we,{$height:"50vh"},e.createElement(De,{title:p.NO_TRACES_FOUND,subTitle:p.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}))),s&&e.createElement(Ar,{span:s,process:m,onClose:()=>c(null)}))};export{Ii as ActionDrawer,Si as ActionForm,Oi as ActionModal,Pi as ActionTable,Wi as AwaitPipeline,vn as ConditionDropdown,pn as DataFlow,Wn as DataFlowActionsMenu,Mn as DataStreamDrawer,En as DataStreamForm,Vn as DataStreamModal,jn as DataStreamSelectionForm,ia as DestinationDrawer,ea as DestinationForm,$a as DestinationModal,Na as DestinationSelectionForm,Ia as DestinationTable,fn as ErrorDropdown,Ba as InstrumentationRuleDrawer,Wa as InstrumentationRuleForm,Ga as InstrumentationRuleModal,Qa as InstrumentationRuleTable,$n as KindDropdown,bn as LanguageDropdown,xn as MonitorDropdown,Za as MultiSourceControl,Cn as NamespaceDropdown,El as NavIconIds,al as NotificationManager,wi as OverviewDrawer,yl as ServiceMap,Il as SetupSummary,Ol as SideNav,Ml as SlackInvite,Bl as SourceDrawer,Rl as SourceForm,Gl as SourceModal,_l as SourceSelectionForm,Yl as SourceTable,nr as SystemOverview,xr as SystemSettings,Ai as TableCellConditions,$r as ToastList,Dr as ToggleDarkMode,Gr as TraceView};
540
+ `,Gr=({heightToRemove:o,traces:i,isLoading:n})=>{const[a,r]=t([]),[s,c]=t(null),d=l(()=>Nt(i).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:Nr(e)})),[i]),u=l(()=>d.reduce((e,t)=>Math.max(e,t.spans.reduce((e,t)=>e+t.duration,0)),0),[d]),m=l(()=>{const e=d.find(e=>e.spans.some(e=>e.spanID===s?.spanID)),t=e?.processes.find(e=>e.serviceName===s?.processID);return t},[d,s]);return e.createElement(e.Fragment,null,e.createElement(jr,{$heightToRemove:o},n?e.createElement(we,{$height:"50vh"},e.createElement(xt,{scale:1.5})):d.length?e.createElement(Vr,{$heightToRemove:o},e.createElement(Br,null,e.createElement(T,null,"Service & operation")),new Array(5).fill(null).map((t,i)=>e.createElement(Ur,{key:`${i}-divider`,$heightToRemove:o,index:i},e.createElement(_r,null,xo(u/5*i)))),d.map((t,o)=>{const{spans:i}=t,n=i.reduce((e,t)=>Math.min(e,t.startTime),Number.MAX_SAFE_INTEGER),l=i.reduce((e,t)=>Math.max(e,t.startTime+t.duration),0);return e.createElement(Wr,{key:`recursive-spans-${t.traceID}`,spans:i,logs:[],depth:1,indexInMatrix:o,maxDuration:u,minStartTime:n,maxEndTime:l,openSpanIdsState:{value:a,set:r},selectedSpanState:{value:s,set:c}})})):e.createElement(we,{$height:"50vh"},e.createElement(De,{title:p.NO_TRACES_FOUND,subTitle:p.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}))),s&&e.createElement(Ar,{span:s,process:m,onClose:()=>c(null)}))};export{Ii as ActionDrawer,Si as ActionForm,Oi as ActionModal,Pi as ActionTable,Wi as AwaitPipeline,vn as ConditionDropdown,pn as DataFlow,Wn as DataFlowActionsMenu,Mn as DataStreamDrawer,En as DataStreamForm,Vn as DataStreamModal,jn as DataStreamSelectionForm,ia as DestinationDrawer,ea as DestinationForm,$a as DestinationModal,Na as DestinationSelectionForm,Ia as DestinationTable,fn as ErrorDropdown,Ba as InstrumentationRuleDrawer,Wa as InstrumentationRuleForm,Ga as InstrumentationRuleModal,Qa as InstrumentationRuleTable,$n as KindDropdown,bn as LanguageDropdown,xn as MonitorDropdown,Za as MultiSourceControl,Cn as NamespaceDropdown,El as NavIconIds,al as NotificationManager,wi as OverviewDrawer,yl as ServiceMap,Il as SetupSummary,Ol as SideNav,Ml as SlackInvite,Bl as SourceDrawer,Rl as SourceForm,Gl as SourceModal,_l as SourceSelectionForm,Yl as SourceTable,nr as SystemOverview,xr as SystemSettings,Ai as TableCellConditions,$r as ToastList,Dr as ToggleDarkMode,Gr as TraceView};
package/lib/functions.js CHANGED
@@ -1 +1 @@
1
- export{b2 as capitalizeFirstLetter,c2 as cleanObjectEmptyStringsValues,aX as compareCondition,b5 as deepClone,a3 as filterActions,az as filterDestinations,ay as filterDestinationsByStream,ax as filterSources,aw as filterSourcesByStream,c3 as flattenObjectKeys,aj as formatBytes,bP as formatDuration,z as getActionIcon,X as getConditionsBooleans,ao as getContainersIcons,bF as getContainersInstrumentedCount,ar as getDestinationIcon,aa as getEntityIcon,aG as getEntityId,a5 as getEntityLabel,c4 as getIdFromSseTarget,an as getInstrumentationRuleIcon,c5 as getMainContainerLanguage,b8 as getMetricForEntity,c6 as getMonitorIcon,c7 as getPlatformIcon,c8 as getPlatformLabel,bh as getProgrammingLanguageIcon,bR as getRecursiveValues,c9 as getSseTargetFromId,a1 as getStatusIcon,bs as getStatusTypeFromOdigosHealth,ap as getValueForRange,bm as getWorkloadId,b0 as getYamlFieldsForDestination,bt as hasUnhealthyInstances,i as isEmpty,ca as isLegalK8sLabel,bG as isOverTime,bx as isStringABoolean,cb as isTimeElapsed,cc as isValidVersion,_ as mapConditions,aW as mapDestinationFieldsForDisplay,aq as mapExportedSignals,cd as numbersOnly,by as parseBooleanFromString,ce as parseJsonStringToPrettyString,cf as removeEmptyValuesFromObject,aY as safeJsonParse,cg as safeJsonStringify,ah as sleep,aI as splitCamelString,ch as stringifyNonStringValues}from"./chunks/ui-components-3c494332.js";import"./icons.js";import"react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-1dea551d.js";import"styled-components";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
1
+ export{b2 as capitalizeFirstLetter,c2 as cleanObjectEmptyStringsValues,aY as compareCondition,b5 as deepClone,a3 as filterActions,az as filterDestinations,ay as filterDestinationsByStream,ax as filterSources,aw as filterSourcesByStream,c3 as flattenObjectKeys,aj as formatBytes,bP as formatDuration,z as getActionIcon,X as getConditionsBooleans,ao as getContainersIcons,bF as getContainersInstrumentedCount,ar as getDestinationIcon,aa as getEntityIcon,aG as getEntityId,a5 as getEntityLabel,c4 as getIdFromSseTarget,an as getInstrumentationRuleIcon,c5 as getMainContainerLanguage,b8 as getMetricForEntity,c6 as getMonitorIcon,c7 as getPlatformIcon,c8 as getPlatformLabel,bh as getProgrammingLanguageIcon,bR as getRecursiveValues,c9 as getSseTargetFromId,a1 as getStatusIcon,bs as getStatusTypeFromOdigosHealth,ap as getValueForRange,bm as getWorkloadId,b1 as getYamlFieldsForDestination,bt as hasUnhealthyInstances,i as isEmpty,ca as isLegalK8sLabel,bG as isOverTime,bx as isStringABoolean,cb as isTimeElapsed,cc as isValidVersion,_ as mapConditions,aX as mapDestinationFieldsForDisplay,aq as mapExportedSignals,cd as numbersOnly,by as parseBooleanFromString,ce as parseJsonStringToPrettyString,cf as removeEmptyValuesFromObject,aZ as safeJsonParse,cg as safeJsonStringify,ah as sleep,aI as splitCamelString,ch as stringifyNonStringValues}from"./chunks/ui-components-16ba4841.js";import"./icons.js";import"react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-1dea551d.js";import"styled-components";import"react-dom";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
package/lib/hooks.js CHANGED
@@ -1 +1 @@
1
- export{x as useActionFormData,cl as useBodyScroll,aB as useClickNode,bo as useClickNotification,as as useConnection,av as useContainerSize,bH as useCopy,aP as useDataStreamFormData,a$ as useDestinationFormData,bI as useGenericForm,bi as useInstrumentationRuleFormData,q as useKeyDown,aH as useOnClickOutside,aC as usePopup,aO as useSessionStorage,bz as useSourceFormData,bD as useSourceSelectionFormData,bn as useTimeAgo,bk as useTransition}from"./chunks/ui-components-3c494332.js";import"./icons.js";import"react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-1dea551d.js";import"styled-components";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
1
+ export{x as useActionFormData,cl as useBodyScroll,aB as useClickNode,bo as useClickNotification,as as useConnection,av as useContainerSize,bH as useCopy,aP as useDataStreamFormData,b0 as useDestinationFormData,bI as useGenericForm,bi as useInstrumentationRuleFormData,q as useKeyDown,aH as useOnClickOutside,aC as usePopup,aO as useSessionStorage,bz as useSourceFormData,bD as useSourceSelectionFormData,bn as useTimeAgo,bk as useTransition}from"./chunks/ui-components-16ba4841.js";import"./icons.js";import"react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-1dea551d.js";import"styled-components";import"react-dom";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
@@ -1,2 +1,3 @@
1
+ export * from './odigos-central-logo-text';
1
2
  export * from './odigos-logo';
2
3
  export * from './odigos-logo-text';
@@ -0,0 +1,2 @@
1
+ import type { SVG } from '@/types';
2
+ export declare const OdigosCentralLogoText: SVG;