"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[4619],{94619:function(e,t,a){a.r(t);var l=a(29439),n=a(72791),s=a(56028),i=a(29945),o=a(31776),r=a(82342),c=a(23814),u=a(87995),d=a(81551),p=a(80184);t.default=function(e){var t=e.modalOpen,a=e.onClose,f=e.bucket,h=e.prefilledRoute,x=(0,d.TL)(),b=(0,n.useState)(""),k=(0,l.Z)(b,2),y=k[0],v=k[1],m=(0,n.useState)("readonly"),j=(0,l.Z)(m,2),C=j[0],A=j[1];(0,n.useEffect)((function(){h&&v(h)}),[h]);return(0,p.jsx)(s.Z,{modalOpen:t,title:"Add Anonymous Access Rule",onClose:a,titleIcon:(0,p.jsx)(i.sR0,{}),children:(0,p.jsxs)(i.ltY,{withBorders:!1,containerPadding:!1,children:[(0,p.jsx)(i.Wzg,{value:y,label:"Prefix",id:"prefix",name:"prefix",placeholder:"Enter Prefix",onChange:function(e){v(e.target.value)},tooltip:"Enter '/' to apply the rule to all prefixes and objects at the bucket root. Do not include the wildcard asterisk '*' as part of the prefix *unless* it is an explicit part of the prefix name. The Console automatically appends an asterisk to the appropriate sections of the resulting IAM policy."}),(0,p.jsx)(i.PhF,{id:"access",name:"Access",onChange:function(e){A(e)},label:"Access",value:C,options:[{label:"readonly",value:"readonly"},{label:"writeonly",value:"writeonly"},{label:"readwrite",value:"readwrite"}],disabled:!1}),(0,p.jsxs)(i.rjZ,{item:!0,xs:12,sx:c.ID.modalButtonBar,children:[(0,p.jsx)(i.zxk,{id:"clear",type:"button",variant:"regular",onClick:function(){v(""),A("readonly")},label:"Clear"}),(0,p.jsx)(i.zxk,{id:"add-access-save",type:"submit",variant:"callAction",disabled:""===y.trim(),onClick:function(){o.h.bucket.setAccessRuleWithBucket(f,{prefix:y,access:C}).then((function(e){x((0,u.y1)("Access Rule added successfully")),a()})).catch((function(e){x((0,u.Ih)((0,r.g)(e))),a()}))},label:"Save"})]})]})})}}}]);
//# sourceMappingURL=4619.1535ff32.chunk.js.map