@20minutes/hela 2.7.2 → 2.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +1711 -1612
- package/dist/index.umd.js +2 -2
- package/dist/js/scripts.es.js +355 -330
- package/dist/js/scripts.umd.js +3 -3
- package/dist/scss/abstracts/variables/_token-variables.scss +1 -1
- package/dist/scss/abstracts/variables/_variables.scss +1 -1
- package/dist/src/assets/scripts/actualSearch.d.ts +1 -0
- package/dist/src/components/organisms/ActualSearchbar/ActualSearchbar.d.ts +11 -0
- package/dist/src/components/organisms/ActualSearchbar/ActualSearchbar.stories.d.ts +49 -0
- package/dist/src/components/organisms/ActualSearchbar/index.d.ts +1 -0
- package/dist/src/components/organisms/index.d.ts +1 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/js/scripts.es.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var T = (s, t, e) =>
|
|
4
|
-
const
|
|
1
|
+
var Et = Object.defineProperty;
|
|
2
|
+
var Pt = (s, t, e) => t in s ? Et(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
|
|
3
|
+
var T = (s, t, e) => Pt(s, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
const At = () => /Android/i.test(navigator.userAgent), xt = typeof window < "u" && navigator.userAgent.toLowerCase().includes("firefox"), It = () => {
|
|
5
5
|
const s = document.getElementById("js-download-band");
|
|
6
|
-
s &&
|
|
6
|
+
s && At() && s.setAttribute(
|
|
7
7
|
"href",
|
|
8
8
|
"https://app.adjust.com/15shf6wg?campaign=Bandeau_1&deep_link=20minutes%3A%2F%2Fhome"
|
|
9
9
|
);
|
|
10
|
-
},
|
|
10
|
+
}, Ct = () => {
|
|
11
11
|
const s = document.querySelector("#js-election-selector");
|
|
12
12
|
s && s.addEventListener("change", (t) => {
|
|
13
13
|
window.location.replace(t.target.value);
|
|
14
14
|
});
|
|
15
|
-
},
|
|
15
|
+
}, Tt = () => {
|
|
16
16
|
const s = document.querySelector(".c-search-banner");
|
|
17
17
|
if (s) {
|
|
18
18
|
const t = document.querySelector("#js-search-banner-to-hide"), e = s.querySelector("#js-search-banner-dropdown-btn");
|
|
@@ -28,7 +28,25 @@ const Pt = () => /Android/i.test(navigator.userAgent), At = typeof window < "u"
|
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
|
-
}
|
|
31
|
+
};
|
|
32
|
+
function zt(s) {
|
|
33
|
+
var c, d, p;
|
|
34
|
+
if (!(s.target instanceof HTMLFormElement))
|
|
35
|
+
return;
|
|
36
|
+
s.preventDefault();
|
|
37
|
+
const t = s.target, e = new FormData(t), i = {}, n = (c = e.get("job")) == null ? void 0 : c.toString();
|
|
38
|
+
n && (i["tags[]"] = n);
|
|
39
|
+
const o = (d = e.get("adresse")) == null ? void 0 : d.toString();
|
|
40
|
+
o && (i.adresse = o);
|
|
41
|
+
const r = (p = e.get("distance")) == null ? void 0 : p.toString();
|
|
42
|
+
r && (i.distance = r);
|
|
43
|
+
const a = "https://offres-emploi.20minutes.fr/offre-emploi", l = new URLSearchParams(i).toString(), h = `${a}?${l}&&utm_source=20minutes&utm_medium=referral&utm_campaign=job_offer&utm_term=actual&utm_content=search_bar&force_source=1`;
|
|
44
|
+
window.open(h, "_blank");
|
|
45
|
+
}
|
|
46
|
+
const Ot = () => {
|
|
47
|
+
const s = document.querySelector("form#actual-search-form");
|
|
48
|
+
s instanceof HTMLFormElement && s.addEventListener("submit", zt);
|
|
49
|
+
}, Dt = [
|
|
32
50
|
{
|
|
33
51
|
text: "Paris",
|
|
34
52
|
_index: "town_1717424751904",
|
|
@@ -59,21 +77,21 @@ const Pt = () => /Android/i.test(navigator.userAgent), At = typeof window < "u"
|
|
|
59
77
|
url: "/elections/resultats/paris/paris-75011"
|
|
60
78
|
}
|
|
61
79
|
}
|
|
62
|
-
],
|
|
80
|
+
], K = (s, t, e, i, n, o) => {
|
|
63
81
|
const r = document.getElementById(s);
|
|
64
82
|
if (!r)
|
|
65
83
|
return;
|
|
66
84
|
const a = r.dataset.storybook, l = r.querySelector(`#${s}-search`), h = l == null ? void 0 : l.getAttribute("data-api-url"), c = r.querySelector(".c-autocomplete__menu");
|
|
67
85
|
if (!l || !c || !h)
|
|
68
86
|
return;
|
|
69
|
-
const d = r.querySelector(".c-autocomplete__input-spinner"),
|
|
87
|
+
const d = r.querySelector(".c-autocomplete__input-spinner"), p = l.getAttribute("data-trigger-message"), g = async (L) => {
|
|
70
88
|
try {
|
|
71
89
|
let y;
|
|
72
|
-
return a && t.includes("20minutes.fr") ? y =
|
|
90
|
+
return a && t.includes("20minutes.fr") ? y = Dt : y = await (await fetch(`${h}${e}${encodeURIComponent(L)}`)).json(), o ? y[o] : y;
|
|
73
91
|
} catch (y) {
|
|
74
92
|
return console.error("Error fetching autocomplete results:", y), [];
|
|
75
93
|
}
|
|
76
|
-
},
|
|
94
|
+
}, u = (L, y) => {
|
|
77
95
|
const A = document.createElement("li");
|
|
78
96
|
A.id = `/${L}`, A.textContent = y, A.addEventListener("click", () => {
|
|
79
97
|
l instanceof HTMLInputElement && (l.value = y, c.classList.add("u-hidden"));
|
|
@@ -82,12 +100,12 @@ const Pt = () => /Android/i.test(navigator.userAgent), At = typeof window < "u"
|
|
|
82
100
|
d == null || d.classList.toggle("u-hidden");
|
|
83
101
|
}, v = () => {
|
|
84
102
|
const L = document.createElement("li");
|
|
85
|
-
L.textContent =
|
|
103
|
+
L.textContent = p, c.appendChild(L);
|
|
86
104
|
}, E = async (L) => {
|
|
87
105
|
m(), c.classList.remove("u-hidden");
|
|
88
106
|
const y = await g(L);
|
|
89
107
|
c.innerHTML = "", y.length === 0 && c.classList.add("u-hidden"), y.forEach((A) => {
|
|
90
|
-
|
|
108
|
+
u(A[i], A[n]);
|
|
91
109
|
}), m();
|
|
92
110
|
}, P = (L) => {
|
|
93
111
|
if (!(L.target instanceof HTMLInputElement))
|
|
@@ -100,7 +118,7 @@ const Pt = () => /Android/i.test(navigator.userAgent), At = typeof window < "u"
|
|
|
100
118
|
}), l.addEventListener("focusin", () => {
|
|
101
119
|
c.childElementCount > 0 && c.classList.remove("u-hidden");
|
|
102
120
|
});
|
|
103
|
-
},
|
|
121
|
+
}, Mt = () => {
|
|
104
122
|
const s = document.querySelector("header"), t = document.querySelector(".js-limit-scroll-close-article-btn"), e = document.querySelector(".js-close-article-btn"), i = document.querySelector(".c-header-mobile"), n = i instanceof HTMLElement ? i.offsetHeight : 0;
|
|
105
123
|
if (s && t && e) {
|
|
106
124
|
const o = new IntersectionObserver(
|
|
@@ -113,7 +131,7 @@ const Pt = () => /Android/i.test(navigator.userAgent), At = typeof window < "u"
|
|
|
113
131
|
);
|
|
114
132
|
o.observe(s), o.observe(t);
|
|
115
133
|
}
|
|
116
|
-
},
|
|
134
|
+
}, $t = (s) => {
|
|
117
135
|
s.stopImmediatePropagation(), s.preventDefault();
|
|
118
136
|
const t = s.currentTarget;
|
|
119
137
|
if (t instanceof HTMLButtonElement) {
|
|
@@ -122,12 +140,12 @@ const Pt = () => /Android/i.test(navigator.userAgent), At = typeof window < "u"
|
|
|
122
140
|
);
|
|
123
141
|
t.getAttribute("aria-expanded") === "true" ? (t.setAttribute("aria-expanded", "false"), i == null || i.setAttribute("aria-hidden", "true")) : (t.setAttribute("aria-expanded", "true"), i == null || i.setAttribute("aria-hidden", "false"));
|
|
124
142
|
}
|
|
125
|
-
},
|
|
143
|
+
}, Ft = (s = document.querySelector(
|
|
126
144
|
".js-collapse__button"
|
|
127
145
|
)) => {
|
|
128
146
|
s && document.querySelectorAll(".c-collapse__button").forEach((e) => {
|
|
129
147
|
e.addEventListener("click", (i) => {
|
|
130
|
-
|
|
148
|
+
$t(i);
|
|
131
149
|
});
|
|
132
150
|
});
|
|
133
151
|
}, Zt = (s, t) => {
|
|
@@ -146,17 +164,17 @@ const Pt = () => /Android/i.test(navigator.userAgent), At = typeof window < "u"
|
|
|
146
164
|
if (d <= 0)
|
|
147
165
|
clearInterval(h);
|
|
148
166
|
else {
|
|
149
|
-
const
|
|
150
|
-
i.innerHTML =
|
|
167
|
+
const p = Math.floor(d / 864e5), g = Math.floor(d % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60)), u = Math.floor(d % (1e3 * 60 * 60) / (1e3 * 60)), m = Math.floor(d % (1e3 * 60) / 1e3);
|
|
168
|
+
i.innerHTML = p.toString(), n.innerHTML = g.toString(), o.innerHTML = u.toString(), r.innerHTML = m.toString();
|
|
151
169
|
}
|
|
152
170
|
}, 1e3);
|
|
153
171
|
}
|
|
154
|
-
},
|
|
172
|
+
}, Rt = (s) => {
|
|
155
173
|
const t = s.getBBox(), e = t.width / 20;
|
|
156
174
|
return [t.x - e, t.y - e, t.width + e * 2, t.height + e * 2].join(
|
|
157
175
|
" "
|
|
158
176
|
);
|
|
159
|
-
},
|
|
177
|
+
}, kt = () => {
|
|
160
178
|
const s = document.querySelector(".c-map-districts-container"), t = document.querySelector(".c-map-districts");
|
|
161
179
|
if (!s || !t)
|
|
162
180
|
return;
|
|
@@ -168,39 +186,39 @@ const Pt = () => /Android/i.test(navigator.userAgent), At = typeof window < "u"
|
|
|
168
186
|
".c-map-districts-container__unzoom-button"
|
|
169
187
|
);
|
|
170
188
|
let o = t;
|
|
171
|
-
const r = t.getAttribute("viewBox"), a = (
|
|
189
|
+
const r = t.getAttribute("viewBox"), a = (u, m) => {
|
|
172
190
|
var v;
|
|
173
|
-
return (v =
|
|
174
|
-
}, l = (
|
|
175
|
-
if (!
|
|
191
|
+
return (v = u.matches) == null ? void 0 : v.call(u, m);
|
|
192
|
+
}, l = (u, m, v = ".c-map-districts__zoomable:not(.js-selected-area)") => {
|
|
193
|
+
if (!u)
|
|
176
194
|
return;
|
|
177
|
-
let E, P =
|
|
195
|
+
let E, P = u.parentElement;
|
|
178
196
|
for (; P instanceof SVGGraphicsElement && P !== m; )
|
|
179
197
|
a(P, v) && (E = P), P = P.parentElement;
|
|
180
198
|
return E;
|
|
181
|
-
}, h = (
|
|
182
|
-
if (!
|
|
199
|
+
}, h = (u, m, v) => {
|
|
200
|
+
if (!u)
|
|
183
201
|
return;
|
|
184
|
-
let E =
|
|
202
|
+
let E = u.parentElement;
|
|
185
203
|
for (; E instanceof SVGGraphicsElement && E !== v; ) {
|
|
186
204
|
if (m === E)
|
|
187
205
|
return !0;
|
|
188
206
|
E = E.parentElement;
|
|
189
207
|
}
|
|
190
208
|
return v === m;
|
|
191
|
-
}, c = (
|
|
209
|
+
}, c = (u, m) => {
|
|
192
210
|
if (m && n && e) {
|
|
193
|
-
s.classList.remove("c-map-districts-container--department-view"), e.classList.remove("u-hidden"), i == null || i.classList.add("u-hidden"), n.classList.add("u-hidden"), m !== r && (e.classList.add("u-hidden"), n.classList.remove("u-hidden")), o.classList.remove("js-selected-area"), o =
|
|
211
|
+
s.classList.remove("c-map-districts-container--department-view"), e.classList.remove("u-hidden"), i == null || i.classList.add("u-hidden"), n.classList.add("u-hidden"), m !== r && (e.classList.add("u-hidden"), n.classList.remove("u-hidden")), o.classList.remove("js-selected-area"), o = u;
|
|
194
212
|
const v = o.getAttribute("data-info");
|
|
195
213
|
i && v && (s.classList.add("c-map-districts-container--department-view"), i.classList.remove("u-hidden"), i.innerHTML = v), o.classList.add("js-selected-area"), t.setAttribute("viewBox", m);
|
|
196
214
|
}
|
|
197
|
-
}, d = (
|
|
198
|
-
|
|
199
|
-
const m =
|
|
215
|
+
}, d = (u) => {
|
|
216
|
+
u.stopPropagation();
|
|
217
|
+
const m = u.currentTarget;
|
|
200
218
|
if (o && t && m instanceof SVGGraphicsElement) {
|
|
201
219
|
if (m === o)
|
|
202
220
|
return;
|
|
203
|
-
if (
|
|
221
|
+
if (u.preventDefault(), o !== t && !h(m, o, t)) {
|
|
204
222
|
c(t, r);
|
|
205
223
|
return;
|
|
206
224
|
}
|
|
@@ -210,16 +228,16 @@ const Pt = () => /Android/i.test(navigator.userAgent), At = typeof window < "u"
|
|
|
210
228
|
);
|
|
211
229
|
c(
|
|
212
230
|
v || m,
|
|
213
|
-
|
|
231
|
+
Rt(v || m)
|
|
214
232
|
);
|
|
215
233
|
}
|
|
216
|
-
},
|
|
234
|
+
}, p = () => {
|
|
217
235
|
t && o !== t && c(t, r);
|
|
218
236
|
};
|
|
219
|
-
t.addEventListener("click",
|
|
220
|
-
|
|
237
|
+
t.addEventListener("click", p), n && n.addEventListener("click", p), document.querySelectorAll(".c-map-districts__zoomable").forEach((u) => {
|
|
238
|
+
u.addEventListener("click", (m) => d(m));
|
|
221
239
|
});
|
|
222
|
-
},
|
|
240
|
+
}, qt = () => {
|
|
223
241
|
const s = document.getElementById("elections-form-search"), t = document.querySelector(".c-search-form__autocomplete");
|
|
224
242
|
if (!s || !t)
|
|
225
243
|
return;
|
|
@@ -248,57 +266,57 @@ const Pt = () => /Android/i.test(navigator.userAgent), At = typeof window < "u"
|
|
|
248
266
|
}), s.addEventListener("focusin", () => {
|
|
249
267
|
t.childElementCount > 0 && t.classList.remove("u-hidden");
|
|
250
268
|
});
|
|
251
|
-
},
|
|
269
|
+
}, Nt = (s, t) => {
|
|
252
270
|
var n;
|
|
253
271
|
s.setAttribute("aria-expanded", "true");
|
|
254
272
|
const e = (n = s.parentNode) == null ? void 0 : n.querySelectorAll(".js-ellipsis-target");
|
|
255
273
|
e == null || e.forEach((o) => o.classList.remove(t));
|
|
256
274
|
const i = s.querySelector(".js-ellipsis-button__label");
|
|
257
275
|
i instanceof HTMLSpanElement && (i.innerHTML = "Voir moins");
|
|
258
|
-
},
|
|
276
|
+
}, Bt = (s, t) => {
|
|
259
277
|
var n;
|
|
260
278
|
const e = (n = s.parentNode) == null ? void 0 : n.querySelectorAll(".js-ellipsis-target");
|
|
261
279
|
e == null || e.forEach((o) => o.classList.add(t)), s.setAttribute("aria-expanded", "false");
|
|
262
280
|
const i = s.querySelector(".js-ellipsis-button__label");
|
|
263
281
|
i instanceof HTMLSpanElement && (i.innerHTML = "Voir plus");
|
|
264
|
-
},
|
|
282
|
+
}, Ht = (s, t) => {
|
|
265
283
|
const e = s.currentTarget;
|
|
266
284
|
if (s.preventDefault(), e instanceof HTMLButtonElement) {
|
|
267
285
|
const i = t ? "u-ellipsis-multiline" : "u-ellipsis";
|
|
268
|
-
return e.getAttribute("aria-expanded") === "true" ?
|
|
286
|
+
return e.getAttribute("aria-expanded") === "true" ? Bt(e, i) : Nt(e, i);
|
|
269
287
|
}
|
|
270
288
|
return null;
|
|
271
|
-
},
|
|
289
|
+
}, Wt = (s = document.querySelector(
|
|
272
290
|
".js-ellipsis-button"
|
|
273
291
|
)) => {
|
|
274
292
|
s && document.querySelectorAll(".js-ellipsis-button").forEach((e) => {
|
|
275
293
|
const i = e.getAttribute("data-multiple") === "true";
|
|
276
|
-
e.addEventListener("click", (n) =>
|
|
294
|
+
e.addEventListener("click", (n) => Ht(n, i));
|
|
277
295
|
});
|
|
278
|
-
},
|
|
296
|
+
}, Vt = (s) => {
|
|
279
297
|
var i;
|
|
280
298
|
s.setAttribute("aria-expanded", "true");
|
|
281
299
|
const t = (i = s.parentNode) == null ? void 0 : i.querySelectorAll(".js-expand-target");
|
|
282
300
|
t == null || t.forEach((n) => n.setAttribute("aria-hidden", "false"));
|
|
283
301
|
const e = s.querySelector(".js-expand-button__label");
|
|
284
302
|
e instanceof HTMLSpanElement && (e.innerHTML = "Voir moins");
|
|
285
|
-
},
|
|
303
|
+
}, jt = (s) => {
|
|
286
304
|
var i;
|
|
287
305
|
const t = (i = s.parentNode) == null ? void 0 : i.querySelectorAll(".js-expand-target");
|
|
288
306
|
t == null || t.forEach((n) => n.setAttribute("aria-hidden", "true")), s.setAttribute("aria-expanded", "false");
|
|
289
307
|
const e = s.querySelector(".js-expand-button__label");
|
|
290
308
|
e instanceof HTMLSpanElement && (e.innerHTML = "Voir plus");
|
|
291
|
-
},
|
|
309
|
+
}, Ut = (s) => {
|
|
292
310
|
const t = s.currentTarget;
|
|
293
|
-
return s.preventDefault(), t instanceof HTMLButtonElement ? t.getAttribute("aria-expanded") === "true" ?
|
|
294
|
-
},
|
|
311
|
+
return s.preventDefault(), t instanceof HTMLButtonElement ? t.getAttribute("aria-expanded") === "true" ? jt(t) : Vt(t) : null;
|
|
312
|
+
}, Gt = (s = document.querySelector(
|
|
295
313
|
".js-expand-button"
|
|
296
314
|
)) => {
|
|
297
|
-
s && document.querySelectorAll(".js-expand-button").forEach((e) => e.addEventListener("click",
|
|
298
|
-
},
|
|
315
|
+
s && document.querySelectorAll(".js-expand-button").forEach((e) => e.addEventListener("click", Ut));
|
|
316
|
+
}, Kt = () => {
|
|
299
317
|
const s = document.querySelector(".js-game-alert");
|
|
300
|
-
|
|
301
|
-
},
|
|
318
|
+
xt && s && s.classList.remove("u-hidden");
|
|
319
|
+
}, Xt = () => {
|
|
302
320
|
const s = document.querySelectorAll(".js-half-donut-result");
|
|
303
321
|
for (const t of Array.from(s)) {
|
|
304
322
|
const e = t.querySelector(".c-half-donut"), i = t.querySelector(".c-legend");
|
|
@@ -317,7 +335,7 @@ const Pt = () => /Android/i.test(navigator.userAgent), At = typeof window < "u"
|
|
|
317
335
|
});
|
|
318
336
|
});
|
|
319
337
|
}
|
|
320
|
-
},
|
|
338
|
+
}, Yt = () => {
|
|
321
339
|
const s = document.querySelector(".c-image-slider__container");
|
|
322
340
|
if (!s)
|
|
323
341
|
return;
|
|
@@ -351,7 +369,7 @@ const Pt = () => /Android/i.test(navigator.userAgent), At = typeof window < "u"
|
|
|
351
369
|
negTabIndex: ':not([tabindex^="-"])',
|
|
352
370
|
disabled: ":not(:disabled)"
|
|
353
371
|
};
|
|
354
|
-
var
|
|
372
|
+
var Qt = [
|
|
355
373
|
`a[href]${f.inert}${f.negTabIndex}`,
|
|
356
374
|
`area[href]${f.inert}${f.negTabIndex}`,
|
|
357
375
|
`input:not([type="hidden"]):not([type="radio"])${f.inert}${f.negTabIndex}${f.disabled}`,
|
|
@@ -369,24 +387,24 @@ var Xt = [
|
|
|
369
387
|
`[contenteditable]${f.inert}${f.negTabIndex}`,
|
|
370
388
|
`[tabindex]${f.inert}${f.negTabIndex}`
|
|
371
389
|
];
|
|
372
|
-
function
|
|
390
|
+
function X(s) {
|
|
373
391
|
(s.querySelector("[autofocus]") || s).focus();
|
|
374
392
|
}
|
|
375
|
-
function
|
|
376
|
-
const t =
|
|
393
|
+
function Jt(s) {
|
|
394
|
+
const t = F(s, !0), e = t ? F(s, !1) || t : null;
|
|
377
395
|
return [t, e];
|
|
378
396
|
}
|
|
379
|
-
function
|
|
380
|
-
if (t &&
|
|
397
|
+
function F(s, t) {
|
|
398
|
+
if (t && J(s))
|
|
381
399
|
return s;
|
|
382
|
-
if (
|
|
400
|
+
if (ee(s))
|
|
383
401
|
if (s.shadowRoot) {
|
|
384
|
-
let e =
|
|
402
|
+
let e = Y(s.shadowRoot, t);
|
|
385
403
|
for (; e; ) {
|
|
386
|
-
const i =
|
|
404
|
+
const i = F(e, t);
|
|
387
405
|
if (i)
|
|
388
406
|
return i;
|
|
389
|
-
e =
|
|
407
|
+
e = Q(e, t);
|
|
390
408
|
}
|
|
391
409
|
} else if (s.localName === "slot") {
|
|
392
410
|
const e = s.assignedElements({
|
|
@@ -394,56 +412,56 @@ function $(s, t) {
|
|
|
394
412
|
});
|
|
395
413
|
t || e.reverse();
|
|
396
414
|
for (const i of e) {
|
|
397
|
-
const n =
|
|
415
|
+
const n = F(i, t);
|
|
398
416
|
if (n)
|
|
399
417
|
return n;
|
|
400
418
|
}
|
|
401
419
|
} else {
|
|
402
|
-
let e =
|
|
420
|
+
let e = Y(s, t);
|
|
403
421
|
for (; e; ) {
|
|
404
|
-
const i =
|
|
422
|
+
const i = F(e, t);
|
|
405
423
|
if (i)
|
|
406
424
|
return i;
|
|
407
|
-
e =
|
|
425
|
+
e = Q(e, t);
|
|
408
426
|
}
|
|
409
427
|
}
|
|
410
|
-
return !t &&
|
|
428
|
+
return !t && J(s) ? s : null;
|
|
411
429
|
}
|
|
412
|
-
function
|
|
430
|
+
function Y(s, t) {
|
|
413
431
|
return t ? s.firstElementChild : s.lastElementChild;
|
|
414
432
|
}
|
|
415
|
-
function
|
|
433
|
+
function Q(s, t) {
|
|
416
434
|
return t ? s.nextElementSibling : s.previousElementSibling;
|
|
417
435
|
}
|
|
418
|
-
const
|
|
436
|
+
const te = (s) => s.matches("details:not([open]) *") && !s.matches("details>summary:first-of-type") ? !0 : !(s.offsetWidth || s.offsetHeight || s.getClientRects().length), J = (s) => {
|
|
419
437
|
var t;
|
|
420
|
-
return (t = s.shadowRoot) != null && t.delegatesFocus ? !1 : s.matches(
|
|
438
|
+
return (t = s.shadowRoot) != null && t.delegatesFocus ? !1 : s.matches(Qt.join(",")) && !te(s);
|
|
421
439
|
};
|
|
422
|
-
function
|
|
440
|
+
function ee(s) {
|
|
423
441
|
return s.shadowRoot && s.getAttribute("tabindex") === "-1" ? !1 : !s.matches(":disabled,[hidden],[inert]");
|
|
424
442
|
}
|
|
425
|
-
function
|
|
443
|
+
function Z(s = document) {
|
|
426
444
|
const t = s.activeElement;
|
|
427
|
-
return t ? t.shadowRoot ?
|
|
445
|
+
return t ? t.shadowRoot ? Z(t.shadowRoot) || document.activeElement : t : null;
|
|
428
446
|
}
|
|
429
|
-
function
|
|
430
|
-
const [e, i] =
|
|
447
|
+
function ie(s, t) {
|
|
448
|
+
const [e, i] = Jt(s);
|
|
431
449
|
if (!e)
|
|
432
450
|
return t.preventDefault();
|
|
433
|
-
const n =
|
|
451
|
+
const n = Z();
|
|
434
452
|
t.shiftKey && n === e ? (i.focus(), t.preventDefault()) : !t.shiftKey && n === i && (e.focus(), t.preventDefault());
|
|
435
453
|
}
|
|
436
454
|
function C(s, t) {
|
|
437
455
|
function e(i) {
|
|
438
456
|
if (!i || i === document || i === window)
|
|
439
457
|
return null;
|
|
440
|
-
const n =
|
|
458
|
+
const n = ut(i);
|
|
441
459
|
return n && (i = n), i.closest(s) || e(i.getRootNode().host);
|
|
442
460
|
}
|
|
443
461
|
return e(t);
|
|
444
462
|
}
|
|
445
|
-
function
|
|
446
|
-
return s.assignedSlot || (s.parentNode ?
|
|
463
|
+
function ut(s) {
|
|
464
|
+
return s.assignedSlot || (s.parentNode ? ut(s.parentNode) : null);
|
|
447
465
|
}
|
|
448
466
|
const z = "data-a11y-dialog";
|
|
449
467
|
class pt {
|
|
@@ -467,7 +485,7 @@ class pt {
|
|
|
467
485
|
*/
|
|
468
486
|
show(t) {
|
|
469
487
|
var i;
|
|
470
|
-
return this.shown ? this : this.fire("show", t).defaultPrevented ? this : (this.shown = !0, this.$el.removeAttribute("aria-hidden"), this.previouslyFocused =
|
|
488
|
+
return this.shown ? this : this.fire("show", t).defaultPrevented ? this : (this.shown = !0, this.$el.removeAttribute("aria-hidden"), this.previouslyFocused = Z(), ((i = this.previouslyFocused) == null ? void 0 : i.tagName) === "BODY" && (t != null && t.target) && (this.previouslyFocused = t.target), (t == null ? void 0 : t.type) === "focus" ? this.maintainFocus() : X(this.$el), document.body.addEventListener("focus", this.maintainFocus, !0), this.$el.addEventListener("keydown", this.bindKeypress, !0), this);
|
|
471
489
|
}
|
|
472
490
|
/**
|
|
473
491
|
* Hide the dialog element, restore the focus to the previously active
|
|
@@ -515,14 +533,14 @@ class pt {
|
|
|
515
533
|
* (namely ESC and TAB)
|
|
516
534
|
*/
|
|
517
535
|
bindKeypress(t) {
|
|
518
|
-
if (C('[aria-modal="true"]',
|
|
536
|
+
if (C('[aria-modal="true"]', Z()) !== this.$el)
|
|
519
537
|
return;
|
|
520
538
|
let e = !1;
|
|
521
539
|
try {
|
|
522
540
|
e = !!this.$el.querySelector('[popover]:not([popover="manual"]):popover-open');
|
|
523
541
|
} catch {
|
|
524
542
|
}
|
|
525
|
-
t.key === "Escape" && this.$el.getAttribute("role") !== "alertdialog" && !e && (t.preventDefault(), this.hide(t)), t.key === "Tab" &&
|
|
543
|
+
t.key === "Escape" && this.$el.getAttribute("role") !== "alertdialog" && !e && (t.preventDefault(), this.hide(t)), t.key === "Tab" && ie(this.$el, t);
|
|
526
544
|
}
|
|
527
545
|
/**
|
|
528
546
|
* If the dialog is shown and the focus is not within a dialog element (either
|
|
@@ -531,16 +549,16 @@ class pt {
|
|
|
531
549
|
* See: https://github.com/KittyGiraudel/a11y-dialog/issues/177
|
|
532
550
|
*/
|
|
533
551
|
maintainFocus() {
|
|
534
|
-
const t =
|
|
535
|
-
C(`[aria-modal="true"], [${z}-ignore-focus-trap]`, t) ||
|
|
552
|
+
const t = Z();
|
|
553
|
+
C(`[aria-modal="true"], [${z}-ignore-focus-trap]`, t) || X(this.$el);
|
|
536
554
|
}
|
|
537
555
|
}
|
|
538
|
-
function
|
|
556
|
+
function tt() {
|
|
539
557
|
for (const s of document.querySelectorAll("[data-a11y-dialog]"))
|
|
540
558
|
new pt(s);
|
|
541
559
|
}
|
|
542
|
-
typeof document < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded",
|
|
543
|
-
const
|
|
560
|
+
typeof document < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", tt) : tt());
|
|
561
|
+
const se = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
544
562
|
if (!(s instanceof HTMLElement))
|
|
545
563
|
return;
|
|
546
564
|
const t = new pt(s);
|
|
@@ -557,11 +575,11 @@ const ee = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
557
575
|
}).on("hide", () => {
|
|
558
576
|
document.body.classList.remove("noscroll");
|
|
559
577
|
});
|
|
560
|
-
}),
|
|
561
|
-
var o, r, a, l, h, c, d,
|
|
578
|
+
}), ne = ({ navigatedList: s, nextBtn: t, prevBtn: e }) => {
|
|
579
|
+
var o, r, a, l, h, c, d, p;
|
|
562
580
|
const i = s.scrollLeft > 0, n = s.scrollLeft + s.clientWidth < s.scrollWidth;
|
|
563
|
-
i && n ? ((o = t.classList) == null || o.add("o-nav-button--visible"), (r = e.classList) == null || r.add("o-nav-button--visible")) : i ? ((a = t.classList) == null || a.remove("o-nav-button--visible"), (l = e.classList) == null || l.add("o-nav-button--visible")) : n ? ((h = t.classList) == null || h.add("o-nav-button--visible"), (c = e.classList) == null || c.remove("o-nav-button--visible")) : ((d = t.classList) == null || d.remove("o-nav-button--visible"), (
|
|
564
|
-
},
|
|
581
|
+
i && n ? ((o = t.classList) == null || o.add("o-nav-button--visible"), (r = e.classList) == null || r.add("o-nav-button--visible")) : i ? ((a = t.classList) == null || a.remove("o-nav-button--visible"), (l = e.classList) == null || l.add("o-nav-button--visible")) : n ? ((h = t.classList) == null || h.add("o-nav-button--visible"), (c = e.classList) == null || c.remove("o-nav-button--visible")) : ((d = t.classList) == null || d.remove("o-nav-button--visible"), (p = e.classList) == null || p.remove("o-nav-button--visible"));
|
|
582
|
+
}, oe = ({
|
|
565
583
|
navigatedList: s,
|
|
566
584
|
nextBtn: t,
|
|
567
585
|
prevBtn: e,
|
|
@@ -606,7 +624,7 @@ const ee = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
606
624
|
}), t.classList.remove("o-nav-button--visible"), e.classList.add("o-nav-button--visible");
|
|
607
625
|
}
|
|
608
626
|
}
|
|
609
|
-
},
|
|
627
|
+
}, re = ({
|
|
610
628
|
navigatedList: s,
|
|
611
629
|
nextBtn: t,
|
|
612
630
|
prevBtn: e,
|
|
@@ -647,13 +665,13 @@ const ee = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
647
665
|
behavior: "smooth"
|
|
648
666
|
}), e.classList.remove("o-nav-button--visible"), s.clientWidth < s.scrollWidth && t.classList.add("o-nav-button--visible");
|
|
649
667
|
}
|
|
650
|
-
},
|
|
651
|
-
|
|
668
|
+
}, ae = ({ navigatedList: s, nextBtn: t, prevBtn: e }) => {
|
|
669
|
+
ne({
|
|
652
670
|
navigatedList: s,
|
|
653
671
|
nextBtn: t,
|
|
654
672
|
prevBtn: e
|
|
655
673
|
});
|
|
656
|
-
},
|
|
674
|
+
}, le = () => {
|
|
657
675
|
const s = document.querySelectorAll(".js-navigation-container");
|
|
658
676
|
for (const t of Array.from(s)) {
|
|
659
677
|
const { sliderVariant: e } = t.dataset, { sliderAuto: i } = t.dataset, { sliderDelay: n } = t.dataset, o = n ? parseInt(n, 10) : 3e3, r = t.closest(".js-overview-bar-container"), a = r == null ? void 0 : r.querySelector(".c-stepper"), l = a == null ? void 0 : a.querySelectorAll(".c-stepper__item");
|
|
@@ -667,7 +685,7 @@ const ee = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
667
685
|
);
|
|
668
686
|
if (h && h.clientWidth < h.scrollWidth && (c == null || c.classList.add("o-nav-button--visible")), h && c && d && (c == null || c.addEventListener(
|
|
669
687
|
"click",
|
|
670
|
-
|
|
688
|
+
oe.bind(!1, {
|
|
671
689
|
navigatedList: h,
|
|
672
690
|
nextBtn: c,
|
|
673
691
|
prevBtn: d,
|
|
@@ -675,7 +693,7 @@ const ee = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
675
693
|
})
|
|
676
694
|
), d == null || d.addEventListener(
|
|
677
695
|
"click",
|
|
678
|
-
|
|
696
|
+
re.bind(!1, {
|
|
679
697
|
navigatedList: h,
|
|
680
698
|
nextBtn: c,
|
|
681
699
|
prevBtn: d,
|
|
@@ -683,15 +701,15 @@ const ee = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
683
701
|
delay: o
|
|
684
702
|
})
|
|
685
703
|
)), i === "true" && c) {
|
|
686
|
-
const
|
|
704
|
+
const p = a ? a.querySelector(".c-stepper__item--loading") : null;
|
|
687
705
|
l && (l.forEach((g) => {
|
|
688
|
-
const
|
|
689
|
-
|
|
690
|
-
}),
|
|
706
|
+
const u = g.querySelector(".c-stepper__loader");
|
|
707
|
+
u && u instanceof HTMLElement && (u.style.transition = `width ${o / 1e3}s linear`);
|
|
708
|
+
}), p || l[0].classList.add("c-stepper__item--loading")), setInterval(() => {
|
|
691
709
|
c.classList.contains("o-nav-button--visible") ? c.click() : h && d && (h.scrollLeft = 0, l && (l.forEach((g) => {
|
|
692
|
-
const
|
|
693
|
-
|
|
694
|
-
|
|
710
|
+
const u = g.querySelector(".c-stepper__loader");
|
|
711
|
+
u && u instanceof HTMLElement && (u.style.transition = "width 0s linear"), g.classList.remove("c-stepper__item--loading"), g.classList.remove("c-stepper__item--loaded"), setTimeout(() => {
|
|
712
|
+
u && u instanceof HTMLElement && (u.style.transition = `width ${o / 1e3}s linear`);
|
|
695
713
|
}, 0);
|
|
696
714
|
}), setTimeout(() => {
|
|
697
715
|
l[0].classList.add("c-stepper__item--loading");
|
|
@@ -700,7 +718,7 @@ const ee = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
700
718
|
}
|
|
701
719
|
}
|
|
702
720
|
}
|
|
703
|
-
},
|
|
721
|
+
}, he = () => {
|
|
704
722
|
const s = document.querySelectorAll(".js-navigation-container");
|
|
705
723
|
for (const t of Array.from(s))
|
|
706
724
|
if (t) {
|
|
@@ -713,7 +731,7 @@ const ee = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
713
731
|
);
|
|
714
732
|
e && i && n && window.addEventListener(
|
|
715
733
|
"resize",
|
|
716
|
-
|
|
734
|
+
ae.bind(!1, {
|
|
717
735
|
navigatedList: e,
|
|
718
736
|
nextBtn: i,
|
|
719
737
|
prevBtn: n
|
|
@@ -732,7 +750,7 @@ function w(s, t, e) {
|
|
|
732
750
|
function _(s, t) {
|
|
733
751
|
return s.x = t.x, s.y = t.y, t.id !== void 0 && (s.id = t.id), s;
|
|
734
752
|
}
|
|
735
|
-
function
|
|
753
|
+
function mt(s) {
|
|
736
754
|
s.x = Math.round(s.x), s.y = Math.round(s.y);
|
|
737
755
|
}
|
|
738
756
|
function W(s, t) {
|
|
@@ -752,17 +770,17 @@ function k(s, t, e) {
|
|
|
752
770
|
function I(s, t, e, i) {
|
|
753
771
|
s.style.transform = k(t, e, i);
|
|
754
772
|
}
|
|
755
|
-
const
|
|
756
|
-
function
|
|
757
|
-
s.style.transition = t ? `${t} ${e}ms ${i ||
|
|
773
|
+
const ce = "cubic-bezier(.4,0,.22,1)";
|
|
774
|
+
function ft(s, t, e, i) {
|
|
775
|
+
s.style.transition = t ? `${t} ${e}ms ${i || ce}` : "none";
|
|
758
776
|
}
|
|
759
777
|
function V(s, t, e) {
|
|
760
778
|
s.style.width = typeof t == "number" ? `${t}px` : t, s.style.height = typeof e == "number" ? `${e}px` : e;
|
|
761
779
|
}
|
|
762
|
-
function
|
|
763
|
-
|
|
780
|
+
function de(s) {
|
|
781
|
+
ft(s);
|
|
764
782
|
}
|
|
765
|
-
function
|
|
783
|
+
function ue(s) {
|
|
766
784
|
return "decode" in s ? s.decode().catch(() => {
|
|
767
785
|
}) : s.complete ? Promise.resolve(s) : new Promise((t, e) => {
|
|
768
786
|
s.onload = () => t(s), s.onerror = e;
|
|
@@ -774,10 +792,10 @@ const S = {
|
|
|
774
792
|
LOADED: "loaded",
|
|
775
793
|
ERROR: "error"
|
|
776
794
|
};
|
|
777
|
-
function
|
|
795
|
+
function pe(s) {
|
|
778
796
|
return "button" in s && s.button === 1 || s.ctrlKey || s.metaKey || s.altKey || s.shiftKey;
|
|
779
797
|
}
|
|
780
|
-
function
|
|
798
|
+
function me(s, t, e = document) {
|
|
781
799
|
let i = [];
|
|
782
800
|
if (s instanceof Element)
|
|
783
801
|
i = [s];
|
|
@@ -789,19 +807,19 @@ function pe(s, t, e = document) {
|
|
|
789
807
|
}
|
|
790
808
|
return i;
|
|
791
809
|
}
|
|
792
|
-
function
|
|
810
|
+
function et() {
|
|
793
811
|
return !!(navigator.vendor && navigator.vendor.match(/apple/i));
|
|
794
812
|
}
|
|
795
|
-
let
|
|
813
|
+
let gt = !1;
|
|
796
814
|
try {
|
|
797
815
|
window.addEventListener("test", null, Object.defineProperty({}, "passive", {
|
|
798
816
|
get: () => {
|
|
799
|
-
|
|
817
|
+
gt = !0;
|
|
800
818
|
}
|
|
801
819
|
}));
|
|
802
820
|
} catch {
|
|
803
821
|
}
|
|
804
|
-
class
|
|
822
|
+
class fe {
|
|
805
823
|
constructor() {
|
|
806
824
|
this._pool = [];
|
|
807
825
|
}
|
|
@@ -858,7 +876,7 @@ class ue {
|
|
|
858
876
|
listener: i,
|
|
859
877
|
passive: n
|
|
860
878
|
}));
|
|
861
|
-
const c =
|
|
879
|
+
const c = gt ? {
|
|
862
880
|
passive: n || !1
|
|
863
881
|
} : !1;
|
|
864
882
|
t[a](h, i, c);
|
|
@@ -866,7 +884,7 @@ class ue {
|
|
|
866
884
|
});
|
|
867
885
|
}
|
|
868
886
|
}
|
|
869
|
-
function
|
|
887
|
+
function _t(s, t) {
|
|
870
888
|
if (s.getViewportSizeFn) {
|
|
871
889
|
const e = s.getViewportSizeFn(s, t);
|
|
872
890
|
if (e)
|
|
@@ -893,13 +911,13 @@ function D(s, t, e, i, n) {
|
|
|
893
911
|
}
|
|
894
912
|
return Number(o) || 0;
|
|
895
913
|
}
|
|
896
|
-
function
|
|
914
|
+
function vt(s, t, e, i) {
|
|
897
915
|
return {
|
|
898
916
|
x: t.x - D("left", s, t, e, i) - D("right", s, t, e, i),
|
|
899
917
|
y: t.y - D("top", s, t, e, i) - D("bottom", s, t, e, i)
|
|
900
918
|
};
|
|
901
919
|
}
|
|
902
|
-
class
|
|
920
|
+
class ge {
|
|
903
921
|
/**
|
|
904
922
|
* @param {Slide} slide
|
|
905
923
|
*/
|
|
@@ -954,8 +972,8 @@ class me {
|
|
|
954
972
|
return q(e, this.max[t], this.min[t]);
|
|
955
973
|
}
|
|
956
974
|
}
|
|
957
|
-
const
|
|
958
|
-
let
|
|
975
|
+
const it = 4e3;
|
|
976
|
+
let yt = class {
|
|
959
977
|
/**
|
|
960
978
|
* @param {PhotoSwipeOptions} options PhotoSwipe options
|
|
961
979
|
* @param {SlideData} itemData Slide data
|
|
@@ -1012,7 +1030,7 @@ let vt = class {
|
|
|
1012
1030
|
*/
|
|
1013
1031
|
_getSecondary() {
|
|
1014
1032
|
let t = this._parseZoomLevelOption("secondary");
|
|
1015
|
-
return t || (t = Math.min(1, this.fit * 3), this.elementSize && t * this.elementSize.x >
|
|
1033
|
+
return t || (t = Math.min(1, this.fit * 3), this.elementSize && t * this.elementSize.x > it && (t = it / this.elementSize.x), t);
|
|
1016
1034
|
}
|
|
1017
1035
|
/**
|
|
1018
1036
|
* Get initial image zoom level.
|
|
@@ -1035,7 +1053,7 @@ let vt = class {
|
|
|
1035
1053
|
return this._parseZoomLevelOption("max") || Math.max(1, this.fit * 4);
|
|
1036
1054
|
}
|
|
1037
1055
|
};
|
|
1038
|
-
class
|
|
1056
|
+
class _e {
|
|
1039
1057
|
/**
|
|
1040
1058
|
* @param {SlideData} data
|
|
1041
1059
|
* @param {number} index
|
|
@@ -1048,11 +1066,11 @@ class fe {
|
|
|
1048
1066
|
}, this.pan = {
|
|
1049
1067
|
x: 0,
|
|
1050
1068
|
y: 0
|
|
1051
|
-
}, this.isFirstSlide = this.isActive && !i.opener.isOpen, this.zoomLevels = new
|
|
1069
|
+
}, this.isFirstSlide = this.isActive && !i.opener.isOpen, this.zoomLevels = new yt(i.options, t, e, i), this.pswp.dispatch("gettingData", {
|
|
1052
1070
|
slide: this,
|
|
1053
1071
|
data: this.data,
|
|
1054
1072
|
index: e
|
|
1055
|
-
}), this.content = this.pswp.contentLoader.getContentBySlide(this), this.container = w("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
|
|
1073
|
+
}), this.content = this.pswp.contentLoader.getContentBySlide(this), this.container = w("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 ge(this), this.prevDisplayedWidth = -1, this.prevDisplayedHeight = -1, this.pswp.dispatch("slideInit", {
|
|
1056
1074
|
slide: this
|
|
1057
1075
|
});
|
|
1058
1076
|
}
|
|
@@ -1176,7 +1194,7 @@ class fe {
|
|
|
1176
1194
|
transitionDuration: i
|
|
1177
1195
|
}), o.animations.stopAllPan();
|
|
1178
1196
|
const r = this.currZoomLevel;
|
|
1179
|
-
n || (t = q(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),
|
|
1197
|
+
n || (t = q(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), mt(this.pan);
|
|
1180
1198
|
const a = () => {
|
|
1181
1199
|
this._setResolution(t), this.applyCurrentZoomPan();
|
|
1182
1200
|
};
|
|
@@ -1277,7 +1295,7 @@ class fe {
|
|
|
1277
1295
|
const {
|
|
1278
1296
|
pswp: t
|
|
1279
1297
|
} = this;
|
|
1280
|
-
_(this.panAreaSize,
|
|
1298
|
+
_(this.panAreaSize, vt(t.options, t.viewportSize, this.data, this.index)), this.zoomLevels.update(this.width, this.height, this.panAreaSize), t.dispatch("calcSlideSize", {
|
|
1281
1299
|
slide: this
|
|
1282
1300
|
});
|
|
1283
1301
|
}
|
|
@@ -1305,11 +1323,11 @@ class fe {
|
|
|
1305
1323
|
t !== this.currentResolution && (this.currentResolution = t, this.updateContentSize(), this.pswp.dispatch("resolutionChanged"));
|
|
1306
1324
|
}
|
|
1307
1325
|
}
|
|
1308
|
-
const
|
|
1309
|
-
function
|
|
1326
|
+
const ve = 0.35, ye = 0.6, we = 0.4, Se = 0.5;
|
|
1327
|
+
function be(s, t) {
|
|
1310
1328
|
return s * t / (1 - t);
|
|
1311
1329
|
}
|
|
1312
|
-
class
|
|
1330
|
+
class Le {
|
|
1313
1331
|
/**
|
|
1314
1332
|
* @param {Gestures} gestures
|
|
1315
1333
|
*/
|
|
@@ -1335,12 +1353,12 @@ class Se {
|
|
|
1335
1353
|
if (!this.pswp.dispatch("verticalDrag", {
|
|
1336
1354
|
panY: o
|
|
1337
1355
|
}).defaultPrevented) {
|
|
1338
|
-
this._setPanWithFriction("y", o,
|
|
1356
|
+
this._setPanWithFriction("y", o, ye);
|
|
1339
1357
|
const r = 1 - Math.abs(this._getVerticalDragRatio(n.pan.y));
|
|
1340
1358
|
this.pswp.applyBgOpacity(r), n.applyCurrentZoomPan();
|
|
1341
1359
|
}
|
|
1342
1360
|
} else
|
|
1343
|
-
this._panOrMoveMainScroll("x") || (this._panOrMoveMainScroll("y"), n && (
|
|
1361
|
+
this._panOrMoveMainScroll("x") || (this._panOrMoveMainScroll("y"), n && (mt(n.pan), n.applyCurrentZoomPan()));
|
|
1344
1362
|
}
|
|
1345
1363
|
end() {
|
|
1346
1364
|
const {
|
|
@@ -1352,7 +1370,7 @@ class Se {
|
|
|
1352
1370
|
let n = 0;
|
|
1353
1371
|
if (this.pswp.animations.stopAll(), e.isShifted()) {
|
|
1354
1372
|
const r = (e.x - e.getCurrSlideX()) / this.pswp.viewportSize.x;
|
|
1355
|
-
t.x < -0.5 && r < 0 || t.x < 0.1 && r < -0.5 ? (n = 1, t.x = Math.min(t.x, 0)) : (t.x >
|
|
1373
|
+
t.x < -0.5 && r < 0 || t.x < 0.1 && r < -0.5 ? (n = 1, t.x = Math.min(t.x, 0)) : (t.x > Se && r > 0 || t.x > -0.1 && r > 0.5) && (n = -1, t.x = Math.max(t.x, 0)), e.moveIndexBy(n, !0, t.x);
|
|
1356
1374
|
}
|
|
1357
1375
|
i && i.currZoomLevel > i.zoomLevels.max || this.gestures.isMultitouch ? this.gestures.zoomLevels.correctZoomPan(!0) : (this._finishPanGestureForAxis("x"), this._finishPanGestureForAxis("y"));
|
|
1358
1376
|
}
|
|
@@ -1371,10 +1389,10 @@ class Se {
|
|
|
1371
1389
|
const {
|
|
1372
1390
|
pan: n,
|
|
1373
1391
|
bounds: o
|
|
1374
|
-
} = i, r = n[t], a = this.pswp.bgOpacity < 1 && t === "y", h = r +
|
|
1392
|
+
} = i, r = n[t], a = this.pswp.bgOpacity < 1 && t === "y", h = r + be(e[t], 0.995);
|
|
1375
1393
|
if (a) {
|
|
1376
|
-
const
|
|
1377
|
-
if (
|
|
1394
|
+
const u = this._getVerticalDragRatio(r), m = this._getVerticalDragRatio(h);
|
|
1395
|
+
if (u < 0 && m < -0.4 || u > 0 && m > we) {
|
|
1378
1396
|
this.pswp.close();
|
|
1379
1397
|
return;
|
|
1380
1398
|
}
|
|
@@ -1382,7 +1400,7 @@ class Se {
|
|
|
1382
1400
|
const c = o.correctPan(t, h);
|
|
1383
1401
|
if (r === c)
|
|
1384
1402
|
return;
|
|
1385
|
-
const d = c === h ? 1 : 0.82,
|
|
1403
|
+
const d = c === h ? 1 : 0.82, p = this.pswp.bgOpacity, g = c - r;
|
|
1386
1404
|
this.pswp.animations.startSpring({
|
|
1387
1405
|
name: "panGesture" + t,
|
|
1388
1406
|
isPan: !0,
|
|
@@ -1390,12 +1408,12 @@ class Se {
|
|
|
1390
1408
|
end: c,
|
|
1391
1409
|
velocity: e[t],
|
|
1392
1410
|
dampingRatio: d,
|
|
1393
|
-
onUpdate: (
|
|
1411
|
+
onUpdate: (u) => {
|
|
1394
1412
|
if (a && this.pswp.bgOpacity < 1) {
|
|
1395
|
-
const m = 1 - (c -
|
|
1396
|
-
this.pswp.applyBgOpacity(q(
|
|
1413
|
+
const m = 1 - (c - u) / g;
|
|
1414
|
+
this.pswp.applyBgOpacity(q(p + (1 - p) * m, 0, 1));
|
|
1397
1415
|
}
|
|
1398
|
-
n[t] = Math.floor(
|
|
1416
|
+
n[t] = Math.floor(u), i.applyCurrentZoomPan();
|
|
1399
1417
|
}
|
|
1400
1418
|
});
|
|
1401
1419
|
}
|
|
@@ -1427,8 +1445,8 @@ class Se {
|
|
|
1427
1445
|
bounds: c
|
|
1428
1446
|
} = r, d = r.pan[t] + l;
|
|
1429
1447
|
if (this.pswp.options.allowPanToNext && i === "x" && t === "x" && !o) {
|
|
1430
|
-
const
|
|
1431
|
-
if (d > c.min[t] &&
|
|
1448
|
+
const p = a.getCurrSlideX(), g = a.x - p, u = l > 0, m = !u;
|
|
1449
|
+
if (d > c.min[t] && u) {
|
|
1432
1450
|
if (c.min[t] <= this.startPan[t])
|
|
1433
1451
|
return a.moveTo(h, !0), !0;
|
|
1434
1452
|
this._setPanWithFriction(t, d);
|
|
@@ -1438,9 +1456,9 @@ class Se {
|
|
|
1438
1456
|
this._setPanWithFriction(t, d);
|
|
1439
1457
|
} else if (g !== 0) {
|
|
1440
1458
|
if (g > 0)
|
|
1441
|
-
return a.moveTo(Math.max(h,
|
|
1459
|
+
return a.moveTo(Math.max(h, p), !0), !0;
|
|
1442
1460
|
if (g < 0)
|
|
1443
|
-
return a.moveTo(Math.min(h,
|
|
1461
|
+
return a.moveTo(Math.min(h, p), !0), !0;
|
|
1444
1462
|
} else
|
|
1445
1463
|
this._setPanWithFriction(t, d);
|
|
1446
1464
|
} else
|
|
@@ -1486,16 +1504,16 @@ class Se {
|
|
|
1486
1504
|
} = n;
|
|
1487
1505
|
if (r.correctPan(t, e) !== e || i) {
|
|
1488
1506
|
const l = Math.round(e - o[t]);
|
|
1489
|
-
o[t] += l * (i ||
|
|
1507
|
+
o[t] += l * (i || ve);
|
|
1490
1508
|
} else
|
|
1491
1509
|
o[t] = e;
|
|
1492
1510
|
}
|
|
1493
1511
|
}
|
|
1494
|
-
const
|
|
1495
|
-
function
|
|
1512
|
+
const Ee = 0.05, Pe = 0.15;
|
|
1513
|
+
function st(s, t, e) {
|
|
1496
1514
|
return s.x = (t.x + e.x) / 2, s.y = (t.y + e.y) / 2, s;
|
|
1497
1515
|
}
|
|
1498
|
-
class
|
|
1516
|
+
class Ae {
|
|
1499
1517
|
/**
|
|
1500
1518
|
* @param {Gestures} gestures
|
|
1501
1519
|
*/
|
|
@@ -1532,7 +1550,7 @@ class Ee {
|
|
|
1532
1550
|
const a = r.zoomLevels.min, l = r.zoomLevels.max;
|
|
1533
1551
|
if (!r.isZoomable() || o.mainScroll.isShifted())
|
|
1534
1552
|
return;
|
|
1535
|
-
|
|
1553
|
+
st(this._startZoomPoint, e, n), st(this._zoomPoint, t, i);
|
|
1536
1554
|
let h = 1 / W(e, n) * W(t, i) * this._startZoomLevel;
|
|
1537
1555
|
if (h > r.zoomLevels.initial + r.zoomLevels.initial / 15 && (this._wasOverFitZoomLevel = !0), h < a)
|
|
1538
1556
|
if (o.options.pinchToClose && !this._wasOverFitZoomLevel && this._startZoomLevel <= r.zoomLevels.initial) {
|
|
@@ -1541,8 +1559,8 @@ class Ee {
|
|
|
1541
1559
|
bgOpacity: c
|
|
1542
1560
|
}).defaultPrevented || o.applyBgOpacity(c);
|
|
1543
1561
|
} else
|
|
1544
|
-
h = a - (a - h) *
|
|
1545
|
-
else h > l && (h = l + (h - l) *
|
|
1562
|
+
h = a - (a - h) * Pe;
|
|
1563
|
+
else h > l && (h = l + (h - l) * Ee);
|
|
1546
1564
|
r.pan.x = this._calculatePanForZoomLevel("x", h), r.pan.y = this._calculatePanForZoomLevel("y", h), r.setZoomLevel(h), r.applyCurrentZoomPan();
|
|
1547
1565
|
}
|
|
1548
1566
|
end() {
|
|
@@ -1610,15 +1628,15 @@ class Ee {
|
|
|
1610
1628
|
velocity: 0,
|
|
1611
1629
|
dampingRatio: 1,
|
|
1612
1630
|
naturalFrequency: 40,
|
|
1613
|
-
onUpdate: (
|
|
1614
|
-
if (
|
|
1615
|
-
if (d && (i.pan.x = h.x + (c.x - h.x) *
|
|
1616
|
-
const g = n + (o - n) *
|
|
1631
|
+
onUpdate: (p) => {
|
|
1632
|
+
if (p /= 1e3, d || r) {
|
|
1633
|
+
if (d && (i.pan.x = h.x + (c.x - h.x) * p, i.pan.y = h.y + (c.y - h.y) * p), r) {
|
|
1634
|
+
const g = n + (o - n) * p;
|
|
1617
1635
|
i.setZoomLevel(g);
|
|
1618
1636
|
}
|
|
1619
1637
|
i.applyCurrentZoomPan();
|
|
1620
1638
|
}
|
|
1621
|
-
l && e.bgOpacity < 1 && e.applyBgOpacity(q(a + (1 - a) *
|
|
1639
|
+
l && e.bgOpacity < 1 && e.applyBgOpacity(q(a + (1 - a) * p, 0, 1));
|
|
1622
1640
|
},
|
|
1623
1641
|
onComplete: () => {
|
|
1624
1642
|
i._setResolution(o), i.applyCurrentZoomPan();
|
|
@@ -1626,11 +1644,11 @@ class Ee {
|
|
|
1626
1644
|
});
|
|
1627
1645
|
}
|
|
1628
1646
|
}
|
|
1629
|
-
function
|
|
1647
|
+
function nt(s) {
|
|
1630
1648
|
return !!/** @type {HTMLElement} */
|
|
1631
1649
|
s.target.closest(".pswp__container");
|
|
1632
1650
|
}
|
|
1633
|
-
class
|
|
1651
|
+
class xe {
|
|
1634
1652
|
/**
|
|
1635
1653
|
* @param {Gestures} gestures
|
|
1636
1654
|
*/
|
|
@@ -1653,14 +1671,14 @@ class Pe {
|
|
|
1653
1671
|
* @param {PointerEvent} originalEvent
|
|
1654
1672
|
*/
|
|
1655
1673
|
tap(t, e) {
|
|
1656
|
-
|
|
1674
|
+
nt(e) && this._doClickOrTapAction("tap", t, e);
|
|
1657
1675
|
}
|
|
1658
1676
|
/**
|
|
1659
1677
|
* @param {Point} point
|
|
1660
1678
|
* @param {PointerEvent} originalEvent
|
|
1661
1679
|
*/
|
|
1662
1680
|
doubleTap(t, e) {
|
|
1663
|
-
|
|
1681
|
+
nt(e) && this._doClickOrTapAction("doubleTap", t, e);
|
|
1664
1682
|
}
|
|
1665
1683
|
/**
|
|
1666
1684
|
* @private
|
|
@@ -1704,8 +1722,8 @@ class Pe {
|
|
|
1704
1722
|
}
|
|
1705
1723
|
}
|
|
1706
1724
|
}
|
|
1707
|
-
const
|
|
1708
|
-
class
|
|
1725
|
+
const Ie = 10, Ce = 300, Te = 25;
|
|
1726
|
+
class ze {
|
|
1709
1727
|
/**
|
|
1710
1728
|
* @param {PhotoSwipe} pswp
|
|
1711
1729
|
*/
|
|
@@ -1737,7 +1755,7 @@ class Ce {
|
|
|
1737
1755
|
}, this._intervalP1 = {
|
|
1738
1756
|
x: 0,
|
|
1739
1757
|
y: 0
|
|
1740
|
-
}, 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
|
|
1758
|
+
}, 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 Le(this), this.zoomLevels = new Ae(this), this.tapHandler = new xe(this), t.on("bindEvents", () => {
|
|
1741
1759
|
t.events.add(
|
|
1742
1760
|
t.scrollWrap,
|
|
1743
1761
|
"click",
|
|
@@ -1857,8 +1875,8 @@ class Ce {
|
|
|
1857
1875
|
this.tapHandler.click(this.startP1, t);
|
|
1858
1876
|
return;
|
|
1859
1877
|
}
|
|
1860
|
-
const i = this.pswp.options.doubleTapAction ?
|
|
1861
|
-
this._tapTimer ? (this._clearTapTimer(), W(this._lastStartP1, this.startP1) <
|
|
1878
|
+
const i = this.pswp.options.doubleTapAction ? Ce : 0;
|
|
1879
|
+
this._tapTimer ? (this._clearTapTimer(), W(this._lastStartP1, this.startP1) < Te && this.tapHandler.doubleTap(this.startP1, t)) : (_(this._lastStartP1, this.startP1), this._tapTimer = setTimeout(() => {
|
|
1862
1880
|
this.tapHandler.tap(this.startP1, t), this._clearTapTimer();
|
|
1863
1881
|
}, i));
|
|
1864
1882
|
}
|
|
@@ -1944,7 +1962,7 @@ class Ce {
|
|
|
1944
1962
|
const t = Math.abs(this.p1.x - this.startP1.x) - Math.abs(this.p1.y - this.startP1.y);
|
|
1945
1963
|
if (t !== 0) {
|
|
1946
1964
|
const e = t > 0 ? "x" : "y";
|
|
1947
|
-
Math.abs(this.p1[e] - this.startP1[e]) >=
|
|
1965
|
+
Math.abs(this.p1[e] - this.startP1[e]) >= Ie && (this.dragAxis = e);
|
|
1948
1966
|
}
|
|
1949
1967
|
}
|
|
1950
1968
|
}
|
|
@@ -1968,8 +1986,8 @@ class Ce {
|
|
|
1968
1986
|
this.pswp.mainScroll.isShifted() && (t.preventDefault(), t.stopPropagation());
|
|
1969
1987
|
}
|
|
1970
1988
|
}
|
|
1971
|
-
const
|
|
1972
|
-
class
|
|
1989
|
+
const Oe = 0.35;
|
|
1990
|
+
class De {
|
|
1973
1991
|
/**
|
|
1974
1992
|
* @param {PhotoSwipe} pswp
|
|
1975
1993
|
*/
|
|
@@ -2122,7 +2140,7 @@ class ze {
|
|
|
2122
2140
|
let i = (this.slideWidth * this._currPositionIndex - t) / this.slideWidth;
|
|
2123
2141
|
i += this.pswp.currIndex;
|
|
2124
2142
|
const n = Math.round(t - this.x);
|
|
2125
|
-
(i < 0 && n > 0 || i >= this.pswp.getNumItems() - 1 && n < 0) && (t = this.x + n *
|
|
2143
|
+
(i < 0 && n > 0 || i >= this.pswp.getNumItems() - 1 && n < 0) && (t = this.x + n * Oe);
|
|
2126
2144
|
}
|
|
2127
2145
|
this.x = t, this.pswp.container && I(this.pswp.container, t), this.pswp.dispatch("moveMainScroll", {
|
|
2128
2146
|
x: t,
|
|
@@ -2130,7 +2148,7 @@ class ze {
|
|
|
2130
2148
|
});
|
|
2131
2149
|
}
|
|
2132
2150
|
}
|
|
2133
|
-
const
|
|
2151
|
+
const Me = {
|
|
2134
2152
|
Escape: 27,
|
|
2135
2153
|
z: 90,
|
|
2136
2154
|
ArrowLeft: 37,
|
|
@@ -2138,8 +2156,8 @@ const Oe = {
|
|
|
2138
2156
|
ArrowRight: 39,
|
|
2139
2157
|
ArrowDown: 40,
|
|
2140
2158
|
Tab: 9
|
|
2141
|
-
}, x = (s, t) => t ? s :
|
|
2142
|
-
class
|
|
2159
|
+
}, x = (s, t) => t ? s : Me[s];
|
|
2160
|
+
class $e {
|
|
2143
2161
|
/**
|
|
2144
2162
|
* @param {PhotoSwipe} pswp
|
|
2145
2163
|
*/
|
|
@@ -2179,7 +2197,7 @@ class De {
|
|
|
2179
2197
|
} = this;
|
|
2180
2198
|
if (e.dispatch("keydown", {
|
|
2181
2199
|
originalEvent: t
|
|
2182
|
-
}).defaultPrevented ||
|
|
2200
|
+
}).defaultPrevented || pe(t))
|
|
2183
2201
|
return;
|
|
2184
2202
|
let i, n, o = !1;
|
|
2185
2203
|
const r = "key" in t;
|
|
@@ -2231,7 +2249,7 @@ class De {
|
|
|
2231
2249
|
) && e.focus();
|
|
2232
2250
|
}
|
|
2233
2251
|
}
|
|
2234
|
-
const
|
|
2252
|
+
const Fe = "cubic-bezier(.4,0,.22,1)";
|
|
2235
2253
|
class Ze {
|
|
2236
2254
|
/**
|
|
2237
2255
|
* onComplete can be unpredictable, be careful about current state
|
|
@@ -2248,12 +2266,12 @@ class Ze {
|
|
|
2248
2266
|
onFinish: r = () => {
|
|
2249
2267
|
},
|
|
2250
2268
|
duration: a = 333,
|
|
2251
|
-
easing: l =
|
|
2269
|
+
easing: l = Fe
|
|
2252
2270
|
} = t;
|
|
2253
2271
|
this.onFinish = r;
|
|
2254
2272
|
const h = o ? "transform" : "opacity", c = (e = t[h]) !== null && e !== void 0 ? e : "";
|
|
2255
2273
|
this._target = i, this._onComplete = n, this._finished = !1, this._onTransitionEnd = this._onTransitionEnd.bind(this), this._helperTimeout = setTimeout(() => {
|
|
2256
|
-
|
|
2274
|
+
ft(i, h, a, l), this._helperTimeout = setTimeout(() => {
|
|
2257
2275
|
i.addEventListener("transitionend", this._onTransitionEnd, !1), i.addEventListener("transitioncancel", this._onTransitionEnd, !1), this._helperTimeout = setTimeout(() => {
|
|
2258
2276
|
this._finalizeAnimation();
|
|
2259
2277
|
}, a + 500), i.style[h] = c;
|
|
@@ -2275,11 +2293,11 @@ class Ze {
|
|
|
2275
2293
|
}
|
|
2276
2294
|
// Destroy is called automatically onFinish
|
|
2277
2295
|
destroy() {
|
|
2278
|
-
this._helperTimeout && clearTimeout(this._helperTimeout),
|
|
2296
|
+
this._helperTimeout && clearTimeout(this._helperTimeout), de(this._target), this._target.removeEventListener("transitionend", this._onTransitionEnd, !1), this._target.removeEventListener("transitioncancel", this._onTransitionEnd, !1), this._finished || this._finalizeAnimation();
|
|
2279
2297
|
}
|
|
2280
2298
|
}
|
|
2281
|
-
const
|
|
2282
|
-
class
|
|
2299
|
+
const Re = 12, ke = 0.75;
|
|
2300
|
+
class qe {
|
|
2283
2301
|
/**
|
|
2284
2302
|
* @param {number} initialVelocity Initial velocity, px per ms.
|
|
2285
2303
|
*
|
|
@@ -2296,7 +2314,7 @@ class Re {
|
|
|
2296
2314
|
* Recommended value from 10 to 50
|
|
2297
2315
|
*/
|
|
2298
2316
|
constructor(t, e, i) {
|
|
2299
|
-
this.velocity = t * 1e3, this._dampingRatio = e ||
|
|
2317
|
+
this.velocity = t * 1e3, this._dampingRatio = e || ke, this._naturalFrequency = i || Re, this._dampedFrequency = this._naturalFrequency, this._dampingRatio < 1 && (this._dampedFrequency *= Math.sqrt(1 - this._dampingRatio * this._dampingRatio));
|
|
2300
2318
|
}
|
|
2301
2319
|
/**
|
|
2302
2320
|
* @param {number} deltaPosition Difference between current and end position of the animation
|
|
@@ -2318,7 +2336,7 @@ class Re {
|
|
|
2318
2336
|
return i;
|
|
2319
2337
|
}
|
|
2320
2338
|
}
|
|
2321
|
-
class
|
|
2339
|
+
class Ne {
|
|
2322
2340
|
/**
|
|
2323
2341
|
* @param {SpringAnimationProps} props
|
|
2324
2342
|
*/
|
|
@@ -2336,10 +2354,10 @@ class ke {
|
|
|
2336
2354
|
naturalFrequency: h
|
|
2337
2355
|
} = t;
|
|
2338
2356
|
this.onFinish = a;
|
|
2339
|
-
const c = new
|
|
2340
|
-
let d = Date.now(),
|
|
2357
|
+
const c = new qe(n, l, h);
|
|
2358
|
+
let d = Date.now(), p = e - i;
|
|
2341
2359
|
const g = () => {
|
|
2342
|
-
this._raf && (
|
|
2360
|
+
this._raf && (p = c.easeFrame(p, Date.now() - d), Math.abs(p) < 1 && Math.abs(c.velocity) < 50 ? (o(i), r && r(), this.onFinish()) : (d = Date.now(), o(p + i), this._raf = requestAnimationFrame(g)));
|
|
2343
2361
|
};
|
|
2344
2362
|
this._raf = requestAnimationFrame(g);
|
|
2345
2363
|
}
|
|
@@ -2348,7 +2366,7 @@ class ke {
|
|
|
2348
2366
|
this._raf >= 0 && cancelAnimationFrame(this._raf), this._raf = 0;
|
|
2349
2367
|
}
|
|
2350
2368
|
}
|
|
2351
|
-
class
|
|
2369
|
+
class Be {
|
|
2352
2370
|
constructor() {
|
|
2353
2371
|
this.activeAnimations = [];
|
|
2354
2372
|
}
|
|
@@ -2371,7 +2389,7 @@ class qe {
|
|
|
2371
2389
|
* @returns {Animation}
|
|
2372
2390
|
*/
|
|
2373
2391
|
_start(t, e) {
|
|
2374
|
-
const i = e ? new
|
|
2392
|
+
const i = e ? new Ne(
|
|
2375
2393
|
/** @type SpringAnimationProps */
|
|
2376
2394
|
t
|
|
2377
2395
|
) : new Ze(
|
|
@@ -2417,7 +2435,7 @@ class qe {
|
|
|
2417
2435
|
return this.activeAnimations.some((t) => t.props.isPan);
|
|
2418
2436
|
}
|
|
2419
2437
|
}
|
|
2420
|
-
class
|
|
2438
|
+
class He {
|
|
2421
2439
|
/**
|
|
2422
2440
|
* @param {PhotoSwipe} pswp
|
|
2423
2441
|
*/
|
|
@@ -2459,7 +2477,7 @@ class Ne {
|
|
|
2459
2477
|
e.isPannable() && (t.deltaMode === 1 && (i *= 18, n *= 18), e.panTo(e.pan.x - i, e.pan.y - n));
|
|
2460
2478
|
}
|
|
2461
2479
|
}
|
|
2462
|
-
function
|
|
2480
|
+
function We(s) {
|
|
2463
2481
|
if (typeof s == "string")
|
|
2464
2482
|
return s;
|
|
2465
2483
|
if (!s || !s.isCustomSVG)
|
|
@@ -2471,7 +2489,7 @@ function Be(s) {
|
|
|
2471
2489
|
t.size || 32
|
|
2472
2490
|
), t.outlineID && (e += '<use class="pswp__icn-shadow" xlink:href="#' + t.outlineID + '"/>'), e += t.inner, e += "</svg>", e;
|
|
2473
2491
|
}
|
|
2474
|
-
class
|
|
2492
|
+
class Ve {
|
|
2475
2493
|
/**
|
|
2476
2494
|
* @param {PhotoSwipe} pswp
|
|
2477
2495
|
* @param {UIElementData} data
|
|
@@ -2497,13 +2515,13 @@ class He {
|
|
|
2497
2515
|
title: d
|
|
2498
2516
|
} = e;
|
|
2499
2517
|
const {
|
|
2500
|
-
ariaLabel:
|
|
2518
|
+
ariaLabel: p
|
|
2501
2519
|
} = e;
|
|
2502
2520
|
typeof t.options[n + "Title"] == "string" && (d = t.options[n + "Title"]), d && (l.title = d);
|
|
2503
|
-
const g =
|
|
2521
|
+
const g = p || d;
|
|
2504
2522
|
g && l.setAttribute("aria-label", g);
|
|
2505
2523
|
}
|
|
2506
|
-
l.innerHTML =
|
|
2524
|
+
l.innerHTML = We(o), e.onInit && e.onInit(l, t), e.onClick && (l.onclick = (d) => {
|
|
2507
2525
|
typeof e.onClick == "string" ? t[e.onClick]() : typeof e.onClick == "function" && e.onClick(d, l, t);
|
|
2508
2526
|
});
|
|
2509
2527
|
const h = e.appendTo || "bar";
|
|
@@ -2511,12 +2529,12 @@ class He {
|
|
|
2511
2529
|
h === "bar" ? (t.topBar || (t.topBar = w("pswp__top-bar pswp__hide-on-close", "div", t.scrollWrap)), c = t.topBar) : (l.classList.add("pswp__hide-on-close"), h === "wrapper" && (c = t.scrollWrap)), (i = c) === null || i === void 0 || i.appendChild(t.applyFilters("uiElement", l, e));
|
|
2512
2530
|
}
|
|
2513
2531
|
}
|
|
2514
|
-
function
|
|
2532
|
+
function wt(s, t, e) {
|
|
2515
2533
|
s.classList.add("pswp__button--arrow"), s.setAttribute("aria-controls", "pswp__items"), t.on("change", () => {
|
|
2516
2534
|
t.options.loop || (e ? s.disabled = !(t.currIndex < t.getNumItems() - 1) : s.disabled = !(t.currIndex > 0));
|
|
2517
2535
|
});
|
|
2518
2536
|
}
|
|
2519
|
-
const
|
|
2537
|
+
const je = {
|
|
2520
2538
|
name: "arrowPrev",
|
|
2521
2539
|
className: "pswp__button--arrow--prev",
|
|
2522
2540
|
title: "Previous",
|
|
@@ -2530,8 +2548,8 @@ const We = {
|
|
|
2530
2548
|
outlineID: "pswp__icn-arrow"
|
|
2531
2549
|
},
|
|
2532
2550
|
onClick: "prev",
|
|
2533
|
-
onInit:
|
|
2534
|
-
},
|
|
2551
|
+
onInit: wt
|
|
2552
|
+
}, Ue = {
|
|
2535
2553
|
name: "arrowNext",
|
|
2536
2554
|
className: "pswp__button--arrow--next",
|
|
2537
2555
|
title: "Next",
|
|
@@ -2546,9 +2564,9 @@ const We = {
|
|
|
2546
2564
|
},
|
|
2547
2565
|
onClick: "next",
|
|
2548
2566
|
onInit: (s, t) => {
|
|
2549
|
-
|
|
2567
|
+
wt(s, t, !0);
|
|
2550
2568
|
}
|
|
2551
|
-
},
|
|
2569
|
+
}, Ge = {
|
|
2552
2570
|
name: "close",
|
|
2553
2571
|
title: "Close",
|
|
2554
2572
|
order: 20,
|
|
@@ -2559,7 +2577,7 @@ const We = {
|
|
|
2559
2577
|
outlineID: "pswp__icn-close"
|
|
2560
2578
|
},
|
|
2561
2579
|
onClick: "close"
|
|
2562
|
-
},
|
|
2580
|
+
}, Ke = {
|
|
2563
2581
|
name: "zoom",
|
|
2564
2582
|
title: "Zoom",
|
|
2565
2583
|
order: 10,
|
|
@@ -2571,7 +2589,7 @@ const We = {
|
|
|
2571
2589
|
outlineID: "pswp__icn-zoom"
|
|
2572
2590
|
},
|
|
2573
2591
|
onClick: "toggleZoom"
|
|
2574
|
-
},
|
|
2592
|
+
}, Xe = {
|
|
2575
2593
|
name: "preloader",
|
|
2576
2594
|
appendTo: "bar",
|
|
2577
2595
|
order: 7,
|
|
@@ -2602,7 +2620,7 @@ const We = {
|
|
|
2602
2620
|
t.currSlide === a.slide && r();
|
|
2603
2621
|
}), t.ui && (t.ui.updatePreloaderVisibility = r);
|
|
2604
2622
|
}
|
|
2605
|
-
},
|
|
2623
|
+
}, Ye = {
|
|
2606
2624
|
name: "counter",
|
|
2607
2625
|
order: 5,
|
|
2608
2626
|
onInit: (s, t) => {
|
|
@@ -2611,10 +2629,10 @@ const We = {
|
|
|
2611
2629
|
});
|
|
2612
2630
|
}
|
|
2613
2631
|
};
|
|
2614
|
-
function
|
|
2632
|
+
function ot(s, t) {
|
|
2615
2633
|
s.classList.toggle("pswp--zoomed-in", t);
|
|
2616
2634
|
}
|
|
2617
|
-
class
|
|
2635
|
+
class Qe {
|
|
2618
2636
|
/**
|
|
2619
2637
|
* @param {PhotoSwipe} pswp
|
|
2620
2638
|
*/
|
|
@@ -2626,7 +2644,7 @@ class Xe {
|
|
|
2626
2644
|
const {
|
|
2627
2645
|
pswp: t
|
|
2628
2646
|
} = this;
|
|
2629
|
-
this.isRegistered = !1, this.uiElementsData = [
|
|
2647
|
+
this.isRegistered = !1, this.uiElementsData = [Ge, je, Ue, Ke, Xe, Ye], t.dispatch("uiRegister"), this.uiElementsData.sort((e, i) => (e.order || 0) - (i.order || 0)), this.items = [], this.isRegistered = !0, this.uiElementsData.forEach((e) => {
|
|
2630
2648
|
this.registerElement(e);
|
|
2631
2649
|
}), t.on("change", () => {
|
|
2632
2650
|
var e;
|
|
@@ -2637,7 +2655,7 @@ class Xe {
|
|
|
2637
2655
|
* @param {UIElementData} elementData
|
|
2638
2656
|
*/
|
|
2639
2657
|
registerElement(t) {
|
|
2640
|
-
this.isRegistered ? this.items.push(new
|
|
2658
|
+
this.isRegistered ? this.items.push(new Ve(this.pswp, t)) : this.uiElementsData.push(t);
|
|
2641
2659
|
}
|
|
2642
2660
|
/**
|
|
2643
2661
|
* Fired each time zoom or pan position is changed.
|
|
@@ -2661,15 +2679,15 @@ class Xe {
|
|
|
2661
2679
|
this._lastUpdatedZoomLevel = n;
|
|
2662
2680
|
const o = e.zoomLevels.initial - e.zoomLevels.secondary;
|
|
2663
2681
|
if (Math.abs(o) < 0.01 || !e.isZoomable()) {
|
|
2664
|
-
|
|
2682
|
+
ot(t, !1), t.classList.remove("pswp--zoom-allowed");
|
|
2665
2683
|
return;
|
|
2666
2684
|
}
|
|
2667
2685
|
t.classList.add("pswp--zoom-allowed");
|
|
2668
2686
|
const r = n === e.zoomLevels.initial ? e.zoomLevels.secondary : e.zoomLevels.initial;
|
|
2669
|
-
|
|
2687
|
+
ot(t, r <= n), (i.imageClickAction === "zoom" || i.imageClickAction === "zoom-or-close") && t.classList.add("pswp--click-to-zoom");
|
|
2670
2688
|
}
|
|
2671
2689
|
}
|
|
2672
|
-
function
|
|
2690
|
+
function Je(s) {
|
|
2673
2691
|
const t = s.getBoundingClientRect();
|
|
2674
2692
|
return {
|
|
2675
2693
|
x: t.left,
|
|
@@ -2677,7 +2695,7 @@ function Ye(s) {
|
|
|
2677
2695
|
w: t.width
|
|
2678
2696
|
};
|
|
2679
2697
|
}
|
|
2680
|
-
function
|
|
2698
|
+
function ti(s, t, e) {
|
|
2681
2699
|
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, h = {
|
|
2682
2700
|
x: i.left + a,
|
|
2683
2701
|
y: i.top + l,
|
|
@@ -2690,7 +2708,7 @@ function Qe(s, t, e) {
|
|
|
2690
2708
|
y: l
|
|
2691
2709
|
}, h;
|
|
2692
2710
|
}
|
|
2693
|
-
function
|
|
2711
|
+
function ei(s, t, e) {
|
|
2694
2712
|
const i = e.dispatch("thumbBounds", {
|
|
2695
2713
|
index: s,
|
|
2696
2714
|
itemData: t,
|
|
@@ -2709,9 +2727,9 @@ function Je(s, t, e) {
|
|
|
2709
2727
|
n.querySelector(a)
|
|
2710
2728
|
);
|
|
2711
2729
|
}
|
|
2712
|
-
return r = e.applyFilters("thumbEl", r, t, s), r && (t.thumbCropped ? o =
|
|
2730
|
+
return r = e.applyFilters("thumbEl", r, t, s), r && (t.thumbCropped ? o = ti(r, t.width || t.w || 0, t.height || t.h || 0) : o = Je(r)), e.applyFilters("thumbBounds", o, t, s);
|
|
2713
2731
|
}
|
|
2714
|
-
let
|
|
2732
|
+
let ii = class {
|
|
2715
2733
|
/**
|
|
2716
2734
|
* @param {T} type
|
|
2717
2735
|
* @param {PhotoSwipeEventsMap[T]} [details]
|
|
@@ -2722,7 +2740,7 @@ let ti = class {
|
|
|
2722
2740
|
preventDefault() {
|
|
2723
2741
|
this.defaultPrevented = !0;
|
|
2724
2742
|
}
|
|
2725
|
-
},
|
|
2743
|
+
}, si = class {
|
|
2726
2744
|
constructor() {
|
|
2727
2745
|
this._listeners = {}, this._filters = {}, this.pswp = void 0, this.options = void 0;
|
|
2728
2746
|
}
|
|
@@ -2789,13 +2807,13 @@ let ti = class {
|
|
|
2789
2807
|
return this.pswp.dispatch(t, e);
|
|
2790
2808
|
const n = (
|
|
2791
2809
|
/** @type {AugmentedEvent<T>} */
|
|
2792
|
-
new
|
|
2810
|
+
new ii(t, e)
|
|
2793
2811
|
);
|
|
2794
2812
|
return (i = this._listeners[t]) === null || i === void 0 || i.forEach((o) => {
|
|
2795
2813
|
o.call(this, n);
|
|
2796
2814
|
}), n;
|
|
2797
2815
|
}
|
|
2798
|
-
},
|
|
2816
|
+
}, ni = class {
|
|
2799
2817
|
/**
|
|
2800
2818
|
* @param {string | false} imageSrc
|
|
2801
2819
|
* @param {HTMLElement} container
|
|
@@ -2821,7 +2839,7 @@ let ti = class {
|
|
|
2821
2839
|
var t;
|
|
2822
2840
|
(t = this.element) !== null && t !== void 0 && t.parentNode && this.element.remove(), this.element = null;
|
|
2823
2841
|
}
|
|
2824
|
-
},
|
|
2842
|
+
}, oi = class {
|
|
2825
2843
|
/**
|
|
2826
2844
|
* @param {SlideData} itemData Slide data
|
|
2827
2845
|
* @param {PhotoSwipeBase} instance PhotoSwipe or PhotoSwipeLightbox instance
|
|
@@ -2856,7 +2874,7 @@ let ti = class {
|
|
|
2856
2874
|
this.data.msrc && this.slide.isFirstSlide ? this.data.msrc : !1,
|
|
2857
2875
|
this
|
|
2858
2876
|
);
|
|
2859
|
-
this.placeholder = new
|
|
2877
|
+
this.placeholder = new ni(i, this.slide.container);
|
|
2860
2878
|
}
|
|
2861
2879
|
this.element && !e || this.instance.dispatch("contentLoad", {
|
|
2862
2880
|
content: this,
|
|
@@ -3026,7 +3044,7 @@ let ti = class {
|
|
|
3026
3044
|
}).defaultPrevented)
|
|
3027
3045
|
return;
|
|
3028
3046
|
const t = "decode" in this.element;
|
|
3029
|
-
this.isImageContent() ? t && this.slide && (!this.slide.isActive ||
|
|
3047
|
+
this.isImageContent() ? t && this.slide && (!this.slide.isActive || et()) ? (this.isDecoding = !0, this.element.decode().catch(() => {
|
|
3030
3048
|
}).finally(() => {
|
|
3031
3049
|
this.isDecoding = !1, this.appendImage();
|
|
3032
3050
|
})) : this.appendImage() : this.slide && !this.element.parentNode && this.slide.container.appendChild(this.element);
|
|
@@ -3039,7 +3057,7 @@ let ti = class {
|
|
|
3039
3057
|
activate() {
|
|
3040
3058
|
this.instance.dispatch("contentActivate", {
|
|
3041
3059
|
content: this
|
|
3042
|
-
}).defaultPrevented || !this.slide || (this.isImageContent() && this.isDecoding && !
|
|
3060
|
+
}).defaultPrevented || !this.slide || (this.isImageContent() && this.isDecoding && !et() ? this.appendImage() : this.isError() && this.load(!1, !0), this.slide.holderElement && this.slide.holderElement.setAttribute("aria-hidden", "false"));
|
|
3043
3061
|
}
|
|
3044
3062
|
/**
|
|
3045
3063
|
* Deactivate the content
|
|
@@ -3066,36 +3084,36 @@ let ti = class {
|
|
|
3066
3084
|
}).defaultPrevented || (this.slide && this.element && !this.element.parentNode && this.slide.container.appendChild(this.element), (this.state === S.LOADED || this.state === S.ERROR) && this.removePlaceholder()));
|
|
3067
3085
|
}
|
|
3068
3086
|
};
|
|
3069
|
-
const
|
|
3070
|
-
function
|
|
3087
|
+
const ri = 5;
|
|
3088
|
+
function St(s, t, e) {
|
|
3071
3089
|
const i = t.createContentFromData(s, e);
|
|
3072
3090
|
let n;
|
|
3073
3091
|
const {
|
|
3074
3092
|
options: o
|
|
3075
3093
|
} = t;
|
|
3076
3094
|
if (o) {
|
|
3077
|
-
n = new
|
|
3095
|
+
n = new yt(o, s, -1);
|
|
3078
3096
|
let r;
|
|
3079
|
-
t.pswp ? r = t.pswp.viewportSize : r =
|
|
3080
|
-
const a =
|
|
3097
|
+
t.pswp ? r = t.pswp.viewportSize : r = _t(o, t);
|
|
3098
|
+
const a = vt(o, r, s, e);
|
|
3081
3099
|
n.update(i.width, i.height, a);
|
|
3082
3100
|
}
|
|
3083
3101
|
return i.lazyLoad(), n && i.setDisplayedSize(Math.ceil(i.width * n.initial), Math.ceil(i.height * n.initial)), i;
|
|
3084
3102
|
}
|
|
3085
|
-
function
|
|
3103
|
+
function ai(s, t) {
|
|
3086
3104
|
const e = t.getItemData(s);
|
|
3087
3105
|
if (!t.dispatch("lazyLoadSlide", {
|
|
3088
3106
|
index: s,
|
|
3089
3107
|
itemData: e
|
|
3090
3108
|
}).defaultPrevented)
|
|
3091
|
-
return
|
|
3109
|
+
return St(e, t, s);
|
|
3092
3110
|
}
|
|
3093
|
-
class
|
|
3111
|
+
class li {
|
|
3094
3112
|
/**
|
|
3095
3113
|
* @param {PhotoSwipe} pswp
|
|
3096
3114
|
*/
|
|
3097
3115
|
constructor(t) {
|
|
3098
|
-
this.pswp = t, this.limit = Math.max(t.options.preload[0] + t.options.preload[1] + 1,
|
|
3116
|
+
this.pswp = t, this.limit = Math.max(t.options.preload[0] + t.options.preload[1] + 1, ri), this._cachedItems = [];
|
|
3099
3117
|
}
|
|
3100
3118
|
/**
|
|
3101
3119
|
* Lazy load nearby slides based on `preload` option.
|
|
@@ -3123,7 +3141,7 @@ class ri {
|
|
|
3123
3141
|
loadSlideByIndex(t) {
|
|
3124
3142
|
const e = this.pswp.getLoopedIndex(t);
|
|
3125
3143
|
let i = this.getContentByIndex(e);
|
|
3126
|
-
i || (i =
|
|
3144
|
+
i || (i = ai(e, this.pswp), i && this.addToCache(i));
|
|
3127
3145
|
}
|
|
3128
3146
|
/**
|
|
3129
3147
|
* @param {Slide} slide
|
|
@@ -3162,7 +3180,7 @@ class ri {
|
|
|
3162
3180
|
this._cachedItems.forEach((t) => t.destroy()), this._cachedItems = [];
|
|
3163
3181
|
}
|
|
3164
3182
|
}
|
|
3165
|
-
let
|
|
3183
|
+
let hi = class extends si {
|
|
3166
3184
|
/**
|
|
3167
3185
|
* Get total number of slides
|
|
3168
3186
|
*
|
|
@@ -3185,7 +3203,7 @@ let ai = class extends ei {
|
|
|
3185
3203
|
* @returns {Content}
|
|
3186
3204
|
*/
|
|
3187
3205
|
createContentFromData(t, e) {
|
|
3188
|
-
return new
|
|
3206
|
+
return new oi(t, this, e);
|
|
3189
3207
|
}
|
|
3190
3208
|
/**
|
|
3191
3209
|
* Get item data by index.
|
|
@@ -3219,7 +3237,7 @@ let ai = class extends ei {
|
|
|
3219
3237
|
*/
|
|
3220
3238
|
_getGalleryDOMElements(t) {
|
|
3221
3239
|
var e, i;
|
|
3222
|
-
return (e = this.options) !== null && e !== void 0 && e.children || (i = this.options) !== null && i !== void 0 && i.childSelector ?
|
|
3240
|
+
return (e = this.options) !== null && e !== void 0 && e.children || (i = this.options) !== null && i !== void 0 && i.childSelector ? me(this.options.children, this.options.childSelector, t) || [] : [t];
|
|
3223
3241
|
}
|
|
3224
3242
|
/**
|
|
3225
3243
|
* Converts DOM element to item data object.
|
|
@@ -3253,11 +3271,11 @@ let ai = class extends ei {
|
|
|
3253
3271
|
* @returns {Content} Image that is being decoded or false.
|
|
3254
3272
|
*/
|
|
3255
3273
|
lazyLoadData(t, e) {
|
|
3256
|
-
return
|
|
3274
|
+
return St(t, this, e);
|
|
3257
3275
|
}
|
|
3258
3276
|
};
|
|
3259
3277
|
const O = 3e-3;
|
|
3260
|
-
class
|
|
3278
|
+
class ci {
|
|
3261
3279
|
/**
|
|
3262
3280
|
* @param {PhotoSwipe} pswp
|
|
3263
3281
|
*/
|
|
@@ -3310,7 +3328,7 @@ class li {
|
|
|
3310
3328
|
_start() {
|
|
3311
3329
|
this.isOpening && this._useAnimation && this._placeholder && this._placeholder.tagName === "IMG" ? new Promise((t) => {
|
|
3312
3330
|
let e = !1, i = !0;
|
|
3313
|
-
|
|
3331
|
+
ue(
|
|
3314
3332
|
/** @type {HTMLImageElement} */
|
|
3315
3333
|
this._placeholder
|
|
3316
3334
|
).finally(() => {
|
|
@@ -3401,7 +3419,7 @@ class li {
|
|
|
3401
3419
|
o[e] = i, n.startTransition(o);
|
|
3402
3420
|
}
|
|
3403
3421
|
}
|
|
3404
|
-
const
|
|
3422
|
+
const di = {
|
|
3405
3423
|
allowPanToNext: !0,
|
|
3406
3424
|
spacing: 0.1,
|
|
3407
3425
|
loop: !0,
|
|
@@ -3428,7 +3446,7 @@ const hi = {
|
|
|
3428
3446
|
preload: [1, 2],
|
|
3429
3447
|
easing: "cubic-bezier(.4,0,.22,1)"
|
|
3430
3448
|
};
|
|
3431
|
-
class
|
|
3449
|
+
class ui extends hi {
|
|
3432
3450
|
/**
|
|
3433
3451
|
* @param {PhotoSwipeOptions} [options]
|
|
3434
3452
|
*/
|
|
@@ -3442,7 +3460,7 @@ class ci extends ai {
|
|
|
3442
3460
|
}, this.viewportSize = {
|
|
3443
3461
|
x: 0,
|
|
3444
3462
|
y: 0
|
|
3445
|
-
}, 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
|
|
3463
|
+
}, 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 fe(), this.animations = new Be(), this.mainScroll = new De(this), this.gestures = new ze(this), this.opener = new ci(this), this.keyboard = new $e(this), this.contentLoader = new li(this);
|
|
3446
3464
|
}
|
|
3447
3465
|
/** @returns {boolean} */
|
|
3448
3466
|
init() {
|
|
@@ -3450,7 +3468,7 @@ class ci extends ai {
|
|
|
3450
3468
|
return !1;
|
|
3451
3469
|
this.isOpen = !0, this.dispatch("init"), this.dispatch("beforeOpen"), this._createMainStructure();
|
|
3452
3470
|
let t = "pswp--open";
|
|
3453
|
-
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
|
|
3471
|
+
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 He(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", {
|
|
3454
3472
|
index: this.currIndex,
|
|
3455
3473
|
data: this._initialItemData,
|
|
3456
3474
|
slide: void 0
|
|
@@ -3569,7 +3587,7 @@ class ci extends ai {
|
|
|
3569
3587
|
if (!this.canLoop() && (e < 0 || e >= this.getNumItems()))
|
|
3570
3588
|
return;
|
|
3571
3589
|
const n = this.getItemData(e);
|
|
3572
|
-
t.slide = new
|
|
3590
|
+
t.slide = new _e(n, e, this), e === this.currIndex && (this.currSlide = t.slide), t.slide.append(t.el);
|
|
3573
3591
|
}
|
|
3574
3592
|
/** @returns {Point} */
|
|
3575
3593
|
getViewportCenterPoint() {
|
|
@@ -3587,7 +3605,7 @@ class ci extends ai {
|
|
|
3587
3605
|
updateSize(t) {
|
|
3588
3606
|
if (this.isDestroying)
|
|
3589
3607
|
return;
|
|
3590
|
-
const e =
|
|
3608
|
+
const e = _t(this.options, this);
|
|
3591
3609
|
!t && R(e, this._prevViewportSize) || (_(this._prevViewportSize, e), this.dispatch("beforeResize"), _(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"));
|
|
3592
3610
|
}
|
|
3593
3611
|
/**
|
|
@@ -3639,7 +3657,7 @@ class ci extends ai {
|
|
|
3639
3657
|
* @private
|
|
3640
3658
|
*/
|
|
3641
3659
|
_createMainStructure() {
|
|
3642
|
-
this.element = w("pswp", "div"), this.element.setAttribute("tabindex", "-1"), this.element.setAttribute("role", "dialog"), this.template = this.element, this.bg = w("pswp__bg", "div", this.element), this.scrollWrap = w("pswp__scroll-wrap", "section", this.element), this.container = w("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
|
|
3660
|
+
this.element = w("pswp", "div"), this.element.setAttribute("tabindex", "-1"), this.element.setAttribute("role", "dialog"), this.template = this.element, this.bg = w("pswp__bg", "div", this.element), this.scrollWrap = w("pswp__scroll-wrap", "section", this.element), this.container = w("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 Qe(this), this.ui.init(), (this.options.appendToEl || document.body).appendChild(this.element);
|
|
3643
3661
|
}
|
|
3644
3662
|
/**
|
|
3645
3663
|
* Get position and dimensions of small thumbnail
|
|
@@ -3650,7 +3668,7 @@ class ci extends ai {
|
|
|
3650
3668
|
* @returns {Bounds | undefined}
|
|
3651
3669
|
*/
|
|
3652
3670
|
getThumbBounds() {
|
|
3653
|
-
return
|
|
3671
|
+
return ei(this.currIndex, this.currSlide ? this.currSlide.data : this._initialItemData, this);
|
|
3654
3672
|
}
|
|
3655
3673
|
/**
|
|
3656
3674
|
* If the PhotoSwipe can have continuous loop
|
|
@@ -3666,7 +3684,7 @@ class ci extends ai {
|
|
|
3666
3684
|
*/
|
|
3667
3685
|
_prepareOptions(t) {
|
|
3668
3686
|
return window.matchMedia("(prefers-reduced-motion), (update: slow)").matches && (t.showHideAnimationType = "none", t.zoomAnimationDuration = 0), {
|
|
3669
|
-
...
|
|
3687
|
+
...di,
|
|
3670
3688
|
...t
|
|
3671
3689
|
};
|
|
3672
3690
|
}
|
|
@@ -3679,7 +3697,7 @@ function M(s, t, e) {
|
|
|
3679
3697
|
const i = document.createElement(t);
|
|
3680
3698
|
return s && (i.className = s), e && e.appendChild(i), i;
|
|
3681
3699
|
}
|
|
3682
|
-
function
|
|
3700
|
+
function pi(s, t, e) {
|
|
3683
3701
|
let i = `translate3d(${s}px,0px,0)`;
|
|
3684
3702
|
return e !== void 0 && (i += ` scale3d(${e},${e},1)`), i;
|
|
3685
3703
|
}
|
|
@@ -3692,10 +3710,10 @@ const b = {
|
|
|
3692
3710
|
LOADED: "loaded",
|
|
3693
3711
|
ERROR: "error"
|
|
3694
3712
|
};
|
|
3695
|
-
function
|
|
3713
|
+
function mi(s) {
|
|
3696
3714
|
return "button" in s && s.button === 1 || s.ctrlKey || s.metaKey || s.altKey || s.shiftKey;
|
|
3697
3715
|
}
|
|
3698
|
-
function
|
|
3716
|
+
function $(s, t, e = document) {
|
|
3699
3717
|
let i = [];
|
|
3700
3718
|
if (s instanceof Element)
|
|
3701
3719
|
i = [s];
|
|
@@ -3707,13 +3725,13 @@ function Z(s, t, e = document) {
|
|
|
3707
3725
|
}
|
|
3708
3726
|
return i;
|
|
3709
3727
|
}
|
|
3710
|
-
function
|
|
3728
|
+
function fi(s) {
|
|
3711
3729
|
return typeof s == "function" && s.prototype && s.prototype.goTo;
|
|
3712
3730
|
}
|
|
3713
|
-
function
|
|
3731
|
+
function rt() {
|
|
3714
3732
|
return !!(navigator.vendor && navigator.vendor.match(/apple/i));
|
|
3715
3733
|
}
|
|
3716
|
-
class
|
|
3734
|
+
class gi {
|
|
3717
3735
|
/**
|
|
3718
3736
|
* @param {T} type
|
|
3719
3737
|
* @param {PhotoSwipeEventsMap[T]} [details]
|
|
@@ -3725,7 +3743,7 @@ class mi {
|
|
|
3725
3743
|
this.defaultPrevented = !0;
|
|
3726
3744
|
}
|
|
3727
3745
|
}
|
|
3728
|
-
class
|
|
3746
|
+
class _i {
|
|
3729
3747
|
constructor() {
|
|
3730
3748
|
this._listeners = {}, this._filters = {}, this.pswp = void 0, this.options = void 0;
|
|
3731
3749
|
}
|
|
@@ -3792,14 +3810,14 @@ class fi {
|
|
|
3792
3810
|
return this.pswp.dispatch(t, e);
|
|
3793
3811
|
const n = (
|
|
3794
3812
|
/** @type {AugmentedEvent<T>} */
|
|
3795
|
-
new
|
|
3813
|
+
new gi(t, e)
|
|
3796
3814
|
);
|
|
3797
3815
|
return (i = this._listeners[t]) === null || i === void 0 || i.forEach((o) => {
|
|
3798
3816
|
o.call(this, n);
|
|
3799
3817
|
}), n;
|
|
3800
3818
|
}
|
|
3801
3819
|
}
|
|
3802
|
-
class
|
|
3820
|
+
class vi {
|
|
3803
3821
|
/**
|
|
3804
3822
|
* @param {string | false} imageSrc
|
|
3805
3823
|
* @param {HTMLElement} container
|
|
@@ -3819,14 +3837,14 @@ class gi {
|
|
|
3819
3837
|
* @param {number} height
|
|
3820
3838
|
*/
|
|
3821
3839
|
setDisplayedSize(t, e) {
|
|
3822
|
-
this.element && (this.element.tagName === "IMG" ? (j(this.element, 250, "auto"), this.element.style.transformOrigin = "0 0", this.element.style.transform =
|
|
3840
|
+
this.element && (this.element.tagName === "IMG" ? (j(this.element, 250, "auto"), this.element.style.transformOrigin = "0 0", this.element.style.transform = pi(0, 0, t / 250)) : j(this.element, t, e));
|
|
3823
3841
|
}
|
|
3824
3842
|
destroy() {
|
|
3825
3843
|
var t;
|
|
3826
3844
|
(t = this.element) !== null && t !== void 0 && t.parentNode && this.element.remove(), this.element = null;
|
|
3827
3845
|
}
|
|
3828
3846
|
}
|
|
3829
|
-
class
|
|
3847
|
+
class yi {
|
|
3830
3848
|
/**
|
|
3831
3849
|
* @param {SlideData} itemData Slide data
|
|
3832
3850
|
* @param {PhotoSwipeBase} instance PhotoSwipe or PhotoSwipeLightbox instance
|
|
@@ -3861,7 +3879,7 @@ class _i {
|
|
|
3861
3879
|
this.data.msrc && this.slide.isFirstSlide ? this.data.msrc : !1,
|
|
3862
3880
|
this
|
|
3863
3881
|
);
|
|
3864
|
-
this.placeholder = new
|
|
3882
|
+
this.placeholder = new vi(i, this.slide.container);
|
|
3865
3883
|
}
|
|
3866
3884
|
this.element && !e || this.instance.dispatch("contentLoad", {
|
|
3867
3885
|
content: this,
|
|
@@ -4031,7 +4049,7 @@ class _i {
|
|
|
4031
4049
|
}).defaultPrevented)
|
|
4032
4050
|
return;
|
|
4033
4051
|
const t = "decode" in this.element;
|
|
4034
|
-
this.isImageContent() ? t && this.slide && (!this.slide.isActive ||
|
|
4052
|
+
this.isImageContent() ? t && this.slide && (!this.slide.isActive || rt()) ? (this.isDecoding = !0, this.element.decode().catch(() => {
|
|
4035
4053
|
}).finally(() => {
|
|
4036
4054
|
this.isDecoding = !1, this.appendImage();
|
|
4037
4055
|
})) : this.appendImage() : this.slide && !this.element.parentNode && this.slide.container.appendChild(this.element);
|
|
@@ -4044,7 +4062,7 @@ class _i {
|
|
|
4044
4062
|
activate() {
|
|
4045
4063
|
this.instance.dispatch("contentActivate", {
|
|
4046
4064
|
content: this
|
|
4047
|
-
}).defaultPrevented || !this.slide || (this.isImageContent() && this.isDecoding && !
|
|
4065
|
+
}).defaultPrevented || !this.slide || (this.isImageContent() && this.isDecoding && !rt() ? this.appendImage() : this.isError() && this.load(!1, !0), this.slide.holderElement && this.slide.holderElement.setAttribute("aria-hidden", "false"));
|
|
4048
4066
|
}
|
|
4049
4067
|
/**
|
|
4050
4068
|
* Deactivate the content
|
|
@@ -4071,7 +4089,7 @@ class _i {
|
|
|
4071
4089
|
}).defaultPrevented || (this.slide && this.element && !this.element.parentNode && this.slide.container.appendChild(this.element), (this.state === b.LOADED || this.state === b.ERROR) && this.removePlaceholder()));
|
|
4072
4090
|
}
|
|
4073
4091
|
}
|
|
4074
|
-
function
|
|
4092
|
+
function wi(s, t) {
|
|
4075
4093
|
if (s.getViewportSizeFn) {
|
|
4076
4094
|
const e = s.getViewportSizeFn(s, t);
|
|
4077
4095
|
if (e)
|
|
@@ -4098,14 +4116,14 @@ function N(s, t, e, i, n) {
|
|
|
4098
4116
|
}
|
|
4099
4117
|
return Number(o) || 0;
|
|
4100
4118
|
}
|
|
4101
|
-
function
|
|
4119
|
+
function Si(s, t, e, i) {
|
|
4102
4120
|
return {
|
|
4103
4121
|
x: t.x - N("left", s, t, e, i) - N("right", s, t, e, i),
|
|
4104
4122
|
y: t.y - N("top", s, t, e, i) - N("bottom", s, t, e, i)
|
|
4105
4123
|
};
|
|
4106
4124
|
}
|
|
4107
|
-
const
|
|
4108
|
-
class
|
|
4125
|
+
const at = 4e3;
|
|
4126
|
+
class bi {
|
|
4109
4127
|
/**
|
|
4110
4128
|
* @param {PhotoSwipeOptions} options PhotoSwipe options
|
|
4111
4129
|
* @param {SlideData} itemData Slide data
|
|
@@ -4162,7 +4180,7 @@ class wi {
|
|
|
4162
4180
|
*/
|
|
4163
4181
|
_getSecondary() {
|
|
4164
4182
|
let t = this._parseZoomLevelOption("secondary");
|
|
4165
|
-
return t || (t = Math.min(1, this.fit * 3), this.elementSize && t * this.elementSize.x >
|
|
4183
|
+
return t || (t = Math.min(1, this.fit * 3), this.elementSize && t * this.elementSize.x > at && (t = at / this.elementSize.x), t);
|
|
4166
4184
|
}
|
|
4167
4185
|
/**
|
|
4168
4186
|
* Get initial image zoom level.
|
|
@@ -4185,30 +4203,30 @@ class wi {
|
|
|
4185
4203
|
return this._parseZoomLevelOption("max") || Math.max(1, this.fit * 4);
|
|
4186
4204
|
}
|
|
4187
4205
|
}
|
|
4188
|
-
function
|
|
4206
|
+
function bt(s, t, e) {
|
|
4189
4207
|
const i = t.createContentFromData(s, e);
|
|
4190
4208
|
let n;
|
|
4191
4209
|
const {
|
|
4192
4210
|
options: o
|
|
4193
4211
|
} = t;
|
|
4194
4212
|
if (o) {
|
|
4195
|
-
n = new
|
|
4213
|
+
n = new bi(o, s, -1);
|
|
4196
4214
|
let r;
|
|
4197
|
-
t.pswp ? r = t.pswp.viewportSize : r =
|
|
4198
|
-
const a =
|
|
4215
|
+
t.pswp ? r = t.pswp.viewportSize : r = wi(o, t);
|
|
4216
|
+
const a = Si(o, r, s, e);
|
|
4199
4217
|
n.update(i.width, i.height, a);
|
|
4200
4218
|
}
|
|
4201
4219
|
return i.lazyLoad(), n && i.setDisplayedSize(Math.ceil(i.width * n.initial), Math.ceil(i.height * n.initial)), i;
|
|
4202
4220
|
}
|
|
4203
|
-
function
|
|
4221
|
+
function Li(s, t) {
|
|
4204
4222
|
const e = t.getItemData(s);
|
|
4205
4223
|
if (!t.dispatch("lazyLoadSlide", {
|
|
4206
4224
|
index: s,
|
|
4207
4225
|
itemData: e
|
|
4208
4226
|
}).defaultPrevented)
|
|
4209
|
-
return
|
|
4227
|
+
return bt(e, t, s);
|
|
4210
4228
|
}
|
|
4211
|
-
class
|
|
4229
|
+
class Ei extends _i {
|
|
4212
4230
|
/**
|
|
4213
4231
|
* Get total number of slides
|
|
4214
4232
|
*
|
|
@@ -4231,7 +4249,7 @@ class bi extends fi {
|
|
|
4231
4249
|
* @returns {Content}
|
|
4232
4250
|
*/
|
|
4233
4251
|
createContentFromData(t, e) {
|
|
4234
|
-
return new
|
|
4252
|
+
return new yi(t, this, e);
|
|
4235
4253
|
}
|
|
4236
4254
|
/**
|
|
4237
4255
|
* Get item data by index.
|
|
@@ -4265,7 +4283,7 @@ class bi extends fi {
|
|
|
4265
4283
|
*/
|
|
4266
4284
|
_getGalleryDOMElements(t) {
|
|
4267
4285
|
var e, i;
|
|
4268
|
-
return (e = this.options) !== null && e !== void 0 && e.children || (i = this.options) !== null && i !== void 0 && i.childSelector ?
|
|
4286
|
+
return (e = this.options) !== null && e !== void 0 && e.children || (i = this.options) !== null && i !== void 0 && i.childSelector ? $(this.options.children, this.options.childSelector, t) || [] : [t];
|
|
4269
4287
|
}
|
|
4270
4288
|
/**
|
|
4271
4289
|
* Converts DOM element to item data object.
|
|
@@ -4299,10 +4317,10 @@ class bi extends fi {
|
|
|
4299
4317
|
* @returns {Content} Image that is being decoded or false.
|
|
4300
4318
|
*/
|
|
4301
4319
|
lazyLoadData(t, e) {
|
|
4302
|
-
return
|
|
4320
|
+
return bt(t, this, e);
|
|
4303
4321
|
}
|
|
4304
4322
|
}
|
|
4305
|
-
class
|
|
4323
|
+
class Pi extends Ei {
|
|
4306
4324
|
/**
|
|
4307
4325
|
* @param {PhotoSwipeOptions} [options]
|
|
4308
4326
|
*/
|
|
@@ -4314,7 +4332,7 @@ class Li extends bi {
|
|
|
4314
4332
|
* It's not included in the main constructor, so you may bind events before it.
|
|
4315
4333
|
*/
|
|
4316
4334
|
init() {
|
|
4317
|
-
|
|
4335
|
+
$(this.options.gallery, this.options.gallerySelector).forEach((t) => {
|
|
4318
4336
|
t.addEventListener("click", this.onThumbnailsClick, !1);
|
|
4319
4337
|
});
|
|
4320
4338
|
}
|
|
@@ -4322,7 +4340,7 @@ class Li extends bi {
|
|
|
4322
4340
|
* @param {MouseEvent} e
|
|
4323
4341
|
*/
|
|
4324
4342
|
onThumbnailsClick(t) {
|
|
4325
|
-
if (
|
|
4343
|
+
if (mi(t) || window.pswp)
|
|
4326
4344
|
return;
|
|
4327
4345
|
let e = {
|
|
4328
4346
|
x: t.clientX,
|
|
@@ -4351,7 +4369,7 @@ class Li extends bi {
|
|
|
4351
4369
|
const e = (
|
|
4352
4370
|
/** @type {HTMLElement} */
|
|
4353
4371
|
t.target
|
|
4354
|
-
), n =
|
|
4372
|
+
), n = $(
|
|
4355
4373
|
this.options.children,
|
|
4356
4374
|
this.options.childSelector,
|
|
4357
4375
|
/** @type {HTMLElement} */
|
|
@@ -4371,7 +4389,7 @@ class Li extends bi {
|
|
|
4371
4389
|
if (window.pswp || !this.options)
|
|
4372
4390
|
return !1;
|
|
4373
4391
|
if (!e && this.options.gallery && this.options.children) {
|
|
4374
|
-
const n =
|
|
4392
|
+
const n = $(this.options.gallery);
|
|
4375
4393
|
n[0] && (e = {
|
|
4376
4394
|
gallery: n[0]
|
|
4377
4395
|
});
|
|
@@ -4390,7 +4408,7 @@ class Li extends bi {
|
|
|
4390
4408
|
} = this;
|
|
4391
4409
|
e && (i.dataSource = e);
|
|
4392
4410
|
const n = [], o = typeof i.pswpModule;
|
|
4393
|
-
if (
|
|
4411
|
+
if (fi(i.pswpModule))
|
|
4394
4412
|
n.push(Promise.resolve(
|
|
4395
4413
|
/** @type {Type<PhotoSwipe>} */
|
|
4396
4414
|
i.pswpModule
|
|
@@ -4406,7 +4424,7 @@ class Li extends bi {
|
|
|
4406
4424
|
else
|
|
4407
4425
|
throw new Error("pswpModule is not valid");
|
|
4408
4426
|
}
|
|
4409
|
-
typeof i.openPromise == "function" && n.push(i.openPromise()), i.preloadFirstSlide !== !1 && t >= 0 && (this._preloadedContent =
|
|
4427
|
+
typeof i.openPromise == "function" && n.push(i.openPromise()), i.preloadFirstSlide !== !1 && t >= 0 && (this._preloadedContent = Li(t, this));
|
|
4410
4428
|
const r = ++this._uid;
|
|
4411
4429
|
Promise.all(n).then((a) => {
|
|
4412
4430
|
if (this.shouldOpen) {
|
|
@@ -4447,17 +4465,17 @@ class Li extends bi {
|
|
|
4447
4465
|
*/
|
|
4448
4466
|
destroy() {
|
|
4449
4467
|
var t;
|
|
4450
|
-
(t = this.pswp) === null || t === void 0 || t.destroy(), this.shouldOpen = !1, this._listeners = {},
|
|
4468
|
+
(t = this.pswp) === null || t === void 0 || t.destroy(), this.shouldOpen = !1, this._listeners = {}, $(this.options.gallery, this.options.gallerySelector).forEach((e) => {
|
|
4451
4469
|
e.removeEventListener("click", this.onThumbnailsClick, !1);
|
|
4452
4470
|
});
|
|
4453
4471
|
}
|
|
4454
4472
|
}
|
|
4455
|
-
const
|
|
4473
|
+
const Ai = () => {
|
|
4456
4474
|
let s = null;
|
|
4457
|
-
return s = new
|
|
4475
|
+
return s = new Pi({
|
|
4458
4476
|
gallery: "#photoswipe-gallery",
|
|
4459
4477
|
children: "a",
|
|
4460
|
-
pswpModule:
|
|
4478
|
+
pswpModule: ui,
|
|
4461
4479
|
zoom: !1,
|
|
4462
4480
|
imageClickAction: "next",
|
|
4463
4481
|
tapAction: "next"
|
|
@@ -4481,7 +4499,7 @@ const Ei = () => {
|
|
|
4481
4499
|
}), s.init(), () => {
|
|
4482
4500
|
s && (s.destroy(), s = null);
|
|
4483
4501
|
};
|
|
4484
|
-
},
|
|
4502
|
+
}, xi = () => {
|
|
4485
4503
|
const s = document.querySelector(".js-limit-scroll-progress-bar"), t = document.querySelector(".c-progress__bar");
|
|
4486
4504
|
if (!t)
|
|
4487
4505
|
return;
|
|
@@ -4493,9 +4511,9 @@ const Ei = () => {
|
|
|
4493
4511
|
s && (i = s.scrollHeight - e.clientHeight + (window.pageYOffset + s.getBoundingClientRect().top));
|
|
4494
4512
|
const o = Math.round(n / i * 100);
|
|
4495
4513
|
t.style.width = `${o}%`, o >= 100 && (t.style.width = "100%");
|
|
4496
|
-
},
|
|
4497
|
-
document.querySelector(".c-progress") && window.addEventListener("scroll",
|
|
4498
|
-
}, H = "#page-content",
|
|
4514
|
+
}, Ii = () => {
|
|
4515
|
+
document.querySelector(".c-progress") && window.addEventListener("scroll", xi);
|
|
4516
|
+
}, H = "#page-content", U = "#text-tooltip", Ci = ".tooltip-btn", Lt = "c-text-tooltip--show", Ti = [
|
|
4499
4517
|
"#page-content .c-content p",
|
|
4500
4518
|
"#page-content .c-content h2",
|
|
4501
4519
|
"#page-content .c-content h3",
|
|
@@ -4507,18 +4525,18 @@ const Ei = () => {
|
|
|
4507
4525
|
"#page-content header span",
|
|
4508
4526
|
"#page-content header h1",
|
|
4509
4527
|
"#page-content header h2"
|
|
4510
|
-
],
|
|
4528
|
+
], lt = (s, t) => s instanceof Element ? t.some((e) => s.matches(e)) : !1, zi = (s, t) => {
|
|
4511
4529
|
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;
|
|
4512
|
-
return !!e &&
|
|
4513
|
-
},
|
|
4530
|
+
return !!e && lt(e, t) || !!i && lt(i, t);
|
|
4531
|
+
}, Oi = (s) => {
|
|
4514
4532
|
var e;
|
|
4515
4533
|
if (!s.focusNode)
|
|
4516
4534
|
return null;
|
|
4517
4535
|
const t = (e = s.anchorNode) == null ? void 0 : e.compareDocumentPosition(s.focusNode);
|
|
4518
4536
|
return t ? (t & 4) > 0 : s.anchorOffset < s.focusOffset;
|
|
4519
|
-
},
|
|
4520
|
-
const i = document.querySelector(`${H} ${
|
|
4521
|
-
`${H} ${
|
|
4537
|
+
}, Di = (s, t, e) => {
|
|
4538
|
+
const i = document.querySelector(`${H} ${U}`), n = document.querySelector(`${H}`), o = document.querySelectorAll(
|
|
4539
|
+
`${H} ${U} ${Ci}`
|
|
4522
4540
|
);
|
|
4523
4541
|
if (!i || !n) {
|
|
4524
4542
|
console.warn("Text tooltip : Tooltip or it's parent are not found in the DOM");
|
|
@@ -4526,42 +4544,42 @@ const Ei = () => {
|
|
|
4526
4544
|
}
|
|
4527
4545
|
Array.from(o).forEach((l) => l.setAttribute("data-selected-text", e));
|
|
4528
4546
|
const r = s.getClientRects(), a = r[t ? r.length - 1 : 0];
|
|
4529
|
-
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(
|
|
4530
|
-
},
|
|
4531
|
-
const s = document.querySelector(`${
|
|
4532
|
-
s && s.classList.remove(
|
|
4547
|
+
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(Lt);
|
|
4548
|
+
}, ht = () => {
|
|
4549
|
+
const s = document.querySelector(`${U}`);
|
|
4550
|
+
s && s.classList.remove(Lt);
|
|
4533
4551
|
}, B = ({ type: s }) => {
|
|
4534
4552
|
const t = window.getSelection();
|
|
4535
4553
|
if (s === "selectionchange") {
|
|
4536
|
-
|
|
4554
|
+
ht();
|
|
4537
4555
|
return;
|
|
4538
4556
|
}
|
|
4539
4557
|
if (!t || !t.rangeCount)
|
|
4540
4558
|
return;
|
|
4541
4559
|
const e = t.getRangeAt(0), i = t.toString().trim();
|
|
4542
4560
|
if (i.length) {
|
|
4543
|
-
const n =
|
|
4544
|
-
n &&
|
|
4561
|
+
const n = zi(e, Ti), o = Oi(t) || !1;
|
|
4562
|
+
n && Di(e, o, i);
|
|
4545
4563
|
return;
|
|
4546
4564
|
}
|
|
4547
|
-
|
|
4548
|
-
},
|
|
4565
|
+
ht();
|
|
4566
|
+
}, Mi = () => {
|
|
4549
4567
|
if (!(window != null && window.getSelection)) {
|
|
4550
4568
|
console.warn("Selection API isn't supported");
|
|
4551
4569
|
return;
|
|
4552
4570
|
}
|
|
4553
4571
|
document.addEventListener("mouseup", B), document.addEventListener("selectionchange", B), document.addEventListener("touchend", B), document.addEventListener("touchcancel", B);
|
|
4554
|
-
},
|
|
4572
|
+
}, $i = (s) => {
|
|
4555
4573
|
const { target: t } = s;
|
|
4556
4574
|
if (t instanceof Element) {
|
|
4557
4575
|
const e = t.closest(".c-search-form--button");
|
|
4558
4576
|
e && (s.preventDefault(), e.classList.remove("c-search-form--button"));
|
|
4559
4577
|
}
|
|
4560
|
-
},
|
|
4578
|
+
}, Fi = (s = document.querySelector(
|
|
4561
4579
|
".c-search-form--button"
|
|
4562
4580
|
)) => {
|
|
4563
4581
|
s && s.addEventListener("click", (t) => {
|
|
4564
|
-
|
|
4582
|
+
$i(t);
|
|
4565
4583
|
});
|
|
4566
4584
|
}, Zi = ({
|
|
4567
4585
|
tabsContainerElement: s,
|
|
@@ -4579,7 +4597,7 @@ const Ei = () => {
|
|
|
4579
4597
|
}), n.forEach((a) => {
|
|
4580
4598
|
a.setAttribute("aria-hidden", "true");
|
|
4581
4599
|
}), e.setAttribute("aria-selected", "true"), r && r.removeAttribute("aria-hidden");
|
|
4582
|
-
},
|
|
4600
|
+
}, ct = (s) => s.code === "ArrowLeft" || s.keyCode === 39, dt = (s) => s.code === "ArrowRight" || s.keyCode === 37, Ri = (s = document.querySelectorAll(
|
|
4583
4601
|
".js-tabs"
|
|
4584
4602
|
)) => {
|
|
4585
4603
|
s.length > 0 && s.forEach((t) => {
|
|
@@ -4593,37 +4611,44 @@ const Ei = () => {
|
|
|
4593
4611
|
if (i && e.length > 0) {
|
|
4594
4612
|
let n = 0;
|
|
4595
4613
|
i.addEventListener("keydown", (o) => {
|
|
4596
|
-
o instanceof KeyboardEvent && (
|
|
4614
|
+
o instanceof KeyboardEvent && (ct(o) || dt(o)) && (e[n].setAttribute("tabindex", "-1"), ct(o) ? (n += 1, n >= e.length && (n = 0)) : dt(o) && (n -= 1, n < 0 && (n = e.length - 1)), e[n].setAttribute("tabindex", "0"), e[n].focus());
|
|
4597
4615
|
});
|
|
4598
4616
|
}
|
|
4599
4617
|
});
|
|
4600
|
-
},
|
|
4618
|
+
}, G = "c-icon-item__container--is-highlighted", ki = (s) => {
|
|
4601
4619
|
const t = s.find(
|
|
4602
|
-
(e) => e.classList.contains(
|
|
4620
|
+
(e) => e.classList.contains(G)
|
|
4603
4621
|
);
|
|
4604
|
-
t == null || t.classList.remove(
|
|
4605
|
-
},
|
|
4622
|
+
t == null || t.classList.remove(G);
|
|
4623
|
+
}, qi = () => {
|
|
4606
4624
|
const s = document.querySelector(".c-toolbar");
|
|
4607
4625
|
if (s) {
|
|
4608
4626
|
const t = window.location.origin + window.location.pathname, e = Array.from(s.querySelectorAll(".c-icon-item__container"));
|
|
4609
|
-
|
|
4627
|
+
ki(e);
|
|
4610
4628
|
const i = e.find(
|
|
4611
4629
|
(n) => {
|
|
4612
4630
|
var o;
|
|
4613
4631
|
return ((o = n.querySelector("a")) == null ? void 0 : o.getAttribute("href")) === t;
|
|
4614
4632
|
}
|
|
4615
4633
|
);
|
|
4616
|
-
i == null || i.classList.add(
|
|
4617
|
-
}
|
|
4618
|
-
},
|
|
4619
|
-
|
|
4634
|
+
i == null || i.classList.add(G);
|
|
4635
|
+
}
|
|
4636
|
+
}, Gi = () => {
|
|
4637
|
+
Gt(), Ri(), Ft(), Wt(), Ii(), Ai(), se(), Fi(), Zt("paralympicsGames", "countdown-paralympics-games"), Mi(), Mt(), Xt(), qt(), Ot(), K(
|
|
4638
|
+
"jobs-input",
|
|
4639
|
+
"https://www.groupeactual.eu/autocomplete/profession-simple?code&prefix&limit=75",
|
|
4640
|
+
"&term=",
|
|
4641
|
+
"id",
|
|
4642
|
+
"title",
|
|
4643
|
+
"items"
|
|
4644
|
+
), K(
|
|
4620
4645
|
"localisation-input",
|
|
4621
4646
|
"https://www.20minutes.fr/elections/resultats/recherche",
|
|
4622
4647
|
"?searchValue=",
|
|
4623
4648
|
"text",
|
|
4624
4649
|
"text"
|
|
4625
|
-
),
|
|
4650
|
+
), kt(), qi(), Ct(), Tt(), Yt(), le(), he(), Kt(), It();
|
|
4626
4651
|
};
|
|
4627
4652
|
export {
|
|
4628
|
-
|
|
4653
|
+
Gi as initScripts
|
|
4629
4654
|
};
|