"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[7774],{97774:(e,t,r)=>{r.r(t),r.d(t,{default:()=>p});var s=r(65043),a=r(73216),n=r(22166),l=r(89923),i=r(94141),o=r(77403),d=r(21383),c=r(64159),h=r(70579);const p=(0,n.Ng)((e=>{let{objectBrowser:t}=e;return{simplePath:t.simplePath}}))((e=>{let{modalOpen:t,folderName:r,bucketName:p,onClose:u,simplePath:m,limitedSubPath:f}=e;const x=(0,d.jL)(),w=(0,a.Zp)(),[b,j]=(0,s.useState)(""),[C,g]=(0,s.useState)(!1),[y,P]=(0,s.useState)(p),v=(0,n.d4)((e=>e.objectBrowser.records));(0,s.useEffect)((()=>{if(m){const e=`${p}${p.endsWith("/")||m.startsWith("/")?"":"/"}${m}`;P(e)}}),[m,p]);const $=()=>{let e="/";m&&(e=m.endsWith("/")?m:`${m}/`);if(-1!==v.findIndex((t=>t.name===e+b)))return void x((0,c.Dy)({errorMessage:"Folder cannot have the same name as an existing file",detailedError:""}));const t=b.split("/").filter((e=>""!==e.trim())).join("/");"/"===e.slice(0,1)&&(e=e.slice(1));const r=`/browser/${encodeURIComponent(p)}/${encodeURIComponent(`${e}${t}/`)}`;w(r),u()};(0,s.useEffect)((()=>{let e=!0;0===b.trim().length&&(e=!1),g(e)}),[b]);return(0,h.jsx)(s.Fragment,{children:(0,h.jsx)(i.A,{modalOpen:t,title:"Choose or create a new path",onClose:u,titleIcon:(0,h.jsx)(l.DGR,{}),children:(0,h.jsxs)(l.Hbc,{withBorders:!1,containerPadding:!1,children:[(0,h.jsxs)(l.azJ,{className:"inputItem",sx:{display:"flex",gap:8},children:[(0,h.jsx)("strong",{children:"Current Path:"})," ",(0,h.jsx)("br",{}),(0,h.jsx)(l.azJ,{sx:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",fontSize:14,textAlign:"left"},dir:"rtl",children:y})]}),(0,h.jsx)(l.cl_,{value:b,label:"New Folder Path",id:"folderPath",name:"folderPath",placeholder:"Enter the new Folder Path",onChange:e=>{j(e.target.value)},onKeyPress:e=>{"Enter"===e.code&&""!==b&&$()},required:!0,tooltip:f?"You may only have write access on a limited set of subpaths within this path. Please carefully review your User permissions to understand the paths to which you may write.":""}),(0,h.jsxs)(l.xA9,{item:!0,xs:12,sx:o.Uz.modalButtonBar,children:[(0,h.jsx)(l.$nd,{id:"clear",type:"button",color:"primary",variant:"regular",onClick:()=>{j("")},label:"Clear"}),(0,h.jsx)(l.$nd,{id:"create",type:"submit",variant:"callAction",disabled:!C,onClick:$,label:"Create"})]})]})})})}))}}]);
//# sourceMappingURL=7774.a3ae398a.chunk.js.map