1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9856],{79856:function(e,t,n){n.d(t,{ContentEngagement:function(){return N}});var r=n(57437),l=n(2265),a=n(27648),s=n(61496),o=n(66754),i=n(80498),u=n(1750);n(83079);var c=n(12119),d=(0,c.$)("2b34293fbf7e159665f1018cb6a31ec9dd14ecc9"),f=(0,c.$)("6bc1116a3b97c5e71d780ba19a0d473d879dd21b");(0,c.$)("f86de255e48b364e3bd313186df42933ad51be0c");var m=(0,c.$)("d00b4587772c030cd9384ee693229b398a081dc5"),h=(0,c.$)("7b31c1a790e4207fa9b30f667e3e71052d21c286"),p=n(70417),x=n(76818);function g(e){let{value:t,onChange:n,placeholder:a="\xc9crivez un commentaire⦠Utilisez @ pour mentionner",disabled:s=!1,rows:o=3,className:i}=e,c=(0,l.useRef)(null),[d,m]=(0,l.useState)([]),[h,g]=(0,l.useState)(null),[b,v]=(0,l.useState)(0),[w,j]=(0,l.useState)(!1),N=(e,t)=>{let n=function(e,t){let n=e.slice(0,t),r=n.lastIndexOf("@");if(r<0||r>0&&!/\s/.test(n[r-1]))return null;let l=n.slice(r+1);return l.includes("\n")||l.includes("[")||l.length>40?null:{start:r,query:l}}(e,t);if(!n){m([]),g(null);return}g(n.start),v(0),j(!0),f(n.query).then(e=>m(e)).finally(()=>j(!1))};(0,l.useEffect)(()=>{if(null==h)return;let e=e=>{var t,n;(null===(n=c.current)||void 0===n?void 0:null===(t=n.parentElement)||void 0===t?void 0:t.contains(e.target))||(m([]),g(null))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[h]);let y=e=>{let r=c.current;if(!r||null==h)return;let l=r.selectionStart,a=(0,p.c$)(e.id,e.full_name),s=t.slice(0,h),o=t.slice(l);n("".concat(s).concat(a," ").concat(o)),m([]),g(null),requestAnimationFrame(()=>{let e=s.length+a.length+1;r.focus(),r.setSelectionRange(e,e)})};return(0,r.jsxs)("div",{className:"relative min-w-0 flex-1",children:[(0,r.jsx)(x.g,{ref:c,placeholder:a,value:t,disabled:s,rows:o,className:null!=i?i:"min-h-[80px] resize-y py-2 font-sans text-sm",onChange:e=>{let t=e.target.value;n(t),N(t,e.currentTarget.selectionStart)},onKeyUp:e=>{N(t,e.currentTarget.selectionStart)},onClick:e=>{N(t,e.currentTarget.selectionStart)},onKeyDown:e=>{if(0!==d.length){if("ArrowDown"===e.key)e.preventDefault(),v(e=>(e+1)%d.length);else if("ArrowUp"===e.key)e.preventDefault(),v(e=>(e-1+d.length)%d.length);else if("Enter"===e.key||"Tab"===e.key){e.preventDefault();let t=d[b];t&&y(t)}else"Escape"===e.key&&(m([]),g(null))}}}),null!=h&&(w||d.length>0)?(0,r.jsxs)("ul",{className:"absolute bottom-full z-20 mb-1 max-h-48 w-full overflow-auto rounded-lg border border-border bg-card py-1 shadow-md",role:"listbox",children:[w&&0===d.length?(0,r.jsx)("li",{className:"px-3 py-2 font-sans text-xs text-muted-foreground",children:"Rechercheâ¦"}):null,d.map((e,t)=>(0,r.jsx)("li",{children:(0,r.jsxs)("button",{type:"button",role:"option","aria-selected":t===b,className:"flex w-full items-center gap-2 px-3 py-2 text-left font-sans text-sm transition ".concat(t===b?"bg-muted text-foreground":"hover:bg-muted/60"),onMouseDown:t=>{t.preventDefault(),y(e)},children:[e.avatar_url?(0,r.jsx)("img",{src:e.avatar_url,alt:"",className:"h-7 w-7 rounded-full object-cover"}):(0,r.jsx)("span",{className:"flex h-7 w-7 items-center justify-center rounded-full bg-muted text-xs font-semibold text-muted-foreground",children:e.full_name.charAt(0)}),(0,r.jsxs)("span",{className:"min-w-0 flex-1 truncate",children:[(0,r.jsxs)("span",{className:"inline-flex max-w-full items-center gap-1.5",children:[(0,r.jsx)("span",{className:"truncate font-medium",children:e.full_name}),e.is_premium?(0,r.jsx)(u.$M,{}):null]}),e.job_title?(0,r.jsx)("span",{className:"block truncate text-xs text-muted-foreground",children:e.job_title}):null]})]})},e.id))]}):null]})}var b=n(62869),v=n(70544),w=n(79320),j=n(14438);function N(e){let{kind:t,targetId:n,actionUrl:u,contextLabel:c,initialStats:f,allowedDomains:x,enabled:N=!0,className:y}=e,[C,S]=(0,l.useState)(f.is_liked_by_me),[_,L]=(0,l.useState)(f.likes_count),[k,F]=(0,l.useState)(f.comments_count),[A,M]=(0,l.useState)(!1),[$,E]=(0,l.useState)([]),[U,z]=(0,l.useState)(!1),[I,R]=(0,l.useState)(""),[O,T]=(0,l.useState)(!1);if(!N)return null;let D=async()=>{let e=!C;S(e),L(t=>e?t+1:Math.max(0,t-1));let r=await m(t,n);r.success||(S(!e),L(t=>e?Math.max(0,t-1):t+1),j.Am.error(r.error||"Erreur lors de l'action."))},P=async()=>
1{if(A){M(!1);return}M(!0),0===$.length&&k>0&&(z(!0),E(await h(t,n)),z(!1))},Z=async()=>{if(!I.trim())return;T(!0);let e=await d({kind:t,targetId:n,content:I,actionUrl:u,contextLabel:c});e.success?(R(""),F(e=>e+1),j.Am.success("Commentaire ajout\xe9 !"),E(await h(t,n))):j.Am.error(e.error||"Erreur lors de l'envoi du commentaire."),T(!1)};return(0,r.jsxs)("div",{className:y,children:[(0,r.jsxs)("div",{className:"flex items-center gap-6 border-t border-border/60 bg-muted/20 px-4 py-2",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>void D(),className:"flex items-center gap-2 text-sm font-medium transition ".concat(C?"text-red-500 hover:text-red-600":"text-muted-foreground hover:text-foreground"),children:[(0,r.jsx)(s.Z,{className:"h-4 w-4 ".concat(C?"fill-current":"")}),_>0?_:"J'aime"]}),(0,r.jsxs)("button",{type:"button",onClick:()=>void P(),className:"flex items-center gap-2 text-sm font-medium text-muted-foreground transition hover:text-foreground",children:[(0,r.jsx)(o.Z,{className:"h-4 w-4"}),k>0?k:"Commenter"]})]}),A?(0,r.jsxs)("div",{className:"space-y-4 border-t border-border/60 bg-muted/10 p-4",children:[U?(0,r.jsx)("p",{className:"text-center text-xs text-muted-foreground",children:"Chargementâ¦"}):$.length>0?(0,r.jsx)("div",{className:"space-y-4",children:$.map(e=>{var t;return(0,r.jsxs)("div",{className:"flex gap-3 text-sm",children:[e.author.avatar_url?(0,r.jsx)("img",{src:e.author.avatar_url,alt:"",className:"h-8 w-8 shrink-0 rounded-full object-cover"}):(0,r.jsx)("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-muted",children:(0,r.jsx)("span",{className:"text-xs font-semibold text-muted-foreground",children:(null===(t=e.author.full_name)||void 0===t?void 0:t.charAt(0))||"?"})}),(0,r.jsxs)("div",{className:"flex-1 rounded-lg bg-muted/50 p-2.5",children:[(0,r.jsxs)("div",{className:"mb-1 flex items-center justify-between gap-2",children:[(0,r.jsx)(a.default,{href:"/members/".concat(e.author.id),className:"font-semibold hover:underline",children:e.author.full_name}),(0,r.jsx)("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:function(e){let t=new Date(e),n=Math.floor((new Date().getTime()-t.getTime())/1e3);return n<60?"\xc0 l'instant":n<3600?"Il y a ".concat(Math.floor(n/60)," min"):n<86400?"Il y a ".concat(Math.floor(n/3600)," h"):"Il y a ".concat(Math.floor(n/86400)," j")}(e.created_at)})]}),(0,r.jsx)("p",{className:"whitespace-pre-wrap leading-relaxed text-foreground",children:function(e,t){let n=/(https?:\/\/[^\s]+)/g;return(0,p.i5)(e).map((e,l)=>"mention"===e.type?(0,r.jsxs)(a.default,{href:"/members/".concat(e.contactId),className:"font-semibold text-brand hover:underline",children:["@",e.name]},"m-".concat(l)):e.value.split(n).map((e,a)=>{if(!e)return null;if(e.match(n)){let n=(0,v.MH)(e);return(0,w.R)(e,t)?(0,r.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"font-medium text-brand hover:underline",children:n},"".concat(l,"-").concat(a)):(0,r.jsx)("span",{className:"break-all text-amber-600",title:"Lien non autoris\xe9",children:n},"".concat(l,"-").concat(a))}return(0,r.jsx)("span",{children:e},"".concat(l,"-").concat(a))}))}(e.content,x)})]})]},e.id)})}):null,(0,r.jsxs)("div",{className:"mt-4 flex gap-3",children:[(0,r.jsx)(g,{value:I,onChange:R,disabled:O}),(0,r.jsx)(b.z,{className:"h-[80px] w-10 shrink-0 self-start p-0",onClick:()=>void Z(),disabled:!I.trim()||O,children:(0,r.jsx)(i.Z,{className:"h-4 w-4"})})]})]}):null]})}},1750:function(e,t,n){n.d(t,{$M:function(){return a},FT:function(){return o},S_:function(){return s}});var r=n(57437),l=n(94508);function a(e){let{className:t,size:n="sm"}=e;return(0,r.jsx)("span",{className:(0,l.cn)("inline-flex shrink-0 items-center justify-center rounded-full bg-brand-red font-sans font-semibold uppercase leading-none text-brand-red-foreground","sm"===n&&"h-3.5 w-3.5 text-[9px]","md"===n&&"h-4 w-4 text-[10px]",t),title:"Membre Premium","aria-label":"Membre Premium",children:"P"})}function s(e){let{name:t,isPremium:n=!1,className:s,nameClassName:o,markSize:i="sm"}=e;return(0,r.jsxs)("span",{className:(0,l.cn)("inline-flex min-w-0 max-w-full items-center gap-1.5",s),children:[(0,r.jsx)("span",{className:(0,l.cn)("min-w-0 truncate",o),children:t}),n?(0,r.jsx)(a,{size:i}):null]})}function o(e){return e?"ring-2 ring-brand-red ring-offset-2 ring-offset-background":""}},70544:function(e,t,n){n.d(t,{$j:function(){return x},Cf:function(){return d},MH:function(){return i},ZI:function(){return p}});let r={"leparisien.fr":"Le Parisien","lequipe.fr":"L'\xc9quipe","lefigaro.fr":"Le Figaro","lemonde.fr":"Le Monde","francetvinfo.fr":"France Info","franceinfo.fr":"France Info","ouest-france.fr":"Ouest-France","rmcsport.fr":"RMC Sport","rmcsport.bfmtv.com":"RMC Sport","eurosport.fr":"Eurosport","sport24.lefigaro.fr":"Sport24","sportbuzzbusiness.fr":"Sport Buzz Bu
1siness","filieresport.com":"Fili\xe8re Sport","sportspro.com":"SportsPro","sportsbusinessjournal.com":"Sports Business Journal","lalettre.fr":"La Lettre","latribune.fr":"La Tribune","lesechos.fr":"Les \xc9chos","bfmtv.com":"BFMTV","linkedin.com":"LinkedIn","x.com":"X","twitter.com":"X","youtube.com":"YouTube","youtu.be":"YouTube"},l=["placeholder_ogimage","placeholder-og","default-og","default_og","default-share","default_share","og-default","fallback-og"],a=new Set(["JO","JOA","JOP","PSG","OM","OL","ASSE","FIFA","UEFA","NBA","NFL","IOC","CIO","F1","UCI","FFR","LFP","FFF","COJOP"]);function s(e){try{return new URL(e).hostname.replace(/^www\./i,"").toLowerCase()}catch(e){return""}}function o(e){let t=e.replace(/^www\./i,"").toLowerCase();if(!t)return"Lien";if(r[t])return r[t];let n=t.split(".");if(n.length>2){let e=n.slice(-2).join(".");if(r[e])return r[e]}return t}function i(e){return o(s(e))}function u(e){return e.replace(/[)\].,!?\u2026]+$/u,"")}function c(e){try{let t=new URL(u(e.trim()));return t.hash="",t.hostname=t.hostname.replace(/^www\./i,"").toLowerCase(),t.pathname=t.pathname.replace(/\/+$/,""),t.search="",t.toString()}catch(t){return u(e).trim().toLowerCase()}}function d(e,t){let n=c(e),r=c(t);if(!n||!r)return!1;if(n===r)return!0;let l=n.length<=r.length?n:r,a=n.length>r.length?n:r;return!(l.length<36)&&a.startsWith(l)}function f(e,t){var n;let r=null!==(n=null==e?void 0:e.trim())&&void 0!==n?n:"";if(!r)return!0;let l=s(t),a=o(l),i=g(r);return!i||i===g(a)||i===g(l)||i===g(l.replace(/\.[a-z]+$/i,""))}function m(e){let t=e.trim();return!(!t||a.has(t.toUpperCase()))&&!!(/^\d{6,}$/.test(t)||/^[A-Z0-9]{6,}$/.test(t)&&/[A-Z]/.test(t))}function h(e,t){let n=e[t],r=e[t+1],l=e[t+2];return!!(n&&r&&l&&/^\d{2}$/.test(n)&&/^\d{2}$/.test(r)&&/^\d{4}$/.test(l))}function p(e){var t,n;let r=x(e),l=!!r.title&&!/[.:!?]/.test(r.title)&&r.title===(null===(t=r.title)||void 0===t?void 0:t.toLowerCase().replace(/^./,e=>e.toUpperCase()));return!r.imageUrl||!r.title||f(e.title,e.url)||/[A-Z0-9]{10,}/.test(null!==(n=r.title)&&void 0!==n?n:"")||l}function x(e){var t,n;let r=e.url,a=s(r),i=o(a),u=((null===(t=e.title)||void 0===t?void 0:t.trim())||"").split(/\s+/).filter(e=>!m(e.replace(/[^A-Za-z0-9]/g,""))).join(" ").replace(/\s+/g," ").trim()||null,c=f(u,r)?function(e){try{let t=new URL(e).pathname.replace(/\/+$/,"").split("/").filter(Boolean),n=t[t.length-1];if(!n)return null;let r=n.replace(/\.(html?|php|aspx)$/i,"").split(/[-_]+/).filter(Boolean),l=r.filter((e,t)=>!(m(e)||h(r,t)||t>=1&&h(r,t-1)||t>=2&&h(r,t-2)));if(l.length<3)return null;let a=l.join(" ").replace(/\s+/g," ").trim();if(a.length<12)return null;return a.charAt(0).toUpperCase()+a.slice(1)}catch(e){return null}}(r):u,d=(null===(n=e.description)||void 0===n?void 0:n.trim())||null,p=d&&g(d)!==g(null!=c?c:"")?d:null;return{href:r,hostname:a,sourceLabel:i,title:c,description:p,imageUrl:!function(e){if(!e)return!0;let t=e.toLowerCase();return l.some(e=>t.includes(e))}(e.image_url)?e.image_url.trim():null,faviconUrl:a?"https://www.google.com/s2/favicons?domain=".concat(encodeURIComponent(a),"&sz=64"):null}}function g(e){return e.normalize("NFD").replace(RegExp("\\p{M}","gu"),"").toLowerCase().replace(/^(le|la|les|l'|the)\s+/i,"").replace(/[^a-z0-9]+/g,"")}},70417:function(e,t,n){n.d(t,{c$:function(){return l},i5:function(){return a}});let r=/@\[([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}):([^\]]+)\]/g;function l(e,t){let n=t.replace(/[\[\]]/g,"").trim()||"Membre";return"@[".concat(e,":").concat(n,"]")}function a(e){let t;let n=[],l=RegExp(r.source,"g"),a=0;for(;null!=(t=l.exec(e));)t.index>a&&n.push({type:"text",value:e.slice(a,t.index)}),n.push({type:"mention",contactId:t[1],name:t[2]}),a=t.index+t[0].length;return a<e.length&&n.push({type:"text",value:e.slice(a)}),n.length>0?n:[{type:"text",value:e}]}},79320:function(e,t,n){n.d(t,{R:function(){return r}});function r(e,t){let n=e.trim();if(!n||0===t.length)return!1;try{let e=new URL(n);if("http:"!==e.protocol&&"https:"!==e.protocol)return!1;let r=e.hostname.toLowerCase();return t.some(e=>r===e||r.endsWith(".".concat(e.toLowerCase())))}catch(e){return!1}}}}]);
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.