diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-09-04 08:57:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-09-04 08:57:43 +0000 |
commit | 42ad44d1fea072d23f2e0067bca4ba6bc0b2a523 (patch) | |
tree | b1c1459c6914f1d4c5b123b601b9dbecb049360c /web/gui/v2/654.67b0714ebd49a65d277c.chunk.js | |
parent | Adding upstream version 1.42.1. (diff) | |
download | netdata-upstream/1.42.2.tar.xz netdata-upstream/1.42.2.zip |
Adding upstream version 1.42.2.upstream/1.42.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | web/gui/v2/654.67b0714ebd49a65d277c.chunk.js | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/web/gui/v2/654.67b0714ebd49a65d277c.chunk.js b/web/gui/v2/654.67b0714ebd49a65d277c.chunk.js deleted file mode 100644 index db895e829..000000000 --- a/web/gui/v2/654.67b0714ebd49a65d277c.chunk.js +++ /dev/null @@ -1 +0,0 @@ -!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]="87770e6f-dd77-4cf0-bd56-726345033453",e._sentryDebugIdIdentifier="sentry-dbid-87770e6f-dd77-4cf0-bd56-726345033453")}catch(e){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"1f9bd6d85714735ca8bbf884fbe65fc5566ec047"},(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[654],{51091:function(e,t,n){"use strict";var r=n(87462),a=n(45987),l=(n(57327),n(41539),n(88449),n(2490),n(59849),n(21249),n(57640),n(9924),n(92222),n(60677)),o=n(10928),c=n.n(o),i=n(67294),s=n(57509),u=["items","isBig","showBackButton","testid"],m=(0,l.default)(s.Box).withConfig({displayName:"breadcrumbs__StyledItemContainer",componentId:"sc-3u39st-0"})([""]),d=(0,l.css)(["&:hover{color:",";}"],(function(e){var t=e.withHover,n=e.theme;return t&&(0,s.getColor)("success")({theme:n})})),p=(0,l.default)(s.Text).withConfig({displayName:"breadcrumbs__StyledText",componentId:"sc-3u39st-1"})(["",""],d),g=(0,l.default)(s.TextSmall).withConfig({displayName:"breadcrumbs__StyledTextSmall",componentId:"sc-3u39st-2"})(["",""],d);t.Z=function(e){var t=e.items,n=e.isBig,l=e.showBackButton,o=void 0===l||l,d=e.testid,f=void 0===d?"":d,E=(0,a.Z)(e,u),b=(0,i.useMemo)((function(){return null!==t&&void 0!==t&&t.length&&o?c()(t.filter((function(e){return!!e.onClick}))).onClick:null}),[t,o]);if(null===t||void 0===t||!t.length)return null;var h=n?p:g;return i.createElement(s.Flex,(0,r.Z)({gap:4},E),o&&i.createElement(s.Button,{onClick:b,icon:"chevron_left",label:"Back",neutral:!0,flavour:"hollow",small:!0,padding:[0,2,0,1],textTransform:"uppercase","data-testid":"".concat(f,"-breadcrumbs-backButton")}),i.createElement(s.Flex,{gap:2,alignItems:"center"},t.map((function(e,t){var n=e.isDisabled,a=e.name,l=e.onClick;return i.createElement(m,(0,r.Z)({key:t,alignItems:"center"},l&&{cursor:"pointer",onClick:l},{"data-testid":"".concat(f,"-breadcrumbs-level-").concat(t)}),i.createElement(h,{color:n&&"textLite","data-testid":"".concat(f,"-breadcrumbs-level-").concat(t),withHover:!!l},0!==t&&" / ",a))}))))}},80959:function(e,t,n){"use strict";var r=n(87462),a=n(45987),l=n(67294),o=n(57509),c=["message","title","footer"];t.Z=function(e){var t=e.message,n=e.title,i=e.footer,s=(0,a.Z)(e,c),u=(null===s||void 0===s?void 0:s["data-testid"])||"functionError";return l.createElement(o.Flex,(0,r.Z)({alignItems:"center",column:!0,"data-testid":u,flex:!0,gap:3,justifyContent:"center",padding:[0,20]},s),l.createElement(o.H3,{"data-testid":"".concat(u,"-title")},n),l.createElement(o.TextBig,{color:"textDescription","data-testid":"".concat(u,"-message")},t),i)}},93742:function(e,t,n){"use strict";n.d(t,{p:function(){return o}});var r=n(93433),a=(n(69826),n(41539),n(31672),n(2490),n(59461),n(21249),n(57640),n(9924),n(3689)),l=n(95383),o=function(e){var t=(0,l.J7)().find((function(e){return"All nodes"==e.name}));return t?e?t[e]:t:null};t.Z=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.all,n=e.internal,o=(0,l.J7)().map((function(e){var t=e.id;return{label:e.name,value:t}})),c=[];return n&&c.push(a.mN),t&&c.push(a.k_),c.push.apply(c,(0,r.Z)(o)),c}},27308:function(e,t,n){"use strict";var r=n(87462),a=n(45987),l=n(67294),o=n(79655),c=n(57509),i=n(91008),s=n(33335),u=n(99826),m=["classification"];t.Z=function(e){var t=e.classification,n=(0,a.Z)(e,m),d=(0,s.gI)("billing:ReadAll"),p=(0,u.Z)(t.toLowerCase()).url;return p?l.createElement(c.Flex,{background:"sideBarMini",border:{side:"all",color:"border"},padding:[1,2],round:!0},l.createElement(i.Z,(0,r.Z)({align:"bottom",as:o.rU,boxProps:{as:c.Flex},color:"text",Component:c.TextMicro,content:"Available on ".concat(t," plan"),disabled:!d,hoverColor:"textFocus",showToolTip:!0,strong:!0,to:p},n),t)):null}},84580:function(e,t,n){"use strict";n.d(t,{Z:function(){return S}});var r=n(45987),a=n(67294),l=n(87462),o=(n(82526),n(41817),n(57509)),c=n(82351),i=["description","isRequired","title"],s=function(e){var t=e.description,n=e.isRequired,l=e.title,s=(0,r.Z)(e,i),u=s["data-testid"]?"".concat(s["data-testid"],"-label"):"fieldLabel";return a.createElement(o.Flex,{"data-testid":"".concat(u,"-container"),gap:1},a.createElement(o.TextSmall,{color:"textLite","data-testid":u},l,n&&" *"),t&&a.createElement(c.Z,{align:"top",content:t,"data-testid":"".concat(u,"-info"),plain:!0},a.createElement(o.Icon,{color:"textLite",name:"information",size:"small"})))},u=["data-testid","description","isRequired","onChange","title"],m=function(e){var t=e["data-testid"],n=void 0===t?"input":t,c=e.description,i=e.isRequired,m=e.onChange,d=e.title,p=(0,r.Z)(e,u);return a.createElement(o.Flex,{column:!0,"data-testid":n,flex:"grow",gap:1},a.createElement(s,{"data-testid":n,description:c,isRequired:i,title:d}),a.createElement(o.TextInput,(0,l.Z)({"data-testid":"".concat(n,"-field"),size:"tiny",onChange:function(e){var t=e.target;return m(t.value)}},p)))},d=(n(21249),n(57640),n(9924),n(26833),n(92222),["data-testid","description","getDataGa","fields","id","isRequired","onChange","secrets","setSecrets","title"]),p=["getValue","id","onChange"],g=function(e){var t,n=e["data-testid"],c=void 0===n?"select":n,i=e.description,u=e.getDataGa,m=e.fields,g=e.id,f=e.isRequired,E=e.onChange,b=e.secrets,h=e.setSecrets,v=e.title,y=(0,r.Z)(e,d);return a.createElement(o.Flex,{column:!0,"data-testid":c,flex:"grow",gap:1},a.createElement(s,{"data-testid":c,description:i,isRequired:f,title:v}),a.createElement(o.Select,(0,l.Z)({"data-testid":"".concat(c,"-field"),menuPortalTarget:document.body,onChange:function(e){return E(e)},styles:{size:"tiny"},menuPlacement:"auto"},y)),Object.values((null===m||void 0===m?void 0:m[null===(t=y.value)||void 0===t?void 0:t.value])||{}).map((function(e){var t=e.getValue,n=e.id,o=e.onChange,i=(0,r.Z)(e,p);return a.createElement(S,(0,l.Z)({"data-ga":u("".concat(g,"-").concat(n,"-").concat(i.component)),"data-testid":"".concat(c,"-").concat(n),key:n,id:n,onChange:o({id:g,setSecrets:h,subsetId:n}),value:t({id:g,secrets:b,subsetId:n})},i))})))},f=n(4942),E=n(29439),b=(n(85827),n(41539),n(25387),n(2490),n(72608),n(47941),n(69720),n(57327),n(88449),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070),n(57557)),h=n.n(b),v=n(73955),y=n.n(v),x=n(31790),w=n(25185);function C(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 O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?C(Object(n),!0).forEach((function(t){(0,f.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var P=["component"],I={default:function(){return null},pairs:function(e){var t=e.componentPairs,n=e["data-testid"],r=void 0===n?"pairs":n,l=e.description,c=e.getDataGa,i=e.id,u=e.isRequired,m=e.placeholder,d=e.setSecrets,p=e.title,g=(0,a.useState)({}),b=(0,E.Z)(g,2),v=b[0],C=b[1];(0,a.useEffect)((function(){var e=Object.values(v).reduce((function(e,t){var n=t.key,r=t.value;return n?O(O({},e),{},(0,f.Z)({},n,r||"")):e}),{});d((function(t){return Object.keys(e).length?O(O({},t),{},(0,f.Z)({},i,e)):h()(t,i)}))}),[v]);return a.createElement(o.Flex,{column:!0,"data-testid":r,gap:1},a.createElement(o.Flex,{alignItems:"center",justifyContent:"between"},a.createElement(s,{"data-testid":r,description:l,isRequired:u,title:p}),t.map((function(e){var n=(0,x.XM)(e);return a.createElement(w.nO,{"data-ga":c("".concat(i,"-").concat(n,"-add")),"data-testid":"".concat(r,"-").concat(n,"Add"),key:n,label:1===t.length?"Add":"Add ".concat(n),onClick:function(){return function(e){return C((function(t){return O(O({},t),{},(0,f.Z)({},y()("pair_"),{key:"",components:e,value:""}))}))}(e)}})}))),Object.entries(v).map((function(e){var t=(0,E.Z)(e,2),n=t[0],l=t[1],s=l.key,u=l.components,d=l.value,p=(0,E.Z)(u,2),g=p[0],b=p[1],v=(0,x.XM)(u);return a.createElement(o.Flex,{alignItems:"end",key:"".concat(v,"-").concat(n),gap:2},a.createElement(S,{component:g,"data-ga":c("".concat(i,"-").concat(v,"-key")),"data-testid":"".concat(r,"-").concat(v,"Key"),onChange:function(e){return C((function(t){return O(O({},t),{},(0,f.Z)({},n,O(O({},t[n]),{},{key:e})))}))},value:s,placeholder:m,title:"Key"}),a.createElement(S,{component:b,"data-ga":c("".concat(i,"-").concat(v,"-value")),"data-testid":"".concat(r,"-").concat(v,"Value"),onChange:function(e){return C((function(t){return O(O({},t),{},(0,f.Z)({},n,O(O({},t[n]),{},{value:e})))}))},value:d,placeholder:m,title:"Value"}),a.createElement(o.Button,{flavour:"borderless",icon:"trashcan",margin:[0,0,1,0],neutral:!0,onClick:function(){C((function(e){return h()(e,n)}))}}))})))},input:m,select:g},S=function(e){var t=e.component,n=(0,r.Z)(e,P),l=I[t]||I.default;return a.createElement(l,n)}},25185:function(e,t,n){"use strict";n.d(t,{A3:function(){return p},Ce:function(){return i},QD:function(){return g},aN:function(){return f},bb:function(){return m},fb:function(){return E},hz:function(){return d},nO:function(){return u},zT:function(){return s}});n(47941),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);var r=n(4942),a=n(60677),l=n(57509);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 c(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,r.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 i=(0,a.default)(l.Flex).attrs({alignItems:"center",color:"text",gap:1,hoverColor:"text"}).withConfig({displayName:"styled__AnchorComponent",componentId:"sc-wc4x41-0"})(["&,&:hover{text-decoration:none;}"]),s=(0,a.default)(l.Icon).attrs({height:"130px",width:"130px"}).withConfig({displayName:"styled__BlurredIcon",componentId:"sc-wc4x41-1"})(["filter:blur(70px);position:absolute;left:0;top:0;opacity:0.5;"]),u=(0,a.default)(l.Button).attrs({height:"22px",icon:"plus",padding:[.5,2,.5,1],small:!0,width:"auto"}).withConfig({displayName:"styled__IntegrationAction",componentId:"sc-wc4x41-2"})(["&& > span{font-weight:bold;margin-left:4px;}"]),m=((0,a.default)(l.Flex).withConfig({displayName:"styled__FormRow",componentId:"sc-wc4x41-3"})(["flex-flow:row nowrap;align-items:center;justify-content:space-between;"]),(0,a.default)(l.TextSmall).withConfig({displayName:"styled__LearnMoreTest",componentId:"sc-wc4x41-4"})(["position:relative;"])),d=(0,a.default)(l.ModalContent).attrs({background:"dropdown",height:{base:150,max:150,min:45},overflow:{vertical:"auto"},width:{base:121,max:140,min:70}}).withConfig({displayName:"styled__ModalContent",componentId:"sc-wc4x41-5"})(["box-shadow:0 18px 28px rgb(9 30 66 / 15%),0 0 1px rgb(9 30 66 / 31%);"]),p=(0,a.default)(l.ModalCloseButton).attrs({color:"text",height:"16px",width:"16px"}).withConfig({displayName:"styled__ModalClose",componentId:"sc-wc4x41-6"})(["&:hover{fill:",";}"],(0,l.getColor)("selected")),g=(0,a.default)(l.Flex).attrs((function(e){return c(c({},e.hasBorder?{border:{side:"bottom",color:"disabled"}}:{}),{},{column:!0,padding:[3,4]})})).withConfig({displayName:"styled__ModalSection",componentId:"sc-wc4x41-7"})([""]),f=(0,a.default)(l.Icon).attrs({name:"warning_triangle",height:"18px",width:"18px",color:["yellow","amber"]}).withConfig({displayName:"styled__WarningIcon",componentId:"sc-wc4x41-8"})(["position:absolute;top:0;right:0;z-index:1;"]),E=(0,a.default)(l.Icon).attrs({height:"12px",width:"12px",color:"white"}).withConfig({displayName:"styled__SystemIcon",componentId:"sc-wc4x41-9"})(["position:relative;top:2px;"])},66654:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return vl}});n(92222);var r=n(67294),a=n(89250),l=n(29439),o=n(87462),c=n(4942),i=n(45987),s=(n(66992),n(41539),n(88674),n(78783),n(33948),n(82772),n(47042),n(47941),n(82526),n(57327),n(88449),n(2490),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070),n(2145)),u=n(12599),m=n(60677),d=n(57509),p=n(73256),g=n(16645),f=n(7693),E=n(56662),b=(n(21249),n(57640),n(9924),n(33335)),h=n(95383),v=n(74059),y=n(46667),x=n(20031),w=[{id:"name",accessor:"name",header:"Name",cell:function(e){var t=e.getValue,n=e.row.original.isMember,a=t(),l=(0,b.gI)("room:ReadAll");return r.createElement(d.Flex,{alignItems:"center"},l&&n&&r.createElement(x.Z,{margin:[0,1,0,0]}),r.createElement(d.Text,{margin:l&&!n&&[0,0,0,4]},a))}},{id:"nodeCount",accessor:"nodeCount",header:"Nodes",cell:function(e){var t=e.getValue;return"".concat(t()||0)}},{id:"memberCount",accessor:"memberCount",header:function(){return"Users"},cell:function(e){var t=e.getValue;return"".concat(t()||0)}}],C=n(15861),O=n(64687),P=n.n(O),I=(n(26699),n(32023),n(4480)),S=n(33427),T=n(25819),k=n(37518),Z=n(91850),j=n(4474),F=function(){var e=(0,C.Z)(P().mark((function e(t,n){return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.all(n.map((function(e){return(0,T.GX)(t,e)}))));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),D=n(7724);function A(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 N(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?A(Object(n),!0).forEach((function(t){(0,c.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var M=function(e){var t=e.spaceId,n=e.spaceName,a=e.startIsCreating,o=function(e){return(0,I._8)((function(t){var n=t.snapshot,r=t.set,a=t.reset;return function(){var t=(0,C.Z)(P().mark((function t(o){var c,i,s,u,m,d,p,g,f,E=arguments;return P().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=(c=E.length>1&&void 0!==E[1]?E[1]:{}).onSuccess,s=c.onFail,t.next=3,n.getPromise((0,h.Ad)({id:e,key:"ids"}));case 3:return u=t.sent,m=o.map((function(e){return e.id})),d=u.filter((function(e){return!m.includes(e)})),r((0,h.Ad)({id:e,key:"ids"}),d),t.next=9,Promise.all(d.map((function(e){return n.getPromise((0,k.n2)({id:e}))})));case 9:return p=t.sent,t.prev=10,t.next=13,F(e,m);case 13:r(Z.IV,(0,j.rZ)(p)),o.forEach((function(t){var n=t.id,r=t.slug;a((0,k.n2)({id:n})),a((0,Z.xh)([e,r]))})),i&&i(),o.length>1?(0,S.$T)("Rooms were successfully deleted from Space!"):(g=(0,l.Z)(o,1),f=g[0],(0,S.$T)("Room ".concat(f.name," was successfully deleted!"))),t.next=23;break;case 19:t.prev=19,t.t0=t.catch(10),r((0,h.Ad)({id:e,key:"ids"}),u),s&&s(t.t0);case 23:case"end":return t.stop()}}),t,null,[[10,19]])})));return function(e){return t.apply(this,arguments)}}()}),[e])}(t),c=(0,b.gI)("space:Delete"),i=(0,b.gI)("room:Create"),s=function(e){if(e){var t=Array.isArray(e)?e.map((function(e){return{id:e.id,name:e.name}})):[{id:e.id,name:e.name}];o(t)}},u=function(e,t){var n=t.length;return n?1===n?(0,D.CE)(t[0].name):(0,D.CE)(n):""},m=function(e,t){var a=t.length;if(!a)return"";var l=N(N({},1===a?{name:t[0].name}:{roomsLength:a}),{},{spaceName:n});return r.createElement(D.M5,l)},d=(0,r.useMemo)((function(){return{delete:{confirmLabel:"Yes, delete",confirmationMessage:function(e){return r.createElement(D.M5,{name:e.name,spaceName:n})},confirmationTitle:function(e){return(0,D.R4)(e.name)},dataGa:function(e){var t=e.slug;return"manage-rooms::click-delete::".concat(t)},declineLabel:"Cancel",handleAction:s,isDisabled:function(e){return e.untouchable||!c},tooltipText:"Delete room"}}}),[c]);return{bulkActions:(0,r.useMemo)((function(){return{addEntry:{dataGa:"manage-rooms::click::add-room",handleAction:a,isDisabled:!i,tooltipText:"Create room"},delete:{confirmationMessage:m,confirmationTitle:u,confirmLabel:"Yes, delete",dataGa:"manage-rooms::delete-bulk",declineLabel:"Cancel",handleAction:s,isDisabled:!c,tooltipText:"Delete rooms"}}}),[i,c,m,u]),rowActions:d}};function L(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 R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?L(Object(n),!0).forEach((function(t){(0,c.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var B=function(){var e=(0,h.J7)(),t=(0,b.gI)("room:Delete"),n=e.map((function(e){return R(R({},e),{},{disabled:e.untouchable||!t})})),o=(0,r.useState)(""),c=(0,l.Z)(o,2),i=c[0],s=c[1],u=(0,v.OS)("name"),m=(0,v.OS)("id"),d=(0,y.Z)(),p=(0,l.Z)(d,4),g=p[0],f=p[2],E=p[3],x=(0,r.useState)([]),C=(0,l.Z)(x,2)[1],O=M({startIsCreating:f,spaceId:m,spaceName:u}),P=O.bulkActions,I=O.rowActions,S=(0,a.TH)().pathname,T=(0,a.s0)(),k=(0,r.useCallback)((function(e){var t=e.data.slug;T("".concat(S,"/").concat(t))}),[S,T]);return{roomList:n,globalFilter:i,spaceName:u,spaceId:m,isCreating:g,rowActions:I,bulkActions:P,columns:w,startIsCreating:f,stopIsCreating:E,setGlobalFilter:s,onRowSelected:C,onClickRow:k,dataGa:"manage-rooms",canDeleteRoom:t}},_=function(e){var t=B(),n=t.roomList,a=t.spaceName,l=t.isCreating,c=t.columns,i=t.setGlobalFilter,s=t.stopIsCreating,u=t.onRowSelected,m=t.rowActions,p=t.bulkActions,g=t.onClickRow,f=t.dataGa;t.canDeleteRoom;return r.createElement(r.Fragment,null,r.createElement(d.Flex,(0,o.Z)({column:!0,height:"100%",overflow:"hidden",gap:3},e),r.createElement(d.H3,null,"Rooms of ",a),r.createElement(d.NetdataTable,{onGlobalSearchChange:i,onRowSelected:u,onClickRow:g,enableSorting:!0,dataColumns:c,enableSelection:!0,data:n,bulkActions:p,rowActions:m,dataGa:f,testPrefixCallback:function(e){return e.name}})),l&&r.createElement(E.U,{onClose:s}))},U=(n(74916),n(64765),n(41817),n(97323)),V=n(41379),H=n(39904),W=n(2509),G=n(17563),z=n(96929),Y=n(97945);function q(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?q(Object(n),!0).forEach((function(t){(0,c.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Q=function(){var e=(0,z.zN)();return{nodes:(0,Y.Ne)(e).map((function(e){return K(K({},e),{},{disabled:e.hasAccessibleData})}))||[],nodeIds:e}},X=n(18129),$=["roomUntouchable"],J=(0,r.memo)((function(e){var t=e.roomUntouchable,n=(0,i.Z)(e,$),a=Q({roomUntouchable:t}),l=a.nodes,c=a.nodeIds;return r.createElement(d.Flex,(0,o.Z)({column:!0,height:"100%",overflow:"hidden",gap:3},n),r.createElement(d.H3,null,"Nodes in this room (",c.length,") "),r.createElement(X.Z,{showClaimNodeOnEmptySpace:!0,enableSelection:!0,customNodes:l,roomUntouchable:t}))})),ee=n(92903),te=n(1229),ne=n(6557),re=n.n(ne),ae=n(91966),le=n.n(ae),oe=n(94666),ce=n(34912),ie=n(31203),se=[{id:"user",accessorKey:"user",header:"Name",cell:function(e){var t=e.cell.row.original,n=t.avatarURL,a=t.name;return r.createElement(d.Flex,{alignItems:"center",gap:2},r.createElement(ie.Z,{src:n,title:a}),r.createElement(d.TextSmall,null,a))}},{id:"email",accessorKey:"email",header:"Email",cell:function(e){var t=e.getValue;return r.createElement(d.TextSmall,null,t())}}],ue=[{id:"user",desc:!1}],me=function(e){var t=e.setSelected,n=(0,oe.H4)(),a=(0,te.e1)(),l=(0,r.useMemo)((function(){return le()(n,a)}),[n,a]),o=(0,r.useCallback)((function(e){t(e.map((function(e){return e.id})))}),[]),c=(0,ce.Vr)(l);return r.createElement(d.Flex,{alignItems:"start",padding:[1],overflow:{horizontal:"hidden",vertical:"auto"}},r.createElement(d.NetdataTable,{dataColumns:se,data:c,autoResetSelectedRows:!0,sortableBy:ue,onGlobalSearchChange:re(),onRowSelected:o,enableSelection:!0,enableSorting:!0}))},de=function(e){var t=e.onAdd,n=e.onClose,a=e.selected,l=e.error,o=e.name;return r.createElement(d.Flex,{alignItems:"center",justifyContent:"between"},l?r.createElement(d.Text,{color:"error"},"Select at least 1 user to add to ",o):r.createElement("div",null),r.createElement(d.Flex,{gap:2},r.createElement(d.Button,{neutral:!0,flavour:"hollow",onClick:n,label:"Cancel"}),r.createElement(d.Button,{disabled:!a.length,label:"Add ".concat(a.length," members"),onClick:t})))},pe=n(87181),ge=n(86414),fe=n(36925),Ee=n(35838),be=n(74855),he=n(52631),ve=n(93017),ye=n(8048),xe=n(91008),we=n(46475),Ce=function(e){var t=e.email;return(0,fe.vV)(t)},Oe={header:"Invitations",text:"Invitations successfully sent!"},Pe=function(e){var t=(0,v.OS)(),n=t.id,a=t.slug,c=(0,k.UL)(),i=(0,k.tE)(c,"name"),s=(0,r.useState)([]),u=(0,l.Z)(s,2),m=u[0],p=u[1],g=(0,Ee.E)(n),f=(0,l.Z)(g,4),E=f[2],h=f[3],y=(0,ve.Z)(),x=(0,l.Z)(y,2)[1],w=(0,r.useState)(),C=(0,l.Z)(w,2),O=C[0],P=C[1],I=(0,r.useState)(),S=(0,l.Z)(I,2),T=S[0],Z=S[1],j=function(e){var t=e||Oe,n=t.header,r=t.text,a=(0,be.sc)({header:n,text:r,success:!0});he.Z.success(a,{context:"manageInvitations"}),p([]),P(Math.random())},F=(0,r.useCallback)((function(){var e=m.filter(Ce).map((function(e){return{email:e.email,name:e.name,role:T,roomIDs:[c]}})),t="".concat(window.location.origin,"/spaces/").concat(a,"/join-space");E(e,t,{onSuccess:j,onError:x})}),[m,c,T]),D=(0,b.QB)();return r.createElement(d.Flex,(0,o.Z)({column:!0},e),r.createElement(d.H4,null,"Send invitations to ",i," room"),r.createElement(pe.ne,null,"TIP: You can send more invitations at once, separate each with a comma."),r.createElement(ge.m,{key:O,invitations:m,setInvitations:p}),r.createElement(d.H5,{margin:[4,0,0]},"Role"),r.createElement(pe.ne,null,"Choose a role for invited user."," ",r.createElement(xe.Z,{href:we.R,target:"_blank",rel:"noopener noreferrer",Component:d.TextSmall},"Learn more")),r.createElement(ye.Z,{availableRoles:D,dataGA:"invite-to-room",dataTestId:"invite-selectRole",onChange:function(e){Z(e.target.value)},value:T}),r.createElement(d.Box,{alignSelf:"end",margin:[4,0,0]},r.createElement(d.Button,{label:"Send",onClick:F,disabled:0===m.length||!T,flavour:"hollow",isLoading:h})))},Ie=function(e){var t=e.onClose,n=e.room,a=(0,r.useState)([]),o=(0,l.Z)(a,2),c=o[0],i=o[1],s=(0,r.useState)(!1),u=(0,l.Z)(s,2),m=u[0],p=u[1],E=(0,te.r3)(n.spaceId,n.id),b=(0,r.useCallback)((function(){if(!c.length)return p(!0);p(!1),E(c),t()}),[c,E]);return r.createElement(g.u6,{right:!0,closeOnEsc:!0,closeOnOverlayClick:!0,onClose:t},r.createElement(f.x,{onClose:t,isSubmodal:!0,title:r.createElement(r.Fragment,null,"Manage room",r.createElement(d.TextBig,{color:"textLite"},"\xa0/ Add Users"))}),r.createElement(ee.B,null,"Add users to room\xa0",n.name),r.createElement(g.TZ,null,r.createElement(Pe,{margin:[0,0,4]}),r.createElement(d.Flex,{column:!0,flex:!0,overflow:"hidden",padding:[0,0,2,0]},r.createElement(me,{setSelected:i})),r.createElement(de,{onClose:t,onAdd:b,selected:c,error:m,name:n.name})))},Se=n(46322),Te=n(13477),ke=function(e){return"Remove ".concat(e)},Ze=function(e){var t,n=e.name,r=e.usersLength;return r?1===r&&n?ke(n):"Remove ".concat(t=r," ").concat(1===t?"user":"users"):""},je=function(e){var t=e.name,n=e.roomName;return r.createElement(r.Fragment,null,"You are about to remove ",r.createElement("strong",null,t)," from room ",r.createElement("strong",null,n),".",r.createElement("br",null),"Are you sure you want to continue?")},Fe=function(e){var t=e.roomName,n=e.usersLength,a="".concat(n,1===n?" user":" users");return r.createElement(r.Fragment,null,"You are about to remove ",r.createElement("strong",null,a)," from room ",r.createElement("strong",null,t),".",r.createElement("br",null),"Are you sure you want to continue?")},De=function(e){var t=e.name,n=e.roomName,a=e.usersLength;return a?1===a&&t?r.createElement(je,{name:t,roomName:n}):r.createElement(Fe,{roomName:n,usersLength:a}):""},Ae=function(e){var t=e.spaceId,n=e.roomId,a=e.startIsInviting,l=(0,te.GA)(t,n),o=(0,k.Hm)("name"),c=function(e){if(e){var t=Array.isArray(e)?e.map((function(e){return e.user.id})):[null===e||void 0===e?void 0:e.user.id];l(t)}};return{rowActions:(0,r.useMemo)((function(){return{remove:{confirmLabel:"Yes, remove",confirmationMessage:function(e){return r.createElement(je,{name:e.name,roomName:o})},confirmationTitle:function(e){return ke(e.name)},declineLabel:"Cancel",disabledTooltipText:"Remove is disabled",handleAction:c,isDisabled:function(e){return e.disabled},tooltipText:"Remove user from room"}}}),[ke,c,je,o]),bulkActions:(0,r.useMemo)((function(){return{addEntry:{handleAction:a,tooltipText:"Invite users"},remove:{confirmLabel:"Yes, remove",confirmationMessage:function(e,t){return r.createElement(De,{name:t[0].name,roomName:o,usersLength:t.length})},confirmationTitle:function(e,t){return Ze({name:t[0].name,usersLength:t.length})},declineLabel:"Cancel",disabledTooltipText:"Remove is disabled",handleAction:c,tooltipText:"Remove users from room"}}}),[c,De,o,a,Ze])}},Ne=function(e){var t=e.untouchable,n=(0,r.useMemo)((function(){return[{id:"email",accessor:"email",header:"Email",cell:function(e){var t=e.getValue;return"".concat(t())}},{id:"name",accessor:"name",header:"Name",cell:function(e){var t=e.getValue;return"".concat(t())}},{id:"user",accessor:"user",header:"Users",cell:function(e){var t=(0,e.getValue)(),n=t.name,a=t.avatarURL,l=t.email;return r.createElement(d.Flex,{alignItems:"center",gap:2},r.createElement(ie.Z,{src:a,title:"".concat(n," - ").concat(l||"email not set")}),r.createElement(d.TextSmall,null,n))}}]}),[]),a=(0,te.lA)(),o=(0,Te.Iy)("id"),c=(0,b.gI)("space:RemoveUser"),i=(0,r.useState)([]),s=(0,l.Z)(i,2),u=s[0],m=s[1],p=(0,r.useState)(""),g=(0,l.Z)(p,2),f=g[0],E=g[1],h=(0,y.Z)(),x=(0,l.Z)(h,4),w=x[0],C=x[2],O=x[3],P=(0,v.OS)("id"),I=(0,k.UL)(),S=Ae({selectedRows:u,spaceId:P,roomId:I,startIsInviting:C}),T=S.rowActions,Z=S.bulkActions;return{columns:n,data:(0,r.useMemo)((function(){return(0,Se.k)({data:a,currentUserId:o,canRemoveUser:c,untouchable:t})}),[a]),columnVisibility:{email:!1,name:!1},members:a,rowActions:T,bulkActions:Z,isInviting:w,globalFilter:f,stopIsInviting:O,onRowSelected:m,setGlobalFilter:E,canRemoveUser:c}},Me=["room"],Le=function(e){var t=e.room,n=(0,i.Z)(e,Me),a=t.untouchable,l=Ne({untouchable:a}),c=l.columns,s=l.data,u=l.columnVisibility,m=l.members,p=l.rowActions,g=l.bulkActions,f=l.isInviting,E=l.stopIsInviting,b=l.onRowSelected,h=l.setGlobalFilter;l.canRemoveUser;return r.createElement(d.Flex,(0,o.Z)({column:!0,height:"100%",overflow:"hidden",gap:3},n),r.createElement(d.H3,null,"Users in this room (",m.length,")"),r.createElement(d.NetdataTable,{enableSelection:!0,enableSorting:!0,columnVisibility:u,data:s,dataColumns:c,rowActions:p,bulkActions:g,onRowSelected:b,onGlobalSearchChange:h,testPrefixCallback:function(e){return e.name}}),f&&r.createElement(Ie,{onClose:E,room:t}))},Re={room:0,nodes:1,users:2},Be=(0,m.default)(d.Box).attrs({height:"100%",padding:[4,0]}).withConfig({displayName:"manageRoomModal__TabContent",componentId:"sc-lrxs0y-0"})([""]),_e=function(){var e=(0,a.s0)(),t=(0,v.th)(),n=(0,a.UO)(),o=n.roomSlug,c=n.spaceSlug,i=n.settingsTab,s=(0,k.HM)(t,o);(0,V.Z)({spaceId:t,id:s,polling:!1}),(0,H.Z)(t,s);var m=(0,b.gI)("room:ReadUsers"),p=(0,k.tE)(s),g=(0,r.useState)(p.name),f=(0,l.Z)(g,2),E=f[0],h=f[1],y=(0,a.TH)().search,x=G.parse(y).tab,w=Re[void 0===x?"room":x],C=(0,r.useState)(w),O=(0,l.Z)(C,2),P=O[0],I=O[1],S=(0,d.useInputValue)({maxChars:255,value:p.description}),T=(0,l.Z)(S,3),Z=T[0],j=T[1],F=T[2],D=(0,r.useCallback)((function(){e((0,u.Gn)(W.Sr,{spaceSlug:c,settingsTab:i}))}),[c,i]),A=(0,k.s)(p.id,{shouldPersist:!0,onSuccess:D}),N=(0,r.useCallback)((function(){return A({name:E,description:Z})}),[E,Z,A]);return r.createElement(d.Flex,{column:!0,justifyContent:"between",overflow:"hidden","data-testid":"manageRoom"},r.createElement(d.Flex,{column:!0,gap:4,height:"100%"},r.createElement(d.Tabs,{"data-testid":"manageRoom-tabs",selected:P,onChange:I,TabContent:Be,flex:!0,height:"100%"},r.createElement(d.Tab,{"data-testid":"manageRoom-roomTab",label:r.createElement(d.H5,null,"Room"),height:"100%"},r.createElement(U.Q,{roomName:E,setRoomName:h,roomDescription:Z,setRoomDescription:j,charsDescIndicator:F,"data-testid":"manageRoom-roomTabContent",id:p.id,navigateToParent:D,onSaveClick:N})),r.createElement(d.Tab,{"data-testid":"manageRoom-nodesTab",label:r.createElement(d.H5,null,"Nodes")},r.createElement(J,{roomUntouchable:p.untouchable,"data-testid":"manageRoom-nodesTabContent"})),m&&r.createElement(d.Tab,{"data-testid":"manageRoom-usersTab",label:r.createElement(d.H5,null,"Users")},r.createElement(Le,{"data-testid":"manageRoom-usersTabContent",room:p})))),P===Re.room&&r.createElement(d.Flex,{justifyContent:"end"}))},Ue=n(3975),Ve=function(e){var t=e.children;return(0,Ue.QF)(),t},He=function(e){var t=e.children;return(0,k.Hm)().loaded?t:null},We=function(){return r.createElement(a.Z5,null,r.createElement(a.AW,{path:"/",element:r.createElement(_,null)}),r.createElement(a.AW,{path:":roomSlug",element:r.createElement(Ve,null,r.createElement(He,null,r.createElement(_e,null)))}))},Ge=n(18663),ze=n(64637),Ye=n(82351),qe=[{id:"email",accessor:"email",header:"Email",cell:function(e){var t=e.getValue;return"".concat(t())}},{id:"name",accessor:"name",header:"Name",cell:function(e){var t=e.getValue;return"".concat(t())}},{id:"user",accessor:"user",width:300,header:"Users",cell:function(e){var t=(0,e.getValue)(),n=t.name,a=t.avatarURL,l=t.email;return r.createElement(d.Flex,{alignItems:"center",gap:2},r.createElement(ie.Z,{src:a,title:"".concat(n," - ").concat(l||"email not set")}),r.createElement(d.TextSmall,null,n))}},{id:"type",accessor:"type",width:100,header:"Role",cell:function(e){var t=e.getValue,n=e.row.original.user.deactivated;return r.createElement(d.Flex,{alignItems:"center",gap:1},r.createElement(d.TextSmall,{strong:!0},(0,ze.fm)(t())),n&&r.createElement(Ye.Z,{content:"This user's role doesn't have permission to access any information on the Space. Please review user's role or space's plan."},r.createElement(d.Icon,{name:"warning_triangle",height:"18px",width:"18px",color:["yellow","amber"]})))}}],Ke=(n(85827),n(25387),n(72608),n(274)),Qe=["role"],Xe=["id"];function $e(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 Je(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$e(Object(n),!0).forEach((function(t){(0,c.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$e(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var et=function(){var e=(0,C.Z)(P().mark((function e(t,n,r){return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.all(n.map(function(){var e=(0,C.Z)(P().mark((function e(n){return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Ke.lh)(t,n,r);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())));case 1:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),tt="change-user-role",nt="changeUserRole",rt=function(e){var t=e.handleAction,n=e.ids,a=e.onClose,o=(0,oe.kf)(n),c=1===o.length?o[0]:null,i=(0,b.QB)(),s=(0,r.useState)(c),u=(0,l.Z)(s,2),m=u[0],p=u[1];return r.createElement(d.ConfirmationDialog,{confirmLabel:"Save","data-ga":tt,"data-testid":nt,handleConfirm:function(){t(m),a()},handleDecline:a,isConfirmDisabled:!m,isConfirmPositive:!0,message:r.createElement(d.Flex,{gap:2,column:!0},r.createElement(d.TextSmall,null,"Learn more about Netdata role-based access model on"," ",r.createElement(xe.Z,{href:we.R,target:"_blank",rel:"noopener noreferrer",Component:d.TextSmall},"our documentation")),r.createElement(ye.Z,{availableRoles:i,dataGA:tt,dataTestId:nt,onChange:function(e){p(e.target.value)},value:m})),title:"Change roles"})},at=["data"],lt=["data"],ot=function(e){var t=e.spaceId,n=e.startIsInviting,a=function(e){return(0,I._8)((function(t){var n=t.snapshot,r=t.set;return function(){var t=(0,C.Z)(P().mark((function t(a,l){var o,c,i,s;return P().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=l.onSuccess,c=l.onError,t.next=3,n.getPromise((0,oe.WA)({id:e,key:"ids"}));case 3:return i=t.sent,s=i.filter((function(e){return!e.includes(a)})),r((0,oe.WA)({id:e,key:"ids"}),s),t.prev=6,t.next=9,(0,Ke.Sz)(e,a);case 9:o&&o(),t.next=16;break;case 12:t.prev=12,t.t0=t.catch(6),r((0,oe.WA)({id:e,key:"ids"}),i),c&&c();case 16:case"end":return t.stop()}}),t,null,[[6,12]])})));return function(e,n){return t.apply(this,arguments)}}()}),[e])}(t),l=function(e){return(0,I._8)((function(t){var n=t.snapshot,r=t.set;return function(){var t=(0,C.Z)(P().mark((function t(a,l){var o,c,s,u,m,d,p,g=arguments;return P().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c=(o=g.length>2&&void 0!==g[2]?g[2]:{}).onSuccess,s=o.onError,t.next=3,n.getPromise((0,ce.W3)(a));case 3:return u=t.sent,t.next=6,Promise.all(a.map(function(){var t=(0,C.Z)(P().mark((function t(r){var a;return P().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.getPromise((0,oe.ZN)({id:r,spaceId:e}));case 2:return a=t.sent,t.abrupt("return",{mId:r,role:a});case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 6:return m=t.sent,d=l.role,p=(0,i.Z)(l,Qe),a.forEach((function(e){r((0,ce.mX)({id:e}),(function(e){return Je(Je({},e),p)}))})),d&&a.forEach((function(t){r((0,oe.ZN)({id:t,spaceId:e}),d)})),t.prev=10,t.next=13,et(e,a,l);case 13:c&&c(),t.next=21;break;case 16:t.prev=16,t.t0=t.catch(10),u.forEach((function(e){var t=e.id,n=(0,i.Z)(e,Xe);return r((0,ce.mX)({id:t}),Je({id:t},n))})),d&&m.forEach((function(t){var n=t.mId,a=t.role;return r((0,oe.ZN)({id:n,spaceId:e}),a)})),s&&s();case 21:case"end":return t.stop()}}),t,null,[[10,16]])})));return function(e,n){return t.apply(this,arguments)}}()}),[e])}(t),c=(0,b.gI)("space:InviteUser"),s=(0,r.useCallback)((function(e){var t=e.role,n=e.members;l(n,{role:t})}),[]),u=function(e){return function(t){if(e){var n=Array.isArray(e)?e.map((function(e){return e.user.id})):[null===e||void 0===e?void 0:e.user.id];s({role:t,members:n})}}},m=function(e){if(e){var t=Array.isArray(e)?e.map((function(e){return e.user.id})):[null===e||void 0===e?void 0:e.user.id];a(t,{})}},d=(0,r.useCallback)((function(){return"Delete User"}),[]),p=(0,r.useCallback)((function(e){return r.createElement(r.Fragment,null,"You are about to delete ",r.createElement("strong",null,e.name),".",r.createElement("br",null),"Are you sure you want to continue?")}),[]),g=(0,r.useCallback)((function(e,t){var n=t.length;return n?1===n?"Delete User":"Delete Users":""}),[]),f=(0,r.useCallback)((function(e,t){var n=t.length;return n?r.createElement(r.Fragment,null,"You are about to delete"," ",r.createElement("strong",null,1===n?t[0].name:"".concat(t.length," users")),".",r.createElement("br",null),"Are you sure you want to continue?"):""}),[]);return{rowActions:(0,r.useMemo)((function(){return{userSettings:{CustomUIAction:function(e){var t=e.data,n=(0,i.Z)(e,at);return r.createElement(rt,(0,o.Z)({ids:[t.user.id]},n))},handleAction:u,tooltipText:"Change Role",isDisabled:function(e){return e.disabled},disabledTooltipText:"Changing roles is disabled"},delete:{handleAction:m,confirmationTitle:d,confirmationMessage:p,isDisabled:function(e){return e.disabled},disabledTooltipText:"Delete is disabled"}}}),[]),bulkActions:(0,r.useMemo)((function(){return{addEntry:{handleAction:n,tooltipText:"Invite user",isDisabled:function(){return!c},disabledTooltipText:"Invitations are disabled"},userSettings:{CustomUIAction:function(e){var t=e.data,n=(0,i.Z)(e,lt);return r.createElement(rt,(0,o.Z)({ids:t.map((function(e){return e.user.id}))},n))},handleAction:u,tooltipText:"Change Roles",disabledTooltipText:"Changing roles is disabled"},delete:{handleAction:m,confirmationTitle:g,confirmationMessage:f,disabledTooltipText:"Delete is disabled"}}}),[c,g,f])}},ct=function(){var e=(0,v.th)(),t=(0,v.vu)(e,"name"),n=(0,oe.Qk)(),a=(0,Te.Iy)("id"),o=(0,y.Z)(),c=(0,l.Z)(o,4),i=c[0],s=c[2],u=c[3],m=(0,r.useState)(""),d=(0,l.Z)(m,2),p=d[0],g=d[1],f=(0,r.useState)([]),E=(0,l.Z)(f,2),h=E[0],x=E[1],w=ot({selectedRows:h,spaceId:e,startIsInviting:s}),C=w.rowActions,O=w.bulkActions,P=(0,b.gI)("space:RemoveUser"),I=(0,b.gI)("user:ChangeRoles"),S=(0,b.M2)(),T=P||I,k=(0,r.useMemo)((function(){return function(e){var t=e.fromRolePermissions,n=e.userList,r=e.canModifyUser,a=e.currentUserId;return n.reduce((function(e,n){var l=a===(null===n||void 0===n?void 0:n.id),o=t.includes(n.role);return e.push({name:n.name,email:n.email,user:{avatarURL:n.avatarURL,deactivated:n.deactivated,name:n.name,email:n.email,id:n.id},type:n.role,disabled:!o||!r||l}),e}),[])}({userList:n,currentUserId:a,canModifyUser:T,fromRolePermissions:S})}),[n]);return{columns:qe,spaceName:t,members:n,currentUserId:a,data:k,isInviting:i,globalFilter:p,rowActions:C,bulkActions:O,columnVisibility:{email:!1,name:!1},onRowSelected:x,setGlobalFilter:g,startIsInviting:s,stopIsInviting:u,canModifyUser:T}},it=function(e){var t=ct(),n=t.columns,a=t.spaceName,l=t.data,c=t.isInviting,i=t.rowActions,s=t.bulkActions,u=t.columnVisibility,m=t.stopIsInviting,p=t.setGlobalFilter,g=t.onRowSelected;return r.createElement(r.Fragment,null,r.createElement(d.Flex,(0,o.Z)({column:!0,height:"100%",overflow:"hidden"},e),r.createElement(d.H3,null,"Members of ",a),r.createElement(d.TextSmall,{margin:[1,0,3]},"Learn more about Netdata role-based access model on"," ",r.createElement(xe.Z,{href:we.R,target:"_blank",rel:"noopener noreferrer",Component:d.TextSmall},"our documentation")),r.createElement(d.NetdataTable,{onGlobalSearchChange:p,data:l,dataColumns:n,enableSorting:!0,enableSelection:!0,onRowSelected:g,bulkActions:s,rowActions:i,columnVisibility:u,testPrefixCallback:function(e){return e.name}})),c&&r.createElement(Ge.l,{onClose:m,isSubmodal:!0}))},st=n(33582),ut=function(){var e=(0,k.Jb)().id,t=void 0===e?"":e,n=(0,z.X7)(t,"ids"),r=(0,z.X7)(t,"loaded"),a=(0,Y.Ne)(n),o=(0,v.th)(),c=(0,y.Z)(),i=(0,l.Z)(c,4),s=i[0],u=i[3];return(0,V.Z)({id:t,spaceId:o,polling:!0}),{areDefaultRoomNodesLoaded:r,nodes:a,isClaimNodeModalOpen:s,closeClaimNodeModal:u}},mt=(0,r.memo)((function(e){var t=(0,v.th)(),n=(0,v.OS)("name"),a=ut().nodes;(0,st.Z)(t);var l="Connect Nodes to ".concat(n);return r.createElement(d.Flex,(0,o.Z)({column:!0,"data-testid":"manageClaimedNodes",height:"100%",overflow:"hidden",gap:3},e),r.createElement(d.H3,{"data-testid":"manageClaimedNodes-header"},l),r.createElement(X.Z,{showClaimNodeOnEmptySpace:!0,showClaimModalWithRoomSelection:!0,enableSelection:!0,customNodes:a,isSpace:!0}))})),dt=mt,pt=(n(91058),n(77184)),gt=n(45736),ft=n(3689),Et=function(e){var t=e.name,n=e.spaceName;return r.createElement(r.Fragment,null,"You are about to delete ",r.createElement("strong",null,t)," channel from ",r.createElement("strong",null,n)," space.",r.createElement("br",null),"This cannot be undone. Are you sure you want to continue?")},bt=n(31790),ht=(n(64211),n(41874),n(26833),n(25185)),vt=["integration","testId"],yt=["testId","tooltipContent"],xt=["data-testid","enabled","id","integration","isAvailable","name","spaceId","tooltipContent"];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 Ct(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,c.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 Ot=function(e){var t=e.integration,n=e.testId,a=(0,i.Z)(e,vt),l=a.checked?"disable":"enable";return r.createElement(d.Toggle,(0,o.Z)({colored:!0,"data-testid":"".concat(n,"-toggle"),"data-ga":"manage-channels::toggle-".concat(t,"-").concat(l,"::notifications-tab")},a))},Pt=function(e){var t=e.testId,n=e.tooltipContent,a=void 0===n?"plan":n,l=(0,i.Z)(e,yt);return l.disabled?r.createElement(Ye.Z,{align:"top",content:ft.rc[a],"data-testid":"".concat(t,"-warning"),plain:!0},r.createElement(d.Flex,{padding:[2,2,0,0],position:"relative"},r.createElement(ht.aN,{"data-testid":"".concat(t,"-warningIcon")}),r.createElement(Ot,(0,o.Z)({testId:t},l)))):r.createElement(Ot,(0,o.Z)({testId:t},l))},It=function(e){var t=e["data-testid"],n=void 0===t?"cellName":t,a=e.enabled,l=e.id,c=e.integration,s=e.isAvailable,u=e.name,m=e.spaceId,p=e.tooltipContent,g=(0,i.Z)(e,xt),f=(0,gt.pV)(m,"channels"),E=(0,gt.rz)(m,"channels");return r.createElement(d.Flex,(0,o.Z)({alignItems:"center","data-testid":n,gap:4},g),r.createElement(Pt,{checked:a,disabled:!s,integration:c,onChange:function(e){var t=e.target.checked;E(f.map((function(e){return e.id===l?Ct(Ct({},e),{},{enabled:t}):e}))),(0,pt.eZ)(m,l,t)},testId:n,tooltipContent:p}),r.createElement(d.Text,{"data-testid":"".concat(n,"-label")},u))},St=["data-testid","integration","kind","kindLabel"],Tt=function(e){var t=e["data-testid"],n=void 0===t?"cellService":t,a=e.integration,l=e.kind,c=e.kindLabel,s=(0,i.Z)(e,St),u=ft.aU[a]||{};return r.createElement(d.Flex,(0,o.Z)({alignItems:"center","data-testid":n,gap:2,justifyContent:"between",width:"100%"},s),r.createElement(d.Flex,{alignItems:"center","data-testid":"".concat(n,"-integration"),gap:2},r.createElement(d.Icon,(0,o.Z)({"data-testid":"".concat(n,"-icon")},u)),r.createElement(d.Text,{"data-testid":"".concat(n,"-label")},a)),r.createElement(Ye.Z,{content:c,"data-testid":"".concat(n,"-kind"),plain:!0},r.createElement(d.Icon,{color:"textLite",height:"16px",name:ft.XK[l].icon,width:"16px"})))},kt=function(e){var t=e.canManageChannels,n=e.roomOptions,a=e.spaceId;return[{accessor:"name",cell:function(e){var n=e.getValue,l=e.row;return r.createElement(It,{enabled:l.original.enabled,id:l.original.id,integration:l.original.integration,isAvailable:t&&l.original.available,name:n(),spaceId:a,tooltipContent:t?"plan":"role"})},header:"Name",id:"name"},{accessor:"integration",cell:function(e){var t=e.getValue,n=e.row;return r.createElement(Tt,{integration:t(),kind:n.original.kind,kindLabel:n.original.kindLabel})},enableColumnFilter:!0,filterFn:function(e,t,n){var r=e.original.integration;return n.length<1||n.some((function(e){var t=e.value;return""===t||t===r}))},header:"Service",id:"integration",meta:{filter:{component:"select",isMulti:!0,options:Object.keys(ft.aU).map((function(e){return{label:e,value:e}})),tiny:!0,"data-ga":"manage-integrations::select-service::notification-integrations-tab"},tooltip:r.createElement(d.Flex,{column:!0,width:{max:"200px"},gap:2},r.createElement(d.TextMicro,{color:"white"},"Services are distinguished in two categories."),r.createElement(d.TextMicro,{color:"white"},r.createElement(ht.fb,{name:ft.XK.PERSONAL.icon})," ",r.createElement(d.TextMicro,{color:"white",strong:!0},"Personal:")," ",ft.XK.PERSONAL.tooltip),r.createElement(d.TextMicro,{color:"white"},r.createElement(ht.fb,{name:ft.XK.SYSTEM.icon})," ",r.createElement(d.TextMicro,{color:"white",strong:!0},"System:")," ",ft.XK.SYSTEM.tooltip))}},{accessor:"notificationLabel",cell:function(e){var t=e.getValue;return r.createElement(d.Text,{"data-testid":"channelNotificationsCell"},t())},enableColumnFilter:!0,filterFn:function(e,t,n){var r=e.original.notificationLabel;return n.length<1||n.some((function(e){var t=e.label;return""===t||t===r}))},header:"Notifications",id:"notificationLabel",meta:{filter:{component:"select",isMulti:!0,options:Object.values(ft.uK),tiny:!0,"data-ga":"manage-integrations::select-notification::notification-integrations-tab"}}},{accessor:"rooms",cell:function(e){var t,a=e.getValue,l=e.row,o={"data-testid":"channelRoomsCell"};if(l.original.internal)return r.createElement(d.Text,o,ft.mN.label);if(!(l.original.rooms||null!==(t=l.original.rooms)&&void 0!==t&&t.length))return r.createElement(d.Text,o,ft.k_.label);var c=(0,bt.ae)({roomIds:a(),roomOptions:n});return r.createElement(d.Text,{"data-testid":"channelRoomsCell"},c)},enableColumnFilter:!0,filterFn:function(e,t,n){return n.length<1||n.some((function(t){var n=t.label,r=t.value;if(e.original.internal)return n===ft.mN.label;var a=e.original.rooms||[];return a.length?a.includes(r):n===ft.k_.label}))},header:"Rooms",id:"rooms",meta:{filter:{component:"select",isMulti:!0,options:n,tiny:!0,"data-ga":"manage-integrations::select-room::notification-integrations-tab"}}}]},Zt=n(45939),jt=n(5429),Ft=n(93742);function Dt(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 At(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Dt(Object(n),!0).forEach((function(t){(0,c.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Nt=function(e,t){var n=(0,gt.Cz)(t),r=(0,Ft.Z)({all:!0});(0,jt.Z)((function(){return{enabled:!!t,fetch:function(){return(0,pt.$3)(e,t)},onFail:function(e){return n(At(At({},Zt.C),{},{error:e.message}))},onSettle:function(){return n({loading:!1,loaded:!0})},onSuccess:function(e){return n(At(At(At({},Zt.C),e.rooms?{roomSelections:r.filter((function(t){var n=t.value;return e.rooms.includes(n)}))}:{}),e))}}}),[e,t])},Mt=n(26913);function Lt(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 Rt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Lt(Object(n),!0).forEach((function(t){(0,c.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Bt=function(){var e=(0,a.s0)(),t=(0,b.gI)("channel:Manage"),n=(0,v.th)(),o=(0,v.OS)("name"),c=(0,v.uk)(),i=(0,ve.Z)(),s=(0,l.Z)(i,2),m=s[0],d=s[1],p=(0,r.useState)(""),g=(0,l.Z)(p,2),f=g[0],E=g[1];(0,Mt.Z)(n);var h=(0,gt.pV)(n,"channels"),y=(0,gt.pV)(n,"currentChannelId"),x=(0,gt.rz)(n,"channels"),w=(0,gt.rz)(n,"currentChannelId"),O=(0,Ft.Z)({all:!0,internal:!0}),I=(0,gt.su)(y),S=I.alerts,T=I.name,k=I.rooms,Z=I.secrets;Nt(n,y);var j=(0,r.useCallback)((function(e){w(e)}),[]),F=(0,r.useCallback)(function(){var e=(0,C.Z)(P().mark((function e(t){var r;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.id,e.prev=1,e.next=4,(0,pt.JV)(n,r);case 4:x(h.filter((function(e){return e.id!==r}))),m({header:"Configuration deleted successfully!"}),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),d(e.t0);case 11:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}(),[h,n]),D=(0,r.useCallback)((function(){e((0,u.Gn)(W.xN,{spaceSlug:c,settingsTab:W.bK,settingsSubTab:W.Q$}))}),[c]),A=(0,r.useMemo)((function(){return{addEntry:Rt({dataGa:"manage-channels::click-add-channel::notifications-tab",flavour:"hollow",handleAction:D,iconColor:"success",label:t?"Add Configuration":"View configurations",small:!0,strong:!0,width:"auto"},t?{}:{icon:""})}}),[t,D]),N=(0,r.useMemo)((function(){return{edit:{dataGa:function(e){var t=e.slug;return"manage-rooms::click-edit::".concat(t)},disabledTooltipText:"Edit is disabled",handleAction:function(e){var t=e.id;j(t)},isDisabled:function(e){var n=e.available,r=e.internal;return!t||!n||r},TooltipComponent:Ye.Z,tooltipText:"Edit setting"},delete:{confirmLabel:"Yes, delete",confirmationMessage:function(e){var t=e.name;return r.createElement(Et,{name:t,spaceName:o})},confirmationTitle:function(e){var t=e.name;return(0,bt.D4)(t)},dataGa:function(e){var t=e.slug;return"manage-rooms::click-delete::".concat(t)},declineLabel:"Cancel",handleAction:F,isDisabled:function(e){var n=e.internal;return!t||n},TooltipComponent:Ye.Z,tooltipText:"Delete setting"}}}),[t,F,D]);return{bulkActions:A,channelData:h,currentChannelId:y,columns:kt({canManageChannels:t,roomOptions:O,spaceId:n}),dataGa:"manage-channels",onFilter:function(e,t,n){var r=e.original,a=n.toLowerCase();if(r.name.toLowerCase().includes(a))return!0;if(r.integration.toLowerCase().includes(a))return!0;if(r.notificationLabel.toLowerCase().includes(a))return!0;if(r.internal)return ft.mN.label.toLowerCase().includes(a);var l=r.rooms||[];return l.length?(0,bt.ae)({roomIds:l,roomOptions:O}).toLowerCase().includes(a):ft.k_.label.toLowerCase().includes(a)},onModalClose:function(){x(h.map((function(e){return e.id===y?Rt(Rt({},e),{},{alerts:S,name:T,rooms:k,secrets:Z}):e}))),w("")},rowActions:N,search:f,setSearch:E}},_t=(n(68216),n(79433),n(84580)),Ut=["id","integrationId","onClose"],Vt=["id","getValue","onChange"];function Ht(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 Wt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ht(Object(n),!0).forEach((function(t){(0,c.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ht(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Gt="modal",zt=function(e){var t=e.id,n=void 0===t?"new":t,c=e.integrationId,s=e.onClose,m=(0,i.Z)(e,Ut),p=(0,gt.su)(n),g=p.alarms,f=p.description,E=p.docsLink,b=p.fields,y=p.integration,x=p.loaded,w=p.name,O=p.required,I=p.rooms,S=p.roomSelections,T=p.secrets,k=function(e){return"manage-".concat(y,"-channel::").concat(e,"::notification-").concat(c?"integrations":"channels","-tab")},Z=(0,a.s0)(),j=(0,ve.Z)(),F=(0,l.Z)(j,2),D=F[0],A=F[1],N=(0,Ft.Z)({all:!0}),M=(0,h.J7)(),L=(0,v.th)(),R=(0,v.uk)(),B=(0,gt.Cz)(n,"alarms"),_=(0,gt.Cz)(n,"name"),U=(0,gt.Cz)(n,"roomSelections"),V=(0,gt.Cz)(n,"secrets"),H=(0,gt.Cz)(n,"rooms"),G=(0,r.useState)({}),z=(0,l.Z)(G,2),Y=z[0],q=z[1];if(!x)return null;var K=Object.keys(Y),Q=O.every((function(e){return(0,bt.xW)(e,T[e],b[e])})),X=!K.length||K.every((function(e){var t=T[e].selection;return Y[e].every((function(n){return(0,bt.xW)(n,T[e][n],b[e].fields[t][n])}))})),$=g&&Q&&X,J=(0,u.Gn)(W.Sr,{spaceSlug:R,settingsTab:W.bK}),ee=function(){var e=(0,C.Z)(P().mark((function e(){var t;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,t=Wt(Wt(Wt({alarms:g,integrationID:c},w?{name:w}:{}),null!==I&&void 0!==I&&I.length?{Rooms:I}:{}),{},{secrets:T}),"new"!==n){e.next=7;break}return e.next=5,(0,pt.Y0)(L,t);case 5:e.next=9;break;case 7:return e.next=9,(0,pt.IU)(L,n,t);case 9:D({header:"new"===n?"Configuration created successfully!":"Configuration updated successfully!"}),s(),Z(J),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(0),A(e.t0);case 17:case"end":return e.stop()}}),e,null,[[0,14]])})));return function(){return e.apply(this,arguments)}}();return r.createElement(d.Modal,{onEsc:s},r.createElement(ht.hz,{"data-testid":m["data-testid"]||Gt},r.createElement(d.ModalHeader,{border:{side:"bottom",color:"disabled"},column:!0,"data-testid":"".concat(Gt,"-header"),gap:.5,padding:[6,4,3]},r.createElement(d.Flex,{alignItems:"center","data-testid":"".concat(Gt,"-headerMain")},r.createElement(d.Flex,{"data-testid":"".concat(Gt,"-titleContainer"),gap:1},r.createElement(d.Icon,(0,o.Z)({"data-testid":"".concat(Gt,"-titleIcon")},ft.aU[y]||{})),r.createElement(d.H3,{"data-testid":"".concat(Gt,"-title")},y)),s&&r.createElement(ht.A3,{"data-ga":k("close-modal"),"data-testid":"".concat(Gt,"-close"),onClose:s})),r.createElement(d.TextSmall,{as:d.Box,"data-testid":"".concat(Gt,"-description")},f,"\xa0",r.createElement(xe.Z,{Component:d.TextSmall,"data-ga":k("click-docs"),"data-testid":"".concat(Gt,"-docsLink"),href:E,target:"_blank",whiteSpace:"nowrap"},"Learn how to configure it."))),r.createElement(d.ModalBody,{"data-testid":"".concat(Gt,"-body"),overflow:{vertical:"auto"},padding:[0]},r.createElement(ht.QD,{gap:2,"data-testid":"".concat(Gt,"-standardFields"),hasBorder:!0},r.createElement(d.Text,{"data-testid":"".concat(Gt,"-standardFields-header")},"Notification settings"),r.createElement(d.Flex,{column:!0,"data-testid":"".concat(Gt,"-standardFields-body"),gap:3},r.createElement(_t.Z,{component:"input","data-ga":k("configuration-name-input"),"data-testid":"".concat(Gt,"-configurationName"),onChange:_,placeholder:"i.e All alerts from All nodes",title:"Configuration name",value:w}),r.createElement(_t.Z,{component:"select","data-ga":k("rooms-select"),"data-testid":"".concat(Gt,"-rooms"),isMulti:!0,onChange:function(e){var t;if(1!==M.length){if(0===e.length)return H([]),void U([]);if(e.length===M.length||null===(t=e[e.length-1])||void 0===t||!t.value)return H([]),void U([ft.k_]);var n=e.map((function(e){return e.value})).filter(Boolean),r=e.length>1?e.filter((function(e){return e.value})):e;H(n),U(r)}},options:N,placeholder:"Select rooms",title:"Rooms",value:S}),r.createElement(_t.Z,{component:"select","data-ga":k("notification-select"),"data-testid":"".concat(Gt,"-notifications"),isRequired:!0,onChange:function(e){var t=e.value;B(t)},options:Object.values(ft.Nq),placeholder:"Select notifications",title:"Notifications",value:ft.Nq[g]}))),r.createElement(ht.QD,{gap:2,"data-testid":"".concat(Gt,"-dynamicFields"),hasBorder:!0},r.createElement(d.Text,{"data-testid":"".concat(Gt,"-dynamicFields-header")},"Integration configuration"),r.createElement(d.Flex,{column:!0,"data-testid":"".concat(Gt,"-dynamicFields-body"),gap:3},Object.values(b).map((function(e){var t=e.id,n=e.getValue,a=e.onChange,l=(0,i.Z)(e,Vt);return r.createElement(_t.Z,(0,o.Z)({"data-ga":k("".concat(t,"-").concat(l.component)),"data-testid":"".concat(Gt,"-").concat(t),getDataGa:k,key:t,id:t,onChange:null===a||void 0===a?void 0:a({id:t,setRequiredSubsets:q,setSecrets:V}),secrets:T,setSecrets:V,value:null===n||void 0===n?void 0:n({id:t,secrets:T})},l))}))))),r.createElement(ht.QD,{alignItems:"end","data-testid":"".concat(Gt,"-footer"),justifyContent:"center"},r.createElement(d.Button,{"data-ga":k("new"===n?"create-click":"edit-click"),"data-testid":"".concat(Gt,"-confirmButton"),disabled:!$,label:"OK",onClick:ee,textTransform:"uppercase"}))))},Yt=["data-testid"],qt={maxHeight:"none",whiteSpace:"initial"},Kt=function(e){var t=e["data-testid"],n=void 0===t?"channelList":t,a=(0,i.Z)(e,Yt),l=Bt(),c=l.bulkActions,s=l.channelData,u=l.currentChannelId,m=l.columns,p=l.dataGa,g=l.onFilter,f=l.onModalClose,E=l.rowActions,b=l.search,h=l.setSearch;return r.createElement(d.Flex,(0,o.Z)({column:!0,"data-testid":n,gap:4,height:"100%",margin:[3,0]},a),r.createElement(d.NetdataTable,{bulkActions:c,data:s,dataColumns:m,dataGa:p,globalFilter:b,globalFilterFn:g,onGlobalSearchChange:h,rowActions:E,testPrefixCallback:function(e){return e.name},meta:qt}),!!u&&r.createElement(zt,{"data-testid":"editChannelModal",id:u,onClose:f}))},Qt=n(58591);function Xt(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 $t(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Xt(Object(n),!0).forEach((function(t){(0,c.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Jt=(0,s.Z)((function(){return n.e(597).then(n.bind(n,95384))}),"SilencingRules"),en={side:"top",type:"solid",size:"1px",color:"border"},tn=function(){var e=(0,Qt.m$)().notificationsActiveTab,t=void 0===e?0:e,n=(0,r.useCallback)((function(e){var t=(0,Qt.m$)();(0,Qt.xs)($t($t({},t),{},{notificationsActiveTab:e}))}),[]);return r.createElement(r.Fragment,null,r.createElement(d.Flex,{padding:[0,0,0,4]},r.createElement(d.H3,null,"Alerts & Notifications")),r.createElement(d.Tabs,{selected:parseInt(t,10),onChange:n,height:"calc(100% - 44px)",margin:[4,0,0,0]},r.createElement(d.Tab,{"data-testid":"spaceSettings-notifications-methods-tab","data-ga":"manage-space::click-tab::notifications-methods-tab",label:r.createElement(d.Text,null,"Notification Methods")},r.createElement(d.Flex,{padding:[2,4],border:en,flex:!0},r.createElement(Kt,null))),r.createElement(d.Tab,{"data-testid":"spaceSettings-notifications-silencing-rules-tab","data-ga":"manage-space::click-tab::notifications-silencing-rules-tab",label:r.createElement(d.Text,null,"Notification Silencing Rules")},r.createElement(d.Flex,{border:en,flex:!0},r.createElement(r.Suspense,null,r.createElement(Jt,null))))))},nn=n(79655),rn=n(27856),an=n(78266),ln=n(37689),on=n(80959),cn=n(27308),sn=["available","classification","data-testid","description","docsLink","fields","id","internal","kind","kindLabel","slug","required","title"];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 mn(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,c.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 dn=function(e){var t=e.available,n=e.classification,a=e["data-testid"],c=void 0===a?"card":a,s=e.description,u=e.docsLink,m=e.fields,p=e.id,g=e.internal,f=e.kind,E=e.kindLabel,h=e.slug,v=e.required,x=e.title,w=(0,i.Z)(e,sn),C=ft.aU[h]||{},O=(0,gt.h3)("new"),P=(0,gt.Cz)("new"),I=(0,b.gI)("channel:Manage"),S=(0,y.Z)(!1),T=(0,l.Z)(S,4),k=T[0],Z=T[2],j=T[3],F=(0,r.useCallback)((function(){P(mn(mn({},Zt.C),{},{description:s,docsLink:u,fields:m,integration:h,loading:!1,loaded:!0,required:v,secrets:(0,bt.A_)(m,v)})),Z()}),[s,u,m,h,v]);return r.createElement(r.Fragment,null,r.createElement(d.Flex,(0,o.Z)({background:"elementBackground",column:!0,"data-testid":c,justifyContent:"between",flex:!1,height:37,padding:[3,2,2,3],margin:[0,0,4,0],position:"relative",overflow:"hidden",round:.5,width:75},w),r.createElement(ht.zT,(0,o.Z)({"data-testid":"".concat(c,"-blurredIcon")},C)),r.createElement(d.Flex,{column:!0,"data-testid":"".concat(c,"-details"),gap:3,margin:[0,0,3,0]},r.createElement(d.Flex,{"data-testid":"".concat(c,"-header"),justifyContent:"between"},r.createElement(d.Flex,{alignItems:"center","data-testid":"".concat(c,"-titleContainer"),gap:1},r.createElement(d.Icon,(0,o.Z)({"data-testid":"".concat(c,"-icon")},C)),r.createElement(d.Text,{"data-testid":"".concat(c,"-title")},x)),!g&&t&&r.createElement(Ye.Z,{align:"bottom",content:I?"":ft.Ue,plain:!0},r.createElement(d.Box,null,r.createElement(ht.nO,{"data-ga":"manage-integration-".concat(h,"::click-add::notification-integrations-tab"),"data-testid":"".concat(c,"-button"),disabled:!I,label:"Add",onClick:F}))),!g&&!t&&r.createElement(cn.Z,{classification:n,"data-ga":"manage-integration-".concat(h,"::click-plan-badge-").concat(n.toLowerCase(),"::notification-integrations-tab")})),r.createElement(d.TextSmall,{color:"textDescription","data-testid":"".concat(c,"-description")},s,u&&r.createElement(r.Fragment,null,"\xa0",r.createElement(xe.Z,{Component:ht.bb,"data-ga":"manage-integration-".concat(h,"::click-docs::notification-integrations-tab"),"data-testid":"".concat(c,"-docsLink"),href:u,target:"_blank",whiteSpace:"nowrap"},"Learn more.")))),r.createElement(Ye.Z,{align:"top",content:ft.XK[f].tooltip,"data-testid":"".concat(c,"-kindContainer"),plain:!0},r.createElement(d.Flex,{alignItems:"end",alignSelf:"end","data-testid":"".concat(c,"-kindContainer"),gap:1},r.createElement(d.Icon,{color:"textLite","data-testid":"".concat(c,"-kindIcon"),height:"16px",name:ft.XK[f].icon,width:"16px"}),r.createElement(d.TextSmall,{color:"textLite","data-testid":"".concat(c,"-kind")},E)))),k&&r.createElement(zt,{"data-testid":"createChannelModal",integrationId:p,onClose:function(){j(),O()}}))},pn=["data-testid","integrations","title"],gn=function(e){var t=e["data-testid"],n=void 0===t?"group":t,a=e.integrations,l=e.title,c=(0,i.Z)(e,pn);return a.length?r.createElement(d.Flex,(0,o.Z)({column:!0,"data-testid":n,gap:2,position:"relative"},c),r.createElement(d.TextBig,{color:"textDescription","data-testid":"".concat(n,"-title")},l),r.createElement(d.Flex,{flexWrap:!0,"data-testid":"".concat(n,"-integrations"),gap:4},a.map((function(e){return r.createElement(dn,(0,o.Z)({"data-testid":"".concat(e.slug,"Card"),key:e.slug},e))})))):null},fn=n(69414);function En(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?En(Object(n),!0).forEach((function(t){(0,c.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):En(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var hn=function(e){var t=(0,gt.R1)(e);(0,jt.Z)((function(){return{enabled:!!e,fetch:function(){return(0,pt.h3)(e)},onFail:function(e){return t(bn(bn({},fn.E),{},{error:e.message}))},onSettle:function(){return t({loading:!1,loaded:!0})},onSuccess:function(e){t(bn(bn({},fn.E),e))}}}),[e])},vn=["data-testid"],yn=function(e){var t=e["data-testid"],n=void 0===t?"integrations":t,a=(0,i.Z)(e,vn),c=(0,v.th)(),s=(0,v.uk)();hn(c);var m=(0,gt.ry)(c),p=m.available,g=m.error,f=m.loaded,E=m.unavailable,b=(0,r.useState)([]),h=(0,l.Z)(b,2),y=h[0],x=h[1],w=(0,r.useState)([]),C=(0,l.Z)(w,2),O=C[0],P=C[1],I=(0,r.useState)(""),S=(0,l.Z)(I,2),T=S[0],k=S[1];if(!f)return r.createElement(an.Z,{"data-testid":"".concat(n,"-loader"),title:"Loading services..."});if(g)return r.createElement(on.Z,{"data-testid":"".concat(n,"-error"),message:g,title:"Services of ".concat(s," are currently unavailable")});var Z=(0,rn.D)(300,(function(e){var t=e.target.value;k(t),x((0,bt.uf)(p,t)),P((0,bt.uf)(E,t))})),j=(0,u.Gn)(W.Sr,{spaceSlug:s,settingsTab:W.bK});return r.createElement(d.Flex,(0,o.Z)({column:!0,"data-testid":n},a,{padding:[0,4]}),r.createElement(d.Flex,{border:{side:"bottom",color:"separator"},"data-testid":"".concat(n,"-header"),margin:[0,0,4,0],padding:[0,0,4,0],width:"100%"},r.createElement(xe.Z,{as:nn.rU,Component:ht.Ce,"data-ga":"manage-integrations::click-back::notification-integrations-tab","data-testid":"".concat(n,"-backLink"),to:j},r.createElement(d.Icon,{"data-testid":"".concat(n,"-backIcon"),name:"arrow_left"}),r.createElement(d.H3,{"data-testid":"".concat(n,"-title")},W.fV[W.Q$]))),r.createElement(d.Flex,{column:!0,"data-testid":"".concat(n,"-content"),gap:4},r.createElement(d.Box,{as:ln.Z,"data-ga":"manage-integrations::search::notification-integrations-tab","data-testid":"".concat(n,"-search"),iconLeft:r.createElement(d.Icon,{name:"magnify",color:"textLite"}),onChange:Z,placeholder:"Search service",size:"small",width:{max:49.5}}),r.createElement(d.Flex,{column:!0,"data-testid":"".concat(n,"-groups")},r.createElement(gn,{"data-testid":"integrationGroupAvailable",integrations:T?y:p,title:"Available"}),r.createElement(gn,{"data-testid":"integrationGroupUnavailable",integrations:T?O:E,title:"Unavailable"}))))},xn=function(){return r.createElement(a.Z5,null,r.createElement(a.AW,{path:"/",element:r.createElement(tn,null)}),r.createElement(a.AW,{path:"/".concat(W.Q$),element:r.createElement(yn,null)}))},wn=n(46585),Cn=n(78710),On=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[(0,d.useInputValue)({maxChars:20,value:e.name||""})||{},(0,d.useInputValue)({maxChars:50,value:e.description||""})||{}]},Pn=n(14809),In=n(54131),Sn=n(15418),Tn=["nameInput","descriptionInput"],kn=function(e){var t=e.nameInput,n=e.descriptionInput,a=(0,i.Z)(e,Tn),c=(0,l.Z)(t,4),s=c[0],u=c[1],m=c[2],p=c[3],g=(0,l.Z)(n,4),f=g[0],E=g[1],b=g[2],h=g[3],v=(0,r.useMemo)((function(){return(0,In.x3)(s)}),[s]),y=(0,r.useMemo)((function(){return(0,In.uB)(f)}),[f]);return r.createElement(d.Flex,(0,o.Z)({column:!0},a),r.createElement(Sn.Z,{Component:d.TextInput,permission:"space:UpdateMeta",label:"Name",value:s,onChange:u,error:In.Qj[v],isDirty:p,instantFeedback:"all",fieldIndicator:m,"data-testid":"textInputs-spaceName"}),r.createElement(Sn.Z,{Component:d.TextInput,permission:"space:UpdateMeta",label:"Description",value:f,onChange:E,error:In.Qj[y],isDirty:h,instantFeedback:"all",fieldIndicator:b,"data-testid":"textInputs-spaceDescription"}))},Zn=n(57387),jn=["id"],Fn=function(e){var t=e.id,n=(0,i.Z)(e,jn);return r.createElement(d.Flex,(0,o.Z)({column:!0,gap:1},n),r.createElement(d.Text,{strong:!0},"Space Id"),r.createElement(Zn.ZP,{confirmationText:"Space ID copied to your clipboard."},t))},Dn=n(72671),An=n(20428),Nn=["nameInput","descriptionInput","onClose"],Mn=function(e){var t=e.nameInput,n=e.descriptionInput,a=e.onClose,c=(0,i.Z)(e,Nn),s=(0,v.OS)(),u=(0,An.Z)(s.id),m=(0,r.useState)(!1),p=(0,l.Z)(m,2),g=p[0],f=p[1],E=(0,l.Z)(t,1)[0],b=(0,l.Z)(n,1)[0],h=function(){a(),f(!1)},y=function(){return f(!1)},x=(0,r.useCallback)((function(){f(!0),u({name:E,description:b},{onSuccess:h,onFail:y})}),[E,b]),w=(0,r.useMemo)((function(){var e=(0,In.x3)(E),t=(0,In.uB)(b);return!!(g||e||t)||s.name===E&&(s.description===b||!s.description&&!b)}),[s,E,b,g]);return r.createElement(d.Button,(0,o.Z)({label:"SAVE",onClick:x,isLoading:g,disabled:w,"data-testid":"saveSpace-button"},c))},Ln=["onClose"],Rn=(0,r.memo)((function(e){var t=e.onClose,n=(0,i.Z)(e,Ln),a=(0,v.OS)(),c=(0,v.GM)("ids"),s=(0,y.Z)(),u=(0,l.Z)(s,4),m=u[0],p=u[2],g=u[3],f=On({name:a.name,description:a.description}),E=(0,l.Z)(f,2),b=E[0],h=E[1];if(!a.id)return null;var x=1===c.filter((function(e){return!(0,Cn.Ly)(e)})).length;return r.createElement(r.Fragment,null,r.createElement(d.Flex,(0,o.Z)({column:!0,"data-testid":"manageSpace",flex:"grow",justifyContent:"between"},n),r.createElement(d.Flex,{column:!0,"data-testid":"manageSpace-settings"},r.createElement(d.H3,{margin:[0,0,4,0]},"Info"),r.createElement(d.Flex,{column:!0,gap:8},r.createElement(d.Box,null,r.createElement(kn,{"data-testid":"manageSpace-nameInputs",nameInput:b,descriptionInput:h}),r.createElement(Fn,{"data-testid":"manageSpace-spaceIdInput",id:a.id}),r.createElement(d.Flex,{column:!0,gap:1,margin:[4,0,0]},r.createElement(d.TextInput,{label:"Your role in space",value:(0,ze.fm)(a.roleInSpace),disabled:!0})),r.createElement(d.Flex,{column:!0,gap:1,margin:[4,0,0]},r.createElement(d.TextInput,{label:"Plan",value:(0,ze.db)(a.plan),disabled:!0}))))),r.createElement(d.Flex,{"data-testid":"manageSpace-actions",justifyContent:"between",alignItems:"center",padding:[0,10,0,0]},r.createElement(d.Flex,{"data-testid":"manageSpace-deleteLeaveActions",gap:4},r.createElement(Ye.Z,{align:"top",content:x&&wn.T$.leave,isBasic:!0,stretch:"align"},r.createElement(d.Flex,{alignItems:"center"},r.createElement(d.Button,{"data-ga":"manage-space-tab::click-leave-space::manage-space-modal","data-testid":"manageSpace-leave",disabled:x,icon:"switch_off",flavour:"borderless",label:"Leave space",neutral:!0,padding:[0],width:"fit-content",onClick:p}))),r.createElement(Dn.Z,{"data-testid":"manageSpace-delete",id:a.id,isLastSpace:x,name:a.name,onClose:t})),r.createElement(Mn,{"data-testid":"manageSpace-save",nameInput:b,descriptionInput:h,onClose:t}))),m&&r.createElement(Pn.Z,{id:a.id,name:a.name,onClose:g}))}),(function(){return!0})),Bn=n(51091);function _n(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 Un(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_n(Object(n),!0).forEach((function(t){(0,c.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_n(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Vn=function(){var e=(0,a.s0)(),t=(0,v.th)(),n=(0,a.bS)(W.xN),l=(0,a.bS)(W.Sr),o=(n||l||{}).params,c=o.spaceSlug,i=void 0===c?"":c,s=o.settingsTab,m=void 0===s?"":s,d=o.settingsSubTab,p=void 0===d?"":d,g=(0,v.OS)("name"),f=(0,k.HM)(t,p),E=(0,k.tE)(f,"name"),b=W.fV[m],h=(0,r.useCallback)((function(){e((0,u.Gn)(W.Sr,{spaceSlug:i,settingsTab:m}))}),[i,m]),y=(0,r.useMemo)((function(){var e=[{name:"Manage Space",isDisabled:!0},{name:g,isDisabled:!0},Un({name:b},!!p&&{onClick:h})];return p&&e.push({name:b===W.fV[W.eq]?E:W.fV[p]||p}),e}),[h,E,g,b,p]);return r.createElement(Bn.Z,{isBig:!0,items:y,showBackButton:!1,testid:"manageSpace"})},Hn=n(22648),Wn=n(46715),Gn=(0,r.createContext)(),zn=(0,r.createContext)(),Yn=function(e){var t=e.children,n=(0,y.Z)(!1),a=(0,l.Z)(n,2),o=a[0],c=a[1];return r.createElement(Gn.Provider,{value:o},r.createElement(zn.Provider,{value:c},t))},qn=function(){return(0,r.useContext)(Gn)},Kn=function(){return(0,r.useContext)(zn)},Qn=(n(17727),n(43337)),Xn=function(e){return r.createElement(d.Box,(0,o.Z)({as:"hr",height:"100%",sx:{borderWidth:"0px 0px 0px 1px",borderColor:"borderSecondary",borderStyle:"solid"}},e))},$n=function(){return r.createElement(Xn,{height:"1px",width:"100%",sx:{borderWidth:"1px 0px 0px 0px",borderColor:"borderSecondary",borderStyle:"solid"}})},Jn=function(e){return["free","earlyBird"].includes(e)},er=function(e,t){var n=t.amountPerNode;if(e.amountPerNode&&e.monthlyDiscountPercentagePerNode){var r=e.amountPerNode/12;n=lr(r,e.monthlyDiscountPercentagePerNode)}return n},tr=function(e){if(!e)return null;var t=e.city,n=e.country,r=e.line_1,a=e.line_2,l=e.postalCode,o=e.state;return[[r,a].filter(Boolean).join(" "),t,l,o,n].filter(Boolean).join(", ")},nr=function(e,t){return Jn(t)?"hollow":"business"===t||"pro"===t&&Jn(e)?"default":"hollow"},rr=function(){return{cellStyles:{height:"40px"},headStyles:{height:"32px"}}},ar=function(e,t,n,r,a){return((t||0)-e)*(n||0)+(r||0)-(a||0)},lr=function(e,t){return e*(1/(1-t))},or=function(e){var t=e.currentPlan,n=e.billingEmail,a=e.paymentMethod,o=e.businessName,c=e.vatNo,i=e.billingAddress,s=(0,Wn.SH)(),u=(0,l.Z)(s,2),m=u[0],p=u[1],g=!!t.billingEmail&&!p;return r.createElement(d.Flex,{column:!0,gap:3},r.createElement(d.Flex,{gap:3},r.createElement(d.TextInput,{value:n||"",label:"Billing email",placeholder:"Not specified",disabled:!0}),r.createElement(d.TextInput,{value:null!==a&&void 0!==a&&a.id?"**** ".concat(null===a||void 0===a?void 0:a.id):"",label:"Default payment method",placeholder:"Not specified",disabled:!0})),c&&r.createElement(d.Flex,{gap:3},r.createElement(d.TextInput,{value:o||"",label:"Business name",placeholder:"Not specified",disabled:!0}),r.createElement(d.TextInput,{value:c,label:"VAT number",placeholder:"Not specified",disabled:!0})),r.createElement(d.Flex,{gap:3},r.createElement(d.TextInput,{value:tr(i)||"",label:"Billing address",placeholder:"Not specified",disabled:!0})),r.createElement(xe.Z,{Component:d.Flex,cursor:g?"pointer":"default",disabled:!g,onClick:m,alignItems:"center",gap:1,"data-ga":"billing-options::click::billing"},r.createElement("span",null,"Change billing information and payment method"),r.createElement(d.Icon,{name:"nav_arrow_goto",width:"12px",height:"12px"})))},cr=function(e){var t=e.onReset;return r.createElement(d.Box,{as:d.Icon,name:"close_circle",onClick:t,cursor:"pointer",width:3,height:3,color:"border",position:"absolute",left:"2px"})},ir=function(e){var t=e.promotionCode,n=e.onReset;return r.createElement(d.Flex,{width:"100%"},r.createElement(d.Pill,{background:"nodeBadgeBackground",padding:[0],borderColor:"nodeBadgeBackground"},r.createElement(d.Flex,{position:"relative",gap:2,alignItems:"center",padding:[1,2,1,5]},r.createElement(cr,{onReset:n}),r.createElement(d.Text,null,t))))},sr=function(e){var t=e.promotionCode,n=e.onApply,a=e.error,o=(0,r.useState)(a?t:""),c=(0,l.Z)(o,2),i=c[0],s=c[1],u=function(){s(""),n("")};return r.createElement(d.Flex,{column:!0,gap:1},r.createElement(d.Text,{strong:!0},"Promotion code"),t&&!a?r.createElement(ir,{promotionCode:t,onReset:u}):r.createElement(d.Flex,{column:!0,gap:1},r.createElement(d.Flex,{gap:3,alignItems:"baseline"},r.createElement(d.TextInput,{value:i,onChange:function(e){return s(e.target.value)},placeholder:"Promotion code"}),a?r.createElement(d.Button,{label:"Clear",flavour:"hollow",onClick:u,padding:[3,4],disabled:!i}):r.createElement(d.Button,{label:"Apply",onClick:function(){return n(i)},padding:[3,4],disabled:!i})),a&&r.createElement(d.Text,{color:"error"},a)))},ur=function(e){var t=e.needsCommitment,n=e.commitment,a=e.handleCommitmentChange;return t&&r.createElement(d.Flex,{column:!0,gap:2},r.createElement(d.Flex,{gap:4,alignItems:"baseline"},r.createElement(d.Text,{strong:!0,style:{whiteSpace:"nowrap"}},"Committed Nodes"),r.createElement(d.TextInput,{onChange:a,value:n,placeholder:"i.e. 14",type:"number",min:1})),r.createElement(d.TextSmall,null,"Nodes that you'll have a discount of 25% on the original cost per node of the plan. This amount will be part of your annual prepayment."))},mr=function(e){return"earlyBird"===e.currentPlan.slug&&r.createElement(r.Fragment,null,r.createElement(Xn,{height:"1px",width:"100%",sx:{borderWidth:"1px 0px 0px 0px",borderColor:"borderSecondary",borderStyle:"solid"}}),r.createElement(d.Flex,{gap:3},r.createElement(d.Icon,{size:"large",color:"warning",name:"warning_triangle"}),r.createElement(d.Text,null,"You are moving from ",r.createElement(d.Text,{strong:!0},"Early Bird")," plan to another plan, you won't be able to come back to this. The ",r.createElement(d.Text,{strong:!0},"Community")," free plan will be there if you wish to cancel but this doesn't allow you to invite or change users using the Member role.")))},dr=function(e){return"earlyBird"===(null===e||void 0===e?void 0:e.slug)?"earlyBird":e&&e.slug&&"free"!==e.slug?"".concat(e.slug,"-").concat(e.interval):"free"},pr=(n(54678),m.default.div.withConfig({displayName:"withTableWrapper__TableWrapper",componentId:"sc-drcfxi-0"})(["margin-top:30px;"])),gr=function(e){return function(t){return r.createElement(pr,null,r.createElement(e,t))}},fr=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"});function Er(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 br(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Er(Object(n),!0).forEach((function(t){(0,c.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Er(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var hr={size:50,minSize:50,maxSize:100},vr=function(e){return function(){return r.createElement(d.Flex,{width:"100%",justifyContent:"end"},e)}},yr=function(e){var t=e.getValue;return r.createElement(d.Flex,{width:"100%",justifyContent:"end"},t())},xr=[br({id:"name",accessor:"name",header:""},hr),br({id:"price",accessor:"price",header:vr("Price"),cell:yr},hr),br({id:"qty",accessor:"qty",header:vr("Qty"),cell:yr},hr),br({id:"month",accessor:"month",header:vr("Month"),cell:yr},hr),br({id:"total",accessor:"total",header:vr("Total"),cell:yr},hr)],wr=function(e){return r.createElement(d.Flex,(0,o.Z)({gap:3},e),r.createElement(d.Icon,{size:"large",color:"warning",name:"warning_triangle"}),r.createElement(d.Text,null,"No immediate charges are applicable to this plan subscription. On-demand usage charges will be applied based on your node period count."))},Cr=gr(d.NetdataTable),Or=function(e){var t=e.needsCommitment,n=e.price,a=e.spaceTotal,l=e.commitment,o=e.currentCommitment,c=e.onlyCommitment,i=e.balance,s=e.nodesTotal,u=e.zeroSubscriptionTotal,m=e.checkoutIsDisabled,p=function(e,t,n,r,a){if(!r)return r;var l=ar(a,e,t,n);return r-l<0?r:l}(l,n.pricing.primary.amountPerNode,c?0:n.pricing.primary.amountFlat,i.amount,o),g=((null===n||void 0===n?void 0:n.pricing)||{}).primary,f=(null===g||void 0===g?void 0:g.monthlyDiscountPercentagePerNode)||0,E=parseFloat(s+a),b=parseFloat(E*f),h=parseFloat(E-b);return r.createElement(r.Fragment,null,u?m?null:r.createElement(wr,null):r.createElement(r.Fragment,null,t&&r.createElement(r.Fragment,null,r.createElement(d.Flex,{justifyContent:"between"},r.createElement(d.Text,null,"Subscription Total"),r.createElement(d.Text,null,fr.format(E))),r.createElement(d.Flex,{justifyContent:"between"},r.createElement(d.Text,{color:"primary"},"Discount (",100*f,"%)"),r.createElement(d.Text,{color:"primary"},"- ",fr.format(b)))),r.createElement(d.Flex,{justifyContent:"between"},r.createElement(d.Text,null,"Total"),r.createElement(d.Text,null,fr.format(h))),!!i.amount&&r.createElement(d.Flex,{justifyContent:"between"},r.createElement(d.Text,null,"Credit amount"),r.createElement(d.Text,null,"- ",fr.format(p))),r.createElement($n,null),r.createElement(d.Flex,null,r.createElement(d.TextMicro,null,"Additional taxes may be applicable"))),r.createElement(d.Flex,{justifyContent:"between"},r.createElement(d.H0,{strong:!0},"Total payable"),r.createElement(d.H0,{strong:!0,"data-testid":"totalPayableAmountCheckout"},fr.format(function(){var e=ar.apply(void 0,arguments);return e<0?0:e}(o,l,n.pricing.primary.amountPerNode,c?0:n.pricing.primary.amountFlat,p)))))},Pr=function(e){var t=e.price,n=e.needsCommitment,a=e.currentCommitment,l=e.onlyCommitment,o=e.balance,c=e.spaceTotal,i=e.amountPerNodePerMonth,s=e.amountPerSpacePerMonth,u=e.commitment,m=e.nodesTotal,d=e.months,p=e.tableMeta,g=void 0===p?rr:p,f=e.checkoutIsDisabled,E=(0,r.useMemo)((function(){return 0==parseFloat(m+c)}),[m,c]),b=(0,r.useMemo)((function(){var e=!isNaN(c)&&c>0?{id:"space",name:"Space",price:fr.format(s),qty:1,month:d,total:fr.format(c)}:null;return n?[isNaN(m)?null:{id:"nodes",name:"Nodes",price:fr.format(i),qty:u||0,month:d,total:fr.format(m)},e].filter(Boolean):[e]}),[n,s,c,m,d]);return r.createElement(r.Fragment,null,!E&&r.createElement(r.Fragment,null,r.createElement(Cr,{meta:g,dataColumns:xr,data:b}),r.createElement($n,null)),r.createElement(Or,{needsCommitment:n,price:t,spaceTotal:c,commitment:u,currentCommitment:a,onlyCommitment:l,balance:o,nodesTotal:m,zeroSubscriptionTotal:E,checkoutIsDisabled:f}))},Ir=n(93433);n(23157);function Sr(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 Tr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Sr(Object(n),!0).forEach((function(t){(0,c.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var kr,Zr=gr(d.NetdataTable),jr=function(e){var t=e.lineItems;return r.createElement(r.Fragment,null,t.map((function(e){var t,n,a=(n=e).description?n.description.startsWith("Discount")?{color:"primary"}:n.description.startsWith("VAT")?{color:"textLite"}:{}:{},l=e.isInfo?d.TextSmall:d.Text;return r.createElement(d.Flex,{key:e.description,justifyContent:"between"},r.createElement(l,a,e.description),r.createElement(l,a,fr.format(null===(t=e.total)||void 0===t?void 0:t.amount)))})))},Fr=(kr=function(e){var t=e.lineItems;return r.createElement(d.Flex,{justifyContent:"between",margin:[4,0,0,0]},r.createElement(d.H0,{strong:!0},"Total payable"),r.createElement(d.H0,{strong:!0,"data-testid":"totalPayableAmountPreview"},fr.format(t.totalPayable.total.amount)))},function(e){var t;return e.lineItems.totalPayable?null!==(t=e.lineItems.info)&&void 0!==t&&t.length?r.createElement(d.Flex,{column:!0,gap:1},r.createElement(kr,e),r.createElement(jr,{lineItems:e.lineItems.info})):r.createElement(kr,e):null}),Dr=function(e){var t=e.lineItems,n=e.agree,a=e.toggleAgree,l=e.zeroPreviewSubscriptionTotal;return r.createElement(r.Fragment,null,r.createElement($n,null),l&&r.createElement(wr,{padding:[0,0,2,0]}),r.createElement(d.Flex,{gap:3},r.createElement(d.Checkbox,{checked:n,onChange:a}),r.createElement(d.Text,null,"I agree to Netdata Inc's"," ",r.createElement(xe.Z,{href:"https://www.netdata.cloud/service-terms/",rel:"noopener noreferrer",target:"_blank"},"Terms of Service")," ","and"," ",r.createElement(xe.Z,{href:"https://netdata.cloud/privacy",rel:"noopener noreferer",target:"_blank"},"Privacy Policy"))),r.createElement(Fr,{lineItems:t}))},Ar=function(e){var t=e.lineItems,n=e.tableMeta,a=void 0===n?rr:n;return r.createElement(r.Fragment,null,r.createElement(Zr,{meta:a,dataColumns:xr,data:t.table}),r.createElement($n,null),r.createElement(jr,{lineItems:t.footer}))},Nr=function(e){var t=e.title,n=e.onConfirm,a=e.onClose,l="Community"==t,o=l?"Cancellation":"Downgrading";return r.createElement(d.ConfirmationDialog,{confirmLabel:"Yes","data-ga":"downgrade-dialog","data-testid":"downgradeDialog",handleConfirm:function(){n(),a()},handleDecline:function(){a()},message:r.createElement(d.Flex,{column:!0,gap:2},r.createElement(d.Text,null,"Are you sure you want to ",r.createElement(d.Text,{strong:!0},"move to the ",t," plan")," and cancel your current plan?"),l&&r.createElement(d.Text,null,"Upon cancellation,"," ",r.createElement(d.Text,{strong:!0},"a credit of the value related to the unused period will be credited to your Netdata account.")," ","The credit will be available for you to use on future plan subscriptions with us."),r.createElement(d.Text,null,"For the next 24 hours, you will be able to use all your current notification method configurations."," ",r.createElement(d.Text,{strong:!0},"After 24 hours, any of the notification method configurations that aren't available on your space's plan will be automatically disabled.")),r.createElement(d.Text,null,o," might affect your Space users. Please check what roles are available on the"," ",r.createElement(xe.Z,{href:"https://learn.netdata.cloud/docs/nightly/concepts/netdata-plans#areas-impacted-by-plans",rel:"noopener noreferrer",strong:!0,target:"_blank"},t," plan"),"."," ",r.createElement(d.Text,{strong:!0},"Users with unavailable roles on the ",t," plan will immediately have restricted access to the Space.")),r.createElement(d.Text,null,"Do you wish to proceed?")),title:"Go to ".concat(t," plan?")})},Mr=n(49489),Lr=["title","isDowngrade","showProrations","checkoutOrUpdate"];function Rr(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 Br(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rr(Object(n),!0).forEach((function(t){(0,c.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var _r=function(e){return e?"::commited-".concat(e):""},Ur=(0,m.default)(d.Flex).withConfig({displayName:"checkoutTotals__CheckoutButtonWrapper",componentId:"sc-1q0h6ca-0"})(["background:",";padding:16px 0;position:sticky;bottom:0;z-index:20;"],(0,d.getColor)("mainBackground")),Vr=function(e){return function(t){var n=t.title,a=t.isDowngrade,c=t.showProrations,s=t.checkoutOrUpdate,u=(0,i.Z)(t,Lr),m=(0,y.Z)(),d=(0,l.Z)(m,4),p=d[0],g=d[2],f=d[3];return c&&a?r.createElement(r.Fragment,null,p&&r.createElement(Nr,{title:n,onConfirm:s,onClose:f}),r.createElement(e,(0,o.Z)({onClick:g},u))):r.createElement(e,(0,o.Z)({onClick:s},u))}}((0,m.default)(d.Button).withConfig({displayName:"checkoutTotals__CheckoutButton",componentId:"sc-1q0h6ca-1"})(["flex:auto;"])),Hr=function(e){var t,n=e.title,a=e.slug,o=e.onClose,c=e.currentPlan,i=e.price,s=e.balance,u=e.commitment,m=e.currentCommitment,p=void 0===m?0:m,g=e.email,f=e.needsCommitment,E=e.onlyCommitment,b=e.previewData,h=e.loadingPreview,v=e.showProrations,x=e.promotionCode,w=function(e,t){var n,r;return((null===(n=Mr.Vc[t])||void 0===n?void 0:n.level)||0)<((null===(r=Mr.Vc[e])||void 0===r?void 0:r.level)||0)}(c.slug,a),C=(0,y.Z)(!1),O=(0,l.Z)(C,2),P=O[0],I=O[1],S=v&&!P||!v&&!g||f&&(p===u||!u||u<1),T=(0,y.Z)(),k=(0,l.Z)(T,2),Z=k[0],j=k[1],F=(0,Wn.eY)(),D=(0,Wn.Zn)(),A=v||c.billingEmail?D:F,N=(null===i||void 0===i?void 0:i.pricing)||{},M=N.primary,L=N.secondary,R="year"===i.interval?12:1,B=er(M,L),_=f?B*R*(u||0):0,U=function(e){var t=e.amountFlat||0;if(e.monthlyDiscountPercentagePerNode&&e.amountFlat){var n=e.amountFlat/12;t=lr(n,e.monthlyDiscountPercentagePerNode)}return t}(M),V=U*R,H=(t=null===b||void 0===b?void 0:b.invoiceLineItems,(0,r.useMemo)((function(){if(null===t||void 0===t||!t.length)return null;var e=!1;return t.reduce((function(t,n){var r;return"Total payable"==n.description?(t.totalPayable=n,e=!0,t):(n.unitPrice?t.table=[].concat((0,Ir.Z)(t.table),[{id:n.description,name:n.description,price:fr.format(n.unitPrice.amount),qty:n.quantity,month:n.month,total:null===(r=n.total)||void 0===r?void 0:r.amount}]):e?t.info=[].concat((0,Ir.Z)(t.info),[Tr(Tr({},n),{},{isInfo:!0})]):t.footer=[].concat((0,Ir.Z)(t.footer),[n]),t)}),{table:[],footer:[],info:[]})}),[t])),W=((null===H||void 0===H?void 0:H.footer)||[]).some((function(e){var t=e.description,n=e.total;return"Subscription Total"==t&&0==(null===n||void 0===n?void 0:n.amount)}));return r.createElement(d.Flex,{column:!0,gap:3},v?h||!H||W?null:r.createElement(Ar,{lineItems:H,agree:P,toggleAgree:I}):r.createElement(Pr,{price:i,needsCommitment:f,currentCommitment:p,onlyCommitment:E,balance:s,spaceTotal:V,amountPerNodePerMonth:B,amountPerSpacePerMonth:U,commitment:u,nodesTotal:_,months:R,checkoutIsDisabled:S}),r.createElement(Ur,{column:!0,gap:2},v&&!h&&H&&r.createElement(Dr,{lineItems:H,agree:P,toggleAgree:I,zeroPreviewSubscriptionTotal:W}),r.createElement(Vr,{title:n,isDowngrade:w,label:v?"Checkout":"Proceed to checkout",disabled:!!S||Z,checkoutOrUpdate:function(){j(),A(Br(Br({productId:i.id,email:(null===b||void 0===b?void 0:b.billingEmail)||g},f&&{commitment:u}),v&&x&&{promotionCode:x})).then(o).finally(j)},isLoading:Z,"data-ga":"proceedTocheckoutButton::click-".concat(dr(i)).concat(_r(u),"::billing"),"data-testid":"billingCheckoutTotals-proceedToCheckoutButton",showProrations:v})))},Wr=function(e){var t=e.prices,n=e.currentPlan,a=(0,r.useState)(0),o=(0,l.Z)(a,2),c=o[0],i=o[1],s=t[c],u=null===s||void 0===s?void 0:s.commitment,m=(0,r.useState)(n.committedNodes||1),d=(0,l.Z)(m,2),p=d[0],g=d[1];return{recurringIndex:c,setRecurringIndex:i,price:s,needsCommitment:u,commitment:p,handleCommitmentChange:function(e){return g(e.target.value?parseInt(e.target.value,10):"")}}},Gr=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).title,t=void 0===e?"Checkout":e;return function(e){return function(n){return r.createElement(g.u6,{right:!0,closeOnEsc:!0,closeOnOverlayClick:!0,onClose:n.onClose},r.createElement(f.x,{onClose:n.onClose,title:t}),r.createElement(d.Flex,{column:!0,padding:[4,4,0,4],justifyContent:"between",height:"calc(100vh - 60px)",overflow:"auto"},r.createElement(e,n)))}}};function zr(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}var Yr=3e5,qr=Gr({title:"Update plan"})((function(e){var t=e.title,n=e.onClose,a=e.prices,i=e.currentPlan,s=void 0===i?{}:i,u=e.children,m=Wr({prices:a,currentPlan:s}),p=m.recurringIndex,g=m.setRecurringIndex,f=m.price,E=m.needsCommitment,b=m.commitment,h=m.handleCommitmentChange,v=(0,r.useState)(""),y=(0,l.Z)(v,2),x=y[0],w=y[1],C=(0,r.useState)(0),O=(0,l.Z)(C,2),P=O[0],I=O[1],S=(0,r.useState)(Yr),T=(0,l.Z)(S,2),k=T[0],Z=T[1],j=(0,Wn.fG)(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zr(Object(n),!0).forEach((function(t){(0,c.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({productId:f.id,promotionCode:x},E&&b&&{commitment:b}),P),F=j.loading,D=j.value,A=j.promoCodeError;return(0,Qn.Z)((function(){F||I((function(e){return e+1}))}),k),(0,r.useEffect)((function(){Z(F?null:Yr)}),[F]),r.createElement(r.Fragment,null,r.createElement(d.Flex,{column:!0,gap:4},r.Children.map(u,(function(e){return(0,r.cloneElement)(e,{recurringIndex:p,setRecurringIndex:g})})),r.createElement(ur,{needsCommitment:E,commitment:b,handleCommitmentChange:h}),r.createElement($n,null),F?r.createElement(an.Z,{title:"Loading billing info...",height:"auto"}):D?r.createElement(r.Fragment,null,r.createElement(or,(0,o.Z)({currentPlan:s},D)),r.createElement($n,null),r.createElement(sr,{promotionCode:x,onApply:w,error:A})):r.createElement("div",null,"No data available"),r.createElement(mr,{currentPlan:s})),r.createElement(Hr,{title:t,slug:f.slug,currentPlan:s,onClose:n,price:f,balance:s.balance,commitment:b,needsCommitment:E,previewData:D,loadingPreview:F,showProrations:!0,promotionCode:x}))})),Kr=Gr()((function(e){var t=e.onClose,n=e.prices,a=e.currentPlan,o=void 0===a?{}:a,c=e.children,i=Wr({prices:n,currentPlan:o}),s=i.recurringIndex,u=i.setRecurringIndex,m=i.price,p=i.needsCommitment,g=i.commitment,f=i.handleCommitmentChange,E=(0,Te.Iy)("email"),b=(0,r.useState)(o.billingEmail||E||""),h=(0,l.Z)(b,2),v=h[0],y=h[1];return r.createElement(r.Fragment,null,r.createElement(d.Flex,{column:!0,gap:4},r.Children.map(c,(function(e){return(0,r.cloneElement)(e,{recurringIndex:s,setRecurringIndex:u})})),r.createElement(ur,{needsCommitment:p,commitment:g,handleCommitmentChange:f}),r.createElement($n,null),r.createElement(d.TextInput,{onChange:function(e){return y(e.target.value)},value:v,label:"Billing email",placeholder:"jsmith@example.com"}),r.createElement(mr,{currentPlan:o})),r.createElement(Hr,{currentPlan:o,onClose:t,price:m,balance:o.balance,commitment:g,email:v,needsCommitment:p}))})),Qr=n(89405),Xr=["inModal","recurringIndex","setRecurringIndex"],$r=function(e){var t=e.primary,n=e.secondary;return r.createElement(d.Flex,{column:!0,gap:2},t||n?r.createElement(r.Fragment,null,r.createElement(Ye.Z,{align:"top",content:t.amountPerNode?"Price per active node per month for committed usage of nodes for a year":"Price per node per month",isBasic:!0,plain:!0,stretch:"align"},r.createElement(d.H0,null,fr.format(er(t,n)),r.createElement(d.TextSmall,{color:"textLite"},"/",r.createElement(xe.Z,{Component:d.TextSmall,href:"https://www.netdata.cloud/pricing/#do-i-have-to-pay-for-nodes-that-are-no-longer-online",rel:"noopener noreferrer",target:"_blank"},"Node"),"/month")))):r.createElement(d.H0,null,"Free, Forever"),(null===t||void 0===t?void 0:t.monthlyDiscountPercentagePerNode)&&r.createElement(d.Flex,null,r.createElement(d.Text,null,r.createElement(d.Text,{strong:!0},100*t.monthlyDiscountPercentagePerNode,"% discount")," applicable on space and committed node prices, billed annually.")))},Jr=m.default.div.withConfig({displayName:"pricingDetails__OneLine",componentId:"sc-hbslp4-0"})(["white-space:nowrap white-space:nowrap;"]),ea=function(e){var t=e.interval,n=e.currentPeriodTo,a=e.committedNodes,l=e.nodesLastPeriod,o=e.showPromotion,c=e.cancelling,i=e.onCancelPlan,s=(0,Qr.rA)().localeDateString,u=l-a;return r.createElement(d.Flex,{column:!0,gap:1},!!n&&r.createElement(d.TextSmall,null,r.createElement(d.TextSmall,{strong:!0,"data-testid":"billingPricingDetails-interval"},"Billing ".concat(Mr.go[t]))," ","(renews ",s(new Date(n),{long:!1}),")"),o&&"month"===t&&r.createElement(xe.Z,{onClick:i,disabled:c},r.createElement(Jr,null,"Save 25% by changing your billing frequency to yearly")),"year"===t&&r.createElement(r.Fragment,null,r.createElement(d.TextSmall,null,"Committed Nodes:"," ",r.createElement(d.Text,{strong:!0,"data-testid":"billingPricingDetails-committedNodesNumber"},a)),"number"===typeof l&&r.createElement(d.TextSmall,null,0===u&&"Your current Period count is equal to commitment",0!==u&&r.createElement(r.Fragment,null,"Your current Period count is ",u>0?"above":"below"," by"," ",r.createElement(d.TextSmall,{color:u>0?"error":"success",strong:!0},u>0?"+":"",u," node",1===Math.abs(u)?"":"s")))))},ta=function(e){var t=e.features;return r.createElement(d.Flex,{column:!0,gap:1},t.map((function(e){return r.createElement(d.Flex,{gap:2,key:e},r.createElement(d.Box,{width:5},r.createElement(d.Icon,{name:"check",width:"20px",height:"20px",color:"primary"})),r.createElement(d.TextSmall,null,e))})),r.createElement(d.Flex,{gap:2},r.createElement(d.Box,{width:5}),r.createElement(xe.Z,{Component:d.Flex,as:nn.rU,cursor:"pointer",alignItems:"center",gap:1,color:"text",hoverColor:"textFocus",to:"all-plans"},r.createElement(d.Text,{strong:!0},"View full details"),r.createElement(d.Icon,{name:"chevron_right",width:"16px",height:"16px"}))))},na=function(e){return function(t){var n=t.inModal,a=t.recurringIndex,l=t.setRecurringIndex,o=(0,i.Z)(t,Xr);return n?r.createElement(d.Flex,{width:"100%",justifyContent:"between",alignItems:"center"},r.createElement(e,o),r.createElement(d.Flex,{gap:3,padding:[0,10]},Mr.FC.map((function(e,t){return r.createElement(d.RadioButton,{key:e,checked:a===t,onChange:function(){return l(t)},"data-testid":"billingPaidPlans-".concat(e,"-radioButton")},r.createElement(d.Text,{color:"textDescription"},(0,ze.fm)(Mr.go[e])))})))):r.createElement(e,o)}}((function(e){var t=e.children;return r.createElement(d.H3,{"data-testid":"billingPricingDetails-activePlanName"},t)})),ra=function(e){var t,n=e.slug,a=e.prices,l=e.recurringIndex,c=void 0===l?1:l,i=e.setRecurringIndex,s=e.currentPlan,u=void 0===s?{}:s,m=e.isActive,p=e.showAllDetails,g=e.showTeaserDetails,f=e.cancelling,E=e.onCancelPlan,b=e.title,h=e.features,v=e.nodesLastPeriod,y=e.inModal;return r.createElement(d.Flex,{column:!0,gap:2},r.createElement(d.Flex,{alignItems:"center",gap:2},r.createElement(na,{inModal:y,recurringIndex:c,setRecurringIndex:i},b),m&&r.createElement(d.Pill,{flavour:"success","data-testid":"active-plan",icon:"checkmark_s",size:"normal",iconSize:"16px"},"Active")),(p||!m||"free"===n)&&r.createElement($r,(null===(t=a[c])||void 0===t?void 0:t.pricing)||{}),g&&!!h&&r.createElement(ta,{features:h}),m&&!Jn(n)&&r.createElement(ea,(0,o.Z)({},u,{showPromotion:!0,cancelling:f,onCancelPlan:E,nodesLastPeriod:v})))},aa=["slug","prices","freePlanId","isSmall","isActive","currentPlan","showAllPlans","showTeaserDetails","allPlansView","nodesLastPeriod"];function la(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 oa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?la(Object(n),!0).forEach((function(t){(0,c.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):la(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ca=function(e){var t=e.slug,n=e.prices,a=void 0===n?[]:n,c=e.freePlanId,s=e.isSmall,u=e.isActive,m=e.currentPlan,p=e.showAllPlans,g=e.showTeaserDetails,f=e.allPlansView,E=void 0!==f&&f,h=e.nodesLastPeriod,v=(0,i.Z)(e,aa),x=qn(),w=Kn(),C=Mr.Vc[t]||Mr.Vc.free,O=C.title,P=C.features,I=(0,b.gI)("billing:Manage"),S=(0,r.useState)({}),T=(0,l.Z)(S,2),k=T[0],Z=T[1],j=(0,y.Z)(),F=(0,l.Z)(j,4),D=F[0],A=F[2],N=F[3],M=function(e){var t=e.currentPlan,n=e.slug,r=t.slug,a=t.interval;return r===n?Jn(n)?"Current plan":"year"===a?"Update plan options":"Change billing frequency":Jn(r)&&!Jn(n)||"pro"===r&&"business"===n?"Upgrade":"Select"}({currentPlan:m,slug:t}),L=(0,ve.Z)(),R=(0,l.Z)(L,2),B=R[0],_=R[1],U=(0,y.Z)(),V=(0,l.Z)(U,2),H=V[0],W=V[1],G=(0,Wn.Zn)(),z=function(){H||x||(Jn(t)?Z({type:"cancel"}):Jn(m.slug)?J("checkout"):J("update"))},Y=!!m.billingEmail,q=Y?qr:Kr,K=(0,Qt.m$)(),Q=K.billingModalType,X=K.billingModalSlug,$=["checkout","update"].includes(Q)&&t==X,J=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=(0,Qt.m$)();(0,Qt.xs)(oa(oa({},n),{},{billingModalType:e,billingModalSlug:""==e?e:t}))};return r.createElement(d.Flex,{column:!0,gap:7},r.createElement(d.Flex,(0,o.Z)({column:!0,height:s?"auto":p?57:90,width:99.5,flex:s,padding:s?[6,10]:[0,10],gap:2,justifyContent:"between"},v),r.createElement(ra,{slug:t,prices:a,isActive:u,currentPlan:m,cancelling:x,showAllDetails:p,showTeaserDetails:g,title:O,features:P,nodesLastPeriod:h,onCancelPlan:z}),!E&&r.createElement(Sn.Z,{Component:d.Button,permission:"billing:Manage","data-ga":"upgrade-button::click-".concat(dr({slug:t}),"::current-").concat(dr(m),"::billing"),"data-testid":"billingPlan-".concat(t,"-").concat(u?"currentPlan":"upgradeButton"),label:M,flavour:nr(null===m||void 0===m?void 0:m.slug,t),disabled:H||x||!!u&&Jn(t),width:"100%",onClick:z,isLoading:H,loadingLabel:"Cancelling"}),!p&&!Jn(m.slug)&&r.createElement(xe.Z,{Component:d.Flex,as:nn.rU,cursor:"pointer",alignItems:"center",gap:1,color:"text",hoverColor:"textFocus",to:"all-plans",padding:[4,0,0],disabled:x,"data-testid":"billingPlan-viewMorePlansLink","data-ga":"change-plan::click::billing"},r.createElement("span",null,I?"Change plan":"View plans"),r.createElement(d.Icon,{name:"chevron_right",width:"16px",height:"16px"})),"cancel"===k.type&&!Jn(m.slug)&&!D&&r.createElement(Nr,{title:O,onConfirm:function(){A(),w(),W(),G({productId:c}).then((function(){return B({header:"Successfully canceled subscription",text:"You are now on Community plan"})})).catch((function(){return _({header:"Failed to cancel the subscription",text:"Remained on ".concat(O," plan")})})).finally((function(){W(),w()}))},onClose:function(){N(),Z({})}}),$&&r.createElement(q,{title:O,onClose:function(){N(),J()},prices:a,currentPlan:m,showProrations:Y},r.createElement(ra,{slug:t,prices:a,currentPlan:m,title:O,inModal:!0}))))},ia=function(e){var t=e.plans,n=e.freePlanId,a=e.isSmall,l=e.currentPlan,o=e.showAllPlans,c=e.showTeaserDetails;return r.createElement(d.Flex,{column:!0,gap:2,flex:!0},r.createElement(d.Flex,{column:a},r.createElement(ca,{slug:"pro",prices:t.pro,freePlanId:n,isActive:"pro"===l.slug,isSmall:a,currentPlan:l,showAllPlans:o,showTeaserDetails:c}),r.createElement(Xn,{height:a?"1px":"100%",width:a?"100%":"1px",sx:{borderWidth:a?"1px 0px 0px 0px":"0px 0px 0px 1px",borderColor:"borderSecondary",borderStyle:"solid"}}),r.createElement(ca,{slug:"business",prices:t.business,freePlanId:n,isActive:"business"===l.slug,isSmall:a,currentPlan:l,showAllPlans:o,showTeaserDetails:c})))},sa=function(e){var t=e.isSmall,n=e.plans,a=e.currentPlan,l=e.showAllPlans,o=void 0!==l&&l,c=e.showTeaserDetails,i=void 0!==c&&c,s=e.children,u="earlyBird"===a.slug,m=((null===n||void 0===n?void 0:n.free)||[]).length>0?n.free[0].id:"Community";return r.createElement(d.Flex,{column:t,justifyContent:"between"},s,(o||!u)&&r.createElement(r.Fragment,null,r.createElement(ca,{slug:"free",prices:n.free,freePlanId:m,width:t?"auto":70,isSmall:t,isActive:"free"===a.slug,currentPlan:a,showAllPlans:o}),r.createElement(Xn,{height:t?"1px":"100%",width:t?"100%":"1px",sx:{borderWidth:t?"1px 0px 0px 0px":"0px 0px 0px 1px",borderColor:"borderSecondary",borderStyle:"solid"}})),u&&r.createElement(r.Fragment,null,r.createElement(ca,{slug:"earlyBird",prices:n.earlyBird,freePlanId:m,width:t?"auto":70,isSmall:t,isActive:"earlyBird"===a.slug,currentPlan:a,showAllPlans:o}),r.createElement(Xn,{height:t?"1px":"100%",width:t?"100%":"1px",sx:{borderWidth:t?"1px 0px 0px 0px":"0px 0px 0px 1px",borderColor:"borderSecondary",borderStyle:"solid"}})),r.createElement(ia,{plans:n,freePlanId:m,isSmall:t,currentPlan:a,showAllPlans:o,showTeaserDetails:i}))},ua=["children"],ma=function(e){var t=e.children,n=(0,i.Z)(e,ua);return r.createElement(d.Flex,(0,o.Z)({alignItems:"center",gap:2},n),t)},da=function(){return r.createElement(d.Flex,{column:!0,gap:2,width:65},r.createElement(d.TextMicro,{color:"bright"},r.createElement(d.TextMicro,{color:"bright",strong:!0},"Available credit")," ","for you to use on any plan subscriptions with us."),r.createElement(d.TextMicro,{color:"bright"},"It is ok to change your mind, we will give you full flexibility! You can change the plan level, billing frequency or committed nodes, we won't hold you to any choice. When applicable, we'll credit you back on any unused amount."))},pa=function(e){var t=e.currentPlan,n=(0,Wn.SH)(),a=(0,l.Z)(n,2),o=a[0],c=a[1],i=!!t.billingEmail&&!c,s=(0,b.gI)("billing:ReadAll");return r.createElement(d.Flex,{column:!0,gap:2},r.createElement(d.H3,null,"Plan & Billing"),s&&r.createElement(r.Fragment,null,r.createElement(ma,null,r.createElement(d.Flex,{gap:1,alignItems:"center"},r.createElement(d.Text,null,"Credit:"),r.createElement(d.Text,{"data-testid":"billingHeader-credits",strong:!0},fr.format(t.balance.amount||0)),r.createElement(Ye.Z,{content:da,align:"bottom",isBasic:!0},r.createElement(d.Icon,{name:"information",width:"16px",height:"16px",color:"textLite"}))),r.createElement(Xn,null),r.createElement(d.Text,null,"Billing email:"," ",r.createElement(d.Text,{strong:!0,"data-testid":"billingHeader-email"},t.billingEmail||"-")),r.createElement(Xn,null),r.createElement(xe.Z,{Component:d.Flex,cursor:i?"pointer":"default",disabled:!i,onClick:o,alignItems:"center",gap:1,"data-ga":"billing-options::click::billing","data-testid":"billingHeader-goToPortal"},r.createElement("span",null,"Billing options and Invoices"),r.createElement(d.Icon,{name:"nav_arrow_goto",width:"12px",height:"12px"}))),r.createElement(Xn,{height:1,width:"100%",sx:{borderWidth:"1px 0px 0px 0px",borderColor:"borderSecondary",borderStyle:"solid"}})))};n(34553),n(2707),n(69810),n(86035);var ga=n(69119),fa=n(71002),Ea=n(7069),ba=n(54559),ha=n(13882),va=n(83946);var ya=n(28789),xa=n(23148),wa=n(36337),Ca=n(26495),Oa=n(95665),Pa=n(92501),Ia=n(95248),Sa=n(69019);function Ta(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 ka(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ta(Object(n),!0).forEach((function(t){(0,c.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ta(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Za={nodes:1,p90:2,committed_nodes:3},ja={"Daily count":"The weighted 90th percentile of the live node count during the day, taking time as the weight. If you have 30 live nodes throughout the day, except for a two hour peak of 44 live nodes, the daily value is 31.","Committed nodes":"The number of nodes committed to in the yearly plan. In case the period count is higher than the number of committed nodes, the difference is billed as overage.","Period count":"The 90th percentile of the daily counts for this period up to the date. The last value for the period is used as the number of nodes for the bill for that period."};xa.kL.register(xa.f$,xa.uw,xa.ZL,xa.od,xa.jn,xa.De,xa.u,xa.ST,xa.vn,wa.Z),xa.u.positioners.follow=function(e,t){return null===e||void 0===e||!e.length||t.y>360?(this._resolveAnimations().update(this,{opacity:0}),!1):(0===this.opacity&&this._resolveAnimations().update(this,{opacity:1}),{x:t.x,y:t.y})};var Fa=function(e){return{nodes:{label:"Daily count",type:"bar",color:(0,d.getColor)("text")({theme:e}),backgroundColor:(0,d.getColor)("primary")({theme:e}),borderColor:(0,d.getColor)("primary")({theme:e}),borderWidth:2,pointStyle:"rectangle",usePointStyle:!0},p90:{label:"Period count",type:"line",color:(0,d.getColor)("text")({theme:e}),borderColor:(0,d.getColor)(["purple","lilac"])({theme:e}),borderWidth:2,fill:!1,stepped:!0},committed_nodes:{label:"Committed nodes",type:"line",color:(0,d.getColor)("text")({theme:e}),borderColor:(0,d.getColor)(["blue","aquamarine"])({theme:e}),borderWidth:2,fill:!1,borderDash:[1,2],borderDashOffset:1,pointStyle:!1}}},Da={border:{side:"all",color:"inputBorder",padding:[3]},round:!0},Aa=function(){var e=new Date,t=e.getFullYear(),n=e.getMonth(),r=e.getDate(),a=new Date(0);return a.setFullYear(t,n,r-1),a.setHours(23,59,59,999),a}(),Na=(0,ga.default)(function(e,t){if((0,ha.Z)(2,arguments),!t||"object"!==(0,fa.Z)(t))return new Date(NaN);var n=t.years?(0,va.Z)(t.years):0,r=t.months?(0,va.Z)(t.months):0,a=t.weeks?(0,va.Z)(t.weeks):0,l=t.days?(0,va.Z)(t.days):0,o=t.hours?(0,va.Z)(t.hours):0,c=t.minutes?(0,va.Z)(t.minutes):0,i=t.seconds?(0,va.Z)(t.seconds):0,s=(0,ba.default)(e,r+12*n),u=(0,Ea.default)(s,l+7*a),m=1e3*(i+60*(c+60*o));return new Date(u.getTime()-m)}(Aa,{months:1})),Ma=function(e){var t=e.onNodesLastPeriodFetch,n=(0,Ia.by)("offset"),a=(0,v.th)(),o=(0,r.useState)((function(){return{start:Na,end:Aa}})),i=(0,l.Z)(o,2),s=i[0],u=i[1],p=(0,jt.Z)((function(){return{enabled:!!a&&!!s.start&&!!s.end,fetch:function(){return(0,Sa.fA)(a,{after:Math.floor((0,ya.default)((0,Qr.tb)(s.start,n))/1e3),before:Math.floor((0,ya.default)((0,Qr.tb)(s.end,n))/1e3)})},initialValue:{labels:[],data:[]},onSuccess:function(e){var n=e.data,r=e.labels;if(n.length){var a=n.at(-1),l=a[r.indexOf("nodes")],o=a[r.indexOf("timestamp")];t((function(e){return e.timestamp>o?e:{timestamp:o,value:l}}))}}}}),[a,s,t]),g=(0,l.Z)(p,3),f=g[0],E=g[1],b=g[2],h=(0,r.useContext)(m.ThemeContext),y=(0,r.useMemo)((function(){var e=f.data.map((function(e){return(0,l.Z)(e,1)[0]})),t=f.labels.reduce((function(t,n,r){return r?[ka(ka({},Fa(h)[n]),{},{data:e.map((function(e,t){return f.data[t][r]})),order:Za[n]})].concat((0,Ir.Z)(t)):t}),[]);return{labels:e,datasets:t}}),[f]),x=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.data,a=t.annotations,o=void 0===a?[]:a,i=(0,Qr.rA)().localeDateString,s=(0,r.useRef)(!1),u=(0,r.useRef)(),m=(0,r.useMemo)((function(){return{interaction:{axis:"x"},plugins:{legend:{position:"bottom",align:"start",onClick:function(e,t,n){var r=n.legendItems.findIndex((function(e){return e.text===t.text}));n.chart.isDatasetVisible(r)?n.chart.hide(r):n.chart.show(r)},labels:{generateLabels:function(e){return e.data.datasets.map((function(t,n){return{fontColor:t.color,text:t.label,fillStyle:t.backgroundColor,strokeStyle:t.borderColor,pointStyle:"Daily count"===t.label?"rect":"line",hidden:!e.isDatasetVisible(n),order:t.order}})).sort((function(e,t){return e.order-t.order}))},usePointStyle:!0},onHover:function(e,t){!s.current&&u.current&&(s.current=!0,u.current.innerHTML=ja[t.text],u.current.style.left=e.x+"px",u.current.style.top=e.y+"px",u.current.style.visibility="visible",u.current.style.transform="translateY(-100%)")},onLeave:function(){u.current&&(s.current=!1,u.current.innerHTML="",u.current.style.visibility="hidden")}},tooltip:{enabled:!0,mode:"nearest",intersect:!1,yAlign:"bottom",usePointStyle:!0,position:"follow",backgroundColor:(0,d.getColor)("panel")({theme:e}),color:(0,d.getColor)(["neutral","iron"])({theme:e}),callbacks:{title:function(e){var t=(0,l.Z)(e,1)[0];return t?i(1e3*t.label,{month:"2-digit",day:"2-digit",year:"numeric",long:!1,dateStyle:void 0}):""},labelPointStyle:function(e){return{pointStyle:"Total Nodes"===e.dataset.label?"rect":"line"}},label:function(e){return" ".concat(e.formattedValue," ").concat(e.dataset.label||"")}}},annotation:{annotations:o.reduce((function(t,r,a){return ka(ka({},t),{},(0,c.Z)({},"annotation".concat(a),{type:"line",value:n.findIndex((function(e){return e[0]===r.timestamp})),borderColor:(0,d.getRgbColor)(["blue","indigo"],.3)({theme:e}),borderDashOffset:0,borderWidth:10,drawTime:"afterDatasetsDraw",label:{drawTime:"afterDatasetsDraw",display:!1,backgroundColor:(0,d.getRgbColor)(["blue","indigo"],.8)({theme:e}),borderWidth:0,color:"white",content:r.name,textAlign:"center"},scaleID:"x",enter:function(e,t){var n=e.chart,r=n.options.plugins.annotation.annotations["annotation".concat(a)];r.label.display=!0,r.label.position=t.y/e.chart.chartArea.height>.5?"start":"end",n.update()},leave:function(e){var t=e.chart;t.options.plugins.annotation.annotations["annotation".concat(a)].label.display=!1,t.update()}}))}),{})}},responsive:!0,maintainAspectRatio:!1,scales:{x:{ticks:{callback:function(e){return i(1e3*this.getLabelForValue(e),{month:"2-digit",day:"2-digit",year:"numeric",long:!1,dateStyle:void 0})},color:(0,d.getColor)("textLite")({theme:e})}},y:{beginAtZero:!0,ticks:{color:(0,d.getColor)("textLite")({theme:e})}}}}}),[e,n]);return[m,u]}(h,f),w=(0,l.Z)(x,2),C=w[0],O=w[1];return r.createElement(d.Flex,{column:!0,gap:4},r.createElement(d.Flex,{alignItems:"center",justifyContent:"between"},r.createElement(d.H3,null,"Usage"),r.createElement(Oa.Z,{values:s,utc:n,onChange:u,tagging:"billing-usage",isPlaying:!1,onlyDates:!0,accessorProps:Da,padding:[4,0],width:"auto",maxDate:Aa})),r.createElement(d.Flex,{position:"relative",height:90},E?r.createElement(an.Z,{title:"Loading billing data..."}):b?r.createElement(Pa.NY,{title:"Chart couldn't be loaded"}):r.createElement(Ca.kL,{type:"bar",data:y,options:C}),r.createElement(d.Flex,{ref:O,background:"panel",color:["neutral","iron"],position:"absolute",round:!0,padding:[3],width:{max:75},sx:{visibility:"hidden"},onMouseOver:function(){return O.current.style.visibility="hidden"}})))},La=function(e){var t=e.isSmall,n=e.currentPlan,a=e.loaded,o=e.currentLoaded,c=e.plans,i=((null===c||void 0===c?void 0:c.free)||[]).length>0?c.free[0].id:"Community",s=(0,r.useState)({timestamp:null,value:null}),u=(0,l.Z)(s,2),m=u[0],d=u[1];return r.createElement(r.Fragment,null,r.createElement(pa,{currentPlan:n}),a&&o?r.createElement(r.Fragment,null,Jn(n.slug)?r.createElement(sa,{isSmall:t,plans:c,currentPlan:n,showTeaserDetails:!0}):r.createElement(ca,{slug:n.slug,prices:c[n.slug],freePlanId:i,width:t?"auto":120,padding:[0],height:"auto",isSmall:t,isActive:!0,currentPlan:n,allPlansView:!0,nodesLastPeriod:m.value}),r.createElement(Xn,{height:1,width:"100%",sx:{borderWidth:"1px 0px 0px 0px",borderColor:"borderSecondary",borderStyle:"solid"}}),r.createElement(Ma,{onNodesLastPeriodFetch:d})):r.createElement(an.Z,{title:a?"Loading billing info...":"Loading Netdata plans..."}))},Ra=n(92432),Ba={year:"Yearly",month:"Monthly"},_a=function(e){var t,n=e.plans,a=e.currentPlan,o=(0,v.uk)(),c=qn(),i=Kn(),s=(0,Wn.SH)(),u=(0,l.Z)(s,2),m=u[0],p=u[1],g=!!a.billingEmail&&!p,f=(0,y.Z)(),E=(0,l.Z)(f,2),h=E[0],x=E[1],w=(0,y.Z)(),C=(0,l.Z)(w,2),O=C[0],P=C[1],I=(0,ve.Z)(),S=(0,l.Z)(I,2),T=S[0],k=S[1],Z=(0,Wn.Zn)(),j=(Mr.Vc[a.slug]||Mr.Vc.free).title,F=((null===n||void 0===n?void 0:n.free)||[]).length>0?n.free[0].id:"Community",D=(0,b.gI)("billing:Manage"),A=(0,b.gI)("billing:ReadAll"),N=(Mr.Vc[null===a||void 0===a?void 0:a.slug]||Mr.Vc.free).title,M=Ba[null===a||void 0===a?void 0:a.interval];return r.createElement(d.Flex,{column:!0,gap:2},r.createElement(d.Flex,{gap:2,alignItems:"center"},r.createElement(xe.Z,{as:nn.rU,to:"/spaces/".concat(o,"/settings/billing"),disabled:c,color:"text",hoverColor:"textLite",showToolTip:!0,content:"Back to Plan & Billing",align:"bottom",isBasic:!0},r.createElement(d.Icon,{name:"arrow_left",width:"20px",height:"20px",margin:[1.5,0,0]})),r.createElement(d.H3,null,"All Plans")),r.createElement(ma,null,r.createElement(d.Flex,{gap:1,alignItems:"center"},r.createElement(d.Text,null,"Active plan:"),r.createElement(d.Text,{strong:!0},N)),r.createElement(Xn,null),M&&r.createElement(r.Fragment,null,r.createElement(d.Flex,{gap:1,alignItems:"center"},r.createElement(d.Text,null,"Billing frequency:"),r.createElement(d.Text,{strong:!0},M)),r.createElement(Xn,null)),"Yearly"===M&&r.createElement(d.Flex,{gap:1,alignItems:"center"},r.createElement(d.Text,null,"Committed Nodes:"),r.createElement(d.Text,{strong:!0},(null===a||void 0===a?void 0:a.committedNodes)||0)),r.createElement(Xn,null),A&&r.createElement(r.Fragment,null,r.createElement(d.Flex,{gap:1,alignItems:"center"},r.createElement(d.Text,null,"Credit:"),r.createElement(d.Text,{strong:!0},fr.format((null===a||void 0===a||null===(t=a.balance)||void 0===t?void 0:t.amount)||0)),r.createElement(Ye.Z,{content:da,align:"bottom",isBasic:!0},r.createElement(d.Icon,{name:"information",width:"16px",height:"16px",color:"textLite"}))),r.createElement(Xn,null),r.createElement(d.Flex,{gap:1,alignItems:"center"},r.createElement(d.Text,null,"Billing email:"),r.createElement(d.Text,{strong:!0},(null===a||void 0===a?void 0:a.billingEmail)||"-")),r.createElement(Xn,null)),r.createElement(xe.Z,{Component:d.Flex,cursor:g?"pointer":"default",disabled:!g,onClick:m,alignItems:"center",gap:1},r.createElement("span",null,"Billing options and Invoices"),r.createElement(d.Icon,{name:"nav_arrow_goto",width:"12px",height:"12px"})),!Jn(null===a||void 0===a?void 0:a.slug)&&r.createElement(r.Fragment,null,r.createElement(Xn,null),r.createElement(xe.Z,{Component:d.Flex,cursor:"pointer",onClick:x,alignItems:"center",gap:1,disabled:O||c||!D,"data-ga":"cancel-plan::click::billing"},r.createElement(d.Text,{textDecoration:"underline"},O||c?"Canceling plan...":"Cancel plan")))),r.createElement(Xn,{height:1,width:"100%",sx:{borderWidth:"1px 0px 0px 0px",borderColor:"borderSecondary",borderStyle:"solid"}}),h&&r.createElement(Nr,{title:"Community",onConfirm:function(){P(),i(),Z({productId:F}).then((function(){return(0,Ra.L)("billing","cancel-plan","global-view",{slug:null===a||void 0===a?void 0:a.slug,interval:null===a||void 0===a?void 0:a.interval,success:!0}),T({header:"Successfully canceled subscription",text:"You are now on Community plan"})})).catch((function(){return(0,Ra.L)("billing","cancel-plan","global-view",{slug:null===a||void 0===a?void 0:a.slug,interval:null===a||void 0===a?void 0:a.interval,success:!1}),k({header:"Failed to cancel the subscription",text:"Remained on ".concat(j," plan")})})).finally((function(){P(),i()}))},onClose:x}))},Ua=["center","end"],Va=m.default.div.withConfig({displayName:"plansDetails__Container",componentId:"sc-t6ze2m-0"})(["display:grid;",""],(function(e){return e.isEarlyBird?"grid-template-columns: 1fr 1.5fr 1.5fr 1.5fr 1.5fr;":"grid-template-columns: 1fr 1.5fr 1.5fr 1.5fr;"})),Ha=m.default.div.withConfig({displayName:"plansDetails__Header",componentId:"sc-t6ze2m-1"})(["display:contents;> *{background:",";border-bottom:1px solid ",";}"],(0,d.getColor)("panelBg"),(0,d.getColor)("separator")),Wa=(0,m.default)(d.Collapsible).withConfig({displayName:"plansDetails__Content",componentId:"sc-t6ze2m-2"})(["display:contents;"]),Ga=function(e){var t=e.center,n=e.end,a=(0,i.Z)(e,Ua);return r.createElement(d.Flex,{alignItems:"center",justifyContent:t?"center":n?"end":"start",padding:[2]},r.createElement(d.Text,a))},za=function(){return r.createElement(d.Icon,{name:"check",color:"primary"})},Ya=function(){return r.createElement(d.Icon,{name:"checkmark_partial_s",color:"textLite"})},qa=function(){return r.createElement(d.Icon,{name:"chevron_down_thin",color:"text"})},Ka=function(){return r.createElement(d.Icon,{name:"chevron_up_thin",color:"text"})},Qa=function(e){var t="earlyBird"===(e.currentPlan||{}).slug,n=(0,r.useState)((function(){return[!1,!1,!1,!1,!1]})),a=(0,l.Z)(n,2),o=a[0],c=a[1],i=function(e){return c((function(t){return t[e]=!t[e],(0,Ir.Z)(t)}))};return r.createElement(r.Fragment,null,r.createElement(Va,{isEarlyBird:t},r.createElement(Ha,{onClick:function(){return i(0)}},r.createElement(Ga,{strong:!0},"Usage Allowances"),r.createElement(Ga,null),t&&r.createElement(Ga,null),r.createElement(Ga,null),r.createElement(Ga,{end:!0},o[0]?r.createElement(Ka,null):r.createElement(qa,null))),r.createElement(Wa,{open:!o[0]},r.createElement(Ga,null,"Single Node Metrics Access Limit"),r.createElement(Ga,{center:!0},"UNLIMITED"),t&&r.createElement(Ga,{center:!0},"UNLIMITED"),r.createElement(Ga,{center:!0},"UNLIMITED"),r.createElement(Ga,{center:!0},"UNLIMITED"),r.createElement(Ga,null,"Multi-Node Infrastructure Metrics Access Limit"),r.createElement(Ga,{center:!0},"UNLIMITED"),t&&r.createElement(Ga,{center:!0},"UNLIMITED"),r.createElement(Ga,{center:!0},"UNLIMITED"),r.createElement(Ga,{center:!0},"UNLIMITED"),r.createElement(Ga,null,r.createElement(d.Text,{id:"auditing-events"},"Auditing Events"),r.createElement("br",null),r.createElement(d.TextSmall,{color:"textDescription",id:"events-related-to-actions-done-on-your-space-eg-invite-user-change-user-role-or-create-room"},"Events related to actions done on your Space, e.g. invite user, change user role or create room")),r.createElement(Ga,{center:!0},"4 hours"),t&&r.createElement(Ga,{center:!0},"4 hours"),r.createElement(Ga,{center:!0},"7 days"),r.createElement(Ga,{center:!0},"90 days"),r.createElement(Ga,null,r.createElement(d.Text,{id:"topology-events"},"Topology Events"),r.createElement("br",null),r.createElement(d.TextSmall,{color:"textDescription",id:"node-state-transition-events-eg-live-or-offline"},"Node state transition events, e.g. live or offline")),r.createElement(Ga,{center:!0},"4 hours"),t&&r.createElement(Ga,{center:!0},"4 hours"),r.createElement(Ga,{center:!0},"7 days"),r.createElement(Ga,{center:!0},"14 days"),r.createElement(Ga,null,r.createElement(d.Text,{id:"alert-events"},"Alert Events"),r.createElement("br",null),r.createElement(d.TextSmall,{color:"textDescription",id:"alert-state-transition-events-can-be-seen-as-an-alert-history-log"},"Alert state transition events, can be seen as an alert history log")),r.createElement(Ga,{center:!0},"4 hours"),t&&r.createElement(Ga,{center:!0},"4 hours"),r.createElement(Ga,{center:!0},"7 days"),r.createElement(Ga,{center:!0},"60 days"),r.createElement(Ga,null,"Globally Administered Alerts Notifications Integrations"),r.createElement(Ga,{center:!0},"Email and Discord"),t&&r.createElement(Ga,{center:!0},"Email and Discord"),r.createElement(Ga,{center:!0},"Email, Discord and Webhook"),r.createElement(Ga,{center:!0},"UNLIMITED"))),r.createElement(Va,{isEarlyBird:t},r.createElement(Ha,{onClick:function(){return i(1)}},r.createElement(Ga,{strong:!0},"User Administration"),r.createElement(Ga,null),t&&r.createElement(Ga,null),r.createElement(Ga,null),r.createElement(Ga,{end:!0},o[1]?r.createElement(Ka,null):r.createElement(qa,null))),r.createElement(Wa,{open:!o[1]},r.createElement(Ga,null,"Role Based Access"),r.createElement(Ga,{center:!0},"Basic"),t&&r.createElement(Ga,{center:!0},"Basic"),r.createElement(Ga,{center:!0},"Basic"),r.createElement(Ga,{center:!0},"Advanced"),r.createElement(Ga,null,r.createElement(d.Text,{id:"administrators"},"Administrators"),r.createElement("br",null),r.createElement(d.TextSmall,{color:"textDescription",id:"administrators-have-unrestricted-access-to-a-space"},"Administrators have unrestricted access to a space")),r.createElement(Ga,{center:!0},r.createElement(za,null)),t&&r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,null,r.createElement(d.Text,{id:"managers"},"Managers"),r.createElement("br",null),r.createElement(d.TextSmall,{color:"textDescription",id:"same-as-admins-but-unable-to-add-nodes-or-manage-the-space-settings"},"Same as admins, but unable to add nodes, or manage the space settings")),r.createElement(Ga,{center:!0},r.createElement(Ya,null)),t&&r.createElement(Ga,{center:!0},r.createElement(Ya,null)),r.createElement(Ga,{center:!0},r.createElement(Ya,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,null,r.createElement(d.Text,{id:"troubleshooters"},"Troubleshooters"),r.createElement("br",null),r.createElement(d.TextSmall,{color:"textDescription",id:"same-as-managers-but-unable-to-manage-users-or-rooms"},"Same as managers, but unable to manage users or rooms")),r.createElement(Ga,{center:!0},r.createElement(Ya,null)),t&&r.createElement(Ga,{center:!0},r.createElement(Ya,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,null,r.createElement(d.Text,{id:"observers"},"Observers"),r.createElement("br",null),r.createElement(d.TextSmall,{color:"textDescription",id:"read-only-role-restricted-to-specific-rooms"},"Read only role, restricted to specific rooms")),r.createElement(Ga,{center:!0},r.createElement(Ya,null)),t&&r.createElement(Ga,{center:!0},r.createElement(Ya,null)),r.createElement(Ga,{center:!0},r.createElement(Ya,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,null,r.createElement(d.Text,{id:"billing"},"Billing"),r.createElement("br",null),r.createElement(d.TextSmall,{color:"textDescription",id:"access-to-billing-details-and-subscription-management"},"Access to billing details and subscription management")),r.createElement(Ga,{center:!0},r.createElement(Ya,null)),t&&r.createElement(Ga,{center:!0},r.createElement(Ya,null)),r.createElement(Ga,{center:!0},r.createElement(Ya,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),t&&r.createElement(r.Fragment,null,r.createElement(Ga,null,r.createElement(d.Text,{id:"billing"},"Member"),r.createElement("br",null),r.createElement(d.TextSmall,{color:"textDescription",id:"access-to-billing-details-and-subscription-management"},"This role allows users to manage rooms and invite fellow Member teammates. These users cannot see all rooms in the Space but can see all Nodes since they are always on the All Nodes.")),r.createElement(Ga,{center:!0},r.createElement(Ya,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(Ya,null)),r.createElement(Ga,{center:!0},r.createElement(Ya,null))))),r.createElement(Va,{isEarlyBird:t},r.createElement(Ha,{onClick:function(){return i(2)}},r.createElement(Ga,{strong:!0},"Support"),r.createElement(Ga,null),t&&r.createElement(Ga,null),r.createElement(Ga,null),r.createElement(Ga,{end:!0},o[2]?r.createElement(Ka,null):r.createElement(qa,null))),r.createElement(Wa,{open:!o[2]},r.createElement(Ga,null,"Service Availability"),r.createElement(Ga,{center:!0,textAlign:"center"},"Best Effort (99.5% in last 12 months)"),t&&r.createElement(Ga,{center:!0,textAlign:"center"},"Best Effort (99.5% in last 12 months)"),r.createElement(Ga,{center:!0,textAlign:"center"},"Best Effort (99.5% in last 12 months)"),r.createElement(Ga,{center:!0,textAlign:"center"},"99.9% annually (excl. scheduled maintenance)"),r.createElement(Ga,null,"Technical Support"),r.createElement(Ga,{center:!0,textAlign:"center"},"Public Forums, Tickets & Chat"),t&&r.createElement(Ga,{center:!0,textAlign:"center"},"Public Forums, Tickets & Chat"),r.createElement(Ga,{center:!0,textAlign:"center"},"Public Forums, Tickets & Chat"),r.createElement(Ga,{center:!0,textAlign:"center"},"Public Forums, Tickets & Chat"),r.createElement(Ga,null,"Initial Deployment Consulting Services"),r.createElement(Ga,{center:!0,textAlign:"center"},"Public Forums, Tickets & Chat"),t&&r.createElement(Ga,{center:!0,textAlign:"center"},"Public Forums, Tickets & Chat"),r.createElement(Ga,{center:!0,textAlign:"center"},"Public Forums, Tickets & Chat"),r.createElement(Ga,{center:!0,textAlign:"center"},"Remote Consultation Available upon Request"),r.createElement(Ga,null,"Alerts Digest"),r.createElement(Ga,{center:!0},"Limited"),t&&r.createElement(Ga,{center:!0},"Limited"),r.createElement(Ga,{center:!0},"Limited"),r.createElement(Ga,{center:!0},"Unlimited"))),r.createElement(Va,{isEarlyBird:t},r.createElement(Ha,{onClick:function(){return i(3)}},r.createElement(Ga,{strong:!0},"Advanced features"),r.createElement(Ga,null),t&&r.createElement(Ga,null),r.createElement(Ga,null),r.createElement(Ga,{end:!0},o[3]?r.createElement(Ka,null):r.createElement(qa,null))),r.createElement(Wa,{open:!o[3]},r.createElement(Ga,null,"Custom Dashboards - incl. Grafana"),r.createElement(Ga,{center:!0},r.createElement(za,null)),t&&r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,null,"Nodes secured for access via Netdata only"),r.createElement(Ga,{center:!0},r.createElement(za,null)),t&&r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,null,"Secure Worldwide Remote Access to Dashboards"),r.createElement(Ga,{center:!0},r.createElement(za,null)),t&&r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,null,"Unlimited Service Level room Views"),r.createElement(Ga,{center:!0},r.createElement(za,null)),t&&r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,null,"Centrally Dispatched Alerts Notifications"),r.createElement(Ga,{center:!0},r.createElement(za,null)),t&&r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,null,"Infrastructure and Service Level Nodes Views"),r.createElement(Ga,{center:!0},r.createElement(za,null)),t&&r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,null,"Infrastructure and Service Level Alerts Views"),r.createElement(Ga,{center:!0},r.createElement(za,null)),t&&r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,null,"Infrastructure and Service Level Charts and Dashboards"),r.createElement(Ga,{center:!0},r.createElement(za,null)),t&&r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,null,"Infinite Horizontal Scalability"),r.createElement(Ga,{center:!0},r.createElement(za,null)),t&&r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,null,"Machine Learning and Anomaly Advisor for All Metrics"),r.createElement(Ga,{center:!0},r.createElement(za,null)),t&&r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,null,"Advanced Troubleshooting with Metric Correlations"),r.createElement(Ga,{center:!0},r.createElement(za,null)),t&&r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,null,"Microservices Monitoring - incl. Kubernetes"),r.createElement(Ga,{center:!0},r.createElement(za,null)),t&&r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)))),r.createElement(Va,{isEarlyBird:t},r.createElement(Ha,{onClick:function(){return i(4)}},r.createElement(Ga,{strong:!0},"Basic features"),r.createElement(Ga,null),t&&r.createElement(Ga,null),r.createElement(Ga,null),r.createElement(Ga,{end:!0},o[4]?r.createElement(Ka,null):r.createElement(qa,null))),r.createElement(Wa,{open:!o[4]},r.createElement(Ga,null,"Unlimited Nodes"),r.createElement(Ga,{center:!0},r.createElement(za,null)),t&&r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,null,"Unlimited Containers"),r.createElement(Ga,{center:!0},r.createElement(za,null)),t&&r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,null,"Unlimited Users"),r.createElement(Ga,{center:!0},r.createElement(za,null)),t&&r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,null,"Unlimited High Resolution Metrics"),r.createElement(Ga,{center:!0},r.createElement(za,null)),t&&r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,null,"Unlimited High Resolution Custom Metrics"),r.createElement(Ga,{center:!0},r.createElement(za,null)),t&&r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,null,"Unlimited Metrics Retention"),r.createElement(Ga,{center:!0},r.createElement(za,null)),t&&r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,null,"1s granularity + 100ms Latency for All Metrics"),r.createElement(Ga,{center:!0},r.createElement(za,null)),t&&r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,null,"800+ Integrations with Data Stores, Servers, and more"),r.createElement(Ga,{center:!0},r.createElement(za,null)),t&&r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,null,"Metrics Extration from web logs"),r.createElement(Ga,{center:!0},r.createElement(za,null)),t&&r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,null,"Zero Configuration Setup"),r.createElement(Ga,{center:!0},r.createElement(za,null)),t&&r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,null,"Auto-Detection of Metrics"),r.createElement(Ga,{center:!0},r.createElement(za,null)),t&&r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,null,"Pre-configured and out-of-the-box Alerts"),r.createElement(Ga,{center:!0},r.createElement(za,null)),t&&r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,null,"Unlimited Synthetic Checks"),r.createElement(Ga,{center:!0},r.createElement(za,null)),t&&r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,null,"Auto generated Dashboards for All Metrics"),r.createElement(Ga,{center:!0},r.createElement(za,null)),t&&r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,null,"Metrics data exclusively stored On Premise"),r.createElement(Ga,{center:!0},r.createElement(za,null)),t&&r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,null,"Popular Alerts Notifications"),r.createElement(Ga,{center:!0},r.createElement(za,null)),t&&r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,null,"Open Data Exporters - Prometheus, Graphite, InfluxDB, and more"),r.createElement(Ga,{center:!0},r.createElement(za,null)),t&&r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)),r.createElement(Ga,{center:!0},r.createElement(za,null)))))},Xa=function(e){var t=e.plans,n=e.loaded,a=e.currentLoaded,l=e.currentPlan;return r.createElement(d.Flex,{column:!0,height:"calc(100% - 30px)",gap:3},r.createElement(_a,{plans:t,currentPlan:l}),n&&a?r.createElement(d.Flex,{column:!0,gap:5},r.createElement(sa,{plans:t,currentPlan:l,showAllPlans:!0},r.createElement(d.Flex,{column:!0,height:50,width:40,justifyContent:"center"},r.createElement(d.Text,{strong:!0},"Pricing"))),r.createElement(Qa,{currentPlan:l})):r.createElement(an.Z,{title:n?"Loading billing info...":"Loading Netdata plans..."}))},$a={Community:0,Pro:1,Business:2},Ja={month:"Monthly",year:"Yearly"},el=function(e){var t=e.from,n=e.to,r=e.fromNodes,a=e.toNodes,l=e.interval,o=e.success,c=void 0===o||o,i=Ja[l]||l;if(t===n&&r===a)return{header:c?"Successful billing cycle change":"Failed to update billing cycle",text:c?"Subscription billing cycle changed to ".concat(i):"Subscription is still on ".concat(i," billing cycle")};if(t===n)return{header:c?"Successful change of commitment":"Failed to change the commitment",text:c?"Commitment ".concat(r<a?"increased":"decreased"," from ").concat(r," to ").concat(a," nodes"):"Commitment remained the same, ".concat(r," nodes")};var s=$a[t]>$a[n];return{header:c?"Successfully ".concat(s?"downgraded":"upgraded"," plan"):"Failed to ".concat(s?"downgrade":"upgrade"," plan"),text:c?"Subsrciprion ".concat(s?"downgraded":"upgraded"," from ").concat(t," to ").concat(n," plan (").concat(i,")"):"Remained on ".concat(t," plan")}},tl=function(){!function(){var e=(0,nn.lr)(),t=(0,l.Z)(e,2),n=t[0],a=t[1],o=(0,ve.Z)(),c=(0,l.Z)(o,2),i=c[0],s=c[1];(0,r.useEffect)((function(){var e=n.get("from"),t=n.get("from_committed_nodes"),r=n.get("interval"),l=n.get("result"),o=n.get("to"),c=n.get("to_committed_nodes");switch(l){case"success":var u={from:e,fromNodes:t,interval:r,to:o,toNodes:c,success:!0};i(el(u)),(0,Ra.L)("billing","callback","global-view",u);break;case"failure":var m={from:e,fromNodes:t,interval:r,to:o,toNodes:c,success:!1};s(el(m)),(0,Ra.L)("billing","callback","global-view",m)}l&&a("")}),[n])}();var e=(0,Wn.Gl)(),t=e.loaded,n=e.value,o=(0,Wn.RP)(),c=o.loaded,i=o.value,s=(0,Hn.m)();return r.createElement(d.Flex,{column:!0,height:"calc(100% - 30px)",gap:3},r.createElement(Yn,null,r.createElement(a.Z5,null,r.createElement(a.AW,{path:"/all-plans",element:r.createElement(Xa,{isSmall:s,currentPlan:i,loaded:t,currentLoaded:c,plans:n})}),r.createElement(a.AW,{path:"/",element:r.createElement(La,{isSmall:s,currentPlan:i,loaded:t,currentLoaded:c,plans:n})}))))},nl=n(41898),rl=["containerProps"],al=["settingsTab"];function ll(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 ol(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ll(Object(n),!0).forEach((function(t){(0,c.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ll(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var cl=(0,s.Z)((function(){return Promise.all([n.e(502),n.e(129)]).then(n.bind(n,66129))})),il=(0,m.default)(p.G).withConfig({displayName:"manage-workspace__ColumnHeader",componentId:"sc-j9n54n-0"})(["width:180px;padding:16px;"]),sl=function(e){return function(t){return r.createElement(g.TZ,{hasFooter:!1,hasModalTitle:!1},r.createElement(e,t))}},ul=function(e){return function(t){var n=t.containerProps,a=void 0===n?{}:n,l=(0,i.Z)(t,rl),c=ol({height:"100%",padding:[4,0,0,0]},a);return r.createElement(g.TZ,(0,o.Z)({hasFooter:!1,hasModalTitle:!1},c),r.createElement(e,l))}},ml=sl(Rn),dl=sl(We),pl=sl(dt),gl=sl(it),fl=ul(xn),El=sl(tl),bl=ul(function(e){return function(t){return r.createElement(r.Suspense,{fallback:"Loading settings tab..."},r.createElement(e,t))}}(cl)),hl=(0,r.memo)((function(){var e=(0,a.s0)(),t=(0,a.TH)(),n=t.state,o=void 0===n?{}:n,c=t.pathname,s=(0,a.UO)(),m=s.settingsTab,p=(0,i.Z)(s,al),E=(0,r.useState)((null===o||void 0===o?void 0:o.previousUrlPath)||null),h=(0,l.Z)(E,1)[0],y=(0,v.OS)("name"),x=function(e){var t=W.dH.indexOf(e);return-1!==t?t:W.z2}(m),w=(0,r.useCallback)((function(t){var n=function(e,t){var n=e.split("/"),r=n.indexOf("settings")+1-n.length;return"".concat(n.slice(0,r).join("/"),"/").concat(W.dH[t]||W.z2)}(c,t);e(n)}),[m]);(0,r.useEffect)((function(){W.fV[m]||e((0,u.Gn)(c,ol(ol({},p),{},{settingsTab:W.z2})))}),[]);var C=(0,b.gI)("billing:ReadBasic"),O=(0,b.gI)("room:ReadAll"),P=(0,b.gI)("user:ReadAll"),I=(0,b.gI)("channel:ReadAll"),S=(0,k.jW)();(0,r.useEffect)((function(){C||m===W.fM&&e((0,u.Gn)(c,ol(ol({},p),{},{settingsTab:W.z2})))}),[C,m]);var T=(0,v.uk)(),Z=(0,r.useCallback)((function(){e(h||"/spaces/".concat(T))}),[h,T]);return y?r.createElement(g.oU,{"data-testid":"manageWorkspaceModal",right:!0,closeOnOverlayClick:!0,onClose:Z},r.createElement(f.x,{"data-testid":"manageWorkspaceModal-header",onClose:Z,title:r.createElement(Vn,null)}),r.createElement(d.Tabs,{row:!0,column:!1,"data-testid":"manageWorkspaceModal-tabs",selected:x,onChange:w,TabsHeader:il,tabsProps:{column:!0},height:"100%",noDefaultBorder:!0,position:"relative"},r.createElement(d.Tab,{basis:0,"data-testid":"manageWorkspaceModal-spaceTab",label:W.fV[W.m3],"data-ga":"manage-space::click-tab::space-tab",isMenuItem:!0},r.createElement(ml,{"data-testid":"manageWorkspaceModal-spaceTabContent",onClose:Z,small:!0})),r.createElement(d.Tab,{basis:0,"data-testid":"manageWorkspaceModal-warRoomsTab","data-ga":"manage-space::click-tab::rooms-tab",label:"Rooms",isMenuItem:!0},r.createElement(dl,{"data-testid":"manageWorkspaceModal-warRoomsTabContent"})),(O||S)&&r.createElement(d.Tab,{basis:0,label:"Nodes","data-testid":"manageWorkspaceModal-nodesTab","data-ga":"manage-space::click-tab::nodes-tab",isMenuItem:!0},r.createElement(pl,{"data-testid":"manageWorkspaceModal-nodesTabContent"})),P&&r.createElement(d.Tab,{basis:0,"data-testid":"manageWorkspaceModal-usersTab","data-ga":"manage-space::click-tab::users-tab",label:"Users",isMenuItem:!0},r.createElement(gl,{"data-testid":"manageWorkspaceModal-usersTabContent"})),I&&r.createElement(d.Tab,{basis:0,label:"Alerts & Notifications","data-testid":"manageWorkspaceModal-notificationsTab","data-ga":"manage-space::click-tab::notifications-tab",isMenuItem:!0},r.createElement(fl,null)),C&&!window.envSettings.onprem&&r.createElement(d.Tab,{basis:0,"data-testid":"manageWorkspaceModal-billingTab","data-ga":"manage-space::click-tab::billing-tab",label:"Plan & Billing",isMenuItem:!0},r.createElement(El,{"data-testid":"manageWorkspaceModal-billingTabContent"})),r.createElement(d.Tab,{basis:0,"data-testid":"manageWorkspaceModal-integrationsTab","data-ga":"manage-space::click-tab::integrations-tab",label:"Integrations",isMenuItem:!0},r.createElement(bl,{flavour:nl.RV.settingsPage,containerProps:{padding:[0]},"data-testid":"manageWorkspaceModal-integrationsTabContent"})))):null})),vl=function(){var e=(0,a.TH)(),t=e.pathname,n=e.state;return r.createElement(a.Z5,null,r.createElement(a.AW,{path:"/",element:r.createElement(a.Fg,{state:n,to:{pathname:"".concat(t,"/").concat(W.z2)}})}),r.createElement(a.AW,{path:":settingsTab/*",element:r.createElement(hl,null)}))}},14809:function(e,t,n){"use strict";n.d(t,{Z:function(){return O}});var r=n(87462),a=n(67294),l=n(57509),o=n(89250),c=n(13477),i=n(94666),s=n(15861),u=n(29439),m=n(64687),d=n.n(m),p=(n(57327),n(41539),n(88449),n(2490),n(59849),n(4480)),g=n(93017),f=n(274),E=n(46585),b=n(74059),h=n(57079),v=n(58502),y=n(95383),x=n(53606),w="leave-space-dialog",C="leaveSpaceDialog",O=function(e){var t=e.id,n=e.name,m=e.onClose,O=(0,o.s0)(),P=(0,c.Iy)("id"),I=(0,i.H4)(),S=(0,i.nP)(),T=(0,i.Wy)(),k=function(e){var t=(0,g.Z)(),n=(0,u.Z)(t,2)[1];return(0,p._8)((function(t){var r=t.snapshot,a=t.set,l=t.reset;return function(){var t=(0,s.Z)(d().mark((function t(o){var c,s,m,p,g,x,w,C,O;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c=o.currentUserId,s=o.onSuccess,m=o.onError,t.next=3,r.getPromise((0,b.st)("ids"));case 3:if(p=t.sent,g=p.filter((function(t){return e!==t})),x=(0,u.Z)(g,1),w=x[0]){t.next=9;break}return n({header:"Spaces",text:E.T$.leave}),t.abrupt("return");case 9:if(t.t0=w,!t.t0){t.next=14;break}return t.next=13,r.getPromise((0,v.ZP)(w));case 13:t.t0=t.sent;case 14:return C=t.t0,O=C.slug,a((0,b.st)("ids"),g),a(h.Z,(function(t){return t.filter((function(t){return t!==e}))})),t.prev=18,t.next=21,(0,f.Sz)(e,[c]);case 21:s&&s(O),(0,i.zm)(l,e),(0,y.r1)(l,e),l((0,v.ZP)(e)),t.next=31;break;case 27:t.prev=27,t.t1=t.catch(18),a((0,b.st)("ids"),p),m&&m();case 31:case"end":return t.stop()}}),t,null,[[18,27]])})));return function(e){return t.apply(this,arguments)}}()}),[e])}(t),Z=(0,x.Z)(t),j=(0,a.useCallback)((function(e){return O("/spaces/".concat(e))}),[]),F=1===I.length,D=1===S.length&&T,A=F?{confirmLabel:"Yes, leave","data-ga":"".concat(w,"-last-member"),"data-testid":"".concat(C,"LastMember"),handleConfirm:function(){return Z({onSuccess:j})},message:a.createElement(a.Fragment,null,"If you leave, space ",a.createElement("strong",null,n)," will be deleted immediately.",a.createElement("br",null),"Are you sure you want to continue?"),title:"Leave and delete ".concat(n," space")}:D?{confirmLabel:"Give rights","data-ga":"".concat(w,"-last-admin"),"data-testid":"".concat(C,"LastAdmin"),handleConfirm:function(){return O("users")},isConfirmPositive:!0,message:a.createElement(a.Fragment,null,"You are the last admin of ",a.createElement("strong",null,n)," space. Please give admin rights to another member so you can leave this space."),title:"Leave ".concat(n," space")}:{confirmLabel:"Yes, leave","data-ga":w,"data-testid":C,handleConfirm:function(){return k({currentUserId:P,onSuccess:j})},message:a.createElement(a.Fragment,null,"You are about to leave ",a.createElement("strong",null,n)," space.",a.createElement("br",null),"Are you sure you want to continue?"),title:"Leave ".concat(n," space")};return a.createElement(l.ConfirmationDialog,(0,r.Z)({handleDecline:m},A))}},73955:function(e,t,n){var r=n(79833),a=0;e.exports=function(e){var t=++a;return r(e)+t}}}]);
\ No newline at end of file |