PageSourceSearch

https://cause-commune.fm/_next/static/chunks/17qi5-fwq9499.js

js cause-commune.fm collected 2026-10-02 04:49:22 UTC 52,237 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,74462,e=>{"use strict";var t=e.i(43476),r=e.i(71645);let n=6e5,a=100,s=500,o=!0;class l{cache=new Map;accessOrder=[];hits=0;misses=0;set(e,t,r=n){if(this.cache.size>=a){let e=this.accessOrder.shift();e&&this.cache.delete(e)}this.cache.set(e,{data:t,timestamp:Date.now(),ttl:r}),this.accessOrder=this.accessOrder.filter(t=>t!==e),this.accessOrder.push(e)}get(e){let t=this.cache.get(e);return t?Date.now()-t.timestamp>t.ttl?(this.cache.delete(e),this.accessOrder=this.accessOrder.filter(t=>t!==e),this.misses++,null):(this.accessOrder=this.accessOrder.filter(t=>t!==e),this.accessOrder.push(e),this.hits++,t.data):(this.misses++,null)}invalidate(e){e?Array.from(this.cache.keys()).filter(t=>t.includes(e)).forEach(e=>{this.cache.delete(e),this.accessOrder=this.accessOrder.filter(t=>t!==e)}):(this.cache.clear(),this.accessOrder=[])}getStats(){let e=this.hits+this.misses;return{size:this.cache.size,maxSize:a,hits:this.hits,misses:this.misses,hitRatio:e>0?this.hits/e:0}}}let c=new l,i=new class{prefix="cc-podcast-cache-";async set(e,t,r=n){try{let n={data:t,timestamp:Date.now(),ttl:r};localStorage.setItem(this.prefix+e,JSON.stringify(n)),await this.cleanup()}catch(n){if(n instanceof DOMException&&"QuotaExceededError"===n.name){console.warn("⚠️ localStorage full, cleaning oldest entries..."),await this.cleanup();try{localStorage.setItem(this.prefix+e,JSON.stringify({data:t,timestamp:Date.now(),ttl:r}))}catch(e){console.warn("StorageCache set failed after cleanup:",e)}}else console.warn("StorageCache set failed:",n)}}async get(e){try{let t=localStorage.getItem(this.prefix+e);if(!t)return null;let r=JSON.parse(t);if(Date.now()-r.timestamp>r.ttl)return localStorage.removeItem(this.prefix+e),null;return r.data}catch(e){return console.warn("StorageCache get failed:",e),null}}async invalidate(e){let t=Object.keys(localStorage).filter(e=>e.startsWith(this.prefix));e?t.filter(t=>t.includes(e)).forEach(e=>localStorage.removeItem(e)):t.forEach(e=>localStorage.removeItem(e))}async cleanup(){let e=Object.keys(localStorage).filter(e=>e.startsWith(this.prefix));e.length>s&&e.map(e=>{try{let t=localStorage.getItem(e);if(!t)return{key:e,timestamp:0};let r=JSON.parse(t);return{key:e,timestamp:r.timestamp||0}}catch{return{key:e,timestamp:0}}}).sort((e,t)=>e.timestamp-t.timestamp).slice(0,e.length-s).forEach(e=>localStorage.removeItem(e.key))}},d=new class{dbName="CauseCommunePodcastCache";version=1;db=null;initPromise=null;async init(){if(!this.db)return this.initPromise||(this.initPromise=new Promise((e,t)=>{if(!window.indexedDB){console.warn("IndexedDB not available"),e();return}let r=indexedDB.open(this.dbName,this.version);r.onerror=()=>{console.warn("IndexedDB open failed:",r.error),e()},r.onsuccess=()=>{this.db=r.result,e()},r.onupgradeneeded=e=>{let t=e.target.result;t.objectStoreNames.contains("podcasts")||t.createObjectStore("podcasts",{keyPath:"key"}).createIndex("timestamp","timestamp"),t.objectStoreNames.contains("shows")||t.createObjectStore("shows",{keyPath:"key"})}})),this.initPromise}async set(e,t,r="podcasts"){if(this.db||await this.init(),this.db)return new Promise((n,a)=>{try{let a=this.db.transaction([r],"readwrite").objectStore(r),s={key:e,data:t,timestamp:Date.now()},o=a.put(s);o.onsuccess=()=>n(),o.onerror=()=>{console.warn("IndexedDB set failed:",o.error),n()}}catch(e){console.warn("IndexedDB set error:",e),n()}})}async get(e,t="podcasts"){return(this.db||await this.init(),this.db)?new Promise(r=>{try{let n=this.db.transaction([t],"readonly").objectStore(t).get(e);n.onsuccess=()=>{let e=n.result;r(e?e.data:null)},n.onerror=()=>{console.warn("IndexedDB get failed:",n.error),r(null)}}catch(e){console.warn("IndexedDB get error:",e),r(null)}}):null}async getAll(e="podcasts"){return(this.db||await this.init(),this.db)?new Promise(t=>{try{let r=this.db.transaction([e],"readonly").objectStore(e).getAll();r.onsuccess=()=>t(r.result.map(e=>e.data)),r.onerror=()=>{console.warn("IndexedDB getAll failed:",r.error),t([])}}catch(e){console.warn("IndexedDB getAll error:",e),t([])}}):[]}
1async invalidate(e){this.db||await this.init(),this.db&&e&&console.warn("Pattern invalidation in IndexedDB not fully implemented")}};class u{requestQueue=new Map;backgroundRefreshQueue=new Set;async get(e,t,r={}){let{ttl:a=n,forceRefresh:s=!1,background:l=!1}=r;if(s)return this.fetchAndCache(e,t,a);let u=c.get(e);return u?(l&&o&&this.scheduleBackgroundRefresh(e,t,a),u):(u=await i.get(e))?(c.set(e,u,a),u):(u=await d.get(e))?(c.set(e,u,a),await i.set(e,u,a),u):this.fetchAndCache(e,t,a)}async fetchAndCache(e,t,r){if(this.requestQueue.has(e))return this.requestQueue.get(e);let n=(async()=>{try{let n=await t();return c.set(e,n,r),await i.set(e,n,r),await d.set(e,n),console.log(`✅ Cache miss - data fetched and cached: ${e}`),n}catch(t){throw console.error(`❌ Fetch failed for ${e}:`,t),t}finally{this.requestQueue.delete(e)}})();return this.requestQueue.set(e,n),n}scheduleBackgroundRefresh(e,t,r){this.backgroundRefreshQueue.has(e)||(this.backgroundRefreshQueue.add(e),setTimeout(async()=>{try{await this.fetchAndCache(e,t,r),console.log(`🔄 Background refresh completed: ${e}`)}catch(t){console.warn(`⚠️ Background refresh failed: ${e}`,t)}finally{this.backgroundRefreshQueue.delete(e)}},100))}async invalidate(e){c.invalidate(e),await i.invalidate(e),await d.invalidate(e),e?console.log(`🗑️ Cache invalidated for pattern: ${e}`):console.log("🗑️ Full cache invalidation")}async preload(e){let t=e.map(({key:e,fetcher:t})=>this.get(e,t,{background:!0}));await Promise.allSettled(t),console.log(`📦 Preloaded ${e.length} items`)}getStats(){return{memory:c.getStats(),requestQueue:this.requestQueue.size,backgroundQueue:this.backgroundRefreshQueue.size}}}let m=new u,h=async()=>{console.log("🔥 Warming up cache...");try{let e=[{key:"recent-podcasts",fetcher:()=>fetch("/api/wp/v2/podcast?per_page=20&orderby=date&order=desc").then(e=>e.json())},{key:"popular-emissions",fetcher:()=>fetch("/api/wp/v2/emissions?per_page=10").then(e=>e.json())}];await m.preload(e),console.log("✅ Cache warmup completed")}catch(e){console.warn("⚠️ Cache warmup failed:",e)}};setInterval(()=>{m.invalidate(),console.log("🧹 Periodic cache cleanup completed")},36e5),e.i(89922);let x=(0,r.createContext)(null),p=({children:e})=>{let[n,a]=(0,r.useState)(!1);(0,r.useEffect)(()=>{(async()=>{try{await h(),a(!0),console.log("✅ Cache system initialized")}catch(e){console.error("❌ Cache initialization failed:",e),a(!0)}})()},[]);let s=async()=>
1{await m.invalidate(),await h()},o=async()=>{await m.invalidate()};return(0,t.jsx)(x.Provider,{value:{isInitialized:n,refresh:s,clearCache:o,getStats:()=>m.getStats()},children:e})};e.s(["default",0,function({children:e}){return(0,t.jsx)(p,{children:e})}],74462)},53474,e=>{"use strict";var t=e.i(43476),r=e.i(71645),n=e.i(51360),a=e.i(48896);function s({variant:e="default",className:a}){let[o,l]=(0,r.useState)(""),[c,i]=(0,r.useState)("idle"),[d,u]=(0,r.useState)(""),m=(0,r.useRef)(null),h="dark"===e,x="compact"===e,p=async e=>{if(e.preventDefault(),!m.current?.value){if(!o.trim())return void u("Veuillez entrer une adresse email.");i("loading"),u("");try{let e=await fetch("/api/newsletter/subscribe",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:o.trim()})}),t=await e.json();if(!e.ok)throw Error(t.error??"Erreur lors de l'inscription");i("success"),l("")}catch(e){u(e instanceof Error?e.message:"Une erreur est survenue."),i("error")}}};return"success"===c?(0,t.jsxs)("div",{className:(0,n.cn)("border-3 border-neo-black p-6 shadow-[5px_5px_0px_0px_#0F0F0F]",h?"bg-neo-black text-white":"bg-white text-neo-black",a),children:[(0,t.jsx)("p",{className:"font-black text-xl uppercase font-condensed tracking-wide mb-2",children:"✓ Inscription confirmée !"}),(0,t.jsx)("p",{className:(0,n.cn)("text-sm",h?"text-gray-300":"text-gray-600"),children:"Vous recevrez la prochaine newsletter hebdomadaire de Radio Cause Commune."})]}):(0,t.jsxs)("div",{className:(0,n.cn)("border-3 border-neo-black shadow-[5px_5px_0px_0px_#0F0F0F]",h?"bg-neo-black text-white":"bg-cc-fond text-neo-black",x?"p-4":"p-6 sm:p-8",a),children:[!x&&(0,t.jsxs)("div",{className:"mb-5",children:[(0,t.jsx)("p",{className:(0,n.cn)("font-black uppercase tracking-widest font-condensed mb-1",x?"text-base":"text-2xl",h?"text-white":"text-neo-black"),children:"◼ La Newsletter"}),(0,t.jsx)("p",{className:(0,n.cn)("text-sm",h?"text-gray-400":"text-gray-600"),children:"Les nouvelles publications de podcasts chaque semaine, directement dans votre boîte mail."})]}),(0,t.jsxs)("form",{onSubmit:p,noValidate:!0,children:[(0,t.jsx)("input",{ref:m,type:"text",name:"website",tabIndex:-1,"aria-hidden":"true",className:"absolute opacity-0 pointer-events-none w-0 h-0"}),(0,t.jsxs)("div",{className:(0,n.cn)("flex gap-0",x?"flex-row":"flex-col sm:flex-row"),children:[(0,t.jsx)("input",{type:"email",value:o,onChange:e=>l(e.target.value),placeholder:"[email protected]",required:!0,disabled:"loading"===c,"aria-label":"Adresse email",className:(0,n.cn)("flex-1 border-3 border-neo-black px-4 py-3 text-sm font-mono","focus:outline-none focus:ring-2 focus:ring-cc-rouge focus:ring-offset-0","disabled:opacity-50",h?"bg-gray-900 text-white placeholder-gray-500 border-gray-600 focus:border-cc-rouge":"bg-white text-neo-black placeholder-gray-400",!x&&"sm:border-r-0")}),(0,t.jsx)("button",{type:"submit",disabled:"loading"===c,className:(0,n.cn)("border-3 border-neo-black px-6 py-3 font-black uppercase tracking-wide text-sm","transition-all duration-150","bg-cc-rouge text-white","hover:-translate-y-[1px] hover:shadow-[3px_3px_0px_0px_#0F0F0F]","active:translate-y-[1px] active:shadow-none","disabled:opacity-40 disabled:pointer-events-none",!x&&"sm:border-l-0 mt-[-3px] sm:mt-0"),children:"loading"===c?"...":"S'abonner"})]}),("error"===c||d)&&(0,t.jsx)("p",{className:"mt-2 text-xs font-mono text-cc-rouge",children:d}),(0,t.jsx)("p",{className:(0,n.cn)("mt-3 text-xs font-mono",h?"text-gray-500":"text-gray-400"),children:"Désabonnement possible à tout moment · Conformément au RGPD"})]})]})}e.s(["NewsletterModal",0,()=>{let{isOpen:e,closeNewsletter:o}=(0,a.useNewsletter)();return((0,r.useEffect)(()=>{let t=t=>{"Escape"===t.key&&e&&o()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[e,o]),(0,r.useEffect)(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),e)?(0,t.jsxs)("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4 md:p-8 animate-fade-in",role:"dialog","aria-modal":"true","aria-label":"S'abonner à la newsletter",children:[(0,t.jsx)("div",{className:"absolute inset-0 bg-neo-black/80 backdrop-blur-sm",onClick:o}),(0,t.jsxs)("div",{className:(0,n.cn)("relative w-full max-w-lg","bg-neo-bg border-4 border-neo-black","shadow-[12px_12px_0px_0px_#000]","animate-slide-up","p-6 md:p-8"),onClick:e=>e.stopPropagation(),children:[(0,t.jsx)("button",{onClick:o,className:(0,n.cn)("absolute top-4 right-4 w-10 h-10 flex items-center justify-center","border-3 border-neo-black","bg-neo-bg hover:bg-neo-black hover:text-neo-bg","shadow-neo-sm hover:shadow-none hover:-translate-y-[2px] hover:-translate-x-[2px]","transition-all duration-200 ease-out"),"aria-label":"Fermer",children:(0,t.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",strokeWidth:"3",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),(0,t.jsx)(s,{variant:"default"})]})]}):null}],53474)},67264,e=>{"use strict";var t=e.i(43476),r=e.i(51360),n=e.i(48896),a=e.i(11802);e.s(["NewsletterToast",0,()=>{let{openNewsletter:e}=(0,n.useNewsletter)(),{showToast:s,dismissToast:o}=(0,a.useNewsletterPromo)();if(!s)return null;let l=()=>{o()};return(0,t.jsxs)("div",{className:(0,r.cn)("fixed bottom-28 right-4 z-[90] w-72","border-3 border-neo-black bg-neo-bg","shadow-[6px_6px_0px_0px_#0F0F0F]","animate-slide-up"),role:"status","aria-live":"polite",children:[(0,t.jsx)("div",{className:"h-1.5 bg-cc-rouge w-full"}),(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2 mb-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"bg-cc-rouge text-white p-1 border-2 border-neo-black shrink-0",children:(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),(0,t.jsx)("path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"})]})}),(0,t.jsx)("p",{className:"font-condensed font-black uppercase text-sm tracking-wide",children:"Nouvelle newsletter !"})]}),(0,t.jsx)("button",{onClick:l,className:"shrink-0 w-6 h-6 flex items-center justify-center hover:bg-neo-black hover:text-neo-bg transition-colors duration-150 border border-neo-black/30","aria-label":"Fermer",children:(0,t.jsx)("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",strokeWidth:"3",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,t.jsx)("p",{className:"text-xs text-gray-600 font-mono mb-3 leading-relaxed",children:"Recevez les nouvelles publications chaque semaine, directement dans votre boîte mail."}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)("button",{onClick:()=>{o(),e()},className:(0,r.cn)("flex-1 border-2 border-neo-black px-3 py-2","bg-cc-rouge text-white font-condensed font-black uppercase text-xs tracking-wide","hover:-translate-y-[1px] hover:shadow-[2px_2px_0px_0px_#0F0F0F]","active:translate-y-0 active:shadow-none","transition-all duration-150"),children:"S'abonner →"}),(0,t.jsx)("button",{onClick:l,className:(0,r.cn)("border-2 border-neo-black px-3 py-2","bg-neo-bg font-condensed font-bold uppercase text-xs text-gray-500","hover:bg-gray-100 transition-colors duration-150"),children:"Non merci"})]})]})]})}])},30289,e=>{"use strict";var t=e.i(43476),r=e.i(71645),n=e.i(57688),a=e.i(22016),s=e.i(18566),o=e.i(51360),l=e.i(10425),c=e.i(55540),i=e.i(31206),d=e.i(9003),u=e.i(5490),m=e.i(60590),h=e.i(90808),x=e.i(55722);
1let p=({value:e,onChange:n,size:a="md",className:s})=>{let[l,c]=(0,r.useState)(!1),i=(0,r.useRef)(null),d=(0,r.useRef)(0),u=(0,r.useRef)(0),m=-135+e/100*270,h=e=>{let t=d.current-e.clientY,r=u.current+t/200*100;n(Math.round(r=Math.max(0,Math.min(100,r))))},x=()=>{c(!1),document.body.style.cursor="",document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",x)};return(0,t.jsx)("div",{className:(0,o.cn)("flex flex-col items-center gap-1",s),children:(0,t.jsxs)("div",{ref:i,className:(0,o.cn)({sm:"w-8 h-8",md:"w-12 h-12",lg:"w-16 h-16"}[a],"relative rounded-full bg-neo-bg border-2 border-neo-black shadow-neo-sm cursor-ns-resize touch-none select-none","active:scale-95 transition-transform",l&&"ring-2 ring-cc-rouge ring-offset-2"),onMouseDown:t=>{c(!0),d.current=t.clientY,u.current=e,document.body.style.cursor="ns-resize",document.addEventListener("mousemove",h),document.addEventListener("mouseup",x)},onTouchStart:t=>{c(!0),d.current=t.touches[0].clientY,u.current=e,document.body.style.overflow="hidden"},onTouchMove:e=>{let t=d.current-e.touches[0].clientY,r=u.current+t/200*100;n(Math.round(r=Math.max(0,Math.min(100,r))))},onTouchEnd:()=>{c(!1),document.body.style.overflow=""},role:"slider","aria-valuenow":e,"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Volume",title:"Volume (glisser vers le haut/bas)",children:[(0,t.jsx)("div",{className:"absolute w-1 h-1/2 bg-neo-black left-1/2 top-0 origin-bottom -translate-x-1/2 rounded-full",style:{transform:`translateX(-50%) rotate(${m}deg)`},children:(0,t.jsx)("div",{className:"w-2 h-2 bg-cc-rouge rounded-full absolute top-1 left-1/2 -translate-x-1/2 border border-neo-black"})}),(0,t.jsx)("div",{className:"absolute inset-0 rounded-full opacity-10 pointer-events-none",style:{backgroundImage:"radial-gradient(circle at center, transparent 30%, #000 31%, #000 33%, transparent 34%)"}})]})})};function b(){return{committed:[],current:"",nextId:1}}function f(e){return e.replace(/\s+/g," ").trim()}function g(e){return f(e).toLowerCase()}function v(e,t){let r=g(e),n=g(t);if(!r||!n||n.startsWith(r)||r.startsWith(n))return!0;let a=r.split(" "),s=n.split(" "),o=Math.min(a.length,s.length,8);if(o<2)return!1;let l=0;for(let e=0;e<o&&a[e]===s[e];e++)l+=1;return l>=3||l>=2&&o>=3}function y(e,t,r,n){let a=f(r);if(!a)return{committed:e,nextId:t};let s=e[e.length-1];return s&&g(s.text)===g(a)?{committed:e,nextId:t}:s&&v(s.text,a)&&a.length>=s.text.length?{committed:e.slice(0,-1).concat({id:s.id,text:a}).slice(-n),nextId:t}:{committed:e.concat({id:t,text:a}).slice(-n),nextId:t+1}}function w(e,t,r=40){let n=f(t);if(!n)return e;let a=e.committed[e.committed.length-1];if(!e.current&&a&&v(a.text,n)){if(n.length<=a.text.length)return e;let t=y(e.committed,e.nextId,n,r);return{...e,committed:t.committed,nextId:t.nextId,current:""}}if(e.current&&!v(e.current,n)){let t=y(e.committed,e.nextId,e.current,r);return{committed:t.committed,nextId:t.nextId,current:n}}return{...e,current:n}}function k(e,t,r=40){let n=f(t)||e.current;if(!n)return{...e,current:""};let a=y(e.committed,e.nextId,n,r);return{committed:a.committed,nextId:a.nextId,current:""}}function j(e,t,r=40){return t.full_text?.trim()?w(e,t.full_text,r):t.delta?.trim()?w(e,`${e.current} ${t.delta}`.trim(),r):e}let N=["Bonjour à toutes et à tous, bienvenue sur Cause Commune.","La transcription s’écrit maintenant phrase après phrase, sans tout remplacer.","Les mots arrivent à la fin de la ligne, et le début reste lisible.","Pendant un silence, le panneau reste ouvert : on peut relire ce qui vient d’être dit."];function C(e,t){return new Promise((r,n)=>{if(t.aborted)return void n(new DOMException("Aborted","AbortError"));let a=setTimeout(r,e);t.addEventListener("abort",()=>{clearTimeout(a),n(new DOMException("Aborted","AbortError"))},{once:!0})})}let S=({enabled:n=!0,onClose:a,socketUrl:s,maxCommitted:l=40,simulate:c=!1,className:i})=>{let[d,u]=(0,r.useState)(()=>b()),[m,h]=(0,r.useState)(!1),[x,p]=(0,r.useState)(!1),f=(0,r.useRef)(b()),g=(0,r.useRef)(null),v=(0,r.useRef)(!0),y=(0,r.useRef)(null),w=(0,r.useRef)(null),S=(0,r.useRef)(null),E=(0,r.useRef)(l);E.current=l;let L=(0,r.useCallback)(e=>{f.current=e,u(e);let t=e.committed[e.committed.length-1];S.current&&t&&!e.current&&(S.current.textContent=t.text)},[]),I=(0,r.useCallback)(()=>{let e=b();f.current=e,u(e),v.current=!0},[]);(0,r.useLayoutEffect)(()=>{let e=g.current;e&&v.current&&(e.scrollTop=e.scrollHeight)},[d]);let A=(0,r.useCallback)(()=>{let e=g.current;e&&(v.current=e.scrollHeight-e.scrollTop-e.clientHeight<56)},[]);if((0,r.useEffect)(()=>
1{if(!n||!c)return;let e=new AbortController;return h(!0),p(!0),w.current=setTimeout(()=>p(!1),3e3),(async()=>{try{for(let t=0;t<2;t++)for(let t of N){if(e.signal.aborted)return;let r=t.split(" "),n="";for(let t of r)n=n?`${n} ${t}`:t,L(j(f.current,{full_text:n},E.current)),await C(70+50*Math.random(),e.signal);L(k(f.current,t,E.current)),await C(700,e.signal)}}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return;throw e}})(),()=>{e.abort(),h(!1),I()}},[n,c,L,I]),(0,r.useEffect)(()=>{if(!n||c){y.current&&(y.current.disconnect(),y.current=null),c||(h(!1),I());return}let t=!0;return(async()=>{try{let{io:r}=await e.A(22025),n=s||`${window.location.origin}`,a=r(n,{path:s?void 0:"/ws/transcript/socket.io",transports:["websocket","polling"],reconnection:!0,reconnectionDelay:2e3,reconnectionAttempts:1/0,timeout:1e4});y.current=a,a.on("connect",()=>{t&&(h(!0),p(!0),w.current&&clearTimeout(w.current),w.current=setTimeout(()=>p(!1),3e3))}),a.on("disconnect",()=>{t&&(h(!1),p(!0))}),a.on("subtitle",e=>{t&&L(j(f.current,e,E.current))}),a.on("subtitle_complete",e=>{t&&e.text?.trim()&&L(k(f.current,e.text,E.current))})}catch(e){console.error("LiveTranscript: erreur de connexion",e)}})(),()=>{t=!1,y.current&&(y.current.disconnect(),y.current=null),w.current&&clearTimeout(w.current)}},[s,n,c,L,I]),!n)return null;let T=d.committed.length>0||d.current.length>0;return(0,t.jsxs)("div",{className:(0,o.cn)("w-full",i),role:"region","aria-label":"Transcription en direct",children:[(0,t.jsx)("div",{className:"sr-only","aria-live":"polite","aria-atomic":"true",ref:S}),(0,t.jsx)("div",{className:"container mx-auto px-4",children:(0,t.jsxs)("div",{className:"relative bg-neo-black border-2 border-neo-black border-b-0 shadow-[4px_-4px_0px_0px] shadow-cc-rouge/40",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 py-1.5 border-b border-gray-800",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:(0,o.cn)("w-2 h-2 rounded-full transition-colors",m?"bg-green-400 animate-pulse":"bg-red-500")}),(0,t.jsx)("span",{className:"font-condensed font-bold text-[11px] uppercase tracking-widest text-gray-400",children:"Transcription IA"}),(0,t.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 bg-cc-rouge/20 text-cc-rouge border border-cc-rouge/30 font-mono font-bold",children:"LIVE"}),c&&(0,t.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 text-amber-300 border border-amber-300/40 font-mono font-bold",children:"DÉMO"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:(0,o.cn)("text-[10px] font-mono transition-opacity duration-300",x?"opacity-100":"opacity-0",m?"text-green-400":"text-red-400"),children:m?"● connecté":"○ déconnecté"}),a&&(0,t.jsx)("button",{type:"button",onClick:a,className:"text-gray-500 hover:text-white transition-colors p-0.5",title:"Masquer la transcription","aria-label":"Masquer la transcription",children:(0,t.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]})]}),(0,t.jsxs)("div",{ref:g,onScroll:A,className:"live-transcript-scroll px-4 py-3 max-h-32 sm:max-h-44 overflow-y-auto overflow-x-hidden",children:[!T&&(0,t.jsx)("p",{className:"font-body text-sm leading-relaxed text-gray-500 italic",children:"En attente de la parole…"}),(0,t.jsxs)("div",{className:"space-y-2",children:[d.committed.map(e=>(0,t.jsx)("p",{className:"font-body text-sm leading-relaxed text-gray-400 break-words",children:e.text},e.id)),d.current&&(0,t.jsxs)("p",{className:"font-body text-sm leading-relaxed text-white font-medium break-words",children:[d.current,(0,t.jsx)("span",{className:"inline-block w-[2px] h-[0.9em] bg-cc-rouge ml-0.5 align-[-0.1em] animate-pulse","aria-hidden":!0})]})]})]})]})})]})};var E=e.i(18840);function L(e){if(!Number.isFinite(e)||e<0)return"0:00";let t=Math.floor(e),r=Math.floor(t/3600),n=Math.floor(t%3600/60),a=t%60;return r>0?`${r}:${n.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`:`${n}:${a.toString().padStart(2,"0")}`}let I=({currentTime:e,duration:n,chapters:a=[],onSeek:s,audioRef:l,className:c,size:i="sm"})=>{let d=(0,r.useRef)(null),[u,m]=(0,r.useState)(null),[h,x]=(0,r.useState)(0),[p,b]=(0,r.useState)(!1),f=Number.isFinite(n)&&n>0?n:0,g=f>0?Math.min(100,Math.max(0,e/f*100)):0,v=a.length>0?Math.max(...a.map(e=>e.seconds)):0,y=(()=>
1{if(v<=0)return f;if(f<=0||v>f)return v;let e=v/f;return a.length>=3&&e<.25?v:f})();(0,r.useEffect)(()=>{let e=l?.current??null;if(!e)return;let t=()=>{try{if(e.buffered.length>0&&f>0){let t=e.buffered.end(e.buffered.length-1);x(Math.min(100,Math.max(0,t/f*100)))}}catch{}};return t(),e.addEventListener("progress",t),e.addEventListener("loadedmetadata",t),e.addEventListener("timeupdate",t),()=>{e.removeEventListener("progress",t),e.removeEventListener("loadedmetadata",t),e.removeEventListener("timeupdate",t)}},[l,f]);let w=(0,r.useCallback)(e=>{let t=d.current;if(!t||f<=0)return 0;let r=t.getBoundingClientRect();return Math.min(1,Math.max(0,(e-r.left)/r.width))*f},[f]),k=(0,r.useCallback)(e=>{if(!a.length)return null;let t=null;for(let r of a)if(r.seconds<=e+.25)t=r;else break;return t},[a]),j=(0,r.useCallback)(e=>{let t=d.current;if(!t)return;let r=t.getBoundingClientRect(),n=Math.min(1,Math.max(0,(e.clientX-r.left)/r.width)),a=n*f;m({leftPct:100*n,time:a,chapter:k(a)}),p&&s(a)},[f,k,p,s,m]),N=(0,r.useCallback)(()=>{p||m(null)},[p,m]),C=(0,r.useCallback)(e=>{s(w(e))},[w,s]),S=(0,r.useCallback)(e=>{f<=0||(e.target.setPointerCapture?.(e.pointerId),b(!0),C(e.clientX))},[f,C,b]),E=(0,r.useCallback)(e=>{p&&(e.target.releasePointerCapture?.(e.pointerId),b(!1),m(null))},[p,b,m]),I=(0,r.useCallback)(t=>{if(f<=0)return;let r=e;switch(t.key){case"ArrowLeft":case"ArrowDown":r=Math.max(0,e-5);break;case"ArrowRight":case"ArrowUp":r=Math.min(f,e+5);break;case"Home":r=0;break;case"End":r=f;break;default:return}t.preventDefault(),s(r)},[e,f,s]);return(0,t.jsxs)("div",{className:(0,o.cn)("group relative w-full select-none","sm"===i?"py-1":"py-1.5",c),children:[(0,t.jsxs)("div",{ref:d,role:"slider",tabIndex:0,"aria-label":"Progression de lecture","aria-valuemin":0,"aria-valuemax":Math.floor(f),"aria-valuenow":Math.floor(e),"aria-valuetext":`${L(e)} sur ${L(f)}`,onPointerDown:S,onPointerMove:j,onPointerUp:E,onPointerLeave:N,onKeyDown:I,className:(0,o.cn)("relative w-full cursor-pointer rounded-full bg-cc-fond","border border-neo-black/15 focu
1s:outline-none","focus-visible:ring-2 focus-visible:ring-cc-rouge focus-visible:ring-offset-1","sm"===i?"h-1.5":"h-2.5"),children:[(0,t.jsx)("div",{className:"absolute inset-y-0 left-0 rounded-full bg-neo-black/10",style:{width:`${h}%`},"aria-hidden":!0}),(0,t.jsx)("div",{className:"absolute inset-y-0 left-0 rounded-full bg-cc-rouge transition-[width] duration-100 ease-linear",style:{width:`${g}%`},"aria-hidden":!0,children:(0,t.jsx)("div",{className:(0,o.cn)("absolute right-0 top-1/2 -translate-y-1/2 -mr-1.5","w-3 h-3 rounded-full bg-cc-rouge border-2 border-neo-black shadow-neo-sm","opacity-0 group-hover:opacity-100 transition-opacity",p&&"opacity-100 scale-110"),"aria-hidden":!0})}),y>0&&a.map((e,r)=>{if(0===r&&e.seconds<=.5)return null;let n=e.seconds/y*100;return n>=100?null:(0,t.jsx)("button",{type:"button",onClick:t=>{t.stopPropagation(),s(e.seconds)},title:`${e.time_code} — ${e.title}`,"aria-label":`Aller au chapitre : ${e.title} (${e.time_code})`,className:(0,o.cn)("absolute top-1/2 -translate-y-1/2 -translate-x-1/2","w-0.5 h-3 bg-neo-black/70 hover:bg-neo-black hover:h-4","transition-all rounded-full"),style:{left:`${n}%`},children:(0,t.jsx)("span",{className:"sr-only",children:e.title})},e.id)})]}),u&&(0,t.jsxs)("div",{className:(0,o.cn)("pointer-events-none absolute -top-9 z-10","bg-neo-black text-white px-2 py-1","font-mono text-[10px] leading-none whitespace-nowrap","border border-neo-black shadow-neo-sm rounded-sm","motion-reduce:transition-none"),style:{left:`${u.leftPct}%`,transform:"translateX(-50%)"},children:[L(u.time),u.chapter&&(0,t.jsxs)("span",{className:"opacity-70",children:[" · ",u.chapter.title]})]})]})},A=({className:e,fixed:b=!0})=>{let f=(0,s.usePathname)(),{state:g,actions:v,audioRef:y}=(0,l.useRadioPlayer)(),{liveData:w}=(0,c.useLiveData)(),k=(0,c.useLiveEpisodeImage)("LIVE"===g.type?w?.current?.url:null),[j,N]=(0,r.useState)(!1),[C,L]=(0,r.useState)(!1),A=function(){let[e,t]=(0,r.useState)(null);return(0,r.useEffect)(()=>{if(window.location.hostname.endsWith(".onion"))try{new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0])),t("standard")}catch{t("restricted")}},[]),e}();r.default.useEffect(()=>{L(new URLSearchParams(window.location.search).has("preview-transcript"))},[]),function(e,t={}){let{state:n,actions:a,audioRef:s}=e,{artworkUrl:o,chapters:l}=t,c=(0,r.useRef)(a),i=(0,r.useRef)(n),d=(0,r.useRef)(l);(0,r.useEffect)(()=>{c.current=a,i.current=n,d.current=l},[a,n,l]),(0,r.useEffect)(()=>{if("u"<typeof navigator||!("mediaSession"in navigator))return;let e=navigator.mediaSession;e.setActionHandler("play",()=>{c.current.play()}),e.setActionHandler("pause",()=>{c.current.pause()});try{e.setActionHandler("seekbackward",e=>{let t=s.current;if(!t)return;let r=e?.seekOffset??15,n=Math.max(0,t.currentTime-r);c.current.seek(n)})}catch{}try{e.setActionHandler("seekforward",e=>{let t=s.current;if(!t)return;let r=e?.seekOffset??15,n=t.duration||i.current.podcastInfo?.duration||0,a=Number.isFinite(n)&&n>0?Math.min(n,t.currentTime+r):t.currentTime+r;c.current.seek(a)})}catch{}try{e.setActionHandler("seekto",e=>{e?.seekTime!=null&&c.current.seek(e.seekTime)})}catch{}try{e.setActionHandler("previoustrack",()=>{let e=s.current,t=d.current;if(!e||!t||0===t.length)return;let r=e.currentTime,n=0;for(let e=0;e<t.length;e++)if(t[e].seconds+3<r)n=t[e].seconds;else break;c.current.seek(n)})}catch{}try{e.setActionHandler("nexttrack",()=>{let e=s.current,t=d.current;if(!e||!t||0===t.length)return;let r=e.currentTime,n=t.find(e=>e.seconds>r+1)?.seconds;null!=n&&c.current.seek(n)})}catch{}return()=>{try{e.setActionHandler("play",null)}catch{}try{e.setActionHandler("pause",null)}catch{}try{e.setActionHandler("seekbackward",null)}catch{}try{e.setActionHandler("seekforward",null)}catch{}try{e.setActionHandler("seekto",null)}catch{}try{e.setActionHandler("previoustrack",null)}catch{}try{e.setActionHandler("nexttrack",null)}catch{}}},[]);let{type:u,isPlaying:m,podcastInfo:h,liveInfo:x}=n;(0,r.useEffect)(()=>{if("u"<typeof navigator||!("mediaSession"in navigator))return;let e=(()=>{if("PODCAST"!==u||!h)return null;let e=h.duration||0;return!Number.isFinite(e)||e<=0?null:{duration:e,position:Math.max(0,Math.min(e,h.currentTime)),playbackRate:n.playbackRate||1}})();if(e)try{navigator.mediaSession.setPositionState(e)}catch{}},[u,h,n.playbackRate]),(0,r.useEffect)(()=>
1{if("u"<typeof navigator||!("mediaSession"in navigator))return;let e="PODCAST"===u?h?.title||"Podcast":x?.current?.name||"Radio Cause Commune",t="PODCAST"===u?h?.episode||"Cause Commune":"93.1 FM · Cause Commune",r=o?[{src:o,sizes:"512x512",type:"image/png"},{src:o,sizes:"256x256",type:"image/png"}]:void 0;navigator.mediaSession.metadata=new MediaMetadata({title:e,artist:t,album:"Radio Cause Commune",artwork:r}),navigator.mediaSession.playbackState=m?"playing":"paused"},[u,m,h,x,o])}({state:g,actions:v,audioRef:y},{artworkUrl:"LIVE"===g.type?k:null}),function(e){let{state:t,actions:n,audioRef:a}=e,s=(0,r.useRef)(n),o=(0,r.useRef)(t);(0,r.useEffect)(()=>{s.current=n,o.current=t},[n,t]);let c=(0,r.useRef)(null);(0,r.useEffect)(()=>{let e=e=>{if(function(e){if(!e)return!1;if(e.isContentEditable)return!0;let t=e.tagName;return"INPUT"===t||"TEXTAREA"===t||"SELECT"===t}(e.target)||e.ctrlKey||e.metaKey||e.altKey)return;let{type:t,volume:r}=o.current,n=a.current;switch(e.key){case" ":case"k":case"K":e.preventDefault(),s.current.togglePlay();break;case"ArrowLeft":if("PODCAST"!==t||!n)return;e.preventDefault(),s.current.seek(Math.max(0,n.currentTime-15));break;case"ArrowRight":{if("PODCAST"!==t||!n)return;e.preventDefault();let r=n.duration||o.current.podcastInfo?.duration||0,a=Number.isFinite(r)&&r>0?Math.min(r,n.currentTime+15):n.currentTime+15;s.current.seek(a);break}case"j":case"J":if("PODCAST"!==t||!n)return;e.preventDefault(),s.current.seek(Math.max(0,n.currentTime-10));break;case"l":case"L":{if("PODCAST"!==t||!n)return;e.preventDefault();let r=n.duration||o.current.podcastInfo?.duration||0,a=Number.isFinite(r)&&r>0?Math.min(r,n.currentTime+10):n.currentTime+10;s.current.seek(a);break}case"ArrowUp":e.preventDefault(),s.current.setVolume(r+5),c.current=null;break;case"ArrowDown":e.preventDefault(),s.current.setVolume(r-5),c.current=null;break;case"m":case"M":if(e.preventDefault(),r>0)c.current=r,s.current.setVolume(0);else{let e=c.current??70;s.current.setVolume(e),c.current=null}break;default:if("PODCAST"===t&&/^[1-7]$/.test(e.key)){let t=l.PLAYBACK_RATES[Number(e.key)-1];null!=t&&(e.preventDefault(),s.current.setPlaybackRate(t))}}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[a])}({state:g,actions:v,audioRef:y});let T=(0,E.useNowChapters)("PODCAST"===g.type?g.podcastInfo?.url??null:null),[M,R]=(0,r.useState)(()=>{let e=localStorage.getItem("cc-transcript-enabled");return null===e||"true"===e}),D=(0,r.useCallback)(()=>{R(e=>{let t=!e;return localStorage.setItem("cc-transcript-enabled",String(t)),t})},[]),P=f?.startsWith("/admin")||f?.startsWith("/moderation");if(r.default.useEffect(()=>{!P&&w&&"LIVE"===g.type&&v.setLiveInfo(w)},[P,w,v,g.type]),P)return null;let{isPlaying:O,volume:$,isConnecting:_,error:z,liveInfo:V,type:B,podcastInfo:F}=g,H=e=>{if(isNaN(e))return"0:00";let t=Math.floor(e/60),r=Math.floor(e%60);return`${t}:${r.toString().padStart(2,"0")}`},W=V?.current?.name||"Les playlists de Cause Commune",q="LIVE"===B&&V?.current?(0,h.parseAirtimeShowName)(W):null,Q="LIVE"===B?q?.cleanTitle||W:F?.title||"Lecture podcast",U="LIVE"===B&&V?.current?.url?V.current.url:null,K=U?(e=>{try{if(e.startsWith("http"))return new URL(e).pathname;return e}catch{return e}})(U):null,J=V?.current?`${new Date(V.current.starts).toLocaleTimeString("fr-FR",{hour:"2-digit",minute:"2-digit"})} - ${new Date(V.current.ends).toLocaleTimeString("fr-FR",{hour:"2-digit",minute:"2-digit"})}`:"16:00 - 19:00",X=V?.current?.description?(0,x.decodeHtmlEntities)(V.current.description).trim():"",Y="LIVE"===B?V?.current?X||`${J} • En direct`:"16:00 - 19:00 • En direct":F?.episode||"Cause Commune Podcast",G="LIVE"===B&&(q?.isDirect??!1),Z=G||C,ee=q?.flags??[],et=q?.episodeNumber;return(0,t.jsxs)("div",{className:(0,o.cn)("border-t-4 border-neo-black transition-all duration-300",b&&["fixed bottom-0 left-0 right-0 z-50","backdrop-blur-lg bg-neo-bg/95"],!b&&"bg-neo-bg",e),children:["restricted"===A&&(0,t.jsx)("div",{className:"bg-cc-rouge text-white text-xs sm:text-sm font-condensed font-bold py-1.5 px-4 text-center border-b-2 border-neo-black",children:"Niveau de sécurité Tor élevé détecté — Basculez sur « Standard » pour activer la lecture audio."}),Z&&(0,t.jsx)(S,{enabled:M,onClose:()=>{R(!1),localStorage.setItem("cc-transcript-enabled","false")},simulate:C&&!G}),"PODCAST"===B&&F&&(0,t.jsx)("div",{className:"absolute top-0 left-0 right-0 z-10 px-2 pt-1",children:(0,t.jsx)(I,{currentTime:F.currentTime,duration:F.duration||0,chapters:T,onSeek:v.seek,audioRef:y,size:"sm"})}),(0,t.jsxs)("div",{className:"container mx-auto px-4 py-3 md:py-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4 flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:(0,o.cn)("relative flex-shrink-0 transition-transform","LIVE"===B&&O&&"motion-reduce:animate-none"),children:["LIVE"===B&&O&&(0,t.jsx)("span",{className:"pointer-events-none absolute -inset-1 rounded-sm border-2 border-cc-rouge motion-reduce:hidden",style:{animation:"cc-onair-pulse 1.8s ease-in-out infinite"},"aria-hidden":!0}),(0,t.jsxs)("div",{className:(0,o.cn)("relative w-12 h-12 md:w-16 md:h-16 border-2 border-neo-black shadow-neo-sm overflow-hidden transition-colors","LIVE"===B?k?"bg-transparent":"bg-cc-rouge flex items-center justify-center":"bg-neo-accent flex items-center justify-center"),children:["LIVE"===B?k?(0,t.jsx)(n.default,{src:k,alt:"Couverture de l'émission en cours",width:64,height:64,className:"w-full h-full object-cover",unoptimized:!1}):(0,t.jsx)(n.default,{src:"/logo/logo-cc-V3-red.png",alt:"Radio Cause Commune",width:48,height:48,className:"w-8 h-8 md:w-10 md:h-10 object-contain"}):(0,t.jsx)("svg",{className:"w-6 h-6 md:w-8 md:h-8 text-neo-black",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 11a7 7 0 01-7 7m0 0a7 7 0 01-7-7m7 7v4m0 0H8m4 0h4m-4-8a3 3 0 01-3-3V5a3 3 0 116 0v6a3 3 0 01-3 3z"})}),_&&(0,t.jsx)("div",{className:"absolute inset-0 motion-reduce:hidden",style:{background:"linear-gradient(90deg, rgba(15,15,15,0) 0%, rgba(15,15,15,0.18) 50%, rgba(15,15,15,0) 100%)",backgroundSize:"200% 100%",animation:"cc-skeleton-shimmer 1.2s linear infinite"},"aria-hidden":!0})]})]}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 flex flex-col gap-1.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:["LIVE"===B&&null!=et&&(0,t.jsx)(m.EpisodeNumberBadge,{number:et,size:"sm",href:K}),(0,t.jsx)("div",{className:"font-condensed font-black text-neo-black text-base md:text-lg truncate leading-tight min-w-0",children:K?(0,t.jsxs)(a.default,{href:K,className:"hover:underline decoration-2 decoration-cc-rouge flex items-center gap-2 group",title:"Accéder à la page de l'émission et au chat",children:[Q,(0,t.jsx)("span",{className:"inline-flex items-center justify-center bg-cc-rouge text-white text-[10px] px-1.5 py-0.5 rounded-sm transform group-hover:-translate-y-0.5 transition-transform",children:"CHAT 💬"})]}):Q}),"LIVE"===B&&ee.length>0&&(0,t.jsx)(u.ShowTypeBadges,{flags:ee,size:"sm"}),"LIVE"===B&&(0,t.jsx)(d.FMStatusBadge,{variant:"minimal"}),Z&&(0,t.jsxs)("button",{onClick:D,className:`flex items-center gap-1 px-2 py-0.5 text-[10px] font-condensed font-bold uppercase tracking-wider border rounded-sm transition-all ${M?"bg-neo-black text-white border-neo-black hover:bg-gray-800":"bg-transparent text-cc-text-secondary border-cc-text-tertiary hover:border-neo-black hover:text-neo-black"}`,title:M?"Masquer la transcription IA":"Afficher la transcription IA","aria-label":M?"Masquer la transcription IA":"Afficher la transcription IA",children:[(0,t.jsx)("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-3l-4 4z"})}),"IA"]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs md:text-sm text-cc-text-secondary min-w-0 truncate",children:["LIVE"===B&&X?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"font-body font-bold text-neo-black/80 truncate",children:X}),(0,t.jsx)("span",{className:"shrink-0 opacity-50","aria-hidden":!0,
1children:"·"}),(0,t.jsx)("span",{className:"shrink-0",children:J})]}):(0,t.jsx)("span",{className:"truncate",children:Y}),"PODCAST"===B&&F&&(0,t.jsxs)("span",{className:"font-mono text-xs bg-neo-black text-white px-1 rounded ml-2 hidden sm:inline-block",children:[H(F.currentTime)," / ",H(F.duration)]})]}),z&&(0,t.jsxs)("div",{className:"text-xs text-cc-danger mt-1 truncate",title:z,children:["⚠️ ",z]})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 md:gap-6",children:["PODCAST"===B&&(0,t.jsxs)("button",{onClick:v.playLive,className:(0,o.cn)("hidden md:flex items-center gap-2 px-4 py-2","bg-white border-2 border-neo-black shadow-neo-sm","font-condensed font-black text-xs uppercase tracking-wider","hover:bg-cc-rouge hover:text-white hover:shadow-neo transition-all hover:-translate-y-0.5 hover:translate-x-0.5"),children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-current rounded-full animate-pulse"}),"Retour au direct"]}),"PODCAST"===B&&(0,t.jsxs)("button",{onClick:v.cyclePlaybackRate,className:(0,o.cn)("px-2.5 py-1.5 border-2 border-neo-black font-mono text-xs font-bold transition-all",1!==g.playbackRate?"bg-neo-black text-white shadow-neo-sm hover:bg-gray-800":"bg-white text-neo-black shadow-neo-sm hover:bg-cc-fond hover:-translate-y-0.5 hover:translate-x-0.5 hover:shadow-neo"),title:`Vitesse : ${g.playbackRate}x`,children:[g.playbackRate,"x"]}),(0,t.jsxs)("button",{onClick:v.togglePlay,disabled:_,className:(0,o.cn)("flex items-center justify-center gap-2 border-2 border-neo-black transition-all shadow-neo-sm group","disabled:opacity-50 disabled:cursor-not-allowed","LIVE"===B?"bg-cc-rouge text-neo-bg hover:bg-cc-rouge-dark px-4 py-2 md:px-6 md:py-3":"bg-neo-black text-white hover:bg-gray-800 px-3 py-2 md:px-5 md:py-3 rounded-full"),children:[_?(0,t.jsx)("div",{className:"w-5 h-5 border-2 border-current border-t-transparent rounded-full animate-spin"}):O?(0,t.jsx)("svg",{className:"w-5 h-5 md:w-6 md:h-6",fill:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M6 4h4v16H6V4zm8 0h4v16h-4V4z"})}):(0,t.jsx)("svg",{className:"w-5 h-5 md:w-6 md:h-6",fill:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M8 5v14l11-7z"})}),"LIVE"===B&&(0,t.jsx)("span",{className:"font-condensed font-black hidden md:inline",children:_?"CONNEXION...":"DIRECT"})]}),(0,t.jsxs)("div",{className:"hidden md:flex items-center gap-3",children:[(0,t.jsx)("button",{onClick:()=>N(!j),className:(0,o.cn)("border-2 border-neo-black bg-white shadow-neo-sm p-2","text-neo-black hover:bg-neo-black hover:text-white transition-all","hover:-translate-y-0.5 hover:translate-x-0.5 hover:shadow-neo",0===$&&"text-gray-400"),title:0===$?"Activer le son":"Couper le son",children:0===$?(0,t.jsxs)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z"}),(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2"})]}):(0,t.jsxs)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[(0,t.jsx)("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}),(0,t.jsx)("path",{d:"M15.54 8.46a5 5 0 0 1 0 7.07"}),(0,t.jsx)("path",{d:"M19.07 4.93a10 10 0 0 1 0 14.14"})]})}),(0,t.jsx)("div",{className:(0,o.cn)("transition-all duration-300 ease-out overflow-visible origin-left",j?"w-16 opacity-100 scale-100":"w-0 opacity-0 scale-90"),children:(0,t.jsx)("div",{className:"py-1 pr-2",children:(0,t.jsx)(p,{value:$,onChange:e=>v.setVolume(e),size:"sm"})})})]}),(0,t.jsx)("div",{className:"hidden sm:flex items-center gap-2",children:(0,t.jsx)(i.default,{title:`${Q} - Cause Commune`,description:`\xc9coutez ${Q} sur Radio Cause Commune`})})]})]}),j&&(0,t.jsx)("div",{className:"md:hidden mt-4 pt-4 border-t border-cc-text-tertiary",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("span",{className:"text-sm font-condensed text-cc-text-secondary w-16",children:"Volume"}),(0,t.jsx)("input",{type:"range",min:"0",max:"100",value:$,onChange:e=>v.setVolume(Number(e.target.value)),className:"flex-1 h-2 bg-cc-fond border border-neo-black appearance-none"})]})})]})]})};e.s(["RadioPlayerUI",0,A,"default",0,A],30289)},65854,e=>{"use strict";var t=e.i(43476),r=e.i(41096),n=e.i(71645),a=e.i(18566),s=e.i(51360);
1let o=(0,n.forwardRef)(({value:e,onChange:r,placeholder:n,isLoading:a,className:o,onKeyDown:l},c)=>(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("input",{ref:c,type:"text",value:e,onChange:e=>r(e.target.value),onKeyDown:l,placeholder:n,className:(0,s.cn)("w-full px-4 py-3 pr-12","bg-cc-blanc border-3 border-neo-black","font-body text-lg text-neo-black","focus:outline-none focus:border-cc-rouge focus:ring-2 focus:ring-cc-rouge focus:ring-offset-2","placeholder:text-cc-text-tertiary",o),autoComplete:"off",spellCheck:"false"}),a&&(0,t.jsx)("div",{className:"absolute right-4 top-1/2 -translate-y-1/2",children:(0,t.jsx)("div",{className:"w-5 h-5 border-2 border-cc-rouge border-t-transparent rounded-full animate-spin"})})]}));o.displayName="SearchInput";var l=e.i(22016);let c=({type:e})=>{let r={podcast:{label:"PODCAST",bg:"bg-cc-rouge",text:"text-cc-blanc"},emission:{label:"ÉMISSION",bg:"bg-neo-purple",text:"text-cc-blanc"},transcription:{label:"TRANSCRIPTION",bg:"bg-neo-accent",text:"text-neo-black"}},n=r[e]||r.podcast;return(0,t.jsx)("span",{className:(0,s.cn)("px-2 py-1 text-xs font-condensed font-black uppercase",n.bg,n.text,"border-2 border-neo-black"),children:n.label})},i=({result:e,onClick:r})=>{let n=()=>{r?.()},a=(0,t.jsx)("div",{className:(0,s.cn)("p-4 border-b-2 border-cc-fond","hover:bg-cc-fond transition-colors","group cursor-pointer"),children:(0,t.jsxs)("div",{className:"flex items-start gap-4",children:[(0,t.jsx)("div",{className:"shrink-0",children:(0,t.jsx)(c,{type:e.type})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("h3",{className:(0,s.cn)("font-condensed font-bold text-lg text-neo-black mb-1","group-hover:text-cc-rouge transition-colors","line-clamp-2"),children:e.title}),e.description&&(0,t.jsx)("p",{className:"text-sm text-cc-text-secondary mb-2 line-clamp-2",children:e.description}),(0,t.jsxs)("div",{className:"flex items-center gap-3 text-xs text-cc-text-tertiary",children:[e.metadata?.showName&&(0,t.jsx)("span",{className:"font-condensed",children:e.metadata.showName}),e.metadata?.episodeNumber&&(0,t.jsxs)("span",{children:["Épisode #",e.metadata.episodeNumber]}),e.metadata?.date&&(0,t.jsx)("span",{children:new Date(e.metadata.date).toLocaleDateString("fr-FR",{day:"numeric",month:"long",year:"numeric"})}),e.metadata?.timestamp&&(0,t.jsxs)("span",{className:"font-mono",children:[Math.floor(e.metadata.timestamp/60),":",Math.floor(e.metadata.timestamp%60).toString().padStart(2,"0")]})]})]}),(0,t.jsx)("div",{className:"shrink-0 text-xs text-cc-text-tertiary font-mono",children:e.score})]})});return e.url&&"#"!==e.url?(0,t.jsx)(l.default,{href:e.url,onClick:n,children:a}):(0,t.jsx)("div",{onClick:n,children:a})},d=({results:e,isLoading:r,error:n,query:a,onResultClick:s})=>!a||a.trim().length<2?(0,t.jsxs)("div",{className:"p-8 text-center",children:[(0,t.jsx)("div",{className:"text-4xl mb-4",children:"🔍"}),(0,t.jsx)("p",{className:"font-condensed font-bold text-lg text-cc-text-secondary",children:"Tapez au moins 2 caractères pour rechercher"})]}):r?(0,t.jsxs)("div",{className:"p-8 text-center",children:[(0,t.jsx)("div",{className:"inline-block w-12 h-12 border-4 border-cc-rouge border-t-transparent rounded-full animate-spin mb-4"}),(0,t.jsx)("p",{className:"font-condensed font-bold text-lg text-cc-text-secondary",children:"Recherche en cours..."})]}):n?(0,t.jsxs)("div",{className:"p-8 text-center",children:[(0,t.jsx)("div",{className:"text-4xl mb-4",children:"⚠️"}),(0,t.jsx)("p",{className:"font-condensed font-bold text-lg text-cc-rouge mb-2",children:"Erreur de recherche"}),(0,t.jsx)("p",{className:"text-sm text-cc-text-secondary",children:n})]}):e&&0!==e.results.length?(0,t.jsxs)("div",{className:"bg-cc-blanc",children:[(0,t.jsx)("div",{className:"p-4 border-b-3 border-neo-black bg-cc-fond",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("p",{className:"font-condensed font-bold text-sm text-cc-text-secondary",children:[e.total," résultat",e.total>1?"s":""," trouvé",e.total>1?"s":""]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[e.byType.podcasts>0&&(0,t.jsxs)("span",{className:"px-2 py-1 bg-cc-rouge text-cc-blanc border-2 border-neo-black font-condensed font-black",children:[e.byType.podcasts," podcasts"]}),e.byType.emissions>0&&(0,t.jsxs)("span",{className:"px-2 py-1 bg-neo-purple text-cc-blanc border-2 border-neo-black font-condensed font-black",children:[e.byType.emissions," émissions"]}),e.byType.transcriptions>0&&(0,t.jsxs)("span",{className:"px-2 py-1 bg-neo-accent text-neo-black border-2 border-neo-black font-condensed font-black",children:[e.byType.transcriptions," transcriptions"]})]})]})}),(0,t.jsx)("div",{className:"divide-y-2 divide-cc-fond",children:e.results.map(e=>(0,t.jsx)(i,{result:e,onClick:s},e.id))})]}):(0,t.jsxs)("div",{className:"p-8 text-center",children:[(0,t.jsx)("div",{className:"text-4xl mb-4",children:"🔍"}),(0,t.jsx)("p",{className:"font-condensed font-bold text-lg text-cc-text-secondary mb-2",children:"Aucun résultat trouvé"}),(0,t.jsx)("p",{className:"text-sm text-cc-text-tertiary",children:"Essayez avec d'autres mots-clés"})]}),u=({isOpen:e,onClose:r})=>{let l=(0,n.useRef)(null),c=(0,n.useRef)(null),i=(0,a.useRouter)(),{query:u,results:m,isLoading:h,error:x,search:p,clear:b}=((e={})=>{let{debounceMs:t=300,minQueryLength:r=2}
1=e,[a,s]=(0,n.useState)(""),[o,l]=(0,n.useState)(null),[c,i]=(0,n.useState)(!1),[d,u]=(0,n.useState)(null),[m,h]=(0,n.useState)("");return(0,n.useEffect)(()=>{let e=setTimeout(()=>{h(a)},t);return()=>clearTimeout(e)},[a,t]),(0,n.useEffect)(()=>{(async()=>{if(!m||m.trim().length<r){l(null),i(!1),u(null);return}i(!0),u(null);try{let e=await fetch(`/api/search?q=${encodeURIComponent(m)}&limit=10`);if(!e.ok)throw Error(`Erreur ${e.status}: ${e.statusText}`);let t=await e.json();l(t)}catch(e){console.error("Erreur recherche:",e),u(e instanceof Error?e.message:"Erreur lors de la recherche"),l(null)}finally{i(!1)}})()},[m,r]),{query:a,results:o,isLoading:c,error:d,search:(0,n.useCallback)(e=>{s(e)},[]),clear:(0,n.useCallback)(()=>{s(""),l(null),u(null)},[])}})();return((0,n.useEffect)(()=>{e&&l.current?setTimeout(()=>{l.current?.focus()},100):b()},[e,b]),(0,n.useEffect)(()=>{let t=t=>{"Escape"===t.key&&e&&r()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[e,r]),(0,n.useEffect)(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),e)?(0,t.jsxs)("div",{className:"fixed inset-0 z-[100] flex items-start justify-center p-4 md:p-8 pt-20 md:pt-24 animate-fade-in",role:"dialog","aria-modal":"true","aria-label":"Recherche",children:[(0,t.jsx)("div",{className:"absolute inset-0 bg-neo-black/80 backdrop-blur-sm",onClick:r}),(0,t.jsxs)("div",{ref:c,className:(0,s.cn)("relative w-full max-w-3xl max-h-[85vh] overflow-hidden","bg-neo-bg border-4 border-neo-black","shadow-[12px_12px_0px_0px_#000]","animate-slide-up","flex flex-col"),onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"p-6 md:p-8 border-b-4 border-neo-black bg-cc-blanc",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("div",{className:"w-8 h-8 flex items-center justify-center bg-neo-black text-neo-bg border-2 border-neo-black",children:(0,t.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}),(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsx)(o,{ref:l,value:u,onChange:p,onKeyDown:e=>{"Enter"===e.key&&u.trim().length>=2&&(e.preventDefault(),r(),i.push(`/recherche?q=${encodeURIComponent(u.trim())}`))},placeholder:"Rechercher dans les podcasts, émissions, transcriptions...",isLoading:h})}),(0,t.jsxs)("button",{onClick:r,className:(0,s.cn)("w-10 h-10 flex items-center justify-center","border-3 border-neo-black","bg-neo-bg hover:bg-neo-black hover:text-neo-bg","shadow-neo-sm hover:shadow-none hover:-translate-y-[2px] hover:-translate-x-[2px]","transition-all duration-200 ease-out","group"),"aria-label":"Fermer",children:[(0,t.jsx)("div",{className:"w-6 h-1 bg-current absolute rotate-45 group-hover:rotate-90 transition-transform duration-200"}),(0,t.jsx)("div",{className:"w-6 h-1 bg-current absolute -rotate-45 group-hover:-rotate-90 transition-transform duration-200"})]})]}),(0,t.jsxs)("div",{className:"mt-4 flex items-center gap-4 text-xs text-cc-text-secondary font-condensed",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("kbd",{className:"px-2 py-1 bg-cc-fond border-2 border-neo-black font-mono text-xs",children:"Esc"}),(0,t.jsx)("span",{children:"fermer"})]}),(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("kbd",{className:"px-2 py-1 bg-cc-fond border-2 border-neo-black font-mono text-xs",children:"↵ Entrée"}),(0,t.jsx)("span",{children:"recherche avancée"})]})]})]}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,t.jsx)(d,{results:m,isLoading:h,error:x,query:u,onResultClick:r})})]})]}):null};e.s(["SearchModalWrapper",0,function(){let{isOpen:e,closeSearch:n}=(0,r.useSearch)();return(0,t.jsx)(u,{isOpen:e,onClose:n})}],65854)}]);

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.