@20minutes/hela
Advanced tools
Comparing version 1.8.9 to 1.9.0
@@ -1,5 +0,5 @@ | ||
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 O = () => { | ||
var R = Object.defineProperty; | ||
var O = (e, t, o) => t in e ? R(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o; | ||
var b = (e, t, o) => (O(e, typeof t != "symbol" ? t + "" : t, o), o); | ||
const W = () => { | ||
const e = document.querySelector("header"), t = document.querySelector(".js-limit-scroll-close-article-btn"); | ||
@@ -9,7 +9,7 @@ if (e && t) { | ||
if (o) { | ||
const n = new IntersectionObserver(([r]) => { | ||
const s = new IntersectionObserver(([r]) => { | ||
r.isIntersecting || r.boundingClientRect.top < 0 ? o.classList.add("u-hidden") : o.classList.remove("u-hidden"); | ||
}); | ||
new IntersectionObserver(([r]) => { | ||
o.classList.add("u-hidden"), r.isIntersecting || (o.classList.remove("u-hidden"), n.observe(t)); | ||
o.classList.add("u-hidden"), r.isIntersecting || (o.classList.remove("u-hidden"), s.observe(t)); | ||
}).observe(e); | ||
@@ -22,6 +22,6 @@ } | ||
if (t instanceof HTMLButtonElement) { | ||
const o = t.parentElement, n = o == null ? void 0 : o.querySelector( | ||
const o = t.parentElement, s = 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")); | ||
t.getAttribute("aria-expanded") === "true" ? (t.setAttribute("aria-expanded", "false"), s == null || s.setAttribute("aria-hidden", "true")) : (t.setAttribute("aria-expanded", "true"), s == null || s.setAttribute("aria-hidden", "false")); | ||
} | ||
@@ -32,4 +32,4 @@ }, F = (e = document.querySelector( | ||
e && document.querySelectorAll(".c-collapse__button").forEach((o) => { | ||
o.addEventListener("click", (n) => { | ||
j(n); | ||
o.addEventListener("click", (s) => { | ||
j(s); | ||
}); | ||
@@ -42,4 +42,4 @@ }); | ||
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) | ||
const s = o.querySelector(".js-countdown-days"), n = o.querySelector(".js-countdown-hours"), r = o.querySelector(".js-countdown-minutes"), l = o.querySelector(".js-countdown-seconds"); | ||
if (!s || !n || !r || !l) | ||
return; | ||
@@ -49,9 +49,9 @@ window.counters = { | ||
}; | ||
const i = window.counters[e], l = new Date(i).getTime(), d = setInterval(() => { | ||
const u = (/* @__PURE__ */ new Date()).getTime(), f = l - u; | ||
const i = window.counters[e], c = new Date(i).getTime(), d = setInterval(() => { | ||
const u = (/* @__PURE__ */ new Date()).getTime(), f = c - u; | ||
if (f <= 0) | ||
clearInterval(d); | ||
else { | ||
const p = Math.floor(f / 864e5), m = 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 = m.toString(), r.innerHTML = h.toString(), a.innerHTML = R.toString(); | ||
const p = Math.floor(f / 864e5), m = Math.floor(f % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60)), h = Math.floor(f % (1e3 * 60 * 60) / (1e3 * 60)), H = Math.floor(f % (1e3 * 60) / 1e3); | ||
s.innerHTML = p.toString(), n.innerHTML = m.toString(), r.innerHTML = h.toString(), l.innerHTML = H.toString(); | ||
} | ||
@@ -61,12 +61,12 @@ }, 1e3); | ||
}, B = (e) => { | ||
var n; | ||
var s; | ||
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 t = (s = e.parentNode) == null ? void 0 : s.querySelectorAll(".js-expand-target"); | ||
t == null || t.forEach((n) => n.setAttribute("aria-hidden", "false")); | ||
const o = e.querySelector(".js-expand-button__label"); | ||
o instanceof HTMLSpanElement && (o.innerHTML = "Voir moins"); | ||
}, K = (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"); | ||
var s; | ||
const t = (s = e.parentNode) == null ? void 0 : s.querySelectorAll(".js-expand-target"); | ||
t == null || t.forEach((n) => n.setAttribute("aria-hidden", "true")), e.setAttribute("aria-expanded", "false"); | ||
const o = e.querySelector(".js-expand-button__label"); | ||
@@ -77,7 +77,26 @@ o instanceof HTMLSpanElement && (o.innerHTML = "Voir plus"); | ||
return e.preventDefault(), t instanceof HTMLButtonElement ? t.getAttribute("aria-expanded") === "true" ? K(t) : B(t) : null; | ||
}, z = (e = document.querySelector( | ||
}, V = (e = document.querySelector( | ||
".js-expand-button" | ||
)) => { | ||
e && document.querySelectorAll(".js-expand-button").forEach((o) => o.addEventListener("click", P)); | ||
}, c = { | ||
}, Y = () => { | ||
const e = document.querySelectorAll(".js-half-donut-result"); | ||
for (const t of Array.from(e)) { | ||
const o = t.querySelector(".c-half-donut"), s = t.querySelector(".c-legend"); | ||
if (!o || !s) | ||
return; | ||
s.querySelectorAll("[data-color]").forEach((n) => { | ||
const r = n.getAttribute("data-color"), l = o.querySelector(`.c-half-donut__zone--${r}`); | ||
l == null || l.addEventListener("mouseenter", () => { | ||
n.classList.add("c-legend__item--is-hovered"), o.classList.add("c-half-donut--is-hovered"), s.classList.add("c-legend--is-hovered"); | ||
}), l == null || l.addEventListener("mouseleave", () => { | ||
n.classList.remove("c-legend__item--is-hovered"), o.classList.remove("c-half-donut--is-hovered"), s.classList.remove("c-legend--is-hovered"); | ||
}), n.addEventListener("mouseenter", () => { | ||
l == null || l.classList.add("c-half-donut__zone--is-hovered"), s.classList.add("c-legend--is-hovered"), o.classList.add("c-half-donut--is-hovered"); | ||
}), n.addEventListener("mouseleave", () => { | ||
l == null || l.classList.remove("c-half-donut__zone--is-hovered"), s.classList.remove("c-legend--is-hovered"), o.classList.remove("c-half-donut--is-hovered"); | ||
}); | ||
}); | ||
} | ||
}, a = { | ||
inert: ":not([inert]):not([inert] *)", | ||
@@ -87,24 +106,24 @@ negTabIndex: ':not([tabindex^="-"])', | ||
}; | ||
var V = [ | ||
`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}`, | ||
var G = [ | ||
`a[href]${a.inert}${a.negTabIndex}`, | ||
`area[href]${a.inert}${a.negTabIndex}`, | ||
`input:not([type="hidden"]):not([type="radio"])${a.inert}${a.negTabIndex}${a.disabled}`, | ||
`input[type="radio"]${a.inert}${a.negTabIndex}${a.disabled}`, | ||
`select${a.inert}${a.negTabIndex}${a.disabled}`, | ||
`textarea${a.inert}${a.negTabIndex}${a.disabled}`, | ||
`button${a.inert}${a.negTabIndex}${a.disabled}`, | ||
`details${a.inert} > summary:first-of-type${a.negTabIndex}`, | ||
// Discard until Firefox supports `:has()` | ||
// See: https://github.com/KittyGiraudel/focusable-selectors/issues/12 | ||
// `details:not(:has(> summary))${not.inert}${not.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}` | ||
`iframe${a.inert}${a.negTabIndex}`, | ||
`audio[controls]${a.inert}${a.negTabIndex}`, | ||
`video[controls]${a.inert}${a.negTabIndex}`, | ||
`[contenteditable]${a.inert}${a.negTabIndex}`, | ||
`[tabindex]${a.inert}${a.negTabIndex}` | ||
]; | ||
function T(e) { | ||
function w(e) { | ||
(e.querySelector("[autofocus]") || e).focus(); | ||
} | ||
function Y(e) { | ||
function X(e) { | ||
const t = y(e, !0), o = t ? y(e, !1) || t : null; | ||
@@ -114,11 +133,11 @@ return [t, o]; | ||
function y(e, t) { | ||
if (t && x(e)) | ||
if (t && A(e)) | ||
return e; | ||
if (X(e)) | ||
if (J(e)) | ||
if (e.shadowRoot) { | ||
let o = _(e.shadowRoot, t); | ||
let o = T(e.shadowRoot, t); | ||
for (; o; ) { | ||
const n = y(o, t); | ||
if (n) | ||
return n; | ||
const s = y(o, t); | ||
if (s) | ||
return s; | ||
o = $(o, t); | ||
@@ -131,19 +150,19 @@ } | ||
t || o.reverse(); | ||
for (const n of o) { | ||
const s = y(n, t); | ||
if (s) | ||
return s; | ||
for (const s of o) { | ||
const n = y(s, t); | ||
if (n) | ||
return n; | ||
} | ||
} else { | ||
let o = _(e, t); | ||
let o = T(e, t); | ||
for (; o; ) { | ||
const n = y(o, t); | ||
if (n) | ||
return n; | ||
const s = y(o, t); | ||
if (s) | ||
return s; | ||
o = $(o, t); | ||
} | ||
} | ||
return !t && x(e) ? e : null; | ||
return !t && A(e) ? e : null; | ||
} | ||
function _(e, t) { | ||
function T(e, t) { | ||
return t ? e.firstElementChild : e.lastElementChild; | ||
@@ -154,19 +173,19 @@ } | ||
} | ||
const G = (e) => e.matches("details:not([open]) *") && !e.matches("details>summary:first-of-type") ? !0 : !(e.offsetWidth || e.offsetHeight || e.getClientRects().length), x = (e) => { | ||
const z = (e) => e.matches("details:not([open]) *") && !e.matches("details>summary:first-of-type") ? !0 : !(e.offsetWidth || e.offsetHeight || e.getClientRects().length), A = (e) => { | ||
var t; | ||
return (t = e.shadowRoot) != null && t.delegatesFocus ? !1 : e.matches(V.join(",")) && !G(e); | ||
return (t = e.shadowRoot) != null && t.delegatesFocus ? !1 : e.matches(G.join(",")) && !z(e); | ||
}; | ||
function X(e) { | ||
function J(e) { | ||
return e.shadowRoot && e.getAttribute("tabindex") === "-1" ? !1 : !e.matches(":disabled,[hidden],[inert]"); | ||
} | ||
function w(e = document) { | ||
function _(e = document) { | ||
const t = e.activeElement; | ||
return t ? t.shadowRoot ? w(t.shadowRoot) || document.activeElement : t : null; | ||
return t ? t.shadowRoot ? _(t.shadowRoot) || document.activeElement : t : null; | ||
} | ||
function J(e, t) { | ||
const [o, n] = Y(e); | ||
function Q(e, t) { | ||
const [o, s] = X(e); | ||
if (!o) | ||
return t.preventDefault(); | ||
const s = w(); | ||
t.shiftKey && s === o ? (n.focus(), t.preventDefault()) : !t.shiftKey && s === n && (o.focus(), t.preventDefault()); | ||
const n = _(); | ||
t.shiftKey && n === o ? (s.focus(), t.preventDefault()) : !t.shiftKey && n === s && (o.focus(), t.preventDefault()); | ||
} | ||
@@ -194,3 +213,3 @@ class M { | ||
var o; | ||
return this.shown ? this : (this.shown = !0, this.$el.removeAttribute("aria-hidden"), this.previouslyFocused = w(), ((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) : T(this.$el), document.body.addEventListener("focus", this.maintainFocus, !0), this.$el.addEventListener("keydown", this.bindKeypress, !0), this.fire("show", t), this); | ||
return this.shown ? this : (this.shown = !0, this.$el.removeAttribute("aria-hidden"), this.previouslyFocused = _(), ((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) : w(this.$el), document.body.addEventListener("focus", this.maintainFocus, !0), this.$el.addEventListener("keydown", this.bindKeypress, !0), this.fire("show", t), this); | ||
} | ||
@@ -203,4 +222,4 @@ /** | ||
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; | ||
var o, s; | ||
return this.shown ? (this.shown = !1, this.$el.setAttribute("aria-hidden", "true"), (s = (o = this.previouslyFocused) == null ? void 0 : o.focus) == null || s.call(o), document.body.removeEventListener("focus", this.maintainFocus, !0), this.$el.removeEventListener("keydown", this.bindKeypress, !0), this.fire("hide", t), this) : this; | ||
} | ||
@@ -210,4 +229,4 @@ /** | ||
*/ | ||
on(t, o, n) { | ||
return this.$el.addEventListener(t, o, n), this; | ||
on(t, o, s) { | ||
return this.$el.addEventListener(t, o, s), this; | ||
} | ||
@@ -217,4 +236,4 @@ /** | ||
*/ | ||
off(t, o, n) { | ||
return this.$el.removeEventListener(t, o, n), this; | ||
off(t, o, s) { | ||
return this.$el.removeEventListener(t, o, s), this; | ||
} | ||
@@ -245,4 +264,4 @@ /** | ||
bindKeypress(t) { | ||
var n; | ||
if (((n = document.activeElement) == null ? void 0 : n.closest('[aria-modal="true"]')) !== this.$el) | ||
var s; | ||
if (((s = document.activeElement) == null ? void 0 : s.closest('[aria-modal="true"]')) !== this.$el) | ||
return; | ||
@@ -254,3 +273,3 @@ let o = !1; | ||
} | ||
t.key === "Escape" && this.$el.getAttribute("role") !== "alertdialog" && !o && (t.preventDefault(), this.hide(t)), t.key === "Tab" && J(this.$el, t); | ||
t.key === "Escape" && this.$el.getAttribute("role") !== "alertdialog" && !o && (t.preventDefault(), this.hide(t)), t.key === "Tab" && Q(this.$el, t); | ||
} | ||
@@ -264,11 +283,11 @@ /** | ||
maintainFocus(t) { | ||
t.target.closest('[aria-modal="true"], [data-a11y-dialog-ignore-focus-trap]') || T(this.$el); | ||
t.target.closest('[aria-modal="true"], [data-a11y-dialog-ignore-focus-trap]') || w(this.$el); | ||
} | ||
} | ||
function A() { | ||
function x() { | ||
for (const e of document.querySelectorAll("[data-a11y-dialog]")) | ||
new M(e); | ||
} | ||
typeof document < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", A) : A()); | ||
const Q = () => document.querySelectorAll(".js-modal").forEach((e) => { | ||
typeof document < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", x) : x()); | ||
const U = () => document.querySelectorAll(".js-modal").forEach((e) => { | ||
if (!(e instanceof HTMLElement)) | ||
@@ -285,24 +304,24 @@ return; | ||
}); | ||
}), U = ({ navigatedList: e, nextBtn: t, prevBtn: o }) => { | ||
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"), (p = o.classList) == null || p.remove("o-nav-button--visible")); | ||
}, Z = ({ | ||
}), Z = ({ navigatedList: e, nextBtn: t, prevBtn: o }) => { | ||
var r, l, i, c, d, u, f, p; | ||
const s = e.scrollLeft > 0, n = e.scrollLeft + e.clientWidth < e.scrollWidth; | ||
s && n ? ((r = t.classList) == null || r.add("o-nav-button--visible"), (l = o.classList) == null || l.add("o-nav-button--visible")) : s ? ((i = t.classList) == null || i.remove("o-nav-button--visible"), (c = o.classList) == null || c.add("o-nav-button--visible")) : n ? ((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")); | ||
}, ee = ({ | ||
navigatedList: e, | ||
nextBtn: t, | ||
prevBtn: o, | ||
sliderVariant: n | ||
sliderVariant: s | ||
}) => { | ||
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") | ||
const n = e.closest(".js-overview-bar-container"), r = n == null ? void 0 : n.querySelector(".c-stepper"), l = r == null ? void 0 : r.querySelectorAll(".c-stepper__item"); | ||
if (l) { | ||
const i = Array.from(l).findIndex( | ||
(c) => c.classList.contains("c-stepper__item--loading") | ||
); | ||
if (i < 0) | ||
a[0].classList.add("c-stepper__item--loading"); | ||
l[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"); | ||
l[i].classList.remove("c-stepper__item--loading"), l[i].classList.add("c-stepper__item--loaded"); | ||
const c = l[i].querySelector(".c-stepper__loader"); | ||
c && c instanceof HTMLElement && (c.style.transition = "width 0s linear"), i + 1 < l.length && l[i + 1].classList.add("c-stepper__item--loading"); | ||
} | ||
@@ -312,3 +331,3 @@ } | ||
let i = e.scrollLeft; | ||
switch (n) { | ||
switch (s) { | ||
case "three-columns-articles": | ||
@@ -336,37 +355,37 @@ i += e.clientWidth + 32; | ||
} | ||
}, ee = ({ | ||
}, te = ({ | ||
navigatedList: e, | ||
nextBtn: t, | ||
prevBtn: o, | ||
sliderVariant: n, | ||
delay: s | ||
sliderVariant: s, | ||
delay: n | ||
}) => { | ||
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"); | ||
const r = e.closest(".js-overview-bar-container"), l = r == null ? void 0 : r.querySelector(".c-stepper"), i = l == null ? void 0 : l.querySelectorAll(".c-stepper__item"); | ||
if (i) { | ||
const l = Array.from(i).findIndex( | ||
const c = 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`); | ||
c < 0 ? i[0].classList.add("c-stepper__item--loading") : (i[c].classList.remove("c-stepper__item--loading"), i[c].classList.remove("c-stepper__item--loaded"), c - 1 > 0 && (i[c - 1].classList.remove("c-stepper__item--loading"), i[c - 1].classList.remove("c-stepper__item--loaded"), setTimeout(() => { | ||
const d = i[c - 1].querySelector(".c-stepper__loader"); | ||
i[c - 1].classList.add("c-stepper__item--loading"), d && d instanceof HTMLElement && (d.style.transition = `width ${n / 1e3}s linear`); | ||
}, 0))); | ||
} | ||
if (e.clientWidth < e.scrollLeft) { | ||
let l = e.scrollLeft; | ||
switch (n) { | ||
let c = e.scrollLeft; | ||
switch (s) { | ||
case "three-columns-articles": | ||
l -= e.clientWidth + 32; | ||
c -= e.clientWidth + 32; | ||
break; | ||
case "rubrics": | ||
l -= e.clientWidth - 36; | ||
c -= e.clientWidth - 36; | ||
break; | ||
default: | ||
l -= Math.ceil(e.clientWidth * 0.6); | ||
c -= Math.ceil(e.clientWidth * 0.6); | ||
break; | ||
} | ||
e.scrollTo({ | ||
left: l, | ||
left: c, | ||
behavior: "smooth" | ||
}), t.classList.add("o-nav-button--visible"), l === 0 && o.classList.remove("o-nav-button--visible"); | ||
}), t.classList.add("o-nav-button--visible"), c === 0 && o.classList.remove("o-nav-button--visible"); | ||
} else | ||
@@ -378,4 +397,4 @@ e.scrollTo({ | ||
} | ||
}, te = ({ navigatedList: e, nextBtn: t, prevBtn: o }) => { | ||
U({ | ||
}, oe = ({ navigatedList: e, nextBtn: t, prevBtn: o }) => { | ||
Z({ | ||
navigatedList: e, | ||
@@ -385,6 +404,6 @@ nextBtn: t, | ||
}); | ||
}, oe = () => { | ||
}, se = () => { | ||
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"); | ||
const { sliderVariant: o } = t.dataset, { sliderAuto: s } = t.dataset, { sliderDelay: n } = t.dataset, r = n ? parseInt(n, 10) : 3e3, l = t.closest(".js-overview-bar-container"), i = l == null ? void 0 : l.querySelector(".c-stepper"), c = i == null ? void 0 : i.querySelectorAll(".c-stepper__item"); | ||
if (t) { | ||
@@ -400,3 +419,3 @@ const d = t.querySelector( | ||
"click", | ||
Z.bind(!1, { | ||
ee.bind(!1, { | ||
navigatedList: d, | ||
@@ -409,3 +428,3 @@ nextBtn: u, | ||
"click", | ||
ee.bind(!1, { | ||
te.bind(!1, { | ||
navigatedList: d, | ||
@@ -417,9 +436,9 @@ nextBtn: u, | ||
}) | ||
)), n === "true" && u) { | ||
)), s === "true" && u) { | ||
const p = i ? i.querySelector(".c-stepper__item--loading") : null; | ||
l && (l.forEach((m) => { | ||
c && (c.forEach((m) => { | ||
const h = m.querySelector(".c-stepper__loader"); | ||
h && h instanceof HTMLElement && (h.style.transition = `width ${r / 1e3}s linear`); | ||
}), 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((m) => { | ||
}), p || c[0].classList.add("c-stepper__item--loading")), setInterval(() => { | ||
u.classList.contains("o-nav-button--visible") ? u.click() : d && f && (d.scrollLeft = 0, c && (c.forEach((m) => { | ||
const h = m.querySelector(".c-stepper__loader"); | ||
@@ -430,3 +449,3 @@ h && h instanceof HTMLElement && (h.style.transition = "width 0s linear"), m.classList.remove("c-stepper__item--loading"), m.classList.remove("c-stepper__item--loaded"), setTimeout(() => { | ||
}), setTimeout(() => { | ||
l[0].classList.add("c-stepper__item--loading"); | ||
c[0].classList.add("c-stepper__item--loading"); | ||
}, 0)), f.click()); | ||
@@ -443,17 +462,17 @@ }, r); | ||
".js-navigation-container__list" | ||
), s = t.querySelector( | ||
".o-nav-button--next-button" | ||
), n = t.querySelector( | ||
".o-nav-button--next-button" | ||
), s = t.querySelector( | ||
".o-nav-button--previous-button" | ||
); | ||
o && n && s && window.addEventListener( | ||
o && s && n && window.addEventListener( | ||
"resize", | ||
te.bind(!1, { | ||
oe.bind(!1, { | ||
navigatedList: o, | ||
nextBtn: n, | ||
prevBtn: s | ||
nextBtn: s, | ||
prevBtn: n | ||
}) | ||
); | ||
} | ||
}, se = () => { | ||
}, ie = () => { | ||
const e = document.querySelector(".js-limit-scroll-progress-bar"), t = document.querySelector(".c-progress__bar"); | ||
@@ -463,15 +482,15 @@ if (!t) | ||
const { documentElement: o } = document; | ||
let n = o.scrollHeight - o.clientHeight; | ||
if (!n) | ||
let s = o.scrollHeight - o.clientHeight; | ||
if (!s) | ||
return; | ||
const s = o.scrollTop; | ||
e && (n = e.scrollHeight - o.clientHeight + (window.pageYOffset + e.getBoundingClientRect().top)); | ||
const r = Math.round(s / n * 100); | ||
const n = o.scrollTop; | ||
e && (s = e.scrollHeight - o.clientHeight + (window.pageYOffset + e.getBoundingClientRect().top)); | ||
const r = Math.round(n / s * 100); | ||
t.style.width = `${r}%`, r >= 100 && (t.style.width = "100%"); | ||
}, ie = () => { | ||
document.querySelector(".c-progress") && window.addEventListener("scroll", se); | ||
}, re = () => { | ||
document.querySelector(".c-progress") && window.addEventListener("scroll", ie); | ||
}; | ||
let g, v = 0; | ||
const re = () => { | ||
g = null, document.body.getBoundingClientRect().top > v + 2 && (g = "up"), document.body.getBoundingClientRect().top < v - 2 && (g = "down"), v = document.body.getBoundingClientRect().top; | ||
let g, E = 0; | ||
const le = () => { | ||
g = null, document.body.getBoundingClientRect().top > E + 2 && (g = "up"), document.body.getBoundingClientRect().top < E - 2 && (g = "down"), E = document.body.getBoundingClientRect().top; | ||
const e = document.querySelector(".c-read-also-banner"); | ||
@@ -482,3 +501,3 @@ if (e) { | ||
} | ||
}, le = (e = document.querySelector( | ||
}, ce = (e = document.querySelector( | ||
".c-read-also-banner" | ||
@@ -489,6 +508,6 @@ )) => { | ||
window.addEventListener("scroll", () => { | ||
clearTimeout(t), t = setTimeout(re, 100); | ||
clearTimeout(t), t = setTimeout(le, 100); | ||
}); | ||
} | ||
}, S = "#page-content", L = "#text-tooltip", ce = ".tooltip-btn", H = "c-text-tooltip--show", ae = [ | ||
}, L = "#page-content", S = "#text-tooltip", ae = ".tooltip-btn", D = "c-text-tooltip--show", de = [ | ||
"#page-content .c-content p", | ||
@@ -505,6 +524,6 @@ "#page-content .c-content h2", | ||
"#page-content header h2" | ||
], q = (e, t) => e instanceof Element ? t.some((o) => e.matches(o)) : !1, de = (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 && q(o, t) || !!n && q(n, t); | ||
}, ue = (e) => { | ||
], q = (e, t) => e instanceof Element ? t.some((o) => e.matches(o)) : !1, ue = (e, t) => { | ||
const o = e.startContainer.nodeType === Node.ELEMENT_NODE ? e.startContainer : e.startContainer.parentElement, s = e.endContainer.nodeType === Node.ELEMENT_NODE ? e.endContainer : e.endContainer.parentElement; | ||
return !!o && q(o, t) || !!s && q(s, t); | ||
}, fe = (e) => { | ||
var o; | ||
@@ -515,17 +534,17 @@ if (!e.focusNode) | ||
return t ? (t & 4) > 0 : e.anchorOffset < e.focusOffset; | ||
}, fe = (e, t, o) => { | ||
const n = document.querySelector(`${S} ${L}`), s = document.querySelector(`${S}`), r = document.querySelectorAll( | ||
`${S} ${L} ${ce}` | ||
}, he = (e, t, o) => { | ||
const s = document.querySelector(`${L} ${S}`), n = document.querySelector(`${L}`), r = document.querySelectorAll( | ||
`${L} ${S} ${ae}` | ||
); | ||
if (!n || !s) { | ||
if (!s || !n) { | ||
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(H); | ||
Array.from(r).forEach((c) => c.setAttribute("data-selected-text", o)); | ||
const l = e.getClientRects(), i = l[t ? l.length - 1 : 0]; | ||
s.style.top = `${i.top - n.getBoundingClientRect().top - (s.offsetHeight + 10)}px`, i.width < s.offsetWidth ? s.style.left = `${i.left - n.getBoundingClientRect().left + i.width / 2 - s.offsetWidth / 2}px` : t ? s.style.left = `${i.left - n.getBoundingClientRect().left + i.width - s.offsetWidth}px` : s.style.left = `${i.left - n.getBoundingClientRect().left}px`, s.classList.add(D); | ||
}, C = () => { | ||
const e = document.querySelector(`${L}`); | ||
e && e.classList.remove(H); | ||
}, E = ({ type: e }) => { | ||
const e = document.querySelector(`${S}`); | ||
e && e.classList.remove(D); | ||
}, v = ({ type: e }) => { | ||
const t = window.getSelection(); | ||
@@ -538,10 +557,10 @@ if (e === "selectionchange") { | ||
return; | ||
const o = t.getRangeAt(0), n = t.toString().trim(); | ||
if (n.length) { | ||
const s = de(o, ae), r = ue(t) || !1; | ||
s && fe(o, r, n); | ||
const o = t.getRangeAt(0), s = t.toString().trim(); | ||
if (s.length) { | ||
const n = ue(o, de), r = fe(t) || !1; | ||
n && he(o, r, s); | ||
return; | ||
} | ||
C(); | ||
}, he = () => { | ||
}, me = () => { | ||
if (!(window != null && window.getSelection)) { | ||
@@ -551,4 +570,4 @@ console.warn("Selection API isn't supported"); | ||
} | ||
document.addEventListener("mouseup", E), document.addEventListener("selectionchange", E), document.addEventListener("touchend", E), document.addEventListener("touchcancel", E); | ||
}, me = (e) => { | ||
document.addEventListener("mouseup", v), document.addEventListener("selectionchange", v), document.addEventListener("touchend", v), document.addEventListener("touchcancel", v); | ||
}, pe = (e) => { | ||
const { target: t } = e; | ||
@@ -559,9 +578,9 @@ if (t instanceof Element) { | ||
} | ||
}, pe = (e = document.querySelector( | ||
}, be = (e = document.querySelector( | ||
".c-search-form--button" | ||
)) => { | ||
e && e.addEventListener("click", (t) => { | ||
me(t); | ||
pe(t); | ||
}); | ||
}, be = ({ | ||
}, ge = ({ | ||
tabsContainerElement: e, | ||
@@ -574,11 +593,11 @@ event: t | ||
return; | ||
const n = e.querySelectorAll('[role="tab"]'), s = e.querySelectorAll('[role="tabpanel"]'), r = o.getAttribute("aria-controls"), a = Object.values(s).find( | ||
const s = e.querySelectorAll('[role="tab"]'), n = e.querySelectorAll('[role="tabpanel"]'), r = o.getAttribute("aria-controls"), l = Object.values(n).find( | ||
(i) => i.id === r | ||
); | ||
n.forEach((i) => { | ||
s.forEach((i) => { | ||
i.setAttribute("aria-selected", "false"); | ||
}), s.forEach((i) => { | ||
}), n.forEach((i) => { | ||
i.setAttribute("aria-hidden", "true"); | ||
}), o.setAttribute("aria-selected", "true"), a && a.removeAttribute("aria-hidden"); | ||
}, I = (e) => e.code === "ArrowLeft" || e.keyCode === 39, k = (e) => e.code === "ArrowRight" || e.keyCode === 37, ge = (e = document.querySelectorAll( | ||
}), o.setAttribute("aria-selected", "true"), l && l.removeAttribute("aria-hidden"); | ||
}, I = (e) => e.code === "ArrowLeft" || e.keyCode === 39, k = (e) => e.code === "ArrowRight" || e.keyCode === 37, ye = (e = document.querySelectorAll( | ||
".js-tabs" | ||
@@ -588,12 +607,12 @@ )) => { | ||
const o = t.querySelectorAll('[role="tab"]'); | ||
o.forEach((s) => { | ||
s.addEventListener("click", (r) => { | ||
be({ tabsContainerElement: t, event: r }); | ||
o.forEach((n) => { | ||
n.addEventListener("click", (r) => { | ||
ge({ 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 && (I(r) || k(r)) && (o[s].setAttribute("tabindex", "-1"), I(r) ? (s += 1, s >= o.length && (s = 0)) : k(r) && (s -= 1, s < 0 && (s = o.length - 1)), o[s].setAttribute("tabindex", "0"), o[s].focus()); | ||
const s = t.querySelector('[role="tablist"]'); | ||
if (s && o.length > 0) { | ||
let n = 0; | ||
s.addEventListener("keydown", (r) => { | ||
r instanceof KeyboardEvent && (I(r) || k(r)) && (o[n].setAttribute("tabindex", "-1"), I(r) ? (n += 1, n >= o.length && (n = 0)) : k(r) && (n -= 1, n < 0 && (n = o.length - 1)), o[n].setAttribute("tabindex", "0"), o[n].focus()); | ||
}); | ||
@@ -603,3 +622,3 @@ } | ||
}, Ee = () => { | ||
z(), ge(), F(), ie(), Q(), le(), pe(), N("olympicsGames", "countdown-olympics-games"), he(), O(), oe(), ne(); | ||
V(), ye(), F(), re(), U(), ce(), be(), N("olympicsGames", "countdown-olympics-games"), me(), W(), Y(), se(), ne(); | ||
}; | ||
@@ -606,0 +625,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("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])=>{r.isIntersecting||r.boundingClientRect.top<0?o.classList.add("u-hidden"):o.classList.remove("u-hidden")});new IntersectionObserver(([r])=>{o.classList.add("u-hidden"),r.isIntersecting||(o.classList.remove("u-hidden"),n.observe(t))}).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)})})},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)),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)}},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 w(e=document){const t=e.activeElement;return t?t.shadowRoot?w(t.shadowRoot)||document.activeElement:t:null}function G(e,t){const[o,n]=z(e);if(!o)return t.preventDefault();const s=w();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=w(),((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)},L=({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",L),document.addEventListener("selectionchange",L),document.addEventListener("touchend",L),document.addEventListener("touchcancel",L)},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(),O("olympicsGames","countdown-olympics-games"),ue(),h(),ee(),te()};p.initScripts=be,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})}); | ||
(function(m,h){typeof exports=="object"&&typeof module<"u"?h(exports):typeof define=="function"&&define.amd?define(["exports"],h):(m=typeof globalThis<"u"?globalThis:m||self,h(m.scripts={}))})(this,function(m){"use strict";var ve=Object.defineProperty;var Ee=(m,h,b)=>h in m?ve(m,h,{enumerable:!0,configurable:!0,writable:!0,value:b}):m[h]=b;var L=(m,h,b)=>(Ee(m,typeof h!="symbol"?h+"":h,b),b);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 s=new IntersectionObserver(([r])=>{r.isIntersecting||r.boundingClientRect.top<0?o.classList.add("u-hidden"):o.classList.remove("u-hidden")});new IntersectionObserver(([r])=>{o.classList.add("u-hidden"),r.isIntersecting||(o.classList.remove("u-hidden"),s.observe(t))}).observe(e)}}},b=e=>{e.stopImmediatePropagation(),e.preventDefault();const t=e.currentTarget;if(t instanceof HTMLButtonElement){const o=t.parentElement,s=o==null?void 0:o.querySelector(`#${t.getAttribute("aria-controls")}`);t.getAttribute("aria-expanded")==="true"?(t.setAttribute("aria-expanded","false"),s==null||s.setAttribute("aria-hidden","true")):(t.setAttribute("aria-expanded","true"),s==null||s.setAttribute("aria-hidden","false"))}},j=(e=document.querySelector(".js-collapse__button"))=>{e&&document.querySelectorAll(".c-collapse__button").forEach(o=>{o.addEventListener("click",s=>{b(s)})})},W=(e,t)=>{const o=document.querySelector(`#${t}`);if(o){const s=o.querySelector(".js-countdown-days"),n=o.querySelector(".js-countdown-hours"),r=o.querySelector(".js-countdown-minutes"),l=o.querySelector(".js-countdown-seconds");if(!s||!n||!r||!l)return;window.counters={olympicsGames:"2024-07-26 20:00:00"};const i=window.counters[e],c=new Date(i).getTime(),d=setInterval(()=>{const u=new Date().getTime(),f=c-u;if(f<=0)clearInterval(d);else{const y=Math.floor(f/864e5),g=Math.floor(f%(1e3*60*60*24)/(1e3*60*60)),p=Math.floor(f%(1e3*60*60)/(1e3*60)),ye=Math.floor(f%(1e3*60)/1e3);s.innerHTML=y.toString(),n.innerHTML=g.toString(),r.innerHTML=p.toString(),l.innerHTML=ye.toString()}},1e3)}},F=e=>{var s;e.setAttribute("aria-expanded","true");const t=(s=e.parentNode)==null?void 0:s.querySelectorAll(".js-expand-target");t==null||t.forEach(n=>n.setAttribute("aria-hidden","false"));const o=e.querySelector(".js-expand-button__label");o instanceof HTMLSpanElement&&(o.innerHTML="Voir moins")},N=e=>{var s;const t=(s=e.parentNode)==null?void 0:s.querySelectorAll(".js-expand-target");t==null||t.forEach(n=>n.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))},K=()=>{const e=document.querySelectorAll(".js-half-donut-result");for(const t of Array.from(e)){const o=t.querySelector(".c-half-donut"),s=t.querySelector(".c-legend");if(!o||!s)return;s.querySelectorAll("[data-color]").forEach(n=>{const r=n.getAttribute("data-color"),l=o.querySelector(`.c-half-donut__zone--${r}`);l==null||l.addEventListener("mouseenter",()=>{n.classList.add("c-legend__item--is-hovered"),o.classList.add("c-half-donut--is-hovered"),s.classList.add("c-legend--is-hovered")}),l==null||l.addEventListener("mouseleave",()=>{n.classList.remove("c-legend__item--is-hovered"),o.classList.remove("c-half-donut--is-hovered"),s.classList.remove("c-legend--is-hovered")}),n.addEventListener("mouseenter",()=>{l==null||l.classList.add("c-half-donut__zone--is-hovered"),s.classList.add("c-legend--is-hovered"),o.classList.add("c-half-donut--is-hovered")}),n.addEventListener("mouseleave",()=>{l==null||l.classList.remove("c-half-donut__zone--is-hovered"),s.classList.remove("c-legend--is-hovered"),o.classList.remove("c-half-donut--is-hovered")})})}},a={inert:":not([inert]):not([inert] *)",negTabIndex:':not([tabindex^="-"])',disabled:":not(:disabled)"};var V=[`a[href]${a.inert}${a.negTabIndex}`,`area[href]${a.inert}${a.negTabIndex}`,`input:not([type="hidden"]):not([type="radio"])${a.inert}${a.negTabIndex}${a.disabled}`,`input[type="radio"]${a.inert}${a.negTabIndex}${a.disabled}`,`select${a.inert}${a.negTabIndex}${a.disabled}`,`textarea${a.inert}${a.negTabIndex}${a.disabled}`,`button${a.inert}${a.negTabIndex}${a.disabled}`,`details${a.inert} > summary:first-of-type${a.negTabIndex}`,`iframe${a.inert}${a.negTabIndex}`,`audio[controls]${a.inert}${a.negTabIndex}`,`video[controls]${a.inert}${a.negTabIndex}`,`[contenteditable]${a.inert}${a.negTabIndex}`,`[tabindex]${a.inert}${a.negTabIndex}`];function A(e){(e.querySelector("[autofocus]")||e).focus()}function Y(e){const t=v(e,!0),o=t?v(e,!1)||t:null;return[t,o]}function v(e,t){if(t&&C(e))return e;if(X(e))if(e.shadowRoot){let o=x(e.shadowRoot,t);for(;o;){const s=v(o,t);if(s)return s;o=q(o,t)}}else if(e.localName==="slot"){const o=e.assignedElements({flatten:!0});t||o.reverse();for(const s of o){const n=v(s,t);if(n)return n}}else{let o=x(e,t);for(;o;){const s=v(o,t);if(s)return s;o=q(o,t)}}return!t&&C(e)?e:null}function x(e,t){return t?e.firstElementChild:e.lastElementChild}function q(e,t){return t?e.nextElementSibling:e.previousElementSibling}const G=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(V.join(","))&&!G(e)};function X(e){return e.shadowRoot&&e.getAttribute("tabindex")==="-1"?!1:!e.matches(":disabled,[hidden],[inert]")}function _(e=document){const t=e.activeElement;return t?t.shadowRoot?_(t.shadowRoot)||document.activeElement:t:null}function z(e,t){const[o,s]=Y(e);if(!o)return t.preventDefault();const n=_();t.shiftKey&&n===o?(s.focus(),t.preventDefault()):!t.shiftKey&&n===s&&(o.focus(),t.preventDefault())}class I{constructor(t){L(this,"$el");L(this,"id");L(this,"previouslyFocused");L(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=_(),((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):A(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,s;return this.shown?(this.shown=!1,this.$el.setAttribute("aria-hidden","true"),(s=(o=this.previouslyFocused)==null?void 0:o.focus)==null||s.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,s){return this.$el.addEventListener(t,o,s),this}off(t,o,s){return this.$el.removeEventListener(t,o,s),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 s;if(((s=document.activeElement)==null?void 0:s.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"&&z(this.$el,t)}maintainFocus(t){t.target.closest('[aria-modal="true"], [data-a11y-dialog-ignore-focus-trap]')||A(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 J=()=>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)})}),Q=({navigatedList:e,nextBtn:t,prevBtn:o})=>{var r,l,i,c,d,u,f,y;const s=e.scrollLeft>0,n=e.scrollLeft+e.clientWidth<e.scrollWidth;s&&n?((r=t.classList)==null||r.add("o-nav-button--visible"),(l=o.classList)==null||l.add("o-nav-button--visible")):s?((i=t.classList)==null||i.remove("o-nav-button--visible"),(c=o.classList)==null||c.add("o-nav-button--visible")):n?((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"),(y=o.classList)==null||y.remove("o-nav-button--visible"))},U=({navigatedList:e,nextBtn:t,prevBtn:o,sliderVariant:s})=>{if(e){const n=e.closest(".js-overview-bar-container"),r=n==null?void 0:n.querySelector(".c-stepper"),l=r==null?void 0:r.querySelectorAll(".c-stepper__item");if(l){const i=Array.from(l).findIndex(c=>c.classList.contains("c-stepper__item--loading"));if(i<0)l[0].classList.add("c-stepper__item--loading");else{l[i].classList.remove("c-stepper__item--loading"),l[i].classList.add("c-stepper__item--loaded");const c=l[i].querySelector(".c-stepper__loader");c&&c instanceof HTMLElement&&(c.style.transition="width 0s linear"),i+1<l.length&&l[i+1].classList.add("c-stepper__item--loading")}}if(e.scrollWidth-e.clientWidth>e.clientWidth){let i=e.scrollLeft;switch(s){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")}}},Z=({navigatedList:e,nextBtn:t,prevBtn:o,sliderVariant:s,delay:n})=>{if(e){const r=e.closest(".js-overview-bar-container"),l=r==null?void 0:r.querySelector(".c-stepper"),i=l==null?void 0:l.querySelectorAll(".c-stepper__item");if(i){const c=Array.from(i).findIndex(d=>d.classList.contains("c-stepper__item--loading"));c<0?i[0].classList.add("c-stepper__item--loading"):(i[c].classList.remove("c-stepper__item--loading"),i[c].classList.remove("c-stepper__item--loaded"),c-1>0&&(i[c-1].classList.remove("c-stepper__item--loading"),i[c-1].classList.remove("c-stepper__item--loaded"),setTimeout(()=>{const d=i[c-1].querySelector(".c-stepper__loader");i[c-1].classList.add("c-stepper__item--loading"),d&&d instanceof HTMLElement&&(d.style.transition=`width ${n/1e3}s linear`)},0)))}if(e.clientWidth<e.scrollLeft){let c=e.scrollLeft;switch(s){case"three-columns-articles":c-=e.clientWidth+32;break;case"rubrics":c-=e.clientWidth-36;break;default:c-=Math.ceil(e.clientWidth*.6);break}e.scrollTo({left:c,behavior:"smooth"}),t.classList.add("o-nav-button--visible"),c===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")}},ee=({navigatedList:e,nextBtn:t,prevBtn:o})=>{Q({navigatedList:e,nextBtn:t,prevBtn:o})},te=()=>{const e=document.querySelectorAll(".js-navigation-container");for(const t of Array.from(e)){const{sliderVariant:o}=t.dataset,{sliderAuto:s}=t.dataset,{sliderDelay:n}=t.dataset,r=n?parseInt(n,10):3e3,l=t.closest(".js-overview-bar-container"),i=l==null?void 0:l.querySelector(".c-stepper"),c=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",U.bind(!1,{navigatedList:d,nextBtn:u,prevBtn:f,sliderVariant:o})),f==null||f.addEventListener("click",Z.bind(!1,{navigatedList:d,nextBtn:u,prevBtn:f,sliderVariant:o,delay:r}))),s==="true"&&u){const y=i?i.querySelector(".c-stepper__item--loading"):null;c&&(c.forEach(g=>{const p=g.querySelector(".c-stepper__loader");p&&p instanceof HTMLElement&&(p.style.transition=`width ${r/1e3}s linear`)}),y||c[0].classList.add("c-stepper__item--loading")),setInterval(()=>{u.classList.contains("o-nav-button--visible")?u.click():d&&f&&(d.scrollLeft=0,c&&(c.forEach(g=>{const p=g.querySelector(".c-stepper__loader");p&&p instanceof HTMLElement&&(p.style.transition="width 0s linear"),g.classList.remove("c-stepper__item--loading"),g.classList.remove("c-stepper__item--loaded"),setTimeout(()=>{p&&p instanceof HTMLElement&&(p.style.transition=`width ${r/1e3}s linear`)},0)}),setTimeout(()=>{c[0].classList.add("c-stepper__item--loading")},0)),f.click())},r)}}}},oe=()=>{const e=document.querySelectorAll(".js-navigation-container");for(const t of Array.from(e))if(t){const o=t.querySelector(".js-navigation-container__list"),s=t.querySelector(".o-nav-button--next-button"),n=t.querySelector(".o-nav-button--previous-button");o&&s&&n&&window.addEventListener("resize",ee.bind(!1,{navigatedList:o,nextBtn:s,prevBtn:n}))}},se=()=>{const e=document.querySelector(".js-limit-scroll-progress-bar"),t=document.querySelector(".c-progress__bar");if(!t)return;const{documentElement:o}=document;let s=o.scrollHeight-o.clientHeight;if(!s)return;const n=o.scrollTop;e&&(s=e.scrollHeight-o.clientHeight+(window.pageYOffset+e.getBoundingClientRect().top));const r=Math.round(n/s*100);t.style.width=`${r}%`,r>=100&&(t.style.width="100%")},ne=()=>{document.querySelector(".c-progress")&&window.addEventListener("scroll",se)};let E,w=0;const ie=()=>{E=null,document.body.getBoundingClientRect().top>w+2&&(E="up"),document.body.getBoundingClientRect().top<w-2&&(E="down"),w=document.body.getBoundingClientRect().top;const e=document.querySelector(".c-read-also-banner");if(e){const t=e.dataset.bannerLimitTop||"0";E==="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")),(E==="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"))}},re=(e=document.querySelector(".c-read-also-banner"))=>{if(e){let t;window.addEventListener("scroll",()=>{clearTimeout(t),t=setTimeout(ie,100)})}},T="#page-content",$="#text-tooltip",le=".tooltip-btn",M="c-text-tooltip--show",ce=["#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"],D=(e,t)=>e instanceof Element?t.some(o=>e.matches(o)):!1,ae=(e,t)=>{const o=e.startContainer.nodeType===Node.ELEMENT_NODE?e.startContainer:e.startContainer.parentElement,s=e.endContainer.nodeType===Node.ELEMENT_NODE?e.endContainer:e.endContainer.parentElement;return!!o&&D(o,t)||!!s&&D(s,t)},de=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},ue=(e,t,o)=>{const s=document.querySelector(`${T} ${$}`),n=document.querySelector(`${T}`),r=document.querySelectorAll(`${T} ${$} ${le}`);if(!s||!n){console.warn("Text tooltip : Tooltip or it's parent are not found in the DOM");return}Array.from(r).forEach(c=>c.setAttribute("data-selected-text",o));const l=e.getClientRects(),i=l[t?l.length-1:0];s.style.top=`${i.top-n.getBoundingClientRect().top-(s.offsetHeight+10)}px`,i.width<s.offsetWidth?s.style.left=`${i.left-n.getBoundingClientRect().left+i.width/2-s.offsetWidth/2}px`:t?s.style.left=`${i.left-n.getBoundingClientRect().left+i.width-s.offsetWidth}px`:s.style.left=`${i.left-n.getBoundingClientRect().left}px`,s.classList.add(M)},H=()=>{const e=document.querySelector(`${$}`);e&&e.classList.remove(M)},S=({type:e})=>{const t=window.getSelection();if(e==="selectionchange"){H();return}if(!t||!t.rangeCount)return;const o=t.getRangeAt(0),s=t.toString().trim();if(s.length){const n=ae(o,ce),r=de(t)||!1;n&&ue(o,r,s);return}H()},fe=()=>{if(!(window!=null&&window.getSelection)){console.warn("Selection API isn't supported");return}document.addEventListener("mouseup",S),document.addEventListener("selectionchange",S),document.addEventListener("touchend",S),document.addEventListener("touchcancel",S)},he=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"))}},me=(e=document.querySelector(".c-search-form--button"))=>{e&&e.addEventListener("click",t=>{he(t)})},pe=({tabsContainerElement:e,event:t})=>{t.preventDefault();const o=t.target;if(!(o instanceof HTMLButtonElement))return;const s=e.querySelectorAll('[role="tab"]'),n=e.querySelectorAll('[role="tabpanel"]'),r=o.getAttribute("aria-controls"),l=Object.values(n).find(i=>i.id===r);s.forEach(i=>{i.setAttribute("aria-selected","false")}),n.forEach(i=>{i.setAttribute("aria-hidden","true")}),o.setAttribute("aria-selected","true"),l&&l.removeAttribute("aria-hidden")},R=e=>e.code==="ArrowLeft"||e.keyCode===39,O=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(n=>{n.addEventListener("click",r=>{pe({tabsContainerElement:t,event:r})})});const s=t.querySelector('[role="tablist"]');if(s&&o.length>0){let n=0;s.addEventListener("keydown",r=>{r instanceof KeyboardEvent&&(R(r)||O(r))&&(o[n].setAttribute("tabindex","-1"),R(r)?(n+=1,n>=o.length&&(n=0)):O(r)&&(n-=1,n<0&&(n=o.length-1)),o[n].setAttribute("tabindex","0"),o[n].focus())})}})},ge=()=>{P(),be(),j(),ne(),J(),re(),me(),W("olympicsGames","countdown-olympics-games"),fe(),h(),K(),te(),oe()};m.initScripts=ge,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})}); |
@@ -9,2 +9,3 @@ export * from './AlertInfoBanner'; | ||
export * from './Carousel'; | ||
export * from './Chart'; | ||
export * from './Citation'; | ||
@@ -11,0 +12,0 @@ export * from './Collapse'; |
@@ -0,6 +1,5 @@ | ||
import { PoliticalPartiesColorsType } from '../../../types'; | ||
import { BoxProps, PercentageBarProps } from '../..'; | ||
import { default as React } from 'react'; | ||
export declare const politicalPartyList: readonly ["agir", "animalistes", "autre-ecologiste", "debout-la-france", "divers", "divers-centre", "divers-droite", "divers-gauche", "droite-souverainiste", "ensemble", "europe-ecologie-les-verts", "extreme-droite", "extreme-gauche", "france-insoumise", "generation-s", "gilets-jaunes", "horizons", "la-republique-en-marche", "les-republicains", "modem", "nouvelle-union-populaire-ecologique-et-sociale", "parti-communiste-francais", "parti-radical", "parti-radical-de-gauche", "parti-socialiste", "rassemblement-national", "reconquete", "regionalistes", "union-centre-droite", "union-centre-gauche", "union-des-democrates-et-independants", "union-gauche-ecologistes", "union-populaire-republicaine"]; | ||
export type PoliticalPartyListType = (typeof politicalPartyList)[number]; | ||
export interface ElectionsResultProps extends BoxProps { | ||
@@ -10,3 +9,3 @@ label: string; | ||
votes: number; | ||
politicalParty?: PoliticalPartyListType; | ||
politicalPartyColor?: PoliticalPartiesColorsType; | ||
ranking?: number; | ||
@@ -13,0 +12,0 @@ electedMembers?: string[]; |
@@ -10,3 +10,3 @@ declare const _default: { | ||
argTypes: { | ||
politicalParty: { | ||
politicalPartyColor: { | ||
options: readonly ["agir", "animalistes", "autre-ecologiste", "debout-la-france", "divers", "divers-centre", "divers-droite", "divers-gauche", "droite-souverainiste", "ensemble", "europe-ecologie-les-verts", "extreme-droite", "extreme-gauche", "france-insoumise", "generation-s", "gilets-jaunes", "horizons", "la-republique-en-marche", "les-republicains", "modem", "nouvelle-union-populaire-ecologique-et-sociale", "parti-communiste-francais", "parti-radical", "parti-radical-de-gauche", "parti-socialiste", "rassemblement-national", "reconquete", "regionalistes", "union-centre-droite", "union-centre-gauche", "union-des-democrates-et-independants", "union-gauche-ecologistes", "union-populaire-republicaine"]; | ||
@@ -46,3 +46,3 @@ }; | ||
votes: number; | ||
politicalParty: string; | ||
politicalPartyColor: string; | ||
ranking: number; | ||
@@ -49,0 +49,0 @@ electedMembers: string[]; |
@@ -8,3 +8,4 @@ export * from './tokenVariables'; | ||
export * from './diodeColorAvailables'; | ||
export * from './politicalPartiesColors'; | ||
export * from './rubricColorAvailables'; | ||
export * from './themeColorAvailables'; |
@@ -10,2 +10,3 @@ export * from './AsProps'; | ||
export * from './MessageType'; | ||
export * from './PoliticalPartiesColorsType'; | ||
export * from './SponsorType'; | ||
@@ -12,0 +13,0 @@ export * from './SystemProps'; |
{ | ||
"name": "@20minutes/hela", | ||
"version": "1.8.9", | ||
"version": "1.9.0", | ||
"repository": "git@github.com:20minutes/hela.git", | ||
@@ -70,3 +70,3 @@ "license": "MIT", | ||
"peerDependencies": { | ||
"react": "^18.2.0", | ||
"react": "^18.3.0", | ||
"react-dom": "^18.2.0" | ||
@@ -76,3 +76,3 @@ }, | ||
"@20minutes/eslint-config": "^1.2.6", | ||
"@aws-sdk/client-s3": "3.556.0", | ||
"@aws-sdk/client-s3": "3.563.0", | ||
"@csstools/postcss-sass": "^5.1.1", | ||
@@ -91,6 +91,6 @@ "@octokit/core": "5.1.0", | ||
"@types/node": "^20.12.7", | ||
"@types/react": "^18.2.79", | ||
"@types/react": "^18.3.0", | ||
"@types/react-dom": "^18.2.25", | ||
"@typescript-eslint/eslint-plugin": "^7.7.0", | ||
"@typescript-eslint/parser": "^7.7.0", | ||
"@typescript-eslint/eslint-plugin": "^7.7.1", | ||
"@typescript-eslint/parser": "^7.7.1", | ||
"@vitejs/plugin-react": "^4.2.1", | ||
@@ -118,3 +118,3 @@ "autoprefixer": "^10.4.19", | ||
"prettier": "^3.2.5", | ||
"react": "^18.2.0", | ||
"react": "^18.3.0", | ||
"react-dom": "^18.2.0", | ||
@@ -136,3 +136,3 @@ "react-syntax-highlighter": "^15.5.0", | ||
"vite-tsconfig-paths": "^4.3.2", | ||
"vitest": "^1.5.1" | ||
"vitest": "^1.5.2" | ||
}, | ||
@@ -139,0 +139,0 @@ "resolutions": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
1510112
493
19685