@cntrl-site/components 1.0.107-alpha.6 → 1.0.108-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,6 +28,7 @@ type BurgerPosition = 'left-top' | 'center-top' | 'right-top' | 'left-center' |
28
28
  type BurgerSettings = {
29
29
  link?: BurgerLink[];
30
30
  logo?: BurgerLogo | null;
31
+ logoLink?: string;
31
32
  logoMaxWidth?: number;
32
33
  logoMaxHeight?: number;
33
34
  logoPosition?: BurgerLogoPosition;
@@ -111,6 +112,8 @@ type BurgerSettings = {
111
112
  openTextAppearance?: TextStyles['textAppearance'];
112
113
  stateOverrides?: Record<string, Partial<Record<'iconColor' | 'closeButtonColor' | 'linkColor' | 'openLinkColor' | 'compactIconColor' | 'compactLinkColor' | 'compactLogoColor' | 'compactBackgroundColor' | 'openLogoColor' | 'menuBackgroundColor' | 'overlayColor' | 'backgroundColor' | 'logoColor', string>>>;
113
114
  };
115
+ /** The open menu is unavailable when every link is shown in the default state only. */
116
+ export declare function isBurgerOpenMenuAvailable(links: unknown, layoutId?: string): boolean;
114
117
  type BurgerPageRef = {
115
118
  id: string;
116
119
  slug: string;
@@ -96,6 +96,15 @@ export declare const BurgerComponent: {
96
96
  };
97
97
  };
98
98
  };
99
+ logoLink: {
100
+ type: "string";
101
+ scope: "common";
102
+ title: string;
103
+ message: string;
104
+ display: {
105
+ type: string;
106
+ };
107
+ };
99
108
  logoMaxHeight: {
100
109
  type: "number";
101
110
  scope: "layout";
@@ -567,6 +576,7 @@ export declare const BurgerComponent: {
567
576
  mode: string;
568
577
  icon: string;
569
578
  };
579
+ logoLink: string;
570
580
  backgroundColor: string;
571
581
  logoColor: string;
572
582
  iconColor: string;
@@ -857,6 +867,25 @@ export declare const BurgerComponent: {
857
867
  })[];
858
868
  availableWhen: {
859
869
  navigationPosition: string[];
870
+ openMenu?: undefined;
871
+ };
872
+ } | {
873
+ id: string;
874
+ icon: string;
875
+ title: string;
876
+ tooltip: string;
877
+ layout: (string | {
878
+ type: "row";
879
+ title: string;
880
+ items: string[];
881
+ } | {
882
+ type: "row";
883
+ items: string[];
884
+ title?: undefined;
885
+ })[];
886
+ availableWhen: {
887
+ openMenu: string[];
888
+ navigationPosition?: undefined;
860
889
  };
861
890
  })[];
862
891
  paletteBookmark: {
@@ -892,4 +921,7 @@ export declare const BurgerComponent: {
892
921
  openFontSettings: string;
893
922
  compactFontSettings: string;
894
923
  };
924
+ getPanelAvailabilityContext: (settings: Record<string, any>, layoutId?: string) => {
925
+ openMenu: string;
926
+ };
895
927
  };
@@ -1,5 +1,6 @@
1
1
  import { CommonComponentProps } from '../props';
2
2
  import { HiveLightboxTitleSettings } from './HiveLightboxTitles';
