@cntrl-site/components 1.0.106-alpha.0 → 1.0.107-alpha.0

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 (88) hide show
  1. package/dist/ClickGallerie-CYQMgrIr.js +36 -0
  2. package/dist/ClickGallerie-o2U6oyOF.mjs +272 -0
  3. package/dist/Components/ClickGallerie/ClickGallerie.d.ts +2 -1
  4. package/dist/Components/Helix/Helix.d.ts +4 -1
  5. package/dist/Components/Hive/Hive.d.ts +4 -1
  6. package/dist/Components/ImageRevealSlider/ImageRevealSlider.d.ts +2 -1
  7. package/dist/Components/List/List.d.ts +6 -2
  8. package/dist/Components/Marquee/Marquee.d.ts +6 -2
  9. package/dist/Components/MarqueeText/MarqueeText.d.ts +2 -1
  10. package/dist/Components/Mercury/Mercury.d.ts +4 -1
  11. package/dist/Components/Waterfall/WaterfallLightbox.d.ts +4 -1
  12. package/dist/Components/utils/EmbedMediaFrame.d.ts +27 -0
  13. package/dist/Components/utils/LinkWrapper.d.ts +16 -0
  14. package/dist/Components/utils/embedMedia.d.ts +40 -0
  15. package/dist/Components/utils/index.d.ts +6 -0
  16. package/dist/{ControlSlider-SiOt22l_.js → ControlSlider-Kkec-i14.js} +1 -1
  17. package/dist/{ControlSlider-pZv7H6BU.mjs → ControlSlider-LcZmviGX.mjs} +1 -1
  18. package/dist/EmbedMediaFrame-DsOTKE4i.js +1 -0
  19. package/dist/EmbedMediaFrame-DwHeOAy5.mjs +164 -0
  20. package/dist/{FAQ-C7823fyi.js → FAQ-BxhMo7T8.js} +1 -1
  21. package/dist/{FAQ-CZ39u4m8.mjs → FAQ-CdwSft5p.mjs} +1 -1
  22. package/dist/Grid-CFHTP3mb.js +378 -0
  23. package/dist/Grid-e-gLfsji.mjs +1590 -0
  24. package/dist/Helix-BpLo9FD3.js +43 -0
  25. package/dist/Helix-CidI3ucE.mjs +324 -0
  26. package/dist/{Hive-D6-R6TwM.mjs → Hive-BsmFHk2i.mjs} +505 -475
  27. package/dist/Hive-D1j6wZpV.js +321 -0
  28. package/dist/ImageRevealSlider-BuukTGAK.js +1 -0
  29. package/dist/{ImageRevealSlider-BdFGyVEP.mjs → ImageRevealSlider-Df9sygk9.mjs} +63 -70
  30. package/dist/{Lightbox-eP9qAZzL.mjs → Lightbox-C_fXsfdz.mjs} +1 -1
  31. package/dist/{Lightbox-CIss_nOG.js → Lightbox-DaunVrkp.js} +1 -1
  32. package/dist/LinkWrapper-Ca84iPtg.js +1 -0
  33. package/dist/LinkWrapper-DZs9hlOn.mjs +13 -0
  34. package/dist/{List-DW7fyJbf.mjs → List-Bh_-l9vD.mjs} +532 -520
  35. package/dist/List-DVvpQ24J.js +377 -0
  36. package/dist/Marquee-DByooiWP.mjs +578 -0
  37. package/dist/Marquee-DfIP-tIN.js +133 -0
  38. package/dist/{MarqueeText-Rzt2fJYt.mjs → MarqueeText-D6FNCe6P.mjs} +115 -114
  39. package/dist/MarqueeText-DsUiV6Zv.js +132 -0
  40. package/dist/Mercury-B-s2Kvuq.js +267 -0
  41. package/dist/Mercury-CCW0Es-s.mjs +1700 -0
  42. package/dist/PretextComponent-Dnbenstn.js +1 -0
  43. package/dist/{PretextComponent-j-OsRZTx.mjs → PretextComponent-OygSO3fr.mjs} +312 -269
  44. package/dist/{RichTextRenderer-B6WtTYlR.mjs → RichTextRenderer-BptwNpbJ.mjs} +10 -9
  45. package/dist/RichTextRenderer-K90Dd7pt.js +1 -0
  46. package/dist/{Slider20-Dm8BeCli.mjs → Slider20-CCzixTiN.mjs} +1 -1
  47. package/dist/{Slider20-C9o2REDl.js → Slider20-fMVeRfgx.js} +1 -1
  48. package/dist/{TestimonialGrid-CPu4qQ6B.mjs → TestimonialGrid-CbsVxSn9.mjs} +1 -1
  49. package/dist/{TestimonialGrid-D4ieiz9e.js → TestimonialGrid-CiCagfBU.js} +1 -1
  50. package/dist/{TestimonialSingle-DLdnAVF7.mjs → TestimonialSingle-BVm3Amrl.mjs} +1 -1
  51. package/dist/{TestimonialSingle-CVu15ZtV.js → TestimonialSingle-BWXynGjv.js} +1 -1
  52. package/dist/Waterfall-3kKioKh2.mjs +1432 -0
  53. package/dist/Waterfall-DII4-WV5.js +288 -0
  54. package/dist/{components-D2LyuDm-.mjs → components-BRmbflgg.mjs} +15 -15
  55. package/dist/components-nvbH4l0S.js +1 -0
  56. package/dist/content/postFieldBindings.d.ts +29 -0
  57. package/dist/elements.js +1 -1
  58. package/dist/elements.mjs +16 -16
  59. package/dist/elements.node.js +1 -1
  60. package/dist/elements.node.mjs +1 -1
  61. package/dist/index.d.ts +3 -1
  62. package/dist/index.js +1 -1
  63. package/dist/index.mjs +52 -15
  64. package/dist/sources.js +312 -212
  65. package/dist/sources.mjs +312 -212
  66. package/dist/types/SchemaV1.d.ts +53 -1
  67. package/dist/utils.js +1 -1
  68. package/dist/utils.mjs +30 -20
  69. package/package.json +1 -1
  70. package/dist/ClickGallerie-D7g093HX.js +0 -36
  71. package/dist/ClickGallerie-QSOQjSdv.mjs +0 -271
  72. package/dist/Grid-BBpdl60K.js +0 -374
  73. package/dist/Grid-DS53S_gA.mjs +0 -1576
  74. package/dist/Helix-BPn9V1sg.mjs +0 -315
  75. package/dist/Helix-DcgsCc4D.js +0 -43
  76. package/dist/Hive-n8Fz-j3o.js +0 -321
  77. package/dist/ImageRevealSlider-BBWtFjUF.js +0 -1
  78. package/dist/List-C32WImI3.js +0 -377
  79. package/dist/Marquee-DOIRRCu4.js +0 -133
  80. package/dist/Marquee-O_PDwlIb.mjs +0 -564
  81. package/dist/MarqueeText-DkaO2lQ5.js +0 -132
  82. package/dist/Mercury-C9D10TTT.mjs +0 -1702
  83. package/dist/Mercury-DynO-NxY.js +0 -267
  84. package/dist/PretextComponent-BnsS2zJ6.js +0 -1
  85. package/dist/RichTextRenderer-CIy6yI8U.js +0 -1
  86. package/dist/Waterfall-DC2WQ3GT.js +0 -287
  87. package/dist/Waterfall-Yud2VR62.mjs +0 -1404
  88. package/dist/components-B9Vdjf0w.js +0 -1
