PageSourceSearch

https://www.franceinfo.fr/assets/common/js/utils-96d0cfcb.js

js franceinfo.fr collected 2026-09-24 07:47:05 UTC 15,182 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkfranceinfo_package=self.webpackChunkfranceinfo_package||[]).push([[9980],{2885:function(e,t,n){function r(e){return parseInt(getComputedStyle(document.documentElement).getPropertyValue(e).replace("px",""),10)}n.r(t),n.d(t,{buildSharedUrl:function(){return U},convertHexToRGB:function(){return s},copyToClipboard:function(){return l},createCookie:function(){return d},deleteCookie:function(){return G},fetchBasicAuth:function(){return p},focusJumpClass:function(){return h},focusTrap:function(){return g},getContentId:function(){return y},getFocusableElements:function(){return w},getGraphCommentCount:function(){return J},getSharingTypes:function(){return z},isBreakpoint:function(){return a},isIos:function(){return v},isMobileDevice:function(){return O},isValidEmail:function(){return C},jwtDecode:function(){return E},largeBreakpoint:function(){return c},loadScript:function(){return $},loadStylesheet:function(){return S},mediumBreakpoint:function(){return i},onAreaVisible:function(){return x},onReadyStateChange:function(){return j},onResize:function(){return k},onScroll:function(){return P},onScrollIntoElement:function(){return A},readCookie:function(){return T},replaceTagname:function(){return L},resetFocusOnTop:function(){return M},scrolltoElt:function(){return H},setGraphCommentLabel:function(){return K},setGraphCommentShortLabel:function(){return N},slugify:function(){return F},smallBreakpoint:function(){return o},timeAgo:function(){return q},waitFor:function(){return V},webShare:function(){return W}});const o=r("--small"),i=r("--medium"),c=r("--large");function a(e){switch(e){case"small":return window.innerWidth<i;case"medium":return window.innerWidth<c&&window.innerWidth>=i;case"large":return window.innerWidth>=c;default:return!1}}function u(e,t){return`rgba(${parseInt(e.slice(1,3),16)},${parseInt(e.slice(3,5),16)},${parseInt(e.slice(5,7),16)},${t})`}function s(e,t){const n=e.split(",");let r="";for(let e=0;e<n.length;e++)r+=u(n[e],t),e<n.length-1&&(r+=",");return r}async function l(e){try{if("function"==typeof ClipboardItem&&navigator.clipboard.write){const t=new ClipboardItem({"text/plain":e});await navigator.clipboard.write([t])}else await navigator.clipboard.writeText(e);return!0}catch(e){return console.error("Clipboard operation failed:",e),!1}}const d=(e,t,n,r="days")=>{const o=new Date;if("number"==typeof n)switch(r){case"days":o.setDate(o.getDate()+n);break;case"hours":o.setHours(o.getHours()+n);break;case"minutes":o.setMinutes(o.getMinutes()+n);break;case"months":o.setMonth(o.getMonth()+n)}const i="string"==typeof n&&"date"===r?`; expires=${n}`:`; expires=${o.toUTCString()}`;document.cookie=`${e}=${t}${i}; path=/`};function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function m(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e,t={}){const n=new URL(e),r=n.port?`:${n.port}`:"",o=`${n.protocol}//${n.hostname}${r}${n.pathname}${n.search}`,i=new Headers;if(n.username&&n.password){const e=btoa(`${n.username}:${n.password}`);i.set("Authorization",`Basic ${e}`)}return fetch(o,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach(function(t){m(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({method:"GET",headers:i},t))}const h="focus-jump";function w(e){return[...e.querySelectorAll("a,\n      button,\n      input,\n      textarea,\n      select,\n      iframe,\n      object,\n      summary,\n      audio[controls],\n      video[controls],\n      [contenteditable],\n      [tabindex]\n      ")].filter(e=>!!e.classList.contains(h)||!e.hasAttribute("disabled")&&!e.hasAttribute("hidden")&&!(e.tabIndex<0)&&"none"!==window.getComputedStyle(e).display&&("function"!=typeof e.checkVisibility||e.checkVisibility()))}function b(e){if(document.removeEventListener("keydown",window.focusTrapHandleKey),document.removeEventListener("FocusTrap::exit",()=>b(!0)),e)for(const e of document.querySelectorAll(`.${h}`))e.removeEventListener("focus",window.focusShouldJump),e.remove()}function g(e,t,{elementToFocusAtFirst:n=null,additionalFocusableElements:r=[],waitForTab:o=!1,withJump:i=!1}={}){b(i);const c=[...w(e),...r];if(0===c.length)return;const a=n?c.indexOf(n):0;(function(e,t,n,r){let o;const i=(t,i)=>{o=[...w(e),...n];const c=o.length;if(0===c)return;const a=o.indexOf(document.activeElement);let u;u=i?(a-1+c)%c:(a+1)%c;const s=o[u];r&&s.classList.contains(h)&&(s.dataset.shiftKey=String(i)),(-1===a||i&&0===a||!i&&a===o.length-1)&&(t.preventDefault(),s.focus())};if(window.focusTrapHandleKey=e=>{switch(e.code){case"Escape":b(r),t();break;case"Tab":i(e,e.shiftKey)}},r&&(window.focusShouldJump=e=>{const t=e.target,n="true"===t.dataset.shiftKey;
1t.removeAttribute("data-shift-key"),i(e,n)}),document.addEventListener("keydown",window.focusTrapHandleKey),r){const t=document.createElement("span");t.setAttribute("tabindex","0"),t.setAttribute("aria-hidden","true"),t.classList.add(h,"sr-only"),t.addEventListener("focus",window.focusShouldJump),e.appendChild(t)}document.addEventListener("FocusTrap::exit",()=>b(!0))})(e,t,r,i),!0!==o&&c[a<0?0:a].focus()}function y(e){const t=(e||window.location.pathname).match(/_(\d+).[a-z]+/);return t&&t.length>1?parseInt(t[1],10):null}function v(){return!(!navigator.userAgent||!/ip(hone|od|ad)/i.test(navigator.userAgent))}function O(){const e=navigator.userAgent;if("userAgentData"in navigator)return navigator.userAgentData.mobile;const t=/Android|iPhone|iPad|iPod|BlackBerry|Mobi/i.test(e),n=window.matchMedia("(pointer: coarse)").matches,r=window.matchMedia("(hover: none)").matches;return t||n&&r}function C(e){return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)}function E(e){const t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=decodeURIComponent(atob(t).split("").map(e=>`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));return JSON.parse(n)}function $(e,{attributes:t=[],cmpVendorId:r="",text:o=""}={}){return new Promise(async(i,c)=>{const a=document.createElement("script");for(let e=0;e<t.length;e++)a.setAttribute(t[e].name,t[e].value);a.src=e,a.text=o,a.type="text/javascript",a.onload=i,a.onerror=c,""!==r?(await(await n.e(6247).then(n.bind(n,4416))).default).onVendorAccepted(r,()=>{document.head.appendChild(a)}):document.head.appendChild(a)})}function S(e,{preload:t=!0}={}){return new Promise((n,r)=>{if(document.head.querySelector(`link[href="${e}"]`))return void n(!1);const o=document.createElement("link");o.href=e,o.type="text/css",t?(o.rel="preload",o.setAttribute("as","style"),o.onload=()=>{o.rel="stylesheet",o.onload=null,n(!0)}):(o.rel="stylesheet",o.onload=n),o.onerror=r,document.head.appendChild(o)})}function x(e,t,{offset:n="500px",threshold:r=0,root:o=null,fire_once:i=!0}={}){const c=new IntersectionObserver(([e])=>{e.isIntersecting&&(i&&c.disconnect(),t())},{threshold:r,rootMargin:n,root:o});c.observe(e)}function j(e,t){if(document.readyState===e)return void t();const n=()=>{document.readyState===e&&(t(),document.removeEventListener("readystatechange",n))};document.addEventListener("readystatechange",n)}function k(e,{callOnceBefore:t=!1,wait:r=500}={}){const o={teardown:()=>{}};t&&e(o),n.e(1870).then(n.t.bind(n,8221,23)).then(t=>{const n=t.default(()=>{e(o)},r);o.teardown=()=>{window.removeEventListener("resize",n)},window.addEventListener("resize",n)})}function I(e,t,{throttleMaxWait:r,callOnceBefore:o}){n.e(1832).then(n.t.bind(n,7350,23)).then(n=>{const i=n.default(t,r);let c=null;function a(){c&&window.cancelAnimationFrame(c),c=window.requestAnimationFrame(()=>{i(a)})}e.addEventListener("scroll",a),o&&a()}).catch(e=>{throw new Error(e)})}function P(e,{throttleMaxWait:t=150,callOnceBefore:n=!1}={}){return I(window,e,{throttleMaxWait:t,callOnceBefore:n})}function A(e,t,{throttleMaxWait:n=150,callOnceBefore:r=!1}={}){return I(e,t,{throttleMaxWait:n,callOnceBefore:r})}function T(e){const t=`${e}=`,n=document.cookie.split(";");for(let e=0;e<n.length;e++){let r=n[e];for(;" "===r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(t))return r.substring(t.length,r.length)}return null}function L(e,t){if(e.tagName===t.toUpperCase())return;const n=document.createElement(t);for(let t=0,r=e.attributes.length;t<r;++t){const{nodeName:r}=e.attributes.item(t),{nodeValue:o}=e.attributes.item(t);n.setAttribute(r,o)}n.innerHTML=e.innerHTML,e.parentNode.replaceChild(n,e)}function M(e={mainEl:document.body}){const t="fake-button-focus-top";let n=document.getElementById(t);n||(n=document.createElement("button"),n.id=t,n.tabIndex=-1,n.style.outline="none",n.style.position="absolute",e.mainEl.insertBefore(n,e.mainEl.firstChild)),n.focus({preventScroll:!0}),document.dispatchEvent(new CustomEvent("FocusTrap::exit"))}function D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function B(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?D(Object(n),!0).forEach(function(t){_(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function H(e,t={},n=null){const r=B(B({},{duration:100,offset:0}),t);if(!(e instanceof HTMLElement||"number"==typeof e))return;const o=getComputedStyle(document.documentElement),i={easeInOutQuad(e){return e<.5?2*e*e:(4-2*e)*e-1}};let c=!1;["touchmove","wheel"].forEach(e=>{document.addEventListener(e,()=>{c=!0})});const a=window.scrollY,u="now"in window.performance?performance.now():(new Date).getTime(),s=document.documentElement.clientHeight,l=Math.max(document.body.scrollHeight,document.body.offsetHeight,s,document.documentElement.scrollHeight,document.documentElement.offsetHeight),d=window.innerHeight||s||document.getElementsByTagName("body")[0].clientHeight,f="number"==typeof e?e:e.getBoundingClientRect().top+window.scrollY+r.offset,m=Math.round(l-f<d?l-d:f);if("requestAnimationFrame"in window==0)return window.scrollTo(0,m),void(n&&n());const p=()=>{const e=parseFloat(o.getPropertyValue("--offset-sticky-top"))||0,t=m-(e>0?e+10:e),s="now"in window.performance?performance.now():(new Date).getTime(),l=Math.min(1,(s-u)/r.duration),d=i.easeInOutQuad(l);window.scroll(0,Math.ceil(d*(t-a)+a)),window.scrollY===t||c||l>=1?n&&n():(requestAnimationFrame(p),document.activeElement.blur())};p()}function F(e){const t="àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;",n=new RegExp(t.split("").join("|"),"g");return e.toString().toLowerCase().replace(/\s+/g,"-").replace(n,e=>"aaaaaaaaaacccddeeeeeeeegghiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------".charAt(t.indexOf(e))).replace(/&/g,"-and-").replace(/[^\w-]+/g,"-").replace(/--+/g,"-").replace(/^-+/,"").replace(/-+$/,"")}const R="CS2-765";function U(e,t,n){const r=(n||(document.head.querySelector("[rel=canonical]")?document.head.querySelector("[rel=canonical]").href:document.location.href.split("#")[0]))+"#"+`xtor=${R}-[${t}]-`,o=function(e){let t=document.title;return e.dataset.text&&(t=decodeURIComponent(e.dataset.text)),t}(e);switch(t){case"facebook":return`https://www.facebook.com/sharer.php?u=${encodeURIComponent(r)}&t=${encodeURIComponent(o)}`;case"whatsapp":return`${O()?"whatsapp:/":"https://web.whatsapp.com"}/send?text=${encodeURIComponent(r)}`;case"twitter":return`https://twitter.com/share?url=${encodeURIComponent(r)}&text=${encodeURIComponent(o)}&via=franceinfo`;case"email":return`mailto:?subject=${o}&body=${encodeURIComponent(r)}`;default:return r}}function z(){return["facebook","whatsapp","twitter","share","email","link","copy"]}function q(e){const t=["seconde","minute","heure","jour","semaine","mois","an","décennie"],n=[60,60,24,7,4.35,12,10];let r,o=Date.now()-e;for(o/=1e3,r=0;o>=n[r]&&r<n.length-1;r++)o/=n[r];return o=Math.round(o),1!==o&&"s"!==t[r].slice(-1)&&(t[r]+="s"),o>0?`il y a ${o} ${t[r]}`:""}function V(e,t=null){return new Promise((n,r)=>{let o=null;const i=()=>{e()&&(clearInterval(o),n(!0))};o=setInterval(i,100),i(),t&&setTimeout(()=>{clearInterval(o),r()},t)})}async function W(e,t=""){if(navigator.share)try{return await navigator.share({title:"franceinfo",text:t,url:e}),!0}catch(e){return console.error("Error sharing",e),!1}return Promise.resolve(!1)}function G(e,t,n){const r=[e+"=","expires=Thu, 01 Jan 1970 00:00:01 GMT","path="+(n||"/")];t&&r.push("domain="+t),document.cookie=r.join(";")}async function J(){const e=await Promise.resolve().then(n.bind(n,2885)),t=e.getContentId(),r="data-gc-count",o=`ftviGraphCommentCountContentId${t}`,i=e.readCookie(o);if(i)return Promise.resolve(parseInt(i,10));const c=document.querySelector(".gc-counter");if(c){var a;c.removeAttribute(r);const e=null!==(a=c.getAttribute(r))&&void 0!==a?a:"0";return Promise.resolve(parseInt(e,10))}const u=function(e){const t=document.createElement("span");return t.style.display="none",t.className="gc-counter",e&&(t.dataset.uid=String(e)),t.dataset.url=window.location.href,document.body.appendChild(t),t}(t),s=await(await n.e(3355).then(n.bind(n,6672))).default,l=await s.getConfig(),d=l.comments.graphcommentUrl;return await e.loadScript(`${d}/helpers_counter.js?${Date.now()}`,{attributes:[{name:"class",value:"graphComment-script"}]}).then(()=>{window.__semio__helpers_counter?window.__semio__helpers_counter(l.comments.graphcommentId):console.error("GraphComment helpers_counter non disponible")}),new Promise(t=>{const n=new MutationObserver(r=>{r.forEach(r=>{if("characterData"===r.type||"childList"===r.type){n.disconnect();const i=r.target.textContent||"0";e.createCookie(o,i,5,"minutes"),t(parseInt(i,10))}})});n.observe(u,{childList:!0,characterData:!0,subtree:!0})})}function K(e){return e?`${e} commentaire${e>1?"s":""}`:"commenter"}function N(e){return e?`${e} com.`:"commenter"}}}]);

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.