@odigos/ui-kit 0.0.135 → 0.0.136

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/containers.js CHANGED
@@ -1,4 +1,4 @@
1
- import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperativeHandle as o,useMemo as l,Fragment as r,useCallback as s,Children as c}from"react";import d,{css as u}from"styled-components";import{s as p,t as m,A as h,K as g,v as y,w as v,x as b,y as f,z as x,E as $,G as C,H as S,J as k,L as w,M as T,N as D,Q as N,T as E,R as O,U as F,V as I,X as A,Y as M,Z as R,_ as L,$ as P,a0 as K,a1 as j,a2 as V,a3 as q,a4 as z,a5 as H,r as B,a6 as W,a7 as _,a8 as U,a9 as J,aa as G,ab as Y,ac as X,c as Z,ad as Q,ae as ee,af as te,ag as ae,ah as ie,ai as ne,aj as oe,ak as le,al as re,am as se,l as ce,an as de,ao as ue,ap as pe,aq as me,ar as he,as as ge,at as ye,au as ve,av as be,aw as fe,ax as xe,ay as $e,az as Ce,aA as Se,aB as ke,C as we,aC as Te,aD as De,aE as Ne,aF as Ee,aG as Oe,aH as Fe,aI as Ie,aJ as Ae,aK as Me,F as Re,aL as Le,aM as Pe,aN as Ke,aO as je,aP as Ve,aQ as qe,aR as ze,aS as He,aT as Be,aU as We,aV as _e,aW as Ue,aX as Je,aY as Ge,aZ as Ye,a_ as Xe,a$ as Ze,b0 as Qe,b1 as et,b2 as tt,b3 as at,b4 as it,b5 as nt,b6 as ot,b7 as lt,b8 as rt,b9 as st,ba as ct,bb as dt,bc as ut,bd as pt,be as mt,bf as ht,bg as gt,bh as yt,bi as vt,bj as bt,bk as ft,bl as xt,bm as $t,bn as Ct,bo as St,bp as kt,bq as wt,br as Tt,bs as Dt,bt as Nt,bu as Et,bv as Ot,bw as Ft,bx as It,by as At,bz as Mt,bA as Rt,bB as Lt,bC as Pt,bD as Kt,bE as jt,bF as Vt,bG as qt,u as zt,bH as Ht,bI as Bt,bJ as Wt,bK as _t,bL as Ut,bM as Jt,bN as Gt,bO as Yt,bP as Xt,bQ as Zt,bR as Qt,bS as ea,bT as ta,bU as aa,bV as ia,bW as na,bX as oa,bY as la,bZ as ra,b_ as sa,a as ca,b$ as da,c0 as ua,c1 as pa,c2 as ma,c3 as ha,c4 as ga,c5 as ya}from"./chunks/ui-components-c87427ab.js";import{VSquareIcon as va,XSquareIcon as ba,EditIcon as fa,TrashIcon as xa,OdigosLogoText as $a,PlusIcon as Ca,SearchIcon as Sa,FilterIcon as ka,DataStreamIcon as wa,VIcon as Ta,OdigosLogo as Da,ArrowIcon as Na,RefreshLeftArrowIcon as Ea,NotificationIcon as Oa,UserIcon as Fa,ImageErrorIcon as Ia,OverviewIcon as Aa,InstrumentationRuleIcon as Ma,ActionIcon as Ra,SourceIcon as La,DestinationIcon as Pa,SlackLogo as Ka,CopyIcon as ja,KeyIcon as Va,TerminalIcon as qa,ExclamationTriangleIcon as za,TraceViewIcon as Ha}from"./icons.js";import{MarkerType as Ba,useNodesState as Wa,useEdgesState as _a,applyNodeChanges as Ua}from"@xyflow/react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-55cc654c.js";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";const Ja=e=>{const{type:t,name:a,notes:i,signals:n,disabled:o,fields:{collectContainerAttributes:l,collectReplicaSetAttributes:r,collectWorkloadId:s,collectClusterId:c,labelsAttributes:d,annotationsAttributes:u,clusterAttributes:y,overwriteExistingValues:v,attributeNamesToDelete:b,renames:f,piiCategories:x,fallbackSamplingRatio:$,samplingPercentage:C,endpointsFilters:S,servicesNameFilters:k,attributeFilters:w}}=e,T=[{title:p.TYPE,value:t},{type:m.ActiveStatus,title:p.STATUS,value:String(!o)},{type:m.Monitors,title:p.SIGNALS_FOR_PROCESSING,value:n?.map(e=>e.toLowerCase()).join(", ")||""},{title:p.NAME,value:a||""},{title:p.NOTES,value:i||""},{type:m.Divider}];if(t===h.K8sAttributes&&(T.push({title:"Collect Container Attributes",value:String(l)}),T.push({title:"Collect ReplicaSet Attributes",value:String(r)}),T.push({title:"Collect Workload ID",value:String(s)}),T.push({title:"Collect Cluster ID",value:String(c)}),d?.length&&T.push({type:m.Divider}),d?.forEach(({labelKey:e,attributeKey:t,from:a},i)=>{let n="";n+=`Label Key: ${e}\n`,n+=`Attribute Key: ${t}\n`,n+=`From: ${a||g.Pod}\n`,T.push({title:"Label"+(d.length>1?` #${i+1}`:""),value:n})}),u?.length&&T.push({type:m.Divider}),u?.forEach(({annotationKey:e,attributeKey:t,from:a},i)=>{let n="";n+=`Annotation Key: ${e}\n`,n+=`Attribute Key: ${t}\n`,n+=`From: ${a||g.Pod}\n`,T.push({title:"Annotation"+(u.length>1?` #${i+1}`:""),value:n})})),t===h.AddClusterInfo){T.push({title:"Overwrite Existing Values",value:String(v||!1)});let e="";y?.forEach(({attributeName:t,attributeStringValue:a},i)=>{e+=`${t}: ${a}`,i<y.length-1&&(e+=", ")}),T.push({title:"Attributes",value:e})}if(t===h.DeleteAttributes){let e="";b?.forEach((t,a)=>{e+=t,a<b.length-1&&(e+=", ")}),T.push({title:"Attributes",value:e})}if(t===h.RenameAttributes){let e="";const t=Object.entries(f||{});t.forEach(([a,i],n)=>{e+=`${a}: ${i}`,n<t.length-1&&(e+=", ")}),T.push({title:"Attributes",value:e})}if(t===h.PiiMasking){let e="";x?.forEach((t,a)=>{e+=t,a<x.length-1&&(e+=", ")}),T.push({title:"Categories",value:e})}return t===h.ErrorSampler&&T.push({title:"Sampling Ratio",value:String($)}),t===h.ProbabilisticSampler&&T.push({title:"Sampling Percentage",value:String(C)}),t===h.LatencySampler&&S?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:a,fallbackSamplingRatio:i},n)=>{let o="";o+=`Service Name: ${e}\n`,o+=`HTTP Route: ${t}\n`,o+=`Min. Latency: ${a}\n`,o+=`Fallback Sampling Ratio: ${i}`,T.push({title:"Endpoint"+(S.length>1?` #${n+1}`:""),value:o})}),t===h.ServiceNameSampler&&k?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:a},i)=>{let n="";n+=`Service Name: ${e}\n`,n+=`Sampling Ratio: ${t}\n`,n+=`Fallback Sampling Ratio: ${a}`,T.push({title:"Filter"+(k.length>1?` #${i+1}`:""),value:n})}),t===h.SpanAttributeSampler&&w?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:a,condition:i},n)=>{let o="";o+=`Service Name: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`Fallback Sampling Ratio: ${a}\n`;const l=Object.keys(i)[0];o+=`Condition: ${l}\n`,o+=`Operation: ${i[l]?.operation}\n`,o+=`Expected Value: ${i[l]?.expectedValue}`,"jsonCondition"===l&&(o+=`\nJSON Path: ${i[l].jsonPath}`),T.push({title:"Filter"+(w.length>1?` #${n+1}`:""),value:o})}),T},Ga=f.PiiCategories,Ya=d.div`
1
+ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperativeHandle as o,useMemo as l,Fragment as r,useCallback as s,Children as c}from"react";import d,{css as u}from"styled-components";import{v as p,w as m,A as h,K as g,x as y,y as v,z as b,E as f,G as x,H as $,J as C,L as S,M as k,N as w,Q as T,R as D,U as N,T as E,V as O,X as F,Y as I,Z as A,_ as M,$ as R,a0 as L,a1 as P,a2 as K,a3 as j,a4 as V,a5 as q,a6 as z,a7 as H,m as B,a8 as W,a9 as _,aa as U,ab as J,ac as G,ad as Y,ae as X,c as Z,af as Q,ag as ee,ah as te,ai as ae,aj as ie,ak as ne,al as oe,am as le,an as re,ao as se,o as ce,ap as de,aq as ue,ar as pe,as as me,at as he,au as ge,av as ye,aw as ve,ax as be,ay as fe,az as xe,aA as $e,aB as Ce,aC as Se,aD as ke,C as we,aE as Te,aF as De,aG as Ne,aH as Ee,aI as Oe,aJ as Fe,aK as Ie,aL as Ae,aM as Me,F as Re,aN as Le,aO as Pe,aP as Ke,aQ as je,aR as Ve,aS as qe,aT as ze,aU as He,aV as Be,aW as We,aX as _e,aY as Ue,aZ as Je,a_ as Ge,a$ as Ye,b0 as Xe,b1 as Ze,b2 as Qe,b3 as et,b4 as tt,b5 as at,b6 as it,b7 as nt,b8 as ot,b9 as lt,ba as rt,bb as st,bc as ct,bd as dt,be as ut,bf as pt,bg as mt,bh as ht,bi as gt,bj as yt,bk as vt,bl as bt,bm as ft,bn as xt,bo as $t,bp as Ct,bq as St,br as kt,bs as wt,bt as Tt,bu as Dt,bv as Nt,bw as Et,bx as Ot,by as Ft,bz as It,bA as At,bB as Mt,bC as Rt,bD as Lt,bE as Pt,bF as Kt,bG as jt,bH as Vt,bI as qt,u as zt,bJ as Ht,bK as Bt,bL as Wt,bM as _t,bN as Ut,bO as Jt,bP as Gt,bQ as Yt,bR as Xt,bS as Zt,bT as Qt,bU as ea,bV as ta,bW as aa,bX as ia,bY as na,bZ as oa,b_ as la,b$ as ra,c0 as sa,a as ca,c1 as da,c2 as ua,c3 as pa,c4 as ma,c5 as ha,c6 as ga,c7 as ya,c8 as va}from"./chunks/ui-components-d05b354a.js";import{VSquareIcon as ba,XSquareIcon as fa,EditIcon as xa,TrashIcon as $a,OdigosLogoText as Ca,PlusIcon as Sa,SearchIcon as ka,FilterIcon as wa,DataStreamIcon as Ta,VIcon as Da,OdigosLogo as Na,ArrowIcon as Ea,RefreshLeftArrowIcon as Oa,NotificationIcon as Fa,UserIcon as Ia,ImageErrorIcon as Aa,OverviewIcon as Ma,InstrumentationRuleIcon as Ra,ActionIcon as La,SourceIcon as Pa,DestinationIcon as Ka,SlackLogo as ja,KeyIcon as Va,TerminalIcon as qa,ExclamationTriangleIcon as za,TraceViewIcon as Ha}from"./icons.js";import{MarkerType as Ba,useNodesState as Wa,useEdgesState as _a,applyNodeChanges as Ua}from"@xyflow/react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-55cc654c.js";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";const Ja=e=>{const{type:t,name:a,notes:i,signals:n,disabled:o,fields:{collectContainerAttributes:l,collectReplicaSetAttributes:r,collectWorkloadId:s,collectClusterId:c,labelsAttributes:d,annotationsAttributes:u,clusterAttributes:y,overwriteExistingValues:v,attributeNamesToDelete:b,renames:f,piiCategories:x,fallbackSamplingRatio:$,samplingPercentage:C,endpointsFilters:S,servicesNameFilters:k,attributeFilters:w}}=e,T=[{title:p.TYPE,value:t},{type:m.ActiveStatus,title:p.STATUS,value:String(!o)},{type:m.Monitors,title:p.SIGNALS_FOR_PROCESSING,value:n?.map(e=>e.toLowerCase()).join(", ")||""},{title:p.NAME,value:a||""},{title:p.NOTES,value:i||""},{type:m.Divider}];if(t===h.K8sAttributes&&(T.push({title:"Collect Container Attributes",value:String(l)}),T.push({title:"Collect ReplicaSet Attributes",value:String(r)}),T.push({title:"Collect Workload ID",value:String(s)}),T.push({title:"Collect Cluster ID",value:String(c)}),d?.length&&T.push({type:m.Divider}),d?.forEach(({labelKey:e,attributeKey:t,from:a},i)=>{let n="";n+=`Label Key: ${e}\n`,n+=`Attribute Key: ${t}\n`,n+=`From: ${a||g.Pod}\n`,T.push({title:"Label"+(d.length>1?` #${i+1}`:""),value:n})}),u?.length&&T.push({type:m.Divider}),u?.forEach(({annotationKey:e,attributeKey:t,from:a},i)=>{let n="";n+=`Annotation Key: ${e}\n`,n+=`Attribute Key: ${t}\n`,n+=`From: ${a||g.Pod}\n`,T.push({title:"Annotation"+(u.length>1?` #${i+1}`:""),value:n})})),t===h.AddClusterInfo){T.push({title:"Overwrite Existing Values",value:String(v||!1)});let e="";y?.forEach(({attributeName:t,attributeStringValue:a},i)=>{e+=`${t}: ${a}`,i<y.length-1&&(e+=", ")}),T.push({title:"Attributes",value:e})}if(t===h.DeleteAttributes){let e="";b?.forEach((t,a)=>{e+=t,a<b.length-1&&(e+=", ")}),T.push({title:"Attributes",value:e})}if(t===h.RenameAttributes){let e="";const t=Object.entries(f||{});t.forEach(([a,i],n)=>{e+=`${a}: ${i}`,n<t.length-1&&(e+=", ")}),T.push({title:"Attributes",value:e})}if(t===h.PiiMasking){let e="";x?.forEach((t,a)=>{e+=t,a<x.length-1&&(e+=", ")}),T.push({title:"Categories",value:e})}return t===h.ErrorSampler&&T.push({title:"Sampling Ratio",value:String($)}),t===h.ProbabilisticSampler&&T.push({title:"Sampling Percentage",value:String(C)}),t===h.LatencySampler&&S?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:a,fallbackSamplingRatio:i},n)=>{let o="";o+=`Service Name: ${e}\n`,o+=`HTTP Route: ${t}\n`,o+=`Min. Latency: ${a}\n`,o+=`Fallback Sampling Ratio: ${i}`,T.push({title:"Endpoint"+(S.length>1?` #${n+1}`:""),value:o})}),t===h.ServiceNameSampler&&k?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:a},i)=>{let n="";n+=`Service Name: ${e}\n`,n+=`Sampling Ratio: ${t}\n`,n+=`Fallback Sampling Ratio: ${a}`,T.push({title:"Filter"+(k.length>1?` #${i+1}`:""),value:n})}),t===h.SpanAttributeSampler&&w?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:a,condition:i},n)=>{let o="";o+=`Service Name: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`Fallback Sampling Ratio: ${a}\n`;const l=Object.keys(i)[0];o+=`Condition: ${l}\n`,o+=`Operation: ${i[l]?.operation}\n`,o+=`Expected Value: ${i[l]?.expectedValue}`,"jsonCondition"===l&&(o+=`\nJSON Path: ${i[l].jsonPath}`),T.push({title:"Filter"+(w.length>1?` #${n+1}`:""),value:o})}),T},Ga=f.PiiCategories,Ya=d.div`
2
2
  display: flex;
3
3
  flex-direction: row;
4
4
  gap: 32px;
@@ -14,7 +14,7 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
14
14
  padding: 4px;
15
15
  `,hi=d(N)`
16
16
  margin-bottom: 12px;
