@20minutes/hela 2.17.1 → 2.17.3
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.
- package/dist/index.es.js +1972 -1836
- package/dist/index.umd.cjs +1 -1
- package/dist/js/scripts.es.js +221 -170
- package/dist/js/scripts.umd.cjs +1 -1
- package/dist/scss/abstracts/variables/_token-variables.scss +1 -1
- package/dist/src/assets/scripts/scrollToTopComment.d.ts +1 -0
- package/dist/src/components/molecules/Card/Templates/CardNotification/CardNotification.d.ts +9 -0
- package/dist/src/components/molecules/Card/Templates/CardNotification/CardNotification.stories.d.ts +26 -0
- package/dist/src/components/molecules/Card/Templates/CardNotification/index.d.ts +1 -0
- package/dist/src/components/molecules/Card/Templates/index.d.ts +1 -0
- package/dist/src/components/molecules/Comment/Comment.d.ts +2 -1
- package/dist/src/components/molecules/Comment/Comment.stories.d.ts +1 -0
- package/dist/src/components/organisms/Elections/ElectionsResult.stories.d.ts +1 -1
- package/dist/src/constants/politicalPartiesColors.d.ts +1 -1
- package/dist/src/constants/tokenVariables.d.ts +8 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/js/scripts.es.js
CHANGED
|
@@ -9,7 +9,7 @@ const Rt = () => /Android/i.test(navigator.userAgent), Bt = typeof window < "u"
|
|
|
9
9
|
s && s.addEventListener("change", (t) => {
|
|
10
10
|
window.location.replace(t.target.value);
|
|
11
11
|
});
|
|
12
|
-
},
|
|
12
|
+
}, qt = () => {
|
|
13
13
|
const s = document.querySelector(".c-search-banner");
|
|
14
14
|
if (!s)
|
|
15
15
|
return;
|
|
@@ -22,7 +22,7 @@ const Rt = () => /Android/i.test(navigator.userAgent), Bt = typeof window < "u"
|
|
|
22
22
|
e.getAttribute("aria-expanded") === "true" ? (e.setAttribute("aria-expanded", "false"), i.setAttribute("aria-hidden", "true")) : (e.setAttribute("aria-expanded", "true"), i.setAttribute("aria-hidden", "false"));
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
},
|
|
25
|
+
}, kt = [
|
|
26
26
|
{
|
|
27
27
|
text: "Paris",
|
|
28
28
|
_index: "town_1717424751904",
|
|
@@ -60,34 +60,34 @@ const Rt = () => /Android/i.test(navigator.userAgent), Bt = typeof window < "u"
|
|
|
60
60
|
const a = r.dataset.storybook, l = r.querySelector(`#${s}-search`), c = l?.getAttribute("data-api-url"), d = r.querySelector(".c-autocomplete__menu");
|
|
61
61
|
if (!l || !d || !c)
|
|
62
62
|
return;
|
|
63
|
-
const h = r.querySelector(".c-autocomplete__input-spinner"), u = l.getAttribute("data-trigger-message"),
|
|
63
|
+
const h = r.querySelector(".c-autocomplete__input-spinner"), u = l.getAttribute("data-trigger-message"), m = async (g) => {
|
|
64
64
|
try {
|
|
65
|
-
let
|
|
66
|
-
return a && t.includes("20minutes.fr") ?
|
|
67
|
-
} catch (
|
|
68
|
-
return console.error("Error fetching autocomplete results:",
|
|
65
|
+
let _;
|
|
66
|
+
return a && t.includes("20minutes.fr") ? _ = kt : _ = await (await fetch(`${c}${e}${encodeURIComponent(g)}`)).json(), o ? _[o] : _;
|
|
67
|
+
} catch (_) {
|
|
68
|
+
return console.error("Error fetching autocomplete results:", _), [];
|
|
69
69
|
}
|
|
70
|
-
}, f = (g,
|
|
70
|
+
}, f = (g, _) => {
|
|
71
71
|
const w = document.createElement("li");
|
|
72
|
-
w.id = `/${g}`, w.textContent =
|
|
73
|
-
l instanceof HTMLInputElement && (l.value =
|
|
72
|
+
w.id = `/${g}`, w.textContent = _, w.addEventListener("click", () => {
|
|
73
|
+
l instanceof HTMLInputElement && (l.value = _, d.classList.add("u-hidden"));
|
|
74
74
|
}), d.appendChild(w);
|
|
75
|
-
},
|
|
75
|
+
}, p = () => {
|
|
76
76
|
h?.classList.toggle("u-hidden");
|
|
77
|
-
},
|
|
77
|
+
}, y = () => {
|
|
78
78
|
const g = document.createElement("li");
|
|
79
79
|
g.textContent = u, d.appendChild(g);
|
|
80
80
|
}, S = async (g) => {
|
|
81
|
-
|
|
82
|
-
const
|
|
83
|
-
d.innerHTML = "",
|
|
81
|
+
p(), d.classList.remove("u-hidden");
|
|
82
|
+
const _ = await m(g);
|
|
83
|
+
d.innerHTML = "", _.length === 0 && d.classList.add("u-hidden"), _.forEach((w) => {
|
|
84
84
|
f(w[i], w[n]);
|
|
85
|
-
}),
|
|
85
|
+
}), p();
|
|
86
86
|
}, L = (g) => {
|
|
87
87
|
if (!(g.target instanceof HTMLInputElement))
|
|
88
88
|
return;
|
|
89
|
-
const
|
|
90
|
-
d.classList.remove("u-hidden"),
|
|
89
|
+
const _ = g.target.value;
|
|
90
|
+
d.classList.remove("u-hidden"), _.length >= 3 ? S(_) : (d.innerHTML = "", y());
|
|
91
91
|
};
|
|
92
92
|
l.addEventListener("input", L), l.addEventListener("focusout", () => {
|
|
93
93
|
setTimeout(() => d.classList.add("u-hidden"), 300);
|
|
@@ -143,8 +143,8 @@ const Rt = () => /Android/i.test(navigator.userAgent), Bt = typeof window < "u"
|
|
|
143
143
|
if (h <= 0)
|
|
144
144
|
clearInterval(c);
|
|
145
145
|
else {
|
|
146
|
-
const u = Math.floor(h / 864e5),
|
|
147
|
-
i.innerHTML = u.toString(), n.innerHTML =
|
|
146
|
+
const u = Math.floor(h / 864e5), m = Math.floor(h % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60)), f = Math.floor(h % (1e3 * 60 * 60) / (1e3 * 60)), p = Math.floor(h % (1e3 * 60) / 1e3);
|
|
147
|
+
i.innerHTML = u.toString(), n.innerHTML = m.toString(), o.innerHTML = f.toString(), r.innerHTML = p.toString();
|
|
148
148
|
}
|
|
149
149
|
}, 1e3);
|
|
150
150
|
}
|
|
@@ -165,53 +165,53 @@ const Rt = () => /Android/i.test(navigator.userAgent), Bt = typeof window < "u"
|
|
|
165
165
|
".c-map-districts-container__unzoom-button"
|
|
166
166
|
);
|
|
167
167
|
let o = t;
|
|
168
|
-
const r = t.getAttribute("viewBox"), a = (f,
|
|
168
|
+
const r = t.getAttribute("viewBox"), a = (f, p) => f.matches?.call(f, p), l = (f, p, y = ".c-map-districts__zoomable:not(.js-selected-area)") => {
|
|
169
169
|
if (!f)
|
|
170
170
|
return;
|
|
171
171
|
let S, L = f.parentElement;
|
|
172
|
-
for (; L instanceof SVGGraphicsElement && L !==
|
|
173
|
-
a(L,
|
|
172
|
+
for (; L instanceof SVGGraphicsElement && L !== p; )
|
|
173
|
+
a(L, y) && (S = L), L = L.parentElement;
|
|
174
174
|
return S;
|
|
175
|
-
}, c = (f,
|
|
175
|
+
}, c = (f, p, y) => {
|
|
176
176
|
if (!f)
|
|
177
177
|
return;
|
|
178
178
|
let S = f.parentElement;
|
|
179
|
-
for (; S instanceof SVGGraphicsElement && S !==
|
|
180
|
-
if (
|
|
179
|
+
for (; S instanceof SVGGraphicsElement && S !== y; ) {
|
|
180
|
+
if (p === S)
|
|
181
181
|
return !0;
|
|
182
182
|
S = S.parentElement;
|
|
183
183
|
}
|
|
184
|
-
return
|
|
185
|
-
}, d = (f,
|
|
186
|
-
if (
|
|
187
|
-
s.classList.remove("c-map-districts-container--department-view"), e.classList.remove("u-hidden"), i?.classList.add("u-hidden"), n.classList.add("u-hidden"),
|
|
188
|
-
const
|
|
189
|
-
i &&
|
|
184
|
+
return y === p;
|
|
185
|
+
}, d = (f, p) => {
|
|
186
|
+
if (p && n && e) {
|
|
187
|
+
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 = f;
|
|
188
|
+
const y = o.getAttribute("data-info");
|
|
189
|
+
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);
|
|
190
190
|
}
|
|
191
191
|
}, h = (f) => {
|
|
192
192
|
f.stopPropagation();
|
|
193
|
-
const
|
|
194
|
-
if (o && t &&
|
|
195
|
-
if (
|
|
193
|
+
const p = f.currentTarget;
|
|
194
|
+
if (o && t && p instanceof SVGGraphicsElement) {
|
|
195
|
+
if (p === o)
|
|
196
196
|
return;
|
|
197
|
-
if (f.preventDefault(), o !== t && !c(
|
|
197
|
+
if (f.preventDefault(), o !== t && !c(p, o, t)) {
|
|
198
198
|
d(t, r);
|
|
199
199
|
return;
|
|
200
200
|
}
|
|
201
|
-
const
|
|
202
|
-
|
|
201
|
+
const y = l(
|
|
202
|
+
p,
|
|
203
203
|
o
|
|
204
204
|
);
|
|
205
205
|
d(
|
|
206
|
-
|
|
207
|
-
jt(
|
|
206
|
+
y || p,
|
|
207
|
+
jt(y || p)
|
|
208
208
|
);
|
|
209
209
|
}
|
|
210
210
|
}, u = () => {
|
|
211
211
|
t && o !== t && d(t, r);
|
|
212
212
|
};
|
|
213
213
|
t.addEventListener("click", u), n && n.addEventListener("click", u), document.querySelectorAll(".c-map-districts__zoomable").forEach((f) => {
|
|
214
|
-
f.addEventListener("click", (
|
|
214
|
+
f.addEventListener("click", (p) => h(p));
|
|
215
215
|
});
|
|
216
216
|
}, Ut = () => {
|
|
217
217
|
const s = document.getElementById("elections-form-search"), t = document.querySelector(".c-search-form__autocomplete");
|
|
@@ -314,15 +314,15 @@ const Rt = () => /Android/i.test(navigator.userAgent), Bt = typeof window < "u"
|
|
|
314
314
|
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");
|
|
315
315
|
let o = 0, r = null, a = !1;
|
|
316
316
|
const l = () => {
|
|
317
|
-
n.forEach((g,
|
|
318
|
-
g.classList.toggle("c-image-slider__indicator--is-active",
|
|
317
|
+
n.forEach((g, _) => {
|
|
318
|
+
g.classList.toggle("c-image-slider__indicator--is-active", _ === o);
|
|
319
319
|
});
|
|
320
320
|
}, c = (g = !0) => {
|
|
321
321
|
if (!(s instanceof HTMLElement))
|
|
322
322
|
return;
|
|
323
323
|
s.style.transition = g ? "transform 0.3s ease" : "none";
|
|
324
|
-
const
|
|
325
|
-
s.style.transform = `translateX(${
|
|
324
|
+
const _ = -o * 100;
|
|
325
|
+
s.style.transform = `translateX(${_}%)`, l();
|
|
326
326
|
}, d = (g) => {
|
|
327
327
|
o = g, c(!0);
|
|
328
328
|
}, h = () => {
|
|
@@ -334,38 +334,38 @@ const Rt = () => /Android/i.test(navigator.userAgent), Bt = typeof window < "u"
|
|
|
334
334
|
}, 4e3);
|
|
335
335
|
}, u = () => {
|
|
336
336
|
r && (clearInterval(r), r = null);
|
|
337
|
-
},
|
|
337
|
+
}, m = () => {
|
|
338
338
|
a = !0, u();
|
|
339
339
|
}, f = () => {
|
|
340
340
|
a = !1, h();
|
|
341
341
|
};
|
|
342
342
|
e?.addEventListener("click", () => {
|
|
343
|
-
|
|
343
|
+
m();
|
|
344
344
|
const g = (o - 1 + t.length) % t.length;
|
|
345
345
|
d(g), setTimeout(f, 5e3);
|
|
346
346
|
}), i?.addEventListener("click", () => {
|
|
347
|
-
|
|
347
|
+
m();
|
|
348
348
|
const g = (o + 1) % t.length;
|
|
349
349
|
d(g), setTimeout(f, 5e3);
|
|
350
|
-
}), n.forEach((g,
|
|
350
|
+
}), n.forEach((g, _) => {
|
|
351
351
|
g.addEventListener("click", () => {
|
|
352
|
-
|
|
352
|
+
m(), d(_), setTimeout(f, 5e3);
|
|
353
353
|
});
|
|
354
354
|
});
|
|
355
|
-
let
|
|
355
|
+
let p = 0, y = 0, S = !1;
|
|
356
356
|
return s.addEventListener("touchstart", (g) => {
|
|
357
|
-
s instanceof HTMLElement && (
|
|
357
|
+
s instanceof HTMLElement && (m(), p = g.touches[0].clientX, y = p, S = !0, s.style.transition = "none");
|
|
358
358
|
}), s.addEventListener("touchmove", (g) => {
|
|
359
359
|
if (!(s instanceof HTMLElement))
|
|
360
360
|
return;
|
|
361
|
-
|
|
362
|
-
const
|
|
361
|
+
y = g.touches[0].clientX;
|
|
362
|
+
const _ = y - p, w = -o * window.innerWidth + _;
|
|
363
363
|
s.style.transform = `translateX(${w}px)`;
|
|
364
364
|
}), s.addEventListener("touchend", () => {
|
|
365
365
|
if (!S)
|
|
366
366
|
return;
|
|
367
367
|
S = !1;
|
|
368
|
-
const g =
|
|
368
|
+
const g = y - p;
|
|
369
369
|
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(f, 5e3);
|
|
370
370
|
}), c(!0), h(), () => {
|
|
371
371
|
u();
|
|
@@ -461,7 +461,7 @@ function pe(s, t) {
|
|
|
461
461
|
const n = R();
|
|
462
462
|
t.shiftKey && n === e ? (i.focus(), t.preventDefault()) : !t.shiftKey && n === i && (e.focus(), t.preventDefault());
|
|
463
463
|
}
|
|
464
|
-
function
|
|
464
|
+
function I(s, t) {
|
|
465
465
|
function e(i) {
|
|
466
466
|
if (!i || i === document || i === window)
|
|
467
467
|
return null;
|
|
@@ -473,7 +473,7 @@ function T(s, t) {
|
|
|
473
473
|
function wt(s) {
|
|
474
474
|
return s.assignedSlot || (s.parentNode ? wt(s.parentNode) : null);
|
|
475
475
|
}
|
|
476
|
-
const
|
|
476
|
+
const T = "data-a11y-dialog";
|
|
477
477
|
class bt {
|
|
478
478
|
$el;
|
|
479
479
|
id;
|
|
@@ -497,7 +497,7 @@ class bt {
|
|
|
497
497
|
* `[data-a11y-dialog-show="<id>"]` and `[data-a11y-dialog-hide="<id>"]`.
|
|
498
498
|
*/
|
|
499
499
|
constructor(t) {
|
|
500
|
-
this.$el = t, this.id = this.$el.getAttribute(
|
|
500
|
+
this.$el = t, this.id = this.$el.getAttribute(T) || 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);
|
|
501
501
|
}
|
|
502
502
|
/**
|
|
503
503
|
* Destroy the current instance (after making sure the dialog has been hidden)
|
|
@@ -571,7 +571,7 @@ class bt {
|
|
|
571
571
|
* dialog are clicked, and call `show` or `hide`, respectively
|
|
572
572
|
*/
|
|
573
573
|
handleTriggerClicks(t) {
|
|
574
|
-
const e = t.composedPath()[0], i =
|
|
574
|
+
const e = t.composedPath()[0], i = I(`[${T}-show="${this.id}"]`, e), n = I(`[${T}-hide="${this.id}"]`, e), o = I(`[${T}-hide]`, e) && I('[aria-modal="true"]', e) === this.$el;
|
|
575
575
|
i && this.show(t), (n || o) && this.hide(t);
|
|
576
576
|
}
|
|
577
577
|
/**
|
|
@@ -579,7 +579,7 @@ class bt {
|
|
|
579
579
|
* (namely ESC and TAB)
|
|
580
580
|
*/
|
|
581
581
|
bindKeypress(t) {
|
|
582
|
-
if (
|
|
582
|
+
if (I('[aria-modal="true"]', R()) !== this.$el)
|
|
583
583
|
return;
|
|
584
584
|
let e = !1;
|
|
585
585
|
try {
|
|
@@ -596,7 +596,7 @@ class bt {
|
|
|
596
596
|
*/
|
|
597
597
|
maintainFocus() {
|
|
598
598
|
const t = R();
|
|
599
|
-
|
|
599
|
+
I(`[aria-modal="true"], [${T}-ignore-focus-trap]`, t) || et(this.$el);
|
|
600
600
|
}
|
|
601
601
|
}
|
|
602
602
|
function ot() {
|
|
@@ -787,13 +787,13 @@ const me = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
787
787
|
), e === "true") {
|
|
788
788
|
const h = r ? r.querySelector(".c-stepper__item--loading") : null;
|
|
789
789
|
a && (a.forEach((u) => {
|
|
790
|
-
const
|
|
791
|
-
|
|
790
|
+
const m = u.querySelector(".c-stepper__loader");
|
|
791
|
+
m && m instanceof HTMLElement && (m.style.transition = `width ${n / 1e3}s linear`);
|
|
792
792
|
}), h || a[0].classList.add("c-stepper__item--loading")), setInterval(() => {
|
|
793
793
|
c.classList.contains("o-nav-button--visible") ? c.click() : l && d && (l.scrollLeft = 0, a && (a.forEach((u) => {
|
|
794
|
-
const
|
|
795
|
-
|
|
796
|
-
|
|
794
|
+
const m = u.querySelector(".c-stepper__loader");
|
|
795
|
+
m && m instanceof HTMLElement && (m.style.transition = "width 0s linear"), u.classList.remove("c-stepper__item--loading"), u.classList.remove("c-stepper__item--loaded"), setTimeout(() => {
|
|
796
|
+
m && m instanceof HTMLElement && (m.style.transition = `width ${n / 1e3}s linear`);
|
|
797
797
|
}, 0);
|
|
798
798
|
}), setTimeout(() => {
|
|
799
799
|
a[0].classList.add("c-stepper__item--loading");
|
|
@@ -1069,7 +1069,7 @@ class Pe {
|
|
|
1069
1069
|
}
|
|
1070
1070
|
}
|
|
1071
1071
|
const at = 4e3;
|
|
1072
|
-
let
|
|
1072
|
+
let It = class {
|
|
1073
1073
|
/**
|
|
1074
1074
|
* @param {PhotoSwipeOptions} options PhotoSwipe options
|
|
1075
1075
|
* @param {SlideData} itemData Slide data
|
|
@@ -1149,7 +1149,7 @@ let Tt = class {
|
|
|
1149
1149
|
return this._parseZoomLevelOption("max") || Math.max(1, this.fit * 4);
|
|
1150
1150
|
}
|
|
1151
1151
|
};
|
|
1152
|
-
class
|
|
1152
|
+
class Ie {
|
|
1153
1153
|
/**
|
|
1154
1154
|
* @param {SlideData} data
|
|
1155
1155
|
* @param {number} index
|
|
@@ -1162,7 +1162,7 @@ class Te {
|
|
|
1162
1162
|
}, this.pan = {
|
|
1163
1163
|
x: 0,
|
|
1164
1164
|
y: 0
|
|
1165
|
-
}, this.isFirstSlide = this.isActive && !i.opener.isOpen, this.zoomLevels = new
|
|
1165
|
+
}, this.isFirstSlide = this.isActive && !i.opener.isOpen, this.zoomLevels = new It(i.options, t, e, i), this.pswp.dispatch("gettingData", {
|
|
1166
1166
|
slide: this,
|
|
1167
1167
|
data: this.data,
|
|
1168
1168
|
index: e
|
|
@@ -1419,11 +1419,11 @@ class Te {
|
|
|
1419
1419
|
t !== this.currentResolution && (this.currentResolution = t, this.updateContentSize(), this.pswp.dispatch("resolutionChanged"));
|
|
1420
1420
|
}
|
|
1421
1421
|
}
|
|
1422
|
-
const
|
|
1422
|
+
const Te = 0.35, ze = 0.6, lt = 0.4, ct = 0.5;
|
|
1423
1423
|
function Me(s, t) {
|
|
1424
1424
|
return s * t / (1 - t);
|
|
1425
1425
|
}
|
|
1426
|
-
class
|
|
1426
|
+
class Oe {
|
|
1427
1427
|
/**
|
|
1428
1428
|
* @param {Gestures} gestures
|
|
1429
1429
|
*/
|
|
@@ -1487,8 +1487,8 @@ class De {
|
|
|
1487
1487
|
bounds: o
|
|
1488
1488
|
} = i, r = n[t], a = this.pswp.bgOpacity < 1 && t === "y", c = r + Me(e[t], 0.995);
|
|
1489
1489
|
if (a) {
|
|
1490
|
-
const f = this._getVerticalDragRatio(r),
|
|
1491
|
-
if (f < 0 &&
|
|
1490
|
+
const f = this._getVerticalDragRatio(r), p = this._getVerticalDragRatio(c);
|
|
1491
|
+
if (f < 0 && p < -lt || f > 0 && p > lt) {
|
|
1492
1492
|
this.pswp.close();
|
|
1493
1493
|
return;
|
|
1494
1494
|
}
|
|
@@ -1496,7 +1496,7 @@ class De {
|
|
|
1496
1496
|
const d = o.correctPan(t, c);
|
|
1497
1497
|
if (r === d)
|
|
1498
1498
|
return;
|
|
1499
|
-
const h = d === c ? 1 : 0.82, u = this.pswp.bgOpacity,
|
|
1499
|
+
const h = d === c ? 1 : 0.82, u = this.pswp.bgOpacity, m = d - r;
|
|
1500
1500
|
this.pswp.animations.startSpring({
|
|
1501
1501
|
name: "panGesture" + t,
|
|
1502
1502
|
isPan: !0,
|
|
@@ -1506,8 +1506,8 @@ class De {
|
|
|
1506
1506
|
dampingRatio: h,
|
|
1507
1507
|
onUpdate: (f) => {
|
|
1508
1508
|
if (a && this.pswp.bgOpacity < 1) {
|
|
1509
|
-
const
|
|
1510
|
-
this.pswp.applyBgOpacity(Z(u + (1 - u) *
|
|
1509
|
+
const p = 1 - (d - f) / m;
|
|
1510
|
+
this.pswp.applyBgOpacity(Z(u + (1 - u) * p, 0, 1));
|
|
1511
1511
|
}
|
|
1512
1512
|
n[t] = Math.floor(f), i.applyCurrentZoomPan();
|
|
1513
1513
|
}
|
|
@@ -1541,19 +1541,19 @@ class De {
|
|
|
1541
1541
|
bounds: d
|
|
1542
1542
|
} = r, h = r.pan[t] + l;
|
|
1543
1543
|
if (this.pswp.options.allowPanToNext && i === "x" && t === "x" && !o) {
|
|
1544
|
-
const u = a.getCurrSlideX(),
|
|
1544
|
+
const u = a.getCurrSlideX(), m = a.x - u, f = l > 0, p = !f;
|
|
1545
1545
|
if (h > d.min[t] && f) {
|
|
1546
1546
|
if (d.min[t] <= this.startPan[t])
|
|
1547
1547
|
return a.moveTo(c, !0), !0;
|
|
1548
1548
|
this._setPanWithFriction(t, h);
|
|
1549
|
-
} else if (h < d.max[t] &&
|
|
1549
|
+
} else if (h < d.max[t] && p) {
|
|
1550
1550
|
if (this.startPan[t] <= d.max[t])
|
|
1551
1551
|
return a.moveTo(c, !0), !0;
|
|
1552
1552
|
this._setPanWithFriction(t, h);
|
|
1553
|
-
} else if (
|
|
1554
|
-
if (
|
|
1553
|
+
} else if (m !== 0) {
|
|
1554
|
+
if (m > 0)
|
|
1555
1555
|
return a.moveTo(Math.max(c, u), !0), !0;
|
|
1556
|
-
if (
|
|
1556
|
+
if (m < 0)
|
|
1557
1557
|
return a.moveTo(Math.min(c, u), !0), !0;
|
|
1558
1558
|
} else
|
|
1559
1559
|
this._setPanWithFriction(t, h);
|
|
@@ -1600,12 +1600,12 @@ class De {
|
|
|
1600
1600
|
} = n;
|
|
1601
1601
|
if (r.correctPan(t, e) !== e || i) {
|
|
1602
1602
|
const l = Math.round(e - o[t]);
|
|
1603
|
-
o[t] += l * (i ||
|
|
1603
|
+
o[t] += l * (i || Te);
|
|
1604
1604
|
} else
|
|
1605
1605
|
o[t] = e;
|
|
1606
1606
|
}
|
|
1607
1607
|
}
|
|
1608
|
-
const
|
|
1608
|
+
const De = 0.05, $e = 0.15;
|
|
1609
1609
|
function dt(s, t, e) {
|
|
1610
1610
|
return s.x = (t.x + e.x) / 2, s.y = (t.y + e.y) / 2, s;
|
|
1611
1611
|
}
|
|
@@ -1656,7 +1656,7 @@ class Re {
|
|
|
1656
1656
|
}).defaultPrevented || o.applyBgOpacity(d);
|
|
1657
1657
|
} else
|
|
1658
1658
|
c = a - (a - c) * $e;
|
|
1659
|
-
else c > l && (c = l + (c - l) *
|
|
1659
|
+
else c > l && (c = l + (c - l) * De);
|
|
1660
1660
|
r.pan.x = this._calculatePanForZoomLevel("x", c), r.pan.y = this._calculatePanForZoomLevel("y", c), r.setZoomLevel(c), r.applyCurrentZoomPan();
|
|
1661
1661
|
}
|
|
1662
1662
|
end() {
|
|
@@ -1727,8 +1727,8 @@ class Re {
|
|
|
1727
1727
|
onUpdate: (u) => {
|
|
1728
1728
|
if (u /= 1e3, h || r) {
|
|
1729
1729
|
if (h && (i.pan.x = c.x + (d.x - c.x) * u, i.pan.y = c.y + (d.y - c.y) * u), r) {
|
|
1730
|
-
const
|
|
1731
|
-
i.setZoomLevel(
|
|
1730
|
+
const m = n + (o - n) * u;
|
|
1731
|
+
i.setZoomLevel(m);
|
|
1732
1732
|
}
|
|
1733
1733
|
i.applyCurrentZoomPan();
|
|
1734
1734
|
}
|
|
@@ -1818,8 +1818,8 @@ class Be {
|
|
|
1818
1818
|
}
|
|
1819
1819
|
}
|
|
1820
1820
|
}
|
|
1821
|
-
const Fe = 10, Ze = 300,
|
|
1822
|
-
class
|
|
1821
|
+
const Fe = 10, Ze = 300, qe = 25;
|
|
1822
|
+
class ke {
|
|
1823
1823
|
/**
|
|
1824
1824
|
* @param {PhotoSwipe} pswp
|
|
1825
1825
|
*/
|
|
@@ -1851,7 +1851,7 @@ class qe {
|
|
|
1851
1851
|
}, this._intervalP1 = {
|
|
1852
1852
|
x: 0,
|
|
1853
1853
|
y: 0
|
|
1854
|
-
}, this._numActivePoints = 0, this._ongoingPointers = [], this._touchEventEnabled = "ontouchstart" in window, this._pointerEventEnabled = !!window.PointerEvent, this.supportsTouch = this._touchEventEnabled || this._pointerEventEnabled && navigator.maxTouchPoints > 1, this._numActivePoints = 0, this._intervalTime = 0, this._velocityCalculated = !1, this.isMultitouch = !1, this.isDragging = !1, this.isZooming = !1, this.raf = null, this._tapTimer = null, this.supportsTouch || (t.options.allowPanToNext = !1), this.drag = new
|
|
1854
|
+
}, this._numActivePoints = 0, this._ongoingPointers = [], this._touchEventEnabled = "ontouchstart" in window, this._pointerEventEnabled = !!window.PointerEvent, this.supportsTouch = this._touchEventEnabled || this._pointerEventEnabled && navigator.maxTouchPoints > 1, this._numActivePoints = 0, this._intervalTime = 0, this._velocityCalculated = !1, this.isMultitouch = !1, this.isDragging = !1, this.isZooming = !1, this.raf = null, this._tapTimer = null, this.supportsTouch || (t.options.allowPanToNext = !1), this.drag = new Oe(this), this.zoomLevels = new Re(this), this.tapHandler = new Be(this), t.on("bindEvents", () => {
|
|
1855
1855
|
t.events.add(
|
|
1856
1856
|
t.scrollWrap,
|
|
1857
1857
|
"click",
|
|
@@ -1972,7 +1972,7 @@ class qe {
|
|
|
1972
1972
|
return;
|
|
1973
1973
|
}
|
|
1974
1974
|
const i = this.pswp.options.doubleTapAction ? Ze : 0;
|
|
1975
|
-
this._tapTimer ? (this._clearTapTimer(), G(this._lastStartP1, this.startP1) <
|
|
1975
|
+
this._tapTimer ? (this._clearTapTimer(), G(this._lastStartP1, this.startP1) < qe && this.tapHandler.doubleTap(this.startP1, t)) : (b(this._lastStartP1, this.startP1), this._tapTimer = setTimeout(() => {
|
|
1976
1976
|
this.tapHandler.tap(this.startP1, t), this._clearTapTimer();
|
|
1977
1977
|
}, i));
|
|
1978
1978
|
}
|
|
@@ -2452,10 +2452,10 @@ class Ye {
|
|
|
2452
2452
|
this.onFinish = a;
|
|
2453
2453
|
const d = new Xe(n, l, c);
|
|
2454
2454
|
let h = Date.now(), u = e - i;
|
|
2455
|
-
const
|
|
2456
|
-
this._raf && (u = d.easeFrame(u, Date.now() - h), Math.abs(u) < 1 && Math.abs(d.velocity) < 50 ? (o(i), r && r(), this.onFinish()) : (h = Date.now(), o(u + i), this._raf = requestAnimationFrame(
|
|
2455
|
+
const m = () => {
|
|
2456
|
+
this._raf && (u = d.easeFrame(u, Date.now() - h), Math.abs(u) < 1 && Math.abs(d.velocity) < 50 ? (o(i), r && r(), this.onFinish()) : (h = Date.now(), o(u + i), this._raf = requestAnimationFrame(m)));
|
|
2457
2457
|
};
|
|
2458
|
-
this._raf = requestAnimationFrame(
|
|
2458
|
+
this._raf = requestAnimationFrame(m);
|
|
2459
2459
|
}
|
|
2460
2460
|
// Destroy is called automatically onFinish
|
|
2461
2461
|
destroy() {
|
|
@@ -2614,8 +2614,8 @@ class ei {
|
|
|
2614
2614
|
ariaLabel: u
|
|
2615
2615
|
} = e;
|
|
2616
2616
|
typeof t.options[n + "Title"] == "string" && (h = t.options[n + "Title"]), h && (l.title = h);
|
|
2617
|
-
const
|
|
2618
|
-
|
|
2617
|
+
const m = u || h;
|
|
2618
|
+
m && l.setAttribute("aria-label", m);
|
|
2619
2619
|
}
|
|
2620
2620
|
l.innerHTML = ti(o), e.onInit && e.onInit(l, t), e.onClick && (l.onclick = (h) => {
|
|
2621
2621
|
typeof e.onClick == "string" ? t[e.onClick]() : typeof e.onClick == "function" && e.onClick(h, l, t);
|
|
@@ -2625,7 +2625,7 @@ class ei {
|
|
|
2625
2625
|
c === "bar" ? (t.topBar || (t.topBar = A("pswp__top-bar pswp__hide-on-close", "div", t.scrollWrap)), d = t.topBar) : (l.classList.add("pswp__hide-on-close"), c === "wrapper" && (d = t.scrollWrap)), (i = d) === null || i === void 0 || i.appendChild(t.applyFilters("uiElement", l, e));
|
|
2626
2626
|
}
|
|
2627
2627
|
}
|
|
2628
|
-
function
|
|
2628
|
+
function Tt(s, t, e) {
|
|
2629
2629
|
s.classList.add("pswp__button--arrow"), s.setAttribute("aria-controls", "pswp__items"), t.on("change", () => {
|
|
2630
2630
|
t.options.loop || (e ? s.disabled = !(t.currIndex < t.getNumItems() - 1) : s.disabled = !(t.currIndex > 0));
|
|
2631
2631
|
});
|
|
@@ -2644,7 +2644,7 @@ const ii = {
|
|
|
2644
2644
|
outlineID: "pswp__icn-arrow"
|
|
2645
2645
|
},
|
|
2646
2646
|
onClick: "prev",
|
|
2647
|
-
onInit:
|
|
2647
|
+
onInit: Tt
|
|
2648
2648
|
}, si = {
|
|
2649
2649
|
name: "arrowNext",
|
|
2650
2650
|
className: "pswp__button--arrow--next",
|
|
@@ -2660,7 +2660,7 @@ const ii = {
|
|
|
2660
2660
|
},
|
|
2661
2661
|
onClick: "next",
|
|
2662
2662
|
onInit: (s, t) => {
|
|
2663
|
-
|
|
2663
|
+
Tt(s, t, !0);
|
|
2664
2664
|
}
|
|
2665
2665
|
}, ni = {
|
|
2666
2666
|
name: "close",
|
|
@@ -3188,7 +3188,7 @@ function zt(s, t, e) {
|
|
|
3188
3188
|
options: o
|
|
3189
3189
|
} = t;
|
|
3190
3190
|
if (o) {
|
|
3191
|
-
n = new
|
|
3191
|
+
n = new It(o, s, -1);
|
|
3192
3192
|
let r;
|
|
3193
3193
|
t.pswp ? r = t.pswp.viewportSize : r = Ct(o, t);
|
|
3194
3194
|
const a = Pt(o, r, s, e);
|
|
@@ -3556,7 +3556,7 @@ class Si extends _i {
|
|
|
3556
3556
|
}, this.viewportSize = {
|
|
3557
3557
|
x: 0,
|
|
3558
3558
|
y: 0
|
|
3559
|
-
}, this.bgOpacity = 1, this.currIndex = 0, this.potentialIndex = 0, this.isOpen = !1, this.isDestroying = !1, this.hasMouse = !1, this._initialItemData = {}, this._initialThumbBounds = void 0, this.topBar = void 0, this.element = void 0, this.template = void 0, this.container = void 0, this.scrollWrap = void 0, this.currSlide = void 0, this.events = new Ce(), this.animations = new Je(), this.mainScroll = new He(this), this.gestures = new
|
|
3559
|
+
}, this.bgOpacity = 1, this.currIndex = 0, this.potentialIndex = 0, this.isOpen = !1, this.isDestroying = !1, this.hasMouse = !1, this._initialItemData = {}, this._initialThumbBounds = void 0, this.topBar = void 0, this.element = void 0, this.template = void 0, this.container = void 0, this.scrollWrap = void 0, this.currSlide = void 0, this.events = new Ce(), this.animations = new Je(), this.mainScroll = new He(this), this.gestures = new ke(this), this.opener = new wi(this), this.keyboard = new Ve(this), this.contentLoader = new yi(this);
|
|
3560
3560
|
}
|
|
3561
3561
|
/** @returns {boolean} */
|
|
3562
3562
|
init() {
|
|
@@ -3683,7 +3683,7 @@ class Si extends _i {
|
|
|
3683
3683
|
if (!this.canLoop() && (e < 0 || e >= this.getNumItems()))
|
|
3684
3684
|
return;
|
|
3685
3685
|
const n = this.getItemData(e);
|
|
3686
|
-
t.slide = new
|
|
3686
|
+
t.slide = new Ie(n, e, this), e === this.currIndex && (this.currSlide = t.slide), t.slide.append(t.el);
|
|
3687
3687
|
}
|
|
3688
3688
|
/** @returns {Point} */
|
|
3689
3689
|
getViewportCenterPoint() {
|
|
@@ -3785,7 +3785,7 @@ class Si extends _i {
|
|
|
3785
3785
|
};
|
|
3786
3786
|
}
|
|
3787
3787
|
}
|
|
3788
|
-
function
|
|
3788
|
+
function O(s, t, e) {
|
|
3789
3789
|
const i = document.createElement(t);
|
|
3790
3790
|
return s && (i.className = s), e && e.appendChild(i), i;
|
|
3791
3791
|
}
|
|
@@ -3805,7 +3805,7 @@ const x = {
|
|
|
3805
3805
|
function Ai(s) {
|
|
3806
3806
|
return "button" in s && s.button === 1 || s.ctrlKey || s.metaKey || s.altKey || s.shiftKey;
|
|
3807
3807
|
}
|
|
3808
|
-
function
|
|
3808
|
+
function D(s, t, e = document) {
|
|
3809
3809
|
let i = [];
|
|
3810
3810
|
if (s instanceof Element)
|
|
3811
3811
|
i = [s];
|
|
@@ -3915,7 +3915,7 @@ class Pi {
|
|
|
3915
3915
|
* @param {HTMLElement} container
|
|
3916
3916
|
*/
|
|
3917
3917
|
constructor(t, e) {
|
|
3918
|
-
if (this.element =
|
|
3918
|
+
if (this.element = O("pswp__img pswp__img--placeholder", t ? "img" : "div", e), t) {
|
|
3919
3919
|
const i = (
|
|
3920
3920
|
/** @type {HTMLImageElement} */
|
|
3921
3921
|
this.element
|
|
@@ -3936,7 +3936,7 @@ class Pi {
|
|
|
3936
3936
|
(t = this.element) !== null && t !== void 0 && t.parentNode && this.element.remove(), this.element = null;
|
|
3937
3937
|
}
|
|
3938
3938
|
}
|
|
3939
|
-
class
|
|
3939
|
+
class Ii {
|
|
3940
3940
|
/**
|
|
3941
3941
|
* @param {SlideData} itemData Slide data
|
|
3942
3942
|
* @param {PhotoSwipeBase} instance PhotoSwipe or PhotoSwipeLightbox instance
|
|
@@ -3976,7 +3976,7 @@ class Ti {
|
|
|
3976
3976
|
this.element && !e || this.instance.dispatch("contentLoad", {
|
|
3977
3977
|
content: this,
|
|
3978
3978
|
isLazy: t
|
|
3979
|
-
}).defaultPrevented || (this.isImageContent() ? (this.element =
|
|
3979
|
+
}).defaultPrevented || (this.isImageContent() ? (this.element = O("pswp__img", "img"), this.displayedImageWidth && this.loadImage(t)) : (this.element = O("pswp__content", "div"), this.element.innerHTML = this.data.html || ""), e && this.slide && this.slide.updateContentSize(!0));
|
|
3980
3980
|
}
|
|
3981
3981
|
/**
|
|
3982
3982
|
* Preload image
|
|
@@ -4121,9 +4121,9 @@ class Ti {
|
|
|
4121
4121
|
displayError() {
|
|
4122
4122
|
if (this.slide) {
|
|
4123
4123
|
var t, e;
|
|
4124
|
-
let i =
|
|
4124
|
+
let i = O("pswp__error-msg", "div");
|
|
4125
4125
|
i.innerText = (t = (e = this.instance.options) === null || e === void 0 ? void 0 : e.errorMsg) !== null && t !== void 0 ? t : "", i = /** @type {HTMLDivElement} */
|
|
4126
|
-
this.instance.applyFilters("contentErrorElement", i, this), this.element =
|
|
4126
|
+
this.instance.applyFilters("contentErrorElement", i, this), this.element = O("pswp__content pswp__error-msg-container", "div"), this.element.appendChild(i), this.slide.container.innerText = "", this.slide.container.appendChild(this.element), this.slide.updateContentSize(!0), this.removePlaceholder();
|
|
4127
4127
|
}
|
|
4128
4128
|
}
|
|
4129
4129
|
/**
|
|
@@ -4181,7 +4181,7 @@ class Ti {
|
|
|
4181
4181
|
}).defaultPrevented || (this.slide && this.element && !this.element.parentNode && this.slide.container.appendChild(this.element), (this.state === x.LOADED || this.state === x.ERROR) && this.removePlaceholder()));
|
|
4182
4182
|
}
|
|
4183
4183
|
}
|
|
4184
|
-
function
|
|
4184
|
+
function Ti(s, t) {
|
|
4185
4185
|
if (s.getViewportSizeFn) {
|
|
4186
4186
|
const e = s.getViewportSizeFn(s, t);
|
|
4187
4187
|
if (e)
|
|
@@ -4196,7 +4196,7 @@ function Ii(s, t) {
|
|
|
4196
4196
|
y: window.innerHeight
|
|
4197
4197
|
};
|
|
4198
4198
|
}
|
|
4199
|
-
function
|
|
4199
|
+
function k(s, t, e, i, n) {
|
|
4200
4200
|
let o = 0;
|
|
4201
4201
|
if (t.paddingFn)
|
|
4202
4202
|
o = t.paddingFn(e, i, n)[s];
|
|
@@ -4210,8 +4210,8 @@ function q(s, t, e, i, n) {
|
|
|
4210
4210
|
}
|
|
4211
4211
|
function zi(s, t, e, i) {
|
|
4212
4212
|
return {
|
|
4213
|
-
x: t.x -
|
|
4214
|
-
y: t.y -
|
|
4213
|
+
x: t.x - k("left", s, t, e, i) - k("right", s, t, e, i),
|
|
4214
|
+
y: t.y - k("top", s, t, e, i) - k("bottom", s, t, e, i)
|
|
4215
4215
|
};
|
|
4216
4216
|
}
|
|
4217
4217
|
const mt = 4e3;
|
|
@@ -4304,13 +4304,13 @@ function Mt(s, t, e) {
|
|
|
4304
4304
|
if (o) {
|
|
4305
4305
|
n = new Mi(o, s, -1);
|
|
4306
4306
|
let r;
|
|
4307
|
-
t.pswp ? r = t.pswp.viewportSize : r =
|
|
4307
|
+
t.pswp ? r = t.pswp.viewportSize : r = Ti(o, t);
|
|
4308
4308
|
const a = zi(o, r, s, e);
|
|
4309
4309
|
n.update(i.width, i.height, a);
|
|
4310
4310
|
}
|
|
4311
4311
|
return i.lazyLoad(), n && i.setDisplayedSize(Math.ceil(i.width * n.initial), Math.ceil(i.height * n.initial)), i;
|
|
4312
4312
|
}
|
|
4313
|
-
function
|
|
4313
|
+
function Oi(s, t) {
|
|
4314
4314
|
const e = t.getItemData(s);
|
|
4315
4315
|
if (!t.dispatch("lazyLoadSlide", {
|
|
4316
4316
|
index: s,
|
|
@@ -4318,7 +4318,7 @@ function Di(s, t) {
|
|
|
4318
4318
|
}).defaultPrevented)
|
|
4319
4319
|
return Mt(e, t, s);
|
|
4320
4320
|
}
|
|
4321
|
-
class
|
|
4321
|
+
class Di extends Ci {
|
|
4322
4322
|
/**
|
|
4323
4323
|
* Get total number of slides
|
|
4324
4324
|
*
|
|
@@ -4341,7 +4341,7 @@ class Oi extends Ci {
|
|
|
4341
4341
|
* @returns {Content}
|
|
4342
4342
|
*/
|
|
4343
4343
|
createContentFromData(t, e) {
|
|
4344
|
-
return new
|
|
4344
|
+
return new Ii(t, this, e);
|
|
4345
4345
|
}
|
|
4346
4346
|
/**
|
|
4347
4347
|
* Get item data by index.
|
|
@@ -4375,7 +4375,7 @@ class Oi extends Ci {
|
|
|
4375
4375
|
*/
|
|
4376
4376
|
_getGalleryDOMElements(t) {
|
|
4377
4377
|
var e, i;
|
|
4378
|
-
return (e = this.options) !== null && e !== void 0 && e.children || (i = this.options) !== null && i !== void 0 && i.childSelector ?
|
|
4378
|
+
return (e = this.options) !== null && e !== void 0 && e.children || (i = this.options) !== null && i !== void 0 && i.childSelector ? D(this.options.children, this.options.childSelector, t) || [] : [t];
|
|
4379
4379
|
}
|
|
4380
4380
|
/**
|
|
4381
4381
|
* Converts DOM element to item data object.
|
|
@@ -4412,7 +4412,7 @@ class Oi extends Ci {
|
|
|
4412
4412
|
return Mt(t, this, e);
|
|
4413
4413
|
}
|
|
4414
4414
|
}
|
|
4415
|
-
class $i extends
|
|
4415
|
+
class $i extends Di {
|
|
4416
4416
|
/**
|
|
4417
4417
|
* @param {PhotoSwipeOptions} [options]
|
|
4418
4418
|
*/
|
|
@@ -4424,7 +4424,7 @@ class $i extends Oi {
|
|
|
4424
4424
|
* It's not included in the main constructor, so you may bind events before it.
|
|
4425
4425
|
*/
|
|
4426
4426
|
init() {
|
|
4427
|
-
|
|
4427
|
+
D(this.options.gallery, this.options.gallerySelector).forEach((t) => {
|
|
4428
4428
|
t.addEventListener("click", this.onThumbnailsClick, !1);
|
|
4429
4429
|
});
|
|
4430
4430
|
}
|
|
@@ -4461,7 +4461,7 @@ class $i extends Oi {
|
|
|
4461
4461
|
const e = (
|
|
4462
4462
|
/** @type {HTMLElement} */
|
|
4463
4463
|
t.target
|
|
4464
|
-
), n =
|
|
4464
|
+
), n = D(
|
|
4465
4465
|
this.options.children,
|
|
4466
4466
|
this.options.childSelector,
|
|
4467
4467
|
/** @type {HTMLElement} */
|
|
@@ -4481,7 +4481,7 @@ class $i extends Oi {
|
|
|
4481
4481
|
if (window.pswp || !this.options)
|
|
4482
4482
|
return !1;
|
|
4483
4483
|
if (!e && this.options.gallery && this.options.children) {
|
|
4484
|
-
const n =
|
|
4484
|
+
const n = D(this.options.gallery);
|
|
4485
4485
|
n[0] && (e = {
|
|
4486
4486
|
gallery: n[0]
|
|
4487
4487
|
});
|
|
@@ -4516,7 +4516,7 @@ class $i extends Oi {
|
|
|
4516
4516
|
else
|
|
4517
4517
|
throw new Error("pswpModule is not valid");
|
|
4518
4518
|
}
|
|
4519
|
-
typeof i.openPromise == "function" && n.push(i.openPromise()), i.preloadFirstSlide !== !1 && t >= 0 && (this._preloadedContent =
|
|
4519
|
+
typeof i.openPromise == "function" && n.push(i.openPromise()), i.preloadFirstSlide !== !1 && t >= 0 && (this._preloadedContent = Oi(t, this));
|
|
4520
4520
|
const r = ++this._uid;
|
|
4521
4521
|
Promise.all(n).then((a) => {
|
|
4522
4522
|
if (this.shouldOpen) {
|
|
@@ -4557,7 +4557,7 @@ class $i extends Oi {
|
|
|
4557
4557
|
*/
|
|
4558
4558
|
destroy() {
|
|
4559
4559
|
var t;
|
|
4560
|
-
(t = this.pswp) === null || t === void 0 || t.destroy(), this.shouldOpen = !1, this._listeners = {},
|
|
4560
|
+
(t = this.pswp) === null || t === void 0 || t.destroy(), this.shouldOpen = !1, this._listeners = {}, D(this.options.gallery, this.options.gallerySelector).forEach((e) => {
|
|
4561
4561
|
e.removeEventListener("click", this.onThumbnailsClick, !1);
|
|
4562
4562
|
});
|
|
4563
4563
|
}
|
|
@@ -4624,7 +4624,58 @@ const Ri = () => {
|
|
|
4624
4624
|
});
|
|
4625
4625
|
};
|
|
4626
4626
|
window.addEventListener("scroll", r), i.addEventListener("click", a), r();
|
|
4627
|
-
},
|
|
4627
|
+
}, qi = 500, ki = () => {
|
|
4628
|
+
const s = document.querySelector("#mbrs-comments-container"), t = s?.querySelector(".c-comment__scroll-to-top-button");
|
|
4629
|
+
if (!s || !t)
|
|
4630
|
+
return;
|
|
4631
|
+
t.style.display = "none";
|
|
4632
|
+
let e = !1;
|
|
4633
|
+
const i = () => {
|
|
4634
|
+
const { top: u } = s.getBoundingClientRect();
|
|
4635
|
+
t.style.display = u < -400 ? "block" : "none";
|
|
4636
|
+
}, n = () => {
|
|
4637
|
+
e || (e = !0, window.addEventListener("scroll", i, { passive: !0 }), i());
|
|
4638
|
+
}, o = () => {
|
|
4639
|
+
e && (e = !1, window.removeEventListener("scroll", i), t.style.display = "none");
|
|
4640
|
+
}, r = (u) => {
|
|
4641
|
+
u.offsetHeight > qi ? n() : o();
|
|
4642
|
+
}, a = (u) => {
|
|
4643
|
+
new ResizeObserver(() => {
|
|
4644
|
+
r(u);
|
|
4645
|
+
}).observe(u);
|
|
4646
|
+
}, l = (u) => {
|
|
4647
|
+
r(u), a(u);
|
|
4648
|
+
}, c = (u) => {
|
|
4649
|
+
try {
|
|
4650
|
+
if (u.contentDocument?.readyState === "complete") {
|
|
4651
|
+
l(u);
|
|
4652
|
+
return;
|
|
4653
|
+
}
|
|
4654
|
+
} catch {
|
|
4655
|
+
}
|
|
4656
|
+
u.addEventListener("load", () => l(u), { once: !0 });
|
|
4657
|
+
};
|
|
4658
|
+
if ((() => {
|
|
4659
|
+
const u = s.querySelector("iframe");
|
|
4660
|
+
return u ? (c(u), !0) : !1;
|
|
4661
|
+
})())
|
|
4662
|
+
return;
|
|
4663
|
+
const h = new MutationObserver((u) => {
|
|
4664
|
+
u.some(
|
|
4665
|
+
(f) => Array.from(f.addedNodes).some((p) => {
|
|
4666
|
+
if (p instanceof HTMLIFrameElement)
|
|
4667
|
+
return c(p), !0;
|
|
4668
|
+
if (p instanceof HTMLElement) {
|
|
4669
|
+
const y = p.querySelector("iframe");
|
|
4670
|
+
if (y)
|
|
4671
|
+
return c(y), !0;
|
|
4672
|
+
}
|
|
4673
|
+
return !1;
|
|
4674
|
+
})
|
|
4675
|
+
) && h.disconnect();
|
|
4676
|
+
});
|
|
4677
|
+
h.observe(s, { childList: !0, subtree: !0 });
|
|
4678
|
+
}, j = "#page-content", X = "#text-tooltip", Ni = ".tooltip-btn", Ot = "c-text-tooltip--show", Hi = [
|
|
4628
4679
|
"#page-content .c-content p",
|
|
4629
4680
|
"#page-content .c-content h2",
|
|
4630
4681
|
"#page-content .c-content h3",
|
|
@@ -4636,17 +4687,17 @@ const Ri = () => {
|
|
|
4636
4687
|
"#page-content header span",
|
|
4637
4688
|
"#page-content header h1",
|
|
4638
4689
|
"#page-content header h2"
|
|
4639
|
-
], ft = (s, t) => s instanceof Element ? t.some((e) => s.matches(e)) : !1,
|
|
4690
|
+
], ft = (s, t) => s instanceof Element ? t.some((e) => s.matches(e)) : !1, Wi = (s, t) => {
|
|
4640
4691
|
const e = s.startContainer.nodeType === Node.ELEMENT_NODE ? s.startContainer : s.startContainer.parentElement, i = s.endContainer.nodeType === Node.ELEMENT_NODE ? s.endContainer : s.endContainer.parentElement;
|
|
4641
4692
|
return !!e && ft(e, t) || !!i && ft(i, t);
|
|
4642
|
-
},
|
|
4693
|
+
}, Vi = (s) => {
|
|
4643
4694
|
if (!s.focusNode)
|
|
4644
4695
|
return null;
|
|
4645
4696
|
const t = s.anchorNode?.compareDocumentPosition(s.focusNode);
|
|
4646
4697
|
return t ? (t & 4) > 0 : s.anchorOffset < s.focusOffset;
|
|
4647
|
-
},
|
|
4698
|
+
}, ji = (s, t, e) => {
|
|
4648
4699
|
const i = document.querySelector(`${j} ${X}`), n = document.querySelector(`${j}`), o = document.querySelectorAll(
|
|
4649
|
-
`${j} ${X} ${
|
|
4700
|
+
`${j} ${X} ${Ni}`
|
|
4650
4701
|
);
|
|
4651
4702
|
if (!i || !n) {
|
|
4652
4703
|
console.warn("Text tooltip : Tooltip or it's parent are not found in the DOM");
|
|
@@ -4654,10 +4705,10 @@ const Ri = () => {
|
|
|
4654
4705
|
}
|
|
4655
4706
|
Array.from(o).forEach((l) => l.setAttribute("data-selected-text", e));
|
|
4656
4707
|
const r = s.getClientRects(), a = r[t ? r.length - 1 : 0];
|
|
4657
|
-
i.style.top = `${a.top - n.getBoundingClientRect().top - (i.offsetHeight + 10)}px`, a.width < i.offsetWidth ? i.style.left = `${a.left - n.getBoundingClientRect().left + a.width / 2 - i.offsetWidth / 2}px` : t ? i.style.left = `${a.left - n.getBoundingClientRect().left + a.width - i.offsetWidth}px` : i.style.left = `${a.left - n.getBoundingClientRect().left}px`, i.classList.add(
|
|
4708
|
+
i.style.top = `${a.top - n.getBoundingClientRect().top - (i.offsetHeight + 10)}px`, a.width < i.offsetWidth ? i.style.left = `${a.left - n.getBoundingClientRect().left + a.width / 2 - i.offsetWidth / 2}px` : t ? i.style.left = `${a.left - n.getBoundingClientRect().left + a.width - i.offsetWidth}px` : i.style.left = `${a.left - n.getBoundingClientRect().left}px`, i.classList.add(Ot);
|
|
4658
4709
|
}, gt = () => {
|
|
4659
4710
|
const s = document.querySelector(`${X}`);
|
|
4660
|
-
s && s.classList.remove(
|
|
4711
|
+
s && s.classList.remove(Ot);
|
|
4661
4712
|
}, N = ({ type: s }) => {
|
|
4662
4713
|
const t = window.getSelection();
|
|
4663
4714
|
if (s === "selectionchange") {
|
|
@@ -4668,30 +4719,30 @@ const Ri = () => {
|
|
|
4668
4719
|
return;
|
|
4669
4720
|
const e = t.getRangeAt(0), i = t.toString().trim();
|
|
4670
4721
|
if (i.length) {
|
|
4671
|
-
const n =
|
|
4672
|
-
n &&
|
|
4722
|
+
const n = Wi(e, Hi), o = Vi(t) || !1;
|
|
4723
|
+
n && ji(e, o, i);
|
|
4673
4724
|
return;
|
|
4674
4725
|
}
|
|
4675
4726
|
gt();
|
|
4676
|
-
},
|
|
4727
|
+
}, Gi = () => {
|
|
4677
4728
|
if (!window?.getSelection) {
|
|
4678
4729
|
console.warn("Selection API isn't supported");
|
|
4679
4730
|
return;
|
|
4680
4731
|
}
|
|
4681
4732
|
document.addEventListener("mouseup", N), document.addEventListener("selectionchange", N), document.addEventListener("touchend", N), document.addEventListener("touchcancel", N);
|
|
4682
|
-
},
|
|
4733
|
+
}, Ui = (s) => {
|
|
4683
4734
|
const { target: t } = s;
|
|
4684
4735
|
if (t instanceof Element) {
|
|
4685
4736
|
const e = t.closest(".c-search-form--button");
|
|
4686
4737
|
e && (s.preventDefault(), e.classList.remove("c-search-form--button"));
|
|
4687
4738
|
}
|
|
4688
|
-
},
|
|
4739
|
+
}, Ki = (s = document.querySelector(
|
|
4689
4740
|
".c-search-form--button"
|
|
4690
4741
|
)) => {
|
|
4691
4742
|
s && s.addEventListener("click", (t) => {
|
|
4692
|
-
|
|
4743
|
+
Ui(t);
|
|
4693
4744
|
});
|
|
4694
|
-
},
|
|
4745
|
+
}, Xi = ({
|
|
4695
4746
|
tabsContainerElement: s,
|
|
4696
4747
|
event: t
|
|
4697
4748
|
}) => {
|
|
@@ -4707,14 +4758,14 @@ const Ri = () => {
|
|
|
4707
4758
|
}), n.forEach((a) => {
|
|
4708
4759
|
a.setAttribute("aria-hidden", "true");
|
|
4709
4760
|
}), e.setAttribute("aria-selected", "true"), r && r.removeAttribute("aria-hidden");
|
|
4710
|
-
}, vt = (s) => s.code === "ArrowLeft" || s.keyCode === 39, yt = (s) => s.code === "ArrowRight" || s.keyCode === 37,
|
|
4761
|
+
}, vt = (s) => s.code === "ArrowLeft" || s.keyCode === 39, yt = (s) => s.code === "ArrowRight" || s.keyCode === 37, Yi = (s = document.querySelectorAll(
|
|
4711
4762
|
".js-tabs"
|
|
4712
4763
|
)) => {
|
|
4713
4764
|
s.length > 0 && s.forEach((t) => {
|
|
4714
4765
|
const e = t.querySelectorAll('[role="tab"]');
|
|
4715
4766
|
e.forEach((n) => {
|
|
4716
4767
|
n.addEventListener("click", (o) => {
|
|
4717
|
-
|
|
4768
|
+
Xi({ tabsContainerElement: t, event: o });
|
|
4718
4769
|
});
|
|
4719
4770
|
});
|
|
4720
4771
|
const i = t.querySelector('[role="tablist"]');
|
|
@@ -4728,17 +4779,17 @@ const Ri = () => {
|
|
|
4728
4779
|
}, H = (s) => {
|
|
4729
4780
|
const [t, e] = s.split("h").map(Number);
|
|
4730
4781
|
return t * 60 + e;
|
|
4731
|
-
},
|
|
4782
|
+
}, Dt = () => {
|
|
4732
4783
|
const s = /* @__PURE__ */ new Date(), t = s.getHours(), e = s.getMinutes();
|
|
4733
4784
|
return t * 60 + e;
|
|
4734
|
-
},
|
|
4735
|
-
const e =
|
|
4785
|
+
}, Ji = (s, t) => {
|
|
4786
|
+
const e = Dt();
|
|
4736
4787
|
if (e < s || e > t)
|
|
4737
4788
|
return 0;
|
|
4738
4789
|
const i = t - s;
|
|
4739
4790
|
return (e - s) / i;
|
|
4740
|
-
},
|
|
4741
|
-
const t =
|
|
4791
|
+
}, Qi = (s) => {
|
|
4792
|
+
const t = Dt();
|
|
4742
4793
|
let e = null, i = null, n = -1;
|
|
4743
4794
|
return Array.from(s).find((o, r, a) => {
|
|
4744
4795
|
if (r === a.length - 1)
|
|
@@ -4749,14 +4800,14 @@ const Ri = () => {
|
|
|
4749
4800
|
const d = H(l), h = H(c);
|
|
4750
4801
|
return t >= d && t < h ? (e = l, i = c, n = r, !0) : !1;
|
|
4751
4802
|
}), { currentIntervalStartTime: e, currentIntervalEndTime: i, currentIntervalIndex: n };
|
|
4752
|
-
},
|
|
4803
|
+
}, ts = () => {
|
|
4753
4804
|
const s = document.querySelectorAll(".c-timeline__time");
|
|
4754
4805
|
if (!s || s.length < 2)
|
|
4755
4806
|
return;
|
|
4756
|
-
const t = document.querySelector(".c-timeline__progress-bar"), { currentIntervalStartTime: e, currentIntervalEndTime: i, currentIntervalIndex: n } =
|
|
4807
|
+
const t = document.querySelector(".c-timeline__progress-bar"), { currentIntervalStartTime: e, currentIntervalEndTime: i, currentIntervalIndex: n } = Qi(s);
|
|
4757
4808
|
if (!e || !i)
|
|
4758
4809
|
return;
|
|
4759
|
-
const o = H(e), r = H(i), a =
|
|
4810
|
+
const o = H(e), r = H(i), a = Ji(o, r);
|
|
4760
4811
|
if (t instanceof HTMLElement) {
|
|
4761
4812
|
if (t.classList.contains("c-timeline__progress-bar--is-desktop") && s.length >= 5) {
|
|
4762
4813
|
const l = "172px / 2";
|
|
@@ -4795,15 +4846,15 @@ const Ri = () => {
|
|
|
4795
4846
|
}
|
|
4796
4847
|
}
|
|
4797
4848
|
}
|
|
4798
|
-
}, Y = "c-icon-item__container--is-highlighted",
|
|
4849
|
+
}, Y = "c-icon-item__container--is-highlighted", es = (s) => {
|
|
4799
4850
|
s.find(
|
|
4800
4851
|
(e) => e.classList.contains(Y)
|
|
4801
4852
|
)?.classList.remove(Y);
|
|
4802
|
-
},
|
|
4853
|
+
}, is = () => {
|
|
4803
4854
|
const s = document.querySelector(".c-toolbar");
|
|
4804
4855
|
if (s) {
|
|
4805
4856
|
const t = window.location.origin + window.location.pathname, e = Array.from(s.querySelectorAll(".c-icon-item__container"));
|
|
4806
|
-
|
|
4857
|
+
es(e), e.find(
|
|
4807
4858
|
(n) => n.querySelector("a")?.getAttribute("href") === t
|
|
4808
4859
|
)?.classList.add(Y);
|
|
4809
4860
|
}
|
|
@@ -4832,13 +4883,13 @@ const Ri = () => {
|
|
|
4832
4883
|
return;
|
|
4833
4884
|
const h = l.getBBox();
|
|
4834
4885
|
if (h.width > 0) {
|
|
4835
|
-
const { x: u, y:
|
|
4886
|
+
const { x: u, y: m, width: f, height: p } = h, y = a.getAttribute("data-scale"), S = y ? ` scale(${y})` : "";
|
|
4836
4887
|
a.setAttribute(
|
|
4837
4888
|
"transform",
|
|
4838
|
-
`translate(${u + f / 2}, ${
|
|
4889
|
+
`translate(${u + f / 2}, ${m + p / 2})${S}`
|
|
4839
4890
|
);
|
|
4840
|
-
const L = c.getBBox(), g = 8,
|
|
4841
|
-
d.setAttribute("width", `${
|
|
4891
|
+
const L = c.getBBox(), g = 8, _ = 4, w = 8, q = L.width + g, W = L.height + _;
|
|
4892
|
+
d.setAttribute("width", `${q}`), d.setAttribute("height", `${W}`), d.setAttribute("x", `${-q / 2}`), d.setAttribute("y", `${-W - w}`);
|
|
4842
4893
|
const $t = -W / 2 - w;
|
|
4843
4894
|
c.setAttribute("y", `${$t}`), a.setAttribute("aria-hidden", "false");
|
|
4844
4895
|
} else
|
|
@@ -4855,7 +4906,7 @@ const Ri = () => {
|
|
|
4855
4906
|
childList: !0,
|
|
4856
4907
|
subtree: !0
|
|
4857
4908
|
});
|
|
4858
|
-
},
|
|
4909
|
+
}, ss = {
|
|
4859
4910
|
10: [{ id: "10387", name: "Troyes" }, { id: "10323", name: "Romilly-sur-Seine" }, { id: "10033", name: "Bar-sur-Aube" }],
|
|
4860
4911
|
11: [{ id: "11262", name: "Narbonne" }, { id: "11069", name: "Carcassonne" }, { id: "11076", name: "Castelnaudary" }],
|
|
4861
4912
|
12: [{ id: "12202", name: "Rodez" }, { id: "12145", name: "Millau" }, { id: "12300", name: "Villefranche-de-Rouergue" }],
|
|
@@ -4956,20 +5007,20 @@ const Ri = () => {
|
|
|
4956
5007
|
"07": [{ id: "07010", name: "Annonay" }, { id: "07019", name: "Aubenas" }, { id: "07324", name: "Tournon-sur-Rhône" }],
|
|
4957
5008
|
"05": [{ id: "05061", name: "Gap" }, { id: "05023", name: "Briançon" }, { id: "05046", name: "Embrun" }],
|
|
4958
5009
|
"08": [{ id: "08105", name: "Charleville-Mézières" }, { id: "08362", name: "Rethel" }, { id: "08190", name: "Givet" }]
|
|
4959
|
-
},
|
|
5010
|
+
}, ns = (s, t) => {
|
|
4960
5011
|
if (s.startsWith("97"))
|
|
4961
5012
|
return Array.from(
|
|
4962
5013
|
document.querySelectorAll(`path[id^="town-${s}"][id$="-drom"]`)
|
|
4963
5014
|
);
|
|
4964
5015
|
const e = `[id^="town-${s}"]`;
|
|
4965
5016
|
return t ? Array.from(t.querySelectorAll(e)) : [];
|
|
4966
|
-
},
|
|
5017
|
+
}, os = (s, t, e, i) => {
|
|
4967
5018
|
(i.startsWith("97") ? s : document.querySelector(
|
|
4968
5019
|
`.c-map-towns__layer-towns [href="#${e}"], .c-map-towns__layer-towns [xlink\\:href="#${e}"]`
|
|
4969
5020
|
))?.classList.forEach((o) => {
|
|
4970
5021
|
o.includes("--") && t.classList.add(o);
|
|
4971
5022
|
});
|
|
4972
|
-
},
|
|
5023
|
+
}, rs = (s, t) => {
|
|
4973
5024
|
const e = s.getAttribute("id"), i = s.getAttribute("data-url"), n = s.getAttribute("data-name");
|
|
4974
5025
|
if (!e || !i)
|
|
4975
5026
|
return null;
|
|
@@ -4983,8 +5034,8 @@ const Ri = () => {
|
|
|
4983
5034
|
r = a, r.removeAttribute("id");
|
|
4984
5035
|
} else
|
|
4985
5036
|
r = document.createElementNS("http://www.w3.org/2000/svg", "use"), r.setAttribute("href", `#${e}`);
|
|
4986
|
-
return r.classList.add("c-map-towns__path"),
|
|
4987
|
-
},
|
|
5037
|
+
return r.classList.add("c-map-towns__path"), os(s, r, e, t), o.appendChild(r), o;
|
|
5038
|
+
}, as = (s, t, e) => {
|
|
4988
5039
|
const i = document.createElementNS("http://www.w3.org/2000/svg", "g");
|
|
4989
5040
|
i.setAttribute("class", "js-city-marker c-map-towns__city-marker"), i.setAttribute("aria-hidden", "true"), i.setAttribute("data-scale", e.toString());
|
|
4990
5041
|
const n = document.createElementNS("http://www.w3.org/2000/svg", "use"), r = t.startsWith("97") ? `#town-${t}-drom` : `#town-${t}`;
|
|
@@ -4995,7 +5046,7 @@ const Ri = () => {
|
|
|
4995
5046
|
l.setAttribute("class", "js-city-bg"), l.setAttribute("fill", "white"), l.setAttribute("rx", "4"), l.setAttribute("ry", "4");
|
|
4996
5047
|
const c = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
4997
5048
|
return c.setAttribute("class", "js-city-text c-map-towns__city-text"), c.textContent = s, i.appendChild(n), i.appendChild(a), i.appendChild(l), i.appendChild(c), i;
|
|
4998
|
-
},
|
|
5049
|
+
}, ls = (s, t, e) => {
|
|
4999
5050
|
s.innerHTML = "", e.forEach((c) => s.appendChild(c));
|
|
5000
5051
|
const i = s.getBBox(), n = 5, o = i.width + n * 2, r = i.height + n * 2;
|
|
5001
5052
|
t.setAttribute(
|
|
@@ -5028,12 +5079,12 @@ const J = () => {
|
|
|
5028
5079
|
const u = h?.closest(".c-map-towns__dept-trigger");
|
|
5029
5080
|
if (!u)
|
|
5030
5081
|
return;
|
|
5031
|
-
const
|
|
5082
|
+
const m = u.getAttribute("id")?.replace("out-", "") || "", f = u.getAttribute("data-name"), p = document.querySelector(".c-map-towns__sprite"), S = ns(m, p).map((w) => rs(w, m)).filter((w) => w !== null);
|
|
5032
5083
|
a && f && (a.textContent = f);
|
|
5033
|
-
const L =
|
|
5034
|
-
(
|
|
5035
|
-
const
|
|
5036
|
-
i.appendChild(
|
|
5084
|
+
const L = ls(i, e, S);
|
|
5085
|
+
(ss[m] || []).forEach((w) => {
|
|
5086
|
+
const q = as(w.name, w.id, L);
|
|
5087
|
+
i.appendChild(q);
|
|
5037
5088
|
}), tt(i), t.setAttribute("aria-hidden", "false");
|
|
5038
5089
|
};
|
|
5039
5090
|
o?.addEventListener("click", l), r?.addEventListener("click", l), n.addEventListener("click", () => {
|
|
@@ -5041,15 +5092,15 @@ const J = () => {
|
|
|
5041
5092
|
}), t.addEventListener("click", (d) => {
|
|
5042
5093
|
d.target === t && t.setAttribute("aria-hidden", "true");
|
|
5043
5094
|
});
|
|
5044
|
-
},
|
|
5045
|
-
se(),
|
|
5095
|
+
}, fs = () => {
|
|
5096
|
+
se(), Yi(), Vt(), le(), Jt(), Fi(), Ri(), me(), Ki(), V("winterOlympicsGames", "countdown-winter-olympics-games"), V("eurovision", "countdown-eurovision"), V("worldFoot2026", "countdown-world-foot-2026"), Gi(), Ht(), oe(), Ut(), Nt(
|
|
5046
5097
|
"localisation-input",
|
|
5047
5098
|
"https://www.20minutes.fr/elections/resultats/recherche",
|
|
5048
5099
|
"?searchValue=",
|
|
5049
5100
|
"text",
|
|
5050
5101
|
"text"
|
|
5051
|
-
), Gt(), tt(),
|
|
5102
|
+
), Gt(), tt(), is(), Zt(), qt(), re(), J(), we(), be(), ne(), Ft(), ts(), Zi(), ki();
|
|
5052
5103
|
};
|
|
5053
5104
|
export {
|
|
5054
|
-
|
|
5105
|
+
fs as initScripts
|
|
5055
5106
|
};
|