@20minutes/hela 2.18.5 → 2.18.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -64,34 +64,34 @@ const Vt = () => /Android/i.test(navigator.userAgent), jt = typeof window < "u"
64
64
  return;
65
65
  const h = r.querySelector(".c-autocomplete__input-spinner"), u = l.getAttribute("data-trigger-message"), f = async (g) => {
66
66
  try {
67
- const y = a && t.includes("20minutes.fr") ? Xt : await fetch(`${c}${e}${encodeURIComponent(g)}`).then(
67
+ const _ = a && t.includes("20minutes.fr") ? Xt : await fetch(`${c}${e}${encodeURIComponent(g)}`).then(
68
68
  (B) => B.json()
69
- ), A = o && typeof y == "object" && y !== null ? y[o] : y;
69
+ ), A = o && typeof _ == "object" && _ !== null ? _[o] : _;
70
70
  return Array.isArray(A) ? A : [];
71
- } catch (y) {
72
- return console.error("Error fetching autocomplete results:", y), [];
71
+ } catch (_) {
72
+ return console.error("Error fetching autocomplete results:", _), [];
73
73
  }
74
- }, m = (g, y) => {
74
+ }, m = (g, _) => {
75
75
  const A = document.createElement("li");
76
- A.id = `/${g}`, A.textContent = y, A.addEventListener("click", () => {
77
- l instanceof HTMLInputElement && (l.value = y, d.classList.add("u-hidden"));
76
+ A.id = `/${g}`, A.textContent = _, A.addEventListener("click", () => {
77
+ l instanceof HTMLInputElement && (l.value = _, d.classList.add("u-hidden"));
78
78
  }), d.appendChild(A);
79
79
  }, p = () => {
80
80
  h?.classList.toggle("u-hidden");
81
- }, _ = () => {
81
+ }, y = () => {
82
82
  const g = document.createElement("li");
83
83
  g.textContent = u, d.appendChild(g);
84
84
  }, w = async (g) => {
85
85
  p(), d.classList.remove("u-hidden");
86
- const y = await f(g);
87
- d.innerHTML = "", y.length === 0 && d.classList.add("u-hidden"), y.forEach((A) => {
86
+ const _ = await f(g);
87
+ d.innerHTML = "", _.length === 0 && d.classList.add("u-hidden"), _.forEach((A) => {
88
88
  m(A[i], A[n]);
89
89
  }), p();
90
90
  }, C = (g) => {
91
91
  if (!(g.target instanceof HTMLInputElement))
92
92
  return;
93
- const y = g.target.value;
94
- d.classList.remove("u-hidden"), y.length >= 3 ? w(y) : (d.innerHTML = "", _());
93
+ const _ = g.target.value;
94
+ d.classList.remove("u-hidden"), _.length >= 3 ? w(_) : (d.innerHTML = "", y());
95
95
  };
96
96
  l.addEventListener("input", C), l.addEventListener("focusout", () => {
97
97
  setTimeout(() => d.classList.add("u-hidden"), 300);
@@ -169,28 +169,28 @@ const Vt = () => /Android/i.test(navigator.userAgent), jt = typeof window < "u"
169
169
  ".c-map-districts-container__unzoom-button"
170
170
  );
171
171
  let o = t;
172
- const r = t.getAttribute("viewBox"), a = (m, p) => m.matches?.call(m, p), l = (m, p, _ = ".c-map-districts__zoomable:not(.js-selected-area)") => {
172
+ const r = t.getAttribute("viewBox"), a = (m, p) => m.matches?.call(m, p), l = (m, p, y = ".c-map-districts__zoomable:not(.js-selected-area)") => {
173
173
  if (!m)
174
174
  return;
175
175
  let w, C = m.parentElement;
176
176
  for (; C instanceof SVGGraphicsElement && C !== p; )
177
- a(C, _) && (w = C), C = C.parentElement;
177
+ a(C, y) && (w = C), C = C.parentElement;
178
178
  return w;
179
- }, c = (m, p, _) => {
179
+ }, c = (m, p, y) => {
180
180
  if (!m)
181
181
  return;
182
182
  let w = m.parentElement;
183
- for (; w instanceof SVGGraphicsElement && w !== _; ) {
183
+ for (; w instanceof SVGGraphicsElement && w !== y; ) {
184
184
  if (p === w)
185
185
  return !0;
186
186
  w = w.parentElement;
187
187
  }
188
- return _ === p;
188
+ return y === p;
189
189
  }, d = (m, p) => {
190
190
  if (p && n && e) {
191
191
  s.classList.remove("c-map-districts-container--department-view"), e.classList.remove("u-hidden"), i?.classList.add("u-hidden"), n.classList.add("u-hidden"), p !== r && (e.classList.add("u-hidden"), n.classList.remove("u-hidden")), o.classList.remove("js-selected-area"), o = m;
192
- const _ = o.getAttribute("data-info");
193
- i && _ && (s.classList.add("c-map-districts-container--department-view"), i.classList.remove("u-hidden"), i.innerHTML = _), o.classList.add("js-selected-area"), t.setAttribute("viewBox", p);
192
+ const y = o.getAttribute("data-info");
193
+ i && y && (s.classList.add("c-map-districts-container--department-view"), i.classList.remove("u-hidden"), i.innerHTML = y), o.classList.add("js-selected-area"), t.setAttribute("viewBox", p);
194
194
  }
195
195
  }, h = (m) => {
196
196
  m.stopPropagation();
@@ -202,13 +202,13 @@ const Vt = () => /Android/i.test(navigator.userAgent), jt = typeof window < "u"
202
202
  d(t, r);
203
203
  return;
204
204
  }
205
- const _ = l(
205
+ const y = l(
206
206
  p,
207
207
  o
208
208
  );
209
209
  d(
210
- _ || p,
211
- ee(_ || p)
210
+ y || p,
211
+ ee(y || p)
212
212
  );
213
213
  }
214
214
  }, u = () => {
@@ -327,15 +327,15 @@ const Vt = () => /Android/i.test(navigator.userAgent), jt = typeof window < "u"
327
327
  const t = document.querySelectorAll(".c-image-slider__slide"), e = document.querySelector(".c-image-slider__button-container--previous"), i = document.querySelector(".c-image-slider__button-container--next"), n = document.querySelectorAll(".c-image-slider__indicator");
328
328
  let o = 0, r = null, a = !1;
329
329
  const l = () => {
330
- n.forEach((g, y) => {
331
- g.classList.toggle("c-image-slider__indicator--is-active", y === o);
330
+ n.forEach((g, _) => {
331
+ g.classList.toggle("c-image-slider__indicator--is-active", _ === o);
332
332
  });
333
333
  }, c = (g = !0) => {
334
334
  if (!(s instanceof HTMLElement))
335
335
  return;
336
336
  s.style.transition = g ? "transform 0.3s ease" : "none";
337
- const y = -o * 100;
338
- s.style.transform = `translateX(${y}%)`, l();
337
+ const _ = -o * 100;
338
+ s.style.transform = `translateX(${_}%)`, l();
339
339
  }, d = (g) => {
340
340
  o = g, c(!0);
341
341
  }, h = () => {
@@ -360,25 +360,25 @@ const Vt = () => /Android/i.test(navigator.userAgent), jt = typeof window < "u"
360
360
  f();
361
361
  const g = (o + 1) % t.length;
362
362
  d(g), setTimeout(m, 5e3);
363
- }), n.forEach((g, y) => {
363
+ }), n.forEach((g, _) => {
364
364
  g.addEventListener("click", () => {
365
- f(), d(y), setTimeout(m, 5e3);
365
+ f(), d(_), setTimeout(m, 5e3);
366
366
  });
367
367
  });
368
- let p = 0, _ = 0, w = !1;
368
+ let p = 0, y = 0, w = !1;
369
369
  return s.addEventListener("touchstart", (g) => {
370
- s instanceof HTMLElement && (f(), p = g.touches[0].clientX, _ = p, w = !0, s.style.transition = "none");
370
+ s instanceof HTMLElement && (f(), p = g.touches[0].clientX, y = p, w = !0, s.style.transition = "none");
371
371
  }), s.addEventListener("touchmove", (g) => {
372
372
  if (!(s instanceof HTMLElement))
373
373
  return;
374
- _ = g.touches[0].clientX;
375
- const y = _ - p, A = -o * window.innerWidth + y;
374
+ y = g.touches[0].clientX;
375
+ const _ = y - p, A = -o * window.innerWidth + _;
376
376
  s.style.transform = `translateX(${A}px)`;
377
377
  }), s.addEventListener("touchend", () => {
378
378
  if (!w)
379
379
  return;
380
380
  w = !1;
381
- const g = _ - p;
381
+ const g = y - p;
382
382
  Math.abs(g) > 75 && (g < 0 ? o = Math.min(o + 1, t.length - 1) : g > 0 && (o = Math.max(o - 1, 0))), c(!0), setTimeout(m, 5e3);
383
383
  }), c(!0), h(), () => {
384
384
  u();
@@ -642,13 +642,13 @@ const Le = () => document.querySelectorAll(".js-modal").forEach((s) => {
642
642
  }).on("hide", () => {
643
643
  document.body.classList.remove("noscroll");
644
644
  });
645
- }), zt = "68px", Mt = "50px", lt = ({
645
+ }), Mt = "68px", zt = "50px", lt = ({
646
646
  navigationContainer: s,
647
647
  navigatedList: t,
648
648
  nextBtn: e,
649
649
  prevBtn: i
650
650
  }) => {
651
- const n = s.classList.contains("c-breadcrumb--is-small") ? Mt : zt;
651
+ const n = s.classList.contains("c-breadcrumb--is-small") ? zt : Mt;
652
652
  e.classList.contains("o-nav-button--visible") && !i.classList.contains("o-nav-button--visible") && (s.style.paddingRight = n, s.style.paddingLeft = ""), i.classList.contains("o-nav-button--visible") && (s.style.paddingLeft = n, e.classList.contains("o-nav-button--visible") && (s.style.paddingRight = n), e.classList.contains("o-nav-button--visible") || (s.style.paddingRight = "")), !e.classList.contains("o-nav-button--visible") && !i.classList.contains("o-nav-button--visible") && (t.style.width = "", s.style.paddingRight = "");
653
653
  }, Ae = ({
654
654
  navigationContainer: s,
@@ -783,7 +783,7 @@ const Le = () => document.querySelectorAll(".js-modal").forEach((s) => {
783
783
  );
784
784
  if (!(!l || !c || !d)) {
785
785
  if (l.clientWidth < l.scrollWidth && (c.classList.add("o-nav-button--visible"), c.classList.contains("c-slider__button-container--has-space-around"))) {
786
- const h = s.classList.contains("c-breadcrumb--is-small") ? Mt : zt;
786
+ const h = s.classList.contains("c-breadcrumb--is-small") ? zt : Mt;
787
787
  s.style.paddingRight = h;
788
788
  }
789
789
  if (c.addEventListener(
@@ -887,14 +887,14 @@ function G(s, t, e) {
887
887
  function D(s, t, e, i) {
888
888
  s.style.transform = G(t, e, i);
889
889
  }
890
- const ze = "cubic-bezier(.4,0,.22,1)";
890
+ const Me = "cubic-bezier(.4,0,.22,1)";
891
891
  function Dt(s, t, e, i) {
892
- s.style.transition = t ? `${t} ${e}ms ${i || ze}` : "none";
892
+ s.style.transition = t ? `${t} ${e}ms ${i || Me}` : "none";
893
893
  }
894
894
  function st(s, t, e) {
895
895
  s.style.width = typeof t == "number" ? `${t}px` : t, s.style.height = typeof e == "number" ? `${e}px` : e;
896
896
  }
897
- function Me(s) {
897
+ function ze(s) {
898
898
  Dt(s);
899
899
  }
900
900
  function Oe(s) {
@@ -2410,7 +2410,7 @@ class ii {
2410
2410
  }
2411
2411
  // Destroy is called automatically onFinish
2412
2412
  destroy() {
2413
- this._helperTimeout && clearTimeout(this._helperTimeout), Me(this._target), this._target.removeEventListener("transitionend", this._onTransitionEnd, !1), this._target.removeEventListener("transitioncancel", this._onTransitionEnd, !1), this._finished || this._finalizeAnimation();
2413
+ this._helperTimeout && clearTimeout(this._helperTimeout), ze(this._target), this._target.removeEventListener("transitionend", this._onTransitionEnd, !1), this._target.removeEventListener("transitioncancel", this._onTransitionEnd, !1), this._finished || this._finalizeAnimation();
2414
2414
  }
2415
2415
  }
2416
2416
  const si = 12, ni = 0.75;
@@ -3563,7 +3563,7 @@ const Ii = {
3563
3563
  preload: [1, 2],
3564
3564
  easing: "cubic-bezier(.4,0,.22,1)"
3565
3565
  };
3566
- class zi extends Pi {
3566
+ class Mi extends Pi {
3567
3567
  /**
3568
3568
  * @param {PhotoSwipeOptions} [options]
3569
3569
  */
@@ -3810,7 +3810,7 @@ function N(s, t, e) {
3810
3810
  const i = document.createElement(t);
3811
3811
  return s && (i.className = s), e && e.appendChild(i), i;
3812
3812
  }
3813
- function Mi(s, t, e) {
3813
+ function zi(s, t, e) {
3814
3814
  let i = `translate3d(${s}px,0px,0)`;
3815
3815
  return e !== void 0 && (i += ` scale3d(${e},${e},1)`), i;
3816
3816
  }
@@ -3950,7 +3950,7 @@ class Bi {
3950
3950
  * @param {number} height
3951
3951
  */
3952
3952
  setDisplayedSize(t, e) {
3953
- this.element && (this.element.tagName === "IMG" ? (nt(this.element, 250, "auto"), this.element.style.transformOrigin = "0 0", this.element.style.transform = Mi(0, 0, t / 250)) : nt(this.element, t, e));
3953
+ this.element && (this.element.tagName === "IMG" ? (nt(this.element, 250, "auto"), this.element.style.transformOrigin = "0 0", this.element.style.transform = zi(0, 0, t / 250)) : nt(this.element, t, e));
3954
3954
  }
3955
3955
  destroy() {
3956
3956
  var t;
@@ -4588,7 +4588,7 @@ const Vi = () => {
4588
4588
  return s = new Wi({
4589
4589
  gallery: "#photoswipe-gallery",
4590
4590
  children: "a",
4591
- pswpModule: zi,
4591
+ pswpModule: Mi,
4592
4592
  zoom: !1,
4593
4593
  imageClickAction: "next",
4594
4594
  tapAction: "next"
@@ -4667,8 +4667,8 @@ const Vi = () => {
4667
4667
  });
4668
4668
  let e = !1;
4669
4669
  const i = () => {
4670
- const { top: u, bottom: f } = s.getBoundingClientRect(), m = u < -400, p = f > 0;
4671
- t.style.display = m && p ? "flex" : "none";
4670
+ const { top: u, bottom: f } = s.getBoundingClientRect(), m = window.innerHeight / 2, p = u < -400, y = f < m;
4671
+ t.style.display = p && !y ? "flex" : "none";
4672
4672
  }, n = () => {
4673
4673
  e || (e = !0, window.addEventListener("scroll", i, { passive: !0 }), i());
4674
4674
  }, o = () => {
@@ -4702,9 +4702,9 @@ const Vi = () => {
4702
4702
  if (p instanceof HTMLIFrameElement)
4703
4703
  return c(p), !0;
4704
4704
  if (p instanceof HTMLElement) {
4705
- const _ = p.querySelector("iframe");
4706
- if (_)
4707
- return c(_), !0;
4705
+ const y = p.querySelector("iframe");
4706
+ if (y)
4707
+ return c(y), !0;
4708
4708
  }
4709
4709
  return !1;
4710
4710
  })
@@ -4753,7 +4753,7 @@ const Vi = () => {
4753
4753
  Ct();
4754
4754
  return;
4755
4755
  }
4756
- if (!t || !t.rangeCount)
4756
+ if (!t?.rangeCount)
4757
4757
  return;
4758
4758
  const e = t.getRangeAt(0), i = t.toString().trim();
4759
4759
  if (i.length) {
@@ -4921,12 +4921,12 @@ const Vi = () => {
4921
4921
  return;
4922
4922
  const u = c.getBBox();
4923
4923
  if (u.width > 0) {
4924
- const { x: f, y: m, width: p, height: _ } = u, w = l.getAttribute("data-scale"), C = w ? ` scale(${w})` : "";
4924
+ const { x: f, y: m, width: p, height: y } = u, w = l.getAttribute("data-scale"), C = w ? ` scale(${w})` : "";
4925
4925
  l.setAttribute(
4926
4926
  "transform",
4927
- `translate(${f + p / 2}, ${m + _ / 2})${C}`
4927
+ `translate(${f + p / 2}, ${m + y / 2})${C}`
4928
4928
  );
4929
- const g = d.getBBox(), y = 8, A = 4, B = 8, L = g.width + y, b = g.height + A;
4929
+ const g = d.getBBox(), _ = 8, A = 4, B = 8, L = g.width + _, b = g.height + A;
4930
4930
  h.setAttribute("width", `${L}`), h.setAttribute("height", `${b}`), h.setAttribute("x", `${-L / 2}`), h.setAttribute("y", `${-b - B}`);
4931
4931
  const E = -b / 2 - B;
4932
4932
  d.setAttribute("y", `${E}`), l.setAttribute("aria-hidden", "false");
@@ -5158,13 +5158,13 @@ const at = () => {
5158
5158
  $ && Y($);
5159
5159
  return;
5160
5160
  }
5161
- const z = b.closest(".c-map-towns__zoom-item")?.getAttribute("data-city-url");
5162
- if (z) {
5163
- Y(z);
5161
+ const M = b.closest(".c-map-towns__zoom-item")?.getAttribute("data-city-url");
5162
+ if (M) {
5163
+ Y(M);
5164
5164
  return;
5165
5165
  }
5166
- const M = b.closest(".c-map-towns__dept-trigger")?.getAttribute("data-url");
5167
- M && Y(M);
5166
+ const z = b.closest(".c-map-towns__dept-trigger")?.getAttribute("data-url");
5167
+ z && Y(z);
5168
5168
  };
5169
5169
  if (t) {
5170
5170
  e?.addEventListener("click", o), i?.addEventListener("click", o), n?.addEventListener("click", o), et = !0;
@@ -5178,41 +5178,41 @@ const at = () => {
5178
5178
  et = !0;
5179
5179
  const d = document.getElementById("js-zoom-label"), h = document.getElementById("js-zoom-title"), u = document.getElementById("js-town-sprite-data"), f = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map();
5180
5180
  let p = null;
5181
- const _ = () => {
5181
+ const y = () => {
5182
5182
  if (p)
5183
5183
  return p;
5184
5184
  const L = u instanceof HTMLScriptElement ? JSON.parse(u.textContent || '""') : "";
5185
5185
  return p = vs(gs(L)), p;
5186
5186
  }, w = () => {
5187
5187
  r.setAttribute("aria-hidden", "true"), l.replaceChildren();
5188
- }, C = (L, b) => L.startsWith("97") ? document.querySelector(`path[id="town-${b}-drom"]`)?.getAttribute("d") || null : _().get(`town-${b}`)?.path || null, g = (L, b) => {
5188
+ }, C = (L, b) => L.startsWith("97") ? document.querySelector(`path[id="town-${b}-drom"]`)?.getAttribute("d") || null : y().get(`town-${b}`)?.path || null, g = (L, b) => {
5189
5189
  const I = ps[L] || [];
5190
5190
  if (I.length === 0)
5191
5191
  return;
5192
- const z = document.createDocumentFragment();
5192
+ const M = document.createDocumentFragment();
5193
5193
  I.forEach((F) => {
5194
- const M = C(L, F.id);
5195
- if (!M)
5194
+ const z = C(L, F.id);
5195
+ if (!z)
5196
5196
  return;
5197
- const $ = As(F.name, M, b);
5198
- z.appendChild($);
5199
- }), l.appendChild(z), requestAnimationFrame(() => {
5197
+ const $ = As(F.name, z, b);
5198
+ M.appendChild($);
5199
+ }), l.appendChild(M), requestAnimationFrame(() => {
5200
5200
  ct(l);
5201
5201
  });
5202
- }, y = (L) => {
5202
+ }, _ = (L) => {
5203
5203
  const { target: b } = L;
5204
5204
  if (!(b instanceof Element))
5205
5205
  return;
5206
5206
  const E = b?.closest(".c-map-towns__dept-trigger");
5207
5207
  if (!E)
5208
5208
  return;
5209
- const I = E.getAttribute("id")?.replace("out-", "") || "", z = E.getAttribute("data-name"), F = ys(I, _, f);
5209
+ const I = E.getAttribute("id")?.replace("out-", "") || "", M = E.getAttribute("data-name"), F = ys(I, y, f);
5210
5210
  ws(m);
5211
- const M = Ss(F, m);
5212
- if (d && h && z && (d.textContent = z, h.textContent = `Carte détaillée du département : ${z}`), !(E instanceof SVGGraphicsElement))
5211
+ const z = Ss(F, m);
5212
+ if (d && h && M && (d.textContent = M, h.textContent = `Carte détaillée du département : ${M}`), !(E instanceof SVGGraphicsElement))
5213
5213
  return;
5214
5214
  const $ = Es(a, E);
5215
- r.setAttribute("aria-hidden", "false"), Ls(l, M), g(I, $);
5215
+ r.setAttribute("aria-hidden", "false"), Ls(l, z), g(I, $);
5216
5216
  }, A = (L) => {
5217
5217
  const { target: b } = L;
5218
5218
  if (!(b instanceof Element))
@@ -5220,12 +5220,12 @@ const at = () => {
5220
5220
  const I = b.closest(".c-map-towns__zoom-town")?.getAttribute("data-url");
5221
5221
  I && Y(I);
5222
5222
  };
5223
- e?.addEventListener("click", y), i?.addEventListener("click", y), l.addEventListener("click", A), c.addEventListener("click", () => {
5223
+ e?.addEventListener("click", _), i?.addEventListener("click", _), l.addEventListener("click", A), c.addEventListener("click", () => {
5224
5224
  w();
5225
5225
  }), r.addEventListener("click", (L) => {
5226
5226
  L.target === r && w();
5227
5227
  });
5228
- }, Ms = () => {
5228
+ }, zs = () => {
5229
5229
  ue(), rs(), te(), ve(), ae(), Gi(), Vi(), Le(), ns(), Q("winterOlympicsGames", "countdown-winter-olympics-games"), Q("eurovision", "countdown-eurovision"), Q("worldFoot2026", "countdown-world-foot-2026"), is(), Jt(), me(), se(), Yt(
5230
5230
  "localisation-input",
5231
5231
  "https://www.20minutes.fr/elections/resultats/recherche",
@@ -5235,5 +5235,5 @@ const at = () => {
5235
5235
  ), ie(), ct(), hs(), Ut(), Kt(), fe(), at(), Te(), Ie(), pe(), Gt(), cs(), Ui(), Xi();
5236
5236
  };
5237
5237
  export {
5238
- Ms as initScripts
5238
+ zs as initScripts
5239
5239
  };