17
- `,gi=({isUpdate:t,action:a,formData:i,formErrors:n,handleFormChange:o})=>{const l=E.useTheme();return e.createElement(mi,null,t&&e.createElement("div",null,e.createElement(hi,null,"Status"),e.createElement(O,{options:[{icon:va,label:p.ENABLED,value:!1,selectedBgColor:l.text.success+E.opacity.hex["050"]},{icon:ba,label:p.DISABLED,value:!0,selectedBgColor:l.text.error+E.opacity.hex["050"]}],selected:i.disabled,setSelected:e=>o("disabled",e)})),!t&&e.createElement(F,{title:"",description:a.docsDescription,actionButton:e.createElement(I,{endpoint:a.docsEndpoint})}),e.createElement(A,{title:"Signals for Processing",required:!0,allowedSignals:a.allowedSignals,selectedSignals:i.signals||[],setSelectedSignals:e=>o("signals",e),errorMessage:n.signals}),!t&&e.createElement(x,{title:"Action name",placeholder:"Use a name that describes the action",value:i.name||"",onChange:({target:{value:e}})=>o("name",e),errorMessage:n.name}),e.createElement(pi,{actionType:a.type,value:i.fields,setValue:(e,t)=>o(`fields.${e}`,t),formErrors:n}),e.createElement(M,{title:"Notes",value:i.notes||"",onChange:({target:{value:e}})=>o("notes",e),errorMessage:n.notes}))},yi=i(({children:a,width:i=640,title:r,titleTooltip:s,hideEditTitleFromEdit:c,icons:d,iconSrcs:u,isEdit:p=!1,isFormDirty:m=!1,isLastItem:h=!1,onClose:g,onEdit:y,onSave:v,onDelete:b,onCancel:f,tabs:x,headerActionButtons:$},C)=>{const S=E.useTheme(),{isThisPending:k}=R(),{addNotification:w}=L(),{drawerType:T,drawerEntityId:D,setDrawerType:O,setDrawerEntityId:F}=P();K({key:"Enter",active:p},()=>Q());const[I,A]=t(!1),[M,W]=t(!1),_=n(null),U=T===H.Source,J=()=>{A(!1),W(!1)},G=()=>{J(),y&&y(!1),O(null),F(null),g?.()};o(C,()=>({closeDrawer:G}));const Y=()=>{_.current?.clearTitle(),f&&f(),J()},X=()=>{const e=_.current?.isTitleDirty();m||e?W(!0):Y()},Z=()=>{A(!0)},Q=()=>{v&&v(_.current?.getTitle()||"")},ee=l(()=>!!T&&k({entityType:T,entityId:D}),[T,D]),te=e=>{w({type:B.Warning,title:"Pending",message:`Cannot click ${e}, ${T} is pending`,hideFromHistory:!0})},ae=$||[];return y&&!p&&ae.push({"data-id":"drawer-edit",variant:"tertiary",onClick:ee?()=>te("edit"):()=>y(!0),children:e.createElement(e.Fragment,null,e.createElement(fa,null),e.createElement(N,{size:14,family:"secondary",decoration:"underline"},"Edit"))}),b&&!p&&ae.push({"data-id":"drawer-delete",variant:"tertiary",onClick:ee?()=>te(U?"uninstrument":"delete"):Z,children:e.createElement(e.Fragment,null,e.createElement(xa,null),e.createElement(N,{color:S.text.error,size:14,family:"secondary",decoration:"underline"},U?j.UNINSTRUMENT:j.DELETE))}),e.createElement(e.Fragment,null,e.createElement(V,{isOpen:!0,onClose:p?X:G,closeOnEscape:!I&&!M,width:`${i+64}px`,header:{icons:d,iconSrcs:u,title:r,titleTooltip:s,replaceTitleWith:!c&&p?e.createElement(vi,{ref:_,title:r}):void 0,actionButtons:ae,tabs:x},footer:{isOpen:p,leftButtons:[{"data-id":"drawer-save",variant:"primary",onClick:Q,children:j.SAVE},{"data-id":"drawer-cancel",variant:"secondary",onClick:X,children:j.CANCEL}],rightButtons:b?[{"data-id":"drawer-delete",variant:"tertiary",onClick:Z,children:e.createElement(e.Fragment,null,e.createElement(xa,null),e.createElement(N,{size:14,color:S.text.error,family:"secondary",decoration:"underline"},j.DELETE))}]:[]}},a),e.createElement(q,{isOpen:I,noOverlay:!0,name:`${T}${r?` (${r})`:""}`,type:T,isLastItem:h,onApprove:()=>{b&&b(),J()},onDeny:J}),e.createElement(z,{isOpen:M,noOverlay:!0,name:"edit mode",onApprove:Y,onDeny:J}))}),vi=i(({title:i},n)=>{const[l,r]=t(i);return a(()=>{r(i)},[i]),o(n,()=>({getTitle:()=>l||i,isTitleDirty:()=>l!==i,clearTitle:()=>r(i)})),e.createElement(x,{"data-id":"title",value:l,onChange:e=>r(e.target.value)})});vi.displayName=vi.name,yi.displayName=yi.name;const bi=d.div`
17
+ `,gi=({isUpdate:t,action:a,formData:i,formErrors:n,handleFormChange:o})=>{const l=E.useTheme();return e.createElement(mi,null,t&&e.createElement("div",null,e.createElement(hi,null,"Status"),e.createElement(O,{options:[{icon:ba,label:p.ENABLED,value:!1,selectedBgColor:l.text.success+E.opacity.hex["050"]},{icon:fa,label:p.DISABLED,value:!0,selectedBgColor:l.text.error+E.opacity.hex["050"]}],selected:i.disabled,setSelected:e=>o("disabled",e)})),!t&&e.createElement(F,{title:"",description:a.docsDescription,actionButton:e.createElement(I,{endpoint:a.docsEndpoint})}),e.createElement(A,{title:"Signals for Processing",required:!0,allowedSignals:a.allowedSignals,selectedSignals:i.signals||[],setSelectedSignals:e=>o("signals",e),errorMessage:n.signals}),!t&&e.createElement(x,{title:"Action name",placeholder:"Use a name that describes the action",value:i.name||"",onChange:({target:{value:e}})=>o("name",e),errorMessage:n.name}),e.createElement(pi,{actionType:a.type,value:i.fields,setValue:(e,t)=>o(`fields.${e}`,t),formErrors:n}),e.createElement(M,{title:"Notes",value:i.notes||"",onChange:({target:{value:e}})=>o("notes",e),errorMessage:n.notes}))},yi=i(({children:a,width:i=640,title:r,titleTooltip:s,hideEditTitleFromEdit:c,icons:d,iconSrcs:u,isEdit:p=!1,isFormDirty:m=!1,isLastItem:h=!1,onClose:g,onEdit:y,onSave:v,onDelete:b,onCancel:f,tabs:x,headerActionButtons:$},C)=>{const S=E.useTheme(),{isThisPending:k}=R(),{addNotification:w}=L(),{drawerType:T,drawerEntityId:D,setDrawerType:O,setDrawerEntityId:F}=P();K({key:"Enter",active:p},()=>Q());const[I,A]=t(!1),[M,W]=t(!1),_=n(null),U=T===H.Source,J=()=>{A(!1),W(!1)},G=()=>{J(),y&&y(!1),O(null),F(null),g?.()};o(C,()=>({closeDrawer:G}));const Y=()=>{_.current?.clearTitle(),f&&f(),J()},X=()=>{const e=_.current?.isTitleDirty();m||e?W(!0):Y()},Z=()=>{A(!0)},Q=()=>{v&&v(_.current?.getTitle()||"")},ee=l(()=>!!T&&k({entityType:T,entityId:D}),[T,D]),te=e=>{w({type:B.Warning,title:"Pending",message:`Cannot click ${e}, ${T} is pending`,hideFromHistory:!0})},ae=$||[];return y&&!p&&ae.push({"data-id":"drawer-edit",variant:"tertiary",onClick:ee?()=>te("edit"):()=>y(!0),children:e.createElement(e.Fragment,null,e.createElement(xa,null),e.createElement(N,{size:14,family:"secondary",decoration:"underline"},"Edit"))}),b&&!p&&ae.push({"data-id":"drawer-delete",variant:"tertiary",onClick:ee?()=>te(U?"uninstrument":"delete"):Z,children:e.createElement(e.Fragment,null,e.createElement($a,null),e.createElement(N,{color:S.text.error,size:14,family:"secondary",decoration:"underline"},U?j.UNINSTRUMENT:j.DELETE))}),e.createElement(e.Fragment,null,e.createElement(V,{isOpen:!0,onClose:p?X:G,closeOnEscape:!I&&!M,width:`${i+64}px`,header:{icons:d,iconSrcs:u,title:r,titleTooltip:s,replaceTitleWith:!c&&p?e.createElement(vi,{ref:_,title:r}):void 0,actionButtons:ae,tabs:x},footer:{isOpen:p,leftButtons:[{"data-id":"drawer-save",variant:"primary",onClick:Q,children:j.SAVE},{"data-id":"drawer-cancel",variant:"secondary",onClick:X,children:j.CANCEL}],rightButtons:b?[{"data-id":"drawer-delete",variant:"tertiary",onClick:Z,children:e.createElement(e.Fragment,null,e.createElement($a,null),e.createElement(N,{size:14,color:S.text.error,family:"secondary",decoration:"underline"},j.DELETE))}]:[]}},a),e.createElement(q,{isOpen:I,noOverlay:!0,name:`${T}${r?` (${r})`:""}`,type:T,isLastItem:h,onApprove:()=>{b&&b(),J()},onDeny:J}),e.createElement(z,{isOpen:M,noOverlay:!0,name:"edit mode",onApprove:Y,onDeny:J}))}),vi=i(({title:i},n)=>{const[l,r]=t(i);return a(()=>{r(i)},[i]),o(n,()=>({getTitle:()=>l||i,isTitleDirty:()=>l!==i,clearTitle:()=>r(i)})),e.createElement(x,{"data-id":"title",value:l,onChange:e=>r(e.target.value)})});vi.displayName=vi.name,yi.displayName=yi.name;const bi=d.div`
18
18
  width: 100%;
19
19
  height: 100%;
20
20
  max-height: calc(100vh - 220px);
@@ -45,7 +45,7 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
45
45
  text-align: center;
46
46
  line-height: 26px;
47
47
  color: ${({theme:e})=>e.text.info};
48
- `,Ai=()=>{const[i,n]=t(0);return a(()=>{(async()=>{for(let e=0;e<=100;e+=5)await Ee(500),n(e)})()},[]),e.createElement(Ei,null,e.createElement($a,{size:100}),e.createElement(De,{width:400}),e.createElement(Oi,null,e.createElement(ce,{$gap:16},e.createElement(Fi,null,"Preparing your workspace..."),e.createElement(Ne,{label:`${i}%`})),e.createElement(Ii,null,"It can take up to a few minutes. Grab a cup of coffee, look out a window, and enjoy your free moment!")))},Mi=d(Z)`
48
+ `,Ai=()=>{const[i,n]=t(0);return a(()=>{(async()=>{for(let e=0;e<=100;e+=5)await Ee(500),n(e)})()},[]),e.createElement(Ei,null,e.createElement(Ca,{size:100}),e.createElement(De,{width:400}),e.createElement(Oi,null,e.createElement(ce,{$gap:16},e.createElement(Fi,null,"Preparing your workspace..."),e.createElement(Ne,{label:`${i}%`})),e.createElement(Ii,null,"It can take up to a few minutes. Grab a cup of coffee, look out a window, and enjoy your free moment!")))},Mi=d(Z)`
49
49
  align-items: center !important;
50
50
  justify-content: center !important;
51
51
  align-self: stretch;
@@ -63,7 +63,7 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
63
63
  &:hover {
64
64
  background-color: ${({theme:e})=>e.colors.dropdown_bg_2+E.opacity.hex["030"]};
65
65
  }
66
- `,Ri=({entityType:t,description:a})=>{const{setCurrentModal:i}=Q(),{isThisPending:n}=R(),o=n({entityType:t});return e.createElement(Mi,{"data-id":`add-${t}`,onClick:()=>i(t)},e.createElement(ce,{$gap:4},e.createElement(Ca,null),o?e.createElement(Oe,{size:14,weight:600,family:"secondary"},"Adding ",t):e.createElement(N,{size:14,weight:600,family:"secondary",decoration:"underline"},"Add ",t)),e.createElement(N,{size:12,align:"center"},o?"Just a few more seconds...":a))},Li=d.div`
66
+ `,Ri=({entityType:t,description:a})=>{const{setCurrentModal:i}=Q(),{isThisPending:n}=R(),o=n({entityType:t});return e.createElement(Mi,{onClick:()=>i(t)},e.createElement(ce,{$gap:4},e.createElement(Sa,null),o?e.createElement(Oe,{size:14,weight:600,family:"secondary"},"Adding ",t):e.createElement(N,{size:14,weight:600,family:"secondary",decoration:"underline"},"Add ",t)),e.createElement(N,{size:12,align:"center"},o?"Just a few more seconds...":a))},Li=d.div`
67
67
  position: relative;
68
68
  width: 100%;
69
69
  padding: 12px 0;
@@ -86,7 +86,7 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
86
86
  height: 4px;
87
87
  width: ${({percent:e})=>`${e}%`};
88
88
  transition: width 0.3s;
89
- `,Vi=({entityType:t,badge:a,badgeTooltip:i,isLoading:n})=>{const o=E.useTheme(),{sources:r}=W(),{isThisPending:s}=R(),{setCurrentModal:c}=Q(),{selectedSources:d,setSelectedSources:u}=Ie(),{isAwaitingInstrumentation:p,sourcesToCreate:m,sourcesCreated:h,sourcesToDelete:g,sourcesDeleted:y}=Ae(),b=Ce(t),f=t===H.Source&&p,x=(m?Math.floor(100/m*h):g?Math.floor(100/g*y):0)||1,[$,C]=l(()=>{let e=0;return Object.values(d).forEach(t=>e+=t.length),[0!==e,e]},[d]);return e.createElement(Li,null,t===H.Source&&e.createElement(Pi,{$marginLeft:"28px"},e.createElement(v,{partiallyChecked:$&&r?.length!==C,value:$&&r?.length===C,onChange:e=>{if(e){const e={};r?.forEach(t=>{const a={namespace:t.namespace,name:t.name,kind:t.kind};s({entityType:H.Source,entityId:a})||(e[t.namespace]?e[t.namespace].push(t):e[t.namespace]=[t])}),u(e)}else u({})},disabled:!r?.length})),e.createElement(Pi,{$marginLeft:t===H.Source?"0":"28px"},e.createElement($e,{icon:b,title:`${t}s`,badge:f?`${x}%`:a,badgeTooltip:i,loading:n&&!f})),e.createElement(Pi,{$marginLeft:"auto"},e.createElement(Ki,{"data-id":`add-${t}`,variant:"primary",onClick:()=>c(t)},e.createElement(Ca,{fill:o.colors.primary,size:18}))),f&&e.createElement(ji,{percent:x}))},qi=d.div`
89
+ `,Vi=({entityType:t,badge:a,badgeTooltip:i,isLoading:n})=>{const o=E.useTheme(),{sources:r}=W(),{isThisPending:s}=R(),{setCurrentModal:c}=Q(),{selectedSources:d,setSelectedSources:u}=Ie(),{isAwaitingInstrumentation:p,sourcesToCreate:m,sourcesCreated:h,sourcesToDelete:g,sourcesDeleted:y}=Ae(),b=Ce(t),f=t===H.Source&&p,x=(m?Math.floor(100/m*h):g?Math.floor(100/g*y):0)||1,[$,C]=l(()=>{let e=0;return Object.values(d).forEach(t=>e+=t.length),[0!==e,e]},[d]);return e.createElement(Li,null,t===H.Source&&e.createElement(Pi,{$marginLeft:"28px"},e.createElement(v,{partiallyChecked:$&&r?.length!==C,value:$&&r?.length===C,onChange:e=>{if(e){const e={};r?.forEach(t=>{const a={namespace:t.namespace,name:t.name,kind:t.kind};s({entityType:H.Source,entityId:a})||(e[t.namespace]?e[t.namespace].push(t):e[t.namespace]=[t])}),u(e)}else u({})},disabled:!r?.length})),e.createElement(Pi,{$marginLeft:t===H.Source?"0":"28px"},e.createElement($e,{icon:b,title:`${t}s`,badge:f?`${x}%`:a,badgeTooltip:i,loading:n&&!f})),e.createElement(Pi,{$marginLeft:"auto"},e.createElement(Ki,{"data-id":`add-${t}`,variant:"primary",onClick:()=>c(t)},e.createElement(Sa,{fill:o.colors.primary,size:18}))),f&&e.createElement(ji,{percent:x}))},qi=d.div`
90
90
  padding: 2px 6px;
91
91
  background-color: ${({theme:e})=>e.colors.primary};
92
92
  border-radius: 360px;
@@ -155,7 +155,7 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
155
155
  display: flex;
156
156
  align-items: center;
157
157
  overflow-x: scroll;
158
- `,Zi=({onClose:i})=>{const n=E.useTheme(),{onClickNode:o}=Xe(),{searchText:s}=he(),{selectedStreamName:c}=We(),{sources:d,destinations:u,actions:p,instrumentationRules:m}=W(),{popupRef:h,popupOpen:g,setPopupOpen:y,popupPosition:v,handlePosition:b}=Ze();a(()=>{g||(b(0,50),y(!0))},[g]);const[f,x]=t("all"),{categories:$,searchResults:C}=l(()=>Ti({instrumentationRules:m,sources:Je(d,c),actions:p,destinations:Ye(u,c),searchText:s,selectedCategory:f}),[m,d,p,u,c,s,f]);return C.length?e.createElement(Qe,{ref:h,isOpen:g,top:v.top,left:v.left,maxWidth:"420px",header:e.createElement(Xi,null,$.map(({category:t,label:a,count:i})=>!!i&&e.createElement(et,{key:`category-select-${t}`,label:a,badgeLabel:i,isSelected:f===t,onClick:()=>x(t)})))},C.map(({category:t,label:a,entities:l},s)=>!!l.length&&e.createElement(r,{key:`category-list-${t}`},e.createElement(tt,{style:{maxHeight:"all"!==f?"240px":"140px",padding:"12px 0"}},e.createElement(N,{size:12,family:"secondary",color:n.text.darker_grey,style:{marginLeft:"16px"}},a),l.map((a,n)=>e.createElement(et,{key:`entity-${s}-${n}`,icon:Ce(t),label:ve(a,t,{extended:!0}),onClick:()=>{const e=Le(a);o(null,{data:{type:t,id:e}}),i()},style:{width:"100%",justifyContent:"flex-start"},color:"transparent"}))),e.createElement(le,{thickness:s===C.length-1?0:1,length:"90%",margin:"8px auto"})))):e.createElement(Qe,{ref:h,isOpen:g,top:v.top,left:v.left},e.createElement(Te,null))},Qi=({preventPopup:a=!1})=>{const{searchText:i,setSearchText:o}=he(),[l,r]=t(!1),s=!!i||l,c=()=>{o(""),r(!1)},d=n(null);return at(d,c),K({key:"Escape",active:s},c),e.createElement(Yi,{ref:d},e.createElement(x,{placeholder:"Search",icon:Sa,value:i,onChange:e=>o(e.target.value.toLowerCase()),onFocus:()=>r(!0)}),s&&!a?e.createElement(Zi,{onClose:c}):null)},en=({sources:t,title:a="Condition",value:i,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t.forEach(({conditions:t})=>{t?.forEach(({type:t,reason:a})=>{e.find(e=>e.id===`${t}#${a}`)||e.push({id:`${t}#${a}`,value:`${it(t)} - ${it(a)}`})})}),e.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[t]);return e.createElement(nt,{disabled:!s?.length,title:a,placeholder:"All",options:s,value:i,onSelect:n,onDeselect:o,...r})},tn=({sources:t,title:a="Error Message",value:i,onSelect:n,onDeselect:o,disabled:r,...s})=>{const c=l(()=>{const e=[];return t.forEach(({conditions:t})=>{de(t||[]).forEach(({status:t,message:a,reason:i})=>{t!==B.Error||e.find(e=>e.id===a)||(a?e.find(e=>e.id===a)||e.push({id:a,value:a}):i&&(e.find(e=>e.id===i)||e.push({id:i,value:i})))})}),e},[t]);return e.createElement(nt,{disabled:r||!c?.length,title:a,placeholder:"All",options:c,value:i,onSelect:n,onDeselect:o,...s})},an=({sources:t,title:a="Programming Language",value:i,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t.forEach(({containers:t})=>{t?.forEach(({language:t})=>{e.find(e=>e.id===t)||e.push({id:t,value:ot[t]||t})})}),e.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[t]);return e.createElement(nt,{disabled:!s?.length,title:a,placeholder:"All",options:s,value:i,onSelect:n,onDeselect:o,...r})},nn=({title:t="Monitors",value:a,onSelect:i,onDeselect:n,...o})=>{const r=l(()=>{const e=[];return lt.forEach(({id:t,value:a})=>{e.find(e=>e.id===t)||e.push({id:t,value:a})}),e},[]);return e.createElement(nt,{disabled:!r?.length,title:t,placeholder:"All",options:r,value:a,onSelect:i,onDeselect:n,...o})},on=({namespaces:t,title:a="Namespace",value:i,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t?.forEach(({name:t})=>{e.find(e=>e.id===t)||e.push({id:t,value:t})}),e},[t]);return e.createElement(nt,{disabled:!s?.length,title:a,placeholder:"Select namespace",options:s,value:i,onSelect:n,onDeselect:o,...r})},ln=({sources:t,title:a="Kind",value:i,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t.forEach(({kind:t})=>{e.find(e=>e.id===t)||e.push({id:t,value:t})}),e},[t]);return e.createElement(nt,{disabled:!s?.length,title:a,placeholder:"All",options:s,value:i,onSelect:n,onDeselect:o,...r})},rn=d.div`
158
+ `,Zi=({onClose:i})=>{const n=E.useTheme(),{onClickNode:o}=Xe(),{searchText:s}=he(),{selectedStreamName:c}=We(),{sources:d,destinations:u,actions:p,instrumentationRules:m}=W(),{popupRef:h,popupOpen:g,setPopupOpen:y,popupPosition:v,handlePosition:b}=Ze();a(()=>{g||(b(0,50),y(!0))},[g]);const[f,x]=t("all"),{categories:$,searchResults:C}=l(()=>Ti({instrumentationRules:m,sources:Je(d,c),actions:p,destinations:Ye(u,c),searchText:s,selectedCategory:f}),[m,d,p,u,c,s,f]);return C.length?e.createElement(Qe,{ref:h,isOpen:g,top:v.top,left:v.left,maxWidth:"420px",header:e.createElement(Xi,null,$.map(({category:t,label:a,count:i})=>!!i&&e.createElement(et,{key:`category-select-${t}`,label:a,badgeLabel:i,isSelected:f===t,onClick:()=>x(t)})))},C.map(({category:t,label:a,entities:l},s)=>!!l.length&&e.createElement(r,{key:`category-list-${t}`},e.createElement(tt,{style:{maxHeight:"all"!==f?"240px":"140px",padding:"12px 0"}},e.createElement(N,{size:12,family:"secondary",color:n.text.darker_grey,style:{marginLeft:"16px"}},a),l.map((a,n)=>e.createElement(et,{key:`entity-${s}-${n}`,icon:Ce(t),label:ve(a,t,{extended:!0}),onClick:()=>{const e=Le(a);o(null,{data:{type:t,id:e}}),i()},style:{width:"100%",justifyContent:"flex-start"},color:"transparent"}))),e.createElement(le,{thickness:s===C.length-1?0:1,length:"90%",margin:"8px auto"})))):e.createElement(Qe,{ref:h,isOpen:g,top:v.top,left:v.left},e.createElement(Te,null))},Qi=({preventPopup:a=!1})=>{const{searchText:i,setSearchText:o}=he(),[l,r]=t(!1),s=!!i||l,c=()=>{o(""),r(!1)},d=n(null);return at(d,c),K({key:"Escape",active:s},c),e.createElement(Yi,{ref:d},e.createElement(x,{placeholder:"Search",icon:ka,value:i,onChange:e=>o(e.target.value.toLowerCase()),onFocus:()=>r(!0)}),s&&!a?e.createElement(Zi,{onClose:c}):null)},en=({sources:t,title:a="Condition",value:i,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t.forEach(({conditions:t})=>{t?.forEach(({type:t,reason:a})=>{e.find(e=>e.id===`${t}#${a}`)||e.push({id:`${t}#${a}`,value:`${it(t)} - ${it(a)}`})})}),e.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[t]);return e.createElement(nt,{disabled:!s?.length,title:a,placeholder:"All",options:s,value:i,onSelect:n,onDeselect:o,...r})},tn=({sources:t,title:a="Error Message",value:i,onSelect:n,onDeselect:o,disabled:r,...s})=>{const c=l(()=>{const e=[];return t.forEach(({conditions:t})=>{de(t||[]).forEach(({status:t,message:a,reason:i})=>{t!==B.Error||e.find(e=>e.id===a)||(a?e.find(e=>e.id===a)||e.push({id:a,value:a}):i&&(e.find(e=>e.id===i)||e.push({id:i,value:i})))})}),e},[t]);return e.createElement(nt,{disabled:r||!c?.length,title:a,placeholder:"All",options:c,value:i,onSelect:n,onDeselect:o,...s})},an=({sources:t,title:a="Programming Language",value:i,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t.forEach(({containers:t})=>{t?.forEach(({language:t})=>{e.find(e=>e.id===t)||e.push({id:t,value:ot[t]||t})})}),e.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[t]);return e.createElement(nt,{disabled:!s?.length,title:a,placeholder:"All",options:s,value:i,onSelect:n,onDeselect:o,...r})},nn=({title:t="Monitors",value:a,onSelect:i,onDeselect:n,...o})=>{const r=l(()=>{const e=[];return lt.forEach(({id:t,value:a})=>{e.find(e=>e.id===t)||e.push({id:t,value:a})}),e},[]);return e.createElement(nt,{disabled:!r?.length,title:t,placeholder:"All",options:r,value:a,onSelect:i,onDeselect:n,...o})},on=({namespaces:t,title:a="Namespace",value:i,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t?.forEach(({name:t})=>{e.find(e=>e.id===t)||e.push({id:t,value:t})}),e},[t]);return e.createElement(nt,{disabled:!s?.length,title:a,placeholder:"Select namespace",options:s,value:i,onSelect:n,onDeselect:o,...r})},ln=({sources:t,title:a="Kind",value:i,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t.forEach(({kind:t})=>{e.find(e=>e.id===t)||e.push({id:t,value:t})}),e},[t]);return e.createElement(nt,{disabled:!s?.length,title:a,placeholder:"All",options:s,value:i,onSelect:n,onDeselect:o,...r})},rn=d.div`
159
159
  display: flex;
