import{j as e}from"./query-PJ0ZdjbV.js";import{f as p,a as l,O as d,k as m}from"./vendor-CWhr2lg4.js";import{b0 as g,a5 as x,M as u,U as h,o as b,as as f,aU as N,a8 as j,a9 as v,aB as y,a7 as k,a as w,bf as S,ap as o}from"./index-BSPIaiZU.js";import{K as R}from"./key-round-C9u8YOHO.js";import{S as C}from"./smartphone-CjO1nI6k.js";import{F as E}from"./file-search-Xio2ch8J.js";import{S as I}from"./shield-7SCLx_iT.js";import"./ui-aO-W1bxx.js";const T=[{heading:"Account",items:[{to:"/settings/notifications",label:"Notifications",description:"Channels & preferences",icon:x,permission:["notifications","notification","read"]},{to:"/settings/change-password",label:"Change Password",description:"Update your account password",icon:R},{to:"/settings/sessions",label:"Active Sessions",description:"Devices & sign-in activity",icon:u,permission:["settings","settings","read"]},{to:"/settings/mfa",label:"Two-Factor Auth",description:"TOTP authenticator setup",icon:C,permission:["settings","settings","read"]}]},{heading:"Access Control",items:[{to:"/settings/users",label:"Users",description:"Invite & manage access",icon:h,permission:["users","user","read"]},{to:"/settings/roles",label:"Roles & Permissions",description:"RBAC & field masking",icon:b,permission:["roles","role","read"]},{to:"/settings/resources",label:"Resources",description:"Enable models for masking & approvals",icon:f,permission:["roles","role","read"]}]},{heading:"Data Management",items:[{to:"/settings/import",label:"Import",description:"Upload CSV, XLSX, JSON",icon:N,permission:["data_io","import","read"]},{to:"/settings/export",label:"Export",description:"Download platform data",icon:j,permission:["data_io","export","read"]}]},{heading:"AI Engine",items:[{to:"/settings/ai-models",label:"Models & Features",description:"AI model registry & flags",icon:v,permission:["ai_engine","model","read"]},{to:"/settings/ai-usage",label:"Usage & Costs",description:"Token tracking & budgets",icon:y,permission:["ai_engine","usage","read"]}]},{heading:"Compliance",items:[{to:"/settings/audit-log",label:"Audit Log",description:"Immutable action history",icon:k,permission:["audit","audit_log","read"]},{to:"/settings/dsar",label:"Data Requests",description:"GDPR subject access requests",icon:E,permission:["compliance","dsar","read"]},{to:"/settings/retention-policies",label:"Data Retention",description:"Retention & archival rules",icon:w,permission:["compliance","retention_policy","read"]},{to:"/settings/consent-records",label:"Consent Records",description:"Employee consent tracking",icon:I,permission:["compliance","consent","read"]}]}];function U({item:i,isActive:t}){const n=i.icon;return e.jsxs(m,{to:i.to,className:o("group relative flex items-center gap-3 rounded-lg px-3 py-2.5 transition-all duration-150",t?"bg-primary-subtle/70":"hover:bg-slate-50"),children:[t&&e.jsx("span",{className:"absolute left-0 top-2.5 bottom-2.5 w-[3px] rounded-r-full bg-primary"}),e.jsx("div",{className:o("flex h-8 w-8 shrink-0 items-center justify-center rounded-lg transition-colors duration-150",t?"bg-primary/10 text-primary":"bg-slate-100 text-slate-400 group-hover:bg-slate-200/70 group-hover:text-slate-500"),children:e.jsx(n,{className:"h-4 w-4"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:o("block text-[13px] truncate leading-tight",t?"font-medium text-primary":"font-medium text-slate-700 group-hover:text-slate-900"),children:i.label}),e.jsx("span",{className:o("block text-[11px] truncate leading-tight mt-0.5",t?"text-primary/60":"text-slate-400"),children:i.description})]})]})}function O(){const i=p(),t=l.useRef(null),{hasPermission:n}=g();l.useEffect(()=>{var s;(s=t.current)==null||s.scrollTo(0,0)},[i.pathname]);const c=l.useMemo(()=>T.map(s=>({...s,items:s.items.filter(a=>!a.permission||n(a.permission[0],a.permission[1],a.permission[2]))})).filter(s=>s.items.length>0),[n]);return e.jsxs("div",{className:"-m-6 flex h-[calc(100%+48px)]",children:[e.jsxs("aside",{className:"w-[260px] shrink-0 border-r border-slate-200/60 bg-white flex flex-col",children:[e.jsxs("div",{className:"shrink-0 px-5 pt-6 pb-4 border-b border-slate-100",children:[e.jsx("h1",{className:"text-[15px] font-semibold text-slate-900 tracking-tight",children:"Settings"}),e.jsx("p",{className:"mt-0.5 text-[11px] text-slate-400",children:"Manage your workspace"})]}),e.jsx("nav",{className:"flex-1 overflow-y-auto px-3 py-3 scrollbar-thin",children:c.map((s,a)=>e.jsxs("div",{className:o(a>0&&"mt-6"),children:[e.jsx("p",{className:"mb-2 px-3 text-[11px] font-semibold uppercase tracking-[0.08em] text-slate-400",children:s.heading}),e.jsx("div",{className:"space-y-0.5",children:s.items.map(r=>e.jsx(U,{item:r,isActive:S(i.pathname,r.to)},r.to))})]},s.heading))})]}),e.jsx("main",{ref:t,className:"flex-1 min-w-0 overflow-y-auto bg-background scrollbar-thin",children:e.jsx("div",{className:"px-8 py-6 w-full",children:e.jsx(d,{})})})]})}export{O as SettingsLayout};
