@cntrl-site/components 1.0.116-alpha.0 → 1.0.117
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/{Burger-DyORh_vF.mjs → Burger-BkVgNMGU.mjs} +1 -1
- package/dist/{Burger-B4kXX9aY.js → Burger-C3yVbQcq.js} +1 -1
- package/dist/Chronicles-BNvvaFYY.mjs +744 -0
- package/dist/Chronicles-Dj1gvNjE.js +196 -0
- package/dist/ChroniclesComponent-CoOgQZx2.js +1 -0
- package/dist/{ChroniclesComponent-jh4v7wp6.mjs → ChroniclesComponent-Szt0H-op.mjs} +542 -491
- package/dist/Components/Chronicles/Chronicles.d.ts +7 -1
- package/dist/Components/Chronicles/ChroniclesComponent.d.ts +26 -2
- package/dist/Components/LightboxJournal/LightboxJournal.d.ts +1 -0
- package/dist/Components/LightboxStrip/LightboxStrip.d.ts +1 -0
- package/dist/Components/helpers/SvgImage/loadSvgMaskUrl.d.ts +0 -7
- package/dist/{ControlSlider-DB4nbVLT.js → ControlSlider-C8ckUIDm.js} +1 -1
- package/dist/{ControlSlider-3w-bHQEg.mjs → ControlSlider-DqKfaKMG.mjs} +1 -1
- package/dist/{FAQ-GmiwRdFq.mjs → FAQ-CJHCMSBa.mjs} +1 -1
- package/dist/{FAQ-7HEkaoU6.js → FAQ-DLh63Utr.js} +1 -1
- package/dist/{Grid-BzarI5Mc.js → Grid-C4hO8KCr.js} +14 -9
- package/dist/{Grid-Z2JZyUdC.mjs → Grid-Dud7PLS9.mjs} +201 -196
- package/dist/{Hive-34KvKNsa.js → Hive-CzabuuCc.js} +1 -1
- package/dist/{Hive-7xHXyMM1.mjs → Hive-DyxYd5eg.mjs} +1 -1
- package/dist/{HiveLightboxTitles-BCoL46-V.mjs → HiveLightboxTitles-DhEeFKWs.mjs} +1 -1
- package/dist/{HiveLightboxTitles-DEeyQGcf.js → HiveLightboxTitles-DlyptAaK.js} +1 -1
- package/dist/{Lightbox-DzPqgKP4.mjs → Lightbox-BY99NS14.mjs} +1 -1
- package/dist/{Lightbox-Cb7lyaNt.js → Lightbox-DZckgBzK.js} +1 -1
- package/dist/{LightboxJournal-C_q7_s-B.mjs → LightboxJournal-BDUs6T0B.mjs} +466 -434
- package/dist/LightboxJournal-Bf_rZzmz.js +555 -0
- package/dist/{LightboxStrip-BrNj7ipX.mjs → LightboxStrip-Cuhb2fIR.mjs} +459 -427
- package/dist/LightboxStrip-RA4ABUC-.js +418 -0
- package/dist/{Mercury-BmhtFYOw.js → Mercury-B-s2Kvuq.js} +1 -1
- package/dist/{Mercury-Q788wrYQ.mjs → Mercury-CCW0Es-s.mjs} +1 -1
- package/dist/{OnelinerForm-D8WIB9Qy.mjs → OnelinerForm-BEu7_sho.mjs} +1 -1
- package/dist/{OnelinerForm-CUmY-bXL.js → OnelinerForm-C2Y_XMCY.js} +1 -1
- package/dist/{SimpleButton-DTpzfmb6.mjs → SimpleButton-C-o2W9bS.mjs} +1 -1
- package/dist/{SimpleButton-DtaCYa3y.js → SimpleButton-nGEcO2gB.js} +1 -1
- package/dist/{Slider20-q0iGgnE3.js → Slider20-BOmjDRf2.js} +1 -1
- package/dist/{Slider20-CKngROrc.mjs → Slider20-DUi6qwnd.mjs} +1 -1
- package/dist/SvgImage-B5mR9y6q.mjs +51 -0
- package/dist/SvgImage-DFlmxAoL.js +1 -0
- package/dist/{TestimonialSingle-CpEUendN.js → TestimonialSingle-BORQom3u.js} +1 -1
- package/dist/{TestimonialSingle-Bax71Hyo.mjs → TestimonialSingle-DrnyReim.mjs} +1 -1
- package/dist/{Waterfall-znaoynn5.mjs → Waterfall-3kKioKh2.mjs} +1 -1
- package/dist/{Waterfall-B9YWMhrg.js → Waterfall-DII4-WV5.js} +1 -1
- package/dist/{components-C9Fu28pp.mjs → components-DSHc15vW.mjs} +29 -653
- package/dist/components-iORMB3kt.js +1 -0
- package/dist/elements.js +1 -1
- package/dist/elements.mjs +23 -24
- package/dist/elements.node.js +1 -1
- package/dist/elements.node.mjs +1 -1
- package/dist/index.d.ts +2 -4
- package/dist/index.js +1 -1
- package/dist/index.mjs +38 -61
- package/dist/loadSvgMaskUrl-DfF7ay6h.js +1 -0
- package/dist/loadSvgMaskUrl-xHgGYgPe.mjs +20 -0
- package/dist/sources.js +143 -30
- package/dist/sources.mjs +150 -37
- package/dist/types/Component.d.ts +0 -7
- package/dist/types/SchemaV1.d.ts +3 -3
- package/package.json +1 -1
- package/dist/Chronicles-Cy2h3jlZ.mjs +0 -724
- package/dist/Chronicles-D0ojQzOP.js +0 -196
- package/dist/ChroniclesComponent-DYPJBI3d.js +0 -1
- package/dist/Components/PopupMenu/PopupMenu.d.ts +0 -73
- package/dist/Components/PopupMenu/PopupMenuComponent.d.ts +0 -594
- package/dist/Components/PopupMenu/popupMenuLayout.d.ts +0 -203
- package/dist/Components/PopupMenu/popupMenuSnap.d.ts +0 -61
- package/dist/LightboxJournal-BFF5aKRz.js +0 -523
- package/dist/LightboxStrip-CC2e0_9A.js +0 -386
- package/dist/PopupMenu-CYdDyzEt.mjs +0 -1372
- package/dist/PopupMenu-Di1fHgho.js +0 -409
- package/dist/SvgImage-CwRq9-ec.mjs +0 -56
- package/dist/SvgImage-_QN8ngad.js +0 -1
- package/dist/components-6QFLq5OI.js +0 -1
- package/dist/loadSvgMaskUrl-B6kHUyof.js +0 -1
- package/dist/loadSvgMaskUrl-DUhCVvpl.mjs +0 -39
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import { jsxs as w, jsx as f, Fragment as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsxs as w, jsx as f, Fragment as yt } from "react/jsx-runtime";
|
|
2
|
+
import { useState as wt, useRef as p, useMemo as z, useCallback as W, useEffect as ft, useLayoutEffect as le } from "react";
|
|
3
3
|
import { createPortal as kn } from "react-dom";
|
|
4
|
-
import { u as
|
|
5
|
-
import { i as
|
|
6
|
-
import { s as
|
|
7
|
-
import { S as
|
|
8
|
-
import { u as
|
|
9
|
-
import { t as
|
|
10
|
-
const
|
|
4
|
+
import { u as En } from "./useScopedStyles-DhBG3557.mjs";
|
|
5
|
+
import { i as Et, g as Ve, u as Kn } from "./useLightboxSwipeDismiss-SGv6Ra33.mjs";
|
|
6
|
+
import { s as _t } from "./scalingValue-C9JH5L6O.mjs";
|
|
7
|
+
import { S as Fn } from "./SvgImage-B5mR9y6q.mjs";
|
|
8
|
+
import { u as Bn } from "./useLightboxScrollLock-VQ07s7EJ.mjs";
|
|
9
|
+
import { t as Dn } from "./textStylesToCss-05Mn6I_2.mjs";
|
|
10
|
+
const Hn = (e, o, a, c) => {
|
|
11
11
|
const s = Math.min(Math.abs(e) / Math.max(c, 1), 1);
|
|
12
12
|
return o + (a - o) * s;
|
|
13
|
-
},
|
|
13
|
+
}, Xn = (e) => {
|
|
14
14
|
e.style.transition = "", e.style.transform = "", e.style.willChange = "";
|
|
15
|
-
},
|
|
15
|
+
}, jn = (e) => {
|
|
16
16
|
const o = getComputedStyle(e).transform;
|
|
17
17
|
return o === "none" ? 0 : new DOMMatrixReadOnly(o).m41;
|
|
18
|
-
},
|
|
19
|
-
const m = e.scrollLeft,
|
|
20
|
-
|
|
18
|
+
}, Gn = (e, o, a, { duration: c, easing: s, onComplete: d }) => {
|
|
19
|
+
const m = e.scrollLeft, $ = a - m, A = m - a, K = (M, tt) => {
|
|
20
|
+
Xn(o), e.scrollLeft = M, tt && (d == null || d());
|
|
21
21
|
};
|
|
22
|
-
if (Math.abs(
|
|
23
|
-
return
|
|
22
|
+
if (Math.abs($) < 0.5)
|
|
23
|
+
return K(a, !0), () => {
|
|
24
24
|
};
|
|
25
|
-
let
|
|
26
|
-
const
|
|
27
|
-
o.removeEventListener("transitionend",
|
|
28
|
-
},
|
|
29
|
-
|
|
25
|
+
let O = !1, P = 0;
|
|
26
|
+
const R = () => {
|
|
27
|
+
o.removeEventListener("transitionend", F), clearTimeout(P);
|
|
28
|
+
}, F = (M) => {
|
|
29
|
+
M.target !== o || M.propertyName !== "transform" || O || (O = !0, R(), K(a, !0));
|
|
30
30
|
};
|
|
31
|
-
return o.addEventListener("transitionend",
|
|
32
|
-
|
|
31
|
+
return o.addEventListener("transitionend", F), o.style.willChange = "transform", o.style.transition = "none", o.style.transform = "translate3d(0, 0, 0)", o.offsetHeight, o.style.transition = `transform ${c}ms ${s}`, o.style.transform = `translate3d(${A}px, 0, 0)`, P = window.setTimeout(() => {
|
|
32
|
+
O || (O = !0, R(), K(a, !0));
|
|
33
33
|
}, c + 64), () => {
|
|
34
|
-
|
|
34
|
+
O || (O = !0, R(), K(m - jn(o), !1));
|
|
35
35
|
};
|
|
36
|
-
},
|
|
36
|
+
}, $t = 300, Vn = 900, Yn = 1500, qn = "cubic-bezier(0.16, 1, 0.3, 1)", Un = 3e3, Zn = 2, Jn = 16, Qn = 0.05, Pn = 1, zt = 0.3, tr = 50, er = 20, ut = 4e-3, nr = ["title1", "title2", "title3"], rr = {
|
|
37
37
|
title1: "1",
|
|
38
38
|
title2: "2",
|
|
39
39
|
title3: "3"
|
|
40
|
-
},
|
|
40
|
+
}, or = {
|
|
41
41
|
title1: "title1Color",
|
|
42
42
|
title2: "title2Color",
|
|
43
43
|
title3: "title3Color"
|
|
44
|
-
},
|
|
44
|
+
}, ir = {
|
|
45
45
|
title1: 0.02,
|
|
46
46
|
title2: 0.02,
|
|
47
47
|
title3: 0.02
|
|
48
|
-
},
|
|
48
|
+
}, Ot = (e) => `max(${e}, ${er}px)`, lr = (e) => {
|
|
49
49
|
if (!Array.isArray(e) || e.length === 0) return {};
|
|
50
50
|
const o = e.find((s) => (s == null ? void 0 : s.type) === "paragraph") ?? e[0], a = o == null ? void 0 : o.children;
|
|
51
51
|
if (!Array.isArray(a)) return {};
|
|
@@ -55,7 +55,7 @@ const Bn = (e, o, a, c) => {
|
|
|
55
55
|
title2: c[1],
|
|
56
56
|
title3: c[2]
|
|
57
57
|
};
|
|
58
|
-
},
|
|
58
|
+
}, sr = (e) => {
|
|
59
59
|
if (!e)
|
|
60
60
|
return { title1: "", title2: "", title3: "" };
|
|
61
61
|
if (e.title1 || e.title2 || e.title3)
|
|
@@ -64,89 +64,89 @@ const Bn = (e, o, a, c) => {
|
|
|
64
64
|
title2: e.title2 ?? "",
|
|
65
65
|
title3: e.title3 ?? ""
|
|
66
66
|
};
|
|
67
|
-
const o =
|
|
67
|
+
const o = lr(e.text);
|
|
68
68
|
return {
|
|
69
69
|
title1: o.title1 ?? "",
|
|
70
70
|
title2: o.title2 ?? "",
|
|
71
71
|
title3: o.title3 ?? ""
|
|
72
72
|
};
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
}, X = (e, o) => `${e}${o.charAt(0).toUpperCase()}${o.slice(1)}`, ar = (e) => [
|
|
74
|
+
X(e, "fontFamily"),
|
|
75
|
+
X(e, "fontSettings"),
|
|
76
76
|
{
|
|
77
77
|
type: "row",
|
|
78
78
|
items: [
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
X(e, "fontSize"),
|
|
80
|
+
X(e, "lineHeight"),
|
|
81
|
+
X(e, "letterSpacing"),
|
|
82
|
+
X(e, "wordSpacing")
|
|
83
83
|
]
|
|
84
84
|
},
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
],
|
|
85
|
+
X(e, "textAlign"),
|
|
86
|
+
X(e, "textAppearance")
|
|
87
|
+
], Sr = () => ({
|
|
88
88
|
type: "tab",
|
|
89
89
|
id: "stripTextStyle",
|
|
90
90
|
tabs: Object.fromEntries(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
nr.map((e) => [
|
|
92
|
+
rr[e],
|
|
93
|
+
ar(e)
|
|
94
94
|
])
|
|
95
95
|
)
|
|
96
|
-
}),
|
|
96
|
+
}), fe = (e, o) => {
|
|
97
97
|
if (e <= 0)
|
|
98
98
|
return [];
|
|
99
99
|
const a = o.slice(0, e), c = a.reduce((d, m) => d + m, 0);
|
|
100
100
|
if (c <= 1)
|
|
101
101
|
return a;
|
|
102
102
|
const { widths: s } = [...a].reverse().reduce(
|
|
103
|
-
({ overflow: d, widths: m },
|
|
104
|
-
if (d <= 0 ||
|
|
105
|
-
return { overflow: d, widths: [
|
|
106
|
-
const
|
|
103
|
+
({ overflow: d, widths: m }, $) => {
|
|
104
|
+
if (d <= 0 || $ <= 0)
|
|
105
|
+
return { overflow: d, widths: [$, ...m] };
|
|
106
|
+
const A = Math.min(d, $);
|
|
107
107
|
return {
|
|
108
|
-
overflow: d -
|
|
109
|
-
widths: [
|
|
108
|
+
overflow: d - A,
|
|
109
|
+
widths: [$ - A, ...m]
|
|
110
110
|
};
|
|
111
111
|
},
|
|
112
112
|
{ overflow: c - 1, widths: [] }
|
|
113
113
|
);
|
|
114
114
|
return s;
|
|
115
|
-
},
|
|
115
|
+
}, Ye = (e, o) => fe(e, o), kt = (e, o) => {
|
|
116
116
|
const a = o.filter((c, s) => s !== e).reduce((c, s) => c + s, 0);
|
|
117
117
|
return Math.max(1 - a, 0);
|
|
118
|
-
},
|
|
118
|
+
}, Ge = (e, o) => {
|
|
119
119
|
const a = e.map((c) => o[c.widthKey] ?? 0);
|
|
120
120
|
return {
|
|
121
|
-
resolved:
|
|
122
|
-
effective:
|
|
121
|
+
resolved: fe(e.length, a),
|
|
122
|
+
effective: Ye(e.length, a)
|
|
123
123
|
};
|
|
124
|
-
},
|
|
125
|
-
const
|
|
126
|
-
return o &&
|
|
124
|
+
}, cr = (e, o, a, c, s, d, m) => {
|
|
125
|
+
const $ = [];
|
|
126
|
+
return o && $.push({
|
|
127
127
|
prefix: "title1",
|
|
128
128
|
widthKey: "title1Width",
|
|
129
129
|
className: `${e}-title1`,
|
|
130
130
|
style: s,
|
|
131
131
|
text: o
|
|
132
|
-
}), a &&
|
|
132
|
+
}), a && $.push({
|
|
133
133
|
prefix: "title2",
|
|
134
134
|
widthKey: "title2Width",
|
|
135
135
|
marginLeftKey: "title2MarginLeft",
|
|
136
136
|
className: `${e}-title2`,
|
|
137
137
|
style: d,
|
|
138
138
|
text: a
|
|
139
|
-
}), c &&
|
|
139
|
+
}), c && $.push({
|
|
140
140
|
prefix: "title3",
|
|
141
141
|
widthKey: "title3Width",
|
|
142
142
|
marginLeftKey: "title3MarginLeft",
|
|
143
143
|
className: `${e}-title3`,
|
|
144
144
|
style: m,
|
|
145
145
|
text: c
|
|
146
|
-
}),
|
|
147
|
-
},
|
|
146
|
+
}), $;
|
|
147
|
+
}, se = (e, o) => {
|
|
148
148
|
const a = (c) => {
|
|
149
|
-
const s =
|
|
149
|
+
const s = X(o, c);
|
|
150
150
|
return e[s];
|
|
151
151
|
};
|
|
152
152
|
return {
|
|
@@ -161,12 +161,12 @@ const Bn = (e, o, a, c) => {
|
|
|
161
161
|
wordSpacing: a("wordSpacing") ?? 0,
|
|
162
162
|
textAlign: a("textAlign") ?? "left",
|
|
163
163
|
textAppearance: a("textAppearance"),
|
|
164
|
-
color: e[
|
|
164
|
+
color: e[or[o]]
|
|
165
165
|
};
|
|
166
|
-
},
|
|
166
|
+
}, ur = (e, o, a, c) => e.slice(0, c).reduce(
|
|
167
167
|
(s, d, m) => s + (d != null && d.marginLeftKey ? a[d.marginLeftKey] ?? 0 : 0) + (o[m] ?? 0),
|
|
168
168
|
0
|
|
169
|
-
),
|
|
169
|
+
), ae = (e, o, a) => {
|
|
170
170
|
var s, d;
|
|
171
171
|
const c = {
|
|
172
172
|
fontSettings: {
|
|
@@ -174,7 +174,7 @@ const Bn = (e, o, a, c) => {
|
|
|
174
174
|
fontWeight: ((s = o.fontSettings) == null ? void 0 : s.fontWeight) ?? 400,
|
|
175
175
|
fontStyle: ((d = o.fontSettings) == null ? void 0 : d.fontStyle) ?? "normal"
|
|
176
176
|
},
|
|
177
|
-
fontSize: o.fontSize ??
|
|
177
|
+
fontSize: o.fontSize ?? ir[e],
|
|
178
178
|
lineHeight: o.lineHeight,
|
|
179
179
|
letterSpacing: o.letterSpacing,
|
|
180
180
|
wordSpacing: o.wordSpacing,
|
|
@@ -182,8 +182,8 @@ const Bn = (e, o, a, c) => {
|
|
|
182
182
|
textAppearance: o.textAppearance,
|
|
183
183
|
color: o.color ?? "#ffffff"
|
|
184
184
|
};
|
|
185
|
-
return
|
|
186
|
-
},
|
|
185
|
+
return Dn(c, a);
|
|
186
|
+
}, fr = ({
|
|
187
187
|
prefix: e,
|
|
188
188
|
images: o,
|
|
189
189
|
settings: a,
|
|
@@ -193,99 +193,99 @@ const Bn = (e, o, a, c) => {
|
|
|
193
193
|
onClose: m
|
|
194
194
|
}) => {
|
|
195
195
|
const {
|
|
196
|
-
backgroundColor:
|
|
197
|
-
thumbnailSize:
|
|
198
|
-
thumbnailGap:
|
|
199
|
-
thumbnailMarginBottom:
|
|
200
|
-
imageGap:
|
|
201
|
-
closeIcon:
|
|
202
|
-
closeIconMaxWidth:
|
|
203
|
-
closeIconColor:
|
|
196
|
+
backgroundColor: $,
|
|
197
|
+
thumbnailSize: A,
|
|
198
|
+
thumbnailGap: K,
|
|
199
|
+
thumbnailMarginBottom: O,
|
|
200
|
+
imageGap: P,
|
|
201
|
+
closeIcon: R,
|
|
202
|
+
closeIconMaxWidth: F,
|
|
203
|
+
closeIconColor: M,
|
|
204
204
|
closeIconHoverColor: tt,
|
|
205
|
-
thumbnailTrigger:
|
|
206
|
-
thumbnailVisibility:
|
|
207
|
-
thumbnailObjectFit:
|
|
208
|
-
thumbnailActive:
|
|
209
|
-
thumbnailActiveColor:
|
|
210
|
-
title1Width:
|
|
211
|
-
title2Width:
|
|
212
|
-
title3Width:
|
|
205
|
+
thumbnailTrigger: St,
|
|
206
|
+
thumbnailVisibility: ht,
|
|
207
|
+
thumbnailObjectFit: Lt,
|
|
208
|
+
thumbnailActive: qe,
|
|
209
|
+
thumbnailActiveColor: Ue,
|
|
210
|
+
title1Width: Kt,
|
|
211
|
+
title2Width: he,
|
|
212
|
+
title3Width: de,
|
|
213
213
|
title1MarginLeft: C = 0,
|
|
214
|
-
title2MarginLeft:
|
|
215
|
-
title3MarginLeft:
|
|
216
|
-
titleRowMarginBottom:
|
|
217
|
-
titleHeaderLayout:
|
|
218
|
-
contentMarginTop:
|
|
219
|
-
iconMarginLeft:
|
|
220
|
-
} = a, et = (t) =>
|
|
221
|
-
|
|
222
|
-
const
|
|
223
|
-
() =>
|
|
224
|
-
[e, nt,
|
|
225
|
-
), rt =
|
|
214
|
+
title2MarginLeft: me = 0,
|
|
215
|
+
title3MarginLeft: pe = 0,
|
|
216
|
+
titleRowMarginBottom: ge = 0,
|
|
217
|
+
titleHeaderLayout: ve = "desktop",
|
|
218
|
+
contentMarginTop: Ze,
|
|
219
|
+
iconMarginLeft: Je
|
|
220
|
+
} = a, et = (t) => _t(t, c ?? !1), Qe = A ?? a.thumnailSize ?? 0.03, be = et(Qe), Ft = et(K), Bt = et(O ?? 0.02), dt = et(P ?? 0), xe = et(Ze ?? 0), Pe = Ot(xe), ye = et(Je ?? 0), [nt, Dt] = wt(0), N = p(nt);
|
|
221
|
+
N.current = nt;
|
|
222
|
+
const tn = o[nt], { title1: Ht, title2: Xt, title3: jt } = sr(tn), we = ae("title1", se(a, "title1"), c), $e = ae("title2", se(a, "title2"), c), Se = ae("title3", se(a, "title3"), c), _ = ve === "mobile", q = !s && (!c || d), mt = q, pt = q, en = q, Le = Et(Lt), nn = Le ? { "--image-aspect-ratio": Ve(Lt) } : void 0, Te = !!(Ht || Xt || jt), v = z(
|
|
223
|
+
() => cr(e, Ht, Xt, jt, we, $e, Se),
|
|
224
|
+
[e, nt, Ht, Xt, jt, we, $e, Se]
|
|
225
|
+
), rt = z(() => ({ title1Width: Kt, title2Width: he, title3Width: de }), [Kt, he, de]), Tt = z(() => v.map((t) => rt[t.widthKey]), [v, rt]), B = z(() => fe(v.length, Tt), [v.length, Tt]), Ie = z(() => Ye(v.length, Tt), [v.length, Tt]), It = z(() => v.filter((t) => t.prefix === "title1"), [v]), k = z(() => v.filter((t) => t.prefix === "title2" || t.prefix === "title3"), [v]), Wt = z(() => Ge(It, rt), [It, rt]), j = z(() => Ge(k, rt), [k, rt]), Gt = W((t, n) => {
|
|
226
226
|
const r = v.indexOf(t);
|
|
227
|
-
if (!
|
|
227
|
+
if (!_ || n === "single-row")
|
|
228
228
|
return {
|
|
229
|
-
effectiveWidth:
|
|
230
|
-
resolvedWidth:
|
|
231
|
-
maxWidth: kt(r,
|
|
229
|
+
effectiveWidth: Ie[r] ?? 0,
|
|
230
|
+
resolvedWidth: B[r] ?? 0,
|
|
231
|
+
maxWidth: kt(r, B)
|
|
232
232
|
};
|
|
233
233
|
if (n === "two-row-top") {
|
|
234
|
-
const l =
|
|
234
|
+
const l = It.indexOf(t);
|
|
235
235
|
return {
|
|
236
|
-
effectiveWidth:
|
|
237
|
-
resolvedWidth:
|
|
238
|
-
maxWidth: kt(l,
|
|
236
|
+
effectiveWidth: Wt.effective[l] ?? 0,
|
|
237
|
+
resolvedWidth: Wt.resolved[l] ?? 0,
|
|
238
|
+
maxWidth: kt(l, Wt.resolved)
|
|
239
239
|
};
|
|
240
240
|
}
|
|
241
|
-
const i =
|
|
241
|
+
const i = k.indexOf(t);
|
|
242
242
|
return {
|
|
243
243
|
effectiveWidth: j.effective[i] ?? 0,
|
|
244
244
|
resolvedWidth: j.resolved[i] ?? 0,
|
|
245
245
|
maxWidth: kt(i, j.resolved)
|
|
246
246
|
};
|
|
247
247
|
}, [
|
|
248
|
-
|
|
248
|
+
k,
|
|
249
249
|
j,
|
|
250
|
-
|
|
251
|
-
|
|
250
|
+
Ie,
|
|
251
|
+
B,
|
|
252
252
|
v,
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
]), y =
|
|
257
|
-
(t) =>
|
|
253
|
+
It,
|
|
254
|
+
Wt,
|
|
255
|
+
_
|
|
256
|
+
]), y = W(
|
|
257
|
+
(t) => _t(t, c ?? !1),
|
|
258
258
|
[c]
|
|
259
|
-
),
|
|
259
|
+
), rn = y(ge ?? 0), E = z(
|
|
260
260
|
() => ({
|
|
261
261
|
title1MarginLeft: C,
|
|
262
|
-
title2MarginLeft:
|
|
263
|
-
title3MarginLeft:
|
|
262
|
+
title2MarginLeft: me,
|
|
263
|
+
title3MarginLeft: pe
|
|
264
264
|
}),
|
|
265
|
-
[C,
|
|
266
|
-
),
|
|
265
|
+
[C, me, pe]
|
|
266
|
+
), on = W(
|
|
267
267
|
(t) => v.slice(0, t + 1).reduce(
|
|
268
|
-
(n, r, i) => n + (r != null && r.marginLeftKey ?
|
|
268
|
+
(n, r, i) => n + (r != null && r.marginLeftKey ? E[r.marginLeftKey] ?? 0 : 0) + (B[i] ?? 0),
|
|
269
269
|
0
|
|
270
|
-
) + (
|
|
271
|
-
[v,
|
|
272
|
-
),
|
|
273
|
-
() =>
|
|
274
|
-
[
|
|
275
|
-
),
|
|
276
|
-
(t) =>
|
|
277
|
-
(n, r, i) => n + (r.marginLeftKey ?
|
|
270
|
+
) + (_ ? 0 : C ?? 0),
|
|
271
|
+
[v, E, B, _, C]
|
|
272
|
+
), ln = W(
|
|
273
|
+
() => _ ? 0 : C ?? 0,
|
|
274
|
+
[_, C]
|
|
275
|
+
), Vt = W(
|
|
276
|
+
(t) => k.slice(0, t).reduce(
|
|
277
|
+
(n, r, i) => n + (r.marginLeftKey ? E[r.marginLeftKey] ?? 0 : 0) + (j.resolved[i] ?? 0),
|
|
278
278
|
0
|
|
279
279
|
),
|
|
280
|
-
[
|
|
281
|
-
),
|
|
280
|
+
[k, j.resolved, E]
|
|
281
|
+
), sn = W(
|
|
282
282
|
(t) => {
|
|
283
|
-
const n =
|
|
284
|
-
return
|
|
283
|
+
const n = k[t];
|
|
284
|
+
return Vt(t) + (n.marginLeftKey ? E[n.marginLeftKey] ?? 0 : 0) + (j.resolved[t] ?? 0);
|
|
285
285
|
},
|
|
286
|
-
[
|
|
286
|
+
[k, j.resolved, Vt, E]
|
|
287
287
|
), Yt = (t, n) => {
|
|
288
|
-
const r = t.marginLeftKey ?
|
|
288
|
+
const r = t.marginLeftKey ? E[t.marginLeftKey] ?? 0 : 0, { effectiveWidth: i, resolvedWidth: l, maxWidth: u } = Gt(t, n), h = s && n === "two-row-top";
|
|
289
289
|
return /* @__PURE__ */ w(
|
|
290
290
|
"div",
|
|
291
291
|
{
|
|
@@ -337,9 +337,9 @@ const Bn = (e, o, a, c) => {
|
|
|
337
337
|
},
|
|
338
338
|
t.className
|
|
339
339
|
);
|
|
340
|
-
},
|
|
341
|
-
const t =
|
|
342
|
-
const i = C ?? 0, l = t >= 0 ?
|
|
340
|
+
}, an = () => {
|
|
341
|
+
const t = _ ? -1 : v.findIndex((i) => i.prefix === "title1"), n = !_ && (s || (C ?? 0) > 0) ? (() => {
|
|
342
|
+
const i = C ?? 0, l = t >= 0 ? B[t] : Kt ?? 0;
|
|
343
343
|
return /* @__PURE__ */ f(
|
|
344
344
|
"div",
|
|
345
345
|
{
|
|
@@ -360,19 +360,19 @@ const Bn = (e, o, a, c) => {
|
|
|
360
360
|
);
|
|
361
361
|
})() : null, r = v.flatMap((i, l) => {
|
|
362
362
|
if (!i.marginLeftKey) return [];
|
|
363
|
-
const u =
|
|
363
|
+
const u = E[i.marginLeftKey] ?? 0, h = ur(
|
|
364
364
|
v,
|
|
365
|
-
|
|
366
|
-
|
|
365
|
+
B,
|
|
366
|
+
E,
|
|
367
367
|
l
|
|
368
|
-
) +
|
|
368
|
+
) + ln();
|
|
369
369
|
return /* @__PURE__ */ f(
|
|
370
370
|
"div",
|
|
371
371
|
{
|
|
372
372
|
"data-controls": i.marginLeftKey,
|
|
373
373
|
"data-controls-axis": "x",
|
|
374
374
|
"data-controls-min": "0",
|
|
375
|
-
"data-controls-max-fraction": String(
|
|
375
|
+
"data-controls-max-fraction": String(B[l]),
|
|
376
376
|
style: {
|
|
377
377
|
position: "absolute",
|
|
378
378
|
top: 0,
|
|
@@ -386,11 +386,11 @@ const Bn = (e, o, a, c) => {
|
|
|
386
386
|
);
|
|
387
387
|
});
|
|
388
388
|
return n ? [n, ...r] : r;
|
|
389
|
-
},
|
|
389
|
+
}, cn = () => v.map((t, n) => {
|
|
390
390
|
const r = kt(
|
|
391
391
|
n,
|
|
392
|
-
|
|
393
|
-
), l =
|
|
392
|
+
B
|
|
393
|
+
), l = on(n) - ut / 2;
|
|
394
394
|
return /* @__PURE__ */ f("div", { style: { position: "absolute", inset: 0, pointerEvents: "none" }, children: /* @__PURE__ */ f(
|
|
395
395
|
"div",
|
|
396
396
|
{
|
|
@@ -409,9 +409,9 @@ const Bn = (e, o, a, c) => {
|
|
|
409
409
|
}
|
|
410
410
|
}
|
|
411
411
|
) }, `${t.widthKey}-junction`);
|
|
412
|
-
}),
|
|
412
|
+
}), un = () => k.flatMap((t, n) => {
|
|
413
413
|
if (!t.marginLeftKey) return [];
|
|
414
|
-
const r =
|
|
414
|
+
const r = E[t.marginLeftKey] ?? 0, i = Vt(n), { resolvedWidth: l } = Gt(t, "two-row-bottom");
|
|
415
415
|
return /* @__PURE__ */ f(
|
|
416
416
|
"div",
|
|
417
417
|
{
|
|
@@ -430,8 +430,8 @@ const Bn = (e, o, a, c) => {
|
|
|
430
430
|
},
|
|
431
431
|
t.marginLeftKey
|
|
432
432
|
);
|
|
433
|
-
}),
|
|
434
|
-
const { maxWidth: r } =
|
|
433
|
+
}), fn = () => k.map((t, n) => {
|
|
434
|
+
const { maxWidth: r } = Gt(t, "two-row-bottom"), l = sn(n) - ut / 2;
|
|
435
435
|
return /* @__PURE__ */ f("div", { style: { position: "absolute", inset: 0, pointerEvents: "none" }, children: /* @__PURE__ */ f(
|
|
436
436
|
"div",
|
|
437
437
|
{
|
|
@@ -450,32 +450,32 @@ const Bn = (e, o, a, c) => {
|
|
|
450
450
|
}
|
|
451
451
|
}
|
|
452
452
|
) }, `${t.widthKey}-junction`);
|
|
453
|
-
}),
|
|
453
|
+
}), hn = p(null), b = p(null), qt = p(null), We = p(null), At = p([]), S = p([]), ot = p(0), Rt = p(null), x = p({
|
|
454
454
|
isActive: !1,
|
|
455
455
|
startX: 0,
|
|
456
456
|
scrollLeft: 0,
|
|
457
457
|
startActiveIndex: 0,
|
|
458
458
|
hasMoved: !1
|
|
459
|
-
}),
|
|
460
|
-
() => Array.from({ length:
|
|
461
|
-
[o,
|
|
462
|
-
), [
|
|
463
|
-
|
|
464
|
-
x.current.isActive ||
|
|
465
|
-
},
|
|
466
|
-
}, [
|
|
467
|
-
s ||
|
|
459
|
+
}), gt = p(null), it = p(null), Ut = p(0), Zt = p("forward"), G = p(0), V = p(null), U = p(!1), L = o.length > 1 && (!s || !!d), Jt = L ? 3 : 1, dn = z(
|
|
460
|
+
() => Array.from({ length: Jt }, () => o).flat(),
|
|
461
|
+
[o, Jt]
|
|
462
|
+
), [mn, Ae] = wt(!1), [Re, Me] = wt(!1), [pn, Qt] = wt(!0), Z = p(null), lt = p(null), Pt = p(!1), Ce = p(!1), te = p(null), J = p(null), Ne = mt && !pn, D = W(() => {
|
|
463
|
+
mt && (Qt(!0), J.current && clearTimeout(J.current), J.current = setTimeout(() => {
|
|
464
|
+
x.current.isActive || Qt(!1);
|
|
465
|
+
}, Un));
|
|
466
|
+
}, [mt]), vt = W(() => {
|
|
467
|
+
s || Ce.current || (Ce.current = !0, Me(!1), te.current = setTimeout(() => {
|
|
468
468
|
m();
|
|
469
|
-
},
|
|
470
|
-
}, [s, m]),
|
|
469
|
+
}, $t));
|
|
470
|
+
}, [s, m]), _e = () => /* @__PURE__ */ w(
|
|
471
471
|
"div",
|
|
472
472
|
{
|
|
473
473
|
className: `${e}-close-icon`,
|
|
474
|
-
"data-overlay-content-hidden":
|
|
474
|
+
"data-overlay-content-hidden": Ne ? "true" : "false",
|
|
475
475
|
style: {
|
|
476
|
-
width:
|
|
477
|
-
height:
|
|
478
|
-
marginRight:
|
|
476
|
+
width: _t(F ?? 0, c),
|
|
477
|
+
height: _t(F ?? 0, c),
|
|
478
|
+
marginRight: ye,
|
|
479
479
|
"--close-icon-hover-color": tt
|
|
480
480
|
},
|
|
481
481
|
children: [
|
|
@@ -484,14 +484,14 @@ const Bn = (e, o, a, c) => {
|
|
|
484
484
|
{
|
|
485
485
|
type: "button",
|
|
486
486
|
className: `${e}-close-icon-inner`,
|
|
487
|
-
onClick:
|
|
487
|
+
onClick: vt,
|
|
488
488
|
"aria-label": "Close",
|
|
489
489
|
children: /* @__PURE__ */ f(
|
|
490
|
-
|
|
490
|
+
Fn,
|
|
491
491
|
{
|
|
492
|
-
url:
|
|
493
|
-
fill:
|
|
494
|
-
hoverFill: c && !d ?
|
|
492
|
+
url: R,
|
|
493
|
+
fill: M,
|
|
494
|
+
hoverFill: c && !d ? M : tt,
|
|
495
495
|
className: `${e}-close-icon-img`
|
|
496
496
|
}
|
|
497
497
|
)
|
|
@@ -508,7 +508,7 @@ const Bn = (e, o, a, c) => {
|
|
|
508
508
|
position: "absolute",
|
|
509
509
|
top: 0,
|
|
510
510
|
left: "100%",
|
|
511
|
-
width:
|
|
511
|
+
width: ye,
|
|
512
512
|
height: "100%",
|
|
513
513
|
pointerEvents: "auto"
|
|
514
514
|
}
|
|
@@ -516,7 +516,7 @@ const Bn = (e, o, a, c) => {
|
|
|
516
516
|
)
|
|
517
517
|
]
|
|
518
518
|
}
|
|
519
|
-
),
|
|
519
|
+
), ze = (t = "two-row") => /* @__PURE__ */ f(
|
|
520
520
|
"div",
|
|
521
521
|
{
|
|
522
522
|
...t === "two-row" && s ? {
|
|
@@ -530,20 +530,20 @@ const Bn = (e, o, a, c) => {
|
|
|
530
530
|
...t === "two-row" && s ? { pointerEvents: "auto" } : {}
|
|
531
531
|
}
|
|
532
532
|
}
|
|
533
|
-
),
|
|
534
|
-
const t = v.find((i) => i.prefix === "title1"), n = v.filter((i) => i.prefix === "title2" || i.prefix === "title3"), r = n.length > 0 || s || (
|
|
535
|
-
return /* @__PURE__ */ w(
|
|
533
|
+
), gn = () => {
|
|
534
|
+
const t = v.find((i) => i.prefix === "title1"), n = v.filter((i) => i.prefix === "title2" || i.prefix === "title3"), r = n.length > 0 || s || (ge ?? 0) > 0;
|
|
535
|
+
return /* @__PURE__ */ w(yt, { children: [
|
|
536
536
|
/* @__PURE__ */ w("div", { className: `${e}-header-row-top`, children: [
|
|
537
|
-
(C ?? 0) > 0 || s ?
|
|
537
|
+
(C ?? 0) > 0 || s ? ze() : null,
|
|
538
538
|
t && Yt(t, "two-row-top"),
|
|
539
|
-
|
|
539
|
+
R && _e()
|
|
540
540
|
] }),
|
|
541
541
|
r ? /* @__PURE__ */ w("div", { className: `${e}-header-row-bottom-wrap`, children: [
|
|
542
542
|
n.length > 0 ? /* @__PURE__ */ w("div", { className: `${e}-header-row-bottom`, children: [
|
|
543
543
|
n.map((i) => Yt(i, "two-row-bottom")),
|
|
544
|
-
s && /* @__PURE__ */ w(
|
|
545
|
-
|
|
546
|
-
|
|
544
|
+
s && /* @__PURE__ */ w(yt, { children: [
|
|
545
|
+
un(),
|
|
546
|
+
fn()
|
|
547
547
|
] })
|
|
548
548
|
] }) : null,
|
|
549
549
|
/* @__PURE__ */ f(
|
|
@@ -554,7 +554,7 @@ const Bn = (e, o, a, c) => {
|
|
|
554
554
|
"data-controls-reverse": s ? "" : void 0,
|
|
555
555
|
className: s ? `${e}-control` : void 0,
|
|
556
556
|
style: {
|
|
557
|
-
height:
|
|
557
|
+
height: rn,
|
|
558
558
|
width: "100%",
|
|
559
559
|
flexShrink: 0,
|
|
560
560
|
pointerEvents: s ? "auto" : "none"
|
|
@@ -563,377 +563,377 @@ const Bn = (e, o, a, c) => {
|
|
|
563
563
|
)
|
|
564
564
|
] }) : null
|
|
565
565
|
] });
|
|
566
|
-
},
|
|
567
|
-
(C ?? 0) > 0 || s ?
|
|
566
|
+
}, vn = () => /* @__PURE__ */ w(yt, { children: [
|
|
567
|
+
(C ?? 0) > 0 || s ? ze("single-row") : null,
|
|
568
568
|
v.map((t) => Yt(t, "single-row")),
|
|
569
|
-
s ? /* @__PURE__ */ w(
|
|
570
|
-
|
|
571
|
-
|
|
569
|
+
s ? /* @__PURE__ */ w(yt, { children: [
|
|
570
|
+
an(),
|
|
571
|
+
cn()
|
|
572
572
|
] }) : null,
|
|
573
|
-
|
|
574
|
-
] }),
|
|
575
|
-
isSwipeDragging:
|
|
576
|
-
backdropStyle:
|
|
577
|
-
mediaAreaStyle:
|
|
578
|
-
overlayContentStyle:
|
|
579
|
-
swipeHandlers:
|
|
580
|
-
dismissAreaStyle:
|
|
581
|
-
} =
|
|
582
|
-
enabled:
|
|
583
|
-
onClose:
|
|
584
|
-
animMs:
|
|
585
|
-
isBlockedTarget:
|
|
586
|
-
}),
|
|
587
|
-
if (!
|
|
573
|
+
R ? _e() : null
|
|
574
|
+
] }), ee = W((t) => !!(t.closest("[data-controls]") || t.closest(`.${e}-thumbnails`) || t.closest(`.${e}-close-icon`)), [e]), {
|
|
575
|
+
isSwipeDragging: bn,
|
|
576
|
+
backdropStyle: xn,
|
|
577
|
+
mediaAreaStyle: yn,
|
|
578
|
+
overlayContentStyle: wn,
|
|
579
|
+
swipeHandlers: $n,
|
|
580
|
+
dismissAreaStyle: Sn
|
|
581
|
+
} = Kn({
|
|
582
|
+
enabled: q ?? !1,
|
|
583
|
+
onClose: vt,
|
|
584
|
+
animMs: $t,
|
|
585
|
+
isBlockedTarget: ee
|
|
586
|
+
}), ne = () => {
|
|
587
|
+
if (!L || o.length === 0)
|
|
588
588
|
return ot.current = 0, 0;
|
|
589
|
-
const t =
|
|
589
|
+
const t = S.current[0], n = S.current[o.length];
|
|
590
590
|
if (!t || !n) return ot.current;
|
|
591
591
|
const r = n.offsetLeft - t.offsetLeft;
|
|
592
592
|
return r > 0 && (ot.current = r), ot.current;
|
|
593
|
-
},
|
|
594
|
-
if (!
|
|
595
|
-
const n = b.current, r =
|
|
596
|
-
!n || r <= 0 || r < n.clientWidth * 0.25 || (n.scrollLeft <= 0 ? (n.scrollLeft += r, t && (x.current.scrollLeft += r),
|
|
597
|
-
},
|
|
598
|
-
if (!
|
|
593
|
+
}, Q = (t = !1) => {
|
|
594
|
+
if (!L) return;
|
|
595
|
+
const n = b.current, r = ne();
|
|
596
|
+
!n || r <= 0 || r < n.clientWidth * 0.25 || (n.scrollLeft <= 0 ? (n.scrollLeft += r, t && (x.current.scrollLeft += r), U.current && (G.current += r)) : n.scrollLeft >= r * 2 && (n.scrollLeft -= r, t && (x.current.scrollLeft -= r), U.current && (G.current -= r)));
|
|
597
|
+
}, Oe = (t, n = ((r) => (r = b.current) == null ? void 0 : r.scrollLeft)() ?? 0) => {
|
|
598
|
+
if (!L) return t;
|
|
599
599
|
let i = o.length + t, l = 1 / 0;
|
|
600
|
-
for (let u = 0; u <
|
|
601
|
-
const h = u * o.length + t, g =
|
|
600
|
+
for (let u = 0; u < Jt; u++) {
|
|
601
|
+
const h = u * o.length + t, g = S.current[h];
|
|
602
602
|
if (!g) continue;
|
|
603
|
-
const
|
|
604
|
-
|
|
603
|
+
const T = Math.abs(g.offsetLeft - n);
|
|
604
|
+
T < l && (l = T, i = h);
|
|
605
605
|
}
|
|
606
606
|
return i;
|
|
607
607
|
}, ke = (t) => {
|
|
608
608
|
const n = b.current;
|
|
609
609
|
return !t || !n ? !1 : t.offsetWidth > n.clientWidth + 1;
|
|
610
|
-
},
|
|
610
|
+
}, re = (t) => {
|
|
611
611
|
const n = b.current;
|
|
612
612
|
if (!t || !n || !ke(t)) return !1;
|
|
613
613
|
const r = t.offsetLeft, i = r + t.offsetWidth;
|
|
614
614
|
return n.scrollLeft >= r - 1 && n.scrollLeft + n.clientWidth <= i + 1;
|
|
615
615
|
}, st = (t = ((n) => (n = b.current) == null ? void 0 : n.scrollLeft)() ?? 0) => {
|
|
616
|
-
for (let i = 0; i <
|
|
617
|
-
const l =
|
|
618
|
-
if (l &&
|
|
616
|
+
for (let i = 0; i < S.current.length; i += 1) {
|
|
617
|
+
const l = S.current[i];
|
|
618
|
+
if (l && re(l))
|
|
619
619
|
return i;
|
|
620
620
|
}
|
|
621
621
|
let r = { flatIndex: 0, distance: 1 / 0 };
|
|
622
|
-
return
|
|
622
|
+
return S.current.forEach((i, l) => {
|
|
623
623
|
if (!i) return;
|
|
624
624
|
const u = Math.abs(i.offsetLeft - t);
|
|
625
625
|
u < r.distance && (r = { flatIndex: l, distance: u });
|
|
626
626
|
}), r.flatIndex;
|
|
627
|
-
},
|
|
628
|
-
b.current &&
|
|
627
|
+
}, Ee = (t) => {
|
|
628
|
+
b.current && S.current.forEach((n) => {
|
|
629
629
|
n && (n.style.scrollSnapAlign = ke(n) && t === "backward" ? "end" : "start");
|
|
630
630
|
});
|
|
631
|
-
},
|
|
632
|
-
const i = t - n, l = st(n), u =
|
|
633
|
-
if (
|
|
631
|
+
}, Ln = (t, n, r) => {
|
|
632
|
+
const i = t - n, l = st(n), u = S.current[l];
|
|
633
|
+
if (re(u))
|
|
634
634
|
return st(t) % o.length;
|
|
635
|
-
const h =
|
|
636
|
-
return
|
|
637
|
-
},
|
|
638
|
-
if (
|
|
639
|
-
const n =
|
|
635
|
+
const h = S.current[l + 1], g = u ? h ? h.offsetLeft - u.offsetLeft : u.offsetWidth : 0, T = g > 0 ? i > g * zt ? 1 : i < -g * zt ? -1 : 0 : 0;
|
|
636
|
+
return T === 0 ? r : L ? (r + T + o.length) % o.length : Math.max(0, Math.min(o.length - 1, r + T));
|
|
637
|
+
}, Ke = W((t = !1) => {
|
|
638
|
+
if (ht !== "on" || s) return;
|
|
639
|
+
const n = We.current, r = N.current, i = At.current[r];
|
|
640
640
|
if (!n || !i || n.scrollWidth <= n.clientWidth) return;
|
|
641
641
|
const l = n.scrollLeft, u = l + n.clientWidth, h = i.offsetLeft, g = h + i.offsetWidth;
|
|
642
642
|
if (h >= l && g <= u) return;
|
|
643
|
-
const
|
|
644
|
-
let
|
|
645
|
-
if (!t &&
|
|
646
|
-
const ct =
|
|
647
|
-
g > u ?
|
|
648
|
-
} else g > u ?
|
|
649
|
-
n.scrollLeft = Math.max(0, Math.min(
|
|
650
|
-
}, [s,
|
|
651
|
-
t && (
|
|
643
|
+
const T = n.scrollWidth - n.clientWidth;
|
|
644
|
+
let I = l;
|
|
645
|
+
if (!t && Z.current === null) {
|
|
646
|
+
const ct = At.current[r - 1], xt = At.current[r + 1], Nt = ct ? i.offsetLeft - ct.offsetLeft : xt ? xt.offsetLeft - i.offsetLeft : i.offsetWidth;
|
|
647
|
+
g > u ? I += Nt : h < l && (I -= Nt);
|
|
648
|
+
} else g > u ? I = g - n.clientWidth : I = h;
|
|
649
|
+
n.scrollLeft = Math.max(0, Math.min(T, I));
|
|
650
|
+
}, [s, ht]), oe = W((t = !1) => {
|
|
651
|
+
t && (Pt.current = !0), lt.current === null && (lt.current = requestAnimationFrame(() => {
|
|
652
652
|
lt.current = null;
|
|
653
|
-
const n =
|
|
654
|
-
|
|
653
|
+
const n = Pt.current;
|
|
654
|
+
Pt.current = !1, Ke(n);
|
|
655
655
|
}));
|
|
656
|
-
}, [
|
|
657
|
-
if (t ===
|
|
658
|
-
const n =
|
|
659
|
-
|
|
660
|
-
const r = Math.abs(t - n) > 1, i =
|
|
661
|
-
|
|
662
|
-
}, [o.length,
|
|
663
|
-
if (!b.current || o.length === 0 ||
|
|
656
|
+
}, [Ke]), Tn = W((t) => {
|
|
657
|
+
if (t === N.current) return;
|
|
658
|
+
const n = N.current;
|
|
659
|
+
N.current = t;
|
|
660
|
+
const r = Math.abs(t - n) > 1, i = L && o.length > 1 && (n === o.length - 1 && t === 0 || n === 0 && t === o.length - 1);
|
|
661
|
+
Dt(t), oe(r || i);
|
|
662
|
+
}, [o.length, L, oe]), H = () => {
|
|
663
|
+
if (!b.current || o.length === 0 || Z.current !== null || x.current.isActive && x.current.hasMoved) return;
|
|
664
664
|
const t = b.current.scrollLeft, n = st(t) % o.length;
|
|
665
|
-
n !==
|
|
666
|
-
},
|
|
667
|
-
|
|
668
|
-
},
|
|
665
|
+
n !== N.current && Tn(n);
|
|
666
|
+
}, In = () => {
|
|
667
|
+
Z.current = null;
|
|
668
|
+
}, Y = (t) => {
|
|
669
669
|
const n = b.current;
|
|
670
670
|
n && (n.style.scrollSnapType = t ? "" : "none");
|
|
671
|
-
},
|
|
671
|
+
}, bt = () => {
|
|
672
672
|
var t;
|
|
673
673
|
(t = it.current) == null || t.call(it), it.current = null;
|
|
674
|
-
},
|
|
675
|
-
|
|
676
|
-
},
|
|
674
|
+
}, Mt = () => {
|
|
675
|
+
V.current !== null && (cancelAnimationFrame(V.current), V.current = null), U.current = !1;
|
|
676
|
+
}, Fe = () => {
|
|
677
677
|
const t = b.current;
|
|
678
678
|
if (!t) {
|
|
679
|
-
|
|
679
|
+
V.current = null, U.current = !1;
|
|
680
680
|
return;
|
|
681
681
|
}
|
|
682
682
|
const n = G.current - t.scrollLeft;
|
|
683
683
|
if (Math.abs(n) < 0.5) {
|
|
684
|
-
t.scrollLeft = G.current,
|
|
684
|
+
t.scrollLeft = G.current, Q(), H(), V.current = null, U.current = !1;
|
|
685
685
|
return;
|
|
686
686
|
}
|
|
687
|
-
t.scrollLeft += n *
|
|
688
|
-
},
|
|
689
|
-
const t =
|
|
687
|
+
t.scrollLeft += n * Qn, Q(), H(), D(), V.current = requestAnimationFrame(Fe);
|
|
688
|
+
}, Be = () => {
|
|
689
|
+
const t = qt.current;
|
|
690
690
|
t && (t.style.transition = "", t.style.transform = "", t.style.willChange = "");
|
|
691
|
-
},
|
|
692
|
-
|
|
693
|
-
},
|
|
694
|
-
const l = b.current, u =
|
|
691
|
+
}, De = (t, n, r, i) => {
|
|
692
|
+
Be(), t.scrollLeft = n, Ut.current = t.scrollLeft, Q(), r !== void 0 ? (N.current = r, Dt(r)) : H(), Y(!0), i == null || i();
|
|
693
|
+
}, He = (t, { behavior: n = "smooth", activeIndex: r, onComplete: i } = {}) => {
|
|
694
|
+
const l = b.current, u = qt.current;
|
|
695
695
|
if (!l || !u) return;
|
|
696
|
-
if (
|
|
697
|
-
|
|
696
|
+
if (Mt(), bt(), Y(!1), n === "auto") {
|
|
697
|
+
De(l, t, r, i);
|
|
698
698
|
return;
|
|
699
699
|
}
|
|
700
|
-
const h = Math.abs(t - l.scrollLeft), g =
|
|
700
|
+
const h = Math.abs(t - l.scrollLeft), g = Hn(
|
|
701
701
|
h,
|
|
702
|
-
|
|
703
|
-
|
|
702
|
+
Vn,
|
|
703
|
+
Yn,
|
|
704
704
|
l.clientWidth * 0.55
|
|
705
705
|
);
|
|
706
|
-
it.current =
|
|
706
|
+
it.current = Gn(l, u, t, {
|
|
707
707
|
duration: g,
|
|
708
|
-
easing:
|
|
708
|
+
easing: qn,
|
|
709
709
|
onComplete: () => {
|
|
710
|
-
it.current = null,
|
|
710
|
+
it.current = null, De(l, t, r, i);
|
|
711
711
|
}
|
|
712
712
|
});
|
|
713
|
-
},
|
|
713
|
+
}, Wn = (t = "smooth") => {
|
|
714
714
|
const n = b.current;
|
|
715
715
|
if (!n || o.length === 0) return;
|
|
716
|
-
const r = st() % o.length, i =
|
|
717
|
-
l &&
|
|
718
|
-
},
|
|
716
|
+
const r = st() % o.length, i = Oe(r, n.scrollLeft), l = S.current[i];
|
|
717
|
+
l && He(l.offsetLeft, { behavior: t, activeIndex: r });
|
|
718
|
+
}, An = (t, n = "smooth", r, i) => {
|
|
719
719
|
const l = b.current;
|
|
720
720
|
if (!l || o.length === 0) return;
|
|
721
|
-
const u = (i ?? l.scrollLeft) - t, h = st(t), g =
|
|
722
|
-
if (
|
|
723
|
-
|
|
721
|
+
const u = (i ?? l.scrollLeft) - t, h = st(t), g = S.current[h];
|
|
722
|
+
if (re(g)) {
|
|
723
|
+
Y(!0), H();
|
|
724
724
|
return;
|
|
725
725
|
}
|
|
726
|
-
const
|
|
727
|
-
if ((
|
|
728
|
-
const
|
|
726
|
+
const T = S.current[h + 1], I = g ? T ? T.offsetLeft - g.offsetLeft : g.offsetWidth : 0;
|
|
727
|
+
if ((I > 0 ? u > I * zt ? 1 : u < -I * zt ? -1 : 0 : 0) !== 0) {
|
|
728
|
+
const zn = r ?? h % o.length, On = Ln(
|
|
729
729
|
i ?? l.scrollLeft,
|
|
730
730
|
t,
|
|
731
|
-
|
|
731
|
+
zn
|
|
732
732
|
);
|
|
733
|
-
at(
|
|
733
|
+
at(On, n);
|
|
734
734
|
return;
|
|
735
735
|
}
|
|
736
|
-
const
|
|
737
|
-
if (
|
|
738
|
-
|
|
736
|
+
const xt = i ?? l.scrollLeft, Nt = st(xt), je = S.current[Nt];
|
|
737
|
+
if (je && Math.abs(je.offsetLeft - xt) < 1) {
|
|
738
|
+
Y(!0), H();
|
|
739
739
|
return;
|
|
740
740
|
}
|
|
741
|
-
|
|
741
|
+
Wn("auto");
|
|
742
742
|
}, at = (t, n = "smooth") => {
|
|
743
743
|
const r = b.current;
|
|
744
744
|
if (!r || o.length === 0) return;
|
|
745
|
-
const i =
|
|
746
|
-
l && (n === "smooth" ?
|
|
745
|
+
const i = Oe(t, r.scrollLeft), l = S.current[i];
|
|
746
|
+
l && (n === "smooth" ? Z.current = t : Z.current = null, N.current = t, Dt(t), oe(!0), He(l.offsetLeft, {
|
|
747
747
|
behavior: n,
|
|
748
748
|
activeIndex: t,
|
|
749
|
-
onComplete: n === "smooth" ?
|
|
749
|
+
onComplete: n === "smooth" ? In : void 0
|
|
750
750
|
}));
|
|
751
|
-
},
|
|
752
|
-
|
|
753
|
-
},
|
|
754
|
-
const u = r - t, h = i - n, g = Math.abs(u),
|
|
755
|
-
if (g <
|
|
756
|
-
const
|
|
751
|
+
}, ie = () => {
|
|
752
|
+
gt.current && (window.removeEventListener("pointerup", gt.current), window.removeEventListener("pointercancel", gt.current), gt.current = null);
|
|
753
|
+
}, Rn = (t, n, r, i, l) => {
|
|
754
|
+
const u = r - t, h = i - n, g = Math.abs(u), T = Math.abs(h);
|
|
755
|
+
if (g < tr || g <= T) return !1;
|
|
756
|
+
const I = u < 0 ? 1 : -1, ct = L ? (l + I + o.length) % o.length : Math.max(0, Math.min(o.length - 1, l + I));
|
|
757
757
|
return ct === l ? !1 : (at(ct), !0);
|
|
758
|
-
},
|
|
758
|
+
}, Ct = (t) => {
|
|
759
759
|
if (!x.current.isActive) return;
|
|
760
|
-
|
|
760
|
+
ie();
|
|
761
761
|
const n = b.current;
|
|
762
762
|
if (!n) return;
|
|
763
763
|
const { scrollLeft: r, startActiveIndex: i, hasMoved: l } = x.current, u = n.scrollLeft;
|
|
764
|
-
|
|
764
|
+
Q(!0), x.current = {
|
|
765
765
|
isActive: !1,
|
|
766
766
|
startX: 0,
|
|
767
767
|
scrollLeft: 0,
|
|
768
768
|
startActiveIndex: 0,
|
|
769
769
|
hasMoved: !1
|
|
770
|
-
},
|
|
771
|
-
},
|
|
772
|
-
const r =
|
|
773
|
-
|
|
770
|
+
}, Ae(!1), t !== void 0 && n.hasPointerCapture(t) && n.releasePointerCapture(t), l ? An(r, "smooth", i, u) : (Y(!0), H()), D();
|
|
771
|
+
}, Mn = (t, n) => {
|
|
772
|
+
const r = Rt.current;
|
|
773
|
+
Rt.current = null, r && (Rn(
|
|
774
774
|
r.startX,
|
|
775
775
|
r.startY,
|
|
776
776
|
t,
|
|
777
777
|
n,
|
|
778
778
|
r.startActiveIndex
|
|
779
|
-
),
|
|
780
|
-
},
|
|
781
|
-
if (!
|
|
779
|
+
), D());
|
|
780
|
+
}, Cn = (t) => {
|
|
781
|
+
if (!pt) return;
|
|
782
782
|
if (t.pointerType === "touch") {
|
|
783
|
-
if (
|
|
784
|
-
|
|
783
|
+
if (Mt(), Y(!0), ee(t.target)) return;
|
|
784
|
+
Rt.current = {
|
|
785
785
|
startX: t.clientX,
|
|
786
786
|
startY: t.clientY,
|
|
787
|
-
startActiveIndex:
|
|
787
|
+
startActiveIndex: N.current
|
|
788
788
|
};
|
|
789
789
|
return;
|
|
790
790
|
}
|
|
791
|
-
if (t.pointerType !== "mouse" || t.button !== 0 ||
|
|
791
|
+
if (t.pointerType !== "mouse" || t.button !== 0 || ee(t.target)) return;
|
|
792
792
|
const n = b.current;
|
|
793
793
|
if (!n) return;
|
|
794
|
-
|
|
794
|
+
Mt(), bt(), Be(), Z.current = null, x.current = {
|
|
795
795
|
isActive: !0,
|
|
796
796
|
startX: t.clientX,
|
|
797
797
|
scrollLeft: n.scrollLeft,
|
|
798
|
-
startActiveIndex:
|
|
798
|
+
startActiveIndex: N.current,
|
|
799
799
|
hasMoved: !1
|
|
800
|
-
},
|
|
800
|
+
}, Y(!1), D(), n.setPointerCapture(t.pointerId), ie();
|
|
801
801
|
const r = (i) => {
|
|
802
|
-
i.pointerType === "mouse" &&
|
|
802
|
+
i.pointerType === "mouse" && Ct(i.pointerId);
|
|
803
803
|
};
|
|
804
|
-
|
|
805
|
-
},
|
|
806
|
-
if (!
|
|
804
|
+
gt.current = r, window.addEventListener("pointerup", r), window.addEventListener("pointercancel", r);
|
|
805
|
+
}, Nn = (t) => {
|
|
806
|
+
if (!pt || t.pointerType !== "mouse") return;
|
|
807
807
|
const n = b.current;
|
|
808
808
|
if (!n || !x.current.isActive) return;
|
|
809
809
|
if (t.buttons === 0) {
|
|
810
|
-
|
|
810
|
+
Ct(t.pointerId);
|
|
811
811
|
return;
|
|
812
812
|
}
|
|
813
813
|
const r = t.clientX - x.current.startX;
|
|
814
|
-
Math.abs(r) >
|
|
815
|
-
},
|
|
816
|
-
if (
|
|
814
|
+
Math.abs(r) > Pn && (x.current.hasMoved = !0, Ae(!0)), x.current.hasMoved && (t.preventDefault(), n.scrollLeft = x.current.scrollLeft - r, Q(!0), H(), D());
|
|
815
|
+
}, Xe = (t) => {
|
|
816
|
+
if (pt) {
|
|
817
817
|
if (t.pointerType === "touch") {
|
|
818
|
-
t.type === "pointerup" ?
|
|
818
|
+
t.type === "pointerup" ? Mn(t.clientX, t.clientY) : Rt.current = null;
|
|
819
819
|
return;
|
|
820
820
|
}
|
|
821
|
-
t.pointerType === "mouse" &&
|
|
821
|
+
t.pointerType === "mouse" && Ct(t.pointerId);
|
|
822
822
|
}
|
|
823
|
-
},
|
|
824
|
-
!
|
|
823
|
+
}, _n = (t) => {
|
|
824
|
+
!pt || t.pointerType !== "mouse" || Ct(t.pointerId);
|
|
825
825
|
};
|
|
826
|
-
return
|
|
827
|
-
const t = requestAnimationFrame(() =>
|
|
826
|
+
return Bn(), ft(() => {
|
|
827
|
+
const t = requestAnimationFrame(() => Me(!0));
|
|
828
828
|
return () => {
|
|
829
|
-
cancelAnimationFrame(t),
|
|
829
|
+
cancelAnimationFrame(t), bt(), ie(), lt.current !== null && (cancelAnimationFrame(lt.current), lt.current = null), te.current && clearTimeout(te.current), J.current && clearTimeout(J.current);
|
|
830
830
|
};
|
|
831
831
|
}, []), ft(() => {
|
|
832
|
-
if (!
|
|
833
|
-
|
|
832
|
+
if (!mt) {
|
|
833
|
+
Qt(!0);
|
|
834
834
|
return;
|
|
835
835
|
}
|
|
836
|
-
|
|
837
|
-
const t = () =>
|
|
836
|
+
D();
|
|
837
|
+
const t = () => D();
|
|
838
838
|
return document.addEventListener("pointermove", t, { passive: !0 }), document.addEventListener("pointerdown", t, { passive: !0 }), () => {
|
|
839
|
-
document.removeEventListener("pointermove", t), document.removeEventListener("pointerdown", t),
|
|
839
|
+
document.removeEventListener("pointermove", t), document.removeEventListener("pointerdown", t), J.current && clearTimeout(J.current);
|
|
840
840
|
};
|
|
841
|
-
}, [
|
|
841
|
+
}, [mt, D]), ft(() => {
|
|
842
842
|
const t = (n) => {
|
|
843
|
-
n.key === "Escape" &&
|
|
843
|
+
n.key === "Escape" && vt();
|
|
844
844
|
};
|
|
845
845
|
return window.addEventListener("keydown", t), () => window.removeEventListener("keydown", t);
|
|
846
|
-
}, [
|
|
847
|
-
|
|
848
|
-
}, [
|
|
849
|
-
s || at(
|
|
850
|
-
}, [
|
|
846
|
+
}, [vt]), le(() => {
|
|
847
|
+
ne();
|
|
848
|
+
}, [dt, o.length, L]), le(() => {
|
|
849
|
+
s || at(N.current, "auto");
|
|
850
|
+
}, [dt, s]), le(() => {
|
|
851
851
|
at(0, "auto");
|
|
852
|
-
}, [o.length,
|
|
852
|
+
}, [o.length, L]), ft(() => {
|
|
853
853
|
const t = b.current;
|
|
854
|
-
if (!t || s || !
|
|
854
|
+
if (!t || s || !q) return;
|
|
855
855
|
const n = (r) => {
|
|
856
856
|
if (r.preventDefault(), Math.abs(r.deltaY) <= Math.abs(r.deltaX)) return;
|
|
857
|
-
const i = r.deltaMode === 1 ?
|
|
857
|
+
const i = r.deltaMode === 1 ? Jn : r.deltaMode === 2 ? t.clientHeight : 1, l = r.deltaY * i * Zn;
|
|
858
858
|
if (l !== 0) {
|
|
859
|
-
if (
|
|
859
|
+
if (bt(), U.current || (U.current = !0, G.current = t.scrollLeft, Z.current = null, Y(!1)), G.current += l, !L) {
|
|
860
860
|
const u = t.scrollWidth - t.clientWidth;
|
|
861
861
|
G.current = Math.max(0, Math.min(u, G.current));
|
|
862
862
|
}
|
|
863
|
-
|
|
863
|
+
D(), V.current === null && (V.current = requestAnimationFrame(Fe));
|
|
864
864
|
}
|
|
865
865
|
};
|
|
866
866
|
return t.addEventListener("wheel", n, { passive: !1 }), () => {
|
|
867
|
-
t.removeEventListener("wheel", n),
|
|
867
|
+
t.removeEventListener("wheel", n), Mt();
|
|
868
868
|
};
|
|
869
|
-
}, [s,
|
|
869
|
+
}, [s, q, L]), ft(() => {
|
|
870
870
|
const t = b.current;
|
|
871
871
|
if (!t) return;
|
|
872
872
|
const n = () => {
|
|
873
|
-
|
|
874
|
-
const i = t.scrollLeft, l = i -
|
|
875
|
-
|
|
873
|
+
Q(x.current.isActive);
|
|
874
|
+
const i = t.scrollLeft, l = i - Ut.current;
|
|
875
|
+
Ut.current = i;
|
|
876
876
|
const u = ot.current > 0 ? ot.current * 0.5 : 1 / 0;
|
|
877
877
|
if (l !== 0 && Math.abs(l) < u) {
|
|
878
878
|
const h = l > 0 ? "forward" : "backward";
|
|
879
|
-
h !==
|
|
879
|
+
h !== Zt.current && (Zt.current = h, Ee(h));
|
|
880
880
|
}
|
|
881
|
-
x.current.isActive && x.current.hasMoved ||
|
|
881
|
+
x.current.isActive && x.current.hasMoved || H();
|
|
882
882
|
};
|
|
883
883
|
t.addEventListener("scroll", n, { passive: !0 });
|
|
884
884
|
const r = new ResizeObserver(() => {
|
|
885
|
-
|
|
885
|
+
ne(), Q(x.current.isActive), Ee(Zt.current), H();
|
|
886
886
|
});
|
|
887
887
|
return r.observe(t), () => {
|
|
888
|
-
|
|
888
|
+
bt(), t.removeEventListener("scroll", n), r.disconnect();
|
|
889
889
|
};
|
|
890
|
-
}, [o.length,
|
|
890
|
+
}, [o.length, L]), /* @__PURE__ */ w(
|
|
891
891
|
"div",
|
|
892
892
|
{
|
|
893
893
|
"data-selection": "none",
|
|
894
894
|
className: `${e}-lightbox${c ? ` ${e}-lightbox-editor` : ""}${s ? ` ${e}-lightbox-edit-mode` : ""}`,
|
|
895
895
|
onClick: () => {
|
|
896
|
-
|
|
896
|
+
bn || vt();
|
|
897
897
|
},
|
|
898
898
|
role: "dialog",
|
|
899
899
|
"aria-modal": "true",
|
|
900
900
|
"aria-label": "Image gallery",
|
|
901
901
|
style: {
|
|
902
|
-
opacity:
|
|
903
|
-
transition: `opacity ${
|
|
904
|
-
pointerEvents:
|
|
902
|
+
opacity: Re ? 1 : 0,
|
|
903
|
+
transition: `opacity ${$t}ms ease`,
|
|
904
|
+
pointerEvents: Re ? "auto" : "none"
|
|
905
905
|
},
|
|
906
906
|
children: [
|
|
907
|
-
/* @__PURE__ */ f("div", { className: `${e}-lightbox-backdrop`, style: { backgroundColor:
|
|
907
|
+
/* @__PURE__ */ f("div", { className: `${e}-lightbox-backdrop`, style: { backgroundColor: $, ...xn } }),
|
|
908
908
|
/* @__PURE__ */ w(
|
|
909
909
|
"div",
|
|
910
910
|
{
|
|
911
|
-
ref:
|
|
911
|
+
ref: hn,
|
|
912
912
|
className: `${e}-lightbox-dismiss-area`,
|
|
913
|
-
style:
|
|
914
|
-
|
|
913
|
+
style: Sn,
|
|
914
|
+
...$n,
|
|
915
915
|
children: [
|
|
916
|
-
/* @__PURE__ */ f("div", { className: `${e}-lightbox-content`, style:
|
|
916
|
+
/* @__PURE__ */ f("div", { className: `${e}-lightbox-content`, style: yn, onClick: (t) => t.stopPropagation(), children: /* @__PURE__ */ f(
|
|
917
917
|
"div",
|
|
918
918
|
{
|
|
919
919
|
ref: b,
|
|
920
920
|
className: `${e}-lightbox-strip`,
|
|
921
921
|
"data-lightbox-scrollable": "",
|
|
922
|
-
"data-mouse-draggable":
|
|
923
|
-
"data-mouse-dragging":
|
|
924
|
-
onPointerDown:
|
|
925
|
-
onPointerMove:
|
|
926
|
-
onPointerUp:
|
|
927
|
-
onPointerCancel:
|
|
928
|
-
onLostPointerCapture:
|
|
929
|
-
children: /* @__PURE__ */ f("div", { ref:
|
|
930
|
-
const r = t.image.objectFit ?? "contain", i = n % o.length, l = Math.floor(n / o.length), u =
|
|
922
|
+
"data-mouse-draggable": pt && o.length > 0 ? "true" : "false",
|
|
923
|
+
"data-mouse-dragging": mn ? "true" : "false",
|
|
924
|
+
onPointerDown: Cn,
|
|
925
|
+
onPointerMove: Nn,
|
|
926
|
+
onPointerUp: Xe,
|
|
927
|
+
onPointerCancel: Xe,
|
|
928
|
+
onLostPointerCapture: _n,
|
|
929
|
+
children: /* @__PURE__ */ f("div", { ref: qt, className: `${e}-lightbox-strip-track`, style: { gap: dt }, children: dn.map((t, n) => {
|
|
930
|
+
const r = t.image.objectFit ?? "contain", i = n % o.length, l = Math.floor(n / o.length), u = Ot(dt), h = `calc(-0.5 * (${u} + ${dt}))`;
|
|
931
931
|
return /* @__PURE__ */ w(
|
|
932
932
|
"div",
|
|
933
933
|
{
|
|
934
|
-
ref: (g) =>
|
|
934
|
+
ref: (g) => S.current[n] = g,
|
|
935
935
|
className: `${e}-strip-item`,
|
|
936
|
-
style: { height:
|
|
936
|
+
style: { height: ve === "mobile" ? "calc(0.75 * var(--cntrl-viewport-height, 100vh))" : "100%" },
|
|
937
937
|
children: [
|
|
938
938
|
/* @__PURE__ */ f(
|
|
939
939
|
"img",
|
|
@@ -975,8 +975,8 @@ const Bn = (e, o, a, c) => {
|
|
|
975
975
|
"div",
|
|
976
976
|
{
|
|
977
977
|
className: `${e}-lightbox-content-inner`,
|
|
978
|
-
"data-overlay-content-hidden":
|
|
979
|
-
style:
|
|
978
|
+
"data-overlay-content-hidden": Ne ? "true" : "false",
|
|
979
|
+
style: wn,
|
|
980
980
|
children: [
|
|
981
981
|
/* @__PURE__ */ f(
|
|
982
982
|
"div",
|
|
@@ -984,7 +984,7 @@ const Bn = (e, o, a, c) => {
|
|
|
984
984
|
style: {
|
|
985
985
|
position: "relative",
|
|
986
986
|
width: "100%",
|
|
987
|
-
height:
|
|
987
|
+
height: xe,
|
|
988
988
|
flexShrink: 0,
|
|
989
989
|
pointerEvents: "none"
|
|
990
990
|
},
|
|
@@ -999,7 +999,7 @@ const Bn = (e, o, a, c) => {
|
|
|
999
999
|
left: 0,
|
|
1000
1000
|
right: 0,
|
|
1001
1001
|
top: 0,
|
|
1002
|
-
height:
|
|
1002
|
+
height: Pe,
|
|
1003
1003
|
pointerEvents: "auto",
|
|
1004
1004
|
zIndex: 3
|
|
1005
1005
|
}
|
|
@@ -1007,21 +1007,21 @@ const Bn = (e, o, a, c) => {
|
|
|
1007
1007
|
)
|
|
1008
1008
|
}
|
|
1009
1009
|
),
|
|
1010
|
-
/* @__PURE__ */ f("div", { style: { display: "flex", flexDirection: "row", width: "100%", flex: 1, minHeight: 0, pointerEvents: "none" }, children: /* @__PURE__ */ f("div", { className: `${e}-lightbox-content-area${
|
|
1010
|
+
/* @__PURE__ */ f("div", { style: { display: "flex", flexDirection: "row", width: "100%", flex: 1, minHeight: 0, pointerEvents: "none" }, children: /* @__PURE__ */ f("div", { className: `${e}-lightbox-content-area${_ ? ` ${e}-lightbox-content-area-stacked` : ""}`, children: (Te || R) && /* @__PURE__ */ f("div", { className: `${e}-header ${_ ? `${e}-header-two-row` : `${e}-header-single-row`}`, children: _ ? gn() : Te || R ? vn() : null }) }) })
|
|
1011
1011
|
]
|
|
1012
1012
|
}
|
|
1013
1013
|
),
|
|
1014
|
-
o.length > 1 &&
|
|
1015
|
-
const t =
|
|
1014
|
+
o.length > 1 && ht === "on" && (() => {
|
|
1015
|
+
const t = Ot(Bt), n = `calc(-0.5 * (${Bt} + ${t}))`;
|
|
1016
1016
|
return /* @__PURE__ */ f(
|
|
1017
1017
|
"div",
|
|
1018
1018
|
{
|
|
1019
1019
|
className: `${e}-thumbnails-wrap`,
|
|
1020
|
-
style: { bottom:
|
|
1020
|
+
style: { bottom: Bt },
|
|
1021
1021
|
children: /* @__PURE__ */ f(
|
|
1022
1022
|
"div",
|
|
1023
1023
|
{
|
|
1024
|
-
ref:
|
|
1024
|
+
ref: We,
|
|
1025
1025
|
className: `${e}-thumbnails`,
|
|
1026
1026
|
"data-lightbox-scrollable": "",
|
|
1027
1027
|
onClick: (r) => r.stopPropagation(),
|
|
@@ -1029,19 +1029,19 @@ const Bn = (e, o, a, c) => {
|
|
|
1029
1029
|
"div",
|
|
1030
1030
|
{
|
|
1031
1031
|
className: `${e}-thumbnails-track`,
|
|
1032
|
-
"data-thumbnail-active":
|
|
1032
|
+
"data-thumbnail-active": qe,
|
|
1033
1033
|
style: {
|
|
1034
|
-
gap:
|
|
1035
|
-
"--thumbnail-active-color":
|
|
1034
|
+
gap: Ft,
|
|
1035
|
+
"--thumbnail-active-color": Ue
|
|
1036
1036
|
},
|
|
1037
1037
|
children: [
|
|
1038
1038
|
o.map((r, i) => {
|
|
1039
|
-
const l =
|
|
1039
|
+
const l = Ot(Ft), u = `calc(-0.5 * (${l} + ${Ft}))`;
|
|
1040
1040
|
return /* @__PURE__ */ w(
|
|
1041
1041
|
"div",
|
|
1042
1042
|
{
|
|
1043
1043
|
ref: (h) => {
|
|
1044
|
-
|
|
1044
|
+
At.current[i] = h;
|
|
1045
1045
|
},
|
|
1046
1046
|
style: { position: "relative", flex: "0 0 auto" },
|
|
1047
1047
|
children: [
|
|
@@ -1051,24 +1051,24 @@ const Bn = (e, o, a, c) => {
|
|
|
1051
1051
|
type: "button",
|
|
1052
1052
|
className: `${e}-thumb`,
|
|
1053
1053
|
"data-active": nt === i ? "true" : "false",
|
|
1054
|
-
onClick: () =>
|
|
1055
|
-
onMouseEnter: () =>
|
|
1054
|
+
onClick: () => q && St === "click" && at(i),
|
|
1055
|
+
onMouseEnter: () => en && St === "hover" && at(i),
|
|
1056
1056
|
"aria-label": r.image.name ? `View ${r.image.name}` : `View image ${i + 1}`,
|
|
1057
1057
|
"aria-current": nt === i ? "true" : void 0,
|
|
1058
1058
|
children: /* @__PURE__ */ f(
|
|
1059
1059
|
"img",
|
|
1060
1060
|
{
|
|
1061
|
-
className: `${e}-thumb-image${
|
|
1061
|
+
className: `${e}-thumb-image${Le ? ` ${e}-thumb-image-cover` : ""}`,
|
|
1062
1062
|
src: r.image.assetId,
|
|
1063
1063
|
alt: "",
|
|
1064
1064
|
draggable: !1,
|
|
1065
1065
|
style: {
|
|
1066
|
-
...
|
|
1067
|
-
maxWidth:
|
|
1068
|
-
maxHeight:
|
|
1069
|
-
width:
|
|
1066
|
+
...nn,
|
|
1067
|
+
maxWidth: be,
|
|
1068
|
+
maxHeight: be,
|
|
1069
|
+
width: Lt.display === "cover" ? "auto" : "100%",
|
|
1070
1070
|
height: "auto",
|
|
1071
|
-
objectFit:
|
|
1071
|
+
objectFit: Lt.display === "cover" ? "cover" : "contain"
|
|
1072
1072
|
}
|
|
1073
1073
|
}
|
|
1074
1074
|
)
|
|
@@ -1126,8 +1126,8 @@ const Bn = (e, o, a, c) => {
|
|
|
1126
1126
|
]
|
|
1127
1127
|
}
|
|
1128
1128
|
);
|
|
1129
|
-
};
|
|
1130
|
-
function
|
|
1129
|
+
}, ce = 400, ue = "cubic-bezier(0.25, 0.1, 0.25, 1)", hr = 1.1;
|
|
1130
|
+
function dr(e) {
|
|
1131
1131
|
return `
|
|
1132
1132
|
.${e}-wrapper {
|
|
1133
1133
|
position: relative;
|
|
@@ -1173,6 +1173,38 @@ function ur(e) {
|
|
|
1173
1173
|
max-width: 100%;
|
|
1174
1174
|
}
|
|
1175
1175
|
|
|
1176
|
+
@property --${e}-hover-zoom {
|
|
1177
|
+
syntax: '<number>';
|
|
1178
|
+
inherits: false;
|
|
1179
|
+
initial-value: 1;
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
.${e}-hover-zoom-in .${e}-cover-image {
|
|
1183
|
+
transform: scale(var(--${e}-hover-zoom));
|
|
1184
|
+
clip-path: inset(calc(50% - 50% / var(--${e}-hover-zoom)));
|
|
1185
|
+
transition: --${e}-hover-zoom ${ce}ms ${ue};
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
.${e}-hover-scale-down .${e}-cover-image {
|
|
1189
|
+
transition: transform ${ce}ms ${ue};
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
.${e}-hover-greyscale .${e}-cover-image {
|
|
1193
|
+
transition: filter ${ce}ms ${ue};
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1196
|
+
@media (hover: hover) {
|
|
1197
|
+
.${e}-hover-zoom-in .${e}-cover:hover .${e}-cover-image {
|
|
1198
|
+
--${e}-hover-zoom: ${hr};
|
|
1199
|
+
}
|
|
1200
|
+
.${e}-hover-scale-down .${e}-cover:hover .${e}-cover-image {
|
|
1201
|
+
transform: scale(0.9);
|
|
1202
|
+
}
|
|
1203
|
+
.${e}-hover-greyscale .${e}-cover:hover .${e}-cover-image {
|
|
1204
|
+
filter: grayscale(1);
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1176
1208
|
.${e}-lightbox {
|
|
1177
1209
|
position: fixed;
|
|
1178
1210
|
inset: 0;
|
|
@@ -1359,7 +1391,7 @@ function ur(e) {
|
|
|
1359
1391
|
background-color: transparent;
|
|
1360
1392
|
padding: 0;
|
|
1361
1393
|
opacity: 1;
|
|
1362
|
-
transition: opacity ${
|
|
1394
|
+
transition: opacity ${$t}ms ease;
|
|
1363
1395
|
}
|
|
1364
1396
|
|
|
1365
1397
|
.${e}-close-icon[data-overlay-content-hidden="true"] {
|
|
@@ -1472,7 +1504,7 @@ function ur(e) {
|
|
|
1472
1504
|
display: flex;
|
|
1473
1505
|
flex-direction: column;
|
|
1474
1506
|
opacity: 1;
|
|
1475
|
-
transition: opacity ${
|
|
1507
|
+
transition: opacity ${$t}ms ease;
|
|
1476
1508
|
}
|
|
1477
1509
|
|
|
1478
1510
|
.${e}-lightbox-content-inner[data-overlay-content-hidden="true"] {
|
|
@@ -1515,60 +1547,60 @@ function ur(e) {
|
|
|
1515
1547
|
}
|
|
1516
1548
|
`;
|
|
1517
1549
|
}
|
|
1518
|
-
const
|
|
1519
|
-
const { prefix: m } =
|
|
1520
|
-
|
|
1550
|
+
const Lr = ({ settings: e, content: o, isEditor: a, isEditMode: c, isPreviewMode: s, portalId: d }) => {
|
|
1551
|
+
const { prefix: m } = En(), { cover: $, coverFit: A, hover: K = "none" } = e, O = K !== "none" && (!a || s) ? ` ${m}-hover-${K}` : "", P = p(null), [R, F] = wt(!1), M = o ?? [], tt = R && M.length > 0, St = () => {
|
|
1552
|
+
M.length !== 0 && F(!0);
|
|
1521
1553
|
};
|
|
1522
1554
|
return ft(() => {
|
|
1523
|
-
!a || c || s ||
|
|
1524
|
-
}, [a, c, s]), /* @__PURE__ */ w(
|
|
1525
|
-
/* @__PURE__ */ w("div", { ref:
|
|
1526
|
-
/* @__PURE__ */ f("style", { dangerouslySetInnerHTML: { __html:
|
|
1527
|
-
|
|
1555
|
+
!a || c || s || F(!1);
|
|
1556
|
+
}, [a, c, s]), /* @__PURE__ */ w(yt, { children: [
|
|
1557
|
+
/* @__PURE__ */ w("div", { ref: P, className: `${m}-wrapper${O}`, children: [
|
|
1558
|
+
/* @__PURE__ */ f("style", { dangerouslySetInnerHTML: { __html: dr(m) } }),
|
|
1559
|
+
$ && /* @__PURE__ */ f(
|
|
1528
1560
|
"div",
|
|
1529
1561
|
{
|
|
1530
|
-
className: `${m}-cover ${
|
|
1531
|
-
onClick: () =>
|
|
1532
|
-
style: { ...
|
|
1562
|
+
className: `${m}-cover ${Et(A) ? `${m}-ratio-wrapper-cover` : `${m}-ratio-wrapper-fit`}`,
|
|
1563
|
+
onClick: () => St(),
|
|
1564
|
+
style: { ...Et(A) ? { "--image-aspect-ratio": Ve(A) } : {} },
|
|
1533
1565
|
"aria-label": "Open image gallery",
|
|
1534
1566
|
children: /* @__PURE__ */ f(
|
|
1535
1567
|
"img",
|
|
1536
1568
|
{
|
|
1537
|
-
className: `${m}-cover-image ${
|
|
1538
|
-
src:
|
|
1569
|
+
className: `${m}-cover-image ${Et(A) ? `${m}-cover-image-cover` : `${m}-cover-image-fit`}`,
|
|
1570
|
+
src: $,
|
|
1539
1571
|
alt: "cover"
|
|
1540
1572
|
}
|
|
1541
1573
|
)
|
|
1542
1574
|
}
|
|
1543
1575
|
)
|
|
1544
1576
|
] }),
|
|
1545
|
-
|
|
1546
|
-
const
|
|
1577
|
+
tt && typeof document < "u" && (() => {
|
|
1578
|
+
const ht = (d ? document.getElementById(d) : null) ?? document.body;
|
|
1547
1579
|
return kn(
|
|
1548
1580
|
/* @__PURE__ */ f(
|
|
1549
|
-
|
|
1581
|
+
fr,
|
|
1550
1582
|
{
|
|
1551
1583
|
prefix: m,
|
|
1552
|
-
images:
|
|
1584
|
+
images: M,
|
|
1553
1585
|
settings: e,
|
|
1554
1586
|
isEditor: a,
|
|
1555
1587
|
isEditMode: c,
|
|
1556
1588
|
isPreviewMode: s,
|
|
1557
|
-
onClose: () =>
|
|
1589
|
+
onClose: () => F(!1)
|
|
1558
1590
|
}
|
|
1559
1591
|
),
|
|
1560
|
-
|
|
1592
|
+
ht
|
|
1561
1593
|
);
|
|
1562
1594
|
})()
|
|
1563
1595
|
] });
|
|
1564
1596
|
};
|
|
1565
1597
|
export {
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1598
|
+
Lr as LightboxStrip,
|
|
1599
|
+
nr as STRIP_TEXT_STYLE_PREFIXES,
|
|
1600
|
+
rr as STRIP_TEXT_STYLE_TAB_LABELS,
|
|
1601
|
+
Sr as createStripTextStylePanelTab,
|
|
1602
|
+
ar as createStripTextStyleTabContentItems,
|
|
1603
|
+
lr as extractTitlesFromLegacyText,
|
|
1604
|
+
X as getStripTextStyleSettingKey,
|
|
1605
|
+
sr as resolveStripItemTitles
|
|
1574
1606
|
};
|