@cntrl-site/components 1.0.120 → 1.0.121

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.
Files changed (30) hide show
  1. package/dist/{Burger-C8JIQQwm.mjs → Burger-BKeZH3HS.mjs} +1 -1
  2. package/dist/{Burger-C_SjPZWp.js → Burger-DxjmS1t5.js} +1 -1
  3. package/dist/{Chronicles-BNvvaFYY.mjs → Chronicles-BXfNFANB.mjs} +1 -1
  4. package/dist/{Chronicles-Dj1gvNjE.js → Chronicles-mir8oCdq.js} +1 -1
  5. package/dist/{ChroniclesComponent-8lhIeord.mjs → ChroniclesComponent-CH-c7QBm.mjs} +18 -35
  6. package/dist/{ChroniclesComponent-5ZbqHNpi.js → ChroniclesComponent-D425pM5e.js} +1 -1
  7. package/dist/Components/Slider20/Slider20.d.ts +1 -2
  8. package/dist/{LightboxJournal-BDUs6T0B.mjs → LightboxJournal-By2sN-Ix.mjs} +1 -1
  9. package/dist/{LightboxJournal-Bf_rZzmz.js → LightboxJournal-DEQXz8wX.js} +1 -1
  10. package/dist/{LightboxStrip-Cuhb2fIR.mjs → LightboxStrip-GwaY8uLD.mjs} +1 -1
  11. package/dist/{LightboxStrip-RA4ABUC-.js → LightboxStrip-XbD9uQKr.js} +1 -1
  12. package/dist/Slider20-BOmjDRf2.js +272 -0
  13. package/dist/Slider20-DUi6qwnd.mjs +851 -0
  14. package/dist/{components-CBJ6asBX.mjs → components-BN4QKcJm.mjs} +1 -1
  15. package/dist/{components-BHB4G3ma.js → components-QZW1MaQM.js} +1 -1
  16. package/dist/elements.js +1 -1
  17. package/dist/elements.mjs +5 -5
  18. package/dist/elements.node.js +1 -1
  19. package/dist/elements.node.mjs +1 -1
  20. package/dist/index.js +1 -1
  21. package/dist/index.mjs +2 -2
  22. package/dist/sources.js +168 -213
  23. package/dist/sources.mjs +167 -212
  24. package/dist/useLightboxScrollLock-CjSZPvqJ.mjs +18 -0
  25. package/dist/useLightboxScrollLock-CmwKl-Vu.js +1 -0
  26. package/package.json +1 -1
  27. package/dist/Slider20-C2o_EB1I.mjs +0 -872
  28. package/dist/Slider20-DzxWCTg-.js +0 -273
  29. package/dist/useLightboxScrollLock-Hf16Eq4g.js +0 -1
  30. package/dist/useLightboxScrollLock-VQ07s7EJ.mjs +0 -18