@@ -1,1702 +0,0 @@
1
- import { jsxs as C, Fragment as xt, jsx as r } from "react/jsx-runtime";
2
- import { useMemo as Ce, useRef as M, useState as B, useCallback as yt, useEffect as Z, useLayoutEffect as ce } from "react";
3
- import { createPortal as Ze } from "react-dom";
4
- import { s as dt } from "./scalingValue-C9JH5L6O.mjs";
5
- import { b as qe } from "./buildColorVars-CLyWQm5K.mjs";
6
- import { u as Je } from "./useScopedStyles-DhBG3557.mjs";
7
- import { o as ne, t as oe } from "./textStylesToCss-05Mn6I_2.mjs";
8
- import { S as Qe } from "./SvgImage-B5mR9y6q.mjs";
9
- import { L as Pe } from "./LazyVideo-CdAWymKO.mjs";
10
- const It = 300 / 1440, tn = 8 / 1440, st = 4e-3;
11
- function en(t) {
12
- return `calc(var(--cntrl-article-width, 100vw) * ${t / 1440})`;
13
- }
14
- function ie(t, e, n, i) {
15
- return e !== void 0 && e < (t ?? 0.01) ? `${n} ${i}` : n;
16
- }
17
- function re(t, e, n, i, l = "title-leading-gap") {
18
- const d = t ?? 0.01;
19
- return e === void 0 || e >= d ? {} : {
20
- [`--${n}-${l}`]: dt((d - e) / 2, i)
21
- };
22
- }
23
- function nn(t) {
24
- return `
25
- .${t}-wrapper {
26
- box-sizing: border-box;
27
- display: flex;
28
- flex-direction: column;
29
- position: relative;
30
- width: 100%;
31
- min-height: ${en(48)};
32
- }
33
- .${t}-single-title-layer {
34
- position: absolute;
35
- inset: 0;
36
- z-index: 2;
37
- pointer-events: none;
38
- display: flex;
39
- flex-direction: column;
40
- justify-content: flex-start;
41
- }
42
- .${t}-single-title {
43
- pointer-events: none;
44
- }
45
- .${t}-item {
46
- position: relative;
47
- display: flex;
48
- align-items: center;
49
- width: 100%;
50
- }
51
- .${t}-item-a {
52
- flex-direction: row;
53
- }
54
- .${t}-item-b {
55
- flex-direction: column;
56
- }
57
- .${t}-item-c {
58
- flex-direction: row-reverse;
59
- }
60
- .${t}-title {
61
- align-self: flex-start;
62
- display: flex;
63
- flex-shrink: 0;
64
- min-width: 0;
65
- box-sizing: border-box;
66
- position: sticky;
67
- z-index: 2;
68
- overflow: visible;
69
- color: var(--${t}-title-color);
70
- }
71
- .${t}-title-text,
72
- .${t}-description-text {
73
- display: block;
74
- width: 100%;
75
- white-space: pre-wrap;
76
- overflow-wrap: anywhere;
77
- word-break: break-word;
78
- }
79
- .${t}-description-text {
80
- color: var(--${t}-description-color);
81
- }
82
- .${t}-title-texts {
83
- display: flex;
84
- flex-direction: column;
85
- width: 100%;
86
- min-width: 0;
87
- }
88
- .${t}-title-texts-gap {
89
- position: relative;
90
- width: 100%;
91
- flex-shrink: 0;
92
- }
93
- .${t}-title-text-inner {
94
- display: flex;
95
- flex-direction: column;
96
- flex-shrink: 0;
97
- box-sizing: border-box;
98
- outline: 1px solid #FF5C02;
99
- }
100
- .${t}-title-text-inner-hidden {
101
- display: flex;
102
- flex-direction: column;
103
- flex-shrink: 0;
104
- box-sizing: border-box;
105
- }
106
- .${t}-title-text-stack {
107
- display: flex;
108
- flex-direction: column;
109
- flex-shrink: 0;
110
- min-width: 0;
111
- position: relative;
112
- box-sizing: border-box;
113
- }
114
- .${t}-item-a .${t}-title-v-top .${t}-title-text-stack,
115
- .${t}-item-b .${t}-title-v-top .${t}-title-text-stack,
116
- .${t}-item-c .${t}-title-v-top .${t}-title-text-stack,
117
- .${t}-single-title-layer .${t}-title-v-top .${t}-title-text-stack {
118
- padding-top: var(--${t}-title-top-padding, 0);
119
- }
120
- .${t}-item-a .${t}-title-v-bottom .${t}-title-text-stack,
121
- .${t}-item-b .${t}-title-v-bottom .${t}-title-text-stack,
122
- .${t}-item-c .${t}-title-v-bottom .${t}-title-text-stack,
123
- .${t}-single-title-layer .${t}-title-v-bottom .${t}-title-text-stack {
124
- padding-bottom: var(--${t}-title-bottom-padding, 0);
125
- }
126
- .${t}-title-v-center {
127
- top: calc(var(--cntrl-article-top, 0px) + var(--cntrl-viewport-height, 100vh) / 2 - (var(--${t}-title-height, 0px) / 2));
128
- align-items: center;
129
- }
130
- .${t}-title-v-top {
131
- top: var(--cntrl-article-top, 0px);
132
- bottom: auto;
133
- align-self: flex-start;
134
- }
135
- .${t}-title-v-bottom {
136
- top: calc(var(--cntrl-article-top, 0px) + var(--cntrl-viewport-height, 100vh) - var(--${t}-title-height, 0px));
137
- align-items: center;
138
- }
139
- .${t}-title-h-left {
140
- justify-content: flex-start;
141
- }
142
- .${t}-item-a .${t}-title-h-left,
143
- .${t}-item-b .${t}-title-h-left,
144
- .${t}-item-c .${t}-title-h-left,
145
- .${t}-single-title-layer .${t}-title-h-left {
146
- padding-left: var(--${t}-title-left-padding, 0);
147
- }
148
- .${t}-title-h-center {
149
- justify-content: center;
150
- }
151
- .${t}-title-h-right {
152
- justify-content: flex-end;
153
- }
154
- .${t}-item-a .${t}-title-h-right,
155
- .${t}-item-b .${t}-title-h-right,
156
- .${t}-item-c .${t}-title-h-right,
157
- .${t}-single-title-layer .${t}-title-h-right {
158
- padding-right: var(--${t}-title-right-padding, 0);
159
- }
160
- .${t}-item-a .${t}-title,
161
- .${t}-item-c .${t}-title {
162
- flex: 1;
163
- width: auto;
164
- min-width: 0;
165
- overflow: visible;
166
- }
167
- .${t}-item-b .${t}-title,
168
- .${t}-single-title-layer .${t}-title {
169
- width: 100%;
170
- pointer-events: none;
171
- }
172
- .${t}-gallery {
173
- display: flex;
174
- flex-direction: column;
175
- align-items: center;
176
- flex-shrink: 0;
177
- box-sizing: border-box;
178
- }
179
- .${t}-item-b .${t}-gallery {
180
- display: grid;
181
- width: 100%;
182
- }
183
- .${t}-item-b .${t}-gallery-media {
184
- grid-area: 1 / 1;
185
- display: flex;
186
- flex-direction: column;
187
- align-items: center;
188
- width: 100%;
189
- min-width: 0;
190
- }
191
- .${t}-item-b .${t}-title-layer {
192
- grid-area: 1 / 1;
193
- align-self: stretch;
194
- width: 100%;
195
- min-width: 0;
196
- z-index: 2;
197
- overflow: visible;
198
- pointer-events: none;
199
- display: flex;
200
- flex-direction: column;
201
- justify-content: flex-start;
202
- }
203
- .${t}-gallery-item {
204
- position: relative;
205
- display: flex;
206
- flex-direction: column;
207
- align-items: center;
208
- width: 100%;
209
- }
210
- .${t}-gallery-image,
211
- .${t}-gallery-video {
212
- display: block;
213
- max-width: 100%;
214
- height: auto;
215
- }
216
- .${t}-gallery-controls {
217
- position: relative;
218
- display: flex;
219
- flex-shrink: 0;
220
- box-sizing: border-box;
221
- z-index: 1;
222
- }
223
- .${t}-gallery-edge-spacer {
224
- flex-shrink: 0;
225
- }
226
- .${t}-control-anchor {
227
- position: absolute;
228
- pointer-events: none;
229
- z-index: 2;
230
- }
231
- .${t}-padding-handle {
232
- width: 100%;
233
- flex-shrink: 0;
234
- background: transparent;
235
- }
236
- .${t}-text-tight-leading {
237
- flex-shrink: 0;
238
- padding-top: var(--${t}-title-leading-gap, 0);
239
- padding-bottom: var(--${t}-title-leading-gap, 0);
240
- }
241
- .${t}-description-tight-leading {
242
- flex-shrink: 0;
243
- padding-top: var(--${t}-description-leading-gap, 0);
244
- padding-bottom: var(--${t}-description-leading-gap, 0);
245
- }
246
- .${t}-lightbox-counter {
247
- margin: 0;
248
- color: var(--${t}-lightbox-counter-color);
249
- }
250
- .${t}-lightbox {
251
- position: fixed;
252
- inset: 0;
253
- z-index: 9997;
254
- overscroll-behavior: none;
255
- overflow: hidden;
256
- }
257
- .${t}-lightbox-editor {
258
- inset: auto;
259
- top: var(--cntrl-article-top, 0);
260
- left: var(--cntrl-article-left, 0);
261
- width: var(--cntrl-article-width, 100vw) !important;
262
- height: var(--cntrl-viewport-height, 100vh) !important;
263
- }
264
- .${t}-close-icon {
265
- position: relative;
266
- flex-shrink: 0;
267
- pointer-events: auto;
268
- z-index: 2;
269
- display: flex;
270
- align-items: center;
271
- justify-content: center;
272
- border: none;
273
- background-color: transparent;
274
- padding: 0;
275
- }
276
- .${t}-close-icon-inner {
277
- all: unset;
278
- position: relative;
279
- cursor: pointer;
280
- width: 100%;
281
- height: 100%;
282
- pointer-events: auto;
283
- }
284
- .${t}-close-icon-img {
285
- position: absolute;
286
- top: 50%;
287
- left: 50%;
288
- transform: translate(-50%, -50%);
289
- }
290
- `;
291
- }
292
- const ze = {
293
- "left-top": { horizontal: "left", vertical: "top" },
294
- "top-center": { horizontal: "center", vertical: "top" },
295
- "top-right": { horizontal: "right", vertical: "top" },
296
- "left-center": { horizontal: "left", vertical: "center" },
297
- center: { horizontal: "center", vertical: "center" },
298
- "right-center": { horizontal: "right", vertical: "center" },
299
- "left-bottom": { horizontal: "left", vertical: "bottom" },
300
- "bottom-center": { horizontal: "center", vertical: "bottom" },
301
- "right-bottom": { horizontal: "right", vertical: "bottom" }
302
- };
303
- function on(t) {
304
- return t in ze;
305
- }
306
- function rn(t) {
307
- if (t && on(t))
308
- return t;
309
- switch (t) {
310
- case "center-top":
311
- return "top-center";
312
- case "right-top":
313
- return "top-right";
314
- case "top-left":
315
- return "left-top";
316
- case "center-bottom":
317
- return "bottom-center";
318
- case "bottom-left":
319
- return "left-bottom";
320
- case "bottom-right":
321
- return "right-bottom";
322
- case "center-center":
323
- return "center";
324
- case "left":
325
- return "left-center";
326
- case "right":
327
- return "right-center";
328
- case "top":
329
- return "left-top";
330
- default:
331
- return "center";
332
- }
333
- }
334
- function se(t) {
335
- return ze[t];
336
- }
337
- const ln = "rgba(28,31,34,0.9)", ct = 500, vt = "cubic-bezier(0.22, 1, 0.36, 1)", an = 72, cn = 50, sn = {
338
- titleColor: "title-color",
339
- descriptionColor: "description-color",
340
- lightboxCounterColor: "lightbox-counter-color"
341
- }, dn = [];
342
- function hn(t) {
343
- if (!Array.isArray(t) || t.length === 0) return !1;
344
- const e = t[0];
345
- return e !== null && typeof e == "object" && "media" in e && Array.isArray(e.media);
346
- }
347
- function pn(t) {
348
- const [e, n] = t.media;
349
- return n != null && n.assetId ? n : e != null && e.assetId ? e : null;
350
- }
351
- function un(t) {
352
- const [e] = t.media;
353
- return e != null && e.assetId ? e : null;
354
- }
355
- function fn(t) {
356
- if (!Array.isArray(t) || t.length === 0) return [];
357
- if (hn(t)) {
358
- const e = [];
359
- for (const n of t) {
360
- const i = pn(n);
361
- if (!i) continue;
362
- const l = un(n);
363
- e.push({
364
- displayMedia: i,
365
- lightboxMedia: l != null && l.assetId ? l : null
366
- });
367
- }
368
- return e;
369
- }
370
- return t.filter((e) => e == null ? void 0 : e.assetId).map((e) => ({
371
- displayMedia: e,
372
- lightboxMedia: e
373
- }));
374
- }
375
- function ae(t) {
376
- return t.type === "video";
377
- }
378
- function gn(t) {
379
- t.pause(), t.removeAttribute("src"), t.load();
380
- }
381
- function jt(t) {
382
- const e = t.getBoundingClientRect();
383
- return { width: e.width, height: e.height, left: e.left, top: e.top };
384
- }
385
- function mn(t) {
386
- return t instanceof HTMLVideoElement ? { width: t.videoWidth, height: t.videoHeight } : { width: t.naturalWidth, height: t.naturalHeight };
387
- }
388
- const vn = 1140 / 1440;
389
- function yn(t) {
390
- return typeof t == "string" ? {
391
- display: t.toLowerCase() === "cover" ? "cover" : "fit",
392
- ratioValue: "2:3",
393
- reversed: !1
394
- } : {
395
- display: (typeof (t == null ? void 0 : t.display) == "string" ? t.display.toLowerCase() : "") === "cover" ? "cover" : "fit",
396
- ratioValue: (t == null ? void 0 : t.ratioValue) ?? "2:3",
397
- reversed: (t == null ? void 0 : t.reversed) ?? !1
398
- };
399
- }
400
- function xn(t) {
401
- const e = t.ratioValue ?? "1:1", n = t.reversed ?? !1, [i, l] = e.split(":").map(Number);
402
- return `${n ? l : i} / ${n ? i : l}`;
403
- }
404
- function $n(t) {
405
- return typeof t == "string" ? t === "cover" ? "cover" : "fit" : (t == null ? void 0 : t.display) === "cover" ? "cover" : "fit";
406
- }
407
- function wn({
408
- src: t,
409
- phase: e,
410
- mediaRef: n,
411
- mediaStyle: i,
412
- onLoadedMetadata: l,
413
- onClick: d,
414
- onMouseMove: o,
415
- onTransitionEnd: p
416
- }) {
417
- return Z(() => {
418
- const a = n.current;
419
- if (a)
420
- return () => {
421
- gn(a);
422
- };
423
- }, [t, n]), /* @__PURE__ */ r(
424
- "video",
425
- {
426
- ref: n,
427
- src: t,
428
- controls: e === "open",
429
- playsInline: !0,
430
- preload: "auto",
431
- onLoadedMetadata: l,
432
- onClick: d,
433
- onMouseMove: o,
434
- onTransitionEnd: p,
435
- style: i
436
- }
437
- );
438
- }
439
- const bn = "https://cdn.cntrl.site/component-assets/defaultCloseIcon.svg", Sn = 4e-3;
440
- function Cn({
441
- prefix: t,
442
- closeIcon: e = bn,
443
- closeIconMaxWidth: n = 0.0125,
444
- closeIconColor: i = "#FFFFFF",
445
- closeIconHoverColor: l = "#999999",
446
- iconMarginRight: d = 0.01,
447
- contentMarginTop: o = 0.01,
448
- isEditor: p,
449
- isPreviewMode: a,
450
- isEditMode: h,
451
- visible: s,
452
- onClose: y
453
- }) {
454
- if (!e) return null;
455
- const I = dt(n, p), K = dt(d, p), R = dt(o, p), D = dt(Math.max(o, Sn), p);
456
- return /* @__PURE__ */ C(
457
- "div",
458
- {
459
- style: {
460
- position: "absolute",
461
- top: 0,
462
- left: 0,
463
- right: 0,
464
- zIndex: 1e4,
465
- display: "flex",
466
- flexDirection: "column",
467
- alignItems: "flex-end",
468
- pointerEvents: "none",
469
- opacity: s ? 1 : 0,
470
- transition: "opacity 500ms cubic-bezier(0.22, 1, 0.36, 1)"
471
- },
472
- children: [
473
- /* @__PURE__ */ r(
474
- "div",
475
- {
476
- style: {
477
- position: "relative",
478
- width: "100%",
479
- height: R,
480
- flexShrink: 0
481
- },
482
- children: h && /* @__PURE__ */ r(
483
- "div",
484
- {
485
- "data-controls": "contentMarginTop",
486
- "data-controls-axis": "y",
487
- "data-controls-min": "0",
488
- className: `${t}-control`,
489
- style: {
490
- position: "absolute",
491
- top: 0,
492
- left: 0,
493
- width: "100%",
494
- height: D,
495
- pointerEvents: s ? "auto" : "none"
496
- }
497
- }
498
- )
499
- }
500
- ),
501
- /* @__PURE__ */ C(
502
- "div",
503
- {
504
- className: `${t}-close-icon`,
505
- style: {
506
- width: I,
507
- height: I,
508
- marginRight: K,
509
- pointerEvents: s ? "auto" : "none"
510
- },
511
- onClick: (A) => A.stopPropagation(),
512
- children: [
513
- /* @__PURE__ */ r(
514
- "button",
515
- {
516
- type: "button",
517
- className: `${t}-close-icon-inner`,
518
- "aria-label": "Close",
519
- onClick: (A) => {
520
- A.stopPropagation(), y();
521
- },
522
- children: /* @__PURE__ */ r(
523
- Qe,
524
- {
525
- url: e,
526
- fill: i,
527
- hoverFill: p && !a ? i : l,
528
- className: `${t}-close-icon-img`
529
- }
530
- )
531
- }
532
- ),
533
- h && /* @__PURE__ */ r(
534
- "div",
535
- {
536
- "data-controls": "iconMarginRight",
537
- "data-controls-axis": "x",
538
- "data-controls-reverse": "",
539
- className: `${t}-control`,
540
- style: {
541
- position: "absolute",
542
- top: 0,
543
- left: "100%",
544
- width: K,
545
- height: "100%",
546
- pointerEvents: s ? "auto" : "none"
547
- }
548
- }
549
- )
550
- ]
551
- }
552
- )
553
- ]
554
- }
555
- );
556
- }
557
- function Tn({
558
- prefix: t,
559
- items: e,
560
- index: n,
561
- imageDisplay: i,
562
- isEditor: l,
563
- isPreviewMode: d,
564
- isEditMode: o,
565
- onClose: p,
566
- onPrev: a,
567
- onNext: h,
568
- counterClassName: s,
569
- counterStyle: y,
570
- backgroundColor: I,
571
- closeIcon: K,
572
- closeIconMaxWidth: R,
573
- closeIconColor: D,
574
- closeIconHoverColor: A,
575
- iconMarginRight: V,
576
- contentMarginTop: ht
577
- }) {
578
- const pt = i === "cover", E = M(null), W = M(null), N = M(null), w = M(0), g = M(0), x = M("none"), U = M(!1), H = M(!1), Y = M(!1), q = M(null), [u, j] = B(null), [$, k] = B("opening"), [et, $t] = B(0), [Mt, nt] = B(0), [T, ot] = B(!1), [it, J] = B(!1), [m, Xt] = B(!1), Rt = M(n), Q = e[n], wt = Q ? ae(Q) : !1, bt = Mt !== 0 || T, P = yt((c) => {
579
- Y.current = c, ot(c);
580
- }, []), F = yt(() => {
581
- q.current !== null && (window.clearTimeout(q.current), q.current = null);
582
- }, []), Lt = yt(() => {
583
- F(), q.current = window.setTimeout(() => {
584
- F(), P(!1);
585
- }, ct + 32);
586
- }, [F, P]), ut = yt(() => {
587
- const c = E.current, f = W.current;
588
- if (!c) return;
589
- const S = c.getBoundingClientRect(), z = S.width, O = S.height;
590
- if (!z || !O) return;
591
- if (i === "cover") {
592
- j({ width: z, height: O, left: S.left, top: S.top });
593
- return;
594
- }
595
- if (!f) {
596
- j(jt(c));
597
- return;
598
- }
599
- const { width: G, height: lt } = mn(f);
600
- if (!G || !lt) {
601
- j(jt(c));
602
- return;
603
- }
604
- const X = G / lt, v = z / O;
605
- if (X > v) {
606
- const b = z / X;
607
- j({ width: z, height: b, left: S.left, top: S.top + (O - b) / 2 });
608
- } else {
609
- const b = O * X;
610
- j({ width: b, height: O, left: S.left + (z - b) / 2, top: S.top });
611
- }
612
- }, [i]);
613
- Z(() => {
614
- ut();
615
- const c = E.current;
616
- if (!c) return;
617
- const f = new ResizeObserver(() => ut());
618
- return f.observe(c), () => f.disconnect();
619
- }, [ut, n]), Z(() => {
620
- $ === "opening" && u && k("open");
621
- }, [$, u]), Z(() => {
622
- if ($ !== "closing") return;
623
- const c = setTimeout(() => p(), ct);
624
- return () => clearTimeout(c);
625
- }, [$, p]), Z(() => () => {
626
- F();
627
- }, [F]), ce(() => {
628
- if (Rt.current === n) return;
629
- F(), $t(0), nt(0), P(!1), Xt(!1), J(!1), w.current = 0, g.current = 0, x.current = "none", U.current = !1, N.current = null, H.current = !1;
630
- const c = E.current;
631
- c && j(jt(c)), Rt.current = n;
632
- }, [n, P, F]), Z(() => {
633
- if ($ !== "open") return;
634
- let c = null;
635
- const f = () => {
636
- c && (document.removeEventListener("click", c, !0), c = null);
637
- }, S = () => {
638
- f(), c = (v) => {
639
- v.stopPropagation(), v.preventDefault(), f();
640
- }, document.addEventListener("click", c, !0);
641
- }, z = (v) => {
642
- F(), Y.current = !1, ot(!1), nt(0), J(!1), U.current = !1, g.current = 0, x.current = "none";
643
- const b = E.current;
644
- b && j(jt(b)), v < 0 ? h() : a();
645
- }, O = (v) => {
646
- if (Math.abs(v) > cn && e.length > 1) {
647
- z(v);
648
- return;
649
- }
650
- P(!0), nt(0), Lt();
651
- }, G = (v) => {
652
- if (v.touches.length !== 1 || Y.current) return;
653
- const b = v.touches[0];
654
- H.current = !0, N.current = { x: b.clientX, y: b.clientY }, x.current = "none", g.current = 0, U.current = !1;
655
- }, lt = (v) => {
656
- if (!N.current || v.touches.length !== 1 || Y.current) return;
657
- const b = v.touches[0], mt = b.clientX - N.current.x, tt = b.clientY - N.current.y;
658
- if (x.current === "none") {
659
- if (Math.abs(mt) < 10 && Math.abs(tt) < 10) return;
660
- if (Math.abs(mt) > Math.abs(tt)) {
661
- if (e.length <= 1) return;
662
- x.current = "horizontal";
663
- } else if (tt > 0)
664
- x.current = "vertical";
665
- else
666
- return;
667
- }
668
- if (x.current === "horizontal") {
669
- U.current = !0, J(!0), g.current = mt, nt(mt), v.preventDefault();
670
- return;
671
- }
672
- x.current === "vertical" && (U.current = !0, J(!0), w.current = tt, $t(tt), v.preventDefault());
673
- }, X = () => {
674
- if (!N.current) return;
675
- const v = x.current, b = U.current;
676
- if (b && v === "horizontal")
677
- O(g.current), S();
678
- else if (b && v === "vertical")
679
- if (w.current > an) {
680
- const tt = window.innerHeight;
681
- w.current = tt, Xt(!0), $t(tt), k("closing");
682
- } else
683
- w.current = 0, $t(0), S();
684
- else v === "horizontal" && Math.abs(g.current) > 0 && (O(g.current), S());
685
- N.current = null, x.current = "none", g.current = 0, U.current = !1, J(!1);
686
- };
687
- return document.addEventListener("touchstart", G, { passive: !0 }), document.addEventListener("touchmove", lt, { passive: !1 }), document.addEventListener("touchend", X), document.addEventListener("touchcancel", X), () => {
688
- document.removeEventListener("touchstart", G), document.removeEventListener("touchmove", lt), document.removeEventListener("touchend", X), document.removeEventListener("touchcancel", X), f();
689
- };
690
- }, [$, e.length, h, a, P, Lt, F]), Z(() => {
691
- const c = (f) => {
692
- f.key === "Escape" && (f.preventDefault(), f.stopPropagation(), $ !== "closing" && k("closing"));
693
- };
694
- return window.addEventListener("keydown", c, !0), () => window.removeEventListener("keydown", c, !0);
695
- }, [$]);
696
- const At = () => {
697
- $ !== "closing" && k("closing");
698
- }, rt = $ === "open", Dt = $ === "closing", Kt = et > 0 ? Math.max(0, 1 - et / 500) : 1, Et = et > 0 ? Math.max(0.35, 1 - et / 500) : 1, Wt = (c) => {
699
- if (c.stopPropagation(), H.current) {
700
- H.current = !1;
701
- return;
702
- }
703
- if (e.length <= 1) return;
704
- const f = c.currentTarget.getBoundingClientRect(), S = c.clientY - f.top, z = Math.min(52, f.height * 0.2);
705
- if (!(S > f.height - z)) {
706
- if (c.clientX - f.left < f.width / 2) {
707
- a();
708
- return;
709
- }
710
- h();
711
- }
712
- }, Ht = (c) => {
713
- if (e.length <= 1) return;
714
- const f = c.currentTarget.getBoundingClientRect(), S = c.clientX - f.left, z = c.clientY - f.top, O = Math.min(52, f.height * 0.2);
715
- if (z > f.height - O) {
716
- c.currentTarget.style.cursor = "default";
717
- return;
718
- }
719
- c.currentTarget.style.cursor = S < f.width / 2 ? "w-resize" : "e-resize";
720
- }, Ft = yt((c) => {
721
- c.propertyName !== "transform" || !Y.current || (F(), P(!1));
722
- }, [F, P]), Ut = bt ? `translateX(${Mt}px)` : et > 0 ? `translateY(${et}px)` : void 0, ft = {
723
- position: "fixed",
724
- top: u == null ? void 0 : u.top,
725
- left: u == null ? void 0 : u.left,
726
- width: u == null ? void 0 : u.width,
727
- height: u == null ? void 0 : u.height,
728
- objectFit: i === "cover" ? "cover" : "contain",
729
- transform: Ut,
730
- opacity: et > 0 ? Et : $ === "opening" || Dt ? 0 : 1,
731
- transition: it && !T ? "none" : T ? `transform ${ct}ms ${vt}` : m ? `transform ${ct}ms ${vt}, opacity ${ct}ms ${vt}` : $ === "opening" || Dt ? `opacity ${ct}ms ${vt}` : "none",
732
- pointerEvents: wt && rt && !bt ? "auto" : "none",
733
- touchAction: wt && rt ? "none" : void 0,
734
- zIndex: 9998
735
- }, gt = u ? {
736
- position: "fixed",
737
- top: u.top,
738
- height: u.height,
739
- width: u.width / 2,
740
- zIndex: 9999
741
- } : null;
742
- return /* @__PURE__ */ C(
743
- "div",
744
- {
745
- className: [
746
- `${t}-lightbox`,
747
- l ? `${t}-lightbox-editor` : ""
748
- ].filter(Boolean).join(" "),
749
- style: {
750
- touchAction: $ === "open" ? "none" : void 0
751
- },
752
- onClick: At,
753
- children: [
754
- /* @__PURE__ */ r(
755
- "div",
756
- {
757
- style: {
758
- position: "absolute",
759
- inset: 0,
760
- background: I,
761
- opacity: rt ? Kt : 0,
762
- transition: it ? "none" : `opacity ${ct}ms ${vt}`,
763
- pointerEvents: "none"
764
- }
765
- }
766
- ),
767
- /* @__PURE__ */ r(
768
- "div",
769
- {
770
- style: {
771
- position: "relative",
772
- width: "100%",
773
- height: "100%",
774
- display: "flex",
775
- flexDirection: "column",
776
- alignItems: "center",
777
- justifyContent: "center"
778
- },
779
- children: pt ? /* @__PURE__ */ C(xt, { children: [
780
- /* @__PURE__ */ r("div", { ref: E, style: { position: "absolute", inset: 0 } }),
781
- /* @__PURE__ */ r(
782
- "div",
783
- {
784
- style: {
785
- position: "absolute",
786
- bottom: 0,
787
- left: 0,
788
- right: 0,
789
- display: "flex",
790
- flexDirection: "row",
791
- justifyContent: "center",
792
- alignItems: "center",
793
- height: "10%",
794
- opacity: rt ? 1 : 0,
795
- transition: `opacity ${ct}ms ${vt}`,
796
- pointerEvents: "none",
797
- zIndex: 9999
798
- },
799
- children: e.length > 1 && /* @__PURE__ */ C("p", { className: s, style: y, children: [
800
- n + 1,
801
- " / ",
802
- e.length
803
- ] })
804
- }
805
- )
806
- ] }) : /* @__PURE__ */ C(xt, { children: [
807
- /* @__PURE__ */ r("div", { style: { height: "10%" } }),
808
- /* @__PURE__ */ r(
809
- "div",
810
- {
811
- style: {
812
- width: "70%",
813
- height: "80%",
814
- display: "flex",
815
- justifyContent: "center",
816
- alignItems: "center"
817
- },
818
- children: /* @__PURE__ */ r("div", { ref: E, style: { width: "100%", height: "100%" } })
819
- }
820
- ),
821
- /* @__PURE__ */ r(
822
- "div",
823
- {
824
- style: {
825
- display: "flex",
826
- flexDirection: "row",
827
- justifyContent: "center",
828
- alignItems: "center",
829
- height: "10%",
830
- opacity: rt ? 1 : 0,
831
- transition: `opacity ${ct}ms ${vt}`
832
- },
833
- children: e.length > 1 && /* @__PURE__ */ C("p", { className: s, style: y, children: [
834
- n + 1,
835
- " / ",
836
- e.length
837
- ] })
838
- }
839
- )
840
- ] })
841
- }
842
- ),
843
- u && Q && (wt ? /* @__PURE__ */ r(
844
- wn,
845
- {
846
- src: Q.assetId,
847
- phase: $,
848
- mediaRef: W,
849
- mediaStyle: ft,
850
- onLoadedMetadata: ut,
851
- onClick: Wt,
852
- onMouseMove: Ht,
853
- onTransitionEnd: Ft
854
- },
855
- `${n}-${Q.assetId}`
856
- ) : /* @__PURE__ */ r(
857
- "img",
858
- {
859
- ref: W,
860
- src: Q.assetId,
861
- alt: Q.name,
862
- onLoad: ut,
863
- onTransitionEnd: Ft,
864
- style: ft
865
- },
866
- `${n}-${Q.assetId}`
867
- )),
868
- rt && gt && e.length > 1 && !wt && /* @__PURE__ */ C(xt, { children: [
869
- /* @__PURE__ */ r(
870
- "div",
871
- {
872
- style: {
873
- ...gt,
874
- left: u.left,
875
- cursor: "w-resize",
876
- pointerEvents: bt ? "none" : "auto"
877
- },
878
- onClick: (c) => {
879
- if (H.current) {
880
- H.current = !1;
881
- return;
882
- }
883
- c.stopPropagation(), a();
884
- }
885
- }
886
- ),
887
- /* @__PURE__ */ r(
888
- "div",
889
- {
890
- style: {
891
- ...gt,
892
- left: u.left + u.width / 2,
893
- cursor: "e-resize",
894
- pointerEvents: bt ? "none" : "auto"
895
- },
896
- onClick: (c) => {
897
- if (H.current) {
898
- H.current = !1;
899
- return;
900
- }
901
- c.stopPropagation(), h();
902
- }
903
- }
904
- )
905
- ] }),
906
- /* @__PURE__ */ r(
907
- Cn,
908
- {
909
- prefix: t,
910
- closeIcon: K,
911
- closeIconMaxWidth: R,
912
- closeIconColor: D,
913
- closeIconHoverColor: A,
914
- iconMarginRight: V,
915
- contentMarginTop: ht,
916
- isEditor: l,
917
- isPreviewMode: d,
918
- isEditMode: o,
919
- visible: rt,
920
- onClose: At
921
- }
922
- )
923
- ]
924
- }
925
- );
926
- }
927
- function Te({
928
- P: t,
929
- media: e,
930
- imgWidth: n,
931
- cornerRadius: i,
932
- fillGalleryWidth: l,
933
- imageDisplay: d,
934
- isEditor: o,
935
- galleryPaddingBetween: p = 0,
936
- showPaddingAfter: a = !1,
937
- showControls: h = !1,
938
- onMediaClick: s
939
- }) {
940
- const y = `${t}-gallery-${ae(e) ? "video" : "image"}`, I = d.display === "cover", K = xn(d), R = (g) => dt(g, o ?? !1), D = n ?? It, A = l ? { width: "100%", maxWidth: "100%" } : { width: R(D), maxWidth: "100%" }, V = i ? { borderRadius: R(i) } : {}, ht = {
941
- ...A,
942
- ...I ? { aspectRatio: K, height: "auto", overflow: "hidden" } : {},
943
- ...V
944
- }, pt = {
945
- ...I ? {
946
- display: "block",
947
- width: "100%",
948
- height: "100%",
949
- objectFit: "cover",
950
- maxWidth: "100%"
951
- } : {
952
- display: "block",
953
- maxWidth: "100%",
954
- height: "auto",
955
- width: l ? "100%" : R(D)
956
- },
957
- ...s ? { cursor: "pointer", pointerEvents: "auto" } : {},
958
- ...I ? {} : V
959
- }, W = {
960
- className: y,
961
- style: pt,
962
- onClick: s ? (g) => {
963
- g.stopPropagation(), s();
964
- } : void 0
965
- }, N = Math.max(p, st), w = ae(e) ? /* @__PURE__ */ r(
966
- Pe,
967
- {
968
- ...W,
969
- src: e.assetId,
970
- muted: !0,
971
- autoPlay: !0,
972
- loop: !0,
973
- playsInline: !0
974
- }
975
- ) : /* @__PURE__ */ r(
976
- "img",
977
- {
978
- ...W,
979
- src: e.assetId,
980
- alt: e.name ?? ""
981
- }
982
- );
983
- return /* @__PURE__ */ C("div", { className: `${t}-gallery-item`, children: [
984
- I ? /* @__PURE__ */ r("div", { style: ht, children: w }) : w,
985
- a && p > 0 && /* @__PURE__ */ r(
986
- "div",
987
- {
988
- className: `${t}-padding-handle`,
989
- style: { height: R(p) },
990
- "aria-hidden": "true"
991
- }
992
- ),
993
- h && a && /* @__PURE__ */ r(
994
- "div",
995
- {
996
- "data-controls": "galleryPaddingBetween",
997
- "data-controls-axis": "y",
998
- "data-controls-variant": "row-padding",
999
- "data-controls-min": "0",
1000
- className: `${t}-control-anchor`,
1001
- style: {
1002
- bottom: 0,
1003
- left: 0,
1004
- width: "100%",
1005
- height: R(N)
1006
- }
1007
- }
1008
- )
1009
- ] });
1010
- }
1011
- function In({
1012
- P: t,
1013
- layoutType: e,
1014
- galleryWidthStyle: n,
1015
- galleryPaddingRight: i,
1016
- galleryPaddingLeft: l,
1017
- galleryPaddingRightWidth: d,
1018
- galleryPaddingLeftWidth: o,
1019
- galleryPaddingMaxFraction: p,
1020
- showControls: a,
1021
- scaled: h,
1022
- children: s
1023
- }) {
1024
- const y = e === "a" ? i : e === "c" ? l : 0, I = y > 0 || a;
1025
- return /* @__PURE__ */ C("div", { className: `${t}-gallery-controls`, children: [
1026
- e === "c" && I && /* @__PURE__ */ r(
1027
- "div",
1028
- {
1029
- className: `${t}-gallery-edge-spacer`,
1030
- style: { width: h(y) },
1031
- "aria-hidden": "true"
1032
- }
1033
- ),
1034
- a && e === "c" && /* @__PURE__ */ r(
1035
- "div",
1036
- {
1037
- "data-controls": "galleryPaddingLeft",
1038
- "data-controls-axis": "x",
1039
- "data-controls-variant": "column-padding",
1040
- "data-controls-min": "0",
1041
- "data-controls-max-fraction": String(p),
1042
- className: `${t}-control-anchor`,
1043
- style: {
1044
- top: 0,
1045
- left: 0,
1046
- width: h(o),
1047
- height: "100%"
1048
- }
1049
- }
1050
- ),
1051
- /* @__PURE__ */ r("div", { className: `${t}-gallery`, style: n, children: s }),
1052
- e === "a" && I && /* @__PURE__ */ r(
1053
- "div",
1054
- {
1055
- className: `${t}-gallery-edge-spacer`,
1056
- style: { width: h(y) },
1057
- "aria-hidden": "true"
1058
- }
1059
- ),
1060
- a && e === "a" && /* @__PURE__ */ r(
1061
- "div",
1062
- {
1063
- "data-controls": "galleryPaddingRight",
1064
- "data-controls-axis": "x",
1065
- "data-controls-variant": "column-padding",
1066
- "data-controls-reverse": "",
1067
- "data-controls-min": "0",
1068
- "data-controls-max-fraction": String(p),
1069
- className: `${t}-control-anchor`,
1070
- style: {
1071
- top: 0,
1072
- right: 0,
1073
- width: h(d),
1074
- height: "100%"
1075
- }
1076
- }
1077
- )
1078
- ] });
1079
- }
1080
- function Ln(t) {
1081
- switch (t) {
1082
- case "fade":
1083
- case "retype":
1084
- case "scroll":
1085
- return t;
1086
- case "default":
1087
- return "scroll";
1088
- default:
1089
- return "scroll";
1090
- }
1091
- }
1092
- function Gt({
1093
- P: t,
1094
- controlKey: e,
1095
- scaled: n,
1096
- height: i,
1097
- paired: l,
1098
- side: d
1099
- }) {
1100
- return /* @__PURE__ */ r(
1101
- "div",
1102
- {
1103
- "data-controls": e,
1104
- ...l ? { "data-controls-paired": "" } : {},
1105
- "data-controls-axis": "y",
1106
- "data-controls-variant": "row-padding",
1107
- "data-controls-min": "0",
1108
- className: `${t}-control-anchor`,
1109
- style: {
1110
- ...d === "top" ? { top: 0 } : { bottom: 0 },
1111
- left: 0,
1112
- width: "100%",
1113
- height: n(i)
1114
- }
1115
- }
1116
- );
1117
- }
1118
- function Ie({
1119
- P: t,
1120
- controlKey: e,
1121
- scaled: n,
1122
- width: i,
1123
- maxFraction: l,
1124
- side: d,
1125
- paired: o,
1126
- anchorStyle: p
1127
- }) {
1128
- return /* @__PURE__ */ r(
1129
- "div",
1130
- {
1131
- "data-controls": e,
1132
- ...o ? { "data-controls-paired": "" } : {},
1133
- "data-controls-axis": "x",
1134
- "data-controls-variant": "column-padding",
1135
- ...d === "right" ? { "data-controls-reverse": "" } : {},
1136
- "data-controls-min": "0",
1137
- "data-controls-max-fraction": String(l),
1138
- className: `${t}-control-anchor`,
1139
- style: {
1140
- top: 0,
1141
- ...d === "left" ? { left: 0 } : { right: 0 },
1142
- width: n(i),
1143
- height: "100%",
1144
- ...p
1145
- }
1146
- }
1147
- );
1148
- }
1149
- function le({
1150
- P: t,
1151
- title: e,
1152
- description: n,
1153
- position: i,
1154
- titleRef: l,
1155
- titleClassName: d,
1156
- titleContainerStyle: o,
1157
- titleTextBoxStyle: p,
1158
- titleStyle: a,
1159
- descriptionClassName: h,
1160
- descriptionStyle: s,
1161
- descriptionPadding: y,
1162
- showTextBoxOutline: I = !1,
1163
- showDescriptionPaddingControl: K = !1,
1164
- descriptionPaddingPaired: R = !1,
1165
- topPaddingControl: D,
1166
- bottomPaddingControl: A
1167
- }) {
1168
- const V = M(null), [ht, pt] = B(0), E = e ?? "", W = n ?? "", N = W.length > 0, { horizontal: w, vertical: g } = se(i), x = g === "center" || g === "bottom", U = g === "bottom";
1169
- ce(() => {
1170
- if (!x) return;
1171
- const u = V.current;
1172
- if (!u || typeof ResizeObserver > "u") return;
1173
- const j = () => pt(u.offsetHeight);
1174
- j();
1175
- const $ = new ResizeObserver(j);
1176
- return $.observe(u), () => $.disconnect();
1177
- }, [E, W, x]);
1178
- const H = /* @__PURE__ */ r("span", { className: `${t}-title-text`, style: a, children: E }), Y = N ? /* @__PURE__ */ r("span", { className: h, style: s, children: W }) : null, q = N ? /* @__PURE__ */ r(
1179
- "div",
1180
- {
1181
- className: `${t}-title-texts-gap`,
1182
- style: { height: y },
1183
- children: K && /* @__PURE__ */ r(
1184
- "div",
1185
- {
1186
- "data-controls": "titleDescriptionPadding",
1187
- ...R ? { "data-controls-paired": "" } : {},
1188
- "data-controls-axis": "y",
1189
- "data-controls-variant": "row-padding",
1190
- "data-controls-min": "0",
1191
- className: `${t}-control-anchor`,
1192
- style: {
1193
- top: 0,
1194
- left: 0,
1195
- width: "100%",
1196
- height: "100%"
1197
- }
1198
- }
1199
- )
1200
- }
1201
- ) : null;
1202
- return /* @__PURE__ */ r(
1203
- "div",
1204
- {
1205
- ref: (u) => {
1206
- V.current = u, l(u);
1207
- },
1208
- className: [
1209
- d,
1210
- `${t}-title-h-${w}`,
1211
- `${t}-title-v-${g}`
1212
- ].join(" "),
1213
- style: {
1214
- ...x ? { [`--${t}-title-height`]: `${ht}px` } : {},
1215
- ...o
1216
- },
1217
- children: /* @__PURE__ */ C(
1218
- "div",
1219
- {
1220
- className: `${t}-title-text-stack`,
1221
- style: p,
1222
- children: [
1223
- D,
1224
- /* @__PURE__ */ r(
1225
- "div",
1226
- {
1227
- className: I ? `${t}-title-text-inner` : `${t}-title-text-inner-hidden`,
1228
- style: { width: "100%" },
1229
- children: /* @__PURE__ */ r("div", { className: `${t}-title-texts`, children: U ? /* @__PURE__ */ C(xt, { children: [
1230
- Y,
1231
- q,
1232
- H
1233
- ] }) : /* @__PURE__ */ C(xt, { children: [
1234
- H,
1235
- q,
1236
- Y
1237
- ] }) })
1238
- }
1239
- ),
1240
- A
1241
- ]
1242
- }
1243
- )
1244
- }
1245
- );
1246
- }
1247
- const Le = 45;
1248
- function Ne(t, e, n) {
1249
- let i = t;
1250
- for (; i; ) {
1251
- const l = getComputedStyle(i).getPropertyValue(e).trim();
1252
- if (l) {
1253
- const d = parseFloat(l);
1254
- if (!Number.isNaN(d)) return d;
1255
- }
1256
- i = i.parentElement;
1257
- }
1258
- return n;
1259
- }
1260
- function Nn(t) {
1261
- const e = Ne(t, "--cntrl-viewport-height", window.innerHeight), n = Ne(t, "--cntrl-article-top", 0);
1262
- return { top: n, height: e, centerY: n + e / 2 };
1263
- }
1264
- function kn(t, e, n) {
1265
- const { vertical: i } = se(e), { top: l, height: d, centerY: o } = Nn(n);
1266
- if (i === "top") {
1267
- const a = n && parseFloat(getComputedStyle(n).top) || l;
1268
- return Math.abs(t.top - a);
1269
- }
1270
- if (i === "bottom")
1271
- return Math.abs(t.bottom - (l + d));
1272
- const p = t.top + t.height / 2;
1273
- return Math.abs(p - o);
1274
- }
1275
- function zn(t, e, n) {
1276
- const i = Array.from({ length: e }, (o, p) => {
1277
- const a = t.current[p];
1278
- if (!a) return 0;
1279
- const h = a.getBoundingClientRect(), s = kn(h, n, a);
1280
- return Math.exp(-(s * s) / (2 * Le * Le));
1281
- });
1282
- let l = 0, d = -1;
1283
- return i.forEach((o, p) => {
1284
- o > d && (d = o, l = p);
1285
- }), { opacities: i, dominantIndex: l };
1286
- }
1287
- function Mn(t, e, n) {
1288
- const i = M([]), [{ opacities: l, dominantIndex: d }, o] = B(() => ({
1289
- opacities: Array.from({ length: t }, (a, h) => h === 0 ? 1 : 0),
1290
- dominantIndex: 0
1291
- }));
1292
- return ce(() => {
1293
- if (!e || t === 0) {
1294
- o({
1295
- opacities: Array.from({ length: t }, () => 1),
1296
- dominantIndex: 0
1297
- });
1298
- return;
1299
- }
1300
- let a = 0;
1301
- const h = () => {
1302
- o(zn(i, t, n));
1303
- }, s = () => {
1304
- a || (a = window.requestAnimationFrame(() => {
1305
- a = 0, h();
1306
- }));
1307
- };
1308
- return h(), window.addEventListener("scroll", s, { passive: !0 }), window.addEventListener("resize", s, { passive: !0 }), () => {
1309
- a && window.cancelAnimationFrame(a), window.removeEventListener("scroll", s), window.removeEventListener("resize", s);
1310
- };
1311
- }, [e, t, n]), { setTitleRef: (a) => (h) => {
1312
- i.current[a] = h;
1313
- }, opacities: l, dominantIndex: d };
1314
- }
1315
- function ke(t, e) {
1316
- const [n, i] = B(t), l = M(t);
1317
- return Z(() => {
1318
- if (!e) {
1319
- l.current = t, i(t);
1320
- return;
1321
- }
1322
- const d = Array.from(l.current), o = Array.from(t), p = Math.max(d.length, o.length);
1323
- if (p === 0 || l.current === t) return;
1324
- let a = 0;
1325
- const h = window.setInterval(() => {
1326
- a += 1;
1327
- const s = [
1328
- ...o.slice(0, a),
1329
- ...d.slice(a)
1330
- ].join("");
1331
- l.current = s, i(s), a >= p && window.clearInterval(h);
1332
- }, 70);
1333
- return () => window.clearInterval(h);
1334
- }, [e, t]), n;
1335
- }
1336
- function jn({
1337
- settings: t,
1338
- content: e,
1339
- isEditor: n,
1340
- isPreviewMode: i,
1341
- isEditMode: l,
1342
- portalId: d
1343
- }) {
1344
- var $e, we;
1345
- const { prefix: o } = Je(), p = Ce(() => nn(o), [o]), a = e ?? [], h = (t == null ? void 0 : t.wrapperWidth) ?? 1, s = (t == null ? void 0 : t.type) ?? "a", y = (t == null ? void 0 : t.imgWidth) ?? It, I = (t == null ? void 0 : t.titleWidth) ?? vn, K = yn(t == null ? void 0 : t.imageDisplay), R = (t == null ? void 0 : t.cornerRadius) ?? tn, D = rn(t == null ? void 0 : t.position), { horizontal: A, vertical: V } = se(D), ht = (t == null ? void 0 : t.titleTopPadding) ?? 0, pt = (t == null ? void 0 : t.titleBottomPadding) ?? 0, E = (t == null ? void 0 : t.titleLeftPadding) ?? 0, W = (t == null ? void 0 : t.titleRightPadding) ?? 0, N = (t == null ? void 0 : t.titleDescriptionPadding) ?? 0, w = Ln(t == null ? void 0 : t.transition), g = (t == null ? void 0 : t.lightbox) ?? "on", x = s === "b", U = w === "fade" || w === "retype", { setTitleRef: H, dominantIndex: Y } = Mn(a.length, U, D), q = (($e = a[Y]) == null ? void 0 : $e.title) ?? "", u = ((we = a[Y]) == null ? void 0 : we.description) ?? "", j = ke(q, w === "retype"), $ = ke(u, w === "retype"), k = w === "fade" || w === "retype", et = w === "retype" ? j : q, $t = w === "retype" ? $ : u, Mt = x ? void 0 : { width: dt(y, n ?? !1) }, nt = g === "on" && (!n || i || l), T = l ?? !1, ot = (t == null ? void 0 : t.galleryPaddingRight) ?? 0, it = (t == null ? void 0 : t.galleryPaddingLeft) ?? 0, J = (t == null ? void 0 : t.galleryPaddingBetween) ?? 0, m = (L) => dt(L, n ?? !1), Rt = {
1346
- width: m(I)
1347
- }, Q = s === "a" ? ot : it, wt = x ? { width: "100%" } : {
1348
- width: `calc(100% - ${m(y)} - ${m(Q)})`,
1349
- ...s === "c" ? { marginLeft: "auto" } : {}
1350
- }, bt = Math.max(ot, st), P = Math.max(it, st), F = Math.max(J, st), Lt = Math.max(ht, st), ut = Math.max(pt, st), At = Math.max(E, st), rt = Math.max(W, st), Dt = Math.max(N, st), Kt = Math.max(0, (h ?? 1) - (y ?? It)), Et = s === "a" ? Math.max(0, (h ?? 1) - (y ?? It) - ot) : s === "c" ? Math.max(0, (h ?? 1) - (y ?? It) - it) : s === "b" ? h ?? 1 : 1, Wt = T && V === "top", Ht = T && V === "bottom", Ft = T && A === "left", Ut = T && A === "right", ft = a.length > 1, gt = x ? void 0 : m((s === "c" ? it : ot) + (y ?? It)), c = s === "c" && gt ? { left: gt } : void 0, f = s === "a" && gt ? { right: gt } : void 0, S = x ? { left: 0, width: "100%" } : s === "a" ? { right: m(ot), width: m(y) } : { left: m(it), width: m(y) }, {
1351
- titleColor: z,
1352
- titleFontFamily: O,
1353
- titleFontSettings: G,
1354
- titleFontSize: lt,
1355
- titleLineHeight: X,
1356
- titleLetterSpacing: v,
1357
- titleWordSpacing: b,
1358
- titleAlign: mt,
1359
- titleTextAppearance: tt,
1360
- descriptionColor: de,
1361
- descriptionFontFamily: Me,
1362
- descriptionFontSettings: St,
1363
- descriptionFontSize: Yt,
1364
- descriptionLineHeight: Zt,
1365
- descriptionLetterSpacing: Re,
1366
- descriptionWordSpacing: Ae,
1367
- descriptionAlign: De,
1368
- descriptionTextAppearance: Ee,
1369
- lightboxCounterColor: he,
1370
- lightboxCounterFontFamily: We,
1371
- lightboxCounterFontSettings: Ct,
1372
- lightboxCounterFontSize: qt,
1373
- lightboxCounterLineHeight: Jt,
1374
- lightboxCounterLetterSpacing: He,
1375
- lightboxCounterWordSpacing: Fe,
1376
- lightboxCounterTextAppearance: Oe
1377
- } = t ?? {}, _e = {
1378
- fontSettings: {
1379
- fontFamily: O,
1380
- fontWeight: (G == null ? void 0 : G.fontWeight) ?? 400,
1381
- fontStyle: (G == null ? void 0 : G.fontStyle) ?? "normal"
1382
- },
1383
- fontSize: lt ?? 0.01,
1384
- lineHeight: X,
1385
- letterSpacing: v ?? 0,
1386
- wordSpacing: b ?? 0,
1387
- textAlign: mt ?? "left",
1388
- textAppearance: tt,
1389
- color: z ?? "#000000"
1390
- }, pe = ne(oe(_e, n)), ue = Rt, fe = {
1391
- ...re(lt, X, o, n),
1392
- ...re(Yt, Zt, o, n, "description-leading-gap")
1393
- }, ge = ie(
1394
- lt,
1395
- X,
1396
- `${o}-title`,
1397
- `${o}-text-tight-leading`
1398
- ), Be = {
1399
- fontSettings: {
1400
- fontFamily: Me,
1401
- fontWeight: (St == null ? void 0 : St.fontWeight) ?? 400,
1402
- fontStyle: (St == null ? void 0 : St.fontStyle) ?? "normal"
1403
- },
1404
- fontSize: Yt ?? 0.01,
1405
- lineHeight: Zt,
1406
- letterSpacing: Re ?? 0,
1407
- wordSpacing: Ae ?? 0,
1408
- textAlign: De ?? "left",
1409
- textAppearance: Ee,
1410
- color: de ?? "#000000"
1411
- }, me = ne(oe(Be, n)), ve = ie(
1412
- Yt,
1413
- Zt,
1414
- `${o}-description-text`,
1415
- `${o}-description-tight-leading`
1416
- ), ye = m(T ? Dt : N), Ve = {
1417
- fontSettings: {
1418
- fontFamily: We,
1419
- fontWeight: (Ct == null ? void 0 : Ct.fontWeight) ?? 400,
1420
- fontStyle: (Ct == null ? void 0 : Ct.fontStyle) ?? "normal"
1421
- },
1422
- fontSize: qt ?? 0.01,
1423
- lineHeight: Jt,
1424
- letterSpacing: He ?? 0,
1425
- wordSpacing: Fe ?? 0,
1426
- textAppearance: Oe,
1427
- color: he ?? "#DEDDDD"
1428
- }, je = {
1429
- ...ne(oe(Ve, n)),
1430
- ...re(qt, Jt, o, n)
1431
- }, Ge = ie(
1432
- qt,
1433
- Jt,
1434
- `${o}-lightbox-counter`,
1435
- `${o}-text-tight-leading`
1436
- ), Qt = qe(o, {
1437
- titleColor: z ?? "#000000",
1438
- descriptionColor: de ?? "#000000",
1439
- lightboxCounterColor: he ?? "#DEDDDD"
1440
- }, sn, dn), Pt = M(null), [Ot, _t] = B(!1), [Bt, Xe] = B([]), [Ke, te] = B(0), xe = yt((L, _) => {
1441
- nt && (Xe(L), te(_), _t(!0));
1442
- }, [nt]), Ue = yt(() => {
1443
- _t(!1);
1444
- }, []), Ye = Ce(() => {
1445
- const L = { ...Qt }, _ = Pt.current ? getComputedStyle(Pt.current).getPropertyValue("--cntrl-article-width").trim() : "";
1446
- return _ && (L["--cntrl-article-width"] = _), L;
1447
- }, [Qt, Ot]);
1448
- return Z(() => {
1449
- if (!Ot || g !== "on" || typeof document > "u") return;
1450
- const L = document.body.style.overflow;
1451
- return document.body.style.overflow = "hidden", () => {
1452
- document.body.style.overflow = L;
1453
- };
1454
- }, [Ot, g]), Z(() => {
1455
- !n || l || i || _t(!1);
1456
- }, [n, l, i]), Z(() => {
1457
- g === "off" && _t(!1);
1458
- }, [g]), /* @__PURE__ */ C(xt, { children: [
1459
- /* @__PURE__ */ r("style", { dangerouslySetInnerHTML: { __html: p } }),
1460
- /* @__PURE__ */ r("div", { style: Qt, children: /* @__PURE__ */ C(
1461
- "div",
1462
- {
1463
- ref: Pt,
1464
- className: `${o}-wrapper`,
1465
- style: {
1466
- width: dt(h, n ?? !1),
1467
- [`--${o}-title-top-padding`]: V === "top" ? m(ht) : void 0,
1468
- [`--${o}-title-bottom-padding`]: V === "bottom" ? m(pt) : void 0,
1469
- [`--${o}-title-left-padding`]: A === "left" ? m(E) : void 0,
1470
- [`--${o}-title-right-padding`]: A === "right" ? m(W) : void 0
1471
- },
1472
- children: [
1473
- k && /* @__PURE__ */ r("div", { className: `${o}-single-title-layer`, children: /* @__PURE__ */ r(
1474
- le,
1475
- {
1476
- P: o,
1477
- title: et,
1478
- description: $t,
1479
- position: D,
1480
- titleRef: () => {
1481
- },
1482
- titleClassName: `${ge} ${o}-single-title`,
1483
- titleContainerStyle: {
1484
- ...fe,
1485
- ...wt
1486
- },
1487
- titleTextBoxStyle: ue,
1488
- titleStyle: pe,
1489
- descriptionClassName: ve,
1490
- descriptionStyle: me,
1491
- descriptionPadding: ye,
1492
- showTextBoxOutline: T,
1493
- showDescriptionPaddingControl: T,
1494
- topPaddingControl: Wt ? Gt({
1495
- P: o,
1496
- controlKey: "titleTopPadding",
1497
- scaled: m,
1498
- height: Lt,
1499
- paired: !1,
1500
- side: "top"
1501
- }) : void 0,
1502
- bottomPaddingControl: Ht ? Gt({
1503
- P: o,
1504
- controlKey: "titleBottomPadding",
1505
- scaled: m,
1506
- height: ut,
1507
- paired: !1,
1508
- side: "bottom"
1509
- }) : void 0
1510
- }
1511
- ) }),
1512
- a.map((L, _) => {
1513
- const Tt = fn(L.gallery), be = _ < a.length - 1, Vt = Tt.filter((at) => at.lightboxMedia).map((at) => at.lightboxMedia), Se = {
1514
- P: o,
1515
- position: D,
1516
- titleRef: H(_),
1517
- titleClassName: ge,
1518
- titleContainerStyle: fe,
1519
- titleTextBoxStyle: k ? { maxWidth: "100%" } : ue,
1520
- titleStyle: pe,
1521
- descriptionClassName: ve,
1522
- descriptionStyle: me,
1523
- descriptionPadding: ye,
1524
- showTextBoxOutline: T && !k,
1525
- showDescriptionPaddingControl: T && !k,
1526
- descriptionPaddingPaired: ft,
1527
- topPaddingControl: Wt && !k ? Gt({
1528
- P: o,
1529
- controlKey: "titleTopPadding",
1530
- scaled: m,
1531
- height: Lt,
1532
- paired: ft,
1533
- side: "top"
1534
- }) : void 0,
1535
- bottomPaddingControl: Ht && !k ? Gt({
1536
- P: o,
1537
- controlKey: "titleBottomPadding",
1538
- scaled: m,
1539
- height: ut,
1540
- paired: ft,
1541
- side: "bottom"
1542
- }) : void 0
1543
- };
1544
- return /* @__PURE__ */ C(
1545
- "div",
1546
- {
1547
- "data-item-index": _,
1548
- className: `${o}-item ${o}-item-${s}`,
1549
- style: {
1550
- paddingBottom: be ? m(J) : void 0
1551
- },
1552
- children: [
1553
- Ft && Ie({
1554
- P: o,
1555
- controlKey: "titleLeftPadding",
1556
- scaled: m,
1557
- width: At,
1558
- maxFraction: Et,
1559
- side: "left",
1560
- paired: ft,
1561
- anchorStyle: c
1562
- }),
1563
- Ut && Ie({
1564
- P: o,
1565
- controlKey: "titleRightPadding",
1566
- scaled: m,
1567
- width: rt,
1568
- maxFraction: Et,
1569
- side: "right",
1570
- paired: ft,
1571
- anchorStyle: f
1572
- }),
1573
- T && be && /* @__PURE__ */ r(
1574
- "div",
1575
- {
1576
- "data-controls": "galleryPaddingBetween",
1577
- "data-controls-axis": "y",
1578
- "data-controls-variant": "row-padding",
1579
- "data-controls-min": "0",
1580
- className: `${o}-control-anchor`,
1581
- style: {
1582
- bottom: 0,
1583
- height: m(F),
1584
- ...S
1585
- }
1586
- }
1587
- ),
1588
- x ? /* @__PURE__ */ C("div", { className: `${o}-gallery`, children: [
1589
- /* @__PURE__ */ r("div", { className: `${o}-gallery-media`, children: Tt.map(({ displayMedia: at, lightboxMedia: Nt }, kt) => {
1590
- const zt = Nt ? Vt.findIndex((ee) => ee.assetId === Nt.assetId) : -1;
1591
- return /* @__PURE__ */ r(
1592
- Te,
1593
- {
1594
- P: o,
1595
- media: at,
1596
- imgWidth: y || void 0,
1597
- cornerRadius: R || void 0,
1598
- imageDisplay: K,
1599
- isEditor: n,
1600
- galleryPaddingBetween: J,
1601
- showPaddingAfter: kt < Tt.length - 1,
1602
- showControls: T,
1603
- onMediaClick: nt && zt >= 0 ? () => xe(Vt, zt) : void 0
1604
- },
1605
- `${at.assetId}-${kt}`
1606
- );
1607
- }) }),
1608
- /* @__PURE__ */ r("div", { className: `${o}-title-layer`, children: /* @__PURE__ */ r(
1609
- le,
1610
- {
1611
- ...Se,
1612
- title: k ? "" : L.title,
1613
- description: k ? "" : L.description
1614
- }
1615
- ) })
1616
- ] }) : /* @__PURE__ */ C(xt, { children: [
1617
- /* @__PURE__ */ r(
1618
- le,
1619
- {
1620
- ...Se,
1621
- title: k ? "" : L.title,
1622
- description: k ? "" : L.description
1623
- }
1624
- ),
1625
- Tt.length > 0 && /* @__PURE__ */ r(
1626
- In,
1627
- {
1628
- P: o,
1629
- layoutType: s,
1630
- galleryWidthStyle: Mt,
1631
- galleryPaddingRight: ot,
1632
- galleryPaddingLeft: it,
1633
- galleryPaddingRightWidth: bt,
1634
- galleryPaddingLeftWidth: P,
1635
- galleryPaddingMaxFraction: Kt,
1636
- showControls: T,
1637
- scaled: m,
1638
- children: Tt.map(({ displayMedia: at, lightboxMedia: Nt }, kt) => {
1639
- const zt = Nt ? Vt.findIndex((ee) => ee.assetId === Nt.assetId) : -1;
1640
- return /* @__PURE__ */ r(
1641
- Te,
1642
- {
1643
- P: o,
1644
- media: at,
1645
- cornerRadius: R || void 0,
1646
- fillGalleryWidth: !0,
1647
- imageDisplay: K,
1648
- isEditor: n,
1649
- galleryPaddingBetween: J,
1650
- showPaddingAfter: kt < Tt.length - 1,
1651
- showControls: T,
1652
- onMediaClick: nt && zt >= 0 ? () => xe(Vt, zt) : void 0
1653
- },
1654
- `${at.assetId}-${kt}`
1655
- );
1656
- })
1657
- }
1658
- )
1659
- ] })
1660
- ]
1661
- },
1662
- _
1663
- );
1664
- })
1665
- ]
1666
- }
1667
- ) }),
1668
- Ot && g === "on" && typeof document < "u" && t && (() => {
1669
- const L = (d ? document.getElementById(d) : null) ?? document.body;
1670
- return Ze(
1671
- /* @__PURE__ */ r("div", { style: Ye, "data-selection": "none", children: /* @__PURE__ */ r(
1672
- Tn,
1673
- {
1674
- prefix: o,
1675
- items: Bt,
1676
- index: Ke,
1677
- imageDisplay: $n(t.lightboxImageDisplay),
1678
- isEditor: n,
1679
- isPreviewMode: i,
1680
- isEditMode: l,
1681
- closeIcon: t.closeIcon,
1682
- closeIconMaxWidth: t.closeIconMaxWidth,
1683
- closeIconColor: t.closeIconColor,
1684
- closeIconHoverColor: t.closeIconHoverColor,
1685
- iconMarginRight: t.iconMarginRight,
1686
- contentMarginTop: t.contentMarginTop,
1687
- onClose: Ue,
1688
- onPrev: () => te((_) => (_ - 1 + Bt.length) % Bt.length),
1689
- onNext: () => te((_) => (_ + 1) % Bt.length),
1690
- counterClassName: Ge,
1691
- counterStyle: je,
1692
- backgroundColor: t.backgroundColor ?? ln
1693
- }
1694
- ) }),
1695
- L
1696
- );
1697
- })()
1698
- ] });
1699
- }
1700
- export {
1701
- jn as Mercury
1702
- };