PageSourceSearch

https://yournameinlandsat.cc/assets/DashboardLayout-yrUV1rDd.js

js yournameinlandsat.cc collected 2026-10-08 07:30:33 UTC 11,621 bytes, 2 lines download raw bytes

1import{j as e}from"./ui-vendor-lDWPXbVk.js";import{r as f,O as U,u as S,L as j,i as z}from"./react-vendor-BM5Vs4gt.js";import{h as A,i as M,j as T,D as F,k as I,B as c,l as D,m as O,L as N,n as p,o as d,f as g,p as B,T as H,u as P,e as L,q as R,r as K,s as Q,t as V,S as $,M as G}from"./index-BsGGgQyJ.js";import{A as X,a as Y,b as _}from"./avatar-CzBjrMew.js";import{S as J,a as W,b as Z}from"./sheet-DoYz89DI.js";import{B as w,C as ee,u as se,M as ae}from"./useAdminStatus-3JlcSTaf.js";import{S as re}from"./scroll-area-gMa2CqKg.js";import{C as te}from"./check-7vjUK4YJ.js";import{C as ne}from"./circle-alert-Cf6UlOzI.js";import{f as ie}from"./formatDistanceToNow-GvzlsMc-.js";import{A as y,a as v}from"./alert-y1VoRG1I.js";import{C as le}from"./circle-check-big-BXL7CNl1.js";import{X as C}from"./x-BFHqqJgJ.js";import{M as oe}from"./mail-DF_Jx5Q6.js";import{f as u}from"./features-XWwDGVMj.js";import{H as ce}from"./house-BmrHGJb7.js";import{M as de}from"./message-square-DZONI9o6.js";import{A as me}from"./activity-BJqY1c2N.js";import{F as he}from"./folder-open-BjvjU8iO.js";import{C as xe}from"./component-BxG2tsOW.js";import{P as ue}from"./palette-C4RSBlqr.js";import{U as fe}from"./user-Cz0dX-PV.js";import{S as k}from"./shield-RHqAAfYq.js";import{S as pe}from"./settings-DByin0wg.js";import{L as je}from"./log-out-BzlWmULt.js";import"./index-DgSZb3Sj.js";import"./index-BdQq_4o_.js";import"./en-US-BOFmMboH.js";const m={all:["notifications"],list:s=>[...m.all,"list",s],unreadCount:()=>[...m.all,"unread-count"]};function ge(s){return A({queryKey:m.list(s),queryFn:async()=>{const a=new URLSearchParams;s?.limit&&a.set("limit",s.limit.toString()),s?.unreadOnly&&a.set("unreadOnly","true");const r=await fetch(`/api/notifications?${a}`,{credentials:"include"});if(!r.ok)throw new Error("Failed to fetch notifications");return r.json()},staleTime:30*1e3,refetchInterval:60*1e3})}function Ne(){return A({queryKey:m.unreadCount(),queryFn:async()=>{const s=await fetch("/api/notifications/unread-count",{credentials:"include"});if(!s.ok)throw new Error("Failed to fetch unread count");return(await s.json()).count},staleTime:30*1e3,refetchInterval:60*1e3})}function be(){const s=M();return T({mutationFn:async a=>{if(!(await fetch(`/api/notifications/${a}/read`,{method:"PATCH",credentials:"include"})).ok)throw new Error("Failed to mark notification as read")},onSuccess:()=>{s.invalidateQueries({queryKey:m.all})}})}function we(){const s=M();return T({mutationFn:async()=>{if(!(await fetch("/api/notifications/read-all",{method:"POST",credentials:"include"})).ok)throw new Error("Failed to mark all as read")},onSuccess:()=>{s.invalidateQueries({queryKey:m.all})}})}function ye(s){switch(s){case"warning":return e.jsx(H,{className:"h-4 w-4 text-yellow-500"});case"error":return e.jsx(ne,{className:"h-4 w-4 text-destructive"});case"success":return e.jsx(te,{className:"h-4 w-4 text-green-500"});default:return e.jsx(B,{className:"h-4 w-4 text-blue-500"})}}function ve(s){try{return ie(new Date(s),{addSuffix:!0})}catch{return"recently"}}function Ce(){const{data:s=0}=Ne(),{data:a,isLoading:r}=ge({limit:10}),t=be(),l=we(),o=a?.notifications??[],i=s>0,h=n=>{t.mutate(n)},x=()=>{l.mutate()};return e.jsxs(F,{children:[e.jsx(I,{asChild:!0,children:e.jsxs(c,{variant:"ghost",size:"icon",className:"relative",children:[e.jsx(w,{className:"h-5 w-5"}),i&&e.jsx("span",{className:"absolute -right-0.5 -top-0.5 flex h-5 w-5 items-center justify-center rounded-full bg-destructive text-[10px] font-medium text-destructive-foreground",children:s>9?"9+":s}),e.jsx("span",{className:"sr-only",children:i?`${s} unread notifications`:"Notifications"})]})}),e.jsxs(D,{align:"end",className:"w-80",children:[e.jsxs(O,{className:"flex items-center justify-between",children:[e.jsx("span",{children:"Notifications"}),i&&e.jsxs(c,{variant:"ghost",size:"sm",className:"h-auto p-1 text-xs",onClick:x,disabled:l.isPending,children:[l.isPending?e.jsx(N,{className:"mr-1 h-3 w-3 animate-spin"}):e.jsx(ee,{className:"mr-1 h-3 w-3"}),"Mark all read"]})]}),e.jsx(p,{}),r?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(N,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):o.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[e.jsx(w,{className:"h-8 w-8 text-muted-foreground
1/50"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"No notifications"})]}):e.jsx(re,{className:"h-[300px]",children:o.map(n=>e.jsx(d,{className:g("flex cursor-pointer flex-col items-start gap-1 p-3",!n.read&&"bg-muted/50"),onClick:()=>!n.read&&h(n.id),children:e.jsxs("div",{className:"flex w-full items-start gap-2",children:[ye(n.type),e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsx("p",{className:g("text-sm",!n.read&&"font-medium"),children:n.title}),n.message&&e.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:n.message}),e.jsx("p",{className:"text-xs text-muted-foreground",children:ve(n.createdAt)})]}),!n.read&&e.jsx("span",{className:"h-2 w-2 rounded-full bg-primary"})]})},n.id))})]})]})}function ke(){const{data:s}=P(),[a,r]=f.useState(!1),[t,l]=f.useState(!1),[o,i]=f.useState(!1);if(!s?.user||s.user.emailVerified||t)return null;const h=async()=>{r(!0);try{await L.sendVerificationEmail({email:s.user.email,callbackURL:"/verify-email"}),i(!0),setTimeout(()=>i(!1),5e3)}catch(x){console.error("Failed to resend verification email:",x)}finally{r(!1)}};return o?e.jsxs(y,{className:"rounded-none border-x-0 border-t-0 bg-green-500/10 border-green-500/20",children:[e.jsx(le,{className:"h-4 w-4 text-green-600"}),e.jsxs(v,{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-green-600",children:"Verification email sent! Check your inbox."}),e.jsx(c,{variant:"ghost",size:"sm",onClick:()=>i(!1),className:"h-6 px-2 text-green-600 hover:text-green-700 hover:bg-green-500/10",children:e.jsx(C,{className:"h-4 w-4"})})]})]}):e.jsxs(y,{className:"rounded-none border-x-0 border-t-0 bg-yellow-500/10 border-yellow-500/20",children:[e.jsx(oe,{className:"h-4 w-4 text-yellow-600"}),e.jsxs(v,{className:"flex items-center justify-between flex-wrap gap-2",children:[e.jsx("span",{className:"text-yellow-600",children:"Please verify your email address to access all features."}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(c,{variant:"outline",size:"sm",onClick:h,disabled:a,className:"h-7 border-yellow-500/30 text-yellow-600 hover:bg-yellow-500/10",children:a?e.jsxs(e.Fragment,{children:[e.jsx(N,{className:"mr-1 h-3 w-3 animate-spin"}),"Sending..."]}):"Resend Email"}),e.jsx(c,{variant:"ghost",size:"sm",onClick:()=>l(!0),className:"h-7 px-2 text-yellow-600 hover:text-yellow-700 hover:bg-yellow-500/10",children:e.jsx(C,{className:"h-4 w-4"})})]})]})]})}const q=[{label:"Home",href:"/dashboard",icon:ce},{label:"AI Chat",href:"/dashboard/chat",icon:de},{label:"Activity",href:"/dashboard/activity",icon:me},{label:"Files",href:"/dashboard/files",icon:he},...u.devTools&&u.components?[{label:"Components",href:"/dashboard/components",icon:xe}]:[],...u.devTools&&u.styleGuide?[{label:"Style Guide",href:"/dashboard/style-guide",icon:ue}]:[]];function Se(){const s=S();return e.jsx("aside",{className:"fixed left-0 top-0 z-40 h-screen w-64 border-r border-border bg-background",children:e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsx("div",{className:"flex h-16 items-center border-b border-border px-6",children:e.jsxs(j,{to:"/",className:"flex items-center gap-2 font-semibold text-lg",children:[e.jsx("span",{className:"text-primary",children:"⚡"}),e.jsx("span",{children:R.name})]})}),e.jsx("nav",{className:"flex-1 space-y-1 p-4",children:q.map(a=>{const r=a.icon,t=s.pathname===a.href;return e.jsxs(j,{to:a.href,className:g("flex items-center gap-3 rounded-lg px-3 py-2 text-sm font-medium transition-colors",t?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:[e.jsx(r,{className:"h-4 w-4"}),a.label]},a.href)})})]})})}function Ae(){const s=S(),[a,r]=f.useState(!1);return e.jsxs(J,{open:a,onOpenChange:r,children:[e.jsx(W,{asChild:!0,children:e.jsxs(c,{variant:"ghost",size:"icon",className:"md:hidden",children:[e.jsx(ae,{className:"h-5 w-5"}),e.jsx("span",{className:"sr-only",children:"Toggle menu"})]})}),e.jsx(Z,{side:"left",className:"w-64 p-0",children:e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsx("div",{className:"flex h-16 items-center border-b border-border px-6",children:e.jsxs(j,{to:"/",className:"flex items-center gap-2 font-semibold text-lg",children:[e.jsx("span",{className:"text-primary",children:"⚡"}),e.jsx("span",{children:R.name})]})}),e.jsx("nav",{className:"flex-1 space-y-1 p-4",children:q.map(t=>{const l=t.icon,o=s.pathname===t.href;return e.jsxs(j,{to:t.href,onClick:()=>r(!1),className:g("flex items-center gap-3 rounded-lg px-3 py-2 text-sm font-medium transition-colors",o?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:[e.jsx(l,{className:"h-4 w-4"}),t.label]},t.href)})})]})})]})}function Me(){const{theme:s,setTheme:a}=K(),{data:r}=P(),{data:t}=Q(),{data:l}=se(),o=V(),i=z(),h=async()=>{await L.signOut(),i("/sign-in")},x=()=>
1{if(r&&t){const E=t.mode==="dark"?"light":"dark";o.mutate({theme:t.theme,mode:E})}else a(s==="dark"?"light":"dark")},n=r?.user?.name?.split(" ").map(b=>b[0]).join("").toUpperCase()||"U";return e.jsxs("header",{className:"sticky top-0 z-30 flex h-16 items-center gap-4 border-b border-border bg-background px-4 md:px-6",children:[e.jsx(Ae,{}),e.jsx("div",{className:"flex-1"}),e.jsx(Ce,{}),e.jsxs(c,{variant:"ghost",size:"icon",onClick:x,children:[s==="dark"?e.jsx($,{className:"h-5 w-5"}):e.jsx(G,{className:"h-5 w-5"}),e.jsx("span",{className:"sr-only",children:"Toggle theme"})]}),e.jsxs(F,{children:[e.jsx(I,{asChild:!0,children:e.jsx(c,{variant:"ghost",className:"relative h-10 w-10 rounded-full",children:e.jsxs(X,{className:"h-10 w-10",children:[e.jsx(Y,{src:r?.user?.image||void 0,alt:r?.user?.name||"User"}),e.jsx(_,{children:n})]})})}),e.jsxs(D,{align:"end",className:"w-56",children:[e.jsx(O,{children:e.jsxs("div",{className:"flex flex-col space-y-1",children:[e.jsx("p",{className:"text-sm font-medium leading-none",children:r?.user?.name}),e.jsx("p",{className:"text-xs leading-none text-muted-foreground",children:r?.user?.email})]})}),e.jsx(p,{}),e.jsxs(d,{onClick:()=>i("/dashboard/profile"),children:[e.jsx(fe,{className:"mr-2 h-4 w-4"}),e.jsx("span",{children:"Profile"})]}),e.jsxs(d,{onClick:()=>i("/dashboard/settings?tab=security"),children:[e.jsx(k,{className:"mr-2 h-4 w-4"}),e.jsx("span",{children:"Security"})]}),e.jsxs(d,{onClick:()=>i("/dashboard/settings?tab=settings"),children:[e.jsx(pe,{className:"mr-2 h-4 w-4"}),e.jsx("span",{children:"Settings"})]}),l&&e.jsxs(e.Fragment,{children:[e.jsx(p,{}),e.jsxs(d,{onClick:()=>i("/dashboard/admin"),children:[e.jsx(k,{className:"mr-2 h-4 w-4"}),e.jsx("span",{children:"Admin"})]})]}),e.jsx(p,{}),e.jsxs(d,{onClick:h,children:[e.jsx(je,{className:"mr-2 h-4 w-4"}),e.jsx("span",{children:"Sign out"})]})]})]})]})}function rs(){return e.jsxs("div",{className:"flex h-screen overflow-hidden",children:[e.jsx("div",{className:"hidden md:block",children:e.jsx(Se,{})}),e.jsxs("div",{className:"flex flex-1 flex-col md:pl-64",children:[e.jsx(Me,{}),e.jsx(ke,{}),e.jsx("main",{className:"flex-1 overflow-y-auto bg-background p-4 md:p-6",children:e.jsx(U,{})})]})]})}export{rs as DashboardLayout};
2//# sourceMappingURL=DashboardLayout-yrUV1rDd.js.map

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.