@cntrl-site/components 1.0.33-alpha.1 → 1.0.33-alpha.2

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/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * Version : 4.1.3
4
4
  * License : MIT
5
5
  * Copyright: 2022 Naotoshi Fujita
6
- */const dd="RichTextRenderer-module__link___BWeZ2",ud={link:dd},pd=e=>{const t=e.trim();return!t||t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?!1:t.split(/\s+/g).filter(Boolean).some(i=>/^\d/.test(i))},qo=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>pd(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function qt(e){const{color:t,...n}=e;return n}function At(e,t){var o,s,a;const{fontSize:n,lineHeight:i}=e;return{fontFamily:qo(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:P.scalingValue(e.letterSpacing,t),wordSpacing:P.scalingValue(e.wordSpacing,t),fontSize:P.scalingValue(n,t),lineHeight:i!==void 0?P.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(s=e.textAppearance)==null?void 0:s.textDecoration,fontVariant:(a=e.textAppearance)==null?void 0:a.fontVariant,textAlign:e.textAlign,color:e.color}}const ui=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?r.jsx("a",{className:ud.link,href:i.value,target:i.target,children:t(i.children)},o):r.jsx("span",{style:md(i),children:i.text},o));return r.jsx(r.Fragment,{children:e.map((n,i)=>{const o=n.children;return r.jsx("div",{children:t(o)},i)})})};function md(e){return{...e.fontFamily&&{fontFamily:qo(e.fontFamily)},...e.fontWeight&&{fontWeight:e.fontWeight},...e.fontStyle&&{fontStyle:e.fontStyle},...e.textDecoration&&{textDecoration:e.textDecoration},...e.textTransform&&{textTransform:e.textTransform},...e.fontVariant&&{fontVariant:e.fontVariant},...e.verticalAlign&&{verticalAlign:e.verticalAlign,lineHeight:"0px"}}}const gd="SvgImage-module__svg___q3xE-",hd="SvgImage-module__img___VsTm-",xa={svg:gd,img:hd},fd=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},yd=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,Qt=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[s,a]=l.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return l.useEffect(()=>{if(typeof window<"u"&&window.CSS){const u=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');a(u)}},[]),!fd(e)||!s?r.jsx("img",{src:e,alt:"",className:ze(xa.img,i),style:o}):r.jsx("span",{"data-supports-mask":s,className:ze(xa.svg,i),style:{"--svg":yd(e),"--fill":t,"--hover-fill":n,...o??{}}})},vd={"top-left":Pe.topLeftAlignment,"top-center":Pe.topCenterAlignment,"top-right":Pe.topRightAlignment,"middle-left":Pe.middleLeftAlignment,"middle-center":Pe.middleCenterAlignment,"middle-right":Pe.middleRightAlignment,"bottom-left":Pe.bottomLeftAlignment,"bottom-center":Pe.bottomCenterAlignment,"bottom-right":Pe.bottomRightAlignment};function bd({settings:e,content:t,styles:n,isEditor:i}){const[o,s]=l.useState(null),{widthSettings:a,fontSettings:u,letterSpacing:c,textAlign:m,wordSpacing:p,fontSizeLineHeight:b,textAppearance:w,color:S}=n.imageCaption??{},[g,v]=l.useState(void 0),[T,$]=l.useState(null),[C,L]=l.useState(0),[A,k]=l.useState(0),{direction:F,transition:I,controls:E,pagination:J,imageCaption:y,triggers:_}=e,W=l.useRef(I.type),{x:G,y:te}=e.controls.offset,ue=X=>{o&&o.go(X)};return l.useEffect(()=>{if(!T)return;const X=new ResizeObserver(H=>{if(!o)return;const[Q]=H;v({width:Math.round(Q.contentRect.width),height:Math.round(Q.contentRect.height)})});return X.observe(T),()=>X.unobserve(T)},[T]),l.useEffect(()=>{!o||W.current===I.type||(k(X=>X+1),W.current=I.type)},[I.type]),r.jsx("div",{className:ze(Pe.wrapper,{[Pe.editor]:i}),ref:$,children:r.jsxs("div",{className:Pe.sliderInner,style:{width:g?g.width:"100%",height:g?g.height:"100%",backgroundColor:I.backgroundColor&&I.type==="fade in"?I.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&r.jsx("div",{className:ze(Pe.captionBlock),children:r.jsx("div",{className:Pe.captionTextWrapper,children:t.map((X,H)=>r.jsx("div",{className:ze(Pe.captionText,vd[y.alignment],{[Pe.withPointerEvents]:H===C&&i,[Pe.active]:H===C}),style:{fontFamily:qo(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:a.sizing==="auto"?"max-content":P.scalingValue(a.width,i),letterSpacing:P.scalingValue(c,i),wordSpacing:P.scalingValue(p,i),textAlign:m,fontSize:P.scalingValue(b.fontSize,i),lineHeight:P.scalingValue(b.lineHeight,i),textTransform:w.textTransform??"none",textDecoration:w.textDecoration??"none",fontVariant:w.fontVariant??"normal",color:S,transitionDuration:I.duration?`${Math.round(parseInt(I.duration)/2)}ms`:"500ms"},children:r.jsx("div",{"data-styles":"imageCaption",className:Pe.captionTextInner,style:{"--link-hover-color":y.linkHoverColor,"--link-color":y.linkColor,position:"relative",top:P.scalingValue(y.offset.y,i),left:P.scalingValue(y.offset.x,i)},children:r.jsx(ui,{content:X.imageCaption})})},H))})}),r.jsx(Yr,{onMove:X=>{L(X.index)},ref:s,options:{arrows:!1,speed:I.duration?parseInt(I.duration):500,autoplay:_.autoPlay!==null,..._.autoPlay!==null&&{interval:parseInt(_.autoPlay)*1e3},direction:F==="horiz"||I.type==="fade in"?"ltr":"ttb",pagination:!1,drag:_.triggersList.drag,perPage:1,width:g?g.width:"100%",height:g?g.height:"100%",type:I.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((X,H)=>r.jsx(Jr,{children:r.jsx("div",{className:Pe.sliderItem,children:r.jsx("div",{className:Pe.imgWrapper,children:r.jsx("img",{className:ze(Pe.sliderImage,{[Pe.contain]:X.image.objectFit==="contain",[Pe.cover]:X.image.objectFit==="cover"}),src:X.image.url,alt:X.image.name??""})})})},H))},A),E.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:ze(Pe.arrow,{[Pe.arrowVertical]:F==="vert",[Pe.hoverArrow]:E.show==="on hover"}),style:{color:E.color,"--arrow-hover-color":E.hover},children:r.jsxs("button",{onClick:()=>{ue("-1")},className:Pe.arrowInner,style:{transform:`translate(${P.scalingValue(G,i)}, ${P.scalingValue(te*(F==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${F==="horiz"?"0deg":"90deg"})`},children:[E.arrowsImgUrl&&r.jsx(Qt,{url:E.arrowsImgUrl,fill:E.color,hoverFill:E.hover,className:ze(Pe.arrowImg,Pe.mirror)}),!E.arrowsImgUrl&&r.jsx(wa,{color:E.color,className:ze(Pe.arrowIcon,Pe.arrowImg,Pe.mirror)})]})}),r.jsx("div",{className:ze(Pe.arrow,Pe.nextArrow,{[Pe.arrowVertical]:F==="vert",[Pe.hoverArrow]:E.show==="on hover"}),style:{color:E.color,"--arrow-hover-color":E.hover},children:r.jsxs("button",{className:Pe.arrowInner,onClick:()=>ue("+1"),style:{transform:`translate(${P.scalingValue(G*(F==="horiz"?-1:1),i)}, ${P.scalingValue(te,i)}) scale(${e.controls.scale/100}) rotate(${F==="horiz"?"0deg":"90deg"})`},children:[E.arrowsImgUrl&&r.jsx(Qt,{url:E.arrowsImgUrl,fill:E.color,hoverFill:E.hover,className:Pe.arrowImg}),!E.arrowsImgUrl&&r.jsx(wa,{color:E.color,className:ze(Pe.arrowIcon,Pe.arrowImg)})]})})]}),_.triggersList.click&&r.jsx("div",{className:Pe.clickOverlay,onClick:()=>{o&&o.go("+1")}}),J.isActive&&r.jsx("div",{className:ze(Pe.pagination,{[Pe.paginationInsideBottom]:J.position==="inside-1"&&F==="horiz",[Pe.paginationInsideTop]:J.position==="inside-2"&&F==="horiz",[Pe.paginationOutsideBottom]:J.position==="outside-1"&&F==="horiz",[Pe.paginationOutsideTop]:J.position==="outside-2"&&F==="horiz",[Pe.paginationInsideLeft]:J.position==="inside-1"&&F==="vert",[Pe.paginationInsideRight]:J.position==="inside-2"&&F==="vert",[Pe.paginationOutsideLeft]:J.position==="outside-1"&&F==="vert",[Pe.paginationOutsideRight]:J.position==="outside-2"&&F==="vert",[Pe.paginationVertical]:F==="vert"}),children:r.jsx("div",{className:Pe.paginationInner,style:{backgroundColor:J.colors[2],transform:`scale(${J.scale/100}) translate(${P.scalingValue(J.offset.x,i)}, ${P.scalingValue(J.offset.y,i)}) rotate(${F==="horiz"?"0deg":"90deg"})`},children:t.map((X,H)=>r.jsx("button",{onClick:()=>{o&&o.go(H)},className:ze(Pe.paginationItem),children:r.jsx("div",{className:ze(Pe.dot,{[Pe.activeDot]:H===C}),style:{backgroundColor:H===C?J.colors[0]:J.colors[1],"--pagination-hover-color":J.hover}})},H))})})]})})}function wa({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.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:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const xd={element:bd,id:"control-slider",name:"Slider",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Slider.mp4"},defaultSize:{d:{width:400,height:400},t:{width:400,height:400},m:{width:300,height:300}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.arrowsImgUrl"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{triggers:{title:"triggers",icon:"target",tooltip:"Triggers",type:"object",properties:{triggersList:{type:"object",display:{type:"toggle-ratio-group"},properties:{click:{type:"boolean"},drag:{type:"boolean"}}},autoPlay:{type:["string","null"],label:"Auto",display:{type:"step-selector"},enum:[null,"1s","2s","3s","4s","5s"]}}},direction:{icon:"horizontal-resize",tooltip:"Direction",type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},transition:{title:"transit",icon:"transition",tooltip:"Transition",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade in"]},backgroundColor:{type:["string","null"],title:"BG Color",display:{visible:!1,type:"settings-color-picker",format:"single"}},duration:{type:"string",label:"icon:hourglass",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},controls:{title:"controls",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:50,max:600,display:{type:"range-control"}},color:{title:"color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}},show:{title:"Show",type:"string",display:{type:"ratio-group"},enum:["always","on hover"]}}},pagination:{title:"nav",icon:"pagination",tooltip:"Navigation",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"socket",direction:"horizontal"},type:"string",enum:["outside-1","outside-2","inside-1","inside-2"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:10,max:400,display:{type:"range-control"}},colors:{display:{type:"settings-color-picker",format:"multiple"},title:"color",type:"array",items:{type:"string"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},imageCaption:{title:"Caption",icon:"text-icon",tooltip:"Caption",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}},default:{triggers:{triggersList:{click:!1,drag:!0},autoPlay:null},controls:{isActive:!0,arrowsImgUrl:null,offset:{x:0,y:0},scale:100,color:"#000000",hover:"#cccccc",show:"always"},transition:{type:"slide",duration:"500ms",backgroundColor:null},pagination:{isActive:!0,scale:50,position:"inside-1",offset:{x:0,y:0},colors:["#cccccc","#cccccc","#000000"],hover:"#cccccc"},direction:"horiz",imageCaption:{offset:{x:0,y:0},isActive:!0,alignment:"middle-center",linkColor:"#cccccc",linkHoverColor:"#cccccc"}},displayRules:[{if:{name:"direction",value:"vert"},then:{name:"properties.pagination.properties.position.display.direction",value:"vertical"}},{if:{name:"transition.type",value:"fade in"},then:{name:"properties.transition.properties.backgroundColor.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{placeholder:"Add Caption...",label:"Description",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-1.png",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-2.png",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-3.png",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}},wd="ImageRevealSlider-module__imageRevealSlider___UE5Ob",$d="ImageRevealSlider-module__image___Qjt-e",Sd="ImageRevealSlider-module__link___N-iLG",Cd="ImageRevealSlider-module__cursor___2U03d",Qn={imageRevealSlider:wd,image:$d,link:Sd,cursor:Cd};function $a(e,t,n){for(const i of n){const o=new Image;o.src=i.url;const s=i.width?Number.parseFloat(i.width):o.naturalWidth,a=o.naturalHeight/o.naturalWidth*s,u=s/2,c=a/2;if(e>=i.x-u&&e<=i.x+u&&t>=i.y-c&&t<=i.y+c)return!0}return!1}function rr(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Td(e,t,n,i){let o,s;if(t==="custom"){o=n;const a=await rr(e);s=a.height/a.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const a=await rr(e);s=a.height/a.width*o}else{const a=await rr(e);o=a.width,s=a.height}return{width:o,height:s,finalWidth:`${o}px`}}function Ld({settings:e,content:t,isEditor:n}){const[i,o]=l.useState(null),[s,a]=l.useState([]),[u,c]=l.useState(0),m=l.useRef(0),[p,b]=l.useState({x:0,y:0}),[w,S]=l.useState(1),[g,v]=l.useState("none"),T=l.useRef({x:0,y:0}),[$,C]=l.useState(!1),{sizeType:L,imageWidth:A,randomRangeImageWidth:k}=e.imageSize,{revealPosition:F,visible:I}=e.position,{cursorType:E,target:J,defaultCursorScale:y,defaultCursor:_,hoverCursorScale:W,hoverCursor:G}=e.cursor;l.useEffect(()=>{if(!i)return;const X=(z,B)=>{const Y=i.getBoundingClientRect(),oe=z-Y.left,ie=B-Y.top;if(b({x:oe,y:ie}),E==="system"){v("none"),S(1);return}const O=oe,ce=ie,f=document.elementFromPoint(Y.left+O,Y.top+ce);if(f&&f.closest("a")){v("none"),S(1);return}const de=$a(O,ce,s)||J==="area"?{img:G??"none",scale:W}:{img:_??"none",scale:y};v(de.img),S(de.scale)},H=z=>{z.stopPropagation(),T.current={x:z.clientX,y:z.clientY},X(z.clientX,z.clientY)},Q=()=>{$&&X(T.current.x,T.current.y)};return i.addEventListener("mousemove",H),window.addEventListener("scroll",Q,!0),()=>{i.removeEventListener("mousemove",H),window.removeEventListener("scroll",Q,!0)}},[i,$,p,E,J,G,_,W,y,s]),l.useEffect(()=>{$||(v("none"),S(0))},[$]);const te=async(X,H,Q,z={})=>{const{width:B,height:Y,finalWidth:oe}=await Td(X.image.url,L,A,k);let ie=0,O=0;F==="same"?(ie=H/2,O=Q/2):(ie=z.x??Math.random()*H,O=z.y??Math.random()*Q);const ce=Math.min(Math.max(ie,B/2),H-B/2),f=Math.min(Math.max(O,Y/2),Q-Y/2);return{id:m.current++,url:X.image.url,link:X.link,name:X.image.name,x:ce,y:f,width:oe}};l.useEffect(()=>{if(!i||t.length===0)return;const X=i.getBoundingClientRect(),H=X.width,Q=X.height,z=[];(async()=>{const Y=t[0],oe=await te(Y,H,Q);z.push(oe),a(z),c(1)})()},[L,A,k,F,i]),l.useEffect(()=>{I==="last One"&&a(X=>X.length>0?[X[X.length-1]]:[])},[I]);const ue=async X=>{if(!i)return;const H=i.getBoundingClientRect(),Q=X.clientX-H.left,z=X.clientY-H.top;if(J==="image"&&!$a(Q,z,s))return;let B=0,Y=0;F==="on Click"?(B=Q,Y=z):F==="same"?(B=H.width/2,Y=H.height/2):(B=Math.random()*H.width,Y=Math.random()*H.height);const oe=t[u],ie=await te(oe,H.width,H.height,{x:B,y:Y});a(O=>I==="all"?[...O,ie]:[ie]),c(O=>O>=t.length-1?0:O+1)};return r.jsxs("div",{ref:o,onClick:ue,onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),className:Qn.imageRevealSlider,style:{cursor:g==="none"?"default":"none"},children:[s.map(X=>r.jsx("div",{className:Qn.wrapper,style:{top:`${X.y}px`,left:`${X.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:X.width??"auto",height:"auto",cursor:g==="none"?"default":"none"},children:J==="area"&&X.link?r.jsx("a",{href:X.link,target:"_blank",className:Qn.link,children:r.jsx("img",{src:X.url,alt:X.name,className:Qn.image},X.id)}):r.jsx("img",{src:X.url,alt:X.name,className:Qn.image},X.id)},X.id)),$&&r.jsx("div",{className:Qn.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${w})`,backgroundImage:`url('${g}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const Ed={element:Ld,id:"control-image-reveal",name:"Click Gallery",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Click_Gallery.mp4"},defaultSize:{d:{width:"100%",height:"100%"},t:{width:"100%",height:"100%"},m:{width:"100%",height:"100%"}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.cursor.defaultCursor"},{path:"settings.cursor.hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{imageSize:{title:"IMG SIZE",icon:"size",tooltip:"IMG SIZE",type:"object",properties:{sizeType:{type:"string",display:{type:"ratio-group"},enum:["as Is","custom","random"]},imageWidth:{type:"number",label:"W",display:{type:"numeric-input",visible:!1}},randomRangeImageWidth:{type:"object",display:{type:"random-range-controls",visible:!1},properties:{min:{type:"number"},max:{type:"number"}}}}},cursor:{title:"cursor",icon:"cursor",tooltip:"cursor",type:"object",properties:{cursorType:{type:"string",display:{type:"ratio-group"},enum:["system","custom"]},target:{type:"string",title:"Target",display:{type:"ratio-group"},enum:["area","image"]},defaultCursor:{type:["string","null"],title:"Default",display:{type:"settings-image-input",visible:!1}},defaultCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}},hoverCursor:{type:["string","null"],title:"Hover",display:{type:"settings-image-input",visible:!1}},hoverCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}}}},position:{title:"position",icon:"transition",tooltip:"Position",type:"object",properties:{revealPosition:{type:"string",display:{type:"ratio-group"},enum:["random","same","on Click"]},visible:{type:"string",title:"Visible",display:{type:"ratio-group"},enum:["all","last One"]}}}},default:{imageSize:{sizeType:"custom",imageWidth:500,randomRangeImageWidth:{min:100,max:1e3}},cursor:{cursorType:"system",target:"area",defaultCursor:null,defaultCursorScale:2,hoverCursor:null,hoverCursorScale:2},position:{revealPosition:"random",visible:"all"}},displayRules:[{if:{name:"imageSize.sizeType",value:"custom"},then:{name:"properties.imageSize.properties.imageWidth.display.visible",value:!0}},{if:{name:"imageSize.sizeType",value:"random"},then:{name:"properties.imageSize.properties.randomRangeImageWidth.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"}],then:{name:"properties.cursor.properties.defaultCursor.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"},{name:"cursor.defaultCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.defaultCursorScale.display.visible",value:!0}},{if:{name:"cursor.cursorType",value:"custom"},then:{name:"properties.cursor.properties.hoverCursor.display.visible",value:!0}},{if:[{name:"cursor.cursorType",value:"custom"},{name:"cursor.hoverCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.hoverCursorScale.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQK9211QXBE9W284ZNKB8.png",name:"Slider-1.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQMFT72JD18WKP0Q2DVAT.png",name:"Slider-2.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQNEVRXPSRX5K1YTMJQY9.png",name:"Slider-3.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQP84JKRDT7WNWDQZR4Y9.png",name:"Slider-4.png"},link:""}]}}}},Id="LightBox-module__hidden___9s-9x",Pd="LightBox-module__heroImage___sTxNF",kd="LightBox-module__background___rm9ml",Rd="LightBox-module__editor___4ACaY",Ad="LightBox-module__contentStyle___Bgnsq",Md="LightBox-module__imageStyle___tLIlB",_d="LightBox-module__imgWrapper___LuFUp",Fd="LightBox-module__contain___8-yaS",Wd="LightBox-module__cover___hNvOG",Nd="LightBox-module__caption___b6L2I",Hd="LightBox-module__captionTextInner___rCGNH",Od="LightBox-module__lightboxSplide___XFuWC",Bd="LightBox-module__arrow___iz38X",jd="LightBox-module__arrowVertical___Zfz81",zd="LightBox-module__nextArrow___zkAQN",Vd="LightBox-module__arrowInner___p48sW",Dd="LightBox-module__arrowIcon___3VaFf",qd="LightBox-module__arrowImg___pNV88",Kd="LightBox-module__mirror___pjeXc",Gd="LightBox-module__thumbsWrapper___GB-nU",Ud="LightBox-module__thumbsContainerVertical___wttk5",Xd="LightBox-module__thumbsContainer___osSma",Yd="LightBox-module__thumbsAlignStart___MO6tY",Jd="LightBox-module__thumbsAlignCenter___Q4sUx",Zd="LightBox-module__thumbsAlignEnd___p4y9R",Qd="LightBox-module__thumbItem___HvnF3",eu="LightBox-module__closeButton___g2khP",tu="LightBox-module__fadeIn___0m5GW",nu="LightBox-module__slideInLeft___gPYwC",iu="LightBox-module__slideInRight___S-pPp",ou="LightBox-module__slideInTop___DFdAj",ru="LightBox-module__slideInBottom___m27kZ",au="LightBox-module__fadeOut___55qBR",su="LightBox-module__slideOutLeft___NvU7P",lu="LightBox-module__slideOutRight___SK7eC",cu="LightBox-module__slideOutTop___Vgg0z",du="LightBox-module__slideOutBottom___nJ0Ef",uu="LightBox-module__scaleSlide___vZriG",ve={hidden:Id,heroImage:Pd,background:kd,editor:Rd,contentStyle:Ad,imageStyle:Md,imgWrapper:_d,contain:Fd,cover:Wd,caption:Nd,captionTextInner:Hd,lightboxSplide:Od,arrow:Bd,arrowVertical:jd,nextArrow:zd,arrowInner:Vd,arrowIcon:Dd,arrowImg:qd,mirror:Kd,thumbsWrapper:Gd,thumbsContainerVertical:Ud,thumbsContainer:Xd,thumbsAlignStart:Yd,thumbsAlignCenter:Jd,thumbsAlignEnd:Zd,thumbItem:Qd,closeButton:eu,fadeIn:tu,slideInLeft:nu,slideInRight:iu,slideInTop:ou,slideInBottom:ru,fadeOut:au,slideOutLeft:su,slideOutRight:lu,slideOutTop:cu,slideOutBottom:du,scaleSlide:uu},io=(e,t,n)=>{const i={},[o,s]=e.split("-");return o==="top"?(i.top="0",i.bottom="auto"):o==="middle"?(i.top="50%",i.bottom="auto"):o==="bottom"&&(i.top="auto",i.bottom="0"),s==="left"?(i.left="0",i.right="auto"):s==="center"?(i.left="50%",i.right="auto"):s==="right"&&(i.left="auto",i.right="0"),o==="middle"&&s==="center"?i.transform=`translate(calc(-50% + ${P.scalingValue(t.x,n)}), calc(-50% + ${P.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${P.scalingValue(t.x,n)}, calc(-50% + ${P.scalingValue(t.y,n)}))`:s==="center"?i.transform=`translate(calc(-50% + ${P.scalingValue(t.x,n)}), ${P.scalingValue(t.y,n)})`:i.transform=`translate(${P.scalingValue(t.x,n)}, ${P.scalingValue(t.y,n)})`,i};function Gs(e){const t=window.getComputedStyle(e);return{top:parseFloat(t.paddingTop)||0,right:parseFloat(t.paddingRight)||0,bottom:parseFloat(t.paddingBottom)||0,left:parseFloat(t.paddingLeft)||0}}function Sa(e){const t=e.getBoundingClientRect(),n=Gs(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),s=e.naturalWidth,a=e.naturalHeight,u=i/o,c=s/a;let m,p;c>u?(m=i,p=i/c):(p=o,m=o*c);const b=t.left+n.left,w=t.top+n.top,S=(i-m)/2+b,g=(o-p)/2+w;return{x:S,y:g,width:m,height:p}}function Ca(e){const t=e.getBoundingClientRect(),n=Gs(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Ta(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const i=t[1].split(",").map(o=>parseFloat(o.trim()));return i.length===4?i[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const i=n[1].substring(6,8);return parseInt(i,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function pu(e,t){const n=(()=>{if(e==="fade in")return ve.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return ve.slideInLeft;case"right":return ve.slideInRight;case"top":return ve.slideInTop;case"bottom":return ve.slideInBottom;default:return ve.slideInRight}return ve.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return ve.fadeIn;if(e==="slide in")switch(t){case"left":return ve.slideInLeft;case"right":return ve.slideInRight;case"top":return ve.slideInTop;case"bottom":return ve.slideInBottom;default:return ve.slideInRight}return ve.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return ve.fadeOut;if(e==="slide in")switch(t){case"left":return ve.slideOutLeft;case"right":return ve.slideOutRight;case"top":return ve.slideOutTop;case"bottom":return ve.slideOutBottom;default:return ve.slideOutRight}return ve.fadeOut})(),s=(()=>{if(e==="fade in")return ve.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return ve.slideOutLeft;case"right":return ve.slideOutRight;case"top":return ve.slideOutTop;case"bottom":return ve.slideOutBottom;default:return ve.slideOutRight}return ve.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:s}}const mu=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:s,isPreviewMode:a})=>{const[u,c]=l.useState(!1),{url:m}=e.thumbnailBlock.cover;return l.useEffect(()=>{o==="close"&&c(!1),o==="open"&&c(!0)},[o]),r.jsxs(r.Fragment,{children:[r.jsx("img",{src:m,alt:"Cover",className:ve.heroImage,onClick:()=>c(!0)}),r.jsx(gu,{isOpen:u,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:s})]})},gu=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:s,isEditor:a,metadata:u})=>{var Ie;const{widthSettings:c,fontSettings:m,letterSpacing:p,textAlign:b,wordSpacing:w,fontSizeLineHeight:S,textAppearance:g,color:v}=i.imageCaption??{},[T,$]=l.useState(0),[C,L]=l.useState(0),[A,k]=l.useState(!1),[F,I]=l.useState(!1),[E,J]=l.useState({}),y=l.useRef(null),_=l.useRef(null),W=l.useRef(null),G=l.useRef(!1),te=l.useRef(null),ue=l.useRef(null),X=l.useRef(null),H=l.useRef(null),Q=l.useRef(!1),z=l.useRef(null),[B,Y]=l.useState(!1),{appear:oe,triggers:ie,slider:O,thumbnail:ce,controls:f,area:de,caption:be,layout:fe}=o.lightboxBlock,{appearClass:Re,backdropAppearClass:Z,backdropDisappearClass:ge,disappearClass:U}=pu(oe.type,oe.direction),V=(u==null?void 0:u.itemId)??null;l.useEffect(()=>{const N=()=>{setTimeout(()=>{var R,K;(K=(R=y.current)==null?void 0:R.splide)==null||K.refresh()},16)},ee=()=>{L(R=>R+1)};return window.addEventListener("ArticleEditor.Layout:change",N),window.addEventListener("ArticleEditor.ComponentContent:change",ee),()=>{window.removeEventListener("ArticleEditor.Layout:change",N),window.removeEventListener("ArticleEditor.ComponentContent:change",ee)}},[]),l.useEffect(()=>{if(!e||!ce.isActive){Y(!1);return}const N=z.current;if(!N)return;const ee=()=>{O.direction==="horiz"?Y(N.scrollWidth>N.clientWidth):Y(N.scrollHeight>N.clientHeight)};ee();const R=new ResizeObserver(ee);return R.observe(N),()=>R.disconnect()},[e,ce.isActive,n.length,E,O.direction]);const j=l.useCallback(()=>{const N=window.matchMedia("(max-width: 768px)").matches,ee=Ta(de.color);N&&!a&&ee>.9&&(document.body.style.backgroundColor=""),k(!0),G.current=!0;const R=K=>{K.target===te.current&&K.animationName&&(te.current&&ue.current&&te.current.removeEventListener("animationend",ue.current),ue.current=null,G.current&&(G.current=!1,t()),k(!1))};te.current&&(ue.current=R,te.current.addEventListener("animationend",R))},[t,de.color,a]),he=(N,ee,R)=>{var K,D;if(N){if(ie.type==="click"&&ie.switch==="image")ie.repeat==="close"&&T===n.length-1?j():(K=y.current)==null||K.go("+1");else if(ie.type==="click"&&ie.switch==="50/50"){const ae=N.getBoundingClientRect(),ne=ee-ae.left,ye=R-ae.top,ke=ae.width,Te=ae.height;let xe;O.direction==="horiz"?xe=ne<ke/2?"-1":"+1":xe=ye<Te/2?"-1":"+1",(D=y.current)==null||D.go(xe)}}},re=N=>{if(Q.current){Q.current=!1;return}const ee=n[T],R=(ee==null?void 0:ee.image.objectFit)==="cover";let K,D;if("changedTouches"in N&&N.changedTouches.length>0)K=N.changedTouches[0].clientX,D=N.changedTouches[0].clientY;else if("clientX"in N)K=N.clientX,D=N.clientY;else return;let ae;if(R&&W.current){const ne=Ca(W.current);ae=K>=ne.left&&K<=ne.right&&D>=ne.top&&D<=ne.bottom}else{const ne=W.current?Sa(W.current):null;if(!ne){N.target===N.currentTarget&&j();return}ae=K>=ne.x&&K<=ne.x+ne.width&&D>=ne.y&&D<=ne.y+ne.height}ae?he(W.current,K,D):j()},Ce=N=>{const ee=N.target;(ee.classList.contains(ve.thumbsWrapper)||ee.classList.contains(ve.thumbsContainer))&&re(N)};l.useEffect(()=>{if(!e)return;const N=ee=>{var R,K;if(ee.key==="Escape"){j();return}if(ee.key==="ArrowRight"){$(D=>(D+1)%Math.max(n.length,1)),(R=y.current)==null||R.go("+1");return}ee.key==="ArrowLeft"&&($(D=>(D-1+Math.max(n.length,1))%Math.max(n.length,1)),(K=y.current)==null||K.go("-1"))};return window.addEventListener("keydown",N),()=>{window.removeEventListener("keydown",N)}},[e,j,n.length]),l.useEffect(()=>{if(e){if($(0),L(ee=>ee+1),G.current=!1,k(!1),I(!1),J({}),!V)return;const N=new CustomEvent("page-overlay",{detail:{itemId:V}});window.dispatchEvent(N)}return()=>{te.current&&ue.current&&(te.current.removeEventListener("animationend",ue.current),ue.current=null),I(!1)}},[e,V]),l.useEffect(()=>{_.current!==null&&_.current!==O.type&&L(N=>N+1),_.current=O.type},[O.type]),l.useEffect(()=>{if(!e)return;const N=document.body.style.overflow,ee=window.matchMedia("(max-width: 768px)").matches,R=Ta(de.color);document.body.style.overflow="hidden",I(!1);const K=ae=>{ae.target===te.current&&!G.current&&ae.animationName&&(ee&&!a&&R>.9&&(document.body.style.backgroundColor=de.color),I(!0),te.current&&X.current&&te.current.removeEventListener("animationend",X.current),X.current=null)};te.current&&(X.current=K,te.current.addEventListener("animationend",K));const D=ae=>{const ne=ae.target;ne&&(ne.closest(`.${ve.thumbsWrapper}`)||ne.closest(`.${ve.thumbsContainer}`))||O.type!=="slide"&&ae.preventDefault()};return document.addEventListener("touchmove",D,{passive:!1}),()=>{document.body.style.overflow=N,document.removeEventListener("touchmove",D),te.current&&X.current&&(te.current.removeEventListener("animationend",X.current),X.current=null),I(!1)}},[e,a,de.color,O.type]),l.useEffect(()=>{if(!e)return;const N=ee=>{var K,D;if(G.current){ee.stopPropagation();return}if(Q.current){Q.current=!1;return}const R=ee.target;if(!(R&&(R.closest(`.${ve.thumbsContainer}`)||R.closest(`.${ve.thumbItem}`)||R.closest(`.${ve.arrow}`)||R.closest(`.${ve.closeButton}`)||R.closest(`.${ve.caption}`)))){if(O.type==="slide"&&ie.type==="drag"&&((D=(K=y.current)==null?void 0:K.splide)!=null&&D.root)){const ae=y.current.splide.root;if(R&&(ae.contains(R)||ae===R))return}if(ee.touches.length===0&&ee.changedTouches.length>0){const ae=n[T],ne=(ae==null?void 0:ae.image.objectFit)==="cover",ye=ee.changedTouches[0];let ke;if(ne&&W.current){const Te=Ca(W.current);ke=ye.clientX>=Te.left&&ye.clientX<=Te.right&&ye.clientY>=Te.top&&ye.clientY<=Te.bottom}else{const Te=W.current?Sa(W.current):null;if(!Te)return;ke=ye.clientX>=Te.x&&ye.clientX<=Te.x+Te.width&&ye.clientY>=Te.y&&ye.clientY<=Te.y+Te.height}if(!ke){ee.stopPropagation(),G.current=!0;const Te=xe=>{xe.stopPropagation(),xe.preventDefault(),document.removeEventListener("click",Te,!0)};document.addEventListener("click",Te,!0),j()}}}};return document.addEventListener("touchend",N,{passive:!0}),()=>{document.removeEventListener("touchend",N)}},[e,j,T,n]);const Se=(O.type==="scale"||O.type==="fade")&&O.direction==="vert"&&ie.type==="drag";l.useEffect(()=>{var xe,Ke;if(!e||!Se||!((Ke=(xe=y.current)==null?void 0:xe.splide)!=null&&Ke.root))return;const N=y.current.splide.root,ee=30,R=(se,Ae)=>{if(H.current){const Ne=Math.abs(se-H.current.x),He=Math.abs(Ae-H.current.y);(Ne>0||He>0)&&(Q.current=!0)}},K=se=>{H.current&&(se.preventDefault(),R(se.clientX,se.clientY))},D=se=>{H.current&&se.touches.length>0&&(se.preventDefault(),R(se.touches[0].clientX,se.touches[0].clientY))},ae=(se,Ae)=>{if(!H.current||!y.current){H.current=null;return}const Ne=Math.abs(se-H.current.x),He=Math.abs(Ae-H.current.y);He>ee&&He>Ne&&y.current.go(Ae<H.current.y?"+1":"-1"),H.current=null},ne=se=>{H.current&&ae(se.clientX,se.clientY),document.removeEventListener("pointerup",ne),document.removeEventListener("pointercancel",ne),document.removeEventListener("pointermove",K)},ye=se=>{if(H.current){if(se.changedTouches.length>0){const Ae=se.changedTouches[0];ae(Ae.clientX,Ae.clientY)}document.removeEventListener("touchend",ye),document.removeEventListener("touchcancel",ye),document.removeEventListener("touchmove",D)}},ke=se=>{H.current={x:se.clientX,y:se.clientY},Q.current=!1,document.addEventListener("pointermove",K,{passive:!1}),document.addEventListener("pointerup",ne),document.addEventListener("pointercancel",ne)},Te=se=>{se.touches.length>0&&(H.current={x:se.touches[0].clientX,y:se.touches[0].clientY},Q.current=!1,document.addEventListener("touchmove",D,{passive:!1}),document.addEventListener("touchend",ye),document.addEventListener("touchcancel",ye))};return N.addEventListener("pointerdown",ke),N.addEventListener("touchstart",Te),()=>{N.removeEventListener("pointerdown",ke),N.removeEventListener("touchstart",Te),document.removeEventListener("pointermove",K),document.removeEventListener("pointerup",ne),document.removeEventListener("pointercancel",ne),document.removeEventListener("touchmove",D),document.removeEventListener("touchend",ye),document.removeEventListener("touchcancel",ye),H.current=null,Q.current=!1}},[e,Se,C]);const we={backgroundColor:de.color,backdropFilter:`blur(${de.blur}px)`,animationDuration:`${parseInt(oe.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(s)?null:ji.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:a?null:te,className:ze(ve.background,A?ge:Z,{[ve.editor]:a},{[ve.hidden]:!e}),style:{...we,...F&&!a&&!A?{position:"absolute"}:{}}}),r.jsxs("div",{ref:a?te:null,className:ze(ve.contentStyle,A?U:Re,{[ve.editor]:a},{[ve.hidden]:!e}),style:{animationDuration:`${parseInt(oe.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[r.jsx(Yr,{onMove:N=>$(N.index),ref:y,className:ve.lightboxSplide,options:{arrows:!1,speed:O.duration?parseInt(O.duration):500,direction:O.direction==="horiz"||O.type==="fade"||O.type==="scale"?"ltr":"ttb",pagination:!1,drag:ie.type==="drag"&&!Se,perPage:1,width:"100%",height:"100%",type:O.type==="fade"||O.type==="scale"?"fade":"loop",padding:0,rewind:ie.repeat!=="close",start:0},style:{"--splide-speed":O.duration},children:n.map((N,ee)=>{const R=io(fe.position,fe.offset,a),K=`${P.scalingValue(fe.padding.top,a)} ${P.scalingValue(fe.padding.right,a)} ${P.scalingValue(fe.padding.bottom,a)} ${P.scalingValue(fe.padding.left,a)}`,D=O.type==="scale"?(()=>{const{transform:ae,...ne}=R;return{...ne,position:"absolute",padding:K,boxSizing:"border-box","--position-transform":ae||"none"}})():{...R,position:"absolute",padding:K,boxSizing:"border-box"};return r.jsx(Jr,{children:r.jsx("div",{className:ve.imgWrapper,onClick:re,children:r.jsx("img",{ref:ee===T?W:null,className:ze(ve.imageStyle,{[ve.contain]:N.image.objectFit==="contain",[ve.cover]:N.image.objectFit==="cover",[ve.scaleSlide]:O.type==="scale"}),src:N.image.url,alt:N.image.name??"",style:{...D,pointerEvents:N.image.objectFit==="contain"?"none":"auto"}})})},ee)})},C),f.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:ze(ve.arrow,{[ve.arrowVertical]:O.direction==="vert"}),style:{color:f.color,"--arrow-hover-color":f.hover},children:r.jsxs("button",{className:ve.arrowInner,style:{transform:`translate(${P.scalingValue(f.offset.x,a)}, ${P.scalingValue(f.offset.y*(O.direction==="horiz"?1:-1),a)}) scale(${f.scale}) rotate(${O.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var N;return(N=y.current)==null?void 0:N.go("-1")},"aria-label":"Previous",children:[f.arrowsImgUrl&&r.jsx(Qt,{url:f.arrowsImgUrl,fill:f.color,hoverFill:f.hover,className:ze(ve.arrowImg,ve.mirror)}),!f.arrowsImgUrl&&r.jsx(La,{color:f.color,className:ze(ve.arrowIcon,ve.arrowImg,ve.mirror)})]})}),r.jsx("div",{className:ze(ve.arrow,ve.nextArrow,{[ve.arrowVertical]:O.direction==="vert"}),style:{color:f.color,"--arrow-hover-color":f.hover},children:r.jsxs("button",{className:ve.arrowInner,style:{transform:`translate(${P.scalingValue(f.offset.x*(O.direction==="horiz"?-1:1),a)}, ${P.scalingValue(f.offset.y,a)}) scale(${f.scale}) rotate(${O.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var N;return(N=y.current)==null?void 0:N.go("+1")},"aria-label":"Next",children:[f.arrowsImgUrl&&r.jsx(Qt,{url:f.arrowsImgUrl,fill:f.color,hoverFill:f.hover,className:ve.arrowImg}),!f.arrowsImgUrl&&r.jsx(La,{color:f.color,className:ze(ve.arrowIcon,ve.arrowImg)})]})})]}),de.closeIconUrl&&(()=>{const N=io(de.closeIconAlign,de.closeIconOffset,a),ee=`scale(${de.closeIconScale})`,R=N.transform?`${N.transform} ${ee}`:ee;return r.jsx("button",{className:ve.closeButton,style:{...N,transform:R},onClick:j,"aria-label":"Close lightbox",children:r.jsx(Qt,{url:de.closeIconUrl,fill:de.closeIconColor??"#000000",hoverFill:de.closeIconHover??"#cccccc"})})})(),be&&be.isActive&&i.imageCaption&&((Ie=n[T])==null?void 0:Ie.imageCaption)&&r.jsx("div",{className:ve.caption,style:{...io(be.alignment,be.offset,a),fontFamily:qo(m.fontFamily),fontWeight:m.fontWeight,fontStyle:m.fontStyle,width:c.sizing==="auto"?"max-content":P.scalingValue(c.width,a),letterSpacing:P.scalingValue(p,a),wordSpacing:P.scalingValue(w,a),textAlign:b,fontSize:P.scalingValue(S.fontSize,a),lineHeight:P.scalingValue(S.lineHeight,a),textTransform:g.textTransform??"none",textDecoration:g.textDecoration??"none",fontVariant:g.fontVariant??"normal",color:v},onClick:N=>N.stopPropagation(),children:r.jsx("div",{"data-styles":"imageCaption",className:ve.captionTextInner,style:{"--link-color":be.linkColor,"--link-hover-color":be.linkHoverColor},children:r.jsx(ui,{content:n[T].imageCaption})})}),ce.isActive&&(()=>{const[N,ee]=ce.position.split("-"),R=O.direction==="horiz"?`${N}-left`:ce.position,K=io(R,ce.offset,a),D=()=>{if(O.direction==="horiz"){if(ee==="left")return"flex-start";if(ee==="center")return"center";if(ee==="right")return"flex-end"}else{if(N==="top")return"flex-start";if(N==="middle")return"center";if(N==="bottom")return"flex-end"}return"flex-start"};return r.jsx("div",{ref:z,className:ve.thumbsWrapper,onClick:ae=>Ce(ae),style:{position:a?"absolute":"fixed",...K,...O.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:r.jsx("div",{className:ze(ve.thumbsContainer,{[ve.thumbsContainerVertical]:O.direction==="vert",[ve.thumbsAlignStart]:ce.align==="start",[ve.thumbsAlignCenter]:ce.align==="center",[ve.thumbsAlignEnd]:ce.align==="end"}),style:{gap:P.scalingValue(ce.grid.gap,a),justifyContent:B?"flex-start":D()},children:n.map((ae,ne)=>{const ye=ne===T,ke=E[ne],xe=ce.grid.size*(ye?ce.activeState.scale:1),Ke=()=>{if(ce.fit!=="fit")return{};if(!ke)return O.direction==="horiz"?{height:P.scalingValue(xe,a)}:{width:P.scalingValue(xe,a)};const se=ke.width/ke.height;if(O.direction==="horiz"){const Ae=xe,Ne=Ae*se;return{width:P.scalingValue(Ne,a),height:P.scalingValue(Ae,a)}}else{const Ae=xe,Ne=Ae/se;return{width:P.scalingValue(Ae,a),height:P.scalingValue(Ne,a)}}};return r.jsx("button",{className:ve.thumbItem,style:{...O.direction==="horiz"&&ce.fit!=="fit"?{height:P.scalingValue(xe,a)}:{},...O.direction==="vert"&&ce.fit!=="fit"?{width:P.scalingValue(xe,a)}:{},...ce.fit==="cover"?{width:P.scalingValue(xe,a),height:P.scalingValue(xe,a)}:{},...Ke(),transition:ye?"all 0.25s ease-out":"none",opacity:ye?ce.activeState.opacity/100:ce.opacity/100,"--thumb-hover":ce.activeState.opacity/100},onClick:se=>{var Ae;se.stopPropagation(),$(ne),(Ae=y.current)==null||Ae.go(ne)},onMouseEnter:()=>{var se;ce.triggers==="hov"&&((se=y.current)==null||se.go(ne))},children:r.jsx("img",{src:ae.image.url,alt:ae.image.name??"",onLoad:se=>{const Ae=se.currentTarget;Ae.naturalWidth&&Ae.naturalHeight&&J(Ne=>({...Ne,[ne]:{width:Ae.naturalWidth,height:Ae.naturalHeight}}))},style:{objectFit:ce.fit==="cover"?"cover":"contain",...ce.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...ce.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${ae.image.name}-${ne}`)})})})})()]})]}),document.getElementById(s))};function La({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.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:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const hu={element:mu,id:"lightbox",name:"Lightbox",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Lightbox.png"},defaultSize:{d:{width:440,height:550},t:{width:235,height:293},m:{width:265,height:331}},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.thumbnailBlock.cover.url",placeholderEnabled:!0},{path:"settings.controls.arrowsImgUrl"},{path:"settings.area.closeIconUrl"}]},schema:{type:"object",properties:{settings:{type:"object",properties:{thumbnailBlock:{display:{type:"settings-block",triggerEvent:"close"},type:"object",properties:{cover:{title:"COVER",icon:"cover",tooltip:"Cover Image",type:"object",properties:{url:{type:"string",display:{type:"cover-image-input"}}}}}},lightboxBlock:{display:{type:"settings-block",triggerEvent:"open"},type:"object",properties:{appear:{title:"APPEAR",icon:"transition",tooltip:"Appearance",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide in","fade in","mix"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]},direction:{type:"string",title:"From",display:{type:"direction-control"},enum:["top","left","right","bottom"]}}},triggers:{title:"TRIGGERS",icon:"target",tooltip:"Triggers",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["click","drag"]},switch:{type:"string",display:{type:"ratio-group"},enum:["image","50/50"]},repeat:{type:"string",title:"Repeat",display:{visible:!1,type:"ratio-group"},enum:["close","loop"]}}},slider:{title:"SLIDER",icon:"horizontal-resize",tooltip:"Slider",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade","scale"]},direction:{type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},thumbnail:{title:"THUMB",icon:"thumbnail",tooltip:"Thumbnail",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},fit:{type:"string",display:{type:"ratio-group"},enum:["cover","fit"]},align:{type:"string",title:"Align",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},triggers:{type:"string",title:"Triggers",display:{type:"ratio-group",direction:"horizontal"},enum:["clk","hov"]},grid:{type:"object",title:"Grid",display:{type:"group"},properties:{size:{type:"number",label:"Box",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},gap:{type:"number",label:"Gap",scalingEnabled:!0,min:0,display:{type:"numeric-input"}}}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}},activeState:{type:"object",title:"ACTIVE",display:{type:"group"},properties:{scale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control"}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}}}}}},layout:{title:"LAYOUT",icon:"layout",tooltip:"Layout",type:"object",properties:{position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},padding:{type:"object",title:"Padding",display:{type:"padding-controls"},properties:{top:{min:0,step:1,type:"number"},left:{min:0,step:1,type:"number"},right:{min:0,step:1,type:"number"},bottom:{min:0,step:1,type:"number"}}}}},controls:{title:"CONTROLS",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},color:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},area:{title:"AREA",icon:"area",tooltip:"Area",type:"object",properties:{color:{type:"string",display:{type:"settings-color-picker",format:"single"}},blur:{type:"number",label:"icon:blur",display:{type:"numeric-input"}},closeIconUrl:{type:["string","null"],title:"Close Icon",display:{type:"settings-image-input"}},closeIconAlign:{display:{type:"align-grid",direction:"horizontal"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},closeIconScale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},closeIconOffset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},closeIconColor:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},closeIconHover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},caption:{title:"DESC",icon:"text-icon",tooltip:"Description",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}}}},default:{d:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"slide in",duration:"1000ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.01,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:0,bottom:.06,left:0}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},linkColor:"#cccccc",linkHoverColor:"#cccccc"}}},m:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"horiz",duration:"1000ms"},thumbnail:{isActive:!0,position:"bottom-center",fit:"fit",align:"start",triggers:"hov",grid:{size:.1,gap:.05},offset:{x:.01,y:-.05},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.05,bottom:.06,left:.05}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}},t:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.03,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.1,bottom:.06,left:.1}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}}},displayRules:[{if:{name:"lightboxBlock.appear.type",value:"slide in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.slider.direction",value:"vert"},then:{name:"properties.lightboxBlock.properties.thumbnail.properties.align.display.direction",value:"vertical"}},{if:{name:"lightboxBlock.appear.type",value:"mix"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.appear.type",value:"fade in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!1}},{if:[{name:"lightboxBlock.triggers.type",value:"click"},{name:"lightboxBlock.triggers.switch",value:"image"}],then:{name:"properties.lightboxBlock.properties.triggers.properties.repeat.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{label:"Description",placeholder:"Add Caption...",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/2.jpg",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/3.jpg",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/4.jpg",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}};function oo(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function fu(e){return`
6
+ */const dd="RichTextRenderer-module__link___BWeZ2",ud={link:dd},pd=e=>{const t=e.trim();return!t||t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?!1:t.split(/\s+/g).filter(Boolean).some(i=>/^\d/.test(i))},qo=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>pd(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function qt(e){const{color:t,...n}=e;return n}function At(e,t){var o,s,a;const{fontSize:n,lineHeight:i}=e;return{fontFamily:qo(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:P.scalingValue(e.letterSpacing,t),wordSpacing:P.scalingValue(e.wordSpacing,t),fontSize:P.scalingValue(n,t),lineHeight:i!==void 0?P.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(s=e.textAppearance)==null?void 0:s.textDecoration,fontVariant:(a=e.textAppearance)==null?void 0:a.fontVariant,textAlign:e.textAlign,color:e.color}}const ui=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?r.jsx("a",{className:ud.link,href:i.value,target:i.target,children:t(i.children)},o):r.jsx("span",{style:md(i),children:i.text},o));return r.jsx(r.Fragment,{children:e.map((n,i)=>{const o=n.children;return r.jsx("div",{children:t(o)},i)})})};function md(e){return{...e.fontFamily&&{fontFamily:qo(e.fontFamily)},...e.fontWeight&&{fontWeight:e.fontWeight},...e.fontStyle&&{fontStyle:e.fontStyle},...e.textDecoration&&{textDecoration:e.textDecoration},...e.textTransform&&{textTransform:e.textTransform},...e.fontVariant&&{fontVariant:e.fontVariant},...e.verticalAlign&&{verticalAlign:e.verticalAlign,lineHeight:"0px"}}}const gd="SvgImage-module__svg___q3xE-",hd="SvgImage-module__img___VsTm-",xa={svg:gd,img:hd},fd=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},yd=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,Qt=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[s,a]=l.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return l.useEffect(()=>{if(typeof window<"u"&&window.CSS){const u=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');a(u)}},[]),!fd(e)||!s?r.jsx("img",{src:e,alt:"",className:ze(xa.img,i),style:o}):r.jsx("span",{"data-supports-mask":s,className:ze(xa.svg,i),style:{"--svg":yd(e),"--fill":t,"--hover-fill":n,...o??{}}})},vd={"top-left":Pe.topLeftAlignment,"top-center":Pe.topCenterAlignment,"top-right":Pe.topRightAlignment,"middle-left":Pe.middleLeftAlignment,"middle-center":Pe.middleCenterAlignment,"middle-right":Pe.middleRightAlignment,"bottom-left":Pe.bottomLeftAlignment,"bottom-center":Pe.bottomCenterAlignment,"bottom-right":Pe.bottomRightAlignment};function bd({settings:e,content:t,styles:n,isEditor:i}){const[o,s]=l.useState(null),{widthSettings:a,fontSettings:u,letterSpacing:c,textAlign:m,wordSpacing:p,fontSizeLineHeight:b,textAppearance:w,color:S}=n.imageCaption??{},[g,v]=l.useState(void 0),[T,$]=l.useState(null),[C,L]=l.useState(0),[A,k]=l.useState(0),{direction:F,transition:I,controls:E,pagination:J,imageCaption:y,triggers:_}=e,W=l.useRef(I.type),{x:G,y:te}=e.controls.offset,ue=X=>{o&&o.go(X)};return l.useEffect(()=>{if(!T)return;const X=new ResizeObserver(H=>{if(!o)return;const[Q]=H;v({width:Math.round(Q.contentRect.width),height:Math.round(Q.contentRect.height)})});return X.observe(T),()=>X.unobserve(T)},[T]),l.useEffect(()=>{!o||W.current===I.type||(k(X=>X+1),W.current=I.type)},[I.type]),r.jsx("div",{className:ze(Pe.wrapper,{[Pe.editor]:i}),ref:$,children:r.jsxs("div",{className:Pe.sliderInner,style:{width:g?g.width:"100%",height:g?g.height:"100%",backgroundColor:I.backgroundColor&&I.type==="fade in"?I.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&r.jsx("div",{className:ze(Pe.captionBlock),children:r.jsx("div",{className:Pe.captionTextWrapper,children:t.map((X,H)=>r.jsx("div",{className:ze(Pe.captionText,vd[y.alignment],{[Pe.withPointerEvents]:H===C&&i,[Pe.active]:H===C}),style:{fontFamily:qo(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:a.sizing==="auto"?"max-content":P.scalingValue(a.width,i),letterSpacing:P.scalingValue(c,i),wordSpacing:P.scalingValue(p,i),textAlign:m,fontSize:P.scalingValue(b.fontSize,i),lineHeight:P.scalingValue(b.lineHeight,i),textTransform:w.textTransform??"none",textDecoration:w.textDecoration??"none",fontVariant:w.fontVariant??"normal",color:S,transitionDuration:I.duration?`${Math.round(parseInt(I.duration)/2)}ms`:"500ms"},children:r.jsx("div",{"data-styles":"imageCaption",className:Pe.captionTextInner,style:{"--link-hover-color":y.linkHoverColor,"--link-color":y.linkColor,position:"relative",top:P.scalingValue(y.offset.y,i),left:P.scalingValue(y.offset.x,i)},children:r.jsx(ui,{content:X.imageCaption})})},H))})}),r.jsx(Yr,{onMove:X=>{L(X.index)},ref:s,options:{arrows:!1,speed:I.duration?parseInt(I.duration):500,autoplay:_.autoPlay!==null,..._.autoPlay!==null&&{interval:parseInt(_.autoPlay)*1e3},direction:F==="horiz"||I.type==="fade in"?"ltr":"ttb",pagination:!1,drag:_.triggersList.drag,perPage:1,width:g?g.width:"100%",height:g?g.height:"100%",type:I.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((X,H)=>r.jsx(Jr,{children:r.jsx("div",{className:Pe.sliderItem,children:r.jsx("div",{className:Pe.imgWrapper,children:r.jsx("img",{className:ze(Pe.sliderImage,{[Pe.contain]:X.image.objectFit==="contain",[Pe.cover]:X.image.objectFit==="cover"}),src:X.image.url,alt:X.image.name??""})})})},H))},A),E.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:ze(Pe.arrow,{[Pe.arrowVertical]:F==="vert",[Pe.hoverArrow]:E.show==="on hover"}),style:{color:E.color,"--arrow-hover-color":E.hover},children:r.jsxs("button",{onClick:()=>{ue("-1")},className:Pe.arrowInner,style:{transform:`translate(${P.scalingValue(G,i)}, ${P.scalingValue(te*(F==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${F==="horiz"?"0deg":"90deg"})`},children:[E.arrowsImgUrl&&r.jsx(Qt,{url:E.arrowsImgUrl,fill:E.color,hoverFill:E.hover,className:ze(Pe.arrowImg,Pe.mirror)}),!E.arrowsImgUrl&&r.jsx(wa,{color:E.color,className:ze(Pe.arrowIcon,Pe.arrowImg,Pe.mirror)})]})}),r.jsx("div",{className:ze(Pe.arrow,Pe.nextArrow,{[Pe.arrowVertical]:F==="vert",[Pe.hoverArrow]:E.show==="on hover"}),style:{color:E.color,"--arrow-hover-color":E.hover},children:r.jsxs("button",{className:Pe.arrowInner,onClick:()=>ue("+1"),style:{transform:`translate(${P.scalingValue(G*(F==="horiz"?-1:1),i)}, ${P.scalingValue(te,i)}) scale(${e.controls.scale/100}) rotate(${F==="horiz"?"0deg":"90deg"})`},children:[E.arrowsImgUrl&&r.jsx(Qt,{url:E.arrowsImgUrl,fill:E.color,hoverFill:E.hover,className:Pe.arrowImg}),!E.arrowsImgUrl&&r.jsx(wa,{color:E.color,className:ze(Pe.arrowIcon,Pe.arrowImg)})]})})]}),_.triggersList.click&&r.jsx("div",{className:Pe.clickOverlay,onClick:()=>{o&&o.go("+1")}}),J.isActive&&r.jsx("div",{className:ze(Pe.pagination,{[Pe.paginationInsideBottom]:J.position==="inside-1"&&F==="horiz",[Pe.paginationInsideTop]:J.position==="inside-2"&&F==="horiz",[Pe.paginationOutsideBottom]:J.position==="outside-1"&&F==="horiz",[Pe.paginationOutsideTop]:J.position==="outside-2"&&F==="horiz",[Pe.paginationInsideLeft]:J.position==="inside-1"&&F==="vert",[Pe.paginationInsideRight]:J.position==="inside-2"&&F==="vert",[Pe.paginationOutsideLeft]:J.position==="outside-1"&&F==="vert",[Pe.paginationOutsideRight]:J.position==="outside-2"&&F==="vert",[Pe.paginationVertical]:F==="vert"}),children:r.jsx("div",{className:Pe.paginationInner,style:{backgroundColor:J.colors[2],transform:`scale(${J.scale/100}) translate(${P.scalingValue(J.offset.x,i)}, ${P.scalingValue(J.offset.y,i)}) rotate(${F==="horiz"?"0deg":"90deg"})`},children:t.map((X,H)=>r.jsx("button",{onClick:()=>{o&&o.go(H)},className:ze(Pe.paginationItem),children:r.jsx("div",{className:ze(Pe.dot,{[Pe.activeDot]:H===C}),style:{backgroundColor:H===C?J.colors[0]:J.colors[1],"--pagination-hover-color":J.hover}})},H))})})]})})}function wa({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.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:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const xd={element:bd,id:"control-slider",name:"Slider",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Slider.mp4"},defaultSize:{d:{width:400,height:400},t:{width:400,height:400},m:{width:300,height:300}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.arrowsImgUrl"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{triggers:{title:"triggers",icon:"target",tooltip:"Triggers",type:"object",properties:{triggersList:{type:"object",display:{type:"toggle-ratio-group"},properties:{click:{type:"boolean"},drag:{type:"boolean"}}},autoPlay:{type:["string","null"],label:"Auto",display:{type:"step-selector"},enum:[null,"1s","2s","3s","4s","5s"]}}},direction:{icon:"horizontal-resize",tooltip:"Direction",type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},transition:{title:"transit",icon:"transition",tooltip:"Transition",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade in"]},backgroundColor:{type:["string","null"],title:"BG Color",display:{visible:!1,type:"settings-color-picker",format:"single"}},duration:{type:"string",label:"icon:hourglass",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},controls:{title:"controls",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:50,max:600,display:{type:"range-control"}},color:{title:"color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}},show:{title:"Show",type:"string",display:{type:"ratio-group"},enum:["always","on hover"]}}},pagination:{title:"nav",icon:"pagination",tooltip:"Navigation",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"socket",direction:"horizontal"},type:"string",enum:["outside-1","outside-2","inside-1","inside-2"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:10,max:400,display:{type:"range-control"}},colors:{display:{type:"settings-color-picker",format:"multiple"},title:"color",type:"array",items:{type:"string"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},imageCaption:{title:"Caption",icon:"text-icon",tooltip:"Caption",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}},default:{triggers:{triggersList:{click:!1,drag:!0},autoPlay:null},controls:{isActive:!0,arrowsImgUrl:null,offset:{x:0,y:0},scale:100,color:"#000000",hover:"#cccccc",show:"always"},transition:{type:"slide",duration:"500ms",backgroundColor:null},pagination:{isActive:!0,scale:50,position:"inside-1",offset:{x:0,y:0},colors:["#cccccc","#cccccc","#000000"],hover:"#cccccc"},direction:"horiz",imageCaption:{offset:{x:0,y:0},isActive:!0,alignment:"middle-center",linkColor:"#cccccc",linkHoverColor:"#cccccc"}},displayRules:[{if:{name:"direction",value:"vert"},then:{name:"properties.pagination.properties.position.display.direction",value:"vertical"}},{if:{name:"transition.type",value:"fade in"},then:{name:"properties.transition.properties.backgroundColor.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{placeholder:"Add Caption...",label:"Description",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-1.png",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-2.png",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-3.png",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}},wd="ImageRevealSlider-module__imageRevealSlider___UE5Ob",$d="ImageRevealSlider-module__image___Qjt-e",Sd="ImageRevealSlider-module__link___N-iLG",Cd="ImageRevealSlider-module__cursor___2U03d",Qn={imageRevealSlider:wd,image:$d,link:Sd,cursor:Cd};function $a(e,t,n){for(const i of n){const o=new Image;o.src=i.url;const s=i.width?Number.parseFloat(i.width):o.naturalWidth,a=o.naturalHeight/o.naturalWidth*s,u=s/2,c=a/2;if(e>=i.x-u&&e<=i.x+u&&t>=i.y-c&&t<=i.y+c)return!0}return!1}function rr(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Td(e,t,n,i){let o,s;if(t==="custom"){o=n;const a=await rr(e);s=a.height/a.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const a=await rr(e);s=a.height/a.width*o}else{const a=await rr(e);o=a.width,s=a.height}return{width:o,height:s,finalWidth:`${o}px`}}function Ld({settings:e,content:t,isEditor:n}){const[i,o]=l.useState(null),[s,a]=l.useState([]),[u,c]=l.useState(0),m=l.useRef(0),[p,b]=l.useState({x:0,y:0}),[w,S]=l.useState(1),[g,v]=l.useState("none"),T=l.useRef({x:0,y:0}),[$,C]=l.useState(!1),{sizeType:L,imageWidth:A,randomRangeImageWidth:k}=e.imageSize,{revealPosition:F,visible:I}=e.position,{cursorType:E,target:J,defaultCursorScale:y,defaultCursor:_,hoverCursorScale:W,hoverCursor:G}=e.cursor;l.useEffect(()=>{if(!i)return;const X=(z,B)=>{const Y=i.getBoundingClientRect(),oe=z-Y.left,ie=B-Y.top;if(b({x:oe,y:ie}),E==="system"){v("none"),S(1);return}const O=oe,ce=ie,f=document.elementFromPoint(Y.left+O,Y.top+ce);if(f&&f.closest("a")){v("none"),S(1);return}const de=$a(O,ce,s)||J==="area"?{img:G??"none",scale:W}:{img:_??"none",scale:y};v(de.img),S(de.scale)},H=z=>{z.stopPropagation(),T.current={x:z.clientX,y:z.clientY},X(z.clientX,z.clientY)},Q=()=>{$&&X(T.current.x,T.current.y)};return i.addEventListener("mousemove",H),window.addEventListener("scroll",Q,!0),()=>{i.removeEventListener("mousemove",H),window.removeEventListener("scroll",Q,!0)}},[i,$,p,E,J,G,_,W,y,s]),l.useEffect(()=>{$||(v("none"),S(0))},[$]);const te=async(X,H,Q,z={})=>{const{width:B,height:Y,finalWidth:oe}=await Td(X.image.url,L,A,k);let ie=0,O=0;F==="same"?(ie=H/2,O=Q/2):(ie=z.x??Math.random()*H,O=z.y??Math.random()*Q);const ce=Math.min(Math.max(ie,B/2),H-B/2),f=Math.min(Math.max(O,Y/2),Q-Y/2);return{id:m.current++,url:X.image.url,link:X.link,name:X.image.name,x:ce,y:f,width:oe}};l.useEffect(()=>{if(!i||t.length===0)return;const X=i.getBoundingClientRect(),H=X.width,Q=X.height,z=[];(async()=>{const Y=t[0],oe=await te(Y,H,Q);z.push(oe),a(z),c(1)})()},[L,A,k,F,i]),l.useEffect(()=>{I==="last One"&&a(X=>X.length>0?[X[X.length-1]]:[])},[I]);const ue=async X=>{if(!i)return;const H=i.getBoundingClientRect(),Q=X.clientX-H.left,z=X.clientY-H.top;if(J==="image"&&!$a(Q,z,s))return;let B=0,Y=0;F==="on Click"?(B=Q,Y=z):F==="same"?(B=H.width/2,Y=H.height/2):(B=Math.random()*H.width,Y=Math.random()*H.height);const oe=t[u],ie=await te(oe,H.width,H.height,{x:B,y:Y});a(O=>I==="all"?[...O,ie]:[ie]),c(O=>O>=t.length-1?0:O+1)};return r.jsxs("div",{ref:o,onClick:ue,onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),className:Qn.imageRevealSlider,style:{cursor:g==="none"?"default":"none"},children:[s.map(X=>r.jsx("div",{className:Qn.wrapper,style:{top:`${X.y}px`,left:`${X.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:X.width??"auto",height:"auto",cursor:g==="none"?"default":"none"},children:J==="area"&&X.link?r.jsx("a",{href:X.link,target:"_blank",className:Qn.link,children:r.jsx("img",{src:X.url,alt:X.name,className:Qn.image},X.id)}):r.jsx("img",{src:X.url,alt:X.name,className:Qn.image},X.id)},X.id)),$&&r.jsx("div",{className:Qn.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${w})`,backgroundImage:`url('${g}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const Ed={element:Ld,id:"control-image-reveal",name:"Click Gallery",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Click_Gallery.mp4"},defaultSize:{d:{width:"100%",height:"100%"},t:{width:"100%",height:"100%"},m:{width:"100%",height:"100%"}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.cursor.defaultCursor"},{path:"settings.cursor.hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{imageSize:{title:"IMG SIZE",icon:"size",tooltip:"IMG SIZE",type:"object",properties:{sizeType:{type:"string",display:{type:"ratio-group"},enum:["as Is","custom","random"]},imageWidth:{type:"number",label:"W",display:{type:"numeric-input",visible:!1}},randomRangeImageWidth:{type:"object",display:{type:"random-range-controls",visible:!1},properties:{min:{type:"number"},max:{type:"number"}}}}},cursor:{title:"cursor",icon:"cursor",tooltip:"cursor",type:"object",properties:{cursorType:{type:"string",display:{type:"ratio-group"},enum:["system","custom"]},target:{type:"string",title:"Target",display:{type:"ratio-group"},enum:["area","image"]},defaultCursor:{type:["string","null"],title:"Default",display:{type:"settings-image-input",visible:!1}},defaultCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}},hoverCursor:{type:["string","null"],title:"Hover",display:{type:"settings-image-input",visible:!1}},hoverCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}}}},position:{title:"position",icon:"transition",tooltip:"Position",type:"object",properties:{revealPosition:{type:"string",display:{type:"ratio-group"},enum:["random","same","on Click"]},visible:{type:"string",title:"Visible",display:{type:"ratio-group"},enum:["all","last One"]}}}},default:{imageSize:{sizeType:"custom",imageWidth:500,randomRangeImageWidth:{min:100,max:1e3}},cursor:{cursorType:"system",target:"area",defaultCursor:null,defaultCursorScale:2,hoverCursor:null,hoverCursorScale:2},position:{revealPosition:"random",visible:"all"}},displayRules:[{if:{name:"imageSize.sizeType",value:"custom"},then:{name:"properties.imageSize.properties.imageWidth.display.visible",value:!0}},{if:{name:"imageSize.sizeType",value:"random"},then:{name:"properties.imageSize.properties.randomRangeImageWidth.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"}],then:{name:"properties.cursor.properties.defaultCursor.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"},{name:"cursor.defaultCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.defaultCursorScale.display.visible",value:!0}},{if:{name:"cursor.cursorType",value:"custom"},then:{name:"properties.cursor.properties.hoverCursor.display.visible",value:!0}},{if:[{name:"cursor.cursorType",value:"custom"},{name:"cursor.hoverCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.hoverCursorScale.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQK9211QXBE9W284ZNKB8.png",name:"Slider-1.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQMFT72JD18WKP0Q2DVAT.png",name:"Slider-2.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQNEVRXPSRX5K1YTMJQY9.png",name:"Slider-3.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQP84JKRDT7WNWDQZR4Y9.png",name:"Slider-4.png"},link:""}]}}}},Id="LightBox-module__hidden___9s-9x",Pd="LightBox-module__heroImage___sTxNF",kd="LightBox-module__background___rm9ml",Rd="LightBox-module__editor___4ACaY",Ad="LightBox-module__contentStyle___Bgnsq",Md="LightBox-module__imageStyle___tLIlB",_d="LightBox-module__imgWrapper___LuFUp",Fd="LightBox-module__contain___8-yaS",Wd="LightBox-module__cover___hNvOG",Nd="LightBox-module__caption___b6L2I",Hd="LightBox-module__captionTextInner___rCGNH",Od="LightBox-module__lightboxSplide___XFuWC",Bd="LightBox-module__arrow___iz38X",jd="LightBox-module__arrowVertical___Zfz81",zd="LightBox-module__nextArrow___zkAQN",Vd="LightBox-module__arrowInner___p48sW",Dd="LightBox-module__arrowIcon___3VaFf",qd="LightBox-module__arrowImg___pNV88",Kd="LightBox-module__mirror___pjeXc",Gd="LightBox-module__thumbsWrapper___GB-nU",Ud="LightBox-module__thumbsContainerVertical___wttk5",Xd="LightBox-module__thumbsContainer___osSma",Yd="LightBox-module__thumbsAlignStart___MO6tY",Jd="LightBox-module__thumbsAlignCenter___Q4sUx",Zd="LightBox-module__thumbsAlignEnd___p4y9R",Qd="LightBox-module__thumbItem___HvnF3",eu="LightBox-module__closeButton___g2khP",tu="LightBox-module__fadeIn___0m5GW",nu="LightBox-module__slideInLeft___gPYwC",iu="LightBox-module__slideInRight___S-pPp",ou="LightBox-module__slideInTop___DFdAj",ru="LightBox-module__slideInBottom___m27kZ",au="LightBox-module__fadeOut___55qBR",su="LightBox-module__slideOutLeft___NvU7P",lu="LightBox-module__slideOutRight___SK7eC",cu="LightBox-module__slideOutTop___Vgg0z",du="LightBox-module__slideOutBottom___nJ0Ef",uu="LightBox-module__scaleSlide___vZriG",ve={hidden:Id,heroImage:Pd,background:kd,editor:Rd,contentStyle:Ad,imageStyle:Md,imgWrapper:_d,contain:Fd,cover:Wd,caption:Nd,captionTextInner:Hd,lightboxSplide:Od,arrow:Bd,arrowVertical:jd,nextArrow:zd,arrowInner:Vd,arrowIcon:Dd,arrowImg:qd,mirror:Kd,thumbsWrapper:Gd,thumbsContainerVertical:Ud,thumbsContainer:Xd,thumbsAlignStart:Yd,thumbsAlignCenter:Jd,thumbsAlignEnd:Zd,thumbItem:Qd,closeButton:eu,fadeIn:tu,slideInLeft:nu,slideInRight:iu,slideInTop:ou,slideInBottom:ru,fadeOut:au,slideOutLeft:su,slideOutRight:lu,slideOutTop:cu,slideOutBottom:du,scaleSlide:uu},io=(e,t,n)=>{const i={},[o,s]=e.split("-");return o==="top"?(i.top="0",i.bottom="auto"):o==="middle"?(i.top="50%",i.bottom="auto"):o==="bottom"&&(i.top="auto",i.bottom="0"),s==="left"?(i.left="0",i.right="auto"):s==="center"?(i.left="50%",i.right="auto"):s==="right"&&(i.left="auto",i.right="0"),o==="middle"&&s==="center"?i.transform=`translate(calc(-50% + ${P.scalingValue(t.x,n)}), calc(-50% + ${P.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${P.scalingValue(t.x,n)}, calc(-50% + ${P.scalingValue(t.y,n)}))`:s==="center"?i.transform=`translate(calc(-50% + ${P.scalingValue(t.x,n)}), ${P.scalingValue(t.y,n)})`:i.transform=`translate(${P.scalingValue(t.x,n)}, ${P.scalingValue(t.y,n)})`,i};function Gs(e){const t=window.getComputedStyle(e);return{top:parseFloat(t.paddingTop)||0,right:parseFloat(t.paddingRight)||0,bottom:parseFloat(t.paddingBottom)||0,left:parseFloat(t.paddingLeft)||0}}function Sa(e){const t=e.getBoundingClientRect(),n=Gs(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),s=e.naturalWidth,a=e.naturalHeight,u=i/o,c=s/a;let m,p;c>u?(m=i,p=i/c):(p=o,m=o*c);const b=t.left+n.left,w=t.top+n.top,S=(i-m)/2+b,g=(o-p)/2+w;return{x:S,y:g,width:m,height:p}}function Ca(e){const t=e.getBoundingClientRect(),n=Gs(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Ta(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const i=t[1].split(",").map(o=>parseFloat(o.trim()));return i.length===4?i[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const i=n[1].substring(6,8);return parseInt(i,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function pu(e,t){const n=(()=>{if(e==="fade in")return ve.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return ve.slideInLeft;case"right":return ve.slideInRight;case"top":return ve.slideInTop;case"bottom":return ve.slideInBottom;default:return ve.slideInRight}return ve.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return ve.fadeIn;if(e==="slide in")switch(t){case"left":return ve.slideInLeft;case"right":return ve.slideInRight;case"top":return ve.slideInTop;case"bottom":return ve.slideInBottom;default:return ve.slideInRight}return ve.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return ve.fadeOut;if(e==="slide in")switch(t){case"left":return ve.slideOutLeft;case"right":return ve.slideOutRight;case"top":return ve.slideOutTop;case"bottom":return ve.slideOutBottom;default:return ve.slideOutRight}return ve.fadeOut})(),s=(()=>{if(e==="fade in")return ve.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return ve.slideOutLeft;case"right":return ve.slideOutRight;case"top":return ve.slideOutTop;case"bottom":return ve.slideOutBottom;default:return ve.slideOutRight}return ve.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:s}}const mu=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:s,isPreviewMode:a})=>{const[u,c]=l.useState(!1),{url:m}=e.thumbnailBlock.cover;return l.useEffect(()=>{o==="close"&&c(!1),o==="open"&&c(!0)},[o]),r.jsxs(r.Fragment,{children:[r.jsx("img",{src:m,alt:"Cover",className:ve.heroImage,onClick:()=>c(!0)}),r.jsx(gu,{isOpen:u,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:s})]})},gu=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:s,isEditor:a,metadata:u})=>{var Ie;const{widthSettings:c,fontSettings:m,letterSpacing:p,textAlign:b,wordSpacing:w,fontSizeLineHeight:S,textAppearance:g,color:v}=i.imageCaption??{},[T,$]=l.useState(0),[C,L]=l.useState(0),[A,k]=l.useState(!1),[F,I]=l.useState(!1),[E,J]=l.useState({}),y=l.useRef(null),_=l.useRef(null),W=l.useRef(null),G=l.useRef(!1),te=l.useRef(null),ue=l.useRef(null),X=l.useRef(null),H=l.useRef(null),Q=l.useRef(!1),z=l.useRef(null),[B,Y]=l.useState(!1),{appear:oe,triggers:ie,slider:O,thumbnail:ce,controls:f,area:de,caption:be,layout:fe}=o.lightboxBlock,{appearClass:Re,backdropAppearClass:Z,backdropDisappearClass:ge,disappearClass:U}=pu(oe.type,oe.direction),V=(u==null?void 0:u.itemId)??null;l.useEffect(()=>{const N=()=>{setTimeout(()=>{var R,K;(K=(R=y.current)==null?void 0:R.splide)==null||K.refresh()},16)},ee=()=>{L(R=>R+1)};return window.addEventListener("ArticleEditor.Layout:change",N),window.addEventListener("ArticleEditor.ComponentContent:change",ee),()=>{window.removeEventListener("ArticleEditor.Layout:change",N),window.removeEventListener("ArticleEditor.ComponentContent:change",ee)}},[]),l.useEffect(()=>{if(!e||!ce.isActive){Y(!1);return}const N=z.current;if(!N)return;const ee=()=>{O.direction==="horiz"?Y(N.scrollWidth>N.clientWidth):Y(N.scrollHeight>N.clientHeight)};ee();const R=new ResizeObserver(ee);return R.observe(N),()=>R.disconnect()},[e,ce.isActive,n.length,E,O.direction]);const j=l.useCallback(()=>{const N=window.matchMedia("(max-width: 768px)").matches,ee=Ta(de.color);N&&!a&&ee>.9&&(document.body.style.backgroundColor=""),k(!0),G.current=!0;const R=K=>{K.target===te.current&&K.animationName&&(te.current&&ue.current&&te.current.removeEventListener("animationend",ue.current),ue.current=null,G.current&&(G.current=!1,t()),k(!1))};te.current&&(ue.current=R,te.current.addEventListener("animationend",R))},[t,de.color,a]),he=(N,ee,R)=>{var K,D;if(N){if(ie.type==="click"&&ie.switch==="image")ie.repeat==="close"&&T===n.length-1?j():(K=y.current)==null||K.go("+1");else if(ie.type==="click"&&ie.switch==="50/50"){const ae=N.getBoundingClientRect(),ne=ee-ae.left,ye=R-ae.top,ke=ae.width,Te=ae.height;let xe;O.direction==="horiz"?xe=ne<ke/2?"-1":"+1":xe=ye<Te/2?"-1":"+1",(D=y.current)==null||D.go(xe)}}},re=N=>{if(Q.current){Q.current=!1;return}const ee=n[T],R=(ee==null?void 0:ee.image.objectFit)==="cover";let K,D;if("changedTouches"in N&&N.changedTouches.length>0)K=N.changedTouches[0].clientX,D=N.changedTouches[0].clientY;else if("clientX"in N)K=N.clientX,D=N.clientY;else return;let ae;if(R&&W.current){const ne=Ca(W.current);ae=K>=ne.left&&K<=ne.right&&D>=ne.top&&D<=ne.bottom}else{const ne=W.current?Sa(W.current):null;if(!ne){N.target===N.currentTarget&&j();return}ae=K>=ne.x&&K<=ne.x+ne.width&&D>=ne.y&&D<=ne.y+ne.height}ae?he(W.current,K,D):j()},Ce=N=>{const ee=N.target;(ee.classList.contains(ve.thumbsWrapper)||ee.classList.contains(ve.thumbsContainer))&&re(N)};l.useEffect(()=>{if(!e)return;const N=ee=>{var R,K;if(ee.key==="Escape"){j();return}if(ee.key==="ArrowRight"){$(D=>(D+1)%Math.max(n.length,1)),(R=y.current)==null||R.go("+1");return}ee.key==="ArrowLeft"&&($(D=>(D-1+Math.max(n.length,1))%Math.max(n.length,1)),(K=y.current)==null||K.go("-1"))};return window.addEventListener("keydown",N),()=>{window.removeEventListener("keydown",N)}},[e,j,n.length]),l.useEffect(()=>{if(e){if($(0),L(ee=>ee+1),G.current=!1,k(!1),I(!1),J({}),!V)return;const N=new CustomEvent("page-overlay",{detail:{itemId:V}});window.dispatchEvent(N)}return()=>{te.current&&ue.current&&(te.current.removeEventListener("animationend",ue.current),ue.current=null),I(!1)}},[e,V]),l.useEffect(()=>{_.current!==null&&_.current!==O.type&&L(N=>N+1),_.current=O.type},[O.type]),l.useEffect(()=>{if(!e)return;const N=document.body.style.overflow,ee=window.matchMedia("(max-width: 768px)").matches,R=Ta(de.color);document.body.style.overflow="hidden",I(!1);const K=ae=>{ae.target===te.current&&!G.current&&ae.animationName&&(ee&&!a&&R>.9&&(document.body.style.backgroundColor=de.color),I(!0),te.current&&X.current&&te.current.removeEventListener("animationend",X.current),X.current=null)};te.current&&(X.current=K,te.current.addEventListener("animationend",K));const D=ae=>{const ne=ae.target;ne&&(ne.closest(`.${ve.thumbsWrapper}`)||ne.closest(`.${ve.thumbsContainer}`))||O.type!=="slide"&&ae.preventDefault()};return document.addEventListener("touchmove",D,{passive:!1}),()=>{document.body.style.overflow=N,document.removeEventListener("touchmove",D),te.current&&X.current&&(te.current.removeEventListener("animationend",X.current),X.current=null),I(!1)}},[e,a,de.color,O.type]),l.useEffect(()=>{if(!e)return;const N=ee=>{var K,D;if(G.current){ee.stopPropagation();return}if(Q.current){Q.current=!1;return}const R=ee.target;if(!(R&&(R.closest(`.${ve.thumbsContainer}`)||R.closest(`.${ve.thumbItem}`)||R.closest(`.${ve.arrow}`)||R.closest(`.${ve.closeButton}`)||R.closest(`.${ve.caption}`)))){if(O.type==="slide"&&ie.type==="drag"&&((D=(K=y.current)==null?void 0:K.splide)!=null&&D.root)){const ae=y.current.splide.root;if(R&&(ae.contains(R)||ae===R))return}if(ee.touches.length===0&&ee.changedTouches.length>0){const ae=n[T],ne=(ae==null?void 0:ae.image.objectFit)==="cover",ye=ee.changedTouches[0];let ke;if(ne&&W.current){const Te=Ca(W.current);ke=ye.clientX>=Te.left&&ye.clientX<=Te.right&&ye.clientY>=Te.top&&ye.clientY<=Te.bottom}else{const Te=W.current?Sa(W.current):null;if(!Te)return;ke=ye.clientX>=Te.x&&ye.clientX<=Te.x+Te.width&&ye.clientY>=Te.y&&ye.clientY<=Te.y+Te.height}if(!ke){ee.stopPropagation(),G.current=!0;const Te=xe=>{xe.stopPropagation(),xe.preventDefault(),document.removeEventListener("click",Te,!0)};document.addEventListener("click",Te,!0),j()}}}};return document.addEventListener("touchend",N,{passive:!0}),()=>{document.removeEventListener("touchend",N)}},[e,j,T,n]);const Se=(O.type==="scale"||O.type==="fade")&&O.direction==="vert"&&ie.type==="drag";l.useEffect(()=>{var xe,qe;if(!e||!Se||!((qe=(xe=y.current)==null?void 0:xe.splide)!=null&&qe.root))return;const N=y.current.splide.root,ee=30,R=(se,Ae)=>{if(H.current){const Ne=Math.abs(se-H.current.x),He=Math.abs(Ae-H.current.y);(Ne>0||He>0)&&(Q.current=!0)}},K=se=>{H.current&&(se.preventDefault(),R(se.clientX,se.clientY))},D=se=>{H.current&&se.touches.length>0&&(se.preventDefault(),R(se.touches[0].clientX,se.touches[0].clientY))},ae=(se,Ae)=>{if(!H.current||!y.current){H.current=null;return}const Ne=Math.abs(se-H.current.x),He=Math.abs(Ae-H.current.y);He>ee&&He>Ne&&y.current.go(Ae<H.current.y?"+1":"-1"),H.current=null},ne=se=>{H.current&&ae(se.clientX,se.clientY),document.removeEventListener("pointerup",ne),document.removeEventListener("pointercancel",ne),document.removeEventListener("pointermove",K)},ye=se=>{if(H.current){if(se.changedTouches.length>0){const Ae=se.changedTouches[0];ae(Ae.clientX,Ae.clientY)}document.removeEventListener("touchend",ye),document.removeEventListener("touchcancel",ye),document.removeEventListener("touchmove",D)}},ke=se=>{H.current={x:se.clientX,y:se.clientY},Q.current=!1,document.addEventListener("pointermove",K,{passive:!1}),document.addEventListener("pointerup",ne),document.addEventListener("pointercancel",ne)},Te=se=>{se.touches.length>0&&(H.current={x:se.touches[0].clientX,y:se.touches[0].clientY},Q.current=!1,document.addEventListener("touchmove",D,{passive:!1}),document.addEventListener("touchend",ye),document.addEventListener("touchcancel",ye))};return N.addEventListener("pointerdown",ke),N.addEventListener("touchstart",Te),()=>{N.removeEventListener("pointerdown",ke),N.removeEventListener("touchstart",Te),document.removeEventListener("pointermove",K),document.removeEventListener("pointerup",ne),document.removeEventListener("pointercancel",ne),document.removeEventListener("touchmove",D),document.removeEventListener("touchend",ye),document.removeEventListener("touchcancel",ye),H.current=null,Q.current=!1}},[e,Se,C]);const we={backgroundColor:de.color,backdropFilter:`blur(${de.blur}px)`,animationDuration:`${parseInt(oe.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(s)?null:ji.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:a?null:te,className:ze(ve.background,A?ge:Z,{[ve.editor]:a},{[ve.hidden]:!e}),style:{...we,...F&&!a&&!A?{position:"absolute"}:{}}}),r.jsxs("div",{ref:a?te:null,className:ze(ve.contentStyle,A?U:Re,{[ve.editor]:a},{[ve.hidden]:!e}),style:{animationDuration:`${parseInt(oe.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[r.jsx(Yr,{onMove:N=>$(N.index),ref:y,className:ve.lightboxSplide,options:{arrows:!1,speed:O.duration?parseInt(O.duration):500,direction:O.direction==="horiz"||O.type==="fade"||O.type==="scale"?"ltr":"ttb",pagination:!1,drag:ie.type==="drag"&&!Se,perPage:1,width:"100%",height:"100%",type:O.type==="fade"||O.type==="scale"?"fade":"loop",padding:0,rewind:ie.repeat!=="close",start:0},style:{"--splide-speed":O.duration},children:n.map((N,ee)=>{const R=io(fe.position,fe.offset,a),K=`${P.scalingValue(fe.padding.top,a)} ${P.scalingValue(fe.padding.right,a)} ${P.scalingValue(fe.padding.bottom,a)} ${P.scalingValue(fe.padding.left,a)}`,D=O.type==="scale"?(()=>{const{transform:ae,...ne}=R;return{...ne,position:"absolute",padding:K,boxSizing:"border-box","--position-transform":ae||"none"}})():{...R,position:"absolute",padding:K,boxSizing:"border-box"};return r.jsx(Jr,{children:r.jsx("div",{className:ve.imgWrapper,onClick:re,children:r.jsx("img",{ref:ee===T?W:null,className:ze(ve.imageStyle,{[ve.contain]:N.image.objectFit==="contain",[ve.cover]:N.image.objectFit==="cover",[ve.scaleSlide]:O.type==="scale"}),src:N.image.url,alt:N.image.name??"",style:{...D,pointerEvents:N.image.objectFit==="contain"?"none":"auto"}})})},ee)})},C),f.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:ze(ve.arrow,{[ve.arrowVertical]:O.direction==="vert"}),style:{color:f.color,"--arrow-hover-color":f.hover},children:r.jsxs("button",{className:ve.arrowInner,style:{transform:`translate(${P.scalingValue(f.offset.x,a)}, ${P.scalingValue(f.offset.y*(O.direction==="horiz"?1:-1),a)}) scale(${f.scale}) rotate(${O.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var N;return(N=y.current)==null?void 0:N.go("-1")},"aria-label":"Previous",children:[f.arrowsImgUrl&&r.jsx(Qt,{url:f.arrowsImgUrl,fill:f.color,hoverFill:f.hover,className:ze(ve.arrowImg,ve.mirror)}),!f.arrowsImgUrl&&r.jsx(La,{color:f.color,className:ze(ve.arrowIcon,ve.arrowImg,ve.mirror)})]})}),r.jsx("div",{className:ze(ve.arrow,ve.nextArrow,{[ve.arrowVertical]:O.direction==="vert"}),style:{color:f.color,"--arrow-hover-color":f.hover},children:r.jsxs("button",{className:ve.arrowInner,style:{transform:`translate(${P.scalingValue(f.offset.x*(O.direction==="horiz"?-1:1),a)}, ${P.scalingValue(f.offset.y,a)}) scale(${f.scale}) rotate(${O.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var N;return(N=y.current)==null?void 0:N.go("+1")},"aria-label":"Next",children:[f.arrowsImgUrl&&r.jsx(Qt,{url:f.arrowsImgUrl,fill:f.color,hoverFill:f.hover,className:ve.arrowImg}),!f.arrowsImgUrl&&r.jsx(La,{color:f.color,className:ze(ve.arrowIcon,ve.arrowImg)})]})})]}),de.closeIconUrl&&(()=>{const N=io(de.closeIconAlign,de.closeIconOffset,a),ee=`scale(${de.closeIconScale})`,R=N.transform?`${N.transform} ${ee}`:ee;return r.jsx("button",{className:ve.closeButton,style:{...N,transform:R},onClick:j,"aria-label":"Close lightbox",children:r.jsx(Qt,{url:de.closeIconUrl,fill:de.closeIconColor??"#000000",hoverFill:de.closeIconHover??"#cccccc"})})})(),be&&be.isActive&&i.imageCaption&&((Ie=n[T])==null?void 0:Ie.imageCaption)&&r.jsx("div",{className:ve.caption,style:{...io(be.alignment,be.offset,a),fontFamily:qo(m.fontFamily),fontWeight:m.fontWeight,fontStyle:m.fontStyle,width:c.sizing==="auto"?"max-content":P.scalingValue(c.width,a),letterSpacing:P.scalingValue(p,a),wordSpacing:P.scalingValue(w,a),textAlign:b,fontSize:P.scalingValue(S.fontSize,a),lineHeight:P.scalingValue(S.lineHeight,a),textTransform:g.textTransform??"none",textDecoration:g.textDecoration??"none",fontVariant:g.fontVariant??"normal",color:v},onClick:N=>N.stopPropagation(),children:r.jsx("div",{"data-styles":"imageCaption",className:ve.captionTextInner,style:{"--link-color":be.linkColor,"--link-hover-color":be.linkHoverColor},children:r.jsx(ui,{content:n[T].imageCaption})})}),ce.isActive&&(()=>{const[N,ee]=ce.position.split("-"),R=O.direction==="horiz"?`${N}-left`:ce.position,K=io(R,ce.offset,a),D=()=>{if(O.direction==="horiz"){if(ee==="left")return"flex-start";if(ee==="center")return"center";if(ee==="right")return"flex-end"}else{if(N==="top")return"flex-start";if(N==="middle")return"center";if(N==="bottom")return"flex-end"}return"flex-start"};return r.jsx("div",{ref:z,className:ve.thumbsWrapper,onClick:ae=>Ce(ae),style:{position:a?"absolute":"fixed",...K,...O.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:r.jsx("div",{className:ze(ve.thumbsContainer,{[ve.thumbsContainerVertical]:O.direction==="vert",[ve.thumbsAlignStart]:ce.align==="start",[ve.thumbsAlignCenter]:ce.align==="center",[ve.thumbsAlignEnd]:ce.align==="end"}),style:{gap:P.scalingValue(ce.grid.gap,a),justifyContent:B?"flex-start":D()},children:n.map((ae,ne)=>{const ye=ne===T,ke=E[ne],xe=ce.grid.size*(ye?ce.activeState.scale:1),qe=()=>{if(ce.fit!=="fit")return{};if(!ke)return O.direction==="horiz"?{height:P.scalingValue(xe,a)}:{width:P.scalingValue(xe,a)};const se=ke.width/ke.height;if(O.direction==="horiz"){const Ae=xe,Ne=Ae*se;return{width:P.scalingValue(Ne,a),height:P.scalingValue(Ae,a)}}else{const Ae=xe,Ne=Ae/se;return{width:P.scalingValue(Ae,a),height:P.scalingValue(Ne,a)}}};return r.jsx("button",{className:ve.thumbItem,style:{...O.direction==="horiz"&&ce.fit!=="fit"?{height:P.scalingValue(xe,a)}:{},...O.direction==="vert"&&ce.fit!=="fit"?{width:P.scalingValue(xe,a)}:{},...ce.fit==="cover"?{width:P.scalingValue(xe,a),height:P.scalingValue(xe,a)}:{},...qe(),transition:ye?"all 0.25s ease-out":"none",opacity:ye?ce.activeState.opacity/100:ce.opacity/100,"--thumb-hover":ce.activeState.opacity/100},onClick:se=>{var Ae;se.stopPropagation(),$(ne),(Ae=y.current)==null||Ae.go(ne)},onMouseEnter:()=>{var se;ce.triggers==="hov"&&((se=y.current)==null||se.go(ne))},children:r.jsx("img",{src:ae.image.url,alt:ae.image.name??"",onLoad:se=>{const Ae=se.currentTarget;Ae.naturalWidth&&Ae.naturalHeight&&J(Ne=>({...Ne,[ne]:{width:Ae.naturalWidth,height:Ae.naturalHeight}}))},style:{objectFit:ce.fit==="cover"?"cover":"contain",...ce.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...ce.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${ae.image.name}-${ne}`)})})})})()]})]}),document.getElementById(s))};function La({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.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:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const hu={element:mu,id:"lightbox",name:"Lightbox",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Lightbox.png"},defaultSize:{d:{width:440,height:550},t:{width:235,height:293},m:{width:265,height:331}},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.thumbnailBlock.cover.url",placeholderEnabled:!0},{path:"settings.controls.arrowsImgUrl"},{path:"settings.area.closeIconUrl"}]},schema:{type:"object",properties:{settings:{type:"object",properties:{thumbnailBlock:{display:{type:"settings-block",triggerEvent:"close"},type:"object",properties:{cover:{title:"COVER",icon:"cover",tooltip:"Cover Image",type:"object",properties:{url:{type:"string",display:{type:"cover-image-input"}}}}}},lightboxBlock:{display:{type:"settings-block",triggerEvent:"open"},type:"object",properties:{appear:{title:"APPEAR",icon:"transition",tooltip:"Appearance",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide in","fade in","mix"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]},direction:{type:"string",title:"From",display:{type:"direction-control"},enum:["top","left","right","bottom"]}}},triggers:{title:"TRIGGERS",icon:"target",tooltip:"Triggers",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["click","drag"]},switch:{type:"string",display:{type:"ratio-group"},enum:["image","50/50"]},repeat:{type:"string",title:"Repeat",display:{visible:!1,type:"ratio-group"},enum:["close","loop"]}}},slider:{title:"SLIDER",icon:"horizontal-resize",tooltip:"Slider",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade","scale"]},direction:{type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},thumbnail:{title:"THUMB",icon:"thumbnail",tooltip:"Thumbnail",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},fit:{type:"string",display:{type:"ratio-group"},enum:["cover","fit"]},align:{type:"string",title:"Align",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},triggers:{type:"string",title:"Triggers",display:{type:"ratio-group",direction:"horizontal"},enum:["clk","hov"]},grid:{type:"object",title:"Grid",display:{type:"group"},properties:{size:{type:"number",label:"Box",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},gap:{type:"number",label:"Gap",scalingEnabled:!0,min:0,display:{type:"numeric-input"}}}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}},activeState:{type:"object",title:"ACTIVE",display:{type:"group"},properties:{scale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control"}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}}}}}},layout:{title:"LAYOUT",icon:"layout",tooltip:"Layout",type:"object",properties:{position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},padding:{type:"object",title:"Padding",display:{type:"padding-controls"},properties:{top:{min:0,step:1,type:"number"},left:{min:0,step:1,type:"number"},right:{min:0,step:1,type:"number"},bottom:{min:0,step:1,type:"number"}}}}},controls:{title:"CONTROLS",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},color:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},area:{title:"AREA",icon:"area",tooltip:"Area",type:"object",properties:{color:{type:"string",display:{type:"settings-color-picker",format:"single"}},blur:{type:"number",label:"icon:blur",display:{type:"numeric-input"}},closeIconUrl:{type:["string","null"],title:"Close Icon",display:{type:"settings-image-input"}},closeIconAlign:{display:{type:"align-grid",direction:"horizontal"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},closeIconScale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},closeIconOffset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},closeIconColor:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},closeIconHover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},caption:{title:"DESC",icon:"text-icon",tooltip:"Description",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}}}},default:{d:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"slide in",duration:"1000ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.01,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:0,bottom:.06,left:0}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},linkColor:"#cccccc",linkHoverColor:"#cccccc"}}},m:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"horiz",duration:"1000ms"},thumbnail:{isActive:!0,position:"bottom-center",fit:"fit",align:"start",triggers:"hov",grid:{size:.1,gap:.05},offset:{x:.01,y:-.05},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.05,bottom:.06,left:.05}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}},t:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.03,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.1,bottom:.06,left:.1}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}}},displayRules:[{if:{name:"lightboxBlock.appear.type",value:"slide in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.slider.direction",value:"vert"},then:{name:"properties.lightboxBlock.properties.thumbnail.properties.align.display.direction",value:"vertical"}},{if:{name:"lightboxBlock.appear.type",value:"mix"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.appear.type",value:"fade in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!1}},{if:[{name:"lightboxBlock.triggers.type",value:"click"},{name:"lightboxBlock.triggers.switch",value:"image"}],then:{name:"properties.lightboxBlock.properties.triggers.properties.repeat.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{label:"Description",placeholder:"Add Caption...",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/2.jpg",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/3.jpg",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/4.jpg",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}};function oo(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function fu(e){return`
7
7
  .${e}-wrapper {
8
8
  display: flex;
9
9
  flex-direction: column;
@@ -155,7 +155,7 @@
155
155
  pointer-events: auto;
156
156
  z-index: 10;
157
157
  }
158
- `}function yu({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:s}){const a=!!n,u=i&&t||!t,{prefix:c}=P.useScopedStyles(),{type:m="A",fieldsToShow:p=2,fields:b=[],buttonLabel:w,gap:S,fieldsGap:g,buttonCorners:v,buttonStroke:T,buttonPadding:$,isButtonFullWidth:C,inputCorners:L,inputStroke:A,inputPadding:k,inputColor:F,inputTextColor:I,inputBorderColor:E,placeholderColor:J,buttonColor:y,buttonTextColor:_,buttonBorderColor:W,labelTextColor:G,successColor:te,errorColor:ue,fontFamily:X,inputFontSettings:H,inputFontSize:Q,inputLineHeight:z,inputLetterSpacing:B,inputWordSpacing:Y,inputTextAppearance:oe,buttonFontSettings:ie,buttonFontSize:O,buttonLineHeight:ce,buttonLetterSpacing:f,buttonWordSpacing:de,buttonTextAppearance:be,labelFontSettings:fe,labelFontSize:Re,labelLineHeight:Z,labelLetterSpacing:ge,labelWordSpacing:U,labelTextAppearance:V,statusFontSettings:j,statusFontSize:he,statusLineHeight:re,statusLetterSpacing:Ce,statusWordSpacing:Se,statusTextAppearance:we,successMessage:Ie,errorMessage:N,stateOverrides:ee}=e,R=m==="B",K=b.slice(0,Math.min(p,b.length)),D={fontSettings:{fontFamily:X,fontWeight:(H==null?void 0:H.fontWeight)??400,fontStyle:(H==null?void 0:H.fontStyle)??"normal"},fontSize:Q??.01,lineHeight:z,letterSpacing:B??0,wordSpacing:Y??0,textAppearance:oe,color:I},ae=qt(At(D,t)),ne=P.scalingValue(A??0,t),ye=P.scalingValue((z??Q??.01)+((k==null?void 0:k.top)??0)+((k==null?void 0:k.bottom)??0)+(m==="C"?A??0:(A??0)*2),t),ke={...ae,borderStyle:"solid",borderRadius:m==="C"?0:P.scalingValue(L??0,t),...m==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:ne,borderLeftWidth:0}:{borderWidth:ne},paddingTop:P.scalingValue((k==null?void 0:k.top)??0,t),paddingRight:P.scalingValue((k==null?void 0:k.right)??0,t),paddingBottom:P.scalingValue((k==null?void 0:k.bottom)??0,t),paddingLeft:P.scalingValue((k==null?void 0:k.left)??0,t),height:ye,minHeight:ye},Te={fontSettings:{fontFamily:X,fontWeight:(ie==null?void 0:ie.fontWeight)??400,fontStyle:(ie==null?void 0:ie.fontStyle)??"normal"},fontSize:O??.01,lineHeight:ce,letterSpacing:f??0,wordSpacing:de??0,textAppearance:be,color:_},xe=qt(At(Te,t)),Ke=P.scalingValue(T??0,t),se={fontSettings:{fontFamily:X,fontWeight:(fe==null?void 0:fe.fontWeight)??400,fontStyle:(fe==null?void 0:fe.fontStyle)??"normal"},fontSize:Re??.01,lineHeight:Z,letterSpacing:ge??0,wordSpacing:U??0,textAppearance:V,color:G},Ae=At(se,t),Ne={fontSettings:{fontFamily:X,fontWeight:(j==null?void 0:j.fontWeight)??400,fontStyle:(j==null?void 0:j.fontStyle)??"normal"},fontSize:he??.01,lineHeight:re,letterSpacing:Ce??0,wordSpacing:Se??0,textAppearance:we,color:te},He=qt(At(Ne,t)),dt=P.buildColorVars(c,{inputColor:F,inputTextColor:I,inputBorderColor:E,placeholderColor:J!=null&&J.trim()?J:"#cccccc",buttonColor:y,buttonTextColor:_,buttonBorderColor:W,labelTextColor:G,successColor:te,errorColor:ue},vu,bu,ee),[ft,It]=l.useState(()=>Object.fromEntries(K.map(je=>[je.name,""]))),[xt,wt]=l.useState("idle"),[Ht,Lt]=l.useState(null),Xe=s==="success"?"success":s==="error"?"error":xt,Me=s==="error"?N:Ht,Ve=s==="filled",Ye=l.useMemo(()=>{if(!Ve)return ft;let je=null;for(const gt of K)(ft[gt.name]??"").trim().length>0||(je=je??{...ft},je[gt.name]="Filled");return je??ft},[ft,Ve,K]),Be=Xe==="error"?P.getFormFieldValidationError(K,Ye):null,Pt=`${s&&s!=="default"?`${c}-state-${s}`:""}`.trim(),Qe=o==null?void 0:o.submitUrl,Mt=(je,gt)=>{It(it=>({...it,[je]:gt}))},Ot=async je=>{if(je.preventDefault(),!u)return;const gt=Object.fromEntries(K.map(Ze=>{var rt;return[Ze.name,((rt=ft[Ze.name])==null?void 0:rt.trim())??""]}).filter(([,Ze])=>Ze));if(!Qe){wt("error"),Lt("No integrations were found for this form.");return}if(Object.keys(gt).length===0)return;const it=P.getFormFieldValidationError(K,ft);if(it){wt("error"),Lt(it);return}wt("submitting"),Lt(null);try{const Ze=await fetch(Qe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(gt)});if(!Ze.ok){const rt=await Ze.text();throw new Error(rt||`Request failed: ${Ze.status}`)}wt("success"),It(Object.fromEntries(K.map(rt=>[rt.name,""])))}catch(Ze){wt("error"),Lt(Ze instanceof Error?Ze.message:"Something went wrong")}};return r.jsxs("div",{className:`${c}-wrapper ${c}-type-${m} ${Pt}`.trim(),style:dt,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:fu(c)}}),r.jsxs("form",{onSubmit:Ot,className:`${c}-form`,children:[r.jsx("div",{className:`${c}-fields`,children:K.map((je,gt)=>r.jsxs(l.Fragment,{children:[gt>0&&r.jsx("div",{"data-controls":a?"fieldsGap":void 0,className:a?`${c}-control`:void 0,style:{height:P.scalingValue(g??0,t)}}),r.jsxs("div",{className:`${c}-field-group${R?` ${c}-labeled`:""}`,children:[R&&r.jsx("span",{className:`${c}-field-label`,style:Ae?{...Ae,lineHeight:Ae.fontSize}:void 0,children:je.label||je.name}),je.type==="textarea"?r.jsx("textarea",{name:je.name,autoComplete:"off",value:Ye[je.name]??"",onChange:it=>Mt(je.name,it.target.value),placeholder:je.placeholder,className:`${c}-input`,style:ke,rows:1,"data-filled":Ve||(Ye[je.name]??"").trim().length>0,"data-field-type":"textarea"}):r.jsx("input",{type:je.type==="phone"?"tel":je.type==="email"?"email":"text",name:je.name,autoComplete:"off",value:Ye[je.name]??"",onChange:it=>Mt(je.name,it.target.value),placeholder:je.placeholder,required:je.isRequired??je.type==="email",className:`${c}-input`,style:ke,"data-filled":Ve||(Ye[je.name]??"").trim().length>0})]})]},gt))}),r.jsx("div",{"data-controls":a?"gap":void 0,className:a?`${c}-control`:void 0,style:{height:P.scalingValue(S??0,t)}}),r.jsx("div",{className:`${c}-overlay-anchor`,children:r.jsx("button",{type:u?"submit":"button",className:`${c}-button`,style:{borderStyle:"solid",borderRadius:P.scalingValue(v??0,t),borderWidth:Ke,paddingTop:P.scalingValue(($==null?void 0:$.top)??0,t),paddingRight:P.scalingValue(($==null?void 0:$.right)??0,t),paddingBottom:P.scalingValue(($==null?void 0:$.bottom)??0,t),paddingLeft:P.scalingValue(($==null?void 0:$.left)??0,t),pointerEvents:u?"auto":void 0,...xe,...C?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:r.jsx("span",{className:`${c}-overlay-anchor`,style:C?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:xt==="submitting"?"...":w})})})]}),Xe==="success"&&r.jsx("p",{className:`${c}-success`,style:{...He},children:Ie}),Xe==="error"&&r.jsx("p",{className:`${c}-error`,style:{...He},role:"alert",children:Be??Me??N})]})}const vu={inputColor:"input-color",inputTextColor:"input-text-color",inputBorderColor:"input-border-color",placeholderColor:"placeholder-color",buttonColor:"button-color",buttonTextColor:"button-text-color",buttonBorderColor:"button-border-color",labelTextColor:"label-text-color",successColor:"success-color",errorColor:"error-color"},bu=["hover","focus","filled","success","error"],xu=`import React, { useMemo, useState } from 'react';
158
+ `}function yu({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:s}){const a=!!n,u=i&&t||!t,{prefix:c}=P.useScopedStyles(),{type:m="A",fieldsToShow:p=2,fields:b=[],buttonLabel:w,gap:S,fieldsGap:g,buttonCorners:v,buttonStroke:T,buttonPadding:$,isButtonFullWidth:C,inputCorners:L,inputStroke:A,inputPadding:k,inputColor:F,inputTextColor:I,inputBorderColor:E,placeholderColor:J,buttonColor:y,buttonTextColor:_,buttonBorderColor:W,labelTextColor:G,successColor:te,errorColor:ue,fontFamily:X,inputFontSettings:H,inputFontSize:Q,inputLineHeight:z,inputLetterSpacing:B,inputWordSpacing:Y,inputTextAppearance:oe,buttonFontSettings:ie,buttonFontSize:O,buttonLineHeight:ce,buttonLetterSpacing:f,buttonWordSpacing:de,buttonTextAppearance:be,labelFontSettings:fe,labelFontSize:Re,labelLineHeight:Z,labelLetterSpacing:ge,labelWordSpacing:U,labelTextAppearance:V,statusFontSettings:j,statusFontSize:he,statusLineHeight:re,statusLetterSpacing:Ce,statusWordSpacing:Se,statusTextAppearance:we,successMessage:Ie,errorMessage:N,stateOverrides:ee}=e,R=m==="B",K=b.slice(0,Math.min(p,b.length)),D={fontSettings:{fontFamily:X,fontWeight:(H==null?void 0:H.fontWeight)??400,fontStyle:(H==null?void 0:H.fontStyle)??"normal"},fontSize:Q??.01,lineHeight:z,letterSpacing:B??0,wordSpacing:Y??0,textAppearance:oe,color:I},ae=qt(At(D,t)),ne=P.scalingValue(A??0,t),ye=P.scalingValue((z??Q??.01)+((k==null?void 0:k.top)??0)+((k==null?void 0:k.bottom)??0)+(m==="C"?A??0:(A??0)*2),t),ke={...ae,borderStyle:"solid",borderRadius:m==="C"?0:P.scalingValue(L??0,t),...m==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:ne,borderLeftWidth:0}:{borderWidth:ne},paddingTop:P.scalingValue((k==null?void 0:k.top)??0,t),paddingRight:P.scalingValue((k==null?void 0:k.right)??0,t),paddingBottom:P.scalingValue((k==null?void 0:k.bottom)??0,t),paddingLeft:P.scalingValue((k==null?void 0:k.left)??0,t),height:ye,minHeight:ye},Te={fontSettings:{fontFamily:X,fontWeight:(ie==null?void 0:ie.fontWeight)??400,fontStyle:(ie==null?void 0:ie.fontStyle)??"normal"},fontSize:O??.01,lineHeight:ce,letterSpacing:f??0,wordSpacing:de??0,textAppearance:be,color:_},xe=qt(At(Te,t)),qe=P.scalingValue(T??0,t),se={fontSettings:{fontFamily:X,fontWeight:(fe==null?void 0:fe.fontWeight)??400,fontStyle:(fe==null?void 0:fe.fontStyle)??"normal"},fontSize:Re??.01,lineHeight:Z,letterSpacing:ge??0,wordSpacing:U??0,textAppearance:V,color:G},Ae=At(se,t),Ne={fontSettings:{fontFamily:X,fontWeight:(j==null?void 0:j.fontWeight)??400,fontStyle:(j==null?void 0:j.fontStyle)??"normal"},fontSize:he??.01,lineHeight:re,letterSpacing:Ce??0,wordSpacing:Se??0,textAppearance:we,color:te},He=qt(At(Ne,t)),dt=P.buildColorVars(c,{inputColor:F,inputTextColor:I,inputBorderColor:E,placeholderColor:J!=null&&J.trim()?J:"#cccccc",buttonColor:y,buttonTextColor:_,buttonBorderColor:W,labelTextColor:G,successColor:te,errorColor:ue},vu,bu,ee),[ft,It]=l.useState(()=>Object.fromEntries(K.map(je=>[je.name,""]))),[xt,wt]=l.useState("idle"),[Ht,Lt]=l.useState(null),Xe=s==="success"?"success":s==="error"?"error":xt,Me=s==="error"?N:Ht,Ve=s==="filled",Ye=l.useMemo(()=>{if(!Ve)return ft;let je=null;for(const gt of K)(ft[gt.name]??"").trim().length>0||(je=je??{...ft},je[gt.name]="Filled");return je??ft},[ft,Ve,K]),Be=Xe==="error"?P.getFormFieldValidationError(K,Ye):null,Pt=`${s&&s!=="default"?`${c}-state-${s}`:""}`.trim(),Qe=o==null?void 0:o.submitUrl,Mt=(je,gt)=>{It(it=>({...it,[je]:gt}))},Ot=async je=>{if(je.preventDefault(),!u)return;const gt=Object.fromEntries(K.map(Ze=>{var rt;return[Ze.name,((rt=ft[Ze.name])==null?void 0:rt.trim())??""]}).filter(([,Ze])=>Ze));if(!Qe){wt("error"),Lt("No integrations were found for this form.");return}if(Object.keys(gt).length===0)return;const it=P.getFormFieldValidationError(K,ft);if(it){wt("error"),Lt(it);return}wt("submitting"),Lt(null);try{const Ze=await fetch(Qe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(gt)});if(!Ze.ok){const rt=await Ze.text();throw new Error(rt||`Request failed: ${Ze.status}`)}wt("success"),It(Object.fromEntries(K.map(rt=>[rt.name,""])))}catch(Ze){wt("error"),Lt(Ze instanceof Error?Ze.message:"Something went wrong")}};return r.jsxs("div",{className:`${c}-wrapper ${c}-type-${m} ${Pt}`.trim(),style:dt,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:fu(c)}}),r.jsxs("form",{onSubmit:Ot,className:`${c}-form`,children:[r.jsx("div",{className:`${c}-fields`,children:K.map((je,gt)=>r.jsxs(l.Fragment,{children:[gt>0&&r.jsx("div",{"data-controls":a?"fieldsGap":void 0,className:a?`${c}-control`:void 0,style:{height:P.scalingValue(g??0,t)}}),r.jsxs("div",{className:`${c}-field-group${R?` ${c}-labeled`:""}`,children:[R&&r.jsx("span",{className:`${c}-field-label`,style:Ae?{...Ae,lineHeight:Ae.fontSize}:void 0,children:je.label||je.name}),je.type==="textarea"?r.jsx("textarea",{name:je.name,autoComplete:"off",value:Ye[je.name]??"",onChange:it=>Mt(je.name,it.target.value),placeholder:je.placeholder,className:`${c}-input`,style:ke,rows:1,"data-filled":Ve||(Ye[je.name]??"").trim().length>0,"data-field-type":"textarea"}):r.jsx("input",{type:je.type==="phone"?"tel":je.type==="email"?"email":"text",name:je.name,autoComplete:"off",value:Ye[je.name]??"",onChange:it=>Mt(je.name,it.target.value),placeholder:je.placeholder,required:je.isRequired??je.type==="email",className:`${c}-input`,style:ke,"data-filled":Ve||(Ye[je.name]??"").trim().length>0})]})]},gt))}),r.jsx("div",{"data-controls":a?"gap":void 0,className:a?`${c}-control`:void 0,style:{height:P.scalingValue(S??0,t)}}),r.jsx("div",{className:`${c}-overlay-anchor`,children:r.jsx("button",{type:u?"submit":"button",className:`${c}-button`,style:{borderStyle:"solid",borderRadius:P.scalingValue(v??0,t),borderWidth:qe,paddingTop:P.scalingValue(($==null?void 0:$.top)??0,t),paddingRight:P.scalingValue(($==null?void 0:$.right)??0,t),paddingBottom:P.scalingValue(($==null?void 0:$.bottom)??0,t),paddingLeft:P.scalingValue(($==null?void 0:$.left)??0,t),pointerEvents:u?"auto":void 0,...xe,...C?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:r.jsx("span",{className:`${c}-overlay-anchor`,style:C?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:xt==="submitting"?"...":w})})})]}),Xe==="success"&&r.jsx("p",{className:`${c}-success`,style:{...He},children:Ie}),Xe==="error"&&r.jsx("p",{className:`${c}-error`,style:{...He},role:"alert",children:Be??Me??N})]})}const vu={inputColor:"input-color",inputTextColor:"input-text-color",inputBorderColor:"input-border-color",placeholderColor:"placeholder-color",buttonColor:"button-color",buttonTextColor:"button-text-color",buttonBorderColor:"button-border-color",labelTextColor:"label-text-color",successColor:"success-color",errorColor:"error-color"},bu=["hover","focus","filled","success","error"],xu=`import React, { useMemo, useState } from 'react';
159
159
  import { CommonComponentProps } from '../props';
160
160
  import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
161
161
  import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
@@ -980,7 +980,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
980
980
  font-size: ${ao(14)};
981
981
  color: var(--${e}-error-error-color, var(--${e}-error-color));
982
982
  }
983
- `}const Lu=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:s}=P.useScopedStyles(),a=n&&t||!t,{fields:u=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:c,buttonLabel:m,fieldsToShow:p=1,fontFamily:b,inputFontSettings:w,inputFontSize:S,inputLineHeight:g,inputLetterSpacing:v,inputWordSpacing:T,inputTextAppearance:$,buttonFontSettings:C,buttonFontSize:L,buttonLineHeight:A,buttonLetterSpacing:k,buttonWordSpacing:F,buttonTextAppearance:I,statusFontSettings:E,statusFontSize:J,statusLineHeight:y,statusLetterSpacing:_,statusWordSpacing:W,statusTextAppearance:G,iconMaxWidth:te,minHeight:ue,corners:X,stroke:H,stateOverrides:Q,inputPadding:z,buttonPadding:B,successMessage:Y="Thanks for subscribing!",errorMessage:oe="Please, fill all required fields."}=e,ie=u.slice(0,Math.min(p,u.length)),[O,ce]=l.useState(()=>Object.fromEntries(ie.map(se=>[se.name,""]))),[f,de]=l.useState("idle"),[be,fe]=l.useState(null),Re=o==="success"?"success":o==="error"?"error":f,Z=o==="error"?oe:be,ge=o==="filled",U=l.useMemo(()=>{if(!ge)return O;let se=null;for(const Ae of ie)(O[Ae.name]??"").trim().length>0||(se=se??{...O},se[Ae.name]="Filled");return se??O},[ge,O,ie]),V=Re==="error"?P.getFormFieldValidationError(ie,U):null,j=o&&o!=="default"?`${s}-state-${o}`:"",he=ie.some(se=>(U[se.name]??"").trim().length>0),re=j!==`${s}-state-filled`&&he?`${s}-state-filled`:"",Ce=`${j} ${re}`.trim(),Se=i==null?void 0:i.submitUrl,we=m??"",Ie=(c==null?void 0:c.icon)??"",N=(c==null?void 0:c.mode)==="On",ee=we||"Submit",R={fontSettings:{fontFamily:b,fontWeight:(w==null?void 0:w.fontWeight)??400,fontStyle:(w==null?void 0:w.fontStyle)??"normal"},fontSize:S??.01,lineHeight:g,letterSpacing:v??0,wordSpacing:T??0,textAppearance:$,color:e.inputTextColor??"#111111"},K={fontSettings:{fontFamily:b,fontWeight:(C==null?void 0:C.fontWeight)??400,fontStyle:(C==null?void 0:C.fontStyle)??"normal"},fontSize:L??.01,lineHeight:A,letterSpacing:k??0,wordSpacing:F??0,textAppearance:I,color:e.buttonTextColor??"#ffffff"},D={fontSettings:{fontFamily:b,fontWeight:(E==null?void 0:E.fontWeight)??400,fontStyle:(E==null?void 0:E.fontStyle)??"normal"},fontSize:J??.01,lineHeight:y,letterSpacing:_??0,wordSpacing:W??0,textAppearance:G,color:e.successColor??"#22c55e"},ae=qt(At(R,t)),ne=qt(At(K,t)),ye=qt(At(D,t)),ke=P.buildColorVars(s,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(R==null?void 0:R.color)??"#111111",buttonTextColor:e.buttonTextColor??(K==null?void 0:K.color)??"#ffffff"},Eu,Iu,Q),Te={borderRadius:P.scalingValue(X,t),borderWidth:P.scalingValue(H,t),borderStyle:"solid"},xe={borderLeftWidth:P.scalingValue(H,t)},Ke=async se=>{if(se.preventDefault(),!a)return;const Ae=Object.fromEntries(ie.map(He=>{var dt;return[He.name,((dt=O[He.name])==null?void 0:dt.trim())??""]}).filter(([,He])=>He));if(!Se){de("error"),fe("No integrations were found for this form.");return}if(Object.keys(Ae).length===0)return;const Ne=P.getFormFieldValidationError(ie,O);if(Ne){de("error"),fe(Ne);return}de("submitting"),fe(null);try{const He=await fetch(Se,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ae)});if(!He.ok){const dt=await He.text();throw new Error(dt||`Request failed: ${He.status}`)}de("success"),ce(Object.fromEntries(ie.map(dt=>[dt.name,""])))}catch(He){de("error"),fe(He instanceof Error?He.message:"Something went wrong")}};return r.jsxs("div",{className:`${s}-wrapper ${Ce}`.trim(),style:ke,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Tu(s)}}),r.jsxs("form",{onSubmit:Ke,className:`${s}-form`,style:{...Te,height:P.scalingValue(ue,t),minHeight:P.scalingValue(ue,t)},children:[r.jsx("div",{className:`${s}-inputWrap ${s}-overlayAnchor`,style:{flex:1,minWidth:0},children:ie.map(se=>r.jsx("input",{type:se.type==="email"?"email":se.type==="phone"?"tel":"text",name:se.name,autoComplete:"off",value:U[se.name]??"",onChange:Ae=>ce(Ne=>({...Ne,[se.name]:Ae.target.value})),placeholder:se.placeholder,required:se.isRequired??se.type==="email",className:`${s}-input`,style:{...ae,paddingRight:P.scalingValue(z.right,t),paddingLeft:P.scalingValue(z.left,t),paddingTop:P.scalingValue(z.top,t),paddingBottom:P.scalingValue(z.bottom,t)}},se.name))}),r.jsx("div",{className:`${s}-overlayAnchor`,children:r.jsx("button",{type:a?"submit":"button",className:`${s}-submitBtn`,"aria-label":ee,style:{...ne,...xe,paddingRight:P.scalingValue(B.right,t),paddingLeft:P.scalingValue(B.left,t),paddingTop:P.scalingValue(B.top,t),paddingBottom:P.scalingValue(B.bottom,t),pointerEvents:a?"auto":void 0},children:f==="submitting"?"...":N?Ie&&r.jsx(Qt,{url:Ie,className:`${s}-submitBtnIcon`,style:{maxWidth:P.scalingValue(te??0,t)},fill:`var(--${s}-button-text-color)`,hoverFill:`var(--${s}-button-text-color)`}):we})})]}),Re==="success"&&r.jsx("p",{className:`${s}-success`,style:{...ye},children:Y}),Re==="error"&&r.jsx("p",{className:`${s}-error`,style:{...ye},role:"alert",children:V??Z??oe})]})},Eu={strokeColor:"stroke-color",inputColor:"input-color",placeholderColor:"placeholder-color",buttonColor:"button-color",inputTextColor:"input-text-color",buttonTextColor:"button-text-color",successColor:"success-color",errorColor:"error-color"},Iu=["hover","focus","filled","success","error"],Pu=`import React, { useMemo, useState } from 'react';
983
+ `}const Lu=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:s}=P.useScopedStyles(),a=n&&t||!t,{fields:u=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:c,buttonLabel:m,fieldsToShow:p=1,fontFamily:b,inputFontSettings:w,inputFontSize:S,inputLineHeight:g,inputLetterSpacing:v,inputWordSpacing:T,inputTextAppearance:$,buttonFontSettings:C,buttonFontSize:L,buttonLineHeight:A,buttonLetterSpacing:k,buttonWordSpacing:F,buttonTextAppearance:I,statusFontSettings:E,statusFontSize:J,statusLineHeight:y,statusLetterSpacing:_,statusWordSpacing:W,statusTextAppearance:G,iconMaxWidth:te,minHeight:ue,corners:X,stroke:H,stateOverrides:Q,inputPadding:z,buttonPadding:B,successMessage:Y="Thanks for subscribing!",errorMessage:oe="Please, fill all required fields."}=e,ie=u.slice(0,Math.min(p,u.length)),[O,ce]=l.useState(()=>Object.fromEntries(ie.map(se=>[se.name,""]))),[f,de]=l.useState("idle"),[be,fe]=l.useState(null),Re=o==="success"?"success":o==="error"?"error":f,Z=o==="error"?oe:be,ge=o==="filled",U=l.useMemo(()=>{if(!ge)return O;let se=null;for(const Ae of ie)(O[Ae.name]??"").trim().length>0||(se=se??{...O},se[Ae.name]="Filled");return se??O},[ge,O,ie]),V=Re==="error"?P.getFormFieldValidationError(ie,U):null,j=o&&o!=="default"?`${s}-state-${o}`:"",he=ie.some(se=>(U[se.name]??"").trim().length>0),re=j!==`${s}-state-filled`&&he?`${s}-state-filled`:"",Ce=`${j} ${re}`.trim(),Se=i==null?void 0:i.submitUrl,we=m??"",Ie=(c==null?void 0:c.icon)??"",N=(c==null?void 0:c.mode)==="On",ee=we||"Submit",R={fontSettings:{fontFamily:b,fontWeight:(w==null?void 0:w.fontWeight)??400,fontStyle:(w==null?void 0:w.fontStyle)??"normal"},fontSize:S??.01,lineHeight:g,letterSpacing:v??0,wordSpacing:T??0,textAppearance:$,color:e.inputTextColor??"#111111"},K={fontSettings:{fontFamily:b,fontWeight:(C==null?void 0:C.fontWeight)??400,fontStyle:(C==null?void 0:C.fontStyle)??"normal"},fontSize:L??.01,lineHeight:A,letterSpacing:k??0,wordSpacing:F??0,textAppearance:I,color:e.buttonTextColor??"#ffffff"},D={fontSettings:{fontFamily:b,fontWeight:(E==null?void 0:E.fontWeight)??400,fontStyle:(E==null?void 0:E.fontStyle)??"normal"},fontSize:J??.01,lineHeight:y,letterSpacing:_??0,wordSpacing:W??0,textAppearance:G,color:e.successColor??"#22c55e"},ae=qt(At(R,t)),ne=qt(At(K,t)),ye=qt(At(D,t)),ke=P.buildColorVars(s,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(R==null?void 0:R.color)??"#111111",buttonTextColor:e.buttonTextColor??(K==null?void 0:K.color)??"#ffffff"},Eu,Iu,Q),Te={borderRadius:P.scalingValue(X,t),borderWidth:P.scalingValue(H,t),borderStyle:"solid"},xe={borderLeftWidth:P.scalingValue(H,t)},qe=async se=>{if(se.preventDefault(),!a)return;const Ae=Object.fromEntries(ie.map(He=>{var dt;return[He.name,((dt=O[He.name])==null?void 0:dt.trim())??""]}).filter(([,He])=>He));if(!Se){de("error"),fe("No integrations were found for this form.");return}if(Object.keys(Ae).length===0)return;const Ne=P.getFormFieldValidationError(ie,O);if(Ne){de("error"),fe(Ne);return}de("submitting"),fe(null);try{const He=await fetch(Se,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ae)});if(!He.ok){const dt=await He.text();throw new Error(dt||`Request failed: ${He.status}`)}de("success"),ce(Object.fromEntries(ie.map(dt=>[dt.name,""])))}catch(He){de("error"),fe(He instanceof Error?He.message:"Something went wrong")}};return r.jsxs("div",{className:`${s}-wrapper ${Ce}`.trim(),style:ke,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Tu(s)}}),r.jsxs("form",{onSubmit:qe,className:`${s}-form`,style:{...Te,height:P.scalingValue(ue,t),minHeight:P.scalingValue(ue,t)},children:[r.jsx("div",{className:`${s}-inputWrap ${s}-overlayAnchor`,style:{flex:1,minWidth:0},children:ie.map(se=>r.jsx("input",{type:se.type==="email"?"email":se.type==="phone"?"tel":"text",name:se.name,autoComplete:"off",value:U[se.name]??"",onChange:Ae=>ce(Ne=>({...Ne,[se.name]:Ae.target.value})),placeholder:se.placeholder,required:se.isRequired??se.type==="email",className:`${s}-input`,style:{...ae,paddingRight:P.scalingValue(z.right,t),paddingLeft:P.scalingValue(z.left,t),paddingTop:P.scalingValue(z.top,t),paddingBottom:P.scalingValue(z.bottom,t)}},se.name))}),r.jsx("div",{className:`${s}-overlayAnchor`,children:r.jsx("button",{type:a?"submit":"button",className:`${s}-submitBtn`,"aria-label":ee,style:{...ne,...xe,paddingRight:P.scalingValue(B.right,t),paddingLeft:P.scalingValue(B.left,t),paddingTop:P.scalingValue(B.top,t),paddingBottom:P.scalingValue(B.bottom,t),pointerEvents:a?"auto":void 0},children:f==="submitting"?"...":N?Ie&&r.jsx(Qt,{url:Ie,className:`${s}-submitBtnIcon`,style:{maxWidth:P.scalingValue(te??0,t)},fill:`var(--${s}-button-text-color)`,hoverFill:`var(--${s}-button-text-color)`}):we})})]}),Re==="success"&&r.jsx("p",{className:`${s}-success`,style:{...ye},children:Y}),Re==="error"&&r.jsx("p",{className:`${s}-error`,style:{...ye},role:"alert",children:V??Z??oe})]})},Eu={strokeColor:"stroke-color",inputColor:"input-color",placeholderColor:"placeholder-color",buttonColor:"button-color",inputTextColor:"input-text-color",buttonTextColor:"button-text-color",successColor:"success-color",errorColor:"error-color"},Iu=["hover","focus","filled","success","error"],Pu=`import React, { useMemo, useState } from 'react';
984
984
  import { CommonComponentProps } from '../props';
985
985
  import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
986
986
  import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
@@ -2416,7 +2416,7 @@ type MarqueeProps = {
2416
2416
  pointer-events: auto;
2417
2417
  z-index: 10;
2418
2418
  }
2419
- `}const Gu=30,Ia=2,Uu=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:s}=P.useScopedStyles(),{align:a,speed:u,direction:c,pauseOnHover:m,gap:p,cardWidth:b,corners:w,stroke:S,strokeColor:g,bgColor:v,padding:T,logoMarginTop:$,logoWidth:C,logoHeight:L,captionMarginTop:A}=e,k=!!o,F=((t==null?void 0:t.length)??0)>0,I=u>0&&(!n||i),E=F&&(I||n),J=Math.max(0,u)*Gu,y=R=>P.scalingValue(R,n??!1),_=l.useRef(null),W=l.useRef(null),G=l.useRef(null),[te,ue]=l.useState(0),[X,H]=l.useState(0),[Q,z]=l.useState(0),B=I&&m==="on",[Y,oe]=l.useState(!1),ie=l.useRef(null),[O,ce]=l.useState(0),[f,de]=l.useState(0),be=l.useRef(null),fe=R=>{var D,ae,ne,ye,ke;return{fontSettings:{fontFamily:(e==null?void 0:e[`${R}FontFamily`])??"Arial",fontWeight:((D=e==null?void 0:e[`${R}FontSettings`])==null?void 0:D.fontWeight)??400,fontStyle:((ae=e==null?void 0:e[`${R}FontSettings`])==null?void 0:ae.fontStyle)??"normal"},textAppearance:{textTransform:((ne=e==null?void 0:e[`${R}TextAppearance`])==null?void 0:ne.textTransform)??"none",textDecoration:((ye=e==null?void 0:e[`${R}TextAppearance`])==null?void 0:ye.textDecoration)??"none",fontVariant:((ke=e==null?void 0:e[`${R}TextAppearance`])==null?void 0:ke.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${R}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${R}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${R}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${R}LineHeight`])??.01,color:(e==null?void 0:e[`${R}Color`])??"#000000"}},Re=fe("text"),Z=fe("caption"),ge=l.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(R=>{var K,D;return(((K=R.text)==null?void 0:K.length)??0)>0||(((D=R.caption)==null?void 0:D.length)??0)>0}),[t]),U=l.useMemo(()=>!E||(t==null?void 0:t.length)===0?1:X<=0||te<=0?Ia:Math.max(Ia,Math.ceil(te/X)+1),[E,t==null?void 0:t.length,X,te]);l.useLayoutEffect(()=>{if(!E)return;const R=_.current,K=G.current;if(!R||!K)return;let D=0;const ae=()=>{const ke=R.getBoundingClientRect().width,Te=K.getBoundingClientRect().width,xe=be.current,Ke=typeof xe=="number"&&Math.abs(xe-Te)<=.25;if(be.current=Te,ue(ke),typeof Te=="number"&&Te>0&&X<=0){H(Te);return}Ke&&Te!==X?H(Te):!Ke&&X<=0&&(cancelAnimationFrame(D),D=requestAnimationFrame(ae))},ne=()=>{cancelAnimationFrame(D),D=requestAnimationFrame(ae)};ne();const ye=new ResizeObserver(ne);return ye.observe(R),ye.observe(K),()=>{cancelAnimationFrame(D),ye.disconnect()}},[I,E,X]),l.useLayoutEffect(()=>{const R=W.current;if(!E||!R)return;const K=X>0?X:0,D=K>0&&J>0?K/J*1e3:0,ae=`${Math.max(0,D)/1e3}s`;R.style.setProperty("--marquee-distance",`${K}px`),R.style.setProperty("--marquee-duration",ae)},[I,E,J,X]),l.useLayoutEffect(()=>{if(!E){z(0);return}const R=G.current,K=W.current;if(!R||!K)return;const D=()=>{let ne=0;for(let ye=0;ye<R.children.length;ye++){const Te=R.children[ye].firstElementChild;Te&&(ne=Math.max(ne,Te.offsetHeight))}ne<=0&&(ne=K.offsetHeight),z(ne>0?ne:0)};D();const ae=new ResizeObserver(D);return ae.observe(R),ae.observe(K),()=>{ae.disconnect()}},[E,U,t,n,p,b,T,S,w,C,L,O,f]);const V=()=>{B&&oe(!0)},j=()=>{B&&oe(!1)},he=l.useMemo(()=>{switch(a){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[a]),re=l.useMemo(()=>{switch(a){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[a]),Ce=l.useCallback((R,K,D,ae)=>r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:he,width:"100%"},children:[r.jsx("div",{"data-controls":k?ae==null?void 0:ae.controlsName:void 0,"data-controls-axis":k?"y":void 0,className:k?`${s}-control`:void 0,style:{height:y((ae==null?void 0:ae.marginTop)??0)}}),r.jsx("div",{...ae!=null&&ae.dataMeasureKind?{"data-testimonial-measure":ae.dataMeasureKind}:{},style:{...At(R,n),textAlign:re,pointerEvents:"auto",...typeof(ae==null?void 0:ae.minHeightPx)=="number"&&ae.minHeightPx>0?{minHeight:ae.minHeightPx}:{}},children:r.jsx(ui,{content:K})})]},D),[he,re,n,k,s,y]),Se=l.useCallback((R,K,D)=>{var ae,ne,ye;return r.jsxs("div",{style:{padding:`${y(T.top)} ${y(T.right)} ${y(T.bottom)} ${y(T.left)}`,width:y(b+S*2),height:"100%",borderRadius:y(w),border:`${y(S)} solid ${g}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[r.jsx("div",{className:`${s}-cover`,style:{background:v}}),r.jsxs("div",{className:`${s}-elements-overlay`,style:{alignItems:he,textAlign:re},children:[R.text&&Ce(Re,R.text,"text",D!=null&&D.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(D==null?void 0:D.textMinHeightPx)=="number"&&D.textMinHeightPx>0?{minHeightPx:D.textMinHeightPx}:void 0),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:he,width:"100%"},children:[r.jsx("div",{"data-controls":k&&!(D!=null&&D.dataMeasureAttrs)?"logoMarginTop":void 0,className:k&&!(D!=null&&D.dataMeasureAttrs)?`${s}-control`:void 0,style:{height:y($)}}),r.jsx("div",{style:{width:y(C),height:y(L)},children:((ae=R.logo)==null?void 0:ae.url)&&r.jsx("img",{src:R.logo.url,alt:((ne=R.logo)==null?void 0:ne.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((ye=R.logo)==null?void 0:ye.objectFit)||"contain"}})})]}),R.caption&&Ce(Z,R.caption,"caption",{...D!=null&&D.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:A,...D!=null&&D.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(D==null?void 0:D.captionMinHeightPx)=="number"&&D.captionMinHeightPx>0?{minHeightPx:D.captionMinHeightPx}:{}})]})]},K)},[v,A,Z,b,w,L,$,C,he,re,T.bottom,T.left,T.right,T.top,Ce,S,g,Re,n,k,s]),we=l.useCallback(R=>{ce(R.maxTextPx),de(R.maxCaptionPx)},[]);l.useLayoutEffect(()=>{if(!ge){we({maxTextPx:0,maxCaptionPx:0});return}const R=ie.current;if(!R)return;const K=()=>{P.readTestimonialTextMeasure(R,we)};K();const D=new ResizeObserver(K);return D.observe(R),()=>{D.disconnect()}},[ge,we,t,Se]);const Ie=ge?{textMinHeightPx:O,captionMinHeightPx:f}:void 0,N=ge?r.jsx("div",{ref:ie,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((R,K)=>Se(R,`measure-${K}`,{dataMeasureAttrs:!0}))}):null,ee=(R,K)=>r.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[Se(R,`card-${K}`,Ie),k&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${y(p)})`,width:y(p),height:"100%",pointerEvents:"auto",zIndex:2}})]},K);if(E){const R=I?B&&Y?"paused":"running":"paused";return r.jsxs("div",{ref:_,className:ze(`${s}-wrapper`,`${s}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...Q>0?{height:Q}:{}},children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Ea(s)}}),N,r.jsx("div",{ref:W,className:`${s}-marquee-track`,"data-direction":c,onMouseEnter:V,onMouseLeave:j,style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",width:"max-content",willChange:"transform",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",perspective:"1000px","--marquee-play-state":R},children:Array.from({length:U},(K,D)=>r.jsx("div",{ref:D===0?G:void 0,className:`${s}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:y(p),paddingRight:y(p)},"aria-hidden":D>0,children:t==null?void 0:t.map((ae,ne)=>ee(ae,`${D}-${ne}`))},`set-${D}`))})]})}return r.jsxs("div",{className:`${s}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Ea(s)}}),N,r.jsx("div",{style:{gap:y(p),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((R,K)=>ee(R,K))})]})},Xu=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
2419
+ `}const Gu=30,Ia=2,Uu=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:s}=P.useScopedStyles(),{align:a,speed:u,direction:c,pauseOnHover:m,gap:p,cardWidth:b,corners:w,stroke:S,strokeColor:g,bgColor:v,padding:T,logoMarginTop:$,logoWidth:C,logoHeight:L,captionMarginTop:A}=e,k=!!o,F=((t==null?void 0:t.length)??0)>0,I=u>0&&(!n||i),E=F&&(I||n),J=Math.max(0,u)*Gu,y=R=>P.scalingValue(R,n??!1),_=l.useRef(null),W=l.useRef(null),G=l.useRef(null),[te,ue]=l.useState(0),[X,H]=l.useState(0),[Q,z]=l.useState(0),B=I&&m==="on",[Y,oe]=l.useState(!1),ie=l.useRef(null),[O,ce]=l.useState(0),[f,de]=l.useState(0),be=l.useRef(null),fe=R=>{var D,ae,ne,ye,ke;return{fontSettings:{fontFamily:(e==null?void 0:e[`${R}FontFamily`])??"Arial",fontWeight:((D=e==null?void 0:e[`${R}FontSettings`])==null?void 0:D.fontWeight)??400,fontStyle:((ae=e==null?void 0:e[`${R}FontSettings`])==null?void 0:ae.fontStyle)??"normal"},textAppearance:{textTransform:((ne=e==null?void 0:e[`${R}TextAppearance`])==null?void 0:ne.textTransform)??"none",textDecoration:((ye=e==null?void 0:e[`${R}TextAppearance`])==null?void 0:ye.textDecoration)??"none",fontVariant:((ke=e==null?void 0:e[`${R}TextAppearance`])==null?void 0:ke.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${R}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${R}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${R}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${R}LineHeight`])??.01,color:(e==null?void 0:e[`${R}Color`])??"#000000"}},Re=fe("text"),Z=fe("caption"),ge=l.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(R=>{var K,D;return(((K=R.text)==null?void 0:K.length)??0)>0||(((D=R.caption)==null?void 0:D.length)??0)>0}),[t]),U=l.useMemo(()=>!E||(t==null?void 0:t.length)===0?1:X<=0||te<=0?Ia:Math.max(Ia,Math.ceil(te/X)+1),[E,t==null?void 0:t.length,X,te]);l.useLayoutEffect(()=>{if(!E)return;const R=_.current,K=G.current;if(!R||!K)return;let D=0;const ae=()=>{const ke=R.getBoundingClientRect().width,Te=K.getBoundingClientRect().width,xe=be.current,qe=typeof xe=="number"&&Math.abs(xe-Te)<=.25;if(be.current=Te,ue(ke),typeof Te=="number"&&Te>0&&X<=0){H(Te);return}qe&&Te!==X?H(Te):!qe&&X<=0&&(cancelAnimationFrame(D),D=requestAnimationFrame(ae))},ne=()=>{cancelAnimationFrame(D),D=requestAnimationFrame(ae)};ne();const ye=new ResizeObserver(ne);return ye.observe(R),ye.observe(K),()=>{cancelAnimationFrame(D),ye.disconnect()}},[I,E,X]),l.useLayoutEffect(()=>{const R=W.current;if(!E||!R)return;const K=X>0?X:0,D=K>0&&J>0?K/J*1e3:0,ae=`${Math.max(0,D)/1e3}s`;R.style.setProperty("--marquee-distance",`${K}px`),R.style.setProperty("--marquee-duration",ae)},[I,E,J,X]),l.useLayoutEffect(()=>{if(!E){z(0);return}const R=G.current,K=W.current;if(!R||!K)return;const D=()=>{let ne=0;for(let ye=0;ye<R.children.length;ye++){const Te=R.children[ye].firstElementChild;Te&&(ne=Math.max(ne,Te.offsetHeight))}ne<=0&&(ne=K.offsetHeight),z(ne>0?ne:0)};D();const ae=new ResizeObserver(D);return ae.observe(R),ae.observe(K),()=>{ae.disconnect()}},[E,U,t,n,p,b,T,S,w,C,L,O,f]);const V=()=>{B&&oe(!0)},j=()=>{B&&oe(!1)},he=l.useMemo(()=>{switch(a){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[a]),re=l.useMemo(()=>{switch(a){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[a]),Ce=l.useCallback((R,K,D,ae)=>r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:he,width:"100%"},children:[r.jsx("div",{"data-controls":k?ae==null?void 0:ae.controlsName:void 0,"data-controls-axis":k?"y":void 0,className:k?`${s}-control`:void 0,style:{height:y((ae==null?void 0:ae.marginTop)??0)}}),r.jsx("div",{...ae!=null&&ae.dataMeasureKind?{"data-testimonial-measure":ae.dataMeasureKind}:{},style:{...At(R,n),textAlign:re,pointerEvents:"auto",...typeof(ae==null?void 0:ae.minHeightPx)=="number"&&ae.minHeightPx>0?{minHeight:ae.minHeightPx}:{}},children:r.jsx(ui,{content:K})})]},D),[he,re,n,k,s,y]),Se=l.useCallback((R,K,D)=>{var ae,ne,ye;return r.jsxs("div",{style:{padding:`${y(T.top)} ${y(T.right)} ${y(T.bottom)} ${y(T.left)}`,width:y(b+S*2),height:"100%",borderRadius:y(w),border:`${y(S)} solid ${g}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[r.jsx("div",{className:`${s}-cover`,style:{background:v}}),r.jsxs("div",{className:`${s}-elements-overlay`,style:{alignItems:he,textAlign:re},children:[R.text&&Ce(Re,R.text,"text",D!=null&&D.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(D==null?void 0:D.textMinHeightPx)=="number"&&D.textMinHeightPx>0?{minHeightPx:D.textMinHeightPx}:void 0),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:he,width:"100%"},children:[r.jsx("div",{"data-controls":k&&!(D!=null&&D.dataMeasureAttrs)?"logoMarginTop":void 0,className:k&&!(D!=null&&D.dataMeasureAttrs)?`${s}-control`:void 0,style:{height:y($)}}),r.jsx("div",{style:{width:y(C),height:y(L)},children:((ae=R.logo)==null?void 0:ae.url)&&r.jsx("img",{src:R.logo.url,alt:((ne=R.logo)==null?void 0:ne.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((ye=R.logo)==null?void 0:ye.objectFit)||"contain"}})})]}),R.caption&&Ce(Z,R.caption,"caption",{...D!=null&&D.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:A,...D!=null&&D.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(D==null?void 0:D.captionMinHeightPx)=="number"&&D.captionMinHeightPx>0?{minHeightPx:D.captionMinHeightPx}:{}})]})]},K)},[v,A,Z,b,w,L,$,C,he,re,T.bottom,T.left,T.right,T.top,Ce,S,g,Re,n,k,s]),we=l.useCallback(R=>{ce(R.maxTextPx),de(R.maxCaptionPx)},[]);l.useLayoutEffect(()=>{if(!ge){we({maxTextPx:0,maxCaptionPx:0});return}const R=ie.current;if(!R)return;const K=()=>{P.readTestimonialTextMeasure(R,we)};K();const D=new ResizeObserver(K);return D.observe(R),()=>{D.disconnect()}},[ge,we,t,Se]);const Ie=ge?{textMinHeightPx:O,captionMinHeightPx:f}:void 0,N=ge?r.jsx("div",{ref:ie,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((R,K)=>Se(R,`measure-${K}`,{dataMeasureAttrs:!0}))}):null,ee=(R,K)=>r.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[Se(R,`card-${K}`,Ie),k&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${y(p)})`,width:y(p),height:"100%",pointerEvents:"auto",zIndex:2}})]},K);if(E){const R=I?B&&Y?"paused":"running":"paused";return r.jsxs("div",{ref:_,className:ze(`${s}-wrapper`,`${s}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...Q>0?{height:Q}:{}},children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Ea(s)}}),N,r.jsx("div",{ref:W,className:`${s}-marquee-track`,"data-direction":c,onMouseEnter:V,onMouseLeave:j,style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",width:"max-content",willChange:"transform",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",perspective:"1000px","--marquee-play-state":R},children:Array.from({length:U},(K,D)=>r.jsx("div",{ref:D===0?G:void 0,className:`${s}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:y(p),paddingRight:y(p)},"aria-hidden":D>0,children:t==null?void 0:t.map((ae,ne)=>ee(ae,`${D}-${ne}`))},`set-${D}`))})]})}return r.jsxs("div",{className:`${s}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Ea(s)}}),N,r.jsx("div",{style:{gap:y(p),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((R,K)=>ee(R,K))})]})},Xu=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
2420
2420
  import cn from 'classnames';
2421
2421
  import { CommonComponentProps } from '../props';
2422
2422
  import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
@@ -3992,7 +3992,7 @@ type TestimonialsSettings = {
3992
3992
  pointer-events: auto;
3993
3993
  z-index: 10;
3994
3994
  }
3995
- `}const pn=500,sp=750,On="cubic-bezier(0.22, 1, 0.36, 1)",lp=72,cp=50;function dp(e){if(!Array.isArray(e)||e.length===0)return!1;const t=e[0];return t!==null&&typeof t=="object"&&"media"in t&&Array.isArray(t.media)}function up(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function pp(e){const[t]=e.media;return t!=null&&t.url?t:null}function mp(e){return!Array.isArray(e)||e.length===0?[]:dp(e)?e.flatMap(t=>{const n=up(t);if(!n)return[];const i=pp(t);return[{displayMedia:n,lightboxMedia:i!=null&&i.url?i:null}]}):e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function Ei(e){return e.type==="video"}function gp(e){e.pause(),e.removeAttribute("src"),e.load()}function Aa({media:e,className:t,style:n,onMediaClick:i}){return Ei(e)?r.jsx("video",{src:e.url,className:t,style:{...n,cursor:i?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,onClick:i}):r.jsx("img",{src:e.url,alt:e.name,className:t,style:{...n,cursor:i?"pointer":"default"},onClick:i})}function so(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function hp(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function fp({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:s,onMouseMove:a,onTransitionEnd:u}){return l.useEffect(()=>{const c=n.current;if(c)return()=>{gp(c)}},[e,n]),r.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:s,onMouseMove:a,onTransitionEnd:u,style:i})}function yp({items:e,index:t,imageDisplay:n,onClose:i,onPrev:o,onNext:s,counterClassName:a,counterStyle:u}){const c=n==="cover",m=l.useRef(null),p=l.useRef(null),b=l.useRef(null),w=l.useRef(null),S=l.useRef(0),g=l.useRef(0),v=l.useRef("none"),T=l.useRef(!1),$=l.useRef(!1),C=l.useRef(!1),L=l.useRef(null),[A,k]=l.useState(null),[F,I]=l.useState("opening"),[E,J]=l.useState(0),[y,_]=l.useState(0),[W,G]=l.useState(!1),[te,ue]=l.useState(!1),[X,H]=l.useState(!1),Q=l.useRef(t),z=e[t],B=z?Ei(z):!1,Y=y!==0||W,oe=l.useCallback(re=>{C.current=re,G(re)},[]),ie=l.useCallback(()=>{L.current!==null&&(window.clearTimeout(L.current),L.current=null)},[]),O=l.useCallback(()=>{ie(),L.current=window.setTimeout(()=>{ie(),oe(!1)},pn+32)},[ie,oe]),ce=l.useCallback(()=>{const re=p.current,Ce=b.current;if(!re)return;const Se=re.getBoundingClientRect(),we=Se.width,Ie=Se.height;if(!we||!Ie)return;if(n==="cover"){k({width:we,height:Ie,left:Se.left,top:Se.top});return}if(!Ce){k(so(re));return}const{width:N,height:ee}=hp(Ce);if(!N||!ee){k(so(re));return}const R=N/ee,K=we/Ie;if(R>K){const D=we/R;k({width:we,height:D,left:Se.left,top:Se.top+(Ie-D)/2})}else{const D=Ie*R;k({width:D,height:Ie,left:Se.left+(we-D)/2,top:Se.top})}},[n]);l.useEffect(()=>{ce();const re=p.current;if(!re)return;const Ce=new ResizeObserver(()=>ce());return Ce.observe(re),()=>Ce.disconnect()},[ce,t]),l.useEffect(()=>{F==="opening"&&A&&I("open")},[F,A]),l.useEffect(()=>{if(F!=="closing")return;const re=setTimeout(()=>i(),pn);return()=>clearTimeout(re)},[F,i]),l.useEffect(()=>()=>{ie()},[ie]),l.useLayoutEffect(()=>{if(Q.current===t)return;ie(),J(0),_(0),oe(!1),H(!1),ue(!1),S.current=0,g.current=0,v.current="none",T.current=!1,w.current=null,$.current=!1;const re=p.current;re&&k(so(re)),Q.current=t},[t,oe,ie]),l.useEffect(()=>{if(F!=="open")return;const re=()=>{const ee=R=>{R.stopPropagation(),R.preventDefault(),document.removeEventListener("click",ee,!0)};document.addEventListener("click",ee,!0)},Ce=ee=>{ie(),C.current=!1,G(!1),_(0),ue(!1),T.current=!1,g.current=0,v.current="none";const R=p.current;R&&k(so(R)),ee<0?s():o()},Se=ee=>{if(Math.abs(ee)>cp&&e.length>1){Ce(ee);return}oe(!0),_(0),O()},we=ee=>{if(ee.touches.length!==1||C.current)return;const R=ee.touches[0];$.current=!0,w.current={x:R.clientX,y:R.clientY},v.current="none",g.current=0,T.current=!1},Ie=ee=>{if(!w.current||ee.touches.length!==1||C.current)return;const R=ee.touches[0],K=R.clientX-w.current.x,D=R.clientY-w.current.y;if(v.current==="none"){if(Math.abs(K)<10&&Math.abs(D)<10)return;if(Math.abs(K)>Math.abs(D)){if(e.length<=1)return;v.current="horizontal"}else if(D>0)v.current="vertical";else return}if(v.current==="horizontal"){T.current=!0,ue(!0),g.current=K,_(K),ee.preventDefault();return}v.current==="vertical"&&(T.current=!0,ue(!0),S.current=D,J(D),ee.preventDefault())},N=()=>{if(!w.current)return;const ee=v.current,R=T.current;if(R&&ee==="horizontal")Se(g.current),re();else if(R&&ee==="vertical"){if(S.current>lp){const D=window.innerHeight;S.current=D,H(!0),J(D),I("closing")}else S.current=0,J(0);re()}else ee==="horizontal"&&Math.abs(g.current)>0&&(Se(g.current),re());w.current=null,v.current="none",g.current=0,T.current=!1,ue(!1)};return document.addEventListener("touchstart",we,{passive:!0}),document.addEventListener("touchmove",Ie,{passive:!1}),document.addEventListener("touchend",N),document.addEventListener("touchcancel",N),()=>{document.removeEventListener("touchstart",we),document.removeEventListener("touchmove",Ie),document.removeEventListener("touchend",N),document.removeEventListener("touchcancel",N)}},[F,e.length,s,o,oe,O]),l.useEffect(()=>{const re=Ce=>{Ce.key==="Escape"&&(Ce.preventDefault(),Ce.stopPropagation(),F!=="closing"&&I("closing"))};return window.addEventListener("keydown",re,!0),()=>window.removeEventListener("keydown",re,!0)},[F]);const f=()=>{F!=="closing"&&I("closing")},de=F==="open",be=F==="closing",fe=E>0?Math.max(0,1-E/500):1,Re=E>0?Math.max(.35,1-E/500):1,Z=re=>{if(re.stopPropagation(),$.current){$.current=!1;return}if(e.length<=1)return;const Ce=re.currentTarget.getBoundingClientRect(),Se=re.clientY-Ce.top,we=Math.min(52,Ce.height*.2);if(!(Se>Ce.height-we)){if(re.clientX-Ce.left<Ce.width/2){o();return}s()}},ge=re=>{if(e.length<=1)return;const Ce=re.currentTarget.getBoundingClientRect(),Se=re.clientX-Ce.left,we=re.clientY-Ce.top,Ie=Math.min(52,Ce.height*.2);if(we>Ce.height-Ie){re.currentTarget.style.cursor="default";return}re.currentTarget.style.cursor=Se<Ce.width/2?"w-resize":"e-resize"},U=l.useCallback(re=>{re.propertyName!=="transform"||!C.current||(ie(),oe(!1))},[ie,oe]),V=Y?`translateX(${y}px)`:E>0?`translateY(${E}px)`:void 0,j={position:"fixed",top:A==null?void 0:A.top,left:A==null?void 0:A.left,width:A==null?void 0:A.width,height:A==null?void 0:A.height,objectFit:n==="cover"?"cover":"contain",transform:V,opacity:E>0?Re:F==="opening"||be?0:1,transition:te&&!W?"none":W?`transform ${pn}ms ${On}`:X?`transform ${pn}ms ${On}, opacity ${pn}ms ${On}`:F==="opening"||be?`opacity ${pn}ms ${On}`:"none",pointerEvents:B&&de&&!Y?"auto":"none",touchAction:B&&de?"none":void 0,zIndex:9998},he=A?{position:"fixed",top:A.top,height:A.height,width:A.width/2,zIndex:9999}:null;return r.jsxs("div",{ref:m,style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:9997,touchAction:F==="open"?"none":void 0},onClick:f,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:de?fe:0,transition:te?"none":`opacity ${pn}ms ${On}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:c?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:p,style:{position:"absolute",inset:0}}),r.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:de?1:0,transition:`opacity ${pn}ms ${On}`,pointerEvents:"none",zIndex:9999},children:e.length>1&&r.jsxs("p",{className:a,style:u,children:[t+1," / ",e.length]})})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:p,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:de?1:0,transition:`opacity ${pn}ms ${On}`},children:e.length>1&&r.jsxs("p",{className:a,style:u,children:[t+1," / ",e.length]})})]})}),A&&z&&(B?r.jsx(fp,{src:z.url,phase:F,mediaRef:b,mediaStyle:j,onLoadedMetadata:ce,onClick:Z,onMouseMove:ge,onTransitionEnd:U},`${t}-${z.url}`):r.jsx("img",{ref:b,src:z.url,alt:z.name,onLoad:ce,onTransitionEnd:U,style:j},`${t}-${z.url}`)),de&&he&&e.length>1&&!B&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...he,left:A.left,cursor:"w-resize",pointerEvents:Y?"none":"auto"},onClick:re=>{if($.current){$.current=!1;return}re.stopPropagation(),o()}}),r.jsx("div",{style:{...he,left:A.left+A.width/2,cursor:"e-resize",pointerEvents:Y?"none":"auto"},onClick:re=>{if($.current){$.current=!1;return}re.stopPropagation(),s()}})]})]})}function vp(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function bp({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:s,activeEvent:a,layoutId:u}){const{prefix:c}=P.useScopedStyles(),{type:m="a",gridLayout:p,textBoxWidth:b=100,verticalGap:w,entriesCount:S,lightbox:g,imageDisplay:v,lightboxImageDisplay:T,slider:$,sliderTiming:C,direction:L,transition:A,titleMarginTop:k,subtitleMarginTop:F,titleColor:I,subtitleColor:E,lightboxCounterColor:J,titleFontFamily:y,titleFontSettings:_,titleFontSize:W,titleLineHeight:G,titleLetterSpacing:te,titleWordSpacing:ue,titleTextAppearance:X,subtitleFontFamily:H,subtitleFontSettings:Q,subtitleFontSize:z,subtitleLineHeight:B,subtitleLetterSpacing:Y,subtitleWordSpacing:oe,subtitleTextAppearance:ie,lightboxCounterFontFamily:O,lightboxCounterFontSettings:ce,lightboxCounterFontSize:f,lightboxCounterLineHeight:de,lightboxCounterLetterSpacing:be,lightboxCounterWordSpacing:fe,lightboxCounterTextAppearance:Re,showText:Z="always",alignEntries:ge="off",align:U="top"}=e,V={fontSettings:{fontFamily:y,fontWeight:(_==null?void 0:_.fontWeight)??400,fontStyle:(_==null?void 0:_.fontStyle)??"normal"},fontSize:W??.01,lineHeight:G,letterSpacing:te??0,wordSpacing:ue??0,textAppearance:X,color:I},he={...qt(At(V,n))},re={fontSettings:{fontFamily:H,fontWeight:(Q==null?void 0:Q.fontWeight)??400,fontStyle:(Q==null?void 0:Q.fontStyle)??"normal"},fontSize:z??.01,lineHeight:B,letterSpacing:Y??0,wordSpacing:oe??0,textAppearance:ie,color:E},Se={...qt(At(re,n))},we={fontSettings:{fontFamily:O,fontWeight:(ce==null?void 0:ce.fontWeight)??400,fontStyle:(ce==null?void 0:ce.fontStyle)??"normal"},fontSize:f??.01,lineHeight:de,letterSpacing:be??0,wordSpacing:fe??0,textAppearance:Re,color:J},N={...qt(At(we,n)),...cr(f,de,c,n)},ee=lr(W,G,`${c}-item-title`,`${c}-text-tight-leading`),R=lr(z,B,`${c}-item-subtitle`,`${c}-text-tight-leading`),K=cr(W,G,c,n),D=cr(z,B,c,n),ae=lr(f,de,`${c}-lightbox-counter`,`${c}-text-tight-leading`),ne=P.buildColorVars(c,{titleColor:I,subtitleColor:E,lightboxCounterColor:J},xp,wp),Te=`${a&&a!=="default"?`${c}-state-${a}`:""}${Z==="on hover"&&(!n||i)?` ${c}-show-text-hover`:""}`.trim(),xe=S===0?1/0:S,Ke=(t??[]).slice(0,xe),se=p.entryWidth??.2,Ae=(v==null?void 0:v.display)==="cover",Ne=(v==null?void 0:v.ratioValue)??"1:1",He=(v==null?void 0:v.reversed)??!1,[dt,ft]=Ne.split(":").map(Number),wt=`${He?ft:dt} / ${He?dt:ft}`,Ht=P.scalingValue(se??0,n),Lt=!Ae&&$!=="off",Xe={width:Ht,...Ae?{aspectRatio:wt,height:"auto",overflow:"hidden"}:{height:"auto"}},Me=`${c}-item-image-wrapper${Lt?` ${c}-item-image-wrapper-fit-slider`:""}`.trim(),Ve=m==="d"||m==="e"||m==="f",Ye=ge==="on",Be=`calc(${P.scalingValue(se??0,n)} * (${b} / 100))`,ut=P.scalingValue(se*b/100,n),Pt=Ae?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},[Qe,Mt]=l.useState("ltr"),[Ot,je]=l.useState(0),gt=l.useRef(null);l.useEffect(()=>{const qe=gt.current;if(!qe)return;const yt=new ResizeObserver(vt=>{je(Math.round(vt[0].contentRect.width))});return yt.observe(qe),()=>yt.disconnect()},[]);const it=(()=>{const qe={...ne},yt=gt.current?getComputedStyle(gt.current).getPropertyValue("--cntrl-article-width").trim():"";return yt&&(qe["--cntrl-article-width"]=yt),qe})(),[Ze,rt]=l.useState(!1),[at,sn]=l.useState([]),[wn,ln]=l.useState(0),ot=g==="on"&&(!n||i),tn=(qe,yt)=>{n&&!i||g!=="off"&&(sn(qe),ln(yt),rt(!0))};l.useEffect(()=>{if(!Ze||g!=="on"||typeof document>"u")return;const qe=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=qe}},[Ze,g]),l.useEffect(()=>{!n||i||rt(!1)},[n,i]);const Ut=l.useMemo(()=>ap(c),[c]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Ut}}),r.jsx("div",{style:ne,children:r.jsx("div",{ref:gt,className:`${c}-wrapper ${c}-type-${m}${Ye?` ${c}-align-entries`:""} ${c}-image-align-${U} ${Te}`.trim(),style:{gridTemplateColumns:`repeat(${p.columnsCount}, minmax(0, 1fr))`,rowGap:Ye?0:P.scalingValue(w??0,n),columnGap:P.scalingValue(p.horizontalGap??0,n),width:P.scalingValue(p.wrapperWidth??0,n),...Ye?{[`--${c}-align-entries-row-gap`]:P.scalingValue(w??0,n)}:{}},children:Ke.map((qe,yt)=>{var kt;const vt=Ra(qe.title),pe=Ra(qe.subtitle),Le=(((kt=qe.link)==null?void 0:kt.length)??0)>0&&g==="off"?qe.link:void 0,_e=Math.floor(yt/p.columnsCount)===Math.ceil(Ke.length/p.columnsCount)-1,We=Ve?r.jsxs("div",{className:`${c}-item-text-block`,children:[vt&&r.jsx("p",{className:ee,style:{width:Be,...he,...K},children:qe.title}),vt&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${c}-control`:void 0,style:{height:P.scalingValue(k??0,n),width:ut}}),pe&&r.jsx("p",{className:R,style:{width:Be,...Se,...D},children:qe.subtitle}),pe&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${c}-control`:void 0,style:{height:P.scalingValue(F??0,n),width:ut}})]}):null,tt=Ye?r.jsxs("div",{className:`${c}-item-title-row`,children:[!Ve&&r.jsx("div",{"data-controls":o&&vt?"titleMarginTop":void 0,className:o&&vt?`${c}-control`:void 0,style:{height:vt?P.scalingValue(k??0,n):0,width:ut}}),vt&&r.jsx("p",{className:ee,style:{width:Be,...he,...K},children:qe.title}),Ve&&vt&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${c}-control`:void 0,style:{height:P.scalingValue(k??0,n),width:ut}})]}):null,$t=Ye?r.jsxs("div",{className:`${c}-item-subtitle-row`,children:[!Ve&&r.jsx("div",{"data-controls":o&&pe?"subtitleMarginTop":void 0,className:o&&pe?`${c}-control`:void 0,style:{height:pe?P.scalingValue(F??0,n):0,width:ut}}),pe&&r.jsx("p",{className:R,style:{width:Be,...Se,...D},children:qe.subtitle}),Ve&&pe&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${c}-control`:void 0,style:{height:P.scalingValue(F??0,n),width:ut}})]}):null,Ee=Le?r.jsxs("a",{href:Le,target:"_blank",className:`${c}-item-text-link`,children:[tt,$t]}):r.jsxs(r.Fragment,{children:[tt,$t]}),et=mp(qe.gallery),De=et.filter(Ge=>Ge.lightboxMedia).map(Ge=>Ge.lightboxMedia),st=r.jsx("div",{className:Me,style:Xe,children:et.length===0?null:$==="off"?(()=>{const{displayMedia:Ge,lightboxMedia:nt}=et[0],Et=nt?De.findIndex(St=>St.url===nt.url):-1;return r.jsx(Aa,{media:Ge,className:`${c}-item-${Ei(Ge)?"video":"image"}`.trim(),style:Pt,onMediaClick:ot&&Et>=0?()=>tn(De,Et):void 0})})():r.jsxs(r.Fragment,{children:[Lt&&Ye&&r.jsx("div",{className:`${c}-item-image-wrapper-sizer`,"aria-hidden":"true",children:et.map(({displayMedia:Ge})=>Ei(Ge)?r.jsx("video",{src:Ge.url,muted:!0,playsInline:!0},`sizer-${Ge.url}`):r.jsx("img",{src:Ge.url,alt:""},`sizer-${Ge.url}`))}),r.jsx(Yr,{className:`${c}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:C*1e3,width:"100%",height:"100%",speed:sp,type:A==="fade"?"fade":"loop",rewind:A==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:A==="fade"?"ltr":L!=="random"?L==="horizontal"?"ltr":"ttb":Qe},onMoved:Ge=>{if(L!=="random"||A==="fade")return;const nt=Math.random()>.5?Math.random()>.5?"rtl":"ltr":"ttb";Mt(nt),setTimeout(()=>{Ge.refresh()},0)},children:et.map(({displayMedia:Ge,lightboxMedia:nt},Et)=>{const St=nt?De.findIndex(_t=>_t.url===nt.url):-1;return r.jsx(Jr,{children:r.jsx(Aa,{media:Ge,className:`${c}-item-${Ei(Ge)?"video":"image"}`.trim(),style:Pt,onMediaClick:ot&&St>=0?()=>tn(De,St):void 0})},Et)})},`${A}-${se}-${L}-${C}-${Ot}-${u}`)]})}),pt=Ve?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":o&&vt?"titleMarginTop":void 0,className:o&&vt?`${c}-control`:void 0,style:{height:vt?P.scalingValue(k??0,n):0,width:ut}}),r.jsx("p",{className:ee,style:{width:Be,...he,...K},children:qe.title}),r.jsx("div",{"data-controls":o&&pe?"subtitleMarginTop":void 0,className:o&&pe?`${c}-control`:void 0,style:{height:pe?P.scalingValue(F??0,n):0,width:ut}}),r.jsx("p",{className:R,style:{width:Be,...Se,...D},children:qe.subtitle})]});return r.jsx("div",{className:`${c}-item`.trim(),children:r.jsx("div",{className:`${o?`${c}-item-inner`:`${c}-item-inner-hidden`}${Ye&&_e?` ${c}-item-inner-last-row`:""}`.trim(),style:{width:(b??0)>100?`calc(${P.scalingValue(se??0,n)} * (${b} / 100))`:P.scalingValue(se??0,n)},children:Ye?r.jsx(r.Fragment,{children:Ve?r.jsxs(r.Fragment,{children:[Ee,r.jsx("a",{href:Le,target:"_blank",className:`${c}-item-image-link`,children:st})]}):r.jsxs(r.Fragment,{children:[r.jsx("a",{href:Le,target:"_blank",className:`${c}-item-image-link`,children:st}),Ee]})}):Le?r.jsxs(r.Fragment,{children:[r.jsxs("a",{href:Le,target:"_blank",className:`${c}-item-image-link`,children:[We,st]}),!Ve&&r.jsx("a",{href:Le,target:"_blank",className:`${c}-item-text-link`,children:pt})]}):r.jsxs(r.Fragment,{children:[We,st,pt]})})},yt)})})}),(!n||i)&&Ze&&typeof document<"u"&&g==="on"&&ji.createPortal(r.jsx("div",{style:it,"data-selection":"none",children:r.jsx(yp,{items:at,index:wn,imageDisplay:vp(T),onClose:()=>rt(!1),onPrev:()=>ln(qe=>(qe-1+at.length)%at.length),onNext:()=>ln(qe=>(qe+1)%at.length),counterClassName:ae,counterStyle:N})}),document.body)]})}const xp={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},wp=["hover","focus","filled","success","error"],$p=`import { Splide, SplideSlide } from '@splidejs/react-splide';
3995
+ `}const pn=500,sp=750,On="cubic-bezier(0.22, 1, 0.36, 1)",lp=72,cp=50;function dp(e){if(!Array.isArray(e)||e.length===0)return!1;const t=e[0];return t!==null&&typeof t=="object"&&"media"in t&&Array.isArray(t.media)}function up(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function pp(e){const[t]=e.media;return t!=null&&t.url?t:null}function mp(e){return!Array.isArray(e)||e.length===0?[]:dp(e)?e.flatMap(t=>{const n=up(t);if(!n)return[];const i=pp(t);return[{displayMedia:n,lightboxMedia:i!=null&&i.url?i:null}]}):e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function Ei(e){return e.type==="video"}function gp(e){e.pause(),e.removeAttribute("src"),e.load()}function Aa({media:e,className:t,style:n,onMediaClick:i}){return Ei(e)?r.jsx("video",{src:e.url,className:t,style:{...n,cursor:i?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,onClick:i}):r.jsx("img",{src:e.url,alt:e.name,className:t,style:{...n,cursor:i?"pointer":"default"},onClick:i})}function so(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function hp(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function fp({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:s,onMouseMove:a,onTransitionEnd:u}){return l.useEffect(()=>{const c=n.current;if(c)return()=>{gp(c)}},[e,n]),r.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:s,onMouseMove:a,onTransitionEnd:u,style:i})}function yp({items:e,index:t,imageDisplay:n,onClose:i,onPrev:o,onNext:s,counterClassName:a,counterStyle:u}){const c=n==="cover",m=l.useRef(null),p=l.useRef(null),b=l.useRef(null),w=l.useRef(null),S=l.useRef(0),g=l.useRef(0),v=l.useRef("none"),T=l.useRef(!1),$=l.useRef(!1),C=l.useRef(!1),L=l.useRef(null),[A,k]=l.useState(null),[F,I]=l.useState("opening"),[E,J]=l.useState(0),[y,_]=l.useState(0),[W,G]=l.useState(!1),[te,ue]=l.useState(!1),[X,H]=l.useState(!1),Q=l.useRef(t),z=e[t],B=z?Ei(z):!1,Y=y!==0||W,oe=l.useCallback(re=>{C.current=re,G(re)},[]),ie=l.useCallback(()=>{L.current!==null&&(window.clearTimeout(L.current),L.current=null)},[]),O=l.useCallback(()=>{ie(),L.current=window.setTimeout(()=>{ie(),oe(!1)},pn+32)},[ie,oe]),ce=l.useCallback(()=>{const re=p.current,Ce=b.current;if(!re)return;const Se=re.getBoundingClientRect(),we=Se.width,Ie=Se.height;if(!we||!Ie)return;if(n==="cover"){k({width:we,height:Ie,left:Se.left,top:Se.top});return}if(!Ce){k(so(re));return}const{width:N,height:ee}=hp(Ce);if(!N||!ee){k(so(re));return}const R=N/ee,K=we/Ie;if(R>K){const D=we/R;k({width:we,height:D,left:Se.left,top:Se.top+(Ie-D)/2})}else{const D=Ie*R;k({width:D,height:Ie,left:Se.left+(we-D)/2,top:Se.top})}},[n]);l.useEffect(()=>{ce();const re=p.current;if(!re)return;const Ce=new ResizeObserver(()=>ce());return Ce.observe(re),()=>Ce.disconnect()},[ce,t]),l.useEffect(()=>{F==="opening"&&A&&I("open")},[F,A]),l.useEffect(()=>{if(F!=="closing")return;const re=setTimeout(()=>i(),pn);return()=>clearTimeout(re)},[F,i]),l.useEffect(()=>()=>{ie()},[ie]),l.useLayoutEffect(()=>{if(Q.current===t)return;ie(),J(0),_(0),oe(!1),H(!1),ue(!1),S.current=0,g.current=0,v.current="none",T.current=!1,w.current=null,$.current=!1;const re=p.current;re&&k(so(re)),Q.current=t},[t,oe,ie]),l.useEffect(()=>{if(F!=="open")return;const re=()=>{const ee=R=>{R.stopPropagation(),R.preventDefault(),document.removeEventListener("click",ee,!0)};document.addEventListener("click",ee,!0)},Ce=ee=>{ie(),C.current=!1,G(!1),_(0),ue(!1),T.current=!1,g.current=0,v.current="none";const R=p.current;R&&k(so(R)),ee<0?s():o()},Se=ee=>{if(Math.abs(ee)>cp&&e.length>1){Ce(ee);return}oe(!0),_(0),O()},we=ee=>{if(ee.touches.length!==1||C.current)return;const R=ee.touches[0];$.current=!0,w.current={x:R.clientX,y:R.clientY},v.current="none",g.current=0,T.current=!1},Ie=ee=>{if(!w.current||ee.touches.length!==1||C.current)return;const R=ee.touches[0],K=R.clientX-w.current.x,D=R.clientY-w.current.y;if(v.current==="none"){if(Math.abs(K)<10&&Math.abs(D)<10)return;if(Math.abs(K)>Math.abs(D)){if(e.length<=1)return;v.current="horizontal"}else if(D>0)v.current="vertical";else return}if(v.current==="horizontal"){T.current=!0,ue(!0),g.current=K,_(K),ee.preventDefault();return}v.current==="vertical"&&(T.current=!0,ue(!0),S.current=D,J(D),ee.preventDefault())},N=()=>{if(!w.current)return;const ee=v.current,R=T.current;if(R&&ee==="horizontal")Se(g.current),re();else if(R&&ee==="vertical"){if(S.current>lp){const D=window.innerHeight;S.current=D,H(!0),J(D),I("closing")}else S.current=0,J(0);re()}else ee==="horizontal"&&Math.abs(g.current)>0&&(Se(g.current),re());w.current=null,v.current="none",g.current=0,T.current=!1,ue(!1)};return document.addEventListener("touchstart",we,{passive:!0}),document.addEventListener("touchmove",Ie,{passive:!1}),document.addEventListener("touchend",N),document.addEventListener("touchcancel",N),()=>{document.removeEventListener("touchstart",we),document.removeEventListener("touchmove",Ie),document.removeEventListener("touchend",N),document.removeEventListener("touchcancel",N)}},[F,e.length,s,o,oe,O]),l.useEffect(()=>{const re=Ce=>{Ce.key==="Escape"&&(Ce.preventDefault(),Ce.stopPropagation(),F!=="closing"&&I("closing"))};return window.addEventListener("keydown",re,!0),()=>window.removeEventListener("keydown",re,!0)},[F]);const f=()=>{F!=="closing"&&I("closing")},de=F==="open",be=F==="closing",fe=E>0?Math.max(0,1-E/500):1,Re=E>0?Math.max(.35,1-E/500):1,Z=re=>{if(re.stopPropagation(),$.current){$.current=!1;return}if(e.length<=1)return;const Ce=re.currentTarget.getBoundingClientRect(),Se=re.clientY-Ce.top,we=Math.min(52,Ce.height*.2);if(!(Se>Ce.height-we)){if(re.clientX-Ce.left<Ce.width/2){o();return}s()}},ge=re=>{if(e.length<=1)return;const Ce=re.currentTarget.getBoundingClientRect(),Se=re.clientX-Ce.left,we=re.clientY-Ce.top,Ie=Math.min(52,Ce.height*.2);if(we>Ce.height-Ie){re.currentTarget.style.cursor="default";return}re.currentTarget.style.cursor=Se<Ce.width/2?"w-resize":"e-resize"},U=l.useCallback(re=>{re.propertyName!=="transform"||!C.current||(ie(),oe(!1))},[ie,oe]),V=Y?`translateX(${y}px)`:E>0?`translateY(${E}px)`:void 0,j={position:"fixed",top:A==null?void 0:A.top,left:A==null?void 0:A.left,width:A==null?void 0:A.width,height:A==null?void 0:A.height,objectFit:n==="cover"?"cover":"contain",transform:V,opacity:E>0?Re:F==="opening"||be?0:1,transition:te&&!W?"none":W?`transform ${pn}ms ${On}`:X?`transform ${pn}ms ${On}, opacity ${pn}ms ${On}`:F==="opening"||be?`opacity ${pn}ms ${On}`:"none",pointerEvents:B&&de&&!Y?"auto":"none",touchAction:B&&de?"none":void 0,zIndex:9998},he=A?{position:"fixed",top:A.top,height:A.height,width:A.width/2,zIndex:9999}:null;return r.jsxs("div",{ref:m,style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:9997,touchAction:F==="open"?"none":void 0},onClick:f,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:de?fe:0,transition:te?"none":`opacity ${pn}ms ${On}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:c?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:p,style:{position:"absolute",inset:0}}),r.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:de?1:0,transition:`opacity ${pn}ms ${On}`,pointerEvents:"none",zIndex:9999},children:e.length>1&&r.jsxs("p",{className:a,style:u,children:[t+1," / ",e.length]})})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:p,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:de?1:0,transition:`opacity ${pn}ms ${On}`},children:e.length>1&&r.jsxs("p",{className:a,style:u,children:[t+1," / ",e.length]})})]})}),A&&z&&(B?r.jsx(fp,{src:z.url,phase:F,mediaRef:b,mediaStyle:j,onLoadedMetadata:ce,onClick:Z,onMouseMove:ge,onTransitionEnd:U},`${t}-${z.url}`):r.jsx("img",{ref:b,src:z.url,alt:z.name,onLoad:ce,onTransitionEnd:U,style:j},`${t}-${z.url}`)),de&&he&&e.length>1&&!B&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...he,left:A.left,cursor:"w-resize",pointerEvents:Y?"none":"auto"},onClick:re=>{if($.current){$.current=!1;return}re.stopPropagation(),o()}}),r.jsx("div",{style:{...he,left:A.left+A.width/2,cursor:"e-resize",pointerEvents:Y?"none":"auto"},onClick:re=>{if($.current){$.current=!1;return}re.stopPropagation(),s()}})]})]})}function vp(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function bp({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:s,activeEvent:a,layoutId:u}){const{prefix:c}=P.useScopedStyles(),{type:m="a",gridLayout:p,textBoxWidth:b=100,verticalGap:w,entriesCount:S,lightbox:g,imageDisplay:v,lightboxImageDisplay:T,slider:$,sliderTiming:C,direction:L,transition:A,titleMarginTop:k,subtitleMarginTop:F,titleColor:I,subtitleColor:E,lightboxCounterColor:J,titleFontFamily:y,titleFontSettings:_,titleFontSize:W,titleLineHeight:G,titleLetterSpacing:te,titleWordSpacing:ue,titleTextAppearance:X,subtitleFontFamily:H,subtitleFontSettings:Q,subtitleFontSize:z,subtitleLineHeight:B,subtitleLetterSpacing:Y,subtitleWordSpacing:oe,subtitleTextAppearance:ie,lightboxCounterFontFamily:O,lightboxCounterFontSettings:ce,lightboxCounterFontSize:f,lightboxCounterLineHeight:de,lightboxCounterLetterSpacing:be,lightboxCounterWordSpacing:fe,lightboxCounterTextAppearance:Re,showText:Z="always",alignEntries:ge="off",align:U="top"}=e,V={fontSettings:{fontFamily:y,fontWeight:(_==null?void 0:_.fontWeight)??400,fontStyle:(_==null?void 0:_.fontStyle)??"normal"},fontSize:W??.01,lineHeight:G,letterSpacing:te??0,wordSpacing:ue??0,textAppearance:X,color:I},he={...qt(At(V,n))},re={fontSettings:{fontFamily:H,fontWeight:(Q==null?void 0:Q.fontWeight)??400,fontStyle:(Q==null?void 0:Q.fontStyle)??"normal"},fontSize:z??.01,lineHeight:B,letterSpacing:Y??0,wordSpacing:oe??0,textAppearance:ie,color:E},Se={...qt(At(re,n))},we={fontSettings:{fontFamily:O,fontWeight:(ce==null?void 0:ce.fontWeight)??400,fontStyle:(ce==null?void 0:ce.fontStyle)??"normal"},fontSize:f??.01,lineHeight:de,letterSpacing:be??0,wordSpacing:fe??0,textAppearance:Re,color:J},N={...qt(At(we,n)),...cr(f,de,c,n)},ee=lr(W,G,`${c}-item-title`,`${c}-text-tight-leading`),R=lr(z,B,`${c}-item-subtitle`,`${c}-text-tight-leading`),K=cr(W,G,c,n),D=cr(z,B,c,n),ae=lr(f,de,`${c}-lightbox-counter`,`${c}-text-tight-leading`),ne=P.buildColorVars(c,{titleColor:I,subtitleColor:E,lightboxCounterColor:J},xp,wp),Te=`${a&&a!=="default"?`${c}-state-${a}`:""}${Z==="on hover"&&(!n||i)?` ${c}-show-text-hover`:""}`.trim(),xe=S===0?1/0:S,qe=(t??[]).slice(0,xe),se=p.entryWidth??.2,Ae=(v==null?void 0:v.display)==="cover",Ne=(v==null?void 0:v.ratioValue)??"1:1",He=(v==null?void 0:v.reversed)??!1,[dt,ft]=Ne.split(":").map(Number),wt=`${He?ft:dt} / ${He?dt:ft}`,Ht=P.scalingValue(se??0,n),Lt=!Ae&&$!=="off",Xe={width:Ht,...Ae?{aspectRatio:wt,height:"auto",overflow:"hidden"}:{height:"auto"}},Me=`${c}-item-image-wrapper${Lt?` ${c}-item-image-wrapper-fit-slider`:""}`.trim(),Ve=m==="d"||m==="e"||m==="f",Ye=ge==="on",Be=`calc(${P.scalingValue(se??0,n)} * (${b} / 100))`,ut=P.scalingValue(se*b/100,n),Pt=Ae?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},[Qe,Mt]=l.useState("ltr"),[Ot,je]=l.useState(0),gt=l.useRef(null);l.useEffect(()=>{const Ke=gt.current;if(!Ke)return;const yt=new ResizeObserver(vt=>{je(Math.round(vt[0].contentRect.width))});return yt.observe(Ke),()=>yt.disconnect()},[]);const it=(()=>{const Ke={...ne},yt=gt.current?getComputedStyle(gt.current).getPropertyValue("--cntrl-article-width").trim():"";return yt&&(Ke["--cntrl-article-width"]=yt),Ke})(),[Ze,rt]=l.useState(!1),[at,sn]=l.useState([]),[wn,ln]=l.useState(0),ot=g==="on"&&(!n||i),tn=(Ke,yt)=>{n&&!i||g!=="off"&&(sn(Ke),ln(yt),rt(!0))};l.useEffect(()=>{if(!Ze||g!=="on"||typeof document>"u")return;const Ke=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Ke}},[Ze,g]),l.useEffect(()=>{!n||i||rt(!1)},[n,i]);const Ut=l.useMemo(()=>ap(c),[c]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Ut}}),r.jsx("div",{style:ne,children:r.jsx("div",{ref:gt,className:`${c}-wrapper ${c}-type-${m}${Ye?` ${c}-align-entries`:""} ${c}-image-align-${U} ${Te}`.trim(),style:{gridTemplateColumns:`repeat(${p.columnsCount}, minmax(0, 1fr))`,rowGap:Ye?0:P.scalingValue(w??0,n),columnGap:P.scalingValue(p.horizontalGap??0,n),width:P.scalingValue(p.wrapperWidth??0,n),...Ye?{[`--${c}-align-entries-row-gap`]:P.scalingValue(w??0,n)}:{}},children:qe.map((Ke,yt)=>{var kt;const vt=Ra(Ke.title),pe=Ra(Ke.subtitle),Le=(((kt=Ke.link)==null?void 0:kt.length)??0)>0&&g==="off"?Ke.link:void 0,_e=Math.floor(yt/p.columnsCount)===Math.ceil(qe.length/p.columnsCount)-1,We=Ve?r.jsxs("div",{className:`${c}-item-text-block`,children:[vt&&r.jsx("p",{className:ee,style:{width:Be,...he,...K},children:Ke.title}),vt&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${c}-control`:void 0,style:{height:P.scalingValue(k??0,n),width:ut}}),pe&&r.jsx("p",{className:R,style:{width:Be,...Se,...D},children:Ke.subtitle}),pe&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${c}-control`:void 0,style:{height:P.scalingValue(F??0,n),width:ut}})]}):null,tt=Ye?r.jsxs("div",{className:`${c}-item-title-row`,children:[!Ve&&r.jsx("div",{"data-controls":o&&vt?"titleMarginTop":void 0,className:o&&vt?`${c}-control`:void 0,style:{height:vt?P.scalingValue(k??0,n):0,width:ut}}),vt&&r.jsx("p",{className:ee,style:{width:Be,...he,...K},children:Ke.title}),Ve&&vt&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${c}-control`:void 0,style:{height:P.scalingValue(k??0,n),width:ut}})]}):null,$t=Ye?r.jsxs("div",{className:`${c}-item-subtitle-row`,children:[!Ve&&r.jsx("div",{"data-controls":o&&pe?"subtitleMarginTop":void 0,className:o&&pe?`${c}-control`:void 0,style:{height:pe?P.scalingValue(F??0,n):0,width:ut}}),pe&&r.jsx("p",{className:R,style:{width:Be,...Se,...D},children:Ke.subtitle}),Ve&&pe&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${c}-control`:void 0,style:{height:P.scalingValue(F??0,n),width:ut}})]}):null,Ee=Le?r.jsxs("a",{href:Le,target:"_blank",className:`${c}-item-text-link`,children:[tt,$t]}):r.jsxs(r.Fragment,{children:[tt,$t]}),et=mp(Ke.gallery),De=et.filter(Ge=>Ge.lightboxMedia).map(Ge=>Ge.lightboxMedia),st=r.jsx("div",{className:Me,style:Xe,children:et.length===0?null:$==="off"?(()=>{const{displayMedia:Ge,lightboxMedia:nt}=et[0],Et=nt?De.findIndex(St=>St.url===nt.url):-1;return r.jsx(Aa,{media:Ge,className:`${c}-item-${Ei(Ge)?"video":"image"}`.trim(),style:Pt,onMediaClick:ot&&Et>=0?()=>tn(De,Et):void 0})})():r.jsxs(r.Fragment,{children:[Lt&&Ye&&r.jsx("div",{className:`${c}-item-image-wrapper-sizer`,"aria-hidden":"true",children:et.map(({displayMedia:Ge})=>Ei(Ge)?r.jsx("video",{src:Ge.url,muted:!0,playsInline:!0},`sizer-${Ge.url}`):r.jsx("img",{src:Ge.url,alt:""},`sizer-${Ge.url}`))}),r.jsx(Yr,{className:`${c}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:C*1e3,width:"100%",height:"100%",speed:sp,type:A==="fade"?"fade":"loop",rewind:A==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:A==="fade"?"ltr":L!=="random"?L==="horizontal"?"ltr":"ttb":Qe},onMoved:Ge=>{if(L!=="random"||A==="fade")return;const nt=Math.random()>.5?Math.random()>.5?"rtl":"ltr":"ttb";Mt(nt),setTimeout(()=>{Ge.refresh()},0)},children:et.map(({displayMedia:Ge,lightboxMedia:nt},Et)=>{const St=nt?De.findIndex(_t=>_t.url===nt.url):-1;return r.jsx(Jr,{children:r.jsx(Aa,{media:Ge,className:`${c}-item-${Ei(Ge)?"video":"image"}`.trim(),style:Pt,onMediaClick:ot&&St>=0?()=>tn(De,St):void 0})},Et)})},`${A}-${se}-${L}-${C}-${Ot}-${u}`)]})}),pt=Ve?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":o&&vt?"titleMarginTop":void 0,className:o&&vt?`${c}-control`:void 0,style:{height:vt?P.scalingValue(k??0,n):0,width:ut}}),r.jsx("p",{className:ee,style:{width:Be,...he,...K},children:Ke.title}),r.jsx("div",{"data-controls":o&&pe?"subtitleMarginTop":void 0,className:o&&pe?`${c}-control`:void 0,style:{height:pe?P.scalingValue(F??0,n):0,width:ut}}),r.jsx("p",{className:R,style:{width:Be,...Se,...D},children:Ke.subtitle})]});return r.jsx("div",{className:`${c}-item`.trim(),children:r.jsx("div",{className:`${o?`${c}-item-inner`:`${c}-item-inner-hidden`}${Ye&&_e?` ${c}-item-inner-last-row`:""}`.trim(),style:{width:(b??0)>100?`calc(${P.scalingValue(se??0,n)} * (${b} / 100))`:P.scalingValue(se??0,n)},children:Ye?r.jsx(r.Fragment,{children:Ve?r.jsxs(r.Fragment,{children:[Ee,r.jsx("a",{href:Le,target:"_blank",className:`${c}-item-image-link`,children:st})]}):r.jsxs(r.Fragment,{children:[r.jsx("a",{href:Le,target:"_blank",className:`${c}-item-image-link`,children:st}),Ee]})}):Le?r.jsxs(r.Fragment,{children:[r.jsxs("a",{href:Le,target:"_blank",className:`${c}-item-image-link`,children:[We,st]}),!Ve&&r.jsx("a",{href:Le,target:"_blank",className:`${c}-item-text-link`,children:pt})]}):r.jsxs(r.Fragment,{children:[We,st,pt]})})},yt)})})}),(!n||i)&&Ze&&typeof document<"u"&&g==="on"&&ji.createPortal(r.jsx("div",{style:it,"data-selection":"none",children:r.jsx(yp,{items:at,index:wn,imageDisplay:vp(T),onClose:()=>rt(!1),onPrev:()=>ln(Ke=>(Ke-1+at.length)%at.length),onNext:()=>ln(Ke=>(Ke+1)%at.length),counterClassName:ae,counterStyle:N})}),document.body)]})}const xp={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},wp=["hover","focus","filled","success","error"],$p=`import { Splide, SplideSlide } from '@splidejs/react-splide';
3996
3996
  import '@splidejs/react-splide/css/core';
3997
3997
  import { CommonComponentProps } from '../props';
3998
3998
  import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
@@ -6200,7 +6200,7 @@ a.${e}-list-item {
6200
6200
  overflow-wrap: anywhere;
6201
6201
  word-break: break-word;
6202
6202
  }
6203
- `}const Rn=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Zr=["AColumn","BColumn","CColumn","DColumn","EColumn"],yn="cutLabel",Ni=[...Zr,yn],Ko=["A","B","C","D","E"];function Us(e){return`${e}ColumnVerticalAlign`}const Er=["Top","Center","Bottom"];function Qr(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return Ko.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function Ap(e){const t=Qr(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function Mp(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return Ko.includes(n)?n:null}function Xs(e,t,n){const i=Mp(e);return i?i===t?!1:Ap(n[Us(i)]):!0}function Hi(e){const t=Qr(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return Ko.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function _p(e,t,n){if(Ys(e,t,n))return Hi(e);const i=Hi(e);return i.kind==="baseline"?{kind:"top"}:i}function Fp(e){const t=Hi(e);return t.kind==="baseline"?{kind:"top"}:t}function Ys(e,t,n){return Xs(e,n,t)?Hi(e).kind==="baseline":!1}function Wp(e){const t={};let n=!1;for(const i of Ko){const o=Us(i),s=e[o];if(e.type==="b"){const a=String(s??"Top").trim();a!=="Top"&&a!=="Center"&&a!=="Bottom"&&(t[o]="Top",n=!0);continue}Xs(s,i,e)||(t[o]="Top",n=!0)}return n?t:null}function Np(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function Hp(e){const t=Hi(e).kind;return t==="baseline"?"center":t}function Op(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Ha(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function Bp(e,t){const n=document.createElement("i");n.className=t,n.setAttribute("aria-hidden","true"),e.prepend(n);const{top:i}=e.getBoundingClientRect(),{bottom:o}=n.getBoundingClientRect(),s=o-i;return n.remove(),s}function ur(e,t,n,i){const o=e.titleEl;if(!o)return 0;const s=o.closest(`.${n}`);if(!s)return 0;const a=Bp(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+a;const u=s.getBoundingClientRect(),c=o.getBoundingClientRect().height;let m=0;return e.kind==="center"?m=(u.height-c)/2:e.kind==="bottom"&&(m=u.height-c),u.top-t+m+a}function jp(e,t,n){const i=e.getBoundingClientRect().height;return i<=0?0:(t.forEach(o=>{const s=o.querySelector(`.${n}`);s&&(s.style.minHeight=`${i}px`,s.style.height=`${i}px`)}),i)}function zp(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const Vp={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Je(e,t){return`${e}${t.replace(/^text/,"Text")}`}const Dp={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function qp(e){return[Je(e,"textFontFamily"),Je(e,"textFontSettings"),{type:"row",items:[Je(e,"textFontSize"),Je(e,"textLineHeight"),Je(e,"textLetterSpacing"),Je(e,"textWordSpacing")]},Je(e,"textTextAlign"),Je(e,"textTextAppearance"),`${e}VerticalAlign`]}function Kp(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(Ni.map(e=>[Dp[e],qp(e)]))}}function Ao(e,t){const n=i=>{const o=Je(t,i);return e[o]};return{textFontFamily:n("textFontFamily")??"Arial",textFontSettings:n("textFontSettings")??{fontWeight:400,fontStyle:"normal"},textFontSize:n("textFontSize"),textLineHeight:n("textLineHeight"),textLetterSpacing:n("textLetterSpacing")??0,textWordSpacing:n("textWordSpacing")??0,textTextAlign:n("textTextAlign")??(t===yn?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Oa(e,t){var i,o;const n={fontSettings:{fontFamily:e.textFontFamily,fontWeight:((i=e.textFontSettings)==null?void 0:i.fontWeight)??400,fontStyle:((o=e.textFontSettings)==null?void 0:o.fontStyle)??"normal"},fontSize:e.textFontSize??.01,lineHeight:e.textLineHeight,letterSpacing:e.textLetterSpacing,wordSpacing:e.textWordSpacing,textAlign:e.textTextAlign,textAppearance:e.textTextAppearance,color:e.textColor??"#767676"};return qt(At(n,t))}function Ba(e,t,n,i){const o=Ao(e,t),s=o.textFontSize??.01,a=o.textLineHeight;return a!==void 0&&a<s?`${n} ${i}`:n}function ja(e,t,n,i){const o=Ao(e,t),s=o.textFontSize??.01,a=o.textLineHeight;return a===void 0||a>=s?{}:{[`--${n}-title-leading-gap`]:P.scalingValue((s-a)/2,i)}}const Kt=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],pi=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],mi=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],gi=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Gp={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Up=["hover","focus","filled","success","error"],za=.004,oi=.004,pr=oi,ea=50,Oi=1440,Bi=ea/Oi;function Js(e){const t=typeof e=="number"&&e>0?e:Oi;return ea/t}function Xp(e){let t=e??null;for(;t;){const n=t.style.getPropertyValue("--cntrl-article-width").trim();if(n){const o=parseFloat(n);if(Number.isFinite(o)&&o>0)return o}const i=getComputedStyle(t).getPropertyValue("--cntrl-article-width").trim();if(i){const o=parseFloat(i);if(Number.isFinite(o)&&o>0)return o}t=t.parentElement}return Oi}const Zs={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function Ii(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function Yp(e,t=1){const n=t/e;return Object.fromEntries(Kt.map(i=>[i,n]))}function Jp(){return Object.fromEntries([...pi.map(e=>[e,0]),...mi.map(e=>[e,0])])}function Zp(){return Object.fromEntries(gi.map(e=>[e,0]))}function lo(e){return Object.fromEntries(Kt.map(t=>[t,typeof e[t]=="number"?e[t]:Zs[t]]))}function Qs(e,t,n){const i=e-Bi,o=t+n;if(o<=0||o<=i)return{paddingLeft:t,paddingRight:n};if(i<=0)return{paddingLeft:0,paddingRight:0};const s=i/o;return{paddingLeft:t*s,paddingRight:n*s}}function Co(e,t,n){const i=ta(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((s,a)=>s+a,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function Qp(e,t,n){const i={};for(let o=0;o<e;o+=1){const s=pi[o],a=mi[o],u=typeof n[s]=="number"?n[s]:0,c=typeof n[a]=="number"?n[a]:0,m=Qs(t[o]??0,u,c);m.paddingLeft!==u&&(i[s]=m.paddingLeft),m.paddingRight!==c&&(i[a]=m.paddingRight)}return i}function ta(e,t,n){if(e<=0)return[];const i=Kt.slice(0,e).map(m=>n[m]);if(e===1)return i;const o=i.slice(0,e-1),a=o.reduce((m,p)=>m+p,0)+Bi;if(t>=a)return i;const u=[...o];let c=a-t;for(let m=u.length-1;m>=0&&c>0;m-=1){const p=u[m]-Bi;if(p<=0)continue;const b=Math.min(c,p);u[m]-=b,c-=b}return[...u,i[e-1]]}function em(e,t,n){if(e<=1)return{};const i=ta(e,t,n),o={};for(let s=0;s<e-1;s+=1){const a=Kt[s];i[s]!==n[a]&&(o[a]=i[s])}return o}function Va(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Rn]}function tm(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function nm(e,t,n,i){const o=Math.min(i,e.length,Kt.length),s={};for(let a=0;a<o;a+=1){const u=e[a],c=t.indexOf(u);if(c===-1)continue;const m=Kt[c],p=pi[c],b=mi[c],w=gi[c],S=Kt[a],g=pi[a],v=mi[a],T=gi[a],$=n[m],C=n[p],L=n[b],A=n[w];typeof $=="number"&&(s[S]=$),typeof C=="number"&&(s[g]=C),typeof L=="number"&&(s[v]=L),typeof A=="number"&&(s[T]=A)}return s}function el(e,t){const n=new Set([...Object.keys(e),...Object.keys(t)]);for(const i of n)if(e[i]!==t[i])return!0;return!1}function im(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=Ii(e),s=e.type==="b"||e.type===void 0&&t.type==="b",a={...e,...Yp(n,o),...Jp()};if(s)for(const u of gi)typeof t[u]=="number"&&(a[u]=t[u]);else Object.assign(a,Zp());return el(e,a)?a:e}function om(e,t,n){const i=Wp(e);i&&(e={...e,...i});const o=Js(n==null?void 0:n.designWidth),s=e.columns,a=t.columns,u=Ii(e),c=Ii(t),m=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof s=="number"?s:typeof a=="number"?a:Rn.length,b=L=>{if(m)return L;const A=lo({...t,...L}),k=Ii(L),F=Co(p,k,A),I=Qp(p,F,{...t,...L});return Object.keys(I).length===0?L:{...L,...I}};if(typeof s=="number"&&s!==a)return e;const w=Va(e),S=Va(t);if(!tm(w,S))return b({...e,...nm(w,S,t,p)});if(u<c&&typeof p=="number"&&!m){const L=lo({...t,...e});return b({...e,...em(p,u,L)})}if(m){const L=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,A=Math.max(0,(u-o)/2);return L>A?{...e,textPaddingLR:A}:e}const g=lo({...t,...e}),v=Co(p,c,lo(t)),$=Co(p,u,g).some((L,A)=>L<(v[A]??L)),C=Kt.some(L=>{const A=e[L],k=t[L];return typeof A=="number"&&typeof k=="number"&&A!==k});return $||C?b(e):e}function rm(e,t,n,i){const o=t.slice(0,e).reduce((a,u)=>a+u,0),s=n.slice(e+1,t.length-1).reduce((a,u)=>a+u,0);return Math.max(Bi,i-o-s-Bi)}function am(e,t){return Math.random()*(t-e)+e}function sm(e){return Object.fromEntries(Kt.map(t=>[t,typeof e[t]=="number"?e[t]:Zs[t]]))}function mr(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function lm(e,t,n,i,o,s){return e.slice(0,t).map((a,u)=>{const c=pi[u],m=mi[u],p=gi[u];return{key:a,textPrefix:Vp[a],widthKey:Kt[u],width:n[Kt[u]],paddingLeftKey:c,paddingRightKey:m,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[m],paddingBottom:s[p]}})}function cm({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:s,layoutId:a,onUpdateSettings:u}){const{prefix:c}=P.useScopedStyles(),m=!!o,{columns:p,type:b,wrapperWidth:w,entriesCount:S,cellMinHeight:g,dividerWidth:v,showVisibility:T,cut:$,showCut:C,cutCellMinHeight:L,cutLabel:A,imageSize:k,imageOnHover:F,entryHoverEffect:I,entryHoverShowOption:E,rowPaddingTop:J,rowPaddingBottom:y,rowPaddingTopB:_,columnsOrder:W,textPaddingLR:G,textColor:te,backgroundColor:ue,dividerColor:X,textHoverColor:H,backgroundHoverColor:Q,dividerHoverColor:z}=e,[B,Y]=l.useState(void 0),[oe,ie]=l.useState(null),O=F==="on"&&(!n||i),ce=($??0)>0,f=b==="b",de=l.useRef(null),be=l.useRef(null),[fe,Re]=l.useState(null),[Z,ge]=l.useState(Oi),U=Js(Z),V=Math.max(0,((w??0)-U)/2),j=Math.min(G??0,V),he=Math.max(j,oi),re=((w??0)+U)/2;l.useLayoutEffect(()=>{if(!n){ge(Oi);return}const pe=()=>{ge(Xp(de.current))};pe();const Le=de.current;if(!Le)return;const _e=new ResizeObserver(pe);_e.observe(Le);let We=Le;for(;We&&!We.style.getPropertyValue("--cntrl-article-width");)We=We.parentElement;return We&&_e.observe(We),()=>_e.disconnect()},[n,a]),l.useEffect(()=>{Y(void 0)},[$,C,t,S]),l.useEffect(()=>{n&&!i&&Y(void 0)},[n,i]);const Ce=P.buildColorVars(c,{textColor:te,backgroundColor:ue,dividerColor:X,textHoverColor:H,backgroundHoverColor:Q,dividerHoverColor:z},Gp,Up),Se=s&&s!=="default"?`${c}-state-${s}`:"",Ie=`${!n||i?I==="default"?`${c}-entry-hover-default`:I==="blinds"?`${c}-entry-hover-blinds`:I==="reveal"?`${c}-entry-hover-reveal`:"":""} ${Se}`.trim(),N=I==="reveal"&&(!n||i),ee=(T==null?void 0:T[0])??!1,R=(T==null?void 0:T[1])??!1,K=l.useRef(e),D=l.useRef(a);l.useEffect(()=>{if(!u||!n){K.current=e,D.current=a;return}if(D.current!==a){K.current=e,D.current=a;return}const pe=K.current;if(!(pe!==e))return;if(typeof pe.columns=="number"&&typeof e.columns=="number"&&pe.columns!==e.columns){K.current=e;return}const _e=om(e,pe,{designWidth:Z});K.current=e,el(e,_e)&&u(_e)},[e,u,n,a,Z]);const ae=l.useMemo(()=>sm(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),ne=l.useMemo(()=>mr(e,pi),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),ye=l.useMemo(()=>mr(e,mi),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),ke=l.useMemo(()=>mr(e,gi),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),Te=l.useMemo(()=>Array.isArray(W)&&W.length>0?W:[...Rn],[W]),xe=l.useMemo(()=>lm(Te,p,ae,ne,ye,ke),[Te,p,ae,ne,ye,ke]),Ke=Ii(e),se=l.useMemo(()=>Kt.slice(0,p).map(pe=>ae[pe]),[p,ae]),Ae=l.useMemo(()=>ta(p,Ke,ae),[p,Ke,ae]),Ne=l.useMemo(()=>Co(p,Ke,ae),[p,Ke,ae]),He=l.useMemo(()=>xe.map((pe,Le)=>Qs(Ne[Le]??0,pe.paddingLeft,pe.paddingRight)),[xe,Ne]),dt=l.useMemo(()=>{const pe=S===0?1/0:S;return(t??[]).slice(0,pe).map((_e,We)=>({id:We,cells:Object.fromEntries(Rn.map(tt=>[tt,_e[tt]??""])),image:_e.image,link:_e.link}))},[t,S]),ft=ce?B??$:dt.length,It=l.useMemo(()=>ce?dt.slice(0,ft):dt,[dt,ce,ft]),xt=ce&&ft<dt.length,wt=It.length>1||xt,Ht=[ee?`${c}-divider-top`:"",R||wt?`${c}-divider-bottom`:""].filter(Boolean).join(" "),Lt=!n||i,Xe=()=>{if(!Lt)return;const pe=B??$;if(!C){Y(dt.length);return}Y(Math.min(pe+C,dt.length))},Me=pe=>P.scalingValue(pe,n??!1),Ve=f?_??0:J??0,Ye=y??0,Be=g??0,ut=Ve+Be/2,Pt=Math.max(Ye,pr),Qe=Wa(0,It.length,ee,R,xt,v??0,n??!1).borderTopWidth,Mt=fe!=null?`${fe}px`:`calc(${Qe} + ${Me(ut)})`,Ot=f?"rowPaddingTopB":"rowPaddingTop",je=xe[0],gt=xe[xe.length-1],it=He[0],Ze=He[He.length-1],rt=je&&it?Math.max(it.paddingLeft,oi):0,at=gt&&Ze?Math.max(Ze.paddingRight,oi):0,sn=Ke,wn=pe=>{const Le=de.current;if(!Le)return{x:0,y:0};const _e=Le.getBoundingClientRect();return{x:pe.clientX-_e.left+Na,y:pe.clientY-_e.top+Na}},ln=(pe,Le)=>{if(!O)return;const _e=pe.image;if(!(_e!=null&&_e.url)){ie(null);return}const{x:We,y:tt}=wn(Le),$t=(k==null?void 0:k.min)??80,Ee=(k==null?void 0:k.max)??320,et=(oe==null?void 0:oe.rowId)===pe.id?oe.widthPx:am($t,Ee);ie({rowId:pe.id,url:_e.url,objectFit:"contain",isVideo:Ep(_e),widthPx:et,x:We,y:tt})},ot=pe=>{if(!O||!oe)return;const{x:Le,y:_e}=wn(pe);ie(We=>!We||We.x===Le&&We.y===_e?We:{...We,x:Le,y:_e})},tn=()=>{ie(null)},Ut=pe=>{N&&_a(pe,c),O&&ie(null)},qe=pe=>{N&&Fa(pe,c)};l.useLayoutEffect(()=>{if(!m||f){Re(null);return}const pe=be.current,Le=pe==null?void 0:pe.parentElement;if(!pe||!Le){Re(null);return}const _e=()=>{const tt=pe.querySelector("[data-list-row]");if(!tt){Re(null);return}const $t=Le.getBoundingClientRect(),Ee=tt.getBoundingClientRect();Re(Ee.top-$t.top+Ee.height/2)};_e();const We=new ResizeObserver(_e);return We.observe(pe),We.observe(Le),()=>We.disconnect()},[m,f,It,Ve,Ye,Be,t,e,xe,Ne,Z,v,ee,R,xt]);const yt=l.useMemo(()=>!f&&Zr.some(pe=>{const Le=pe.charAt(0),_e=e[`${pe}VerticalAlign`];return Ys(_e,e,Le)}),[f,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);l.useLayoutEffect(()=>{var et;const pe=de.current;if(!pe)return;const Le=()=>{pe.querySelectorAll("[data-list-col]").forEach(De=>{De.style.transform="";const st=De.querySelector(`.${c}-list-col`);st&&(st.style.minHeight="",st.style.height="");const pt=De.querySelector(`.${c}-list-col-title`);pt&&(pt.style.transform="")})};if(f||!yt){Le();return}const _e=()=>{const De=Array.from(pe.querySelectorAll("[data-list-row]")),st=`${c}-list-col`,pt=`${c}-baseline-probe`;De.forEach(kt=>{kt.querySelectorAll("[data-list-col]").forEach(Ge=>{Ge.style.transform="";const nt=Ge.querySelector(`.${st}`);nt&&(nt.style.minHeight="",nt.style.height="");const Et=Ge.querySelector(`.${c}-list-col-title`);Et&&(Et.style.transform="")})}),De.forEach(kt=>{const Ge=Array.from(kt.querySelectorAll("[data-list-col]"));jp(kt,Ge,st)}),pe.offsetHeight,De.forEach(kt=>{const Ge=Array.from(kt.querySelectorAll("[data-list-col]")),nt=kt.getBoundingClientRect().top,Et=new Map,St=Ge.map(ht=>{const Bt=ht.querySelector(`.${c}-list-col-title`),Wt={el:ht,titleEl:Bt,letter:ht.getAttribute("data-col-letter")??"",kind:ht.getAttribute("data-valign")??"top",anchor:ht.getAttribute("data-valign-anchor")};return Et.set(Wt.letter,Wt),Wt}),_t=new Map,$n=(ht,Bt)=>{const Wt=_t.get(ht.letter);if(Wt!==void 0)return Wt;const cn=ht.anchor?Et.get(ht.anchor):void 0;if(ht.kind!=="baseline"||!cn||Bt.has(ht.letter)){const Xn=ur(ht,nt,st,pt);return _t.set(ht.letter,Xn),Xn}Bt.add(ht.letter);const Sn=$n(cn,Bt);Bt.delete(ht.letter);const dn=ur(ht,nt,st,pt),zt=Sn-dn;zp(ht.titleEl,zt);const Cn=ur(ht,nt,st,pt);return _t.set(ht.letter,Cn),Cn};St.forEach(ht=>$n(ht,new Set))})};let We=null;const tt=()=>{We===null&&(We=requestAnimationFrame(()=>{We=null,_e()}))};_e();const $t=new ResizeObserver(()=>tt());$t.observe(pe);let Ee=!1;return typeof document<"u"&&((et=document.fonts)!=null&&et.ready)&&document.fonts.ready.then(()=>{Ee||tt()}),()=>{Ee=!0,We!==null&&(cancelAnimationFrame(We),We=null),$t.disconnect(),Le()}},[yt,f,e,t,Z,It,Ne]);const vt=l.useMemo(()=>Rp(c),[c]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:vt}}),r.jsx("div",{style:Ce,children:r.jsxs("div",{ref:de,className:`${c}-wrapper ${Ie}${Ht?` ${Ht}`:""}${f?` ${c}-type-b`:""}`.trim(),style:{width:P.scalingValue(w??0,n),...!f&&m?{[`--${c}-first-entry-handle-top`]:Mt}:{}},onMouseMove:O?ot:void 0,onMouseLeave:O?tn:void 0,children:[r.jsxs("div",{style:{width:"100%",position:"relative"},children:[It.map((pe,Le)=>{var $t;const _e=((($t=pe.link)==null?void 0:$t.length)??0)>0,We=_e&&(!n||i)?"a":"div",tt=Wa(Le,It.length,ee,R,xt,v??0,n??!1);return r.jsxs(We,{ref:Le===0?Ee=>{be.current=Ee}:void 0,className:`${c}-list-item${_e||E==="always"?` ${c}-list-item-has-link`:""}`,..._e?{href:pe.link,target:"_blank"}:{},style:tt,onMouseEnter:Ee=>{N&&(_e||E==="always")&&_a(Ee,c),O&&ln(pe,Ee)},onMouseLeave:Ee=>{N&&(_e||E==="always")&&Fa(Ee,c)},children:[Ve>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Me(Ve)}}),r.jsxs("div",{className:`${c}-list-cols-row${f?"":` ${c}-list-cols-row-h`}${m&&Le===0&&f?` ${c}-list-cols-row-controls`:""}`,...f?{}:{"data-list-row":""},style:f?void 0:{minHeight:Me(Be)},children:[xe.map((Ee,et)=>{const De=et===xe.length-1,st=He[et],pt=Ee.paddingBottom,kt=Pp(pe.cells[Ee.key]),Ge=f&&kt&&pt>0,nt=f?{minHeight:Me(Be)}:{width:Me(Ne[et])},Et=f?{paddingLeft:Me(j),paddingRight:Me(j)}:{paddingLeft:Me(st.paddingLeft),paddingRight:Me(st.paddingRight)},St=Ee.textPrefix.charAt(0),_t=f?Fp(e[`${Ee.textPrefix}VerticalAlign`]):_p(e[`${Ee.textPrefix}VerticalAlign`],e,St),$n=f&&kt&&m&&Le===0;return r.jsxs("div",{className:f?`${c}-list-col-wrap`:void 0,...f?{}:{"data-list-col":"","data-col-letter":St,"data-valign":_t.kind,..._t.kind==="baseline"?{"data-valign-anchor":_t.anchorLetter}:{}},children:[r.jsx("div",{className:`${c}-list-col${De?` ${c}-list-col-last`:""}`,style:{...Et,...nt,...f?{justifyContent:Ha(_t.kind)}:{}},"data-test":Ee.width,children:r.jsx("span",{className:Ba(e,Ee.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Oa(Ao(e,Ee.textPrefix),n),...ja(e,Ee.textPrefix,c,n),...f?{}:Np(_t.kind)},children:pe.cells[Ee.key]??null})}),Ge&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Me(pt)}}),$n&&r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Ee.paddingBottomKey,"data-controls-static-handle":"","data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:"center",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:Me(Math.max(pt,pr))}})]},Ee.key)}),m&&Le===0&&f&&r.jsxs(r.Fragment,{children:[r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":"textPaddingLR","data-controls-static-handle":"","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(re),className:`${c}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:0,width:Me(he),height:"100%"}}),r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":"textPaddingLR","data-controls-static-handle":"","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(re),className:`${c}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:Me(Math.max(he,Ke-he)),width:Me(he),height:"100%"}})]})]}),!f&&Ye>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Me(Ye)}}),m&&Le===0&&!f&&r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":"rowPaddingBottom","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:Me(Pt)}})]},pe.id)}),m&&r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Ot,"data-controls-static-handle":"",...f?{}:{"data-controls-handle-left":"20"},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:f?"center":"left-y",areaStyle:{position:"absolute",top:Qe,left:0,width:"100%",height:Me(Math.max(Ve,pr))}})},"row-padding-handles"),m&&!f&&je&&gt&&r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":je.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ne[0]-((it==null?void 0:it.paddingRight)??0)),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:Me(rt),height:"100%"}}),r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":gt.paddingRightKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ne[xe.length-1]-((Ze==null?void 0:Ze.paddingLeft)??0)),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Me(sn-at),width:Me(at),height:"100%"}})]},"column-edge-padding-handles"),m&&!f&&xe.slice(0,-1).map((pe,Le)=>{const _e=xe[Le+1],We=Ae.slice(0,Le+1).reduce((De,st)=>De+st,0),tt=He[Le],$t=He[Le+1],Ee=Math.max(tt.paddingRight,oi),et=Math.max($t.paddingLeft,oi);return r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":pe.paddingRightKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ne[Le]-tt.paddingLeft),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Me(We-Ee),width:Me(Ee),height:"100%"}}),r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":_e.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ne[Le+1]-$t.paddingRight),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Me(We),width:Me(et),height:"100%"}})]},`${pe.paddingRightKey}-padding`)}),m&&!f&&xe.slice(0,-1).map((pe,Le)=>{const _e=rm(Le,Ae,se,Ke),tt=Ae.slice(0,Le+1).reduce(($t,Ee)=>$t+Ee,0)-za/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":pe.widthKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-min":String(ea),"data-controls-max-fraction":String(_e),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Me(tt),width:Me(za),height:"calc(100%)",pointerEvents:"auto"}})},`${pe.widthKey}-junction`)})]}),xt&&(()=>{const pe=Ao(e,yn),Le=Hp(e.cutLabelVerticalAlign),_e=pe.textTextAlign==="justify"||f;return r.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:Me(L??0),cursor:Lt?"pointer":"default",...kp(R,v??0,n??!1)},onClick:Lt?Xe:void 0,onMouseEnter:N||O?Ut:void 0,onMouseLeave:N?qe:void 0,children:r.jsx("div",{className:`${c}-list-cols-row`,style:{...f?{paddingLeft:Me(j),paddingRight:Me(j)}:{},justifyContent:Op(pe.textTextAlign),alignItems:Ha(Le)},children:r.jsx("span",{className:Ba(e,yn,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Oa(pe,n),...ja(e,yn,c,n),..._e?{width:"100%"}:{}},children:A})})})})(),O&&oe&&(()=>{const pe=So(oe.widthPx),Le={width:pe,height:"auto",maxHeight:pe,objectFit:"contain",left:oe.x,top:oe.y,position:"absolute"};return r.jsx(Ip,{media:oe,className:oe.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:Le},`${oe.rowId}-${oe.url}`)})()]})})]})}const dm=`import { useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
6203
+ `}const Rn=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Zr=["AColumn","BColumn","CColumn","DColumn","EColumn"],yn="cutLabel",Ni=[...Zr,yn],Ko=["A","B","C","D","E"];function Us(e){return`${e}ColumnVerticalAlign`}const Er=["Top","Center","Bottom"];function Qr(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return Ko.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function Ap(e){const t=Qr(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function Mp(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return Ko.includes(n)?n:null}function Xs(e,t,n){const i=Mp(e);return i?i===t?!1:Ap(n[Us(i)]):!0}function Hi(e){const t=Qr(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return Ko.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function _p(e,t,n){if(Ys(e,t,n))return Hi(e);const i=Hi(e);return i.kind==="baseline"?{kind:"top"}:i}function Fp(e){const t=Hi(e);return t.kind==="baseline"?{kind:"top"}:t}function Ys(e,t,n){return Xs(e,n,t)?Hi(e).kind==="baseline":!1}function Wp(e){const t={};let n=!1;for(const i of Ko){const o=Us(i),s=e[o];if(e.type==="b"){const a=String(s??"Top").trim();a!=="Top"&&a!=="Center"&&a!=="Bottom"&&(t[o]="Top",n=!0);continue}Xs(s,i,e)||(t[o]="Top",n=!0)}return n?t:null}function Np(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function Hp(e){const t=Hi(e).kind;return t==="baseline"?"center":t}function Op(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Ha(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function Bp(e,t){const n=document.createElement("i");n.className=t,n.setAttribute("aria-hidden","true"),e.prepend(n);const{top:i}=e.getBoundingClientRect(),{bottom:o}=n.getBoundingClientRect(),s=o-i;return n.remove(),s}function ur(e,t,n,i){const o=e.titleEl;if(!o)return 0;const s=o.closest(`.${n}`);if(!s)return 0;const a=Bp(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+a;const u=s.getBoundingClientRect(),c=o.getBoundingClientRect().height;let m=0;return e.kind==="center"?m=(u.height-c)/2:e.kind==="bottom"&&(m=u.height-c),u.top-t+m+a}function jp(e,t,n){const i=e.getBoundingClientRect().height;return i<=0?0:(t.forEach(o=>{const s=o.querySelector(`.${n}`);s&&(s.style.minHeight=`${i}px`,s.style.height=`${i}px`)}),i)}function zp(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const Vp={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Je(e,t){return`${e}${t.replace(/^text/,"Text")}`}const Dp={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function qp(e){return[Je(e,"textFontFamily"),Je(e,"textFontSettings"),{type:"row",items:[Je(e,"textFontSize"),Je(e,"textLineHeight"),Je(e,"textLetterSpacing"),Je(e,"textWordSpacing")]},Je(e,"textTextAlign"),Je(e,"textTextAppearance"),`${e}VerticalAlign`]}function Kp(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(Ni.map(e=>[Dp[e],qp(e)]))}}function Ao(e,t){const n=i=>{const o=Je(t,i);return e[o]};return{textFontFamily:n("textFontFamily")??"Arial",textFontSettings:n("textFontSettings")??{fontWeight:400,fontStyle:"normal"},textFontSize:n("textFontSize"),textLineHeight:n("textLineHeight"),textLetterSpacing:n("textLetterSpacing")??0,textWordSpacing:n("textWordSpacing")??0,textTextAlign:n("textTextAlign")??(t===yn?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Oa(e,t){var i,o;const n={fontSettings:{fontFamily:e.textFontFamily,fontWeight:((i=e.textFontSettings)==null?void 0:i.fontWeight)??400,fontStyle:((o=e.textFontSettings)==null?void 0:o.fontStyle)??"normal"},fontSize:e.textFontSize??.01,lineHeight:e.textLineHeight,letterSpacing:e.textLetterSpacing,wordSpacing:e.textWordSpacing,textAlign:e.textTextAlign,textAppearance:e.textTextAppearance,color:e.textColor??"#767676"};return qt(At(n,t))}function Ba(e,t,n,i){const o=Ao(e,t),s=o.textFontSize??.01,a=o.textLineHeight;return a!==void 0&&a<s?`${n} ${i}`:n}function ja(e,t,n,i){const o=Ao(e,t),s=o.textFontSize??.01,a=o.textLineHeight;return a===void 0||a>=s?{}:{[`--${n}-title-leading-gap`]:P.scalingValue((s-a)/2,i)}}const Kt=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],pi=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],mi=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],gi=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Gp={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Up=["hover","focus","filled","success","error"],za=.004,oi=.004,pr=oi,ea=50,Oi=1440,Bi=ea/Oi;function Js(e){const t=typeof e=="number"&&e>0?e:Oi;return ea/t}function Xp(e){let t=e??null;for(;t;){const n=t.style.getPropertyValue("--cntrl-article-width").trim();if(n){const o=parseFloat(n);if(Number.isFinite(o)&&o>0)return o}const i=getComputedStyle(t).getPropertyValue("--cntrl-article-width").trim();if(i){const o=parseFloat(i);if(Number.isFinite(o)&&o>0)return o}t=t.parentElement}return Oi}const Zs={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function Ii(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function Yp(e,t=1){const n=t/e;return Object.fromEntries(Kt.map(i=>[i,n]))}function Jp(){return Object.fromEntries([...pi.map(e=>[e,0]),...mi.map(e=>[e,0])])}function Zp(){return Object.fromEntries(gi.map(e=>[e,0]))}function lo(e){return Object.fromEntries(Kt.map(t=>[t,typeof e[t]=="number"?e[t]:Zs[t]]))}function Qs(e,t,n){const i=e-Bi,o=t+n;if(o<=0||o<=i)return{paddingLeft:t,paddingRight:n};if(i<=0)return{paddingLeft:0,paddingRight:0};const s=i/o;return{paddingLeft:t*s,paddingRight:n*s}}function Co(e,t,n){const i=ta(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((s,a)=>s+a,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function Qp(e,t,n){const i={};for(let o=0;o<e;o+=1){const s=pi[o],a=mi[o],u=typeof n[s]=="number"?n[s]:0,c=typeof n[a]=="number"?n[a]:0,m=Qs(t[o]??0,u,c);m.paddingLeft!==u&&(i[s]=m.paddingLeft),m.paddingRight!==c&&(i[a]=m.paddingRight)}return i}function ta(e,t,n){if(e<=0)return[];const i=Kt.slice(0,e).map(m=>n[m]);if(e===1)return i;const o=i.slice(0,e-1),a=o.reduce((m,p)=>m+p,0)+Bi;if(t>=a)return i;const u=[...o];let c=a-t;for(let m=u.length-1;m>=0&&c>0;m-=1){const p=u[m]-Bi;if(p<=0)continue;const b=Math.min(c,p);u[m]-=b,c-=b}return[...u,i[e-1]]}function em(e,t,n){if(e<=1)return{};const i=ta(e,t,n),o={};for(let s=0;s<e-1;s+=1){const a=Kt[s];i[s]!==n[a]&&(o[a]=i[s])}return o}function Va(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Rn]}function tm(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function nm(e,t,n,i){const o=Math.min(i,e.length,Kt.length),s={};for(let a=0;a<o;a+=1){const u=e[a],c=t.indexOf(u);if(c===-1)continue;const m=Kt[c],p=pi[c],b=mi[c],w=gi[c],S=Kt[a],g=pi[a],v=mi[a],T=gi[a],$=n[m],C=n[p],L=n[b],A=n[w];typeof $=="number"&&(s[S]=$),typeof C=="number"&&(s[g]=C),typeof L=="number"&&(s[v]=L),typeof A=="number"&&(s[T]=A)}return s}function el(e,t){const n=new Set([...Object.keys(e),...Object.keys(t)]);for(const i of n)if(e[i]!==t[i])return!0;return!1}function im(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=Ii(e),s=e.type==="b"||e.type===void 0&&t.type==="b",a={...e,...Yp(n,o),...Jp()};if(s)for(const u of gi)typeof t[u]=="number"&&(a[u]=t[u]);else Object.assign(a,Zp());return el(e,a)?a:e}function om(e,t,n){const i=Wp(e);i&&(e={...e,...i});const o=Js(n==null?void 0:n.designWidth),s=e.columns,a=t.columns,u=Ii(e),c=Ii(t),m=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof s=="number"?s:typeof a=="number"?a:Rn.length,b=L=>{if(m)return L;const A=lo({...t,...L}),k=Ii(L),F=Co(p,k,A),I=Qp(p,F,{...t,...L});return Object.keys(I).length===0?L:{...L,...I}};if(typeof s=="number"&&s!==a)return e;const w=Va(e),S=Va(t);if(!tm(w,S))return b({...e,...nm(w,S,t,p)});if(u<c&&typeof p=="number"&&!m){const L=lo({...t,...e});return b({...e,...em(p,u,L)})}if(m){const L=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,A=Math.max(0,(u-o)/2);return L>A?{...e,textPaddingLR:A}:e}const g=lo({...t,...e}),v=Co(p,c,lo(t)),$=Co(p,u,g).some((L,A)=>L<(v[A]??L)),C=Kt.some(L=>{const A=e[L],k=t[L];return typeof A=="number"&&typeof k=="number"&&A!==k});return $||C?b(e):e}function rm(e,t,n,i){const o=t.slice(0,e).reduce((a,u)=>a+u,0),s=n.slice(e+1,t.length-1).reduce((a,u)=>a+u,0);return Math.max(Bi,i-o-s-Bi)}function am(e,t){return Math.random()*(t-e)+e}function sm(e){return Object.fromEntries(Kt.map(t=>[t,typeof e[t]=="number"?e[t]:Zs[t]]))}function mr(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function lm(e,t,n,i,o,s){return e.slice(0,t).map((a,u)=>{const c=pi[u],m=mi[u],p=gi[u];return{key:a,textPrefix:Vp[a],widthKey:Kt[u],width:n[Kt[u]],paddingLeftKey:c,paddingRightKey:m,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[m],paddingBottom:s[p]}})}function cm({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:s,layoutId:a,onUpdateSettings:u}){const{prefix:c}=P.useScopedStyles(),m=!!o,{columns:p,type:b,wrapperWidth:w,entriesCount:S,cellMinHeight:g,dividerWidth:v,showVisibility:T,cut:$,showCut:C,cutCellMinHeight:L,cutLabel:A,imageSize:k,imageOnHover:F,entryHoverEffect:I,entryHoverShowOption:E,rowPaddingTop:J,rowPaddingBottom:y,rowPaddingTopB:_,columnsOrder:W,textPaddingLR:G,textColor:te,backgroundColor:ue,dividerColor:X,textHoverColor:H,backgroundHoverColor:Q,dividerHoverColor:z}=e,[B,Y]=l.useState(void 0),[oe,ie]=l.useState(null),O=F==="on"&&(!n||i),ce=($??0)>0,f=b==="b",de=l.useRef(null),be=l.useRef(null),[fe,Re]=l.useState(null),[Z,ge]=l.useState(Oi),U=Js(Z),V=Math.max(0,((w??0)-U)/2),j=Math.min(G??0,V),he=Math.max(j,oi),re=((w??0)+U)/2;l.useLayoutEffect(()=>{if(!n){ge(Oi);return}const pe=()=>{ge(Xp(de.current))};pe();const Le=de.current;if(!Le)return;const _e=new ResizeObserver(pe);_e.observe(Le);let We=Le;for(;We&&!We.style.getPropertyValue("--cntrl-article-width");)We=We.parentElement;return We&&_e.observe(We),()=>_e.disconnect()},[n,a]),l.useEffect(()=>{Y(void 0)},[$,C,t,S]),l.useEffect(()=>{n&&!i&&Y(void 0)},[n,i]);const Ce=P.buildColorVars(c,{textColor:te,backgroundColor:ue,dividerColor:X,textHoverColor:H,backgroundHoverColor:Q,dividerHoverColor:z},Gp,Up),Se=s&&s!=="default"?`${c}-state-${s}`:"",Ie=`${!n||i?I==="default"?`${c}-entry-hover-default`:I==="blinds"?`${c}-entry-hover-blinds`:I==="reveal"?`${c}-entry-hover-reveal`:"":""} ${Se}`.trim(),N=I==="reveal"&&(!n||i),ee=(T==null?void 0:T[0])??!1,R=(T==null?void 0:T[1])??!1,K=l.useRef(e),D=l.useRef(a);l.useEffect(()=>{if(!u||!n){K.current=e,D.current=a;return}if(D.current!==a){K.current=e,D.current=a;return}const pe=K.current;if(!(pe!==e))return;if(typeof pe.columns=="number"&&typeof e.columns=="number"&&pe.columns!==e.columns){K.current=e;return}const _e=om(e,pe,{designWidth:Z});K.current=e,el(e,_e)&&u(_e)},[e,u,n,a,Z]);const ae=l.useMemo(()=>sm(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),ne=l.useMemo(()=>mr(e,pi),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),ye=l.useMemo(()=>mr(e,mi),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),ke=l.useMemo(()=>mr(e,gi),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),Te=l.useMemo(()=>Array.isArray(W)&&W.length>0?W:[...Rn],[W]),xe=l.useMemo(()=>lm(Te,p,ae,ne,ye,ke),[Te,p,ae,ne,ye,ke]),qe=Ii(e),se=l.useMemo(()=>Kt.slice(0,p).map(pe=>ae[pe]),[p,ae]),Ae=l.useMemo(()=>ta(p,qe,ae),[p,qe,ae]),Ne=l.useMemo(()=>Co(p,qe,ae),[p,qe,ae]),He=l.useMemo(()=>xe.map((pe,Le)=>Qs(Ne[Le]??0,pe.paddingLeft,pe.paddingRight)),[xe,Ne]),dt=l.useMemo(()=>{const pe=S===0?1/0:S;return(t??[]).slice(0,pe).map((_e,We)=>({id:We,cells:Object.fromEntries(Rn.map(tt=>[tt,_e[tt]??""])),image:_e.image,link:_e.link}))},[t,S]),ft=ce?B??$:dt.length,It=l.useMemo(()=>ce?dt.slice(0,ft):dt,[dt,ce,ft]),xt=ce&&ft<dt.length,wt=It.length>1||xt,Ht=[ee?`${c}-divider-top`:"",R||wt?`${c}-divider-bottom`:""].filter(Boolean).join(" "),Lt=!n||i,Xe=()=>{if(!Lt)return;const pe=B??$;if(!C){Y(dt.length);return}Y(Math.min(pe+C,dt.length))},Me=pe=>P.scalingValue(pe,n??!1),Ve=f?_??0:J??0,Ye=y??0,Be=g??0,ut=Ve+Be/2,Pt=Math.max(Ye,pr),Qe=Wa(0,It.length,ee,R,xt,v??0,n??!1).borderTopWidth,Mt=fe!=null?`${fe}px`:`calc(${Qe} + ${Me(ut)})`,Ot=f?"rowPaddingTopB":"rowPaddingTop",je=xe[0],gt=xe[xe.length-1],it=He[0],Ze=He[He.length-1],rt=je&&it?Math.max(it.paddingLeft,oi):0,at=gt&&Ze?Math.max(Ze.paddingRight,oi):0,sn=qe,wn=pe=>{const Le=de.current;if(!Le)return{x:0,y:0};const _e=Le.getBoundingClientRect();return{x:pe.clientX-_e.left+Na,y:pe.clientY-_e.top+Na}},ln=(pe,Le)=>{if(!O)return;const _e=pe.image;if(!(_e!=null&&_e.url)){ie(null);return}const{x:We,y:tt}=wn(Le),$t=(k==null?void 0:k.min)??80,Ee=(k==null?void 0:k.max)??320,et=(oe==null?void 0:oe.rowId)===pe.id?oe.widthPx:am($t,Ee);ie({rowId:pe.id,url:_e.url,objectFit:"contain",isVideo:Ep(_e),widthPx:et,x:We,y:tt})},ot=pe=>{if(!O||!oe)return;const{x:Le,y:_e}=wn(pe);ie(We=>!We||We.x===Le&&We.y===_e?We:{...We,x:Le,y:_e})},tn=()=>{ie(null)},Ut=pe=>{N&&_a(pe,c),O&&ie(null)},Ke=pe=>{N&&Fa(pe,c)};l.useLayoutEffect(()=>{if(!m||f){Re(null);return}const pe=be.current,Le=pe==null?void 0:pe.parentElement;if(!pe||!Le){Re(null);return}const _e=()=>{const tt=pe.querySelector("[data-list-row]");if(!tt){Re(null);return}const $t=Le.getBoundingClientRect(),Ee=tt.getBoundingClientRect();Re(Ee.top-$t.top+Ee.height/2)};_e();const We=new ResizeObserver(_e);return We.observe(pe),We.observe(Le),()=>We.disconnect()},[m,f,It,Ve,Ye,Be,t,e,xe,Ne,Z,v,ee,R,xt]);const yt=l.useMemo(()=>!f&&Zr.some(pe=>{const Le=pe.charAt(0),_e=e[`${pe}VerticalAlign`];return Ys(_e,e,Le)}),[f,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);l.useLayoutEffect(()=>{var et;const pe=de.current;if(!pe)return;const Le=()=>{pe.querySelectorAll("[data-list-col]").forEach(De=>{De.style.transform="";const st=De.querySelector(`.${c}-list-col`);st&&(st.style.minHeight="",st.style.height="");const pt=De.querySelector(`.${c}-list-col-title`);pt&&(pt.style.transform="")})};if(f||!yt){Le();return}const _e=()=>{const De=Array.from(pe.querySelectorAll("[data-list-row]")),st=`${c}-list-col`,pt=`${c}-baseline-probe`;De.forEach(kt=>{kt.querySelectorAll("[data-list-col]").forEach(Ge=>{Ge.style.transform="";const nt=Ge.querySelector(`.${st}`);nt&&(nt.style.minHeight="",nt.style.height="");const Et=Ge.querySelector(`.${c}-list-col-title`);Et&&(Et.style.transform="")})}),De.forEach(kt=>{const Ge=Array.from(kt.querySelectorAll("[data-list-col]"));jp(kt,Ge,st)}),pe.offsetHeight,De.forEach(kt=>{const Ge=Array.from(kt.querySelectorAll("[data-list-col]")),nt=kt.getBoundingClientRect().top,Et=new Map,St=Ge.map(ht=>{const Bt=ht.querySelector(`.${c}-list-col-title`),Wt={el:ht,titleEl:Bt,letter:ht.getAttribute("data-col-letter")??"",kind:ht.getAttribute("data-valign")??"top",anchor:ht.getAttribute("data-valign-anchor")};return Et.set(Wt.letter,Wt),Wt}),_t=new Map,$n=(ht,Bt)=>{const Wt=_t.get(ht.letter);if(Wt!==void 0)return Wt;const cn=ht.anchor?Et.get(ht.anchor):void 0;if(ht.kind!=="baseline"||!cn||Bt.has(ht.letter)){const Xn=ur(ht,nt,st,pt);return _t.set(ht.letter,Xn),Xn}Bt.add(ht.letter);const Sn=$n(cn,Bt);Bt.delete(ht.letter);const dn=ur(ht,nt,st,pt),zt=Sn-dn;zp(ht.titleEl,zt);const Cn=ur(ht,nt,st,pt);return _t.set(ht.letter,Cn),Cn};St.forEach(ht=>$n(ht,new Set))})};let We=null;const tt=()=>{We===null&&(We=requestAnimationFrame(()=>{We=null,_e()}))};_e();const $t=new ResizeObserver(()=>tt());$t.observe(pe);let Ee=!1;return typeof document<"u"&&((et=document.fonts)!=null&&et.ready)&&document.fonts.ready.then(()=>{Ee||tt()}),()=>{Ee=!0,We!==null&&(cancelAnimationFrame(We),We=null),$t.disconnect(),Le()}},[yt,f,e,t,Z,It,Ne]);const vt=l.useMemo(()=>Rp(c),[c]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:vt}}),r.jsx("div",{style:Ce,children:r.jsxs("div",{ref:de,className:`${c}-wrapper ${Ie}${Ht?` ${Ht}`:""}${f?` ${c}-type-b`:""}`.trim(),style:{width:P.scalingValue(w??0,n),...!f&&m?{[`--${c}-first-entry-handle-top`]:Mt}:{}},onMouseMove:O?ot:void 0,onMouseLeave:O?tn:void 0,children:[r.jsxs("div",{style:{width:"100%",position:"relative"},children:[It.map((pe,Le)=>{var $t;const _e=((($t=pe.link)==null?void 0:$t.length)??0)>0,We=_e&&(!n||i)?"a":"div",tt=Wa(Le,It.length,ee,R,xt,v??0,n??!1);return r.jsxs(We,{ref:Le===0?Ee=>{be.current=Ee}:void 0,className:`${c}-list-item${_e||E==="always"?` ${c}-list-item-has-link`:""}`,..._e?{href:pe.link,target:"_blank"}:{},style:tt,onMouseEnter:Ee=>{N&&(_e||E==="always")&&_a(Ee,c),O&&ln(pe,Ee)},onMouseLeave:Ee=>{N&&(_e||E==="always")&&Fa(Ee,c)},children:[Ve>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Me(Ve)}}),r.jsxs("div",{className:`${c}-list-cols-row${f?"":` ${c}-list-cols-row-h`}${m&&Le===0&&f?` ${c}-list-cols-row-controls`:""}`,...f?{}:{"data-list-row":""},style:f?void 0:{minHeight:Me(Be)},children:[xe.map((Ee,et)=>{const De=et===xe.length-1,st=He[et],pt=Ee.paddingBottom,kt=Pp(pe.cells[Ee.key]),Ge=f&&kt&&pt>0,nt=f?{minHeight:Me(Be)}:{width:Me(Ne[et])},Et=f?{paddingLeft:Me(j),paddingRight:Me(j)}:{paddingLeft:Me(st.paddingLeft),paddingRight:Me(st.paddingRight)},St=Ee.textPrefix.charAt(0),_t=f?Fp(e[`${Ee.textPrefix}VerticalAlign`]):_p(e[`${Ee.textPrefix}VerticalAlign`],e,St),$n=f&&kt&&m&&Le===0;return r.jsxs("div",{className:f?`${c}-list-col-wrap`:void 0,...f?{}:{"data-list-col":"","data-col-letter":St,"data-valign":_t.kind,..._t.kind==="baseline"?{"data-valign-anchor":_t.anchorLetter}:{}},children:[r.jsx("div",{className:`${c}-list-col${De?` ${c}-list-col-last`:""}`,style:{...Et,...nt,...f?{justifyContent:Ha(_t.kind)}:{}},"data-test":Ee.width,children:r.jsx("span",{className:Ba(e,Ee.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Oa(Ao(e,Ee.textPrefix),n),...ja(e,Ee.textPrefix,c,n),...f?{}:Np(_t.kind)},children:pe.cells[Ee.key]??null})}),Ge&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Me(pt)}}),$n&&r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Ee.paddingBottomKey,"data-controls-static-handle":"","data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:"center",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:Me(Math.max(pt,pr))}})]},Ee.key)}),m&&Le===0&&f&&r.jsxs(r.Fragment,{children:[r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":"textPaddingLR","data-controls-static-handle":"","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(re),className:`${c}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:0,width:Me(he),height:"100%"}}),r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":"textPaddingLR","data-controls-static-handle":"","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(re),className:`${c}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:Me(Math.max(he,qe-he)),width:Me(he),height:"100%"}})]})]}),!f&&Ye>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Me(Ye)}}),m&&Le===0&&!f&&r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":"rowPaddingBottom","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:Me(Pt)}})]},pe.id)}),m&&r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Ot,"data-controls-static-handle":"",...f?{}:{"data-controls-handle-left":"20"},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:f?"center":"left-y",areaStyle:{position:"absolute",top:Qe,left:0,width:"100%",height:Me(Math.max(Ve,pr))}})},"row-padding-handles"),m&&!f&&je&&gt&&r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":je.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ne[0]-((it==null?void 0:it.paddingRight)??0)),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:Me(rt),height:"100%"}}),r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":gt.paddingRightKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ne[xe.length-1]-((Ze==null?void 0:Ze.paddingLeft)??0)),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Me(sn-at),width:Me(at),height:"100%"}})]},"column-edge-padding-handles"),m&&!f&&xe.slice(0,-1).map((pe,Le)=>{const _e=xe[Le+1],We=Ae.slice(0,Le+1).reduce((De,st)=>De+st,0),tt=He[Le],$t=He[Le+1],Ee=Math.max(tt.paddingRight,oi),et=Math.max($t.paddingLeft,oi);return r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":pe.paddingRightKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ne[Le]-tt.paddingLeft),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Me(We-Ee),width:Me(Ee),height:"100%"}}),r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":_e.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ne[Le+1]-$t.paddingRight),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Me(We),width:Me(et),height:"100%"}})]},`${pe.paddingRightKey}-padding`)}),m&&!f&&xe.slice(0,-1).map((pe,Le)=>{const _e=rm(Le,Ae,se,qe),tt=Ae.slice(0,Le+1).reduce(($t,Ee)=>$t+Ee,0)-za/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":pe.widthKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-min":String(ea),"data-controls-max-fraction":String(_e),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Me(tt),width:Me(za),height:"calc(100%)",pointerEvents:"auto"}})},`${pe.widthKey}-junction`)})]}),xt&&(()=>{const pe=Ao(e,yn),Le=Hp(e.cutLabelVerticalAlign),_e=pe.textTextAlign==="justify"||f;return r.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:Me(L??0),cursor:Lt?"pointer":"default",...kp(R,v??0,n??!1)},onClick:Lt?Xe:void 0,onMouseEnter:N||O?Ut:void 0,onMouseLeave:N?Ke:void 0,children:r.jsx("div",{className:`${c}-list-cols-row`,style:{...f?{paddingLeft:Me(j),paddingRight:Me(j)}:{},justifyContent:Op(pe.textTextAlign),alignItems:Ha(Le)},children:r.jsx("span",{className:Ba(e,yn,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Oa(pe,n),...ja(e,yn,c,n),..._e?{width:"100%"}:{}},children:A})})})})(),O&&oe&&(()=>{const pe=So(oe.widthPx),Le={width:pe,height:"auto",maxHeight:pe,objectFit:"contain",left:oe.x,top:oe.y,position:"absolute"};return r.jsx(Ip,{media:oe,className:oe.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:Le},`${oe.rowId}-${oe.url}`)})()]})})]})}const dm=`import { useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
6204
6204
  import { CommonComponentProps } from '../props';
6205
6205
  import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
6206
6206
  import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';
@@ -9350,7 +9350,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
9350
9350
  left: 20px;
9351
9351
  transform: translateY(-50%);
9352
9352
  }
9353
- `}function Ya(e,t,n,i,o,s,a,u){return{fontSettings:{fontFamily:e,fontWeight:(t==null?void 0:t.fontWeight)??400,fontStyle:(t==null?void 0:t.fontStyle)??"normal"},fontSize:n??.01,lineHeight:i,letterSpacing:o??0,wordSpacing:s??0,textAppearance:a,color:u??"#000000"}}function Am({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:s}){const{prefix:a}=P.useScopedStyles(),u=o??!1,{wrapperWidth:c=1,cellMinHeight:m=0,dividerWidth:p=694e-6,dividerStyle:b="solid",entryHoverEffect:w="default",autoclose:S="off",icon:g,iconMaxWidth:v=.00833,iconPaddingRight:T=0,iconAnimation:$="rotate 45",questionColor:C="#000000",answerColor:L="#000000",dividerColor:A="#0000001F",iconColor:k="#000000",questionHoverColor:F="#666666",iconHoverColor:I="#666666",iconActiveColor:E="#000000",dividerHoverColor:J="#000000",questionFontFamily:y,questionFontSettings:_,questionFontSize:W,questionLineHeight:G,questionLetterSpacing:te,questionWordSpacing:ue,questionTextAppearance:X,answerFontFamily:H,answerFontSettings:Q,answerFontSize:z,answerLineHeight:B,answerLetterSpacing:Y,answerWordSpacing:oe,answerTextAppearance:ie,questionPaddingLeft:O=0,questionPaddingTop:ce=0,questionPaddingBottom:f=0,answerPaddingLeft:de=0,answerPaddingRight:be=0,answerPaddingTop:fe=0,answerPaddingBottom:Re=0}=e,Z=t??[],[ge,U]=l.useState(()=>new Set),V=!n||i;l.useEffect(()=>{U(new Set)},[S]),l.useEffect(()=>{n&&!o&&!i&&U(new Set)},[n,o,i]);const j=Me=>P.scalingValue(Me,n??!1),he=Math.max(O,Ln),re=Math.max(ce,Ln),Ce=Math.max(f,Ln),Se=Math.max(de,Ln),we=Math.max(be,Ln),Ie=Math.max(fe,Ln),N=Math.max(Re,Ln),ee=Math.max(0,(c??1)-T-v),R=Math.max(0,(c??1)-be),K=Math.max(0,(c??1)-de),D=Math.max(T,Ln),ae=Math.max(0,(c??1)-O-v),ne=l.useMemo(()=>ge.size===0?0:Math.min(...ge),[ge]),ye=l.useCallback(Me=>ge.has(Me),[ge]),ke=V&&w==="default"?`${a}-entry-hover-default`:"",Te=g??"",xe=Te!=="",Ke=$.replace(/^rotate /,""),se=`${a}-icon-anim-${Ke}`,Ae=qt(At(Ya(y,_,W,G,te,ue,X,C),n)),Ne=qt(At(Ya(H,Q,z,B,Y,oe,ie,L),n)),He=Ua(W,G,`${a}-question`,`${a}-text-tight-leading`),dt=Ua(z,B,`${a}-answer-text`,`${a}-text-tight-leading`),ft=Xa(W,G,a,n),It=Xa(z,B,a,n),xt=P.buildColorVars(a,{questionColor:C,answerColor:L,dividerColor:A,iconColor:k,questionHoverColor:F,iconHoverColor:I,iconActiveColor:E,dividerHoverColor:J},Im,Pm),wt=s&&s!=="default"?`${a}-state-${s}`:"",Ht=l.useCallback(Me=>{V&&U(Ve=>{if(Ve.has(Me)){const Be=new Set(Ve);return Be.delete(Me),Be}if(S==="on")return new Set([Me]);const Ye=new Set(Ve);return Ye.add(Me),Ye})},[V,S]),Lt=l.useMemo(()=>Rm(a),[a]),Xe={[`--${a}-divider-width`]:P.scalingValue(p,n??!1),[`--${a}-divider-style`]:b,[`--${a}-icon-max-width`]:P.scalingValue(v,n??!1),...m>0?{[`--${a}-question-min-height`]:P.scalingValue(m,n??!1)}:{}};return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Lt}}),r.jsx("div",{style:xt,children:r.jsx("div",{className:ze(`${a}-wrapper`,n&&!i&&`${a}-editor`,ke,wt),style:{width:P.scalingValue(c,n??!1),maxWidth:"100%",...Xe},children:Z.map((Me,Ve)=>{var Mt;const Ye=ye(Ve),Be=((Mt=Me.question)==null?void 0:Mt.trim())??"",ut=Me.answer,Pt=((ut==null?void 0:ut.length)??0)>0,Qe=u&&Ve===ne;return r.jsxs("div",{className:ze(`${a}-item`,Ye&&`${a}-item-open`),"data-faq-item":"",children:[r.jsxs("div",{className:`${a}-question-controls`,children:[Qe&&r.jsxs(r.Fragment,{children:[r.jsx(Ft,{"data-controls":"questionPaddingTop","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${a}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",top:0,left:0,width:"100%",height:j(re),zIndex:2}}),r.jsx(Ft,{"data-controls":"questionPaddingLeft","data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(ee),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:j(he),height:"100%",zIndex:2}}),r.jsx(Ft,{"data-controls":"iconPaddingRight","data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(ae),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,right:0,width:j(D),height:"100%",zIndex:2}})]}),r.jsxs("button",{type:"button",className:`${a}-question-button`,"aria-expanded":Ye,style:{...Ae,...ft,paddingLeft:j(O),paddingRight:j(T)},onClick:()=>Ht(Ve),children:[ce>0&&r.jsx("span",{className:`${a}-padding-handle`,style:{height:j(ce)},"aria-hidden":"true"}),r.jsxs("span",{className:`${a}-question-row`,children:[r.jsx("span",{className:He,children:Be}),Pt&&(xe?r.jsx("span",{className:`${a}-icon ${a}-icon-custom ${se}`,"aria-hidden":"true",children:r.jsx(Qt,{url:Te,fill:k,hoverFill:I,className:`${a}-icon-image`})}):r.jsx("span",{className:`${a}-icon ${a}-icon-default ${se}`,"aria-hidden":"true"}))]}),f>0&&r.jsx("span",{className:`${a}-padding-handle`,style:{height:j(f)},"aria-hidden":"true"})]}),Qe&&r.jsx(Ft,{"data-controls":"questionPaddingBottom","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${a}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:j(Ce),zIndex:2}})]}),Pt&&ut&&r.jsx("div",{className:`${a}-panel`,"aria-hidden":!Ye,children:r.jsx("div",{className:`${a}-panel-inner`,children:r.jsxs("div",{className:`${a}-answer-controls`,children:[Qe&&Ye&&r.jsxs(r.Fragment,{children:[r.jsx(Ft,{"data-controls":"answerPaddingTop","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${a}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",top:0,left:0,width:"100%",height:j(Ie),zIndex:2}}),r.jsx(Ft,{"data-controls":"answerPaddingLeft","data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(R),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:j(Se),height:"100%",zIndex:2}}),r.jsx(Ft,{"data-controls":"answerPaddingRight","data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(K),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,right:0,width:j(we),height:"100%",zIndex:2}})]}),fe>0&&r.jsx("div",{className:`${a}-padding-handle`,style:{height:j(fe)}}),r.jsx("div",{className:`${a}-answer`,style:{...Ne,...It,paddingLeft:j(de),paddingRight:j(be)},children:r.jsx("div",{className:dt,children:r.jsx(ui,{content:ut})})}),Re>0&&r.jsx("div",{className:`${a}-padding-handle`,style:{height:j(Re)}}),Qe&&Ye&&r.jsx(Ft,{"data-controls":"answerPaddingBottom","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${a}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:j(N),zIndex:2}})]})})})]},Ve)})})})]})}const Mm=`import { useCallback, useEffect, useMemo, useState } from 'react';
9353
+ `}function Ya(e,t,n,i,o,s,a,u){return{fontSettings:{fontFamily:e,fontWeight:(t==null?void 0:t.fontWeight)??400,fontStyle:(t==null?void 0:t.fontStyle)??"normal"},fontSize:n??.01,lineHeight:i,letterSpacing:o??0,wordSpacing:s??0,textAppearance:a,color:u??"#000000"}}function Am({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:s}){const{prefix:a}=P.useScopedStyles(),u=o??!1,{wrapperWidth:c=1,cellMinHeight:m=0,dividerWidth:p=694e-6,dividerStyle:b="solid",entryHoverEffect:w="default",autoclose:S="off",icon:g,iconMaxWidth:v=.00833,iconPaddingRight:T=0,iconAnimation:$="rotate 45",questionColor:C="#000000",answerColor:L="#000000",dividerColor:A="#0000001F",iconColor:k="#000000",questionHoverColor:F="#666666",iconHoverColor:I="#666666",iconActiveColor:E="#000000",dividerHoverColor:J="#000000",questionFontFamily:y,questionFontSettings:_,questionFontSize:W,questionLineHeight:G,questionLetterSpacing:te,questionWordSpacing:ue,questionTextAppearance:X,answerFontFamily:H,answerFontSettings:Q,answerFontSize:z,answerLineHeight:B,answerLetterSpacing:Y,answerWordSpacing:oe,answerTextAppearance:ie,questionPaddingLeft:O=0,questionPaddingTop:ce=0,questionPaddingBottom:f=0,answerPaddingLeft:de=0,answerPaddingRight:be=0,answerPaddingTop:fe=0,answerPaddingBottom:Re=0}=e,Z=t??[],[ge,U]=l.useState(()=>new Set),V=!n||i;l.useEffect(()=>{U(new Set)},[S]),l.useEffect(()=>{n&&!o&&!i&&U(new Set)},[n,o,i]);const j=Me=>P.scalingValue(Me,n??!1),he=Math.max(O,Ln),re=Math.max(ce,Ln),Ce=Math.max(f,Ln),Se=Math.max(de,Ln),we=Math.max(be,Ln),Ie=Math.max(fe,Ln),N=Math.max(Re,Ln),ee=Math.max(0,(c??1)-T-v),R=Math.max(0,(c??1)-be),K=Math.max(0,(c??1)-de),D=Math.max(T,Ln),ae=Math.max(0,(c??1)-O-v),ne=l.useMemo(()=>ge.size===0?0:Math.min(...ge),[ge]),ye=l.useCallback(Me=>ge.has(Me),[ge]),ke=V&&w==="default"?`${a}-entry-hover-default`:"",Te=g??"",xe=Te!=="",qe=$.replace(/^rotate /,""),se=`${a}-icon-anim-${qe}`,Ae=qt(At(Ya(y,_,W,G,te,ue,X,C),n)),Ne=qt(At(Ya(H,Q,z,B,Y,oe,ie,L),n)),He=Ua(W,G,`${a}-question`,`${a}-text-tight-leading`),dt=Ua(z,B,`${a}-answer-text`,`${a}-text-tight-leading`),ft=Xa(W,G,a,n),It=Xa(z,B,a,n),xt=P.buildColorVars(a,{questionColor:C,answerColor:L,dividerColor:A,iconColor:k,questionHoverColor:F,iconHoverColor:I,iconActiveColor:E,dividerHoverColor:J},Im,Pm),wt=s&&s!=="default"?`${a}-state-${s}`:"",Ht=l.useCallback(Me=>{V&&U(Ve=>{if(Ve.has(Me)){const Be=new Set(Ve);return Be.delete(Me),Be}if(S==="on")return new Set([Me]);const Ye=new Set(Ve);return Ye.add(Me),Ye})},[V,S]),Lt=l.useMemo(()=>Rm(a),[a]),Xe={[`--${a}-divider-width`]:P.scalingValue(p,n??!1),[`--${a}-divider-style`]:b,[`--${a}-icon-max-width`]:P.scalingValue(v,n??!1),...m>0?{[`--${a}-question-min-height`]:P.scalingValue(m,n??!1)}:{}};return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Lt}}),r.jsx("div",{style:xt,children:r.jsx("div",{className:ze(`${a}-wrapper`,n&&!i&&`${a}-editor`,ke,wt),style:{width:P.scalingValue(c,n??!1),maxWidth:"100%",...Xe},children:Z.map((Me,Ve)=>{var Mt;const Ye=ye(Ve),Be=((Mt=Me.question)==null?void 0:Mt.trim())??"",ut=Me.answer,Pt=((ut==null?void 0:ut.length)??0)>0,Qe=u&&Ve===ne;return r.jsxs("div",{className:ze(`${a}-item`,Ye&&`${a}-item-open`),"data-faq-item":"",children:[r.jsxs("div",{className:`${a}-question-controls`,children:[Qe&&r.jsxs(r.Fragment,{children:[r.jsx(Ft,{"data-controls":"questionPaddingTop","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${a}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",top:0,left:0,width:"100%",height:j(re),zIndex:2}}),r.jsx(Ft,{"data-controls":"questionPaddingLeft","data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(ee),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:j(he),height:"100%",zIndex:2}}),r.jsx(Ft,{"data-controls":"iconPaddingRight","data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(ae),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,right:0,width:j(D),height:"100%",zIndex:2}})]}),r.jsxs("button",{type:"button",className:`${a}-question-button`,"aria-expanded":Ye,style:{...Ae,...ft,paddingLeft:j(O),paddingRight:j(T)},onClick:()=>Ht(Ve),children:[ce>0&&r.jsx("span",{className:`${a}-padding-handle`,style:{height:j(ce)},"aria-hidden":"true"}),r.jsxs("span",{className:`${a}-question-row`,children:[r.jsx("span",{className:He,children:Be}),Pt&&(xe?r.jsx("span",{className:`${a}-icon ${a}-icon-custom ${se}`,"aria-hidden":"true",children:r.jsx(Qt,{url:Te,fill:k,hoverFill:I,className:`${a}-icon-image`})}):r.jsx("span",{className:`${a}-icon ${a}-icon-default ${se}`,"aria-hidden":"true"}))]}),f>0&&r.jsx("span",{className:`${a}-padding-handle`,style:{height:j(f)},"aria-hidden":"true"})]}),Qe&&r.jsx(Ft,{"data-controls":"questionPaddingBottom","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${a}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:j(Ce),zIndex:2}})]}),Pt&&ut&&r.jsx("div",{className:`${a}-panel`,"aria-hidden":!Ye,children:r.jsx("div",{className:`${a}-panel-inner`,children:r.jsxs("div",{className:`${a}-answer-controls`,children:[Qe&&Ye&&r.jsxs(r.Fragment,{children:[r.jsx(Ft,{"data-controls":"answerPaddingTop","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${a}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",top:0,left:0,width:"100%",height:j(Ie),zIndex:2}}),r.jsx(Ft,{"data-controls":"answerPaddingLeft","data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(R),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:j(Se),height:"100%",zIndex:2}}),r.jsx(Ft,{"data-controls":"answerPaddingRight","data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(K),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,right:0,width:j(we),height:"100%",zIndex:2}})]}),fe>0&&r.jsx("div",{className:`${a}-padding-handle`,style:{height:j(fe)}}),r.jsx("div",{className:`${a}-answer`,style:{...Ne,...It,paddingLeft:j(de),paddingRight:j(be)},children:r.jsx("div",{className:dt,children:r.jsx(ui,{content:ut})})}),Re>0&&r.jsx("div",{className:`${a}-padding-handle`,style:{height:j(Re)}}),Qe&&Ye&&r.jsx(Ft,{"data-controls":"answerPaddingBottom","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${a}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:j(N),zIndex:2}})]})})})]},Ve)})})})]})}const Mm=`import { useCallback, useEffect, useMemo, useState } from 'react';
9354
9354
  import cn from 'classnames';
9355
9355
  import { CommonComponentProps } from '../props';
9356
9356
  import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
@@ -10147,7 +10147,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
10147
10147
  </>
10148
10148
  );
10149
10149
  }
10150
- `;function En(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Ja={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},_m=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],Fm={type:"object",version:1,content:{type:"array",display:{type:"array"},items:{type:"object",properties:{question:{type:"string",label:"Question",placeholder:"Add question...",display:{type:"text-input"}},answer:{label:"Answer",placeholder:"Add answer...",display:{type:"rich-text"}}}},default:[{question:"What are the three main parts of The Divine Comedy?",answer:[{type:"paragraph",children:[{text:"The poem is divided into Inferno, Purgatorio, and Paradiso. These three sections follow Dante’s journey through Hell, Purgatory, and Heaven."}]}]},{question:"Who guides Dante through Hell and most of Purgatory?",answer:[{type:"paragraph",children:[{text:"Dante is guided by Virgil, the ancient Roman poet. Virgil represents human reason and wisdom, but because he lived before Christianity, he cannot guide Dante all the way into Heaven."}]}]},{question:"What does the dark wood at the beginning of the poem symbolize?",answer:[{type:"paragraph",children:[{text:"The dark wood symbolizes Dante’s spiritual confusion and moral crisis. It shows that he has lost the “straight way” in life and needs guidance to return to truth and salvation."}]}]},{question:"What is “contrapasso” in Inferno?",answer:[{type:"paragraph",children:[{text:"“Contrapasso” is the principle that punishments in Hell reflect the sins committed during life. For example, people who caused division are themselves physically divided, showing how their punishment mirrors their wrongdoing."}]}]},{question:"Who guides Dante through Heaven?",answer:[{type:"paragraph",children:[{text:"Beatrice guides Dante through Paradiso. She represents divine love, grace, and spiritual understanding, helping Dante move beyond human reason toward a vision of God."}]}]},{question:"Why is The Divine Comedy important in literary history?",answer:[{type:"paragraph",children:[{text:"The Divine Comedy is important because it is one of the greatest works of world literature and helped shape the Italian language. Dante wrote it in the Tuscan dialect rather than Latin, making serious literature more accessible to ordinary readers."}]}]},{question:"What is the overall journey of The Divine Comedy about?",answer:[{type:"paragraph",children:[{text:"The poem is about Dante’s spiritual journey from sin and despair toward repentance, wisdom, and union with God. On a deeper level, it represents the soul’s path from confusion to divine truth."}]}]}]},settings:{sizing:"auto",properties:{wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},cellMinHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},dividerWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},dividerStyle:{type:"string",scope:"common",title:"Style",display:{type:"toggle-cycle",enum:["solid","dashed","dotted"]}},entryHoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["none","default"]}},autoclose:{type:"string",scope:"common",title:"Autoclose",display:{type:"toggle-cycle",enum:["on","off"]}},icon:{type:["string","null"],scope:"common",display:{type:"settings-image-input"}},iconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"numeric-input"},min:0,max:9999},iconPaddingRight:En("Icon Padding Right"),iconAnimation:{type:"string",scope:"common",title:"Icon Animation",display:{type:"toggle-cycle",enum:["rotate 180","rotate 90","rotate 45"]}},questionColor:{type:"string",scope:"common",title:"Question Default",display:{type:"palette-color-picker"}},answerColor:{type:"string",scope:"common",title:"Answer Default",display:{type:"palette-color-picker"}},dividerColor:{type:"string",scope:"common",title:"Divider Default",display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"palette-color-picker"}},questionHoverColor:{type:"string",scope:"common",title:"Question Hover",display:{type:"palette-color-picker"}},iconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"palette-color-picker"}},iconActiveColor:{type:"string",scope:"common",title:"Icon Active",display:{type:"palette-color-picker"}},dividerHoverColor:{type:"string",scope:"common",title:"Divider Hover",display:{type:"palette-color-picker"}},questionFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},questionFontSettings:{...Ja.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},questionFontSize:{type:"number",scope:"layout",title:"Question Font Size",display:{type:"font-size"}},questionLineHeight:{type:"number",scope:"layout",title:"Question Line Height",display:{type:"line-height-input"}},questionLetterSpacing:{type:"number",scope:"layout",title:"Question Letter Spacing",display:{type:"letter-spacing-input"}},questionWordSpacing:{type:"number",scope:"layout",title:"Question Word Spacing",display:{type:"word-spacing-input"}},questionTextAppearance:{type:"object",scope:"layout",title:"Question Text Appearance",display:{type:"text-appearance"}},answerFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},answerFontSettings:{...Ja.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},answerFontSize:{type:"number",scope:"layout",title:"Answer Font Size",display:{type:"font-size"}},answerLineHeight:{type:"number",scope:"layout",title:"Answer Line Height",display:{type:"line-height-input"}},answerLetterSpacing:{type:"number",scope:"layout",title:"Answer Letter Spacing",display:{type:"letter-spacing-input"}},answerWordSpacing:{type:"number",scope:"layout",title:"Answer Word Spacing",display:{type:"word-spacing-input"}},answerTextAppearance:{type:"object",scope:"layout",title:"Answer Text Appearance",display:{type:"text-appearance"}},questionPaddingLeft:En("Question Padding Left"),questionPaddingTop:En("Question Padding Top"),questionPaddingBottom:En("Question Padding Bottom"),answerPaddingLeft:En("Answer Padding Left"),answerPaddingRight:En("Answer Padding Right"),answerPaddingTop:En("Answer Padding Top"),answerPaddingBottom:En("Answer Padding Bottom")},defaults:{dividerStyle:"dotted",entryHoverEffect:"default",autoclose:"off",icon:"https://cdn.cntrl.site/component-assets/PlusIcon.svg",iconAnimation:"rotate 45",questionColor:"#000000",answerColor:"#000000",dividerColor:"#000000",iconColor:"#000000",questionHoverColor:"#A60239",iconHoverColor:"#A60239",iconActiveColor:"#000000",dividerHoverColor:"#A60239",questionFontFamily:"Goudy Bookletter 1911",questionFontSettings:{fontWeight:400,fontStyle:"normal"},questionLetterSpacing:0,questionWordSpacing:0,questionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},answerFontFamily:"Goudy Bookletter 1911",answerFontSettings:{fontWeight:400,fontStyle:"normal"},answerLetterSpacing:0,answerWordSpacing:0,answerTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{wrapperWidth:1,cellMinHeight:0,dividerWidth:.008,iconMaxWidth:.0533,iconPaddingRight:.08,questionFontSize:.09066,questionLineHeight:.10133,questionLetterSpacing:-.00266,answerFontSize:.0533,answerLineHeight:.064,questionPaddingLeft:.0533,questionPaddingTop:.0533,questionPaddingBottom:.0533,answerPaddingLeft:.0533,answerPaddingRight:.16,answerPaddingTop:.0533,answerPaddingBottom:.0533},t:{wrapperWidth:.651041,cellMinHeight:0,dividerWidth:.00390625,iconMaxWidth:.02604166,iconPaddingRight:.0130208,questionFontSize:.0390625,questionLineHeight:.04427,questionLetterSpacing:-.00091145833,answerFontSize:.0234375,answerLineHeight:.026041,questionPaddingLeft:0,questionPaddingTop:.01302,questionPaddingBottom:.01302,answerPaddingLeft:.065104,answerPaddingRight:.09765625,answerPaddingTop:.026041,answerPaddingBottom:.026041},d:{wrapperWidth:.6388,cellMinHeight:0,dividerWidth:.002083,iconMaxWidth:.01388,iconPaddingRight:.01388,questionFontSize:.0333,questionLineHeight:.0333,questionLetterSpacing:-9e-4,answerFontSize:.01111,answerLineHeight:.01388,questionPaddingLeft:0,questionPaddingTop:.01111,questionPaddingBottom:.01111,answerPaddingLeft:.0625,answerPaddingRight:.1625,answerPaddingTop:0,answerPaddingBottom:.01111}},layout:["__componentName__","wrapperWidth","cellMinHeight","dividerWidth","dividerStyle","entryHoverEffect","autoclose","icon","iconMaxWidth","iconAnimation"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["wrapperWidth","cellMinHeight"]},{type:"row",title:"",items:["entryHoverEffect","autoclose"]},{type:"row",title:"Divider",items:["dividerWidth","dividerStyle"]},{type:"row",title:"Icon",items:["icon","iconMaxWidth"]},{type:"row",title:"",items:["iconAnimation"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Question",items:["questionFontFamily","questionFontSettings",{type:"row",items:["questionFontSize","questionLineHeight","questionLetterSpacing","questionWordSpacing"]},"questionTextAppearance"]},{type:"group",title:"Answer",items:["answerFontFamily","answerFontSettings",{type:"row",items:["answerFontSize","answerLineHeight","answerLetterSpacing","answerWordSpacing"]},"answerTextAppearance"]}]}],paletteBookmark:{items:[..._m],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},Wm={element:Am,id:"faq",name:"FAQ",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/FAQ_List.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[],parameters:[{path:"icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"questionFontFamily"},{path:"answerFontFamily"}]},fontRelations:{questionFontSettings:"questionFontFamily",answerFontSettings:"answerFontFamily"},schema:Fm,sourceCode:Mm},vn=e=>e.display==="cover",Go=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},Za=100,Nm=.2,Qa=8,nl=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,s]=l.useState(0),[a,u]=l.useState(!1),c=l.useRef(null),m=l.useRef(0);m.current=o;const p=l.useMemo(()=>typeof window>"u"?Za:Math.max(Za,window.innerHeight*Nm),[]),b=l.useCallback(y=>Math.max(0,1-y/(p*1.5)),[p]),w=l.useCallback(y=>Math.max(0,1-y/(p*.45)),[p]),S=l.useCallback(y=>{const _=typeof window<"u"?window.innerHeight:800,W=Math.max(.88,1-y/_*.12);return`translateY(${y}px) scale(${W})`},[]),g=l.useCallback(()=>{c.current=null},[]),v=l.useCallback(()=>{u(!0),s(0),window.setTimeout(()=>u(!1),n),g()},[n,g]),T=l.useCallback(()=>{const y=typeof window<"u"?window.innerHeight:800;u(!0),s(y),window.setTimeout(()=>{t(),g(),u(!1)},Math.min(n,200))},[n,t,g]),$=l.useCallback(y=>{!e||a||y.pointerType==="touch"&&(i!=null&&i(y.target)||(c.current={startX:y.clientX,startY:y.clientY,isLocked:null,pointerId:y.pointerId}))},[e,a,i]),C=l.useCallback(y=>{const _=c.current;if(!e||!_||y.pointerType!=="touch"||_.pointerId!==y.pointerId)return;const W=y.clientX-_.startX,G=y.clientY-_.startY;if(_.isLocked===null){if(Math.abs(W)<Qa&&Math.abs(G)<Qa)return;if(G>0&&G>Math.abs(W))_.isLocked=!0,y.currentTarget.setPointerCapture(y.pointerId);else{_.isLocked=!1,g();return}}if(!_.isLocked)return;y.preventDefault();const te=Math.max(0,G);m.current=te,s(te)},[e,g]),L=l.useCallback(y=>{const _=c.current;if(!e||!_||y.pointerType!=="touch"||_.pointerId!==y.pointerId)return;const W=_.isLocked===!0;if(y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),!W){g();return}y.clientY-_.startY>=p?T():v()},[p,T,e,g,v]),A=l.useCallback(y=>{L(y)},[L]),k=l.useCallback(y=>{L(y)},[L]),F=o>0,I=a?`transform ${n}ms ease`:"none",E=a?`opacity ${n}ms ease`:"none",J=o>0||a;return{isSwipeDragging:F,backdropStyle:{opacity:b(o),transition:E},mediaAreaStyle:{transform:S(o),transition:I,touchAction:F?"none":void 0,willChange:F?"transform":void 0},overlayContentStyle:J?{opacity:w(o),transition:E}:void 0,swipeHandlers:e?{onPointerDown:$,onPointerMove:C,onPointerUp:A,onPointerCancel:k}:{},dismissAreaStyle:e?{touchAction:F?"none":"pan-x"}:void 0}},Hm="[data-lightbox-scrollable]",il=()=>{l.useEffect(()=>{const e=window.scrollY,t=document.body.style.overflow,n=document.body.style.position,i=document.body.style.top,o=document.body.style.width,s=document.documentElement.style.overflow;document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${e}px`,document.body.style.width="100%",document.documentElement.style.overflow="hidden";const a=u=>{const c=u.target;c instanceof Element&&c.closest(Hm)||u.preventDefault()};return document.addEventListener("touchmove",a,{passive:!1}),()=>{document.removeEventListener("touchmove",a),document.body.style.overflow=t,document.body.style.position=n,document.body.style.top=i,document.body.style.width=o,document.documentElement.style.overflow=s,window.scrollTo(0,e)}},[])},Om=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},Bm=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},jm=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},zm=(e,t,n,{duration:i,easing:o,onComplete:s})=>{const a=e.scrollLeft,u=n-a,c=a-n,m=(g,v)=>{Bm(t),e.scrollLeft=g,v&&(s==null||s())};if(Math.abs(u)<.5)return m(n,!0),()=>{};let p=!1,b=0;const w=()=>{t.removeEventListener("transitionend",S),clearTimeout(b)},S=g=>{g.target!==t||g.propertyName!=="transform"||p||(p=!0,w(),m(n,!0))};return t.addEventListener("transitionend",S),t.style.willChange="transform",t.style.transition="none",t.style.transform="translate3d(0, 0, 0)",t.offsetHeight,t.style.transition=`transform ${i}ms ${o}`,t.style.transform=`translate3d(${c}px, 0, 0)`,b=window.setTimeout(()=>{p||(p=!0,w(),m(n,!0))},i+64),()=>{p||(p=!0,w(),m(a-jm(t),!1))}},Pi=300,Vm=900,Dm=1500,qm="cubic-bezier(0.16, 1, 0.3, 1)",Km=3e3,Gm=2,Um=16,Xm=.05,Ym=1,uo=.3,Jm=50,Zm=20,ei=.004,hi=["title1","title2","title3"],Qm={title1:"1",title2:"2",title3:"3"},eg={title1:"title1Color",title2:"title2Color",title3:"title3Color"},tg={title1:.02,title2:.02,title3:.02},po=e=>`max(${e}, ${Zm}px)`,ng=e=>{if(!Array.isArray(e)||e.length===0)return{};const t=e.find(o=>(o==null?void 0:o.type)==="paragraph")??e[0],n=t==null?void 0:t.children;if(!Array.isArray(n))return{};const i=n.map(o=>typeof(o==null?void 0:o.text)=="string"?o.text.trim():"").filter(Boolean);return{title1:i[0],title2:i[1],title3:i[2]}},ig=e=>{if(!e)return{title1:"",title2:"",title3:""};if(e.title1||e.title2||e.title3)return{title1:e.title1??"",title2:e.title2??"",title3:e.title3??""};const t=ng(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},lt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,og=e=>[lt(e,"fontFamily"),lt(e,"fontSettings"),{type:"row",items:[lt(e,"fontSize"),lt(e,"lineHeight"),lt(e,"letterSpacing"),lt(e,"wordSpacing")]},lt(e,"textAlign"),lt(e,"textAppearance")],rg=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(hi.map(e=>[Qm[e],og(e)]))}),na=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((s,a)=>s+a,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:s,widths:a},u)=>{if(s<=0||u<=0)return{overflow:s,widths:[u,...a]};const c=Math.min(s,u);return{overflow:s-c,widths:[u-c,...a]}},{overflow:i-1,widths:[]});return o},ol=(e,t)=>na(e,t),mo=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},es=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:na(e.length,n),effective:ol(e.length,n)}},ag=(e,t,n,i,o,s,a)=>{const u=[];return t&&u.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:o,text:t}),n&&u.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:s,text:n}),i&&u.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:a,text:i}),u},gr=(e,t)=>{const n=i=>{const o=lt(t,i);return e[o]};return{fontFamily:n("fontFamily")??"Arial",fontSettings:n("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:n("fontSize"),lineHeight:n("lineHeight"),letterSpacing:n("letterSpacing")??0,wordSpacing:n("wordSpacing")??0,textAlign:n("textAlign")??"left",textAppearance:n("textAppearance"),color:e[eg[t]]}},sg=(e,t,n,i)=>e.slice(0,i).reduce((o,s,a)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[a]??0),0),hr=(e,t,n)=>{var o,s;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((s=t.fontSettings)==null?void 0:s.fontStyle)??"normal"},fontSize:t.fontSize??tg[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return At(i,n)},lg=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,onClose:a})=>{const{backgroundColor:u,thumbnailSize:c,thumbnailGap:m,thumbnailMarginBottom:p,imageGap:b,closeIcon:w,closeIconMaxWidth:S,closeIconColor:g,closeIconHoverColor:v,thumbnailTrigger:T,thumbnailVisibility:$,thumbnailObjectFit:C,thumbnailActive:L,thumbnailActiveColor:A,title1Width:k,title2Width:F,title3Width:I,title1MarginLeft:E=0,title2MarginLeft:J=0,title3MarginLeft:y=0,titleRowMarginBottom:_=0,titleHeaderLayout:W="desktop",contentMarginTop:G,iconMarginLeft:te}=n,ue=d=>P.scalingValue(d,i??!1),X=c??n.thumnailSize??.03,H=ue(X),Q=ue(m),z=ue(p??.02),B=ue(b??0),Y=ue(G??0),oe=po(Y),ie=ue(te??0),[O,ce]=l.useState(0),f=l.useRef(O);f.current=O;const de=t[O],{title1:be,title2:fe,title3:Re}=ig(de),Z=hr("title1",gr(n,"title1"),i),ge=hr("title2",gr(n,"title2"),i),U=hr("title3",gr(n,"title3"),i),V=W==="mobile",j=!o&&(!i||s),he=j,re=j,Ce=j,Se=vn(C),we=Se?{"--image-aspect-ratio":Go(C)}:void 0,Ie=!!(be||fe||Re),N=l.useMemo(()=>ag(e,be,fe,Re,Z,ge,U),[e,O,be,fe,Re,Z,ge,U]),ee=l.useMemo(()=>({title1Width:k,title2Width:F,title3Width:I}),[k,F,I]),R=l.useMemo(()=>N.map(d=>ee[d.widthKey]),[N,ee]),K=l.useMemo(()=>na(N.length,R),[N.length,R]),D=l.useMemo(()=>ol(N.length,R),[N.length,R]),ae=l.useMemo(()=>N.filter(d=>d.prefix==="title1"),[N]),ne=l.useMemo(()=>N.filter(d=>d.prefix==="title2"||d.prefix==="title3"),[N]),ye=l.useMemo(()=>es(ae,ee),[ae,ee]),ke=l.useMemo(()=>es(ne,ee),[ne,ee]),Te=l.useCallback((d,h)=>{const x=N.indexOf(d);if(!V||h==="single-row")return{effectiveWidth:D[x]??0,resolvedWidth:K[x]??0,maxWidth:mo(x,K)};if(h==="two-row-top"){const le=ae.indexOf(d);return{effectiveWidth:ye.effective[le]??0,resolvedWidth:ye.resolved[le]??0,maxWidth:mo(le,ye.resolved)}}const q=ne.indexOf(d);return{effectiveWidth:ke.effective[q]??0,resolvedWidth:ke.resolved[q]??0,maxWidth:mo(q,ke.resolved)}},[ne,ke,D,K,N,ae,ye,V]),xe=l.useCallback(d=>P.scalingValue(d,i??!1),[i]),Ke=xe(_??0),se=l.useMemo(()=>({title1MarginLeft:E,title2MarginLeft:J,title3MarginLeft:y}),[E,J,y]),Ae=l.useCallback(d=>N.slice(0,d+1).reduce((h,x,q)=>h+(x!=null&&x.marginLeftKey?se[x.marginLeftKey]??0:0)+(K[q]??0),0)+(V?0:E??0),[N,se,K,V,E]),Ne=l.useCallback(()=>V?0:E??0,[V,E]),He=l.useCallback(d=>ne.slice(0,d).reduce((h,x,q)=>h+(x.marginLeftKey?se[x.marginLeftKey]??0:0)+(ke.resolved[q]??0),0),[ne,ke.resolved,se]),dt=l.useCallback(d=>{const h=ne[d];return He(d)+(h.marginLeftKey?se[h.marginLeftKey]??0:0)+(ke.resolved[d]??0)},[ne,ke.resolved,He,se]),ft=(d,h)=>{const x=d.marginLeftKey?se[d.marginLeftKey]??0:0,{effectiveWidth:q,resolvedWidth:le,maxWidth:$e}=Te(d,h),Fe=o&&h==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":d.prefix,style:{...h==="single-row"?{gridArea:d.prefix}:{},width:xe(q),...x>0?{marginLeft:xe(x)}:{}},children:[r.jsx("p",{className:d.className,style:d.style,children:d.text}),Fe&&d.marginLeftKey&&r.jsx("div",{"data-controls":d.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(le),style:{position:"absolute",top:0,left:xe(-x),width:`max(${xe(x)}, 10px)`,height:"100%",pointerEvents:"auto"}}),Fe&&r.jsx("div",{"data-controls":d.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String($e),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:xe(-ei/2),width:xe(ei),height:"100%",pointerEvents:"auto"}})]},d.className)},It=()=>{const d=V?-1:N.findIndex(q=>q.prefix==="title1"),h=!V&&(o||(E??0)>0)?(()=>{const q=E??0,le=d>=0?K[d]:k??0;return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(le),style:{position:"absolute",top:0,left:0,width:`max(${xe(q)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,x=N.flatMap((q,le)=>{if(!q.marginLeftKey)return[];const $e=se[q.marginLeftKey]??0,Fe=sg(N,K,se,le)+Ne();return r.jsx("div",{"data-controls":q.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(K[le]),style:{position:"absolute",top:0,left:xe(Fe),width:`max(${xe($e)}, 10px)`,height:"100%",pointerEvents:"auto"}},q.marginLeftKey)});return h?[h,...x]:x},xt=()=>N.map((d,h)=>{const x=mo(h,K),le=Ae(h)-ei/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":d.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(x),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:xe(le),width:xe(ei),height:"100%",pointerEvents:"auto"}})},`${d.widthKey}-junction`)}),wt=()=>ne.flatMap((d,h)=>{if(!d.marginLeftKey)return[];const x=se[d.marginLeftKey]??0,q=He(h),{resolvedWidth:le}=Te(d,"two-row-bottom");return r.jsx("div",{"data-controls":d.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(le),style:{position:"absolute",top:0,left:xe(q),width:`max(${xe(x)}, 10px)`,height:"100%",pointerEvents:"auto"}},d.marginLeftKey)}),Ht=()=>ne.map((d,h)=>{const{maxWidth:x}=Te(d,"two-row-bottom"),le=dt(h)-ei/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":d.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(x),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:xe(le),width:xe(ei),height:"100%",pointerEvents:"auto"}})},`${d.widthKey}-junction`)}),Lt=l.useRef(null),Xe=l.useRef(null),Me=l.useRef(null),Ve=l.useRef(null),Ye=l.useRef([]),Be=l.useRef([]),ut=l.useRef(0),Pt=l.useRef(null),Qe=l.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),Mt=l.useRef(null),Ot=l.useRef(null),je=l.useRef(0),gt=l.useRef("forward"),it=l.useRef(0),Ze=l.useRef(null),rt=l.useRef(!1),at=t.length>1&&(!o||!!s),sn=at?3:1,wn=l.useMemo(()=>Array.from({length:sn},()=>t).flat(),[t,sn]),[ln,ot]=l.useState(!1),[tn,Ut]=l.useState(!1),[qe,yt]=l.useState(!0),vt=l.useRef(null),pe=l.useRef(null),Le=l.useRef(!1),_e=l.useRef(!1),We=l.useRef(null),tt=l.useRef(null),$t=he&&!qe,Ee=l.useCallback(()=>{he&&(yt(!0),tt.current&&clearTimeout(tt.current),tt.current=setTimeout(()=>{Qe.current.isActive||yt(!1)},Km))},[he]),et=l.useCallback(()=>{o||_e.current||(_e.current=!0,Ut(!1),We.current=setTimeout(()=>{a()},Pi))},[o,a]),De=()=>r.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":$t?"true":"false",style:{width:P.scalingValue(S??0,i),height:P.scalingValue(S??0,i),marginRight:ie,"--close-icon-hover-color":v},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:et,"aria-label":"Close",children:r.jsx(Qt,{url:w,fill:g,hoverFill:i&&!s?g:v,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginLeft","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:ie,height:"100%",pointerEvents:"auto"}})]}),st=(d="two-row")=>r.jsx("div",{...d==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:xe(E??0),flexShrink:0,...d==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...d==="two-row"&&o?{pointerEvents:"auto"}:{}}}),pt=()=>{const d=N.find(q=>q.prefix==="title1"),h=N.filter(q=>q.prefix==="title2"||q.prefix==="title3"),x=h.length>0||o||(_??0)>0;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${e}-header-row-top`,children:[(E??0)>0||o?st():null,d&&ft(d,"two-row-top"),w&&De()]}),x?r.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[h.length>0?r.jsxs("div",{className:`${e}-header-row-bottom`,children:[h.map(q=>ft(q,"two-row-bottom")),o&&r.jsxs(r.Fragment,{children:[wt(),Ht()]})]}):null,r.jsx("div",{"data-controls":o?"titleRowMarginBottom":void 0,"data-controls-axis":o?"y":void 0,"data-controls-reverse":o?"":void 0,className:o?`${e}-control`:void 0,style:{height:Ke,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},kt=()=>r.jsxs(r.Fragment,{children:[(E??0)>0||o?st("single-row"):null,N.map(d=>ft(d,"single-row")),o?r.jsxs(r.Fragment,{children:[It(),xt()]}):null,w?De():null]}),Ge=l.useCallback(d=>!!(d.closest("[data-controls]")||d.closest(`.${e}-thumbnails`)||d.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:nt,backdropStyle:Et,mediaAreaStyle:St,overlayContentStyle:_t,swipeHandlers:$n,dismissAreaStyle:ht}=nl({enabled:j??!1,onClose:et,animMs:Pi,isBlockedTarget:Ge}),Bt=()=>{if(!at||t.length===0)return ut.current=0,0;const d=Be.current[0],h=Be.current[t.length];if(!d||!h)return ut.current;const x=h.offsetLeft-d.offsetLeft;return x>0&&(ut.current=x),ut.current},Wt=(d=!1)=>{if(!at)return;const h=Xe.current,x=Bt();!h||x<=0||x<h.clientWidth*.25||(h.scrollLeft<=0?(h.scrollLeft+=x,d&&(Qe.current.scrollLeft+=x),rt.current&&(it.current+=x)):h.scrollLeft>=x*2&&(h.scrollLeft-=x,d&&(Qe.current.scrollLeft-=x),rt.current&&(it.current-=x)))},cn=(d,h=(x=>(x=Xe.current)==null?void 0:x.scrollLeft)()??0)=>{if(!at)return d;let q=t.length+d,le=1/0;for(let $e=0;$e<sn;$e++){const Fe=$e*t.length+d,Ue=Be.current[Fe];if(!Ue)continue;const Rt=Math.abs(Ue.offsetLeft-h);Rt<le&&(le=Rt,q=Fe)}return q},Sn=d=>{const h=Xe.current;return!d||!h?!1:d.offsetWidth>h.clientWidth+1},dn=d=>{const h=Xe.current;if(!d||!h||!Sn(d))return!1;const x=d.offsetLeft,q=x+d.offsetWidth;return h.scrollLeft>=x-1&&h.scrollLeft+h.clientWidth<=q+1},zt=(d=(h=>(h=Xe.current)==null?void 0:h.scrollLeft)()??0)=>{for(let q=0;q<Be.current.length;q+=1){const le=Be.current[q];if(le&&dn(le))return q}let x={flatIndex:0,distance:1/0};return Be.current.forEach((q,le)=>{if(!q)return;const $e=Math.abs(q.offsetLeft-d);$e<x.distance&&(x={flatIndex:le,distance:$e})}),x.flatIndex},Cn=d=>{Xe.current&&Be.current.forEach(h=>{h&&(h.style.scrollSnapAlign=Sn(h)&&d==="backward"?"end":"start")})},Xn=(d,h,x)=>{const q=d-h,le=zt(h),$e=Be.current[le];if(dn($e))return zt(d)%t.length;const Fe=Be.current[le+1],Ue=$e?Fe?Fe.offsetLeft-$e.offsetLeft:$e.offsetWidth:0,Rt=Ue>0?q>Ue*uo?1:q<-Ue*uo?-1:0:0;return Rt===0?x:at?(x+Rt+t.length)%t.length:Math.max(0,Math.min(t.length-1,x+Rt))},Yn=l.useCallback((d=!1)=>{if($!=="on"||o)return;const h=Ve.current,x=f.current,q=Ye.current[x];if(!h||!q||h.scrollWidth<=h.clientWidth)return;const le=h.scrollLeft,$e=le+h.clientWidth,Fe=q.offsetLeft,Ue=Fe+q.offsetWidth;if(Fe>=le&&Ue<=$e)return;const Rt=h.scrollWidth-h.clientWidth;let Ct=le;if(!d&&vt.current===null){const Zn=Ye.current[x-1],Si=Ye.current[x+1],to=Zn?q.offsetLeft-Zn.offsetLeft:Si?Si.offsetLeft-q.offsetLeft:q.offsetWidth;Ue>$e?Ct+=to:Fe<le&&(Ct-=to)}else Ue>$e?Ct=Ue-h.clientWidth:Ct=Fe;h.scrollLeft=Math.max(0,Math.min(Rt,Ct))},[o,$]),$i=l.useCallback((d=!1)=>{d&&(Le.current=!0),pe.current===null&&(pe.current=requestAnimationFrame(()=>{pe.current=null;const h=Le.current;Le.current=!1,Yn(h)}))},[Yn]),Yo=l.useCallback(d=>{if(d===f.current)return;const h=f.current;f.current=d;const x=Math.abs(d-h)>1,q=at&&t.length>1&&(h===t.length-1&&d===0||h===0&&d===t.length-1);ce(d),$i(x||q)},[t.length,at,$i]),Xt=()=>{if(!Xe.current||t.length===0||vt.current!==null||Qe.current.isActive&&Qe.current.hasMoved)return;const d=Xe.current.scrollLeft,h=zt(d)%t.length;h!==f.current&&Yo(h)},Yi=()=>{vt.current=null},Yt=d=>{const h=Xe.current;h&&(h.style.scrollSnapType=d?"":"none")},un=()=>{var d;(d=Ot.current)==null||d.call(Ot),Ot.current=null},Tn=()=>{Ze.current!==null&&(cancelAnimationFrame(Ze.current),Ze.current=null),rt.current=!1},Fn=()=>{const d=Xe.current;if(!d){Ze.current=null,rt.current=!1;return}const h=it.current-d.scrollLeft;if(Math.abs(h)<.5){d.scrollLeft=it.current,Wt(),Xt(),Ze.current=null,rt.current=!1;return}d.scrollLeft+=h*Xm,Wt(),Xt(),Ee(),Ze.current=requestAnimationFrame(Fn)},Wn=()=>{const d=Me.current;d&&(d.style.transition="",d.style.transform="",d.style.willChange="")},Ji=(d,h,x,q)=>{Wn(),d.scrollLeft=h,je.current=d.scrollLeft,Wt(),x!==void 0?(f.current=x,ce(x)):Xt(),Yt(!0),q==null||q()},Zi=(d,{behavior:h="smooth",activeIndex:x,onComplete:q}={})=>{const le=Xe.current,$e=Me.current;if(!le||!$e)return;if(Tn(),un(),Yt(!1),h==="auto"){Ji(le,d,x,q);return}const Fe=Math.abs(d-le.scrollLeft),Ue=Om(Fe,Vm,Dm,le.clientWidth*.55);Ot.current=zm(le,$e,d,{duration:Ue,easing:qm,onComplete:()=>{Ot.current=null,Ji(le,d,x,q)}})},Jo=(d="smooth")=>{const h=Xe.current;if(!h||t.length===0)return;const x=zt()%t.length,q=cn(x,h.scrollLeft),le=Be.current[q];le&&Zi(le.offsetLeft,{behavior:d,activeIndex:x})},Zo=(d,h="smooth",x,q)=>{const le=Xe.current;if(!le||t.length===0)return;const $e=(q??le.scrollLeft)-d,Fe=zt(d),Ue=Be.current[Fe];if(dn(Ue)){Yt(!0),Xt();return}const Rt=Be.current[Fe+1],Ct=Ue?Rt?Rt.offsetLeft-Ue.offsetLeft:Ue.offsetWidth:0;if((Ct>0?$e>Ct*uo?1:$e<-Ct*uo?-1:0:0)!==0){const cl=x??Fe%t.length,dl=Xn(q??le.scrollLeft,d,cl);nn(dl,h);return}const Si=q??le.scrollLeft,to=zt(Si),ra=Be.current[to];if(ra&&Math.abs(ra.offsetLeft-Si)<1){Yt(!0),Xt();return}Jo("auto")},nn=(d,h="smooth")=>{const x=Xe.current;if(!x||t.length===0)return;const q=cn(d,x.scrollLeft),le=Be.current[q];le&&(h==="smooth"?vt.current=d:vt.current=null,f.current=d,ce(d),$i(!0),Zi(le.offsetLeft,{behavior:h,activeIndex:d,onComplete:h==="smooth"?Yi:void 0}))},Jn=()=>{Mt.current&&(window.removeEventListener("pointerup",Mt.current),window.removeEventListener("pointercancel",Mt.current),Mt.current=null)},Qi=(d,h,x,q,le)=>{const $e=x-d,Fe=q-h,Ue=Math.abs($e),Rt=Math.abs(Fe);if(Ue<Jm||Ue<=Rt)return!1;const Ct=$e<0?1:-1,Zn=at?(le+Ct+t.length)%t.length:Math.max(0,Math.min(t.length-1,le+Ct));return Zn===le?!1:(nn(Zn),!0)},Nn=d=>{if(!Qe.current.isActive)return;Jn();const h=Xe.current;if(!h)return;const{scrollLeft:x,startActiveIndex:q,hasMoved:le}=Qe.current,$e=h.scrollLeft;Wt(!0),Qe.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},ot(!1),d!==void 0&&h.hasPointerCapture(d)&&h.releasePointerCapture(d),le?Zo(x,"smooth",q,$e):(Yt(!0),Xt()),Ee()},eo=(d,h)=>{const x=Pt.current;Pt.current=null,x&&(Qi(x.startX,x.startY,d,h,x.startActiveIndex),Ee())},Qo=d=>{if(!re)return;if(d.pointerType==="touch"){if(Tn(),Yt(!0),Ge(d.target))return;Pt.current={startX:d.clientX,startY:d.clientY,startActiveIndex:f.current};return}if(d.pointerType!=="mouse"||d.button!==0||Ge(d.target))return;const h=Xe.current;if(!h)return;Tn(),un(),Wn(),vt.current=null,Qe.current={isActive:!0,startX:d.clientX,scrollLeft:h.scrollLeft,startActiveIndex:f.current,hasMoved:!1},Yt(!1),Ee(),h.setPointerCapture(d.pointerId),Jn();const x=q=>{q.pointerType==="mouse"&&Nn(q.pointerId)};Mt.current=x,window.addEventListener("pointerup",x),window.addEventListener("pointercancel",x)},er=d=>{if(!re||d.pointerType!=="mouse")return;const h=Xe.current;if(!h||!Qe.current.isActive)return;if(d.buttons===0){Nn(d.pointerId);return}const x=d.clientX-Qe.current.startX;Math.abs(x)>Ym&&(Qe.current.hasMoved=!0,ot(!0)),Qe.current.hasMoved&&(d.preventDefault(),h.scrollLeft=Qe.current.scrollLeft-x,Wt(!0),Xt(),Ee())},M=d=>{if(re){if(d.pointerType==="touch"){d.type==="pointerup"?eo(d.clientX,d.clientY):Pt.current=null;return}d.pointerType==="mouse"&&Nn(d.pointerId)}},me=d=>{!re||d.pointerType!=="mouse"||Nn(d.pointerId)};return il(),l.useEffect(()=>{const d=requestAnimationFrame(()=>Ut(!0));return()=>{cancelAnimationFrame(d),un(),Jn(),pe.current!==null&&(cancelAnimationFrame(pe.current),pe.current=null),We.current&&clearTimeout(We.current),tt.current&&clearTimeout(tt.current)}},[]),l.useEffect(()=>{if(!he){yt(!0);return}Ee();const d=Lt.current;if(!d)return;const h=()=>Ee();return d.addEventListener("pointermove",h),d.addEventListener("pointerdown",h),()=>{d.removeEventListener("pointermove",h),d.removeEventListener("pointerdown",h),tt.current&&clearTimeout(tt.current)}},[he,Ee]),l.useEffect(()=>{const d=h=>{h.key==="Escape"&&et()};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[et]),l.useLayoutEffect(()=>{Bt()},[B,t.length,at]),l.useLayoutEffect(()=>{o||nn(f.current,"auto")},[B,o]),l.useLayoutEffect(()=>{nn(0,"auto")},[t.length,at]),l.useEffect(()=>{const d=Xe.current;if(!d||o||!j)return;const h=x=>{if(x.preventDefault(),Math.abs(x.deltaY)<=Math.abs(x.deltaX))return;const q=x.deltaMode===1?Um:x.deltaMode===2?d.clientHeight:1,le=x.deltaY*q*Gm;if(le!==0){if(un(),rt.current||(rt.current=!0,it.current=d.scrollLeft,vt.current=null,Yt(!1)),it.current+=le,!at){const $e=d.scrollWidth-d.clientWidth;it.current=Math.max(0,Math.min($e,it.current))}Ee(),Ze.current===null&&(Ze.current=requestAnimationFrame(Fn))}};return d.addEventListener("wheel",h,{passive:!1}),()=>{d.removeEventListener("wheel",h),Tn()}},[o,j,at]),l.useEffect(()=>{const d=Xe.current;if(!d)return;const h=()=>{Wt(Qe.current.isActive);const q=d.scrollLeft,le=q-je.current;je.current=q;const $e=ut.current>0?ut.current*.5:1/0;if(le!==0&&Math.abs(le)<$e){const Fe=le>0?"forward":"backward";Fe!==gt.current&&(gt.current=Fe,Cn(Fe))}Qe.current.isActive&&Qe.current.hasMoved||Xt()};d.addEventListener("scroll",h,{passive:!0});const x=new ResizeObserver(()=>{Bt(),Wt(Qe.current.isActive),Cn(gt.current),Xt()});return x.observe(d),()=>{un(),d.removeEventListener("scroll",h),x.disconnect()}},[t.length,at]),r.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{nt||et()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:tn?1:0,transition:`opacity ${Pi}ms ease`,pointerEvents:tn?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:u,...Et}}),r.jsxs("div",{ref:Lt,className:`${e}-lightbox-dismiss-area`,style:ht,...$n,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:St,onClick:d=>d.stopPropagation(),children:r.jsx("div",{ref:Xe,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":re&&t.length>0?"true":"false","data-mouse-dragging":ln?"true":"false",onPointerDown:Qo,onPointerMove:er,onPointerUp:M,onPointerCancel:M,onLostPointerCapture:me,children:r.jsx("div",{ref:Me,className:`${e}-lightbox-strip-track`,style:{gap:B},children:wn.map((d,h)=>{const x=d.image.objectFit??"contain",q=h%t.length,le=Math.floor(h/t.length),$e=po(B),Fe=`calc(-0.5 * (${$e} + ${B}))`;return r.jsxs("div",{ref:Ue=>Be.current[h]=Ue,className:`${e}-strip-item`,style:{height:W==="mobile"?"75vh":"100%"},children:[r.jsx("img",{src:d.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:x}}),o&&q<t.length-1&&le===0&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Fe,width:$e,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${le}-${d.image.url}-${q}`)})})})}),r.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":$t?"true":"false",style:_t,children:[r.jsx("div",{style:{position:"relative",width:"100%",height:Y,flexShrink:0,pointerEvents:"none"},children:o&&r.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-handle-left-fraction":"0.05",style:{position:"absolute",left:0,right:0,top:0,height:oe,pointerEvents:"auto",zIndex:3}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",flex:1,minHeight:0,pointerEvents:"none"},children:r.jsx("div",{className:`${e}-lightbox-content-area${V?` ${e}-lightbox-content-area-stacked`:""}`,children:(Ie||w)&&r.jsx("div",{className:`${e}-header ${V?`${e}-header-two-row`:`${e}-header-single-row`}`,children:V?pt():Ie||w?kt():null})})})]}),t.length>1&&$==="on"&&(()=>{const d=po(z),h=`calc(-0.5 * (${z} + ${d}))`;return r.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:z},children:r.jsx("div",{ref:Ve,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:x=>x.stopPropagation(),children:r.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":L,style:{gap:Q,"--thumbnail-active-color":A},children:[t.map((x,q)=>{const le=po(Q),$e=`calc(-0.5 * (${le} + ${Q}))`;return r.jsxs("div",{ref:Fe=>{Ye.current[q]=Fe},style:{position:"relative",flex:"0 0 auto"},children:[r.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":O===q?"true":"false",onClick:()=>j&&T==="click"&&nn(q),onMouseEnter:()=>Ce&&T==="hover"&&nn(q),"aria-label":x.image.name?`View ${x.image.name}`:`View image ${q+1}`,"aria-current":O===q?"true":void 0,children:r.jsx("img",{className:`${e}-thumb-image${Se?` ${e}-thumb-image-cover`:""}`,src:x.image.url,alt:"",draggable:!1,style:{...we,maxWidth:H,maxHeight:H,width:C.display==="cover"?"auto":"100%",height:"auto",objectFit:C.display==="cover"?"cover":"contain"}})}),o&&q<t.length-1&&r.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:$e,width:le,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${x.image.url}-${q}`)}),o&&r.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":o?"":void 0,style:{position:"absolute",left:0,right:0,bottom:h,height:d,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function cg(e){return`
10150
+ `;function En(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Ja={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},_m=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],Fm={type:"object",version:1,content:{type:"array",display:{type:"array"},items:{type:"object",properties:{question:{type:"string",label:"Question",placeholder:"Add question...",display:{type:"text-input"}},answer:{label:"Answer",placeholder:"Add answer...",display:{type:"rich-text"}}}},default:[{question:"What are the three main parts of The Divine Comedy?",answer:[{type:"paragraph",children:[{text:"The poem is divided into Inferno, Purgatorio, and Paradiso. These three sections follow Dante’s journey through Hell, Purgatory, and Heaven."}]}]},{question:"Who guides Dante through Hell and most of Purgatory?",answer:[{type:"paragraph",children:[{text:"Dante is guided by Virgil, the ancient Roman poet. Virgil represents human reason and wisdom, but because he lived before Christianity, he cannot guide Dante all the way into Heaven."}]}]},{question:"What does the dark wood at the beginning of the poem symbolize?",answer:[{type:"paragraph",children:[{text:"The dark wood symbolizes Dante’s spiritual confusion and moral crisis. It shows that he has lost the “straight way” in life and needs guidance to return to truth and salvation."}]}]},{question:"What is “contrapasso” in Inferno?",answer:[{type:"paragraph",children:[{text:"“Contrapasso” is the principle that punishments in Hell reflect the sins committed during life. For example, people who caused division are themselves physically divided, showing how their punishment mirrors their wrongdoing."}]}]},{question:"Who guides Dante through Heaven?",answer:[{type:"paragraph",children:[{text:"Beatrice guides Dante through Paradiso. She represents divine love, grace, and spiritual understanding, helping Dante move beyond human reason toward a vision of God."}]}]},{question:"Why is The Divine Comedy important in literary history?",answer:[{type:"paragraph",children:[{text:"The Divine Comedy is important because it is one of the greatest works of world literature and helped shape the Italian language. Dante wrote it in the Tuscan dialect rather than Latin, making serious literature more accessible to ordinary readers."}]}]},{question:"What is the overall journey of The Divine Comedy about?",answer:[{type:"paragraph",children:[{text:"The poem is about Dante’s spiritual journey from sin and despair toward repentance, wisdom, and union with God. On a deeper level, it represents the soul’s path from confusion to divine truth."}]}]}]},settings:{sizing:"auto",properties:{wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},cellMinHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},dividerWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},dividerStyle:{type:"string",scope:"common",title:"Style",display:{type:"toggle-cycle",enum:["solid","dashed","dotted"]}},entryHoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["none","default"]}},autoclose:{type:"string",scope:"common",title:"Autoclose",display:{type:"toggle-cycle",enum:["on","off"]}},icon:{type:["string","null"],scope:"common",display:{type:"settings-image-input"}},iconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"numeric-input"},min:0,max:9999},iconPaddingRight:En("Icon Padding Right"),iconAnimation:{type:"string",scope:"common",title:"Icon Animation",display:{type:"toggle-cycle",enum:["rotate 180","rotate 90","rotate 45"]}},questionColor:{type:"string",scope:"common",title:"Question Default",display:{type:"palette-color-picker"}},answerColor:{type:"string",scope:"common",title:"Answer Default",display:{type:"palette-color-picker"}},dividerColor:{type:"string",scope:"common",title:"Divider Default",display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"palette-color-picker"}},questionHoverColor:{type:"string",scope:"common",title:"Question Hover",display:{type:"palette-color-picker"}},iconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"palette-color-picker"}},iconActiveColor:{type:"string",scope:"common",title:"Icon Active",display:{type:"palette-color-picker"}},dividerHoverColor:{type:"string",scope:"common",title:"Divider Hover",display:{type:"palette-color-picker"}},questionFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},questionFontSettings:{...Ja.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},questionFontSize:{type:"number",scope:"layout",title:"Question Font Size",display:{type:"font-size"}},questionLineHeight:{type:"number",scope:"layout",title:"Question Line Height",display:{type:"line-height-input"}},questionLetterSpacing:{type:"number",scope:"layout",title:"Question Letter Spacing",display:{type:"letter-spacing-input"}},questionWordSpacing:{type:"number",scope:"layout",title:"Question Word Spacing",display:{type:"word-spacing-input"}},questionTextAppearance:{type:"object",scope:"layout",title:"Question Text Appearance",display:{type:"text-appearance"}},answerFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},answerFontSettings:{...Ja.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},answerFontSize:{type:"number",scope:"layout",title:"Answer Font Size",display:{type:"font-size"}},answerLineHeight:{type:"number",scope:"layout",title:"Answer Line Height",display:{type:"line-height-input"}},answerLetterSpacing:{type:"number",scope:"layout",title:"Answer Letter Spacing",display:{type:"letter-spacing-input"}},answerWordSpacing:{type:"number",scope:"layout",title:"Answer Word Spacing",display:{type:"word-spacing-input"}},answerTextAppearance:{type:"object",scope:"layout",title:"Answer Text Appearance",display:{type:"text-appearance"}},questionPaddingLeft:En("Question Padding Left"),questionPaddingTop:En("Question Padding Top"),questionPaddingBottom:En("Question Padding Bottom"),answerPaddingLeft:En("Answer Padding Left"),answerPaddingRight:En("Answer Padding Right"),answerPaddingTop:En("Answer Padding Top"),answerPaddingBottom:En("Answer Padding Bottom")},defaults:{dividerStyle:"dotted",entryHoverEffect:"default",autoclose:"off",icon:"https://cdn.cntrl.site/component-assets/PlusIcon.svg",iconAnimation:"rotate 45",questionColor:"#000000",answerColor:"#000000",dividerColor:"#000000",iconColor:"#000000",questionHoverColor:"#A60239",iconHoverColor:"#A60239",iconActiveColor:"#000000",dividerHoverColor:"#A60239",questionFontFamily:"Goudy Bookletter 1911",questionFontSettings:{fontWeight:400,fontStyle:"normal"},questionLetterSpacing:0,questionWordSpacing:0,questionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},answerFontFamily:"Goudy Bookletter 1911",answerFontSettings:{fontWeight:400,fontStyle:"normal"},answerLetterSpacing:0,answerWordSpacing:0,answerTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{wrapperWidth:1,cellMinHeight:0,dividerWidth:.008,iconMaxWidth:.0533,iconPaddingRight:.08,questionFontSize:.09066,questionLineHeight:.10133,questionLetterSpacing:-.00266,answerFontSize:.0533,answerLineHeight:.064,questionPaddingLeft:.0533,questionPaddingTop:.0533,questionPaddingBottom:.0533,answerPaddingLeft:.0533,answerPaddingRight:.16,answerPaddingTop:.0533,answerPaddingBottom:.0533},t:{wrapperWidth:.651041,cellMinHeight:0,dividerWidth:.00390625,iconMaxWidth:.02604166,iconPaddingRight:.0130208,questionFontSize:.0390625,questionLineHeight:.04427,questionLetterSpacing:-.00091145833,answerFontSize:.0234375,answerLineHeight:.026041,questionPaddingLeft:0,questionPaddingTop:.01302,questionPaddingBottom:.01302,answerPaddingLeft:.065104,answerPaddingRight:.09765625,answerPaddingTop:.026041,answerPaddingBottom:.026041},d:{wrapperWidth:.6388,cellMinHeight:0,dividerWidth:.002083,iconMaxWidth:.01388,iconPaddingRight:.01388,questionFontSize:.0333,questionLineHeight:.0333,questionLetterSpacing:-9e-4,answerFontSize:.01111,answerLineHeight:.01388,questionPaddingLeft:0,questionPaddingTop:.01111,questionPaddingBottom:.01111,answerPaddingLeft:.0625,answerPaddingRight:.1625,answerPaddingTop:0,answerPaddingBottom:.01111}},layout:["__componentName__","wrapperWidth","cellMinHeight","dividerWidth","dividerStyle","entryHoverEffect","autoclose","icon","iconMaxWidth","iconAnimation"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["wrapperWidth","cellMinHeight"]},{type:"row",title:"",items:["entryHoverEffect","autoclose"]},{type:"row",title:"Divider",items:["dividerWidth","dividerStyle"]},{type:"row",title:"Icon",items:["icon","iconMaxWidth"]},{type:"row",title:"",items:["iconAnimation"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Question",items:["questionFontFamily","questionFontSettings",{type:"row",items:["questionFontSize","questionLineHeight","questionLetterSpacing","questionWordSpacing"]},"questionTextAppearance"]},{type:"group",title:"Answer",items:["answerFontFamily","answerFontSettings",{type:"row",items:["answerFontSize","answerLineHeight","answerLetterSpacing","answerWordSpacing"]},"answerTextAppearance"]}]}],paletteBookmark:{items:[..._m],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},Wm={element:Am,id:"faq",name:"FAQ",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/FAQ_List.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[],parameters:[{path:"icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"questionFontFamily"},{path:"answerFontFamily"}]},fontRelations:{questionFontSettings:"questionFontFamily",answerFontSettings:"answerFontFamily"},schema:Fm,sourceCode:Mm},vn=e=>e.display==="cover",Go=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},Za=100,Nm=.2,Qa=8,nl=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,s]=l.useState(0),[a,u]=l.useState(!1),c=l.useRef(null),m=l.useRef(0);m.current=o;const p=l.useMemo(()=>typeof window>"u"?Za:Math.max(Za,window.innerHeight*Nm),[]),b=l.useCallback(y=>Math.max(0,1-y/(p*1.5)),[p]),w=l.useCallback(y=>Math.max(0,1-y/(p*.45)),[p]),S=l.useCallback(y=>{const _=typeof window<"u"?window.innerHeight:800,W=Math.max(.88,1-y/_*.12);return`translateY(${y}px) scale(${W})`},[]),g=l.useCallback(()=>{c.current=null},[]),v=l.useCallback(()=>{u(!0),s(0),window.setTimeout(()=>u(!1),n),g()},[n,g]),T=l.useCallback(()=>{const y=typeof window<"u"?window.innerHeight:800;u(!0),s(y),window.setTimeout(()=>{t(),g(),u(!1)},Math.min(n,200))},[n,t,g]),$=l.useCallback(y=>{!e||a||y.pointerType==="touch"&&(i!=null&&i(y.target)||(c.current={startX:y.clientX,startY:y.clientY,isLocked:null,pointerId:y.pointerId}))},[e,a,i]),C=l.useCallback(y=>{const _=c.current;if(!e||!_||y.pointerType!=="touch"||_.pointerId!==y.pointerId)return;const W=y.clientX-_.startX,G=y.clientY-_.startY;if(_.isLocked===null){if(Math.abs(W)<Qa&&Math.abs(G)<Qa)return;if(G>0&&G>Math.abs(W))_.isLocked=!0,y.currentTarget.setPointerCapture(y.pointerId);else{_.isLocked=!1,g();return}}if(!_.isLocked)return;y.preventDefault();const te=Math.max(0,G);m.current=te,s(te)},[e,g]),L=l.useCallback(y=>{const _=c.current;if(!e||!_||y.pointerType!=="touch"||_.pointerId!==y.pointerId)return;const W=_.isLocked===!0;if(y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),!W){g();return}y.clientY-_.startY>=p?T():v()},[p,T,e,g,v]),A=l.useCallback(y=>{L(y)},[L]),k=l.useCallback(y=>{L(y)},[L]),F=o>0,I=a?`transform ${n}ms ease`:"none",E=a?`opacity ${n}ms ease`:"none",J=o>0||a;return{isSwipeDragging:F,backdropStyle:{opacity:b(o),transition:E},mediaAreaStyle:{transform:S(o),transition:I,touchAction:F?"none":void 0,willChange:F?"transform":void 0},overlayContentStyle:J?{opacity:w(o),transition:E}:void 0,swipeHandlers:e?{onPointerDown:$,onPointerMove:C,onPointerUp:A,onPointerCancel:k}:{},dismissAreaStyle:e?{touchAction:F?"none":"pan-x"}:void 0}},Hm="[data-lightbox-scrollable]",il=()=>{l.useEffect(()=>{const e=window.scrollY,t=document.body.style.overflow,n=document.body.style.position,i=document.body.style.top,o=document.body.style.width,s=document.documentElement.style.overflow;document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${e}px`,document.body.style.width="100%",document.documentElement.style.overflow="hidden";const a=u=>{const c=u.target;c instanceof Element&&c.closest(Hm)||u.preventDefault()};return document.addEventListener("touchmove",a,{passive:!1}),()=>{document.removeEventListener("touchmove",a),document.body.style.overflow=t,document.body.style.position=n,document.body.style.top=i,document.body.style.width=o,document.documentElement.style.overflow=s,window.scrollTo(0,e)}},[])},Om=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},Bm=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},jm=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},zm=(e,t,n,{duration:i,easing:o,onComplete:s})=>{const a=e.scrollLeft,u=n-a,c=a-n,m=(g,v)=>{Bm(t),e.scrollLeft=g,v&&(s==null||s())};if(Math.abs(u)<.5)return m(n,!0),()=>{};let p=!1,b=0;const w=()=>{t.removeEventListener("transitionend",S),clearTimeout(b)},S=g=>{g.target!==t||g.propertyName!=="transform"||p||(p=!0,w(),m(n,!0))};return t.addEventListener("transitionend",S),t.style.willChange="transform",t.style.transition="none",t.style.transform="translate3d(0, 0, 0)",t.offsetHeight,t.style.transition=`transform ${i}ms ${o}`,t.style.transform=`translate3d(${c}px, 0, 0)`,b=window.setTimeout(()=>{p||(p=!0,w(),m(n,!0))},i+64),()=>{p||(p=!0,w(),m(a-jm(t),!1))}},Pi=300,Vm=900,Dm=1500,qm="cubic-bezier(0.16, 1, 0.3, 1)",Km=3e3,Gm=2,Um=16,Xm=.05,Ym=1,uo=.3,Jm=50,Zm=20,ei=.004,hi=["title1","title2","title3"],Qm={title1:"1",title2:"2",title3:"3"},eg={title1:"title1Color",title2:"title2Color",title3:"title3Color"},tg={title1:.02,title2:.02,title3:.02},po=e=>`max(${e}, ${Zm}px)`,ng=e=>{if(!Array.isArray(e)||e.length===0)return{};const t=e.find(o=>(o==null?void 0:o.type)==="paragraph")??e[0],n=t==null?void 0:t.children;if(!Array.isArray(n))return{};const i=n.map(o=>typeof(o==null?void 0:o.text)=="string"?o.text.trim():"").filter(Boolean);return{title1:i[0],title2:i[1],title3:i[2]}},ig=e=>{if(!e)return{title1:"",title2:"",title3:""};if(e.title1||e.title2||e.title3)return{title1:e.title1??"",title2:e.title2??"",title3:e.title3??""};const t=ng(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},lt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,og=e=>[lt(e,"fontFamily"),lt(e,"fontSettings"),{type:"row",items:[lt(e,"fontSize"),lt(e,"lineHeight"),lt(e,"letterSpacing"),lt(e,"wordSpacing")]},lt(e,"textAlign"),lt(e,"textAppearance")],rg=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(hi.map(e=>[Qm[e],og(e)]))}),na=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((s,a)=>s+a,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:s,widths:a},u)=>{if(s<=0||u<=0)return{overflow:s,widths:[u,...a]};const c=Math.min(s,u);return{overflow:s-c,widths:[u-c,...a]}},{overflow:i-1,widths:[]});return o},ol=(e,t)=>na(e,t),mo=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},es=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:na(e.length,n),effective:ol(e.length,n)}},ag=(e,t,n,i,o,s,a)=>{const u=[];return t&&u.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:o,text:t}),n&&u.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:s,text:n}),i&&u.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:a,text:i}),u},gr=(e,t)=>{const n=i=>{const o=lt(t,i);return e[o]};return{fontFamily:n("fontFamily")??"Arial",fontSettings:n("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:n("fontSize"),lineHeight:n("lineHeight"),letterSpacing:n("letterSpacing")??0,wordSpacing:n("wordSpacing")??0,textAlign:n("textAlign")??"left",textAppearance:n("textAppearance"),color:e[eg[t]]}},sg=(e,t,n,i)=>e.slice(0,i).reduce((o,s,a)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[a]??0),0),hr=(e,t,n)=>{var o,s;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((s=t.fontSettings)==null?void 0:s.fontStyle)??"normal"},fontSize:t.fontSize??tg[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return At(i,n)},lg=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,onClose:a})=>{const{backgroundColor:u,thumbnailSize:c,thumbnailGap:m,thumbnailMarginBottom:p,imageGap:b,closeIcon:w,closeIconMaxWidth:S,closeIconColor:g,closeIconHoverColor:v,thumbnailTrigger:T,thumbnailVisibility:$,thumbnailObjectFit:C,thumbnailActive:L,thumbnailActiveColor:A,title1Width:k,title2Width:F,title3Width:I,title1MarginLeft:E=0,title2MarginLeft:J=0,title3MarginLeft:y=0,titleRowMarginBottom:_=0,titleHeaderLayout:W="desktop",contentMarginTop:G,iconMarginLeft:te}=n,ue=d=>P.scalingValue(d,i??!1),X=c??n.thumnailSize??.03,H=ue(X),Q=ue(m),z=ue(p??.02),B=ue(b??0),Y=ue(G??0),oe=po(Y),ie=ue(te??0),[O,ce]=l.useState(0),f=l.useRef(O);f.current=O;const de=t[O],{title1:be,title2:fe,title3:Re}=ig(de),Z=hr("title1",gr(n,"title1"),i),ge=hr("title2",gr(n,"title2"),i),U=hr("title3",gr(n,"title3"),i),V=W==="mobile",j=!o&&(!i||s),he=j,re=j,Ce=j,Se=vn(C),we=Se?{"--image-aspect-ratio":Go(C)}:void 0,Ie=!!(be||fe||Re),N=l.useMemo(()=>ag(e,be,fe,Re,Z,ge,U),[e,O,be,fe,Re,Z,ge,U]),ee=l.useMemo(()=>({title1Width:k,title2Width:F,title3Width:I}),[k,F,I]),R=l.useMemo(()=>N.map(d=>ee[d.widthKey]),[N,ee]),K=l.useMemo(()=>na(N.length,R),[N.length,R]),D=l.useMemo(()=>ol(N.length,R),[N.length,R]),ae=l.useMemo(()=>N.filter(d=>d.prefix==="title1"),[N]),ne=l.useMemo(()=>N.filter(d=>d.prefix==="title2"||d.prefix==="title3"),[N]),ye=l.useMemo(()=>es(ae,ee),[ae,ee]),ke=l.useMemo(()=>es(ne,ee),[ne,ee]),Te=l.useCallback((d,h)=>{const x=N.indexOf(d);if(!V||h==="single-row")return{effectiveWidth:D[x]??0,resolvedWidth:K[x]??0,maxWidth:mo(x,K)};if(h==="two-row-top"){const le=ae.indexOf(d);return{effectiveWidth:ye.effective[le]??0,resolvedWidth:ye.resolved[le]??0,maxWidth:mo(le,ye.resolved)}}const q=ne.indexOf(d);return{effectiveWidth:ke.effective[q]??0,resolvedWidth:ke.resolved[q]??0,maxWidth:mo(q,ke.resolved)}},[ne,ke,D,K,N,ae,ye,V]),xe=l.useCallback(d=>P.scalingValue(d,i??!1),[i]),qe=xe(_??0),se=l.useMemo(()=>({title1MarginLeft:E,title2MarginLeft:J,title3MarginLeft:y}),[E,J,y]),Ae=l.useCallback(d=>N.slice(0,d+1).reduce((h,x,q)=>h+(x!=null&&x.marginLeftKey?se[x.marginLeftKey]??0:0)+(K[q]??0),0)+(V?0:E??0),[N,se,K,V,E]),Ne=l.useCallback(()=>V?0:E??0,[V,E]),He=l.useCallback(d=>ne.slice(0,d).reduce((h,x,q)=>h+(x.marginLeftKey?se[x.marginLeftKey]??0:0)+(ke.resolved[q]??0),0),[ne,ke.resolved,se]),dt=l.useCallback(d=>{const h=ne[d];return He(d)+(h.marginLeftKey?se[h.marginLeftKey]??0:0)+(ke.resolved[d]??0)},[ne,ke.resolved,He,se]),ft=(d,h)=>{const x=d.marginLeftKey?se[d.marginLeftKey]??0:0,{effectiveWidth:q,resolvedWidth:le,maxWidth:$e}=Te(d,h),Fe=o&&h==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":d.prefix,style:{...h==="single-row"?{gridArea:d.prefix}:{},width:xe(q),...x>0?{marginLeft:xe(x)}:{}},children:[r.jsx("p",{className:d.className,style:d.style,children:d.text}),Fe&&d.marginLeftKey&&r.jsx("div",{"data-controls":d.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(le),style:{position:"absolute",top:0,left:xe(-x),width:`max(${xe(x)}, 10px)`,height:"100%",pointerEvents:"auto"}}),Fe&&r.jsx("div",{"data-controls":d.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String($e),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:xe(-ei/2),width:xe(ei),height:"100%",pointerEvents:"auto"}})]},d.className)},It=()=>{const d=V?-1:N.findIndex(q=>q.prefix==="title1"),h=!V&&(o||(E??0)>0)?(()=>{const q=E??0,le=d>=0?K[d]:k??0;return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(le),style:{position:"absolute",top:0,left:0,width:`max(${xe(q)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,x=N.flatMap((q,le)=>{if(!q.marginLeftKey)return[];const $e=se[q.marginLeftKey]??0,Fe=sg(N,K,se,le)+Ne();return r.jsx("div",{"data-controls":q.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(K[le]),style:{position:"absolute",top:0,left:xe(Fe),width:`max(${xe($e)}, 10px)`,height:"100%",pointerEvents:"auto"}},q.marginLeftKey)});return h?[h,...x]:x},xt=()=>N.map((d,h)=>{const x=mo(h,K),le=Ae(h)-ei/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":d.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(x),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:xe(le),width:xe(ei),height:"100%",pointerEvents:"auto"}})},`${d.widthKey}-junction`)}),wt=()=>ne.flatMap((d,h)=>{if(!d.marginLeftKey)return[];const x=se[d.marginLeftKey]??0,q=He(h),{resolvedWidth:le}=Te(d,"two-row-bottom");return r.jsx("div",{"data-controls":d.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(le),style:{position:"absolute",top:0,left:xe(q),width:`max(${xe(x)}, 10px)`,height:"100%",pointerEvents:"auto"}},d.marginLeftKey)}),Ht=()=>ne.map((d,h)=>{const{maxWidth:x}=Te(d,"two-row-bottom"),le=dt(h)-ei/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":d.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(x),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:xe(le),width:xe(ei),height:"100%",pointerEvents:"auto"}})},`${d.widthKey}-junction`)}),Lt=l.useRef(null),Xe=l.useRef(null),Me=l.useRef(null),Ve=l.useRef(null),Ye=l.useRef([]),Be=l.useRef([]),ut=l.useRef(0),Pt=l.useRef(null),Qe=l.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),Mt=l.useRef(null),Ot=l.useRef(null),je=l.useRef(0),gt=l.useRef("forward"),it=l.useRef(0),Ze=l.useRef(null),rt=l.useRef(!1),at=t.length>1&&(!o||!!s),sn=at?3:1,wn=l.useMemo(()=>Array.from({length:sn},()=>t).flat(),[t,sn]),[ln,ot]=l.useState(!1),[tn,Ut]=l.useState(!1),[Ke,yt]=l.useState(!0),vt=l.useRef(null),pe=l.useRef(null),Le=l.useRef(!1),_e=l.useRef(!1),We=l.useRef(null),tt=l.useRef(null),$t=he&&!Ke,Ee=l.useCallback(()=>{he&&(yt(!0),tt.current&&clearTimeout(tt.current),tt.current=setTimeout(()=>{Qe.current.isActive||yt(!1)},Km))},[he]),et=l.useCallback(()=>{o||_e.current||(_e.current=!0,Ut(!1),We.current=setTimeout(()=>{a()},Pi))},[o,a]),De=()=>r.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":$t?"true":"false",style:{width:P.scalingValue(S??0,i),height:P.scalingValue(S??0,i),marginRight:ie,"--close-icon-hover-color":v},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:et,"aria-label":"Close",children:r.jsx(Qt,{url:w,fill:g,hoverFill:i&&!s?g:v,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginLeft","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:ie,height:"100%",pointerEvents:"auto"}})]}),st=(d="two-row")=>r.jsx("div",{...d==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:xe(E??0),flexShrink:0,...d==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...d==="two-row"&&o?{pointerEvents:"auto"}:{}}}),pt=()=>{const d=N.find(q=>q.prefix==="title1"),h=N.filter(q=>q.prefix==="title2"||q.prefix==="title3"),x=h.length>0||o||(_??0)>0;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${e}-header-row-top`,children:[(E??0)>0||o?st():null,d&&ft(d,"two-row-top"),w&&De()]}),x?r.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[h.length>0?r.jsxs("div",{className:`${e}-header-row-bottom`,children:[h.map(q=>ft(q,"two-row-bottom")),o&&r.jsxs(r.Fragment,{children:[wt(),Ht()]})]}):null,r.jsx("div",{"data-controls":o?"titleRowMarginBottom":void 0,"data-controls-axis":o?"y":void 0,"data-controls-reverse":o?"":void 0,className:o?`${e}-control`:void 0,style:{height:qe,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},kt=()=>r.jsxs(r.Fragment,{children:[(E??0)>0||o?st("single-row"):null,N.map(d=>ft(d,"single-row")),o?r.jsxs(r.Fragment,{children:[It(),xt()]}):null,w?De():null]}),Ge=l.useCallback(d=>!!(d.closest("[data-controls]")||d.closest(`.${e}-thumbnails`)||d.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:nt,backdropStyle:Et,mediaAreaStyle:St,overlayContentStyle:_t,swipeHandlers:$n,dismissAreaStyle:ht}=nl({enabled:j??!1,onClose:et,animMs:Pi,isBlockedTarget:Ge}),Bt=()=>{if(!at||t.length===0)return ut.current=0,0;const d=Be.current[0],h=Be.current[t.length];if(!d||!h)return ut.current;const x=h.offsetLeft-d.offsetLeft;return x>0&&(ut.current=x),ut.current},Wt=(d=!1)=>{if(!at)return;const h=Xe.current,x=Bt();!h||x<=0||x<h.clientWidth*.25||(h.scrollLeft<=0?(h.scrollLeft+=x,d&&(Qe.current.scrollLeft+=x),rt.current&&(it.current+=x)):h.scrollLeft>=x*2&&(h.scrollLeft-=x,d&&(Qe.current.scrollLeft-=x),rt.current&&(it.current-=x)))},cn=(d,h=(x=>(x=Xe.current)==null?void 0:x.scrollLeft)()??0)=>{if(!at)return d;let q=t.length+d,le=1/0;for(let $e=0;$e<sn;$e++){const Fe=$e*t.length+d,Ue=Be.current[Fe];if(!Ue)continue;const Rt=Math.abs(Ue.offsetLeft-h);Rt<le&&(le=Rt,q=Fe)}return q},Sn=d=>{const h=Xe.current;return!d||!h?!1:d.offsetWidth>h.clientWidth+1},dn=d=>{const h=Xe.current;if(!d||!h||!Sn(d))return!1;const x=d.offsetLeft,q=x+d.offsetWidth;return h.scrollLeft>=x-1&&h.scrollLeft+h.clientWidth<=q+1},zt=(d=(h=>(h=Xe.current)==null?void 0:h.scrollLeft)()??0)=>{for(let q=0;q<Be.current.length;q+=1){const le=Be.current[q];if(le&&dn(le))return q}let x={flatIndex:0,distance:1/0};return Be.current.forEach((q,le)=>{if(!q)return;const $e=Math.abs(q.offsetLeft-d);$e<x.distance&&(x={flatIndex:le,distance:$e})}),x.flatIndex},Cn=d=>{Xe.current&&Be.current.forEach(h=>{h&&(h.style.scrollSnapAlign=Sn(h)&&d==="backward"?"end":"start")})},Xn=(d,h,x)=>{const q=d-h,le=zt(h),$e=Be.current[le];if(dn($e))return zt(d)%t.length;const Fe=Be.current[le+1],Ue=$e?Fe?Fe.offsetLeft-$e.offsetLeft:$e.offsetWidth:0,Rt=Ue>0?q>Ue*uo?1:q<-Ue*uo?-1:0:0;return Rt===0?x:at?(x+Rt+t.length)%t.length:Math.max(0,Math.min(t.length-1,x+Rt))},Yn=l.useCallback((d=!1)=>{if($!=="on"||o)return;const h=Ve.current,x=f.current,q=Ye.current[x];if(!h||!q||h.scrollWidth<=h.clientWidth)return;const le=h.scrollLeft,$e=le+h.clientWidth,Fe=q.offsetLeft,Ue=Fe+q.offsetWidth;if(Fe>=le&&Ue<=$e)return;const Rt=h.scrollWidth-h.clientWidth;let Ct=le;if(!d&&vt.current===null){const Zn=Ye.current[x-1],Si=Ye.current[x+1],to=Zn?q.offsetLeft-Zn.offsetLeft:Si?Si.offsetLeft-q.offsetLeft:q.offsetWidth;Ue>$e?Ct+=to:Fe<le&&(Ct-=to)}else Ue>$e?Ct=Ue-h.clientWidth:Ct=Fe;h.scrollLeft=Math.max(0,Math.min(Rt,Ct))},[o,$]),$i=l.useCallback((d=!1)=>{d&&(Le.current=!0),pe.current===null&&(pe.current=requestAnimationFrame(()=>{pe.current=null;const h=Le.current;Le.current=!1,Yn(h)}))},[Yn]),Yo=l.useCallback(d=>{if(d===f.current)return;const h=f.current;f.current=d;const x=Math.abs(d-h)>1,q=at&&t.length>1&&(h===t.length-1&&d===0||h===0&&d===t.length-1);ce(d),$i(x||q)},[t.length,at,$i]),Xt=()=>{if(!Xe.current||t.length===0||vt.current!==null||Qe.current.isActive&&Qe.current.hasMoved)return;const d=Xe.current.scrollLeft,h=zt(d)%t.length;h!==f.current&&Yo(h)},Yi=()=>{vt.current=null},Yt=d=>{const h=Xe.current;h&&(h.style.scrollSnapType=d?"":"none")},un=()=>{var d;(d=Ot.current)==null||d.call(Ot),Ot.current=null},Tn=()=>{Ze.current!==null&&(cancelAnimationFrame(Ze.current),Ze.current=null),rt.current=!1},Fn=()=>{const d=Xe.current;if(!d){Ze.current=null,rt.current=!1;return}const h=it.current-d.scrollLeft;if(Math.abs(h)<.5){d.scrollLeft=it.current,Wt(),Xt(),Ze.current=null,rt.current=!1;return}d.scrollLeft+=h*Xm,Wt(),Xt(),Ee(),Ze.current=requestAnimationFrame(Fn)},Wn=()=>{const d=Me.current;d&&(d.style.transition="",d.style.transform="",d.style.willChange="")},Ji=(d,h,x,q)=>{Wn(),d.scrollLeft=h,je.current=d.scrollLeft,Wt(),x!==void 0?(f.current=x,ce(x)):Xt(),Yt(!0),q==null||q()},Zi=(d,{behavior:h="smooth",activeIndex:x,onComplete:q}={})=>{const le=Xe.current,$e=Me.current;if(!le||!$e)return;if(Tn(),un(),Yt(!1),h==="auto"){Ji(le,d,x,q);return}const Fe=Math.abs(d-le.scrollLeft),Ue=Om(Fe,Vm,Dm,le.clientWidth*.55);Ot.current=zm(le,$e,d,{duration:Ue,easing:qm,onComplete:()=>{Ot.current=null,Ji(le,d,x,q)}})},Jo=(d="smooth")=>{const h=Xe.current;if(!h||t.length===0)return;const x=zt()%t.length,q=cn(x,h.scrollLeft),le=Be.current[q];le&&Zi(le.offsetLeft,{behavior:d,activeIndex:x})},Zo=(d,h="smooth",x,q)=>{const le=Xe.current;if(!le||t.length===0)return;const $e=(q??le.scrollLeft)-d,Fe=zt(d),Ue=Be.current[Fe];if(dn(Ue)){Yt(!0),Xt();return}const Rt=Be.current[Fe+1],Ct=Ue?Rt?Rt.offsetLeft-Ue.offsetLeft:Ue.offsetWidth:0;if((Ct>0?$e>Ct*uo?1:$e<-Ct*uo?-1:0:0)!==0){const cl=x??Fe%t.length,dl=Xn(q??le.scrollLeft,d,cl);nn(dl,h);return}const Si=q??le.scrollLeft,to=zt(Si),ra=Be.current[to];if(ra&&Math.abs(ra.offsetLeft-Si)<1){Yt(!0),Xt();return}Jo("auto")},nn=(d,h="smooth")=>{const x=Xe.current;if(!x||t.length===0)return;const q=cn(d,x.scrollLeft),le=Be.current[q];le&&(h==="smooth"?vt.current=d:vt.current=null,f.current=d,ce(d),$i(!0),Zi(le.offsetLeft,{behavior:h,activeIndex:d,onComplete:h==="smooth"?Yi:void 0}))},Jn=()=>{Mt.current&&(window.removeEventListener("pointerup",Mt.current),window.removeEventListener("pointercancel",Mt.current),Mt.current=null)},Qi=(d,h,x,q,le)=>{const $e=x-d,Fe=q-h,Ue=Math.abs($e),Rt=Math.abs(Fe);if(Ue<Jm||Ue<=Rt)return!1;const Ct=$e<0?1:-1,Zn=at?(le+Ct+t.length)%t.length:Math.max(0,Math.min(t.length-1,le+Ct));return Zn===le?!1:(nn(Zn),!0)},Nn=d=>{if(!Qe.current.isActive)return;Jn();const h=Xe.current;if(!h)return;const{scrollLeft:x,startActiveIndex:q,hasMoved:le}=Qe.current,$e=h.scrollLeft;Wt(!0),Qe.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},ot(!1),d!==void 0&&h.hasPointerCapture(d)&&h.releasePointerCapture(d),le?Zo(x,"smooth",q,$e):(Yt(!0),Xt()),Ee()},eo=(d,h)=>{const x=Pt.current;Pt.current=null,x&&(Qi(x.startX,x.startY,d,h,x.startActiveIndex),Ee())},Qo=d=>{if(!re)return;if(d.pointerType==="touch"){if(Tn(),Yt(!0),Ge(d.target))return;Pt.current={startX:d.clientX,startY:d.clientY,startActiveIndex:f.current};return}if(d.pointerType!=="mouse"||d.button!==0||Ge(d.target))return;const h=Xe.current;if(!h)return;Tn(),un(),Wn(),vt.current=null,Qe.current={isActive:!0,startX:d.clientX,scrollLeft:h.scrollLeft,startActiveIndex:f.current,hasMoved:!1},Yt(!1),Ee(),h.setPointerCapture(d.pointerId),Jn();const x=q=>{q.pointerType==="mouse"&&Nn(q.pointerId)};Mt.current=x,window.addEventListener("pointerup",x),window.addEventListener("pointercancel",x)},er=d=>{if(!re||d.pointerType!=="mouse")return;const h=Xe.current;if(!h||!Qe.current.isActive)return;if(d.buttons===0){Nn(d.pointerId);return}const x=d.clientX-Qe.current.startX;Math.abs(x)>Ym&&(Qe.current.hasMoved=!0,ot(!0)),Qe.current.hasMoved&&(d.preventDefault(),h.scrollLeft=Qe.current.scrollLeft-x,Wt(!0),Xt(),Ee())},M=d=>{if(re){if(d.pointerType==="touch"){d.type==="pointerup"?eo(d.clientX,d.clientY):Pt.current=null;return}d.pointerType==="mouse"&&Nn(d.pointerId)}},me=d=>{!re||d.pointerType!=="mouse"||Nn(d.pointerId)};return il(),l.useEffect(()=>{const d=requestAnimationFrame(()=>Ut(!0));return()=>{cancelAnimationFrame(d),un(),Jn(),pe.current!==null&&(cancelAnimationFrame(pe.current),pe.current=null),We.current&&clearTimeout(We.current),tt.current&&clearTimeout(tt.current)}},[]),l.useEffect(()=>{if(!he){yt(!0);return}Ee();const d=Lt.current;if(!d)return;const h=()=>Ee();return d.addEventListener("pointermove",h),d.addEventListener("pointerdown",h),()=>{d.removeEventListener("pointermove",h),d.removeEventListener("pointerdown",h),tt.current&&clearTimeout(tt.current)}},[he,Ee]),l.useEffect(()=>{const d=h=>{h.key==="Escape"&&et()};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[et]),l.useLayoutEffect(()=>{Bt()},[B,t.length,at]),l.useLayoutEffect(()=>{o||nn(f.current,"auto")},[B,o]),l.useLayoutEffect(()=>{nn(0,"auto")},[t.length,at]),l.useEffect(()=>{const d=Xe.current;if(!d||o||!j)return;const h=x=>{if(x.preventDefault(),Math.abs(x.deltaY)<=Math.abs(x.deltaX))return;const q=x.deltaMode===1?Um:x.deltaMode===2?d.clientHeight:1,le=x.deltaY*q*Gm;if(le!==0){if(un(),rt.current||(rt.current=!0,it.current=d.scrollLeft,vt.current=null,Yt(!1)),it.current+=le,!at){const $e=d.scrollWidth-d.clientWidth;it.current=Math.max(0,Math.min($e,it.current))}Ee(),Ze.current===null&&(Ze.current=requestAnimationFrame(Fn))}};return d.addEventListener("wheel",h,{passive:!1}),()=>{d.removeEventListener("wheel",h),Tn()}},[o,j,at]),l.useEffect(()=>{const d=Xe.current;if(!d)return;const h=()=>{Wt(Qe.current.isActive);const q=d.scrollLeft,le=q-je.current;je.current=q;const $e=ut.current>0?ut.current*.5:1/0;if(le!==0&&Math.abs(le)<$e){const Fe=le>0?"forward":"backward";Fe!==gt.current&&(gt.current=Fe,Cn(Fe))}Qe.current.isActive&&Qe.current.hasMoved||Xt()};d.addEventListener("scroll",h,{passive:!0});const x=new ResizeObserver(()=>{Bt(),Wt(Qe.current.isActive),Cn(gt.current),Xt()});return x.observe(d),()=>{un(),d.removeEventListener("scroll",h),x.disconnect()}},[t.length,at]),r.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{nt||et()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:tn?1:0,transition:`opacity ${Pi}ms ease`,pointerEvents:tn?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:u,...Et}}),r.jsxs("div",{ref:Lt,className:`${e}-lightbox-dismiss-area`,style:ht,...$n,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:St,onClick:d=>d.stopPropagation(),children:r.jsx("div",{ref:Xe,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":re&&t.length>0?"true":"false","data-mouse-dragging":ln?"true":"false",onPointerDown:Qo,onPointerMove:er,onPointerUp:M,onPointerCancel:M,onLostPointerCapture:me,children:r.jsx("div",{ref:Me,className:`${e}-lightbox-strip-track`,style:{gap:B},children:wn.map((d,h)=>{const x=d.image.objectFit??"contain",q=h%t.length,le=Math.floor(h/t.length),$e=po(B),Fe=`calc(-0.5 * (${$e} + ${B}))`;return r.jsxs("div",{ref:Ue=>Be.current[h]=Ue,className:`${e}-strip-item`,style:{height:W==="mobile"?"75vh":"100%"},children:[r.jsx("img",{src:d.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:x}}),o&&q<t.length-1&&le===0&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Fe,width:$e,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${le}-${d.image.url}-${q}`)})})})}),r.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":$t?"true":"false",style:_t,children:[r.jsx("div",{style:{position:"relative",width:"100%",height:Y,flexShrink:0,pointerEvents:"none"},children:o&&r.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-handle-left-fraction":"0.05",style:{position:"absolute",left:0,right:0,top:0,height:oe,pointerEvents:"auto",zIndex:3}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",flex:1,minHeight:0,pointerEvents:"none"},children:r.jsx("div",{className:`${e}-lightbox-content-area${V?` ${e}-lightbox-content-area-stacked`:""}`,children:(Ie||w)&&r.jsx("div",{className:`${e}-header ${V?`${e}-header-two-row`:`${e}-header-single-row`}`,children:V?pt():Ie||w?kt():null})})})]}),t.length>1&&$==="on"&&(()=>{const d=po(z),h=`calc(-0.5 * (${z} + ${d}))`;return r.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:z},children:r.jsx("div",{ref:Ve,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:x=>x.stopPropagation(),children:r.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":L,style:{gap:Q,"--thumbnail-active-color":A},children:[t.map((x,q)=>{const le=po(Q),$e=`calc(-0.5 * (${le} + ${Q}))`;return r.jsxs("div",{ref:Fe=>{Ye.current[q]=Fe},style:{position:"relative",flex:"0 0 auto"},children:[r.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":O===q?"true":"false",onClick:()=>j&&T==="click"&&nn(q),onMouseEnter:()=>Ce&&T==="hover"&&nn(q),"aria-label":x.image.name?`View ${x.image.name}`:`View image ${q+1}`,"aria-current":O===q?"true":void 0,children:r.jsx("img",{className:`${e}-thumb-image${Se?` ${e}-thumb-image-cover`:""}`,src:x.image.url,alt:"",draggable:!1,style:{...we,maxWidth:H,maxHeight:H,width:C.display==="cover"?"auto":"100%",height:"auto",objectFit:C.display==="cover"?"cover":"contain"}})}),o&&q<t.length-1&&r.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:$e,width:le,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${x.image.url}-${q}`)}),o&&r.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":o?"":void 0,style:{position:"absolute",left:0,right:0,bottom:h,height:d,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function cg(e){return`
10151
10151
  .${e}-wrapper {
10152
10152
  position: relative;
10153
10153
  width: 100%;
@@ -11093,7 +11093,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
11093
11093
  </>
11094
11094
  );
11095
11095
  };
11096
- `,pg="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),zn={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function mg(e){const t={};return t[lt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[lt(e,"fontSettings")]={...zn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[lt(e,"fontSize")]={...zn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[lt(e,"lineHeight")]={...zn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[lt(e,"letterSpacing")]={...zn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[lt(e,"wordSpacing")]={...zn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[lt(e,"textAlign")]={...zn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[lt(e,"textAppearance")]={...zn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const gg=hi.reduce((e,t)=>({...e,...mg(t)}),{}),hg=hi.reduce((e,t)=>({...e,[lt(t,"fontFamily")]:"Goudy Bookletter 1911",[lt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[lt(t,"letterSpacing")]:0,[lt(t,"wordSpacing")]:0,[lt(t,"textAlign")]:"left",[lt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function ts(e){return hi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[lt(n,"fontSize")]=i),o!==void 0&&(t[lt(n,"lineHeight")]=o),t},{})}const fg=rg(),yg={type:"object",version:1,settings:{sizing:"auto manual",properties:{cover:{type:"string",scope:"common",title:"",display:{type:"settings-image-input"}},coverFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},thumbnailSize:{type:"number",scope:"layout",title:"Thumbnail Size",min:0,display:{type:"range-control"}},thumbnailGap:{type:"number",scope:"layout",title:"Thumbnail Gap",min:0,display:{type:"range-control"}},thumbnailMarginBottom:{type:"number",scope:"layout",title:"Thumbnail Margin Bottom",min:0,display:{type:"range-control"}},imageGap:{type:"number",scope:"layout",title:"Image Gap",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"layout",title:"BG Default",display:{type:"settings-color-picker"}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},thumbnailVisibility:{type:"boolean",scope:"layout",title:"Visibility",display:{type:"toggle-cycle",enum:["on","off"]}},thumbnailObjectFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},thumbnailTrigger:{type:"string",scope:"common",title:"Trigger",display:{type:"toggle-cycle",enum:["click","hover"]}},thumbnailActive:{type:"boolean",scope:"common",title:"Active",display:{type:"toggle-cycle",enum:["outline","color","scale-up"]}},thumbnailActiveColor:{type:"string",scope:"common",title:"Outline Active",display:{type:"palette-color-picker",visible:!1}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1Color:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},...gg,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},title1MarginLeft:{type:"number",scope:"layout",title:"Title 1 margin left",min:0,display:{type:"range-control"}},titleRowMarginBottom:{type:"number",scope:"layout",title:"Title row margin bottom",min:0,display:{type:"range-control"}},iconMarginLeft:{type:"number",scope:"layout",title:"Icon margin left",min:0,display:{type:"range-control"}}},defaults:{cover:"https://cdn.cntrl.site/component-assets/lightbox_strip_1.jpg",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:pg,closeIconColor:"#000000",closeIconHoverColor:"#cccccc",thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",thumbnailActiveColor:"#ffffff",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",...hg},layoutDefaults:{m:{thumbnailSize:.1,thumbnailVisibility:"off",titleHeaderLayout:"mobile",thumbnailGap:.04,thumbnailMarginBottom:.04,imageGap:.005,title1Width:.25,title2Width:.6,title3Width:.25,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.04,titleRowMarginBottom:.08,closeIconMaxWidth:.04,backgroundColor:"#FFFFFF",contentMarginTop:.08,iconMarginLeft:.02,...ts({title1FontSize:.04,title1LineHeight:.04,title2FontSize:.04,title2LineHeight:.04,title3FontSize:.04,title3LineHeight:.04})},d:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.02,backgroundColor:"#FFFFFF",contentMarginTop:.015,iconMarginLeft:.02,...ts({title1FontSize:.011,title1LineHeight:.02,title2FontSize:.011,title2LineHeight:.02,title3FontSize:.011,title3LineHeight:.02})}},displayRules:[{if:{name:"thumbnailActive",value:"outline"},then:{name:"properties.thumbnailActiveColor.display.visible",value:!0}}],layout:["__componentName__","thumbnailGap","thumbnailMarginBottom","imageGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","contentMarginTop","title1MarginLeft","iconMarginLeft"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",title:"Thumbnails",items:["thumbnailVisibility","thumbnailObjectFit"]},{type:"row",items:["thumbnailTrigger","thumbnailActive"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]},{type:"row",title:"Cover",items:["cover","coverFit"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[fg]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor","thumbnailActiveColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"contain",type:"media-input"}},title1:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},title2:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},title3:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_2.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_3.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_4.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_5.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_6.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_7.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"}]}},vg={element:dg,id:"lightbox-strip",name:"Strip",category:"galleries",version:1,defaultSize:{d:{width:350,height:350},m:{width:300,height:350}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Strip.mp4"},schema:yg,sourceCode:ug,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...hi.map(e=>({path:`${lt(e,"fontFamily")}`}))]},fontRelations:{...hi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${lt(t,"fontFamily")}`}),{})}},bg=50,ns=10,ia="cntrl-lightbox-journal",Uo=ia,Ir=`${ia}-`,Xo=e=>`${ia}-${e}`,oa=e=>e===Uo||e.startsWith(Ir),is=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},os=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=is(t.get(Xo(e)));if(i)return i}const n=is(t.get(Uo));if(n)return n;for(const[i]of t){if(!i.startsWith(Ir))continue;const o=i.slice(Ir.length);if(!/^\d+$/.test(o))continue;const s=Number.parseInt(o,10);if(Number.isFinite(s)&&s>=1)return s}return null},rs=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},rl=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(a=>{oa(a)&&i.searchParams.delete(a)}),t?i.searchParams.set(Xo(t),String(e)):i.searchParams.set(Uo,String(e));const o=n?"replaceState":"pushState",s=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",s)},xg=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===Xo(e)||i===Uo:oa(i));if(n.forEach(i=>t.searchParams.delete(i)),n.length>0){const i=`${t.pathname}${t.search}${t.hash}`;window.history.replaceState(window.history.state,"",i)}},al=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(Xo(e)):[...t.keys()].some(n=>oa(n))},wg=(e,t)=>{if(al(t)){if(e){window.history.back();return}xg(t)}},$g=20,Sg=2,fr=e=>`max(${e}, ${$g}px)`,fi=e=>((e==null?void 0:e.image)??[]).slice(0,Sg),sl=e=>e.reduce((t,n)=>t+fi(n).length,0),Cg=(e,t)=>{const n=e.slice(0,t).reduce((o,s)=>o+fi(s).length,1),i=fi(e[t]).length;return{start:n,end:n+i-1}},Tg=(e,t)=>{const n=sl(e),{start:i,end:o}=Cg(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},Lo=(e,t)=>t==="B"?e.flatMap((n,i)=>fi(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:fi(n)})),Lg=(e,t,n,i)=>{var s;if(n==="B")return`${t+1} / ${e.length}`;const o=((s=e[t])==null?void 0:s.entryIndex)??0;return Tg(i,o)},as=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",Eg=(e,t,n)=>e==="B"?t.length>1:sl(n)>1,ti=.004,go=.004,yr={title1Width:.13,title2Width:.13,title3Width:.14},ho=(e,t,n,i,o)=>{const s=[];return t.title1&&s.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:n,text:t.title1}),t.title2&&s.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:i,text:t.title2}),t.title3&&s.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:o,text:t.title3}),s},Mo=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((s,a)=>s+a,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:s,widths:a},u)=>{if(s<=0||u<=0)return{overflow:s,widths:[u,...a]};const c=Math.min(s,u);return{overflow:s-c,widths:[u-c,...a]}},{overflow:i-1,widths:[]});return o},Pr=(e,t)=>Mo(e,t),Vn=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},fo=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Mo(e.length,n),effective:Pr(e.length,n)}},Ig=(e,t,n,i)=>e.slice(0,i).reduce((o,s,a)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[a]??0),0),Pg=(e,t,n,i)=>e.slice(0,i+1).reduce((o,s,a)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[a]??0),0),yi=["title1","title2","title3","count"],ct=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,kg={title1:"1",title2:"2",title3:"3",count:"Count"},Rg=e=>[ct(e,"fontFamily"),ct(e,"fontSettings"),{type:"row",items:[ct(e,"fontSize"),ct(e,"lineHeight"),ct(e,"letterSpacing"),ct(e,"wordSpacing")]},ct(e,"textAlign"),ct(e,"textAppearance")],Ag=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(yi.map(e=>[kg[e],Rg(e)]))}),Mg={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},_g={title1:.02,title2:.02,title3:.02,count:.017},yo=(e,t)=>{const n=i=>{const o=ct(t,i);return e[o]};return{fontFamily:n("fontFamily")??"Arial",fontSettings:n("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:n("fontSize"),lineHeight:n("lineHeight"),letterSpacing:n("letterSpacing")??0,wordSpacing:n("wordSpacing")??0,textAlign:n("textAlign")??"left",textAppearance:n("textAppearance"),color:e[Mg[t]]}},vo=(e,t,n)=>{var o,s;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((s=t.fontSettings)==null?void 0:s.fontStyle)??"normal"},fontSize:t.fontSize??_g[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return At(i,n)},Fg=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,initialSlideIndex:a=0,enableUrlSync:u=!1,journalItemId:c=null,onBeforeClose:m,onClose:p})=>{const{type:b,coverFit:w,backgroundColor:S,imageGap:g,maxWidth:v,maxHeight:T,textTransition:$,title1Width:C,title2Width:L,title3Width:A,title1MarginLeft:k=0,title2MarginLeft:F=0,title3MarginLeft:I=0,titleRowMarginBottom:E=0,titleHeaderLayout:J="single-row",countCloseGap:y=0,closeIcon:_,closeIconMaxWidth:W,closeIconColor:G,closeIconHoverColor:te,contentMarginTop:ue=0,iconMarginRight:X=0}=n,H=l.useCallback(M=>P.scalingValue(M,i??!1),[i]),Q=H(g??0),z=`${v}%`,B=`${T}%`,Y=H(y),oe=H(ue),ie=H(X),O=vo("title1",yo(n,"title1"),i),ce=vo("title2",yo(n,"title2"),i),f=vo("title3",yo(n,"title3"),i),de=vo("count",yo(n,"count"),i),be=J==="mobile",fe=!i||!!s,Re=!o&&(!i||!!s),Z=l.useMemo(()=>Lo(t,b),[t,b]),[ge,U]=l.useState(a),V=Z[ge],j=V==null?void 0:V.entry,[he,re]=l.useState(!1),[Ce,Se]=l.useState(null),[we,Ie]=l.useState(!1),[N,ee]=l.useState(null),[R,K]=l.useState(!1),[D,ae]=l.useState(0),[ne,ye]=l.useState(),[ke,Te]=l.useState(),[xe,Ke]=l.useState(null),se=l.useRef(null),Ae=l.useRef(0),Ne=l.useRef(0),He=l.useRef(0),dt=l.useRef(!1),ft=l.useRef(null),It=l.useRef(null),xt=l.useRef(null),wt=l.useRef(null),Ht=l.useRef(null),Lt=l.useRef(null),Xe=l.useRef(null),Me=l.useCallback(()=>{const M=It.current;if(!M)return;const me=M.closest(`.${e}-lightbox-content-area`);if(!me)return M.getBoundingClientRect().width;const d=Array.from(me.children).reduce((h,x)=>!(x instanceof HTMLElement)||x.contains(M)?h:h+x.getBoundingClientRect().width,0);return me.getBoundingClientRect().width-d},[e]),Ve=l.useCallback(()=>{se.current&&(clearTimeout(se.current),se.current=null)},[]),Ye=l.useCallback(M=>{M===Ae.current&&(ee(null),K(!1))},[]),Be=l.useCallback(()=>{o||dt.current||(dt.current=!0,m==null||m(),re(!1),ft.current=setTimeout(()=>{p()},300))},[o,m,p]),ut=l.useCallback(M=>!!(M.closest("[data-controls]")||M.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:Pt,backdropStyle:Qe,mediaAreaStyle:Mt,overlayContentStyle:Ot,swipeHandlers:je,dismissAreaStyle:gt}=nl({enabled:Re,onClose:Be,animMs:300,isBlockedTarget:ut}),it=l.useCallback(M=>{u&&rl(M+1,c,!0)},[u,c]),Ze=l.useCallback(M=>{if(M)return M.getBoundingClientRect().height},[]),rt=l.useCallback(M=>{if(Z.length===0)return;const me=(M%Z.length+Z.length)%Z.length;if(me===ge)return;const d=Z[ge],h=Z[me];Ae.current+=1;const x=Ae.current,q=$==="fade"&&as(d==null?void 0:d.entry)!==as(h==null?void 0:h.entry),le=Ze(xt.current),$e=q?(()=>{const Ue=Me();ji.flushSync(()=>{Ke(h.entry)}),xt.current&&Ue&&(xt.current.style.width=`${Ue}px`);const Rt=Ze(xt.current);return xt.current&&(xt.current.style.width=""),{measuredIncomingTitlesHeight:Rt,incomingTitlesMeasureWidth:Ue}})():void 0,Fe=Math.max(le??0,($e==null?void 0:$e.measuredIncomingTitlesHeight)??0)||void 0;ae(x),ee(ge),K(!0),U(me),it(me),He.current=me,q?(Ve(),Fe&&ye(Fe),$e!=null&&$e.incomingTitlesMeasureWidth&&Te($e.incomingTitlesMeasureWidth),Se((d==null?void 0:d.entryIndex)??null),Ie(!0),Ne.current=h.entryIndex,se.current=setTimeout(()=>{Se(null),Ie(!1),ye(void 0),Te(void 0),Ke(null),se.current=null},400)):(Ve(),Se(null),Ie(!1),ye(void 0),Te(void 0),Ke(null),Ne.current=h.entryIndex)},[ge,Ve,Me,Ze,Z,it,$]),at=l.useCallback(()=>{Xe.current=null},[]),sn=l.useCallback(M=>{!fe||Z.length<=1||M.pointerType==="mouse"&&M.button!==0||M.target.closest("[data-controls]")||(Xe.current={startX:M.clientX,startY:M.clientY,pointerId:M.pointerId})},[fe,Z.length]),wn=l.useCallback(M=>{var Ue;if(!fe||Z.length<=1||M.pointerType==="mouse"&&M.button!==0)return;if(Pt){at();return}const me=Xe.current;if(!me||me.pointerId!==M.pointerId||(at(),M.target.closest("[data-controls]")))return;const h=M.clientX-me.startX,x=M.clientY-me.startY,q=Math.abs(h),le=Math.abs(x);if(q>=bg&&q>le){rt(h>0?ge-1:ge+1);return}if(q>ns||le>ns)return;const $e=(Ue=wt.current)==null?void 0:Ue.getBoundingClientRect(),Fe=$e?$e.left+$e.width/2:window.innerWidth/2;rt(M.clientX<Fe?ge-1:ge+1)},[ge,fe,rt,Pt,at,Z.length]),ln=l.useCallback(M=>{const me=Xe.current;(me==null?void 0:me.pointerId)===M.pointerId&&at()},[at]);il(),l.useEffect(()=>{Lt.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const M=requestAnimationFrame(()=>{re(!0),requestAnimationFrame(()=>{Ht.current?Ht.current.focus():wt.current&&wt.current.focus()})});return()=>{cancelAnimationFrame(M),ft.current&&clearTimeout(ft.current),se.current&&clearTimeout(se.current);const me=Lt.current;me&&document.contains(me)&&me.focus()}},[]),l.useEffect(()=>{var M;$!=="fade"&&(Ne.current=((M=Z[ge])==null?void 0:M.entryIndex)??0,Ve(),Se(null),Ie(!1),ye(void 0),Te(void 0))},[ge,Ve,Z,$]),l.useEffect(()=>{const M=me=>{if(me.key==="Escape"){Be();return}if(me.key==="ArrowLeft"&&Z.length>1){rt(ge-1);return}if(me.key==="ArrowRight"&&Z.length>1){rt(ge+1);return}if(me.key==="Tab"&&wt.current){const d=wt.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),h=Array.from(d).filter($e=>!$e.closest('[aria-hidden="true"]'));if(h.length===0)return;const x=h[0],q=h[h.length-1],le=document.activeElement;me.shiftKey?(le===x||!wt.current.contains(le))&&(me.preventDefault(),q.focus()):(le===q||!wt.current.contains(le))&&(me.preventDefault(),x.focus())}};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[rt,Be,ge,Z.length]),l.useLayoutEffect(()=>{Ve(),Ae.current=0,ae(0),ee(null),K(!1),Se(null),Ie(!1),ye(void 0),Te(void 0),Ke(null),U(M=>{const me=Math.max(0,Z.length-1);return Math.min(M,me)})},[Ve,t.length,b,Z.length]),l.useLayoutEffect(()=>{var d;const M=Math.max(0,Z.length-1),me=Math.min(Math.max(0,a),M);He.current=me,Ne.current=((d=Z[me])==null?void 0:d.entryIndex)??0,U(me)},[a]);const ot=Ce!==null?t[Ce]:null,tn=N!==null?Z[N]:null,Ut=(j==null?void 0:j.title1)||(j==null?void 0:j.title2)||(j==null?void 0:j.title3)||(ot==null?void 0:ot.title1)||(ot==null?void 0:ot.title2)||(ot==null?void 0:ot.title3),qe=Eg(b,Z,t),yt=_!==null,vt=Ut||qe||yt,pe=qe&&yt?{gap:Y}:void 0,Le=`${e}-titles-stack${be?` ${e}-titles-stack-stacked`:""}`,_e=`${e}-titles-layer-out${be?` ${e}-titles-layer-out-stacked`:""}`,We=`${e}-titles-layer-out`,tt=(k??0)>0||o,$t=H(E),Ee=l.useMemo(()=>({title1Width:C??yr.title1Width,title2Width:L??yr.title2Width,title3Width:A??yr.title3Width}),[C,L,A]),et=l.useMemo(()=>({title2MarginLeft:F,title3MarginLeft:I}),[F,I]),De=l.useMemo(()=>j?ho(e,j,O,ce,f):[],[e,j,O,ce,f]),st=l.useMemo(()=>De.map(M=>Ee[M.widthKey]),[De,Ee]),pt=l.useMemo(()=>Mo(De.length,st),[De.length,st]),kt=l.useMemo(()=>Pr(De.length,st),[De.length,st]),Ge=l.useMemo(()=>De.filter(M=>M.prefix==="title1"),[De]),nt=l.useMemo(()=>De.filter(M=>M.prefix==="title2"||M.prefix==="title3"),[De]),Et=l.useMemo(()=>fo(Ge,Ee),[Ge,Ee]),St=l.useMemo(()=>fo(nt,Ee),[nt,Ee]),_t=l.useCallback((M,me)=>{const d=De.findIndex(x=>x.prefix===M.prefix);if(!be||me==="single-row")return{effectiveWidth:kt[d]??0,resolvedWidth:pt[d]??0,maxWidth:Vn(d,pt)};if(me==="two-row-top"){const x=Ge.findIndex(q=>q.prefix===M.prefix);return{effectiveWidth:Et.effective[x]??0,resolvedWidth:Et.resolved[x]??0,maxWidth:Vn(x,Et.resolved)}}const h=nt.findIndex(x=>x.prefix===M.prefix);return{effectiveWidth:St.effective[h]??0,resolvedWidth:St.resolved[h]??0,maxWidth:Vn(h,St.resolved)}},[De,nt,St,kt,pt,Ge,Et,be]),$n=l.useCallback(M=>Pg(De,pt,et,M)+(be?0:k??0),[De,pt,et,be,k]),ht=l.useCallback(()=>be?0:k??0,[be,k]),Bt=l.useCallback(M=>nt.slice(0,M).reduce((me,d,h)=>me+(d.marginLeftKey?et[d.marginLeftKey]??0:0)+(St.resolved[h]??0),0),[nt,St.resolved,et]),Wt=l.useCallback(M=>{const me=nt[M];return Bt(M)+(me.marginLeftKey?et[me.marginLeftKey]??0:0)+(St.resolved[M]??0)},[nt,St.resolved,Bt,et]),cn=l.useCallback((M,me,d)=>{if(!be||d==="single-row"){const $e=M.findIndex(Ct=>Ct.prefix===me.prefix),Fe=M.map(Ct=>Ee[Ct.widthKey]),Ue=Mo(M.length,Fe);return{effectiveWidth:Pr(M.length,Fe)[$e]??0,resolvedWidth:Ue[$e]??0,maxWidth:Vn($e,Ue)}}if(d==="two-row-top"){const $e=M.filter(Ct=>Ct.prefix==="title1"),Fe=$e.findIndex(Ct=>Ct.prefix===me.prefix),{resolved:Ue,effective:Rt}=fo($e,Ee);return{effectiveWidth:Rt[Fe]??0,resolvedWidth:Ue[Fe]??0,maxWidth:Vn(Fe,Ue)}}const h=M.filter($e=>$e.prefix==="title2"||$e.prefix==="title3"),x=h.findIndex($e=>$e.prefix===me.prefix),{resolved:q,effective:le}=fo(h,Ee);return{effectiveWidth:le[x]??0,resolvedWidth:q[x]??0,maxWidth:Vn(x,q)}},[Ee,be]),Sn=(M,me,d)=>{const h=M.marginLeftKey?et[M.marginLeftKey]??0:0,{effectiveWidth:x,resolvedWidth:q,maxWidth:le}=d??_t(M,me),$e=Math.max(h,go),Fe=o&&me==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":M.prefix,style:{width:H(x),...h>0?{marginLeft:H(h)}:{}},children:[r.jsx("p",{className:M.className,style:M.style,children:M.text}),Fe&&M.marginLeftKey?r.jsx("div",{"data-controls":M.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(q),style:{position:"absolute",top:0,left:H(-h),width:H($e),height:"100%",pointerEvents:"auto"}}):null,Fe?r.jsx("div",{"data-controls":M.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(le),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:H(-ti/2),width:H(ti),height:"100%",pointerEvents:"auto"}}):null]},M.className)},dn=(M="two-row")=>{const me=De.findIndex(x=>x.prefix==="title1"),d=me>=0?pt[me]:Ee.title1Width,h=M==="two-row"&&o;return r.jsx("div",{...h?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(d)}:{},style:{width:H(k??0),flexShrink:0,alignSelf:"stretch",...h?{pointerEvents:"auto"}:{}}})},zt=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:O,"aria-hidden":"true",children:" "}),Cn=()=>r.jsx("span",{className:`${e}-entry-counter`,style:de,"aria-live":"polite","aria-atomic":"true",children:Lg(Z,ge,b,t)}),Xn=()=>qe?o&&yt?r.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Cn(),r.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${fr(Y)} + ${Y}))`,width:fr(Y),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Cn():null,Yn=()=>!qe&&!yt?null:r.jsxs("div",{className:`${e}-titles-row-header-controls`,style:pe,children:[Xn(),yt?Xt():null]}),$i=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[qe||Ut?zt():null,tt?dn("single-row"):null,Yt(j),r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),Yn(),nn()]}),Yo=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[qe||Ut?zt():null,tt?dn("single-row"):null,r.jsxs("div",{className:`${e}-titles-row-titles`,style:we&&ne?{minHeight:ne}:void 0,children:[r.jsx("div",{ref:xt,className:Le,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Wn(xe||j)}),r.jsxs("div",{ref:It,className:Le,style:{position:we?"absolute":"relative",inset:we?0:void 0,width:"100%",...we&&ke?{width:ke,maxWidth:"100%"}:void 0},children:[ot&&we?r.jsx("div",{className:`${_e} ${e}-titles-fade-out`,children:Wn(ot)}):null,r.jsx("div",{className:`${e}-titles-layer-in${we?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:Wn(j)})]})]}),Yn(),nn()]}),Xt=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:P.scalingValue(W??0,i),height:P.scalingValue(W??0,i),marginRight:ie,"--close-icon-hover-color":te},children:[r.jsx("button",{ref:Ht,type:"button",className:`${e}-close-icon-inner`,onClick:Be,"aria-label":"Close",children:r.jsx(Qt,{url:_??"",fill:G,hoverFill:i&&!s?G:te,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:ie,height:"100%",pointerEvents:"auto"}})]}),Yi=(M,me)=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[qe||Ut?zt():null,tt?dn("two-row"):null,me!==void 0?r.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:me},children:M}):r.jsxs(r.Fragment,{children:[M,r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),Yn()]}),Yt=M=>{if(!M)return null;const me=ho(e,M,O,ce,f);return r.jsx(r.Fragment,{children:me.map(d=>Sn(d,"single-row",cn(me,d,"single-row")))})},un=M=>{if(!M)return null;const me=ho(e,M,O,ce,f),d=me.find(h=>h.prefix==="title1");return d?Sn(d,"two-row-top",cn(me,d,"two-row-top")):null},Tn=(M,me=!1)=>{const d=M?ho(e,M,O,ce,f):[],h=d.filter(le=>le.prefix==="title2"||le.prefix==="title3"),x=o&&me;return h.length>0||x||(E??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[h.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[h.map(le=>Sn(le,"two-row-bottom",cn(d,le,"two-row-bottom"))),me&&o?r.jsxs(r.Fragment,{children:[Jo(),Zo()]}):null]}):null,(E??0)>0||x?r.jsx("div",{"data-controls":x?"titleRowMarginBottom":void 0,"data-controls-axis":x?"y":void 0,"data-controls-reverse":x?"":void 0,className:x?`${e}-control`:void 0,style:{height:$t,width:"100%",flexShrink:0,pointerEvents:x?"auto":"none"}}):null]}):null},Fn=(M,me=!1)=>r.jsxs(r.Fragment,{children:[Yi(un(M)),Tn(M,me)]}),Wn=M=>be?r.jsx("div",{className:`${e}-titles-row-two-row`,children:Fn(M)}):M?r.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:Yt(M)}):null,Ji=()=>{const M=be?-1:De.findIndex(h=>h.prefix==="title1"),me=!be&&(o||(k??0)>0)?(()=>{const h=k??0,x=M>=0?pt[M]:Ee.title1Width,q=Math.max(h,go);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(x),style:{position:"absolute",top:0,left:0,width:H(q),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,d=De.flatMap((h,x)=>{if(!h.marginLeftKey)return[];const q=et[h.marginLeftKey]??0,le=Ig(De,pt,et,x)+ht(),$e=Math.max(q,go);return r.jsx("div",{"data-controls":h.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(pt[x]),style:{position:"absolute",top:0,left:H(le),width:H($e),height:"100%",pointerEvents:"auto"}},h.marginLeftKey)});return me?[me,...d]:d},Zi=()=>De.map((M,me)=>{const d=Vn(me,pt),x=$n(me)-ti/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":M.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(d),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:H(x),width:H(ti),height:"100%",pointerEvents:"auto"}})},`${M.widthKey}-junction`)}),Jo=()=>nt.flatMap((M,me)=>{if(!M.marginLeftKey)return[];const d=et[M.marginLeftKey]??0,h=Bt(me),x=Math.max(d,go),{resolvedWidth:q}=_t(M,"two-row-bottom");return r.jsx("div",{"data-controls":M.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(q),style:{position:"absolute",top:0,left:H(h),width:H(x),height:"100%",pointerEvents:"auto"}},M.marginLeftKey)}),Zo=()=>nt.map((M,me)=>{const{maxWidth:d}=_t(M,"two-row-bottom"),x=Wt(me)-ti/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":M.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(d),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:H(x),width:H(ti),height:"100%",pointerEvents:"auto"}})},`${M.widthKey}-junction`)}),nn=()=>!o||be?null:r.jsxs(r.Fragment,{children:[Ji(),Zi()]}),Jn=M=>{const me=!M.objectFit&&vn(w);return{className:`${e}-slide-image-cell${me?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:z,maxHeight:B,...me?{"--image-aspect-ratio":Go(w)}:{}}}},Qi=M=>M.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":M.objectFit}}:vn(w)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},Nn=M=>{if(M.length===0)return null;const me=M.length>1,d=fr(Q),h=`calc(-0.5 * (${d} + ${Q}))`;if(M.length===1){const x=M[0];return r.jsx("div",{...Jn(x),children:r.jsx("img",{...Qi(x),src:x.url,alt:x.name??"",draggable:!1})})}return r.jsx("div",{className:`${e}-slide-inner`,style:me?{gap:Q}:void 0,children:M.map((x,q)=>r.jsxs("div",{...Jn(x),children:[r.jsx("img",{...Qi(x),src:x.url,alt:x.name??"",draggable:!1}),o&&me&&q<M.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:h,width:d,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${x.url}-${q}`))})},eo=!!(j!=null&&j.title2||j!=null&&j.title3||ot!=null&&ot.title2||ot!=null&&ot.title3||(E??0)>0||o),Qo=()=>r.jsxs("div",{style:{position:"relative",width:"100%",flex:1,alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,height:"100%"},children:[r.jsx("div",{ref:xt,className:Le,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Fn(xe||j)}),r.jsxs("div",{ref:It,className:`${e}-titles-row-two-row`,style:{...we&&ne?{minHeight:ne}:void 0,...we&&ke?{width:ke,maxWidth:"100%"}:void 0},children:[Yi(r.jsxs("div",{className:Le,style:{position:we?"absolute":"relative",inset:we?0:void 0,width:"100%"},children:[ot&&we?r.jsx("div",{className:`${We} ${e}-titles-fade-out`,children:un(ot)}):null,r.jsx("div",{className:`${e}-titles-layer-in${we?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:un(j)})]}),we&&ne?ne:void 0),eo?r.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[ot&&we?r.jsx("div",{className:`${_e} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:Tn(ot)}):null,r.jsx("div",{className:`${e}-titles-layer-in${we?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${be?` ${e}-titles-layer-in-stacked`:""}`,children:Tn(j,!0)})]}):null]})]}),er=()=>{const M=eo;return r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...M?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:M?void 0:{flex:"0 0 auto",height:"auto"},children:Fn(j,!0)}),nn()]})};return r.jsxs("div",{ref:wt,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{Pt||Be()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:yt?void 0:-1,style:{opacity:he?1:0,transition:"opacity 300ms ease",pointerEvents:he?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:S,...Qe}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:gt,...je,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:Mt,onClick:M=>M.stopPropagation(),children:r.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":fe&&Z.length>1?"true":"false",onPointerDown:fe?sn:void 0,onPointerUp:fe?wn:void 0,onPointerCancel:fe?ln:void 0,children:r.jsxs("div",{className:`${e}-slide-stack`,children:[tn&&R?r.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:M=>{M.target===M.currentTarget&&Ye(D)},children:r.jsx("div",{className:`${e}-slide-area`,children:Nn(tn.images)})},`slide-out-${D}`):null,r.jsx("div",{className:`${e}-slide-layer-in${R?` ${e}-slide-fade-in`:""}`,children:r.jsx("div",{className:`${e}-slide-area`,children:V?Nn(V.images):null})},`slide-in-${D}-${ge}`)]})})}),r.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Ot,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:oe,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...be?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${be?` ${e}-lightbox-content-area-stacked`:""}`,children:vt&&r.jsx("div",{className:`${e}-text-bar-cell${be?` ${e}-text-bar-cell-stacked`:""}`,style:be?void 0:{flex:1,minWidth:0,width:"100%"},children:be?$==="fade"?Qo():er():$==="fade"?Yo():$i()})})})]})]})]})};function Wg(e){return`
11096
+ `,pg="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),zn={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function mg(e){const t={};return t[lt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[lt(e,"fontSettings")]={...zn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[lt(e,"fontSize")]={...zn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[lt(e,"lineHeight")]={...zn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[lt(e,"letterSpacing")]={...zn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[lt(e,"wordSpacing")]={...zn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[lt(e,"textAlign")]={...zn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[lt(e,"textAppearance")]={...zn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const gg=hi.reduce((e,t)=>({...e,...mg(t)}),{}),hg=hi.reduce((e,t)=>({...e,[lt(t,"fontFamily")]:"Goudy Bookletter 1911",[lt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[lt(t,"letterSpacing")]:0,[lt(t,"wordSpacing")]:0,[lt(t,"textAlign")]:"left",[lt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function ts(e){return hi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[lt(n,"fontSize")]=i),o!==void 0&&(t[lt(n,"lineHeight")]=o),t},{})}const fg=rg(),yg={type:"object",version:1,settings:{sizing:"auto manual",properties:{cover:{type:"string",scope:"common",title:"",display:{type:"settings-image-input"}},coverFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},thumbnailSize:{type:"number",scope:"layout",title:"Thumbnail Size",min:0,display:{type:"range-control"}},thumbnailGap:{type:"number",scope:"layout",title:"Thumbnail Gap",min:0,display:{type:"range-control"}},thumbnailMarginBottom:{type:"number",scope:"layout",title:"Thumbnail Margin Bottom",min:0,display:{type:"range-control"}},imageGap:{type:"number",scope:"layout",title:"Image Gap",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"layout",title:"BG Default",display:{type:"settings-color-picker"}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},thumbnailVisibility:{type:"boolean",scope:"layout",title:"Visibility",display:{type:"toggle-cycle",enum:["on","off"]}},thumbnailObjectFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},thumbnailTrigger:{type:"string",scope:"common",title:"Trigger",display:{type:"toggle-cycle",enum:["click","hover"]}},thumbnailActive:{type:"boolean",scope:"common",title:"Active",display:{type:"toggle-cycle",enum:["outline","color","scale-up"]}},thumbnailActiveColor:{type:"string",scope:"common",title:"Outline Active",display:{type:"palette-color-picker",visible:!1}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1Color:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},...gg,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},title1MarginLeft:{type:"number",scope:"layout",title:"Title 1 margin left",min:0,display:{type:"range-control"}},titleRowMarginBottom:{type:"number",scope:"layout",title:"Title row margin bottom",min:0,display:{type:"range-control"}},iconMarginLeft:{type:"number",scope:"layout",title:"Icon margin left",min:0,display:{type:"range-control"}}},defaults:{cover:"https://cdn.cntrl.site/component-assets/lightbox_strip_1.jpg",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:pg,closeIconColor:"#000000",closeIconHoverColor:"#cccccc",thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",thumbnailActiveColor:"#ffffff",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",...hg},layoutDefaults:{m:{thumbnailSize:.1,thumbnailVisibility:"off",titleHeaderLayout:"mobile",thumbnailGap:.04,thumbnailMarginBottom:.04,imageGap:.005,title1Width:.25,title2Width:.6,title3Width:.25,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.04,titleRowMarginBottom:.08,closeIconMaxWidth:.04,backgroundColor:"#FFFFFF",contentMarginTop:.08,iconMarginLeft:.02,...ts({title1FontSize:.04,title1LineHeight:.04,title2FontSize:.04,title2LineHeight:.04,title3FontSize:.04,title3LineHeight:.04})},d:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.02,backgroundColor:"#FFFFFF",contentMarginTop:.015,iconMarginLeft:.02,...ts({title1FontSize:.011,title1LineHeight:.02,title2FontSize:.011,title2LineHeight:.02,title3FontSize:.011,title3LineHeight:.02})}},displayRules:[{if:{name:"thumbnailActive",value:"outline"},then:{name:"properties.thumbnailActiveColor.display.visible",value:!0}}],layout:["__componentName__","thumbnailGap","thumbnailMarginBottom","imageGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","contentMarginTop","title1MarginLeft","iconMarginLeft"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",title:"Thumbnails",items:["thumbnailVisibility","thumbnailObjectFit"]},{type:"row",items:["thumbnailTrigger","thumbnailActive"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]},{type:"row",title:"Cover",items:["cover","coverFit"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[fg]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor","thumbnailActiveColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"contain",type:"media-input"}},title1:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},title2:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},title3:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_2.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_3.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_4.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_5.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_6.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_7.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"}]}},vg={element:dg,id:"lightbox-strip",name:"Strip",category:"galleries",version:1,defaultSize:{d:{width:350,height:350},m:{width:300,height:350}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Strip.mp4"},schema:yg,sourceCode:ug,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...hi.map(e=>({path:`${lt(e,"fontFamily")}`}))]},fontRelations:{...hi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${lt(t,"fontFamily")}`}),{})}},bg=50,ns=10,ia="cntrl-lightbox-journal",Uo=ia,Ir=`${ia}-`,Xo=e=>`${ia}-${e}`,oa=e=>e===Uo||e.startsWith(Ir),is=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},os=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=is(t.get(Xo(e)));if(i)return i}const n=is(t.get(Uo));if(n)return n;for(const[i]of t){if(!i.startsWith(Ir))continue;const o=i.slice(Ir.length);if(!/^\d+$/.test(o))continue;const s=Number.parseInt(o,10);if(Number.isFinite(s)&&s>=1)return s}return null},rs=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},rl=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(a=>{oa(a)&&i.searchParams.delete(a)}),t?i.searchParams.set(Xo(t),String(e)):i.searchParams.set(Uo,String(e));const o=n?"replaceState":"pushState",s=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",s)},xg=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===Xo(e)||i===Uo:oa(i));if(n.forEach(i=>t.searchParams.delete(i)),n.length>0){const i=`${t.pathname}${t.search}${t.hash}`;window.history.replaceState(window.history.state,"",i)}},al=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(Xo(e)):[...t.keys()].some(n=>oa(n))},wg=(e,t)=>{if(al(t)){if(e){window.history.back();return}xg(t)}},$g=20,Sg=2,fr=e=>`max(${e}, ${$g}px)`,fi=e=>((e==null?void 0:e.image)??[]).slice(0,Sg),sl=e=>e.reduce((t,n)=>t+fi(n).length,0),Cg=(e,t)=>{const n=e.slice(0,t).reduce((o,s)=>o+fi(s).length,1),i=fi(e[t]).length;return{start:n,end:n+i-1}},Tg=(e,t)=>{const n=sl(e),{start:i,end:o}=Cg(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},Lo=(e,t)=>t==="B"?e.flatMap((n,i)=>fi(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:fi(n)})),Lg=(e,t,n,i)=>{var s;if(n==="B")return`${t+1} / ${e.length}`;const o=((s=e[t])==null?void 0:s.entryIndex)??0;return Tg(i,o)},as=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",Eg=(e,t,n)=>e==="B"?t.length>1:sl(n)>1,ti=.004,go=.004,yr={title1Width:.13,title2Width:.13,title3Width:.14},ho=(e,t,n,i,o)=>{const s=[];return t.title1&&s.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:n,text:t.title1}),t.title2&&s.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:i,text:t.title2}),t.title3&&s.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:o,text:t.title3}),s},Mo=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((s,a)=>s+a,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:s,widths:a},u)=>{if(s<=0||u<=0)return{overflow:s,widths:[u,...a]};const c=Math.min(s,u);return{overflow:s-c,widths:[u-c,...a]}},{overflow:i-1,widths:[]});return o},Pr=(e,t)=>Mo(e,t),Vn=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},fo=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Mo(e.length,n),effective:Pr(e.length,n)}},Ig=(e,t,n,i)=>e.slice(0,i).reduce((o,s,a)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[a]??0),0),Pg=(e,t,n,i)=>e.slice(0,i+1).reduce((o,s,a)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[a]??0),0),yi=["title1","title2","title3","count"],ct=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,kg={title1:"1",title2:"2",title3:"3",count:"Count"},Rg=e=>[ct(e,"fontFamily"),ct(e,"fontSettings"),{type:"row",items:[ct(e,"fontSize"),ct(e,"lineHeight"),ct(e,"letterSpacing"),ct(e,"wordSpacing")]},ct(e,"textAlign"),ct(e,"textAppearance")],Ag=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(yi.map(e=>[kg[e],Rg(e)]))}),Mg={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},_g={title1:.02,title2:.02,title3:.02,count:.017},yo=(e,t)=>{const n=i=>{const o=ct(t,i);return e[o]};return{fontFamily:n("fontFamily")??"Arial",fontSettings:n("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:n("fontSize"),lineHeight:n("lineHeight"),letterSpacing:n("letterSpacing")??0,wordSpacing:n("wordSpacing")??0,textAlign:n("textAlign")??"left",textAppearance:n("textAppearance"),color:e[Mg[t]]}},vo=(e,t,n)=>{var o,s;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((s=t.fontSettings)==null?void 0:s.fontStyle)??"normal"},fontSize:t.fontSize??_g[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return At(i,n)},Fg=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,initialSlideIndex:a=0,enableUrlSync:u=!1,journalItemId:c=null,onBeforeClose:m,onClose:p})=>{const{type:b,coverFit:w,backgroundColor:S,imageGap:g,maxWidth:v,maxHeight:T,textTransition:$,title1Width:C,title2Width:L,title3Width:A,title1MarginLeft:k=0,title2MarginLeft:F=0,title3MarginLeft:I=0,titleRowMarginBottom:E=0,titleHeaderLayout:J="single-row",countCloseGap:y=0,closeIcon:_,closeIconMaxWidth:W,closeIconColor:G,closeIconHoverColor:te,contentMarginTop:ue=0,iconMarginRight:X=0}=n,H=l.useCallback(M=>P.scalingValue(M,i??!1),[i]),Q=H(g??0),z=`${v}%`,B=`${T}%`,Y=H(y),oe=H(ue),ie=H(X),O=vo("title1",yo(n,"title1"),i),ce=vo("title2",yo(n,"title2"),i),f=vo("title3",yo(n,"title3"),i),de=vo("count",yo(n,"count"),i),be=J==="mobile",fe=!i||!!s,Re=!o&&(!i||!!s),Z=l.useMemo(()=>Lo(t,b),[t,b]),[ge,U]=l.useState(a),V=Z[ge],j=V==null?void 0:V.entry,[he,re]=l.useState(!1),[Ce,Se]=l.useState(null),[we,Ie]=l.useState(!1),[N,ee]=l.useState(null),[R,K]=l.useState(!1),[D,ae]=l.useState(0),[ne,ye]=l.useState(),[ke,Te]=l.useState(),[xe,qe]=l.useState(null),se=l.useRef(null),Ae=l.useRef(0),Ne=l.useRef(0),He=l.useRef(0),dt=l.useRef(!1),ft=l.useRef(null),It=l.useRef(null),xt=l.useRef(null),wt=l.useRef(null),Ht=l.useRef(null),Lt=l.useRef(null),Xe=l.useRef(null),Me=l.useCallback(()=>{const M=It.current;if(!M)return;const me=M.closest(`.${e}-lightbox-content-area`);if(!me)return M.getBoundingClientRect().width;const d=Array.from(me.children).reduce((h,x)=>!(x instanceof HTMLElement)||x.contains(M)?h:h+x.getBoundingClientRect().width,0);return me.getBoundingClientRect().width-d},[e]),Ve=l.useCallback(()=>{se.current&&(clearTimeout(se.current),se.current=null)},[]),Ye=l.useCallback(M=>{M===Ae.current&&(ee(null),K(!1))},[]),Be=l.useCallback(()=>{o||dt.current||(dt.current=!0,m==null||m(),re(!1),ft.current=setTimeout(()=>{p()},300))},[o,m,p]),ut=l.useCallback(M=>!!(M.closest("[data-controls]")||M.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:Pt,backdropStyle:Qe,mediaAreaStyle:Mt,overlayContentStyle:Ot,swipeHandlers:je,dismissAreaStyle:gt}=nl({enabled:Re,onClose:Be,animMs:300,isBlockedTarget:ut}),it=l.useCallback(M=>{u&&rl(M+1,c,!0)},[u,c]),Ze=l.useCallback(M=>{if(M)return M.getBoundingClientRect().height},[]),rt=l.useCallback(M=>{if(Z.length===0)return;const me=(M%Z.length+Z.length)%Z.length;if(me===ge)return;const d=Z[ge],h=Z[me];Ae.current+=1;const x=Ae.current,q=$==="fade"&&as(d==null?void 0:d.entry)!==as(h==null?void 0:h.entry),le=Ze(xt.current),$e=q?(()=>{const Ue=Me();ji.flushSync(()=>{qe(h.entry)}),xt.current&&Ue&&(xt.current.style.width=`${Ue}px`);const Rt=Ze(xt.current);return xt.current&&(xt.current.style.width=""),{measuredIncomingTitlesHeight:Rt,incomingTitlesMeasureWidth:Ue}})():void 0,Fe=Math.max(le??0,($e==null?void 0:$e.measuredIncomingTitlesHeight)??0)||void 0;ae(x),ee(ge),K(!0),U(me),it(me),He.current=me,q?(Ve(),Fe&&ye(Fe),$e!=null&&$e.incomingTitlesMeasureWidth&&Te($e.incomingTitlesMeasureWidth),Se((d==null?void 0:d.entryIndex)??null),Ie(!0),Ne.current=h.entryIndex,se.current=setTimeout(()=>{Se(null),Ie(!1),ye(void 0),Te(void 0),qe(null),se.current=null},400)):(Ve(),Se(null),Ie(!1),ye(void 0),Te(void 0),qe(null),Ne.current=h.entryIndex)},[ge,Ve,Me,Ze,Z,it,$]),at=l.useCallback(()=>{Xe.current=null},[]),sn=l.useCallback(M=>{!fe||Z.length<=1||M.pointerType==="mouse"&&M.button!==0||M.target.closest("[data-controls]")||(Xe.current={startX:M.clientX,startY:M.clientY,pointerId:M.pointerId})},[fe,Z.length]),wn=l.useCallback(M=>{var Ue;if(!fe||Z.length<=1||M.pointerType==="mouse"&&M.button!==0)return;if(Pt){at();return}const me=Xe.current;if(!me||me.pointerId!==M.pointerId||(at(),M.target.closest("[data-controls]")))return;const h=M.clientX-me.startX,x=M.clientY-me.startY,q=Math.abs(h),le=Math.abs(x);if(q>=bg&&q>le){rt(h>0?ge-1:ge+1);return}if(q>ns||le>ns)return;const $e=(Ue=wt.current)==null?void 0:Ue.getBoundingClientRect(),Fe=$e?$e.left+$e.width/2:window.innerWidth/2;rt(M.clientX<Fe?ge-1:ge+1)},[ge,fe,rt,Pt,at,Z.length]),ln=l.useCallback(M=>{const me=Xe.current;(me==null?void 0:me.pointerId)===M.pointerId&&at()},[at]);il(),l.useEffect(()=>{Lt.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const M=requestAnimationFrame(()=>{re(!0),requestAnimationFrame(()=>{Ht.current?Ht.current.focus():wt.current&&wt.current.focus()})});return()=>{cancelAnimationFrame(M),ft.current&&clearTimeout(ft.current),se.current&&clearTimeout(se.current);const me=Lt.current;me&&document.contains(me)&&me.focus()}},[]),l.useEffect(()=>{var M;$!=="fade"&&(Ne.current=((M=Z[ge])==null?void 0:M.entryIndex)??0,Ve(),Se(null),Ie(!1),ye(void 0),Te(void 0))},[ge,Ve,Z,$]),l.useEffect(()=>{const M=me=>{if(me.key==="Escape"){Be();return}if(me.key==="ArrowLeft"&&Z.length>1){rt(ge-1);return}if(me.key==="ArrowRight"&&Z.length>1){rt(ge+1);return}if(me.key==="Tab"&&wt.current){const d=wt.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),h=Array.from(d).filter($e=>!$e.closest('[aria-hidden="true"]'));if(h.length===0)return;const x=h[0],q=h[h.length-1],le=document.activeElement;me.shiftKey?(le===x||!wt.current.contains(le))&&(me.preventDefault(),q.focus()):(le===q||!wt.current.contains(le))&&(me.preventDefault(),x.focus())}};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[rt,Be,ge,Z.length]),l.useLayoutEffect(()=>{Ve(),Ae.current=0,ae(0),ee(null),K(!1),Se(null),Ie(!1),ye(void 0),Te(void 0),qe(null),U(M=>{const me=Math.max(0,Z.length-1);return Math.min(M,me)})},[Ve,t.length,b,Z.length]),l.useLayoutEffect(()=>{var d;const M=Math.max(0,Z.length-1),me=Math.min(Math.max(0,a),M);He.current=me,Ne.current=((d=Z[me])==null?void 0:d.entryIndex)??0,U(me)},[a]);const ot=Ce!==null?t[Ce]:null,tn=N!==null?Z[N]:null,Ut=(j==null?void 0:j.title1)||(j==null?void 0:j.title2)||(j==null?void 0:j.title3)||(ot==null?void 0:ot.title1)||(ot==null?void 0:ot.title2)||(ot==null?void 0:ot.title3),Ke=Eg(b,Z,t),yt=_!==null,vt=Ut||Ke||yt,pe=Ke&&yt?{gap:Y}:void 0,Le=`${e}-titles-stack${be?` ${e}-titles-stack-stacked`:""}`,_e=`${e}-titles-layer-out${be?` ${e}-titles-layer-out-stacked`:""}`,We=`${e}-titles-layer-out`,tt=(k??0)>0||o,$t=H(E),Ee=l.useMemo(()=>({title1Width:C??yr.title1Width,title2Width:L??yr.title2Width,title3Width:A??yr.title3Width}),[C,L,A]),et=l.useMemo(()=>({title2MarginLeft:F,title3MarginLeft:I}),[F,I]),De=l.useMemo(()=>j?ho(e,j,O,ce,f):[],[e,j,O,ce,f]),st=l.useMemo(()=>De.map(M=>Ee[M.widthKey]),[De,Ee]),pt=l.useMemo(()=>Mo(De.length,st),[De.length,st]),kt=l.useMemo(()=>Pr(De.length,st),[De.length,st]),Ge=l.useMemo(()=>De.filter(M=>M.prefix==="title1"),[De]),nt=l.useMemo(()=>De.filter(M=>M.prefix==="title2"||M.prefix==="title3"),[De]),Et=l.useMemo(()=>fo(Ge,Ee),[Ge,Ee]),St=l.useMemo(()=>fo(nt,Ee),[nt,Ee]),_t=l.useCallback((M,me)=>{const d=De.findIndex(x=>x.prefix===M.prefix);if(!be||me==="single-row")return{effectiveWidth:kt[d]??0,resolvedWidth:pt[d]??0,maxWidth:Vn(d,pt)};if(me==="two-row-top"){const x=Ge.findIndex(q=>q.prefix===M.prefix);return{effectiveWidth:Et.effective[x]??0,resolvedWidth:Et.resolved[x]??0,maxWidth:Vn(x,Et.resolved)}}const h=nt.findIndex(x=>x.prefix===M.prefix);return{effectiveWidth:St.effective[h]??0,resolvedWidth:St.resolved[h]??0,maxWidth:Vn(h,St.resolved)}},[De,nt,St,kt,pt,Ge,Et,be]),$n=l.useCallback(M=>Pg(De,pt,et,M)+(be?0:k??0),[De,pt,et,be,k]),ht=l.useCallback(()=>be?0:k??0,[be,k]),Bt=l.useCallback(M=>nt.slice(0,M).reduce((me,d,h)=>me+(d.marginLeftKey?et[d.marginLeftKey]??0:0)+(St.resolved[h]??0),0),[nt,St.resolved,et]),Wt=l.useCallback(M=>{const me=nt[M];return Bt(M)+(me.marginLeftKey?et[me.marginLeftKey]??0:0)+(St.resolved[M]??0)},[nt,St.resolved,Bt,et]),cn=l.useCallback((M,me,d)=>{if(!be||d==="single-row"){const $e=M.findIndex(Ct=>Ct.prefix===me.prefix),Fe=M.map(Ct=>Ee[Ct.widthKey]),Ue=Mo(M.length,Fe);return{effectiveWidth:Pr(M.length,Fe)[$e]??0,resolvedWidth:Ue[$e]??0,maxWidth:Vn($e,Ue)}}if(d==="two-row-top"){const $e=M.filter(Ct=>Ct.prefix==="title1"),Fe=$e.findIndex(Ct=>Ct.prefix===me.prefix),{resolved:Ue,effective:Rt}=fo($e,Ee);return{effectiveWidth:Rt[Fe]??0,resolvedWidth:Ue[Fe]??0,maxWidth:Vn(Fe,Ue)}}const h=M.filter($e=>$e.prefix==="title2"||$e.prefix==="title3"),x=h.findIndex($e=>$e.prefix===me.prefix),{resolved:q,effective:le}=fo(h,Ee);return{effectiveWidth:le[x]??0,resolvedWidth:q[x]??0,maxWidth:Vn(x,q)}},[Ee,be]),Sn=(M,me,d)=>{const h=M.marginLeftKey?et[M.marginLeftKey]??0:0,{effectiveWidth:x,resolvedWidth:q,maxWidth:le}=d??_t(M,me),$e=Math.max(h,go),Fe=o&&me==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":M.prefix,style:{width:H(x),...h>0?{marginLeft:H(h)}:{}},children:[r.jsx("p",{className:M.className,style:M.style,children:M.text}),Fe&&M.marginLeftKey?r.jsx("div",{"data-controls":M.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(q),style:{position:"absolute",top:0,left:H(-h),width:H($e),height:"100%",pointerEvents:"auto"}}):null,Fe?r.jsx("div",{"data-controls":M.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(le),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:H(-ti/2),width:H(ti),height:"100%",pointerEvents:"auto"}}):null]},M.className)},dn=(M="two-row")=>{const me=De.findIndex(x=>x.prefix==="title1"),d=me>=0?pt[me]:Ee.title1Width,h=M==="two-row"&&o;return r.jsx("div",{...h?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(d)}:{},style:{width:H(k??0),flexShrink:0,alignSelf:"stretch",...h?{pointerEvents:"auto"}:{}}})},zt=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:O,"aria-hidden":"true",children:" "}),Cn=()=>r.jsx("span",{className:`${e}-entry-counter`,style:de,"aria-live":"polite","aria-atomic":"true",children:Lg(Z,ge,b,t)}),Xn=()=>Ke?o&&yt?r.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Cn(),r.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${fr(Y)} + ${Y}))`,width:fr(Y),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Cn():null,Yn=()=>!Ke&&!yt?null:r.jsxs("div",{className:`${e}-titles-row-header-controls`,style:pe,children:[Xn(),yt?Xt():null]}),$i=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Ke||Ut?zt():null,tt?dn("single-row"):null,Yt(j),r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),Yn(),nn()]}),Yo=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Ke||Ut?zt():null,tt?dn("single-row"):null,r.jsxs("div",{className:`${e}-titles-row-titles`,style:we&&ne?{minHeight:ne}:void 0,children:[r.jsx("div",{ref:xt,className:Le,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Wn(xe||j)}),r.jsxs("div",{ref:It,className:Le,style:{position:we?"absolute":"relative",inset:we?0:void 0,width:"100%",...we&&ke?{width:ke,maxWidth:"100%"}:void 0},children:[ot&&we?r.jsx("div",{className:`${_e} ${e}-titles-fade-out`,children:Wn(ot)}):null,r.jsx("div",{className:`${e}-titles-layer-in${we?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:Wn(j)})]})]}),Yn(),nn()]}),Xt=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:P.scalingValue(W??0,i),height:P.scalingValue(W??0,i),marginRight:ie,"--close-icon-hover-color":te},children:[r.jsx("button",{ref:Ht,type:"button",className:`${e}-close-icon-inner`,onClick:Be,"aria-label":"Close",children:r.jsx(Qt,{url:_??"",fill:G,hoverFill:i&&!s?G:te,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:ie,height:"100%",pointerEvents:"auto"}})]}),Yi=(M,me)=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[Ke||Ut?zt():null,tt?dn("two-row"):null,me!==void 0?r.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:me},children:M}):r.jsxs(r.Fragment,{children:[M,r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),Yn()]}),Yt=M=>{if(!M)return null;const me=ho(e,M,O,ce,f);return r.jsx(r.Fragment,{children:me.map(d=>Sn(d,"single-row",cn(me,d,"single-row")))})},un=M=>{if(!M)return null;const me=ho(e,M,O,ce,f),d=me.find(h=>h.prefix==="title1");return d?Sn(d,"two-row-top",cn(me,d,"two-row-top")):null},Tn=(M,me=!1)=>{const d=M?ho(e,M,O,ce,f):[],h=d.filter(le=>le.prefix==="title2"||le.prefix==="title3"),x=o&&me;return h.length>0||x||(E??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[h.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[h.map(le=>Sn(le,"two-row-bottom",cn(d,le,"two-row-bottom"))),me&&o?r.jsxs(r.Fragment,{children:[Jo(),Zo()]}):null]}):null,(E??0)>0||x?r.jsx("div",{"data-controls":x?"titleRowMarginBottom":void 0,"data-controls-axis":x?"y":void 0,"data-controls-reverse":x?"":void 0,className:x?`${e}-control`:void 0,style:{height:$t,width:"100%",flexShrink:0,pointerEvents:x?"auto":"none"}}):null]}):null},Fn=(M,me=!1)=>r.jsxs(r.Fragment,{children:[Yi(un(M)),Tn(M,me)]}),Wn=M=>be?r.jsx("div",{className:`${e}-titles-row-two-row`,children:Fn(M)}):M?r.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:Yt(M)}):null,Ji=()=>{const M=be?-1:De.findIndex(h=>h.prefix==="title1"),me=!be&&(o||(k??0)>0)?(()=>{const h=k??0,x=M>=0?pt[M]:Ee.title1Width,q=Math.max(h,go);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(x),style:{position:"absolute",top:0,left:0,width:H(q),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,d=De.flatMap((h,x)=>{if(!h.marginLeftKey)return[];const q=et[h.marginLeftKey]??0,le=Ig(De,pt,et,x)+ht(),$e=Math.max(q,go);return r.jsx("div",{"data-controls":h.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(pt[x]),style:{position:"absolute",top:0,left:H(le),width:H($e),height:"100%",pointerEvents:"auto"}},h.marginLeftKey)});return me?[me,...d]:d},Zi=()=>De.map((M,me)=>{const d=Vn(me,pt),x=$n(me)-ti/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":M.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(d),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:H(x),width:H(ti),height:"100%",pointerEvents:"auto"}})},`${M.widthKey}-junction`)}),Jo=()=>nt.flatMap((M,me)=>{if(!M.marginLeftKey)return[];const d=et[M.marginLeftKey]??0,h=Bt(me),x=Math.max(d,go),{resolvedWidth:q}=_t(M,"two-row-bottom");return r.jsx("div",{"data-controls":M.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(q),style:{position:"absolute",top:0,left:H(h),width:H(x),height:"100%",pointerEvents:"auto"}},M.marginLeftKey)}),Zo=()=>nt.map((M,me)=>{const{maxWidth:d}=_t(M,"two-row-bottom"),x=Wt(me)-ti/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":M.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(d),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:H(x),width:H(ti),height:"100%",pointerEvents:"auto"}})},`${M.widthKey}-junction`)}),nn=()=>!o||be?null:r.jsxs(r.Fragment,{children:[Ji(),Zi()]}),Jn=M=>{const me=!M.objectFit&&vn(w);return{className:`${e}-slide-image-cell${me?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:z,maxHeight:B,...me?{"--image-aspect-ratio":Go(w)}:{}}}},Qi=M=>M.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":M.objectFit}}:vn(w)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},Nn=M=>{if(M.length===0)return null;const me=M.length>1,d=fr(Q),h=`calc(-0.5 * (${d} + ${Q}))`;if(M.length===1){const x=M[0];return r.jsx("div",{...Jn(x),children:r.jsx("img",{...Qi(x),src:x.url,alt:x.name??"",draggable:!1})})}return r.jsx("div",{className:`${e}-slide-inner`,style:me?{gap:Q}:void 0,children:M.map((x,q)=>r.jsxs("div",{...Jn(x),children:[r.jsx("img",{...Qi(x),src:x.url,alt:x.name??"",draggable:!1}),o&&me&&q<M.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:h,width:d,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${x.url}-${q}`))})},eo=!!(j!=null&&j.title2||j!=null&&j.title3||ot!=null&&ot.title2||ot!=null&&ot.title3||(E??0)>0||o),Qo=()=>r.jsxs("div",{style:{position:"relative",width:"100%",flex:1,alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,height:"100%"},children:[r.jsx("div",{ref:xt,className:Le,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Fn(xe||j)}),r.jsxs("div",{ref:It,className:`${e}-titles-row-two-row`,style:{...we&&ne?{minHeight:ne}:void 0,...we&&ke?{width:ke,maxWidth:"100%"}:void 0},children:[Yi(r.jsxs("div",{className:Le,style:{position:we?"absolute":"relative",inset:we?0:void 0,width:"100%"},children:[ot&&we?r.jsx("div",{className:`${We} ${e}-titles-fade-out`,children:un(ot)}):null,r.jsx("div",{className:`${e}-titles-layer-in${we?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:un(j)})]}),we&&ne?ne:void 0),eo?r.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[ot&&we?r.jsx("div",{className:`${_e} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:Tn(ot)}):null,r.jsx("div",{className:`${e}-titles-layer-in${we?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${be?` ${e}-titles-layer-in-stacked`:""}`,children:Tn(j,!0)})]}):null]})]}),er=()=>{const M=eo;return r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...M?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:M?void 0:{flex:"0 0 auto",height:"auto"},children:Fn(j,!0)}),nn()]})};return r.jsxs("div",{ref:wt,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{Pt||Be()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:yt?void 0:-1,style:{opacity:he?1:0,transition:"opacity 300ms ease",pointerEvents:he?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:S,...Qe}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:gt,...je,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:Mt,onClick:M=>M.stopPropagation(),children:r.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":fe&&Z.length>1?"true":"false",onPointerDown:fe?sn:void 0,onPointerUp:fe?wn:void 0,onPointerCancel:fe?ln:void 0,children:r.jsxs("div",{className:`${e}-slide-stack`,children:[tn&&R?r.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:M=>{M.target===M.currentTarget&&Ye(D)},children:r.jsx("div",{className:`${e}-slide-area`,children:Nn(tn.images)})},`slide-out-${D}`):null,r.jsx("div",{className:`${e}-slide-layer-in${R?` ${e}-slide-fade-in`:""}`,children:r.jsx("div",{className:`${e}-slide-area`,children:V?Nn(V.images):null})},`slide-in-${D}-${ge}`)]})})}),r.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Ot,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:oe,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...be?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${be?` ${e}-lightbox-content-area-stacked`:""}`,children:vt&&r.jsx("div",{className:`${e}-text-bar-cell${be?` ${e}-text-bar-cell-stacked`:""}`,style:be?void 0:{flex:1,minWidth:0,width:"100%"},children:be?$==="fade"?Qo():er():$==="fade"?Yo():$i()})})})]})]})]})};function Wg(e){return`
11097
11097
  .${e}-wrapper {
11098
11098
  position: relative;
11099
11099
  width: 100%;
@@ -12505,7 +12505,7 @@ export type LightboxJournalSettings = {
12505
12505
  display: block;
12506
12506
  pointer-events: none;
12507
12507
  }
12508
- `}function Xg(e){return e==="blur"?Gg:e==="greyscale"?Kg:0}function Ci(e,t=1){const n=Xg(e)*Math.max(0,Math.min(1,t));return e==="greyscale"?`grayscale(${n}%)`:e==="blur"?`blur(${n/4}px)`:"none"}function ls(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function Yg(e,t){return t<=1?0:(e-1+t)%t}function Jg(e,t=1){return!e||e.height===0?t:e.width/e.height}function Zg(e,t,n,i,o){if(e<=0||t<=0)return{widthPercent:i,heightPercent:o};const s=e*i/100,a=t*o/100;let u=s,c=u/n;return c>a&&(c=a,u=c*n),{widthPercent:u/e*100,heightPercent:c/t*100}}function cs(e,t,n){if(e<=0||t<=0)return 1;const i=e*n.widthPercent/100,o=t*n.heightPercent/100;return i<=0||o<=0?1:Math.max(e/i,t/o)}function ll(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function ds(e,t,n){return{...ll(e),[`--${n}-stage-scale`]:t}}function Qg(e,t){[...new Set(e.filter(Boolean))].forEach(i=>{const o=new Image;o.onload=()=>{o.naturalWidth>0&&o.naturalHeight>0&&t(i,{width:o.naturalWidth,height:o.naturalHeight})},o.src=i})}function eh({settings:e,content:t,isEditor:n,isPreviewMode:i}){var Ie,N,ee,R,K,D,ae;const{prefix:o}=P.useScopedStyles(),s=l.useMemo(()=>Ug(o),[o]),{imageSize:a,maxWidth:u,maxHeight:c,transition:m=1e3,bgImage:p="greyscale"}=e,b=t??[],w=ls(b.length),[S,g]=l.useState(w.activeIndex),[v,T]=l.useState(w.backgroundIndex),[$,C]=l.useState(!1),[L,A]=l.useState(!1),[k,F]=l.useState(null),[I,E]=l.useState(null),[J,y]=l.useState(0),[_,W]=l.useState(1),[G,te]=l.useState("none"),[ue,X]=l.useState("next"),[H,Q]=l.useState({}),[z,B]=l.useState({width:0,height:0}),Y=l.useRef(null),oe=l.useRef(null),ie=!n||!!i,O=a??60,ce=Math.max(10,Math.min(100,u??O)),f=Math.max(10,Math.min(100,c??O)),de=Math.max(100,m),be=Ci(p),fe=l.useCallback(ne=>{const ye=Jg(ne?H[ne]:void 0);return Zg(z.width,z.height,ye,ce,f)},[z.height,z.width,H,f,ce]);l.useEffect(()=>{const ne=oe.current;if(!ne)return;const ye=new ResizeObserver(([ke])=>{const{width:Te,height:xe}=ke.contentRect;B({width:Te,height:xe})});return ye.observe(ne),()=>ye.disconnect()},[]),l.useEffect(()=>{const ne=(t??[]).map(ye=>{var ke;return(ke=ye.image)==null?void 0:ke.url}).filter(ye=>!!ye);Qg(ne,(ye,ke)=>{Q(Te=>{var xe,Ke;return((xe=Te[ye])==null?void 0:xe.width)===ke.width&&((Ke=Te[ye])==null?void 0:Ke.height)===ke.height?Te:{...Te,[ye]:ke}})})},[t]),l.useEffect(()=>{const{backgroundIndex:ne,activeIndex:ye}=ls(b.length);g(ye),T(ne),C(!1),A(!1),F(null),E(null),y(0),W(1),te("none"),X("next")},[b.length,t]),l.useEffect(()=>()=>{Y.current&&clearTimeout(Y.current)},[]);const Re=l.useCallback(ne=>{var se,Ae,Ne,He;if(!ie||$||b.length<=1)return;const ye=ne==="next"?(S+1)%b.length:(S-1+b.length)%b.length,ke=fe((Ae=(se=b[S])==null?void 0:se.image)==null?void 0:Ae.url),Te=fe((He=(Ne=b[ye])==null?void 0:Ne.image)==null?void 0:He.url),xe=cs(z.width,z.height,ke),Ke=cs(z.width,z.height,Te);Y.current&&clearTimeout(Y.current),X(ne),A(!0),C(!0),ne==="next"?(F(S),E(ye),y(0),W(1),te(Ci(p,0))):(T(Yg(ye,b.length)),F(ye),E(S),y(1),W(Ke),te(Ci(p,1))),requestAnimationFrame(()=>{A(!1),requestAnimationFrame(()=>{ne==="next"?(y(1),W(xe),te(Ci(p,1))):(y(0),W(1),te(Ci(p,0)))})}),Y.current=setTimeout(()=>{ne==="next"&&T(S),g(ye),F(null),E(null),C(!1)},de)},[S,p,z.height,z.width,fe,$,ie,b,de]),Z=b[S],ge=v!==null?b[v]:null,U=k!==null?b[k]:null,V=I!==null?b[I]:null,j=b.length<=1?0:(S-1+b.length)%b.length,he=b.length<=1?0:(S+1)%b.length,re=fe((Ie=Z==null?void 0:Z.image)==null?void 0:Ie.url),Ce=fe((N=U==null?void 0:U.image)==null?void 0:N.url),Se=fe((ee=V==null?void 0:V.image)==null?void 0:ee.url),we={[`--${o}-transition-ms`]:`${de}ms`};return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:s}}),r.jsxs("div",{ref:oe,className:ze(`${o}-wrapper`,L&&`${o}-snap`,n&&!i&&`${o}-editor`),style:we,"aria-label":"Zoom gallery",children:[((R=ge==null?void 0:ge.image)==null?void 0:R.url)&&r.jsx("div",{className:`${o}-background`,"aria-hidden":"true",children:r.jsx("img",{className:`${o}-effect-image`,src:ge.image.url,alt:"",style:{filter:be}})}),$&&((K=U==null?void 0:U.image)==null?void 0:K.url)&&r.jsx("div",{className:ze(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${ue}`),style:ds(Ce,_,o),"aria-hidden":"true",children:r.jsx("img",{className:`${o}-effect-image`,src:U.image.url,alt:"",style:{filter:G}})}),$&&((D=V==null?void 0:V.image)==null?void 0:D.url)&&r.jsx("div",{className:ze(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${ue}`),style:ds(Se,J,o),"aria-hidden":"true",children:r.jsx("img",{className:`${o}-image`,src:V.image.url,alt:""})}),!$&&((ae=Z==null?void 0:Z.image)==null?void 0:ae.url)&&r.jsx("div",{className:ze(`${o}-stage`,`${o}-foreground`),style:ll(re),children:r.jsx("img",{className:`${o}-image`,src:Z.image.url,alt:Z.image.name??""})}),ie&&b.length>1&&!$&&r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:ze(`${o}-nav`,`${o}-nav-prev`),onClick:()=>Re("prev"),"aria-label":`Show previous image (${j+1} of ${b.length})`}),r.jsx("button",{type:"button",className:ze(`${o}-nav`,`${o}-nav-next`),onClick:()=>Re("next"),"aria-label":`Show next image (${he+1} of ${b.length})`})]})]})]})}const th=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
12508
+ `}function Xg(e){return e==="blur"?Gg:e==="greyscale"?Kg:0}function Ci(e,t=1,n=1){const i=Xg(e)*Math.max(0,Math.min(1,t));if(e==="greyscale")return`grayscale(${i}%)`;if(e==="blur"){const o=i/4;return o<=0?"none":`blur(${o/Math.max(n,1)}px)`}return"none"}function ls(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function Yg(e,t){return t<=1?0:(e-1+t)%t}function Jg(e,t=1){return!e||e.height===0?t:e.width/e.height}function Zg(e,t,n,i,o){if(e<=0||t<=0)return{widthPercent:i,heightPercent:o};const s=e*i/100,a=t*o/100;let u=s,c=u/n;return c>a&&(c=a,u=c*n),{widthPercent:u/e*100,heightPercent:c/t*100}}function cs(e,t,n){if(e<=0||t<=0)return 1;const i=e*n.widthPercent/100,o=t*n.heightPercent/100;return i<=0||o<=0?1:Math.max(e/i,t/o)}function ll(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function ds(e,t,n){return{...ll(e),[`--${n}-stage-scale`]:t}}function Qg(e,t){[...new Set(e.filter(Boolean))].forEach(i=>{const o=new Image;o.onload=()=>{o.naturalWidth>0&&o.naturalHeight>0&&t(i,{width:o.naturalWidth,height:o.naturalHeight})},o.src=i})}function eh({settings:e,content:t,isEditor:n,isPreviewMode:i}){var Ie,N,ee,R,K,D,ae;const{prefix:o}=P.useScopedStyles(),s=l.useMemo(()=>Ug(o),[o]),{imageSize:a,maxWidth:u,maxHeight:c,transition:m=1e3,bgImage:p="greyscale"}=e,b=t??[],w=ls(b.length),[S,g]=l.useState(w.activeIndex),[v,T]=l.useState(w.backgroundIndex),[$,C]=l.useState(!1),[L,A]=l.useState(!1),[k,F]=l.useState(null),[I,E]=l.useState(null),[J,y]=l.useState(0),[_,W]=l.useState(1),[G,te]=l.useState("none"),[ue,X]=l.useState("next"),[H,Q]=l.useState({}),[z,B]=l.useState({width:0,height:0}),Y=l.useRef(null),oe=l.useRef(null),ie=!n||!!i,O=a??60,ce=Math.max(10,Math.min(100,u??O)),f=Math.max(10,Math.min(100,c??O)),de=Math.max(100,m),be=Ci(p),fe=l.useCallback(ne=>{const ye=Jg(ne?H[ne]:void 0);return Zg(z.width,z.height,ye,ce,f)},[z.height,z.width,H,f,ce]);l.useEffect(()=>{const ne=oe.current;if(!ne)return;const ye=new ResizeObserver(([ke])=>{const{width:Te,height:xe}=ke.contentRect;B({width:Te,height:xe})});return ye.observe(ne),()=>ye.disconnect()},[]),l.useEffect(()=>{const ne=(t??[]).map(ye=>{var ke;return(ke=ye.image)==null?void 0:ke.url}).filter(ye=>!!ye);Qg(ne,(ye,ke)=>{Q(Te=>{var xe,qe;return((xe=Te[ye])==null?void 0:xe.width)===ke.width&&((qe=Te[ye])==null?void 0:qe.height)===ke.height?Te:{...Te,[ye]:ke}})})},[t]),l.useEffect(()=>{const{backgroundIndex:ne,activeIndex:ye}=ls(b.length);g(ye),T(ne),C(!1),A(!1),F(null),E(null),y(0),W(1),te("none"),X("next")},[b.length,t]),l.useEffect(()=>()=>{Y.current&&clearTimeout(Y.current)},[]);const Re=l.useCallback(ne=>{var se,Ae,Ne,He;if(!ie||$||b.length<=1)return;const ye=ne==="next"?(S+1)%b.length:(S-1+b.length)%b.length,ke=fe((Ae=(se=b[S])==null?void 0:se.image)==null?void 0:Ae.url),Te=fe((He=(Ne=b[ye])==null?void 0:Ne.image)==null?void 0:He.url),xe=cs(z.width,z.height,ke),qe=cs(z.width,z.height,Te);Y.current&&clearTimeout(Y.current),X(ne),A(!0),C(!0),ne==="next"?(F(S),E(ye),y(0),W(1),te(Ci(p,0,1))):(T(Yg(ye,b.length)),F(ye),E(S),y(1),W(qe),te(Ci(p,1,qe))),requestAnimationFrame(()=>{A(!1),requestAnimationFrame(()=>{ne==="next"?(y(1),W(xe),te(Ci(p,1,xe))):(y(0),W(1),te(Ci(p,0,1)))})}),Y.current=setTimeout(()=>{ne==="next"&&T(S),g(ye),F(null),E(null),C(!1)},de)},[S,p,z.height,z.width,fe,$,ie,b,de]),Z=b[S],ge=v!==null?b[v]:null,U=k!==null?b[k]:null,V=I!==null?b[I]:null,j=b.length<=1?0:(S-1+b.length)%b.length,he=b.length<=1?0:(S+1)%b.length,re=fe((Ie=Z==null?void 0:Z.image)==null?void 0:Ie.url),Ce=fe((N=U==null?void 0:U.image)==null?void 0:N.url),Se=fe((ee=V==null?void 0:V.image)==null?void 0:ee.url),we={[`--${o}-transition-ms`]:`${de}ms`};return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:s}}),r.jsxs("div",{ref:oe,className:ze(`${o}-wrapper`,L&&`${o}-snap`,n&&!i&&`${o}-editor`),style:we,"aria-label":"Zoom gallery",children:[((R=ge==null?void 0:ge.image)==null?void 0:R.url)&&r.jsx("div",{className:`${o}-background`,"aria-hidden":"true",children:r.jsx("img",{className:`${o}-effect-image`,src:ge.image.url,alt:"",style:{filter:be}})}),$&&((K=U==null?void 0:U.image)==null?void 0:K.url)&&r.jsx("div",{className:ze(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${ue}`),style:ds(Ce,_,o),"aria-hidden":"true",children:r.jsx("img",{className:`${o}-effect-image`,src:U.image.url,alt:"",style:{filter:G}})}),$&&((D=V==null?void 0:V.image)==null?void 0:D.url)&&r.jsx("div",{className:ze(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${ue}`),style:ds(Se,J,o),"aria-hidden":"true",children:r.jsx("img",{className:`${o}-image`,src:V.image.url,alt:""})}),!$&&((ae=Z==null?void 0:Z.image)==null?void 0:ae.url)&&r.jsx("div",{className:ze(`${o}-stage`,`${o}-foreground`),style:ll(re),children:r.jsx("img",{className:`${o}-image`,src:Z.image.url,alt:Z.image.name??""})}),ie&&b.length>1&&!$&&r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:ze(`${o}-nav`,`${o}-nav-prev`),onClick:()=>Re("prev"),"aria-label":`Show previous image (${j+1} of ${b.length})`}),r.jsx("button",{type:"button",className:ze(`${o}-nav`,`${o}-nav-next`),onClick:()=>Re("next"),"aria-label":`Show next image (${he+1} of ${b.length})`})]})]})]})}const th=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
12509
12509
  import cn from 'classnames';
12510
12510
  import { CommonComponentProps } from '../props';
12511
12511
  import { useScopedStyles } from '../utils/useScopedStyles';
@@ -12665,13 +12665,14 @@ function getEffectAmount(bgImage: ZoomSettings['bgImage']): number {
12665
12665
  return 0;
12666
12666
  }
12667
12667
 
12668
- function getBackgroundFilter(bgImage: ZoomSettings['bgImage'], progress = 1): string {
12668
+ function getBackgroundFilter(bgImage: ZoomSettings['bgImage'], progress = 1, scale = 1): string {
12669
12669
  const amount = getEffectAmount(bgImage) * Math.max(0, Math.min(1, progress));
12670
12670
  if (bgImage === 'greyscale') {
12671
12671
  return \`grayscale(\${amount}%)\`;
12672
12672
  }
12673
12673
  if (bgImage === 'blur') {
12674
- return \`blur(\${amount / 4}px)\`;
12674
+ const blurPx = amount / 4;
12675
+ return blurPx <= 0 ? 'none' : \`blur(\${blurPx / Math.max(scale, 1)}px)\`;
12675
12676
  }
12676
12677
  return 'none';
12677
12678
  }
@@ -12877,14 +12878,14 @@ export function Zoom({ settings, content, isEditor, isPreviewMode }: ZoomProps)
12877
12878
  setIncomingIndex(targetIndex);
12878
12879
  setIncomingScale(0);
12879
12880
  setOutgoingScale(1);
12880
- setOutgoingFilter(getBackgroundFilter(bgImage, 0));
12881
+ setOutgoingFilter(getBackgroundFilter(bgImage, 0, 1));
12881
12882
  } else {
12882
12883
  setBackgroundIndex(getPreviousBackgroundIndex(targetIndex, items.length));
12883
12884
  setOutgoingIndex(targetIndex);
12884
12885
  setIncomingIndex(activeIndex);
12885
12886
  setIncomingScale(1);
12886
12887
  setOutgoingScale(targetCoverScale);
12887
- setOutgoingFilter(getBackgroundFilter(bgImage, 1));
12888
+ setOutgoingFilter(getBackgroundFilter(bgImage, 1, targetCoverScale));
12888
12889
  }
12889
12890
 
12890
12891
  requestAnimationFrame(() => {
@@ -12893,11 +12894,11 @@ export function Zoom({ settings, content, isEditor, isPreviewMode }: ZoomProps)
12893
12894
  if (direction === 'next') {
12894
12895
  setIncomingScale(1);
12895
12896
  setOutgoingScale(activeCoverScale);
12896
- setOutgoingFilter(getBackgroundFilter(bgImage, 1));
12897
+ setOutgoingFilter(getBackgroundFilter(bgImage, 1, activeCoverScale));
12897
12898
  } else {
12898
12899
  setIncomingScale(0);
12899
12900
  setOutgoingScale(1);
12900
- setOutgoingFilter(getBackgroundFilter(bgImage, 0));
12901
+ setOutgoingFilter(getBackgroundFilter(bgImage, 0, 1));
12901
12902
  }
12902
12903
  });
12903
12904
  });