160
160
  flex-direction: column;
161
161
  gap: 12px;
@@ -167,7 +167,7 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
167
167
  ${({$color:e})=>`color: ${e};`}
168
168
  `,dn=d.div`
169
169
  margin-left: auto;
170
- `,un=e=>{let t=0;return Object.values(e).forEach(e=>{e&&Array.isArray(e)&&e.length>0&&(t+=e.length)}),e.onlyErrors&&t++,e.searchText&&t++,t},pn=()=>{const i=E.useTheme(),{isVm:o}=Be(),{namespaces:r,sources:s}=W(),{selectedStreamName:c}=We(),{getItemSS:d,setItemSS:u,removeItemSS:p}=st(),{popupRef:m,popupOpen:h,setPopupOpen:g,popupPosition:y,handlePosition:v}=Ze(),{namespaces:b,kinds:f,monitors:x,languages:$,conditions:C,errors:S,onlyErrors:w,setAll:T,clearAll:D,getEmptyState:N}=he(),O=l(()=>Je(s,c),[s,c]),[F,I]=t({namespaces:b,kinds:f,monitors:x,languages:$,conditions:C,errors:S,onlyErrors:w}),[A,M]=t(un(F));a(()=>{const e=d(rt.OVERVIEW_FILTERS,N());T(e)},[]),a(()=>{if(!h){const e={namespaces:b,kinds:f,monitors:x,languages:$,conditions:C,errors:S,onlyErrors:w};I(e),M(un(e))}},[h,b,f,x,$,C,S,w]);const R=()=>{g(!1)},L=n(null);return at(L,R),K({key:"Escape",active:h},R),e.createElement(Yi,{ref:L},e.createElement(et,{label:"Filters",icon:ka,badgeLabel:A,badgeFilled:!!A,withBorder:!0,color:"transparent",onClick:()=>{v(0,50),g(!0)}}),e.createElement(Qe,{ref:m,isOpen:h,top:y.top,left:y.left,width:"420px",footer:e.createElement(ce,null,e.createElement(cn,{variant:"primary",onClick:()=>{u(rt.OVERVIEW_FILTERS,F),T(F),M(un(F)),g(!1)}},"Apply"),e.createElement(cn,{variant:"secondary",onClick:R},"Cancel"),e.createElement(dn,null,e.createElement(cn,{variant:"tertiary",onClick:()=>{p(rt.OVERVIEW_FILTERS),D(),I(N()),M(0),g(!1)},$color:i.text.error},"Reset")))},e.createElement(rn,null,!o&&e.createElement(on,{namespaces:r,value:F.namespaces,onSelect:e=>I(t=>({...t,namespaces:[...t.namespaces||[],e]})),onDeselect:e=>I(t=>({...t,namespaces:(t.namespaces||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(ln,{sources:O,value:F.kinds,onSelect:e=>I(t=>({...t,kinds:[...t.kinds||[],e]})),onDeselect:e=>I(t=>({...t,kinds:(t.kinds||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(an,{sources:O,value:F.languages,onSelect:e=>I(t=>({...t,languages:[...t.languages||[],e]})),onDeselect:e=>I(t=>({...t,languages:(t.languages||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(nn,{value:F.monitors,onSelect:e=>I(t=>({...t,monitors:[...t.monitors||[],e]})),onDeselect:e=>I(t=>({...t,monitors:(t.monitors||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(en,{sources:O,value:F.conditions,onSelect:e=>I(t=>({...t,conditions:[...t.conditions||[],e]})),onDeselect:e=>I(t=>({...t,conditions:(t.conditions||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(sn,null,e.createElement(k,{title:"Show only sources with errors",initialValue:F.onlyErrors,onChange:e=>I(t=>({...t,errors:[],onlyErrors:e}))})),e.createElement(tn,{sources:O,value:F.errors,onSelect:e=>I(t=>({...t,errors:[...t.errors||[],e]})),onDeselect:e=>I(t=>({...t,errors:(t.errors||[]).filter(t=>t.id!==e.id)})),disabled:!F.onlyErrors,showSearch:!0,required:!0,isMulti:!0}))))},mn=d.div`
170
+ `,un=e=>{let t=0;return Object.values(e).forEach(e=>{e&&Array.isArray(e)&&e.length>0&&(t+=e.length)}),e.onlyErrors&&t++,e.searchText&&t++,t},pn=()=>{const i=E.useTheme(),{isVm:o}=Be(),{namespaces:r,sources:s}=W(),{selectedStreamName:c}=We(),{getItemSS:d,setItemSS:u,removeItemSS:p}=st(),{popupRef:m,popupOpen:h,setPopupOpen:g,popupPosition:y,handlePosition:v}=Ze(),{namespaces:b,kinds:f,monitors:x,languages:$,conditions:C,errors:S,onlyErrors:w,setAll:T,clearAll:D,getEmptyState:N}=he(),O=l(()=>Je(s,c),[s,c]),[F,I]=t({namespaces:b,kinds:f,monitors:x,languages:$,conditions:C,errors:S,onlyErrors:w}),[A,M]=t(un(F));a(()=>{const e=d(rt.OVERVIEW_FILTERS,N());T(e)},[]),a(()=>{if(!h){const e={namespaces:b,kinds:f,monitors:x,languages:$,conditions:C,errors:S,onlyErrors:w};I(e),M(un(e))}},[h,b,f,x,$,C,S,w]);const R=()=>{g(!1)},L=n(null);return at(L,R),K({key:"Escape",active:h},R),e.createElement(Yi,{ref:L},e.createElement(et,{label:"Filters",icon:wa,badgeLabel:A,badgeFilled:!!A,withBorder:!0,color:"transparent",onClick:()=>{v(0,50),g(!0)}}),e.createElement(Qe,{ref:m,isOpen:h,top:y.top,left:y.left,width:"420px",footer:e.createElement(ce,null,e.createElement(cn,{variant:"primary",onClick:()=>{u(rt.OVERVIEW_FILTERS,F),T(F),M(un(F)),g(!1)}},"Apply"),e.createElement(cn,{variant:"secondary",onClick:R},"Cancel"),e.createElement(dn,null,e.createElement(cn,{variant:"tertiary",onClick:()=>{p(rt.OVERVIEW_FILTERS),D(),I(N()),M(0),g(!1)},$color:i.text.error},"Reset")))},e.createElement(rn,null,!o&&e.createElement(on,{namespaces:r,value:F.namespaces,onSelect:e=>I(t=>({...t,namespaces:[...t.namespaces||[],e]})),onDeselect:e=>I(t=>({...t,namespaces:(t.namespaces||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(ln,{sources:O,value:F.kinds,onSelect:e=>I(t=>({...t,kinds:[...t.kinds||[],e]})),onDeselect:e=>I(t=>({...t,kinds:(t.kinds||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(an,{sources:O,value:F.languages,onSelect:e=>I(t=>({...t,languages:[...t.languages||[],e]})),onDeselect:e=>I(t=>({...t,languages:(t.languages||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(nn,{value:F.monitors,onSelect:e=>I(t=>({...t,monitors:[...t.monitors||[],e]})),onDeselect:e=>I(t=>({...t,monitors:(t.monitors||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(en,{sources:O,value:F.conditions,onSelect:e=>I(t=>({...t,conditions:[...t.conditions||[],e]})),onDeselect:e=>I(t=>({...t,conditions:(t.conditions||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(sn,null,e.createElement(k,{title:"Show only sources with errors",initialValue:F.onlyErrors,onChange:e=>I(t=>({...t,errors:[],onlyErrors:e}))})),e.createElement(tn,{sources:O,value:F.errors,onSelect:e=>I(t=>({...t,errors:[...t.errors||[],e]})),onDeselect:e=>I(t=>({...t,errors:(t.errors||[]).filter(t=>t.id!==e.id)})),disabled:!F.onlyErrors,showSearch:!0,required:!0,isMulti:!0}))))},mn=d.div`
171
171
  display: flex;
172
172
  flex-direction: column;
173
173
  gap: 24px;
@@ -178,7 +178,7 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
178
178
  max-height: calc(100vh - 220px);
179
179
  overflow: overlay;
180
180
  overflow-y: auto;
181
- `,yn=({isOpen:a,onClose:i,dataStreamName:o,updateDataStream:r})=>{const{dataStreams:c}=We(),d=n(null),[u,p]=t(!1),{formData:m,handleFormChange:h,formErrors:g,validateForm:y,resetFormData:v,loadFormWithDrawerItem:b}=ct({name:o}),f=l(()=>{if(!a)return v();const e=c?.find(e=>e.name===o);return e?b(e):v(),e},[a,c,o]),x=s((e,t)=>{h(e,t),p(!0)},[h]);return f?e.createElement(yi,{ref:d,title:f.name,icons:[wa],hideEditTitleFromEdit:!0,isEdit:!0,isFormDirty:u,onSave:()=>{y({withAlert:!0,alertTitle:X.Update})&&(r(o,m),p(!1),i())},onCancel:()=>{v(),p(!1),i()}},e.createElement(gn,null,e.createElement(hn,{formData:m,handleFormChange:x,formErrors:g}))):null},vn=d.div`
181
+ `,yn=({isOpen:a,onClose:i,dataStreamName:o,updateDataStream:r})=>{const{dataStreams:c}=We(),d=n(null),[u,p]=t(!1),{formData:m,handleFormChange:h,formErrors:g,validateForm:y,resetFormData:v,loadFormWithDrawerItem:b}=ct({name:o}),f=l(()=>{if(!a)return v();const e=c?.find(e=>e.name===o);return e?b(e):v(),e},[a,c,o]),x=s((e,t)=>{h(e,t),p(!0)},[h]);return f?e.createElement(yi,{ref:d,title:f.name,icons:[Ta],hideEditTitleFromEdit:!0,isEdit:!0,isFormDirty:u,onSave:()=>{y({withAlert:!0,alertTitle:X.Update})&&(r(o,m),p(!1),i())},onCancel:()=>{v(),p(!1),i()}},e.createElement(gn,null,e.createElement(hn,{formData:m,handleFormChange:x,formErrors:g}))):null},vn=d.div`
182
182
  position: relative;
183
183
  `,bn=d(ce)`
184
184
  border: 1px solid ${({theme:e})=>e.colors.border};
@@ -196,7 +196,7 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
196
196
  width: 100%;
197
197
  `,Cn=d.div`
198
198
  width: 100%;
199
- `,Sn=({onClickNewDataStream:a,updateDataStream:i,deleteDataStream:n})=>{const o=E.useTheme(),{clearStore:r}=dt(),{popupRef:s,popupOpen:c,setPopupOpen:d,popupPosition:u,handlePosition:p}=Ze(),{dataStreams:m,selectedStreamName:h,setSelectedStreamName:g}=We(),[y,v]=t(""),[b,f]=t(""),[$,C]=t(""),S=l(()=>m.filter(({name:e})=>!$||e.toLowerCase().includes($.toLowerCase())).map(({name:t})=>e.createElement($n,{key:`stream-${t}`},e.createElement(Cn,null,e.createElement(et,{label:t,isSelected:h===t,onClick:()=>{r(),g(t),d(!1)},color:"transparent",style:{width:"100%",justifyContent:"flex-start"}})),t!==ut&&e.createElement(pt,{onClick:()=>f(t),tooltip:j.DELETE},e.createElement(xa,null)),e.createElement(pt,{onClick:()=>v(t),tooltip:j.EDIT},e.createElement(fa,null)))),[m,h,$]);return e.createElement(e.Fragment,null,e.createElement(vn,null,e.createElement(bn,{$gap:0},e.createElement(Fe,{variant:"tertiary",onClick:()=>{p(0,50),d(e=>!e)}},e.createElement(wa,{fill:o.text.info}),e.createElement(fn,null,"Data Stream: ",h),e.createElement(mt,{extend:c}),e.createElement(Ne,{label:m.length})),e.createElement(le,{orientation:"vertical",length:"32px",thickness:2,margin:"0"}),e.createElement(ht,{onClick:()=>{r(),a()},label:j.NEW})),e.createElement(Qe,{ref:s,isOpen:c,top:u.top,left:u.left,header:e.createElement(x,{placeholder:"Search...",icon:Sa,value:$,onChange:e=>C(e.target.value)})},e.createElement(xn,null,S))),e.createElement(q,{isOpen:""!==b,name:b,onApprove:()=>{n(b),f("")},onDeny:()=>{f("")}}),e.createElement(yn,{isOpen:""!==y,onClose:()=>{v("")},dataStreamName:y,updateDataStream:i}))},kn=d.div`
199
+ `,Sn=({onClickNewDataStream:a,updateDataStream:i,deleteDataStream:n})=>{const o=E.useTheme(),{clearStore:r}=dt(),{popupRef:s,popupOpen:c,setPopupOpen:d,popupPosition:u,handlePosition:p}=Ze(),{dataStreams:m,selectedStreamName:h,setSelectedStreamName:g}=We(),[y,v]=t(""),[b,f]=t(""),[$,C]=t(""),S=l(()=>m.filter(({name:e})=>!$||e.toLowerCase().includes($.toLowerCase())).map(({name:t})=>e.createElement($n,{key:`stream-${t}`},e.createElement(Cn,null,e.createElement(et,{label:t,isSelected:h===t,onClick:()=>{r(),g(t),d(!1)},color:"transparent",style:{width:"100%",justifyContent:"flex-start"}})),t!==ut&&e.createElement(pt,{onClick:()=>f(t),tooltip:j.DELETE},e.createElement($a,null)),e.createElement(pt,{onClick:()=>v(t),tooltip:j.EDIT},e.createElement(xa,null)))),[m,h,$]);return e.createElement(e.Fragment,null,e.createElement(vn,null,e.createElement(bn,{$gap:0},e.createElement(Fe,{variant:"tertiary",onClick:()=>{p(0,50),d(e=>!e)}},e.createElement(Ta,{fill:o.text.info}),e.createElement(fn,null,"Data Stream: ",h),e.createElement(mt,{extend:c}),e.createElement(Ne,{label:m.length})),e.createElement(le,{orientation:"vertical",length:"32px",thickness:2,margin:"0"}),e.createElement(ht,{onClick:()=>{r(),a()},label:j.NEW})),e.createElement(Qe,{ref:s,isOpen:c,top:u.top,left:u.left,header:e.createElement(x,{placeholder:"Search...",icon:ka,value:$,onChange:e=>C(e.target.value)})},e.createElement(xn,null,S))),e.createElement(q,{isOpen:""!==b,name:b,onApprove:()=>{n(b),f("")},onDeny:()=>{f("")}}),e.createElement(yn,{isOpen:""!==y,onClose:()=>{v("")},dataStreamName:y,updateDataStream:i}))},kn=d.div`
200
200
  display: flex;
201
201
  align-items: center;
202
202
  margin: 20px 0;
@@ -229,7 +229,7 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
229
229
  justify-content: space-between;
230
230
  `,Pn=d(N)`
231
231
  margin-bottom: 12px;
