diff options
Diffstat (limited to 'src/web/gui/v2/4958.5969fedc1ff7dc82775e.chunk.js')
-rw-r--r-- | src/web/gui/v2/4958.5969fedc1ff7dc82775e.chunk.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/web/gui/v2/4958.5969fedc1ff7dc82775e.chunk.js b/src/web/gui/v2/4958.5969fedc1ff7dc82775e.chunk.js new file mode 100644 index 000000000..51443523a --- /dev/null +++ b/src/web/gui/v2/4958.5969fedc1ff7dc82775e.chunk.js @@ -0,0 +1 @@ +!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="349be8c4-9658-4a28-87e0-147f3b4fa910",e._sentryDebugIdIdentifier="sentry-dbid-349be8c4-9658-4a28-87e0-147f3b4fa910")}catch(e){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"30b1ba65cc8722be7e184f4a401fb43e6b21634d"},(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[4958],{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)),o=n(68090),r=n.n(o),i=n(96540),c=n(83199);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:o="",...m}=e;const g=(0,i.useMemo)((()=>{if(null===t||void 0===t||!t.length||!l)return null;return r()(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(o,"-breadcrumbs-backButton")}),i.createElement(c.Flex,{gap:2,alignItems:"center"},t.map(((e,t)=>{let{isDisabled:n,name:l,onClick:r}=e;return i.createElement(s,(0,a.A)({key:t,alignItems:"center"},r&&{cursor:"pointer",onClick:r},{"data-testid":"".concat(o,"-breadcrumbs-level-").concat(t)}),i.createElement(p,{color:n&&"textLite","data-testid":"".concat(o,"-breadcrumbs-level-").concat(t),withHover:!!r},0!==t&&" / ",l))}))))}},26751:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});var a=n(58168),l=n(96540),o=n(83199);const r=e=>{let{message:t,title:n,footer:r,...i}=e;const c=(null===i||void 0===i?void 0:i["data-testid"])||"functionError";return l.createElement(o.Flex,(0,a.A)({alignItems:"center",column:!0,"data-testid":c,flex:!0,gap:3,justifyContent:"center",padding:[0,20]},i),l.createElement(o.H3,{"data-testid":"".concat(c,"-title")},n),l.createElement(o.TextBig,{color:"textDescription","data-testid":"".concat(c,"-message")},t),r)}},54856:(e,t,n)=>{"use strict";n.d(t,{A:()=>m});var a=n(58168),l=n(96540),o=n(84976),r=n(83199),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(r.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:o.N_,boxProps:{as:r.Flex},color:"text",Component:r.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),o=n(83199),r=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(o.Flex,{"data-testid":"".concat(c,"-container"),gap:1},a.createElement(o.TextSmall,{color:"textLite","data-testid":c},l,n&&" *"),t&&a.createElement(r.A,{align:"top",content:t,"data-testid":"".concat(c,"-info"),plain:!0},a.createElement(o.Icon,{color:"textLite",name:"information",size:"small"})))},c=e=>{let{"data-testid":t="input",description:n,isRequired:r,onChange:c,title:s,...m}=e;return a.createElement(o.Flex,{column:!0,"data-testid":t,flex:"grow",gap:1},a.createElement(i,{"data-testid":t,description:n,isRequired:r,title:s}),a.createElement(o.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:r,getDataGa:c,fields:s,id:m,isRequired:d,onChange:u,secrets:g,setSecrets:p,title:E,...h}=e;return a.createElement(o.Flex,{column:!0,"data-testid":n,flex:"grow",gap:1},a.createElement(i,{"data-testid":n,description:r,isRequired:d,title:E}),a.createElement(o.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:o,onChange:r,...i}=e;return a.createElement(b,(0,l.A)({"data-ga":c("".concat(m,"-").concat(o,"-").concat(i.component)),"data-testid":"".concat(n,"-").concat(o),key:o,id:o,onChange:r({id:m,setSecrets:p,subsetId:o}),value:t({id:m,secrets:g,subsetId:o})},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:r,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(o.Flex,{column:!0,"data-testid":n,gap:1},a.createElement(o.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":r("".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(o.Flex,{alignItems:"end",key:"".concat(E,"-").concat(t),gap:2},a.createElement(f,{component:u,"data-ga":r("".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":r("".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(o.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:()=>o,Jg:()=>g,MU:()=>r,Oj:()=>m,W6:()=>c,fn:()=>d,id:()=>u,ro:()=>i});var a=n(8711),l=n(83199);const o=(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;}"]),r=(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((e=>({height:"22px",icon:"plus",padding:[.5,2,.5,1],small:!0,width:"auto",...e}))).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),o=n(25624);var r=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,r.A)(!localStorage.getItem(n)),{trialEndsAtRaw:m}=(0,o.A)(),d=m&&"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),o=n.n(l),r=n(83199),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)(r.Button),E=e=>{let{onConfirm:t,onDecline:n=o(),onCancellingEnd:l=o()}=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(r.Modal,{backdropProps:{backdropBlur:!0}},a.createElement(d.Ay,{feature:"TrialOptOut"},a.createElement(r.ModalContent,{width:{base:140}},a.createElement(r.ModalHeader,null,a.createElement(r.Flex,{gap:2,alignItems:"center"},a.createElement(r.H4,null,"Go to Community plan"))),a.createElement(r.ModalBody,null,x?a.createElement(r.Flex,{height:"100px"},a.createElement(r.TextBig,null,"Changing billing plan...")):a.createElement(r.Flex,{gap:2,column:!0},a.createElement(r.H3,null,"Are You Sure?"),a.createElement(r.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(r.TextBig,null,"By opting out, you will switch to the community plan immediately."))),a.createElement(r.ModalFooter,null,a.createElement(r.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:()=>r,TB:()=>i,W1:()=>l,ml:()=>o,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"}},o=[30,15,3,2,1],r="dismissedTrialWelcome",i="dismissedTrialWarningDate"},93476:(e,t,n)=>{"use strict";n.d(t,{A:()=>g});var a=n(58168),l=n(96540),o=n(83199),r=n(63950),i=n.n(r),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:r,...c}=e;return t?l.createElement(o.Box,(0,a.A)({"data-testid":"upgrade-to-business-banner",onClick:n,as:o.Text,cursor:"pointer",textDecoration:"underline",color:"main"},c),r):null},g=e=>{let{flavour:t,couponRemainingDays:n,onUpdateClick:r=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(o.Flex,{justifyContent:b.isBilling?"start":"center",alignItems:"center",width:"100%",gap:2},b.isCoupon?l.createElement(o.Flex,{column:!0},l.createElement(o.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(o.Flex,{column:!0,gap:1,alignItems:"center"},l.createElement(o.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:r},"Upgrade"):null),l.createElement(o.Text,(0,a.A)({},d[t],{color:"primary",fontSize:"22px",lineHeight:.8,strong:!0}),"25% Lifetime off")):b.isFreePlanUpgrade?l.createElement(o.Text,d[t],"Upgrade your plan for unlimited access and Business features."):l.createElement(o.Text,d[t],"You have ",l.createElement(o.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(o.Text,(0,a.A)({strong:!0},d[t]),E),"."," "),b.isBanner?l.createElement(u,{canUpgrade:p,onUpdateClick:r},"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:()=>r});var a=n(8711),l=n(83199),o=n(35454);const r=(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=o.W1[n])||void 0===t?void 0:t.background)}),(e=>{var t;let{type:n}=e;return(0,l.getColor)(null===(t=o.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),o=n.n(l),r=n(83199),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=o(),...l}=e;const{sendLog:s,isReady:m}=(0,i.A)(),d=(0,a.useCallback)((()=>{n(),s({feature:"TrialOptOut",isStart:!0})}),[m]);return a.createElement(r.Text,l,"After the trial, you'll automatically switch to the free Community plan."," ",a.createElement(r.Box,{"data-testid":"upgrade-to-business-banner",onClick:d,as:r.Text,cursor:"pointer",textDecoration:"underline",color:"primary"},c[t]),".")}},25624:(e,t,n)=>{"use strict";n.d(t,{A:()=>h});n(62953);var a=n(96540),l=n(46741),o=n(5668),r=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(17170),p=n(93155);const E=e=>{const t=new Date(e||void 0).toLocaleDateString();return"Invalid Date"!==t?t:null},h=()=>{const e=(0,g.A)(),{loaded:t,value:n,refresh:h}=(0,s.JN)(),{isFailure:b}=(0,m.A)(),{slug:f,trialEndsAt:v,paymentProvider:x}=n||{},y=(0,a.useMemo)((()=>(e=>{if(!e)return null;const t=new Date(e)-new Date;return Math.ceil(t/864e5)})(v)),[v]),C=t&&!!v&&!e,w=(0,l.JT)("billing:Manage"),[A]=(0,o.ng)("trialModalDismissed"),T=p.bO&&w&&(C||b)&&!localStorage.getItem(d.$B)&&!A,[S,I]=(0,a.useState)(localStorage.getItem(d.TB)),k=(0,a.useMemo)((()=>p.bO&&C),[C]),[F,P]=(0,a.useState)(),M=(D=y)>15?"default":D>5?"warning":"critical";var D;const L=!(0,r.uW)("isAnonymous")&&w;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 o=new Date(a||void 0);if(!(0,i.f)(o))return!0;const{days:r}=(0,c.F)({start:o,end:l}),s=r;return n.some((e=>e>=t&&e<s))})(v,y,d.ml,S);P(p.bO&&e)}),[v,y,S]),{trialWelcomeVisible:T,sidebarWarningVisible:k,bannerVisible:F,dismissBanner:()=>{const e=(new Date).toISOString();I(e),localStorage.setItem(d.TB,e)},daysRemaining:y,trialEndsAt:E(v),trialEndsAtRaw:v,type:M,canUpgrade:L,onTrial:C,refreshPlan:h,planIsFreeOrEarlyBird:(0,u.Kj)(f),paymentProvider:x}}},97118:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var a=n(19673),l=n(42728);const o=()=>{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}}},52577:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>Zl});var a=n(96540),l=n(47767),o=n(3914),r=n(58168),i=(n(62953),n(39225)),c=n(45588),s=n(8711),m=n(83199),d=n(57375),u=n(15327),g=n(74618),p=n(79412),E=(n(41393),n(81454),n(46741)),h=n(14994),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(),o=(0,E.JT)("room:ReadAll");return a.createElement(m.Flex,{alignItems:"center"},o&&n&&a.createElement(f.A,{margin:[0,1,0,0]}),a.createElement(m.Text,{margin:o&&!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:o,onFail:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=await n.getPromise((0,h.$e)({id:e,key:"ids"})),c=t.map((e=>{let{id:t}=e;return t})),s=i.filter((e=>!c.includes(e)));a((0,h.$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,h.Oy)(e),t))),t.forEach((t=>{let{id:n,slug:a}=t;l((0,A.LS)({id:n})),l((0,T.x4)([e,a]))})),o&&o(),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,h.$e)({id:e,key:"ids"}),i),r&&r(d)}}}),[e]);var k=n(74564);const F=e=>{let{spaceId:t,spaceName:n,startIsCreating:r}=e;const i=I(t),c=(0,E.JT)("space:Delete"),s=(0,E.JT)("room:Read"),m=(0,E.JT)("room:Create"),d=(0,E.JT)("space:CreatePersonalSilencingRule"),u=(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}];i(n,{onSuccess:t.resetRowSelection})},g=(e,t)=>{const n=t.length;if(!n)return"";return 1===n?(0,k.kI)(t[0].name):(0,k.kI)(n)},p=(e,t)=>{const l=t.length;if(!l)return"";const o={...1===l?{name:t[0].name}:{roomsLength:l},spaceName:n};return a.createElement(k.rj,o)},{pathname:h}=(0,l.zy)(),b=(0,o.bq)(),f=(0,l.Zp)(),v=(0,a.useCallback)((e=>f("".concat(h,"/").concat(e))),[h,f]),x=(0,a.useMemo)((()=>({goto:{handleAction:e=>{let{slug:t}=e;return v(t)},icon:"chevron_right",tooltipText:"Room settings",isDisabled:()=>!s},addRule:{handleAction:e=>{const t={roomId:e.id};f("/spaces/".concat(b,"/settings/notifications#notificationsActiveTab=1&silencingRulePrefill=").concat(JSON.stringify(t)))},icon:"alarm_off",flavour:"hollow",neutral:!1,isDisabled:()=>!d,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:u,isDisabled:e=>{let{untouchable:t}=e;return t||!c},tooltipText:"Delete room"}})),[c,v,d,s]);return{bulkActions:(0,a.useMemo)((()=>({addEntry:{dataGa:"manage-rooms::click::add-room",handleAction:r,isDisabled:!m,tooltipText:"Create room"},delete:{confirmationMessage:p,confirmationTitle:g,confirmLabel:"Yes, delete",dataGa:"manage-rooms::delete-bulk",declineLabel:"Cancel",handleAction:u,isDisabled:!c,tooltipText:"Delete rooms"}})),[m,c,p,g]),rowActions:x,onClickRow:v}},P=()=>{const e=(0,h.DL)(),t=(0,E.JT)("room:Delete"),n=e.map((e=>({...e,disabled:e.untouchable||!t}))),[l,r]=(0,a.useState)(""),i=(0,o.ap)("name"),c=(0,o.ap)("id"),[s,,m,d]=(0,b.A)(),[,u]=(0,a.useState)([]),{bulkActions:g,rowActions:p}=F({startIsCreating:m,spaceId:c,spaceName:i});return{roomList:n,globalFilter:l,spaceName:i,spaceId:c,isCreating:s,rowActions:p,bulkActions:g,columns:x,startIsCreating:m,stopIsCreating:d,setGlobalFilter:r,onRowSelected:u,dataGa:"manage-rooms"}};var M=n(63314);const D=e=>{const{roomList:t,spaceName:n,isCreating:l,columns:o,setGlobalFilter:i,stopIsCreating:c,onRowSelected:s,rowActions:d,bulkActions:u,dataGa:g}=P();return a.createElement(M.Ay,{tab:"Rooms"},a.createElement(m.Flex,(0,r.A)({column:!0,height:"100%",overflow:"hidden",gap:3},e),a.createElement(m.H3,null,"Rooms of ",n),a.createElement(m.Table,{onSearch:i,onRowSelected:s,enableSorting:!0,dataColumns:o,enableSelection:!0,data:t,bulkActions:u,rowActions:d,dataGa:g,testPrefixCallback:e=>e.name})),l&&a.createElement(p.n,{onClose:c}))};var L=n(67031),N=n(87860),R=n(29662),B=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(m.Flex,(0,r.A)({column:!0,height:"100%",overflow:"hidden",gap:3},n),a.createElement(m.H3,null,"Nodes in this room (",o.length,") "),a.createElement(H.A,{showClaimNodeOnEmptySpace:!0,enableSelection:!0,customNodes:l,roomUntouchable:t})))}));var Y=n(45765),q=n(46902),j=n(83488),z=n.n(j),J=n(66245),G=n.n(J),$=n(55463),K=n(70716),Z=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(m.Flex,{alignItems:"center",gap:2},a.createElement(Z.A,{src:n,title:l}),a.createElement(m.TextSmall,null,l))}},{id:"email",accessorKey:"email",header:"Email",cell:e=>{let{getValue:t}=e;return a.createElement(m.TextSmall,null,t())}}],X=[{id:"user",desc:!1}],ee=e=>{let{setSelected:t}=e;const n=(0,$.Gi)(),l=(0,q.lb)(),o=(0,a.useMemo)((()=>G()(n,l)),[n,l]),r=(0,a.useCallback)((e=>{t(e.map((e=>e.id)))}),[]),i=(0,K.Uv)(o);return a.createElement(m.Flex,{alignItems:"start",padding:[1],overflow:{horizontal:"hidden",vertical:"auto"}},a.createElement(m.Table,{dataColumns:Q,data:i,autoResetSelectedRows:!0,sortableBy:X,onSearch:z(),onRowSelected:r,enableSelection:!0,enableSorting:!0}))};var te=n(92155);const ne=(0,te.A)(m.Button),ae=e=>{let{onAdd:t,onClose:n,selected:l,error:o,name:r}=e;return a.createElement(m.Flex,{alignItems:"center",justifyContent:"between"},o?a.createElement(m.Text,{color:"error"},"Select at least 1 user to add to ",r):a.createElement("div",null),a.createElement(m.Flex,{gap:2},a.createElement(m.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),oe=n(84707),re=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,re.B9)(t)},Ee={header:"Invitations",text:"Invitations successfully sent!"},he=e=>{const{id:t,slug:n}=(0,o.ap)(),l=(0,A.ID)(),i=(0,A.wz)(l,"name"),[c,s]=(0,a.useState)([]),[,,d,u]=(0,ie.g)(t),[,g]=(0,me.A)(),[p,h]=(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"}),s([]),h(Math.random())},x=(0,a.useCallback)((()=>{const e=c.filter(pe).map((e=>({email:e.email,name:e.name,role:b,roomIDs:[l]}))),t="".concat(window.location.origin,"/spaces/").concat(n,"/join-space");d(e,t,{onSuccess:v,onError:g})}),[c,l,b]),y=(0,E._s)();return a.createElement(m.Flex,(0,r.A)({column:!0},e),a.createElement(m.H4,null,"Send invitations to ",i," room"),a.createElement(le.BZ,null,"TIP: You can send more invitations at once, separate each with a comma."),a.createElement(oe.y,{key:p,invitations:c,setInvitations:s}),a.createElement(m.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:m.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(m.Box,{alignSelf:"end",margin:[4,0,0]},a.createElement(m.Button,{label:"Send",onClick:x,disabled:0===c.length||!b,flavour:"hollow",isLoading:u})))},be=e=>{let{onClose:t,room:n}=e;const[l,o]=(0,a.useState)([]),[r,i]=(0,a.useState)(!1),c=(0,q.n)(n.spaceId,n.id),s=(0,a.useCallback)((()=>{if(!l.length)return i(!0);i(!1),c(l),t()}),[l,c]);return a.createElement(u.GO,{onClose:t},a.createElement(g.z,{onClose:t,isSubmodal:!0,title:a.createElement(a.Fragment,null,"Manage room",a.createElement(m.TextBig,{color:"textLite"},"\xa0/ Add Users"))}),a.createElement(Y.U,null,"Add users to room\xa0",n.name),a.createElement(u.Yv,null,a.createElement(he,{margin:[0,0,4]}),a.createElement(m.Flex,{column:!0,flex:!0,overflow:"hidden",padding:[0,0,2,0]},a.createElement(ee,{setSelected:o})),a.createElement(ae,{onClose:t,onAdd:s,selected:l,error:r,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:o,untouchable:r}=e;const i=(0,q.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=>r?"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.":o?"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=>r?"It's not allowed to remove users from this room. Try removing them from the space.":e.length?o?"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:o}=t();return a.createElement(m.Flex,{alignItems:"center",gap:2},a.createElement(Z.A,{src:l,title:"".concat(n," - ").concat(o||"email not set")}),a.createElement(m.TextSmall,null,n))}},{id:"email",accessor:"email",header:"Email",width:300,align:"center",cell:e=>{let{getValue:t}=e;return a.createElement(m.TextSmall,null,t())}}]),[]),l=(0,q.di)(),r=(0,ve.uW)("id"),i=(0,E.JT)("space:RemoveUser"),[c,s]=(0,a.useState)([]),[d,u]=(0,a.useState)(""),[g,,p,h]=(0,b.A)(),f=(0,o.ap)("id"),v=(0,A.ID)(),{rowActions:x,bulkActions:y}=Se({selectedRows:c,spaceId:f,roomId:v,startIsInviting:p,canRemoveUser:i,untouchable:t});return{columns:n,data:(0,a.useMemo)((()=>(0,fe.L)({data:l,currentUserId:r,canRemoveUser:i,untouchable:t})),[l]),columnVisibility:{name:!1},members:l,rowActions:x,bulkActions:y,isInviting:g,globalFilter:d,stopIsInviting:h,onRowSelected:s,setGlobalFilter:u,canRemoveUser:i}},ke=e=>{let{room:t,...n}=e;const{untouchable:l}=t,{columns:o,data:i,columnVisibility:c,members:s,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(m.Flex,(0,r.A)({column:!0,height:"100%",overflow:"hidden",gap:3},n),a.createElement(m.H3,null,"Users in this room (",s.length,")"),a.createElement(m.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,s.default)(m.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,o.vt)(),{roomSlug:n,spaceSlug:r,settingsTab:i}=(0,l.g)(),s=(0,A.J_)(t,n);(0,N.A)({spaceId:t,id:s,polling:!1}),(0,R.A)(t,s);const d=(0,E.JT)("room:ReadUsers"),u=(0,A.wz)(s),[g,p]=(0,a.useState)(u.name),{search:h}=(0,l.zy)(),{tab:b="room"}=_.parse(h),f=Fe[b],[v,x]=(0,a.useState)(f),[y,C,w]=(0,m.useInputValue)({maxChars:255,value:u.description}),T=(0,a.useCallback)((()=>{e((0,c.tW)(B.bq,{spaceSlug:r,settingsTab:i}))}),[r,i]),S=(0,A.a8)(u.id,{shouldPersist:!0,onSuccess:T}),I=(0,a.useCallback)((()=>S({name:g,description:y})),[g,y,S]);return a.createElement(m.Flex,{column:!0,justifyContent:"between",overflow:"hidden","data-testid":"manageRoom",flex:"1",height:"100%"},a.createElement(m.Tabs,{"data-testid":"manageRoom-tabs",selected:v,onChange:x,TabContent:Pe,height:"100%",position:"relative",overflow:"hidden",width:"100%"},a.createElement(m.Tab,{"data-testid":"manageRoom-roomTab",label:a.createElement(m.H5,null,"Room")},a.createElement(L.U,{roomName:g,setRoomName:p,roomDescription:y,setRoomDescription:C,charsDescIndicator:w,"data-testid":"manageRoom-roomTabContent",id:u.id,navigateToParent:T,onSaveClick:I})),a.createElement(m.Tab,{"data-testid":"manageRoom-nodesTab",label:a.createElement(m.H5,null,"Nodes")},a.createElement(W,{roomUntouchable:u.untouchable,"data-testid":"manageRoom-nodesTabContent"})),d&&a.createElement(m.Tab,{"data-testid":"manageRoom-usersTab",label:a.createElement(m.H5,null,"Users")},a.createElement(ke,{"data-testid":"manageRoom-usersTabContent",room:u}))),v===Fe.room&&a.createElement(m.Flex,{justifyContent:"end"}))};var De=n(97054);const Le=e=>{let{children:t}=e;return(0,De.TP)(),t},Ne=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(Le,null,a.createElement(Ne,null,a.createElement(Me,null)))}));var Be=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:o}=t();return a.createElement(m.Flex,{alignItems:"center",gap:2},a.createElement(Z.A,{src:l,title:"".concat(n," - ").concat(o||"email not set")}),a.createElement(m.TextSmall,null,n))}},{id:"email",accessor:"email",header:"Email",width:300,align:"center",cell:e=>{let{getValue:t}=e;return a.createElement(m.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(m.Flex,{alignItems:"center",gap:1},a.createElement(m.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(m.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),Ye=n(66294);const qe=e=>{const t=(0,We.t)();return(0,y.Zs)((n=>{let{snapshot:a,set:l}=n;return async function(n){let{onSuccess:o,onError:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=await a.getPromise((0,$.kd)({id:e,key:"ids"})),c=i.filter((e=>!e.includes(n)));l((0,$.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,Ye.$)(a));await(0,He.y)({key:l,handleResults:e=>e.results.filter((e=>!n.includes(e.id)))})})({cacheKeyPrefix:t,spaceId:e,memberIds:n}),o&&o()}catch(s){l((0,$.kd)({id:e,key:"ids"}),i),r&&r()}}}),[e])},je=e=>(0,y.Zs)((t=>{let{snapshot:n,set:a}=t;return async function(t,l){let{onSuccess:o,onError:r}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=await n.getPromise((0,K.Z6)(t)),c=await Promise.all(t.map((async t=>({mId:t,role:await n.getPromise((0,$.K2)({id:t,spaceId:e}))})))),{role:s,...m}=l;t.forEach((e=>{a((0,K.m)({id:e}),(e=>({...e,...m})))})),s&&t.forEach((t=>{a((0,$.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),o&&o()}catch(d){i.forEach((e=>{let{id:t,...n}=e;return a((0,K.m)({id:t}),{id:t,...n})})),s&&c.forEach((t=>{let{mId:n,role:l}=t;return a((0,$.K2)({id:n,spaceId:e}),l)})),r&&r()}}}),[e]),ze="change-user-role",Je="changeUserRole",Ge=e=>{let{handleAction:t,ids:n,onClose:l}=e;const o=(0,$.$D)(n),r=1===o.length?o[0]:null,i=(0,E._s)(),[c,s]=(0,a.useState)(r);return a.createElement(m.ConfirmationDialog,{confirmLabel:"Save","data-ga":ze,"data-testid":Je,handleConfirm:()=>{t(c),l()},handleDecline:l,isConfirmDisabled:!c,isConfirmPositive:!0,message:a.createElement(m.Flex,{gap:2,column:!0},a.createElement(m.TextSmall,null,"Learn more about Netdata role-based access model on"," ",a.createElement(ue.A,{href:ge.S,target:"_blank",rel:"noopener noreferrer",Component:m.TextSmall},"our documentation")),a.createElement(de.A,{availableRoles:i,dataGA:ze,dataTestId:Je,onChange:e=>{s(e.target.value)},value:c})),title:"Change roles"})};var $e=n(29848);const Ke=e=>{let{spaceId:t,startIsInviting:n}=e;const l=qe(t),o=je(t),i=(0,E.JT)("space:InviteUser"),c=(0,$e.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":""}),[]),p=(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:p,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,p])}},Ze=()=>{const e=(0,o.vt)(),t=(0,o.ns)(e,"name"),n=(0,$.bj)(),l=(0,ve.uW)("id"),[r,,i,c]=(0,b.A)(),[s,m]=(0,a.useState)(""),[d,u]=(0,a.useState)([]),{rowActions:g,bulkActions:p}=Ke({selectedRows:d,spaceId:e,startIsInviting:i}),h=(0,E.JT)("space:RemoveUser"),f=(0,E.JT)("user:ChangeRoles"),v=(0,E.Ge)(),x=h||f,y=(0,a.useMemo)((()=>(e=>{let{fromRolePermissions:t,userList:n,canModifyUser:a,currentUserId:l}=e;return n.reduce(((e,n)=>{const o=l===(null===n||void 0===n?void 0:n.id),r=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:!r||!a||o,isSelf:o,canModifyUser:a,canSetRole:r}),e}),[])})({userList:n,currentUserId:l,canModifyUser:x,fromRolePermissions:v})),[n]);return{columns:Oe,spaceName:t,members:n,currentUserId:l,data:y,isInviting:r,globalFilter:s,rowActions:g,bulkActions:p,columnVisibility:{name:!1},onRowSelected:u,setGlobalFilter:m,startIsInviting:i,stopIsInviting:c,canModifyUser:x}},Qe=e=>{const{columns:t,spaceName:n,data:l,isInviting:o,rowActions:i,bulkActions:c,columnVisibility:s,stopIsInviting:d,setGlobalFilter:u,onRowSelected:g}=Ze();return a.createElement(M.Ay,{tab:"Users"},a.createElement(m.Flex,(0,r.A)({column:!0,height:"100%",overflow:"hidden"},e),a.createElement(m.H3,null,"Members of ",n),a.createElement(m.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:m.TextSmall},"our documentation")),a.createElement(m.Table,{onSearch:u,data:l,dataColumns:t,enableSorting:!0,enableSelection:!0,onRowSelected:g,bulkActions:c,rowActions:i,columnVisibility:s,testPrefixCallback:e=>e.name})),o&&a.createElement(Be.d,{onClose:d,isSubmodal:!0}))};var Xe=n(74530),et=n(47193);const tt=(0,a.memo)((e=>{const t=(0,o.vt)(),n=(0,o.ap)("name"),{nodes:l}=(0,et.A)();(0,Xe.A)(t);const i="Connect Nodes to ".concat(n);return a.createElement(M.Ay,{tab:"Nodes"},a.createElement(m.Flex,(0,r.A)({column:!0,"data-testid":"manageClaimedNodes",height:"100%",overflow:"hidden",gap:3},e),a.createElement(m.H3,{"data-testid":"manageClaimedNodes-header"},i),a.createElement(H.A,{showClaimNodeOnEmptySpace:!0,showClaimModalWithRoomSelection:!0,enableSelection:!0,customNodes:l,isSpace:!0})))})),nt=tt;var at=n(54961),lt=n(26770),ot=n(71856);const rt=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(m.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:ot.r7[n],"data-testid":"".concat(t,"-warning"),plain:!0},a.createElement(m.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:s,tooltipContent:d,...u}=e;const g=(0,lt.t5)(s,"channels"),p=(0,lt.vq)(s,"channels");return a.createElement(m.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)(s,l,n)},testId:t,tooltipContent:d}),a.createElement(m.Text,{"data-testid":"".concat(t,"-label")},c))},ut=e=>{var t;let{"data-testid":n="cellService",integration:l={},kindLabel:o,...i}=e;const c=ot.a$[l.slug]||{};return a.createElement(m.Flex,(0,r.A)({alignItems:"center","data-testid":n,gap:2,justifyContent:"between",width:"100%"},i),a.createElement(m.Flex,{alignItems:"center","data-testid":"".concat(n,"-integration"),gap:2},a.createElement(m.Icon,(0,r.A)({"data-testid":"".concat(n,"-icon")},c)),a.createElement(m.Text,{"data-testid":"".concat(n,"-label")},l.title)),a.createElement(Ue.A,{content:o,"data-testid":"".concat(n,"-kind"),plain:!0},a.createElement(m.Icon,{color:"textLite",height:"16px",name:null===(t=ot.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:o}=e;return a.createElement(dt,{enabled:o.original.enabled,id:o.original.id,integration:o.original.integration,isAvailable:t&&o.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(ot.a$).map((e=>({label:e,value:e}))),tiny:!0,"data-ga":"manage-integrations::select-service::notification-integrations-tab"},tooltip:a.createElement(m.Flex,{column:!0,width:{max:"200px"},gap:2},a.createElement(m.TextMicro,null,"Services are distinguished in two categories."),a.createElement(m.TextMicro,null,a.createElement(ct.Jg,{name:ot.HA.PERSONAL.icon})," ",a.createElement(m.TextMicro,{strong:!0},"Personal:")," ",ot.HA.PERSONAL.tooltip),a.createElement(m.TextMicro,null,a.createElement(ct.Jg,{name:ot.HA.SYSTEM.icon})," ",a.createElement(m.TextMicro,{strong:!0},"System:")," ",ot.HA.SYSTEM.tooltip))}},{accessor:"notificationLabel",cell:e=>{let{getValue:t}=e;return a.createElement(m.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(ot.w8),tiny:!0,"data-ga":"manage-integrations::select-notification::notification-integrations-tab"}}},{accessor:"rooms",cell:e=>{var t;let{getValue:l,row:o}=e;const r={"data-testid":"channelRoomsCell"};if(o.original.internal)return a.createElement(m.Text,r,ot.Oh.label);if(!(o.original.rooms||null!==(t=o.original.rooms)&&void 0!==t&&t.length))return a.createElement(m.Text,r,ot.PT.label);const i=(0,it.Pl)({roomIds:l(),roomOptions:n});return a.createElement(m.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===ot.Oh.label;const l=e.original.rooms||[];return l.length?l.includes(a):n===ot.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,E.JT)("channel:Manage"),n=(0,o.vt)(),r=(0,o.ap)("name"),i=(0,o.bq)(),[s,m]=(0,me.A)(),[d,u]=(0,a.useState)(""),g=(0,lt.bY)();(0,ft.A)(n);const p=(0,lt.t5)(n,"channels"),h=(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)(h);bt(n,h);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(p.filter((e=>e.id!==t))),s({header:"Configuration deleted successfully!"})}catch(a){m(a)}}),[p,n]),S=(0,a.useCallback)((()=>{e((0,c.tW)(B.uX,{spaceSlug:i,settingsTab:B.A8,settingsSubTab:B.G0}))}),[i]),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&&g({id:e})}),[g]),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(rt,{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:p,currentChannelId:h,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 ot.Oh.label.toLowerCase().includes(l);const o=a.rooms||[];if(!o.length)return ot.PT.label.toLowerCase().includes(l);return(0,it.Pl)({roomIds:o,roomOptions:v}).toLowerCase().includes(l)},onModalClose:()=>{b(p.map((e=>e.id===h?{...e,alerts:x,name:y,rooms:C,secrets:w}:e))),f("")},rowActions:F,search:d,setSearch:u}};n(74648),n(23215);var yt=n(54518),Ct=n(47130);const wt=(0,te.A)((0,Ct.A)(m.Button)),At="modal",Tt=e=>{let{id:t="new",integrationId:n,onClose:r,isSubmitEnabled:i}=e;const{alarms:s,name:m,rooms:d,slug:u,integration:g,secrets:p}=(0,lt.g4)(t),E=(0,$e.ly)(),h=(0,l.Zp)(),[b,f]=(0,me.A)(),v=(0,o.vt)(),x=(0,o.bq)(),y=(0,lt.bY)(),C=(0,a.useCallback)((()=>{(u||g)&&y({slug:u||g,secrets:p})}),[u,p,y]),w=(0,c.tW)(B.bq,{spaceSlug:x,settingsTab:B.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:!i,tooltipProps:{content:"Test your notification settings",align:"bottom"}}),a.createElement(wt,{feature:"IntegrationNotification",integrationId:n,"data-testid":"".concat(At,"-confirmButton"),disabled:!i,label:"OK",onClick:async()=>{try{const e={alarms:s,integrationID:n,...m?{name:m}:{},...null!==d&&void 0!==d&&d.length?{Rooms:d}:{},secrets:p};"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!"}),E(),r(),h(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:s,docsLink:d,fields:u,integration:g,loaded:p,name:E,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,h.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])))})),L=i&&M&&D;return a.createElement(m.Modal,{onEsc:l},a.createElement(ct.$m,{"data-testid":o["data-testid"]||St},a.createElement(m.ModalHeader,{border:{side:"bottom",color:"disabled"},column:!0,"data-testid":"".concat(St,"-header"),gap:.5,padding:[6,4,3]},a.createElement(m.Flex,{alignItems:"center","data-testid":"".concat(St,"-headerMain")},a.createElement(m.Flex,{"data-testid":"".concat(St,"-titleContainer"),gap:1},a.createElement(m.Icon,(0,r.A)({"data-testid":"".concat(St,"-titleIcon")},ot.a$[g]||{})),a.createElement(m.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(m.TextSmall,{as:m.Box,"data-testid":"".concat(St,"-description")},s,"\xa0",a.createElement(ue.A,{Component:m.TextSmall,"data-ga":x("click-docs"),"data-testid":"".concat(St,"-docsLink"),href:d,target:"_blank",whiteSpace:"nowrap"},"Learn how to configure it."))),a.createElement(m.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(m.Text,{"data-testid":"".concat(St,"-standardFields-header")},"Notification settings"),a.createElement(m.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:E}),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([ot.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(ot.N4),placeholder:"Select notifications",title:"Notifications",value:ot.N4[i]}))),a.createElement(ct.fn,{gap:2,"data-testid":"".concat(St,"-dynamicFields"),hasBorder:!0},a.createElement(m.Text,{"data-testid":"".concat(St,"-dynamicFields-header")},"Integration configuration"),a.createElement(m.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:L})))},kt=e=>{let{"data-testid":t="channelList",...n}=e;const{bulkActions:l,channelData:o,currentChannelId:i,columns:c,dataGa:s,onFilter:d,onModalClose:u,rowActions:g,search:p,setSearch:E}=xt();return a.createElement(M.Ay,{tab:"Notifications::Channels"},a.createElement(m.Flex,(0,r.A)({column:!0,"data-testid":t,gap:4,height:"100%",width:"100%",margin:[3,0]},n),a.createElement(m.Table,{bulkActions:l,data:o,dataColumns:c,dataGa:s,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,i.A)((()=>n.e(5304).then(n.bind(n,25304))),"SilencingRules"),Dt={side:"top",type:"solid",size:"1px",color:"border"},Lt=()=>{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(m.Flex,{padding:[0,0,0,4]},a.createElement(m.H3,null,"Alerts & Notifications")),a.createElement(m.Tabs,{selected:parseInt(e,10),onChange:t,height:"calc(100% - 44px)",margin:[4,0,0,0]},a.createElement(m.Tab,{"data-testid":"spaceSettings-notifications-methods-tab","data-ga":"manage-space::click-tab::notifications-methods-tab",label:a.createElement(m.Text,null,"Notification Methods")},a.createElement(m.Flex,{padding:[2,4],border:Dt,flex:"grow"},a.createElement(kt,null))),a.createElement(m.Tab,{"data-testid":"spaceSettings-notifications-silencing-rules-tab","data-ga":"manage-space::click-tab::notifications-silencing-rules-tab",label:a.createElement(m.Text,null,"Notification Silencing Rules")},a.createElement(m.Flex,{border:Dt,flex:"grow"},a.createElement(a.Suspense,null,a.createElement(Mt,null))))))};var Nt=n(84976),Rt=n(28738),Bt=n(26751),_t=n(54856);const Ut=e=>{let{available:t,"data-testid":n="card",description:l,docsLink:o,fields:i,id:c,internal:s,kind:d,kindLabel:u,slug:g,required:p,title:h,...f}=e;const v=ot.a$[g]||{},x=(0,lt.Mw)("new"),y=(0,lt.ef)("new"),C=(0,E.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:p,secrets:(0,it.s7)(i,p)}),A()}),[l,o,i,g,p]);return a.createElement(a.Fragment,null,a.createElement(m.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(m.Flex,{column:!0,"data-testid":"".concat(n,"-details"),gap:3,margin:[0,0,3,0]},a.createElement(m.Flex,{"data-testid":"".concat(n,"-header"),justifyContent:"between"},a.createElement(m.Flex,{alignItems:"center","data-testid":"".concat(n,"-titleContainer"),gap:1},a.createElement(m.Icon,(0,r.A)({"data-testid":"".concat(n,"-icon")},v)),a.createElement(m.Text,{"data-testid":"".concat(n,"-title")},h)),!s&&t&&a.createElement(Ue.A,{align:"bottom",content:C?"":ot.WB,plain:!0},a.createElement(m.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}))),!s&&!t&&a.createElement(_t.A,{"data-ga":"manage-integration-".concat(g,"::click-plan-badge::notification-integrations-tab")})),a.createElement(m.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:ot.HA[d].tooltip,"data-testid":"".concat(n,"-kindContainer"),plain:!0},a.createElement(m.Flex,{alignItems:"end",alignSelf:"end","data-testid":"".concat(n,"-kindContainer"),gap:1},a.createElement(m.Icon,{color:"textLite","data-testid":"".concat(n,"-kindIcon"),height:"16px",name:ot.HA[d].icon,width:"16px"}),a.createElement(m.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(m.Flex,(0,r.A)({column:!0,"data-testid":t,gap:2,position:"relative"},o),a.createElement(m.TextBig,{color:"textDescription","data-testid":"".concat(t,"-title")},l),a.createElement(m.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,o.vt)(),i=(0,o.bq)();Ht(l);const{available:s,error:d,loaded:u,unavailable:g}=(0,lt.m$)(l),[p,E]=(0,a.useState)([]),[h,b]=(0,a.useState)([]),[f,v]=(0,a.useState)("");if(!u)return a.createElement(Rt.A,{"data-testid":"".concat(t,"-loader"),title:"Loading services..."});if(d)return a.createElement(Bt.A,{"data-testid":"".concat(t,"-error"),message:d,title:"Services of ".concat(i," are currently unavailable")});const x=(0,c.tW)(B.bq,{spaceSlug:i,settingsTab:B.A8});return a.createElement(M.Ay,{tab:"Notifications::Integrations"},a.createElement(m.Flex,(0,r.A)({column:!0,"data-testid":t},n,{padding:[0,3,3],gap:3,overflow:"hidden"}),a.createElement(m.Flex,{border:{side:"bottom",color:"placeholder"},"data-testid":"".concat(t,"-header"),width:"100%"},a.createElement(ue.A,{as:Nt.N_,Component:ct.He,"data-ga":"manage-integrations::click-back::notification-integrations-tab","data-testid":"".concat(t,"-backLink"),to:x},a.createElement(m.Icon,{"data-testid":"".concat(t,"-backIcon"),name:"arrow_left"}),a.createElement(m.H3,{"data-testid":"".concat(t,"-title")},B.ys[B.G0]))),a.createElement(m.Flex,{column:!0,"data-testid":"".concat(t,"-content"),gap:2,height:"100%",overflow:"hidden"},a.createElement(m.Box,{as:m.SearchInput,"data-ga":"manage-integrations::search::notification-integrations-tab","data-testid":"".concat(t,"-search"),iconLeft:a.createElement(m.Icon,{name:"magnify",color:"textLite"}),onChange:e=>{v(e),E((0,it.Zv)(s,e)),b((0,it.Zv)(g,e))},placeholder:"Search service",size:"small",width:{max:49.5}}),a.createElement(m.Flex,{column:!0,"data-testid":"".concat(t,"-groups"),overflow:"auto",height:"100%"},a.createElement(Ot,{"data-testid":"integrationGroupAvailable",integrations:f?p:s,title:"Available"}),a.createElement(Ot,{"data-testid":"integrationGroupUnavailable",integrations:f?h:g,title:"Unavailable"})))))},Yt=()=>a.createElement(l.BV,null,a.createElement(l.qh,{path:"/",element:a.createElement(Lt,null)}),a.createElement(l.qh,{path:"/".concat(B.G0),element:a.createElement(Wt,null)}));var qt=n(55189),jt=n(37618);const zt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[(0,m.useInputValue)({maxChars:20,value:e.name||""})||{},(0,m.useInputValue)({maxChars:30,value:e.slug||""})||{},(0,m.useInputValue)({maxChars:50,value:e.description||""})||{}]};var Jt=n(39522),Gt=n(47373),$t=n(53285),Kt=n(7484),Zt=n(61360);const Qt={loading:!1,isAvailable:!1,isValid:!0,error:null},Xt=e=>{const t=(0,o.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,Zt.A)((()=>{(0,Gt.ni)(e)||t.slug==e||(l((e=>({...e,loading:!0}))),(0,Kt.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,...s}=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(m.Flex,(0,r.A)({column:!0,gap:4},s),a.createElement($t.A,{Component:m.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($t.A,{Component:m.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($t.A,{Component:m.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(m.Flex,(0,r.A)({column:!0,gap:1},n),a.createElement(m.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(m.Text,{lineHeight:1.5},"With the change of the Space Slug, previous ",a.createElement(m.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."),on=e=>{let{handleConfirm:t,handleDecline:n}=e;return a.createElement(m.ConfirmationDialog,{confirmLabel:"Continue","data-testid":"changeSpaceSlugDialog",handleConfirm:t,handleDecline:n,message:a.createElement(ln,null),title:"Space slug change"})};var rn=n(98046);const cn=(0,te.A)(m.Button),sn=e=>{let{nameInput:t,slugInput:n,descriptionInput:l,onClose:i,isValidatingSlug:c,slugError:s,...m}=e;const d=(0,o.ap)(),u=(0,rn.A)(d.id),[g,p]=(0,a.useState)(!1),[E]=t,[h]=n,[f]=l,v=(0,a.useMemo)((()=>d.slug!==h),[d.slug,h]),[x,,y,C]=(0,b.A)(),w=()=>{i(v?h:null),p(!1)},A=()=>p(!1),T=(0,a.useCallback)((e=>{!e&&v?y():(p(!0),u({name:E,description:f,...v?{slug:h}:{}},{onSuccess:w,onFail:A}))}),[E,h,f,d.slug]),S=(0,a.useCallback)((()=>T(!0)),[T]),I=(0,a.useMemo)((()=>{const e=(0,Gt.fc)(E),t=(0,Gt.e_)(f);return!!(g||c||e||s||t)||d.name===E&&d.slug===h&&(d.description===f||!d.description&&!f)}),[d,E,h,f,g,c]);return a.createElement(a.Fragment,null,a.createElement(cn,(0,r.A)({label:"SAVE",onClick:T,isLoading:g||c,disabled:I,"data-testid":"saveSpace-button",feature:"SpaceSettings"},m)),x?a.createElement(on,{handleConfirm:S,handleDecline:C}):null)},mn=(0,a.memo)((e=>{let{onClose:t,...n}=e;const l=(0,o.ap)(),i=(0,o.UV)("ids"),[c,,s,d]=(0,b.A)(),[u,,g,p]=(0,b.A)(),[E,h]=(0,a.useState)(),[f,v,x]=zt({name:l.name,slug:l.slug,description:l.description});if(!l.id)return null;const y=1===i.filter((e=>!(0,jt.ES)(e))).length;return a.createElement(M.Ay,{tab:"Info"},a.createElement(m.Flex,(0,r.A)({column:!0,"data-testid":"manageSpace",flex:"grow",justifyContent:"between",padding:[0,0,6,0],width:{max:150}},n),a.createElement(m.Flex,{column:!0,"data-testid":"manageSpace-settings"},a.createElement(m.H3,{margin:[0,0,4,0]},"Info"),a.createElement(m.Flex,{column:!0,gap:4},a.createElement(en,{"data-testid":"manageSpace-nameInputs",nameInput:f,slugInput:v,descriptionInput:x,onStartSlugValidation:g,onStopSlugValidation:p,onSlugValidationError:h}),a.createElement(nn,{"data-testid":"manageSpace-spaceIdInput",id:l.id,width:{base:150}}),a.createElement(m.TextInput,{label:"Your role in space",value:(0,_e.Zr)(l.roleInSpace),disabled:!0,containerStyles:{width:{base:150}}}),a.createElement(m.TextInput,{label:"Plan",value:(0,_e.Vn)(l.planName),disabled:!0,containerStyles:{width:{base:150}}}))),a.createElement(m.Flex,{"data-testid":"manageSpace-actions",justifyContent:"between",alignItems:"center"},a.createElement(m.Flex,{"data-testid":"manageSpace-deleteLeaveActions",gap:4},a.createElement(Ue.A,{align:"top",content:y&&qt.sh.leave,isBasic:!0,stretch:"align"},a.createElement(m.Flex,{alignItems:"center"},a.createElement(m.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:s}))),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:u,slugError:E}))),c&&a.createElement(Jt.A,{id:l.id,name:l.name,onClose:d}))}),(()=>!0));var dn=n(62232);const un=()=>{const e=(0,l.Zp)(),t=(0,o.vt)(),n=(0,l.RQ)(B.uX),r=(0,l.RQ)(B.bq),{params:i}=n||r||{},{spaceSlug:s="",settingsTab:m="",settingsSubTab:d=""}=i,u=(0,o.ap)("name"),g=(0,A.J_)(t,d),p=(0,A.wz)(g,"name"),E=B.ys[m],h=(0,a.useCallback)((()=>{e((0,c.tW)(B.bq,{spaceSlug:s,settingsTab:m}))}),[s,m]),b=(0,a.useMemo)((()=>{const e=[{name:"Manage Space",isDisabled:!0},{name:u,isDisabled:!0},{name:E,...!!d&&{onClick:h}}];return d&&e.push({name:E===B.ys[B.aj]?p:B.ys[d]||d}),e}),[h,p,u,E,d]);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(m.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:o,vatNo:r,billingAddress:i}=e;const[c,s]=(0,pn.Qh)(),d=!!t.billingEmail&&!s,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(m.Flex,{column:!0,gap:3},a.createElement(m.Flex,{gap:4},a.createElement(m.TextInput,{value:u,label:"Billing email",placeholder:"Not specified",instantFeedback:"all",isDirty:!!g,error:g,disabled:!0}),a.createElement(m.TextInput,{value:p,label:"Default payment method",placeholder:"Not specified",instantFeedback:"all",isDirty:!!E,error:E,disabled:!0})),r&&a.createElement(m.Flex,{gap:4},a.createElement(m.TextInput,{value:o||"",label:"Business name",placeholder:"Not specified",disabled:!0}),a.createElement(m.TextInput,{value:r,label:"VAT number",placeholder:"Not specified",disabled:!0})),a.createElement(m.Flex,null,a.createElement(m.TextInput,{value:(0,fn.qN)(i)||"",label:"Billing address",placeholder:"Not specified",isDirty:!!h,error:h,disabled:!0})),a.createElement(ue.A,{Component:m.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(m.Icon,{name:"nav_arrow_goto",width:"12px",height:"12px"})))},xn=e=>{let{onReset:t}=e;return a.createElement(m.Box,{as:m.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(m.Flex,{width:"100%"},a.createElement(m.Pill,{padding:[0],flavour:"neutral",hollow:!0},a.createElement(m.Flex,{position:"relative",gap:2,alignItems:"center",padding:[1,2,1,5]},a.createElement(xn,{onReset:n}),a.createElement(m.Text,null,t))))},Cn=e=>{let{promotionCode:t,onApply:n,error:l}=e;const[o,r]=(0,a.useState)(t||""),i=()=>{r(""),n("")};return a.createElement(m.Flex,{column:!0,gap:1},a.createElement(m.Text,{strong:!0},"Promotion code"),t&&!l?a.createElement(yn,{promotionCode:t,onReset:i}):a.createElement(m.Flex,{column:!0,gap:1},a.createElement(m.Flex,{gap:2,alignItems:"baseline"},a.createElement(m.TextInput,{value:o,onChange:e=>r(e.target.value),placeholder:"Promotion code"}),!l&&a.createElement(m.Button,{label:"Apply",onClick:()=>n(o),padding:[3,4],disabled:!o}),!!o&&a.createElement(m.Button,{label:"Clear",flavour:"hollow",onClick:i,padding:[3,4],disabled:!o})),l&&a.createElement(m.Text,{color:"error"},l)))},wn=e=>{let{needsCommitment:t,commitment:n,handleCommitmentChange:l}=e;return t&&a.createElement(m.Flex,{column:!0,gap:2},a.createElement(m.Flex,{gap:4,alignItems:"baseline"},a.createElement(m.Text,{strong:!0,style:{whiteSpace:"nowrap"}},"Committed Nodes"),a.createElement(m.TextInput,{onChange:l,value:n,placeholder:"i.e. 14",type:"number",min:1})),a.createElement(m.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(m.Text,null,"You are moving from ",a.createElement(m.Text,{strong:!0},"Early Bird")," plan to another plan, you won't be able to come back to this. The ",a.createElement(m.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(m.Text,null,"You are moving from ",a.createElement(m.Text,{strong:!0},"Community (2023.02)")," plan to another plan, you won't be able to come back to this. The new ",a.createElement(m.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:Nt.N_,onClick:t,to:n,disabled:!n},a.createElement(m.Text,{color:"primary"},"View plans page")),".")},pro:()=>a.createElement(m.Text,null,"You are moving from ",a.createElement(m.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(m.Flex,{gap:3},a.createElement(m.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=s.default.div.withConfig({displayName:"withTableWrapper__TableWrapper",componentId:"sc-drcfxi-0"})(["margin-top:30px;"]),Mn=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}),Dn={size:50,minSize:50,maxSize:100},Ln=e=>()=>a.createElement(m.Flex,{width:"100%",justifyContent:"end"},e),Nn=e=>{let{getValue:t}=e;return a.createElement(m.Flex,{width:"100%",justifyContent:"end"},t())},Rn=[{id:"name",accessor:"name",header:"",...Dn,fullWidth:!0},{id:"price",accessor:"price",header:Ln("Price"),cell:Nn,...Dn},{id:"qty",accessor:"qty",header:Ln("Qty"),cell:Nn,...Dn},{id:"month",accessor:"month",header:Ln("Month"),cell:Nn,...Dn},{id:"total",accessor:"total",header:Ln("Total"),cell:Nn,...Dn}],Bn=e=>a.createElement(m.Flex,(0,r.A)({gap:3},e),a.createElement(m.Icon,{size:"large",color:"warning",name:"warning_triangle"}),a.createElement(m.Text,null,"No immediate charges are applicable to this plan subscription. On-demand usage charges will be applied based on your node period count.")),_n=(Un=m.Table,e=>a.createElement(Pn,null,a.createElement(Un,e)));var Un;const On=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 o=e.isInfo?m.TextSmall:m.Text;return a.createElement(m.Flex,{key:e.description,justifyContent:"between"},a.createElement(o,n,e.description),a.createElement(o,n,Mn.format(null===(t=e.total)||void 0===t?void 0:t.amount)))})))},Vn=(e=>t=>{var n;return t.lineItems.totalPayable?null!==(n=t.lineItems.info)&&void 0!==n&&n.length?a.createElement(m.Flex,{column:!0,gap:1},a.createElement(e,t),a.createElement(On,{lineItems:t.lineItems.info})):a.createElement(e,t):null})((e=>{let{lineItems:t}=e;return a.createElement(m.Flex,{justifyContent:"between",margin:[4,0,0,0]},a.createElement(m.H0,{strong:!0},"Total payable"),a.createElement(m.H0,{strong:!0,"data-testid":"totalPayableAmountPreview"},Mn.format(t.totalPayable.total.amount)))})),Hn=e=>{let{previewData:t,lineItems:n,agree:l,toggleAgree:o,zeroPreviewSubscriptionTotal:r,isUpdate:i}=e;const c=!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),r&&a.createElement(Bn,{padding:[0,0,2,0]}),a.createElement(m.Flex,{gap:3},a.createElement(m.Checkbox,{checked:l,onChange:o,disabled:!c}),a.createElement(m.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(Vn,{lineItems:n}))},Wn=e=>{let{lineItems:t}=e;return a.createElement(a.Fragment,null,a.createElement(_n,{dataColumns:Rn,data:t.table}),a.createElement(bn,null),a.createElement(On,{lineItems:t.footer}))};var Yn=n(34641),qn=n(25624);const jn=e=>{let{title:t,onConfirm:n,onClose:l}=e;const{sendButtonClickedLog:o,isReady:r}=(0,Te.A)(),{onTrial:i}=(0,qn.A)(),c=(0,a.useCallback)((()=>{n(),l(),o({description:"confirm-billing-plan-change"},!0)}),[o,r]),s=(0,a.useCallback)((()=>{l(),o({description:"close-billing-plan-change-confirmation-dialog"},!0)}),[o,r]),d="Community"==t,u=d?"Cancellation":"Downgrading";return i?a.createElement(Yn.A,{onDecline:s}):a.createElement(m.ConfirmationDialog,{confirmLabel:"Yes","data-ga":"downgrade-dialog","data-testid":"downgradeDialog",handleConfirm:c,handleDecline:s,message:a.createElement(m.Flex,{column:!0,gap:2},a.createElement(m.Text,null,"Are you sure you want to ",a.createElement(m.Text,{strong:!0},"move to the ",t," plan")," and cancel your current plan?"),d&&a.createElement(m.Text,null,"Upon cancellation,"," ",a.createElement(m.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(m.Text,null,"For the next 24 hours, you will be able to use all your current notification method configurations."," ",a.createElement(m.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(m.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(m.Text,{strong:!0},"Users with unavailable roles on the ",t," plan will immediately have restricted access to the Space.")),a.createElement(m.Text,null,"Do you wish to proceed?")),title:"Go to ".concat(t," plan?")})};var zn=n(88116);const Jn=e=>{let{isUpdate:t,currentPlan:n={},billingEmail:l,paymentMethod:o,...i}=e;const[c,s]=(0,pn.Qh)(),d=!!n.billingEmail&&!s;return t&&l&&o?null:a.createElement(m.Flex,(0,r.A)({gap:3,alignItems:"center"},i),a.createElement(m.Icon,{size:"large",color:"warning",name:"warning_triangle"}),a.createElement(m.Flex,{column:!0,gap:1},a.createElement(m.Text,null,"You can't proceed to checkout without having provided a"," ",a.createElement(m.Text,{strong:!0},"payment method")," and a ",a.createElement(m.Text,{strong:!0},"billing address"),"."),a.createElement(ue.A,{cursor:d?"pointer":"default",disabled:!d,onClick:c,gap:1,"data-ga":"billing-options::click::billing"},"Please go to the billing portal and fill a payment method")))};var Gn=n(79731);const $n=e=>e?"::commited-".concat(e):"",Kn=(0,s.default)(m.Flex).withConfig({displayName:"checkoutTotals__CheckoutButtonWrapper",componentId:"sc-1q0h6ca-0"})(["background:",";padding:16px 0;position:sticky;bottom:0;z-index:20;"],(0,m.getColor)("mainBackground")),Zn=(0,te.A)(m.Button),Qn=(e=>t=>{let{title:n,isDowngrade:l,isUpdate:o,checkoutOrUpdate:i,...c}=t;const[s,,m,d]=(0,b.A)();return o&&l?a.createElement(a.Fragment,null,s&&a.createElement(jn,{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,s.default)(Zn).withConfig({displayName:"checkoutTotals__CheckoutButton",componentId:"sc-1q0h6ca-1"})(["flex:auto;"])),Xn=e=>{let{title:t,slug:n,onClose:l,currentPlan:o,price:r,commitment:i,currentCommitment:c=0,email:s,needsCommitment:d,previewData:u,loadingPreview:g,isUpdate:p,promotionCode:E}=e;const h=((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)})(o.slug,n),[f,v]=(0,b.A)(!1),x=p&&!f||!p&&!s||d&&(c===i||!i||i<1),[y,C]=(0,b.A)(),w=(0,pn.L_)(),A=(0,pn.M4)(),T=p||o.billingEmail,S=T?A:w,{sendLog:I,isReady:k}=(0,Te.A)(),[F,P]=(0,me.A)(),M=(0,a.useCallback)((()=>{C(),S({productId:r.id,email:(null===u||void 0===u?void 0:u.billingEmail)||s,...d&&{commitment:i},...E&&{promotionCode:E}}).then((()=>{l(),I({isSuccess:!0,details:S==T?"update-billing-plan":"checkout-billing-plan"},!0),F({header:"Success",text:"You have successfully updated your plan"})})).catch((e=>{var t;I({isFailure:!0,details:S==T?"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;P({header:"Error",text:(0,Gn.o)(null===n||void 0===n?void 0:n.errorMsgKey)||(null===n||void 0===n?void 0:n.errorMessage)||"Something went wrong"})})).finally(C)}),[I,k]),D=(L=null===u||void 0===u?void 0:u.invoiceLineItems,(0,a.useMemo)((()=>{if(null===L||void 0===L||!L.length)return null;let e=!1;return L.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:Mn.format(n.unitPrice.amount),qty:n.quantity,month:n.month,total:Mn.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:[]})}),[L]));var L;const N=((null===D||void 0===D?void 0:D.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(m.Flex,{column:!0,gap:3},g||!D||N?null:a.createElement(Wn,{lineItems:D}),a.createElement(Kn,{column:!0,gap:2},p&&!g&&D&&a.createElement(Hn,{isUpdate:p,previewData:u,lineItems:D,agree:f,toggleAgree:v,zeroPreviewSubscriptionTotal:N}),p&&!g&&a.createElement(Jn,{currentPlan:o,billingEmail:null===u||void 0===u?void 0:u.billingEmail,paymentMethod:null===u||void 0===u?void 0:u.paymentMethod,padding:[0,0,4,0],isUpdate:p}),a.createElement(Qn,{title:t,isDowngrade:h,label:p?"Checkout":"Proceed to checkout",disabled:!!x||y,checkoutOrUpdate:M,isLoading:y,"data-ga":"proceedTocheckoutButton::click-".concat(Fn(r)).concat($n(i),"::billing"),"data-testid":"billingCheckoutTotals-proceedToCheckoutButton",isUpdate:p})))},ea=e=>{let{prices:t,currentPlan:n}=e;const[l,o]=(0,a.useState)(0),r=t[l],i=null===r||void 0===r?void 0:r.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:o,price:r,needsCommitment:i,commitment:u,handleCommitmentChange:e=>g(e.target.value?parseInt(e.target.value,10):"")}},ta=function(){let{title:e="Checkout"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>n=>a.createElement(u.GO,{onClose:n.onClose},a.createElement(g.z,{onClose:n.onClose,title:e}),a.createElement(m.Flex,{column:!0,padding:[4,4,0,4],justifyContent:"between",height:"calc(100vh - 60px)",overflow:"auto"},a.createElement(t,n)))},na=3e5,aa=ta({title:"Update plan"})((e=>{let{title:t,onClose:n,prices:o,currentPlan:i={},children:c}=e;const{recurringIndex:s,setRecurringIndex:d,price:u,needsCommitment:g,commitment:p,handleCommitmentChange:h}=ea({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)(na),A=(0,E.JT)("billing:Manage"),T=(0,fn.di)({price:u,promotionCode:f,commitment:p}),{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:na)}),[S]),a.createElement(M.Ay,{feature:"Billing::UpdateModal"},A?a.createElement(a.Fragment,null,a.createElement(m.Flex,{column:!0,gap:4},a.Children.map(c,(e=>(0,a.cloneElement)(e,{recurringIndex:s,setRecurringIndex:d}))),a.createElement(wn,{needsCommitment:g,commitment:p,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(Xn,{title:t,slug:u.slug,currentPlan:i,onClose:n,price:u,balance:i.balance,commitment:p,needsCommitment:g,previewData:I,loadingPreview:S,isUpdate:!0,promotionCode:f})):a.createElement(m.Flex,null,a.createElement(m.TextBigger,null,"You don't have permissions to change the plan.")))}));var la=n(45467);const oa=ta()((e=>{let{onClose:t,prices:n,currentPlan:o={},children:r}=e;const{recurringIndex:i,setRecurringIndex:c,price:s,needsCommitment:d,commitment:u,handleCommitmentChange:g}=ea({prices:n,currentPlan:o}),p=(0,ve.uW)("email"),[h,b]=(0,a.useState)(o.billingEmail||p||""),f=(0,E.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:s.id,promotionCode:x,...d&&u&&{commitment:u}}),[A,T]=(0,a.useState)(0),S=(0,fn.Lf)({price:s,promotionCode:x,commitment:u}),{loading:I,value:k}=(0,pn.Tr)(S,A);return(0,la.A)((()=>()=>T((e=>e+1))),[C,!x]),a.createElement(M.Ay,{feature:"Billing::CheckoutModal"},f?a.createElement(a.Fragment,null,a.createElement(m.Flex,{column:!0,gap:4},a.Children.map(r,(e=>(0,a.cloneElement)(e,{recurringIndex:i,setRecurringIndex:c}))),a.createElement(wn,{needsCommitment:d,commitment:u,handleCommitmentChange:g}),a.createElement(bn,null),a.createElement(m.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:o,onCtaClick:t})),a.createElement(Xn,{currentPlan:o,onClose:t,price:s,balance:o.balance,commitment:u,email:h,needsCommitment:d,previewData:k,loadingPreview:I,promotionCode:x})):a.createElement(m.Flex,null,a.createElement(m.TextBigger,null,"You don't have permissions to change the plan.")))}));var ra=n(21290),ia=n(12602),ca=n(49389);const sa=[{free:a.createElement(m.H0,null,"Free forever"),homelab:a.createElement(m.H0,null,"$90.00",a.createElement(m.TextSmall,{color:"textLite"},"/year")),"business_2023.02":a.createElement(a.Fragment,null,a.createElement(m.H0,null,"$3.00",a.createElement(m.TextSmall,{color:"textLite"},"/Node/month (billed yearly)")),a.createElement(m.Text,null,a.createElement(m.Text,{strong:!0},"25% discount")," is applied for annual billing.")),"business_2024.03":a.createElement(a.Fragment,null,a.createElement(m.H0,null,a.createElement(m.TextSmall,{color:"textLite"},"Up to")," $4.50",a.createElement(m.TextSmall,{color:"textLite"},"/Node/month (billed yearly)")),a.createElement(m.Flex,{column:!0},a.createElement(m.Text,null,a.createElement(m.Text,{strong:!0},"25% discount")," is applied for annual billing."),a.createElement(m.Text,null,a.createElement(m.Text,{strong:!0},"+ volume discounts")," based on number of committed nodes"))),business:a.createElement(a.Fragment,null,a.createElement(m.H0,null,a.createElement(m.TextSmall,{color:"textLite"},"Up to")," $4.50",a.createElement(m.TextSmall,{color:"textLite"},"/Node/month (billed yearly)")),a.createElement(m.Flex,{column:!0},a.createElement(m.Text,null,a.createElement(m.Text,{strong:!0},"25% discount")," is applied for annual billing."),a.createElement(m.Text,null,a.createElement(m.Text,{strong:!0},"+ volume discounts")," based on number of committed nodes")))},{free:a.createElement(m.H0,null,"Free forever"),homelab:a.createElement(m.H0,null,"$10.00",a.createElement(m.TextSmall,{color:"textLite"},"/month")),"business_2023.02":a.createElement(a.Fragment,null,a.createElement(m.H0,null,"$4.00",a.createElement(m.TextSmall,{color:"textLite"},"/Node/month"))),"business_2024.03":a.createElement(a.Fragment,null,a.createElement(m.H0,null,"$6.00",a.createElement(m.TextSmall,{color:"textLite"},"/Node/month"))),business:a.createElement(a.Fragment,null,a.createElement(m.H0,null,"$6.00",a.createElement(m.TextSmall,{color:"textLite"},"/Node/month")))}],ma=e=>{let{recurringIndex:t,slug:n,version:l}=e;return a.createElement(m.Flex,{column:!0,gap:2},sa[t]["".concat(n,"_").concat(l)]||sa[t][n])},da=s.default.div.withConfig({displayName:"pricingDetails__OneLine",componentId:"sc-hbslp4-0"})(["white-space:nowrap white-space:nowrap;"]),ua=e=>{let{nodesLastPeriod:t,committedNodes:n}=e;const l=t-n,o=l>0;return 0==l?a.createElement(m.TextSmall,null,"You are using all your committed nodes."):o?a.createElement(m.TextSmall,null,"You are using"," ",a.createElement(m.TextSmall,{strong:!0,color:"error"},l," ",(0,ca.su)(l).toLowerCase()," more")," ","than your committed nodes."):a.createElement(m.TextSmall,null,"You are using"," ",a.createElement(m.TextSmall,{strong:!0,color:"success"},t," out of ",n)," ","committed ",(0,ca.su)(n).toLowerCase(),".")},ga=e=>{let{interval:t,currentPeriodTo:n,committedNodes:l,nodesLastPeriod:o,showPromotion:r,cancelling:i,onCancelPlan:c,commitment:s}=e;const{localeDateString:d}=(0,ra.$j)();return a.createElement(m.Flex,{column:!0,gap:1},!!n&&a.createElement(m.TextSmall,null,a.createElement(m.TextSmall,{strong:!0,"data-testid":"billingPricingDetails-interval"},"Billing ".concat(zn.rY[t]))," ","(renews ",d(new Date(n),{long:!1}),")"),r&&"month"===t&&a.createElement(ue.A,{onClick:c,disabled:i},a.createElement(da,null,"Save 25% by changing your billing frequency to yearly")),s?a.createElement(a.Fragment,null,a.createElement(m.TextSmall,null,"Committed Nodes:"," ",a.createElement(m.Text,{strong:!0,"data-testid":"billingPricingDetails-committedNodesNumber"},l)),"number"===typeof o?a.createElement(ua,{nodesLastPeriod:o,committedNodes:l}):null):null)},pa=e=>{let{features:t,showViewDetails:n}=e;return a.createElement(m.Flex,{column:!0,gap:1},t.map((e=>a.createElement(m.Flex,{gap:2,key:e},a.createElement(m.Box,{width:5},a.createElement(m.Icon,{name:"check",width:"20px",height:"20px",color:"primary"})),a.createElement(m.TextSmall,null,e)))),n&&a.createElement(m.Flex,{gap:2},a.createElement(m.Box,{width:5}),a.createElement(ue.A,{Component:m.Flex,as:Nt.N_,cursor:"pointer",alignItems:"center",gap:1,color:"text",hoverColor:"textFocus",to:"all-plans"},a.createElement(m.Text,{strong:!0},"View full details"),a.createElement(m.Icon,{name:"chevron_right",width:"16px",height:"16px"}))))},Ea=(e=>t=>{let{inModal:n,recurringIndex:l,setRecurringIndex:o,...r}=t;return n?a.createElement(m.Flex,{width:"100%",justifyContent:"between",alignItems:"center"},a.createElement(e,r),a.createElement(m.Flex,{gap:3,padding:[0,10]},zn.HR.map(((e,t)=>a.createElement(m.RadioButton,{key:e,checked:l===t,onChange:()=>o(t),"data-testid":"billingPaidPlans-".concat(e,"-radioButton")},a.createElement(m.Text,{color:"textDescription"},(0,_e.Zr)(zn.rY[e]))))))):a.createElement(e,r)})((e=>{let{children:t}=e;return a.createElement(m.H3,{"data-testid":"billingPricingDetails-activePlanName"},t)})),ha=e=>{var t;let{slug:n,version:l,prices:o,recurringIndex:i=0,setRecurringIndex:c,currentPlan:s={},isActive:d,showAllDetails:u,showTeaserDetails:g,cancelling:p,onCancelPlan:E,title:h,features:b,nodesLastPeriod:f,inModal:v}=e;const{onTrial:x}=(0,qn.A)(),y=d?s.pricing:(null===(t=o[i])||void 0===t?void 0:t.pricing)||{},C=(0,fn.Kj)(n);return a.createElement(m.Flex,{column:!0,gap:2},a.createElement(m.Flex,{column:!0},a.createElement(m.Flex,{alignItems:"center",gap:2},a.createElement(Ea,{inModal:v,recurringIndex:i,setRecurringIndex:c},h),d&&a.createElement(a.Fragment,null,a.createElement(m.Pill,{flavour:"success","data-testid":"active-plan",icon:"checkmark_s"},x?"Trial":"Active"),x&&!u&&a.createElement(ia.A,null,a.createElement(m.TextBig,{color:"primary"},"Upgrade Now!")))),l&&a.createElement(m.TextBig,null,"(",l,")")),u||!d||"free"===n?a.createElement(ma,(0,r.A)({inModal:v,isActive:d,currentPlan:s,recurringIndex:i,slug:n,version:l},y)):null,g&&null!==b&&void 0!==b&&b[l]?a.createElement(pa,{features:b[l],showViewDetails:!C}):null,d&&!(0,fn.Kj)(n)&&!x&&a.createElement(ga,(0,r.A)({},s,{showPromotion:!0,cancelling:p,onCancelPlan:E,nodesLastPeriod:f})))},ba=e=>{let{onConfirm:t}=e;const{sendButtonClickedLog:n}=(0,Te.A)(),[l,o]=(0,b.A)(),r=(0,a.useCallback)((()=>{n({feature:"HomelabAcceptTerms"}),t()}),[n]);return a.createElement(m.ConfirmationDialog,{title:"Terms of usage",confirmLabel:"I agree",handleConfirm:r,hideDecline:!0,isConfirmPositive:!0,isConfirmDisabled:!l,message:a.createElement(m.Flex,{column:!0,gap:2},a.createElement(m.Text,null,"By continuing, you acknowledge that you will use Netdata ONLY for homelab purposes. If professional use is detected you will be downgraded, and will waive any rights to refunds."),a.createElement(m.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(m.Flex,null,a.createElement(m.Checkbox,{checked:l,onChange:o,label:"I will NOT use the Homelab plan for professional purposes (this includes testing and staging environments).",labelPosition:"right",labelProps:{strong:!0,padding:[0,0,0,1]}})),a.createElement(m.Text,null))})};var fa=n(67276),va=n(47431),xa=n(93476),ya=n(66732),Ca=n(97118);const wa=(0,s.default)(m.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?"240px":"auto"}),(e=>{let{showAllPlans:t}=e;return t?"center":"auto"})),Aa=e=>{let{slug:t,version:n,prices:l=[],isSmall:i,isActive:c,currentPlan:s,showAllPlans:d,showTeaserDetails:u,allPlansView:g=!1,nodesLastPeriod:p,numberOfPlans:h,...f}=e;const v=(0,ve.NJ)(),x=(0,o.vt)(),{title:y,features:C}=zn.FJ[t]||zn.FJ.free,w=(0,E.JT)("billing:Manage"),{sendLog:A,sendButtonClickedLog:T,isReady:S}=(0,Te.A)(),{onTrial:I}=(0,qn.A)(),{cancelling:k,startCancelling:F,stopCancelling:P}=(0,pn.og)(),M="AWS"==s.paymentProvider,D=(0,a.useCallback)((function(){let{label:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};T({label:e},!0)}),[T,S]),L=(0,fn.z_)({currentPlan:s,slug:t,version:n,onTrial:I}),N=k||c&&(0,fn.Kj)(t)||s.slug==zn.VH.earlyBird&&t==zn.VH.free||s.slug==zn.VH.free&&"2023.02"==s.version&&t==zn.VH.free&&"2023.11"==n,[R,B]=(0,a.useState)({}),[_,,U,O]=(0,b.A)(),[V,H]=(0,me.A)(),W=(0,pn.M4)(),Y="cancel"===R.type&&!(0,fn.Kj)(s.slug)&&!_,q="cancel"===R.type&&t==zn.VH.free&&"2023.11"==n,{id:j}=(0,Ca.A)(),z=(0,$e.ly)(),J=(0,a.useCallback)((()=>{U(),F(),W({productId:j}).then((()=>{V({header:"Successfully canceled subscription",text:"You are now on Community plan"}),A({isSuccess:!0,description:"cancel-subscription"})})).catch((()=>{H({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(),z()}))}),[A,S]),G=(0,a.useMemo)((()=>"user-".concat(v,"-space-").concat(x,"-accept-homelab-terms")),[v,x]),$=(0,a.useCallback)((()=>{localStorage.setItem(G,!0)}),[G]),K=(0,a.useCallback)((()=>"true"==localStorage.getItem(G)),[G]),Z=(0,a.useCallback)((e=>{if(!k&&!N)if(t!=zn.VH.homelab||s.slug==zn.VH.homelab||K()){if((0,fn.Kj)(t))return B({type:"cancel"}),void A(e,!0);if((0,fn.Kj)(s.slug))return le("checkout"),void A(e,!0);le("update"),A(e,!0)}else B({type:"homelab"})}),[A,S,R,B]),Q=(0,a.useCallback)((()=>{B({}),$(),setTimeout((()=>{Z({action:fa.o1.buttonClicked},!0)}),200)}),[B,$,Z]),X=!!s.billingEmail,ee=X?aa:oa,{billingModalType:te,billingModalSlug:ne}=(0,Pt.PP)(),ae=["checkout","update"].includes(te)&&t==ne,le=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})},[oe,,re,ie]=(0,b.A)();return a.createElement(wa,(0,r.A)({column:!0,flex:i,gap:2,justifyContent:"between",showAllPlans:d,numberOfPlans:h,isSmall:i},f),a.createElement(ha,{slug:t,prices:l,isActive:c,currentPlan:s,cancelling:k,showAllDetails:d,showTeaserDetails:u,title:y,version:n,features:C,nodesLastPeriod:p,onCancelPlan:()=>Z({action:fa.o1.buttonClicked,label:y})}),!g&&a.createElement($t.A,{Component:m.Button,permission:"billing:Manage","data-ga":"upgrade-button::click-".concat(Fn({slug:t}),"::current-").concat(Fn(s),"::billing"),"data-testid":"billingPlan-".concat(t,"-").concat(c?"currentPlan":"upgradeButton"),label:L,flavour:(0,fn.Dy)(null===s||void 0===s?void 0:s.slug,t),disabled:N,width:"100%",onClick:()=>Z({action:fa.o1.buttonClicked,label:L,dataGa:"upgrade-button::click-".concat(Fn({slug:t}),"::current-").concat(Fn(s),"::billing")}),isLoading:k&&c,loadingLabel:"Cancelling"}),!d&&a.createElement(a.Fragment,null,I&&a.createElement(xa.A,{flavour:"billing"}),(I||!(0,fn.Kj)(s.slug))&&a.createElement(m.Flex,{column:!0,gap:4},a.createElement(m.Flex,{gap:6,alignItems:"baseline"},I&&a.createElement(va.A,null),!(0,fn.Kj)(s.slug)&&!M&&a.createElement(ue.A,{Component:m.Flex,as:Nt.N_,cursor:"pointer",alignItems:"center",gap:1,color:"text",hoverColor:"textFocus",to:"all-plans",padding:[4,0,0],disabled:k,onClick:()=>D({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(m.Icon,{name:"chevron_right",width:"16px",height:"16px"}))),I&&a.createElement(a.Fragment,null,a.createElement(ya.A,{flavour:"billing",color:"textLite",onOptOutClick:re}),oe&&a.createElement(Yn.A,{onDecline:ie,onCancellingEnd:()=>{}})))),(Y||q)&&a.createElement(jn,{title:y,onConfirm:J,onClose:()=>{O(),B({})}}),"homelab"==R.type?a.createElement(ba,{onConfirm:Q}):null,ae&&a.createElement(ee,{title:y,onClose:()=>{O(),le()},prices:l,currentPlan:s,showProrations:X},a.createElement(ha,{slug:t,prices:l,currentPlan:s,title:y,version:n,inModal:!0})))},Ta=e=>{let{slug:t,isSmall:n,currentPlan:l,showAllPlans:o,allPlansView:i=!1,showTeaserDetails:c,numberOfPlans:s,...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/request-enterprise/","_blank","noopener,noreferrer"),u({feature:"OnPremContact"})}),[u]);return a.createElement(wa,(0,r.A)({column:!0,flex:n,gap:2,justifyContent:"between",showAllPlans:o,numberOfPlans:s,isSmall:n},d),a.createElement(m.Flex,{column:!0,gap:2},a.createElement(m.Flex,{column:!0},a.createElement(m.Flex,{alignItems:"center",gap:2},a.createElement(m.H3,{"data-testid":"billingPricingDetails-activePlanName"},"Enterprise On-Premise"))),a.createElement(m.H0,null,a.createElement(m.TextSmall,{color:"textLite"},"Up to")," $3.52",a.createElement(m.TextSmall,{color:"textLite"},"/Node/month (billed yearly)")),a.createElement(m.Flex,{column:!0},a.createElement(m.Text,null,"Starts at 214 node licenses")),c&&a.createElement(pa,{features:p[2023.11]||[]})),!i&&a.createElement($t.A,{Component:m.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}))},Sa=e=>{let{plans:t,isSmall:n,currentPlan:l,showAllPlans:o,showTeaserDetails:r,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(Aa,{key:"".concat(e,"-").concat(c),slug:e,version:c,prices:s,isActive:l.slug==e&&l.version==c,isSmall:n,currentPlan:l,showAllPlans:o,showTeaserDetails:r,numberOfPlans:i})})))),a.createElement(Ta,{slug:"enterprise",isSmall:n,currentPlan:l,showAllPlans:o,showTeaserDetails:r,numberOfPlans:i}))},Ia=s.default.div.withConfig({displayName:"styled__Container",componentId:"sc-1oa2kv1-0"})(["display:grid;background:",";"," ",""],(0,m.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(" "),";")})),ka=s.default.div.withConfig({displayName:"styled__Header",componentId:"sc-1oa2kv1-1"})(["display:contents;> *{background:",";border-bottom:1px solid ",";}"],(0,m.getColor)("panelBg"),(0,m.getColor)("placeholder")),Fa=(0,s.default)(m.Collapsible).withConfig({displayName:"styled__Content",componentId:"sc-1oa2kv1-2"})(["display:contents;"]),Pa=()=>{const{loaded:e,value:t}=(0,pn.lU)(),n=(0,fn.LJ)(t);return e?n:0},Ma=e=>{var t,n,l,o;let{isSmall:r,plans:i,currentPlan:c,showAllPlans:s=!1,showTeaserDetails:d=!1,showPricingColumn:u}=e;const g="earlyBird"===c.slug,p=Pa(),{version:E}=(0,Ca.A)(),h=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[E]))||void 0===t?void 0:t[0],b=i.earlyBird?null===(o=Object.values(i.earlyBird)[0])||void 0===o?void 0:o[0]:{};return a.createElement(Ia,{numberOfPlans:p,showAllPlans:s,sticky:!0},u?a.createElement(m.Flex,{column:!0,height:50,justifyContent:"center"},a.createElement(m.Text,{strong:!0},"Pricing")):null,g?a.createElement(Aa,{slug:"earlyBird",version:null===b||void 0===b?void 0:b.version,prices:null===b||void 0===b?void 0:b.prices,isSmall:r,isActive:"earlyBird"===c.slug,currentPlan:c,showAllPlans:s,numberOfPlans:p}):a.createElement(Aa,{slug:"free",version:null===h||void 0===h?void 0:h.version,prices:null===h||void 0===h?void 0:h.prices,isSmall:r,isActive:"free"===c.slug&&c.version==(null===h||void 0===h?void 0:h.version),currentPlan:c,showAllPlans:s,showTeaserDetails:d,numberOfPlans:p}),a.createElement(Sa,{plans:i,isSmall:r,currentPlan:c,showAllPlans:s,showTeaserDetails:d,numberOfPlans:p}))},Da=e=>{let{children:t,...n}=e;return a.createElement(m.Flex,(0,r.A)({alignItems:"center",gap:2},n),t)},La=()=>a.createElement(m.Flex,{column:!0,gap:2,width:65},a.createElement(m.TextMicro,null,a.createElement(m.TextMicro,{strong:!0},"Available credit")," for you to use on any plan subscriptions with us."),a.createElement(m.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.")),Na=(0,Ct.A)(ue.A),Ra=e=>{let{currentPlan:t}=e;const[n,l]=(0,pn.Qh)(),o=!!t.billingEmail&&!l,r=(0,E.JT)("billing:ReadAll"),i=null===t||void 0===t?void 0:t.marketplaceUrl,c="AWS"==(null===t||void 0===t?void 0:t.paymentProvider),s=(0,a.useCallback)((()=>{i&&(location.href=i)}),[i]);return a.createElement(m.Flex,{column:!0,gap:2},a.createElement(m.H3,null,"Plan & Billing"),r&&a.createElement(a.Fragment,null,a.createElement(Da,null,c?null:a.createElement(a.Fragment,null,a.createElement(m.Flex,{gap:1,alignItems:"center"},a.createElement(m.Text,null,"Credit:"),a.createElement(m.Text,{"data-testid":"billingHeader-credits",strong:!0},Mn.format(t.balance.amount||0)),a.createElement(Ue.A,{content:La,align:"bottom",isBasic:!0},a.createElement(m.Icon,{name:"information",width:"16px",height:"16px",color:"textLite"}))),a.createElement(hn,null)),a.createElement(m.Text,null,"Billing email:"," ",a.createElement(m.Text,{strong:!0,"data-testid":"billingHeader-email"},t.billingEmail||"-")),a.createElement(hn,null),i?a.createElement(Na,{Component:m.Flex,cursor:"pointer",onClick:s,alignItems:"center",gap:1,tooltip:"Manage your subscription on the AWS Marketplace","data-ga":"billing-options::click::billing","data-testid":"billingHeader-goToMarketplace"},a.createElement("span",null,"Manage your Subscription"),a.createElement(m.Icon,{name:"nav_arrow_goto",width:"12px",height:"12px"})):a.createElement(ue.A,{Component:m.Flex,cursor:o?"pointer":"default",disabled:!o,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(m.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 Ba(){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 _a=n(51730),Ua=n(13999);function Oa(e,t){return(0,Ua.f)(e,-t)}var Va=n(4883);function Ha(e,t){return(0,Va.P)(e,-t)}var Wa=n(35840);function Ya(e,t){const{years:n=0,months:a=0,weeks:l=0,days:o=0,hours:r=0,minutes:i=0,seconds:c=0}=t,s=Oa(Ha(e,a+12*n),o+7*l),m=1e3*(c+60*(i+60*r));return(0,Wa.w)(e,s.getTime()-m)}var qa=n(71600),ja=n(66118),za=n(51891),Ja=n(44731),Ga=n(99851),$a=n(24266),Ka=n(27467),Za=n(36712);const Qa={nodes:1,p90:2,committed_nodes:3},Xa={"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,za.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 el=e=>({nodes:{label:"Daily count",type:"bar",color:(0,m.getColor)("text")({theme:e}),backgroundColor:(0,m.getColor)("primary")({theme:e}),borderColor:(0,m.getColor)("primary")({theme:e}),borderWidth:2,pointStyle:"rectangle",usePointStyle:!0},p90:{label:"Period count",type:"line",color:(0,m.getColor)("text")({theme:e}),borderColor:(0,m.getColor)(["purple","lilac"])({theme:e}),borderWidth:2,fill:!1,stepped:!0},committed_nodes:{label:"Committed nodes",type:"line",color:(0,m.getColor)("text")({theme:e}),borderColor:(0,m.getColor)(["blue","aquamarine"])({theme:e}),borderWidth:2,fill:!1,borderDash:[1,2],borderDashOffset:1,pointStyle:!1}}),tl={border:{side:"all",color:"inputBorder",padding:[3]},round:!0},nl=Ba(),al=(0,_a.o)(Ya(nl,{months:1})),ll=e=>{let{onNodesLastPeriodFetch:t}=e;const n=(0,Ka.rW)("offset"),l=(0,o.vt)(),[r,i]=(0,a.useState)((()=>({start:al,end:nl}))),[c,d,u]=(0,Et.A)((()=>({enabled:!!l&&!!r.start&&!!r.end,fetch:()=>(0,Za.U2)(l,{after:Math.floor((0,qa.W)((0,ra.ii)(r.start,n))/1e3),before:Math.floor((0,qa.W)((0,ra.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),o=l[a.indexOf("nodes")],r=l[a.indexOf("timestamp")];t((e=>e.timestamp>r?e:{timestamp:r,value:o}))}})),[l,r,t]),g=(0,a.useContext)(s.ThemeContext),p=(0,a.useMemo)((()=>{const e=c.data.map((e=>{let[t]=e;return t})),t=c.labels.reduce(((t,n,a)=>a?[{...el(g)[n],data:e.map(((e,t)=>c.data[t][a])),order:Qa[n]},...t]:t),[]);return{labels:e,datasets:t}}),[c]),[E,h]=function(e){let{data:t,annotations:n=[]}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{localeDateString:l}=(0,ra.$j)(),o=(0,a.useRef)(!1),r=(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){!o.current&&r.current&&(o.current=!0,r.current.innerHTML=Xa[t.text],r.current.style.left=e.x+"px",r.current.style.top=e.y+"px",r.current.style.visibility="visible",r.current.style.transform="translateY(-100%)")},onLeave:function(){r.current&&(o.current=!1,r.current.innerHTML="",r.current.style.visibility="hidden")}},tooltip:{enabled:!0,mode:"nearest",intersect:!1,yAlign:"bottom",usePointStyle:!0,position:"follow",backgroundColor:(0,m.getColor)("tooltip")({theme:e}),color:(0,m.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,m.getRgbColor)("attention",.3)({theme:e}),borderDashOffset:0,borderWidth:10,drawTime:"afterDatasetsDraw",label:{drawTime:"afterDatasetsDraw",display:!1,backgroundColor:(0,m.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,m.getColor)("textLite")({theme:e})}},y:{beginAtZero:!0,ticks:{color:(0,m.getColor)("textLite")({theme:e})}}}})),[e,t]);return[i,r]}(g,c);return a.createElement(m.Flex,{column:!0,gap:4},a.createElement(m.Flex,{alignItems:"center",justifyContent:"between"},a.createElement(m.H3,null,"Usage"),a.createElement(Ga.A,{values:r,utc:n,onChange:i,tagging:"billing-usage",isPlaying:!1,onlyDates:!0,accessorProps:tl,padding:[4,0],width:"auto",maxDate:nl})),a.createElement(m.Flex,{position:"relative",height:90},d?a.createElement(Rt.A,{title:"Loading billing data..."}):u?a.createElement($a.H4,{title:"Chart couldn't be loaded"}):a.createElement(Ja.t1,{type:"bar",data:p,options:E}),a.createElement(m.Flex,{ref:h,background:"main",color:"generic",position:"absolute",round:!0,padding:[3],width:{max:75},sx:{visibility:"hidden"},onMouseOver:()=>h.current.style.visibility="hidden"})))},ol=e=>{let{isSmall:t,currentPlan:n,loaded:l,currentLoaded:o,plans:r}=e;const[i,c]=(0,a.useState)({timestamp:null,value:null}),s=r[n.slug]?r[n.slug][n.version]:[];return a.createElement(a.Fragment,null,a.createElement(Ra,{currentPlan:n}),l&&o?a.createElement(a.Fragment,null,(0,fn.Kj)(n.slug)?a.createElement(Ma,{isSmall:t,plans:r,currentPlan:n,showTeaserDetails:!0}):a.createElement(Aa,{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(ll,{onNodesLastPeriodFetch:c})):a.createElement(Rt.A,{title:l?"Loading billing info...":"Loading Netdata plans..."}))};var rl=n(71847);const il={year:"Yearly",month:"Monthly"},cl=e=>{var t;let{currentPlan:n}=e;const l=(0,o.bq)(),[r,i]=(0,pn.Qh)(),{cancelling:c,startCancelling:s,stopCancelling:d}=(0,pn.og)(),u=!!n.billingEmail&&!i,[g,p]=(0,b.A)(),[h,f]=(0,me.A)(),v=(0,pn.M4)(),{title:x}=zn.FJ[n.slug]||zn.FJ.free,{id:y}=(0,Ca.A)(),C=(0,E.JT)("billing:Manage"),w=(0,E.JT)("billing:ReadAll"),{title:A}=zn.FJ[null===n||void 0===n?void 0:n.slug]||zn.FJ.free,T=il[null===n||void 0===n?void 0:n.interval];return a.createElement(m.Flex,{column:!0,gap:2},a.createElement(m.Flex,{gap:2,alignItems:"center"},a.createElement(ue.A,{as:Nt.N_,to:"/spaces/".concat(l,"/settings/billing"),disabled:c,color:"text",hoverColor:"textLite",showToolTip:!0,content:"Back to Plan & Billing",align:"bottom",isBasic:!0},a.createElement(m.Icon,{name:"arrow_left",width:"20px",height:"20px",margin:[1.5,0,0]})),a.createElement(m.H3,null,"All Plans")),a.createElement(Da,null,a.createElement(m.Flex,{gap:1,alignItems:"center"},a.createElement(m.Text,null,"Active plan:"),a.createElement(m.Text,{strong:!0},A)),a.createElement(hn,null),T&&a.createElement(a.Fragment,null,a.createElement(m.Flex,{gap:1,alignItems:"center"},a.createElement(m.Text,null,"Billing frequency:"),a.createElement(m.Text,{strong:!0},T)),a.createElement(hn,null)),n.commitment?a.createElement(m.Flex,{gap:1,alignItems:"center"},a.createElement(m.Text,null,"Committed Nodes:"),a.createElement(m.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(m.Flex,{gap:1,alignItems:"center"},a.createElement(m.Text,null,"Credit:"),a.createElement(m.Text,{strong:!0},Mn.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(m.Icon,{name:"information",width:"16px",height:"16px",color:"textLite"}))),a.createElement(hn,null),a.createElement(m.Flex,{gap:1,alignItems:"center"},a.createElement(m.Text,null,"Billing email:"),a.createElement(m.Text,{strong:!0},(null===n||void 0===n?void 0:n.billingEmail)||"-")),a.createElement(hn,null)),a.createElement(ue.A,{Component:m.Flex,cursor:u?"pointer":"default",disabled:!u,onClick:r,alignItems:"center",gap:1},a.createElement("span",null,"Billing options and Invoices"),a.createElement(m.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:m.Flex,cursor:"pointer",onClick:p,alignItems:"center",gap:1,disabled:c||!C,"data-ga":"cancel-plan::click::billing"},a.createElement(m.Text,{textDecoration:"underline"},c?"Canceling plan...":"Cancel plan")))),a.createElement(hn,{height:1,width:"100%",sx:{borderWidth:"1px 0px 0px 0px",borderColor:"borderSecondary",borderStyle:"solid"}}),g&&a.createElement(jn,{title:"Community",onConfirm:()=>{s(),v({productId:y}).then((()=>((0,rl.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}),h({header:"Successfully canceled subscription",text:"You are now on Community plan"})))).catch((()=>((0,rl.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((()=>{d()}))},onClose:p}))},sl=()=>a.createElement(m.Icon,{name:"check",color:"primary"}),ml=()=>a.createElement(m.Icon,{name:"checkmark_partial_s",color:"textLite"}),dl=()=>a.createElement(m.Icon,{name:"chevron_down_thin",color:"text"}),ul=()=>a.createElement(m.Icon,{name:"chevron_up_thin",color:"text"}),gl=e=>{let{center:t,end:n,...l}=e;return a.createElement(m.Flex,{alignItems:"center",justifyContent:t?"center":n?"end":"start",padding:[2]},a.createElement(m.Text,(0,r.A)({},t?{textAlign:"center"}:{},l)))},pl=e=>{let{children:t,...n}=e;return a.createElement(gl,(0,r.A)({center:!0},n),t?a.createElement(m.Flex,{alignItems:"center",gap:2},t,a.createElement(sl,null)):a.createElement(sl,null))},El=e=>a.createElement(gl,(0,r.A)({center:!0},e),"UNLIMITED"),hl=e=>a.createElement(gl,(0,r.A)({center:!0},e),a.createElement(ml,null)),bl=e=>a.createElement(gl,(0,r.A)({center:!0},e),"SOON"),fl=e=>t=>{const{index:n,title:l="",showAllPlans:o,onToggle:r,collapsed:i}=t,c=Pa();return a.createElement(Ia,{numberOfPlans:c,showAllPlans:o},a.createElement(ka,{onClick:()=>r(n)},a.createElement(gl,{strong:!0},l),Array.from(Array(c-1).keys()).map((e=>a.createElement(gl,{key:e}))),a.createElement(gl,{end:!0},i[n]?a.createElement(ul,null):a.createElement(dl,null))),a.createElement(Fa,{open:!i[n]},a.createElement(e,t)))},vl=(0,a.memo)(fl((()=>a.createElement(a.Fragment,null,a.createElement(gl,null,"Scalability"),a.createElement(gl,{center:!0},"Vertical and Horizontal"),a.createElement(gl,{center:!0},"Vertical and Horizontal"),a.createElement(gl,{center:!0},"Vertical and Horizontal"),a.createElement(gl,{center:!0},"Vertical and Horizontal"),a.createElement(gl,null,"High Availability"),a.createElement(pl,null),a.createElement(pl,null),a.createElement(pl,null),a.createElement(pl,null),a.createElement(gl,null,"Data Retention"),a.createElement(El,null),a.createElement(El,null),a.createElement(El,null),a.createElement(El,null),a.createElement(gl,null,"Data Privacy"),a.createElement(gl,{center:!0},"Data stored On-Prem and visualized on Netdata Cloud"),a.createElement(gl,{center:!0},"Data stored On-Prem and visualized on Netdata Cloud"),a.createElement(gl,{center:!0},"Data stored On-Prem and visualized on Netdata Cloud"),a.createElement(gl,{center:!0},"Data stored and visualized On-Prem"),a.createElement(gl,null,"Configuration"),a.createElement(gl,{center:!0},"Manual, IaC or in App(UI)"),a.createElement(gl,{center:!0},"Manual, IaC or in App(UI)"),a.createElement(gl,{center:!0},"Manual, IaC or in App(UI)"),a.createElement(gl,{center:!0},"Manual, IaC or in App(UI)"))))),xl=(0,a.memo)(fl((e=>{let{freePlanLimitattions:t}=e;return a.createElement(a.Fragment,null,a.createElement(gl,null,"Customizable charts"),a.createElement(pl,null),a.createElement(pl,null),a.createElement(pl,null),a.createElement(pl,null),a.createElement(gl,null,"Infrastructure wide Dashboards"),a.createElement(pl,null),a.createElement(pl,null),a.createElement(pl,null),a.createElement(pl,null),a.createElement(gl,null,"Centralized Alerts Management"),a.createElement(pl,null),a.createElement(pl,null),a.createElement(pl,null),a.createElement(pl,null),a.createElement(gl,null,"Infrastructure Organization (Rooms)"),a.createElement(pl,null),a.createElement(pl,null),a.createElement(pl,null),a.createElement(pl,null),a.createElement(gl,null,"Custom Dashboards"),a.createElement(pl,null,null!==t&&void 0!==t&&t.maxDashboards?a.createElement(m.Text,null,"(Limited to ",t.maxDashboards," per Room)"):null),a.createElement(pl,null),a.createElement(pl,null),a.createElement(pl,null),a.createElement(gl,null,"Access dashboards from anywhere in the world"),a.createElement(pl,null),a.createElement(pl,null),a.createElement(pl,null),a.createElement(pl,null),a.createElement(gl,null,"Role Based Access Control (RBAC)"),a.createElement(pl,null),a.createElement(pl,null),a.createElement(pl,null),a.createElement(pl,null),a.createElement(gl,null,"Auditing"),a.createElement(pl,null),a.createElement(pl,null),a.createElement(pl,null),a.createElement(pl,null),a.createElement(gl,null,"Invite Team Members"),a.createElement(pl,null),a.createElement(pl,null),a.createElement(pl,null),a.createElement(pl,null),a.createElement(gl,null,"Functions"),a.createElement(pl,null),a.createElement(pl,null),a.createElement(pl,null),a.createElement(pl,null),a.createElement(gl,null,"Netdata Assistant"),a.createElement(pl,null),a.createElement(pl,null),a.createElement(pl,null),a.createElement(pl,null),a.createElement(gl,null,"Mobile App"),a.createElement(hl,null),a.createElement(pl,null),a.createElement(pl,null),a.createElement(hl,null),a.createElement(gl,null,"Centralized Management of Integrations"),a.createElement(bl,null),a.createElement(bl,null),a.createElement(bl,null),a.createElement(bl,null))}))),yl=(0,a.memo)(fl((e=>{let{freePlanLimitattions:t}=e;return a.createElement(a.Fragment,null,a.createElement(gl,null,"Active Connected Nodes"),null!==t&&void 0!==t&&t.maxNodes?a.createElement(gl,{center:!0},"Max of ",t.maxNodes):a.createElement(El,null),a.createElement(El,null),a.createElement(El,null),a.createElement(El,null),a.createElement(gl,null,"Active Custom Dashboards"),null!==t&&void 0!==t&&t.maxDashboards?a.createElement(gl,{center:!0},"Max of ",t.maxDashboards," per Room"):a.createElement(El,null),a.createElement(El,null),a.createElement(El,null),a.createElement(El,null),a.createElement(gl,null,"Infrastructure metrics"),a.createElement(El,null),a.createElement(El,null),a.createElement(El,null),a.createElement(El,null),a.createElement(gl,null,"APM metrics"),a.createElement(El,null),a.createElement(El,null),a.createElement(El,null),a.createElement(El,null),a.createElement(gl,null,"Custom metrics"),a.createElement(El,null),a.createElement(El,null),a.createElement(El,null),a.createElement(El,null),a.createElement(gl,null,"Synthetic checks"),a.createElement(El,null),a.createElement(El,null),a.createElement(El,null),a.createElement(El,null),a.createElement(gl,null,"Monitor system journal logs"),a.createElement(El,null),a.createElement(El,null),a.createElement(El,null),a.createElement(El,null),a.createElement(gl,null,"Auditing Events"),a.createElement(gl,{center:!0},"4 hours"),a.createElement(gl,{center:!0},"90 days"),a.createElement(gl,{center:!0},"90 days"),a.createElement(gl,{center:!0},"As required"),a.createElement(gl,null,"Topology Events"),a.createElement(gl,{center:!0},"4 hours"),a.createElement(gl,{center:!0},"14 days"),a.createElement(gl,{center:!0},"14 days"),a.createElement(gl,{center:!0},"As required"),a.createElement(gl,null,"Alert Events"),a.createElement(gl,{center:!0},"4 hours"),a.createElement(gl,{center:!0},"60 days"),a.createElement(gl,{center:!0},"60 days"),a.createElement(gl,{center:!0},"As required"),a.createElement(gl,null,"Alert Notification Integrations"),a.createElement(gl,{center:!0},"Email, Discord"),a.createElement(gl,{center:!0},"Email, Discord, Webhook, Mattermost, Opsgenie, PagerDuty, RocketChat, Slack, and more"),a.createElement(gl,{center:!0},"Email, Discord, Webhook, Mattermost, Opsgenie, PagerDuty, RocketChat, Slack, and more"),a.createElement(gl,{center:!0},a.createElement(m.Text,null,"Same as Business plan"),a.createElement("br",null),a.createElement(m.TextSmall,null,"(Custom requests can be handled)")),a.createElement(gl,null,"User Administration"),a.createElement(gl,{center:!0},"Basic"),a.createElement(gl,{center:!0},"Advanced"),a.createElement(gl,{center:!0},"Advanced"),a.createElement(gl,{center:!0},"Advanced"))}))),Cl=(0,a.memo)(fl((e=>{let{isEarlyBird:t}=e;return a.createElement(a.Fragment,null,a.createElement(gl,null,a.createElement(m.Text,{id:"administrators"},"Administrators"),a.createElement("br",null),a.createElement(m.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(pl,null),a.createElement(pl,null),a.createElement(pl,null),a.createElement(pl,null),a.createElement(gl,null,a.createElement(m.Text,{id:"troubleshooters"},"Troubleshooters"),a.createElement("br",null),a.createElement(m.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(hl,null),a.createElement(pl,null),a.createElement(pl,null),a.createElement(pl,null),a.createElement(gl,null,a.createElement(m.Text,{id:"managers"},"Managers"),a.createElement("br",null),a.createElement(m.TextSmall,{color:"textDescription"},"Users with this role can manage Rooms and Users. They can access any Room in the Space.")),a.createElement(hl,null),a.createElement(pl,null),a.createElement(pl,null),a.createElement(pl,null),a.createElement(gl,null,a.createElement(m.Text,{id:"observers"},"Observers"),a.createElement("br",null),a.createElement(m.TextSmall,{color:"textDescription"},"Users with this role can only view data in specific Rooms.")),a.createElement(hl,null),a.createElement(pl,null),a.createElement(pl,null),a.createElement(pl,null),a.createElement(gl,null,a.createElement(m.Text,{id:"billing"},"Billing"),a.createElement("br",null),a.createElement(m.TextSmall,{color:"textDescription"},"Users with this role can handle billing options and invoices.")),a.createElement(hl,null),a.createElement(pl,null),a.createElement(pl,null),a.createElement(pl,null),a.createElement(gl,null,a.createElement(m.Text,{id:"billing"},"Member"),a.createElement("br",null),a.createElement(m.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(pl,null):a.createElement(hl,null),a.createElement(hl,null),a.createElement(hl,null),a.createElement(hl,null))}))),wl=(0,a.memo)(fl((()=>a.createElement(a.Fragment,null,a.createElement(gl,null,"Service Availability"),a.createElement(gl,{center:!0},"Best Effort (99.5% in last 12 months)"),a.createElement(gl,{center:!0},"Best Effort (99.5% in last 12 months)"),a.createElement(gl,{center:!0},"99.9% annually (excl. scheduled maintenance)"),a.createElement(gl,{center:!0},"Same as Business plan"),a.createElement(gl,null,"Technical Support"),a.createElement(gl,{center:!0},"Public Forums, Tickets & Chat"),a.createElement(gl,{center:!0},"Public Forums, Tickets & Chat"),a.createElement(gl,{center:!0},a.createElement(m.Text,null,"Public Forums, Tickets & Chat"),a.createElement("br",null),a.createElement(m.Text,{color:"textDescription"},"Need Premium Support?"," ",a.createElement(ue.A,{Component:m.Text,href:"https://www.netdata.cloud/contact-us/?subject=custom-support-requirements",target:"_blank",rel:"noopener noreferrer"},"Reach out to us"))),a.createElement(gl,{center:!0},"Custom Design to Meet Requirements"),a.createElement(gl,null,"Initial Deployment Consulting Services"),a.createElement(gl,{center:!0},"Public Forums, Tickets & Chat"),a.createElement(gl,{center:!0},"Public Forums, Tickets & Chat"),a.createElement(gl,{center:!0},"Public Forums, Tickets & Chat"),a.createElement(gl,{center:!0},"Remote or On Site Consultation and Training During Deployment"))))),Al=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=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,[s,d]=(0,a.useState)((()=>[!1,!0,!0,!0,!0])),u={isOldCommunity:o,isEarlyBird:i,freePlanLimitattions:c,showAllPlans:!0,onToggle:e=>d((t=>(t[e]=!t[e],[...t]))),collapsed:s};return a.createElement(m.Flex,{column:!0,gap:5,height:"100%"},a.createElement(vl,(0,r.A)({title:"General",index:0},u)),a.createElement(xl,(0,r.A)({title:"Features",index:1},u)),a.createElement(yl,(0,r.A)({title:"Usage Allowances",index:2},u)),a.createElement(Cl,(0,r.A)({title:"User Roles",index:3},u)),a.createElement(wl,(0,r.A)({title:"Support",index:4},u)))},Tl=e=>{let{plans:t,loaded:n,currentLoaded:l,currentPlan:o}=e;return a.createElement(m.Flex,{column:!0,height:"100%",gap:3},a.createElement(cl,{currentPlan:o}),n&&l?a.createElement(m.Flex,{overflow:"auto",column:!0,gap:5,height:"100%",padding:[0,0,20,0]},a.createElement(Ma,{plans:t,currentPlan:o,showAllPlans:!0,showPricingColumn:!0}),a.createElement(Al,{plans:t,currentPlan:o})):a.createElement(Rt.A,{title:n?"Loading billing info...":"Loading Netdata plans..."}))},Sl={Community:0,Pro:1,Business:2},Il={month:"Monthly",year:"Yearly"},kl=()=>{const[e,t]=(0,Nt.ok)(),[n,l]=(0,me.A)();(0,a.useEffect)((()=>{const a=e.get("from"),o=e.get("from_committed_nodes"),r=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:o,interval:r,to:c,toNodes:s,fromTrial:m,success:d};(d?n:l)((e=>{let{from:t,to:n,fromNodes:a,toNodes:l,interval:o,fromTrial:r,success:i=!0}=e;if(r)return{header:i?"Successful upgrade":"Failed to upgrade",text:i?"You have successfully upgraded your plan":"Something went wrong"};const c=Il[o]||o;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=Sl[t]>Sl[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,rl.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])},Fl=()=>{const[e]=(0,De.Ay)();return a.createElement(l.C5,{replace:!0,to:"/spaces/".concat(e)})},Pl=()=>{kl();const{loaded:e,value:t}=(0,pn.lU)(),{loaded:n,value:o}=(0,pn.JN)(),r="AWS"==(null===o||void 0===o?void 0:o.paymentProvider),i=(0,gn.J)();return a.createElement(M.Ay,{feature:"Billing"},a.createElement(m.Flex,{column:!0,height:"calc(100% - 30px)",gap:3},a.createElement(l.BV,null,a.createElement(l.qh,{path:"/all-plans",element:r?a.createElement(Fl,null):a.createElement(Tl,{isSmall:i,currentPlan:o,loaded:e,currentLoaded:n,plans:t})}),a.createElement(l.qh,{path:"/",element:a.createElement(ol,{isSmall:i,currentPlan:o,loaded:e,currentLoaded:n,plans:t})}))))};var Ml=n(58205),Dl=n(1239),Ll=n(93155);const Nl=(0,i.A)((()=>Promise.all([n.e(7208),n.e(7304)]).then(n.bind(n,7304)))),Rl=(0,i.A)((()=>Promise.all([n.e(749),n.e(8910),n.e(185)]).then(n.bind(n,70185)))),Bl=(0,i.A)((()=>n.e(8842).then(n.bind(n,8842)))),_l=(0,s.default)(d.t).withConfig({displayName:"manage-workspace__ColumnHeader",componentId:"sc-j9n54n-0"})(["width:180px;padding:16px;"]),Ul=e=>t=>a.createElement(a.Suspense,{fallback:a.createElement(Rt.A,{title:"Loading settings tab..."})},a.createElement(e,t)),Ol=e=>t=>a.createElement(u.Yv,{flex:"1",overflow:"hidden"},a.createElement(e,t)),Vl=e=>t=>{let{containerProps:n={},...l}=t;return a.createElement(u.Yv,(0,r.A)({flex:"1",overflow:"hidden",height:"100%",padding:[4,0,0]},n),a.createElement(e,l))},Hl=Ol(mn),Wl=Ol(Re),Yl=Ol(nt),ql=Ol(Qe),jl=Vl(Yt),zl=Ol(Pl),Jl=Vl(Ul(Nl)),Gl=Ol(Ul(Rl)),$l=Vl(Ul(Bl)),Kl=(0,a.memo)((()=>{const e=(0,l.Zp)(),{state:t={},pathname:n}=(0,l.zy)(),{settingsTab:r,...i}=(0,l.g)(),[s]=(0,a.useState)((null===t||void 0===t?void 0:t.previousUrlPath)||null),d=(0,o.ap)("name"),p=(0,o.ap)("id"),h=(e=>{const t=B.IV.indexOf(e);return-1!==t?t:B.Wk})(r),b=(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(B.IV[t]||B.Wk)})(n,t);e(a)}),[r]);(0,a.useEffect)((()=>{B.ys[r]||e((0,c.tW)(n,{...i,settingsTab:B.Wk}))}),[]);const f=(0,E.JT)("billing:ReadBasic"),v=(0,E.JT)("room:ReadAll"),x=(0,E.JT)("user:ReadAll"),y=(0,E.JT)("channel:ReadAll"),C=(0,A.At)(),w=(0,jt.ES)(p);(0,a.useEffect)((()=>{f||r===B.bO&&e((0,c.tW)(n,{...i,settingsTab:B.Wk}))}),[f,r]);const T=(0,o.bq)(),S=(0,a.useCallback)((t=>{const n=t?"/spaces/".concat(t):s||"/spaces/".concat(T);e(n)}),[s,T]);return d?a.createElement($t.A,{permission:"space:ReadSettings"},(e=>a.createElement(M.Ay,{feature:"SpaceSettings"},a.createElement(u.GO,{full:!0,"data-testid":"manageWorkspaceModal",closeOnClickOutside:!1,onClose:S,width:"100%"},a.createElement(g.z,{"data-testid":"manageWorkspaceModal-header",onClose:S,title:a.createElement(un,null)}),a.createElement(m.Tabs,{row:!0,column:!1,"data-testid":"manageWorkspaceModal-tabs",selected:h,onChange:b,TabsHeader:_l,tabsProps:{column:!0},height:"100%",noDefaultBorder:!0,position:"relative",overflow:"hidden",width:"100%"},w?null:a.createElement(m.Tab,{basis:0,"data-testid":"manageWorkspaceModal-spaceTab",label:B.ys[B.mm],"data-ga":"manage-space::click-tab::space-tab",isMenuItem:!0},a.createElement(Hl,{"data-testid":"manageWorkspaceModal-spaceTabContent",onClose:S,small:!0})),!w&&v?a.createElement(m.Tab,{basis:0,"data-testid":"manageWorkspaceModal-warRoomsTab","data-ga":"manage-space::click-tab::rooms-tab",label:"Rooms",isMenuItem:!0},a.createElement(Wl,{"data-testid":"manageWorkspaceModal-warRoomsTabContent"})):null,w||!v&&!C?null:a.createElement(m.Tab,{basis:0,label:"Nodes","data-testid":"manageWorkspaceModal-nodesTab","data-ga":"manage-space::click-tab::nodes-tab",isMenuItem:!0},a.createElement(Yl,{"data-testid":"manageWorkspaceModal-nodesTabContent"})),!w&&x?a.createElement(m.Tab,{basis:0,"data-testid":"manageWorkspaceModal-usersTab","data-ga":"manage-space::click-tab::users-tab",label:"Users",isMenuItem:!0},a.createElement(ql,{"data-testid":"manageWorkspaceModal-usersTabContent"})):null,!w&&y?a.createElement(m.Tab,{basis:0,label:"Alerts & Notifications","data-testid":"manageWorkspaceModal-notificationsTab","data-ga":"manage-space::click-tab::notifications-tab",isMenuItem:!0},a.createElement(jl,null)):null,w||!f||Dl.ei?null:a.createElement(m.Tab,{basis:0,"data-testid":"manageWorkspaceModal-billingTab","data-ga":"manage-space::click-tab::billing-tab",label:"Plan & Billing",isMenuItem:!0},a.createElement(zl,{"data-testid":"manageWorkspaceModal-billingTabContent"})),!w&&v?a.createElement(m.Tab,{basis:0,"data-testid":"manageWorkspaceModal-integrationsTab","data-ga":"manage-space::click-tab::integrations-tab",label:"Integrations",isMenuItem:!0},a.createElement(Jl,{flavour:Ml.D_.settingsPage,containerProps:{padding:[0]},"data-testid":"manageWorkspaceModal-integrationsTabContent"})):null,a.createElement(m.Tab,{basis:0,"data-testid":"manageWorkspaceModal-configurationsTab","data-ga":"manage-space::click-tab::configurations-tab",label:B.ys[B.$d],isMenuItem:!0},a.createElement(Gl,null)),!w&&Ll.Df?a.createElement(m.Tab,{basis:0,"data-testid":"manageWorkspaceModal-authenticationTab","data-ga":"manage-space::click-tab::authentication-tab",label:B.ys[B.iy],isMenuItem:!0},a.createElement($l,null)):null))))):null})),Zl=()=>{const e=(0,o.ap)("id"),t=(0,jt.ES)(e)?"virtual":"default",n=B.DT[t],{pathname:r,state:i}=(0,l.zy)();return a.createElement(l.BV,null,a.createElement(l.qh,{path:"/",element:a.createElement(l.C5,{state:i,to:{pathname:"".concat(r,"/").concat(n)}})}),a.createElement(l.qh,{path:":settingsTab/*",element:a.createElement(Kl,null)}))}},39522:(e,t,n)=>{"use strict";n.d(t,{A:()=>x});var a=n(58168),l=n(96540),o=n(83199),r=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,r.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:o}=n;return async n=>{let{currentUserId:r,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,[r]),i&&i(v),(0,c.Z8)(o,e),(0,h.Is)(o,e),o((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(o.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),o=n(87860),r=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,r.vt)(),[u,,,g]=(0,c.A)();return(0,o.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}}}]);
\ No newline at end of file |