@20minutes/hela 2.21.7 → 2.21.9
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/components/atoms/Tag/Tag.d.ts +1 -1
- package/dist/components/organisms/Ranking/Ranking.d.ts +13 -12
- package/dist/index.es.js +608 -615
- package/dist/index.umd.cjs +1 -1
- package/dist/js/scripts.es.js +366 -373
- package/dist/js/scripts.umd.cjs +1 -1
- package/dist/scss/abstracts/variables/_token-variables.scss +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/js/scripts.es.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
const
|
|
1
|
+
const Vt = () => /Android/i.test(navigator.userAgent), jt = typeof window < "u" && navigator.userAgent.toLowerCase().includes("firefox"), Gt = () => {
|
|
2
2
|
const s = document.getElementById("js-download-band");
|
|
3
|
-
s &&
|
|
3
|
+
s && Vt() && s.setAttribute(
|
|
4
4
|
"href",
|
|
5
5
|
"https://app.adjust.com/15shf6wg?campaign=Bandeau_1&deep_link=20minutes%3A%2F%2Fhome"
|
|
6
6
|
);
|
|
7
|
-
},
|
|
7
|
+
}, Ut = () => {
|
|
8
8
|
const s = document.querySelector("#js-election-selector");
|
|
9
9
|
s && s.addEventListener("change", (t) => {
|
|
10
10
|
window.location.replace(t.target.value);
|
|
11
11
|
});
|
|
12
|
-
},
|
|
12
|
+
}, Kt = () => {
|
|
13
13
|
const s = document.querySelector(".c-search-banner");
|
|
14
14
|
if (!s)
|
|
15
15
|
return;
|
|
@@ -24,7 +24,7 @@ const jt = () => /Android/i.test(navigator.userAgent), Gt = typeof window < "u"
|
|
|
24
24
|
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"));
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
|
-
},
|
|
27
|
+
}, Xt = [
|
|
28
28
|
{
|
|
29
29
|
text: "Paris",
|
|
30
30
|
_index: "town_1717424751904",
|
|
@@ -55,7 +55,7 @@ const jt = () => /Android/i.test(navigator.userAgent), Gt = typeof window < "u"
|
|
|
55
55
|
url: "/elections/resultats/paris/paris-75011"
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
],
|
|
58
|
+
], Yt = (s, t, e, i, n, o) => {
|
|
59
59
|
const r = document.getElementById(s);
|
|
60
60
|
if (!r)
|
|
61
61
|
return;
|
|
@@ -64,7 +64,7 @@ const jt = () => /Android/i.test(navigator.userAgent), Gt = 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 _ = a && t.includes("20minutes.fr") ?
|
|
67
|
+
const _ = a && t.includes("20minutes.fr") ? Xt : await fetch(`${c}${e}${encodeURIComponent(g)}`).then(
|
|
68
68
|
(B) => B.json()
|
|
69
69
|
), A = o && typeof _ == "object" && _ !== null ? _[o] : _;
|
|
70
70
|
return Array.isArray(A) ? A : [];
|
|
@@ -98,7 +98,7 @@ const jt = () => /Android/i.test(navigator.userAgent), Gt = typeof window < "u"
|
|
|
98
98
|
}), l.addEventListener("focusin", () => {
|
|
99
99
|
d.childElementCount > 0 && d.classList.remove("u-hidden");
|
|
100
100
|
});
|
|
101
|
-
},
|
|
101
|
+
}, Jt = (s) => {
|
|
102
102
|
s.stopImmediatePropagation(), s.preventDefault();
|
|
103
103
|
const t = s.currentTarget;
|
|
104
104
|
if (t instanceof HTMLButtonElement) {
|
|
@@ -107,15 +107,15 @@ const jt = () => /Android/i.test(navigator.userAgent), Gt = typeof window < "u"
|
|
|
107
107
|
);
|
|
108
108
|
t.getAttribute("aria-expanded") === "true" ? (t.setAttribute("aria-expanded", "false"), i?.setAttribute("aria-hidden", "true")) : (t.setAttribute("aria-expanded", "true"), i?.setAttribute("aria-hidden", "false"));
|
|
109
109
|
}
|
|
110
|
-
},
|
|
110
|
+
}, Qt = (s = document.querySelector(
|
|
111
111
|
".js-collapse__button"
|
|
112
112
|
)) => {
|
|
113
113
|
s && document.querySelectorAll(".c-collapse__button").forEach((e) => {
|
|
114
114
|
e.addEventListener("click", (i) => {
|
|
115
|
-
|
|
115
|
+
Jt(i);
|
|
116
116
|
});
|
|
117
117
|
});
|
|
118
|
-
},
|
|
118
|
+
}, tt = (s, t) => {
|
|
119
119
|
const e = document.querySelector(
|
|
120
120
|
`#${t}`
|
|
121
121
|
);
|
|
@@ -139,12 +139,12 @@ const jt = () => /Android/i.test(navigator.userAgent), Gt = typeof window < "u"
|
|
|
139
139
|
}
|
|
140
140
|
}, 1e3);
|
|
141
141
|
}
|
|
142
|
-
},
|
|
142
|
+
}, te = (s) => {
|
|
143
143
|
const t = s.getBBox(), e = t.width / 20;
|
|
144
144
|
return [t.x - e, t.y - e, t.width + e * 2, t.height + e * 2].join(
|
|
145
145
|
" "
|
|
146
146
|
);
|
|
147
|
-
},
|
|
147
|
+
}, ee = () => {
|
|
148
148
|
const s = document.querySelector(".c-map-districts-container"), t = document.querySelector(".c-map-districts");
|
|
149
149
|
if (!s || !t)
|
|
150
150
|
return;
|
|
@@ -195,7 +195,7 @@ const jt = () => /Android/i.test(navigator.userAgent), Gt = typeof window < "u"
|
|
|
195
195
|
);
|
|
196
196
|
d(
|
|
197
197
|
y || p,
|
|
198
|
-
|
|
198
|
+
te(y || p)
|
|
199
199
|
);
|
|
200
200
|
}
|
|
201
201
|
}, u = () => {
|
|
@@ -204,7 +204,7 @@ const jt = () => /Android/i.test(navigator.userAgent), Gt = typeof window < "u"
|
|
|
204
204
|
t.addEventListener("click", u), n && n.addEventListener("click", u), document.querySelectorAll(".c-map-districts__zoomable").forEach((m) => {
|
|
205
205
|
m.addEventListener("click", (p) => h(p));
|
|
206
206
|
});
|
|
207
|
-
},
|
|
207
|
+
}, ie = () => {
|
|
208
208
|
const s = document.getElementById("elections-form-search"), t = document.querySelector(".c-search-form__autocomplete");
|
|
209
209
|
if (!s || !t)
|
|
210
210
|
return;
|
|
@@ -232,59 +232,59 @@ const jt = () => /Android/i.test(navigator.userAgent), Gt = typeof window < "u"
|
|
|
232
232
|
}), s.addEventListener("focusin", () => {
|
|
233
233
|
t.childElementCount > 0 && t.classList.remove("u-hidden");
|
|
234
234
|
});
|
|
235
|
-
},
|
|
235
|
+
}, se = (s, t) => {
|
|
236
236
|
s.setAttribute("aria-expanded", "true"), s.parentNode?.querySelectorAll(".js-ellipsis-target")?.forEach((n) => {
|
|
237
237
|
n.classList.remove(t);
|
|
238
238
|
});
|
|
239
239
|
const i = s.querySelector(".js-ellipsis-button__label");
|
|
240
240
|
i instanceof HTMLSpanElement && (i.innerHTML = "Voir moins");
|
|
241
|
-
},
|
|
241
|
+
}, ne = (s, t) => {
|
|
242
242
|
s.parentNode?.querySelectorAll(".js-ellipsis-target")?.forEach((n) => {
|
|
243
243
|
n.classList.add(t);
|
|
244
244
|
}), s.setAttribute("aria-expanded", "false");
|
|
245
245
|
const i = s.querySelector(".js-ellipsis-button__label");
|
|
246
246
|
i instanceof HTMLSpanElement && (i.innerHTML = "Voir plus");
|
|
247
|
-
},
|
|
247
|
+
}, oe = (s, t) => {
|
|
248
248
|
const e = s.currentTarget;
|
|
249
249
|
if (s.preventDefault(), e instanceof HTMLButtonElement) {
|
|
250
250
|
const i = t ? "u-ellipsis-multiline" : "u-ellipsis";
|
|
251
|
-
return e.getAttribute("aria-expanded") === "true" ?
|
|
251
|
+
return e.getAttribute("aria-expanded") === "true" ? ne(e, i) : se(e, i);
|
|
252
252
|
}
|
|
253
253
|
return null;
|
|
254
|
-
},
|
|
254
|
+
}, re = (s = document.querySelector(
|
|
255
255
|
".js-ellipsis-button"
|
|
256
256
|
)) => {
|
|
257
257
|
s && document.querySelectorAll(".js-ellipsis-button").forEach((e) => {
|
|
258
258
|
const i = e.getAttribute("data-multiple") === "true";
|
|
259
|
-
e.addEventListener("click", (n) =>
|
|
259
|
+
e.addEventListener("click", (n) => oe(n, i));
|
|
260
260
|
});
|
|
261
|
-
},
|
|
261
|
+
}, ae = (s) => {
|
|
262
262
|
s.setAttribute("aria-expanded", "true"), s.parentNode?.querySelectorAll(".js-expand-target")?.forEach((i) => {
|
|
263
263
|
i.setAttribute("aria-hidden", "false");
|
|
264
264
|
});
|
|
265
265
|
const e = s.querySelector(".js-expand-button__label");
|
|
266
266
|
e instanceof HTMLSpanElement && (e.innerHTML = "Voir moins");
|
|
267
|
-
},
|
|
267
|
+
}, le = (s) => {
|
|
268
268
|
s.parentNode?.querySelectorAll(".js-expand-target")?.forEach((i) => {
|
|
269
269
|
i.setAttribute("aria-hidden", "true");
|
|
270
270
|
}), s.setAttribute("aria-expanded", "false");
|
|
271
271
|
const e = s.querySelector(".js-expand-button__label");
|
|
272
272
|
e instanceof HTMLSpanElement && (e.innerHTML = "Voir plus");
|
|
273
|
-
},
|
|
273
|
+
}, ce = (s) => {
|
|
274
274
|
const t = s.currentTarget;
|
|
275
|
-
return s.preventDefault(), t instanceof HTMLButtonElement ? t.getAttribute("aria-expanded") === "true" ?
|
|
276
|
-
},
|
|
275
|
+
return s.preventDefault(), t instanceof HTMLButtonElement ? t.getAttribute("aria-expanded") === "true" ? le(t) : ae(t) : null;
|
|
276
|
+
}, de = (s) => {
|
|
277
277
|
const t = s.parentNode?.querySelector(".js-expand-target");
|
|
278
278
|
return !t || t.classList.contains("c-elections-result__members") ? !1 : (t.textContent?.trim().length ?? 0) < 255;
|
|
279
|
-
},
|
|
279
|
+
}, he = (s = document.querySelector(
|
|
280
280
|
".js-expand-button"
|
|
281
281
|
)) => {
|
|
282
282
|
s && document.querySelectorAll(".js-expand-button").forEach((e) => {
|
|
283
|
-
|
|
283
|
+
de(e) ? (e.style.display = "none", e.parentNode?.querySelectorAll(".js-expand-target")?.forEach((n) => {
|
|
284
284
|
n.setAttribute("aria-hidden", "false");
|
|
285
|
-
})) : e.addEventListener("click",
|
|
285
|
+
})) : e.addEventListener("click", ce);
|
|
286
286
|
});
|
|
287
|
-
},
|
|
287
|
+
}, It = (s, t) => {
|
|
288
288
|
const e = document.querySelector(".js-content-header"), i = document.querySelector(t), n = document.querySelector(s), o = document.querySelector(".c-header-mobile"), r = o instanceof HTMLElement ? o.offsetHeight : 0;
|
|
289
289
|
if (e && i && n) {
|
|
290
290
|
const a = new IntersectionObserver(
|
|
@@ -298,10 +298,10 @@ const jt = () => /Android/i.test(navigator.userAgent), Gt = typeof window < "u"
|
|
|
298
298
|
);
|
|
299
299
|
a.observe(e), a.observe(i);
|
|
300
300
|
}
|
|
301
|
-
},
|
|
301
|
+
}, ue = () => It(".js-close-article-btn", ".js-limit-scroll-close-article-btn"), pe = () => It(".js-chatbot-btn", ".js-limit-scroll-chatbot-btn"), me = () => {
|
|
302
302
|
const s = document.querySelector(".js-game-alert");
|
|
303
|
-
|
|
304
|
-
},
|
|
303
|
+
jt && s && s.classList.remove("u-hidden");
|
|
304
|
+
}, fe = () => {
|
|
305
305
|
const s = document.querySelectorAll(".js-half-donut-result");
|
|
306
306
|
for (const t of Array.from(s)) {
|
|
307
307
|
const e = t.querySelector(".c-half-donut"), i = t.querySelector(".c-legend");
|
|
@@ -320,7 +320,7 @@ const jt = () => /Android/i.test(navigator.userAgent), Gt = typeof window < "u"
|
|
|
320
320
|
});
|
|
321
321
|
});
|
|
322
322
|
}
|
|
323
|
-
},
|
|
323
|
+
}, ge = () => {
|
|
324
324
|
const s = document.querySelector(".c-image-slider__container");
|
|
325
325
|
if (!s)
|
|
326
326
|
return () => {
|
|
@@ -384,19 +384,19 @@ const jt = () => /Android/i.test(navigator.userAgent), Gt = typeof window < "u"
|
|
|
384
384
|
}), c(!0), h(), () => {
|
|
385
385
|
u();
|
|
386
386
|
};
|
|
387
|
-
},
|
|
387
|
+
}, ve = (s) => {
|
|
388
388
|
s.stopImmediatePropagation(), s.preventDefault();
|
|
389
389
|
const t = s.currentTarget, e = document.getElementById("info-button-content");
|
|
390
390
|
!(t instanceof HTMLButtonElement) || !e || (t.getAttribute("aria-expanded") === "true" ? (t.setAttribute("aria-expanded", "false"), e.setAttribute("aria-hidden", "true")) : (t.setAttribute("aria-expanded", "true"), e.setAttribute("aria-hidden", "false")));
|
|
391
|
-
},
|
|
391
|
+
}, ye = () => {
|
|
392
392
|
const s = document.querySelector(".js-info-banner__button");
|
|
393
|
-
s instanceof HTMLButtonElement && s.addEventListener("click",
|
|
393
|
+
s instanceof HTMLButtonElement && s.addEventListener("click", ve);
|
|
394
394
|
}, v = {
|
|
395
395
|
inert: ":not([inert]):not([inert] *)",
|
|
396
396
|
negTabIndex: ':not([tabindex^="-"])',
|
|
397
397
|
disabled: ":not(:disabled)"
|
|
398
398
|
};
|
|
399
|
-
var
|
|
399
|
+
var _e = [
|
|
400
400
|
`a[href]${v.inert}${v.negTabIndex}`,
|
|
401
401
|
`area[href]${v.inert}${v.negTabIndex}`,
|
|
402
402
|
`input:not([type="hidden"]):not([type="radio"])${v.inert}${v.negTabIndex}${v.disabled}`,
|
|
@@ -414,24 +414,24 @@ var we = [
|
|
|
414
414
|
`[contenteditable]${v.inert}${v.negTabIndex}`,
|
|
415
415
|
`[tabindex]${v.inert}${v.negTabIndex}`
|
|
416
416
|
];
|
|
417
|
-
function
|
|
417
|
+
function ht(s) {
|
|
418
418
|
(s.querySelector("[autofocus]") || s).focus();
|
|
419
419
|
}
|
|
420
|
-
function
|
|
420
|
+
function we(s) {
|
|
421
421
|
const t = W(s, !0), e = t ? W(s, !1) || t : null;
|
|
422
422
|
return [t, e];
|
|
423
423
|
}
|
|
424
424
|
function W(s, t) {
|
|
425
|
-
if (t &&
|
|
425
|
+
if (t && mt(s))
|
|
426
426
|
return s;
|
|
427
|
-
if (
|
|
427
|
+
if (Se(s))
|
|
428
428
|
if (s.shadowRoot) {
|
|
429
|
-
let e =
|
|
429
|
+
let e = ut(s.shadowRoot, t);
|
|
430
430
|
for (; e; ) {
|
|
431
431
|
const i = W(e, t);
|
|
432
432
|
if (i)
|
|
433
433
|
return i;
|
|
434
|
-
e =
|
|
434
|
+
e = pt(e, t);
|
|
435
435
|
}
|
|
436
436
|
} else if (s.localName === "slot") {
|
|
437
437
|
const e = s.assignedElements({
|
|
@@ -444,32 +444,32 @@ function W(s, t) {
|
|
|
444
444
|
return n;
|
|
445
445
|
}
|
|
446
446
|
} else {
|
|
447
|
-
let e =
|
|
447
|
+
let e = ut(s, t);
|
|
448
448
|
for (; e; ) {
|
|
449
449
|
const i = W(e, t);
|
|
450
450
|
if (i)
|
|
451
451
|
return i;
|
|
452
|
-
e =
|
|
452
|
+
e = pt(e, t);
|
|
453
453
|
}
|
|
454
454
|
}
|
|
455
|
-
return !t &&
|
|
455
|
+
return !t && mt(s) ? s : null;
|
|
456
456
|
}
|
|
457
|
-
function
|
|
457
|
+
function ut(s, t) {
|
|
458
458
|
return t ? s.firstElementChild : s.lastElementChild;
|
|
459
459
|
}
|
|
460
|
-
function
|
|
460
|
+
function pt(s, t) {
|
|
461
461
|
return t ? s.nextElementSibling : s.previousElementSibling;
|
|
462
462
|
}
|
|
463
|
-
const
|
|
464
|
-
function
|
|
463
|
+
const be = (s) => s.matches("details:not([open]) *") && !s.matches("details>summary:first-of-type") ? !0 : !(s.offsetWidth || s.offsetHeight || s.getClientRects().length), mt = (s) => s.shadowRoot?.delegatesFocus ? !1 : s.matches(_e.join(",")) && !be(s);
|
|
464
|
+
function Se(s) {
|
|
465
465
|
return s.shadowRoot && s.getAttribute("tabindex") === "-1" ? !1 : !s.matches(":disabled,[hidden],[inert]");
|
|
466
466
|
}
|
|
467
467
|
function V(s = document) {
|
|
468
468
|
const t = s.activeElement;
|
|
469
469
|
return t ? t.shadowRoot ? V(t.shadowRoot) || document.activeElement : t : null;
|
|
470
470
|
}
|
|
471
|
-
function
|
|
472
|
-
const [e, i] =
|
|
471
|
+
function Le(s, t) {
|
|
472
|
+
const [e, i] = we(s);
|
|
473
473
|
if (!e)
|
|
474
474
|
return t.preventDefault();
|
|
475
475
|
const n = V();
|
|
@@ -479,16 +479,16 @@ function R(s, t) {
|
|
|
479
479
|
function e(i) {
|
|
480
480
|
if (!i || i === document || i === window)
|
|
481
481
|
return null;
|
|
482
|
-
const n =
|
|
482
|
+
const n = Mt(i);
|
|
483
483
|
return n && (i = n), i.closest(s) || e(i.getRootNode().host);
|
|
484
484
|
}
|
|
485
485
|
return e(t);
|
|
486
486
|
}
|
|
487
|
-
function
|
|
488
|
-
return s.assignedSlot || (s.parentNode ?
|
|
487
|
+
function Mt(s) {
|
|
488
|
+
return s.assignedSlot || (s.parentNode ? Mt(s.parentNode) : null);
|
|
489
489
|
}
|
|
490
490
|
const Z = "data-a11y-dialog";
|
|
491
|
-
class
|
|
491
|
+
class zt {
|
|
492
492
|
$el;
|
|
493
493
|
id;
|
|
494
494
|
previouslyFocused;
|
|
@@ -537,7 +537,7 @@ class Mt {
|
|
|
537
537
|
* Returns the instance to allow method chaining.
|
|
538
538
|
*/
|
|
539
539
|
show(t) {
|
|
540
|
-
return this.shown ? this : this.fire("show", t).defaultPrevented ? this : (this.shown = !0, this.$el.removeAttribute("aria-hidden"), this.previouslyFocused = V(), this.previouslyFocused?.tagName === "BODY" && t?.target && (this.previouslyFocused = t.target), t?.type === "focus" ? this.maintainFocus() :
|
|
540
|
+
return this.shown ? this : this.fire("show", t).defaultPrevented ? this : (this.shown = !0, this.$el.removeAttribute("aria-hidden"), this.previouslyFocused = V(), this.previouslyFocused?.tagName === "BODY" && t?.target && (this.previouslyFocused = t.target), t?.type === "focus" ? this.maintainFocus() : ht(this.$el), document.body.addEventListener("focus", this.maintainFocus, !0), this.$el.addEventListener("keydown", this.bindKeypress, !0), this);
|
|
541
541
|
}
|
|
542
542
|
/**
|
|
543
543
|
* Hide the dialog.
|
|
@@ -600,7 +600,7 @@ class Mt {
|
|
|
600
600
|
e = !!this.$el.querySelector('[popover]:not([popover="manual"]):popover-open');
|
|
601
601
|
} catch {
|
|
602
602
|
}
|
|
603
|
-
t.key === "Escape" && this.$el.getAttribute("role") !== "alertdialog" && !e && (t.preventDefault(), this.hide(t)), t.key === "Tab" &&
|
|
603
|
+
t.key === "Escape" && this.$el.getAttribute("role") !== "alertdialog" && !e && (t.preventDefault(), this.hide(t)), t.key === "Tab" && Le(this.$el, t);
|
|
604
604
|
}
|
|
605
605
|
/**
|
|
606
606
|
* If the dialog is shown and the focus is not within a dialog element (either
|
|
@@ -610,18 +610,18 @@ class Mt {
|
|
|
610
610
|
*/
|
|
611
611
|
maintainFocus() {
|
|
612
612
|
const t = V();
|
|
613
|
-
R(`[aria-modal="true"], [${Z}-ignore-focus-trap]`, t) ||
|
|
613
|
+
R(`[aria-modal="true"], [${Z}-ignore-focus-trap]`, t) || ht(this.$el);
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
|
-
function
|
|
616
|
+
function ft() {
|
|
617
617
|
for (const s of document.querySelectorAll("[data-a11y-dialog]"))
|
|
618
|
-
new
|
|
618
|
+
new zt(s);
|
|
619
619
|
}
|
|
620
|
-
typeof document < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded",
|
|
621
|
-
const
|
|
620
|
+
typeof document < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", ft) : ft());
|
|
621
|
+
const Ae = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
622
622
|
if (!(s instanceof HTMLElement))
|
|
623
623
|
return;
|
|
624
|
-
const t = new
|
|
624
|
+
const t = new zt(s);
|
|
625
625
|
if (s.id === "dialog-menu") {
|
|
626
626
|
const e = document.querySelectorAll("button[data-a11y-dialog-show='dialog-menu']"), i = document.querySelectorAll("button[data-a11y-dialog-hide='dialog-menu']");
|
|
627
627
|
e.length > 0 && i.length > 0 && (t.on("show", () => {
|
|
@@ -643,28 +643,27 @@ const Ee = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
643
643
|
}).on("hide", () => {
|
|
644
644
|
document.body.classList.remove("noscroll");
|
|
645
645
|
});
|
|
646
|
-
}),
|
|
646
|
+
}), J = "50px", ct = ({
|
|
647
647
|
navigationContainer: s,
|
|
648
648
|
navigatedList: t,
|
|
649
649
|
nextBtn: e,
|
|
650
650
|
prevBtn: i
|
|
651
651
|
}) => {
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
}, Ce = ({
|
|
652
|
+
e.classList.contains("o-nav-button--visible") && !i.classList.contains("o-nav-button--visible") && (s.style.paddingRight = J, s.style.paddingLeft = ""), i.classList.contains("o-nav-button--visible") && (s.style.paddingLeft = J, e.classList.contains("o-nav-button--visible") && (s.style.paddingRight = J), 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
|
+
}, Ee = ({
|
|
655
654
|
navigationContainer: s,
|
|
656
655
|
navigatedList: t,
|
|
657
656
|
nextBtn: e,
|
|
658
657
|
prevBtn: i
|
|
659
658
|
}) => {
|
|
660
659
|
const n = t.scrollLeft > 0, o = t.scrollLeft + (t.clientWidth + 0.5) < t.scrollWidth;
|
|
661
|
-
n && o ? (e.classList?.add("o-nav-button--visible"), i.classList?.add("o-nav-button--visible")) : n ? (e.classList?.remove("o-nav-button--visible"), i.classList?.add("o-nav-button--visible")) : o ? (e.classList?.add("o-nav-button--visible"), i.classList?.remove("o-nav-button--visible")) : (e.classList?.remove("o-nav-button--visible"), i.classList?.remove("o-nav-button--visible")), e.classList.contains("c-slider__button-container--has-space-around") && i.classList.contains("c-slider__button-container--has-space-around") &&
|
|
660
|
+
n && o ? (e.classList?.add("o-nav-button--visible"), i.classList?.add("o-nav-button--visible")) : n ? (e.classList?.remove("o-nav-button--visible"), i.classList?.add("o-nav-button--visible")) : o ? (e.classList?.add("o-nav-button--visible"), i.classList?.remove("o-nav-button--visible")) : (e.classList?.remove("o-nav-button--visible"), i.classList?.remove("o-nav-button--visible")), e.classList.contains("c-slider__button-container--has-space-around") && i.classList.contains("c-slider__button-container--has-space-around") && ct({
|
|
662
661
|
navigationContainer: s,
|
|
663
662
|
navigatedList: t,
|
|
664
663
|
nextBtn: e,
|
|
665
664
|
prevBtn: i
|
|
666
665
|
});
|
|
667
|
-
},
|
|
666
|
+
}, Ce = ({
|
|
668
667
|
navigationContainer: s,
|
|
669
668
|
navigatedList: t,
|
|
670
669
|
nextBtn: e,
|
|
@@ -709,14 +708,14 @@ const Ee = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
709
708
|
behavior: "smooth"
|
|
710
709
|
}), e.classList.remove("o-nav-button--visible"), i.classList.add("o-nav-button--visible");
|
|
711
710
|
}
|
|
712
|
-
e.classList.contains("c-slider__button-container--has-space-around") && i.classList.contains("c-slider__button-container--has-space-around") &&
|
|
711
|
+
e.classList.contains("c-slider__button-container--has-space-around") && i.classList.contains("c-slider__button-container--has-space-around") && ct({
|
|
713
712
|
navigationContainer: s,
|
|
714
713
|
navigatedList: t,
|
|
715
714
|
nextBtn: e,
|
|
716
715
|
prevBtn: i
|
|
717
716
|
});
|
|
718
717
|
}
|
|
719
|
-
},
|
|
718
|
+
}, xe = ({
|
|
720
719
|
navigationContainer: s,
|
|
721
720
|
navigatedList: t,
|
|
722
721
|
nextBtn: e,
|
|
@@ -757,73 +756,67 @@ const Ee = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
757
756
|
left: 0,
|
|
758
757
|
behavior: "smooth"
|
|
759
758
|
}), i.classList.remove("o-nav-button--visible"), t.clientWidth < t.scrollWidth && e.classList.add("o-nav-button--visible");
|
|
760
|
-
e.classList.contains("c-slider__button-container--has-space-around") && i.classList.contains("c-slider__button-container--has-space-around") &&
|
|
759
|
+
e.classList.contains("c-slider__button-container--has-space-around") && i.classList.contains("c-slider__button-container--has-space-around") && ct({
|
|
761
760
|
navigationContainer: s,
|
|
762
761
|
navigatedList: t,
|
|
763
762
|
nextBtn: e,
|
|
764
763
|
prevBtn: i
|
|
765
764
|
});
|
|
766
765
|
}
|
|
767
|
-
},
|
|
766
|
+
}, Pe = ({
|
|
768
767
|
navigationContainer: s,
|
|
769
768
|
navigatedList: t,
|
|
770
769
|
nextBtn: e,
|
|
771
770
|
prevBtn: i
|
|
772
771
|
}) => {
|
|
773
|
-
|
|
772
|
+
Ee({
|
|
774
773
|
navigationContainer: s,
|
|
775
774
|
navigatedList: t,
|
|
776
775
|
nextBtn: e,
|
|
777
776
|
prevBtn: i
|
|
778
777
|
});
|
|
779
|
-
},
|
|
778
|
+
}, Te = (s) => {
|
|
780
779
|
const { sliderVariant: t } = s.dataset, { sliderAuto: e } = s.dataset, { sliderDelay: i } = s.dataset, n = i ? parseInt(i, 10) : 3e3, r = s.closest(".js-overview-bar-container")?.querySelector(".c-stepper"), a = r?.querySelectorAll(".c-stepper__item"), l = s.querySelector(
|
|
781
780
|
".js-navigation-container__list"
|
|
782
781
|
), c = s.querySelector(".o-nav-button--next-button"), d = s.querySelector(
|
|
783
782
|
".o-nav-button--previous-button"
|
|
784
783
|
);
|
|
785
|
-
if (!(!l || !c || !d))
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
s
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
})
|
|
809
|
-
),
|
|
810
|
-
|
|
811
|
-
a && (a.forEach((u) => {
|
|
784
|
+
if (!(!l || !c || !d) && (l.clientWidth < l.scrollWidth && (c.classList.add("o-nav-button--visible"), c.classList.contains("c-slider__button-container--has-space-around") && (s.style.paddingRight = J)), c.addEventListener(
|
|
785
|
+
"click",
|
|
786
|
+
Ce.bind(!1, {
|
|
787
|
+
navigationContainer: s,
|
|
788
|
+
navigatedList: l,
|
|
789
|
+
nextBtn: c,
|
|
790
|
+
prevBtn: d,
|
|
791
|
+
sliderVariant: t
|
|
792
|
+
})
|
|
793
|
+
), d.addEventListener(
|
|
794
|
+
"click",
|
|
795
|
+
xe.bind(!1, {
|
|
796
|
+
navigationContainer: s,
|
|
797
|
+
navigatedList: l,
|
|
798
|
+
nextBtn: c,
|
|
799
|
+
prevBtn: d,
|
|
800
|
+
sliderVariant: t,
|
|
801
|
+
delay: n
|
|
802
|
+
})
|
|
803
|
+
), e === "true")) {
|
|
804
|
+
const h = r ? r.querySelector(".c-stepper__item--loading") : null;
|
|
805
|
+
a && (a.forEach((u) => {
|
|
806
|
+
const f = u.querySelector(".c-stepper__loader");
|
|
807
|
+
f && f instanceof HTMLElement && (f.style.transition = `width ${n / 1e3}s linear`);
|
|
808
|
+
}), h || a[0].classList.add("c-stepper__item--loading")), setInterval(() => {
|
|
809
|
+
c.classList.contains("o-nav-button--visible") ? c.click() : l && d && (l.scrollLeft = 0, a && (a.forEach((u) => {
|
|
812
810
|
const f = u.querySelector(".c-stepper__loader");
|
|
813
|
-
f && f instanceof HTMLElement && (f.style.transition =
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
}), setTimeout(() => {
|
|
821
|
-
a[0].classList.add("c-stepper__item--loading");
|
|
822
|
-
}, 0)), d.click());
|
|
823
|
-
}, n);
|
|
824
|
-
}
|
|
811
|
+
f && f instanceof HTMLElement && (f.style.transition = "width 0s linear"), u.classList.remove("c-stepper__item--loading"), u.classList.remove("c-stepper__item--loaded"), setTimeout(() => {
|
|
812
|
+
f && f instanceof HTMLElement && (f.style.transition = `width ${n / 1e3}s linear`);
|
|
813
|
+
}, 0);
|
|
814
|
+
}), setTimeout(() => {
|
|
815
|
+
a[0].classList.add("c-stepper__item--loading");
|
|
816
|
+
}, 0)), d.click());
|
|
817
|
+
}, n);
|
|
825
818
|
}
|
|
826
|
-
},
|
|
819
|
+
}, Ie = () => {
|
|
827
820
|
const s = document.querySelectorAll(".js-navigation-container");
|
|
828
821
|
Array.from(s).forEach((t) => {
|
|
829
822
|
const e = t.querySelector(
|
|
@@ -833,13 +826,13 @@ const Ee = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
833
826
|
const i = new ResizeObserver((n) => {
|
|
834
827
|
n.forEach((o) => {
|
|
835
828
|
const { width: r } = o.contentRect;
|
|
836
|
-
r > 0 && (
|
|
829
|
+
r > 0 && (Te(t), i.disconnect());
|
|
837
830
|
});
|
|
838
831
|
});
|
|
839
832
|
i.observe(e);
|
|
840
833
|
}
|
|
841
834
|
});
|
|
842
|
-
},
|
|
835
|
+
}, Me = () => {
|
|
843
836
|
const s = document.querySelectorAll(".js-navigation-container");
|
|
844
837
|
for (const t of Array.from(s))
|
|
845
838
|
if (t) {
|
|
@@ -852,7 +845,7 @@ const Ee = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
852
845
|
);
|
|
853
846
|
e && i && n && window.addEventListener(
|
|
854
847
|
"resize",
|
|
855
|
-
|
|
848
|
+
Pe.bind(!1, {
|
|
856
849
|
navigationContainer: t,
|
|
857
850
|
navigatedList: e,
|
|
858
851
|
nextBtn: i,
|
|
@@ -868,10 +861,10 @@ function x(s, t, e) {
|
|
|
868
861
|
function S(s, t) {
|
|
869
862
|
return s.x = t.x, s.y = t.y, t.id !== void 0 && (s.id = t.id), s;
|
|
870
863
|
}
|
|
871
|
-
function
|
|
864
|
+
function Ot(s) {
|
|
872
865
|
s.x = Math.round(s.x), s.y = Math.round(s.y);
|
|
873
866
|
}
|
|
874
|
-
function
|
|
867
|
+
function st(s, t) {
|
|
875
868
|
const e = Math.abs(s.x - t.x), i = Math.abs(s.y - t.y);
|
|
876
869
|
return Math.sqrt(e * e + i * i);
|
|
877
870
|
}
|
|
@@ -888,17 +881,17 @@ function G(s, t, e) {
|
|
|
888
881
|
function D(s, t, e, i) {
|
|
889
882
|
s.style.transform = G(t, e, i);
|
|
890
883
|
}
|
|
891
|
-
const
|
|
892
|
-
function
|
|
893
|
-
s.style.transition = t ? `${t} ${e}ms ${i ||
|
|
884
|
+
const ze = "cubic-bezier(.4,0,.22,1)";
|
|
885
|
+
function Dt(s, t, e, i) {
|
|
886
|
+
s.style.transition = t ? `${t} ${e}ms ${i || ze}` : "none";
|
|
894
887
|
}
|
|
895
|
-
function
|
|
888
|
+
function nt(s, t, e) {
|
|
896
889
|
s.style.width = typeof t == "number" ? `${t}px` : t, s.style.height = typeof e == "number" ? `${e}px` : e;
|
|
897
890
|
}
|
|
898
|
-
function
|
|
899
|
-
|
|
891
|
+
function Oe(s) {
|
|
892
|
+
Dt(s);
|
|
900
893
|
}
|
|
901
|
-
function
|
|
894
|
+
function De(s) {
|
|
902
895
|
return "decode" in s ? s.decode().catch(() => {
|
|
903
896
|
}) : s.complete ? Promise.resolve(s) : new Promise((t, e) => {
|
|
904
897
|
s.onload = () => t(s), s.onerror = e;
|
|
@@ -910,10 +903,10 @@ const P = {
|
|
|
910
903
|
LOADED: "loaded",
|
|
911
904
|
ERROR: "error"
|
|
912
905
|
};
|
|
913
|
-
function
|
|
906
|
+
function $e(s) {
|
|
914
907
|
return "button" in s && s.button === 1 || s.ctrlKey || s.metaKey || s.altKey || s.shiftKey;
|
|
915
908
|
}
|
|
916
|
-
function
|
|
909
|
+
function Re(s, t, e = document) {
|
|
917
910
|
let i = [];
|
|
918
911
|
if (s instanceof Element)
|
|
919
912
|
i = [s];
|
|
@@ -925,19 +918,19 @@ function Be(s, t, e = document) {
|
|
|
925
918
|
}
|
|
926
919
|
return i;
|
|
927
920
|
}
|
|
928
|
-
function
|
|
921
|
+
function gt() {
|
|
929
922
|
return !!(navigator.vendor && navigator.vendor.match(/apple/i));
|
|
930
923
|
}
|
|
931
|
-
let
|
|
924
|
+
let $t = !1;
|
|
932
925
|
try {
|
|
933
926
|
window.addEventListener("test", null, Object.defineProperty({}, "passive", {
|
|
934
927
|
get: () => {
|
|
935
|
-
|
|
928
|
+
$t = !0;
|
|
936
929
|
}
|
|
937
930
|
}));
|
|
938
931
|
} catch {
|
|
939
932
|
}
|
|
940
|
-
class
|
|
933
|
+
class Be {
|
|
941
934
|
constructor() {
|
|
942
935
|
this._pool = [];
|
|
943
936
|
}
|
|
@@ -994,7 +987,7 @@ class Fe {
|
|
|
994
987
|
listener: i,
|
|
995
988
|
passive: n
|
|
996
989
|
}));
|
|
997
|
-
const d =
|
|
990
|
+
const d = $t ? {
|
|
998
991
|
passive: n || !1
|
|
999
992
|
} : !1;
|
|
1000
993
|
t[a](c, i, d);
|
|
@@ -1002,7 +995,7 @@ class Fe {
|
|
|
1002
995
|
});
|
|
1003
996
|
}
|
|
1004
997
|
}
|
|
1005
|
-
function
|
|
998
|
+
function Rt(s, t) {
|
|
1006
999
|
if (s.getViewportSizeFn) {
|
|
1007
1000
|
const e = s.getViewportSizeFn(s, t);
|
|
1008
1001
|
if (e)
|
|
@@ -1029,13 +1022,13 @@ function q(s, t, e, i, n) {
|
|
|
1029
1022
|
}
|
|
1030
1023
|
return Number(o) || 0;
|
|
1031
1024
|
}
|
|
1032
|
-
function
|
|
1025
|
+
function Bt(s, t, e, i) {
|
|
1033
1026
|
return {
|
|
1034
1027
|
x: t.x - q("left", s, t, e, i) - q("right", s, t, e, i),
|
|
1035
1028
|
y: t.y - q("top", s, t, e, i) - q("bottom", s, t, e, i)
|
|
1036
1029
|
};
|
|
1037
1030
|
}
|
|
1038
|
-
class
|
|
1031
|
+
class Fe {
|
|
1039
1032
|
/**
|
|
1040
1033
|
* @param {Slide} slide
|
|
1041
1034
|
*/
|
|
@@ -1090,8 +1083,8 @@ class Ze {
|
|
|
1090
1083
|
return U(e, this.max[t], this.min[t]);
|
|
1091
1084
|
}
|
|
1092
1085
|
}
|
|
1093
|
-
const
|
|
1094
|
-
let
|
|
1086
|
+
const vt = 4e3;
|
|
1087
|
+
let Ft = class {
|
|
1095
1088
|
/**
|
|
1096
1089
|
* @param {PhotoSwipeOptions} options PhotoSwipe options
|
|
1097
1090
|
* @param {SlideData} itemData Slide data
|
|
@@ -1148,7 +1141,7 @@ let Zt = class {
|
|
|
1148
1141
|
*/
|
|
1149
1142
|
_getSecondary() {
|
|
1150
1143
|
let t = this._parseZoomLevelOption("secondary");
|
|
1151
|
-
return t || (t = Math.min(1, this.fit * 3), this.elementSize && t * this.elementSize.x >
|
|
1144
|
+
return t || (t = Math.min(1, this.fit * 3), this.elementSize && t * this.elementSize.x > vt && (t = vt / this.elementSize.x), t);
|
|
1152
1145
|
}
|
|
1153
1146
|
/**
|
|
1154
1147
|
* Get initial image zoom level.
|
|
@@ -1171,7 +1164,7 @@ let Zt = class {
|
|
|
1171
1164
|
return this._parseZoomLevelOption("max") || Math.max(1, this.fit * 4);
|
|
1172
1165
|
}
|
|
1173
1166
|
};
|
|
1174
|
-
class
|
|
1167
|
+
class Ze {
|
|
1175
1168
|
/**
|
|
1176
1169
|
* @param {SlideData} data
|
|
1177
1170
|
* @param {number} index
|
|
@@ -1184,11 +1177,11 @@ class ke {
|
|
|
1184
1177
|
}, this.pan = {
|
|
1185
1178
|
x: 0,
|
|
1186
1179
|
y: 0
|
|
1187
|
-
}, this.isFirstSlide = this.isActive && !i.opener.isOpen, this.zoomLevels = new
|
|
1180
|
+
}, this.isFirstSlide = this.isActive && !i.opener.isOpen, this.zoomLevels = new Ft(i.options, t, e, i), this.pswp.dispatch("gettingData", {
|
|
1188
1181
|
slide: this,
|
|
1189
1182
|
data: this.data,
|
|
1190
1183
|
index: e
|
|
1191
|
-
}), this.content = this.pswp.contentLoader.getContentBySlide(this), this.container = x("pswp__zoom-wrap", "div"), this.holderElement = null, this.currZoomLevel = 1, this.width = this.content.width, this.height = this.content.height, this.heavyAppended = !1, this.bounds = new
|
|
1184
|
+
}), this.content = this.pswp.contentLoader.getContentBySlide(this), this.container = x("pswp__zoom-wrap", "div"), this.holderElement = null, this.currZoomLevel = 1, this.width = this.content.width, this.height = this.content.height, this.heavyAppended = !1, this.bounds = new Fe(this), this.prevDisplayedWidth = -1, this.prevDisplayedHeight = -1, this.pswp.dispatch("slideInit", {
|
|
1192
1185
|
slide: this
|
|
1193
1186
|
});
|
|
1194
1187
|
}
|
|
@@ -1312,7 +1305,7 @@ class ke {
|
|
|
1312
1305
|
transitionDuration: i
|
|
1313
1306
|
}), o.animations.stopAllPan();
|
|
1314
1307
|
const r = this.currZoomLevel;
|
|
1315
|
-
n || (t = U(t, this.zoomLevels.min, this.zoomLevels.max)), this.setZoomLevel(t), this.pan.x = this.calculateZoomToPanOffset("x", e, r), this.pan.y = this.calculateZoomToPanOffset("y", e, r),
|
|
1308
|
+
n || (t = U(t, this.zoomLevels.min, this.zoomLevels.max)), this.setZoomLevel(t), this.pan.x = this.calculateZoomToPanOffset("x", e, r), this.pan.y = this.calculateZoomToPanOffset("y", e, r), Ot(this.pan);
|
|
1316
1309
|
const a = () => {
|
|
1317
1310
|
this._setResolution(t), this.applyCurrentZoomPan();
|
|
1318
1311
|
};
|
|
@@ -1413,7 +1406,7 @@ class ke {
|
|
|
1413
1406
|
const {
|
|
1414
1407
|
pswp: t
|
|
1415
1408
|
} = this;
|
|
1416
|
-
S(this.panAreaSize,
|
|
1409
|
+
S(this.panAreaSize, Bt(t.options, t.viewportSize, this.data, this.index)), this.zoomLevels.update(this.width, this.height, this.panAreaSize), t.dispatch("calcSlideSize", {
|
|
1417
1410
|
slide: this
|
|
1418
1411
|
});
|
|
1419
1412
|
}
|
|
@@ -1441,11 +1434,11 @@ class ke {
|
|
|
1441
1434
|
t !== this.currentResolution && (this.currentResolution = t, this.updateContentSize(), this.pswp.dispatch("resolutionChanged"));
|
|
1442
1435
|
}
|
|
1443
1436
|
}
|
|
1444
|
-
const
|
|
1445
|
-
function
|
|
1437
|
+
const ke = 0.35, qe = 0.6, yt = 0.4, _t = 0.5;
|
|
1438
|
+
function Ne(s, t) {
|
|
1446
1439
|
return s * t / (1 - t);
|
|
1447
1440
|
}
|
|
1448
|
-
class
|
|
1441
|
+
class He {
|
|
1449
1442
|
/**
|
|
1450
1443
|
* @param {Gestures} gestures
|
|
1451
1444
|
*/
|
|
@@ -1471,12 +1464,12 @@ class We {
|
|
|
1471
1464
|
if (!this.pswp.dispatch("verticalDrag", {
|
|
1472
1465
|
panY: o
|
|
1473
1466
|
}).defaultPrevented) {
|
|
1474
|
-
this._setPanWithFriction("y", o,
|
|
1467
|
+
this._setPanWithFriction("y", o, qe);
|
|
1475
1468
|
const r = 1 - Math.abs(this._getVerticalDragRatio(n.pan.y));
|
|
1476
1469
|
this.pswp.applyBgOpacity(r), n.applyCurrentZoomPan();
|
|
1477
1470
|
}
|
|
1478
1471
|
} else
|
|
1479
|
-
this._panOrMoveMainScroll("x") || (this._panOrMoveMainScroll("y"), n && (
|
|
1472
|
+
this._panOrMoveMainScroll("x") || (this._panOrMoveMainScroll("y"), n && (Ot(n.pan), n.applyCurrentZoomPan()));
|
|
1480
1473
|
}
|
|
1481
1474
|
end() {
|
|
1482
1475
|
const {
|
|
@@ -1488,7 +1481,7 @@ class We {
|
|
|
1488
1481
|
let n = 0;
|
|
1489
1482
|
if (this.pswp.animations.stopAll(), e.isShifted()) {
|
|
1490
1483
|
const r = (e.x - e.getCurrSlideX()) / this.pswp.viewportSize.x;
|
|
1491
|
-
t.x < -
|
|
1484
|
+
t.x < -_t && r < 0 || t.x < 0.1 && r < -0.5 ? (n = 1, t.x = Math.min(t.x, 0)) : (t.x > _t && r > 0 || t.x > -0.1 && r > 0.5) && (n = -1, t.x = Math.max(t.x, 0)), e.moveIndexBy(n, !0, t.x);
|
|
1492
1485
|
}
|
|
1493
1486
|
i && i.currZoomLevel > i.zoomLevels.max || this.gestures.isMultitouch ? this.gestures.zoomLevels.correctZoomPan(!0) : (this._finishPanGestureForAxis("x"), this._finishPanGestureForAxis("y"));
|
|
1494
1487
|
}
|
|
@@ -1507,10 +1500,10 @@ class We {
|
|
|
1507
1500
|
const {
|
|
1508
1501
|
pan: n,
|
|
1509
1502
|
bounds: o
|
|
1510
|
-
} = i, r = n[t], a = this.pswp.bgOpacity < 1 && t === "y", c = r +
|
|
1503
|
+
} = i, r = n[t], a = this.pswp.bgOpacity < 1 && t === "y", c = r + Ne(e[t], 0.995);
|
|
1511
1504
|
if (a) {
|
|
1512
1505
|
const m = this._getVerticalDragRatio(r), p = this._getVerticalDragRatio(c);
|
|
1513
|
-
if (m < 0 && p < -
|
|
1506
|
+
if (m < 0 && p < -yt || m > 0 && p > yt) {
|
|
1514
1507
|
this.pswp.close();
|
|
1515
1508
|
return;
|
|
1516
1509
|
}
|
|
@@ -1622,16 +1615,16 @@ class We {
|
|
|
1622
1615
|
} = n;
|
|
1623
1616
|
if (r.correctPan(t, e) !== e || i) {
|
|
1624
1617
|
const l = Math.round(e - o[t]);
|
|
1625
|
-
o[t] += l * (i ||
|
|
1618
|
+
o[t] += l * (i || ke);
|
|
1626
1619
|
} else
|
|
1627
1620
|
o[t] = e;
|
|
1628
1621
|
}
|
|
1629
1622
|
}
|
|
1630
|
-
const
|
|
1631
|
-
function
|
|
1623
|
+
const We = 0.05, Ve = 0.15;
|
|
1624
|
+
function wt(s, t, e) {
|
|
1632
1625
|
return s.x = (t.x + e.x) / 2, s.y = (t.y + e.y) / 2, s;
|
|
1633
1626
|
}
|
|
1634
|
-
class
|
|
1627
|
+
class je {
|
|
1635
1628
|
/**
|
|
1636
1629
|
* @param {Gestures} gestures
|
|
1637
1630
|
*/
|
|
@@ -1668,8 +1661,8 @@ class Ge {
|
|
|
1668
1661
|
const a = r.zoomLevels.min, l = r.zoomLevels.max;
|
|
1669
1662
|
if (!r.isZoomable() || o.mainScroll.isShifted())
|
|
1670
1663
|
return;
|
|
1671
|
-
|
|
1672
|
-
let c = 1 /
|
|
1664
|
+
wt(this._startZoomPoint, e, n), wt(this._zoomPoint, t, i);
|
|
1665
|
+
let c = 1 / st(e, n) * st(t, i) * this._startZoomLevel;
|
|
1673
1666
|
if (c > r.zoomLevels.initial + r.zoomLevels.initial / 15 && (this._wasOverFitZoomLevel = !0), c < a)
|
|
1674
1667
|
if (o.options.pinchToClose && !this._wasOverFitZoomLevel && this._startZoomLevel <= r.zoomLevels.initial) {
|
|
1675
1668
|
const d = 1 - (a - c) / (a / 1.2);
|
|
@@ -1677,8 +1670,8 @@ class Ge {
|
|
|
1677
1670
|
bgOpacity: d
|
|
1678
1671
|
}).defaultPrevented || o.applyBgOpacity(d);
|
|
1679
1672
|
} else
|
|
1680
|
-
c = a - (a - c) *
|
|
1681
|
-
else c > l && (c = l + (c - l) *
|
|
1673
|
+
c = a - (a - c) * Ve;
|
|
1674
|
+
else c > l && (c = l + (c - l) * We);
|
|
1682
1675
|
r.pan.x = this._calculatePanForZoomLevel("x", c), r.pan.y = this._calculatePanForZoomLevel("y", c), r.setZoomLevel(c), r.applyCurrentZoomPan();
|
|
1683
1676
|
}
|
|
1684
1677
|
end() {
|
|
@@ -1762,11 +1755,11 @@ class Ge {
|
|
|
1762
1755
|
});
|
|
1763
1756
|
}
|
|
1764
1757
|
}
|
|
1765
|
-
function
|
|
1758
|
+
function bt(s) {
|
|
1766
1759
|
return !!/** @type {HTMLElement} */
|
|
1767
1760
|
s.target.closest(".pswp__container");
|
|
1768
1761
|
}
|
|
1769
|
-
class
|
|
1762
|
+
class Ge {
|
|
1770
1763
|
/**
|
|
1771
1764
|
* @param {Gestures} gestures
|
|
1772
1765
|
*/
|
|
@@ -1789,14 +1782,14 @@ class Ue {
|
|
|
1789
1782
|
* @param {PointerEvent} originalEvent
|
|
1790
1783
|
*/
|
|
1791
1784
|
tap(t, e) {
|
|
1792
|
-
|
|
1785
|
+
bt(e) && this._doClickOrTapAction("tap", t, e);
|
|
1793
1786
|
}
|
|
1794
1787
|
/**
|
|
1795
1788
|
* @param {Point} point
|
|
1796
1789
|
* @param {PointerEvent} originalEvent
|
|
1797
1790
|
*/
|
|
1798
1791
|
doubleTap(t, e) {
|
|
1799
|
-
|
|
1792
|
+
bt(e) && this._doClickOrTapAction("doubleTap", t, e);
|
|
1800
1793
|
}
|
|
1801
1794
|
/**
|
|
1802
1795
|
* @private
|
|
@@ -1840,8 +1833,8 @@ class Ue {
|
|
|
1840
1833
|
}
|
|
1841
1834
|
}
|
|
1842
1835
|
}
|
|
1843
|
-
const
|
|
1844
|
-
class
|
|
1836
|
+
const Ue = 10, Ke = 300, Xe = 25;
|
|
1837
|
+
class Ye {
|
|
1845
1838
|
/**
|
|
1846
1839
|
* @param {PhotoSwipe} pswp
|
|
1847
1840
|
*/
|
|
@@ -1873,7 +1866,7 @@ class Je {
|
|
|
1873
1866
|
}, this._intervalP1 = {
|
|
1874
1867
|
x: 0,
|
|
1875
1868
|
y: 0
|
|
1876
|
-
}, 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
|
|
1869
|
+
}, 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 He(this), this.zoomLevels = new je(this), this.tapHandler = new Ge(this), t.on("bindEvents", () => {
|
|
1877
1870
|
t.events.add(
|
|
1878
1871
|
t.scrollWrap,
|
|
1879
1872
|
"click",
|
|
@@ -1993,8 +1986,8 @@ class Je {
|
|
|
1993
1986
|
this.tapHandler.click(this.startP1, t);
|
|
1994
1987
|
return;
|
|
1995
1988
|
}
|
|
1996
|
-
const i = this.pswp.options.doubleTapAction ?
|
|
1997
|
-
this._tapTimer ? (this._clearTapTimer(),
|
|
1989
|
+
const i = this.pswp.options.doubleTapAction ? Ke : 0;
|
|
1990
|
+
this._tapTimer ? (this._clearTapTimer(), st(this._lastStartP1, this.startP1) < Xe && this.tapHandler.doubleTap(this.startP1, t)) : (S(this._lastStartP1, this.startP1), this._tapTimer = setTimeout(() => {
|
|
1998
1991
|
this.tapHandler.tap(this.startP1, t), this._clearTapTimer();
|
|
1999
1992
|
}, i));
|
|
2000
1993
|
}
|
|
@@ -2080,7 +2073,7 @@ class Je {
|
|
|
2080
2073
|
const t = Math.abs(this.p1.x - this.startP1.x) - Math.abs(this.p1.y - this.startP1.y);
|
|
2081
2074
|
if (t !== 0) {
|
|
2082
2075
|
const e = t > 0 ? "x" : "y";
|
|
2083
|
-
Math.abs(this.p1[e] - this.startP1[e]) >=
|
|
2076
|
+
Math.abs(this.p1[e] - this.startP1[e]) >= Ue && (this.dragAxis = e);
|
|
2084
2077
|
}
|
|
2085
2078
|
}
|
|
2086
2079
|
}
|
|
@@ -2104,8 +2097,8 @@ class Je {
|
|
|
2104
2097
|
this.pswp.mainScroll.isShifted() && (t.preventDefault(), t.stopPropagation());
|
|
2105
2098
|
}
|
|
2106
2099
|
}
|
|
2107
|
-
const
|
|
2108
|
-
class
|
|
2100
|
+
const Je = 0.35;
|
|
2101
|
+
class Qe {
|
|
2109
2102
|
/**
|
|
2110
2103
|
* @param {PhotoSwipe} pswp
|
|
2111
2104
|
*/
|
|
@@ -2258,7 +2251,7 @@ class ti {
|
|
|
2258
2251
|
let i = (this.slideWidth * this._currPositionIndex - t) / this.slideWidth;
|
|
2259
2252
|
i += this.pswp.currIndex;
|
|
2260
2253
|
const n = Math.round(t - this.x);
|
|
2261
|
-
(i < 0 && n > 0 || i >= this.pswp.getNumItems() - 1 && n < 0) && (t = this.x + n *
|
|
2254
|
+
(i < 0 && n > 0 || i >= this.pswp.getNumItems() - 1 && n < 0) && (t = this.x + n * Je);
|
|
2262
2255
|
}
|
|
2263
2256
|
this.x = t, this.pswp.container && D(this.pswp.container, t), this.pswp.dispatch("moveMainScroll", {
|
|
2264
2257
|
x: t,
|
|
@@ -2266,7 +2259,7 @@ class ti {
|
|
|
2266
2259
|
});
|
|
2267
2260
|
}
|
|
2268
2261
|
}
|
|
2269
|
-
const
|
|
2262
|
+
const ti = {
|
|
2270
2263
|
Escape: 27,
|
|
2271
2264
|
z: 90,
|
|
2272
2265
|
ArrowLeft: 37,
|
|
@@ -2274,8 +2267,8 @@ const ei = {
|
|
|
2274
2267
|
ArrowRight: 39,
|
|
2275
2268
|
ArrowDown: 40,
|
|
2276
2269
|
Tab: 9
|
|
2277
|
-
}, O = (s, t) => t ? s :
|
|
2278
|
-
class
|
|
2270
|
+
}, O = (s, t) => t ? s : ti[s];
|
|
2271
|
+
class ei {
|
|
2279
2272
|
/**
|
|
2280
2273
|
* @param {PhotoSwipe} pswp
|
|
2281
2274
|
*/
|
|
@@ -2315,7 +2308,7 @@ class ii {
|
|
|
2315
2308
|
} = this;
|
|
2316
2309
|
if (e.dispatch("keydown", {
|
|
2317
2310
|
originalEvent: t
|
|
2318
|
-
}).defaultPrevented ||
|
|
2311
|
+
}).defaultPrevented || $e(t))
|
|
2319
2312
|
return;
|
|
2320
2313
|
let i, n, o = !1;
|
|
2321
2314
|
const r = "key" in t;
|
|
@@ -2367,8 +2360,8 @@ class ii {
|
|
|
2367
2360
|
) && e.focus();
|
|
2368
2361
|
}
|
|
2369
2362
|
}
|
|
2370
|
-
const
|
|
2371
|
-
class
|
|
2363
|
+
const ii = "cubic-bezier(.4,0,.22,1)";
|
|
2364
|
+
class si {
|
|
2372
2365
|
/**
|
|
2373
2366
|
* onComplete can be unpredictable, be careful about current state
|
|
2374
2367
|
*
|
|
@@ -2384,12 +2377,12 @@ class ni {
|
|
|
2384
2377
|
onFinish: r = () => {
|
|
2385
2378
|
},
|
|
2386
2379
|
duration: a = 333,
|
|
2387
|
-
easing: l =
|
|
2380
|
+
easing: l = ii
|
|
2388
2381
|
} = t;
|
|
2389
2382
|
this.onFinish = r;
|
|
2390
2383
|
const c = o ? "transform" : "opacity", d = (e = t[c]) !== null && e !== void 0 ? e : "";
|
|
2391
2384
|
this._target = i, this._onComplete = n, this._finished = !1, this._onTransitionEnd = this._onTransitionEnd.bind(this), this._helperTimeout = setTimeout(() => {
|
|
2392
|
-
|
|
2385
|
+
Dt(i, c, a, l), this._helperTimeout = setTimeout(() => {
|
|
2393
2386
|
i.addEventListener("transitionend", this._onTransitionEnd, !1), i.addEventListener("transitioncancel", this._onTransitionEnd, !1), this._helperTimeout = setTimeout(() => {
|
|
2394
2387
|
this._finalizeAnimation();
|
|
2395
2388
|
}, a + 500), i.style[c] = d;
|
|
@@ -2411,11 +2404,11 @@ class ni {
|
|
|
2411
2404
|
}
|
|
2412
2405
|
// Destroy is called automatically onFinish
|
|
2413
2406
|
destroy() {
|
|
2414
|
-
this._helperTimeout && clearTimeout(this._helperTimeout),
|
|
2407
|
+
this._helperTimeout && clearTimeout(this._helperTimeout), Oe(this._target), this._target.removeEventListener("transitionend", this._onTransitionEnd, !1), this._target.removeEventListener("transitioncancel", this._onTransitionEnd, !1), this._finished || this._finalizeAnimation();
|
|
2415
2408
|
}
|
|
2416
2409
|
}
|
|
2417
|
-
const
|
|
2418
|
-
class
|
|
2410
|
+
const ni = 12, oi = 0.75;
|
|
2411
|
+
class ri {
|
|
2419
2412
|
/**
|
|
2420
2413
|
* @param {number} initialVelocity Initial velocity, px per ms.
|
|
2421
2414
|
*
|
|
@@ -2432,7 +2425,7 @@ class ai {
|
|
|
2432
2425
|
* Recommended value from 10 to 50
|
|
2433
2426
|
*/
|
|
2434
2427
|
constructor(t, e, i) {
|
|
2435
|
-
this.velocity = t * 1e3, this._dampingRatio = e ||
|
|
2428
|
+
this.velocity = t * 1e3, this._dampingRatio = e || oi, this._naturalFrequency = i || ni, this._dampedFrequency = this._naturalFrequency, this._dampingRatio < 1 && (this._dampedFrequency *= Math.sqrt(1 - this._dampingRatio * this._dampingRatio));
|
|
2436
2429
|
}
|
|
2437
2430
|
/**
|
|
2438
2431
|
* @param {number} deltaPosition Difference between current and end position of the animation
|
|
@@ -2454,7 +2447,7 @@ class ai {
|
|
|
2454
2447
|
return i;
|
|
2455
2448
|
}
|
|
2456
2449
|
}
|
|
2457
|
-
class
|
|
2450
|
+
class ai {
|
|
2458
2451
|
/**
|
|
2459
2452
|
* @param {SpringAnimationProps} props
|
|
2460
2453
|
*/
|
|
@@ -2472,7 +2465,7 @@ class li {
|
|
|
2472
2465
|
naturalFrequency: c
|
|
2473
2466
|
} = t;
|
|
2474
2467
|
this.onFinish = a;
|
|
2475
|
-
const d = new
|
|
2468
|
+
const d = new ri(n, l, c);
|
|
2476
2469
|
let h = Date.now(), u = e - i;
|
|
2477
2470
|
const f = () => {
|
|
2478
2471
|
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(f)));
|
|
@@ -2484,7 +2477,7 @@ class li {
|
|
|
2484
2477
|
this._raf >= 0 && cancelAnimationFrame(this._raf), this._raf = 0;
|
|
2485
2478
|
}
|
|
2486
2479
|
}
|
|
2487
|
-
class
|
|
2480
|
+
class li {
|
|
2488
2481
|
constructor() {
|
|
2489
2482
|
this.activeAnimations = [];
|
|
2490
2483
|
}
|
|
@@ -2507,10 +2500,10 @@ class ci {
|
|
|
2507
2500
|
* @returns {Animation}
|
|
2508
2501
|
*/
|
|
2509
2502
|
_start(t, e) {
|
|
2510
|
-
const i = e ? new
|
|
2503
|
+
const i = e ? new ai(
|
|
2511
2504
|
/** @type SpringAnimationProps */
|
|
2512
2505
|
t
|
|
2513
|
-
) : new
|
|
2506
|
+
) : new si(
|
|
2514
2507
|
/** @type CssAnimationProps */
|
|
2515
2508
|
t
|
|
2516
2509
|
);
|
|
@@ -2553,7 +2546,7 @@ class ci {
|
|
|
2553
2546
|
return this.activeAnimations.some((t) => t.props.isPan);
|
|
2554
2547
|
}
|
|
2555
2548
|
}
|
|
2556
|
-
class
|
|
2549
|
+
class ci {
|
|
2557
2550
|
/**
|
|
2558
2551
|
* @param {PhotoSwipe} pswp
|
|
2559
2552
|
*/
|
|
@@ -2595,7 +2588,7 @@ class di {
|
|
|
2595
2588
|
e.isPannable() && (t.deltaMode === 1 && (i *= 18, n *= 18), e.panTo(e.pan.x - i, e.pan.y - n));
|
|
2596
2589
|
}
|
|
2597
2590
|
}
|
|
2598
|
-
function
|
|
2591
|
+
function di(s) {
|
|
2599
2592
|
if (typeof s == "string")
|
|
2600
2593
|
return s;
|
|
2601
2594
|
if (!s || !s.isCustomSVG)
|
|
@@ -2607,7 +2600,7 @@ function hi(s) {
|
|
|
2607
2600
|
t.size || 32
|
|
2608
2601
|
), t.outlineID && (e += '<use class="pswp__icn-shadow" xlink:href="#' + t.outlineID + '"/>'), e += t.inner, e += "</svg>", e;
|
|
2609
2602
|
}
|
|
2610
|
-
class
|
|
2603
|
+
class hi {
|
|
2611
2604
|
/**
|
|
2612
2605
|
* @param {PhotoSwipe} pswp
|
|
2613
2606
|
* @param {UIElementData} data
|
|
@@ -2639,7 +2632,7 @@ class ui {
|
|
|
2639
2632
|
const f = u || h;
|
|
2640
2633
|
f && l.setAttribute("aria-label", f);
|
|
2641
2634
|
}
|
|
2642
|
-
l.innerHTML =
|
|
2635
|
+
l.innerHTML = di(o), e.onInit && e.onInit(l, t), e.onClick && (l.onclick = (h) => {
|
|
2643
2636
|
typeof e.onClick == "string" ? t[e.onClick]() : typeof e.onClick == "function" && e.onClick(h, l, t);
|
|
2644
2637
|
});
|
|
2645
2638
|
const c = e.appendTo || "bar";
|
|
@@ -2647,12 +2640,12 @@ class ui {
|
|
|
2647
2640
|
c === "bar" ? (t.topBar || (t.topBar = x("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));
|
|
2648
2641
|
}
|
|
2649
2642
|
}
|
|
2650
|
-
function
|
|
2643
|
+
function Zt(s, t, e) {
|
|
2651
2644
|
s.classList.add("pswp__button--arrow"), s.setAttribute("aria-controls", "pswp__items"), t.on("change", () => {
|
|
2652
2645
|
t.options.loop || (e ? s.disabled = !(t.currIndex < t.getNumItems() - 1) : s.disabled = !(t.currIndex > 0));
|
|
2653
2646
|
});
|
|
2654
2647
|
}
|
|
2655
|
-
const
|
|
2648
|
+
const ui = {
|
|
2656
2649
|
name: "arrowPrev",
|
|
2657
2650
|
className: "pswp__button--arrow--prev",
|
|
2658
2651
|
title: "Previous",
|
|
@@ -2666,8 +2659,8 @@ const pi = {
|
|
|
2666
2659
|
outlineID: "pswp__icn-arrow"
|
|
2667
2660
|
},
|
|
2668
2661
|
onClick: "prev",
|
|
2669
|
-
onInit:
|
|
2670
|
-
},
|
|
2662
|
+
onInit: Zt
|
|
2663
|
+
}, pi = {
|
|
2671
2664
|
name: "arrowNext",
|
|
2672
2665
|
className: "pswp__button--arrow--next",
|
|
2673
2666
|
title: "Next",
|
|
@@ -2682,9 +2675,9 @@ const pi = {
|
|
|
2682
2675
|
},
|
|
2683
2676
|
onClick: "next",
|
|
2684
2677
|
onInit: (s, t) => {
|
|
2685
|
-
|
|
2678
|
+
Zt(s, t, !0);
|
|
2686
2679
|
}
|
|
2687
|
-
},
|
|
2680
|
+
}, mi = {
|
|
2688
2681
|
name: "close",
|
|
2689
2682
|
title: "Close",
|
|
2690
2683
|
order: 20,
|
|
@@ -2695,7 +2688,7 @@ const pi = {
|
|
|
2695
2688
|
outlineID: "pswp__icn-close"
|
|
2696
2689
|
},
|
|
2697
2690
|
onClick: "close"
|
|
2698
|
-
},
|
|
2691
|
+
}, fi = {
|
|
2699
2692
|
name: "zoom",
|
|
2700
2693
|
title: "Zoom",
|
|
2701
2694
|
order: 10,
|
|
@@ -2707,7 +2700,7 @@ const pi = {
|
|
|
2707
2700
|
outlineID: "pswp__icn-zoom"
|
|
2708
2701
|
},
|
|
2709
2702
|
onClick: "toggleZoom"
|
|
2710
|
-
},
|
|
2703
|
+
}, gi = {
|
|
2711
2704
|
name: "preloader",
|
|
2712
2705
|
appendTo: "bar",
|
|
2713
2706
|
order: 7,
|
|
@@ -2738,7 +2731,7 @@ const pi = {
|
|
|
2738
2731
|
t.currSlide === a.slide && r();
|
|
2739
2732
|
}), t.ui && (t.ui.updatePreloaderVisibility = r);
|
|
2740
2733
|
}
|
|
2741
|
-
},
|
|
2734
|
+
}, vi = {
|
|
2742
2735
|
name: "counter",
|
|
2743
2736
|
order: 5,
|
|
2744
2737
|
onInit: (s, t) => {
|
|
@@ -2747,10 +2740,10 @@ const pi = {
|
|
|
2747
2740
|
});
|
|
2748
2741
|
}
|
|
2749
2742
|
};
|
|
2750
|
-
function
|
|
2743
|
+
function St(s, t) {
|
|
2751
2744
|
s.classList.toggle("pswp--zoomed-in", t);
|
|
2752
2745
|
}
|
|
2753
|
-
class
|
|
2746
|
+
class yi {
|
|
2754
2747
|
/**
|
|
2755
2748
|
* @param {PhotoSwipe} pswp
|
|
2756
2749
|
*/
|
|
@@ -2762,7 +2755,7 @@ class _i {
|
|
|
2762
2755
|
const {
|
|
2763
2756
|
pswp: t
|
|
2764
2757
|
} = this;
|
|
2765
|
-
this.isRegistered = !1, this.uiElementsData = [
|
|
2758
|
+
this.isRegistered = !1, this.uiElementsData = [mi, ui, pi, fi, gi, vi], t.dispatch("uiRegister"), this.uiElementsData.sort((e, i) => (e.order || 0) - (i.order || 0)), this.items = [], this.isRegistered = !0, this.uiElementsData.forEach((e) => {
|
|
2766
2759
|
this.registerElement(e);
|
|
2767
2760
|
}), t.on("change", () => {
|
|
2768
2761
|
var e;
|
|
@@ -2773,7 +2766,7 @@ class _i {
|
|
|
2773
2766
|
* @param {UIElementData} elementData
|
|
2774
2767
|
*/
|
|
2775
2768
|
registerElement(t) {
|
|
2776
|
-
this.isRegistered ? this.items.push(new
|
|
2769
|
+
this.isRegistered ? this.items.push(new hi(this.pswp, t)) : this.uiElementsData.push(t);
|
|
2777
2770
|
}
|
|
2778
2771
|
/**
|
|
2779
2772
|
* Fired each time zoom or pan position is changed.
|
|
@@ -2797,15 +2790,15 @@ class _i {
|
|
|
2797
2790
|
this._lastUpdatedZoomLevel = n;
|
|
2798
2791
|
const o = e.zoomLevels.initial - e.zoomLevels.secondary;
|
|
2799
2792
|
if (Math.abs(o) < 0.01 || !e.isZoomable()) {
|
|
2800
|
-
|
|
2793
|
+
St(t, !1), t.classList.remove("pswp--zoom-allowed");
|
|
2801
2794
|
return;
|
|
2802
2795
|
}
|
|
2803
2796
|
t.classList.add("pswp--zoom-allowed");
|
|
2804
2797
|
const r = n === e.zoomLevels.initial ? e.zoomLevels.secondary : e.zoomLevels.initial;
|
|
2805
|
-
|
|
2798
|
+
St(t, r <= n), (i.imageClickAction === "zoom" || i.imageClickAction === "zoom-or-close") && t.classList.add("pswp--click-to-zoom");
|
|
2806
2799
|
}
|
|
2807
2800
|
}
|
|
2808
|
-
function
|
|
2801
|
+
function _i(s) {
|
|
2809
2802
|
const t = s.getBoundingClientRect();
|
|
2810
2803
|
return {
|
|
2811
2804
|
x: t.left,
|
|
@@ -2813,7 +2806,7 @@ function wi(s) {
|
|
|
2813
2806
|
w: t.width
|
|
2814
2807
|
};
|
|
2815
2808
|
}
|
|
2816
|
-
function
|
|
2809
|
+
function wi(s, t, e) {
|
|
2817
2810
|
const i = s.getBoundingClientRect(), n = i.width / t, o = i.height / e, r = n > o ? n : o, a = (i.width - t * r) / 2, l = (i.height - e * r) / 2, c = {
|
|
2818
2811
|
x: i.left + a,
|
|
2819
2812
|
y: i.top + l,
|
|
@@ -2826,7 +2819,7 @@ function bi(s, t, e) {
|
|
|
2826
2819
|
y: l
|
|
2827
2820
|
}, c;
|
|
2828
2821
|
}
|
|
2829
|
-
function
|
|
2822
|
+
function bi(s, t, e) {
|
|
2830
2823
|
const i = e.dispatch("thumbBounds", {
|
|
2831
2824
|
index: s,
|
|
2832
2825
|
itemData: t,
|
|
@@ -2845,9 +2838,9 @@ function Si(s, t, e) {
|
|
|
2845
2838
|
n.querySelector(a)
|
|
2846
2839
|
);
|
|
2847
2840
|
}
|
|
2848
|
-
return r = e.applyFilters("thumbEl", r, t, s), r && (t.thumbCropped ? o =
|
|
2841
|
+
return r = e.applyFilters("thumbEl", r, t, s), r && (t.thumbCropped ? o = wi(r, t.width || t.w || 0, t.height || t.h || 0) : o = _i(r)), e.applyFilters("thumbBounds", o, t, s);
|
|
2849
2842
|
}
|
|
2850
|
-
let
|
|
2843
|
+
let Si = class {
|
|
2851
2844
|
/**
|
|
2852
2845
|
* @param {T} type
|
|
2853
2846
|
* @param {PhotoSwipeEventsMap[T]} [details]
|
|
@@ -2858,7 +2851,7 @@ let Li = class {
|
|
|
2858
2851
|
preventDefault() {
|
|
2859
2852
|
this.defaultPrevented = !0;
|
|
2860
2853
|
}
|
|
2861
|
-
},
|
|
2854
|
+
}, Li = class {
|
|
2862
2855
|
constructor() {
|
|
2863
2856
|
this._listeners = {}, this._filters = {}, this.pswp = void 0, this.options = void 0;
|
|
2864
2857
|
}
|
|
@@ -2925,13 +2918,13 @@ let Li = class {
|
|
|
2925
2918
|
return this.pswp.dispatch(t, e);
|
|
2926
2919
|
const n = (
|
|
2927
2920
|
/** @type {AugmentedEvent<T>} */
|
|
2928
|
-
new
|
|
2921
|
+
new Si(t, e)
|
|
2929
2922
|
);
|
|
2930
2923
|
return (i = this._listeners[t]) === null || i === void 0 || i.forEach((o) => {
|
|
2931
2924
|
o.call(this, n);
|
|
2932
2925
|
}), n;
|
|
2933
2926
|
}
|
|
2934
|
-
},
|
|
2927
|
+
}, Ai = class {
|
|
2935
2928
|
/**
|
|
2936
2929
|
* @param {string | false} imageSrc
|
|
2937
2930
|
* @param {HTMLElement} container
|
|
@@ -2951,13 +2944,13 @@ let Li = class {
|
|
|
2951
2944
|
* @param {number} height
|
|
2952
2945
|
*/
|
|
2953
2946
|
setDisplayedSize(t, e) {
|
|
2954
|
-
this.element && (this.element.tagName === "IMG" ? (
|
|
2947
|
+
this.element && (this.element.tagName === "IMG" ? (nt(this.element, 250, "auto"), this.element.style.transformOrigin = "0 0", this.element.style.transform = G(0, 0, t / 250)) : nt(this.element, t, e));
|
|
2955
2948
|
}
|
|
2956
2949
|
destroy() {
|
|
2957
2950
|
var t;
|
|
2958
2951
|
(t = this.element) !== null && t !== void 0 && t.parentNode && this.element.remove(), this.element = null;
|
|
2959
2952
|
}
|
|
2960
|
-
},
|
|
2953
|
+
}, Ei = class {
|
|
2961
2954
|
/**
|
|
2962
2955
|
* @param {SlideData} itemData Slide data
|
|
2963
2956
|
* @param {PhotoSwipeBase} instance PhotoSwipe or PhotoSwipeLightbox instance
|
|
@@ -2992,7 +2985,7 @@ let Li = class {
|
|
|
2992
2985
|
this.data.msrc && this.slide.isFirstSlide ? this.data.msrc : !1,
|
|
2993
2986
|
this
|
|
2994
2987
|
);
|
|
2995
|
-
this.placeholder = new
|
|
2988
|
+
this.placeholder = new Ai(i, this.slide.container);
|
|
2996
2989
|
}
|
|
2997
2990
|
this.element && !e || this.instance.dispatch("contentLoad", {
|
|
2998
2991
|
content: this,
|
|
@@ -3080,7 +3073,7 @@ let Li = class {
|
|
|
3080
3073
|
content: this,
|
|
3081
3074
|
width: t,
|
|
3082
3075
|
height: e
|
|
3083
|
-
}).defaultPrevented && (
|
|
3076
|
+
}).defaultPrevented && (nt(this.element, t, e), this.isImageContent() && !this.isError()))) {
|
|
3084
3077
|
const i = !this.displayedImageWidth && t;
|
|
3085
3078
|
this.displayedImageWidth = t, this.displayedImageHeight = e, i ? this.loadImage(!1) : this.updateSrcsetSizes(), this.slide && this.instance.dispatch("imageSizeChange", {
|
|
3086
3079
|
slide: this.slide,
|
|
@@ -3162,7 +3155,7 @@ let Li = class {
|
|
|
3162
3155
|
}).defaultPrevented)
|
|
3163
3156
|
return;
|
|
3164
3157
|
const t = "decode" in this.element;
|
|
3165
|
-
this.isImageContent() ? t && this.slide && (!this.slide.isActive ||
|
|
3158
|
+
this.isImageContent() ? t && this.slide && (!this.slide.isActive || gt()) ? (this.isDecoding = !0, this.element.decode().catch(() => {
|
|
3166
3159
|
}).finally(() => {
|
|
3167
3160
|
this.isDecoding = !1, this.appendImage();
|
|
3168
3161
|
})) : this.appendImage() : this.slide && !this.element.parentNode && this.slide.container.appendChild(this.element);
|
|
@@ -3175,7 +3168,7 @@ let Li = class {
|
|
|
3175
3168
|
activate() {
|
|
3176
3169
|
this.instance.dispatch("contentActivate", {
|
|
3177
3170
|
content: this
|
|
3178
|
-
}).defaultPrevented || !this.slide || (this.isImageContent() && this.isDecoding && !
|
|
3171
|
+
}).defaultPrevented || !this.slide || (this.isImageContent() && this.isDecoding && !gt() ? this.appendImage() : this.isError() && this.load(!1, !0), this.slide.holderElement && this.slide.holderElement.setAttribute("aria-hidden", "false"));
|
|
3179
3172
|
}
|
|
3180
3173
|
/**
|
|
3181
3174
|
* Deactivate the content
|
|
@@ -3202,36 +3195,36 @@ let Li = class {
|
|
|
3202
3195
|
}).defaultPrevented || (this.slide && this.element && !this.element.parentNode && this.slide.container.appendChild(this.element), (this.state === P.LOADED || this.state === P.ERROR) && this.removePlaceholder()));
|
|
3203
3196
|
}
|
|
3204
3197
|
};
|
|
3205
|
-
const
|
|
3206
|
-
function
|
|
3198
|
+
const Ci = 5;
|
|
3199
|
+
function kt(s, t, e) {
|
|
3207
3200
|
const i = t.createContentFromData(s, e);
|
|
3208
3201
|
let n;
|
|
3209
3202
|
const {
|
|
3210
3203
|
options: o
|
|
3211
3204
|
} = t;
|
|
3212
3205
|
if (o) {
|
|
3213
|
-
n = new
|
|
3206
|
+
n = new Ft(o, s, -1);
|
|
3214
3207
|
let r;
|
|
3215
|
-
t.pswp ? r = t.pswp.viewportSize : r =
|
|
3216
|
-
const a =
|
|
3208
|
+
t.pswp ? r = t.pswp.viewportSize : r = Rt(o, t);
|
|
3209
|
+
const a = Bt(o, r, s, e);
|
|
3217
3210
|
n.update(i.width, i.height, a);
|
|
3218
3211
|
}
|
|
3219
3212
|
return i.lazyLoad(), n && i.setDisplayedSize(Math.ceil(i.width * n.initial), Math.ceil(i.height * n.initial)), i;
|
|
3220
3213
|
}
|
|
3221
|
-
function
|
|
3214
|
+
function xi(s, t) {
|
|
3222
3215
|
const e = t.getItemData(s);
|
|
3223
3216
|
if (!t.dispatch("lazyLoadSlide", {
|
|
3224
3217
|
index: s,
|
|
3225
3218
|
itemData: e
|
|
3226
3219
|
}).defaultPrevented)
|
|
3227
|
-
return
|
|
3220
|
+
return kt(e, t, s);
|
|
3228
3221
|
}
|
|
3229
|
-
class
|
|
3222
|
+
class Pi {
|
|
3230
3223
|
/**
|
|
3231
3224
|
* @param {PhotoSwipe} pswp
|
|
3232
3225
|
*/
|
|
3233
3226
|
constructor(t) {
|
|
3234
|
-
this.pswp = t, this.limit = Math.max(t.options.preload[0] + t.options.preload[1] + 1,
|
|
3227
|
+
this.pswp = t, this.limit = Math.max(t.options.preload[0] + t.options.preload[1] + 1, Ci), this._cachedItems = [];
|
|
3235
3228
|
}
|
|
3236
3229
|
/**
|
|
3237
3230
|
* Lazy load nearby slides based on `preload` option.
|
|
@@ -3259,7 +3252,7 @@ class Ti {
|
|
|
3259
3252
|
loadSlideByIndex(t) {
|
|
3260
3253
|
const e = this.pswp.getLoopedIndex(t);
|
|
3261
3254
|
let i = this.getContentByIndex(e);
|
|
3262
|
-
i || (i =
|
|
3255
|
+
i || (i = xi(e, this.pswp), i && this.addToCache(i));
|
|
3263
3256
|
}
|
|
3264
3257
|
/**
|
|
3265
3258
|
* @param {Slide} slide
|
|
@@ -3298,7 +3291,7 @@ class Ti {
|
|
|
3298
3291
|
this._cachedItems.forEach((t) => t.destroy()), this._cachedItems = [];
|
|
3299
3292
|
}
|
|
3300
3293
|
}
|
|
3301
|
-
let
|
|
3294
|
+
let Ti = class extends Li {
|
|
3302
3295
|
/**
|
|
3303
3296
|
* Get total number of slides
|
|
3304
3297
|
*
|
|
@@ -3321,7 +3314,7 @@ let Ii = class extends Ai {
|
|
|
3321
3314
|
* @returns {Content}
|
|
3322
3315
|
*/
|
|
3323
3316
|
createContentFromData(t, e) {
|
|
3324
|
-
return new
|
|
3317
|
+
return new Ei(t, this, e);
|
|
3325
3318
|
}
|
|
3326
3319
|
/**
|
|
3327
3320
|
* Get item data by index.
|
|
@@ -3355,7 +3348,7 @@ let Ii = class extends Ai {
|
|
|
3355
3348
|
*/
|
|
3356
3349
|
_getGalleryDOMElements(t) {
|
|
3357
3350
|
var e, i;
|
|
3358
|
-
return (e = this.options) !== null && e !== void 0 && e.children || (i = this.options) !== null && i !== void 0 && i.childSelector ?
|
|
3351
|
+
return (e = this.options) !== null && e !== void 0 && e.children || (i = this.options) !== null && i !== void 0 && i.childSelector ? Re(this.options.children, this.options.childSelector, t) || [] : [t];
|
|
3359
3352
|
}
|
|
3360
3353
|
/**
|
|
3361
3354
|
* Converts DOM element to item data object.
|
|
@@ -3389,11 +3382,11 @@ let Ii = class extends Ai {
|
|
|
3389
3382
|
* @returns {Content} Image that is being decoded or false.
|
|
3390
3383
|
*/
|
|
3391
3384
|
lazyLoadData(t, e) {
|
|
3392
|
-
return
|
|
3385
|
+
return kt(t, this, e);
|
|
3393
3386
|
}
|
|
3394
3387
|
};
|
|
3395
3388
|
const k = 3e-3;
|
|
3396
|
-
class
|
|
3389
|
+
class Ii {
|
|
3397
3390
|
/**
|
|
3398
3391
|
* @param {PhotoSwipe} pswp
|
|
3399
3392
|
*/
|
|
@@ -3446,7 +3439,7 @@ class Mi {
|
|
|
3446
3439
|
_start() {
|
|
3447
3440
|
this.isOpening && this._useAnimation && this._placeholder && this._placeholder.tagName === "IMG" ? new Promise((t) => {
|
|
3448
3441
|
let e = !1, i = !0;
|
|
3449
|
-
|
|
3442
|
+
De(
|
|
3450
3443
|
/** @type {HTMLImageElement} */
|
|
3451
3444
|
this._placeholder
|
|
3452
3445
|
).finally(() => {
|
|
@@ -3537,7 +3530,7 @@ class Mi {
|
|
|
3537
3530
|
o[e] = i, n.startTransition(o);
|
|
3538
3531
|
}
|
|
3539
3532
|
}
|
|
3540
|
-
const
|
|
3533
|
+
const Mi = {
|
|
3541
3534
|
allowPanToNext: !0,
|
|
3542
3535
|
spacing: 0.1,
|
|
3543
3536
|
loop: !0,
|
|
@@ -3564,7 +3557,7 @@ const zi = {
|
|
|
3564
3557
|
preload: [1, 2],
|
|
3565
3558
|
easing: "cubic-bezier(.4,0,.22,1)"
|
|
3566
3559
|
};
|
|
3567
|
-
class
|
|
3560
|
+
class zi extends Ti {
|
|
3568
3561
|
/**
|
|
3569
3562
|
* @param {PhotoSwipeOptions} [options]
|
|
3570
3563
|
*/
|
|
@@ -3578,7 +3571,7 @@ class Oi extends Ii {
|
|
|
3578
3571
|
}, this.viewportSize = {
|
|
3579
3572
|
x: 0,
|
|
3580
3573
|
y: 0
|
|
3581
|
-
}, 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
|
|
3574
|
+
}, 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 Be(), this.animations = new li(), this.mainScroll = new Qe(this), this.gestures = new Ye(this), this.opener = new Ii(this), this.keyboard = new ei(this), this.contentLoader = new Pi(this);
|
|
3582
3575
|
}
|
|
3583
3576
|
/** @returns {boolean} */
|
|
3584
3577
|
init() {
|
|
@@ -3586,7 +3579,7 @@ class Oi extends Ii {
|
|
|
3586
3579
|
return !1;
|
|
3587
3580
|
this.isOpen = !0, this.dispatch("init"), this.dispatch("beforeOpen"), this._createMainStructure();
|
|
3588
3581
|
let t = "pswp--open";
|
|
3589
|
-
return this.gestures.supportsTouch && (t += " pswp--touch"), this.options.mainClass && (t += " " + this.options.mainClass), this.element && (this.element.className += " " + t), this.currIndex = this.options.index || 0, this.potentialIndex = this.currIndex, this.dispatch("firstUpdate"), this.scrollWheel = new
|
|
3582
|
+
return this.gestures.supportsTouch && (t += " pswp--touch"), this.options.mainClass && (t += " " + this.options.mainClass), this.element && (this.element.className += " " + t), this.currIndex = this.options.index || 0, this.potentialIndex = this.currIndex, this.dispatch("firstUpdate"), this.scrollWheel = new ci(this), (Number.isNaN(this.currIndex) || this.currIndex < 0 || this.currIndex >= this.getNumItems()) && (this.currIndex = 0), this.gestures.supportsTouch || this.mouseDetected(), this.updateSize(), this.offset.y = window.pageYOffset, this._initialItemData = this.getItemData(this.currIndex), this.dispatch("gettingData", {
|
|
3590
3583
|
index: this.currIndex,
|
|
3591
3584
|
data: this._initialItemData,
|
|
3592
3585
|
slide: void 0
|
|
@@ -3705,7 +3698,7 @@ class Oi extends Ii {
|
|
|
3705
3698
|
if (!this.canLoop() && (e < 0 || e >= this.getNumItems()))
|
|
3706
3699
|
return;
|
|
3707
3700
|
const n = this.getItemData(e);
|
|
3708
|
-
t.slide = new
|
|
3701
|
+
t.slide = new Ze(n, e, this), e === this.currIndex && (this.currSlide = t.slide), t.slide.append(t.el);
|
|
3709
3702
|
}
|
|
3710
3703
|
/** @returns {Point} */
|
|
3711
3704
|
getViewportCenterPoint() {
|
|
@@ -3723,7 +3716,7 @@ class Oi extends Ii {
|
|
|
3723
3716
|
updateSize(t) {
|
|
3724
3717
|
if (this.isDestroying)
|
|
3725
3718
|
return;
|
|
3726
|
-
const e =
|
|
3719
|
+
const e = Rt(this.options, this);
|
|
3727
3720
|
!t && j(e, this._prevViewportSize) || (S(this._prevViewportSize, e), this.dispatch("beforeResize"), S(this.viewportSize, this._prevViewportSize), this._updatePageScrollOffset(), this.dispatch("viewportSize"), this.mainScroll.resize(this.opener.isOpen), !this.hasMouse && window.matchMedia("(any-hover: hover)").matches && this.mouseDetected(), this.dispatch("resize"));
|
|
3728
3721
|
}
|
|
3729
3722
|
/**
|
|
@@ -3775,7 +3768,7 @@ class Oi extends Ii {
|
|
|
3775
3768
|
* @private
|
|
3776
3769
|
*/
|
|
3777
3770
|
_createMainStructure() {
|
|
3778
|
-
this.element = x("pswp", "div"), this.element.setAttribute("tabindex", "-1"), this.element.setAttribute("role", "dialog"), this.template = this.element, this.bg = x("pswp__bg", "div", this.element), this.scrollWrap = x("pswp__scroll-wrap", "section", this.element), this.container = x("pswp__container", "div", this.scrollWrap), this.scrollWrap.setAttribute("aria-roledescription", "carousel"), this.container.setAttribute("aria-live", "off"), this.container.setAttribute("id", "pswp__items"), this.mainScroll.appendHolders(), this.ui = new
|
|
3771
|
+
this.element = x("pswp", "div"), this.element.setAttribute("tabindex", "-1"), this.element.setAttribute("role", "dialog"), this.template = this.element, this.bg = x("pswp__bg", "div", this.element), this.scrollWrap = x("pswp__scroll-wrap", "section", this.element), this.container = x("pswp__container", "div", this.scrollWrap), this.scrollWrap.setAttribute("aria-roledescription", "carousel"), this.container.setAttribute("aria-live", "off"), this.container.setAttribute("id", "pswp__items"), this.mainScroll.appendHolders(), this.ui = new yi(this), this.ui.init(), (this.options.appendToEl || document.body).appendChild(this.element);
|
|
3779
3772
|
}
|
|
3780
3773
|
/**
|
|
3781
3774
|
* Get position and dimensions of small thumbnail
|
|
@@ -3786,7 +3779,7 @@ class Oi extends Ii {
|
|
|
3786
3779
|
* @returns {Bounds | undefined}
|
|
3787
3780
|
*/
|
|
3788
3781
|
getThumbBounds() {
|
|
3789
|
-
return
|
|
3782
|
+
return bi(this.currIndex, this.currSlide ? this.currSlide.data : this._initialItemData, this);
|
|
3790
3783
|
}
|
|
3791
3784
|
/**
|
|
3792
3785
|
* If the PhotoSwipe can have continuous loop
|
|
@@ -3802,7 +3795,7 @@ class Oi extends Ii {
|
|
|
3802
3795
|
*/
|
|
3803
3796
|
_prepareOptions(t) {
|
|
3804
3797
|
return window.matchMedia("(prefers-reduced-motion), (update: slow)").matches && (t.showHideAnimationType = "none", t.zoomAnimationDuration = 0), {
|
|
3805
|
-
...
|
|
3798
|
+
...Mi,
|
|
3806
3799
|
...t
|
|
3807
3800
|
};
|
|
3808
3801
|
}
|
|
@@ -3811,11 +3804,11 @@ function N(s, t, e) {
|
|
|
3811
3804
|
const i = document.createElement(t);
|
|
3812
3805
|
return s && (i.className = s), e && e.appendChild(i), i;
|
|
3813
3806
|
}
|
|
3814
|
-
function
|
|
3807
|
+
function Oi(s, t, e) {
|
|
3815
3808
|
let i = `translate3d(${s}px,0px,0)`;
|
|
3816
3809
|
return e !== void 0 && (i += ` scale3d(${e},${e},1)`), i;
|
|
3817
3810
|
}
|
|
3818
|
-
function
|
|
3811
|
+
function ot(s, t, e) {
|
|
3819
3812
|
s.style.width = typeof t == "number" ? `${t}px` : t, s.style.height = typeof e == "number" ? `${e}px` : e;
|
|
3820
3813
|
}
|
|
3821
3814
|
const T = {
|
|
@@ -3824,7 +3817,7 @@ const T = {
|
|
|
3824
3817
|
LOADED: "loaded",
|
|
3825
3818
|
ERROR: "error"
|
|
3826
3819
|
};
|
|
3827
|
-
function
|
|
3820
|
+
function Di(s) {
|
|
3828
3821
|
return "button" in s && s.button === 1 || s.ctrlKey || s.metaKey || s.altKey || s.shiftKey;
|
|
3829
3822
|
}
|
|
3830
3823
|
function H(s, t, e = document) {
|
|
@@ -3839,13 +3832,13 @@ function H(s, t, e = document) {
|
|
|
3839
3832
|
}
|
|
3840
3833
|
return i;
|
|
3841
3834
|
}
|
|
3842
|
-
function
|
|
3835
|
+
function $i(s) {
|
|
3843
3836
|
return typeof s == "function" && s.prototype && s.prototype.goTo;
|
|
3844
3837
|
}
|
|
3845
|
-
function
|
|
3838
|
+
function Lt() {
|
|
3846
3839
|
return !!(navigator.vendor && navigator.vendor.match(/apple/i));
|
|
3847
3840
|
}
|
|
3848
|
-
class
|
|
3841
|
+
class Ri {
|
|
3849
3842
|
/**
|
|
3850
3843
|
* @param {T} type
|
|
3851
3844
|
* @param {PhotoSwipeEventsMap[T]} [details]
|
|
@@ -3857,7 +3850,7 @@ class Bi {
|
|
|
3857
3850
|
this.defaultPrevented = !0;
|
|
3858
3851
|
}
|
|
3859
3852
|
}
|
|
3860
|
-
class
|
|
3853
|
+
class Bi {
|
|
3861
3854
|
constructor() {
|
|
3862
3855
|
this._listeners = {}, this._filters = {}, this.pswp = void 0, this.options = void 0;
|
|
3863
3856
|
}
|
|
@@ -3924,14 +3917,14 @@ class Fi {
|
|
|
3924
3917
|
return this.pswp.dispatch(t, e);
|
|
3925
3918
|
const n = (
|
|
3926
3919
|
/** @type {AugmentedEvent<T>} */
|
|
3927
|
-
new
|
|
3920
|
+
new Ri(t, e)
|
|
3928
3921
|
);
|
|
3929
3922
|
return (i = this._listeners[t]) === null || i === void 0 || i.forEach((o) => {
|
|
3930
3923
|
o.call(this, n);
|
|
3931
3924
|
}), n;
|
|
3932
3925
|
}
|
|
3933
3926
|
}
|
|
3934
|
-
class
|
|
3927
|
+
class Fi {
|
|
3935
3928
|
/**
|
|
3936
3929
|
* @param {string | false} imageSrc
|
|
3937
3930
|
* @param {HTMLElement} container
|
|
@@ -3951,14 +3944,14 @@ class Zi {
|
|
|
3951
3944
|
* @param {number} height
|
|
3952
3945
|
*/
|
|
3953
3946
|
setDisplayedSize(t, e) {
|
|
3954
|
-
this.element && (this.element.tagName === "IMG" ? (
|
|
3947
|
+
this.element && (this.element.tagName === "IMG" ? (ot(this.element, 250, "auto"), this.element.style.transformOrigin = "0 0", this.element.style.transform = Oi(0, 0, t / 250)) : ot(this.element, t, e));
|
|
3955
3948
|
}
|
|
3956
3949
|
destroy() {
|
|
3957
3950
|
var t;
|
|
3958
3951
|
(t = this.element) !== null && t !== void 0 && t.parentNode && this.element.remove(), this.element = null;
|
|
3959
3952
|
}
|
|
3960
3953
|
}
|
|
3961
|
-
class
|
|
3954
|
+
class Zi {
|
|
3962
3955
|
/**
|
|
3963
3956
|
* @param {SlideData} itemData Slide data
|
|
3964
3957
|
* @param {PhotoSwipeBase} instance PhotoSwipe or PhotoSwipeLightbox instance
|
|
@@ -3993,7 +3986,7 @@ class ki {
|
|
|
3993
3986
|
this.data.msrc && this.slide.isFirstSlide ? this.data.msrc : !1,
|
|
3994
3987
|
this
|
|
3995
3988
|
);
|
|
3996
|
-
this.placeholder = new
|
|
3989
|
+
this.placeholder = new Fi(i, this.slide.container);
|
|
3997
3990
|
}
|
|
3998
3991
|
this.element && !e || this.instance.dispatch("contentLoad", {
|
|
3999
3992
|
content: this,
|
|
@@ -4081,7 +4074,7 @@ class ki {
|
|
|
4081
4074
|
content: this,
|
|
4082
4075
|
width: t,
|
|
4083
4076
|
height: e
|
|
4084
|
-
}).defaultPrevented && (
|
|
4077
|
+
}).defaultPrevented && (ot(this.element, t, e), this.isImageContent() && !this.isError()))) {
|
|
4085
4078
|
const i = !this.displayedImageWidth && t;
|
|
4086
4079
|
this.displayedImageWidth = t, this.displayedImageHeight = e, i ? this.loadImage(!1) : this.updateSrcsetSizes(), this.slide && this.instance.dispatch("imageSizeChange", {
|
|
4087
4080
|
slide: this.slide,
|
|
@@ -4163,7 +4156,7 @@ class ki {
|
|
|
4163
4156
|
}).defaultPrevented)
|
|
4164
4157
|
return;
|
|
4165
4158
|
const t = "decode" in this.element;
|
|
4166
|
-
this.isImageContent() ? t && this.slide && (!this.slide.isActive ||
|
|
4159
|
+
this.isImageContent() ? t && this.slide && (!this.slide.isActive || Lt()) ? (this.isDecoding = !0, this.element.decode().catch(() => {
|
|
4167
4160
|
}).finally(() => {
|
|
4168
4161
|
this.isDecoding = !1, this.appendImage();
|
|
4169
4162
|
})) : this.appendImage() : this.slide && !this.element.parentNode && this.slide.container.appendChild(this.element);
|
|
@@ -4176,7 +4169,7 @@ class ki {
|
|
|
4176
4169
|
activate() {
|
|
4177
4170
|
this.instance.dispatch("contentActivate", {
|
|
4178
4171
|
content: this
|
|
4179
|
-
}).defaultPrevented || !this.slide || (this.isImageContent() && this.isDecoding && !
|
|
4172
|
+
}).defaultPrevented || !this.slide || (this.isImageContent() && this.isDecoding && !Lt() ? this.appendImage() : this.isError() && this.load(!1, !0), this.slide.holderElement && this.slide.holderElement.setAttribute("aria-hidden", "false"));
|
|
4180
4173
|
}
|
|
4181
4174
|
/**
|
|
4182
4175
|
* Deactivate the content
|
|
@@ -4203,7 +4196,7 @@ class ki {
|
|
|
4203
4196
|
}).defaultPrevented || (this.slide && this.element && !this.element.parentNode && this.slide.container.appendChild(this.element), (this.state === T.LOADED || this.state === T.ERROR) && this.removePlaceholder()));
|
|
4204
4197
|
}
|
|
4205
4198
|
}
|
|
4206
|
-
function
|
|
4199
|
+
function ki(s, t) {
|
|
4207
4200
|
if (s.getViewportSizeFn) {
|
|
4208
4201
|
const e = s.getViewportSizeFn(s, t);
|
|
4209
4202
|
if (e)
|
|
@@ -4230,14 +4223,14 @@ function K(s, t, e, i, n) {
|
|
|
4230
4223
|
}
|
|
4231
4224
|
return Number(o) || 0;
|
|
4232
4225
|
}
|
|
4233
|
-
function
|
|
4226
|
+
function qi(s, t, e, i) {
|
|
4234
4227
|
return {
|
|
4235
4228
|
x: t.x - K("left", s, t, e, i) - K("right", s, t, e, i),
|
|
4236
4229
|
y: t.y - K("top", s, t, e, i) - K("bottom", s, t, e, i)
|
|
4237
4230
|
};
|
|
4238
4231
|
}
|
|
4239
|
-
const
|
|
4240
|
-
class
|
|
4232
|
+
const At = 4e3;
|
|
4233
|
+
class Ni {
|
|
4241
4234
|
/**
|
|
4242
4235
|
* @param {PhotoSwipeOptions} options PhotoSwipe options
|
|
4243
4236
|
* @param {SlideData} itemData Slide data
|
|
@@ -4294,7 +4287,7 @@ class Hi {
|
|
|
4294
4287
|
*/
|
|
4295
4288
|
_getSecondary() {
|
|
4296
4289
|
let t = this._parseZoomLevelOption("secondary");
|
|
4297
|
-
return t || (t = Math.min(1, this.fit * 3), this.elementSize && t * this.elementSize.x >
|
|
4290
|
+
return t || (t = Math.min(1, this.fit * 3), this.elementSize && t * this.elementSize.x > At && (t = At / this.elementSize.x), t);
|
|
4298
4291
|
}
|
|
4299
4292
|
/**
|
|
4300
4293
|
* Get initial image zoom level.
|
|
@@ -4317,30 +4310,30 @@ class Hi {
|
|
|
4317
4310
|
return this._parseZoomLevelOption("max") || Math.max(1, this.fit * 4);
|
|
4318
4311
|
}
|
|
4319
4312
|
}
|
|
4320
|
-
function
|
|
4313
|
+
function qt(s, t, e) {
|
|
4321
4314
|
const i = t.createContentFromData(s, e);
|
|
4322
4315
|
let n;
|
|
4323
4316
|
const {
|
|
4324
4317
|
options: o
|
|
4325
4318
|
} = t;
|
|
4326
4319
|
if (o) {
|
|
4327
|
-
n = new
|
|
4320
|
+
n = new Ni(o, s, -1);
|
|
4328
4321
|
let r;
|
|
4329
|
-
t.pswp ? r = t.pswp.viewportSize : r =
|
|
4330
|
-
const a =
|
|
4322
|
+
t.pswp ? r = t.pswp.viewportSize : r = ki(o, t);
|
|
4323
|
+
const a = qi(o, r, s, e);
|
|
4331
4324
|
n.update(i.width, i.height, a);
|
|
4332
4325
|
}
|
|
4333
4326
|
return i.lazyLoad(), n && i.setDisplayedSize(Math.ceil(i.width * n.initial), Math.ceil(i.height * n.initial)), i;
|
|
4334
4327
|
}
|
|
4335
|
-
function
|
|
4328
|
+
function Hi(s, t) {
|
|
4336
4329
|
const e = t.getItemData(s);
|
|
4337
4330
|
if (!t.dispatch("lazyLoadSlide", {
|
|
4338
4331
|
index: s,
|
|
4339
4332
|
itemData: e
|
|
4340
4333
|
}).defaultPrevented)
|
|
4341
|
-
return
|
|
4334
|
+
return qt(e, t, s);
|
|
4342
4335
|
}
|
|
4343
|
-
class
|
|
4336
|
+
class Wi extends Bi {
|
|
4344
4337
|
/**
|
|
4345
4338
|
* Get total number of slides
|
|
4346
4339
|
*
|
|
@@ -4363,7 +4356,7 @@ class Vi extends Fi {
|
|
|
4363
4356
|
* @returns {Content}
|
|
4364
4357
|
*/
|
|
4365
4358
|
createContentFromData(t, e) {
|
|
4366
|
-
return new
|
|
4359
|
+
return new Zi(t, this, e);
|
|
4367
4360
|
}
|
|
4368
4361
|
/**
|
|
4369
4362
|
* Get item data by index.
|
|
@@ -4431,10 +4424,10 @@ class Vi extends Fi {
|
|
|
4431
4424
|
* @returns {Content} Image that is being decoded or false.
|
|
4432
4425
|
*/
|
|
4433
4426
|
lazyLoadData(t, e) {
|
|
4434
|
-
return
|
|
4427
|
+
return qt(t, this, e);
|
|
4435
4428
|
}
|
|
4436
4429
|
}
|
|
4437
|
-
class
|
|
4430
|
+
class Vi extends Wi {
|
|
4438
4431
|
/**
|
|
4439
4432
|
* @param {PhotoSwipeOptions} [options]
|
|
4440
4433
|
*/
|
|
@@ -4454,7 +4447,7 @@ class ji extends Vi {
|
|
|
4454
4447
|
* @param {MouseEvent} e
|
|
4455
4448
|
*/
|
|
4456
4449
|
onThumbnailsClick(t) {
|
|
4457
|
-
if (
|
|
4450
|
+
if (Di(t) || window.pswp)
|
|
4458
4451
|
return;
|
|
4459
4452
|
let e = {
|
|
4460
4453
|
x: t.clientX,
|
|
@@ -4522,7 +4515,7 @@ class ji extends Vi {
|
|
|
4522
4515
|
} = this;
|
|
4523
4516
|
e && (i.dataSource = e);
|
|
4524
4517
|
const n = [], o = typeof i.pswpModule;
|
|
4525
|
-
if (
|
|
4518
|
+
if ($i(i.pswpModule))
|
|
4526
4519
|
n.push(Promise.resolve(
|
|
4527
4520
|
/** @type {Type<PhotoSwipe>} */
|
|
4528
4521
|
i.pswpModule
|
|
@@ -4538,7 +4531,7 @@ class ji extends Vi {
|
|
|
4538
4531
|
else
|
|
4539
4532
|
throw new Error("pswpModule is not valid");
|
|
4540
4533
|
}
|
|
4541
|
-
typeof i.openPromise == "function" && n.push(i.openPromise()), i.preloadFirstSlide !== !1 && t >= 0 && (this._preloadedContent =
|
|
4534
|
+
typeof i.openPromise == "function" && n.push(i.openPromise()), i.preloadFirstSlide !== !1 && t >= 0 && (this._preloadedContent = Hi(t, this));
|
|
4542
4535
|
const r = ++this._uid;
|
|
4543
4536
|
Promise.all(n).then((a) => {
|
|
4544
4537
|
if (this.shouldOpen) {
|
|
@@ -4584,12 +4577,12 @@ class ji extends Vi {
|
|
|
4584
4577
|
});
|
|
4585
4578
|
}
|
|
4586
4579
|
}
|
|
4587
|
-
const
|
|
4580
|
+
const ji = () => {
|
|
4588
4581
|
let s = null;
|
|
4589
|
-
return s = new
|
|
4582
|
+
return s = new Vi({
|
|
4590
4583
|
gallery: "#photoswipe-gallery",
|
|
4591
4584
|
children: "a",
|
|
4592
|
-
pswpModule:
|
|
4585
|
+
pswpModule: zi,
|
|
4593
4586
|
zoom: !1,
|
|
4594
4587
|
imageClickAction: "next",
|
|
4595
4588
|
tapAction: "next"
|
|
@@ -4610,7 +4603,7 @@ const Gi = () => {
|
|
|
4610
4603
|
}), s.init(), () => {
|
|
4611
4604
|
s && (s.destroy(), s = null);
|
|
4612
4605
|
};
|
|
4613
|
-
},
|
|
4606
|
+
}, Et = (s) => Math.min(100, Math.max(0, Math.round(s))), Gi = () => {
|
|
4614
4607
|
const s = document.querySelector(".js-limit-scroll-progress-bar"), t = document.querySelector(".c-progress__bar"), e = document.querySelector(".c-btn__close-progress");
|
|
4615
4608
|
if (!t && !e)
|
|
4616
4609
|
return;
|
|
@@ -4619,14 +4612,14 @@ const Gi = () => {
|
|
|
4619
4612
|
let o = i.scrollHeight - i.clientHeight;
|
|
4620
4613
|
if (!o)
|
|
4621
4614
|
return;
|
|
4622
|
-
s && (o = s.scrollHeight - i.clientHeight + (window.pageYOffset + s.getBoundingClientRect().top)), t.style.width = `${
|
|
4615
|
+
s && (o = s.scrollHeight - i.clientHeight + (window.pageYOffset + s.getBoundingClientRect().top)), t.style.width = `${Et(n / o * 100)}%`;
|
|
4623
4616
|
}
|
|
4624
4617
|
if (e) {
|
|
4625
4618
|
const o = document.querySelector(".js-content-header"), r = document.querySelector(".js-limit-scroll-close-article-btn");
|
|
4626
4619
|
if (o && r) {
|
|
4627
4620
|
const a = window.pageYOffset + o.getBoundingClientRect().bottom, c = window.pageYOffset + r.getBoundingClientRect().bottom - i.clientHeight - a;
|
|
4628
4621
|
if (c > 0) {
|
|
4629
|
-
const d =
|
|
4622
|
+
const d = Et((n - a) / c * 100);
|
|
4630
4623
|
e.style.setProperty("--progress", `${d}`), e.parentElement?.classList.toggle(
|
|
4631
4624
|
"c-btn--close-progress-complete",
|
|
4632
4625
|
d >= 100
|
|
@@ -4634,10 +4627,10 @@ const Gi = () => {
|
|
|
4634
4627
|
}
|
|
4635
4628
|
}
|
|
4636
4629
|
}
|
|
4637
|
-
},
|
|
4630
|
+
}, Ui = () => {
|
|
4638
4631
|
const s = document.querySelector(".c-progress"), t = document.querySelector(".c-btn__close-progress");
|
|
4639
|
-
(s || t) && window.addEventListener("scroll",
|
|
4640
|
-
},
|
|
4632
|
+
(s || t) && window.addEventListener("scroll", Gi);
|
|
4633
|
+
}, Ki = (s = {}) => {
|
|
4641
4634
|
const { buttonSelector: t = ".c-scroll-to-top" } = s, e = document.querySelector(t), i = e?.querySelector("button");
|
|
4642
4635
|
if (!e || !i)
|
|
4643
4636
|
return;
|
|
@@ -4659,7 +4652,7 @@ const Gi = () => {
|
|
|
4659
4652
|
});
|
|
4660
4653
|
};
|
|
4661
4654
|
window.addEventListener("scroll", r), i.addEventListener("click", a), r();
|
|
4662
|
-
},
|
|
4655
|
+
}, Xi = 500, Yi = () => {
|
|
4663
4656
|
const s = document.querySelector("#mbrs-comments-container"), t = document.querySelector(".c-scroll-to-top-comment");
|
|
4664
4657
|
if (!s || !t)
|
|
4665
4658
|
return;
|
|
@@ -4675,7 +4668,7 @@ const Gi = () => {
|
|
|
4675
4668
|
}, o = () => {
|
|
4676
4669
|
e && (e = !1, window.removeEventListener("scroll", i), t.style.display = "none");
|
|
4677
4670
|
}, r = (u) => {
|
|
4678
|
-
u.offsetHeight >
|
|
4671
|
+
u.offsetHeight > Xi ? n() : o();
|
|
4679
4672
|
}, a = (u) => {
|
|
4680
4673
|
new ResizeObserver(() => {
|
|
4681
4674
|
r(u);
|
|
@@ -4712,7 +4705,7 @@ const Gi = () => {
|
|
|
4712
4705
|
) && h.disconnect();
|
|
4713
4706
|
});
|
|
4714
4707
|
h.observe(s, { childList: !0, subtree: !0 });
|
|
4715
|
-
},
|
|
4708
|
+
}, et = "#page-content", rt = "#text-tooltip", Ji = ".tooltip-btn", Nt = "c-text-tooltip--show", Qi = [
|
|
4716
4709
|
"#page-content .c-content p",
|
|
4717
4710
|
"#page-content .c-content h2",
|
|
4718
4711
|
"#page-content .c-content h3",
|
|
@@ -4724,17 +4717,17 @@ const Gi = () => {
|
|
|
4724
4717
|
"#page-content header span",
|
|
4725
4718
|
"#page-content header h1",
|
|
4726
4719
|
"#page-content header h2"
|
|
4727
|
-
],
|
|
4720
|
+
], Ct = (s, t) => s instanceof Element ? t.some((e) => s.matches(e)) : !1, ts = (s, t) => {
|
|
4728
4721
|
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;
|
|
4729
|
-
return !!e &&
|
|
4730
|
-
},
|
|
4722
|
+
return !!e && Ct(e, t) || !!i && Ct(i, t);
|
|
4723
|
+
}, es = (s) => {
|
|
4731
4724
|
if (!s.focusNode)
|
|
4732
4725
|
return null;
|
|
4733
4726
|
const t = s.anchorNode?.compareDocumentPosition(s.focusNode);
|
|
4734
4727
|
return t ? (t & 4) > 0 : s.anchorOffset < s.focusOffset;
|
|
4735
|
-
},
|
|
4736
|
-
const i = document.querySelector(`${
|
|
4737
|
-
`${
|
|
4728
|
+
}, is = (s, t, e) => {
|
|
4729
|
+
const i = document.querySelector(`${et} ${rt}`), n = document.querySelector(`${et}`), o = document.querySelectorAll(
|
|
4730
|
+
`${et} ${rt} ${Ji}`
|
|
4738
4731
|
);
|
|
4739
4732
|
if (!i || !n) {
|
|
4740
4733
|
console.warn("Text tooltip : Tooltip or it's parent are not found in the DOM");
|
|
@@ -4744,44 +4737,44 @@ const Gi = () => {
|
|
|
4744
4737
|
l.setAttribute("data-selected-text", e);
|
|
4745
4738
|
});
|
|
4746
4739
|
const r = s.getClientRects(), a = r[t ? r.length - 1 : 0];
|
|
4747
|
-
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(
|
|
4748
|
-
},
|
|
4749
|
-
const s = document.querySelector(`${
|
|
4750
|
-
s && s.classList.remove(
|
|
4740
|
+
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(Nt);
|
|
4741
|
+
}, xt = () => {
|
|
4742
|
+
const s = document.querySelector(`${rt}`);
|
|
4743
|
+
s && s.classList.remove(Nt);
|
|
4751
4744
|
}, X = ({ type: s }) => {
|
|
4752
4745
|
const t = window.getSelection();
|
|
4753
4746
|
if (s === "selectionchange") {
|
|
4754
|
-
|
|
4747
|
+
xt();
|
|
4755
4748
|
return;
|
|
4756
4749
|
}
|
|
4757
4750
|
if (!t?.rangeCount)
|
|
4758
4751
|
return;
|
|
4759
4752
|
const e = t.getRangeAt(0), i = t.toString().trim();
|
|
4760
4753
|
if (i.length) {
|
|
4761
|
-
const n =
|
|
4762
|
-
n &&
|
|
4754
|
+
const n = ts(e, Qi), o = es(t) || !1;
|
|
4755
|
+
n && is(e, o, i);
|
|
4763
4756
|
return;
|
|
4764
4757
|
}
|
|
4765
|
-
|
|
4766
|
-
},
|
|
4758
|
+
xt();
|
|
4759
|
+
}, ss = () => {
|
|
4767
4760
|
if (!window?.getSelection) {
|
|
4768
4761
|
console.warn("Selection API isn't supported");
|
|
4769
4762
|
return;
|
|
4770
4763
|
}
|
|
4771
4764
|
document.addEventListener("mouseup", X), document.addEventListener("selectionchange", X), document.addEventListener("touchend", X), document.addEventListener("touchcancel", X);
|
|
4772
|
-
},
|
|
4765
|
+
}, ns = (s) => {
|
|
4773
4766
|
const { target: t } = s;
|
|
4774
4767
|
if (t instanceof Element) {
|
|
4775
4768
|
const e = t.closest(".c-search-form--button");
|
|
4776
4769
|
e && (s.preventDefault(), e.classList.remove("c-search-form--button"));
|
|
4777
4770
|
}
|
|
4778
|
-
},
|
|
4771
|
+
}, os = (s = document.querySelector(
|
|
4779
4772
|
".c-search-form--button"
|
|
4780
4773
|
)) => {
|
|
4781
4774
|
s && s.addEventListener("click", (t) => {
|
|
4782
|
-
|
|
4775
|
+
ns(t);
|
|
4783
4776
|
});
|
|
4784
|
-
},
|
|
4777
|
+
}, rs = ({
|
|
4785
4778
|
tabsContainerElement: s,
|
|
4786
4779
|
event: t
|
|
4787
4780
|
}) => {
|
|
@@ -4797,38 +4790,38 @@ const Gi = () => {
|
|
|
4797
4790
|
}), n.forEach((a) => {
|
|
4798
4791
|
a.setAttribute("aria-hidden", "true");
|
|
4799
4792
|
}), e.setAttribute("aria-selected", "true"), r && r.removeAttribute("aria-hidden");
|
|
4800
|
-
},
|
|
4793
|
+
}, Pt = (s) => s.code === "ArrowLeft" || s.keyCode === 39, Tt = (s) => s.code === "ArrowRight" || s.keyCode === 37, as = (s = document.querySelectorAll(
|
|
4801
4794
|
".js-tabs"
|
|
4802
4795
|
)) => {
|
|
4803
4796
|
s.length > 0 && s.forEach((t) => {
|
|
4804
4797
|
const e = t.querySelectorAll('[role="tab"]');
|
|
4805
4798
|
e.forEach((n) => {
|
|
4806
4799
|
n.addEventListener("click", (o) => {
|
|
4807
|
-
|
|
4800
|
+
rs({ tabsContainerElement: t, event: o });
|
|
4808
4801
|
});
|
|
4809
4802
|
});
|
|
4810
4803
|
const i = t.querySelector('[role="tablist"]');
|
|
4811
4804
|
if (i && e.length > 0) {
|
|
4812
4805
|
let n = 0;
|
|
4813
4806
|
i.addEventListener("keydown", (o) => {
|
|
4814
|
-
o instanceof KeyboardEvent && (
|
|
4807
|
+
o instanceof KeyboardEvent && (Pt(o) || Tt(o)) && (e[n].setAttribute("tabindex", "-1"), Pt(o) ? (n += 1, n >= e.length && (n = 0)) : Tt(o) && (n -= 1, n < 0 && (n = e.length - 1)), e[n].setAttribute("tabindex", "0"), e[n].focus());
|
|
4815
4808
|
});
|
|
4816
4809
|
}
|
|
4817
4810
|
});
|
|
4818
|
-
},
|
|
4811
|
+
}, Q = (s) => {
|
|
4819
4812
|
const [t, e] = s.split("h").map(Number);
|
|
4820
4813
|
return t * 60 + e;
|
|
4821
|
-
},
|
|
4814
|
+
}, Ht = () => {
|
|
4822
4815
|
const s = /* @__PURE__ */ new Date(), t = s.getHours(), e = s.getMinutes();
|
|
4823
4816
|
return t * 60 + e;
|
|
4824
|
-
},
|
|
4825
|
-
const e =
|
|
4817
|
+
}, ls = (s, t) => {
|
|
4818
|
+
const e = Ht();
|
|
4826
4819
|
if (e < s || e > t)
|
|
4827
4820
|
return 0;
|
|
4828
4821
|
const i = t - s;
|
|
4829
4822
|
return (e - s) / i;
|
|
4830
|
-
},
|
|
4831
|
-
const t =
|
|
4823
|
+
}, cs = (s) => {
|
|
4824
|
+
const t = Ht();
|
|
4832
4825
|
let e = null, i = null, n = -1;
|
|
4833
4826
|
return Array.from(s).find((o, r, a) => {
|
|
4834
4827
|
if (r === a.length - 1)
|
|
@@ -4836,17 +4829,17 @@ const Gi = () => {
|
|
|
4836
4829
|
const l = o.textContent, c = a[r + 1].textContent;
|
|
4837
4830
|
if (!l || !c)
|
|
4838
4831
|
return !1;
|
|
4839
|
-
const d =
|
|
4832
|
+
const d = Q(l), h = Q(c);
|
|
4840
4833
|
return t >= d && t < h ? (e = l, i = c, n = r, !0) : !1;
|
|
4841
4834
|
}), { currentIntervalStartTime: e, currentIntervalEndTime: i, currentIntervalIndex: n };
|
|
4842
|
-
},
|
|
4835
|
+
}, ds = () => {
|
|
4843
4836
|
const s = document.querySelectorAll(".c-timeline__time");
|
|
4844
4837
|
if (!s || s.length < 2)
|
|
4845
4838
|
return;
|
|
4846
|
-
const t = document.querySelector(".c-timeline__progress-bar"), { currentIntervalStartTime: e, currentIntervalEndTime: i, currentIntervalIndex: n } =
|
|
4839
|
+
const t = document.querySelector(".c-timeline__progress-bar"), { currentIntervalStartTime: e, currentIntervalEndTime: i, currentIntervalIndex: n } = cs(s);
|
|
4847
4840
|
if (!e || !i)
|
|
4848
4841
|
return;
|
|
4849
|
-
const o =
|
|
4842
|
+
const o = Q(e), r = Q(i), a = ls(o, r);
|
|
4850
4843
|
if (t instanceof HTMLElement) {
|
|
4851
4844
|
if (t.classList.contains("c-timeline__progress-bar--is-desktop") && s.length >= 5) {
|
|
4852
4845
|
const l = "172px / 2";
|
|
@@ -4885,25 +4878,25 @@ const Gi = () => {
|
|
|
4885
4878
|
}
|
|
4886
4879
|
}
|
|
4887
4880
|
}
|
|
4888
|
-
},
|
|
4881
|
+
}, at = "c-icon-item__container--is-highlighted", hs = (s) => {
|
|
4889
4882
|
s.find(
|
|
4890
|
-
(e) => e.classList.contains(
|
|
4891
|
-
)?.classList.remove(
|
|
4892
|
-
},
|
|
4883
|
+
(e) => e.classList.contains(at)
|
|
4884
|
+
)?.classList.remove(at);
|
|
4885
|
+
}, us = () => {
|
|
4893
4886
|
const s = document.querySelector(".c-toolbar");
|
|
4894
4887
|
if (s) {
|
|
4895
4888
|
const t = window.location.origin + window.location.pathname, e = Array.from(s.querySelectorAll(".c-icon-item__container"));
|
|
4896
|
-
|
|
4889
|
+
hs(e), e.find(
|
|
4897
4890
|
(n) => n.querySelector("a")?.getAttribute("href") === t
|
|
4898
|
-
)?.classList.add(
|
|
4891
|
+
)?.classList.add(at);
|
|
4899
4892
|
}
|
|
4900
|
-
},
|
|
4893
|
+
}, ps = 12, dt = (s) => {
|
|
4901
4894
|
const t = s || document.querySelector(".c-map-towns");
|
|
4902
4895
|
if (!t) {
|
|
4903
4896
|
new MutationObserver((o, r) => {
|
|
4904
4897
|
if (typeof document < "u") {
|
|
4905
4898
|
const a = document.querySelector(".c-map-towns");
|
|
4906
|
-
a && (r.disconnect(),
|
|
4899
|
+
a && (r.disconnect(), dt(a));
|
|
4907
4900
|
}
|
|
4908
4901
|
}).observe(document.body, { childList: !0, subtree: !0 });
|
|
4909
4902
|
return;
|
|
@@ -4933,7 +4926,7 @@ const Gi = () => {
|
|
|
4933
4926
|
d.setAttribute("y", `${E}`), l.setAttribute("aria-hidden", "false");
|
|
4934
4927
|
} else
|
|
4935
4928
|
a = !1;
|
|
4936
|
-
}), !a && r <
|
|
4929
|
+
}), !a && r < ps && requestAnimationFrame(() => o(r + 1));
|
|
4937
4930
|
};
|
|
4938
4931
|
return requestAnimationFrame(() => o()), !0;
|
|
4939
4932
|
};
|
|
@@ -4945,7 +4938,7 @@ const Gi = () => {
|
|
|
4945
4938
|
childList: !0,
|
|
4946
4939
|
subtree: !0
|
|
4947
4940
|
});
|
|
4948
|
-
},
|
|
4941
|
+
}, ms = {
|
|
4949
4942
|
10: [{ id: "10387", name: "Troyes" }, { id: "10323", name: "Romilly-sur-Seine" }, { id: "10033", name: "Bar-sur-Aube" }],
|
|
4950
4943
|
11: [{ id: "11262", name: "Narbonne" }, { id: "11069", name: "Carcassonne" }, { id: "11076", name: "Castelnaudary" }],
|
|
4951
4944
|
12: [{ id: "12202", name: "Rodez" }, { id: "12145", name: "Millau" }, { id: "12300", name: "Villefranche-de-Rouergue" }],
|
|
@@ -5046,14 +5039,14 @@ const Gi = () => {
|
|
|
5046
5039
|
"07": [{ id: "07010", name: "Annonay" }, { id: "07019", name: "Aubenas" }, { id: "07324", name: "Tournon-sur-Rhône" }],
|
|
5047
5040
|
"05": [{ id: "05061", name: "Gap" }, { id: "05023", name: "Briançon" }, { id: "05046", name: "Embrun" }],
|
|
5048
5041
|
"08": [{ id: "08105", name: "Charleville-Mézières" }, { id: "08362", name: "Rethel" }, { id: "08190", name: "Givet" }]
|
|
5049
|
-
},
|
|
5042
|
+
}, fs = /<path\b([^>]*?)\/>/g, gs = /\b([:\w-]+)="([^"]*)"/g, vs = (s) => {
|
|
5050
5043
|
const t = [];
|
|
5051
|
-
for (const e of s.matchAll(
|
|
5044
|
+
for (const e of s.matchAll(fs)) {
|
|
5052
5045
|
const i = e[1];
|
|
5053
5046
|
if (!i)
|
|
5054
5047
|
continue;
|
|
5055
5048
|
const n = /* @__PURE__ */ new Map();
|
|
5056
|
-
for (const c of i.matchAll(
|
|
5049
|
+
for (const c of i.matchAll(gs)) {
|
|
5057
5050
|
const [, d, h] = c;
|
|
5058
5051
|
d && n.set(d, h || "");
|
|
5059
5052
|
}
|
|
@@ -5066,11 +5059,11 @@ const Gi = () => {
|
|
|
5066
5059
|
});
|
|
5067
5060
|
}
|
|
5068
5061
|
return t;
|
|
5069
|
-
},
|
|
5070
|
-
var
|
|
5062
|
+
}, ys = (s) => new Map(s.map((t) => [t.id, t]));
|
|
5063
|
+
var Wt = /* @__PURE__ */ ((s) => (s.MOBILE = "mobile", s.DESKTOP = "desktop", s))(Wt || {});
|
|
5071
5064
|
const Y = (s) => {
|
|
5072
5065
|
window.location.href = s;
|
|
5073
|
-
},
|
|
5066
|
+
}, _s = (s, t, e) => {
|
|
5074
5067
|
const i = e.get(s);
|
|
5075
5068
|
if (i)
|
|
5076
5069
|
return i;
|
|
@@ -5085,7 +5078,7 @@ const Y = (s) => {
|
|
|
5085
5078
|
(o) => o.id.startsWith(`town-${s}`)
|
|
5086
5079
|
);
|
|
5087
5080
|
return e.set(s, n), n;
|
|
5088
|
-
},
|
|
5081
|
+
}, ws = (s, t) => t.get(s), bs = (s) => {
|
|
5089
5082
|
if (s.size > 0)
|
|
5090
5083
|
return;
|
|
5091
5084
|
document.querySelectorAll(
|
|
@@ -5097,13 +5090,13 @@ const Y = (s) => {
|
|
|
5097
5090
|
Array.from(e.classList).filter((n) => n.startsWith("c-map-towns__path--"))
|
|
5098
5091
|
);
|
|
5099
5092
|
});
|
|
5100
|
-
},
|
|
5093
|
+
}, Ss = (s, t) => {
|
|
5101
5094
|
const e = s.id, i = s.url, n = s.name;
|
|
5102
5095
|
if (!e || !i)
|
|
5103
5096
|
return null;
|
|
5104
5097
|
const o = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
5105
5098
|
o.setAttribute("d", s.path), o.setAttribute("class", "c-map-towns__path c-map-towns__zoom-town"), o.setAttribute("data-url", i);
|
|
5106
|
-
const r =
|
|
5099
|
+
const r = ws(e, t);
|
|
5107
5100
|
if (r && r.forEach((a) => {
|
|
5108
5101
|
o.classList.add(a);
|
|
5109
5102
|
}), n) {
|
|
@@ -5111,15 +5104,15 @@ const Y = (s) => {
|
|
|
5111
5104
|
a.textContent = n, o.appendChild(a);
|
|
5112
5105
|
}
|
|
5113
5106
|
return o;
|
|
5114
|
-
},
|
|
5107
|
+
}, Ls = (s, t) => {
|
|
5115
5108
|
const e = document.createDocumentFragment();
|
|
5116
5109
|
return s.forEach((i) => {
|
|
5117
|
-
const n =
|
|
5110
|
+
const n = Ss(i, t);
|
|
5118
5111
|
n && e.appendChild(n);
|
|
5119
5112
|
}), e;
|
|
5120
|
-
},
|
|
5113
|
+
}, As = (s, t) => {
|
|
5121
5114
|
s.replaceChildren(t);
|
|
5122
|
-
},
|
|
5115
|
+
}, Es = (s, t, e) => {
|
|
5123
5116
|
const i = document.createElementNS("http://www.w3.org/2000/svg", "g");
|
|
5124
5117
|
i.setAttribute("class", "js-city-marker c-map-towns__city-marker"), i.setAttribute("aria-hidden", "true"), i.setAttribute("data-scale", e.toString());
|
|
5125
5118
|
const n = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
@@ -5130,7 +5123,7 @@ const Y = (s) => {
|
|
|
5130
5123
|
r.setAttribute("class", "js-city-bg"), r.setAttribute("fill", "white"), r.setAttribute("rx", "4"), r.setAttribute("ry", "4");
|
|
5131
5124
|
const a = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
5132
5125
|
return a.setAttribute("class", "js-city-text c-map-towns__city-text"), a.textContent = s, i.appendChild(n), i.appendChild(o), i.appendChild(r), i.appendChild(a), i;
|
|
5133
|
-
},
|
|
5126
|
+
}, Cs = (s, t) => {
|
|
5134
5127
|
const e = t.getBBox(), i = 5, n = e.width + i * 2, o = e.height + i * 2;
|
|
5135
5128
|
s.setAttribute(
|
|
5136
5129
|
"viewBox",
|
|
@@ -5139,17 +5132,17 @@ const Y = (s) => {
|
|
|
5139
5132
|
const r = s.clientWidth || 800, a = s.clientHeight || 600;
|
|
5140
5133
|
return Math.max(n / r, o / a);
|
|
5141
5134
|
};
|
|
5142
|
-
let
|
|
5143
|
-
const
|
|
5144
|
-
if (
|
|
5135
|
+
let it = !1;
|
|
5136
|
+
const lt = () => {
|
|
5137
|
+
if (it)
|
|
5145
5138
|
return;
|
|
5146
5139
|
if (!document.querySelector(".c-map-towns")) {
|
|
5147
5140
|
new MutationObserver((b, E) => {
|
|
5148
|
-
typeof document < "u" && document.querySelector(".c-map-towns") && (E.disconnect(),
|
|
5141
|
+
typeof document < "u" && document.querySelector(".c-map-towns") && (E.disconnect(), lt());
|
|
5149
5142
|
}).observe(document.body, { childList: !0, subtree: !0 });
|
|
5150
5143
|
return;
|
|
5151
5144
|
}
|
|
5152
|
-
const t = window.layout ===
|
|
5145
|
+
const t = window.layout === Wt.MOBILE, e = document.querySelector(".c-map-towns__map"), i = document.querySelector(".c-map-towns__droms"), n = document.querySelector(".c-map-towns__zooms"), o = (L) => {
|
|
5153
5146
|
const { target: b } = L;
|
|
5154
5147
|
if (!(b instanceof Element))
|
|
5155
5148
|
return;
|
|
@@ -5168,26 +5161,26 @@ const at = () => {
|
|
|
5168
5161
|
z && Y(z);
|
|
5169
5162
|
};
|
|
5170
5163
|
if (t) {
|
|
5171
|
-
e?.addEventListener("click", o), i?.addEventListener("click", o), n?.addEventListener("click", o),
|
|
5164
|
+
e?.addEventListener("click", o), i?.addEventListener("click", o), n?.addEventListener("click", o), it = !0;
|
|
5172
5165
|
return;
|
|
5173
5166
|
}
|
|
5174
5167
|
const r = document.getElementById("js-zoom-overlay"), a = document.getElementById("js-zoom-svg"), l = document.getElementById("js-zoom-group"), c = document.getElementById("js-zoom-close");
|
|
5175
5168
|
if (!(r instanceof HTMLElement) || !(a instanceof SVGSVGElement) || !(l instanceof SVGGElement) || !(c instanceof HTMLElement)) {
|
|
5176
|
-
requestAnimationFrame(
|
|
5169
|
+
requestAnimationFrame(lt);
|
|
5177
5170
|
return;
|
|
5178
5171
|
}
|
|
5179
|
-
|
|
5172
|
+
it = !0;
|
|
5180
5173
|
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();
|
|
5181
5174
|
let p = null;
|
|
5182
5175
|
const y = () => {
|
|
5183
5176
|
if (p)
|
|
5184
5177
|
return p;
|
|
5185
5178
|
const L = u instanceof HTMLScriptElement ? JSON.parse(u.textContent || '""') : "";
|
|
5186
|
-
return p =
|
|
5179
|
+
return p = ys(vs(L)), p;
|
|
5187
5180
|
}, w = () => {
|
|
5188
5181
|
r.setAttribute("aria-hidden", "true"), l.replaceChildren();
|
|
5189
5182
|
}, 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) => {
|
|
5190
|
-
const I =
|
|
5183
|
+
const I = ms[L] || [];
|
|
5191
5184
|
if (I.length === 0)
|
|
5192
5185
|
return;
|
|
5193
5186
|
const M = document.createDocumentFragment();
|
|
@@ -5195,10 +5188,10 @@ const at = () => {
|
|
|
5195
5188
|
const z = C(L, F.id);
|
|
5196
5189
|
if (!z)
|
|
5197
5190
|
return;
|
|
5198
|
-
const $ =
|
|
5191
|
+
const $ = Es(F.name, z, b);
|
|
5199
5192
|
M.appendChild($);
|
|
5200
5193
|
}), l.appendChild(M), requestAnimationFrame(() => {
|
|
5201
|
-
|
|
5194
|
+
dt(l);
|
|
5202
5195
|
});
|
|
5203
5196
|
}, _ = (L) => {
|
|
5204
5197
|
const { target: b } = L;
|
|
@@ -5207,13 +5200,13 @@ const at = () => {
|
|
|
5207
5200
|
const E = b?.closest(".c-map-towns__dept-trigger");
|
|
5208
5201
|
if (!E)
|
|
5209
5202
|
return;
|
|
5210
|
-
const I = E.getAttribute("id")?.replace("out-", "") || "", M = E.getAttribute("data-name"), F =
|
|
5211
|
-
|
|
5212
|
-
const z =
|
|
5203
|
+
const I = E.getAttribute("id")?.replace("out-", "") || "", M = E.getAttribute("data-name"), F = _s(I, y, f);
|
|
5204
|
+
bs(m);
|
|
5205
|
+
const z = Ls(F, m);
|
|
5213
5206
|
if (d && h && M && (d.textContent = M, h.textContent = `Carte détaillée du département : ${M}`), !(E instanceof SVGGraphicsElement))
|
|
5214
5207
|
return;
|
|
5215
|
-
const $ =
|
|
5216
|
-
r.setAttribute("aria-hidden", "false"),
|
|
5208
|
+
const $ = Cs(a, E);
|
|
5209
|
+
r.setAttribute("aria-hidden", "false"), As(l, z), g(I, $);
|
|
5217
5210
|
}, A = (L) => {
|
|
5218
5211
|
const { target: b } = L;
|
|
5219
5212
|
if (!(b instanceof Element))
|
|
@@ -5226,15 +5219,15 @@ const at = () => {
|
|
|
5226
5219
|
}), r.addEventListener("click", (L) => {
|
|
5227
5220
|
L.target === r && w();
|
|
5228
5221
|
});
|
|
5229
|
-
},
|
|
5230
|
-
|
|
5222
|
+
}, Os = () => {
|
|
5223
|
+
he(), as(), Qt(), ye(), re(), Ui(), ji(), Ae(), os(), tt("winterOlympicsGames", "countdown-winter-olympics-games"), tt("eurovision", "countdown-eurovision"), tt("worldFoot2026", "countdown-world-foot-2026"), ss(), ue(), pe(), fe(), ie(), Yt(
|
|
5231
5224
|
"localisation-input",
|
|
5232
5225
|
"https://www.20minutes.fr/elections/resultats/recherche",
|
|
5233
5226
|
"?searchValue=",
|
|
5234
5227
|
"text",
|
|
5235
5228
|
"text"
|
|
5236
|
-
),
|
|
5229
|
+
), ee(), dt(), us(), Ut(), Kt(), ge(), lt(), Ie(), Me(), me(), Gt(), ds(), Ki(), Yi();
|
|
5237
5230
|
};
|
|
5238
5231
|
export {
|
|
5239
|
-
|
|
5232
|
+
Os as initScripts
|
|
5240
5233
|
};
|