232
- `,Kn=({isUpdate:i,categoryItem:o,formData:r,formErrors:s,validateForm:c,handleFormChange:d,dynamicFields:u,setDynamicFields:m,testConnection:h})=>{const{type:g,displayName:y,supportedSignals:v,testConnectionSupported:b}=o||{},f=E.useTheme(),[$,C]=t(!1),[S,k]=t(!1),[w,T]=t(void 0),D=n(!1);a(()=>{if(u.length&&!D.current){D.current=!0;let e=!1;for(let t=0;t<u.length;t++){const{required:a,value:i}=u[t];if(a){if([void 0,null,""].includes(i)){e=!1;break}e=!0}}C(e)}},[u,S]);const N=l(()=>{const{logs:e,metrics:t,traces:a}=v||{},i=[];return e?.supported&&i.push(xt.Logs),t?.supported&&i.push(xt.Metrics),a?.supported&&i.push(xt.Traces),i},[v]),M=l(()=>{const{logs:e,metrics:t,traces:a}=r.exportedSignals||{},i=[];return e&&i.push(xt.Logs),t&&i.push(xt.Metrics),a&&i.push(xt.Traces),i},[r.exportedSignals]),R=()=>{C(!1),k(!0),T(void 0)};return e.createElement(Mn,{$gap:24},e.createElement(Mn,{$gap:12},e.createElement(F,{title:i?"Update destination":"Create destination",description:`Connect ${y} with Odigos.`,actionButton:b&&e.createElement(An,{destination:r,validateForm:c,status:w?.type,testConnection:h,onError:e=>{k(!1),T({type:B.Error,title:e?.reason||"Connection failed",message:e?.message||"Please check your input and try again."})},onSuccess:e=>{k(!1),T({type:B.Success,title:e?.reason||"Connection succeeded",message:e?.message||""})}})}),e.createElement(Rn,null,b&&w&&e.createElement(ie,{type:w.type,title:w.title,message:w.message}),$&&!w&&!i&&e.createElement(ie,{type:B.Default,message:`Odigos autocompleted ${y} destination details.`})),e.createElement(le,null)),e.createElement(Ln,null,e.createElement(A,{title:i?"":"This connection will monitor:",required:!0,allowedSignals:N,selectedSignals:M,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(I,{endpoint:`/backends/${g}`})),i&&e.createElement("div",null,e.createElement(Pn,null,"Status"),e.createElement(O,{options:[{icon:va,label:p.ENABLED,value:!1,selectedBgColor:f.text.success+E.opacity.hex["050"]},{icon:ba,label:p.DISABLED,value:!0,selectedBgColor:f.text.error+E.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(Fn,{signals:M,fields:u,onChange:(e,t)=>{R(),m(a=>{const i=[...a],n=i.findIndex(t=>t.name===e);return-1!==n&&(i[n]={...i[n],value:t}),i})},formErrors:s}))},jn=d.div`
232
+ `,Kn=({isUpdate:i,categoryItem:o,formData:r,formErrors:s,validateForm:c,handleFormChange:d,dynamicFields:u,setDynamicFields:m,testConnection:h})=>{const{type:g,displayName:y,supportedSignals:v,testConnectionSupported:b}=o||{},f=E.useTheme(),[$,C]=t(!1),[S,k]=t(!1),[w,T]=t(void 0),D=n(!1);a(()=>{if(u.length&&!D.current){D.current=!0;let e=!1;for(let t=0;t<u.length;t++){const{required:a,value:i}=u[t];if(a){if([void 0,null,""].includes(i)){e=!1;break}e=!0}}C(e)}},[u,S]);const N=l(()=>{const{logs:e,metrics:t,traces:a}=v||{},i=[];return e?.supported&&i.push(xt.Logs),t?.supported&&i.push(xt.Metrics),a?.supported&&i.push(xt.Traces),i},[v]),M=l(()=>{const{logs:e,metrics:t,traces:a}=r.exportedSignals||{},i=[];return e&&i.push(xt.Logs),t&&i.push(xt.Metrics),a&&i.push(xt.Traces),i},[r.exportedSignals]),R=()=>{C(!1),k(!0),T(void 0)};return e.createElement(Mn,{$gap:24},e.createElement(Mn,{$gap:12},e.createElement(F,{title:i?"Update destination":"Create destination",description:`Connect ${y} with Odigos.`,actionButton:b&&e.createElement(An,{destination:r,validateForm:c,status:w?.type,testConnection:h,onError:e=>{k(!1),T({type:B.Error,title:e?.reason||"Connection failed",message:e?.message||"Please check your input and try again."})},onSuccess:e=>{k(!1),T({type:B.Success,title:e?.reason||"Connection succeeded",message:e?.message||""})}})}),e.createElement(Rn,null,b&&w&&e.createElement(ie,{type:w.type,title:w.title,message:w.message}),$&&!w&&!i&&e.createElement(ie,{type:B.Default,message:`Odigos autocompleted ${y} destination details.`})),e.createElement(le,null)),e.createElement(Ln,null,e.createElement(A,{title:i?"":"This connection will monitor:",required:!0,allowedSignals:N,selectedSignals:M,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(I,{endpoint:`/backends/${g}`})),i&&e.createElement("div",null,e.createElement(Pn,null,"Status"),e.createElement(O,{options:[{icon:ba,label:p.ENABLED,value:!1,selectedBgColor:f.text.success+E.opacity.hex["050"]},{icon:fa,label:p.DISABLED,value:!0,selectedBgColor:f.text.error+E.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(Fn,{signals:M,fields:u,onChange:(e,t)=>{R(),m(a=>{const i=[...a],n=i.findIndex(t=>t.name===e);return-1!==n&&(i[n]={...i[n],value:t}),i})},formErrors:s}))},jn=d.div`
233
233
  width: 100%;
234
234
  height: 100%;
235
235
  max-height: calc(100vh - 220px);
@@ -267,7 +267,7 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
267
267
  }
268
268
  `,Jn=d(Bn)`
269
269
  margin-top: 80px;
270
- `,{MANAGED:Gn,SELF_HOSTED:Yn,DETECTED:Xn,EXISTS:Zn}=kt,Qn=[{value:"All types",id:"all"},{value:Gn.TITLE,id:Gn.TITLE},{value:Yn.TITLE,id:Yn.TITLE},{value:Xn.TITLE,id:Xn.TITLE},{value:Zn.TITLE,id:Zn.TITLE}],eo=Qn[0],to=[xt.Logs,xt.Metrics,xt.Traces],ao=(e,t,a)=>e.map(e=>{const{type:i,displayName:n}=e.destinationType,o=e.dataStreamNames?.includes(t),l=a.has(e.id);return{id:e.id,type:i,displayName:n,selected:o||l,fields:[],testConnectionSupported:!1,supportedSignals:{[xt.Logs]:{supported:e.exportedSignals.logs},[xt.Metrics]:{supported:e.exportedSignals.metrics},[xt.Traces]:{supported:e.exportedSignals.traces}}}}),io=({hidden:a,categories:i,potentialDestinations:n,onSelectNew:o,onSelectConfigured:r,isLoadingForDestinationIds:s})=>{const{destinations:c}=W(),{selectedStreamName:d}=We(),{configuredDestinations:u,configuredDestinationsUpdateOnly:p}=dt(),[m,h]=t(""),[g,y]=t(eo),[v,b]=t(to),f=l(()=>{const e=wt(i);return e.unshift({name:Zn.TITLE,description:Zn.DESCRIPTION,icon:Ta,items:ao(c,d,new Set(u.concat(p).map(e=>e.id)))}),e.unshift({name:Xn.TITLE,description:Xn.DESCRIPTION,icon:Da,items:n}),e.map(e=>{const t=e.items.filter(t=>{const a=!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 a&&i&&n});return{...e,items:t}}).filter(({items:e})=>!!e.length)},[i,n,c,m,g,v,d,u,p]);return a?null:e.createElement(Bn,null,e.createElement(F,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e.createElement(Wn,null,e.createElement(_n,null,e.createElement(x,{placeholder:"Search...",icon:Sa,value:m,onChange:({target:{value:e}})=>h(e)})),e.createElement(_n,null,e.createElement(nt,{options:Qn,value:g,onSelect:y,onDeselect:()=>{}})),e.createElement(A,{title:"",selectedSignals:v,setSelectedSignals:b})),e.createElement(le,null),f.length?e.createElement(Un,null,e.createElement(Hn,{items:f,onSelectNew:e=>o(e,v),onSelectConfigured:r,isLoadingForDestinationIds:s})):e.createElement(Jn,null,e.createElement(Te,{title:"No destinations found"})))},no=d.div`
270
+ `,{MANAGED:Gn,SELF_HOSTED:Yn,DETECTED:Xn,EXISTS:Zn}=kt,Qn=[{value:"All types",id:"all"},{value:Gn.TITLE,id:Gn.TITLE},{value:Yn.TITLE,id:Yn.TITLE},{value:Xn.TITLE,id:Xn.TITLE},{value:Zn.TITLE,id:Zn.TITLE}],eo=Qn[0],to=[xt.Logs,xt.Metrics,xt.Traces],ao=(e,t,a)=>e.map(e=>{const{type:i,displayName:n}=e.destinationType,o=e.dataStreamNames?.includes(t),l=a.has(e.id);return{id:e.id,type:i,displayName:n,selected:o||l,fields:[],testConnectionSupported:!1,supportedSignals:{[xt.Logs]:{supported:e.exportedSignals.logs},[xt.Metrics]:{supported:e.exportedSignals.metrics},[xt.Traces]:{supported:e.exportedSignals.traces}}}}),io=({hidden:a,categories:i,potentialDestinations:n,onSelectNew:o,onSelectConfigured:r,isLoadingForDestinationIds:s})=>{const{destinations:c}=W(),{selectedStreamName:d}=We(),{configuredDestinations:u,configuredDestinationsUpdateOnly:p}=dt(),[m,h]=t(""),[g,y]=t(eo),[v,b]=t(to),f=l(()=>{const e=wt(i);return e.unshift({name:Zn.TITLE,description:Zn.DESCRIPTION,icon:Da,items:ao(c,d,new Set(u.concat(p).map(e=>e.id)))}),e.unshift({name:Xn.TITLE,description:Xn.DESCRIPTION,icon:Na,items:n}),e.map(e=>{const t=e.items.filter(t=>{const a=!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 a&&i&&n});return{...e,items:t}}).filter(({items:e})=>!!e.length)},[i,n,c,m,g,v,d,u,p]);return a?null:e.createElement(Bn,null,e.createElement(F,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e.createElement(Wn,null,e.createElement(_n,null,e.createElement(x,{placeholder:"Search...",icon:ka,value:m,onChange:({target:{value:e}})=>h(e)})),e.createElement(_n,null,e.createElement(nt,{options:Qn,value:g,onSelect:y,onDeselect:()=>{}})),e.createElement(A,{title:"",selectedSignals:v,setSelectedSignals:b})),e.createElement(le,null),f.length?e.createElement(Un,null,e.createElement(Hn,{items:f,onSelectNew:e=>o(e,v),onSelectConfigured:r,isLoadingForDestinationIds:s})):e.createElement(Jn,null,e.createElement(Te,{title:"No destinations found"})))},no=d.div`
271
271
  display: flex;
272
272
  `,oo=d.div`
273
273
  border-right: 1px solid ${({theme:e})=>e.colors.border};
@@ -276,7 +276,7 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
276
276
  @media (max-width: 1050px) {
277
277
  display: none;
278
278
  }
279
- `,lo=({isOnboarding:a,categories:i,potentialDestinations:n,createDestination:o,updateDestination:l,deleteDestination:r,testConnection:s})=>{const{destinations:c}=W(),{selectedStreamName:d}=We(),{currentModal:u,setCurrentModal:m}=Q(),{addConfiguredDestination:h,addConfiguredDestinationUpdateOnly:g,removeConfiguredDestinationUpdateOnly:y,configuredDestinationsUpdateOnly:v}=dt(),b=u===H.Destination,[f,x]=t(void 0),{formData:$,formErrors:C,handleFormChange:S,resetFormData:k,validateForm:w,setYamlFields:T,dynamicFields:D,setDynamicFields:N,loadFormWithDrawerItem:E}=$t({supportedSignals:f?.supportedSignals,preLoadedFields:f?.fields}),[O,F]=t([]),I=e=>{const t={};return e||D.forEach(e=>t[e.name]=e.value),{id:e?.id||"",name:e?.name||$.name,disabled:e?.disabled||$.disabled,dataStreamNames:e?.dataStreamNames||[],conditions:e?.conditions||[],exportedSignals:e?.exportedSignals||$.exportedSignals,fields:e?.fields||JSON.stringify(t),destinationType:e?.destinationType||{type:f.type,displayName:f.displayName,supportedSignals:{logs:{supported:!1},metrics:{supported:!1},traces:{supported:!1}}}}},A=async e=>{if(a&&!e){const e=I();h(e)}else if(a&&e){const t=I(e);v.some(t=>t.id===e.id)?y(e):g(t)}else if(a||e){if(!a&&e){const t=I(e),a=t.dataStreamNames.some(e=>e===d);F(t=>[...t,e.id]),a?await r(e.id):await l(e.id,E(t)),F(t=>t.filter(t=>t!==e.id))}}else o($)},M=()=>{k(),x(void 0),m("")},R=()=>{k(),x(void 0)},L=async()=>{if(f){if(!w({withAlert:!a,alertTitle:X.Create}))return null;A()}M()};return K({key:"Enter",active:b},()=>L()),e.createElement(ee,{isOpen:b,onClose:M,header:{title:p.ADD_DESTINATION},actionComponent:e.createElement(te,{buttons:(()=>{const t=[{label:"DONE",variant:"primary",onClick:L}];return f&&t.unshift({label:"BACK",icon:()=>e.createElement(Na,{rotate:-90}),variant:"secondary",onClick:R}),t})()})},e.createElement(no,null,e.createElement(oo,null,e.createElement(Tt,{currentStep:f?2:1,data:[{stepNumber:1,title:p.DESTINATIONS},{stepNumber:2,title:p.CONNECTION}]})),e.createElement(ae,{style:{margin:"32px 24px 12px 24px"}},e.createElement(io,{hidden:void 0!==f,categories:i,potentialDestinations:n,onSelectNew:(e,t)=>{k(),S("type",e?.type||""),S("currentStreamName",d);const a={logs:!1,metrics:!1,traces:!1};t.filter(t=>e.supportedSignals[t].supported).forEach(e=>a[e]=!0),S("exportedSignals",a),T(e?.fields||[]),x(e)},onSelectConfigured:e=>{const t=c.find(t=>t.id===e);t&&A(t)},isLoadingForDestinationIds:O}),f&&e.createElement(Kn,{categoryItem:f,formData:$,formErrors:C,handleFormChange:S,dynamicFields:D,setDynamicFields:N,validateForm:w,testConnection:s}))))},ro=d.div`
279
+ `,lo=({isOnboarding:a,categories:i,potentialDestinations:n,createDestination:o,updateDestination:l,deleteDestination:r,testConnection:s})=>{const{destinations:c}=W(),{selectedStreamName:d}=We(),{currentModal:u,setCurrentModal:m}=Q(),{addConfiguredDestination:h,addConfiguredDestinationUpdateOnly:g,removeConfiguredDestinationUpdateOnly:y,configuredDestinationsUpdateOnly:v}=dt(),b=u===H.Destination,[f,x]=t(void 0),{formData:$,formErrors:C,handleFormChange:S,resetFormData:k,validateForm:w,setYamlFields:T,dynamicFields:D,setDynamicFields:N,loadFormWithDrawerItem:E}=$t({supportedSignals:f?.supportedSignals,preLoadedFields:f?.fields}),[O,F]=t([]),I=e=>{const t={};return e||D.forEach(e=>t[e.name]=e.value),{id:e?.id||"",name:e?.name||$.name,disabled:e?.disabled||$.disabled,dataStreamNames:e?.dataStreamNames||[],conditions:e?.conditions||[],exportedSignals:e?.exportedSignals||$.exportedSignals,fields:e?.fields||JSON.stringify(t),destinationType:e?.destinationType||{type:f.type,displayName:f.displayName,supportedSignals:{logs:{supported:!1},metrics:{supported:!1},traces:{supported:!1}}}}},A=async e=>{if(a&&!e){const e=I();h(e)}else if(a&&e){const t=I(e);v.some(t=>t.id===e.id)?y(e):g(t)}else if(a||e){if(!a&&e){const t=I(e),a=t.dataStreamNames.some(e=>e===d);F(t=>[...t,e.id]),a?await r(e.id):await l(e.id,E(t)),F(t=>t.filter(t=>t!==e.id))}}else o($)},M=()=>{k(),x(void 0),m("")},R=()=>{k(),x(void 0)},L=async()=>{if(f){if(!w({withAlert:!a,alertTitle:X.Create}))return null;A()}M()};return K({key:"Enter",active:b},()=>L()),e.createElement(ee,{isOpen:b,onClose:M,header:{title:p.ADD_DESTINATION},actionComponent:e.createElement(te,{buttons:(()=>{const t=[{label:"DONE",variant:"primary",onClick:L}];return f&&t.unshift({label:"BACK",icon:()=>e.createElement(Ea,{rotate:-90}),variant:"secondary",onClick:R}),t})()})},e.createElement(no,null,e.createElement(oo,null,e.createElement(Tt,{currentStep:f?2:1,data:[{stepNumber:1,title:p.DESTINATIONS},{stepNumber:2,title:p.CONNECTION}]})),e.createElement(ae,{style:{margin:"32px 24px 12px 24px"}},e.createElement(io,{hidden:void 0!==f,categories:i,potentialDestinations:n,onSelectNew:(e,t)=>{k(),S("type",e?.type||""),S("currentStreamName",d);const a={logs:!1,metrics:!1,traces:!1};t.filter(t=>e.supportedSignals[t].supported).forEach(e=>a[e]=!0),S("exportedSignals",a),T(e?.fields||[]),x(e)},onSelectConfigured:e=>{const t=c.find(t=>t.id===e);t&&A(t)},isLoadingForDestinationIds:O}),f&&e.createElement(Kn,{categoryItem:f,formData:$,formErrors:C,handleFormChange:S,dynamicFields:D,setDynamicFields:N,validateForm:w,testConnection:s}))))},ro=d.div`
280
280
  display: flex;
281
281
  flex-direction: column;
282
282
  align-items: center;
@@ -285,7 +285,7 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
285
285
  max-height: calc(100vh - 310px);
286
286
  height: fit-content;
287
287
  overflow-y: scroll;
