diff options
Diffstat (limited to 'web/gui/v2/709.b63f3383f748847da537.chunk.js')
-rw-r--r-- | web/gui/v2/709.b63f3383f748847da537.chunk.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/web/gui/v2/709.b63f3383f748847da537.chunk.js b/web/gui/v2/709.b63f3383f748847da537.chunk.js new file mode 100644 index 00000000..6c4aaed4 --- /dev/null +++ b/web/gui/v2/709.b63f3383f748847da537.chunk.js @@ -0,0 +1 @@ +!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ce2d90a0-7790-425b-a0e9-ee5a12fe29f0",e._sentryDebugIdIdentifier="sentry-dbid-ce2d90a0-7790-425b-a0e9-ee5a12fe29f0")}catch(e){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"068845a823c962888381794c354a8f6b6e263031"},(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[709],{80959:function(e,t,n){var r=n(87462),a=n(45987),o=n(67294),l=n(15557),i=["message","title"];t.Z=function(e){var t=e.message,n=e.title,c=(0,a.Z)(e,i),u=(null===c||void 0===c?void 0:c["data-testid"])||"functionError";return o.createElement(l.Flex,(0,r.Z)({alignItems:"center",column:!0,"data-testid":u,flex:!0,gap:1,justifyContent:"center",padding:[0,20]},c),o.createElement(l.H3,{"data-testid":"".concat(u,"-title")},n),o.createElement(l.TextBig,{color:"textDescription","data-testid":"".concat(u,"-message")},t))}},22709:function(e,t,n){n.r(t),n.d(t,{default:function(){return ur}});var r={};n.r(r),n.d(r,{base:function(){return vn},table:function(){return pn}});var a=n(29439),o=n(67294),l=n(91268),i=n(96929),c=n(3322),u=(n(82526),n(57327),n(41539),n(88449),n(2490),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070),n(4942)),s=(n(47941),n(21249),n(57640),n(9924),n(60677)),d=n(15557),m=n(54316),f=n(46667),p=n(82351),v=n(29814),g=n(72843),b=n(37518),y=n(87462),h=(n(85827),n(25387),n(72608),n(97945)),E=n(97193),x=n(8144);function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach((function(t){(0,u.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var C=function(e){var t=e.roomId,n=e.flavour,r=function(e){var t="fn"===e;return(0,o.useMemo)((function(){return{Live:{head:{label:"Live nodes",textColor:"textLite",iconName:"connectivityStatusLive",hasFn:t},node:{textColor:"text",showFn:t,requireFn:t}},Stale:{head:{label:"Stale nodes",textColor:"textLite",iconName:"connectivityStatusStale"},node:{textColor:"text",disabled:t}},Offline:{head:{label:"Offline nodes",textColor:"textLite",iconName:"connectivityStatusOffline",disabled:t},node:{textColor:"textLite",disabled:t}}}}),[e])}(n),a=function(e){var t=(0,c.ZQ)({extraKey:e}).aggregations;return(0,o.useMemo)((function(){return null!==t&&void 0!==t&&t.node_ids?t.node_ids.buckets.reduce((function(e,t){return w(w({},e),{},(0,u.Z)({},t.key,t.hits.doc_count))}),{}):null}),[t])}(n),l="fn"===n,i=(0,c.CE)({extraKey:n});return o.createElement(x.Z,{title:"Nodes",testIdPrefix:"nodes",baseKey:t,extraKey:n,param:"selectedNodeIds",multi:"feed"===n},o.createElement(E.Z,(0,y.Z)({key:n,baseKey:t,extraKey:n,statusProps:r,background:"mainBackground",itemProps:{padding:[1,1,1,.5],maxLength:30},searchMargin:[0,0,2],height:{max:"300px"},multi:"feed"===n,nodeCounts:a},l&&{useFilteredIds:h.HZ},{currentFn:i})))},S=n(46742),Z=function(e){var t=e.param,n=e.baseKey,r=e.extraKey,a=e.testIdPrefix,l=e.title,i=e.items,c=void 0===i?["processes"]:i,u=e.multi,s=void 0!==u&&u;return c.length?o.createElement(x.Z,{title:l,testIdPrefix:a,baseKey:n,extraKey:r,param:t,multi:s},o.createElement(S.ZP,{param:t,baseKey:n,extraKey:r,testIdPrefix:a,collection:c,multi:s})):null},k=n(93433),j=(n(92222),function(e,t){var n=(0,c.ZQ)({extraKey:e}),r=n.loaded,a=n.loading,l=n.columns,i=n.sortedColumns,u=(0,o.useRef)([]);return(0,o.useMemo)((function(){return!r||a||(u.current=i.reduce((function(e,n){return l[n].filter?[].concat((0,k.Z)(e),[t(n,l)]):e}),[])),u.current}),[r,a])}),P=n(95248),T=n(71002),I=(n(64211),n(41874),n(69720),n(26699),n(32023),n(54678),n(4480));function D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function K(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?D(Object(n),!0).forEach((function(t){(0,u.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var F={query:function(e,t,n){var r=n.columnVisibility,o=(null===t||void 0===t?void 0:t.toLowerCase())||"";return Object.entries(e).some((function(e){var t=(0,a.Z)(e,2),n=t[0],l=t[1];return!!r[n]&&(null!==l&&"undefined"!==typeof l&&(Array.isArray(l)?l.some((function(e){return String(e).toLowerCase().includes(o)})):("object"===(0,T.Z)(l)&&Object.keys(l).some((function(e){return String(l[e]).toLowerCase().includes(o)})),String(l).toLowerCase().includes(o))))}))}},N=function(e){return function(t,n){return!e.some((function(e){var r=(0,a.Z)(e,2),o=r[0],l=r[1];return F[o]?!F[o](t,l,n):!function(e){return function(t,n,r){var a;if("range"===(null===(a=r.columns[e])||void 0===a?void 0:a.filter)&&null!==n&&void 0!==n&&n.length)return t[e]>=n[0]&&t[e]<=n[1];if(!Array.isArray(n)||!n.length)return!0;var o=t[e];return"number"===typeof o?(o=parseFloat(o),n.some((function(e){return parseFloat(e)===o}))):n.includes(o)}}(o)(t,l,n)}))}},z=(0,I.CG)({key:"fnDataFiltered",get:function(e){var t=e.extraKey,n=e.roomId,r=e.omit,a=void 0===r?[]:r,o=e.keepAll,l=e.fn;return function(e){var r,i=e.get,u=null===(r=i((0,P.dz)({key:n,extraKey:"".concat(l,"Settings")})))||void 0===r?void 0:r.sortColumn,s=i((0,P.dz)({key:n,extraKey:t})),d=Object.keys(s).reduce((function(e,t){return a.includes(t)||e.push([t,s[t]]),e}),[]),m=i((0,c.tD)({id:l})),f=m.columnVisibility,p=m.data,v=m.columns;if("feed"===l||!d.length||!p)return p||[];var g=N(d);return o?p.map((function(e){return g(e,{columnVisibility:f,columns:v,sortColumn:u})?e:K(K({},e),{},{hidden:!0})})):p.filter((function(e){return g(e,{columnVisibility:f,columns:v,sortColumn:u})}))}},cachePolicy_UNSTABLE:{eviction:"most-recent"}}),L=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.extraKey,n=void 0===t?"fn":t,r=e.omit,a=void 0===r?[]:r,o=e.keepAll,l=void 0!==o&&o,i=(0,c.CE)({extraKey:n}),u=(0,b.UL)();return(0,I.sJ)(z({extraKey:"".concat(i||n,"Filters"),fn:i,roomId:u,omit:a,keepAll:l}))},A=(n(2707),n(6557)),R=function(e){return e.id},M={string:function(e,t){return e.localeCompare(t,void 0,{sensitivity:"accent"})},integer:function(e,t){return e-t}},_={table:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.param,r=t.columns;return Object.entries(e.reduce((function(e,t){var a,o;return e[t[n]]={count:((null===(a=e[t[n]])||void 0===a?void 0:a.count)||0)+(t.hidden?0:1),type:null===(o=r[n])||void 0===o?void 0:o.type},e}),{})).map((function(e){var t=(0,a.Z)(e,2),n=t[0],r=t[1];return{id:n,type:r.type,count:r.count}})).sort((function(e,t){return(M[e.type]||M.integer)(e.id,t.id)}))},default:n.n(A)()},V=function(e,t){return{key:e,type:t[e].filter}},B={multiselect:function(e){var t=e.param,n=e.baseKey,r=e.extraKey,a=e.filtersKey,l=e.testIdPrefix,i=e.title,u=function(e){var t=e.extraKey,n=e.filtersKey,r=e.param,a=L({extraKey:t,omit:[r],keepAll:!0}),l=(0,P.tk)(r,{extraKey:n}),i=(0,c.ZQ)({key:"type",extraKey:t}),u=_[i]||_.default,s=(0,c.ZQ)({key:"columns",extraKey:t});return(0,o.useMemo)((function(){return u(a,{param:r,columns:s})}),[r,a,l])}({param:t,extraKey:r,filtersKey:a});return u&&u.length?o.createElement(x.Z,{title:i,testIdPrefix:l,baseKey:n,extraKey:a,param:t,defaultIsOpen:!1},o.createElement(S.ZP,{param:t,baseKey:n,extraKey:a,testIdPrefix:l,collection:u,capitalized:!1,getValue:R,getLabel:R})):null},range:function(e){var t=e.param,n=e.baseKey,r=e.extraKey,l=e.filtersKey,i=e.testIdPrefix,u=e.title,s=(0,c.ZQ)({extraKey:r}).columns,m=(0,P.I0)(t,{defaultValue:[],key:n,extraKey:l}),f=(0,a.Z)(m,2),p=f[0],v=f[1];if(!s[t])return null;var g=1*s[t].range.min,b=1*s[t].range.max;return o.createElement(x.Z,{title:u,testIdPrefix:i,baseKey:n,extraKey:l,param:t,defaultIsOpen:!1},o.createElement(d.Box,{padding:[2,0],width:"100%"},o.createElement(d.MultiRangeInput,{min:g,max:b,onChange:function(e){var t=e.min,n=e.max;return v([t,n])},initMin:p[0]?1*p[0]:g,initMax:p[1]?1*p[1]:b})))}},U=function(e){var t=e.roomId,n=e.extraKey,r=(0,c.CE)({extraKey:n}),a=function(e){return j(e,V)}(n);return a.map((function(e){var a=B[e.type]||B.multiselect;return o.createElement(a,{key:e.key,title:e.key,testIdPrefix:"function",baseKey:t,extraKey:n,filtersKey:"".concat(r||n,"Filters"),param:e.key})}))},H=function(e){return e.name||e.id},W=function(e){return e.id},Q=function(e){var t=e.title,n=e.options,r=e.param,a=e.baseKey,l=e.filtersKey,i=e.testIdPrefix;return null!==n&&void 0!==n&&n.length?o.createElement(x.Z,{title:t,testIdPrefix:i,baseKey:a,extraKey:l,param:r,defaultIsOpen:!1},o.createElement(S.ZP,{param:r,baseKey:a,extraKey:l,testIdPrefix:i,collection:n,capitalized:!1,getValue:W,getLabel:H})):null},q={nodes:!0},G=function(e){var t=e.roomId,n=e.extraKey,r=(0,c.CE)({extraKey:n}),a=(0,c.Cf)(n);return a.length?a.map((function(e){return q[e.id]?null:o.createElement(Q,{key:e.id,title:e.name,options:e.options,param:e.id,testIdPrefix:"function",baseKey:t,filtersKey:"".concat(r||n,"Filters")})})):null},X=(0,o.memo)((function(e){var t=e.flavour,n=e.refetch,r=e.availableFns,a=(0,b.UL)(),l=(0,c.ZQ)({extraKey:t}),i=l.loaded,u=l.aggregations,s=l.error;return o.createElement(d.Flex,{column:!0,overflow:{vertical:"auto"},padding:[0,3,30]},"fn"===t&&o.createElement(Z,{title:"Function",testIdPrefix:"function",baseKey:a,extraKey:t,param:"selected",items:r}),o.createElement(C,{roomId:a,flavour:t}),i&&!u&&!s&&o.createElement(U,{roomId:a,extraKey:t}),i&&u&&!s&&o.createElement(G,{roomId:a,extraKey:t,onFilter:n}))})),J=n(45987),Y=(n(38862),n(32586)),$=n(76184),ee=n(52428),te=["selectedRowData","setSelectedRowData"],ne=function(e){var t=e.data;return o.createElement($.Z,{name:"Files"},o.createElement(d.Flex,{gap:1,padding:[0,1],alignItems:"center"},o.createElement(d.Box,{sx:{fontWeight:"500",letterSpacing:"1px"},as:d.Text,color:"textLite"},"{;}"),o.createElement(d.TextSmall,null,"Copy data as"),o.createElement(d.Flex,{cursor:"pointer",gap:1,onClick:(0,ee.JG)(JSON.stringify(t),{text:"JSON copied to clipboard"})},o.createElement(d.TextSmall,{color:"primary"},"json"),o.createElement(d.Icon,{color:"primary",size:"small",name:"copy"}))))},re=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return Object.entries(t).reduce((function(t,n){var o=(0,a.Z)(n,2),l=o[0],i=o[1],c=r?"".concat(r,".").concat(l):l,u=Array.isArray(i),s=u&&"object"===(0,T.Z)(i[0])&&null!==i[0];return!i||"object"!==(0,T.Z)(i)||u&&!s?[].concat((0,k.Z)(t),[[c,u?i.length>1?"[".concat(i.join(", "),"]"):i[0]:i]]):e(s?function(e){return e.reduce((function(e,t){return Object.entries(t).forEach((function(t){var n=(0,a.Z)(t,2),r=n[0],o=n[1];e[r]=[].concat((0,k.Z)(e[r]||[]),[o])})),e}),{})}(i):i,t,c)}),n)},ae=function(e){var t=e.selectedRowData,n=void 0===t?{}:t,r=e.setSelectedRowData,l=(0,J.Z)(e,te),i=(0,o.useMemo)((function(){return re(n).sort((function(e,t){var n=(0,a.Z)(e,1)[0],r=(0,a.Z)(t,1)[0];return n.localeCompare(r)}))}),[n]);return o.createElement(d.Flex,(0,y.Z)({column:!0,gap:2,overflow:{vertical:"auto"},padding:[2,3]},l),o.createElement(d.Flex,{justifyContent:"between",padding:[2,0],border:{side:"bottom",color:"borderSecondary"}},o.createElement(d.TextBig,{strong:!0},"Row info"),i.length>0&&o.createElement(d.Box,{onClick:function(){return r()},cursor:"pointer"},o.createElement(d.TextSmall,{color:"primary"},"Clear selection"))),Array.isArray(i)&&i.length?o.createElement(o.Fragment,null,i.map((function(e){var t=(0,a.Z)(e,2),n=t[0],r=t[1];return o.createElement(Y.Z,{key:n,size:"small",name:n,testId:"rightBar-rowInfoContent-".concat(n),padding:[1,0,0]},r)})),o.createElement(ne,{data:n})):o.createElement(d.Text,null,"Select a row to see raw data"))};function oe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function le(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(n),!0).forEach((function(t){(0,u.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ie={color:{active:"success",notActive:"textLite"}},ce={filters:le(le({iconName:"filterList"},ie),{},{width:"19px",Content:X,dataTestId:"fnFilters",label:"Filters"}),info:le(le({iconName:"information"},ie),{},{width:"19px",dataTestId:"info",Content:ae,label:"Info"})},ue=Object.keys(ce),se=(0,s.default)(d.Tabs).withConfig({displayName:"sidebar__StyledTabs",componentId:"sc-1x1ez62-0"})(["overflow:hidden;height:100%;"]),de=function(e){var t=e.isActive,n=e.color,r=e.name,a=e.label;return o.createElement(p.Z,{plain:!0,content:a},o.createElement(d.Icon,{name:r,color:t?n.active:n.notActive,height:"18px",width:"18px"}))},me=function(e){var t=(0,f.Z)(!0),n=(0,a.Z)(t,2),r=n[0],l=n[1],i=(0,o.useState)(0),c=(0,a.Z)(i,2),u=c[0],s=c[1];return(0,o.useEffect)((function(){e.selectedRowData&&s(1)}),[e.selectedRowData]),o.createElement(m.ZP,{collapsedComponent:o.createElement(v.Z,{availableTabs:ce,onClickTab:l,tabsToShow:ue}),header:o.createElement(g.Z,{icon:"filterList",isOpen:r,onToggle:l,title:"Filters"}),isOpen:r},o.createElement(d.Flex,{"data-testid":"overview-info",column:!0,overflow:"hidden",height:"100%"},o.createElement(se,{selected:u,onChange:s,noDefaultBorder:!0},ue.map((function(t,n){var r=ce[t],a=r.iconName,l=r.color,i=r.Content,c=r.dataTestId,s=r.label;return o.createElement(d.Tab,{style:{display:1===ue.length?"none":"inherit"},"data-testid":c,maxWidth:"100%",key:a,small:!0,label:o.createElement(de,{isActive:u===n,name:a,color:l,label:s})},o.createElement(d.Flex,{column:!0,overflow:"hidden",height:"calc(100% - 60px)",position:"relative"},o.createElement(i,e)))})))))},fe=n(36560),pe=n(78266),ve=n(5429),ge=n(74059),be=n(18761),ye=n(89250),he=function(e){var t=(0,P.XT)(e),n=(0,ye.TH)().state;return(0,o.useEffect)((function(){null!==n&&void 0!==n&&n.nodeId&&t([n.nodeId])}),[]),null===n||void 0===n?void 0:n.nodeId},Ee=n(91008),xe=n(80959),Oe=["paramsKey"],we=function(e){var t=e.paramsKey,n=(0,J.Z)(e,Oe),r=(null===n||void 0===n?void 0:n["data-testid"])||"capableNodesError",a=(0,P.c6)(t),l=(0,h.bV)(null===a||void 0===a?void 0:a[0],"name");return o.createElement(d.Flex,(0,y.Z)({alignItems:"center",flex:!0,gap:8,justifyContent:"center"},n,{"data-testid":r}),o.createElement(d.Icon,{"data-testid":"".concat(r,"-icon"),height:"230px",name:"unreachableNode",width:"230px"}),o.createElement(xe.Z,{"data-testid":"".concat(r,"-details"),gap:2,title:l?"".concat(l," is not configured for Functions"):"Your nodes are not configured for Functions",message:o.createElement(o.Fragment,null,"Learn how to configure your nodes"," ",o.createElement(Ee.Z,{Component:d.TextBig,"data-ga":"functions-capable-nodes-error::click-docs-link::functions-view","data-testid":"".concat(r,"-docsLink"),href:"https://learn.netdata.cloud/docs/nightly/operations/run-time-troubleshooting-with-functions#prerequisites",target:"_blank",rel:"noopener noreferrer"},"to support functions")),width:{max:"fit-content"}}))},Ce=n(39469),Se=n(36657),Ze=n(91128),ke=n(62554),je=(0,s.default)(d.Flex).attrs({alignItems:"center",border:{side:"bottom",color:"borderSecondary"},padding:[2]}).withConfig({displayName:"styled__MenuItem",componentId:"sc-fmyuo7-0"})(["&:last-child{border:none;}"]),Pe=(0,s.default)(d.TextInput).withConfig({displayName:"styled__TextInput",componentId:"sc-fmyuo7-1"})(['margin:0 10px;min-width:unset;width:45px;> div{margin:0;}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}input[type="number"]{-moz-appearance:textfield;}']),Te=["onClose","targetRef","paramsKey"];function Ie(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function De(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ie(Object(n),!0).forEach((function(t){(0,u.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ie(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ke=function(e){var t=e.onClose,n=e.targetRef,r=e.paramsKey,l=(0,J.Z)(e,Te),i=(null===l||void 0===l?void 0:l["data-testid"])||"refreshOptions",u=(0,c.ZQ)(De({key:"updateEvery"},r)),s=(0,c.WO)(r),m=(0,a.Z)(s,2),p=m[0],v=m[1],g=(0,f.Z)(p),b=(0,a.Z)(g,2),y=b[0],h=b[1];(0,ke.Z)((function(){!!p!==!!y&&v(y)}),200,[p,y]);var E=(0,c.FF)(De(De({},r),{},{defaultValue:u})),x=(0,a.Z)(E,2),O=x[0],w=x[1],C=(0,o.useState)(O),S=(0,a.Z)(C,2),Z=S[0],k=S[1];return(0,ke.Z)((function(){O!==Z&&w(Z)}),400,[O,Z]),n.current?o.createElement(d.Drop,{align:{top:"bottom",right:"right"},animation:!0,background:"dropdown",close:t,column:!0,"data-testid":i,margin:[.5,0,0],onClickOutside:t,onEsc:t,round:1,target:n.current,width:58},o.createElement(je,{"data-testid":"".concat(i,"-autoRefresh"),justifyContent:"between"},o.createElement(d.Text,{color:"menuItem","data-testid":"".concat(i,"-autoRefresh-label")},"Auto Refresh"),o.createElement(d.Toggle,{colored:!0,checked:y,"data-ga":"functions-refresh-options::auto-refresh-switch::functions-view::".concat(y?"enabled":"disabled"),"data-testid":"".concat(i,"-autoRefresh-switch"),onChange:h})),o.createElement(je,{"data-testid":"".concat(i,"-pollingInterval")},o.createElement(d.Text,{color:"menuItem","data-testid":"".concat(i,"-pollingInterval-label")},"Refresh every"),o.createElement(Pe,{"data-ga":"functions-refresh-options::polling-interval::functions-view","data-testid":"".concat(i,"-pollingInterval-input"),min:1,onChange:function(e){var t=+e.target.value;t>0&&k(t)},size:"tiny",type:"number",value:Z}),o.createElement(d.Text,{color:"menuItem","data-testid":"".concat(i,"-pollingInterval-units")},"seconds"))):null},Fe=n(89405),Ne=function(e){var t=e.paramsKey,n=(0,c.ZQ)(t).updatedAt,r=(0,Fe.rA)(),a=r.localeTimeString,l=r.localeDateString;return o.createElement(d.TextMicro,{color:"textLite"},"Last updated: ",l(n,{long:!0})," ",a(n,{secs:!0}))},ze=s.default.div.withConfig({displayName:"reload__IconsContainer",componentId:"sc-1nbamjz-0"})(["position:relative;"]),Le=(0,s.default)(d.Icon).withConfig({displayName:"reload__SmallIcon",componentId:"sc-1nbamjz-1"})(["position:absolute;top:3px;left:3px;"]),Ae=function(e){var t=e.onRefresh,n=e.dataGa,r=e.testId,a=e.paramsKey,l=(0,c.T2)(a);return o.createElement(ze,null,o.createElement(Le,{name:l?"playSolid":"pauseSolid",width:"8px",height:"8px",color:l?"primary":"text"}),o.createElement(d.IconButton,{"data-testid":"".concat(r,"-refreshNowBtn"),"data-ga":"".concat(n,"::click-refresh-now::functions-view"),flavour:"hollow",icon:"refresh",onClick:function(){return t({merge:!1})},disabled:l}))},Re=["onRefresh","paramsKey"],Me={fn:{dataGa:"functions-header",hasAutoRefresh:!0,Title:function(e){var t=e.name,n=e.fn,r=void 0===n?"Processes":n;return t?"".concat(r," on ").concat(t):r},TextContent:function(e){var t=e.testId;return o.createElement(o.Fragment,null,"Netdata Functions enable detailed low-level monitoring at the edge. Use this tab to execute functions on your node and see the results immediately."," ",o.createElement(Ee.Z,{Component:d.Text,"data-ga":"functions-header::click-docs-link::functions-view","data-testid":"".concat(t,"-docsLink"),href:"https://learn.netdata.cloud/docs/nightly/concepts/netdata-functions",target:"_blank",rel:"noopener noreferrer"},"Read the Netdata functions documentation to learn more"),".")}},feed:{dataGa:"feed-header",Title:function(){return"Events"},TextContent:function(e){var t=e.testId;return o.createElement(o.Fragment,null,"Troubleshoot faster with Netdata Events. Access topology and alert events across the war room in one convenient location."," ",o.createElement(Ee.Z,{Component:d.Text,"data-ga":"feed-header::click-docs-link::feed-view","data-testid":"".concat(t,"-docsLink"),href:"https://learn.netdata.cloud/docs/nightly/concepts/events-feed",target:"_blank",rel:"noopener noreferrer"},"Read the Events feed documentation to learn more"),".")}}},_e=(0,o.memo)((function(e){var t=e.onRefresh,n=e.paramsKey,r=(0,J.Z)(e,Re),l=(null===r||void 0===r?void 0:r["data-testid"])||"functionsHeader",i=(0,o.useRef)(),u=Me[n.extraKey],s=u.dataGa,m=u.hasAutoRefresh,p=u.TextContent,v=u.Title,g=(0,f.Z)(!1),b=(0,a.Z)(g,4),y=b[0],E=b[1],x=b[3],O=(0,P.c6)(n),w=(0,h.bV)(null===O||void 0===O?void 0:O[0],"name"),C=(0,c.ZQ)(n),S=C.loaded,Z=C.data,k=C.totalSize,j=(0,c.CE)(n);return o.createElement(d.Flex,{"data-testid":l,justifyContent:"between",margin:[0,0,3]},o.createElement(d.Flex,{column:!0,gap:2,"data-testid":"".concat(l,"-info"),width:{max:164}},o.createElement(d.Flex,{gap:2,alignItems:"baseline"},o.createElement(d.H1,{"data-testid":"".concat(l,"-title")},o.createElement(v,{name:w,fn:j})),S&&o.createElement(d.TextSmall,{color:"textLite",strong:!0},"(",k||(null===Z||void 0===Z?void 0:Z.length)||0," results)")),o.createElement(d.Flex,{column:!0,gap:2},o.createElement(d.Text,{"data-testid":"".concat(l,"-description"),color:"textLite"},o.createElement(p,{testId:l})))),o.createElement(d.Flex,{alignItems:"end",column:!0,gap:1},o.createElement(d.Flex,{gap:1},o.createElement(Ae,{testId:l,dataGa:s,onRefresh:t,paramsKey:n}),m&&o.createElement(d.IconButton,{"data-testid":"".concat(l,"-refreshOptionsBtn"),"data-ga":"".concat(s,"::click-refresh-options::functions-view"),flavour:"hollow",icon:"chevron_down",ref:i,onClick:E}),y&&o.createElement(Ke,{"data-testid":"".concat(l,"-refreshOptions"),isOpen:y,onClose:x,targetRef:i,paramsKey:n})),o.createElement(Ne,{paramsKey:n})))}),(function(e,t){return e.onRefresh===t.onRefresh})),Ve=n(41331),Be=(n(88386),n(41817),n(78150)),Ue=["icon","iconRotate","children","onClick","strong","testId","textAlign"],He=["description","tooltipValue","value","valueOptions"],We=(0,s.default)(d.Icon).attrs({color:"text",height:"16px",width:"16px"}).withConfig({displayName:"value__Arrow",componentId:"sc-1ahoh2y-0"})(["rotate:",";transition:all 200ms ease;"],(function(e){return e.rotate})),Qe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.transform,r=t.decimalPoints,a=void 0===r?0:r,l=t.units,i=t.defaultValue,c=(0,Be.Ol)();return(0,o.useMemo)((function(){switch(n){case"number":return(0,Be.Jw)(e,{decimalPoints:a,units:l,defaultValue:i});case"duration":return(0,Be.kl)(e,{defaultValue:i});case"datetime":return c(e,{defaultValue:i});default:return null===e?i:e}}),[e,l])},qe=function(e){var t=e.description,n=void 0===t?"":t,r=e.value,a=e.units,l=void 0===a?"":a;return n?o.createElement(d.Flex,{column:!0,gap:1,justifyContent:"center"},o.createElement(d.TextSmall,{color:"bright"},n),o.createElement(d.TextSmall,{strong:!0,color:"bright",textAlign:"center"},r," ",l)):"".concat(r," ").concat(l)},Ge=(0,o.forwardRef)((function(e,t){var n=e.icon,r=e.iconRotate,a=e.children,l=e.onClick,i=e.strong,c=e.testId,u=void 0===c?"cell":c,s=e.textAlign,m=(0,J.Z)(e,Ue);return o.createElement(d.Flex,(0,y.Z)({cursor:l?"pointer":"inherit",gap:.5,onClick:l,overflow:"hidden",ref:t,width:{max:"100%"}},m),n&&o.createElement(We,{name:n,rotate:r}),o.createElement(d.TextSmall,{"data-testid":"".concat(u,"-value"),strong:i,textAlign:s,truncate:!0,whiteSpace:"nowrap"},a))})),Xe=function(e){var t=e.description,n=void 0===t?"":t,r=e.tooltipValue,a=e.value,l=e.valueOptions,i=void 0===l?{}:l,c=(0,J.Z)(e,He),u=Qe(a,i);return o.createElement(p.Z,(0,y.Z)({content:o.createElement(qe,{description:n,value:r||a,units:i.units}),"data-testid":"tableCell",isBasic:!0},c),o.createElement(Ge,null,u))},Je=["description","maxValue","strong","type","value","valueOptions"],Ye=function(e){var t=e.description,n=void 0===t?"":t,r=e.maxValue,a=e.strong,l=e.type,i=e.value,c=e.valueOptions,u=void 0===c?{}:c,s=(0,J.Z)(e,Je),m=100*i/r,f="bar"===l,v=(null===s||void 0===s?void 0:s["data-testid"])||"progressTableCell",g=Qe(i,u);return o.createElement(p.Z,{content:o.createElement(qe,{description:n,value:i,units:u.units}),isBasic:!0,stretch:"align"},o.createElement(d.Flex,{column:!0,"data-testid":v,gap:1},!f&&o.createElement(Ge,{strong:a,testid:v},g),o.createElement(d.ProgressBar,{background:"sideBarMini",border:"none",color:["green","netdata"],containerWidth:"100%","data-testid":"".concat(v,"-bar"),height:2,width:"".concat(m,"%")})))},$e=["value"],et=function(e){var t=e.value,n=(0,J.Z)(e,$e);return t=Array.isArray(t)?t:[t],o.createElement(d.Flex,{alignItems:"center",gap:1},t.map((function(e,t){return o.createElement(d.Flex,(0,y.Z)({"data-testid":"tableCell",key:"".concat(e,"-").concat(t)},n),o.createElement(d.Pill,{flavour:"neutral",color:"neutralPillColor",size:"small"},e))})))},tt=n(20686),nt=["color"],rt=function(e){var t=e.hide,n=e.user;return t||!n?null:o.createElement(o.Fragment,null,o.createElement(d.TextSmall,null,"by"),o.createElement(at,null,n))},at=function(e){var t=e.color,n=void 0===t?"textDescription":t,r=(0,J.Z)(e,nt);return o.createElement(d.TextSmall,(0,y.Z)({color:n,strong:!0},r))},ot=function(e){var t=e.type,n=e.text,r=void 0===n?t:n,a=e.hollow,l=a?"".concat(t.toLowerCase(),"AlertsTable"):t.toLowerCase();return o.createElement(tt.Z,(0,y.Z)({type:l},a&&{border:!1}),r)},lt=(0,s.default)(d.Flex).attrs({gap:1,flexWrap:!0,alignItems:"center"}).withConfig({displayName:"components__Container",componentId:"sc-1qr6qv2-0"})([""]),it=n(79655),ct=["chart","hosts","alert"];function ut(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function st(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ut(Object(n),!0).forEach((function(t){(0,u.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ut(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var dt={CLEAR:0,WARNING:1,CRITICAL:2,UNINITIALIZED:3,UNDEFINED:4},mt=function(e){var t=e.chart,n=e.nodeId,r=e.nodeName,a=e.spaceSlug,l=e.roomSlug,i=e.alert,c=(0,ye.s0)(),u=(0,h.m3)(n),s=(0,o.useCallback)((function(){i?c(u,{state:{alertId:null===i||void 0===i?void 0:i.id}}):c(u)}),[u,i]),m="/spaces/".concat(a,"/rooms/").concat(l,"/alerts/").concat(null===i||void 0===i?void 0:i.id),f=i.current,v=i.name,g=i.previous;if("ERROR"===f.status)return o.createElement(lt,null,o.createElement(d.TextSmall,null,"For the alert"),o.createElement(Ee.Z,{Component:at,as:it.rU,to:m},v),o.createElement(d.TextSmall,null,"for"),o.createElement(Ee.Z,{Component:at,onClick:s},t.name),o.createElement(d.TextSmall,null,"on"),o.createElement(Ee.Z,{Component:at,onClick:s},r),o.createElement(d.TextSmall,null,"we couldn't calculate the current value"),o.createElement(p.Z,{align:"bottom",content:"Please check your alert configuration"},o.createElement(d.Icon,{color:"nodeBadgeColor",size:"small",name:"information"})));if("REMOVED"===f.status)return o.createElement(lt,null,o.createElement(d.TextSmall,null,"Alert"),o.createElement(Ee.Z,{Component:at,as:it.rU,to:m},v),o.createElement(d.TextSmall,null,"for"),o.createElement(Ee.Z,{Component:at,onClick:s},t.name),o.createElement(d.TextSmall,null,"on"),o.createElement(Ee.Z,{Component:at,onClick:s},r),o.createElement(d.TextSmall,null,"is no longer available, state can't be assessed"));var b=dt[f.status]===dt.CLEAR;return o.createElement(lt,null,o.createElement(d.TextSmall,null,"Alert"),o.createElement(Ee.Z,{Component:at,as:it.rU,to:m},v),o.createElement(d.TextSmall,null,"for"),o.createElement(Ee.Z,{Component:at,onClick:s},t.name),o.createElement(d.TextSmall,null,"on"),o.createElement(Ee.Z,{Component:at,onClick:s},r),b?o.createElement(d.TextSmall,null,"recovered"):o.createElement(o.Fragment,null,o.createElement(d.TextSmall,null,dt[g.status]===dt.CRITICAL?"was demoted":dt[g.status]===dt.WARNING?"escalated":dt[f.status]===dt.UNDEFINED?"transitioned":"was raised"),o.createElement(d.TextSmall,null,"to"),o.createElement(ot,{type:f.status}),dt[f.status]===dt.UNDEFINED&&o.createElement(d.TextSmall,null,"state")),o.createElement(d.TextSmall,null,"with value"),o.createElement(ot,{type:f.status,text:f.value_string,hollow:!0,padding:[0]}))},ft=function(e){var t=e.id,n=e.name,r=(0,ge.uk)(),a=(0,b.tE)(t,"slug"),l="/spaces/".concat(r,"/rooms/").concat(a,"/home");return o.createElement(Ee.Z,{Component:at,as:it.rU,to:l},n)},pt=function(e){var t=e.rooms;return t.map((function(e,n){return o.createElement(o.Fragment,{key:e.id},n>0&&(n<t.length-1?", ":" and "),o.createElement(ft,e))}))},vt=function(e){var t=e.rooms;if(!t.length)return null;var n=t.length>1?"rooms":"room";return o.createElement(o.Fragment,null,o.createElement(d.TextSmall,null,"on ",n),o.createElement(pt,{rooms:t}))},gt=function(e){var t=e.contexts;t.map((function(e,n){return o.createElement(o.Fragment,{key:e},n>0&&(n<t.length-1?", ":" and "),o.createElement(at,null,e))}))},bt=function(e){var t=e.contexts;if(!t.length)return null;var n=t.length>1?"contexts":"context";return o.createElement(d.TextSmall,null,"on ",n," ",o.createElement(gt,{contexts:t}))},yt={month:"2-digit",day:"2-digit",year:"numeric",hour:"numeric",minute:"numeric",long:!1,dateStyle:void 0},ht=function(e){var t=e.start,n=e.end,r=(0,Fe.rA)().localeDateString;if(!t||!n)return null;var a=r(new Date(t),yt),l=r(new Date(n),yt);return o.createElement(o.Fragment,null,o.createElement(d.TextSmall,null,"(scheduled ",a," - ",l,")"))},Et={"silencing-rule-created":"created","silencing-rule-deleted":"deleted","silencing-rule-changed":"changed"},xt=function(e){var t=e.rooms,n=void 0===t?[]:t,r=e.contexts,a=void 0===r?[]:r;return n.length||a.length?o.createElement(o.Fragment,null,!!n.length&&o.createElement(vt,{rooms:n}),!!n.length&&!!a.length&&o.createElement(d.TextSmall,null,"and ",o.createElement(bt,{contexts:a}))):null},Ot=function(e){var t,n=e.action,r=e.notification,a=e.user,l=e.room,i=e.context,c=((null===r||void 0===r||null===(t=r.silencing)||void 0===t?void 0:t.rule)||[])[0],u=null===a||void 0===a?void 0:a.name,s=(null===i||void 0===i?void 0:i.name)||[];return o.createElement(lt,null,o.createElement(d.TextSmall,null,"Silencing rule"),o.createElement(at,null,c.name),o.createElement(xt,{rooms:l,contexts:s}),o.createElement(d.TextSmall,null,"was ",Et[n]),o.createElement(rt,{user:u}),o.createElement(ht,c))},wt=n(62200),Ct=function(e,t){var n,r;return(null===(n=e.target)||void 0===n?void 0:n[t])||(null===(r=e.target)||void 0===r?void 0:r.id)||e[t]||e.id},St=function(e){return Array.isArray(e)?e[0].name||e[0].id:e.name||e.id},Zt=function(e){var t=e.statistics,n=(null===t||void 0===t?void 0:t.nodes)||{},r=n.live,a=n.stale,l=n.removed,i=n.total;return o.createElement(lt,null,o.createElement(d.TextSmall,null,"Space statistics. Nodes:"),o.createElement(d.TextSmall,{color:wt.WV.live.statusTextSmallColor},r," live"),o.createElement(d.TextSmall,null,","),o.createElement(d.TextSmall,{color:wt.WV.stale.statusTextSmallColor},a," stale"),o.createElement(d.TextSmall,null,","),o.createElement(d.TextSmall,{color:wt.WV.offline.statusTextSmallColor},l," removed"),o.createElement(d.TextSmall,null,","),o.createElement(d.TextSmall,{strong:!0},i," total"))},kt=(n(69810),n(86035),n(6973)),jt=function(e){var t=e.stateColor,n=e.state;return o.createElement(o.Fragment,null,o.createElement(d.TextSmall,null,"became"),o.createElement(at,{color:t},n))},Pt=function(e){var t=e.stateColor,n=e.state;return o.createElement(o.Fragment,null,o.createElement(d.TextSmall,null,"was"),o.createElement(at,{color:t},n))},Tt={"node-created":jt,"node-state-live":jt,"node-state-stale":jt,"node-state-offline":jt,"node-removed":Pt,"node-deleted":Pt,"node-restored":Pt,default:Pt},It=function(e){var t,n=e.action,r=e.hosts,a=(void 0===r?[]:r)[0],l=a.id,i=a.name,c=(0,ye.s0)(),u=(0,h.m3)(l),s=(0,o.useCallback)((function(){return c(u)}),[u]),m=Tt[n],f=n.split("-").at(-1),p=null===(t=kt.B[f])||void 0===t?void 0:t.statusTextSmallColor;return o.createElement(lt,null,o.createElement(d.TextSmall,null,"Node"),o.createElement(Ee.Z,{Component:at,onClick:s},i),o.createElement(m,{stateColor:p,state:f}))},Dt=function(e){var t=e.room,n=(0,b.Hm)("untouchable");return o.createElement(o.Fragment,null,o.createElement(d.TextSmall,null,"was added to",n?" room":""),o.createElement(at,null,n?St(t):"this room"))},Kt=function(e){var t=e.room,n=(0,b.Hm)("untouchable");return o.createElement(o.Fragment,null,o.createElement(d.TextSmall,null,"was removed from",n?" room":""),o.createElement(at,null,n?St(t):"this room"))},Ft={"room-created":function(){return o.createElement(d.TextSmall,null,"was created")},"room-deleted":function(){return o.createElement(d.TextSmall,null,"was deleted")},"room-node-added":Dt,"room-node-removed":Kt,"room-user-added":Dt,"room-user-removed":Kt},Nt=function(e){var t,n=e.action,r=e.hosts,a=void 0===r?[]:r,l=e.Netdata,i=e.user,c=Ft[n],u=null===(t=a[0])||void 0===t?void 0:t.name;return o.createElement(lt,null,o.createElement(d.TextSmall,null,"Node"),o.createElement(at,null,u),o.createElement(c,{room:l.room}),o.createElement(rt,{user:null===i||void 0===i?void 0:i.name}))},zt=function(e){var t=e.action,n=e.Netdata,r=e.user,a=Ft[t];return o.createElement(lt,null,o.createElement(d.TextSmall,null,"User"),o.createElement(at,null,Ct(r,"name")),o.createElement(a,{room:n.room}),o.createElement(rt,{hide:!r.target,user:r.name}))},Lt=function(e){var t=e.action,n=e.Netdata,r=e.user,a=Ft[t];return o.createElement(lt,null,o.createElement(d.TextSmall,null,"Room"),o.createElement(at,null,St(n.room)),o.createElement(a,null),o.createElement(rt,{user:r.name}))},At={"alert-node-transition":function(e){var t=e.chart,n=e.hosts,r=e.alert,a=(0,J.Z)(e,ct);return n.map((function(e,n){var l=e.id,i=e.name,c=st(st({},r),{},{name:r.name[n]},r.current?{current:st(st({},r.current),r.current.status?{status:r.current.status[n]||r.current.status[0]}:{})}:{});return o.createElement(mt,(0,y.Z)({key:l,chart:t,nodeId:l,nodeName:i,alert:c},a))}))},"node-created":It,"node-state-live":It,"node-state-stale":It,"node-state-offline":It,"node-removed":It,"node-deleted":It,"node-restored":It,"agent-connected":function(e){var t=e.agentId;return o.createElement(lt,null,o.createElement(d.TextSmall,null,"Agent with claim ID"),o.createElement(at,null,t)," ",o.createElement(d.TextSmall,null,"has connected to Cloud"))},"agent-disconnected":function(e){var t=e.agentId,n=e.reason;return o.createElement(lt,null,o.createElement(d.TextSmall,null,"Agent with claim ID"),o.createElement(at,null,t),o.createElement(d.TextSmall,null,"has disconnected from Cloud with reason: \u201c",n,"\u201d"))},"agent-authenticated":function(e){var t=e.agentId;return o.createElement(lt,null,o.createElement(d.TextSmall,null,"Agent with claim ID"),o.createElement(at,null,t),o.createElement(d.TextSmall,null,"has successfully authenticated"))},"agent-authentication-failed":function(e){var t=e.agentId;return o.createElement(lt,null,o.createElement(d.TextSmall,null,"Agent with claim ID"),o.createElement(at,null,t),o.createElement(d.TextSmall,null,"has failed to authenticate"))},"room-created":Lt,"room-deleted":Lt,"room-node-added":Nt,"room-node-removed":Nt,"room-user-added":zt,"room-user-removed":zt,"space-created":function(e){var t=e.Netdata,n=e.user;return o.createElement(lt,null,o.createElement(d.TextSmall,null,"Space"),o.createElement(at,null,t.space.name||t.space.id),o.createElement(d.TextSmall,null,"was created"),o.createElement(rt,{user:n.name}))},"space-statistics":Zt,"space-user-added":function(e){var t=e.Netdata,n=e.user,r=((null===t||void 0===t?void 0:t.inviter)||{}).name;return o.createElement(lt,null,o.createElement(d.TextSmall,null,"User"),o.createElement(at,null,Ct(n,"name")),o.createElement(d.TextSmall,null,"was added to this space"),r&&o.createElement(o.Fragment,null,o.createElement(d.TextSmall,null,"by invite of"),o.createElement(at,null,r)))},"space-user-changed":function(e){var t,n=e.user;if(!(null===(t=n.changes)||void 0===t||!t.roles)&&1===Object.keys(n.changes).length){var r=n.changes.roles.length>1,a=n.changes.roles.join(", ");return o.createElement(lt,null,o.createElement(d.TextSmall,null,"User ",r?"roles":"role"," for"),o.createElement(at,null,Ct(n,"name")),o.createElement(d.TextSmall,null,r?"were":"was"," changed to"),o.createElement(at,null,a),o.createElement(rt,{hide:!n.target,user:n.name}))}return o.createElement(lt,null,o.createElement(d.TextSmall,null,"User"),o.createElement(at,null,Ct(n,"name")),o.createElement(d.TextSmall,null,"was modified"))},"space-user-invited":function(e){var t=e.user;return o.createElement(lt,null,o.createElement(d.TextSmall,null,"User"),o.createElement(at,null,Ct(t,"email")),o.createElement(d.TextSmall,null,"was invited to this space"),o.createElement(rt,{user:t.name}))},"space-user-removed":function(e){var t=e.user,n=(t.target||{}).name;return o.createElement(lt,null,o.createElement(d.TextSmall,null,"User"),o.createElement(at,null,Ct(t,"name")),o.createElement(d.TextSmall,null,"was removed from this space"),n&&o.createElement(rt,{user:t.name}))},"space-user-uninvited":function(e){var t=e.event,n=e.user;return"space-invite-expired"===t.reason?o.createElement(lt,null,o.createElement(d.TextSmall,null,"The invite for"),o.createElement(at,null,Ct(n,"email")),o.createElement(d.TextSmall,null,"to this space has expired")):o.createElement(lt,null,o.createElement(d.TextSmall,null,"User"),o.createElement(at,null,Ct(n,"email")),o.createElement(d.TextSmall,null,"was uninvited from this space"),o.createElement(rt,{hide:!n.target,user:n.name}))},"silencing-rule-created":Ot,"silencing-rule-deleted":Ot,"silencing-rule-changed":Ot},Rt=function(e){var t=e.data,n=t.source,r=n.action,a=n.roomId,l=n.space,i=(0,ge.vu)(l.id,"slug"),c=(0,b.tE)(a,"slug"),u=At[r];return u?o.createElement(u,(0,y.Z)({},t.source,{spaceSlug:i,roomSlug:c})):o.createElement(lt,null,o.createElement(d.Text,null,"Event")," ",o.createElement(d.Text,{strong:!0},r)," ",o.createElement(d.Text,null,"emitted"))},Mt=["value"],_t=["visualization","type","value"],Vt={bar:Ye,"bar-with-integer":Ye,duration:Ye,pill:et,number:Xe,string:Xe,feedTemplate:Rt,datetime:function(e){var t=e.value,n=(0,J.Z)(e,Mt),r=new Date(t),a=(0,Fe.rA)(),l=a.localeTimeString,i=a.localeDateString,c=isNaN(r.valueOf())?"Missing date & time":"".concat(i(r,{long:!1})," ").concat(l(r,{secs:!0}));return o.createElement(Xe,(0,y.Z)({value:c},n))},value:Xe},Bt={bar:Ye,pill:et,value:Xe,feedTemplate:Rt},Ut=function(e){var t=e.visualization,n=e.type,r=e.value,a=(0,J.Z)(e,_t),l=Bt[t]||Vt[n]||Bt.value;return o.createElement(l,(0,y.Z)({value:r,type:n},a))},Ht=["name","sortable","sticky","units","max","maxValue","dummy","cellSize","valueOptions","summary","type","visualization"];function Wt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wt(Object(n),!0).forEach((function(t){(0,u.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var qt={sum:"sum",min:"min",max:"max",extent:"extent",mean:"mean",median:"median",unique:"unique",uniqueCount:"uniqueCount",count:"count"};function Gt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gt(Object(n),!0).forEach((function(t){(0,u.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Jt=(0,o.memo)(d.NetdataTable,(function(e,t){return(0,Ve.ZP)(e,t,{keep:["columnVisibility","data","fnQuery","sortBy","virtualizeOptions"]})})),Yt={cellStyles:{height:"46px"},headStyles:{height:"44px"},styles:{verticalAlign:"middle"}},$t=(0,o.memo)((0,o.forwardRef)((function(e,t){var n=e["data-testid"],r=e.paramsKey,l=e.refetch,i=e.onShowInfo,u=(0,c.ZQ)(r),s=u.columns,m=u.sortedColumns,f=u.sortColumn,p=u.sortDirection,v=u.columnVisibility,g=u.pinnedColumns,y=u.loading,h=u.totalSize,E=u.anchor,x=u.retentionWarning,O=u.groupByColumns,w=(0,o.useState)(""),C=(0,a.Z)(w,2),S=C[0],Z=C[1],j=L(r),T="feed"===r.extraKey,I=function(e,t,n){var r=n.groupBy;return(0,o.useMemo)((function(){return e.reduce((function(e,n){var a=t[n],l=a.name,i=a.sortable,c=a.sticky,u=a.units,s=a.max,m=a.maxValue,f=a.dummy,p=a.cellSize,v=a.valueOptions,g=a.summary,b=a.type,y=a.visualization,h=(0,J.Z)(a,Ht);return f?e:[].concat((0,k.Z)(e),[Qt(Qt(Qt({},h),{},{id:n,accessor:n,cell:function(e){var t=e.getValue,n=e.row,a=n.getCanExpand(),i=t(),c=qt[g]===qt.count||qt[g]===qt.uniqueCount||!qt[g];return o.createElement(Ut,{description:l,data:n.original,maxValue:s||m.value,padding:n.depth>0?[0,0,0,2.5*n.depth]:[0],strong:a,value:a&&c?"".concat(i,"x"):i,tooltipValue:a&&c?"".concat(i," ").concat(1===i?"item":"items"," associated with ").concat(r," grouping"):i,valueOptions:c?Qt(Qt({},v),{},{transform:"none"}):v,type:b,visualization:y})},header:o.createElement(d.Flex,{column:!0},n,u&&o.createElement(d.TextMicro,null,"(",u,")")),enableSorting:i,aggregationFn:qt[g]||qt.count},p),{},{meta:Qt({biggestCellIndexPerColumn:null===m||void 0===m?void 0:m.index,sticky:c,styles:{verticalAlign:"middle"}},n!==l?{tooltip:l}:{})})])}),[])}),[t,r])}(m,s,Xt({},T?{}:{groupBy:S})),D=(0,c.CE)(r),K=(0,b.UL)(),F=(0,c.fg)(Xt({key:"sortColumn"},r)),N=(0,a.Z)(F,2),z=N[0],A=N[1],R=(0,c.fg)(Xt({key:"sortDirection"},r)),M=(0,a.Z)(R,2),_=M[0],V=M[1],B=(0,c.kU)(Xt({key:"query"},r)),U=(0,a.Z)(B,2),H=U[0],W=U[1],Q=(0,c.I_)(Xt({key:"columnVisibility"},r)),q=(0,P.I0)(z,{defaultValue:[],key:K,extraKey:"".concat(D,"RangeFilter")}),G=(0,a.Z)(q,2)[1],X=(0,o.useMemo)((function(){return z||f?[{id:z||f,desc:"descending"===(_||p)}]:[]}),[f,p,z,_]),Y=(0,o.useCallback)((function(e){var t=e(),n=(0,a.Z)(t,1)[0],r=(null===n||void 0===n?void 0:n.id)||r,o=null!==n&&void 0!==n&&n.desc?p||"descending":"ascending";A(r),V(o),z!==r&&G([])}),[z,G,f,p]),$=(0,o.useCallback)((function(e){Q((function(t){return Xt(Xt({},t),e())}))}),[]),ee=(0,o.useMemo)((function(){return{left:g}}),[g]),te=(0,o.useMemo)((function(){return{overscan:10,hasNextPage:h>j.length,loading:y,loadMore:function(){y||h<=j.length||l({anchor:E,merge:!0})},warning:x}}),[j.length,y]),ne=(0,o.useCallback)((function(e){var t=e.data;return i(t.json||t)}),[]);return o.createElement(Jt,{groupByColumns:O,onClickRow:ne,autoFixedColumns:!0,columnPinning:ee,columnVisibility:v,data:j,dataColumns:I,dataGa:"functions",enableColumnPinning:!!g.length,enableColumnVisibility:!T,enableCustomSearch:!T,enablePinning:!T&&!!g.length,enableResize:!0,enableSorting:!T,globalFilter:T?null:H,onColumnVisibilityChange:$,onGlobalSearchChange:T?null:W,onGroupByChange:T?null:Z,onSortingChange:T?null:Y,sortBy:X,testPrefix:n,virtualizeOptions:te,meta:Yt,ref:t})})),(function(){return!0})),en=n(18997),tn=n(4808),nn=(n(26833),n(50361)),rn=n.n(nn),an=n(38609),on=n(81732),ln=n(85672),cn=["defaultSortColumn","updateEvery","merge","groupBy"],un=["data","type","updateEvery"];function sn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function dn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sn(Object(n),!0).forEach((function(t){(0,u.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var mn={minSize:ln.bb.xs,maxSize:ln.bb.xl},fn={bar:{size:ln.bb.xs},value:{minSize:ln.bb.sm,size:ln.bb.md},feedTemplate:{size:ln.bb.xxl,minSize:ln.bb.lg,maxSize:5e3},pill:{size:ln.bb.md,minSize:ln.bb.md}},pn=function(e,t,n){var r=t.defaultSortColumn,a=t.updateEvery,o=t.merge,l=t.groupBy,i=(0,J.Z)(t,cn),c=rn()(o?(0,an.Z)(n.columns,t.columns):t.columns),u={},s=Object.keys(c).reduce((function(e,t){var n,r=c[t],a=r.sticky,o=r.visible,l=r.index;return e.columnVisibility[t]=o,a&&e.pinnedColumns.push(t),r.valueOptions=r.valueOptions||{},r.cellSize=(n=r.visualization||r.type,r.uniqueKey?{minSize:ln.bb.xs,maxSize:ln.bb.md,size:ln.bb.xs}:dn(dn({},mn),fn[n]||fn.xs)),"undefined"!==typeof l&&(u[l]=t),e}),{columnVisibility:{},pinnedColumns:[]}),d=t.data.map((function(e){return e.reduce((function(e,t,n){var r,a,o=u[n];if(!o)return e;var l=c[o],i=isNaN(t)?(null===t||void 0===t?void 0:t.length)||0:t;"flexTemplate"!==l.type&&(!l.maxValue||i>l.maxValue.value)&&(l.maxValue={index:n,value:i});var s=(null===l||void 0===l||null===(r=l.range)||void 0===r?void 0:r.min)||t,d=(null===l||void 0===l||null===(a=l.range)||void 0===a?void 0:a.max)||l.max||t;return l.range={min:s<t?s:t,max:d>t?d:t},e[o]=t,e}),{})}));e(dn(dn(dn(dn({},on.Zn.table),i),{},{groupByColumns:l,data:o?(n.data||[]).concat(d):d,columns:o?(0,an.Z)(n.columns,c):c,updatedAt:(new Date).getTime(),updateEvery:a,sortedColumns:Object.values(u),sortColumn:r,sortDirection:r?c[r].sort:"descending"},s),{},{loading:!1,loaded:!0}))},vn=function(e,t){var n=t.data,r=t.type,a=t.updateEvery,o=(0,J.Z)(t,un);e(dn(dn(dn({},on.Zn.default),o),{},{data:n,updateEvery:a,type:r,loading:!1,loaded:!0}))};function gn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function bn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gn(Object(n),!0).forEach((function(t){(0,u.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var yn={default:{fetch:tn.Ru,isEnabled:function(e){var t=e.nodeIds,n=e.fn;return!(null===t||void 0===t||!t.length)&&!!n}},feed:{fetch:tn.bj,isEnabled:function(e){var t=e.roomId,n=e.fn;return!!t&&!!n}}},hn=function(){var e=(0,P.by)(),t=e.after,n=e.before;return(0,o.useMemo)((function(){if(t>0)return[{after:t,before:n},t,n];var e=Date.now();return[{after:e+1e3*t,before:e},t,n]}),[t,n])},En=n(92501),xn=(n(47042),n(26495)),On=n(36337),wn=n(19221),Cn=n(23148),Sn=(0,I.cn)({key:"feedChart",default:{navigation:"pan"}});function Zn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function kn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Zn(Object(n),!0).forEach((function(t){(0,u.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var jn=(0,I.CG)({key:"feedChartState",get:function(e){var t=e.key;return function(e){var n=(0,e.get)(Sn);return t?n[t]:n}},set:function(e){var t=e.key;return function(e,n){(0,e.set)(Sn,(function(e){return t?kn(kn({},e),{},(0,u.Z)({},t,n)):kn(kn({},e),n)}))}}}),Pn=function(e){return(0,I.sJ)(jn({key:e}))},Tn=function(e){return(0,I.Zl)(jn({key:e}))},In=(n(41203),["icon","hoverIndicator","padding"]);function Dn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Kn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Dn(Object(n),!0).forEach((function(t){(0,u.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Fn=(0,s.default)(d.Button).attrs((function(e){return{flavour:"borderless",iconColor:e.active?"textDescription":"border",iconSize:"small",padding:[.5],small:!0}})).withConfig({displayName:"styled__Button",componentId:"sc-8s0lqd-0"})(["&&{background-color:",";height:20px;width:20px;&:hover{background-color:",";.button-icon__color{fill:",";}}}"],(function(e){var t=e.theme;return e.active?(0,d.getColor)("borderSecondary")({theme:t}):"initial"}),(function(e){var t=e.theme;return(0,d.getColor)("borderSecondary")({theme:t})}),(function(e){var t=e.theme;return(0,d.getColor)("textDescription")({theme:t})})),Nn=(0,s.default)(d.Flex).attrs({padding:[.5],gap:1,round:!0,border:{side:"all",color:"borderSecondary"}}).withConfig({displayName:"styled__Container",componentId:"sc-8s0lqd-1"})(["position:absolute;top:18px;right:8px;background:",";&:hover{background:",";}"],(0,d.getRgbColor)("elementBackground",.5),(0,d.getColor)("elementBackground")),zn=function(e){var t=e.active,n=e.disabled,r=e.defaultColor;return t?"textDescription":n?"disabled":void 0===r?"border":r},Ln=(s.default.button.attrs((function(e){var t=e.icon,n=e.hoverIndicator,r=void 0===n||n,a=e.padding,o=void 0===a?0:a,l=(0,J.Z)(e,In);return Kn(Kn({},l),{},{children:t,active:l.active||l["aria-expanded"],hoverIndicator:r,padding:o})})).withConfig({displayName:"styled__StyledButton",componentId:"sc-8s0lqd-2"})(["border:initial;padding:",";height:fit-content;line-height:0;background:",";cursor:pointer;svg{fill:",";stroke:",";}"," &:hover{",";svg{fill:",";stroke:",";}}"],(function(e){return e.padding}),(function(e){var t=e.theme;return e.active?(0,d.getColor)("borderSecondary")({theme:t}):"initial"}),(function(e){var t=e.active,n=e.disabled,r=e.theme;return e.stroked?"none":(0,d.getColor)(zn({active:t,disabled:n}))({theme:r})}),(function(e){var t=e.active,n=e.disabled,r=e.theme;return e.stroked?(0,d.getColor)(zn({active:t,disabled:n}))({theme:r}):"none"}),(function(e){var t=e.active,n=e.hoverIndicator;return(t||n)&&"\n border-radius: 4px;\n "}),(function(e){var t=e.theme,n=e.hoverIndicator,r=e.disabled;return n&&!r&&"background: ".concat((0,d.getColor)("borderSecondary")({theme:t}),";")}),(function(e){var t=e.theme,n=e.stroked,r=e.disabled;return n?"none":(0,d.getColor)(zn({defaultColor:"textDescription",disabled:r}))({theme:t})}),(function(e){var t=e.theme,n=e.stroked,r=e.disabled;return n?(0,d.getColor)(zn({defaultColor:"textDescription",disabled:r}))({theme:t}):"none"})),["testIdPrefix"]),An=(0,o.forwardRef)((function(e,t){var n,r=e.testIdPrefix,l=(0,J.Z)(e,Ln),i=(0,P.I0)(),c=(0,a.Z)(i,2),u=c[0],s=u.after,d=u.before,m=c[1],f=[Pn(n="navigation"),Tn(n)],p=(0,a.Z)(f,2),v=p[0],g=p[1],b=(0,o.useCallback)((function(e){var t=s,n=d;if(s<0){var r=Date.now();t=r+1e3*s,n=r}var a=e*Math.round((n-t)/4);m({after:t+a,before:n-a})}),[s,d]),h=s>0&&Math.abs(d-s)<2e3||-1===s;return o.createElement(Nn,(0,y.Z)({"data-testid":"chartToolbox","data-track":"chart-toolbox::hover-chart::".concat(r),"data-toolbox":"true",ref:t},l),o.createElement(Fn,{active:"pan"===v,"data-testid":"chartToolbox-pan","data-track":"chart-toolbox::pan-click::".concat(r),icon:"panTool",onClick:function(){return g("pan")},title:"Pan"}),o.createElement(Fn,{active:"highlight"===v,"data-testid":"chartToolbox-highlight","data-track":"chart-toolbox::highlight-click::".concat(r),icon:"highlightArea",onClick:function(){return g("highlight")},title:"Highlight"}),o.createElement(Fn,{active:"zoom"===v,"data-testid":"chartToolbox-zoom","data-track":"chart-toolbox::zoom-click::".concat(r),disabled:h,icon:"dragHorizontal",onClick:function(){g("zoom")},title:"Select and zoom"}),o.createElement(Fn,{"data-testid":"chartToolbox-zoomIn","data-track":"chart-toolbox::zoom-in-click::".concat(r),disabled:h,icon:"zoomIn",onClick:function(){b(1)},title:"Zoom in"}),o.createElement(Fn,{"data-testid":"chartToolbox-zoomOut","data-track":"chart-toolbox::zoom-out-click::".concat(r),icon:"zoomOut",onClick:function(){b(-1)},title:"Zoom out"}),o.createElement(Fn,{"data-testid":"chartToolbox-zoomReset","data-track":"chart-toolbox::zoom-reset-click::".concat(r),disabled:-900===s&&0===d,icon:"zoomReset",onClick:function(){m({after:-900,before:0})},title:"Zoom reset"}))}));function Rn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Mn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rn(Object(n),!0).forEach((function(t){(0,u.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var _n={after:null,before:null};Cn.kL.register(On.Z,Cn.vn,Cn.ZL,Cn.uw,Cn.De,Cn.f$,Cn.FB,Cn.u,wn.ZP);var Vn=function(e){var t,n=e.paramsKey,r=e.testIdPrefix,l=(0,o.useRef)(),i=(0,o.useContext)(s.ThemeContext),u=(0,P.I0)(),m=(0,a.Z)(u,2),p=m[0],v=m[1],g=(0,o.useState)([]),b=(0,a.Z)(g,2),y=b[0],h=b[1],E=(0,o.useState)(_n),x=(0,a.Z)(E,2),O=x[0],w=x[1],C=(0,o.useState)(!1),S=(0,a.Z)(C,2),Z=S[0],j=S[1],T=(0,o.useState)(!1),I=(0,a.Z)(T,2),D=I[0],K=I[1],F=(0,o.useState)([]),N=(0,a.Z)(F,2),z=N[0],L=N[1],A=(0,o.useState)(null),R=(0,a.Z)(A,2),M=R[0],_=R[1],V=(0,o.useState)("second"),B=(0,a.Z)(V,2),U=B[0],H=B[1],W=(0,f.Z)(!1),Q=(0,a.Z)(W,4),q=Q[0],G=Q[2],X=Q[3],J=(0,c.ZQ)(n).aggregations,Y=Pn().navigation,$=(0,Fe.rA)(),ee=$.localeTimeString,te=$.localeDateString,ne=hn(),re=(0,a.Z)(ne,1)[0],ae=re.before-re.after,oe=(0,o.useMemo)((function(){var e=Date.now();return{min:re.after-ae,max:0===p.before?re.before:e<re.before+ae?e:re.before+ae}}),[re.after,re.before,p.before]),le=[{backgroundColor:(0,d.getColor)("primary")({theme:i}),borderWidth:0,data:y,label:"Histogram",maxBarThickness:50,minBarLength:0}];(0,o.useEffect)((function(){var e;if(null!==J&&void 0!==J&&null!==(e=J.event_histogram)&&void 0!==e&&null!==(e=e.hits)&&void 0!==e&&e.buckets){var t=J.event_histogram.hits.buckets.reduce((function(e,t){var n=t.key,r=t.doc_count;return{data:[].concat((0,k.Z)(e.data),[r]),labels:[].concat((0,k.Z)(e.labels),[n])}}),{data:[],labels:[]}),n=(0,Be.BZ)(p.after,p.before)||{};h(t.data),L(t.labels),_(null),H(n.unit)}}),[null===J||void 0===J||null===(t=J.event_histogram)||void 0===t||null===(t=t.hits)||void 0===t?void 0:t.buckets]);var ie=(0,o.useMemo)((function(){return{animation:!1,interaction:{axis:"x"},maintainAspectRatio:!1,plugins:{annotation:{annotations:Mn({},O.after&&O.before?{annotation:{type:"box",backgroundColor:"rgba(128,128,128,0.3)",borderDash:[1,5,1,1],borderWidth:1,xMax:O.before,xMin:O.after,xScaleID:"x"}}:{})},legend:{align:"start",display:!1,position:"bottom"},zoom:{limits:{x:oe},pan:{enabled:"pan"===Y&&!Z,mode:"x",onPanStart:function(e){e.chart.canvas.style.cursor="grabbing"},onPanComplete:function(e){var t=e.chart;t.canvas.style.cursor="default";var n=t.scales.x,r=n.min,a=n.max;_({min:Math.round(r),max:Math.round(a)}),v({after:Math.round(r),before:Math.round(a)}),t.update()},threshold:1},zoom:{drag:{enabled:"zoom"===Y||Z},mode:"x",onZoomStart:function(e){e.chart.canvas.style.cursor="col-resize"},onZoomComplete:function(e){var t=e.chart;if("zoom"===Y||Z){t.canvas.style.cursor="default";var n=t.scales.x,r=n.min,a=n.max;v({after:Math.round(r),before:Math.round(a)}),j(!1)}}}}},responsive:!0,scales:{x:Mn({type:"time",grid:{drawBorder:!0,drawOnChartArea:!1,drawTicks:!0,offset:!1},parsing:!1,ticks:Mn({color:(0,d.getColor)("textLite")({theme:i}),font:{size:11},autoSkip:!0,maxTicksLimit:20},"minute"===U&&ae>=1e3*ln.Kl?{callback:function(e){var t=te(e,{month:"2-digit",day:"2-digit",year:"numeric",long:!1,dateStyle:void 0}).split("/").reverse().slice(1).join("-"),n=ee(e,{secs:!1});return"".concat(t," ").concat(n)}}:{}),time:{displayFormats:{week:"yyyy-MM-dd",day:"MM-dd",hour:"MM-dd HH:mm",minute:"HH:mm",second:"HH:mm:ss"},tooltipFormat:"yyyy-MM-dd HH:mm:ss",unit:U||"second"}},M?{min:M.min,max:M.max}:{}),y:{beginAtZero:!0,ticks:{precision:0,color:(0,d.getColor)("textLite")({theme:i}),font:{size:11}}}}}}),[O,ae,Z,Y,M,_,U,oe]);if((0,o.useEffect)((function(){var e=function(e){"Shift"===e.key&&(e.preventDefault(),j(!0))};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[]),!y.length)return null;return o.createElement(d.Flex,{position:"relative",height:{min:50},onMouseEnter:G,onMouseLeave:X},q&&o.createElement(An,{testIdPrefix:r}),o.createElement(xn.$Q,{data:{datasets:le,labels:z},onMouseDown:function(e){if(e.preventDefault(),"highlight"===Y){K(!0);var t=e.nativeEvent.offsetX||e.nativeEvent.layerX,n=l.current;n.canvas.style.cursor="crosshair",w({after:Math.round(n.scales.x.getValueForPixel(t)),before:null})}},onMouseMove:function(e){if(e.preventDefault(),"highlight"===Y&&D){var t=e.nativeEvent.offsetX||e.nativeEvent.layerX,n=l.current;w((function(e){return Mn(Mn({},e),{},{before:Math.round(n.scales.x.getValueForPixel(t))})}))}},onMouseUp:function(e){e.preventDefault(),K(!1);var t=e.nativeEvent.offsetX||e.nativeEvent.layerX,n=l.current;n.canvas.style.cursor="default",O.after===Math.round(n.scales.x.getValueForPixel(t))?w(_n):w(O)},options:ie,ref:l}))},Bn=["sorter"];function Un(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Hn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Un(Object(n),!0).forEach((function(t){(0,u.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Un(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Wn=function(e){return{label:e,value:e}},Qn=function(e){var t=e.paramsKey,n=e.initData,r=e.initFilter,l=(0,c.ZQ)(t),i=l.charts,m=l.loading,f=L(t),p=(0,o.useContext)(s.ThemeContext),v=Object.keys(i).map(Wn),g=j(t.extraKey,Wn),b=(0,o.useState)(n),y=(0,a.Z)(b,2),h=y[0],E=y[1],x=(0,o.useState)(r),O=(0,a.Z)(x,2),w=O[0],C=O[1],S=(0,c.CE)(t);(0,o.useEffect)((function(){E(n)}),[n]),(0,o.useEffect)((function(){C(r)}),[r]);var Z=(0,o.useMemo)((function(){if(!i[h])return{datasets:[],labels:[]};var e=i[h].columns,t=null===f||void 0===f?void 0:f.reduce((function(t,n){var r=n[w];return t[r]?Hn(Hn({},t),{},(0,u.Z)({},r,e.reduce((function(e,t){var r;return Hn(Hn({},e),{},(r={},(0,u.Z)(r,t,e[t]+n[t]),(0,u.Z)(r,"sorter",e.sorter+n[t]),r))}),t[r]))):Hn(Hn({},t),{},(0,u.Z)({},r,e.reduce((function(e,t,a){var o;return Hn(Hn(Hn({},e),0===a?{label:r,sorter:n[t]}:{}),{},(o={},(0,u.Z)(o,t,n[t]),(0,u.Z)(o,"sorter",e.sorter?e.sorter+n[t]:n[t]),o))}),{})))}),{}),n=Object.values(t).sort((function(e,t){return t.sorter-e.sorter})).slice(0,15).map((function(e){e.sorter;return Hn({},(0,J.Z)(e,Bn))}));return{datasets:i[h].columns.map((function(e,t){return{backgroundColor:ln.vK[t],borderWidth:0,data:n.map((function(t){return t[e]})),label:e,maxBarThickness:50,minBarLength:0}})),labels:n.map((function(e){return e.label}))}}),[S,i,h,w,f]),k={animation:!1,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{boxWidth:4,boxHeight:20,title:{color:(0,d.getColor)("textLite")({theme:p})}}}},responsive:!0,scales:{x:{stacked:!0},y:{stacked:!0}}};return o.createElement(d.Flex,{column:!0,"data-testid":"functionsCharts",gap:3,width:"50%"},o.createElement(d.Flex,{alignItems:"center","data-testid":"functionsChart".concat(h,"-selects"),gap:2},o.createElement(d.Select,{"data-ga":"functions-chart-".concat(h,"::select-data::functions-view"),"data-testid":"functionsChart".concat(h,"-dataSelect"),isLoading:m,onChange:function(e){var t=e.value;return E(t)},options:v,styles:{size:"tiny",minWidth:120},value:{label:h,value:h}}),o.createElement(d.Text,{"data-testid":"functionsChart".concat(h,"-perLabel"),color:"textLite"},"per"),o.createElement(d.Select,{"data-ga":"functions-chart-".concat(w,"::select-filter::functions-view"),"data-testid":"functionsChart".concat(w,"-filterSelect"),isLoading:m,onChange:function(e){var t=e.value;return C(t)},options:g,styles:{size:"tiny",minWidth:120},value:{label:w,value:w}})),o.createElement(d.Flex,{position:"relative",height:{min:60},width:{min:"100%"}},o.createElement(xn.$Q,{data:Z,options:k})))},qn=["margin","defaultCharts"],Gn=["paramsKey","testIdPrefix","availableFns","availableFnsLoaded","hasError"],Xn={extraKey:"fn"},Jn={fn:{Chart:function(e){var t=e.margin,n=e.defaultCharts,r=(0,J.Z)(e,qn);return o.createElement(d.Flex,{gap:6,margin:t},n.map((function(e,t){var n=(0,a.Z)(e,2),l=n[0],i=n[1];return o.createElement(Qn,(0,y.Z)({key:t,initData:l,initFilter:i},r))})))},loadingMessage:"Loading function..."},feed:{Chart:Vn,loadingMessage:"Loading events..."}},Yn={table:$t},$n=(0,o.memo)((function(e){var t=e.paramsKey,n=void 0===t?Xn:t,l=e.testIdPrefix,i=void 0===l?"functions":l,u=e.availableFns,s=e.availableFnsLoaded,m=e.hasError,f=(0,J.Z)(e,Gn),p=Jn[n.extraKey]||Jn.fn,v=p.Chart,g=p.loadingMessage,E=(0,c.Hv)(n),x=(0,a.Z)(E,2),O=x[0],w=x[1],C=(0,P.c6)(n),S=(0,c.ZQ)(n),Z=S.loaded,k=S.data,j=S.error,T=S.type,I=S.retentionWarning,D=S.defaultCharts,K=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=(0,a.Z)(e,1)[0],n=(0,h.bV)(t,"name");return 1===e.length&&n?"on ".concat(n):"on your selected node"}(C);(0,o.useEffect)((function(){null!==O&&void 0!==O&&O.length||null===u||void 0===u||!u.length||m||w([u[0]])}),[s,O]);var F=(0,Se.useHovered)({},[Z]),N=(0,a.Z)(F,2),z=N[0],L=N[1],A=(0,Ze.Z)();(0,o.useEffect)((function(){A(L)}),[L]);var R=function(e,t,n){var l=(0,ge.th)(),i=(0,b.vf)(),u=(0,c.T2)(n),s=(0,c.e6)(n),d=(0,c.mO)(n),m=(0,a.Z)(d,2),f=m[0],p=m[1],v=(0,o.useRef)();v.current=f;var g=function(e){var t=e.data,n=void 0===t?{}:t;(r[n.type]||vn)(p,n,v.current)},y=yn[t]||yn.default,E=y.fetch,x=y.isEnabled,O=hn(),w=(0,a.Z)(O,3),C=w[0],S=w[1],Z=w[2],k=(0,o.useRef)();k.current=C;var j=(0,b.UL)(),T=(0,P.by)(null,{key:j,extraKey:"".concat(t||n.extraKey,"Filters")}),I=(0,h.Xw)(e);return(0,en.Z)((function(){return{enabled:x({nodeIds:e,fn:t,roomId:j}),fetch:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return E(bn(bn(bn({roomId:j,spaceId:l,nodeIds:e,cloudNodeIds:I,fn:t,roomSlug:i},T),k.current),n))},onStart:function(){return p({loading:!0})},onFail:function(e){var t;null!==(t=e)&&void 0!==t&&null!==(t=t.response)&&void 0!==t&&t.data&&(e=e.response.data),p({error:e,loading:!1,loaded:!0})},onReceive:g,polling:u||!1,pollingOptions:{pollingInterval:1e3*(s||f.updateEvery),shouldPause:!0},force:!0}}),[j,null===e||void 0===e?void 0:e.length,null===e||void 0===e?void 0:e[0],t,u,u&&s,"feed"===t&&T,S,Z])}(C,O[0],n);if(!Z||!s)return o.createElement(pe.Z,{title:g,"data-testid":"".concat(i,"Loading")});if(m)return o.createElement(En.NY,{title:"Functions couldn't be loaded",message:"We couldn't find any available functions."});if(j&&"canceled"!==j)return"ErrNodeResourceNotFound"===(null===j||void 0===j?void 0:j.errorMsgKey)?o.createElement(xe.Z,{message:"Please review your selection and try again.",title:"".concat("feed"===n.extraKey?"Events are":'Function "'.concat(O,' is"')," not available ").concat(K,".")}):o.createElement(En.NY,{title:"".concat("feed"===n.extraKey?"Events":"Functions"," couldn't be loaded"),message:"ErrForbidden"===(null===j||void 0===j?void 0:j.errorMsgKey)?"Forbidden":""});var M=Yn[T]||Yn.table;return o.createElement(d.Box,{overflow:{horizontal:"hidden",vertical:"auto"},column:!0,padding:[4,4,0],gap:2},o.createElement(_e,{nodeIds:C,onRefresh:R,paramsKey:n}),o.createElement(v,{paramsKey:n,testIdPrefix:i,defaultCharts:D}),Z&&null!==k&&void 0!==k&&k.length?o.createElement(M,(0,y.Z)({"data-testid":"".concat(i,"Component"),paramsKey:n,refetch:R,ref:z},f)):o.createElement(d.Flex,{column:!0,justifyContent:"center",alignItems:"center",alignSelf:"center",margin:["feed"===n.extraKey?3:30,0,0],gap:3},o.createElement(d.H3,null,"No results to display"),o.createElement(d.Text,{color:"textDescription",textAlign:"center"},"Double-check your search or filters and dates and try again with different conditions"),I&&o.createElement(d.Text,{color:"text",textAlign:"center"},I)))})),er=$n,tr=n(78710),nr=["paramsKey","hasError"],rr={notLoggedIn:"Sign in to Netdata to use Functions",notClaimed:"Claim this agent to use Functions",noAccess:"This agent belongs to a Netdata Space you are not member of. Ask for an invitation to the Netdata Space of the agent to use functions."},ar=function(e){var t=e.data,n=e.accessError,r=e.bearerError;return n?rr.notLoggedIn:tr.Fp?rr[null===t||void 0===t?void 0:t.user_node_status]?rr[t.user_node_status]:r:rr.notClaimed},or={extraKey:"fn"},lr=["paramsKey"],ir={extraKey:"feed"},cr={fn:{Component:function(e){var t=e.paramsKey,n=void 0===t?or:t,r=e.hasError,l=(0,J.Z)(e,nr),i=(0,P.H7)(n),c=(0,P.wT)(n),u=(0,a.Z)(c,2),s=u[0],d=u[1],m=(0,h.M2)(i),f=(0,a.Z)(m,1)[0],p=he(n);(0,o.useEffect)((function(){null!==i&&void 0!==i&&i.length&&(p||null!==s&&void 0!==s&&s.length||!f||d([f]))}),[p,d,s]);var v=function(e){var t=(0,ge.Q6)(),n=(0,h.bV)(e,"mg");return(0,ve.Z)((function(){return{enabled:t&&!!n,fetch:function(){return(0,be.yM)(n)},initialValue:{},isDefaultLoading:!0}}),[])}(f),g=(0,a.Z)(v,3),b=g[0],E=g[2],x=(0,Ce.Z)(),O=x.bearerProtection,w=x.error;return f?(r||w)&&O?o.createElement(xe.Z,{title:ar({data:b,accessError:E,bearerError:w}),message:"Functions expose sensitive information about your systems and applications. To protect your privacy, Netdata exposes this information only to logged-in users and claimed agents. When viewing Functions directly on a Netdata Agent UI, this information is sent directly from the Netdata Agent to your web browser, without exposing it to any third parties."}):o.createElement(er,(0,y.Z)({testIdPrefix:"fn",paramsKey:n},l)):o.createElement(we,{paramsKey:n})},paramsKey:{extraKey:"fn"},loading:"Loading functions..."},feed:{Component:function(e){var t=e.paramsKey,n=void 0===t?ir:t,r=(0,J.Z)(e,lr);return he(n),o.createElement(er,(0,y.Z)({testIdPrefix:"feed",paramsKey:n},r))},paramsKey:{extraKey:"feed"},loading:"Loading events..."}},ur=function(e){var t=e.flavour,n=cr[t]||cr.fn,r=n.Component,u=n.paramsKey,s=n.loading,d=(0,i.zN)(),m=(0,i.fD)(),f=(0,o.useState)(),p=(0,a.Z)(f,2),v=p[0],g=p[1],b=(0,c.KO)(u.extraKey),y=b.loaded,h=b.value,E=b.hasError;return m?d.length||"fn"!==t?o.createElement(l.Z,{"data-testid":"".concat(t,"Page"),margin:[0,0,8,0],rightBar:o.createElement(me,{flavour:t,selectedRowData:v,setSelectedRowData:g,availableFns:h})},o.createElement(r,{testIdPrefix:t,paramsKey:u,onShowInfo:g,availableFnsLoaded:y,availableFns:h,hasError:E})):o.createElement(fe.Z,null):o.createElement(pe.Z,{title:s})}}}]);
\ No newline at end of file |