PageSourceSearch

https://printlabzz.lovable.app/assets/admin-CCSamqX7.js

js printlabzz.lovable.app collected 2026-10-03 03:40:39 UTC 8,257 bytes, 1 lines download raw bytes

1import{b as j,r as m,c as v,d as N,a as k,j as e,L as c,O as w,s as S}from"./index-CqIYrOTa.js";import{u as C}from"./useQuery-C8CCHTlt.js";import{L as _,M as O}from"./menu-wPJpou-o.js";import{S as z}from"./shopping-cart-CM32eeDL.js";import{W as M}from"./wallet-Crz3FkOX.js";import{M as P}from"./message-square-BF83NNpw.js";import{M as A}from"./mail-Ds8oEobd.js";import{P as E}from"./package-BUubOrK-.js";import{P as L}from"./palette-B7jvn3wt.js";import{S as f}from"./shield-DxcDHLpg.js";import{U as R}from"./users-BUJV4P-x.js";import{C as h}from"./circle-user-BP24idqo.js";import{S as q}from"./settings-DTCSwv9z.js";import{C as U}from"./chevron-right-DUNytOFu.js";import{A as D}from"./arrow-left-DgMlc9ai.js";import{X as T}from"./x-B4jx6vMv.js";import"./createLucideIcon-95o0Ae_w.js";function W(s){const i=j({warn:s?.router===void 0}),t=s?.router||i,l=m.useRef(void 0);return v(t.stores.__store,n=>{if(s?.select){if(s.structuralSharing??t.options.defaultStructuralSharing){const o=N(l.current,s.select(n));return l.current=o,o}return s.select(n)}return n})}function te(){const{user:s,loading:i,isStaff:t,isSuperAdmin:l,roles:n}=k(),o=j(),u=W({select:r=>r.location.pathname}),[p,x]=m.useState(!1),{data:d}=C({queryKey:["sidebar-profile",s?.id],enabled:!!s,queryFn:async()=>{const{data:r}=await S.from("profiles").select("display_name, full_name, avatar_url").eq("id",s.id).maybeSingle();return r}}),b=d?.display_name||d?.full_name||s?.email;if(m.useEffect(()=>{!i&&(!s||!t)&&o.navigate({to:"/login"})},[i,s,t,o]),m.useEffect(()=>{x(!1)},[u]),i||!s||!t)return e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center text-muted-foreground",children:"Checking access…"});const y=[{label:"Overview",links:[{to:"/admin",label:"Dashboard",icon:_,exact:!0}]},{label:"Operations",links:[{to:"/admin/orders",label:"Orders",icon:z},{to:"/admin/commissions",label:"Commissions",icon:M},{to:"/admin/custom-requests",label:"Custom Requests",icon:P},{to:"/admin/contact-messages",label:"Contact Messages",icon:A}]},{label:"Catalog",links:[{to:"/admin/products",label:"Products",icon:E},{to:"/admin/colours",label:"Colour Management",icon:L},{to:"/admin/product-approvals",label:"Product Approvals",icon:f,superOnly:!0}]},{label:"People",links:[{to:"/admin/customers",label:"Customers",icon:R},{to:"/admin/users",label:"Employees",icon:f,superOnly:!0},{to:"/admin/team",label:"Manage About Us Team",icon:h,superOnly:!0}]},{label:"System",links:[{to:"/admin/settings",label:"Site Settings",icon:q,superOnly:!0}]}].map(r=>({...r,links:r.links.filter(a=>!a.superOnly||l)})).filter(r=>r.links.length>0),g=e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsxs("div",{className:"px-6 py-5 border-b border-border/40",children:[e.jsxs(c,{to:"/",className:"font-display text-lg font-bold tracking-tight",children:["Print",e.jsx("span",{className:"text-primary",children:"labzz"})]}),e.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[l?e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-primary/40 bg-primary/10 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-widest text-primary",children:[e.jsx(f,{size:10})," Super Admin"]}):e.jsx("span",{className:"rounded-full border border-border/60 bg-secondary/40 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-widest text-muted-foreground",children:"Employee"}),e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[10px] text-muted-foreground",children:[e.jsxs("span",{className:"relative flex h-1.5 w-1.5",children:[e.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-primary opacity-75 animate-ping"}),e.jsx("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-primary"})]}),"Live"]})]})]}),e.jsx("nav",{className:"flex-1 overflow-y-auto p-3 space-y-5",children:y.map(r=>e.jsxs("div",{children:[e.jsx("div",{className:"px-3 pb-1.5 text-[10px] uppercase tracking-widest text-muted-foreground/70",children:r.label}),e.jsx("div",{className:"space-y-0.5",children:r.links.map(a=>e.jsxs(c,{to:a.to,activeOptions:{exact:a.exact},className:"group flex items-center gap-3 px-3 py-2 rounded-lg text-sm text-muted-foreground hover:text-foreground hover:bg-secondary/50 transition-all duration-200",activeProps:{className:"group flex items-center gap-3 px-3 py-2 rounded-lg text-sm bg-gradient-to-r from-primary/20 to-primary/5 text-primary border border-primary/30 shadow-[0_0_20px_oklch(0.72_0.21_45/0.15)]"},children:[e.jsx(a.icon,{size:16,className:"shrink-0"}),e.jsx("span",{className:"flex-1",children:a.label}),e.jsx(U,{size:14,className:"opacity-0 -translate-x-1 transition-all group-hover:opacity-60 group-hover:translate-x-0"})]},a.to))})]},r.label))}),e.jsxs("div",{className:"p-3 border-t border-border/40 space-y-3",children:[e.jsxs("div",{className:"rounded-lg border border-border/50 bg-secondary/30 p-3",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-8 h-8 rounded-full overflow-hidden bg-secondary border border-border flex items-center justify-center shrink-0",children:d?.avatar_url?e.jsx("img",{src:d.avatar_url,alt:"",className:"w-full h-full object-cover"}):e.jsx("span",{className:"text-[11px] font-medium",children:(b??"?")[0]?.toUpperCase()})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-xs font-medium truncate",children:b}),e.jsx("p",{className:"text-[10px] text-muted-foreground truncate",children:s.email})]})]}),e.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider mt-2",children:n.join(" · ")})]}),e.jsxs(c,{to:"/account/profile",className:"flex items-center gap-2 px-3 py-2 text-xs text-muted-foreground hover:text-foreground rounded-md hover:bg-secondary/40 transition",children:[e.jsx(h,{size:14})," My Profile"]}),e.jsxs(c,{to:"/",className:"flex items-center gap-2 px-3 py-2 text-xs text-muted-foreground hover:text-foreground rounded-md hover:bg-secondary/40 transition",children:[e.jsx(D,{size:14})," Back to site"]})]})]});return e.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[e.jsxs("div",{className:"pointer-events-none fixed inset-0 overflow-hidden",children:[e.jsx("div",{className:"absolute -top-40 -right-40 h-96 w-96 rounded-full bg-primary/10 blur-3xl"}),e.jsx("div",{className:"absolute top-1/2 -left-40 h-96 w-96 rounded-full bg-primary/5 blur-3xl"})]}),e.jsxs("div",{className:"relative flex",children:[e.jsx("aside",{className:"hidden lg:flex w-64 shrink-0 border-r border-border/40 bg-card/40 backdrop-blur-2xl min-h-screen sticky top-0 max-h-screen",children:g}),p&&e.jsx("div",{className:"lg:hidden fixed inset-0 z-40 bg-background/80 backdrop-blur-sm",onClick:()=>x(!1)}),e.jsx("aside",{className:`lg:hidden fixed inset-y-0 left-0 z-50 w-72 border-r border-border/40 bg-card/95 backdrop-blur-2xl transition-transform duration-300 ${p?"translate-x-0":"-translate-x-full"}`,children:g}),e.jsxs("main",{className:"flex-1 min-w-0",children:[e.jsx("header",{className:"sticky top-0 z-30 border-b border-border/40 bg-background/70 backdrop-blur-xl",children:e.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-6 lg:px-10 py-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{onClick:()=>x(r=>!r),className:"lg:hidden p-2 rounded-md hover:bg-secondary/60","aria-label":"Toggle menu",children:p?e.jsx(T,{size:18}):e.jsx(O,{size:18})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] uppercase tracking-widest text-muted-foreground",children:l?"Super Admin · Control Centre":"Employee Panel"}),e.jsx("h2",{className:"font-display text-sm font-semibold",children:u==="/admin"?"Dashboard":u.replace("/admin/","").replace(/-/g," ")})]})]}),e.jsxs("div",{className:"hidden sm:flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"relative flex h-2 w-2",children:[e.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-primary opacity-75 animate-ping"}),e.jsx("span",{className:"relative inline-flex h-2 w-2 rounded-full bg-primary"})]}),"Live updates"]})]})}),e.jsx("div",{className:"p-4 sm:p-6 lg:p-10 max-w-[1400px] mx-auto",children:e.jsx(w,{})})]})]})]})}export{te as component};

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.