summaryrefslogtreecommitdiffstats
path: root/src/web/gui/v2/8676.a3d687b3b339a72ab66e.chunk.js
blob: e9a7098073e1d1aac1b81b2a19af6935df26cc10 (plain)
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]="3dbf5f7b-ca21-4dfb-a27c-297cfd33b96e",e._sentryDebugIdIdentifier="sentry-dbid-3dbf5f7b-ca21-4dfb-a27c-297cfd33b96e")}catch(e){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"08864407160b3973b9b88c5ae92687282b21e2f4"},(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[8676],{62232:(e,t,n)=>{"use strict";n.d(t,{A:()=>g});var a=n(58168),l=(n(17333),n(41393),n(98992),n(54520),n(81454),n(8711)),r=n(68090),o=n.n(r),i=n(96540),c=n(10058);const s=(0,l.default)(c.Box).withConfig({displayName:"breadcrumbs__StyledItemContainer",componentId:"sc-3u39st-0"})([""]),m=(0,l.css)(["&:hover{color:",";}"],(e=>{let{withHover:t,theme:n}=e;return t&&(0,c.getColor)("success")({theme:n})})),d=(0,l.default)(c.Text).withConfig({displayName:"breadcrumbs__StyledText",componentId:"sc-3u39st-1"})(["",""],m),u=(0,l.default)(c.TextSmall).withConfig({displayName:"breadcrumbs__StyledTextSmall",componentId:"sc-3u39st-2"})(["",""],m),g=e=>{let{items:t,isBig:n,showBackButton:l=!0,testid:r="",...m}=e;const g=(0,i.useMemo)((()=>{if(null===t||void 0===t||!t.length||!l)return null;return o()(t.filter((e=>{let{onClick:t}=e;return!!t}))).onClick}),[t,l]);if(null===t||void 0===t||!t.length)return null;const p=n?d:u;return i.createElement(c.Flex,(0,a.A)({gap:4},m),l&&i.createElement(c.Button,{onClick:g,icon:"chevron_left",label:"Back",neutral:!0,flavour:"hollow",small:!0,padding:[0,2,0,1],textTransform:"uppercase","data-testid":"".concat(r,"-breadcrumbs-backButton")}),i.createElement(c.Flex,{gap:2,alignItems:"center"},t.map(((e,t)=>{let{isDisabled:n,name:l,onClick:o}=e;return i.createElement(s,(0,a.A)({key:t,alignItems:"center"},o&&{cursor:"pointer",onClick:o},{"data-testid":"".concat(r,"-breadcrumbs-level-").concat(t)}),i.createElement(p,{color:n&&"textLite","data-testid":"".concat(r,"-breadcrumbs-level-").concat(t),withHover:!!o},0!==t&&" / ",l))}))))}},26751:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var a=n(58168),l=n(96540),r=n(10058);const o=e=>{let{message:t,title:n,footer:o,...i}=e;const c=(null===i||void 0===i?void 0:i["data-testid"])||"functionError";return l.createElement(r.Flex,(0,a.A)({alignItems:"center",column:!0,"data-testid":c,flex:!0,gap:3,justifyContent:"center",padding:[0,20]},i),l.createElement(r.H3,{"data-testid":"".concat(c,"-title")},n),l.createElement(r.TextBig,{color:"textDescription","data-testid":"".concat(c,"-message")},t),o)}},54856:(e,t,n)=>{"use strict";n.d(t,{A:()=>m});var a=n(58168),l=n(96540),r=n(84976),o=n(10058),i=n(4659),c=n(46741),s=n(27994);const m=function(){let{containerProps:e={},...t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=(0,c.JT)("billing:ReadAll"),{url:m}=(0,s.A)();return m?l.createElement(o.Flex,(0,a.A)({background:"sideBarMini",border:{side:"all",color:"border"},padding:[1,2],round:!0},e),l.createElement(i.A,(0,a.A)({align:"bottom",as:r.N_,boxProps:{as:o.Flex},color:"text",Component:o.TextMicro,content:n?"Upgrade your plan in order to use this feature":"You have no permissions to manage billing",disabled:!n,hoverColor:"textFocus",showToolTip:!0,strong:!0,to:m},t),"Upgrade now!")):null}},54518:(e,t,n)=>{"use strict";n.d(t,{A:()=>f});var a=n(96540),l=n(58168),r=n(10058),o=n(29217);const i=e=>{let{description:t,isRequired:n,title:l,...i}=e;const c=i["data-testid"]?"".concat(i["data-testid"],"-label"):"fieldLabel";return a.createElement(r.Flex,{"data-testid":"".concat(c,"-container"),gap:1},a.createElement(r.TextSmall,{color:"textLite","data-testid":c},l,n&&" *"),t&&a.createElement(o.A,{align:"top",content:t,"data-testid":"".concat(c,"-info"),plain:!0},a.createElement(r.Icon,{color:"textLite",name:"information",size:"small"})))},c=e=>{let{"data-testid":t="input",description:n,isRequired:o,onChange:c,title:s,...m}=e;return a.createElement(r.Flex,{column:!0,"data-testid":t,flex:"grow",gap:1},a.createElement(i,{"data-testid":t,description:n,isRequired:o,title:s}),a.createElement(r.TextInput,(0,l.A)({"data-testid":"".concat(t,"-field"),size:"tiny",onChange:e=>{let{target:t}=e;return c(t.value)}},m)))};n(41393),n(81454);const s=e=>{var t;let{"data-testid":n="select",description:o,getDataGa:c,fields:s,id:m,isRequired:d,onChange:u,secrets:g,setSecrets:p,title:E,...h}=e;return a.createElement(r.Flex,{column:!0,"data-testid":n,flex:"grow",gap:1},a.createElement(i,{"data-testid":n,description:o,isRequired:d,title:E}),a.createElement(r.Select,(0,l.A)({"data-testid":"".concat(n,"-field"),menuPortalTarget:document.body,onChange:e=>u(e),styles:{size:"tiny"},menuPlacement:"auto"},h)),Object.values((null===s||void 0===s?void 0:s[null===(t=h.value)||void 0===t?void 0:t.value])||{}).map((e=>{let{getValue:t,id:r,onChange:o,...i}=e;return a.createElement(b,(0,l.A)({"data-ga":c("".concat(m,"-").concat(r,"-").concat(i.component)),"data-testid":"".concat(n,"-").concat(r),key:r,id:r,onChange:o({id:m,setSecrets:p,subsetId:r}),value:t({id:m,secrets:g,subsetId:r})},i))})))};n(14905),n(98992),n(8872),n(62953);var m=n(90179),d=n.n(m),u=n(97200),g=n.n(u),p=n(30960),E=n(63450);const h={default:()=>null,pairs:e=>{let{componentPairs:t,"data-testid":n="pairs",description:l,getDataGa:o,id:c,isRequired:s,placeholder:m,setSecrets:u,title:h}=e;const[b,v]=(0,a.useState)({});(0,a.useEffect)((()=>{const e=Object.values(b).reduce(((e,t)=>{let{key:n,value:a}=t;return n?{...e,[n]:a||""}:e}),{});u((t=>Object.keys(e).length?{...t,[c]:e}:d()(t,c)))}),[b]);return a.createElement(r.Flex,{column:!0,"data-testid":n,gap:1},a.createElement(r.Flex,{alignItems:"center",justifyContent:"between"},a.createElement(i,{"data-testid":n,description:l,isRequired:s,title:h}),t.map((e=>{const l=(0,p.$Q)(e);return a.createElement(E.ro,{"data-ga":o("".concat(c,"-").concat(l,"-add")),"data-testid":"".concat(n,"-").concat(l,"Add"),key:l,label:1===t.length?"Add":"Add ".concat(l),onClick:()=>(e=>v((t=>({...t,[g()("pair_")]:{key:"",components:e,value:""}}))))(e)})}))),Object.entries(b).map((e=>{let[t,{key:l,components:i,value:s}]=e;const[u,g]=i,E=(0,p.$Q)(i);return a.createElement(r.Flex,{alignItems:"end",key:"".concat(E,"-").concat(t),gap:2},a.createElement(f,{component:u,"data-ga":o("".concat(c,"-").concat(E,"-key")),"data-testid":"".concat(n,"-").concat(E,"Key"),onChange:e=>v((n=>({...n,[t]:{...n[t],key:e}}))),value:l,placeholder:m,title:"Key"}),a.createElement(f,{component:g,"data-ga":o("".concat(c,"-").concat(E,"-value")),"data-testid":"".concat(n,"-").concat(E,"Value"),onChange:e=>v((n=>({...n,[t]:{...n[t],value:e}}))),value:s,placeholder:m,title:"Value"}),a.createElement(r.Button,{flavour:"borderless",icon:"trashcan",margin:[0,0,1,0],neutral:!0,onClick:()=>{v((e=>d()(e,t)))}}))})))},input:c,select:s},b=e=>{let{component:t,...n}=e;const l=h[t]||h.default;return a.createElement(l,n)},f=b},63450:(e,t,n)=>{"use strict";n.d(t,{$m:()=>s,He:()=>r,Jg:()=>g,MU:()=>o,Oj:()=>m,W6:()=>c,fn:()=>d,id:()=>u,ro:()=>i});var a=n(8711),l=n(10058);const r=(0,a.default)(l.Flex).attrs({alignItems:"center",color:"text",gap:1,hoverColor:"text"}).withConfig({displayName:"styled__AnchorComponent",componentId:"sc-wc4x41-0"})(["&,&:hover{text-decoration:none;}"]),o=(0,a.default)(l.Icon).attrs({height:"130px",width:"130px"}).withConfig({displayName:"styled__BlurredIcon",componentId:"sc-wc4x41-1"})(["filter:blur(70px);position:absolute;left:0;top:0;opacity:0.5;"]),i=(0,a.default)(l.Button).attrs({height:"22px",icon:"plus",padding:[.5,2,.5,1],small:!0,width:"auto"}).withConfig({displayName:"styled__IntegrationAction",componentId:"sc-wc4x41-2"})(["&& > span{font-weight:bold;margin-left:4px;}"]),c=(0,a.default)(l.TextSmall).withConfig({displayName:"styled__LearnMoreTest",componentId:"sc-wc4x41-3"})(["position:relative;"]),s=(0,a.default)(l.ModalContent).attrs({height:{base:150,max:150,min:45},overflow:{vertical:"auto"},width:{base:121,max:140,min:70}}).withConfig({displayName:"styled__ModalContent",componentId:"sc-wc4x41-4"})(["box-shadow:0 18px 28px rgb(9 30 66 / 15%),0 0 1px rgb(9 30 66 / 31%);"]),m=(0,a.default)(l.ModalCloseButton).attrs({color:"text",height:"16px",width:"16px"}).withConfig({displayName:"styled__ModalClose",componentId:"sc-wc4x41-5"})(["&:hover{fill:",";}"],(0,l.getColor)("selected")),d=(0,a.default)(l.Flex).attrs((e=>{let{hasBorder:t,...n}=e;return{...t?{border:{side:"bottom",color:"disabled"}}:{},column:!0,padding:[3,4],...n}})).withConfig({displayName:"styled__ModalSection",componentId:"sc-wc4x41-6"})([""]),u=(0,a.default)(l.Icon).attrs({name:"warning_triangle",height:"18px",width:"18px",color:["yellow","amber"]}).withConfig({displayName:"styled__WarningIcon",componentId:"sc-wc4x41-7"})(["position:absolute;top:0;right:0;z-index:1;"]),g=(0,a.default)(l.Icon).attrs({height:"12px",width:"12px",color:"white"}).withConfig({displayName:"styled__SystemIcon",componentId:"sc-wc4x41-8"})(["position:relative;top:2px;"])},99904:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});n(62953);var a=n(96540),l=n(3914),r=n(25624);var o=n(87659);const i=e=>{const t=new Date(e||void 0).toDateString();return"Invalid Date"!==t?t:null},c=()=>{var e;const t=(0,l.ap)(),n=(0,a.useMemo)((()=>"".concat("dismissedBumpedWarningKey","_").concat(null===t||void 0===t?void 0:t.id)),[null===t||void 0===t?void 0:t.id]),[c,,,s]=(0,o.A)(!localStorage.getItem(n)),{trialEndsAtRaw:m}=(0,r.A)(),d="EarlybirdAndCommunitySunset"==(null===t||void 0===t||null===(e=t.metadata)||void 0===e?void 0:e.joinTrialCode),u=c&&m&&d,g=d?"EARLYB25":null,p=(0,a.useCallback)((()=>{localStorage.setItem(n,!0),s()}),[s,n]);return{isModalVisible:u,isEarlybirdAndCommunitySunset:d,coupon:g,trialEndsAt:i(m),onClose:p}}},34641:(e,t,n)=>{"use strict";n.d(t,{A:()=>E});n(9391),n(62953);var a=n(96540),l=n(63950),r=n.n(l),o=n(10058),i=n(19673),c=n(71835),s=n(92155),m=n(50876),d=n(63314),u=n(87659),g=n(97118);const p=(0,s.A)(o.Button),E=e=>{let{onConfirm:t,onDecline:n=r(),onCancellingEnd:l=r()}=e;const s=(0,i.M4)(),[E,h]=(0,c.A)(),{id:b}=(0,g.A)(),{sendLog:f,isReady:v}=(0,m.A)(),[x,,y,C]=(0,u.A)(),w=(0,a.useCallback)((()=>{y(),s({productId:b}).then((()=>{E({header:"Successfully canceled subscription",text:"You are now on Community plan"}),f({feature:"TrialOptOut",isSuccess:!0})})).catch((()=>{h({header:"Failed to cancel the subscription",text:"Remained on Business plan"}),f({feature:"TrialOptOut",isFailure:!0,error:"Failed to cancel the subscription"})})).finally((()=>{l(),C()}))}),[b,v]),A=(0,a.useCallback)((()=>{t?t():w()}),[t,w]);return a.createElement(o.Modal,{backdropProps:{backdropBlur:!0}},a.createElement(d.Ay,{feature:"TrialOptOut"},a.createElement(o.ModalContent,{width:{base:140}},a.createElement(o.ModalHeader,null,a.createElement(o.Flex,{gap:2,alignItems:"center"},a.createElement(o.H4,null,"Go to Community plan"))),a.createElement(o.ModalBody,null,x?a.createElement(o.Flex,{height:"100px"},a.createElement(o.TextBig,null,"Changing billing plan...")):a.createElement(o.Flex,{gap:2,column:!0},a.createElement(o.H3,null,"Are You Sure?"),a.createElement(o.TextBig,null,"It looks like you have chosen to opt-out of your free 30-day business trial. Are you sure you do not want to experience all the features Netdata has to offer?"),a.createElement(o.TextBig,null,"By opting out, you will switch to the community plan immediately."))),a.createElement(o.ModalFooter,null,a.createElement(o.Flex,{justifyContent:"end",gap:4,padding:[1,2]},a.createElement(p,{feature:"TrialOptOut",label:"Yes, I am sure!",flavour:"hollow",small:!0,onClick:A,disabled:!b||x,textTransform:""}),a.createElement(p,{feature:"TrialOptOut",label:"No, I want the trial!",small:!0,onClick:n,disabled:x,textTransform:""}))))))}},35454:(e,t,n)=>{"use strict";n.d(t,{$B:()=>o,TB:()=>i,W1:()=>l,ml:()=>r,ue:()=>a});const a={default:"successSemi",warning:"warningSemi",critical:"errorSemi"},l={default:{background:"successSemi",border:"success"},warning:{background:"warningSemi",border:"warning"},critical:{background:"errorSemi",border:"error"}},r=[30,15,3,2,1],o="dismissedTrialWelcome",i="dismissedTrialWarningDate"},93476:(e,t,n)=>{"use strict";n.d(t,{A:()=>g});var a=n(58168),l=n(96540),r=n(10058),o=n(63950),i=n.n(o),c=n(25624),s=n(99904),m=n(24864);const d={banner:{color:"main"},sidebar:{lineHeight:"1.6",color:"main"},freePlanUpgrade:{lineHeight:"1.6",color:"main"},billing:{color:"textLite"}},u=e=>{let{canUpgrade:t,onUpdateClick:n=i(),children:o,...c}=e;return t?l.createElement(r.Box,(0,a.A)({"data-testid":"upgrade-to-business-banner",onClick:n,as:r.Text,cursor:"pointer",textDecoration:"underline",color:"main"},c),o):null},g=e=>{let{flavour:t,couponRemainingDays:n,onUpdateClick:o=i()}=e;const{daysRemaining:g,canUpgrade:p,trialEndsAt:E}=(0,c.A)(),{isEarlybirdAndCommunitySunset:h}=(0,s.A)(),b=(0,l.useMemo)((()=>({isCoupon:n>0,isEarlybirdAndCommunitySunset:h,isBanner:"banner"==t,isSidebar:"sidebar"==t,isBilling:"billing"==t,isFreePlanUpgrade:"freePlanUpgrade"==t})),[t,n]);return l.createElement(r.Flex,{justifyContent:b.isBilling?"start":"center",alignItems:"center",width:"100%",gap:2},b.isCoupon?l.createElement(r.Flex,{column:!0},l.createElement(r.Text,(0,a.A)({},d[t],{fontSize:"10px",strong:!0}),"POST BLACK FRIDAY OFFER"),l.createElement(m.Te,(0,a.A)({},d[t],{fontSize:"38px",lineHeight:.8,strong:!0}),"50% off")):b.isEarlybirdAndCommunitySunset?l.createElement(r.Flex,{column:!0,gap:1,alignItems:"center"},l.createElement(r.Text,(0,a.A)({},d[t],{textAlign:"center",strong:!0},b.isBanner?{}:{fontSize:"10px"}),"Thank you for your support!"," ",b.isBanner?l.createElement(u,{canUpgrade:p,onUpdateClick:o},"Upgrade"):null),l.createElement(r.Text,(0,a.A)({},d[t],{color:"primary",fontSize:"22px",lineHeight:.8,strong:!0}),"25% Lifetime off")):b.isFreePlanUpgrade?l.createElement(r.Text,d[t],"Upgrade your plan for unlimited access and Business features."):l.createElement(r.Text,d[t],"You have ",l.createElement(r.Text,(0,a.A)({strong:!0},d[t]),"".concat(g," days"))," ","left to explore all the features of Netdata Business."," ",b.isBilling&&l.createElement(l.Fragment,null,"Trial ends at"," ",l.createElement(r.Text,(0,a.A)({strong:!0},d[t]),E),"."," "),b.isBanner?l.createElement(u,{canUpgrade:p,onUpdateClick:o},"Consider upgrading for unlimited access."):l.createElement(l.Fragment,null,"Consider upgrading for unlimited access.")))}},24864:(e,t,n)=>{"use strict";n.d(t,{PL:()=>i,Te:()=>c,bg:()=>o});var a=n(8711),l=n(10058),r=n(35454);const o=(0,a.default)(l.Flex).attrs({position:"relative"}).withConfig({displayName:"styled__TrialWarningSidebar",componentId:"sc-66x250-0"})(["background-color:",";border-width:1px;border-style:dashed;border-color:",";border-radius:2px;"],(e=>{var t;let{type:n}=e;return(0,l.getColor)(null===(t=r.W1[n])||void 0===t?void 0:t.background)}),(e=>{var t;let{type:n}=e;return(0,l.getColor)(null===(t=r.W1[n])||void 0===t?void 0:t.border)})),i=(0,a.default)(l.Button).withConfig({displayName:"styled__TrialUpgradeButton",componentId:"sc-66x250-1"})(["flex:auto;"]),c=(0,a.default)(l.Text).attrs({strong:!0,lineHeight:.8}).withConfig({displayName:"styled__PromoText",componentId:"sc-66x250-2"})(["background-color:",";background-image:linear-gradient( 43deg,"," 0%,"," 46%,"," 100% );-webkit-background-clip:text;-webkit-text-fill-color:transparent;"],(0,l.getColor)("primary"),(0,l.getColor)(["blue","aquamarine"]),(0,l.getColor)(["purple","mauve"]),(0,l.getColor)("primary"))},66732:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var a=n(96540),l=n(63950),r=n.n(l),o=n(10058),i=n(50876);const c={default:"Or you can opt to downgrade immediately",billing:"Or you can opt to downgrade immediately"},s=e=>{let{flavour:t="default",onOptOutClick:n=r(),...l}=e;const{sendLog:s,isReady:m}=(0,i.A)(),d=(0,a.useCallback)((()=>{n(),s({feature:"TrialOptOut",isStart:!0})}),[m]);return a.createElement(o.Text,l,"After the trial, you'll automatically switch to the free Community plan."," ",a.createElement(o.Box,{"data-testid":"upgrade-to-business-banner",onClick:d,as:o.Text,cursor:"pointer",textDecoration:"underline",color:"primary"},c[t]),".")}},25624:(e,t,n)=>{"use strict";n.d(t,{A:()=>E});n(62953);var a=n(96540),l=n(46741),r=n(5668),o=n(22292),i=(n(8159),n(98992),n(37550),n(16074)),c=n(6593);var s=n(19673),m=n(50503),d=n(35454),u=n(42728),g=n(93155);const p=e=>{const t=new Date(e||void 0).toLocaleDateString();return"Invalid Date"!==t?t:null},E=()=>{const{loaded:e,value:t,refresh:n}=(0,s.JN)(),{isFailure:E}=(0,m.A)(),{slug:h,trialEndsAt:b}=t||{},f=(0,a.useMemo)((()=>(e=>{if(!e)return null;const t=new Date(e)-new Date;return Math.ceil(t/864e5)})(b)),[b]),v=e&&!!b,x=(0,l.JT)("billing:Manage"),[y]=(0,r.ng)("trialModalDismissed"),C=g.bO&&x&&(v||E)&&!localStorage.getItem(d.$B)&&!y,[w,A]=(0,a.useState)(localStorage.getItem(d.TB)),T=(0,a.useMemo)((()=>g.bO&&v),[v]),[S,I]=(0,a.useState)(),k=(F=f)>15?"default":F>5?"warning":"critical";var F;const P=!(0,o.uW)("isAnonymous")&&x;return(0,a.useEffect)((()=>{const e=((e,t,n,a)=>{if(t<0)return!1;const l=new Date(e||void 0);if(!(0,i.f)(l))return!1;const r=new Date(a||void 0);if(!(0,i.f)(r))return!0;const{days:o}=(0,c.F)({start:r,end:l}),s=o;return n.some((e=>e>=t&&e<s))})(b,f,d.ml,w);I(g.bO&&e)}),[b,f,w]),{trialWelcomeVisible:C,sidebarWarningVisible:T,bannerVisible:S,dismissBanner:()=>{const e=(new Date).toISOString();A(e),localStorage.setItem(d.TB,e)},daysRemaining:f,trialEndsAt:p(b),trialEndsAtRaw:b,type:k,canUpgrade:P,onTrial:v,refreshPlan:n,planIsFreeOrEarlyBird:(0,u.Kj)(h)}}},97118:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});var a=n(19673),l=n(42728);const r=()=>{var e;const{value:t}=(0,a.lU)();if(null===t||void 0===t||!t.free)return{};const n=Object.keys(t.free).sort(l.M7)[0];return{id:t.free[n]?null===(e=t.free[n][0])||void 0===e?void 0:e.id:null,version:n}}},78676:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>Gl});var a=n(96540),l=n(47767),r=n(58168),o=(n(62953),n(39225)),i=n(45588),c=n(8711),s=n(10058),m=n(57375),d=n(15327),u=n(74618),g=n(79412),p=(n(41393),n(81454),n(46741)),E=n(14994),h=n(3914),b=n(87659),f=n(46440),v=n(33195);const x=[{id:"name",accessor:"name",header:"Name",cell:e=>{let{getValue:t,row:{original:{isMember:n}}}=e;const l=t(),r=(0,p.JT)("room:ReadAll");return a.createElement(s.Flex,{alignItems:"center"},r&&n&&a.createElement(f.A,{margin:[0,1,0,0]}),a.createElement(s.Text,{margin:r&&!n&&[0,0,0,4]},l))}},{id:"nodeCount",accessor:"nodeCount",header:"Nodes",cell:e=>{let{getValue:t}=e;return"".concat(t()||0)}},{id:"memberCount",accessor:"memberCount",header:()=>"Users",cell:e=>{let{getValue:t}=e;return"".concat(t()||0)}},{id:"silencing",accessorKey:"silencingState",header:"Silencing",cell:e=>{let{getValue:t}=e;return a.createElement(v.A,{flavour:"room",silencing:t()})}}];n(17333),n(9920),n(98992),n(54520),n(3949);var y=n(47444),C=n(24198),w=n(63129),A=n(69765),T=n(54308),S=n(56820);const I=e=>(0,y.Zs)((t=>{let{snapshot:n,set:a,reset:l}=t;return async function(t){let{onSuccess:r,onFail:o}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=await n.getPromise((0,E.$e)({id:e,key:"ids"})),c=t.map((e=>{let{id:t}=e;return t})),s=i.filter((e=>!c.includes(e)));a((0,E.$e)({id:e,key:"ids"}),s);const m=await Promise.all(s.map((e=>n.getPromise((0,A.LS)({id:e})))));try{if(await(async(e,t)=>Promise.all(t.map((t=>(0,w.HN)(e,t)))))(e,c),a(T.yz,(0,S.Pb)(m)),c.forEach((t=>a((0,E.Oy)(e),t))),t.forEach((t=>{let{id:n,slug:a}=t;l((0,A.LS)({id:n})),l((0,T.x4)([e,a]))})),r&&r(),t.length>1)(0,C.r0)("Rooms were successfully deleted from Space!");else{const[e]=t;(0,C.r0)("Room ".concat(e.name," was successfully deleted!"))}}catch(d){a((0,E.$e)({id:e,key:"ids"}),i),o&&o(d)}}}),[e]);var k=n(74564);const F=e=>{let{spaceId:t,spaceName:n,startIsCreating:r}=e;const o=I(t),i=(0,p.JT)("space:Delete"),c=(0,p.JT)("room:Create"),s=(e,t)=>{if(!e)return;const n=Array.isArray(e)?e.map((e=>{let{id:t,name:n}=e;return{id:t,name:n}})):[{id:e.id,name:e.name}];o(n,{onSuccess:t.resetRowSelection})},m=(e,t)=>{const n=t.length;if(!n)return"";return 1===n?(0,k.kI)(t[0].name):(0,k.kI)(n)},d=(e,t)=>{const l=t.length;if(!l)return"";const r={...1===l?{name:t[0].name}:{roomsLength:l},spaceName:n};return a.createElement(k.rj,r)},{pathname:u}=(0,l.zy)(),g=(0,h.bq)(),E=(0,l.Zp)(),b=(0,a.useCallback)((e=>E("".concat(u,"/").concat(e))),[u,E]),f=(0,a.useMemo)((()=>({goto:{handleAction:e=>{let{slug:t}=e;return b(t)},icon:"chevron_right",tooltipText:"Room settings"},addRule:{handleAction:e=>{const t={roomId:e.id};E("/spaces/".concat(g,"/settings/notifications#notificationsActiveTab=1&silencingRulePrefill=").concat(JSON.stringify(t)))},icon:"alarm_off",flavour:"hollow",neutral:!1,tooltipText:"Add new silencing rule",confirmation:!1},delete:{confirmLabel:"Yes, delete",confirmationMessage:e=>a.createElement(k.rj,{name:e.name,spaceName:n}),confirmationTitle:e=>(0,k.TU)(e.name),dataGa:e=>{let{slug:t}=e;return"manage-rooms::click-delete::".concat(t)},declineLabel:"Cancel",handleAction:s,isDisabled:e=>{let{untouchable:t}=e;return t||!i},tooltipText:"Delete room"}})),[i,b]);return{bulkActions:(0,a.useMemo)((()=>({addEntry:{dataGa:"manage-rooms::click::add-room",handleAction:r,isDisabled:!c,tooltipText:"Create room"},delete:{confirmationMessage:d,confirmationTitle:m,confirmLabel:"Yes, delete",dataGa:"manage-rooms::delete-bulk",declineLabel:"Cancel",handleAction:s,isDisabled:!i,tooltipText:"Delete rooms"}})),[c,i,d,m]),rowActions:f,onClickRow:b}},P=()=>{const e=(0,E.DL)(),t=(0,p.JT)("room:Delete"),n=e.map((e=>({...e,disabled:e.untouchable||!t}))),[l,r]=(0,a.useState)(""),o=(0,h.ap)("name"),i=(0,h.ap)("id"),[c,,s,m]=(0,b.A)(),[,d]=(0,a.useState)([]),{bulkActions:u,rowActions:g}=F({startIsCreating:s,spaceId:i,spaceName:o});return{roomList:n,globalFilter:l,spaceName:o,spaceId:i,isCreating:c,rowActions:g,bulkActions:u,columns:x,startIsCreating:s,stopIsCreating:m,setGlobalFilter:r,onRowSelected:d,dataGa:"manage-rooms"}};var M=n(63314);const D=e=>{const{roomList:t,spaceName:n,isCreating:l,columns:o,setGlobalFilter:i,stopIsCreating:c,onRowSelected:m,rowActions:d,bulkActions:u,dataGa:p}=P();return a.createElement(M.Ay,{tab:"Rooms"},a.createElement(s.Flex,(0,r.A)({column:!0,height:"100%",overflow:"hidden",gap:3},e),a.createElement(s.H3,null,"Rooms of ",n),a.createElement(s.Table,{onSearch:i,onRowSelected:m,enableSorting:!0,dataColumns:o,enableSelection:!0,data:t,bulkActions:u,rowActions:d,dataGa:p,testPrefixCallback:e=>e.name})),l&&a.createElement(g.n,{onClose:c}))};var N=n(67031),B=n(87860),R=n(29662),L=n(84280),_=n(86663),U=n(67990),O=n(47762);const V=()=>{const e=(0,U.CK)();return{nodes:(0,O.Gt)(e).map((e=>({...e,disabled:e.hasAccessibleData})))||[],nodeIds:e}};var H=n(60383);const W=(0,a.memo)((e=>{let{roomUntouchable:t,...n}=e;const{nodes:l,nodeIds:o}=V({roomUntouchable:t});return a.createElement(M.Ay,{tab:"Room::Nodes"},a.createElement(s.Flex,(0,r.A)({column:!0,height:"100%",overflow:"hidden",gap:3},n),a.createElement(s.H3,null,"Nodes in this room (",o.length,") "),a.createElement(H.A,{showClaimNodeOnEmptySpace:!0,enableSelection:!0,customNodes:l,roomUntouchable:t})))}));var j=n(45765),Y=n(46902),q=n(83488),z=n.n(q),J=n(66245),G=n.n(J),K=n(55463),Z=n(70716),$=n(96083);const Q=[{id:"user",accessorKey:"user",header:"Name",cell:e=>{let{cell:t}=e;const{avatarURL:n,name:l}=t.row.original;return a.createElement(s.Flex,{alignItems:"center",gap:2},a.createElement($.A,{src:n,title:l}),a.createElement(s.TextSmall,null,l))}},{id:"email",accessorKey:"email",header:"Email",cell:e=>{let{getValue:t}=e;return a.createElement(s.TextSmall,null,t())}}],X=[{id:"user",desc:!1}],ee=e=>{let{setSelected:t}=e;const n=(0,K.Gi)(),l=(0,Y.lb)(),r=(0,a.useMemo)((()=>G()(n,l)),[n,l]),o=(0,a.useCallback)((e=>{t(e.map((e=>e.id)))}),[]),i=(0,Z.Uv)(r);return a.createElement(s.Flex,{alignItems:"start",padding:[1],overflow:{horizontal:"hidden",vertical:"auto"}},a.createElement(s.Table,{dataColumns:Q,data:i,autoResetSelectedRows:!0,sortableBy:X,onSearch:z(),onRowSelected:o,enableSelection:!0,enableSorting:!0}))};var te=n(92155);const ne=(0,te.A)(s.Button),ae=e=>{let{onAdd:t,onClose:n,selected:l,error:r,name:o}=e;return a.createElement(s.Flex,{alignItems:"center",justifyContent:"between"},r?a.createElement(s.Text,{color:"error"},"Select at least 1 user to add to ",o):a.createElement("div",null),a.createElement(s.Flex,{gap:2},a.createElement(s.Button,{neutral:!0,flavour:"hollow",onClick:n,label:"Cancel"}),a.createElement(ne,{disabled:!l.length,label:"Add ".concat(l.length," members"),onClick:t})))};var le=n(27287),re=n(84707),oe=n(49032),ie=n(77181),ce=n(13871),se=n(78217),me=n(71835),de=n(69756),ue=n(4659),ge=n(36850);const pe=e=>{let{email:t}=e;return(0,oe.B9)(t)},Ee={header:"Invitations",text:"Invitations successfully sent!"},he=e=>{const{id:t,slug:n}=(0,h.ap)(),l=(0,A.ID)(),o=(0,A.wz)(l,"name"),[i,c]=(0,a.useState)([]),[,,m,d]=(0,ie.g)(t),[,u]=(0,me.A)(),[g,E]=(0,a.useState)(),[b,f]=(0,a.useState)(),v=e=>{const{header:t,text:n}=e||Ee,a=(0,ce.UI)({header:t,text:n,success:!0});se.A.success(a,{context:"manageInvitations"}),c([]),E(Math.random())},x=(0,a.useCallback)((()=>{const e=i.filter(pe).map((e=>({email:e.email,name:e.name,role:b,roomIDs:[l]}))),t="".concat(window.location.origin,"/spaces/").concat(n,"/join-space");m(e,t,{onSuccess:v,onError:u})}),[i,l,b]),y=(0,p._s)();return a.createElement(s.Flex,(0,r.A)({column:!0},e),a.createElement(s.H4,null,"Send invitations to ",o," room"),a.createElement(le.BZ,null,"TIP: You can send more invitations at once, separate each with a comma."),a.createElement(re.y,{key:g,invitations:i,setInvitations:c}),a.createElement(s.H5,{margin:[4,0,0]},"Role"),a.createElement(le.BZ,null,"Choose a role for invited user."," ",a.createElement(ue.A,{href:ge.S,target:"_blank",rel:"noopener noreferrer",Component:s.TextSmall},"Learn more")),a.createElement(de.A,{availableRoles:y,dataGA:"invite-to-room",dataTestId:"invite-selectRole",onChange:e=>{f(e.target.value)},value:b}),a.createElement(s.Box,{alignSelf:"end",margin:[4,0,0]},a.createElement(s.Button,{label:"Send",onClick:x,disabled:0===i.length||!b,flavour:"hollow",isLoading:d})))},be=e=>{let{onClose:t,room:n}=e;const[l,r]=(0,a.useState)([]),[o,i]=(0,a.useState)(!1),c=(0,Y.n)(n.spaceId,n.id),m=(0,a.useCallback)((()=>{if(!l.length)return i(!0);i(!1),c(l),t()}),[l,c]);return a.createElement(d.GO,{onClose:t},a.createElement(u.z,{onClose:t,isSubmodal:!0,title:a.createElement(a.Fragment,null,"Manage room",a.createElement(s.TextBig,{color:"textLite"},"\xa0/ Add Users"))}),a.createElement(j.U,null,"Add users to room\xa0",n.name),a.createElement(d.Yv,null,a.createElement(he,{margin:[0,0,4]}),a.createElement(s.Flex,{column:!0,flex:!0,overflow:"hidden",padding:[0,0,2,0]},a.createElement(ee,{setSelected:r})),a.createElement(ae,{onClose:t,onAdd:m,selected:l,error:o,name:n.name})))};var fe=n(97245),ve=n(22292);const xe=e=>"Remove ".concat(e),ye=e=>{let{name:t,usersLength:n}=e;return n?1===n&&t?xe(t):"Remove ".concat(a=n," ").concat(1===a?"user":"users"):"";var a},Ce=e=>{let{name:t,roomName:n}=e;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?")},we=e=>{let{roomName:t,usersLength:n}=e;const l="".concat(n,1===n?" user":" users");return a.createElement(a.Fragment,null,"You are about to remove ",a.createElement("strong",null,l)," from room ",a.createElement("strong",null,t),".",a.createElement("br",null),"Are you sure you want to continue?")},Ae=e=>{let{name:t,roomName:n,usersLength:l}=e;return l?1===l&&t?a.createElement(Ce,{name:t,roomName:n}):a.createElement(we,{roomName:n,usersLength:l}):""};var Te=n(50876);const Se=e=>{let{spaceId:t,roomId:n,startIsInviting:l,canRemoveUser:r,untouchable:o}=e;const i=(0,Y.zC)(t,n),c=(0,A.XA)("name"),{sendButtonClickedLog:s,isReady:m}=(0,Te.A)(),d=e=>{if(!e)return;const t=Array.isArray(e)?e.map((e=>{let{user:t}=e;return t.id})):[null===e||void 0===e?void 0:e.user.id];i(t)},u=(0,a.useCallback)((()=>{l(),m&&s({label:"Invite users"},!0)}),[m,s]);return{rowActions:(0,a.useMemo)((()=>({remove:{confirmLabel:"Yes, remove",confirmationMessage:e=>a.createElement(Ce,{name:e.name,roomName:c}),confirmationTitle:e=>xe(e.name),declineLabel:"Cancel",disabledTooltipText:e=>o?"It's not allowed to remove users from this room. Try removing them from the space.":e.isSelf?"You cannot remove yourself. Click the leave button on the room tab.":r?"Remove is disabled":"You don't have the required permissions to remove users from this room",handleAction:d,isDisabled:e=>e.disabled,tooltipText:"Remove user from room"}})),[xe,d,Ce,c]),bulkActions:(0,a.useMemo)((()=>({addEntry:{handleAction:u,tooltipText:"Invite users"},remove:{confirmLabel:"Yes, remove",confirmationMessage:(e,t)=>a.createElement(Ae,{name:t[0].name,roomName:c,usersLength:t.length}),confirmationTitle:(e,t)=>ye({name:t[0].name,usersLength:t.length}),declineLabel:"Cancel",disabledTooltipText:e=>o?"It's not allowed to remove users from this room. Try removing them from the space.":e.length?r?"Remove is disabled":"You don't have the required permissions to remove users from this room":"You haven't selected any users",handleAction:d,tooltipText:"Remove users from room"}})),[d,Ae,c,l,ye])}},Ie=e=>{let{untouchable:t}=e;const n=(0,a.useMemo)((()=>[{id:"name",accessor:"name",header:"Name",cell:e=>{let{getValue:t}=e;return"".concat(t())}},{id:"user",accessor:"user",header:"Users",cell:e=>{let{getValue:t}=e;const{name:n,avatarURL:l,email:r}=t();return a.createElement(s.Flex,{alignItems:"center",gap:2},a.createElement($.A,{src:l,title:"".concat(n," - ").concat(r||"email not set")}),a.createElement(s.TextSmall,null,n))}},{id:"email",accessor:"email",header:"Email",width:300,align:"center",cell:e=>{let{getValue:t}=e;return a.createElement(s.TextSmall,null,t())}}]),[]),l=(0,Y.di)(),r=(0,ve.uW)("id"),o=(0,p.JT)("space:RemoveUser"),[i,c]=(0,a.useState)([]),[m,d]=(0,a.useState)(""),[u,,g,E]=(0,b.A)(),f=(0,h.ap)("id"),v=(0,A.ID)(),{rowActions:x,bulkActions:y}=Se({selectedRows:i,spaceId:f,roomId:v,startIsInviting:g,canRemoveUser:o,untouchable:t});return{columns:n,data:(0,a.useMemo)((()=>(0,fe.L)({data:l,currentUserId:r,canRemoveUser:o,untouchable:t})),[l]),columnVisibility:{name:!1},members:l,rowActions:x,bulkActions:y,isInviting:u,globalFilter:m,stopIsInviting:E,onRowSelected:c,setGlobalFilter:d,canRemoveUser:o}},ke=e=>{let{room:t,...n}=e;const{untouchable:l}=t,{columns:o,data:i,columnVisibility:c,members:m,rowActions:d,bulkActions:u,isInviting:g,stopIsInviting:p,onRowSelected:E,setGlobalFilter:h,canRemoveUser:b}=Ie({untouchable:l});return a.createElement(M.Ay,{tab:"Room::User"},a.createElement(s.Flex,(0,r.A)({column:!0,height:"100%",overflow:"hidden",gap:3},n),a.createElement(s.H3,null,"Users in this room (",m.length,")"),a.createElement(s.Table,{enableSelection:!0,enableSorting:!0,columnVisibility:c,data:i,dataColumns:o,rowActions:d,bulkActions:u,onRowSelected:E,onSearch:h,testPrefixCallback:e=>e.name}),g&&a.createElement(be,{onClose:p,room:t})))},Fe={room:0,nodes:1,users:2},Pe=(0,c.default)(s.Box).attrs({height:"100%",padding:[4,0],flex:"1",overflow:"hidden"}).withConfig({displayName:"manageRoomModal__TabContent",componentId:"sc-lrxs0y-0"})([""]),Me=()=>{const e=(0,l.Zp)(),t=(0,h.vt)(),{roomSlug:n,spaceSlug:r,settingsTab:o}=(0,l.g)(),c=(0,A.J_)(t,n);(0,B.A)({spaceId:t,id:c,polling:!1}),(0,R.A)(t,c);const m=(0,p.JT)("room:ReadUsers"),d=(0,A.wz)(c),[u,g]=(0,a.useState)(d.name),{search:E}=(0,l.zy)(),{tab:b="room"}=_.parse(E),f=Fe[b],[v,x]=(0,a.useState)(f),[y,C,w]=(0,s.useInputValue)({maxChars:255,value:d.description}),T=(0,a.useCallback)((()=>{e((0,i.tW)(L.bq,{spaceSlug:r,settingsTab:o}))}),[r,o]),S=(0,A.a8)(d.id,{shouldPersist:!0,onSuccess:T}),I=(0,a.useCallback)((()=>S({name:u,description:y})),[u,y,S]);return a.createElement(s.Flex,{column:!0,justifyContent:"between",overflow:"hidden","data-testid":"manageRoom",flex:"1",height:"100%"},a.createElement(s.Tabs,{"data-testid":"manageRoom-tabs",selected:v,onChange:x,TabContent:Pe,height:"100%",position:"relative",overflow:"hidden",width:"100%"},a.createElement(s.Tab,{"data-testid":"manageRoom-roomTab",label:a.createElement(s.H5,null,"Room")},a.createElement(N.U,{roomName:u,setRoomName:g,roomDescription:y,setRoomDescription:C,charsDescIndicator:w,"data-testid":"manageRoom-roomTabContent",id:d.id,navigateToParent:T,onSaveClick:I})),a.createElement(s.Tab,{"data-testid":"manageRoom-nodesTab",label:a.createElement(s.H5,null,"Nodes")},a.createElement(W,{roomUntouchable:d.untouchable,"data-testid":"manageRoom-nodesTabContent"})),m&&a.createElement(s.Tab,{"data-testid":"manageRoom-usersTab",label:a.createElement(s.H5,null,"Users")},a.createElement(ke,{"data-testid":"manageRoom-usersTabContent",room:d}))),v===Fe.room&&a.createElement(s.Flex,{justifyContent:"end"}))};var De=n(97054);const Ne=e=>{let{children:t}=e;return(0,De.TP)(),t},Be=e=>{let{children:t}=e;return(0,A.XA)().loaded?t:null},Re=()=>a.createElement(l.BV,null,a.createElement(l.qh,{path:"/",element:a.createElement(D,null)}),a.createElement(l.qh,{path:":roomSlug",element:a.createElement(Ne,null,a.createElement(Be,null,a.createElement(Me,null)))}));var Le=n(6323),_e=n(80158),Ue=n(29217);const Oe=[{id:"name",accessor:"name",header:"Name",cell:e=>{let{getValue:t}=e;return"".concat(t())}},{id:"user",accessor:"user",width:300,header:"Users",cell:e=>{let{getValue:t}=e;const{name:n,avatarURL:l,email:r}=t();return a.createElement(s.Flex,{alignItems:"center",gap:2},a.createElement($.A,{src:l,title:"".concat(n," - ").concat(r||"email not set")}),a.createElement(s.TextSmall,null,n))}},{id:"email",accessor:"email",header:"Email",width:300,align:"center",cell:e=>{let{getValue:t}=e;return a.createElement(s.TextSmall,null,t())}},{id:"type",accessor:"type",header:"Role",width:100,align:"center",cell:e=>{let{getValue:t,row:{original:{user:{deactivated:n}}}}=e;return a.createElement(s.Flex,{alignItems:"center",gap:1},a.createElement(s.TextSmall,{strong:!0},(0,_e.Zr)(t())),n&&a.createElement(Ue.A,{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(s.Icon,{name:"warning_triangle",height:"18px",width:"18px",color:["yellow","amber"]})))}}];n(14905),n(8872);var Ve=n(54702),He=n(12800),We=n(5169),je=n(66294);const Ye=e=>{const t=(0,We.t)();return(0,y.Zs)((n=>{let{snapshot:a,set:l}=n;return async function(n){let{onSuccess:r,onError:o}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=await a.getPromise((0,K.kd)({id:e,key:"ids"})),c=i.filter((e=>!e.includes(n)));l((0,K.kd)({id:e,key:"ids"}),c);try{await(0,Ve.XY)(e,n),(async e=>{let{cacheKeyPrefix:t,memberIds:n,spaceId:a}=e;const l="".concat(t).concat((0,je.$)(a));await(0,He.y)({key:l,handleResults:e=>e.results.filter((e=>!n.includes(e.id)))})})({cacheKeyPrefix:t,spaceId:e,memberIds:n}),r&&r()}catch(s){l((0,K.kd)({id:e,key:"ids"}),i),o&&o()}}}),[e])},qe=e=>(0,y.Zs)((t=>{let{snapshot:n,set:a}=t;return async function(t,l){let{onSuccess:r,onError:o}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=await n.getPromise((0,Z.Z6)(t)),c=await Promise.all(t.map((async t=>({mId:t,role:await n.getPromise((0,K.K2)({id:t,spaceId:e}))})))),{role:s,...m}=l;t.forEach((e=>{a((0,Z.m)({id:e}),(e=>({...e,...m})))})),s&&t.forEach((t=>{a((0,K.K2)({id:t,spaceId:e}),s)}));try{await(async(e,t,n)=>Promise.all(t.map((async t=>await(0,Ve.w5)(e,t,n)))))(e,t,l),r&&r()}catch(d){i.forEach((e=>{let{id:t,...n}=e;return a((0,Z.m)({id:t}),{id:t,...n})})),s&&c.forEach((t=>{let{mId:n,role:l}=t;return a((0,K.K2)({id:n,spaceId:e}),l)})),o&&o()}}}),[e]),ze="change-user-role",Je="changeUserRole",Ge=e=>{let{handleAction:t,ids:n,onClose:l}=e;const r=(0,K.$D)(n),o=1===r.length?r[0]:null,i=(0,p._s)(),[c,m]=(0,a.useState)(o);return a.createElement(s.ConfirmationDialog,{confirmLabel:"Save","data-ga":ze,"data-testid":Je,handleConfirm:()=>{t(c),l()},handleDecline:l,isConfirmDisabled:!c,isConfirmPositive:!0,message:a.createElement(s.Flex,{gap:2,column:!0},a.createElement(s.TextSmall,null,"Learn more about Netdata role-based access model on"," ",a.createElement(ue.A,{href:ge.S,target:"_blank",rel:"noopener noreferrer",Component:s.TextSmall},"our documentation")),a.createElement(de.A,{availableRoles:i,dataGA:ze,dataTestId:Je,onChange:e=>{m(e.target.value)},value:c})),title:"Change roles"})};var Ke=n(29848);const Ze=e=>{let{spaceId:t,startIsInviting:n}=e;const l=Ye(t),o=qe(t),i=(0,p.JT)("space:InviteUser"),c=(0,Ke.ly)(),s=(0,a.useCallback)((e=>{let{role:t,members:n}=e;o(n,{role:t},{onSuccess:c})}),[]),m=e=>t=>{if(!e)return;const n=Array.isArray(e)?e.map((e=>{let{user:t}=e;return t.id})):[null===e||void 0===e?void 0:e.user.id];s({role:t,members:n})},d=(e,t)=>{if(!e)return;const n=Array.isArray(e)?e.map((e=>{let{user:t}=e;return t.id})):[null===e||void 0===e?void 0:e.user.id];l(n,{onSuccess:t.resetRowSelection})},u=(0,a.useCallback)((e=>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?")),[]),g=(0,a.useCallback)(((e,t)=>{const n=t.length;return n?1===n?"Delete User":"Delete Users":""}),[]),E=(0,a.useCallback)(((e,t)=>{const 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)((()=>({userSettings:{CustomUIAction:e=>{let{data:t,...n}=e;return a.createElement(Ge,(0,r.A)({ids:[t.user.id]},n))},handleAction:m,tooltipText:"Change Role",isDisabled:e=>e.disabled,disabledTooltipText:e=>e.isSelf?"You cannot change your role":"You don't have the required permissions to change roles for users"},delete:{handleAction:d,confirmationTitle:"Delete User",confirmationMessage:u,isDisabled:e=>e.disabled,disabledTooltipText:e=>e.isSelf?"You cannot delete yourself. Try the space info tab, to leave space.":"You don't have the required permissions to remove users from space"}})),[]),bulkActions:(0,a.useMemo)((()=>({addEntry:{handleAction:n,tooltipText:"Invite user",isDisabled:()=>!i,disabledTooltipText:"You don't have the required permissions to invite new users"},userSettings:{CustomUIAction:e=>{let{data:t,...n}=e;return a.createElement(Ge,(0,r.A)({ids:t.map((e=>{let{user:t}=e;return t.id}))},n))},handleAction:m,tooltipText:"Change Roles",disabledTooltipText:e=>null!==e&&void 0!==e&&e.length?"You don't have the required permissions to change roles for users":"You haven't selected any users"},delete:{handleAction:d,confirmationTitle:g,confirmationMessage:E,disabledTooltipText:e=>null!==e&&void 0!==e&&e.length?"You don't have the required permissions to remove users from space":"You haven't selected any users"}})),[i,g,E])}},$e=()=>{const e=(0,h.vt)(),t=(0,h.ns)(e,"name"),n=(0,K.bj)(),l=(0,ve.uW)("id"),[r,,o,i]=(0,b.A)(),[c,s]=(0,a.useState)(""),[m,d]=(0,a.useState)([]),{rowActions:u,bulkActions:g}=Ze({selectedRows:m,spaceId:e,startIsInviting:o}),E=(0,p.JT)("space:RemoveUser"),f=(0,p.JT)("user:ChangeRoles"),v=(0,p.Ge)(),x=E||f,y=(0,a.useMemo)((()=>(e=>{let{fromRolePermissions:t,userList:n,canModifyUser:a,currentUserId:l}=e;return n.reduce(((e,n)=>{const r=l===(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||r,isSelf:r,canModifyUser:a,canSetRole:o}),e}),[])})({userList:n,currentUserId:l,canModifyUser:x,fromRolePermissions:v})),[n]);return{columns:Oe,spaceName:t,members:n,currentUserId:l,data:y,isInviting:r,globalFilter:c,rowActions:u,bulkActions:g,columnVisibility:{name:!1},onRowSelected:d,setGlobalFilter:s,startIsInviting:o,stopIsInviting:i,canModifyUser:x}},Qe=e=>{const{columns:t,spaceName:n,data:l,isInviting:o,rowActions:i,bulkActions:c,columnVisibility:m,stopIsInviting:d,setGlobalFilter:u,onRowSelected:g}=$e();return a.createElement(M.Ay,{tab:"Users"},a.createElement(s.Flex,(0,r.A)({column:!0,height:"100%",overflow:"hidden"},e),a.createElement(s.H3,null,"Members of ",n),a.createElement(s.TextSmall,{margin:[1,0,3]},"Learn more about Netdata role-based access model on"," ",a.createElement(ue.A,{href:ge.S,target:"_blank",rel:"noopener noreferrer",Component:s.TextSmall},"our documentation")),a.createElement(s.Table,{onSearch:u,data:l,dataColumns:t,enableSorting:!0,enableSelection:!0,onRowSelected:g,bulkActions:c,rowActions:i,columnVisibility:m,testPrefixCallback:e=>e.name})),o&&a.createElement(Le.d,{onClose:d,isSubmodal:!0}))};var Xe=n(63502),et=n(47193);const tt=(0,a.memo)((e=>{const t=(0,h.vt)(),n=(0,h.ap)("name"),{nodes:l}=(0,et.A)();(0,Xe.A)(t);const o="Connect Nodes to ".concat(n);return a.createElement(M.Ay,{tab:"Nodes"},a.createElement(s.Flex,(0,r.A)({column:!0,"data-testid":"manageClaimedNodes",height:"100%",overflow:"hidden",gap:3},e),a.createElement(s.H3,{"data-testid":"manageClaimedNodes-header"},o),a.createElement(H.A,{showClaimNodeOnEmptySpace:!0,showClaimModalWithRoomSelection:!0,enableSelection:!0,customNodes:l,isSpace:!0})))})),nt=tt;var at=n(54961),lt=n(26770),rt=n(71856);const ot=e=>{let{name:t,spaceName:n}=e;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?")};var it=n(30960),ct=(n(8159),n(37550),n(63450));const st=e=>{let{integration:t={},testId:n,...l}=e;const o=l.checked?"disable":"enable";return a.createElement(s.Toggle,(0,r.A)({colored:!0,"data-testid":"".concat(n,"-toggle"),"data-ga":"manage-channels::toggle-".concat(t.slug,"-").concat(o,"::notifications-tab")},l))},mt=e=>{let{testId:t,tooltipContent:n="plan",...l}=e;return l.disabled?a.createElement(Ue.A,{align:"top",content:rt.r7[n],"data-testid":"".concat(t,"-warning"),plain:!0},a.createElement(s.Flex,{padding:[2,2,0,0],position:"relative"},a.createElement(ct.id,{"data-testid":"".concat(t,"-warningIcon")}),a.createElement(st,(0,r.A)({testId:t},l)))):a.createElement(st,(0,r.A)({testId:t},l))},dt=e=>{let{"data-testid":t="cellName",enabled:n,id:l,integration:o,isAvailable:i,name:c,spaceId:m,tooltipContent:d,...u}=e;const g=(0,lt.t5)(m,"channels"),p=(0,lt.vq)(m,"channels");return a.createElement(s.Flex,(0,r.A)({alignItems:"center","data-testid":t,gap:4},u),a.createElement(mt,{checked:n,disabled:!i,integration:o,onChange:e=>{let{target:t}=e;const n=t.checked;p(g.map((e=>e.id===l?{...e,enabled:n}:e))),(0,at.Jq)(m,l,n)},testId:t,tooltipContent:d}),a.createElement(s.Text,{"data-testid":"".concat(t,"-label")},c))},ut=e=>{var t;let{"data-testid":n="cellService",integration:l={},kindLabel:o,...i}=e;const c=rt.a$[l.slug]||{};return a.createElement(s.Flex,(0,r.A)({alignItems:"center","data-testid":n,gap:2,justifyContent:"between",width:"100%"},i),a.createElement(s.Flex,{alignItems:"center","data-testid":"".concat(n,"-integration"),gap:2},a.createElement(s.Icon,(0,r.A)({"data-testid":"".concat(n,"-icon")},c)),a.createElement(s.Text,{"data-testid":"".concat(n,"-label")},l.title)),a.createElement(Ue.A,{content:o,"data-testid":"".concat(n,"-kind"),plain:!0},a.createElement(s.Icon,{color:"textLite",height:"16px",name:null===(t=rt.HA[l.kind])||void 0===t?void 0:t.icon,width:"16px"})))},gt=e=>{let{canManageChannels:t,roomOptions:n,spaceId:l}=e;return[{accessor:"name",cell:e=>{let{getValue:n,row:r}=e;return a.createElement(dt,{enabled:r.original.enabled,id:r.original.id,integration:r.original.integration,isAvailable:t&&r.original.available,name:n(),spaceId:l,tooltipContent:t?"plan":"role"})},header:"Name",id:"name"},{accessor:"integration",cell:e=>{let{getValue:t,row:n}=e;return a.createElement(ut,{integration:t(),kindLabel:n.original.kindLabel})},enableColumnFilter:!0,filterFn:(e,t,n)=>{const a=e.original.integration;return n.length<1||n.some((e=>{let{value:t}=e;return""===t||t===(null===a||void 0===a?void 0:a.slug)}))},header:"Service",id:"integration",meta:{filter:{component:"select",isMulti:!0,options:Object.keys(rt.a$).map((e=>({label:e,value:e}))),tiny:!0,"data-ga":"manage-integrations::select-service::notification-integrations-tab"},tooltip:a.createElement(s.Flex,{column:!0,width:{max:"200px"},gap:2},a.createElement(s.TextMicro,null,"Services are distinguished in two categories."),a.createElement(s.TextMicro,null,a.createElement(ct.Jg,{name:rt.HA.PERSONAL.icon})," ",a.createElement(s.TextMicro,{strong:!0},"Personal:")," ",rt.HA.PERSONAL.tooltip),a.createElement(s.TextMicro,null,a.createElement(ct.Jg,{name:rt.HA.SYSTEM.icon})," ",a.createElement(s.TextMicro,{strong:!0},"System:")," ",rt.HA.SYSTEM.tooltip))}},{accessor:"notificationLabel",cell:e=>{let{getValue:t}=e;return a.createElement(s.Text,{"data-testid":"channelNotificationsCell"},t())},enableColumnFilter:!0,filterFn:(e,t,n)=>{const a=e.original.notificationLabel;return n.length<1||n.some((e=>{let{label:t}=e;return""===t||t===a}))},header:"Notifications",id:"notificationLabel",meta:{filter:{component:"select",isMulti:!0,options:Object.values(rt.w8),tiny:!0,"data-ga":"manage-integrations::select-notification::notification-integrations-tab"}}},{accessor:"rooms",cell:e=>{var t;let{getValue:l,row:r}=e;const o={"data-testid":"channelRoomsCell"};if(r.original.internal)return a.createElement(s.Text,o,rt.Oh.label);if(!(r.original.rooms||null!==(t=r.original.rooms)&&void 0!==t&&t.length))return a.createElement(s.Text,o,rt.PT.label);const i=(0,it.Pl)({roomIds:l(),roomOptions:n});return a.createElement(s.Text,{"data-testid":"channelRoomsCell"},i)},enableColumnFilter:!0,filterFn:(e,t,n)=>n.length<1||n.some((t=>{let{label:n,value:a}=t;if(e.original.internal)return n===rt.Oh.label;const l=e.original.rooms||[];return l.length?l.includes(a):n===rt.PT.label})),header:"Rooms",id:"rooms",meta:{filter:{component:"select",isMulti:!0,options:n,tiny:!0,"data-ga":"manage-integrations::select-room::notification-integrations-tab"}}}]};var pt=n(58159),Et=n(18061),ht=n(88982);const bt=(e,t)=>{const n=(0,lt.ef)(t),a=(0,ht.A)({all:!0});(0,Et.A)((()=>({enabled:!!t,fetch:()=>(0,at.t9)(e,t),onFail:e=>n({...pt.V,error:e.message}),onSettle:()=>n({loading:!1,loaded:!0}),onSuccess:e=>n({...pt.V,...e.rooms?{roomSelections:a.filter((t=>{let{value:n}=t;return e.rooms.includes(n)}))}:{},...e})})),[e,t])};var ft=n(79769);const vt=["MobileApp","Email"],xt=()=>{const e=(0,l.Zp)(),t=(0,p.JT)("channel:Manage"),n=(0,h.vt)(),r=(0,h.ap)("name"),o=(0,h.bq)(),[c,s]=(0,me.A)(),[m,d]=(0,a.useState)(""),u=(0,lt.bY)();(0,ft.A)(n);const g=(0,lt.t5)(n,"channels"),E=(0,lt.t5)(n,"currentChannelId"),b=(0,lt.vq)(n,"channels"),f=(0,lt.vq)(n,"currentChannelId"),v=(0,ht.A)({all:!0,internal:!0}),{alerts:x,name:y,rooms:C,secrets:w}=(0,lt.g4)(E);bt(n,E);const A=(0,a.useCallback)((e=>{f(e)}),[]),T=(0,a.useCallback)((async e=>{let{id:t}=e;try{await(0,at.Wb)(n,t),b(g.filter((e=>e.id!==t))),c({header:"Configuration deleted successfully!"})}catch(a){s(a)}}),[g,n]),S=(0,a.useCallback)((()=>{e((0,i.tW)(L.uX,{spaceSlug:o,settingsTab:L.A8,settingsSubTab:L.G0}))}),[o]),I=(0,a.useMemo)((()=>({addEntry:{dataGa:"manage-channels::click-add-channel::notifications-tab",flavour:"hollow",handleAction:S,iconColor:"success",label:t?"Add Configuration":"View configurations",small:!0,strong:!0,width:"auto",...t?{}:{icon:""}}})),[t,S]),k=(0,a.useCallback)((e=>{e&&u({id:e})}),[u]),F=(0,a.useMemo)((()=>({testNotification:{handleAction:e=>{let{id:t}=e;k(t)},icon:"notificationTrigger",confirmation:!1,tooltipText:"Test your notification settings",disabledTooltipText:"You cannot test this notification",isDisabled:e=>{let{slug:t}=e;return vt.includes(t)}},edit:{dataGa:e=>{let{integration:t={}}=e;return"manage-rooms::click-edit::".concat(t.slug)},disabledTooltipText:"Edit is disabled",handleAction:e=>{let{id:t}=e;A(t)},isDisabled:e=>{let{available:n,internal:a}=e;return!t||!n||a},TooltipComponent:Ue.A,tooltipText:"Edit setting"},delete:{confirmLabel:"Yes, delete",confirmationMessage:e=>{let{integration:t={}}=e;return a.createElement(ot,{name:t.name,spaceName:r})},confirmationTitle:e=>{let{name:t}=e;return(0,it.O5)(t)},dataGa:e=>{let{integration:t={}}=e;return"manage-rooms::click-delete::".concat(t.slug)},declineLabel:"Cancel",handleAction:T,isDisabled:e=>{let{integration:n={}}=e;return!t||n.internal},TooltipComponent:Ue.A,tooltipText:"Delete setting"}})),[t,T,S]);return{bulkActions:I,channelData:g,currentChannelId:E,columns:gt({canManageChannels:t,roomOptions:v,spaceId:n}),dataGa:"manage-channels",onFilter:(e,t,n)=>{const a=e.original,l=n.toLowerCase();if(a.name.toLowerCase().includes(l))return!0;if(a.integration.slug.toLowerCase().includes(l))return!0;if(a.notificationLabel.toLowerCase().includes(l))return!0;if(a.internal)return rt.Oh.label.toLowerCase().includes(l);const r=a.rooms||[];if(!r.length)return rt.PT.label.toLowerCase().includes(l);return(0,it.Pl)({roomIds:r,roomOptions:v}).toLowerCase().includes(l)},onModalClose:()=>{b(g.map((e=>e.id===E?{...e,alerts:x,name:y,rooms:C,secrets:w}:e))),f("")},rowActions:F,search:m,setSearch:d}};n(74648),n(23215);var yt=n(54518),Ct=n(47130);const wt=(0,te.A)((0,Ct.A)(s.Button)),At="modal",Tt=e=>{let{id:t="new",integrationId:n,onClose:r,isSubmitEnabled:o}=e;const{alarms:c,name:s,rooms:m,slug:d,integration:u,secrets:g}=(0,lt.g4)(t),p=(0,Ke.ly)(),E=(0,l.Zp)(),[b,f]=(0,me.A)(),v=(0,h.vt)(),x=(0,h.bq)(),y=(0,lt.bY)(),C=(0,a.useCallback)((()=>{(d||u)&&y({slug:d||u,secrets:g})}),[d,g,y]),w=(0,i.tW)(L.bq,{spaceSlug:x,settingsTab:L.A8});return a.createElement(ct.fn,{column:!1,gap:2,"data-testid":"".concat(At,"-footer"),justifyContent:"end"},a.createElement(wt,{feature:"IntegrationNotification",integrationId:n,label:"Test",flavour:"hollow",onClick:C,disabled:!o,tooltipProps:{content:"Test your notification settings",align:"bottom"}}),a.createElement(wt,{feature:"IntegrationNotification",integrationId:n,"data-testid":"".concat(At,"-confirmButton"),disabled:!o,label:"OK",onClick:async()=>{try{const e={alarms:c,integrationID:n,...s?{name:s}:{},...null!==m&&void 0!==m&&m.length?{Rooms:m}:{},secrets:g};"new"===t?await(0,at.Qb)(v,e):await(0,at.eQ)(v,t,e),b({header:"new"===t?"Configuration created successfully!":"Configuration updated successfully!"}),p(),r(),E(w)}catch(e){f(e)}},textTransform:"uppercase",tooltipProps:{content:"Save your settings",align:"bottom"}}))},St="modal",It=e=>{let{id:t="new",integrationId:n,onClose:l,...o}=e;const{alarms:i,title:c,description:m,docsLink:d,fields:u,integration:g,loaded:p,name:h,required:b,roomSelections:f,secrets:v}=(0,lt.g4)(t),x=e=>"manage-".concat(g,"-channel::").concat(e,"::notification-").concat(n?"integrations":"channels","-tab"),y=(0,ht.A)({all:!0}),C=(0,E.DL)(),w=(0,lt.ef)(t,"alarms"),A=(0,lt.ef)(t,"name"),T=(0,lt.ef)(t,"roomSelections"),S=(0,lt.ef)(t,"secrets"),I=(0,lt.ef)(t,"rooms"),[k,F]=(0,a.useState)({});if(!p)return null;const P=Object.keys(k),M=b.every((e=>(0,it.ct)(e,v[e],u[e]))),D=!P.length||P.every((e=>{const t=v[e].selection;return k[e].every((n=>(0,it.ct)(n,v[e][n],u[e].fields[t][n])))})),N=i&&M&&D;return a.createElement(s.Modal,{onEsc:l},a.createElement(ct.$m,{"data-testid":o["data-testid"]||St},a.createElement(s.ModalHeader,{border:{side:"bottom",color:"disabled"},column:!0,"data-testid":"".concat(St,"-header"),gap:.5,padding:[6,4,3]},a.createElement(s.Flex,{alignItems:"center","data-testid":"".concat(St,"-headerMain")},a.createElement(s.Flex,{"data-testid":"".concat(St,"-titleContainer"),gap:1},a.createElement(s.Icon,(0,r.A)({"data-testid":"".concat(St,"-titleIcon")},rt.a$[g]||{})),a.createElement(s.H3,{"data-testid":"".concat(St,"-title")},c)),l&&a.createElement(ct.Oj,{"data-ga":x("close-modal"),"data-testid":"".concat(St,"-close"),onClose:l})),a.createElement(s.TextSmall,{as:s.Box,"data-testid":"".concat(St,"-description")},m,"\xa0",a.createElement(ue.A,{Component:s.TextSmall,"data-ga":x("click-docs"),"data-testid":"".concat(St,"-docsLink"),href:d,target:"_blank",whiteSpace:"nowrap"},"Learn how to configure it."))),a.createElement(s.ModalBody,{"data-testid":"".concat(St,"-body"),overflow:{vertical:"auto"},padding:[0]},a.createElement(ct.fn,{gap:2,"data-testid":"".concat(St,"-standardFields"),hasBorder:!0},a.createElement(s.Text,{"data-testid":"".concat(St,"-standardFields-header")},"Notification settings"),a.createElement(s.Flex,{column:!0,"data-testid":"".concat(St,"-standardFields-body"),gap:3},a.createElement(yt.A,{component:"input","data-ga":x("configuration-name-input"),"data-testid":"".concat(St,"-configurationName"),onChange:A,placeholder:"i.e All alerts from All nodes",title:"Configuration name",value:h}),a.createElement(yt.A,{component:"select","data-ga":x("rooms-select"),"data-testid":"".concat(St,"-rooms"),isMulti:!0,onChange:e=>{var t;if(1===C.length)return;if(0===e.length)return I([]),void T([]);if(e.length===C.length||null===(t=e[e.length-1])||void 0===t||!t.value)return I([]),void T([rt.PT]);const n=e.map((e=>{let{value:t}=e;return t})).filter(Boolean),a=e.length>1?e.filter((e=>e.value)):e;I(n),T(a)},options:y,placeholder:"Select rooms",title:"Rooms",value:f}),a.createElement(yt.A,{component:"select","data-ga":x("notification-select"),"data-testid":"".concat(St,"-notifications"),isRequired:!0,onChange:e=>{let{value:t}=e;w(t)},options:Object.values(rt.N4),placeholder:"Select notifications",title:"Notifications",value:rt.N4[i]}))),a.createElement(ct.fn,{gap:2,"data-testid":"".concat(St,"-dynamicFields"),hasBorder:!0},a.createElement(s.Text,{"data-testid":"".concat(St,"-dynamicFields-header")},"Integration configuration"),a.createElement(s.Flex,{column:!0,"data-testid":"".concat(St,"-dynamicFields-body"),gap:3},Object.values(u).map((e=>{let{id:t,getValue:n,onChange:l,...o}=e;return a.createElement(yt.A,(0,r.A)({"data-ga":x("".concat(t,"-").concat(o.component)),"data-testid":"".concat(St,"-").concat(t),getDataGa:x,key:t,id:t,onChange:null===l||void 0===l?void 0:l({id:t,setRequiredSubsets:F,setSecrets:S}),secrets:v,setSecrets:S,value:null===n||void 0===n?void 0:n({id:t,secrets:v})},o))}))))),a.createElement(Tt,{id:t,integrationId:n,onClose:l,isSubmitEnabled:N})))},kt=e=>{let{"data-testid":t="channelList",...n}=e;const{bulkActions:l,channelData:o,currentChannelId:i,columns:c,dataGa:m,onFilter:d,onModalClose:u,rowActions:g,search:p,setSearch:E}=xt();return a.createElement(M.Ay,{tab:"Notifications::Channels"},a.createElement(s.Flex,(0,r.A)({column:!0,"data-testid":t,gap:4,height:"100%",width:"100%",margin:[3,0]},n),a.createElement(s.Table,{bulkActions:l,data:o,dataColumns:c,dataGa:m,globalFilter:p,globalFilterFn:d,onSearch:E,rowActions:g,testPrefix:"channelList",testPrefixCallback:e=>e.name}),!!i&&a.createElement(It,{"data-testid":"editChannelModal",id:i,onClose:u})))},Ft=0;var Pt=n(38819);const Mt=(0,o.A)((()=>n.e(5304).then(n.bind(n,25304))),"SilencingRules"),Dt={side:"top",type:"solid",size:"1px",color:"border"},Nt=()=>{const{notificationsActiveTab:e=Ft}=(0,Pt.PP)(),t=(0,a.useCallback)((e=>{const t=(0,Pt.PP)();(0,Pt.Z8)({...t,notificationsActiveTab:e})}),[]);return a.createElement(a.Fragment,null,a.createElement(s.Flex,{padding:[0,0,0,4]},a.createElement(s.H3,null,"Alerts & Notifications")),a.createElement(s.Tabs,{selected:parseInt(e,10),onChange:t,height:"calc(100% - 44px)",margin:[4,0,0,0]},a.createElement(s.Tab,{"data-testid":"spaceSettings-notifications-methods-tab","data-ga":"manage-space::click-tab::notifications-methods-tab",label:a.createElement(s.Text,null,"Notification Methods")},a.createElement(s.Flex,{padding:[2,4],border:Dt,flex:"grow"},a.createElement(kt,null))),a.createElement(s.Tab,{"data-testid":"spaceSettings-notifications-silencing-rules-tab","data-ga":"manage-space::click-tab::notifications-silencing-rules-tab",label:a.createElement(s.Text,null,"Notification Silencing Rules")},a.createElement(s.Flex,{border:Dt,flex:"grow"},a.createElement(a.Suspense,null,a.createElement(Mt,null))))))};var Bt=n(84976),Rt=n(28738),Lt=n(26751),_t=n(54856);const Ut=e=>{let{available:t,"data-testid":n="card",description:l,docsLink:o,fields:i,id:c,internal:m,kind:d,kindLabel:u,slug:g,required:E,title:h,...f}=e;const v=rt.a$[g]||{},x=(0,lt.Mw)("new"),y=(0,lt.ef)("new"),C=(0,p.JT)("channel:Manage"),[w,,A,T]=(0,b.A)(!1),S=(0,a.useCallback)((()=>{y({...pt.V,title:h,description:l,docsLink:o,fields:i,integration:g,loading:!1,loaded:!0,required:E,secrets:(0,it.s7)(i,E)}),A()}),[l,o,i,g,E]);return a.createElement(a.Fragment,null,a.createElement(s.Flex,(0,r.A)({background:"elementBackground",column:!0,"data-testid":n,justifyContent:"between",flex:!1,height:37,padding:[3,2,2,3],margin:[0,0,4,0],position:"relative",overflow:"hidden",round:.5,width:75},f),a.createElement(ct.MU,(0,r.A)({"data-testid":"".concat(n,"-blurredIcon")},v)),a.createElement(s.Flex,{column:!0,"data-testid":"".concat(n,"-details"),gap:3,margin:[0,0,3,0]},a.createElement(s.Flex,{"data-testid":"".concat(n,"-header"),justifyContent:"between"},a.createElement(s.Flex,{alignItems:"center","data-testid":"".concat(n,"-titleContainer"),gap:1},a.createElement(s.Icon,(0,r.A)({"data-testid":"".concat(n,"-icon")},v)),a.createElement(s.Text,{"data-testid":"".concat(n,"-title")},h)),!m&&t&&a.createElement(Ue.A,{align:"bottom",content:C?"":rt.WB,plain:!0},a.createElement(s.Box,null,a.createElement(ct.ro,{"data-ga":"manage-integration-".concat(g,"::click-add::notification-integrations-tab"),"data-testid":"".concat(n,"-button"),disabled:!C,label:"Add",onClick:S}))),!m&&!t&&a.createElement(_t.A,{"data-ga":"manage-integration-".concat(g,"::click-plan-badge::notification-integrations-tab")})),a.createElement(s.TextSmall,{color:"textDescription","data-testid":"".concat(n,"-description")},l," ",o&&a.createElement(ue.A,{Component:ct.W6,"data-ga":"manage-integration-".concat(g,"::click-docs::notification-integrations-tab"),"data-testid":"".concat(n,"-docsLink"),href:o,target:"_blank",whiteSpace:"nowrap"},"Learn more."))),a.createElement(Ue.A,{align:"top",content:rt.HA[d].tooltip,"data-testid":"".concat(n,"-kindContainer"),plain:!0},a.createElement(s.Flex,{alignItems:"end",alignSelf:"end","data-testid":"".concat(n,"-kindContainer"),gap:1},a.createElement(s.Icon,{color:"textLite","data-testid":"".concat(n,"-kindIcon"),height:"16px",name:rt.HA[d].icon,width:"16px"}),a.createElement(s.TextSmall,{color:"textLite","data-testid":"".concat(n,"-kind")},u)))),w&&a.createElement(It,{"data-testid":"createChannelModal",integrationId:c,onClose:()=>{T(),x()}}))},Ot=e=>{let{"data-testid":t="group",integrations:n,title:l,...o}=e;return n.length?a.createElement(s.Flex,(0,r.A)({column:!0,"data-testid":t,gap:2,position:"relative"},o),a.createElement(s.TextBig,{color:"textDescription","data-testid":"".concat(t,"-title")},l),a.createElement(s.Flex,{flexWrap:!0,"data-testid":"".concat(t,"-integrations"),gap:4},n.map((e=>a.createElement(Ut,(0,r.A)({"data-testid":"".concat(e.slug,"Card"),key:e.slug},e)))))):null};var Vt=n(73743);const Ht=e=>{const t=(0,lt.EE)(e);(0,Et.A)((()=>({enabled:!!e,fetch:()=>(0,at.b8)(e),onFail:e=>t({...Vt.u,error:e.message}),onSettle:()=>t({loading:!1,loaded:!0}),onSuccess:e=>{t({...Vt.u,...e})}})),[e])},Wt=e=>{let{"data-testid":t="integrations",...n}=e;const l=(0,h.vt)(),o=(0,h.bq)();Ht(l);const{available:c,error:m,loaded:d,unavailable:u}=(0,lt.m$)(l),[g,p]=(0,a.useState)([]),[E,b]=(0,a.useState)([]),[f,v]=(0,a.useState)("");if(!d)return a.createElement(Rt.A,{"data-testid":"".concat(t,"-loader"),title:"Loading services..."});if(m)return a.createElement(Lt.A,{"data-testid":"".concat(t,"-error"),message:m,title:"Services of ".concat(o," are currently unavailable")});const x=(0,i.tW)(L.bq,{spaceSlug:o,settingsTab:L.A8});return a.createElement(M.Ay,{tab:"Notifications::Integrations"},a.createElement(s.Flex,(0,r.A)({column:!0,"data-testid":t},n,{padding:[0,3,3],gap:3,overflow:"hidden"}),a.createElement(s.Flex,{border:{side:"bottom",color:"placeholder"},"data-testid":"".concat(t,"-header"),width:"100%"},a.createElement(ue.A,{as:Bt.N_,Component:ct.He,"data-ga":"manage-integrations::click-back::notification-integrations-tab","data-testid":"".concat(t,"-backLink"),to:x},a.createElement(s.Icon,{"data-testid":"".concat(t,"-backIcon"),name:"arrow_left"}),a.createElement(s.H3,{"data-testid":"".concat(t,"-title")},L.ys[L.G0]))),a.createElement(s.Flex,{column:!0,"data-testid":"".concat(t,"-content"),gap:2,height:"100%",overflow:"hidden"},a.createElement(s.Box,{as:s.SearchInput,"data-ga":"manage-integrations::search::notification-integrations-tab","data-testid":"".concat(t,"-search"),iconLeft:a.createElement(s.Icon,{name:"magnify",color:"textLite"}),onChange:e=>{v(e),p((0,it.Zv)(c,e)),b((0,it.Zv)(u,e))},placeholder:"Search service",size:"small",width:{max:49.5}}),a.createElement(s.Flex,{column:!0,"data-testid":"".concat(t,"-groups"),overflow:"auto",height:"100%"},a.createElement(Ot,{"data-testid":"integrationGroupAvailable",integrations:f?g:c,title:"Available"}),a.createElement(Ot,{"data-testid":"integrationGroupUnavailable",integrations:f?E:u,title:"Unavailable"})))))},jt=()=>a.createElement(l.BV,null,a.createElement(l.qh,{path:"/",element:a.createElement(Nt,null)}),a.createElement(l.qh,{path:"/".concat(L.G0),element:a.createElement(Wt,null)}));var Yt=n(55189),qt=n(37618);const zt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[(0,s.useInputValue)({maxChars:20,value:e.name||""})||{},(0,s.useInputValue)({maxChars:30,value:e.slug||""})||{},(0,s.useInputValue)({maxChars:50,value:e.description||""})||{}]};var Jt=n(39522),Gt=n(47373),Kt=n(53285),Zt=n(7484),$t=n(61360);const Qt={loading:!1,isAvailable:!1,isValid:!0,error:null},Xt=e=>{const t=(0,h.ap)(),[n,l]=(0,a.useState)(Qt);return(0,a.useEffect)((()=>{if(t.slug==e)l(Qt);else{const t=(0,Gt.ni)(e);l({...Qt,isValid:!1,error:t})}}),[t.slug,e]),(0,$t.A)((()=>{(0,Gt.ni)(e)||t.slug==e||(l((e=>({...e,loading:!0}))),(0,Zt.Q9)(e).then((e=>{let{data:t}=e;l((e=>({...e,loading:!1,error:t.isAvailable?e.error:"slugNotAvailable"})))})).catch((e=>{l((t=>{var n;return{...t,loading:!1,error:(null===(n=e.response)||void 0===n||null===(n=n.data)||void 0===n?void 0:n.errorMessage)||"Error while validating slug"}}))})))}),500,[e]),n},en=e=>{let{nameInput:t,slugInput:n,descriptionInput:l,onStartSlugValidation:o,onStopSlugValidation:i,onSlugValidationError:c,...m}=e;const[d,u,g,p]=t,[E,h,b,f]=n,[v,x,y,C]=l,{loading:w,error:A}=Xt(E);(0,a.useEffect)((()=>{(w?o:i)()}),[w]),(0,a.useEffect)((()=>{c(A)}),[A]);const T=(0,a.useMemo)((()=>(0,Gt.fc)(d)),[d]),S=(0,a.useMemo)((()=>(0,Gt.e_)(v)),[v]);return a.createElement(s.Flex,(0,r.A)({column:!0,gap:4},m),a.createElement(Kt.A,{Component:s.TextInput,permission:"space:UpdateMeta",label:"Name",value:d,onChange:u,error:Gt.xc[T],isDirty:p,instantFeedback:"all",fieldIndicator:g,"data-testid":"textInputs-spaceName",containerStyles:{width:{base:150}}}),a.createElement(Kt.A,{Component:s.TextInput,permission:"space:UpdateMeta",label:"Slug",value:E,onChange:h,error:Gt.xc[A]||A,isDirty:f,instantFeedback:"all",fieldIndicator:b,"data-testid":"textInputs-spaceSlug",containerStyles:{width:{base:150}}}),a.createElement(Kt.A,{Component:s.TextInput,permission:"space:UpdateMeta",label:"Description",value:v,onChange:x,error:Gt.xc[S],isDirty:C,instantFeedback:"all",fieldIndicator:y,"data-testid":"textInputs-spaceDescription",containerStyles:{width:{base:150}}}))};var tn=n(87292);const nn=e=>{let{id:t,...n}=e;return a.createElement(s.Flex,(0,r.A)({column:!0,gap:1},n),a.createElement(s.Text,{strong:!0},"Space Id"),a.createElement(tn.Ay,{confirmationText:"Space ID copied to your clipboard."},t))};var an=n(83694);const ln=()=>a.createElement(s.Text,{lineHeight:1.5},"With the change of the Space Slug, previous ",a.createElement(s.Text,{strong:!0},"links will be broken"),". In case you have some bookmarks or previous references using the previous Space Slug you should update them where possible. Please confirm you want to proceed with the change."),rn=e=>{let{handleConfirm:t,handleDecline:n}=e;return a.createElement(s.ConfirmationDialog,{confirmLabel:"Continue","data-testid":"changeSpaceSlugDialog",handleConfirm:t,handleDecline:n,message:a.createElement(ln,null),title:"Space slug change"})};var on=n(98046);const cn=(0,te.A)(s.Button),sn=e=>{let{nameInput:t,slugInput:n,descriptionInput:l,onClose:o,isValidatingSlug:i,slugError:c,...s}=e;const m=(0,h.ap)(),d=(0,on.A)(m.id),[u,g]=(0,a.useState)(!1),[p]=t,[E]=n,[f]=l,v=(0,a.useMemo)((()=>m.slug!==E),[m.slug,E]),[x,,y,C]=(0,b.A)(),w=()=>{o(v?E:null),g(!1)},A=()=>g(!1),T=(0,a.useCallback)((e=>{!e&&v?y():(g(!0),d({name:p,description:f,...v?{slug:E}:{}},{onSuccess:w,onFail:A}))}),[p,E,f,m.slug]),S=(0,a.useCallback)((()=>T(!0)),[T]),I=(0,a.useMemo)((()=>{const e=(0,Gt.fc)(p),t=(0,Gt.e_)(f);return!!(u||i||e||c||t)||m.name===p&&m.slug===E&&(m.description===f||!m.description&&!f)}),[m,p,E,f,u,i]);return a.createElement(a.Fragment,null,a.createElement(cn,(0,r.A)({label:"SAVE",onClick:T,isLoading:u||i,disabled:I,"data-testid":"saveSpace-button",feature:"SpaceSettings"},s)),x?a.createElement(rn,{handleConfirm:S,handleDecline:C}):null)},mn=(0,a.memo)((e=>{let{onClose:t,...n}=e;const l=(0,h.ap)(),o=(0,h.UV)("ids"),[i,,c,m]=(0,b.A)(),[d,,u,g]=(0,b.A)(),[p,E]=(0,a.useState)(),[f,v,x]=zt({name:l.name,slug:l.slug,description:l.description});if(!l.id)return null;const y=1===o.filter((e=>!(0,qt.ES)(e))).length;return a.createElement(M.Ay,{tab:"Info"},a.createElement(s.Flex,(0,r.A)({column:!0,"data-testid":"manageSpace",flex:"grow",justifyContent:"between",padding:[0,0,6,0],width:{max:150}},n),a.createElement(s.Flex,{column:!0,"data-testid":"manageSpace-settings"},a.createElement(s.H3,{margin:[0,0,4,0]},"Info"),a.createElement(s.Flex,{column:!0,gap:4},a.createElement(en,{"data-testid":"manageSpace-nameInputs",nameInput:f,slugInput:v,descriptionInput:x,onStartSlugValidation:u,onStopSlugValidation:g,onSlugValidationError:E}),a.createElement(nn,{"data-testid":"manageSpace-spaceIdInput",id:l.id,width:{base:150}}),a.createElement(s.TextInput,{label:"Your role in space",value:(0,_e.Zr)(l.roleInSpace),disabled:!0,containerStyles:{width:{base:150}}}),a.createElement(s.TextInput,{label:"Plan",value:(0,_e.Vn)(l.planName),disabled:!0,containerStyles:{width:{base:150}}}))),a.createElement(s.Flex,{"data-testid":"manageSpace-actions",justifyContent:"between",alignItems:"center"},a.createElement(s.Flex,{"data-testid":"manageSpace-deleteLeaveActions",gap:4},a.createElement(Ue.A,{align:"top",content:y&&Yt.sh.leave,isBasic:!0,stretch:"align"},a.createElement(s.Flex,{alignItems:"center"},a.createElement(s.Button,{"data-ga":"manage-space-tab::click-leave-space::manage-space-modal","data-testid":"manageSpace-leave",disabled:y,icon:"switch_off",flavour:"borderless",label:"Leave space",neutral:!0,padding:[0],width:"fit-content",onClick:c}))),a.createElement(an.A,{"data-testid":"manageSpace-delete",id:l.id,isLastSpace:y,name:l.name,onClose:t})),a.createElement(sn,{"data-testid":"manageSpace-save",nameInput:f,slugInput:v,descriptionInput:x,onClose:t,isValidatingSlug:d,slugError:p}))),i&&a.createElement(Jt.A,{id:l.id,name:l.name,onClose:m}))}),(()=>!0));var dn=n(62232);const un=()=>{const e=(0,l.Zp)(),t=(0,h.vt)(),n=(0,l.RQ)(L.uX),r=(0,l.RQ)(L.bq),{params:o}=n||r||{},{spaceSlug:c="",settingsTab:s="",settingsSubTab:m=""}=o,d=(0,h.ap)("name"),u=(0,A.J_)(t,m),g=(0,A.wz)(u,"name"),p=L.ys[s],E=(0,a.useCallback)((()=>{e((0,i.tW)(L.bq,{spaceSlug:c,settingsTab:s}))}),[c,s]),b=(0,a.useMemo)((()=>{const e=[{name:"Manage Space",isDisabled:!0},{name:d,isDisabled:!0},{name:p,...!!m&&{onClick:E}}];return m&&e.push({name:p===L.ys[L.aj]?g:L.ys[m]||m}),e}),[E,g,d,p,m]);return a.createElement(dn.A,{isBig:!0,items:b,showBackButton:!1,testid:"manageSpace"})};var gn=n(47731),pn=n(19673),En=(n(9391),n(67742));const hn=e=>a.createElement(s.Box,(0,r.A)({as:"hr",height:"100%",sx:{borderWidth:"0px 0px 0px 1px",borderColor:"borderSecondary",borderStyle:"solid"}},e)),bn=()=>a.createElement(hn,{height:"1px",width:"100%",sx:{borderWidth:"1px 0px 0px 0px",borderColor:"borderSecondary",borderStyle:"solid"}});var fn=n(42728);const vn=e=>{let{currentPlan:t,billingEmail:n,paymentMethod:l,businessName:r,vatNo:o,billingAddress:i}=e;const[c,m]=(0,pn.Qh)(),d=!!t.billingEmail&&!m,u=n||"",g=u?"":"Email is required",p=null!==l&&void 0!==l&&l.id?"**** ".concat(null===l||void 0===l?void 0:l.id):"",E=p?"":"Payment method is required",h=i?"":"Billing address is required";return a.createElement(s.Flex,{column:!0,gap:3},a.createElement(s.Flex,{gap:4},a.createElement(s.TextInput,{value:u,label:"Billing email",placeholder:"Not specified",instantFeedback:"all",isDirty:!!g,error:g,disabled:!0}),a.createElement(s.TextInput,{value:p,label:"Default payment method",placeholder:"Not specified",instantFeedback:"all",isDirty:!!E,error:E,disabled:!0})),o&&a.createElement(s.Flex,{gap:4},a.createElement(s.TextInput,{value:r||"",label:"Business name",placeholder:"Not specified",disabled:!0}),a.createElement(s.TextInput,{value:o,label:"VAT number",placeholder:"Not specified",disabled:!0})),a.createElement(s.Flex,null,a.createElement(s.TextInput,{value:(0,fn.qN)(i)||"",label:"Billing address",placeholder:"Not specified",isDirty:!!h,error:h,disabled:!0})),a.createElement(ue.A,{Component:s.Flex,cursor:d?"pointer":"default",disabled:!d,onClick:c,alignItems:"center",gap:1,"data-ga":"billing-options::click::billing"},a.createElement("span",null,"Change billing information and payment method"),a.createElement(s.Icon,{name:"nav_arrow_goto",width:"12px",height:"12px"})))},xn=e=>{let{onReset:t}=e;return a.createElement(s.Box,{as:s.Icon,name:"close_circle",onClick:t,cursor:"pointer",width:3,height:3,color:"border",position:"absolute",left:"2px"})},yn=e=>{let{promotionCode:t,onReset:n}=e;return a.createElement(s.Flex,{width:"100%"},a.createElement(s.Pill,{padding:[0],flavour:"neutral",hollow:!0},a.createElement(s.Flex,{position:"relative",gap:2,alignItems:"center",padding:[1,2,1,5]},a.createElement(xn,{onReset:n}),a.createElement(s.Text,null,t))))},Cn=e=>{let{promotionCode:t,onApply:n,error:l}=e;const[r,o]=(0,a.useState)(t||""),i=()=>{o(""),n("")};return a.createElement(s.Flex,{column:!0,gap:1},a.createElement(s.Text,{strong:!0},"Promotion code"),t&&!l?a.createElement(yn,{promotionCode:t,onReset:i}):a.createElement(s.Flex,{column:!0,gap:1},a.createElement(s.Flex,{gap:2,alignItems:"baseline"},a.createElement(s.TextInput,{value:r,onChange:e=>o(e.target.value),placeholder:"Promotion code"}),!l&&a.createElement(s.Button,{label:"Apply",onClick:()=>n(r),padding:[3,4],disabled:!r}),!!r&&a.createElement(s.Button,{label:"Clear",flavour:"hollow",onClick:i,padding:[3,4],disabled:!r})),l&&a.createElement(s.Text,{color:"error"},l)))},wn=e=>{let{needsCommitment:t,commitment:n,handleCommitmentChange:l}=e;return t&&a.createElement(s.Flex,{column:!0,gap:2},a.createElement(s.Flex,{gap:4,alignItems:"baseline"},a.createElement(s.Text,{strong:!0,style:{whiteSpace:"nowrap"}},"Committed Nodes"),a.createElement(s.TextInput,{onChange:l,value:n,placeholder:"i.e. 14",type:"number",min:1})),a.createElement(s.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."))};var An=n(63950),Tn=n.n(An),Sn=n(27994);const In={earlyBird:()=>a.createElement(s.Text,null,"You are moving from ",a.createElement(s.Text,{strong:!0},"Early Bird")," plan to another plan, you won't be able to come back to this. The ",a.createElement(s.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."),communityV1:e=>{let{onCtaClick:t=Tn()}=e;const{url:n}=(0,Sn.A)();return a.createElement(s.Text,null,"You are moving from ",a.createElement(s.Text,{strong:!0},"Community (2023.02)")," plan to another plan, you won't be able to come back to this. The new ",a.createElement(s.Text,{strong:!0},"Community (2023.11)")," free plan will be there if you wish to cancel but this will have new limitation: max of 5 nodes active and max of 1 custom dashboard. See full details on the"," ",a.createElement(ue.A,{as:Bt.N_,onClick:t,to:n,disabled:!n},a.createElement(s.Text,{color:"primary"},"View plans page")),".")},pro:()=>a.createElement(s.Text,null,"You are moving from ",a.createElement(s.Text,{strong:!0},"Pro")," plan to another plan by yourself, if you proceed we won't be able to migrate you to the Business plan with your current pricing conditions as communicated.")},kn=e=>{let{currentPlan:t,...n}=e;const l=In[(e=>"earlyBird"==e.slug?"earlyBird":"free"==e.slug&&"2023.02"==e.version?"communityV1":"pro"==e.slug?"pro":null)(t)]||null;return l&&a.createElement(a.Fragment,null,a.createElement(hn,{height:"1px",width:"100%",sx:{borderWidth:"1px 0px 0px 0px",borderColor:"borderSecondary",borderStyle:"solid"}}),a.createElement(s.Flex,{gap:3},a.createElement(s.Icon,{size:"large",color:"warning",name:"warning_triangle"}),a.createElement(l,n)))},Fn=e=>"earlyBird"===(null===e||void 0===e?void 0:e.slug)?"earlyBird":e&&e.slug&&"free"!==e.slug?"".concat(e.slug,"-").concat(e.interval):"free",Pn=c.default.div.withConfig({displayName:"withTableWrapper__TableWrapper",componentId:"sc-drcfxi-0"})(["margin-top:30px;"]),Mn=e=>t=>a.createElement(Pn,null,a.createElement(e,t)),Dn=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}),Nn={size:50,minSize:50,maxSize:100},Bn=e=>()=>a.createElement(s.Flex,{width:"100%",justifyContent:"end"},e),Rn=e=>{let{getValue:t}=e;return a.createElement(s.Flex,{width:"100%",justifyContent:"end"},t())},Ln=[{id:"name",accessor:"name",header:"",...Nn,fullWidth:!0},{id:"price",accessor:"price",header:Bn("Price"),cell:Rn,...Nn},{id:"qty",accessor:"qty",header:Bn("Qty"),cell:Rn,...Nn},{id:"month",accessor:"month",header:Bn("Month"),cell:Rn,...Nn},{id:"total",accessor:"total",header:Bn("Total"),cell:Rn,...Nn}],_n=e=>a.createElement(s.Flex,(0,r.A)({gap:3},e),a.createElement(s.Icon,{size:"large",color:"warning",name:"warning_triangle"}),a.createElement(s.Text,null,"No immediate charges are applicable to this plan subscription. On-demand usage charges will be applied based on your node period count.")),Un=Mn(s.Table),On=e=>{let{needsCommitment:t,price:n,spaceTotal:l,commitment:r,currentCommitment:o,onlyCommitment:i,balance:c,nodesTotal:m,zeroSubscriptionTotal:d,checkoutIsDisabled:u,discount:g=0}=e;const p=parseFloat(m+l),E=parseFloat(p*g),h=parseFloat(p-E),b=(0,fn.S_)(r,n.pricing.primary.amountPerNode,i?0:n.pricing.primary.amountFlat,c.amount,o,E);return a.createElement(a.Fragment,null,d?u?null:a.createElement(_n,null):a.createElement(a.Fragment,null,t&&a.createElement(a.Fragment,null,a.createElement(s.Flex,{justifyContent:"between"},a.createElement(s.Text,null,"Subscription Total"),a.createElement(s.Text,null,Dn.format(p))),!!g&&a.createElement(s.Flex,{justifyContent:"between"},a.createElement(s.Text,{color:"primary"},"Promo discount (",100*g,"%)"),a.createElement(s.Text,{color:"primary"},"- ",Dn.format(E)))),a.createElement(s.Flex,{justifyContent:"between"},a.createElement(s.Text,null,"Total"),a.createElement(s.Text,null,Dn.format(h))),!!c.amount&&a.createElement(s.Flex,{justifyContent:"between"},a.createElement(s.Text,null,"Credit amount"),a.createElement(s.Text,null,"- ",Dn.format(b))),a.createElement(bn,null),a.createElement(s.Flex,null,a.createElement(s.TextMicro,null,"Additional taxes may be applicable"))),a.createElement(s.Flex,{justifyContent:"between"},a.createElement(s.H0,{strong:!0},"Total payable"),a.createElement(s.H0,{strong:!0,"data-testid":"totalPayableAmountCheckout"},Dn.format((0,fn.Lm)(o,r,n.pricing.primary.amountPerNode,i?0:n.pricing.primary.amountFlat,b,E)))))},Vn=e=>{let{price:t,needsCommitment:n,currentCommitment:l,onlyCommitment:r,balance:o,spaceTotal:i,amountPerNodePerMonth:c,amountPerSpacePerMonth:s,commitment:m,nodesTotal:d,months:u,checkoutIsDisabled:g,discount:p=0}=e;const E=(0,a.useMemo)((()=>0==parseFloat(d+i)),[d,i]),h=(0,a.useMemo)((()=>{const e=!isNaN(i)&&i>0?{id:"space",name:"Space",price:Dn.format(s),qty:1,month:u,total:Dn.format(i)}:null;if(!n)return[e];return[isNaN(d)?null:{id:"nodes",name:"Nodes",price:Dn.format(c),qty:m||0,month:u,total:Dn.format(d)},e].filter(Boolean)}),[n,s,i,d,u]);return a.createElement(a.Fragment,null,!E&&a.createElement(a.Fragment,null,a.createElement(Un,{dataColumns:Ln,data:h}),a.createElement(bn,null)),a.createElement(On,{needsCommitment:n,price:t,spaceTotal:i,commitment:m,currentCommitment:l,onlyCommitment:r,balance:o,nodesTotal:d,zeroSubscriptionTotal:E,checkoutIsDisabled:g,discount:p}))},Hn=Mn(s.Table),Wn=e=>{let{lineItems:t}=e;return a.createElement(a.Fragment,null,t.map((e=>{var t;const n=(l=e).description?l.description.startsWith("Discount")?{color:"primary"}:l.description.startsWith("VAT")?{color:"textLite"}:{}:{};var l;const r=e.isInfo?s.TextSmall:s.Text;return a.createElement(s.Flex,{key:e.description,justifyContent:"between"},a.createElement(r,n,e.description),a.createElement(r,n,Dn.format(null===(t=e.total)||void 0===t?void 0:t.amount)))})))},jn=(Yn=e=>{let{lineItems:t}=e;return a.createElement(s.Flex,{justifyContent:"between",margin:[4,0,0,0]},a.createElement(s.H0,{strong:!0},"Total payable"),a.createElement(s.H0,{strong:!0,"data-testid":"totalPayableAmountPreview"},Dn.format(t.totalPayable.total.amount)))},e=>{var t;return e.lineItems.totalPayable?null!==(t=e.lineItems.info)&&void 0!==t&&t.length?a.createElement(s.Flex,{column:!0,gap:1},a.createElement(Yn,e),a.createElement(Wn,{lineItems:e.lineItems.info})):a.createElement(Yn,e):null});var Yn;const qn=e=>{let{previewData:t,lineItems:n,agree:l,toggleAgree:r,zeroPreviewSubscriptionTotal:o}=e;const i=!(null===t||void 0===t||!t.paymentMethod)&&!(null===t||void 0===t||!t.billingAddress);return a.createElement(a.Fragment,null,a.createElement(bn,null),o&&a.createElement(_n,{padding:[0,0,2,0]}),a.createElement(s.Flex,{gap:3},a.createElement(s.Checkbox,{checked:l,onChange:r,disabled:!i}),a.createElement(s.Text,null,"I agree to Netdata Inc's"," ",a.createElement(ue.A,{href:"https://www.netdata.cloud/service-terms/",rel:"noopener noreferrer",target:"_blank"},"Terms of Service")," ","and"," ",a.createElement(ue.A,{href:"https://netdata.cloud/privacy",rel:"noopener noreferer",target:"_blank"},"Privacy Policy"))),a.createElement(jn,{lineItems:n}))},zn=e=>{let{lineItems:t}=e;return a.createElement(a.Fragment,null,a.createElement(Hn,{dataColumns:Ln,data:t.table}),a.createElement(bn,null),a.createElement(Wn,{lineItems:t.footer}))};var Jn=n(34641),Gn=n(25624);const Kn=e=>{let{title:t,onConfirm:n,onClose:l}=e;const{sendButtonClickedLog:r,isReady:o}=(0,Te.A)(),{onTrial:i}=(0,Gn.A)(),c=(0,a.useCallback)((()=>{n(),l(),r({description:"confirm-billing-plan-change"},!0)}),[r,o]),m=(0,a.useCallback)((()=>{l(),r({description:"close-billing-plan-change-confirmation-dialog"},!0)}),[r,o]),d="Community"==t,u=d?"Cancellation":"Downgrading";return i?a.createElement(Jn.A,{onDecline:m}):a.createElement(s.ConfirmationDialog,{confirmLabel:"Yes","data-ga":"downgrade-dialog","data-testid":"downgradeDialog",handleConfirm:c,handleDecline:m,message:a.createElement(s.Flex,{column:!0,gap:2},a.createElement(s.Text,null,"Are you sure you want to ",a.createElement(s.Text,{strong:!0},"move to the ",t," plan")," and cancel your current plan?"),d&&a.createElement(s.Text,null,"Upon cancellation,"," ",a.createElement(s.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(s.Text,null,"For the next 24 hours, you will be able to use all your current notification method configurations."," ",a.createElement(s.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(s.Text,null,u," might affect your Space users. Please check what roles are available on the"," ",a.createElement(ue.A,{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(s.Text,{strong:!0},"Users with unavailable roles on the ",t," plan will immediately have restricted access to the Space.")),a.createElement(s.Text,null,"Do you wish to proceed?")),title:"Go to ".concat(t," plan?")})};var Zn=n(88116);const $n=e=>{let{currentPlan:t={},billingEmail:n,paymentMethod:l,...o}=e;const[i,c]=(0,pn.Qh)(),m=!!t.billingEmail&&!c;return n&&l?null:a.createElement(s.Flex,(0,r.A)({gap:3,alignItems:"center"},o),a.createElement(s.Icon,{size:"large",color:"warning",name:"warning_triangle"}),a.createElement(s.Flex,{column:!0,gap:1},a.createElement(s.Text,null,"You can't proceed to checkout without having provided a"," ",a.createElement(s.Text,{strong:!0},"payment method")," and a ",a.createElement(s.Text,{strong:!0},"billing address"),"."),a.createElement(ue.A,{cursor:m?"pointer":"default",disabled:!m,onClick:i,gap:1,"data-ga":"billing-options::click::billing"},"Please go to the billing portal and fill a payment method")))};var Qn=n(79731);const Xn=e=>e?"::commited-".concat(e):"",ea=(0,c.default)(s.Flex).withConfig({displayName:"checkoutTotals__CheckoutButtonWrapper",componentId:"sc-1q0h6ca-0"})(["background:",";padding:16px 0;position:sticky;bottom:0;z-index:20;"],(0,s.getColor)("mainBackground")),ta=(0,te.A)(s.Button),na=(e=>t=>{let{title:n,isDowngrade:l,showProrations:o,checkoutOrUpdate:i,...c}=t;const[s,,m,d]=(0,b.A)();return o&&l?a.createElement(a.Fragment,null,s&&a.createElement(Kn,{title:n,onConfirm:i,onClose:d}),a.createElement(e,(0,r.A)({onClick:m},c))):a.createElement(e,(0,r.A)({onClick:i},c))})((0,c.default)(ta).withConfig({displayName:"checkoutTotals__CheckoutButton",componentId:"sc-1q0h6ca-1"})(["flex:auto;"])),aa=e=>{let{title:t,slug:n,onClose:l,currentPlan:r,price:o,balance:i,commitment:c,currentCommitment:m=0,email:d,needsCommitment:u,onlyCommitment:g,previewData:p,loadingPreview:E,showProrations:h,promotionCode:f,discount:v=0}=e;const x=((e,t)=>{var n,a;return((null===(n=Zn.FJ[t])||void 0===n?void 0:n.level)||0)<((null===(a=Zn.FJ[e])||void 0===a?void 0:a.level)||0)})(r.slug,n),[y,C]=(0,b.A)(!1),w=h&&!y||!h&&!d||u&&(m===c||!c||c<1),[A,T]=(0,b.A)(),S=(0,pn.L_)(),I=(0,pn.M4)(),k=h||r.billingEmail,F=k?I:S,{sendLog:P,isReady:M}=(0,Te.A)(),[D,N]=(0,me.A)(),B=(0,a.useCallback)((()=>{T(),F({productId:o.id,email:(null===p||void 0===p?void 0:p.billingEmail)||d,...u&&{commitment:c},...f&&{promotionCode:f}}).then((()=>{l(),P({isSuccess:!0,details:F==k?"update-billing-plan":"checkout-billing-plan"},!0),D({header:"Success",text:"You have successfully updated your plan"})})).catch((e=>{var t;P({isFailure:!0,details:F==k?"update-billing-plan":"checkout-billing-plan"},!0);const n=(null===e||void 0===e||null===(t=e.response)||void 0===t?void 0:t.data)||e;N({header:"Error",text:(0,Qn.o)(null===n||void 0===n?void 0:n.errorMsgKey)||(null===n||void 0===n?void 0:n.errorMessage)||"Something went wrong"})})).finally(T)}),[P,M]),{primary:R,secondary:L}=(null===o||void 0===o?void 0:o.pricing)||{},_="year"===o.interval?12:1,U=(0,fn.ji)(R,L),O=u?U*_*(c||0):0,V=(0,fn.bk)(R),H=V*_,W=(j=null===p||void 0===p?void 0:p.invoiceLineItems,(0,a.useMemo)((()=>{if(null===j||void 0===j||!j.length)return null;let e=!1;return j.reduce(((t,n)=>{return"Total payable"==n.description?(t.totalPayable=n,e=!0,t):(n.unitPrice?t.table=[...t.table,{id:n.description,name:n.description,price:Dn.format(n.unitPrice.amount),qty:n.quantity,month:n.month,total:Dn.format(null===(a=n.total)||void 0===a?void 0:a.amount)}]:e?t.info=[...t.info,{...n,isInfo:!0}]:t.footer=[...t.footer,n],t);var a}),{table:[],footer:[],info:[]})}),[j]));var j;const Y=((null===W||void 0===W?void 0:W.footer)||[]).some((e=>{let{description:t,total:n}=e;return"Subscription Total"==t&&0==(null===n||void 0===n?void 0:n.amount)}));return a.createElement(s.Flex,{column:!0,gap:3},h?E||!W||Y?null:a.createElement(zn,{lineItems:W}):a.createElement(Vn,{price:o,needsCommitment:u,currentCommitment:m,onlyCommitment:g,balance:i,spaceTotal:H,amountPerNodePerMonth:U,amountPerSpacePerMonth:V,commitment:c,nodesTotal:O,months:_,checkoutIsDisabled:w,discount:v}),a.createElement(ea,{column:!0,gap:2},h&&!E&&W&&a.createElement(qn,{previewData:p,lineItems:W,agree:y,toggleAgree:C,zeroPreviewSubscriptionTotal:Y}),h&&!E&&a.createElement($n,{currentPlan:r,billingEmail:null===p||void 0===p?void 0:p.billingEmail,paymentMethod:null===p||void 0===p?void 0:p.paymentMethod,padding:[0,0,4,0]}),a.createElement(na,{title:t,isDowngrade:x,label:h?"Checkout":"Proceed to checkout",disabled:!!w||A,checkoutOrUpdate:B,isLoading:A,"data-ga":"proceedTocheckoutButton::click-".concat(Fn(o)).concat(Xn(c),"::billing"),"data-testid":"billingCheckoutTotals-proceedToCheckoutButton",showProrations:h})))},la=e=>{let{prices:t,currentPlan:n}=e;const[l,r]=(0,a.useState)(0),o=t[l],i=null===o||void 0===o?void 0:o.commitment,c=(0,ht.n)("id"),s=(0,U.gr)(c,"ids"),m=(0,O.BU)(s),d=Math.max(5,m.length),[u,g]=(0,a.useState)(n.committedNodes||d);return{recurringIndex:l,setRecurringIndex:r,price:o,needsCommitment:i,commitment:u,handleCommitmentChange:e=>g(e.target.value?parseInt(e.target.value,10):"")}},ra=function(){let{title:e="Checkout"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>n=>a.createElement(d.GO,{onClose:n.onClose},a.createElement(u.z,{onClose:n.onClose,title:e}),a.createElement(s.Flex,{column:!0,padding:[4,4,0,4],justifyContent:"between",height:"calc(100vh - 60px)",overflow:"auto"},a.createElement(t,n)))},oa=3e5,ia=ra({title:"Update plan"})((e=>{let{title:t,onClose:n,prices:o,currentPlan:i={},children:c}=e;const{recurringIndex:m,setRecurringIndex:d,price:u,needsCommitment:g,commitment:E,handleCommitmentChange:h}=la({prices:o,currentPlan:i}),{state:b}=(0,l.zy)(),[f,v]=(0,a.useState)((null===b||void 0===b?void 0:b.coupon)||""),[x,y]=(0,a.useState)(0),[C,w]=(0,a.useState)(oa),A=(0,p.JT)("billing:Manage"),T=(0,fn.di)({price:u,promotionCode:f,commitment:E}),{loading:S,value:I,promoCodeError:k}=(0,pn.qW)(T,x);return(0,En.A)((()=>{S||y((e=>e+1))}),C),(0,a.useEffect)((()=>{w(S?null:oa)}),[S]),a.createElement(M.Ay,{feature:"Billing::UpdateModal"},A?a.createElement(a.Fragment,null,a.createElement(s.Flex,{column:!0,gap:4},a.Children.map(c,(e=>(0,a.cloneElement)(e,{recurringIndex:m,setRecurringIndex:d}))),a.createElement(wn,{needsCommitment:g,commitment:E,handleCommitmentChange:h}),a.createElement(bn,null),S?a.createElement(Rt.A,{title:"Loading billing info...",height:"auto"}):I?a.createElement(a.Fragment,null,a.createElement(vn,(0,r.A)({currentPlan:i},I)),a.createElement(bn,null),a.createElement(Cn,{promotionCode:f,onApply:v,error:k})):a.createElement("div",null,"No data available"),a.createElement(kn,{currentPlan:i,onCtaClick:n})),a.createElement(aa,{title:t,slug:u.slug,currentPlan:i,onClose:n,price:u,balance:i.balance,commitment:E,needsCommitment:g,previewData:I,loadingPreview:S,showProrations:!0,promotionCode:f})):a.createElement(s.Flex,null,a.createElement(s.TextBigger,null,"You don't have permissions to change the plan.")))})),ca=ra()((e=>{let{onClose:t,prices:n,currentPlan:r={},children:o}=e;const{recurringIndex:i,setRecurringIndex:c,price:m,needsCommitment:d,commitment:u,handleCommitmentChange:g}=la({prices:n,currentPlan:r}),E=(0,ve.uW)("email"),[h,b]=(0,a.useState)(r.billingEmail||E||""),f=(0,p.JT)("billing:Manage"),{state:v}=(0,l.zy)(),[x,y]=(0,a.useState)((null===v||void 0===v?void 0:v.coupon)||""),{discount:C,promoCodeError:w}=(0,pn.D)({productId:m.id,promotionCode:x,...d&&u&&{commitment:u}});return a.createElement(M.Ay,{feature:"Billing::CheckoutModal"},f?a.createElement(a.Fragment,null,a.createElement(s.Flex,{column:!0,gap:4},a.Children.map(o,(e=>(0,a.cloneElement)(e,{recurringIndex:i,setRecurringIndex:c}))),a.createElement(wn,{needsCommitment:d,commitment:u,handleCommitmentChange:g}),a.createElement(bn,null),a.createElement(s.TextInput,{onChange:e=>b(e.target.value),value:h,label:"Billing email",placeholder:"jsmith@example.com"}),a.createElement(bn,null),a.createElement(Cn,{promotionCode:x,onApply:y,error:w}),a.createElement(kn,{currentPlan:r,onCtaClick:t})),a.createElement(aa,{currentPlan:r,onClose:t,price:m,balance:r.balance,commitment:u,email:h,needsCommitment:d,discount:C,promotionCode:x})):a.createElement(s.Flex,null,a.createElement(s.TextBigger,null,"You don't have permissions to change the plan.")))}));var sa=n(21290),ma=n(12602),da=n(49389);const ua=e=>{let{inModal:t,isActive:n,currentPlan:l,slug:r,primary:o,secondary:i,recurringIndex:c}=e;if(!o)return null;const m=(e=>{let{inModal:t,isActive:n,currentPlan:a,slug:l,recurringIndex:r}=e;const{showAnnualPrice:o}=Zn.FJ[l]||{};return t&&o?0==r:!t&&(n?"year"==a.interval&&o:o)})({inModal:t,isActive:n,currentPlan:l,slug:r,recurringIndex:c}),d=(e=>{let{inModal:t,slug:n,currentPlan:a,recurringIndex:l}=e;const{showAnnualPrice:r}=Zn.FJ[n]||{};return"year"==(t?0==l?"year":"month":a.interval)&&!r})({inModal:t,slug:r,currentPlan:l,recurringIndex:c}),u=!!o.amountFlat,g=u?"Price per month":o.amountPerNode?"Price per active node per month for committed usage of nodes for a year":"Price per node per month";return a.createElement(Ue.A,{align:"top",content:g,isBasic:!0,plain:!0,stretch:"align"},a.createElement(s.H0,null,Dn.format((0,fn.ji)(o,i,m)),a.createElement(s.TextSmall,{color:"textLite"},u?null:a.createElement(a.Fragment,null,"/",a.createElement(ue.A,{Component:s.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")),m?"/year":"/month",d?a.createElement(a.Fragment,null," (billed yearly)"):null)))},ga=e=>{let{inModal:t,isActive:n,currentPlan:l,recurringIndex:r,slug:o,primary:i,secondary:c}=e;return a.createElement(s.Flex,{column:!0,gap:2},(0,fn.Kj)(o)?o==Zn.VH.free?a.createElement(s.H0,null,"Free, Forever"):null:a.createElement(ua,{inModal:t,isActive:n,currentPlan:l,slug:o,primary:i,secondary:c,recurringIndex:r}),(null===i||void 0===i?void 0:i.monthlyDiscountPercentagePerNode)&&a.createElement(s.Flex,null,a.createElement(s.Text,null,a.createElement(s.Text,{strong:!0},(0,fn.lb)(100*i.monthlyDiscountPercentagePerNode),"% discount")," ","is applied for annual billing.")))},pa=c.default.div.withConfig({displayName:"pricingDetails__OneLine",componentId:"sc-hbslp4-0"})(["white-space:nowrap white-space:nowrap;"]),Ea=e=>{let{nodesLastPeriod:t,committedNodes:n}=e;const l=t-n,r=l>0;return 0==l?a.createElement(s.TextSmall,null,"You are using all your committed nodes."):r?a.createElement(s.TextSmall,null,"You are using"," ",a.createElement(s.TextSmall,{strong:!0,color:"error"},l," ",(0,da.su)(l).toLowerCase()," more")," ","than your committed nodes."):a.createElement(s.TextSmall,null,"You are using"," ",a.createElement(s.TextSmall,{strong:!0,color:"success"},t," out of ",n)," ","committed ",(0,da.su)(n).toLowerCase(),".")},ha=e=>{let{interval:t,currentPeriodTo:n,committedNodes:l,nodesLastPeriod:r,showPromotion:o,cancelling:i,onCancelPlan:c,commitment:m}=e;const{localeDateString:d}=(0,sa.$j)();return a.createElement(s.Flex,{column:!0,gap:1},!!n&&a.createElement(s.TextSmall,null,a.createElement(s.TextSmall,{strong:!0,"data-testid":"billingPricingDetails-interval"},"Billing ".concat(Zn.rY[t]))," ","(renews ",d(new Date(n),{long:!1}),")"),o&&"month"===t&&a.createElement(ue.A,{onClick:c,disabled:i},a.createElement(pa,null,"Save 25% by changing your billing frequency to yearly")),m?a.createElement(a.Fragment,null,a.createElement(s.TextSmall,null,"Committed Nodes:"," ",a.createElement(s.Text,{strong:!0,"data-testid":"billingPricingDetails-committedNodesNumber"},l)),"number"===typeof r?a.createElement(Ea,{nodesLastPeriod:r,committedNodes:l}):null):null)},ba=e=>{let{features:t,showViewDetails:n}=e;return a.createElement(s.Flex,{column:!0,gap:1},t.map((e=>a.createElement(s.Flex,{gap:2,key:e},a.createElement(s.Box,{width:5},a.createElement(s.Icon,{name:"check",width:"20px",height:"20px",color:"primary"})),a.createElement(s.TextSmall,null,e)))),n&&a.createElement(s.Flex,{gap:2},a.createElement(s.Box,{width:5}),a.createElement(ue.A,{Component:s.Flex,as:Bt.N_,cursor:"pointer",alignItems:"center",gap:1,color:"text",hoverColor:"textFocus",to:"all-plans"},a.createElement(s.Text,{strong:!0},"View full details"),a.createElement(s.Icon,{name:"chevron_right",width:"16px",height:"16px"}))))},fa=(e=>t=>{let{inModal:n,recurringIndex:l,setRecurringIndex:r,...o}=t;return n?a.createElement(s.Flex,{width:"100%",justifyContent:"between",alignItems:"center"},a.createElement(e,o),a.createElement(s.Flex,{gap:3,padding:[0,10]},Zn.HR.map(((e,t)=>a.createElement(s.RadioButton,{key:e,checked:l===t,onChange:()=>r(t),"data-testid":"billingPaidPlans-".concat(e,"-radioButton")},a.createElement(s.Text,{color:"textDescription"},(0,_e.Zr)(Zn.rY[e]))))))):a.createElement(e,o)})((e=>{let{children:t}=e;return a.createElement(s.H3,{"data-testid":"billingPricingDetails-activePlanName"},t)})),va=e=>{var t;let{slug:n,version:l,prices:o,recurringIndex:i=0,setRecurringIndex:c,currentPlan:m={},isActive:d,showAllDetails:u,showTeaserDetails:g,cancelling:p,onCancelPlan:E,title:h,features:b,nodesLastPeriod:f,inModal:v}=e;const{onTrial:x}=(0,Gn.A)(),y=d?m.pricing:(null===(t=o[i])||void 0===t?void 0:t.pricing)||{},C=(0,fn.Kj)(n);return a.createElement(s.Flex,{column:!0,gap:2},a.createElement(s.Flex,{column:!0},a.createElement(s.Flex,{alignItems:"center",gap:2},a.createElement(fa,{inModal:v,recurringIndex:i,setRecurringIndex:c},h),d&&a.createElement(a.Fragment,null,a.createElement(s.Pill,{flavour:"success","data-testid":"active-plan",icon:"checkmark_s"},x?"Trial":"Active"),x&&!u&&a.createElement(ma.A,null,a.createElement(s.TextBig,{color:"primary"},"Upgrade Now!")))),l&&a.createElement(s.TextBig,null,"(",l,")")),u||!d||"free"===n?a.createElement(ga,(0,r.A)({inModal:v,isActive:d,currentPlan:m,recurringIndex:i,slug:n},y)):null,g&&null!==b&&void 0!==b&&b[l]?a.createElement(ba,{features:b[l],showViewDetails:!C}):null,d&&!(0,fn.Kj)(n)&&!x&&a.createElement(ha,(0,r.A)({},m,{showPromotion:!0,cancelling:p,onCancelPlan:E,nodesLastPeriod:f})))},xa=e=>{let{onConfirm:t}=e;const{sendButtonClickedLog:n}=(0,Te.A)(),[l,r]=(0,b.A)(),o=(0,a.useCallback)((()=>{n({feature:"HomelabAcceptTerms"}),t()}),[n]);return a.createElement(s.ConfirmationDialog,{title:"Terms of usage",confirmLabel:"I agree",handleConfirm:o,hideDecline:!0,isConfirmPositive:!0,isConfirmDisabled:!l,message:a.createElement(s.Flex,{column:!0,gap:2},a.createElement(s.Text,null,"You are subscribing the Netdata Homelab plan. By continuing, you acknowledge that you are using Netdata as a homelabber or a student and are not using it for professional or commercial usage."),a.createElement(s.Text,null,"For more details on conditions please check our"," ",a.createElement(ue.A,{href:"https://www.netdata.cloud/fair-usage-policy",rel:"noopener noreferrer",strong:!0,target:"_blank"},"Fair Usage Policy"),"."),a.createElement(s.Flex,null,a.createElement(s.Checkbox,{checked:l,onChange:r,label:"I will NOT use the Homelab plan for professional purposes.",labelPosition:"right",labelProps:{strong:!0,padding:[0,0,0,1]}})),a.createElement(s.Text,null))})};var ya=n(67276),Ca=n(47431),wa=n(93476),Aa=n(66732),Ta=n(97118);const Sa=(0,c.default)(s.Flex).attrs((e=>({padding:[0,2,4,2],background:"mainBackground",width:{min:"280px"},...e}))).withConfig({displayName:"styled__StyledWrapper",componentId:"sc-1gqbztm-0"})(["width:","};height:",";place-self:",";"],(e=>{let{showAllPlans:t,numberOfPlans:n}=e;return t?"calc(100% / ".concat(n+1,")"):"auto"}),(e=>{let{showAllPlans:t}=e;return t?"200px":"auto"}),(e=>{let{showAllPlans:t}=e;return t?"center":"auto"})),Ia=e=>{let{slug:t,version:n,prices:l=[],isSmall:o,isActive:i,currentPlan:c,showAllPlans:m,showTeaserDetails:d,allPlansView:u=!1,nodesLastPeriod:g,numberOfPlans:E,...f}=e;const v=(0,ve.NJ)(),x=(0,h.vt)(),{title:y,features:C}=Zn.FJ[t]||Zn.FJ.free,w=(0,p.JT)("billing:Manage"),{sendLog:A,sendButtonClickedLog:T,isReady:S}=(0,Te.A)(),{onTrial:I}=(0,Gn.A)(),{cancelling:k,startCancelling:F,stopCancelling:P}=(0,pn.og)(),M=(0,a.useCallback)((function(){let{label:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};T({label:e},!0)}),[T,S]),D=(0,fn.z_)({currentPlan:c,slug:t,version:n,onTrial:I}),N=k||i&&(0,fn.Kj)(t)||c.slug==Zn.VH.earlyBird&&t==Zn.VH.free||c.slug==Zn.VH.free&&"2023.02"==c.version&&t==Zn.VH.free&&"2023.11"==n,[B,R]=(0,a.useState)({}),[L,,_,U]=(0,b.A)(),[O,V]=(0,me.A)(),H=(0,pn.M4)(),W="cancel"===B.type&&!(0,fn.Kj)(c.slug)&&!L,j="cancel"===B.type&&t==Zn.VH.free&&"2023.11"==n,{id:Y}=(0,Ta.A)(),q=(0,Ke.ly)(),z=(0,a.useCallback)((()=>{_(),F(),H({productId:Y}).then((()=>{O({header:"Successfully canceled subscription",text:"You are now on Community plan"}),A({isSuccess:!0,description:"cancel-subscription"})})).catch((()=>{V({header:"Failed to cancel the subscription",text:"Remained on ".concat(y," plan")}),A({isFailure:!0,description:"cancel-subscription",error:"Failed to cancel the subscription"})})).finally((()=>{P(),q()}))}),[A,S]),J=(0,a.useMemo)((()=>"user-".concat(v,"-space-").concat(x,"-accept-homelab-terms")),[v,x]),G=(0,a.useCallback)((()=>{localStorage.setItem(J,!0)}),[J]),K=(0,a.useCallback)((()=>"true"==localStorage.getItem(J)),[J]),Z=(0,a.useCallback)((e=>{if(!k&&!N)if(t!=Zn.VH.homelab||c.slug==Zn.VH.homelab||K()){if((0,fn.Kj)(t))return R({type:"cancel"}),void A(e,!0);if((0,fn.Kj)(c.slug))return ae("checkout"),void A(e,!0);ae("update"),A(e,!0)}else R({type:"homelab"})}),[A,S,B,R]),$=(0,a.useCallback)((()=>{R({}),G(),setTimeout((()=>{Z({action:ya.o1.buttonClicked},!0)}),200)}),[R,G,Z]),Q=!!c.billingEmail,X=Q?ia:ca,{billingModalType:ee,billingModalSlug:te}=(0,Pt.PP)(),ne=["checkout","update"].includes(ee)&&t==te,ae=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const n=(0,Pt.PP)();(0,Pt.Z8)({...n,billingModalType:e,billingModalSlug:""==e?e:t})},[le,,re,oe]=(0,b.A)();return a.createElement(Sa,(0,r.A)({column:!0,flex:o,gap:2,justifyContent:"between",showAllPlans:m,numberOfPlans:E,isSmall:o},f),a.createElement(va,{slug:t,prices:l,isActive:i,currentPlan:c,cancelling:k,showAllDetails:m,showTeaserDetails:d,title:y,version:n,features:C,nodesLastPeriod:g,onCancelPlan:()=>Z({action:ya.o1.buttonClicked,label:y})}),!u&&a.createElement(Kt.A,{Component:s.Button,permission:"billing:Manage","data-ga":"upgrade-button::click-".concat(Fn({slug:t}),"::current-").concat(Fn(c),"::billing"),"data-testid":"billingPlan-".concat(t,"-").concat(i?"currentPlan":"upgradeButton"),label:D,flavour:(0,fn.Dy)(null===c||void 0===c?void 0:c.slug,t),disabled:N,width:"100%",onClick:()=>Z({action:ya.o1.buttonClicked,label:D,dataGa:"upgrade-button::click-".concat(Fn({slug:t}),"::current-").concat(Fn(c),"::billing")}),isLoading:k&&i,loadingLabel:"Cancelling"}),!m&&a.createElement(a.Fragment,null,I&&a.createElement(wa.A,{flavour:"billing"}),(I||!(0,fn.Kj)(c.slug))&&a.createElement(s.Flex,{column:!0,gap:4},a.createElement(s.Flex,{gap:6,alignItems:"baseline"},I&&a.createElement(Ca.A,null),!(0,fn.Kj)(c.slug)&&a.createElement(ue.A,{Component:s.Flex,as:Bt.N_,cursor:"pointer",alignItems:"center",gap:1,color:"text",hoverColor:"textFocus",to:"all-plans",padding:[4,0,0],disabled:k,onClick:()=>M({label:w?"Change plan":"View plans"}),"data-testid":"billingPlan-viewMorePlansLink","data-ga":"change-plan::click::billing"},a.createElement("span",null,w?"Change plan":"View plans"),a.createElement(s.Icon,{name:"chevron_right",width:"16px",height:"16px"}))),I&&a.createElement(a.Fragment,null,a.createElement(Aa.A,{flavour:"billing",color:"textLite",onOptOutClick:re}),le&&a.createElement(Jn.A,{onDecline:oe,onCancellingEnd:()=>{}})))),(W||j)&&a.createElement(Kn,{title:y,onConfirm:z,onClose:()=>{U(),R({})}}),"homelab"==B.type?a.createElement(xa,{onConfirm:$}):null,ne&&a.createElement(X,{title:y,onClose:()=>{U(),ae()},prices:l,currentPlan:c,showProrations:Q},a.createElement(va,{slug:t,prices:l,currentPlan:c,title:y,inModal:!0})))},ka=e=>{let{slug:t,isSmall:n,currentPlan:l,showAllPlans:o,allPlansView:i=!1,showTeaserDetails:c,numberOfPlans:m,...d}=e;const{sendButtonClickedLog:u}=(0,Te.A)(),{cancelling:g}=(0,pn.og)(),{features:p}=Zn.FJ.enterprise,E=(0,a.useCallback)((()=>{window.open("https://www.netdata.cloud/contact-us/?subject=on-prem","_blank","noopener,noreferrer"),u({feature:"OnPremContact"})}),[u]);return a.createElement(Sa,(0,r.A)({column:!0,flex:n,gap:2,justifyContent:"between",showAllPlans:o,numberOfPlans:m,isSmall:n},d),a.createElement(s.Flex,{column:!0,gap:2},a.createElement(s.Flex,{column:!0},a.createElement(s.Flex,{alignItems:"center",gap:2},a.createElement(s.H3,{"data-testid":"billingPricingDetails-activePlanName"},"Enterprise On-Premise"))),a.createElement(s.H0,null,Dn.format(3),a.createElement(s.TextSmall,{color:"textLite"},"/",a.createElement(ue.A,{Component:s.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 (billed yearly)")),c&&a.createElement(ba,{features:p[2023.11]||[]})),!i&&a.createElement(Kt.A,{Component:s.Button,permission:"billing:Manage","data-ga":"upgrade-button::click-".concat(Fn({slug:t}),"::current-").concat(Fn(l),"::billing"),"data-testid":"billingPlan-".concat(t,"-upgradeButton"),label:"Contact us",flavour:"hollow",disabled:g,width:"100%",onClick:E}))},Fa=e=>{let{plans:t,isSmall:n,currentPlan:l,showAllPlans:r,showTeaserDetails:o,numberOfPlans:i}=e;return a.createElement(a.Fragment,null,Zn.tD.map((e=>(Object.entries(t[e]||{})||[]).map((t=>{let[c,s]=t;return a.createElement(Ia,{key:"".concat(e,"-").concat(c),slug:e,version:c,prices:s,isActive:l.slug==e&&l.version==c,isSmall:n,currentPlan:l,showAllPlans:r,showTeaserDetails:o,numberOfPlans:i})})))),a.createElement(ka,{slug:"enterprise",isSmall:n,currentPlan:l,showAllPlans:r,showTeaserDetails:o,numberOfPlans:i}))},Pa=c.default.div.withConfig({displayName:"styled__Container",componentId:"sc-1oa2kv1-0"})(["display:grid;background:",";"," ",""],(0,s.getColor)("mainBackground"),(e=>{let{sticky:t}=e;return t?"position:sticky;top:0;":""}),(e=>{let{numberOfPlans:t,showAllPlans:n}=e;const a=[n?"200px":"minmax(280px, 1fr)",...Array(t).fill("minmax(280px, 1.5fr)")];return"grid-template-columns: ".concat(a.join(" "),";")})),Ma=c.default.div.withConfig({displayName:"styled__Header",componentId:"sc-1oa2kv1-1"})(["display:contents;> *{background:",";border-bottom:1px solid ",";}"],(0,s.getColor)("panelBg"),(0,s.getColor)("placeholder")),Da=(0,c.default)(s.Collapsible).withConfig({displayName:"styled__Content",componentId:"sc-1oa2kv1-2"})(["display:contents;"]),Na=()=>{const{loaded:e,value:t}=(0,pn.lU)(),n=(0,fn.LJ)(t);return e?n:0},Ba=e=>{var t,n,l,r;let{isSmall:o,plans:i,currentPlan:c,showAllPlans:m=!1,showTeaserDetails:d=!1,showPricingColumn:u}=e;const g="earlyBird"===c.slug,p="pro"===c.slug,E=Na(),{version:h}=(0,Ta.A)(),b=null===(t=(null===(n=i.free)||void 0===n?void 0:n[null===c||void 0===c?void 0:c.version])||(null===(l=i.free)||void 0===l?void 0:l[h]))||void 0===t?void 0:t[0],f=i.earlyBird?null===(r=Object.values(i.earlyBird)[0])||void 0===r?void 0:r[0]:{};return a.createElement(Pa,{numberOfPlans:E,showAllPlans:m,sticky:!0},u?a.createElement(s.Flex,{column:!0,height:50,justifyContent:"center"},a.createElement(s.Text,{strong:!0},"Pricing")):null,g?a.createElement(Ia,{slug:"earlyBird",version:null===f||void 0===f?void 0:f.version,prices:null===f||void 0===f?void 0:f.prices,isSmall:o,isActive:"earlyBird"===c.slug,currentPlan:c,showAllPlans:m,numberOfPlans:E}):a.createElement(Ia,{slug:"free",version:null===b||void 0===b?void 0:b.version,prices:null===b||void 0===b?void 0:b.prices,isSmall:o,isActive:"free"===c.slug&&c.version==(null===b||void 0===b?void 0:b.version),currentPlan:c,showAllPlans:m,showTeaserDetails:d,numberOfPlans:E}),a.createElement(Fa,{plans:i,isSmall:o,currentPlan:c,showAllPlans:m,showTeaserDetails:d,isPro:p,numberOfPlans:E}))},Ra=e=>{let{children:t,...n}=e;return a.createElement(s.Flex,(0,r.A)({alignItems:"center",gap:2},n),t)},La=()=>a.createElement(s.Flex,{column:!0,gap:2,width:65},a.createElement(s.TextMicro,null,a.createElement(s.TextMicro,{strong:!0},"Available credit")," for you to use on any plan subscriptions with us."),a.createElement(s.TextMicro,null,"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.")),_a=e=>{let{currentPlan:t}=e;const[n,l]=(0,pn.Qh)(),r=!!t.billingEmail&&!l,o=(0,p.JT)("billing:ReadAll");return a.createElement(s.Flex,{column:!0,gap:2},a.createElement(s.H3,null,"Plan & Billing"),o&&a.createElement(a.Fragment,null,a.createElement(Ra,null,a.createElement(s.Flex,{gap:1,alignItems:"center"},a.createElement(s.Text,null,"Credit:"),a.createElement(s.Text,{"data-testid":"billingHeader-credits",strong:!0},Dn.format(t.balance.amount||0)),a.createElement(Ue.A,{content:La,align:"bottom",isBasic:!0},a.createElement(s.Icon,{name:"information",width:"16px",height:"16px",color:"textLite"}))),a.createElement(hn,null),a.createElement(s.Text,null,"Billing email:"," ",a.createElement(s.Text,{strong:!0,"data-testid":"billingHeader-email"},t.billingEmail||"-")),a.createElement(hn,null),a.createElement(ue.A,{Component:s.Flex,cursor:r?"pointer":"default",disabled:!r,onClick:n,alignItems:"center",gap:1,"data-ga":"billing-options::click::billing","data-testid":"billingHeader-goToPortal"},a.createElement("span",null,"Billing options and Invoices"),a.createElement(s.Icon,{name:"nav_arrow_goto",width:"12px",height:"12px"}))),a.createElement(hn,{height:1,width:"100%",sx:{borderWidth:"1px 0px 0px 0px",borderColor:"borderSecondary",borderStyle:"solid"}})))};n(34504),n(78898);function Ua(){const e=new Date,t=e.getFullYear(),n=e.getMonth(),a=e.getDate(),l=new Date(0);return l.setFullYear(t,n,a-1),l.setHours(23,59,59,999),l}var Oa=n(51730),Va=n(13999);function Ha(e,t){return(0,Va.f)(e,-t)}var Wa=n(4883);function ja(e,t){return(0,Wa.P)(e,-t)}var Ya=n(35840);function qa(e,t){const{years:n=0,months:a=0,weeks:l=0,days:r=0,hours:o=0,minutes:i=0,seconds:c=0}=t,s=Ha(ja(e,a+12*n),r+7*l),m=1e3*(c+60*(i+60*o));return(0,Ya.w)(e,s.getTime()-m)}var za=n(71600),Ja=n(66118),Ga=n(51891),Ka=n(44731),Za=n(99851),$a=n(24266),Qa=n(27467),Xa=n(36712);const el={nodes:1,p90:2,committed_nodes:3},tl={"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."};Ja.t1.register(Ja.kc,Ja.PP,Ja.E8,Ja.FN,Ja.No,Ja.s$,Ja.m_,Ja.ZT,Ja.A6,Ga.A),Ja.m_.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})};const nl=e=>({nodes:{label:"Daily count",type:"bar",color:(0,s.getColor)("text")({theme:e}),backgroundColor:(0,s.getColor)("primary")({theme:e}),borderColor:(0,s.getColor)("primary")({theme:e}),borderWidth:2,pointStyle:"rectangle",usePointStyle:!0},p90:{label:"Period count",type:"line",color:(0,s.getColor)("text")({theme:e}),borderColor:(0,s.getColor)(["purple","lilac"])({theme:e}),borderWidth:2,fill:!1,stepped:!0},committed_nodes:{label:"Committed nodes",type:"line",color:(0,s.getColor)("text")({theme:e}),borderColor:(0,s.getColor)(["blue","aquamarine"])({theme:e}),borderWidth:2,fill:!1,borderDash:[1,2],borderDashOffset:1,pointStyle:!1}}),al={border:{side:"all",color:"inputBorder",padding:[3]},round:!0},ll=Ua(),rl=(0,Oa.o)(qa(ll,{months:1})),ol=e=>{let{onNodesLastPeriodFetch:t}=e;const n=(0,Qa.rW)("offset"),l=(0,h.vt)(),[r,o]=(0,a.useState)((()=>({start:rl,end:ll}))),[i,m,d]=(0,Et.A)((()=>({enabled:!!l&&!!r.start&&!!r.end,fetch:()=>(0,Xa.U2)(l,{after:Math.floor((0,za.W)((0,sa.ii)(r.start,n))/1e3),before:Math.floor((0,za.W)((0,sa.ii)(r.end,n))/1e3)}),initialValue:{labels:[],data:[]},onSuccess:e=>{let{data:n,labels:a}=e;if(!n.length)return;const l=n.at(-1),r=l[a.indexOf("nodes")],o=l[a.indexOf("timestamp")];t((e=>e.timestamp>o?e:{timestamp:o,value:r}))}})),[l,r,t]),u=(0,a.useContext)(c.ThemeContext),g=(0,a.useMemo)((()=>{const e=i.data.map((e=>{let[t]=e;return t})),t=i.labels.reduce(((t,n,a)=>a?[{...nl(u)[n],data:e.map(((e,t)=>i.data[t][a])),order:el[n]},...t]:t),[]);return{labels:e,datasets:t}}),[i]),[p,E]=function(e){let{data:t,annotations:n=[]}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{localeDateString:l}=(0,sa.$j)(),r=(0,a.useRef)(!1),o=(0,a.useRef)(),i=(0,a.useMemo)((()=>({interaction:{axis:"x"},plugins:{legend:{position:"bottom",align:"start",onClick:(e,t,n)=>{const a=n.legendItems.findIndex((e=>e.text===t.text));n.chart.isDatasetVisible(a)?n.chart.hide(a):n.chart.show(a)},labels:{generateLabels:e=>e.data.datasets.map(((t,n)=>({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(((e,t)=>e.order-t.order)),usePointStyle:!0},onHover:function(e,t){!r.current&&o.current&&(r.current=!0,o.current.innerHTML=tl[t.text],o.current.style.left=e.x+"px",o.current.style.top=e.y+"px",o.current.style.visibility="visible",o.current.style.transform="translateY(-100%)")},onLeave:function(){o.current&&(r.current=!1,o.current.innerHTML="",o.current.style.visibility="hidden")}},tooltip:{enabled:!0,mode:"nearest",intersect:!1,yAlign:"bottom",usePointStyle:!0,position:"follow",backgroundColor:(0,s.getColor)("tooltip")({theme:e}),color:(0,s.getColor)("tooltipText")({theme:e}),callbacks:{title:e=>{const[t]=e;return t?l(1e3*t.label,{month:"2-digit",day:"2-digit",year:"numeric",long:!1,dateStyle:void 0}):""},labelPointStyle:e=>({pointStyle:"Total Nodes"===e.dataset.label?"rect":"line"}),label:e=>"  ".concat(e.formattedValue," ").concat(e.dataset.label||"")}},annotation:{annotations:n.reduce(((n,a,l)=>({...n,["annotation".concat(l)]:{type:"line",value:t.findIndex((e=>e[0]===a.timestamp)),borderColor:(0,s.getRgbColor)("attention",.3)({theme:e}),borderDashOffset:0,borderWidth:10,drawTime:"afterDatasetsDraw",label:{drawTime:"afterDatasetsDraw",display:!1,backgroundColor:(0,s.getRgbColor)("attention",.8)({theme:e}),borderWidth:0,color:"white",content:a.name,textAlign:"center"},scaleID:"x",enter(e,t){const n=e.chart,a=n.options.plugins.annotation.annotations["annotation".concat(l)];a.label.display=!0,a.label.position=t.y/e.chart.chartArea.height>.5?"start":"end",n.update()},leave(e){const t=e.chart;t.options.plugins.annotation.annotations["annotation".concat(l)].label.display=!1,t.update()}}})),{})}},responsive:!0,maintainAspectRatio:!1,scales:{x:{ticks:{callback:function(e){return l(1e3*this.getLabelForValue(e),{month:"2-digit",day:"2-digit",year:"numeric",long:!1,dateStyle:void 0})},color:(0,s.getColor)("textLite")({theme:e})}},y:{beginAtZero:!0,ticks:{color:(0,s.getColor)("textLite")({theme:e})}}}})),[e,t]);return[i,o]}(u,i);return a.createElement(s.Flex,{column:!0,gap:4},a.createElement(s.Flex,{alignItems:"center",justifyContent:"between"},a.createElement(s.H3,null,"Usage"),a.createElement(Za.A,{values:r,utc:n,onChange:o,tagging:"billing-usage",isPlaying:!1,onlyDates:!0,accessorProps:al,padding:[4,0],width:"auto",maxDate:ll})),a.createElement(s.Flex,{position:"relative",height:90},m?a.createElement(Rt.A,{title:"Loading billing data..."}):d?a.createElement($a.H4,{title:"Chart couldn't be loaded"}):a.createElement(Ka.t1,{type:"bar",data:g,options:p}),a.createElement(s.Flex,{ref:E,background:"main",color:"generic",position:"absolute",round:!0,padding:[3],width:{max:75},sx:{visibility:"hidden"},onMouseOver:()=>E.current.style.visibility="hidden"})))},il=e=>{let{isSmall:t,currentPlan:n,loaded:l,currentLoaded:r,plans:o}=e;const[i,c]=(0,a.useState)({timestamp:null,value:null}),s=o[n.slug]?o[n.slug][n.version]:[];return a.createElement(a.Fragment,null,a.createElement(_a,{currentPlan:n}),l&&r?a.createElement(a.Fragment,null,(0,fn.Kj)(n.slug)?a.createElement(Ba,{isSmall:t,plans:o,currentPlan:n,showTeaserDetails:!0}):a.createElement(Ia,{slug:n.slug,version:n.version,prices:s,width:t?"auto":120,padding:[0],height:"auto",isSmall:t,isActive:!0,currentPlan:n,allPlansView:!0,nodesLastPeriod:i.value}),a.createElement(hn,{height:1,width:"100%",sx:{borderWidth:"1px 0px 0px 0px",borderColor:"borderSecondary",borderStyle:"solid"}}),a.createElement(ol,{onNodesLastPeriodFetch:c})):a.createElement(Rt.A,{title:l?"Loading billing info...":"Loading Netdata plans..."}))};var cl=n(71847);const sl={year:"Yearly",month:"Monthly"},ml=e=>{var t;let{currentPlan:n}=e;const l=(0,h.bq)(),[r,o]=(0,pn.Qh)(),{cancelling:i,startCancelling:c,stopCancelling:m}=(0,pn.og)(),d=!!n.billingEmail&&!o,[u,g]=(0,b.A)(),[E,f]=(0,me.A)(),v=(0,pn.M4)(),{title:x}=Zn.FJ[n.slug]||Zn.FJ.free,{id:y}=(0,Ta.A)(),C=(0,p.JT)("billing:Manage"),w=(0,p.JT)("billing:ReadAll"),{title:A}=Zn.FJ[null===n||void 0===n?void 0:n.slug]||Zn.FJ.free,T=sl[null===n||void 0===n?void 0:n.interval];return a.createElement(s.Flex,{column:!0,gap:2},a.createElement(s.Flex,{gap:2,alignItems:"center"},a.createElement(ue.A,{as:Bt.N_,to:"/spaces/".concat(l,"/settings/billing"),disabled:i,color:"text",hoverColor:"textLite",showToolTip:!0,content:"Back to Plan & Billing",align:"bottom",isBasic:!0},a.createElement(s.Icon,{name:"arrow_left",width:"20px",height:"20px",margin:[1.5,0,0]})),a.createElement(s.H3,null,"All Plans")),a.createElement(Ra,null,a.createElement(s.Flex,{gap:1,alignItems:"center"},a.createElement(s.Text,null,"Active plan:"),a.createElement(s.Text,{strong:!0},A)),a.createElement(hn,null),T&&a.createElement(a.Fragment,null,a.createElement(s.Flex,{gap:1,alignItems:"center"},a.createElement(s.Text,null,"Billing frequency:"),a.createElement(s.Text,{strong:!0},T)),a.createElement(hn,null)),n.commitment?a.createElement(s.Flex,{gap:1,alignItems:"center"},a.createElement(s.Text,null,"Committed Nodes:"),a.createElement(s.Text,{strong:!0},(null===n||void 0===n?void 0:n.committedNodes)||0)):null,a.createElement(hn,null),w&&a.createElement(a.Fragment,null,a.createElement(s.Flex,{gap:1,alignItems:"center"},a.createElement(s.Text,null,"Credit:"),a.createElement(s.Text,{strong:!0},Dn.format((null===n||void 0===n||null===(t=n.balance)||void 0===t?void 0:t.amount)||0)),a.createElement(Ue.A,{content:La,align:"bottom",isBasic:!0},a.createElement(s.Icon,{name:"information",width:"16px",height:"16px",color:"textLite"}))),a.createElement(hn,null),a.createElement(s.Flex,{gap:1,alignItems:"center"},a.createElement(s.Text,null,"Billing email:"),a.createElement(s.Text,{strong:!0},(null===n||void 0===n?void 0:n.billingEmail)||"-")),a.createElement(hn,null)),a.createElement(ue.A,{Component:s.Flex,cursor:d?"pointer":"default",disabled:!d,onClick:r,alignItems:"center",gap:1},a.createElement("span",null,"Billing options and Invoices"),a.createElement(s.Icon,{name:"nav_arrow_goto",width:"12px",height:"12px"})),!(0,fn.Kj)(null===n||void 0===n?void 0:n.slug)&&a.createElement(a.Fragment,null,a.createElement(hn,null),a.createElement(ue.A,{Component:s.Flex,cursor:"pointer",onClick:g,alignItems:"center",gap:1,disabled:i||!C,"data-ga":"cancel-plan::click::billing"},a.createElement(s.Text,{textDecoration:"underline"},i?"Canceling plan...":"Cancel plan")))),a.createElement(hn,{height:1,width:"100%",sx:{borderWidth:"1px 0px 0px 0px",borderColor:"borderSecondary",borderStyle:"solid"}}),u&&a.createElement(Kn,{title:"Community",onConfirm:()=>{c(),v({productId:y}).then((()=>((0,cl.H)("billing","cancel-plan","global-view",{slug:null===n||void 0===n?void 0:n.slug,interval:null===n||void 0===n?void 0:n.interval,success:!0}),E({header:"Successfully canceled subscription",text:"You are now on Community plan"})))).catch((()=>((0,cl.H)("billing","cancel-plan","global-view",{slug:null===n||void 0===n?void 0:n.slug,interval:null===n||void 0===n?void 0:n.interval,success:!1}),f({header:"Failed to cancel the subscription",text:"Remained on ".concat(x," plan")})))).finally((()=>{m()}))},onClose:g}))},dl=()=>a.createElement(s.Icon,{name:"check",color:"primary"}),ul=()=>a.createElement(s.Icon,{name:"checkmark_partial_s",color:"textLite"}),gl=()=>a.createElement(s.Icon,{name:"chevron_down_thin",color:"text"}),pl=()=>a.createElement(s.Icon,{name:"chevron_up_thin",color:"text"}),El=e=>{let{center:t,end:n,...l}=e;return a.createElement(s.Flex,{alignItems:"center",justifyContent:t?"center":n?"end":"start",padding:[2]},a.createElement(s.Text,(0,r.A)({},t?{textAlign:"center"}:{},l)))},hl=e=>{let{children:t,...n}=e;return a.createElement(El,(0,r.A)({center:!0},n),t?a.createElement(s.Flex,{alignItems:"center",gap:2},t,a.createElement(dl,null)):a.createElement(dl,null))},bl=e=>a.createElement(El,(0,r.A)({center:!0},e),"UNLIMITED"),fl=e=>a.createElement(El,(0,r.A)({center:!0},e),a.createElement(ul,null)),vl=e=>a.createElement(El,(0,r.A)({center:!0},e),"SOON"),xl=e=>t=>{const{index:n,title:l="",showAllPlans:r,onToggle:o,collapsed:i}=t,c=Na();return a.createElement(Pa,{numberOfPlans:c,showAllPlans:r},a.createElement(Ma,{onClick:()=>o(n)},a.createElement(El,{strong:!0},l),Array.from(Array(c-1).keys()).map((e=>a.createElement(El,{key:e}))),a.createElement(El,{end:!0},i[n]?a.createElement(pl,null):a.createElement(gl,null))),a.createElement(Da,{open:!i[n]},a.createElement(e,t)))},yl=(0,a.memo)(xl((e=>{let{isPro:t}=e;return a.createElement(a.Fragment,null,a.createElement(El,null,"Scalability"),a.createElement(El,{center:!0},"Vertical and Horizontal"),a.createElement(El,{center:!0},"Vertical and Horizontal"),t&&a.createElement(El,{center:!0},"Vertical and Horizontal"),a.createElement(El,{center:!0},"Vertical and Horizontal"),a.createElement(El,{center:!0},"Vertical and Horizontal"),a.createElement(El,null,"High Availability"),a.createElement(hl,null),a.createElement(hl,null),t&&a.createElement(hl,null),a.createElement(hl,null),a.createElement(hl,null),a.createElement(El,null,"Data Retention"),a.createElement(bl,null),a.createElement(bl,null),t&&a.createElement(bl,null),a.createElement(bl,null),a.createElement(bl,null),a.createElement(El,null,"Data Privacy"),a.createElement(El,{center:!0},"Data stored On-Prem and visualized on Netdata Cloud"),a.createElement(El,{center:!0},"Data stored On-Prem and visualized on Netdata Cloud"),t&&a.createElement(El,{center:!0},"Data stored On-Prem and visualized on Netdata Cloud"),a.createElement(El,{center:!0},"Data stored On-Prem and visualized on Netdata Cloud"),a.createElement(El,{center:!0},"Data stored and visualized On-Prem"),a.createElement(El,null,"Configuration"),a.createElement(El,{center:!0},"Manual, IaC or in App(UI)"),a.createElement(El,{center:!0},"Manual, IaC or in App(UI)"),t&&a.createElement(El,{center:!0},"Manual, IaC or in App(UI)"),a.createElement(El,{center:!0},"Manual, IaC or in App(UI)"),a.createElement(El,{center:!0},"Manual, IaC or in App(UI)"))}))),Cl=(0,a.memo)(xl((e=>{let{isPro:t,freePlanLimitattions:n}=e;return a.createElement(a.Fragment,null,a.createElement(El,null,"Customizable charts"),a.createElement(hl,null),a.createElement(hl,null),t&&a.createElement(hl,null),a.createElement(hl,null),a.createElement(hl,null),a.createElement(El,null,"Infrastructure wide Dashboards"),a.createElement(hl,null),a.createElement(hl,null),t&&a.createElement(hl,null),a.createElement(hl,null),a.createElement(hl,null),a.createElement(El,null,"Centralized Alerts Management"),a.createElement(hl,null),a.createElement(hl,null),t&&a.createElement(hl,null),a.createElement(hl,null),a.createElement(hl,null),a.createElement(El,null,"Infrastructure Organization (Rooms)"),a.createElement(hl,null),a.createElement(hl,null),t&&a.createElement(hl,null),a.createElement(hl,null),a.createElement(hl,null),a.createElement(El,null,"Custom Dashboards"),a.createElement(hl,null,null!==n&&void 0!==n&&n.maxDashboards?a.createElement(s.Text,null,"(Limited to ",n.maxDashboards," per Room)"):null),a.createElement(hl,null),t&&a.createElement(hl,null),a.createElement(hl,null),a.createElement(hl,null),a.createElement(El,null,"Access dashboards from anywhere in the world"),a.createElement(hl,null),a.createElement(hl,null),t&&a.createElement(hl,null),a.createElement(hl,null),a.createElement(hl,null),a.createElement(El,null,"Role Based Access Control (RBAC)"),a.createElement(hl,null),a.createElement(hl,null),t&&a.createElement(hl,null),a.createElement(hl,null),a.createElement(hl,null),a.createElement(El,null,"Auditing"),a.createElement(hl,null),a.createElement(hl,null),t&&a.createElement(hl,null),a.createElement(hl,null),a.createElement(hl,null),a.createElement(El,null,"Invite Team Members"),a.createElement(hl,null),a.createElement(hl,null),t&&a.createElement(hl,null),a.createElement(hl,null),a.createElement(hl,null),a.createElement(El,null,"Functions"),a.createElement(hl,null),a.createElement(hl,null),t&&a.createElement(hl,null),a.createElement(hl,null),a.createElement(hl,null),a.createElement(El,null,"Netdata Assistant"),a.createElement(hl,null),a.createElement(hl,null),t&&a.createElement(hl,null),a.createElement(hl,null),a.createElement(hl,null),a.createElement(El,null,"Mobile App"),a.createElement(fl,null),a.createElement(hl,null),t&&a.createElement(hl,null),a.createElement(hl,null),a.createElement(fl,null),a.createElement(El,null,"Centralized Management of Integrations"),a.createElement(vl,null),a.createElement(vl,null),t&&a.createElement(vl,null),a.createElement(vl,null),a.createElement(vl,null))}))),wl=(0,a.memo)(xl((e=>{let{isPro:t,freePlanLimitattions:n}=e;return a.createElement(a.Fragment,null,a.createElement(El,null,"Active Connected Nodes"),null!==n&&void 0!==n&&n.maxNodes?a.createElement(El,{center:!0},"Max of ",n.maxNodes):a.createElement(bl,null),a.createElement(bl,null),t&&a.createElement(bl,null),a.createElement(bl,null),a.createElement(bl,null),a.createElement(El,null,"Active Custom Dashboards"),null!==n&&void 0!==n&&n.maxDashboards?a.createElement(El,{center:!0},"Max of ",n.maxDashboards," per Room"):a.createElement(bl,null),a.createElement(bl,null),t&&a.createElement(bl,null),a.createElement(bl,null),a.createElement(bl,null),a.createElement(El,null,"Infrastructure metrics"),a.createElement(bl,null),a.createElement(bl,null),t&&a.createElement(bl,null),a.createElement(bl,null),a.createElement(bl,null),a.createElement(El,null,"APM metrics"),a.createElement(bl,null),a.createElement(bl,null),t&&a.createElement(bl,null),a.createElement(bl,null),a.createElement(bl,null),a.createElement(El,null,"Custom metrics"),a.createElement(bl,null),a.createElement(bl,null),t&&a.createElement(bl,null),a.createElement(bl,null),a.createElement(bl,null),a.createElement(El,null,"Synthetic checks"),a.createElement(bl,null),a.createElement(bl,null),t&&a.createElement(bl,null),a.createElement(bl,null),a.createElement(bl,null),a.createElement(El,null,"Monitor system journal logs"),a.createElement(bl,null),a.createElement(bl,null),t&&a.createElement(bl,null),a.createElement(bl,null),a.createElement(bl,null),a.createElement(El,null,"Auditing Events"),a.createElement(El,{center:!0},"4 hours"),a.createElement(El,{center:!0},"90 days"),t&&a.createElement(El,{center:!0},"7 days"),a.createElement(El,{center:!0},"90 days"),a.createElement(El,{center:!0},"As required"),a.createElement(El,null,"Topology Events"),a.createElement(El,{center:!0},"4 hours"),a.createElement(El,{center:!0},"14 days"),t&&a.createElement(El,{center:!0},"7 days"),a.createElement(El,{center:!0},"14 days"),a.createElement(El,{center:!0},"As required"),a.createElement(El,null,"Alert Events"),a.createElement(El,{center:!0},"4 hours"),a.createElement(El,{center:!0},"60 days"),t&&a.createElement(El,{center:!0},"7 days"),a.createElement(El,{center:!0},"60 days"),a.createElement(El,{center:!0},"As required"),a.createElement(El,null,"Alert Notification Integrations"),a.createElement(El,{center:!0},"Email, Discord"),a.createElement(El,{center:!0},"Email, Discord, Webhook, Mattermost, Opsgenie, PagerDuty, RocketChat, Slack, and more"),t&&a.createElement(El,{center:!0},"Email, Discord, Webhook"),a.createElement(El,{center:!0},"Email, Discord, Webhook, Mattermost, Opsgenie, PagerDuty, RocketChat, Slack, and more"),a.createElement(El,{center:!0},a.createElement(s.Text,null,"Same as Business plan"),a.createElement("br",null),a.createElement(s.TextSmall,null,"(Custom requests can be handled)")),a.createElement(El,null,"User Administration"),a.createElement(El,{center:!0},"Basic"),a.createElement(El,{center:!0},"Advanced"),t&&a.createElement(El,{center:!0},"Intermediate"),a.createElement(El,{center:!0},"Advanced"),a.createElement(El,{center:!0},"Advanced"))}))),Al=(0,a.memo)(xl((e=>{let{isEarlyBird:t,isPro:n}=e;return a.createElement(a.Fragment,null,a.createElement(El,null,a.createElement(s.Text,{id:"administrators"},"Administrators"),a.createElement("br",null),a.createElement(s.TextSmall,{color:"textDescription",id:"same-as-managers-but-unable-to-manage-users-or-rooms"},"Users with this role can control Spaces, War Rooms, Nodes, Users and Billing. They can also access any Room in the Space.")),a.createElement(hl,null),a.createElement(hl,null),n&&a.createElement(hl,null),a.createElement(hl,null),a.createElement(hl,null),a.createElement(El,null,a.createElement(s.Text,{id:"troubleshooters"},"Troubleshooters"),a.createElement("br",null),a.createElement(s.TextSmall,{color:"textDescription"},"Users with this role can use Netdata to troubleshoot, not manage entities. They can access any Room in the Space.")),a.createElement(fl,null),a.createElement(hl,null),n&&a.createElement(hl,null),a.createElement(hl,null),a.createElement(hl,null),a.createElement(El,null,a.createElement(s.Text,{id:"managers"},"Managers"),a.createElement("br",null),a.createElement(s.TextSmall,{color:"textDescription"},"Users with this role can manage Rooms and Users. They can access any Room in the Space.")),a.createElement(fl,null),a.createElement(hl,null),n&&a.createElement(fl,null),a.createElement(hl,null),a.createElement(hl,null),a.createElement(El,null,a.createElement(s.Text,{id:"observers"},"Observers"),a.createElement("br",null),a.createElement(s.TextSmall,{color:"textDescription"},"Users with this role can only view data in specific Rooms.")),a.createElement(fl,null),a.createElement(hl,null),n&&a.createElement(fl,null),a.createElement(hl,null),a.createElement(hl,null),a.createElement(El,null,a.createElement(s.Text,{id:"billing"},"Billing"),a.createElement("br",null),a.createElement(s.TextSmall,{color:"textDescription"},"Users with this role can handle billing options and invoices.")),a.createElement(fl,null),a.createElement(hl,null),n&&a.createElement(fl,null),a.createElement(hl,null),a.createElement(hl,null),a.createElement(El,null,a.createElement(s.Text,{id:"billing"},"Member"),a.createElement("br",null),a.createElement(s.TextSmall,{color:"textDescription"},"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.")),t?a.createElement(hl,null):a.createElement(fl,null),a.createElement(fl,null),n&&a.createElement(fl,null),a.createElement(fl,null),a.createElement(fl,null))}))),Tl=(0,a.memo)(xl((e=>{let{isPro:t}=e;return a.createElement(a.Fragment,null,a.createElement(El,null,"Service Availability"),a.createElement(El,{center:!0},"Best Effort (99.5% in last 12 months)"),a.createElement(El,{center:!0},"Best Effort (99.5% in last 12 months)"),t&&a.createElement(El,{center:!0},"Best Effort (99.5% in last 12 months)"),a.createElement(El,{center:!0},"99.9% annually (excl. scheduled maintenance)"),a.createElement(El,{center:!0},"Same as Business plan"),a.createElement(El,null,"Technical Support"),a.createElement(El,{center:!0},"Public Forums, Tickets & Chat"),a.createElement(El,{center:!0},"Public Forums, Tickets & Chat"),t&&a.createElement(El,{center:!0},"Public Forums, Tickets & Chat"),a.createElement(El,{center:!0},a.createElement(s.Text,null,"Public Forums, Tickets & Chat"),a.createElement("br",null),a.createElement(s.Text,{color:"textDescription"},"Need Premium Support?"," ",a.createElement(ue.A,{Component:s.Text,href:"https://www.netdata.cloud/contact-us/?subject=custom-support-requirements",target:"_blank",rel:"noopener noreferrer"},"Reach out to us"))),a.createElement(El,{center:!0},"Custom Design to Meet Requirements"),a.createElement(El,null,"Initial Deployment Consulting Services"),a.createElement(El,{center:!0},"Public Forums, Tickets & Chat"),a.createElement(El,{center:!0},"Public Forums, Tickets & Chat"),t&&a.createElement(El,{center:!0},"Public Forums, Tickets & Chat"),a.createElement(El,{center:!0},"Public Forums, Tickets & Chat"),a.createElement(El,{center:!0},"Remote or On Site Consultation and Training During Deployment"))}))),Sl=e=>{var t;let{plans:n,currentPlan:l}=e;const o="free"==(null===l||void 0===l?void 0:l.slug)&&"2023.02"==(null===l||void 0===l?void 0:l.version),i="earlyBird"===(null===l||void 0===l?void 0:l.slug),c="pro"===(null===l||void 0===l?void 0:l.slug),m=null===(t=Object.values((null===n||void 0===n?void 0:n.free)||{}))||void 0===t||null===(t=t[0])||void 0===t||null===(t=t[0])||void 0===t?void 0:t.planLimitations,[d,u]=(0,a.useState)((()=>[!1,!0,!0,!0,!0])),g={isOldCommunity:o,isEarlyBird:i,isPro:c,freePlanLimitattions:m,showAllPlans:!0,onToggle:e=>u((t=>(t[e]=!t[e],[...t]))),collapsed:d};return a.createElement(s.Flex,{column:!0,gap:5,height:"100%"},a.createElement(yl,(0,r.A)({title:"General",index:0},g)),a.createElement(Cl,(0,r.A)({title:"Features",index:1},g)),a.createElement(wl,(0,r.A)({title:"Usage Allowances",index:2},g)),a.createElement(Al,(0,r.A)({title:"User Roles",index:3},g)),a.createElement(Tl,(0,r.A)({title:"Support",index:4},g)))},Il=e=>{let{plans:t,loaded:n,currentLoaded:l,currentPlan:r}=e;return a.createElement(s.Flex,{column:!0,height:"100%",gap:3},a.createElement(ml,{currentPlan:r}),n&&l?a.createElement(s.Flex,{overflow:"auto",column:!0,gap:5,height:"100%",padding:[0,0,20,0]},a.createElement(Ba,{plans:t,currentPlan:r,showAllPlans:!0,showPricingColumn:!0}),a.createElement(Sl,{plans:t,currentPlan:r})):a.createElement(Rt.A,{title:n?"Loading billing info...":"Loading Netdata plans..."}))},kl={Community:0,Pro:1,Business:2},Fl={month:"Monthly",year:"Yearly"},Pl=()=>{const[e,t]=(0,Bt.ok)(),[n,l]=(0,me.A)();(0,a.useEffect)((()=>{const a=e.get("from"),r=e.get("from_committed_nodes"),o=e.get("interval"),i=e.get("result"),c=e.get("to"),s=e.get("to_committed_nodes"),m=e.get("from_trial");if(i){const d="success"==i,u={from:a,fromNodes:r,interval:o,to:c,toNodes:s,fromTrial:m,success:d};(d?n:l)((e=>{let{from:t,to:n,fromNodes:a,toNodes:l,interval:r,fromTrial:o,success:i=!0}=e;if(o)return{header:i?"Successful upgrade":"Failed to upgrade",text:i?"You have successfully upgraded your plan":"Something went wrong"};const c=Fl[r]||r;if(t===n&&a===l)return{header:i?"Successful billing cycle change":"Failed to update billing cycle",text:i?"Subscription billing cycle changed to ".concat(c):"Subscription is still on ".concat(c," billing cycle")};if(t===n)return{header:i?"Successful change of commitment":"Failed to change the commitment",text:i?"Commitment ".concat(a<l?"increased":"decreased"," from ").concat(a," to ").concat(l," nodes"):"Commitment remained the same, ".concat(a," nodes")};const s=kl[t]>kl[n];return{header:i?"Successfully ".concat(s?"downgraded":"upgraded"," plan"):"Failed to ".concat(s?"downgrade":"upgrade"," plan"),text:i?"Subsrciprion ".concat(s?"downgraded":"upgraded"," from ").concat(t," to ").concat(n," plan (").concat(c,")"):"Remained on ".concat(t," plan")}})(u)),(0,cl.H)("billing","callback","global-view",u),e&&(e.delete("from"),e.delete("from_committed_nodes"),e.delete("interval"),e.delete("result"),e.delete("to"),e.delete("to_committed_nodes"),e.delete("from_trial"),t(e))}}),[e,n,l])},Ml=()=>{Pl();const{loaded:e,value:t}=(0,pn.lU)(),{loaded:n,value:r}=(0,pn.JN)(),o=(0,gn.J)();return a.createElement(M.Ay,{feature:"Billing"},a.createElement(s.Flex,{column:!0,height:"calc(100% - 30px)",gap:3},a.createElement(l.BV,null,a.createElement(l.qh,{path:"/all-plans",element:a.createElement(Il,{isSmall:o,currentPlan:r,loaded:e,currentLoaded:n,plans:t})}),a.createElement(l.qh,{path:"/",element:a.createElement(il,{isSmall:o,currentPlan:r,loaded:e,currentLoaded:n,plans:t})}))))};var Dl=n(58205);const Nl=(0,o.A)((()=>Promise.all([n.e(7208),n.e(2414)]).then(n.bind(n,72414)))),Bl=(0,o.A)((()=>Promise.all([n.e(749),n.e(9510),n.e(185)]).then(n.bind(n,70185)))),Rl=(0,c.default)(m.t).withConfig({displayName:"manage-workspace__ColumnHeader",componentId:"sc-j9n54n-0"})(["width:180px;padding:16px;"]),Ll=e=>t=>a.createElement(a.Suspense,{fallback:a.createElement(Rt.A,{title:"Loading settings tab..."})},a.createElement(e,t)),_l=e=>t=>a.createElement(d.Yv,{flex:"1",overflow:"hidden"},a.createElement(e,t)),Ul=e=>t=>{let{containerProps:n={},...l}=t;return a.createElement(d.Yv,(0,r.A)({flex:"1",overflow:"hidden",height:"100%",padding:[4,0,0]},n),a.createElement(e,l))},Ol=_l(mn),Vl=_l(Re),Hl=_l(nt),Wl=_l(Qe),jl=Ul(jt),Yl=_l(Ml),ql=Ul(Ll(Nl)),zl=_l(Ll(Bl)),Jl=(0,a.memo)((()=>{const e=(0,l.Zp)(),{state:t={},pathname:n}=(0,l.zy)(),{settingsTab:r,...o}=(0,l.g)(),[c]=(0,a.useState)((null===t||void 0===t?void 0:t.previousUrlPath)||null),m=(0,h.ap)("name"),g=(e=>{const t=L.IV.indexOf(e);return-1!==t?t:L.Wk})(r),E=(0,a.useCallback)((t=>{const a=((e,t)=>{const n=e.split("/"),a=n.indexOf("settings")+1-n.length;return"".concat(n.slice(0,a).join("/"),"/").concat(L.IV[t]||L.Wk)})(n,t);e(a)}),[r]);(0,a.useEffect)((()=>{L.ys[r]||e((0,i.tW)(n,{...o,settingsTab:L.Wk}))}),[]);const b=(0,p.JT)("billing:ReadBasic"),f=(0,p.JT)("room:ReadAll"),v=(0,p.JT)("user:ReadAll"),x=(0,p.JT)("channel:ReadAll"),y=(0,A.At)();(0,a.useEffect)((()=>{b||r===L.bO&&e((0,i.tW)(n,{...o,settingsTab:L.Wk}))}),[b,r]);const C=(0,h.bq)(),w=(0,a.useCallback)((t=>{const n=t?"/spaces/".concat(t):c||"/spaces/".concat(C);e(n)}),[c,C]);return m?a.createElement(Kt.A,{permission:"space:ReadSettings"},(e=>a.createElement(M.Ay,{feature:"SpaceSettings"},a.createElement(d.GO,{full:!0,"data-testid":"manageWorkspaceModal",closeOnClickOutside:!1,onClose:w,width:"100%"},a.createElement(u.z,{"data-testid":"manageWorkspaceModal-header",onClose:w,title:a.createElement(un,null)}),a.createElement(s.Tabs,{row:!0,column:!1,"data-testid":"manageWorkspaceModal-tabs",selected:g,onChange:E,TabsHeader:Rl,tabsProps:{column:!0},height:"100%",noDefaultBorder:!0,position:"relative",overflow:"hidden",width:"100%"},a.createElement(s.Tab,{basis:0,"data-testid":"manageWorkspaceModal-spaceTab",label:L.ys[L.mm],"data-ga":"manage-space::click-tab::space-tab",isMenuItem:!0},a.createElement(Ol,{"data-testid":"manageWorkspaceModal-spaceTabContent",onClose:w,small:!0})),a.createElement(s.Tab,{basis:0,"data-testid":"manageWorkspaceModal-warRoomsTab","data-ga":"manage-space::click-tab::rooms-tab",label:"Rooms",isMenuItem:!0},a.createElement(Vl,{"data-testid":"manageWorkspaceModal-warRoomsTabContent"})),(f||y)&&a.createElement(s.Tab,{basis:0,label:"Nodes","data-testid":"manageWorkspaceModal-nodesTab","data-ga":"manage-space::click-tab::nodes-tab",isMenuItem:!0},a.createElement(Hl,{"data-testid":"manageWorkspaceModal-nodesTabContent"})),v&&a.createElement(s.Tab,{basis:0,"data-testid":"manageWorkspaceModal-usersTab","data-ga":"manage-space::click-tab::users-tab",label:"Users",isMenuItem:!0},a.createElement(Wl,{"data-testid":"manageWorkspaceModal-usersTabContent"})),x&&a.createElement(s.Tab,{basis:0,label:"Alerts & Notifications","data-testid":"manageWorkspaceModal-notificationsTab","data-ga":"manage-space::click-tab::notifications-tab",isMenuItem:!0},a.createElement(jl,null)),b&&!window.envSettings.onprem&&a.createElement(s.Tab,{basis:0,"data-testid":"manageWorkspaceModal-billingTab","data-ga":"manage-space::click-tab::billing-tab",label:"Plan & Billing",isMenuItem:!0},a.createElement(Yl,{"data-testid":"manageWorkspaceModal-billingTabContent"})),a.createElement(s.Tab,{basis:0,"data-testid":"manageWorkspaceModal-integrationsTab","data-ga":"manage-space::click-tab::integrations-tab",label:"Integrations",isMenuItem:!0},a.createElement(ql,{flavour:Dl.D_.settingsPage,containerProps:{padding:[0]},"data-testid":"manageWorkspaceModal-integrationsTabContent"})),a.createElement(s.Tab,{basis:0,"data-testid":"manageWorkspaceModal-configurationsTab","data-ga":"manage-space::click-tab::configurations-tab",label:L.ys[L.$d],isMenuItem:!0},a.createElement(zl,null))))))):null})),Gl=()=>{const{pathname:e,state:t}=(0,l.zy)();return a.createElement(l.BV,null,a.createElement(l.qh,{path:"/",element:a.createElement(l.C5,{state:t,to:{pathname:"".concat(e,"/").concat(L.Wk)}})}),a.createElement(l.qh,{path:":settingsTab/*",element:a.createElement(Jl,null)}))}},39522:(e,t,n)=>{"use strict";n.d(t,{A:()=>x});var a=n(58168),l=n(96540),r=n(10058),o=n(47767),i=n(22292),c=n(55463),s=(n(17333),n(98992),n(54520),n(62953),n(47444)),m=n(71835),d=n(54702),u=n(55189),g=n(3914),p=n(48849),E=n(56639),h=n(14994);var b=n(57992);const f="leave-space-dialog",v="leaveSpaceDialog",x=e=>{let{id:t,name:n,onClose:x}=e;const y=(0,o.Zp)(),C=(0,i.uW)("id"),w=(0,c.Gi)(),A=(0,c.i3)(),T=(0,c.pB)(),S=(e=>{const[,t]=(0,m.A)();return(0,s.Zs)((n=>{let{snapshot:a,set:l,reset:r}=n;return async n=>{let{currentUserId:o,onSuccess:i,onError:s}=n;const m=await a.getPromise((0,g.nC)("ids")),b=m.filter((t=>e!==t)),[f]=b;if(!f)return void t({header:"Spaces",text:u.sh.leave});const{slug:v}=f&&await a.getPromise((0,E.Ay)(f));l((0,g.nC)("ids"),b),l(p.A,(t=>t.filter((t=>t!==e))));try{await(0,d.XY)(e,[o]),i&&i(v),(0,c.Z8)(r,e),(0,h.Is)(r,e),r((0,E.Ay)(e))}catch(x){l((0,g.nC)("ids"),m),s&&s()}}}),[e])})(t),I=(0,b.A)(t),k=(0,l.useCallback)((e=>y("/spaces/".concat(e))),[]),F=1===w.length,P=1===A.length&&T,M=F?{confirmLabel:"Yes, leave","data-ga":"".concat(f,"-last-member"),"data-testid":"".concat(v,"LastMember"),handleConfirm:()=>I({onSuccess:k}),message:l.createElement(l.Fragment,null,"If you leave, space ",l.createElement("strong",null,n)," will be deleted immediately.",l.createElement("br",null),"Are you sure you want to continue?"),title:"Leave and delete ".concat(n," space")}:P?{confirmLabel:"Give rights","data-ga":"".concat(f,"-last-admin"),"data-testid":"".concat(v,"LastAdmin"),handleConfirm:()=>y("users"),isConfirmPositive:!0,message:l.createElement(l.Fragment,null,"You are the last admin of ",l.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":f,"data-testid":v,handleConfirm:()=>S({currentUserId:C,onSuccess:k}),message:l.createElement(l.Fragment,null,"You are about to leave ",l.createElement("strong",null,n)," space.",l.createElement("br",null),"Are you sure you want to continue?"),title:"Leave ".concat(n," space")};return l.createElement(r.ConfirmationDialog,(0,a.A)({handleDecline:x},M))}},47193:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});n(62953);var a=n(69765),l=n(67990),r=n(87860),o=n(3914),i=n(47762),c=n(87659);const s=function(){let{polling:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{id:t=""}=(0,a.pr)(),n=(0,l.gr)(t,"ids"),s=(0,l.gr)(t,"loaded"),m=(0,i.Gt)(n),d=(0,o.vt)(),[u,,,g]=(0,c.A)();return(0,r.A)({id:t,spaceId:d,polling:e}),{areDefaultRoomNodesLoaded:s,nodes:m,isClaimNodeModalOpen:u,closeClaimNodeModal:g}}},97200:(e,t,n)=>{var a=n(13222),l=0;e.exports=function(e){var t=++l;return a(e)+t}}}]);