288
- `,so=({categories:t,withDelete:a})=>{const{configuredDestinations:i,configuredDestinationsUpdateOnly:n}=dt();return i.length||n.length?e.createElement(ro,null,i.concat(n).map((o,l)=>e.createElement(co,{key:`configured-destination-${o.destinationType.type}-${l}`,"data-id":`configured-destination-${o.destinationType.type}`,item:o,yamlFields:Ct(t,o),isLastItem:i.length+n.length===1,withDelete:a}))):e.createElement(we,null,e.createElement(Te,{title:"No destinations",subTitle:"Please add a destination"}))},co=({item:a,yamlFields:i,isLastItem:n,withDelete:o})=>{const[r,s]=t(!1),{icon:c,iconSrc:d}=qe(a.destinationType.type),{removeConfiguredDestination:u,removeConfiguredDestinationUpdateOnly:p}=dt(),m=l(()=>vt(a,i).map(e=>({title:e.name,value:e.value})),[a,i]);return e.createElement(e.Fragment,null,e.createElement(Me,{title:a.name||a.destinationType.displayName,subTitle:a.destinationType.type,iconProps:{icon:c,iconSrc:d},visualProps:{monitors:Pe(a.exportedSignals),monitorsWithLabels:!0},extendableProps:{withExtend:!0,renderExtended:()=>e.createElement(Dt,{data:m})},renderActions:o?()=>e.createElement(pt,{onClick:()=>s(!0)},e.createElement(xa,null)):void 0}),o&&e.createElement(q,{isOpen:r,name:a.destinationType.displayName||a.name,type:H.Destination,isLastItem:n,onApprove:()=>{a.id?p(a):u(a)},onDeny:()=>s(!1)}))},uo=d(Fe)`
288
+ `,so=({categories:t,withDelete:a})=>{const{configuredDestinations:i,configuredDestinationsUpdateOnly:n}=dt();return i.length||n.length?e.createElement(ro,null,i.concat(n).map((o,l)=>e.createElement(co,{key:`configured-destination-${o.destinationType.type}-${l}`,"data-id":`configured-destination-${o.destinationType.type}`,item:o,yamlFields:Ct(t,o),isLastItem:i.length+n.length===1,withDelete:a}))):e.createElement(we,null,e.createElement(Te,{title:"No destinations",subTitle:"Please add a destination"}))},co=({item:a,yamlFields:i,isLastItem:n,withDelete:o})=>{const[r,s]=t(!1),{icon:c,iconSrc:d}=qe(a.destinationType.type),{removeConfiguredDestination:u,removeConfiguredDestinationUpdateOnly:p}=dt(),m=l(()=>vt(a,i).map(e=>({title:e.name,value:e.value})),[a,i]);return e.createElement(e.Fragment,null,e.createElement(Me,{title:a.name||a.destinationType.displayName,subTitle:a.destinationType.type,iconProps:{icon:c,iconSrc:d},visualProps:{monitors:Pe(a.exportedSignals),monitorsWithLabels:!0},extendableProps:{withExtend:!0,renderExtended:()=>e.createElement(Dt,{data:m})},renderActions:o?()=>e.createElement(pt,{onClick:()=>s(!0)},e.createElement($a,null)):void 0}),o&&e.createElement(q,{isOpen:r,name:a.destinationType.displayName||a.name,type:H.Destination,isLastItem:n,onApprove:()=>{a.id?p(a):u(a)},onDeny:()=>s(!1)}))},uo=d(Fe)`
289
289
  display: flex;
290
290
  align-items: center;
291
291
  justify-content: center;
@@ -294,7 +294,7 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
294
294
  padding: 32px;
295
295
  border-radius: 16px;
296
296
  border-style: dashed !important;
297
- `,po=({isSourcesListEmpty:t,goToSources:a,categories:i,potentialDestinations:n,testConnection:o,onClickSummary:l})=>{const r=E.useTheme(),{setCurrentModal:s}=Q(),{configuredDestinations:c,configuredDestinationsUpdateOnly:d}=dt();return e.createElement(e.Fragment,null,e.createElement(ae,{$isNotModal:!0},e.createElement(Z,{$gap:12},e.createElement(Z,{$gap:24},l&&e.createElement(gt,{onClick:l}),e.createElement(F,{title:p.ADD_DESTINATIONS,badgeLabel:c.length+d.length,description:p.ADD_DESTINATION_DESCRIPTION}),t&&e.createElement(ie,{type:B.Warning,message:p.NO_SOURCES_GO_BACK,action:{label:p.SELECT_SOURCES,onClick:a}}),e.createElement(uo,{variant:"secondary",onClick:()=>s(H.Destination)},e.createElement(Ca,null),e.createElement(N,{color:r.colors.secondary,size:14,decoration:"underline",family:"secondary"},p.ADD_DESTINATION))),e.createElement(so,{categories:i,withDelete:!0}))),e.createElement(lo,{isOnboarding:!0,categories:i,potentialDestinations:n,updateDestination:async()=>{},createDestination:async()=>{},deleteDestination:async()=>{},testConnection:o}))},mo=[{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}],ho=({metrics:t,maxHeight:a,maxWidth:i})=>{const n=E.useTheme(),o=he(),{selectedStreamName:r}=We(),{setDrawerType:s,setDrawerEntityId:c}=P(),{destinations:d,destinationsLoading:u}=W(),m=l(()=>Ye(d,r),[d,r]),h=l(()=>Ti({instrumentationRules:[],sources:[],actions:[],destinations:Ge(m,o),searchText:o.searchText,selectedCategory:H.Destination}).searchResults.find(({category:e})=>e===H.Destination)?.entities||[],[m,o]),g=l(()=>h.map(a=>{const{hasErrors:i,hasWarnings:o,hasDisableds:l}=re(a.conditions||[]),{icon:r,iconSrc:d}=qe(a.destinationType.type);return{status:i?B.Error:o?B.Warning:void 0,faded:l,onClick:()=>{s(H.Destination),c(a.id)},cells:[{columnKey:"icon",component:()=>e.createElement(ye,{icon:r,src:d})},{columnKey:"name",value:ve(a,H.Destination,{prioritizeDisplayName:!0})},{columnKey:"type",value:a.destinationType.type,textColor:n.text.info},{columnKey:"throughput",value:Ke(Nt(t,H.Destination,a.id).throughput),textColor:n.text.info},{columnKey:"signals",component:()=>e.createElement(be,{withLabels:!0,monitors:Pe(a.exportedSignals)})},{columnKey:"conditions",component:()=>a.conditions?.length?e.createElement(ki,{conditions:a.conditions,id:a.id}):null},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:a.disabled?B.Error:B.Success,title:a.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(fe,{$maxWidth:i},e.createElement(xe,null,e.createElement($e,{icon:Ce(H.Destination),title:p.DESTINATIONS,badge:y,badgeTooltip:v,loading:u})),e.createElement(Se,{$maxHeight:a},e.createElement(ke,{columns:mo,rows:g})),!h.length&&e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(Te,null)))},go=e=>{const{type:t,ruleName:a,notes:i,disabled:n,profileName:o,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:a},{title:p.NOTES,value:i},{title:p.MANAGED_BY_PROFILE,value:o},{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[Et.HeaderKeys]||[]).filter(e=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(c){const e=(c[Ft.Java]||[]).map(e=>new Ot(e.className,e.methodName)).map(e=>`• ${e.toString()}`).join("\r\n");e&&d.push({title:p.JAVA_CUSTOM_PROBES,value:e});const t=(c[Ft.Golang]||[]).map(e=>new It(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},yo=d.div`
297
+ `,po=({isSourcesListEmpty:t,goToSources:a,categories:i,potentialDestinations:n,testConnection:o,onClickSummary:l})=>{const r=E.useTheme(),{setCurrentModal:s}=Q(),{configuredDestinations:c,configuredDestinationsUpdateOnly:d}=dt();return e.createElement(e.Fragment,null,e.createElement(ae,{$isNotModal:!0},e.createElement(Z,{$gap:12},e.createElement(Z,{$gap:24},l&&e.createElement(gt,{onClick:l}),e.createElement(F,{title:p.ADD_DESTINATIONS,badgeLabel:c.length+d.length,description:p.ADD_DESTINATION_DESCRIPTION}),t&&e.createElement(ie,{type:B.Warning,message:p.NO_SOURCES_GO_BACK,action:{label:p.SELECT_SOURCES,onClick:a}}),e.createElement(uo,{variant:"secondary",onClick:()=>s(H.Destination)},e.createElement(Sa,null),e.createElement(N,{color:r.colors.secondary,size:14,decoration:"underline",family:"secondary"},p.ADD_DESTINATION))),e.createElement(so,{categories:i,withDelete:!0}))),e.createElement(lo,{isOnboarding:!0,categories:i,potentialDestinations:n,updateDestination:async()=>{},createDestination:async()=>{},deleteDestination:async()=>{},testConnection:o}))},mo=[{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}],ho=({metrics:t,maxHeight:a,maxWidth:i})=>{const n=E.useTheme(),o=he(),{selectedStreamName:r}=We(),{setDrawerType:s,setDrawerEntityId:c}=P(),{destinations:d,destinationsLoading:u}=W(),m=l(()=>Ye(d,r),[d,r]),h=l(()=>Ti({instrumentationRules:[],sources:[],actions:[],destinations:Ge(m,o),searchText:o.searchText,selectedCategory:H.Destination}).searchResults.find(({category:e})=>e===H.Destination)?.entities||[],[m,o]),g=l(()=>h.map(a=>{const{hasErrors:i,hasWarnings:o,hasDisableds:l}=re(a.conditions||[]),{icon:r,iconSrc:d}=qe(a.destinationType.type);return{status:i?B.Error:o?B.Warning:void 0,faded:l,onClick:()=>{s(H.Destination),c(a.id)},cells:[{columnKey:"icon",component:()=>e.createElement(ye,{icon:r,src:d})},{columnKey:"name",value:ve(a,H.Destination,{prioritizeDisplayName:!0})},{columnKey:"type",value:a.destinationType.type,textColor:n.text.info},{columnKey:"throughput",value:Ke(Nt(t,H.Destination,a.id).throughput),textColor:n.text.info},{columnKey:"signals",component:()=>e.createElement(be,{withLabels:!0,monitors:Pe(a.exportedSignals)})},{columnKey:"conditions",component:()=>a.conditions?.length?e.createElement(ki,{conditions:a.conditions,id:a.id}):null},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:a.disabled?B.Error:B.Success,title:a.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(fe,{$maxWidth:i},e.createElement(xe,null,e.createElement($e,{icon:Ce(H.Destination),title:p.DESTINATIONS,badge:y,badgeTooltip:v,loading:u})),e.createElement(Se,{$maxHeight:a},e.createElement(ke,{columns:mo,rows:g})),!h.length&&e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(Te,null)))},go=e=>{const{type:t,ruleName:a,notes:i,disabled:n,profileName:o,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:a},{title:p.NOTES,value:i},{title:p.MANAGED_BY_PROFILE,value:o},{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[Et.HeaderKeys]||[]).filter(e=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(c){const e=(c[Ft.Java]||[]).map(e=>new Ot(e.className,e.methodName)).map(e=>`• ${e.toString()}`).join("\r\n");e&&d.push({title:p.JAVA_CUSTOM_PROBES,value:e});const t=(c[Ft.Golang]||[]).map(e=>new It(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},yo=d.div`
298
298
  display: flex;
299
299
  flex-direction: column;
300
300
  gap: 12px;
@@ -321,7 +321,7 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
321
321
  padding: 4px;
322
322
  `,To=d(N)`
323
323
  margin-bottom: 12px;
324
- `,Do=({isUpdate:t,rule:a,formData:i,formErrors:n,handleFormChange:o})=>{const l=E.useTheme();return e.createElement(wo,null,e.createElement(ce,null,a.supportedLanguages.map(t=>e.createElement(Lt,{key:t,icon:Pt(t),type:B.Info},ot[t]))),t?e.createElement("div",null,e.createElement(To,null,"Status"),e.createElement(O,{options:[{icon:va,label:p.ENABLED,value:!1,selectedBgColor:l.text.success+E.opacity.hex["050"]},{icon:ba,label:p.DISABLED,value:!0,selectedBgColor:l.text.error+E.opacity.hex["050"]}],selected:i.disabled,setSelected:e=>o("disabled",e)})):e.createElement(e.Fragment,null,e.createElement(F,{title:"",description:a.docsDescription,actionButton:e.createElement(I,{endpoint:a.docsEndpoint})}),e.createElement(x,{title:"Rule name",placeholder:"Use a name that describes the rule",value:i.ruleName,onChange:({target:{value:e}})=>o("ruleName",e),errorMessage:n.ruleName})),e.createElement(ko,{ruleType:a.type,value:i,setValue:(e,t)=>o(e,t),formErrors:n}),e.createElement(M,{title:"Notes",value:i.notes,onChange:({target:{value:e}})=>o("notes",e),errorMessage:n.notes}))},No=d.div`
324
+ `,Do=({isUpdate:t,rule:a,formData:i,formErrors:n,handleFormChange:o})=>{const l=E.useTheme();return e.createElement(wo,null,e.createElement(ce,null,a.supportedLanguages.map(t=>e.createElement(Lt,{key:t,icon:Pt(t),type:B.Info},ot[t]))),t?e.createElement("div",null,e.createElement(To,null,"Status"),e.createElement(O,{options:[{icon:ba,label:p.ENABLED,value:!1,selectedBgColor:l.text.success+E.opacity.hex["050"]},{icon:fa,label:p.DISABLED,value:!0,selectedBgColor:l.text.error+E.opacity.hex["050"]}],selected:i.disabled,setSelected:e=>o("disabled",e)})):e.createElement(e.Fragment,null,e.createElement(F,{title:"",description:a.docsDescription,actionButton:e.createElement(I,{endpoint:a.docsEndpoint})}),e.createElement(x,{title:"Rule name",placeholder:"Use a name that describes the rule",value:i.ruleName,onChange:({target:{value:e}})=>o("ruleName",e),errorMessage:n.ruleName})),e.createElement(ko,{ruleType:a.type,value:i,setValue:(e,t)=>o(e,t),formErrors:n}),e.createElement(M,{title:"Notes",value:i.notes,onChange:({target:{value:e}})=>o("notes",e),errorMessage:n.notes}))},No=d.div`
325
325
  width: 100%;
326
326
  height: 100%;
327
327
  max-height: calc(100vh - 220px);
@@ -347,7 +347,7 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
347
347
  border-radius: 32px;
348
348
  border: 1px solid ${({theme:e})=>e.colors.border};
349
349
  background-color: ${({theme:e})=>e.colors.dropdown_bg};
350
- `,Ko=({totalSourceCount:a,uninstrumentSources:i,restartWorkloads:n})=>{const o=E.useTheme(),s=Vt({container:Po,animateIn:E.animations.slide.in.center,animateOut:E.animations.slide.out.center}),{selectedSources:c,setSelectedSources:d}=Ie(),[u,p]=t(!1),m=l(()=>{let e=0;return Object.values(c).forEach(t=>{e+=t.length}),e},[c]),h=()=>{d({})};return e.createElement(r,null,e.createElement(s,{"data-id":"multi-source-control",enter:!!m},e.createElement(N,null,"Selected sources"),e.createElement(Ne,{label:m,filled:!0}),e.createElement(le,{orientation:"vertical",length:"16px"}),e.createElement(Fe,{variant:"tertiary",onClick:h},e.createElement(N,{family:"secondary",decoration:"underline"},"Deselect")),e.createElement(Fe,{variant:"tertiary",onClick:()=>{const e=[];Object.values(c).forEach(t=>{e.push(...t.map(e=>qt(e)))}),n(e),h()}},e.createElement(Ea,null),e.createElement(N,{family:"secondary",decoration:"underline"},"Restart")),e.createElement(Fe,{variant:"tertiary",onClick:()=>p(!0)},e.createElement(xa,null),e.createElement(N,{family:"secondary",decoration:"underline",color:o.text.error},"Uninstrument"))),e.createElement(q,{isOpen:u,name:`${m} sources`,type:H.Source,isLastItem:m===a,onApprove:()=>{const e={};Object.entries(c).forEach(([t,a])=>{e[t]=a.map(e=>({...e,selected:!1}))}),i(e),p(!1),h()},onDeny:()=>p(!1)}))},jo=d.div`
350
+ `,Ko=({totalSourceCount:a,uninstrumentSources:i,restartWorkloads:n})=>{const o=E.useTheme(),s=Vt({container:Po,animateIn:E.animations.slide.in.center,animateOut:E.animations.slide.out.center}),{selectedSources:c,setSelectedSources:d}=Ie(),[u,p]=t(!1),m=l(()=>{let e=0;return Object.values(c).forEach(t=>{e+=t.length}),e},[c]),h=()=>{d({})};return e.createElement(r,null,e.createElement(s,{"data-id":"multi-source-control",enter:!!m},e.createElement(N,null,"Selected sources"),e.createElement(Ne,{label:m,filled:!0}),e.createElement(le,{orientation:"vertical",length:"16px"}),e.createElement(Fe,{variant:"tertiary",onClick:h},e.createElement(N,{family:"secondary",decoration:"underline"},"Deselect")),e.createElement(Fe,{variant:"tertiary",onClick:()=>{const e=[];Object.values(c).forEach(t=>{e.push(...t.map(e=>qt(e)))}),n(e),h()}},e.createElement(Oa,null),e.createElement(N,{family:"secondary",decoration:"underline"},"Restart")),e.createElement(Fe,{variant:"tertiary",onClick:()=>p(!0)},e.createElement($a,null),e.createElement(N,{family:"secondary",decoration:"underline",color:o.text.error},"Uninstrument"))),e.createElement(q,{isOpen:u,name:`${m} sources`,type:H.Source,isLastItem:m===a,onApprove:()=>{const e={};Object.entries(c).forEach(([t,a])=>{e[t]=a.map(e=>({...e,selected:!1}))}),i(e),p(!1),h()},onDeny:()=>p(!1)}))},jo=d.div`
351
351
  position: relative;
352
352
  width: fit-content;
353
353
  `,Vo=d(ce)`
@@ -372,7 +372,7 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
372
372
  border-radius: 32px;
373
373
  width: fit-content;
374
374
  padding: 2px 8px;
375
- `,Bo=()=>{const t=E.useTheme(),{notifications:a,markAsSeen:i}=L(),n=a.filter(({hideFromHistory:e})=>!e),o=n.filter(({seen:e})=>!e),l=o.length,{popupRef:r,popupOpen:s,setPopupOpen:c,popupPosition:d,handlePosition:u}=Ze({defaultClientHeight:420,defaultClientwidth:400,onClickOutside:()=>{l&&o.forEach(({id:e})=>i(e))}});return e.createElement(jo,null,e.createElement(pt,{onClick:()=>{u(0,0),c(e=>!e)},tooltip:"Notifications",withPing:!!l,pingColor:t.colors.orange_og},e.createElement(Oa,{size:18})),e.createElement(Qe,{ref:r,isOpen:s,right:d.left,maxWidth:"400px",header:e.createElement(Vo,null,e.createElement(N,{size:20},"Notifications"),!!l&&e.createElement(Ho,{size:12,family:"secondary"},l," new"))},e.createElement(qo,null,n.length?n.map(t=>e.createElement(Yo,{key:`notification-${t.id}`,...t,onClick:()=>c(!1)})):e.createElement(Te,{title:"No notifications",subTitle:""})),e.createElement(zo,null)))},Wo=d.div`
375
+ `,Bo=()=>{const t=E.useTheme(),{notifications:a,markAsSeen:i}=L(),n=a.filter(({hideFromHistory:e})=>!e),o=n.filter(({seen:e})=>!e),l=o.length,{popupRef:r,popupOpen:s,setPopupOpen:c,popupPosition:d,handlePosition:u}=Ze({defaultClientHeight:420,defaultClientwidth:400,onClickOutside:()=>{l&&o.forEach(({id:e})=>i(e))}});return e.createElement(jo,null,e.createElement(pt,{onClick:()=>{u(0,0),c(e=>!e)},tooltip:"Notifications",withPing:!!l,pingColor:t.colors.orange_og},e.createElement(Fa,{size:18})),e.createElement(Qe,{ref:r,isOpen:s,right:d.left,maxWidth:"400px",header:e.createElement(Vo,null,e.createElement(N,{size:20},"Notifications"),!!l&&e.createElement(Ho,{size:12,family:"secondary"},l," new"))},e.createElement(qo,null,n.length?n.map(t=>e.createElement(Yo,{key:`notification-${t.id}`,...t,onClick:()=>c(!1)})):e.createElement(Te,{title:"No notifications",subTitle:""})),e.createElement(zo,null)))},Wo=d.div`
376
376
  display: flex;
