import{r as e,t}from"./jsx-runtime-BbTa8W_M-1776590214964.js";import{n,o as r,r as i}from"./app-CXDQ5oEH-1776590214964.js";import{t as a}from"./useTranslation-D1etqd9u-1776590214964.js";import{t as o}from"./arrow-left-BFhIh_le-1776590214964.js";import{t as s}from"./log-out-YATsQfXZ-1776590214964.js";import{n as c,t as l}from"./sun-tkdA80yb-1776590214964.js";import{n as u,t as d}from"./ThemeProvider-BEVm-uvz-1776590214964.js";import{t as f}from"./button-WiAFyHfP-1776590214964.js";import{n as p,t as m}from"./scroll-area-CZQl4Pnh-1776590214964.js";import{t as h}from"./Logo-C07KrU6Z-1776590214964.js";import{t as g}from"./card-Cby8flFO-1776590214964.js";e();var _=t();function v(){let{theme:e,setTheme:t}=u();return(0,_.jsxs)(f,{variant:`ghost`,size:`icon`,onClick:()=>t(e===`light`?`dark`:`light`),className:`rounded-full`,children:[(0,_.jsx)(l,{className:`h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0`}),(0,_.jsx)(c,{className:`absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100`}),(0,_.jsx)(`span`,{className:`sr-only`,children:`Toggle theme`})]})}function y({children:e,title:t=`Settings`,description:c=``,navigation:l=[],backRoute:u=`home`}){let{auth:y}=r().props,{t:b}=a(),x=y?.user;return(0,_.jsxs)(d,{defaultTheme:`system`,storageKey:`app-ui-theme`,children:[(0,_.jsx)(n,{title:b(t)}),(0,_.jsxs)(`div`,{className:`min-h-screen bg-muted/20 text-foreground transition-colors duration-300 pb-12 md:pb-0 font-sans`,children:[(0,_.jsx)(`nav`,{className:`border-b bg-card sticky top-0 z-50 shadow-sm`,children:(0,_.jsx)(`div`,{className:`max-w-7xl mx-auto px-4 sm:px-6 lg:px-8`,children:(0,_.jsxs)(`div`,{className:`flex justify-between h-14 sm:h-16 items-center`,children:[(0,_.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,_.jsx)(f,{variant:`ghost`,size:`icon`,asChild:!0,className:`rounded-full h-8 w-8 shrink-0`,children:(0,_.jsx)(i,{href:route(u),children:(0,_.jsx)(o,{className:`h-5 w-5 rtl:rotate-180`})})}),(0,_.jsx)(i,{href:`/`,className:`flex items-center gap-2 hover:opacity-80 transition-opacity outline-none`,children:(0,_.jsx)(h,{className:`w-[100px] h-[50px] sm:w-[120px] sm:h-[60px]`})})]}),(0,_.jsxs)(`div`,{className:`flex items-center gap-2 sm:gap-4`,children:[(0,_.jsx)(v,{}),x?.role===`admin`&&(0,_.jsx)(f,{variant:`outline`,size:`sm`,asChild:!0,className:`hidden sm:inline-flex`,children:(0,_.jsx)(i,{href:route(`cp.dashboard`),children:b(`Admin Panel`)})}),(0,_.jsx)(f,{variant:`destructive`,size:`sm`,asChild:!0,className:`gap-2 rounded-full sm:rounded-md h-8 w-8 sm:h-9 sm:w-auto p-0 sm:px-3`,children:(0,_.jsxs)(i,{href:route(`logout`),method:`post`,as:`button`,children:[(0,_.jsx)(s,{className:`w-4 h-4 rtl:rotate-180`}),(0,_.jsx)(`span`,{className:`hidden sm:inline`,children:b(`Logout`)})]})})]})]})})}),(0,_.jsxs)(`main`,{className:`max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6 sm:py-8`,children:[(0,_.jsxs)(`div`,{className:`mb-6`,children:[(0,_.jsx)(`h1`,{className:`text-2xl font-bold tracking-tight`,children:b(t)}),c&&(0,_.jsx)(`p`,{className:`text-muted-foreground text-sm mt-1`,children:b(c)})]}),(0,_.jsxs)(`div`,{className:`flex flex-col md:flex-row gap-6 items-start`,children:[l.length>0&&(0,_.jsx)(`div`,{className:`md:hidden w-full -mx-4 px-4`,children:(0,_.jsxs)(m,{className:`w-full whitespace-nowrap`,children:[(0,_.jsx)(`div`,{className:`flex w-max space-x-2 pb-3`,children:l.map(e=>{let t=route().current(e.routeName);return(0,_.jsx)(f,{variant:t?`secondary`:`outline`,size:`sm`,asChild:!0,className:`gap-2 rounded-full border-border/50 ${t?`bg-primary/10 text-primary border-primary/20`:`text-muted-foreground bg-card`}`,children:(0,_.jsxs)(i,{href:route(e.routeName),children:[e.icon&&(0,_.jsx)(e.icon,{className:`w-4 h-4 shrink-0`}),b(e.name)]})},e.routeName)})}),(0,_.jsx)(p,{orientation:`horizontal`,className:`hidden`})]})}),l.length>0&&(0,_.jsx)(g,{className:`hidden md:flex w-64 flex-shrink-0 p-2 bg-card border-none shadow-sm sticky top-24`,children:(0,_.jsx)(`nav`,{className:`flex flex-col gap-1 w-full`,children:l.map(e=>{let t=route().current(e.routeName);return(0,_.jsx)(f,{variant:t?`secondary`:`ghost`,asChild:!0,className:`w-full justify-start gap-3 rounded-xl ${t?`bg-primary/10 text-primary hover:bg-primary/15`:`text-muted-foreground`}`,children:(0,_.jsxs)(i,{href:route(e.routeName),children:[e.icon&&(0,_.jsx)(e.icon,{className:`w-4 h-4 shrink-0 ${t?`text-primary`:``}`}),b(e.name)]})},e.routeName)})})}),(0,_.jsx)(`div`,{className:`flex-1 w-full space-y-6 min-w-0`,children:e})]})]})]})]})}export{y as t};