@cntrl-site/components 1.0.118-alpha.3 → 1.0.118-alpha.4
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-C3yVbQcq.js → Burger-B4kXX9aY.js} +1 -1
- package/dist/{Burger-BkVgNMGU.mjs → Burger-DyORh_vF.mjs} +1 -1
- package/dist/{ChroniclesComponent-DD3tqNNm.mjs → ChroniclesComponent-DVoJ0kdT.mjs} +442 -512
- package/dist/ChroniclesComponent-Nm_yIRmr.js +1 -0
- package/dist/Components/Grid/Grid.d.ts +7 -25
- package/dist/Components/PopupMenu/PopupMenu.d.ts +73 -0
- package/dist/Components/PopupMenu/PopupMenuComponent.d.ts +594 -0
- package/dist/Components/PopupMenu/popupMenuLayout.d.ts +203 -0
- package/dist/Components/PopupMenu/popupMenuSnap.d.ts +61 -0
- package/dist/Components/helpers/SvgImage/loadSvgMaskUrl.d.ts +7 -0
- package/dist/{ControlSlider-BBAXRDLP.mjs → ControlSlider-3w-bHQEg.mjs} +4 -3
- package/dist/ControlSlider-DB4nbVLT.js +1 -0
- package/dist/{FAQ-DLh63Utr.js → FAQ-7HEkaoU6.js} +1 -1
- package/dist/{FAQ-CJHCMSBa.mjs → FAQ-GmiwRdFq.mjs} +1 -1
- package/dist/Grid-BuRdth9A.mjs +1622 -0
- package/dist/Grid-tqSSYh2-.js +408 -0
- package/dist/{Hive-CzabuuCc.js → Hive-34KvKNsa.js} +1 -1
- package/dist/{Hive-DyxYd5eg.mjs → Hive-7xHXyMM1.mjs} +1 -1
- package/dist/{HiveLightboxTitles-DhEeFKWs.mjs → HiveLightboxTitles-BCoL46-V.mjs} +1 -1
- package/dist/{HiveLightboxTitles-DlyptAaK.js → HiveLightboxTitles-DEeyQGcf.js} +1 -1
- package/dist/{Lightbox-DZckgBzK.js → Lightbox-Cb7lyaNt.js} +1 -1
- package/dist/{Lightbox-BY99NS14.mjs → Lightbox-DzPqgKP4.mjs} +1 -1
- package/dist/{LightboxJournal-Bf_rZzmz.js → LightboxJournal-B-vul_be.js} +1 -1
- package/dist/{LightboxJournal-BDUs6T0B.mjs → LightboxJournal-DisD2DLv.mjs} +1 -1
- package/dist/{LightboxStrip-RA4ABUC-.js → LightboxStrip-YDyEPEb6.js} +1 -1
- package/dist/{LightboxStrip-Cuhb2fIR.mjs → LightboxStrip-wCHUhAqN.mjs} +1 -1
- package/dist/{Mercury-B-s2Kvuq.js → Mercury-BmhtFYOw.js} +1 -1
- package/dist/{Mercury-CCW0Es-s.mjs → Mercury-Q788wrYQ.mjs} +1 -1
- package/dist/{OnelinerForm-C2Y_XMCY.js → OnelinerForm-CUmY-bXL.js} +1 -1
- package/dist/{OnelinerForm-BEu7_sho.mjs → OnelinerForm-D8WIB9Qy.mjs} +1 -1
- package/dist/PopupMenu-CYdDyzEt.mjs +1372 -0
- package/dist/PopupMenu-Di1fHgho.js +409 -0
- package/dist/{SimpleButton-C-o2W9bS.mjs → SimpleButton-DTpzfmb6.mjs} +1 -1
- package/dist/{SimpleButton-nGEcO2gB.js → SimpleButton-DtaCYa3y.js} +1 -1
- package/dist/{Slider20-DUi6qwnd.mjs → Slider20-CKngROrc.mjs} +1 -1
- package/dist/{Slider20-BOmjDRf2.js → Slider20-q0iGgnE3.js} +1 -1
- package/dist/SvgImage-CwRq9-ec.mjs +56 -0
- package/dist/SvgImage-_QN8ngad.js +1 -0
- package/dist/{TestimonialSingle-DrnyReim.mjs → TestimonialSingle-Bax71Hyo.mjs} +1 -1
- package/dist/{TestimonialSingle-BORQom3u.js → TestimonialSingle-CpEUendN.js} +1 -1
- package/dist/{Waterfall-DII4-WV5.js → Waterfall-B9YWMhrg.js} +1 -1
- package/dist/{Waterfall-3kKioKh2.mjs → Waterfall-znaoynn5.mjs} +1 -1
- package/dist/components-BYoTPJk3.js +1 -0
- package/dist/{components-BwAmTGJp.mjs → components-eK82xypT.mjs} +653 -30
- package/dist/components.css +1 -1
- package/dist/elements.js +1 -1
- package/dist/elements.mjs +24 -24
- package/dist/elements.node.js +1 -1
- package/dist/elements.node.mjs +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +63 -36
- package/dist/loadSvgMaskUrl-B6kHUyof.js +1 -0
- package/dist/loadSvgMaskUrl-DUhCVvpl.mjs +39 -0
- package/dist/sources.js +233 -514
- package/dist/sources.mjs +273 -555
- package/dist/types/Component.d.ts +7 -0
- package/dist/types/SchemaV1.d.ts +3 -0
- package/package.json +1 -1
- package/dist/ChroniclesComponent-BMbUwzk6.js +0 -1
- package/dist/Components/Grid/CustomGridComponent.d.ts +0 -41
- package/dist/ControlSlider-BCkVFl4w.js +0 -1
- package/dist/Grid-CUaVUaRa.js +0 -441
- package/dist/Grid-D19xZ_mh.mjs +0 -1800
- package/dist/SvgImage-B5mR9y6q.mjs +0 -51
- package/dist/SvgImage-DFlmxAoL.js +0 -1
- package/dist/components-D8RelPGE.js +0 -1
- package/dist/loadSvgMaskUrl-DfF7ay6h.js +0 -1
- package/dist/loadSvgMaskUrl-xHgGYgPe.mjs +0 -20
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { Grid } from './Grid';
|
|
2
|
-
import { ComponentSchemaV1 } from '../../types/SchemaV1';
|
|
3
|
-
export declare const CustomGridComponent: {
|
|
4
|
-
element: typeof Grid;
|
|
5
|
-
id: string;
|
|
6
|
-
name: string;
|
|
7
|
-
schema: ComponentSchemaV1;
|
|
8
|
-
category: string;
|
|
9
|
-
layoutMode: "structured";
|
|
10
|
-
preview: {
|
|
11
|
-
type: "image";
|
|
12
|
-
url: string;
|
|
13
|
-
};
|
|
14
|
-
version: number;
|
|
15
|
-
defaultSize: {
|
|
16
|
-
d: {
|
|
17
|
-
width: number;
|
|
18
|
-
height: number;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
assetsPaths: {
|
|
22
|
-
content: {
|
|
23
|
-
path: string;
|
|
24
|
-
placeholderEnabled: boolean;
|
|
25
|
-
}[];
|
|
26
|
-
parameters: {
|
|
27
|
-
path: string;
|
|
28
|
-
}[];
|
|
29
|
-
};
|
|
30
|
-
fontSettingsPaths: {
|
|
31
|
-
content: never[];
|
|
32
|
-
parameters: {
|
|
33
|
-
path: string;
|
|
34
|
-
}[];
|
|
35
|
-
};
|
|
36
|
-
fontRelations: {
|
|
37
|
-
titleFontSettings: string;
|
|
38
|
-
subtitleFontSettings: string;
|
|
39
|
-
lightboxCounterFontSettings: string;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
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"),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,D]=g.useState(null),[S,$]=g.useState(0),[q,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:D,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=>{$(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))},q),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;
|
package/dist/Grid-CUaVUaRa.js
DELETED
|
@@ -1,441 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),b=require("./scalingValue-CSHYgTZl.js"),$n=require("./buildColorVars-CE2D5cQV.js"),xn=require("./useScopedStyles-Bf6yohVQ.js"),Pt=require("./useLazyVideos-CdCbc2j0.js"),pt=require("./LinkWrapper-CTqM1ucO.js"),ae=require("./EmbedMediaFrame-DsOTKE4i.js"),r=require("react"),yn=require("react-dom"),De=require("./textStylesToCss-CNN3zZTV.js"),vn=require("./SvgImage-DFlmxAoL.js"),en=require("./LazyVideo-imbU18js.js");function wn(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Kt(e){return((e==null?void 0:e.trim().length)??0)>0}function Tt(e,i,t,a){return i!==void 0&&i<(e??.01)?`${t} ${a}`:t}function Lt(e,i,t,a){const l=e??.01;return i===void 0||i>=l?{}:{[`--${t}-title-leading-gap`]:b.scalingValue((l-i)/2,a)}}const Mt=400,Rt="cubic-bezier(0.25, 0.1, 0.25, 1)",bn=1.1,tn="--grid-media-radius";function Sn(e){return`
|
|
2
|
-
.${e}-wrapper {
|
|
3
|
-
display: grid;
|
|
4
|
-
align-items: start;
|
|
5
|
-
justify-content: center;
|
|
6
|
-
min-height: ${wn(48)};
|
|
7
|
-
}
|
|
8
|
-
.${e}-item {
|
|
9
|
-
display: flex;
|
|
10
|
-
flex-direction: column;
|
|
11
|
-
justify-content: center;
|
|
12
|
-
align-items: center;
|
|
13
|
-
}
|
|
14
|
-
.${e}-item-inner {
|
|
15
|
-
display: flex;
|
|
16
|
-
flex-direction: column;
|
|
17
|
-
align-items: center;
|
|
18
|
-
outline: 1px solid #FF5C02;
|
|
19
|
-
}
|
|
20
|
-
.${e}-item-inner-hidden {
|
|
21
|
-
display: flex;
|
|
22
|
-
flex-direction: column;
|
|
23
|
-
align-items: center;
|
|
24
|
-
}
|
|
25
|
-
.${e}-item-image-wrapper {
|
|
26
|
-
display: flex;
|
|
27
|
-
justify-content: center;
|
|
28
|
-
align-items: center;
|
|
29
|
-
align-self: center;
|
|
30
|
-
}
|
|
31
|
-
.${e}-item-image-wrapper-fit-slider {
|
|
32
|
-
display: grid;
|
|
33
|
-
overflow: hidden;
|
|
34
|
-
position: relative;
|
|
35
|
-
}
|
|
36
|
-
.${e}-item-image-wrapper-fit-slider > .${e}-item-image-wrapper-sizer {
|
|
37
|
-
grid-area: 1 / 1;
|
|
38
|
-
width: 100%;
|
|
39
|
-
display: grid;
|
|
40
|
-
visibility: hidden;
|
|
41
|
-
pointer-events: none;
|
|
42
|
-
}
|
|
43
|
-
.${e}-item-image-wrapper-fit-slider > .${e}-item-image-wrapper-sizer img {
|
|
44
|
-
grid-area: 1 / 1;
|
|
45
|
-
width: auto;
|
|
46
|
-
height: auto;
|
|
47
|
-
max-width: 100%;
|
|
48
|
-
object-fit: contain;
|
|
49
|
-
}
|
|
50
|
-
.${e}-item-image-wrapper-fit-slider > .${e}-item-image-wrapper-sizer video {
|
|
51
|
-
grid-area: 1 / 1;
|
|
52
|
-
width: auto;
|
|
53
|
-
height: auto;
|
|
54
|
-
max-width: 100%;
|
|
55
|
-
object-fit: contain;
|
|
56
|
-
}
|
|
57
|
-
.${e}-item-image-wrapper-fit-slider > .${e}-item-image-wrapper-sizer div {
|
|
58
|
-
grid-area: 1 / 1;
|
|
59
|
-
width: 100%;
|
|
60
|
-
}
|
|
61
|
-
.${e}-item-image-wrapper-fit-slider > .${e}-item-slider {
|
|
62
|
-
position: absolute;
|
|
63
|
-
inset: 0;
|
|
64
|
-
width: 100%;
|
|
65
|
-
overflow: hidden;
|
|
66
|
-
}
|
|
67
|
-
.${e}-item-image-link {
|
|
68
|
-
width: 100%;
|
|
69
|
-
display: flex;
|
|
70
|
-
flex-direction: column;
|
|
71
|
-
align-items: center;
|
|
72
|
-
}
|
|
73
|
-
.${e}-custom-layout .${e}-item-image-link {
|
|
74
|
-
flex: 1 1 0%;
|
|
75
|
-
min-height: 0;
|
|
76
|
-
}
|
|
77
|
-
.${e}-custom-layout.${e}-text-outside .${e}-item-image-link {
|
|
78
|
-
flex: none;
|
|
79
|
-
}
|
|
80
|
-
.${e}-item-text-link {
|
|
81
|
-
display: flex;
|
|
82
|
-
flex-direction: column;
|
|
83
|
-
align-items: center;
|
|
84
|
-
width: 100%;
|
|
85
|
-
color: inherit;
|
|
86
|
-
text-decoration: none;
|
|
87
|
-
}
|
|
88
|
-
.${e}-item-image {
|
|
89
|
-
width: 100%;
|
|
90
|
-
height: 100%;
|
|
91
|
-
display: block;
|
|
92
|
-
max-width: 100%;
|
|
93
|
-
}
|
|
94
|
-
.${e}-item-video {
|
|
95
|
-
width: 100%;
|
|
96
|
-
height: 100%;
|
|
97
|
-
display: block;
|
|
98
|
-
max-width: 100%;
|
|
99
|
-
}
|
|
100
|
-
.${e}-item-slider {
|
|
101
|
-
position: relative;
|
|
102
|
-
width: 100%;
|
|
103
|
-
height: 100%;
|
|
104
|
-
overflow: hidden;
|
|
105
|
-
}
|
|
106
|
-
.${e}-item-slider-list {
|
|
107
|
-
position: relative;
|
|
108
|
-
display: flex;
|
|
109
|
-
flex-direction: row;
|
|
110
|
-
width: 100%;
|
|
111
|
-
height: 100%;
|
|
112
|
-
will-change: transform;
|
|
113
|
-
}
|
|
114
|
-
.${e}-item-slider-list-vertical {
|
|
115
|
-
flex-direction: column;
|
|
116
|
-
}
|
|
117
|
-
.${e}-item-slider-list-fade {
|
|
118
|
-
display: block;
|
|
119
|
-
will-change: auto;
|
|
120
|
-
}
|
|
121
|
-
.${e}-item-slide {
|
|
122
|
-
position: relative;
|
|
123
|
-
flex: 0 0 100%;
|
|
124
|
-
width: 100%;
|
|
125
|
-
height: 100%;
|
|
126
|
-
display: flex;
|
|
127
|
-
justify-content: center;
|
|
128
|
-
align-items: center;
|
|
129
|
-
}
|
|
130
|
-
.${e}-item-slider-list-fade .${e}-item-slide {
|
|
131
|
-
position: absolute;
|
|
132
|
-
top: 0;
|
|
133
|
-
left: 0;
|
|
134
|
-
opacity: 0;
|
|
135
|
-
transition: opacity ${zt}ms ${nn};
|
|
136
|
-
}
|
|
137
|
-
.${e}-item-slider-list-fade .${e}-item-slide-active {
|
|
138
|
-
opacity: 1;
|
|
139
|
-
z-index: 1;
|
|
140
|
-
}
|
|
141
|
-
.${e}-item-title {
|
|
142
|
-
white-space: normal;
|
|
143
|
-
overflow-wrap: anywhere;
|
|
144
|
-
word-break: break-word;
|
|
145
|
-
text-align: center;
|
|
146
|
-
margin-bottom: 0px;
|
|
147
|
-
margin-top: 0px;
|
|
148
|
-
color: var(--${e}-title-color);
|
|
149
|
-
}
|
|
150
|
-
.${e}-item-subtitle {
|
|
151
|
-
white-space: normal;
|
|
152
|
-
overflow-wrap: anywhere;
|
|
153
|
-
word-break: break-word;
|
|
154
|
-
text-align: center;
|
|
155
|
-
margin-bottom: 0px;
|
|
156
|
-
margin-top: 0px;
|
|
157
|
-
color: var(--${e}-subtitle-color);
|
|
158
|
-
}
|
|
159
|
-
.${e}-text-tight-leading {
|
|
160
|
-
display: block;
|
|
161
|
-
flex-shrink: 0;
|
|
162
|
-
padding-top: var(--${e}-title-leading-gap, 0);
|
|
163
|
-
padding-bottom: var(--${e}-title-leading-gap, 0);
|
|
164
|
-
}
|
|
165
|
-
.${e}-show-text-hover .${e}-item-title,
|
|
166
|
-
.${e}-show-text-hover .${e}-item-subtitle {
|
|
167
|
-
opacity: 0;
|
|
168
|
-
transition: opacity 250ms;
|
|
169
|
-
}
|
|
170
|
-
.${e}-show-text-hover .${e}-item-inner:hover .${e}-item-title,
|
|
171
|
-
.${e}-show-text-hover .${e}-item-inner:hover .${e}-item-subtitle,
|
|
172
|
-
.${e}-show-text-hover .${e}-item-inner-hidden:hover .${e}-item-title,
|
|
173
|
-
.${e}-show-text-hover .${e}-item-inner-hidden:hover .${e}-item-subtitle {
|
|
174
|
-
opacity: 1;
|
|
175
|
-
}
|
|
176
|
-
@property --${e}-hover-zoom {
|
|
177
|
-
syntax: '<number>';
|
|
178
|
-
inherits: false;
|
|
179
|
-
initial-value: 1;
|
|
180
|
-
}
|
|
181
|
-
.${e}-hover-zoom-in .${e}-item-image,
|
|
182
|
-
.${e}-hover-zoom-in .${e}-item-video {
|
|
183
|
-
transform: scale(var(--${e}-hover-zoom));
|
|
184
|
-
clip-path: inset(calc(50% - 50% / var(--${e}-hover-zoom)) round calc(var(${tn}, 0px) / var(--${e}-hover-zoom)));
|
|
185
|
-
transition: --${e}-hover-zoom ${Mt}ms ${Rt};
|
|
186
|
-
}
|
|
187
|
-
.${e}-hover-scale-down .${e}-item-image,
|
|
188
|
-
.${e}-hover-scale-down .${e}-item-video {
|
|
189
|
-
transition: transform ${Mt}ms ${Rt};
|
|
190
|
-
}
|
|
191
|
-
.${e}-hover-greyscale .${e}-item-image-wrapper {
|
|
192
|
-
transition: filter ${Mt}ms ${Rt};
|
|
193
|
-
}
|
|
194
|
-
@media (hover: hover) {
|
|
195
|
-
.${e}-hover-zoom-in .${e}-item-image-wrapper:has(.${e}-item-image:hover, .${e}-item-video:hover) :is(.${e}-item-image, .${e}-item-video) {
|
|
196
|
-
--${e}-hover-zoom: ${bn};
|
|
197
|
-
}
|
|
198
|
-
.${e}-hover-scale-down .${e}-item-image-wrapper:hover .${e}-item-image,
|
|
199
|
-
.${e}-hover-scale-down .${e}-item-image-wrapper:hover .${e}-item-video {
|
|
200
|
-
transform: scale(0.9);
|
|
201
|
-
}
|
|
202
|
-
.${e}-hover-greyscale:has(.${e}-item-image:hover, .${e}-item-video:hover) .${e}-item-image-wrapper:not(:has(.${e}-item-image:hover, .${e}-item-video:hover)) {
|
|
203
|
-
filter: grayscale(1);
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
.${e}-type-a .${e}-item-inner,
|
|
207
|
-
.${e}-type-a .${e}-item-inner-hidden,
|
|
208
|
-
.${e}-type-d .${e}-item-inner,
|
|
209
|
-
.${e}-type-d .${e}-item-inner-hidden {
|
|
210
|
-
align-items: flex-start;
|
|
211
|
-
}
|
|
212
|
-
.${e}-type-b .${e}-item-inner,
|
|
213
|
-
.${e}-type-b .${e}-item-inner-hidden,
|
|
214
|
-
.${e}-type-e .${e}-item-inner,
|
|
215
|
-
.${e}-type-e .${e}-item-inner-hidden {
|
|
216
|
-
align-items: center;
|
|
217
|
-
}
|
|
218
|
-
.${e}-type-c .${e}-item-inner,
|
|
219
|
-
.${e}-type-c .${e}-item-inner-hidden,
|
|
220
|
-
.${e}-type-f .${e}-item-inner,
|
|
221
|
-
.${e}-type-f .${e}-item-inner-hidden {
|
|
222
|
-
align-items: flex-end;
|
|
223
|
-
}
|
|
224
|
-
.${e}-type-a .${e}-item-image-link,
|
|
225
|
-
.${e}-type-b .${e}-item-image-link,
|
|
226
|
-
.${e}-type-c .${e}-item-image-link,
|
|
227
|
-
.${e}-type-d .${e}-item-image-link,
|
|
228
|
-
.${e}-type-e .${e}-item-image-link,
|
|
229
|
-
.${e}-type-f .${e}-item-image-link {
|
|
230
|
-
align-items: center;
|
|
231
|
-
}
|
|
232
|
-
.${e}-type-a .${e}-item-title,
|
|
233
|
-
.${e}-type-a .${e}-item-subtitle,
|
|
234
|
-
.${e}-type-d .${e}-item-title,
|
|
235
|
-
.${e}-type-d .${e}-item-subtitle {
|
|
236
|
-
text-align: left;
|
|
237
|
-
}
|
|
238
|
-
.${e}-type-b .${e}-item-title,
|
|
239
|
-
.${e}-type-b .${e}-item-subtitle,
|
|
240
|
-
.${e}-type-e .${e}-item-title,
|
|
241
|
-
.${e}-type-e .${e}-item-subtitle {
|
|
242
|
-
text-align: center;
|
|
243
|
-
}
|
|
244
|
-
.${e}-type-c .${e}-item-title,
|
|
245
|
-
.${e}-type-c .${e}-item-subtitle,
|
|
246
|
-
.${e}-type-f .${e}-item-title,
|
|
247
|
-
.${e}-type-f .${e}-item-subtitle {
|
|
248
|
-
text-align: right;
|
|
249
|
-
}
|
|
250
|
-
.${e}-item-text-block {
|
|
251
|
-
display: flex;
|
|
252
|
-
flex-direction: column;
|
|
253
|
-
align-items: flex-start;
|
|
254
|
-
width: 100%;
|
|
255
|
-
flex-shrink: 0;
|
|
256
|
-
}
|
|
257
|
-
.${e}-type-d .${e}-item-text-block {
|
|
258
|
-
align-items: flex-start;
|
|
259
|
-
}
|
|
260
|
-
.${e}-type-e .${e}-item-text-block {
|
|
261
|
-
align-items: center;
|
|
262
|
-
}
|
|
263
|
-
.${e}-type-f .${e}-item-text-block {
|
|
264
|
-
align-items: flex-end;
|
|
265
|
-
}
|
|
266
|
-
.${e}-type-a .${e}-item-text-link,
|
|
267
|
-
.${e}-type-d .${e}-item-text-link {
|
|
268
|
-
align-items: flex-start;
|
|
269
|
-
}
|
|
270
|
-
.${e}-type-b .${e}-item-text-link,
|
|
271
|
-
.${e}-type-e .${e}-item-text-link {
|
|
272
|
-
align-items: center;
|
|
273
|
-
}
|
|
274
|
-
.${e}-type-c .${e}-item-text-link,
|
|
275
|
-
.${e}-type-f .${e}-item-text-link {
|
|
276
|
-
align-items: flex-end;
|
|
277
|
-
}
|
|
278
|
-
.${e}-image-align-top .${e}-item-image-wrapper:not(.${e}-item-image-wrapper-fit-slider) {
|
|
279
|
-
align-items: flex-start;
|
|
280
|
-
}
|
|
281
|
-
.${e}-image-align-center .${e}-item-image-wrapper:not(.${e}-item-image-wrapper-fit-slider) {
|
|
282
|
-
align-items: center;
|
|
283
|
-
}
|
|
284
|
-
.${e}-image-align-bottom .${e}-item-image-wrapper:not(.${e}-item-image-wrapper-fit-slider) {
|
|
285
|
-
align-items: flex-end;
|
|
286
|
-
}
|
|
287
|
-
.${e}-image-align-top .${e}-item-slider .${e}-item-slide {
|
|
288
|
-
align-items: flex-start;
|
|
289
|
-
}
|
|
290
|
-
.${e}-image-align-center .${e}-item-slider .${e}-item-slide {
|
|
291
|
-
align-items: center;
|
|
292
|
-
}
|
|
293
|
-
.${e}-image-align-bottom .${e}-item-slider .${e}-item-slide {
|
|
294
|
-
align-items: flex-end;
|
|
295
|
-
}
|
|
296
|
-
.${e}-align-entries .${e}-item {
|
|
297
|
-
display: contents;
|
|
298
|
-
}
|
|
299
|
-
.${e}-align-entries .${e}-item-inner,
|
|
300
|
-
.${e}-align-entries .${e}-item-inner-hidden {
|
|
301
|
-
display: grid;
|
|
302
|
-
grid-template-rows: subgrid;
|
|
303
|
-
grid-row: span 3;
|
|
304
|
-
justify-self: center;
|
|
305
|
-
margin-bottom: var(--${e}-align-entries-row-gap, 0);
|
|
306
|
-
}
|
|
307
|
-
.${e}-align-entries .${e}-item-inner-last-row {
|
|
308
|
-
margin-bottom: 0;
|
|
309
|
-
}
|
|
310
|
-
.${e}-align-entries .${e}-item-text-link {
|
|
311
|
-
display: contents;
|
|
312
|
-
}
|
|
313
|
-
.${e}-align-entries .${e}-item-title-row,
|
|
314
|
-
.${e}-align-entries .${e}-item-subtitle-row {
|
|
315
|
-
display: flex;
|
|
316
|
-
flex-direction: column;
|
|
317
|
-
align-items: flex-start;
|
|
318
|
-
width: 100%;
|
|
319
|
-
min-height: 100%;
|
|
320
|
-
}
|
|
321
|
-
.${e}-type-a.${e}-align-entries .${e}-item-title-row,
|
|
322
|
-
.${e}-type-a.${e}-align-entries .${e}-item-subtitle-row,
|
|
323
|
-
.${e}-type-d.${e}-align-entries .${e}-item-title-row,
|
|
324
|
-
.${e}-type-d.${e}-align-entries .${e}-item-subtitle-row {
|
|
325
|
-
align-items: flex-start;
|
|
326
|
-
}
|
|
327
|
-
.${e}-type-b.${e}-align-entries .${e}-item-title-row,
|
|
328
|
-
.${e}-type-b.${e}-align-entries .${e}-item-subtitle-row,
|
|
329
|
-
.${e}-type-e.${e}-align-entries .${e}-item-title-row,
|
|
330
|
-
.${e}-type-e.${e}-align-entries .${e}-item-subtitle-row {
|
|
331
|
-
align-items: center;
|
|
332
|
-
}
|
|
333
|
-
.${e}-type-c.${e}-align-entries .${e}-item-title-row,
|
|
334
|
-
.${e}-type-c.${e}-align-entries .${e}-item-subtitle-row,
|
|
335
|
-
.${e}-type-f.${e}-align-entries .${e}-item-title-row,
|
|
336
|
-
.${e}-type-f.${e}-align-entries .${e}-item-subtitle-row {
|
|
337
|
-
align-items: flex-end;
|
|
338
|
-
}
|
|
339
|
-
.${e}-align-entries .${e}-item-image-link {
|
|
340
|
-
width: 100%;
|
|
341
|
-
height: 100%;
|
|
342
|
-
min-height: 100%;
|
|
343
|
-
display: flex;
|
|
344
|
-
flex-direction: column;
|
|
345
|
-
align-items: center;
|
|
346
|
-
justify-content: flex-start;
|
|
347
|
-
}
|
|
348
|
-
.${e}-align-entries .${e}-item-image-link > .${e}-item-image-wrapper {
|
|
349
|
-
flex-shrink: 0;
|
|
350
|
-
height: auto;
|
|
351
|
-
align-self: auto;
|
|
352
|
-
}
|
|
353
|
-
.${e}-image-align-top.${e}-align-entries .${e}-item-image-link > .${e}-item-image-wrapper {
|
|
354
|
-
margin-top: 0;
|
|
355
|
-
margin-bottom: auto;
|
|
356
|
-
}
|
|
357
|
-
.${e}-image-align-center.${e}-align-entries .${e}-item-image-link > .${e}-item-image-wrapper {
|
|
358
|
-
margin-top: auto;
|
|
359
|
-
margin-bottom: auto;
|
|
360
|
-
}
|
|
361
|
-
.${e}-image-align-bottom.${e}-align-entries .${e}-item-image-link > .${e}-item-image-wrapper {
|
|
362
|
-
margin-top: auto;
|
|
363
|
-
margin-bottom: 0;
|
|
364
|
-
}
|
|
365
|
-
.${e}-image-align-top.${e}-align-entries .${e}-item-image-wrapper:not(.${e}-item-image-wrapper-fit-slider) {
|
|
366
|
-
align-items: flex-start;
|
|
367
|
-
}
|
|
368
|
-
.${e}-image-align-center.${e}-align-entries .${e}-item-image-wrapper:not(.${e}-item-image-wrapper-fit-slider) {
|
|
369
|
-
align-items: center;
|
|
370
|
-
}
|
|
371
|
-
.${e}-image-align-bottom.${e}-align-entries .${e}-item-image-wrapper:not(.${e}-item-image-wrapper-fit-slider) {
|
|
372
|
-
align-items: flex-end;
|
|
373
|
-
}
|
|
374
|
-
.${e}-image-align-top.${e}-align-entries .${e}-item-slider .${e}-item-slide {
|
|
375
|
-
align-items: flex-start;
|
|
376
|
-
}
|
|
377
|
-
.${e}-image-align-center.${e}-align-entries .${e}-item-slider .${e}-item-slide {
|
|
378
|
-
align-items: center;
|
|
379
|
-
}
|
|
380
|
-
.${e}-image-align-bottom.${e}-align-entries .${e}-item-slider .${e}-item-slide {
|
|
381
|
-
align-items: flex-end;
|
|
382
|
-
}
|
|
383
|
-
.${e}-image-align-top.${e}-align-entries .${e}-item-image-link {
|
|
384
|
-
justify-content: flex-start;
|
|
385
|
-
}
|
|
386
|
-
.${e}-image-align-center.${e}-align-entries .${e}-item-image-link {
|
|
387
|
-
justify-content: center;
|
|
388
|
-
}
|
|
389
|
-
.${e}-image-align-bottom.${e}-align-entries .${e}-item-image-link {
|
|
390
|
-
justify-content: flex-end;
|
|
391
|
-
}
|
|
392
|
-
.${e}-lightbox-counter {
|
|
393
|
-
margin: 0;
|
|
394
|
-
color: var(--${e}-lightbox-counter-color);
|
|
395
|
-
}
|
|
396
|
-
.${e}-lightbox {
|
|
397
|
-
position: fixed;
|
|
398
|
-
inset: 0;
|
|
399
|
-
z-index: 9997;
|
|
400
|
-
overscroll-behavior: none;
|
|
401
|
-
overflow: hidden;
|
|
402
|
-
}
|
|
403
|
-
.${e}-lightbox-editor {
|
|
404
|
-
inset: auto;
|
|
405
|
-
top: var(--cntrl-article-top, 0);
|
|
406
|
-
left: var(--cntrl-article-left, 0);
|
|
407
|
-
width: var(--cntrl-article-width, 100vw) !important;
|
|
408
|
-
height: var(--cntrl-viewport-height, 100vh) !important;
|
|
409
|
-
}
|
|
410
|
-
.${e}-control {
|
|
411
|
-
position: relative;
|
|
412
|
-
z-index: 2;
|
|
413
|
-
width: 100%;
|
|
414
|
-
}
|
|
415
|
-
.${e}-close-icon {
|
|
416
|
-
position: relative;
|
|
417
|
-
flex-shrink: 0;
|
|
418
|
-
pointer-events: auto;
|
|
419
|
-
z-index: 2;
|
|
420
|
-
display: flex;
|
|
421
|
-
align-items: center;
|
|
422
|
-
justify-content: center;
|
|
423
|
-
border: none;
|
|
424
|
-
background-color: transparent;
|
|
425
|
-
padding: 0;
|
|
426
|
-
}
|
|
427
|
-
.${e}-close-icon-inner {
|
|
428
|
-
all: unset;
|
|
429
|
-
position: relative;
|
|
430
|
-
cursor: pointer;
|
|
431
|
-
width: 100%;
|
|
432
|
-
height: 100%;
|
|
433
|
-
pointer-events: auto;
|
|
434
|
-
}
|
|
435
|
-
.${e}-close-icon-img {
|
|
436
|
-
position: absolute;
|
|
437
|
-
top: 50%;
|
|
438
|
-
left: 50%;
|
|
439
|
-
transform: translate(-50%, -50%);
|
|
440
|
-
}
|
|
441
|
-
`}function In(){return Math.random()<.5?"ltr":"ttb"}function Zt(e,i){return i<=0?0:(e%i+i)%i}const le=500,zt=750,nn="cubic-bezier(0.25, 1, 0.5, 1)",jn=5e3,je="cubic-bezier(0.22, 1, 0.36, 1)",Cn=72,kn=50;function Tn(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 Ln(e){const[i,t]=e.media;return t!=null&&t.assetId?t:i!=null&&i.assetId?i:null}function Mn(e){const[i]=e.media;return i!=null&&i.assetId?i:null}function rn(e){return!Array.isArray(e)||e.length===0?[]:Tn(e)?e.flatMap(i=>{const t=Ln(i);if(!t)return[];const a=Mn(i);return[{displayMedia:t,lightboxMedia:a!=null&&a.assetId?a:null}]}):e.filter(i=>i==null?void 0:i.assetId).map(i=>({displayMedia:i,lightboxMedia:i}))}function Re(e){return!ae.isEmbedMedia(e)&&e.type==="video"}function Rn(e){const i=new Set,t=[];for(const a of e){const l=rn(a.gallery);for(const u of l){const h=u.lightboxMedia;h!=null&&h.assetId&&!i.has(h.assetId)&&(i.add(h.assetId),t.push(h))}}return t}const Nn=r.memo(function({mediaList:i}){const[t,a]=r.useState(null);Pt.useLazyVideos(t,{preload:"metadata"});const l=i.filter(u=>!ae.isEmbedMedia(u));return l.length===0?null:n.jsx("div",{ref:a,"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:l.map(u=>Re(u)?n.jsx("video",{src:u.assetId,preload:"none",muted:!0,playsInline:!0},u.assetId):n.jsx("img",{src:u.assetId,alt:""},u.assetId))})});function zn(e){e.pause(),e.removeAttribute("src"),e.load()}const sn="cntrl-grid-slide",on="cntrl-grid-slide-playing",An=`.${sn} video`;function Vn(e){return e.closest(`.${on}`)!==null}function Fn({prefix:e,slides:i,isFade:t,direction:a,intervalMs:l}){const u=i.length,h=!t&&u>1,A=!t&&a==="random",Y=Number.isFinite(l)&&l>0?l:jn,[s,M]=r.useState(h?1:0),[I,O]=r.useState(!t&&a==="vertical"?"ttb":"ltr"),[B,te]=r.useState(!1),[K,S]=r.useState(!1),[ce,Z]=r.useState(0),ue=r.useRef(!1);r.useEffect(()=>{if(u<2)return;const v=window.setTimeout(()=>{if(ue.current){Z(x=>x+1);return}ue.current=!0,te(!0),S(!1),M(x=>h?x+1:Zt(x+1,u)),A||Z(x=>x+1)},Y);return()=>window.clearTimeout(v)},[u,ce,Y,h,A]),r.useEffect(()=>{if(!B)return;const v=window.setTimeout(()=>{const x=h&&s===u+1,k=A?In():I;(x||k!==I)&&(S(!0),x&&M(1),O(k)),ue.current=!1,te(!1),A&&Z(F=>F+1)},zt);return()=>window.clearTimeout(v)},[I,u,h,B,A,s]),r.useEffect(()=>{if(!K)return;let v=0;const x=requestAnimationFrame(()=>{v=requestAnimationFrame(()=>S(!1))});return()=>{cancelAnimationFrame(x),cancelAnimationFrame(v)}},[K]);const J=h?u+2:u,c=v=>h?Zt(v-1,u):v,m=v=>h&&(v===0||v===u+1),y=c(s),N=s+1<J?s+1:-1,R=v=>t||v===s&&!m(v)||v===N||N>=0&&!m(v)&&c(v)===c(N),z=!t&&I==="ttb",Q=t?void 0:{transform:z?`translate3d(0, ${-s*100}%, 0)`:`translate3d(${-s*100}%, 0, 0)`,transition:K?"none":`transform ${zt}ms ${nn}`};return n.jsx("div",{className:`${e}-item-slider`,children:n.jsx("div",{className:`${e}-item-slider-list${t?` ${e}-item-slider-list-fade`:""}${z?` ${e}-item-slider-list-vertical`:""}`,style:Q,children:Array.from({length:J},(v,x)=>{const k=c(x),F=m(x),U=t?k===y:x===s;return n.jsx("div",{className:`${e}-item-slide ${sn}${t&&U?` ${e}-item-slide-active`:""}${R(x)?` ${on}`:""}`,"aria-hidden":U?void 0:!0,children:i[k]},F?`clone-${x===0?"start":"end"}`:`slide-${k}`)})})})}function Jt({media:e,className:i,style:t,hasLightbox:a,isSliderSlide:l=!1,onMediaClick:u}){if(ae.isEmbedMedia(e))return n.jsx(ae.EmbedMediaFrame,{media:e,fit:t.objectFit==="contain"?"contain":"cover",silentLoop:a,className:i,style:{...t,cursor:u?"pointer":"default"},onClick:u});if(Re(e)){const h={src:e.assetId,className:i,style:{...t,cursor:u?"pointer":"default"},muted:!0,loop:!0,playsInline:!0,onClick:u};return l?n.jsx("video",{...h,preload:"none"}):n.jsx(en.LazyVideo,{...h,autoPlay:!0})}return n.jsx("img",{src:e.assetId,alt:e.name,className:i,style:{...t,cursor:u?"pointer":"default"},onClick:u})}function En({className:e,style:i,children:t}){const[a,l]=r.useState(null);return Pt.useLazyVideos(a,{autoPlay:!0,selector:An,shouldPlay:Vn}),n.jsx("div",{ref:l,className:e,style:i,children:t})}function Qt(e){const i=e.getBoundingClientRect();return{width:i.width,height:i.height,left:i.left,top:i.top}}function Wn(e,i){if(!i||!i.width||!i.height||!e.width||!e.height)return e;const t=i.width/i.height,a=e.width/e.height;if(t>a){const u=e.width/t;return{width:e.width,height:u,left:e.left,top:e.top+(e.height-u)/2}}const l=e.height*t;return{width:l,height:e.height,left:e.left+(e.width-l)/2,top:e.top}}function On({src:e,mediaRef:i,mediaStyle:t,onLoadedMetadata:a}){return r.useEffect(()=>{const l=i.current;if(l)return()=>{zn(l)}},[e,i]),n.jsx("video",{ref:i,src:e,muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onLoadedMetadata:a,style:t})}const _n="https://cdn.cntrl.site/component-assets/defaultCloseIcon.svg",Dn=.004;function Gn({prefix:e,closeIcon:i=_n,closeIconMaxWidth:t=.0125,closeIconColor:a="#FFFFFF",closeIconHoverColor:l="#999999",iconMarginRight:u=.01,contentMarginTop:h=.01,isEditor:A,isPreviewMode:Y,isEditMode:s,visible:M,onClose:I}){if(!i)return null;const O=b.scalingValue(t,A),B=b.scalingValue(u,A),te=b.scalingValue(h,A),K=b.scalingValue(Math.max(h,Dn),A);return n.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,zIndex:1e4,display:"flex",flexDirection:"column",alignItems:"flex-end",pointerEvents:"none",opacity:M?1:0,transition:"opacity 500ms cubic-bezier(0.22, 1, 0.36, 1)"},children:[n.jsx("div",{style:{position:"relative",width:"100%",height:te,flexShrink:0},children:s&&n.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:K,pointerEvents:M?"auto":"none"}})}),n.jsxs("div",{className:`${e}-close-icon`,style:{width:O,height:O,marginRight:B,pointerEvents:M?"auto":"none"},onClick:S=>S.stopPropagation(),children:[n.jsx("button",{type:"button",className:`${e}-close-icon-inner`,"aria-label":"Close",onClick:S=>{S.stopPropagation(),I()},children:n.jsx(vn.SvgImage,{url:i,fill:a,hoverFill:A&&!Y?a:l,className:`${e}-close-icon-img`})}),s&&n.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:B,height:"100%",pointerEvents:M?"auto":"none"}})]})]})}function Hn({prefix:e,items:i,index:t,imageDisplay:a,isEditor:l,isPreviewMode:u,isEditMode:h,onClose:A,onPrev:Y,onNext:s,counterClassName:M,counterStyle:I,closeIcon:O,closeIconMaxWidth:B,closeIconColor:te,closeIconHoverColor:K,iconMarginRight:S,contentMarginTop:ce}){const Z=a==="cover",ue=r.useRef(null),J=r.useRef(null),c=r.useRef(null),m=r.useRef(null),y=r.useRef(0),N=r.useRef(0),R=r.useRef("none"),z=r.useRef(!1),Q=r.useRef(!1),v=r.useRef(null),x=r.useRef(0),k=r.useRef(null),F=r.useRef(!1),U=r.useRef(null),ie=r.useRef(null),Ne=r.useRef(null),Ge=r.useRef(()=>{}),[T,ge]=r.useState(null),[d,ze]=r.useState(null),[E,Ce]=r.useState("opening"),[me,ke]=r.useState(0),[re,ne]=r.useState(0),[xe,fe]=r.useState(null),[Ae,ye]=r.useState(!1),[Ve,Te]=r.useState(!1),[$t,Pe]=r.useState(!1),[xt,et]=r.useState(null),tt=r.useRef(t),He=r.useRef(void 0),$=i[t],yt=$?Re($):!1,Be=$?ae.isEmbedMedia($):!1,Fe=xe!==null,Ee=r.useCallback(o=>{const w=o.currentTarget,q=w instanceof HTMLVideoElement?{width:w.videoWidth,height:w.videoHeight}:{width:w.naturalWidth,height:w.naturalHeight};!q.width||!q.height||et(q)},[]);r.useEffect(()=>{v.current=d},[d]),r.useEffect(()=>{const o=ue.current;if(!o)return;const w=()=>ze(Qt(o));w();const q=new ResizeObserver(w);return q.observe(o),()=>q.disconnect()},[]);const _=r.useCallback(()=>{U.current!==null&&(window.clearTimeout(U.current),U.current=null)},[]),de=r.useCallback(()=>{const o=ie.current;ie.current=null,_(),k.current=null,F.current=!1,fe(null),ye(!1),ne(0),x.current=0,Te(!1),z.current=!1,N.current=0,R.current="none",o===1?s():o===-1&&Y()},[_,s,Y]),ve=r.useCallback(()=>{_(),ie.current=null,k.current=null,F.current=!1,fe(null),ye(!1),ne(0),x.current=0},[_]),nt=r.useCallback(()=>{_(),U.current=window.setTimeout(()=>{ie.current!==null&&de()},le+32)},[_,de]),we=r.useCallback((o,w)=>{var pe;const q=((pe=v.current)==null?void 0:pe.width)??0;if(_(),k.current=o,fe(o),F.current=!0,ye(!0),w){ie.current=o;const Se=-o*q;x.current=Se,ne(Se),nt();return}x.current=0,ne(0),U.current=window.setTimeout(()=>{U.current=null,ve()},le+32)},[_,ve,nt]),qe=r.useCallback(o=>{if(!(i.length<=1)){if(F.current){if(ie.current===o){Ne.current=o,de();return}ve()}_(),k.current=o,fe(o),F.current=!1,ye(!1),x.current=0,ne(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{we(o,!0)})})}},[i.length,we,de,ve,_]);Ge.current=qe;const it=r.useCallback(o=>{o.propertyName!=="transform"||!F.current||ie.current!==null&&de()},[de]),Ue=r.useCallback(()=>{const o=J.current;if(!o)return;const w=Qt(o);!w.width||!w.height||ge(w)},[]);r.useEffect(()=>{Ue();const o=J.current;if(!o)return;const w=new ResizeObserver(()=>Ue());return w.observe(o),()=>w.disconnect()},[Ue]),r.useEffect(()=>{E==="opening"&&T&&Ce("open")},[E,T]),r.useEffect(()=>{if(E!=="closing")return;const o=setTimeout(()=>A(),le);return()=>clearTimeout(o)},[E,A]),r.useEffect(()=>()=>{_()},[_]),r.useLayoutEffect(()=>{tt.current===t&&He.current===($==null?void 0:$.assetId)||(_(),ie.current=null,fe(null),ke(0),ne(0),ye(!1),Pe(!1),Te(!1),et(null),y.current=0,N.current=0,R.current="none",z.current=!1,F.current=!1,x.current=0,k.current=null,m.current=null,Q.current=!1,tt.current=t,He.current=$==null?void 0:$.assetId)},[t,$==null?void 0:$.assetId,_]),r.useLayoutEffect(()=>{const o=Ne.current;o!==null&&(Ne.current=null,requestAnimationFrame(()=>{Ge.current(o)}))},[t,$==null?void 0:$.assetId]),r.useEffect(()=>{if(E!=="open")return;let o=null;const w=()=>{o&&(document.removeEventListener("click",o,!0),o=null)},q=()=>{w(),o=C=>{C.stopPropagation(),C.preventDefault(),w()},document.addEventListener("click",o,!0)},pe=C=>{const P=C<0?1:-1;if(Math.abs(C)>kn&&i.length>1){we(P,!0);return}we(P,!1)},Se=C=>{if(C.touches.length!==1||F.current)return;const P=C.touches[0];Q.current=!0,m.current={x:P.clientX,y:P.clientY},R.current="none",N.current=0,z.current=!1},Ze=C=>{if(!m.current||C.touches.length!==1||F.current)return;const P=C.touches[0],$e=P.clientX-m.current.x,W=P.clientY-m.current.y;if(R.current==="none"){if(Math.abs($e)<10&&Math.abs(W)<10)return;if(Math.abs($e)>Math.abs(W)){if(i.length<=1)return;R.current="horizontal"}else if(W>0)R.current="vertical";else return}if(R.current==="horizontal"){z.current=!0,Te(!0),N.current=$e;const ee=$e<0?1:-1;k.current!==ee&&(k.current=ee,fe(ee)),x.current=$e,ne($e),C.preventDefault();return}R.current==="vertical"&&(z.current=!0,Te(!0),y.current=W,ke(W),C.preventDefault())},We=()=>{if(!m.current)return;const C=R.current,P=z.current;if(P&&C==="horizontal")pe(N.current),q();else if(P&&C==="vertical")if(y.current>Cn){const W=window.innerHeight;y.current=W,Pe(!0),ke(W),Ce("closing")}else y.current=0,ke(0),q();else C==="horizontal"&&Math.abs(N.current)>0&&(pe(N.current),q());m.current=null,R.current="none",N.current=0,z.current=!1,Te(!1)};return document.addEventListener("touchstart",Se,{passive:!0}),document.addEventListener("touchmove",Ze,{passive:!1}),document.addEventListener("touchend",We),document.addEventListener("touchcancel",We),()=>{document.removeEventListener("touchstart",Se),document.removeEventListener("touchmove",Ze),document.removeEventListener("touchend",We),document.removeEventListener("touchcancel",We),w()}},[E,i.length,we]),r.useEffect(()=>{const o=w=>{w.key==="Escape"&&(w.preventDefault(),w.stopPropagation(),E!=="closing"&&Ce("closing"))};return window.addEventListener("keydown",o,!0),()=>window.removeEventListener("keydown",o,!0)},[E]);const rt=()=>{E!=="closing"&&Ce("closing")},p=E==="open",Xe=E==="closing",Ye=me>0?Math.max(0,1-me/500):1,st=me>0?Math.max(.35,1-me/500):1,ot=Be&&$?{width:ae.getEmbedAspect($),height:1}:xt,j=T?Z?T:Wn(T,ot):null,V={position:"fixed",top:d==null?void 0:d.top,left:d==null?void 0:d.left,width:d==null?void 0:d.width,height:d==null?void 0:d.height,zIndex:9998},lt=Z?"cover":"contain",vt=re!==0||me>0?`translate(${re}px, ${me}px)`:void 0,at=Ve&&!Ae?"none":Ae?`transform ${le}ms ${je}`:$t?`transform ${le}ms ${je}, opacity ${le}ms ${je}`:E==="opening"||Xe?`opacity ${le}ms ${je}`:"none",se={...V,transform:vt,opacity:me>0?st:E==="opening"||Xe?0:1,transition:at,pointerEvents:"none"},Le={position:"absolute",top:((j==null?void 0:j.top)??0)-((d==null?void 0:d.top)??0),left:((j==null?void 0:j.left)??0)-((d==null?void 0:d.left)??0),width:j==null?void 0:j.width,height:j==null?void 0:j.height,objectFit:lt,pointerEvents:"none"},wt=(d==null?void 0:d.width)??0,be=Fe?(t+xe+i.length)%i.length:null,X=be!==null?i[be]:null,ct={...V,transform:Fe?`translateX(${xe*wt+re}px)`:void 0,opacity:1,transition:Ae?`transform ${le}ms ${je}`:"none",pointerEvents:"none"},ut={position:"absolute",top:((T==null?void 0:T.top)??0)-((d==null?void 0:d.top)??0),left:((T==null?void 0:T.left)??0)-((d==null?void 0:d.left)??0),width:T==null?void 0:T.width,height:T==null?void 0:T.height,objectFit:lt,pointerEvents:"none"},Vt=Be&&$&&ae.getEmbedPlayback($).controls&&j?Math.min(52,j.height*.2):0,Ke=j?{position:"fixed",top:j.top,height:j.height-Vt,width:j.width/2,zIndex:9999}:null;return n.jsxs("div",{ref:ue,className:[`${e}-lightbox`,l?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:E==="open"?"none":void 0},onClick:rt,children:[n.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:p?Ye:0,transition:Ve?"none":`opacity ${le}ms ${je}`,pointerEvents:"none"}}),n.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:Z?n.jsxs(n.Fragment,{children:[n.jsx("div",{ref:J,style:{position:"absolute",inset:0}}),n.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:p?1:0,transition:`opacity ${le}ms ${je}`,pointerEvents:"none",zIndex:9999},children:i.length>1&&n.jsxs("p",{className:M,style:I,children:[t+1," / ",i.length]})})]}):n.jsxs(n.Fragment,{children:[n.jsx("div",{style:{height:"10%"}}),n.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:n.jsx("div",{ref:J,style:{width:"100%",height:"100%"}})}),n.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:p?1:0,transition:`opacity ${le}ms ${je}`},children:i.length>1&&n.jsxs("p",{className:M,style:I,children:[t+1," / ",i.length]})})]})}),T&&d&&X&&n.jsx("div",{style:ct,onTransitionEnd:it,children:ae.isEmbedMedia(X)?n.jsx("img",{src:X.thumbnail,alt:X.name,style:ut},`neighbor-${be}-${X.assetId}`):Re(X)?n.jsx("video",{src:X.assetId,muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",style:ut},`neighbor-${be}-${X.assetId}`):n.jsx("img",{src:X.assetId,alt:X.name,style:ut},`neighbor-${be}-${X.assetId}`)}),T&&d&&$&&n.jsx("div",{style:se,onTransitionEnd:it,children:Be?n.jsx(ae.EmbedMediaFrame,{media:$,fit:Z?"cover":"contain",lazy:!1,startsAtOnce:!0,style:Le},`${t}-${$.assetId}`):yt?n.jsx(On,{src:$.assetId,mediaRef:c,mediaStyle:Le,onLoadedMetadata:Ee},`${t}-${$.assetId}`):n.jsx("img",{ref:c,src:$.assetId,alt:$.name,onLoad:Ee,style:Le},`${t}-${$.assetId}`)}),p&&Ke&&i.length>1&&n.jsxs(n.Fragment,{children:[n.jsx("div",{style:{...Ke,left:j.left,cursor:"w-resize",pointerEvents:Ve?"none":"auto"},onClick:o=>{if(Q.current){Q.current=!1;return}o.stopPropagation(),qe(-1)}}),n.jsx("div",{style:{...Ke,left:j.left+j.width/2,cursor:"e-resize",pointerEvents:Ve?"none":"auto"},onClick:o=>{if(Q.current){Q.current=!1;return}o.stopPropagation(),qe(1)}})]}),n.jsx(Gn,{prefix:e,closeIcon:O,closeIconMaxWidth:B,closeIconColor:te,closeIconHoverColor:K,iconMarginRight:S,contentMarginTop:ce,isEditor:l,isPreviewMode:u,isEditMode:h,visible:p,onClose:rt})]})}function Bn(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function At(e,i){return e.columnWidth*i+e.gutterWidth*Math.max(0,i-1)}function qn(e){return e.blocks.reduce((i,t)=>Math.max(i,Math.max(0,t.top)+Math.max(0,t.height)),0)}function Un(e){return typeof e.verticalGap=="number"?Math.max(0,e.verticalGap):Math.max(0,(e.repeatHeight??0)-qn(e))}function ln(e,i){const t=e.blocks[i%e.blocks.length],a=Math.min(Math.max(1,Math.round(t.span)),e.columnsCount),l=Math.min(Math.max(0,Math.round(t.column)),e.columnsCount-a);return{column:l,span:a,width:At(e,a),top:Math.max(0,t.top),height:Math.max(0,t.height),gridColumn:`${l+1} / span ${a}`}}const Nt=1e-6;function Xn(e,i,t){const a=e.beat??0,l=a>0&&!!t,u=s=>Math.ceil(s/a-.001)*a,h=[],A=[],Y=Un(e);for(let s=0;s<i;s+=e.blocks.length){s>0&&Y>0&&h.push(Y);const M=Array.from({length:Math.min(e.blocks.length,i-s)},(c,m)=>ln(e,s+m)),I=M.map(c=>{const m=M.filter(y=>y.column<c.column+c.span&&c.column<y.column+y.span&&y.top>=c.top+c.height-Nt);return m.length>0?Math.min(...m.map(y=>y.top)):void 0}),O=[0,...M.map(c=>c.top)].sort((c,m)=>c-m).filter((c,m,y)=>m===0||c-y[m-1]>Nt),B=(c,m)=>Math.abs(c-m)<=Nt,te=c=>O.findIndex(m=>B(m,c)),K=[];let S=0;const ce=c=>{const m=M.flatMap((R,z)=>c(I[z])?[{slot:R,entry:s+z}]:[]);if(m.length===0)return;if(!l){h.push("auto");return}const y=Math.max(...m.map(({slot:R,entry:z})=>K[te(R.top)]+(t[z]??0))),N=Math.max(0,u(y)-S);h.push(N),S+=N},Z=O.map((c,m)=>(m>0&&(h.push(c-O[m-1]),S+=c-O[m-1]),ce(y=>y!==void 0&&B(y,c)),K.push(S),h.length+1));ce(c=>c===void 0);const ue=h.length+1,J=c=>Z[te(c)];M.forEach((c,m)=>{const y=I[m];A.push(`${J(c.top)} / ${y===void 0?ue:J(y)}`)})}return{tracks:h,gridRows:A}}function Yn({settings:e,content:i,isEditor:t,isPreviewMode:a,isEditMode:l,metadata:u,activeEvent:h,layoutId:A,portalId:Y}){const{prefix:s}=xn.useScopedStyles(),{type:M="a",gridLayout:I,customGrid:O,textBoxWidth:B=100,verticalGap:te,entriesCount:K,lightbox:S,imageDisplay:ce,imageCorners:Z,lightboxImageDisplay:ue,slider:J,sliderTiming:c,direction:m,transition:y,titleMarginTop:N,subtitleMarginTop:R,titleColor:z,subtitleColor:Q,lightboxCounterColor:v,titleFontFamily:x,titleFontSettings:k,titleFontSize:F,titleLineHeight:U,titleLetterSpacing:ie,titleWordSpacing:Ne,titleTextAppearance:Ge,subtitleFontFamily:T,subtitleFontSettings:ge,subtitleFontSize:d,subtitleLineHeight:ze,subtitleLetterSpacing:E,subtitleWordSpacing:Ce,subtitleTextAppearance:me,lightboxCounterFontFamily:ke,lightboxCounterFontSettings:re,lightboxCounterFontSize:ne,lightboxCounterLineHeight:xe,lightboxCounterLetterSpacing:fe,lightboxCounterWordSpacing:Ae,lightboxCounterTextAppearance:ye,closeIcon:Ve,closeIconMaxWidth:Te,closeIconColor:$t,closeIconHoverColor:Pe,iconMarginRight:xt,contentMarginTop:et,showText:tt="always",hover:He="none",alignEntries:$="off",align:yt="top",textGrowth:Be="inside"}=e,Fe=r.useMemo(()=>({...De.omitTextColors(De.textStylesToCss({fontSettings:{fontFamily:x,fontWeight:(k==null?void 0:k.fontWeight)??400,fontStyle:(k==null?void 0:k.fontStyle)??"normal"},fontSize:F??.01,lineHeight:U,letterSpacing:ie??0,wordSpacing:Ne??0,textAppearance:Ge,color:z},t)),...Lt(F,U,s,t)}),[x,k,F,U,ie,Ne,Ge,z,t,s]),Ee=r.useMemo(()=>({...De.omitTextColors(De.textStylesToCss({fontSettings:{fontFamily:T,fontWeight:(ge==null?void 0:ge.fontWeight)??400,fontStyle:(ge==null?void 0:ge.fontStyle)??"normal"},fontSize:d??.01,lineHeight:ze,letterSpacing:E??0,wordSpacing:Ce??0,textAppearance:me,color:Q},t)),...Lt(d,ze,s,t)}),[T,ge,d,ze,E,Ce,me,Q,t,s]),_=r.useMemo(()=>({...De.omitTextColors(De.textStylesToCss({fontSettings:{fontFamily:ke,fontWeight:(re==null?void 0:re.fontWeight)??400,fontStyle:(re==null?void 0:re.fontStyle)??"normal"},fontSize:ne??.01,lineHeight:xe,letterSpacing:fe??0,wordSpacing:Ae??0,textAppearance:ye,color:v},t)),...Lt(ne,xe,s,t)}),[ke,re,ne,xe,fe,Ae,ye,v,t,s]),de=Tt(F,U,`${s}-item-title`,`${s}-text-tight-leading`),ve=Tt(d,ze,`${s}-item-subtitle`,`${s}-text-tight-leading`),nt=Tt(ne,xe,`${s}-lightbox-counter`,`${s}-text-tight-leading`),we=r.useMemo(()=>$n.buildColorVars(s,{titleColor:z,subtitleColor:Q,lightboxCounterColor:v},Kn,Zn),[s,z,Q,v]),qe=h&&h!=="default"?`${s}-state-${h}`:"",it=tt==="on hover"&&(!t||a),Ue=He!=="none"&&(!t||a)?` ${s}-hover-${He}`:"",rt=`${qe}${it?` ${s}-show-text-hover`:""}${Ue}`.trim(),p=O&&Array.isArray(O.blocks)&&O.blocks.length>0?O:void 0,Xe=p||K===0?1/0:K,Ye=!!p&&Be==="outside",st=r.useRef([]),[ot,j]=r.useState([]),V=r.useMemo(()=>(i??[]).slice(0,Xe),[i,Xe]),lt=r.useMemo(()=>S==="on"?Rn(V):[],[V,S]),vt=r.useMemo(()=>V.map(g=>{const f=rn(g.gallery),D=f.filter(L=>L.lightboxMedia).map(L=>L.lightboxMedia),G=f.map(({lightboxMedia:L})=>L?D.findIndex(Me=>Me.assetId===L.assetId):-1);return{displayItems:f,lightboxItemsForEntry:D,lightboxIndexes:G}}),[V]),at=(I==null?void 0:I.entryWidth)??.2,se=typeof ce=="string"?{display:ce}:ce,Le=(se==null?void 0:se.display)==="cover",wt=(se==null?void 0:se.ratioValue)??"1:1",be=(se==null?void 0:se.reversed)??!1,[X,ct]=wt.split(":").map(Number),Ke=`${be?ct:X} / ${be?X:ct}`,o=(I==null?void 0:I.columnsCount)??1,w=b.scalingValue(at??0,t),q=!p&&!Le&&J!=="off",pe=V.length%o||o,Se=!p&&pe<o&&V.length>0,Ze=V.length-pe,We=Se?Math.floor((o-pe)/2)+1:1,C=Z?b.scalingValue(Z,t):void 0,P=(g,f)=>({width:g,...f?Ye?{height:b.scalingValue(f.height,t),flexShrink:0,overflow:"hidden"}:{flex:"1 1 0%",minHeight:0,overflow:"hidden"}:Le?{aspectRatio:Ke,height:"auto",overflow:"hidden"}:{height:"auto"},...C?{borderRadius:C,overflow:"hidden"}:{}}),$e=`${s}-item-image-wrapper${q?` ${s}-item-image-wrapper-fit-slider`:""}`.trim(),W=M==="d"||M==="e"||M==="f",ee=!p&&$==="on",Ft=C?{borderRadius:C,[tn]:C}:{},Et=Le?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...Ft}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...p?{maxHeight:"100%"}:{},...Ft},bt=((p==null?void 0:p.beat)??0)>0,St=p?At(p,p.columnsCount):0;r.useLayoutEffect(()=>{if(!bt){j(L=>L.length>0?[]:L);return}const g=mt.current,f=st.current.slice(0,V.length),D=()=>{const L=g&&St>0?g.offsetWidth/St:0;if(L<=0)return;const Me=f.map(oe=>oe?oe.offsetHeight/L:0);j(oe=>oe.length===Me.length&&oe.every((he,Je)=>Math.abs(he-Me[Je])<1e-5)?oe:Me)};D();const G=new ResizeObserver(D);return g&&G.observe(g),f.forEach(L=>L&&G.observe(L)),()=>G.disconnect()},[bt,V.length,St,s]);const Wt=bt&&ot.length===V.length?ot:void 0,Oe=r.useMemo(()=>{if(!p)return;const g=Xn(p,V.length,Wt);return{gridRows:g.gridRows,gridTemplateRows:g.tracks.length?g.tracks.map(f=>f==="auto"?"auto":b.scalingValue(f,t)).join(" "):"auto"}},[p,V.length,Wt,t]),It=r.useMemo(()=>p?V.map((g,f)=>ln(p,f)):void 0,[p,V.length]),an=p?{gridTemplateColumns:`repeat(${p.columnsCount}, ${b.scalingValue(p.columnWidth,t)})`,gridTemplateRows:(Oe==null?void 0:Oe.gridTemplateRows)??"auto",rowGap:0,columnGap:b.scalingValue(p.gutterWidth,t),width:b.scalingValue(At(p,p.columnsCount),t)}:{gridTemplateColumns:`repeat(${o}, ${w})`,rowGap:ee?0:b.scalingValue(te??0,t),columnGap:b.scalingValue((I==null?void 0:I.horizontalGap)??0,t),width:b.scalingValue((I==null?void 0:I.wrapperWidth)??0,t),...ee?{[`--${s}-align-entries-row-gap`]:b.scalingValue(te??0,t)}:{}},mt=r.useRef(null),cn=()=>{const g={...we},f=mt.current?getComputedStyle(mt.current).getPropertyValue("--cntrl-article-width").trim():"";return f&&(g["--cntrl-article-width"]=f),g},[jt,Ct]=r.useState(!1),[dt,un]=r.useState([]),[mn,kt]=r.useState(0),Ot=S==="on"&&(!t||a),_t=(g,f)=>{t&&!a||S!=="off"&&(un(g),kt(f),Ct(!0))};r.useEffect(()=>{if(!jt||S!=="on"||typeof document>"u")return;const g=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=g}},[jt,S]),r.useEffect(()=>{!t||a||Ct(!1)},[t,a]);const dn=r.useMemo(()=>Sn(s),[s]);return n.jsxs(n.Fragment,{children:[n.jsx("style",{dangerouslySetInnerHTML:{__html:dn}}),S==="on"&&n.jsx(Nn,{mediaList:lt}),n.jsx("div",{style:we,children:n.jsx("div",{ref:mt,className:`${s}-wrapper ${s}-type-${M}${ee?` ${s}-align-entries`:""}${p?` ${s}-custom-layout`:""}${Ye?` ${s}-text-outside`:""} ${s}-image-align-${yt} ${rt}`.trim(),style:an,children:V.map((g,f)=>{var Xt;const D=Kt(g.title),G=Kt(g.subtitle),L=S==="off"&&((Xt=g.link)!=null&&Xt.value)?g.link:void 0,Me=Math.floor(f/o)===Math.ceil(V.length/o)-1,oe=Se&&f>=Ze?`${We+(f-Ze)}`:void 0,he=It==null?void 0:It[f],Je=(he==null?void 0:he.width)??at,ht=b.scalingValue(Je,t),_e=`calc(${ht} * (${B} / 100))`,Ie=b.scalingValue(Je*B/100,t),hn=P(ht,he),gn=he?{gridColumn:he.gridColumn,gridRow:Oe==null?void 0:Oe.gridRows[f],alignSelf:"start"}:oe&&!ee?{gridColumn:oe}:void 0,Dt=W?n.jsxs("div",{className:`${s}-item-text-block`,children:[D&&n.jsx("p",{className:de,style:{width:_e,...Fe},children:g.title}),D&&n.jsx("div",{"data-controls":l?"titleMarginTop":void 0,className:l?`${s}-control`:void 0,style:{height:b.scalingValue(N??0,t),width:Ie}}),G&&n.jsx("p",{className:ve,style:{width:_e,...Ee},children:g.subtitle}),G&&n.jsx("div",{"data-controls":l?"subtitleMarginTop":void 0,className:l?`${s}-control`:void 0,style:{height:b.scalingValue(R??0,t),width:Ie}})]}):null,fn=ee?n.jsxs("div",{className:`${s}-item-title-row`,children:[!W&&n.jsx("div",{"data-controls":l&&D?"titleMarginTop":void 0,className:l&&D?`${s}-control`:void 0,style:{height:D?b.scalingValue(N??0,t):0,width:Ie}}),D&&n.jsx("p",{className:de,style:{width:_e,...Fe},children:g.title}),W&&D&&n.jsx("div",{"data-controls":l?"titleMarginTop":void 0,className:l?`${s}-control`:void 0,style:{height:b.scalingValue(N??0,t),width:Ie}})]}):null,pn=ee?n.jsxs("div",{className:`${s}-item-subtitle-row`,children:[!W&&n.jsx("div",{"data-controls":l&&G?"subtitleMarginTop":void 0,className:l&&G?`${s}-control`:void 0,style:{height:G?b.scalingValue(R??0,t):0,width:Ie}}),G&&n.jsx("p",{className:ve,style:{width:_e,...Ee},children:g.subtitle}),W&&G&&n.jsx("div",{"data-controls":l?"subtitleMarginTop":void 0,className:l?`${s}-control`:void 0,style:{height:b.scalingValue(R??0,t),width:Ie}})]}):null,Gt=n.jsxs(pt.LinkWrapper,{link:L,className:`${s}-item-text-link`,children:[fn,pn]}),{displayItems:Qe,lightboxItemsForEntry:Ht,lightboxIndexes:Bt}=vt[f],gt=n.jsx(En,{className:$e,style:hn,children:Qe.length===0?null:J==="off"?(()=>{const{displayMedia:H}=Qe[0],ft=Bt[0];return n.jsx(Jt,{media:H,className:`${s}-item-${Re(H)?"video":"image"}`.trim(),style:Et,hasLightbox:S==="on",onMediaClick:Ot&&ft>=0?()=>_t(Ht,ft):void 0})})():n.jsxs(n.Fragment,{children:[q&&n.jsx("div",{className:`${s}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Qe.map(({displayMedia:H})=>ae.isEmbedMedia(H)?n.jsx("div",{style:{aspectRatio:`${ae.getEmbedAspect(H)}`}},`sizer-${H.assetId}`):Re(H)?n.jsx(en.LazyVideo,{src:H.assetId,nearPreload:"metadata",muted:!0,playsInline:!0},`sizer-${H.assetId}`):n.jsx("img",{src:H.assetId,alt:""},`sizer-${H.assetId}`))}),n.jsx(Fn,{prefix:s,isFade:y==="fade",direction:m,intervalMs:c*1e3,slides:Qe.map(({displayMedia:H},ft)=>{const Yt=Bt[ft];return n.jsx(Jt,{media:H,className:`${s}-item-${Re(H)?"video":"image"}`.trim(),style:Et,hasLightbox:S==="on",isSliderSlide:!0,onMediaClick:Ot&&Yt>=0?()=>_t(Ht,Yt):void 0})})},`${y}-${Je}-${m}-${c}-${A}-${Qe.length}`)]})}),qt=W?null:n.jsxs(n.Fragment,{children:[n.jsx("div",{"data-controls":l&&D?"titleMarginTop":void 0,className:l&&D?`${s}-control`:void 0,style:{height:D?b.scalingValue(N??0,t):0,width:Ie}}),n.jsx("p",{className:de,style:{width:_e,...Fe},children:g.title}),n.jsx("div",{"data-controls":l&&G?"subtitleMarginTop":void 0,className:l&&G?`${s}-control`:void 0,style:{height:G?b.scalingValue(R??0,t):0,width:Ie}}),n.jsx("p",{className:ve,style:{width:_e,...Ee},children:g.subtitle})]}),Ut=L?n.jsx(pt.LinkWrapper,{link:L,className:`${s}-item-image-link`,children:gt}):n.jsx("a",{className:`${s}-item-image-link`,children:gt});return n.jsx("div",{className:`${s}-item`.trim(),style:gn,children:n.jsx("div",{ref:H=>{st.current[f]=H},className:`${l?`${s}-item-inner`:`${s}-item-inner-hidden`}${ee&&Me?` ${s}-item-inner-last-row`:""}`.trim(),style:{width:(B??0)>100?`calc(${ht} * (${B} / 100))`:ht,...he&&!Ye?{height:b.scalingValue(he.height,t)}:{},...oe&&ee?{gridColumn:oe}:{}},children:ee?n.jsx(n.Fragment,{children:W?n.jsxs(n.Fragment,{children:[Gt,Ut]}):n.jsxs(n.Fragment,{children:[Ut,Gt]})}):L?n.jsxs(n.Fragment,{children:[n.jsxs(pt.LinkWrapper,{link:L,className:`${s}-item-image-link`,children:[Dt,gt]}),!W&&n.jsx(pt.LinkWrapper,{link:L,className:`${s}-item-text-link`,children:qt})]}):n.jsxs(n.Fragment,{children:[Dt,gt,qt]})})},f)})})}),(!t||a)&&jt&&typeof document<"u"&&S==="on"&&(()=>{const g=(Y?document.getElementById(Y):null)??document.body;return yn.createPortal(n.jsx("div",{style:cn(),"data-selection":"none",children:n.jsx(Hn,{prefix:s,items:dt,index:mn,imageDisplay:Bn(ue),isEditor:t,isPreviewMode:a,isEditMode:l,closeIcon:Ve,closeIconMaxWidth:Te,closeIconColor:$t,closeIconHoverColor:Pe,iconMarginRight:xt,contentMarginTop:et,onClose:()=>Ct(!1),onPrev:()=>kt(f=>(f-1+dt.length)%dt.length),onNext:()=>kt(f=>(f+1)%dt.length),counterClassName:nt,counterStyle:_})}),g)})()]})}const Kn={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},Zn=["hover","focus","filled","success","error"];exports.Grid=Yn;
|