"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[2661],{82661:function(e,n,t){t.r(n),t.d(n,{default:function(){return E}});var l=t(1413),a=t(93433),i=t(29439),s=t(72791),u=t(29945),o=t(87995),c=t(81551),r=t(31776),d=t(66315),f=t(56028),x=t(61889),p=t(27391),v=t(30829),h=t(20068),j=t(68096),b=t(72455),m=t(35739),Z=t(11135),g=t(25787),C=t(23814),k=t(80184),S=(0,b.Z)((function(e){return(0,Z.Z)((0,l.Z)({},C.gM))}));function F(e){var n=S();return(0,k.jsx)(p.Z,(0,l.Z)({InputProps:{classes:n}},e))}var L=(0,g.Z)((function(e){return(0,Z.Z)((0,l.Z)((0,l.Z)({},C.YI),C.Hr))}))((function(e){var n=e.classes,t=e.id,a=e.name,o=e.onChange,c=e.options,r=e.label,d=e.tooltip,f=void 0===d?"":d,p=e.value,b=e.disabled,Z=void 0!==b&&b,g=(0,s.useState)(c[0]),C=(0,i.Z)(g,2),S=C[0],L=C[1];return(0,k.jsx)(s.Fragment,{children:(0,k.jsxs)(x.ZP,{item:!0,xs:12,className:n.fieldContainer,children:[""!==r&&(0,k.jsxs)(v.Z,{htmlFor:t,className:n.inputLabel,children:[(0,k.jsx)("span",{children:r}),""!==f&&(0,k.jsx)("div",{className:n.tooltipContainer,children:(0,k.jsx)(h.Z,{title:f,placement:"top-start",children:(0,k.jsx)("div",{className:n.tooltip,children:(0,k.jsx)(u.byK,{})})})})]}),(0,k.jsx)(j.Z,{fullWidth:!0,children:(0,k.jsx)(m.Z,{id:t,options:c,getOptionLabel:function(e){return e.label},isOptionEqualToValue:function(e){return e.value===p},disabled:Z,renderInput:function(e){return(0,k.jsx)(F,(0,l.Z)((0,l.Z)({},e),{},{name:a}))},value:S,onChange:function(e,n){n&&(o(n.value),L(n))},autoHighlight:!0})})]})})})),E=function(e){var n=e.open,t=e.selectedBucket,x=e.closeModalAndRefresh,p=(0,c.TL)(),v=(0,s.useState)(!1),h=(0,i.Z)(v,2),j=h[0],b=h[1],m=(0,s.useState)(""),Z=(0,i.Z)(m,2),g=Z[0],S=Z[1],F=(0,s.useState)(""),E=(0,i.Z)(F,2),I=E[0],O=E[1],D=(0,s.useState)(""),R=(0,i.Z)(D,2),w=R[0],P=R[1],T=(0,s.useState)([]),y=(0,i.Z)(T,2),z=y[0],B=y[1],N=(0,s.useState)([]),A=(0,i.Z)(N,2),M=A[0],W=A[1],H=(0,s.useCallback)((function(){b(!0),r.h.admin.arnList().then((function(e){null!==e.data.arns&&W(e.data.arns),b(!1)})).catch((function(e){b(!1),p((0,o.zb)(e))}))}),[p]);(0,s.useEffect)((function(){H()}),[H]);var G=[{label:"PUT - Object Uploaded",value:d.Ln.Put},{label:"GET - Object accessed",value:d.Ln.Get},{label:"DELETE - Object Deleted",value:d.Ln.Delete},{label:"REPLICA - Object Replicated",value:d.Ln.Replica},{label:"ILM - Object Transitioned",value:d.Ln.Ilm}],K=null===M||void 0===M?void 0:M.map((function(e){return{label:e,value:e}}));return(0,k.jsx)(f.Z,{modalOpen:n,onClose:function(){x()},title:"Subscribe To Bucket Events",titleIcon:(0,k.jsx)(u.c3W,{}),children:(0,k.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){e.preventDefault(),j||(b(!0),r.h.buckets.createBucketEvent(t,{configuration:{arn:w,events:z,prefix:g,suffix:I},ignoreExisting:!0}).then((function(){b(!1),x()})).catch((function(e){b(!1),p((0,o.zb)(e))})))},children:(0,k.jsxs)(u.rjZ,{container:!0,children:[(0,k.jsxs)(u.rjZ,{item:!0,xs:12,sx:C.oO.formScrollable,children:[(0,k.jsx)(u.rjZ,{item:!0,xs:12,sx:(0,l.Z)((0,l.Z)({},C.DF.formFieldRow),{},{"& div div .MuiOutlinedInput-root":{padding:0}}),children:(0,k.jsx)(L,{onChange:function(e){P(e)},id:"select-access-policy",name:"select-access-policy",label:"ARN",value:w,options:K||[]})}),(0,k.jsx)(u.rjZ,{item:!0,xs:12,sx:C.DF.formFieldRow,children:(0,k.jsx)(u.Wzg,{id:"prefix-input",name:"prefix-input",label:"Prefix",value:g,onChange:function(e){S(e.target.value)}})}),(0,k.jsx)(u.rjZ,{item:!0,xs:12,sx:C.DF.formFieldRow,children:(0,k.jsx)(u.Wzg,{id:"suffix-input",name:"suffix-input",label:"Suffix",value:I,onChange:function(e){O(e.target.value)}})}),(0,k.jsx)(u.rjZ,{item:!0,xs:12,sx:C.DF.formFieldRow,children:(0,k.jsx)(u.wQF,{columns:[{label:"Event",elementKey:"label"}],idField:"value",records:G,onSelect:function(e){var n=e.target,t=n.value,l=n.checked,i=(0,a.Z)(z);l?i.push(t):i=i.filter((function(e){return e!==t})),B(i)},selectedItems:z,noBackground:!0,customPaperHeight:"260px"})})]}),(0,k.jsxs)(u.rjZ,{item:!0,xs:12,sx:C.ID.modalButtonBar,children:[(0,k.jsx)(u.zxk,{id:"cancel-add-event",type:"button",variant:"regular",disabled:j,onClick:function(){x()},label:"Cancel"}),(0,k.jsx)(u.zxk,{id:"save-event",type:"submit",variant:"callAction",disabled:j||""===w||0===z.length,label:"Save"})]})]})})})}}}]);
//# sourceMappingURL=2661.7ae2f0e2.chunk.js.map