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