1import{j as e}from"./ui-vendor-DugvyhkM.js";import{e as P,u as z,r,O as E}from"./react-vendor-CnbS1iJ1.js";import{u as L,g as F,h as u,i as f,e as a,j as b,k as W,l as U,B as j,d as R}from"./index-Bg0TxxV_.js";import{D as H,a as q,b as G,c as J,d as S,e as A}from"./dropdown-menu-CJTjBFRP.js";import{A as B,a as I,b as O}from"./avatar-BhOpUk1W.js";import{S as K,a as Q}from"./sheet-BVVh0a3j.js";import{S as V}from"./scroll-area-CYvSnwu3.js";import{S as M}from"./separator-BR_2C1oT.js";import{B as X}from"./badge-CzHqQw3k.js";import{B as Y}from"./brand-logo-DoIKfNx-.js";import{P as Z}from"./pin-BovWKMHC.js";import{P as $}from"./pin-off-C8L4acxB.js";import{L as ee}from"./layout-dashboard-DMDvEMLa.js";import{B as se}from"./building-2-DwC9Ar9P.js";import{S as ae}from"./smartphone-C3IDloT3.js";import{C as re}from"./credit-card-C7wqqMsd.js";import{W as te}from"./webhook-DphB-iDT.js";import{F as ie}from"./file-text-BY-TZAlQ.js";import{S as ne}from"./settings-isKArzsI.js";import{M as le}from"./menu-BJLCfarx.js";import{S as oe,M as de}from"./sun-DndslO0a.js";import{B as ce}from"./bell-B6njzjP8.js";import{C as me}from"./chevron-down-B8zXvv0T.js";import"./supabase-vendor-DOL-USaH.js";import"./charts-vendor-BthknRg3.js";import"./query-vendor-VfPrV_BW.js";import"./chevron-right-BPOfCJ9Z.js";import"./check-CLse9FI2.js";const xe=[{label:"Dashboard",icon:ee,href:"/admin"},{label:"Workspaces",icon:se,href:"/admin/tenants"},{label:"Instâncias",icon:ae,href:"/admin/instances"}],pe=[{label:"Planos",icon:re,href:"/admin/plans"},{label:"Webhooks",icon:te,href:"/admin/webhooks"}],he=[{label:"Atividades",icon:ie,href:"/admin/activity-logs"}];function D({pinned:o,onPinnedChange:d}){const l=P(),x=z(),{profile:i,user:g}=L(),[p,h]=r.useState(!1),[N,c]=r.useState(!1),n=o??p,v=d??h,s=!n&&!N,w=r.useCallback(()=>c(!0),[]),T=r.useCallback(()=>c(!1),[]),C=t=>x.pathname===t,_=({item:t})=>{const y=C(t.href),m=e.jsxs("button",{onClick:()=>l(t.href),className:a(s?"sidebar-item-collapsed":"sidebar-item w-full",y&&(s?"sidebar-item-collapsed-active":"sidebar-item-active")),children:[e.jsx(t.icon,{className:"h-5 w-5 flex-shrink-0"}),!s&&e.jsx("span",{className:"truncate",children:t.label})]});return s?e.jsxs(u,{delayDuration:0,children:[e.jsx(f,{asChild:!0,children:m}),e.jsx(b,{side:"right",className:"font-medium",children:t.label})]}):m},k=({title:t,items:y})=>e.jsxs("div",{className:a(s?"flex flex-col items-center gap-1":"space-y-0.5"),children:[!s&&e.jsx("p",{className:"px-3 mb-2 text-[10px] font-semibold uppercase tracking-wider text-sidebar-foreground/40",children:t}),y.map(m=>e.jsx(_,{item:m},m.href))]});return e.jsx(F,{children:e.jsxs("div",{onMouseEnter:w,onMouseLeave:T,className:a("flex h-full flex-col bg-sidebar border-r border-sidebar-border transition-all duration-300 ease-in-out",s?"w-[68px]":"w-[260px]"),children:[e.jsxs("div",{className:a("flex h-16 items-center border-b border-sidebar-border overflow-hidden",s?"justify-center px-2":"justify-between px-4"),children:[e.jsxs("div",{className:"flex items-center gap-3 overflow-hidden",children:[e.jsx(Y,{size:s?"sm":"md",variant:"dark",iconOnly:s}),!s&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-lg font-bold text-sidebar-foreground",children:"Admin"}),e.jsx(X,{variant:"secondary",className:"text-[10px] h-5 px-1.5",children:"SUPER"})]})]}),!s&&e.jsxs(u,{delayDuration:0,children:[e.jsx(f,{asChild:!0,children:e.jsx("button",{onClick:()=>v(!n),className:a("h-7 w-7 flex items-center justify-center rounded-lg transition-colors",n?"text-primary hover:bg-sidebar-accent/50":"text-sidebar-foreground/40 hover:text-sidebar-foreground hover:bg-sidebar-accent/50"),children:n?e.jsx(Z,{className:"h-4 w-4"}):e.jsx($,{className:"h-4 w-4"})})}),e.jsx(b,{side:"right",children:n?"Desafixar menu":"Fixar menu aberto"})]})]}),e.jsx(V,{className:"flex-1",children:e.jsxs("div",{className:a(s?"px-2 py-4":"px-3 py-4",s?"flex flex-col items-center gap-1":"space-y-6"),children:[e.jsx(k,{title:"Principal",items:xe}),s&&e.jsx(M,{className:"my-1.5 w-6 bg-sidebar-border/50"}),e.jsx(k,{title:"Plataforma",items:pe}),s&&e.jsx(M,{className:"my-1.5 w-6 bg-sidebar-border/50"}),e.jsx(k,{title:"Sistema",items:he})]})}),e.jsxs("div",{className:"border-t border-sidebar-border p-2 space-y-1",children:[e.jsxs(u,{delayDuration:0,
1children:[e.jsx(f,{asChild:!0,children:e.jsxs("button",{onClick:()=>l("/admin/settings"),className:a(s?"sidebar-item-collapsed":"sidebar-item w-full",C("/admin/settings")&&(s?"sidebar-item-collapsed-active":"sidebar-item-active")),children:[e.jsx(ne,{className:"h-5 w-5"}),!s&&e.jsx("span",{children:"Configurações"})]})}),s&&e.jsx(b,{side:"right",className:"font-medium",children:"Configurações"})]}),e.jsxs(u,{delayDuration:0,children:[e.jsx(f,{asChild:!0,children:e.jsxs("div",{className:a("flex items-center gap-3 rounded-xl p-2 cursor-default",s&&"justify-center"),children:[e.jsxs(B,{className:"h-8 w-8 ring-2 ring-primary/20 flex-shrink-0",children:[e.jsx(I,{src:i?.avatar_url||void 0}),e.jsx(O,{className:"bg-primary/10 text-primary text-xs font-medium",children:i?.full_name?.charAt(0)||g?.email?.charAt(0)?.toUpperCase()||"A"})]}),!s&&e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-xs font-medium truncate text-sidebar-foreground",children:i?.full_name||"Admin"}),e.jsx("p",{className:"text-[10px] text-sidebar-foreground/50 truncate",children:"Super Admin"})]})]})}),s&&e.jsx(b,{side:"right",children:e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:i?.full_name||"Admin"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Super Admin"})]})})]})]})]})})}function ue(){const o=P(),{user:d,profile:l,signOut:x}=L(),{isImpersonating:i}=W(),[g,p]=r.useState(!1),[h,N]=r.useState(!1),{theme:c,setTheme:n}=U(),v=r.useCallback(async()=>{await x(),o("/auth")},[x,o]),s=r.useCallback(()=>{n(c==="dark"?"light":"dark")},[c,n]),w=r.useCallback(()=>p(!0),[]);return e.jsxs("div",{className:"flex min-h-screen bg-background",children:[e.jsx("aside",{className:a("hidden lg:flex lg:flex-col lg:fixed lg:inset-y-0 z-50",i&&"lg:top-10"),children:e.jsx(D,{pinned:h,onPinnedChange:N})}),e.jsx(K,{open:g,onOpenChange:p,children:e.jsx(Q,{side:"left",className:"w-72 p-0 bg-sidebar border-r border-sidebar-border",children:e.jsx(D,{})})}),e.jsxs("div",{className:a("flex flex-1 flex-col transition-all duration-300",h?"lg:pl-[260px]":"lg:pl-[68px]",i&&"pt-10"),children:[e.jsxs("header",{className:a("sticky z-40 flex h-16 items-center gap-4 border-b bg-card/95 backdrop-blur supports-[backdrop-filter]:bg-card/60 px-4 lg:px-6",i?"top-10":"top-0"),children:[e.jsx(j,{variant:"ghost",size:"icon",className:"lg:hidden",onClick:w,children:e.jsx(le,{className:"h-5 w-5"})}),e.jsx("div",{className:"flex-1"}),e.jsxs(j,{variant:"ghost",size:"icon",onClick:s,className:"text-muted-foreground hover:text-foreground",children:[e.jsx(oe,{className:"h-5 w-5 rotate-0 scale-100 transition-transform dark:-rotate-90 dark:scale-0"}),e.jsx(de,{className:"absolute h-5 w-5 rotate-90 scale-0 transition-transform dark:rotate-0 dark:scale-100"})]}),e.jsxs(j,{variant:"ghost",size:"icon",className:"relative",children:[e.jsx(ce,{className:"h-5 w-5"}),e.jsx("span",{className:"absolute top-2 right-2 h-2 w-2 rounded-full bg-primary animate-pulse"})]}
1),e.jsxs(H,{children:[e.jsx(q,{asChild:!0,children:e.jsxs(j,{variant:"ghost",className:"gap-2 pl-2",children:[e.jsxs(B,{className:"h-8 w-8 ring-2 ring-primary/20",children:[e.jsx(I,{src:l?.avatar_url||void 0}),e.jsx(O,{className:"bg-primary text-primary-foreground text-sm font-medium",children:l?.full_name?.charAt(0)||d?.email?.charAt(0)?.toUpperCase()})]}),e.jsxs("div",{className:"hidden md:flex flex-col items-start",children:[e.jsx("span",{className:"text-sm font-medium",children:l?.full_name||d?.email?.split("@")[0]}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Super Admin"})]}),e.jsx(me,{className:"h-4 w-4 opacity-50 hidden md:block"})]})}),e.jsxs(G,{align:"end",className:"w-56",children:[e.jsx(J,{className:"font-normal",children:e.jsxs("div",{className:"flex flex-col space-y-1",children:[e.jsx("p",{className:"text-sm font-medium",children:l?.full_name||"Admin"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:d?.email})]})}),e.jsx(S,{}),e.jsx(A,{onClick:()=>o("/workspace"),children:"Ir para Dashboard"}),e.jsx(S,{}),e.jsxs(A,{onClick:v,className:"text-destructive focus:text-destructive",children:[e.jsx(R,{className:"mr-2 h-4 w-4"}),"Sair"]})]})]})]}),e.jsx("main",{className:"flex-1 p-4 lg:p-6",children:e.jsx(E,{})})]})]})}const qe=r.memo(ue);export{qe as default};
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.