PageSourceSearch

https://fla-das-web.vercel.app/_next/static/chunks/pages/eventi-71fd3e9331436780.js

js fla-das-web.vercel.app collected 2026-10-03 06:57:33 UTC 11,264 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1],{6380:(e,a,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/eventi",function(){return t(80465)}])},80465:(e,a,t)=>{"use strict";t.r(a),t.d(a,{__N_SSG:()=>R,default:()=>k});var l=t(6029),s=t(87755),r=t(42972),i=t(44316),n=t(46238),o=t(83983),d=t(50194),c=t(71986),u=t(14314),h=t(27726),g=t(52575),x=t(21856),v=t(89019),m=t(81278),p=t(55729),f=t(71527),A=t(89562),b=t(80839),j=t(12481),y=t(74688),C=t(79802),S=t(42424),w=t(65610);let T=e=>{let a=new Set;return e.filter(e=>!e.id||!a.has(e.id)&&(a.add(e.id),!0))},_=[{value:"DESC",label:"Pi\xf9 recenti"},{value:"ASC",label:"Meno recenti"}],E=[{value:"All",label:"- Seleziona Tag -"},{value:"antial",label:"ANTIAL"},{value:"anvides",label:"ANVIDES"},{value:"apil",label:"APIL"},{value:"apps",label:"APPS"},{value:"asp",label:"ASP"},{value:"asalassoallestimenti",label:"ASAL Assoallestimenti"},{value:"assarredo",label:"Assarredo"},{value:"assobagno",label:"Assobagno"},{value:"assoimballaggi",label:"Assoimballaggi"},{value:"assolegno",label:"Assolegno"},{value:"assoluce",label:"Assoluce"},{value:"assopannelli",label:"Assopannelli"},{value:"assotende",label:"Assotende"},{value:"assufficio",label:"Assufficio"},{value:"edilegnoarredo",label:"Edilegnoarredo"},{value:"fedecomlegno",label:"Fedecomlegno"},{value:"gruppogiovani",label:"Gruppo Giovani"},{value:"federazione",label:"Federazione"}];function F(e){let{menu:a,footerMenu:t,footerBottomMenu:x,preFooter:v}=e,y=(0,m.useRouter)(),F=(0,C.XI)(),[R,k]=(0,p.useState)("prossimi"),[O,P]=(0,p.useState)({searchText:"",association:"All",tag:"All",hashtag:"All",dateFrom:"",dateTo:"",sortOrder:"DESC"}),[D,N]=(0,p.useState)([]),[I,W]=(0,p.useState)(!1),[q,z]=(0,p.useState)(null),[M,G]=(0,p.useState)(!0),[H,X]=(0,p.useState)(0),[B,U]=(0,p.useState)(0),[V,Y]=(0,p.useState)(!1),[J,K]=(0,p.useState)(!1),[Q,Z]=(0,p.useState)([]),[$,ee]=(0,p.useState)(!1),[ea,et]=(0,p.useState)([]),[el,es]=(0,p.useState)(!1),{setMenu:er}=(0,w.we)();(0,p.useEffect)(()=>{er(a)},[er,a]);let ei=async()=>{ee(!0);try{let e=await fetch("/api/tags");if(e.ok){let a=(await e.json()).data.map(e=>{var a;let t=(null==(a=e.name)?void 0:a.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]+/g,""))||"";return{id:e.drupal_internal__tid||e.id||"",name:e.name||"",slug:e.field_slug||t}});Z(a)}}catch(e){console.error("Errore nel caricamento dei tags:",e)}finally{ee(!1)}},en=async()=>{es(!0);try{let e=await fetch("/api/hashtag");if(e.ok){let a=(await e.json()).data.map(e=>{var a;let t=(null==(a=e.name)?void 0:a.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]+/g,""))||"";return{id:e.drupal_internal__tid||e.id||"",name:e.name||"",slug:e.field_slug||t}});et(a)}}catch(e){console.error("Errore nel caricamento degli hashtag:",e)}finally{es(!1)}};(0,p.useEffect)(()=>{ei(),en()},[]),(0,p.useEffect)(()=>{if(Q.length>0&&y.isReady){let e=y.query.service;if(e){let a=decodeURIComponent(e),t=Q.find(e=>e.name.toLowerCase().trim()===a.toLowerCase().trim()||e.slug.toLowerCase()===a.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]+/g,"")||e.name.toLowerCase().includes(a.toLowerCase())||a.toLowerCase().includes(e.name.toLowerCase()));if(t){let e=t.id.toString();P(a=>({...a,tag:e})),ed(R,{searchText:"",association:"All",tag:e,hashtag:"All",dateFrom:"",dateTo:"",sortOrder:"DESC"})}else ed(R,{searchText:"",association:"All",tag:"All",hashtag:"All",dateFrom:"",dateTo:"",sortOrder:"DESC"})}}},[Q,y.isReady,y.query.service,R]),(0,p.useEffect)(()=>{if(y.isReady){let e=y.query.association;if(e){let a=E.find(a=>a.value.toLowerCase()===e.toLowerCase());a?(P(e=>({...e,association:a.value})),ed(R,{searchText:"",association:a.value,tag:"All",hashtag:"All",dateFrom:"",dateTo:"",sortOrder:"DESC"})):ed(R,{searchText:"",association:"All",tag:"All",hashtag:"All",dateFrom:"",dateTo:"",sortOrder:"DESC"})}}},[y.isReady,y.query.association,R]);let eo=(e,a)=>{let t=new Date().toISOString().split("T")[0]||"";return"prossimi"===e?{...a,dateFrom:t,dateTo:"",sortOrder:"ASC"}:{...a,dateFrom:"",dateTo:t,sortOrder:"DESC"}},ed=async(e,a)=>{let t=eo(e,a||O);W(!0),z(null);try{let e=await ec(t),a=T(e.events);N(a),U(e.total),Y(e.hasNextPage),X(0),G(!0)}catch(e){z(e instanceof Error?e.message:"Errore durante la ricerca"),N([]),U(0),Y(!1)}finally{W(!1)}},ec=async function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;try{let t=new URLSearchParams;e.searchText&&t.append("search",e.searchText),e.association&&"All"!==e.association&&t.append("association",e.association),e.tag&&"All"!==e.tag&&t.append("tag",e.tag),e.hashtag&&"All"!==e.hashtag&&t.append("hashtag",e.hashtag),e.dateFrom&&t.append("dateFrom",e.dateFrom),e.dateTo&&t.append("dateTo",e.dateTo),t.append("sort",e.sortOrder),a>0&&t.append("page",a.toString());let l=await fetch("/api/eventi?".concat(t.toString()));if(!l.ok)throw Error("HTTP error! status: ".concat(l.status));let s=await l.json();if(s.error)throw Error(s.error);return{events:s.data||[],total:s.total||0,hasNextPage:s.hasNextPage||!1}}catch(e){throw console.error("Fetch Events Error:",e),e}};(0,p.useEffect)(()=>{!y.isReady||y.query.service||y.query.association||ed(R)},[y.isReady,y.query.service,y.query.association,R]);let eu=(e,a)=>{P(t=>({...t,[e]:a}))},eh=async e=>{e&&e.preventDefault(),await ed(R,O)},eg=async()=>{let e={searchText:"",association:"All",tag:"All",hashtag:"All",dateFrom:"",dateTo:"",sortOrder:"DESC"};P(e),await ed(R,e)},ex=async()=>
1{if(V&&!J){K(!0),z(null);try{let e=H+1,a=eo(R,O),t=await ec(a,e);N(e=>{let a=[...e,...t.events];return T(a)}),Y(t.hasNextPage),X(e)}catch(e){z(e instanceof Error?e.message:"Errore durante il caricamento di pi\xf9 eventi")}finally{K(!1)}}};return(0,l.jsx)(f.YW,{metaTitle:"Eventi",children:(0,l.jsxs)(S.Od,{menu:a,preFooter:v,footerMenu:t,footerMenuBottom:x,children:[(0,l.jsx)(j.dz,{backgroundImage:"/assets/images/federation-bg.webp",title:"Eventi",tabValue:R,handleTabChange:e=>{k(e),X(0),N([]),ed(e)},tabsData:[{label:"Prossimi appuntamenti",value:"prossimi"},{label:"Archivio eventi",value:"archivio"}],tabsColor:"black"}),(0,l.jsxs)(A.g,{sx:{py:{xs:4,md:6}},children:[(0,l.jsxs)(s.A,{sx:{borderRadius:2,p:3,mb:4},children:[(0,l.jsx)(r.A,{variant:"headline4",sx:{mb:3},children:"Ricerca eventi"}),(0,l.jsx)(s.A,{component:"form",onSubmit:eh,children:(0,l.jsxs)(i.Ay,{container:!0,spacing:2,children:[(0,l.jsx)(i.Ay,{item:!0,xs:12,md:3,children:(0,l.jsx)(n.A,{fullWidth:!0,label:"Testo",variant:"outlined",placeholder:"TESTO",value:O.searchText,onChange:e=>eu("searchText",e.target.value),disabled:I})}),(0,l.jsx)(i.Ay,{item:!0,xs:12,md:3,children:(0,l.jsxs)(o.A,{fullWidth:!0,children:[(0,l.jsx)(d.A,{children:"Tag"}),(0,l.jsx)(c.A,{value:O.association,onChange:e=>eu("association",e.target.value),label:"Tag",children:E.map(e=>(0,l.jsx)(u.A,{value:e.value,children:e.label},e.value))})]})}),(0,l.jsx)(i.Ay,{item:!0,xs:12,md:3,children:(0,l.jsxs)(o.A,{fullWidth:!0,children:[(0,l.jsx)(d.A,{children:"Categoria"}),(0,l.jsxs)(c.A,{value:O.tag,onChange:e=>eu("tag",e.target.value),label:"TCategoriag",disabled:$,children:[(0,l.jsx)(u.A,{value:"All",children:"- Seleziona Categoria -"}),Q.map(e=>(0,l.jsx)(u.A,{value:e.id,children:e.name},e.id))]})]})}),(0,l.jsx)(i.Ay,{item:!0,xs:12,md:3,children:(0,l.jsxs)(o.A,{fullWidth:!0,children:[(0,l.jsx)(d.A,{children:"Hashtag"}),(0,l.jsxs)(c.A,{value:O.hashtag,onChange:e=>eu("hashtag",e.target.value),label:"Hashtag",disabled:el,children:[(0,l.jsx)(u.A,{value:"All",children:"- Seleziona Hashtag -"}),ea.map(e=>(0,l.jsx)(u.A,{value:e.id,children:e.name},e.id))]})]})}),(0,l.jsx)(i.Ay,{item:!0,xs:12,md:4,children:(0,l.jsx)(n.A,{fullWidth:!0,label:"Data evento da",type:"date",value:O.dateFrom,onChange:e=>eu("dateFrom",e.target.value),disabled:I,InputLabelProps:{shrink:!0}})}),(0,l.jsx)(i.Ay,{item:!0,xs:12,md:4,children:(0,l.jsx)(n.A,{fullWidth:!0,label:"Data evento a",type:"date",value:O.dateTo,onChange:e=>eu("dateTo",e.target.value),disabled:I,InputLabelProps:{shrink:!0}})}),(0,l.jsx)(i.Ay,{item:!0,xs:12,md:4,children:(0,l.jsxs)(o.A,{fullWidth:!0,children:[(0,l.jsx)(d.A,{children:"Ordinamento"}),(0,l.jsx)(c.A,{value:O.sortOrder,onChange:e=>eu("sortOrder",e.target.value),label:"Ordinamento",children:_.map(e=>(0,l.jsx)(u.A,{value:e.value,children:e.label},e.value))})]})}),(0,l.jsx)(i.Ay,{item:!0,xs:12,children:(0,l.jsxs)(s.A,{sx:{display:"flex",justifyContent:"space-between",gap:2,mt:2},children:[(0,l.jsx)(b.RR,{color:"light",variant:"default",onClick:eg,disabled:I,children:"Reset filtri"}),(0,l.jsx)(b.RR,{color:"dark",variant:"default",withStandardIcon:!0,onClick:eh,disabled:I,children:"Cerca"})]})})]})})]}),I&&(0,l.jsx)(s.A,{sx:{display:"flex",justifyContent:"center",mb:4},children:(0,l.jsx)(h.A,{})}),q&&(0,l.jsx)(g.A,{severity:"error",sx:{mb:4},children:q}),M&&!I&&(0,l.jsx)(l.Fragment,{children:D.length>0?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(i.Ay,{container:!0,spacing:3,children:D.filter(e=>!e.field_event_visibility||"public"===e.field_event_visibility||F).map(e=>(0,l.jsx)(i.Ay,{item:!0,xs:12,md:6,children:(0,l.jsx)(L,{eventItem:e})},e.id))}),V&&(0,l.jsx)(s.A,{sx:{display:"flex",justifyContent:"center",mt:4},children:(0,l.jsx)(b.RR,{color:"dark",variant:"default",onClick:ex,disabled:J,children:J?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(h.A,{size:20,sx:{mr:1}}),"Caricamento..."]}):"Mostra di pi\xf9"})})]}):(0,l.jsxs)(s.A,{sx:{textAlign:"center",py:8},children:[(0,l.jsx)(r.A,{variant:"headline4",color:"text.secondary",children:"Nessun evento trovato"}),(0,l.jsx)(r.A,{variant:"bodyParagraph",color:"text.secondary",children:"Prova a modificare i filtri di ricerca"})]})})]})]})})}let L=e=>{var a;let{eventItem:t}=e,[i,n]=(0,p.useState)(!1),o=e=>e?new Date(e).toLocaleDateString("it-IT",{year:"numeric",month:"long",day:"numeric"}):"",d=()=>
1{if(!t.field_date)return"";let e=t.field_date.value,a=t.field_date.end_value;if(!e)return"";let l=e.split("T")[0],s=a?a.split("T")[0]:l;return l!==s?"".concat(o(e)," - ").concat(o(a)):o(e)},c=()=>t.field_location?t.field_location:t.field_luogo?"string"==typeof t.field_luogo?t.field_luogo:t.field_luogo.name||t.field_luogo.title||"":"";return(0,l.jsx)(x.A,{sx:{borderRadius:"10px",border:"1px solid rgba(7, 14, 37, 0.10)",backgroundColor:i?"#FFFFFF":"#F2F4F7",cursor:"pointer",transition:"all 0.3s ease",height:"100%",display:"flex",flexDirection:"column","&:hover":{boxShadow:"0px 8px 24px rgba(0, 0, 0, 0.15)"}},onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),children:(0,l.jsxs)(v.A,{sx:{flexGrow:1,p:3},children:[c()&&(0,l.jsx)(r.A,{variant:"bodyParagraphSmall",sx:{color:"text.secondary",fontWeight:500,mb:2},children:c()}),d()&&(0,l.jsx)(r.A,{variant:"editorialSmall",sx:{textTransform:"uppercase",mb:2},children:d()}),(0,l.jsx)(r.A,{variant:"headline4",component:"h4",sx:{mb:2,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",lineHeight:1.3},children:t.title}),(0,l.jsx)(s.A,{sx:{flexGrow:1}}),(0,l.jsx)(s.A,{sx:{display:"flex",justifyContent:"flex-end",mt:2},children:(0,l.jsx)(b.RR,{href:(null==(a=t.path)?void 0:a.alias)||"#",variant:"icon",color:"ghost",ariaLabel:"Leggi l'evento",children:(0,l.jsx)(y.A,{icon:"material-symbols:east-rounded"})})})]})})};var R=!0;let k=F;F.getLayout=function(e){return e}}},e=>{var a=a=>e(e.s=a);e.O(0,[636,593,792],()=>a(6380)),_N_E=e.O()}]);

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.