vendor: 8,990 bytes, lines 1-99
1var ot=Object.defineProperty;var ct=(n,t,s)=>t in n?ot(n,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[t]=s;var J=(n,t,s)=>ct(n,typeof t!="symbol"?t+"":t,s);import{r as h,b as lt,R as X}from"./vendor-B5ij6mNn.js";import{I as je,b as be,a as oe,c as ce,d as dt,i as ut,e as ye,s as ht,f as mt,g as pt,h as gt,j as ft,k as se,l as I,m as Ce,n as Me,o as _e,p as $e,q as xt,r as vt,t as jt,u as bt}from"./calendar-5uQg0jf8.js";import{c as yt}from"./supabase-CC_a39Rq.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))a(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const u of i.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&a(u)}).observe(document,{childList:!0,subtree:!0});function s(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function a(r){if(r.ep)return;r.ep=!0;const i=s(r);fetch(r.href,i)}})();var Ue={exports:{}},ge={};/** 2 * @license React 3 * react-jsx-runtime.production.min.js 4 * 5 * Copyright (c) Facebook, Inc. and its affiliates. 6 * 7 * This source code is licensed under the MIT license found in the 8 * LICENSE file in the root directory of this source tree. 9 */var Nt=h,wt=Symbol.for("react.element"),St=Symbol.for("react.fragment"),kt=Object.prototype.hasOwnProperty,Et=Nt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Ct={key:!0,ref:!0,__self:!0,__source:!0};function Je(n,t,s){var a,r={},i=null,u=null;s!==void 0&&(i=""+s),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(u=t.ref);for(a in t)kt.call(t,a)&&!Ct.hasOwnProperty(a)&&(r[a]=t[a]);if(n&&n.defaultProps)for(a in t=n.defaultProps,t)r[a]===void 0&&(r[a]=t[a]);return{$$typeof:wt,type:n,key:i,ref:u,props:r,_owner:Et.current}}ge.Fragment=St;ge.jsx=Je;ge.jsxs=Je;Ue.exports=ge;var e=Ue.exports,Ne={},De=lt;Ne.createRoot=De.createRoot,Ne.hydrateRoot=De.hydrateRoot;/** 10 * @license lucide-react v0.544.0 - ISC 11 * 12 * This source code is licensed under the ISC license. 13 * See the LICENSE file in the root directory of this source tree. 14 */const Mt=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_t=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,s,a)=>a?a.toUpperCase():s.toLowerCase()),Te=n=>{const t=_t(n);return t.charAt(0).toUpperCase()+t.slice(1)},Be=(...n)=>n.filter((t,s,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===s).join(" ").trim(),$t=n=>{for(const t in n)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/** 15 * @license lucide-react v0.544.0 - ISC 16 * 17 * This source code is licensed under the ISC license. 18 * See the LICENSE file in the root directory of this source tree. 19 */var Dt={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** 20 * @license lucide-react v0.544.0 - ISC 21 * 22 * This source code is licensed under the ISC license. 23 * See the LICENSE file in the root directory of this source tree. 24 */const Tt=h.forwardRef(({color:n="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:a,className:r="",children:i,iconNode:u,...f},l)=>h.createElement("svg",{ref:l,...Dt,width:t,height:t,stroke:n,strokeWidth:a?Number(s)*24/Number(t):s,className:Be("lucide",r),...!i&&!$t(f)&&{"aria-hidden":"true"},...f},[...u.map(([c,x])=>h.createElement(c,x)),...Array.isArray(i)?i:[i]]));/** 25 * @license lucide-react v0.544.0 - ISC 26 * 27 * This source code is licensed under the ISC license. 28 * See the LICENSE file in the root directory of this source tree. 29 */const O=(n,t)=>{const s=h.forwardRef(({className:a,...r},i)=>h.createElement(Tt,{ref:i,iconNode:t,className:Be(`lucide-${Mt(Te(n))}`,`lucide-${n}`,a),...r}));return s.displayName=Te(n),s};/** 30 * @license lucide-react v0.544.0 - ISC 31 * 32 * This source code is licensed under the ISC license. 33 * See the LICENSE file in the root directory of this source tree. 34 */const It=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],Ie=O("calendar-days",It);/** 35 * @license lucide-react v0.544.0 - ISC 36 * 37 * This source code is licensed under the ISC license. 38 * See the LICENSE file in the root directory of this source tree. 39 */const Pt=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],Z=O("calendar",Pt);/** 40 * @license lucide-react v0.544.0 - ISC 41 * 42 * This source code is licensed under the ISC license. 43 * See the LICENSE file in the root directory of this source tree. 44 */const Lt=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],zt=O("chevron-down",Lt);/** 45 * @license lucide-react v0.544.0 - ISC 46 * 47 * This source code is licensed under the ISC license. 48 * See the LICENSE file in the root directory of this source tree. 49 */const Rt=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],At=O("chevron-left",Rt);/** 50 * @license lucide-react v0.544.0 - ISC 51 * 52 * This source code is licensed under the ISC license. 53 * See the LICENSE file in the root directory of this source tree. 54 */const Ot=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ht=O("chevron-right",Ot);/** 55 * @license lucide-react v0.544.0 - ISC 56 * 57 * This source code is licensed under the ISC license. 58 * See the LICENSE file in the root directory of this source tree. 59 */const Wt=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],qt=O("chevron-up",Wt);/** 60 * @license lucide-react v0.544.0 - ISC 61 * 62 * This source code is licensed under the ISC license. 63 * See the LICENSE file in the root directory of this source tree. 64 */const Vt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Ft=O("circle-question-mark",Vt);/** 65 * @license lucide-react v0.544.0 - ISC 66 * 67 * This source code is licensed under the ISC license. 68 * See the LICENSE file in the root directory of this source tree. 69 */const Ut=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Pe=O("download",Ut);/** 70 * @license lucide-react v0.544.0 - ISC 71 * 72 * This source code is licensed under the ISC license. 73 * See the LICENSE file in the root directory of this source tree. 74 */const Jt=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Qe=O("external-link",Jt);/** 75 * @license lucide-react v0.544.0 - ISC 76 * 77 * This source code is licensed under the ISC license. 78 * See the LICENSE file in the root directory of this source tree. 79 */const Bt=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Qt=O("file-text",Bt);/** 80 * @license lucide-react v0.544.0 - ISC 81 * 82 * This source code is licensed under the ISC license. 83 * See the LICENSE file in the root directory of this source tree. 84 */const Gt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Yt=O("info",Gt);/** 85 * @license lucide-react v0.544.0 - ISC 86 * 87 * This source code is licensed under the ISC license. 88 * See the LICENSE file in the root directory of this source tree. 89 */const Zt=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],Xt=O("list",Zt);/** 90 * @license lucide-react v0.544.0 - ISC 91 * 92 * This source code is licensed under the ISC license. 93 * See the LICENSE file in the root directory of this source tree. 94 */const Kt=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],Ge=O("map-pin",Kt);/** 95 * @license lucide-react v0.544.0 - ISC 96 * 97 * This source code is licensed under the ISC license. 98 * See the LICENSE file in the root directory of this source tree. 99 */const es=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7
99a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]],ts=O("pin",es);/** 100 * @license lucide-react v0.544.0 - ISC 101 * 102 * This source code is licensed under the ISC license. 103 * See the LICENSE file in the root directory of this source tree. 104 */const ss=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Le=O("refresh-cw",ss);/** 105 * @license lucide-react v0.544.0 - ISC 106 * 107 * This source code is licensed under the ISC license. 108 * See the LICENSE file in the root directory of this source tree. 109 */const ns=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],de=O("search",ns);/** 110 * @license lucide-react v0.544.0 - ISC 111 * 112 * This source code is licensed under the ISC license. 113 * See the LICENSE file in the root directory of this source tree. 114 */const rs=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ye=O("x",rs);/** 115 * @license lucide-react v0.544.0 - ISC 116 * 117 * This source code is licensed under the ISC license. 118 * See the LICENSE file in the root directory of this source tree. 119 */const as=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],is=O("zap",as),Y=["#ff6b6b","#4ecdc4","#45b7d1","#f39c12","#9b59b6","#e74c3c","#2ecc71","#f1c40f","#e67e22","#1abc9c","#3498db","#e91e63","#795548","#607d8b","#ff9800"],ne={icloud:{id:"icloud",name:"Calendrier Personnel",color:Y[0],source:"icloud"},outlook:{id:"outlook",name:"Calendrier UCLouvain",color:Y[1],source:"outlook"},cours:{id:"cours",name:"Cours",color:Y[2],source:"outlook"},examens:{id:"examens",name:"Examens",color:Y[3],source:"outlook"},reunions:{id:"reunions",name:"Réunions",color:Y[4],source:"outlook"},evenements:{id:"evenements",name:"Ãvénements",color:Y[5],source:"outlook"}};function os(n,t="",s){if(s==="icloud")return ne.icloud;const a=n.toLowerCase(),r=t.toLowerCase(),i=`${a} ${r}`;return i.includes("cours")||i.includes("lecture")||i.includes("séminaire")||i.includes("tp")||i.includes("td")||i.includes("labo")?ne.cours:i.includes("examen")||i.includes("test")||i.includes("évaluation")||i.includes("contrôle")||i.includes("partiel")?ne.examens:i.includes("réunion")||i.includes("meeting")||i.includes("rendez-vous")||i.includes("entretien")||i.includes("rdv")?ne.reunions:i.includes("événement")||i.includes("conférence")||i.includes("colloque")||i.includes("symposium")||i.includes("workshop")||i.includes("atelier")?ne.evenements:ne.outlook}const cs={"de duve":"#8e44ad"},ze=["#e74c3c","#3498db","#2ecc71","#f39c12","#9b59b6","#1abc9c","#e67e22","#f1c40f","#e91e63","#795548","#607d8b","#ff9800","#673ab7","#009688","#ff5722"];function ls(n){const t=n.match(/\[([^\]]+)\]/);return t?t[1].toLowerCase().trim():null}function ds(n){let t=0;for(let a=0;a<n.length;a++){const r=n.charCodeAt(a);t=(t<<5)-t+r,t=t&t}const s=Math.abs(t)%ze.length;return ze[s]}function us(n,t){const s=n.toLowerCase();for(const[u,f]of Object.entries(cs))if(s.includes(u))return f;const a=ls(n);if(a)return ds(a);let r=0;for(let u=0;u<n.length;u++){const f=n.charCodeAt(u);r=(r<<5)-r+f,r=r&r}const i=Math.abs(r)%Y.length;return Y[i]}function Re(n,t="",s){const a=os(n,t,s),r=us(n);return{...a,color:r}}const Ae=(n,t="")=>{const s=n.toLowerCase(),a=t.toLowerCase(),r=`${s} ${a}`;return[/^(busy|occupé|indisponible)$/i,/^(free|libre|disponible)$/i,/^(tentative|provisoire)$/i,/^(pause|break|lunch|déjeuner)$/i,/^(meeting|réunion)\s*$/i,/maintenance/i,/test\s*$/i,/^(privé|private|personnel|personal)$/i,/^(blocked|bloqué|block)$/i,/^(no meeting|pas de réunion)$/i].some(u=>u.test(r))};class Oe{static async fetchAndParse(t,s){try{const a=[`https://corsproxy.io/?${encodeURIComponent(t)}`,`https://api.codetabs.com/v1/proxy?quest=${encodeURIComponent(t)}`,`https://thingproxy.freeboard.io/fetch/${t}`,`https://api.allorigins.win/raw?url=${encodeURIComponent(t)}`,t];let r="",i=null;for(let p=0;p<a.length;p++){const o=a[p];try{console.log(`ð Tentative ${p+1}/${a.length} pour ${s}:`,o.includes("corsproxy")?"corsproxy.io":o.includes("codetabs")?"codetabs.com":o.includes("thingproxy")?"thingproxy":o.includes("allorigins")?"allorigins.win":"direct");
119const d=p<2?8e3:15e3,v=new AbortController,S=setTimeout(()=>v.abort(),d),j=await fetch(o,{headers:o===t?{Accept:"text/calendar,text/plain,*/*"}:void 0,signal:v.signal,mode:"cors"});if(clearTimeout(S),j.ok){r=await j.text(),console.log(`â
Succès avec ${o.includes("corsproxy")?"corsproxy.io":o.includes("codetabs")?"codetabs.com":o.includes("thingproxy")?"thingproxy":o.includes("allorigins")?"allorigins.win":"direct"} pour ${s}`);break}else console.warn(`â ï¸ Ãchec HTTP ${j.status} avec proxy ${p+1}`)}catch(d){console.warn(`â ï¸ Erreur avec proxy ${p+1}:`,d instanceof Error?d.message:d),i=d;continue}}if(!r)throw i||new Error("Tous les proxies ont échoué");const u=je.parse(r),l=new je.Component(u).getAllSubcomponents("vevent"),c=[],x=new Date,y=new Date(x.getFullYear(),x.getMonth()-6,1),g=new Date(x.getFullYear()+1,x.getMonth(),0);for(const p of l)try{const o=new je.Event(p);if(o.isRecurring()){const d=o.iterator();let v,S=0;const D=500;for(;(v=d.next())&&S<D;){const j=v.toJSDate();if(j>g)break;if(j>=y){const W=o.getOccurrenceDetails(v).endDate.toJSDate(),F=o.summary||"Sans titre",R=o.description||"";if(Ae(F,R))continue;const L=Re(F,R,s),A=p.getFirstPropertyValue("url")??void 0;c.push({id:`${o.uid}_${v.toString()}`,title:F,start:j,end:W,description:R,location:o.location||"",source:s,allDay:o.startDate.isDate,category:L,color:L.color,eventUrl:typeof A=="string"&&A.startsWith("http")?A:void 0})}S++}}else{const d=o.startDate.toJSDate(),v=o.endDate?o.endDate.toJSDate():d;if(v>=y&&d<=g){const S=o.summary||"Sans titre",D=o.description||"";if(Ae(S,D))continue;const j=Re(S,D,s),H=p.getFirstPropertyValue("url")??void 0;c.push({id:o.uid,title:S,start:d,end:v,description:D,location:o.location||"",source:s,allDay:o.startDate.isDate,category:j,color:j.color,eventUrl:typeof H=="string"&&H.startsWith("http")?H:void 0})}}}catch(o){console.warn(`â ï¸ Error parsing event in ${s}:`,o)}return c.sort((p,o)=>p.start.getTime()-o.start.getTime()),c}catch(a){return console.error(`â Error fetching ${s} calendar:`,a),[]}}}var hs={lessThanXSeconds:{one:"moins dâune seconde",other:"moins de {{count}} secondes"},xSeconds:{one:"1 seconde",other:"{{count}} secondes"},halfAMinute:"30 secondes",lessThanXMinutes:{one:"moins dâune minute",other:"moins de {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"environ 1 heure",other:"environ {{count}} heures"},xHours:{one:"1 heure",other:"{{count}} heures"},xDays:{one:"1 jour",other:"{{count}} jours"},aboutXWeeks:{one:"environ 1 semaine",other:"environ {{count}} semaines"},xWeeks:{one:"1 semaine",other:"{{count}} semaines"},aboutXMonths:{one:"environ 1 mois",other:"environ {{count}} mois"},xMonths:{one:"1 mois",other:"{{count}} mois"},aboutXYears:{one:"environ 1 an",other:"environ {{count}} ans"},xYears:{one:"1 an",other:"{{count}} ans"},overXYears:{one:"plus dâun an",other:"plus de {{count}} ans"},almostXYears:{one:"presquâun an",other:"presque {{count}} ans"}},ms=function(t,s,a){var r,i=hs[t];return typeof i=="string"?r=i:s===1?r=i.one:r=i.other.replace("{{count}}",String(s)),a!=null&&a.addSuffix?a.comparison&&a.comparison>0?"dans "+r:"il y a "+r:r},ps={full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd/MM/y"},gs={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},fs={full:"{{date}} 'à ' {{time}}",long:"{{date}} 'à ' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},xs={date:be({formats:ps,defaultWidth:"full"}),time:be({formats:gs,defaultWidth:"full"}),dateTime:be({formats:fs,defaultWidth:"full"})},vs={lastWeek:"eeee 'dernier à ' p",yesterday:"'hier à ' p",today:"'aujourdâhui à ' p",tomorrow:"'demain à ' p'",nextWeek:"eeee 'prochain à ' p",other:"P"},js=function(t,s,a,r){return vs[t]},bs={narrow:["av. J.-C","ap. J.-C"],abbreviated:["av. J.-C","ap. J.-C"],wide:["avant Jésus-Christ","après Jésus-Christ"]},ys={narrow:["T1","T2","T3","T4"],abbreviated:["1er trim.","2ème trim.","3ème trim.","4ème trim."],wide:["1er trimestre","2ème trimestre","3ème trimestre","4ème trimestre"]},Ns={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],wide:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"]},ws={narrow:["D","L","M","M","J","V","S"],short:["di","lu","ma","me","je","ve","sa"],abbreviated:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],wide:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"]},Ss={narrow:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"mat.",afternoon:"ap.m.",evening:"soir",night:"mat."},abbreviated:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"matin",afternoon:"après-midi",evening:"soir",night:"matin"},wide:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"du matin",afternoon:"de lâaprès-midi",evening:"du soir",night:"du matin"}},ks=function(t,s){var a=Number(t),r=s==null?void 0:s.unit;if(a===0)return"0";var i=["year","week","hour","minute","second"],u;return a===1?u=r&&i.includes(r)?"ère":"er":u="ème",a+u},Es={ordinalNumber:ks,era:oe({values:bs,defaultWidth:"wide"}),quarter:oe({values:ys,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:oe({values:Ns,defaultWidth:"wide"}),day:oe({values:ws,defaultWidth:"wide"}),dayPeriod:oe({values:Ss,defaultWidth:"wide"})},Cs=/^(\d+)(ième|ère|ème|er|e)?/i,Ms=/\d+/i,_s={narrow:/^(av\.J\.C|ap\.J\.C|ap\.J\.-C)/i,abbreviated:/^(av\.J\.-C|av\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,wide:/^(avant Jésus-Christ|après Jésus-Christ)/i},$s={any:[/^av/i,/^ap/i]},Ds={narrow:/^T?[1234]/i,abbreviated:/^[1234](er|ème|e)? trim\.?/i,wide:/^[1234](er|ème|e)? trimestre/i},Ts={any:[/1/i,/2/i,/3/i,/4/i]},Is={narrow:/^[jfmasond]/i,abbreviated:/^(janv|févr|mars|avr|mai|juin|juill|juil|août|sept|oct|nov|déc)\.?/i,wide:/^(janv
119ier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i},Ps={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^av/i,/^ma/i,/^juin/i,/^juil/i,/^ao/i,/^s/i,/^o/i,/^n/i,/^d/i]},Ls={narrow:/^[lmjvsd]/i,short:/^(di|lu|ma|me|je|ve|sa)/i,abbreviated:/^(dim|lun|mar|mer|jeu|ven|sam)\.?/i,wide:/^(dimanche|lundi|mardi|mercredi|jeudi|vendredi|samedi)/i},zs={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^di/i,/^lu/i,/^ma/i,/^me/i,/^je/i,/^ve/i,/^sa/i]},Rs={narrow:/^(a|p|minuit|midi|mat\.?|ap\.?m\.?|soir|nuit)/i,any:/^([ap]\.?\s?m\.?|du matin|de l'après[-\s]midi|du soir|de la nuit)/i},As={any:{am:/^a/i,pm:/^p/i,midnight:/^min/i,noon:/^mid/i,morning:/mat/i,afternoon:/ap/i,evening:/soir/i,night:/nuit/i}},Os={ordinalNumber:dt({matchPattern:Cs,parsePattern:Ms,valueCallback:function(t){return parseInt(t)}}),era:ce({matchPatterns:_s,defaultMatchWidth:"wide",parsePatterns:$s,defaultParseWidth:"any"}),quarter:ce({matchPatterns:Ds,defaultMatchWidth:"wide",parsePatterns:Ts,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:ce({matchPatterns:Is,defaultMatchWidth:"wide",parsePatterns:Ps,defaultParseWidth:"any"}),day:ce({matchPatterns:Ls,defaultMatchWidth:"wide",parsePatterns:zs,defaultParseWidth:"any"}),dayPeriod:ce({matchPatterns:Rs,defaultMatchWidth:"any",parsePatterns:As,defaultParseWidth:"any"})},Q={code:"fr",formatDistance:ms,formatLong:xs,formatRelative:js,localize:Es,match:Os,options:{weekStartsOn:1,firstWeekContainsDate:4}};const Hs="https://rslrjzlceadedjnzscre.supabase.co",Ws="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InJzbHJqemxjZWFkZWRqbnpzY3JlIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NTgxMjY5MTYsImV4cCI6MjA3MzcwMjkxNn0.XuFhPUvjZjEH2gKzSBGAs-CW0C1ckp5VsPNyMAz-SVc",B=yt(Hs,Ws),he=async n=>{try{const{data:t,error:s}=await B.from("calendar_syncs").upsert(n,{onConflict:"source_name",ignoreDuplicates:!1}).select();return s?s.code==="PGRST205"?(console.warn("Table calendar_syncs non trouvée, synchronisation ignorée"),null):(console.error("Erreur lors de la synchronisation du statut:",s),null):t}catch(t){return console.warn("Supabase non disponible, synchronisation ignorée:",t),null}},He=async n=>{try{await B.from("event_cache").delete().neq("id",0);const{data:t,error:s}=await B.from("event_cache").insert(n).select();return s?s.code==="PGRST205"?(console.warn("Table event_cache non trouvée, mise en cache ignorée"),null):(console.error("Erreur lors de la mise en cache des événements:",s),null):t}catch(t){return console.warn("Supabase non disponible, mise en cache ignorée:",t),null}},qs=async()=>{try{const{data:n,error:t}=await B.from("event_cache").select("*").order("start_date",{ascending:!0});return t?t.code==="PGRST205"?(console.warn("Table event_cache non trouvée, aucun cache disponible"),[]):(console.error("Erreur lors de la récupération des événements en cache:",t),[]):n||[]}catch(n){return console.warn("Supabase non disponible, aucun cache disponible:",n),[]}},Vs=async()=>{try{const{error:n}=await B.from("event_cache").delete().neq("id",0);return n&&n.code!=="PGRST205"?(console.error("Erreur lors de la suppression du cache:",n),!1):!0}catch(n){return console.warn("Supabase non disponible, impossible de vider le cache:",n),!1}},Fs=[{view:"month",title:"Mois",icon:"month"},{view:"agenda",title:"Agenda",icon:"agenda"}],Us=({view:n})=>n==="month"?e.jsx(Z,{size:18,"aria-hidden":!0}):n==="agenda"?e.jsx(Xt,{size:18,"aria-hidden":!0}):e.jsx(Z,{size:18,"aria-hidden":!0}),We=({currentView:n,onViewChange:t})=>e.jsx("div",{className:"view-selector",children:e.jsx("div",{className:"view-buttons",children:Fs.map(s=>e.jsxs("button",{className:`view-button ${n===s.view?"active":""}`,onClick:()=>t(s.view),title:s.title,children:[e.jsx("span",{className:"view-icon",children:e.jsx(Us,{view:s.view})}),e.jsx("span",{className:"view-label",children:s.title})]},s.view))})}),qe=n=>{const t=n.replace("#",""),s=parseInt(t.substring(0,2),16),a=parseInt(t.substring(2,4),16),r=parseInt(t.substring(4,6),16);return .299*s+.587*a+.114*r},pe=(n,t=.8)=>{const s=n.replace("#",""),a=Math.floor(parseInt(s.substring(0,2),16)*t),r=Math.floor(parseInt(s.substring(2,4),16)*t),i=Math.floor(parseInt(s.substring(4,6),16)*t);return`#${a.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}`},Js=n=>{const t=qe(n);if(t>120)return pe(n,.3);if(t>80)return pe(n,.5);{const s=pe(n,.8);return qe(s)<80?s:"#2d3748"}},Ve=({currentDate:n,events:t,onEventClick:s,onEventHover:a,onEventLeave:r,isEventHighlighted:i=()=>!1,onExportToGoogle:u,onExportToOutlook:f,onExportToICS:l,sourceLegend:c=[],onMoreEventsClick:x})=>{const y=()=>{const o=ht(n),d=mt(n),v=pt(o,{weekStartsOn:1}
119),S=gt(d,{weekStartsOn:1});return ft({start:v,end:S})},g=o=>t.filter(d=>se(d.start,o)),p=y();return e.jsxs("div",{className:"month-view",children:[e.jsxs("div",{className:"calendar-grid",children:[e.jsx("div",{className:"calendar-weekdays",children:["Lun","Mar","Mer","Jeu","Ven","Sam","Dim"].map(o=>e.jsx("div",{className:"weekday",children:o},o))}),e.jsx("div",{className:"calendar-days",children:p.map((o,d)=>{const v=g(o),S=ut(o,n),D=ye(o);return e.jsxs("div",{className:`calendar-day ${S?"":"other-month"} ${D?"today":""}`,children:[e.jsx("div",{className:"day-number",children:o.getDate()}),e.jsxs("div",{className:"day-events",children:[v.slice(0,2).map((j,H)=>{const W=window.innerWidth>1400?15:window.innerWidth>1200?12:8,F=j.title.length>W?`${j.title.substring(0,W-3)}...`:j.title,R=i(j.id);return e.jsxs("div",{className:`event-item ${j.source} ${R?"highlighted":""}`,style:{backgroundColor:j.color,color:"#ffffff",borderColor:pe(j.color,.6),borderWidth:R?"3px":"2px",borderStyle:"solid",boxShadow:R?"0 0 0 2px rgba(0, 61, 122, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2)":"0 2px 6px rgba(0, 0, 0, 0.2)",transform:R?"scale(1.02)":"scale(1)",zIndex:R?10:1,fontWeight:"600",textShadow:"0 1px 2px rgba(0, 0, 0, 0.5)"},onClick:()=>s(j),onMouseEnter:L=>a(L,j),onMouseLeave:r,title:j.title,children:[R&&e.jsx("span",{className:"highlight-indicator",children:"ð"}),F]},`${j.id}-${j.start.getTime()}-${H}`)}),v.length>2&&e.jsxs("button",{type:"button",className:"event-item more-events more-events-btn",style:{background:"linear-gradient(135deg, #6c757d, #495057)",color:"#fff",fontSize:"9px",fontWeight:"600",textAlign:"center"},title:`Voir les ${v.length} événements de ce jour`,onClick:j=>{j.stopPropagation(),x==null||x(o,v)},children:["+",v.length-2," autres"]})]})]},`${o.getFullYear()}-${o.getMonth()}-${o.getDate()}`)})})]}),c.length>0&&e.jsx("div",{className:"month-view-legend",role:"group","aria-label":"Légende des sources",children:c.map(({name:o,color:d})=>e.jsxs("span",{className:"month-view-legend-item",children:[e.jsx("span",{className:"month-view-legend-dot",style:{backgroundColor:d},"aria-hidden":!0}),e.jsx("span",{children:o})]},o))})]})};class Ze{static formatText(t,s={}){if(!t||typeof t!="string")return"";const a={...this.DEFAULT_OPTIONS,...s};let r=t;return r=this.processBoldMarkers(r,a.boldMarker),r=this.processItalicMarkers(r,a.italicMarker),r=this.processUnderlineMarkers(r,a.underlineMarker),r=this.processLineBreakMarkers(r,a.lineBreakMarker),r=this.processSeparatorMarkers(r,a.separatorMarker),r}static processBoldMarkers(t,s){const a=this.escapeRegexChars(s),r=new RegExp(`${a}([^${a}]+?)${a}`,"g");return t.replace(r,'<strong class="custom-bold">$1</strong>')}static processItalicMarkers(t,s){const a=this.escapeRegexChars(s),r=new RegExp(`${a}([^${a}]+?)${a}`,"g");return t.replace(r,'<em class="custom-italic">$1</em>')}static processUnderlineMarkers(t,s){const a=this.escapeRegexChars(s),r=new RegExp(`${a}([^${a}]+?)${a}`,"g");return t.replace(r,'<u class="custom-underline">$1</u>')}static processLineBreakMarkers(t,s){const a=this.escapeRegexChars(s),r=new RegExp(a,"g");return t.replace(r,'<br class="custom-break">')}static processSeparatorMarkers(t,s){const a=this.escapeRegexChars(s),r=new RegExp(`(^|\\n)\\s*${a}\\s*(?=\\n|$)`,"gm");return t.replace(r,'$1<hr class="custom-separator">')}static escapeRegexChars(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}static getMarkersGuide(){return` 120Marqueurs de formatage disponibles : 121⢠+++texte+++ â texte en gras 122⢠___texte___ â texte en italique 123⢠~~~texte~~~ â texte souligné 124⢠||| â retour à la ligne 125⢠=== â ligne de séparation 126 127Exemples : 128+++Important+++ : Inscription obligatoire 129___Lieu___ : Salle A.123 130~~~Attention~~~ : Places limitées 131||| 132Première ligne|||Deuxième ligne 133=== 134Section suivante 135 `.trim()}static processEventDescription(t){if(!t)return"";let s=this.formatText(t);return s=s.replace(/\n\s*\n(?![^<]*>)/g,"</p><p>").replace(/\n(?![^<]*>)/g,"<br>").replace(/(<br>)?[\s]*\*\s+(?![^<]*>)/g,"<br>⢠").replace(/(<br>)?[\s]*-\s+(?![^<]*>)/g,"<br>⢠").replace(/(<br>)?[\s]*â¢\s+(?![^<]*>)/g,"<br>⢠").replace(/(<br>
135\s*){3,}(?!class="custom-break")/g,"<br><br>"),!s.includes("<p>")&&!s.includes("<hr")?s=`<p>${s}</p>`:s.includes("<p>")||(s=s.split(/(<hr[^>]*>)/).map(r=>r.includes("<hr")?r:r.trim()?`<p>${r.trim()}</p>`:"").filter(Boolean).join("")),s}}J(Ze,"DEFAULT_OPTIONS",{boldMarker:"+++",italicMarker:"___",underlineMarker:"~~~",lineBreakMarker:"|||",separatorMarker:"==="});const Xe=Ze,Bs=({description:n,className:t=""})=>{const s=X.useMemo(()=>n?Xe.processEventDescription(n):"",[n]);return!n||!n.trim()?null:e.jsx("div",{className:`event-description-formatted ${t}`,dangerouslySetInnerHTML:{__html:s}})},Qs=({events:n,onEventClick:t,onEventHover:s,onEventLeave:a,isEventHighlighted:r=()=>!1,selectedEventId:i,onExportToGoogle:u,onExportToOutlook:f,onExportToICS:l})=>{const[c,x]=h.useState("all"),[y,g]=h.useState(!1),[p,o]=h.useState(new Set),[d,v]=h.useState(0),S=20,D=h.useRef(null),j=E=>{const M=new Set(p);M.has(E)?M.delete(E):M.add(E),o(M)},H=()=>{let E=[...n];const M=new Date;if(c!=="all"){const P=parseInt(c),N=y?Ce(M,-P):Me(M),ee=Ce(M,P);E=E.filter(U=>{const G=Me(U.start),te=_e(G,N)||se(G,N),q=$e(G,ee)||se(G,ee);return te&&q})}else y||(E=E.filter(P=>_e(P.start,M)||se(P.start,M)));return E.sort((P,N)=>P.start.getTime()-N.start.getTime())},W=E=>E.reduce((M,P)=>{const N=I(P.start,"yyyy-MM-dd");return M[N]||(M[N]=[]),M[N].push(P),M},{}),F=H(),R=F.length,L=Math.ceil(R/S),A=F.slice(d*S,(d+1)*S),K=W(A),ue=Object.keys(K).sort();h.useEffect(()=>{i&&D.current&&D.current.scrollIntoView({behavior:"smooth",block:"center"})},[i]),h.useEffect(()=>{v(0)},[c,y,n.length]);const fe=E=>se(E.start,new Date),xe=E=>$e(E.start,new Date);return e.jsxs("div",{className:"agenda-view",children:[e.jsxs("div",{className:"agenda-controls",children:[e.jsxs("div",{className:"agenda-filters",children:[e.jsxs("div",{className:"agenda-filter-chips",children:[e.jsx("span",{className:"agenda-filter-label",children:"Période :"}),[{value:"7",label:"7 j"},{value:"30",label:"30 j"},{value:"60",label:"60 j"},{value:"90",label:"90 j"},{value:"all",label:"Tous"}].map(({value:E,label:M})=>e.jsx("button",{type:"button",className:`agenda-chip ${c===E?"active":""}`,onClick:()=>x(E),children:M},E))]}),e.jsx("div",{className:"past-events-toggle",children:e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:y,onChange:E=>g(E.target.checked)}),"Inclure les événements passés"]})})]}),e.jsxs("div",{className:"agenda-summary",children:[e.jsxs("div",{className:"summary-stats",children:[e.jsxs("div",{className:"total-events-container",children:[e.jsx("span",{className:"total-events-number",children:R}),e.jsxs("span",{className:"total-events-label",children:["événement",R>1?"s":""," trouvé",R>1?"s":""]})]}),L>1&&e.jsxs("div",{className:"pagination-info",children:[e.jsxs("span",{className:"page-info",children:["Page ",d+1," sur ",L]}),e.jsxs("span",{className:"events-range",children:["(",d*S+1,"-",Math.min((d+1)*S,R),")"]})]})]}),L>1&&e.jsxs("div",{className:"agenda-pagination",children:[e.jsx("button",{className:"nav-button",onClick:()=>v(E=>Math.max(0,E-1)),disabled:d===0,children:"â Précédent"}),e.jsx("span",{className:"page-numbers",children:Array.from({length:Math.min(5,L)},(E,M)=>{let P;return L<=5||d<3?P=M:d>L-4?P=L-5+M:P=d-2+M,e.jsx("button",{className:`page-number ${d===P?"active":""}`,onClick:()=>v(P),children:P+1},P)})}),e.jsx("button",{className:"nav-button",onClick:()=>v(E=>Math.min(L-1,E+1)),disabled:d===L-1,children:"Suivant â"})]})]})]}),e.jsx("div",{className:"agenda-list",children:ue.length===0?e.jsx("div",{className:"no-events",children:e.jsx("p",{children:"Aucun événement trouvé pour cette période"})}):ue.map(E=>{const M=K[E],P=new Date(E);return e.jsxs("div",{className:"agenda-day-group",children:[e.jsxs("div",{className:"agenda-date-header",children:[e.jsxs("div",{className:"date-info",children:[e.jsx("h3",{className:"date-title",children:I(P,"EEEE d MMMM yyyy",{locale:Q})}),se(P,new Date)&&e.jsx("span",{className:"today-badge",children:"Aujourd'hui"})]}),e.jsxs("div",{className:"events-count-container",children:[e.jsx("span",{className:"events-count",children:M.length}),e.jsxs("span",{className:"events-label",children:["événement",M.length>
1351?"s":""]})]})]}),e.jsx("div",{className:"agenda-events",children:M.map((N,ee)=>{const U=p.has(N.id),G=N.description||N.location,te=r(N.id),q=i===N.id;return e.jsxs("div",{ref:q?D:void 0,className:`agenda-event-card ${N.source} ${fe(N)?"today":""} ${xe(N)?"past":""} ${te?"highlighted":""} ${q?"selected":""}`,style:{borderLeftColor:N.color,borderLeftWidth:te||q?"4px":"3px"},children:[e.jsxs("div",{className:"agenda-event-header",onMouseEnter:V=>s(V,N),onMouseLeave:a,onClick:()=>{t(N)},children:[e.jsxs("div",{className:"event-time-indicator",children:[e.jsx("div",{className:"time-dot",style:{backgroundColor:N.color}}),e.jsx("div",{className:"event-time",children:N.allDay?"Toute la journée":`${I(N.start,"HH:mm")} - ${I(N.end,"HH:mm")}`})]}),e.jsx("div",{className:"event-main-info",children:e.jsxs("h4",{className:"event-title",style:{color:Js(N.color)},children:[te&&e.jsx(de,{size:14,className:"search-indicator","aria-hidden":!0}),N.title]})}),e.jsxs("div",{className:"event-actions-header",children:[G&&e.jsx("button",{className:`expand-button ${U?"expanded":""}`,onClick:V=>{V.stopPropagation(),j(N.id)},"aria-label":U?"Réduire les détails":"Voir les détails",children:U?e.jsx(qt,{size:18,"aria-hidden":!0}):e.jsx(zt,{size:18,"aria-hidden":!0})}),e.jsx("button",{className:"btn-view-modal",onClick:V=>{V.stopPropagation(),t(N)},title:"Ouvrir dans une fenêtre","aria-label":"Voir les détails",children:e.jsx(de,{size:18,"aria-hidden":!0})})]})]}),G&&U&&e.jsxs("div",{className:"agenda-event-details",children:[N.location&&e.jsx("div",{className:"event-detail-item",children:e.jsx("span",{className:"detail-text",children:N.location})}),N.description&&e.jsx("div",{className:"event-detail-item",children:e.jsx("div",{className:"detail-text",children:e.jsx(Bs,{description:N.description,className:"event-description-full"})})}),e.jsxs("div",{className:"event-detail-item export-actions",children:[e.jsx("span",{className:"detail-icon",children:"ð¾"}),e.jsx("div",{className:"detail-text",children:e.jsxs("div",{className:"agenda-export-buttons",children:[u&&e.jsx("button",{className:"btn-agenda-export google",onClick:V=>{V.stopPropagation(),u(N)},title:"Ajouter à Google Calendar",children:"ð
"}),f&&e.jsx("button",{className:"btn-agenda-export outlook",onClick:V=>{V.stopPropagation(),f(N)},title:"Ajouter à Outlook",children:"ð"}),l&&e.jsx("button",{className:"btn-agenda-export ics",onClick:V=>{V.stopPropagation(),l(N)},title:"Télécharger fichier ICS",children:"ð¾"})]})})]})]})]},`${N.id}-${ee}`)})})]},E)})})]})},Gs=({events:n})=>{const[t,s]=h.useState(new Date);h.useEffect(()=>{const l=setInterval(()=>{s(new Date)},6e4);return()=>clearInterval(l)},[]);const r=(()=>{const l=new Date;return n.filter(c=>c.start>=l||c.end>=l&&c.start<=l).sort((c,x)=>c.start.getTime()-x.start.getTime()).slice(0,5)})(),i=l=>{if(ye(l))return"Aujourd'hui";if(xt(l))return"Demain";if(vt(l))return"Hier";{const c=new Date,x=Math.ceil((l.getTime()-c.getTime())/(1e3*60*60*24));return x<=7&&x>0?I(l,"EEEE",{locale:Q}):I(l,"EEEE d MMMM",{locale:Q})}},u=l=>{if(l.allDay)return"Toute la journée";const c=I(l.start,"HH:mm"),x=I(l.end,"HH:mm");return se(l.start,l.end)?`${c} - ${x}`:`${c} - ${I(l.end,"dd/MM HH:mm")}`},f=l=>{const c=new Date;return l.start<=c&&l.end>=c?"current":ye(l.start)?"today":"upcoming"};return e.jsxs("div",{className:"screen-view",children:[e.jsxs("div",{className:"screen-header",children:[e.jsxs("div",{className:"screen-title",children:[e.jsx("h1",{children:"ð
Prochains événements SSS"}),e.jsx("div",{className:"ucl-branding",children:"UCLouvain"})]}),e.jsxs("div",{className:"screen-clock",children:[e.jsx("div",{className:"current-time",children:I(t,"HH:mm")}),e.jsx("div",{className:"current-date",children:I(t,"EEEE d MMMM yyyy",{locale:Q})})]})]}),e.jsx("div",{className:"screen-events",children:r.length===0?e.jsxs("div",{className:"no-events-screen",children:[e.jsx("div",{className:"no-events-icon",children:"ð
"}),e.jsx("div",{className:"no-events-message",children:"Aucun événement à venir"}),e.jsx("div",{className:"no-events-submessage",children:"Consultez le calendrier complet pour plus d'informations"})]}):r.map((l,c)=>{const x=f(l);return e.jsxs("div",{className:`screen-event ${x}`,style:{"--event-color":l.color,"--event-index":c},children:[e.jsxs("div",{className:"event-indicator",children:[e.jsx("div",{className:"event-dot",style:{backgroundColor:l.color}}),e.jsx("div",{className:"event-number",children:c+1})]}),e.jsxs("div",{className:"event-content",children:[e.jsxs("div",{className:"event-datetime",children:[e.jsx("div",{className:"event-date",children:i(l.start)}),e.jsx("div",{className:"event-time",children:u(l)})]}),e.jsxs("div",{className:"event-details",children:[e.jsxs("h2",{className:"event-title",children:[x==="current"&&e.jsx("span",{className:"live-indicator",children:"ð´ EN COURS"}),l.title]}),l.location&&e.jsxs("div",{className:"event-location",children:["ð ",l.location]})]})]}),e.jsx("div",{className:"event-source",children:e.jsx("div",{className:`s
135ource-badge ${l.source}`,children:l.source==="icloud"?"ð iCloud":"ð§ Outlook"})})]},`${l.id}-${c}`)})}),e.jsxs("div",{className:"screen-footer",children:[e.jsxs("div",{className:"footer-info",children:[e.jsx("span",{children:"Mise à jour automatique"}),e.jsx("span",{children:"â¢"}),e.jsxs("span",{children:["Dernière synchronisation : ",I(t,"HH:mm")]})]}),e.jsx("div",{className:"footer-branding",children:"Calendrier SSS - UCLouvain"})]})]})},Ke=n=>{if(!n)return{cleanDescription:"",images:[],hasImages:!1,hadUnavailableAttachments:!1};const t=[];let s=n,a=!1;const r=/<img[^>]+src=["']([^"']+)["'][^>]*(?:alt=["']([^"']*)["'])?[^>]*(?:title=["']([^"']*)["'])?[^>]*>/gi,i=/(https?:\/\/[^\s]+\.(?:jpg|jpeg|png|gif|webp|svg)(?:\?[^\s]*)?)/gi,u=/data:image\/[^;]+;base64,([A-Za-z0-9+/=]+)/gi,f=/\[cid:([^@\]]+)@([^\]]+)\]/gi;let l;for(;(l=r.exec(n))!==null;){const c=l[1],x=l[2]||"",y=l[3]||"";c.toLowerCase().startsWith("cid:")&&(a=!0),t.push({src:c,alt:x,title:y,isBase64:c.startsWith("data:image/"),isUrl:c.startsWith("http")}),s=s.replace(l[0],`[Image: ${x||y||"Image"}]`)}for(r.lastIndex=0;(l=i.exec(n))!==null;){const c=l[1];t.some(x=>x.src===c)||(t.push({src:c,alt:"Image",isBase64:!1,isUrl:!0}),s=s.replace(c,"[Image]"))}for(i.lastIndex=0;(l=u.exec(n))!==null;){const c=l[0];t.push({src:c,alt:"Image intégrée",isBase64:!0,isUrl:!1}),s=s.replace(c,"[Image intégrée]")}for(u.lastIndex=0;(l=f.exec(n))!==null;){const c=l[0];a=!0,s=s.replace(c,"")}return s=s.replace(/<[^>]*>/g,"").replace(/\s+/g," ").trim(),{cleanDescription:s,images:t,hasImages:t.length>0,hadUnavailableAttachments:a}},Ys={maxSize:1e3,ttl:5*60*1e3,cleanupInterval:60*1e3,enableMetrics:!0};class Zs{constructor(t={}){J(this,"cache",{});J(this,"metrics",{cacheHits:0,cacheMisses:0,totalOperations:0,averageProcessingTime:0,lastCleanup:Date.now()});J(this,"config");J(this,"cleanupTimer");this.config={...Ys,...t},this.startCleanupTimer()}generateKey(t,s={}){const a=JSON.stringify(s);return`${t.length}_${this.hashString(t)}_${this.hashString(a)}`}hashString(t){let s=0;if(t.length===0)return s.toString();for(let a=0;a<t.length;a++){const r=t.charCodeAt(a);s=(s<<5)-s+r,s=s&s}return Math.abs(s).toString(36)}get(t,s){const a=performance.now(),r=this.cache[t];if(r&&Date.now()-r.timestamp<this.config.ttl)return r.accessCount++,this.metrics.cacheHits++,this.metrics.totalOperations++,r.result;const i=s(),u=performance.now();this.set(t,i),this.metrics.cacheMisses++,this.metrics.totalOperations++;const f=u-a;return this.metrics.averageProcessingTime=(this.metrics.averageProcessingTime*(this.metrics.totalOperations-1)+f)/this.metrics.totalOperations,i}set(t,s){Object.keys(this.cache).length>=this.config.maxSize&&this.evictOldest(),this.cache[t]={result:s,timestamp:Date.now(),accessCount:1}}memoize(t,s){return(...a)=>{const r=s?s(...a):this.generateKey(JSON.stringify(a));return this.get(r,()=>t(...a))}}evictOldest(){const t=Object.entries(this.cache);if(t.length===0)return;t.sort((a,r)=>{const i=a[1].timestamp-r[1].timestamp;return i!==0?i:a[1].accessCount-r[1].accessCount});const s=Math.max(1,Math.floor(t.length*.25));for(let a=0;a<s;a++)delete this.cache[t[a][0]]}cleanup(){const t=Date.now(),s=[];for(const[a,r]of Object.entries(this.cache))t-r.timestamp>this.config.ttl&&s.push(a);s.forEach(a=>delete this.cache[a]),this.metrics.lastCleanup=t}startCleanupTimer(){this.cleanupTimer&&clearInterval(this.cleanupTimer),this.cleanupTimer=setInterval(()=>{this.cleanup()},this.config.cleanupInterval)}getMetrics(){return{...this.metrics}}getStats(){const t=this.metrics.totalOperations>0?this.metrics.cacheHits/this.metrics.totalOperations:0;return{size:Object.keys(this.cache).length,hitRate:t,metrics:this.getMetrics()}}clear(){this.cache={},this.metrics={cacheHits:0,cacheMisses:0,totalOperations:0,averageProcessingTime:0,lastCleanup:Date.now()}}destroy(){this.cleanupTimer&&(clearInterval(this.cleanupTimer),this.cleanupTimer=void 0),this.clear()}}class Xs{constructor(){J(this,"processingQueue",new Map);J(this,"processedResults",new Map)}async processLazy(t,s,a="normal"){if(this.processedResults.has(t))return this.processedResults.get(t);if(this.processingQueue.has(t))return this.processingQueue.get(t);const r=this.createProcessingPromise(t,s,a);this.processingQueue.set(t,r);try{const i=await r;return this.processedResults.set(t,i),i}finally{this.processingQueue.delete(t)}}async createProcessingPromise(t,s,a){return a==="low"?await new Promise(r=>setTimeout(r,10)):a==="normal"&&await new Promise(r=>setTimeout(r,1)),await s()}async processBatch(t){const s=t.map(a=>this.processLazy(a.key,a.processor,a.priority));return Promise.all(s)}clear(){this.processedResults.clear(),this.processingQueue.clear()}getStats(){return{queueSize:this.processingQueue.size,cacheSize:this.processedResults.size,isProcessing:this.processingQueue.size>0}}}class Ks{constructor(t=150){J(this,"callbacks",new Set);J(this,"timeoutId");J(this,"isListening",!1);this.delay=t}addCallback(t){return this.callbacks.add(t),this.startListening(),(
135)=>{this.callbacks.delete(t),this.callbacks.size===0&&this.stopListening()}}startListening(){if(this.isListening)return;const t=()=>{this.timeoutId&&clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.callbacks.forEach(s=>{try{s()}catch(a){console.error("Error in resize callback:",a)}})},this.delay)};window.addEventListener("resize",t,{passive:!0}),this.isListening=!0}stopListening(){this.isListening&&(window.removeEventListener("resize",this.startListening),this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=void 0),this.isListening=!1)}destroy(){this.callbacks.clear(),this.stopListening()}}const en=new Zs,tn=new Xs,et=new Ks;typeof window<"u"&&window.addEventListener("beforeunload",()=>{en.destroy(),tn.clear(),et.destroy()});const me={title:{mobile:{fontSize:"16px",lineHeight:"1.3",fontWeight:"600"},tablet:{fontSize:"18px",lineHeight:"1.3",fontWeight:"600"},desktop:{fontSize:"20px",lineHeight:"1.3",fontWeight:"600"},tv:{fontSize:"28px",lineHeight:"1.2",fontWeight:"700"}},description:{mobile:{fontSize:"13px",lineHeight:"1.4",fontWeight:"400"},tablet:{fontSize:"14px",lineHeight:"1.5",fontWeight:"400"},desktop:{fontSize:"15px",lineHeight:"1.5",fontWeight:"400"},tv:{fontSize:"18px",lineHeight:"1.4",fontWeight:"400"}},metadata:{mobile:{fontSize:"11px",lineHeight:"1.3",fontWeight:"500"},tablet:{fontSize:"12px",lineHeight:"1.3",fontWeight:"500"},desktop:{fontSize:"13px",lineHeight:"1.3",fontWeight:"500"},tv:{fontSize:"16px",lineHeight:"1.3",fontWeight:"500"}}},re={mobile:768,tablet:1024,desktop:1920},sn=()=>{const[n,t]=h.useState(()=>{if(typeof window>"u")return"desktop";const r=window.innerWidth;return r<re.mobile?"mobile":r<re.tablet?"tablet":r<re.desktop?"desktop":"tv"}),s=h.useCallback(()=>{if(typeof window>"u")return"desktop";const r=window.innerWidth;return r<re.mobile?"mobile":r<re.tablet?"tablet":r<re.desktop?"desktop":"tv"},[]),a=h.useCallback(()=>{const r=s();t(i=>i!==r?r:i)},[s]);return h.useEffect(()=>{let r;try{r=et.addCallback(a)}catch(i){console.warn("Failed to add resize handler:",i),window.addEventListener("resize",a),r=()=>window.removeEventListener("resize",a)}return r},[a]),n},tt=X.forwardRef(({text:n,variant:t,maxLines:s,className:a="",screenSize:r},i)=>{const u=sn(),f=r||u;if(!n||typeof n!="string")return null;const c=(()=>{if(!t||!f)return{fontSize:"14px",lineHeight:"1.4",fontWeight:"400",margin:0,padding:0};if(!me[t]||!me[t][f]){const p=me.description.desktop;return{fontSize:p.fontSize,lineHeight:p.lineHeight,fontWeight:p.fontWeight,margin:0,padding:0}}const y=me[t][f],g={fontSize:y.fontSize,lineHeight:y.lineHeight,fontWeight:y.fontWeight,margin:0,padding:0};return s&&s>0&&(g.display="-webkit-box",g.WebkitLineClamp=s,g.WebkitBoxOrient="vertical",g.overflow="hidden",g.textOverflow="ellipsis"),g})(),x=`responsive-text responsive-text--${t} responsive-text--${f} ${a}`.trim();return e.jsx("div",{ref:i,className:x,style:c,"data-variant":t,"data-screen-size":f,title:s&&n.length>100?n:void 0,children:n})});tt.displayName="ResponsiveText";class nn extends h.Component{constructor(){super(...arguments);
135J(this,"state",{hasError:!1})}static getDerivedStateFromError(s){return{hasError:!0,error:s}}componentDidCatch(s,a){console.error("ErrorBoundary caught an error:",s,a)}render(){return this.state.hasError?this.props.fallback||e.jsxs("div",{className:"error-boundary",children:[e.jsx("h3",{children:"Something went wrong"}),e.jsx("p",{children:"There was an error displaying this content."}),e.jsx("button",{onClick:()=>this.setState({hasError:!1}),children:"Try again"})]}):this.props.children}}const rn=({event:n,isOpen:t,onClose:s,onExportToGoogle:a,onExportToOutlook:r,onExportToICS:i})=>{const u=h.useRef(null),[f,l]=h.useState({canScrollUp:!1,canScrollDown:!1,isScrollable:!1}),c=h.useMemo(()=>n!=null&&n.description?Ke(n.description):null,[n==null?void 0:n.description]),x=h.useMemo(()=>{const o=(c==null?void 0:c.cleanDescription)??(n==null?void 0:n.description);if(!o)return null;let d=o.replace(/<script[^>]*>.*?<\/script>/gis,"").replace(/<style[^>]*>.*?<\/style>/gis,"").replace(/<!--.*?-->/gs,"").replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'");return Xe.processEventDescription(d)},[c==null?void 0:c.cleanDescription,n==null?void 0:n.description]),y=h.useCallback(()=>{const o=u.current;if(!o)return;const{scrollTop:d,scrollHeight:v,clientHeight:S}=o,D=v>S+5,j=d>15,H=d<v-S-15;l(W=>W.canScrollUp===j&&W.canScrollDown===H&&W.isScrollable===D?W:{canScrollUp:j,canScrollDown:H,isScrollable:D})},[]);if(h.useEffect(()=>{if(!t||!x)return;const o=u.current;if(!o)return;const d=setTimeout(()=>{y()},300);let v=null;const S=()=>{v&&clearTimeout(v),v=setTimeout(y,200)};return o.addEventListener("scroll",S,{passive:!0}),()=>{clearTimeout(d),v&&clearTimeout(v),o.removeEventListener("scroll",S)}},[t]),!t||!n||!n.id)return null;const g=o=>{o.target===o.currentTarget&&s()},p=o=>{o.key==="Escape"&&s()};return e.jsx("div",{className:"event-modal-backdrop",onClick:g,onKeyDown:p,tabIndex:-1,children:e.jsxs("div",{className:"event-modal",role:"dialog","aria-labelledby":"event-title","aria-modal":"true",children:[e.jsxs("div",{className:"event-modal-header",children:[e.jsx(nn,{fallback:e.jsx("h2",{className:"event-modal-title",children:n.title}),children:e.jsx(tt,{text:n.title,variant:"title",className:"event-modal-title"})}),e.jsx("button",{className:"event-modal-close",onClick:s,"aria-label":"Fermer les détails de l'événement",children:"â"})]}),e.jsx("div",{className:"event-modal-content",children:e.jsxs("div",{className:"event-modal-details",children:[e.jsxs("div",{className:"event-detail-row",children:[e.jsx("div",{className:"detail-icon",children:e.jsx(Z,{size:20,"aria-hidden":!0})}),e.jsxs("div",{className:"detail-content",children:[e.jsx("strong",{children:"Date et heure"}),e.jsx("span",{children:n.allDay?`${I(n.start,"EEEE d MMMM yyyy",{locale:Q})} - Toute la journée`:`${I(n.start,"EEEE d MMMM yyyy",{locale:Q})} de ${I(n.start,"HH:mm")} à ${I(n.end,"HH:mm")}`})]})]}),n.location&&e.jsxs("div",{className:"event-detail-row",children:[e.jsx("div",{className:"detail-icon",children:e.jsx(Ge,{size:20,"aria-hidden":!0})}),e.jsxs("div",{className:"detail-content",children:[e.jsx("strong",{children:"Lieu"}),e.jsx("span",{children:n.location})]})]}),(c==null?void 0:c.hadUnavailableAttachments)&&e.jsxs("div",{className:"event-modal-attachment-notice",role:"status",children:[e.jsx(Yt,{size:18,className:"event-modal-attachment-notice-icon","aria-hidden":!0}),e.jsxs("div",{className:"event-modal-attachment-notice-content",children:[e.jsx("p",{className:"event-modal-attachment-notice-text",children:"La pièce jointe concernant les détails n'est pas accessible ici. Consultez l'événement dans votre calendrier (Outlook, Google, etc.) pour voir les pièces jointes."}),n.eventUrl&&e.jsxs("a",{href:n.eventUrl,target:"_blank",rel:"noopener noreferrer",className:"event-modal-calendar-link",children:[e.jsx(Qe,{size:16,"aria-hidden":!0}),"Voir l'événement dans le calendrier"]})]})]}),x&&e.jsxs("div",{className:"event-detail-row description-row",children:[e.jsx("div",{className:"detail-icon",children:e.jsx(Qt,{size:20,"aria-hidden":!0})}),e.jsxs("div",{className:"detail-content",children:[e.jsx("strong",{children:"Description"}),e.jsxs("div",{className:"description-content-wrapper",children:[e.jsx("div",{ref:u,className:"description-content","data-has-scroll":f.isScrollable?"true":"false",children:e.jsx("div",{className:"event-description-modal",dangerouslySetInnerHTML:{__html:x}})}),f.isScrollable&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:`scroll-indicator scroll-indicator--top ${f.canScrollUp?"scroll-indicator--visible":""}`,"aria-hidden":"true",children:e.jsx("div",{className:"scroll-fade"})}),e.jsx("div",{className:`scroll-indicator scroll-indicator--bottom ${f.canScrollDown?"scroll-indicator--visible":""}`,"aria-hidden":"true",children:e.jsx("div",{className:"scroll-fade"})})]})]})]})]}),e.jsxs("div",{className:"event-detail-row export-row",children:[e.jsx("div",{className:"detail-icon",children:e.jsx(Pe,{size:20,"aria-hidden":!0})}),e.jsxs("div",{className:"detail-content",children:[e.jsx("strong",{children:"Ajouter à mon calendrier"}),e.jsxs("div",{className:"export-buttons",children:[a&&e.jsxs("button",{className:"export-button google",onClick:()=>a(n),title:"Ajouter à Google Calendar",children:[e.jsx(Z,{size:18,className:"export-icon","aria-hidden":!0}),e.jsx("span",{className:"export-label",children:"Google"})]}),r&&e.jsxs("button",{className:"export-button outlook",onClick:()=>r(n),title:"Ajouter à Outlook",children:[e.jsx(Z,{size:18,className:"export-icon","aria-hidden":!0}),e.jsx("span",{className:"export-label",children:"Outlook"})]}),i&&e.jsxs("button",{className:"export-button ics",onClick:()=>i(n),title:"Télécharger fichier ICS",children:[e.jsx(Pe,{size:18,className:"export-icon","aria-hidden":!0}),e.jsx("span",{className:"export-label",children:"Fichier ICS"})]})]})]})]})]})})]})})},an=({date:n,events:t,onClose:s,onEventClick:a})=>e.jsx("div",{className:"day-events-modal-overlay",onClick:s,role:"dialog","aria-modal":"true","aria-labelledby":"day-events-modal-title",children:e.jsxs("div",{className:"day-events-modal",onClick:r=>r.stopPropagation(),children:[e.jsxs("div",{className:"day-events-modal-header",children:[e.jsxs("h3",{id:"day-events-modal-title",children:["Ãvénements du ",I(n,"EEEE d MMMM yyyy",{locale:Q})]}),e.jsx("button",{type:"button",className:"day-events-modal-close",onClick:s,"aria-label":"Fermer",children:e.jsx(Ye,{size:20,"aria-hidden":!0})})]}),e.jsx("ul",{className:"day-events-modal-list",children:t.map(r=>e.jsx("li",{children:e.jsxs("button",{type:"button",className:"day-events-modal-item",onClick:()=>{a(r),s()},style:{borderLeftColor:r.color},children:[e.jsx("span",{className:"day-events-modal-time",children:r.allDay?"Toute la journée":I(r.start,"HH:mm")}
135),e.jsx("span",{className:"day-events-modal-title",children:r.title})]})},`${r.id}-${r.start.getTime()}`))})]})}),on=()=>{let n=sessionStorage.getItem("calendar_session_id");return n||(n=`session_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,sessionStorage.setItem("calendar_session_id",n)),n},cn=async()=>{try{const n={timestamp:new Date().toISOString(),user_agent:navigator.userAgent.substring(0,200),referrer:document.referrer||"direct",page_path:window.location.pathname,session_id:on()},{error:t}=await B.from("calendar_visits").insert([n]);t&&console.warn("Erreur lors de l'enregistrement de la visite:",t)}catch(n){console.warn("Analytics non disponible:",n)}},ln=async()=>{try{const n=new Date,t=new Date(n.getFullYear(),n.getMonth(),n.getDate()),s=new Date(n.getTime()-7*24*60*60*1e3),a=new Date(n.getFullYear(),n.getMonth(),1),{count:r}=await B.from("calendar_visits").select("*",{count:"exact",head:!0}),{data:i}=await B.from("calendar_visits").select("session_id").not("session_id","is",null),u=new Set(i==null?void 0:i.map(x=>x.session_id)).size,{count:f}=await B.from("calendar_visits").select("*",{count:"exact",head:!0}).gte("timestamp",t.toISOString()),{count:l}=await B.from("calendar_visits").select("*",{count:"exact",head:!0}).gte("timestamp",s.toISOString()),{count:c}=await B.from("calendar_visits").select("*",{count:"exact",head:!0}).gte("timestamp",a.toISOString());return{total_visits:r||0,unique_sessions:u,today_visits:f||0,this_week_visits:l||0,this_month_visits:c||0}}catch(n){return console.warn("Erreur lors de la récupération des stats:",n),null}},dn=({showDetailed:n=!1,className:t=""})=>{const[s,a]=h.useState(null),[r,i]=h.useState(!0),[u,f]=h.useState(null);return h.useEffect(()=>{const l=async()=>{try{i(!0);const x=await ln();a(x),f(null)}catch(x){f("Impossible de charger les statistiques"),console.warn("Erreur stats:",x)}finally{i(!1)}};l();const c=setInterval(l,5*60*1e3);return()=>clearInterval(c)},[]),r?e.jsxs("div",{className:`visit-stats loading ${t}`,children:[e.jsx("span",{className:"stats-icon",children:"ð"}),e.jsx("span",{className:"stats-text",children:"Chargement des stats..."})]}):u||!s?null:n?e.jsxs("div",{className:`visit-stats detailed ${t}`,children:[e.jsxs("div",{className:"stats-header",children:[e.jsx("span",{className:"stats-icon",children:"ð"}),e.jsx("h4",{children:"Statistiques de visite"})]}),e.jsxs("div",{className:"stats-grid",children:[e.jsxs("div",{className:"stat-item",children:[e.jsx("span",{className:"stat-number",children:s.total_visits.toLocaleString()}),e.jsx("span",{className:"stat-label",children:"Visites totales"})]}),e.jsxs("div",{className:"stat-item",children:[e.jsx("span",{className:"stat-number",children:s.unique_sessions.toLocaleString()}),e.jsx("span",{className:"stat-label",children:"Sessions uniques"})]}),e.jsxs("div",{className:"stat-item",children:[e.jsx("span",{className:"stat-number",children:s.today_visits.toLocaleString()}),e.jsx("span",{className:"stat-label",children:"Aujourd'hui"})]}),e.jsxs("div",{className:"stat-item",children:[e.jsx("span",{className:"stat-number",children:s.this_week_visits.toLocaleString()}),e.jsx("span",{className:"stat-label",children:"Cette semaine"})]}),e.jsxs("div",{className:"stat-item",children:[e.jsx("span",{className:"stat-number",children:s.this_month_visits.toLocaleString()}),e.jsx("span",{className:"stat-label",children:"Ce mois"})]})]})]}):e.jsxs("div",{className:`visit-stats compact ${t}`,children:[e.jsx("span",{className:"stats-icon",children:"ð¥"}),e.jsxs("span",{className:"stats-text",children:[s.total_visits.toLocaleString()," visites (",s.unique_sessions.toLocaleString(),")",s.today_visits>0&&e.jsxs("span",{className:"today-badge",children:["+",s.today_visits," aujourd'hui"]})]})]})},un=()=>e.jsxs("footer",{className:"calendar-footer",children:[e.jsxs("div",{className:"footer-content",children:[e.jsxs("div",{className:"footer-section",children:[e.jsx("h4",{children:"Secteur des Sciences de la Santé"}),e.jsx("p",{children:"UCLouvain - Secteur des Sciences de la Santé"}),e.jsx("p",{children:"Rue Martin V 40, Batiment Les Arches"}),e.jsx("p",{children:"1200 Woluwe-Saint-Lambert"})]}),e.jsxs("div",{className:"footer-section",children:[e.jsx("h4",{children:"Support technique"}),e.jsx("p",{children:"En cas de souci technique, s'adresser à :"}),e.jsx("p",{children:e.jsx("a",{href:"mailto:[email protected]",className:"footer-link",children:"[email protected]"})})]}),e.jsxs("div",{className:"footer-section",children:[e.jsx("h4",{children:"Liens utiles"}),e.jsx("p",{children:e.jsx("a",{href:"https://www.uclouvain.be/fr/secteurs/sss",target:"_blank",rel:"noopener noreferrer",className:"footer-link",children:"Site du secteur SSS"})}),e.jsx("p",{children:e.jsx("a",{href:"https://www.uclouvain.be",target:"_blank",rel:"noopener noreferrer",className:"footer-link",children:"UCLouvain"})})]})]}),e.jsxs("div",{className:"footer-bottom",children:[e.jsxs("p",{children:["© ",new Date().getFullYear()," UCLouvain - Secteur des Sciences de la Santé"]}),e.jsx("div",{className:"footer-version",children:e.jsxs("p",{children:["Version 2.1.0 ⢠Dernière mise à jour : ",new Date().toLocaleDateString("fr-FR",{year:"numeric",month:"long",day:"numeric"})]})}),e.jsx(dn,{className:"footer-stats"})]})]}),Fe=[{title:"PINDARE â Agenda CRef",description:"Agenda des événements interuniversitaires (Ãthique, Open Science, Formation, Intégrité scientifiqueâ¦).",url:"https://pindare.cref.be/fr/agenda/",label:"Voir lâagenda"}],hn=()=>Fe.length===0?null:e.jsxs("section",{className:"other-agendas-section","aria-labelledby":"other-agendas-heading",children:[e.jsxs("h2",{id:"other-agendas-heading",className:"other-agendas-heading",children:[e.jsx(ts,{size:24,"aria-hidden":!0}),"Autres agendas"]}),e.jsx("p",{className:"other-agendas-intro",children:"Découvrez dâautres calendriers dâévénements utiles."}),e.jsx("div",{className:"other-agendas-grid",children:Fe.map(n=>e.jsx("a",{href:n.url,target:"_blank",rel:"noopener noreferrer",className:"other-agenda-card",children:e.jsxs("div",{className:"other-agenda-card-content",children:[e.jsx("h3",{className:"other-agenda-card-title",children:n.title}),e.jsx("p",{className:"other-agenda-card-desc",children:n.description}),e.jsxs("span",{className:"other-agenda-card-link",children:[n.label??"Voir lâagenda",e.jsx(Qe,{size:14,className:"other-agenda-card-arrow","aria-hidden":!0})]})]})},n.url))})]}),mn=({events:n,onSearchResults:t,onClearSearch:s,placeholder:a="Rechercher dans les événements..."})=>{const[r,i]=h.useState(""),[u,f]=h.useState(!1),l=h.useRef(null),c=h.useRef(null),x=d=>{if(!d.trim())return[];const v=d.toLowerCase().trim(),S=v.split(/\s+/);return n.filter(D=>{const j=[D.title,D.description||"",D.location||"",D.category.name].join(" ").toLowerCase(),H=S.every(F=>j.includes(F)),W=j.includes(v);return H||W})};h.useEffect(()=>{const d=setTimeout(()=>
135{if(r.trim()){const v=x(r);t(v,r)}else s()},300);return()=>clearTimeout(d)},[r,n,t,s,u]),h.useEffect(()=>{const d=v=>{l.current&&!l.current.contains(v.target)&&c.current&&!c.current.contains(v.target)&&f(!1)};return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[]);const y=d=>{i(d.target.value)},g=()=>{f(!0)},p=()=>{var d;i(""),s(),(d=l.current)==null||d.focus()},o=d=>{var v;d.key==="Escape"&&(f(!1),(v=l.current)==null||v.blur())};return e.jsx("div",{className:"search-bar-container",children:e.jsx("div",{className:`search-bar ${u?"active":""}`,children:e.jsxs("div",{className:"search-input-wrapper",children:[e.jsx(de,{className:"search-icon",size:20,"aria-hidden":!0}),e.jsx("input",{ref:l,type:"text",value:r,onChange:y,onFocus:g,onKeyDown:o,placeholder:a,className:"search-input",autoComplete:"off"}),r&&e.jsx("button",{onClick:p,className:"search-clear",title:"Effacer la recherche",children:e.jsx(Ye,{size:18,"aria-hidden":!0})})]})})})};function pn(n){return!n||typeof n!="string"?"":n.replace(/\+\+\+([^+]+)\+\+\+/g,"$1").replace(/___([^_]+)___/g,"$1").replace(/~~~([^~]+)~~~/g,"$1").replace(/\|\|\|/g," ").replace(/===/g," ").replace(/\s+/g," ").trim()}function gn(n,t=120){const s=pn(n);return s.length<=t?s:`${s.substring(0,t-3)}...`}const fn=({searchResults:n,searchQuery:t,isVisible:s,onEventClick:a})=>{if(!s||!t.trim())return null;const r=(i,u)=>e.jsx("div",{className:"search-result-card",children:e.jsxs("div",{className:"search-result-content",children:[e.jsx("div",{className:"search-result-header",children:e.jsx("h4",{className:"search-result-title",children:i.title})}),e.jsxs("div",{className:"search-result-datetime",children:[e.jsxs("span",{className:"search-result-date",children:["ð
",I(i.start,"d MMM yyyy",{locale:Q})]}),e.jsxs("span",{className:"search-result-time",children:["ð ",i.allDay?"Journée entière":`${I(i.start,"HH:mm")} - ${I(i.end,"HH:mm")}`]})]}),i.location&&e.jsxs("div",{className:"search-result-location",children:["ð ",i.location]}),i.description&&e.jsx("div",{className:"search-result-description",children:gn(i.description,120)}),e.jsx("div",{className:"search-result-actions",children:e.jsx("button",{className:"btn-search-info",onClick:()=>a(i),title:"Plus d'informations",children:"â¹ï¸ Détails"})})]})},`${i.id}-${i.start.getTime()}-${u}`);return e.jsxs("div",{className:"search-results-section",children:[e.jsxs("div",{className:"search-results-header",children:[e.jsxs("h3",{className:"search-results-title",children:['ð Résultats de recherche pour "',t,'"',e.jsxs("span",{className:"search-results-count",children:["(",n.length," résultat",n.length!==1?"s":"",")"]})]}),e.jsx("p",{className:"search-results-subtitle",children:"Cliquez sur un événement pour voir les détails"})]}),e.jsx("div",{className:"search-results-grid",children:n.length===0?e.jsxs("div",{className:"no-search-results",children:[e.jsx("div",{className:"no-results-icon",children:"ð"}),e.jsxs("p",{children:['Aucun résultat pour "',t,'"']}),e.jsx("p",{className:"no-results-suggestion",children:"Essayez avec d'autres mots-clés ou modifiez les filtres"})]}):n.map((i,u)=>r(i,u))})]})},xn=({events:n,onEventClick:t,eventsPerPage:s=6})=>{const[a,r]=h.useState(1),i=h.useMemo(()=>{const g=new Date;return n.filter(p=>p.start>=g).sort((p,o)=>p.start.getTime()-o.start.getTime())},[n]),u=Math.ceil(i.length/s),f=(a-1)*s,l=i.slice(f,f+s),c=g=>{r(Math.max(1,Math.min(g,u)))},x=g=>I(g,"EEEE d MMMM",{locale:Q}),y=(g,p,o)=>o?"Toute la journée":`${I(g,"HH:mm")} - ${I(p,"HH:mm")}`;return i.length===0?e.jsxs("div",{className:"upcoming-events-section",children:[e.jsx("div",{className:"upcoming-events-header",children:e.jsxs("h3",{className:"upcoming-events-title",children:[e.jsx(Ie,{size:22,"aria-hidden":!0})," Prochains événements"]})}),e.jsx("div",{className:"no-upcoming-events",children:e.jsx("p",{children:"Aucun événement à venir"})})]}):e.jsxs("div",{className:"upcoming-events-section",children:[e.jsxs("div",{className:"upcoming-events-header",children:[e.jsxs("h3",{className:"upcoming-events-title",children:[e.jsx(Ie,{size:22,"aria-hidden":!0})," Prochains événements"]}),e.jsxs("div",{className:"events-pagination-info",children:[i.length," événement",i.length>
1351?"s":""," à venir"]})]}),e.jsx("div",{className:"upcoming-events-grid",children:l.map((g,p)=>{const o=g.description?Ke(g.description):null;return e.jsxs("div",{className:"upcoming-event-card",children:[e.jsx("div",{className:"upcoming-event-header",children:e.jsxs("div",{className:"upcoming-event-date-time",children:[e.jsx("div",{className:"upcoming-event-date",children:x(g.start)}),e.jsx("div",{className:"upcoming-event-time",children:y(g.start,g.end,g.allDay)})]})}),e.jsxs("div",{className:"upcoming-event-content",children:[e.jsx("h4",{className:"upcoming-event-title",onClick:()=>t(g),title:"Cliquer pour voir les détails",children:g.title}),g.location&&e.jsxs("div",{className:"upcoming-event-location",children:["ð ",g.location]}),o&&o.cleanDescription&&e.jsx("div",{className:"upcoming-event-description",children:o.cleanDescription.length>100?`${o.cleanDescription.substring(0,100)}...`:o.cleanDescription})]}),e.jsx("div",{className:"upcoming-event-actions",children:e.jsx("div",{className:"primary-actions",children:e.jsx("button",{onClick:()=>t(g),className:"btn-event-details",title:"Voir les détails",children:"Détails"})})})]},`${g.id}-${p}`)})}),u>1&&e.jsxs("div",{className:"upcoming-events-pagination",children:[e.jsx("button",{onClick:()=>c(a-1),disabled:a===1,className:"pagination-btn",children:"â Précédent"}),e.jsxs("div",{className:"pagination-info",children:["Page ",a," sur ",u]}),e.jsx("div",{className:"pagination-numbers",children:Array.from({length:Math.min(5,u)},(g,p)=>{const o=Math.max(1,Math.min(u-4,a-2))+p;return o>u?null:e.jsx("button",{onClick:()=>c(o),className:`pagination-number ${a===o?"active":""}`,children:o},o)})}),e.jsx("button",{onClick:()=>c(a+1),disabled:a===u,className:"pagination-btn",children:"Suivant â"})]})]})},vn=n=>{const[t,s]=h.useState({query:"",results:[],filters:{dateRange:"all"},isSearching:!1,highlightedEvents:new Set}),a=(y,g)=>{let p=[...y];const o=new Date,d=new Date(o);d.setDate(o.getDate()-o.getDay()+1);const v=new Date(d);v.setDate(d.getDate()+6);const S=new Date(o.getFullYear(),o.getMonth(),1),D=new Date(o.getFullYear(),o.getMonth()+1,0);switch(g.dateRange){case"upcoming":p=p.filter(j=>j.start>=o);break;case"thisWeek":p=p.filter(j=>j.start>=d&&j.start<=v);break;case"thisMonth":p=p.filter(j=>j.start>=S&&j.start<=D);break}return p},r=h.useMemo(()=>a(n,t.filters),[n,t.filters]),i=y=>{if(!y.trim())return[];const g=y.toLowerCase().trim(),p=g.split(/\s+/);return r.filter(o=>{const d=[o.title,o.description||"",o.location||"",o.category.name].join(" ").toLowerCase(),v=p.every(j=>d.includes(j)),S=d.includes(g),D=p.some(j=>j.length<3?!1:d.includes(j.substring(0,j.length-1)));return v||S||D})},u=y=>{const g=i(y),p=new Set(g.map(o=>o.id));s(o=>({...o,query:y,results:g,isSearching:y.trim().length>0,highlightedEvents:p}))},f=y=>{const g={...t.filters,...y},p=t.query?i(t.query):[],o=new Set(p.map(d=>d.id));s(d=>({...d,filters:g,results:p,highlightedEvents:o}))},l=()=>{s(y=>({...y,query:"",results:[],isSearching:!1,highlightedEvents:new Set}))},c=y=>t.highlightedEvents.has(y),x=h.useMemo(()=>{const y=n.length,g=r.length,p=t.results.length;return{totalEvents:y,filteredCount:g,resultsCount:p,hasActiveFilters:t.filters.dateRange!=="all"}},[n.length,r.length,t.results.length,t.filters]);return{searchState:t,filteredEvents:r,searchStats:x,setQuery:u,updateFilters:f,clearSearch:l,isEventHighlighted:c,performSearch:i}},le=[{id:"navigation",title:"Navigation rapide",content:`Utilisez les flèches â â pour naviguer entre les mois, ou cliquez sur "Aujourd'hui" pour revenir à la date actuelle.`,position:"bottom"},{id:"search",title:"Recherche intelligente",content:"Tapez n'importe quel mot-clé pour trouver des événements. La recherche fonctionne sur les titres, descriptions et lieux.",position:"bottom"},{id:"filters",title:"Filtres avancés",content:"Utilisez les filtres pour affiner votre vue : par source (de Duve ou SSS), par catégorie ou par période.",position:"top"},{id:"export",title:"Export vers vos calendriers",content:"Cliquez sur un événement puis utilisez les boutons d'export pour l'ajouter à Google Calendar, Outlook ou télécharger un fichier ICS.",position:"left"},{id:"views",title:"Différentes vues",content:"Basculez entre la vue Mois (aperçu général), Agenda (liste détaillée) et Affichage (mode présentation).",position:"bottom"}],jn=()=>{const[n,t]=h.useState(!1),[s,a]=h.useState(0),[r,i]=h.useState(localStorage.getItem("calendar-help-seen")==="true"),u=()=>{t(!0),a(0)},f=()=>{t(!1),i(!0),localStorage.setItem("calendar-help-seen","true")},l=()=>
135{s<le.length-1?a(s+1):f()},c=()=>{s>0&&a(s-1)},x=le[s];return e.jsxs(e.Fragment,{children:[e.jsxs("button",{className:`help-button ${r?"":"pulse"}`,onClick:u,title:"Aide et conseils d'utilisation",children:[e.jsx("span",{className:"help-icon",children:"â"}),!r&&e.jsx("span",{className:"help-badge",children:"Nouveau"})]}),n&&e.jsx("div",{className:"help-overlay",children:e.jsxs("div",{className:"help-tooltip",children:[e.jsxs("div",{className:"help-header",children:[e.jsx("h3",{children:x.title}),e.jsx("button",{className:"help-close",onClick:f,children:"â"})]}),e.jsx("div",{className:"help-content",children:e.jsx("p",{children:x.content})}),e.jsxs("div",{className:"help-footer",children:[e.jsxs("div",{className:"help-progress",children:[e.jsxs("span",{children:[s+1," / ",le.length]}),e.jsx("div",{className:"progress-bar",children:e.jsx("div",{className:"progress-fill",style:{width:`${(s+1)/le.length*100}%`}})})]}),e.jsxs("div",{className:"help-actions",children:[e.jsx("button",{className:"help-btn secondary",onClick:c,disabled:s===0,children:"Précédent"}),e.jsx("button",{className:"help-btn primary",onClick:l,children:s===le.length-1?"Terminer":"Suivant"})]})]})]})})]})},bn=({isVisible:n,onClose:t})=>{const[s,a]=h.useState(null),r=[{id:"sync",question:"à quelle fréquence les calendriers sont-ils synchronisés ?",answer:'Les calendriers sont automatiquement synchronisés toutes les 10 minutes. Vous pouvez aussi forcer une synchronisation en cliquant sur "Actualiser".'},{id:"sources",question:"Quelles sont les sources de calendriers disponibles ?",answer:"Nous affichons le calendrier de Duve (iCloud) et le calendrier du secteur SSS (Outlook). Les événements sont identifiés par des couleurs différentes."},{id:"export",question:"Comment ajouter un événement à mon calendrier personnel ?",answer:"Cliquez sur l'événement pour ouvrir ses détails, puis utilisez les boutons d'export pour l'ajouter à Google Calendar, Outlook ou télécharger un fichier ICS."},{id:"search",question:"Comment fonctionne la recherche ?",answer:"La recherche est intelligente et cherche dans les titres, descriptions et lieux des événements. Vous pouvez aussi utiliser les filtres pour affiner les résultats."},{id:"mobile",question:"L'application fonctionne-t-elle sur mobile ?",answer:"Oui, l'interface s'adapte automatiquement aux écrans mobiles avec des zones tactiles optimisées et une navigation simplifiée."}];return n?e.jsx("div",{className:"faq-modal-backdrop",onClick:t,children:e.jsxs("div",{className:"faq-modal",onClick:i=>i.stopPropagation(),children:[e.jsxs("div",{className:"faq-header",children:[e.jsx("h3",{children:"â Questions fréquentes"}),e.jsx("button",{className:"faq-close",onClick:t,children:"â"})]}),e.jsx("div",{className:"faq-content",children:r.map(i=>e.jsxs("div",{className:"faq-item",children:[e.jsxs("button",{className:`faq-question ${s===i.id?"active":""}`,onClick:()=>a(s===i.id?null:i.id),children:[e.jsx("span",{children:i.question}),e.jsx("span",{className:"faq-toggle",children:s===i.id?"â":"+"})]}),s===i.id&&e.jsx("div",{className:"faq-answer",children:e.jsx("p",{children:i.answer})})]},i.id))})]})}):null},yn=({isLoading:n,message:t="Chargement..."})=>n?e.jsxs("div",{className:"realtime-loading",children:[e.jsx("div",{className:"loading-spinner"}),e.jsx("span",{className:"loading-message",children:t})]}):null,Nn=({type:n,message:t,isVisible:s,onClose:a})=>{if(X.useEffect(()=>{if(s){const i=setTimeout(a,2e3);return()=>clearTimeout(i)}},[s,a]),!s)return null;const r={success:"â
",error:"â",info:"â¹ï¸"};return e.jsxs("div",{className:`toast-notification toast-${n}`,children:[e.jsx("span",{className:"toast-icon",children:r[n]}),e.jsx("span",{className:"toast-message",children:t}),e.jsx("button",{className:"toast-close",onClick:a,children:"â"})]})},wn=()=>{const[n,t]=X.useState(navigator.onLine);return X.useEffect(()=>{const s=()=>t(!0),a=()=>t(!1);return window.addEventListener("online",s),window.addEventListener("offline",a),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",a)}},[]),n?null:e.jsxs("div",{className:"network-status offline",children:[e.jsx("span",{className:"network-icon",children:"ð¡"}),e.jsx("span",{children:"Mode hors ligne - Les données peuvent ne pas être à jour"})]})},Sn=({progress:n,message:t})=>e.jsx("div",{className:"loading-screen",children:e.jsxs("div",{className:"loading-content",children:[e.jsxs("div",{className:"loading-logo",children:[e.jsx("div",{className:"ucl-logo",children:e.jsx(Z,{size:48,"aria-hidden":!0})}),e.jsx("h1",{className:"loading-title",children:"Ãvénements SSS"}),e.jsx("p",{className:"loading-subtitle",children:"Secteur des Sciences de la Santé - UCLouvain"})]}),e.jsxs("div",{className:"loading-progress-container",children:[e.jsx("div",{className:"loading-progress-bar",children:e.jsx("div",{className:"loading-progress-fill",style:{width:`${Math.min(Math.max(n,10),100)}%`}})}),e.jsxs("div",{className:"loading-percentage",children:[Math.min(Math.round(n),100),"%"]})]}),e.jsxs("div",{className:"loading-message",children:[e.jsx("span",{className:"loading-text",children:t}),e.jsxs("div",{className:"loading-dots",children:[e.jsx("span",{}),e.jsx("span",{}),e.jsx("span",{})]})]}),e.jsxs("div",{className:"loading-tips",children:[e.jsxs("div",{className:"loading-tip",children:[e.jsx(de,{size:20,className:"tip-icon","aria-hidden":!0}),e.jsx("span",{children:"Recherche en temps réel dans les événements"})]}),e.jsxs("div",{className:"loading-tip",children:[e.jsx(is,{size:20,className:"tip-icon","aria-hidden":!0}),e.jsx("span",{children:"Cache intelligent pour un chargement rapide"})]})]}),e.jsx("div",{className:"loading-footer",children:e.jsx("p",{children:"Rue Martin V 40, Batiment Les Arches, 1200 Woluwe-Saint-Lambert"})})]})}),ae=[{name:"Calendrier de Duve",url:"https://p25-caldav.icloud.com/published/2/MjE3MzIxMzkxMTYyMTczMtrwrElZXGcjHRcJohH3ZTG9v2l4po1v88R9tID706X9RxGohLKxmB8cXu3SUYxqWQyqiN7dN3ZkiPAFAAQE2b8",source:"icloud",color:"#ff6b6b"},{name:"Calendrier Secteur SSS",url:"https://outlook.office365.com/owa/calendar/[email protected]/32bcbe6b269b4cf78cd02da934b381c215406410938849709841/calendar.ics",source:"outlook",color:"#003d7a"}],kn=()=>{const[n,t]=h.useState(new Date),[s,a]=h.useState("month"),[r,i]=h.useState([]),[u,f]=h.useState(null),[l,c]=h.useState(!1),[x,y]=h.useState(!0),[g,p]=h.useState(null),[o,d]=h.useState(0),[v,S]=h.useState("Initialisation..."),[D,j]=h.useState(!1),[H,W]=h.useState({type:"info",message:"",isVisible:!1}),[F,R]=h.useState(!1),L=X.useRef(null),{searchState:A,filteredEvents:K,setQuery:ue,clearSearch:fe,isEventHighlighted:xe}
135=vn(r),E=X.useRef(null),[M,P]=h.useState({visible:!1,content:"",x:0,y:0}),[N,ee]=h.useState(null),U=m=>m?m.replace(/<[^>]*>/g,"").replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/'/g,"'").replace(/\s+/g," ").trim():"",G=(m,k)=>{const C=m.target.getBoundingClientRect(),w=window.innerWidth;let b=k.title;if(k.location&&(b+=` 136ð ${k.location}`),k.description&&k.description.length>0){const T=k.description.length>100?`${U(k.description).substring(0,100)}...`:U(k.description);b+=` 137ð ${T}`}const _=Math.min(350,b.length*6);let $=C.left+C.width/2,z=C.top-10;$+_/2>w-20&&($=w-_/2-20),$-_/2<20&&($=_/2+20),P({visible:!0,content:b,x:$,y:z})},te=()=>{P(m=>({...m,visible:!1}))},q=(m,k,C=!0)=>{L.current&&(clearTimeout(L.current),L.current=null),W({type:m,message:k,isVisible:!0}),C&&m==="success"&&(L.current=setTimeout(()=>{W(w=>({...w,isVisible:!1})),L.current=null},3e3))},V=()=>{W(m=>({...m,isVisible:!1}))},st=async()=>{try{const m=ae.map(async w=>{try{const b=await Oe.fetchAndParse(w.url,w.source);try{await he({source_name:w.name,source_url:w.url,last_sync:new Date().toISOString(),events_count:b.length,status:"success"})}catch{}return b}catch(b){console.error(`Erreur chargement ${w.name}:`,b);try{await he({source_name:w.name,source_url:w.url,last_sync:new Date().toISOString(),events_count:0,status:"error",error_message:b instanceof Error?b.message:"Erreur inconnue"})}catch{}return q("error",`Erreur de chargement: ${w.name}`),[]}}),C=(await Promise.all(m)).flat();if(C.length>0){const w=C.map(b=>{const _=ae.find($=>$.source===b.source);return{...b,color:(_==null?void 0:_.color)||(b.source==="icloud"?"#ff6b6b":"#4ecdc4"),category:{...b.category,id:b.category.id||`${b.source}-${b.category.name}`,color:(_==null?void 0:_.color)||(b.source==="icloud"?"#ff6b6b":"#4ecdc4"),source:b.source}}});i(w);try{const b=w.map(_=>({event_id:_.id,title:_.title,start_date:_.start.toISOString(),end_date:_.end.toISOString(),description:_.description,location:_.location,source:_.source,color:_.color,category:_.category.name}));await He(b)}catch{}q("success",`${C.length} événements actualisés`)}}catch{q("error","Erreur lors de l'actualisation")}finally{R(!1)}},ie=async m=>{const k=(m==null?void 0:m.forceRefresh)===!0;if(p(null),d(0),S("Vérification du cache..."),R(!0),!k)try{const C=await qs();if(d(20),C.length>0){const w=C.map(b=>({id:b.event_id,title:b.title,start:new Date(b.start_date),end:new Date(b.end_date),description:b.description||"",location:b.location||"",source:b.source,color:b.color||"#6c757d",allDay:!1,category:{id:`${b.source}-${b.category||"default"}`,name:b.category||"default",color:b.color||"#6c757d",source:b.source}}));i(w),y(!1),st();return}}catch{console.warn("Cache non disponible, chargement direct des calendriers")}y(!0);try{if(k){S("Vidage du cache...");try{await Vs()}catch{console.warn("Cache non disponible")}d(10)}S("Chargement des calendriers..."),d(30);const C=ae.map(async($,z)=>{try{S(`Chargement ${$.name}...`);const T=await Oe.fetchAndParse($.url,$.source),it=30+40/ae.length*(z+1);d(Math.min(it,70)),console.log(`ð ${$.name}: ${T.length} événements chargés`);try{await he({source_name:$.name,source_url:$.url,last_sync:new Date().toISOString(),events_count:T.length,status:"success"})}catch{console.warn("Synchronisation du statut non disponible")}return T}catch(T){console.error(`â Erreur lors du chargement de ${$.name}:`,T);try{await he({source_name:$.name,source_url:$.url,last_sync:new Date().toISOString(),events_count:0,status:"error",error_message:T instanceof Error?T.message:"Erreur inconnue"})}catch{console.warn("Synchronisation du statut d'erreur non disponible")}return q("error",`Erreur de chargement: ${$.name}`),[]}});S("Traitement des données..."),d(70);const b=(await Promise.all(C)).flat();if(console.log(`ð Total des événements chargés: ${b.length}`),b.length>0){S("Application des couleurs..."),d(80);const $=b.map(z=>{const T=ae.find(ve=>ve.source===z.source);return{...z,color:(T==null?void 0:T.color)||(z.source==="icloud"?"#ff6b6b":"#4ecdc4"),category:{...z.category,id:z.category.id||`${z.source}-${z.category.name}`,color:(T==null?void 0:T.color)||(z.source==="icloud"?"#ff6b6b":"#4ecdc4"),source:z.source}}});i($),S("Mise en cache..."),d(90);try{const z=$.map(T=>({event_id:T.id,title:T.title,start_date:T.start.toISOString(),end_date:T.end.toISOString(),description:T.description,location:T.location,source:T.source,color:T.color,category:T.category.name}));await He(z)}catch{console.warn("Mise en cache non disponible, continuons sans cache")}}S("Terminé !"),d(100);const _=b.length;_>0?q("success",`${_} événements chargés avec succès !`):q("error","Aucun événement chargé - Vérifiez la console pour plus de détails")}
137catch(C){const w=C instanceof Error?C.message:"Erreur inconnue";p(w),q("error",`Erreur lors du chargement : ${w}`)}finally{y(!1),R(!1)}};h.useEffect(()=>{ie(),cn().catch(k=>{console.warn("Analytics non disponible:",k)});const m=setInterval(()=>{ie()},10*60*1e3);return()=>{clearInterval(m),L.current&&clearTimeout(L.current)}},[]);const we=m=>{t(k=>{switch(s){case"month":default:return m==="prev"?jt(k,1):bt(k,1)}})},nt=()=>{t(new Date)},rt=()=>{switch(s){case"month":return I(n,"MMMM yyyy",{locale:Q});case"agenda":return"Vue Agenda";case"screen":return"Vue Ãcran";default:return I(n,"MMMM yyyy",{locale:Q})}},Se=m=>{const k=m.start.toISOString().replace(/[-:]/g,"").split(".")[0]+"Z",C=m.end.toISOString().replace(/[-:]/g,"").split(".")[0]+"Z",w=new URL("https://calendar.google.com/calendar/render");w.searchParams.set("action","TEMPLATE"),w.searchParams.set("text",m.title),w.searchParams.set("dates",`${k}/${C}`),m.description&&w.searchParams.set("details",U(m.description)),m.location&&w.searchParams.set("location",m.location),window.open(w.toString(),"_blank"),q("success","Ãvénement ouvert dans Google Calendar")},ke=m=>{const k=m.start.toISOString(),C=m.end.toISOString(),w=new URL("https://outlook.live.com/calendar/0/deeplink/compose");w.searchParams.set("subject",m.title),w.searchParams.set("startdt",k),w.searchParams.set("enddt",C),m.description&&w.searchParams.set("body",U(m.description)),m.location&&w.searchParams.set("location",m.location),window.open(w.toString(),"_blank"),q("success","Ãvénement ouvert dans Outlook")},Ee=m=>{const k=z=>z.toISOString().replace(/[-:]/g,"").split(".")[0]+"Z",C=z=>z.replace(/\\/g,"\\\\").replace(/;/g,"\\;").replace(/,/g,"\\,").replace(/\n/g,"\\n").replace(/\r/g,""),w=["BEGIN:VCALENDAR","VERSION:2.0","PRODID:-//UCLouvain//Calendrier SSS//FR","BEGIN:VEVENT",`UID:${m.id}@calendrier-sss.uclouvain.be`,`DTSTART:${k(m.start)}`,`DTEND:${k(m.end)}`,`SUMMARY:${C(m.title)}`,m.description?`DESCRIPTION:${C(U(m.description))}`:"",m.location?`LOCATION:${C(m.location)}`:"",`CREATED:${k(new Date)}`,`LAST-MODIFIED:${k(new Date)}`,"END:VEVENT","END:VCALENDAR"].filter(z=>z!=="").join(`\r 138`),b=new Blob([w],{type:"text/calendar;charset=utf-8"}),_=URL.createObjectURL(b),$=document.createElement("a");$.href=_,$.download=`${m.title.replace(/[^a-z0-9]/gi,"_").toLowerCase()}.ics`,document.body.appendChild($),$.click(),document.body.removeChild($),URL.revokeObjectURL(_),q("success","Fichier ICS téléchargé")},at=()=>{const k={currentDate:n,events:K,onEventClick:C=>{f(C),c(!0)},onEventHover:G,onEventLeave:te,isEventHighlighted:xe,onExportToGoogle:Se,onExportToOutlook:ke,onExportToICS:Ee};switch(s){case"month":return e.jsx(Ve,{...k,sourceLegend:ae.map(C=>({name:C.name,color:C.color})),onMoreEventsClick:(C,w)=>ee({date:C,events:w})});case"agenda":return e.jsx(Qs,{...k,selectedEventId:u==null?void 0:u.id});case"screen":return e.jsx(Gs,{events:K});default:return e.jsx(Ve,{...k})}};return x&&r.length===0?e.jsx(Sn,{progress:o,message:v}):g?e.jsxs("div",{className:"error",children:[e.jsx("h3",{children:"Erreur de chargement"}),e.jsx("p",{children:g}),e.jsx("button",{onClick:()=>ie({forceRefresh:!0}),className:"nav-button",children:"Réessayer"})]}):e.jsxs("div",{className:"calendar-container fade-in",children:[e.jsx(wn,{}),e.jsx(yn,{isLoading:F,message:"Synchronisation en cours..."}),e.jsx(Nn,{type:H.type,message:H.message,isVisible:H.isVisible,onClose:V}),e.jsxs("div",{className:"calendar-main-header-compact",children:[e.jsxs("h1",{className:"calendar-main-title-compact",children:[e.jsx(Z,{size:28,className:"header-title-icon","aria-hidden":!0}),"Calendrier SSS - UCLouvain"]}),e.jsxs("div",{className:"header-actions-group",children:[e.jsx("div",{className:"header-refresh-actions",children:e.jsxs("button",{onClick:()=>ie({forceRefresh:!0}),className:"nav-button refresh-button compact","aria-label":"Actualiser les calendriers",title:"Actualiser les calendriers (vide automatiquement le cache)",children:[e.jsx(Le,{size:18,"aria-hidden":!0}),"Actualiser"]})}),e.jsx("div",{className:"header-help-actions",children:e.jsx("button",{className:"faq-btn",onClick:()=>j(!0),title:"Questions fréquentes","aria-label":"Questions fréquentes",children:e.jsx(Ft,{size:20,"aria-hidden":!0})})})]})]}),s!=="screen"&&e.jsxs("div",{className:"calendar-header-redesigned",children:[e.jsxs("div",{className:"header-top-row",children:[e.jsxs("div",{className:"calendar-nav",children:[e.jsx("button",{onClick:()=>we("prev"),className:"nav-button nav-button-icon","aria-label":"Période précédente",title:"Période précédente",children:e.jsx(At,{size:22,"aria-hidden":!0})}),e.jsxs("button",{onClick:nt,className:"nav-button","aria-label":"Aller à aujourd'hui",title:"Aujourd'hui",children:[e.jsx(Z,{size:18,"aria-hidden":!0}),"Aujourd'hui"]}),e.jsx("button",{onClick:()=>we("next"),className:"nav-button nav-button-icon","aria-label":"Période suivante",title:"Période suivante",children:e.jsx(Ht,{size:22,"aria-hidden":!0})})]}),e.jsxs("div",{className:"month-year-container-redesigned",children:[e.jsx("h2",{className:"month-year",children:rt()}),s==="month"&&e.jsx("span",{className:"month-badge",children:"Vue mensuelle"})]}
138),e.jsx("div",{className:"header-controls",children:e.jsx(We,{currentView:s,onViewChange:a})})]}),e.jsxs("div",{className:"header-bottom-row",children:[e.jsxs("div",{className:"calendar-search-section-redesigned",children:[e.jsx(mn,{events:r,onSearchResults:(m,k)=>{ue(k)},onClearSearch:()=>{fe()},placeholder:"Rechercher dans les événements..."}),A.isSearching&&e.jsx(e.Fragment,{children:A.results.length>0?e.jsxs("button",{className:"scroll-to-results-btn",onClick:()=>{var m;(m=E.current)==null||m.scrollIntoView({behavior:"smooth",block:"start"})},title:"Voir les résultats de recherche",children:[e.jsx(Ge,{size:16,"aria-hidden":!0}),A.results.length," résultat",A.results.length!==1?"s":""," trouvé",A.results.length!==1?"s":""," · Voir"]}):e.jsxs("div",{className:"no-results-message-inline",children:[e.jsx(de,{size:16,"aria-hidden":!0}),'Aucun résultat pour "',A.query,'"']})})]}),e.jsxs("div",{className:"events-stats-redesigned",children:[e.jsxs("span",{className:"stats-total",children:[K.length," événements"]}),A.isSearching&&e.jsxs("span",{className:"stats-found",children:["⢠",A.results.length," trouvés"]})]})]})]}),s==="screen"&&e.jsx("div",{className:"screen-view-header",children:e.jsxs("div",{className:"screen-view-controls",children:[e.jsx(We,{currentView:s,onViewChange:a}),e.jsxs("button",{onClick:()=>ie({forceRefresh:!0}),className:"nav-button refresh-button","aria-label":"Actualiser les événements",title:"Actualiser les événements",children:[e.jsx(Le,{size:18,"aria-hidden":!0}),"Actualiser"]})]})}),e.jsx("div",{className:`calendar-layout-full ${A.isSearching?"search-active":""} ${s==="screen"?"screen-mode":""}`,children:e.jsxs("div",{className:"calendar-main-full",children:[e.jsx("div",{className:`calendar-content ${s!=="screen"?"scale-in":""}`,children:at()}),s!=="screen"&&e.jsx("div",{ref:E,children:e.jsx(fn,{searchResults:A.results,searchQuery:A.query,isVisible:A.isSearching,onEventClick:m=>{f(m),c(!0)}})}),s!=="screen"&&!A.isSearching&&e.jsx(xn,{events:K,onEventClick:m=>{f(m),c(!0)},eventsPerPage:5})]})}),e.jsx(rn,{event:u,isOpen:l,onClose:()=>{c(!1),f(null)},onExportToGoogle:Se,onExportToOutlook:ke,onExportToICS:Ee}),N&&e.jsx(an,{date:N.date,events:N.events,onClose:()=>ee(null),onEventClick:m=>{f(m),c(!0)}}),M.visible&&e.jsx("div",{className:"event-tooltip",style:{left:M.x,top:M.y},children:M.content}),s!=="screen"&&e.jsxs(e.Fragment,{children:[e.jsx(hn,{}),e.jsx(un,{}),e.jsx(jn,{}),e.jsx(bn,{isVisible:D,onClose:()=>j(!1)})]})]})};function En(){return e.jsx("div",{className:"App",children:e.jsx(kn,{})})}Ne.createRoot(document.getElementById("root")).render(e.jsx(X.StrictMode,{children:e.jsx(En,{})}));
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.