@20minutes/hela
Advanced tools
Comparing version 1.8.5 to 1.8.6
var D = Object.defineProperty; | ||
var W = (e, t, o) => t in e ? D(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o; | ||
var b = (e, t, o) => (W(e, typeof t != "symbol" ? t + "" : t, o), o); | ||
const j = () => { | ||
const e = document.querySelector(".js-limit-scroll-close-article-btn"); | ||
e && new IntersectionObserver(([o]) => { | ||
const n = document.querySelector(".c-close-article-btn"); | ||
n && (n.style.visibility = o.isIntersecting || o.boundingClientRect.top < 0 ? "hidden" : "visible"); | ||
}).observe(e); | ||
}, F = (e) => { | ||
var m = (e, t, o) => (W(e, typeof t != "symbol" ? t + "" : t, o), o); | ||
const O = () => { | ||
const e = document.querySelector("header"), t = document.querySelector(".js-limit-scroll-close-article-btn"); | ||
if (e && t) { | ||
const o = document.querySelector(".c-close-article-btn"); | ||
if (o) { | ||
const n = new IntersectionObserver(([r]) => { | ||
o.style.visibility = r.isIntersecting ? "hidden" : "visible"; | ||
}); | ||
new IntersectionObserver(([r]) => { | ||
o.style.visibility = r.isIntersecting || r.boundingClientRect.top < 0 ? "hidden" : "visible"; | ||
}).observe(t), n.observe(e); | ||
} | ||
} | ||
}, j = (e) => { | ||
e.stopImmediatePropagation(), e.preventDefault(); | ||
@@ -19,3 +26,3 @@ const t = e.currentTarget; | ||
} | ||
}, O = (e = document.querySelector( | ||
}, F = (e = document.querySelector( | ||
".js-collapse__button" | ||
@@ -25,3 +32,3 @@ )) => { | ||
o.addEventListener("click", (n) => { | ||
F(n); | ||
j(n); | ||
}); | ||
@@ -45,4 +52,4 @@ }); | ||
else { | ||
const m = Math.floor(f / 864e5), p = Math.floor(f % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60)), h = Math.floor(f % (1e3 * 60 * 60) / (1e3 * 60)), R = Math.floor(f % (1e3 * 60) / 1e3); | ||
n.innerHTML = m.toString(), s.innerHTML = p.toString(), r.innerHTML = h.toString(), a.innerHTML = R.toString(); | ||
const p = Math.floor(f / 864e5), b = Math.floor(f % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60)), h = Math.floor(f % (1e3 * 60 * 60) / (1e3 * 60)), R = Math.floor(f % (1e3 * 60) / 1e3); | ||
n.innerHTML = p.toString(), s.innerHTML = b.toString(), r.innerHTML = h.toString(), a.innerHTML = R.toString(); | ||
} | ||
@@ -160,6 +167,6 @@ }, 1e3); | ||
constructor(t) { | ||
b(this, "$el"); | ||
b(this, "id"); | ||
b(this, "previouslyFocused"); | ||
b(this, "shown"); | ||
m(this, "$el"); | ||
m(this, "id"); | ||
m(this, "previouslyFocused"); | ||
m(this, "shown"); | ||
this.$el = t, this.id = this.$el.getAttribute("data-a11y-dialog") || this.$el.id, this.previouslyFocused = null, this.shown = !1, this.maintainFocus = this.maintainFocus.bind(this), this.bindKeypress = this.bindKeypress.bind(this), this.handleTriggerClicks = this.handleTriggerClicks.bind(this), this.show = this.show.bind(this), this.hide = this.hide.bind(this), this.$el.setAttribute("aria-hidden", "true"), this.$el.setAttribute("aria-modal", "true"), this.$el.setAttribute("tabindex", "-1"), this.$el.hasAttribute("role") || this.$el.setAttribute("role", "dialog"), document.addEventListener("click", this.handleTriggerClicks, !0); | ||
@@ -265,5 +272,5 @@ } | ||
}), U = ({ navigatedList: e, nextBtn: t, prevBtn: o }) => { | ||
var r, a, i, l, d, u, f, m; | ||
var r, a, i, l, d, u, f, p; | ||
const n = e.scrollLeft > 0, s = e.scrollLeft + e.clientWidth < e.scrollWidth; | ||
n && s ? ((r = t.classList) == null || r.add("o-nav-button--visible"), (a = o.classList) == null || a.add("o-nav-button--visible")) : n ? ((i = t.classList) == null || i.remove("o-nav-button--visible"), (l = o.classList) == null || l.add("o-nav-button--visible")) : s ? ((d = t.classList) == null || d.add("o-nav-button--visible"), (u = o.classList) == null || u.remove("o-nav-button--visible")) : ((f = t.classList) == null || f.remove("o-nav-button--visible"), (m = o.classList) == null || m.remove("o-nav-button--visible")); | ||
n && s ? ((r = t.classList) == null || r.add("o-nav-button--visible"), (a = o.classList) == null || a.add("o-nav-button--visible")) : n ? ((i = t.classList) == null || i.remove("o-nav-button--visible"), (l = o.classList) == null || l.add("o-nav-button--visible")) : s ? ((d = t.classList) == null || d.add("o-nav-button--visible"), (u = o.classList) == null || u.remove("o-nav-button--visible")) : ((f = t.classList) == null || f.remove("o-nav-button--visible"), (p = o.classList) == null || p.remove("o-nav-button--visible")); | ||
}, Z = ({ | ||
@@ -391,10 +398,10 @@ navigatedList: e, | ||
)), n === "true" && u) { | ||
const m = i ? i.querySelector(".c-stepper__item--loading") : null; | ||
l && (l.forEach((p) => { | ||
const h = p.querySelector(".c-stepper__loader"); | ||
const p = i ? i.querySelector(".c-stepper__item--loading") : null; | ||
l && (l.forEach((b) => { | ||
const h = b.querySelector(".c-stepper__loader"); | ||
h && h instanceof HTMLElement && (h.style.transition = `width ${r / 1e3}s linear`); | ||
}), m || l[0].classList.add("c-stepper__item--loading")), setInterval(() => { | ||
u.classList.contains("o-nav-button--visible") ? u.click() : d && f && (d.scrollLeft = 0, l && (l.forEach((p) => { | ||
const h = p.querySelector(".c-stepper__loader"); | ||
h && h instanceof HTMLElement && (h.style.transition = "width 0s linear"), p.classList.remove("c-stepper__item--loading"), p.classList.remove("c-stepper__item--loaded"), setTimeout(() => { | ||
}), p || l[0].classList.add("c-stepper__item--loading")), setInterval(() => { | ||
u.classList.contains("o-nav-button--visible") ? u.click() : d && f && (d.scrollLeft = 0, l && (l.forEach((b) => { | ||
const h = b.querySelector(".c-stepper__loader"); | ||
h && h instanceof HTMLElement && (h.style.transition = "width 0s linear"), b.classList.remove("c-stepper__item--loading"), b.classList.remove("c-stepper__item--loaded"), setTimeout(() => { | ||
h && h instanceof HTMLElement && (h.style.transition = `width ${r / 1e3}s linear`); | ||
@@ -517,3 +524,3 @@ }, 0); | ||
document.addEventListener("mouseup", E), document.addEventListener("selectionchange", E), document.addEventListener("touchend", E), document.addEventListener("touchcancel", E); | ||
}, pe = (e) => { | ||
}, be = (e) => { | ||
const { target: t } = e; | ||
@@ -524,9 +531,9 @@ if (t instanceof Element) { | ||
} | ||
}, me = (e = document.querySelector( | ||
}, pe = (e = document.querySelector( | ||
".c-search-form--button" | ||
)) => { | ||
e && e.addEventListener("click", (t) => { | ||
pe(t); | ||
be(t); | ||
}); | ||
}, be = ({ | ||
}, me = ({ | ||
tabsContainerElement: e, | ||
@@ -554,3 +561,3 @@ event: t | ||
s.addEventListener("click", (r) => { | ||
be({ tabsContainerElement: t, event: r }); | ||
me({ tabsContainerElement: t, event: r }); | ||
}); | ||
@@ -567,3 +574,3 @@ }); | ||
}, Ee = () => { | ||
z(), ye(), O(), ie(), Q(), le(), me(), N("olympicsGames", "countdown-olympics-games"), he(), j(), oe(), ne(); | ||
z(), ye(), F(), ie(), Q(), le(), pe(), N("olympicsGames", "countdown-olympics-games"), he(), O(), oe(), ne(); | ||
}; | ||
@@ -570,0 +577,0 @@ export { |
@@ -1,1 +0,1 @@ | ||
(function(p,h){typeof exports=="object"&&typeof module<"u"?h(exports):typeof define=="function"&&define.amd?define(["exports"],h):(p=typeof globalThis<"u"?globalThis:p||self,h(p.scripts={}))})(this,function(p){"use strict";var ge=Object.defineProperty;var Ee=(p,h,b)=>h in p?ge(p,h,{enumerable:!0,configurable:!0,writable:!0,value:b}):p[h]=b;var S=(p,h,b)=>(Ee(p,typeof h!="symbol"?h+"":h,b),b);const h=()=>{const e=document.querySelector(".js-limit-scroll-close-article-btn");e&&new IntersectionObserver(([o])=>{const n=document.querySelector(".c-close-article-btn");n&&(n.style.visibility=o.isIntersecting||o.boundingClientRect.top<0?"hidden":"visible")}).observe(e)},b=e=>{e.stopImmediatePropagation(),e.preventDefault();const t=e.currentTarget;if(t instanceof HTMLButtonElement){const o=t.parentElement,n=o==null?void 0:o.querySelector(`#${t.getAttribute("aria-controls")}`);t.getAttribute("aria-expanded")==="true"?(t.setAttribute("aria-expanded","false"),n==null||n.setAttribute("aria-hidden","true")):(t.setAttribute("aria-expanded","true"),n==null||n.setAttribute("aria-hidden","false"))}},j=(e=document.querySelector(".js-collapse__button"))=>{e&&document.querySelectorAll(".c-collapse__button").forEach(o=>{o.addEventListener("click",n=>{b(n)})})},F=(e,t)=>{const o=document.querySelector(`#${t}`);if(o){const n=o.querySelector(".js-countdown-days"),s=o.querySelector(".js-countdown-hours"),r=o.querySelector(".js-countdown-minutes"),a=o.querySelector(".js-countdown-seconds");if(!n||!s||!r||!a)return;window.counters={olympicsGames:"2024-07-26 20:00:00"};const i=window.counters[e],l=new Date(i).getTime(),d=setInterval(()=>{const u=new Date().getTime(),f=l-u;if(f<=0)clearInterval(d);else{const g=Math.floor(f/864e5),y=Math.floor(f%(1e3*60*60*24)/(1e3*60*60)),m=Math.floor(f%(1e3*60*60)/(1e3*60)),ye=Math.floor(f%(1e3*60)/1e3);n.innerHTML=g.toString(),s.innerHTML=y.toString(),r.innerHTML=m.toString(),a.innerHTML=ye.toString()}},1e3)}},O=e=>{var n;e.setAttribute("aria-expanded","true");const t=(n=e.parentNode)==null?void 0:n.querySelectorAll(".js-expand-target");t==null||t.forEach(s=>s.setAttribute("aria-hidden","false"));const o=e.querySelector(".js-expand-button__label");o instanceof HTMLSpanElement&&(o.innerHTML="Voir moins")},N=e=>{var n;const t=(n=e.parentNode)==null?void 0:n.querySelectorAll(".js-expand-target");t==null||t.forEach(s=>s.setAttribute("aria-hidden","true")),e.setAttribute("aria-expanded","false");const o=e.querySelector(".js-expand-button__label");o instanceof HTMLSpanElement&&(o.innerHTML="Voir plus")},B=e=>{const t=e.currentTarget;return e.preventDefault(),t instanceof HTMLButtonElement?t.getAttribute("aria-expanded")==="true"?N(t):O(t):null},P=(e=document.querySelector(".js-expand-button"))=>{e&&document.querySelectorAll(".js-expand-button").forEach(o=>o.addEventListener("click",B))},c={inert:":not([inert]):not([inert] *)",negTabIndex:':not([tabindex^="-"])',disabled:":not(:disabled)"};var K=[`a[href]${c.inert}${c.negTabIndex}`,`area[href]${c.inert}${c.negTabIndex}`,`input:not([type="hidden"]):not([type="radio"])${c.inert}${c.negTabIndex}${c.disabled}`,`input[type="radio"]${c.inert}${c.negTabIndex}${c.disabled}`,`select${c.inert}${c.negTabIndex}${c.disabled}`,`textarea${c.inert}${c.negTabIndex}${c.disabled}`,`button${c.inert}${c.negTabIndex}${c.disabled}`,`details${c.inert} > summary:first-of-type${c.negTabIndex}`,`iframe${c.inert}${c.negTabIndex}`,`audio[controls]${c.inert}${c.negTabIndex}`,`video[controls]${c.inert}${c.negTabIndex}`,`[contenteditable]${c.inert}${c.negTabIndex}`,`[tabindex]${c.inert}${c.negTabIndex}`];function x(e){(e.querySelector("[autofocus]")||e).focus()}function z(e){const t=E(e,!0),o=t?E(e,!1)||t:null;return[t,o]}function E(e,t){if(t&&C(e))return e;if(Y(e))if(e.shadowRoot){let o=A(e.shadowRoot,t);for(;o;){const n=E(o,t);if(n)return n;o=q(o,t)}}else if(e.localName==="slot"){const o=e.assignedElements({flatten:!0});t||o.reverse();for(const n of o){const s=E(n,t);if(s)return s}}else{let o=A(e,t);for(;o;){const n=E(o,t);if(n)return n;o=q(o,t)}}return!t&&C(e)?e:null}function A(e,t){return t?e.firstElementChild:e.lastElementChild}function q(e,t){return t?e.nextElementSibling:e.previousElementSibling}const V=e=>e.matches("details:not([open]) *")&&!e.matches("details>summary:first-of-type")?!0:!(e.offsetWidth||e.offsetHeight||e.getClientRects().length),C=e=>{var t;return(t=e.shadowRoot)!=null&&t.delegatesFocus?!1:e.matches(K.join(","))&&!V(e)};function Y(e){return e.shadowRoot&&e.getAttribute("tabindex")==="-1"?!1:!e.matches(":disabled,[hidden],[inert]")}function L(e=document){const t=e.activeElement;return t?t.shadowRoot?L(t.shadowRoot)||document.activeElement:t:null}function G(e,t){const[o,n]=z(e);if(!o)return t.preventDefault();const s=L();t.shiftKey&&s===o?(n.focus(),t.preventDefault()):!t.shiftKey&&s===n&&(o.focus(),t.preventDefault())}class I{constructor(t){S(this,"$el");S(this,"id");S(this,"previouslyFocused");S(this,"shown");this.$el=t,this.id=this.$el.getAttribute("data-a11y-dialog")||this.$el.id,this.previouslyFocused=null,this.shown=!1,this.maintainFocus=this.maintainFocus.bind(this),this.bindKeypress=this.bindKeypress.bind(this),this.handleTriggerClicks=this.handleTriggerClicks.bind(this),this.show=this.show.bind(this),this.hide=this.hide.bind(this),this.$el.setAttribute("aria-hidden","true"),this.$el.setAttribute("aria-modal","true"),this.$el.setAttribute("tabindex","-1"),this.$el.hasAttribute("role")||this.$el.setAttribute("role","dialog"),document.addEventListener("click",this.handleTriggerClicks,!0)}destroy(){return this.hide(),document.removeEventListener("click",this.handleTriggerClicks,!0),this.$el.replaceWith(this.$el.cloneNode(!0)),this.fire("destroy"),this}show(t){var o;return this.shown?this:(this.shown=!0,this.$el.removeAttribute("aria-hidden"),this.previouslyFocused=L(),((o=this.previouslyFocused)==null?void 0:o.tagName)==="BODY"&&(t!=null&&t.target)&&(this.previouslyFocused=t.target),(t==null?void 0:t.type)==="focus"?this.maintainFocus(t):x(this.$el),document.body.addEventListener("focus",this.maintainFocus,!0),this.$el.addEventListener("keydown",this.bindKeypress,!0),this.fire("show",t),this)}hide(t){var o,n;return this.shown?(this.shown=!1,this.$el.setAttribute("aria-hidden","true"),(n=(o=this.previouslyFocused)==null?void 0:o.focus)==null||n.call(o),document.body.removeEventListener("focus",this.maintainFocus,!0),this.$el.removeEventListener("keydown",this.bindKeypress,!0),this.fire("hide",t),this):this}on(t,o,n){return this.$el.addEventListener(t,o,n),this}off(t,o,n){return this.$el.removeEventListener(t,o,n),this}fire(t,o){this.$el.dispatchEvent(new CustomEvent(t,{detail:o,cancelable:!0}))}handleTriggerClicks(t){const o=t.target;o.closest(`[data-a11y-dialog-show="${this.id}"]`)&&this.show(t),(o.closest(`[data-a11y-dialog-hide="${this.id}"]`)||o.closest("[data-a11y-dialog-hide]")&&o.closest('[aria-modal="true"]')===this.$el)&&this.hide(t)}bindKeypress(t){var n;if(((n=document.activeElement)==null?void 0:n.closest('[aria-modal="true"]'))!==this.$el)return;let o=!1;try{o=!!this.$el.querySelector('[popover]:not([popover="manual"]):popover-open')}catch{}t.key==="Escape"&&this.$el.getAttribute("role")!=="alertdialog"&&!o&&(t.preventDefault(),this.hide(t)),t.key==="Tab"&&G(this.$el,t)}maintainFocus(t){t.target.closest('[aria-modal="true"], [data-a11y-dialog-ignore-focus-trap]')||x(this.$el)}}function k(){for(const e of document.querySelectorAll("[data-a11y-dialog]"))new I(e)}typeof document<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",k):k());const X=()=>document.querySelectorAll(".js-modal").forEach(e=>{if(!(e instanceof HTMLElement))return;const t=new I(e),o={x:0,y:0};t.on("show",()=>{o.x=window.scrollX,o.y=window.scrollY,document.body.classList.add("noscroll"),document.body.style.top=`-${o.y}px`}).on("hide",()=>{document.body.classList.remove("noscroll"),document.body.style.top="",(window.scrollY!==o.y||window.scrollX!==o.x)&&window.scroll(o.x,o.y)})}),J=({navigatedList:e,nextBtn:t,prevBtn:o})=>{var r,a,i,l,d,u,f,g;const n=e.scrollLeft>0,s=e.scrollLeft+e.clientWidth<e.scrollWidth;n&&s?((r=t.classList)==null||r.add("o-nav-button--visible"),(a=o.classList)==null||a.add("o-nav-button--visible")):n?((i=t.classList)==null||i.remove("o-nav-button--visible"),(l=o.classList)==null||l.add("o-nav-button--visible")):s?((d=t.classList)==null||d.add("o-nav-button--visible"),(u=o.classList)==null||u.remove("o-nav-button--visible")):((f=t.classList)==null||f.remove("o-nav-button--visible"),(g=o.classList)==null||g.remove("o-nav-button--visible"))},Q=({navigatedList:e,nextBtn:t,prevBtn:o,sliderVariant:n})=>{if(e){const s=e.closest(".js-overview-bar-container"),r=s==null?void 0:s.querySelector(".c-stepper"),a=r==null?void 0:r.querySelectorAll(".c-stepper__item");if(a){const i=Array.from(a).findIndex(l=>l.classList.contains("c-stepper__item--loading"));if(i<0)a[0].classList.add("c-stepper__item--loading");else{a[i].classList.remove("c-stepper__item--loading"),a[i].classList.add("c-stepper__item--loaded");const l=a[i].querySelector(".c-stepper__loader");l&&l instanceof HTMLElement&&(l.style.transition="width 0s linear"),i+1<a.length&&a[i+1].classList.add("c-stepper__item--loading")}}if(e.scrollWidth-e.clientWidth>e.clientWidth){let i=e.scrollLeft;switch(n){case"three-columns-articles":i+=e.clientWidth+32;break;case"rubrics":i+=e.clientWidth-36;break;default:i+=Math.ceil(e.clientWidth*.6);break}e.scrollTo({left:i,behavior:"smooth"}),o.classList.add("o-nav-button--visible"),i+e.clientWidth>=e.scrollWidth&&t.classList.remove("o-nav-button--visible")}else{const i=e.scrollWidth-e.clientWidth;e.scrollTo({left:i,behavior:"smooth"}),t.classList.remove("o-nav-button--visible"),o.classList.add("o-nav-button--visible")}}},U=({navigatedList:e,nextBtn:t,prevBtn:o,sliderVariant:n,delay:s})=>{if(e){const r=e.closest(".js-overview-bar-container"),a=r==null?void 0:r.querySelector(".c-stepper"),i=a==null?void 0:a.querySelectorAll(".c-stepper__item");if(i){const l=Array.from(i).findIndex(d=>d.classList.contains("c-stepper__item--loading"));l<0?i[0].classList.add("c-stepper__item--loading"):(i[l].classList.remove("c-stepper__item--loading"),i[l].classList.remove("c-stepper__item--loaded"),l-1>0&&(i[l-1].classList.remove("c-stepper__item--loading"),i[l-1].classList.remove("c-stepper__item--loaded"),setTimeout(()=>{const d=i[l-1].querySelector(".c-stepper__loader");i[l-1].classList.add("c-stepper__item--loading"),d&&d instanceof HTMLElement&&(d.style.transition=`width ${s/1e3}s linear`)},0)))}if(e.clientWidth<e.scrollLeft){let l=e.scrollLeft;switch(n){case"three-columns-articles":l-=e.clientWidth+32;break;case"rubrics":l-=e.clientWidth-36;break;default:l-=Math.ceil(e.clientWidth*.6);break}e.scrollTo({left:l,behavior:"smooth"}),t.classList.add("o-nav-button--visible"),l===0&&o.classList.remove("o-nav-button--visible")}else e.scrollTo({left:0,behavior:"smooth"}),o.classList.remove("o-nav-button--visible"),e.clientWidth<e.scrollWidth&&t.classList.add("o-nav-button--visible")}},Z=({navigatedList:e,nextBtn:t,prevBtn:o})=>{J({navigatedList:e,nextBtn:t,prevBtn:o})},ee=()=>{const e=document.querySelectorAll(".js-navigation-container");for(const t of Array.from(e)){const{sliderVariant:o}=t.dataset,{sliderAuto:n}=t.dataset,{sliderDelay:s}=t.dataset,r=s?parseInt(s,10):3e3,a=t.closest(".js-overview-bar-container"),i=a==null?void 0:a.querySelector(".c-stepper"),l=i==null?void 0:i.querySelectorAll(".c-stepper__item");if(t){const d=t.querySelector(".js-navigation-container__list"),u=t.querySelector(".o-nav-button--next-button"),f=t.querySelector(".o-nav-button--previous-button");if(d&&d.clientWidth<d.scrollWidth&&(u==null||u.classList.add("o-nav-button--visible")),d&&u&&f&&(u==null||u.addEventListener("click",Q.bind(!1,{navigatedList:d,nextBtn:u,prevBtn:f,sliderVariant:o})),f==null||f.addEventListener("click",U.bind(!1,{navigatedList:d,nextBtn:u,prevBtn:f,sliderVariant:o,delay:r}))),n==="true"&&u){const g=i?i.querySelector(".c-stepper__item--loading"):null;l&&(l.forEach(y=>{const m=y.querySelector(".c-stepper__loader");m&&m instanceof HTMLElement&&(m.style.transition=`width ${r/1e3}s linear`)}),g||l[0].classList.add("c-stepper__item--loading")),setInterval(()=>{u.classList.contains("o-nav-button--visible")?u.click():d&&f&&(d.scrollLeft=0,l&&(l.forEach(y=>{const m=y.querySelector(".c-stepper__loader");m&&m instanceof HTMLElement&&(m.style.transition="width 0s linear"),y.classList.remove("c-stepper__item--loading"),y.classList.remove("c-stepper__item--loaded"),setTimeout(()=>{m&&m instanceof HTMLElement&&(m.style.transition=`width ${r/1e3}s linear`)},0)}),setTimeout(()=>{l[0].classList.add("c-stepper__item--loading")},0)),f.click())},r)}}}},te=()=>{const e=document.querySelectorAll(".js-navigation-container");for(const t of Array.from(e))if(t){const o=t.querySelector(".js-navigation-container__list"),n=t.querySelector(".o-nav-button--next-button"),s=t.querySelector(".o-nav-button--previous-button");o&&n&&s&&window.addEventListener("resize",Z.bind(!1,{navigatedList:o,nextBtn:n,prevBtn:s}))}},oe=()=>{const e=document.querySelector(".js-limit-scroll-progress-bar"),t=document.querySelector(".c-progress__bar");if(!t)return;const{documentElement:o}=document;let n=o.scrollHeight-o.clientHeight;if(!n)return;const s=o.scrollTop;e&&(n=e.scrollHeight-o.clientHeight+(window.pageYOffset+e.getBoundingClientRect().top));const r=Math.round(s/n*100);t.style.width=`${r}%`,r>=100&&(t.style.width="100%")},ne=()=>{document.querySelector(".c-progress")&&window.addEventListener("scroll",oe)};let v,T=0;const se=()=>{v=null,document.body.getBoundingClientRect().top>T+2&&(v="up"),document.body.getBoundingClientRect().top<T-2&&(v="down"),T=document.body.getBoundingClientRect().top;const e=document.querySelector(".c-read-also-banner");if(e){const t=e.dataset.bannerLimitTop||"0";v==="up"&&-document.body.getBoundingClientRect().top>=parseInt(t,10)&&(e.classList.remove("c-read-also-banner__scrolldirection--down"),e.style.paddingTop="0.75em",e.style.paddingBottom="0.75em",e.style.borderWidth="1px",e.classList.contains("c-read-also-banner__scrolldirection--up")||e.classList.add("c-read-also-banner__scrolldirection--up")),(v==="down"||-document.body.getBoundingClientRect().top<=parseInt(t,10))&&(e.classList.remove("c-read-also-banner__scrolldirection--up"),e.style.paddingTop="0",e.style.paddingBottom="0",e.style.borderWidth="0",e.classList.contains("c-read-also-banner__scrolldirection--down")||e.classList.add("c-read-also-banner__scrolldirection--down"))}},ie=(e=document.querySelector(".c-read-also-banner"))=>{if(e){let t;window.addEventListener("scroll",()=>{clearTimeout(t),t=setTimeout(se,100)})}},_="#page-content",$="#text-tooltip",re=".tooltip-btn",M="c-text-tooltip--show",le=["#page-content .c-content p","#page-content .c-content h2","#page-content .c-content h3","#page-content .c-content h4","#page-content .c-content h5","#page-content .c-content h6","#page-content .c-content li","#page-content .c-content span","#page-content header span","#page-content header h1","#page-content header h2"],H=(e,t)=>e instanceof Element?t.some(o=>e.matches(o)):!1,ce=(e,t)=>{const o=e.startContainer.nodeType===Node.ELEMENT_NODE?e.startContainer:e.startContainer.parentElement,n=e.endContainer.nodeType===Node.ELEMENT_NODE?e.endContainer:e.endContainer.parentElement;return!!o&&H(o,t)||!!n&&H(n,t)},ae=e=>{var o;if(!e.focusNode)return null;const t=(o=e.anchorNode)==null?void 0:o.compareDocumentPosition(e.focusNode);return t?(t&4)>0:e.anchorOffset<e.focusOffset},de=(e,t,o)=>{const n=document.querySelector(`${_} ${$}`),s=document.querySelector(`${_}`),r=document.querySelectorAll(`${_} ${$} ${re}`);if(!n||!s){console.warn("Text tooltip : Tooltip or it's parent are not found in the DOM");return}Array.from(r).forEach(l=>l.setAttribute("data-selected-text",o));const a=e.getClientRects(),i=a[t?a.length-1:0];n.style.top=`${i.top-s.getBoundingClientRect().top-(n.offsetHeight+10)}px`,i.width<n.offsetWidth?n.style.left=`${i.left-s.getBoundingClientRect().left+i.width/2-n.offsetWidth/2}px`:t?n.style.left=`${i.left-s.getBoundingClientRect().left+i.width-n.offsetWidth}px`:n.style.left=`${i.left-s.getBoundingClientRect().left}px`,n.classList.add(M)},R=()=>{const e=document.querySelector(`${$}`);e&&e.classList.remove(M)},w=({type:e})=>{const t=window.getSelection();if(e==="selectionchange"){R();return}if(!t||!t.rangeCount)return;const o=t.getRangeAt(0),n=t.toString().trim();if(n.length){const s=ce(o,le),r=ae(t)||!1;s&&de(o,r,n);return}R()},ue=()=>{if(!(window!=null&&window.getSelection)){console.warn("Selection API isn't supported");return}document.addEventListener("mouseup",w),document.addEventListener("selectionchange",w),document.addEventListener("touchend",w),document.addEventListener("touchcancel",w)},fe=e=>{const{target:t}=e;if(t instanceof Element){const o=t.closest(".c-search-form--button");o&&(e.preventDefault(),o.classList.remove("c-search-form--button"))}},he=(e=document.querySelector(".c-search-form--button"))=>{e&&e.addEventListener("click",t=>{fe(t)})},pe=({tabsContainerElement:e,event:t})=>{t.preventDefault();const o=t.target;if(!(o instanceof HTMLButtonElement))return;const n=e.querySelectorAll('[role="tab"]'),s=e.querySelectorAll('[role="tabpanel"]'),r=o.getAttribute("aria-controls"),a=Object.values(s).find(i=>i.id===r);n.forEach(i=>{i.setAttribute("aria-selected","false")}),s.forEach(i=>{i.setAttribute("aria-hidden","true")}),o.setAttribute("aria-selected","true"),a&&a.removeAttribute("aria-hidden")},D=e=>e.code==="ArrowLeft"||e.keyCode===39,W=e=>e.code==="ArrowRight"||e.keyCode===37,me=(e=document.querySelectorAll(".js-tabs"))=>{e.length>0&&e.forEach(t=>{const o=t.querySelectorAll('[role="tab"]');o.forEach(s=>{s.addEventListener("click",r=>{pe({tabsContainerElement:t,event:r})})});const n=t.querySelector('[role="tablist"]');if(n&&o.length>0){let s=0;n.addEventListener("keydown",r=>{r instanceof KeyboardEvent&&(D(r)||W(r))&&(o[s].setAttribute("tabindex","-1"),D(r)?(s+=1,s>=o.length&&(s=0)):W(r)&&(s-=1,s<0&&(s=o.length-1)),o[s].setAttribute("tabindex","0"),o[s].focus())})}})},be=()=>{P(),me(),j(),ne(),X(),ie(),he(),F("olympicsGames","countdown-olympics-games"),ue(),h(),ee(),te()};p.initScripts=be,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})}); | ||
(function(p,h){typeof exports=="object"&&typeof module<"u"?h(exports):typeof define=="function"&&define.amd?define(["exports"],h):(p=typeof globalThis<"u"?globalThis:p||self,h(p.scripts={}))})(this,function(p){"use strict";var ge=Object.defineProperty;var Ee=(p,h,m)=>h in p?ge(p,h,{enumerable:!0,configurable:!0,writable:!0,value:m}):p[h]=m;var S=(p,h,m)=>(Ee(p,typeof h!="symbol"?h+"":h,m),m);const h=()=>{const e=document.querySelector("header"),t=document.querySelector(".js-limit-scroll-close-article-btn");if(e&&t){const o=document.querySelector(".c-close-article-btn");if(o){const n=new IntersectionObserver(([r])=>{o.style.visibility=r.isIntersecting?"hidden":"visible"});new IntersectionObserver(([r])=>{o.style.visibility=r.isIntersecting||r.boundingClientRect.top<0?"hidden":"visible"}).observe(t),n.observe(e)}}},m=e=>{e.stopImmediatePropagation(),e.preventDefault();const t=e.currentTarget;if(t instanceof HTMLButtonElement){const o=t.parentElement,n=o==null?void 0:o.querySelector(`#${t.getAttribute("aria-controls")}`);t.getAttribute("aria-expanded")==="true"?(t.setAttribute("aria-expanded","false"),n==null||n.setAttribute("aria-hidden","true")):(t.setAttribute("aria-expanded","true"),n==null||n.setAttribute("aria-hidden","false"))}},j=(e=document.querySelector(".js-collapse__button"))=>{e&&document.querySelectorAll(".c-collapse__button").forEach(o=>{o.addEventListener("click",n=>{m(n)})})},O=(e,t)=>{const o=document.querySelector(`#${t}`);if(o){const n=o.querySelector(".js-countdown-days"),s=o.querySelector(".js-countdown-hours"),r=o.querySelector(".js-countdown-minutes"),a=o.querySelector(".js-countdown-seconds");if(!n||!s||!r||!a)return;window.counters={olympicsGames:"2024-07-26 20:00:00"};const i=window.counters[e],l=new Date(i).getTime(),d=setInterval(()=>{const u=new Date().getTime(),f=l-u;if(f<=0)clearInterval(d);else{const g=Math.floor(f/864e5),y=Math.floor(f%(1e3*60*60*24)/(1e3*60*60)),b=Math.floor(f%(1e3*60*60)/(1e3*60)),ye=Math.floor(f%(1e3*60)/1e3);n.innerHTML=g.toString(),s.innerHTML=y.toString(),r.innerHTML=b.toString(),a.innerHTML=ye.toString()}},1e3)}},F=e=>{var n;e.setAttribute("aria-expanded","true");const t=(n=e.parentNode)==null?void 0:n.querySelectorAll(".js-expand-target");t==null||t.forEach(s=>s.setAttribute("aria-hidden","false"));const o=e.querySelector(".js-expand-button__label");o instanceof HTMLSpanElement&&(o.innerHTML="Voir moins")},N=e=>{var n;const t=(n=e.parentNode)==null?void 0:n.querySelectorAll(".js-expand-target");t==null||t.forEach(s=>s.setAttribute("aria-hidden","true")),e.setAttribute("aria-expanded","false");const o=e.querySelector(".js-expand-button__label");o instanceof HTMLSpanElement&&(o.innerHTML="Voir plus")},B=e=>{const t=e.currentTarget;return e.preventDefault(),t instanceof HTMLButtonElement?t.getAttribute("aria-expanded")==="true"?N(t):F(t):null},P=(e=document.querySelector(".js-expand-button"))=>{e&&document.querySelectorAll(".js-expand-button").forEach(o=>o.addEventListener("click",B))},c={inert:":not([inert]):not([inert] *)",negTabIndex:':not([tabindex^="-"])',disabled:":not(:disabled)"};var K=[`a[href]${c.inert}${c.negTabIndex}`,`area[href]${c.inert}${c.negTabIndex}`,`input:not([type="hidden"]):not([type="radio"])${c.inert}${c.negTabIndex}${c.disabled}`,`input[type="radio"]${c.inert}${c.negTabIndex}${c.disabled}`,`select${c.inert}${c.negTabIndex}${c.disabled}`,`textarea${c.inert}${c.negTabIndex}${c.disabled}`,`button${c.inert}${c.negTabIndex}${c.disabled}`,`details${c.inert} > summary:first-of-type${c.negTabIndex}`,`iframe${c.inert}${c.negTabIndex}`,`audio[controls]${c.inert}${c.negTabIndex}`,`video[controls]${c.inert}${c.negTabIndex}`,`[contenteditable]${c.inert}${c.negTabIndex}`,`[tabindex]${c.inert}${c.negTabIndex}`];function x(e){(e.querySelector("[autofocus]")||e).focus()}function z(e){const t=E(e,!0),o=t?E(e,!1)||t:null;return[t,o]}function E(e,t){if(t&&C(e))return e;if(Y(e))if(e.shadowRoot){let o=A(e.shadowRoot,t);for(;o;){const n=E(o,t);if(n)return n;o=q(o,t)}}else if(e.localName==="slot"){const o=e.assignedElements({flatten:!0});t||o.reverse();for(const n of o){const s=E(n,t);if(s)return s}}else{let o=A(e,t);for(;o;){const n=E(o,t);if(n)return n;o=q(o,t)}}return!t&&C(e)?e:null}function A(e,t){return t?e.firstElementChild:e.lastElementChild}function q(e,t){return t?e.nextElementSibling:e.previousElementSibling}const V=e=>e.matches("details:not([open]) *")&&!e.matches("details>summary:first-of-type")?!0:!(e.offsetWidth||e.offsetHeight||e.getClientRects().length),C=e=>{var t;return(t=e.shadowRoot)!=null&&t.delegatesFocus?!1:e.matches(K.join(","))&&!V(e)};function Y(e){return e.shadowRoot&&e.getAttribute("tabindex")==="-1"?!1:!e.matches(":disabled,[hidden],[inert]")}function L(e=document){const t=e.activeElement;return t?t.shadowRoot?L(t.shadowRoot)||document.activeElement:t:null}function G(e,t){const[o,n]=z(e);if(!o)return t.preventDefault();const s=L();t.shiftKey&&s===o?(n.focus(),t.preventDefault()):!t.shiftKey&&s===n&&(o.focus(),t.preventDefault())}class I{constructor(t){S(this,"$el");S(this,"id");S(this,"previouslyFocused");S(this,"shown");this.$el=t,this.id=this.$el.getAttribute("data-a11y-dialog")||this.$el.id,this.previouslyFocused=null,this.shown=!1,this.maintainFocus=this.maintainFocus.bind(this),this.bindKeypress=this.bindKeypress.bind(this),this.handleTriggerClicks=this.handleTriggerClicks.bind(this),this.show=this.show.bind(this),this.hide=this.hide.bind(this),this.$el.setAttribute("aria-hidden","true"),this.$el.setAttribute("aria-modal","true"),this.$el.setAttribute("tabindex","-1"),this.$el.hasAttribute("role")||this.$el.setAttribute("role","dialog"),document.addEventListener("click",this.handleTriggerClicks,!0)}destroy(){return this.hide(),document.removeEventListener("click",this.handleTriggerClicks,!0),this.$el.replaceWith(this.$el.cloneNode(!0)),this.fire("destroy"),this}show(t){var o;return this.shown?this:(this.shown=!0,this.$el.removeAttribute("aria-hidden"),this.previouslyFocused=L(),((o=this.previouslyFocused)==null?void 0:o.tagName)==="BODY"&&(t!=null&&t.target)&&(this.previouslyFocused=t.target),(t==null?void 0:t.type)==="focus"?this.maintainFocus(t):x(this.$el),document.body.addEventListener("focus",this.maintainFocus,!0),this.$el.addEventListener("keydown",this.bindKeypress,!0),this.fire("show",t),this)}hide(t){var o,n;return this.shown?(this.shown=!1,this.$el.setAttribute("aria-hidden","true"),(n=(o=this.previouslyFocused)==null?void 0:o.focus)==null||n.call(o),document.body.removeEventListener("focus",this.maintainFocus,!0),this.$el.removeEventListener("keydown",this.bindKeypress,!0),this.fire("hide",t),this):this}on(t,o,n){return this.$el.addEventListener(t,o,n),this}off(t,o,n){return this.$el.removeEventListener(t,o,n),this}fire(t,o){this.$el.dispatchEvent(new CustomEvent(t,{detail:o,cancelable:!0}))}handleTriggerClicks(t){const o=t.target;o.closest(`[data-a11y-dialog-show="${this.id}"]`)&&this.show(t),(o.closest(`[data-a11y-dialog-hide="${this.id}"]`)||o.closest("[data-a11y-dialog-hide]")&&o.closest('[aria-modal="true"]')===this.$el)&&this.hide(t)}bindKeypress(t){var n;if(((n=document.activeElement)==null?void 0:n.closest('[aria-modal="true"]'))!==this.$el)return;let o=!1;try{o=!!this.$el.querySelector('[popover]:not([popover="manual"]):popover-open')}catch{}t.key==="Escape"&&this.$el.getAttribute("role")!=="alertdialog"&&!o&&(t.preventDefault(),this.hide(t)),t.key==="Tab"&&G(this.$el,t)}maintainFocus(t){t.target.closest('[aria-modal="true"], [data-a11y-dialog-ignore-focus-trap]')||x(this.$el)}}function k(){for(const e of document.querySelectorAll("[data-a11y-dialog]"))new I(e)}typeof document<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",k):k());const X=()=>document.querySelectorAll(".js-modal").forEach(e=>{if(!(e instanceof HTMLElement))return;const t=new I(e),o={x:0,y:0};t.on("show",()=>{o.x=window.scrollX,o.y=window.scrollY,document.body.classList.add("noscroll"),document.body.style.top=`-${o.y}px`}).on("hide",()=>{document.body.classList.remove("noscroll"),document.body.style.top="",(window.scrollY!==o.y||window.scrollX!==o.x)&&window.scroll(o.x,o.y)})}),J=({navigatedList:e,nextBtn:t,prevBtn:o})=>{var r,a,i,l,d,u,f,g;const n=e.scrollLeft>0,s=e.scrollLeft+e.clientWidth<e.scrollWidth;n&&s?((r=t.classList)==null||r.add("o-nav-button--visible"),(a=o.classList)==null||a.add("o-nav-button--visible")):n?((i=t.classList)==null||i.remove("o-nav-button--visible"),(l=o.classList)==null||l.add("o-nav-button--visible")):s?((d=t.classList)==null||d.add("o-nav-button--visible"),(u=o.classList)==null||u.remove("o-nav-button--visible")):((f=t.classList)==null||f.remove("o-nav-button--visible"),(g=o.classList)==null||g.remove("o-nav-button--visible"))},Q=({navigatedList:e,nextBtn:t,prevBtn:o,sliderVariant:n})=>{if(e){const s=e.closest(".js-overview-bar-container"),r=s==null?void 0:s.querySelector(".c-stepper"),a=r==null?void 0:r.querySelectorAll(".c-stepper__item");if(a){const i=Array.from(a).findIndex(l=>l.classList.contains("c-stepper__item--loading"));if(i<0)a[0].classList.add("c-stepper__item--loading");else{a[i].classList.remove("c-stepper__item--loading"),a[i].classList.add("c-stepper__item--loaded");const l=a[i].querySelector(".c-stepper__loader");l&&l instanceof HTMLElement&&(l.style.transition="width 0s linear"),i+1<a.length&&a[i+1].classList.add("c-stepper__item--loading")}}if(e.scrollWidth-e.clientWidth>e.clientWidth){let i=e.scrollLeft;switch(n){case"three-columns-articles":i+=e.clientWidth+32;break;case"rubrics":i+=e.clientWidth-36;break;default:i+=Math.ceil(e.clientWidth*.6);break}e.scrollTo({left:i,behavior:"smooth"}),o.classList.add("o-nav-button--visible"),i+e.clientWidth>=e.scrollWidth&&t.classList.remove("o-nav-button--visible")}else{const i=e.scrollWidth-e.clientWidth;e.scrollTo({left:i,behavior:"smooth"}),t.classList.remove("o-nav-button--visible"),o.classList.add("o-nav-button--visible")}}},U=({navigatedList:e,nextBtn:t,prevBtn:o,sliderVariant:n,delay:s})=>{if(e){const r=e.closest(".js-overview-bar-container"),a=r==null?void 0:r.querySelector(".c-stepper"),i=a==null?void 0:a.querySelectorAll(".c-stepper__item");if(i){const l=Array.from(i).findIndex(d=>d.classList.contains("c-stepper__item--loading"));l<0?i[0].classList.add("c-stepper__item--loading"):(i[l].classList.remove("c-stepper__item--loading"),i[l].classList.remove("c-stepper__item--loaded"),l-1>0&&(i[l-1].classList.remove("c-stepper__item--loading"),i[l-1].classList.remove("c-stepper__item--loaded"),setTimeout(()=>{const d=i[l-1].querySelector(".c-stepper__loader");i[l-1].classList.add("c-stepper__item--loading"),d&&d instanceof HTMLElement&&(d.style.transition=`width ${s/1e3}s linear`)},0)))}if(e.clientWidth<e.scrollLeft){let l=e.scrollLeft;switch(n){case"three-columns-articles":l-=e.clientWidth+32;break;case"rubrics":l-=e.clientWidth-36;break;default:l-=Math.ceil(e.clientWidth*.6);break}e.scrollTo({left:l,behavior:"smooth"}),t.classList.add("o-nav-button--visible"),l===0&&o.classList.remove("o-nav-button--visible")}else e.scrollTo({left:0,behavior:"smooth"}),o.classList.remove("o-nav-button--visible"),e.clientWidth<e.scrollWidth&&t.classList.add("o-nav-button--visible")}},Z=({navigatedList:e,nextBtn:t,prevBtn:o})=>{J({navigatedList:e,nextBtn:t,prevBtn:o})},ee=()=>{const e=document.querySelectorAll(".js-navigation-container");for(const t of Array.from(e)){const{sliderVariant:o}=t.dataset,{sliderAuto:n}=t.dataset,{sliderDelay:s}=t.dataset,r=s?parseInt(s,10):3e3,a=t.closest(".js-overview-bar-container"),i=a==null?void 0:a.querySelector(".c-stepper"),l=i==null?void 0:i.querySelectorAll(".c-stepper__item");if(t){const d=t.querySelector(".js-navigation-container__list"),u=t.querySelector(".o-nav-button--next-button"),f=t.querySelector(".o-nav-button--previous-button");if(d&&d.clientWidth<d.scrollWidth&&(u==null||u.classList.add("o-nav-button--visible")),d&&u&&f&&(u==null||u.addEventListener("click",Q.bind(!1,{navigatedList:d,nextBtn:u,prevBtn:f,sliderVariant:o})),f==null||f.addEventListener("click",U.bind(!1,{navigatedList:d,nextBtn:u,prevBtn:f,sliderVariant:o,delay:r}))),n==="true"&&u){const g=i?i.querySelector(".c-stepper__item--loading"):null;l&&(l.forEach(y=>{const b=y.querySelector(".c-stepper__loader");b&&b instanceof HTMLElement&&(b.style.transition=`width ${r/1e3}s linear`)}),g||l[0].classList.add("c-stepper__item--loading")),setInterval(()=>{u.classList.contains("o-nav-button--visible")?u.click():d&&f&&(d.scrollLeft=0,l&&(l.forEach(y=>{const b=y.querySelector(".c-stepper__loader");b&&b instanceof HTMLElement&&(b.style.transition="width 0s linear"),y.classList.remove("c-stepper__item--loading"),y.classList.remove("c-stepper__item--loaded"),setTimeout(()=>{b&&b instanceof HTMLElement&&(b.style.transition=`width ${r/1e3}s linear`)},0)}),setTimeout(()=>{l[0].classList.add("c-stepper__item--loading")},0)),f.click())},r)}}}},te=()=>{const e=document.querySelectorAll(".js-navigation-container");for(const t of Array.from(e))if(t){const o=t.querySelector(".js-navigation-container__list"),n=t.querySelector(".o-nav-button--next-button"),s=t.querySelector(".o-nav-button--previous-button");o&&n&&s&&window.addEventListener("resize",Z.bind(!1,{navigatedList:o,nextBtn:n,prevBtn:s}))}},oe=()=>{const e=document.querySelector(".js-limit-scroll-progress-bar"),t=document.querySelector(".c-progress__bar");if(!t)return;const{documentElement:o}=document;let n=o.scrollHeight-o.clientHeight;if(!n)return;const s=o.scrollTop;e&&(n=e.scrollHeight-o.clientHeight+(window.pageYOffset+e.getBoundingClientRect().top));const r=Math.round(s/n*100);t.style.width=`${r}%`,r>=100&&(t.style.width="100%")},ne=()=>{document.querySelector(".c-progress")&&window.addEventListener("scroll",oe)};let v,T=0;const se=()=>{v=null,document.body.getBoundingClientRect().top>T+2&&(v="up"),document.body.getBoundingClientRect().top<T-2&&(v="down"),T=document.body.getBoundingClientRect().top;const e=document.querySelector(".c-read-also-banner");if(e){const t=e.dataset.bannerLimitTop||"0";v==="up"&&-document.body.getBoundingClientRect().top>=parseInt(t,10)&&(e.classList.remove("c-read-also-banner__scrolldirection--down"),e.style.paddingTop="0.75em",e.style.paddingBottom="0.75em",e.style.borderWidth="1px",e.classList.contains("c-read-also-banner__scrolldirection--up")||e.classList.add("c-read-also-banner__scrolldirection--up")),(v==="down"||-document.body.getBoundingClientRect().top<=parseInt(t,10))&&(e.classList.remove("c-read-also-banner__scrolldirection--up"),e.style.paddingTop="0",e.style.paddingBottom="0",e.style.borderWidth="0",e.classList.contains("c-read-also-banner__scrolldirection--down")||e.classList.add("c-read-also-banner__scrolldirection--down"))}},ie=(e=document.querySelector(".c-read-also-banner"))=>{if(e){let t;window.addEventListener("scroll",()=>{clearTimeout(t),t=setTimeout(se,100)})}},_="#page-content",$="#text-tooltip",re=".tooltip-btn",M="c-text-tooltip--show",le=["#page-content .c-content p","#page-content .c-content h2","#page-content .c-content h3","#page-content .c-content h4","#page-content .c-content h5","#page-content .c-content h6","#page-content .c-content li","#page-content .c-content span","#page-content header span","#page-content header h1","#page-content header h2"],H=(e,t)=>e instanceof Element?t.some(o=>e.matches(o)):!1,ce=(e,t)=>{const o=e.startContainer.nodeType===Node.ELEMENT_NODE?e.startContainer:e.startContainer.parentElement,n=e.endContainer.nodeType===Node.ELEMENT_NODE?e.endContainer:e.endContainer.parentElement;return!!o&&H(o,t)||!!n&&H(n,t)},ae=e=>{var o;if(!e.focusNode)return null;const t=(o=e.anchorNode)==null?void 0:o.compareDocumentPosition(e.focusNode);return t?(t&4)>0:e.anchorOffset<e.focusOffset},de=(e,t,o)=>{const n=document.querySelector(`${_} ${$}`),s=document.querySelector(`${_}`),r=document.querySelectorAll(`${_} ${$} ${re}`);if(!n||!s){console.warn("Text tooltip : Tooltip or it's parent are not found in the DOM");return}Array.from(r).forEach(l=>l.setAttribute("data-selected-text",o));const a=e.getClientRects(),i=a[t?a.length-1:0];n.style.top=`${i.top-s.getBoundingClientRect().top-(n.offsetHeight+10)}px`,i.width<n.offsetWidth?n.style.left=`${i.left-s.getBoundingClientRect().left+i.width/2-n.offsetWidth/2}px`:t?n.style.left=`${i.left-s.getBoundingClientRect().left+i.width-n.offsetWidth}px`:n.style.left=`${i.left-s.getBoundingClientRect().left}px`,n.classList.add(M)},R=()=>{const e=document.querySelector(`${$}`);e&&e.classList.remove(M)},w=({type:e})=>{const t=window.getSelection();if(e==="selectionchange"){R();return}if(!t||!t.rangeCount)return;const o=t.getRangeAt(0),n=t.toString().trim();if(n.length){const s=ce(o,le),r=ae(t)||!1;s&&de(o,r,n);return}R()},ue=()=>{if(!(window!=null&&window.getSelection)){console.warn("Selection API isn't supported");return}document.addEventListener("mouseup",w),document.addEventListener("selectionchange",w),document.addEventListener("touchend",w),document.addEventListener("touchcancel",w)},fe=e=>{const{target:t}=e;if(t instanceof Element){const o=t.closest(".c-search-form--button");o&&(e.preventDefault(),o.classList.remove("c-search-form--button"))}},he=(e=document.querySelector(".c-search-form--button"))=>{e&&e.addEventListener("click",t=>{fe(t)})},pe=({tabsContainerElement:e,event:t})=>{t.preventDefault();const o=t.target;if(!(o instanceof HTMLButtonElement))return;const n=e.querySelectorAll('[role="tab"]'),s=e.querySelectorAll('[role="tabpanel"]'),r=o.getAttribute("aria-controls"),a=Object.values(s).find(i=>i.id===r);n.forEach(i=>{i.setAttribute("aria-selected","false")}),s.forEach(i=>{i.setAttribute("aria-hidden","true")}),o.setAttribute("aria-selected","true"),a&&a.removeAttribute("aria-hidden")},D=e=>e.code==="ArrowLeft"||e.keyCode===39,W=e=>e.code==="ArrowRight"||e.keyCode===37,be=(e=document.querySelectorAll(".js-tabs"))=>{e.length>0&&e.forEach(t=>{const o=t.querySelectorAll('[role="tab"]');o.forEach(s=>{s.addEventListener("click",r=>{pe({tabsContainerElement:t,event:r})})});const n=t.querySelector('[role="tablist"]');if(n&&o.length>0){let s=0;n.addEventListener("keydown",r=>{r instanceof KeyboardEvent&&(D(r)||W(r))&&(o[s].setAttribute("tabindex","-1"),D(r)?(s+=1,s>=o.length&&(s=0)):W(r)&&(s-=1,s<0&&(s=o.length-1)),o[s].setAttribute("tabindex","0"),o[s].focus())})}})},me=()=>{P(),be(),j(),ne(),X(),ie(),he(),O("olympicsGames","countdown-olympics-games"),ue(),h(),ee(),te()};p.initScripts=me,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})}); |
{ | ||
"name": "@20minutes/hela", | ||
"version": "1.8.5", | ||
"version": "1.8.6", | ||
"repository": "git@github.com:20minutes/hela.git", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1481770
19343