@cntrl-site/components 1.0.103 → 1.0.104
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Components/helpers/LazyVideo/LazyVideo.d.ts +4 -0
- package/dist/Components/utils/index.d.ts +1 -0
- package/dist/Components/utils/useLazyVideos.d.ts +15 -0
- package/dist/Grid-B2_o1dvz.mjs +1576 -0
- package/dist/Grid-Bq6bk2AQ.js +374 -0
- package/dist/{Helix-2Vr-9WBa.js → Helix-B7rxlvKq.js} +2 -2
- package/dist/{Helix-BmkAKT1G.mjs → Helix-BrKQzGX5.mjs} +53 -53
- package/dist/{Hive-BGMWinrW.mjs → Hive-BusARSOi.mjs} +114 -111
- package/dist/Hive-Dh5nKPGm.js +321 -0
- package/dist/LazyVideo-Cn_vmMq8.js +1 -0
- package/dist/LazyVideo-D8eVYFyw.mjs +15 -0
- package/dist/Marquee-CdtAqhQE.mjs +563 -0
- package/dist/Marquee-DUN8wUax.js +133 -0
- package/dist/{Mercury-DuKJQ1Zo.mjs → Mercury-BRqlbk4i.mjs} +55 -54
- package/dist/Mercury-C-O2VGkK.js +267 -0
- package/dist/{PretextComponent-CGycuNNn.js → PretextComponent-D5P0AjnL.js} +1 -1
- package/dist/{PretextComponent-DN8cyZ8x.mjs → PretextComponent-s4DDfmzY.mjs} +6 -6
- package/dist/{Waterfall-A0FjM2my.mjs → Waterfall-DKuh4bnv.mjs} +299 -295
- package/dist/Waterfall-fdiHR0Rc.js +287 -0
- package/dist/{components-DTCDEBo0.js → components-DzNixU7Q.js} +1 -1
- package/dist/{components-BFJINCME.mjs → components-Yf9Zjska.mjs} +1 -1
- package/dist/elements.js +1 -1
- package/dist/elements.mjs +6 -6
- package/dist/elements.node.js +1 -1
- package/dist/elements.node.mjs +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +2 -2
- package/dist/sources.js +125 -49
- package/dist/sources.mjs +129 -53
- package/dist/useLazyVideos-BbgdvELi.js +1 -0
- package/dist/useLazyVideos-CZLyNolX.mjs +72 -0
- package/dist/utils.js +1 -1
- package/dist/utils.mjs +14 -12
- package/package.json +5 -3
- package/dist/Grid-CemGhf3F.js +0 -374
- package/dist/Grid-cfQsXW3b.mjs +0 -1553
- package/dist/Hive-BC6zQBsv.js +0 -321
- package/dist/Marquee-BYClHHws.mjs +0 -551
- package/dist/Marquee-vmHaTGIP.js +0 -133
- package/dist/Mercury-BwF_XW2w.js +0 -267
- package/dist/Waterfall-DnPDHbCL.js +0 -287
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),a=require("react"),Ve=require("react-dom"),at=require("./scalingValue-CSHYgTZl.js"),_e=require("./buildColorVars-CE2D5cQV.js"),Be=require("./useScopedStyles-Bf6yohVQ.js"),wt=require("./textStylesToCss-CNN3zZTV.js"),Ge=require("./SvgImage-DFlmxAoL.js"),qe=require("./LazyVideo-Cn_vmMq8.js"),bt=300/1440,Xe=8/1440,lt=.004;function Ke(t){return`calc(var(--cntrl-article-width, 100vw) * ${t/1440})`}function Qt(t,e,o,r){return e!==void 0&&e<(t??.01)?`${o} ${r}`:o}function Pt(t,e,o,r,l="title-leading-gap"){const h=t??.01;return e===void 0||e>=h?{}:{[`--${o}-${l}`]:at.scalingValue((h-e)/2,r)}}function Ue(t){return`
|
|
2
|
+
.${t}-wrapper {
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
position: relative;
|
|
7
|
+
width: 100%;
|
|
8
|
+
min-height: ${Ke(48)};
|
|
9
|
+
}
|
|
10
|
+
.${t}-single-title-layer {
|
|
11
|
+
position: absolute;
|
|
12
|
+
inset: 0;
|
|
13
|
+
z-index: 2;
|
|
14
|
+
pointer-events: none;
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
justify-content: flex-start;
|
|
18
|
+
}
|
|
19
|
+
.${t}-single-title {
|
|
20
|
+
pointer-events: none;
|
|
21
|
+
}
|
|
22
|
+
.${t}-item {
|
|
23
|
+
position: relative;
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
width: 100%;
|
|
27
|
+
}
|
|
28
|
+
.${t}-item-a {
|
|
29
|
+
flex-direction: row;
|
|
30
|
+
}
|
|
31
|
+
.${t}-item-b {
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
}
|
|
34
|
+
.${t}-item-c {
|
|
35
|
+
flex-direction: row-reverse;
|
|
36
|
+
}
|
|
37
|
+
.${t}-title {
|
|
38
|
+
align-self: flex-start;
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-shrink: 0;
|
|
41
|
+
min-width: 0;
|
|
42
|
+
box-sizing: border-box;
|
|
43
|
+
position: sticky;
|
|
44
|
+
z-index: 2;
|
|
45
|
+
overflow: visible;
|
|
46
|
+
color: var(--${t}-title-color);
|
|
47
|
+
}
|
|
48
|
+
.${t}-title-text,
|
|
49
|
+
.${t}-description-text {
|
|
50
|
+
display: block;
|
|
51
|
+
width: 100%;
|
|
52
|
+
white-space: pre-wrap;
|
|
53
|
+
overflow-wrap: anywhere;
|
|
54
|
+
word-break: break-word;
|
|
55
|
+
}
|
|
56
|
+
.${t}-description-text {
|
|
57
|
+
color: var(--${t}-description-color);
|
|
58
|
+
}
|
|
59
|
+
.${t}-title-texts {
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-direction: column;
|
|
62
|
+
width: 100%;
|
|
63
|
+
min-width: 0;
|
|
64
|
+
}
|
|
65
|
+
.${t}-title-texts-gap {
|
|
66
|
+
position: relative;
|
|
67
|
+
width: 100%;
|
|
68
|
+
flex-shrink: 0;
|
|
69
|
+
}
|
|
70
|
+
.${t}-title-text-inner {
|
|
71
|
+
display: flex;
|
|
72
|
+
flex-direction: column;
|
|
73
|
+
flex-shrink: 0;
|
|
74
|
+
box-sizing: border-box;
|
|
75
|
+
outline: 1px solid #FF5C02;
|
|
76
|
+
}
|
|
77
|
+
.${t}-title-text-inner-hidden {
|
|
78
|
+
display: flex;
|
|
79
|
+
flex-direction: column;
|
|
80
|
+
flex-shrink: 0;
|
|
81
|
+
box-sizing: border-box;
|
|
82
|
+
}
|
|
83
|
+
.${t}-title-text-stack {
|
|
84
|
+
display: flex;
|
|
85
|
+
flex-direction: column;
|
|
86
|
+
flex-shrink: 0;
|
|
87
|
+
min-width: 0;
|
|
88
|
+
position: relative;
|
|
89
|
+
box-sizing: border-box;
|
|
90
|
+
}
|
|
91
|
+
.${t}-item-a .${t}-title-v-top .${t}-title-text-stack,
|
|
92
|
+
.${t}-item-b .${t}-title-v-top .${t}-title-text-stack,
|
|
93
|
+
.${t}-item-c .${t}-title-v-top .${t}-title-text-stack,
|
|
94
|
+
.${t}-single-title-layer .${t}-title-v-top .${t}-title-text-stack {
|
|
95
|
+
padding-top: var(--${t}-title-top-padding, 0);
|
|
96
|
+
}
|
|
97
|
+
.${t}-item-a .${t}-title-v-bottom .${t}-title-text-stack,
|
|
98
|
+
.${t}-item-b .${t}-title-v-bottom .${t}-title-text-stack,
|
|
99
|
+
.${t}-item-c .${t}-title-v-bottom .${t}-title-text-stack,
|
|
100
|
+
.${t}-single-title-layer .${t}-title-v-bottom .${t}-title-text-stack {
|
|
101
|
+
padding-bottom: var(--${t}-title-bottom-padding, 0);
|
|
102
|
+
}
|
|
103
|
+
.${t}-title-v-center {
|
|
104
|
+
top: calc(var(--cntrl-article-top, 0px) + var(--cntrl-viewport-height, 100vh) / 2 - (var(--${t}-title-height, 0px) / 2));
|
|
105
|
+
align-items: center;
|
|
106
|
+
}
|
|
107
|
+
.${t}-title-v-top {
|
|
108
|
+
top: var(--cntrl-article-top, 0px);
|
|
109
|
+
bottom: auto;
|
|
110
|
+
align-self: flex-start;
|
|
111
|
+
}
|
|
112
|
+
.${t}-title-v-bottom {
|
|
113
|
+
top: calc(var(--cntrl-article-top, 0px) + var(--cntrl-viewport-height, 100vh) - var(--${t}-title-height, 0px));
|
|
114
|
+
align-items: center;
|
|
115
|
+
}
|
|
116
|
+
.${t}-title-h-left {
|
|
117
|
+
justify-content: flex-start;
|
|
118
|
+
}
|
|
119
|
+
.${t}-item-a .${t}-title-h-left,
|
|
120
|
+
.${t}-item-b .${t}-title-h-left,
|
|
121
|
+
.${t}-item-c .${t}-title-h-left,
|
|
122
|
+
.${t}-single-title-layer .${t}-title-h-left {
|
|
123
|
+
padding-left: var(--${t}-title-left-padding, 0);
|
|
124
|
+
}
|
|
125
|
+
.${t}-title-h-center {
|
|
126
|
+
justify-content: center;
|
|
127
|
+
}
|
|
128
|
+
.${t}-title-h-right {
|
|
129
|
+
justify-content: flex-end;
|
|
130
|
+
}
|
|
131
|
+
.${t}-item-a .${t}-title-h-right,
|
|
132
|
+
.${t}-item-b .${t}-title-h-right,
|
|
133
|
+
.${t}-item-c .${t}-title-h-right,
|
|
134
|
+
.${t}-single-title-layer .${t}-title-h-right {
|
|
135
|
+
padding-right: var(--${t}-title-right-padding, 0);
|
|
136
|
+
}
|
|
137
|
+
.${t}-item-a .${t}-title,
|
|
138
|
+
.${t}-item-c .${t}-title {
|
|
139
|
+
flex: 1;
|
|
140
|
+
width: auto;
|
|
141
|
+
min-width: 0;
|
|
142
|
+
overflow: visible;
|
|
143
|
+
}
|
|
144
|
+
.${t}-item-b .${t}-title,
|
|
145
|
+
.${t}-single-title-layer .${t}-title {
|
|
146
|
+
width: 100%;
|
|
147
|
+
pointer-events: none;
|
|
148
|
+
}
|
|
149
|
+
.${t}-gallery {
|
|
150
|
+
display: flex;
|
|
151
|
+
flex-direction: column;
|
|
152
|
+
align-items: center;
|
|
153
|
+
flex-shrink: 0;
|
|
154
|
+
box-sizing: border-box;
|
|
155
|
+
}
|
|
156
|
+
.${t}-item-b .${t}-gallery {
|
|
157
|
+
display: grid;
|
|
158
|
+
width: 100%;
|
|
159
|
+
}
|
|
160
|
+
.${t}-item-b .${t}-gallery-media {
|
|
161
|
+
grid-area: 1 / 1;
|
|
162
|
+
display: flex;
|
|
163
|
+
flex-direction: column;
|
|
164
|
+
align-items: center;
|
|
165
|
+
width: 100%;
|
|
166
|
+
min-width: 0;
|
|
167
|
+
}
|
|
168
|
+
.${t}-item-b .${t}-title-layer {
|
|
169
|
+
grid-area: 1 / 1;
|
|
170
|
+
align-self: stretch;
|
|
171
|
+
width: 100%;
|
|
172
|
+
min-width: 0;
|
|
173
|
+
z-index: 2;
|
|
174
|
+
overflow: visible;
|
|
175
|
+
pointer-events: none;
|
|
176
|
+
display: flex;
|
|
177
|
+
flex-direction: column;
|
|
178
|
+
justify-content: flex-start;
|
|
179
|
+
}
|
|
180
|
+
.${t}-gallery-item {
|
|
181
|
+
position: relative;
|
|
182
|
+
display: flex;
|
|
183
|
+
flex-direction: column;
|
|
184
|
+
align-items: center;
|
|
185
|
+
width: 100%;
|
|
186
|
+
}
|
|
187
|
+
.${t}-gallery-image,
|
|
188
|
+
.${t}-gallery-video {
|
|
189
|
+
display: block;
|
|
190
|
+
max-width: 100%;
|
|
191
|
+
height: auto;
|
|
192
|
+
}
|
|
193
|
+
.${t}-gallery-controls {
|
|
194
|
+
position: relative;
|
|
195
|
+
display: flex;
|
|
196
|
+
flex-shrink: 0;
|
|
197
|
+
box-sizing: border-box;
|
|
198
|
+
z-index: 1;
|
|
199
|
+
}
|
|
200
|
+
.${t}-gallery-edge-spacer {
|
|
201
|
+
flex-shrink: 0;
|
|
202
|
+
}
|
|
203
|
+
.${t}-control-anchor {
|
|
204
|
+
position: absolute;
|
|
205
|
+
pointer-events: none;
|
|
206
|
+
z-index: 2;
|
|
207
|
+
}
|
|
208
|
+
.${t}-padding-handle {
|
|
209
|
+
width: 100%;
|
|
210
|
+
flex-shrink: 0;
|
|
211
|
+
background: transparent;
|
|
212
|
+
}
|
|
213
|
+
.${t}-text-tight-leading {
|
|
214
|
+
flex-shrink: 0;
|
|
215
|
+
padding-top: var(--${t}-title-leading-gap, 0);
|
|
216
|
+
padding-bottom: var(--${t}-title-leading-gap, 0);
|
|
217
|
+
}
|
|
218
|
+
.${t}-description-tight-leading {
|
|
219
|
+
flex-shrink: 0;
|
|
220
|
+
padding-top: var(--${t}-description-leading-gap, 0);
|
|
221
|
+
padding-bottom: var(--${t}-description-leading-gap, 0);
|
|
222
|
+
}
|
|
223
|
+
.${t}-lightbox-counter {
|
|
224
|
+
margin: 0;
|
|
225
|
+
color: var(--${t}-lightbox-counter-color);
|
|
226
|
+
}
|
|
227
|
+
.${t}-lightbox {
|
|
228
|
+
position: fixed;
|
|
229
|
+
inset: 0;
|
|
230
|
+
z-index: 9997;
|
|
231
|
+
overscroll-behavior: none;
|
|
232
|
+
overflow: hidden;
|
|
233
|
+
}
|
|
234
|
+
.${t}-lightbox-editor {
|
|
235
|
+
inset: auto;
|
|
236
|
+
top: var(--cntrl-article-top, 0);
|
|
237
|
+
left: var(--cntrl-article-left, 0);
|
|
238
|
+
width: var(--cntrl-article-width, 100vw) !important;
|
|
239
|
+
height: var(--cntrl-viewport-height, 100vh) !important;
|
|
240
|
+
}
|
|
241
|
+
.${t}-close-icon {
|
|
242
|
+
position: relative;
|
|
243
|
+
flex-shrink: 0;
|
|
244
|
+
pointer-events: auto;
|
|
245
|
+
z-index: 2;
|
|
246
|
+
display: flex;
|
|
247
|
+
align-items: center;
|
|
248
|
+
justify-content: center;
|
|
249
|
+
border: none;
|
|
250
|
+
background-color: transparent;
|
|
251
|
+
padding: 0;
|
|
252
|
+
}
|
|
253
|
+
.${t}-close-icon-inner {
|
|
254
|
+
all: unset;
|
|
255
|
+
position: relative;
|
|
256
|
+
cursor: pointer;
|
|
257
|
+
width: 100%;
|
|
258
|
+
height: 100%;
|
|
259
|
+
pointer-events: auto;
|
|
260
|
+
}
|
|
261
|
+
.${t}-close-icon-img {
|
|
262
|
+
position: absolute;
|
|
263
|
+
top: 50%;
|
|
264
|
+
left: 50%;
|
|
265
|
+
transform: translate(-50%, -50%);
|
|
266
|
+
}
|
|
267
|
+
`}const be={"left-top":{horizontal:"left",vertical:"top"},"top-center":{horizontal:"center",vertical:"top"},"top-right":{horizontal:"right",vertical:"top"},"left-center":{horizontal:"left",vertical:"center"},center:{horizontal:"center",vertical:"center"},"right-center":{horizontal:"right",vertical:"center"},"left-bottom":{horizontal:"left",vertical:"bottom"},"bottom-center":{horizontal:"center",vertical:"bottom"},"right-bottom":{horizontal:"right",vertical:"bottom"}};function Ye(t){return t in be}function Ze(t){if(t&&Ye(t))return t;switch(t){case"center-top":return"top-center";case"right-top":return"top-right";case"top-left":return"left-top";case"center-bottom":return"bottom-center";case"bottom-left":return"left-bottom";case"bottom-right":return"right-bottom";case"center-center":return"center";case"left":return"left-center";case"right":return"right-center";case"top":return"left-top";default:return"center"}}function ne(t){return be[t]}const Je="rgba(28,31,34,0.9)",rt=500,ft="cubic-bezier(0.22, 1, 0.36, 1)",Qe=72,Pe=50,tn={titleColor:"title-color",descriptionColor:"description-color",lightboxCounterColor:"lightbox-counter-color"},en=[];function nn(t){if(!Array.isArray(t)||t.length===0)return!1;const e=t[0];return e!==null&&typeof e=="object"&&"media"in e&&Array.isArray(e.media)}function on(t){const[e,o]=t.media;return o!=null&&o.assetId?o:e!=null&&e.assetId?e:null}function rn(t){const[e]=t.media;return e!=null&&e.assetId?e:null}function ln(t){if(!Array.isArray(t)||t.length===0)return[];if(nn(t)){const e=[];for(const o of t){const r=on(o);if(!r)continue;const l=rn(o);e.push({displayMedia:r,lightboxMedia:l!=null&&l.assetId?l:null})}return e}return t.filter(e=>e==null?void 0:e.assetId).map(e=>({displayMedia:e,lightboxMedia:e}))}function ee(t){return t.type==="video"}function an(t){t.pause(),t.removeAttribute("src"),t.load()}function Ht(t){const e=t.getBoundingClientRect();return{width:e.width,height:e.height,left:e.left,top:e.top}}function sn(t){return t instanceof HTMLVideoElement?{width:t.videoWidth,height:t.videoHeight}:{width:t.naturalWidth,height:t.naturalHeight}}const cn=1140/1440;function dn(t){return typeof t=="string"?{display:t.toLowerCase()==="cover"?"cover":"fit",ratioValue:"2:3",reversed:!1}:{display:(typeof(t==null?void 0:t.display)=="string"?t.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(t==null?void 0:t.ratioValue)??"2:3",reversed:(t==null?void 0:t.reversed)??!1}}function hn(t){const e=t.ratioValue??"1:1",o=t.reversed??!1,[r,l]=e.split(":").map(Number);return`${o?l:r} / ${o?r:l}`}function un(t){return typeof t=="string"?t==="cover"?"cover":"fit":(t==null?void 0:t.display)==="cover"?"cover":"fit"}function pn({src:t,phase:e,mediaRef:o,mediaStyle:r,onLoadedMetadata:l,onClick:h,onMouseMove:i,onTransitionEnd:p}){return a.useEffect(()=>{const s=o.current;if(s)return()=>{an(s)}},[t,o]),n.jsx("video",{ref:o,src:t,controls:e==="open",playsInline:!0,preload:"auto",onLoadedMetadata:l,onClick:h,onMouseMove:i,onTransitionEnd:p,style:r})}const fn="https://cdn.cntrl.site/component-assets/defaultCloseIcon.svg",gn=.004;function mn({prefix:t,closeIcon:e=fn,closeIconMaxWidth:o=.0125,closeIconColor:r="#FFFFFF",closeIconHoverColor:l="#999999",iconMarginRight:h=.01,contentMarginTop:i=.01,isEditor:p,isPreviewMode:s,isEditMode:u,visible:d,onClose:v}){if(!e)return null;const I=at.scalingValue(o,p),G=at.scalingValue(h,p),N=at.scalingValue(i,p),z=at.scalingValue(Math.max(i,gn),p);return n.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,zIndex:1e4,display:"flex",flexDirection:"column",alignItems:"flex-end",pointerEvents:"none",opacity:d?1:0,transition:"opacity 500ms cubic-bezier(0.22, 1, 0.36, 1)"},children:[n.jsx("div",{style:{position:"relative",width:"100%",height:N,flexShrink:0},children:u&&n.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-min":"0",className:`${t}-control`,style:{position:"absolute",top:0,left:0,width:"100%",height:z,pointerEvents:d?"auto":"none"}})}),n.jsxs("div",{className:`${t}-close-icon`,style:{width:I,height:I,marginRight:G,pointerEvents:d?"auto":"none"},onClick:M=>M.stopPropagation(),children:[n.jsx("button",{type:"button",className:`${t}-close-icon-inner`,"aria-label":"Close",onClick:M=>{M.stopPropagation(),v()},children:n.jsx(Ge.SvgImage,{url:e,fill:r,hoverFill:p&&!s?r:l,className:`${t}-close-icon-img`})}),u&&n.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${t}-control`,style:{position:"absolute",top:0,left:"100%",width:G,height:"100%",pointerEvents:d?"auto":"none"}})]})]})}function xn({prefix:t,items:e,index:o,imageDisplay:r,isEditor:l,isPreviewMode:h,isEditMode:i,onClose:p,onPrev:s,onNext:u,counterClassName:d,counterStyle:v,backgroundColor:I,closeIcon:G,closeIconMaxWidth:N,closeIconColor:z,closeIconHoverColor:M,iconMarginRight:O,contentMarginTop:st}){const ct=r==="cover",D=a.useRef(null),E=a.useRef(null),L=a.useRef(null),b=a.useRef(0),m=a.useRef(0),$=a.useRef("none"),q=a.useRef(!1),A=a.useRef(!1),X=a.useRef(!1),K=a.useRef(null),[f,V]=a.useState(null),[w,R]=a.useState("opening"),[Q,gt]=a.useState(0),[jt,P]=a.useState(0),[T,tt]=a.useState(!1),[et,U]=a.useState(!1),[x,Vt]=a.useState(!1),Lt=a.useRef(o),Y=e[o],mt=Y?ee(Y):!1,xt=jt!==0||T,Z=a.useCallback(c=>{X.current=c,tt(c)},[]),F=a.useCallback(()=>{K.current!==null&&(window.clearTimeout(K.current),K.current=null)},[]),St=a.useCallback(()=>{F(),K.current=window.setTimeout(()=>{F(),Z(!1)},rt+32)},[F,Z]),dt=a.useCallback(()=>{const c=D.current,g=E.current;if(!c)return;const C=c.getBoundingClientRect(),k=C.width,W=C.height;if(!k||!W)return;if(r==="cover"){V({width:k,height:W,left:C.left,top:C.top});return}if(!g){V(Ht(c));return}const{width:_,height:ot}=sn(g);if(!_||!ot){V(Ht(c));return}const B=_/ot,y=k/W;if(B>y){const S=k/B;V({width:k,height:S,left:C.left,top:C.top+(W-S)/2})}else{const S=W*B;V({width:S,height:W,left:C.left+(k-S)/2,top:C.top})}},[r]);a.useEffect(()=>{dt();const c=D.current;if(!c)return;const g=new ResizeObserver(()=>dt());return g.observe(c),()=>g.disconnect()},[dt,o]),a.useEffect(()=>{w==="opening"&&f&&R("open")},[w,f]),a.useEffect(()=>{if(w!=="closing")return;const c=setTimeout(()=>p(),rt);return()=>clearTimeout(c)},[w,p]),a.useEffect(()=>()=>{F()},[F]),a.useLayoutEffect(()=>{if(Lt.current===o)return;F(),gt(0),P(0),Z(!1),Vt(!1),U(!1),b.current=0,m.current=0,$.current="none",q.current=!1,L.current=null,A.current=!1;const c=D.current;c&&V(Ht(c)),Lt.current=o},[o,Z,F]),a.useEffect(()=>{if(w!=="open")return;let c=null;const g=()=>{c&&(document.removeEventListener("click",c,!0),c=null)},C=()=>{g(),c=y=>{y.stopPropagation(),y.preventDefault(),g()},document.addEventListener("click",c,!0)},k=y=>{F(),X.current=!1,tt(!1),P(0),U(!1),q.current=!1,m.current=0,$.current="none";const S=D.current;S&&V(Ht(S)),y<0?u():s()},W=y=>{if(Math.abs(y)>Pe&&e.length>1){k(y);return}Z(!0),P(0),St()},_=y=>{if(y.touches.length!==1||X.current)return;const S=y.touches[0];A.current=!0,L.current={x:S.clientX,y:S.clientY},$.current="none",m.current=0,q.current=!1},ot=y=>{if(!L.current||y.touches.length!==1||X.current)return;const S=y.touches[0],pt=S.clientX-L.current.x,J=S.clientY-L.current.y;if($.current==="none"){if(Math.abs(pt)<10&&Math.abs(J)<10)return;if(Math.abs(pt)>Math.abs(J)){if(e.length<=1)return;$.current="horizontal"}else if(J>0)$.current="vertical";else return}if($.current==="horizontal"){q.current=!0,U(!0),m.current=pt,P(pt),y.preventDefault();return}$.current==="vertical"&&(q.current=!0,U(!0),b.current=J,gt(J),y.preventDefault())},B=()=>{if(!L.current)return;const y=$.current,S=q.current;if(S&&y==="horizontal")W(m.current),C();else if(S&&y==="vertical")if(b.current>Qe){const J=window.innerHeight;b.current=J,Vt(!0),gt(J),R("closing")}else b.current=0,gt(0),C();else y==="horizontal"&&Math.abs(m.current)>0&&(W(m.current),C());L.current=null,$.current="none",m.current=0,q.current=!1,U(!1)};return document.addEventListener("touchstart",_,{passive:!0}),document.addEventListener("touchmove",ot,{passive:!1}),document.addEventListener("touchend",B),document.addEventListener("touchcancel",B),()=>{document.removeEventListener("touchstart",_),document.removeEventListener("touchmove",ot),document.removeEventListener("touchend",B),document.removeEventListener("touchcancel",B),g()}},[w,e.length,u,s,Z,St,F]),a.useEffect(()=>{const c=g=>{g.key==="Escape"&&(g.preventDefault(),g.stopPropagation(),w!=="closing"&&R("closing"))};return window.addEventListener("keydown",c,!0),()=>window.removeEventListener("keydown",c,!0)},[w]);const Rt=()=>{w!=="closing"&&R("closing")},nt=w==="open",kt=w==="closing",_t=Q>0?Math.max(0,1-Q/500):1,Nt=Q>0?Math.max(.35,1-Q/500):1,Mt=c=>{if(c.stopPropagation(),A.current){A.current=!1;return}if(e.length<=1)return;const g=c.currentTarget.getBoundingClientRect(),C=c.clientY-g.top,k=Math.min(52,g.height*.2);if(!(C>g.height-k)){if(c.clientX-g.left<g.width/2){s();return}u()}},zt=c=>{if(e.length<=1)return;const g=c.currentTarget.getBoundingClientRect(),C=c.clientX-g.left,k=c.clientY-g.top,W=Math.min(52,g.height*.2);if(k>g.height-W){c.currentTarget.style.cursor="default";return}c.currentTarget.style.cursor=C<g.width/2?"w-resize":"e-resize"},Dt=a.useCallback(c=>{c.propertyName!=="transform"||!X.current||(F(),Z(!1))},[F,Z]),Bt=xt?`translateX(${jt}px)`:Q>0?`translateY(${Q}px)`:void 0,ht={position:"fixed",top:f==null?void 0:f.top,left:f==null?void 0:f.left,width:f==null?void 0:f.width,height:f==null?void 0:f.height,objectFit:r==="cover"?"cover":"contain",transform:Bt,opacity:Q>0?Nt:w==="opening"||kt?0:1,transition:et&&!T?"none":T?`transform ${rt}ms ${ft}`:x?`transform ${rt}ms ${ft}, opacity ${rt}ms ${ft}`:w==="opening"||kt?`opacity ${rt}ms ${ft}`:"none",pointerEvents:mt&&nt&&!xt?"auto":"none",touchAction:mt&&nt?"none":void 0,zIndex:9998},ut=f?{position:"fixed",top:f.top,height:f.height,width:f.width/2,zIndex:9999}:null;return n.jsxs("div",{className:[`${t}-lightbox`,l?`${t}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:w==="open"?"none":void 0},onClick:Rt,children:[n.jsx("div",{style:{position:"absolute",inset:0,background:I,opacity:nt?_t:0,transition:et?"none":`opacity ${rt}ms ${ft}`,pointerEvents:"none"}}),n.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:ct?n.jsxs(n.Fragment,{children:[n.jsx("div",{ref:D,style:{position:"absolute",inset:0}}),n.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:nt?1:0,transition:`opacity ${rt}ms ${ft}`,pointerEvents:"none",zIndex:9999},children:e.length>1&&n.jsxs("p",{className:d,style:v,children:[o+1," / ",e.length]})})]}):n.jsxs(n.Fragment,{children:[n.jsx("div",{style:{height:"10%"}}),n.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:n.jsx("div",{ref:D,style:{width:"100%",height:"100%"}})}),n.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:nt?1:0,transition:`opacity ${rt}ms ${ft}`},children:e.length>1&&n.jsxs("p",{className:d,style:v,children:[o+1," / ",e.length]})})]})}),f&&Y&&(mt?n.jsx(pn,{src:Y.assetId,phase:w,mediaRef:E,mediaStyle:ht,onLoadedMetadata:dt,onClick:Mt,onMouseMove:zt,onTransitionEnd:Dt},`${o}-${Y.assetId}`):n.jsx("img",{ref:E,src:Y.assetId,alt:Y.name,onLoad:dt,onTransitionEnd:Dt,style:ht},`${o}-${Y.assetId}`)),nt&&ut&&e.length>1&&!mt&&n.jsxs(n.Fragment,{children:[n.jsx("div",{style:{...ut,left:f.left,cursor:"w-resize",pointerEvents:xt?"none":"auto"},onClick:c=>{if(A.current){A.current=!1;return}c.stopPropagation(),s()}}),n.jsx("div",{style:{...ut,left:f.left+f.width/2,cursor:"e-resize",pointerEvents:xt?"none":"auto"},onClick:c=>{if(A.current){A.current=!1;return}c.stopPropagation(),u()}})]}),n.jsx(mn,{prefix:t,closeIcon:G,closeIconMaxWidth:N,closeIconColor:z,closeIconHoverColor:M,iconMarginRight:O,contentMarginTop:st,isEditor:l,isPreviewMode:h,isEditMode:i,visible:nt,onClose:Rt})]})}function xe({P:t,media:e,imgWidth:o,cornerRadius:r,fillGalleryWidth:l,imageDisplay:h,isEditor:i,galleryPaddingBetween:p=0,showPaddingAfter:s=!1,showControls:u=!1,onMediaClick:d}){const v=`${t}-gallery-${ee(e)?"video":"image"}`,I=h.display==="cover",G=hn(h),N=m=>at.scalingValue(m,i??!1),z=o??bt,M=l?{width:"100%",maxWidth:"100%"}:{width:N(z),maxWidth:"100%"},O=r?{borderRadius:N(r)}:{},st={...M,...I?{aspectRatio:G,height:"auto",overflow:"hidden"}:{},...O},ct={...I?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:l?"100%":N(z)},...d?{cursor:"pointer",pointerEvents:"auto"}:{},...I?{}:O},E={className:v,style:ct,onClick:d?m=>{m.stopPropagation(),d()}:void 0},L=Math.max(p,lt),b=ee(e)?n.jsx(qe.LazyVideo,{...E,src:e.assetId,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):n.jsx("img",{...E,src:e.assetId,alt:e.name??""});return n.jsxs("div",{className:`${t}-gallery-item`,children:[I?n.jsx("div",{style:st,children:b}):b,s&&p>0&&n.jsx("div",{className:`${t}-padding-handle`,style:{height:N(p)},"aria-hidden":"true"}),u&&s&&n.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${t}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:N(L)}})]})}function yn({P:t,layoutType:e,galleryWidthStyle:o,galleryPaddingRight:r,galleryPaddingLeft:l,galleryPaddingRightWidth:h,galleryPaddingLeftWidth:i,galleryPaddingMaxFraction:p,showControls:s,scaled:u,children:d}){const v=e==="a"?r:e==="c"?l:0,I=v>0||s;return n.jsxs("div",{className:`${t}-gallery-controls`,children:[e==="c"&&I&&n.jsx("div",{className:`${t}-gallery-edge-spacer`,style:{width:u(v)},"aria-hidden":"true"}),s&&e==="c"&&n.jsx("div",{"data-controls":"galleryPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(p),className:`${t}-control-anchor`,style:{top:0,left:0,width:u(i),height:"100%"}}),n.jsx("div",{className:`${t}-gallery`,style:o,children:d}),e==="a"&&I&&n.jsx("div",{className:`${t}-gallery-edge-spacer`,style:{width:u(v)},"aria-hidden":"true"}),s&&e==="a"&&n.jsx("div",{"data-controls":"galleryPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(p),className:`${t}-control-anchor`,style:{top:0,right:0,width:u(h),height:"100%"}})]})}function vn(t){switch(t){case"fade":case"retype":case"scroll":return t;case"default":return"scroll";default:return"scroll"}}function Ot({P:t,controlKey:e,scaled:o,height:r,paired:l,side:h}){return n.jsx("div",{"data-controls":e,...l?{"data-controls-paired":""}:{},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${t}-control-anchor`,style:{...h==="top"?{top:0}:{bottom:0},left:0,width:"100%",height:o(r)}})}function ye({P:t,controlKey:e,scaled:o,width:r,maxFraction:l,side:h,paired:i,anchorStyle:p}){return n.jsx("div",{"data-controls":e,...i?{"data-controls-paired":""}:{},"data-controls-axis":"x","data-controls-variant":"column-padding",...h==="right"?{"data-controls-reverse":""}:{},"data-controls-min":"0","data-controls-max-fraction":String(l),className:`${t}-control-anchor`,style:{top:0,...h==="left"?{left:0}:{right:0},width:o(r),height:"100%",...p}})}function te({P:t,title:e,description:o,position:r,titleRef:l,titleClassName:h,titleContainerStyle:i,titleTextBoxStyle:p,titleStyle:s,descriptionClassName:u,descriptionStyle:d,descriptionPadding:v,showTextBoxOutline:I=!1,showDescriptionPaddingControl:G=!1,descriptionPaddingPaired:N=!1,topPaddingControl:z,bottomPaddingControl:M}){const O=a.useRef(null),[st,ct]=a.useState(0),D=e??"",E=o??"",L=E.length>0,{horizontal:b,vertical:m}=ne(r),$=m==="center"||m==="bottom",q=m==="bottom";a.useLayoutEffect(()=>{if(!$)return;const f=O.current;if(!f||typeof ResizeObserver>"u")return;const V=()=>ct(f.offsetHeight);V();const w=new ResizeObserver(V);return w.observe(f),()=>w.disconnect()},[D,E,$]);const A=n.jsx("span",{className:`${t}-title-text`,style:s,children:D}),X=L?n.jsx("span",{className:u,style:d,children:E}):null,K=L?n.jsx("div",{className:`${t}-title-texts-gap`,style:{height:v},children:G&&n.jsx("div",{"data-controls":"titleDescriptionPadding",...N?{"data-controls-paired":""}:{},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${t}-control-anchor`,style:{top:0,left:0,width:"100%",height:"100%"}})}):null;return n.jsx("div",{ref:f=>{O.current=f,l(f)},className:[h,`${t}-title-h-${b}`,`${t}-title-v-${m}`].join(" "),style:{...$?{[`--${t}-title-height`]:`${st}px`}:{},...i},children:n.jsxs("div",{className:`${t}-title-text-stack`,style:p,children:[z,n.jsx("div",{className:I?`${t}-title-text-inner`:`${t}-title-text-inner-hidden`,style:{width:"100%"},children:n.jsx("div",{className:`${t}-title-texts`,children:q?n.jsxs(n.Fragment,{children:[X,K,A]}):n.jsxs(n.Fragment,{children:[A,K,X]})})}),M]})})}const ve=45;function $e(t,e,o){let r=t;for(;r;){const l=getComputedStyle(r).getPropertyValue(e).trim();if(l){const h=parseFloat(l);if(!Number.isNaN(h))return h}r=r.parentElement}return o}function $n(t){const e=$e(t,"--cntrl-viewport-height",window.innerHeight),o=$e(t,"--cntrl-article-top",0);return{top:o,height:e,centerY:o+e/2}}function wn(t,e,o){const{vertical:r}=ne(e),{top:l,height:h,centerY:i}=$n(o);if(r==="top"){const s=o&&parseFloat(getComputedStyle(o).top)||l;return Math.abs(t.top-s)}if(r==="bottom")return Math.abs(t.bottom-(l+h));const p=t.top+t.height/2;return Math.abs(p-i)}function bn(t,e,o){const r=Array.from({length:e},(i,p)=>{const s=t.current[p];if(!s)return 0;const u=s.getBoundingClientRect(),d=wn(u,o,s);return Math.exp(-(d*d)/(2*ve*ve))});let l=0,h=-1;return r.forEach((i,p)=>{i>h&&(h=i,l=p)}),{opacities:r,dominantIndex:l}}function Sn(t,e,o){const r=a.useRef([]),[{opacities:l,dominantIndex:h},i]=a.useState(()=>({opacities:Array.from({length:t},(s,u)=>u===0?1:0),dominantIndex:0}));return a.useLayoutEffect(()=>{if(!e||t===0){i({opacities:Array.from({length:t},()=>1),dominantIndex:0});return}let s=0;const u=()=>{i(bn(r,t,o))},d=()=>{s||(s=window.requestAnimationFrame(()=>{s=0,u()}))};return u(),window.addEventListener("scroll",d,{passive:!0}),window.addEventListener("resize",d,{passive:!0}),()=>{s&&window.cancelAnimationFrame(s),window.removeEventListener("scroll",d),window.removeEventListener("resize",d)}},[e,t,o]),{setTitleRef:s=>u=>{r.current[s]=u},opacities:l,dominantIndex:h}}function we(t,e){const[o,r]=a.useState(t),l=a.useRef(t);return a.useEffect(()=>{if(!e){l.current=t,r(t);return}const h=Array.from(l.current),i=Array.from(t),p=Math.max(h.length,i.length);if(p===0||l.current===t)return;let s=0;const u=window.setInterval(()=>{s+=1;const d=[...i.slice(0,s),...h.slice(s)].join("");l.current=d,r(d),s>=p&&window.clearInterval(u)},70);return()=>window.clearInterval(u)},[e,t]),o}function Cn({settings:t,content:e,isEditor:o,isPreviewMode:r,isEditMode:l,portalId:h}){var pe,fe;const{prefix:i}=Be.useScopedStyles(),p=a.useMemo(()=>Ue(i),[i]),s=e??[],u=(t==null?void 0:t.wrapperWidth)??1,d=(t==null?void 0:t.type)??"a",v=(t==null?void 0:t.imgWidth)??bt,I=(t==null?void 0:t.titleWidth)??cn,G=dn(t==null?void 0:t.imageDisplay),N=(t==null?void 0:t.cornerRadius)??Xe,z=Ze(t==null?void 0:t.position),{horizontal:M,vertical:O}=ne(z),st=(t==null?void 0:t.titleTopPadding)??0,ct=(t==null?void 0:t.titleBottomPadding)??0,D=(t==null?void 0:t.titleLeftPadding)??0,E=(t==null?void 0:t.titleRightPadding)??0,L=(t==null?void 0:t.titleDescriptionPadding)??0,b=vn(t==null?void 0:t.transition),m=(t==null?void 0:t.lightbox)??"on",$=d==="b",q=b==="fade"||b==="retype",{setTitleRef:A,dominantIndex:X}=Sn(s.length,q,z),K=((pe=s[X])==null?void 0:pe.title)??"",f=((fe=s[X])==null?void 0:fe.description)??"",V=we(K,b==="retype"),w=we(f,b==="retype"),R=b==="fade"||b==="retype",Q=b==="retype"?V:K,gt=b==="retype"?w:f,jt=$?void 0:{width:at.scalingValue(v,o??!1)},P=m==="on"&&(!o||r||l),T=l??!1,tt=(t==null?void 0:t.galleryPaddingRight)??0,et=(t==null?void 0:t.galleryPaddingLeft)??0,U=(t==null?void 0:t.galleryPaddingBetween)??0,x=j=>at.scalingValue(j,o??!1),Lt={width:x(I)},Y=d==="a"?tt:et,mt=$?{width:"100%"}:{width:`calc(100% - ${x(v)} - ${x(Y)})`,...d==="c"?{marginLeft:"auto"}:{}},xt=Math.max(tt,lt),Z=Math.max(et,lt),F=Math.max(U,lt),St=Math.max(st,lt),dt=Math.max(ct,lt),Rt=Math.max(D,lt),nt=Math.max(E,lt),kt=Math.max(L,lt),_t=Math.max(0,(u??1)-(v??bt)),Nt=d==="a"?Math.max(0,(u??1)-(v??bt)-tt):d==="c"?Math.max(0,(u??1)-(v??bt)-et):d==="b"?u??1:1,Mt=T&&O==="top",zt=T&&O==="bottom",Dt=T&&M==="left",Bt=T&&M==="right",ht=s.length>1,ut=$?void 0:x((d==="c"?et:tt)+(v??bt)),c=d==="c"&&ut?{left:ut}:void 0,g=d==="a"&&ut?{right:ut}:void 0,C=$?{left:0,width:"100%"}:d==="a"?{right:x(tt),width:x(v)}:{left:x(et),width:x(v)},{titleColor:k,titleFontFamily:W,titleFontSettings:_,titleFontSize:ot,titleLineHeight:B,titleLetterSpacing:y,titleWordSpacing:S,titleAlign:pt,titleTextAppearance:J,descriptionColor:oe,descriptionFontFamily:Se,descriptionFontSettings:yt,descriptionFontSize:Gt,descriptionLineHeight:qt,descriptionLetterSpacing:Ce,descriptionWordSpacing:Te,descriptionAlign:Ie,descriptionTextAppearance:je,lightboxCounterColor:ie,lightboxCounterFontFamily:Le,lightboxCounterFontSettings:vt,lightboxCounterFontSize:Xt,lightboxCounterLineHeight:Kt,lightboxCounterLetterSpacing:Re,lightboxCounterWordSpacing:ke,lightboxCounterTextAppearance:Ne}=t??{},Me={fontSettings:{fontFamily:W,fontWeight:(_==null?void 0:_.fontWeight)??400,fontStyle:(_==null?void 0:_.fontStyle)??"normal"},fontSize:ot??.01,lineHeight:B,letterSpacing:y??0,wordSpacing:S??0,textAlign:pt??"left",textAppearance:J,color:k??"#000000"},re=wt.omitTextColors(wt.textStylesToCss(Me,o)),le=Lt,ae={...Pt(ot,B,i,o),...Pt(Gt,qt,i,o,"description-leading-gap")},se=Qt(ot,B,`${i}-title`,`${i}-text-tight-leading`),ze={fontSettings:{fontFamily:Se,fontWeight:(yt==null?void 0:yt.fontWeight)??400,fontStyle:(yt==null?void 0:yt.fontStyle)??"normal"},fontSize:Gt??.01,lineHeight:qt,letterSpacing:Ce??0,wordSpacing:Te??0,textAlign:Ie??"left",textAppearance:je,color:oe??"#000000"},ce=wt.omitTextColors(wt.textStylesToCss(ze,o)),de=Qt(Gt,qt,`${i}-description-text`,`${i}-description-tight-leading`),he=x(T?kt:L),De={fontSettings:{fontFamily:Le,fontWeight:(vt==null?void 0:vt.fontWeight)??400,fontStyle:(vt==null?void 0:vt.fontStyle)??"normal"},fontSize:Xt??.01,lineHeight:Kt,letterSpacing:Re??0,wordSpacing:ke??0,textAppearance:Ne,color:ie??"#DEDDDD"},Ee={...wt.omitTextColors(wt.textStylesToCss(De,o)),...Pt(Xt,Kt,i,o)},Ae=Qt(Xt,Kt,`${i}-lightbox-counter`,`${i}-text-tight-leading`),Ut=_e.buildColorVars(i,{titleColor:k??"#000000",descriptionColor:oe??"#000000",lightboxCounterColor:ie??"#DEDDDD"},tn,en),Yt=a.useRef(null),[Et,At]=a.useState(!1),[Ft,Fe]=a.useState([]),[We,Zt]=a.useState(0),ue=a.useCallback((j,H)=>{P&&(Fe(j),Zt(H),At(!0))},[P]),He=a.useCallback(()=>{At(!1)},[]),Oe=a.useMemo(()=>{const j={...Ut},H=Yt.current?getComputedStyle(Yt.current).getPropertyValue("--cntrl-article-width").trim():"";return H&&(j["--cntrl-article-width"]=H),j},[Ut,Et]);return a.useEffect(()=>{if(!Et||m!=="on"||typeof document>"u")return;const j=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=j}},[Et,m]),a.useEffect(()=>{!o||l||r||At(!1)},[o,l,r]),a.useEffect(()=>{m==="off"&&At(!1)},[m]),n.jsxs(n.Fragment,{children:[n.jsx("style",{dangerouslySetInnerHTML:{__html:p}}),n.jsx("div",{style:Ut,children:n.jsxs("div",{ref:Yt,className:`${i}-wrapper`,style:{width:at.scalingValue(u,o??!1),[`--${i}-title-top-padding`]:O==="top"?x(st):void 0,[`--${i}-title-bottom-padding`]:O==="bottom"?x(ct):void 0,[`--${i}-title-left-padding`]:M==="left"?x(D):void 0,[`--${i}-title-right-padding`]:M==="right"?x(E):void 0},children:[R&&n.jsx("div",{className:`${i}-single-title-layer`,children:n.jsx(te,{P:i,title:Q,description:gt,position:z,titleRef:()=>{},titleClassName:`${se} ${i}-single-title`,titleContainerStyle:{...ae,...mt},titleTextBoxStyle:le,titleStyle:re,descriptionClassName:de,descriptionStyle:ce,descriptionPadding:he,showTextBoxOutline:T,showDescriptionPaddingControl:T,topPaddingControl:Mt?Ot({P:i,controlKey:"titleTopPadding",scaled:x,height:St,paired:!1,side:"top"}):void 0,bottomPaddingControl:zt?Ot({P:i,controlKey:"titleBottomPadding",scaled:x,height:dt,paired:!1,side:"bottom"}):void 0})}),s.map((j,H)=>{const $t=ln(j.gallery),ge=H<s.length-1,Wt=$t.filter(it=>it.lightboxMedia).map(it=>it.lightboxMedia),me={P:i,position:z,titleRef:A(H),titleClassName:se,titleContainerStyle:ae,titleTextBoxStyle:R?{maxWidth:"100%"}:le,titleStyle:re,descriptionClassName:de,descriptionStyle:ce,descriptionPadding:he,showTextBoxOutline:T&&!R,showDescriptionPaddingControl:T&&!R,descriptionPaddingPaired:ht,topPaddingControl:Mt&&!R?Ot({P:i,controlKey:"titleTopPadding",scaled:x,height:St,paired:ht,side:"top"}):void 0,bottomPaddingControl:zt&&!R?Ot({P:i,controlKey:"titleBottomPadding",scaled:x,height:dt,paired:ht,side:"bottom"}):void 0};return n.jsxs("div",{"data-item-index":H,className:`${i}-item ${i}-item-${d}`,style:{paddingBottom:ge?x(U):void 0},children:[Dt&&ye({P:i,controlKey:"titleLeftPadding",scaled:x,width:Rt,maxFraction:Nt,side:"left",paired:ht,anchorStyle:c}),Bt&&ye({P:i,controlKey:"titleRightPadding",scaled:x,width:nt,maxFraction:Nt,side:"right",paired:ht,anchorStyle:g}),T&&ge&&n.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${i}-control-anchor`,style:{bottom:0,height:x(F),...C}}),$?n.jsxs("div",{className:`${i}-gallery`,children:[n.jsx("div",{className:`${i}-gallery-media`,children:$t.map(({displayMedia:it,lightboxMedia:Ct},Tt)=>{const It=Ct?Wt.findIndex(Jt=>Jt.assetId===Ct.assetId):-1;return n.jsx(xe,{P:i,media:it,imgWidth:v||void 0,cornerRadius:N||void 0,imageDisplay:G,isEditor:o,galleryPaddingBetween:U,showPaddingAfter:Tt<$t.length-1,showControls:T,onMediaClick:P&&It>=0?()=>ue(Wt,It):void 0},`${it.assetId}-${Tt}`)})}),n.jsx("div",{className:`${i}-title-layer`,children:n.jsx(te,{...me,title:R?"":j.title,description:R?"":j.description})})]}):n.jsxs(n.Fragment,{children:[n.jsx(te,{...me,title:R?"":j.title,description:R?"":j.description}),$t.length>0&&n.jsx(yn,{P:i,layoutType:d,galleryWidthStyle:jt,galleryPaddingRight:tt,galleryPaddingLeft:et,galleryPaddingRightWidth:xt,galleryPaddingLeftWidth:Z,galleryPaddingMaxFraction:_t,showControls:T,scaled:x,children:$t.map(({displayMedia:it,lightboxMedia:Ct},Tt)=>{const It=Ct?Wt.findIndex(Jt=>Jt.assetId===Ct.assetId):-1;return n.jsx(xe,{P:i,media:it,cornerRadius:N||void 0,fillGalleryWidth:!0,imageDisplay:G,isEditor:o,galleryPaddingBetween:U,showPaddingAfter:Tt<$t.length-1,showControls:T,onMediaClick:P&&It>=0?()=>ue(Wt,It):void 0},`${it.assetId}-${Tt}`)})})]})]},H)})]})}),Et&&m==="on"&&typeof document<"u"&&t&&(()=>{const j=(h?document.getElementById(h):null)??document.body;return Ve.createPortal(n.jsx("div",{style:Oe,"data-selection":"none",children:n.jsx(xn,{prefix:i,items:Ft,index:We,imageDisplay:un(t.lightboxImageDisplay),isEditor:o,isPreviewMode:r,isEditMode:l,closeIcon:t.closeIcon,closeIconMaxWidth:t.closeIconMaxWidth,closeIconColor:t.closeIconColor,closeIconHoverColor:t.closeIconHoverColor,iconMarginRight:t.iconMarginRight,contentMarginTop:t.contentMarginTop,onClose:He,onPrev:()=>Zt(H=>(H-1+Ft.length)%Ft.length),onNext:()=>Zt(H=>(H+1)%Ft.length),counterClassName:Ae,counterStyle:Ee,backgroundColor:t.backgroundColor??Je})}),j)})()]})}exports.Mercury=Cn;
|