@@ -1,872 +0,0 @@
1
- import { jsxs as k, Fragment as Ee, jsx as s } from "react/jsx-runtime";
2
- import { useState as C, useRef as T, useCallback as M, useEffect as z } from "react";
3
- import w from "classnames";
4
- import { R as wo } from "./RichTextRenderer-D52Xto59.mjs";
5
- import { s as y } from "./scalingValue-C9JH5L6O.mjs";
6
- import { S as Ke } from "./SvgImage-B5mR9y6q.mjs";
7
- import { t as xo } from "./textStylesToCss-05Mn6I_2.mjs";
8
- import { u as bo } from "./useScopedStyles-DhBG3557.mjs";
9
- const Io = 500, To = 1, ke = "cubic-bezier(0.25, 1, 0.5, 1)", So = 300, ko = 40, Co = 5, Ao = 0.15, go = 0.4, Mo = 100, X = 100, je = {
10
- color: "#000000",
11
- hover: "#cccccc"
12
- }, q = {
13
- offset: { x: 0, y: 0 },
14
- colors: {
15
- pagination: "#cccccc",
16
- inactive: "#cccccc",
17
- background: "#000000"
18
- }
19
- }, No = {
20
- s: {
21
- paddingY: 5,
22
- paddingActive: 5,
23
- borderRadius: 9,
24
- dot: 4,
25
- activeDot: 8,
26
- gapInactive: 9,
27
- inset: 5
28
- },
29
- m: {
30
- paddingY: 7,
31
- paddingActive: 7,
32
- borderRadius: 17,
33
- dot: 8,
34
- activeDot: 20,
35
- gapInactive: 22,
36
- inset: 7
37
- },
38
- l: {
39
- paddingY: 10,
40
- paddingActive: 10,
41
- borderRadius: 29,
42
- dot: 20,
43
- activeDot: 38,
44
- gapInactive: 26,
45
- inset: 10
46
- }
47
- }, Ie = {
48
- offset: { x: 0, y: 0 },
49
- linkColor: "#cccccc"
50
- }, qe = {
51
- sizeType: "drag",
52
- value: 3
53
- }, Ro = "left";
54
- function Lo(e, a) {
55
- var x, $;
56
- const n = {
57
- fontSettings: {
58
- fontFamily: (e == null ? void 0 : e.titleFontFamily) ?? "Arial",
59
- fontWeight: ((x = e == null ? void 0 : e.titleFontSettings) == null ? void 0 : x.fontWeight) ?? 400,
60
- fontStyle: (($ = e == null ? void 0 : e.titleFontSettings) == null ? void 0 : $.fontStyle) ?? "normal"
61
- },
62
- fontSize: (e == null ? void 0 : e.titleFontSize) ?? 0.02,
63
- lineHeight: (e == null ? void 0 : e.titleLineHeight) ?? 0.02,
64
- letterSpacing: (e == null ? void 0 : e.titleLetterSpacing) ?? 0,
65
- wordSpacing: (e == null ? void 0 : e.titleWordSpacing) ?? 0,
66
- textAppearance: e == null ? void 0 : e.titleTextAppearance,
67
- textAlign: Ro,
68
- color: (e == null ? void 0 : e.titleColor) ?? "#000000"
69
- };
70
- return xo(n, a);
71
- }
72
- function H(e, a, n) {
73
- return `${e}: ${y(a / 1440, n)};`;
74
- }
75
- function Z(e, a) {
76
- return a <= 0 ? 0 : (e % a + a) % a;
77
- }
78
- const Do = 3;
79
- function Te(e, a, n) {
80
- return n ? `translate3d(calc(${-e * 100}% + ${a}px), 0, 0)` : `translate3d(0, calc(${-e * 100}% + ${a}px), 0)`;
81
- }
82
- function Se(e, a) {
83
- return (Math.floor(e / a) - 1) * a;
84
- }
85
- function Ze(e, a) {
86
- const n = window.getComputedStyle(e);
87
- return parseFloat(a ? n.width : n.height) || 0;
88
- }
89
- function zo(e, a) {
90
- const n = new DOMMatrixReadOnly(window.getComputedStyle(e).transform);
91
- return a ? n.m41 : n.m42;
92
- }
93
- function _o(e, a) {
94
- const n = document.createElement("div");
95
- n.className = a, n.setAttribute("aria-hidden", "true"), e.appendChild(n);
96
- const x = (W, P) => {
97
- n.style.transform = `translate(${W}px, ${P}px)`;
98
- const G = n.getBoundingClientRect();
99
- return { x: G.left, y: G.top };
100
- }, $ = x(0, 0), r = x(X, 0), J = x(0, X);
101
- e.removeChild(n);
102
- const I = {
103
- x: (r.x - $.x) / X,
104
- y: (r.y - $.y) / X
105
- }, i = {
106
- x: (J.x - $.x) / X,
107
- y: (J.y - $.y) / X
108
- }, Q = I.x * i.y - i.x * I.y;
109
- return { ex: I, ey: i, det: Q };
110
- }
111
- function Oo(e, a, n) {
112
- const { ex: x, ey: $, det: r } = e;
113
- return {
114
- x: (a * $.y - n * $.x) / r,
115
- y: (x.x * n - x.y * a) / r
116
- };
117
- }
118
- function Yo(e) {
119
- const a = Math.min(Math.max(e, 0), 2);
120
- return Math.round(Io * Math.pow(4, 1 - a));
121
- }
122
- function Fo(e, a, n) {
123
- return `
124
- .${e}-wrapper {
125
- position: relative;
126
- width: 100%;
127
- height: 100%;
128
- overflow: visible;
129
- }
130
- .${e}-wrapper:hover .${e}-hover-arrow {
131
- opacity: 1 !important;
132
- }
133
- .${e}-slider-inner {
134
- position: relative;
135
- width: 100%;
136
- height: 100%;
137
- }
138
- .${e}-track {
139
- position: absolute;
140
- top: 0;
141
- left: 0;
142
- width: 100%;
143
- height: 100%;
144
- overflow: hidden;
145
- }
146
- .${e}-axis-probe {
147
- position: absolute;
148
- top: 0;
149
- left: 0;
150
- width: 0;
151
- height: 0;
152
- pointer-events: none;
153
- visibility: hidden;
154
- }
155
- .${e}-track-draggable {
156
- touch-action: pan-y;
157
- }
158
- .${e}-track-draggable-vertical {
159
- touch-action: pan-x;
160
- }
161
- .${e}-track-draggable .${e}-list {
162
- user-select: none;
163
- -webkit-user-select: none;
164
- }
165
- .${e}-track-draggable .${e}-slider-image {
166
- -webkit-user-drag: none;
167
- }
168
- .${e}-list {
169
- position: relative;
170
- width: 100%;
171
- height: 100%;
172
- }
173
- .${e}-list-slide {
174
- display: flex;
175
- flex-direction: row;
176
- will-change: transform;
177
- }
178
- .${e}-list-slide-vertical {
179
- flex-direction: column;
180
- }
181
- .${e}-list-fade {
182
- display: block;
183
- /* Keeps the transition layers' z-index below the arrows, dots and click overlay. */
184
- isolation: isolate;
185
- }
186
- .${e}-slide {
187
- position: relative;
188
- flex: 0 0 100%;
189
- width: 100%;
190
- height: 100%;
191
- }
192
- .${e}-list-fade .${e}-slide {
193
- position: absolute;
194
- top: 0;
195
- left: 0;
196
- opacity: 0;
197
- }
198
- .${e}-list-fade .${e}-slide.${e}-is-layer {
199
- opacity: 1;
200
- }
201
- .${e}-slider-item {
202
- width: 100%;
203
- height: 100%;
204
- display: flex;
205
- position: relative;
206
- }
207
- .${e}-slider-image {
208
- width: 100%;
209
- height: 100%;
210
- object-fit: cover;
211
- }
212
- .${e}-arrow {
213
- position: absolute;
214
- display: flex;
215
- align-items: center;
216
- justify-content: center;
217
- border: none;
218
- background-color: transparent;
219
- top: 50%;
220
- z-index: 3;
221
- padding: 0;
222
- ${H("width", 30, n)}
223
- ${H("height", 30, n)}
224
- transition: opacity 0.15s ease-in-out;
225
- }
226
- .${e}-arrow-prev {
227
- ${H("left", -20, n)}
228
- transform: translate3d(-50%, -50%, 0);
229
- }
230
- .${e}-arrow-next {
231
- left: unset;
232
- ${H("right", -20, n)}
233
- transform: translate3d(50%, -50%, 0);
234
- }
235
- .${e}-arrow-prev-vertical {
236
- left: 50%;
237
- ${H("top", -20, n)}
238
- transform: translate3d(-50%, -50%, 0);
239
- }
240
- .${e}-arrow-next-vertical {
241
- left: 50%;
242
- right: unset;
243
- top: unset;
244
- ${H("bottom", -20, n)}
245
- transform: translate3d(-50%, 50%, 0);
246
- }
247
- .${e}-arrow-hidden {
248
- opacity: 0;
249
- pointer-events: none;
250
- }
251
- .${e}-hover-arrow {
252
- opacity: 0;
253
- transition: opacity 0.15s ease-in-out;
254
- }
255
- .${e}-hover-arrow:hover {
256
- opacity: 1;
257
- }
258
- .${e}-arrow-inner {
259
- all: unset;
260
- cursor: pointer;
261
- width: 100%;
262
- height: 100%;
263
- }
264
- .${e}-arrow-inner:hover .${e}-arrow-icon path {
265
- fill: var(--arrow-hover-color) !important;
266
- }
267
- .${e}-arrow-img {
268
- position: absolute;
269
- top: 50%;
270
- left: 50%;
271
- transform: translate(-50%, -50%);
272
- }
273
- .${e}-arrow-icon {
274
- width: 100%;
275
- height: 100%;
276
- overflow: visible;
277
- }
278
- .${e}-arrow-icon path {
279
- transition: fill 0.15s ease-in-out;
280
- }
281
- .${e}-mirror {
282
- transform: translate(-50%, -50%) scaleX(-1) !important;
283
- }
284
- .${e}-pagination {
285
- position: absolute;
286
- z-index: 3;
287
- border-radius: 50%;
288
- }
289
- .${e}-pagination-inner {
290
- display: flex;
291
- align-items: center;
292
- box-sizing: border-box;
293
- }
294
- .${e}-pagination-vertical {
295
- flex-direction: column;
296
- }
297
- .${e}-pagination-item {
298
- all: unset;
299
- flex-shrink: 0;
300
- position: relative;
301
- display: flex;
302
- align-items: center;
303
- justify-content: center;
304
- cursor: pointer;
305
- aspect-ratio: 1;
306
- height: auto;
307
- }
308
- .${e}-dot {
309
- border-radius: 50%;
310
- aspect-ratio: 1;
311
- height: auto;
312
- transition: background-color 0.3s ease-in-out;
313
- }
314
- .${e}-animate-dots .${e}-dot {
315
- transition: background-color 0.3s ease-in-out, width 0.3s ease-in-out;
316
- }
317
- .${e}-pagination-inside-bottom {
318
- left: 50%;
319
- transform: translate3d(-50%, 0, 0);
320
- }
321
- .${e}-pagination-inside-left {
322
- top: 50%;
323
- transform: translate3d(0, -50%, 0);
324
- }
325
- .${e}-img-wrapper {
326
- width: 100%;
327
- height: 100%;
328
- }
329
- .${e}-control {
330
- position: relative;
331
- z-index: 2;
332
- width: 100%;
333
- }
334
- .${e}-caption-block {
335
- pointer-events: none;
336
- position: absolute;
337
- top: 100%;
338
- left: 0;
339
- right: 0;
340
- z-index: 1;
341
- }
342
- .${e}-caption-text-wrapper {
343
- position: relative;
344
- width: 100%;
345
- }
346
- .${e}-caption-text {
347
- pointer-events: none;
348
- max-width: 100%;
349
- transition-property: opacity;
350
- transition-timing-function: ease-in-out;
351
- position: absolute;
352
- top: 0;
353
- left: 0;
354
- display: inline-block;
355
- white-space: pre-wrap;
356
- overflow-wrap: break-word;
357
- opacity: 0;
358
- }
359
- .${e}-caption-text.${e}-active {
360
- opacity: 1;
361
- }
362
- .${e}-with-pointer-events {
363
- pointer-events: auto;
364
- }
365
- .${e}-click-overlay {
366
- position: absolute;
367
- top: 0;
368
- left: 0;
369
- width: 100%;
370
- height: 100%;
371
- cursor: pointer;
372
- z-index: 2;
373
- }
374
- .${e}-transition-fade .${e}-slide.${e}-is-animated .${e}-slider-image {
375
- animation: ${e}-fade-in ${a}ms ${ke};
376
- }
377
- .${e}-transition-reveal .${e}-slide.${e}-is-animated .${e}-slider-image {
378
- animation: ${e}-reveal-horizontal ${a}ms ease;
379
- }
380
- .${e}-transition-reveal-vertical .${e}-slide.${e}-is-animated .${e}-slider-image {
381
- animation: ${e}-reveal-vertical ${a}ms ease;
382
- }
383
- @keyframes ${e}-fade-in {
384
- from { opacity: 0; }
385
- to { opacity: 1; }
386
- }
387
- @keyframes ${e}-reveal-horizontal {
388
- from { clip-path: inset(0 100% 0 0); }
389
- to { clip-path: inset(0 0 0 0); }
390
- }
391
- @keyframes ${e}-reveal-vertical {
392
- from { clip-path: inset(100% 0 0 0); }
393
- to { clip-path: inset(0 0 0 0); }
394
- }
395
- `;
396
- }
397
- function Ko({ settings: e, content: a, isEditor: n, isPreviewMode: x, isEditMode: $ }) {
398
- const { prefix: r } = bo(), J = Lo(e, n), I = a ?? [], i = I.length, Q = (e == null ? void 0 : e.trigger) ?? qe, W = Q.sizeType ?? "drag", P = Q.value ?? qe.value, G = (e == null ? void 0 : e.direction) ?? "horizontal", fe = (e == null ? void 0 : e.transition) ?? "slide", Qe = typeof (e == null ? void 0 : e.transitionSpeed) == "number" ? e.transitionSpeed : To, S = Yo(Qe), Pe = (e == null ? void 0 : e.nav) ?? "classic", Ce = (e == null ? void 0 : e.navSize) ?? "m", u = No[Ce], eo = typeof (e == null ? void 0 : e.navUnit) == "number" ? e.navUnit : 1 / 1440, m = (o) => y(o * eo, n), Ae = (e == null ? void 0 : e.show) ?? "always", _ = (e == null ? void 0 : e.controls) ?? null, ge = typeof (e == null ? void 0 : e.controlsMaxWidth) == "number" ? e.controlsMaxWidth : 65 / 1440, Me = typeof (e == null ? void 0 : e.paddingX) == "number" ? e.paddingX : 0, Ne = typeof (e == null ? void 0 : e.paddingY) == "number" ? e.paddingY : 0, O = (e == null ? void 0 : e.controlsColor) ?? je.color, ee = (e == null ? void 0 : e.controlsHoverColor) ?? je.hover, oo = (e == null ? void 0 : e.navColor) ?? q.colors.inactive, to = (e == null ? void 0 : e.navPaginationColor) ?? q.colors.pagination, ro = (e == null ? void 0 : e.navBackgroundColor) ?? q.colors.background, Re = (e == null ? void 0 : e.linkColor) ?? Ie.linkColor, no = typeof (e == null ? void 0 : e.captionMarginTop) == "number" ? e.captionMarginTop : 0, Le = typeof (e == null ? void 0 : e.imageCorners) == "number" ? e.imageCorners : 0, ao = Le > 0 ? { borderRadius: y(Le, n), isolation: "isolate" } : void 0, l = G === "horizontal", io = W === "click", me = W === "drag", De = W === "auto" && (!n || !!x), ze = !n, h = fe === "slide", oe = fe === "reveal", _e = !h, co = Pe === "classic", lo = Ae !== "never" && ge > 0, Oe = Ae === "on hover", he = y(ge, n), te = {
399
- width: he,
400
- height: he,
401
- maxWidth: he
402
- }, A = h && i > 1, [v, re] = C(0), [N, Ye] = C([
403
- { index: v, key: 0, isAnimated: !1 }
404
- ]), Fe = N[N.length - 1];
405
- if (_e && Fe.index !== v) {
406
- const o = N.length >= ko ? [N[0], ...N.slice(2)] : N;
407
- Ye([...o, { index: v, key: Fe.key + 1, isAnimated: !0 }]);
408
- }
409
- const so = (o) => {
410
- Ye((t) => {
411
- const c = t.findIndex((p) => p.key === o);
412
- return c > 0 ? t.slice(c) : t;
413
- });
414
- }, Xe = (o) => o && /* @__PURE__ */ s("div", { className: `${r}-slider-item`, children: /* @__PURE__ */ s("div", { className: `${r}-img-wrapper`, children: /* @__PURE__ */ s(
415
- "img",
416
- {
417
- className: `${r}-slider-image`,
418
- src: o.image.assetId,
419
- alt: o.image.name ?? "",
420
- draggable: !1
421
- }
422
- ) }) }), [Y, ne] = C(A ? i : 0), [He, po] = C(!1), [ve, B] = C(!1), [uo, $e] = C(!1), [fo, R] = C(0), [ye, we] = C(!1), [We, Ge] = C(!1), xe = T(!1), U = T(Y);
423
- U.current = Y;
424
- const ae = T(null), ie = T(null), F = T(null), L = T(null), ce = T(v);
425
- ce.current = v;
426
- const V = T(v), E = T(null), D = M((o) => {
427
- xe.current = o, po(o);
428
- }, []), le = M((o) => {
429
- if (!oe) {
430
- re((d) => Z(o(d), i));
431
- return;
432
- }
433
- const t = E.current !== null, c = t ? V.current : ce.current;
434
- if (V.current = Z(o(c), i), t) return;
435
- const p = (d) => {
436
- ce.current = d, re(d), E.current = window.setTimeout(() => {
437
- E.current = null, V.current !== ce.current && p(V.current);
438
- }, S / 2);
439
- };
440
- p(V.current);
441
- }, [i, oe, S]);
442
- z(() => () => {
443
- E.current !== null && window.clearTimeout(E.current);
444
- }, []);
445
- const be = M(() => {
446
- const o = ie.current, t = o ? Ze(o, l) : 0;
447
- return !o || t <= 0 ? U.current : Math.round(-zo(o, l) / t * 1e3) / 1e3;
448
- }, [l]), se = M((o) => {
449
- const t = be(), c = Se(t, i), p = o(t - c, c), d = ie.current;
450
- if (c !== 0 && d) {
451
- const f = d.style.transition;
452
- d.style.transition = "none", d.style.transform = Te(t - c, 0, l), d.offsetWidth, d.style.transition = f && f !== "none" ? f : `transform ${S}ms ${ke}`, d.style.transform = Te(p, 0, l);
453
- }
454
- U.current = p, re(Z(p, i)), B(!1), ne(p);
455
- }, [i, l, be, S]), de = M((o) => {
456
- if (!(i < 2 || o === 0)) {
457
- if (we(!0), D(!0), !h) {
458
- le((t) => t + o);
459
- return;
460
- }
461
- se((t, c) => {
462
- const p = U.current - c, d = Math.abs(p - t) < i ? p : Math.round(t), f = i - 1;
463
- return Math.min(Math.max(d + o, Math.ceil(t - f)), Math.floor(t + f));
464
- });
465
- }
466
- }, [le, i, h, se, D]), K = M((o) => {
467
- de(o);
468
- }, [de]), mo = M((o) => {
469
- if (i < 2) return;
470
- const t = Z(o, i);
471
- if (!(t === v && !xe.current)) {
472
- if (we(!0), D(!0), !h) {
473
- le(() => t);
474
- return;
475
- }
476
- se(() => i + t);
477
- }
478
- }, [v, le, i, h, se, D]);
479
- z(() => {
480
- if (!He) return;
481
- const o = window.setTimeout(() => {
482
- if (D(!1), !A) return;
483
- const t = Se(Y, i);
484
- t !== 0 && (B(!0), ne(Y - t));
485
- }, S);
486
- return () => window.clearTimeout(o);
487
- }, [i, A, He, D, Y, S]), z(() => {
488
- if (!ve) return;
489
- let o = 0;
490
- const t = requestAnimationFrame(() => {
491
- o = requestAnimationFrame(() => B(!1));
492
- });
493
- return () => {
494
- cancelAnimationFrame(t), cancelAnimationFrame(o);
495
- };
496
- }, [ve]);
497
- const pe = `${A}:${i}`, Be = T(pe);
498
- z(() => {
499
- if (Be.current === pe) return;
500
- Be.current = pe;
501
- const o = i > 0 ? Math.min(v, i - 1) : 0;
502
- F.current = null, L.current = null, $e(!1), R(0), re(o), B(!0), ne(o + (A ? i : 0));
503
- }, [v, i, A, pe]), z(() => {
504
- if (!ye) return;
505
- const o = window.setTimeout(() => we(!1), So);
506
- return () => window.clearTimeout(o);
507
- }, [ye, v]), z(() => {
508
- if (!De || i < 2) return;
509
- const o = Math.max(P, 0.1) * 1e3, t = window.setInterval(() => {
510
- ze && We || K(1);
511
- }, o);
512
- return () => window.clearInterval(t);
513
- }, [P, i, K, De, We, ze]);
514
- const j = M((o) => {
515
- const t = F.current;
516
- if (!t || t.pointerId !== o.pointerId) return;
517
- F.current = null, L.current = null;
518
- const c = ae.current;
519
- if (c != null && c.hasPointerCapture(o.pointerId) && c.releasePointerCapture(o.pointerId), !t.isActive) {
520
- h && R(0);
521
- return;
522
- }
523
- const d = !(o.timeStamp - t.lastTime > Mo) && Math.abs(t.velocity) > go, f = t.size > 0 && Math.abs(t.offset - t.baseOffset) > t.size * Ao;
524
- if ($e(!1), !d && !f) {
525
- R(0);
526
- return;
527
- }
528
- const g = f ? t.offset - t.baseOffset : t.velocity;
529
- let b = 1;
530
- f && t.size > 0 && (b = Math.max(1, Math.round(Math.abs(g) / t.size))), R(0), de(g < 0 ? b : -b);
531
- }, [de, h]);
532
- z(() => {
533
- const o = (t) => {
534
- L.current === null || t.pointerId !== L.current || j(t);
535
- };
536
- return window.addEventListener("pointerup", o), window.addEventListener("pointercancel", o), () => {
537
- window.removeEventListener("pointerup", o), window.removeEventListener("pointercancel", o);
538
- };
539
- }, [j]);
540
- const ho = (o) => {
541
- const t = ae.current;
542
- if (!me || i < 2 || !t || o.pointerType === "mouse" && o.button !== 0) return;
543
- xe.current && D(!1);
544
- let c = 0;
545
- const p = ie.current;
546
- if (h && p) {
547
- const d = Ze(p, l);
548
- if (d > 0) {
549
- const f = be(), g = A ? f - Se(f, i) : f, b = Math.round(g);
550
- c = (b - g) * d, U.current = b, B(!0), ne(b), R(c);
551
- }
552
- }
553
- t.setPointerCapture(o.pointerId), L.current = o.pointerId, F.current = {
554
- pointerId: o.pointerId,
555
- startClientX: o.clientX,
556
- startClientY: o.clientY,
557
- axes: _o(t, `${r}-axis-probe`),
558
- size: l ? t.offsetWidth : t.offsetHeight,
559
- isActive: !1,
560
- baseOffset: c,
561
- offset: c,
562
- lastTime: o.timeStamp,
563
- velocity: 0
564
- };
565
- }, vo = (o) => {
566
- const t = F.current;
567
- if (!t || t.pointerId !== o.pointerId) return;
568
- if (o.pointerType === "mouse" && o.buttons === 0) {
569
- j(o);
570
- return;
571
- }
572
- const c = o.clientX - t.startClientX, p = o.clientY - t.startClientY, d = t.axes ? Oo(t.axes, c, p) : { x: c, y: p }, f = l ? d.x : d.y, g = l ? d.y : d.x, b = t.baseOffset + f;
573
- if (!t.isActive) {
574
- if (Math.max(Math.abs(f), Math.abs(g)) < Co) return;
575
- if (Math.abs(g) > Math.abs(f)) {
576
- const ue = ae.current;
577
- ue != null && ue.hasPointerCapture(t.pointerId) && ue.releasePointerCapture(t.pointerId), F.current = null, L.current = null, h && R(0);
578
- return;
579
- }
580
- t.isActive = !0, $e(!0);
581
- }
582
- const Ve = o.timeStamp - t.lastTime;
583
- Ve > 0 && (t.velocity = (b - t.offset) / Ve, t.lastTime = o.timeStamp), t.offset = b, h && R(b);
584
- }, Ue = (o) => {
585
- j(o);
586
- }, $o = Te(Y, fo, l), yo = A ? Array.from({ length: Do }, () => I).flat() : I;
587
- return /* @__PURE__ */ k(Ee, { children: [
588
- /* @__PURE__ */ s("style", { dangerouslySetInnerHTML: { __html: Fo(r, S, n) } }),
589
- /* @__PURE__ */ k(
590
- "div",
591
- {
592
- className: w(`${r}-wrapper`, {
593
- [`${r}-transition-fade`]: fe === "fade in",
594
- [`${r}-transition-reveal`]: oe,
595
- [`${r}-transition-reveal-vertical`]: oe && !l
596
- }),
597
- "data-active-index": v,
598
- onMouseEnter: () => Ge(!0),
599
- onMouseLeave: () => Ge(!1),
600
- children: [
601
- /* @__PURE__ */ k(
602
- "div",
603
- {
604
- className: `${r}-slider-inner`,
605
- style: {
606
- backgroundColor: "transparent"
607
- },
608
- children: [
609
- /* @__PURE__ */ k(
610
- "div",
611
- {
612
- ref: ae,
613
- className: w(`${r}-track`, {
614
- [`${r}-track-draggable`]: me,
615
- [`${r}-track-draggable-vertical`]: me && !l
616
- }),
617
- style: ao,
618
- onPointerDown: ho,
619
- onPointerMove: vo,
620
- onPointerUp: Ue,
621
- onPointerCancel: Ue,
622
- onLostPointerCapture: (o) => {
623
- L.current === o.pointerId && j(o);
624
- },
625
- children: [
626
- /* @__PURE__ */ k(
627
- "div",
628
- {
629
- ref: ie,
630
- className: w(`${r}-list`, {
631
- [`${r}-list-slide`]: h,
632
- [`${r}-list-slide-vertical`]: h && !l,
633
- [`${r}-list-fade`]: !h
634
- }),
635
- style: h ? {
636
- transform: $o,
637
- transition: uo || ve ? "none" : `transform ${S}ms ${ke}`
638
- } : void 0,
639
- children: [
640
- yo.map((o, t) => {
641
- const c = Z(t, i), p = `slide-${Math.floor(t / i)}-${c}`;
642
- return /* @__PURE__ */ s("div", { className: `${r}-slide`, children: Xe(o) }, p);
643
- }),
644
- _e && N.map((o, t) => /* @__PURE__ */ s(
645
- "div",
646
- {
647
- className: w(`${r}-slide`, `${r}-is-layer`, { [`${r}-is-animated`]: o.isAnimated }),
648
- style: { zIndex: t + 1 },
649
- onAnimationEnd: () => so(o.key),
650
- children: Xe(I[o.index])
651
- },
652
- `layer-${o.key}`
653
- ))
654
- ]
655
- }
656
- ),
657
- io && /* @__PURE__ */ s(
658
- "div",
659
- {
660
- className: `${r}-click-overlay`,
661
- onClick: () => K(1)
662
- }
663
- )
664
- ]
665
- }
666
- ),
667
- lo && /* @__PURE__ */ k(Ee, { children: [
668
- /* @__PURE__ */ s(
669
- "div",
670
- {
671
- className: w(`${r}-arrow`, {
672
- [`${r}-arrow-prev`]: l,
673
- [`${r}-arrow-prev-vertical`]: !l,
674
- [`${r}-hover-arrow`]: Oe
675
- }),
676
- style: {
677
- color: O,
678
- "--arrow-hover-color": ee,
679
- ...te
680
- },
681
- children: /* @__PURE__ */ k(
682
- "button",
683
- {
684
- onClick: (o) => {
685
- o.stopPropagation(), K(-1);
686
- },
687
- className: `${r}-arrow-inner`,
688
- style: {
689
- transform: `translate(${y(Me, n)}, ${y(Ne * (l ? 1 : -1), n)}) rotate(${l ? "0deg" : "90deg"})`
690
- },
691
- children: [
692
- _ && /* @__PURE__ */ s(
693
- Ke,
694
- {
695
- url: _,
696
- fill: O,
697
- hoverFill: ee,
698
- className: w(`${r}-arrow-img`, `${r}-mirror`),
699
- style: te
700
- }
701
- ),
702
- !_ && /* @__PURE__ */ s(
703
- Je,
704
- {
705
- color: O,
706
- className: w(`${r}-arrow-icon`, `${r}-arrow-img`, `${r}-mirror`)
707
- }
708
- )
709
- ]
710
- }
711
- )
712
- }
713
- ),
714
- /* @__PURE__ */ s(
715
- "div",
716
- {
717
- className: w(`${r}-arrow`, {
718
- [`${r}-arrow-next`]: l,
719
- [`${r}-arrow-next-vertical`]: !l,
720
- [`${r}-hover-arrow`]: Oe
721
- }),
722
- style: {
723
- color: O,
724
- "--arrow-hover-color": ee,
725
- ...te
726
- },
727
- children: /* @__PURE__ */ k(
728
- "button",
729
- {
730
- className: `${r}-arrow-inner`,
731
- onClick: (o) => {
732
- o.stopPropagation(), K(1);
733
- },
734
- style: {
735
- transform: `translate(${y(Me * (l ? -1 : 1), n)}, ${y(Ne, n)}) rotate(${l ? "0deg" : "90deg"})`
736
- },
737
- children: [
738
- _ && /* @__PURE__ */ s(
739
- Ke,
740
- {
741
- url: _,
742
- fill: O,
743
- hoverFill: ee,
744
- className: `${r}-arrow-img`,
745
- style: te
746
- }
747
- ),
748
- !_ && /* @__PURE__ */ s(Je, { color: O, className: w(`${r}-arrow-icon`, `${r}-arrow-img`) })
749
- ]
750
- }
751
- )
752
- }
753
- )
754
- ] }),
755
- co && /* @__PURE__ */ s(
756
- "div",
757
- {
758
- className: w(`${r}-pagination`, {
759
- [`${r}-pagination-inside-bottom`]: l,
760
- [`${r}-pagination-inside-left`]: !l
761
- }),
762
- style: l ? { bottom: m(u.inset) } : { left: m(u.inset) },
763
- children: /* @__PURE__ */ s(
764
- "div",
765
- {
766
- className: w(`${r}-pagination-inner`, {
767
- [`${r}-pagination-vertical`]: !l,
768
- [`${r}-animate-dots`]: ye
769
- }),
770
- style: {
771
- backgroundColor: ro,
772
- gap: m(u.gapInactive - u.activeDot + u.dot),
773
- ...l ? {
774
- height: m(u.activeDot + u.paddingY * 2),
775
- paddingTop: m(u.paddingY),
776
- paddingBottom: m(u.paddingY),
777
- paddingLeft: m(u.paddingActive),
778
- paddingRight: m(u.paddingActive)
779
- } : {
780
- width: m(u.activeDot + u.paddingY * 2),
781
- paddingLeft: m(u.paddingY),
782
- paddingRight: m(u.paddingY),
783
- paddingTop: m(u.paddingActive),
784
- paddingBottom: m(u.paddingActive)
785
- },
786
- borderRadius: m(u.borderRadius),
787
- transform: `translate(${y(q.offset.x, n)}, ${y(q.offset.y, n)})`
788
- },
789
- children: I.map((o, t) => {
790
- const c = t === v, p = c ? u.activeDot : u.dot;
791
- return /* @__PURE__ */ s(
792
- "button",
793
- {
794
- onClick: () => mo(t),
795
- className: `${r}-pagination-item`,
796
- style: {
797
- width: m(u.activeDot)
798
- },
799
- children: /* @__PURE__ */ s(
800
- "div",
801
- {
802
- className: `${r}-dot`,
803
- style: {
804
- backgroundColor: c ? to : oo,
805
- width: m(p)
806
- }
807
- }
808
- )
809
- },
810
- t
811
- );
812
- })
813
- },
814
- `${Ce}-${G}`
815
- )
816
- }
817
- )
818
- ]
819
- }
820
- ),
821
- /* @__PURE__ */ k("div", { className: `${r}-caption-block`, children: [
822
- /* @__PURE__ */ s(
823
- "div",
824
- {
825
- "data-controls": $ ? "captionMarginTop" : void 0,
826
- className: $ ? `${r}-control` : void 0,
827
- style: {
828
- height: y(no, n)
829
- }
830
- }
831
- ),
832
- /* @__PURE__ */ s("div", { className: `${r}-caption-text-wrapper`, children: I.map((o, t) => /* @__PURE__ */ s(
833
- "div",
834
- {
835
- className: w(`${r}-caption-text`, {
836
- [`${r}-with-pointer-events`]: t === v && n,
837
- [`${r}-active`]: t === v
838
- }),
839
- style: {
840
- ...J,
841
- width: "max-content",
842
- transitionDuration: `${Math.round(S / 2)}ms`
843
- },
844
- children: /* @__PURE__ */ s(
845
- "div",
846
- {
847
- className: `${r}-caption-text-inner`,
848
- style: {
849
- "--link-color": Re,
850
- "--link-hover-color": Re,
851
- position: "relative",
852
- top: y(Ie.offset.y, n),
853
- left: y(Ie.offset.x, n)
854
- },
855
- children: /* @__PURE__ */ s(wo, { content: o.imageCaption })
856
- }
857
- )
858
- },
859
- t
860
- )) })
861
- ] })
862
- ]
863
- }
864
- )
865
- ] });
866
- }
867
- function Je({ color: e, className: a }) {
868
- return /* @__PURE__ */ s("svg", { viewBox: "0 0 10 18", className: a, children: /* @__PURE__ */ s("g", { id: "Symbols", stroke: "none", strokeWidth: "1", fillRule: "evenodd", children: /* @__PURE__ */ s("path", { d: "M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z", id: "Shape-Copy", fill: e, transform: "translate(5, 9) rotate(-90) translate(-5, -9)" }) }) });
869
- }
870
- export {
871
- Ko as Slider20
872
- };