@cntrl-site/components 1.0.106-alpha.0 → 1.0.107-alpha.1
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/ArchivePopup-DMpGP8r2.js +176 -0
- package/dist/ArchivePopup-X4EtTAyA.mjs +694 -0
- package/dist/ArchivePopupComponent-BTniPIfi.js +1 -0
- package/dist/{PretextComponent-j-OsRZTx.mjs → ArchivePopupComponent-GgAT2Avz.mjs} +954 -479
- package/dist/ClickGallerie-CYQMgrIr.js +36 -0
- package/dist/ClickGallerie-o2U6oyOF.mjs +272 -0
- package/dist/Components/ArchivePopup/ArchivePopup.d.ts +154 -0
- package/dist/Components/ArchivePopup/ArchivePopupComponent.d.ts +288 -0
- package/dist/Components/ClickGallerie/ClickGallerie.d.ts +2 -1
- package/dist/Components/Helix/Helix.d.ts +4 -1
- package/dist/Components/Hive/Hive.d.ts +4 -1
- package/dist/Components/ImageRevealSlider/ImageRevealSlider.d.ts +2 -1
- package/dist/Components/List/List.d.ts +6 -2
- package/dist/Components/Marquee/Marquee.d.ts +6 -2
- package/dist/Components/MarqueeText/MarqueeText.d.ts +2 -1
- package/dist/Components/Mercury/Mercury.d.ts +4 -1
- package/dist/Components/Waterfall/WaterfallLightbox.d.ts +4 -1
- package/dist/Components/utils/EmbedMediaFrame.d.ts +27 -0
- package/dist/Components/utils/LinkWrapper.d.ts +16 -0
- package/dist/Components/utils/embedMedia.d.ts +40 -0
- package/dist/Components/utils/index.d.ts +6 -0
- package/dist/{ControlSlider-SiOt22l_.js → ControlSlider-Kkec-i14.js} +1 -1
- package/dist/{ControlSlider-pZv7H6BU.mjs → ControlSlider-LcZmviGX.mjs} +1 -1
- package/dist/EmbedMediaFrame-DsOTKE4i.js +1 -0
- package/dist/EmbedMediaFrame-DwHeOAy5.mjs +164 -0
- package/dist/{FAQ-C7823fyi.js → FAQ-BxhMo7T8.js} +1 -1
- package/dist/{FAQ-CZ39u4m8.mjs → FAQ-CdwSft5p.mjs} +1 -1
- package/dist/Grid-CFHTP3mb.js +378 -0
- package/dist/Grid-e-gLfsji.mjs +1590 -0
- package/dist/Helix-BpLo9FD3.js +43 -0
- package/dist/Helix-CidI3ucE.mjs +324 -0
- package/dist/{Hive-D6-R6TwM.mjs → Hive-BsmFHk2i.mjs} +505 -475
- package/dist/Hive-D1j6wZpV.js +321 -0
- package/dist/ImageRevealSlider-BuukTGAK.js +1 -0
- package/dist/{ImageRevealSlider-BdFGyVEP.mjs → ImageRevealSlider-Df9sygk9.mjs} +63 -70
- package/dist/{Lightbox-eP9qAZzL.mjs → Lightbox-C_fXsfdz.mjs} +1 -1
- package/dist/{Lightbox-CIss_nOG.js → Lightbox-DaunVrkp.js} +1 -1
- package/dist/LinkWrapper-Ca84iPtg.js +1 -0
- package/dist/LinkWrapper-DZs9hlOn.mjs +13 -0
- package/dist/{List-DW7fyJbf.mjs → List-Bh_-l9vD.mjs} +532 -520
- package/dist/List-DVvpQ24J.js +377 -0
- package/dist/Marquee-DByooiWP.mjs +578 -0
- package/dist/Marquee-DfIP-tIN.js +133 -0
- package/dist/{MarqueeText-Rzt2fJYt.mjs → MarqueeText-D6FNCe6P.mjs} +115 -114
- package/dist/MarqueeText-DsUiV6Zv.js +132 -0
- package/dist/Mercury-B-s2Kvuq.js +267 -0
- package/dist/Mercury-CCW0Es-s.mjs +1700 -0
- package/dist/{RichTextRenderer-B6WtTYlR.mjs → RichTextRenderer-BptwNpbJ.mjs} +10 -9
- package/dist/RichTextRenderer-K90Dd7pt.js +1 -0
- package/dist/{Slider20-Dm8BeCli.mjs → Slider20-CCzixTiN.mjs} +1 -1
- package/dist/{Slider20-C9o2REDl.js → Slider20-fMVeRfgx.js} +1 -1
- package/dist/{TestimonialGrid-CPu4qQ6B.mjs → TestimonialGrid-CbsVxSn9.mjs} +1 -1
- package/dist/{TestimonialGrid-D4ieiz9e.js → TestimonialGrid-CiCagfBU.js} +1 -1
- package/dist/{TestimonialSingle-DLdnAVF7.mjs → TestimonialSingle-BVm3Amrl.mjs} +1 -1
- package/dist/{TestimonialSingle-CVu15ZtV.js → TestimonialSingle-BWXynGjv.js} +1 -1
- package/dist/Waterfall-3kKioKh2.mjs +1432 -0
- package/dist/Waterfall-DII4-WV5.js +288 -0
- package/dist/{components-D2LyuDm-.mjs → components-DKuQ8PUa.mjs} +19 -18
- package/dist/components-SEwSqFrQ.js +1 -0
- package/dist/content/postFieldBindings.d.ts +29 -0
- package/dist/elements.js +1 -1
- package/dist/elements.mjs +22 -21
- 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 +52 -15
- package/dist/sources.js +1331 -233
- package/dist/sources.mjs +1355 -256
- package/dist/types/SchemaV1.d.ts +53 -1
- package/dist/utils.js +1 -1
- package/dist/utils.mjs +30 -20
- package/package.json +1 -1
- package/dist/ClickGallerie-D7g093HX.js +0 -36
- package/dist/ClickGallerie-QSOQjSdv.mjs +0 -271
- package/dist/Grid-BBpdl60K.js +0 -374
- package/dist/Grid-DS53S_gA.mjs +0 -1576
- package/dist/Helix-BPn9V1sg.mjs +0 -315
- package/dist/Helix-DcgsCc4D.js +0 -43
- package/dist/Hive-n8Fz-j3o.js +0 -321
- package/dist/ImageRevealSlider-BBWtFjUF.js +0 -1
- package/dist/List-C32WImI3.js +0 -377
- package/dist/Marquee-DOIRRCu4.js +0 -133
- package/dist/Marquee-O_PDwlIb.mjs +0 -564
- package/dist/MarqueeText-DkaO2lQ5.js +0 -132
- package/dist/Mercury-C9D10TTT.mjs +0 -1702
- package/dist/Mercury-DynO-NxY.js +0 -267
- package/dist/PretextComponent-BnsS2zJ6.js +0 -1
- package/dist/RichTextRenderer-CIy6yI8U.js +0 -1
- package/dist/Waterfall-DC2WQ3GT.js +0 -287
- package/dist/Waterfall-Yud2VR62.mjs +0 -1404
- package/dist/components-B9Vdjf0w.js +0 -1
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react/jsx-runtime"),s=require("react"),At=require("classnames"),Et=require("./scalingValue-CSHYgTZl.js"),Mt=require("./useScopedStyles-Bf6yohVQ.js"),Ct=require("./LinkWrapper-Ca84iPtg.js"),Rt=require("./textStylesToCss-CNN3zZTV.js"),kt=require("./observeIntersection-DxGj9Ctt.js");function qt(e,r,o){const c=r>0?`${r}px`:"0px",a=o?`
|
|
2
|
+
.${e}-item-image-wrap {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex: 0 0 auto;
|
|
5
|
+
align-items: center;
|
|
6
|
+
}
|
|
7
|
+
.${e}-glyph {
|
|
8
|
+
display: inline-block;
|
|
9
|
+
}
|
|
10
|
+
.${e}-glyph-inner {
|
|
11
|
+
display: inline-block;
|
|
12
|
+
transform-origin: 50% 50%;
|
|
13
|
+
backface-visibility: hidden;
|
|
14
|
+
-webkit-backface-visibility: hidden;
|
|
15
|
+
}
|
|
16
|
+
.${e}-item-image {
|
|
17
|
+
transform-origin: 50% 50%;
|
|
18
|
+
backface-visibility: hidden;
|
|
19
|
+
-webkit-backface-visibility: hidden;
|
|
20
|
+
}
|
|
21
|
+
`:"";return`
|
|
22
|
+
.${e}-wrapper {
|
|
23
|
+
position: relative;
|
|
24
|
+
width: 100%;
|
|
25
|
+
height: auto;
|
|
26
|
+
}
|
|
27
|
+
.${e}-marquee-wrapper {
|
|
28
|
+
position: relative;
|
|
29
|
+
overflow: hidden;
|
|
30
|
+
overflow-x: clip;
|
|
31
|
+
overflow-y: visible;
|
|
32
|
+
width: 100%;
|
|
33
|
+
height: auto;
|
|
34
|
+
}
|
|
35
|
+
.${e}-curve-bg {
|
|
36
|
+
position: absolute;
|
|
37
|
+
left: 0;
|
|
38
|
+
top: 0;
|
|
39
|
+
width: 100%;
|
|
40
|
+
height: 100%;
|
|
41
|
+
overflow: visible;
|
|
42
|
+
pointer-events: none;
|
|
43
|
+
z-index: 0;
|
|
44
|
+
}
|
|
45
|
+
.${e}-ribbon {
|
|
46
|
+
position: absolute;
|
|
47
|
+
left: 0;
|
|
48
|
+
top: 50%;
|
|
49
|
+
width: 100%;
|
|
50
|
+
transform: translateY(-50%);
|
|
51
|
+
pointer-events: none;
|
|
52
|
+
z-index: 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@keyframes ${e}-marquee-left {
|
|
56
|
+
from { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
|
|
57
|
+
to { -webkit-transform: translate3d(-${c}, 0, 0); transform: translate3d(-${c}, 0, 0); }
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@keyframes ${e}-marquee-right {
|
|
61
|
+
from { -webkit-transform: translate3d(-${c}, 0, 0); transform: translate3d(-${c}, 0, 0); }
|
|
62
|
+
to { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.${e}-marquee-track {
|
|
66
|
+
display: flex;
|
|
67
|
+
flex-direction: row;
|
|
68
|
+
width: max-content;
|
|
69
|
+
backface-visibility: hidden;
|
|
70
|
+
-webkit-backface-visibility: hidden;
|
|
71
|
+
flex-wrap: nowrap;
|
|
72
|
+
-webkit-animation-timing-function: linear;
|
|
73
|
+
animation-timing-function: linear;
|
|
74
|
+
-webkit-animation-iteration-count: infinite;
|
|
75
|
+
animation-iteration-count: infinite;
|
|
76
|
+
position: relative;
|
|
77
|
+
z-index: 1;
|
|
78
|
+
}
|
|
79
|
+
.${e}-marquee-track[data-direction="left"] {
|
|
80
|
+
-webkit-animation-name: ${e}-marquee-left;
|
|
81
|
+
animation-name: ${e}-marquee-left;
|
|
82
|
+
}
|
|
83
|
+
.${e}-marquee-track[data-direction="right"] {
|
|
84
|
+
-webkit-animation-name: ${e}-marquee-right;
|
|
85
|
+
animation-name: ${e}-marquee-right;
|
|
86
|
+
}
|
|
87
|
+
.${e}-marquee-set {
|
|
88
|
+
display: flex;
|
|
89
|
+
flex-direction: row;
|
|
90
|
+
align-items: center;
|
|
91
|
+
flex: 0 0 auto;
|
|
92
|
+
position: relative;
|
|
93
|
+
z-index: 1;
|
|
94
|
+
}
|
|
95
|
+
.${e}-marquee-static {
|
|
96
|
+
justify-content: center;
|
|
97
|
+
overflow-x: auto;
|
|
98
|
+
}
|
|
99
|
+
.${e}-item {
|
|
100
|
+
position: relative;
|
|
101
|
+
display: flex;
|
|
102
|
+
flex-direction: row;
|
|
103
|
+
align-items: center;
|
|
104
|
+
flex: 0 0 auto;
|
|
105
|
+
white-space: nowrap;
|
|
106
|
+
}
|
|
107
|
+
.${e}-item-link {
|
|
108
|
+
display: flex;
|
|
109
|
+
flex-direction: row;
|
|
110
|
+
align-items: center;
|
|
111
|
+
text-decoration: none;
|
|
112
|
+
color: inherit;
|
|
113
|
+
}
|
|
114
|
+
.${e}-item-image {
|
|
115
|
+
display: block;
|
|
116
|
+
width: auto;
|
|
117
|
+
flex: 0 0 auto;
|
|
118
|
+
object-fit: contain;
|
|
119
|
+
}
|
|
120
|
+
.${e}-text {
|
|
121
|
+
display: inline-block;
|
|
122
|
+
}
|
|
123
|
+
${a}
|
|
124
|
+
.${e}-cap-ref {
|
|
125
|
+
position: absolute;
|
|
126
|
+
visibility: hidden;
|
|
127
|
+
pointer-events: none;
|
|
128
|
+
white-space: nowrap;
|
|
129
|
+
left: -9999px;
|
|
130
|
+
top: 0;
|
|
131
|
+
}
|
|
132
|
+
`}const Lt=30,we=3,Ft=12,Tt=96,Ve=3,ce=.72,Wt=100,_t=10,Nt=e=>e/Wt,jt=e=>Math.max(0,e)/_t,Bt=e=>{e.style.setProperty("animation-name","none"),e.style.setProperty("-webkit-animation-name","none"),e.offsetHeight,e.style.removeProperty("animation-name"),e.style.removeProperty("-webkit-animation-name")},Ht=(e,r)=>Array.from({length:r*e.length},(o,c)=>e[c%e.length]),U={ctx:void 0},Ot=()=>U.ctx!==void 0?U.ctx:typeof document>"u"?(U.ctx=null,U.ctx):(U.ctx=document.createElement("canvas").getContext("2d"),U.ctx),Pt=(e,r,o,c)=>{e.style.transform=`translate3d(${r}px, ${o}px, 0) rotate(${c}deg)`},Ye=e=>{e.style.transform=""},zt=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},Dt=(e,r)=>{const o=(c,a)=>{if(!c||c===r)return a;const m=a+c.offsetLeft,u=c.offsetParent;return!u||u===c?m:o(u,m)};return o(e,e.offsetWidth/2)},Ke=96,Qe=(e,r,o)=>{if(r<=0||Math.abs(e)<=0||o<2)return null;const c=2*Math.PI/r,a=new Float64Array(o+1),m=new Float64Array(o+1),u=e*r,l=d=>Math.sqrt(1+(u*Math.cos(r*d))**2),$=c/o;return Array.from({length:o},(d,C)=>{const v=C*$,R=v+$;a[C+1]=R,m[C+1]=m[C]+(l(v)+l(R))*.5*$}),{wavelength:c,periodArc:m[o],x:a,s:m}},It=(e,r)=>{const o=Qe(e,r,Ke);return!o||o.wavelength<=0?1:o.periodArc/o.wavelength},Ut=(e,r)=>{if(e.periodArc<=0)return r;const o=r<0?-1:1,c=Math.abs(r),a=Math.floor(c/e.periodArc),m=c-a*e.periodArc,{s:u,x:l}=e,$=(q,S)=>{if(S-q<=1)return[q,S];const L=q+S>>1;return u[L]<=m?$(L,S):$(q,L)},[d,C]=$(0,u.length-1),v=u[C]-u[d],R=v>0?(m-u[d])/v:0;return o*(a*e.wavelength+l[d]+(l[C]-l[d])*R)},Xt=(e,r,o,c,a=0)=>{const m=Math.max(0,o),u=e>0?2*Math.PI*m/e:0,l=S=>c+r*Math.sin(u*S),$=S=>r*u*Math.cos(u*S),d=-a,v=e+a-d,R=Math.max(4,Math.ceil(m*4*(v/Math.max(e,1)))),q=Array.from({length:R},(S,L)=>{const _=d+L/R*v,F=d+(L+1)/R*v,j=F-_,J=l(_),X=l(F),Z=_+j/3,ee=J+$(_)*j/3,ue=F-j/3,te=X-$(F)*j/3;return`C${Z.toFixed(2)} ${ee.toFixed(2)} ${ue.toFixed(2)} ${te.toFixed(2)} ${F.toFixed(2)} ${X.toFixed(2)}`});return[`M${d.toFixed(2)} ${l(d).toFixed(2)}`,...q].join(" ")},Vt=({item:e,prefix:r,textCss:o,capHeightPx:c,opticalOffsetY:a,imageGapPx:m,isCurve:u})=>{var q;const l=a!==0?{...o,transform:`translateY(${a}px)`}:o,$=c>0?{height:`${c}px`}:{fontSize:o.fontSize,height:`${ce}em`},d=((q=e.image)==null?void 0:q.assetId)&&f.jsx("img",{src:e.image.assetId,alt:e.image.name??"",className:`${r}-item-image`,style:$}),C=d&&(u?f.jsx("span",{className:`${r}-item-image-wrap`,"data-marquee-wave-node":!0,children:d}):d),v=u?f.jsx("span",{className:`${r}-text`,style:l,children:Array.from(e.text).map((S,L)=>f.jsx("span",{className:`${r}-glyph`,"data-marquee-wave-node":!0,children:f.jsx("span",{className:`${r}-glyph-inner`,children:S===" "?" ":S})},L))}):f.jsx("span",{className:`${r}-text`,style:l,children:e.text}),R=f.jsxs(f.Fragment,{children:[C,v]});return f.jsx("div",{className:`${r}-item`,"data-marquee-text-item":!0,style:{gap:m},children:f.jsx(Ct.LinkWrapper,{link:e.link,className:`${r}-item-link`,style:{gap:m},children:R})})},Yt=({settings:e,content:r,isEditor:o,isPreviewMode:c})=>{const{prefix:a}=Mt.useScopedStyles(),[m,u]=s.useState(0),l=m>0?Math.round(m):0,{speed:$,direction:d,pauseOnHover:C,gap:v,layoutType:R,curveAmplitude:q,curveFrequency:S,textFontFamily:L,textFontSettings:_,textFontSize:F,textLetterSpacing:j,textWordSpacing:J,textTextAppearance:X,textColor:Z,backgroundColor:ee,ribbonWidth:ue}=e,te=ue??F,b=R==="curve",P=Nt(q),V=jt(S),Ge=s.useMemo(()=>qt(a,l,b),[a,l,b]),B=s.useMemo(()=>Rt.textStylesToCss({fontSettings:{fontFamily:L,fontWeight:_.fontWeight,fontStyle:_.fontStyle},letterSpacing:j,wordSpacing:J,fontSize:F,lineHeight:F,textAppearance:X,color:Z},o),[L,_,j,J,F,X,Z,o]),ne=n=>Et.scalingValue(n,o??!1),H=((r==null?void 0:r.length)??0)>0,Y=o?!!c:!0,O=H&&(Y||!!o),re=Math.max(0,$)*Lt,le=Y&&C==="on",[Je,$e]=s.useState(!1),de=Y?le&&Je?"paused":"running":"paused",fe=de==="running"&&re>0&&l>0,Ze=l>0&&re>0?l/re*1e3:0,oe=s.useRef(null),me=s.useRef(null),he=s.useRef(null),ie=s.useRef(null),Se=s.useRef(null),Ae=s.useRef(null),Ee=s.useRef(fe),K=s.useRef(null),Q=s.useRef(null),pe=s.useRef(P),ge=s.useRef(V);Ee.current=fe,pe.current=P,ge.current=V;const[z,Me]=s.useState(0),[et,Ce]=s.useState(0),[Re,ke]=s.useState(0),[G,qe]=s.useState(0),[Le,tt]=s.useState(0),se=s.useMemo(()=>(r??[]).map(n=>{var i,t;return`${n.text}\0${((i=n.image)==null?void 0:i.assetId)??""}\0${((t=n.link)==null?void 0:t.value)??""}`}).join("\0"),[r]),[D,Fe]=s.useState(we),nt=s.useMemo(()=>{const n=r??[];return n.length===0||!(Y||o)?n:Ht(n,D)},[r,Y,D,o]),rt=O?Ve:1;s.useLayoutEffect(()=>{Fe(we),u(0)},[se]),s.useLayoutEffect(()=>{var y;const n=Ae.current;if(!n)return;const i=()=>{const p=getComputedStyle(n),g=parseFloat(p.fontSize)||0;if(g<=0)return;const h=Ot();if(!h){Me(g*ce),Ce(0);return}h.font=`${p.fontStyle} ${p.fontWeight} ${g}px ${p.fontFamily}`;const E=h.measureText("H"),T=E.actualBoundingBoxAscent>0?E.actualBoundingBoxAscent:g*ce,N=Math.max(0,E.actualBoundingBoxDescent||0),k=E.fontBoundingBoxAscent||0,M=E.fontBoundingBoxDescent||0;Me(x=>Math.abs(x-T)>.5?T:x);const A=k>0||M>0?(M-N-(k-T))/2:0;Ce(x=>Math.abs(x-A)>.25?A:x)};i();const t=typeof document<"u"?document.fonts:void 0;(y=t==null?void 0:t.ready)==null||y.then(i).catch(()=>{});const w=new ResizeObserver(i);return w.observe(n),()=>w.disconnect()},[B.fontFamily,B.fontWeight,B.fontStyle,B.fontSize,B.lineHeight]),s.useLayoutEffect(()=>{if(!O)return;const n=oe.current,i=ie.current;if(!n||!i)return;const t={id:0},w=()=>{const h=n.offsetWidth||n.getBoundingClientRect().width,E=i.offsetWidth||i.getBoundingClientRect().width;if(H&&h>0&&E>0){const T=E/D;if(T>0){let N=h,k=Ft;if(b){const A=h*pe.current,x=ge.current,I=x>0?2*Math.PI*x/h:0,W=It(A,I);N=Math.max(h,W*h/(Ve-1)),k=Tt}const M=Math.min(k,Math.max(we,Math.ceil(N/T)+1));if(M!==D){Fe(M);return}}}E>0&&u(E)},y=()=>{cancelAnimationFrame(t.id),t.id=requestAnimationFrame(w)};y();const p=new ResizeObserver(y);p.observe(n),p.observe(i);const g=()=>{document.hidden||y()};return document.addEventListener("visibilitychange",g),window.addEventListener("pageshow",g),window.addEventListener("focus",g),()=>{cancelAnimationFrame(t.id),p.disconnect(),document.removeEventListener("visibilitychange",g),window.removeEventListener("pageshow",g),window.removeEventListener("focus",g)}},[O,se,D,H,z,b,P,V]),s.useLayoutEffect(()=>{const n=Se.current;if(!n)return;const i={id:0},t=()=>{const y=n.offsetHeight;y>0&&tt(p=>Math.abs(p-y)>.5?y:p)};i.id=requestAnimationFrame(t);const w=new ResizeObserver(()=>{cancelAnimationFrame(i.id),i.id=requestAnimationFrame(t)});return w.observe(n),()=>{cancelAnimationFrame(i.id),w.disconnect()}},[te,o]),s.useLayoutEffect(()=>{if(!b){ke(0),qe(0);return}const n=oe.current,i=ie.current;if(!n||!i)return;const t={id:0},w=()=>{const p=n.offsetWidth,g=i.offsetHeight;p>0&&qe(h=>Math.abs(h-p)>.5?p:h),g>0&&ke(h=>Math.abs(h-g)>.5?g:h)};t.id=requestAnimationFrame(w);const y=new ResizeObserver(()=>{cancelAnimationFrame(t.id),t.id=requestAnimationFrame(w)});return y.observe(n),y.observe(i),()=>{cancelAnimationFrame(t.id),y.disconnect()}},[b,se,z,F,O]),s.useLayoutEffect(()=>{if(!O||l<=0)return;const n=he.current;n&&Bt(n)},[O,l,d,re]),s.useLayoutEffect(()=>{if(!b||!H)return;const n=oe.current;if(!n)return;const i=typeof IntersectionObserver<"u",t={raf:0,cancelled:!1,isOnScreen:!i,lut:null,lutKey:"",itemsCache:[],cacheDirty:!0},w=()=>{for(const M of t.itemsCache)for(const A of M.glyphs)Ye(A.inner)},y=()=>{const M=me.current??n;t.itemsCache=Array.from(n.querySelectorAll("[data-marquee-text-item]"),A=>{const x=[];return A.querySelectorAll("[data-marquee-wave-node]").forEach(I=>{const W=I.firstElementChild;W&&x.push({inner:W,layoutLocalX:Dt(I,M)})}),{item:A,glyphs:x}}),t.cacheDirty=!1},p=()=>{t.cacheDirty&&y();const A=(me.current??n).offsetWidth||1,x=A*pe.current,I=ge.current,W=2*Math.PI*I/A,Oe=`${A}|${x}|${W}`;if(Oe!==t.lutKey&&(t.lutKey=Oe,t.lut=Qe(x,W,Ke)),Math.abs(x)<=0||W<=0){w();return}const Pe=he.current,gt=Pe?zt(getComputedStyle(Pe).transform):0,ze=n.getBoundingClientRect(),xt=ze.left,yt=ze.right,vt=t.lut&&t.lut.wavelength>0?Math.max(0,(t.lut.periodArc/t.lut.wavelength-1)*A):0;for(const{item:bt,glyphs:De}of t.itemsCache){const Ie=bt.getBoundingClientRect();if(Ie.right<xt||Ie.left>yt+vt){for(const ae of De)Ye(ae.inner);continue}for(const ae of De){const be=ae.layoutLocalX+gt,Ue=t.lut?Ut(t.lut,be):be,Xe=W*Ue,wt=x*Math.sin(Xe),$t=x*W*Math.cos(Xe),St=Math.atan($t)*(180/Math.PI);Pt(ae.inner,Ue-be,wt,St)}}},g=()=>{t.cancelled||(t.raf=0,p(),Ee.current&&t.isOnScreen&&!document.hidden&&(t.raf=requestAnimationFrame(g)))},h=()=>{t.cancelled||t.raf||!t.isOnScreen||(t.raf=requestAnimationFrame(g))},E=()=>{cancelAnimationFrame(t.raf),t.raf=0},T=()=>{t.cacheDirty=!0,t.isOnScreen&&(p(),h())};K.current=h,Q.current=T,p(),h();const N=i?kt.observeIntersection(n,"0px",M=>{t.isOnScreen=M,M?T():E()}):null,k=()=>{E(),document.hidden||T()};return document.addEventListener("visibilitychange",k),window.addEventListener("pageshow",k),window.addEventListener("focus",k),()=>{t.cancelled=!0,K.current=null,Q.current=null,N==null||N(),cancelAnimationFrame(t.raf),document.removeEventListener("visibilitychange",k),window.removeEventListener("pageshow",k),window.removeEventListener("focus",k),w()}},[b,H]),s.useLayoutEffect(()=>{var n;!b||!H||(n=Q.current)==null||n.call(Q)},[b,H,m,se,D,z,P,V,G]),s.useLayoutEffect(()=>{var n;(n=K.current)==null||n.call(K)},[fe,d]);const ot=n=>{le&&n.pointerType==="mouse"&&$e(!0)},it=()=>{le&&$e(!1)},Te=b?Math.abs(P)*100:0,xe=ne(te),st={minHeight:xe,...b?{paddingTop:`${Te}%`,paddingBottom:`${Te}%`}:{}},at={height:xe,...b?{visibility:"hidden"}:{backgroundColor:ee}},We={gap:ne(v),minHeight:xe},_e=G*P,Ne=Math.abs(_e),ye=Le>0?Le:Re,ve=Math.max(Re,ye),ct=Ne+ve/2,ut=Math.max(ye,1),je=b&&G>0&&ve>0?Xt(G,_e,V,ct,ut):"",lt=Ne*2+ve,dt=je?f.jsx("svg",{className:`${a}-curve-bg`,viewBox:`0 0 ${G} ${lt}`,preserveAspectRatio:"none","aria-hidden":!0,children:f.jsx("path",{d:je,fill:"none",stroke:ee,strokeWidth:ye,strokeLinecap:"butt",strokeLinejoin:"round"})}):null,ft=f.jsx("div",{ref:Se,className:`${a}-ribbon`,style:at,"aria-hidden":!0}),mt={...B,lineHeight:z>0?`${z}px`:`${ce}em`},Be=(n,i,t)=>f.jsx(Vt,{item:n,prefix:a,textCss:mt,capHeightPx:z,opticalOffsetY:et,imageGapPx:ne(v),isCurve:b},`${i}-${t}`),ht=f.jsx("span",{ref:Ae,"aria-hidden":!0,className:`${a}-cap-ref`,style:B,children:"H"}),He=`${Math.max(0,Ze)/1e3}s`,pt=O?f.jsx("div",{ref:he,className:`${a}-marquee-track`,"data-direction":d,onPointerEnter:ot,onPointerLeave:it,style:{WebkitAnimationDuration:He,animationDuration:He,WebkitAnimationPlayState:de,animationPlayState:de},children:Array.from({length:rt},(n,i)=>f.jsx("div",{ref:i===0?ie:void 0,className:`${a}-marquee-set`,style:{...We,paddingRight:ne(v)},"aria-hidden":i>0,children:nt.map((t,w)=>Be(t,i,w))},`set-${i}`))}):f.jsx("div",{ref:ie,className:At(`${a}-marquee-set`,`${a}-marquee-static`),style:We,children:r==null?void 0:r.map((n,i)=>Be(n,0,i))});return f.jsxs("div",{ref:oe,className:`${a}-wrapper`,"aria-label":"Marquee text",children:[f.jsx("style",{dangerouslySetInnerHTML:{__html:Ge}}),ht,f.jsxs("div",{ref:me,className:`${a}-marquee-wrapper`,style:st,children:[ft,dt,pt]})]})};exports.MarqueeText=Yt;
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),a=require("react"),_e=require("react-dom"),lt=require("./scalingValue-CSHYgTZl.js"),Be=require("./buildColorVars-CE2D5cQV.js"),Ge=require("./useScopedStyles-Bf6yohVQ.js"),gt=require("./EmbedMediaFrame-DsOTKE4i.js"),bt=require("./textStylesToCss-CNN3zZTV.js"),qe=require("./SvgImage-DFlmxAoL.js"),Ke=require("./LazyVideo-imbU18js.js"),wt=300/1440,Ue=8/1440,rt=.004;function Xe(t){return`calc(var(--cntrl-article-width, 100vw) * ${t/1440})`}function Pt(t,e,o,r){return e!==void 0&&e<(t??.01)?`${o} ${r}`:o}function te(t,e,o,r,l="title-leading-gap"){const c=t??.01;return e===void 0||e>=c?{}:{[`--${o}-${l}`]:lt.scalingValue((c-e)/2,r)}}function Ye(t){return`
|
|
2
|
+
.${t}-wrapper {
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
position: relative;
|
|
7
|
+
width: 100%;
|
|
8
|
+
min-height: ${Xe(48)};
|
|
9
|
+
}
|
|
10
|
+
.${t}-single-title-layer {
|
|
11
|
+
position: absolute;
|
|
12
|
+
inset: 0;
|
|
13
|
+
z-index: 2;
|
|
14
|
+
pointer-events: none;
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
justify-content: flex-start;
|
|
18
|
+
}
|
|
19
|
+
.${t}-single-title {
|
|
20
|
+
pointer-events: none;
|
|
21
|
+
}
|
|
22
|
+
.${t}-item {
|
|
23
|
+
position: relative;
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
width: 100%;
|
|
27
|
+
}
|
|
28
|
+
.${t}-item-a {
|
|
29
|
+
flex-direction: row;
|
|
30
|
+
}
|
|
31
|
+
.${t}-item-b {
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
}
|
|
34
|
+
.${t}-item-c {
|
|
35
|
+
flex-direction: row-reverse;
|
|
36
|
+
}
|
|
37
|
+
.${t}-title {
|
|
38
|
+
align-self: flex-start;
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-shrink: 0;
|
|
41
|
+
min-width: 0;
|
|
42
|
+
box-sizing: border-box;
|
|
43
|
+
position: sticky;
|
|
44
|
+
z-index: 2;
|
|
45
|
+
overflow: visible;
|
|
46
|
+
color: var(--${t}-title-color);
|
|
47
|
+
}
|
|
48
|
+
.${t}-title-text,
|
|
49
|
+
.${t}-description-text {
|
|
50
|
+
display: block;
|
|
51
|
+
width: 100%;
|
|
52
|
+
white-space: pre-wrap;
|
|
53
|
+
overflow-wrap: anywhere;
|
|
54
|
+
word-break: break-word;
|
|
55
|
+
}
|
|
56
|
+
.${t}-description-text {
|
|
57
|
+
color: var(--${t}-description-color);
|
|
58
|
+
}
|
|
59
|
+
.${t}-title-texts {
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-direction: column;
|
|
62
|
+
width: 100%;
|
|
63
|
+
min-width: 0;
|
|
64
|
+
}
|
|
65
|
+
.${t}-title-texts-gap {
|
|
66
|
+
position: relative;
|
|
67
|
+
width: 100%;
|
|
68
|
+
flex-shrink: 0;
|
|
69
|
+
}
|
|
70
|
+
.${t}-title-text-inner {
|
|
71
|
+
display: flex;
|
|
72
|
+
flex-direction: column;
|
|
73
|
+
flex-shrink: 0;
|
|
74
|
+
box-sizing: border-box;
|
|
75
|
+
outline: 1px solid #FF5C02;
|
|
76
|
+
}
|
|
77
|
+
.${t}-title-text-inner-hidden {
|
|
78
|
+
display: flex;
|
|
79
|
+
flex-direction: column;
|
|
80
|
+
flex-shrink: 0;
|
|
81
|
+
box-sizing: border-box;
|
|
82
|
+
}
|
|
83
|
+
.${t}-title-text-stack {
|
|
84
|
+
display: flex;
|
|
85
|
+
flex-direction: column;
|
|
86
|
+
flex-shrink: 0;
|
|
87
|
+
min-width: 0;
|
|
88
|
+
position: relative;
|
|
89
|
+
box-sizing: border-box;
|
|
90
|
+
}
|
|
91
|
+
.${t}-item-a .${t}-title-v-top .${t}-title-text-stack,
|
|
92
|
+
.${t}-item-b .${t}-title-v-top .${t}-title-text-stack,
|
|
93
|
+
.${t}-item-c .${t}-title-v-top .${t}-title-text-stack,
|
|
94
|
+
.${t}-single-title-layer .${t}-title-v-top .${t}-title-text-stack {
|
|
95
|
+
padding-top: var(--${t}-title-top-padding, 0);
|
|
96
|
+
}
|
|
97
|
+
.${t}-item-a .${t}-title-v-bottom .${t}-title-text-stack,
|
|
98
|
+
.${t}-item-b .${t}-title-v-bottom .${t}-title-text-stack,
|
|
99
|
+
.${t}-item-c .${t}-title-v-bottom .${t}-title-text-stack,
|
|
100
|
+
.${t}-single-title-layer .${t}-title-v-bottom .${t}-title-text-stack {
|
|
101
|
+
padding-bottom: var(--${t}-title-bottom-padding, 0);
|
|
102
|
+
}
|
|
103
|
+
.${t}-title-v-center {
|
|
104
|
+
top: calc(var(--cntrl-article-top, 0px) + var(--cntrl-viewport-height, 100vh) / 2 - (var(--${t}-title-height, 0px) / 2));
|
|
105
|
+
align-items: center;
|
|
106
|
+
}
|
|
107
|
+
.${t}-title-v-top {
|
|
108
|
+
top: var(--cntrl-article-top, 0px);
|
|
109
|
+
bottom: auto;
|
|
110
|
+
align-self: flex-start;
|
|
111
|
+
}
|
|
112
|
+
.${t}-title-v-bottom {
|
|
113
|
+
top: calc(var(--cntrl-article-top, 0px) + var(--cntrl-viewport-height, 100vh) - var(--${t}-title-height, 0px));
|
|
114
|
+
align-items: center;
|
|
115
|
+
}
|
|
116
|
+
.${t}-title-h-left {
|
|
117
|
+
justify-content: flex-start;
|
|
118
|
+
}
|
|
119
|
+
.${t}-item-a .${t}-title-h-left,
|
|
120
|
+
.${t}-item-b .${t}-title-h-left,
|
|
121
|
+
.${t}-item-c .${t}-title-h-left,
|
|
122
|
+
.${t}-single-title-layer .${t}-title-h-left {
|
|
123
|
+
padding-left: var(--${t}-title-left-padding, 0);
|
|
124
|
+
}
|
|
125
|
+
.${t}-title-h-center {
|
|
126
|
+
justify-content: center;
|
|
127
|
+
}
|
|
128
|
+
.${t}-title-h-right {
|
|
129
|
+
justify-content: flex-end;
|
|
130
|
+
}
|
|
131
|
+
.${t}-item-a .${t}-title-h-right,
|
|
132
|
+
.${t}-item-b .${t}-title-h-right,
|
|
133
|
+
.${t}-item-c .${t}-title-h-right,
|
|
134
|
+
.${t}-single-title-layer .${t}-title-h-right {
|
|
135
|
+
padding-right: var(--${t}-title-right-padding, 0);
|
|
136
|
+
}
|
|
137
|
+
.${t}-item-a .${t}-title,
|
|
138
|
+
.${t}-item-c .${t}-title {
|
|
139
|
+
flex: 1;
|
|
140
|
+
width: auto;
|
|
141
|
+
min-width: 0;
|
|
142
|
+
overflow: visible;
|
|
143
|
+
}
|
|
144
|
+
.${t}-item-b .${t}-title,
|
|
145
|
+
.${t}-single-title-layer .${t}-title {
|
|
146
|
+
width: 100%;
|
|
147
|
+
pointer-events: none;
|
|
148
|
+
}
|
|
149
|
+
.${t}-gallery {
|
|
150
|
+
display: flex;
|
|
151
|
+
flex-direction: column;
|
|
152
|
+
align-items: center;
|
|
153
|
+
flex-shrink: 0;
|
|
154
|
+
box-sizing: border-box;
|
|
155
|
+
}
|
|
156
|
+
.${t}-item-b .${t}-gallery {
|
|
157
|
+
display: grid;
|
|
158
|
+
width: 100%;
|
|
159
|
+
}
|
|
160
|
+
.${t}-item-b .${t}-gallery-media {
|
|
161
|
+
grid-area: 1 / 1;
|
|
162
|
+
display: flex;
|
|
163
|
+
flex-direction: column;
|
|
164
|
+
align-items: center;
|
|
165
|
+
width: 100%;
|
|
166
|
+
min-width: 0;
|
|
167
|
+
}
|
|
168
|
+
.${t}-item-b .${t}-title-layer {
|
|
169
|
+
grid-area: 1 / 1;
|
|
170
|
+
align-self: stretch;
|
|
171
|
+
width: 100%;
|
|
172
|
+
min-width: 0;
|
|
173
|
+
z-index: 2;
|
|
174
|
+
overflow: visible;
|
|
175
|
+
pointer-events: none;
|
|
176
|
+
display: flex;
|
|
177
|
+
flex-direction: column;
|
|
178
|
+
justify-content: flex-start;
|
|
179
|
+
}
|
|
180
|
+
.${t}-gallery-item {
|
|
181
|
+
position: relative;
|
|
182
|
+
display: flex;
|
|
183
|
+
flex-direction: column;
|
|
184
|
+
align-items: center;
|
|
185
|
+
width: 100%;
|
|
186
|
+
}
|
|
187
|
+
.${t}-gallery-image,
|
|
188
|
+
.${t}-gallery-video {
|
|
189
|
+
display: block;
|
|
190
|
+
max-width: 100%;
|
|
191
|
+
height: auto;
|
|
192
|
+
}
|
|
193
|
+
.${t}-gallery-controls {
|
|
194
|
+
position: relative;
|
|
195
|
+
display: flex;
|
|
196
|
+
flex-shrink: 0;
|
|
197
|
+
box-sizing: border-box;
|
|
198
|
+
z-index: 1;
|
|
199
|
+
}
|
|
200
|
+
.${t}-gallery-edge-spacer {
|
|
201
|
+
flex-shrink: 0;
|
|
202
|
+
}
|
|
203
|
+
.${t}-control-anchor {
|
|
204
|
+
position: absolute;
|
|
205
|
+
pointer-events: none;
|
|
206
|
+
z-index: 2;
|
|
207
|
+
}
|
|
208
|
+
.${t}-padding-handle {
|
|
209
|
+
width: 100%;
|
|
210
|
+
flex-shrink: 0;
|
|
211
|
+
background: transparent;
|
|
212
|
+
}
|
|
213
|
+
.${t}-text-tight-leading {
|
|
214
|
+
flex-shrink: 0;
|
|
215
|
+
padding-top: var(--${t}-title-leading-gap, 0);
|
|
216
|
+
padding-bottom: var(--${t}-title-leading-gap, 0);
|
|
217
|
+
}
|
|
218
|
+
.${t}-description-tight-leading {
|
|
219
|
+
flex-shrink: 0;
|
|
220
|
+
padding-top: var(--${t}-description-leading-gap, 0);
|
|
221
|
+
padding-bottom: var(--${t}-description-leading-gap, 0);
|
|
222
|
+
}
|
|
223
|
+
.${t}-lightbox-counter {
|
|
224
|
+
margin: 0;
|
|
225
|
+
color: var(--${t}-lightbox-counter-color);
|
|
226
|
+
}
|
|
227
|
+
.${t}-lightbox {
|
|
228
|
+
position: fixed;
|
|
229
|
+
inset: 0;
|
|
230
|
+
z-index: 9997;
|
|
231
|
+
overscroll-behavior: none;
|
|
232
|
+
overflow: hidden;
|
|
233
|
+
}
|
|
234
|
+
.${t}-lightbox-editor {
|
|
235
|
+
inset: auto;
|
|
236
|
+
top: var(--cntrl-article-top, 0);
|
|
237
|
+
left: var(--cntrl-article-left, 0);
|
|
238
|
+
width: var(--cntrl-article-width, 100vw) !important;
|
|
239
|
+
height: var(--cntrl-viewport-height, 100vh) !important;
|
|
240
|
+
}
|
|
241
|
+
.${t}-close-icon {
|
|
242
|
+
position: relative;
|
|
243
|
+
flex-shrink: 0;
|
|
244
|
+
pointer-events: auto;
|
|
245
|
+
z-index: 2;
|
|
246
|
+
display: flex;
|
|
247
|
+
align-items: center;
|
|
248
|
+
justify-content: center;
|
|
249
|
+
border: none;
|
|
250
|
+
background-color: transparent;
|
|
251
|
+
padding: 0;
|
|
252
|
+
}
|
|
253
|
+
.${t}-close-icon-inner {
|
|
254
|
+
all: unset;
|
|
255
|
+
position: relative;
|
|
256
|
+
cursor: pointer;
|
|
257
|
+
width: 100%;
|
|
258
|
+
height: 100%;
|
|
259
|
+
pointer-events: auto;
|
|
260
|
+
}
|
|
261
|
+
.${t}-close-icon-img {
|
|
262
|
+
position: absolute;
|
|
263
|
+
top: 50%;
|
|
264
|
+
left: 50%;
|
|
265
|
+
transform: translate(-50%, -50%);
|
|
266
|
+
}
|
|
267
|
+
`}const Se={"left-top":{horizontal:"left",vertical:"top"},"top-center":{horizontal:"center",vertical:"top"},"top-right":{horizontal:"right",vertical:"top"},"left-center":{horizontal:"left",vertical:"center"},center:{horizontal:"center",vertical:"center"},"right-center":{horizontal:"right",vertical:"center"},"left-bottom":{horizontal:"left",vertical:"bottom"},"bottom-center":{horizontal:"center",vertical:"bottom"},"right-bottom":{horizontal:"right",vertical:"bottom"}};function Ze(t){return t in Se}function Je(t){if(t&&Ze(t))return t;switch(t){case"center-top":return"top-center";case"right-top":return"top-right";case"top-left":return"left-top";case"center-bottom":return"bottom-center";case"bottom-left":return"left-bottom";case"bottom-right":return"right-bottom";case"center-center":return"center";case"left":return"left-center";case"right":return"right-center";case"top":return"left-top";default:return"center"}}function oe(t){return Se[t]}const Qe="rgba(28,31,34,0.9)",it=500,ft="cubic-bezier(0.22, 1, 0.36, 1)",Pe=72,tn=50,en={titleColor:"title-color",descriptionColor:"description-color",lightboxCounterColor:"lightbox-counter-color"},nn=[];function on(t){if(!Array.isArray(t)||t.length===0)return!1;const e=t[0];return e!==null&&typeof e=="object"&&"media"in e&&Array.isArray(e.media)}function rn(t){const[e,o]=t.media;return o!=null&&o.assetId?o:e!=null&&e.assetId?e:null}function ln(t){const[e]=t.media;return e!=null&&e.assetId?e:null}function an(t){if(!Array.isArray(t)||t.length===0)return[];if(on(t)){const e=[];for(const o of t){const r=rn(o);if(!r)continue;const l=ln(o);e.push({displayMedia:r,lightboxMedia:l!=null&&l.assetId?l:null})}return e}return t.filter(e=>e==null?void 0:e.assetId).map(e=>({displayMedia:e,lightboxMedia:e}))}function ne(t){return t.type==="video"}function sn(t){t.pause(),t.removeAttribute("src"),t.load()}function Ht(t){const e=t.getBoundingClientRect();return{width:e.width,height:e.height,left:e.left,top:e.top}}function cn(t){return t instanceof HTMLVideoElement?{width:t.videoWidth,height:t.videoHeight}:{width:t.naturalWidth,height:t.naturalHeight}}const dn=1140/1440;function hn(t){return typeof t=="string"?{display:t.toLowerCase()==="cover"?"cover":"fit",ratioValue:"2:3",reversed:!1}:{display:(typeof(t==null?void 0:t.display)=="string"?t.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(t==null?void 0:t.ratioValue)??"2:3",reversed:(t==null?void 0:t.reversed)??!1}}function un(t){const e=t.ratioValue??"1:1",o=t.reversed??!1,[r,l]=e.split(":").map(Number);return`${o?l:r} / ${o?r:l}`}function pn(t){return typeof t=="string"?t==="cover"?"cover":"fit":(t==null?void 0:t.display)==="cover"?"cover":"fit"}function fn({src:t,mediaRef:e,mediaStyle:o,onLoadedMetadata:r,onTransitionEnd:l}){return a.useEffect(()=>{const c=e.current;if(c)return()=>{sn(c)}},[t,e]),n.jsx("video",{ref:e,src:t,muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onLoadedMetadata:r,onTransitionEnd:l,style:o})}const gn="https://cdn.cntrl.site/component-assets/defaultCloseIcon.svg",mn=.004;function xn({prefix:t,closeIcon:e=gn,closeIconMaxWidth:o=.0125,closeIconColor:r="#FFFFFF",closeIconHoverColor:l="#999999",iconMarginRight:c=.01,contentMarginTop:i=.01,isEditor:f,isPreviewMode:s,isEditMode:u,visible:d,onClose:m}){if(!e)return null;const D=lt.scalingValue(o,f),L=lt.scalingValue(c,f),U=lt.scalingValue(i,f),I=lt.scalingValue(Math.max(i,mn),f);return n.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,zIndex:1e4,display:"flex",flexDirection:"column",alignItems:"flex-end",pointerEvents:"none",opacity:d?1:0,transition:"opacity 500ms cubic-bezier(0.22, 1, 0.36, 1)"},children:[n.jsx("div",{style:{position:"relative",width:"100%",height:U,flexShrink:0},children:u&&n.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-min":"0",className:`${t}-control`,style:{position:"absolute",top:0,left:0,width:"100%",height:I,pointerEvents:d?"auto":"none"}})}),n.jsxs("div",{className:`${t}-close-icon`,style:{width:D,height:D,marginRight:L,pointerEvents:d?"auto":"none"},onClick:R=>R.stopPropagation(),children:[n.jsx("button",{type:"button",className:`${t}-close-icon-inner`,"aria-label":"Close",onClick:R=>{R.stopPropagation(),m()},children:n.jsx(qe.SvgImage,{url:e,fill:r,hoverFill:f&&!s?r:l,className:`${t}-close-icon-img`})}),u&&n.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${t}-control`,style:{position:"absolute",top:0,left:"100%",width:L,height:"100%",pointerEvents:d?"auto":"none"}})]})]})}function yn({prefix:t,items:e,index:o,imageDisplay:r,isEditor:l,isPreviewMode:c,isEditMode:i,onClose:f,onPrev:s,onNext:u,counterClassName:d,counterStyle:m,backgroundColor:D,closeIcon:L,closeIconMaxWidth:U,closeIconColor:I,closeIconHoverColor:R,iconMarginRight:H,contentMarginTop:Q}){const at=r==="cover",M=a.useRef(null),V=a.useRef(null),S=a.useRef(null),w=a.useRef(0),g=a.useRef(0),x=a.useRef("none"),_=a.useRef(!1),B=a.useRef(!1),G=a.useRef(!1),X=a.useRef(null),[h,O]=a.useState(null),[b,N]=a.useState("opening"),[P,mt]=a.useState(0),[Rt,tt]=a.useState(0),[C,et]=a.useState(!1),[nt,Y]=a.useState(!1),[y,_t]=a.useState(!1),Nt=a.useRef(o),$=e[o],Bt=$?ne($):!1,kt=$?gt.isEmbedMedia($):!1,St=Rt!==0||C,Z=a.useCallback(p=>{G.current=p,et(p)},[]),z=a.useCallback(()=>{X.current!==null&&(window.clearTimeout(X.current),X.current=null)},[]),Ct=a.useCallback(()=>{z(),X.current=window.setTimeout(()=>{z(),Z(!1)},it+32)},[z,Z]),dt=a.useCallback(()=>{const p=M.current,k=V.current;if(!p)return;const A=p.getBoundingClientRect(),q=A.width,K=A.height;if(!q||!K)return;if(r==="cover"){O({width:q,height:K,left:A.left,top:A.top});return}let E=$&>.isEmbedMedia($)?gt.getEmbedAspect($):null;if(E===null){if(!k){O(Ht(p));return}const{width:T,height:v}=cn(k);if(!T||!v){O(Ht(p));return}E=T/v}const ct=q/K;if(E>ct){const T=q/E;O({width:q,height:T,left:A.left,top:A.top+(K-T)/2})}else{const T=K*E;O({width:T,height:K,left:A.left+(q-T)/2,top:A.top})}},[r,$]);a.useEffect(()=>{dt();const p=M.current;if(!p)return;const k=new ResizeObserver(()=>dt());return k.observe(p),()=>k.disconnect()},[dt,o]),a.useEffect(()=>{b==="opening"&&h&&N("open")},[b,h]),a.useEffect(()=>{if(b!=="closing")return;const p=setTimeout(()=>f(),it);return()=>clearTimeout(p)},[b,f]),a.useEffect(()=>()=>{z()},[z]),a.useLayoutEffect(()=>{if(Nt.current===o)return;z(),mt(0),tt(0),Z(!1),_t(!1),Y(!1),w.current=0,g.current=0,x.current="none",_.current=!1,S.current=null,B.current=!1;const p=M.current;p&&O(Ht(p)),Nt.current=o},[o,Z,z]),a.useEffect(()=>{if(b!=="open")return;let p=null;const k=()=>{p&&(document.removeEventListener("click",p,!0),p=null)},A=()=>{k(),p=v=>{v.stopPropagation(),v.preventDefault(),k()},document.addEventListener("click",p,!0)},q=v=>{z(),G.current=!1,et(!1),tt(0),Y(!1),_.current=!1,g.current=0,x.current="none";const F=M.current;F&&O(Ht(F)),v<0?u():s()},K=v=>{if(Math.abs(v)>tn&&e.length>1){q(v);return}Z(!0),tt(0),Ct()},E=v=>{if(v.touches.length!==1||G.current)return;const F=v.touches[0];B.current=!0,S.current={x:F.clientX,y:F.clientY},x.current="none",g.current=0,_.current=!1},ct=v=>{if(!S.current||v.touches.length!==1||G.current)return;const F=v.touches[0],pt=F.clientX-S.current.x,J=F.clientY-S.current.y;if(x.current==="none"){if(Math.abs(pt)<10&&Math.abs(J)<10)return;if(Math.abs(pt)>Math.abs(J)){if(e.length<=1)return;x.current="horizontal"}else if(J>0)x.current="vertical";else return}if(x.current==="horizontal"){_.current=!0,Y(!0),g.current=pt,tt(pt),v.preventDefault();return}x.current==="vertical"&&(_.current=!0,Y(!0),w.current=J,mt(J),v.preventDefault())},T=()=>{if(!S.current)return;const v=x.current,F=_.current;if(F&&v==="horizontal")K(g.current),A();else if(F&&v==="vertical")if(w.current>Pe){const J=window.innerHeight;w.current=J,_t(!0),mt(J),N("closing")}else w.current=0,mt(0),A();else v==="horizontal"&&Math.abs(g.current)>0&&(K(g.current),A());S.current=null,x.current="none",g.current=0,_.current=!1,Y(!1)};return document.addEventListener("touchstart",E,{passive:!0}),document.addEventListener("touchmove",ct,{passive:!1}),document.addEventListener("touchend",T),document.addEventListener("touchcancel",T),()=>{document.removeEventListener("touchstart",E),document.removeEventListener("touchmove",ct),document.removeEventListener("touchend",T),document.removeEventListener("touchcancel",T),k()}},[b,e.length,u,s,Z,Ct,z]),a.useEffect(()=>{const p=k=>{k.key==="Escape"&&(k.preventDefault(),k.stopPropagation(),b!=="closing"&&N("closing"))};return window.addEventListener("keydown",p,!0),()=>window.removeEventListener("keydown",p,!0)},[b]);const Et=()=>{b!=="closing"&&N("closing")},ht=b==="open",Mt=b==="closing",zt=P>0?Math.max(0,1-P/500):1,At=P>0?Math.max(.35,1-P/500):1,xt=a.useCallback(p=>{p.propertyName!=="transform"||!G.current||(z(),Z(!1))},[z,Z]),Gt=St?`translateX(${Rt}px)`:P>0?`translateY(${P}px)`:void 0,Tt={position:"fixed",top:h==null?void 0:h.top,left:h==null?void 0:h.left,width:h==null?void 0:h.width,height:h==null?void 0:h.height,objectFit:r==="cover"?"cover":"contain",transform:Gt,opacity:P>0?At:b==="opening"||Mt?0:1,transition:nt&&!C?"none":C?`transform ${it}ms ${ft}`:y?`transform ${it}ms ${ft}, opacity ${it}ms ${ft}`:b==="opening"||Mt?`opacity ${it}ms ${ft}`:"none",pointerEvents:"none",zIndex:9998},ut=kt&&$&>.getEmbedPlayback($).controls&&h?Math.min(52,h.height*.2):0,st=h?{position:"fixed",top:h.top,height:h.height-ut,width:h.width/2,zIndex:9999}:null;return n.jsxs("div",{className:[`${t}-lightbox`,l?`${t}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:b==="open"?"none":void 0},onClick:Et,children:[n.jsx("div",{style:{position:"absolute",inset:0,background:D,opacity:ht?zt:0,transition:nt?"none":`opacity ${it}ms ${ft}`,pointerEvents:"none"}}),n.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:at?n.jsxs(n.Fragment,{children:[n.jsx("div",{ref:M,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:ht?1:0,transition:`opacity ${it}ms ${ft}`,pointerEvents:"none",zIndex:9999},children:e.length>1&&n.jsxs("p",{className:d,style:m,children:[o+1," / ",e.length]})})]}):n.jsxs(n.Fragment,{children:[n.jsx("div",{style:{height:"10%"}}),n.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:n.jsx("div",{ref:M,style:{width:"100%",height:"100%"}})}),n.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ht?1:0,transition:`opacity ${it}ms ${ft}`},children:e.length>1&&n.jsxs("p",{className:d,style:m,children:[o+1," / ",e.length]})})]})}),h&&$&&(kt?n.jsx(gt.EmbedMediaFrame,{media:$,fit:r==="cover"?"cover":"contain",lazy:!1,startsAtOnce:!0,style:Tt,onTransitionEnd:xt},`${o}-${$.assetId}`):Bt?n.jsx(fn,{src:$.assetId,mediaRef:V,mediaStyle:Tt,onLoadedMetadata:dt,onTransitionEnd:xt},`${o}-${$.assetId}`):n.jsx("img",{ref:V,src:$.assetId,alt:$.name,onLoad:dt,onTransitionEnd:xt,style:Tt},`${o}-${$.assetId}`)),ht&&st&&e.length>1&&n.jsxs(n.Fragment,{children:[n.jsx("div",{style:{...st,left:h.left,cursor:"w-resize",pointerEvents:St?"none":"auto"},onClick:p=>{if(B.current){B.current=!1;return}p.stopPropagation(),s()}}),n.jsx("div",{style:{...st,left:h.left+h.width/2,cursor:"e-resize",pointerEvents:St?"none":"auto"},onClick:p=>{if(B.current){B.current=!1;return}p.stopPropagation(),u()}})]}),n.jsx(xn,{prefix:t,closeIcon:L,closeIconMaxWidth:U,closeIconColor:I,closeIconHoverColor:R,iconMarginRight:H,contentMarginTop:Q,isEditor:l,isPreviewMode:c,isEditMode:i,visible:ht,onClose:Et})]})}function ye({P:t,media:e,imgWidth:o,cornerRadius:r,fillGalleryWidth:l,imageDisplay:c,isEditor:i,galleryPaddingBetween:f=0,showPaddingAfter:s=!1,showControls:u=!1,hasLightbox:d,onMediaClick:m}){const D=`${t}-gallery-${ne(e)?"video":"image"}`,L=c.display==="cover",U=un(c),I=x=>lt.scalingValue(x,i??!1),R=o??wt,H=l?{width:"100%",maxWidth:"100%"}:{width:I(R),maxWidth:"100%"},Q=r?{borderRadius:I(r)}:{},at={...H,...L?{aspectRatio:U,height:"auto",overflow:"hidden"}:{},...Q},M={...L?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:l?"100%":I(R)},...m?{cursor:"pointer",pointerEvents:"auto"}:{},...L?{}:Q},S={className:D,style:M,onClick:m?x=>{x.stopPropagation(),m()}:void 0},w=Math.max(f,rt),g=gt.isEmbedMedia(e)?n.jsx(gt.EmbedMediaFrame,{...S,media:e,fit:L?"cover":"contain",silentLoop:d}):ne(e)?n.jsx(Ke.LazyVideo,{...S,src:e.assetId,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):n.jsx("img",{...S,src:e.assetId,alt:e.name??""});return n.jsxs("div",{className:`${t}-gallery-item`,children:[L?n.jsx("div",{style:at,children:g}):g,s&&f>0&&n.jsx("div",{className:`${t}-padding-handle`,style:{height:I(f)},"aria-hidden":"true"}),u&&s&&n.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${t}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:I(w)}})]})}function vn({P:t,layoutType:e,galleryWidthStyle:o,galleryPaddingRight:r,galleryPaddingLeft:l,galleryPaddingRightWidth:c,galleryPaddingLeftWidth:i,galleryPaddingMaxFraction:f,showControls:s,scaled:u,children:d}){const m=e==="a"?r:e==="c"?l:0,D=m>0||s;return n.jsxs("div",{className:`${t}-gallery-controls`,children:[e==="c"&&D&&n.jsx("div",{className:`${t}-gallery-edge-spacer`,style:{width:u(m)},"aria-hidden":"true"}),s&&e==="c"&&n.jsx("div",{"data-controls":"galleryPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(f),className:`${t}-control-anchor`,style:{top:0,left:0,width:u(i),height:"100%"}}),n.jsx("div",{className:`${t}-gallery`,style:o,children:d}),e==="a"&&D&&n.jsx("div",{className:`${t}-gallery-edge-spacer`,style:{width:u(m)},"aria-hidden":"true"}),s&&e==="a"&&n.jsx("div",{"data-controls":"galleryPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(f),className:`${t}-control-anchor`,style:{top:0,right:0,width:u(c),height:"100%"}})]})}function $n(t){switch(t){case"fade":case"retype":case"scroll":return t;case"default":return"scroll";default:return"scroll"}}function Vt({P:t,controlKey:e,scaled:o,height:r,paired:l,side:c}){return n.jsx("div",{"data-controls":e,...l?{"data-controls-paired":""}:{},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${t}-control-anchor`,style:{...c==="top"?{top:0}:{bottom:0},left:0,width:"100%",height:o(r)}})}function ve({P:t,controlKey:e,scaled:o,width:r,maxFraction:l,side:c,paired:i,anchorStyle:f}){return n.jsx("div",{"data-controls":e,...i?{"data-controls-paired":""}:{},"data-controls-axis":"x","data-controls-variant":"column-padding",...c==="right"?{"data-controls-reverse":""}:{},"data-controls-min":"0","data-controls-max-fraction":String(l),className:`${t}-control-anchor`,style:{top:0,...c==="left"?{left:0}:{right:0},width:o(r),height:"100%",...f}})}function ee({P:t,title:e,description:o,position:r,titleRef:l,titleClassName:c,titleContainerStyle:i,titleTextBoxStyle:f,titleStyle:s,descriptionClassName:u,descriptionStyle:d,descriptionPadding:m,showTextBoxOutline:D=!1,showDescriptionPaddingControl:L=!1,descriptionPaddingPaired:U=!1,topPaddingControl:I,bottomPaddingControl:R}){const H=a.useRef(null),[Q,at]=a.useState(0),M=e??"",V=o??"",S=V.length>0,{horizontal:w,vertical:g}=oe(r),x=g==="center"||g==="bottom",_=g==="bottom";a.useLayoutEffect(()=>{if(!x)return;const h=H.current;if(!h||typeof ResizeObserver>"u")return;const O=()=>at(h.offsetHeight);O();const b=new ResizeObserver(O);return b.observe(h),()=>b.disconnect()},[M,V,x]);const B=n.jsx("span",{className:`${t}-title-text`,style:s,children:M}),G=S?n.jsx("span",{className:u,style:d,children:V}):null,X=S?n.jsx("div",{className:`${t}-title-texts-gap`,style:{height:m},children:L&&n.jsx("div",{"data-controls":"titleDescriptionPadding",...U?{"data-controls-paired":""}:{},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${t}-control-anchor`,style:{top:0,left:0,width:"100%",height:"100%"}})}):null;return n.jsx("div",{ref:h=>{H.current=h,l(h)},className:[c,`${t}-title-h-${w}`,`${t}-title-v-${g}`].join(" "),style:{...x?{[`--${t}-title-height`]:`${Q}px`}:{},...i},children:n.jsxs("div",{className:`${t}-title-text-stack`,style:f,children:[I,n.jsx("div",{className:D?`${t}-title-text-inner`:`${t}-title-text-inner-hidden`,style:{width:"100%"},children:n.jsx("div",{className:`${t}-title-texts`,children:_?n.jsxs(n.Fragment,{children:[G,X,B]}):n.jsxs(n.Fragment,{children:[B,X,G]})})}),R]})})}const $e=45;function be(t,e,o){let r=t;for(;r;){const l=getComputedStyle(r).getPropertyValue(e).trim();if(l){const c=parseFloat(l);if(!Number.isNaN(c))return c}r=r.parentElement}return o}function bn(t){const e=be(t,"--cntrl-viewport-height",window.innerHeight),o=be(t,"--cntrl-article-top",0);return{top:o,height:e,centerY:o+e/2}}function wn(t,e,o){const{vertical:r}=oe(e),{top:l,height:c,centerY:i}=bn(o);if(r==="top"){const s=o&&parseFloat(getComputedStyle(o).top)||l;return Math.abs(t.top-s)}if(r==="bottom")return Math.abs(t.bottom-(l+c));const f=t.top+t.height/2;return Math.abs(f-i)}function Sn(t,e,o){const r=Array.from({length:e},(i,f)=>{const s=t.current[f];if(!s)return 0;const u=s.getBoundingClientRect(),d=wn(u,o,s);return Math.exp(-(d*d)/(2*$e*$e))});let l=0,c=-1;return r.forEach((i,f)=>{i>c&&(c=i,l=f)}),{opacities:r,dominantIndex:l}}function Cn(t,e,o){const r=a.useRef([]),[{opacities:l,dominantIndex:c},i]=a.useState(()=>({opacities:Array.from({length:t},(s,u)=>u===0?1:0),dominantIndex:0}));return a.useLayoutEffect(()=>{if(!e||t===0){i({opacities:Array.from({length:t},()=>1),dominantIndex:0});return}let s=0;const u=()=>{i(Sn(r,t,o))},d=()=>{s||(s=window.requestAnimationFrame(()=>{s=0,u()}))};return u(),window.addEventListener("scroll",d,{passive:!0}),window.addEventListener("resize",d,{passive:!0}),()=>{s&&window.cancelAnimationFrame(s),window.removeEventListener("scroll",d),window.removeEventListener("resize",d)}},[e,t,o]),{setTitleRef:s=>u=>{r.current[s]=u},opacities:l,dominantIndex:c}}function we(t,e){const[o,r]=a.useState(t),l=a.useRef(t);return a.useEffect(()=>{if(!e){l.current=t,r(t);return}const c=Array.from(l.current),i=Array.from(t),f=Math.max(c.length,i.length);if(f===0||l.current===t)return;let s=0;const u=window.setInterval(()=>{s+=1;const d=[...i.slice(0,s),...c.slice(s)].join("");l.current=d,r(d),s>=f&&window.clearInterval(u)},70);return()=>window.clearInterval(u)},[e,t]),o}function Tn({settings:t,content:e,isEditor:o,isPreviewMode:r,isEditMode:l,portalId:c}){var fe,ge;const{prefix:i}=Ge.useScopedStyles(),f=a.useMemo(()=>Ye(i),[i]),s=e??[],u=(t==null?void 0:t.wrapperWidth)??1,d=(t==null?void 0:t.type)??"a",m=(t==null?void 0:t.imgWidth)??wt,D=(t==null?void 0:t.titleWidth)??dn,L=hn(t==null?void 0:t.imageDisplay),U=(t==null?void 0:t.cornerRadius)??Ue,I=Je(t==null?void 0:t.position),{horizontal:R,vertical:H}=oe(I),Q=(t==null?void 0:t.titleTopPadding)??0,at=(t==null?void 0:t.titleBottomPadding)??0,M=(t==null?void 0:t.titleLeftPadding)??0,V=(t==null?void 0:t.titleRightPadding)??0,S=(t==null?void 0:t.titleDescriptionPadding)??0,w=$n(t==null?void 0:t.transition),g=(t==null?void 0:t.lightbox)??"on",x=d==="b",_=w==="fade"||w==="retype",{setTitleRef:B,dominantIndex:G}=Cn(s.length,_,I),X=((fe=s[G])==null?void 0:fe.title)??"",h=((ge=s[G])==null?void 0:ge.description)??"",O=we(X,w==="retype"),b=we(h,w==="retype"),N=w==="fade"||w==="retype",P=w==="retype"?O:X,mt=w==="retype"?b:h,Rt=x?void 0:{width:lt.scalingValue(m,o??!1)},tt=g==="on"&&(!o||r||l),C=l??!1,et=(t==null?void 0:t.galleryPaddingRight)??0,nt=(t==null?void 0:t.galleryPaddingLeft)??0,Y=(t==null?void 0:t.galleryPaddingBetween)??0,y=j=>lt.scalingValue(j,o??!1),Nt={width:y(D)},$=d==="a"?et:nt,Bt=x?{width:"100%"}:{width:`calc(100% - ${y(m)} - ${y($)})`,...d==="c"?{marginLeft:"auto"}:{}},kt=Math.max(et,rt),St=Math.max(nt,rt),Z=Math.max(Y,rt),z=Math.max(Q,rt),Ct=Math.max(at,rt),dt=Math.max(M,rt),Et=Math.max(V,rt),ht=Math.max(S,rt),Mt=Math.max(0,(u??1)-(m??wt)),zt=d==="a"?Math.max(0,(u??1)-(m??wt)-et):d==="c"?Math.max(0,(u??1)-(m??wt)-nt):d==="b"?u??1:1,At=C&&H==="top",xt=C&&H==="bottom",Gt=C&&R==="left",Tt=C&&R==="right",ut=s.length>1,st=x?void 0:y((d==="c"?nt:et)+(m??wt)),p=d==="c"&&st?{left:st}:void 0,k=d==="a"&&st?{right:st}:void 0,A=x?{left:0,width:"100%"}:d==="a"?{right:y(et),width:y(m)}:{left:y(nt),width:y(m)},{titleColor:q,titleFontFamily:K,titleFontSettings:E,titleFontSize:ct,titleLineHeight:T,titleLetterSpacing:v,titleWordSpacing:F,titleAlign:pt,titleTextAppearance:J,descriptionColor:ie,descriptionFontFamily:Ce,descriptionFontSettings:yt,descriptionFontSize:qt,descriptionLineHeight:Kt,descriptionLetterSpacing:Te,descriptionWordSpacing:Ie,descriptionAlign:je,descriptionTextAppearance:Le,lightboxCounterColor:re,lightboxCounterFontFamily:Re,lightboxCounterFontSettings:vt,lightboxCounterFontSize:Ut,lightboxCounterLineHeight:Xt,lightboxCounterLetterSpacing:Ne,lightboxCounterWordSpacing:ke,lightboxCounterTextAppearance:Ee}=t??{},Me={fontSettings:{fontFamily:K,fontWeight:(E==null?void 0:E.fontWeight)??400,fontStyle:(E==null?void 0:E.fontStyle)??"normal"},fontSize:ct??.01,lineHeight:T,letterSpacing:v??0,wordSpacing:F??0,textAlign:pt??"left",textAppearance:J,color:q??"#000000"},le=bt.omitTextColors(bt.textStylesToCss(Me,o)),ae=Nt,se={...te(ct,T,i,o),...te(qt,Kt,i,o,"description-leading-gap")},ce=Pt(ct,T,`${i}-title`,`${i}-text-tight-leading`),ze={fontSettings:{fontFamily:Ce,fontWeight:(yt==null?void 0:yt.fontWeight)??400,fontStyle:(yt==null?void 0:yt.fontStyle)??"normal"},fontSize:qt??.01,lineHeight:Kt,letterSpacing:Te??0,wordSpacing:Ie??0,textAlign:je??"left",textAppearance:Le,color:ie??"#000000"},de=bt.omitTextColors(bt.textStylesToCss(ze,o)),he=Pt(qt,Kt,`${i}-description-text`,`${i}-description-tight-leading`),ue=y(C?ht:S),Ae={fontSettings:{fontFamily:Re,fontWeight:(vt==null?void 0:vt.fontWeight)??400,fontStyle:(vt==null?void 0:vt.fontStyle)??"normal"},fontSize:Ut??.01,lineHeight:Xt,letterSpacing:Ne??0,wordSpacing:ke??0,textAppearance:Ee,color:re??"#DEDDDD"},De={...bt.omitTextColors(bt.textStylesToCss(Ae,o)),...te(Ut,Xt,i,o)},Fe=Pt(Ut,Xt,`${i}-lightbox-counter`,`${i}-text-tight-leading`),Yt=Be.buildColorVars(i,{titleColor:q??"#000000",descriptionColor:ie??"#000000",lightboxCounterColor:re??"#DEDDDD"},en,nn),Zt=a.useRef(null),[Dt,Ft]=a.useState(!1),[Wt,We]=a.useState([]),[Oe,Jt]=a.useState(0),pe=a.useCallback((j,W)=>{tt&&(We(j),Jt(W),Ft(!0))},[tt]),He=a.useCallback(()=>{Ft(!1)},[]),Ve=a.useMemo(()=>{const j={...Yt},W=Zt.current?getComputedStyle(Zt.current).getPropertyValue("--cntrl-article-width").trim():"";return W&&(j["--cntrl-article-width"]=W),j},[Yt,Dt]);return a.useEffect(()=>{if(!Dt||g!=="on"||typeof document>"u")return;const j=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=j}},[Dt,g]),a.useEffect(()=>{!o||l||r||Ft(!1)},[o,l,r]),a.useEffect(()=>{g==="off"&&Ft(!1)},[g]),n.jsxs(n.Fragment,{children:[n.jsx("style",{dangerouslySetInnerHTML:{__html:f}}),n.jsx("div",{style:Yt,children:n.jsxs("div",{ref:Zt,className:`${i}-wrapper`,style:{width:lt.scalingValue(u,o??!1),[`--${i}-title-top-padding`]:H==="top"?y(Q):void 0,[`--${i}-title-bottom-padding`]:H==="bottom"?y(at):void 0,[`--${i}-title-left-padding`]:R==="left"?y(M):void 0,[`--${i}-title-right-padding`]:R==="right"?y(V):void 0},children:[N&&n.jsx("div",{className:`${i}-single-title-layer`,children:n.jsx(ee,{P:i,title:P,description:mt,position:I,titleRef:()=>{},titleClassName:`${ce} ${i}-single-title`,titleContainerStyle:{...se,...Bt},titleTextBoxStyle:ae,titleStyle:le,descriptionClassName:he,descriptionStyle:de,descriptionPadding:ue,showTextBoxOutline:C,showDescriptionPaddingControl:C,topPaddingControl:At?Vt({P:i,controlKey:"titleTopPadding",scaled:y,height:z,paired:!1,side:"top"}):void 0,bottomPaddingControl:xt?Vt({P:i,controlKey:"titleBottomPadding",scaled:y,height:Ct,paired:!1,side:"bottom"}):void 0})}),s.map((j,W)=>{const $t=an(j.gallery),me=W<s.length-1,Ot=$t.filter(ot=>ot.lightboxMedia).map(ot=>ot.lightboxMedia),xe={P:i,position:I,titleRef:B(W),titleClassName:ce,titleContainerStyle:se,titleTextBoxStyle:N?{maxWidth:"100%"}:ae,titleStyle:le,descriptionClassName:he,descriptionStyle:de,descriptionPadding:ue,showTextBoxOutline:C&&!N,showDescriptionPaddingControl:C&&!N,descriptionPaddingPaired:ut,topPaddingControl:At&&!N?Vt({P:i,controlKey:"titleTopPadding",scaled:y,height:z,paired:ut,side:"top"}):void 0,bottomPaddingControl:xt&&!N?Vt({P:i,controlKey:"titleBottomPadding",scaled:y,height:Ct,paired:ut,side:"bottom"}):void 0};return n.jsxs("div",{"data-item-index":W,className:`${i}-item ${i}-item-${d}`,style:{paddingBottom:me?y(Y):void 0},children:[Gt&&ve({P:i,controlKey:"titleLeftPadding",scaled:y,width:dt,maxFraction:zt,side:"left",paired:ut,anchorStyle:p}),Tt&&ve({P:i,controlKey:"titleRightPadding",scaled:y,width:Et,maxFraction:zt,side:"right",paired:ut,anchorStyle:k}),C&&me&&n.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${i}-control-anchor`,style:{bottom:0,height:y(Z),...A}}),x?n.jsxs("div",{className:`${i}-gallery`,children:[n.jsx("div",{className:`${i}-gallery-media`,children:$t.map(({displayMedia:ot,lightboxMedia:It},jt)=>{const Lt=It?Ot.findIndex(Qt=>Qt.assetId===It.assetId):-1;return n.jsx(ye,{P:i,media:ot,imgWidth:m||void 0,cornerRadius:U||void 0,imageDisplay:L,isEditor:o,galleryPaddingBetween:Y,showPaddingAfter:jt<$t.length-1,showControls:C,hasLightbox:g==="on",onMediaClick:tt&&Lt>=0?()=>pe(Ot,Lt):void 0},`${ot.assetId}-${jt}`)})}),n.jsx("div",{className:`${i}-title-layer`,children:n.jsx(ee,{...xe,title:N?"":j.title,description:N?"":j.description})})]}):n.jsxs(n.Fragment,{children:[n.jsx(ee,{...xe,title:N?"":j.title,description:N?"":j.description}),$t.length>0&&n.jsx(vn,{P:i,layoutType:d,galleryWidthStyle:Rt,galleryPaddingRight:et,galleryPaddingLeft:nt,galleryPaddingRightWidth:kt,galleryPaddingLeftWidth:St,galleryPaddingMaxFraction:Mt,showControls:C,scaled:y,children:$t.map(({displayMedia:ot,lightboxMedia:It},jt)=>{const Lt=It?Ot.findIndex(Qt=>Qt.assetId===It.assetId):-1;return n.jsx(ye,{P:i,media:ot,cornerRadius:U||void 0,fillGalleryWidth:!0,imageDisplay:L,isEditor:o,galleryPaddingBetween:Y,showPaddingAfter:jt<$t.length-1,showControls:C,hasLightbox:g==="on",onMediaClick:tt&&Lt>=0?()=>pe(Ot,Lt):void 0},`${ot.assetId}-${jt}`)})})]})]},W)})]})}),Dt&&g==="on"&&typeof document<"u"&&t&&(()=>{const j=(c?document.getElementById(c):null)??document.body;return _e.createPortal(n.jsx("div",{style:Ve,"data-selection":"none",children:n.jsx(yn,{prefix:i,items:Wt,index:Oe,imageDisplay:pn(t.lightboxImageDisplay),isEditor:o,isPreviewMode:r,isEditMode:l,closeIcon:t.closeIcon,closeIconMaxWidth:t.closeIconMaxWidth,closeIconColor:t.closeIconColor,closeIconHoverColor:t.closeIconHoverColor,iconMarginRight:t.iconMarginRight,contentMarginTop:t.contentMarginTop,onClose:He,onPrev:()=>Jt(W=>(W-1+Wt.length)%Wt.length),onNext:()=>Jt(W=>(W+1)%Wt.length),counterClassName:Fe,counterStyle:De,backgroundColor:t.backgroundColor??Qe})}),j)})()]})}exports.Mercury=Tn;
|