mirror of
https://github.com/OpenMaxIO/openmaxio-object-browser
synced 2026-07-01 07:41:18 -07:00
* Added refresh tenant functionality add icon to Users page to change password commit work to date to github for ongoing use add modal with fields for current and new password on icon click missing swagger files remove unneeded files move changeUserPassword to admin_api, remove field for current password, include selected user Please enter the commit message for your changes. Lines starting added missing js files asset and function signature formatting changes * fixed lint * removed Current Password field, returned Groups label, added selectedUser to modal text * disabled save button if newPasssword and reNewPassword don't match, removed commented out code * Added refresh tenant functionality add icon to Users page to change password commit work to date to github for ongoing use add modal with fields for current and new password on icon click missing swagger files remove unneeded files move changeUserPassword to admin_api, remove field for current password, include selected user Please enter the commit message for your changes. Lines starting added missing js files asset and function signature formatting changes * removed Current Password field, returned Groups label, added selectedUser to modal text * changed Swagger parameters to camel case Co-authored-by: Jill <jill@minio.io>
2 lines
523 KiB
JavaScript
2 lines
523 KiB
JavaScript
(this["webpackJsonpportal-ui"]=this["webpackJsonpportal-ui"]||[]).push([[0],{555:function(e,t,a){},909:function(e,t,a){},910:function(e,t,a){"use strict";a.r(t);var n=a(0),c=a(1),i=a.n(c),r=a(27),o=a.n(r),s=a(6),l=a(56),d=a(72),u=Object(d.a)(),b=a(2),j=a(3),m=a(210),h=a.n(m),p=a(393),O=a.n(p),g=a(962),f=a(1011),x=a(961),v=a(109),y=a(963),S=a(964),C=a(454),k=a(1015),N=a(952),w=a(15),T="USER_LOGGED",E="OPERATOR_MODE",A="MENU_OPEN",_="SERVER_NEEDS_RESTART",I="SERVER_IS_LOADING",M="SET_LOADING_PROGRESS",F="SET_SNACK_BAR_MESSAGE",D="SET_SERVER_DIAG_STAT",L="SET_ERROR_SNACK_MESSAGE",B="SET_SNACK_MODAL_MESSAGE",R="SET_MODAL_ERROR_MESSAGE";function P(e){return{type:T,logged:e}}function z(e){return{type:A,open:e}}function K(e){return{type:_,needsRestart:e}}var U,W=function(e){return{type:F,message:e}},V=function(e){return{type:L,message:e}},G=function(e){return{type:B,message:e}},q=function(e){return{type:R,message:e}},H=a(388),Y=a(389),Q=a(13),Z=a.n(Q),J=a(211),$=a.n(J),X=1073741824,ee=2147483648,te=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],ae=["Ki","Mi","Gi","Ti","Pi","Ei"],ne=["B"].concat(ae),ce=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=0,n=parseInt(e,10)||0;n>=1024&&++a;)n/=1024;var c=["B"].concat(ae);return n.toFixed(n<10&&a>0?1:0)+" "+(t?c[a]:te[a])},ie=function(){var e;$.a.removeItem("token"),e="token",document.cookie=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;"},re=function(e){var t=e.getHours()<10?"0".concat(e.getHours()):"".concat(e.getHours()),a=e.getMinutes()<10?"0".concat(e.getMinutes()):"".concat(e.getMinutes()),n=e.getSeconds()<10?"0".concat(e.getSeconds()):"".concat(e.getSeconds());return"".concat(t,":").concat(a,":").concat(n,":").concat(e.getMilliseconds())},oe=function(){return te.map((function(e){return{label:e,value:e}}))},se=function(){return ae.map((function(e){return{label:e,value:e}}))},le=function(e,t){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=parseFloat(e),c=a?ne:te,i=c.findIndex((function(e){return e===t}));if(-1===i)return"0";var r=Math.pow(1024,i),o=n*r;return o.toString(10)},de=function(e,t,a,n){var c=parseInt(e,10);return ue(t,c,274877906944,a,n)},ue=function(e,t,a,n){var c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(isNaN(e)||isNaN(t)||isNaN(a)||isNaN(n))return{error:"Some provided data is invalid, please try again.",nodes:0,persistentVolumes:0,disks:0,volumePerDisk:0};var i=0,r=0,o=0;if(0===c&&(o=(r=t/(i=Math.floor(Math.min(t/Math.max(4,e),a))))/e),c&&(r=(o=c)*e,i=Math.floor(t/r)),o%1>0){r=(o=Math.ceil(o))*e;var s=(i=Math.floor(t/r))*o*e;if(s>n)return{error:"We were not able to allocate this server.",nodes:0,persistentVolumes:0,disks:0,volumePerDisk:0}}return i<X?{error:"Disk Size with this combination would be less than 1Gi, please try another combination",nodes:0,persistentVolumes:0,disks:0,volumePerDisk:0}:{error:"",nodes:e,persistentVolumes:r,disks:o,pvSize:i}},be=function(e){var t=e.length;return"pool-".concat(t)},je=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"s",a=parseFloat(e);switch(t){case"ns":a=Math.floor(1e-9*a);break;case"ms":a=Math.floor(.001*a)}var n=Math.floor(a/86400);a-=3600*n*24;var c=Math.floor(a/3600);a-=3600*c;var i=Math.floor(a/60);if(a-=60*i,n>365){var r=n/365;return"".concat(r," year").concat(1===Math.floor(r)?"":"s")}if(n>30){var o=Math.floor(n/30),s=n-30*o;return"".concat(o," month").concat(1===Math.floor(o)?"":"s"," ").concat(s>0?"".concat(s," day").concat(s>1?"s":""):"")}if(n>=7&&n<=30){var l=Math.floor(n/7);return"".concat(Math.floor(l)," week").concat(1===l?"":"s")}return n>=1&&n<=6?"".concat(n," day").concat(n>1?"s":""):"".concat(c>=1?"".concat(c," hour").concat(c>1?"s":""):""," ").concat(i>=1&&0===c?"".concat(i," minute").concat(i>1?"s":""):""," ").concat(a>=1&&0===i&&0===c?"".concat(a," second").concat(a>1?"s":""):"")},me=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=new Date(1e3*parseInt(e));return t?"".concat(a.getFullYear(),"-").concat(String(a.getMonth()+1).padStart(2,"0"),"-").concat(String(a.getDay()).padStart(2,"0")," ").concat(a.getHours(),":").concat(String(a.getMinutes()).padStart(2,"0"),":").concat(String(a.getSeconds()).padStart(2,"0")):"".concat(a.getHours(),":").concat(String(a.getMinutes()).padStart(2,"0"))},he=function(e){var t=1e-9*e,a=Math.round(1e4*(t+Number.EPSILON))/1e4;return"".concat(a," s")},pe=function(e){var t=(100*e.split("").reduce((function(e,t){return e+t.charCodeAt(0)+((e<<5)-e)}),0)&16777215).toString(16).toUpperCase();return"#".concat(t.padStart(6,"0"))},Oe=new(function(){function e(){Object(H.a)(this,e)}return Object(Y.a)(e,[{key:"invoke",value:function(e,t,a){var n=this;return h()(e,t).send(a).then((function(e){return e.body})).catch((function(e){return 401===e.status?(ie(),void(window.location.href="/login")):n.onError(e)}))}},{key:"onError",value:function(e){if(e.status){var t=Z()(e.response,"body.message",e.status.toString()),a=t.charAt(0).toUpperCase()+t.slice(1);return Promise.reject(a)}ie(),window.location.href="/login"}}]),e}());!function(e){e.unknown="unknown",e.form="form",e.redirect="redirect",e.serviceAccount="service-account"}(U||(U={}));var ge=Object(N.a)((function(e){return Object(k.a)({disabled:{"&.MuiInput-underline::before":{borderColor:"#eaeaea",borderBottomStyle:"solid"}}})}));function fe(e){var t=ge();return Object(n.jsx)(f.a,Object(j.a)({InputProps:{classes:t}},e))}var xe=Object(s.b)((function(e){return{loggedIn:e.loggedIn}}),{userLoggedIn:P})(Object(w.a)((function(e){return Object(k.a)({"@global":{body:{backgroundColor:"#FAFAFA"}},paper:{borderRadius:8,display:"flex",flexDirection:"column",alignItems:"center",width:800,height:424,margin:"auto",position:"absolute",top:"50%",left:"50%",marginLeft:-400,marginTop:-212,"&.MuiPaper-root":{borderRadius:8}},avatar:{margin:e.spacing(1),backgroundColor:e.palette.secondary.main},form:{width:"100%"},submit:{margin:"30px 0px 16px",height:40,boxShadow:"none",padding:"16px 30px"},errorBlock:{backgroundColor:"#C72C48",width:800,height:64,display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",left:"50%",top:"50%",marginLeft:-400,marginTop:-290,color:"#fff",fontWeight:700,fontSize:14,borderRadius:8,padding:10,boxSizing:"border-box"},mainContainer:{position:"relative",height:424},theOcean:{borderTopLeftRadius:8,borderBottomLeftRadius:8,background:"transparent linear-gradient(to bottom, #073052 0%,#05122b 100%); 0% 0% no-repeat padding-box;"},oceanBg:{backgroundImage:"url(/images/BG_Illustration.svg)",backgroundRepeat:"no-repeat",backgroundPosition:"bottom left",height:"100%",width:324},theLogin:{padding:"40px 45px 20px 45px"},loadingLoginStrategy:{textAlign:"center"},headerTitle:{marginBottom:10},submitContainer:{textAlign:"right"},disclaimer:{fontSize:12,marginTop:30},jwtInput:{marginTop:45},linearPredef:{height:10},errorIconStyle:{marginRight:3}})}))((function(e){var t=e.classes,a=e.userLoggedIn,r=Object(c.useState)(""),o=Object(b.a)(r,2),s=o[0],l=o[1],d=Object(c.useState)(""),j=Object(b.a)(d,2),m=j[0],p=j[1],f=Object(c.useState)(""),k=Object(b.a)(f,2),N=k[0],w=k[1],T=Object(c.useState)(""),E=Object(b.a)(T,2),A=E[0],_=E[1],I=Object(c.useState)({loginStrategy:U.unknown,redirect:""}),M=Object(b.a)(I,2),F=M[0],D=M[1],L=Object(c.useState)(!1),B=Object(b.a)(L,2),R=B[0],P=B[1],z={form:"/api/v1/login","service-account":"/api/v1/login/operator"},K={form:{accessKey:s,secretKey:N},"service-account":{jwt:m}},W=function(e){e.preventDefault(),P(!0),h.a.post(z[F.loginStrategy]||"/api/v1/login").send(K[F.loginStrategy]).then((function(e){var t=e.body;if(t.error)throw P(!1),t.error})).then((function(){a(!0),F.loginStrategy===U.form&&localStorage.setItem("userLoggedIn",btoa(s)),u.push("/")})).catch((function(e){P(!1),_(e.message)}))};Object(c.useEffect)((function(){Oe.invoke("GET","/api/v1/login").then((function(e){D(e),_(""),"redirect"===e.loginStrategy&&e.redirect})).catch((function(e){_(e)}))}),[]);var V=null;switch(F.loginStrategy){case U.form:V=Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsx)(v.a,{component:"h1",variant:"h6",className:t.headerTitle,children:"Console Login"}),Object(n.jsxs)("form",{className:t.form,noValidate:!0,onSubmit:W,children:[Object(n.jsxs)(x.a,{container:!0,spacing:2,children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(fe,{fullWidth:!0,id:"accessKey",value:s,onChange:function(e){return l(e.target.value)},label:"Enter Access Key",name:"accessKey",autoComplete:"username",disabled:R})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(fe,{fullWidth:!0,value:N,onChange:function(e){return w(e.target.value)},name:"secretKey",label:"Enter Secret Key",type:"password",id:"secretKey",autoComplete:"current-password",disabled:R})})]}),Object(n.jsx)(x.a,{item:!0,xs:12,className:t.submitContainer,children:Object(n.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",className:t.submit,disabled:""===N||""===s||R,children:"Login"})}),Object(n.jsx)(x.a,{item:!0,xs:12,className:t.linearPredef,children:R&&Object(n.jsx)(y.a,{})}),Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.disclaimer,children:[Object(n.jsx)("strong",{children:"Don't have an access key?"}),Object(n.jsx)("br",{}),Object(n.jsx)("br",{}),"Contact your administrator to have one made"]})]})]});break;case U.redirect:V=Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsx)(v.a,{component:"h1",variant:"h6",className:t.headerTitle,children:"Welcome"}),Object(n.jsx)(g.a,{component:"a",href:F.redirect.replace("%5BHOSTNAME%5D",window.location.hostname),type:"submit",variant:"contained",color:"primary",className:t.submit,children:"Login with SSO"})]});break;case U.serviceAccount:V=Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsx)(v.a,{component:"h1",variant:"h6",className:t.headerTitle,children:"Operator Login"}),Object(n.jsxs)("form",{className:t.form,noValidate:!0,onSubmit:W,children:[Object(n.jsx)(x.a,{container:!0,spacing:2,children:Object(n.jsx)(x.a,{item:!0,xs:12,className:t.jwtInput,children:Object(n.jsx)(fe,{required:!0,fullWidth:!0,id:"jwt",value:m,onChange:function(e){return p(e.target.value)},label:"JWT",name:"jwt",autoComplete:"off",disabled:R})})}),Object(n.jsx)(x.a,{item:!0,xs:12,className:t.submitContainer,children:Object(n.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",className:t.submit,disabled:""===m||R,children:"Login"})}),Object(n.jsx)(x.a,{item:!0,xs:12,className:t.linearPredef,children:R&&Object(n.jsx)(y.a,{})}),Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.disclaimer,children:[Object(n.jsx)("strong",{children:"Don't have an access key?"}),Object(n.jsx)("br",{}),"Contact your administrator to have one made"]})]})]});break;default:V=Object(n.jsx)(S.a,{className:t.loadingLoginStrategy})}return Object(n.jsxs)(i.a.Fragment,{children:[""!==A&&Object(n.jsxs)("div",{className:t.errorBlock,children:[Object(n.jsx)(O.a,{fontSize:"small",className:t.errorIconStyle})," ",A]}),Object(n.jsx)(C.a,{className:t.paper,children:Object(n.jsxs)(x.a,{container:!0,className:t.mainContainer,children:[Object(n.jsx)(x.a,{item:!0,xs:7,className:t.theOcean,children:Object(n.jsx)("div",{className:t.oceanBg})}),Object(n.jsx)(x.a,{item:!0,xs:5,className:t.theLogin,children:V})]})})]})}))),ve=a(38),ye=a(5),Se=a(967),Ce=a(1010),ke=a(966),Ne=a(1005),we={inputLabel:{fontWeight:600,marginRight:10,fontSize:15,color:"#000",textAlign:"left",overflow:"hidden","& span":{display:"flex",alignItems:"center"},display:"flex"},fieldLabelError:{paddingBottom:22},fieldContainer:{marginBottom:20,position:"relative",maxWidth:840},tooltipContainer:{marginLeft:5,display:"flex",alignItems:"center"},switchContainer:{display:"flex",maxWidth:840}},Te={formScrollable:{maxHeight:"calc(100vh - 300px)",overflowY:"auto",marginBottom:25},formSlider:{marginLeft:0},clearButton:{fontFamily:"Lato, sans-serif",border:"0",backgroundColor:"transparent",color:"#393939",fontWeight:600,fontSize:14,marginRight:10,outline:"0",padding:"16px 25px 16px 25px",cursor:"pointer"},floatingEnabled:{position:"absolute",right:58,zIndex:1e3,marginTop:-38},configureString:{border:"#EAEAEA 1px solid",borderRadius:4,padding:"24px 50px",overflowY:"auto",height:170,maxWidth:840}},Ee={tooltip:{fontSize:16}},Ae={width:14,height:14,borderRadius:2},_e={unCheckedIcon:Object(j.a)(Object(j.a)({},Ae),{},{border:"1px solid #c3c3c3"}),checkedIcon:Object(j.a)(Object(j.a)({},Ae),{},{border:"1px solid #081C42",backgroundColor:"#081C42"})},Ie={width:12,height:12,borderRadius:"100%","input:disabled ~ &":{border:"1px solid #9C9C9C"}},Me={radioUnselectedIcon:Object(j.a)(Object(j.a)({},Ie),{},{border:"1px solid #000"}),radioSelectedIcon:Object(j.a)(Object(j.a)({},Ie),{},{border:"1px solid #000",backgroundColor:"#000"})},Fe={label:{color:"#393939",fontWeight:600,fontSize:13,alignSelf:"center",whiteSpace:"nowrap","&:not(:first-of-type)":{marginLeft:10}},timeContainers:{height:40},actionsTray:{display:"flex",justifyContent:"space-between","& button":{flexGrow:0,marginLeft:15}}},De={searchField:{flexGrow:1,height:40,background:"#FFFFFF",borderRadius:5,border:"#EAEDEE 1px solid",display:"flex",justifyContent:"center",padding:"0 16px","& input":{fontSize:12,fontWeight:700,color:"#000","&::placeholder":{color:"#393939",opacity:1}},"&:hover":{borderColor:"#000"}}},Le={prefinedContainer:{maxWidth:840,width:"100%"},predefinedTitle:{fontSize:16,fontWeight:600,color:"#000",margin:"10px 0"},predefinedList:{backgroundColor:"#eaeaea",padding:"12px 10px",color:"#393939",fontSize:12,fontWeight:600,minHeight:41},innerContent:{width:"100%",overflowX:"auto",whiteSpace:"nowrap",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},innerContentMultiline:{width:"100%",maxHeight:100,overflowY:"auto",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}},Be={obTitleSection:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:20},sectionTitle:{fontSize:22,color:"#000",fontWeight:600,height:40,lineHeight:"40px"},breadcrumbs:{fontSize:10,color:"#000",marginTop:2,"& a":{textDecoration:"none",color:"#000","&:hover":{textDecoration:"underline"}}}},Re={multiSelectTable:{height:200}},Pe={customTitle:{fontSize:18,color:"#000",fontWeight:600,padding:"12px 0",borderBottom:"#eaedee 1px solid",marginBottom:10,margin:"15px 38px 27px"},settingsFormContainer:{height:"calc(100vh - 421px)",padding:"15px 38px",overflowY:"auto",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},settingsButtonContainer:{borderTop:"1px solid #EAEAEA",padding:"15px 38px",textAlign:"right"},innerSettingsButtonContainer:{maxWidth:840,textAlign:"right"},settingsOptionsContainer:{height:"calc(100vh - 244px)",backgroundColor:"#fff",border:"#EAEDEE 1px solid",borderRadius:3,marginTop:15},backButton:{cursor:"pointer",fontSize:10,fontWeight:600,color:"#000",backgroundColor:"transparent",border:0,padding:0,display:"flex",alignItems:"center","&:active, &:focus":{outline:0},"& svg":{width:10,marginRight:4}},backContainer:{margin:"20px 38px 0"}},ze={iconContainer:{display:"flex",flexDirection:"row",maxWidth:455,justifyContent:"space-between",flexWrap:"wrap",width:"100%"},nonIconContainer:{marginBottom:16,width:455,marginTop:15,"& button":{marginRight:16}},pickTitle:{fontWeight:600,color:"#393939",fontSize:14,marginBottom:16},centerElements:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},logoButton:{height:"80px"},lambdaNotif:{backgroundColor:"#fff",border:"#393939 1px solid",borderRadius:5,width:101,height:91,display:"flex",alignItems:"center",justifyContent:"center",marginBottom:16,cursor:"pointer","& img":{maxWidth:71,maxHeight:71}}},Ke={logsSubContainer:{height:"calc(100vh - 230px)",padding:"15px 0"}},Ue={singleValueContainer:{position:"relative",flexGrow:1,width:"100%",height:"100%",border:"#EAEAEA 1px solid",borderRadius:5,backgroundColor:"#fff"},titleContainer:{color:"#393939",fontWeight:600,height:15,textAlign:"center",fontSize:10},contentContainer:{flexGrow:2,justifyContent:"center",alignItems:"center",display:"flex",position:"absolute",width:"100%",height:"calc(100% - 15px)"},contentContainerWithLabel:{height:"calc(100% - 25px)"},legendBlock:{position:"absolute",bottom:5,display:"flex",width:"100%",height:15,flexWrap:"wrap",overflowY:"auto"},singleLegendContainer:{display:"flex",alignItems:"center",padding:"0 10px",maxWidth:"100%"},colorContainer:{width:8,height:8,minWidth:8,borderRadius:"100%",marginRight:5},legendLabel:{fontSize:"80%",color:"#393939",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},We={customTooltip:{backgroundColor:"rgba(255, 255, 255, 0.90)",border:"#eaeaea 1px solid",borderRadius:3,padding:"5px 10px",maxHeight:300,overflowY:"auto"},labelContainer:{display:"flex",alignItems:"center"},labelColor:{width:6,height:6,display:"block",borderRadius:"100%",marginRight:5},itemValue:{fontSize:"75%",color:"#393939"},valueContainer:{fontWeight:600},timeStampTitle:{fontSize:"80%",color:"#9c9c9c",textAlign:"center",marginBottom:6}},Ve={snackBar:{backgroundColor:"#081F44",fontWeight:400,fontFamily:"Lato, sans-serif",fontSize:14,padding:"0px 20px 0px 20px;",boxShadow:"none","&.MuiPaper-root.MuiSnackbarContent-root":{borderRadius:"0px 0px 5px 5px"},"& div":{textAlign:"center",padding:"6px 30px",width:"100%",overflowX:"hidden",textOverflow:"ellipsis"}},errorSnackBar:{backgroundColor:"#C72C48",color:"#fff"},snackBarExternal:{top:"-17px",position:"absolute",minWidth:"348px",whiteSpace:"nowrap",height:"33px"},snackDiv:{top:"17px",left:"50%",position:"absolute"},snackBarModal:{top:0,position:"absolute",minWidth:"348px",whiteSpace:"nowrap",height:"33px",maxWidth:"calc(100% - 140px)"}},Ge={multiContainer:{display:"flex",alignItems:"center",justifyContent:"flex-start"},sizeFactorContainer:{marginLeft:8,alignSelf:"flex-start"},headerElement:{position:"sticky",top:0,paddingTop:5,marginBottom:10,zIndex:500,backgroundColor:"#fff"},tableTitle:{fontWeight:700,width:"30%"},poolError:{color:"#dc1f2e",fontSize:"0.75rem",paddingLeft:120},error:{color:"#dc1f2e",fontSize:"0.75rem"},h3Section:{marginTop:0},descriptionText:{fontSize:13,color:"#777777"},container:{padding:"77px 0 0 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}},qe={anchorButton:{textDecoration:"underline",textTransform:"unset",fontWeight:"normal",padding:0,lineHeight:"unset",height:"unset",width:"unset",textAlign:"left",border:0,minWidth:"unset"}},He={hrClass:{borderTop:0,borderLeft:0,borderRight:0,borderColor:"#999999",backgroundColor:"transparent"}},Ye=a(997),Qe=a(965);function Ze(){return Object(n.jsxs)(v.a,{variant:"body2",color:"textSecondary",align:"center",children:["Copyright \xa9 ",Object(n.jsx)(Qe.a,{color:"inherit",href:"https://material-ui.com/",children:"MinIO"})," ",(new Date).getFullYear(),"."]})}var Je=Object(N.a)((function(e){return{"@global":{body:{backgroundColor:e.palette.common.white}},paper:{marginTop:e.spacing(8),display:"flex",flexDirection:"column",alignItems:"center"}}})),$e=function(){var e=Je();return Object(n.jsxs)(ke.a,{component:"main",children:[Object(n.jsx)(Se.a,{}),Object(n.jsx)("div",{className:e.paper,children:Object(n.jsx)(v.a,{variant:"h1",component:"h1",children:"404 Not Found"})}),Object(n.jsx)(Ye.a,{mt:5,children:Object(n.jsx)(Ze,{})})]})},Xe=a(19),et=a(976),tt=a(28),at=a.n(tt),nt=a(401),ct=a.n(nt),it=a(77),rt=a.n(it),ot=a(453),st=function(){return Object(n.jsx)(ot.a,{children:Object(n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",children:[Object(n.jsx)("title",{children:"ic_h_copy-new_sl"}),Object(n.jsx)("g",{id:"Layer_2","data-name":"Layer 2",children:Object(n.jsx)("g",{id:"Layer_1-2","data-name":"Layer 1",children:Object(n.jsx)("path",{className:"cls-1",d:"M0,0V16H16V0ZM11.886,9.048H9.048v2.838h-2.1V9.048H4.114v-2.1H6.952V4.114h2.1V6.952h2.838Z"})})})]})})},lt=function(){return Object(n.jsx)(ot.a,{children:Object(n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 12",children:Object(n.jsxs)("g",{id:"Group_55","data-name":"Group 55",transform:"translate(1002 -2555)",children:[Object(n.jsx)("rect",{id:"Rectangle_29",width:"2",height:"12",transform:"translate(-997 2555)",fill:"#fff"}),Object(n.jsx)("rect",{id:"Rectangle_30",width:"2",height:"12",transform:"translate(-990 2560) rotate(90)",fill:"#fff"})]})})})},dt=function(){return Object(n.jsx)(ot.a,{children:Object(n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 10.402 13",children:Object(n.jsx)("path",{d:"M6.761 1V0H3.64v1H.004v1h10.4V1zM.004 2.998l1.672 10h7.052l1.673-10zm3.412 8.243l-.552-6.478h.653l.553 6.472zm3.569 0h-.653l.551-6.472h.654z",className:"a"})})})},ut=function(){return Object(n.jsx)(ot.a,{children:Object(n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 10 10",children:Object(n.jsxs)("g",{transform:"translate(249 720)",children:[Object(n.jsx)("rect",{width:"6",height:"5",transform:"translate(-244 -720) rotate(90)"}),Object(n.jsx)("rect",{width:"4",height:"4",transform:"translate(-243 -720)"}),Object(n.jsx)("rect",{width:"5",height:"4",transform:"translate(-239 -715) rotate(90)"}),Object(n.jsx)("rect",{width:"5",height:"3",transform:"translate(-244 -710) rotate(180)"})]})})})},bt=function(){return Object(n.jsx)(ot.a,{children:Object(n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 10 10",children:Object(n.jsx)("path",{d:"M8.392,10H1.608L0,0H10Z"})})})},jt=function(){return Object(n.jsx)(ot.a,{children:Object(n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 6.131 10",children:Object(n.jsx)("g",{transform:"translate(193 719.787)",children:Object(n.jsxs)("g",{transform:"translate(-193 -719.787)",children:[Object(n.jsx)("path",{d:"M3,0h.131a3,3,0,0,1,3,3V5a0,0,0,0,1,0,0H0A0,0,0,0,1,0,5V3A3,3,0,0,1,3,0Z",transform:"translate(0 5)"}),Object(n.jsx)("ellipse",{cx:"2.065",cy:"2",rx:"2.065",ry:"2",transform:"translate(1 0)"})]})})})})},mt=function(){return Object(n.jsx)(ot.a,{children:Object(n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 10 9.5",children:Object(n.jsxs)("g",{transform:"translate(231 719.516)",children:[Object(n.jsx)("path",{d:"M-125.5,7.984a4.5,4.5,0,0,1,4.5-4.5,4.5,4.5,0,0,1,4.5,4.5Z",transform:"translate(-105 -720)"}),Object(n.jsx)("rect",{width:"10",height:"1",transform:"translate(-231 -711.016)"}),Object(n.jsx)("path",{d:"M-119.5.484h-3v1h1v1h1v-1h1Z",transform:"translate(-105 -720)"})]})})})},ht=function(){return Object(n.jsx)(ot.a,{children:Object(n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 10 9.787",children:Object(n.jsx)("g",{transform:"translate(177 719.787)",children:Object(n.jsxs)("g",{transform:"translate(-105 -720)",children:[Object(n.jsx)("path",{d:"M-65,5a3,3,0,0,0-1.131.224A3.981,3.981,0,0,1-65,8v2h3V8A3,3,0,0,0-65,5Z"}),Object(n.jsx)("path",{d:"M-72,10h6V8a3,3,0,0,0-3-3,3,3,0,0,0-3,3Z"}),Object(n.jsx)("path",{className:"a",d:"M-65,.213a1.993,1.993,0,0,0-1.384.561A2.967,2.967,0,0,1-66,2.213a2.964,2.964,0,0,1-.384,1.439A1.989,1.989,0,0,0-65,4.213a2,2,0,0,0,2-2A2,2,0,0,0-65,.213Z"}),Object(n.jsx)("circle",{cx:"2",cy:"2",r:"2",transform:"translate(-71 0.213)"})]})})})})},pt=function(){return Object(n.jsx)(ot.a,{children:Object(n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 8.75 10",children:Object(n.jsx)("path",{d:"M-44.625,10l-4.353-2.419L-53.375,10V0h8.75Z",transform:"translate(53.375)"})})})},Ot=function(){return Object(n.jsx)(ot.a,{children:Object(n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 9.998 10",children:Object(n.jsx)("g",{transform:"translate(140.999 720)",children:Object(n.jsxs)("g",{transform:"translate(-105 -720)",children:[Object(n.jsx)("rect",{width:"1.114",height:"1.667",transform:"translate(-27.116 8.333)"}),Object(n.jsx)("path",{d:"M-28.184,10H-29.3V8.154l2.182-3.037V3.147H-26V5.476l-2.182,3.037Z"}),Object(n.jsx)("rect",{width:"1.114",height:"2.963",transform:"translate(-31.531)"}),Object(n.jsx)("rect",{width:"1.114",height:"2.132",transform:"translate(-27.115 0)"}),Object(n.jsx)("rect",{width:"1.114",height:"5.389",transform:"translate(-29.298)"}),Object(n.jsx)("path",{d:"M-30.417,10h-1.114V5.722l-2.233-3V0h1.114V2.353l2.233,3Z"}),Object(n.jsx)("path",{d:"M-32.65,10h-1.114V6.185l-2.234-3V0h1.114V2.815l2.234,3Z"}),Object(n.jsx)("rect",{width:"1.114",height:"4.463",transform:"translate(-35.999 5.537)"})]})})})})},gt=function(){return Object(n.jsx)(ot.a,{children:Object(n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 10 10",children:[Object(n.jsx)("rect",{width:"1.433",height:"1"}),Object(n.jsx)("rect",{width:"7.828",height:"1",transform:"translate(2.172)"}),Object(n.jsx)("rect",{width:"1.433",height:"1",transform:"translate(0 6)"}),Object(n.jsx)("rect",{width:"1.433",height:"1",transform:"translate(0 3)"}),Object(n.jsx)("rect",{width:"1.433",height:"1",transform:"translate(0 9)"}),Object(n.jsx)("rect",{width:"1.368",height:"0.569",transform:"translate(6.316 9)"}),Object(n.jsx)("path",{d:"M5.566,9.569v-.31l-.238-.138-.269.155-.65.375L4.034,9V9H2.172v1H5.566Z"}),Object(n.jsx)("path",{d:"M9.966,9l-.375.65-.65-.375-.269-.155-.238.138V10H10V9H9.967Z"}),Object(n.jsx)("path",{d:"M3.625,6.793l.269-.155V6.362l-.269-.155L3.266,6H2.172V7H3.266Z"}),Object(n.jsx)("path",{d:"M8.434,3.431v.31l.238.138.269-.155.649-.375L9.966,4V4H10V3H8.434Z"}),Object(n.jsx)("path",{d:"M4.034,4l.375-.65.65.375.269.155.238-.138V3H2.172V4H4.033Z"}),Object(n.jsx)("path",{d:"M9.356,5.929,10,5.558,9.316,4.373l-.644.372-.988-.571V3.431H6.316v.743l-.988.571-.644-.372L4,5.558l.644.371V7.071L4,7.442l.684,1.185.644-.372.988.571v.743H7.684V8.826l.988-.571.644.372L10,7.442l-.644-.371ZM7,7.278A.778.778,0,1,1,7.778,6.5.779.779,0,0,1,7,7.278Z"})]})})},ft=function(){return Object(n.jsx)(ot.a,{children:Object(n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 10 9",children:Object(n.jsxs)("g",{transform:"translate(79 438.479)",children:[Object(n.jsx)("g",{children:Object(n.jsx)("g",{children:Object(n.jsx)("rect",{x:"-77.9",y:"-434.5",width:"7.8",height:"1"})})}),Object(n.jsx)("g",{children:Object(n.jsx)("g",{children:Object(n.jsx)("rect",{x:"-77.9",y:"-434.5",transform:"matrix(0.4999 -0.8661 0.8661 0.4999 338.8698 -281.1237)",width:"7.8",height:"1"})})}),Object(n.jsx)("g",{children:Object(n.jsx)("g",{children:Object(n.jsx)("rect",{x:"-74.5",y:"-437.9",transform:"matrix(0.866 -0.5001 0.5001 0.866 207.1129 -95.1668)",width:"1",height:"7.8"})})}),Object(n.jsx)("g",{children:Object(n.jsx)("g",{children:Object(n.jsx)("path",{d:"M-71.8-430.1h-4.5l-2.2-3.9l2.2-3.9h4.5l2.2,3.9L-71.8-430.1z M-75.7-431.1h3.3l1.7-2.9l-1.7-2.9h-3.3 l-1.7,2.9L-75.7-431.1z"})})}),Object(n.jsx)("g",{children:Object(n.jsx)("g",{children:Object(n.jsx)("path",{d:"M-72.3-434c0,0.9-0.7,1.7-1.7,1.7c-0.9,0-1.7-0.7-1.7-1.7c0-0.9,0.7-1.7,1.7-1.7 C-73.1-435.7-72.3-434.9-72.3-434z"})})}),Object(n.jsx)("g",{children:Object(n.jsx)("g",{children:Object(n.jsx)("path",{d:"M-76.8-434c0,0.6-0.5,1.1-1.1,1.1c0,0,0,0,0,0c-0.6,0-1.1-0.5-1.1-1.1c0,0,0,0,0,0c0-0.6,0.5-1.1,1.1-1.1 c0,0,0,0,0,0C-77.3-435.1-76.8-434.6-76.8-434C-76.8-434-76.8-434-76.8-434z"})})}),Object(n.jsx)("g",{children:Object(n.jsx)("g",{children:Object(n.jsx)("path",{d:"M-69-434c0,0.6-0.5,1.1-1.1,1.1c0,0,0,0,0,0c-0.6,0-1.1-0.5-1.1-1.1c0,0,0,0,0,0c0-0.6,0.5-1.1,1.1-1.1 c0,0,0,0,0,0C-69.5-435.1-69-434.6-69-434C-69-434-69-434-69-434z"})})}),Object(n.jsx)("g",{children:Object(n.jsx)("g",{children:Object(n.jsx)("path",{d:"M-75.4-431.6c0.5,0.3,0.7,1,0.4,1.5c-0.3,0.5-1,0.7-1.5,0.4c0,0,0,0,0,0c-0.5-0.3-0.7-1-0.4-1.5 C-76.6-431.7-75.9-431.9-75.4-431.6C-75.4-431.6-75.4-431.6-75.4-431.6z"})})}),Object(n.jsx)("g",{children:Object(n.jsx)("g",{children:Object(n.jsx)("path",{d:"M-71.5-438.3c0.5,0.3,0.7,1,0.4,1.5c-0.3,0.5-1,0.7-1.5,0.4c0,0,0,0,0,0c-0.5-0.3-0.7-1-0.4-1.5 C-72.7-438.5-72-438.6-71.5-438.3C-71.5-438.3-71.5-438.3-71.5-438.3z"})})}),Object(n.jsx)("g",{children:Object(n.jsx)("g",{children:Object(n.jsx)("path",{d:"M-72.6-431.6c0.5-0.3,1.2-0.1,1.5,0.4c0,0,0,0,0,0c0.3,0.5,0.1,1.2-0.4,1.5c-0.5,0.3-1.2,0.1-1.5-0.4 c0,0,0,0,0,0C-73.3-430.6-73.1-431.3-72.6-431.6z"})})}),Object(n.jsx)("g",{children:Object(n.jsx)("g",{children:Object(n.jsx)("path",{d:"M-76.5-438.3c0.5-0.3,1.2-0.1,1.5,0.4c0,0,0,0,0,0c0.3,0.5,0.1,1.2-0.4,1.5c-0.5,0.3-1.2,0.1-1.5-0.4 c0,0,0,0,0,0C-77.2-437.3-77-438-76.5-438.3z"})})})]})})})},xt=function(){return Object(n.jsx)(ot.a,{children:Object(n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 10 10",children:Object(n.jsx)("g",{transform:"translate(213 720)",children:Object(n.jsxs)("g",{transform:"translate(-105 -720)",children:[Object(n.jsx)("rect",{width:"1.5",height:"4",transform:"translate(-108)"}),Object(n.jsx)("rect",{width:"1.5",height:"4",transform:"translate(-108 6)"}),Object(n.jsx)("rect",{width:"1.5",height:"4",transform:"translate(-99.5 6)"}),Object(n.jsx)("rect",{width:"1.5",height:"4",transform:"translate(-99.5)"}),Object(n.jsx)("rect",{width:"1.5",height:"4",transform:"translate(-98) rotate(90)"}),Object(n.jsx)("rect",{width:"1.5",height:"4",transform:"translate(-104) rotate(90)"}),Object(n.jsx)("rect",{width:"1.5",height:"4",transform:"translate(-104 8.5) rotate(90)"}),Object(n.jsx)("rect",{width:"1.5",height:"4",transform:"translate(-98 8.5) rotate(90)"}),Object(n.jsx)("circle",{cx:"2",cy:"2",r:"2",transform:"translate(-105 3)"})]})})})})},vt="ADD_BUCKET_OPEN",yt="ADD_BUCKET_NAME",St="ADD_BUCKET_VERSIONED",Ct="ADD_BUCKET_LOCKING",kt="ADD_BUCKET_QUOTA",Nt="ADD_BUCKET_QUOTA_TYPE",wt="ADD_BUCKET_QUOTA_SIZE",Tt="ADD_BUCKET_QUOTA_UNIT",Et="ADD_BUCKET_RESET",At="ADD_BUCKET_RETENTION",_t="ADD_BUCKET_RETENTION_MODE",It="ADD_BUCKET_RETENTION_UNIT",Mt="ADD_BUCKET_RETENTION_VALIDITY",Ft="BUCKET_DETAILS/SET_TAB";var Dt=a(126),Lt=a.n(Dt),Bt=a(913),Rt=a(958),Pt=a(1004),zt=a(86),Kt=a(398),Ut=a.n(Kt),Wt=a(219),Vt=a.n(Wt),Gt=a(397),qt=a.n(Gt),Ht=a(34),Yt="#081C42",Qt="#081C42",Zt=function(e){var t=e.active,a=void 0!==t&&t;return Object(n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 11.856",children:Object(n.jsx)("path",{fill:a?Qt:Yt,d:"M-54,8l1.764,2.614A7.52,7.52,0,0,0-46,13.928h0a7.52,7.52,0,0,0,6.234-3.314L-38,8l-1.764-2.614A7.52,7.52,0,0,0-46,2.072h0a7.52,7.52,0,0,0-6.234,3.314Zm10.286,0A2.285,2.285,0,0,1-46,10.286,2.285,2.285,0,0,1-48.286,8,2.285,2.285,0,0,1-46,5.714,2.285,2.285,0,0,1-43.714,8Zm1.3,0A3.59,3.59,0,0,1-46,11.59,3.59,3.59,0,0,1-49.59,8,3.59,3.59,0,0,1-46,4.41,3.59,3.59,0,0,1-42.41,8Z",transform:"translate(54 -2.072)"})})},Jt=function(e){var t=e.active,a=void 0!==t&&t;return Object(n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 13.833 13.833",children:Object(n.jsx)("path",{fill:a?Qt:Yt,d:"M2.934,16H0V13.066L10.607,2.459a1,1,0,0,1,1.414,0l1.52,1.52a1,1,0,0,1,0,1.414Z",transform:"translate(0 -2.167)"})})},$t=function(e){var t=e.active,a=void 0!==t&&t;return Object(n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 13 13",children:[Object(n.jsx)("path",{fill:a?Qt:Yt,d:"M11.05 8.617v2.429h-9.1v-9.1h2.429v-1.95H0v13h13V8.617z",className:"a"}),Object(n.jsx)("path",{fill:a?Qt:Yt,d:"M3.854 9.256h1.95a4.945 4.945 0 013.6-4.74v1.3l.6-.487 2.474-2.012L9.4.817v1.7a6.9 6.9 0 00-5.546 6.739z",className:"a"})]})},Xt=function(e){var t=e.active,a=void 0!==t&&t;return Object(n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 10.402 13",children:Object(n.jsx)("path",{fill:a?Qt:Yt,d:"M6.761 1V0H3.64v1H.004v1h10.4V1zM.004 2.998l1.672 10h7.052l1.673-10zm3.412 8.243l-.552-6.478h.653l.553 6.472zm3.569 0h-.653l.551-6.472h.654z"})})},ea=function(e){var t=e.active,a=void 0!==t&&t;return Object(n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 10 11.429",children:Object(n.jsx)("path",{fill:a?Qt:Yt,d:"M-43.375,11.429-48.35,8.664l-5.025,2.764V0h10Z",transform:"translate(53.375)"})})},ta=function(e){var t=e.active,a=void 0!==t&&t;return Object(n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",children:Object(n.jsx)("path",{fill:a?Qt:Yt,d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96z"})})},aa=function(e){var t=e.active,a=void 0!==t&&t;return Object(n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",children:Object(n.jsx)("path",{fill:a?Qt:Yt,d:"M21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H3v-3h18v3z"})})},na=function(e){var t=e.active,a=void 0!==t&&t;return Object(n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 13 12.996",children:[Object(n.jsx)("path",{fill:a?Qt:Yt,d:"M11.05 9.096v1.95h-9.1v-1.95H0v3.9h13v-3.9z"}),Object(n.jsx)("path",{fill:a?Qt:Yt,d:"M6.5 9.75L9 6.672H7.475V0h-1.95v6.672H4z"})]})},ca=function(e){var t=e.active,a=void 0!==t&&t;return Object(n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",children:Object(n.jsx)("path",{fill:a?Qt:Yt,d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm5 11H7v-2h10v2z"})})},ia=function(e){var t=e.active,a=void 0!==t&&t;return Object(n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",children:Object(n.jsx)("path",{fill:a?Qt:Yt,d:"M20 16h2v-2h-2v2zm0-9v5h2V7h-2zM10 4c-4.42 0-8 3.58-8 8s3.58 8 8 8 8-3.58 8-8-3.58-8-8-8zm0 10c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z"})})},ra=function(e,t){switch(e){case"view":return Object(n.jsx)(Zt,{active:t});case"edit":return Object(n.jsx)(Jt,{active:t});case"delete":return Object(n.jsx)(Xt,{active:t});case"description":return Object(n.jsx)(ea,{active:t});case"share":return Object(n.jsx)($t,{active:t});case"cloud":return Object(n.jsx)(ta,{active:t});case"console":return Object(n.jsx)(aa,{active:t});case"download":return Object(n.jsx)(na,{active:t});case"disable":return Object(n.jsx)(ca,{active:t});case"format":return Object(n.jsx)(ia,{active:t})}return null},oa=Object(w.a)((function(){return Object(k.a)({spacing:{margin:"0 8px"},buttonDisabled:{"&.MuiButtonBase-root.Mui-disabled":{cursor:"not-allowed",filter:"grayscale(100%)",opacity:"30%"}}})}))((function(e){var t=e.type,a=e.onClick,c=e.valueToSend,i=e.idField,r=e.selected,o=e.to,s=e.sendOnlyId,l=void 0!==s&&s,d=e.disabled,u=void 0!==d&&d,b=e.classes,j=l?c[i]:c,m=Object(n.jsx)(Bt.a,{"aria-label":t,size:"small",onClick:a?function(e){e.stopPropagation(),u?e.preventDefault():a(j)}:function(){return null},className:"".concat(b.spacing," ").concat(u?b.buttonDisabled:""),disabled:u,children:ra(t,r)});return a?m:Lt()(o)?u?m:Object(n.jsx)(Ht.a,{to:"".concat(o,"/").concat(j),onClick:function(e){e.stopPropagation()},children:m}):null})),sa=a(1014),la=a(1007),da=function(e){return Object(n.jsxs)(ot.a,Object(j.a)(Object(j.a)({},e),{},{viewBox:"0 0 12 12",children:[Object(n.jsx)("path",{d:"M357.14,346a5,5,0,1,1-5,5,5,5,0,0,1,5-5m0-1a6,6,0,1,0,6,6,6,6,0,0,0-6-6Z",transform:"translate(-351.14 -345.03)"}),Object(n.jsx)("path",{d:"M356.21,352.42v-1.86h.52c1.23,0,1.92-.45,1.92-1.29s-.68-1.18-1.89-1.18a8.07,8.07,0,0,0-.93.06l-.1-1.25a9.13,9.13,0,0,1,1.08-.08c2,0,3.19.94,3.19,2.4s-.93,2.24-2.64,2.46l-.05.74Zm1.56,1.8a1,1,0,1,1-1-1A1,1,0,0,1,357.77,354.22Z",transform:"translate(-351.14 -345.03)"})]}))},ua=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)(Object(j.a)({},we),Ee),_e),{},{fieldContainer:Object(j.a)(Object(j.a)({},we.fieldContainer),{},{display:"flex",justifyContent:"flex-start",alignItems:"center",margin:"15px 0",marginBottom:0,flexBasis:"initial"})}))}))((function(e){var t=e.label,a=e.onChange,c=e.value,r=e.id,o=e.name,s=e.checked,l=void 0!==s&&s,d=e.disabled,u=void 0!==d&&d,b=e.tooltip,j=void 0===b?"":b,m=e.classes;return Object(n.jsx)(i.a.Fragment,{children:Object(n.jsxs)(x.a,{item:!0,xs:12,className:m.fieldContainer,children:[Object(n.jsx)("div",{children:Object(n.jsx)(Pt.a,{name:o,id:r,value:c,color:"primary",inputProps:{"aria-label":"secondary checkbox"},checked:l,onChange:a,checkedIcon:Object(n.jsx)("span",{className:m.checkedIcon}),icon:Object(n.jsx)("span",{className:m.unCheckedIcon}),disabled:u})}),""!==t&&Object(n.jsxs)(sa.a,{htmlFor:r,className:m.inputLabel,children:[Object(n.jsx)("span",{children:t}),""!==j&&Object(n.jsx)("div",{className:m.tooltipContainer,children:Object(n.jsx)(la.a,{title:j,placement:"top-start",children:Object(n.jsx)("div",{children:Object(n.jsx)(da,{className:m.tooltip})})})})]})]})})})),ba="#9c9c9c80",ja={fontWeight:400,fontSize:14,borderColor:ba,borderWidth:"0.5px",height:40,transitionDuration:"0.3s",padding:"initial",paddingRight:6,paddingLeft:6},ma=function(e,t,a,i,r,o,s,l,d,u,b){var j=function(e,t,a,n,c,i,r){var o=Object(Xe.a)(e);i&&(o=e.filter((function(e){return r.includes(e.elementKey)})));var s=t;return n&&(s-=45),c&&(s-=a),o.reduce((function(e,t){return t.width?e-t.width:e}),s)/o.filter((function(e){return!e.width})).length}(e,t,a,i,r,l,d);return e.map((function(e,t){if(l&&!d.includes(e.elementKey))return null;var a=!e.enableSort||!e.enableSort;return Object(n.jsx)(zt.b,{dataKey:e.elementKey,headerClassName:"titleHeader ".concat(e.headerTextAlign?"text-".concat(e.headerTextAlign):""),headerRenderer:function(){return Object(n.jsxs)(c.Fragment,{children:[u===e.elementKey&&Object(n.jsx)(c.Fragment,{children:"ASC"===b?Object(n.jsx)(qt.a,{}):Object(n.jsx)(Vt.a,{})}),e.label]})},className:e.contentTextAlign?"text-".concat(e.contentTextAlign):"",cellRenderer:function(t){var a=t.rowData,i=!!o&&o.includes(Lt()(a)?a:a[s]);return function(e,t,a){var i=Lt()(e)?e:Z()(e,t.elementKey,null),r=t.renderFullObject?e:i,o=t.renderFunction?t.renderFunction(r):r;return Object(n.jsx)(c.Fragment,{children:Object(n.jsx)("span",{className:a?"selected":"",children:o})})}(a,e,i)},width:e.width||j,disableSort:a,defaultSortDirection:"ASC"},"col-tb-".concat(t.toString()))}))},ha=Object(w.a)((function(){return Object(k.a)(Object(j.a)(Object(j.a)({dialogContainer:{padding:"12px 26px 22px"},paper:{display:"flex",overflow:"auto",flexDirection:"column",padding:"19px 38px",boxShadow:"none",border:"#EAEDEE 1px solid",borderRadius:3,minHeight:200,overflowY:"scroll",position:"relative","&::-webkit-scrollbar":{width:3,height:3}},noBackground:{backgroundColor:"transparent",border:0},defaultPaperHeight:{height:"calc(100vh - 205px)"},allTableSettings:{"& .MuiTableCell-sizeSmall:last-child":{paddingRight:"initial"},"& .MuiTableCell-body.MuiTableCell-sizeSmall:last-child":{paddingRight:6}},minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:700,fontSize:14,borderColor:"#39393980",borderWidth:"0.5px",padding:"6px 0 10px"}}},rowUnselected:Object(j.a)(Object(j.a)({},ja),{},{color:"#393939"}),rowSelected:Object(j.a)(Object(j.a)({},ja),{},{color:"#081C42",fontWeight:600}),paginatorContainer:{display:"flex",justifyContent:"flex-end",padding:"5px 38px"},checkBoxHeader:{width:50,textAlign:"left",paddingRight:10,"&.MuiTableCell-paddingCheckbox":{paddingBottom:4,paddingLeft:0}},actionsContainer:{width:150,borderColor:ba},paginatorComponent:{borderBottom:0},checkBoxRow:{borderColor:ba,padding:"0 10px 0 0"},loadingBox:{paddingTop:"100px",paddingBottom:"100px"},overlayColumnSelection:{position:"absolute",right:0,top:0},popoverContainer:{position:"relative"},popoverContent:{maxHeight:250,overflowY:"auto",padding:"0 10px 10px"},shownColumnsLabel:{color:"#9c9c9c",fontSize:12,padding:10,borderBottom:"#eaeaea 1px solid",width:"100%"},"@global":{".rowLine":{borderBottom:"1px solid ".concat(ba),height:40,color:"#393939",fontSize:14,transitionDuration:.3,"&:focus":{outline:"initial"},"&:hover:not(.ReactVirtualized__Table__headerRow)":{userSelect:"none",backgroundColor:"#ececec",fontWeight:600,"&.canClick":{cursor:"pointer"},"&.canSelectText":{userSelect:"text"}},"& .selected":{color:"#081C42",fontWeight:600}},".headerItem":{userSelect:"none",fontWeight:700,fontSize:14,fontStyle:"initial",display:"flex",alignItems:"center",outline:"none"},".ReactVirtualized__Table__headerRow":{fontWeight:700,fontSize:14,borderColor:"#39393980",textTransform:"initial"},".optionsAlignment":{textAlign:"center"},".text-center":{textAlign:"center"},".text-right":{textAlign:"right"},".progress-enabled":{paddingTop:3,display:"inline-block",margin:"0 10px",position:"relative",width:18,height:18},".progress-enabled > .MuiCircularProgress-root":{position:"absolute",left:0,top:3}}},_e),Me))}))((function(e){var t=e.itemActions,a=e.columns,r=e.onSelect,o=e.records,s=e.isLoading,l=e.loadingMessage,d=void 0===l?Object(n.jsx)(v.a,{component:"h3",children:"Loading..."}):l,j=e.entityName,m=e.selectedItems,h=e.idField,p=e.classes,O=e.radioSelection,g=void 0!==O&&O,f=e.customEmptyMessage,k=void 0===f?"":f,N=e.customPaperHeight,w=void 0===N?"":N,T=e.noBackground,E=void 0!==T&&T,A=e.columnsSelector,_=void 0!==A&&A,I=e.textSelectable,M=void 0!==I&&I,F=e.columnsShown,D=void 0===F?[]:F,L=e.onColumnChange,B=void 0===L?function(e,t){}:L,R=e.infiniteScrollConfig,P=e.sortConfig,z=e.autoScrollToBottom,K=void 0!==z&&z,U=Object(c.useState)(!1),W=Object(b.a)(U,2),V=W[0],G=W[1],q=i.a.useState(null),H=Object(b.a)(q,2),Y=H[0],Q=H[1],Z=t?t.find((function(e){return"view"===e.type})):null,J=function(e){G(!V),Q(e.currentTarget)},$=function(){G(!1),Q(null)};return Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsxs)(C.a,{className:"".concat(p.paper," ").concat(E?p.noBackground:""," ").concat(""!==w?w:p.defaultPaperHeight),children:[s&&Object(n.jsxs)(x.a,{container:!0,className:p.loadingBox,children:[Object(n.jsx)(x.a,{item:!0,xs:12,style:{textAlign:"center"},children:d}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(y.a,{})})]}),_&&!s&&o.length>0&&Object(n.jsx)("div",{className:p.overlayColumnSelection,children:function(e){return Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(Bt.a,{"aria-describedby":"columnsSelector",color:"primary",onClick:J,children:Object(n.jsx)(Ut.a,{fontSize:"inherit"})}),Object(n.jsxs)(Rt.a,{anchorEl:Y,id:"columnsSelector",open:V,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:$,className:p.popoverContainer,children:[Object(n.jsx)("div",{className:p.shownColumnsLabel,children:"Shown Columns"}),Object(n.jsx)("div",{className:p.popoverContent,children:e.map((function(e){return Object(n.jsx)(ua,{label:e.label,checked:D.includes(e.elementKey),onChange:function(t){B(e.elementKey,t.target.checked)},id:"chbox-".concat(e.label),name:"chbox-".concat(e.label),value:e.label},"tableColumns-".concat(e.label))}))})]})]})}(a)}),o&&!s&&o.length>0?Object(n.jsx)(zt.c,{isRowLoaded:function(e){var t=e.index;return!!o[t]},loadMoreRows:R?R.loadMoreRecords:function(){return new Promise((function(){return!0}))},rowCount:R?R.recordsCount:o.length,children:function(e){var i=e.onRowsRendered,s=e.registerChild;return Object(n.jsx)(zt.a,{children:function(e){var l=e.width,d=e.height,b=function(e,t){var a=45*t;return a<80?80:a>e?e:a}(l,t?t.filter((function(e){return"view"!==e.type})).length:0),O=!(!r||!m),f=!!(t&&t.length>1||t&&1===t.length&&"view"!==t[0].type);return Object(n.jsxs)(zt.d,{ref:s,disableHeader:!1,headerClassName:"headerItem",headerHeight:40,height:d,noRowsRenderer:function(){return Object(n.jsx)(c.Fragment,{children:""!==k?k:"There are no ".concat(j," yet.")})},overscanRowCount:10,rowHeight:40,width:l,rowCount:o.length,rowGetter:function(e){var t=e.index;return o[t]},onRowClick:function(e){!function(e){if(Z){var t=Z.sendOnlyId?e[h]:e;if(Z.to)return void u.push("".concat(Z.to,"/").concat(t));Z.onClick&&Z.onClick(t)}}(e.rowData)},rowClassName:"rowLine ".concat(Z?"canClick":""," ").concat(!Z&&M?"canSelectText":""),onRowsRendered:i,sort:P?P.triggerSort:void 0,sortBy:P?P.currentSort:void 0,sortDirection:P?P.currentDirection:void 0,scrollToIndex:K?o.length-1:-1,children:[O&&Object(n.jsx)(zt.b,{headerRenderer:function(){return Object(n.jsx)(c.Fragment,{children:"Select"})},dataKey:h,width:45,cellRenderer:function(e){var t=e.rowData,a=!!m&&m.includes(Lt()(t)?t:t[h]);return Object(n.jsx)(Pt.a,{value:Lt()(t)?t:t[h],color:"primary",inputProps:{"aria-label":"secondary checkbox"},checked:a,onChange:r,onClick:function(e){e.stopPropagation()},checkedIcon:Object(n.jsx)("span",{className:g?p.radioSelectedIcon:p.checkedIcon}),icon:Object(n.jsx)("span",{className:g?p.radioUnselectedIcon:p.unCheckedIcon})})}}),ma(a,l,b,O,f,m||[],h,_,D,P?P.currentSort:"",P?P.currentDirection:void 0),f&&Object(n.jsx)(zt.b,{headerRenderer:function(){return Object(n.jsx)(c.Fragment,{children:"Options"})},dataKey:h,width:b,headerClassName:"optionsAlignment",className:"optionsAlignment",cellRenderer:function(e){var a=e.rowData,c=!!m&&m.includes(Lt()(a)?a:a[h]);return function(e,t,a,c){return e.map((function(e,i){if("view"===e.type)return null;var r="string"===typeof t?t:t[c],o=!1;return e.disableButtonFunction&&e.disableButtonFunction(r)&&(o=!0),e.showLoaderFunction&&e.showLoaderFunction(r)?Object(n.jsx)("div",{className:"progress-enabled",children:Object(n.jsx)(S.a,{color:"primary",size:18,variant:"indeterminate"},"actions-loader-".concat(e.type,"-").concat(i.toString()))}):Object(n.jsx)(oa,{type:e.type,onClick:e.onClick,to:e.to,valueToSend:t,selected:a,idField:c,sendOnlyId:!!e.sendOnlyId,disabled:o},"actions-".concat(e.type,"-").concat(i.toString()))}))}(t||[],a,c,h)}})]})}})}}):Object(n.jsx)(c.Fragment,{children:!s&&Object(n.jsx)("div",{children:""!==k?k:"There are no ".concat(j," yet.")})})]})})})),pa=a(968),Oa=a(969),ga=a(970),fa={content:'" "',borderLeft:"2px solid #9C9C9C",height:33,width:1,position:"absolute"},xa=Object(s.b)((function(e){return{modalSnackMessage:e.system.modalSnackBar}}),{setModalSnackMessage:G}),va=Object(w.a)((function(e){return Object(k.a)(Object(j.a)({dialogContainer:{padding:"8px 15px 22px"},closeContainer:{textAlign:"right"},closeButton:{width:45,height:45,padding:0,backgroundColor:"initial","&:hover":{backgroundColor:"initial"},"&:active":{backgroundColor:"initial"}},modalCloseIcon:{fontSize:35,color:"#9C9C9C",fontWeight:300,"&:hover":{color:"#9C9C9C"}},closeIcon:{"&::before":Object(j.a)(Object(j.a)({},fa),{},{transform:"rotate(45deg)"}),"&::after":Object(j.a)(Object(j.a)({},fa),{},{transform:"rotate(-45deg)"}),"&:hover::before, &:hover::after":{borderColor:"#9C9C9C"},width:24,height:24,display:"block",position:"relative"},titleClass:{padding:"0px 50px 12px","& h2":{fontWeight:600,color:"#000",fontSize:22}},modalContent:{padding:"0 50px"},customDialogSize:{width:"100%",maxWidth:765}},Ve))}))(xa((function(e){var t=e.onClose,a=e.modalOpen,i=e.title,r=e.children,o=e.classes,s=e.wideLimit,l=void 0===s||s,d=e.modalSnackMessage,u=e.noContentPadding,m=e.setModalSnackMessage,h=Object(c.useState)(!1),p=Object(b.a)(h,2),O=p[0],g=p[1];Object(c.useEffect)((function(){if(d){if(""===d.message)return void g(!1);g(!0)}}),[d]);var f=l?{classes:{paper:o.customDialogSize}}:{maxWidth:"md",fullWidth:!0};return Object(n.jsx)(pa.a,Object(j.a)(Object(j.a)({open:a,onClose:t,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description"},f),{},{children:Object(n.jsxs)("div",{className:o.dialogContainer,children:[Object(n.jsx)(Ne.a,{open:O,className:o.snackBarModal,onClose:function(){g(!1),m("")},message:d?d.message:"",ContentProps:{className:"".concat(o.snackBar," ").concat(d&&"error"===d.type?o.errorSnackBar:"")},autoHideDuration:d&&"error"===d.type?1e4:5e3}),Object(n.jsx)("div",{className:o.closeContainer,children:Object(n.jsx)(Bt.a,{"aria-label":"close",className:o.closeButton,onClick:t,disableRipple:!0,children:Object(n.jsx)("span",{className:o.closeIcon})})}),Object(n.jsx)(Oa.a,{id:"alert-dialog-title",className:o.titleClass,children:i}),Object(n.jsx)(ga.a,{className:u?"":o.modalContent,children:r})]})}))}))),ya=Object(N.a)((function(e){return Object(k.a)({root:{borderRadius:0,"&::before":{borderColor:"#9c9c9c"}},disabled:{"&.MuiInput-underline::before":{borderColor:"#eaeaea",borderBottomStyle:"solid"}},input:{padding:"15px 30px 10px 5px",color:"#393939",fontSize:13,fontWeight:600,"&:placeholder":{color:"#393939",opacity:1}},error:{color:"#b53b4b"}})}));function Sa(e){var t=ya();return Object(n.jsx)(f.a,Object(j.a)({InputProps:{classes:t}},e))}var Ca=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({},we),Ee),{},{textBoxContainer:{flexGrow:1},textBoxWithIcon:{position:"relative",paddingRight:25},errorState:{color:"#b53b4b",fontSize:14,position:"absolute",top:7,right:7},overlayAction:{position:"absolute",right:0,top:15,"& svg":{maxWidth:15,maxHeight:15}}}))}))((function(e){var t=e.label,a=e.onChange,c=e.value,r=e.id,o=e.name,s=e.type,l=void 0===s?"text":s,d=e.autoComplete,u=void 0===d?"off":d,b=e.disabled,j=void 0!==b&&b,m=e.multiline,h=void 0!==m&&m,p=e.tooltip,O=void 0===p?"":p,g=e.index,f=void 0===g?0:g,v=e.error,y=void 0===v?"":v,S=e.required,C=void 0!==S&&S,k=e.placeholder,N=void 0===k?"":k,w=e.min,T=e.max,E=e.overlayIcon,A=void 0===E?null:E,_=e.overlayAction,I=e.classes,M={"data-index":f};return"number"===l&&w&&(M.min=w),"number"===l&&T&&(M.max=T),Object(n.jsx)(i.a.Fragment,{children:Object(n.jsxs)(x.a,{item:!0,xs:12,className:"".concat(I.fieldContainer," ").concat(""!==y?I.errorInField:""),children:[""!==t&&Object(n.jsxs)(sa.a,{htmlFor:r,className:I.inputLabel,children:[Object(n.jsxs)("span",{children:[t,C?"*":""]}),""!==O&&Object(n.jsx)("div",{className:I.tooltipContainer,children:Object(n.jsx)(la.a,{title:O,placement:"top-start",children:Object(n.jsx)("div",{children:Object(n.jsx)(da,{className:I.tooltip})})})})]}),Object(n.jsx)("div",{className:I.textBoxContainer,children:Object(n.jsx)(Sa,{id:r,name:o,fullWidth:!0,value:c,disabled:j,onChange:a,type:l,multiline:h,autoComplete:u,inputProps:M,error:""!==y,helperText:y,placeholder:N,className:I.inputRebase})}),A&&Object(n.jsx)("div",{className:I.overlayAction,children:Object(n.jsx)(Bt.a,{onClick:_?function(){_()}:function(){return null},size:"small",disableFocusRipple:!1,disableRipple:!1,disableTouchRipple:!1,children:A})})]})})})),ka=a(458),Na=a(957),wa=a(1e3),Ta=a(971),Ea=Object(w.a)((function(e){return Object(k.a)({root:{lineHeight:1,"label + &":{marginTop:e.spacing(3)}},input:{position:"relative",color:"#393939",fontSize:13,fontWeight:600,padding:"15px 20px 10px 10px",borderBottom:"1px solid #9c9c9c",display:"flex",alignItems:"center","&:hover":{borderColor:"#393939"},"&:focus":{backgroundColor:"#fff"}}})}))(ka.a),Aa=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({},we),Ee))}))((function(e){var t=e.classes,a=e.id,c=e.name,r=e.onChange,o=e.options,s=e.label,l=e.tooltip,d=void 0===l?"":l,u=e.value,b=e.disabled,j=void 0!==b&&b;return Object(n.jsx)(i.a.Fragment,{children:Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.fieldContainer,children:[""!==s&&Object(n.jsxs)(sa.a,{htmlFor:a,className:t.inputLabel,children:[Object(n.jsx)("span",{children:s}),""!==d&&Object(n.jsx)("div",{className:t.tooltipContainer,children:Object(n.jsx)(la.a,{title:d,placement:"top-start",children:Object(n.jsx)("div",{children:Object(n.jsx)(da,{className:t.tooltip})})})})]}),Object(n.jsx)(Na.a,{fullWidth:!0,children:Object(n.jsx)(wa.a,{id:a,name:c,value:u,onChange:r,input:Object(n.jsx)(Ea,{}),disabled:j,children:o.map((function(e){return Object(n.jsx)(Ta.a,{value:e.value,children:e.label},"select-".concat(c,"-").concat(e.label))}))})})]})})})),_a=a(1012),Ia=a(972),Ma=a(1002),Fa=Object(N.a)(Object(j.a)({root:{"&:hover":{backgroundColor:"transparent"}}},Me)),Da=function(e){var t=Fa();return Object(n.jsx)(Ma.a,Object(j.a)({className:t.root,disableRipple:!0,color:"default",checkedIcon:Object(n.jsx)("span",{className:t.radioSelectedIcon}),icon:Object(n.jsx)("span",{className:t.radioUnselectedIcon})},e))},La=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({},we),Ee),{},{radioBoxContainer:{},fieldContainer:Object(j.a)(Object(j.a)({},we.fieldContainer),{},{display:"flex",justifyContent:"space-between",borderBottom:"#9c9c9c 1px solid",paddingBottom:10,marginTop:11}),optionLabel:{"&.Mui-disabled":{"& .MuiFormControlLabel-label":{color:"#9c9c9c"}},"&:last-child":{marginRight:0},"& .MuiFormControlLabel-label":{fontSize:12,color:"#000"}},checkedOption:{"& .MuiFormControlLabel-label":{fontSize:12,color:"#000",fontWeight:700}}}))}))((function(e){var t=e.selectorOptions,a=void 0===t?[]:t,c=e.currentSelection,r=e.label,o=e.id,s=e.name,l=e.onChange,d=e.tooltip,u=void 0===d?"":d,b=e.disableOptions,j=void 0!==b&&b,m=e.classes,h=e.displayInColumn,p=void 0!==h&&h;return Object(n.jsx)(i.a.Fragment,{children:Object(n.jsxs)(x.a,{item:!0,xs:12,className:m.fieldContainer,children:[Object(n.jsxs)(sa.a,{htmlFor:o,className:m.inputLabel,children:[Object(n.jsx)("span",{children:r}),""!==u&&Object(n.jsx)("div",{className:m.tooltipContainer,children:Object(n.jsx)(la.a,{title:u,placement:"top-start",children:Object(n.jsx)("div",{children:Object(n.jsx)(da,{className:m.tooltip})})})})]}),Object(n.jsx)("div",{className:m.radioBoxContainer,children:Object(n.jsx)(_a.a,{"aria-label":o,id:o,name:s,value:c,onChange:l,row:!p,children:a.map((function(e){return Object(n.jsx)(Ia.a,{value:e.value,control:Object(n.jsx)(Da,{}),label:e.label,disabled:j,className:Object(ye.a)(m.optionLabel,Object(ve.a)({},m.checkedOption,e.value===c))},"rd-".concat(s,"-").concat(e.value))}))})})]})})})),Ba=a(1008),Ra=a(973),Pa=Object(w.a)({root:{alignItems:"flex-start",height:18,padding:"0 12px",display:"flex",position:"relative"},switchBase:{color:"#fff",padding:0,top:"initial","&$checked":{color:"#fff"},"&$checked + $track":{backgroundColor:"#081C42",opacity:1,height:15},"&:hover":{backgroundColor:"#fff"}},checked:{},track:{height:15,backgroundColor:"#9C9C9C",border:"#081C42 1px solid",opacity:1,padding:0,marginTop:1.5,"&$checked":{backgroundColor:"#081C42"}},thumb:{backgroundColor:"#fff",border:"#081C42 1px solid",boxShadow:"none",width:18,height:18,padding:0,marginLeft:10}})(Ra.a),za=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({seeMore:{marginTop:e.spacing(3)},paper:{display:"flex",overflow:"auto",flexDirection:"column",paddingTop:15,boxShadow:"none"},addSideBar:{width:"320px",padding:"20px"},tableToolbar:{paddingLeft:e.spacing(2),paddingRight:e.spacing(0)},wrapCell:{maxWidth:"200px",whiteSpace:"normal",wordWrap:"break-word"},minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:"bold"}}},noFound:{textAlign:"center",padding:"10px 0"},tableContainer:{maxHeight:200},stickyHeader:{backgroundColor:"#fff"},actionsTitle:{fontWeight:600,color:"#081C42",fontSize:16,alignSelf:"center"},tableBlock:{marginTop:15},filterField:{width:375,fontWeight:600,"& .input":{"&::placeholder":{fontWeight:600,color:"#081C42"}}},divContainer:{borderBottom:"#9c9c9c 1px solid",paddingBottom:14,marginBottom:20,maxWidth:840},wrapperContainer:{display:"flex",justifyContent:"space-between",alignItems:"center",maxWidth:840},indicatorLabel:{fontSize:12,fontWeight:600,color:"#081C42",margin:"0 8px 0 10px"},fieldDescription:{marginTop:4,color:"#999999"}},Fe),we))}))((function(e){var t=e.label,a=void 0===t?"":t,c=e.onChange,r=e.value,o=e.id,s=e.name,l=e.checked,d=void 0!==l&&l,u=e.disabled,b=void 0!==u&&u,j=e.switchOnly,m=void 0!==j&&j,h=e.tooltip,p=void 0===h?"":h,O=e.description,g=void 0===O?"":O,f=e.indicatorLabels,y=void 0===f?[]:f,S=e.containerClass,C=void 0===S?"":S,k=e.classes,N=Object(n.jsx)(i.a.Fragment,{children:Object(n.jsxs)("div",{className:"".concat(k.switchContainer," ").concat(C),children:[Object(n.jsx)(Pa,{checked:d,onChange:c,color:"primary",name:s,inputProps:{"aria-label":"primary checkbox"},disabled:b,disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,value:r}),2===y.length&&Object(n.jsx)("span",{className:k.indicatorLabel,children:d?y[0]:y[1]})]})});return m?N:Object(n.jsxs)("div",{className:k.divContainer,children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:k.wrapperContainer,children:[""!==a&&Object(n.jsxs)(sa.a,{htmlFor:o,className:k.inputLabel,children:[Object(n.jsx)("span",{children:a}),""!==p&&Object(n.jsx)("div",{className:k.tooltipContainer,children:Object(n.jsx)(la.a,{title:p,placement:"top-start",children:Object(n.jsx)("div",{children:Object(n.jsx)(da,{className:k.tooltip})})})})]}),N]}),""!==g&&Object(n.jsx)(x.a,{item:!0,xs:10,children:Object(n.jsx)(v.a,{component:"p",className:k.fieldDescription,children:g})})]})})),Ka=Object(s.b)((function(e){return{addBucketModalOpen:e.buckets.open,bucketName:e.buckets.addBucketName,versioningEnabled:e.buckets.addBucketVersioningEnabled,lockingEnabled:e.buckets.addBucketLockingEnabled,quotaEnabled:e.buckets.addBucketQuotaEnabled,quotaType:e.buckets.addBucketQuotaType,quotaSize:e.buckets.addBucketQuotaSize,quotaUnit:e.buckets.addBucketQuotaUnit,retentionEnabled:e.buckets.addBucketRetentionEnabled,retentionMode:e.buckets.addBucketRetentionMode,retentionUnit:e.buckets.addBucketRetentionUnit,retentionValidity:e.buckets.addBucketRetentionValidity}}),{addBucketName:function(e){return{type:yt,name:e}},addBucketVersioned:function(e){return{type:St,versioned:e}},enableObjectLocking:function(e){return{type:Ct,locking:e}},addBucketQuota:function(e){return{type:kt,quota:e}},addBucketQuotaType:function(e){return{type:Nt,quotaType:e}},addBucketQuotaSize:function(e){return{type:wt,quotaSize:e}},addBucketQuotaUnit:function(e){return{type:Tt,quotaUnit:e}},addBucketRetention:function(e){return{type:At,retention:e}},addBucketRetentionMode:function(e){return{type:_t,retentionMode:e}},addBucketRetentionUnit:function(e){return{type:It,retentionUnit:e}},addBucketRetentionValidity:function(e){return{type:Mt,retentionValidity:e}},setModalError:q})(Object(w.a)((function(e){return Object(k.a)(Object(j.a)({buttonContainer:{textAlign:"right"},multiContainer:{display:"flex",alignItems:"center",justifyContent:"flex-start"},quotaSizeContainer:{flexGrow:1},sizeFactorContainer:{flexGrow:0,maxWidth:80,marginLeft:8,alignSelf:"flex-start"}},Te))}))((function(e){var t=e.classes,a=e.open,r=e.closeModalAndRefresh,o=e.addBucketName,s=e.addBucketVersioned,l=e.enableObjectLocking,d=e.addBucketQuota,u=e.addBucketQuotaType,j=e.addBucketQuotaSize,m=e.addBucketQuotaUnit,h=e.addBucketRetention,p=e.addBucketRetentionMode,O=e.addBucketRetentionUnit,f=e.addBucketRetentionValidity,S=e.setModalError,C=e.bucketName,k=e.versioningEnabled,N=e.lockingEnabled,w=e.quotaEnabled,T=e.quotaType,E=e.quotaSize,A=e.quotaUnit,_=e.retentionEnabled,I=e.retentionMode,M=e.retentionUnit,F=e.retentionValidity,D=Object(c.useState)(!1),L=Object(b.a)(D,2),B=L[0],R=L[1],P=Object(c.useState)(!1),z=Object(b.a)(P,2),K=z[0],U=z[1],W=Object(c.useState)(!1),V=Object(b.a)(W,2),G=V[0],q=V[1],H=Object(Ba.a)(C,1e3),Y=Object(b.a)(H,1)[0];Object(c.useEffect)((function(){o(Y)}),[Y,o]);var Q=function(){o(""),s(!1),l(!1),d(!1),u("hard"),j("1"),m("TiB"),h(!1),p("compliance"),O("days"),f(1)};return Object(c.useEffect)((function(){var e=!1;""!==C.trim()&&(e=!0),w&&e&&(""!==E.trim()&&0!==parseInt(E)||(e=!1)),k&&_||(h(!1),p("compliance"),O("days"),f(1)),_?(l(!0),q(!0)):q(!1),_&&(Number.isNaN(F)||F<1)&&(e=!1),U(e)}),[C,_,N,T,E,A,w,h,p,O,f,F,k,l]),Object(n.jsx)(va,{title:"Create Bucket",modalOpen:a,onClose:function(){r(!1)},"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:Object(n.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){!function(e){if(e.preventDefault(),!B){R(!0);var t={name:C,versioning:k,locking:N};if(w){var a=le(E,A,!1);t.quota={enabled:!0,quota_type:T,amount:parseInt(a)}}_&&(t.retention={mode:I,unit:M,validity:F}),Oe.invoke("POST","/api/v1/buckets",t).then((function(e){R(!1),r(!0)})).catch((function(e){R(!1),S(e)})),Q()}}(e)},children:Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.formScrollable,children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"bucket-name",name:"bucket-name",onChange:function(e){o(e.target.value)},label:"Bucket Name",value:C})}),Object(n.jsxs)(x.a,{item:!0,xs:12,children:[Object(n.jsx)(v.a,{component:"h6",variant:"h6",children:"Features"}),Object(n.jsx)("hr",{})]}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(za,{value:"versioned",id:"versioned",name:"versioned",checked:k,onChange:function(e){s(e.target.checked)},description:"Allows to keep multiple versions of the same object under the same key.",label:"Versioning",indicatorLabels:["On","Off"]})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(za,{value:"locking",id:"locking",name:"locking",disabled:G,checked:N,onChange:function(e){l(e.target.checked)},label:"Object Locking",description:"Required to support retention and legal hold. Can only be enabled at bucket creation.",indicatorLabels:["On","Off"]})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(za,{value:"bucket_quota",id:"bucket_quota",name:"bucket_quota",checked:w,onChange:function(e){d(e.target.checked)},label:"Quota",description:"Limit the amount of data in the bucket.",indicatorLabels:["On","Off"]})}),w&&Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(La,{currentSelection:T,id:"quota_type",name:"quota_type",label:"Quota Type",onChange:function(e){u(e.target.value)},selectorOptions:[{value:"hard",label:"Hard"},{value:"fifo",label:"FIFO"}]})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsxs)("div",{className:t.multiContainer,children:[Object(n.jsx)("div",{className:t.quotaSizeContainer,children:Object(n.jsx)(Ca,{type:"number",id:"quota_size",name:"quota_size",onChange:function(e){j(e.target.value)},label:"Quota",value:E,required:!0,min:"1"})}),Object(n.jsx)("div",{className:t.sizeFactorContainer,children:Object(n.jsx)(Aa,{label:"\xa0",id:"quota_unit",name:"quota_unit",value:A,onChange:function(e){m(e.target.value)},options:oe()})})]})})]}),k&&Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(za,{value:"bucket_retention",id:"bucket_retention",name:"bucket_retention",checked:_,onChange:function(e){h(e.target.checked)},label:"Retention",description:"Impose rules to prevent object deletion for a period of time.",indicatorLabels:["On","Off"]})}),_&&Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(La,{currentSelection:I,id:"retention_mode",name:"retention_mode",label:"Retention Mode",onChange:function(e){p(e.target.value)},selectorOptions:[{value:"compliance",label:"Compliance"},{value:"governance",label:"Governance"}]})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(La,{currentSelection:M,id:"retention_unit",name:"retention_unit",label:"Retention Unit",onChange:function(e){O(e.target.value)},selectorOptions:[{value:"days",label:"Days"},{value:"years",label:"Years"}]})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{type:"number",id:"retention_validity",name:"retention_validity",onChange:function(e){f(e.target.valueAsNumber)},label:"Retention Validity",value:String(F),required:!0,min:"1"})})]})]}),Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.buttonContainer,children:[Object(n.jsx)("button",{type:"button",color:"primary",className:t.clearButton,onClick:Q,children:"Clear"}),Object(n.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:B||!K,children:"Save"})]}),B&&Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(y.a,{})})]})})})}))),Ua=a(974),Wa=a(975),Va={setErrorSnackMessage:V},Ga=Object(s.b)(null,Va)((function(e){var t=e.closeDeleteModalAndRefresh,a=e.deleteOpen,i=e.selectedBucket,r=e.setErrorSnackMessage,o=Object(c.useState)(!1),s=Object(b.a)(o,2),l=s[0],d=s[1];return Object(n.jsxs)(pa.a,{open:a,onClose:function(){t(!1)},"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[Object(n.jsx)(Oa.a,{id:"alert-dialog-title",children:"Delete Bucket"}),Object(n.jsxs)(ga.a,{children:[l&&Object(n.jsx)(y.a,{}),Object(n.jsxs)(Ua.a,{id:"alert-dialog-description",children:["Are you sure you want to delete bucket ",Object(n.jsx)("b",{children:i}),"? ",Object(n.jsx)("br",{}),"A bucket can only be deleted if it's empty."]})]}),Object(n.jsxs)(Wa.a,{children:[Object(n.jsx)(g.a,{onClick:function(){t(!1)},color:"primary",disabled:l,children:"Cancel"}),Object(n.jsx)(g.a,{onClick:function(){l||(d(!0),Oe.invoke("DELETE","/api/v1/buckets/".concat(i),{name:i}).then((function(e){d(!1),t(!0)})).catch((function(e){d(!1),r(e)})))},color:"secondary",autoFocus:!0,children:"Delete"})]})]})})),qa=Object(w.a)((function(e){return Object(k.a)({headerContainer:{position:"absolute",width:"100%",height:77,display:"flex",backgroundColor:"#fff",borderBottom:"#E3E3E3 1px solid",left:0},label:{display:"flex",justifyContent:"flex-start",alignItems:"center"},labelStyle:{color:"#000",fontSize:18,fontWeight:700,marginLeft:55,marginTop:8}})}))((function(e){var t=e.classes,a=e.label;return Object(n.jsx)(x.a,{container:!0,className:t.headerContainer,children:Object(n.jsx)(x.a,{item:!0,xs:12,className:t.label,children:Object(n.jsx)(v.a,{variant:"h4",className:t.labelStyle,children:a})})})})),Ha=a(400),Ya=a.n(Ha),Qa=a(399),Za=a.n(Qa),Ja=Object(w.a)((function(e){return Object(k.a)(Object(j.a)({},Le))}))((function(e){var t=e.classes,a=e.label,i=void 0===a?"":a,r=e.content,o=e.multiLine,s=void 0!==o&&o;return Object(n.jsx)(c.Fragment,{children:Object(n.jsxs)(x.a,{className:t.prefinedContainer,children:[""!==i&&Object(n.jsx)(x.a,{item:!0,xs:12,className:t.predefinedTitle,children:i}),Object(n.jsx)(x.a,{item:!0,xs:12,className:t.predefinedList,children:Object(n.jsx)(x.a,{item:!0,xs:12,className:s?t.innerContentMultiline:t.innerContent,children:r})})]})})})),$a=Object(w.a)((function(e){return Object(k.a)({wizardStepContainer:{display:"flex",flexDirection:"column"},wizardComponent:{overflowY:"auto",marginBottom:10,height:"calc(100vh - 435px)",maxWidth:840,width:"100%"},wizardModal:{overflowY:"auto",marginBottom:10,height:"calc(100vh - 515px)"},buttonsContainer:{display:"flex",flexDirection:"row",justifyContent:"flex-start",padding:"10px 0",borderTop:"#EAEAEA 1px solid","& button":{marginLeft:10},"&.forModal":{paddingBottom:0}},buttonInnerContainer:{maxWidth:840,width:"100%",textAlign:"right"}})}))((function(e){var t=e.classes,a=e.page,c=e.pageChange,i=e.loadingStep,r=e.forModal;return Object(n.jsxs)("div",{className:t.wizardStepContainer,children:[Object(n.jsx)("div",{className:r?t.wizardModal:t.wizardComponent,children:a.componentRender}),i&&Object(n.jsx)("div",{children:Object(n.jsx)(y.a,{})}),Object(n.jsx)("div",{className:"".concat(t.buttonsContainer," ").concat(r?"forModal":""),children:Object(n.jsx)("div",{className:t.buttonInnerContainer,children:a.buttons.map((function(e){return Object(n.jsx)(g.a,{variant:"contained",color:"primary",size:"small",onClick:function(){!function(e){switch(e.type){case"next":c("++");break;case"back":c("--");break;case"to":c(e.toPage||0)}e.action&&e.action(c)}(e)},disabled:!e.enabled,children:e.label},"button-".concat(a.label,"-").concat(e.label))}))})})]})})),Xa=Object(w.a)((function(e){return Object(k.a)({wizardMain:{display:"flex",width:"100%",height:"100%",flexGrow:1},wizFromContainer:{height:"calc(100vh - 365px)",minHeight:450,padding:"0 30px"},wizFromModal:{position:"relative"},wizardSteps:{minWidth:180,marginRight:10,borderRight:"#eaeaea 1px solid",display:"flex",flexGrow:1,flexDirection:"column",height:"100%","& ul":{padding:"0 15px 0 40px",marginTop:0,"& li":{listStyle:"lower-roman",marginBottom:12}}},modalWizardSteps:{padding:5,borderBottom:"#eaeaea 1px solid","& ul":{padding:0,marginTop:0,display:"flex",justifyContent:"space-evenly","& li":{listStyle:"lower-roman","&::marker":{paddingLeft:15}}}},buttonList:{backgroundColor:"transparent",border:"none",cursor:"pointer","&:not(:disabled):hover":{textDecoration:"underline"},"&:selected, &:active, &:focus, &:focus:active":{border:"none",outline:0,boxShadow:"none"}},paddedContentGrid:{padding:"0 10px"},stepsLabel:{fontSize:20,color:"#393939",fontWeight:600,margin:"15px 12px","&.stepsModalTitle":{textAlign:"center",width:"100%",marginTop:0,marginBottom:10}},stepsMasterContainer:{position:"sticky",top:0,backgroundColor:"#FFFFFF",width:"100%",maxHeight:90}})}))((function(e){var t=e.classes,a=e.wizardSteps,i=e.loadingStep,r=e.forModal,o=Object(c.useState)(0),s=Object(b.a)(o,2),l=s[0],d=s[1],u=function(e){var t=a.length-1;if("++"===e){var n=l+1;n>t&&(n=t),d(n)}if("--"===e){var c=l-1;c<0&&(c=0),d(c)}if("number"===typeof e){var i=e;e<0&&(i=0),e>t&&(i=t),d(i)}};if(0===a.length)return null;var j=function(){return Object(n.jsx)("ul",{children:a.map((function(e,a){return Object(n.jsx)("li",{children:Object(n.jsx)("button",{onClick:function(){return u(a)},disabled:a>l,className:t.buttonList,children:e.label})},"wizard-".concat(a.toString()))}))})};return Object(n.jsxs)(x.a,{container:!0,className:r?t.wizFromModal:t.wizFromContainer,children:[r?Object(n.jsx)(c.Fragment,{children:Object(n.jsxs)("div",{className:t.stepsMasterContainer,children:[Object(n.jsx)("div",{className:"".concat(t.stepsLabel," stepsModalTitle"),children:"Steps"}),Object(n.jsx)("div",{className:t.modalWizardSteps,children:j()})]})}):Object(n.jsx)(c.Fragment,{children:Object(n.jsx)(x.a,{item:!0,xs:12,sm:3,md:3,lg:3,xl:2,children:Object(n.jsxs)("div",{className:t.wizardSteps,children:[Object(n.jsx)("span",{className:t.stepsLabel,children:"Steps"}),j()]})})}),Object(n.jsx)(x.a,{item:!0,xs:12,sm:r?12:9,md:r?12:9,lg:r?12:9,xl:r?12:10,className:r?"":t.paddedContentGrid,children:Object(n.jsx)($a,{page:a[l],pageChange:u,loadingStep:i,forModal:r})})]})})),en=Object(s.b)(null,{setModalErrorSnackMessage:q}),tn=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:"bold"}}},buttonContainer:{textAlign:"right"},remoteBucketList:{display:"grid",gridTemplateColumns:"auto auto 45px",alignItems:"center",justifyContent:"stretch"},errorIcon:{color:"#C72C48"},successIcon:{color:"#42C91A"},hide:{opacity:0,transitionDuration:"0.3s"}},Te),Ge))}))(en((function(e){var t=e.open,a=e.closeModalAndRefresh,i=e.classes,r=e.buckets,o=e.setModalErrorSnackMessage,s=Object(c.useState)([]),l=Object(b.a)(s,2),d=l[0],u=l[1],j=Object(c.useState)(!1),m=Object(b.a)(j,2),h=m[0],p=m[1],O=Object(c.useState)(!1),g=Object(b.a)(O,2),f=g[0],v=g[1],y=Object(c.useState)(""),S=Object(b.a)(y,2),C=S[0],k=S[1],N=Object(c.useState)(""),w=Object(b.a)(N,2),T=w[0],E=w[1],A=Object(c.useState)(""),_=Object(b.a)(A,2),I=_[0],M=_[1],F=Object(c.useState)(""),D=Object(b.a)(F,2),L=D[0],B=D[1],R=Object(c.useState)(!0),P=Object(b.a)(R,2),z=P[0],K=P[1],U=Object(c.useState)("async"),W=Object(b.a)(U,2),V=W[0],G=W[1],q=Object(c.useState)("100"),H=Object(b.a)(q,2),Y=H[0],Q=H[1],J=Object(c.useState)("Gi"),$=Object(b.a)(J,2),X=$[0],ee=$[1],te=Object(c.useState)("60"),ae=Object(b.a)(te,2),ne=ae[0],ce=ae[1],ie=Object(c.useState)([]),re=Object(b.a)(ie,2),oe=re[0],de=re[1],ue=Object(c.useState)([]),be=Object(b.a)(ue,2),je=be[0],me=be[1],he=Object(c.useState)([]),pe=Object(b.a)(he,2),ge=pe[0],fe=pe[1],xe=je.map((function(e){return{label:e,value:e}}));Object(c.useEffect)((function(){if(0===oe.length){var e=[],t=[];r.forEach((function(a){e.push(a),t.push("")})),de(t),u(e)}}),[r,oe.length]);var ve=function(e){var t=e.errString;switch(t){case"":return Object(n.jsx)("div",{className:i.successIcon,children:Object(n.jsx)(Za.a,{})});case"n/a":return null;default:if(t)return Object(n.jsx)("div",{className:i.errorIcon,children:Object(n.jsx)(la.a,{title:t,placement:"top-start",children:Object(n.jsx)(Ya.a,{})})})}return null},ye=function(e,t){var a=Object(Xe.a)(oe);a[e]=t,de(a)},Se=function(e){var t=Object(Xe.a)(d),a=Object(Xe.a)(oe);e.forEach((function(e){var n=Z()(e,"errorString","");if(!n||""===n){var c=t.indexOf(e.originBucket);t.splice(c,1),a.splice(c,1)}})),u(t),de(a)};return Object(n.jsx)(va,{modalOpen:t,onClose:function(){a(!1)},title:"Set Multiple Bucket Replication",children:Object(n.jsx)(Xa,{loadingStep:h||f,wizardSteps:[{label:"Remote Configuration",componentRender:Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ja,{label:"Local Buckets to replicate",content:d.join(", ")})}),Object(n.jsx)("h4",{children:"Remote Endpoint Configuration"}),Object(n.jsx)("span",{className:i.descriptionText,children:"Please avoid the use of root credentials for this feature"}),Object(n.jsx)("br",{}),Object(n.jsx)("br",{}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"accessKey",name:"accessKey",onChange:function(e){k(e.target.value)},label:"Access Key",value:C})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"secretKey",name:"secretKey",onChange:function(e){E(e.target.value)},label:"Secret Key",value:T})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"targetURL",name:"targetURL",onChange:function(e){M(e.target.value)},placeholder:"play.min.io:9000",label:"Target URL",value:I})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(za,{checked:z,id:"useTLS",name:"useTLS",label:"Use TLS",onChange:function(e){K(e.target.checked)},value:"yes"})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"region",name:"region",onChange:function(e){B(e.target.value)},label:"Region",value:L})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Aa,{id:"replication_mode",name:"replication_mode",onChange:function(e){G(e.target.value)},label:"Replication Mode",value:V,options:[{label:"Asynchronous",value:"async"},{label:"Synchronous",value:"sync"}]})}),"async"===V&&Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsxs)("div",{className:i.multiContainer,children:[Object(n.jsx)("div",{children:Object(n.jsx)(Ca,{type:"number",id:"bandwidth_scalar",name:"bandwidth_scalar",onChange:function(e){Q(e.target.value)},label:"Bandwidth",value:Y,min:"0"})}),Object(n.jsx)("div",{className:i.sizeFactorContainer,children:Object(n.jsx)(Aa,{label:"Unit",id:"bandwidth_unit",name:"bandwidth_unit",value:X,onChange:function(e){ee(e.target.value)},options:se()})})]})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"healthCheck",name:"healthCheck",onChange:function(e){ce(e.target.value)},label:"Health Check Duration",value:ne})})]}),buttons:[{type:"custom",label:"Next",enabled:!f,action:function(e){var t={accessKey:C,secretKey:T,targetURL:I,useTLS:z};v(!0),Oe.invoke("POST","api/v1/list-external-buckets",t).then((function(t){var a=Z()(t,"buckets",[]);if(a&&a.length>0){var n=a.map((function(e){return e.name}));me(n)}e("++"),v(!1)})).catch((function(e){v(!1),o(e)}))}}]},{label:"Buckets Assignation",componentRender:Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)("h3",{children:"Remote Buckets Assignation"}),Object(n.jsx)("span",{className:i.descriptionText,children:"Please select / type the desired remote bucket were you want the local data to be replicated."}),Object(n.jsx)("div",{className:i.remoteBucketList,children:d.map((function(e,t){var a,r=function(e){if(ge.length>0){var t=ge.find((function(t){return t.originBucket===e}));if(t)return Z()(t,"errorString","")||""}return"n/a"}(e);return Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)("div",{className:""===r?i.hide:"",children:e}),Object(n.jsx)("div",{className:""===r?i.hide:"",children:(a=t,je.length>0?Object(n.jsx)(c.Fragment,{children:Object(n.jsx)(Aa,{label:"",id:"assign-bucket-".concat(a),name:"assign-bucket-".concat(a),value:oe[a],onChange:function(e){ye(a,e.target.value)},options:xe,disabled:h})}):Object(n.jsx)(c.Fragment,{children:Object(n.jsx)(Ca,{id:"assign-bucket-".concat(a),name:"assign-bucket-".concat(a),label:"",onChange:function(e){ye(a,e.target.value)},value:oe[a],disabled:h})}))}),Object(n.jsx)("div",{className:""===r?i.hide:"",children:ge.length>0&&Object(n.jsx)(ve,{errString:r})})]},"buckets-assignation-".concat(t.toString(),"-").concat(e))}))})]}),buttons:[{type:"back",label:"Back",enabled:!0},{type:"next",label:"Create",enabled:!h,action:function(){p(!0);var e=d.map((function(e,t){return{originBucket:e,destinationBucket:oe[t]}})),t="".concat(z?"https://":"http://").concat(I),n=parseInt(ne),c={accessKey:C,secretKey:T,targetURL:t,region:L,bucketsRelation:e,syncMode:V,bandwidth:"async"===V?parseInt(le(Y,X,!0)):0,healthCheckPeriod:n};Oe.invoke("POST","/api/v1/buckets-replication",c).then((function(e){p(!1);var t=e.replicationState;fe(t),0===t.filter((function(e){return e.errorString&&""!==e.errorString})).length?a(!0):setTimeout((function(){Se(t)}),500)})).catch((function(e){p(!1),o(e)}))}}]}],forModal:!0})})}))),an=Object(s.b)((function(e){return{addBucketModalOpen:e.buckets.open}}),{addBucketOpen:function(e){return{type:vt,open:e}},addBucketReset:function(){return{type:Et}},setErrorSnackMessage:V})(Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({seeMore:{marginTop:e.spacing(3)},paper:{display:"flex",overflow:"auto",flexDirection:"column"},addSideBar:{width:"320px",padding:"20px"},tableToolbar:{paddingLeft:e.spacing(2),paddingRight:e.spacing(0)},minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:"bold"}}}},Fe),De),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))((function(e){var t=e.classes,a=e.addBucketOpen,i=e.addBucketModalOpen,r=e.addBucketReset,o=e.setErrorSnackMessage,s=Object(c.useState)([]),l=Object(b.a)(s,2),d=l[0],u=l[1],j=Object(c.useState)(!0),m=Object(b.a)(j,2),h=m[0],p=m[1],O=Object(c.useState)(!1),v=Object(b.a)(O,2),y=v[0],S=v[1],C=Object(c.useState)(""),k=Object(b.a)(C,2),N=k[0],w=k[1],T=Object(c.useState)(""),E=Object(b.a)(T,2),A=E[0],_=E[1],I=Object(c.useState)(!0),M=Object(b.a)(I,2),F=M[0],D=M[1],L=Object(c.useState)(!1),B=Object(b.a)(L,2),R=B[0],P=B[1],z=Object(c.useState)([]),K=Object(b.a)(z,2),U=K[0],W=K[1],V=Object(c.useState)(!1),G=Object(b.a)(V,2),q=G[0],H=G[1];Object(c.useEffect)((function(){F&&Oe.invoke("POST","/api/v1/has-permission",{actions:[{id:"createBucket",action:"s3:CreateBucket"}]}).then((function(e){if(D(!1),e.permissions){var t=(e.permissions?e.permissions:[]).find((function(e){return"createBucket"===e.id}));t&&t.can?P(!0):P(!1),D(!1)}})).catch((function(e){D(!1),o(e)}))}),[F,o]),Object(c.useEffect)((function(){if(h){p(!0),Oe.invoke("GET","/api/v1/buckets").then((function(e){p(!1),u(e.buckets||[])})).catch((function(e){p(!1),o(e)}))}}),[h,o]);var Y=[{type:"view",to:"/buckets",sendOnlyId:!0},{type:"delete",onClick:function(e){S(!0),w(e)},sendOnlyId:!0}],Q=d.filter((function(e){return""===A||e.name.indexOf(A)>=0}));return Object(n.jsxs)(c.Fragment,{children:[i&&Object(n.jsx)(Ka,{open:i,closeModalAndRefresh:function(e){a(!1),r(),e&&(p(!0),W([]))}}),y&&Object(n.jsx)(Ga,{deleteOpen:y,selectedBucket:N,closeDeleteModalAndRefresh:function(e){!function(e){S(!1),e&&(p(!0),W([]))}(e)}}),q&&Object(n.jsx)(tn,{open:q,buckets:U,closeModalAndRefresh:function(e){H(!1),e&&W([])}}),Object(n.jsx)(qa,{label:"Buckets"}),Object(n.jsx)(x.a,{container:!0,children:Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.container,children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.actionsTray,children:[Object(n.jsx)(f.a,{placeholder:"Search Buckets",className:t.searchField,id:"search-resource",label:"",onChange:function(e){_(e.target.value)},InputProps:{disableUnderline:!0,startAdornment:Object(n.jsx)(et.a,{position:"start",children:Object(n.jsx)(at.a,{})})}}),Object(n.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(n.jsx)(ct.a,{}),onClick:function(){H(!0)},disabled:0===U.length,children:"Set Replication"}),R&&Object(n.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(n.jsx)(lt,{}),onClick:function(){a(!0)},children:"Create Bucket"})]}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("br",{})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(ha,{itemActions:Y,columns:[{label:"Name",elementKey:"name"},{label:"Creation Date",elementKey:"creation_date",renderFunction:function(e){return Object(n.jsx)(rt.a,{children:e})}},{label:"Size",elementKey:"size",renderFunction:ce,width:60,contentTextAlign:"right"}],isLoading:h,records:Q,entityName:"Buckets",idField:"name",selectedItems:U,onSelect:function(e){var t=e.target,a=t.value,n=t.checked,c=Object(Xe.a)(U);return n?c.push(a):c=c.filter((function(e){return e!==a})),W(c),c}})})]})})]})}))),nn=a(999),cn=a(977),rn=a(448),on=function(e){var t=e.children,a=e.value,i=e.index,r=Object(rn.a)(e,["children","value","index"]);return Object(n.jsx)("div",Object(j.a)(Object(j.a)({role:"tabpanel",hidden:a!==i,id:"simple-tabpanel-".concat(i),"aria-labelledby":"simple-tab-".concat(i),style:{marginTop:"5px"}},r),{},{children:a===i&&Object(n.jsx)(c.Fragment,{children:t})}))},sn=Object(s.b)((function(e){return{session:e.console.session}}),{setErrorSnackMessage:V});function ln(e){return{id:"simple-tab-".concat(e),"aria-controls":"simple-tabpanel-".concat(e)}}var dn=Object(w.a)((function(e){return Object(k.a)({})}))(sn((function(e){e.classes;var t,a=e.match,i=e.setErrorSnackMessage,r=e.session,o=Object(c.useState)(0),s=Object(b.a)(o,2),l=s[0],d=s[1],m=Object(c.useState)(!0),h=Object(b.a)(m,2),p=h[0],O=h[1],g=Object(c.useState)([]),f=Object(b.a)(g,2),x=f[0],v=f[1],y=Object(c.useState)(!0),S=Object(b.a)(y,2),k=S[0],N=S[1],w=Object(c.useState)([]),T=Object(b.a)(w,2),E=T[0],A=T[1],_=a.params.bucketName,I=(null===(t=r.pages)||void 0===t?void 0:t.indexOf("/users"))>-1,M=[{type:"view",onClick:function(e){u.push("/policies/".concat(e.name))}}],F=[{type:"view",onClick:function(e){u.push("/users/".concat(e))}}];return Object(c.useEffect)((function(){k&&I&&Oe.invoke("GET","/api/v1/bucket-users/".concat(_)).then((function(e){A(e),N(!1)})).catch((function(e){i(e),N(!1)}))}),[k,i,_,I]),Object(c.useEffect)((function(){p&&Oe.invoke("GET","/api/v1/bucket-policy/".concat(_)).then((function(e){v(e.policies),O(!1)})).catch((function(e){i(e),O(!1)}))}),[p,i,_]),Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)("br",{}),Object(n.jsxs)(C.a,{children:[Object(n.jsxs)(nn.a,{value:l,onChange:function(e,t){d(t)},indicatorColor:"primary",textColor:"primary","aria-label":"cluster-tabs",variant:"scrollable",scrollButtons:"auto",children:[Object(n.jsx)(cn.a,Object(j.a)({label:"Policies"},ln(0))),I&&Object(n.jsx)(cn.a,Object(j.a)({label:"Users"},ln(1)))]}),Object(n.jsx)(on,{index:0,value:l,children:Object(n.jsx)(ha,{noBackground:!0,itemActions:M,columns:[{label:"Name",elementKey:"name"}],isLoading:p,records:x,entityName:"Policies",idField:"name"})}),I&&Object(n.jsx)(on,{index:1,value:l,children:Object(n.jsx)(ha,{noBackground:!0,itemActions:F,columns:[{label:"User",elementKey:"accessKey"}],isLoading:k,records:E,entityName:"Users",idField:"accessKey"})})]})]})}))),un=Object(s.b)(null,{setModalErrorSnackMessage:q}),bn=Object(w.a)((function(e){return Object(k.a)(Object(j.a)({},Te))}))(un((function(e){var t=e.classes,a=e.open,i=e.bucketName,r=e.actualPolicy,o=e.closeModalAndRefresh,s=e.setModalErrorSnackMessage,l=Object(c.useState)(!1),d=Object(b.a)(l,2),u=d[0],j=d[1],m=Object(c.useState)(""),h=Object(b.a)(m,2),p=h[0],O=h[1];return Object(c.useEffect)((function(){O(r)}),[O,r]),Object(n.jsx)(va,{title:"Change Access Policy",modalOpen:a,onClose:function(){o()},children:Object(n.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){e.preventDefault(),u||(j(!0),Oe.invoke("PUT","/api/v1/buckets/".concat(i,"/set-policy"),{access:p}).then((function(e){j(!1),o()})).catch((function(e){j(!1),s(e)})))},children:Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsx)(x.a,{item:!0,xs:12,className:t.formScrollable,children:Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Aa,{value:p,label:"Access Policy",id:"select-access-policy",name:"select-access-policy",onChange:function(e){O(e.target.value)},options:[{value:"PRIVATE",label:"Private"},{value:"PUBLIC",label:"Public"}]})})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",fullWidth:!0,disabled:u,children:"Set"})}),u&&Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(y.a,{})})]})})})}))),jn=Object(s.b)(null,{setModalErrorSnackMessage:q}),mn=Object(w.a)((function(e){return Object(k.a)(Object(j.a)({},Te))}))(jn((function(e){var t=e.classes,a=e.open,i=e.bucketName,r=e.closeModalAndRefresh,o=e.setModalErrorSnackMessage,s=Object(c.useState)(!1),l=Object(b.a)(s,2),d=l[0],u=l[1],j=Object(c.useState)("compliance"),m=Object(b.a)(j,2),h=m[0],p=m[1],O=Object(c.useState)("days"),f=Object(b.a)(O,2),v=f[0],S=f[1],C=Object(c.useState)(1),k=Object(b.a)(C,2),N=k[0],w=k[1],T=Object(c.useState)(!1),E=Object(b.a)(T,2),A=E[0],_=E[1];return Object(c.useEffect)((function(){Number.isNaN(N)||N<1?_(!1):_(!0)}),[N]),Object(n.jsx)(va,{title:"Set Retention Configuration",modalOpen:a,onClose:function(){r()},children:Object(n.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){e.preventDefault(),d||(u(!0),Oe.invoke("PUT","/api/v1/buckets/".concat(i,"/retention"),{mode:h,unit:v,validity:N}).then((function(){u(!1),r()})).catch((function(e){u(!1),o(e)})))},children:Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.formScrollable,children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(La,{currentSelection:h,id:"retention_mode",name:"retention_mode",label:"Retention Mode",onChange:function(e){p(e.target.value)},selectorOptions:[{value:"compliance",label:"Compliance"},{value:"governance",label:"Governance"}]})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(La,{currentSelection:v,id:"retention_unit",name:"retention_unit",label:"Retention Unit",onChange:function(e){S(e.target.value)},selectorOptions:[{value:"days",label:"Days"},{value:"years",label:"Years"}]})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{type:"number",id:"retention_validity",name:"retention_validity",onChange:function(e){w(e.target.valueAsNumber)},label:"Retention Validity",value:String(N),required:!0,min:"1"})})]}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",fullWidth:!0,disabled:d||!A,children:"Set"})}),d&&Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(y.a,{})})]})})})}))),hn=Object(s.b)(null,{setModalErrorSnackMessage:q}),pn=Object(w.a)((function(e){return Object(k.a)(Object(j.a)({minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:"bold"}}},buttonContainer:{textAlign:"right"}},Te))}))(hn((function(e){var t=e.classes,a=e.open,i=(e.encryptionEnabled,e.encryptionCfg),r=e.selectedBucket,o=e.closeModalAndRefresh,s=e.setModalErrorSnackMessage,l=Object(c.useState)(!1),d=Object(b.a)(l,2),u=d[0],j=d[1],m=Object(c.useState)(""),h=Object(b.a)(m,2),p=h[0],O=h[1],f=Object(c.useState)("disabled"),v=Object(b.a)(f,2),S=v[0],C=v[1];Object(c.useEffect)((function(){i&&("AES256"===i.algorithm?C("sse-s3"):(C("sse-kms"),O(i.kmsMasterKeyID)))}),[i]);return Object(n.jsx)(va,{modalOpen:a,onClose:function(){o()},title:"Enable Bucket Encryption",children:Object(n.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){e.preventDefault(),u||("disabled"===S?Oe.invoke("POST","/api/v1/buckets/".concat(r,"/encryption/disable")).then((function(){j(!1),o()})).catch((function(e){j(!1),s(e)})):Oe.invoke("POST","/api/v1/buckets/".concat(r,"/encryption/enable"),{encType:S,kmsKeyID:p}).then((function(){j(!1),o()})).catch((function(e){j(!1),s(e)})))},children:Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.formScrollable,children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Aa,{onChange:function(e){C(e.target.value)},id:"select-encryption-type",name:"select-encryption-type",label:"Encryption Type",value:S,options:[{label:"Disabled",value:"disabled"},{label:"SSE-S3",value:"sse-s3"},{label:"SSE-KMS",value:"sse-kms"}]})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("br",{})}),"sse-kms"===S&&Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"kms-key-id",name:"kms-key-id",label:"KMS Key ID",value:p,onChange:function(e){O(e.target.value)}})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("br",{})})]}),Object(n.jsx)(x.a,{item:!0,xs:12,className:t.buttonContainer,children:Object(n.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:u,children:"Save"})}),u&&Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(y.a,{})})]})})})}))),On=Object(s.b)(null,{setErrorSnackMessage:V})((function(e){var t=e.closeVersioningModalAndRefresh,a=e.modalOpen,i=e.selectedBucket,r=e.versioningCurrentState,o=e.setErrorSnackMessage,s=Object(c.useState)(!1),l=Object(b.a)(s,2),d=l[0],u=l[1];return Object(n.jsxs)(pa.a,{open:a,onClose:function(){t(!1)},"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[Object(n.jsx)(Oa.a,{id:"alert-dialog-title",children:"Edit Versioning"}),Object(n.jsxs)(ga.a,{children:[d&&Object(n.jsx)(y.a,{}),Object(n.jsxs)(Ua.a,{id:"alert-dialog-description",children:["Are you sure you want to"," ",Object(n.jsx)("strong",{children:r?"disable":"enable"})," ","versioning for this bucket?",r&&Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)("br",{}),Object(n.jsx)("br",{}),Object(n.jsx)("strong",{children:"File versions won't be automatically deleted"})]})]})]}),Object(n.jsxs)(Wa.a,{children:[Object(n.jsx)(g.a,{onClick:function(){t(!1)},color:"primary",disabled:d,children:"Cancel"}),Object(n.jsx)(g.a,{onClick:function(){d||(u(!0),Oe.invoke("PUT","/api/v1/buckets/".concat(i,"/versioning"),{versioning:!r}).then((function(){u(!1),t(!0)})).catch((function(e){u(!1),o(e)})))},color:"secondary",autoFocus:!0,children:r?"Disable":"Enable"})]})]})})),gn=function(){return Object(n.jsxs)(ot.a,{viewBox:"0 0 16.172 17.187",children:[Object(n.jsx)("defs",{children:Object(n.jsxs)("linearGradient",{id:"a",y1:"0.5",x2:"1",y2:"0.5",gradientUnits:"objectBoundingBox",children:[Object(n.jsx)("stop",{offset:"0.044",stopColor:"#362585"}),Object(n.jsx)("stop",{offset:"0.301",stopColor:"#281b6f"}),Object(n.jsx)("stop",{offset:"1",stopColor:"#1e1560"})]})}),Object(n.jsx)("path",{style:{fill:"none",stroke:"#707070",strokeMiterlimit:10,strokeWidth:"0.5px"},d:"M-4778.1,2239.582v6.425h6.425",transform:"translate(4787.594 -2239.582)"}),Object(n.jsx)("path",{fill:"#707070",d:"M-4784.238,2247.532v-.581c0-.027.009-.054.012-.081.039-.313.055-.632.121-.939a6.744,6.744,0,0,1,3.064-4.441,6.514,6.514,0,0,1,3.293-1.032,6.923,6.923,0,0,1,2.667.423,6.793,6.793,0,0,1,4.119,4.333,6.053,6.053,0,0,1,.279,1.337c.006.083.014.164.021.247v.86c-.011.131-.018.261-.032.392a6.494,6.494,0,0,1-.626,2.147,6.807,6.807,0,0,1-4.044,3.528,6.052,6.052,0,0,1-1.663.3,6.576,6.576,0,0,1-2.565-.325,6.73,6.73,0,0,1-3.947-3.451,6.627,6.627,0,0,1-.658-2.288C-4784.212,2247.816-4784.225,2247.674-4784.238,2247.532Zm13.025-.306c-.024-.309-.021-.661-.082-1a6.206,6.206,0,0,0-1.658-3.293,6.153,6.153,0,0,0-4.1-1.9,5.984,5.984,0,0,0-2.476.355,6.188,6.188,0,0,0-4.134,5.708,6.453,6.453,0,0,0,.228,1.881,6.127,6.127,0,0,0,1.984,3.052,6.046,6.046,0,0,0,3.806,1.445,6.043,6.043,0,0,0,1.235-.065,6.249,6.249,0,0,0,3.783-2.2,6.2,6.2,0,0,0,1.352-3.048C-4771.228,2247.863-4771.233,2247.563-4771.212,2247.226Z",transform:"translate(4786.834 -2240.452)"}),Object(n.jsx)("ellipse",{style:{opacity:.1,fill:"url(#a)"},cx:"6.151",cy:"6.151",rx:"6.151",ry:"6.151",transform:"translate(0 4.886)"})]})},fn=a(402),xn=a.n(fn),vn=Object(s.b)(null,{setModalErrorSnackMessage:q}),yn=Object(w.a)((function(e){return Object(k.a)(Object(j.a)({minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:"bold"}}},buttonContainer:{textAlign:"right"},multiContainer:{display:"flex",alignItems:"center",justifyContent:"flex-start"}},Te))}))(vn((function(e){var t=e.classes,a=e.open,r=e.enabled,o=e.cfg,s=e.selectedBucket,l=e.closeModalAndRefresh,d=e.setModalErrorSnackMessage,u=Object(c.useState)(!1),j=Object(b.a)(u,2),m=j[0],h=j[1],p=Object(c.useState)(!1),O=Object(b.a)(p,2),f=O[0],v=O[1],S=Object(c.useState)("hard"),C=Object(b.a)(S,2),k=C[0],N=C[1],w=Object(c.useState)("1"),T=Object(b.a)(w,2),E=T[0],A=T[1],_=Object(c.useState)("TiB"),I=Object(b.a)(_,2),M=I[0],F=I[1];Object(c.useEffect)((function(){if(r&&(v(!0),o)){N(o.type),A("".concat(o.quota)),F("B");for(var e="B",t=o.quota,a=0;a<te.length&&o.quota%Math.pow(1024,a)===0;a++)t=o.quota/Math.pow(1024,a),e=te[a];A("".concat(t)),F(e)}}),[r,o]);return Object(n.jsx)(va,{modalOpen:a,onClose:function(){l()},title:"Enable Bucket Quota",children:Object(n.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){!function(e){if(e.preventDefault(),!m){var t={enabled:f,amount:parseInt(le(E,M,!1)),quota_type:k};Oe.invoke("PUT","/api/v1/buckets/".concat(s,"/quota"),t).then((function(){h(!1),l()})).catch((function(e){h(!1),d(e)}))}}(e)},children:Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.formScrollable,children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(za,{value:"bucket_quota",id:"bucket_quota",name:"bucket_quota",checked:f,onChange:function(e){v(e.target.checked)},label:"Quota",indicatorLabels:["On","Off"]})}),f&&Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(La,{currentSelection:k,id:"quota_type",name:"quota_type",label:"Quota Type",onChange:function(e){N(e.target.value)},selectorOptions:[{value:"hard",label:"Hard"},{value:"fifo",label:"FIFO"}]})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsxs)("div",{className:t.multiContainer,children:[Object(n.jsx)("div",{className:t.quotaSizeContainer,children:Object(n.jsx)(Ca,{type:"number",id:"quota_size",name:"quota_size",onChange:function(e){A(e.target.value)},label:"Quota",value:E,required:!0,min:"1"})}),Object(n.jsx)("div",{className:t.sizeFactorContainer,children:Object(n.jsx)(Aa,{label:"\xa0",id:"quota_unit",name:"quota_unit",value:M,onChange:function(e){F(e.target.value)},options:oe()})})]})})]}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("br",{})})]}),Object(n.jsx)(x.a,{item:!0,xs:12,className:t.buttonContainer,children:Object(n.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:m,children:"Save"})}),m&&Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(y.a,{})})]})})})}))),Sn=Object(s.b)((function(e){return{session:e.console.session}}),{setErrorSnackMessage:V}),Cn=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({paperContainer:{padding:15,paddingLeft:50,display:"flex"},elementTitle:{fontWeight:500,color:"#777777",fontSize:14,marginTop:-9},consumptionValue:{color:"#000000",fontSize:"48px",fontWeight:"bold"},reportedUsage:{padding:"15px"},dualCardLeft:{paddingRight:"5px"},dualCardRight:{paddingLeft:"5px"}},He),qe))}))(Sn((function(e){var t=e.classes,a=e.match,r=e.setErrorSnackMessage,o=Object(c.useState)(null),s=Object(b.a)(o,2),l=s[0],d=s[1],u=Object(c.useState)(null),j=Object(b.a)(u,2),m=j[0],h=j[1],p=Object(c.useState)("0"),O=Object(b.a)(p,2),f=O[0],y=O[1],k=Object(c.useState)(!1),N=Object(b.a)(k,2),w=N[0],T=N[1],E=Object(c.useState)(!1),A=Object(b.a)(E,2),_=A[0],I=A[1],M=Object(c.useState)(!1),F=Object(b.a)(M,2),D=F[0],L=F[1],B=Object(c.useState)(!0),R=Object(b.a)(B,2),P=R[0],z=R[1],K=Object(c.useState)(!0),U=Object(b.a)(K,2),W=U[0],V=U[1],G=Object(c.useState)(!0),q=Object(b.a)(G,2),H=q[0],Y=q[1],Q=Object(c.useState)(!0),J=Object(b.a)(Q,2),$=J[0],X=J[1],ee=Object(c.useState)(!0),te=Object(b.a)(ee,2),ae=te[0],ne=te[1],ie=Object(c.useState)(!0),re=Object(b.a)(ie,2),oe=re[0],se=re[1],le=Object(c.useState)(!0),de=Object(b.a)(le,2),ue=de[0],be=de[1],je=Object(c.useState)(!1),me=Object(b.a)(je,2),he=me[0],pe=me[1],ge=Object(c.useState)(!1),fe=Object(b.a)(ge,2),xe=fe[0],ve=fe[1],ye=Object(c.useState)(null),Se=Object(b.a)(ye,2),Ce=Se[0],ke=Se[1],Ne=Object(c.useState)(!1),we=Object(b.a)(Ne,2),Te=we[0],Ee=we[1],Ae=Object(c.useState)(!1),_e=Object(b.a)(Ae,2),Ie=_e[0],Me=_e[1],Fe=Object(c.useState)(!1),De=Object(b.a)(Fe,2),Le=De[0],Be=De[1],Re=Object(c.useState)(!1),Pe=Object(b.a)(Re,2),ze=Pe[0],Ke=Pe[1],Ue=Object(c.useState)(!1),We=Object(b.a)(Ue,2),Ve=We[0],Ge=We[1],qe=a.params.bucketName,He="n/a";null!==l&&(He=l.access),Object(c.useEffect)((function(){H&&Oe.invoke("GET","/api/v1/buckets/".concat(qe)).then((function(e){Y(!1),d(e)})).catch((function(e){Y(!1),r(e)}))}),[H,r,qe]),Object(c.useEffect)((function(){$&&Oe.invoke("GET","/api/v1/buckets/".concat(qe,"/encryption/info")).then((function(e){e.algorithm&&(Ee(!0),h(e)),X(!1)})).catch((function(e){"The server side encryption configuration was not found"===e&&(Ee(!1),h(null)),X(!1)}))}),[$,qe]),Object(c.useEffect)((function(){ae&&Oe.invoke("GET","/api/v1/buckets/".concat(qe,"/versioning")).then((function(e){pe(e.is_versioned),ne(!1)})).catch((function(e){r(e),ne(!1)}))}),[ae,r,qe]),Object(c.useEffect)((function(){oe&&Oe.invoke("GET","/api/v1/buckets/".concat(qe,"/quota")).then((function(e){ke(e),e.quota?ve(!0):ve(!1),se(!1)})).catch((function(e){r(e),ve(!1),ne(!1)}))}),[oe,ne,r,qe]),Object(c.useEffect)((function(){ae&&Oe.invoke("GET","/api/v1/buckets/".concat(qe,"/object-locking")).then((function(e){T(e.object_locking_enabled),z(!1)})).catch((function(e){r(e),z(!1)}))}),[P,r,qe,ae]),Object(c.useEffect)((function(){W&&Oe.invoke("GET","/api/v1/buckets").then((function(e){var t=Z()(e,"buckets",[]).find((function(e){return e.name===qe})),a=Z()(t,"size","0");V(!1),y(a)})).catch((function(e){V(!1),r(e)}))}),[W,r,qe]),Object(c.useEffect)((function(){ue&&Oe.invoke("GET","/api/v1/buckets/".concat(qe,"/replication")).then((function(e){var t=e.rules?e.rules:[];L(t.length>0),be(!1)})).catch((function(e){r(e),be(!1)}))}),[ue,r,qe]);var Ye,Qe=function(){Y(!0),V(!0),ne(!0),X(!0)};return Object(n.jsxs)(c.Fragment,{children:[Le&&Object(n.jsx)(pn,{open:Le,selectedBucket:qe,encryptionEnabled:Te,encryptionCfg:m,closeModalAndRefresh:function(){Be(!1),X(!0)}}),ze&&Object(n.jsx)(yn,{open:ze,selectedBucket:qe,enabled:xe,cfg:Ce,closeModalAndRefresh:function(){Ke(!1),se(!0)}}),_&&Object(n.jsx)(bn,{bucketName:qe,open:_,actualPolicy:He,closeModalAndRefresh:function(){I(!1),Qe()}}),Ie&&Object(n.jsx)(mn,{bucketName:qe,open:Ie,closeModalAndRefresh:function(){Me(!1),Qe()}}),Ve&&Object(n.jsx)(On,{closeVersioningModalAndRefresh:function(e){Ge(!1),e&&Qe()},modalOpen:Ve,selectedBucket:qe,versioningCurrentState:he}),Object(n.jsx)("br",{}),Object(n.jsx)(C.a,{className:t.paperContainer,children:Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsxs)(x.a,{item:!0,xs:9,children:[Object(n.jsx)("h2",{children:"Details"}),Object(n.jsx)("hr",{className:t.hrClass}),Object(n.jsx)("table",{width:"100%",children:Object(n.jsxs)("tbody",{children:[Object(n.jsxs)("tr",{children:[Object(n.jsx)("td",{className:t.titleCol,children:"Access Policy:"}),Object(n.jsx)("td",{className:t.capitalizeFirst,children:Object(n.jsx)(g.a,{color:"primary",className:t.anchorButton,onClick:function(){I(!0)},children:H?Object(n.jsx)(S.a,{color:"primary",size:16,variant:"indeterminate"}):He.toLowerCase()})}),Object(n.jsx)("td",{className:t.titleCol,children:"Encryption:"}),Object(n.jsx)("td",{children:$?Object(n.jsx)(S.a,{color:"primary",size:16,variant:"indeterminate"}):Object(n.jsx)(g.a,{color:"primary",className:t.anchorButton,onClick:function(){Be(!0)},children:Te?"Enabled":"Disabled"})})]}),Object(n.jsxs)("tr",{children:[Object(n.jsx)("td",{className:t.titleCol,children:"Replication:"}),Object(n.jsx)("td",{className:t.doubleElement,children:Object(n.jsx)("span",{children:D?"Enabled":"Disabled"})}),w?Object(n.jsx)(i.a.Fragment,{children:Object(n.jsx)("td",{colSpan:2})}):Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsx)("td",{className:t.titleCol,children:"Object Locking:"}),Object(n.jsx)("td",{children:"Disabled"})]})]})]})})]}),Object(n.jsxs)(x.a,{item:!0,xs:3,className:t.reportedUsage,children:[Object(n.jsxs)(x.a,{container:!0,direction:"row",alignItems:"center",children:[Object(n.jsx)(x.a,{item:!0,className:t.icon,xs:2,children:Object(n.jsx)(gn,{})}),Object(n.jsx)(x.a,{item:!0,xs:10,children:Object(n.jsx)(v.a,{className:t.elementTitle,children:"Reported Usage"})})]}),Object(n.jsx)(v.a,{className:t.consumptionValue,children:ce(f)})]})]})}),Object(n.jsx)("br",{}),Object(n.jsx)("br",{}),Object(n.jsx)(C.a,{className:t.paperContainer,children:Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsxs)(x.a,{item:!0,xs:xe?9:12,children:[Object(n.jsx)("h2",{children:"Versioning"}),Object(n.jsx)("hr",{className:t.hrClass}),Object(n.jsx)("table",{width:"100%",children:Object(n.jsx)("tbody",{children:Object(n.jsxs)("tr",{children:[Object(n.jsx)("td",{className:t.titleCol,children:"Versioning:"}),Object(n.jsx)("td",{children:ae?Object(n.jsx)(S.a,{color:"primary",size:16,variant:"indeterminate"}):Object(n.jsx)(c.Fragment,{children:Object(n.jsx)(g.a,{color:"primary",className:t.anchorButton,onClick:function(){Ge(!0)},children:he?"Enabled":"Disabled"})})}),Object(n.jsx)("td",{className:t.titleCol,children:"Quota:"}),Object(n.jsx)("td",{children:oe?Object(n.jsx)(S.a,{color:"primary",size:16,variant:"indeterminate"}):Object(n.jsx)(c.Fragment,{children:Object(n.jsx)(g.a,{color:"primary",className:t.anchorButton,onClick:function(){Ke(!0)},children:xe?"Enabled":"Disabled"})})})]})})})]}),xe&&Ce&&Object(n.jsxs)(x.a,{item:!0,xs:3,className:t.reportedUsage,children:[Object(n.jsxs)(x.a,{container:!0,direction:"row",alignItems:"center",children:[Object(n.jsx)(x.a,{item:!0,className:t.icon,xs:2,children:Object(n.jsx)(xn.a,{})}),Object(n.jsx)(x.a,{item:!0,xs:10,children:Object(n.jsxs)(v.a,{className:t.elementTitle,children:[(Ye=null===Ce||void 0===Ce?void 0:Ce.type,Ye?Ye[0].toUpperCase()+Ye.slice(1):null)," Quota"]})})]}),Object(n.jsx)(v.a,{className:t.consumptionValue,children:ce("".concat(null===Ce||void 0===Ce?void 0:Ce.quota))})]})]})}),Object(n.jsx)("br",{}),Object(n.jsx)("br",{}),w&&Object(n.jsx)(C.a,{className:t.paperContainer,children:Object(n.jsx)(x.a,{container:!0,children:Object(n.jsxs)(x.a,{item:!0,xs:12,children:[Object(n.jsx)("h2",{children:"Object Locking"}),Object(n.jsx)("hr",{className:t.hrClass}),Object(n.jsx)("table",{children:Object(n.jsx)("tbody",{children:Object(n.jsxs)("tr",{className:t.gridContainer,children:[Object(n.jsx)("td",{className:t.titleCol,children:"Retention:"}),Object(n.jsx)("td",{children:ae?Object(n.jsx)(S.a,{color:"primary",size:16,variant:"indeterminate"}):Object(n.jsx)(c.Fragment,{children:Object(n.jsx)(g.a,{color:"primary",className:t.anchorButton,onClick:function(){Me(!0)},children:"Configure"})})})]})})})]})})})]})}))),kn=Object(s.b)(null,{setErrorSnackMessage:V})((function(e){var t=e.closeDeleteModalAndRefresh,a=e.deleteOpen,i=e.selectedBucket,r=e.bucketEvent,o=e.setErrorSnackMessage,s=Object(c.useState)(!1),l=Object(b.a)(s,2),d=l[0],u=l[1];return Object(n.jsxs)(pa.a,{open:a,onClose:function(){t(!1)},"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[Object(n.jsx)(Oa.a,{id:"alert-dialog-title",children:"Delete Event"}),Object(n.jsxs)(ga.a,{children:[d&&Object(n.jsx)(y.a,{}),Object(n.jsx)(Ua.a,{id:"alert-dialog-description",children:"Are you sure you want to delete this event?"})]}),Object(n.jsxs)(Wa.a,{children:[Object(n.jsx)(g.a,{onClick:function(){t(!1)},color:"primary",disabled:d,children:"Cancel"}),Object(n.jsx)(g.a,{onClick:function(){!function(){if(!d&&null!=r){u(!0);var e=Z()(r,"events",[]),a=Z()(r,"prefix",""),n=Z()(r,"suffix","");Oe.invoke("DELETE","/api/v1/buckets/".concat(i,"/events/").concat(r.arn),{events:e,prefix:a,suffix:n}).then((function(e){u(!1),t(!0)})).catch((function(e){u(!1),o(e)}))}}()},color:"secondary",autoFocus:!0,children:"Delete"})]})]})})),Nn=a(979),wn=a(980),Tn=a(981),En=a(982),An=a(978),_n=Object(s.b)(null,{setModalErrorSnackMessage:q}),In=Object(w.a)((function(e){return Object(k.a)(Object(j.a)({minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:"bold"}}},buttonContainer:{textAlign:"right"}},Te))}))(_n((function(e){var t=e.classes,a=e.open,i=e.selectedBucket,r=e.closeModalAndRefresh,o=e.setModalErrorSnackMessage,s=Object(c.useState)(!1),l=Object(b.a)(s,2),d=l[0],u=l[1],j=Object(c.useState)(""),m=Object(b.a)(j,2),h=m[0],p=m[1],O=Object(c.useState)(""),f=Object(b.a)(O,2),v=f[0],S=f[1],C=Object(c.useState)(""),k=Object(b.a)(C,2),N=k[0],w=k[1],T=Object(c.useState)([]),E=Object(b.a)(T,2),A=E[0],_=E[1],I=Object(c.useState)([]),M=Object(b.a)(I,2),F=M[0],D=M[1],L=Object(c.useCallback)((function(){u(!0),Oe.invoke("GET","/api/v1/admin/arns").then((function(e){var t=[];null!==e.arns&&(t=e.arns),u(!1),D(t)})).catch((function(e){u(!1),o(e)}))}),[o]);Object(c.useEffect)((function(){L()}),[L]);var B=function(e,t){var a=A.indexOf(t),n=[];-1===a?n=n.concat(A,t):0===a?n=n.concat(A.slice(1)):a===A.length-1?n=n.concat(A.slice(0,-1)):a>0&&(n=n.concat(A.slice(0,a),A.slice(a+1))),_(n)},R=F.map((function(e){return{label:e,value:e}}));return Object(n.jsx)(va,{modalOpen:a,onClose:function(){r()},title:"Subscribe To Event",children:Object(n.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){e.preventDefault(),d||(u(!0),Oe.invoke("POST","/api/v1/buckets/".concat(i,"/events"),{configuration:{arn:N,events:A,prefix:h,suffix:v},ignoreExisting:!0}).then((function(){u(!1),r()})).catch((function(e){u(!1),o(e)})))},children:Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.formScrollable,children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Aa,{onChange:function(e){w(e.target.value)},id:"select-access-policy",name:"select-access-policy",label:"ARN",value:N,options:R})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsxs)(An.a,{size:"medium",children:[Object(n.jsx)(Nn.a,{className:t.minTableHeader,children:Object(n.jsxs)(wn.a,{children:[Object(n.jsx)(Tn.a,{children:"Select"}),Object(n.jsx)(Tn.a,{children:"Event"})]})}),Object(n.jsx)(En.a,{children:[{label:"PUT - Object Uploaded",value:"put"},{label:"GET - Object accessed",value:"get"},{label:"DELETE - Object Deleted",value:"delete"}].map((function(e){return Object(n.jsxs)(wn.a,{onClick:function(t){return B(0,e.value)},children:[Object(n.jsx)(Tn.a,{padding:"checkbox",children:Object(n.jsx)(Pt.a,{value:e.value,color:"primary",inputProps:{"aria-label":"secondary checkbox"},onChange:function(t){return B(0,e.value)},checked:A.includes(e.value)})}),Object(n.jsx)(Tn.a,{className:t.wrapCell,children:e.label})]},"group-".concat(e.value))}))})]})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("br",{})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"prefix-input",name:"prefix-input",label:"Prefix",value:h,onChange:function(e){p(e.target.value)}})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"suffix-input",name:"suffix-input",label:"Suffix",value:v,onChange:function(e){S(e.target.value)}})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("br",{})})]}),Object(n.jsx)(x.a,{item:!0,xs:12,className:t.buttonContainer,children:Object(n.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:d,children:"Save"})}),d&&Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(y.a,{})})]})})})}))),Mn=Object(s.b)((function(e){return{session:e.console.session}}),{setErrorSnackMessage:V}),Fn=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({},De),Fe),{},{actionsTray:Object(j.a)(Object(j.a)({},Fe.actionsTray),{},{padding:"15px 0 0"})}))}))(Mn((function(e){var t=e.classes,a=e.match,i=e.setErrorSnackMessage,r=Object(c.useState)(!1),o=Object(b.a)(r,2),s=o[0],l=o[1],d=Object(c.useState)(!0),u=Object(b.a)(d,2),j=u[0],m=u[1],h=Object(c.useState)([]),p=Object(b.a)(h,2),O=p[0],v=p[1],y=Object(c.useState)(!1),S=Object(b.a)(y,2),C=S[0],k=S[1],N=Object(c.useState)(null),w=Object(b.a)(N,2),T=w[0],E=w[1],A=Object(c.useState)(""),_=Object(b.a)(A,2),I=(_[0],_[1]),M=a.params.bucketName;Object(c.useEffect)((function(){j&&Oe.invoke("GET","/api/v1/buckets/".concat(M,"/events")).then((function(e){var t=Z()(e,"events",[]);m(!1),v(t||[])})).catch((function(e){m(!1),i(e)}))}),[j,i,M]);var F=[{type:"delete",onClick:function(e){k(!0),E(e)}}];return Object(n.jsxs)(c.Fragment,{children:[C&&Object(n.jsx)(kn,{deleteOpen:C,selectedBucket:M,bucketEvent:T,closeDeleteModalAndRefresh:function(e){k(!1),e&&m(!0)}}),s&&Object(n.jsx)(In,{open:s,selectedBucket:M,closeModalAndRefresh:function(){l(!1),m(!0)}}),Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.actionsTray,children:[Object(n.jsx)(f.a,{placeholder:"Filter",className:t.searchField,id:"search-resource",label:"",onChange:function(e){I(e.target.value)},InputProps:{disableUnderline:!0,startAdornment:Object(n.jsx)(et.a,{position:"start",children:Object(n.jsx)(at.a,{})})}}),Object(n.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(n.jsx)(lt,{}),size:"medium",onClick:function(){l(!0)},children:"Subscribe to Event"})]}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("br",{})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(ha,{itemActions:F,columns:[{label:"SQS",elementKey:"arn"},{label:"Events",elementKey:"events",renderFunction:function(e){return Object(n.jsx)(c.Fragment,{children:e.join(", ")})}},{label:"Prefix",elementKey:"prefix"},{label:"Suffix",elementKey:"suffix"}],isLoading:j,records:O,entityName:"Events",idField:"id"})})]})]})}))),Dn=a(148),Ln=a.n(Dn),Bn=a(403),Rn=a.n(Bn),Pn=function(){return Object(n.jsx)(ot.a,{viewBox:"0 0 12 12",children:Object(n.jsx)("path",{fill:"#081c42",className:"a",d:"M-13160.269,1885.114h-3.235v-4.381h-4.382V1877.5h4.382v-4.381h3.235v4.381h4.383v3.238h-4.383v4.38Z",transform:"translate(13167.886 -1873.114)"})})},zn=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({},we),Ee),{},{inputWithBorder:{border:"1px solid #EAEAEA",padding:15,height:150,overflowY:"auto",position:"relative",marginTop:15},labelContainer:{display:"flex"},lineInputBoxes:{display:"flex"},queryDiv:{alignSelf:"center",margin:"0 4px",fontWeight:600}}))}))((function(e){var t=e.elements,a=e.name,r=e.label,o=e.tooltip,s=void 0===o?"":o,l=e.keyPlaceholder,d=void 0===l?"":l,u=e.valuePlaceholder,j=void 0===u?"":u,m=e.onChange,h=e.withBorder,p=void 0!==h&&h,O=e.classes,g=Object(c.useState)([""]),f=Object(b.a)(g,2),v=f[0],y=f[1],S=Object(c.useState)([""]),C=Object(b.a)(S,2),k=C[0],N=C[1],w=Object(c.createRef)();Object(c.useEffect)((function(){if(1===v.length&&""===v[0]&&1===k.length&&""===k[0]&&t&&""!==t){var e=t.split("&"),a=[],n=[];e.forEach((function(e){var t=e.split("=");2===t.length&&(a.push(t[0]),n.push(t[1]))})),a.push(""),n.push(""),y(a),N(n)}}),[v,k,t]),Object(c.useEffect)((function(){var e=w.current;e&&v.length>1&&e.scrollIntoView(!1)}),[v]);var T=Object(c.useRef)(!0);Object(c.useLayoutEffect)((function(){T.current?T.current=!1:_()}),[v,k]);var E=function(e){e.persist();var t=Object(Xe.a)(v);t[Z()(e.target,"dataset.index",0)]=e.target.value,y(t)},A=function(e){e.persist();var t=Object(Xe.a)(k);t[Z()(e.target,"dataset.index",0)]=e.target.value,N(t)},_=Ln()((function(){var e="";v.forEach((function(t,a){if(v[a]&&k[a]){var n="".concat(t,"=").concat(k[a]);0!==a&&(n="&".concat(n)),e="".concat(e).concat(n)}})),m(e)}),500),I=k.map((function(e,t){return Object(n.jsxs)(x.a,{item:!0,xs:12,className:O.lineInputBoxes,children:[Object(n.jsx)(Ca,{id:"".concat(a,"-key-").concat(t.toString()),label:"",name:"".concat(a,"-").concat(t.toString()),value:v[t],onChange:E,index:t,placeholder:d}),Object(n.jsx)("span",{className:O.queryDiv,children:":"}),Object(n.jsx)(Ca,{id:"".concat(a,"-value-").concat(t.toString()),label:"",name:"".concat(a,"-").concat(t.toString()),value:k[t],onChange:A,index:t,placeholder:j,overlayIcon:t===k.length-1?Object(n.jsx)(Pn,{}):null,overlayAction:function(){!function(){if(""!==v[v.length-1].trim()&&""!==k[k.length-1].trim()){var e=Object(Xe.a)(v),t=Object(Xe.a)(k);e.push(""),t.push(""),y(e),N(t)}}()}})]},"query-pair-".concat(a,"-").concat(t.toString()))}));return Object(n.jsx)(i.a.Fragment,{children:Object(n.jsxs)(x.a,{item:!0,xs:12,className:O.fieldContainer,children:[Object(n.jsxs)(sa.a,{className:O.inputLabel,children:[Object(n.jsx)("span",{children:r}),""!==s&&Object(n.jsx)("div",{className:O.tooltipContainer,children:Object(n.jsx)(la.a,{title:s,placement:"top-start",children:Object(n.jsx)(Rn.a,{className:O.tooltip})})})]}),Object(n.jsxs)(x.a,{item:!0,xs:12,className:"".concat(p?O.inputWithBorder:""),children:[I,Object(n.jsx)("div",{ref:w})]})]})})})),Kn=Object(s.b)(null,{setModalErrorSnackMessage:q}),Un=Object(w.a)((function(e){return Object(k.a)(Object(j.a)({minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:"bold"}}},buttonContainer:{textAlign:"right"},multiContainer:{display:"flex",alignItems:"center",justifyContent:"flex-start"}},Te))}))(Kn((function(e){var t=e.open,a=e.closeModalAndRefresh,i=e.classes,r=e.bucketName,o=e.setModalErrorSnackMessage,s=Object(c.useState)(!1),l=Object(b.a)(s,2),d=l[0],u=l[1],j=Object(c.useState)(""),m=Object(b.a)(j,2),h=m[0],p=m[1],O=Object(c.useState)(""),f=Object(b.a)(O,2),v=f[0],S=f[1],C=Object(c.useState)(""),k=Object(b.a)(C,2),N=k[0],w=k[1],T=Object(c.useState)(""),E=Object(b.a)(T,2),A=E[0],_=E[1],I=Object(c.useState)(""),M=Object(b.a)(I,2),F=M[0],D=M[1],L=Object(c.useState)(""),B=Object(b.a)(L,2),R=B[0],P=B[1],z=Object(c.useState)(""),K=Object(b.a)(z,2),U=K[0],W=K[1],V=Object(c.useState)(!0),G=Object(b.a)(V,2),q=G[0],H=G[1],Y=Object(c.useState)(!0),Q=Object(b.a)(Y,2),J=Q[0],$=Q[1],X=Object(c.useState)(!0),ee=Object(b.a)(X,2),te=ee[0],ae=ee[1],ne=Object(c.useState)(!0),ce=Object(b.a)(ne,2),ie=ce[0],re=(ce[1],Object(c.useState)("")),oe=Object(b.a)(re,2),de=oe[0],ue=oe[1],be=Object(c.useState)("async"),je=Object(b.a)(be,2),me=je[0],he=je[1],pe=Object(c.useState)("100"),ge=Object(b.a)(pe,2),fe=ge[0],xe=ge[1],ve=Object(c.useState)("Gi"),ye=Object(b.a)(ve,2),Se=ye[0],Ce=ye[1],ke=Object(c.useState)("60"),Ne=Object(b.a)(ke,2),we=Ne[0],Te=Ne[1];return Object(n.jsx)(va,{modalOpen:t,onClose:function(){a()},title:"Set Bucket Replication",children:Object(n.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){e.preventDefault(),u(!0),function(){var e=[{originBucket:r,destinationBucket:R}],t=parseInt(we),n="".concat(q?"https://":"http://").concat(N),c={accessKey:h,secretKey:v,targetURL:n,region:U,bucketsRelation:e,syncMode:me,bandwidth:"async"===me?parseInt(le(fe,Se,!0)):0,healthCheckPeriod:t,prefix:F,tags:de,replicateDeleteMarkers:J,replicateDeletes:te,replicateMetadata:ie};Oe.invoke("POST","/api/v1/buckets-replication",c).then((function(e){u(!1);var t=Z()(e,"replicationState",[]);if(t.length>0){var n=t[0];return u(!1),n.errorString&&""!==n.errorString?void o(n.errorString):void a()}o("No changes applied")})).catch((function(e){u(!1),o(e)}))}()},children:Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:i.formScrollable,children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"targetURL",name:"targetURL",onChange:function(e){w(e.target.value)},placeholder:"play.min.io",label:"Target URL",value:N})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(za,{checked:q,id:"useTLS",name:"useTLS",label:"Use TLS",onChange:function(e){H(e.target.checked)},value:"yes"})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"accessKey",name:"accessKey",onChange:function(e){p(e.target.value)},label:"Access Key",value:h})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"secretKey",name:"secretKey",onChange:function(e){S(e.target.value)},label:"Secret Key",value:v})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"targetBucket",name:"targetBucket",onChange:function(e){P(e.target.value)},label:"Target Bucket",value:R})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"region",name:"region",onChange:function(e){W(e.target.value)},label:"Region",value:U})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Aa,{id:"replication_mode",name:"replication_mode",onChange:function(e){he(e.target.value)},label:"Replication Mode",value:me,options:[{label:"Asynchronous",value:"async"},{label:"Synchronous",value:"sync"}]})}),"async"===me&&Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsxs)("div",{className:i.multiContainer,children:[Object(n.jsx)("div",{children:Object(n.jsx)(Ca,{type:"number",id:"bandwidth_scalar",name:"bandwidth_scalar",onChange:function(e){xe(e.target.value)},label:"Bandwidth",value:fe,min:"0"})}),Object(n.jsx)("div",{className:i.sizeFactorContainer,children:Object(n.jsx)(Aa,{label:"Unit",id:"bandwidth_unit",name:"bandwidth_unit",value:Se,onChange:function(e){Ce(e.target.value)},options:se()})})]})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"healthCheck",name:"healthCheck",onChange:function(e){Te(e.target.value)},label:"Health Check Duration",value:we})}),Object(n.jsx)("h3",{children:"Object Filters"}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"prefix",name:"prefix",onChange:function(e){D(e.target.value)},placeholder:"prefix",label:"Prefix",value:F})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(zn,{name:"tags",label:"Tags",elements:"",onChange:function(e){ue(e)},keyPlaceholder:"Tag Key",valuePlaceholder:"Tag Value",withBorder:!0})}),Object(n.jsx)("h3",{children:"Storage Configuration"}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"storageClass",name:"storageClass",onChange:function(e){_(e.target.value)},placeholder:"STANDARD_IA,REDUCED_REDUNDANCY etc",label:"Storage Class",value:A})}),Object(n.jsx)("h3",{children:"Replication Options"}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(za,{checked:J,id:"deleteMarker",name:"deleteMarker",label:"Delete Marker",onChange:function(e){console.log(e),console.log(e.target.checked),$(e.target.checked)},value:J,description:"Replicate soft deletes"})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(za,{checked:te,id:"repDelete",name:"repDelete",label:"Deletes",onChange:function(e){ae(e.target.checked)},value:te,description:"Replicate versioned deletes"})})]}),Object(n.jsx)(x.a,{item:!0,xs:12,className:i.buttonContainer,children:Object(n.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:d,children:"Save"})}),d&&Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(y.a,{})})]})})})}))),Wn={setErrorSnackMessage:V},Vn=Object(s.b)(null,Wn)((function(e){var t=e.closeDeleteModalAndRefresh,a=e.deleteOpen,i=e.selectedBucket,r=e.ruleToDelete,o=e.setErrorSnackMessage,s=Object(c.useState)(!1),l=Object(b.a)(s,2),d=l[0],u=l[1];return Object(n.jsxs)(pa.a,{open:a,onClose:function(){t(!1)},"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[Object(n.jsx)(Oa.a,{id:"alert-dialog-title",children:"Delete Replication Rule"}),Object(n.jsxs)(ga.a,{children:[d&&Object(n.jsx)(y.a,{}),Object(n.jsxs)(Ua.a,{id:"alert-dialog-description",children:["Are you sure you want to delete replication rule ",Object(n.jsx)("b",{children:r}),"? ",Object(n.jsx)("br",{}),"Remember, at lease one rule must be present once replication has been enabled"]})]}),Object(n.jsxs)(Wa.a,{children:[Object(n.jsx)(g.a,{onClick:function(){t(!1)},color:"primary",disabled:d,children:"Cancel"}),Object(n.jsx)(g.a,{onClick:function(){d||(u(!0),Oe.invoke("DELETE","/api/v1/buckets/".concat(i,"/replication/").concat(r)).then((function(){u(!1),t(!0)})).catch((function(e){u(!1),o(e)})))},color:"secondary",autoFocus:!0,children:"Delete"})]})]})})),Gn=a(70),qn=a.n(Gn),Hn=Object(s.b)((function(e){return{session:e.console.session}}),{setErrorSnackMessage:V}),Yn=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({},De),Fe),{},{actionsTray:Object(j.a)(Object(j.a)({},Fe.actionsTray),{},{padding:"15px 0 0"})}))}))(Hn((function(e){var t=e.classes,a=e.match,i=e.setErrorSnackMessage,r=Object(c.useState)(!1),o=Object(b.a)(r,2),s=o[0],l=o[1],d=Object(c.useState)(!0),u=Object(b.a)(d,2),j=u[0],m=u[1],h=Object(c.useState)([]),p=Object(b.a)(h,2),O=p[0],v=p[1],y=Object(c.useState)(!0),S=Object(b.a)(y,2),C=S[0],k=S[1],N=Object(c.useState)(!1),w=Object(b.a)(N,2),T=w[0],E=w[1],A=Object(c.useState)(!1),_=Object(b.a)(A,2),I=_[0],M=_[1],F=Object(c.useState)(!1),D=Object(b.a)(F,2),L=D[0],B=D[1],R=Object(c.useState)(""),P=Object(b.a)(R,2),z=P[0],K=P[1],U=a.params.bucketName;if(Object(c.useEffect)((function(){C&&Oe.invoke("POST","/api/v1/has-permission",{actions:[{id:"PutReplicationConfiguration",action:"s3:PutReplicationConfiguration",bucket_name:U},{id:"GetReplicationConfiguration",action:"s3:GetReplicationConfiguration",bucket_name:U}]}).then((function(e){if(k(!1),e.permissions){var t=e.permissions?e.permissions:[],a=t.find((function(e){return"PutReplicationConfiguration"===e.id}));a&&a.can?l(!0):l(!1);var n=t.find((function(e){return"GetReplicationConfiguration"===e.id}));n&&n.can?E(!0):E(!1),k(!1)}})).catch((function(e){k(!1),i(e)}))}),[U,C,i]),Object(c.useEffect)((function(){j&&Oe.invoke("GET","/api/v1/buckets/".concat(U,"/replication")).then((function(e){var t=e.rules?e.rules:[];v(t),m(!1)})).catch((function(e){i(e),m(!1)}))}),[j,i,U]),!T)return null;var W=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];B(e)},V=[{type:"delete",onClick:function(e){K(e.id),M(!0)},disableButtonFunction:function(){return O.length>1}}];return Object(n.jsxs)(c.Fragment,{children:[L&&Object(n.jsx)(Un,{closeModalAndRefresh:function(){W(!1),m(!0)},open:L,bucketName:U}),I&&Object(n.jsx)(Vn,{deleteOpen:I,selectedBucket:U,closeDeleteModalAndRefresh:function(e){M(!1),e&&m(!0)},ruleToDelete:z}),Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.actionsTray,children:[Object(n.jsx)(f.a,{placeholder:"Filter",className:t.searchField,id:"search-resource",label:"",onChange:function(e){},InputProps:{disableUnderline:!0,startAdornment:Object(n.jsx)(et.a,{position:"start",children:Object(n.jsx)(at.a,{})})}}),Object(n.jsx)(Bt.a,{color:"primary","aria-label":"Refresh Replication Rules",component:"span",onClick:function(){m(!0)},children:Object(n.jsx)(qn.a,{})}),s&&Object(n.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(n.jsx)(lt,{}),size:"medium",onClick:function(){W(!0)},children:"Add Replication Rule"})]}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("br",{})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(ha,{itemActions:V,columns:[{label:"Priority",elementKey:"priority"},{label:"Destination",elementKey:"destination",renderFunction:function(e){return Object(n.jsx)(c.Fragment,{children:e.bucket.replace("arn:aws:s3:::","")})}},{label:"Prefix",elementKey:"prefix"},{label:"Tags",elementKey:"tags",renderFunction:function(e){return Object(n.jsx)(c.Fragment,{children:e&&""!==e.tags?"Yes":"No"})}},{label:"Status",elementKey:"status"}],isLoading:j,records:O,entityName:"Replication Rules",idField:"id"})})]})]})}))),Qn={setModalErrorSnackMessage:q},Zn=Object(s.b)(null,Qn),Jn=Object(w.a)((function(e){return Object(k.a)(Object(j.a)({strongText:{fontWeight:700},keyName:{marginLeft:5},buttonContainer:{textAlign:"right"}},Te))}))(Zn((function(e){var t=e.classes,a=e.closeModalAndRefresh,r=e.selectedBucket,o=e.lifecycle,s=e.open,l=e.setModalErrorSnackMessage,d=Object(c.useState)(!1),u=Object(b.a)(d,2),j=u[0],m=u[1],h=Object(c.useState)(""),p=Object(b.a)(h,2),O=p[0],f=p[1],v=Object(c.useState)(!1),S=Object(b.a)(v,2),C=S[0],k=S[1];Object(c.useEffect)((function(){if("Enabled"===o.status&&k(!0),o.tags){var e=o.tags.reduce((function(e,t,a){return"".concat(e).concat(0!==a?"&":"").concat(t.key,"=").concat(t.value)}),"");f(e)}}),[o]);return Object(n.jsxs)(va,{onClose:function(){a(!1)},modalOpen:s,title:"Edit Lifecycle Configuration",children:[Object(n.jsx)("div",{className:t.floatingEnabled,children:Object(n.jsx)(za,{indicatorLabels:["Enabled","Disabled"],checked:C,value:"user_enabled",id:"user-status",name:"user-status",onChange:function(e){k(e.target.checked)},switchOnly:!0})}),Object(n.jsx)(i.a.Fragment,{children:Object(n.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){e.preventDefault(),j||(m(!0),null!==r&&null!==o&&Oe.invoke("PUT","/api/v1/buckets/".concat(r,"/lifecycle/").concat(o.id),{disable:!C,tags:O}).then((function(e){m(!1),a(!0)})).catch((function(e){m(!1),l(e)})))},children:Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.formScrollable,children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"id",name:"id",label:"Id",value:o.id,onChange:function(){},disabled:!0})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(zn,{name:"tags",label:"Tags",elements:O,onChange:function(e){f(e)},keyPlaceholder:"Tag Key",valuePlaceholder:"Tag Value",withBorder:!0})})]}),Object(n.jsx)(x.a,{item:!0,xs:12,className:t.buttonContainer,children:Object(n.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:j,children:"Save"})}),j&&Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(y.a,{})})]})})})]})}))),$n=[{value:"01",label:"January"},{value:"02",label:"February"},{value:"03",label:"March"},{value:"04",label:"April"},{value:"05",label:"May"},{value:"06",label:"June"},{value:"07",label:"July"},{value:"08",label:"August"},{value:"09",label:"September"},{value:"10",label:"October"},{value:"11",label:"November"},{value:"12",label:"December"}],Xn=Array.from(Array(31),(function(e,t){return t+1})),ec=(new Date).getFullYear(),tc=Array.from(Array(25),(function(e,t){return t+ec})),ac=Object(w.a)((function(e){return Object(k.a)({root:{"& .MuiSelect-icon":{color:"#000","&.Mui-disabled":{color:"#9c9c9c"}}},input:{borderBottom:0,fontSize:12}})}))(ka.a),nc=Object(c.forwardRef)((function(e,t){var a=e.classes,i=e.id,r=e.label,o=e.disableOptions,s=void 0!==o&&o,l=e.addSwitch,d=void 0!==l&&l,u=e.tooltip,j=void 0===u?"":u,m=e.borderBottom,h=void 0!==m&&m,p=e.onDateChange,O=e.value,g=void 0===O?"":O;Object(c.useImperativeHandle)(t,(function(){return{resetDate:L}}));var f=Object(c.useState)(!1),v=Object(b.a)(f,2),y=v[0],S=v[1],C=Object(c.useState)(""),k=Object(b.a)(C,2),N=k[0],w=k[1],T=Object(c.useState)(""),E=Object(b.a)(T,2),A=E[0],_=E[1],I=Object(c.useState)(""),M=Object(b.a)(I,2),F=M[0],D=M[1];Object(c.useEffect)((function(){if(""!==g){var e=g.split("-");D(e[0]),w(e[1]),_("".concat(parseInt(e[2])))}}),[g]),Object(c.useEffect)((function(){var e=function(e,t,a){var n=Date.parse("".concat(e,"-").concat(t,"-").concat(a));if(isNaN(n))return[!1,""];var c=parseInt(t),i=parseInt(a),r=c<10?"0".concat(c):c,o=i<10?"0".concat(i):i,s=new Date(n).toISOString().split("T")[0],l="".concat(e,"-").concat(r,"-").concat(o);return[s===l,l]}(F,N,A),t=Object(b.a)(e,2),a=t[0],n=t[1];p(n,a)}),[N,A,F,p]);var L=function(){w(""),_(""),D("")},B=function(){return s||!!d&&!y};return Object(n.jsxs)(x.a,{item:!0,xs:12,className:Object(ye.a)(a.fieldContainer,Object(ve.a)({},a.fieldContainerBorder,h)),children:[Object(n.jsx)("div",{className:a.labelContainer,children:Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsxs)(sa.a,{htmlFor:i,className:a.inputLabel,children:[Object(n.jsx)("span",{children:r}),""!==j&&Object(n.jsx)("div",{className:a.tooltipContainer,children:Object(n.jsx)(la.a,{title:j,placement:"top-start",children:Object(n.jsx)("div",{children:Object(n.jsx)(da,{className:a.tooltip})})})})]}),d&&Object(n.jsx)(za,{indicatorLabels:["Specific Date","Default (7 Days)"],checked:y,value:"date_enabled",id:"date-status",name:"date-status",onChange:function(e){S(e.target.checked),e.target.checked||p("",!0)},switchOnly:!0})]})}),Object(n.jsxs)("div",{children:[Object(n.jsx)(Na.a,{disabled:B(),className:a.dateInput,children:Object(n.jsxs)(wa.a,{id:"".concat(i,"-month"),name:"".concat(i,"-month"),value:N,displayEmpty:!0,onChange:function(e){w(e.target.value)},input:Object(n.jsx)(ac,{}),children:[Object(n.jsx)(Ta.a,{value:"",disabled:!0,children:"<Month>"}),$n.map((function(e){return Object(n.jsx)(Ta.a,{value:e.value,children:e.label},"select-".concat(i,"-monthOP-").concat(e.label))}))]})}),Object(n.jsx)(Na.a,{disabled:B(),className:a.dateInput,children:Object(n.jsxs)(wa.a,{id:"".concat(i,"-day"),name:"".concat(i,"-day"),value:A,displayEmpty:!0,onChange:function(e){_(e.target.value)},input:Object(n.jsx)(ac,{}),children:[Object(n.jsx)(Ta.a,{value:"",disabled:!0,children:"<Day>"}),Xn.map((function(e){return Object(n.jsx)(Ta.a,{value:e,children:e},"select-".concat(i,"-dayOP-").concat(e))}))]})}),Object(n.jsx)(Na.a,{disabled:B(),className:a.dateInput,children:Object(n.jsxs)(wa.a,{id:"".concat(i,"-year"),name:"".concat(i,"-year"),value:F,displayEmpty:!0,onChange:function(e){D(e.target.value)},input:Object(n.jsx)(ac,{}),children:[Object(n.jsx)(Ta.a,{value:"",disabled:!0,children:"<Year>"}),tc.map((function(e){return Object(n.jsx)(Ta.a,{value:e,children:e},"select-".concat(i,"-yearOP-").concat(e))}))]})})]})]})})),cc=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({dateInput:{"&:not(:last-child)":{marginRight:22}}},we),Ee),{},{labelContainer:{flex:1},fieldContainer:Object(j.a)(Object(j.a)({},we.fieldContainer),{},{display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:10,marginTop:11,marginBottom:6}),fieldContainerBorder:{borderBottom:"#9c9c9c 1px solid",marginBottom:20}}))}))(nc),ic=Object(s.b)(null,{setModalErrorSnackMessage:q}),rc=Object(w.a)((function(e){return Object(k.a)(Object(j.a)({minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:"bold"}}},buttonContainer:{textAlign:"right"}},Te))}))(ic((function(e){var t=e.open,a=e.closeModalAndRefresh,i=e.classes,r=e.bucketName,o=e.setModalErrorSnackMessage,s=Object(c.useState)(!0),l=Object(b.a)(s,2),d=l[0],u=l[1],m=Object(c.useState)([]),h=Object(b.a)(m,2),p=h[0],O=h[1],f=Object(c.useState)(!1),v=Object(b.a)(f,2),S=v[0],C=v[1],k=Object(c.useState)(""),N=Object(b.a)(k,2),w=N[0],T=N[1],E=Object(c.useState)(""),A=Object(b.a)(E,2),_=A[0],I=A[1],M=Object(c.useState)(""),F=Object(b.a)(M,2),D=F[0],L=F[1],B=Object(c.useState)(""),R=Object(b.a)(B,2),P=R[0],z=R[1],K=Object(c.useState)(!1),U=Object(b.a)(K,2),W=U[0],V=U[1],G=Object(c.useState)("0"),q=Object(b.a)(G,2),H=q[0],Y=q[1],Q=Object(c.useState)("0"),J=Object(b.a)(Q,2),$=J[0],X=J[1],ee=Object(c.useState)("expiry"),te=Object(b.a)(ee,2),ae=te[0],ne=te[1],ce=Object(c.useState)("date"),ie=Object(b.a)(ce,2),re=ie[0],oe=ie[1],se=Object(c.useState)("0"),le=Object(b.a)(se,2),de=le[0],ue=le[1],be=Object(c.useState)(""),je=Object(b.a)(be,2),me=je[0],he=je[1],pe=Object(c.useState)("0"),ge=Object(b.a)(pe,2),fe=ge[0],xe=ge[1],ve=Object(c.useState)(""),ye=Object(b.a)(ve,2),Se=ye[0],Ce=ye[1],ke=Object(c.useState)("date"),Ne=Object(b.a)(ke,2),we=Ne[0],Te=Ne[1],Ee=Object(c.useState)(!1),Ae=Object(b.a)(Ee,2),_e=Ae[0],Ie=Ae[1];Object(c.useEffect)((function(){d&&Oe.invoke("GET","/api/v1/admin/tiers").then((function(e){var t=Z()(e,"items",[]);if(null!==t&&t.length>=1){var a=t.map((function(e){var t=e.type,a=Z()(e,"".concat(t,".name"),"");return{label:a,value:a}}));O(a),a.length>0&&L(a[0].value)}u(!1)})).catch((function(e){u(!1)}))}),[d]),Object(c.useEffect)((function(){var e=!0;"expiry"===ae?("date"===re&&""===me&&(e=!1),"days"===re&&parseInt(de)<1&&(e=!1)):("date"===we&&""===Se&&(e=!1),"days"===we&&parseInt(fe)<1&&(e=!1),""===D&&(e=!1)),Ie(e)}),[ae,re,me,de,we,Se,fe,D]);return Object(n.jsxs)(va,{modalOpen:t,onClose:function(){a(!1)},title:"Add Lifecycle Rule",children:[d&&Object(n.jsx)(x.a,{container:!0,className:i.loadingBox,children:Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(y.a,{})})}),!d&&Object(n.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){e.preventDefault(),C(!0),function(){var e={};if("expiry"===ae){var t={};t="date"===re?{expiry_date:"".concat(me,"T23:59:59Z")}:{expiry_days:parseInt(de)},e=Object(j.a)(Object(j.a)({},t),{},{noncurrentversion_expiration_days:parseInt(H)})}else{var n={};n="date"===we?{transition_date:"".concat(Se,"T23:59:59Z")}:{transition_days:parseInt(fe)},e=Object(j.a)(Object(j.a)({},n),{},{noncurrentversion_transition_days:parseInt($),noncurrentversion_transition_storage_class:P,storage_class:D})}var c=Object(j.a)({prefix:w,tags:_,expired_object_delete_marker:W},e);Oe.invoke("POST","/api/v1/buckets/".concat(r,"/lifecycle"),c).then((function(){C(!1),a(!0)})).catch((function(e){C(!1),o(e)}))}()},children:Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:i.formScrollable,children:[Object(n.jsx)("h3",{children:"Lifecycle Configuration"}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(La,{currentSelection:ae,id:"quota_type",name:"quota_type",label:"ILM Rule",onChange:function(e){ne(e.target.value)},selectorOptions:[{value:"expiry",label:"Expiry"},{value:"transition",label:"Transition"}]})}),"expiry"===ae?Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(La,{currentSelection:re,id:"expiryType",name:"expiryType",label:"Expiry Type",onChange:function(e){oe(e.target.value)},selectorOptions:[{value:"date",label:"Date"},{value:"days",label:"Days"}]})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:"date"===re?Object(n.jsx)(cc,{id:"expiry_date",label:"Expiry Date",value:me,borderBottom:!0,onDateChange:function(e,t){t&&he(e)}}):Object(n.jsx)(Ca,{type:"number",id:"expiry_days",name:"expiry_days",onChange:function(e){ue(e.target.value)},label:"Expiry Days",value:de,min:"0"})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{type:"number",id:"noncurrentversion_expiration_days",name:"noncurrentversion_expiration_days",onChange:function(e){Y(e.target.value)},label:"Non-current Expiration Days",value:H,min:"0"})})]}):Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(La,{currentSelection:we,id:"transitionType",name:"transitionType",label:"Transition Type",onChange:function(e){Te(e.target.value)},selectorOptions:[{value:"date",label:"Date"},{value:"days",label:"Days"}]})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:"date"===we?Object(n.jsx)(cc,{id:"transition_date",label:"Transition Date",value:Se,borderBottom:!0,onDateChange:function(e,t){t&&Ce(e)}}):Object(n.jsx)(Ca,{type:"number",id:"transition_days",name:"transition_days",onChange:function(e){xe(e.target.value)},label:"Transition Days",value:fe,min:"0"})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{type:"number",id:"noncurrentversion_transition_days",name:"noncurrentversion_transition_days",onChange:function(e){X(e.target.value)},label:"Non-current Transition Days",value:$,min:"0"})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"noncurrentversion_t_SC",name:"noncurrentversion_t_SC",onChange:function(e){z(e.target.value)},placeholder:"Set Non-current Version Transition Storage Class",label:"Non-current Version Transition Storage Class",value:P})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Aa,{label:"Storage Class",id:"storage_class",name:"storage_class",value:D,onChange:function(e){L(e.target.value)},options:p})})]}),Object(n.jsx)("h3",{children:"File Configuration"}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"prefix",name:"prefix",onChange:function(e){T(e.target.value)},label:"Prefix",value:w})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(zn,{name:"tags",label:"Tags",elements:"",onChange:function(e){I(e)},keyPlaceholder:"Tag Key",valuePlaceholder:"Tag Value",withBorder:!0})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(za,{value:"expired_delete_marker",id:"expired_delete_marker",name:"expired_delete_marker",checked:W,onChange:function(e){V(e.target.checked)},label:"Expired Object Delete Marker",indicatorLabels:["On","Off"]})})]}),Object(n.jsx)(x.a,{item:!0,xs:12,className:i.buttonContainer,children:Object(n.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:S||!_e,children:"Save"})}),S&&Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(y.a,{})})]})})]})}))),oc=Object(s.b)((function(e){return{session:e.console.session}}),{setErrorSnackMessage:V}),sc=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({},De),Fe),{},{actionsTray:Object(j.a)(Object(j.a)({},Fe.actionsTray),{},{padding:"15px 0 0"})}))}))(oc((function(e){var t=e.classes,a=e.match,i=(e.setErrorSnackMessage,Object(c.useState)(!0)),r=Object(b.a)(i,2),o=r[0],s=r[1],l=Object(c.useState)([]),d=Object(b.a)(l,2),u=d[0],j=d[1],m=Object(c.useState)(!1),h=Object(b.a)(m,2),p=h[0],O=h[1],v=Object(c.useState)(!1),y=Object(b.a)(v,2),S=y[0],C=y[1],k=a.params.bucketName;Object(c.useEffect)((function(){o&&Oe.invoke("GET","/api/v1/buckets/".concat(k,"/lifecycle")).then((function(e){var t=Z()(e,"lifecycle",[]);j(t||[]),s(!1)})).catch((function(e){console.error(e),s(!1)}))}),[o,s,k]);var N=[{label:"ID",elementKey:"id"},{label:"Prefix",elementKey:"prefix"},{label:"Status",elementKey:"status"},{label:"Expiration",elementKey:"expiration",renderFunction:function(e){return e.days?"".concat(e.days," day").concat(e.days>1?"s":""):"0001-01-01T00:00:00Z"===e.date?"":Object(n.jsx)(rt.a,{children:e.date})}},{label:"Transition",elementKey:"transition",renderFunction:function(e){return e.days?"".concat(e.days," day").concat(e.days>1?"s":""):"0001-01-01T00:00:00Z"===e.date?"":Object(n.jsx)(rt.a,{children:e.date})}},{label:"Storage Class",elementKey:"storage_class",renderFunction:function(e){return Z()(e,"transition.storage_class","")},renderFullObject:!0}];return Object(n.jsxs)(c.Fragment,{children:[S&&Object(n.jsx)(Jn,{open:S,closeModalAndRefresh:function(e){C(!1),e&&s(!0)},selectedBucket:k,lifecycle:{id:""}}),p&&Object(n.jsx)(rc,{open:p,bucketName:k,closeModalAndRefresh:function(e){O(!1),e&&s(!0)}}),Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.actionsTray,children:[Object(n.jsx)(f.a,{placeholder:"Filter",className:t.searchField,id:"search-resource",label:"",onChange:function(e){},InputProps:{disableUnderline:!0,startAdornment:Object(n.jsx)(et.a,{position:"start",children:Object(n.jsx)(at.a,{})})}}),Object(n.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(n.jsx)(lt,{}),size:"medium",onClick:function(){O(!0)},children:"Add Lifecycle Rule"})]}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("br",{})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(ha,{itemActions:[],columns:N,isLoading:o,records:u,entityName:"Lifecycle",customEmptyMessage:"There are no Lifecycle rules yet",idField:"id"})})]})]})})));function lc(e){return{id:"simple-tab-".concat(e),"aria-controls":"simple-tabpanel-".concat(e)}}var dc=Object(s.b)((function(e){return{session:e.console.session,selectedTab:e.buckets.bucketDetails.selectedTab}}),{setErrorSnackMessage:V,setBucketDetailsTab:function(e){return{type:Ft,tab:e}}}),uc=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)(Object(j.a)(Object(j.a)({seeMore:{marginTop:e.spacing(3)},paper:{display:"flex",overflow:"auto",flexDirection:"column"},addSideBar:{width:"320px",padding:"20px"},tableToolbar:{paddingLeft:e.spacing(2),paddingRight:e.spacing(0)},minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:"bold"}}},noRecords:{lineHeight:"24px",textAlign:"center",padding:"20px"},gridWrapper:{width:320},gridContainer:{display:"grid",gridTemplateColumns:"auto auto",gridGap:8,justifyContent:"flex-start",alignItems:"center","& div:not(.MuiCircularProgress-root)":{display:"flex",alignItems:"center"},"& div:nth-child(odd)":{justifyContent:"flex-end",fontWeight:700},"& div:nth-child(2n)":{minWidth:150}},masterActions:{width:"25%",minWidth:"120px","& div":{margin:"5px 0px"}},headerContainer:{display:"flex",justifyContent:"space-between"},capitalizeFirst:{textTransform:"capitalize"},doubleElement:{display:"flex",justifyContent:"space-between"},encCheckbox:{margin:0,padding:0},tabPan:{marginTop:"5px"},fixedHeight:{height:165,minWidth:247,padding:"25px 28px","& svg":{maxHeight:18}},routerContainer:{marginTop:5},titleCol:{fontWeight:"bold"}},De),Fe),{},{actionsTray:Object(j.a)(Object(j.a)({},Fe.actionsTray),{},{padding:"15px 0 0"})},He),qe),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))(dc((function(e){var t=e.classes,a=e.match,i=e.history,r=(e.session,e.selectedTab),o=e.setErrorSnackMessage,s=e.setBucketDetailsTab,d=Object(c.useState)(!0),u=Object(b.a)(d,2),m=u[0],h=u[1],p=Object(c.useState)(!1),O=Object(b.a)(p,2),g=O[0],f=O[1],v=a.params.bucketName;Object(c.useEffect)((function(){var e=a.params?a.params[0]:"summary";e||(e="");var t=e.split("/");r!==t[0]&&s(t[0])}),[a,v,s,r]),Object(c.useEffect)((function(){m&&Oe.invoke("POST","/api/v1/has-permission",{actions:[{id:"GetReplicationConfiguration",action:"s3:GetReplicationConfiguration",bucket_name:v}]}).then((function(e){if(h(!1),e.permissions){var t=(e.permissions?e.permissions:[]).find((function(e){return"GetReplicationConfiguration"===e.id}));t&&t.can?f(!0):f(!1),h(!1)}})).catch((function(e){h(!1),o(e)}))}),[v,m,o]);return Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(qa,{label:"Bucket > ".concat(a.params.bucketName)}),Object(n.jsxs)(x.a,{container:!0,className:t.container,children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsxs)(nn.a,{value:""!==r?r:"summary",onChange:function(e,t){!function(e){var t="/buckets/".concat(v);switch(e){case"events":t+="/events";break;case"replication":t+="/replication";break;case"lifecycle":t+="/lifecycle";break;case"access":t+="/access";break;default:t+="/summary"}s(e),i.push(t)}(t)},indicatorColor:"primary",textColor:"primary","aria-label":"cluster-tabs",variant:"scrollable",scrollButtons:"auto",children:[Object(n.jsx)(cn.a,Object(j.a)({value:"summary",label:"Summary"},lc(0))),Object(n.jsx)(cn.a,Object(j.a)({value:"events",label:"Events"},lc(1))),Object(n.jsx)(cn.a,Object(j.a)(Object(j.a)({value:"replication",label:"Replication"},lc(2)),{},{disabled:!g})),Object(n.jsx)(cn.a,Object(j.a)({value:"lifecycle",label:"Lifecycle"},lc(3))),Object(n.jsx)(cn.a,Object(j.a)({value:"access",label:"Access"},lc(4)))]})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(x.a,{item:!0,xs:12,className:t.routerContainer,children:Object(n.jsx)(l.c,{history:i,children:Object(n.jsxs)(l.d,{children:[Object(n.jsx)(l.b,{path:"/buckets/:bucketName/summary",component:Cn}),Object(n.jsx)(l.b,{path:"/buckets/:bucketName/events",component:Fn}),Object(n.jsx)(l.b,{path:"/buckets/:bucketName/replication",component:Yn}),Object(n.jsx)(l.b,{path:"/buckets/:bucketName/lifecycle",component:sc}),Object(n.jsx)(l.b,{path:"/buckets/:bucketName/access",component:dn}),Object(n.jsx)(l.b,{path:"/buckets/:bucketName/access",component:dn}),Object(n.jsx)(l.b,{path:"/buckets/:bucketName",component:function(){return Object(n.jsx)(l.a,{to:"/buckets/".concat(v,"/summary")})}})]})})})})]})]})}))),bc=Object(s.b)((function(e){return{open:e.system.sidebarOpen}}),{setMenuOpen:z}),jc=Object(l.g)(bc((function(){return Object(n.jsx)(l.c,{history:u,children:Object(n.jsxs)(l.d,{children:[Object(n.jsx)(l.b,{path:"/buckets/:bucketName/*",component:uc}),Object(n.jsx)(l.b,{path:"/buckets/:bucketName",component:uc}),Object(n.jsx)(l.b,{path:"/",component:an}),Object(n.jsx)(l.b,{component:$e})]})})}))),mc=a(404);a(555);a(556);var hc,pc=Object(w.a)((function(e){return Object(k.a)(Object(j.a)({},we))}))((function(e){var t=e.value,a=e.label,c=void 0===a?"":a,r=e.tooltip,o=void 0===r?"":r,s=e.mode,l=void 0===s?"javascript":s,d=e.classes,u=e.onChange,b=void 0===u?function(){}:u,j=e.onBeforeChange,m=e.readOnly,h=void 0!==m&&m;return Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsxs)(sa.a,{className:d.inputLabel,children:[Object(n.jsx)("span",{children:c}),""!==o&&Object(n.jsx)("div",{className:d.tooltipContainer,children:Object(n.jsx)(la.a,{title:o,placement:"top-start",children:Object(n.jsx)("div",{children:Object(n.jsx)(da,{className:d.tooltip})})})})]}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("br",{})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(mc.Controlled,{value:t,options:{mode:l,lineNumbers:!0,readOnly:h},onBeforeChange:j,onChange:b})})]})})),Oc={setModalErrorSnackMessage:q},gc=Object(s.b)(null,Oc),fc=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({jsonPolicyEditor:{minHeight:400,width:"100%"},buttonContainer:{textAlign:"right"}},Te),we))}))(gc((function(e){var t=e.classes,a=e.open,i=e.closeModalAndRefresh,r=e.policyEdit,o=e.setModalErrorSnackMessage,s=Object(c.useState)(!1),l=Object(b.a)(s,2),d=l[0],u=l[1],j=Object(c.useState)(""),m=Object(b.a)(j,2),h=m[0],p=m[1],O=Object(c.useState)(""),f=Object(b.a)(O,2),v=f[0],S=f[1];Object(c.useEffect)((function(){r&&(p(r.name),S(r?JSON.stringify(JSON.parse(r.policy),null,4):""))}),[r]);var C=""!==h.trim();return Object(n.jsx)(va,{modalOpen:a,onClose:function(){i(!1)},title:"".concat(r?"Info":"Create"," Policy"),children:Object(n.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){e.preventDefault(),d||(u(!0),Oe.invoke("POST","/api/v1/policies",{name:h,policy:v}).then((function(e){u(!1),i(!0)})).catch((function(e){u(!1),o(e)})))},children:Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.formScrollable,children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"policy-name",name:"policy-name",label:"Policy Name",placeholder:"Enter Policy Name",onChange:function(e){p(e.target.value)},value:h,disabled:!!r})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("br",{})}),Object(n.jsx)(pc,{label:"".concat(r?"Edit":"Write"," Policy"),value:v,onBeforeChange:function(e,t,a){S(a)}})]}),Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.buttonContainer,children:[!r&&Object(n.jsx)("button",{type:"button",color:"primary",className:t.clearButton,onClick:function(){p(""),S("")},children:"Clear"}),Object(n.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:d||!C,children:"Save"})]}),d&&Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(y.a,{})})]})})})}))),xc={setErrorSnackMessage:V},vc=Object(s.b)(null,xc)((function(e){var t=e.closeDeleteModalAndRefresh,a=e.deleteOpen,i=e.selectedPolicy,r=e.setErrorSnackMessage,o=Object(c.useState)(!1),s=Object(b.a)(o,2),l=s[0],d=s[1];return Object(n.jsxs)(pa.a,{open:a,onClose:function(){t(!1)},"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[Object(n.jsx)(Oa.a,{id:"alert-dialog-title",children:"Delete Policy"}),Object(n.jsxs)(ga.a,{children:[l&&Object(n.jsx)(y.a,{}),Object(n.jsxs)(Ua.a,{id:"alert-dialog-description",children:["Are you sure you want to delete policy ",Object(n.jsx)("b",{children:i}),"?."]})]}),Object(n.jsxs)(Wa.a,{children:[Object(n.jsx)(g.a,{onClick:function(){t(!1)},color:"primary",disabled:l,children:"Cancel"}),Object(n.jsx)(g.a,{onClick:function(){l||(d(!0),Oe.invoke("DELETE","/api/v1/policy?name=".concat(i)).then((function(e){d(!1),t(!0)})).catch((function(e){d(!1),r(e)})))},color:"secondary",autoFocus:!0,children:"Delete"})]})]})})),yc={setErrorSnackMessage:V},Sc=Object(s.b)(null,yc),Cc=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({seeMore:{marginTop:e.spacing(3)},paper:{display:"flex",overflow:"auto",flexDirection:"column"},addSideBar:{width:"320px",padding:"20px"},tableToolbar:{paddingLeft:e.spacing(2),paddingRight:e.spacing(0)},minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:"bold"}}}},Fe),De),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))(Sc((function(e){var t=e.classes,a=e.setErrorSnackMessage,r=Object(c.useState)([]),o=Object(b.a)(r,2),s=o[0],l=o[1],d=Object(c.useState)(!1),j=Object(b.a)(d,2),m=j[0],h=j[1],p=Object(c.useState)(!1),O=Object(b.a)(p,2),v=O[0],y=O[1],S=Object(c.useState)(!1),C=Object(b.a)(S,2),k=C[0],N=C[1],w=Object(c.useState)(""),T=Object(b.a)(w,2),E=T[0],A=T[1],_=Object(c.useState)(""),I=Object(b.a)(_,2),M=I[0],F=I[1],D=Object(c.useState)(null),L=Object(b.a)(D,2),B=L[0],R=L[1];Object(c.useEffect)((function(){P()}),[]),Object(c.useEffect)((function(){m&&Oe.invoke("GET","/api/v1/policies").then((function(e){var t=Z()(e,"policies",[]);t.sort((function(e,t){return e.name>t.name?1:e.name<t.name?-1:0})),h(!1),l(t)})).catch((function(e){h(!1),a(e)}))}),[m,h,l,a]);var P=function(){h(!0)},z=[{type:"view",onClick:function(e){u.push("/policies/".concat(e.name))}},{type:"delete",onClick:function(e){N(!0),A(e)},sendOnlyId:!0}],K=s.filter((function(e){return e.name.includes(M)}));return Object(n.jsxs)(i.a.Fragment,{children:[v&&Object(n.jsx)(fc,{open:v,closeModalAndRefresh:function(e){y(!1),e&&P()},policyEdit:B}),k&&Object(n.jsx)(vc,{deleteOpen:k,selectedPolicy:E,closeDeleteModalAndRefresh:function(e){N(!1),e&&P()}}),Object(n.jsx)(qa,{label:"IAM Policies"}),Object(n.jsx)(x.a,{container:!0,children:Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.container,children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.actionsTray,children:[Object(n.jsx)(f.a,{placeholder:"Search Policies",className:t.searchField,id:"search-resource",label:"",onChange:function(e){F(e.target.value)},InputProps:{disableUnderline:!0,startAdornment:Object(n.jsx)(et.a,{position:"start",children:Object(n.jsx)(at.a,{})})}}),Object(n.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(n.jsx)(lt,{}),onClick:function(){y(!0),R(null)},children:"Create Policy"})]}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("br",{})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(ha,{itemActions:z,columns:[{label:"Name",elementKey:"name"}],isLoading:m,records:K,entityName:"Policies",idField:"name"})})]})})]})}))),kc=Object(s.b)(null,{setErrorSnackMessage:V}),Nc=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({buttonContainer:{textAlign:"right"},multiContainer:{display:"flex",alignItems:"center",justifyContent:"flex-start"},sizeFactorContainer:{marginLeft:8},containerHeader:{display:"flex",justifyContent:"space-between"},paperContainer:{padding:"15px 15px 15px 50px"},infoGrid:{display:"grid",gridTemplateColumns:"auto auto auto auto",gridGap:8,"& div":{display:"flex",alignItems:"center"},"& div:nth-child(odd)":{justifyContent:"flex-end",fontWeight:700},"& div:nth-child(2n)":{paddingRight:35}},masterActions:{width:"25%",minWidth:"120px","& div":{margin:"5px 0px"}},actionsTray:{textAlign:"right"},updateButton:{backgroundColor:"transparent",border:0,padding:"0 6px",cursor:"pointer","&:focus, &:active":{outline:"none"},"& svg":{height:12}},noUnderLine:{textDecoration:"none"},poolLabel:{color:"#666666"},licenseContainer:{position:"relative",padding:"20px 52px 0px 28px",background:"#032F51",boxShadow:"0px 3px 7px #00000014","& h2":{color:"#FFF",marginBottom:67},"& a":{textDecoration:"none"},"& h3":{color:"#FFFFFF",marginBottom:"30px",fontWeight:"bold"},"& h6":{color:"#FFFFFF !important"}},licenseInfo:{color:"#FFFFFF",position:"relative"},licenseInfoTitle:{textTransform:"none",color:"#BFBFBF",fontSize:11},licenseInfoValue:{textTransform:"none",fontSize:14,fontWeight:"bold"},verifiedIcon:{width:96,position:"absolute",right:0,bottom:29},breadcrumLink:{textDecoration:"none",color:"black"}},Te),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))(kc((function(e){var t=e.classes,a=e.match,r=e.closeModalAndRefresh,o=e.setErrorSnackMessage,s=Object(c.useState)(0),l=Object(b.a)(s,2),d=l[0],j=l[1],m=Object(c.useState)(null),h=Object(b.a)(m,2),p=h[0],O=h[1],f=Object(c.useState)([]),v=Object(b.a)(f,2),S=v[0],k=v[1],N=Object(c.useState)(!1),w=Object(b.a)(N,2),T=w[0],E=w[1],A=Object(c.useState)(a.params.policyName),_=Object(b.a)(A,2),I=_[0],M=_[1],F=Object(c.useState)(""),D=Object(b.a)(F,2),L=D[0],B=D[1],R=Object(c.useState)(!0),P=Object(b.a)(R,2),z=P[0],K=P[1];Object(c.useEffect)((function(){z&&(z&&Oe.invoke("GET","/api/v1/policy?name=".concat(I)).then((function(e){e&&(O(e),B(e?JSON.stringify(JSON.parse(e.policy),null,4):"")),K(!1)})).catch((function(e){console.log("Error in loading policy")})),Oe.invoke("GET","/api/v1/policies/".concat(I,"/users")).then((function(e){k(e)})).catch((function(e){console.log("Error in loading users")})))}),[I,z]);var U=""!==I.trim(),W=[{type:"view",onClick:function(e){u.push("/users/".concat(e))}}];return Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsx)(qa,{label:Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(Ht.a,{to:"/policies",className:t.breadcrumLink,children:"Policy"})," > ".concat(a.params.policyName)]})}),Object(n.jsx)(x.a,{container:!0,children:Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.container,children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsxs)(nn.a,{value:d,indicatorColor:"primary",textColor:"primary",onChange:function(e,t){j(t)},"aria-label":"policy-tabs",children:[Object(n.jsx)(cn.a,{label:"Details"}),Object(n.jsx)(cn.a,{label:"Users"})]})}),Object(n.jsxs)(x.a,{item:!0,xs:12,children:[0===d&&Object(n.jsx)(C.a,{className:t.paperContainer,children:Object(n.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){e.preventDefault(),T||(E(!0),Oe.invoke("POST","/api/v1/policies",{name:I,policy:L}).then((function(e){E(!1),r(!0)})).catch((function(e){E(!1),o(e)})))},children:Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsx)(x.a,{item:!0,xs:12,className:t.formScrollable,children:Object(n.jsx)(pc,{label:"".concat(p?"Edit":"Write"," Policy"),value:L,onBeforeChange:function(e,t,a){B(a)}})}),Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.buttonContainer,children:[!p&&Object(n.jsx)("button",{type:"button",color:"primary",className:t.clearButton,onClick:function(){M(""),B("")},children:"Clear"}),Object(n.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:T||!U,children:"Save"})]}),T&&Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(y.a,{})})]})})}),1===d&&Object(n.jsx)(ha,{itemActions:W,columns:[{label:"Name",elementKey:"name"}],isLoading:!1,records:S,entityName:"Users",idField:"name"})]})]})})]})}))),wc=Object(s.b)((function(e){return{open:e.system.sidebarOpen}}),{setMenuOpen:z}),Tc=Object(l.g)(wc((function(){return Object(n.jsx)(l.c,{history:u,children:Object(n.jsxs)(l.d,{children:[Object(n.jsx)(l.b,{path:"/policies/:policyName",component:Nc}),Object(n.jsx)(l.b,{path:"/",component:Cc}),Object(n.jsx)(l.b,{component:$e})]})})}))),Ec=a(405),Ac=a.n(Ec);!function(e){e.singleValue="singleValue",e.linearGraph="linearGraph",e.barChart="barChart",e.pieChart="pieChart",e.singleRep="singleRep"}(hc||(hc={}));var _c="dashboardConfig",Ic=[{w:1,h:2,x:0,y:0,i:"panel-0",minW:1,moved:!1,static:!1},{w:1,h:1,x:1,y:2,i:"panel-1",minW:1,moved:!1,static:!1},{w:1,h:1,x:1,y:3,i:"panel-2",minW:1,moved:!1,static:!1},{w:1,h:2,x:2,y:0,i:"panel-3",minW:1,moved:!1,static:!1},{w:2,h:2,x:3,y:0,i:"panel-4",minW:2,moved:!1,static:!1},{w:2,h:2,x:5,y:0,i:"panel-5",minW:2,moved:!1,static:!1},{w:1,h:1,x:0,y:2,i:"panel-6",minW:1,moved:!1,static:!1},{w:1,h:1,x:0,y:3,i:"panel-7",minW:1,moved:!1,static:!1},{w:1,h:1,x:2,y:2,i:"panel-8",minW:1,moved:!1,static:!1},{w:1,h:1,x:2,y:3,i:"panel-9",minW:1,moved:!1,static:!1},{w:2,h:2,x:3,y:2,i:"panel-10",minW:2,moved:!1,static:!1},{w:1,h:1,x:7,y:0,i:"panel-11",minW:1,moved:!1,static:!1},{w:1,h:1,x:7,y:1,i:"panel-12",minW:1,moved:!1,static:!1},{w:4,h:3,x:0,y:10,i:"panel-13",minW:2,moved:!1,static:!1},{w:4,h:3,x:0,y:4,i:"panel-14",minW:2,moved:!1,static:!1},{w:2,h:2,x:5,y:2,i:"panel-15",minW:2,moved:!1,static:!1},{w:8,h:3,x:0,y:7,i:"panel-16",minW:2,moved:!1,static:!1},{w:8,h:3,x:0,y:19,i:"panel-19",minW:2,moved:!1,static:!1},{w:1,h:1,x:7,y:2,i:"panel-20",minW:1,moved:!1,static:!1},{w:1,h:1,x:7,y:3,i:"panel-21",minW:1,moved:!1,static:!1},{w:4,h:3,x:4,y:4,i:"panel-22",minW:2,moved:!1,static:!1},{w:4,h:3,x:4,y:10,i:"panel-23",minW:2,moved:!1,static:!1},{w:4,h:3,x:0,y:13,i:"panel-24",minW:2,moved:!1,static:!1},{w:4,h:3,x:4,y:13,i:"panel-25",minW:2,moved:!1,static:!1},{w:4,h:3,x:0,y:16,i:"panel-26",minW:2,moved:!1,static:!1},{w:4,h:3,x:4,y:16,i:"panel-27",minW:2,moved:!1,static:!1},{w:1,h:1,x:1,y:0,i:"panel-28",minW:1,moved:!1,static:!1},{w:1,h:1,x:1,y:1,i:"panel-29",minW:1,moved:!1,static:!1}],Mc=["#6992B7","#E2AD17","#22B573","#F7655E","#0071BC","#F9E6C5","#A6E8C4","#F4CECE","#ADD5E0"],Fc=function(e){return je(e,"ns")},Dc=function(e){return parseInt(e).toString(10)},Lc=[{id:1,title:"Uptime",data:"N/A",type:hc.singleValue,layoutIdentifier:"panel-0",labelDisplayFunction:je},{id:9,title:"Total Online Disks",data:"N/A",type:hc.singleValue,layoutIdentifier:"panel-1"},{id:78,title:"Total Offline Disks",data:"N/A",type:hc.singleValue,layoutIdentifier:"panel-2"},{id:50,title:"Current Usable Capacity",data:[],dataOuter:[{name:"outer",value:100}],widgetConfiguration:{outerChart:{colorList:["#9c9c9c"],innerRadius:51,outerRadius:54,startAngle:-15,endAngle:195},innerChart:{colorList:Mc,innerRadius:35,outerRadius:50,startAngle:-15,endAngle:195}},type:hc.pieChart,layoutIdentifier:"panel-3",innerLabel:"N/A",labelDisplayFunction:ce},{id:68,title:"Data Usage Growth",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:hc.linearGraph,layoutIdentifier:"panel-4",yAxisFormatter:ce,xAxisFormatter:me},{id:52,title:"Object size distribution",data:[],widgetConfiguration:[{dataKey:"a",color:Mc[0],background:{fill:"rgba(0,0,0,0.1)"}}],customStructure:[{originTag:"LESS_THAN_1024_B",displayTag:"Less than 1024B"},{originTag:"BETWEEN_1024_B_AND_1_MB",displayTag:"Between 1024B and 1MB"},{originTag:"BETWEEN_1_MB_AND_10_MB",displayTag:"Between 1MB and 10MB"},{originTag:"BETWEEN_10_MB_AND_64_MB",displayTag:"Between 10MB and 64MB"},{originTag:"BETWEEN_64_MB_AND_128_MB",displayTag:"Between 64MB and 128MB"},{originTag:"BETWEEN_128_MB_AND_512_MB",displayTag:"Between 128MB and 512MB"},{originTag:"GREATER_THAN_512_MB",displayTag:"Greater than 512MB"}],type:hc.barChart,layoutIdentifier:"panel-5"},{id:53,title:"Total Online Servers",data:"N/A",type:hc.singleValue,layoutIdentifier:"panel-6"},{id:69,title:"Total Offline Servers",data:"N/A",type:hc.singleValue,layoutIdentifier:"panel-7"},{id:66,title:"Number of Buckets",data:[],innerLabel:"N/A",type:hc.singleRep,color:"#0071BC",fillColor:"#ADD5E0",layoutIdentifier:"panel-8"},{id:44,title:"Number of Objects",data:[],innerLabel:"N/A",type:hc.singleRep,color:"#0071BC",fillColor:"#ADD5E0",layoutIdentifier:"panel-9"},{id:63,title:"S3 API Data Received Rate",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:hc.linearGraph,layoutIdentifier:"panel-10",xAxisFormatter:me,yAxisFormatter:ce},{id:61,title:"Total Open FDs",data:[],innerLabel:"N/A",type:hc.singleRep,layoutIdentifier:"panel-11",color:"#22B573",fillColor:"#A6E8C4"},{id:62,title:"Total Goroutines",data:[],innerLabel:"N/A",type:hc.singleRep,layoutIdentifier:"panel-12",color:"#F7655E",fillColor:"#F4CECE"},{id:77,title:"Node CPU Usage",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:hc.linearGraph,layoutIdentifier:"panel-13",yAxisFormatter:Dc,xAxisFormatter:me},{id:60,title:"S3 API Request Rate",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:hc.linearGraph,layoutIdentifier:"panel-14",xAxisFormatter:me},{id:70,title:"S3 API Data Sent Rate",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:hc.linearGraph,layoutIdentifier:"panel-15",xAxisFormatter:me,yAxisFormatter:ce},{id:17,title:"Internode Data Transfer",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:hc.linearGraph,layoutIdentifier:"panel-16",yAxisFormatter:ce,xAxisFormatter:me},{id:73,title:"Node IO",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:hc.linearGraph,layoutIdentifier:"panel-19",yAxisFormatter:ce,xAxisFormatter:me},{id:80,title:"Time Since Last Heal Activity",data:"N/A",type:hc.singleValue,layoutIdentifier:"panel-20",labelDisplayFunction:Fc},{id:81,title:"Time Since Last Scan Activity",data:"N/A",type:hc.singleValue,layoutIdentifier:"panel-21",labelDisplayFunction:Fc},{id:71,title:"S3 API Request Error Rate",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:hc.linearGraph,layoutIdentifier:"panel-22",xAxisFormatter:me},{id:76,title:"Node Memory Usage",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:hc.linearGraph,layoutIdentifier:"panel-23",xAxisFormatter:me,yAxisFormatter:ce},{id:74,title:"Drive Used Capacity",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:hc.linearGraph,layoutIdentifier:"panel-24",xAxisFormatter:me,yAxisFormatter:ce},{id:82,title:"Drives Free Inodes",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:hc.linearGraph,layoutIdentifier:"panel-25",disableYAxis:!0,xAxisFormatter:me},{id:11,title:"Node Syscalls",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:hc.linearGraph,layoutIdentifier:"panel-26",yAxisFormatter:Dc,xAxisFormatter:me},{id:8,title:"Node File Descriptors",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:hc.linearGraph,layoutIdentifier:"panel-27",yAxisFormatter:Dc,xAxisFormatter:me},{id:65,title:"Total S3 Traffic Inbound",data:"N/A",type:hc.singleValue,layoutIdentifier:"panel-28",labelDisplayFunction:ce},{id:64,title:"Total S3 Traffic Outbound",data:"N/A",type:hc.singleValue,layoutIdentifier:"panel-29",labelDisplayFunction:ce}],Bc=function(e,t){if(0===e.length)return["","0"];switch(t){case"mean":var a=e.reduce((function(e,t){return e+parseFloat(t[1])}),0);return["",Math.floor(a/e.length).toString()];default:var n=e.sort((function(e,t){return e[0]-t[0]}));return n[n.length-1]}},Rc=function(e,t){if(!e)return t;var a=e.type;switch(t.type){case hc.singleValue:if("stat"===a||"singlestat"===a){var n=Z()(e,"targets[0].result[0].values",[]);null===n&&(n=[]);var c=Z()(e,"options.reduceOptions.calcs[0]","lastNotNull"),i=Bc(n,c),r=t.labelDisplayFunction?t.labelDisplayFunction(i[1]):i[1];return Object(j.a)(Object(j.a)({},t),{},{data:r})}break;case hc.pieChart:if("gauge"===a){var o=Z()(e,"targets[0].result",[]);null===o&&(o=[]);var s=Z()(e,"options.reduceOptions.calcs[0]","lastNotNull"),l=o.length>0?o[0].values:[],d=Bc(l,s),u=o.map((function(e){var t=Z()(e,"values",[]),a=Object.keys(e.metric),n=t.sort((function(e,t){return e[0]-t[0]})),c=e.metric[a[0]],i=n[n.length-1];return{name:c,value:parseInt(i)}})),b=t.labelDisplayFunction?t.labelDisplayFunction(d[1]):d[1];return Object(j.a)(Object(j.a)({},t),{},{data:u,innerLabel:b})}break;case hc.linearGraph:if("graph"===a){var m=Z()(e,"targets",[]);null===m&&(m=[]);var h=[],p=[];m.forEach((function(e,t){var a=Z()(e,"result",[]),n=e.legendFormat;null===a&&(a=[]),a.forEach((function(e){var a=function(e,t){var a=Object.keys(e),n=new RegExp("{{(".concat(a.join("|"),")}}"),"g"),c=t.replace(n,(function(t){var a=t.replace(/({{|}})/g,"");return e[a]})),i=(c.match(/{{/g)||[]).length,r=(c.match(/}}/g)||[]).length,o=c.replace(/{{(.*?)}}/g,"");return i===r&&0!==i&&0!==r&&(a.forEach((function(t){c=c.replace(t,e[t])})),o=c),o}(e.metric,n),c="key_".concat(t).concat(a);h.push({dataKey:c,keyLabel:a,lineColor:"",fillColor:""});var i=Z()(e,"values",[]);null===i&&(i=[]),i.forEach((function(e){var t=p.findIndex((function(t){return t.name===e[0]}));if(-1===t){var a={name:e[0]};a[c]=e[1],p.push(a)}else p[t][c]=e[1]}))}))}));var O=h.sort((function(e,t){return e.keyLabel<t.keyLabel?-1:e.keyLabel>t.keyLabel?1:0})).map((function(e,t){return Object(j.a)(Object(j.a)({},e),{},{lineColor:Mc[t]||pe(e.keyLabel),fillColor:Mc[t]||pe(e.keyLabel)})})),g=p.sort((function(e,t){return e.name-t.name}));return Object(j.a)(Object(j.a)({},t),{},{widgetConfiguration:O,data:g})}break;case hc.barChart:if("bargauge"===a){var f=Z()(e,"targets[0].result",[]);null===f&&(f=[]);var x=function(e,t){return e[0]-t[0]},v=[];return v=t.customStructure?t.customStructure.map((function(e){var t=f.find((function(t){var a=Object.keys(t.metric);return t.metric[a[0]]===e.originTag})),a=Z()(t,"values",[]).sort(x),n=a[a.length-1]||["","0"];return{name:e.displayTag,a:parseInt(n[1])}})):f.map((function(e){var t=Object.keys(e.metric),a=e.metric[t[0]],n=Z()(e,"values",[]).sort(x),c=n[n.length-1]||["","0"];return{name:a,a:parseInt(c[1])}})),Object(j.a)(Object(j.a)({},t),{},{data:v})}break;case hc.singleRep:if("stat"===a){var y=Z()(e,"targets[0].result[0].values",[]);null===y&&(y=[]);var S=Z()(e,"options.reduceOptions.calcs[0]","lastNotNull"),C=Bc(y,S),k=y.sort((function(e,t){return e[0]-t[0]})),N=[];1===k.length&&N.push({value:0}),k.forEach((function(e){N.push({value:parseInt(e[1])})}));var w=t.labelDisplayFunction?t.labelDisplayFunction(C[1]):C[1];return Object(j.a)(Object(j.a)({},t),{},{data:N,innerLabel:w})}}return t},Pc=function(e){localStorage.setItem(_c,btoa(JSON.stringify(e)))},zc=Object(s.b)(null,{displayErrorMessage:V}),Kc=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({},Ue),{},{contentContainer:Object(j.a)(Object(j.a)({},Ue.contentContainer),{},{fontWeight:700,color:"#072045",fontSize:18,textAlign:"center"}),loadingAlign:{width:"100%",paddingTop:"15px",textAlign:"center",margin:"auto"}}))}))(zc((function(e){var t=e.title,a=e.panelItem,i=e.timeStart,r=e.timeEnd,o=e.displayErrorMessage,s=e.classes,l=Object(c.useState)(!0),d=Object(b.a)(l,2),u=d[0],j=d[1],m=Object(c.useState)(""),h=Object(b.a)(m,2),p=h[0],O=h[1];return Object(c.useEffect)((function(){if(u){var e=0;if(null!==i&&null!==r){var t=r.unix()-i.unix(),n=Math.floor(t/60);e=n<1?15:n}Oe.invoke("GET","/api/v1/admin/info/widgets/".concat(a.id,"/?step=").concat(e,"&").concat(null!==i?"&start=".concat(i.unix()):"").concat(null!==i&&null!==r?"&":"").concat(null!==r?"end=".concat(r.unix()):"")).then((function(e){var t=Rc(e,a);O(t.data),j(!1)})).catch((function(e){o(e),j(!1)}))}}),[u,a,r,i,o]),Object(n.jsxs)("div",{className:s.singleValueContainer,children:[Object(n.jsx)("div",{className:s.titleContainer,children:t}),u&&Object(n.jsx)("div",{className:s.loadingAlign,children:Object(n.jsx)(S.a,{})}),!u&&Object(n.jsx)("div",{className:s.contentContainer,children:p})]})}))),Uc=a(1001),Wc=a(983),Vc=a(987),Gc=a(224),qc=a(225),Hc=a(418),Yc=a(232),Qc=Object(w.a)((function(e){return Object(k.a)(Object(j.a)({},We))}))((function(e){var t=e.active,a=e.payload,c=e.label,i=e.linearConfiguration,r=e.yAxisFormatter,o=e.classes;return t?Object(n.jsxs)("div",{className:o.customTooltip,children:[Object(n.jsx)("div",{className:o.timeStampTitle,children:me(c,!0)}),a&&a.map((function(e,t){return Object(n.jsxs)("div",{className:o.labelContainer,children:[Object(n.jsx)("div",{className:o.labelColor,style:{backgroundColor:i[t].lineColor}}),Object(n.jsx)("div",{className:o.itemValue,children:Object(n.jsxs)("span",{className:o.valueContainer,children:[i[t].keyLabel,":"," ",r(e.value)]})})]},"lbPl-".concat(t,"-").concat(i[t].keyLabel))}))]}):null})),Zc=Object(s.b)(null,{displayErrorMessage:V}),Jc=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({},Ue),{},{containerElements:{display:"flex",flexDirection:"column",height:"calc(100% - 18px)"},chartCont:{position:"relative",flexGrow:1,minHeight:"65%",height:1},legendChart:{display:"flex",flexWrap:"wrap",flex:"0 1 auto",maxHeight:"35%",margin:0,overflowY:"auto",position:"relative",textAlign:"center"},loadingAlign:{margin:"auto"}}))}))(Zc((function(e){var t=e.classes,a=e.title,r=e.displayErrorMessage,o=e.timeStart,s=e.timeEnd,l=e.panelItem,d=e.hideYAxis,u=void 0!==d&&d,j=e.yAxisFormatter,m=void 0===j?function(e){return e}:j,h=e.xAxisFormatter,p=void 0===h?function(e){return e}:h,O=e.panelWidth,g=void 0===O?0:O,f=Object(c.useState)(!0),x=Object(b.a)(f,2),v=x[0],y=x[1],C=Object(c.useState)([]),k=Object(b.a)(C,2),N=k[0],w=k[1],T=Object(c.useState)(null),E=Object(b.a)(T,2),A=E[0],_=E[1];Object(c.useEffect)((function(){if(v){var e=0;if(null!==o&&null!==s){var t=s.unix()-o.unix(),a=Math.floor(t/60);e=a<1?15:a}Oe.invoke("GET","/api/v1/admin/info/widgets/".concat(l.id,"/?step=").concat(e,"&").concat(null!==o?"&start=".concat(o.unix()):"").concat(null!==o&&null!==s?"&":"").concat(null!==s?"end=".concat(s.unix()):"")).then((function(e){var t=Rc(e,l);w(t.data),_(t),y(!1)})).catch((function(e){r(e),y(!1)}))}}),[v,l,s,o,r]);var I=5;0!==g&&(I=g>400?5:g>350?10:g>300?15:g>250?20:30);var M=A?null===A||void 0===A?void 0:A.widgetConfiguration:[];return Object(n.jsxs)("div",{className:t.singleValueContainer,children:[Object(n.jsx)("div",{className:t.titleContainer,children:a}),Object(n.jsxs)("div",{className:t.containerElements,children:[v&&Object(n.jsx)(S.a,{className:t.loadingAlign}),!v&&Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsx)("div",{className:t.chartCont,children:Object(n.jsx)(Uc.a,{children:Object(n.jsxs)(Wc.a,{data:N,margin:{top:5,right:20,left:u?20:5,bottom:0},children:[Object(n.jsx)(Vc.a,{strokeDasharray:"3 3",strokeWidth:1,strokeOpacity:.5}),Object(n.jsx)(Gc.a,{dataKey:"name",tickFormatter:function(e){return p(e)},interval:I,tick:{fontSize:"70%"},tickCount:10}),Object(n.jsx)(qc.a,{domain:[0,function(e){return 4*e}],hide:u,tickFormatter:function(e){return m(e)},tick:{fontSize:"70%"}}),M.map((function(e,t){return Object(n.jsx)(Hc.a,{type:"monotone",dataKey:e.dataKey,stroke:e.lineColor,fill:e.fillColor,fillOpacity:.3},"area-".concat(e.dataKey,"-").concat(t.toString()))})),Object(n.jsx)(Yc.a,{content:Object(n.jsx)(Qc,{linearConfiguration:M,yAxisFormatter:m}),wrapperStyle:{zIndex:5e3}})]})})}),Object(n.jsx)("div",{className:t.legendChart,children:M.map((function(e,a){return Object(n.jsxs)("div",{className:t.singleLegendContainer,children:[Object(n.jsx)("div",{className:t.colorContainer,style:{backgroundColor:e.lineColor}}),Object(n.jsx)("div",{className:t.legendLabel,children:e.keyLabel})]},"legend-".concat(e.keyLabel,"-").concat(a.toString()))}))})]})]})]})}))),$c=a(988),Xc=a(449),ei=Object(w.a)((function(e){return Object(k.a)(Object(j.a)({},We))}))((function(e){var t=e.active,a=e.payload,c=e.label,i=e.barChartConfiguration,r=e.classes;return t?Object(n.jsxs)("div",{className:r.customTooltip,children:[Object(n.jsx)("div",{className:r.timeStampTitle,children:c}),a&&a.map((function(e,t){return Object(n.jsxs)("div",{className:r.labelContainer,children:[Object(n.jsx)("div",{className:r.labelColor,style:{backgroundColor:i[t].color}}),Object(n.jsx)("div",{className:r.itemValue,children:Object(n.jsx)("span",{className:r.valueContainer,children:e.value})})]},"pltiem-".concat(t,"-").concat(c))}))]}):null})),ti=function(e){var t=e.x,a=e.y,c=e.payload;return Object(n.jsx)("text",{width:50,fontSize:"63%",textAnchor:"end",fill:"#333",transform:"translate(".concat(t,",").concat(a,")"),dy:3,children:c.value})},ai=Object(s.b)(null,{displayErrorMessage:V}),ni=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({},Ue),{},{loadingAlign:{width:"100%",paddingTop:"15px",textAlign:"center",margin:"auto"}}))}))(ai((function(e){var t=e.classes,a=e.title,i=e.panelItem,r=e.timeStart,o=e.timeEnd,s=e.displayErrorMessage,l=Object(c.useState)(!0),d=Object(b.a)(l,2),u=d[0],j=d[1],m=Object(c.useState)([]),h=Object(b.a)(m,2),p=h[0],O=h[1],g=Object(c.useState)(null),f=Object(b.a)(g,2),x=f[0],v=f[1];Object(c.useEffect)((function(){if(u){var e=0;if(null!==r&&null!==o){var t=o.unix()-r.unix(),a=Math.floor(t/60);e=a<1?15:a}Oe.invoke("GET","/api/v1/admin/info/widgets/".concat(i.id,"/?step=").concat(e,"&").concat(null!==r?"&start=".concat(r.unix()):"").concat(null!==r&&null!==o?"&":"").concat(null!==o?"end=".concat(o.unix()):"")).then((function(e){var t=Rc(e,i);O(t.data),v(t),j(!1)})).catch((function(e){s(e),j(!1)}))}}),[u,i,o,r,s]);var y=x?x.widgetConfiguration:[];return Object(n.jsxs)("div",{className:t.singleValueContainer,children:[Object(n.jsx)("div",{className:t.titleContainer,children:a}),u&&Object(n.jsx)("div",{className:t.loadingAlign,children:Object(n.jsx)(S.a,{})}),!u&&Object(n.jsx)("div",{className:t.contentContainer,children:Object(n.jsx)(Uc.a,{children:Object(n.jsxs)($c.a,{data:p,layout:"vertical",barCategoryGap:1,children:[Object(n.jsx)(Gc.a,{type:"number",hide:!0}),Object(n.jsx)(qc.a,{dataKey:"name",type:"category",interval:0,tick:Object(n.jsx)(ti,{}),tickLine:!1,axisLine:!1,width:150}),y.map((function(e){return Object(n.jsx)(Xc.a,{dataKey:e.dataKey,fill:e.color,background:e.background},"bar-".concat(e.dataKey))})),Object(n.jsx)(Yc.a,{cursor:{fill:"rgba(255, 255, 255, 0.3)"},content:Object(n.jsx)(ei,{barChartConfiguration:y})})]})})})]})}))),ci=a(1003),ii=a(420),ri=a(226),oi=Object(s.b)(null,{displayErrorMessage:V}),si=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({},Ue),{},{loadingAlign:{width:"100%",paddingTop:"15px",textAlign:"center",margin:"auto"}}))}))(oi((function(e){var t=e.classes,a=e.title,i=e.panelItem,r=e.timeStart,o=e.timeEnd,s=e.displayErrorMessage,l=Object(c.useState)(!0),d=Object(b.a)(l,2),u=d[0],j=d[1],m=Object(c.useState)([]),h=Object(b.a)(m,2),p=h[0],O=h[1],g=Object(c.useState)([]),f=Object(b.a)(g,2),x=f[0],v=f[1],y=Object(c.useState)(null),C=Object(b.a)(y,2),k=C[0],N=C[1];Object(c.useEffect)((function(){if(u){var e=0;if(null!==r&&null!==o){var t=o.unix()-r.unix(),a=Math.floor(t/60);e=a<1?15:a}Oe.invoke("GET","/api/v1/admin/info/widgets/".concat(i.id,"/?step=").concat(e,"&").concat(null!==r?"&start=".concat(r.unix()):"").concat(null!==r&&null!==o?"&":"").concat(null!==o?"end=".concat(o.unix()):"")).then((function(e){var t=Rc(e,i);O(t.data),v(t.dataOuter),N(t),j(!1)})).catch((function(e){s(e),j(!1)}))}}),[u,i,o,r,s]);var w=k?k.widgetConfiguration:[],T=null===k||void 0===k?void 0:k.innerLabel,E=Z()(w,"innerChart.colorList",[]),A=Z()(w,"outerChart.colorList",[]);return Object(n.jsxs)("div",{className:t.singleValueContainer,children:[Object(n.jsx)("div",{className:t.titleContainer,children:a}),u&&Object(n.jsx)("div",{className:t.loadingAlign,children:Object(n.jsx)(S.a,{})}),!u&&Object(n.jsx)("div",{className:t.contentContainer,children:Object(n.jsx)(Uc.a,{children:Object(n.jsxs)(ci.a,{margin:{top:5,bottom:5},children:[x&&Object(n.jsx)(ii.a,{data:x,cx:"50%",cy:"50%",dataKey:"value",innerRadius:Z()(w,"outerChart.innerRadius",0),outerRadius:Z()(w,"outerChart.outerRadius","80%"),startAngle:Z()(w,"outerChart.startAngle",0),endAngle:Z()(w,"outerChart.endAngle",360),fill:"#201763",children:x.map((function(e,t){return Object(n.jsx)(ri.a,{fill:"undefined"==typeof A[t]?"#393939":A[t]},"cellOuter-".concat(t))}))}),p&&Object(n.jsx)(ii.a,{data:p,dataKey:"value",cx:"50%",cy:"50%",innerRadius:Z()(w,"innerChart.innerRadius",0),outerRadius:Z()(w,"innerChart.outerRadius","80%"),startAngle:Z()(w,"innerChart.startAngle",0),endAngle:Z()(w,"innerChart.endAngle",360),fill:"#201763",children:p.map((function(e,t){return Object(n.jsx)(ri.a,{fill:"undefined"==typeof E[t]?"#393939":E[t]},"cell-".concat(t))}))}),T&&Object(n.jsx)("text",{x:"50%",y:"50%",textAnchor:"middle",dominantBaseline:"middle",fontWeight:600,fontSize:14,children:T})]})})})]})}))),li=Object(s.b)(null,{displayErrorMessage:V}),di=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({},Ue),{},{loadingAlign:{width:"100%",paddingTop:"5px",textAlign:"center",margin:"auto"}}))}))(li((function(e){var t=e.classes,a=e.title,i=e.panelItem,r=e.timeStart,o=e.timeEnd,s=e.displayErrorMessage,l=e.color,d=e.fillColor,u=Object(c.useState)(!0),j=Object(b.a)(u,2),m=j[0],h=j[1],p=Object(c.useState)([]),O=Object(b.a)(p,2),g=O[0],f=O[1],x=Object(c.useState)(null),v=Object(b.a)(x,2),y=v[0],C=v[1];return Object(c.useEffect)((function(){if(m){var e=0;if(null!==r&&null!==o){var t=o.unix()-r.unix(),a=Math.floor(t/60);e=a<1?15:a}Oe.invoke("GET","/api/v1/admin/info/widgets/".concat(i.id,"/?step=").concat(e,"&").concat(null!==r?"&start=".concat(r.unix()):"").concat(null!==r&&null!==o?"&":"").concat(null!==o?"end=".concat(o.unix()):"")).then((function(e){var t=Rc(e,i);C(t),f(t.data),h(!1)})).catch((function(e){s(e),h(!1)}))}}),[m,i,o,r,s]),Object(n.jsxs)("div",{className:t.singleValueContainer,children:[Object(n.jsx)("div",{className:t.titleContainer,children:a}),m&&Object(n.jsx)("div",{className:t.loadingAlign,children:Object(n.jsx)(S.a,{})}),!m&&Object(n.jsx)("div",{className:t.contentContainer,children:Object(n.jsx)(Uc.a,{children:Object(n.jsxs)(Wc.a,{data:g,children:[Object(n.jsx)(qc.a,{domain:[0,function(e){return 2*e}],hide:!0}),Object(n.jsx)(Hc.a,{type:"monotone",dataKey:"value",stroke:l,fill:d,fillOpacity:1}),Object(n.jsx)("text",{x:"50%",y:"50%",textAnchor:"middle",dominantBaseline:"middle",fontWeight:600,fontSize:18,fill:l,children:y?y.innerLabel:""})]})})})]})}))),ui=a(424),bi=a(60),ji=a(996),mi=a(425),hi=a.n(mi),pi=Object(w.a)((function(e){return Object(k.a)({dateSelectorOverride:{height:40,border:"#EAEDEE 1px solid",marginLeft:15,backgroundColor:"#fff",padding:"0 16px",borderRadius:5,"&.MuiInput-underline:hover:not(.Mui-disabled):before":{borderBottom:0},"&:hover":{borderColor:"#000","&:before, &:after":{borderColor:"transparent",borderBottom:0}},"&:before, &:after":{borderColor:"transparent",borderBottom:0},"& input":{fontSize:12,fontWeight:600,color:"#393939"}},parentDateOverride:{flexGrow:1}})}))((function(e){var t=e.value,a=e.onChange,c=e.classes;return Object(n.jsx)(bi.a,{utils:ui.a,children:Object(n.jsx)(ji.a,{value:t,onChange:a,InputProps:{startAdornment:Object(n.jsx)(et.a,{position:"start",children:Object(n.jsx)(hi.a,{})}),className:c.dateSelectorOverride},label:"",ampm:!1,variant:"inline",className:c.parentDateOverride,format:"MMMM Do YYYY, h:mm a"})})})),Oi=function(){return Object(n.jsx)(ot.a,{children:Object(n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:Object(n.jsx)("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z"})})})},gi=Object(s.b)(null,{displayErrorMessage:V}),fi=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({},Fe),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})),{},{widgetsContainer:{height:"calc(100vh - 250px)",paddingBottom:235},syncButton:{"&.MuiButton-root .MuiButton-iconSizeMedium > *:first-child":{fontSize:18}},actionsTray:Object(j.a)(Object(j.a)({},Fe.actionsTray),{},{padding:"0 10px"})}))}))(gi((function(e){var t=e.classes,a=e.displayErrorMessage,i=Object(c.useState)(null),r=Object(b.a)(i,2),o=r[0],s=r[1],l=Object(c.useState)(null),d=Object(b.a)(l,2),u=d[0],j=d[1],m=Object(c.useState)(!0),h=Object(b.a)(m,2),p=h[0],O=h[1],f=Object(c.useState)(Lc),v=Object(b.a)(f,2),y=v[0],S=v[1],C=function(e){var t=localStorage.getItem(_c);if(!t)return Ic;var a=JSON.parse(atob(t));return 0===a.length||a.length>0&&!a[0].minW||0!==e&&a.length!==e?Ic:a}(y.length),k=Object(c.useCallback)((function(e){var t=e/8+5,a=function(e,a){switch(e.type){case hc.singleValue:return Object(n.jsx)(Kc,{title:e.title,panelItem:e,timeStart:o,timeEnd:u});case hc.pieChart:return Object(n.jsx)(si,{title:e.title,panelItem:e,timeStart:o,timeEnd:u});case hc.linearGraph:return Object(n.jsx)(Jc,{title:e.title,panelItem:e,timeStart:o,timeEnd:u,hideYAxis:e.disableYAxis,xAxisFormatter:e.xAxisFormatter,yAxisFormatter:e.yAxisFormatter,panelWidth:C[a]?t*C[a].w:t});case hc.barChart:return Object(n.jsx)(ni,{title:e.title,panelItem:e,timeStart:o,timeEnd:u});case hc.singleRep:var c=e.fillColor?e.fillColor:e.color;return Object(n.jsx)(di,{title:e.title,panelItem:e,timeStart:o,timeEnd:u,color:e.color,fillColor:c});default:return null}};return y.map((function(e,t){return Object(n.jsx)("div",{children:a(e,t)},e.layoutIdentifier)}))}),[y,C,u,o]),N=Object(c.useCallback)((function(){var e=0;if(null!==o&&null!==u){var t=u.unix()-o.unix(),n=Math.floor(t/60);e=n<1?15:n}Oe.invoke("GET","/api/v1/admin/info?step=".concat(e,"&").concat(null!==o?"&start=".concat(o.unix()):"").concat(null!==o&&null!==u?"&":"").concat(null!==u?"end=".concat(u.unix()):"")).then((function(e){if(e.widgets){var t=(n=e.widgets,Lc.map((function(e){var t=n.find((function(t){return t.title.toLowerCase().trim()===e.title.toLowerCase().trim()}));return Rc(t,e)})));S(t)}else a("Widget information could not be retrieved at this time. Please try again");var n;O(!1)})).catch((function(e){a(e),O(!1)}))}),[o,u,a]);return Object(c.useEffect)((function(){p&&N()}),[p,N]),Object(n.jsxs)(x.a,{container:!0,className:t.container,children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:"".concat(t.actionsTray," ").concat(t.timeContainers),children:[Object(n.jsx)("span",{className:t.label,children:"Start Time"}),Object(n.jsx)(pi,{value:o,onChange:s}),Object(n.jsx)("span",{className:t.label,children:"End Time"}),Object(n.jsx)(pi,{value:u,onChange:j}),Object(n.jsx)(g.a,{type:"button",variant:"contained",color:"primary",onClick:function(){O(!0)},startIcon:Object(n.jsx)(Oi,{}),className:t.syncButton,children:"Sync"})]}),Object(n.jsx)(x.a,{item:!0,xs:12,className:t.widgetsContainer,children:Object(n.jsx)(zt.a,{style:{width:"100%",height:"auto",paddingBottom:45},children:function(e){var t=e.width,a=e.height,c=a<600?600:a;c>380&&(c=480);var i=t>1920?1920:t;return Object(n.jsx)(Ac.a,{width:i,cols:8,containerPadding:[10,10],onLayoutChange:Pc,layout:C,rowHeight:c/6,style:{margin:"0 auto",width:i},children:k(t)})}})})]})}))),xi=function(){return Object(n.jsxs)(ot.a,{viewBox:"0 0 15.834 17.375",children:[Object(n.jsx)("defs",{children:Object(n.jsxs)("linearGradient",{id:"a",y1:"0.5",x2:"1",y2:"0.5",gradientUnits:"objectBoundingBox",children:[Object(n.jsx)("stop",{offset:"0.044",stopColor:"#362585"}),Object(n.jsx)("stop",{offset:"0.301",stopColor:"#281b6f"}),Object(n.jsx)("stop",{offset:"1",stopColor:"#1e1560"})]})}),Object(n.jsxs)("g",{transform:"translate(0 0.375)",children:[Object(n.jsx)("circle",{style:{opacity:.1,fill:"url(#a)"},cx:"6.625",cy:"6.625",r:"6.625",transform:"translate(0 3.75)"}),Object(n.jsxs)("g",{transform:"translate(3.092)",children:[Object(n.jsx)("ellipse",{style:{fill:"none",stroke:"#707070",strokeMiterlimit:10,strokeWidth:"0.75px"},cx:"6.183",cy:"1.244",rx:"6.183",ry:"1.244",transform:"translate(0)"}),Object(n.jsx)("path",{style:{fill:"none",stroke:"#707070",strokeMiterlimit:10,strokeWidth:"0.75px"},d:"M-3722.174,1225.225l-1.687,10.292a.858.858,0,0,1-.578.669,12.182,12.182,0,0,1-3.918.647,12.187,12.187,0,0,1-3.894-.639.878.878,0,0,1-.6-.678q-.843-5.145-1.687-10.291",transform:"translate(3734.541 -1223.981)"})]})]})]})},vi=function(){return Object(n.jsxs)(ot.a,{viewBox:"0 0 18.344 17.009",children:[Object(n.jsx)("defs",{children:Object(n.jsxs)("linearGradient",{id:"a",y1:"0.5",x2:"1",y2:"0.5",gradientUnits:"objectBoundingBox",children:[Object(n.jsx)("stop",{offset:"0.044",stopColor:"#362585"}),Object(n.jsx)("stop",{offset:"0.301",stopColor:"#281b6f"}),Object(n.jsx)("stop",{offset:"1",stopColor:"#1e1560"})]})}),Object(n.jsxs)("g",{transform:"translate(0 0.25)",children:[Object(n.jsx)("ellipse",{style:{opacity:.1,fill:"url(#a)"},cx:"7.462",cy:"7.462",rx:"7.462",ry:"7.462",transform:"translate(0 1.835)"}),Object(n.jsx)("rect",{style:{fill:"none",stroke:"#707070",strokeMiterlimit:10,strokeWidth:"0.5px"},width:"9.323",height:"9.323",transform:"translate(4.083)"}),Object(n.jsx)("rect",{style:{fill:"none",stroke:"#707070",strokeMiterlimit:10,strokeWidth:"0.5px"},width:"8.223",height:"8.223",transform:"translate(9.871 5.307)"})]})]})},yi=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({},(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})),{},{paper:{padding:e.spacing(2),display:"flex",overflow:"auto",flexDirection:"column",border:"#eaedee 1px solid",borderRadius:5,boxShadow:"none"},fixedHeight:{height:165,minWidth:247,marginRight:20,padding:"25px 28px","& svg":{maxHeight:18}},consumptionValue:{color:"#000000",fontSize:"60px",fontWeight:"bold"},icon:{marginRight:10,color:"#777777"},notationContainer:{display:"flex"},dashboardBG:{width:390,height:255,zIndex:500,position:"absolute",backgroundSize:"fill",backgroundImage:"url(/images/BG_IllustrationDarker.svg)",backgroundPosition:"right bottom",right:0,bottom:0,backgroundRepeat:"no-repeat"},dashboardContainer:{zIndex:600,position:"absolute"},elementTitle:{fontWeight:500,color:"#777777",fontSize:14,marginTop:-9},smallUnit:{fontSize:20}}))}))((function(e){var t=e.classes,a=e.usage,i=Object(ye.a)(t.paper,t.fixedHeight),r=function(e){return void 0===e?0:e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")};return Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)("div",{className:t.dashboardBG}),Object(n.jsx)(x.a,{container:!0,className:t.dashboardContainer,children:Object(n.jsx)(x.a,{container:!0,spacing:3,className:t.container,children:Object(n.jsxs)(x.a,{item:!0,className:t.notationContainer,children:[Object(n.jsxs)(C.a,{className:i,children:[Object(n.jsxs)(x.a,{container:!0,direction:"row",alignItems:"center",children:[Object(n.jsx)(x.a,{item:!0,className:t.icon,children:Object(n.jsx)(xi,{})}),Object(n.jsx)(x.a,{item:!0,children:Object(n.jsx)(v.a,{className:t.elementTitle,children:"All buckets"})})]}),Object(n.jsx)(v.a,{className:t.consumptionValue,children:a?r(a.buckets):0})]}),Object(n.jsxs)(C.a,{className:i,children:[Object(n.jsxs)(x.a,{container:!0,direction:"row",alignItems:"center",children:[Object(n.jsx)(x.a,{item:!0,className:t.icon,children:Object(n.jsx)(gn,{})}),Object(n.jsx)(x.a,{item:!0,children:Object(n.jsx)(v.a,{className:t.elementTitle,children:"Usage"})})]}),Object(n.jsx)(v.a,{className:t.consumptionValue,children:a?function(e){if(void 0===e)return"0";var a=ce(e).split(" ");return 2!==a.length?a.join(" "):Object(n.jsxs)(c.Fragment,{children:[a[0],Object(n.jsx)("span",{className:t.smallUnit,children:a[1]})]})}(a.usage+""):0})]}),Object(n.jsxs)(C.a,{className:i,children:[Object(n.jsxs)(x.a,{container:!0,direction:"row",alignItems:"center",children:[Object(n.jsx)(x.a,{item:!0,className:t.icon,children:Object(n.jsx)(vi,{})}),Object(n.jsx)(x.a,{item:!0,children:Object(n.jsxs)(v.a,{className:t.elementTitle,children:[" ","Total Objects"]})})]}),Object(n.jsx)(v.a,{className:t.consumptionValue,children:a?r(a.objects):0})]})]})})})]})})),Si=Object(s.b)(null,{displayErrorMessage:V}),Ci=Object(w.a)((function(e){return Object(k.a)(Object(j.a)({},(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))(Si((function(e){var t=e.classes,a=e.displayErrorMessage,i=Object(c.useState)(!0),r=Object(b.a)(i,2),o=r[0],s=r[1],l=Object(c.useState)(null),d=Object(b.a)(l,2),u=d[0],j=d[1],m=Object(c.useCallback)((function(){Oe.invoke("GET","/api/v1/admin/info").then((function(e){j(e),s(!1)})).catch((function(e){a(e),s(!1)}))}),[j,s,a]);Object(c.useEffect)((function(){o&&m()}),[o,m]);var h=Z()(u,"widgets",null);return Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(qa,{label:"Dashboard"}),Object(n.jsx)(x.a,{container:!0,children:o?Object(n.jsx)(x.a,{item:!0,xs:12,className:t.container,children:Object(n.jsx)(y.a,{})}):Object(n.jsx)(c.Fragment,{children:null!==h?Object(n.jsx)(fi,{}):Object(n.jsx)(yi,{usage:u})})})]})}))),ki=a(915),Ni=a(990),wi=a(426),Ti=a.n(wi),Ei=a(989),Ai=a(991),_i=a(960),Ii=a(992),Mi=a.p+"static/media/minio_console_logo.0837460e.svg",Fi=a.p+"static/media/minio_operator_logo.1312b7c9.svg",Di=[{label:"",group:"common",collapsible:!1},{label:"User",group:"User",collapsible:!0},{label:"Admin",group:"Admin",collapsible:!0},{label:"Tools",group:"Tools",collapsible:!0},{label:"Operator",group:"Operator",collapsible:!1},{label:"",group:"License",collapsible:!1}],Li=a(429),Bi=a.n(Li),Ri=function(){return Object(n.jsx)(ot.a,{children:Object(n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 13 11",children:[Object(n.jsx)("path",{fill:"#fff",d:"M11 11H0V2h11v9zM2 8v1h7V8zm0-3v1h5V5z"}),Object(n.jsxs)("g",{fill:"#07274a",stroke:"#fdfdfd",strokeWidth:"0.5",transform:"translate(7)",children:[Object(n.jsx)("circle",{cx:"3",cy:"3",r:"3",stroke:"none"}),Object(n.jsx)("circle",{cx:"3",cy:"3",r:"2.75",fill:"none"})]}),Object(n.jsx)("path",{fill:"none",stroke:"#fff",strokeWidth:"0.5",d:"M8.73 2.794l.954.953 1.471-1.471"})]})})},Pi=function(){return Object(n.jsx)(ot.a,{children:Object(n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12.122 10.571",children:Object(n.jsxs)("g",{transform:"translate(0 0.5)",children:[Object(n.jsx)("path",{style:{fill:"none",stroke:"rgba(255,255,255,0.8)"},d:"M4816.27,3755.205v-2.939h8.539v9.571h-8.539v-2.932",transform:"translate(-4813.187 -3752.266)"}),Object(n.jsx)("path",{style:{fill:"none",stroke:"rgba(255,255,255,0.8)"},d:"M4813.187,3757.052h8.081",transform:"translate(-4813.187 -3752.266)"}),Object(n.jsx)("path",{style:{fill:"none",stroke:"rgba(255,255,255,0.8)"},d:"M4806.5,3756.511l2.265,2.063-2.265,2.063",transform:"translate(-4800.808 -3753.863)"})]})})})},zi=function(){return Object(n.jsx)(ot.a,{children:Object(n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 10 10",children:Object(n.jsxs)("g",{transform:"translate(-518 -361)",children:[Object(n.jsx)("path",{d:"M-126,0V10h10V0Zm1.5,8.5V2.95h7V8.5Z",transform:"translate(644 361)"}),Object(n.jsx)("rect",{width:"2",height:"1",transform:"translate(520.272 364.772)"})]})})})},Ki=function(){return Object(n.jsx)(ot.a,{children:Object(n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 10.014 9.993",children:[Object(n.jsx)("path",{className:"a",d:"M9.162,5.971h0L8.192,5,9.346,3.846a2.257,2.257,0,0,0,0-3.192,2.311,2.311,0,0,0-3.192,0L5,1.808,4.029.837,3.846.654a2.311,2.311,0,0,0-3.192,0,2.257,2.257,0,0,0,0,3.192l.184.183h0L1.808,5,.654,6.154A2.257,2.257,0,0,0,3.846,9.346L5,8.192l.971.971.183.183A2.257,2.257,0,0,0,9.346,6.154Zm-2.29-4.6a1.27,1.27,0,0,1,1.757,0,1.242,1.242,0,0,1,0,1.757L7.475,4.283,5.717,2.525Zm-5.5,1.757A1.243,1.243,0,0,1,3.129,1.371l.183.183L1.555,3.312Zm1.757,5.5a1.27,1.27,0,0,1-1.757,0,1.242,1.242,0,0,1,0-1.757L2.525,5.717,4.283,7.475Zm2.843-.9-.254-.253L2.525,4.283l-.253-.254L4.029,2.272l.254.253L7.475,5.717l.253.254Zm2.657.9a1.271,1.271,0,0,1-1.757,0l-.183-.183L8.446,6.688l.183.183h0a1.241,1.241,0,0,1,0,1.757Z",transform:"translate(0.007 -0.014)"}),Object(n.jsx)("circle",{cx:"0.5",cy:"0.5",r:"0.5",transform:"translate(4.507 4.486)"}),Object(n.jsx)("circle",{cx:"0.5",cy:"0.5",r:"0.5",transform:"translate(3.507 3.486)"}),Object(n.jsx)("circle",{cx:"0.5",cy:"0.5",r:"0.5",transform:"translate(5.507 5.486)"})]})})},Ui=a(427),Wi=a.n(Ui),Vi=a(428),Gi=a.n(Vi),qi=Object(s.b)((function(e){return{open:e.system.loggedIn,operatorMode:e.system.operatorMode}}),{userLoggedIn:P}),Hi=qi(Object(w.a)((function(e){return Object(k.a)({logo:{paddingTop:25,marginBottom:30,paddingLeft:45,"& img":{width:120}},menuList:{"& .active":{borderTopLeftRadius:2,borderBottomLeftRadius:2,color:"#fff",backgroundColor:"rgba(255, 255, 255, .18)","& .MuiSvgIcon-root":{color:"white"},"& .MuiTypography-root":{color:"#fff",fontWeight:700}},"& .MuiSvgIcon-root":{fontSize:16,color:"rgba(255, 255, 255, 0.8)",maxWidth:14},"& .MuiListItemIcon-root":{minWidth:25},"& .MuiTypography-root":{fontSize:12,color:"rgba(255, 255, 255, 0.8)"},"& .MuiListItem-gutters":{paddingRight:0,fontWeight:300},"& .MuiListItem-root":{padding:"2px 0 2px 16px",marginBottom:8,marginLeft:30,width:"calc(100% - 30px)"},"& .MuiCollapse-container .MuiCollapse-wrapper .MuiCollapse-wrapperInner .MuiDivider-root":{backgroundColor:"rgba(112,112,112,0.5)",marginBottom:12,height:1}},extraMargin:{"&.MuiListItem-gutters":{marginLeft:5}},groupTitle:{color:"#fff",fontSize:10,textTransform:"uppercase",fontWeight:700,marginBottom:3,cursor:"pointer",userSelect:"none",display:"flex",justifyContent:"space-between"},subTitleMenu:{fontWeight:700,marginLeft:10,"&.MuiTypography-root":{fontSize:13,color:"#fff"}},selectorArrow:{marginRight:20,marginTop:1,display:"inline-block",width:0,height:0,borderStyle:"solid",borderWidth:"4px 4px 0 4px",borderColor:"rgba(255, 255, 255, .29) transparent transparent transparent",transform:"rotateZ(0deg)",transitionDuration:"0.2s"},selectorArrowOpen:{transform:"rotateZ(180deg)"}})}))((function(e){var t=e.userLoggedIn,a=e.classes,r=e.pages,o=e.operatorMode,s=Object(c.useState)(function(){var e=[];return Di.forEach((function(t){t.collapsible&&(e[t.group]=!0)})),e}()),l=Object(b.a)(s,2),d=l[0],m=l[1],h=[{group:"common",type:"item",component:Ht.b,to:"/dashboard",name:"Dashboard",icon:Object(n.jsx)(ut,{})},{group:"User",type:"item",component:Ht.b,to:"/object-browser",name:"Object Browser",icon:Object(n.jsx)(Ti.a,{})},{group:"User",type:"item",component:Ht.b,to:"/account",name:"Account",icon:Object(n.jsx)(mt,{})},{group:"Admin",type:"item",component:Ht.b,to:"/buckets",name:"Buckets",icon:Object(n.jsx)(bt,{})},{group:"Admin",type:"item",component:Ht.b,to:"/users",name:"Users",icon:Object(n.jsx)(jt,{})},{group:"Admin",type:"item",component:Ht.b,to:"/groups",name:"Groups",icon:Object(n.jsx)(ht,{})},{group:"Admin",type:"item",component:Ht.b,to:"/policies",name:"IAM Policies",icon:Object(n.jsx)(pt,{})},{group:"Tools",type:"item",component:Ht.b,to:"/logs",name:"Logs",icon:Object(n.jsx)(zi,{})},{group:"Tools",type:"item",component:Ht.b,to:"/watch",name:"Watch",icon:Object(n.jsx)(xt,{})},{group:"Tools",type:"item",component:Ht.b,to:"/trace",name:"Trace",icon:Object(n.jsx)(Ot,{})},{group:"Tools",type:"item",component:Ht.b,to:"/heal",name:"Heal",icon:Object(n.jsx)(Ki,{})},{group:"Tools",type:"item",component:Ht.b,to:"/health-info",name:"Diagnostic",icon:Object(n.jsx)(Wi.a,{})},{group:"Admin",type:"item",component:Ht.b,to:"/settings",name:"Settings",icon:Object(n.jsx)(gt,{})},{group:"Operator",type:"item",component:Ht.b,to:"/tenants",name:"Tenants",icon:Object(n.jsx)(ft,{})},{group:"Operator",type:"item",component:Ht.b,to:"/storage",name:"Storage",icon:Object(n.jsx)(Gi.a,{})}],p=r.reduce((function(e,t){return e[t]=!0,e}),{}),O={group:"License",type:"item",component:Ht.b,to:"/documentation",name:"Documentation",icon:Object(n.jsx)(Bi.a,{}),forceDisplay:!0};p.hasOwnProperty("/tenants")?h.push({group:"Operator",type:"item",component:Ht.b,to:"/license",name:"License",icon:Object(n.jsx)(Ri,{})},Object(j.a)(Object(j.a)({},O),{},{group:"Operator",onClick:function(e){e.preventDefault(),window.open("https://docs.min.io/?ref=".concat(o?"op":"con"),"_blank")}})):h.push({group:"License",type:"item",component:Ht.b,to:"/license",name:"License",icon:Object(n.jsx)(Ri,{})},Object(j.a)(Object(j.a)({},O),{},{group:"License",onClick:function(e){e.preventDefault(),window.open("https://docs.min.io/?ref=".concat(o?"op":"con"),"_blank")}}));var g=h.filter((function(e){return p[e.to]||e.forceDisplay||"item"!==e.type}));return Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsx)("div",{className:a.logo,children:Object(n.jsx)("img",{src:o?Fi:Mi,alt:"logo"})}),Object(n.jsxs)(_i.a,{className:a.menuList,children:[Di.map((function(e,t){var c=(g||[]).filter((function(t){return t.group===e.group}));return 0===c.filter((function(e){return"title"!==e.type})).length?null:Object(n.jsxs)(i.a.Fragment,{children:[""!==e.label&&Object(n.jsxs)(ki.a,{className:a.groupTitle,onClick:function(){e.collapsible&&function(e){var t=Object(j.a)({},d);t[e]=!t[e],m(t)}(e.group)},children:[Object(n.jsx)("span",{children:e.label}),e.collapsible&&Object(n.jsx)("span",{className:"".concat(a.selectorArrow," ").concat(d[e.group]?a.selectorArrowOpen:"")})]}),Object(n.jsxs)(Ei.a,{in:!e.collapsible||d[e.group],timeout:"auto",unmountOnExit:!0,children:[c.map((function(e){switch(e.type){case"item":return Object(n.jsxs)(ki.a,{button:!0,onClick:e.onClick,component:e.component,to:e.to,className:e.extraMargin?a.extraMargin:null,children:[e.icon&&Object(n.jsx)(Ni.a,{children:e.icon}),e.name&&Object(n.jsx)(Ai.a,{primary:e.name})]},e.to);case"title":return Object(n.jsx)(ki.a,{component:e.component,className:a.subTitleMenu,children:e.name},e.name);default:return null}})),Object(n.jsx)(Ii.a,{})]},"menuGroup-".concat(e.group))]},"menuElem-".concat(t.toString()))})),Object(n.jsxs)(ki.a,{button:!0,onClick:function(){var e=function(){ie(),t(!1),localStorage.setItem("userLoggedIn",""),u.push("/login")};Oe.invoke("POST","/api/v1/logout").then((function(){e()})).catch((function(t){console.log(t),e()}))},children:[Object(n.jsx)(Ni.a,{children:Object(n.jsx)(Pi,{})}),Object(n.jsx)(Ai.a,{primary:"Logout"})]})]})]})}))),Yi={setModalErrorSnackMessage:q},Qi=Object(s.b)(null,Yi),Zi=Object(w.a)((function(e){return Object(k.a)(Object(j.a)({jsonPolicyEditor:{minHeight:400,width:"100%"},buttonContainer:{textAlign:"right"},infoDetails:{color:"#393939",fontSize:12,fontStyle:"italic",marginBottom:"8px"},containerScrollable:{maxHeight:"calc(100vh - 300px)",overflowY:"auto"}},Te))}))(Qi((function(e){var t=e.classes,a=e.open,i=e.closeModalAndRefresh,r=e.setModalErrorSnackMessage,o=Object(c.useState)(!1),s=Object(b.a)(o,2),l=s[0],d=s[1],u=Object(c.useState)(""),j=Object(b.a)(u,2),m=j[0],h=j[1],p=Object(c.useState)(!1),O=Object(b.a)(p,2),f=O[0],v=O[1];Object(c.useEffect)((function(){l&&Oe.invoke("POST","/api/v1/service-accounts",{policy:m}).then((function(e){d(!1),i(e)})).catch((function(e){d(!1),r(e)}))}),[l,d,r,m,i]);return Object(n.jsx)(va,{modalOpen:a,onClose:function(){i(null)},title:"Create Service Account",children:Object(n.jsxs)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){!function(e){e.preventDefault(),d(!0)}(e)},children:[Object(n.jsxs)(x.a,{container:!0,className:t.containerScrollable,children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("div",{className:t.infoDetails,children:"Service Accounts inherit the policy explicitly attached to the parent user and the policy attached to each group in which the parent user has membership. You can specify an optional JSON-formatted policy below to restrict the Service Account access to a subset of actions and resources explicitly allowed for the parent user. You cannot modify the Service Account optional policy after saving."})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(za,{value:"locking",id:"locking",name:"locking",checked:f,onChange:function(e){v(e.target.checked)},label:"Restrict with policy",indicatorLabels:["On","Off"]})}),f&&Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(pc,{value:m,onBeforeChange:function(e,t,a){h(a)}})})]}),Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.buttonContainer,children:[Object(n.jsx)("button",{type:"button",color:"primary",className:t.clearButton,onClick:function(){h("")},children:"Clear"}),Object(n.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:l,children:"Create"})]}),l&&Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(y.a,{})})]})]})})}))),Ji={setErrorSnackMessage:V},$i=Object(s.b)(null,Ji),Xi=Object(w.a)((function(e){return Object(k.a)({wrapText:{maxWidth:"200px",whiteSpace:"normal",wordWrap:"break-word"}})}))($i((function(e){var t=e.classes,a=e.closeDeleteModalAndRefresh,i=e.deleteOpen,r=e.selectedServiceAccount,o=e.setErrorSnackMessage,s=Object(c.useState)(!1),l=Object(b.a)(s,2),d=l[0],u=l[1];Object(c.useEffect)((function(){d&&Oe.invoke("DELETE","/api/v1/service-accounts/".concat(r)).then((function(){u(!1),a(!0)})).catch((function(e){u(!1),o(e)}))}),[d,a,r,o]);return Object(n.jsxs)(pa.a,{open:i,onClose:function(){a(!1)},"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[Object(n.jsx)(Oa.a,{id:"alert-dialog-title",children:"Delete ServiceAccount"}),Object(n.jsxs)(ga.a,{children:[d&&Object(n.jsx)(y.a,{}),Object(n.jsxs)(Ua.a,{id:"alert-dialog-description",children:["Are you sure you want to delete service account"," ",Object(n.jsx)("b",{className:t.wrapText,children:r}),"?"]})]}),Object(n.jsxs)(Wa.a,{children:[Object(n.jsx)(g.a,{onClick:function(){a(!1)},color:"primary",disabled:d,children:"Cancel"}),Object(n.jsx)(g.a,{onClick:function(){null!=r&&u(!0)},color:"secondary",autoFocus:!0,children:"Delete"})]})]})}))),er=Object(w.a)((function(e){return Object(k.a)({warningBlock:{color:"red"},buttonContainer:{textAlign:"right"},credentialsPanel:{overflowY:"auto",maxHeight:350}})}))((function(e){var t=e.classes,a=e.newServiceAccount,c=e.open,r=e.closeModal,o=e.entity;if(!a)return null;var s=Z()(a,"console",null);return Object(n.jsx)(va,{modalOpen:c,onClose:function(){r()},title:"New ".concat(o," Created"),children:Object(n.jsx)(i.a.Fragment,{children:Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.formScrollable,children:["A new ",o," has been created with the following details:",s&&Object(n.jsx)(i.a.Fragment,{children:Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.credentialsPanel,children:[Object(n.jsx)("strong",{children:"Console Credentials"}),Array.isArray(s)&&s.map((function(e,t){return Object(n.jsxs)("ul",{children:[Object(n.jsxs)("li",{children:[Object(n.jsx)("b",{children:"Access Key:"})," ",e.accessKey]}),Object(n.jsxs)("li",{children:[Object(n.jsx)("b",{children:"Secret Key:"})," ",e.secretKey]})]},"creds-item-".concat(t.toString()))})),!Array.isArray(s)&&Object(n.jsxs)("ul",{children:[Object(n.jsxs)("li",{children:[Object(n.jsx)("b",{children:"Access Key:"})," ",s.accessKey]}),Object(n.jsxs)("li",{children:[Object(n.jsx)("b",{children:"Secret Key:"})," ",s.secretKey]})]})]})}),Object(n.jsx)(v.a,{component:"p",variant:"body1",className:t.warningBlock,children:"Write these down, as this is the only time the secret will be displayed."})]}),Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.buttonContainer,children:[Object(n.jsx)(g.a,{onClick:function(){var e={};if(s)if(Array.isArray(s)){var t=s.map((function(e){return{access_key:e.accessKey,secret_key:e.secretKey}}));e={console:Object(Xe.a)(t)}}else e={console:[{access_key:s.accessKey,secret_key:s.secretKey}]};!function(e,t){var a=document.createElement("a");a.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(t)),a.setAttribute("download",e),a.style.display="none",document.body.appendChild(a),a.click(),document.body.removeChild(a)}("credentials.json",JSON.stringify(Object(j.a)({},e)))},color:"primary",children:"Download"}),Object(n.jsx)(g.a,{onClick:function(){r()},color:"secondary",autoFocus:!0,children:"Done"})]})]})})})})),tr=function(e,t){return e.accessKey>t.accessKey?1:e.accessKey<t.accessKey?-1:0},ar=function(e,t){return e.name>t.name?1:e.name<t.name?-1:0},nr=function(e,t){return e>t?1:e<t?-1:0},cr=a(430),ir=a.n(cr),rr=Object(s.b)(null,{setModalErrorSnackMessage:q}),or=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({buttonContainer:{textAlign:"right"}},Fe),Te),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))(rr((function(e){var t=e.classes,a=e.open,i=e.closeModal,r=e.setModalErrorSnackMessage,o=Object(c.useState)(""),s=Object(b.a)(o,2),l=s[0],d=s[1],u=Object(c.useState)(""),j=Object(b.a)(u,2),m=j[0],h=j[1],p=Object(c.useState)(""),O=Object(b.a)(p,2),f=O[0],v=O[1],S=Object(c.useState)(!1),C=Object(b.a)(S,2),k=C[0],N=C[1];return a?Object(n.jsx)(va,{title:"Change Password",modalOpen:a,onClose:function(){h(""),v(""),d(""),i()},"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:Object(n.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){!function(e){if(e.preventDefault(),m===f){if(!k){N(!0);var t={current_secret_key:l,new_secret_key:m};Oe.invoke("POST","/api/v1/account/change-password",t).then((function(e){N(!1),h(""),v(""),d(""),i()})).catch((function(e){N(!1),h(""),v(""),d(""),r(e)}))}}else r("New passwords don't match")}(e)},children:Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.formScrollable,children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"current-password",name:"current-password",onChange:function(e){d(e.target.value)},label:"Current Password",type:"password",value:l})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"new-password",name:"new-password",onChange:function(e){h(e.target.value)},label:"New Password",type:"password",value:m})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"re-new-password",name:"re-new-password",onChange:function(e){v(e.target.value)},label:"Type New Password Again",type:"password",value:f})})]}),Object(n.jsx)(x.a,{item:!0,xs:12,className:t.buttonContainer,children:Object(n.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:k||!(l.length>0&&m.length>0&&f.length>0),children:"Save"})}),k&&Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(y.a,{})})]})})}):null}))),sr=Object(s.b)(null,{displayErrorMessage:V}),lr=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({seeMore:{marginTop:e.spacing(3)},paper:{display:"flex",overflow:"auto",flexDirection:"column"},addSideBar:{width:"480px",minWidth:"320px",padding:"20px"},tableToolbar:{paddingLeft:e.spacing(2),paddingRight:e.spacing(0)},wrapCell:{maxWidth:"200px",whiteSpace:"normal",wordWrap:"break-word"},minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:"bold"}}},imageIcon:{height:"100%"},iconRoot:{textAlign:"center"}},Fe),De),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))(sr((function(e){var t=e.classes,a=e.displayErrorMessage,r=e.changePassword,o=Object(c.useState)([]),s=Object(b.a)(o,2),l=s[0],d=s[1],u=Object(c.useState)(!1),j=Object(b.a)(u,2),m=j[0],h=j[1],p=Object(c.useState)(""),O=Object(b.a)(p,2),y=O[0],S=O[1],C=Object(c.useState)(!1),k=Object(b.a)(C,2),N=k[0],w=k[1],T=Object(c.useState)(!1),E=Object(b.a)(T,2),A=E[0],_=E[1],I=Object(c.useState)(null),M=Object(b.a)(I,2),F=M[0],D=M[1],L=Object(c.useState)(!1),B=Object(b.a)(L,2),R=B[0],P=B[1],z=Object(c.useState)(null),K=Object(b.a)(z,2),U=K[0],W=K[1],V=Object(c.useState)(!1),G=Object(b.a)(V,2),q=G[0],H=G[1];Object(c.useEffect)((function(){Y()}),[]),Object(c.useEffect)((function(){m&&Oe.invoke("GET","/api/v1/service-accounts").then((function(e){var t=e.sort(nr);h(!1),d(t)})).catch((function(e){a(e),h(!1)}))}),[m,h,d,a]);var Y=function(){h(!0)},Q=[{type:"delete",onClick:function(e){D(e),_(!0)}}],Z=l.filter((function(e){return e.toLowerCase().includes(y.toLowerCase())}));return Object(n.jsxs)(i.a.Fragment,{children:[N&&Object(n.jsx)(Zi,{open:N,closeModalAndRefresh:function(e){!function(e){if(w(!1),Y(),null!==e){var t={console:{accessKey:"".concat(e.accessKey),secretKey:"".concat(e.secretKey)}};W(t),P(!0)}}(e)}}),A&&Object(n.jsx)(Xi,{deleteOpen:A,selectedServiceAccount:F,closeDeleteModalAndRefresh:function(e){!function(e){_(!1),e&&Y()}(e)}}),R&&Object(n.jsx)(er,{newServiceAccount:U,open:R,closeModal:function(){P(!1),W(null)},entity:"Service Account"}),Object(n.jsx)(qa,{label:"Account"}),Object(n.jsx)(x.a,{container:!0,children:Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.container,children:[r&&Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(v.a,{variant:"h5",component:"h5",children:"Settings"})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("br",{})}),Object(n.jsxs)(x.a,{item:!0,xs:12,children:[Object(n.jsx)(or,{open:q,closeModal:function(){return H(!1)}}),Object(n.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(n.jsx)(ir.a,{}),onClick:function(){return H(!0)},children:"Change Password"})]}),Object(n.jsxs)(x.a,{item:!0,xs:12,children:[Object(n.jsx)("br",{}),Object(n.jsx)(Ii.a,{}),Object(n.jsx)("br",{})]})]}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(v.a,{variant:"h5",component:"h5",children:"Service Accounts"})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("br",{})}),Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.actionsTray,children:[Object(n.jsx)(f.a,{placeholder:"Search Service Accounts",className:t.searchField,id:"search-resource",label:"",InputProps:{disableUnderline:!0,startAdornment:Object(n.jsx)(et.a,{position:"start",children:Object(n.jsx)(at.a,{})})},onChange:function(e){S(e.target.value)}}),Object(n.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(n.jsx)(lt,{}),onClick:function(){w(!0),D(null)},children:"Create service account"})]}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("br",{})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(ha,{isLoading:m,records:Z,entityName:"Service Accounts",idField:"",columns:[{label:"Service Account",elementKey:""}],itemActions:Q})})]})})]})}))),dr=a(227),ur=a.n(dr),br={setModalErrorSnackMessage:q},jr=Object(s.b)(null,br),mr=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({seeMore:{marginTop:e.spacing(3)},paper:{display:"flex",overflow:"auto",flexDirection:"column",paddingTop:15,boxShadow:"none"},addSideBar:{width:"320px",padding:"20px"},tableToolbar:{paddingLeft:e.spacing(2),paddingRight:e.spacing(0)},wrapCell:{maxWidth:"200px",whiteSpace:"normal",wordWrap:"break-word"},minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:"bold"}}},noFound:{textAlign:"center",padding:"10px 0"},tableContainer:{maxHeight:200},stickyHeader:{backgroundColor:"#fff"},actionsTitle:{fontWeight:600,color:"#000",fontSize:16,alignSelf:"center"},tableBlock:{marginTop:15},filterField:{width:375,fontWeight:600,"& .input":{"&::placeholder":{fontWeight:600,color:"#000"}}}},Fe),Re))}))(jr((function(e){var t=e.classes,a=e.selectedGroups,r=e.setSelectedGroups,o=e.setModalErrorSnackMessage,s=Object(c.useState)([]),l=Object(b.a)(s,2),d=l[0],u=l[1],j=Object(c.useState)(!1),m=Object(b.a)(j,2),h=m[0],p=m[1],O=Object(c.useState)(""),g=Object(b.a)(O,2),v=g[0],S=g[1],k=Object(c.useCallback)((function(){Oe.invoke("GET","/api/v1/groups").then((function(e){var t=Z()(e,"groups",[]);t||(t=[]),u(t.sort(nr)),p(!1)})).catch((function(e){o(e),p(!1)}))}),[o]);Object(c.useEffect)((function(){p(!0)}),[]),Object(c.useEffect)((function(){h&&k()}),[h,k]);var N=a||[],w=d.filter((function(e){return e.includes(v)}));return Object(n.jsx)(i.a.Fragment,{children:Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsxs)(C.a,{className:t.paper,children:[h&&Object(n.jsx)(y.a,{}),null!=d&&d.length>0?Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.actionsTray,children:[Object(n.jsx)("span",{className:t.actionsTitle,children:"Assign Groups"}),Object(n.jsx)(f.a,{placeholder:"Filter by Group",className:t.filterField,id:"search-resource",label:"",InputProps:{startAdornment:Object(n.jsx)(et.a,{position:"start",children:Object(n.jsx)(at.a,{})})},onChange:function(e){S(e.target.value)}})]}),Object(n.jsx)(x.a,{item:!0,xs:12,className:t.tableBlock,children:Object(n.jsx)(ha,{columns:[{label:"Group",elementKey:""}],onSelect:function(e){var t=e.target,a=t.value,n=t.checked,c=Object(Xe.a)(N);return n?c.push(a):c=c.filter((function(e){return e!==a})),r(c),c},selectedItems:N,isLoading:h,records:w,entityName:"Groups",idField:"",customPaperHeight:t.multiSelectTable})})]}):Object(n.jsx)("div",{className:t.noFound,children:"No Groups Available"})]})})})}))),hr={setModalErrorSnackMessage:q},pr=Object(s.b)(null,hr),Or=Object(w.a)((function(e){return Object(k.a)(Object(j.a)({strongText:{fontWeight:700},keyName:{marginLeft:5},buttonContainer:{textAlign:"right"}},Te))}))(pr((function(e){var t=e.classes,a=e.closeModalAndRefresh,r=e.selectedUser,o=e.open,s=e.setModalErrorSnackMessage,l=Object(c.useState)(!1),d=Object(b.a)(l,2),u=d[0],j=d[1],m=Object(c.useState)(""),h=Object(b.a)(m,2),p=h[0],O=h[1],f=Object(c.useState)(""),v=Object(b.a)(f,2),S=v[0],C=v[1],k=Object(c.useState)(!1),N=Object(b.a)(k,2),w=N[0],T=N[1],E=Object(c.useState)([]),A=Object(b.a)(E,2),_=A[0],I=A[1],M=Object(c.useState)([]),F=Object(b.a)(M,2),D=F[0],L=F[1],B=Object(c.useCallback)((function(){if(!r)return null;Oe.invoke("GET","/api/v1/users/".concat(r.accessKey)).then((function(e){j(!1),O(e.accessKey),I(e.memberOf||[]),L(e.memberOf||[]),T("enabled"===e.status)})).catch((function(e){j(!1),s(e)}))}),[r,s]);Object(c.useEffect)((function(){null==r?(O(""),C(""),I([])):B()}),[r,B]);var R=""!==p.trim()&&(""!==S.trim()&&null===r||null!==r);return Object(n.jsxs)(va,{onClose:function(){a()},modalOpen:o,title:null!==r?"Edit User":"Create User",children:[null!==r&&Object(n.jsx)("div",{className:t.floatingEnabled,children:Object(n.jsx)(za,{indicatorLabels:["Enabled","Disabled"],checked:w,value:"user_enabled",id:"user-status",name:"user-status",onChange:function(e){T(e.target.checked)},switchOnly:!0})}),Object(n.jsx)(i.a.Fragment,{children:Object(n.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){e.preventDefault(),u||(j(!0),null!==r?Oe.invoke("PUT","/api/v1/users/".concat(r.accessKey),{status:w?"enabled":"disabled",groups:_}).then((function(e){j(!1),a()})).catch((function(e){j(!1),s(e)})):Oe.invoke("POST","/api/v1/users",{accessKey:p,secretKey:S,groups:_}).then((function(e){j(!1),a()})).catch((function(e){j(!1),s(e)})))},children:Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.formScrollable,children:[Object(n.jsx)(Ca,{id:"accesskey-input",name:"accesskey-input",label:"Access Key",value:p,onChange:function(e){O(e.target.value)},disabled:null!==r}),null!==r?Object(n.jsx)(Ja,{label:"Current Groups",content:D.join(", ")}):Object(n.jsx)(Ca,{id:"standard-multiline-static",name:"standard-multiline-static",label:"Secret Key",type:"password",value:S,onChange:function(e){C(e.target.value)},autoComplete:"current-password"}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(mr,{selectedGroups:_,setSelectedGroups:function(e){I(e)}})})]}),Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.buttonContainer,children:[Object(n.jsx)("button",{type:"button",color:"primary",className:t.clearButton,onClick:function(){null===r?(O(""),C(""),I([])):I([])},children:"Clear"}),Object(n.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:u||!R,children:"Save"})]}),u&&Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(y.a,{})})]})})})]})}))),gr={setErrorSnackMessage:V},fr=Object(s.b)(null,gr)((function(e){var t=e.closeDeleteModalAndRefresh,a=e.deleteOpen,i=e.selectedUser,r=e.setErrorSnackMessage,o=Object(c.useState)(!1),s=Object(b.a)(o,2),l=s[0],d=s[1];return null===i?Object(n.jsx)("div",{}):Object(n.jsxs)(pa.a,{open:a,onClose:function(){t(!1)},"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[Object(n.jsx)(Oa.a,{id:"alert-dialog-title",children:"Delete User"}),Object(n.jsxs)(ga.a,{children:[l&&Object(n.jsx)(y.a,{}),Object(n.jsxs)(Ua.a,{id:"alert-dialog-description",children:["Are you sure you want to delete user ",Object(n.jsx)("b",{children:i.accessKey}),"?"]})]}),Object(n.jsxs)(Wa.a,{children:[Object(n.jsx)(g.a,{onClick:function(){t(!1)},color:"primary",disabled:l,children:"Cancel"}),Object(n.jsx)(g.a,{onClick:function(){l||null!=i&&(d(!0),Oe.invoke("DELETE","/api/v1/users/".concat(i.accessKey),{id:i.id}).then((function(e){d(!1),t(!0)})).catch((function(e){d(!1),r(e)})))},color:"secondary",autoFocus:!0,children:"Delete"})]})]})})),xr={setModalErrorSnackMessage:q},vr=Object(s.b)(null,xr),yr=Object(w.a)((function(e){return Object(k.a)(Object(j.a)({strongText:{fontWeight:700},keyName:{marginLeft:5},buttonContainer:{textAlign:"right"}},Te))}))(vr((function(e){var t=e.open,a=e.checkedUsers,r=e.closeModalAndRefresh,o=e.classes,s=e.setModalErrorSnackMessage,l=Object(c.useState)(!1),d=Object(b.a)(l,2),u=d[0],j=d[1],m=Object(c.useState)(!1),h=Object(b.a)(m,2),p=h[0],O=h[1],f=Object(c.useState)([]),v=Object(b.a)(f,2),S=v[0],C=v[1];Object(c.useEffect)((function(){u&&(S.length>0?Oe.invoke("PUT","/api/v1/users-groups-bulk",{groups:S,users:a}).then((function(){j(!1),O(!0)})).catch((function(e){j(!1),s(e)})):(j(!1),s("You need to select at least one group to assign")))}),[u,j,r,S,a,s]);return Object(n.jsx)(va,{modalOpen:t,onClose:function(){r(p)},title:p?"The selected users were added to the following groups.":"Add Users to Group",children:p?Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsx)(Ja,{label:"Groups",content:S.join(", ")}),Object(n.jsx)(Ja,{label:"Users",content:a.join(", ")})]}),Object(n.jsx)("br",{}),Object(n.jsx)("br",{}),Object(n.jsx)("br",{})]}):Object(n.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){e.preventDefault(),j(!0)},children:Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:o.formScrollable,children:[Object(n.jsx)(Ja,{label:"Selected Users",content:a.join(", ")}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("br",{})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(mr,{selectedGroups:S,setSelectedGroups:C})})]}),Object(n.jsxs)(x.a,{item:!0,xs:12,className:o.buttonContainer,children:[Object(n.jsx)("button",{type:"button",color:"primary",className:o.clearButton,onClick:function(){C([])},children:"Clear"}),Object(n.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:u||S.length<1,children:"Save"})]}),u&&Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(y.a,{})})]})})})}))),Sr=Object(s.b)(null,{setModalErrorSnackMessage:q}),Cr=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({seeMore:{marginTop:e.spacing(3)},paper:{display:"flex",overflow:"auto",flexDirection:"column",paddingTop:15,boxShadow:"none"},addSideBar:{width:"320px",padding:"20px"},tableToolbar:{paddingLeft:e.spacing(2),paddingRight:e.spacing(0)},wrapCell:{maxWidth:"200px",whiteSpace:"normal",wordWrap:"break-word"},minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:"bold"}}},noFound:{textAlign:"center",padding:"10px 0"},tableContainer:{maxHeight:200},stickyHeader:{backgroundColor:"#fff"},actionsTitle:{fontWeight:600,color:"#000",fontSize:16,alignSelf:"center"},tableBlock:{marginTop:15},filterField:{width:375,fontWeight:600,"& .input":{"&::placeholder":{fontWeight:600,color:"#000"}}}},Fe),Re))}))(Sr((function(e){var t=e.classes,a=e.selectedPolicy,r=void 0===a?[]:a,o=e.setSelectedPolicy,s=e.setModalErrorSnackMessage,l=Object(c.useState)([]),d=Object(b.a)(l,2),u=d[0],j=d[1],m=Object(c.useState)(!1),h=Object(b.a)(m,2),p=h[0],O=h[1],g=Object(c.useState)(""),v=Object(b.a)(g,2),S=v[0],k=v[1],N=Object(c.useCallback)((function(){O(!0),Oe.invoke("GET","/api/v1/policies?limit=1000").then((function(e){var t=null===e.policies?[]:e.policies;O(!1),j(t.sort(ar))})).catch((function(e){O(!1),s(e)}))}),[s]);Object(c.useEffect)((function(){O(!0)}),[]),Object(c.useEffect)((function(){p&&N()}),[p,N]);var w=u.filter((function(e){return e.name.includes(S)}));return Object(n.jsx)(i.a.Fragment,{children:Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsxs)(C.a,{className:t.paper,children:[p&&Object(n.jsx)(y.a,{}),u.length>0?Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.actionsTray,children:[Object(n.jsx)("span",{className:t.actionsTitle,children:"Assign Policies"}),Object(n.jsx)(f.a,{placeholder:"Filter by Policy",className:t.filterField,id:"search-resource",label:"",InputProps:{startAdornment:Object(n.jsx)(et.a,{position:"start",children:Object(n.jsx)(at.a,{})})},onChange:function(e){k(e.target.value)}})]}),Object(n.jsx)(x.a,{item:!0,xs:12,className:t.tableBlock,children:Object(n.jsx)(ha,{columns:[{label:"Policy",elementKey:"name"}],onSelect:function(e){var t=e.target,a=t.value,n=t.checked,c=Object(Xe.a)(r);n?c.push(a):c=c.filter((function(e){return e!==a})),c=c.filter((function(e){return""!==e})),o(c)},selectedItems:r,isLoading:p,records:w,entityName:"Policies",idField:"name",customPaperHeight:t.multiSelectTable})})]}):Object(n.jsx)("div",{className:t.noFound,children:"No Policies Available"})]})})})}))),kr={setModalErrorSnackMessage:q},Nr=Object(s.b)(null,kr),wr=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({},Te),{},{buttonContainer:{textAlign:"right"}}))}))(Nr((function(e){var t=e.classes,a=e.closeModalAndRefresh,i=e.selectedUser,r=e.selectedGroup,o=e.setModalErrorSnackMessage,s=e.open,l=Object(c.useState)(!1),d=Object(b.a)(l,2),u=d[0],j=d[1],m=Object(c.useState)([]),h=Object(b.a)(m,2),p=h[0],O=h[1],f=Object(c.useState)([]),v=Object(b.a)(f,2),S=v[0],C=v[1];Object(c.useEffect)((function(){if(s){if(null!==r)return void(r&&Oe.invoke("GET","/api/v1/groups/".concat(r)).then((function(e){var t=Z()(e,"policy","");O(t.split(",")),C(t.split(","))})).catch((function(e){o(e),j(!1)})));var e=Z()(i,"policy",[]);O(e),C(e)}}),[s,r,i]);var k=Z()(i,"accessKey","");return Object(n.jsxs)(va,{onClose:function(){a()},modalOpen:s,title:"Set Policies",children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ja,{label:"Selected ".concat(null!==r?"Group":"User"),content:null!==r?r:k})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ja,{label:"Current Policy",content:p.join(", ")})}),Object(n.jsx)(Cr,{selectedPolicy:S,setSelectedPolicy:C}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("br",{})}),Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.buttonContainer,children:[Object(n.jsx)("button",{type:"button",color:"primary",className:t.clearButton,onClick:function(){C(p)},children:"Clear"}),Object(n.jsx)(g.a,{type:"button",variant:"contained",color:"primary",disabled:u,onClick:function(){var e="user",t=null;null!==r?(e="group",t=r):null!==i&&(t=i.accessKey),j(!0),Oe.invoke("PUT","/api/v1/set-policy/".concat(S),{entityName:t,entityType:e}).then((function(){j(!1),a()})).catch((function(e){j(!1),o(e)}))},children:"Save"})]}),u&&Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(y.a,{})})]})}))),Tr=Object(s.b)(null,{setModalErrorSnackMessage:q}),Er=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({buttonContainer:{textAlign:"right"}},Fe),Te),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))(Tr((function(e){var t=e.classes,a=e.open,i=e.selectedUser,r=e.closeModal,o=e.setModalErrorSnackMessage,s=Object(c.useState)(""),l=Object(b.a)(s,2),d=l[0],u=l[1],j=Object(c.useState)(""),m=Object(b.a)(j,2),h=m[0],p=m[1],O=Object(c.useState)(!1),f=Object(b.a)(O,2),v=f[0],S=f[1];return a?Object(n.jsx)(va,{title:"Change User Password",modalOpen:a,onClose:function(){u(""),p(""),r()},"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:Object(n.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){!function(e){if(e.preventDefault(),!v){S(!0);var t={selectedUser:String(null===i||void 0===i?void 0:i.accessKey),newSecretKey:d};Oe.invoke("POST","/api/v1/account/change-user-password",t).then((function(e){S(!1),u(""),p(""),r()})).catch((function(e){S(!1),u(""),p(""),o(e)}))}}(e)},children:Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.formScrollable,children:[Object(n.jsxs)("h3",{children:["Change password for ",null===i||void 0===i?void 0:i.accessKey]}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"new-password",name:"new-password",onChange:function(e){u(e.target.value)},label:"New Password",type:"password",value:d})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"re-new-password",name:"re-new-password",onChange:function(e){p(e.target.value)},label:"Type New Password Again",type:"password",value:h})})]}),Object(n.jsx)(x.a,{item:!0,xs:12,className:t.buttonContainer,children:Object(n.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:v||!(h.length>0&&d==h),children:"Save"})}),v&&Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(y.a,{})})]})})}):null}))),Ar={setErrorSnackMessage:V},_r=Object(s.b)(null,Ar),Ir=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({seeMore:{marginTop:e.spacing(3)},paper:{display:"flex",overflow:"auto",flexDirection:"column"},addSideBar:{width:"320px",padding:"20px"},tableToolbar:{paddingLeft:e.spacing(2),paddingRight:e.spacing(0)},wrapCell:{maxWidth:"200px",whiteSpace:"normal",wordWrap:"break-word"},minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:"bold"}}}},Fe),De),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))(_r((function(e){var t=e.classes,a=e.setErrorSnackMessage,r=Object(c.useState)([]),o=Object(b.a)(r,2),s=o[0],l=o[1],d=Object(c.useState)(!1),j=Object(b.a)(d,2),m=j[0],h=j[1],p=Object(c.useState)(!1),O=Object(b.a)(p,2),v=O[0],y=O[1],S=Object(c.useState)(!1),C=Object(b.a)(S,2),k=C[0],N=C[1],w=Object(c.useState)(null),T=Object(b.a)(w,2),E=T[0],A=T[1],_=Object(c.useState)(!1),I=Object(b.a)(_,2),M=I[0],F=I[1],D=Object(c.useState)(""),L=Object(b.a)(D,2),B=L[0],R=L[1],P=Object(c.useState)([]),z=Object(b.a)(P,2),K=z[0],U=z[1],W=Object(c.useState)(!1),V=Object(b.a)(W,2),G=V[0],q=V[1],H=Object(c.useState)(!1),Y=Object(b.a)(H,2),Q=(Y[0],Y[1],Object(c.useState)(!1)),Z=Object(b.a)(Q,2),J=Z[0],$=Z[1],X=Object(c.useCallback)((function(){h(!0),Oe.invoke("GET","/api/v1/users").then((function(e){var t=null===e.users?[]:e.users;h(!1),l(t.sort(tr))})).catch((function(e){h(!1),a(e)}))}),[h,l,a]);Object(c.useEffect)((function(){X()}),[X]);var ee=s.filter((function(e){return e.accessKey.includes(B)})),te=atob(localStorage.getItem("userLoggedIn")||""),ae=[{type:"view",onClick:function(e){u.push("/users/".concat(e.accessKey))}},{type:"edit",onClick:function(e){$(!0),A(e)}},{type:"delete",onClick:function(e){N(!0),A(e)},disableButtonFunction:function(e){return e===te}}];return Object(n.jsxs)(i.a.Fragment,{children:[v&&Object(n.jsx)(Or,{open:v,selectedUser:E,closeModalAndRefresh:function(){y(!1),X()}}),G&&Object(n.jsx)(wr,{open:G,selectedUser:E,selectedGroup:null,closeModalAndRefresh:function(){q(!1),X()}}),k&&Object(n.jsx)(fr,{deleteOpen:k,selectedUser:E,closeDeleteModalAndRefresh:function(e){!function(e){N(!1),e&&X()}(e)}}),M&&Object(n.jsx)(yr,{open:M,checkedUsers:K,closeModalAndRefresh:function(e){!function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];F(!1),e&&U([])}(e)}}),J&&Object(n.jsx)(Er,{open:J,closeModal:function(){return $(!1)},selectedUser:E}),Object(n.jsx)(qa,{label:"Users"}),Object(n.jsx)(x.a,{container:!0,children:Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.container,children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.actionsTray,children:[Object(n.jsx)(f.a,{placeholder:"Search Users",className:t.searchField,id:"search-resource",label:"",InputProps:{disableUnderline:!0,startAdornment:Object(n.jsx)(et.a,{position:"start",children:Object(n.jsx)(at.a,{})})},onChange:function(e){R(e.target.value)}}),Object(n.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(n.jsx)(ur.a,{}),disabled:K.length<=0,onClick:function(){K.length>0&&F(!0)},children:"Add to Group"}),Object(n.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(n.jsx)(lt,{}),onClick:function(){y(!0),A(null)},children:"Create User"})]}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("br",{})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(ha,{itemActions:ae,columns:[{label:"Access Key",elementKey:"accessKey"}],onSelect:function(e){var t=e.target,a=t.value,n=t.checked,c=Object(Xe.a)(K);return n?c.push(a):c=c.filter((function(e){return e!==a})),U(c),c},selectedItems:K,isLoading:m,records:ee,entityName:"Users",idField:"accessKey"})})]})})]})}))),Mr=a(47),Fr={setModalErrorSnackMessage:q},Dr=Object(s.b)(null,Fr),Lr=Object(w.a)((function(e){return Object(k.a)(Object(j.a)({strongText:{fontWeight:700},keyName:{marginLeft:5},buttonContainer:{textAlign:"right"}},Te))}))(Dr((function(e){var t=e.classes,a=e.closeModalAndRefresh,r=e.selectedUser,o=e.open,s=e.setModalErrorSnackMessage,l=Object(c.useState)(!1),d=Object(b.a)(l,2),u=d[0],j=d[1],m=Object(c.useState)(""),h=Object(b.a)(m,2),p=h[0],O=h[1],f=Object(c.useState)(""),v=Object(b.a)(f,2),S=v[0],C=v[1],k=Object(c.useState)(!1),N=Object(b.a)(k,2),w=N[0],T=N[1],E=Object(c.useState)([]),A=Object(b.a)(E,2),_=A[0],I=A[1],M=Object(c.useCallback)((function(){if(!r)return null;Oe.invoke("GET","/api/v1/users/".concat(r)).then((function(e){j(!1),O(e.accessKey),I(e.memberOf||[]),T("enabled"===e.status)})).catch((function(e){j(!1),s(e)}))}),[r,s]);Object(c.useEffect)((function(){null==r?(O(""),C(""),I([])):M()}),[r,M]);var F=""!==p.trim()&&(""!==S.trim()&&null===r||null!==r);return Object(n.jsx)(va,{onClose:function(){a()},modalOpen:o,title:"Set Groups",children:Object(n.jsx)(i.a.Fragment,{children:Object(n.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){e.preventDefault(),u||(j(!0),null!==r?Oe.invoke("PUT","/api/v1/users/".concat(r),{status:w?"enabled":"disabled",groups:_}).then((function(e){j(!1),a()})).catch((function(e){j(!1),s(e)})):Oe.invoke("POST","/api/v1/users",{accessKey:p,secretKey:S,groups:_}).then((function(e){j(!1),a()})).catch((function(e){j(!1),s(e)})))},children:Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsx)(x.a,{item:!0,xs:12,className:t.formScrollable,children:Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(mr,{selectedGroups:_,setSelectedGroups:function(e){I(e)}})})}),Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.buttonContainer,children:[Object(n.jsx)("button",{type:"button",color:"primary",className:t.clearButton,onClick:function(){null===r?(O(""),C(""),I([])):I([])},children:"Clear"}),Object(n.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:u||!F,children:"Save"})]}),u&&Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(y.a,{})})]})})})})}))),Br={setModalErrorSnackMessage:q},Rr=Object(s.b)(null,Br),Pr=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({},Te),{},{buttonContainer:{textAlign:"right"}}))}))(Rr((function(e){var t=e.classes,a=e.closeModalAndRefresh,i=e.selectedUser,r=e.currentPolicies,o=e.setModalErrorSnackMessage,s=e.open,l=Object(c.useState)(!1),d=Object(b.a)(l,2),u=d[0],j=d[1],m=Object(c.useState)([]),h=Object(b.a)(m,2),p=h[0],O=h[1],f=Object(c.useState)([]),v=Object(b.a)(f,2),S=v[0],C=v[1];return Object(c.useEffect)((function(){if(s){var e,t=[],a=Object(Mr.a)(r);try{for(a.s();!(e=a.n()).done;){var n=e.value;t.push(n.policy)}}catch(c){a.e(c)}finally{a.f()}O(t),C(t)}}),[s,i]),Object(n.jsxs)(va,{onClose:function(){a()},modalOpen:s,title:"Set Policies",children:[Object(n.jsx)(Cr,{selectedPolicy:S,setSelectedPolicy:C}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("br",{})}),Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.buttonContainer,children:[Object(n.jsx)("button",{type:"button",color:"primary",className:t.clearButton,onClick:function(){C(p)},children:"Clear"}),Object(n.jsx)(g.a,{type:"button",variant:"contained",color:"primary",disabled:u,onClick:function(){var e=i;j(!0),Oe.invoke("PUT","/api/v1/set-policy/".concat(S),{entityName:e,entityType:"user"}).then((function(){j(!1),a()})).catch((function(e){j(!1),o(e)}))},children:"Save"})]}),u&&Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(y.a,{})})]})}))),zr=a(993),Kr=Object(s.b)((function(e){return{session:e.console.session}}),{setErrorSnackMessage:V}),Ur=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({},De),Fe),{},{actionsTray:Object(j.a)(Object(j.a)({},Fe.actionsTray),{},{padding:"15px 0 0"})}))}))(Kr((function(e){var t=e.classes,a=e.user,r=e.setErrorSnackMessage,o=Object(c.useState)([]),s=Object(b.a)(o,2),l=s[0],d=s[1],u=Object(c.useState)(!1),j=Object(b.a)(u,2),m=j[0],h=j[1],p=Object(c.useState)(""),O=Object(b.a)(p,2),g=O[0],v=O[1],y=Object(c.useState)(!1),S=Object(b.a)(y,2),C=S[0],k=S[1],N=Object(c.useState)(!1),w=Object(b.a)(N,2),T=w[0],E=w[1],A=Object(c.useState)(null),_=Object(b.a)(A,2),I=_[0],M=_[1],F=Object(c.useState)(!1),D=Object(b.a)(F,2),L=D[0],B=D[1],R=Object(c.useState)(null),P=Object(b.a)(R,2),z=P[0],K=P[1],U=Object(c.useState)(!1),W=Object(b.a)(U,2);W[0],W[1];Object(c.useEffect)((function(){V()}),[]),Object(c.useEffect)((function(){m&&Oe.invoke("GET","/api/v1/users/".concat(a,"/service-accounts")).then((function(e){var t=e.sort(nr);h(!1),d(t)})).catch((function(e){r(e),h(!1)}))}),[m,h,d,r]);var V=function(){h(!0)},G=[{type:"delete",onClick:function(e){M(e),E(!0)}}],q=l.filter((function(e){return e.toLowerCase().includes(g.toLowerCase())}));return Object(n.jsxs)(i.a.Fragment,{children:[C&&Object(n.jsx)(Zi,{open:C,closeModalAndRefresh:function(e){!function(e){if(k(!1),V(),null!==e){var t={console:{accessKey:"".concat(e.accessKey),secretKey:"".concat(e.secretKey)}};K(t),B(!0)}}(e)}}),T&&Object(n.jsx)(Xi,{deleteOpen:T,selectedServiceAccount:I,closeDeleteModalAndRefresh:function(e){!function(e){E(!1),e&&V()}(e)}}),L&&Object(n.jsx)(er,{newServiceAccount:z,open:L,closeModal:function(){B(!1),K(null)},entity:"Service Account"}),Object(n.jsx)(x.a,{container:!0,children:Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.container,children:[Object(n.jsx)(x.a,{item:!0,xs:12,className:t.actionsTray,children:Object(n.jsx)(f.a,{placeholder:"Search Service Accounts",className:t.searchField,id:"search-resource",label:"",InputProps:{disableUnderline:!0,startAdornment:Object(n.jsx)(et.a,{position:"start",children:Object(n.jsx)(at.a,{})})},onChange:function(e){v(e.target.value)}})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("br",{})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(ha,{isLoading:m,records:q,entityName:"Service Accounts",idField:"",columns:[{label:"Service Account",elementKey:""}],itemActions:G})})]})})]})})));function Wr(e){return{id:"simple-tab-".concat(e),"aria-controls":"simple-tabpanel-".concat(e)}}var Vr,Gr={setErrorSnackMessage:V},qr=Object(s.b)(null,Gr),Hr=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({seeMore:{marginTop:e.spacing(3)},paper:{display:"flex",overflow:"auto",flexDirection:"column"},addSideBar:{width:"320px",padding:"20px"},tableToolbar:{paddingLeft:e.spacing(2),paddingRight:e.spacing(0)},wrapCell:{maxWidth:"200px",whiteSpace:"normal",wordWrap:"break-word"},minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:"bold"}}},fixedHeight:{height:165,minWidth:247,padding:"25px 28px","& svg":{maxHeight:18}},paperContainer:{padding:15,paddingLeft:50,display:"flex"},gridContainer:{display:"grid",gridTemplateColumns:"auto auto",gridGap:8,justifyContent:"flex-start",alignItems:"center","& div:not(.MuiCircularProgress-root)":{display:"flex",alignItems:"center"},"& div:nth-child(odd)":{justifyContent:"flex-end",fontWeight:700},"& div:nth-child(2n)":{minWidth:150}}},Fe),De),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))(qr((function(e){var t=e.classes,a=e.match,r=Object(c.useState)(0),o=Object(b.a)(r,2),s=o[0],l=o[1],d=Object(c.useState)(!1),m=Object(b.a)(d,2),h=m[0],p=m[1],O=Object(c.useState)(!1),f=Object(b.a)(O,2),v=f[0],y=f[1],S=Object(c.useState)(!1),k=Object(b.a)(S,2),N=k[0],w=k[1],T=Object(c.useState)(!1),E=Object(b.a)(T,2),A=E[0],_=E[1],I=Object(c.useState)(!1),M=Object(b.a)(I,2),F=M[0],D=M[1],L=Object(c.useState)([]),B=Object(b.a)(L,2),R=B[0],P=B[1],z=Object(c.useState)([]),K=Object(b.a)(z,2),U=K[0],W=K[1],V=Object(c.useState)([]),G=Object(b.a)(V,2),H=G[0],Y=G[1],Q=a.params.userName,Z=Object(c.useCallback)((function(){if(""===Q)return null;p(!0),Oe.invoke("GET","/api/v1/users/".concat(Q)).then((function(e){_(!1);var t=e.memberOf||[];P(t);var a,n=[],c=Object(Mr.a)(t);try{for(c.s();!(a=c.n()).done;){var i=a.value;n.push({group:i})}}catch(d){c.e(d)}finally{c.f()}W(n);var r,o=[],s=Object(Mr.a)(e.policy);try{for(s.s();!(r=s.n()).done;){var l=r.value;o.push({policy:l})}}catch(d){s.e(d)}finally{s.f()}Y(o),D("enabled"===e.status),p(!1)})).catch((function(e){_(!1),p(!1),q(e)}))}),[Q]);Object(c.useEffect)((function(){Z()}),[Z]);var J=atob(localStorage.getItem("userLoggedIn")||"");return Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsx)(qa,{label:"User: ".concat(Q)}),v&&Object(n.jsx)(Lr,{open:v,selectedUser:Q,closeModalAndRefresh:function(){y(!1),Z()}}),N&&Object(n.jsx)(Pr,{open:N,selectedUser:Q,currentPolicies:H,closeModalAndRefresh:function(){w(!1),Z()}}),Object(n.jsx)(x.a,{container:!0,children:Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.container,children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(x.a,{container:!0,spacing:2,children:Object(n.jsx)(x.a,{item:!0,children:Object(n.jsx)(C.a,{className:t.paperContainer,children:Object(n.jsxs)("div",{className:t.gridContainer,children:[Object(n.jsx)("div",{children:"Enabled:"}),Object(n.jsx)("div",{className:t.capitalizeFirst,children:Object(n.jsx)(za,{checked:F,value:"user_enabled",id:"user-status",name:"user-status",disabled:J===Q,onChange:function(e){var t;D(e.target.checked),t=e.target.checked,A||(_(!0),Oe.invoke("PUT","/api/v1/users/".concat(Q),{status:t?"enabled":"disabled",groups:R}).then((function(e){_(!1)})).catch((function(e){_(!1),q(e)})))},switchOnly:!0})})]})})})})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("br",{})}),Object(n.jsxs)(x.a,{container:!0,item:!0,xs:12,children:[Object(n.jsx)(x.a,{item:!0,xs:9,children:Object(n.jsxs)(nn.a,{value:s,onChange:function(e,t){l(t)},indicatorColor:"primary",textColor:"primary","aria-label":"cluster-tabs",variant:"scrollable",scrollButtons:"auto",children:[Object(n.jsx)(cn.a,Object(j.a)({label:"Groups"},Wr(0))),Object(n.jsx)(cn.a,Object(j.a)({label:"Service Accounts"},Wr(2))),Object(n.jsx)(cn.a,Object(j.a)({label:"Policies"},Wr(1)))]})}),Object(n.jsxs)(x.a,{item:!0,xs:3,className:t.actionsTray,children:[0===s&&Object(n.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(n.jsx)(lt,{}),size:"medium",onClick:function(){y(!0)},children:"Add to Groups"}),2===s&&Object(n.jsx)(c.Fragment,{children:Object(n.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(n.jsx)(zr.a,{}),size:"medium",onClick:function(){w(!0)},children:"Assign Policies"})})]})]}),Object(n.jsxs)(x.a,{item:!0,xs:12,children:[Object(n.jsx)(on,{index:0,value:s,children:Object(n.jsx)(ha,{columns:[{label:"Name",elementKey:"group"}],isLoading:h,records:U,entityName:"Groups",idField:"group"})}),Object(n.jsx)(on,{index:1,value:s,children:Object(n.jsx)(Ur,{user:Q})}),Object(n.jsx)(on,{index:2,value:s,children:Object(n.jsx)(ha,{itemActions:[{type:"view",onClick:function(e){u.push("/policies/".concat(e.policy))}}],columns:[{label:"Name",elementKey:"policy"}],isLoading:h,records:H,entityName:"Policies",idField:"policy"})})]})]})})]})}))),Yr=Object(s.b)((function(e){return{open:e.system.sidebarOpen}}),{setMenuOpen:z}),Qr=Object(l.g)(Yr((function(){return Object(n.jsx)(l.c,{history:u,children:Object(n.jsxs)(l.d,{children:[Object(n.jsx)(l.b,{path:"/users/:userName",component:Hr}),Object(n.jsx)(l.b,{path:"/",component:Ir}),Object(n.jsx)(l.b,{component:$e})]})})}))),Zr={setModalErrorSnackMessage:q},Jr=Object(s.b)(null,Zr),$r=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({seeMore:{marginTop:e.spacing(3)},paper:{display:"flex",overflow:"auto",flexDirection:"column",paddingTop:15,boxShadow:"none"},addSideBar:{width:"320px",padding:"20px"},tableToolbar:{paddingLeft:e.spacing(2),paddingRight:e.spacing(0)},wrapCell:{maxWidth:"200px",whiteSpace:"normal",wordWrap:"break-word"},minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:"bold"}}},noFound:{textAlign:"center",padding:"10px 0"},tableContainer:{maxHeight:200},stickyHeader:{backgroundColor:"#fff"},actionsTitle:{fontWeight:600,color:"#000",fontSize:16,alignSelf:"center"},tableBlock:{marginTop:15},filterField:{width:375,fontWeight:600,"& .input":{"&::placeholder":{fontWeight:600,color:"#000"}}}},Fe),Re))}))(Jr((function(e){var t=e.classes,a=e.selectedUsers,r=e.setSelectedUsers,o=e.editMode,s=void 0!==o&&o,l=e.setModalErrorSnackMessage,d=Object(c.useState)([]),u=Object(b.a)(d,2),j=u[0],m=u[1],h=Object(c.useState)(!1),p=Object(b.a)(h,2),O=p[0],g=p[1],v=Object(c.useState)(""),S=Object(b.a)(v,2),k=S[0],N=S[1],w=Object(c.useCallback)((function(){Oe.invoke("GET","/api/v1/users").then((function(e){var t=Z()(e,"users",[]);t||(t=[]),m(t.sort(tr)),g(!1)})).catch((function(e){l(e),g(!1)}))}),[l]);Object(c.useEffect)((function(){g(!0)}),[]),Object(c.useEffect)((function(){O&&w()}),[O,w]);var T=a||[],E=j.filter((function(e){return e.accessKey.includes(k)}));return Object(n.jsx)(i.a.Fragment,{children:Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsxs)(C.a,{className:t.paper,children:[O&&Object(n.jsx)(y.a,{}),null!=j&&j.length>0?Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.actionsTray,children:[Object(n.jsx)("span",{className:t.actionsTitle,children:s?"Edit Members":"Assign Users"}),Object(n.jsx)(f.a,{placeholder:"Filter Users",className:t.filterField,id:"search-resource",label:"",InputProps:{startAdornment:Object(n.jsx)(et.a,{position:"start",children:Object(n.jsx)(at.a,{})})},onChange:function(e){N(e.target.value)}})]}),Object(n.jsx)(x.a,{item:!0,xs:12,className:t.tableBlock,children:Object(n.jsx)(ha,{columns:[{label:"Access Key",elementKey:"accessKey"}],onSelect:function(e){var t=e.target,a=t.value,n=t.checked,c=Object(Xe.a)(T);return n?c.push(a):c=c.filter((function(e){return e!==a})),r(c),c},selectedItems:T,isLoading:O,records:E,entityName:"Users",idField:"accessKey",customPaperHeight:t.multiSelectTable})})]}):Object(n.jsx)("div",{className:t.noFound,children:"No Users Available"})]})})})}))),Xr={setModalErrorSnackMessage:q},eo=Object(s.b)(null,Xr),to=Object(w.a)((function(e){return Object(k.a)(Object(j.a)({strongText:{fontWeight:700},keyName:{marginLeft:5},buttonContainer:{textAlign:"right"}},Te))}))(eo((function(e){var t=e.open,a=e.selectedGroup,r=e.closeModalAndRefresh,o=e.classes,s=e.setModalErrorSnackMessage,l=Object(c.useState)(""),d=Object(b.a)(l,2),u=d[0],j=d[1],m=Object(c.useState)(!1),h=Object(b.a)(m,2),p=h[0],O=h[1],f=Object(c.useState)(!1),v=Object(b.a)(f,2),S=v[0],C=v[1],k=Object(c.useState)([]),N=Object(b.a)(k,2),w=N[0],T=N[1],E=Object(c.useState)(!1),A=Object(b.a)(E,2),_=A[0],I=A[1],M=Object(c.useState)(!1),F=Object(b.a)(M,2),D=F[0],L=F[1];Object(c.useEffect)((function(){null!==a?I(!0):(j(""),T([]))}),[a]),Object(c.useEffect)((function(){L(""!==u.trim())}),[u,w]),Object(c.useEffect)((function(){if(S){null!==a?Oe.invoke("PUT","/api/v1/groups/".concat(u),{group:u,members:w,status:p?"enabled":"disabled"}).then((function(e){C(!1),r()})).catch((function(e){C(!1),s(e)})):Oe.invoke("POST","/api/v1/groups",{group:u,members:w}).then((function(e){C(!1),r()})).catch((function(e){C(!1),s(e)}))}}),[S,u,w,p,a,r,s]),Object(c.useEffect)((function(){if(a&&_){Oe.invoke("GET","/api/v1/groups/".concat(a)).then((function(e){O("enabled"===e.status),j(e.name),T(e.members)})).catch((function(e){s(e),I(!1)}))}}),[_,a,s]);return Object(n.jsxs)(va,{modalOpen:t,onClose:r,title:null!==a?"Edit Group":"Create Group",children:[null!==a&&Object(n.jsx)("div",{className:o.floatingEnabled,children:Object(n.jsx)(za,{indicatorLabels:["Enabled","Disabled"],checked:p,value:"group_enabled",id:"group-status",name:"group-status",onChange:function(e){O(e.target.checked)},switchOnly:!0})}),Object(n.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){e.preventDefault(),C(!0)},children:Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:o.formScrollable,children:[null===a?Object(n.jsx)(i.a.Fragment,{children:Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"group-name",name:"group-name",label:"Group Name",value:u,onChange:function(e){j(e.target.value)}})})}):Object(n.jsx)(i.a.Fragment,{children:Object(n.jsx)(Ja,{label:"Group Name",content:a})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)($r,{selectedUsers:w,setSelectedUsers:T,editMode:null!==a})})]}),Object(n.jsxs)(x.a,{item:!0,xs:12,className:o.buttonContainer,children:[Object(n.jsx)("button",{type:"button",color:"primary",className:o.clearButton,onClick:function(){null===a&&j(""),T([])},children:"Clear"}),Object(n.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:S||!D,children:"Save"})]}),S&&Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(y.a,{})})]})})]})}))),ao={setErrorSnackMessage:V},no=Object(s.b)(null,ao),co=no((function(e){var t=e.selectedGroup,a=e.deleteOpen,r=e.closeDeleteModalAndRefresh,o=e.setErrorSnackMessage,s=Object(c.useState)(!1),l=Object(b.a)(s,2),d=l[0],u=l[1];Object(c.useEffect)((function(){if(d){t&&Oe.invoke("DELETE","/api/v1/groups/".concat(t)).then((function(){u(!1),r(!0)})).catch((function(e){u(!1),o(e)}))}}),[d,t,r,o]);var j=function(){r(!1)};return Object(n.jsx)(i.a.Fragment,{children:Object(n.jsxs)(pa.a,{open:a,onClose:j,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[Object(n.jsx)(Oa.a,{id:"alert-dialog-title",children:"Delete User"}),Object(n.jsxs)(ga.a,{children:[d&&Object(n.jsx)(y.a,{}),Object(n.jsxs)(Ua.a,{id:"alert-dialog-description",children:["Are you sure you want to delete group ",Object(n.jsx)("b",{children:t}),"?"]})]}),Object(n.jsxs)(Wa.a,{children:[Object(n.jsx)(g.a,{onClick:j,color:"primary",disabled:d,children:"Cancel"}),Object(n.jsx)(g.a,{onClick:function(){u(!0)},color:"secondary",autoFocus:!0,children:"Delete"})]})]})})})),io={setErrorSnackMessage:V},ro=Object(s.b)(null,io),oo=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({seeMore:{marginTop:e.spacing(3)},paper:{display:"flex",overflow:"auto",flexDirection:"column"},addSideBar:{width:"320px",padding:"20px"},tableToolbar:{paddingLeft:e.spacing(2),paddingRight:e.spacing(0)},wrapCell:{maxWidth:"200px",whiteSpace:"normal",wordWrap:"break-word"},minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:"bold"}}}},Fe),De),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))(ro((function(e){var t=e.classes,a=e.setErrorSnackMessage,r=Object(c.useState)(!1),o=Object(b.a)(r,2),s=o[0],l=o[1],d=Object(c.useState)(null),u=Object(b.a)(d,2),j=u[0],m=u[1],h=Object(c.useState)(!1),p=Object(b.a)(h,2),O=p[0],v=p[1],y=Object(c.useState)(!1),S=Object(b.a)(y,2),C=S[0],k=S[1],N=Object(c.useState)([]),w=Object(b.a)(N,2),T=w[0],E=w[1],A=Object(c.useState)(""),_=Object(b.a)(A,2),I=_[0],M=_[1],F=Object(c.useState)(!1),D=Object(b.a)(F,2),L=D[0],B=D[1];Object(c.useEffect)((function(){k(!0)}),[]),Object(c.useEffect)((function(){k(!0)}),[]),Object(c.useEffect)((function(){if(C){Oe.invoke("GET","/api/v1/groups").then((function(e){var t=[];null!==e.groups&&(t=e.groups.sort(nr)),E(t),k(!1)})).catch((function(e){a(e),k(!1)}))}}),[C,a]);var R=T.filter((function(e){return e.includes(I)})),P=[{type:"view",onClick:function(e){l(!0),m(e)}},{type:"description",onClick:function(e){B(!0),m(e)}},{type:"delete",onClick:function(e){v(!0),m(e)}}];return Object(n.jsxs)(i.a.Fragment,{children:[s&&Object(n.jsx)(to,{open:s,selectedGroup:j,closeModalAndRefresh:function(){l(!1),k(!0)}}),O&&Object(n.jsx)(co,{deleteOpen:O,selectedGroup:j,closeDeleteModalAndRefresh:function(e){v(!1),e&&k(!0)}}),B&&Object(n.jsx)(wr,{open:L,selectedGroup:j,selectedUser:null,closeModalAndRefresh:function(){B(!1)}}),Object(n.jsx)(qa,{label:"Groups"}),Object(n.jsx)(x.a,{container:!0,children:Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.container,children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.actionsTray,children:[Object(n.jsx)(f.a,{placeholder:"Search Groups",className:t.searchField,id:"search-resource",label:"",InputProps:{disableUnderline:!0,startAdornment:Object(n.jsx)(et.a,{position:"start",children:Object(n.jsx)(at.a,{})})},onChange:function(e){M(e.target.value)}}),Object(n.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(n.jsx)(lt,{}),onClick:function(){m(null),l(!0)},children:"Create Group"})]}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("br",{})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(ha,{itemActions:P,columns:[{label:"Name",elementKey:""}],isLoading:C,records:R,entityName:"Groups",idField:""})})]})})]})}))),so="notify_postgres",lo="notify_mysql",uo="notify_kafka",bo="notify_amqp",jo="notify_mqtt",mo="notify_redis",ho="notify_nats",po="notify_elasticsearch",Oo="notify_webhooks",go="notify_nsq",fo=[{configuration_id:"region",configuration_label:"Edit Region Configuration"},{configuration_id:"cache",configuration_label:"Edit Cache Configuration"},{configuration_id:"compression",configuration_label:"Edit Compression Configuration"},{configuration_id:"etcd",configuration_label:"Edit Etcd Configuration"},{configuration_id:"identity_openid",configuration_label:"Edit Identity Openid Configuration"},{configuration_id:"identity_ldap",configuration_label:"Edit Identity LDAP Configuration"},{configuration_id:"logger_webhook",configuration_label:"Edit Logger Webhook Configuration"},{configuration_id:"audit_webhook",configuration_label:"Edit Audit Webhook Configuration"}],xo={region:[{name:"name",required:!0,label:"Server Location",tooltip:'Name of the location of the server e.g. "us-west-rack2"',type:"string",placeholder:"e.g. us-west-rack-2"},{name:"comment",required:!1,label:"Comment",tooltip:"You can add a comment to this setting",type:"comment",placeholder:"Enter Comment"}],cache:[{name:"drives",required:!0,label:"Drives",tooltip:'Mountpoints e.g. "/optane1" or "/optane2", you can write one per field',type:"csv",placeholder:"Enter Mount Point"},{name:"expiry",required:!1,label:"Expiry",tooltip:'Cache expiry duration in days e.g. "90"',type:"number",placeholder:"Enter Number of Days"},{name:"quota",required:!1,label:"Quota",tooltip:'Limit cache drive usage in percentage e.g. "90"',type:"number",placeholder:"Enter in %"},{name:"exclude",required:!1,label:"Exclude",tooltip:'Wildcard exclusion patterns e.g. "bucket/*.tmp" or "*.exe", you can write one per field',type:"csv",placeholder:"Enter Wildcard Exclusion Patterns"},{name:"after",required:!1,label:"After",tooltip:"Minimum number of access before caching an object",type:"number",placeholder:"Enter Number of Attempts"},{name:"watermark_low",required:!1,label:"Watermark Low",tooltip:"Watermark Low",type:"number",placeholder:"Enter Watermark Low"},{name:"watermark_high",required:!1,label:"Watermark High",tooltip:"Watermark High",type:"number",placeholder:"Enter Watermark High"},{name:"comment",required:!1,label:"Comment",tooltip:"You can add a comment to this setting",type:"comment",multiline:!0,placeholder:"Enter Comment"}],compression:[{name:"extensions",required:!1,label:"Extensions",tooltip:'Extensions to compress e.g. ".txt",".log" or ".csv", you can write one per field',type:"csv",placeholder:"Enter an Extension",withBorder:!0},{name:"mime_types",required:!1,label:"Mime Types",tooltip:'Mime types e.g. "text/*","application/json" or "application/xml", you can write one per field',type:"csv",placeholder:"Enter a Mime Type",withBorder:!0}],etcd:[{name:"endpoints",required:!0,label:"Endpoints",tooltip:'List of etcd endpoints e.g. "http://localhost:2379", you can write one per field',type:"csv",placeholder:"Enter Endpoint"},{name:"path_prefix",required:!1,label:"Path Prefix",tooltip:'namespace prefix to isolate tenants e.g. "customer1/"',type:"string",placeholder:"Enter Path Prefix"},{name:"coredns_path",required:!1,label:"Coredns Path",tooltip:'Shared bucket DNS records, default is "/skydns"',type:"string",placeholder:"Enter Coredns Path"},{name:"client_cert",required:!1,label:"Client Cert",tooltip:"Client cert for mTLS authentication",type:"string",placeholder:"Enter Client Cert"},{name:"client_cert_key",required:!1,label:"Client Cert Key",tooltip:"Client cert key for mTLS authentication",type:"string",placeholder:"Enter Client Cert Key"},{name:"comment",required:!1,label:"Comment",tooltip:"You can add a comment to this setting",type:"comment",multiline:!0,placeholder:"Enter Comment"}],identity_openid:[{name:"config_url",required:!1,label:"Config URL",tooltip:"Config URL for Client ID configuration",type:"string",placeholder:"Enter Config URL"},{name:"client_id",required:!1,label:"Client ID",type:"string",placeholder:"Enter Client ID"},{name:"claim_name",required:!1,label:"Claim Name",tooltip:"Claim Name",type:"string",placeholder:"Enter Claim Name"},{name:"claim_prefix",required:!1,label:"Claim Prefix",tooltip:"Claim Prefix",type:"string",placeholder:"Enter Claim Prefix"}],identity_ldap:[{name:"server_addr",required:!0,label:"Server Addr",tooltip:'AD/LDAP server address e.g. "myldapserver.com:636"',type:"string",placeholder:"Enter Server Address"},{name:"username_format",required:!0,label:"Username Format",tooltip:'List of username bind DNs e.g. "uid=%s","cn=accounts","dc=myldapserver" or "dc=com", you can write one per field',type:"csv",placeholder:"Enter Username Format"},{name:"username_search_filter",required:!0,label:"Username Search Filter",tooltip:'User search filter, for example "(cn=%s)" or "(sAMAccountName=%s)" or "(uid=%s)"',type:"string",placeholder:"Enter Username Search Filter"},{name:"group_search_filter",required:!0,label:"Group Search Filter",tooltip:'Search filter for groups e.g. "(&(objectclass=groupOfNames)(memberUid=%s))"',type:"string",placeholder:"Enter Group Search Filter"},{name:"username_search_base_dn",required:!1,label:"Username Search Base DN",tooltip:"List of username search DNs, you can write one per field",type:"csv",placeholder:"Enter Username Search Base DN"},{name:"group_name_attribute",required:!1,label:"Group Name Attribute",tooltip:'Search attribute for group name e.g. "cn"',type:"string",placeholder:"Enter Group Name Attribute"},{name:"sts_expiry",required:!1,label:"STS Expiry",tooltip:'temporary credentials validity duration in s,m,h,d. Default is "1h"',type:"string",placeholder:"Enter STS Expiry"},{name:"tls_skip_verify",required:!1,label:"TLS Skip Verify",tooltip:'Trust server TLS without verification, defaults to "off" (verify)',type:"on|off"},{name:"server_insecure",required:!1,label:"Server Insecure",tooltip:'Allow plain text connection to AD/LDAP server, defaults to "off"',type:"on|off"},{name:"comment",required:!1,label:"Comment",tooltip:"Optionally add a comment to this setting",type:"comment",placeholder:"Enter Comment"}],logger_webhook:[{name:"endpoint",required:!0,label:"Endpoint",type:"string",placeholder:"Enter Endpoint"},{name:"auth_token",required:!0,label:"Auth Token",type:"string",placeholder:"Enter Auth Token"}],audit_webhook:[{name:"endpoint",required:!0,label:"Endpoint",type:"string",placeholder:"Enter Endpoint"},{name:"auth_token",required:!0,label:"Auth Token",type:"string",placeholder:"Enter Auth Token"}]},vo=[{name:"queue-dir",label:"Queue Directory",required:!0,tooltip:"staging dir for undelivered messages e.g. '/home/events'",type:"string",placeholder:"Enter Queue Directory"},{name:"queue-limit",label:"Queue Limit",required:!1,tooltip:"maximum limit for undelivered messages, defaults to '10000'",type:"number",placeholder:"Enter Queue Limit"},{name:"comment",label:"Comment",required:!1,type:"comment",placeholder:"Enter Comment"}],yo=(Vr={},Object(ve.a)(Vr,uo,[{name:"brokers",label:"Brokers",required:!0,tooltip:"Comma separated list of Kafka broker addresses",type:"string",placeholder:"Enter Brokers"},{name:"topic",label:"Topic",tooltip:"Kafka topic used for bucket notifications",type:"string",placeholder:"Enter Topic"},{name:"sasl_username",label:"SASL Username",tooltip:"Username for SASL/PLAIN or SASL/SCRAM authentication",type:"string",placeholder:"Enter SASL Username"},{name:"sasl_password",label:"SASL Password",tooltip:"Password for SASL/PLAIN or SASL/SCRAM authentication",type:"string",placeholder:"Enter SASL Password"},{name:"sasl_mechanism",label:"SASL Mechanism",tooltip:"SASL authentication mechanism, default 'PLAIN'",type:"string"},{name:"tls_client_auth",label:"TLS Client Auth",tooltip:"Client Auth determines the Kafka server's policy for TLS client auth",type:"string",placeholder:"Enter TLS Client Auth"},{name:"sasl",label:"SASL",tooltip:"Set to 'on' to enable SASL authentication",type:"on|off"},{name:"tls",label:"TLS",tooltip:"Set to 'on' to enable TLS",type:"on|off"},{name:"tls_skip_verify",label:"TLS skip verify",tooltip:'Trust server TLS without verification, defaults to "on" (verify)',type:"on|off"},{name:"client_tls_cert",label:"client TLS cert",tooltip:"Path to client certificate for mTLS auth",type:"path",placeholder:"Enter TLS Client Cert"},{name:"client_tls_key",label:"client TLS key",tooltip:"Path to client key for mTLS auth",type:"path",placeholder:"Enter TLS Client Key"},{name:"version",label:"Version",tooltip:"Specify the version of the Kafka cluster e.g '2.2.0'",type:"string",placeholder:"Enter Kafka Version"}].concat(vo)),Object(ve.a)(Vr,bo,[{name:"url",required:!0,label:"URL",tooltip:"AMQP server endpoint e.g. `amqp://myuser:mypassword@localhost:5672`",type:"url"},{name:"exchange",label:"Exchange",tooltip:"Name of the AMQP exchange",type:"string",placeholder:"Enter Exchange"},{name:"exchange_type",label:"Exchange Type",tooltip:"AMQP exchange type",type:"string",placeholder:"Enter Exchange Type"},{name:"routing_key",label:"Routing Key",tooltip:"Routing key for publishing",type:"string",placeholder:"Enter Routing Key"},{name:"mandatory",label:"Mandatory",tooltip:"Quietly ignore undelivered messages when set to 'off', default is 'on'",type:"on|off"},{name:"durable",label:"Durable",tooltip:"Persist queue across broker restarts when set to 'on', default is 'off'",type:"on|off"},{name:"no_wait",label:"No Wait",tooltip:"Non-blocking message delivery when set to 'on', default is 'off'",type:"on|off"},{name:"internal",label:"Internal",tooltip:"Set to 'on' for exchange to be not used directly by publishers, but only when bound to other exchanges",type:"on|off"},{name:"auto_deleted",label:"Auto Deleted",tooltip:"Auto delete queue when set to 'on', when there are no consumers",type:"on|off"},{name:"delivery_mode",label:"Delivery Mode",tooltip:"Set to '1' for non-persistent or '2' for persistent queue",type:"number",placeholder:"Enter Delivery Mode"}].concat(vo)),Object(ve.a)(Vr,mo,[{name:"address",required:!0,label:"Address",tooltip:"Redis server's address. For example: `localhost:6379`",type:"address",placeholder:"Enter Address"},{name:"key",required:!0,label:"Key",tooltip:"Redis key to store/update events, key is auto-created",type:"string",placeholder:"Enter Key"},{name:"password",label:"Password",tooltip:"Redis server password",type:"string",placeholder:"Enter Password"}].concat(vo)),Object(ve.a)(Vr,jo,[{name:"broker",required:!0,label:"Broker",tooltip:"MQTT server endpoint e.g. `tcp://localhost:1883`",type:"uri",placeholder:"Enter Brokers"},{name:"topic",required:!0,label:"Topic",tooltip:"name of the MQTT topic to publish",type:"string",placeholder:"Enter Topic"},{name:"username",label:"Username",tooltip:"MQTT username",type:"string",placeholder:"Enter Username"},{name:"password",label:"Password",tooltip:"MQTT password",type:"string",placeholder:"Enter Password"},{name:"qos",label:"QOS",tooltip:"Set the quality of service priority, defaults to '0'",type:"number",placeholder:"Enter QOS"},{name:"keep_alive_interval",label:"Keep Alive Interval",tooltip:"Keep-alive interval for MQTT connections in s,m,h,d",type:"duration",placeholder:"Enter Keep Alive Internal"},{name:"reconnect_interval",label:"Reconnect Interval",tooltip:"Reconnect interval for MQTT connections in s,m,h,d",type:"duration",placeholder:"Enter Reconnect Interval"}].concat(vo)),Object(ve.a)(Vr,ho,[{name:"address",required:!0,label:"Address",tooltip:"NATS server address e.g. '0.0.0.0:4222'",type:"address",placeholder:"Enter Address"},{name:"subject",required:!0,label:"Subject",tooltip:"NATS subscription subject",type:"string",placeholder:"Enter NATS Subject"},{name:"username",label:"Username",tooltip:"NATS username",type:"string",placeholder:"Enter NATS Username"},{name:"password",label:"Password",tooltip:"NATS password",type:"string",placeholder:"Enter NATS password"},{name:"token",label:"Token",tooltip:"NATS token",type:"string",placeholder:"Enter NATS token"},{name:"tls",label:"TLS",tooltip:"Set to 'on' to enable TLS",type:"on|off"},{name:"tls_skip_verify",label:"TLS Skip Verify",tooltip:'Trust server TLS without verification, defaults to "on" (verify)',type:"on|off"},{name:"ping_interval",label:"Ping Interval",tooltip:"Client ping commands interval in s,m,h,d. Disabled by default",type:"duration",placeholder:"Enter Ping Interval"},{name:"streaming",label:"Streaming",tooltip:"Set to 'on', to use streaming NATS server",type:"on|off"},{name:"streaming_async",label:"Streaming async",tooltip:"Set to 'on', to enable asynchronous publish",type:"on|off"},{name:"streaming_max_pub_acks_in_flight",label:"Streaming max publish ACKS in flight",tooltip:"Number of messages to publish without waiting for ACKs",type:"number",placeholder:"Enter Streaming in flight value"},{name:"streaming_cluster_id",label:"Streaming Cluster ID",tooltip:"Unique ID for NATS streaming cluster",type:"string",placeholder:"Enter Streaming Cluster ID"},{name:"cert_authority",label:"Cert Authority",tooltip:"Path to certificate chain of the target NATS server",type:"string",placeholder:"Enter Cert Authority"},{name:"client_cert",label:"Client Cert",tooltip:"Client cert for NATS mTLS auth",type:"string",placeholder:"Enter Client Cert"},{name:"client_key",label:"Client Key",tooltip:"Client cert key for NATS mTLS auth",type:"string",placeholder:"Enter Client Key"}].concat(vo)),Object(ve.a)(Vr,po,[{name:"url",required:!0,label:"URL",tooltip:"Elasticsearch server's address, with optional authentication info",type:"url",placeholder:"Enter URL"},{name:"index",required:!0,label:"Index",tooltip:"Elasticsearch index to store/update events, index is auto-created",type:"string",placeholder:"Enter Index"},{name:"format",required:!0,label:"Format",tooltip:"'namespace' reflects current bucket/object list and 'access' reflects a journal of object operations, defaults to 'namespace'",type:"enum",placeholder:"Enter Format"}].concat(vo)),Object(ve.a)(Vr,Oo,[{name:"endpoint",required:!0,label:"Endpoint",tooltip:"webhook server endpoint e.g. http://localhost:8080/minio/events",type:"url",placeholder:"Enter Endpoint"},{name:"auth_token",label:"Auth Token",tooltip:"opaque string or JWT authorization token",type:"string",placeholder:"Enter auth_token"}].concat(vo)),Object(ve.a)(Vr,go,[{name:"nsqd_address",required:!0,label:"NSQD Address",tooltip:"NSQ server address e.g. '127.0.0.1:4150'",type:"address",placeholder:"Enter nsqd_address"},{name:"topic",required:!0,label:"Topic",tooltip:"NSQ topic",type:"string",placeholder:"Enter Topic"},{name:"tls",label:"TLS",tooltip:"set to 'on' to enable TLS",type:"on|off"},{name:"tls_skip_verify",label:"TLS Skip Verify",tooltip:'trust server TLS without verification, defaults to "on" (verify)',type:"on|off"}].concat(vo)),Vr),So=function(e){return e.filter((function(e){return""!==e.value}))},Co=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({},we),Ee),{},{inputWithBorder:{border:"1px solid #EAEAEA",padding:15,height:150,overflowY:"auto",position:"relative",marginTop:15},labelContainer:{display:"flex"}}))}))((function(e){var t=e.elements,a=e.name,r=e.label,o=e.tooltip,s=void 0===o?"":o,l=e.commonPlaceholder,d=void 0===l?"":l,u=e.onChange,j=e.withBorder,m=void 0!==j&&j,h=e.classes,p=Object(c.useState)([""]),O=Object(b.a)(p,2),g=O[0],f=O[1],v=Object(c.createRef)();Object(c.useEffect)((function(){if(1===g.length&&""===g[0]&&t&&""!==t){var e=t.split(",");e.push(""),f(e)}}),[t,g]),Object(c.useEffect)((function(){if(g.length>1){var e=v.current;e&&e.scrollIntoView(!1)}}),[g,v]);var y=Object(c.useRef)(!0);Object(c.useLayoutEffect)((function(){y.current?y.current=!1:C()}),[g]);var S=function(e){e.persist();var t=Object(Xe.a)(g);t[Z()(e.target,"dataset.index",0)]=e.target.value,f(t)},C=Ln()((function(){var e=g.filter((function(e){return""!==e.trim()})).join(",");u(e)}),500),k=g.map((function(e,t){return Object(n.jsx)(Ca,{id:"".concat(a,"-").concat(t.toString()),label:"",name:"".concat(a,"-").concat(t.toString()),value:g[t],onChange:S,index:t,placeholder:d,overlayIcon:t===g.length-1?Object(n.jsx)(Pn,{}):null,overlayAction:function(){!function(e){if(""!==e[e.length-1].trim()){var t=Object(Xe.a)(e);t.push(""),f(t)}}(g)}},"csv-".concat(a,"-").concat(t.toString()))}));return Object(n.jsx)(i.a.Fragment,{children:Object(n.jsxs)(x.a,{item:!0,xs:12,className:h.fieldContainer,children:[Object(n.jsxs)(sa.a,{className:h.inputLabel,children:[Object(n.jsx)("span",{children:r}),""!==s&&Object(n.jsx)("div",{className:h.tooltipContainer,children:Object(n.jsx)(la.a,{title:s,placement:"top-start",children:Object(n.jsx)("div",{children:Object(n.jsx)(da,{className:h.tooltip})})})})]}),Object(n.jsxs)(x.a,{item:!0,xs:12,className:"".concat(m?h.inputWithBorder:""),children:[k,Object(n.jsx)("div",{ref:v})]})]})})})),ko=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({},we),Ee),{},{inputLabel:Object(j.a)(Object(j.a)({},we.inputLabel),{},{marginBottom:16,fontSize:14}),textBoxContainer:{flexGrow:1,position:"relative"},errorState:{color:"#b53b4b",fontSize:14,position:"absolute",top:7,right:7},cssOutlinedInput:{borderColor:"#9C9C9C",padding:16},rootContainer:{"& .MuiOutlinedInput-inputMultiline":Object(j.a)(Object(j.a)({},we.inputLabel),{},{fontSize:13,minHeight:150})}}))}))((function(e){var t=e.label,a=e.onChange,c=e.value,r=e.id,o=e.name,s=e.disabled,l=void 0!==s&&s,d=e.tooltip,u=void 0===d?"":d,b=e.index,j=void 0===b?0:b,m=e.error,h=void 0===m?"":m,p=e.required,O=void 0!==p&&p,g=e.placeholder,v=void 0===g?"":g,y=e.classes,S={"data-index":j};return Object(n.jsx)(i.a.Fragment,{children:Object(n.jsxs)(x.a,{item:!0,xs:12,className:"".concat(y.fieldContainer," ").concat(""!==h?y.errorInField:""),children:[""!==t&&Object(n.jsxs)(sa.a,{htmlFor:r,className:y.inputLabel,children:[Object(n.jsxs)("span",{children:[t,O?"*":""]}),""!==u&&Object(n.jsx)("div",{className:y.tooltipContainer,children:Object(n.jsx)(la.a,{title:u,placement:"top-start",children:Object(n.jsx)("div",{children:Object(n.jsx)(da,{className:y.tooltip})})})})]}),Object(n.jsx)("div",{className:y.textBoxContainer,children:Object(n.jsx)(f.a,{id:r,name:o,fullWidth:!0,value:c,disabled:l,onChange:a,multiline:!0,inputProps:S,error:""!==h,helperText:h,placeholder:v,InputLabelProps:{shrink:!0},InputProps:{classes:{notchedOutline:y.cssOutlinedInput,root:y.rootContainer}},variant:"outlined"})})]})})})),No=function(e,t,a){var n="on|off"===t?"false":"";if(a.length>0){var c=a.find((function(t){return t.key===e}));c&&(n=c.value)}return n},wo=Object(w.a)((function(e){return Object(k.a)(Object(j.a)({},Te))}))((function(e){var t=e.onChange,a=e.fields,i=e.defaultVals,r=(e.classes,Object(c.useState)([])),o=Object(b.a)(r,2),s=o[0],l=o[1],d=a||[],u=i||[];Object(c.useEffect)((function(){var e=[];a.forEach((function(t){var a={key:t.name,value:No(t.name,t.type,u)};e.push(a)})),l(e)}),[a,i]),Object(c.useEffect)((function(){t(s)}),[s]);var j=function(e,t,a){var n=Object(Xe.a)(s);n[a]={key:e,value:t},l(n)},m=function(e,t){switch(e.type){case"on|off":var a=s[t]?s[t].value:"false";return Object(n.jsx)(za,{indicatorLabels:["On","Off"],onChange:function(a){var n=a.target.checked?"true":"false";j(e.name,n,t)},id:e.name,name:e.name,label:e.label,value:"switch_on",tooltip:e.tooltip,checked:"true"===a});case"csv":return Object(n.jsx)(Co,{elements:s[t]?s[t].value:"",label:e.label,name:e.name,onChange:function(a){return j(e.name,a,t)},tooltip:e.tooltip,commonPlaceholder:e.placeholder,withBorder:!!e.withBorder});case"comment":return Object(n.jsx)(ko,{id:e.name,name:e.name,label:e.label,tooltip:e.tooltip,value:s[t]?s[t].value:"",onChange:function(a){return j(e.name,a.target.value,t)},placeholder:e.placeholder});default:return Object(n.jsx)(Ca,{id:e.name,name:e.name,label:e.label,tooltip:e.tooltip,value:s[t]?s[t].value:"",onChange:function(a){return j(e.name,a.target.value,t)},multiline:!!e.multiline,placeholder:e.placeholder})}};return Object(n.jsx)(x.a,{container:!0,children:Object(n.jsx)(x.a,{xs:12,item:!0,children:d.map((function(e,t){return Object(n.jsx)(c.Fragment,{children:Object(n.jsx)(x.a,{item:!0,xs:12,children:m(e,t)})},e.name)}))})})})),To={serverNeedsRestart:K,setErrorSnackMessage:V},Eo=Object(s.b)(null,To),Ao=Eo(Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({},we),Pe),{},{strongText:{fontWeight:700},keyName:{marginLeft:5},buttonContainer:{textAlign:"right"},logoButton:{height:"80px"},customTitle:Object(j.a)(Object(j.a)({},Pe.customTitle),{},{marginTop:0})}))}))((function(e){var t=e.closeModalAndRefresh,a=e.serverNeedsRestart,i=e.selectedConfiguration,r=e.setErrorSnackMessage,o=e.classes,s=Object(c.useState)([]),l=Object(b.a)(s,2),d=l[0],u=l[1],j=Object(c.useState)(!1),m=Object(b.a)(j,2),h=m[0],p=m[1],O=Object(c.useState)(!0),f=Object(b.a)(O,2),v=f[0],S=f[1],C=Object(c.useState)([]),k=Object(b.a)(C,2),N=k[0],w=k[1];Object(c.useEffect)((function(){var e=Z()(i,"configuration_id",!1);e&&Oe.invoke("GET","/api/v1/configs/".concat(e)).then((function(e){var t=Z()(e,"key_values",[]);w(t)})).catch((function(e){S(!1),r(e)})),S(!1)}),[i,r]),Object(c.useEffect)((function(){if(h){var e={key_values:So(d)};Oe.invoke("PUT","/api/v1/configs/".concat(i.configuration_id),e).then((function(){p(!1),a(!0),t()})).catch((function(e){p(!1),r(e)}))}}),[h,a,i,d,t,r]);var T=Object(c.useCallback)((function(e){u(e)}),[u]);return Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(x.a,{item:!0,xs:12,className:o.customTitle,children:i.configuration_label}),Object(n.jsx)(c.Fragment,{children:Object(n.jsxs)("form",{noValidate:!0,onSubmit:function(e){e.preventDefault(),p(!0)},children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:o.settingsFormContainer,children:[v&&Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(y.a,{})}),Object(n.jsx)(wo,{fields:xo[i.configuration_id],onChange:T,defaultVals:N})]}),Object(n.jsx)(x.a,{item:!0,xs:12,className:o.settingsButtonContainer,children:Object(n.jsx)(x.a,{item:!0,xs:12,className:o.innerSettingsButtonContainer,children:Object(n.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:h,children:"Save"})})})]})})]})}))),_o=Object(w.a)((function(){return Object(k.a)({masterContainer:{overflowX:"hidden",overflowY:"auto"},sliderContainer:{width:"auto",transitionDuration:"0.3s",position:"relative"},slide:{float:"left"}})}))((function(e){var t=e.classes,a=e.slideOptions,i=e.currentSlide;return Object(n.jsx)(zt.a,{children:function(e){var r=e.width,o=e.height,s=i*r,l=r*a.length;return Object(n.jsx)(c.Fragment,{children:Object(n.jsx)("div",{className:t.masterContainer,style:{width:r,height:o},children:Object(n.jsx)("div",{className:t.sliderContainer,style:{left:"-".concat(s,"px"),width:"".concat(l,"px")},children:a.map((function(e,a){return Object(n.jsx)("div",{className:t.slide,style:{width:r},children:e},"slide-panel-".concat(a.toString()))}))})})})}})})),Io=function(){return Object(n.jsx)(ot.a,{viewBox:"0 0 10.847 6.572",children:Object(n.jsxs)("g",{transform:"translate(-84.793 -81.193)",children:[Object(n.jsx)("line",{x2:"9.64",transform:"translate(85.5 84.5)",fill:"none",stroke:"#000",strokeLinecap:"round",strokeWidth:"1"}),Object(n.jsx)("line",{y1:"2.558",x2:"2.645",transform:"translate(85.5 81.9)",fill:"none",stroke:"#000",strokeLinecap:"round",strokeWidth:"1"}),Object(n.jsx)("line",{x2:"2.645",y2:"2.558",transform:"translate(85.5 84.5)",fill:"none",stroke:"#000",strokeLinecap:"round",strokeWidth:"1"})]})})},Mo={configuration_id:"",configuration_label:""},Fo=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)(Object(j.a)({strongText:{fontWeight:700},keyName:{marginLeft:5},iconText:{lineHeight:"24px"},customConfigurationPage:{height:"calc(100vh - 324px)",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}},De),Fe),Pe),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))((function(e){var t=e.classes,a=Object(c.useState)(Mo),i=Object(b.a)(a,2),r=i[0],o=i[1],s=Object(c.useState)(0),l=Object(b.a)(s,2),d=l[0],j=l[1],m=[{type:"edit",onClick:function(e){var t=Z()(e,"url","");""!==t?u.push(t):(j(1),o(e))}}];return Object(n.jsx)(c.Fragment,{children:Object(n.jsx)(x.a,{container:!0,children:Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("div",{className:t.settingsOptionsContainer,children:Object(n.jsx)(_o,{slideOptions:[Object(n.jsx)(c.Fragment,{children:Object(n.jsx)(ha,{itemActions:m,columns:[{label:"Configuration",elementKey:"configuration_id"}],isLoading:!1,records:fo,entityName:"Configurations",idField:"configuration_id",customPaperHeight:t.customConfigurationPage,noBackground:!0})}),Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(x.a,{item:!0,xs:12,className:t.backContainer,children:Object(n.jsxs)("button",{onClick:function(){j(0),o(Mo)},className:t.backButton,children:[Object(n.jsx)(Io,{}),"Back To Configurations"]})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:1===d?Object(n.jsx)(Ao,{closeModalAndRefresh:function(){j(0)},selectedConfiguration:r}):null})]})],currentSlide:d})})})})})})})),Do=a(229),Lo=a(431),Bo=a.n(Lo),Ro=[{actionTrigger:so,targetTitle:"Postgres SQL",logo:"/postgres.png"},{actionTrigger:uo,targetTitle:"Kafka",logo:"/kafka.png"},{actionTrigger:bo,targetTitle:"AMQP",logo:"/amqp.png"},{actionTrigger:jo,targetTitle:"MQTT",logo:"/mqtt.png"},{actionTrigger:mo,targetTitle:"Redis",logo:"/redis.png"},{actionTrigger:ho,targetTitle:"NATS",logo:"/nats.png"},{actionTrigger:lo,targetTitle:"Mysql",logo:"/mysql.png"},{actionTrigger:po,targetTitle:"Elastic Search",logo:"/elasticsearch.png"},{actionTrigger:Oo,targetTitle:"Webhook",logo:""},{actionTrigger:go,targetTitle:"NSQ",logo:""}],Po=Object(w.a)((function(e){return Object(k.a)(Object(j.a)({},Te))}))((function(e){var t=e.onChange,a=e.classes,r=Object(c.useState)(!1),o=Object(b.a)(r,2),s=o[0],l=o[1],d=Object(c.useState)(""),u=Object(b.a)(d,2),j=u[0],m=u[1],h=Object(c.useState)(""),p=Object(b.a)(h,2),O=p[0],g=p[1],f=Object(c.useState)(""),v=Object(b.a)(f,2),y=v[0],S=v[1],C=Object(c.useState)(""),k=Object(b.a)(C,2),N=k[0],w=k[1],T=Object(c.useState)(""),E=Object(b.a)(T,2),A=E[0],_=E[1],I=Object(c.useState)(""),M=Object(b.a)(I,2),F=M[0],D=M[1],L=Object(c.useState)(" "),B=Object(b.a)(L,2),R=B[0],P=B[1],z=Object(c.useState)(""),K=Object(b.a)(z,2),U=K[0],W=K[1],V=Object(c.useState)("namespace"),G=Object(b.a)(V,2),q=G[0],H=G[1],Y=Object(c.useState)(""),Q=Object(b.a)(Y,2),Z=Q[0],J=Q[1],$=Object(c.useState)(""),X=Object(b.a)($,2),ee=X[0],te=X[1],ae=Object(c.useState)(""),ne=Object(b.a)(ae,2),ce=ne[0],ie=ne[1],re=Object(c.useCallback)((function(){var e="";return""!==O&&(e="".concat(e," host=").concat(O)),""!==y&&(e="".concat(e," dbname=").concat(y)),""!==A&&(e="".concat(e," user=").concat(A)),""!==F&&(e="".concat(e," password=").concat(F)),""!==N&&(e="".concat(e," port=").concat(N))," "!==R&&(e="".concat(e," sslmode=").concat(R)),(e="".concat(e," ")).trim()}),[O,y,A,F,N,R]);return Object(c.useEffect)((function(){""!==j&&t([{key:"connection_string",value:j},{key:"table",value:U},{key:"format",value:q},{key:"queue_dir",value:Z},{key:"queue_limit",value:ee},{key:"comment",value:ce}])}),[j,U,q,Z,ee,ce,t]),Object(c.useEffect)((function(){var e=re();m(e)}),[A,y,F,N,R,O,m,re]),Object(c.useEffect)((function(){if(s){var e=re();m(e)}else{var t=function(e,t){var a,n=[],c=Object(Mr.a)(t);try{for(c.s();!(a=c.n()).done;){var i=a.value,r=e.indexOf(i+"=");-1!==r&&n.push(r)}}catch(p){c.e(p)}finally{c.f()}n.sort((function(e,t){return e-t}));for(var o=new Map,s=new Array(n.length),l=0;l<n.length;l++){var d=l+1;d<n.length?s[l]=e.substr(n[l],n[d]-n[l]):s[l]=e.substr(n[l])}for(var u=0,b=s;u<b.length;u++){var j=b[u];if(void 0!==j){var m=j.substr(0,j.indexOf("=")),h=j.substr(j.indexOf("=")+1).trim();o.set(m,h)}}return o}(j,["host","port","dbname","user","password","sslmode"]);g(t.get("host")?t.get("host")+"":""),w(t.get("port")?t.get("port")+"":""),S(t.get("dbname")?t.get("dbname")+"":""),_(t.get("user")?t.get("user")+"":""),D(t.get("password")?t.get("password")+"":""),P(t.get("sslmode")?t.get("sslmode")+"":" ")}}),[s]),Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(za,{label:"Manually Configure String",checked:s,id:"manualString",name:"manualString",onChange:function(e){l(e.target.checked)},value:"manualString",indicatorLabels:["On","Off"]})}),s?Object(n.jsx)(i.a.Fragment,{children:Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"connection-string",name:"connection_string",label:"Connection String",value:j,onChange:function(e){m(e.target.value)}})})}):Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsxs)(x.a,{item:!0,xs:12,className:a.configureString,children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"host",name:"host",label:"",placeholder:"Enter Host",value:O,onChange:function(e){g(e.target.value)}})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"db-name",name:"db-name",label:"",placeholder:"Enter DB Name",value:y,onChange:function(e){S(e.target.value)}})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"port",name:"port",label:"",placeholder:"Enter Port",value:N,onChange:function(e){w(e.target.value)}})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Aa,{value:R,label:"",id:"sslmode",name:"sslmode",onChange:function(e){void 0!==e.target.value&&P(e.target.value+"")},options:[{label:"Enter SSL Mode",value:" "},{label:"Require",value:"require"},{label:"Disable",value:"disable"},{label:"Verify CA",value:"verify-ca"},{label:"Verify Full",value:"verify-full"}]})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"user",name:"user",label:"",placeholder:"Enter User",value:A,onChange:function(e){_(e.target.value)}})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"password",name:"password",label:"",type:"password",placeholder:"Enter Password",value:F,onChange:function(e){D(e.target.value)}})})]})}),Object(n.jsx)(Ja,{label:"Connection String",content:j}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("br",{})})]}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"table",name:"table",label:"Table",placeholder:"Enter Table Name",value:U,tooltip:"DB table name to store/update events, table is auto-created",onChange:function(e){W(e.target.value)}})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(La,{currentSelection:q,id:"format",name:"format",label:"Format",onChange:function(e){H(e.target.value)},tooltip:"'namespace' reflects current bucket/object list and 'access' reflects a journal of object operations, defaults to 'namespace'",selectorOptions:[{label:"Namespace",value:"namespace"},{label:"Access",value:"access"}]})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"queue-dir",name:"queue_dir",label:"Queue Dir",placeholder:"Enter Queue Directory",value:Z,tooltip:"staging dir for undelivered messages e.g. '/home/events'",onChange:function(e){J(e.target.value)}})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"queue-limit",name:"queue_limit",label:"Queue Limit",placeholder:"Enter Queue Limit",type:"number",value:ee,tooltip:"maximum limit for undelivered messages, defaults to '10000'",onChange:function(e){te(e.target.value)}})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(ko,{id:"comment",name:"comment",label:"Comment",placeholder:"Enter Comment",value:ce,onChange:function(e){ie(e.target.value)}})})]})})),zo=Object(w.a)((function(e){return Object(k.a)(Object(j.a)({},Te))}))((function(e){var t=e.onChange,a=e.classes,r=Object(c.useState)(!1),o=Object(b.a)(r,2),s=o[0],l=o[1],d=Object(c.useState)(""),u=Object(b.a)(d,2),j=u[0],m=u[1],h=Object(c.useState)(""),p=Object(b.a)(h,2),O=p[0],g=p[1],f=Object(c.useState)(""),v=Object(b.a)(f,2),y=v[0],S=v[1],C=Object(c.useState)(""),k=Object(b.a)(C,2),N=k[0],w=k[1],T=Object(c.useState)(""),E=Object(b.a)(T,2),A=E[0],_=E[1],I=Object(c.useState)(""),M=Object(b.a)(I,2),F=M[0],D=M[1],L=Object(c.useState)(""),B=Object(b.a)(L,2),R=B[0],P=B[1],z=Object(c.useState)("namespace"),K=Object(b.a)(z,2),U=K[0],W=K[1],V=Object(c.useState)(""),G=Object(b.a)(V,2),q=G[0],H=G[1],Y=Object(c.useState)(""),Q=Object(b.a)(Y,2),Z=Q[0],J=Q[1],$=Object(c.useState)(""),X=Object(b.a)($,2),ee=X[0],te=X[1],ae=Object(c.useCallback)((function(){return"".concat(A,":").concat(F,"@tcp(").concat(O,":").concat(N,")/").concat(y)}),[A,F,O,N,y]);Object(c.useEffect)((function(){""!==j&&t([{key:"dsn_string",value:j},{key:"table",value:R},{key:"format",value:U},{key:"queue_dir",value:q},{key:"queue_limit",value:Z},{key:"comment",value:ee}])}),[j,R,U,q,Z,ee,t]),Object(c.useEffect)((function(){var e=ae();m(e)}),[A,y,F,N,O,m,ae]);return Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(za,{label:"Enter DNS String",checked:s,id:"checkedB",name:"checkedB",onChange:function(e){if(e.target.checked){var t=ae();m(t)}else{var a=function(e,t){for(var a,n=new Map,c=/(.*?):(.*?)@tcp\((.*?):(.*?)\)\/(.*?)$/gm;null!==(a=c.exec(e));)a.index===c.lastIndex&&c.lastIndex++,n.set("user",a[1]),n.set("password",a[2]),n.set("host",a[3]),n.set("port",a[4]),n.set("dbname",a[5]);return n}(j);g(a.get("host")?a.get("host")+"":""),w(a.get("port")?a.get("port")+"":""),S(a.get("dbname")?a.get("dbname")+"":""),_(a.get("user")?a.get("user")+"":""),D(a.get("password")?a.get("password")+"":"")}l(e.target.checked)},value:"dnsString",indicatorLabels:["On","Off"]})}),s?Object(n.jsx)(i.a.Fragment,{children:Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"dsn-string",name:"dsn_string",label:"DSN String",value:j,onChange:function(e){m(e.target.value)}})})}):Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsxs)(x.a,{item:!0,xs:12,className:a.configureString,children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"host",name:"host",label:"",placeholder:"Enter Host",value:O,onChange:function(e){g(e.target.value)}})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"db-name",name:"db-name",label:"",placeholder:"Enter DB Name",value:y,onChange:function(e){S(e.target.value)}})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"port",name:"port",label:"",placeholder:"Enter Port",value:N,onChange:function(e){w(e.target.value)}})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"user",name:"user",label:"",placeholder:"Enter User",value:A,onChange:function(e){_(e.target.value)}})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"password",name:"password",label:"",placeholder:"Enter Password",type:"password",value:F,onChange:function(e){D(e.target.value)}})})]})}),Object(n.jsx)(Ja,{label:"Connection String",content:j}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("br",{})})]}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"table",name:"table",label:"Table",placeholder:"Enter Table Name",value:R,tooltip:"DB table name to store/update events, table is auto-created",onChange:function(e){P(e.target.value)}})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(La,{currentSelection:U,id:"format",name:"format",label:"Format",onChange:function(e){W(e.target.value)},tooltip:"'namespace' reflects current bucket/object list and 'access' reflects a journal of object operations, defaults to 'namespace'",selectorOptions:[{label:"Namespace",value:"namespace"},{label:"Access",value:"access"}]})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"queue-dir",name:"queue_dir",label:"Queue Dir",placeholder:"Enter Queue Dir",value:q,tooltip:"staging dir for undelivered messages e.g. '/home/events'",onChange:function(e){H(e.target.value)}})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"queue-limit",name:"queue_limit",label:"Queue Limit",placeholder:"Enter Queue Limit",type:"number",value:Z,tooltip:"maximum limit for undelivered messages, defaults to '10000'",onChange:function(e){J(e.target.value)}})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(ko,{id:"comment",name:"comment",label:"Comment",placeholder:"Enter Comment",value:ee,onChange:function(e){te(e.target.value)}})})]})})),Ko={serverNeedsRestart:K,setErrorSnackMessage:V},Uo=Object(s.b)(null,Ko),Wo=Uo(Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({},Te),Pe),{},{strongText:{fontWeight:700},keyName:{marginLeft:5},buttonContainer:{textAlign:"right"},lambdaFormIndicator:{display:"flex",marginBottom:40},customTitle:Object(j.a)(Object(j.a)({},Pe.customTitle),{},{marginTop:0}),settingsFormContainer:Object(j.a)(Object(j.a)({},Pe.settingsFormContainer),{},{height:"calc(100vh - 422px)"})}))}))((function(e){var t=e.service,a=e.saveAndRefresh,i=e.serverNeedsRestart,r=e.classes,o=e.setErrorSnackMessage,s=Object(c.useState)([]),l=Object(b.a)(s,2),d=l[0],u=l[1],j=Object(c.useState)(!1),m=Object(b.a)(j,2),h=m[0],p=m[1];Object(c.useEffect)((function(){if(h){var e={key_values:So(d)};Oe.invoke("PUT","/api/v1/configs/".concat(t),e).then((function(){p(!1),i(!0),a()})).catch((function(e){p(!1),o(e)}))}}),[h,i,t,d,a,o]);var O,f=Object(c.useCallback)((function(e){u(e)}),[u]);switch(t){case so:O=Object(n.jsx)(Po,{onChange:f});break;case lo:O=Object(n.jsx)(zo,{onChange:f});break;default:var v=Z()(yo,t,[]);O=Object(n.jsx)(wo,{fields:v,onChange:f})}var y=Ro.find((function(e){return e.actionTrigger===t}));return Object(n.jsx)(c.Fragment,{children:""!==t&&Object(n.jsx)(c.Fragment,{children:Object(n.jsxs)("form",{noValidate:!0,onSubmit:function(e){e.preventDefault(),p(!0)},children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:r.customTitle,children:[y?y.targetTitle:""," - Add Lambda Notification Target"]}),Object(n.jsx)(x.a,{item:!0,xs:12,className:r.settingsFormContainer,children:O}),Object(n.jsx)(x.a,{item:!0,xs:12,className:r.settingsButtonContainer,children:Object(n.jsx)(x.a,{item:!0,xs:12,className:r.innerSettingsButtonContainer,children:Object(n.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:h,children:"Save"})})}),Object(n.jsx)(x.a,{item:!0,xs:9})]})})})}))),Vo=Ro.filter((function(e){return""===e.logo})),Go=Ro.filter((function(e){return""!==e.logo})),qo=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({},Pe),{},{customTitle:Object(j.a)(Object(j.a)({},Pe.customTitle),{},{marginTop:0})},ze))}))((function(e){var t=e.classes,a=e.setService;return Object(n.jsx)(c.Fragment,{children:Object(n.jsx)(x.a,{container:!0,children:Object(n.jsxs)(x.a,{item:!0,xs:12,children:[Object(n.jsx)(x.a,{item:!0,xs:12,className:t.customTitle,children:"Pick a supported service"}),Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.centerElements,children:[Object(n.jsx)("div",{className:t.nonIconContainer,children:Vo.map((function(e){return Object(n.jsx)(g.a,{variant:"contained",color:"primary",onClick:function(){a(e.actionTrigger)},children:e.targetTitle.toUpperCase()},"non-icon-".concat(e.targetTitle))}))}),Object(n.jsx)("div",{className:t.iconContainer,children:Go.map((function(e){return Object(n.jsx)("button",{className:t.lambdaNotif,onClick:function(){a(e.actionTrigger)},children:Object(n.jsx)("img",{src:e.logo,className:t.logoButton,alt:e.targetTitle})},"icon-".concat(e.targetTitle))}))})]})]})})})})),Ho={setErrorSnackMessage:V},Yo=Object(s.b)(null,Ho),Qo=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)(Object(j.a)(Object(j.a)({},Fe),De),Pe),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})),{},{strongText:{fontWeight:700},keyName:{marginLeft:5},iconText:{lineHeight:"24px"},customConfigurationPage:{height:"calc(100vh - 410px)",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},lambdaContainer:{padding:"15px 0"},actionsTray:Object(j.a)(Object(j.a)({},Fe.actionsTray),{},{padding:"0 38px"})}))}))(Yo((function(e){var t=e.classes,a=e.setErrorSnackMessage,i=Object(c.useState)([]),r=Object(b.a)(i,2),o=r[0],s=r[1],l=Object(c.useState)(""),d=Object(b.a)(l,2),u=d[0],j=d[1],m=Object(c.useState)(!1),h=Object(b.a)(m,2),p=h[0],O=h[1],v=Object(c.useState)(0),y=Object(b.a)(v,2),S=y[0],C=y[1],k=Object(c.useState)(""),N=Object(b.a)(k,2),w=N[0],T=N[1];Object(c.useEffect)((function(){if(p){Oe.invoke("GET","/api/v1/admin/notification_endpoints").then((function(e){var t=[];null!==e.notification_endpoints&&(t=e.notification_endpoints),s(t.map((function(e){return{service_name:"".concat(e.service,":").concat(e.account_id),status:e.status}}))),O(!1)})).catch((function(e){a(e),O(!1)}))}}),[p,a]),Object(c.useEffect)((function(){O(!0)}),[]);var E=o.filter((function(e){return""===u||e.service_name.indexOf(u)>=0})),A=function(){T(""),C(S-1)};return Object(n.jsx)(c.Fragment,{children:Object(n.jsx)(x.a,{container:!0,children:Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("div",{className:t.settingsOptionsContainer,children:Object(n.jsx)(_o,{slideOptions:[Object(n.jsx)(c.Fragment,{children:Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.lambdaContainer,children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.actionsTray,children:[Object(n.jsx)(f.a,{placeholder:"Filter",className:t.searchField,id:"search-resource",label:"",onChange:function(e){j(e.target.value)},InputProps:{disableUnderline:!0,startAdornment:Object(n.jsx)(et.a,{position:"start",children:Object(n.jsx)(at.a,{})})}}),Object(n.jsx)(Bt.a,{color:"primary","aria-label":"Refresh List",component:"span",onClick:function(){O(!0)},children:Object(n.jsx)(qn.a,{})}),Object(n.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(n.jsx)(lt,{}),onClick:function(){C(1)},children:"Add Notification Target"})]}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(ha,{itemActions:[],columns:[{label:"Status",elementKey:"status",renderFunction:function(e){return Object(n.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[Object(n.jsx)(Bo.a,{style:"Offline"===e?{color:Do.a[500]}:{}}),e]})},width:150},{label:"Service",elementKey:"service_name"}],isLoading:p,records:E,entityName:"Lambda Notification Targets",idField:"service_name",customPaperHeight:t.customConfigurationPage,noBackground:!0})})]})}),Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(x.a,{item:!0,xs:12,className:t.backContainer,children:Object(n.jsxs)("button",{onClick:A,className:t.backButton,children:[Object(n.jsx)(Io,{}),"Back To Lambda Notifications"]})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(qo,{setService:function(e){T(e),C(2)}})})]}),Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(x.a,{item:!0,xs:12,className:t.backContainer,children:Object(n.jsxs)("button",{onClick:A,className:t.backButton,children:[Object(n.jsx)(Io,{}),"Back To Supported Services"]})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Wo,{service:w,saveAndRefresh:function(){O(!0),C(0),T("")}})})]})],currentSlide:S})})})})})})}))),Zo=a(433),Jo=a.n(Zo),$o=a(432),Xo=a.n($o),es=Object(w.a)((function(e){return Object(k.a)({errorBlock:{color:e.palette.error.main}})}))((function(e){var t=e.classes,a=e.errorMessage,c=e.withBreak,r=void 0===c||c;return Object(n.jsxs)(i.a.Fragment,{children:[r&&Object(n.jsx)("br",{}),Object(n.jsx)(v.a,{component:"p",variant:"body1",className:t.errorBlock,children:a})]})})),ts=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({},we),Ee),{},{textBoxContainer:{flexGrow:1,position:"relative",flexDirection:"column"},errorState:{color:"#b53b4b",fontSize:14,position:"absolute",top:7,right:7},errorText:{margin:"0",fontSize:"0.75rem",marginTop:3,textAlign:"left",fontFamily:"Lato,sans-serif",fontWeight:400,lineHeight:"1.66",color:"#dc1f2e"},valueString:{maxWidth:350,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",marginTop:2},fileReselect:{display:"flex",alignItems:"center"},fieldBottom:{borderBottom:"#9c9c9c 1px solid"},fileInputField:{margin:"13px 0"}}))}))((function(e){var t=e.label,a=e.classes,r=e.onChange,o=e.id,s=e.name,l=e.disabled,d=void 0!==l&&l,u=e.tooltip,j=void 0===u?"":u,m=e.required,h=e.error,p=void 0===h?"":h,O=e.accept,g=void 0===O?"":O,f=e.value,v=void 0===f?"":f,y=Object(c.useState)(!1),S=Object(b.a)(y,2),C=S[0],k=S[1];return Object(n.jsx)(i.a.Fragment,{children:Object(n.jsxs)(x.a,{item:!0,xs:12,className:"".concat(a.fieldBottom," ").concat(a.fieldContainer," ").concat(""!==p?a.errorInField:""),children:[""!==t&&Object(n.jsxs)(sa.a,{htmlFor:o,className:"".concat(""!==p?a.fieldLabelError:""," ").concat(a.inputLabel),children:[Object(n.jsxs)("span",{children:[t,m?"*":""]}),""!==j&&Object(n.jsx)("div",{className:a.tooltipContainer,children:Object(n.jsx)(la.a,{title:j,placement:"top-start",children:Object(n.jsx)("div",{children:Object(n.jsx)(da,{className:a.tooltip})})})})]}),C||""===v?Object(n.jsxs)("div",{className:a.textBoxContainer,children:[Object(n.jsx)("input",{type:"file",name:s,onChange:function(e){var t=Z()(e,"target.files[0].name","");!function(e,t){var a=e.target.files[0],n=new FileReader;n.readAsDataURL(a),n.onload=function(){var e=n.result;if(e){var a=e.toString().split("base64,");2===a.length&&t(a[1])}}}(e,(function(e){r(e,t)}))},accept:g,required:m,disabled:d,className:a.fileInputField}),""!==v&&Object(n.jsx)(Bt.a,{color:"primary","aria-label":"upload picture",component:"span",onClick:function(){k(!1)},disableRipple:!1,disableFocusRipple:!1,children:Object(n.jsx)(Xo.a,{})}),""!==p&&Object(n.jsx)(es,{errorMessage:p})]}):Object(n.jsxs)("div",{className:a.fileReselect,children:[Object(n.jsx)("div",{className:a.valueString,children:v}),Object(n.jsx)(Bt.a,{color:"primary","aria-label":"upload picture",component:"span",onClick:function(){k(!0)},disableRipple:!1,disableFocusRipple:!1,children:Object(n.jsx)(Jo.a,{})})]})]})})})),as={setErrorSnackMessage:V},ns=Object(s.b)(null,as),cs=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({},Te),Pe),{},{strongText:{fontWeight:700},keyName:{marginLeft:5},buttonContainer:{textAlign:"right"},customTitle:Object(j.a)(Object(j.a)({},Pe.customTitle),{},{marginTop:0}),settingsFormContainer:Object(j.a)(Object(j.a)({},Pe.settingsFormContainer),{},{height:"calc(100vh - 422px)"})}))}))(ns((function(e){var t=e.saveAndRefresh,a=e.classes,i=e.setErrorSnackMessage,r=e.type,o=Object(c.useState)(!1),s=Object(b.a)(o,2),l=s[0],d=s[1],u=Object(c.useState)(""),m=Object(b.a)(u,2),h=m[0],p=m[1],O=Object(c.useState)(""),f=Object(b.a)(O,2),v=f[0],y=f[1],S=Object(c.useState)(""),C=Object(b.a)(S,2),k=C[0],N=C[1],w=Object(c.useState)(""),T=Object(b.a)(w,2),E=T[0],A=T[1],_=Object(c.useState)(""),I=Object(b.a)(_,2),M=I[0],F=I[1],D=Object(c.useState)(""),L=Object(b.a)(D,2),B=L[0],R=L[1],P=Object(c.useState)(""),z=Object(b.a)(P,2),K=z[0],U=z[1],W=Object(c.useState)(""),V=Object(b.a)(W,2),G=V[0],q=V[1],H=Object(c.useState)(""),Y=Object(b.a)(H,2),Q=Y[0],Z=Y[1],J=Object(c.useState)(""),$=Object(b.a)(J,2),X=$[0],ee=$[1],te=Object(c.useState)(""),ae=Object(b.a)(te,2),ne=ae[0],ce=ae[1],ie=Object(c.useState)(""),re=Object(b.a)(ie,2),oe=re[0],se=re[1],le=Object(c.useState)(""),de=Object(b.a)(le,2),ue=de[0],be=de[1],je=Object(c.useState)(!0),me=Object(b.a)(je,2),he=me[0],pe=me[1];Object(c.useEffect)((function(){if(l){var e={},a={name:h,endpoint:v,bucket:k,prefix:E,region:M},n=r;switch("minio"===r&&(n="s3"),r){case"minio":case"s3":e={s3:Object(j.a)(Object(j.a)({},a),{},{accesskey:K,secretkey:G,storageclass:B})};break;case"gcs":e={gcs:Object(j.a)(Object(j.a)({},a),{},{creds:X})};break;case"azure":e={azure:Object(j.a)(Object(j.a)({},a),{},{accountname:ne,accountkey:oe})}}var c=Object(j.a)({type:n},e);Oe.invoke("POST","/api/v1/admin/tiers",c).then((function(){d(!1),t()})).catch((function(e){d(!1),i(e)}))}}),[K,oe,ne,k,X,v,h,E,M,t,l,G,i,B,r]),Object(c.useEffect)((function(){var e=!0;""===r&&(e=!1),""===r&&(e=!1),""===h&&(e=!1),""===v&&(e=!1),""===k&&(e=!1),""===E&&(e=!1),""===M&&(e=!1),"s3"!==r&&"minio"!==r||(""===K&&(e=!1),""===G&&(e=!1)),"gcs"===r&&""===X&&(e=!1),"azure"===r&&(""===ne&&(e=!1),""===oe&&(e=!1)),pe(e)}),[K,oe,ne,k,X,v,he,h,E,M,G,B,r]),Object(c.useEffect)((function(){switch(r){case"gcs":y("https://storage.googleapis.com/"),be("Google Cloud");break;case"s3":y("https://s3.amazonaws.com"),be("Amazon S3");break;case"azure":y("http://blob.core.windows.net"),be("Azure");break;case"minio":y(""),be("MinIO")}}),[r]);return Object(n.jsx)(c.Fragment,{children:Object(n.jsxs)("form",{noValidate:!0,onSubmit:function(e){e.preventDefault(),d(!0)},children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:a.customTitle,children:[ue," - Add Tier Configuration"]}),Object(n.jsx)(x.a,{item:!0,xs:12,className:a.settingsFormContainer,children:Object(n.jsx)(x.a,{container:!0,children:""!==r&&Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(Ca,{id:"name",name:"name",label:"Name",placeholder:"Enter Name",value:h,onChange:function(e){p(e.target.value)}}),Object(n.jsx)(Ca,{id:"endpoint",name:"endpoint",label:"Endpoint",placeholder:"Enter Endpoint",value:v,onChange:function(e){y(e.target.value)}}),"s3"===r||"minio"===r&&Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(Ca,{id:"accessKey",name:"accessKey",label:"Access Key",placeholder:"Enter Access Key",value:K,onChange:function(e){U(e.target.value)}}),Object(n.jsx)(Ca,{id:"secretKey",name:"secretKey",label:"Secret Key",placeholder:"Enter Secret Key",value:G,onChange:function(e){q(e.target.value)}})]}),"gcs"===r&&Object(n.jsx)(c.Fragment,{children:Object(n.jsx)(ts,{accept:".json",id:"creds",label:"Credentials",name:"creds",onChange:function(e,t){ee(e),Z(t)},value:Q})}),"azure"===r&&Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(Ca,{id:"accountName",name:"accountName",label:"Account Name",placeholder:"Enter Account Name",value:ne,onChange:function(e){ce(e.target.value)}}),Object(n.jsx)(Ca,{id:"accountKey",name:"accountKey",label:"Account Key",placeholder:"Enter Account Key",value:oe,onChange:function(e){se(e.target.value)}})]}),Object(n.jsx)(Ca,{id:"bucket",name:"bucket",label:"Bucket",placeholder:"Enter Bucket",value:k,onChange:function(e){N(e.target.value)}}),Object(n.jsx)(Ca,{id:"prefix",name:"prefix",label:"Prefix",placeholder:"Enter Prefix",value:E,onChange:function(e){A(e.target.value)}}),Object(n.jsx)(Ca,{id:"region",name:"region",label:"Region",placeholder:"Enter Region",value:M,onChange:function(e){F(e.target.value)}}),"s3"===r||"minio"===r&&Object(n.jsx)(Ca,{id:"storageClass",name:"storageClass",label:"Storage Class",placeholder:"Enter Storage Class",value:B,onChange:function(e){R(e.target.value)}})]})})}),Object(n.jsx)(x.a,{item:!0,xs:12,className:a.settingsButtonContainer,children:Object(n.jsx)(x.a,{item:!0,xs:12,className:a.innerSettingsButtonContainer,children:Object(n.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:l||!he,children:"Save"})})})]})})}))),is=Object(s.b)(null,{setModalErrorSnackMessage:q}),rs=Object(w.a)((function(e){return Object(k.a)(Object(j.a)({minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:"bold"}}},buttonContainer:{textAlign:"right"}},Te))}))(is((function(e){var t=e.open,a=e.closeModalAndRefresh,i=e.classes,r=e.tierData,o=e.setModalErrorSnackMessage,s=Object(c.useState)(!1),l=Object(b.a)(s,2),d=l[0],u=l[1],j=Object(c.useState)(""),m=Object(b.a)(j,2),h=m[0],p=m[1],O=Object(c.useState)(""),f=Object(b.a)(O,2),v=f[0],S=f[1],C=Object(c.useState)(""),k=Object(b.a)(C,2),N=k[0],w=k[1],T=Object(c.useState)(""),E=Object(b.a)(T,2),A=E[0],_=E[1],I=Object(c.useState)(""),M=Object(b.a)(I,2),F=M[0],D=M[1],L=Object(c.useState)(""),B=Object(b.a)(L,2),R=B[0],P=B[1],z=Object(c.useState)(!0),K=Object(b.a)(z,2),U=K[0],W=K[1],V=Z()(r,"type",""),G=Z()(r,"".concat(V,".name"),"");Object(c.useEffect)((function(){var e=!0;"s3"===V||"azure"===V?""!==F&&""!==R||(e=!1):"gcs"===V&&""===A&&(e=!1),W(e)}),[R,F,A,V]);return Object(n.jsx)(va,{modalOpen:t,onClose:function(){a(!1)},title:"Update Credentials - ".concat(V," / ").concat(G),children:Object(n.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){e.preventDefault(),u(!0),function(){var e={};"s3"===V||"azure"===V?e={access_key:F,secret_key:R}:"gcs"===V&&(e={creds:A}),""!==G?Oe.invoke("PUT","/api/v1/admin/tiers/".concat(V,"/").concat(G,"/credentials"),e).then((function(){u(!1),a(!0)})).catch((function(e){u(!1),o(e)})):o("There was an error retrieving tier information")}()},children:Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:i.formScrollable,children:["s3"===V&&Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(Ca,{id:"accessKey",name:"accessKey",label:"Access Key",placeholder:"Enter Access Key",value:h,onChange:function(e){p(e.target.value)}}),Object(n.jsx)(Ca,{id:"secretKey",name:"secretKey",label:"Secret Key",placeholder:"Enter Secret Key",value:v,onChange:function(e){S(e.target.value)}})]}),"gcs"===V&&Object(n.jsx)(c.Fragment,{children:Object(n.jsx)(ts,{accept:".json",id:"creds",label:"Credentials",name:"creds",onChange:function(e,t){_(e),w(t)},value:N})}),"azure"===V&&Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(Ca,{id:"accountName",name:"accountName",label:"Account Name",placeholder:"Enter Account Name",value:F,onChange:function(e){D(e.target.value)}}),Object(n.jsx)(Ca,{id:"accountKey",name:"accountKey",label:"Account Key",placeholder:"Enter Account Key",value:R,onChange:function(e){P(e.target.value)}})]})]}),Object(n.jsx)(x.a,{item:!0,xs:12,className:i.buttonContainer,children:Object(n.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:d||!U,children:"Save"})}),d&&Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(y.a,{})})]})})})}))),os={setErrorSnackMessage:V},ss=Object(s.b)(null,os),ls=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)(Object(j.a)(Object(j.a)(Object(j.a)({},Fe),De),Pe),ze),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})),{},{strongText:{fontWeight:700},keyName:{marginLeft:5},iconText:{lineHeight:"24px"},customConfigurationPage:{height:"calc(100vh - 410px)",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},lambdaContainer:{padding:"15px 0"},actionsTray:Object(j.a)(Object(j.a)({},Fe.actionsTray),{},{padding:"0 38px"}),customTitle:Object(j.a)(Object(j.a)({},Pe.customTitle),{},{marginTop:0})}))}))(ss((function(e){var t=e.classes,a=e.setErrorSnackMessage,i=Object(c.useState)([]),r=Object(b.a)(i,2),o=r[0],s=r[1],l=Object(c.useState)(""),d=Object(b.a)(l,2),u=d[0],j=d[1],m=Object(c.useState)(!0),h=Object(b.a)(m,2),p=h[0],O=h[1],v=Object(c.useState)(0),y=Object(b.a)(v,2),S=y[0],C=y[1],k=Object(c.useState)(!1),N=Object(b.a)(k,2),w=N[0],T=N[1],E=Object(c.useState)({type:"unsupported"}),A=Object(b.a)(E,2),_=A[0],I=A[1],M=Object(c.useState)(""),F=Object(b.a)(M,2),D=F[0],L=F[1];Object(c.useEffect)((function(){if(p){Oe.invoke("GET","/api/v1/admin/tiers").then((function(e){s(e.items||[]),O(!1)})).catch((function(e){a(e),O(!1)}))}}),[p,a]);var B=o.filter((function(e){if(""===u)return!0;var t=Z()(e,"".concat(e.type,".name"),""),a=Z()(e,"type","");return t.indexOf(u)>=0||a.indexOf(u)>=0})),R=function(){C(S-1)},P=function(e){L(e),C(2)};return Object(n.jsxs)(c.Fragment,{children:[w&&Object(n.jsx)(rs,{open:w,tierData:_,closeModalAndRefresh:function(){T(!1)}}),Object(n.jsx)(x.a,{container:!0,children:Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("div",{className:t.settingsOptionsContainer,children:Object(n.jsx)(_o,{slideOptions:[Object(n.jsx)(c.Fragment,{children:Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.lambdaContainer,children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.actionsTray,children:[Object(n.jsx)(f.a,{placeholder:"Filter",className:t.searchField,id:"search-resource",label:"",onChange:function(e){j(e.target.value)},InputProps:{disableUnderline:!0,startAdornment:Object(n.jsx)(et.a,{position:"start",children:Object(n.jsx)(at.a,{})})}}),Object(n.jsx)(Bt.a,{color:"primary","aria-label":"Refresh List",component:"span",onClick:function(){O(!0)},children:Object(n.jsx)(qn.a,{})}),Object(n.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(n.jsx)(lt,{}),onClick:function(){C(1)},children:"Add Tier"})]}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("br",{})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(ha,{itemActions:[{type:"edit",onClick:function(e){I(e),T(!0)}}],columns:[{label:"Tier Name",elementKey:"type",renderFunction:function(e){var t=Z()(e,"".concat(e.type,".name"),"");return null!==t?t:""},renderFullObject:!0},{label:"Type",elementKey:"type",width:150},{label:"Endpoint",elementKey:"type",renderFunction:function(e){var t=Z()(e,"".concat(e.type,".endpoint"),"");return null!==t?t:""},renderFullObject:!0},{label:"Bucket",elementKey:"type",renderFunction:function(e){var t=Z()(e,"".concat(e.type,".bucket"),"");return null!==t?t:""},renderFullObject:!0},{label:"Prefix",elementKey:"type",renderFunction:function(e){var t=Z()(e,"".concat(e.type,".prefix"),"");return null!==t?t:""},renderFullObject:!0},{label:"Region",elementKey:"type",renderFunction:function(e){var t=Z()(e,"".concat(e.type,".region"),"");return null!==t?t:""},renderFullObject:!0}],isLoading:p,records:B,entityName:"Tiers",idField:"service_name",customPaperHeight:t.customConfigurationPage,noBackground:!0})})]})}),Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(x.a,{item:!0,xs:12,className:t.backContainer,children:Object(n.jsxs)("button",{onClick:R,className:t.backButton,children:[Object(n.jsx)(Io,{}),"Back To Tiers"]})}),Object(n.jsxs)(x.a,{item:!0,xs:12,children:[Object(n.jsx)(x.a,{item:!0,xs:12,className:t.customTitle,children:"Add Tier Configuration"}),Object(n.jsx)(x.a,{item:!0,xs:12,className:t.settingsFormContainer,children:Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(x.a,{item:!0,xs:12,className:t.centerElements,children:Object(n.jsxs)("div",{className:t.iconContainer,children:[Object(n.jsx)("button",{className:t.lambdaNotif,onClick:function(){P("minio")},children:Object(n.jsx)("img",{src:"/minioTier.png",className:t.logoButton,alt:"MinIO"})}),Object(n.jsx)("button",{className:t.lambdaNotif,onClick:function(){P("gcs")},children:Object(n.jsx)("img",{src:"/gcs.png",className:t.logoButton,alt:"GCS"})}),Object(n.jsx)("button",{className:t.lambdaNotif,onClick:function(){P("s3")},children:Object(n.jsx)("img",{src:"/amazon.png",className:t.logoButton,alt:"s3"})}),Object(n.jsx)("button",{className:t.lambdaNotif,onClick:function(){P("azure")},children:Object(n.jsx)("img",{src:"/azure.png",className:t.logoButton,alt:"Azure"})})]})})})})]})]}),Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(x.a,{item:!0,xs:12,className:t.backContainer,children:Object(n.jsxs)("button",{onClick:R,className:t.backButton,children:[Object(n.jsx)(Io,{}),"Back To Tier Type Selection"]})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:2===S&&Object(n.jsx)(cs,{type:D,saveAndRefresh:function(){C(0),O(!0)}})})]})],currentSlide:S})})})})})]})}))),ds=Object(s.b)((function(e){return{session:e.console.session}}),{}),us=Object(w.a)((function(e){return Object(k.a)(Object(j.a)({headerLabel:{fontSize:22,fontWeight:600,color:"#000",marginTop:4}},(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))(ds((function(e){var t=e.classes,a=(e.session,Object(c.useState)(0)),i=Object(b.a)(a,2),r=i[0],o=i[1];return Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(qa,{label:"Settings"}),Object(n.jsx)(x.a,{container:!0,children:Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.container,children:[Object(n.jsxs)(nn.a,{value:r,indicatorColor:"primary",textColor:"primary",onChange:function(e,t){o(t)},"aria-label":"tenant-tabs",variant:"scrollable",scrollButtons:"auto",children:[Object(n.jsx)(cn.a,{label:"Configurations"}),Object(n.jsx)(cn.a,{label:"Lambda Notifications"}),Object(n.jsx)(cn.a,{label:"Tiers"})]}),Object(n.jsxs)(x.a,{item:!0,xs:12,children:[0===r&&Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Fo,{})}),1===r&&Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Qo,{})}),2===r&&Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(ls,{})})]})]})})]})}))),bs=a(154),js=a.n(bs),ms={logger:{main:"logger",title:"Logger Webhook Configuration",modalTitle:"Logger Webhook",apiURL:"",configuration:{configuration_id:"logger_webhook",configuration_label:"Logger Webhook"}},audit:{main:"audit",title:"Audit Webhook Configuration",modalTitle:"Audit Webhook",apiURL:"",configuration:{configuration_id:"audit_webhook",configuration_label:"Audit Webhook"}}},hs=Object(w.a)((function(e){return Object(k.a)({strongText:{fontWeight:700},keyName:{marginLeft:5},actionsTray:{textAlign:"right","& button":{marginLeft:10}},searchField:{background:"#FFFFFF",padding:12,borderRadius:5,boxShadow:"0px 3px 6px #00000012"},iconText:{lineHeight:"24px"}})}))((function(e){var t=e.match,a=e.classes,r=Object(c.useState)(!1),o=Object(b.a)(r,2),s=o[0],l=o[1],d=Object(c.useState)(""),u=Object(b.a)(d,2),j=u[0],m=u[1],h=Object(c.useState)(!1),p=Object(b.a)(h,2),O=p[0],y=p[1],S=Z()(t,"path","").split("/"),C=Z()(ms,S[2],!1);if(!C)return null;var k=[].filter((function(e){return e.name.toLocaleLowerCase().includes(j.toLocaleLowerCase())}));return Object(n.jsxs)(i.a.Fragment,{children:[s&&Object(n.jsx)(Ao,{closeModalAndRefresh:function(){y(!0),l(!1)},selectedConfiguration:C.configuration}),Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(v.a,{variant:"h6",children:C.title})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("br",{})}),Object(n.jsxs)(x.a,{item:!0,xs:12,className:a.actionsTray,children:[Object(n.jsx)(f.a,{placeholder:"Filter",className:a.searchField,id:"search-resource",label:"",onChange:function(e){m(e.target.value)},InputProps:{disableUnderline:!0,startAdornment:Object(n.jsx)(et.a,{position:"start",children:Object(n.jsx)(at.a,{})})}}),Object(n.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(n.jsx)(js.a,{}),onClick:function(){l(!0)},children:"Add Webhook Configuration"})]}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("br",{})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(ha,{itemActions:[{type:"edit",onClick:function(){}}],columns:[{label:"Name",elementKey:"name"}],isLoading:O,records:k,entityName:"Webhook Configurations",idField:"name"})})]})]})})),ps=Object(s.b)(null,{setErrorSnackMessage:V})((function(e){var t=e.deleteOpen,a=e.selectedTenant,i=e.closeDeleteModalAndRefresh,r=e.setErrorSnackMessage,o=Object(c.useState)(!1),s=Object(b.a)(o,2),l=s[0],d=s[1],u=Object(c.useState)(""),j=Object(b.a)(u,2),m=j[0],h=j[1];Object(c.useEffect)((function(){l&&Oe.invoke("DELETE","/api/v1/namespaces/".concat(a.namespace,"/tenants/").concat(a.name)).then((function(){d(!1),i(!0)})).catch((function(e){d(!1),r(e)}))}),[l]);return Object(n.jsxs)(pa.a,{open:t,onClose:function(){i(!1)},"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[Object(n.jsx)(Oa.a,{id:"alert-dialog-title",children:"Delete Tenant"}),Object(n.jsxs)(ga.a,{children:[l&&Object(n.jsx)(y.a,{}),Object(n.jsxs)(Ua.a,{id:"alert-dialog-description",children:["To continue please type ",Object(n.jsx)("b",{children:a.name})," in the box.",Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"retype-tenant",name:"retype-tenant",onChange:function(e){h(e.target.value)},label:"",value:m})})]})]}),Object(n.jsxs)(Wa.a,{children:[Object(n.jsx)(g.a,{onClick:function(){i(!1)},color:"primary",disabled:l,children:"Cancel"}),Object(n.jsx)(g.a,{onClick:function(){m===a.name?d(!0):r("Tenant name is not correct")},color:"secondary",autoFocus:!0,disabled:m!==a.name,children:"Delete"})]})]})})),Os=function(e,t){return{podAntiAffinity:{requiredDuringSchedulingIgnoredDuringExecution:[{labelSelector:{matchExpressions:[{key:"v1.min.io/tenant",operator:"In",values:[e]},{key:"v1.min.io/pool",operator:"In",values:[t]}]},topologyKey:"kubernetes.io/hostname"}]}}},gs=function(e,t,a,n){var c=e.split("&"),i=[];c.forEach((function(e){var t=e.split("=");2===t.length&&i.push({key:t[0],operator:"In",values:[t[1]]})}));var r={nodeAffinity:{requiredDuringSchedulingIgnoredDuringExecution:{nodeSelectorTerms:[{matchExpressions:i}]}}};if(t){var o=Os(a,n);r.podAntiAffinity=o.podAntiAffinity}return console.log(r),r},fs="ADD_TENANT/SET_CURRENT_PAGE",xs="ADD_TENANT/SET_ADVANCED_MODE",vs="ADD_TENANT/UPDATE_FIELD",ys="ADD_TENANT/SET_PAGE_VALID",Ss="ADD_TENANT/RESET_FORM",Cs="ADD_TENANT/SET_STORAGE_CLASSES_LIST",ks="ADD_TENANT/ADD_MINIO_KEYPAIR",Ns="ADD_TENANT/ADD_FILE_MINIO_KEYPAIR",ws="ADD_TENANT/DELETE_MINIO_KEYPAIR",Ts="ADD_TENANT/ADD_CA_KEYPAIR",Es="ADD_TENANT/ADD_FILE_TO_CA_KEYPAIR",As="ADD_TENANT/DELETE_CA_KEYPAIR",_s="ADD_TENANT/ADD_CONSOLE_CERT",Is="ADD_TENANT/ENCRYPTION_SERVER_CERT",Ms="ADD_TENANT/ENCRYPTION_CLIENT_CERT",Fs="ADD_TENANT/ENCRYPTION_VAULT_CERT",Ds="ADD_TENANT/ENCRYPTION_VAULT_CA",Ls="ADD_TENANT/ENCRYPTION_GEMALTO_CA",Bs=function(e,t,a){return{type:vs,pageName:e,field:t,value:a}},Rs=function(e,t){return{type:ys,pageName:e,valid:t}},Ps=function(e,t,a){return{type:_s,key:e,fileName:t,value:a}},zs=function(e){var t={};return e.forEach((function(e){if(e.required&&""===e.value.trim())t[e.fieldKey]="Field cannot be empty";else if(e.required||""!==e.value.trim())if(e.customValidation&&e.customValidationMessage)t[e.fieldKey]=e.customValidationMessage;else if(e.pattern&&e.customPatternMessage){var a=new RegExp(e.pattern,"g");e.value.match(a)||(t[e.fieldKey]=e.customPatternMessage)}else;})),t},Ks=function(e,t){var a=Object(j.a)({},e);return delete a[t],a},Us=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,t="",a="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",n=0;n<e;n++)t+=a[Math.floor(Math.random()*a.length)];return t},Ws=Object(s.b)((function(e){return{advancedMode:e.tenants.createTenant.advancedModeOn,tenantName:e.tenants.createTenant.fields.nameTenant.tenantName,namespace:e.tenants.createTenant.fields.nameTenant.namespace,selectedStorageClass:e.tenants.createTenant.fields.nameTenant.selectedStorageClass,storageClasses:e.tenants.createTenant.storageClasses}}),{setModalErrorSnackMessage:q,setAdvancedMode:function(e){return{type:xs,state:e}},updateAddField:Bs,setStorageClassesList:function(e){return{type:Cs,storageClasses:e}},setLimitSize:function(e){return{type:"ADD_TENANT/SET_LIMIT_SIZE",limitSize:e}},isPageValid:Rs}),Vs=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({buttonContainer:{textAlign:"right"}},Te),Ge))}))(Ws((function(e){var t=e.classes,a=e.storageClasses,r=e.advancedMode,o=e.tenantName,s=e.namespace,l=e.selectedStorageClass,d=e.setAdvancedMode,u=e.updateAddField,j=e.setStorageClassesList,m=e.setLimitSize,h=e.isPageValid,p=e.setModalErrorSnackMessage,O=Object(c.useState)({}),g=Object(b.a)(O,2),f=g[0],v=g[1],y=Object(c.useState)(!0),S=Object(b.a)(y,2),C=S[0],k=S[1],N=Object(c.useState)(!1),w=Object(b.a)(N,2),T=w[0],E=w[1],A=Object(c.useCallback)((function(e,t){u("nameTenant",e,t)}),[u]),_=Object(c.useCallback)((function(){A("selectedStorageClass",""),j([]),Oe.invoke("GET","/api/v1/namespaces/".concat(s,"/tenants")).then((function(e){var t=Z()(e,"tenants",[]);if(t&&t.length>0)return k(!1),void E(!1);k(!0),Oe.invoke("GET","/api/v1/namespaces/".concat(s,"/resourcequotas/").concat(s,"-storagequota")).then((function(e){var t=Z()(e,"elements",[]);m(function(e){var t=Z()(e,"elements",[]),a={};return t.forEach((function(e){var t=e.name.split(".storageclass.storage.k8s.io/requests.storage")[0],n=Z()(e,"hard",0),c=Z()(e,"used",0);a[t]=n-c})),a}(e));var a=t.map((function(e){var t=Z()(e,"name","").split(".storageclass.storage.k8s.io/requests.storage")[0];return{label:t,value:t}}));j(a),a.length>0&&A("selectedStorageClass",a[0].value),E(!1)})).catch((function(e){E(!1),console.error("Namespace error: ",e)}))})).catch((function(e){console.error(e),p("Error validating if namespace already has tenants")}))}),[s,m,p,j,A]),I=Object(c.useMemo)((function(){return Ln()(_,500)}),[_]);Object(c.useEffect)((function(){if(""!==s)return I(),E(!0),I.cancel}),[I,s]),Object(c.useEffect)((function(){var e=!1,t="";C||T?a.length<1&&C&&!T&&(e=!0,t="Please enter a valid namespace"):(e=!0,t="You can only create one tenant per namespace");var n=zs([{fieldKey:"tenant-name",required:!0,pattern:/^[a-z0-9-]{3,63}$/,customPatternMessage:"Name only can contain lowercase letters, numbers and '-'. Min. Length: 3",value:o},{fieldKey:"namespace",required:!0,value:s,customValidation:e,customValidationMessage:t}]),c=!("tenant-name"in n)&&!("namespace"in n)&&a.length>0;h("nameTenant",c),v(n)}),[a,s,o,h,C,T]);var M=function(e){v(Ks(f,e))};return Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsxs)("div",{className:t.headerElement,children:[Object(n.jsx)("h3",{className:t.h3Section,children:"Name Tenant"}),Object(n.jsx)("span",{className:t.descriptionText,children:"How would you like to name this new tenant?"})]}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"tenant-name",name:"tenant-name",onChange:function(e){A("tenantName",e.target.value),M("tenant-name")},label:"Name",value:o,required:!0,error:f["tenant-name"]||""})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"namespace",name:"namespace",onChange:function(e){A("namespace",e.target.value),M("namespace")},label:"Namespace",value:s,error:f.namespace||"",required:!0})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Aa,{id:"storage_class",name:"storage_class",onChange:function(e){A("selectedStorageClass",e.target.value)},label:"Storage Class",value:l,options:a,disabled:a.length<1})}),Object(n.jsxs)(x.a,{item:!0,xs:12,children:[Object(n.jsx)("br",{}),Object(n.jsxs)("span",{className:t.descriptionText,children:["Check 'Advanced Mode' for additional configuration options, such as configuring an Identity Provider, Encryption at rest, and customized TLS/SSL Certificates.",Object(n.jsx)("br",{}),"Leave 'Advanced Mode' unchecked to use the secure default settings for the tenant."]}),Object(n.jsx)("br",{}),Object(n.jsx)("br",{}),Object(n.jsx)(za,{value:"adv_mode",id:"adv_mode",name:"adv_mode",checked:r,onChange:function(e){var t=e.target.checked;d(t)},label:"Advanced Mode"})]})]})}))),Gs=Object(s.b)((function(e){return{storageClasses:e.tenants.createTenant.storageClasses,customImage:e.tenants.createTenant.fields.configure.customImage,imageName:e.tenants.createTenant.fields.configure.imageName,consoleImage:e.tenants.createTenant.fields.configure.consoleImage,customDockerhub:e.tenants.createTenant.fields.configure.customDockerhub,imageRegistry:e.tenants.createTenant.fields.configure.imageRegistry,imageRegistryUsername:e.tenants.createTenant.fields.configure.imageRegistryUsername,imageRegistryPassword:e.tenants.createTenant.fields.configure.imageRegistryPassword,exposeMinIO:e.tenants.createTenant.fields.configure.exposeMinIO,exposeConsole:e.tenants.createTenant.fields.configure.exposeConsole,prometheusCustom:e.tenants.createTenant.fields.configure.prometheusCustom,logSearchCustom:e.tenants.createTenant.fields.configure.logSearchCustom,logSearchVolumeSize:e.tenants.createTenant.fields.configure.logSearchVolumeSize,logSearchSizeFactor:e.tenants.createTenant.fields.configure.logSearchSizeFactor,prometheusVolumeSize:e.tenants.createTenant.fields.configure.prometheusVolumeSize,prometheusSizeFactor:e.tenants.createTenant.fields.configure.prometheusSizeFactor,logSearchSelectedStorageClass:e.tenants.createTenant.fields.configure.logSearchSelectedStorageClass,logSearchImage:e.tenants.createTenant.fields.configure.logSearchImage,kesImage:e.tenants.createTenant.fields.configure.kesImage,logSearchPostgresImage:e.tenants.createTenant.fields.configure.logSearchPostgresImage,prometheusSelectedStorageClass:e.tenants.createTenant.fields.configure.prometheusSelectedStorageClass,prometheusImage:e.tenants.createTenant.fields.configure.prometheusImage,selectedStorageClass:e.tenants.createTenant.fields.nameTenant.selectedStorageClass}}),{updateAddField:Bs,isPageValid:Rs}),qs=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({buttonContainer:{textAlign:"right"}},Te),Ge))}))(Gs((function(e){var t=e.classes,a=e.storageClasses,i=e.customImage,r=e.imageName,o=e.consoleImage,s=e.customDockerhub,l=e.imageRegistry,d=e.imageRegistryUsername,u=e.imageRegistryPassword,j=e.exposeMinIO,m=e.exposeConsole,h=e.prometheusCustom,p=e.logSearchCustom,O=e.logSearchVolumeSize,g=(e.logSearchSizeFactor,e.logSearchImage),f=e.kesImage,v=e.logSearchPostgresImage,y=e.prometheusVolumeSize,S=(e.prometheusSizeFactor,e.logSearchSelectedStorageClass),C=e.prometheusSelectedStorageClass,k=e.prometheusImage,N=e.updateAddField,w=e.isPageValid,T=e.selectedStorageClass,E=Object(c.useState)({}),A=Object(b.a)(E,2),_=A[0],I=A[1],M=Object(c.useCallback)((function(e,t){N("configure",e,t)}),[N]);Object(c.useEffect)((function(){var e=[];h&&(e=[].concat(Object(Xe.a)(e),[{fieldKey:"prometheus_storage_class",required:!0,value:C,customValidation:""===C,customValidationMessage:"Field cannot be empty"},{fieldKey:"prometheus_volume_size",required:!0,value:y,customValidation:""===y||parseInt(y)<=0,customValidationMessage:"Volume size must be present and be greatter than 0"}])),p&&(e=[].concat(Object(Xe.a)(e),[{fieldKey:"log_search_storage_class",required:!0,value:S,customValidation:""===S,customValidationMessage:"Field cannot be empty"},{fieldKey:"log_search_volume_size",required:!0,value:O,customValidation:""===O||parseInt(O)<=0,customValidationMessage:"Volume size must be present and be greatter than 0"}])),i&&(e=[].concat(Object(Xe.a)(e),[{fieldKey:"image",required:!1,value:r,pattern:/^((.*?)\/(.*?):(.+))$/,customPatternMessage:"Format must be of form: 'minio/minio:VERSION'"},{fieldKey:"consoleImage",required:!1,value:o,pattern:/^((.*?)\/(.*?):(.+))$/,customPatternMessage:"Format must be of form: 'minio/console:VERSION'"},{fieldKey:"logSearchImage",required:!1,value:g,pattern:/^((.*?)\/(.*?):(.+))$/,customPatternMessage:"Format must be of form: 'minio/logsearchapi:VERSION'"},{fieldKey:"kesImage",required:!1,value:f,pattern:/^((.*?)\/(.*?):(.+))$/,customPatternMessage:"Format must be of form: 'minio/kes:VERSION'"},{fieldKey:"logSearchPostgresImage",required:!1,value:v,pattern:/^((.*?)\/(.*?):(.+))$/,customPatternMessage:"Format must be of form: 'library/postgres:VERSION'"},{fieldKey:"prometheusImage",required:!1,value:k,pattern:/^((.*?)\/(.*?):(.+))$/,customPatternMessage:"Format must be of form: 'minio/prometheus:VERSION'"}]),s&&(e=[].concat(Object(Xe.a)(e),[{fieldKey:"registry",required:!0,value:l},{fieldKey:"registryUsername",required:!0,value:d},{fieldKey:"registryPassword",required:!0,value:u}])));var t=zs(e);w("configure",0===Object.keys(t).length),I(t)}),[i,r,o,g,f,v,k,s,l,d,u,w,h,p,C,y,S,O]),Object(c.useEffect)((function(){a.length>0&&(0===a.filter((function(e){return e.value===C})).length&&M("prometheusSelectedStorageClass",T),0===a.filter((function(e){return e.value===S})).length&&M("logSearchSelectedStorageClass",T))}),[S,C,T,a,M]);var F=function(e){I(Ks(_,e))};return Object(n.jsxs)(c.Fragment,{children:[Object(n.jsxs)("div",{className:t.headerElement,children:[Object(n.jsx)("h3",{className:t.h3Section,children:"Configure"}),Object(n.jsx)("span",{className:t.descriptionText,children:"Basic configurations for tenant management"})]}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(za,{value:"custom_image",id:"custom_image",name:"custom_image",checked:i,onChange:function(e){var t=e.target.checked;M("customImage",t)},label:"Use custom image"})}),i&&Object(n.jsxs)(c.Fragment,{children:["Please enter the MinIO docker image to use",Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"image",name:"image",onChange:function(e){M("imageName",e.target.value),F("image")},label:"MinIO's Image",value:r,error:_.image||"",placeholder:"E.g. minio/minio:RELEASE.2021-04-22T15-44-28Z"})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"consoleImage",name:"consoleImage",onChange:function(e){M("consoleImage",e.target.value),F("consoleImage")},label:"Console's Image",value:o,error:_.consoleImage||"",placeholder:"E.g. minio/console:v0.7.4"})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"logSearchImage",name:"logSearchImage",onChange:function(e){M("logSearchImage",e.target.value),F("logSearchImage")},label:"Log Search API's Image",value:g,error:_.logSearchImage||"",placeholder:"E.g. minio/logsearchapi:v4.0.9"})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"kesImage",name:"kesImage",onChange:function(e){M("kesImage",e.target.value),F("kesImage")},label:"KES Image",value:f,error:_.kesImage||"",placeholder:"E.g. minio/kes:v0.14.0"})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"logSearchPostgresImage",name:"logSearchPostgresImage",onChange:function(e){M("logSearchPostgresImage",e.target.value),F("logSearchPostgresImage")},label:"Log Search Postgres's Image",value:v,error:_.logSearchPostgresImage||"",placeholder:"E.g. library/postgres:13"})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"prometheusImage",name:"prometheusImage",onChange:function(e){M("prometheusImage",e.target.value),F("prometheusImage")},label:"Prometheus Image",value:k,error:_.prometheusImage||"",placeholder:"E.g. quay.io/prometheus/prometheus:latest"})})]}),i&&Object(n.jsx)(c.Fragment,{children:Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(za,{value:"custom_docker_hub",id:"custom_docker_hub",name:"custom_docker_hub",checked:s,onChange:function(e){var t=e.target.checked;M("customDockerhub",t)},label:"Set/Update Image Registry"})})}),s&&Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"registry",name:"registry",onChange:function(e){M("imageRegistry",e.target.value)},label:"Endpoint",value:l,error:_.registry||"",placeholder:"E.g. https://index.docker.io/v1/",required:!0})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"registryUsername",name:"registryUsername",onChange:function(e){M("imageRegistryUsername",e.target.value)},label:"Username",value:d,error:_.registryUsername||"",required:!0})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"registryPassword",name:"registryPassword",onChange:function(e){M("imageRegistryPassword",e.target.value)},label:"Password",value:u,error:_.registryPassword||"",required:!0})})]}),Object(n.jsxs)("div",{className:t.headerElement,children:[Object(n.jsx)("h3",{className:t.h3Section,children:"Expose Services"}),Object(n.jsx)("span",{className:t.descriptionText,children:"Whether the tenant's services should request an external IP."})]}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(za,{value:"expose_minio",id:"expose_minio",name:"expose_minio",checked:j,onChange:function(e){var t=e.target.checked;M("exposeMinIO",t)},label:"Expose MiniO Service"})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(za,{value:"expose_console",id:"expose_console",name:"expose_console",checked:m,onChange:function(e){var t=e.target.checked;M("exposeConsole",t)},label:"Expose Console Service"})}),Object(n.jsxs)("div",{className:t.headerElement,children:[Object(n.jsx)("h3",{className:t.h3Section,children:"Additional Configurations"}),Object(n.jsx)("span",{className:t.descriptionText,children:"Configure Storage Classes & Storage size for Log Search and Prometheus add-ons"})]}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(za,{value:"logSearchConfig",id:"log_search_configuration",name:"log_search_configuration",checked:p,onChange:function(e){var t=e.target.checked;M("logSearchCustom",t)},label:"Override Log Search defaults"})}),p&&Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Aa,{id:"log_search_storage_class",name:"log_search_storage_class",onChange:function(e){M("logSearchSelectedStorageClass",e.target.value)},label:"Log Search Storage Class",value:S,options:a,disabled:a.length<1})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("div",{className:t.multiContainer,children:Object(n.jsx)("div",{children:Object(n.jsx)(Ca,{type:"number",id:"log_search_volume_size",name:"log_search_volume_size",onChange:function(e){M("logSearchVolumeSize",e.target.value),F("log_search_volume_size")},label:"Storage Size [Gi]",value:O,required:!0,error:_.log_search_volume_size||"",min:"0"})})})}),Object(n.jsx)("br",{})]}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(za,{value:"prometheusConfig",id:"prometheus_configuration",name:"prometheus_configuration",checked:h,onChange:function(e){var t=e.target.checked;M("prometheusCustom",t)},label:"Override Prometheus defaults"})}),h&&Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Aa,{id:"prometheus_storage_class",name:"prometheus_storage_class",onChange:function(e){M("prometheusSelectedStorageClass",e.target.value)},label:"Prometheus Storage Class",value:C,options:a,disabled:a.length<1})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("div",{className:t.multiContainer,children:Object(n.jsx)("div",{children:Object(n.jsx)(Ca,{type:"number",id:"prometheus_volume_size",name:"prometheus_volume_size",onChange:function(e){M("prometheusVolumeSize",e.target.value),F("prometheus_volume_size")},label:"Storage Size [Gi]",value:y,required:!0,error:_.prometheus_volume_size||"",min:"0"})})})}),Object(n.jsx)("br",{})]})]})}))),Hs=a(434),Ys=a.n(Hs),Qs=a(435),Zs=a.n(Qs),Js=Object(s.b)((function(e){return{idpSelection:e.tenants.createTenant.fields.identityProvider.idpSelection,accessKeys:e.tenants.createTenant.fields.identityProvider.accessKeys,secretKeys:e.tenants.createTenant.fields.identityProvider.secretKeys,openIDURL:e.tenants.createTenant.fields.identityProvider.openIDURL,openIDClientID:e.tenants.createTenant.fields.identityProvider.openIDClientID,openIDSecretID:e.tenants.createTenant.fields.identityProvider.openIDSecretID,ADURL:e.tenants.createTenant.fields.identityProvider.ADURL,ADSkipTLS:e.tenants.createTenant.fields.identityProvider.ADSkipTLS,ADServerInsecure:e.tenants.createTenant.fields.identityProvider.ADServerInsecure,ADUserNameFilter:e.tenants.createTenant.fields.identityProvider.ADUserNameFilter,ADGroupBaseDN:e.tenants.createTenant.fields.identityProvider.ADGroupBaseDN,ADGroupSearchFilter:e.tenants.createTenant.fields.identityProvider.ADGroupSearchFilter,ADNameAttribute:e.tenants.createTenant.fields.identityProvider.ADNameAttribute}}),{updateAddField:Bs,isPageValid:Rs}),$s=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({buttonContainer:{textAlign:"right"},shortened:{gridTemplateColumns:"auto auto 50px 50px",display:"grid",gridGap:20},buttonTray:{gridTemplateColumns:"auto auto 10px 10px",display:"grid",gridGap:0,height:16,marginTop:12}},Te),Ge))}))(Js((function(e){var t=e.classes,a=e.idpSelection,i=e.accessKeys,r=e.secretKeys,o=e.openIDURL,s=e.openIDClientID,l=e.openIDSecretID,d=e.ADURL,u=e.ADSkipTLS,j=e.ADServerInsecure,m=e.ADUserNameFilter,h=e.ADGroupBaseDN,p=e.ADGroupSearchFilter,O=e.ADNameAttribute,g=e.updateAddField,f=e.isPageValid,y=Object(c.useState)({}),S=Object(b.a)(y,2),C=S[0],k=S[1],N=Object(c.useCallback)((function(e,t){g("identityProvider",e,t)}),[g]),w=function(e,t){var a=Object(Xe.a)(i);a[e]=t,N("accessKeys",a)},T=function(e,t){var a=Object(Xe.a)(r);a[e]=t,N("secretKeys",a)},E=function(e){k(Ks(C,e))};Object(c.useEffect)((function(){var e=[];if("Built-in"===a){e=Object(Xe.a)(e);for(var t=0;t<i.length;t++)e.push({fieldKey:"accesskey-".concat(t.toString()),required:!0,value:i[t],pattern:/^[a-zA-Z0-9-]{8,63}$/,customPatternMessage:"Keys must be at least length 8"}),e.push({fieldKey:"secretkey-".concat(t.toString()),required:!0,value:r[t],pattern:/^[a-zA-Z0-9-]{8,63}$/,customPatternMessage:"Keys must be at least length 8"})}"OpenID"===a&&(e=[].concat(Object(Xe.a)(e),[{fieldKey:"openID_URL",required:!0,value:o},{fieldKey:"openID_clientID",required:!0,value:s},{fieldKey:"openID_secretID",required:!0,value:l}])),"AD"===a&&(e=[].concat(Object(Xe.a)(e),[{fieldKey:"AD_URL",required:!0,value:d},{fieldKey:"ad_userNameFilter",required:!0,value:m},{fieldKey:"ad_groupBaseDN",required:!0,value:h},{fieldKey:"ad_groupSearchFilter",required:!0,value:p},{fieldKey:"ad_nameAttribute",required:!0,value:O}]));var n=zs(e);f("identityProvider",0===Object.keys(n).length),k(n)}),[a,i,r,o,s,l,d,m,h,p,O,f]);var A=null;return"Built-in"===a&&(A=i.map((function(e,a){return Object(n.jsx)(c.Fragment,{children:Object(n.jsxs)("div",{className:t.shortened,children:[Object(n.jsx)(Ca,{id:"accesskey-".concat(a.toString()),label:"",placeholder:"Access Key",name:"accesskey-".concat(a.toString()),value:i[a],onChange:function(e){w(a,e.target.value),E("accesskey-".concat(a.toString()))},index:a,error:C["accesskey-".concat(a.toString())]||""},"csv-accesskey-".concat(a.toString())),Object(n.jsx)(Ca,{id:"secretkey-".concat(a.toString()),label:"",placeholder:"Secret Key",name:"secretkey-".concat(a.toString()),value:r[a],onChange:function(e){T(a,e.target.value),E("secretkey-".concat(a.toString()))},index:a,error:C["secretkey-".concat(a.toString())]||""},"csv-secretkey-".concat(a.toString())),Object(n.jsxs)("div",{className:t.buttonTray,children:[Object(n.jsx)(la.a,{title:"Add User","aria-label":"add",children:Object(n.jsx)(Bt.a,{size:"small",onClick:function(){i.push(""),r.push(""),w(i.length-1,""),T(r.length-1,"")},children:Object(n.jsx)(js.a,{})})}),Object(n.jsx)(la.a,{title:"Randomize Credentials","aria-label":"add",children:Object(n.jsx)(Bt.a,{onClick:function(){w(a,Us(16)),T(a,Us(32))},size:"small",children:Object(n.jsx)(Ys.a,{})})}),Object(n.jsx)(la.a,{title:"Remove","aria-label":"add",children:Object(n.jsx)(Bt.a,{size:"small",style:{marginLeft:16},onClick:function(){i.length>1&&(i.splice(a,1),r.splice(a,1),w(i.length-1,i[i.length-1]))},children:Object(n.jsx)(Zs.a,{})})})]})]})},"identityField-".concat(a.toString()))}))),Object(n.jsxs)(c.Fragment,{children:[Object(n.jsxs)("div",{className:t.headerElement,children:[Object(n.jsx)("h3",{className:t.h3Section,children:"Identity Provider"}),Object(n.jsx)("span",{className:t.descriptionText,children:"Access to the tenant can be controlled via an external Identity Manager."})]}),Object(n.jsxs)(x.a,{item:!0,xs:12,children:[Object(n.jsx)(La,{currentSelection:a,id:"idp-options",name:"idp-options",label:"Protocol",onChange:function(e){N("idpSelection",e.target.value)},selectorOptions:[{label:"Built-in",value:"Built-in"},{label:"OpenID",value:"OpenID"},{label:"Active Directory",value:"AD"}]}),"Add additional users"]})," ","Built-in"===a&&Object(n.jsx)(c.Fragment,{children:A}),"OpenID"===a&&Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"openID_URL",name:"openID_URL",onChange:function(e){N("openIDURL",e.target.value),E("openID_URL")},label:"URL",value:o,error:C.openID_URL||"",required:!0})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"openID_clientID",name:"openID_clientID",onChange:function(e){N("openIDClientID",e.target.value),E("openID_clientID")},label:"Client ID",value:s,error:C.openID_clientID||"",required:!0})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"openID_secretID",name:"openID_secretID",onChange:function(e){N("openIDSecretID",e.target.value),E("openID_secretID")},label:"Secret ID",value:l,error:C.openID_secretID||"",required:!0})})]}),"AD"===a&&Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"AD_URL",name:"AD_URL",onChange:function(e){N("ADURL",e.target.value),E("AD_URL")},label:"URL",value:d,error:C.AD_URL||"",required:!0})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(za,{value:"ad_skipTLS",id:"ad_skipTLS",name:"ad_skipTLS",checked:u,onChange:function(e){var t=e.target.checked;N("ADSkipTLS",t)},label:"Skip TLS Verification"})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(za,{value:"ad_serverInsecure",id:"ad_serverInsecure",name:"ad_serverInsecure",checked:j,onChange:function(e){var t=e.target.checked;N("ADServerInsecure",t)},label:"Server Insecure"})}),j?Object(n.jsxs)(x.a,{item:!0,xs:12,children:[Object(n.jsx)(v.a,{className:t.error,variant:"caption",display:"block",gutterBottom:!0,children:"Warning: All traffic with Active Directory will be unencrypted"}),Object(n.jsx)("br",{})]}):null,Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"ad_userNameFilter",name:"ad_userNameFilter",onChange:function(e){N("ADUserNameFilter",e.target.value),E("ad_userNameFilter")},label:"User Search Filter",value:m,error:C.ad_userNameFilter||"",required:!0})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"ad_groupBaseDN",name:"ad_groupBaseDN",onChange:function(e){N("ADGroupBaseDN",e.target.value),E("ad_groupBaseDN")},label:"Group Search Base DN",value:h,error:C.ad_groupBaseDN||"",required:!0})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"ad_groupSearchFilter",name:"ad_groupSearchFilter",onChange:function(e){N("ADGroupSearchFilter",e.target.value),E("ad_groupSearchFilter")},label:"Group Search Filter",value:p,error:C.ad_groupSearchFilter||"",required:!0})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"ad_nameAttribute",name:"ad_nameAttribute",onChange:function(e){N("ADNameAttribute",e.target.value),E("ad_nameAttribute")},label:"Group Name Attribute",value:O,error:C.ad_nameAttribute||"",required:!0})})]})]})}))),Xs=Object(s.b)((function(e){return{enableTLS:e.tenants.createTenant.fields.security.enableTLS,enableAutoCert:e.tenants.createTenant.fields.security.enableAutoCert,enableCustomCerts:e.tenants.createTenant.fields.security.enableCustomCerts,minioCertificates:e.tenants.createTenant.certificates.minioCertificates,caCertificates:e.tenants.createTenant.certificates.caCertificates,consoleCertificate:e.tenants.createTenant.certificates.consoleCertificate}}),{updateAddField:Bs,isPageValid:Rs,addFileToCaCertificates:function(e,t,a,n){return{type:Es,id:e,key:t,fileName:a,value:n}},deleteCaCertificate:function(e){return{type:As,id:e}},addCaCertificate:function(){return{type:Ts}},addKeyPair:function(){return{type:ks}},addFileToKeyPair:function(e,t,a,n){return{type:Ns,id:e,key:t,fileName:a,value:n}},deleteKeyPair:function(e){return{type:ws,id:e}},addConsoleCertificate:Ps}),el=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({buttonContainer:{textAlign:"right"}},Te),Ge))}))(Xs((function(e){var t=e.classes,a=e.enableTLS,i=e.enableAutoCert,r=e.enableCustomCerts,o=e.minioCertificates,s=e.caCertificates,l=e.consoleCertificate,d=e.updateAddField,u=e.isPageValid,b=e.addFileToCaCertificates,j=e.deleteCaCertificate,m=e.addCaCertificate,h=e.addKeyPair,p=e.addFileToKeyPair,O=e.deleteKeyPair,f=Object(c.useCallback)((function(e,t){d("security",e,t)}),[d]);return Object(c.useEffect)((function(){u("security",!a||(!!i||!!r))}),[a,i,r,u]),Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)("div",{className:t.headerElement,children:Object(n.jsx)("h3",{className:t.h3Section,children:"Security"})}),Object(n.jsxs)(x.a,{item:!0,xs:12,children:[Object(n.jsx)(za,{value:"enableTLS",id:"enableTLS",name:"enableTLS",checked:a,onChange:function(e){var t=e.target.checked;f("enableTLS",t)},label:"Enable TLS"}),"Enable TLS for the tenant, this is required for Encryption Configuration",a&&Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)("br",{}),Object(n.jsx)("br",{}),Object(n.jsx)(v.a,{variant:"caption",display:"block",gutterBottom:!0,children:"AutoCert: MinIO Operator will generate all TLS certificates automatically"}),Object(n.jsx)(v.a,{variant:"caption",display:"block",gutterBottom:!0,children:"Custom certificates: Allow user to provide your own certificates"}),Object(n.jsx)("br",{})]})]}),a&&Object(n.jsxs)(c.Fragment,{children:[Object(n.jsxs)(x.a,{item:!0,xs:12,children:[Object(n.jsx)(za,{value:"enableAutoCert",id:"enableAutoCert",name:"enableAutoCert",checked:i,onChange:function(e){var t=e.target.checked;f("enableAutoCert",t)},label:"Enable AutoCert"}),Object(n.jsx)(za,{value:"enableCustomCerts",id:"enableCustomCerts",name:"enableCustomCerts",checked:r,onChange:function(e){var t=e.target.checked;f("enableCustomCerts",t)},label:"Custom Certificates"})]}),r&&Object(n.jsxs)(c.Fragment,{children:[Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(v.a,{variant:"overline",display:"block",gutterBottom:!0,children:"MinIO Certificates"})}),o.map((function(e){return Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(x.a,{item:!0,xs:5,children:Object(n.jsx)(ts,{onChange:function(t,a){p(e.id,"key",a,t)},accept:".key,.pem",id:"tlsKey",name:"tlsKey",label:"Key",value:e.key})}),Object(n.jsx)(x.a,{item:!0,xs:5,children:Object(n.jsx)(ts,{onChange:function(t,a){p(e.id,"cert",a,t)},accept:".cer,.crt,.cert,.pem",id:"tlsCert",name:"tlsCert",label:"Cert",value:e.cert})}),Object(n.jsx)(x.a,{item:!0,xs:1,children:Object(n.jsx)(g.a,{onClick:function(){O(e.id)},color:"secondary",children:"Remove"})})]},e.id)})),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(g.a,{onClick:h,color:"primary",children:"Add More"})})]}),Object(n.jsx)(x.a,{container:!0,children:Object(n.jsxs)(x.a,{item:!0,xs:12,children:[Object(n.jsx)("br",{}),Object(n.jsx)(Ii.a,{}),Object(n.jsx)("br",{})]})}),Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(v.a,{variant:"overline",display:"block",gutterBottom:!0,children:"CA Certificates"})}),s.map((function(e){return Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(x.a,{item:!0,xs:10,children:Object(n.jsx)(ts,{onChange:function(t,a){b(e.id,"cert",a,t)},accept:".cer,.crt,.cert,.pem",id:"tlsCert",name:"tlsCert",label:"Cert",value:e.cert})}),Object(n.jsx)(x.a,{item:!0,xs:1,children:Object(n.jsx)(g.a,{onClick:function(){j(e.id)},color:"secondary",children:"Remove"})})]},e.id)})),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(g.a,{onClick:m,color:"primary",children:"Add More"})})]}),Object(n.jsx)(x.a,{container:!0,children:Object(n.jsxs)(x.a,{item:!0,xs:12,children:[Object(n.jsx)("br",{}),Object(n.jsx)(Ii.a,{}),Object(n.jsx)("br",{})]})}),Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(v.a,{variant:"overline",display:"block",gutterBottom:!0,children:"Console Certificates"})}),Object(n.jsx)(x.a,{item:!0,xs:6,children:Object(n.jsx)(ts,{onChange:function(e,t){Ps("key",t,e)},accept:".key,.pem",id:"consoleKey",name:"consoleKey",label:"Key",value:l.key})}),Object(n.jsx)(x.a,{item:!0,xs:6,children:Object(n.jsx)(ts,{onChange:function(e,t){Ps("cert",t,e)},accept:".cer,.crt,.cert,.pem",id:"consoleCert",name:"consoleCert",label:"Cert",value:l.cert})})]})]})]})]})}))),tl=Object(s.b)((function(e){return{enableEncryption:e.tenants.createTenant.fields.encryption.enableEncryption,encryptionType:e.tenants.createTenant.fields.encryption.encryptionType,gemaltoEndpoint:e.tenants.createTenant.fields.encryption.gemaltoEndpoint,gemaltoToken:e.tenants.createTenant.fields.encryption.gemaltoToken,gemaltoDomain:e.tenants.createTenant.fields.encryption.gemaltoDomain,gemaltoRetry:e.tenants.createTenant.fields.encryption.gemaltoRetry,awsEndpoint:e.tenants.createTenant.fields.encryption.awsEndpoint,awsRegion:e.tenants.createTenant.fields.encryption.awsRegion,awsKMSKey:e.tenants.createTenant.fields.encryption.awsKMSKey,awsAccessKey:e.tenants.createTenant.fields.encryption.awsAccessKey,awsSecretKey:e.tenants.createTenant.fields.encryption.awsSecretKey,awsToken:e.tenants.createTenant.fields.encryption.awsToken,vaultEndpoint:e.tenants.createTenant.fields.encryption.vaultEndpoint,vaultEngine:e.tenants.createTenant.fields.encryption.vaultEngine,vaultNamespace:e.tenants.createTenant.fields.encryption.vaultNamespace,vaultPrefix:e.tenants.createTenant.fields.encryption.vaultPrefix,vaultAppRoleEngine:e.tenants.createTenant.fields.encryption.vaultAppRoleEngine,vaultId:e.tenants.createTenant.fields.encryption.vaultId,vaultSecret:e.tenants.createTenant.fields.encryption.vaultSecret,vaultRetry:e.tenants.createTenant.fields.encryption.vaultRetry,vaultPing:e.tenants.createTenant.fields.encryption.vaultPing,gcpProjectID:e.tenants.createTenant.fields.encryption.gcpProjectID,gcpEndpoint:e.tenants.createTenant.fields.encryption.gcpEndpoint,gcpClientEmail:e.tenants.createTenant.fields.encryption.gcpClientEmail,gcpClientID:e.tenants.createTenant.fields.encryption.gcpClientID,gcpPrivateKeyID:e.tenants.createTenant.fields.encryption.gcpPrivateKeyID,gcpPrivateKey:e.tenants.createTenant.fields.encryption.gcpPrivateKey,enableCustomCertsForKES:e.tenants.createTenant.fields.encryption.enableCustomCertsForKES,enableAutoCert:e.tenants.createTenant.fields.security.enableAutoCert,enableTLS:e.tenants.createTenant.fields.security.enableTLS,minioCertificates:e.tenants.createTenant.certificates.minioCertificates,serverCertificate:e.tenants.createTenant.certificates.serverCertificate,clientCertificate:e.tenants.createTenant.certificates.clientCertificate,vaultCertificate:e.tenants.createTenant.certificates.vaultCertificate,vaultCA:e.tenants.createTenant.certificates.vaultCA,gemaltoCA:e.tenants.createTenant.certificates.gemaltoCA,enableCustomCerts:e.tenants.createTenant.fields.security.enableCustomCerts}}),{updateAddField:Bs,isPageValid:Rs,addFileServerCert:function(e,t,a){return{type:Is,key:e,fileName:t,value:a}},addFileClientCert:function(e,t,a){return{type:Ms,key:e,fileName:t,value:a}},addFileVaultCert:function(e,t,a){return{type:Fs,key:e,fileName:t,value:a}},addFileVaultCa:function(e,t){return{type:Ds,fileName:e,value:t}},addFileGemaltoCa:function(e,t){return{type:Ls,fileName:e,value:t}}}),al=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({buttonContainer:{textAlign:"right"}},Te),Ge))}))(tl((function(e){var t=e.classes,a=e.updateAddField,i=e.isPageValid,r=e.addFileServerCert,o=e.addFileClientCert,s=e.addFileVaultCert,l=e.addFileVaultCa,d=e.addFileGemaltoCa,u=e.enableEncryption,j=e.enableCustomCerts,m=e.encryptionType,h=e.gemaltoEndpoint,p=e.gemaltoToken,O=e.gemaltoDomain,g=e.gemaltoRetry,f=e.awsEndpoint,y=e.awsRegion,S=e.awsKMSKey,C=e.awsAccessKey,k=e.awsSecretKey,N=e.awsToken,w=e.vaultEndpoint,T=e.vaultEngine,E=e.vaultNamespace,A=e.vaultPrefix,_=e.vaultAppRoleEngine,I=e.vaultId,M=e.vaultSecret,F=e.vaultRetry,D=e.vaultPing,L=e.gcpProjectID,B=e.gcpEndpoint,R=e.gcpClientEmail,P=e.gcpClientID,z=e.gcpPrivateKeyID,K=e.gcpPrivateKey,U=e.enableCustomCertsForKES,W=e.enableAutoCert,V=e.enableTLS,G=e.minioCertificates,q=e.serverCertificate,H=e.clientCertificate,Y=e.vaultCertificate,Q=e.vaultCA,Z=e.gemaltoCA,J=Object(c.useState)({}),$=Object(b.a)(J,2),X=$[0],ee=$[1],te=!1;V&&(W||G&&G.filter((function(e){return e.encoded_key&&e.encoded_cert})).length>0)&&(te=!0);var ae=Object(c.useCallback)((function(e,t){a("encryption",e,t)}),[a]),ne=function(e){ee(Ks(X,e))};return Object(c.useEffect)((function(){var e=[];u&&(j&&(e=[].concat(Object(Xe.a)(e),[{fieldKey:"serverKey",required:!W,value:q.encoded_key},{fieldKey:"serverCert",required:!W,value:q.encoded_cert},{fieldKey:"clientKey",required:!W,value:H.encoded_key},{fieldKey:"clientCert",required:!W,value:H.encoded_cert}])),"vault"===m&&(e=[].concat(Object(Xe.a)(e),[{fieldKey:"vault_endpoint",required:!0,value:w},{fieldKey:"vault_id",required:!0,value:I},{fieldKey:"vault_secret",required:!0,value:M},{fieldKey:"vault_ping",required:!1,value:D,customValidation:parseInt(D)<0,customValidationMessage:"Value needs to be 0 or greater"},{fieldKey:"vault_retry",required:!1,value:F,customValidation:parseInt(F)<0,customValidationMessage:"Value needs to be 0 or greater"}])),"aws"===m&&(e=[].concat(Object(Xe.a)(e),[{fieldKey:"aws_endpoint",required:!0,value:f},{fieldKey:"aws_region",required:!0,value:y},{fieldKey:"aws_accessKey",required:!0,value:C},{fieldKey:"aws_secretKey",required:!0,value:k}])),"gemalto"===m&&(e=[].concat(Object(Xe.a)(e),[{fieldKey:"gemalto_endpoint",required:!0,value:h},{fieldKey:"gemalto_token",required:!0,value:p},{fieldKey:"gemalto_domain",required:!0,value:O},{fieldKey:"gemalto_retry",required:!1,value:g,customValidation:parseInt(g)<0,customValidationMessage:"Value needs to be 0 or greater"}])));var t=zs(e);i("encryption",0===Object.keys(t).length),ee(t)}),[u,m,w,T,I,M,D,F,f,y,k,C,h,p,O,g,L,i,W,j,q.encoded_key,q.encoded_cert,H.encoded_key,H.encoded_cert]),Object(n.jsxs)(c.Fragment,{children:[Object(n.jsxs)("div",{className:t.headerElement,children:[Object(n.jsx)("h3",{className:t.h3Section,children:"Encryption"}),Object(n.jsx)("span",{className:t.descriptionText,children:"How would you like to encrypt the information at rest."})]}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(za,{value:"enableEncryption",id:"enableEncryption",name:"enableEncryption",checked:u,onChange:function(e){var t=e.target.checked;ae("enableEncryption",t)},label:"Enable Server Side Encryption",disabled:!te})}),u&&Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(La,{currentSelection:m,id:"encryptionType",name:"encryptionType",label:"Encryption Options",onChange:function(e){ae("encryptionType",e.target.value)},selectorOptions:[{label:"Vault",value:"vault"},{label:"AWS",value:"aws"},{label:"Gemalto",value:"gemalto"},{label:"GCP",value:"gcp"}]})}),"vault"===m&&Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(za,{value:"enableCustomCertsForKES",id:"enableCustomCertsForKES",name:"enableCustomCertsForKES",checked:U||!W,onChange:function(e){var t=e.target.checked;ae("enableCustomCertsForKES",t)},label:"Custom Certificates",disabled:!W})}),(U||!W)&&Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(v.a,{variant:"overline",display:"block",gutterBottom:!0,children:"Encryption Service Certificates"})}),Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsx)(x.a,{item:!0,xs:6,children:Object(n.jsx)(ts,{onChange:function(e,t){r("key",t,e),ne("serverKey")},accept:".key,.pem",id:"serverKey",name:"serverKey",label:"Key",error:X.serverKey||"",value:q.key,required:!W})}),Object(n.jsx)(x.a,{item:!0,xs:6,children:Object(n.jsx)(ts,{onChange:function(e,t){r("cert",t,e),ne("serverCert")},accept:".cer,.crt,.cert,.pem",id:"serverCert",name:"serverCert",label:"Cert",error:X.serverCert||"",value:q.cert,required:!W})})]}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(v.a,{variant:"overline",display:"block",gutterBottom:!0,children:"Mutual TLS authentication"})}),Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsx)(x.a,{item:!0,xs:6,children:Object(n.jsx)(ts,{onChange:function(e,t){o("key",t,e),ne("clientKey")},accept:".key,.pem",id:"clientKey",name:"clientKey",label:"Key",error:X.clientKey||"",value:H.key,required:!W})}),Object(n.jsx)(x.a,{item:!0,xs:6,children:Object(n.jsx)(ts,{onChange:function(e,t){o("cert",t,e),ne("clientCert")},accept:".cer,.crt,.cert,.pem",id:"clientCert",name:"clientCert",label:"Cert",error:X.clientCert||"",value:H.cert,required:!W})})]})]}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"vault_endpoint",name:"vault_endpoint",onChange:function(e){ae("vaultEndpoint",e.target.value),ne("vault_endpoint")},label:"Endpoint",value:w,error:X.vault_endpoint||"",required:!0})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"vault_engine",name:"vault_engine",onChange:function(e){ae("vaultEngine",e.target.value),ne("vault_engine")},label:"Engine",value:T})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"vault_namespace",name:"vault_namespace",onChange:function(e){ae("vaultNamespace",e.target.value)},label:"Namespace",value:E})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"vault_prefix",name:"vault_prefix",onChange:function(e){ae("vaultPrefix",e.target.value)},label:"Prefix",value:A})}),Object(n.jsx)("h5",{children:"App Role"}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"vault_approle_engine",name:"vault_approle_engine",onChange:function(e){ae("vaultAppRoleEngine",e.target.value)},label:"Engine",value:_})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"vault_id",name:"vault_id",onChange:function(e){ae("vaultId",e.target.value),ne("vault_id")},label:"AppRole ID",value:I,error:X.vault_id||"",required:!0})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"vault_secret",name:"vault_secret",onChange:function(e){ae("vaultSecret",e.target.value),ne("vault_secret")},label:"AppRole Secret",value:M,error:X.vault_secret||"",required:!0})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{type:"number",min:"0",id:"vault_retry",name:"vault_retry",onChange:function(e){ae("vaultRetry",e.target.value),ne("vault_retry")},label:"Retry (Seconds)",value:F,error:X.vault_retry||""})}),Object(n.jsx)("h5",{children:"Mutual TLS authentication (optional)"}),Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsx)(x.a,{item:!0,xs:6,children:Object(n.jsx)(ts,{onChange:function(e,t){s("key",t,e),ne("vault_key")},accept:".key,.pem",id:"vault_key",name:"vault_key",label:"Key",value:Y.key})}),Object(n.jsx)(x.a,{item:!0,xs:6,children:Object(n.jsx)(ts,{onChange:function(e,t){s("cert",t,e),ne("vault_cert")},accept:".cer,.crt,.cert,.pem",id:"vault_cert",name:"vault_cert",label:"Cert",value:Y.cert})})]}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(ts,{onChange:function(e,t){l(t,e),ne("vault_ca")},accept:".cer,.crt,.cert,.pem",id:"vault_ca",name:"vault_ca",label:"CA",value:Q.cert})}),Object(n.jsx)("h5",{children:"Status"}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{type:"number",min:"0",id:"vault_ping",name:"vault_ping",onChange:function(e){ae("vaultPing",e.target.value),ne("vault_ping")},label:"Ping (Seconds)",value:D,error:X.vault_ping||""})})]}),"gcp"===m&&Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"gcp_project_id",name:"gcp_project_id",onChange:function(e){ae("gcpProjectID",e.target.value)},label:"Project ID",value:L})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"gcp_endpoint",name:"gcp_endpoint",onChange:function(e){ae("gcpEndpoint",e.target.value)},label:"Endpoint",value:B})}),Object(n.jsx)("h5",{children:"Credentials"}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"gcp_client_email",name:"gcp_client_email",onChange:function(e){ae("gcpClientEmail",e.target.value)},label:"Client Email",value:R})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"gcp_client_id",name:"gcp_client_id",onChange:function(e){ae("gcpClientID",e.target.value)},label:"Client ID",value:P})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"gcp_private_key_id",name:"gcp_private_key_id",onChange:function(e){ae("gcpPrivateKeyID",e.target.value)},label:"Private Key ID",value:z})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"gcp_private_key",name:"gcp_private_key",onChange:function(e){ae("gcpPrivateKey",e.target.value)},label:"Private Key",value:K})})]}),"aws"===m&&Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"aws_endpoint",name:"aws_endpoint",onChange:function(e){ae("awsEndpoint",e.target.value),ne("aws_endpoint")},label:"Endpoint",value:f,error:X.aws_endpoint||"",required:!0})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"aws_region",name:"aws_region",onChange:function(e){ae("awsRegion",e.target.value),ne("aws_region")},label:"Region",value:y,error:X.aws_region||"",required:!0})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"aws_kmsKey",name:"aws_kmsKey",onChange:function(e){ae("awsKMSKey",e.target.value)},label:"KMS Key",value:S})}),Object(n.jsx)("h5",{children:"Credentials"}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"aws_accessKey",name:"aws_accessKey",onChange:function(e){ae("awsAccessKey",e.target.value),ne("aws_accessKey")},label:"Access Key",value:C,error:X.aws_accessKey||"",required:!0})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"aws_secretKey",name:"aws_secretKey",onChange:function(e){ae("awsSecretKey",e.target.value),ne("aws_secretKey")},label:"Secret Key",value:k,error:X.aws_secretKey||"",required:!0})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"aws_token",name:"aws_token",onChange:function(e){ae("awsToken",e.target.value)},label:"Token",value:N})})]}),"gemalto"===m&&Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"gemalto_endpoint",name:"gemalto_endpoint",onChange:function(e){ae("gemaltoEndpoint",e.target.value),ne("gemalto_endpoint")},label:"Endpoint",value:h,error:X.gemalto_endpoint||"",required:!0})}),Object(n.jsx)("h5",{children:"Credentials"}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"gemalto_token",name:"gemalto_token",onChange:function(e){ae("gemaltoToken",e.target.value),ne("gemalto_token")},label:"Token",value:p,error:X.gemalto_token||"",required:!0})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"gemalto_domain",name:"gemalto_domain",onChange:function(e){ae("gemaltoDomain",e.target.value),ne("gemalto_domain")},label:"Domain",value:O,error:X.gemalto_domain||"",required:!0})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{type:"number",min:"0",id:"gemalto_retry",name:"gemalto_retry",onChange:function(e){ae("gemaltoRetry",e.target.value),ne("gemalto_retry")},label:"Retry (seconds)",value:g,error:X.gemalto_retry||""})}),Object(n.jsx)("h5",{children:"Custom CA Root certificate verification"}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(ts,{onChange:function(e,t){d(t,e),ne("gemalto_ca")},accept:".cer,.crt,.cert,.pem",id:"gemalto_ca",name:"gemalto_ca",label:"CA",value:Z.cert})})]})]})]})}))),nl=Object(s.b)((function(e){return{advancedMode:e.tenants.createTenant.advancedModeOn,volumeSize:e.tenants.createTenant.fields.tenantSize.volumeSize,sizeFactor:e.tenants.createTenant.fields.tenantSize.sizeFactor,drivesPerServer:e.tenants.createTenant.fields.tenantSize.drivesPerServer,nodes:e.tenants.createTenant.fields.tenantSize.nodes,memoryNode:e.tenants.createTenant.fields.tenantSize.memoryNode,ecParity:e.tenants.createTenant.fields.tenantSize.ecParity,ecParityChoices:e.tenants.createTenant.fields.tenantSize.ecParityChoices,cleanECChoices:e.tenants.createTenant.fields.tenantSize.cleanECChoices,maxAllocableMemo:e.tenants.createTenant.fields.tenantSize.maxAllocableMemo,memorySize:e.tenants.createTenant.fields.tenantSize.memorySize,distribution:e.tenants.createTenant.fields.tenantSize.distribution,ecParityCalc:e.tenants.createTenant.fields.tenantSize.ecParityCalc,limitSize:e.tenants.createTenant.fields.tenantSize.limitSize,selectedStorageClass:e.tenants.createTenant.fields.nameTenant.selectedStorageClass}}),{updateAddField:Bs,isPageValid:Rs}),cl=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({buttonContainer:{textAlign:"right"}},Te),Ge))}))(nl((function(e){var t=e.classes,a=e.updateAddField,i=e.isPageValid,r=e.advancedMode,o=e.volumeSize,s=e.sizeFactor,l=e.drivesPerServer,d=e.nodes,u=e.memoryNode,j=e.ecParity,m=e.ecParityChoices,h=e.cleanECChoices,p=e.maxAllocableMemo,O=e.memorySize,g=e.distribution,f=e.ecParityCalc,v=e.limitSize,y=e.selectedStorageClass,S=Object(c.useState)({}),C=Object(b.a)(S,2),k=C[0],N=C[1],w=f.storageFactors.find((function(e){return e.erasureCode===j})),T=Object(c.useCallback)((function(e,t){a("tenantSize",e,t)}),[a]),E=function(e){N(Ks(k,e))},A=Object(c.useCallback)((function(){var e=parseInt(u)||0,t=p||0,a=s,n=function(e,t,a){var n=le(e.toString(10),"Gi",!0),c=parseInt(n,10);if(0===a)return{error:"There is no memory available for the selected number of nodes",request:0,limit:0};if(a<ee)return{error:"There are not enough memory resources available",request:0,limit:0};if(c<ee)return{error:"The requested memory size must be greater than 2Gi",request:0,limit:0};if(c>a)return{error:"The requested memory is greater than the max available memory for the selected number of nodes",request:0,limit:0};var i=parseInt(t,10),r=c;return i>=parseInt(le("1","Pi",!0),10)?r=Math.max(c,parseInt(le("64","Gi",!0),10)):i>=parseInt(le("100","Ti"),10)?r=Math.max(c,parseInt(le("32","Gi",!0),10)):i>=parseInt(le("10","Ti"),10)?r=Math.max(c,parseInt(le("16","Gi",!0),10)):i>=parseInt(le("1","Ti"),10)&&(r=Math.max(c,parseInt(le("8","Gi",!0),10))),{error:"",request:c,limit:r}}(e,le((o||0).toString(10),a),t);T("memorySize",n)}),[p,u,s,T,o]);Object(c.useEffect)((function(){A()}),[u,A]),Object(c.useEffect)((function(){A()}),[p,A]),Object(c.useEffect)((function(){if(m.length>0&&""===g.error){var e=function(e,t,a,n){if(e.length<1)return{error:1,defaultEC:"",erasureCodeSet:0,maxEC:"",rawCapacity:"0",storageFactors:[]};var c=t*a,i=e[0],r=2*parseInt(i.split(":")[1],10),o=e.map((function(e){var a=parseInt(e.split(":")[1],10),n=r/(r-a),i=Math.floor(c/n),o=t-Math.floor(t/n);return{erasureCode:e,storageFactor:n,maxCapacity:i.toString(10),maxFailureTolerations:o}})),s=i,l=e.find((function(e){return"EC:4"===e}));return t>=8&&n>16&&l&&(s="EC:4"),{error:0,storageFactors:o,maxEC:i,rawCapacity:c.toString(10),erasureCodeSet:r,defaultEC:s}}(h,g.persistentVolumes,g.pvSize,g.nodes);T("ecParityCalc",e),T("ecParity",e.defaultEC)}}),[m.length,g,h,T]),Object(c.useEffect)((function(){_(),I(),function(e){""===e||isNaN(parseInt(e))||Oe.invoke("GET","/api/v1/cluster/max-allocatable-memory?num_nodes=".concat(e)).then((function(e){var t=e.max_memory?e.max_memory:0;T("maxAllocableMemo",t)})).catch((function(e){T("maxAllocableMemo",0),console.error(e)}))}(d)}),[d,o,s,l]);var _=function(){var e=o,t=s,a=le("12","Ti",!0),n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,c=le(e.value,e.unit,!0);return parseInt(c,10)<X?{error:"The pool size must be greater than 1Gi",nodes:0,persistentVolumes:0,disks:0,pvSize:0}:t<4?{error:"Number of nodes cannot be less than 4",nodes:0,persistentVolumes:0,disks:0,pvSize:0}:n<=0?{error:"Number of drives must be at least 1",nodes:0,persistentVolumes:0,disks:0,pvSize:0}:de(c,t,a,n)}({unit:t,value:e.toString()},parseInt(d),parseInt(a),parseInt(l));T("distribution",n)},I=function(){T("ecParity",""),""!==d.trim()&&""!==l.trim()&&Oe.invoke("GET","/api/v1/get-parity/".concat(d,"/").concat(l)).then((function(e){T("ecParityChoices",function(e){return e.map((function(e){return{label:e,value:e}}))}(e)),T("cleanECChoices",e)})).catch((function(e){T("ecparityChoices",[]),i("tenantSize",!1),T("ecParity","")}))};return Object(c.useEffect)((function(){var e=le(o,s,!0),t=zs([{fieldKey:"nodes",required:!0,value:d,customValidation:parseInt(d)<4,customValidationMessage:"Number of nodes cannot be less than 4"},{fieldKey:"volume_size",required:!0,value:o,customValidation:parseInt(e)<1073741824||parseInt(e)>v[y],customValidationMessage:"Volume size must be greater than 1Gi and less than ".concat(ce(v[y],!0))},{fieldKey:"memory_per_node",required:!0,value:u,customValidation:parseInt(u)<2,customValidationMessage:"Memory size must be greater than 2Gi"},{fieldKey:"drivesps",required:!0,value:l,customValidation:parseInt(l)<1,customValidationMessage:"There must be at least one drive"}]);i("tenantSize",!("nodes"in t)&&!("volume_size"in t)&&!("memory_per_node"in t)&&!("drivesps"in t)&&""===g.error&&0===f.error&&""===O.error),N(t)}),[d,o,s,u,g,l,f,O,v,y,i]),Object(n.jsxs)(c.Fragment,{children:[Object(n.jsxs)("div",{className:t.headerElement,children:[Object(n.jsx)("h3",{className:t.h3Section,children:"Tenant Size"}),Object(n.jsx)("span",{className:t.descriptionText,children:"Please select the desired capacity"})]}),Object(n.jsx)("span",{className:t.error,children:g.error}),Object(n.jsx)("span",{className:t.error,children:O.error}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"nodes",name:"nodes",type:"number",onChange:function(e){T("nodes",e.target.value),E("nodes")},label:"Number of Servers",value:d,min:"4",required:!0,error:k.nodes||""})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"drivesps",name:"drivesps",type:"number",onChange:function(e){T("drivesPerServer",e.target.value),E("drivesps")},label:"Number of Drives per Server",value:l,min:"1",required:!0,error:k.drivesps||""})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsxs)("div",{className:t.multiContainer,children:[Object(n.jsx)("div",{children:Object(n.jsx)(Ca,{type:"number",id:"volume_size",name:"volume_size",onChange:function(e){T("volumeSize",e.target.value),E("volume_size")},label:"Total Size",value:o,required:!0,error:k.volume_size||"",min:"0"})}),Object(n.jsx)("div",{className:t.sizeFactorContainer,children:Object(n.jsx)(Aa,{label:"Unit",id:"size_factor",name:"size_factor",value:s,onChange:function(e){T("sizeFactor",e.target.value)},options:se()})})]})}),r&&Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{type:"number",id:"memory_per_node",name:"memory_per_node",onChange:function(e){T("memoryNode",e.target.value),E("memory_per_node")},label:"Memory per Node [Gi]",value:u,required:!0,error:k.memory_per_node||"",min:"2"})}),Object(n.jsxs)(x.a,{item:!0,xs:12,children:[Object(n.jsx)(Aa,{id:"ec_parity",name:"ec_parity",onChange:function(e){T("ecParity",e.target.value)},label:"Erasure Code Parity",value:j,options:m}),Object(n.jsx)("span",{className:t.descriptionText,children:"Please select the desired parity. This setting will change the max usable capacity in the cluster"})]})]}),Object(n.jsx)("h4",{children:"Resource Allocation"}),Object(n.jsx)(An.a,{className:t.table,"aria-label":"simple table",children:Object(n.jsxs)(En.a,{children:[Object(n.jsxs)(wn.a,{children:[Object(n.jsx)(Tn.a,{component:"th",scope:"row",children:"Number of Servers"}),Object(n.jsx)(Tn.a,{align:"right",children:parseInt(d)>0?d:"-"})]}),Object(n.jsxs)(wn.a,{children:[Object(n.jsx)(Tn.a,{component:"th",scope:"row",children:"Drives per Server"}),Object(n.jsx)(Tn.a,{align:"right",children:g?g.disks:"-"})]}),Object(n.jsxs)(wn.a,{children:[Object(n.jsx)(Tn.a,{component:"th",scope:"row",children:"Drive Capacity"}),Object(n.jsx)(Tn.a,{align:"right",children:g?ce(g.pvSize):"-"})]}),Object(n.jsxs)(wn.a,{children:[Object(n.jsx)(Tn.a,{component:"th",scope:"row",children:"Total Number of Volumes"}),Object(n.jsx)(Tn.a,{align:"right",children:g?g.persistentVolumes:"-"})]}),!r&&Object(n.jsxs)(wn.a,{children:[Object(n.jsx)(Tn.a,{component:"th",scope:"row",children:"Memory per Node"}),Object(n.jsxs)(Tn.a,{align:"right",children:[u," Gi"]})]})]})}),0===f.error&&w&&Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)("h4",{children:"Erasure Code Configuration"}),Object(n.jsx)(An.a,{className:t.table,"aria-label":"simple table",children:Object(n.jsxs)(En.a,{children:[Object(n.jsxs)(wn.a,{children:[Object(n.jsx)(Tn.a,{component:"th",scope:"row",children:"EC Parity"}),Object(n.jsx)(Tn.a,{align:"right",children:""!==j?j:"-"})]}),Object(n.jsxs)(wn.a,{children:[Object(n.jsx)(Tn.a,{component:"th",scope:"row",children:"Raw Capacity"}),Object(n.jsx)(Tn.a,{align:"right",children:ce(f.rawCapacity)})]}),Object(n.jsxs)(wn.a,{children:[Object(n.jsx)(Tn.a,{component:"th",scope:"row",children:"Usable Capacity"}),Object(n.jsx)(Tn.a,{align:"right",children:ce(w.maxCapacity)})]}),Object(n.jsxs)(wn.a,{children:[Object(n.jsx)(Tn.a,{component:"th",scope:"row",children:"Number of server failures to tolerate"}),Object(n.jsx)(Tn.a,{align:"right",children:g?Math.floor(w.maxFailureTolerations/g.disks):"-"})]})]})})]})]})}))),il=Object(s.b)((function(e){return{advancedMode:e.tenants.createTenant.advancedModeOn,enableTLS:e.tenants.createTenant.fields.security.enableTLS,tenantName:e.tenants.createTenant.fields.nameTenant.tenantName,selectedStorageClass:e.tenants.createTenant.fields.nameTenant.selectedStorageClass,customImage:e.tenants.createTenant.fields.configure.customImage,imageName:e.tenants.createTenant.fields.configure.imageName,consoleImage:e.tenants.createTenant.fields.configure.consoleImage,namespace:e.tenants.createTenant.fields.nameTenant.namespace,volumeSize:e.tenants.createTenant.fields.tenantSize.volumeSize,sizeFactor:e.tenants.createTenant.fields.tenantSize.sizeFactor}}),{}),rl=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({buttonContainer:{textAlign:"right"}},Te),Ge))}))(il((function(e){var t=e.classes,a=e.tenantName,i=e.customImage,r=e.imageName,o=e.consoleImage,s=e.namespace,l=e.selectedStorageClass,d=e.volumeSize,u=e.sizeFactor,b=e.advancedMode,j=e.enableTLS;return Object(n.jsxs)(c.Fragment,{children:[Object(n.jsxs)("div",{className:t.headerElement,children:[Object(n.jsx)("h3",{className:t.h3Section,children:"Review"}),Object(n.jsx)("span",{className:t.descriptionText,children:"Review the details of the new tenant"})]}),Object(n.jsx)(An.a,{size:"small",children:Object(n.jsxs)(En.a,{children:[Object(n.jsxs)(wn.a,{children:[Object(n.jsx)(Tn.a,{align:"right",className:t.tableTitle,children:"Tenant Name"}),Object(n.jsx)(Tn.a,{children:a})]}),i&&Object(n.jsxs)(c.Fragment,{children:[Object(n.jsxs)(wn.a,{children:[Object(n.jsx)(Tn.a,{align:"right",className:t.tableTitle,children:"MinIO Image"}),Object(n.jsx)(Tn.a,{children:r})]}),Object(n.jsxs)(wn.a,{children:[Object(n.jsx)(Tn.a,{align:"right",className:t.tableTitle,children:"Console Image"}),Object(n.jsx)(Tn.a,{children:o})]})]}),""!==s&&Object(n.jsxs)(wn.a,{children:[Object(n.jsx)(Tn.a,{align:"right",className:t.tableTitle,children:"Namespace"}),Object(n.jsx)(Tn.a,{children:s})]}),Object(n.jsxs)(wn.a,{children:[Object(n.jsx)(Tn.a,{align:"right",className:t.tableTitle,children:"Storage Class"}),Object(n.jsx)(Tn.a,{children:l})]}),Object(n.jsxs)(wn.a,{children:[Object(n.jsx)(Tn.a,{align:"right",className:t.tableTitle,children:"Total Size"}),Object(n.jsxs)(Tn.a,{children:[d," ",u]})]}),b&&Object(n.jsx)(c.Fragment,{children:Object(n.jsxs)(wn.a,{children:[Object(n.jsx)(Tn.a,{align:"right",className:t.tableTitle,children:"Enable TLS"}),Object(n.jsx)(Tn.a,{children:j?"Enabled":"Disabled"})]})})]})})]})}))),ol=Object(s.b)((function(e){return{podAffinity:e.tenants.createTenant.fields.affinity.podAffinity,nodeSelectorLabels:e.tenants.createTenant.fields.affinity.nodeSelectorLabels,withPodAntiAffinity:e.tenants.createTenant.fields.affinity.withPodAntiAffinity}}),{setModalErrorSnackMessage:q,updateAddField:Bs,isPageValid:Rs}),sl=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({buttonContainer:{textAlign:"right"}},Te),Ge))}))(ol((function(e){var t=e.classes,a=e.podAffinity,i=e.nodeSelectorLabels,r=e.withPodAntiAffinity,o=(e.setModalErrorSnackMessage,e.updateAddField),s=e.isPageValid,l=Object(c.useState)({}),d=Object(b.a)(l,2),u=d[0],j=d[1],m=Object(c.useCallback)((function(e,t){o("affinity",e,t)}),[o]);return Object(c.useEffect)((function(){var e=[];if("nodeSelector"===a){var t=!0,n=i.split("&");1===n.length&&""===n[0]&&(t=!1),n.forEach((function(e,a){var c=e.split("=");2!==c.length&&(t=!1),a+1!==n.length&&(""!==c[0]&&""!==c[1]||(t=!1))})),e=[].concat(Object(Xe.a)(e),[{fieldKey:"labels",required:!0,value:i,customValidation:!t,customValidationMessage:"You need to add at least one label key-pair"}])}var c=zs(e);s("affinity",0===Object.keys(c).length),j(c)}),[s,a,i]),Object(n.jsxs)(c.Fragment,{children:[Object(n.jsxs)("div",{className:t.headerElement,children:[Object(n.jsx)("h3",{className:t.h3Section,children:"Pod Affinity"}),Object(n.jsx)("span",{className:t.descriptionText,children:"Configure how pods will be assigned to nodes"})]}),Object(n.jsxs)(x.a,{item:!0,xs:12,children:[Object(n.jsx)(La,{currentSelection:a,id:"affinity-options",name:"affinity-options",label:"Type",onChange:function(e){m("podAffinity",e.target.value)},selectorOptions:[{label:"None",value:"none"},{label:"Default (Pod Anti-afinnity)",value:"default"},{label:"Node Selector",value:"nodeSelector"}]}),"MinIO supports multiple configurations for Pod Afinnity"]}),"nodeSelector"===a&&Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)("br",{}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(za,{value:"with_pod_anti_affinity",id:"with_pod_anti_affinity",name:"with_pod_anti_affinity",checked:r,onChange:function(e){var t=e.target.checked;m("withPodAntiAffinity",t)},label:"With Pod Anti-Affinity"})}),Object(n.jsxs)(x.a,{item:!0,xs:12,children:[Object(n.jsx)(zn,{name:"labels",label:"Labels",elements:i,onChange:function(e){m("nodeSelectorLabels",e)},keyPlaceholder:"Label Key",valuePlaceholder:"Label Value",tooltip:"Labels to be used in nodeSelector assignation. Invalid key-pairs will be ignored",withBorder:!0}),Object(n.jsx)("span",{className:t.error,children:u.labels})]})]})]})}))),ll=Object(s.b)((function(e){return{advancedMode:e.tenants.createTenant.advancedModeOn,namespace:e.tenants.createTenant.fields.nameTenant.namespace,validPages:e.tenants.createTenant.validPages,fields:e.tenants.createTenant.fields,certificates:e.tenants.createTenant.certificates}}),{setModalErrorSnackMessage:q,updateAddField:Bs}),dl=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({buttonContainer:{textAlign:"right"}},Te),Ge),Pe))}))(ll((function(e){var t=e.classes,a=e.advancedMode,i=e.fields,r=e.certificates,o=e.namespace,s=e.validPages,l=e.setModalErrorSnackMessage,d=e.closeAndRefresh,u=Object(c.useState)(!1),m=Object(b.a)(u,2),h=m[0],p=m[1],O=Object(c.useState)(null),g=Object(b.a)(O,2),f=g[0],v=g[1],S=Object(c.useState)(!1),C=Object(b.a)(S,2),k=C[0],N=C[1];Object(c.useEffect)((function(){var e=i.nameTenant.tenantName,t=i.nameTenant.selectedStorageClass,a=i.configure.imageName,n=i.configure.consoleImage,c=i.configure.customDockerhub,s=i.configure.imageRegistry,d=i.configure.imageRegistryUsername,u=i.configure.imageRegistryPassword,b=i.configure.exposeMinIO,m=i.configure.exposeConsole,h=i.identityProvider.idpSelection,O=i.identityProvider.openIDURL,g=i.identityProvider.openIDClientID,f=i.identityProvider.openIDSecretID,x=i.identityProvider.ADURL,y=i.identityProvider.ADSkipTLS,S=i.identityProvider.ADServerInsecure,C=i.identityProvider.ADUserNameFilter,w=i.identityProvider.ADGroupBaseDN,T=i.identityProvider.ADGroupSearchFilter,E=i.identityProvider.ADNameAttribute,A=i.identityProvider.accessKeys,_=i.identityProvider.secretKeys,I=r.minioCertificates,M=r.caCertificates,F=r.consoleCertificate,D=r.serverCertificate,L=r.clientCertificate,B=r.vaultCertificate,R=r.vaultCA,P=r.gemaltoCA,z=i.encryption.enableEncryption,K=i.encryption.encryptionType,U=i.encryption.gemaltoEndpoint,W=i.encryption.gemaltoToken,V=i.encryption.gemaltoDomain,G=i.encryption.gemaltoRetry,q=i.encryption.awsEndpoint,H=i.encryption.awsRegion,Y=i.encryption.awsKMSKey,Q=i.encryption.awsAccessKey,J=i.encryption.awsSecretKey,$=i.encryption.awsToken,X=i.encryption.vaultEndpoint,ee=i.encryption.vaultEngine,te=i.encryption.vaultNamespace,ae=i.encryption.vaultPrefix,ne=i.encryption.vaultAppRoleEngine,ce=i.encryption.vaultId,ie=i.encryption.vaultSecret,re=i.encryption.vaultRetry,oe=i.encryption.vaultPing,se=i.encryption.gcpProjectID,le=i.encryption.gcpEndpoint,de=i.encryption.gcpClientEmail,ue=i.encryption.gcpClientID,je=i.encryption.gcpPrivateKeyID,me=i.encryption.gcpPrivateKey,he=i.security.enableAutoCert,pe=i.security.enableTLS,ge=i.tenantSize.ecParity,fe=i.tenantSize.distribution,xe=i.tenantSize.memorySize,ve=i.configure.logSearchCustom,ye=i.configure.prometheusCustom,Se=i.configure.logSearchVolumeSize,Ce=i.configure.logSearchSelectedStorageClass,ke=i.configure.logSearchImage,Ne=i.configure.kesImage,we=i.configure.logSearchPostgresImage,Te=i.configure.prometheusImage,Ee=i.configure.prometheusSelectedStorageClass,Ae=i.configure.prometheusVolumeSize,_e=i.affinity.podAffinity,Ie=i.affinity.nodeSelectorLabels,Me=i.affinity.withPodAntiAffinity;if(k){var Fe=be([]),De={};switch(_e){case"default":De={affinity:Os(e,Fe)};break;case"nodeSelector":De={affinity:gs(Ie,Me,e,Fe)}}var Le=ge.split(":")[1],Be={name:e,namespace:o,access_key:"",secret_key:"",access_keys:[],secret_keys:[],enable_tls:pe&&he,enable_console:!0,enable_prometheus:!0,service_name:"",image:a,console_image:n,expose_minio:b,expose_console:m,pools:[Object(j.a)({name:Fe,servers:fe.nodes,volumes_per_server:fe.disks,volume_configuration:{size:fe.pvSize,storage_class_name:t},resources:{requests:{memory:xe.request},limits:{memory:xe.limit}}},De)],erasureCodingParity:parseInt(Le,10)};c&&(Be=Object(j.a)(Object(j.a)({},Be),{},{image_registry:{registry:s,username:d,password:u}})),Be=ve?Object(j.a)(Object(j.a)({},Be),{},{logSearchConfiguration:{storageClass:Ce,storageSize:parseInt(Se),image:ke,postgres_image:we}}):Object(j.a)(Object(j.a)({},Be),{},{logSearchConfiguration:{image:ke,postgres_image:we}}),Be=ye?Object(j.a)(Object(j.a)({},Be),{},{prometheusConfiguration:{storageClass:Ee,storageSize:parseInt(Ae),image:Te}}):Object(j.a)(Object(j.a)({},Be),{},{prometheusConfiguration:{image:Te}});var Re=null,Pe=null,ze=null;if(M.length>0&&(ze={ca_certificates:M.map((function(e){return e.encoded_cert})).filter((function(e){return e}))}),pe&&I.length>0&&(Re={minio:I.map((function(e){return{crt:e.encoded_cert,key:e.encoded_key}})).filter((function(e){return e.crt&&e.key}))}),pe&&""!==F.encoded_cert&&""!==F.encoded_key&&(Pe={console:{crt:F.encoded_cert,key:F.encoded_key}}),(Re||Pe||ze)&&(Be=Object(j.a)(Object(j.a)({},Be),{},{tls:Object(j.a)(Object(j.a)(Object(j.a)({},Re),Pe),ze)})),z){var Ke={};switch(K){case"gemalto":var Ue={};""!==P.encoded_cert&&(Ue={ca:P.encoded_cert}),Ke={gemalto:{keysecure:{endpoint:U,credentials:{token:W,domain:V,retry:parseInt(G)},tls:Object(j.a)({},Ue)}}};break;case"aws":Ke={aws:{secretsmanager:{endpoint:q,region:H,kmskey:Y,credentials:{accesskey:Q,secretkey:J,token:$}}}};break;case"gcp":Ke={gcp:{secretmanager:{project_id:se,endpoint:le,credentials:{client_email:de,client_id:ue,private_key_id:je,private_key:me}}}};break;case"vault":var We=null,Ve=null;""!==B.encoded_key&&""!==B.encoded_cert&&(We={key:B.encoded_key,crt:B.encoded_cert}),""!==R.encoded_cert&&(Ve={ca:R.encoded_cert});var Ge=null;(We||R)&&(Ge={tls:Object(j.a)(Object(j.a)({},We),Ve)}),Ke={vault:Object(j.a)(Object(j.a)({endpoint:X,engine:ee,namespace:te,prefix:ae,approle:{engine:ne,id:ce,secret:ie,retry:parseInt(re)}},Ge),{},{status:{ping:parseInt(oe)}})}}var qe={},He={};""!==L.encoded_key&&""!==L.encoded_cert&&(He={client:{key:L.encoded_key,crt:L.encoded_cert}}),""!==D.encoded_key&&""!==D.encoded_cert&&(qe={server:{key:D.encoded_key,crt:D.encoded_cert}}),Be=Object(j.a)(Object(j.a)({},Be),{},{encryption:Object(j.a)(Object(j.a)(Object(j.a)({image:Ne},He),qe),Ke)})}var Ye={};switch(h){case"Built-in":for(var Qe=[],Ze=0;Ze<A.length;Ze++)Qe.push({access_key:A[Ze],secret_key:_[Ze]});Ye={keys:Qe};break;case"OpenID":Ye={oidc:{url:O,client_id:g,secret_id:f}};break;case"AD":Ye={active_directory:{url:x,skip_tls_verification:y,server_insecure:S,username_format:"",user_search_filter:C,group_search_base_dn:w,group_search_filter:T,group_name_attribute:E}}}Be=Object(j.a)(Object(j.a)({},Be),{},{idp:Object(j.a)({},Ye)}),Oe.invoke("POST","/api/v1/tenants",Be).then((function(e){var t=Z()(e,"console",[]),a={console:[]};if(t&&Array.isArray(t)){var n=t.map((function(e){return{accessKey:e.access_key,secretKey:e.secret_key}}));a.console=n}else a={console:{accessKey:e.console.access_key,secretKey:e.console.secret_key}};N(!1),p(!0),v(a)})).catch((function(e){N(!1),l(e)}))}}),[k]);var w={label:"Cancel",type:"other",enabled:!0,action:function(){d(!1)}},T=[{label:"Name Tenant",componentRender:Object(n.jsx)(Vs,{}),buttons:[w,{label:"Next",type:"next",enabled:s.includes("nameTenant")}]},{label:"Configure",advancedOnly:!0,componentRender:Object(n.jsx)(qs,{}),buttons:[w,{label:"Back",type:"back",enabled:!0},{label:"Next",type:"next",enabled:s.includes("configure")}]},{label:"Pod Affinity",advancedOnly:!0,componentRender:Object(n.jsx)(sl,{}),buttons:[w,{label:"Back",type:"back",enabled:!0},{label:"Next",type:"next",enabled:s.includes("affinity")}]},{label:"Identity Provider",advancedOnly:!0,componentRender:Object(n.jsx)($s,{}),buttons:[w,{label:"Back",type:"back",enabled:!0},{label:"Next",type:"next",enabled:s.includes("identityProvider")}]},{label:"Security",advancedOnly:!0,componentRender:Object(n.jsx)(el,{}),buttons:[w,{label:"Back",type:"back",enabled:!0},{label:"Next",type:"next",enabled:s.includes("security")}]},{label:"Encryption",advancedOnly:!0,componentRender:Object(n.jsx)(al,{}),buttons:[w,{label:"Back",type:"back",enabled:!0},{label:"Next",type:"next",enabled:s.includes("encryption")}]},{label:"Tenant Size",componentRender:Object(n.jsx)(cl,{}),buttons:[w,{label:"Back",type:"back",enabled:!0},{label:"Next",type:"next",enabled:s.includes("tenantSize")}]},{label:"Preview Configuration",componentRender:Object(n.jsx)(rl,{}),buttons:[w,{label:"Back",type:"back",enabled:!0},{label:"Create",type:"submit",enabled:!k,action:function(){N(!0)}}]}],E=T;a||(E=T.filter((function(e){return!e.advancedOnly})));return Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(x.a,{item:!0,xs:12,className:t.customTitle,children:"Create New Tenant"}),k&&Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(y.a,{})}),h&&Object(n.jsx)(er,{newServiceAccount:f,open:h,closeModal:function(){d(!0)},entity:"Tenant"}),Object(n.jsx)(x.a,{container:!0,children:Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Xa,{wizardSteps:E})})})]})}))),ul=Object(s.b)(null,{setErrorSnackMessage:V,resetAddTenantForm:function(){return{type:Ss}}}),bl=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)(Object(j.a)({},Fe),De),Pe),{},{seeMore:{marginTop:e.spacing(3)},paper:{display:"flex",overflow:"auto",flexDirection:"column"},addSideBar:{width:"320px",padding:"20px"},tableToolbar:{paddingLeft:e.spacing(2),paddingRight:e.spacing(0)},minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:"bold"}}},actionsTray:Object(j.a)(Object(j.a)({},Fe.actionsTray),{},{padding:"0 38px"}),tenantsContainer:{padding:"15px 0"},customConfigurationPage:{height:"calc(100vh - 440px)",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}}))}))(ul((function(e){var t=e.classes,a=e.setErrorSnackMessage,i=e.resetAddTenantForm,r=Object(c.useState)(0),o=Object(b.a)(r,2),s=o[0],l=o[1],d=Object(c.useState)(!1),j=Object(b.a)(d,2),m=j[0],h=j[1],p=Object(c.useState)(null),O=Object(b.a)(p,2),v=O[0],y=O[1],S=Object(c.useState)(!1),C=Object(b.a)(S,2),k=C[0],N=C[1],w=Object(c.useState)(""),T=Object(b.a)(w,2),E=T[0],A=T[1],_=Object(c.useState)([]),I=Object(b.a)(_,2),M=I[0],F=I[1],D=Object(c.useState)(!1),L=Object(b.a)(D,2),B=L[0],R=L[1],P=Object(c.useState)(null),z=Object(b.a)(P,2),K=z[0],U=z[1],W=[{type:"view",onClick:function(e){u.push("/namespaces/".concat(e.namespace,"/tenants/").concat(e.name))}},{type:"delete",onClick:function(e){y(e),h(!0)}}],V=M.filter((function(e){return""===E||e.name.indexOf(E)>=0}));Object(c.useEffect)((function(){if(k){Oe.invoke("GET","/api/v1/tenants").then((function(e){if(null!==e){var t=[];null!==e.tenants&&(t=e.tenants);for(var a=0;a<t.length;a++)t[a].capacity=ce(t[a].total_size+"");F(t),N(!1)}else N(!1)})).catch((function(e){a(e),N(!1)}))}}),[k,a]),Object(c.useEffect)((function(){N(!0)}),[]);return Object(n.jsxs)(c.Fragment,{children:[m&&Object(n.jsx)(ps,{deleteOpen:m,selectedTenant:v,closeDeleteModalAndRefresh:function(e){h(!1),e&&N(!0)}}),B&&Object(n.jsx)(er,{newServiceAccount:K,open:B,closeModal:function(){R(!1),U(null)},entity:"Tenant"}),Object(n.jsx)(x.a,{container:!0,children:Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("div",{className:t.settingsOptionsContainer,children:Object(n.jsx)(_o,{slideOptions:[Object(n.jsx)(c.Fragment,{children:Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.tenantsContainer,children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.actionsTray,children:[Object(n.jsx)(f.a,{placeholder:"Search Tenants",className:t.searchField,id:"search-resource",label:"",onChange:function(e){A(e.target.value)},InputProps:{disableUnderline:!0,startAdornment:Object(n.jsx)(et.a,{position:"start",children:Object(n.jsx)(at.a,{})})}}),Object(n.jsx)(Bt.a,{color:"primary","aria-label":"Refresh Tenant List",component:"span",onClick:function(){N(!0)},children:Object(n.jsx)(qn.a,{})}),Object(n.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(n.jsx)(lt,{}),onClick:function(){l(1)},children:"Create Tenant"})]}),Object(n.jsx)(x.a,{item:!0,xs:12,className:t.tenantsContainer,children:Object(n.jsx)(ha,{itemActions:W,columns:[{label:"Name",elementKey:"name"},{label:"Namespace",elementKey:"namespace"},{label:"Capacity",elementKey:"capacity"},{label:"# of Pools",elementKey:"pool_count"},{label:"State",elementKey:"currentState"}],isLoading:k,records:V,entityName:"Tenants",idField:"name",customPaperHeight:t.customConfigurationPage,noBackground:!0})})]})}),Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(x.a,{item:!0,xs:12,className:t.backContainer,children:Object(n.jsxs)("button",{onClick:function(){l(s-1),i()},className:t.backButton,children:[Object(n.jsx)(Io,{}),"Back To Tenants List"]})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:1===s&&Object(n.jsx)(dl,{closeAndRefresh:function(e){l(0),i(),e&&N(!0)}})})]})],currentSlide:s})})})})})]})}))),jl=Object(w.a)((function(e){return Object(k.a)(Object(j.a)({headerLabel:{fontSize:22,fontWeight:600,color:"#000",marginTop:4}},(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))((function(e){var t=e.classes;return Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(qa,{label:"Tenants"}),Object(n.jsx)(x.a,{container:!0,children:Object(n.jsx)(x.a,{item:!0,xs:12,className:t.container,children:Object(n.jsx)(bl,{})})})]})})),ml=a(450),hl=Object(w.a)((function(e){return Object(k.a)(Object(j.a)({buttonContainer:{textAlign:"right"},multiContainer:{display:"flex",alignItems:"center",justifyContent:"flex-start"},sizeFactorContainer:{marginLeft:8},bottomContainer:{display:"flex",flexGrow:1,alignItems:"center","& div":{flexGrow:1,width:"100%"}},factorElements:{display:"flex",justifyContent:"flex-start"},sizeNumber:{fontSize:35,fontWeight:700,textAlign:"center"},sizeDescription:{fontSize:14,color:"#777",textAlign:"center"}},Te))}))((function(e){var t=e.tenant,a=e.classes,i=e.open,r=e.onClosePoolAndReload,o=Object(c.useState)(!1),s=Object(b.a)(o,2),l=s[0],d=s[1],u=Object(c.useState)(0),j=Object(b.a)(u,2),m=j[0],h=j[1],p=Object(c.useState)(0),O=Object(b.a)(p,2),f=O[0],v=O[1],S=Object(c.useState)(0),C=Object(b.a)(S,2),k=C[0],N=C[1],w=Object(c.useState)(""),T=Object(b.a)(w,2),E=T[0],A=T[1],_=Object(c.useState)([]),I=Object(b.a)(_,2),M=I[0],F=I[1],D=1073741824*f*k,L=D*m;return Object(c.useEffect)((function(){A(""),F([]),Oe.invoke("GET","/api/v1/namespaces/".concat(t.namespace,"/resourcequotas/").concat(t.namespace,"-storagequota")).then((function(e){var t=Z()(e,"elements",[]).map((function(e){var t=Z()(e,"name","").split(".storageclass.storage.k8s.io/requests.storage")[0];return{label:t,value:t}}));F(t),t.length>0&&A(t[0].value)})).catch((function(e){console.error(e)}))}),[t]),Object(n.jsx)(va,{onClose:function(){return r(!1)},modalOpen:i,title:"Add Pool",children:Object(n.jsxs)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){e.preventDefault(),d(!0);var a=be(t.pools),n=Os(t.name,a),c={name:a,servers:m,volumes_per_server:k,volume_configuration:{size:1073741824*f,storage_class_name:E,labels:null},affinity:n};Oe.invoke("POST","/api/v1/namespaces/".concat(t.namespace,"/tenants/").concat(t.name,"/pools"),c).then((function(){d(!1),r(!0)})).catch((function(e){d(!1)}))},children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"number_of_nodes",name:"number_of_nodes",type:"number",onChange:function(e){h(parseInt(e.target.value))},label:"Number o Nodes",value:m.toString(10)})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"pool_size",name:"pool_size",type:"number",onChange:function(e){v(parseInt(e.target.value))},label:"Volume Size (Gi)",value:f.toString(10)})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"volumes_per_sever",name:"volumes_per_sever",type:"number",onChange:function(e){N(parseInt(e.target.value))},label:"Volumes per Server",value:k.toString(10)})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Aa,{id:"storage_class",name:"storage_class",onChange:function(e){A(e.target.value)},label:"Storage Class",value:E,options:M,disabled:M.length<1})}),Object(n.jsxs)(x.a,{item:!0,xs:12,children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:a.bottomContainer,children:[Object(n.jsxs)("div",{className:a.factorElements,children:[Object(n.jsxs)("div",{children:[Object(n.jsx)("div",{className:a.sizeNumber,children:ce(D.toString(10))}),Object(n.jsx)("div",{className:a.sizeDescription,children:"Instance Capacity"})]}),Object(n.jsxs)("div",{children:[Object(n.jsx)("div",{className:a.sizeNumber,children:ce(L.toString(10))}),Object(n.jsx)("div",{className:a.sizeDescription,children:"Total Capacity"})]})]}),Object(n.jsx)("div",{className:a.buttonContainer,children:Object(n.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:l,children:"Save"})})]}),l&&Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(y.a,{})})]})]})})})),pl=Object(w.a)((function(e){return Object(k.a)(Object(j.a)({buttonContainer:{textAlign:"right"},multiContainer:{display:"flex",alignItems:"center",justifyContent:"flex-start"},sizeFactorContainer:{marginLeft:8}},Te))}))((function(e){var t=e.classes,a=e.open,r=e.closeModalAndRefresh,o=Object(c.useState)(!1),s=Object(b.a)(o,2),l=s[0],d=s[1],u=Object(c.useState)(0),j=Object(b.a)(u,2),m=j[0],h=j[1],p=Object(c.useState)(""),O=Object(b.a)(p,2),f=O[0],v=O[1],S=Object(c.useState)(""),C=Object(b.a)(S,2),k=C[0],N=C[1],w=Object(c.useState)(""),T=Object(b.a)(w,2),E=T[0],A=T[1],_=Object(c.useState)(""),I=Object(b.a)(_,2),M=I[0],F=I[1],D=Object(c.useState)(""),L=Object(b.a)(D,2),B=L[0],R=L[1],P=Object(c.useState)(""),z=Object(b.a)(P,2),K=z[0],U=z[1],W=Object(c.useState)(""),V=Object(b.a)(W,2),G=V[0],q=V[1];return Object(n.jsx)(va,{modalOpen:a,title:"Add Pool",onClose:function(){r(!1)},children:Object(n.jsxs)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){e.preventDefault(),d(!0)},children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Aa,{label:"Source Bucket",options:[],onChange:function(e){v(e.target.value)},value:f,name:"source_bucket",id:"source_bucket"})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsxs)(nn.a,{value:m,indicatorColor:"primary",textColor:"primary",onChange:function(e,t){h(t)},"aria-label":"cluster-tabs",variant:"scrollable",scrollButtons:"auto",children:[Object(n.jsx)(cn.a,{label:"Local Cluster"}),Object(n.jsx)(cn.a,{label:"Remote Cluster"})]})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("br",{})}),0===m&&Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Aa,{label:"Cluster",options:[],onChange:function(e){N(e.target.value)},value:k,name:"cluster",id:"cluster"})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Aa,{label:"Destination Bucket",options:[],onChange:function(e){A(e.target.value)},value:E,name:"destination_bucket",id:"destination_bucket"})})]}),1===m&&Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"address",name:"address",onChange:function(e){F(e.target.value)},label:"Address",value:M})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"bucket",name:"bucket",onChange:function(e){R(e.target.value)},label:"Bucket",value:B})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"accessKey",name:"accessKey",onChange:function(e){U(e.target.value)},label:"Access Key",value:K})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"secretKey",name:"secretKey",onChange:function(e){q(e.target.value)},label:"Secret Key",value:G})})]}),Object(n.jsx)(x.a,{item:!0,xs:12,className:t.buttonContainer,children:Object(n.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:l,children:"Save"})}),l&&Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(y.a,{})})]})})})),Ol=Object(w.a)((function(e){return{root:{height:10,borderRadius:5},colorPrimary:{backgroundColor:"#F4F4F4"},bar:{borderRadius:5,backgroundColor:"#081C42"},padChart:{padding:"5px"}}}))(y.a),gl=Object(w.a)((function(e){return Object(k.a)({paperContainer:{padding:15},allValue:{fontSize:16,fontWeight:700,marginBottom:8},currentUsage:{fontSize:12,marginTop:8},centerItem:{textAlign:"center"}})}))((function(e){var t=e.classes,a=e.maxValue,c=e.currValue,r=e.label,o=e.renderFunction,s=e.loading,l=e.error,d=100*c/a;return Object(n.jsxs)(i.a.Fragment,{children:[s&&Object(n.jsx)("div",{className:t.padChart,children:Object(n.jsx)(x.a,{item:!0,xs:12,className:t.centerItem,children:Object(n.jsx)(S.a,{color:"primary",size:40,variant:"indeterminate"})})}),s?null:""!==l?Object(n.jsx)(es,{errorMessage:l,withBreak:!1}):Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.allValue,children:[r," ",o?o(a.toString()):a]}),Object(n.jsx)(Ol,{variant:"determinate",value:d}),Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.currentUsage,children:["Used:"," ",o?o(c.toString()):c]})]})]})})),fl=Object(s.b)(null,{setModalErrorSnackMessage:q}),xl=Object(w.a)((function(e){return Object(k.a)(Object(j.a)({buttonContainer:{textAlign:"right"}},Te))}))(fl((function(e){var t=e.open,a=e.closeModalAndRefresh,i=e.namespace,r=e.idTenant,o=e.setModalErrorSnackMessage,s=e.classes,l=Object(c.useState)(!1),d=Object(b.a)(l,2),u=d[0],m=d[1],h=Object(c.useState)(""),p=Object(b.a)(h,2),O=p[0],f=p[1],v=Object(c.useState)(""),y=Object(b.a)(v,2),S=y[0],C=y[1],k=Object(c.useState)(!1),N=Object(b.a)(k,2),w=N[0],T=N[1],E=Object(c.useState)(""),A=Object(b.a)(E,2),_=A[0],I=A[1],M=Object(c.useState)(""),F=Object(b.a)(M,2),D=F[0],L=F[1],B=Object(c.useState)(""),R=Object(b.a)(B,2),P=R[0],z=R[1],K=Object(c.useState)(!0),U=Object(b.a)(K,2),W=U[0],V=U[1],G=Object(c.useState)(!0),q=Object(b.a)(G,2),H=q[0],Y=q[1],Q=Object(c.useCallback)((function(e){var t=new RegExp("^$|^((.*?)/(.*?):(.+))$");switch(e){case"consoleImage":Y(t.test(S));break;case"minioImage":V(t.test(O))}}),[S,O]);Object(c.useEffect)((function(){Q("minioImage")}),[O,Q]),Object(c.useEffect)((function(){Q("consoleImage")}),[S,Q]);return Object(n.jsx)(va,{title:"Update MinIO Version",modalOpen:t,onClose:function(){a(!1)},children:Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:s.formScrollable,children:[Object(n.jsx)("span",{children:"Please enter the MinIO image from dockerhub to use. If blank, then latest build will be used."}),Object(n.jsx)("br",{}),Object(n.jsx)("br",{}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{value:O,label:"MinIO's Image",id:"minioImage",name:"minioImage",placeholder:"E.g. minio/minio:RELEASE.2020-05-08T02-40-49Z",onChange:function(e){f(e.target.value)}})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{value:S,label:"Console's Image",id:"consoleImage",name:"consoleImage",placeholder:"E.g. minio/console:v0.3.13",onChange:function(e){C(e.target.value)}})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(za,{value:"imageRegistry",id:"setImageRegistry",name:"setImageRegistry",checked:w,onChange:function(e){T(!w)},label:"Set Custom Image Registry",indicatorLabels:["Yes","No"]})}),w&&Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{value:_,label:"Endpoint",id:"imageRegistry",name:"imageRegistry",placeholder:"E.g. https://index.docker.io/v1/",onChange:function(e){I(e.target.value)}})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{value:D,label:"Username",id:"imageRegistryUsername",name:"imageRegistryUsername",placeholder:"Enter image registry username",onChange:function(e){L(e.target.value)}})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{value:P,label:"Password",id:"imageRegistryPassword",name:"imageRegistryPassword",placeholder:"Enter image registry password",onChange:function(e){z(e.target.value)}})})]})]}),Object(n.jsxs)(x.a,{item:!0,xs:12,className:s.buttonContainer,children:[Object(n.jsx)("button",{type:"button",color:"primary",className:s.clearButton,onClick:function(){f(""),C(""),T(!1),I(""),L(""),z("")},children:"Clear"}),Object(n.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:!W||!H||w&&(""===_.trim()||""===D.trim()||""===P.trim())||u,onClick:function(){m(!0);var e={image:O,console_image:S,enable_prometheus:!0};if(w){var t={image_registry:{registry:_,username:D,password:P}};e=Object(j.a)(Object(j.a)({},e),t)}Oe.invoke("PUT","/api/v1/namespaces/".concat(i,"/tenants/").concat(r),e).then((function(){m(!1),a(!0)})).catch((function(e){o(e),m(!1)}))},children:"Save"})]})]})})}))),vl=a(436),yl=a.n(vl),Sl={setModalErrorSnackMessage:q},Cl=Object(s.b)(null,Sl),kl=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({jsonPolicyEditor:{minHeight:400,width:"100%"},buttonContainer:{textAlign:"right"},errorState:{color:"#b53b4b",fontSize:14,fontWeight:"bold"}},Te),we))}))(Cl((function(e){var t=e.classes,a=e.open,i=e.closeModalAndRefresh,r=e.tenant,o=e.namespace,s=e.setModalErrorSnackMessage,l=Object(c.useState)(!1),d=Object(b.a)(l,2),u=d[0],j=d[1],m=Object(c.useState)(!1),h=Object(b.a)(m,2),p=h[0],O=h[1],f=Object(c.useState)(""),v=Object(b.a)(f,2),S=v[0],C=v[1],k=Object(c.useState)(""),N=Object(b.a)(k,2),w=N[0],T=N[1];Object(c.useEffect)((function(){Oe.invoke("GET","/api/v1/namespaces/".concat(o,"/tenants/").concat(r,"/yaml")).then((function(e){O(!1),C(e.yaml)})).catch((function(e){O(!1),s(e)}))}),[r,o,s]),Object(c.useEffect)((function(){}),[]);var E=""!==S.trim();return Object(n.jsxs)(va,{modalOpen:a,onClose:function(){i(!1)},title:"YAML",children:[p&&Object(n.jsx)(y.a,{}),""!==w&&Object(n.jsx)("div",{className:t.errorState,children:w}),!p&&Object(n.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){e.preventDefault(),u||(j(!0),T(""),Oe.invoke("PUT","/api/v1/namespaces/".concat(o,"/tenants/").concat(r,"/yaml"),{yaml:S}).then((function(e){j(!1),i(!0),T("")})).catch((function(e){j(!1),console.log(e),T(e)})))},children:Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.formScrollable,children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("br",{})}),Object(n.jsx)(pc,{label:"Tenant Specification",value:S,mode:"yaml",onBeforeChange:function(e,t,a){C(a)}})]}),Object(n.jsx)(x.a,{item:!0,xs:12,className:t.buttonContainer,children:Object(n.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:u||!E,children:"Save"})}),u&&Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(y.a,{})})]})})]})}))),Nl=Object(w.a)((function(e){return Object(k.a)(Object(j.a)({paperContainer:{padding:"15px 15px 15px 50px"},licenseInfoValue:{textTransform:"none",fontSize:14,fontWeight:"bold"},licenseContainer:{position:"relative",padding:"20px 52px 0px 28px",background:"#032F51",boxShadow:"0px 3px 7px #00000014","& h2":{color:"#FFF",marginBottom:67},"& a":{textDecoration:"none"},"& h3":{color:"#FFFFFF",marginBottom:"30px",fontWeight:"bold"},"& h6":{color:"#FFFFFF !important"}},licenseInfo:{color:"#FFFFFF",position:"relative"},licenseInfoTitle:{textTransform:"none",color:"#BFBFBF",fontSize:11},verifiedIcon:{width:96,position:"absolute",right:0,bottom:29},noUnderLine:{textDecoration:"none"}},(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))((function(e){var t=e.classes,a=e.tenant,c=e.loadingActivateProduct,r=e.loadingLicenseInfo,o=e.licenseInfo,s=e.activateProduct;return Object(n.jsx)(C.a,{className:a&&a.subnet_license?t.licenseContainer:"",children:a&&a.subnet_license?Object(n.jsx)(i.a.Fragment,{children:Object(n.jsxs)(x.a,{container:!0,className:t.licenseInfo,children:[Object(n.jsxs)(x.a,{item:!0,xs:6,children:[Object(n.jsx)(v.a,{variant:"button",display:"block",gutterBottom:!0,className:t.licenseInfoTitle,children:"License"}),Object(n.jsx)(v.a,{variant:"overline",display:"block",gutterBottom:!0,className:t.licenseInfoValue,children:"Commercial License"}),Object(n.jsx)(v.a,{variant:"button",display:"block",gutterBottom:!0,className:t.licenseInfoTitle,children:"Organization"}),Object(n.jsx)(v.a,{variant:"overline",display:"block",gutterBottom:!0,className:t.licenseInfoValue,children:a.subnet_license.organization}),Object(n.jsx)(v.a,{variant:"button",display:"block",gutterBottom:!0,className:t.licenseInfoTitle,children:"Registered Capacity"}),Object(n.jsx)(v.a,{variant:"overline",display:"block",gutterBottom:!0,className:t.licenseInfoValue,children:ce((1099511627776*a.subnet_license.storage_capacity).toString(10))}),Object(n.jsx)(v.a,{variant:"button",display:"block",gutterBottom:!0,className:t.licenseInfoTitle,children:"Expiry Date"}),Object(n.jsx)(v.a,{variant:"overline",display:"block",gutterBottom:!0,className:t.licenseInfoValue,children:Object(n.jsx)(rt.a,{format:"YYYY-MM-DD",children:a.subnet_license.expires_at})})]}),Object(n.jsxs)(x.a,{item:!0,xs:6,children:[Object(n.jsx)(v.a,{variant:"button",display:"block",gutterBottom:!0,className:t.licenseInfoTitle,children:"Subscription Plan"}),Object(n.jsx)(v.a,{variant:"overline",display:"block",gutterBottom:!0,className:t.licenseInfoValue,children:a.subnet_license.plan}),Object(n.jsx)(v.a,{variant:"button",display:"block",gutterBottom:!0,className:t.licenseInfoTitle,children:"Requester"}),Object(n.jsx)(v.a,{variant:"overline",display:"block",gutterBottom:!0,className:t.licenseInfoValue,children:a.subnet_license.email})]}),Object(n.jsx)("img",{className:t.verifiedIcon,src:"/verified.svg",alt:"verified"})]})}):!r&&Object(n.jsxs)(x.a,{className:t.paperContainer,children:[!o&&Object(n.jsx)(Ht.a,{to:"/license",onClick:function(e){e.stopPropagation()},className:t.noUnderLine,children:Object(n.jsx)(g.a,{className:t.licenseButton,variant:"contained",color:"primary",children:"Activate Product"})}),o&&a&&Object(n.jsx)(g.a,{disabled:c,className:t.licenseButton,variant:"contained",color:"primary",onClick:function(){return s(a.namespace,a.name)},children:"Attach License"})]})})})),wl=Object(s.b)(null,{setErrorSnackMessage:V}),Tl=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)(Object(j.a)(Object(j.a)(Object(j.a)({buttonContainer:{textAlign:"right"},multiContainer:{display:"flex",alignItems:"center",justifyContent:"flex-start"},sizeFactorContainer:{marginLeft:8},containerHeader:{display:"flex",justifyContent:"space-between"},paperContainer:{padding:"15px 15px 15px 50px"},infoGrid:{display:"grid",gridTemplateColumns:"auto auto auto auto",gridGap:8,"& div":{display:"flex",alignItems:"center"},"& div:nth-child(odd)":{justifyContent:"flex-end",fontWeight:700},"& div:nth-child(2n)":{paddingRight:35}},masterActions:{width:"25%",minWidth:"120px","& div":{margin:"5px 0px"}},updateButton:{backgroundColor:"transparent",border:0,padding:"0 6px",cursor:"pointer","&:focus, &:active":{outline:"none"},"& svg":{height:12}},poolLabel:{color:"#666666"},titleCol:{fontWeight:"bold"},breadcrumLink:{textDecoration:"none",color:"black"}},Te),Fe),qe),De),He),{},{actionsTray:Object(j.a)(Object(j.a)({},Fe.actionsTray),{},{padding:"15px 0 0"})},(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))(wl((function(e){var t=e.classes,a=e.match,r=e.setErrorSnackMessage,o=Object(c.useState)(0),s=Object(b.a)(o,2),l=s[0],d=s[1],u=Object(c.useState)(0),j=Object(b.a)(u,2),m=j[0],h=j[1],p=Object(c.useState)(0),O=Object(b.a)(p,2),v=O[0],y=O[1],S=Object(c.useState)([]),k=Object(b.a)(S,2),N=k[0],w=k[1],T=Object(c.useState)([]),E=Object(b.a)(T,2),A=E[0],_=E[1],I=Object(c.useState)(0),M=Object(b.a)(I,2),F=M[0],D=M[1],L=Object(c.useState)(0),B=Object(b.a)(L,2),R=B[0],P=B[1],z=Object(c.useState)(!1),K=Object(b.a)(z,2),U=K[0],W=K[1],V=Object(c.useState)(!1),G=Object(b.a)(V,2),q=G[0],H=G[1],Y=Object(c.useState)(!1),Q=Object(b.a)(Y,2),J=Q[0],$=Q[1],X=Object(c.useState)(null),ee=Object(b.a)(X,2),te=ee[0],ae=ee[1],ne=Object(c.useState)(!0),ie=Object(b.a)(ne,2),re=ie[0],oe=ie[1],se=Object(c.useState)(""),le=Object(b.a)(se,2),de=le[0],ue=le[1],be=Object(c.useState)(0),me=Object(b.a)(be,2),he=me[0],pe=me[1],ge=Object(c.useState)(!1),fe=Object(b.a)(ge,2),xe=fe[0],ve=fe[1],ye=Object(c.useState)(!1),Se=Object(b.a)(ye,2),Ce=Se[0],ke=Se[1],Ne=Object(c.useState)(),we=Object(b.a)(Ne,2),Te=we[0],Ee=we[1],Ae=Object(c.useState)(!0),_e=Object(b.a)(Ae,2),Ie=_e[0],Me=_e[1],Fe=Object(c.useState)(!1),De=Object(b.a)(Fe,2),Le=De[0],Be=De[1],Re=Object(c.useState)(!1),Pe=Object(b.a)(Re,2),ze=Pe[0],Ke=Pe[1],Ue=Object(c.useState)(!1),We=Object(b.a)(Ue,2),Ve=We[0],Ge=We[1],qe=Object(c.useState)(!1),He=Object(b.a)(qe,2),Ye=He[0],Qe=He[1],Ze=Object(c.useState)(!1),Je=Object(b.a)(Ze,2),$e=Je[0],Xe=Je[1],tt=Object(c.useState)(!1),nt=Object(b.a)(tt,2),ct=nt[0],it=nt[1],rt=a.params.tenantName,ot=a.params.tenantNamespace,st=function(){Oe.invoke("GET","/api/v1/namespaces/".concat(ot,"/tenants/").concat(rt)).then((function(e){var t,a=e.pools?e.pools:[],n=0,c=0,i=0,r=Object(Mr.a)(a);try{for(r.s();!(t=r.n()).done;){var o=t.value,s=o.volumes_per_server*o.servers*o.volume_configuration.size;o.label="pool-".concat(i),void 0!==o.name&&""!==o.name||(o.name=o.label),o.capacity=ce(s+""),o.volumes=o.servers*o.volumes_per_server,n+=o.servers,c+=o.volumes,i+=1}}catch(l){r.e(l)}finally{r.f()}h(e.total_size||0),y(a.length),P(c),D(n),w(a),Ke(e.logEnabled),Ge(e.monitoringEnabled),Qe(e.encryptionEnabled),Xe(e.idpAdEnabled),it(e.idpOicEnabled),ae(e)})).catch((function(e){r(e)}))},dt=function(){Oe.invoke("GET","/api/v1/namespaces/".concat(ot,"/tenants/").concat(rt,"/usage")).then((function(e){var t=Z()(e,"disk_used","0");pe(parseInt(t)),ue(""),oe(!1)})).catch((function(e){ue(e),pe(0),oe(!1)}))};Object(c.useEffect)((function(){st(),dt(),Me(!0),Oe.invoke("GET","/api/v1/subscription/info").then((function(e){Ee(e),Me(!1)})).catch((function(e){Me(!1)})),Oe.invoke("GET","/api/v1/namespaces/".concat(ot,"/tenants/").concat(rt,"/pods")).then((function(e){for(var t=0;t<e.length;t++){var a=(new Date).getSeconds();e[t].time=je((a-parseInt(e[t].timeCreated)).toString())}_(e)})).catch((function(e){r("Error loading pods")}))}),[]);var ut=i.a.useState(null),bt=Object(b.a)(ut,2),jt=bt[0],mt=bt[1],ht=function(){mt(null),ke(!0)};return Object(n.jsxs)(i.a.Fragment,{children:[U&&null!==te&&Object(n.jsx)(hl,{open:U,onClosePoolAndReload:function(e){W(!1),e&&(st(),dt())},tenant:te}),q&&Object(n.jsx)(Ka,{open:q,closeModalAndRefresh:function(){H(!1)}}),J&&Object(n.jsx)(pl,{open:J,closeModalAndRefresh:function(e){$(!1),e&&(st(),dt())}}),xe&&Object(n.jsx)(xl,{open:xe,closeModalAndRefresh:function(){ve(!1)},idTenant:rt,namespace:ot}),Ce&&Object(n.jsx)(kl,{open:Ce,closeModalAndRefresh:function(){ke(!1),st()},tenant:rt,namespace:ot}),Object(n.jsx)(qa,{label:Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(Ht.a,{to:"/tenants",className:t.breadcrumLink,children:"Tenant"})," > ".concat(a.params.tenantName),Object(n.jsx)(Bt.a,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true",onClick:function(e){mt(e.currentTarget)},children:Object(n.jsx)(yl.a,{})}),Object(n.jsx)(ml.a,{id:"long-menu",anchorEl:jt,keepMounted:!0,open:Boolean(jt),onClose:ht,children:Object(n.jsx)(Ta.a,{onClick:ht,children:"Edit YAML"},"yaml")})]})}),Object(n.jsx)(x.a,{item:!0,xs:12,className:t.container}),Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsxs)(nn.a,{value:l,indicatorColor:"primary",textColor:"primary",onChange:function(e,t){d(t)},"aria-label":"tenant-tabs",variant:"scrollable",scrollButtons:"auto",children:[Object(n.jsx)(cn.a,{label:"Summary"}),Object(n.jsx)(cn.a,{label:"Pools"}),Object(n.jsx)(cn.a,{label:"Pods"}),Object(n.jsx)(cn.a,{label:"License"})]})}),Object(n.jsxs)(x.a,{item:!0,xs:12,children:[0===l&&Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsx)("br",{}),Object(n.jsx)(C.a,{className:t.paperContainer,children:Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsx)(x.a,{item:!0,xs:8,children:Object(n.jsxs)("table",{width:"100%",children:[Object(n.jsx)("tr",{children:Object(n.jsxs)("td",{colSpan:4,children:[Object(n.jsx)("h2",{children:"Details"}),Object(n.jsx)("hr",{className:t.hrClass})]})}),Object(n.jsxs)("tr",{children:[Object(n.jsx)("td",{className:t.titleCol,children:"Capacity:"}),Object(n.jsx)("td",{children:ce(m.toString(10))}),Object(n.jsx)("td",{className:t.titleCol,children:"MinIO:"}),Object(n.jsx)("td",{children:Object(n.jsx)(g.a,{color:"primary",className:t.anchorButton,onClick:function(){ve(!0)},children:te?te.image:""})})]}),Object(n.jsxs)("tr",{children:[Object(n.jsx)("td",{className:t.titleCol,children:"Clusters:"}),Object(n.jsx)("td",{children:v}),Object(n.jsx)("td",{className:t.titleCol,children:"Console:"}),Object(n.jsx)("td",{children:Object(n.jsx)(g.a,{color:"primary",className:t.anchorButton,onClick:function(){ve(!0)},children:te?te.console_image:""})})]}),Object(n.jsxs)("tr",{children:[Object(n.jsx)("td",{className:t.titleCol,children:"Instances:"}),Object(n.jsx)("td",{children:F}),Object(n.jsx)("td",{className:t.titleCol,children:"Volumes:"}),Object(n.jsx)("td",{children:R})]}),(null===te||void 0===te?void 0:te.endpoints)&&Object(n.jsxs)("tr",{children:[Object(n.jsx)("td",{className:t.titleCol,children:"Endpoint:"}),Object(n.jsx)("td",{children:Object(n.jsx)("a",{href:null===te||void 0===te?void 0:te.endpoints.minio,target:"_blank",rel:"noopener noreferrer",children:null===te||void 0===te?void 0:te.endpoints.minio})}),Object(n.jsx)("td",{className:t.titleCol,children:"Console:"}),Object(n.jsx)("td",{children:Object(n.jsx)("a",{href:null===te||void 0===te?void 0:te.endpoints.console,target:"_blank",rel:"noopener noreferrer",children:null===te||void 0===te?void 0:te.endpoints.console})})]}),Object(n.jsxs)("tr",{children:[Object(n.jsx)("td",{className:t.titleCol,children:"State:"}),Object(n.jsx)("td",{colSpan:3,children:null===te||void 0===te?void 0:te.currentState})]})]})}),Object(n.jsx)(x.a,{item:!0,xs:4,children:Object(n.jsx)(gl,{currValue:he,maxValue:te?te.total_size:0,label:"Storage",renderFunction:ce,error:de,loading:re})})]})}),Object(n.jsx)("br",{}),Object(n.jsx)("br",{}),Object(n.jsx)(C.a,{className:t.paperContainer,children:Object(n.jsx)(x.a,{container:!0,children:Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsxs)("table",{width:"100%",children:[Object(n.jsx)("tr",{children:Object(n.jsxs)("td",{colSpan:4,children:[Object(n.jsx)("h2",{children:"Features"}),Object(n.jsx)("hr",{className:t.hrClass})]})}),Object(n.jsxs)("tr",{children:[Object(n.jsx)("td",{className:t.titleCol,children:"Logs:"}),Object(n.jsx)("td",{children:Object(n.jsx)(g.a,{color:"primary",className:t.anchorButton,children:ze?"Enabled":"Disabled"})}),Object(n.jsx)("td",{className:t.titleCol,children:"Monitoring:"}),Object(n.jsx)("td",{children:Object(n.jsx)(g.a,{color:"primary",className:t.anchorButton,children:Ve?"Enabled":"Disabled"})})]}),Object(n.jsxs)("tr",{children:[Object(n.jsx)("td",{className:t.titleCol,children:"Encryption:"}),Object(n.jsx)("td",{children:Object(n.jsx)(g.a,{color:"primary",className:t.anchorButton,children:Ye?"Enabled":"Disabled"})}),Object(n.jsx)("td",{}),Object(n.jsx)("td",{})]}),Object(n.jsxs)("tr",{children:[$e||!$e&&!ct&&Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsx)("td",{className:t.titleCol,children:"Active Directory:"}),Object(n.jsx)("td",{children:Object(n.jsx)(g.a,{color:"primary",className:t.anchorButton,children:$e?"Enabled":"Disabled"})})]}),ct||!ct&&!$e&&Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsx)("td",{className:t.titleCol,children:"OpenID:"}),Object(n.jsx)("td",{children:Object(n.jsx)(g.a,{color:"primary",className:t.anchorButton,children:ct?"Enabled":"Disabled"})})]})]})]})})})})]}),1===l&&Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.actionsTray,children:[Object(n.jsx)(f.a,{placeholder:"Filter",className:t.searchField,id:"search-resource",label:"",onChange:function(e){},InputProps:{disableUnderline:!0,startAdornment:Object(n.jsx)(et.a,{position:"start",children:Object(n.jsx)(at.a,{})})}}),Object(n.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(n.jsx)(lt,{}),onClick:function(){W(!0)},children:"Expand Tenant"})]}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("br",{})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(ha,{itemActions:[{type:"delete",onClick:function(e){console.log(e)},sendOnlyId:!0}],columns:[{label:"Name",elementKey:"name"},{label:"Capacity",elementKey:"capacity"},{label:"# of Instances",elementKey:"servers"},{label:"# of Drives",elementKey:"volumes"}],isLoading:!1,records:N,entityName:"Servers",idField:"name"})})]}),2===l&&Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsx)("br",{}),Object(n.jsx)(ha,{columns:[{label:"Name",elementKey:"name"},{label:"Status",elementKey:"status"},{label:"Age",elementKey:"time"},{label:"Pod IP",elementKey:"podIP"},{label:"Restarts",elementKey:"restarts",renderFunction:function(e){return null!=e?e:0}},{label:"Node",elementKey:"node"}],isLoading:!1,records:A,entityName:"Servers",idField:"name"})]}),3===l&&Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsx)("br",{}),Object(n.jsx)(x.a,{container:!0,children:Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Nl,{tenant:te,loadingLicenseInfo:Ie,loadingActivateProduct:Le,licenseInfo:Te,activateProduct:function(e,t){Le||(Be(!0),Oe.invoke("POST","/api/v1/subscription/namespaces/".concat(e,"/tenants/").concat(t,"/activate"),{}).then((function(){Be(!1),st()})).catch((function(e){Be(!1),r(e)})))}})})})]})]})]})]})}))),El="OBJECT_BROWSER/ADD_ROUTE",Al="OBJECT_BROWSER/RESET_ROUTES_LIST",_l="OBJECT_BROWSER/REMOVE_ROUTE_LEVEL",Il="OBJECT_BROWSER/SET_ALL_ROUTES",Ml="OBJECT_BROWSER/CREATE_FOLDER",Fl="OBJECT_BROWSER/SET_LAST_AS_FILE",Dl="OBJECT_BROWSER/DOWNLOAD_FILE_LOADER",Ll="OBJECT_BROWSER/DOWNLOADED_FILE",Bl=function(e,t,a){return{type:El,route:e,label:t,routeType:a}},Rl=function(e){return{type:_l,toRoute:e}},Pl=function(e){return{type:Il,currentRoute:e}},zl=function(e){return{type:Dl,path:e}},Kl=function(e){return{type:Ll,path:e}},Ul={removeRouteLevel:Rl},Wl=Object(s.b)((function(e){var t=e.objectBrowser;return{objectsList:Z()(t,"routesList",[])}}),Ul)(Object(w.a)((function(e){return Object(k.a)(Object(j.a)({},Be))}))((function(e){var t=e.classes,a=e.objectsList,c=e.removeRouteLevel,r=a.map((function(e,t){return Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsx)(Ht.a,{to:e.route,onClick:function(){c(e.route)},children:e.label}),t<a.length-1&&Object(n.jsx)("span",{children:" / "})]},"breadcrumbs-".concat(t.toString()))}));return Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("div",{className:t.sectionTitle,children:a&&a.length>0?a.slice(-1)[0].label:""})}),Object(n.jsx)(x.a,{item:!0,xs:12,className:t.breadcrumbs,children:r})]})}))),Vl={addRoute:Bl,resetRoutesList:function(e){return{type:Al,reset:e}},displayErrorMessage:V},Gl=Object(s.b)(null,Vl),ql=Object(l.g)(Gl(Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({seeMore:{marginTop:e.spacing(3)},paper:{display:"flex",overflow:"auto",flexDirection:"column"},addSideBar:{width:"320px",padding:"20px"},tableToolbar:{paddingLeft:e.spacing(2),paddingRight:e.spacing(0)},minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:"bold"}}},usedSpaceCol:{width:150,textAlign:"right"},subTitleLabel:{alignItems:"center",display:"flex"},bucketName:{display:"flex",alignItems:"center"},iconBucket:{backgroundImage:"url(/images/ob_bucket_clear.svg)",backgroundRepeat:"no-repeat",backgroundPosition:"center center",width:16,height:40,marginRight:10},"@global":{".rowLine:hover .iconBucketElm":{backgroundImage:"url(/images/ob_bucket_filled.svg)"}},browsePaper:{height:"calc(100vh - 280px)"}},Fe),De),Be))}))((function(e){var t=e.classes,a=e.match,i=e.addRoute,r=e.resetRoutesList,o=e.displayErrorMessage,s=Object(c.useState)(!0),l=Object(b.a)(s,2),d=l[0],u=l[1],j=Object(c.useState)([]),m=Object(b.a)(j,2),h=m[0],p=m[1],O=Object(c.useState)(!1),v=Object(b.a)(O,2),y=v[0],S=v[1],C=Object(c.useState)(""),k=Object(b.a)(C,2),N=k[0],w=k[1],T=Object(c.useState)(!0),E=Object(b.a)(T,2),A=E[0],_=E[1],I=Object(c.useState)(!1),M=Object(b.a)(I,2),F=M[0],D=M[1];Object(c.useEffect)((function(){A&&Oe.invoke("POST","/api/v1/has-permission",{actions:[{id:"createBucket",action:"s3:CreateBucket"}]}).then((function(e){var t=e.permissions.filter((function(e){return"createBucket"===e.id})).pop();t&&t.can?D(!0):D(!1),_(!1)})).catch((function(e){_(!1),V(e)}))}),[A]),Object(c.useEffect)((function(){r(!0)}),[a,r]),Object(c.useEffect)((function(){d&&Oe.invoke("GET","/api/v1/buckets").then((function(e){u(!1),p(e.buckets||[])})).catch((function(e){u(!1),o(e)}))}),[d,o]);var L=h.filter((function(e){return""===N||e.name.indexOf(N)>=0}));return Object(n.jsxs)(c.Fragment,{children:[y&&Object(n.jsx)(Ka,{open:y,closeModalAndRefresh:function(e){S(!1),e&&u(!0)}}),Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsx)(x.a,{item:!0,xs:12,className:t.obTitleSection,children:Object(n.jsx)("div",{children:Object(n.jsx)(Wl,{})})}),Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.actionsTray,children:[Object(n.jsx)(f.a,{placeholder:"Search Buckets",className:t.searchField,id:"search-resource",label:"",onChange:function(e){w(e.target.value)},InputProps:{disableUnderline:!0,startAdornment:Object(n.jsx)(et.a,{position:"start",children:Object(n.jsx)(at.a,{})})}}),Object(n.jsx)(Bt.a,{color:"primary","aria-label":"Refresh List",component:"span",onClick:function(){u(!0)},children:Object(n.jsx)(qn.a,{})}),F&&Object(n.jsx)("div",{children:Object(n.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(n.jsx)(lt,{}),onClick:function(){S(!0)},children:"Create Bucket"})})]}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("br",{})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(ha,{itemActions:[{type:"view",sendOnlyId:!0,onClick:function(e){var t=Z()(a,"url","/object-browser"),n="".concat(t,"/").concat(e);i(n,e,"path")}}],columns:[{label:"Name",elementKey:"name",renderFunction:function(e){return Object(n.jsxs)("div",{className:t.bucketName,children:[Object(n.jsx)("div",{className:"".concat(t.iconBucket," iconBucketElm")}),Object(n.jsx)("span",{children:e})]})}},{label:"Used Space",elementKey:"size",renderFunction:ce,globalClass:t.usedSpaceCol,rowClass:t.usedSpaceCol,width:100,contentTextAlign:"right",headerTextAlign:"right"}],isLoading:d,records:L,entityName:"Buckets",idField:"name",customPaperHeight:t.browsePaper})})]})]})})))),Hl=Object(w.a)((function(e){return Object(k.a)(Object(j.a)({watchList:{background:"white",maxHeight:"400",overflow:"auto","& ul":{margin:"4",padding:"0"},"& ul li":{listStyle:"none",margin:"0",padding:"0",borderBottom:"1px solid #dedede"}},actionsTray:{textAlign:"right","& button":{marginLeft:10}},inputField:{background:"#FFFFFF",padding:12,borderRadius:5,marginLeft:10,boxShadow:"0px 3px 6px #00000012"},fieldContainer:{background:"#FFFFFF",padding:0,borderRadius:5,marginLeft:10,textAlign:"left",minWidth:"206",boxShadow:"0px 3px 6px #00000012"},lastElementWPadding:{paddingRight:"78"}},(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))((function(e){var t=e.match,a=e.classes,c=Z()(t,"url","");return Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsx)(qa,{label:"Object Browser"}),Object(n.jsx)(x.a,{container:!0,children:Object(n.jsx)(x.a,{item:!0,xs:12,className:a.container,children:"/object-browser"===c&&Object(n.jsx)(ql,{})})})]})})),Yl={setErrorSnackMessage:V},Ql=Object(s.b)(null,Yl)((function(e){var t=e.closeDeleteModalAndRefresh,a=e.deleteOpen,i=e.selectedBucket,r=e.selectedObject,o=e.setErrorSnackMessage,s=Object(c.useState)(!1),l=Object(b.a)(s,2),d=l[0],u=l[1];return Object(n.jsxs)(pa.a,{open:a,onClose:function(){t(!1)},"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[Object(n.jsx)(Oa.a,{id:"alert-dialog-title",children:"Delete"}),Object(n.jsxs)(ga.a,{children:[d&&Object(n.jsx)(y.a,{}),Object(n.jsxs)(Ua.a,{id:"alert-dialog-description",children:["Are you sure you want to delete: ",Object(n.jsx)("b",{children:r}),"?"," "]})]}),Object(n.jsxs)(Wa.a,{children:[Object(n.jsx)(g.a,{onClick:function(){t(!1)},color:"primary",disabled:d,children:"Cancel"}),Object(n.jsx)(g.a,{onClick:function(){!function(){if(!d){var e=!1;r.endsWith("/")&&(e=!0),u(!0),Oe.invoke("DELETE","/api/v1/buckets/".concat(i,"/objects?path=").concat(r,"&recursive=").concat(e)).then((function(){u(!1),t(!0)})).catch((function(e){u(!1),o(e)}))}}()},color:"secondary",disabled:d,children:"Delete"})]})]})})),Zl=a(954),Jl={createFolder:function(e){return{type:Ml,newRoute:e}}},$l=Object(s.b)(null,Jl)(Object(w.a)((function(e){return Object(k.a)(Object(j.a)({buttonContainer:{textAlign:"right"},pathLabel:{marginTop:0,marginBottom:32}},Te))}))((function(e){var t=e.modalOpen,a=e.folderName,r=e.onClose,o=e.createFolder,s=e.classes,l=Object(c.useState)(""),d=Object(b.a)(l,2),u=d[0],j=d[1],m=a.split("/").slice(2).join("/");return Object(n.jsx)(i.a.Fragment,{children:Object(n.jsx)(va,{modalOpen:t,title:"Add Folder",onClose:r,children:Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsxs)("h3",{className:s.pathLabel,children:["Current Path: ",m,"/"]}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{value:u,label:"Folder Path",id:"folderPath",name:"folderPath",placeholder:"Enter Folder Path",onChange:function(e){j(e.target.value)}})}),Object(n.jsxs)(x.a,{item:!0,xs:12,className:s.buttonContainer,children:[Object(n.jsx)("button",{type:"button",color:"primary",className:s.clearButton,onClick:function(){j("")},children:"Clear"}),Object(n.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:""===u.trim(),onClick:function(){o(u),r()},children:"Save"})]})]})})})}))),Xl=function(){return Object(n.jsx)(ot.a,{children:Object(n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 13 12.996",children:Object(n.jsxs)("g",{transform:"translate(-63.686 -70.783)",children:[Object(n.jsx)("path",{className:"a",d:"M74.736,79.879v1.95h-9.1v-1.95h-1.95v3.9h13v-3.9Z"}),Object(n.jsx)("path",{className:"a",d:"M69.211,80.533h1.95V73.861h1.525l-2.5-3.078-2.5,3.078h1.525Z"})]})})})},ed=a(437),td=function(e,t,a,n,c){var i=document.createElement("a");document.body.appendChild(i);var r=new XMLHttpRequest,o=t.split("/"),s=o[o.length-1],l="/api/v1/buckets/".concat(e,"/objects/download?prefix=").concat(t);Object(ed.isNullOrUndefined)(a)||"null"===a||(l=l.concat("&version_id=".concat(a))),r.open("GET",l,!0),r.responseType="blob",r.onload=function(r){if(200===this.status){var o=new Blob([this.response],{type:"octet/stream"}),l=window.URL.createObjectURL(o);i.href=l,i.download=s,i.click(),window.URL.revokeObjectURL(l),i.remove(),n&&n("".concat(e,"/").concat(t).concat(c?"-".concat(a):""))}},r.send()},ad={backgroundRepeat:"no-repeat",backgroundPosition:"center center",width:16,minWidth:16,height:40,marginRight:10};var nd=Object(n.jsx)(v.a,{component:"h3",children:"Loading..."}),cd={addRoute:Bl,setAllRoutes:Pl,setLastAsFile:function(){return{type:Fl}},setLoadingProgress:function(e){return{type:M,loadingProgress:e}},setSnackBarMessage:W,setErrorSnackMessage:V,fileIsBeingPrepared:zl,fileDownloadStarted:Kl},id=Object(s.b)((function(e){var t=e.objectBrowser;return{routesList:Z()(t,"routesList",[]),downloadingFiles:Z()(t,"downloadingFiles",[])}}),cd),rd=Object(l.g)(id(Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)(Object(j.a)({seeMore:{marginTop:e.spacing(3)},paper:{display:"flex",overflow:"auto",flexDirection:"column"},addSideBar:{width:"320px",padding:"20px"},tableToolbar:{paddingLeft:e.spacing(2),paddingRight:e.spacing(0)},minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:"bold"}}},fileName:{display:"flex",alignItems:"center"},fileNameText:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},iconFolder:Object(j.a)({backgroundImage:"url(/images/ob_folder_clear.svg)"},ad),iconFile:Object(j.a)({backgroundImage:"url(/images/ob_file_clear.svg)"},ad),buttonsContainer:{"& .MuiButtonBase-root":{marginLeft:10}},browsePaper:{height:"calc(100vh - 280px)"},"@global":{".rowLine:hover .iconFileElm":{backgroundImage:"url(/images/ob_file_filled.svg)"},".rowLine:hover .iconFolderElm":{backgroundImage:"url(/images/ob_folder_filled.svg)"}},listButton:{marginLeft:"10px"}},Fe),De),Be),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))((function(e){var t=e.classes,a=e.match,r=e.addRoute,o=e.setAllRoutes,s=e.routesList,l=e.downloadingFiles,d=e.setLastAsFile,u=e.setLoadingProgress,j=e.setSnackBarMessage,m=e.setErrorSnackMessage,h=e.fileIsBeingPrepared,p=e.fileDownloadStarted,O=Object(c.useState)([]),y=Object(b.a)(O,2),S=y[0],C=y[1],k=Object(c.useState)(!0),N=Object(b.a)(k,2),w=N[0],T=N[1],E=Object(c.useState)(!1),A=Object(b.a)(E,2),_=A[0],I=A[1],M=Object(c.useState)(!1),F=Object(b.a)(M,2),D=F[0],L=F[1],B=Object(c.useState)(""),R=Object(b.a)(B,2),P=R[0],z=R[1],K=Object(c.useState)(""),U=Object(b.a)(K,2),W=U[0],V=U[1],G=Object(c.useState)(""),q=Object(b.a)(G,2),H=q[0],Y=q[1],Q=Object(c.useState)(0),J=Object(b.a)(Q,2),$=J[0],X=J[1],ee=Object(c.useState)(nd),te=Object(b.a)(ee,2),ae=te[0],ne=te[1];!function(e,t){var a=Object(c.useRef)(null);Object(c.useEffect)((function(){a.current=e}),[e]),Object(c.useEffect)((function(){if(null!==t){var e=setInterval((function(){void 0!==a&&a.current&&a.current()}),t);return function(){return clearInterval(e)}}}),[t])}((function(){w&&function(){var e=Date.now()-$;e/1e3>=6?ne(Object(n.jsx)(i.a.Fragment,{children:Object(n.jsxs)(v.a,{component:"h3",children:["This operation is taking longer than expected... (",Math.ceil(e/1e3),"s)"]})})):e/1e3>=3&&ne(Object(n.jsx)(v.a,{component:"h3",children:"This operation is taking longer than expected..."}))}()}),1e3),Object(c.useEffect)((function(){var e=a.params.bucket,t=a.params[0];if(w){var n="";t&&(n="?prefix=".concat(t,"/"));var c=Date.now()+0;X(c),ne(nd),Oe.invoke("GET","/api/v1/buckets/".concat(e,"/objects").concat(n)).then((function(t){V(e);var c=t.objects||[],i=[],r=[];c.forEach((function(e){e.name.endsWith("/")?i.push(e):r.push(e)}));var o=[].concat(i,r);C(o),t.objects||""===n?T(!1):function(){var e=a.params.bucket,t=a.params[0];Oe.invoke("GET","/api/v1/buckets/".concat(e,"/objects?prefix=").concat(t)).then((function(e){null!==e.objects?d():T(!1)})).catch((function(e){T(!1),m(e)}))}()})).catch((function(e){T(!1),m(e)}))}}),[w,a,d,m]),Object(c.useEffect)((function(){var e=Z()(a,"url","/object-browser");e!==s[s.length-1].route&&o(e)}),[a,s,o]),Object(c.useEffect)((function(){T(!0)}),[s,T]);var ie=function(e){p(e)},re=function(e){var t=s[s.length-1].route.split("/").filter((function(e){return""!==e.trim()})),a="";t.length>2&&(a="".concat(t.slice(2).join("/"),"/")),function(e,t,a){if(null!==e&&void 0!==e&&null!==e.target&&void 0!==e.target){e.preventDefault();var n=e.target.files,c="/api/v1/buckets/".concat(t,"/objects/upload");""!==a&&(c="".concat(c,"?prefix=").concat(a));var i=new XMLHttpRequest,r=n.length>1,o="An error occurred while uploading the file".concat(r?"s":"","."),s="Object".concat(r?"s":""," uploaded successfully.");i.open("POST",c,!0),i.withCredentials=!1,i.onload=function(e){401!==i.status&&403!==i.status&&400!==i.status&&500!==i.status||j(o),200===i.status&&j(s)},i.upload.addEventListener("error",(function(e){j(o)})),i.upload.addEventListener("progress",(function(e){u(Math.floor(100*e.loaded/e.total))})),i.onerror=function(){j(o)},i.onloadend=function(){T(!0),u(100)};var l,d=new FormData,b=Object(Mr.a)(n);try{for(b.s();!(l=b.n()).done;){var m=l.value,h=m.name,p=new Blob([m]);d.append(h,p)}}catch(O){b.e(O)}finally{b.f()}i.send(d),e.target.value=null}}(e,W,a)},oe=[{type:"view",onClick:function(e){var t=Z()(a,"url","/object-browser");if(e.endsWith("/")){var n=e.substr(0,e.length-1).split("/"),c=n.length-1,i="".concat(t,"/").concat(n[c]);r(i,n[c],"path")}else{var o=e.split("/"),s=o[o.length-1],l="".concat(t,"/").concat(s);r(l,s,"file")}},sendOnlyId:!0},{type:"download",onClick:function(e){h("".concat(W,"/").concat(e.name)),e.size>104857600&&j("Download process started, it may take a few moments to complete"),td(W,e.name,e.version_id,ie)},showLoaderFunction:function(e){return l.includes("".concat(a.params.bucket,"/").concat(e))}},{type:"delete",onClick:function(e){I(!0),z(e)},sendOnlyId:!0}],se=S.filter((function(e){return""===H||e.name.indexOf(H)>=0}));return Object(n.jsxs)(i.a.Fragment,{children:[_&&Object(n.jsx)(Ql,{deleteOpen:_,selectedBucket:W,selectedObject:P,closeDeleteModalAndRefresh:function(e){I(!1),e&&(j("Object '".concat(P,"' deleted successfully.")),T(!0))}}),D&&Object(n.jsx)($l,{modalOpen:D,folderName:s[s.length-1].route,onClose:function(){L(!1)}}),Object(n.jsx)(qa,{label:"Object Browser"}),Object(n.jsx)(x.a,{container:!0,children:Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.container,children:[Object(n.jsx)(x.a,{item:!0,xs:12,className:t.obTitleSection,children:Object(n.jsx)("div",{children:Object(n.jsx)(Wl,{})})}),Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.actionsTray,children:[Object(n.jsx)(f.a,{placeholder:"Search Objects",className:t.searchField,id:"search-resource",label:"",onChange:function(e){Y(e.target.value)},InputProps:{disableUnderline:!0,startAdornment:Object(n.jsx)(et.a,{position:"start",children:Object(n.jsx)(at.a,{})})}}),Object(n.jsx)(Bt.a,{color:"primary","aria-label":"Refresh List",component:"span",onClick:function(){T(!0)},children:Object(n.jsx)(qn.a,{})}),Object(n.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(n.jsx)(lt,{}),component:"label",onClick:function(){L(!0)},className:t.listButton,children:"Create Folder"}),Object(n.jsxs)(g.a,{variant:"contained",color:"primary",startIcon:Object(n.jsx)(Xl,{}),component:"label",className:t.listButton,children:["File",Object(n.jsx)(Zl.a,{type:"file",inputProps:{multiple:!0},onChange:function(e){return re(e)},id:"file-input",style:{display:"none"}})]})]}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("br",{})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(ha,{itemActions:oe,columns:[{label:"Name",elementKey:"name",renderFunction:function(e){var a=e,c="".concat(t.iconFile," iconFileElm");e.endsWith("/")&&(c="".concat(t.iconFolder," iconFolderElm"),a=e.substr(0,e.length-1));var i=a.split("/");return Object(n.jsxs)("div",{className:t.fileName,children:[Object(n.jsx)("div",{className:c}),Object(n.jsx)("span",{className:t.fileNameText,children:i[i.length-1]})]})}},{label:"Last Modified",elementKey:"last_modified",renderFunction:function(e){return e.name.endsWith("/")?"":Object(n.jsx)(rt.a,{children:e.last_modified})},renderFullObject:!0},{label:"Size",elementKey:"size",renderFunction:function(e){return e.name.endsWith("/")?"":ce(String(e.size))},renderFullObject:!0,width:60,contentTextAlign:"right"}],isLoading:w,loadingMessage:ae,entityName:"Objects",idField:"name",records:se,customPaperHeight:t.browsePaper})})]})})]})})))),od=a(1016),sd=a(439),ld=a.n(sd),dd=a(438),ud=a.n(dd),bd=Object(s.b)(null,{setModalSnackMessage:G,setModalErrorSnackMessage:q}),jd=Object(w.a)((function(e){return Object(k.a)(Object(j.a)({copyButtonContainer:{paddingLeft:16},modalContent:{paddingBottom:53}},Te))}))(bd((function(e){var t=e.classes,a=e.open,r=e.closeModalAndRefresh,o=e.bucketName,s=e.dataObject,l=e.setModalSnackMessage,d=e.setModalErrorSnackMessage,u=Object(c.useState)(""),j=Object(b.a)(u,2),m=j[0],h=j[1],p=Object(c.useState)(!1),O=Object(b.a)(p,2),f=O[0],v=O[1],y=Object(c.useState)(""),S=Object(b.a)(y,2),C=S[0],k=S[1],N=Object(c.useState)(!0),w=Object(b.a)(N,2),T=w[0],E=w[1];return Object(c.useEffect)((function(){if(T){v(!0),h("");var e=new Date("".concat(C,"T23:59:59")),t=new Date,a=e.getTime()-t.getTime();return a<0?(d("Selected date must be greater than current time."),h(""),void v(!1)):a>6048e5?(d("You can share a file only for less than 7 days."),h(""),void v(!1)):void Oe.invoke("GET","/api/v1/buckets/".concat(o,"/objects/share?prefix=").concat(s.name,"&version_id=").concat(s.version_id).concat(""!==C?"&expires=".concat(a,"ms"):"")).then((function(e){h(e),v(!1)})).catch((function(e){d(e),h(""),v(!1)}))}}),[s,C,o,T,h,d]),Object(n.jsx)(i.a.Fragment,{children:Object(n.jsx)(va,{title:"Share File",modalOpen:a,onClose:function(){r()},children:Object(n.jsxs)(x.a,{container:!0,className:t.modalContent,children:[Object(n.jsx)(x.a,{item:!0,xs:12,className:t.dateContainer,children:Object(n.jsx)(cc,{id:"date",label:"Active until",borderBottom:!1,addSwitch:!0,onDateChange:function(e,t){E(t),k(t?e:"")}})}),Object(n.jsxs)(x.a,{container:!0,item:!0,xs:12,children:[Object(n.jsx)(x.a,{item:!0,xs:10,children:Object(n.jsx)(Ja,{content:m})}),Object(n.jsx)(x.a,{item:!0,xs:2,className:t.copyButtonContainer,children:Object(n.jsx)(ud.a,{text:m,children:Object(n.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(n.jsx)(st,{}),onClick:function(){l("Share URL Copied to clipboard")},disabled:""===m||f,children:"Copy"})})})]})]})})})}))),md=function(){return Object(n.jsx)(ot.a,{children:Object(n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 13 13",children:[Object(n.jsx)("path",{d:"M11.05 8.617v2.429h-9.1v-9.1h2.429v-1.95H0v13h13V8.617z",className:"a"}),Object(n.jsx)("path",{d:"M3.854 9.256h1.95a4.945 4.945 0 013.6-4.74v1.3l.6-.487 2.474-2.012L9.4.817v1.7a6.9 6.9 0 00-5.546 6.739z",className:"a"})]})})},hd=function(){return Object(n.jsx)(ot.a,{children:Object(n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 13 12.996",children:[Object(n.jsx)("path",{d:"M11.05 9.096v1.95h-9.1v-1.95H0v3.9h13v-3.9z"}),Object(n.jsx)("path",{d:"M6.5 9.75L9 6.672H7.475V0h-1.95v6.672H4z"})]})})},pd={setModalErrorSnackMessage:q},Od=Object(s.b)(null,pd),gd=Object(w.a)((function(e){return Object(k.a)(Object(j.a)({objectName:{fontSize:18,fontWeight:700,marginBottom:40},buttonContainer:{textAlign:"right"}},Te))}))(Od((function(e){var t=e.classes,a=e.open,i=e.closeModalAndRefresh,r=e.objectName,o=e.objectInfo,s=e.bucketName,l=e.setModalErrorSnackMessage,d=Object(c.useState)(!0),u=Object(b.a)(d,2),j=u[0],m=u[1],h=Object(c.useState)(""),p=Object(b.a)(h,2),O=p[0],f=p[1],v=Object(c.useState)(""),y=Object(b.a)(v,2),S=y[0],C=y[1],k=Object(c.useState)(!1),N=Object(b.a)(k,2),w=N[0],T=N[1],E=Object(c.useState)(!1),A=Object(b.a)(E,2),_=A[0],I=A[1],M=Object(c.useState)(!1),F=Object(b.a)(M,2),D=F[0],L=F[1];Object(c.useEffect)((function(){if(o.retention_mode&&(f(o.retention_mode.toLowerCase()),L(!0)),o.retention_until_date){var e=new Date(o.retention_until_date);if("Invalid Date"!==e.toString()){var t=e.getFullYear(),a=(c=e.getMonth()+1)<10?"0".concat(c):"".concat(c),n=e.getDate();isNaN(n)||"NaN"===a||isNaN(t)||C("".concat(t,"-").concat(a,"-").concat(n))}L(!0)}var c}),[o]);var B=Object(c.useRef)(null),R=function(){m(!1),f(""),B.current&&B.current.resetDate()},P=D&&("governance"===O||""===O);return Object(n.jsxs)(va,{title:"Set Retention Policy",modalOpen:a,onClose:function(){R(),i(!1)},children:[Object(n.jsx)(x.a,{item:!0,xs:12,className:t.objectName,children:r}),Object(n.jsxs)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){!function(e){e.preventDefault()}(e)},children:[P&&Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(za,{value:"status",id:"status",name:"status",checked:j,onChange:function(e){m(!j)},label:"Status",indicatorLabels:["Enabled","Disabled"]})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(La,{currentSelection:O,id:"type",name:"type",label:"Type",disableOptions:!j||D&&""!==O,onChange:function(e){f(e.target.value)},selectorOptions:[{label:"Governance",value:"governance"},{label:"Compliance",value:"compliance"}]})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(cc,{id:"date",label:"Date",disableOptions:!(j&&("governance"===O||"compliance"===O)),ref:B,value:S,borderBottom:!0,onDateChange:function(e,t){T(t),t&&C(e)}})}),Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.buttonContainer,children:[Object(n.jsx)("button",{type:"button",color:"primary",className:t.clearButton,onClick:R,children:"Reset"}),Object(n.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:j&&""===O||j&&!w||_,onClick:function(){I(!0);var e=o.name,t=o.version_id,a=j||"governance"!==O?"".concat(S,"T23:59:59Z"):"";j||"governance"!==O?function(e,t,a){Oe.invoke("PUT","/api/v1/buckets/".concat(s,"/objects/retention?prefix=").concat(e,"&version_id=").concat(t),{expires:a,mode:O}).then((function(e){I(!1),i(!0)})).catch((function(e){l(e),I(!1)}))}(e,t,a):function(e,t){Oe.invoke("DELETE","/api/v1/buckets/".concat(s,"/objects/retention?prefix=").concat(e,"&version_id=").concat(t)).then((function(){I(!1),i(!0)})).catch((function(e){l(e),I(!1)}))}(e,t)},children:"Save"})]})]})]})}))),fd={setModalErrorSnackMessage:q},xd=Object(s.b)(null,fd),vd=Object(w.a)((function(e){return Object(k.a)(Object(j.a)({buttonContainer:{textAlign:"right"},pathLabel:{marginTop:0,marginBottom:32}},Te))}))(xd((function(e){var t=e.modalOpen,a=e.currentTags,r=e.selectedObject,o=e.onCloseAndUpdate,s=e.bucketName,l=e.versionId,d=e.setModalErrorSnackMessage,u=e.classes,m=Object(c.useState)(""),h=Object(b.a)(m,2),p=h[0],O=h[1],f=Object(c.useState)(""),v=Object(b.a)(f,2),y=v[0],S=v[1],C=Object(c.useState)(!1),k=Object(b.a)(C,2),N=k[0],w=k[1];return Object(n.jsx)(i.a.Fragment,{children:Object(n.jsx)(va,{modalOpen:t,title:"Add New Tag",onClose:function(){o(!1)},children:Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsxs)("h3",{className:u.pathLabel,children:["Selected Object: ",r]}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{value:p,label:"New Tag Key",id:"newTagKey",name:"newTagKey",placeholder:"Enter New Tag Key",onChange:function(e){O(e.target.value)}})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{value:y,label:"New Tag Label",id:"newTagLabel",name:"newTagLabel",placeholder:"Enter New Tag Label",onChange:function(e){S(e.target.value)}})}),Object(n.jsxs)(x.a,{item:!0,xs:12,className:u.buttonContainer,children:[Object(n.jsx)("button",{type:"button",color:"primary",className:u.clearButton,onClick:function(){S(""),O("")},children:"Clear"}),Object(n.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:""===y.trim()||""===p.trim()||N,onClick:function(){w(!0);var e={};e[p]=y;var t=Object(j.a)(Object(j.a)({},a),e);Oe.invoke("PUT","/api/v1/buckets/".concat(s,"/objects/tags?prefix=").concat(r,"&version_id=").concat(l),{tags:t}).then((function(e){w(!1),o(!0)})).catch((function(e){d(e),w(!1)}))},children:"Save"})]})]})})})}))),yd={setErrorSnackMessage:V},Sd=Object(s.b)(null,yd),Cd=Object(w.a)((function(e){return Object(k.a)(Object(j.a)({buttonContainer:{textAlign:"right"},pathLabel:{marginTop:0,marginBottom:32}},Te))}))(Sd((function(e){var t=e.deleteOpen,a=e.currentTags,i=e.selectedObject,r=e.selectedTag,o=e.onCloseAndUpdate,s=e.bucketName,l=e.versionId,d=e.setErrorSnackMessage,u=e.classes,m=Object(c.useState)(!1),h=Object(b.a)(m,2),p=h[0],O=h[1],f=Object(b.a)(r,2),x=f[0],v=f[1];return Object(n.jsxs)(pa.a,{open:t,onClose:function(){o(!1)},"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[Object(n.jsx)(Oa.a,{id:"alert-dialog-title",children:"Delete Tag"}),Object(n.jsxs)(ga.a,{children:[p&&Object(n.jsx)(y.a,{}),Object(n.jsxs)(Ua.a,{id:"alert-dialog-description",children:["Are you sure you want to delete the tag"," ",Object(n.jsxs)("b",{className:u.wrapText,children:[x," : ",v]})," ","from ",i,"?"]})]}),Object(n.jsxs)(Wa.a,{children:[Object(n.jsx)(g.a,{onClick:function(){o(!1)},color:"primary",disabled:p,children:"Cancel"}),Object(n.jsx)(g.a,{onClick:function(){O(!0);var e=Object(j.a)({},a);delete e[x],Oe.invoke("PUT","/api/v1/buckets/".concat(s,"/objects/tags?prefix=").concat(i,"&version_id=").concat(l),{tags:e}).then((function(e){O(!1),o(!0)})).catch((function(e){d(e),O(!1)}))},color:"secondary",autoFocus:!0,children:"Delete"})]})]})}))),kd={setModalErrorSnackMessage:q},Nd=Object(s.b)(null,kd),wd=Object(w.a)((function(e){return Object(k.a)(Object(j.a)({objectName:{fontSize:18,fontWeight:700,marginBottom:40},buttonContainer:{textAlign:"right"}},Te))}))(Nd((function(e){var t=e.classes,a=e.open,i=e.closeModalAndRefresh,r=e.objectName,o=e.bucketName,s=e.actualInfo,l=e.setModalErrorSnackMessage,d=Object(c.useState)(!1),u=Object(b.a)(d,2),j=u[0],m=u[1],h=Object(c.useState)(!1),p=Object(b.a)(h,2),O=p[0],f=p[1],v=s.version_id;Object(c.useEffect)((function(){var e=Z()(s,"legal_hold_status","OFF");m("ON"===e)}),[s]);var y=function(){m(!1)};return Object(n.jsxs)(va,{title:"Set Legal Hold",modalOpen:a,onClose:function(){y(),i(!1)},children:[Object(n.jsx)(x.a,{item:!0,xs:12,className:t.objectName,children:r}),Object(n.jsxs)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){!function(e){e.preventDefault(),f(!0),Oe.invoke("PUT","/api/v1/buckets/".concat(o,"/objects/legalhold?prefix=").concat(r,"&version_id=").concat(v),{status:j?"enabled":"disabled"}).then((function(){f(!1),i(!0)})).catch((function(e){l(e),f(!1)}))}(e)},children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(za,{value:"legalhold",id:"legalhold",name:"legalhold",checked:j,onChange:function(e){m(!j)},label:"Legal Hold Status",indicatorLabels:["Enabled","Disabled"],tooltip:"To enable this feature you need to enable versioning on the bucket before creation"})}),Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.buttonContainer,children:[Object(n.jsx)("button",{type:"button",color:"primary",className:t.clearButton,onClick:y,children:"Reset"}),Object(n.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:O,children:"Save"})]})]})]})}))),Td={is_latest:!0,last_modified:"",legal_hold_status:"",name:"",retention_mode:"",retention_until_date:"",size:"0",tags:{},version_id:null},Ed={removeRouteLevel:Rl,setErrorSnackMessage:V,fileIsBeingPrepared:zl,fileDownloadStarted:Kl,setSnackBarMessage:W},Ad=Object(s.b)((function(e){var t=e.objectBrowser;return{downloadingFiles:Z()(t,"downloadingFiles",[])}}),Ed)(Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({objectNameContainer:{marginBottom:8},objectPathContainer:{marginBottom:26,fontSize:10},objectPathLink:{"&:visited":{color:"#000"}},objectName:{fontSize:24},propertiesContainer:{display:"flex",flexDirection:"row",marginBottom:15},propertiesItem:{display:"flex",flexDirection:"row",marginRight:21},propertiesItemBold:{fontWeight:700},propertiesValue:{marginLeft:8,textTransform:"capitalize"},propertiesIcon:{marginLeft:5},actionsIconContainer:{marginLeft:12},actionsIcon:{height:16,width:16,"& .MuiSvgIcon-root":{height:16}},tagsContainer:{display:"flex",flexDirection:"row",alignItems:"center",marginBottom:15},tagText:{marginRight:13},tag:{marginRight:6,fontSize:10,fontWeight:700,"&.MuiChip-sizeSmall":{height:18},"& .MuiSvgIcon-root":{height:10,width:10}},search:{marginBottom:8,"&.MuiFormControl-root":{marginRight:0}},"@global":{".progressDetails":{paddingTop:3,display:"inline-block",position:"relative",width:18,height:18},".progressDetails > .MuiCircularProgress-root":{position:"absolute",left:0,top:3}}},Fe),De),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))((function(e){var t=e.classes,a=e.routesList,r=e.downloadingFiles,o=e.removeRouteLevel,s=e.setErrorSnackMessage,l=e.setSnackBarMessage,d=e.fileIsBeingPrepared,j=e.fileDownloadStarted,m=Object(c.useState)(!0),h=Object(b.a)(m,2),p=h[0],O=h[1],g=Object(c.useState)(!1),v=Object(b.a)(g,2),y=v[0],C=v[1],k=Object(c.useState)(!1),N=Object(b.a)(k,2),w=N[0],T=N[1],E=Object(c.useState)(!1),A=Object(b.a)(E,2),_=A[0],I=A[1],M=Object(c.useState)(!1),F=Object(b.a)(M,2),D=F[0],L=F[1],B=Object(c.useState)(["",""]),R=Object(b.a)(B,2),P=R[0],z=R[1],K=Object(c.useState)(!1),U=Object(b.a)(K,2),W=U[0],V=U[1],G=Object(c.useState)(Td),q=Object(b.a)(G,2),H=q[0],Y=q[1],Q=Object(c.useState)([]),J=Object(b.a)(Q,2),$=J[0],X=J[1],ee=Object(c.useState)(""),te=Object(b.a)(ee,2),ae=te[0],ne=te[1],ce=Object(c.useState)(!1),ie=Object(b.a)(ce,2),re=ie[0],oe=ie[1],se=a[a.length-1].route.split("/"),le=se[se.length-1],de=se[2],ue=se.slice(3).join("/");Object(c.useEffect)((function(){p&&Oe.invoke("GET","/api/v1/buckets/".concat(de,"/objects?prefix=").concat(ue,"&with_versions=true")).then((function(e){var t=Z()(e,"objects",[]);Y(t.find((function(e){return e.is_latest}))||Td),X(t.filter((function(e){return!e.is_latest}))),O(!1)})).catch((function(e){s(e),O(!1)}))}),[p,de,ue,s]);var be=[];H.tags&&(be=Object.keys(H.tags));var je=function(){C(!0)},me=function(e){j(e)},he=function(e,t){d("".concat(de,"/").concat(e.name).concat(t?"-".concat(e.version_id):"")),e.size&&parseInt(e.size)>104857600&&l("Download process started, it may take a few moments to complete"),td(de,ue,e.version_id,me,t)},pe=[{type:"share",onClick:je,sendOnlyId:!0},{type:"download",onClick:function(e){he(e,!0)},showLoaderFunction:function(e){return r.includes("".concat(de,"/").concat(le,"-").concat(e))}}],ge=$.filter((function(e){return!!e.version_id&&e.version_id.includes(ae)}));return Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsx)(qa,{label:"Object Browser"}),y&&Object(n.jsx)(jd,{open:y,closeModalAndRefresh:function(){C(!1)},bucketName:de,dataObject:H}),w&&Object(n.jsx)(gd,{open:w,closeModalAndRefresh:function(e){T(!1),e&&O(!0)},objectName:le,objectInfo:H,bucketName:de}),re&&Object(n.jsx)(Ql,{deleteOpen:re,selectedBucket:de,selectedObject:ue,closeDeleteModalAndRefresh:function(e){if(oe(!1),e){var t=se.slice(0,-1).join("/");o(t),u.push(t)}}}),_&&Object(n.jsx)(vd,{modalOpen:_,currentTags:H.tags,selectedObject:ue,versionId:H.version_id,bucketName:de,onCloseAndUpdate:function(e){I(!1),e&&O(!0)}}),D&&Object(n.jsx)(Cd,{deleteOpen:D,currentTags:H.tags,selectedObject:ue,versionId:H.version_id,bucketName:de,onCloseAndUpdate:function(e){L(!1),e&&O(!0)},selectedTag:P}),W&&Object(n.jsx)(wd,{open:W,closeModalAndRefresh:function(e){V(!1),e&&O(!0)},objectName:ue,bucketName:de,actualInfo:H}),Object(n.jsx)(x.a,{container:!0,children:Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.container,children:[Object(n.jsx)(x.a,{item:!0,xs:12,className:t.obTitleSection,children:Object(n.jsx)("div",{children:Object(n.jsx)(Wl,{})})}),Object(n.jsx)("br",{}),Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.propertiesContainer,children:[H.version_id&&"null"!==H.version_id&&Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsxs)("div",{className:t.propertiesItem,children:[Object(n.jsxs)("div",{children:[Object(n.jsx)("span",{className:t.propertiesItemBold,children:"Legal Hold:"}),Object(n.jsx)("span",{className:t.propertiesValue,children:H.legal_hold_status?H.legal_hold_status.toLowerCase():"Off"})]}),Object(n.jsx)("div",{children:Object(n.jsx)(Bt.a,{color:"primary","aria-label":"legal-hold",size:"small",className:t.propertiesIcon,onClick:function(){V(!0)},children:Object(n.jsx)(Jt,{active:!0})})})]}),Object(n.jsxs)("div",{className:t.propertiesItem,children:[Object(n.jsxs)("div",{children:[Object(n.jsx)("span",{className:t.propertiesItemBold,children:"Retention:"}),Object(n.jsx)("span",{className:t.propertiesValue,children:H.retention_mode?H.retention_mode.toLowerCase():"Undefined"})]}),Object(n.jsx)("div",{children:Object(n.jsx)(Bt.a,{color:"primary","aria-label":"retention",size:"small",className:t.propertiesIcon,onClick:function(){T(!0)},children:Object(n.jsx)(Jt,{active:!0})})})]})]}),Object(n.jsxs)("div",{className:t.propertiesItem,children:[Object(n.jsx)("div",{className:t.propertiesItemBold,children:"File Actions:"}),Object(n.jsx)("div",{className:t.actionsIconContainer,children:Object(n.jsx)(Bt.a,{color:"primary","aria-label":"share",size:"small",className:t.actionsIcon,onClick:function(){je()},children:Object(n.jsx)(md,{})})}),Object(n.jsx)("div",{className:t.actionsIconContainer,children:r.includes("".concat(de,"/").concat(H.name))?Object(n.jsx)("div",{className:"progressDetails",children:Object(n.jsx)(S.a,{color:"primary",size:17,variant:"indeterminate"})}):Object(n.jsx)(Bt.a,{color:"primary","aria-label":"download",size:"small",className:t.actionsIcon,onClick:function(){he(H)},children:Object(n.jsx)(hd,{})})}),Object(n.jsx)("div",{className:t.actionsIconContainer,children:Object(n.jsx)(Bt.a,{color:"primary","aria-label":"delete",size:"small",className:t.actionsIcon,onClick:function(){oe(!0)},children:Object(n.jsx)(dt,{})})})]})]}),Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.tagsContainer,children:[Object(n.jsx)("div",{className:t.tagText,children:"Tags:"}),be&&be.map((function(e,a){var c=Z()(H,"tags.".concat(e),"");return""!==c?Object(n.jsx)(od.a,{className:t.tag,size:"small",label:"".concat(e," : ").concat(c),color:"primary",deleteIcon:Object(n.jsx)(ld.a,{}),onDelete:function(){!function(e,t){z([e,t]),L(!0)}(e,c)}},"chip-".concat(a)):null})),Object(n.jsx)(od.a,{className:t.tag,icon:Object(n.jsx)(js.a,{}),clickable:!0,size:"small",label:"Add tag",color:"primary",variant:"outlined",onClick:function(){I(!0)}})]}),Object(n.jsx)(x.a,{item:!0,xs:12,className:t.actionsTray,children:H.version_id&&"null"!==H.version_id&&Object(n.jsx)(f.a,{placeholder:"Search ".concat(le),className:Object(ye.a)(t.search,t.searchField),id:"search-resource",label:"",onChange:function(e){ne(e.target.value)},InputProps:{disableUnderline:!0,startAdornment:Object(n.jsx)(et.a,{position:"start",children:Object(n.jsx)(at.a,{})})}})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:H.version_id&&"null"!==H.version_id&&Object(n.jsx)(ha,{itemActions:pe,columns:[{label:"Version ID",elementKey:"version_id"},{label:"Last Modified",elementKey:"last_modified",renderFunction:function(e){return Object(n.jsx)(rt.a,{children:e})}}],isLoading:!1,entityName:"Versions",idField:"version_id",records:ge})})]})})]})}))),_d={setAllRoutes:Pl},Id=Object(s.b)((function(e){var t=e.objectBrowser;return{routesList:Z()(t,"routesList",[])}}),_d),Md=Object(l.g)(Id((function(e){var t=e.routesList,a=e.match,i=e.setAllRoutes,r=t[t.length-1];return Object(c.useEffect)((function(){var e=Z()(a,"url","/object-browser");e!==t[t.length-1].route&&i(e)}),[a,t,i]),"path"===r.type?Object(n.jsx)(rd,{}):Object(n.jsx)(Ad,{routesList:t})}))),Fd=a(231),Dd=a.n(Fd),Ld=[{id:0,title:"Community",price:"Open Source",capacityMin:""},{id:1,title:"Standard",price:"$10/TB/month",capacityMax:"Up to 10PB. No additional charges for capacity over 10PB",capacityMin:""},{id:2,title:"Enterprise",price:"$20/TB/month",capacityMax:"Up to 5PB. No additional charges for capacity over 5PB",capacityMin:""}],Bd=[{id:0,field:"License",community:"GNU AGPL v3",communityDetail:"",standard:"Commercial License",standardDetail:"",enterprise:"Commercial License",enterpriseDetail:""},{id:1,field:"Software Release",community:"Update to latest",standard:"1 Year Long Term Support",enterprise:"5 Years Long Term Support"},{id:2,field:"SLA",community:"No SLA",standard:"<24 hours",enterprise:"<1 hour"},{id:3,field:"Support",community:"Community:",communityDetail:"Public Slack Channel + Github Issues",standard:"24x7 L4 direct engineering",standardDetail:"Support via SUBNET",enterprise:"24x7 L4 direct engineering",enterpriseDetail:"Support via SUBNET"},{id:4,field:"Security Updates & Critical Bugs",community:"Self Update",standard:"Guided Update",enterprise:"Guided Update"},{id:5,field:"Panic Button",community:"N/A",standard:"1 per year",enterprise:"Unlimited"},{id:6,field:"Annual Architecture Review",community:"N/A",standard:"Yes",enterprise:"Yes"},{id:7,field:"Annual Performance Review",community:"N/A",standard:"Yes",enterprise:"Yes"},{id:8,field:"Indemnification",community:"N/A",standard:"N/A",enterprise:"Yes"},{id:9,field:"Security + Policy Review",community:"N/A",standard:"N/A",enterprise:"Yes"}],Rd=[{id:0,text:"Join Slack",text2:"",link:"https://slack.min.io",plan:"community"},{id:1,text:"Subscribe",text2:"Upgrade",link:"https://subnet.min.io/subscription",plan:"standard"},{id:2,text:"Subscribe",text2:"Upgrade",link:"https://subnet.min.io/subscription",plan:"enterprise"}],Pd=a(440),zd=a.n(Pd),Kd=a(441),Ud=a.n(Kd),Wd={setModalErrorSnackMessage:q},Vd=Object(s.b)(null,Wd),Gd=Object(w.a)((function(e){return Object(k.a)(Object(j.a)({errorBlock:{color:"red"},subnetLicenseKey:{padding:"10px 10px 10px 0px",borderRight:"1px solid rgba(0, 0, 0, 0.12)",opacity:.5,"&:hover":{opacity:1}},subnetLoginForm:{padding:"10px 0px 10px 10px",opacity:.5,"&:hover":{opacity:1}},licenseKeyField:{},pageTitle:{marginBottom:20},button:{textTransform:"none",fontSize:15,fontWeight:700,background:"transparent linear-gradient(90deg, #073052 0%, #081c42 100%) 0% 0% no-repeat padding-box",color:"#fff"},buttonSignup:{textTransform:"none",fontSize:15,fontWeight:700,marginLeft:15}},(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))(Vd((function(e){var t=e.classes,a=e.open,i=e.closeModal,r=e.setModalErrorSnackMessage,o=Object(c.useState)(""),s=Object(b.a)(o,2),l=s[0],d=s[1],u=Object(c.useState)(""),j=Object(b.a)(u,2),m=j[0],h=j[1],p=Object(c.useState)(""),O=Object(b.a)(p,2),S=O[0],C=O[1],k=Object(c.useState)(!1),N=Object(b.a)(k,2),w=N[0],T=N[1],E=function(){if(!w){T(!0);var e={license:l,email:S,password:m};Oe.invoke("POST","/api/v1/subscription/validate",e).then((function(){T(!1),d(""),h(""),C(""),i()})).catch((function(e){T(!1),d(""),h(""),C(""),r(e)}))}};return a?Object(n.jsxs)(va,{title:"",modalOpen:a,onClose:function(){d(""),h(""),C(""),i()},"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[Object(n.jsxs)(x.a,{container:!0,alignItems:"center",item:!0,xs:12,children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(v.a,{component:"h2",variant:"h6",className:t.pageTitle,children:"Activate SUBNET License"})}),Object(n.jsxs)(x.a,{item:!0,className:t.subnetLicenseKey,xs:6,children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(v.a,{variant:"caption",display:"block",gutterBottom:!0,children:"Enter your license key here"})}),Object(n.jsx)(f.a,{id:"license-key",placeholder:"",multiline:!0,rows:3,value:l,onChange:function(e){return d(e.target.value)},fullWidth:!0,className:t.licenseKeyField,variant:"outlined"}),Object(n.jsx)("br",{}),Object(n.jsx)("br",{}),Object(n.jsx)(g.a,{variant:"contained",color:"primary",onClick:function(){return E()},disabled:w||0===l.trim().length,children:"Activate"})]}),Object(n.jsx)(x.a,{item:!0,className:t.subnetLoginForm,xs:6,children:Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{overlayIcon:Object(n.jsx)(zd.a,{}),id:"subnet-email",name:"subnet-email",onChange:function(e){C(e.target.value)},placeholder:"email",label:"",type:"text",value:S})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{overlayIcon:Object(n.jsx)(Ud.a,{}),id:"subnet-password",name:"subnet-password",onChange:function(e){h(e.target.value)},placeholder:"password",label:"",type:"password",value:m})}),Object(n.jsxs)(x.a,{item:!0,xs:12,children:[Object(n.jsx)(g.a,{className:t.button,color:"primary",onClick:function(){return E()},disabled:w||0===S.trim().length||0===m.trim().length,variant:"contained",children:"Activate"}),Object(n.jsx)(g.a,{className:t.buttonSignup,color:"primary",target:"_blank",rel:"noopener noreferrer",href:"#",onClick:function(e){e.preventDefault(),window.open("https://min.io/pricing","_blank")},variant:"outlined",children:"Sign Up"})]})]})})]}),w&&Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(y.a,{})})]}):null}))),qd=Object(s.b)((function(e){return{operatorMode:e.system.operatorMode}}),null)(Object(w.a)((function(e){return Object(k.a)(Object(j.a)({pageTitle:{fontSize:18,marginBottom:20},paper:{padding:"20px 52px 20px 28px"},licenseContainer:{position:"relative",padding:"20px 52px 0px 28px",background:"#032F51",boxShadow:"0px 3px 7px #00000014","& h2":{color:"#FFF",marginBottom:67},"& a":{textDecoration:"none"},"& h3":{color:"#FFFFFF",marginBottom:"30px",fontWeight:"bold"},"& h6":{color:"#FFFFFF !important"}},tableContainer:{marginLeft:28},detailsContainer:{textAlign:"center",paddingBottom:12,borderRadius:"3px 3px 0 0",marginLeft:8,maxWidth:"calc(25% - 8px)"},detailsContainerBorder:{border:"1px solid #e2e2e2",borderBottom:0,borderRadius:"4px 4px 0px 0px"},detailsContainerBorderHighlighted:{border:"1px solid #B5B5B5",borderBottom:0},detailsTitle:{fontSize:19,fontWeight:700,marginBottom:26,paddingTop:18},activePlanHeader:{fontWeight:700,background:"#D5DDE5",borderRadius:"3px 3px 0px 0px",color:"#121212",padding:8,borderTop:"1px solid #D5DDE5",marginTop:-2},planHeader:{background:"#FFFFFF",borderRadius:"3px 3px 0px 0px",padding:8,borderTop:"1px solid #D5DDE5"},detailsPrice:{fontSize:13,fontWeight:700,marginBottom:8},detailsCapacityMax:{minHeight:28,fontSize:10,fontWeight:700,marginBottom:12,padding:"0% 15%"},detailsCapacityMin:{fontSize:10},itemContainer:{height:36},itemContainerDetail:{height:48},item:{height:"100%",borderLeft:"1px solid #e2e2e2",borderRight:"1px solid #e2e2e2",textAlign:"center",fontSize:10,fontWeight:700,display:"flex",alignItems:"center",alignContent:"center",marginLeft:8,maxWidth:"calc(25% - 8px)",borderTop:"1px solid #e5e5e5"},itemFirst:{borderLeft:0,borderRight:0},itemHighlighted:{borderLeft:"1px solid #B5B5B5",borderRight:"1px solid #B5B5B5"},field:{textAlign:"left",fontWeight:400,fontSize:12},checkIcon:{height:12,color:"transparent linear-gradient(90deg, #073052 0%, #081c42 100%) 0% 0% no-repeat padding-box"},buttonContainer:{paddingTop:8,paddingBottom:24,height:"100%",display:"flex",justifyContent:"center",borderRadius:"0 0 3px 3px",border:"1px solid #e2e2e2",borderTop:0,marginLeft:8,maxWidth:"calc(25% - 8px)"},buttonContainerBlank:{border:0},buttonContainerHighlighted:{border:"1px solid #B5B5B5",borderTop:0},button:{textTransform:"none",fontSize:15,fontWeight:700},licenseButton:{float:"right",marginTop:25,marginRight:25},openSourcePolicy:{color:"#1C5A8D",fontWeight:"bold"},activateLink:{color:"#1C5A8D",fontWeight:"bold",clear:"both",background:"none",border:"none",textDecoration:"underline",cursor:"pointer"},subnetRefreshLicenseLink:{color:"#1C5A8D",fontWeight:"bold",clear:"both",background:"none",border:"none",textDecoration:"underline",cursor:"pointer",fontSize:13},fullWidth:{width:"100%",height:"100%"},midWidth:{width:"70%",float:"left",height:"100%"},smallWidth:{width:"30%",float:"right",height:"100%",borderRadius:"0px 3px 0px 0px !important"},licenseInfo:{color:"#FFFFFF",position:"relative"},licenseInfoTitle:{textTransform:"none",color:"#BFBFBF",fontSize:11},licenseInfoValue:{textTransform:"none",fontSize:14,fontWeight:"bold"},licenseDescription:{background:"#032F51",padding:"30px 30px",borderTop:"1px solid #e2e5e4",borderLeft:"1px solid #e2e5e4",borderRight:"1px solid #e2e5e4",bottom:0,left:"5%",right:"5%",position:"absolute"},currentPlanBG:{background:"#022A4A 0% 0% no-repeat padding-box",color:"#FFFFFF",borderTop:"1px solid #52687d"},currentPlanButton:{background:"#FFFFFF",color:"#022A4A","&:hover":{background:"#FFFFFF"}},planItemsPadding:{padding:"23px 33px"},subnetSubTitle:{fontSize:12},verifiedIcon:{width:96,position:"absolute",right:0,bottom:29},loadingLoginStrategy:{textAlign:"center"}},(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))((function(e){var t=e.classes,a=e.operatorMode,r=function(){E(!0),Oe.invoke("GET","/api/v1/subscription/info").then((function(e){e&&("STANDARD"===e.plan?k(1):"ENTERPRISE"===e.plan?k(2):k(1),h(e)),E(!1)})).catch((function(e){E(!1)}))},o=Object(c.useState)(!1),s=Object(b.a)(o,2),l=s[0],d=s[1],u=Object(c.useState)(),j=Object(b.a)(u,2),m=j[0],h=j[1],p=Object(c.useState)(0),O=Object(b.a)(p,2),f=O[0],k=O[1],N=Object(c.useState)(!0),w=Object(b.a)(N,2),T=w[0],E=w[1],A=Object(c.useState)(!1),_=Object(b.a)(A,2),I=_[0],M=_[1];return Object(c.useEffect)((function(){r()}),[]),T?Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(y.a,{})}):Object(n.jsx)(i.a.Fragment,{children:Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsx)(qa,{label:"License"}),Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.container,children:[Object(n.jsx)(C.a,{className:"".concat(t.licenseContainer," ").concat(t.midWidth),children:m?Object(n.jsx)(i.a.Fragment,{children:Object(n.jsxs)(x.a,{container:!0,className:t.licenseInfo,children:[Object(n.jsxs)(x.a,{item:!0,xs:6,children:[Object(n.jsx)(v.a,{variant:"button",display:"block",gutterBottom:!0,className:t.licenseInfoTitle,children:"License"}),Object(n.jsx)(v.a,{variant:"overline",display:"block",gutterBottom:!0,className:t.licenseInfoValue,children:"Commercial License"}),Object(n.jsx)(v.a,{variant:"button",display:"block",gutterBottom:!0,className:t.licenseInfoTitle,children:"Organization"}),Object(n.jsx)(v.a,{variant:"overline",display:"block",gutterBottom:!0,className:t.licenseInfoValue,children:m.organization}),Object(n.jsx)(v.a,{variant:"button",display:"block",gutterBottom:!0,className:t.licenseInfoTitle,children:"Registered Capacity"}),Object(n.jsx)(v.a,{variant:"overline",display:"block",gutterBottom:!0,className:t.licenseInfoValue,children:ce((1099511627776*m.storage_capacity).toString(10))}),Object(n.jsx)(v.a,{variant:"button",display:"block",gutterBottom:!0,className:t.licenseInfoTitle,children:"Expiry Date"}),Object(n.jsx)(v.a,{variant:"overline",display:"block",gutterBottom:!0,className:t.licenseInfoValue,children:Object(n.jsx)(rt.a,{format:"YYYY-MM-DD",children:m.expires_at})})]}),Object(n.jsxs)(x.a,{item:!0,xs:6,children:[Object(n.jsx)(v.a,{variant:"button",display:"block",gutterBottom:!0,className:t.licenseInfoTitle,children:"Subscription Plan"}),Object(n.jsx)(v.a,{variant:"overline",display:"block",gutterBottom:!0,className:t.licenseInfoValue,children:m.plan}),Object(n.jsx)(v.a,{variant:"button",display:"block",gutterBottom:!0,className:t.licenseInfoTitle,children:"Requester"}),Object(n.jsx)(v.a,{variant:"overline",display:"block",gutterBottom:!0,className:t.licenseInfoValue,children:m.email})]}),Object(n.jsx)("img",{className:t.verifiedIcon,src:"/verified.svg",alt:"verified"})]})}):Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsx)("img",{src:"/agpl.svg",height:40,alt:"agpl"}),Object(n.jsx)(v.a,{component:"h2",variant:"h6",children:"GNU Affero General Public License"}),Object(n.jsx)("a",{href:"https://www.gnu.org/licenses/agpl-3.0.html",target:"_blank",rel:"nofollow noopener noreferrer",children:Object(n.jsxs)("div",{className:t.licenseDescription,children:[Object(n.jsx)(v.a,{component:"h3",children:"Version 3"}),Object(n.jsx)(v.a,{component:"h6",children:"The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the Community in the case of network server software."})]})})]})}),Object(n.jsx)(C.a,{className:"".concat(t.paper," ").concat(t.smallWidth),children:m?Object(n.jsxs)(i.a.Fragment,{children:[" ",Object(n.jsx)(v.a,{component:"h2",variant:"h6",className:t.pageTitle,children:"Login to MinIO SUBNET !"}),Object(n.jsx)(v.a,{component:"h6",className:t.subnetSubTitle,children:"It combines a commercial license with a support experience unlike any other."}),Object(n.jsx)("br",{}),Object(n.jsx)(g.a,{variant:"contained",color:"primary",className:t.button,target:"_blank",rel:"noopener noreferrer",href:"https://subnet.min.io/support/?ref=".concat(a?"op":"con"),children:"Login to SUBNET"}),a&&Object(n.jsxs)(i.a.Fragment,{children:[" ",Object(n.jsx)("br",{}),Object(n.jsx)("br",{}),Object(n.jsx)("button",{className:t.subnetRefreshLicenseLink,onClick:function(e){e.preventDefault(),M(!0),Oe.invoke("POST","/api/v1/subscription/refresh",{}).then((function(e){e&&("STANDARD"===e.plan?k(1):"ENTERPRISE"===e.plan?k(2):k(1),h(e)),M(!1)})).catch((function(e){M(!1)}))},children:"Refresh Licence"}),I&&Object(n.jsx)(S.a,{size:16,className:t.loadingLoginStrategy})]})]}):Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsx)(v.a,{component:"h2",variant:"h6",className:t.pageTitle,children:"Choosing between GNU AGPL v3 and Commercial License"}),Object(n.jsx)(v.a,{component:"h6",children:"If you are building proprietary applications, you may want to choose the commercial license included as part of the Standard and Enterprise subscription plans. Applications must otherwise comply with all the GNU AGPLv3 License & Trademark obligations. Follow the links below to learn more about the compliance policy."}),Object(n.jsx)("br",{}),Object(n.jsx)("a",{href:"https://min.io/compliance?ref=".concat(a?"op":"con"),className:t.openSourcePolicy,target:"_blank",rel:"nofollow noopener noreferrer",children:"Open Source Policy Compliance"}),Object(n.jsx)("br",{}),Object(n.jsx)("br",{}),Object(n.jsx)("a",{href:"https://min.io/logo?ref=".concat(a?"op":"con"),className:t.openSourcePolicy,target:"_blank",rel:"nofollow noopener noreferrer",children:"Trademark Policy"})]})})]}),Object(n.jsx)(x.a,{item:!0,xs:12,className:Object(ye.a)(t.planItemsPadding),children:Object(n.jsx)(C.a,{className:t.paper,style:{borderRadius:"0px 0px 3px 3px"},children:Object(n.jsxs)(x.a,{container:!0,children:[a?Object(n.jsx)(Gd,{open:l,closeModal:function(){return d(!1),void r()}}):null,Object(n.jsxs)(x.a,{container:!0,item:!0,xs:12,className:t.tableContainer,children:[Object(n.jsxs)(x.a,{container:!0,item:!0,xs:12,children:[Object(n.jsx)(x.a,{item:!0,xs:3,className:t.detailsContainer}),Ld.map((function(e){var a=!m&&"Community"===e.title||m&&m.plan.toLowerCase()===e.title.toLowerCase();return Object(n.jsxs)(x.a,{container:!0,item:!0,xs:3,className:Object(ye.a)(t.detailsContainer,t.detailsContainerBorder,Object(ve.a)({},t.detailsContainerBorderHighlighted,"Community"!==e.title),a?t.currentPlanBG:""),children:[Object(n.jsx)(x.a,{item:!0,xs:12,className:a?t.activePlanHeader:t.planHeader,children:a?"Current Plan":"\xa0"}),Object(n.jsx)(x.a,{item:!0,xs:12,className:t.detailsTitle,children:e.title}),Object(n.jsx)(x.a,{item:!0,xs:12,className:t.detailsPrice,children:e.price}),Object(n.jsx)(x.a,{item:!0,xs:12,className:t.detailsCapacityMax,children:e.capacityMax||""})]},e.id)}))]}),Bd.map((function(e){return Object(n.jsxs)(x.a,{container:!0,item:!0,xs:12,className:Object(ye.a)(t.itemContainer,e.communityDetail&&t.itemContainerDetail),children:[Object(n.jsx)(x.a,{item:!0,xs:3,className:Object(ye.a)(t.item,t.field,t.itemFirst),children:e.field}),Object(n.jsxs)(x.a,{container:!0,item:!0,xs:3,className:Object(ye.a)(t.item,0===f?t.currentPlanBG:""),children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:"N/A"===e.community?"":"Yes"===e.community?Object(n.jsx)(Dd.a,{className:t.checkIcon}):e.community}),void 0!==e.communityDetail&&Object(n.jsx)(x.a,{item:!0,xs:12,children:e.communityDetail})]}),Object(n.jsx)(x.a,{container:!0,item:!0,xs:3,className:Object(ye.a)(t.item,t.itemHighlighted,1===f?t.currentPlanBG:""),children:Object(n.jsx)(x.a,{item:!0,xs:12,children:"N/A"===e.standard?"":"Yes"===e.standard?Object(n.jsx)(Dd.a,{className:t.checkIcon}):e.standard})}),Object(n.jsx)(x.a,{container:!0,item:!0,xs:3,className:Object(ye.a)(t.item,t.itemHighlighted,2===f?t.currentPlanBG:""),children:Object(n.jsx)(x.a,{item:!0,xs:12,children:"N/A"===e.enterprise?"":"Yes"===e.enterprise?Object(n.jsx)(Dd.a,{className:t.checkIcon}):e.enterprise})})]},e.id)})),Object(n.jsxs)(x.a,{container:!0,item:!0,xs:12,children:[Object(n.jsx)(x.a,{item:!0,xs:3,className:Object(ye.a)(t.buttonContainer,t.buttonContainerBlank)}),Rd.map((function(e,c){return Object(n.jsxs)(x.a,{container:!0,item:!0,xs:3,style:{textAlign:"center"},className:Object(ye.a)(t.buttonContainer,f===c?t.currentPlanBG:"",Object(ve.a)({},t.buttonContainerHighlighted,"Subscribe"===e.text)),children:[Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(g.a,{variant:"contained",color:"primary",className:Object(ye.a)(t.button,f===c?t.currentPlanButton:""),target:"_blank",rel:"noopener noreferrer",href:"#",disabled:m&&m.plan.toLowerCase()===e.plan.toLowerCase(),onClick:function(t){t.preventDefault(),window.open("".concat(e.link,"/?ref=").concat(a?"op":"con"),"_blank")},children:f!==c&&c>0?e.text2:e.text})}),a&&"Subscribe"===e.text&&!(m&&m.plan.toLowerCase()===e.plan.toLowerCase())&&Object(n.jsx)(x.a,{item:!0,xs:12,style:{marginTop:"10px"},children:Object(n.jsx)("button",{className:t.activateLink,onClick:function(e){e.preventDefault(),d(!0)},children:"Activate"})})]},e.id)}))]})]})]})})})]})]})})}))),Hd=a(91),Yd="TRACE_MESSAGE_RECEIVED",Qd="TRACE_RESET_MESSAGES";var Zd=function(e){var t="ws";return"https:"===e&&(t="wss"),t},Jd=a(117),$d=a.n(Jd),Xd=Object(s.b)((function(e){return{messages:e.trace.messages}}),{traceMessageReceived:function(e){return{type:Yd,message:e}},traceResetMessages:function(){return{type:Qd}}})(Object(w.a)((function(e){return Object(k.a)(Object(j.a)({logList:{background:"white",height:"400px",overflow:"auto","& ul":{margin:"4px",padding:"0px"},"& ul li":{listStyle:"none",margin:"0px",padding:"0px",borderBottom:"1px solid #dedede"}},sizeItem:{width:150},timeItem:{width:100}},(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))((function(e){var t=e.classes,a=e.traceMessageReceived,r=e.traceResetMessages,o=e.messages;return Object(c.useEffect)((function(){r();var e=new URL(window.location.toString()),t=e.port,n=Zd(e.protocol),c=new Hd.w3cwebsocket("".concat(n,"://").concat(e.hostname,":").concat(t,"/ws/trace")),i=null;if(null!==c)return c.onopen=function(){console.log("WebSocket Client Connected"),c.send("ok"),i=setInterval((function(){c.send("ok")}),1e4)},c.onmessage=function(e){var t=JSON.parse(e.data.toString());t.ptime=$d()(t.time,"YYYY-MM-DD HH:mm:s.SSSS +0000 UTC").toDate(),t.key=Math.random(),a(t)},c.onclose=function(){clearInterval(i),console.log("connection closed by server")},function(){c.close(1e3),clearInterval(i),console.log("closing websockets")}}),[a,r]),Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsx)(qa,{label:"Trace"}),Object(n.jsx)(x.a,{container:!0,children:Object(n.jsx)(x.a,{item:!0,xs:12,className:t.container,children:Object(n.jsx)(ha,{itemActions:[],columns:[{label:"Time",elementKey:"ptime",renderFunction:function(e){var t=new Date(e);return re(t)},globalClass:t.timeItem},{label:"Name",elementKey:"api"},{label:"Status",elementKey:"",renderFunction:function(e){return"".concat(e.statusCode," ").concat(e.statusMsg)},renderFullObject:!0},{label:"Location",elementKey:"configuration_id",renderFunction:function(e){return"".concat(e.host," ").concat(e.client)},renderFullObject:!0},{label:"Load Time",elementKey:"callStats.duration",globalClass:t.timeItem},{label:"Upload",elementKey:"callStats.rx",renderFunction:ce,globalClass:t.sizeItem},{label:"Download",elementKey:"callStats.tx",renderFunction:ce,globalClass:t.sizeItem}],isLoading:!1,records:o,entityName:"Traces",idField:"api",customEmptyMessage:"There are no traced Elements yet",autoScrollToBottom:!0})})})]})}))),eu="LOG_MESSAGE_RECEIVED",tu="LOG_RESET_MESSAGES";var au=Object(s.b)((function(e){return{messages:e.logs.messages}}),{logMessageReceived:function(e){return{type:eu,message:e}},logResetMessages:function(){return{type:tu}}}),nu=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({logList:{background:"#fff",minHeight:400,height:"calc(100vh - 304px)",overflow:"auto",fontSize:13,padding:"25px 45px 0",border:"1px solid #EAEDEE",borderRadius:4},tab:{paddingLeft:25},logerror:{color:"#A52A2A"},logerror_tab:{color:"#A52A2A",paddingLeft:25},ansidefault:{color:"#000"},highlight:{"& span":{backgroundColor:"#082F5238"}}},Fe),De),Ke))}))(au((function(e){var t=e.classes,a=e.logMessageReceived,i=e.logResetMessages,r=e.messages,o=Object(c.useState)(""),s=Object(b.a)(o,2),l=s[0],d=s[1];Object(c.useEffect)((function(){i();var e=new URL(window.location.toString()),t=e.port,n=Zd(e.protocol),c=new Hd.w3cwebsocket("".concat(n,"://").concat(e.hostname,":").concat(t,"/ws/console")),r=null;if(null!==c)return c.onopen=function(){console.log("WebSocket Client Connected"),c.send("ok"),r=setInterval((function(){c.send("ok")}),1e4)},c.onmessage=function(e){var t=JSON.parse(e.data.toString());t.time=$d()(t.time,"HH:mm:s UTC MM/DD/YYYY").toDate(),t.key=Math.random(),a(t)},c.onclose=function(){clearInterval(r),console.log("connection closed by server")},function(){c.close(1e3),clearInterval(r),console.log("closing websockets")}}),[a,i]);var u=function(e){var a=e.ConsoleMsg,c=(a=a.replace(/([^\x20-\x7F])/g,"")).replace(/((\[[0-9;]+m))/g,""),i=""!==l&&a.toLowerCase().includes(l.toLowerCase());return c.startsWith(" ")?Object(n.jsx)("div",{className:"".concat(i?t.highlight:""),children:Object(n.jsx)("span",{className:t.tab,children:c})},e.key):null!==e.error&&void 0!==e.error?function(e){var a=[];if(null!==e.error&&void 0!==e.error){if(e.api&&e.api.name){var c="API: ".concat(e.api.name),i=""!==l&&c.toLowerCase().includes(l.toLowerCase());a.push(Object(n.jsxs)("div",{className:"".concat(i?t.highlight:""),children:[Object(n.jsx)("br",{}),Object(n.jsx)("span",{className:t.logerror,children:c})]},"api-".concat(e.key)))}if(e.time){var r="Time: ".concat(re(e.time)),o=""!==l&&r.toLowerCase().includes(l.toLowerCase());a.push(Object(n.jsx)("div",{className:"".concat(o?t.highlight:""),children:Object(n.jsx)("span",{className:t.logerror,children:r})},"time-".concat(e.key)))}if(e.deploymentid){var s="DeploymentID: ".concat(e.deploymentid),d=""!==l&&s.toLowerCase().includes(l.toLowerCase());a.push(Object(n.jsx)("div",{className:"".concat(d?t.highlight:""),children:Object(n.jsx)("span",{className:t.logerror,children:s})},"deploytmentid-".concat(e.key)))}if(e.requestID){var u="RequestID: ".concat(e.requestID),b=""!==l&&u.toLowerCase().includes(l.toLowerCase());a.push(Object(n.jsx)("div",{className:"".concat(b?t.highlight:""),children:Object(n.jsx)("span",{className:t.logerror,children:u})},"requestid-".concat(e.key)))}if(e.remotehost){var j="RemoteHost: ".concat(e.remotehost),m=""!==l&&j.toLowerCase().includes(l.toLowerCase());a.push(Object(n.jsx)("div",{className:"".concat(m?t.highlight:""),children:Object(n.jsx)("span",{className:t.logerror,children:j})},"remotehost-".concat(e.key)))}if(e.host){var h="Host: ".concat(e.host),p=""!==l&&h.toLowerCase().includes(l.toLowerCase());a.push(Object(n.jsx)("div",{className:"".concat(p?t.highlight:""),children:Object(n.jsx)("span",{className:t.logerror,children:h})},"host-".concat(e.key)))}if(e.userAgent){var O="UserAgent: ".concat(e.userAgent),g=""!==l&&O.toLowerCase().includes(l.toLowerCase());a.push(Object(n.jsx)("div",{className:"".concat(g?t.highlight:""),children:Object(n.jsx)("span",{className:t.logerror,children:O})},"useragent-".concat(e.key)))}if(e.error.message){var f="Error: ".concat(e.error.message),x=""!==l&&f.toLowerCase().includes(l.toLowerCase());a.push(Object(n.jsx)("div",{className:"".concat(x?t.highlight:""),children:Object(n.jsx)("span",{className:t.logerror,children:f})},"message-".concat(e.key)))}if(e.error.source)for(var v in e.error.source){var y=e.error.source[v],S=""!==l&&y.toLowerCase().includes(l.toLowerCase());a.push(Object(n.jsx)("div",{className:"".concat(S?t.highlight:""),children:Object(n.jsx)("span",{className:t.logerror_tab,children:y})},"source-".concat(e.key,"-").concat(v)))}}return a}(e):Object(n.jsx)("div",{className:"".concat(i?t.highlight:""),children:Object(n.jsx)("span",{className:t.ansidefault,children:c})},e.key)},j=r.map((function(e){return u(e)}));return Object(n.jsx)(c.Fragment,{children:Object(n.jsxs)(x.a,{container:!0,className:t.logsSubContainer,children:[Object(n.jsx)(x.a,{item:!0,xs:12,className:t.actionsTray,children:Object(n.jsx)(f.a,{placeholder:"Highlight Line",className:t.searchField,id:"search-resource",label:"",onChange:function(e){d(e.target.value)},InputProps:{disableUnderline:!0,startAdornment:Object(n.jsx)(et.a,{position:"start",children:Object(n.jsx)(at.a,{})})}})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("br",{})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("div",{className:t.logList,children:j})})]})})}))),cu=a(994),iu=Object(w.a)((function(e){return Object(k.a)({searchField:Object(j.a)(Object(j.a)({},De.searchField),{},{height:30,padding:0,"& input":{padding:"0 12px",height:28,fontSize:12,fontWeight:600,color:"#393939"},"&.isDisabled":{"&:hover":{borderColor:"#EAEDEE"}},"& input.Mui-disabled":{backgroundColor:"#EAEAEA"}}),labelStyle:{color:"#393939",fontSize:12,marginBottom:4},buttonKit:{display:"flex",alignItems:"center"},toggleButton:{marginRight:10},fieldContainer:{flexGrow:1,margin:"0 15px"}})}))((function(e){var t=e.classes,a=e.label,i=e.onChange,r=e.value,o=e.placeholder,s=void 0===o?"":o,l=e.id,d=e.name;return Object(n.jsx)(c.Fragment,{children:Object(n.jsxs)("div",{className:t.fieldContainer,children:[Object(n.jsx)("div",{className:t.labelStyle,children:a}),Object(n.jsx)("div",{className:t.buttonKit,children:Object(n.jsx)(f.a,{placeholder:s,id:l,name:d,label:"",onChange:function(e){i(e.target.value)},InputProps:{disableUnderline:!0},className:t.searchField,value:r})})]})})})),ru={setErrorSnackMessage:V},ou=Object(s.b)(null,ru),su=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)(Object(j.a)({inputBar:{flexGrow:1,marginLeft:15},advancedLabel:{display:"flex",alignItems:"center",color:"#091C42",border:0,backgroundColor:"transparent",cursor:"pointer","&:focus, &:active":{outline:"none"}},advancedLabelContainer:{marginTop:10},getInformationContainer:{textAlign:"right"},orderButton:{width:93},recordsLabel:{alignSelf:"center",marginLeft:15},blockCollapsed:{height:0,overflowY:"hidden",transitionDuration:"0.3s"},filterOpen:{height:200,marginBottom:12},endLineAction:{marginBottom:15},filtersContainer:{display:"flex",justifyContent:"space-between",marginBottom:12},innerContainer:{backgroundColor:"#fff",border:"#EAEDEE 1px solid",borderRadius:3,padding:10,marginBottom:15},noticeLabel:{marginLeft:15,marginBottom:15,fontSize:12,color:"#9C9C9C"},tableFOpen:{height:"calc(100vh - 561px)"},tableFClosed:{height:"calc(100vh - 349px)"},"@global":{".overrideMargin":{marginLeft:0}}},De),Fe),Ke),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))(ou((function(e){var t=e.classes,a=e.setErrorSnackMessage,i=Object(c.useState)(!0),r=Object(b.a)(i,2),o=r[0],s=r[1],l=Object(c.useState)(null),d=Object(b.a)(l,2),u=d[0],j=d[1],m=Object(c.useState)(null),h=Object(b.a)(m,2),p=h[0],O=h[1],f=Object(c.useState)(!1),v=Object(b.a)(f,2),y=v[0],S=v[1],C=Object(c.useState)([]),k=Object(b.a)(C,2),N=k[0],w=k[1],T=Object(c.useState)(""),E=Object(b.a)(T,2),A=E[0],_=E[1],I=Object(c.useState)(""),M=Object(b.a)(I,2),F=M[0],D=M[1],L=Object(c.useState)(""),B=Object(b.a)(L,2),R=B[0],P=B[1],z=Object(c.useState)(""),K=Object(b.a)(z,2),U=K[0],W=K[1],V=Object(c.useState)(""),G=Object(b.a)(V,2),q=G[0],H=G[1],Y=Object(c.useState)(""),Q=Object(b.a)(Y,2),J=Q[0],$=Q[1],X=Object(c.useState)("DESC"),ee=Object(b.a)(X,2),te=ee[0],ae=ee[1],ne=Object(c.useState)(["time","api_name","bucket","object","remote_host","request_id","user_agent","response_status"]),ie=Object(b.a)(ne,2),re=ie[0],oe=ie[1],se=Object(c.useState)(0),le=Object(b.a)(se,2),de=le[0],ue=le[1],be=Object(c.useState)(!1),je=Object(b.a)(be,2),me=je[0],pe=je[1],ge=null,fe=Object(c.useCallback)((function(){if(!me){pe(!0);var e="".concat(""!==A?"&fp=bucket:".concat(A):"").concat(""!==U?"&fp=object:".concat(U):"").concat(""!==F?"&fp=api_name:".concat(F):"").concat(""!==q?"&fp=request_id:".concat(q):"").concat(""!==R?"&fp=user_agent:".concat(R):"").concat(""!==J?"&fp=response_status:".concat(J):"");(e=e.trim()).endsWith(",")&&(e=e.slice(0,-1)),Oe.invoke("GET","/api/v1/logs/search?q=reqinfo".concat(""!==e?"".concat(e):"","&pageSize=100&pageNo=").concat(de,"&order=").concat("DESC"===te?"timeDesc":"timeAsc").concat(null!==u?"&timeStart=".concat(u.toISOString()):"").concat(null!==p?"&timeEnd=".concat(p.toISOString()):"")).then((function(e){var t=e.results||[],a=[].concat(Object(Xe.a)(N),Object(Xe.a)(t));s(!1),pe(!1),w(a),ue(de+1),null!==ge&&ge()})).catch((function(e){s(!1),pe(!1),a(e)}))}}),[A,U,F,q,R,J,de,te,u,p,me,N,ge,a]);Object(c.useEffect)((function(){o&&(w([]),fe())}),[o,te,fe]);return Object(n.jsx)(c.Fragment,{children:Object(n.jsxs)(x.a,{container:!0,className:t.logsSubContainer,children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:"".concat(t.actionsTray," ").concat(t.timeContainers),children:[Object(n.jsx)("span",{className:t.label,children:"Start Time"}),Object(n.jsx)(pi,{value:u,onChange:j}),Object(n.jsx)("span",{className:t.label,children:"End Time"}),Object(n.jsx)(pi,{value:p,onChange:O})]}),Object(n.jsx)(x.a,{item:!0,xs:12,className:"".concat(t.advancedLabelContainer),children:Object(n.jsx)("div",{className:"".concat(t.blockCollapsed," ").concat(y?t.filterOpen:""),children:Object(n.jsxs)("div",{className:t.innerContainer,children:[Object(n.jsxs)("div",{className:t.noticeLabel,children:["Enable your preferred options to get filtered records.",Object(n.jsx)("br",{}),"You can use '*' to match any character, '.' to signify a single character or '\\' to scape an special character (E.g. mybucket-*)"]}),Object(n.jsxs)("div",{className:t.filtersContainer,children:[Object(n.jsx)(iu,{onChange:_,value:A,label:"Bucket",id:"bucket",name:"bucket"}),Object(n.jsx)(iu,{onChange:D,value:F,label:"API Name",id:"api_name",name:"api_name"}),Object(n.jsx)(iu,{onChange:P,value:R,label:"User Agent",id:"user_agent",name:"user_agent"})]}),Object(n.jsxs)("div",{className:t.filtersContainer,children:[Object(n.jsx)(iu,{onChange:W,value:U,label:"Object",id:"object",name:"object"}),Object(n.jsx)(iu,{onChange:H,value:q,label:"Request ID",id:"request_id",name:"request_id"}),Object(n.jsx)(iu,{onChange:$,value:J,label:"Response Status",id:"response_status",name:"response_status"})]})]})})}),Object(n.jsxs)(x.a,{item:!0,xs:12,className:"".concat(t.actionsTray," ").concat(t.endLineAction),children:[Object(n.jsx)("div",{children:Object(n.jsxs)("button",{type:"button",className:"".concat(t.advancedLabel," overrideMargin"),onClick:function(){S(!y)},children:["Advanced Filters"," ",y?Object(n.jsx)(cu.a,{}):Object(n.jsx)(Vt.a,{})]})}),Object(n.jsx)(g.a,{type:"button",variant:"contained",color:"primary",onClick:function(){ue(0),s(!0)},children:"Get Information"})]}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(ha,{columns:[{label:"Timestamp",elementKey:"time",enableSort:!0},{label:"API Name",elementKey:"api_name"},{label:"Bucket",elementKey:"bucket"},{label:"Object",elementKey:"object"},{label:"Remote Host",elementKey:"remote_host"},{label:"Request ID",elementKey:"request_id"},{label:"User Agent",elementKey:"user_agent"},{label:"Response Status",elementKey:"response_status",renderFunction:function(e){return Object(n.jsx)(c.Fragment,{children:Object(n.jsxs)("span",{children:[e.response_status_code," (",e.response_status,")"]})})},renderFullObject:!0},{label:"Request Content Length",elementKey:"request_content_length",renderFunction:ce},{label:"Response Content Length",elementKey:"response_content_length",renderFunction:ce},{label:"Time to Response NS",elementKey:"time_to_response_ns",renderFunction:he,contentTextAlign:"right"}],isLoading:o,records:N,entityName:"Logs",customEmptyMessage:"There is no information with this criteria",idField:"request_id",columnsSelector:!0,columnsShown:re,onColumnChange:function(e,t){var a=Object(Xe.a)(re);t?a.includes(e)||a.push(e):a=re.filter((function(t){return t!==e})),oe(a)},customPaperHeight:y?t.tableFOpen:t.tableFClosed,sortConfig:{currentSort:"time",currentDirection:te,triggerSort:function(e){var t=Z()(e,"sortDirection","DESC");ae(t),ue(0),s(!0)}},infiniteScrollConfig:{recordsCount:1e6,loadMoreRecords:function(e){return fe(),new Promise((function(e){ge=e}))}},textSelectable:!0})})]})})}))),lu=Object(w.a)((function(e){return Object(k.a)(Object(j.a)({headerLabel:{fontSize:22,fontWeight:600,color:"#000",marginTop:4}},(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))((function(e){var t=e.classes,a=Object(c.useState)(0),i=Object(b.a)(a,2),r=i[0],o=i[1],s=Object(c.useState)(!0),l=Object(b.a)(s,2),d=l[0],u=l[1],j=Object(c.useState)(!1),m=Object(b.a)(j,2),h=m[0],p=m[1];return Object(c.useEffect)((function(){Oe.invoke("GET","/api/v1/logs/search?q=reqinfo&pageSize=10&pageNo=0").then((function(){p(!0),u(!1)})).catch((function(e){u(!1),console.info("Log Search API not available.")}))}),[d]),Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(qa,{label:"Logs"}),Object(n.jsx)(x.a,{container:!0,children:Object(n.jsx)(x.a,{item:!0,xs:12,className:t.container,children:d?Object(n.jsx)(y.a,{}):Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(x.a,{item:!0,xs:12,className:t.headerLabel,children:"All Logs"}),Object(n.jsxs)(nn.a,{value:r,onChange:function(e,t){o(t)},indicatorColor:"primary",textColor:"primary","aria-label":"cluster-tabs",variant:"scrollable",scrollButtons:"auto",children:[Object(n.jsx)(cn.a,{label:"Error Logs"}),h&&Object(n.jsx)(cn.a,{label:"Logs Search"})]}),Object(n.jsxs)(x.a,{item:!0,xs:12,children:[0===r&&Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(nu,{})}),1===r&&h&&Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(su,{})})]})]})})})]})})),du=a(442),uu=Object(w.a)((function(e){return Object(k.a)({root:{width:450,lineHeight:"50px",marginRight:15,"label + &":{marginTop:e.spacing(3)},"& .MuiSelect-select:focus":{backgroundColor:"transparent"}},input:{height:50,fontSize:13,lineHeight:"50px",width:450}})}))(ka.a),bu=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({watchList:{background:"white",maxHeight:"400",overflow:"auto","& ul":{margin:"4",padding:"0"},"& ul li":{listStyle:"none",margin:"0",padding:"0",borderBottom:"1px solid #dedede"}},graphContainer:{backgroundColor:"#fff",border:"#EAEDEE 1px solid",borderRadius:3,padding:"19px 38px"},scanInfo:{marginTop:20,display:"flex",flexDirection:"row",justifyContent:"space-between"},scanData:{fontSize:13},inlineCheckboxes:{display:"flex",justifyContent:"flex-start"}},Fe),De),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))((function(e){var t=e.classes,a=Object(c.useState)(!1),r=Object(b.a)(a,2),o=r[0],s=r[1],l=Object(c.useState)(""),d=Object(b.a)(l,2),u=d[0],j=d[1],m=Object(c.useState)([]),h=Object(b.a)(m,2),p=h[0],O=h[1],v=Object(c.useState)(""),y=Object(b.a)(v,2),S=y[0],C=y[1],k=Object(c.useState)(!1),N=Object(b.a)(k,2),w=N[0],T=N[1],E=Object(c.useState)(!1),A=Object(b.a)(E,2),_=A[0],I=A[1],M=Object(c.useState)(!1),F=Object(b.a)(M,2),D=F[0],L=F[1],B=Object(c.useState)({beforeHeal:[0,0,0,0],afterHeal:[0,0,0,0],objectsHealed:0,objectsScanned:0,healDuration:0,sizeScanned:""}),R=Object(b.a)(B,2),P=R[0],z=R[1];Object(c.useEffect)((function(){Oe.invoke("GET","/api/v1/buckets").then((function(e){var t=[];null!==e.buckets&&(t=e.buckets),O(t)})).catch((function(e){console.log(e)}))}),[]),Object(c.useEffect)((function(){!0===_&&L(!1)}),[_]),Object(c.useEffect)((function(){!0===D&&I(!1)}),[D]);var K=function(e){return[e.Green,e.Yellow,e.Red,e.Grey]};Object(c.useEffect)((function(){if(o){var e={Green:0,Yellow:0,Red:0,Grey:0},t={Green:0,Yellow:0,Red:0,Grey:0},a=new URL(window.location.toString()),n=a.port,c=Zd(a.protocol),i=new Hd.w3cwebsocket("".concat(c,"://").concat(a.hostname,":").concat(n,"/ws/heal/").concat(u,"?prefix=").concat(S,"&recursive=").concat(w,"&force-start=").concat(_,"&force-stop=").concat(D));if(null!==i)return i.onopen=function(){console.log("WebSocket Client Connected"),i.send("ok")},i.onmessage=function(a){for(var n=JSON.parse(a.data.toString()),c=0,i=Object.entries(n.healthAfterCols);c<i.length;c++){var r=Object(b.a)(i[c],2),o=r[0],s=r[1];t[o]=100*s/n.itemsScanned}for(var l=0,d=Object.entries(n.healthBeforeCols);l<d.length;l++){var u=Object(b.a)(d[l],2),j=u[0],m=u[1];e[j]=100*m/n.itemsScanned}z({beforeHeal:K(e),afterHeal:K(t),objectsHealed:n.objectsHealed,objectsScanned:n.objectsScanned,healDuration:n.healDuration,sizeScanned:ce(n.bytesScanned.toString())})},i.onclose=function(){s(!1),console.log("connection closed by server")},function(){i.close(1e3),console.log("closing websockets")}}}),[o,u,_,D,S,w]);var U={labels:["Green","Yellow","Red","Grey"],datasets:[{label:"After Healing",data:P.afterHeal,backgroundColor:"rgba(0, 0, 255, 0.2)",borderColor:"rgba(54, 162, 235, 1)",borderWidth:1},{label:"Before Healing",data:P.beforeHeal,backgroundColor:"rgba(153, 102, 255, 0.2)",borderColor:"rgba(153, 102, 255, 1)",borderWidth:1}]},W=p.map((function(e){return{label:e.name,value:e.name}}));return Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsx)(qa,{label:"Heal"}),Object(n.jsx)(x.a,{container:!0,className:t.container,children:Object(n.jsxs)(x.a,{item:!0,xs:12,children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.actionsTray,children:[Object(n.jsx)(Na.a,{variant:"outlined",children:Object(n.jsxs)(wa.a,{id:"bucket-name",name:"bucket-name",value:u,onChange:function(e){j(e.target.value)},className:t.searchField,input:Object(n.jsx)(uu,{}),displayEmpty:!0,children:[Object(n.jsx)(Ta.a,{value:"",children:"Select Bucket"},"select-bucket-name-default"),W.map((function(e){return Object(n.jsx)(Ta.a,{value:e.value,children:e.label},"select-bucket-name-".concat(e.label))}))]})}),Object(n.jsx)(f.a,{placeholder:"Prefix",className:t.searchField,id:"prefix-resource",label:"",disabled:!1,InputProps:{disableUnderline:!0},onChange:function(e){C(e.target.value)}}),Object(n.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:o,onClick:function(){return s(!0)},children:"Start"})]}),Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.inlineCheckboxes,children:[Object(n.jsx)(ua,{name:"recursive",id:"recursive",value:"recursive",checked:w,onChange:function(e){T(e.target.checked)},disabled:!1,label:"Recursive"}),Object(n.jsx)(ua,{name:"forceStart",id:"forceStart",value:"forceStart",checked:_,onChange:function(e){I(e.target.checked)},disabled:!1,label:"Force Start"}),Object(n.jsx)(ua,{name:"forceStop",id:"forceStop",value:"forceStop",checked:D,onChange:function(e){L(e.target.checked)},disabled:!1,label:"Force Stop"})]}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("br",{})}),Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.graphContainer,children:[Object(n.jsx)(du.HorizontalBar,{data:U,width:80,height:30,options:{title:{display:!0,text:"Item's Health Status [%]",fontSize:20},legend:{display:!0,position:"right"}}}),Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.scanInfo,children:[Object(n.jsxs)("div",{className:t.scanData,children:[Object(n.jsx)("strong",{children:"Size scanned:"})," ",P.sizeScanned]}),Object(n.jsxs)("div",{className:t.scanData,children:[Object(n.jsx)("strong",{children:"Objects healed:"})," ",P.objectsHealed," /"," ",P.objectsScanned]}),Object(n.jsxs)("div",{className:t.scanData,children:[Object(n.jsx)("strong",{children:"Healing time:"})," ",P.healDuration,"s"]})]})]})]})})]})})),ju="WATCH_MESSAGE_RECEIVED",mu="WATCH_RESET_MESSAGES";var hu=Object(w.a)((function(e){return Object(k.a)({root:{width:450,lineHeight:"50px","label + &":{marginTop:e.spacing(3)},"& .MuiSelect-select:focus":{backgroundColor:"transparent"}},input:{height:50,fontSize:13,lineHeight:"50px",width:450}})}))(ka.a),pu=Object(s.b)((function(e){return{messages:e.watch.messages}}),{watchMessageReceived:function(e){return{type:ju,message:e}},watchResetMessages:function(){return{type:mu}}})(Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({watchList:{background:"white",height:"400px",overflow:"auto","& ul":{margin:"4px",padding:"0px"},"& ul li":{listStyle:"none",margin:"0px",padding:"0px",borderBottom:"1px solid #dedede"}},searchPrefix:{flexGrow:1,marginLeft:15}},Fe),De),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))((function(e){var t=e.classes,a=e.watchMessageReceived,r=e.watchResetMessages,o=e.messages,s=Object(c.useState)(!1),l=Object(b.a)(s,2),d=l[0],u=l[1],j=Object(c.useState)("Select Bucket"),m=Object(b.a)(j,2),h=m[0],p=m[1],O=Object(c.useState)(""),v=Object(b.a)(O,2),y=v[0],S=v[1],C=Object(c.useState)(""),k=Object(b.a)(C,2),N=k[0],w=k[1],T=Object(c.useState)([]),E=Object(b.a)(T,2),A=E[0],_=E[1];Object(c.useEffect)((function(){Oe.invoke("GET","/api/v1/buckets").then((function(e){var t=[];null!==e.buckets&&(t=e.buckets),_(t)})).catch((function(e){console.log(e)}))}),[]),Object(c.useEffect)((function(){if(r(),d&&A.some((function(e){return e.name===h}))){var e=new URL(window.location.toString()),t=e.port,n=Zd(e.protocol),c=new Hd.w3cwebsocket("".concat(n,"://").concat(e.hostname,":").concat(t,"/ws/watch/").concat(h,"?prefix=").concat(y,"&suffix=").concat(N)),i=null;if(null!==c)return c.onopen=function(){console.log("WebSocket Client Connected"),c.send("ok"),i=setInterval((function(){c.send("ok")}),1e4)},c.onmessage=function(e){var t=JSON.parse(e.data.toString());t.Time=new Date(t.Time.toString()),t.key=Math.random(),a(t)},c.onclose=function(){clearInterval(i),console.log("connection closed by server"),u(!1)},function(){c.close(1e3),clearInterval(i),console.log("closing websockets")}}else u(!1)}),[a,d,A,h,y,N,r]);var I=A.map((function(e){return{label:e.name,value:e.name}}));return Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsx)(qa,{label:"Watch"}),Object(n.jsx)(x.a,{container:!0,children:Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.container,children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.actionsTray,children:[Object(n.jsx)(Na.a,{variant:"outlined",children:Object(n.jsxs)(wa.a,{id:"bucket-name",name:"bucket-name",value:h,onChange:function(e){p(e.target.value)},className:t.searchField,disabled:d,input:Object(n.jsx)(hu,{}),children:[Object(n.jsx)(Ta.a,{value:h,disabled:!0,children:"Select Bucket"},"select-bucket-name-default"),I.map((function(e){return Object(n.jsx)(Ta.a,{value:e.value,children:e.label},"select-bucket-name-".concat(e.label))}))]})}),Object(n.jsx)(f.a,{placeholder:"Prefix",className:"".concat(t.searchField," ").concat(t.searchPrefix),id:"prefix-resource",label:"",disabled:d,InputProps:{disableUnderline:!0},onChange:function(e){S(e.target.value)}}),Object(n.jsx)(f.a,{placeholder:"Suffix",className:"".concat(t.searchField," ").concat(t.searchPrefix),id:"suffix-resource",label:"",disabled:d,InputProps:{disableUnderline:!0},onChange:function(e){w(e.target.value)}}),Object(n.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:d,onClick:function(){return u(!0)},children:"Start"})]}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("br",{})}),Object(n.jsx)(ha,{columns:[{label:"Time",elementKey:"Time",renderFunction:re},{label:"Size",elementKey:"Size",renderFunction:ce},{label:"Type",elementKey:"Type"},{label:"Path",elementKey:"Path"}],records:o,entityName:"Watch",customEmptyMessage:"No Changes at this time",idField:"watch_table",isLoading:!1})]})})]})}))),Ou="HEALTH_INFO_MESSAGE_RECEIVED",gu="HEALTH_INFO_RESET_MESSAGE";var fu="error",xu="success",vu="inProgress",yu=Object(s.b)((function(e){return{message:e.healthInfo.message,serverDiagnosticStatus:e.system.serverDiagnosticStatus}}),{healthInfoMessageReceived:function(e){return{type:Ou,message:e}},healthInfoResetMessage:function(){return{type:gu}},setSnackBarMessage:W,setServerDiagStat:function(e){return{type:D,serverDiagnosticStatus:e}}})(Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({logList:{background:"#fff",minHeight:400,height:"calc(100vh - 270px)",overflow:"auto",fontSize:13,padding:"25px 45px",border:"1px solid #EAEDEE",borderRadius:4},loading:{paddingTop:8,paddingLeft:40},buttons:{justifyContent:"flex-start",gap:20}},Fe),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))((function(e){var t=e.classes,a=e.healthInfoMessageReceived,r=e.healthInfoResetMessage,o=e.message,s=e.setSnackBarMessage,l=e.setServerDiagStat,d=e.serverDiagnosticStatus,u=Object(c.useState)(!1),j=Object(b.a)(u,2),m=j[0],h=j[1],p=Object(c.useState)(!0),O=Object(b.a)(p,2),f=O[0],v=O[1];return Object(c.useEffect)((function(){d===xu&&o!=={}&&v(!1),d===vu&&v(!0),h(!1)}),[d,o]),Object(c.useEffect)((function(){if(m){r();var e=new URL(window.location.toString()),t=e.port,n=Zd(e.protocol),c=new Hd.w3cwebsocket("".concat(n,"://").concat(e.hostname,":").concat(t,"/ws/health-info?deadline=1h")),i=null;null!==c&&(c.onopen=function(){console.log("WebSocket Client Connected"),c.send("ok"),i=setInterval((function(){c.send("ok")}),1e4),s("Diagnostic started. Please do not refresh page during diagnosis."),l(vu)},c.onmessage=function(e){var t=JSON.parse(e.data.toString());t.timestamp=new Date(t.timestamp.toString()),a(t)},c.onerror=function(e){console.log("error closing websocket:",e.message),c.close(1e3),clearInterval(i),l(fu)},c.onclose=function(e){clearInterval(i),1011===e.code||1008===e.code||1006===e.code?(console.log("connection closed by server with code:",e.code),s("An error occurred while getting Diagnostic file."),l(fu)):(console.log("connection closed by server"),s("Diagnostic file is ready to be downloaded."),l(xu))})}else h(!1)}),[a,r,m,s,l]),Object(n.jsxs)(i.a.Fragment,{children:[Object(n.jsx)(qa,{label:"Diagnostic"}),Object(n.jsx)(x.a,{container:!0,children:Object(n.jsx)(x.a,{item:!0,xs:12,className:t.container,children:Object(n.jsxs)(x.a,{container:!0,className:t.buttons,children:[Object(n.jsx)(x.a,{item:!0,children:Object(n.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:m,onClick:function(){return h(!0)},children:"Start Diagnostic"})},"start-diag"),Object(n.jsx)(x.a,{item:!0,children:d===vu?Object(n.jsx)("div",{className:t.loading,children:Object(n.jsx)(S.a,{size:25})}):Object(n.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",onClick:function(){!function(e,t){var a=document.createElement("a");a.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(t)),a.setAttribute("download",e),a.style.display="none",document.body.appendChild(a),a.click(),document.body.removeChild(a)}("diagnostic.json",JSON.stringify(o,null,2))},disabled:f,children:"Download"})},"start-download")]})})})]})}))),Su={setErrorSnackMessage:V},Cu=Object(s.b)(null,Su),ku=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({headerLabel:{fontSize:22,fontWeight:600,color:"#000",marginTop:4},breadcrumLink:{textDecoration:"none",color:"black"},tableWrapper:{height:"calc(100vh - 267px)"}},Fe),De),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))(Cu((function(e){var t=e.classes,a=e.setErrorSnackMessage,i=Object(c.useState)([]),r=Object(b.a)(i,2),o=r[0],s=r[1],l=Object(c.useState)(""),d=Object(b.a)(l,2),u=d[0],j=d[1],m=Object(c.useState)(!0),h=Object(b.a)(m,2),p=h[0],O=h[1];Object(c.useEffect)((function(){p&&Oe.invoke("GET","/api/v1/list-pvcs").then((function(e){var t=Z()(e,"pvcs",[]);s(t||[]),O(!1)})).catch((function(e){O(!1),a(e)}))}),[p,a]);var g=o.filter((function(e){return e.name.includes(u)}));return Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(x.a,{item:!0,xs:12,className:t.actionsTray,children:Object(n.jsx)(f.a,{placeholder:"Search PVC",className:t.searchField,id:"search-resource",label:"",InputProps:{disableUnderline:!0,startAdornment:Object(n.jsx)(et.a,{position:"start",children:Object(n.jsx)(at.a,{})})},onChange:function(e){j(e.target.value)}})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("br",{})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(ha,{itemActions:[],columns:[{label:"Name",elementKey:"name"},{label:"Namespace",elementKey:"namespace",width:90},{label:"Status",elementKey:"status",width:120},{label:"Volume",elementKey:"volume"},{label:"Capacity",elementKey:"capacity",width:90},{label:"Storage Class",elementKey:"storageClass"}],isLoading:p,records:g,entityName:"PVCs",idField:"name",customPaperHeight:t.tableWrapper})})]})}))),Nu="DIRECT_CSI/SELECT_DRIVE",wu={setErrorSnackMessage:V},Tu=Object(s.b)(null,wu)((function(e){var t=e.closeFormatModalAndRefresh,a=e.deleteOpen,i=e.allDrives,r=e.drivesToFormat,o=e.setErrorSnackMessage,s=Object(c.useState)(!1),l=Object(b.a)(s,2),d=l[0],u=l[1],j=Object(c.useState)(""),m=Object(b.a)(j,2),h=m[0],p=m[1],O=Object(c.useState)(!1),f=Object(b.a)(O,2),v=f[0],S=f[1];return Object(n.jsxs)(pa.a,{open:a,onClose:function(){t(!1,[])},"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[Object(n.jsxs)(Oa.a,{id:"alert-dialog-title",children:["Format ",i?"All ":"","Drives"]}),Object(n.jsx)(ga.a,{children:Object(n.jsxs)(Ua.a,{id:"alert-dialog-description",children:[!i&&Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(Ja,{label:"Selected Drive".concat(r.length>1?"s":""),content:r.join(", ")}),Object(n.jsx)("br",{})]}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(za,{value:"force",id:"force",name:"force",checked:v,onChange:function(e){S(e.target.checked)},label:"Force Format",indicatorLabels:["Yes","No"]})}),"Are you sure you want to format"," ",i?Object(n.jsx)("strong",{children:"All"}):"the selected"," drive",r.length>1||i?"s":"","?.",Object(n.jsx)("br",{}),Object(n.jsx)("br",{}),Object(n.jsx)("strong",{children:"All information contained will be erased and cannot be recovered"}),Object(n.jsx)("br",{}),Object(n.jsx)("br",{}),"To continue please type ",Object(n.jsx)("b",{children:"YES, PROCEED"})," in the box.",Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)(Ca,{id:"format-confirm",name:"format-confirm",onChange:function(e){p(e.target.value)},label:"",value:h})})]})}),d&&Object(n.jsx)(y.a,{}),Object(n.jsxs)(Wa.a,{children:[Object(n.jsx)(g.a,{onClick:function(){t(!1,[])},color:"primary",disabled:d,children:"Cancel"}),Object(n.jsxs)(g.a,{onClick:function(){d||(u(!0),Oe.invoke("POST","/api/v1/direct-csi/drives/format",{drives:r,force:v}).then((function(e){u(!1),t(!0,e.formatIssuesList)})).catch((function(e){u(!1),o(e)})))},color:"secondary",autoFocus:!0,disabled:"YES, PROCEED"!==h,children:["Format Drive",r.length>1||i?"s":""]})]})]})})),Eu=Object(w.a)((function(e){return Object(k.a)({warningBlock:{color:"red"},buttonContainer:{textAlign:"right"},errorsList:{height:"calc(100vh - 280px)"}})}))((function(e){var t=e.open,a=e.onCloseFormatErrorsList,c=e.errorsList,i=e.classes;return Object(n.jsx)(va,{modalOpen:t,title:"Format Errors",onClose:a,children:Object(n.jsxs)(x.a,{container:!0,children:[Object(n.jsxs)(x.a,{item:!0,xs:12,className:i.formScrollable,children:["There were some issues trying to format the selected CSI Drives, please fix the issues and try again.",Object(n.jsx)("br",{}),Object(n.jsx)(ha,{columns:[{label:"Node",elementKey:"node"},{label:"Drive",elementKey:"drive"},{label:"Message",elementKey:"error"}],entityName:"Format Errors",idField:"drive",records:c,isLoading:!1,customPaperHeight:i.errorsList,textSelectable:!0,noBackground:!0})]}),Object(n.jsxs)(x.a,{item:!0,xs:12,className:i.buttonContainer,children:[Object(n.jsx)(g.a,{onClick:function(){!function(e,t){var a=document.createElement("a");a.setAttribute("href","data:application/json;charset=utf-8,"+encodeURIComponent(t)),console.log(e),a.setAttribute("download",e),a.style.display="none",document.body.appendChild(a),a.click(),document.body.removeChild(a)}("csiFormatErrors.json",JSON.stringify(Object(Xe.a)(c)))},color:"primary",children:"Download"}),Object(n.jsx)(g.a,{onClick:a,color:"secondary",autoFocus:!0,children:"Done"})]})]})})})),Au={setErrorSnackMessage:V,selectDrive:function(e){return{type:Nu,driveName:e}}},_u=Object(s.b)(null,Au),Iu=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({headerLabel:{fontSize:22,fontWeight:600,color:"#000",marginTop:4},tableWrapper:{height:"calc(100vh - 275px)"},notAvailableNotice:{border:"#EAEDEE 1px solid",backgroundColor:"#FFF",display:"flex",padding:"19px 38px",overflow:"auto",position:"relative",boxShadow:"none",minHeight:200,overflowY:"scroll",borderRadius:3,flexDirection:"column",alignItems:"center",justifyContent:"center",height:"calc(100vh - 275px)",fontSize:18,fontWeight:600,textAlign:"center"},linkItem:{display:"default",color:"#072F51",textDecoration:"none","&:hover":{textDecoration:"underline",color:"#000"}}},Fe),De),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))(_u((function(e){var t=e.classes,a=(e.selectDrive,e.setErrorSnackMessage),i=Object(c.useState)([]),r=Object(b.a)(i,2),o=r[0],s=r[1],l=Object(c.useState)(""),d=Object(b.a)(l,2),u=d[0],m=d[1],h=Object(c.useState)([]),p=Object(b.a)(h,2),O=p[0],v=p[1],y=Object(c.useState)(!0),S=Object(b.a)(y,2),C=S[0],k=S[1],N=Object(c.useState)(!1),w=Object(b.a)(N,2),T=w[0],E=w[1],A=Object(c.useState)(!1),_=Object(b.a)(A,2),I=_[0],M=_[1],F=Object(c.useState)([]),D=Object(b.a)(F,2),L=D[0],B=D[1],R=Object(c.useState)(!1),P=Object(b.a)(R,2),z=P[0],K=P[1],U=Object(c.useState)([]),W=Object(b.a)(U,2),V=W[0],G=W[1],q=Object(c.useState)(!0),H=Object(b.a)(q,2),Y=H[0],Q=H[1];Object(c.useEffect)((function(){C&&!Y&&Oe.invoke("GET","/api/v1/direct-csi/drives").then((function(e){var t=Z()(e,"drives",[]);t||(t=[]),(t=t.map((function(e){var t=Object(j.a)({},e);return t.joinName="".concat(t.node,":").concat(t.drive),t}))).sort((function(e,t){return e.drive>t.drive?1:e.drive<t.drive?-1:0})),s(t),k(!1),Q(!1)})).catch((function(e){k(!1),Q(!0)}))}),[C,a,Y]);var J=[{type:"format",onClick:function(e){G([e]),M(!1),E(!0)},sendOnlyId:!0}],$=o.filter((function(e){return e.drive.includes(u)}));return Object(n.jsxs)(c.Fragment,{children:[T&&Object(n.jsx)(Tu,{closeFormatModalAndRefresh:function(e,t){E(!1),e&&(t&&t.length>0&&(B(t),K(!0)),k(!0),v([]))},deleteOpen:T,allDrives:I,drivesToFormat:V}),z&&Object(n.jsx)(Eu,{errorsList:L,open:z,onCloseFormatErrorsList:function(){K(!1)}}),Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.actionsTray,children:[Object(n.jsx)(f.a,{placeholder:"Search Drives",className:t.searchField,id:"search-resource",label:"",InputProps:{disableUnderline:!0,startAdornment:Object(n.jsx)(et.a,{position:"start",children:Object(n.jsx)(at.a,{})})},onChange:function(e){m(e.target.value)},disabled:Y}),Object(n.jsx)(Bt.a,{color:"primary","aria-label":"Refresh Tenant List",component:"span",onClick:function(){k(!0)},disabled:Y,children:Object(n.jsx)(qn.a,{})}),Object(n.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(n.jsx)(ur.a,{}),disabled:O.length<=0||Y,onClick:function(){O.length>0&&(G(O),M(!1),E(!0))},children:"Format Selected Drives"}),Object(n.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(n.jsx)(lt,{}),onClick:function(){var e=o.map((function(e){return"".concat(e.node,":").concat(e.drive)}));M(!0),G(e),E(!0)},disabled:Y,children:"Format All Drives"})]}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Object(n.jsx)("br",{})}),Object(n.jsx)(x.a,{item:!0,xs:12,children:Y?Object(n.jsxs)("div",{className:t.notAvailableNotice,children:["To manage locally attached drives you need to install direct-csi, for more information",Object(n.jsx)("br",{}),"please follow this",Object(n.jsx)("a",{href:"https://github.com/minio/direct-csi",rel:"noreferrer",target:"_blank",className:t.linkItem,children:"Link"})]}):Object(n.jsx)(ha,{itemActions:J,columns:[{label:"Drive",elementKey:"drive"},{label:"Capacity",elementKey:"capacity",renderFunction:ce},{label:"Allocated",elementKey:"allocated",renderFunction:ce},{label:"Volumes",elementKey:"volumes"},{label:"Node",elementKey:"node"},{label:"Status",elementKey:"status"}],onSelect:function(e){var t=e.target,a=t.value,n=t.checked,c=Object(Xe.a)(O);return n?c.push(a):c=c.filter((function(e){return e!==a})),v(c),c},selectedItems:O,isLoading:C,records:$,customPaperHeight:t.tableWrapper,entityName:"Drives",idField:"joinName"})})]})}))),Mu=["/storage/volumes","/storage/drives"],Fu=Object(w.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({headerLabel:{fontSize:22,fontWeight:600,color:"#000",marginTop:4},tabsContainer:{marginBottom:15}},Fe),De),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))((function(e){var t=e.classes,a=e.match,i=Object(c.useState)(0),r=Object(b.a)(i,2),o=r[0],s=r[1];Object(c.useEffect)((function(){var e=Mu.findIndex((function(e){return e===a.path}));s(e)}),[a]);return Object(n.jsxs)(c.Fragment,{children:[Object(n.jsx)(qa,{label:"Storage"}),Object(n.jsx)(x.a,{container:!0,children:Object(n.jsxs)(x.a,{item:!0,xs:12,className:t.container,children:[Object(n.jsx)(x.a,{item:!0,xs:12,className:t.tabsContainer,children:Object(n.jsxs)(nn.a,{value:o,onChange:function(e,t){u.push(Mu[t])},indicatorColor:"primary",textColor:"primary","aria-label":"cluster-tabs",children:[Object(n.jsx)(cn.a,{label:"Volumes"}),Object(n.jsx)(cn.a,{label:"Drives"})]})}),Object(n.jsx)(l.c,{history:u,children:Object(n.jsxs)(l.d,{children:[Object(n.jsx)(l.b,{path:Mu[0],component:ku}),Object(n.jsx)(l.b,{path:Mu[1],component:Iu}),Object(n.jsx)(l.b,{render:function(){return Object(n.jsx)(l.a,{to:"/storage/volumes"})}})]})})]})})]})})),Du=Object(s.b)((function(e){return{open:e.system.sidebarOpen,needsRestart:e.system.serverNeedsRestart,isServerLoading:e.system.serverIsLoading,session:e.console.session,loadingProgress:e.system.loadingProgress,snackBarMessage:e.system.snackBar}}),{setMenuOpen:z,serverNeedsRestart:K,serverIsLoading:function(e){return{type:I,isLoading:e}},setSnackBarMessage:W}),Lu=Object(w.a)((function(e){return Object(k.a)(Object(j.a)({root:{display:"flex","& .MuiPaper-root.MuiSnackbarContent-root":{borderRadius:"0px 0px 5px 5px",boxShadow:"none"}},toolbar:{background:e.palette.background.default,color:"black",paddingRight:24},toolbarIcon:Object(j.a)({display:"flex",alignItems:"center",justifyContent:"flex-end",padding:"0 8px"},e.mixins.toolbar),appBar:{zIndex:e.zIndex.drawer+1,transition:e.transitions.create(["width","margin"],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen})},appBarShift:{marginLeft:245,width:"calc(100% - ".concat(245,"px)"),transition:e.transitions.create(["width","margin"],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen})},menuButton:{marginRight:36},menuButtonHidden:{display:"none"},title:{flexGrow:1},drawerPaper:{position:"relative",whiteSpace:"nowrap",width:245,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:"hidden",background:"transparent linear-gradient(90deg, #073052 0%, #081C42 100%) 0% 0% no-repeat padding-box",boxShadow:"0px 3px 7px #00000014"},drawerPaperClose:Object(ve.a)({overflowX:"hidden",transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),width:e.spacing(7)},e.breakpoints.up("sm"),{width:e.spacing(9)}),content:{flexGrow:1,height:"100vh",overflow:"auto",position:"relative"},container:{paddingBottom:e.spacing(4),margin:0,width:"100%",maxWidth:"initial"},paper:{padding:e.spacing(2),display:"flex",overflow:"auto",flexDirection:"column"},fixedHeight:{minHeight:240},warningBar:{background:e.palette.primary.main,color:"white",heigh:"60px",widht:"100%",lineHeight:"60px",textAlign:"center"},progress:{height:"3px",backgroundColor:"#eaeaea"}},Ve))}))(Du((function(e){var t=e.classes,a=e.open,i=e.needsRestart,r=e.isServerLoading,o=e.serverNeedsRestart,s=e.serverIsLoading,d=e.session,m=e.loadingProgress,h=e.snackBarMessage,p=e.setSnackBarMessage,O=Object(c.useState)(!1),f=Object(b.a)(O,2),x=f[0],v=f[1],S=d.pages.reduce((function(e,t,a){return e[t]=!0,e}),{}),C=[{component:Ci,path:"/dashboard"},{component:jc,path:"/buckets"},{component:jc,path:"/buckets/:bucketName"},{component:jc,path:"/buckets/:bucketName/summary"},{component:jc,path:"/buckets/:bucketName/events"},{component:jc,path:"/buckets/:bucketName/replication"},{component:jc,path:"/buckets/:bucketName/lifecycle"},{component:jc,path:"/buckets/:bucketName/access"},{component:jc,path:"/buckets/:bucketName/access"},{component:jc,path:"/buckets/:bucketName/access/policies"},{component:jc,path:"/buckets/:bucketName/access/users"},{component:Hl,path:"/object-browser"},{component:Md,path:"/object-browser/:bucket"},{component:Md,path:"/object-browser/:bucket/*"},{component:pu,path:"/watch"},{component:Qr,path:"/users/:userName"},{component:Qr,path:"/users"},{component:oo,path:"/groups"},{component:Tc,path:"/policies/:policyName"},{component:Tc,path:"/policies"},{component:bu,path:"/heal"},{component:Xd,path:"/trace"},{component:lu,path:"/logs"},{component:yu,path:"/health-info"},{component:us,path:"/settings"},{component:lr,path:"/account",props:{changePassword:d.pages.includes("/account/change-password")}},{component:hs,path:"/webhook/logger"},{component:hs,path:"/webhook/audit"},{component:jl,path:"/tenants"},{component:Fu,path:"/storage"},{component:Fu,path:"/storage/volumes"},{component:Fu,path:"/storage/drives"},{component:Tl,path:"/namespaces/:tenantNamespace/tenants/:tenantName"},{component:qd,path:"/license"}].filter((function(e){return S[e.path]}));return Object(c.useEffect)((function(){""!==h.message?v(!0):v(!1)}),[h]),Object(n.jsx)(c.Fragment,{children:"ok"===d.status?Object(n.jsxs)("div",{className:t.root,children:[Object(n.jsx)(Se.a,{}),Object(n.jsx)(Ce.a,{variant:"permanent",classes:{paper:Object(ye.a)(t.drawerPaper,!a&&t.drawerPaperClose)},open:a,children:Object(n.jsx)(Hi,{pages:d.pages})}),Object(n.jsxs)("main",{className:t.content,children:[i&&Object(n.jsx)("div",{className:t.warningBar,children:r?Object(n.jsxs)(c.Fragment,{children:["The server is restarting.",Object(n.jsx)(y.a,{className:t.progress})]}):Object(n.jsxs)(c.Fragment,{children:["The instance needs to be restarted for configuration changes to take effect."," ",Object(n.jsx)(g.a,{color:"secondary",size:"small",onClick:function(){s(!0),Oe.invoke("POST","/api/v1/service/restart",{}).then((function(e){console.log("success restarting service"),console.log(e),s(!1),o(!1)})).catch((function(e){s(!1),console.log("failure restarting service"),console.log(e)}))},children:"Restart"})]})}),m<100&&Object(n.jsx)(y.a,{className:t.progress,variant:"determinate",value:m}),Object(n.jsx)("div",{className:t.snackDiv,children:Object(n.jsx)(Ne.a,{open:x,onClose:function(){v(!1),p("")},autoHideDuration:"error"===h.type?1e4:5e3,message:h.message,className:t.snackBarExternal,ContentProps:{className:"".concat(t.snackBar," ").concat("error"===h.type?t.errorSnackBar:"")}})}),Object(n.jsx)(ke.a,{className:t.container,children:Object(n.jsx)(l.c,{history:u,children:Object(n.jsxs)(l.d,{children:[C.map((function(e){return Object(n.jsx)(l.b,{exact:!0,path:e.path,children:function(t){return Object(n.jsx)(e.component,Object(j.a)(Object(j.a)({},t),e.props))}},e.path)})),C.length>0?Object(n.jsx)(l.a,{to:C[0].path}):null]})})})]})]}):null})}))),Bu=function(e){var t=e.location,a=Object(c.useState)(""),i=Object(b.a)(a,2),r=i[0],o=i[1],s=Object(c.useState)(""),l=Object(b.a)(s,2),d=l[0],u=l[1];return Object(c.useEffect)((function(){var e=(t.search.match(/code=([^&]+)/)||[])[1],a=(t.search.match(/state=([^&]+)/)||[])[1],n=(t.search.match(/error=([^&]+)/)||[])[1],c=(t.search.match(/error_description=([^&]+)/)||[])[1];void 0!==n||void 0!==c?(o(n),u(c)):Oe.invoke("POST","/api/v1/login/oauth2/auth",{code:e,state:a}).then((function(e){e&&e.sessionId&&($.a.setItem("token",e.sessionId),window.location.href="/")})).catch((function(e){window.location.href="/login"}))}),[t.search]),""!==r||""!==d?Object(n.jsxs)("div",{children:[Object(n.jsx)("h2",{children:"IDP Error:"}),Object(n.jsx)("p",{children:r}),Object(n.jsx)("p",{children:d})]}):null},Ru=a(443),Pu="SESSION_RESPONSE";var zu=Object(s.b)((function(e){return{loggedIn:e.system.loggedIn}}),{userLoggedIn:P,consoleOperatorMode:function(e){return{type:E,operatorMode:e}},saveSessionResponse:function(e){return{type:Pu,message:e}}})((function(e){var t=e.Component,a=e.loggedIn,i=e.userLoggedIn,r=e.consoleOperatorMode,o=e.saveSessionResponse,s=Object(c.useState)(!0),d=Object(b.a)(s,2),u=d[0],j=d[1];return Object(c.useEffect)((function(){Oe.invoke("GET","/api/v1/session").then((function(e){o(e),i(!0),j(!1),e.operator&&(r(!0),document.title="MinIO Operator")})).catch((function(){return j(!1)}))}),[o,r,i]),u?null:a?Object(n.jsx)(t,{}):Object(n.jsx)(l.a,{to:{pathname:"/login"}})})),Ku=Object(Ru.hot)((function(){return Object(n.jsx)(l.c,{history:u,children:Object(n.jsxs)(l.d,{children:[Object(n.jsx)(l.b,{exact:!0,path:"/oauth_callback",component:Bu}),Object(n.jsx)(l.b,{exact:!0,path:"/login",component:xe}),Object(n.jsx)(zu,{Component:Lu})]})})})),Uu=a(138),Wu=a(444),Vu={loggedIn:!1,operatorMode:!1,session:"",userName:"",sidebarOpen:!0,serverNeedsRestart:!1,serverIsLoading:!1,loadingProgress:100,snackBar:{message:"",type:"message"},modalSnackBar:{message:"",type:"message"},serverDiagnosticStatus:""};var Gu={messages:[]};var qu={messages:[]};var Hu={message:{}};var Yu={messages:[]};var Qu={session:{operator:!1,status:"",pages:[],features:[]}};var Zu={open:!1,addBucketName:"",addBucketVersioningEnabled:!1,addBucketLockingEnabled:!1,addBucketQuotaEnabled:!1,addBucketQuotaType:"hard",addBucketQuotaSize:"1",addBucketQuotaUnit:"TiB",addBucketRetentionEnabled:!1,addBucketRetentionMode:"compliance",addBucketRetentionUnit:"days",addBucketRetentionValidity:1,bucketDetails:{selectedTab:"summary"}};var Ju=[{route:"/object-browser",label:"All Buckets",type:"path"}],$u={routesList:Ju,downloadingFiles:[]};var Xu=a(445),eb=a.n(Xu),tb={createTenant:{page:0,validPages:[],advancedModeOn:!1,storageClasses:[],limitSize:{},fields:{nameTenant:{tenantName:"",namespace:"",selectedStorageClass:""},configure:{customImage:!1,imageName:"",consoleImage:"",customDockerhub:!1,imageRegistry:"",imageRegistryUsername:"",imageRegistryPassword:"",exposeMinIO:!0,exposeConsole:!0,logSearchCustom:!1,prometheusCustom:!1,logSearchVolumeSize:"5",logSearchSizeFactor:"Gi",logSearchImage:"",kesImage:"",logSearchPostgresImage:"",prometheusVolumeSize:"5",prometheusSizeFactor:"Gi",logSearchSelectedStorageClass:"",prometheusSelectedStorageClass:"",prometheusImage:""},identityProvider:{idpSelection:"Built-in",accessKeys:[Us(16)],secretKeys:[Us(32)],openIDURL:"",openIDClientID:"",openIDSecretID:"",ADURL:"",ADSkipTLS:!1,ADServerInsecure:!1,ADUserNameFilter:"",ADGroupBaseDN:"",ADGroupSearchFilter:"",ADNameAttribute:""},security:{enableAutoCert:!0,enableCustomCerts:!1,enableTLS:!0},encryption:{enableEncryption:!1,encryptionType:"vault",gemaltoEndpoint:"",gemaltoToken:"",gemaltoDomain:"",gemaltoRetry:"0",awsEndpoint:"",awsRegion:"",awsKMSKey:"",awsAccessKey:"",awsSecretKey:"",awsToken:"",vaultEndpoint:"",vaultEngine:"",vaultNamespace:"",vaultPrefix:"",vaultAppRoleEngine:"",vaultId:"",vaultSecret:"",vaultRetry:"0",vaultPing:"0",gcpProjectID:"",gcpEndpoint:"",gcpClientEmail:"",gcpClientID:"",gcpPrivateKeyID:"",gcpPrivateKey:"",enableCustomCertsForKES:!1},tenantSize:{volumeSize:"100",sizeFactor:"Gi",drivesPerServer:"1",nodes:"4",memoryNode:"2",ecParity:"",ecParityChoices:[],cleanECChoices:[],maxAllocableMemo:0,memorySize:{error:"",limit:0,request:0},distribution:{error:"",nodes:0,persistentVolumes:0,disks:0,volumePerDisk:0},ecParityCalc:{error:0,defaultEC:"",erasureCodeSet:0,maxEC:"",rawCapacity:"0",storageFactors:[]},limitSize:{}},affinity:{nodeSelectorLabels:"",podAffinity:"default",withPodAntiAffinity:!0}},certificates:{minioCertificates:[{id:Date.now().toString(),key:"",cert:"",encoded_key:"",encoded_cert:""}],caCertificates:[{id:Date.now().toString(),key:"",cert:"",encoded_key:"",encoded_cert:""}],consoleCertificate:{id:"console_cert_pair",key:"",cert:"",encoded_key:"",encoded_cert:""},serverCertificate:{id:"encryptionServerCertificate",key:"",cert:"",encoded_key:"",encoded_cert:""},clientCertificate:{id:"encryptionClientCertificate",key:"",cert:"",encoded_key:"",encoded_cert:""},vaultCertificate:{id:"encryptionVaultCertificate",key:"",cert:"",encoded_key:"",encoded_cert:""},vaultCA:{id:"encryptionVaultCA",key:"",cert:"",encoded_key:"",encoded_cert:""},gemaltoCA:{id:"encryptionGemaltoCA",key:"",cert:"",encoded_key:"",encoded_cert:""}}}};var ab={selectedDrive:""};var nb=Object(Uu.c)({system:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Vu,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case T:return Object(j.a)(Object(j.a)({},e),{},{loggedIn:t.logged});case E:return Object(j.a)(Object(j.a)({},e),{},{operatorMode:t.operatorMode});case A:return Object(j.a)(Object(j.a)({},e),{},{sidebarOpen:t.open});case _:return Object(j.a)(Object(j.a)({},e),{},{serverNeedsRestart:t.needsRestart});case I:return Object(j.a)(Object(j.a)({},e),{},{serverIsLoading:t.isLoading});case M:return Object(j.a)(Object(j.a)({},e),{},{loadingProgress:t.loadingProgress});case F:return Object(j.a)(Object(j.a)({},e),{},{snackBar:{message:t.message,type:"message"}});case L:return Object(j.a)(Object(j.a)({},e),{},{snackBar:{message:t.message,type:"error"}});case B:return Object(j.a)(Object(j.a)({},e),{},{modalSnackBar:{message:t.message,type:"message"}});case R:return Object(j.a)(Object(j.a)({},e),{},{modalSnackBar:{message:t.message,type:"error"}});case D:return Object(j.a)(Object(j.a)({},e),{},{serverDiagnosticStatus:t.serverDiagnosticStatus});default:return e}},trace:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Gu,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Yd:return Object(j.a)(Object(j.a)({},e),{},{messages:[].concat(Object(Xe.a)(e.messages),[t.message])});case Qd:return Object(j.a)(Object(j.a)({},e),{},{messages:[]});default:return e}},logs:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:qu,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case eu:return Object(j.a)(Object(j.a)({},e),{},{messages:[].concat(Object(Xe.a)(e.messages),[t.message])});case tu:return Object(j.a)(Object(j.a)({},e),{},{messages:[]});default:return e}},watch:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Yu,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ju:return Object(j.a)(Object(j.a)({},e),{},{messages:[].concat(Object(Xe.a)(e.messages),[t.message])});case mu:return Object(j.a)(Object(j.a)({},e),{},{messages:[]});default:return e}},console:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Qu,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Pu:return Object(j.a)(Object(j.a)({},e),{},{session:t.message});default:return e}},buckets:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Zu,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case vt:return Object(j.a)(Object(j.a)({},e),{},{open:t.open});case yt:return Object(j.a)(Object(j.a)({},e),{},{addBucketName:t.name});case St:return Object(j.a)(Object(j.a)({},e),{},{addBucketVersioningEnabled:t.versioned});case Ct:return Object(j.a)(Object(j.a)({},e),{},{addBucketLockingEnabled:t.locking});case kt:return Object(j.a)(Object(j.a)({},e),{},{addBucketQuotaEnabled:t.quota});case Nt:return Object(j.a)(Object(j.a)({},e),{},{addBucketQuotaType:t.quotaType});case wt:return Object(j.a)(Object(j.a)({},e),{},{addBucketQuotaSize:t.quotaSize});case Tt:return Object(j.a)(Object(j.a)({},e),{},{addBucketQuotaUnit:t.quotaUnit});case At:return Object(j.a)(Object(j.a)({},e),{},{addBucketRetentionEnabled:t.retention});case _t:return Object(j.a)(Object(j.a)({},e),{},{addBucketRetentionMode:t.retentionMode});case It:return Object(j.a)(Object(j.a)({},e),{},{addBucketRetentionUnit:t.retentionUnit});case Mt:return Object(j.a)(Object(j.a)({},e),{},{addBucketRetentionValidity:t.retentionValidity});case Ft:return Object(j.a)(Object(j.a)({},e),{},{bucketDetails:Object(j.a)(Object(j.a)({},e.bucketDetails),{},{selectedTab:t.tab})});case Et:return Object(j.a)(Object(j.a)({},e),{},{addBucketName:"",addBucketVersioningEnabled:!1,addBucketLockingEnabled:!1,addBucketQuotaEnabled:!1,addBucketQuotaType:"hard",addBucketQuotaSize:"1",addBucketQuotaUnit:"TiB",addBucketRetentionEnabled:!1,addBucketRetentionMode:"compliance",addBucketRetentionUnit:"days",addBucketRetentionValidity:1});default:return e}},objectBrowser:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$u,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case El:var a=[].concat(Object(Xe.a)(e.routesList),[{route:t.route,label:t.label,type:t.routeType}]);return u.push(t.route),Object(j.a)(Object(j.a)({},e),{},{routesList:a});case Al:return Object(j.a)(Object(j.a)({},e),{},{routesList:[].concat(Ju)});case _l:var n=e.routesList.findIndex((function(e){return e.route===t.toRoute}))+1,c=e.routesList.slice(0,n);return Object(j.a)(Object(j.a)({},e),{},{routesList:c});case Il:var i=t.currentRoute.split("/"),r=[],o=Ju[0].route;i.forEach((function(e){""!==e&&"object-browser"!==e&&(o="".concat(o,"/").concat(e),r.push({route:o,label:e,type:"path"}))}));var s=[].concat(Ju,r);return Object(j.a)(Object(j.a)({},e),{},{routesList:s});case Ml:var l=Object(Xe.a)(e.routesList),d=e.routesList[e.routesList.length-1].route,b=t.newRoute.split("/");return b.forEach((function(e){var t=e.trim();if(""!==t){var a={route:d="".concat(d,"/").concat(t),label:t,type:"path"};l.push(a)}})),u.push(d),Object(j.a)(Object(j.a)({},e),{},{routesList:l});case Fl:var m=e.routesList,h=m.slice(-1)[0];"path"===h.type&&(h.type="file");var p=[].concat(Object(Xe.a)(m.slice(0,-1)),[h]);return Object(j.a)(Object(j.a)({},e),{},{routesList:p});case Dl:var O=Object(Xe.a)(e.downloadingFiles);return O.push(t.path),Object(j.a)(Object(j.a)({},e),{},{downloadingFiles:Object(Xe.a)(O)});case Ll:var g=e.downloadingFiles.filter((function(e){return e!==t.path}));return Object(j.a)(Object(j.a)({},e),{},{downloadingFiles:Object(Xe.a)(g)});default:return e}},healthInfo:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Hu,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ou:return Object(j.a)(Object(j.a)({},e),{},{message:t.message});case gu:return Object(j.a)(Object(j.a)({},e),{},{message:{}});default:return e}},tenants:function(){var e,t,a,n,c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:tb,i=arguments.length>1?arguments[1]:void 0,r=Object(j.a)({},c);switch(i.type){case fs:return r.createTenant.page=i.page,Object(j.a)({},r);case xs:return r.createTenant.advancedModeOn=i.state,Object(j.a)({},r);case vs:if(eb()(r.createTenant.fields,"".concat(i.pageName,".").concat(i.field))){var o=Z()(r.createTenant.fields,"".concat(i.pageName),{}),s={};s[i.field]=i.value;var l=Object(j.a)(Object(j.a)({},o),s);return r.createTenant.fields[i.pageName]=Object(j.a)({},l),Object(j.a)({},r)}return c;case ys:var d=c.createTenant.validPages;if(i.valid)d.includes(i.pageName)||(d.push(i.pageName),r.createTenant.validPages=Object(Xe.a)(d));else{var u=d.filter((function(e){return e!==i.pageName}));r.createTenant.validPages=Object(Xe.a)(u)}return Object(j.a)({},r);case Cs:var b=Object(j.a)(Object(j.a)({},c),{},{createTenant:Object(j.a)(Object(j.a)({},c.createTenant),{},{storageClasses:i.storageClasses})});return Object(j.a)({},b);case ks:var m=[].concat(Object(Xe.a)(c.createTenant.certificates.minioCertificates),[{id:Date.now().toString(),key:"",cert:"",encoded_key:"",encoded_cert:""}]);return r.createTenant.certificates.minioCertificates=Object(Xe.a)(m),Object(j.a)({},r);case Ns:var h=c.createTenant.certificates.minioCertificates,p=h.map((function(e){var t;return e.id===i.id?Object(j.a)(Object(j.a)({},e),{},(t={},Object(ve.a)(t,i.key,i.fileName),Object(ve.a)(t,"encoded_".concat(i.key),i.value),t)):e}));return r.createTenant.certificates.minioCertificates=Object(Xe.a)(p),Object(j.a)({},r);case ws:var O=c.createTenant.certificates.minioCertificates;if(O.length>1){var g=O.filter((function(e){return e.id!==i.id}));return r.createTenant.certificates.minioCertificates=Object(Xe.a)(g),Object(j.a)({},r)}return Object(j.a)({},c);case Ts:var f=[].concat(Object(Xe.a)(c.createTenant.certificates.caCertificates),[{id:Date.now().toString(),key:"",cert:"",encoded_key:"",encoded_cert:""}]);return r.createTenant.certificates.caCertificates=Object(Xe.a)(f),Object(j.a)({},r);case Es:var x=c.createTenant.certificates.caCertificates,v=x.map((function(e){var t;return e.id===i.id?Object(j.a)(Object(j.a)({},e),{},(t={},Object(ve.a)(t,i.key,i.fileName),Object(ve.a)(t,"encoded_".concat(i.key),i.value),t)):e}));return r.createTenant.certificates.caCertificates=Object(Xe.a)(v),Object(j.a)({},r);case As:var y=c.createTenant.certificates.minioCertificates;if(y.length>1){var S=y.filter((function(e){return e.id!==i.id}));return r.createTenant.certificates.caCertificates=Object(Xe.a)(S),Object(j.a)({},r)}return Object(j.a)({},c);case _s:var C=c.createTenant.certificates.consoleCertificate;return r.createTenant.certificates.consoleCertificate=Object(j.a)(Object(j.a)({},C),{},(e={},Object(ve.a)(e,i.key,i.fileName),Object(ve.a)(e,"encoded_".concat(i.key),i.value),e)),Object(j.a)({},r);case Is:var k=c.createTenant.certificates.serverCertificate;return r.createTenant.certificates.serverCertificate=Object(j.a)(Object(j.a)({},k),{},(t={},Object(ve.a)(t,i.key,i.fileName),Object(ve.a)(t,"encoded_".concat(i.key),i.value),t)),Object(j.a)({},r);case Ms:var N=c.createTenant.certificates.clientCertificate;return r.createTenant.certificates.clientCertificate=Object(j.a)(Object(j.a)({},N),{},(a={},Object(ve.a)(a,i.key,i.fileName),Object(ve.a)(a,"encoded_".concat(i.key),i.value),a)),Object(j.a)({},r);case Fs:var w=c.createTenant.certificates.vaultCertificate;return r.createTenant.certificates.vaultCertificate=Object(j.a)(Object(j.a)({},w),{},(n={},Object(ve.a)(n,i.key,i.fileName),Object(ve.a)(n,"encoded_".concat(i.key),i.value),n)),Object(j.a)({},r);case Ds:var T=c.createTenant.certificates.vaultCA;return r.createTenant.certificates.vaultCA=Object(j.a)(Object(j.a)({},T),{},{cert:i.fileName,encoded_cert:i.value}),Object(j.a)({},r);case Ls:var E=c.createTenant.certificates.gemaltoCA;return r.createTenant.certificates.gemaltoCA=Object(j.a)(Object(j.a)({},E),{},{cert:i.fileName,encoded_cert:i.value}),Object(j.a)({},r);case Ss:return Object(j.a)(Object(j.a)({},c),{},{createTenant:{page:0,validPages:[],advancedModeOn:!1,storageClasses:[],limitSize:{},fields:{nameTenant:{tenantName:"",namespace:"",selectedStorageClass:""},configure:{customImage:!1,imageName:"",consoleImage:"",customDockerhub:!1,imageRegistry:"",imageRegistryUsername:"",imageRegistryPassword:"",exposeMinIO:!0,exposeConsole:!0,logSearchCustom:!1,prometheusCustom:!1,logSearchVolumeSize:"5",logSearchSizeFactor:"Gi",logSearchSelectedStorageClass:"",logSearchImage:"",kesImage:"",logSearchPostgresImage:"",prometheusVolumeSize:"5",prometheusSizeFactor:"Gi",prometheusSelectedStorageClass:"",prometheusImage:""},identityProvider:{idpSelection:"Built-in",accessKeys:[Us(16)],secretKeys:[Us(32)],openIDURL:"",openIDClientID:"",openIDSecretID:"",ADURL:"",ADSkipTLS:!1,ADServerInsecure:!1,ADUserNameFilter:"",ADGroupBaseDN:"",ADGroupSearchFilter:"",ADNameAttribute:""},security:{enableAutoCert:!0,enableCustomCerts:!1,enableTLS:!0},encryption:{enableEncryption:!1,encryptionType:"vault",gemaltoEndpoint:"",gemaltoToken:"",gemaltoDomain:"",gemaltoRetry:"0",awsEndpoint:"",awsRegion:"",awsKMSKey:"",awsAccessKey:"",awsSecretKey:"",awsToken:"",vaultEndpoint:"",vaultEngine:"",vaultNamespace:"",vaultPrefix:"",vaultAppRoleEngine:"",vaultId:"",vaultSecret:"",vaultRetry:"0",vaultPing:"0",gcpProjectID:"",gcpEndpoint:"",gcpClientEmail:"",gcpClientID:"",gcpPrivateKeyID:"",gcpPrivateKey:"",enableCustomCertsForKES:!1},tenantSize:{volumeSize:"100",sizeFactor:"Gi",drivesPerServer:"1",nodes:"4",memoryNode:"2",ecParity:"",ecParityChoices:[],cleanECChoices:[],maxAllocableMemo:0,memorySize:{error:"",limit:0,request:0},distribution:{error:"",nodes:0,persistentVolumes:0,disks:0,volumePerDisk:0},ecParityCalc:{error:0,defaultEC:"",erasureCodeSet:0,maxEC:"",rawCapacity:"0",storageFactors:[]},limitSize:{}},affinity:{nodeSelectorLabels:"",podAffinity:"default",withPodAntiAffinity:!0}},certificates:{minioCertificates:[{id:Date.now().toString(),key:"",cert:"",encoded_key:"",encoded_cert:""}],caCertificates:[{id:Date.now().toString(),key:"",cert:"",encoded_key:"",encoded_cert:""}],consoleCertificate:{id:"console_cert_pair",key:"",cert:"",encoded_key:"",encoded_cert:""},serverCertificate:{id:"encryptionServerCertificate",key:"",cert:"",encoded_key:"",encoded_cert:""},clientCertificate:{id:"encryptionClientCertificate",key:"",cert:"",encoded_key:"",encoded_cert:""},vaultCertificate:{id:"encryptionVaultCertificate",key:"",cert:"",encoded_key:"",encoded_cert:""},vaultCA:{id:"encryptionVaultCA",key:"",cert:"",encoded_key:"",encoded_cert:""},gemaltoCA:{id:"encryptionGemaltoCA",key:"",cert:"",encoded_key:"",encoded_cert:""}}}});default:return c}},directCSI:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ab,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Nu:if(""!==t.driveName){var a=Object(j.a)({},e);return a.selectedDrive=t.driveName,a}return e;default:return e}}}),cb=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||Uu.d;Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));var ib=a(995),rb=(a(906),a(907),a(908),a(909),a(446)),ob=Object(rb.a)({palette:{primary:{light:"#073052",main:"#081C42",dark:"#05122B",contrastText:"#fff"},secondary:{light:"#ff7961",main:"#f44336",dark:"#ba000d",contrastText:"#000"},error:{light:"#e03a48",main:"#dc1f2e",contrastText:"#ffffff"},grey:{100:"#f0f0f0",200:"#e6e6e6",300:"#cccccc",400:"#999999",500:"#8c8c8c",600:"#737373",700:"#666666",800:"#4d4d4d",900:"#333333"},background:{default:"#F4F4F4"}},typography:{fontFamily:["Lato","sans-serif"].join(","),h1:{fontWeight:"bold",color:"#081C42"},h2:{fontWeight:"bold",color:"#081C42"},h3:{fontWeight:"bold",color:"#081C42"},h4:{fontWeight:"bold",color:"#081C42"},h5:{fontWeight:"bold",color:"#081C42"},h6:{fontWeight:"bold",color:"#000000"}},overrides:{MuiButton:{root:{borderRadius:3,color:"white",height:40,padding:"0 20px",fontSize:14,fontWeight:600,boxShadow:"none","& .MuiSvgIcon-root":{maxHeight:18},"&.MuiButton-contained.Mui-disabled":{backgroundColor:"#EAEDEE",fontWeight:600,color:"#767676"},"& .MuiButton-iconSizeMedium > *:first-child":{fontSize:12}}}}}),sb=Object(w.a)({"@global":{".MuiButton-contained":{fontSize:"14px",textTransform:"capitalize",padding:"16px 25px 16px 25px",borderRadius:3},".MuiButton-sizeSmall":{padding:"4px 10px",fontSize:"0.8125rem"},".MuiTableCell-head":{borderRadius:"3px 3px 0px 0px",fontSize:13},".MuiPaper-root":{borderRadius:3},".MuiDrawer-paperAnchorDockedLeft":{borderRight:0},".MuiDrawer-root":{"& .MuiPaper-root":{borderRadius:0}}}})((function(){return null}));o.a.render(Object(n.jsxs)(s.a,{store:Object(Uu.e)(nb,cb(Object(Uu.a)(Wu.a))),children:[Object(n.jsx)(sb,{}),Object(n.jsx)(ib.a,{theme:ob,children:Object(n.jsx)(Ku,{})})]}),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()}))}},[[910,1,2]]]);
|
|
//# sourceMappingURL=main.52ab27f8.chunk.js.map
|