377
377
  align-items: flex-start;
378
378
  gap: 12px;
@@ -402,7 +402,7 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
402
402
  display: flex;
403
403
  align-items: center;
404
404
  gap: 6px;
405
- `,Yo=({id:t,seen:a,type:i,title:n,message:o,time:l,crdType:r,target:s,onClick:c})=>{const d=E.useTheme(),{formatTimeAgo:u}=zt(),{onClickNotification:p}=Ht(),m=!!r&&!!s,h=n?.toLowerCase().includes(X.Delete.toLowerCase())||!1,g=me(i,d);return e.createElement(Wo,{key:`notification-${t}`,className:m?"click-enabled":"",onClick:()=>{m&&(c(),p({id:t,crdType:r,target:s}))}},e.createElement(_o,{$type:h?B.Error:i},h?e.createElement(xa,null):e.createElement(g,null)),e.createElement(Uo,null,e.createElement(Jo,null,e.createElement(N,{size:14},o)),e.createElement(Go,null,e.createElement(N,{size:10,color:d.text.grey},u(l)),!a&&e.createElement(e.Fragment,null,e.createElement(N,{size:10},"·"),e.createElement(N,{size:10,color:d.colors.orange_soft},"new")))))},Xo=(e,t,a)=>{const i=e?.serviceName||t?.otelServiceName||t?.name,n=a?[Fa]:ze(t?.containers||[]),{priorotizedStatus:o}=re(t?.conditions||[]);return{id:i,title:i,icons:n.length?n:[Ia],status:o,serviceMapEntry:e}},Zo=e=>"user"===e?.otelServiceName&&!e?.namespace&&!e?.name&&!e?.kind,Qo=d.div`
405
+ `,Yo=({id:t,seen:a,type:i,title:n,message:o,time:l,crdType:r,target:s,onClick:c})=>{const d=E.useTheme(),{formatTimeAgo:u}=zt(),{onClickNotification:p}=Ht(),m=!!r&&!!s,h=n?.toLowerCase().includes(X.Delete.toLowerCase())||!1,g=me(i,d);return e.createElement(Wo,{key:`notification-${t}`,className:m?"click-enabled":"",onClick:()=>{m&&(c(),p({id:t,crdType:r,target:s}))}},e.createElement(_o,{$type:h?B.Error:i},h?e.createElement($a,null):e.createElement(g,null)),e.createElement(Uo,null,e.createElement(Jo,null,e.createElement(N,{size:14},o)),e.createElement(Go,null,e.createElement(N,{size:10,color:d.text.grey},u(l)),!a&&e.createElement(e.Fragment,null,e.createElement(N,{size:10},"·"),e.createElement(N,{size:10,color:d.colors.orange_soft},"new")))))},Xo=(e,t,a)=>{const i=e?.serviceName||t?.otelServiceName||t?.name,n=a?[Ia]:ze(t?.containers||[]),{priorotizedStatus:o}=re(t?.conditions||[]);return{id:i,title:i,icons:n.length?n:[Aa],status:o,serviceMapEntry:e}},Zo=e=>"user"===e?.otelServiceName&&!e?.namespace&&!e?.name&&!e?.kind,Qo=d.div`
406
406
  width: 100%;
