1import{a as x,j as e,L as h,fY as f,Z as m,l,b as d,R as o,fZ as p,fQ as j,f_ as g,S as y,fS as N,M as b,f$ as v,g0 as w,fT as S,g1 as k,g2 as P}from"./index-DPvlhSbR.js";import{T as M}from"./tag-CihHQ-LF.js";import{T as D}from"./trash-2-BtWwPzog.js";function G(s){return new Date(s).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function Q({n:s}){const a=e.jsx("div",{className:`border rounded-xl p-4 ${s.read?"bg-card":"bg-primary/5 border-primary/30"}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[!s.read&&e.jsx("span",{className:"mt-1.5 w-2 h-2 rounded-full bg-primary shrink-0","aria-label":"Unread"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"font-semibold text-foreground",children:s.title}),s.body&&e.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:s.body}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:G(s.createdAt)})]})]})});return s.linkPath?e.jsx("li",{children:e.jsx(d,{href:s.linkPath,className:"block hover:opacity-90 transition-opacity",children:a})}):e.jsx("li",{children:a})}const C={"near-me":"New venues near a location","saved-venue-deals":"Deals on your saved venues"};function K({s}){const a=o(),n=N({mutation:{onSuccess:()=>a.invalidateQueries({queryKey:S()})}}),t=s.kind==="near-me"&&typeof s.params?.label=="string"?s.params.label:null,i=s.kind==="near-me"?b:M;return e.jsxs("li",{className:"flex items-center justify-between gap-3 border rounded-xl p-4 bg-card",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx(i,{className:"w-4 h-4 text-primary shrink-0","aria-hidden":"true"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"font-medium text-foreground",children:C[s.kind]}),t&&e.jsx("p",{className:"text-sm text-muted-foreground truncate",children:t})]})]}),e.jsx(l,{type:"button",variant:"ghost",size:"sm","aria-label":"Remove alert",disabled:n.isPending,onClick:()=>n.mutate({id:s.id}),children:e.jsx(D,{className:"w-4 h-4","aria-hidden":"true"})})]})}function L(){const s=o(),{data:a}=v(),n=w({mutation:{onSuccess:()=>s.invalidateQueries({queryKey:k()})}}),t=a?.emailOptOut??!1;return e.jsxs("label",{className:"flex items-center justify-between gap-3 border rounded-xl p-4 bg-card cursor-pointer",children:[e.jsxs("span",{children:[e.jsx("span",{className:"font-medium text-foreground block",children:"Email alerts"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"Get an email when a saved alert matches. In-app alerts always stay on."})]}),e.jsx("input",{type:"checkbox",className:"h-5 w-5 accent-primary shrink-0",checked:!t,disabled:n.isPending,onChange:i=>n.mutate({data:{emailOptOut:!i.target.checked}})})]})}function q(){const s=o(),{data:a,isLoading:n}=p(),{data:t}=j(),i=g({mutation:{onSuccess:()=>s.invalidateQueries({queryKey:P()})}}),c=a?.notifications??[],u=a?.unreadCount??0;return e.jsxs("div",{className:"space-y-10",children:[e.jsxs("section",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h2",{className:"text-xl font-semibold",children:"Notifications"}),u>0&&e.jsx(l,{type:"button",variant:"outline",size:"sm",disabled:i.isPending,onClick:()=>i.mutate({data:{}}),children:"Mark all read"})]}),n?e.jsx("div",{className:"space-y-3",children:[0,1,2].map(r=>e.jsx(y,{className:"h-20 w-full rounded-xl"},r))}):c.length===0?e.jsx("div",{className:"bg-card border rounded-2xl p-8 text-center text-muted-foreground",children:"No notifications yet. Save an alert below and we'll let you know
1when a new venue or deal matches."}):e.jsx("ul",{className:"space-y-3",children:c.map(r=>e.jsx(Q,{n:r},r.id))})]}),e.jsxs("section",{children:[e.jsx("h2",{className:"text-xl font-semibold mb-2",children:"Your saved alerts"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Set up alerts from the Near Me page (new venues near you) or by saving venues (new deals on your favorites)."}),!t||t.length===0?e.jsxs("div",{className:"bg-card border rounded-2xl p-8 text-center text-muted-foreground",children:[e.jsx("p",{className:"mb-4",children:"You don't have any saved alerts yet."}),e.jsx(l,{asChild:!0,variant:"outline",children:e.jsx(d,{href:"/near-me",children:"Set up a Near Me alert"})})]}):e.jsx("ul",{className:"space-y-3",children:t.map(r=>e.jsx(K,{s:r},r.id))})]}),e.jsxs("section",{children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"Email preferences"}),e.jsx(L,{})]})]})}function T(){return x({title:"Alerts & Notifications | Golf Sim Finder",description:"Your saved alerts and notifications for new indoor golf simulator venues and deals.",robots:"noindex, nofollow"}),e.jsx(h,{children:e.jsxs("div",{className:"container mx-auto px-4 py-12 max-w-3xl",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-8",children:[e.jsx("span",{className:"bg-primary text-primary-foreground p-2 rounded-lg",children:e.jsx(f,{className:"w-6 h-6","aria-hidden":"true"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:"Alerts"}),e.jsx("p",{className:"text-muted-foreground",children:"New venues and deals matched to your saved alerts."})]})]}),e.jsx(m,{when:"signed-in",children:e.jsx(q,{})}),e.jsx(m,{when:"signed-out",children:e.jsxs("div",{className:"bg-card border rounded-2xl p-10 text-center",children:[e.jsx("p",{className:"text-lg font-semibold text-foreground mb-2",children:"Sign in to manage your alerts"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"Save alerts for new golf simulator venues near you and deals on your favorite venues."}),e.jsx(l,{asChild:!0,children:e.jsx(d,{href:"/sign-in",children:"Sign in"})})]})})]})})}export{T 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.