@cntrl-site/components 1.0.116-alpha.0 → 1.0.117
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/{Burger-DyORh_vF.mjs → Burger-BkVgNMGU.mjs} +1 -1
- package/dist/{Burger-B4kXX9aY.js → Burger-C3yVbQcq.js} +1 -1
- package/dist/Chronicles-BNvvaFYY.mjs +744 -0
- package/dist/Chronicles-Dj1gvNjE.js +196 -0
- package/dist/ChroniclesComponent-CoOgQZx2.js +1 -0
- package/dist/{ChroniclesComponent-jh4v7wp6.mjs → ChroniclesComponent-Szt0H-op.mjs} +542 -491
- package/dist/Components/Chronicles/Chronicles.d.ts +7 -1
- package/dist/Components/Chronicles/ChroniclesComponent.d.ts +26 -2
- package/dist/Components/LightboxJournal/LightboxJournal.d.ts +1 -0
- package/dist/Components/LightboxStrip/LightboxStrip.d.ts +1 -0
- package/dist/Components/helpers/SvgImage/loadSvgMaskUrl.d.ts +0 -7
- package/dist/{ControlSlider-DB4nbVLT.js → ControlSlider-C8ckUIDm.js} +1 -1
- package/dist/{ControlSlider-3w-bHQEg.mjs → ControlSlider-DqKfaKMG.mjs} +1 -1
- package/dist/{FAQ-GmiwRdFq.mjs → FAQ-CJHCMSBa.mjs} +1 -1
- package/dist/{FAQ-7HEkaoU6.js → FAQ-DLh63Utr.js} +1 -1
- package/dist/{Grid-BzarI5Mc.js → Grid-C4hO8KCr.js} +14 -9
- package/dist/{Grid-Z2JZyUdC.mjs → Grid-Dud7PLS9.mjs} +201 -196
- package/dist/{Hive-34KvKNsa.js → Hive-CzabuuCc.js} +1 -1
- package/dist/{Hive-7xHXyMM1.mjs → Hive-DyxYd5eg.mjs} +1 -1
- package/dist/{HiveLightboxTitles-BCoL46-V.mjs → HiveLightboxTitles-DhEeFKWs.mjs} +1 -1
- package/dist/{HiveLightboxTitles-DEeyQGcf.js → HiveLightboxTitles-DlyptAaK.js} +1 -1
- package/dist/{Lightbox-DzPqgKP4.mjs → Lightbox-BY99NS14.mjs} +1 -1
- package/dist/{Lightbox-Cb7lyaNt.js → Lightbox-DZckgBzK.js} +1 -1
- package/dist/{LightboxJournal-C_q7_s-B.mjs → LightboxJournal-BDUs6T0B.mjs} +466 -434
- package/dist/LightboxJournal-Bf_rZzmz.js +555 -0
- package/dist/{LightboxStrip-BrNj7ipX.mjs → LightboxStrip-Cuhb2fIR.mjs} +459 -427
- package/dist/LightboxStrip-RA4ABUC-.js +418 -0
- package/dist/{Mercury-BmhtFYOw.js → Mercury-B-s2Kvuq.js} +1 -1
- package/dist/{Mercury-Q788wrYQ.mjs → Mercury-CCW0Es-s.mjs} +1 -1
- package/dist/{OnelinerForm-D8WIB9Qy.mjs → OnelinerForm-BEu7_sho.mjs} +1 -1
- package/dist/{OnelinerForm-CUmY-bXL.js → OnelinerForm-C2Y_XMCY.js} +1 -1
- package/dist/{SimpleButton-DTpzfmb6.mjs → SimpleButton-C-o2W9bS.mjs} +1 -1
- package/dist/{SimpleButton-DtaCYa3y.js → SimpleButton-nGEcO2gB.js} +1 -1
- package/dist/{Slider20-q0iGgnE3.js → Slider20-BOmjDRf2.js} +1 -1
- package/dist/{Slider20-CKngROrc.mjs → Slider20-DUi6qwnd.mjs} +1 -1
- package/dist/SvgImage-B5mR9y6q.mjs +51 -0
- package/dist/SvgImage-DFlmxAoL.js +1 -0
- package/dist/{TestimonialSingle-CpEUendN.js → TestimonialSingle-BORQom3u.js} +1 -1
- package/dist/{TestimonialSingle-Bax71Hyo.mjs → TestimonialSingle-DrnyReim.mjs} +1 -1
- package/dist/{Waterfall-znaoynn5.mjs → Waterfall-3kKioKh2.mjs} +1 -1
- package/dist/{Waterfall-B9YWMhrg.js → Waterfall-DII4-WV5.js} +1 -1
- package/dist/{components-C9Fu28pp.mjs → components-DSHc15vW.mjs} +29 -653
- package/dist/components-iORMB3kt.js +1 -0
- package/dist/elements.js +1 -1
- package/dist/elements.mjs +23 -24
- package/dist/elements.node.js +1 -1
- package/dist/elements.node.mjs +1 -1
- package/dist/index.d.ts +2 -4
- package/dist/index.js +1 -1
- package/dist/index.mjs +38 -61
- package/dist/loadSvgMaskUrl-DfF7ay6h.js +1 -0
- package/dist/loadSvgMaskUrl-xHgGYgPe.mjs +20 -0
- package/dist/sources.js +143 -30
- package/dist/sources.mjs +150 -37
- package/dist/types/Component.d.ts +0 -7
- package/dist/types/SchemaV1.d.ts +3 -3
- package/package.json +1 -1
- package/dist/Chronicles-Cy2h3jlZ.mjs +0 -724
- package/dist/Chronicles-D0ojQzOP.js +0 -196
- package/dist/ChroniclesComponent-DYPJBI3d.js +0 -1
- package/dist/Components/PopupMenu/PopupMenu.d.ts +0 -73
- package/dist/Components/PopupMenu/PopupMenuComponent.d.ts +0 -594
- package/dist/Components/PopupMenu/popupMenuLayout.d.ts +0 -203
- package/dist/Components/PopupMenu/popupMenuSnap.d.ts +0 -61
- package/dist/LightboxJournal-BFF5aKRz.js +0 -523
- package/dist/LightboxStrip-CC2e0_9A.js +0 -386
- package/dist/PopupMenu-CYdDyzEt.mjs +0 -1372
- package/dist/PopupMenu-Di1fHgho.js +0 -409
- package/dist/SvgImage-CwRq9-ec.mjs +0 -56
- package/dist/SvgImage-_QN8ngad.js +0 -1
- package/dist/components-6QFLq5OI.js +0 -1
- package/dist/loadSvgMaskUrl-B6kHUyof.js +0 -1
- package/dist/loadSvgMaskUrl-DUhCVvpl.mjs +0 -39
|
@@ -4,6 +4,11 @@ import { TextStyles } from '../utils/textStylesToCss';
|
|
|
4
4
|
export declare const CHRONICLES_EXTRA_TITLE_KEYS: readonly ["title2", "title3", "title4"];
|
|
5
5
|
export declare const CHRONICLES_COLUMN_WIDTH_KEYS: readonly ["column1Width", "column2Width", "column3Width", "column4Width"];
|
|
6
6
|
export declare const CHRONICLES_COLUMN_STYLE_PREFIXES: readonly ["column1", "column2", "column3", "column4", "column5"];
|
|
7
|
+
export declare const CHRONICLES_COLUMN_KEYS: readonly ["group", "title", "title2", "title3", "title4"];
|
|
8
|
+
export declare const CHRONICLES_COLUMN_LETTERS: readonly ["A", "B", "C", "D", "E"];
|
|
9
|
+
export type ChroniclesColumnKey = typeof CHRONICLES_COLUMN_KEYS[number];
|
|
10
|
+
export declare const CHRONICLES_COLUMN_STYLE_PREFIX_BY_KEY: Record<ChroniclesColumnKey, (typeof CHRONICLES_COLUMN_STYLE_PREFIXES)[number]>;
|
|
11
|
+
export declare function getChroniclesColumnsOrder(order: unknown): ChroniclesColumnKey[];
|
|
7
12
|
declare const PANEL_POSITION_OFFSETS: {
|
|
8
13
|
readonly center: {
|
|
9
14
|
readonly x: "50%";
|
|
@@ -85,6 +90,7 @@ type PrefixedTextStyle<Prefix extends string> = {
|
|
|
85
90
|
};
|
|
86
91
|
type ColumnLayoutSettings = Partial<Record<ColumnWidthKey, number>> & {
|
|
87
92
|
columns: number;
|
|
93
|
+
columnsOrder?: string[];
|
|
88
94
|
columnGap: number;
|
|
89
95
|
panelWidth: number;
|
|
90
96
|
panelPadding: Padding;
|
|
@@ -115,6 +121,6 @@ type ChroniclesProps = {
|
|
|
115
121
|
portalId?: string;
|
|
116
122
|
} & CommonComponentProps;
|
|
117
123
|
export declare function getChroniclesEqualColumnWidths(settings: ColumnLayoutSettings): Partial<Record<ColumnWidthKey, number>>;
|
|
118
|
-
export declare function
|
|
124
|
+
export declare function applyChroniclesLayoutSettingsChange(nextSettings: Record<string, any>, prevSettings: Record<string, any>): Record<string, any>;
|
|
119
125
|
export declare function Chronicles({ settings, content, isEditor, isEditMode, isPreviewMode, portalId, currentState, unavailableStates, }: ChroniclesProps): import("react/jsx-runtime").JSX.Element;
|
|
120
126
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { LayoutItem, SchemaDisplayRule, SchemaProperty } from '../../types/SchemaV1';
|
|
2
|
-
import {
|
|
2
|
+
import { applyChroniclesLayoutSettingsChange, Chronicles } from './Chronicles';
|
|
3
3
|
export declare const ChroniclesComponent: {
|
|
4
4
|
element: typeof Chronicles;
|
|
5
5
|
id: string;
|
|
6
6
|
name: string;
|
|
7
7
|
category: string;
|
|
8
|
-
normalizeLayoutSettingsUpdate: typeof
|
|
8
|
+
normalizeLayoutSettingsUpdate: typeof applyChroniclesLayoutSettingsChange;
|
|
9
9
|
preview: {
|
|
10
10
|
type: "image";
|
|
11
11
|
url: string;
|
|
@@ -23,6 +23,10 @@ export declare const ChroniclesComponent: {
|
|
|
23
23
|
};
|
|
24
24
|
display: {
|
|
25
25
|
type: string;
|
|
26
|
+
ref: {
|
|
27
|
+
columnsOrder: string;
|
|
28
|
+
columnsCount: string;
|
|
29
|
+
};
|
|
26
30
|
rules: SchemaDisplayRule[];
|
|
27
31
|
};
|
|
28
32
|
items: {
|
|
@@ -64,6 +68,7 @@ export declare const ChroniclesComponent: {
|
|
|
64
68
|
type: "string";
|
|
65
69
|
label: string;
|
|
66
70
|
contentKey: "date";
|
|
71
|
+
contentFormat: "year";
|
|
67
72
|
placeholder: string;
|
|
68
73
|
display: {
|
|
69
74
|
type: string;
|
|
@@ -172,6 +177,22 @@ export declare const ChroniclesComponent: {
|
|
|
172
177
|
min: number;
|
|
173
178
|
max: number;
|
|
174
179
|
};
|
|
180
|
+
columnsOrder: {
|
|
181
|
+
type: "array";
|
|
182
|
+
scope: "layout";
|
|
183
|
+
title: string;
|
|
184
|
+
display: {
|
|
185
|
+
type: string;
|
|
186
|
+
options: {
|
|
187
|
+
value: "group" | "title" | "title2" | "title3" | "title4";
|
|
188
|
+
label: "A" | "B" | "C" | "D" | "E";
|
|
189
|
+
}[];
|
|
190
|
+
visibleCountKey: string;
|
|
191
|
+
};
|
|
192
|
+
items: {
|
|
193
|
+
type: "string";
|
|
194
|
+
};
|
|
195
|
+
};
|
|
175
196
|
columnGap: SchemaProperty;
|
|
176
197
|
};
|
|
177
198
|
defaults: {
|
|
@@ -204,6 +225,7 @@ export declare const ChroniclesComponent: {
|
|
|
204
225
|
type: string;
|
|
205
226
|
panelPosition: string;
|
|
206
227
|
columns: number;
|
|
228
|
+
columnsOrder: ("group" | "title" | "title2" | "title3" | "title4")[];
|
|
207
229
|
columnGap: number;
|
|
208
230
|
panelWidth: number;
|
|
209
231
|
panelPadding: {
|
|
@@ -221,6 +243,7 @@ export declare const ChroniclesComponent: {
|
|
|
221
243
|
type: string;
|
|
222
244
|
panelPosition: string;
|
|
223
245
|
columns: number;
|
|
246
|
+
columnsOrder: ("group" | "title" | "title2" | "title3" | "title4")[];
|
|
224
247
|
columnGap: number;
|
|
225
248
|
panelWidth: number;
|
|
226
249
|
panelPadding: {
|
|
@@ -238,6 +261,7 @@ export declare const ChroniclesComponent: {
|
|
|
238
261
|
type: string;
|
|
239
262
|
panelPosition: string;
|
|
240
263
|
columns: number;
|
|
264
|
+
columnsOrder: ("group" | "title" | "title2" | "title3" | "title4")[];
|
|
241
265
|
columnGap: number;
|
|
242
266
|
panelWidth: number;
|
|
243
267
|
panelPadding: {
|
|
@@ -24,6 +24,7 @@ export declare const LightboxJournal: ({ settings, content, isEditor, isEditMode
|
|
|
24
24
|
export type LightboxJournalSettings = {
|
|
25
25
|
cover: string | null;
|
|
26
26
|
coverFit: ImageRatioFit;
|
|
27
|
+
hover?: 'none' | 'zoom-in' | 'greyscale' | 'scale-down';
|
|
27
28
|
type: 'A' | 'B';
|
|
28
29
|
maxWidth: number;
|
|
29
30
|
maxHeight: number;
|
|
@@ -16,6 +16,7 @@ export type LightboxStripItem = {
|
|
|
16
16
|
export type LightboxStripSettings = {
|
|
17
17
|
cover: string | null;
|
|
18
18
|
coverFit: ImageRatioFit;
|
|
19
|
+
hover?: 'none' | 'zoom-in' | 'greyscale' | 'scale-down';
|
|
19
20
|
backgroundColor: string;
|
|
20
21
|
thumbnailVisibility: 'on' | 'off';
|
|
21
22
|
thumbnailSize: number;
|
|
@@ -1,9 +1,2 @@
|
|
|
1
1
|
export declare function isInlineMaskUrl(url: string): boolean;
|
|
2
|
-
/** A data: URL holds an SVG only when its media type says so. */
|
|
3
|
-
export declare function isSvgDataUrl(url: string): boolean;
|
|
4
|
-
/**
|
|
5
|
-
* Whether a data: or blob: URL holds an SVG. A blob: URL, as an image is shown by in the
|
|
6
|
-
* editor while it uploads, says nothing of its type, so its blob is looked at.
|
|
7
|
-
*/
|
|
8
|
-
export declare function isInlineSvgUrl(url: string): Promise<boolean>;
|
|
9
2
|
export declare function loadSvgMaskUrl(url: string): Promise<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),g=require("react"),L=require("./react-splide.esm-CabaEmHi.js");;/* empty css */const d=require("classnames"),M=require("./RichTextRenderer-DEFXh5o6.js"),s=require("./scalingValue-CSHYgTZl.js"),k=require("./SvgImage-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),g=require("react"),L=require("./react-splide.esm-CabaEmHi.js");;/* empty css */const d=require("classnames"),M=require("./RichTextRenderer-DEFXh5o6.js"),s=require("./scalingValue-CSHYgTZl.js"),k=require("./SvgImage-DFlmxAoL.js"),U=require("./textStylesToCss-CNN3zZTV.js"),H="ControlSlider-module__wrapper___sHEkd",Y="ControlSlider-module__hoverArrow___A-dOH",K="ControlSlider-module__sliderItem___QQSkR",Q="ControlSlider-module__sliderImage___9hRl-",Z="ControlSlider-module__arrow___05ghY",G="ControlSlider-module__arrowVertical___tBfVN",J="ControlSlider-module__nextArrow___-30Yc",X="ControlSlider-module__arrowInner___aEra3",E="ControlSlider-module__arrowIcon___S4ztF",ee="ControlSlider-module__arrowImg___2dwJW",te="ControlSlider-module__mirror___brd6U",oe="ControlSlider-module__pagination___bicLF",ne="ControlSlider-module__paginationInner___bT-P-",ie="ControlSlider-module__paginationVertical___zYqKw",re="ControlSlider-module__paginationItem___nTRbk",le="ControlSlider-module__dot___p1Qun",ae="ControlSlider-module__activeDot___LHFaj",se="ControlSlider-module__paginationInsideBottom___R3FWn",ce="ControlSlider-module__paginationInsideTop___V-qb-",de="ControlSlider-module__paginationOutsideBottom___14w8D",_e="ControlSlider-module__paginationOutsideTop___SCLqB",me="ControlSlider-module__paginationInsideLeft___yOBRZ",ge="ControlSlider-module__paginationInsideRight___Rtt3o",pe="ControlSlider-module__paginationOutsideLeft___lahaw",ue="ControlSlider-module__paginationOutsideRight___EtuQa",he="ControlSlider-module__imgWrapper___UjEgB",fe="ControlSlider-module__captionBlock___dJ6-j",Ce="ControlSlider-module__captionTextWrapper___HFlpf",Se="ControlSlider-module__captionText___uGBVc",ve="ControlSlider-module__active___WZK4G",we="ControlSlider-module__withPointerEvents___t-18M",Ie="ControlSlider-module__topLeftAlignment___zjnGM",xe="ControlSlider-module__topCenterAlignment___gD1xW",Ae="ControlSlider-module__topRightAlignment___NMapS",ye="ControlSlider-module__middleLeftAlignment___OnUrY",Re="ControlSlider-module__middleCenterAlignment___Tdkl0",be="ControlSlider-module__middleRightAlignment___wEbfX",je="ControlSlider-module__bottomLeftAlignment___cTP2-",Le="ControlSlider-module__bottomCenterAlignment___c54fB",ke="ControlSlider-module__bottomRightAlignment___kEwrz",Ve="ControlSlider-module__clickOverlay___DZA28",Te="ControlSlider-module__contain___pLyq7",Oe="ControlSlider-module__cover___KdDat",e={wrapper:H,hoverArrow:Y,sliderItem:K,sliderImage:Q,arrow:Z,arrowVertical:G,nextArrow:J,arrowInner:X,arrowIcon:E,arrowImg:ee,mirror:te,pagination:oe,paginationInner:ne,paginationVertical:ie,paginationItem:re,dot:le,activeDot:ae,paginationInsideBottom:se,paginationInsideTop:ce,paginationOutsideBottom:de,paginationOutsideTop:_e,paginationInsideLeft:me,paginationInsideRight:ge,paginationOutsideLeft:pe,paginationOutsideRight:ue,imgWrapper:he,captionBlock:fe,captionTextWrapper:Ce,captionText:Se,active:ve,withPointerEvents:we,topLeftAlignment:Ie,topCenterAlignment:xe,topRightAlignment:Ae,middleLeftAlignment:ye,middleCenterAlignment:Re,middleRightAlignment:be,bottomLeftAlignment:je,bottomCenterAlignment:Le,bottomRightAlignment:ke,clickOverlay:Ve,contain:Te,cover:Oe},Ne={"top-left":e.topLeftAlignment,"top-center":e.topCenterAlignment,"top-right":e.topRightAlignment,"middle-left":e.middleLeftAlignment,"middle-center":e.middleCenterAlignment,"middle-right":e.middleRightAlignment,"bottom-left":e.bottomLeftAlignment,"bottom-center":e.bottomCenterAlignment,"bottom-right":e.bottomRightAlignment};function ze({settings:p,content:u,styles:T,isEditor:l}){const[_,O]=g.useState(null),{widthSettings:I,fontSettings:v,letterSpacing:N,textAlign:z,wordSpacing:B,fontSizeLineHeight:x,textAppearance:w,color:W}=T.imageCaption??{},[m,F]=g.useState(void 0),[C,q]=g.useState(null),[S,D]=g.useState(0),[$,P]=g.useState(0),{direction:n,transition:a,controls:o,pagination:i,imageCaption:h,triggers:f}=p,A=g.useRef(a.type),{x:y,y:R}=p.controls.offset,b=r=>{_&&_.go(r)};return g.useEffect(()=>{if(!C)return;const r=new ResizeObserver(c=>{if(!_)return;const[j]=c;F({width:Math.round(j.contentRect.width),height:Math.round(j.contentRect.height)})});return r.observe(C),()=>r.unobserve(C)},[C]),g.useEffect(()=>{!_||A.current===a.type||(P(r=>r+1),A.current=a.type)},[a.type]),t.jsx("div",{className:d(e.wrapper,{[e.editor]:l}),ref:q,children:t.jsxs("div",{className:e.sliderInner,style:{width:m?m.width:"100%",height:m?m.height:"100%",backgroundColor:a.backgroundColor&&a.type==="fade in"?a.backgroundColor:"transparent"},children:[p.imageCaption.isActive&&t.jsx("div",{className:d(e.captionBlock),children:t.jsx("div",{className:e.captionTextWrapper,children:u.map((r,c)=>t.jsx("div",{className:d(e.captionText,Ne[h.alignment],{[e.withPointerEvents]:c===S&&l,[e.active]:c===S}),style:{fontFamily:U.normalizeFontFamilyCssValue(v.fontFamily),fontWeight:v.fontWeight,fontStyle:v.fontStyle,width:I.sizing==="auto"?"max-content":s.scalingValue(I.width,l),letterSpacing:s.scalingValue(N,l),wordSpacing:s.scalingValue(B,l),textAlign:z,fontSize:s.scalingValue(x.fontSize,l),lineHeight:s.scalingValue(x.lineHeight,l),textTransform:w.textTransform??"none",textDecoration:w.textDecoration??"none",fontVariant:w.fontVariant??"normal",color:W,transitionDuration:a.duration?`${Math.round(parseInt(a.duration)/2)}ms`:"500ms"},children:t.jsx("div",{"data-styles":"imageCaption",className:e.captionTextInner,style:{"--link-hover-color":h.linkHoverColor,"--link-color":h.linkColor,position:"relative",top:s.scalingValue(h.offset.y,l),left:s.scalingValue(h.offset.x,l)},children:t.jsx(M.RichTextRenderer,{content:r.imageCaption})})},c))})}),t.jsx(L.Splide2,{onMove:r=>{D(r.index)},ref:O,options:{arrows:!1,speed:a.duration?parseInt(a.duration):500,autoplay:f.autoPlay!==null,...f.autoPlay!==null&&{interval:parseInt(f.autoPlay)*1e3},direction:n==="horiz"||a.type==="fade in"?"ltr":"ttb",pagination:!1,drag:f.triggersList.drag,perPage:1,width:m?m.width:"100%",height:m?m.height:"100%",type:a.type==="fade in"?"fade":"loop",rewind:!0},children:u.map((r,c)=>t.jsx(L.SplideSlide,{children:t.jsx("div",{className:e.sliderItem,children:t.jsx("div",{className:e.imgWrapper,children:t.jsx("img",{className:d(e.sliderImage,{[e.contain]:r.image.objectFit==="contain",[e.cover]:r.image.objectFit==="cover"}),src:r.image.assetId,alt:r.image.name??""})})})},c))},$),o.isActive&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:d(e.arrow,{[e.arrowVertical]:n==="vert",[e.hoverArrow]:o.show==="on hover"}),style:{color:o.color,"--arrow-hover-color":o.hover},children:t.jsxs("button",{onClick:()=>{b("-1")},className:e.arrowInner,style:{transform:`translate(${s.scalingValue(y,l)}, ${s.scalingValue(R*(n==="horiz"?1:-1),l)}) scale(${p.controls.scale/100}) rotate(${n==="horiz"?"0deg":"90deg"})`},children:[o.arrowsImgUrl&&t.jsx(k.SvgImage,{url:o.arrowsImgUrl,fill:o.color,hoverFill:o.hover,className:d(e.arrowImg,e.mirror)}),!o.arrowsImgUrl&&t.jsx(V,{color:o.color,className:d(e.arrowIcon,e.arrowImg,e.mirror)})]})}),t.jsx("div",{className:d(e.arrow,e.nextArrow,{[e.arrowVertical]:n==="vert",[e.hoverArrow]:o.show==="on hover"}),style:{color:o.color,"--arrow-hover-color":o.hover},children:t.jsxs("button",{className:e.arrowInner,onClick:()=>b("+1"),style:{transform:`translate(${s.scalingValue(y*(n==="horiz"?-1:1),l)}, ${s.scalingValue(R,l)}) scale(${p.controls.scale/100}) rotate(${n==="horiz"?"0deg":"90deg"})`},children:[o.arrowsImgUrl&&t.jsx(k.SvgImage,{url:o.arrowsImgUrl,fill:o.color,hoverFill:o.hover,className:e.arrowImg}),!o.arrowsImgUrl&&t.jsx(V,{color:o.color,className:d(e.arrowIcon,e.arrowImg)})]})})]}),f.triggersList.click&&t.jsx("div",{className:e.clickOverlay,onClick:()=>{_&&_.go("+1")}}),i.isActive&&t.jsx("div",{className:d(e.pagination,{[e.paginationInsideBottom]:i.position==="inside-1"&&n==="horiz",[e.paginationInsideTop]:i.position==="inside-2"&&n==="horiz",[e.paginationOutsideBottom]:i.position==="outside-1"&&n==="horiz",[e.paginationOutsideTop]:i.position==="outside-2"&&n==="horiz",[e.paginationInsideLeft]:i.position==="inside-1"&&n==="vert",[e.paginationInsideRight]:i.position==="inside-2"&&n==="vert",[e.paginationOutsideLeft]:i.position==="outside-1"&&n==="vert",[e.paginationOutsideRight]:i.position==="outside-2"&&n==="vert",[e.paginationVertical]:n==="vert"}),children:t.jsx("div",{className:e.paginationInner,style:{backgroundColor:i.colors[2],transform:`scale(${i.scale/100}) translate(${s.scalingValue(i.offset.x,l)}, ${s.scalingValue(i.offset.y,l)}) rotate(${n==="horiz"?"0deg":"90deg"})`},children:u.map((r,c)=>t.jsx("button",{onClick:()=>{_&&_.go(c)},className:d(e.paginationItem),children:t.jsx("div",{className:d(e.dot,{[e.activeDot]:c===S}),style:{backgroundColor:c===S?i.colors[0]:i.colors[1],"--pagination-hover-color":i.hover}})},c))})})]})})}function V({color:p,className:u}){return t.jsx("svg",{viewBox:"0 0 10 18",className:u,children:t.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:t.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:p,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}exports.ControlSlider=ze;
|
|
@@ -5,7 +5,7 @@ import { S as q, a as K } from "./react-splide.esm-DQqds4PL.mjs";
|
|
|
5
5
|
import c from "classnames";
|
|
6
6
|
import { R as Q } from "./RichTextRenderer-D52Xto59.mjs";
|
|
7
7
|
import { s } from "./scalingValue-C9JH5L6O.mjs";
|
|
8
|
-
import { S as N } from "./SvgImage-
|
|
8
|
+
import { S as N } from "./SvgImage-B5mR9y6q.mjs";
|
|
9
9
|
import { n as Z } from "./textStylesToCss-05Mn6I_2.mjs";
|
|
10
10
|
const G = "ControlSlider-module__wrapper___sHEkd", J = "ControlSlider-module__hoverArrow___A-dOH", X = "ControlSlider-module__sliderItem___QQSkR", E = "ControlSlider-module__sliderImage___9hRl-", oo = "ControlSlider-module__arrow___05ghY", to = "ControlSlider-module__arrowVertical___tBfVN", eo = "ControlSlider-module__nextArrow___-30Yc", no = "ControlSlider-module__arrowInner___aEra3", io = "ControlSlider-module__arrowIcon___S4ztF", ro = "ControlSlider-module__arrowImg___2dwJW", lo = "ControlSlider-module__mirror___brd6U", ao = "ControlSlider-module__pagination___bicLF", so = "ControlSlider-module__paginationInner___bT-P-", co = "ControlSlider-module__paginationVertical___zYqKw", mo = "ControlSlider-module__paginationItem___nTRbk", _o = "ControlSlider-module__dot___p1Qun", go = "ControlSlider-module__activeDot___LHFaj", po = "ControlSlider-module__paginationInsideBottom___R3FWn", ho = "ControlSlider-module__paginationInsideTop___V-qb-", uo = "ControlSlider-module__paginationOutsideBottom___14w8D", fo = "ControlSlider-module__paginationOutsideTop___SCLqB", Co = "ControlSlider-module__paginationInsideLeft___yOBRZ", wo = "ControlSlider-module__paginationInsideRight___Rtt3o", vo = "ControlSlider-module__paginationOutsideLeft___lahaw", So = "ControlSlider-module__paginationOutsideRight___EtuQa", Io = "ControlSlider-module__imgWrapper___UjEgB", Ao = "ControlSlider-module__captionBlock___dJ6-j", yo = "ControlSlider-module__captionTextWrapper___HFlpf", Ro = "ControlSlider-module__captionText___uGBVc", bo = "ControlSlider-module__active___WZK4G", Lo = "ControlSlider-module__withPointerEvents___t-18M", ko = "ControlSlider-module__topLeftAlignment___zjnGM", xo = "ControlSlider-module__topCenterAlignment___gD1xW", Oo = "ControlSlider-module__topRightAlignment___NMapS", No = "ControlSlider-module__middleLeftAlignment___OnUrY", To = "ControlSlider-module__middleCenterAlignment___Tdkl0", zo = "ControlSlider-module__middleRightAlignment___wEbfX", Bo = "ControlSlider-module__bottomLeftAlignment___cTP2-", Vo = "ControlSlider-module__bottomCenterAlignment___c54fB", Wo = "ControlSlider-module__bottomRightAlignment___kEwrz", Fo = "ControlSlider-module__clickOverlay___DZA28", Do = "ControlSlider-module__contain___pLyq7", $o = "ControlSlider-module__cover___KdDat", o = {
|
|
11
11
|
wrapper: G,
|
|
@@ -5,7 +5,7 @@ import { s as $ } from "./scalingValue-C9JH5L6O.mjs";
|
|
|
5
5
|
import { b as Xt } from "./buildColorVars-CLyWQm5K.mjs";
|
|
6
6
|
import { u as Et } from "./useScopedStyles-DhBG3557.mjs";
|
|
7
7
|
import { o as J, t as U } from "./textStylesToCss-05Mn6I_2.mjs";
|
|
8
|
-
import { S as Pt } from "./SvgImage-
|
|
8
|
+
import { S as Pt } from "./SvgImage-B5mR9y6q.mjs";
|
|
9
9
|
import { R as to } from "./RichTextRenderer-D52Xto59.mjs";
|
|
10
10
|
const X = 300, m = 4e-3, oo = {
|
|
11
11
|
questionColor: "question-color",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),m=require("react"),G=require("classnames"),p=require("./scalingValue-CSHYgTZl.js"),Gt=require("./buildColorVars-CE2D5cQV.js"),Kt=require("./useScopedStyles-Bf6yohVQ.js"),f=require("./textStylesToCss-CNN3zZTV.js"),Yt=require("./SvgImage-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),m=require("react"),G=require("classnames"),p=require("./scalingValue-CSHYgTZl.js"),Gt=require("./buildColorVars-CE2D5cQV.js"),Kt=require("./useScopedStyles-Bf6yohVQ.js"),f=require("./textStylesToCss-CNN3zZTV.js"),Yt=require("./SvgImage-DFlmxAoL.js"),Zt=require("./RichTextRenderer-DEFXh5o6.js"),K=300,h=.004,Jt={questionColor:"question-color",answerColor:"answer-color",dividerColor:"divider-color",iconColor:"icon-color",questionHoverColor:"question-hover-color",iconHoverColor:"icon-hover-color",iconActiveColor:"icon-active-color",dividerHoverColor:"divider-hover-color"},Ut=["hover","focus","filled","success","error"];function Xt(t){return`calc(var(--cntrl-article-width, 100vw) * ${t/1440})`}function Y(t,r,n,s){return r!==void 0&&r<(t??.01)?`${n} ${s}`:n}function Z(t,r,n,s){const l=t??.01;return r===void 0||r>=l?{}:{[`--${n}-text-leading-gap`]:p.scalingValue((l-r)/2,s)}}function Et(t){return`
|
|
2
2
|
.${t}-wrapper {
|
|
3
3
|
box-sizing: border-box;
|
|
4
4
|
display: flex;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),Mt=require("./react-splide.esm-CabaEmHi.js");;/* empty css */const f=require("./scalingValue-CSHYgTZl.js"),ii=require("./buildColorVars-CE2D5cQV.js"),ni=require("./useScopedStyles-Bf6yohVQ.js"),Dt=require("./useLazyVideos-CdCbc2j0.js"),ct=require("./LinkWrapper-CTqM1ucO.js"),H=require("./EmbedMediaFrame-DsOTKE4i.js"),r=require("react"),ri=require("react-dom"),Ne=require("./textStylesToCss-CNN3zZTV.js"),si=require("./SvgImage-DFlmxAoL.js"),Ht=require("./LazyVideo-imbU18js.js");function oi(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ot(e){return((e==null?void 0:e.trim().length)??0)>0}function St(e,i,n,a){return i!==void 0&&i<(e??.01)?`${n} ${a}`:n}function jt(e,i,n,a){const o=e??.01;return i===void 0||i>=o?{}:{[`--${n}-title-leading-gap`]:f.scalingValue((o-i)/2,a)}}const Ct=400,It="cubic-bezier(0.25, 0.1, 0.25, 1)",li=1.1,qt="--grid-media-radius";function ai(e){return`
|
|
2
2
|
.${e}-wrapper {
|
|
3
3
|
display: grid;
|
|
4
4
|
align-items: start;
|
|
5
5
|
justify-content: center;
|
|
6
|
-
min-height: ${
|
|
6
|
+
min-height: ${oi(48)};
|
|
7
7
|
}
|
|
8
8
|
.${e}-item {
|
|
9
9
|
display: flex;
|
|
@@ -140,22 +140,27 @@
|
|
|
140
140
|
.${e}-show-text-hover .${e}-item-inner-hidden:hover .${e}-item-subtitle {
|
|
141
141
|
opacity: 1;
|
|
142
142
|
}
|
|
143
|
+
@property --${e}-hover-zoom {
|
|
144
|
+
syntax: '<number>';
|
|
145
|
+
inherits: false;
|
|
146
|
+
initial-value: 1;
|
|
147
|
+
}
|
|
143
148
|
.${e}-hover-zoom-in .${e}-item-image,
|
|
144
149
|
.${e}-hover-zoom-in .${e}-item-video {
|
|
145
|
-
|
|
146
|
-
|
|
150
|
+
transform: scale(var(--${e}-hover-zoom));
|
|
151
|
+
clip-path: inset(calc(50% - 50% / var(--${e}-hover-zoom)) round calc(var(${qt}, 0px) / var(--${e}-hover-zoom)));
|
|
152
|
+
transition: --${e}-hover-zoom ${Ct}ms ${It};
|
|
147
153
|
}
|
|
148
154
|
.${e}-hover-scale-down .${e}-item-image,
|
|
149
155
|
.${e}-hover-scale-down .${e}-item-video {
|
|
150
|
-
transition: transform ${
|
|
156
|
+
transition: transform ${Ct}ms ${It};
|
|
151
157
|
}
|
|
152
158
|
.${e}-hover-greyscale .${e}-item-image-wrapper {
|
|
153
|
-
transition: filter ${
|
|
159
|
+
transition: filter ${Ct}ms ${It};
|
|
154
160
|
}
|
|
155
161
|
@media (hover: hover) {
|
|
156
162
|
.${e}-hover-zoom-in .${e}-item-image-wrapper:has(.${e}-item-image:hover, .${e}-item-video:hover) :is(.${e}-item-image, .${e}-item-video) {
|
|
157
|
-
|
|
158
|
-
clip-path: inset(${ai} round calc(var(${Tt}, 0px) / ${kt}));
|
|
163
|
+
--${e}-hover-zoom: ${li};
|
|
159
164
|
}
|
|
160
165
|
.${e}-hover-scale-down .${e}-item-image-wrapper:hover .${e}-item-image,
|
|
161
166
|
.${e}-hover-scale-down .${e}-item-image-wrapper:hover .${e}-item-video {
|
|
@@ -400,4 +405,4 @@
|
|
|
400
405
|
left: 50%;
|
|
401
406
|
transform: translate(-50%, -50%);
|
|
402
407
|
}
|
|
403
|
-
`}function di(){return Math.random()<.5?"ltr":"ttb"}function ui(e){const i=e.Components.Autoplay;i&&(i.pause(!1),i.play())}function mi(e){const i=di();e.options.direction!==i&&(e.options={...e.options,direction:i}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{ui(e)})})}const D=500,gi=750,le="cubic-bezier(0.22, 1, 0.36, 1)",hi=72,pi=50;function fi(e){if(!Array.isArray(e)||e.length===0)return!1;const i=e[0];return i!==null&&typeof i=="object"&&"media"in i&&Array.isArray(i.media)}function $i(e){const[i,n]=e.media;return n!=null&&n.assetId?n:i!=null&&i.assetId?i:null}function yi(e){const[i]=e.media;return i!=null&&i.assetId?i:null}function Gt(e){return!Array.isArray(e)||e.length===0?[]:fi(e)?e.flatMap(i=>{const n=$i(i);if(!n)return[];const a=yi(i);return[{displayMedia:n,lightboxMedia:a!=null&&a.assetId?a:null}]}):e.filter(i=>i==null?void 0:i.assetId).map(i=>({displayMedia:i,lightboxMedia:i}))}function xe(e){return!H.isEmbedMedia(e)&&e.type==="video"}function xi(e){const i=new Set,n=[];for(const a of e){const o=Gt(a.gallery);for(const x of o){const y=x.lightboxMedia;y!=null&&y.assetId&&!i.has(y.assetId)&&(i.add(y.assetId),n.push(y))}}return n}function vi({mediaList:e}){const[i,n]=r.useState(null);qt.useLazyVideos(i,{preload:"metadata"});const a=e.filter(o=>!H.isEmbedMedia(o));return a.length===0?null:t.jsx("div",{ref:n,"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:a.map(o=>xe(o)?t.jsx("video",{src:o.assetId,preload:"none",muted:!0,playsInline:!0},o.assetId):t.jsx("img",{src:o.assetId,alt:""},o.assetId))})}function wi(e){e.pause(),e.removeAttribute("src"),e.load()}const bi=".splide__slide video";function Si(e){var o;if(e.closest(".splide--fade, .splide__slide.is-active:not(.splide__slide--clone), .splide__slide.is-next"))return!0;const i=e.closest(".splide__slide");if(!i||i.classList.contains("splide__slide--clone"))return!1;const n=i.dataset.slideIndex,a=(o=i.parentElement)==null?void 0:o.querySelector(".splide__slide.is-next");return n!==void 0&&(a==null?void 0:a.dataset.slideIndex)===n}function Dt({media:e,className:i,style:n,hasLightbox:a,isSplideSlide:o=!1,onMediaClick:x}){if(H.isEmbedMedia(e))return t.jsx(H.EmbedMediaFrame,{media:e,fit:n.objectFit==="contain"?"contain":"cover",silentLoop:a,className:i,style:{...n,cursor:x?"pointer":"default"},onClick:x});if(xe(e)){const y={src:e.assetId,className:i,style:{...n,cursor:x?"pointer":"default"},muted:!0,loop:!0,playsInline:!0,onClick:x};return o?t.jsx("video",{...y,preload:"none"}):t.jsx(Bt.LazyVideo,{...y,autoPlay:!0})}return t.jsx("img",{src:e.assetId,alt:e.name,className:i,style:{...n,cursor:x?"pointer":"default"},onClick:x})}function ji({className:e,style:i,children:n}){const[a,o]=r.useState(null);return qt.useLazyVideos(a,{autoPlay:!0,selector:bi,shouldPlay:Si}),t.jsx("div",{ref:o,className:e,style:i,children:n})}function Ht(e){const i=e.getBoundingClientRect();return{width:i.width,height:i.height,left:i.left,top:i.top}}function Ci(e,i){if(!i||!i.width||!i.height||!e.width||!e.height)return e;const n=i.width/i.height,a=e.width/e.height;if(n>a){const x=e.width/n;return{width:e.width,height:x,left:e.left,top:e.top+(e.height-x)/2}}const o=e.height*n;return{width:o,height:e.height,left:e.left+(e.width-o)/2,top:e.top}}function Ii({src:e,mediaRef:i,mediaStyle:n,onLoadedMetadata:a}){return r.useEffect(()=>{const o=i.current;if(o)return()=>{wi(o)}},[e,i]),t.jsx("video",{ref:i,src:e,muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onLoadedMetadata:a,style:n})}const ki="https://cdn.cntrl.site/component-assets/defaultCloseIcon.svg",Ti=.004;function Li({prefix:e,closeIcon:i=ki,closeIconMaxWidth:n=.0125,closeIconColor:a="#FFFFFF",closeIconHoverColor:o="#999999",iconMarginRight:x=.01,contentMarginTop:y=.01,isEditor:q,isPreviewMode:ae,isEditMode:s,visible:V,onClose:Z}){if(!i)return null;const J=f.scalingValue(n,q),ce=f.scalingValue(x,q),ve=f.scalingValue(y,q),S=f.scalingValue(Math.max(y,Ti),q);return t.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,zIndex:1e4,display:"flex",flexDirection:"column",alignItems:"flex-end",pointerEvents:"none",opacity:V?1:0,transition:"opacity 500ms cubic-bezier(0.22, 1, 0.36, 1)"},children:[t.jsx("div",{style:{position:"relative",width:"100%",height:ve,flexShrink:0},children:s&&t.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-min":"0",className:`${e}-control`,style:{position:"absolute",top:0,left:0,width:"100%",height:S,pointerEvents:V?"auto":"none"}})}),t.jsxs("div",{className:`${e}-close-icon`,style:{width:J,height:J,marginRight:ce,pointerEvents:V?"auto":"none"},onClick:j=>j.stopPropagation(),children:[t.jsx("button",{type:"button",className:`${e}-close-icon-inner`,"aria-label":"Close",onClick:j=>{j.stopPropagation(),Z()},children:t.jsx(oi.SvgImage,{url:i,fill:a,hoverFill:q&&!ae?a:o,className:`${e}-close-icon-img`})}),s&&t.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:ce,height:"100%",pointerEvents:V?"auto":"none"}})]})]})}function _i({prefix:e,items:i,index:n,imageDisplay:a,isEditor:o,isPreviewMode:x,isEditMode:y,onClose:q,onPrev:ae,onNext:s,counterClassName:V,counterStyle:Z,closeIcon:J,closeIconMaxWidth:ce,closeIconColor:ve,closeIconHoverColor:S,iconMarginRight:j,contentMarginTop:Xe}){const we=a==="cover",ze=r.useRef(null),de=r.useRef(null),ue=r.useRef(null),L=r.useRef(null),B=r.useRef(0),_=r.useRef(0),N=r.useRef("none"),G=r.useRef(!1),Q=r.useRef(!1),Ue=r.useRef(null),k=r.useRef(0),M=r.useRef(null),R=r.useRef(!1),ie=r.useRef(null),X=r.useRef(null),Fe=r.useRef(null),Ye=r.useRef(()=>{}),[m,Ve]=r.useState(null),[c,mt]=r.useState(null),[w,be]=r.useState("opening"),[P,O]=r.useState(0),[me,W]=r.useState(0),[Ae,ne]=r.useState(null),[Me,ge]=r.useState(!1),[Se,he]=r.useState(!1),[gt,Ke]=r.useState(!1),[ht,Ze]=r.useState(null),Oe=r.useRef(n),Je=r.useRef(void 0),d=i[n],pt=d?xe(d):!1,Qe=d?H.isEmbedMedia(d):!1,je=Ae!==null,Pe=r.useCallback(l=>{const u=l.currentTarget,I=u instanceof HTMLVideoElement?{width:u.videoWidth,height:u.videoHeight}:{width:u.naturalWidth,height:u.naturalHeight};!I.width||!I.height||Ze(I)},[]);r.useEffect(()=>{Ue.current=c},[c]),r.useEffect(()=>{const l=ze.current;if(!l)return;const u=()=>mt(Ht(l));u();const I=new ResizeObserver(u);return I.observe(l),()=>I.disconnect()},[]);const C=r.useCallback(()=>{ie.current!==null&&(window.clearTimeout(ie.current),ie.current=null)},[]),U=r.useCallback(()=>{const l=X.current;X.current=null,C(),M.current=null,R.current=!1,ne(null),ge(!1),W(0),k.current=0,he(!1),G.current=!1,_.current=0,N.current="none",l===1?s():l===-1&&ae()},[C,s,ae]),Ce=r.useCallback(()=>{C(),X.current=null,M.current=null,R.current=!1,ne(null),ge(!1),W(0),k.current=0},[C]),ft=r.useCallback(()=>{C(),ie.current=window.setTimeout(()=>{X.current!==null&&U()},D+32)},[C,U]),pe=r.useCallback((l,u)=>{var ee;const I=((ee=Ue.current)==null?void 0:ee.width)??0;if(C(),M.current=l,ne(l),R.current=!0,ge(!0),u){X.current=l;const se=-l*I;k.current=se,W(se),ft();return}k.current=0,W(0),ie.current=window.setTimeout(()=>{ie.current=null,Ce()},D+32)},[C,Ce,ft]),fe=r.useCallback(l=>{if(!(i.length<=1)){if(R.current){if(X.current===l){Fe.current=l,U();return}Ce()}C(),M.current=l,ne(l),R.current=!1,ge(!1),k.current=0,W(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{pe(l,!0)})})}},[i.length,pe,U,Ce,C]);Ye.current=fe;const Ie=r.useCallback(l=>{l.propertyName!=="transform"||!R.current||X.current!==null&&U()},[U]),$e=r.useCallback(()=>{const l=de.current;if(!l)return;const u=Ht(l);!u.width||!u.height||Ve(u)},[]);r.useEffect(()=>{$e();const l=de.current;if(!l)return;const u=new ResizeObserver(()=>$e());return u.observe(l),()=>u.disconnect()},[$e]),r.useEffect(()=>{w==="opening"&&m&&be("open")},[w,m]),r.useEffect(()=>{if(w!=="closing")return;const l=setTimeout(()=>q(),D);return()=>clearTimeout(l)},[w,q]),r.useEffect(()=>()=>{C()},[C]),r.useLayoutEffect(()=>{Oe.current===n&&Je.current===(d==null?void 0:d.assetId)||(C(),X.current=null,ne(null),O(0),W(0),ge(!1),Ke(!1),he(!1),Ze(null),B.current=0,_.current=0,N.current="none",G.current=!1,R.current=!1,k.current=0,M.current=null,L.current=null,Q.current=!1,Oe.current=n,Je.current=d==null?void 0:d.assetId)},[n,d==null?void 0:d.assetId,C]),r.useLayoutEffect(()=>{const l=Fe.current;l!==null&&(Fe.current=null,requestAnimationFrame(()=>{Ye.current(l)}))},[n,d==null?void 0:d.assetId]),r.useEffect(()=>{if(w!=="open")return;let l=null;const u=()=>{l&&(document.removeEventListener("click",l,!0),l=null)},I=()=>{u(),l=h=>{h.stopPropagation(),h.preventDefault(),u()},document.addEventListener("click",l,!0)},ee=h=>{const z=h<0?1:-1;if(Math.abs(h)>pi&&i.length>1){pe(z,!0);return}pe(z,!1)},se=h=>{if(h.touches.length!==1||R.current)return;const z=h.touches[0];Q.current=!0,L.current={x:z.clientX,y:z.clientY},N.current="none",_.current=0,G.current=!1},He=h=>{if(!L.current||h.touches.length!==1||R.current)return;const z=h.touches[0],te=z.clientX-L.current.x,v=z.clientY-L.current.y;if(N.current==="none"){if(Math.abs(te)<10&&Math.abs(v)<10)return;if(Math.abs(te)>Math.abs(v)){if(i.length<=1)return;N.current="horizontal"}else if(v>0)N.current="vertical";else return}if(N.current==="horizontal"){G.current=!0,he(!0),_.current=te;const F=te<0?1:-1;M.current!==F&&(M.current=F,ne(F)),k.current=te,W(te),h.preventDefault();return}N.current==="vertical"&&(G.current=!0,he(!0),B.current=v,O(v),h.preventDefault())},Le=()=>{if(!L.current)return;const h=N.current,z=G.current;if(z&&h==="horizontal")ee(_.current),I();else if(z&&h==="vertical")if(B.current>hi){const v=window.innerHeight;B.current=v,Ke(!0),O(v),be("closing")}else B.current=0,O(0),I();else h==="horizontal"&&Math.abs(_.current)>0&&(ee(_.current),I());L.current=null,N.current="none",_.current=0,G.current=!1,he(!1)};return document.addEventListener("touchstart",se,{passive:!0}),document.addEventListener("touchmove",He,{passive:!1}),document.addEventListener("touchend",Le),document.addEventListener("touchcancel",Le),()=>{document.removeEventListener("touchstart",se),document.removeEventListener("touchmove",He),document.removeEventListener("touchend",Le),document.removeEventListener("touchcancel",Le),u()}},[w,i.length,pe]),r.useEffect(()=>{const l=u=>{u.key==="Escape"&&(u.preventDefault(),u.stopPropagation(),w!=="closing"&&be("closing"))};return window.addEventListener("keydown",l,!0),()=>window.removeEventListener("keydown",l,!0)},[w]);const ke=()=>{w!=="closing"&&be("closing")},ye=w==="open",We=w==="closing",$t=P>0?Math.max(0,1-P/500):1,yt=P>0?Math.max(.35,1-P/500):1,xt=Qe&&d?{width:H.getEmbedAspect(d),height:1}:ht,g=m?we?m:Ci(m,xt):null,et={position:"fixed",top:c==null?void 0:c.top,left:c==null?void 0:c.left,width:c==null?void 0:c.width,height:c==null?void 0:c.height,zIndex:9998},Y=we?"cover":"contain",vt=me!==0||P>0?`translate(${me}px, ${P}px)`:void 0,Te=Se&&!Me?"none":Me?`transform ${D}ms ${le}`:gt?`transform ${D}ms ${le}, opacity ${D}ms ${le}`:w==="opening"||We?`opacity ${D}ms ${le}`:"none",Ee={...et,transform:vt,opacity:P>0?yt:w==="opening"||We?0:1,transition:Te,pointerEvents:"none"},De={position:"absolute",top:((g==null?void 0:g.top)??0)-((c==null?void 0:c.top)??0),left:((g==null?void 0:g.left)??0)-((c==null?void 0:c.left)??0),width:g==null?void 0:g.width,height:g==null?void 0:g.height,objectFit:Y,pointerEvents:"none"},tt=(c==null?void 0:c.width)??0,re=je?(n+Ae+i.length)%i.length:null,T=re!==null?i[re]:null,Lt={...et,transform:je?`translateX(${Ae*tt+me}px)`:void 0,opacity:1,transition:Me?`transform ${D}ms ${le}`:"none",pointerEvents:"none"},it={position:"absolute",top:((m==null?void 0:m.top)??0)-((c==null?void 0:c.top)??0),left:((m==null?void 0:m.left)??0)-((c==null?void 0:c.left)??0),width:m==null?void 0:m.width,height:m==null?void 0:m.height,objectFit:Y,pointerEvents:"none"},wt=Qe&&d&&H.getEmbedPlayback(d).controls&&g?Math.min(52,g.height*.2):0,E=g?{position:"fixed",top:g.top,height:g.height-wt,width:g.width/2,zIndex:9999}:null;return t.jsxs("div",{ref:ze,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:w==="open"?"none":void 0},onClick:ke,children:[t.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:ye?$t:0,transition:Se?"none":`opacity ${D}ms ${le}`,pointerEvents:"none"}}),t.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:we?t.jsxs(t.Fragment,{children:[t.jsx("div",{ref:de,style:{position:"absolute",inset:0}}),t.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ye?1:0,transition:`opacity ${D}ms ${le}`,pointerEvents:"none",zIndex:9999},children:i.length>1&&t.jsxs("p",{className:V,style:Z,children:[n+1," / ",i.length]})})]}):t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{height:"10%"}}),t.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:t.jsx("div",{ref:de,style:{width:"100%",height:"100%"}})}),t.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ye?1:0,transition:`opacity ${D}ms ${le}`},children:i.length>1&&t.jsxs("p",{className:V,style:Z,children:[n+1," / ",i.length]})})]})}),m&&c&&T&&t.jsx("div",{style:Lt,onTransitionEnd:Ie,children:H.isEmbedMedia(T)?t.jsx("img",{src:T.thumbnail,alt:T.name,style:it},`neighbor-${re}-${T.assetId}`):xe(T)?t.jsx("video",{src:T.assetId,muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",style:it},`neighbor-${re}-${T.assetId}`):t.jsx("img",{src:T.assetId,alt:T.name,style:it},`neighbor-${re}-${T.assetId}`)}),m&&c&&d&&t.jsx("div",{style:Ee,onTransitionEnd:Ie,children:Qe?t.jsx(H.EmbedMediaFrame,{media:d,fit:we?"cover":"contain",lazy:!1,startsAtOnce:!0,style:De},`${n}-${d.assetId}`):pt?t.jsx(Ii,{src:d.assetId,mediaRef:ue,mediaStyle:De,onLoadedMetadata:Pe},`${n}-${d.assetId}`):t.jsx("img",{ref:ue,src:d.assetId,alt:d.name,onLoad:Pe,style:De},`${n}-${d.assetId}`)}),ye&&E&&i.length>1&&t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{...E,left:g.left,cursor:"w-resize",pointerEvents:Se?"none":"auto"},onClick:l=>{if(Q.current){Q.current=!1;return}l.stopPropagation(),fe(-1)}}),t.jsx("div",{style:{...E,left:g.left+g.width/2,cursor:"e-resize",pointerEvents:Se?"none":"auto"},onClick:l=>{if(Q.current){Q.current=!1;return}l.stopPropagation(),fe(1)}})]}),t.jsx(Li,{prefix:e,closeIcon:J,closeIconMaxWidth:ce,closeIconColor:ve,closeIconHoverColor:S,iconMarginRight:j,contentMarginTop:Xe,isEditor:o,isPreviewMode:x,isEditMode:y,visible:ye,onClose:ke})]})}function Ni(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Ri({settings:e,content:i,isEditor:n,isPreviewMode:a,isEditMode:o,metadata:x,activeEvent:y,layoutId:q,portalId:ae}){const{prefix:s}=ri.useScopedStyles(),{type:V="a",gridLayout:Z,textBoxWidth:J=100,verticalGap:ce,entriesCount:ve,lightbox:S,imageDisplay:j,imageCorners:Xe,lightboxImageDisplay:we,slider:ze,sliderTiming:de,direction:ue,transition:L,titleMarginTop:B,subtitleMarginTop:_,titleColor:N,subtitleColor:G,lightboxCounterColor:Q,titleFontFamily:Ue,titleFontSettings:k,titleFontSize:M,titleLineHeight:R,titleLetterSpacing:ie,titleWordSpacing:X,titleTextAppearance:Fe,subtitleFontFamily:Ye,subtitleFontSettings:m,subtitleFontSize:Ve,subtitleLineHeight:c,subtitleLetterSpacing:mt,subtitleWordSpacing:w,subtitleTextAppearance:be,lightboxCounterFontFamily:P,lightboxCounterFontSettings:O,lightboxCounterFontSize:me,lightboxCounterLineHeight:W,lightboxCounterLetterSpacing:Ae,lightboxCounterWordSpacing:ne,lightboxCounterTextAppearance:Me,closeIcon:ge,closeIconMaxWidth:Se,closeIconColor:he,closeIconHoverColor:gt,iconMarginRight:Ke,contentMarginTop:ht,showText:Ze="always",hover:Oe="none",alignEntries:Je="off",align:d="top"}=e,pt={fontSettings:{fontFamily:Ue,fontWeight:(k==null?void 0:k.fontWeight)??400,fontStyle:(k==null?void 0:k.fontStyle)??"normal"},fontSize:M??.01,lineHeight:R,letterSpacing:ie??0,wordSpacing:X??0,textAppearance:Fe,color:N},je={...Re.omitTextColors(Re.textStylesToCss(pt,n))},Pe={fontSettings:{fontFamily:Ye,fontWeight:(m==null?void 0:m.fontWeight)??400,fontStyle:(m==null?void 0:m.fontStyle)??"normal"},fontSize:Ve??.01,lineHeight:c,letterSpacing:mt??0,wordSpacing:w??0,textAppearance:be,color:G},U={...Re.omitTextColors(Re.textStylesToCss(Pe,n))},Ce={fontSettings:{fontFamily:P,fontWeight:(O==null?void 0:O.fontWeight)??400,fontStyle:(O==null?void 0:O.fontStyle)??"normal"},fontSize:me??.01,lineHeight:W,letterSpacing:Ae??0,wordSpacing:ne??0,textAppearance:Me,color:Q},pe={...Re.omitTextColors(Re.textStylesToCss(Ce,n)),...It(me,W,s,n)},fe=Ct(M,R,`${s}-item-title`,`${s}-text-tight-leading`),Ie=Ct(Ve,c,`${s}-item-subtitle`,`${s}-text-tight-leading`),$e=It(M,R,s,n),ke=It(Ve,c,s,n),ye=Ct(me,W,`${s}-lightbox-counter`,`${s}-text-tight-leading`),We=ni.buildColorVars(s,{titleColor:N,subtitleColor:G,lightboxCounterColor:Q},zi,Fi),$t=y&&y!=="default"?`${s}-state-${y}`:"",yt=Ze==="on hover"&&(!n||a),xt=Oe!=="none"&&(!n||a)?` ${s}-hover-${Oe}`:"",g=`${$t}${yt?` ${s}-show-text-hover`:""}${xt}`.trim(),et=ve===0?1/0:ve,Y=(i??[]).slice(0,et),vt=r.useMemo(()=>S==="on"?xi(Y):[],[Y,S]),Te=Z.entryWidth??.2,Ee=(j==null?void 0:j.display)==="cover",De=(j==null?void 0:j.ratioValue)??"1:1",tt=(j==null?void 0:j.reversed)??!1,[re,T]=De.split(":").map(Number),wt=`${tt?T:re} / ${tt?re:T}`,E=Z.columnsCount,l=f.scalingValue(Te??0,n),u=l,I=!Ee&&ze!=="off",ee=Y.length%E||E,se=ee<E&&Y.length>0,He=Y.length-ee,Le=se?Math.floor((E-ee)/2)+1:1,h=Xe?f.scalingValue(Xe,n):void 0,z={width:u,...Ee?{aspectRatio:wt,height:"auto",overflow:"hidden"}:{height:"auto"},...h?{borderRadius:h,overflow:"hidden"}:{}},te=`${s}-item-image-wrapper${I?` ${s}-item-image-wrapper-fit-slider`:""}`.trim(),v=V==="d"||V==="e"||V==="f",F=Je==="on",_e=`calc(${f.scalingValue(Te??0,n)} * (${J} / 100))`,oe=f.scalingValue(Te*J/100,n),_t=h?{borderRadius:h,[Tt]:h}:{},Nt=Ee?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",..._t}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",..._t},[Xt,Ut]=r.useState(0),nt=r.useRef(null),Yt=L==="fade"||ue==="horizontal"?"ltr":ue==="vertical"?"ttb":"ltr";r.useEffect(()=>{const p=nt.current;if(!p)return;const b=new ResizeObserver(A=>{Ut(Math.round(A[0].contentRect.width))});return b.observe(p),()=>b.disconnect()},[]);const Kt=(()=>{const p={...We},b=nt.current?getComputedStyle(nt.current).getPropertyValue("--cntrl-article-width").trim():"";return b&&(p["--cntrl-article-width"]=b),p})(),[bt,St]=r.useState(!1),[rt,Zt]=r.useState([]),[Jt,jt]=r.useState(0),Rt=S==="on"&&(!n||a),zt=(p,b)=>{n&&!a||S!=="off"&&(Zt(p),jt(b),St(!0))};r.useEffect(()=>{if(!bt||S!=="on"||typeof document>"u")return;const p=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=p}},[bt,S]),r.useEffect(()=>{!n||a||St(!1)},[n,a]);const Qt=r.useMemo(()=>ci(s),[s]);return t.jsxs(t.Fragment,{children:[t.jsx("style",{dangerouslySetInnerHTML:{__html:Qt}}),S==="on"&&t.jsx(vi,{mediaList:vt}),t.jsx("div",{style:We,children:t.jsx("div",{ref:nt,className:`${s}-wrapper ${s}-type-${V}${F?` ${s}-align-entries`:""} ${s}-image-align-${d} ${g}`.trim(),style:{gridTemplateColumns:`repeat(${E}, ${l})`,rowGap:F?0:f.scalingValue(ce??0,n),columnGap:f.scalingValue(Z.horizontalGap??0,n),width:f.scalingValue(Z.wrapperWidth??0,n),...F?{[`--${s}-align-entries-row-gap`]:f.scalingValue(ce??0,n)}:{}},children:Y.map((p,b)=>{var Ot;const A=Et(p.title),K=Et(p.subtitle),Ne=S==="off"&&((Ot=p.link)!=null&&Ot.value)?p.link:void 0,Pt=Math.floor(b/E)===Math.ceil(Y.length/E)-1,st=se&&b>=He?`${Le+(b-He)}`:void 0,Ft=v?t.jsxs("div",{className:`${s}-item-text-block`,children:[A&&t.jsx("p",{className:fe,style:{width:_e,...je,...$e},children:p.title}),A&&t.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${s}-control`:void 0,style:{height:f.scalingValue(B??0,n),width:oe}}),K&&t.jsx("p",{className:Ie,style:{width:_e,...U,...ke},children:p.subtitle}),K&&t.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${s}-control`:void 0,style:{height:f.scalingValue(_??0,n),width:oe}})]}):null,ei=F?t.jsxs("div",{className:`${s}-item-title-row`,children:[!v&&t.jsx("div",{"data-controls":o&&A?"titleMarginTop":void 0,className:o&&A?`${s}-control`:void 0,style:{height:A?f.scalingValue(B??0,n):0,width:oe}}),A&&t.jsx("p",{className:fe,style:{width:_e,...je,...$e},children:p.title}),v&&A&&t.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${s}-control`:void 0,style:{height:f.scalingValue(B??0,n),width:oe}})]}):null,ti=F?t.jsxs("div",{className:`${s}-item-subtitle-row`,children:[!v&&t.jsx("div",{"data-controls":o&&K?"subtitleMarginTop":void 0,className:o&&K?`${s}-control`:void 0,style:{height:K?f.scalingValue(_??0,n):0,width:oe}}),K&&t.jsx("p",{className:Ie,style:{width:_e,...U,...ke},children:p.subtitle}),v&&K&&t.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${s}-control`:void 0,style:{height:f.scalingValue(_??0,n),width:oe}})]}):null,Vt=t.jsxs(ct.LinkWrapper,{link:Ne,className:`${s}-item-text-link`,children:[ei,ti]}),qe=Gt(p.gallery),ot=qe.filter($=>$.lightboxMedia).map($=>$.lightboxMedia),lt=t.jsx(ji,{className:te,style:z,children:qe.length===0?null:ze==="off"?(()=>{const{displayMedia:$,lightboxMedia:Be}=qe[0],Ge=Be?ot.findIndex(at=>at.assetId===Be.assetId):-1;return t.jsx(Dt,{media:$,className:`${s}-item-${xe($)?"video":"image"}`.trim(),style:Nt,hasLightbox:S==="on",onMediaClick:Rt&&Ge>=0?()=>zt(ot,Ge):void 0})})():t.jsxs(t.Fragment,{children:[I&&t.jsx("div",{className:`${s}-item-image-wrapper-sizer`,"aria-hidden":"true",children:qe.map(({displayMedia:$})=>H.isEmbedMedia($)?t.jsx("div",{style:{aspectRatio:`${H.getEmbedAspect($)}`}},`sizer-${$.assetId}`):xe($)?t.jsx(Bt.LazyVideo,{src:$.assetId,nearPreload:"metadata",muted:!0,playsInline:!0},`sizer-${$.assetId}`):t.jsx("img",{src:$.assetId,alt:""},`sizer-${$.assetId}`))}),t.jsx(Wt.Splide2,{className:`${s}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:de*1e3,width:"100%",height:"100%",speed:gi,type:L==="fade"?"fade":"loop",rewind:L==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:Yt},onMoved:$=>{ue!=="random"||L==="fade"||mi($)},children:qe.map(({displayMedia:$,lightboxMedia:Be},Ge)=>{const at=Be?ot.findIndex(ii=>ii.assetId===Be.assetId):-1;return t.jsx(Wt.SplideSlide,{"data-slide-index":Ge,children:t.jsx(Dt,{media:$,className:`${s}-item-${xe($)?"video":"image"}`.trim(),style:Nt,hasLightbox:S==="on",isSplideSlide:!0,onMediaClick:Rt&&at>=0?()=>zt(ot,at):void 0})},Ge)})},`${L}-${Te}-${ue}-${de}-${Xt}-${q}`)]})}),At=v?null:t.jsxs(t.Fragment,{children:[t.jsx("div",{"data-controls":o&&A?"titleMarginTop":void 0,className:o&&A?`${s}-control`:void 0,style:{height:A?f.scalingValue(B??0,n):0,width:oe}}),t.jsx("p",{className:fe,style:{width:_e,...je,...$e},children:p.title}),t.jsx("div",{"data-controls":o&&K?"subtitleMarginTop":void 0,className:o&&K?`${s}-control`:void 0,style:{height:K?f.scalingValue(_??0,n):0,width:oe}}),t.jsx("p",{className:Ie,style:{width:_e,...U,...ke},children:p.subtitle})]}),Mt=Ne?t.jsx(ct.LinkWrapper,{link:Ne,className:`${s}-item-image-link`,children:lt}):t.jsx("a",{className:`${s}-item-image-link`,children:lt});return t.jsx("div",{className:`${s}-item`.trim(),style:st&&!F?{gridColumn:st}:void 0,children:t.jsx("div",{className:`${o?`${s}-item-inner`:`${s}-item-inner-hidden`}${F&&Pt?` ${s}-item-inner-last-row`:""}`.trim(),style:{width:(J??0)>100?`calc(${l} * (${J} / 100))`:l,...st&&F?{gridColumn:st}:{}},children:F?t.jsx(t.Fragment,{children:v?t.jsxs(t.Fragment,{children:[Vt,Mt]}):t.jsxs(t.Fragment,{children:[Mt,Vt]})}):Ne?t.jsxs(t.Fragment,{children:[t.jsxs(ct.LinkWrapper,{link:Ne,className:`${s}-item-image-link`,children:[Ft,lt]}),!v&&t.jsx(ct.LinkWrapper,{link:Ne,className:`${s}-item-text-link`,children:At})]}):t.jsxs(t.Fragment,{children:[Ft,lt,At]})})},b)})})}),(!n||a)&&bt&&typeof document<"u"&&S==="on"&&(()=>{const p=(ae?document.getElementById(ae):null)??document.body;return si.createPortal(t.jsx("div",{style:Kt,"data-selection":"none",children:t.jsx(_i,{prefix:s,items:rt,index:Jt,imageDisplay:Ni(we),isEditor:n,isPreviewMode:a,isEditMode:o,closeIcon:ge,closeIconMaxWidth:Se,closeIconColor:he,closeIconHoverColor:gt,iconMarginRight:Ke,contentMarginTop:ht,onClose:()=>St(!1),onPrev:()=>jt(b=>(b-1+rt.length)%rt.length),onNext:()=>jt(b=>(b+1)%rt.length),counterClassName:ye,counterStyle:pe})}),p)})()]})}const zi={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},Fi=["hover","focus","filled","success","error"];exports.Grid=Ri;
|
|
408
|
+
`}function ci(){return Math.random()<.5?"ltr":"ttb"}function di(e){const i=e.Components.Autoplay;i&&(i.pause(!1),i.play())}function ui(e){const i=ci();e.options.direction!==i&&(e.options={...e.options,direction:i}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{di(e)})})}const D=500,mi=750,le="cubic-bezier(0.22, 1, 0.36, 1)",gi=72,hi=50;function pi(e){if(!Array.isArray(e)||e.length===0)return!1;const i=e[0];return i!==null&&typeof i=="object"&&"media"in i&&Array.isArray(i.media)}function fi(e){const[i,n]=e.media;return n!=null&&n.assetId?n:i!=null&&i.assetId?i:null}function $i(e){const[i]=e.media;return i!=null&&i.assetId?i:null}function Bt(e){return!Array.isArray(e)||e.length===0?[]:pi(e)?e.flatMap(i=>{const n=fi(i);if(!n)return[];const a=$i(i);return[{displayMedia:n,lightboxMedia:a!=null&&a.assetId?a:null}]}):e.filter(i=>i==null?void 0:i.assetId).map(i=>({displayMedia:i,lightboxMedia:i}))}function xe(e){return!H.isEmbedMedia(e)&&e.type==="video"}function yi(e){const i=new Set,n=[];for(const a of e){const o=Bt(a.gallery);for(const x of o){const y=x.lightboxMedia;y!=null&&y.assetId&&!i.has(y.assetId)&&(i.add(y.assetId),n.push(y))}}return n}function xi({mediaList:e}){const[i,n]=r.useState(null);Dt.useLazyVideos(i,{preload:"metadata"});const a=e.filter(o=>!H.isEmbedMedia(o));return a.length===0?null:t.jsx("div",{ref:n,"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:a.map(o=>xe(o)?t.jsx("video",{src:o.assetId,preload:"none",muted:!0,playsInline:!0},o.assetId):t.jsx("img",{src:o.assetId,alt:""},o.assetId))})}function vi(e){e.pause(),e.removeAttribute("src"),e.load()}const wi=".splide__slide video";function bi(e){var o;if(e.closest(".splide--fade, .splide__slide.is-active:not(.splide__slide--clone), .splide__slide.is-next"))return!0;const i=e.closest(".splide__slide");if(!i||i.classList.contains("splide__slide--clone"))return!1;const n=i.dataset.slideIndex,a=(o=i.parentElement)==null?void 0:o.querySelector(".splide__slide.is-next");return n!==void 0&&(a==null?void 0:a.dataset.slideIndex)===n}function Wt({media:e,className:i,style:n,hasLightbox:a,isSplideSlide:o=!1,onMediaClick:x}){if(H.isEmbedMedia(e))return t.jsx(H.EmbedMediaFrame,{media:e,fit:n.objectFit==="contain"?"contain":"cover",silentLoop:a,className:i,style:{...n,cursor:x?"pointer":"default"},onClick:x});if(xe(e)){const y={src:e.assetId,className:i,style:{...n,cursor:x?"pointer":"default"},muted:!0,loop:!0,playsInline:!0,onClick:x};return o?t.jsx("video",{...y,preload:"none"}):t.jsx(Ht.LazyVideo,{...y,autoPlay:!0})}return t.jsx("img",{src:e.assetId,alt:e.name,className:i,style:{...n,cursor:x?"pointer":"default"},onClick:x})}function Si({className:e,style:i,children:n}){const[a,o]=r.useState(null);return Dt.useLazyVideos(a,{autoPlay:!0,selector:wi,shouldPlay:bi}),t.jsx("div",{ref:o,className:e,style:i,children:n})}function Et(e){const i=e.getBoundingClientRect();return{width:i.width,height:i.height,left:i.left,top:i.top}}function ji(e,i){if(!i||!i.width||!i.height||!e.width||!e.height)return e;const n=i.width/i.height,a=e.width/e.height;if(n>a){const x=e.width/n;return{width:e.width,height:x,left:e.left,top:e.top+(e.height-x)/2}}const o=e.height*n;return{width:o,height:e.height,left:e.left+(e.width-o)/2,top:e.top}}function Ci({src:e,mediaRef:i,mediaStyle:n,onLoadedMetadata:a}){return r.useEffect(()=>{const o=i.current;if(o)return()=>{vi(o)}},[e,i]),t.jsx("video",{ref:i,src:e,muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onLoadedMetadata:a,style:n})}const Ii="https://cdn.cntrl.site/component-assets/defaultCloseIcon.svg",ki=.004;function Ti({prefix:e,closeIcon:i=Ii,closeIconMaxWidth:n=.0125,closeIconColor:a="#FFFFFF",closeIconHoverColor:o="#999999",iconMarginRight:x=.01,contentMarginTop:y=.01,isEditor:q,isPreviewMode:ae,isEditMode:s,visible:V,onClose:Z}){if(!i)return null;const J=f.scalingValue(n,q),ce=f.scalingValue(x,q),ve=f.scalingValue(y,q),S=f.scalingValue(Math.max(y,ki),q);return t.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,zIndex:1e4,display:"flex",flexDirection:"column",alignItems:"flex-end",pointerEvents:"none",opacity:V?1:0,transition:"opacity 500ms cubic-bezier(0.22, 1, 0.36, 1)"},children:[t.jsx("div",{style:{position:"relative",width:"100%",height:ve,flexShrink:0},children:s&&t.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-min":"0",className:`${e}-control`,style:{position:"absolute",top:0,left:0,width:"100%",height:S,pointerEvents:V?"auto":"none"}})}),t.jsxs("div",{className:`${e}-close-icon`,style:{width:J,height:J,marginRight:ce,pointerEvents:V?"auto":"none"},onClick:j=>j.stopPropagation(),children:[t.jsx("button",{type:"button",className:`${e}-close-icon-inner`,"aria-label":"Close",onClick:j=>{j.stopPropagation(),Z()},children:t.jsx(si.SvgImage,{url:i,fill:a,hoverFill:q&&!ae?a:o,className:`${e}-close-icon-img`})}),s&&t.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:ce,height:"100%",pointerEvents:V?"auto":"none"}})]})]})}function Li({prefix:e,items:i,index:n,imageDisplay:a,isEditor:o,isPreviewMode:x,isEditMode:y,onClose:q,onPrev:ae,onNext:s,counterClassName:V,counterStyle:Z,closeIcon:J,closeIconMaxWidth:ce,closeIconColor:ve,closeIconHoverColor:S,iconMarginRight:j,contentMarginTop:Xe}){const we=a==="cover",Re=r.useRef(null),de=r.useRef(null),ue=r.useRef(null),L=r.useRef(null),B=r.useRef(0),_=r.useRef(0),z=r.useRef("none"),G=r.useRef(!1),Q=r.useRef(!1),Ue=r.useRef(null),k=r.useRef(0),M=r.useRef(null),N=r.useRef(!1),ie=r.useRef(null),X=r.useRef(null),Fe=r.useRef(null),Ye=r.useRef(()=>{}),[m,Ve]=r.useState(null),[c,dt]=r.useState(null),[w,be]=r.useState("opening"),[P,O]=r.useState(0),[me,W]=r.useState(0),[Ae,ne]=r.useState(null),[Me,ge]=r.useState(!1),[Se,he]=r.useState(!1),[ut,Ke]=r.useState(!1),[mt,Ze]=r.useState(null),Oe=r.useRef(n),Je=r.useRef(void 0),d=i[n],gt=d?xe(d):!1,Qe=d?H.isEmbedMedia(d):!1,je=Ae!==null,Pe=r.useCallback(l=>{const u=l.currentTarget,I=u instanceof HTMLVideoElement?{width:u.videoWidth,height:u.videoHeight}:{width:u.naturalWidth,height:u.naturalHeight};!I.width||!I.height||Ze(I)},[]);r.useEffect(()=>{Ue.current=c},[c]),r.useEffect(()=>{const l=Re.current;if(!l)return;const u=()=>dt(Et(l));u();const I=new ResizeObserver(u);return I.observe(l),()=>I.disconnect()},[]);const C=r.useCallback(()=>{ie.current!==null&&(window.clearTimeout(ie.current),ie.current=null)},[]),U=r.useCallback(()=>{const l=X.current;X.current=null,C(),M.current=null,N.current=!1,ne(null),ge(!1),W(0),k.current=0,he(!1),G.current=!1,_.current=0,z.current="none",l===1?s():l===-1&&ae()},[C,s,ae]),Ce=r.useCallback(()=>{C(),X.current=null,M.current=null,N.current=!1,ne(null),ge(!1),W(0),k.current=0},[C]),ht=r.useCallback(()=>{C(),ie.current=window.setTimeout(()=>{X.current!==null&&U()},D+32)},[C,U]),pe=r.useCallback((l,u)=>{var ee;const I=((ee=Ue.current)==null?void 0:ee.width)??0;if(C(),M.current=l,ne(l),N.current=!0,ge(!0),u){X.current=l;const se=-l*I;k.current=se,W(se),ht();return}k.current=0,W(0),ie.current=window.setTimeout(()=>{ie.current=null,Ce()},D+32)},[C,Ce,ht]),fe=r.useCallback(l=>{if(!(i.length<=1)){if(N.current){if(X.current===l){Fe.current=l,U();return}Ce()}C(),M.current=l,ne(l),N.current=!1,ge(!1),k.current=0,W(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{pe(l,!0)})})}},[i.length,pe,U,Ce,C]);Ye.current=fe;const Ie=r.useCallback(l=>{l.propertyName!=="transform"||!N.current||X.current!==null&&U()},[U]),$e=r.useCallback(()=>{const l=de.current;if(!l)return;const u=Et(l);!u.width||!u.height||Ve(u)},[]);r.useEffect(()=>{$e();const l=de.current;if(!l)return;const u=new ResizeObserver(()=>$e());return u.observe(l),()=>u.disconnect()},[$e]),r.useEffect(()=>{w==="opening"&&m&&be("open")},[w,m]),r.useEffect(()=>{if(w!=="closing")return;const l=setTimeout(()=>q(),D);return()=>clearTimeout(l)},[w,q]),r.useEffect(()=>()=>{C()},[C]),r.useLayoutEffect(()=>{Oe.current===n&&Je.current===(d==null?void 0:d.assetId)||(C(),X.current=null,ne(null),O(0),W(0),ge(!1),Ke(!1),he(!1),Ze(null),B.current=0,_.current=0,z.current="none",G.current=!1,N.current=!1,k.current=0,M.current=null,L.current=null,Q.current=!1,Oe.current=n,Je.current=d==null?void 0:d.assetId)},[n,d==null?void 0:d.assetId,C]),r.useLayoutEffect(()=>{const l=Fe.current;l!==null&&(Fe.current=null,requestAnimationFrame(()=>{Ye.current(l)}))},[n,d==null?void 0:d.assetId]),r.useEffect(()=>{if(w!=="open")return;let l=null;const u=()=>{l&&(document.removeEventListener("click",l,!0),l=null)},I=()=>{u(),l=h=>{h.stopPropagation(),h.preventDefault(),u()},document.addEventListener("click",l,!0)},ee=h=>{const R=h<0?1:-1;if(Math.abs(h)>hi&&i.length>1){pe(R,!0);return}pe(R,!1)},se=h=>{if(h.touches.length!==1||N.current)return;const R=h.touches[0];Q.current=!0,L.current={x:R.clientX,y:R.clientY},z.current="none",_.current=0,G.current=!1},He=h=>{if(!L.current||h.touches.length!==1||N.current)return;const R=h.touches[0],te=R.clientX-L.current.x,v=R.clientY-L.current.y;if(z.current==="none"){if(Math.abs(te)<10&&Math.abs(v)<10)return;if(Math.abs(te)>Math.abs(v)){if(i.length<=1)return;z.current="horizontal"}else if(v>0)z.current="vertical";else return}if(z.current==="horizontal"){G.current=!0,he(!0),_.current=te;const F=te<0?1:-1;M.current!==F&&(M.current=F,ne(F)),k.current=te,W(te),h.preventDefault();return}z.current==="vertical"&&(G.current=!0,he(!0),B.current=v,O(v),h.preventDefault())},Le=()=>{if(!L.current)return;const h=z.current,R=G.current;if(R&&h==="horizontal")ee(_.current),I();else if(R&&h==="vertical")if(B.current>gi){const v=window.innerHeight;B.current=v,Ke(!0),O(v),be("closing")}else B.current=0,O(0),I();else h==="horizontal"&&Math.abs(_.current)>0&&(ee(_.current),I());L.current=null,z.current="none",_.current=0,G.current=!1,he(!1)};return document.addEventListener("touchstart",se,{passive:!0}),document.addEventListener("touchmove",He,{passive:!1}),document.addEventListener("touchend",Le),document.addEventListener("touchcancel",Le),()=>{document.removeEventListener("touchstart",se),document.removeEventListener("touchmove",He),document.removeEventListener("touchend",Le),document.removeEventListener("touchcancel",Le),u()}},[w,i.length,pe]),r.useEffect(()=>{const l=u=>{u.key==="Escape"&&(u.preventDefault(),u.stopPropagation(),w!=="closing"&&be("closing"))};return window.addEventListener("keydown",l,!0),()=>window.removeEventListener("keydown",l,!0)},[w]);const ke=()=>{w!=="closing"&&be("closing")},ye=w==="open",We=w==="closing",pt=P>0?Math.max(0,1-P/500):1,ft=P>0?Math.max(.35,1-P/500):1,$t=Qe&&d?{width:H.getEmbedAspect(d),height:1}:mt,g=m?we?m:ji(m,$t):null,et={position:"fixed",top:c==null?void 0:c.top,left:c==null?void 0:c.left,width:c==null?void 0:c.width,height:c==null?void 0:c.height,zIndex:9998},Y=we?"cover":"contain",yt=me!==0||P>0?`translate(${me}px, ${P}px)`:void 0,Te=Se&&!Me?"none":Me?`transform ${D}ms ${le}`:ut?`transform ${D}ms ${le}, opacity ${D}ms ${le}`:w==="opening"||We?`opacity ${D}ms ${le}`:"none",Ee={...et,transform:yt,opacity:P>0?ft:w==="opening"||We?0:1,transition:Te,pointerEvents:"none"},De={position:"absolute",top:((g==null?void 0:g.top)??0)-((c==null?void 0:c.top)??0),left:((g==null?void 0:g.left)??0)-((c==null?void 0:c.left)??0),width:g==null?void 0:g.width,height:g==null?void 0:g.height,objectFit:Y,pointerEvents:"none"},tt=(c==null?void 0:c.width)??0,re=je?(n+Ae+i.length)%i.length:null,T=re!==null?i[re]:null,kt={...et,transform:je?`translateX(${Ae*tt+me}px)`:void 0,opacity:1,transition:Me?`transform ${D}ms ${le}`:"none",pointerEvents:"none"},it={position:"absolute",top:((m==null?void 0:m.top)??0)-((c==null?void 0:c.top)??0),left:((m==null?void 0:m.left)??0)-((c==null?void 0:c.left)??0),width:m==null?void 0:m.width,height:m==null?void 0:m.height,objectFit:Y,pointerEvents:"none"},xt=Qe&&d&&H.getEmbedPlayback(d).controls&&g?Math.min(52,g.height*.2):0,E=g?{position:"fixed",top:g.top,height:g.height-xt,width:g.width/2,zIndex:9999}:null;return t.jsxs("div",{ref:Re,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:w==="open"?"none":void 0},onClick:ke,children:[t.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:ye?pt:0,transition:Se?"none":`opacity ${D}ms ${le}`,pointerEvents:"none"}}),t.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:we?t.jsxs(t.Fragment,{children:[t.jsx("div",{ref:de,style:{position:"absolute",inset:0}}),t.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ye?1:0,transition:`opacity ${D}ms ${le}`,pointerEvents:"none",zIndex:9999},children:i.length>1&&t.jsxs("p",{className:V,style:Z,children:[n+1," / ",i.length]})})]}):t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{height:"10%"}}),t.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:t.jsx("div",{ref:de,style:{width:"100%",height:"100%"}})}),t.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ye?1:0,transition:`opacity ${D}ms ${le}`},children:i.length>1&&t.jsxs("p",{className:V,style:Z,children:[n+1," / ",i.length]})})]})}),m&&c&&T&&t.jsx("div",{style:kt,onTransitionEnd:Ie,children:H.isEmbedMedia(T)?t.jsx("img",{src:T.thumbnail,alt:T.name,style:it},`neighbor-${re}-${T.assetId}`):xe(T)?t.jsx("video",{src:T.assetId,muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",style:it},`neighbor-${re}-${T.assetId}`):t.jsx("img",{src:T.assetId,alt:T.name,style:it},`neighbor-${re}-${T.assetId}`)}),m&&c&&d&&t.jsx("div",{style:Ee,onTransitionEnd:Ie,children:Qe?t.jsx(H.EmbedMediaFrame,{media:d,fit:we?"cover":"contain",lazy:!1,startsAtOnce:!0,style:De},`${n}-${d.assetId}`):gt?t.jsx(Ci,{src:d.assetId,mediaRef:ue,mediaStyle:De,onLoadedMetadata:Pe},`${n}-${d.assetId}`):t.jsx("img",{ref:ue,src:d.assetId,alt:d.name,onLoad:Pe,style:De},`${n}-${d.assetId}`)}),ye&&E&&i.length>1&&t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{...E,left:g.left,cursor:"w-resize",pointerEvents:Se?"none":"auto"},onClick:l=>{if(Q.current){Q.current=!1;return}l.stopPropagation(),fe(-1)}}),t.jsx("div",{style:{...E,left:g.left+g.width/2,cursor:"e-resize",pointerEvents:Se?"none":"auto"},onClick:l=>{if(Q.current){Q.current=!1;return}l.stopPropagation(),fe(1)}})]}),t.jsx(Ti,{prefix:e,closeIcon:J,closeIconMaxWidth:ce,closeIconColor:ve,closeIconHoverColor:S,iconMarginRight:j,contentMarginTop:Xe,isEditor:o,isPreviewMode:x,isEditMode:y,visible:ye,onClose:ke})]})}function _i(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function zi({settings:e,content:i,isEditor:n,isPreviewMode:a,isEditMode:o,metadata:x,activeEvent:y,layoutId:q,portalId:ae}){const{prefix:s}=ni.useScopedStyles(),{type:V="a",gridLayout:Z,textBoxWidth:J=100,verticalGap:ce,entriesCount:ve,lightbox:S,imageDisplay:j,imageCorners:Xe,lightboxImageDisplay:we,slider:Re,sliderTiming:de,direction:ue,transition:L,titleMarginTop:B,subtitleMarginTop:_,titleColor:z,subtitleColor:G,lightboxCounterColor:Q,titleFontFamily:Ue,titleFontSettings:k,titleFontSize:M,titleLineHeight:N,titleLetterSpacing:ie,titleWordSpacing:X,titleTextAppearance:Fe,subtitleFontFamily:Ye,subtitleFontSettings:m,subtitleFontSize:Ve,subtitleLineHeight:c,subtitleLetterSpacing:dt,subtitleWordSpacing:w,subtitleTextAppearance:be,lightboxCounterFontFamily:P,lightboxCounterFontSettings:O,lightboxCounterFontSize:me,lightboxCounterLineHeight:W,lightboxCounterLetterSpacing:Ae,lightboxCounterWordSpacing:ne,lightboxCounterTextAppearance:Me,closeIcon:ge,closeIconMaxWidth:Se,closeIconColor:he,closeIconHoverColor:ut,iconMarginRight:Ke,contentMarginTop:mt,showText:Ze="always",hover:Oe="none",alignEntries:Je="off",align:d="top"}=e,gt={fontSettings:{fontFamily:Ue,fontWeight:(k==null?void 0:k.fontWeight)??400,fontStyle:(k==null?void 0:k.fontStyle)??"normal"},fontSize:M??.01,lineHeight:N,letterSpacing:ie??0,wordSpacing:X??0,textAppearance:Fe,color:z},je={...Ne.omitTextColors(Ne.textStylesToCss(gt,n))},Pe={fontSettings:{fontFamily:Ye,fontWeight:(m==null?void 0:m.fontWeight)??400,fontStyle:(m==null?void 0:m.fontStyle)??"normal"},fontSize:Ve??.01,lineHeight:c,letterSpacing:dt??0,wordSpacing:w??0,textAppearance:be,color:G},U={...Ne.omitTextColors(Ne.textStylesToCss(Pe,n))},Ce={fontSettings:{fontFamily:P,fontWeight:(O==null?void 0:O.fontWeight)??400,fontStyle:(O==null?void 0:O.fontStyle)??"normal"},fontSize:me??.01,lineHeight:W,letterSpacing:Ae??0,wordSpacing:ne??0,textAppearance:Me,color:Q},pe={...Ne.omitTextColors(Ne.textStylesToCss(Ce,n)),...jt(me,W,s,n)},fe=St(M,N,`${s}-item-title`,`${s}-text-tight-leading`),Ie=St(Ve,c,`${s}-item-subtitle`,`${s}-text-tight-leading`),$e=jt(M,N,s,n),ke=jt(Ve,c,s,n),ye=St(me,W,`${s}-lightbox-counter`,`${s}-text-tight-leading`),We=ii.buildColorVars(s,{titleColor:z,subtitleColor:G,lightboxCounterColor:Q},Ni,Ri),pt=y&&y!=="default"?`${s}-state-${y}`:"",ft=Ze==="on hover"&&(!n||a),$t=Oe!=="none"&&(!n||a)?` ${s}-hover-${Oe}`:"",g=`${pt}${ft?` ${s}-show-text-hover`:""}${$t}`.trim(),et=ve===0?1/0:ve,Y=(i??[]).slice(0,et),yt=r.useMemo(()=>S==="on"?yi(Y):[],[Y,S]),Te=Z.entryWidth??.2,Ee=(j==null?void 0:j.display)==="cover",De=(j==null?void 0:j.ratioValue)??"1:1",tt=(j==null?void 0:j.reversed)??!1,[re,T]=De.split(":").map(Number),xt=`${tt?T:re} / ${tt?re:T}`,E=Z.columnsCount,l=f.scalingValue(Te??0,n),u=l,I=!Ee&&Re!=="off",ee=Y.length%E||E,se=ee<E&&Y.length>0,He=Y.length-ee,Le=se?Math.floor((E-ee)/2)+1:1,h=Xe?f.scalingValue(Xe,n):void 0,R={width:u,...Ee?{aspectRatio:xt,height:"auto",overflow:"hidden"}:{height:"auto"},...h?{borderRadius:h,overflow:"hidden"}:{}},te=`${s}-item-image-wrapper${I?` ${s}-item-image-wrapper-fit-slider`:""}`.trim(),v=V==="d"||V==="e"||V==="f",F=Je==="on",_e=`calc(${f.scalingValue(Te??0,n)} * (${J} / 100))`,oe=f.scalingValue(Te*J/100,n),Tt=h?{borderRadius:h,[qt]:h}:{},Lt=Ee?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...Tt}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...Tt},[Gt,Xt]=r.useState(0),nt=r.useRef(null),Ut=L==="fade"||ue==="horizontal"?"ltr":ue==="vertical"?"ttb":"ltr";r.useEffect(()=>{const p=nt.current;if(!p)return;const b=new ResizeObserver(A=>{Xt(Math.round(A[0].contentRect.width))});return b.observe(p),()=>b.disconnect()},[]);const Yt=(()=>{const p={...We},b=nt.current?getComputedStyle(nt.current).getPropertyValue("--cntrl-article-width").trim():"";return b&&(p["--cntrl-article-width"]=b),p})(),[vt,wt]=r.useState(!1),[rt,Kt]=r.useState([]),[Zt,bt]=r.useState(0),_t=S==="on"&&(!n||a),zt=(p,b)=>{n&&!a||S!=="off"&&(Kt(p),bt(b),wt(!0))};r.useEffect(()=>{if(!vt||S!=="on"||typeof document>"u")return;const p=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=p}},[vt,S]),r.useEffect(()=>{!n||a||wt(!1)},[n,a]);const Jt=r.useMemo(()=>ai(s),[s]);return t.jsxs(t.Fragment,{children:[t.jsx("style",{dangerouslySetInnerHTML:{__html:Jt}}),S==="on"&&t.jsx(xi,{mediaList:yt}),t.jsx("div",{style:We,children:t.jsx("div",{ref:nt,className:`${s}-wrapper ${s}-type-${V}${F?` ${s}-align-entries`:""} ${s}-image-align-${d} ${g}`.trim(),style:{gridTemplateColumns:`repeat(${E}, ${l})`,rowGap:F?0:f.scalingValue(ce??0,n),columnGap:f.scalingValue(Z.horizontalGap??0,n),width:f.scalingValue(Z.wrapperWidth??0,n),...F?{[`--${s}-align-entries-row-gap`]:f.scalingValue(ce??0,n)}:{}},children:Y.map((p,b)=>{var At;const A=Ot(p.title),K=Ot(p.subtitle),ze=S==="off"&&((At=p.link)!=null&&At.value)?p.link:void 0,Qt=Math.floor(b/E)===Math.ceil(Y.length/E)-1,st=se&&b>=He?`${Le+(b-He)}`:void 0,Nt=v?t.jsxs("div",{className:`${s}-item-text-block`,children:[A&&t.jsx("p",{className:fe,style:{width:_e,...je,...$e},children:p.title}),A&&t.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${s}-control`:void 0,style:{height:f.scalingValue(B??0,n),width:oe}}),K&&t.jsx("p",{className:Ie,style:{width:_e,...U,...ke},children:p.subtitle}),K&&t.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${s}-control`:void 0,style:{height:f.scalingValue(_??0,n),width:oe}})]}):null,Pt=F?t.jsxs("div",{className:`${s}-item-title-row`,children:[!v&&t.jsx("div",{"data-controls":o&&A?"titleMarginTop":void 0,className:o&&A?`${s}-control`:void 0,style:{height:A?f.scalingValue(B??0,n):0,width:oe}}),A&&t.jsx("p",{className:fe,style:{width:_e,...je,...$e},children:p.title}),v&&A&&t.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${s}-control`:void 0,style:{height:f.scalingValue(B??0,n),width:oe}})]}):null,ei=F?t.jsxs("div",{className:`${s}-item-subtitle-row`,children:[!v&&t.jsx("div",{"data-controls":o&&K?"subtitleMarginTop":void 0,className:o&&K?`${s}-control`:void 0,style:{height:K?f.scalingValue(_??0,n):0,width:oe}}),K&&t.jsx("p",{className:Ie,style:{width:_e,...U,...ke},children:p.subtitle}),v&&K&&t.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${s}-control`:void 0,style:{height:f.scalingValue(_??0,n),width:oe}})]}):null,Rt=t.jsxs(ct.LinkWrapper,{link:ze,className:`${s}-item-text-link`,children:[Pt,ei]}),qe=Bt(p.gallery),ot=qe.filter($=>$.lightboxMedia).map($=>$.lightboxMedia),lt=t.jsx(Si,{className:te,style:R,children:qe.length===0?null:Re==="off"?(()=>{const{displayMedia:$,lightboxMedia:Be}=qe[0],Ge=Be?ot.findIndex(at=>at.assetId===Be.assetId):-1;return t.jsx(Wt,{media:$,className:`${s}-item-${xe($)?"video":"image"}`.trim(),style:Lt,hasLightbox:S==="on",onMediaClick:_t&&Ge>=0?()=>zt(ot,Ge):void 0})})():t.jsxs(t.Fragment,{children:[I&&t.jsx("div",{className:`${s}-item-image-wrapper-sizer`,"aria-hidden":"true",children:qe.map(({displayMedia:$})=>H.isEmbedMedia($)?t.jsx("div",{style:{aspectRatio:`${H.getEmbedAspect($)}`}},`sizer-${$.assetId}`):xe($)?t.jsx(Ht.LazyVideo,{src:$.assetId,nearPreload:"metadata",muted:!0,playsInline:!0},`sizer-${$.assetId}`):t.jsx("img",{src:$.assetId,alt:""},`sizer-${$.assetId}`))}),t.jsx(Mt.Splide2,{className:`${s}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:de*1e3,width:"100%",height:"100%",speed:mi,type:L==="fade"?"fade":"loop",rewind:L==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:Ut},onMoved:$=>{ue!=="random"||L==="fade"||ui($)},children:qe.map(({displayMedia:$,lightboxMedia:Be},Ge)=>{const at=Be?ot.findIndex(ti=>ti.assetId===Be.assetId):-1;return t.jsx(Mt.SplideSlide,{"data-slide-index":Ge,children:t.jsx(Wt,{media:$,className:`${s}-item-${xe($)?"video":"image"}`.trim(),style:Lt,hasLightbox:S==="on",isSplideSlide:!0,onMediaClick:_t&&at>=0?()=>zt(ot,at):void 0})},Ge)})},`${L}-${Te}-${ue}-${de}-${Gt}-${q}`)]})}),Ft=v?null:t.jsxs(t.Fragment,{children:[t.jsx("div",{"data-controls":o&&A?"titleMarginTop":void 0,className:o&&A?`${s}-control`:void 0,style:{height:A?f.scalingValue(B??0,n):0,width:oe}}),t.jsx("p",{className:fe,style:{width:_e,...je,...$e},children:p.title}),t.jsx("div",{"data-controls":o&&K?"subtitleMarginTop":void 0,className:o&&K?`${s}-control`:void 0,style:{height:K?f.scalingValue(_??0,n):0,width:oe}}),t.jsx("p",{className:Ie,style:{width:_e,...U,...ke},children:p.subtitle})]}),Vt=ze?t.jsx(ct.LinkWrapper,{link:ze,className:`${s}-item-image-link`,children:lt}):t.jsx("a",{className:`${s}-item-image-link`,children:lt});return t.jsx("div",{className:`${s}-item`.trim(),style:st&&!F?{gridColumn:st}:void 0,children:t.jsx("div",{className:`${o?`${s}-item-inner`:`${s}-item-inner-hidden`}${F&&Qt?` ${s}-item-inner-last-row`:""}`.trim(),style:{width:(J??0)>100?`calc(${l} * (${J} / 100))`:l,...st&&F?{gridColumn:st}:{}},children:F?t.jsx(t.Fragment,{children:v?t.jsxs(t.Fragment,{children:[Rt,Vt]}):t.jsxs(t.Fragment,{children:[Vt,Rt]})}):ze?t.jsxs(t.Fragment,{children:[t.jsxs(ct.LinkWrapper,{link:ze,className:`${s}-item-image-link`,children:[Nt,lt]}),!v&&t.jsx(ct.LinkWrapper,{link:ze,className:`${s}-item-text-link`,children:Ft})]}):t.jsxs(t.Fragment,{children:[Nt,lt,Ft]})})},b)})})}),(!n||a)&&vt&&typeof document<"u"&&S==="on"&&(()=>{const p=(ae?document.getElementById(ae):null)??document.body;return ri.createPortal(t.jsx("div",{style:Yt,"data-selection":"none",children:t.jsx(Li,{prefix:s,items:rt,index:Zt,imageDisplay:_i(we),isEditor:n,isPreviewMode:a,isEditMode:o,closeIcon:ge,closeIconMaxWidth:Se,closeIconColor:he,closeIconHoverColor:ut,iconMarginRight:Ke,contentMarginTop:mt,onClose:()=>wt(!1),onPrev:()=>bt(b=>(b-1+rt.length)%rt.length),onNext:()=>bt(b=>(b+1)%rt.length),counterClassName:ye,counterStyle:pe})}),p)})()]})}const Ni={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},Ri=["hover","focus","filled","success","error"];exports.Grid=zi;
|