407
407
  height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px)`};
408
408
  position: relative;
@@ -461,7 +461,7 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
461
461
  max-height: calc(100vh - 200px);
462
462
  height: fit-content;
463
463
  overflow-y: scroll;
464
- `,hl=({onEditStream:t,onEditSources:a,onEditDestinations:i,categories:n})=>{const{selectedStreamName:o}=We(),{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(ae,{$isNotModal:!0},e.createElement(Z,{$gap:12},e.createElement(F,{title:p.SUMMARY,description:p.STREAM_CONFIRM}),e.createElement(ml,null,e.createElement(Y,{title:p.STREAM_NAME,action:()=>e.createElement(_t,{onClick:t}),data:[{title:"",value:o}]}),e.createElement(Y,{title:p.SELECTED_SOURCES,titleBadge:d,action:()=>e.createElement(_t,{onClick:a})},e.createElement(ul,{filteredNamespacesAndSources:r,withInstances:!1})),e.createElement(Y,{title:p.SELECTED_DESTINATIONS,titleBadge:s.length+c.length,action:()=>e.createElement(_t,{onClick:i})},e.createElement(so,{categories:n})))))};var gl;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}(gl||(gl={}));const yl=({onClickId:a,defaultSelectedId:i,extendedNavIcons:n})=>{const{isVm:o}=Be(),[r,s]=t(i||""),c=l(()=>[{id:gl.Overview,icon:Aa,selected:r===gl.Overview,onClick:()=>{s(gl.Overview),a(gl.Overview)},tooltip:"Overview"},...(n||[]).map(e=>({...e,selected:r===e.id,onClick:()=>{s(e.id),e.onClick()}}))],[r]),d=l(()=>{const e=[{id:gl.Sources,icon:La,selected:r===gl.Sources,onClick:()=>{s(gl.Sources),a(gl.Sources)},tooltip:"Sources"},{id:gl.Destinations,icon:Pa,selected:r===gl.Destinations,onClick:()=>{s(gl.Destinations),a(gl.Destinations)},tooltip:"Destinations"}];return o||(e.push({id:gl.InstrumentationRules,icon:Ma,selected:r===gl.InstrumentationRules,onClick:()=>{s(gl.InstrumentationRules),a(gl.InstrumentationRules)},tooltip:"Instrumentation Rules"}),e.push({id:gl.Actions,icon:Ra,selected:r===gl.Actions,onClick:()=>{s(gl.Actions),a(gl.Actions)},tooltip:"Actions"})),e},[o,r]);return e.createElement(Ut,{orientation:"vertical",mainIcons:c,subIcons:d})},vl=({})=>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(Ka,null)),bl=(e,t)=>{const{name:a,kind:i,namespace:n}=e,o=[{title:p.KIND,value:i},{title:p.NAME,value:a,tooltip:"Resource name"}];return t||(o.unshift({title:p.NAMESPACE,value:n}),o.push({type:m.Divider}),o.push({type:m.CopyText,value:`kubectl get ${i} ${a} -n ${n}`.toLowerCase()})),o},fl=d.div`
464
+ `,hl=({onEditStream:t,onEditSources:a,onEditDestinations:i,categories:n})=>{const{selectedStreamName:o}=We(),{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(ae,{$isNotModal:!0},e.createElement(Z,{$gap:12},e.createElement(F,{title:p.SUMMARY,description:p.STREAM_CONFIRM}),e.createElement(ml,null,e.createElement(Y,{title:p.STREAM_NAME,action:()=>e.createElement(_t,{onClick:t}),data:[{title:"",value:o}]}),e.createElement(Y,{title:p.SELECTED_SOURCES,titleBadge:d,action:()=>e.createElement(_t,{onClick:a})},e.createElement(ul,{filteredNamespacesAndSources:r,withInstances:!1})),e.createElement(Y,{title:p.SELECTED_DESTINATIONS,titleBadge:s.length+c.length,action:()=>e.createElement(_t,{onClick:i})},e.createElement(so,{categories:n})))))};var gl;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}(gl||(gl={}));const yl=({onClickId:a,defaultSelectedId:i,extendedNavIcons:n})=>{const{isVm:o}=Be(),[r,s]=t(i||""),c=l(()=>[{id:gl.Overview,icon:Ma,selected:r===gl.Overview,onClick:()=>{s(gl.Overview),a(gl.Overview)},tooltip:"Overview"},...(n||[]).map(e=>({...e,selected:r===e.id,onClick:()=>{s(e.id),e.onClick()}}))],[r]),d=l(()=>{const e=[{id:gl.Sources,icon:Pa,selected:r===gl.Sources,onClick:()=>{s(gl.Sources),a(gl.Sources)},tooltip:"Sources"},{id:gl.Destinations,icon:Ka,selected:r===gl.Destinations,onClick:()=>{s(gl.Destinations),a(gl.Destinations)},tooltip:"Destinations"}];return o||(e.push({id:gl.InstrumentationRules,icon:Ra,selected:r===gl.InstrumentationRules,onClick:()=>{s(gl.InstrumentationRules),a(gl.InstrumentationRules)},tooltip:"Instrumentation Rules"}),e.push({id:gl.Actions,icon:La,selected:r===gl.Actions,onClick:()=>{s(gl.Actions),a(gl.Actions)},tooltip:"Actions"})),e},[o,r]);return e.createElement(Ut,{orientation:"vertical",mainIcons:c,subIcons:d})},vl=({})=>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(ja,null)),bl=(e,t)=>{const{name:a,kind:i,namespace:n}=e,o=[{title:p.KIND,value:i},{title:p.NAME,value:a,tooltip:"Resource name"}];return t||(o.unshift({title:p.NAMESPACE,value:n}),o.push({type:m.Divider}),o.push({type:m.CopyText,value:`kubectl get ${i} ${a} -n ${n}`.toLowerCase()})),o},fl=d.div`
465
465
  display: flex;
466
466
  flex-direction: column;
467
467
  gap: 24px;
@@ -480,12 +480,12 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
480
480
  display: flex;
481
481
  flex-direction: column;
482
482
  gap: 12px;
483
- `,Ol=({persistSources:i,updateSource:o,restartWorkloads:r,fetchSourceById:s,fetchSourceDescribe:c,fetchSourceLibraries:d})=>{const{isVm:u}=Be(),{sources:m}=W(),{selectedStreamName:h}=We(),{drawerType:g,drawerEntityId:y}=P(),v=l(()=>Je(m,h),[m,h]),b=n(null),f=g===H.Source,[x,$]=t(!1),[C,S]=t(!1),[k,w]=t(wl.Overview),[T,D]=t(null);a(()=>{f&&y&&s(y).then(e=>D(e||null))},[f,y]);const{formData:E,handleFormChange:O,resetFormData:F,loadFormWithDrawerItem:I}=ta(),A=l(()=>{if(!f)return F();const e=(T&&JSON.stringify(qt(T))===JSON.stringify(qt(y))?T:null)||v?.find(e=>e.namespace===y.namespace&&e.name===y.name&&e.kind===y.kind);return e?I(e):F(),e},[f,y,v,T]),M=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:wl.Overview,onClick:()=>w(wl.Overview),selected:k===wl.Overview}];return Tl.includes(A?.kind)&&e.push({label:wl.Pods,onClick:()=>w(wl.Pods),selected:k===wl.Pods}),A?.containers?.some(({language:e})=>Dl.includes(e))&&e.push({label:wl.Libraries,onClick:()=>w(wl.Libraries),selected:k===wl.Libraries}),e},[k,A]);return A?e.createElement(yi,{ref:b,onClose:()=>{w(wl.Overview),D(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:ze(A.containers),isEdit:x,isFormDirty:C,onEdit:k===wl.Overview?e=>{$("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=E.otelServiceName!==A.name?E.otelServiceName:"";O("otelServiceName",e),await o(y,{...E,otelServiceName:e}),D(null),S(!1),$(!1)},onDelete:k===wl.Overview?async()=>{const{namespace:e}=A;i({[e]:[{...A,selected:!1,currentStreamName:h}]},{}),D(null),S(!1),$(!1),b.current?.closeDrawer()}:void 0,onCancel:()=>{S(!1),$(!1),O("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(Ea,null),e.createElement(N,{size:14,family:"secondary",decoration:"underline"},"Restart"))}]},k===wl.Overview?x?e.createElement(Nl,null,e.createElement(xl,{formData:E,handleFormChange:(...e)=>{S(!0),O(...e),O("currentStreamName",h)}})):e.createElement(El,null,e.createElement($l,{workloadOdigosHealthStatus:A.workloadOdigosHealthStatus}),e.createElement(G,{conditions:A.conditions||[]}),e.createElement(Y,{title:p.SOURCE_DETAILS,data:A?bl(A,u):[]}),e.createElement(Y,{title:u?p.DETECTED_PROCESSES:p.DETECTED_CONTAINERS,titleBadge:M.isLoading?pe.Loading:M.containers.length,description:M.description||(u?p.DETECTED_PROCESSES_DESCRIPTION:p.DETECTED_CONTAINERS_DESCRIPTION)},M.containers.map(t=>e.createElement(aa,{key:`source-container-${t.containerName}`,...t,callbackRuntimeOverride:async e=>await o(y,e)})))):k===wl.Pods?e.createElement(Cl,{source:A,fetchSourceDescribe:c}):e.createElement(kl,{source:A,fetchSourceLibraries:d})):null},Fl=d.div`
483
+ `,Ol=({persistSources:i,updateSource:o,restartWorkloads:r,fetchSourceById:s,fetchSourceDescribe:c,fetchSourceLibraries:d})=>{const{isVm:u}=Be(),{sources:m}=W(),{selectedStreamName:h}=We(),{drawerType:g,drawerEntityId:y}=P(),v=l(()=>Je(m,h),[m,h]),b=n(null),f=g===H.Source,[x,$]=t(!1),[C,S]=t(!1),[k,w]=t(wl.Overview),[T,D]=t(null);a(()=>{f&&y&&s(y).then(e=>D(e||null))},[f,y]);const{formData:E,handleFormChange:O,resetFormData:F,loadFormWithDrawerItem:I}=ta(),A=l(()=>{if(!f)return F();const e=(T&&JSON.stringify(qt(T))===JSON.stringify(qt(y))?T:null)||v?.find(e=>e.namespace===y.namespace&&e.name===y.name&&e.kind===y.kind);return e?I(e):F(),e},[f,y,v,T]),M=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:wl.Overview,onClick:()=>w(wl.Overview),selected:k===wl.Overview}];return Tl.includes(A?.kind)&&e.push({label:wl.Pods,onClick:()=>w(wl.Pods),selected:k===wl.Pods}),A?.containers?.some(({language:e})=>Dl.includes(e))&&e.push({label:wl.Libraries,onClick:()=>w(wl.Libraries),selected:k===wl.Libraries}),e},[k,A]);return A?e.createElement(yi,{ref:b,onClose:()=>{w(wl.Overview),D(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:ze(A.containers),isEdit:x,isFormDirty:C,onEdit:k===wl.Overview?e=>{$("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=E.otelServiceName!==A.name?E.otelServiceName:"";O("otelServiceName",e),await o(y,{...E,otelServiceName:e}),D(null),S(!1),$(!1)},onDelete:k===wl.Overview?async()=>{const{namespace:e}=A;i({[e]:[{...A,selected:!1,currentStreamName:h}]},{}),D(null),S(!1),$(!1),b.current?.closeDrawer()}:void 0,onCancel:()=>{S(!1),$(!1),O("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(Oa,null),e.createElement(N,{size:14,family:"secondary",decoration:"underline"},"Restart"))}]},k===wl.Overview?x?e.createElement(Nl,null,e.createElement(xl,{formData:E,handleFormChange:(...e)=>{S(!0),O(...e),O("currentStreamName",h)}})):e.createElement(El,null,e.createElement($l,{workloadOdigosHealthStatus:A.workloadOdigosHealthStatus}),e.createElement(G,{conditions:A.conditions||[]}),e.createElement(Y,{title:p.SOURCE_DETAILS,data:A?bl(A,u):[]}),e.createElement(Y,{title:u?p.DETECTED_PROCESSES:p.DETECTED_CONTAINERS,titleBadge:M.isLoading?pe.Loading:M.containers.length,description:M.description||(u?p.DETECTED_PROCESSES_DESCRIPTION:p.DETECTED_CONTAINERS_DESCRIPTION)},M.containers.map(t=>e.createElement(aa,{key:`source-container-${t.containerName}`,...t,callbackRuntimeOverride:async e=>await o(y,e)})))):k===wl.Pods?e.createElement(Cl,{source:A,fetchSourceDescribe:c}):e.createElement(kl,{source:A,fetchSourceLibraries:d})):null},Fl=d.div`
484
484
  max-width: ${({$fullWidth:e})=>e?"unset":"420px"};
485
485
  width: 100%;
486
- `,Il=i(({isModal:t,fetchSingleNamespace:a,onClickSummary:i},n)=>{const l=E.useTheme(),{isVm:r}=Be(),s=oa({fetchSingleNamespace:a}),{selectedSources:c,fetchingNamespace:d,selectedAllNamespaces:u,onSelectAllNamespaces:m,getApiSourcesPayload:h,getApiFutureAppsPayload:g,searchText:y,setSearchText:v,searchBy:b,setSearchBy:f,showSelectedOnly:$,setShowSelectedOnly:C,showRunningOnly:S,setShowRunningOnly:w}=s;o(n,()=>({getFormValues:()=>({apps:h(),futureApps:g()})}));const T=Object.values(c).reduce((e,t)=>e+t.filter(e=>e.selected).length,0);return e.createElement(ae,{$isNotModal:!t},e.createElement(Z,{$gap:12},e.createElement(Z,{$gap:24},i&&e.createElement(gt,{onClick:i}),e.createElement(F,{title:p.SELECT_SOURCES,badgeLabel:T,description:p.SELECT_SOURCES_DESCRIPTION}),e.createElement(ce,{$justifyContent:"space-between"},e.createElement(Fl,{$fullWidth:r},e.createElement(x,{placeholder:b===H.Source?p.SEARCH_SOURCES:p.SEARCH_NAMESPACES,icon:Sa,value:y,onChange:e=>v(e.target.value.toLowerCase())})),!r&&e.createElement(O,{options:[{label:p.SOURCE,value:H.Source,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary},{label:p.NAMESPACE,value:H.Namespace,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary}],selected:b,setSelected:f})),e.createElement(ce,{$gap:36},e.createElement(k,{title:p.SELECT_ALL,initialValue:u,onChange:m,disabled:!!d}),e.createElement(k,{title:p.ONLY_SELECTED,initialValue:$,onChange:C}),e.createElement(k,{title:p.ONLY_RUNNING_INSTANCES,initialValue:S,onChange:w}))),e.createElement(le,null),e.createElement(ul,{isModal:t,...s})))});Il.displayName=Il.name;const Al=({fetchSingleNamespace:t,persistSources:a})=>{const{currentModal:i,setCurrentModal:o}=Q(),l=i===H.Source,r=()=>{o("")},s=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();a(e,t),r()}},c=n(null);return K({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(Il,{ref:c,isModal:!0,fetchSingleNamespace:t})):null},Ml=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},Rl=({metrics:t,maxHeight:a,maxWidth:i})=>{const n=E.useTheme(),{isVm:o}=Be(),r=he(),{isThisPending:c}=R(),{selectedStreamName:d}=We(),{sources:u,sourcesLoading:m}=W(),{setDrawerType:h,setDrawerEntityId:g}=P(),{selectedSources:y,setSelectedSources:b}=Ie(),{isAwaitingInstrumentation:f,sourcesToCreate:x,sourcesCreated:$,sourcesToDelete:C,sourcesDeleted:S}=Ae(),k=l(()=>{const e=(e,t)=>e>0&&Math.floor(100/e*t)||1;return x?e(x,$):C?e(C,S):1},[x,$,C,S]),w=l(()=>Je(u,d),[u,d]),T=l(()=>Ti({instrumentationRules:[],sources:Ue(w,r),actions:[],destinations:[],searchText:r.searchText,selectedCategory:H.Source}).searchResults.find(({category:e})=>e===H.Source)?.entities||[],[w,r]),[D,O]=l(()=>{let e=0;return Object.values(y).forEach(t=>{e+=t.length}),[0!==e,e]},[y]),F=s(e=>{if(e){const e={};T.forEach(t=>{const a={namespace:t.namespace,name:t.name,kind:t.kind};c({entityType:H.Source,entityId:a})||(e[t.namespace]?e[t.namespace].push(t):e[t.namespace]=[t])}),b(e)}else b({})},[T]),I=s(e=>{const{namespace:t,name:a,kind:i}=e,n={...y};n[t]||(n[t]=[]);const o=n[t].findIndex(e=>e.name===a&&e.kind===i);-1===o?n[t].push(e):n[t].splice(o,1),b(n)},[y]),A=l(()=>T.map(a=>{const i=qt(a),o=JSON.stringify(i),{hasErrors:l,hasWarnings:r,hasDisableds:s}=re(a.conditions||[]),d=c({entityType:H.Source,entityId:i}),u=!!y[i.namespace]?.find(e=>e.namespace===i.namespace&&e.name===i.name&&e.kind===i.kind);return{status:l?B.Error:r?B.Warning:void 0,faded:s,onClick:()=>{h(H.Source),g(i)},cells:[{columnKey:"checkbox-and-icon",component:()=>e.createElement(ce,{$gap:16},e.createElement(v,{disabled:d,value:u,onChange:()=>I(a)}),e.createElement(la,{icons:ze(a.containers),id:o}))},{columnKey:"name",value:ve(a,H.Source,{extended:!0})},{columnKey:"kind",value:a.kind,textColor:n.text.info},{columnKey:"namespace",value:a.namespace,textColor:n.text.info},{columnKey:"throughput",value:Ke(Nt(t,H.Source,i).throughput),textColor:n.text.info},{columnKey:"conditions",component:()=>e.createElement(ki,{conditions:a.conditions||[],id:o})},{columnKey:"containers",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:B.Info,title:ra(a.containers),withBorder:!0}))}]}}),[T,y,t,I]),{badge:M,badgeTooltip:L}=l(()=>T.length!==w.length?{badge:`${T.length}/${w.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:w.length,badgeTooltip:void 0},[T,w]);return e.createElement(fe,{$maxWidth:i},e.createElement(xe,null,e.createElement(v,{partiallyChecked:D&&T?.length!==O,value:D&&T?.length===O,onChange:F,disabled:!T?.length}),e.createElement($e,{icon:Ce(H.Source),title:p.SOURCES,badge:M,badgeTooltip:L,loading:m||f})),e.createElement(Se,{$maxHeight:a},e.createElement(ke,{columns:Ml(o),rows:A})),f&&!A.length?e.createElement(we,{style:{marginTop:"2rem",gap:"24px"}},e.createElement(De,{width:420}),e.createElement(ce,{$gap:16},e.createElement(N,{color:n.text.info},x?"Instrumenting":"Uninstrumenting"," workloads..."),e.createElement(Ne,{label:`${k}%`}))):A.length?null:e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(Te,null)))},Ll=({expiresAt:t})=>{const a=E.useTheme(),{formatTimeAgo:i}=zt(),n=i(t),o=new Date(t).toDateString().split(" ").slice(1).join(" "),l=sa(t,0)?a.text.error:sa(t,6048e5)?a.text.warning:a.text.success;return e.createElement(N,{size:14,color:l},n," (",o,")")},Pl=d.div`
486
+ `,Il=i(({isModal:t,fetchSingleNamespace:a,onClickSummary:i},n)=>{const l=E.useTheme(),{isVm:r}=Be(),s=oa({fetchSingleNamespace:a}),{selectedSources:c,fetchingNamespace:d,selectedAllNamespaces:u,onSelectAllNamespaces:m,getApiSourcesPayload:h,getApiFutureAppsPayload:g,searchText:y,setSearchText:v,searchBy:b,setSearchBy:f,showSelectedOnly:$,setShowSelectedOnly:C,showRunningOnly:S,setShowRunningOnly:w}=s;o(n,()=>({getFormValues:()=>({apps:h(),futureApps:g()})}));const T=Object.values(c).reduce((e,t)=>e+t.filter(e=>e.selected).length,0);return e.createElement(ae,{$isNotModal:!t},e.createElement(Z,{$gap:12},e.createElement(Z,{$gap:24},i&&e.createElement(gt,{onClick:i}),e.createElement(F,{title:p.SELECT_SOURCES,badgeLabel:T,description:p.SELECT_SOURCES_DESCRIPTION}),e.createElement(ce,{$justifyContent:"space-between"},e.createElement(Fl,{$fullWidth:r},e.createElement(x,{placeholder:b===H.Source?p.SEARCH_SOURCES:p.SEARCH_NAMESPACES,icon:ka,value:y,onChange:e=>v(e.target.value.toLowerCase())})),!r&&e.createElement(O,{options:[{label:p.SOURCE,value:H.Source,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary},{label:p.NAMESPACE,value:H.Namespace,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary}],selected:b,setSelected:f})),e.createElement(ce,{$gap:36},e.createElement(k,{title:p.SELECT_ALL,initialValue:u,onChange:m,disabled:!!d}),e.createElement(k,{title:p.ONLY_SELECTED,initialValue:$,onChange:C}),e.createElement(k,{title:p.ONLY_RUNNING_INSTANCES,initialValue:S,onChange:w}))),e.createElement(le,null),e.createElement(ul,{isModal:t,...s})))});Il.displayName=Il.name;const Al=({fetchSingleNamespace:t,persistSources:a})=>{const{currentModal:i,setCurrentModal:o}=Q(),l=i===H.Source,r=()=>{o("")},s=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();a(e,t),r()}},c=n(null);return K({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(Il,{ref:c,isModal:!0,fetchSingleNamespace:t})):null},Ml=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},Rl=({metrics:t,maxHeight:a,maxWidth:i})=>{const n=E.useTheme(),{isVm:o}=Be(),r=he(),{isThisPending:c}=R(),{selectedStreamName:d}=We(),{sources:u,sourcesLoading:m}=W(),{setDrawerType:h,setDrawerEntityId:g}=P(),{selectedSources:y,setSelectedSources:b}=Ie(),{isAwaitingInstrumentation:f,sourcesToCreate:x,sourcesCreated:$,sourcesToDelete:C,sourcesDeleted:S}=Ae(),k=l(()=>{const e=(e,t)=>e>0&&Math.floor(100/e*t)||1;return x?e(x,$):C?e(C,S):1},[x,$,C,S]),w=l(()=>Je(u,d),[u,d]),T=l(()=>Ti({instrumentationRules:[],sources:Ue(w,r),actions:[],destinations:[],searchText:r.searchText,selectedCategory:H.Source}).searchResults.find(({category:e})=>e===H.Source)?.entities||[],[w,r]),[D,O]=l(()=>{let e=0;return Object.values(y).forEach(t=>{e+=t.length}),[0!==e,e]},[y]),F=s(e=>{if(e){const e={};T.forEach(t=>{const a={namespace:t.namespace,name:t.name,kind:t.kind};c({entityType:H.Source,entityId:a})||(e[t.namespace]?e[t.namespace].push(t):e[t.namespace]=[t])}),b(e)}else b({})},[T]),I=s(e=>{const{namespace:t,name:a,kind:i}=e,n={...y};n[t]||(n[t]=[]);const o=n[t].findIndex(e=>e.name===a&&e.kind===i);-1===o?n[t].push(e):n[t].splice(o,1),b(n)},[y]),A=l(()=>T.map(a=>{const i=qt(a),o=JSON.stringify(i),{hasErrors:l,hasWarnings:r,hasDisableds:s}=re(a.conditions||[]),d=c({entityType:H.Source,entityId:i}),u=!!y[i.namespace]?.find(e=>e.namespace===i.namespace&&e.name===i.name&&e.kind===i.kind);return{status:l?B.Error:r?B.Warning:void 0,faded:s,onClick:()=>{h(H.Source),g(i)},cells:[{columnKey:"checkbox-and-icon",component:()=>e.createElement(ce,{$gap:16},e.createElement(v,{disabled:d,value:u,onChange:()=>I(a)}),e.createElement(la,{icons:ze(a.containers),id:o}))},{columnKey:"name",value:ve(a,H.Source,{extended:!0})},{columnKey:"kind",value:a.kind,textColor:n.text.info},{columnKey:"namespace",value:a.namespace,textColor:n.text.info},{columnKey:"throughput",value:Ke(Nt(t,H.Source,i).throughput),textColor:n.text.info},{columnKey:"conditions",component:()=>e.createElement(ki,{conditions:a.conditions||[],id:o})},{columnKey:"containers",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:B.Info,title:ra(a.containers),withBorder:!0}))}]}}),[T,y,t,I]),{badge:M,badgeTooltip:L}=l(()=>T.length!==w.length?{badge:`${T.length}/${w.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:w.length,badgeTooltip:void 0},[T,w]);return e.createElement(fe,{$maxWidth:i},e.createElement(xe,null,e.createElement(v,{partiallyChecked:D&&T?.length!==O,value:D&&T?.length===O,onChange:F,disabled:!T?.length}),e.createElement($e,{icon:Ce(H.Source),title:p.SOURCES,badge:M,badgeTooltip:L,loading:m||f})),e.createElement(Se,{$maxHeight:a},e.createElement(ke,{columns:Ml(o),rows:A})),f&&!A.length?e.createElement(we,{style:{marginTop:"2rem",gap:"24px"}},e.createElement(De,{width:420}),e.createElement(ce,{$gap:16},e.createElement(N,{color:n.text.info},x?"Instrumenting":"Uninstrumenting"," workloads..."),e.createElement(Ne,{label:`${k}%`}))):A.length?null:e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(Te,null)))},Ll=({expiresAt:t})=>{const a=E.useTheme(),{formatTimeAgo:i}=zt(),n=i(t),o=new Date(t).toDateString().split(" ").slice(1).join(" "),l=sa(t,0)?a.text.error:sa(t,6048e5)?a.text.warning:a.text.success;return e.createElement(N,{size:14,color:l},n," (",o,")")},Pl=d.div`
487
487
  position: relative;
488
- `,Kl=({token:a,saveToken:i})=>{const n=E.useTheme(),{isCopied:o,clickCopy:l}=ca(),{formData:r,handleFormChange:s,resetFormData:c}=da({token:a}),[d,u]=t(!1),p=()=>{u(!1),c()},m=me(B.Success,n);return e.createElement(ce,{$gap:0},e.createElement(pt,{size:32,onClick:()=>l(a)},o?e.createElement(m,null):e.createElement(ja,null)),e.createElement(le,{orientation:"vertical",length:"12px"}),e.createElement(Pl,null,e.createElement(pt,{size:32,onClick:()=>{u(!0)}},e.createElement(fa,null)),d&&e.createElement(ua,{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)}))))},jl=({tokens:t,saveToken:a})=>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:Va},{columnKey:"name",value:t},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>e.createElement(Ll,{expiresAt:n})},{columnKey:"actions",component:()=>e.createElement(Kl,{token:i,saveToken:a})}]}))}}]}),Vl=({fetchDescribeOdigos:i})=>{const[n,o]=t(null);if(a(()=>{i().then(({data:e})=>{o(e?.describeOdigos||null)})},[i]),!n)return e.createElement(we,null,e.createElement(Re,null));const l=t=>t?.name?[e.createElement(le,{key:`divider-${t.name}`}),e.createElement(Xt,{key:`describe-row-${t.name}`,title:t.name,subTitle:t.explain||void 0,value:{status:t.status||(Qt(t.value)?ea(t.value)?B.Success:B.Error:B.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)))},ql=d.div`
488
+ `,Kl=({token:a,saveToken:i})=>{const{CopyButton:n}=ca(),{formData:o,handleFormChange:l,resetFormData:r}=da({token:a}),[s,c]=t(!1),d=()=>{c(!1),r()};return e.createElement(ce,{$gap:0},e.createElement(n,{value:a,size:ua.L}),e.createElement(le,{orientation:"vertical",length:"12px"}),e.createElement(Pl,null,e.createElement(pt,{size:32,onClick:()=>{c(!0)}},e.createElement(xa,null)),s&&e.createElement(pa,{flipX:!0,clientX:36,isOpen:s,onClose:d,onSave:()=>{i(o.token).then(d)},title:"Enter a new API Token",titleTooltip:"Contact us to generate a new one"},e.createElement(x,{placeholder:"API Token",type:"password",value:o.token,onChange:e=>l("token",e.target.value)}))))},jl=({tokens:t,saveToken:a})=>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:Va},{columnKey:"name",value:t},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>e.createElement(Ll,{expiresAt:n})},{columnKey:"actions",component:()=>e.createElement(Kl,{token:i,saveToken:a})}]}))}}]}),Vl=({fetchDescribeOdigos:i})=>{const[n,o]=t(null);if(a(()=>{i().then(({data:e})=>{o(e?.describeOdigos||null)})},[i]),!n)return e.createElement(we,null,e.createElement(Re,null));const l=t=>t?.name?[e.createElement(le,{key:`divider-${t.name}`}),e.createElement(Xt,{key:`describe-row-${t.name}`,title:t.name,subTitle:t.explain||void 0,value:{status:t.status||(Qt(t.value)?ea(t.value)?B.Success:B.Error:B.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)))},ql=d.div`
489
489
  display: flex;
490
490
  flex-direction: column;
491
491
  gap: 12px;
@@ -527,13 +527,13 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
527
527
  background-color: ${({theme:e})=>e.colors.border};
528
528
  border-radius: 100%;
529
529
  transition: all 0.3s;
530
- `,Jl=({path:t})=>e.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"none"},e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:t})),Gl=()=>{const{darkMode:t,setDarkMode:a}=pa();return e.createElement(_l,{onClick:()=>a(!t)},e.createElement(Jl,{path:"M14 7.977A4.333 4.333 0 1 1 8.023 2H8a6 6 0 1 0 6 6v-.023Z"}),e.createElement(Jl,{path:"M8 15.333v-.666m-5.185-1.482.471-.471M.666 8h.667m1.482-5.185.471.47M8 1.334V.667m4.714 2.619.471-.471M14.667 8h.666m-2.619 4.714.471.471M12 8a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"}),e.createElement(Ul,{$darkMode:t}))},Yl=e=>{const{spans:t}=e,a=new Map;t.forEach(e=>{a.set(e.spanID,{...e,spans:[]})});const i=[];return t.forEach(e=>{const t=a.get(e.spanID);let n=!1;if(e.references.length){const t=e.references.find(e=>"CHILD_OF"===e.refType);t&&t.spanID&&a.has(t.spanID)||(n=!0)}else n=!0;if(n)i.push(t);else{const i=e.references.find(e=>"CHILD_OF"===e.refType);if(i){const e=a.get(i.spanID);e&&(e.spans=e.spans||[],e.spans.push(t),e.spans=e.spans.sort((e,t)=>e.startTime-t.startTime))}}}),i.sort((e,t)=>e.startTime-t.startTime)},Xl=(e,t)=>{const{tags:a}=e,i={},n=[];return a.forEach(e=>{i[e.key]=e.value}),n.push({type:m.Code,value:{language:"json",code:JSON.stringify(i,null,2),pretty:t}}),n},Zl=e=>{const{logs:t}=e,a=[];return t.forEach((e,i)=>{e.fields.forEach(e=>{a.push({title:e.key,value:e.value})}),i!==t.length-1&&a.push({type:m.Divider})}),a},Ql=e=>{const{traceID:t,spanID:a,processID:i,operationName:n,duration:o,startTime:l,warnings:r}=e,s=[];return s.push({type:m.CopyText,title:"Trace ID",value:t}),s.push({type:m.CopyText,title:"Span ID",value:a}),s.push({type:m.Divider}),s.push({title:"Service",value:i}),s.push({title:"Operation",value:n}),s.push({title:"Duration",value:ma(o)}),s.push({title:"Start time",value:new Date(l/1e3).toLocaleString()}),r.length&&(s.push({type:m.Divider}),s.push({title:"Warnings",titleIcon:za,value:r})),s},er=(e,t)=>{const{tags:a}=e,i={},n=[];return a.forEach(e=>{i[e.key]=e.value}),n.push({type:m.Code,value:{language:"json",code:JSON.stringify(i,null,2),pretty:t}}),n},tr=d.div`
530
+ `,Jl=({path:t})=>e.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"none"},e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:t})),Gl=()=>{const{darkMode:t,setDarkMode:a}=ma();return e.createElement(_l,{onClick:()=>a(!t)},e.createElement(Jl,{path:"M14 7.977A4.333 4.333 0 1 1 8.023 2H8a6 6 0 1 0 6 6v-.023Z"}),e.createElement(Jl,{path:"M8 15.333v-.666m-5.185-1.482.471-.471M.666 8h.667m1.482-5.185.471.47M8 1.334V.667m4.714 2.619.471-.471M14.667 8h.666m-2.619 4.714.471.471M12 8a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"}),e.createElement(Ul,{$darkMode:t}))},Yl=e=>{const{spans:t}=e,a=new Map;t.forEach(e=>{a.set(e.spanID,{...e,spans:[]})});const i=[];return t.forEach(e=>{const t=a.get(e.spanID);let n=!1;if(e.references.length){const t=e.references.find(e=>"CHILD_OF"===e.refType);t&&t.spanID&&a.has(t.spanID)||(n=!0)}else n=!0;if(n)i.push(t);else{const i=e.references.find(e=>"CHILD_OF"===e.refType);if(i){const e=a.get(i.spanID);e&&(e.spans=e.spans||[],e.spans.push(t),e.spans=e.spans.sort((e,t)=>e.startTime-t.startTime))}}}),i.sort((e,t)=>e.startTime-t.startTime)},Xl=(e,t)=>{const{tags:a}=e,i={},n=[];return a.forEach(e=>{i[e.key]=e.value}),n.push({type:m.Code,value:{language:"json",code:JSON.stringify(i,null,2),pretty:t}}),n},Zl=e=>{const{logs:t}=e,a=[];return t.forEach((e,i)=>{e.fields.forEach(e=>{a.push({title:e.key,value:e.value})}),i!==t.length-1&&a.push({type:m.Divider})}),a},Ql=e=>{const{traceID:t,spanID:a,processID:i,operationName:n,duration:o,startTime:l,warnings:r}=e,s=[];return s.push({type:m.CopyText,title:"Trace ID",value:t}),s.push({type:m.CopyText,title:"Span ID",value:a}),s.push({type:m.Divider}),s.push({title:"Service",value:i}),s.push({title:"Operation",value:n}),s.push({title:"Duration",value:ha(o)}),s.push({title:"Start time",value:new Date(l/1e3).toLocaleString()}),r.length&&(s.push({type:m.Divider}),s.push({title:"Warnings",titleIcon:za,value:r})),s},er=(e,t)=>{const{tags:a}=e,i={},n=[];return a.forEach(e=>{i[e.key]=e.value}),n.push({type:m.Code,value:{language:"json",code:JSON.stringify(i,null,2),pretty:t}}),n},tr=d.div`
531
531
  display: flex;
532
532
  flex-direction: column;
533
533
  gap: 12px;
534
534
  max-height: 100vh;
535
535
  overflow-y: auto;
536
- `,ar=({span:a,process:i,onClose:n})=>{const[o,l]=t(!0),[r,s]=t(!0);return e.createElement(V,{width:"750px",isOpen:!0,onClose:n,header:{icons:[Ha],title:a.operationName},footer:{isOpen:!1}},e.createElement(tr,null,e.createElement(Y,{title:"Details",data:Ql(a)}),a.logs.length>0&&e.createElement(Y,{title:"Errors",titleBadge:a.logs.length,titleIcon:za,data:Zl(a)}),e.createElement(Y,{title:"Tags",data:Xl(a,o),action:e.createElement(ha,{isPrettyMode:o,setIsPrettyMode:l})}),i&&e.createElement(Y,{title:`Process (${i.serviceName})`,data:er(i,r),action:e.createElement(ha,{isPrettyMode:r,setIsPrettyMode:s})})))},ir=370,nr=["#33DCA7","#50F6E8","#444AD9","#8B55FF","#FF7CA9"].reverse(),or=d.div`
536
+ `,ar=({span:a,process:i,onClose:n})=>{const[o,l]=t(!0),[r,s]=t(!0);return e.createElement(V,{width:"750px",isOpen:!0,onClose:n,header:{icons:[Ha],title:a.operationName},footer:{isOpen:!1}},e.createElement(tr,null,e.createElement(Y,{title:"Details",data:Ql(a)}),a.logs.length>0&&e.createElement(Y,{title:"Errors",titleBadge:a.logs.length,titleIcon:za,data:Zl(a)}),e.createElement(Y,{title:"Tags",data:Xl(a,o),action:e.createElement(ga,{isPrettyMode:o,setIsPrettyMode:l})}),i&&e.createElement(Y,{title:`Process (${i.serviceName})`,data:er(i,r),action:e.createElement(ga,{isPrettyMode:r,setIsPrettyMode:s})})))},ir=370,nr=["#33DCA7","#50F6E8","#444AD9","#8B55FF","#FF7CA9"].reverse(),or=d.div`
537
537
  display: flex;
538
538
  align-items: center;
539
539
  width: ${ir}px;
@@ -568,7 +568,7 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
568
568
  color: ${({theme:e})=>e.text.darker_grey};
569
569
  font-family: ${({theme:e})=>e.font_family.secondary};
570
570
  white-space: nowrap;
571
- `,dr=({span:a,depth:i,indexInMatrix:n,maxDuration:o,minStartTime:l,maxEndTime:r,withErrors:s,errorTooltip:c,isOpen:d,withToggle:u,onToggleOpen:p,onSelect:m})=>{const h=E.useTheme(),[g,y]=t(!1),v=ir-12*i-20-(s?12:0),b=s&&(1===i||a.logs.length>0);return e.createElement(or,{className:"span-container",$withErrors:s,$preventHover:g,onClick:m},e.createElement(lr,{$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(ya,{maxWidth:v/2,text:a.processID,textSize:14}),e.createElement(N,{size:12,color:h.text.darker_grey},"•"),e.createElement(ya,{maxWidth:v/2,text:a.operationName,textSize:12,textColor:h.text.darker_grey})),s&&(b?e.createElement(ue,{...c},e.createElement(za,{fill:h.text.error})):e.createElement("div",{style:{position:"relative"}},e.createElement("div",{style:{position:"absolute",top:"-24px",right:"8px"}},e.createElement(le,{type:B.Error,orientation:"vertical",thickness:1,length:"48px",margin:"0",opacity:.5}))))),e.createElement(rr,{className:"span-right"},e.createElement(sr,{$indexInMatrix:n,$duration:a.duration,$maxDuration:o,$startTime:a.startTime,$minStartTime:l,$maxEndTime:r},e.createElement(cr,null,ma(a.duration)))))},ur=({spans:t,logs:a,depth:i,indexInMatrix:n,maxDuration:o,minStartTime:l,maxEndTime:r,openSpanIdsState:s,selectedSpanState:c})=>{const d=E.useTheme();return t.map((t,u)=>{const p=t.spanID,m=s.value.includes(p),h=!!t.spans?.length,g=a.length?a:ga(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,b=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(dr,{span:t,depth:i,indexInMatrix:n+u+i,maxDuration:o,minStartTime:l,maxEndTime:r,withErrors:y,errorTooltip:{titleIcon:za,title:v,text:b},isOpen:m,withToggle:h,onToggleOpen:()=>s.set(e=>e.some(e=>e===p)?e.filter(e=>e!=p):[...e,p,...ga(t,"spans","spanID")]),onSelect:()=>c.set(e=>e?.spanID===p?null:t)}),m&&h?e.createElement(ur,{spans:t.spans||[],logs:g,depth:i+1,indexInMatrix:n+u,maxDuration:o,minStartTime:l,maxEndTime:r,openSpanIdsState:s,selectedSpanState:c}):null)})},pr=d.div`
571
+ `,dr=({span:a,depth:i,indexInMatrix:n,maxDuration:o,minStartTime:l,maxEndTime:r,withErrors:s,errorTooltip:c,isOpen:d,withToggle:u,onToggleOpen:p,onSelect:m})=>{const h=E.useTheme(),[g,y]=t(!1),v=ir-12*i-20-(s?12:0),b=s&&(1===i||a.logs.length>0);return e.createElement(or,{className:"span-container",$withErrors:s,$preventHover:g,onClick:m},e.createElement(lr,{$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(va,{maxWidth:v/2,text:a.processID,textSize:14}),e.createElement(N,{size:12,color:h.text.darker_grey},"•"),e.createElement(va,{maxWidth:v/2,text:a.operationName,textSize:12,textColor:h.text.darker_grey})),s&&(b?e.createElement(ue,{...c},e.createElement(za,{fill:h.text.error})):e.createElement("div",{style:{position:"relative"}},e.createElement("div",{style:{position:"absolute",top:"-24px",right:"8px"}},e.createElement(le,{type:B.Error,orientation:"vertical",thickness:1,length:"48px",margin:"0",opacity:.5}))))),e.createElement(rr,{className:"span-right"},e.createElement(sr,{$indexInMatrix:n,$duration:a.duration,$maxDuration:o,$startTime:a.startTime,$minStartTime:l,$maxEndTime:r},e.createElement(cr,null,ha(a.duration)))))},ur=({spans:t,logs:a,depth:i,indexInMatrix:n,maxDuration:o,minStartTime:l,maxEndTime:r,openSpanIdsState:s,selectedSpanState:c})=>{const d=E.useTheme();return t.map((t,u)=>{const p=t.spanID,m=s.value.includes(p),h=!!t.spans?.length,g=a.length?a:ya(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,b=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(dr,{span:t,depth:i,indexInMatrix:n+u+i,maxDuration:o,minStartTime:l,maxEndTime:r,withErrors:y,errorTooltip:{titleIcon:za,title:v,text:b},isOpen:m,withToggle:h,onToggleOpen:()=>s.set(e=>e.some(e=>e===p)?e.filter(e=>e!=p):[...e,p,...ya(t,"spans","spanID")]),onSelect:()=>c.set(e=>e?.spanID===p?null:t)}),m&&h?e.createElement(ur,{spans:t.spans||[],logs:g,depth:i+1,indexInMatrix:n+u,maxDuration:o,minStartTime:l,maxEndTime:r,openSpanIdsState:s,selectedSpanState:c}):null)})},pr=d.div`
572
572
  width: 100%;
573
573
  `,mr=d.div`
574
574
  max-height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
@@ -598,4 +598,4 @@ import e,{useState as t,useEffect as a,forwardRef as i,useRef as n,useImperative
598
598
  padding-top: 12px;
599
599
  padding-left: 12px;
600
600
  white-space: nowrap;
601
- `,vr=({heightToRemove:a,traces:i,isLoading:n})=>{const[o,r]=t([]),[s,c]=t(null),d=l(()=>wt(i).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:Yl(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(pr,{$heightToRemove:a},n?e.createElement(we,{$height:"50vh"},e.createElement(Re,{scale:1.5})):d.length?e.createElement(mr,{$heightToRemove:a},e.createElement(hr,null,e.createElement(N,null,"Service & operation")),new Array(5).fill(null).map((t,i)=>e.createElement(gr,{key:`${i}-divider`,$heightToRemove:a,index:i},e.createElement(yr,null,ma(u/5*i)))),d.map((t,a)=>{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(ur,{key:`recursive-spans-${t.traceID}`,spans:i,logs:[],depth:1,indexInMatrix:a,maxDuration:u,minStartTime:n,maxEndTime:l,openSpanIdsState:{value:o,set:r},selectedSpanState:{value:s,set:c}})})):e.createElement(we,{$height:"50vh"},e.createElement(Te,{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{xi as ActionDrawer,gi as ActionForm,Ci as ActionModal,Ni as ActionTable,Ai as AwaitPipeline,en as ConditionDropdown,Gi as DataFlow,Tn as DataFlowActionsMenu,yn as DataStreamDrawer,hn as DataStreamForm,Nn as DataStreamModal,Dn as DataStreamSelectionForm,qn as DestinationDrawer,Kn as DestinationForm,lo as DestinationModal,po as DestinationSelectionForm,ho as DestinationTable,tn as ErrorDropdown,Oo as InstrumentationRuleDrawer,Do as InstrumentationRuleForm,Ao as InstrumentationRuleModal,Lo as InstrumentationRuleTable,ln as KindDropdown,an as LanguageDropdown,nn as MonitorDropdown,Ko as MultiSourceControl,on as NamespaceDropdown,gl as NavIconIds,Bo as NotificationManager,yi as OverviewDrawer,tl as ServiceMap,hl as SetupSummary,yl as SideNav,vl as SlackInvite,Ol as SourceDrawer,xl as SourceForm,Al as SourceModal,Il as SourceSelectionForm,Rl as SourceTable,Hl as SystemOverview,ki as TableCellConditions,Wl as ToastList,Gl as ToggleDarkMode,vr as TraceView};
601
+ `,vr=({heightToRemove:a,traces:i,isLoading:n})=>{const[o,r]=t([]),[s,c]=t(null),d=l(()=>wt(i).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:Yl(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(pr,{$heightToRemove:a},n?e.createElement(we,{$height:"50vh"},e.createElement(Re,{scale:1.5})):d.length?e.createElement(mr,{$heightToRemove:a},e.createElement(hr,null,e.createElement(N,null,"Service & operation")),new Array(5).fill(null).map((t,i)=>e.createElement(gr,{key:`${i}-divider`,$heightToRemove:a,index:i},e.createElement(yr,null,ha(u/5*i)))),d.map((t,a)=>{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(ur,{key:`recursive-spans-${t.traceID}`,spans:i,logs:[],depth:1,indexInMatrix:a,maxDuration:u,minStartTime:n,maxEndTime:l,openSpanIdsState:{value:o,set:r},selectedSpanState:{value:s,set:c}})})):e.createElement(we,{$height:"50vh"},e.createElement(Te,{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{xi as ActionDrawer,gi as ActionForm,Ci as ActionModal,Ni as ActionTable,Ai as AwaitPipeline,en as ConditionDropdown,Gi as DataFlow,Tn as DataFlowActionsMenu,yn as DataStreamDrawer,hn as DataStreamForm,Nn as DataStreamModal,Dn as DataStreamSelectionForm,qn as DestinationDrawer,Kn as DestinationForm,lo as DestinationModal,po as DestinationSelectionForm,ho as DestinationTable,tn as ErrorDropdown,Oo as InstrumentationRuleDrawer,Do as InstrumentationRuleForm,Ao as InstrumentationRuleModal,Lo as InstrumentationRuleTable,ln as KindDropdown,an as LanguageDropdown,nn as MonitorDropdown,Ko as MultiSourceControl,on as NamespaceDropdown,gl as NavIconIds,Bo as NotificationManager,yi as OverviewDrawer,tl as ServiceMap,hl as SetupSummary,yl as SideNav,vl as SlackInvite,Ol as SourceDrawer,xl as SourceForm,Al as SourceModal,Il as SourceSelectionForm,Rl as SourceTable,Hl as SystemOverview,ki as TableCellConditions,Wl as ToastList,Gl as ToggleDarkMode,vr as TraceView};
@@ -1,2 +1,3 @@
1
- import { OtherStatusType, PodContainerLifecycleStatus, PodPhase, StatusType, WorkloadRolloutStatus } from '@/types';
2
- export declare const getStatusFromPodStatus: (status?: WorkloadRolloutStatus | PodPhase | PodContainerLifecycleStatus) => StatusType | OtherStatusType;
1
+ import { OtherStatusType, PodContainerLifecycleStatus, PodContainerStatus, PodPhase, StatusType, WorkloadRolloutStatus } from '@/types';
2
+ export type PodStatus = WorkloadRolloutStatus | PodPhase | PodContainerStatus | PodContainerLifecycleStatus;
3
+ export declare const getStatusFromPodStatus: (status?: PodStatus) => StatusType | OtherStatusType;
package/lib/functions.js CHANGED
@@ -1 +1 @@
1
- export{bo as capitalizeFirstLetter,cn as cleanObjectEmptyStringsValues,bj as compareCondition,bq as deepClone,as as filterActions,aY as filterDestinations,aZ as filterDestinationsByStream,aW as filterSources,aX as filterSourcesByStream,co as flattenObjectKeys,aN as formatBytes,c2 as formatDuration,g as generateId,a9 as getActionIcon,al as getConditionsBooleans,aR as getContainersIcons,bZ as getContainersInstrumentedCount,aQ as getDestinationIcon,az as getEntityIcon,aL as getEntityId,au as getEntityLabel,cp as getIdFromSseTarget,aP as getInstrumentationRuleIcon,cq as getMainContainerLanguage,bt as getMetricForEntity,cr as getMonitorIcon,cs as getPlatformIcon,ct as getPlatformLabel,bC as getProgrammingLanguageIcon,c4 as getRecursiveValues,cu as getSseTargetFromId,cv as getStatusColor,b as getStatusFromPodStatus,aq as getStatusIcon,bM as getStatusTypeFromOdigosHealth,cw as getValueForRange,bG as getWorkloadId,bn as getYamlFieldsForDestination,bN as hasUnhealthyInstances,G as isEmpty,cx as isLegalK8sLabel,b_ as isOverTime,bR as isStringABoolean,cy as isTimeElapsed,cz as isValidVersion,an as mapConditions,bi as mapDestinationFieldsForDisplay,aM as mapExportedSignals,cA as numbersOnly,bS as parseBooleanFromString,cB as parseJsonStringToPrettyString,cC as removeEmptyValuesFromObject,bk as safeJsonParse,cD as safeJsonStringify,aF as sleep,b4 as splitCamelString,cE as stringifyNonStringValues}from"./chunks/ui-components-c87427ab.js";import"./icons.js";import"react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-55cc654c.js";import"react-dom";import"styled-components";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
1
+ export{bq as capitalizeFirstLetter,cr as cleanObjectEmptyStringsValues,bl as compareCondition,bs as deepClone,au as filterActions,a_ as filterDestinations,a$ as filterDestinationsByStream,aY as filterSources,aZ as filterSourcesByStream,cs as flattenObjectKeys,aP as formatBytes,c5 as formatDuration,g as generateId,ab as getActionIcon,an as getConditionsBooleans,aT as getContainersIcons,b$ as getContainersInstrumentedCount,aS as getDestinationIcon,aB as getEntityIcon,aN as getEntityId,aw as getEntityLabel,ct as getIdFromSseTarget,aR as getInstrumentationRuleIcon,cu as getMainContainerLanguage,bv as getMetricForEntity,cv as getMonitorIcon,cw as getPlatformIcon,cx as getPlatformLabel,bE as getProgrammingLanguageIcon,c7 as getRecursiveValues,cy as getSseTargetFromId,l as getStatusColor,b as getStatusFromPodStatus,as as getStatusIcon,bO as getStatusTypeFromOdigosHealth,cz as getValueForRange,bI as getWorkloadId,bp as getYamlFieldsForDestination,bP as hasUnhealthyInstances,J as isEmpty,cA as isLegalK8sLabel,c0 as isOverTime,bT as isStringABoolean,cB as isTimeElapsed,cC as isValidVersion,ap as mapConditions,bk as mapDestinationFieldsForDisplay,aO as mapExportedSignals,cD as numbersOnly,bU as parseBooleanFromString,cE as parseJsonStringToPrettyString,cF as removeEmptyValuesFromObject,bm as safeJsonParse,cG as safeJsonStringify,aH as sleep,b6 as splitCamelString,cH as stringifyNonStringValues}from"./chunks/ui-components-d05b354a.js";import"./icons.js";import"react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-55cc654c.js";import"react-dom";import"styled-components";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
@@ -1,4 +1,13 @@
1
- declare const useCopy: () => {
1
+ import React from 'react';
2
+ import { IconButtonSize } from '@/components/_v2/icon-button';
3
+ interface UseCopyProps {
4
+ onDone?: () => void;
5
+ }
6
+ declare const useCopy: ({ onDone }?: UseCopyProps) => {
7
+ CopyButton: React.FC<{
8
+ value: string;
9
+ size?: IconButtonSize;
10
+ }>;
2
11
  isCopied: boolean;
3
12
  copiedIndex: number;
4
13
  clickCopy: (str: string, idx?: number) => Promise<void>;
package/lib/hooks.js CHANGED
@@ -1 +1 @@
1
- export{a7 as useActionFormData,cI as useBodyScroll,a_ as useClickNode,bH as useClickNotification,aT as useConnection,aV as useContainerSize,a as useCopy,ba as useDataStreamFormData,bm as useDestinationFormData,b$ as useGenericForm,cJ as useInfiniteScroll,bD as useInstrumentationRuleFormData,a0 as useKeyDown,b3 as useOnClickOutside,a$ as usePopup,b9 as useSessionStorage,bT as useSourceFormData,bX as useSourceSelectionFormData,u as useTimeAgo,bF as useTransition}from"./chunks/ui-components-c87427ab.js";import"./icons.js";import"react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-55cc654c.js";import"react-dom";import"styled-components";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
1
+ export{a9 as useActionFormData,cL as useBodyScroll,b0 as useClickNode,bJ as useClickNotification,aV as useConnection,aX as useContainerSize,a as useCopy,bc as useDataStreamFormData,bo as useDestinationFormData,c1 as useGenericForm,cM as useInfiniteScroll,bF as useInstrumentationRuleFormData,a2 as useKeyDown,b5 as useOnClickOutside,b1 as usePopup,bb as useSessionStorage,bV as useSourceFormData,bZ as useSourceSelectionFormData,u as useTimeAgo,bH as useTransition}from"./chunks/ui-components-d05b354a.js";import"./icons.js";import"react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-55cc654c.js";import"react-dom";import"styled-components";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";