@cntrl-site/components 1.0.100 → 1.0.102

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