1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6700],{6639:(e,a,r)=>{r.d(a,{default:()=>m});var s=r(95155),t=r(12115),n=r(52619),l=r.n(n),d=r(20063),i=r(36962),o=r(38220);function c(e){return localStorage.getItem(e)||void 0}function m(){let{userRole:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[a,r]=(0,t.useState)(!1),n=(0,d.usePathname)(),m=(0,d.useSearchParams)(),[u,g]=(0,t.useState)(void 0),[x,h]=(0,t.useState)(void 0);(0,t.useEffect)(()=>{g(c("cms_selected_org")),h(c("cms_selected_space"))},[]);let{hasPermission:f,isLoading:p}=(0,i.S)(x,u),y=n.split("/").filter(Boolean),b=y[0]&&y[0].includes("-")?y[0]:"en-US",N=n.includes("/cms/settings")||n.includes("/settings"),v=[{name:"Storagezone",href:N?"?section=storagezone":"/".concat(b,"/cms/settings?section=storagezone"),requiredPermissions:[o.Jj.SPACE_MANAGE_ALL,o.Jj.MANAGE_ALL]},{name:"Profile",href:N?"?section=profile":"/".concat(b,"/cms/settings?section=profile")}].filter(e=>!e.requiredPermissions||0===e.requiredPermissions.length||!p&&f(...e.requiredPermissions)),j=e=>{if(e.includes("?")){let a=e.split("?section=")[1];return!!n.includes("/settings")&&(m.get("section")||"profile")===a}return n===e};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"md:hidden mb-4",children:(0,s.jsxs)("button",{onClick:()=>r(!a),className:"flex items-center px-4 py-2 text-sm font-medium text-white bg-blue-600 rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:[(0,s.jsx)("span",{children:a?"Close Menu":"Menu"}),(0,s.jsx)("svg",{className:"ml-2 h-5 w-5 transform transition-transform duration-200 ".concat(a?"rotate-180":""),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:(0,s.jsx)("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})})]})}),(0,s.jsx)("div",{className:"md:hidden ".concat(a?"block":"hidden"," mb-6 bg-gray-100 dark:bg-gray-800 rounded-lg overflow-hidden"),children:(0,s.jsx)("nav",{className:"px-2 py-3 space-y-1",children:v.map(e=>(0,s.jsxs)(l(),{href:e.href,className:"".concat(j(e.href)?"bg-gray-200 dark:bg-gray-700 text-gray-900 dark:text-white":"text-gray-600 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700"," group flex items-center px-3 py-2 text-sm font-medium rounded-md"),onClick:()=>r(!1),children:[e.icon&&(0,s.jsx)("div",{className:"mr-3",children:e.icon}),e.name]},e.name))})}),(0,s.jsx)("div",{className:"hidden md:block w-64 flex-shrink-0",children:(0,s.jsxs)("nav",{className:"bg-gray-100 dark:bg-gray-800 h-full rounded-lg overflow-hidden",children:[(0,s.jsx)("div",{className:"px-4 py-5 border-b border-gray-200 dark:border-gray-700",children:(0,s.jsx)("h2",{className:"text-lg font-medium text-gray-900 dark:text-white",children:"Settings"})}),(0,s.jsx)("div",{className:"px-2 py-4 space-y-1",children:v.map(e=>(0,s.jsxs)(l(),{href:e.href,className:"".concat(j(e.href)?"bg-gray-200 dark:bg-gray-700 text-gray-900 dark:text-white":"text-gray-600 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700"," group flex items-center px-3 py-2 text-sm font-medium rounded-md"),children:[e.icon&&(0,s.jsx)("div",{className:"mr-3",children:e.icon}),e.name]},e.name))})]})})]})}},20063:(e,a,r)=>{var s=r(47260);r.o(s,"notFound")&&r.d(a,{notFound:function(){return s.notFound}}),r.o(s,"useParams")&&r.d(a,{useParams:function(){return s.useParams}}),r.o(s,"usePathname")&&r.d(a,{usePathname:function(){return s.usePathname}}),r.o(s,"useRouter")&&r.d(a,{useRouter:function(){return s.useRouter}}),r.o(s,"useSearchParams")&&r.d(a,{useSearchParams:function(){return s.useSearchParams}}),r.o(s,"useSelectedLayoutSegments")&&r.d(a,{useSelectedLayoutSegments:function(){return s.useSelectedLayoutSegments}})},36962:(e,a,r)=>{r.d(a,{S:()=>d});var s=r(22454),t=r(12115);function n(e){var a;let r=null==e||null==(a=e.role)?void 0:a.permissions;return Array.isArray(r)?r.map(e=>"string"==typeof e?e:e.permission):[]}function l(e){return e?[...n(e.spaceMembership),...n(e.orgMembership)]:[]}function d(e,a){let{data:r,isLoading:n,error:d,refetch:i}=(0,s.I)({queryKey:["permissions",e,a],queryFn:async()=>{let r=await fetch("/api/cms/user/permissions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({spaceId:e,organizationId:a})});if(!r.ok)throw Error("Failed to fetch permissions");return r.json()},enabled:!!(e||a),staleTime:3e5,gcTime:6e5}),o=(0,t.useMemo)(()=>function(){for(var e=arguments.length,a=Array(e),s=0;s<e;s++)a[s]=arguments[s];if(!r)return!1;let t=l(r);return!!t.includes("manage:all")||a.some(e=>t.includes(e))},[r]);return{hasPermission:o,hasAllPermissions:(0,t.useMemo)(()=>function(){for(var e=arguments.length,a=Array(e),s=0;s<e;s++)a[s]=arguments[s];if(!r)return!1;let t=l(r);return!!t.includes("manage:all")||a.every(e=>t.includes(e))},[r]),allPermissions:(0,t.useMemo)(()=>Array.from(new Set(l(r))),[r]),isLoading:n,error:d,permissions:r,refetch:i}}},38220:(e,a,r)=>{r.d(a,{Jj:()=>s});let s={MANAGE_ALL:"manage:all",MANAGE_ORGANIZATIONS:"manage:organizations",MANAGE_SPACES:"manage:spaces",MANAGE_MEMBERS:"manage:members",MANAGE_ROLES:"manage:roles",SPACE_MANAGE_ALL:"space:manage:all",SPACE_MANAGE_CONTENT:"space:manage:content",SPACE_MANAGE_ASSETS:"space:manage:assets",SPACE_MANAGE_SETTINGS:"space:manage:settings",SPACE_MANAGE_MEMBERS:"space:manage:members",CONTENT_READ:"content:read",CONTENT_CREATE:"content:create",CONTENT_UPDATE:"content:update",CONTENT_DELETE:"content:delete",CONTENT_PUBLISH:"content:publish",ASSET_READ:"asset:read",ASSET_UPLOAD:"asset:upload",ASSET_UPDATE:"asset:update",ASSET_DELETE:"asset:delete",APPS_DATA_READ:"apps:data:read"}},41444:(e,a,r)=>{r.d(a,{v:()=>s});let s={log:function(){for(var e=arguments.length,a=Array(e),r=0;r<e;r++)a[r]=arguments[r]},info:function(){for(var e=arguments.length,a=Array(e),r=0;r<e;r++)a[r]=arguments[r]},debug:function(){for(var e=arguments.length,a=Array(e),r=0;r<e;r++)a[r]=arguments[r]},warn:function(){for(var e=arguments.length,a=Array(e),r=0;r<e;r++)a[r]=arguments[r];console.warn(...a)},error:function(){for(var e=arguments.length,a=Array(e),r=0;r<e;r++)a[r]=arguments[r];console.error(...a)}}},46700:(e,a,r)=>{r.d(a,{default:()=>m});var s=r(95155),t=r(20063),n=r(12115),l=r(36489),d=r(41444);function i(){let{data:e}
1=(0,l.useSession)(),[a,r]=(0,n.useState)(null),[t,i]=(0,n.useState)(!0);return((0,n.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/cms/spaces/current-bucket");if(e.ok){let a=await e.json();r({containerName:a.containerName,hasSpace:!!a.containerName,spaceName:a.spaceName})}else r({containerName:null,hasSpace:!1,spaceName:"No Space"})}catch(e){d.v.error("Error fetching space bucket info:",e),r({containerName:null,hasSpace:!1,spaceName:"Error loading"})}finally{i(!1)}})()},[]),t)?(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsx)("h1",{className:"text-2xl font-bold mb-6",children:"Storage Management"}),(0,s.jsx)("div",{className:"bg-white dark:bg-gray-800 shadow rounded-lg p-6",children:(0,s.jsxs)("div",{className:"animate-pulse",children:[(0,s.jsx)("div",{className:"h-4 bg-gray-200 dark:bg-gray-700 rounded w-3/4 mb-4"}),(0,s.jsx)("div",{className:"h-4 bg-gray-200 dark:bg-gray-700 rounded w-1/2"})]})})]}):(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsx)("h1",{className:"text-2xl font-bold mb-6",children:"Storage Management"}),(0,s.jsxs)("div",{className:"bg-white dark:bg-gray-800 shadow rounded-lg p-6",children:[(0,s.jsx)("h2",{className:"text-xl font-semibold mb-4",children:"Space-Based Storage"}),(0,s.jsx)("div",{className:"space-y-4",children:(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,s.jsxs)("div",{className:"p-4 border border-gray-200 dark:border-gray-700 rounded-lg",children:[(0,s.jsx)("h4",{className:"font-medium text-gray-900 dark:text-gray-100 mb-2",children:"Current Space"}),(0,s.jsx)("p",{className:"text-gray-600 dark:text-gray-400",children:(null==a?void 0:a.spaceName)||"Loading..."})]}),(0,s.jsxs)("div",{className:"p-4 border border-gray-200 dark:border-gray-700 rounded-lg",children:[(0,s.jsx)("h4",{className:"font-medium text-gray-900 dark:text-gray-100 mb-2",children:"Bucket Name"}),(0,s.jsx)("p",{className:"text-sm text-gray-600 dark:text-gray-400 font-mono bg-gray-50 dark:bg-gray-700 px-2 py-1 rounded",children:(null==a?void 0:a.containerName)||"Loading..."})]}),(0,s.jsxs)("div",{className:"p-4 border border-gray-200 dark:border-gray-700 rounded-lg",children:[(0,s.jsx)("h4",{className:"font-medium text-gray-900 dark:text-gray-100 mb-2",children:"Status"}),(0,s.jsxs)("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",children:[(0,s.jsx)("svg",{className:"w-4 h-4 mr-1",fill:"currentColor",viewBox:"0 0 20 20",children:(0,s.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}),"Active"]})]})]})})]})]})}function o(){let{data:e,status:a}=(0,l.useSession)(),r=null==e?void 0:e.user;return(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)("h1",{className:"text-2xl font-bold mb-2",children:"Profile Settings"}),(0,s.jsx)("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Manage your profile information and settings"})]}),(0,s.jsxs)("div",{className:"bg-white dark:bg-gray-800 shadow rounded-lg p-6",children:[(0,s.jsx)("h2",{className:"text-xl font-semibold mb-4",children:"User Information"}),(0,s.jsx)("p",{className:"text-gray-600 dark:text-gray-300 mb-6",children:"View and manage your profile information."}),"loading"===a?(0,s.jsx)("div",{className:"flex justify-center items-center h-32",children:(0,s.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-gray-900 dark:border-white"})}):"unauthenticated"===a?(0,s.jsx)("div",{className:"bg-yellow-100 dark:bg-yellow-800 text-yellow-800 dark:text-yellow-100 p-4 rounded-md",children:(0,s.jsx)("p",{children:"You are not signed in. Please sign in to view your profile."})}):(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Name"}),(0,s.jsx)("div",{className:"bg-gray-100 dark:bg-gray-700 p-3 rounded-md",children:(null==r?void 0:r.name)||"Not provided"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Email"}),(0,s.jsx)("div",{className:"bg-gray-100 dark:bg-gray-700 p-3 rounded-md",children:(null==r?void 0:r.email)||"Not provided"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Role"}),(0,s.jsx)("div",{className:"bg-gray-100 dark:bg-gray-700 p-3 rounded-md",children:(null==e?void 0:e.role)||"Not assigned"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Account reference"}),(0,s.jsx)("div",{className:"bg-gray-100 dark:bg-gray-700 p-3 rounded-md font-mono text-sm",title:"Reference this id when contacting support",children:(()=>{var e;let a=(e=r)?e.sub?e.sub:e.id?e.id:e.userId?e.userId:e.email?e.email:"":"";return a?a.length<=12?a:"".concat(a.slice(0,4),"â¦").concat(a.slice(-4)):"Not available"})()})]}),(0,s.jsx)("div",{className:"pt-4",children:(0,s.jsx)("div",{className:"bg-blue-50 dark:bg-blue-900 p-4 rounded-md text-blue-800 dark:text-blue-100",children:(0,s.jsx)("p",{className:"text-sm",children:"Note: To update your profile information, please contact your administrator."})})})]})]})]})}var c=r(6639);function m(e){let{userRole:a=""}=e,r=(0,t.useSearchParams)(),l=(0,t.usePathname)();(0,t.useRouter)();
1let[d,m]=(0,n.useState)(!1),u=l.split("/").filter(Boolean);u[0]&&u[0].includes("-")&&u[0];let g=r.get("section"),x=g&&["storagezone","profile"].includes(g)?g:"profile";return(l.includes("/settings"),(0,n.useEffect)(()=>{m(!0)},[]),d)?(0,s.jsx)("div",{className:"w-full px-6 lg:px-8 pt-8 pb-4 md:pt-12 md:pb-8",children:(0,s.jsxs)("div",{className:"flex flex-col md:flex-row gap-6",children:[(0,s.jsx)(c.default,{}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:["storagezone"===x&&(0,s.jsx)(i,{}),"profile"===x&&(0,s.jsx)(o,{})]})]})}):null}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.