PageSourceSearch

https://clubpeinard.fr/assets/evenements-Bgw7zp1H.js

js clubpeinard.fr collected 2026-10-02 01:03:14 UTC 8,209 bytes, 1 lines download raw bytes

1import{r as o,H as D,j as e,a as A,b as N}from"./index-CowhCOWN.js";import{R as z,S as M}from"./ScrollToTop-Dlbn8cF4.js";import{N as S}from"./Navbar-BBNjrk21.js";import{F}from"./Footer-Cj5HHxzL.js";import{u as L,i as T,A as R}from"./useActiveAds-CD-sVW-d.js";import{a as y,C as W}from"./contests-BeMym_qG.js";import{t as k}from"./external-url-D-DKGsv0.js";import{C as $}from"./calendar-BwsFgIvN.js";import{M as H}from"./map-pin-nyiJzMgM.js";import{E as P}from"./external-link-QAbIUs5A.js";import"./arrow-up-Bu1JxBHX.js";import"./useAuth-DGucJKcr.js";import"./logo-club-peinard-DbSL6r7V.js";import"./radio-BnmBOxrQ.js";import"./trophy-AEjWAohW.js";import"./image-CTtByhsV.js";import"./circle-user-round-ttVYrFN5.js";import"./log-out-Bo8MMyLk.js";import"./menu-DJnV9Bsm.js";import"./user-plus-BTfPHNk2.js";import"./lock-CBef0rJQ.js";const O="/__l5e/assets-v1/8c675c55-52ff-4f94-a291-b2007789a18d/logo-radio-peinard-watermark.png",B={url:O};function G(){return typeof window>"u"?1:window.innerWidth>=1024?3:window.innerWidth>=640?2:1}function I(){const[t,r]=o.useState(1);return o.useEffect(()=>{const a=()=>r(G());return a(),window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[]),t}function g(t){const r=new Date(t),a=r.getDay(),c=r.getDate()-a+(a===0?-6:1);return r.setDate(c),r.setHours(0,0,0,0),r}function _(t){const r=g(t),a=new Date(r);return a.setDate(r.getDate()+6),a.setHours(23,59,59,999),a}function U(t){const r=new Date(t),a=new Date;return r>=g(a)&&r<=_(a)}function Y(t){const r=new Date(t),a=r.getDay(),c=new Date,i=g(c),u=_(c);return r>=i&&r<=u&&(a===0||a===6)}function ge(){const[t,r]=o.useState([]),[a,c]=o.useState(!0),[i,u]=o.useState("all"),{ads:p,everyN:f}=L(),m=I();o.useEffect(()=>{D().then(r).catch(s=>console.error("Failed to load events",s)).finally(()=>c(!1))},[]);const l=o.useMemo(()=>{const s=t.filter(n=>n.status==="open");return i==="this_week"?s.filter(n=>n.start_date&&U(n.start_date)):i==="this_weekend"?s.filter(n=>n.start_date&&Y(n.start_date)):s},[t,i]),h=o.useMemo(()=>l.filter(s=>s.is_pinned),[l]),j=o.useMemo(()=>l.filter(s=>!s.is_pinned),[l]),b=t.filter(s=>s.status!=="open"),v=o.useMemo(()=>j.map(s=>({id:s.id,event:s})),[j]),w=o.useMemo(()=>T(v,p,f,m),[v,p,f,m]),C=o.useMemo(()=>w.reduce((s,n,d)=>(s[d%m].push(n),s),Array.from({length:m},()=>[])),[w,m]);return e.jsxs(e.Fragment,{children:[e.jsx(z,{}),e.jsx(S,{}),e.jsxs("main",{children:[e.jsx("section",{className:"bg-gradient-to-b from-secondary/40 to-background",children:e.jsxs("div",{className:"mx-auto max-w-7xl px-4 py-12 text-center sm:px-6 lg:px-10 lg:py-16",children:[e.jsx("h1",{className:"text-3xl font-extrabold tracking-tight text-foreground sm:text-4xl lg:text-5xl",children:"Les évènements du Club"}),e.jsx("p",{className:"mx-auto mt-4 max-w-2xl text-base text-muted-foreground sm:text-lg",children:"Soirées, concerts, projections et rendez-vous exclusifs réservés aux adhérents du Club Peinard."})]})}),e.jsx("section",{className:"mx-auto max-w-7xl px-4 py-12 sm:px-6 lg:px-10",children:a?e.jsxs("div",{className:"flex items-center justify-center py-20 text-muted-foreground",children:[e.jsx(A,{className:"mr-2 h-5 w-5 animate-spin"})," Chargement…"]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-6",children:[e.jsxs("h2",{className:"text-2xl font-extrabold tracking-tight text-foreground sm:text-3xl",children:[l.length," évènement",l.length>1?"s":""," à venir"]}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Découvrez le programme et bloquez vos dates."}),e.jsx("div",{className:"mt-4 flex flex-wrap gap-2",children:[{key:"all",label:"Tous les évènements"},{key:"this_week",label:"Cette semaine"},{key:"this_weekend",label:"Ce week-end"}].map(s=>{const n=i===s.key;return e.jsx("button",{onClick:()=>u(s.key),className:`inline-flex items-center rounded-full border-2 px-4 py-2 text-sm font-semibold transition ${n?"border-foreground bg-foreground text-background":"border-border bg-surface text-muted-foreground hover:border-border-strong hover:text-foreground"}`,children:s.label},s.key)})})]}),h.length>0&&e.jsxs("div",{className:"mb-10",children:[e.jsxs("h2",{className:"mb-4 flex items-center gap-2 text-xl font-extrabold tracking-tight text-foreground sm:text-2xl",children:[e.jsx("span",{"aria-hidden":!0,
1children:"⭐"})," À la une"]}),e.jsx("div",{className:"grid grid-cols-1 items-start gap-6 sm:grid-cols-2 lg:grid-cols-3",children:h.map(s=>e.jsx("div",{className:"rounded-[18px] ring-2 ring-primary/70",children:e.jsx(x,{event:s})},s.id))})]}),l.length===0?e.jsxs("div",{className:"rounded-2xl border border-dashed border-border bg-surface px-6 py-20 text-center",children:[e.jsx("p",{className:"text-base font-semibold text-foreground",children:i!=="all"?"Aucun évènement ne correspond à ce filtre":"Aucun évènement à venir pour l'instant"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:i!=="all"?"Essayez un autre filtre ou revenez plus tard.":"Revenez bientôt, de nouveaux rendez-vous arrivent !"})]}):e.jsx("div",{className:"grid grid-cols-1 items-start gap-6 sm:grid-cols-2 lg:grid-cols-3",children:C.map((s,n)=>e.jsx("div",{className:"flex min-w-0 flex-col gap-6",children:s.map((d,E)=>d.kind==="ad"?e.jsx(R,{ad:d.ad},`ad-${d.ad.id}-${n}-${E}`):e.jsx(x,{event:d.item.event},d.item.id))},n))}),b.length>0&&e.jsxs("div",{className:"mt-16",children:[e.jsx("h2",{className:"mb-6 text-xl font-extrabold tracking-tight text-foreground sm:text-2xl",children:"Évènements passés"}),e.jsx("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3",children:b.map(s=>e.jsx(x,{event:s,muted:!0},s.id))})]})]})})]}),e.jsx(F,{}),e.jsx(M,{})]})}function x({event:t,muted:r=!1}){return e.jsxs("article",{className:`group flex flex-col overflow-hidden rounded-2xl border border-border bg-surface shadow-card transition hover:shadow-glow-primary ${r?"opacity-70":""}`,children:[e.jsxs("div",{className:"relative aspect-[750/438] overflow-hidden bg-muted",children:[t.image_url?e.jsxs(e.Fragment,{children:[e.jsx("img",{src:N(t.image_url),alt:"","aria-hidden":!0,className:"absolute inset-0 h-full w-full scale-110 object-cover opacity-60 blur-xl",loading:"lazy"}),e.jsx("img",{src:N(t.image_url),alt:t.title,className:"relative h-full w-full object-contain transition group-hover:scale-105",loading:"lazy"})]}):e.jsx("div",{className:"flex h-full w-full items-center justify-center text-5xl",children:y[t.category]}),t.is_girls&&e.jsx("span",{className:"absolute left-3 top-3 rounded-full bg-primary px-2.5 py-1 text-xs font-bold text-primary-foreground shadow",children:"Eh Les Filles"}),t.show_watermark&&e.jsx("img",{src:B.url,alt:"","aria-hidden":!0,className:"pointer-events-none absolute bottom-[2%] right-[1%] w-[19%] min-w-14 max-w-40 h-auto opacity-80 drop-shadow-md"}),t.is_free&&e.jsx("span",{className:"absolute right-3 top-3 rounded-full bg-success px-2.5 py-1 text-xs font-bold text-success-foreground shadow",children:"Entrée gratuite"})]}),e.jsxs("div",{className:"flex flex-1 flex-col gap-3 p-5",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:[e.jsx("span",{children:y[t.category]}),e.jsx("span",{children:W[t.category]||t.category_label||t.category})]}),e.jsx("h3",{className:"text-lg font-bold leading-tight text-foreground",children:t.title}),t.description&&e.jsx("p",{className:"line-clamp-3 text-sm text-muted-foreground",children:t.description}),e.jsxs("div",{className:"mt-auto space-y-1.5 text-sm text-muted-foreground",children:[t.event_date&&e.jsxs("div",{className:"flex items-start gap-1.5",children:[e.jsx($,{className:"mt-0.5 h-4 w-4 flex-shrink-0"}),e.jsx("span",{children:t.event_date})]}),t.location&&e.jsxs("div",{className:"flex items-start gap-1.5",children:[e.jsx(H,{className:"mt-0.5 h-4 w-4 flex-shrink-0"}),e.jsx("span",{children:t.location})]})]}),k(t.partner_url)&&e.jsxs("a",{href:k(t.partner_url),target:"_blank",rel:"noopener noreferrer",className:"mt-2 inline-flex items-center gap-1.5 text-sm font-semibold text-primary hover:underline",children:["En savoir plus ",e.jsx(P,{className:"h-3.5 w-3.5"})]})]})]})}export{ge 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.