!function(){try{var h="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},l=(new Error).stack;l&&(h._sentryDebugIds=h._sentryDebugIds||{},h._sentryDebugIds[l]="98fbd4d8-b572-4f81-af4b-e5124497167c",h._sentryDebugIdIdentifier="sentry-dbid-98fbd4d8-b572-4f81-af4b-e5124497167c")}catch(h){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"6845f9ce010d5a446e5d4a40f17204cb8341a07a"},(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[6610],{6610:function(h,l,c){c.r(l),c.d(l,{default:function(){return D}});var t=c(29439),e=c(67294),a=c(64969),v=c(74059),i=c(46667),n=c(87854),o=c.n(n),p=c(95348),d=c.n(p),f=new(o())({id:"partialFailureSvg",use:"partialFailureSvg-usage",viewBox:"0 0 348 348",content:''}),r=(d().add(f),f),Z=c(14809),M=c(91008),s=c(79655),u={noRoomPermission:{header:function(h){return"Your role doesn't give you permission to access any of the troubleshooting information on ".concat(h,".")}},noSpacePermission:{header:function(h){return"Your role doesn't give you permission to access any information on ".concat(h,".")}},noRooms:{header:function(h){return"You currently don't have permission to see any room on ".concat(h,".")}}},m=function(h){var l=h.onClick,c=h.spaceName;return e.createElement(e.Fragment,null,e.createElement(a.Text,{margin:[2,0,0]},"You can also leave this Space if you wish. "),e.createElement(a.Button,{flavour:"borderless",icon:"switch_off",label:"Leave ".concat(c),margin:[0,0,0,7],onClick:l,strong:!0}))},D=function(h){var l=h.reason,c=(0,v.OS)(),n=(0,i.Z)(),o=(0,t.Z)(n,4),p=o[0],d=o[2],f=o[3],D=u[l].header,y=(0,v.uk)();return e.createElement(a.Flex,{alignItems:"center",justifyContent:"center",flex:!0,gap:8},e.createElement("svg",{id:"partial_failure",width:"288px",height:"234px"},e.createElement("use",{xlinkHref:"#".concat(r.id)})),e.createElement(a.Flex,{column:!0,width:{max:125},gap:2},e.createElement(a.H3,null,D(c.name)),"noSpacePermission"===l&&e.createElement(e.Fragment,null,e.createElement(a.Text,null,"Please contact the Space administrators if this is unexpected."),e.createElement(m,{onClick:d,spaceName:c.name})),"noRoomPermission"===l&&e.createElement(a.Text,null,"To manage Plan & Billing information please"," ",e.createElement(M.Z,{as:s.rU,to:"/spaces/".concat(y,"/settings/billing")},"click here.")),"noRooms"===l&&e.createElement(e.Fragment,null,e.createElement(a.Text,null,"Please contact a Space administrator or manager if this is unexpected."),e.createElement(m,{onClick:d,spaceName:c.name}))),p&&e.createElement(Z.Z,{id:c.id,name:c.name,onClose:f}))}},14809:function(h,l,c){c.d(l,{Z:function(){return B}});var t=c(87462),e=c(67294),a=c(64969),v=c(89250),i=c(13477),n=c(94666),o=c(15861),p=c(29439),d=c(64687),f=c.n(d),r=(c(57327),c(41539),c(88449),c(2490),c(59849),c(4480)),Z=c(93017),M=c(274),s=c(46585),u=c(74059),m=c(57079),D=c(58502),y=c(95383),A=c(53606),E="leave-space-dialog",g="leaveSpaceDialog",B=function(h){var l=h.id,c=h.name,d=h.onClose,B=(0,v.s0)(),C=(0,i.Iy)("id"),b=(0,n.H4)(),w=(0,n.nP)(),H=(0,n.Wy)(),V=function(h){var l=(0,Z.Z)(),c=(0,p.Z)(l,2)[1];return(0,r._8)((function(l){var t=l.snapshot,e=l.set,a=l.reset;return function(){var l=(0,o.Z)(f().mark((function l(v){var i,o,d,r,Z,A,E,g,B;return f().wrap((function(l){for(;;)switch(l.prev=l.next){case 0:return i=v.currentUserId,o=v.onSuccess,d=v.onError,l.next=3,t.getPromise((0,u.st)("ids"));case 3:if(r=l.sent,Z=r.filter((function(l){return h!==l})),A=(0,p.Z)(Z,1),E=A[0]){l.next=9;break}return c({header:"Spaces",text:s.T$.leave}),l.abrupt("return");case 9:if(l.t0=E,!l.t0){l.next=14;break}return l.next=13,t.getPromise((0,D.ZP)(E));case 13:l.t0=l.sent;case 14:return g=l.t0,B=g.slug,e((0,u.st)("ids"),Z),e(m.Z,(function(l){return l.filter((function(l){return l!==h}))})),l.prev=18,l.next=21,(0,M.Sz)(h,[i]);case 21:o&&o(B),(0,n.zm)(a,h),(0,y.r1)(a,h),a((0,D.ZP)(h)),l.next=31;break;case 27:l.prev=27,l.t1=l.catch(18),e((0,u.st)("ids"),r),d&&d();case 31:case"end":return l.stop()}}),l,null,[[18,27]])})));return function(h){return l.apply(this,arguments)}}()}),[h])}(l),x=(0,A.Z)(l),F=(0,e.useCallback)((function(h){return B("/spaces/".concat(h))}),[]),S=1===b.length,k=1===w.length&&H,P=S?{confirmLabel:"Yes, leave","data-ga":"".concat(E,"-last-member"),"data-testid":"".concat(g,"LastMember"),handleConfirm:function(){return x({onSuccess:F})},message:e.createElement(e.Fragment,null,"If you leave, space ",e.createElement("strong",null,c)," will be deleted immediately.",e.createElement("br",null),"Are you sure you want to continue?"),title:"Leave and delete ".concat(c," space")}:k?{confirmLabel:"Give rights","data-ga":"".concat(E,"-last-admin"),"data-testid":"".concat(g,"LastAdmin"),handleConfirm:function(){return B("users")},isConfirmPositive:!0,message:e.createElement(e.Fragment,null,"You are the last admin of ",e.createElement("strong",null,c)," space. Please give admin rights to another member so you can leave this space."),title:"Leave ".concat(c," space")}:{confirmLabel:"Yes, leave","data-ga":E,"data-testid":g,handleConfirm:function(){return V({currentUserId:C,onSuccess:F})},message:e.createElement(e.Fragment,null,"You are about to leave ",e.createElement("strong",null,c)," space.",e.createElement("br",null),"Are you sure you want to continue?"),title:"Leave ".concat(c," space")};return e.createElement(a.ConfirmationDialog,(0,t.Z)({handleDecline:d},P))}}}]);