3
+ import { TextStyles } from '../utils/textStylesToCss';
3
4
  type GridLayoutConfig = {
4
5
  entryWidth: number;
5
6
  horizontalGap: number;
@@ -8,8 +9,23 @@ type GridLayoutConfig = {
8
9
  lockedParam?: 'wrapperWidth' | 'entryWidth' | 'horizontalGap' | null;
9
10
  };
10
11
  type HiveSettings = {
12
+ type?: 'a' | 'b';
11
13
  gridLayout: GridLayoutConfig;
12
14
  verticalGap: number;
15
+ textBoxWidth?: number;
16
+ textMarginTop?: number;
17
+ entryTitleColor?: string;
18
+ entryTitleFontFamily?: string;
19
+ entryTitleFontSettings?: {
20
+ fontWeight: number;
21
+ fontStyle: string;
22
+ };
23
+ entryTitleFontSize?: number;
24
+ entryTitleLineHeight?: number;
25
+ entryTitleLetterSpacing?: number;
26
+ entryTitleWordSpacing?: number;
27
+ entryTitleTextAlign?: TextStyles['textAlign'];
28
+ entryTitleTextAppearance?: TextStyles['textAppearance'];
13
29
  align?: 'top' | 'center' | 'bottom';
14
30
  imageDisplay: {
15
31
  display: 'fit' | 'cover';
@@ -32,6 +32,8 @@ export declare const HiveComponent: {
32
32
  path: string;
33
33
  }[];
34
34
  };
35
- fontRelations: {};
35
+ fontRelations: {
36
+ entryTitleFontSettings: string;
37
+ };
36
38
  schema: ComponentSchemaV1;
37
39
  };
@@ -0,0 +1,328 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),Wt=require("./scalingValue-CSHYgTZl.js"),on=require("./useScopedStyles-Bf6yohVQ.js"),sn=require("./useLazyVideos-CdCbc2j0.js"),st=require("./EmbedMediaFrame-DsOTKE4i.js"),ln=require("./LazyVideo-imbU18js.js"),r=require("react"),an=require("react-dom"),cn=require("./HiveLightboxTitles-DlyptAaK.js"),un=require("./getImageRect-BQhQXvT8.js"),fn=require("./textStylesToCss-CNN3zZTV.js");function dn(t){return`calc(var(--cntrl-article-width, 100vw) * ${t/1440})`}function hn(t){return`
2
+ .${t}-wrapper {
3
+ display: grid;
4
+ align-items: start;
5
+ justify-content: center;
6
+ min-height: ${dn(48)};
7
+ }
8
+ .${t}-item {
9
+ display: flex;
10
+ flex-direction: column;
11
+ justify-content: center;
12
+ align-items: center;
13
+ }
14
+ .${t}-item-inner {
15
+ display: flex;
16
+ flex-direction: column;
17
+ align-items: center;
18
+ outline: 1px solid #FF5C02;
19
+ }
20
+ .${t}-item-inner-hidden {
21
+ display: flex;
22
+ flex-direction: column;
23
+ align-items: center;
24
+ }
25
+ .${t}-item-image-wrapper {
26
+ display: flex;
27
+ justify-content: center;
28
+ align-items: center;
29
+ align-self: center;
30
+ }
31
+ .${t}-item-image-link {
32
+ width: 100%;
33
+ display: flex;
34
+ flex-direction: column;
35
+ align-items: center;
36
+ }
37
+ .${t}-item-image {
38
+ width: 100%;
39
+ height: 100%;
40
+ display: block;
41
+ max-width: 100%;
42
+ }
43
+ .${t}-item-video {
44
+ width: 100%;
45
+ height: 100%;
46
+ display: block;
47
+ max-width: 100%;
48
+ }
49
+ .${t}-image-align-top .${t}-item-image-wrapper {
50
+ align-items: flex-start;
51
+ }
52
+ .${t}-image-align-center .${t}-item-image-wrapper {
53
+ align-items: center;
54
+ }
55
+ .${t}-image-align-bottom .${t}-item-image-wrapper {
56
+ align-items: flex-end;
57
+ }
58
+ .${t}-align-entries .${t}-item {
59
+ display: contents;
60
+ }
61
+ .${t}-align-entries .${t}-item-inner,
62
+ .${t}-align-entries .${t}-item-inner-hidden {
63
+ display: grid;
64
+ grid-template-rows: subgrid;
65
+ grid-row: span 3;
66
+ justify-self: center;
67
+ margin-bottom: var(--${t}-align-entries-row-gap, 0);
68
+ }
69
+ .${t}-align-entries .${t}-item-inner-last-row {
70
+ margin-bottom: 0;
71
+ }
72
+ .${t}-align-entries .${t}-item-title-row,
73
+ .${t}-align-entries .${t}-item-subtitle-row {
74
+ display: flex;
75
+ flex-direction: column;
76
+ align-items: center;
77
+ width: 100%;
78
+ min-height: 100%;
79
+ }
80
+ .${t}-align-entries .${t}-item-image-link {
81
+ width: 100%;
82
+ height: 100%;
83
+ min-height: 100%;
84
+ display: flex;
85
+ flex-direction: column;
86
+ align-items: center;
87
+ justify-content: flex-start;
88
+ }
89
+ .${t}-align-entries .${t}-item-image-link > .${t}-item-image-wrapper {
90
+ flex-shrink: 0;
91
+ height: auto;
92
+ align-self: auto;
93
+ }
94
+ .${t}-image-align-top.${t}-align-entries .${t}-item-image-link > .${t}-item-image-wrapper {
95
+ margin-top: 0;
96
+ margin-bottom: auto;
97
+ }
98
+ .${t}-image-align-center.${t}-align-entries .${t}-item-image-link > .${t}-item-image-wrapper {
99
+ margin-top: auto;
100
+ margin-bottom: auto;
101
+ }
102
+ .${t}-image-align-bottom.${t}-align-entries .${t}-item-image-link > .${t}-item-image-wrapper {
103
+ margin-top: auto;
104
+ margin-bottom: 0;
105
+ }
106
+ .${t}-image-align-top.${t}-align-entries .${t}-item-image-wrapper {
107
+ align-items: flex-start;
108
+ }
109
+ .${t}-image-align-center.${t}-align-entries .${t}-item-image-wrapper {
110
+ align-items: center;
111
+ }
112
+ .${t}-image-align-bottom.${t}-align-entries .${t}-item-image-wrapper {
113
+ align-items: flex-end;
114
+ }
115
+ .${t}-image-align-top.${t}-align-entries .${t}-item-image-link {
116
+ justify-content: flex-start;
117
+ }
118
+ .${t}-image-align-center.${t}-align-entries .${t}-item-image-link {
119
+ justify-content: center;
120
+ }
121
+ .${t}-image-align-bottom.${t}-align-entries .${t}-item-image-link {
122
+ justify-content: flex-end;
123
+ }
124
+ .${t}-titles-row {
125
+ position: relative;
126
+ flex: 0 1 auto;
127
+ z-index: 2;
128
+ box-sizing: border-box;
129
+ pointer-events: none;
130
+ word-break: break-word;
131
+ min-width: 0;
132
+ display: flex;
133
+ flex-direction: row;
134
+ align-items: baseline;
135
+ }
136
+ .${t}-titles-row-header {
137
+ flex: 1;
138
+ align-items: baseline;
139
+ }
140
+ .${t}-titles-row-header-controls {
141
+ display: flex;
142
+ flex-direction: row;
143
+ align-items: baseline;
144
+ flex-shrink: 0;
145
+ }
146
+ .${t}-close-icon {
147
+ position: relative;
148
+ flex-shrink: 0;
149
+ align-self: center;
150
+ pointer-events: auto;
151
+ z-index: 2;
152
+ display: flex;
153
+ align-items: center;
154
+ justify-content: center;
155
+ border: none;
156
+ background-color: transparent;
157
+ padding: 0;
158
+ }
159
+ .${t}-close-icon-inner {
160
+ all: unset;
161
+ position: relative;
162
+ cursor: pointer;
163
+ width: 100%;
164
+ height: 100%;
165
+ pointer-events: auto;
166
+ }
167
+ .${t}-close-icon-img {
168
+ position: absolute;
169
+ top: 50%;
170
+ left: 50%;
171
+ transform: translate(-50%, -50%);
172
+ }
173
+ .${t}-titles-baseline-strut {
174
+ width: 0;
175
+ overflow: hidden;
176
+ flex-shrink: 0;
177
+ pointer-events: none;
178
+ white-space: nowrap;
179
+ }
180
+ .${t}-titles-row-titles {
181
+ position: relative;
182
+ flex: 1;
183
+ min-width: 0;
184
+ align-self: flex-start;
185
+ }
186
+ .${t}-titles-stack {
187
+ position: relative;
188
+ display: flex;
189
+ flex-direction: row;
190
+ align-items: baseline;
191
+ align-self: flex-start;
192
+ min-width: 0;
193
+ }
194
+ .${t}-titles-row-two-row {
195
+ display: flex;
196
+ flex: 1;
197
+ height: 100%;
198
+ min-height: 0;
199
+ align-self: stretch;
200
+ flex-direction: column;
201
+ width: 100%;
202
+ }
203
+ .${t}-titles-row-top {
204
+ display: flex;
205
+ flex-direction: row;
206
+ align-items: baseline;
207
+ width: 100%;
208
+ flex-shrink: 0;
209
+ margin-bottom: 0;
210
+ }
211
+ .${t}-titles-row-top .${t}-title-cell[data-title="title1"] {
212
+ flex: 0 0 auto;
213
+ min-width: 0;
214
+ }
215
+ .${t}-titles-row-bottom-wrap {
216
+ display: flex;
217
+ flex-direction: column;
218
+ width: 100%;
219
+ margin-top: auto;
220
+ flex-shrink: 0;
221
+ }
222
+ .${t}-titles-row-bottom-area {
223
+ position: relative;
224
+ flex: 1;
225
+ min-height: 0;
226
+ display: flex;
227
+ flex-direction: column;
228
+ width: 100%;
229
+ }
230
+ .${t}-titles-row-bottom {
231
+ position: relative;
232
+ display: flex;
233
+ flex-direction: row;
234
+ align-items: flex-end;
235
+ width: 100%;
236
+ }
237
+ .${t}-titles-row-bottom .${t}-title-cell {
238
+ flex: 0 0 auto;
239
+ }
240
+ .${t}-title-cell {
241
+ position: relative;
242
+ flex: 0 0 auto;
243
+ min-width: 0;
244
+ box-sizing: border-box;
245
+ }
246
+ .${t}-text-bar-cell {
247
+ position: relative;
248
+ flex: 0 1 auto;
249
+ min-width: 0;
250
+ display: flex;
251
+ align-items: baseline;
252
+ }
253
+ .${t}-title1,
254
+ .${t}-title2,
255
+ .${t}-title3 {
256
+ margin: 0;
257
+ min-width: 0;
258
+ }
259
+ .${t}-title-resize-handle {
260
+ background: transparent;
261
+ }
262
+ .${t}-lightbox {
263
+ position: fixed;
264
+ inset: 0;
265
+ z-index: 9997;
266
+ overscroll-behavior: none;
267
+ overflow: hidden;
268
+ }
269
+ .${t}-lightbox-editor {
270
+ inset: auto;
271
+ top: var(--cntrl-article-top, 0);
272
+ left: var(--cntrl-article-left, 0);
273
+ width: var(--cntrl-article-width, 100vw) !important;
274
+ height: var(--cntrl-viewport-height, 100vh) !important;
275
+ }
276
+ .${t}-lightbox-edit-mode {
277
+ z-index: 1;
278
+ }
279
+ .${t}-lightbox-dismiss-area {
280
+ position: relative;
281
+ width: 100%;
282
+ height: 100%;
283
+ }
284
+ .${t}-lightbox-overlay-content {
285
+ position: absolute;
286
+ inset: 0;
287
+ z-index: 3;
288
+ pointer-events: none;
289
+ display: flex;
290
+ flex-direction: column;
291
+ isolation: isolate;
292
+ }
293
+ .${t}-lightbox-content-area {
294
+ position: relative;
295
+ display: flex;
296
+ flex-direction: row;
297
+ align-items: flex-start;
298
+ flex: 1;
299
+ min-width: 0;
300
+ min-height: 0;
301
+ }
302
+ .${t}-lightbox-content-area-stacked {
303
+ align-items: stretch;
304
+ align-self: stretch;
305
+ }
306
+ .${t}-text-bar-cell-stacked {
307
+ align-self: stretch;
308
+ flex: 1;
309
+ min-width: 0;
310
+ min-height: 0;
311
+ height: 100%;
312
+ flex-direction: column;
313
+ align-items: stretch;
314
+ }
315
+ .${t}-control {
316
+ position: relative;
317
+ z-index: 2;
318
+ pointer-events: auto;
319
+ flex-shrink: 0;
320
+ }
321
+ .${t}-item-text {
322
+ flex-shrink: 0;
323
+ margin: 0;
324
+ white-space: normal;
325
+ overflow-wrap: anywhere;
326
+ word-break: break-word;
327
+ }
328
+ `}const De={assetId:"",name:"",objectFit:"cover"},J=500,Jt=650,z="cubic-bezier(0.22, 1, 0.36, 1)",gn=72,pn=50,mn=1e4,wn=650,xn=500;function vn(t,e){const i=t.width/e.width,o=t.height/e.height,s=t.left-e.left,f=t.top-e.top;return`translate(${s}px, ${f}px) scale(${i}, ${o})`}function Be(t,e){if(e==="contain"&&t instanceof HTMLImageElement){const o=un.getDisplayedImageRect(t);return{left:o.x,top:o.y,width:o.width,height:o.height}}const i=t.getBoundingClientRect();return{left:i.left,top:i.top,width:i.width,height:i.height}}function yn(t,e,i){const o=t.querySelector(`[data-hive-grid-index="${e}"]`);return o instanceof HTMLElement?Be(o,i):null}function $n(t){return t.reduce((e,i,o)=>{const s=Se(i.gallery),g=Ie(s).filter(c=>c.lightboxMedia).map(c=>c.lightboxMedia);return g.length===0||e.push({gridIndex:o,items:g,entry:{title1:i.title1??"",title2:i.title2??"",title3:i.title3??""}}),e},[])}function Qt(t,e,i){var s;if(t.length<=1)return null;const o=(e+i+t.length)%t.length;return((s=t[o])==null?void 0:s.items[0])??null}function Ve(t,e,i){if(t.length<=2)return null;const o=(e+i+t.length)%t.length;return Qt(t,o,i)}const bn=.03;function qe(t){return t.width*bn}const $e={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function le(t,e){return{left:t.left-e.left,top:t.top-e.top,width:t.width,height:t.height}}function _e(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}}function be(t,e,i){const o=t.getBoundingClientRect(),s=o.width,f=o.height,g=e/i,c=s/f;if(g>c){const y=s/g;return{width:s,height:y,left:o.left,top:o.top+(f-y)/2}}const Q=f*g;return{width:Q,height:f,left:o.left+(s-Q)/2,top:o.top}}function In(t,e){return!t||!(e!=null&&e.width)||!(e!=null&&e.height)?null:be(t,e.width,e.height)}function kn(t,e){if(st.isEmbedMedia(t)){e(t.assetId,st.getEmbedAspect(t),1);return}if(Mt(t)){const o=document.createElement("video"),s=()=>{o.videoWidth>0&&o.videoHeight>0&&e(t.assetId,o.videoWidth,o.videoHeight),o.removeEventListener("loadedmetadata",s)};o.addEventListener("loadedmetadata",s),o.preload="auto",o.src=t.assetId,o.load();return}const i=new Image;i.onload=()=>{i.naturalWidth>0&&i.naturalHeight>0&&e(t.assetId,i.naturalWidth,i.naturalHeight)},i.src=t.assetId}function Ln(t){const e=new Set,i=[];for(const o of t){const s=Se(o.gallery),f=Ie(s);for(const g of f)for(const c of[g.displayMedia,g.lightboxMedia])c!=null&&c.assetId&&!e.has(c.assetId)&&(e.add(c.assetId),i.push(c))}return i}function jn({mediaList:t}){const[e,i]=r.useState(null);sn.useLazyVideos(e,{preload:"metadata"});const o=t.filter(s=>!st.isEmbedMedia(s));return o.length===0?null:l.jsx("div",{ref:i,"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:o.map(s=>Mt(s)?l.jsx("video",{src:s.assetId,preload:"none",muted:!0,playsInline:!0},s.assetId):l.jsx("img",{src:s.assetId,alt:""},s.assetId))})}function Nt(t,e,i){const{width:o,height:s,top:f}=t,{left:g,width:c}=i,Q=qe(i);return e==="left"?{left:g+Q-o,top:f,width:o,height:s}:{left:g+c-Q,top:f,width:o,height:s}}function ce(t,e,i){const o=Nt(t,e,i);return{...o,left:2*o.left-t.left}}function Rn(t,e,i){const{left:o,width:s}=i,f=qe(i);return e==="left"?{left:o,top:t.top,width:f,height:t.height}:{left:o+s-f,top:t.top,width:f,height:t.height}}function Ge(t,e,i,o){const s=Nt(t,"left",o),f=Nt(t,"right",o),g=ce(t,"left",o),c=ce(t,"right",o);if(i===1)switch(e){case"center":return{start:t,end:s};case"right-adjacent":return{start:f,end:t};case"left-adjacent":return{start:s,end:g};case"far-right":return{start:c,end:f};default:return{start:t,end:t}}switch(e){case"center":return{start:t,end:f};case"left-adjacent":return{start:s,end:t};case"right-adjacent":return{start:f,end:c};case"far-left":return{start:g,end:s};default:return{start:t,end:t}}}function Tn(t,e,i,o){const{start:s,end:f}=Ge(t,e,i,o);return{x:f.left-s.left,y:f.top-s.top}}function Cn(t,e,i){const o=Nt(t,e,i),s=ce(t,e,i);return{x:s.left-o.left,y:s.top-o.top}}function Xe(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 Se(t){if(!t)return;if(Xe(t))return t;if(!Array.isArray(t))return;const[e,i]=t,o=e!=null&&e.assetId?e:void 0,s=i!=null&&i.assetId?i:void 0;if(!(!o&&!s))return[{media:[s??o??De,o??s??De]}]}function An(t){const[e,i]=t.media;return i!=null&&i.assetId?i:e!=null&&e.assetId?e:null}function En(t){const[e]=t.media;return e!=null&&e.assetId?e:null}function Ie(t){if(!Array.isArray(t)||t.length===0)return[];if(Xe(t)){const e=[];for(const i of t){const o=An(i);if(!o)continue;const s=En(i);e.push({displayMedia:o,lightboxMedia:s!=null&&s.assetId?s:null})}return e}return t.filter(e=>e==null?void 0:e.assetId).map(e=>({displayMedia:e,lightboxMedia:e}))}function Mt(t){return st.isEmbedMedia(t)?!1:t.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(t.assetId)}function Fn({media:t,className:e,style:i,gridIndex:o,onMediaClick:s}){return st.isEmbedMedia(t)?l.jsx(st.EmbedMediaFrame,{media:t,fit:i.objectFit==="contain"?"contain":"cover",silentLoop:!0,className:e,"data-hive-grid-index":o,style:{...i,cursor:s?"pointer":"default"},onClick:s}):Mt(t)?l.jsx(ln.LazyVideo,{src:t.assetId,className:e,"data-hive-grid-index":o,style:{...i,cursor:s?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,onClick:s}):l.jsx("img",{src:t.assetId,alt:t.name,className:e,"data-hive-grid-index":o,style:{...i,cursor:s?"pointer":"default"},onClick:s})}function Hn({src:t,onMediaElement:e,wrapperStyle:i,videoStyle:o,onLoadedMetadata:s,onTransitionEnd:f}){const g=r.useRef(null);return r.useEffect(()=>{const c=g.current;return e==null||e(c??null),()=>{c==null||c.pause(),e==null||e(null)}},[t,e]),l.jsx("div",{style:i,onTransitionEnd:f,children:l.jsx("video",{ref:g,src:t,muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onLoadedMetadata:s,style:o},t)})}function ae({media:t,style:e,onTransitionEnd:i,onMeasure:o}){return st.isEmbedMedia(t)?l.jsx("img",{src:t.thumbnail,alt:t.name,style:e,onTransitionEnd:i}):Mt(t)?l.jsx("video",{src:t.assetId,muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",style:e,onLoadedMetadata:s=>{const f=s.currentTarget;f.videoWidth>0&&f.videoHeight>0&&(o==null||o(t.assetId,f.videoWidth,f.videoHeight))},onTransitionEnd:i}):l.jsx("img",{src:t.assetId,alt:t.name,style:e,onLoad:s=>{const f=s.currentTarget;f.naturalWidth>0&&f.naturalHeight>0&&(o==null||o(t.assetId,f.naturalWidth,f.naturalHeight))},onTransitionEnd:i})}function Wn({prefix:t,items:e,index:i,entry:o,settings:s,isEditor:f,isEditMode:g,isPreviewMode:c,canNavigate:Q,lightboxEntries:y,entryIdx:P,layoutId:zt,sourceRect:lt,resolveCloseSourceRect:It,onClose:H,onPrev:Ot,onNext:at}){const Dt=r.useRef(null),ct=r.useRef(null),xt=r.useRef(null),vt=r.useRef(new Map),[ue,ke]=r.useState(0),tt=r.useRef(null),ut=r.useRef(0),S=r.useRef(0),I=r.useRef("none"),q=r.useRef(!1),kt=r.useRef(!1),ft=r.useRef(!1),dt=r.useRef(null),W=r.useRef(null),Vt=r.useRef(null),Lt=r.useRef(()=>{}),ht=r.useRef(null),gt=r.useRef(null),O=r.useRef(null),pt=r.useRef(!1),[j,D]=r.useState(null),[R,jt]=r.useState($e),[_t,yt]=r.useState(0),[m,et]=r.useState("opening"),[G,Rt]=r.useState(0),[Tt,$t]=r.useState(0),[V,fe]=r.useState(!1),[b,X]=r.useState(null),[bt,nt]=r.useState(null),[Ct,k]=r.useState(null),[de,Bt]=r.useState(!1),[he,ge]=r.useState(null),[qt,Gt]=r.useState(!1),x=r.useRef(!1),[p,E]=r.useState(!1),[F,it]=r.useState(!1),At=r.useRef(i),Xt=r.useRef(void 0),u=e[i],Yt=u?Mt(u):!1,Pt=u?st.isEmbedMedia(u):!1,_=Tt!==0||V,B=!g&&(!f||!!c),rt=Q&&!g,mt=y.length>1,Et=r.useCallback((n,a)=>e.length<=1?null:e[(n+a+e.length)%e.length]??null,[e]),T=mt?Qt(y,P,-1):Et(i,-1),C=mt?Qt(y,P,1):Et(i,1),pe=b===-1&&_?mt&&bt!==null?Qt(y,bt,-1):Ct!==null?Et(Ct,-1):null:null,me=b===1&&_?mt&&bt!==null?Qt(y,bt,1):Ct!==null?Et(Ct,1):null:null,Ye=pe&&pe.assetId!==(T==null?void 0:T.assetId)?pe:null,Ue=me&&me.assetId!==(C==null?void 0:C.assetId)?me:null,Ze=T&&rt?(()=>{const n=mt?Ve(y,P,-1):e.length>2?Et((i-1+e.length)%e.length,-1):null;return n&&n.assetId!==T.assetId?n:null})():null,Ke=C&&rt?(()=>{const n=mt?Ve(y,P,1):e.length>2?Et((i+1)%e.length,1):null;return n&&n.assetId!==C.assetId?n:null})():null,te=Ye??Ze,ee=Ue??Ke,wt=r.useCallback((n,a,h)=>{if(!n||!a||!h)return;const d=vt.current,v=d.get(n);(v==null?void 0:v.width)===a&&(v==null?void 0:v.height)===h||(d.set(n,{width:a,height:h}),ke(M=>M+1))},[]),Ft=r.useCallback(n=>{if(!(n!=null&&n.assetId))return null;const a=vt.current.get(n.assetId);return In(ct.current,a)},[ue,_t]),ne=r.useCallback(()=>{if(!u)return;const n=Ft(u);if(n){D(n);return}const a=ct.current;a&&D(_e(a))},[u,Ft]),ie=r.useCallback(n=>{if(mt){const a=y.length;nt((P+n+a)%a),k(null);return}e.length>1&&(k((i+n+e.length)%e.length),nt(null))},[mt,y.length,P,e.length,i]),A=r.useCallback(n=>{ft.current=n,fe(n)},[]),$=r.useCallback(()=>{dt.current!==null&&(window.clearTimeout(dt.current),dt.current=null)},[]),Le=r.useCallback(()=>{$(),dt.current=window.setTimeout(()=>{$(),A(!1)},Jt+32)},[$,A]),je=r.useCallback(()=>{const n=Dt.current;if(!n){jt({left:0,top:0,width:typeof window<"u"?window.innerWidth:$e.width,height:typeof window<"u"?window.innerHeight:$e.height});return}const a=n.getBoundingClientRect();jt({left:a.left,top:a.top,width:a.width,height:a.height})},[]),Re=r.useCallback((n,a)=>{if(_){if(p&&!V)return`translate(${Tt}px, 0px)`;if(V&&b!==null){const h=Ft(n);if(!h)return;const{x:d,y:v}=Tn(h,a,b,R);return`translate(${d}px, ${v}px)`}if(V)return"translate(0px, 0px)"}},[_,p,V,Tt,b,R,Ft]),Ht=r.useCallback(()=>{const n=W.current;W.current=null,$(),A(!1),X(null),nt(null),k(null),$t(0),E(!1),q.current=!1,S.current=0,I.current="none",n===-1?Ot():n===1&&at()},[$,A,Ot,at]),re=r.useCallback(()=>{$(),dt.current=window.setTimeout(()=>{W.current!==null&&Ht()},Jt+32)},[$,Ht]),Te=r.useCallback(()=>{$(),W.current=null,A(!1),X(null),nt(null),k(null),$t(0),E(!1),q.current=!1,S.current=0,I.current="none"},[$,A]),Ce=r.useCallback(n=>{if(!(!rt||!j)){if(ft.current){if(W.current===n){Vt.current=n,Ht();return}Te()}$(),ie(n),W.current=n,X(n),A(!0),re()}},[rt,j,Ht,Te,$,ie,A,re]);Lt.current=Ce;const ot=r.useCallback(()=>{ht.current=null,pt.current=!1,gt.current!==null&&(window.clearInterval(gt.current),gt.current=null),O.current!==null&&(window.clearTimeout(O.current),O.current=null)},[]),we=r.useCallback(n=>{gt.current!==null&&window.clearInterval(gt.current);const a=pt.current?xn:wn;gt.current=window.setInterval(()=>{Lt.current(n)},a)},[]),Ae=r.useCallback(n=>{ht.current!==n&&(ot(),ht.current=n,pt.current=!1,Lt.current(n),we(n),O.current=window.setTimeout(()=>{O.current=null,ht.current===n&&(pt.current=!0,we(n))},mn))},[ot,we]),Y=r.useCallback(()=>{const n=ct.current;if(!n)return;const a=u==null?void 0:u.assetId,h=a?vt.current.get(a):void 0;if(h!=null&&h.width&&(h!=null&&h.height)){D(be(n,h.width,h.height));return}const d=xt.current;if(d&&a&&(d.src===a||d.currentSrc===a)){const{width:M,height:w}=Sn(d);if(M&&w){wt(a,M,w),D(be(n,M,w));return}}const v=_e(n);!v.width||!v.height||D(v)},[u==null?void 0:u.assetId,wt]),Ee=r.useCallback(n=>{if(xt.current=n,!!n){if(n instanceof HTMLVideoElement){n.readyState>=1&&n.videoWidth>0&&Y();return}n.complete&&n.naturalWidth>0&&Y()}},[Y]),Ut=r.useCallback(()=>{je(),Y(),yt(n=>n+1)},[je,Y]);r.useEffect(()=>{Ut();const n=ct.current,a=Dt.current,h=new ResizeObserver(()=>Ut());return n&&h.observe(n),a&&h.observe(a),window.addEventListener("resize",Ut),()=>{h.disconnect(),window.removeEventListener("resize",Ut)}},[Ut,i,zt]),r.useLayoutEffect(()=>{if(!u)return;const n=xt.current;if(n){if(n instanceof HTMLImageElement&&n.complete&&n.naturalWidth>0){Y();return}n instanceof HTMLVideoElement&&n.readyState>=1&&n.videoWidth>0&&Y()}},[u==null?void 0:u.assetId,i,Y]),r.useEffect(()=>{ne()},[ne,ue]),r.useEffect(()=>{const n=new Set,a=[],h=d=>{!(d!=null&&d.assetId)||n.has(d.assetId)||(n.add(d.assetId),a.push(d))};e.forEach(h),y.forEach(d=>d.items.forEach(h)),a.forEach(d=>{vt.current.has(d.assetId)||kn(d,wt)})},[e,y,wt]),r.useEffect(()=>{if(m!=="opening"||!j)return;if(!lt){et("open");return}Bt(!1);const n=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Bt(!0),et("open")})});return()=>cancelAnimationFrame(n)},[m,j,lt]),r.useEffect(()=>{if(m!=="closing")return;const n=setTimeout(()=>H(),J);return()=>clearTimeout(n)},[m,H]),r.useEffect(()=>()=>{$()},[$]),r.useLayoutEffect(()=>{At.current===i&&Xt.current===(u==null?void 0:u.assetId)||($(),W.current=null,X(null),nt(null),k(null),Rt(0),$t(0),A(!1),it(!1),E(!1),ut.current=0,S.current=0,I.current="none",q.current=!1,tt.current=null,kt.current=!1,xt.current=null,ne(),At.current=i,Xt.current=u==null?void 0:u.assetId)},[i,u==null?void 0:u.assetId,A,$,ne]),r.useLayoutEffect(()=>{const n=Vt.current;n!==null&&(Vt.current=null,requestAnimationFrame(()=>{Lt.current(n)}))},[i,P,u==null?void 0:u.assetId]),r.useLayoutEffect(()=>{if(m==="opening"){x.current=!1,Gt(!1);return}if(m!=="open"||x.current)return;if(!T&&!C){x.current=!0;return}Gt(!1);const n=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Gt(!0),x.current=!0})});return()=>cancelAnimationFrame(n)},[m,T==null?void 0:T.assetId,C==null?void 0:C.assetId]),r.useEffect(()=>{if(m!=="open")return;const n=()=>{const w=L=>{L.stopPropagation(),L.preventDefault(),document.removeEventListener("click",w,!0)};document.addEventListener("click",w,!0)},a=w=>{const L=w<0?1:-1;$(),ie(L),W.current=L,X(L),A(!0),re()},h=w=>{if(Math.abs(w)>pn&&rt){a(w);return}W.current=null,X(null),nt(null),k(null),A(!0),$t(0),Le()},d=w=>{if(w.touches.length!==1||ft.current)return;const L=w.touches[0];kt.current=!0,tt.current={x:L.clientX,y:L.clientY},I.current="none",S.current=0,q.current=!1},v=w=>{if(!tt.current||w.touches.length!==1||ft.current)return;const L=w.touches[0],Z=L.clientX-tt.current.x,K=L.clientY-tt.current.y;if(I.current==="none"){if(Math.abs(Z)<10&&Math.abs(K)<10)return;if(Math.abs(Z)>Math.abs(K)){if(!rt)return;I.current="horizontal"}else if(K>0){if(!B)return;I.current="vertical"}else return}if(I.current==="horizontal"){q.current=!0,E(!0),S.current=Z,$t(Z),w.preventDefault();return}I.current==="vertical"&&(q.current=!0,E(!0),ut.current=K,Rt(K),w.preventDefault())},M=()=>{if(!tt.current)return;const w=I.current,L=q.current;if(L&&w==="horizontal")h(S.current),n();else if(L&&w==="vertical"){const Z=ut.current;if(B&&Z>gn){const K=window.innerHeight;ut.current=K,it(!0),Rt(K),et("closing")}else ut.current=0,Rt(0);n()}else w==="horizontal"&&Math.abs(S.current)>0&&(h(S.current),n());tt.current=null,I.current="none",S.current=0,q.current=!1,E(!1)};return document.addEventListener("touchstart",d,{passive:!0}),document.addEventListener("touchmove",v,{passive:!1}),document.addEventListener("touchend",M),document.addEventListener("touchcancel",M),()=>{document.removeEventListener("touchstart",d),document.removeEventListener("touchmove",v),document.removeEventListener("touchend",M),document.removeEventListener("touchcancel",M)}},[m,rt,A,Le,$,B,re,ie]);const xe=r.useCallback(()=>{const n=(It==null?void 0:It())??lt??null;n&&j&&(ge(n),Bt(!0)),et("closing")},[It,lt,j]);r.useEffect(()=>{const n=d=>{if(d.key==="Escape"){if(f&&c||m==="closing")return;ot(),xe();return}if(d.key!=="ArrowLeft"&&d.key!=="ArrowRight"||m!=="open"||!rt)return;d.preventDefault();const v=d.key==="ArrowLeft"?-1:1;d.repeat&&ht.current===v||Ae(v)},a=d=>{if(d.key!=="ArrowLeft"&&d.key!=="ArrowRight")return;const v=d.key==="ArrowLeft"?-1:1;ht.current===v&&ot()},h=()=>{ot()};return window.addEventListener("keydown",n),window.addEventListener("keyup",a),window.addEventListener("blur",h),()=>{window.removeEventListener("keydown",n),window.removeEventListener("keyup",a),window.removeEventListener("blur",h),ot()}},[m,f,c,xe,rt,Ae,ot]),r.useEffect(()=>{m!=="open"&&ot()},[m,ot]);const Fe=()=>{m==="closing"||g||xe()},U=m==="open",oe=m==="closing",Je=G>0?Math.max(0,1-G/500):1,Qe=G>0?Math.max(.35,1-G/500):1,St=r.useCallback(n=>{if(!(n.propertyName!=="transform"||!ft.current)){if(W.current!==null){Ht();return}$(),A(!1)}},[$,A,Ht]),ve=m==="closing"?he??lt:lt,Pe=ve&&j&&(m==="opening"||oe)?vn(ve,j):void 0,tn=_&&u?Re(u,"center"):G>0?`translateY(${G}px)`:Pe,N=j?le(j,R):null,He=!!(ve&&j),en=He&&(m==="closing"||m==="open"&&de),ye={position:"absolute",top:N==null?void 0:N.top,left:N==null?void 0:N.left,width:N==null?void 0:N.width,height:N==null?void 0:N.height,objectFit:"contain",transformOrigin:"top left",transform:tn,opacity:G>0?Qe:He?1:m==="opening"||oe?0:1,transition:p&&!V?"none":V?`transform ${Jt}ms ${z}`:F?`transform ${J}ms ${z}, opacity ${J}ms ${z}`:en?`transform ${J}ms ${z}`:m==="opening"||oe?`opacity ${J}ms ${z}`:"none",pointerEvents:"none",zIndex:1,overflow:Yt||Pt?"hidden":void 0},We={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:"none"},se=(n,a,h="adjacent")=>{const d=Ft(n);if(!d)return{display:"none"};const v=h==="far"?a==="left"?"far-left":"far-right":a==="left"?"left-adjacent":"right-adjacent",{start:M}=b!==null?Ge(d,v,b,R):{start:h==="far"?ce(d,a,R):Nt(d,a,R)},w=le(M,R),L=Re(n,v),Z=!_&&h==="adjacent"&&U&&!qt?Cn(d,a,R):null,K=h==="far"&&_&&b===(a==="left"?-1:1),nn=p&&!V?!1:V,rn=h==="adjacent"&&U&&qt&&!_;return{position:"absolute",top:w.top,left:w.left,width:w.width,height:w.height,objectFit:"contain",transform:L??(Z?`translate(${Z.x}px, ${Z.y}px)`:void 0),opacity:h==="far"?U&&K?1:0:U?1:0,transition:nn?h==="far"?`transform ${Jt}ms ${z}`:`transform ${Jt}ms ${z}, opacity ${J}ms ${z}`:rn?`transform ${J}ms ${z}`:m==="opening"||oe?`opacity ${J}ms ${z}`:"none",pointerEvents:"none",zIndex:1}},Ne=(n,a)=>{const h=Ft(n);return h?Rn(Nt(h,a,R),a,R):null},Me=n=>a=>{if(!g){if(kt.current){kt.current=!1;return}a.stopPropagation(),Ce(n)}},ze=T?Ne(T,"left"):null,Oe=C?Ne(C,"right"):null,Zt=ze?le(ze,R):null,Kt=Oe?le(Oe,R):null;return l.jsxs("div",{ref:Dt,className:[`${t}-lightbox`,f?`${t}-lightbox-editor`:"",g?`${t}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:m==="open"?"none":void 0},onClick:Fe,children:[l.jsx("div",{style:{position:"absolute",inset:0,background:s.backgroundColor??"#FFFFFF",opacity:U?Je:0,transition:p?"none":`opacity ${J}ms ${z}`,pointerEvents:"none"}}),l.jsxs("div",{className:`${t}-lightbox-dismiss-area`,children:[l.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[l.jsx("div",{style:{height:"10%"}}),l.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:l.jsx("div",{ref:ct,style:{width:"100%",height:"100%"}})}),l.jsx("div",{style:{height:"10%"}})]}),l.jsx("div",{style:{position:"absolute",inset:0,opacity:U?1:0,transition:p?"none":`opacity ${J}ms ${z}`,pointerEvents:"none"},children:l.jsx(cn.HiveLightboxTitles,{prefix:t,entry:o,settings:s,isEditor:f,isEditMode:g,isPreviewMode:c,onClose:Fe})})]}),U&&te&&l.jsx(ae,{media:te,style:se(te,"left","far"),onMeasure:wt,onTransitionEnd:St},`far-prev-${te.assetId}`),U&&T&&l.jsxs(l.Fragment,{children:[l.jsx(ae,{media:T,style:se(T,"left"),onMeasure:wt,onTransitionEnd:St},`prev-${T.assetId}`),Zt&&l.jsx("div",{style:{position:"absolute",top:Zt.top,left:Zt.left,width:Zt.width,height:Zt.height,cursor:g||p?"default":"pointer",pointerEvents:g||p?"none":"auto",zIndex:3},onClick:Me(-1)})]}),U&&C&&l.jsxs(l.Fragment,{children:[l.jsx(ae,{media:C,style:se(C,"right"),onMeasure:wt,onTransitionEnd:St},`next-${C.assetId}`),Kt&&l.jsx("div",{style:{position:"absolute",top:Kt.top,left:Kt.left,width:Kt.width,height:Kt.height,cursor:g||p?"default":"pointer",pointerEvents:g||p?"none":"auto",zIndex:3},onClick:Me(1)})]}),U&&ee&&l.jsx(ae,{media:ee,style:se(ee,"right","far"),onMeasure:wt,onTransitionEnd:St},`far-next-${ee.assetId}`),j&&u&&(Pt?l.jsx("div",{style:ye,onTransitionEnd:St,children:l.jsx(st.EmbedMediaFrame,{media:u,fit:"contain",lazy:!1,startsAtOnce:!0,style:We})},`${i}-${u.assetId}`):Yt?l.jsx(Hn,{src:u.assetId,onMediaElement:Ee,wrapperStyle:ye,videoStyle:We,onLoadedMetadata:Y,onTransitionEnd:St},`${i}-${u.assetId}`):l.jsx("img",{ref:Ee,src:u.assetId,alt:u.name,onLoad:Y,onTransitionEnd:St,style:ye},`${i}-${u.assetId}`))]})}function Nn({settings:t,content:e,isEditor:i,isPreviewMode:o,isEditMode:s,layoutId:f,portalId:g}){const{prefix:c}=on.useScopedStyles(),{type:Q="a",gridLayout:y,verticalGap:P,textBoxWidth:zt=100,textMarginTop:lt=0,align:It="top",imageDisplay:H}=t,Ot=Q==="b",at=(H==null?void 0:H.display)==="cover",Dt=(H==null?void 0:H.ratioValue)??"1:1",ct=(H==null?void 0:H.reversed)??!1,[xt,vt]=Dt.split(":").map(Number),tt=`${ct?vt:xt} / ${ct?xt:vt}`,ut=y.entryWidth??.2,S=y.columnsCount,I=Wt.scalingValue(ut,i),q=Wt.scalingValue(y.horizontalGap??0,i),kt=I,ft=I,dt=`calc(${I} * (${zt} / 100))`,W=Wt.scalingValue(ut*zt/100,i),Vt=Ot&&zt>100?dt:I,Lt=r.useMemo(()=>{var x,p;return fn.textStylesToCss({fontSettings:{fontFamily:t.entryTitleFontFamily??"Arial",fontWeight:((x=t.entryTitleFontSettings)==null?void 0:x.fontWeight)??400,fontStyle:((p=t.entryTitleFontSettings)==null?void 0:p.fontStyle)??"normal"},fontSize:t.entryTitleFontSize??.0098,lineHeight:t.entryTitleLineHeight,letterSpacing:t.entryTitleLetterSpacing??0,wordSpacing:t.entryTitleWordSpacing??0,textAlign:t.entryTitleTextAlign??"left",textAppearance:t.entryTitleTextAppearance,color:t.entryTitleColor??"#000000"},i)},[t,i]),ht={width:kt,...at?{aspectRatio:tt,height:"auto",overflow:"hidden"}:{height:"auto"}},gt=at?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},O=r.useRef(null),[pt,j]=r.useState(!1),[D,R]=r.useState([]),[jt,_t]=r.useState(0),[yt,m]=r.useState(0),[et,G]=r.useState(null),[Rt,Tt]=r.useState({title1:"",title2:"",title3:""}),$t=(()=>{const x={},p=O.current?getComputedStyle(O.current).getPropertyValue("--cntrl-article-width").trim():"";return p&&(x["--cntrl-article-width"]=p),x})(),V=!i||o||s,fe=r.useMemo(()=>hn(c),[c]),b=e??[],X=b.length%S||S,bt=X<S&&b.length>0,nt=b.length-X,Ct=bt?Math.floor((S-X)/2)+1:1,k=r.useMemo(()=>$n(b),[b]),de=r.useMemo(()=>Ln(b),[b]),Bt=(x,p,E)=>{if(i&&!s&&!o)return;const F=k.findIndex(At=>At.gridIndex===x);if(F<0)return;const it=k[F];m(F),R(it.items),_t(p),Tt(it.entry),G(E??null),j(!0)},he=r.useCallback(()=>{j(!1),G(null)},[]),ge=r.useCallback(()=>{const x=k[yt];return!x||!O.current?et:yn(O.current,x.gridIndex,at?"cover":"contain")??et},[k,yt,et,at]),qt=r.useCallback(x=>{if(k.length>1){const p=k.length,E=(yt+x+p)%p,F=k[E],it=Math.min(jt,F.items.length-1);m(E),R(F.items),_t(it),Tt(F.entry);return}_t(p=>(p+x+D.length)%D.length)},[k,yt,jt,D.length]),Gt=k.length>1||D.length>1;return r.useEffect(()=>{if(!pt||typeof document>"u")return;const x=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=x}},[pt]),r.useEffect(()=>{!i||s||o||j(!1)},[i,s,o]),l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:fe}}),l.jsx(jn,{mediaList:de}),l.jsx("div",{ref:O,className:`${c}-wrapper ${c}-align-entries ${c}-image-align-${It}`.trim(),style:{gridTemplateColumns:`repeat(${S}, ${I})`,rowGap:0,columnGap:q,width:Wt.scalingValue(y.wrapperWidth??0,i),[`--${c}-align-entries-row-gap`]:Wt.scalingValue(P??0,i)},children:b.map((x,p)=>{var _;const E=Se(x.gallery),F=Ie(E),it=F.filter(B=>B.lightboxMedia).map(B=>B.lightboxMedia),At=Math.floor(p/S)===Math.ceil(b.length/S)-1,Xt=bt&&p>=nt?`${Ct+(p-nt)}`:void 0,u=F[0],Yt=u!=null&&u.lightboxMedia?it.findIndex(B=>B.assetId===u.lightboxMedia.assetId):-1,Pt=l.jsx("div",{className:`${c}-item-image-wrapper`,style:ht,children:F.length>0&&l.jsx(Fn,{media:u.displayMedia,gridIndex:p,className:`${c}-item-${Mt(u.displayMedia)?"video":"image"}`.trim(),style:gt,onMediaClick:V&&Yt>=0?B=>Bt(p,Yt,Be(B.currentTarget,at?"cover":"contain")):void 0})});return l.jsx("div",{className:`${c}-item`,children:l.jsxs("div",{className:[s?`${c}-item-inner`:`${c}-item-inner-hidden`,At?`${c}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:Vt,...Xt?{gridColumn:Xt}:{}},children:[l.jsx("div",{className:`${c}-item-title-row`,children:l.jsx("div",{style:{height:0,width:ft}})}),l.jsx("a",{className:`${c}-item-image-link`,children:Pt}),l.jsx("div",{className:`${c}-item-subtitle-row`,children:Ot&&((_=x.title1)!=null&&_.trim())?l.jsxs(l.Fragment,{children:[l.jsx("div",{"data-controls":s?"textMarginTop":void 0,className:s?`${c}-control`:void 0,style:{height:Wt.scalingValue(lt,i),width:W}}),l.jsx("p",{className:`${c}-item-text`,style:{...Lt,width:dt},children:x.title1})]}):l.jsx("div",{style:{height:0,width:ft}})})]})},p)})}),pt&&typeof document<"u"&&(()=>{const x=(g?document.getElementById(g):null)??document.body;return an.createPortal(l.jsx("div",{style:$t,"data-selection":"none",children:l.jsx(Wn,{prefix:c,items:D,index:jt,entry:Rt,settings:t,isEditor:i,isEditMode:s,isPreviewMode:o,canNavigate:Gt,lightboxEntries:k,entryIdx:yt,layoutId:f,sourceRect:et,resolveCloseSourceRect:ge,onClose:he,onPrev:()=>qt(-1),onNext:()=>qt(1)})}),x)})()]})}exports.Hive=Nn;