@cntrl-site/components 1.0.60 → 1.0.61

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.
Files changed (3) hide show
  1. package/dist/index.js +29 -25
  2. package/dist/index.mjs +564 -560
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),a=require("react"),rt=require("classnames"),S=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Yn=require("react-dom");function Gc(e){return e.type==="object"&&e.version===1}const qc="ControlSlider-module__wrapper___sHEkd",Uc="ControlSlider-module__hoverArrow___A-dOH",Kc="ControlSlider-module__sliderItem___QQSkR",Xc="ControlSlider-module__sliderImage___9hRl-",Yc="ControlSlider-module__arrow___05ghY",Zc="ControlSlider-module__arrowVertical___tBfVN",Jc="ControlSlider-module__nextArrow___-30Yc",Qc="ControlSlider-module__arrowInner___aEra3",ed="ControlSlider-module__arrowIcon___S4ztF",td="ControlSlider-module__arrowImg___2dwJW",nd="ControlSlider-module__mirror___brd6U",id="ControlSlider-module__pagination___bicLF",od="ControlSlider-module__paginationInner___bT-P-",rd="ControlSlider-module__paginationVertical___zYqKw",ad="ControlSlider-module__paginationItem___nTRbk",sd="ControlSlider-module__dot___p1Qun",ld="ControlSlider-module__activeDot___LHFaj",cd="ControlSlider-module__paginationInsideBottom___R3FWn",dd="ControlSlider-module__paginationInsideTop___V-qb-",ud="ControlSlider-module__paginationOutsideBottom___14w8D",pd="ControlSlider-module__paginationOutsideTop___SCLqB",md="ControlSlider-module__paginationInsideLeft___yOBRZ",gd="ControlSlider-module__paginationInsideRight___Rtt3o",hd="ControlSlider-module__paginationOutsideLeft___lahaw",fd="ControlSlider-module__paginationOutsideRight___EtuQa",yd="ControlSlider-module__imgWrapper___UjEgB",vd="ControlSlider-module__captionBlock___dJ6-j",xd="ControlSlider-module__captionTextWrapper___HFlpf",bd="ControlSlider-module__captionText___uGBVc",wd="ControlSlider-module__active___WZK4G",Sd="ControlSlider-module__withPointerEvents___t-18M",$d="ControlSlider-module__topLeftAlignment___zjnGM",Cd="ControlSlider-module__topCenterAlignment___gD1xW",Td="ControlSlider-module__topRightAlignment___NMapS",Ld="ControlSlider-module__middleLeftAlignment___OnUrY",Rd="ControlSlider-module__middleCenterAlignment___Tdkl0",Id="ControlSlider-module__middleRightAlignment___wEbfX",Md="ControlSlider-module__bottomLeftAlignment___cTP2-",Ed="ControlSlider-module__bottomCenterAlignment___c54fB",Pd="ControlSlider-module__bottomRightAlignment___kEwrz",kd="ControlSlider-module__clickOverlay___DZA28",Ad="ControlSlider-module__contain___pLyq7",Fd="ControlSlider-module__cover___KdDat",it={wrapper:qc,hoverArrow:Uc,sliderItem:Kc,sliderImage:Xc,arrow:Yc,arrowVertical:Zc,nextArrow:Jc,arrowInner:Qc,arrowIcon:ed,arrowImg:td,mirror:nd,pagination:id,paginationInner:od,paginationVertical:rd,paginationItem:ad,dot:sd,activeDot:ld,paginationInsideBottom:cd,paginationInsideTop:dd,paginationOutsideBottom:ud,paginationOutsideTop:pd,paginationInsideLeft:md,paginationInsideRight:gd,paginationOutsideLeft:hd,paginationOutsideRight:fd,imgWrapper:yd,captionBlock:vd,captionTextWrapper:xd,captionText:bd,active:wd,withPointerEvents:Sd,topLeftAlignment:$d,topCenterAlignment:Cd,topRightAlignment:Td,middleLeftAlignment:Ld,middleCenterAlignment:Rd,middleRightAlignment:Id,bottomLeftAlignment:Md,bottomCenterAlignment:Ed,bottomRightAlignment:Pd,clickOverlay:kd,contain:Ad,cover:Fd};function Wd(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function _d(e,t,n){return t&&Wd(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var ls="(prefers-reduced-motion: reduce)",Ei=1,Nd=2,Wi=3,Ki=4,To=5,er=6,sr=7,Hd={CREATED:Ei,MOUNTED:Nd,IDLE:Wi,MOVING:Ki,SCROLLING:To,DRAGGING:er,DESTROYED:sr};function Wn(e){e.length=0}function Zn(e,t,n){return Array.prototype.slice.call(e,t,n)}function Vt(e){return e.bind.apply(e,[null].concat(Zn(arguments,1)))}var Ml=setTimeout,ma=function(){};function cs(e){return requestAnimationFrame(e)}function yr(e,t){return typeof t===e}function mo(e){return!Ma(e)&&yr("object",e)}var Ia=Array.isArray,El=Vt(yr,"function"),qn=Vt(yr,"string"),Lo=Vt(yr,"undefined");function Ma(e){return e===null}function Pl(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Ro(e){return Ia(e)?e:[e]}function yn(e,t){Ro(e).forEach(t)}function Ea(e,t){return e.indexOf(t)>-1}function tr(e,t){return e.push.apply(e,Ro(t)),e}function En(e,t,n){e&&yn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Tn(e,t){En(e,qn(t)?t.split(" "):t,!0)}function Io(e,t){yn(t,e.appendChild.bind(e))}function Pa(e,t){yn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function go(e,t){return Pl(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function kl(e,t){var n=e?Zn(e.children):[];return t?n.filter(function(i){return go(i,t)}):n}function Mo(e,t){return t?kl(e,t)[0]:e.firstElementChild}var ho=Object.keys;function mi(e,t,n){return e&&(n?ho(e).reverse():ho(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function fo(e){return Zn(arguments,1).forEach(function(t){mi(t,function(n,i){e[i]=t[i]})}),e}function zn(e){return Zn(arguments,1).forEach(function(t){mi(t,function(n,i){Ia(n)?e[i]=n.slice():mo(n)?e[i]=zn({},mo(e[i])?e[i]:{},n):e[i]=n})}),e}function ds(e,t){yn(t||ho(e),function(n){delete e[n]})}function Ln(e,t){yn(e,function(n){yn(t,function(i){n&&n.removeAttribute(i)})})}function St(e,t,n){mo(t)?mi(t,function(i,o){St(e,o,i)}):yn(e,function(i){Ma(n)||n===""?Ln(i,t):i.setAttribute(t,String(n))})}function Pi(e,t,n){var i=document.createElement(e);return t&&(qn(t)?Tn(i,t):St(i,t)),n&&Io(n,i),i}function xn(e,t,n){if(Lo(n))return getComputedStyle(e)[t];Ma(n)||(e.style[t]=""+n)}function yo(e,t){xn(e,"display",t)}function Al(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function bn(e,t){return e.getAttribute(t)}function us(e,t){return e&&e.classList.contains(t)}function mn(e){return e.getBoundingClientRect()}function hi(e){yn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Fl(e){return Mo(new DOMParser().parseFromString(e,"text/html").body)}function Mn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function Wl(e,t){return e&&e.querySelector(t)}function ka(e,t){return t?Zn(e.querySelectorAll(t)):[]}function Pn(e,t){En(e,t,!1)}function ga(e){return e.timeStamp}function ii(e){return qn(e)?e:e?e+"px":""}var Eo="splide",Aa="data-"+Eo;function lo(e,t){if(!e)throw new Error("["+Eo+"] "+(t||""))}var Un=Math.min,lr=Math.max,cr=Math.floor,vo=Math.ceil,ln=Math.abs;function _l(e,t,n){return ln(e-t)<n}function nr(e,t,n,i){var o=Un(t,n),s=lr(t,n);return i?o<e&&e<s:o<=e&&e<=s}function Li(e,t,n){var i=Un(t,n),o=lr(t,n);return Un(lr(i,e),o)}function ha(e){return+(e>0)-+(e<0)}function fa(e,t){return yn(t,function(n){e=e.replace("%s",""+n)}),e}function Fa(e){return e<10?"0"+e:""+e}var ps={};function Od(e){return""+e+Fa(ps[e]=(ps[e]||0)+1)}function Nl(){var e=[];function t(l,d,c,u){o(l,d,function(p,b,w){var f="addEventListener"in p,h=f?p.removeEventListener.bind(p,b,c,u):p.removeListener.bind(p,c);f?p.addEventListener(b,c,u):p.addListener(c),e.push([p,b,w,c,h])})}function n(l,d,c){o(l,d,function(u,p,b){e=e.filter(function(w){return w[0]===u&&w[1]===p&&w[2]===b&&(!c||w[3]===c)?(w[4](),!1):!0})})}function i(l,d,c){var u,p=!0;return typeof CustomEvent=="function"?u=new CustomEvent(d,{bubbles:p,detail:c}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(d,p,!1,c)),l.dispatchEvent(u),u}function o(l,d,c){yn(l,function(u){u&&yn(d,function(p){p.split(" ").forEach(function(b){var w=b.split(".");c(u,w[0],w[1])})})})}function s(){e.forEach(function(l){l[4]()}),Wn(e)}return{bind:t,unbind:n,dispatch:i,destroy:s}}var Jn="mounted",ya="ready",_n="move",Xi="moved",Wa="click",Hl="active",Ol="inactive",Dl="visible",jl="hidden",Qt="refresh",an="updated",_i="resize",vr="resized",zl="drag",Bl="dragging",Vl="dragged",xr="scroll",vi="scrolled",Dd="overflow",_a="destroy",Gl="arrows:mounted",ql="arrows:updated",Ul="pagination:mounted",Kl="pagination:updated",Na="navigation:mounted",Ha="autoplay:play",Xl="autoplay:playing",Oa="autoplay:pause",Da="lazyload:loaded",Yl="sk",Zl="sh",dr="ei";function Kt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=Nl();function i(s,l){n.bind(t,Ro(s).join(" "),function(d){l.apply(l,Ia(d.detail)?d.detail:[])})}function o(s){n.dispatch(t,s,Zn(arguments,1))}return e&&e.event.on(_a,n.destroy),fo(n,{bus:t,on:i,off:Vt(n.unbind,t),emit:o})}function br(e,t,n,i){var o=Date.now,s,l=0,d,c=!0,u=0;function p(){if(!c){if(l=e?Un((o()-s)/e,1):1,n&&n(l),l>=1&&(t(),s=o(),i&&++u>=i))return w();d=cs(p)}}function b(M){M||h(),s=o()-(M?l*e:0),c=!1,d=cs(p)}function w(){c=!0}function f(){s=o(),l=0,n&&n(l)}function h(){d&&cancelAnimationFrame(d),l=0,d=0,c=!0}function m(M){e=M}function v(){return c}return{start:b,rewind:f,pause:w,cancel:h,set:m,isPaused:v}}function jd(e){var t=e;function n(o){t=o}function i(o){return Ea(Ro(o),t)}return{set:n,is:i}}function zd(e,t){var n=br(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Bd(e,t,n){var i=e.state,o=n.breakpoints||{},s=n.reducedMotion||{},l=Nl(),d=[];function c(){var h=n.mediaQuery==="min";ho(o).sort(function(m,v){return h?+m-+v:+v-+m}).forEach(function(m){p(o[m],"("+(h?"min":"max")+"-width:"+m+"px)")}),p(s,ls),b()}function u(h){h&&l.destroy()}function p(h,m){var v=matchMedia(m);l.bind(v,"change",b),d.push([h,v])}function b(){var h=i.is(sr),m=n.direction,v=d.reduce(function(M,R){return zn(M,R[1].matches?R[0]:{})},{});ds(n),f(v),n.destroy?e.destroy(n.destroy==="completely"):h?(u(!0),e.mount()):m!==n.direction&&e.refresh()}function w(h){matchMedia(ls).matches&&(h?zn(n,s):ds(n,ho(s)))}function f(h,m,v){zn(n,h),m&&zn(Object.getPrototypeOf(n),h),(v||!i.is(Ei))&&e.emit(an,n)}return{setup:c,destroy:u,reduce:w,set:f}}var wr="Arrow",Sr=wr+"Left",$r=wr+"Right",Jl=wr+"Up",Ql=wr+"Down",ms="rtl",Cr="ttb",Hr={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Jl,$r],ArrowRight:[Ql,Sr]};function Vd(e,t,n){function i(s,l,d){d=d||n.direction;var c=d===ms&&!l?1:d===Cr?0:-1;return Hr[s]&&Hr[s][c]||s.replace(/width|left|right/i,function(u,p){var b=Hr[u.toLowerCase()][c]||u;return p>0?b.charAt(0).toUpperCase()+b.slice(1):b})}function o(s){return s*(n.direction===ms?1:-1)}return{resolve:i,orient:o}}var kn="role",ki="tabindex",Gd="disabled",wn="aria-",Po=wn+"controls",ec=wn+"current",gs=wn+"selected",hn=wn+"label",ja=wn+"labelledby",tc=wn+"hidden",za=wn+"orientation",xo=wn+"roledescription",hs=wn+"live",fs=wn+"busy",ys=wn+"atomic",Ba=[kn,ki,Gd,Po,ec,hn,ja,tc,za,xo],Rn=Eo+"__",Qn="is-",Or=Eo,vs=Rn+"track",qd=Rn+"list",Tr=Rn+"slide",nc=Tr+"--clone",Ud=Tr+"__container",Va=Rn+"arrows",Lr=Rn+"arrow",ic=Lr+"--prev",oc=Lr+"--next",Rr=Rn+"pagination",rc=Rr+"__page",Kd=Rn+"progress",Xd=Kd+"__bar",Yd=Rn+"toggle",Zd=Rn+"spinner",Jd=Rn+"sr",Qd=Qn+"initialized",fi=Qn+"active",ac=Qn+"prev",sc=Qn+"next",va=Qn+"visible",xa=Qn+"loading",lc=Qn+"focus-in",cc=Qn+"overflow",eu=[fi,va,ac,sc,xa,lc,cc],tu={slide:Tr,clone:nc,arrows:Va,arrow:Lr,prev:ic,next:oc,pagination:Rr,page:rc,spinner:Zd};function nu(e,t){if(El(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!go(n,t);)n=n.parentElement;return n}var iu=5,xs=200,dc="touchstart mousedown",Dr="touchmove mousemove",jr="touchend touchcancel mouseup click";function ou(e,t,n){var i=Kt(e),o=i.on,s=i.bind,l=e.root,d=n.i18n,c={},u=[],p=[],b=[],w,f,h;function m(){L(),X(),R()}function v(){o(Qt,M),o(Qt,m),o(an,R),s(document,dc+" keydown",function(P){h=P.type==="keydown"},{capture:!0}),s(l,"focusin",function(){En(l,lc,!!h)})}function M(P){var C=Ba.concat("style");Wn(u),Pn(l,p),Pn(w,b),Ln([w,f],C),Ln(l,P?C:["style",xo])}function R(){Pn(l,p),Pn(w,b),p=B(Or),b=B(vs),Tn(l,p),Tn(w,b),St(l,hn,n.label),St(l,ja,n.labelledby)}function L(){w=A("."+vs),f=Mo(w,"."+qd),lo(w&&f,"A track/list element is missing."),tr(u,kl(f,"."+Tr+":not(."+nc+")")),mi({arrows:Va,pagination:Rr,prev:ic,next:oc,bar:Xd,toggle:Yd},function(P,C){c[C]=A("."+P)}),fo(c,{root:l,track:w,list:f,slides:u})}function X(){var P=l.id||Od(Eo),C=n.role;l.id=P,w.id=w.id||P+"-track",f.id=f.id||P+"-list",!bn(l,kn)&&l.tagName!=="SECTION"&&C&&St(l,kn,C),St(l,xo,d.carousel),St(f,kn,"presentation")}function A(P){var C=Wl(l,P);return C&&nu(C,"."+Or)===l?C:void 0}function B(P){return[P+"--"+n.type,P+"--"+n.direction,n.drag&&P+"--draggable",n.isNavigation&&P+"--nav",P===Or&&fi]}return fo(c,{setup:m,mount:v,destroy:M})}var Ni="slide",Yi="loop",ko="fade";function ru(e,t,n,i){var o=Kt(e),s=o.on,l=o.emit,d=o.bind,c=e.Components,u=e.root,p=e.options,b=p.isNavigation,w=p.updateOnMove,f=p.i18n,h=p.pagination,m=p.slideFocus,v=c.Direction.resolve,M=bn(i,"style"),R=bn(i,hn),L=n>-1,X=Mo(i,"."+Ud),A;function B(){L||(i.id=u.id+"-slide"+Fa(t+1),St(i,kn,h?"tabpanel":"group"),St(i,xo,f.slide),St(i,hn,R||fa(f.slideLabel,[t+1,e.length]))),P()}function P(){d(i,"click",Vt(l,Wa,ie)),d(i,"keydown",Vt(l,Yl,ie)),s([Xi,Zl,vi],W),s(Na,j),w&&s(_n,x)}function C(){A=!0,o.destroy(),Pn(i,eu),Ln(i,Ba),St(i,"style",M),St(i,hn,R||"")}function j(){var $=e.splides.map(function(I){var D=I.splide.Components.Slides.getAt(t);return D?D.slide.id:""}).join(" ");St(i,hn,fa(f.slideX,(L?n:t)+1)),St(i,Po,$),St(i,kn,m?"button":""),m&&Ln(i,xo)}function x(){A||W()}function W(){if(!A){var $=e.index;E(),Z(),En(i,ac,t===$-1),En(i,sc,t===$+1)}}function E(){var $=U();$!==us(i,fi)&&(En(i,fi,$),St(i,ec,b&&$||""),l($?Hl:Ol,ie))}function Z(){var $=V(),I=!$&&(!U()||L);if(e.state.is([Ki,To])||St(i,tc,I||""),St(ka(i,p.focusableNodes||""),ki,I?-1:""),m&&St(i,ki,I?-1:0),$!==us(i,va)&&(En(i,va,$),l($?Dl:jl,ie)),!$&&document.activeElement===i){var D=c.Slides.getAt(e.index);D&&Al(D.slide)}}function k($,I,D){xn(D&&X||i,$,I)}function U(){var $=e.index;return $===t||p.cloneStatus&&$===n}function V(){if(e.is(ko))return U();var $=mn(c.Elements.track),I=mn(i),D=v("left",!0),se=v("right",!0);return cr($[D])<=vo(I[D])&&cr(I[se])<=vo($[se])}function G($,I){var D=ln($-t);return!L&&(p.rewind||e.is(Yi))&&(D=Un(D,e.length-D)),D<=I}var ie={index:t,slideIndex:n,slide:i,container:X,isClone:L,mount:B,destroy:C,update:W,style:k,isWithin:G};return ie}function au(e,t,n){var i=Kt(e),o=i.on,s=i.emit,l=i.bind,d=t.Elements,c=d.slides,u=d.list,p=[];function b(){w(),o(Qt,f),o(Qt,w)}function w(){c.forEach(function(W,E){m(W,E,-1)})}function f(){A(function(W){W.destroy()}),Wn(p)}function h(){A(function(W){W.update()})}function m(W,E,Z){var k=ru(e,E,Z,W);k.mount(),p.push(k),p.sort(function(U,V){return U.index-V.index})}function v(W){return W?B(function(E){return!E.isClone}):p}function M(W){var E=t.Controller,Z=E.toIndex(W),k=E.hasFocus()?1:n.perPage;return B(function(U){return nr(U.index,Z,Z+k-1)})}function R(W){return B(W)[0]}function L(W,E){yn(W,function(Z){if(qn(Z)&&(Z=Fl(Z)),Pl(Z)){var k=c[E];k?Pa(Z,k):Io(u,Z),Tn(Z,n.classes.slide),C(Z,Vt(s,_i))}}),s(Qt)}function X(W){hi(B(W).map(function(E){return E.slide})),s(Qt)}function A(W,E){v(E).forEach(W)}function B(W){return p.filter(El(W)?W:function(E){return qn(W)?go(E.slide,W):Ea(Ro(W),E.index)})}function P(W,E,Z){A(function(k){k.style(W,E,Z)})}function C(W,E){var Z=ka(W,"img"),k=Z.length;k?Z.forEach(function(U){l(U,"load error",function(){--k||E()})}):E()}function j(W){return W?c.length:p.length}function x(){return p.length>n.perPage}return{mount:b,destroy:f,update:h,register:m,get:v,getIn:M,getAt:R,add:L,remove:X,forEach:A,filter:B,style:P,getLength:j,isEnough:x}}function su(e,t,n){var i=Kt(e),o=i.on,s=i.bind,l=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,p=u.root,b=u.track,w=u.list,f=d.getAt,h=d.style,m,v,M;function R(){L(),s(window,"resize load",zd(Vt(l,_i))),o([an,Qt],L),o(_i,X)}function L(){m=n.direction===Cr,xn(p,"maxWidth",ii(n.width)),xn(b,c("paddingLeft"),A(!1)),xn(b,c("paddingRight"),A(!0)),X(!0)}function X(ie){var $=mn(p);(ie||v.width!==$.width||v.height!==$.height)&&(xn(b,"height",B()),h(c("marginRight"),ii(n.gap)),h("width",C()),h("height",j(),!0),v=$,l(vr),M!==(M=G())&&(En(p,cc,M),l(Dd,M)))}function A(ie){var $=n.padding,I=c(ie?"right":"left");return $&&ii($[I]||(mo($)?0:$))||"0px"}function B(){var ie="";return m&&(ie=P(),lo(ie,"height or heightRatio is missing."),ie="calc("+ie+" - "+A(!1)+" - "+A(!0)+")"),ie}function P(){return ii(n.height||mn(w).width*n.heightRatio)}function C(){return n.autoWidth?null:ii(n.fixedWidth)||(m?"":x())}function j(){return ii(n.fixedHeight)||(m?n.autoHeight?null:x():P())}function x(){var ie=ii(n.gap);return"calc((100%"+(ie&&" + "+ie)+")/"+(n.perPage||1)+(ie&&" - "+ie)+")"}function W(){return mn(w)[c("width")]}function E(ie,$){var I=f(ie||0);return I?mn(I.slide)[c("width")]+($?0:U()):0}function Z(ie,$){var I=f(ie);if(I){var D=mn(I.slide)[c("right")],se=mn(w)[c("left")];return ln(D-se)+($?0:U())}return 0}function k(ie){return Z(e.length-1)-Z(0)+E(0,ie)}function U(){var ie=f(0);return ie&&parseFloat(xn(ie.slide,c("marginRight")))||0}function V(ie){return parseFloat(xn(b,c("padding"+(ie?"Right":"Left"))))||0}function G(){return e.is(ko)||k(!0)>W()}return{mount:R,resize:X,listSize:W,slideSize:E,sliderSize:k,totalSize:Z,getPadding:V,isOverflow:G}}var lu=2;function cu(e,t,n){var i=Kt(e),o=i.on,s=t.Elements,l=t.Slides,d=t.Direction.resolve,c=[],u;function p(){o(Qt,b),o([an,_i],f),(u=v())&&(h(u),t.Layout.resize(!0))}function b(){w(),p()}function w(){hi(c),Wn(c),i.destroy()}function f(){var M=v();u!==M&&(u<M||!M)&&i.emit(Qt)}function h(M){var R=l.get().slice(),L=R.length;if(L){for(;R.length<M;)tr(R,R);tr(R.slice(-M),R.slice(0,M)).forEach(function(X,A){var B=A<M,P=m(X.slide,A);B?Pa(P,R[0].slide):Io(s.list,P),tr(c,P),l.register(P,A-M+(B?0:L),X.index)})}}function m(M,R){var L=M.cloneNode(!0);return Tn(L,n.classes.clone),L.id=e.root.id+"-clone"+Fa(R+1),L}function v(){var M=n.clones;if(!e.is(Yi))M=0;else if(Lo(M)){var R=n[d("fixedWidth")]&&t.Layout.slideSize(0),L=R&&vo(mn(s.track)[d("width")]/R);M=L||n[d("autoWidth")]&&e.length||n.perPage*lu}return M}return{mount:p,destroy:w}}function du(e,t,n){var i=Kt(e),o=i.on,s=i.emit,l=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,p=d.totalSize,b=d.listSize,w=d.sliderSize,f=t.Direction,h=f.resolve,m=f.orient,v=t.Elements,M=v.list,R=v.track,L;function X(){L=t.Transition,o([Jn,vr,an,Qt],A)}function A(){t.Controller.isBusy()||(t.Scroll.cancel(),P(e.index),t.Slides.update())}function B(I,D,se,oe){I!==D&&ie(I>se)&&(W(),C(x(k(),I>se),!0)),l(Ki),s(_n,D,se,I),L.start(D,function(){l(Wi),s(Xi,D,se,I),oe&&oe()})}function P(I){C(Z(I,!0))}function C(I,D){if(!e.is(ko)){var se=D?I:j(I);xn(M,"transform","translate"+h("X")+"("+se+"px)"),I!==se&&s(Zl)}}function j(I){if(e.is(Yi)){var D=E(I),se=D>t.Controller.getEnd(),oe=D<0;(oe||se)&&(I=x(I,se))}return I}function x(I,D){var se=I-G(D),oe=w();return I-=m(oe*(vo(ln(se)/oe)||1))*(D?1:-1),I}function W(){C(k(),!0),L.cancel()}function E(I){for(var D=t.Slides.get(),se=0,oe=1/0,T=0;T<D.length;T++){var ue=D[T].index,F=ln(Z(ue,!0)-I);if(F<=oe)oe=F,se=ue;else break}return se}function Z(I,D){var se=m(p(I-1)-V(I));return D?U(se):se}function k(){var I=h("left");return mn(M)[I]-mn(R)[I]+m(u(!1))}function U(I){return n.trimSpace&&e.is(Ni)&&(I=Li(I,0,m(w(!0)-b()))),I}function V(I){var D=n.focus;return D==="center"?(b()-c(I,!0))/2:+D*c(I)||0}function G(I){return Z(I?t.Controller.getEnd():0,!!n.trimSpace)}function ie(I){var D=m(x(k(),I));return I?D>=0:D<=M[h("scrollWidth")]-mn(R)[h("width")]}function $(I,D){D=Lo(D)?k():D;var se=I!==!0&&m(D)<m(G(!1)),oe=I!==!1&&m(D)>m(G(!0));return se||oe}return{mount:X,move:B,jump:P,translate:C,shift:x,cancel:W,toIndex:E,toPosition:Z,getPosition:k,getLimit:G,exceededLimit:$,reposition:A}}function uu(e,t,n){var i=Kt(e),o=i.on,s=i.emit,l=t.Move,d=l.getPosition,c=l.getLimit,u=l.toPosition,p=t.Slides,b=p.isEnough,w=p.getLength,f=n.omitEnd,h=e.is(Yi),m=e.is(Ni),v=Vt(k,!1),M=Vt(k,!0),R=n.start||0,L,X=R,A,B,P;function C(){j(),o([an,Qt,dr],j),o(vr,x)}function j(){A=w(!0),B=n.perMove,P=n.perPage,L=ie();var F=Li(R,0,f?L:A-1);F!==R&&(R=F,l.reposition())}function x(){L!==ie()&&s(dr)}function W(F,ne,J){if(!ue()){var ve=Z(F),Ee=G(ve);Ee>-1&&(ne||Ee!==R)&&(se(Ee),l.move(ve,Ee,X,J))}}function E(F,ne,J,ve){t.Scroll.scroll(F,ne,J,function(){var Ee=G(l.toIndex(d()));se(f?Un(Ee,L):Ee),ve&&ve()})}function Z(F){var ne=R;if(qn(F)){var J=F.match(/([+\-<>])(\d+)?/)||[],ve=J[1],Ee=J[2];ve==="+"||ve==="-"?ne=U(R+ +(""+ve+(+Ee||1)),R):ve===">"?ne=Ee?$(+Ee):v(!0):ve==="<"&&(ne=M(!0))}else ne=h?F:Li(F,0,L);return ne}function k(F,ne){var J=B||(T()?1:P),ve=U(R+J*(F?-1:1),R,!(B||T()));return ve===-1&&m&&!_l(d(),c(!F),1)?F?0:L:ne?ve:G(ve)}function U(F,ne,J){if(b()||T()){var ve=V(F);ve!==F&&(ne=F,F=ve,J=!1),F<0||F>L?!B&&(nr(0,F,ne,!0)||nr(L,ne,F,!0))?F=$(I(F)):h?F=J?F<0?-(A%P||P):A:F:n.rewind?F=F<0?L:0:F=-1:J&&F!==ne&&(F=$(I(ne)+(F<ne?-1:1)))}else F=-1;return F}function V(F){if(m&&n.trimSpace==="move"&&F!==R)for(var ne=d();ne===u(F,!0)&&nr(F,0,e.length-1,!n.rewind);)F<R?--F:++F;return F}function G(F){return h?(F+A)%A||0:F}function ie(){for(var F=A-(T()||h&&B?1:P);f&&F-- >0;)if(u(A-1,!0)!==u(F,!0)){F++;break}return Li(F,0,A-1)}function $(F){return Li(T()?F:P*F,0,L)}function I(F){return T()?Un(F,L):cr((F>=L?A-1:F)/P)}function D(F){var ne=l.toIndex(F);return m?Li(ne,0,L):ne}function se(F){F!==R&&(X=R,R=F)}function oe(F){return F?X:R}function T(){return!Lo(n.focus)||n.isNavigation}function ue(){return e.state.is([Ki,To])&&!!n.waitForTransition}return{mount:C,go:W,scroll:E,getNext:v,getPrev:M,getAdjacent:k,getEnd:ie,setIndex:se,getIndex:oe,toIndex:$,toPage:I,toDest:D,hasFocus:T,isBusy:ue}}var pu="http://www.w3.org/2000/svg",mu="m15.5 0.932-4.3 4.38 14.5 14.6-14.5 14.5 4.3 4.4 14.6-14.6 4.4-4.3-4.4-4.4-14.6-14.6z",Ho=40;function gu(e,t,n){var i=Kt(e),o=i.on,s=i.bind,l=i.emit,d=n.classes,c=n.i18n,u=t.Elements,p=t.Controller,b=u.arrows,w=u.track,f=b,h=u.prev,m=u.next,v,M,R={};function L(){A(),o(an,X)}function X(){B(),L()}function A(){var E=n.arrows;E&&!(h&&m)&&j(),h&&m&&(fo(R,{prev:h,next:m}),yo(f,E?"":"none"),Tn(f,M=Va+"--"+n.direction),E&&(P(),W(),St([h,m],Po,w.id),l(Gl,h,m)))}function B(){i.destroy(),Pn(f,M),v?(hi(b?[h,m]:f),h=m=null):Ln([h,m],Ba)}function P(){o([Jn,Xi,Qt,vi,dr],W),s(m,"click",Vt(C,">")),s(h,"click",Vt(C,"<"))}function C(E){p.go(E,!0)}function j(){f=b||Pi("div",d.arrows),h=x(!0),m=x(!1),v=!0,Io(f,[h,m]),!b&&Pa(f,w)}function x(E){var Z='<button class="'+d.arrow+" "+(E?d.prev:d.next)+'" type="button"><svg xmlns="'+pu+'" viewBox="0 0 '+Ho+" "+Ho+'" width="'+Ho+'" height="'+Ho+'" focusable="false"><path d="'+(n.arrowPath||mu)+'" />';return Fl(Z)}function W(){if(h&&m){var E=e.index,Z=p.getPrev(),k=p.getNext(),U=Z>-1&&E<Z?c.last:c.prev,V=k>-1&&E>k?c.first:c.next;h.disabled=Z<0,m.disabled=k<0,St(h,hn,U),St(m,hn,V),l(ql,h,m,Z,k)}}return{arrows:R,mount:L,destroy:B,update:W}}var hu=Aa+"-interval";function fu(e,t,n){var i=Kt(e),o=i.on,s=i.bind,l=i.emit,d=br(n.interval,e.go.bind(e,">"),P),c=d.isPaused,u=t.Elements,p=t.Elements,b=p.root,w=p.toggle,f=n.autoplay,h,m,v=f==="pause";function M(){f&&(R(),w&&St(w,Po,u.track.id),v||L(),B())}function R(){n.pauseOnHover&&s(b,"mouseenter mouseleave",function(j){h=j.type==="mouseenter",A()}),n.pauseOnFocus&&s(b,"focusin focusout",function(j){m=j.type==="focusin",A()}),w&&s(w,"click",function(){v?L():X(!0)}),o([_n,xr,Qt],d.rewind),o(_n,C)}function L(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),m=h=v=!1,B(),l(Ha))}function X(j){j===void 0&&(j=!0),v=!!j,B(),c()||(d.pause(),l(Oa))}function A(){v||(h||m?X(!1):L())}function B(){w&&(En(w,fi,!v),St(w,hn,n.i18n[v?"play":"pause"]))}function P(j){var x=u.bar;x&&xn(x,"width",j*100+"%"),l(Xl,j)}function C(j){var x=t.Slides.getAt(j);d.set(x&&+bn(x.slide,hu)||n.interval)}return{mount:M,destroy:d.cancel,play:L,pause:X,isPaused:c}}function yu(e,t,n){var i=Kt(e),o=i.on;function s(){n.cover&&(o(Da,Vt(d,!0)),o([Jn,an,Qt],Vt(l,!0)))}function l(c){t.Slides.forEach(function(u){var p=Mo(u.container||u.slide,"img");p&&p.src&&d(c,p,u)})}function d(c,u,p){p.style("background",c?'center/cover no-repeat url("'+u.src+'")':"",!0),yo(u,c?"none":"")}return{mount:s,destroy:Vt(l,!1)}}var vu=10,xu=600,bu=.6,wu=1.5,Su=800;function $u(e,t,n){var i=Kt(e),o=i.on,s=i.emit,l=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,p=d.exceededLimit,b=d.translate,w=e.is(Ni),f,h,m=1;function v(){o(_n,X),o([an,Qt],A)}function M(P,C,j,x,W){var E=c();if(X(),j&&(!w||!p())){var Z=t.Layout.sliderSize(),k=ha(P)*Z*cr(ln(P)/Z)||0;P=d.toPosition(t.Controller.toDest(P%Z))+k}var U=_l(E,P,1);m=1,C=U?0:C||lr(ln(P-E)/wu,Su),h=x,f=br(C,R,Vt(L,E,P,W),1),l(To),s(xr),f.start()}function R(){l(Wi),h&&h(),s(vi)}function L(P,C,j,x){var W=c(),E=P+(C-P)*B(x),Z=(E-W)*m;b(W+Z),w&&!j&&p()&&(m*=bu,ln(Z)<vu&&M(u(p(!0)),xu,!1,h,!0))}function X(){f&&f.cancel()}function A(){f&&!f.isPaused()&&(X(),R())}function B(P){var C=n.easingFunc;return C?C(P):1-Math.pow(1-P,4)}return{mount:v,destroy:X,scroll:M,cancel:A}}var Ri={passive:!1,capture:!0};function Cu(e,t,n){var i=Kt(e),o=i.on,s=i.emit,l=i.bind,d=i.unbind,c=e.state,u=t.Move,p=t.Scroll,b=t.Controller,w=t.Elements.track,f=t.Media.reduce,h=t.Direction,m=h.resolve,v=h.orient,M=u.getPosition,R=u.exceededLimit,L,X,A,B,P,C=!1,j,x,W;function E(){l(w,Dr,ma,Ri),l(w,jr,ma,Ri),l(w,dc,k,Ri),l(w,"click",G,{capture:!0}),l(w,"dragstart",Mn),o([Jn,an],Z)}function Z(){var q=n.drag;de(!q),B=q==="free"}function k(q){if(j=!1,!x){var Q=Ee(q);ve(q.target)&&(Q||!q.button)&&(b.isBusy()?Mn(q,!0):(W=Q?w:window,P=c.is([Ki,To]),A=null,l(W,Dr,U,Ri),l(W,jr,V,Ri),u.cancel(),p.cancel(),ie(q)))}}function U(q){if(c.is(er)||(c.set(er),s(zl)),q.cancelable)if(P){u.translate(L+J(T(q)));var Q=ue(q)>xs,Y=C!==(C=R());(Q||Y)&&ie(q),j=!0,s(Bl),Mn(q)}else D(q)&&(P=I(q),Mn(q))}function V(q){c.is(er)&&(c.set(Wi),s(Vl)),P&&($(q),Mn(q)),d(W,Dr,U),d(W,jr,V),P=!1}function G(q){!x&&j&&Mn(q,!0)}function ie(q){A=X,X=q,L=M()}function $(q){var Q=se(q),Y=oe(Q),_e=n.rewind&&n.rewindByDrag;f(!1),B?b.scroll(Y,0,n.snap):e.is(ko)?b.go(v(ha(Q))<0?_e?"<":"-":_e?">":"+"):e.is(Ni)&&C&&_e?b.go(R(!0)?">":"<"):b.go(b.toDest(Y),!0),f(!0)}function I(q){var Q=n.dragMinThreshold,Y=mo(Q),_e=Y&&Q.mouse||0,Ce=(Y?Q.touch:+Q)||10;return ln(T(q))>(Ee(q)?Ce:_e)}function D(q){return ln(T(q))>ln(T(q,!0))}function se(q){if(e.is(Yi)||!C){var Q=ue(q);if(Q&&Q<xs)return T(q)/Q}return 0}function oe(q){return M()+ha(q)*Un(ln(q)*(n.flickPower||600),B?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function T(q,Q){return ne(q,Q)-ne(F(q),Q)}function ue(q){return ga(q)-ga(F(q))}function F(q){return X===q&&A||X}function ne(q,Q){return(Ee(q)?q.changedTouches[0]:q)["page"+m(Q?"Y":"X")]}function J(q){return q/(C&&e.is(Ni)?iu:1)}function ve(q){var Q=n.noDrag;return!go(q,"."+rc+", ."+Lr)&&(!Q||!go(q,Q))}function Ee(q){return typeof TouchEvent<"u"&&q instanceof TouchEvent}function me(){return P}function de(q){x=q}return{mount:E,disable:de,isDragging:me}}var Tu={Spacebar:" ",Right:$r,Left:Sr,Up:Jl,Down:Ql};function Ga(e){return e=qn(e)?e:e.key,Tu[e]||e}var bs="keydown";function Lu(e,t,n){var i=Kt(e),o=i.on,s=i.bind,l=i.unbind,d=e.root,c=t.Direction.resolve,u,p;function b(){w(),o(an,f),o(an,w),o(_n,m)}function w(){var M=n.keyboard;M&&(u=M==="global"?window:d,s(u,bs,v))}function f(){l(u,bs)}function h(M){p=M}function m(){var M=p;p=!0,Ml(function(){p=M})}function v(M){if(!p){var R=Ga(M);R===c(Sr)?e.go("<"):R===c($r)&&e.go(">")}}return{mount:b,destroy:f,disable:h}}var co=Aa+"-lazy",ir=co+"-srcset",Ru="["+co+"], ["+ir+"]";function Iu(e,t,n){var i=Kt(e),o=i.on,s=i.off,l=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[Xi,vi],p=[];function b(){n.lazyLoad&&(w(),o(Qt,w))}function w(){Wn(p),f(),c?M():(s(u),o(u,h),h())}function f(){t.Slides.forEach(function(R){ka(R.slide,Ru).forEach(function(L){var X=bn(L,co),A=bn(L,ir);if(X!==L.src||A!==L.srcset){var B=n.classes.spinner,P=L.parentElement,C=Mo(P,"."+B)||Pi("span",B,P);p.push([L,R,C]),L.src||yo(L,"none")}})})}function h(){p=p.filter(function(R){var L=n.perPage*((n.preloadPages||1)+1)-1;return R[1].isWithin(e.index,L)?m(R):!0}),p.length||s(u)}function m(R){var L=R[0];Tn(R[1].slide,xa),l(L,"load error",Vt(v,R)),St(L,"src",bn(L,co)),St(L,"srcset",bn(L,ir)),Ln(L,co),Ln(L,ir)}function v(R,L){var X=R[0],A=R[1];Pn(A.slide,xa),L.type!=="error"&&(hi(R[2]),yo(X,""),d(Da,X,A),d(_i)),c&&M()}function M(){p.length&&m(p.shift())}return{mount:b,destroy:Vt(Wn,p),check:h}}function Mu(e,t,n){var i=Kt(e),o=i.on,s=i.emit,l=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,p=u.hasFocus,b=u.getIndex,w=u.go,f=t.Direction.resolve,h=c.pagination,m=[],v,M;function R(){L(),o([an,Qt,dr],R);var x=n.pagination;h&&yo(h,x?"":"none"),x&&(o([_n,xr,vi],j),X(),j(),s(Ul,{list:v,items:m},C(e.index)))}function L(){v&&(hi(h?Zn(v.children):v),Pn(v,M),Wn(m),v=null),i.destroy()}function X(){var x=e.length,W=n.classes,E=n.i18n,Z=n.perPage,k=p()?u.getEnd()+1:vo(x/Z);v=h||Pi("ul",W.pagination,c.track.parentElement),Tn(v,M=Rr+"--"+P()),St(v,kn,"tablist"),St(v,hn,E.select),St(v,za,P()===Cr?"vertical":"");for(var U=0;U<k;U++){var V=Pi("li",null,v),G=Pi("button",{class:W.page,type:"button"},V),ie=d.getIn(U).map(function(I){return I.slide.id}),$=!p()&&Z>1?E.pageX:E.slideX;l(G,"click",Vt(A,U)),n.paginationKeyboard&&l(G,"keydown",Vt(B,U)),St(V,kn,"presentation"),St(G,kn,"tab"),St(G,Po,ie.join(" ")),St(G,hn,fa($,U+1)),St(G,ki,-1),m.push({li:V,button:G,page:U})}}function A(x){w(">"+x,!0)}function B(x,W){var E=m.length,Z=Ga(W),k=P(),U=-1;Z===f($r,!1,k)?U=++x%E:Z===f(Sr,!1,k)?U=(--x+E)%E:Z==="Home"?U=0:Z==="End"&&(U=E-1);var V=m[U];V&&(Al(V.button),w(">"+U),Mn(W,!0))}function P(){return n.paginationDirection||n.direction}function C(x){return m[u.toPage(x)]}function j(){var x=C(b(!0)),W=C(b());if(x){var E=x.button;Pn(E,fi),Ln(E,gs),St(E,ki,-1)}if(W){var Z=W.button;Tn(Z,fi),St(Z,gs,!0),St(Z,ki,"")}s(Kl,{list:v,items:m},x,W)}return{items:m,mount:R,destroy:L,getAt:C,update:j}}var Eu=[" ","Enter"];function Pu(e,t,n){var i=n.isNavigation,o=n.slideFocus,s=[];function l(){e.splides.forEach(function(h){h.isParent||(u(e,h.splide),u(h.splide,e))}),i&&p()}function d(){s.forEach(function(h){h.destroy()}),Wn(s)}function c(){d(),l()}function u(h,m){var v=Kt(h);v.on(_n,function(M,R,L){m.go(m.is(Yi)?L:M)}),s.push(v)}function p(){var h=Kt(e),m=h.on;m(Wa,w),m(Yl,f),m([Jn,an],b),s.push(h),h.emit(Na,e.splides)}function b(){St(t.Elements.list,za,n.direction===Cr?"vertical":"")}function w(h){e.go(h.index)}function f(h,m){Ea(Eu,Ga(m))&&(w(h),Mn(m))}return{setup:Vt(t.Media.set,{slideFocus:Lo(o)?i:o},!0),mount:l,destroy:d,remount:c}}function ku(e,t,n){var i=Kt(e),o=i.bind,s=0;function l(){n.wheel&&o(t.Elements.track,"wheel",d,Ri)}function d(u){if(u.cancelable){var p=u.deltaY,b=p<0,w=ga(u),f=n.wheelMinThreshold||0,h=n.wheelSleep||0;ln(p)>f&&w-s>h&&(e.go(b?"<":">"),s=w),c(b)&&Mn(u)}}function c(u){return!n.releaseWheel||e.state.is(Ki)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var Au=90;function Fu(e,t,n){var i=Kt(e),o=i.on,s=t.Elements.track,l=n.live&&!n.isNavigation,d=Pi("span",Jd),c=br(Au,Vt(p,!1));function u(){l&&(w(!t.Autoplay.isPaused()),St(s,ys,!0),d.textContent="…",o(Ha,Vt(w,!0)),o(Oa,Vt(w,!1)),o([Xi,vi],Vt(p,!0)))}function p(f){St(s,fs,f),f?(Io(s,d),c.start()):(hi(d),c.cancel())}function b(){Ln(s,[hs,ys,fs]),hi(d)}function w(f){l&&St(s,hs,f?"off":"polite")}return{mount:u,disable:w,destroy:b}}var Wu=Object.freeze({__proto__:null,Media:Bd,Direction:Vd,Elements:ou,Slides:au,Layout:su,Clones:cu,Move:du,Controller:uu,Arrows:gu,Autoplay:fu,Cover:yu,Scroll:$u,Drag:Cu,Keyboard:Lu,LazyLoad:Iu,Pagination:Mu,Sync:Pu,Wheel:ku,Live:Fu}),_u={prev:"Previous slide",next:"Next slide",first:"Go to first slide",last:"Go to last slide",slideX:"Go to slide %s",pageX:"Go to page %s",play:"Start autoplay",pause:"Pause autoplay",carousel:"carousel",slide:"slide",select:"Select a slide to show",slideLabel:"%s of %s"},Nu={type:"slide",role:"region",speed:400,perPage:1,cloneStatus:!0,arrows:!0,pagination:!0,paginationKeyboard:!0,interval:5e3,pauseOnHover:!0,pauseOnFocus:!0,resetProgress:!0,easing:"cubic-bezier(0.25, 1, 0.5, 1)",drag:!0,direction:"ltr",trimSpace:!0,focusableNodes:"a, button, textarea, input, select, iframe",live:!0,classes:tu,i18n:_u,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Hu(e,t,n){var i=t.Slides;function o(){Kt(e).on([Jn,Qt],s)}function s(){i.forEach(function(d){d.style("transform","translateX(-"+100*d.index+"%)")})}function l(d,c){i.style("transition","opacity "+n.speed+"ms "+n.easing),Ml(c)}return{mount:o,start:l,cancel:ma}}function Ou(e,t,n){var i=t.Move,o=t.Controller,s=t.Scroll,l=t.Elements.list,d=Vt(xn,l,"transition"),c;function u(){Kt(e).bind(l,"transitionend",function(f){f.target===l&&c&&(b(),c())})}function p(f,h){var m=i.toPosition(f,!0),v=i.getPosition(),M=w(f);ln(m-v)>=1&&M>=1?n.useScroll?s.scroll(m,M,!1,h):(d("transform "+M+"ms "+n.easing),i.translate(m,!0),c=h):(i.jump(f),h())}function b(){d(""),s.cancel()}function w(f){var h=n.rewindSpeed;if(e.is(Ni)&&h){var m=o.getIndex(!0),v=o.getEnd();if(m===0&&f>=v||m>=v&&f===0)return h}return n.speed}return{mount:u,start:p,cancel:b}}var Du=(function(){function e(n,i){this.event=Kt(),this.Components={},this.state=jd(Ei),this.splides=[],this._o={},this._E={};var o=qn(n)?Wl(document,n):n;lo(o,o+" is invalid."),this.root=o,i=zn({label:bn(o,hn)||"",labelledby:bn(o,ja)||""},Nu,e.defaults,i||{});try{zn(i,JSON.parse(bn(o,Aa)))}catch{lo(!1,"Invalid JSON")}this._o=Object.create(zn({},i))}var t=e.prototype;return t.mount=function(i,o){var s=this,l=this.state,d=this.Components;lo(l.is([Ei,sr]),"Already mounted!"),l.set(Ei),this._C=d,this._T=o||this._T||(this.is(ko)?Hu:Ou),this._E=i||this._E;var c=fo({},Wu,this._E,{Transition:this._T});return mi(c,function(u,p){var b=u(s,d,s._o);d[p]=b,b.setup&&b.setup()}),mi(d,function(u){u.mount&&u.mount()}),this.emit(Jn),Tn(this.root,Qd),l.set(Wi),this.emit(ya),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(Wi)&&(this._C.Sync.remount(),i.Components.Sync.remount()),this},t.go=function(i){return this._C.Controller.go(i),this},t.on=function(i,o){return this.event.on(i,o),this},t.off=function(i){return this.event.off(i),this},t.emit=function(i){var o;return(o=this.event).emit.apply(o,[i].concat(Zn(arguments,1))),this},t.add=function(i,o){return this._C.Slides.add(i,o),this},t.remove=function(i){return this._C.Slides.remove(i),this},t.is=function(i){return this._o.type===i},t.refresh=function(){return this.emit(Qt),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,s=this.state;return s.is(Ei)?Kt(this).on(ya,this.destroy.bind(this,i)):(mi(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(_a),o.destroy(),i&&Wn(this.splides),s.set(sr)),this},_d(e,[{key:"options",get:function(){return this._o},set:function(i){this._C.Media.set(i,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e})(),qa=Du;qa.defaults={};qa.STATES=Hd;var ws=[[Jn,"onMounted"],[ya,"onReady"],[_n,"onMove"],[Xi,"onMoved"],[Wa,"onClick"],[Hl,"onActive"],[Ol,"onInactive"],[Dl,"onVisible"],[jl,"onHidden"],[Qt,"onRefresh"],[an,"onUpdated"],[_i,"onResize"],[vr,"onResized"],[zl,"onDrag"],[Bl,"onDragging"],[Vl,"onDragged"],[xr,"onScroll"],[vi,"onScrolled"],[_a,"onDestroy"],[Gl,"onArrowsMounted"],[ql,"onArrowsUpdated"],[Ul,"onPaginationMounted"],[Kl,"onPaginationUpdated"],[Na,"onNavigationMounted"],[Ha,"onAutoplayPlay"],[Xl,"onAutoplayPlaying"],[Oa,"onAutoplayPause"],[Da,"onLazyLoadLoaded"]];function Ua(...e){return e.filter(Boolean).join(" ")}function ur(e){return e!==null&&typeof e=="object"}function ba(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!ba(n,t[i]));if(ur(e)&&ur(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!ba(e[o],t[o]))}return e===t}function ju(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function zu(e,t){if(e){const n=Object.keys(e);for(let i=0;i<n.length;i++){const o=n[i];if(o!=="__proto__"&&t(e[o],o)===!1)break}}return e}function wa(e,t){const n=e;return zu(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():ur(i)?n[o]=wa(ur(n[o])?n[o]:{},i):n[o]=i}),n}var Bu=({children:e,className:t,...n})=>a.createElement("div",{className:Ua("splide__track",t),...n},a.createElement("ul",{className:"splide__list"},e)),Ka=class extends a.Component{constructor(){super(...arguments),this.splideRef=a.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:i}=this.splideRef;i&&(this.splide=new qa(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=wa({},e||{}),this.slides=this.getSlides())}componentWillUnmount(){this.splide&&(this.splide.destroy(),this.splide=void 0),this.options=void 0,this.slides.length=0}componentDidUpdate(){if(!this.splide)return;const{options:e}=this.props;e&&!ba(this.options,e)&&(this.splide.options=e,this.options=wa({},e));const t=this.getSlides();ju(this.slides,t)||(this.splide.refresh(),this.slides=t)}sync(e){var t;(t=this.splide)==null||t.sync(e)}go(e){var t;(t=this.splide)==null||t.go(e)}getSlides(){var e;if(this.splide){const t=(e=this.splide.Components.Elements)==null?void 0:e.list.children;return t&&Array.prototype.slice.call(t)||[]}return[]}bind(e){ws.forEach(([t,n])=>{const i=this.props[n];typeof i=="function"&&e.on(t,(...o)=>{i(e,...o)})})}omit(e,t){return t.forEach(n=>{Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}),e}render(){const{className:e,tag:t="div",hasTrack:n=!0,children:i,...o}=this.props;return a.createElement(t,{className:Ua("splide",e),ref:this.splideRef,...this.omit(o,["options",...ws.map(s=>s[1])])},n?a.createElement(Bu,null,i):i)}},Xa=({children:e,className:t,...n})=>a.createElement("li",{className:Ua("splide__slide",t),...n},e);/*!
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),a=require("react"),rt=require("classnames"),S=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Yn=require("react-dom");function Gc(e){return e.type==="object"&&e.version===1}const qc="ControlSlider-module__wrapper___sHEkd",Uc="ControlSlider-module__hoverArrow___A-dOH",Kc="ControlSlider-module__sliderItem___QQSkR",Xc="ControlSlider-module__sliderImage___9hRl-",Yc="ControlSlider-module__arrow___05ghY",Zc="ControlSlider-module__arrowVertical___tBfVN",Jc="ControlSlider-module__nextArrow___-30Yc",Qc="ControlSlider-module__arrowInner___aEra3",ed="ControlSlider-module__arrowIcon___S4ztF",td="ControlSlider-module__arrowImg___2dwJW",nd="ControlSlider-module__mirror___brd6U",id="ControlSlider-module__pagination___bicLF",od="ControlSlider-module__paginationInner___bT-P-",rd="ControlSlider-module__paginationVertical___zYqKw",ad="ControlSlider-module__paginationItem___nTRbk",sd="ControlSlider-module__dot___p1Qun",ld="ControlSlider-module__activeDot___LHFaj",cd="ControlSlider-module__paginationInsideBottom___R3FWn",dd="ControlSlider-module__paginationInsideTop___V-qb-",ud="ControlSlider-module__paginationOutsideBottom___14w8D",pd="ControlSlider-module__paginationOutsideTop___SCLqB",md="ControlSlider-module__paginationInsideLeft___yOBRZ",gd="ControlSlider-module__paginationInsideRight___Rtt3o",hd="ControlSlider-module__paginationOutsideLeft___lahaw",fd="ControlSlider-module__paginationOutsideRight___EtuQa",yd="ControlSlider-module__imgWrapper___UjEgB",vd="ControlSlider-module__captionBlock___dJ6-j",xd="ControlSlider-module__captionTextWrapper___HFlpf",bd="ControlSlider-module__captionText___uGBVc",wd="ControlSlider-module__active___WZK4G",Sd="ControlSlider-module__withPointerEvents___t-18M",$d="ControlSlider-module__topLeftAlignment___zjnGM",Cd="ControlSlider-module__topCenterAlignment___gD1xW",Td="ControlSlider-module__topRightAlignment___NMapS",Ld="ControlSlider-module__middleLeftAlignment___OnUrY",Rd="ControlSlider-module__middleCenterAlignment___Tdkl0",Id="ControlSlider-module__middleRightAlignment___wEbfX",Md="ControlSlider-module__bottomLeftAlignment___cTP2-",Ed="ControlSlider-module__bottomCenterAlignment___c54fB",Pd="ControlSlider-module__bottomRightAlignment___kEwrz",kd="ControlSlider-module__clickOverlay___DZA28",Ad="ControlSlider-module__contain___pLyq7",Fd="ControlSlider-module__cover___KdDat",it={wrapper:qc,hoverArrow:Uc,sliderItem:Kc,sliderImage:Xc,arrow:Yc,arrowVertical:Zc,nextArrow:Jc,arrowInner:Qc,arrowIcon:ed,arrowImg:td,mirror:nd,pagination:id,paginationInner:od,paginationVertical:rd,paginationItem:ad,dot:sd,activeDot:ld,paginationInsideBottom:cd,paginationInsideTop:dd,paginationOutsideBottom:ud,paginationOutsideTop:pd,paginationInsideLeft:md,paginationInsideRight:gd,paginationOutsideLeft:hd,paginationOutsideRight:fd,imgWrapper:yd,captionBlock:vd,captionTextWrapper:xd,captionText:bd,active:wd,withPointerEvents:Sd,topLeftAlignment:$d,topCenterAlignment:Cd,topRightAlignment:Td,middleLeftAlignment:Ld,middleCenterAlignment:Rd,middleRightAlignment:Id,bottomLeftAlignment:Md,bottomCenterAlignment:Ed,bottomRightAlignment:Pd,clickOverlay:kd,contain:Ad,cover:Fd};function Wd(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function _d(e,t,n){return t&&Wd(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var ls="(prefers-reduced-motion: reduce)",Ei=1,Nd=2,Wi=3,Ki=4,To=5,er=6,sr=7,Hd={CREATED:Ei,MOUNTED:Nd,IDLE:Wi,MOVING:Ki,SCROLLING:To,DRAGGING:er,DESTROYED:sr};function Wn(e){e.length=0}function Zn(e,t,n){return Array.prototype.slice.call(e,t,n)}function Vt(e){return e.bind.apply(e,[null].concat(Zn(arguments,1)))}var Ml=setTimeout,ma=function(){};function cs(e){return requestAnimationFrame(e)}function yr(e,t){return typeof t===e}function mo(e){return!Ma(e)&&yr("object",e)}var Ia=Array.isArray,El=Vt(yr,"function"),qn=Vt(yr,"string"),Lo=Vt(yr,"undefined");function Ma(e){return e===null}function Pl(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Ro(e){return Ia(e)?e:[e]}function yn(e,t){Ro(e).forEach(t)}function Ea(e,t){return e.indexOf(t)>-1}function tr(e,t){return e.push.apply(e,Ro(t)),e}function En(e,t,n){e&&yn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Tn(e,t){En(e,qn(t)?t.split(" "):t,!0)}function Io(e,t){yn(t,e.appendChild.bind(e))}function Pa(e,t){yn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function go(e,t){return Pl(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function kl(e,t){var n=e?Zn(e.children):[];return t?n.filter(function(i){return go(i,t)}):n}function Mo(e,t){return t?kl(e,t)[0]:e.firstElementChild}var ho=Object.keys;function mi(e,t,n){return e&&(n?ho(e).reverse():ho(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function fo(e){return Zn(arguments,1).forEach(function(t){mi(t,function(n,i){e[i]=t[i]})}),e}function zn(e){return Zn(arguments,1).forEach(function(t){mi(t,function(n,i){Ia(n)?e[i]=n.slice():mo(n)?e[i]=zn({},mo(e[i])?e[i]:{},n):e[i]=n})}),e}function ds(e,t){yn(t||ho(e),function(n){delete e[n]})}function Ln(e,t){yn(e,function(n){yn(t,function(i){n&&n.removeAttribute(i)})})}function St(e,t,n){mo(t)?mi(t,function(i,o){St(e,o,i)}):yn(e,function(i){Ma(n)||n===""?Ln(i,t):i.setAttribute(t,String(n))})}function Pi(e,t,n){var i=document.createElement(e);return t&&(qn(t)?Tn(i,t):St(i,t)),n&&Io(n,i),i}function xn(e,t,n){if(Lo(n))return getComputedStyle(e)[t];Ma(n)||(e.style[t]=""+n)}function yo(e,t){xn(e,"display",t)}function Al(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function bn(e,t){return e.getAttribute(t)}function us(e,t){return e&&e.classList.contains(t)}function mn(e){return e.getBoundingClientRect()}function hi(e){yn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Fl(e){return Mo(new DOMParser().parseFromString(e,"text/html").body)}function Mn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function Wl(e,t){return e&&e.querySelector(t)}function ka(e,t){return t?Zn(e.querySelectorAll(t)):[]}function Pn(e,t){En(e,t,!1)}function ga(e){return e.timeStamp}function ii(e){return qn(e)?e:e?e+"px":""}var Eo="splide",Aa="data-"+Eo;function lo(e,t){if(!e)throw new Error("["+Eo+"] "+(t||""))}var Un=Math.min,lr=Math.max,cr=Math.floor,vo=Math.ceil,ln=Math.abs;function _l(e,t,n){return ln(e-t)<n}function nr(e,t,n,i){var o=Un(t,n),s=lr(t,n);return i?o<e&&e<s:o<=e&&e<=s}function Li(e,t,n){var i=Un(t,n),o=lr(t,n);return Un(lr(i,e),o)}function ha(e){return+(e>0)-+(e<0)}function fa(e,t){return yn(t,function(n){e=e.replace("%s",""+n)}),e}function Fa(e){return e<10?"0"+e:""+e}var ps={};function Od(e){return""+e+Fa(ps[e]=(ps[e]||0)+1)}function Nl(){var e=[];function t(l,d,c,u){o(l,d,function(p,b,w){var f="addEventListener"in p,h=f?p.removeEventListener.bind(p,b,c,u):p.removeListener.bind(p,c);f?p.addEventListener(b,c,u):p.addListener(c),e.push([p,b,w,c,h])})}function n(l,d,c){o(l,d,function(u,p,b){e=e.filter(function(w){return w[0]===u&&w[1]===p&&w[2]===b&&(!c||w[3]===c)?(w[4](),!1):!0})})}function i(l,d,c){var u,p=!0;return typeof CustomEvent=="function"?u=new CustomEvent(d,{bubbles:p,detail:c}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(d,p,!1,c)),l.dispatchEvent(u),u}function o(l,d,c){yn(l,function(u){u&&yn(d,function(p){p.split(" ").forEach(function(b){var w=b.split(".");c(u,w[0],w[1])})})})}function s(){e.forEach(function(l){l[4]()}),Wn(e)}return{bind:t,unbind:n,dispatch:i,destroy:s}}var Jn="mounted",ya="ready",_n="move",Xi="moved",Wa="click",Hl="active",Ol="inactive",Dl="visible",jl="hidden",Qt="refresh",an="updated",_i="resize",vr="resized",zl="drag",Bl="dragging",Vl="dragged",xr="scroll",vi="scrolled",Dd="overflow",_a="destroy",Gl="arrows:mounted",ql="arrows:updated",Ul="pagination:mounted",Kl="pagination:updated",Na="navigation:mounted",Ha="autoplay:play",Xl="autoplay:playing",Oa="autoplay:pause",Da="lazyload:loaded",Yl="sk",Zl="sh",dr="ei";function Kt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=Nl();function i(s,l){n.bind(t,Ro(s).join(" "),function(d){l.apply(l,Ia(d.detail)?d.detail:[])})}function o(s){n.dispatch(t,s,Zn(arguments,1))}return e&&e.event.on(_a,n.destroy),fo(n,{bus:t,on:i,off:Vt(n.unbind,t),emit:o})}function br(e,t,n,i){var o=Date.now,s,l=0,d,c=!0,u=0;function p(){if(!c){if(l=e?Un((o()-s)/e,1):1,n&&n(l),l>=1&&(t(),s=o(),i&&++u>=i))return w();d=cs(p)}}function b(M){M||h(),s=o()-(M?l*e:0),c=!1,d=cs(p)}function w(){c=!0}function f(){s=o(),l=0,n&&n(l)}function h(){d&&cancelAnimationFrame(d),l=0,d=0,c=!0}function m(M){e=M}function v(){return c}return{start:b,rewind:f,pause:w,cancel:h,set:m,isPaused:v}}function jd(e){var t=e;function n(o){t=o}function i(o){return Ea(Ro(o),t)}return{set:n,is:i}}function zd(e,t){var n=br(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Bd(e,t,n){var i=e.state,o=n.breakpoints||{},s=n.reducedMotion||{},l=Nl(),d=[];function c(){var h=n.mediaQuery==="min";ho(o).sort(function(m,v){return h?+m-+v:+v-+m}).forEach(function(m){p(o[m],"("+(h?"min":"max")+"-width:"+m+"px)")}),p(s,ls),b()}function u(h){h&&l.destroy()}function p(h,m){var v=matchMedia(m);l.bind(v,"change",b),d.push([h,v])}function b(){var h=i.is(sr),m=n.direction,v=d.reduce(function(M,R){return zn(M,R[1].matches?R[0]:{})},{});ds(n),f(v),n.destroy?e.destroy(n.destroy==="completely"):h?(u(!0),e.mount()):m!==n.direction&&e.refresh()}function w(h){matchMedia(ls).matches&&(h?zn(n,s):ds(n,ho(s)))}function f(h,m,v){zn(n,h),m&&zn(Object.getPrototypeOf(n),h),(v||!i.is(Ei))&&e.emit(an,n)}return{setup:c,destroy:u,reduce:w,set:f}}var wr="Arrow",Sr=wr+"Left",$r=wr+"Right",Jl=wr+"Up",Ql=wr+"Down",ms="rtl",Cr="ttb",Hr={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Jl,$r],ArrowRight:[Ql,Sr]};function Vd(e,t,n){function i(s,l,d){d=d||n.direction;var c=d===ms&&!l?1:d===Cr?0:-1;return Hr[s]&&Hr[s][c]||s.replace(/width|left|right/i,function(u,p){var b=Hr[u.toLowerCase()][c]||u;return p>0?b.charAt(0).toUpperCase()+b.slice(1):b})}function o(s){return s*(n.direction===ms?1:-1)}return{resolve:i,orient:o}}var kn="role",ki="tabindex",Gd="disabled",wn="aria-",Po=wn+"controls",ec=wn+"current",gs=wn+"selected",hn=wn+"label",ja=wn+"labelledby",tc=wn+"hidden",za=wn+"orientation",xo=wn+"roledescription",hs=wn+"live",fs=wn+"busy",ys=wn+"atomic",Ba=[kn,ki,Gd,Po,ec,hn,ja,tc,za,xo],Rn=Eo+"__",Qn="is-",Or=Eo,vs=Rn+"track",qd=Rn+"list",Tr=Rn+"slide",nc=Tr+"--clone",Ud=Tr+"__container",Va=Rn+"arrows",Lr=Rn+"arrow",ic=Lr+"--prev",oc=Lr+"--next",Rr=Rn+"pagination",rc=Rr+"__page",Kd=Rn+"progress",Xd=Kd+"__bar",Yd=Rn+"toggle",Zd=Rn+"spinner",Jd=Rn+"sr",Qd=Qn+"initialized",fi=Qn+"active",ac=Qn+"prev",sc=Qn+"next",va=Qn+"visible",xa=Qn+"loading",lc=Qn+"focus-in",cc=Qn+"overflow",eu=[fi,va,ac,sc,xa,lc,cc],tu={slide:Tr,clone:nc,arrows:Va,arrow:Lr,prev:ic,next:oc,pagination:Rr,page:rc,spinner:Zd};function nu(e,t){if(El(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!go(n,t);)n=n.parentElement;return n}var iu=5,xs=200,dc="touchstart mousedown",Dr="touchmove mousemove",jr="touchend touchcancel mouseup click";function ou(e,t,n){var i=Kt(e),o=i.on,s=i.bind,l=e.root,d=n.i18n,c={},u=[],p=[],b=[],w,f,h;function m(){L(),X(),R()}function v(){o(Qt,M),o(Qt,m),o(an,R),s(document,dc+" keydown",function(k){h=k.type==="keydown"},{capture:!0}),s(l,"focusin",function(){En(l,lc,!!h)})}function M(k){var C=Ba.concat("style");Wn(u),Pn(l,p),Pn(w,b),Ln([w,f],C),Ln(l,k?C:["style",xo])}function R(){Pn(l,p),Pn(w,b),p=B(Or),b=B(vs),Tn(l,p),Tn(w,b),St(l,hn,n.label),St(l,ja,n.labelledby)}function L(){w=F("."+vs),f=Mo(w,"."+qd),lo(w&&f,"A track/list element is missing."),tr(u,kl(f,"."+Tr+":not(."+nc+")")),mi({arrows:Va,pagination:Rr,prev:ic,next:oc,bar:Xd,toggle:Yd},function(k,C){c[C]=F("."+k)}),fo(c,{root:l,track:w,list:f,slides:u})}function X(){var k=l.id||Od(Eo),C=n.role;l.id=k,w.id=w.id||k+"-track",f.id=f.id||k+"-list",!bn(l,kn)&&l.tagName!=="SECTION"&&C&&St(l,kn,C),St(l,xo,d.carousel),St(f,kn,"presentation")}function F(k){var C=Wl(l,k);return C&&nu(C,"."+Or)===l?C:void 0}function B(k){return[k+"--"+n.type,k+"--"+n.direction,n.drag&&k+"--draggable",n.isNavigation&&k+"--nav",k===Or&&fi]}return fo(c,{setup:m,mount:v,destroy:M})}var Ni="slide",Yi="loop",ko="fade";function ru(e,t,n,i){var o=Kt(e),s=o.on,l=o.emit,d=o.bind,c=e.Components,u=e.root,p=e.options,b=p.isNavigation,w=p.updateOnMove,f=p.i18n,h=p.pagination,m=p.slideFocus,v=c.Direction.resolve,M=bn(i,"style"),R=bn(i,hn),L=n>-1,X=Mo(i,"."+Ud),F;function B(){L||(i.id=u.id+"-slide"+Fa(t+1),St(i,kn,h?"tabpanel":"group"),St(i,xo,f.slide),St(i,hn,R||fa(f.slideLabel,[t+1,e.length]))),k()}function k(){d(i,"click",Vt(l,Wa,ie)),d(i,"keydown",Vt(l,Yl,ie)),s([Xi,Zl,vi],W),s(Na,j),w&&s(_n,x)}function C(){F=!0,o.destroy(),Pn(i,eu),Ln(i,Ba),St(i,"style",M),St(i,hn,R||"")}function j(){var $=e.splides.map(function(I){var D=I.splide.Components.Slides.getAt(t);return D?D.slide.id:""}).join(" ");St(i,hn,fa(f.slideX,(L?n:t)+1)),St(i,Po,$),St(i,kn,m?"button":""),m&&Ln(i,xo)}function x(){F||W()}function W(){if(!F){var $=e.index;E(),Z(),En(i,ac,t===$-1),En(i,sc,t===$+1)}}function E(){var $=U();$!==us(i,fi)&&(En(i,fi,$),St(i,ec,b&&$||""),l($?Hl:Ol,ie))}function Z(){var $=V(),I=!$&&(!U()||L);if(e.state.is([Ki,To])||St(i,tc,I||""),St(ka(i,p.focusableNodes||""),ki,I?-1:""),m&&St(i,ki,I?-1:0),$!==us(i,va)&&(En(i,va,$),l($?Dl:jl,ie)),!$&&document.activeElement===i){var D=c.Slides.getAt(e.index);D&&Al(D.slide)}}function P($,I,D){xn(D&&X||i,$,I)}function U(){var $=e.index;return $===t||p.cloneStatus&&$===n}function V(){if(e.is(ko))return U();var $=mn(c.Elements.track),I=mn(i),D=v("left",!0),se=v("right",!0);return cr($[D])<=vo(I[D])&&cr(I[se])<=vo($[se])}function G($,I){var D=ln($-t);return!L&&(p.rewind||e.is(Yi))&&(D=Un(D,e.length-D)),D<=I}var ie={index:t,slideIndex:n,slide:i,container:X,isClone:L,mount:B,destroy:C,update:W,style:P,isWithin:G};return ie}function au(e,t,n){var i=Kt(e),o=i.on,s=i.emit,l=i.bind,d=t.Elements,c=d.slides,u=d.list,p=[];function b(){w(),o(Qt,f),o(Qt,w)}function w(){c.forEach(function(W,E){m(W,E,-1)})}function f(){F(function(W){W.destroy()}),Wn(p)}function h(){F(function(W){W.update()})}function m(W,E,Z){var P=ru(e,E,Z,W);P.mount(),p.push(P),p.sort(function(U,V){return U.index-V.index})}function v(W){return W?B(function(E){return!E.isClone}):p}function M(W){var E=t.Controller,Z=E.toIndex(W),P=E.hasFocus()?1:n.perPage;return B(function(U){return nr(U.index,Z,Z+P-1)})}function R(W){return B(W)[0]}function L(W,E){yn(W,function(Z){if(qn(Z)&&(Z=Fl(Z)),Pl(Z)){var P=c[E];P?Pa(Z,P):Io(u,Z),Tn(Z,n.classes.slide),C(Z,Vt(s,_i))}}),s(Qt)}function X(W){hi(B(W).map(function(E){return E.slide})),s(Qt)}function F(W,E){v(E).forEach(W)}function B(W){return p.filter(El(W)?W:function(E){return qn(W)?go(E.slide,W):Ea(Ro(W),E.index)})}function k(W,E,Z){F(function(P){P.style(W,E,Z)})}function C(W,E){var Z=ka(W,"img"),P=Z.length;P?Z.forEach(function(U){l(U,"load error",function(){--P||E()})}):E()}function j(W){return W?c.length:p.length}function x(){return p.length>n.perPage}return{mount:b,destroy:f,update:h,register:m,get:v,getIn:M,getAt:R,add:L,remove:X,forEach:F,filter:B,style:k,getLength:j,isEnough:x}}function su(e,t,n){var i=Kt(e),o=i.on,s=i.bind,l=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,p=u.root,b=u.track,w=u.list,f=d.getAt,h=d.style,m,v,M;function R(){L(),s(window,"resize load",zd(Vt(l,_i))),o([an,Qt],L),o(_i,X)}function L(){m=n.direction===Cr,xn(p,"maxWidth",ii(n.width)),xn(b,c("paddingLeft"),F(!1)),xn(b,c("paddingRight"),F(!0)),X(!0)}function X(ie){var $=mn(p);(ie||v.width!==$.width||v.height!==$.height)&&(xn(b,"height",B()),h(c("marginRight"),ii(n.gap)),h("width",C()),h("height",j(),!0),v=$,l(vr),M!==(M=G())&&(En(p,cc,M),l(Dd,M)))}function F(ie){var $=n.padding,I=c(ie?"right":"left");return $&&ii($[I]||(mo($)?0:$))||"0px"}function B(){var ie="";return m&&(ie=k(),lo(ie,"height or heightRatio is missing."),ie="calc("+ie+" - "+F(!1)+" - "+F(!0)+")"),ie}function k(){return ii(n.height||mn(w).width*n.heightRatio)}function C(){return n.autoWidth?null:ii(n.fixedWidth)||(m?"":x())}function j(){return ii(n.fixedHeight)||(m?n.autoHeight?null:x():k())}function x(){var ie=ii(n.gap);return"calc((100%"+(ie&&" + "+ie)+")/"+(n.perPage||1)+(ie&&" - "+ie)+")"}function W(){return mn(w)[c("width")]}function E(ie,$){var I=f(ie||0);return I?mn(I.slide)[c("width")]+($?0:U()):0}function Z(ie,$){var I=f(ie);if(I){var D=mn(I.slide)[c("right")],se=mn(w)[c("left")];return ln(D-se)+($?0:U())}return 0}function P(ie){return Z(e.length-1)-Z(0)+E(0,ie)}function U(){var ie=f(0);return ie&&parseFloat(xn(ie.slide,c("marginRight")))||0}function V(ie){return parseFloat(xn(b,c("padding"+(ie?"Right":"Left"))))||0}function G(){return e.is(ko)||P(!0)>W()}return{mount:R,resize:X,listSize:W,slideSize:E,sliderSize:P,totalSize:Z,getPadding:V,isOverflow:G}}var lu=2;function cu(e,t,n){var i=Kt(e),o=i.on,s=t.Elements,l=t.Slides,d=t.Direction.resolve,c=[],u;function p(){o(Qt,b),o([an,_i],f),(u=v())&&(h(u),t.Layout.resize(!0))}function b(){w(),p()}function w(){hi(c),Wn(c),i.destroy()}function f(){var M=v();u!==M&&(u<M||!M)&&i.emit(Qt)}function h(M){var R=l.get().slice(),L=R.length;if(L){for(;R.length<M;)tr(R,R);tr(R.slice(-M),R.slice(0,M)).forEach(function(X,F){var B=F<M,k=m(X.slide,F);B?Pa(k,R[0].slide):Io(s.list,k),tr(c,k),l.register(k,F-M+(B?0:L),X.index)})}}function m(M,R){var L=M.cloneNode(!0);return Tn(L,n.classes.clone),L.id=e.root.id+"-clone"+Fa(R+1),L}function v(){var M=n.clones;if(!e.is(Yi))M=0;else if(Lo(M)){var R=n[d("fixedWidth")]&&t.Layout.slideSize(0),L=R&&vo(mn(s.track)[d("width")]/R);M=L||n[d("autoWidth")]&&e.length||n.perPage*lu}return M}return{mount:p,destroy:w}}function du(e,t,n){var i=Kt(e),o=i.on,s=i.emit,l=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,p=d.totalSize,b=d.listSize,w=d.sliderSize,f=t.Direction,h=f.resolve,m=f.orient,v=t.Elements,M=v.list,R=v.track,L;function X(){L=t.Transition,o([Jn,vr,an,Qt],F)}function F(){t.Controller.isBusy()||(t.Scroll.cancel(),k(e.index),t.Slides.update())}function B(I,D,se,oe){I!==D&&ie(I>se)&&(W(),C(x(P(),I>se),!0)),l(Ki),s(_n,D,se,I),L.start(D,function(){l(Wi),s(Xi,D,se,I),oe&&oe()})}function k(I){C(Z(I,!0))}function C(I,D){if(!e.is(ko)){var se=D?I:j(I);xn(M,"transform","translate"+h("X")+"("+se+"px)"),I!==se&&s(Zl)}}function j(I){if(e.is(Yi)){var D=E(I),se=D>t.Controller.getEnd(),oe=D<0;(oe||se)&&(I=x(I,se))}return I}function x(I,D){var se=I-G(D),oe=w();return I-=m(oe*(vo(ln(se)/oe)||1))*(D?1:-1),I}function W(){C(P(),!0),L.cancel()}function E(I){for(var D=t.Slides.get(),se=0,oe=1/0,T=0;T<D.length;T++){var ue=D[T].index,A=ln(Z(ue,!0)-I);if(A<=oe)oe=A,se=ue;else break}return se}function Z(I,D){var se=m(p(I-1)-V(I));return D?U(se):se}function P(){var I=h("left");return mn(M)[I]-mn(R)[I]+m(u(!1))}function U(I){return n.trimSpace&&e.is(Ni)&&(I=Li(I,0,m(w(!0)-b()))),I}function V(I){var D=n.focus;return D==="center"?(b()-c(I,!0))/2:+D*c(I)||0}function G(I){return Z(I?t.Controller.getEnd():0,!!n.trimSpace)}function ie(I){var D=m(x(P(),I));return I?D>=0:D<=M[h("scrollWidth")]-mn(R)[h("width")]}function $(I,D){D=Lo(D)?P():D;var se=I!==!0&&m(D)<m(G(!1)),oe=I!==!1&&m(D)>m(G(!0));return se||oe}return{mount:X,move:B,jump:k,translate:C,shift:x,cancel:W,toIndex:E,toPosition:Z,getPosition:P,getLimit:G,exceededLimit:$,reposition:F}}function uu(e,t,n){var i=Kt(e),o=i.on,s=i.emit,l=t.Move,d=l.getPosition,c=l.getLimit,u=l.toPosition,p=t.Slides,b=p.isEnough,w=p.getLength,f=n.omitEnd,h=e.is(Yi),m=e.is(Ni),v=Vt(P,!1),M=Vt(P,!0),R=n.start||0,L,X=R,F,B,k;function C(){j(),o([an,Qt,dr],j),o(vr,x)}function j(){F=w(!0),B=n.perMove,k=n.perPage,L=ie();var A=Li(R,0,f?L:F-1);A!==R&&(R=A,l.reposition())}function x(){L!==ie()&&s(dr)}function W(A,ne,J){if(!ue()){var ve=Z(A),Ee=G(ve);Ee>-1&&(ne||Ee!==R)&&(se(Ee),l.move(ve,Ee,X,J))}}function E(A,ne,J,ve){t.Scroll.scroll(A,ne,J,function(){var Ee=G(l.toIndex(d()));se(f?Un(Ee,L):Ee),ve&&ve()})}function Z(A){var ne=R;if(qn(A)){var J=A.match(/([+\-<>])(\d+)?/)||[],ve=J[1],Ee=J[2];ve==="+"||ve==="-"?ne=U(R+ +(""+ve+(+Ee||1)),R):ve===">"?ne=Ee?$(+Ee):v(!0):ve==="<"&&(ne=M(!0))}else ne=h?A:Li(A,0,L);return ne}function P(A,ne){var J=B||(T()?1:k),ve=U(R+J*(A?-1:1),R,!(B||T()));return ve===-1&&m&&!_l(d(),c(!A),1)?A?0:L:ne?ve:G(ve)}function U(A,ne,J){if(b()||T()){var ve=V(A);ve!==A&&(ne=A,A=ve,J=!1),A<0||A>L?!B&&(nr(0,A,ne,!0)||nr(L,ne,A,!0))?A=$(I(A)):h?A=J?A<0?-(F%k||k):F:A:n.rewind?A=A<0?L:0:A=-1:J&&A!==ne&&(A=$(I(ne)+(A<ne?-1:1)))}else A=-1;return A}function V(A){if(m&&n.trimSpace==="move"&&A!==R)for(var ne=d();ne===u(A,!0)&&nr(A,0,e.length-1,!n.rewind);)A<R?--A:++A;return A}function G(A){return h?(A+F)%F||0:A}function ie(){for(var A=F-(T()||h&&B?1:k);f&&A-- >0;)if(u(F-1,!0)!==u(A,!0)){A++;break}return Li(A,0,F-1)}function $(A){return Li(T()?A:k*A,0,L)}function I(A){return T()?Un(A,L):cr((A>=L?F-1:A)/k)}function D(A){var ne=l.toIndex(A);return m?Li(ne,0,L):ne}function se(A){A!==R&&(X=R,R=A)}function oe(A){return A?X:R}function T(){return!Lo(n.focus)||n.isNavigation}function ue(){return e.state.is([Ki,To])&&!!n.waitForTransition}return{mount:C,go:W,scroll:E,getNext:v,getPrev:M,getAdjacent:P,getEnd:ie,setIndex:se,getIndex:oe,toIndex:$,toPage:I,toDest:D,hasFocus:T,isBusy:ue}}var pu="http://www.w3.org/2000/svg",mu="m15.5 0.932-4.3 4.38 14.5 14.6-14.5 14.5 4.3 4.4 14.6-14.6 4.4-4.3-4.4-4.4-14.6-14.6z",Ho=40;function gu(e,t,n){var i=Kt(e),o=i.on,s=i.bind,l=i.emit,d=n.classes,c=n.i18n,u=t.Elements,p=t.Controller,b=u.arrows,w=u.track,f=b,h=u.prev,m=u.next,v,M,R={};function L(){F(),o(an,X)}function X(){B(),L()}function F(){var E=n.arrows;E&&!(h&&m)&&j(),h&&m&&(fo(R,{prev:h,next:m}),yo(f,E?"":"none"),Tn(f,M=Va+"--"+n.direction),E&&(k(),W(),St([h,m],Po,w.id),l(Gl,h,m)))}function B(){i.destroy(),Pn(f,M),v?(hi(b?[h,m]:f),h=m=null):Ln([h,m],Ba)}function k(){o([Jn,Xi,Qt,vi,dr],W),s(m,"click",Vt(C,">")),s(h,"click",Vt(C,"<"))}function C(E){p.go(E,!0)}function j(){f=b||Pi("div",d.arrows),h=x(!0),m=x(!1),v=!0,Io(f,[h,m]),!b&&Pa(f,w)}function x(E){var Z='<button class="'+d.arrow+" "+(E?d.prev:d.next)+'" type="button"><svg xmlns="'+pu+'" viewBox="0 0 '+Ho+" "+Ho+'" width="'+Ho+'" height="'+Ho+'" focusable="false"><path d="'+(n.arrowPath||mu)+'" />';return Fl(Z)}function W(){if(h&&m){var E=e.index,Z=p.getPrev(),P=p.getNext(),U=Z>-1&&E<Z?c.last:c.prev,V=P>-1&&E>P?c.first:c.next;h.disabled=Z<0,m.disabled=P<0,St(h,hn,U),St(m,hn,V),l(ql,h,m,Z,P)}}return{arrows:R,mount:L,destroy:B,update:W}}var hu=Aa+"-interval";function fu(e,t,n){var i=Kt(e),o=i.on,s=i.bind,l=i.emit,d=br(n.interval,e.go.bind(e,">"),k),c=d.isPaused,u=t.Elements,p=t.Elements,b=p.root,w=p.toggle,f=n.autoplay,h,m,v=f==="pause";function M(){f&&(R(),w&&St(w,Po,u.track.id),v||L(),B())}function R(){n.pauseOnHover&&s(b,"mouseenter mouseleave",function(j){h=j.type==="mouseenter",F()}),n.pauseOnFocus&&s(b,"focusin focusout",function(j){m=j.type==="focusin",F()}),w&&s(w,"click",function(){v?L():X(!0)}),o([_n,xr,Qt],d.rewind),o(_n,C)}function L(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),m=h=v=!1,B(),l(Ha))}function X(j){j===void 0&&(j=!0),v=!!j,B(),c()||(d.pause(),l(Oa))}function F(){v||(h||m?X(!1):L())}function B(){w&&(En(w,fi,!v),St(w,hn,n.i18n[v?"play":"pause"]))}function k(j){var x=u.bar;x&&xn(x,"width",j*100+"%"),l(Xl,j)}function C(j){var x=t.Slides.getAt(j);d.set(x&&+bn(x.slide,hu)||n.interval)}return{mount:M,destroy:d.cancel,play:L,pause:X,isPaused:c}}function yu(e,t,n){var i=Kt(e),o=i.on;function s(){n.cover&&(o(Da,Vt(d,!0)),o([Jn,an,Qt],Vt(l,!0)))}function l(c){t.Slides.forEach(function(u){var p=Mo(u.container||u.slide,"img");p&&p.src&&d(c,p,u)})}function d(c,u,p){p.style("background",c?'center/cover no-repeat url("'+u.src+'")':"",!0),yo(u,c?"none":"")}return{mount:s,destroy:Vt(l,!1)}}var vu=10,xu=600,bu=.6,wu=1.5,Su=800;function $u(e,t,n){var i=Kt(e),o=i.on,s=i.emit,l=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,p=d.exceededLimit,b=d.translate,w=e.is(Ni),f,h,m=1;function v(){o(_n,X),o([an,Qt],F)}function M(k,C,j,x,W){var E=c();if(X(),j&&(!w||!p())){var Z=t.Layout.sliderSize(),P=ha(k)*Z*cr(ln(k)/Z)||0;k=d.toPosition(t.Controller.toDest(k%Z))+P}var U=_l(E,k,1);m=1,C=U?0:C||lr(ln(k-E)/wu,Su),h=x,f=br(C,R,Vt(L,E,k,W),1),l(To),s(xr),f.start()}function R(){l(Wi),h&&h(),s(vi)}function L(k,C,j,x){var W=c(),E=k+(C-k)*B(x),Z=(E-W)*m;b(W+Z),w&&!j&&p()&&(m*=bu,ln(Z)<vu&&M(u(p(!0)),xu,!1,h,!0))}function X(){f&&f.cancel()}function F(){f&&!f.isPaused()&&(X(),R())}function B(k){var C=n.easingFunc;return C?C(k):1-Math.pow(1-k,4)}return{mount:v,destroy:X,scroll:M,cancel:F}}var Ri={passive:!1,capture:!0};function Cu(e,t,n){var i=Kt(e),o=i.on,s=i.emit,l=i.bind,d=i.unbind,c=e.state,u=t.Move,p=t.Scroll,b=t.Controller,w=t.Elements.track,f=t.Media.reduce,h=t.Direction,m=h.resolve,v=h.orient,M=u.getPosition,R=u.exceededLimit,L,X,F,B,k,C=!1,j,x,W;function E(){l(w,Dr,ma,Ri),l(w,jr,ma,Ri),l(w,dc,P,Ri),l(w,"click",G,{capture:!0}),l(w,"dragstart",Mn),o([Jn,an],Z)}function Z(){var q=n.drag;de(!q),B=q==="free"}function P(q){if(j=!1,!x){var Q=Ee(q);ve(q.target)&&(Q||!q.button)&&(b.isBusy()?Mn(q,!0):(W=Q?w:window,k=c.is([Ki,To]),F=null,l(W,Dr,U,Ri),l(W,jr,V,Ri),u.cancel(),p.cancel(),ie(q)))}}function U(q){if(c.is(er)||(c.set(er),s(zl)),q.cancelable)if(k){u.translate(L+J(T(q)));var Q=ue(q)>xs,Y=C!==(C=R());(Q||Y)&&ie(q),j=!0,s(Bl),Mn(q)}else D(q)&&(k=I(q),Mn(q))}function V(q){c.is(er)&&(c.set(Wi),s(Vl)),k&&($(q),Mn(q)),d(W,Dr,U),d(W,jr,V),k=!1}function G(q){!x&&j&&Mn(q,!0)}function ie(q){F=X,X=q,L=M()}function $(q){var Q=se(q),Y=oe(Q),_e=n.rewind&&n.rewindByDrag;f(!1),B?b.scroll(Y,0,n.snap):e.is(ko)?b.go(v(ha(Q))<0?_e?"<":"-":_e?">":"+"):e.is(Ni)&&C&&_e?b.go(R(!0)?">":"<"):b.go(b.toDest(Y),!0),f(!0)}function I(q){var Q=n.dragMinThreshold,Y=mo(Q),_e=Y&&Q.mouse||0,Ce=(Y?Q.touch:+Q)||10;return ln(T(q))>(Ee(q)?Ce:_e)}function D(q){return ln(T(q))>ln(T(q,!0))}function se(q){if(e.is(Yi)||!C){var Q=ue(q);if(Q&&Q<xs)return T(q)/Q}return 0}function oe(q){return M()+ha(q)*Un(ln(q)*(n.flickPower||600),B?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function T(q,Q){return ne(q,Q)-ne(A(q),Q)}function ue(q){return ga(q)-ga(A(q))}function A(q){return X===q&&F||X}function ne(q,Q){return(Ee(q)?q.changedTouches[0]:q)["page"+m(Q?"Y":"X")]}function J(q){return q/(C&&e.is(Ni)?iu:1)}function ve(q){var Q=n.noDrag;return!go(q,"."+rc+", ."+Lr)&&(!Q||!go(q,Q))}function Ee(q){return typeof TouchEvent<"u"&&q instanceof TouchEvent}function me(){return k}function de(q){x=q}return{mount:E,disable:de,isDragging:me}}var Tu={Spacebar:" ",Right:$r,Left:Sr,Up:Jl,Down:Ql};function Ga(e){return e=qn(e)?e:e.key,Tu[e]||e}var bs="keydown";function Lu(e,t,n){var i=Kt(e),o=i.on,s=i.bind,l=i.unbind,d=e.root,c=t.Direction.resolve,u,p;function b(){w(),o(an,f),o(an,w),o(_n,m)}function w(){var M=n.keyboard;M&&(u=M==="global"?window:d,s(u,bs,v))}function f(){l(u,bs)}function h(M){p=M}function m(){var M=p;p=!0,Ml(function(){p=M})}function v(M){if(!p){var R=Ga(M);R===c(Sr)?e.go("<"):R===c($r)&&e.go(">")}}return{mount:b,destroy:f,disable:h}}var co=Aa+"-lazy",ir=co+"-srcset",Ru="["+co+"], ["+ir+"]";function Iu(e,t,n){var i=Kt(e),o=i.on,s=i.off,l=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[Xi,vi],p=[];function b(){n.lazyLoad&&(w(),o(Qt,w))}function w(){Wn(p),f(),c?M():(s(u),o(u,h),h())}function f(){t.Slides.forEach(function(R){ka(R.slide,Ru).forEach(function(L){var X=bn(L,co),F=bn(L,ir);if(X!==L.src||F!==L.srcset){var B=n.classes.spinner,k=L.parentElement,C=Mo(k,"."+B)||Pi("span",B,k);p.push([L,R,C]),L.src||yo(L,"none")}})})}function h(){p=p.filter(function(R){var L=n.perPage*((n.preloadPages||1)+1)-1;return R[1].isWithin(e.index,L)?m(R):!0}),p.length||s(u)}function m(R){var L=R[0];Tn(R[1].slide,xa),l(L,"load error",Vt(v,R)),St(L,"src",bn(L,co)),St(L,"srcset",bn(L,ir)),Ln(L,co),Ln(L,ir)}function v(R,L){var X=R[0],F=R[1];Pn(F.slide,xa),L.type!=="error"&&(hi(R[2]),yo(X,""),d(Da,X,F),d(_i)),c&&M()}function M(){p.length&&m(p.shift())}return{mount:b,destroy:Vt(Wn,p),check:h}}function Mu(e,t,n){var i=Kt(e),o=i.on,s=i.emit,l=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,p=u.hasFocus,b=u.getIndex,w=u.go,f=t.Direction.resolve,h=c.pagination,m=[],v,M;function R(){L(),o([an,Qt,dr],R);var x=n.pagination;h&&yo(h,x?"":"none"),x&&(o([_n,xr,vi],j),X(),j(),s(Ul,{list:v,items:m},C(e.index)))}function L(){v&&(hi(h?Zn(v.children):v),Pn(v,M),Wn(m),v=null),i.destroy()}function X(){var x=e.length,W=n.classes,E=n.i18n,Z=n.perPage,P=p()?u.getEnd()+1:vo(x/Z);v=h||Pi("ul",W.pagination,c.track.parentElement),Tn(v,M=Rr+"--"+k()),St(v,kn,"tablist"),St(v,hn,E.select),St(v,za,k()===Cr?"vertical":"");for(var U=0;U<P;U++){var V=Pi("li",null,v),G=Pi("button",{class:W.page,type:"button"},V),ie=d.getIn(U).map(function(I){return I.slide.id}),$=!p()&&Z>1?E.pageX:E.slideX;l(G,"click",Vt(F,U)),n.paginationKeyboard&&l(G,"keydown",Vt(B,U)),St(V,kn,"presentation"),St(G,kn,"tab"),St(G,Po,ie.join(" ")),St(G,hn,fa($,U+1)),St(G,ki,-1),m.push({li:V,button:G,page:U})}}function F(x){w(">"+x,!0)}function B(x,W){var E=m.length,Z=Ga(W),P=k(),U=-1;Z===f($r,!1,P)?U=++x%E:Z===f(Sr,!1,P)?U=(--x+E)%E:Z==="Home"?U=0:Z==="End"&&(U=E-1);var V=m[U];V&&(Al(V.button),w(">"+U),Mn(W,!0))}function k(){return n.paginationDirection||n.direction}function C(x){return m[u.toPage(x)]}function j(){var x=C(b(!0)),W=C(b());if(x){var E=x.button;Pn(E,fi),Ln(E,gs),St(E,ki,-1)}if(W){var Z=W.button;Tn(Z,fi),St(Z,gs,!0),St(Z,ki,"")}s(Kl,{list:v,items:m},x,W)}return{items:m,mount:R,destroy:L,getAt:C,update:j}}var Eu=[" ","Enter"];function Pu(e,t,n){var i=n.isNavigation,o=n.slideFocus,s=[];function l(){e.splides.forEach(function(h){h.isParent||(u(e,h.splide),u(h.splide,e))}),i&&p()}function d(){s.forEach(function(h){h.destroy()}),Wn(s)}function c(){d(),l()}function u(h,m){var v=Kt(h);v.on(_n,function(M,R,L){m.go(m.is(Yi)?L:M)}),s.push(v)}function p(){var h=Kt(e),m=h.on;m(Wa,w),m(Yl,f),m([Jn,an],b),s.push(h),h.emit(Na,e.splides)}function b(){St(t.Elements.list,za,n.direction===Cr?"vertical":"")}function w(h){e.go(h.index)}function f(h,m){Ea(Eu,Ga(m))&&(w(h),Mn(m))}return{setup:Vt(t.Media.set,{slideFocus:Lo(o)?i:o},!0),mount:l,destroy:d,remount:c}}function ku(e,t,n){var i=Kt(e),o=i.bind,s=0;function l(){n.wheel&&o(t.Elements.track,"wheel",d,Ri)}function d(u){if(u.cancelable){var p=u.deltaY,b=p<0,w=ga(u),f=n.wheelMinThreshold||0,h=n.wheelSleep||0;ln(p)>f&&w-s>h&&(e.go(b?"<":">"),s=w),c(b)&&Mn(u)}}function c(u){return!n.releaseWheel||e.state.is(Ki)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var Au=90;function Fu(e,t,n){var i=Kt(e),o=i.on,s=t.Elements.track,l=n.live&&!n.isNavigation,d=Pi("span",Jd),c=br(Au,Vt(p,!1));function u(){l&&(w(!t.Autoplay.isPaused()),St(s,ys,!0),d.textContent="…",o(Ha,Vt(w,!0)),o(Oa,Vt(w,!1)),o([Xi,vi],Vt(p,!0)))}function p(f){St(s,fs,f),f?(Io(s,d),c.start()):(hi(d),c.cancel())}function b(){Ln(s,[hs,ys,fs]),hi(d)}function w(f){l&&St(s,hs,f?"off":"polite")}return{mount:u,disable:w,destroy:b}}var Wu=Object.freeze({__proto__:null,Media:Bd,Direction:Vd,Elements:ou,Slides:au,Layout:su,Clones:cu,Move:du,Controller:uu,Arrows:gu,Autoplay:fu,Cover:yu,Scroll:$u,Drag:Cu,Keyboard:Lu,LazyLoad:Iu,Pagination:Mu,Sync:Pu,Wheel:ku,Live:Fu}),_u={prev:"Previous slide",next:"Next slide",first:"Go to first slide",last:"Go to last slide",slideX:"Go to slide %s",pageX:"Go to page %s",play:"Start autoplay",pause:"Pause autoplay",carousel:"carousel",slide:"slide",select:"Select a slide to show",slideLabel:"%s of %s"},Nu={type:"slide",role:"region",speed:400,perPage:1,cloneStatus:!0,arrows:!0,pagination:!0,paginationKeyboard:!0,interval:5e3,pauseOnHover:!0,pauseOnFocus:!0,resetProgress:!0,easing:"cubic-bezier(0.25, 1, 0.5, 1)",drag:!0,direction:"ltr",trimSpace:!0,focusableNodes:"a, button, textarea, input, select, iframe",live:!0,classes:tu,i18n:_u,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Hu(e,t,n){var i=t.Slides;function o(){Kt(e).on([Jn,Qt],s)}function s(){i.forEach(function(d){d.style("transform","translateX(-"+100*d.index+"%)")})}function l(d,c){i.style("transition","opacity "+n.speed+"ms "+n.easing),Ml(c)}return{mount:o,start:l,cancel:ma}}function Ou(e,t,n){var i=t.Move,o=t.Controller,s=t.Scroll,l=t.Elements.list,d=Vt(xn,l,"transition"),c;function u(){Kt(e).bind(l,"transitionend",function(f){f.target===l&&c&&(b(),c())})}function p(f,h){var m=i.toPosition(f,!0),v=i.getPosition(),M=w(f);ln(m-v)>=1&&M>=1?n.useScroll?s.scroll(m,M,!1,h):(d("transform "+M+"ms "+n.easing),i.translate(m,!0),c=h):(i.jump(f),h())}function b(){d(""),s.cancel()}function w(f){var h=n.rewindSpeed;if(e.is(Ni)&&h){var m=o.getIndex(!0),v=o.getEnd();if(m===0&&f>=v||m>=v&&f===0)return h}return n.speed}return{mount:u,start:p,cancel:b}}var Du=(function(){function e(n,i){this.event=Kt(),this.Components={},this.state=jd(Ei),this.splides=[],this._o={},this._E={};var o=qn(n)?Wl(document,n):n;lo(o,o+" is invalid."),this.root=o,i=zn({label:bn(o,hn)||"",labelledby:bn(o,ja)||""},Nu,e.defaults,i||{});try{zn(i,JSON.parse(bn(o,Aa)))}catch{lo(!1,"Invalid JSON")}this._o=Object.create(zn({},i))}var t=e.prototype;return t.mount=function(i,o){var s=this,l=this.state,d=this.Components;lo(l.is([Ei,sr]),"Already mounted!"),l.set(Ei),this._C=d,this._T=o||this._T||(this.is(ko)?Hu:Ou),this._E=i||this._E;var c=fo({},Wu,this._E,{Transition:this._T});return mi(c,function(u,p){var b=u(s,d,s._o);d[p]=b,b.setup&&b.setup()}),mi(d,function(u){u.mount&&u.mount()}),this.emit(Jn),Tn(this.root,Qd),l.set(Wi),this.emit(ya),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(Wi)&&(this._C.Sync.remount(),i.Components.Sync.remount()),this},t.go=function(i){return this._C.Controller.go(i),this},t.on=function(i,o){return this.event.on(i,o),this},t.off=function(i){return this.event.off(i),this},t.emit=function(i){var o;return(o=this.event).emit.apply(o,[i].concat(Zn(arguments,1))),this},t.add=function(i,o){return this._C.Slides.add(i,o),this},t.remove=function(i){return this._C.Slides.remove(i),this},t.is=function(i){return this._o.type===i},t.refresh=function(){return this.emit(Qt),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,s=this.state;return s.is(Ei)?Kt(this).on(ya,this.destroy.bind(this,i)):(mi(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(_a),o.destroy(),i&&Wn(this.splides),s.set(sr)),this},_d(e,[{key:"options",get:function(){return this._o},set:function(i){this._C.Media.set(i,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e})(),qa=Du;qa.defaults={};qa.STATES=Hd;var ws=[[Jn,"onMounted"],[ya,"onReady"],[_n,"onMove"],[Xi,"onMoved"],[Wa,"onClick"],[Hl,"onActive"],[Ol,"onInactive"],[Dl,"onVisible"],[jl,"onHidden"],[Qt,"onRefresh"],[an,"onUpdated"],[_i,"onResize"],[vr,"onResized"],[zl,"onDrag"],[Bl,"onDragging"],[Vl,"onDragged"],[xr,"onScroll"],[vi,"onScrolled"],[_a,"onDestroy"],[Gl,"onArrowsMounted"],[ql,"onArrowsUpdated"],[Ul,"onPaginationMounted"],[Kl,"onPaginationUpdated"],[Na,"onNavigationMounted"],[Ha,"onAutoplayPlay"],[Xl,"onAutoplayPlaying"],[Oa,"onAutoplayPause"],[Da,"onLazyLoadLoaded"]];function Ua(...e){return e.filter(Boolean).join(" ")}function ur(e){return e!==null&&typeof e=="object"}function ba(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!ba(n,t[i]));if(ur(e)&&ur(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!ba(e[o],t[o]))}return e===t}function ju(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function zu(e,t){if(e){const n=Object.keys(e);for(let i=0;i<n.length;i++){const o=n[i];if(o!=="__proto__"&&t(e[o],o)===!1)break}}return e}function wa(e,t){const n=e;return zu(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():ur(i)?n[o]=wa(ur(n[o])?n[o]:{},i):n[o]=i}),n}var Bu=({children:e,className:t,...n})=>a.createElement("div",{className:Ua("splide__track",t),...n},a.createElement("ul",{className:"splide__list"},e)),Ka=class extends a.Component{constructor(){super(...arguments),this.splideRef=a.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:i}=this.splideRef;i&&(this.splide=new qa(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=wa({},e||{}),this.slides=this.getSlides())}componentWillUnmount(){this.splide&&(this.splide.destroy(),this.splide=void 0),this.options=void 0,this.slides.length=0}componentDidUpdate(){if(!this.splide)return;const{options:e}=this.props;e&&!ba(this.options,e)&&(this.splide.options=e,this.options=wa({},e));const t=this.getSlides();ju(this.slides,t)||(this.splide.refresh(),this.slides=t)}sync(e){var t;(t=this.splide)==null||t.sync(e)}go(e){var t;(t=this.splide)==null||t.go(e)}getSlides(){var e;if(this.splide){const t=(e=this.splide.Components.Elements)==null?void 0:e.list.children;return t&&Array.prototype.slice.call(t)||[]}return[]}bind(e){ws.forEach(([t,n])=>{const i=this.props[n];typeof i=="function"&&e.on(t,(...o)=>{i(e,...o)})})}omit(e,t){return t.forEach(n=>{Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}),e}render(){const{className:e,tag:t="div",hasTrack:n=!0,children:i,...o}=this.props;return a.createElement(t,{className:Ua("splide",e),ref:this.splideRef,...this.omit(o,["options",...ws.map(s=>s[1])])},n?a.createElement(Bu,null,i):i)}},Xa=({children:e,className:t,...n})=>a.createElement("li",{className:Ua("splide__slide",t),...n},e);/*!
2
2
  * Splide.js
3
3
  * Version : 4.1.3
4
4
  * License : MIT
5
5
  * Copyright: 2022 Naotoshi Fujita
6
- */const Vu="RichTextRenderer-module__link___BWeZ2",Gu={link:Vu},qu=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))},Ir=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>qu(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function on(e){const{color:t,...n}=e;return n}function Ut(e,t){var o,s,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:Ir(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:S.scalingValue(e.letterSpacing,t),wordSpacing:S.scalingValue(e.wordSpacing,t),fontSize:S.scalingValue(n,t),lineHeight:i!==void 0?S.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(s=e.textAppearance)==null?void 0:s.textDecoration,fontVariant:(l=e.textAppearance)==null?void 0:l.fontVariant,textAlign:e.textAlign,color:e.color}}const yi=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?r.jsx("a",{className:Gu.link,href:i.value,target:i.target,children:t(i.children)},o):r.jsx("span",{style:Uu(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 Uu(e){return{...e.fontFamily&&{fontFamily:Ir(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 Ku="SvgImage-module__svg___q3xE-",Xu="SvgImage-module__img___VsTm-",Ss={svg:Ku,img:Xu},Yu=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},Zu=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,rn=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[s,l]=a.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return a.useEffect(()=>{if(typeof window<"u"&&window.CSS){const d=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');l(d)}},[]),!Yu(e)||!s?r.jsx("img",{src:e,alt:"",className:rt(Ss.img,i),style:o}):r.jsx("span",{"data-supports-mask":s,className:rt(Ss.svg,i),style:{"--svg":Zu(e),"--fill":t,"--hover-fill":n,...o??{}}})},Ju={"top-left":it.topLeftAlignment,"top-center":it.topCenterAlignment,"top-right":it.topRightAlignment,"middle-left":it.middleLeftAlignment,"middle-center":it.middleCenterAlignment,"middle-right":it.middleRightAlignment,"bottom-left":it.bottomLeftAlignment,"bottom-center":it.bottomCenterAlignment,"bottom-right":it.bottomRightAlignment};function Qu({settings:e,content:t,styles:n,isEditor:i}){const[o,s]=a.useState(null),{widthSettings:l,fontSettings:d,letterSpacing:c,textAlign:u,wordSpacing:p,fontSizeLineHeight:b,textAppearance:w,color:f}=n.imageCaption??{},[h,m]=a.useState(void 0),[v,M]=a.useState(null),[R,L]=a.useState(0),[X,A]=a.useState(0),{direction:B,transition:P,controls:C,pagination:j,imageCaption:x,triggers:W}=e,E=a.useRef(P.type),{x:Z,y:k}=e.controls.offset,U=V=>{o&&o.go(V)};return a.useEffect(()=>{if(!v)return;const V=new ResizeObserver(G=>{if(!o)return;const[ie]=G;m({width:Math.round(ie.contentRect.width),height:Math.round(ie.contentRect.height)})});return V.observe(v),()=>V.unobserve(v)},[v]),a.useEffect(()=>{!o||E.current===P.type||(A(V=>V+1),E.current=P.type)},[P.type]),r.jsx("div",{className:rt(it.wrapper,{[it.editor]:i}),ref:M,children:r.jsxs("div",{className:it.sliderInner,style:{width:h?h.width:"100%",height:h?h.height:"100%",backgroundColor:P.backgroundColor&&P.type==="fade in"?P.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&r.jsx("div",{className:rt(it.captionBlock),children:r.jsx("div",{className:it.captionTextWrapper,children:t.map((V,G)=>r.jsx("div",{className:rt(it.captionText,Ju[x.alignment],{[it.withPointerEvents]:G===R&&i,[it.active]:G===R}),style:{fontFamily:Ir(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":S.scalingValue(l.width,i),letterSpacing:S.scalingValue(c,i),wordSpacing:S.scalingValue(p,i),textAlign:u,fontSize:S.scalingValue(b.fontSize,i),lineHeight:S.scalingValue(b.lineHeight,i),textTransform:w.textTransform??"none",textDecoration:w.textDecoration??"none",fontVariant:w.fontVariant??"normal",color:f,transitionDuration:P.duration?`${Math.round(parseInt(P.duration)/2)}ms`:"500ms"},children:r.jsx("div",{"data-styles":"imageCaption",className:it.captionTextInner,style:{"--link-hover-color":x.linkHoverColor,"--link-color":x.linkColor,position:"relative",top:S.scalingValue(x.offset.y,i),left:S.scalingValue(x.offset.x,i)},children:r.jsx(yi,{content:V.imageCaption})})},G))})}),r.jsx(Ka,{onMove:V=>{L(V.index)},ref:s,options:{arrows:!1,speed:P.duration?parseInt(P.duration):500,autoplay:W.autoPlay!==null,...W.autoPlay!==null&&{interval:parseInt(W.autoPlay)*1e3},direction:B==="horiz"||P.type==="fade in"?"ltr":"ttb",pagination:!1,drag:W.triggersList.drag,perPage:1,width:h?h.width:"100%",height:h?h.height:"100%",type:P.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((V,G)=>r.jsx(Xa,{children:r.jsx("div",{className:it.sliderItem,children:r.jsx("div",{className:it.imgWrapper,children:r.jsx("img",{className:rt(it.sliderImage,{[it.contain]:V.image.objectFit==="contain",[it.cover]:V.image.objectFit==="cover"}),src:V.image.url,alt:V.image.name??""})})})},G))},X),C.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:rt(it.arrow,{[it.arrowVertical]:B==="vert",[it.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:r.jsxs("button",{onClick:()=>{U("-1")},className:it.arrowInner,style:{transform:`translate(${S.scalingValue(Z,i)}, ${S.scalingValue(k*(B==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&r.jsx(rn,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:rt(it.arrowImg,it.mirror)}),!C.arrowsImgUrl&&r.jsx($s,{color:C.color,className:rt(it.arrowIcon,it.arrowImg,it.mirror)})]})}),r.jsx("div",{className:rt(it.arrow,it.nextArrow,{[it.arrowVertical]:B==="vert",[it.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:r.jsxs("button",{className:it.arrowInner,onClick:()=>U("+1"),style:{transform:`translate(${S.scalingValue(Z*(B==="horiz"?-1:1),i)}, ${S.scalingValue(k,i)}) scale(${e.controls.scale/100}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&r.jsx(rn,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:it.arrowImg}),!C.arrowsImgUrl&&r.jsx($s,{color:C.color,className:rt(it.arrowIcon,it.arrowImg)})]})})]}),W.triggersList.click&&r.jsx("div",{className:it.clickOverlay,onClick:()=>{o&&o.go("+1")}}),j.isActive&&r.jsx("div",{className:rt(it.pagination,{[it.paginationInsideBottom]:j.position==="inside-1"&&B==="horiz",[it.paginationInsideTop]:j.position==="inside-2"&&B==="horiz",[it.paginationOutsideBottom]:j.position==="outside-1"&&B==="horiz",[it.paginationOutsideTop]:j.position==="outside-2"&&B==="horiz",[it.paginationInsideLeft]:j.position==="inside-1"&&B==="vert",[it.paginationInsideRight]:j.position==="inside-2"&&B==="vert",[it.paginationOutsideLeft]:j.position==="outside-1"&&B==="vert",[it.paginationOutsideRight]:j.position==="outside-2"&&B==="vert",[it.paginationVertical]:B==="vert"}),children:r.jsx("div",{className:it.paginationInner,style:{backgroundColor:j.colors[2],transform:`scale(${j.scale/100}) translate(${S.scalingValue(j.offset.x,i)}, ${S.scalingValue(j.offset.y,i)}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:t.map((V,G)=>r.jsx("button",{onClick:()=>{o&&o.go(G)},className:rt(it.paginationItem),children:r.jsx("div",{className:rt(it.dot,{[it.activeDot]:G===R}),style:{backgroundColor:G===R?j.colors[0]:j.colors[1],"--pagination-hover-color":j.hover}})},G))})})]})})}function $s({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 ep={element:Qu,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"]}},tp="ImageRevealSlider-module__imageRevealSlider___UE5Ob",np="ImageRevealSlider-module__image___Qjt-e",ip="ImageRevealSlider-module__link___N-iLG",op="ImageRevealSlider-module__cursor___2U03d",wi={imageRevealSlider:tp,image:np,link:ip,cursor:op};function Cs(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,l=o.naturalHeight/o.naturalWidth*s,d=s/2,c=l/2;if(e>=i.x-d&&e<=i.x+d&&t>=i.y-c&&t<=i.y+c)return!0}return!1}function zr(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function rp(e,t,n,i){let o,s;if(t==="custom"){o=n;const l=await zr(e);s=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await zr(e);s=l.height/l.width*o}else{const l=await zr(e);o=l.width,s=l.height}return{width:o,height:s,finalWidth:`${o}px`}}function ap({settings:e,content:t,isEditor:n}){const[i,o]=a.useState(null),[s,l]=a.useState([]),[d,c]=a.useState(0),u=a.useRef(0),[p,b]=a.useState({x:0,y:0}),[w,f]=a.useState(1),[h,m]=a.useState("none"),v=a.useRef({x:0,y:0}),[M,R]=a.useState(!1),{sizeType:L,imageWidth:X,randomRangeImageWidth:A}=e.imageSize,{revealPosition:B,visible:P}=e.position,{cursorType:C,target:j,defaultCursorScale:x,defaultCursor:W,hoverCursorScale:E,hoverCursor:Z}=e.cursor;a.useEffect(()=>{if(!i)return;const V=($,I)=>{const D=i.getBoundingClientRect(),se=$-D.left,oe=I-D.top;if(b({x:se,y:oe}),C==="system"){m("none"),f(1);return}const T=se,ue=oe,F=document.elementFromPoint(D.left+T,D.top+ue);if(F&&F.closest("a")){m("none"),f(1);return}const ne=Cs(T,ue,s)||j==="area"?{img:Z??"none",scale:E}:{img:W??"none",scale:x};m(ne.img),f(ne.scale)},G=$=>{$.stopPropagation(),v.current={x:$.clientX,y:$.clientY},V($.clientX,$.clientY)},ie=()=>{M&&V(v.current.x,v.current.y)};return i.addEventListener("mousemove",G),window.addEventListener("scroll",ie,!0),()=>{i.removeEventListener("mousemove",G),window.removeEventListener("scroll",ie,!0)}},[i,M,p,C,j,Z,W,E,x,s]),a.useEffect(()=>{M||(m("none"),f(0))},[M]);const k=async(V,G,ie,$={})=>{const{width:I,height:D,finalWidth:se}=await rp(V.image.url,L,X,A);let oe=0,T=0;B==="same"?(oe=G/2,T=ie/2):(oe=$.x??Math.random()*G,T=$.y??Math.random()*ie);const ue=Math.min(Math.max(oe,I/2),G-I/2),F=Math.min(Math.max(T,D/2),ie-D/2);return{id:u.current++,url:V.image.url,link:V.link,name:V.image.name,x:ue,y:F,width:se}};a.useEffect(()=>{if(!i||t.length===0)return;const V=i.getBoundingClientRect(),G=V.width,ie=V.height,$=[];(async()=>{const D=t[0],se=await k(D,G,ie);$.push(se),l($),c(1)})()},[L,X,A,B,i]),a.useEffect(()=>{P==="last One"&&l(V=>V.length>0?[V[V.length-1]]:[])},[P]);const U=async V=>{if(!i)return;const G=i.getBoundingClientRect(),ie=V.clientX-G.left,$=V.clientY-G.top;if(j==="image"&&!Cs(ie,$,s))return;let I=0,D=0;B==="on Click"?(I=ie,D=$):B==="same"?(I=G.width/2,D=G.height/2):(I=Math.random()*G.width,D=Math.random()*G.height);const se=t[d],oe=await k(se,G.width,G.height,{x:I,y:D});l(T=>P==="all"?[...T,oe]:[oe]),c(T=>T>=t.length-1?0:T+1)};return r.jsxs("div",{ref:o,onClick:U,onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1),className:wi.imageRevealSlider,style:{cursor:h==="none"?"default":"none"},children:[s.map(V=>r.jsx("div",{className:wi.wrapper,style:{top:`${V.y}px`,left:`${V.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:V.width??"auto",height:"auto",cursor:h==="none"?"default":"none"},children:j==="area"&&V.link?r.jsx("a",{href:V.link,target:"_blank",className:wi.link,children:r.jsx("img",{src:V.url,alt:V.name,className:wi.image},V.id)}):r.jsx("img",{src:V.url,alt:V.name,className:wi.image},V.id)},V.id)),M&&r.jsx("div",{className:wi.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${w})`,backgroundImage:`url('${h}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const sp={element:ap,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:""}]}}}},lp="LightBox-module__hidden___9s-9x",cp="LightBox-module__heroImage___sTxNF",dp="LightBox-module__background___rm9ml",up="LightBox-module__editor___4ACaY",pp="LightBox-module__contentStyle___Bgnsq",mp="LightBox-module__imageStyle___tLIlB",gp="LightBox-module__imgWrapper___LuFUp",hp="LightBox-module__contain___8-yaS",fp="LightBox-module__cover___hNvOG",yp="LightBox-module__caption___b6L2I",vp="LightBox-module__captionTextInner___rCGNH",xp="LightBox-module__lightboxSplide___XFuWC",bp="LightBox-module__arrow___iz38X",wp="LightBox-module__arrowVertical___Zfz81",Sp="LightBox-module__nextArrow___zkAQN",$p="LightBox-module__arrowInner___p48sW",Cp="LightBox-module__arrowIcon___3VaFf",Tp="LightBox-module__arrowImg___pNV88",Lp="LightBox-module__mirror___pjeXc",Rp="LightBox-module__thumbsWrapper___GB-nU",Ip="LightBox-module__thumbsContainerVertical___wttk5",Mp="LightBox-module__thumbsContainer___osSma",Ep="LightBox-module__thumbsAlignStart___MO6tY",Pp="LightBox-module__thumbsAlignCenter___Q4sUx",kp="LightBox-module__thumbsAlignEnd___p4y9R",Ap="LightBox-module__thumbItem___HvnF3",Fp="LightBox-module__closeButton___g2khP",Wp="LightBox-module__fadeIn___0m5GW",_p="LightBox-module__slideInLeft___gPYwC",Np="LightBox-module__slideInRight___S-pPp",Hp="LightBox-module__slideInTop___DFdAj",Op="LightBox-module__slideInBottom___m27kZ",Dp="LightBox-module__fadeOut___55qBR",jp="LightBox-module__slideOutLeft___NvU7P",zp="LightBox-module__slideOutRight___SK7eC",Bp="LightBox-module__slideOutTop___Vgg0z",Vp="LightBox-module__slideOutBottom___nJ0Ef",Gp="LightBox-module__scaleSlide___vZriG",Ge={hidden:lp,heroImage:cp,background:dp,editor:up,contentStyle:pp,imageStyle:mp,imgWrapper:gp,contain:hp,cover:fp,caption:yp,captionTextInner:vp,lightboxSplide:xp,arrow:bp,arrowVertical:wp,nextArrow:Sp,arrowInner:$p,arrowIcon:Cp,arrowImg:Tp,mirror:Lp,thumbsWrapper:Rp,thumbsContainerVertical:Ip,thumbsContainer:Mp,thumbsAlignStart:Ep,thumbsAlignCenter:Pp,thumbsAlignEnd:kp,thumbItem:Ap,closeButton:Fp,fadeIn:Wp,slideInLeft:_p,slideInRight:Np,slideInTop:Hp,slideInBottom:Op,fadeOut:Dp,slideOutLeft:jp,slideOutRight:zp,slideOutTop:Bp,slideOutBottom:Vp,scaleSlide:Gp},Oo=(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% + ${S.scalingValue(t.x,n)}), calc(-50% + ${S.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${S.scalingValue(t.x,n)}, calc(-50% + ${S.scalingValue(t.y,n)}))`:s==="center"?i.transform=`translate(calc(-50% + ${S.scalingValue(t.x,n)}), ${S.scalingValue(t.y,n)})`:i.transform=`translate(${S.scalingValue(t.x,n)}, ${S.scalingValue(t.y,n)})`,i};function uc(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 qp(e){const t=e.trim().split(/\s+/),n=i=>{if(i.endsWith("%"))return parseFloat(i)/100;switch(i){case"left":case"top":return 0;case"right":case"bottom":return 1;case"center":return .5;default:return .5}};if(t.length===1){const i=t[0];return i==="center"?{x:.5,y:.5}:i==="top"||i==="bottom"?{x:.5,y:n(i)}:i==="left"||i==="right"?{x:n(i),y:.5}:{x:n(i),y:.5}}return{x:n(t[0]),y:n(t[1])}}function pc(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,s=n/i;if(s>o){const d=e;return{renderedW:d,renderedH:d/s}}const l=t;return{renderedW:l*s,renderedH:l}}function Up(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,s=n/i;if(s>o){const d=t;return{renderedW:d*s,renderedH:d}}const l=e;return{renderedW:l,renderedH:l/s}}function mc(e,t,n,i,o){const{x:s,y:l}=qp(o);return{offsetX:s*(e-n),offsetY:l*(t-i)}}function Kp(e){const t=e.getBoundingClientRect(),n=t.width,i=t.height;if(!n||!i)return"center center";const o=e instanceof HTMLVideoElement?e.videoWidth:e.naturalWidth,s=e instanceof HTMLVideoElement?e.videoHeight:e.naturalHeight,{objectFit:l,objectPosition:d}=window.getComputedStyle(e),c=l==="cover"?Up:pc,{renderedW:u,renderedH:p}=c(n,i,o,s),{offsetX:b,offsetY:w}=mc(n,i,u,p,d),f=(b+u/2)/n*100,h=(w+p/2)/i*100;return`${f}% ${h}%`}function Xp(e){return Kp(e)}function pr(e){const t=e.getBoundingClientRect(),n=uc(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),s=e.naturalWidth,l=e.naturalHeight,{renderedW:d,renderedH:c}=pc(i,o,s,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:b}=mc(i,o,d,c,u),w=t.left+n.left,f=t.top+n.top;return{x:p+w,y:b+f,width:d,height:c}}function Ts(e){const t=e.getBoundingClientRect(),n=uc(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Ls(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 Yp(e,t){const n=(()=>{if(e==="fade in")return Ge.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return Ge.slideInLeft;case"right":return Ge.slideInRight;case"top":return Ge.slideInTop;case"bottom":return Ge.slideInBottom;default:return Ge.slideInRight}return Ge.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return Ge.fadeIn;if(e==="slide in")switch(t){case"left":return Ge.slideInLeft;case"right":return Ge.slideInRight;case"top":return Ge.slideInTop;case"bottom":return Ge.slideInBottom;default:return Ge.slideInRight}return Ge.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return Ge.fadeOut;if(e==="slide in")switch(t){case"left":return Ge.slideOutLeft;case"right":return Ge.slideOutRight;case"top":return Ge.slideOutTop;case"bottom":return Ge.slideOutBottom;default:return Ge.slideOutRight}return Ge.fadeOut})(),s=(()=>{if(e==="fade in")return Ge.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return Ge.slideOutLeft;case"right":return Ge.slideOutRight;case"top":return Ge.slideOutTop;case"bottom":return Ge.slideOutBottom;default:return Ge.slideOutRight}return Ge.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:s}}const Zp=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:s,isPreviewMode:l})=>{const[d,c]=a.useState(!1),{url:u}=e.thumbnailBlock.cover;return a.useEffect(()=>{o==="close"&&c(!1),o==="open"&&c(!0)},[o]),r.jsxs(r.Fragment,{children:[r.jsx("img",{src:u,alt:"Cover",className:Ge.heroImage,onClick:()=>c(!0)}),r.jsx(Jp,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:s})]})},Jp=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:s,isEditor:l,metadata:d})=>{var we;const{widthSettings:c,fontSettings:u,letterSpacing:p,textAlign:b,wordSpacing:w,fontSizeLineHeight:f,textAppearance:h,color:m}=i.imageCaption??{},[v,M]=a.useState(0),[R,L]=a.useState(0),[X,A]=a.useState(!1),[B,P]=a.useState(!1),[C,j]=a.useState({}),x=a.useRef(null),W=a.useRef(null),E=a.useRef(null),Z=a.useRef(!1),k=a.useRef(null),U=a.useRef(null),V=a.useRef(null),G=a.useRef(null),ie=a.useRef(!1),$=a.useRef(null),[I,D]=a.useState(!1),{appear:se,triggers:oe,slider:T,thumbnail:ue,controls:F,area:ne,caption:J,layout:ve}=o.lightboxBlock,{appearClass:Ee,backdropAppearClass:me,backdropDisappearClass:de,disappearClass:q}=Yp(se.type,se.direction),Q=(d==null?void 0:d.itemId)??null;a.useEffect(()=>{const z=()=>{setTimeout(()=>{var he,xe;(xe=(he=x.current)==null?void 0:he.splide)==null||xe.refresh()},16)},le=()=>{L(he=>he+1)};return window.addEventListener("ArticleEditor.Layout:change",z),window.addEventListener("ArticleEditor.ComponentContent:change",le),()=>{window.removeEventListener("ArticleEditor.Layout:change",z),window.removeEventListener("ArticleEditor.ComponentContent:change",le)}},[]),a.useEffect(()=>{if(!e||!ue.isActive){D(!1);return}const z=$.current;if(!z)return;const le=()=>{T.direction==="horiz"?D(z.scrollWidth>z.clientWidth):D(z.scrollHeight>z.clientHeight)};le();const he=new ResizeObserver(le);return he.observe(z),()=>he.disconnect()},[e,ue.isActive,n.length,C,T.direction]);const Y=a.useCallback(()=>{const z=window.matchMedia("(max-width: 768px)").matches,le=Ls(ne.color);z&&!l&&le>.9&&(document.body.style.backgroundColor=""),A(!0),Z.current=!0;const he=xe=>{xe.target===k.current&&xe.animationName&&(k.current&&U.current&&k.current.removeEventListener("animationend",U.current),U.current=null,Z.current&&(Z.current=!1,t()),A(!1))};k.current&&(U.current=he,k.current.addEventListener("animationend",he))},[t,ne.color,l]),_e=(z,le,he)=>{var xe,Re;if(z){if(oe.type==="click"&&oe.switch==="image")oe.repeat==="close"&&v===n.length-1?Y():(xe=x.current)==null||xe.go("+1");else if(oe.type==="click"&&oe.switch==="50/50"){const Te=z.getBoundingClientRect(),_=le-Te.left,pe=he-Te.top,te=Te.width,N=Te.height;let ee;T.direction==="horiz"?ee=_<te/2?"-1":"+1":ee=pe<N/2?"-1":"+1",(Re=x.current)==null||Re.go(ee)}}},Ce=z=>{if(ie.current){ie.current=!1;return}const le=n[v],he=(le==null?void 0:le.image.objectFit)==="cover";let xe,Re;if("changedTouches"in z&&z.changedTouches.length>0)xe=z.changedTouches[0].clientX,Re=z.changedTouches[0].clientY;else if("clientX"in z)xe=z.clientX,Re=z.clientY;else return;let Te;if(he&&E.current){const _=Ts(E.current);Te=xe>=_.left&&xe<=_.right&&Re>=_.top&&Re<=_.bottom}else{const _=E.current?pr(E.current):null;if(!_){z.target===z.currentTarget&&Y();return}Te=xe>=_.x&&xe<=_.x+_.width&&Re>=_.y&&Re<=_.y+_.height}Te?_e(E.current,xe,Re):Y()},ke=z=>{const le=z.target;(le.classList.contains(Ge.thumbsWrapper)||le.classList.contains(Ge.thumbsContainer))&&Ce(z)};a.useEffect(()=>{if(!e)return;const z=le=>{var he,xe;if(le.key==="Escape"){Y();return}if(le.key==="ArrowRight"){M(Re=>(Re+1)%Math.max(n.length,1)),(he=x.current)==null||he.go("+1");return}le.key==="ArrowLeft"&&(M(Re=>(Re-1+Math.max(n.length,1))%Math.max(n.length,1)),(xe=x.current)==null||xe.go("-1"))};return window.addEventListener("keydown",z),()=>{window.removeEventListener("keydown",z)}},[e,Y,n.length]),a.useEffect(()=>{if(e){if(M(0),L(le=>le+1),Z.current=!1,A(!1),P(!1),j({}),!Q)return;const z=new CustomEvent("page-overlay",{detail:{itemId:Q}});window.dispatchEvent(z)}return()=>{k.current&&U.current&&(k.current.removeEventListener("animationend",U.current),U.current=null),P(!1)}},[e,Q]),a.useEffect(()=>{W.current!==null&&W.current!==T.type&&L(z=>z+1),W.current=T.type},[T.type]),a.useEffect(()=>{if(!e)return;const z=document.body.style.overflow,le=window.matchMedia("(max-width: 768px)").matches,he=Ls(ne.color);document.body.style.overflow="hidden",P(!1);const xe=Te=>{Te.target===k.current&&!Z.current&&Te.animationName&&(le&&!l&&he>.9&&(document.body.style.backgroundColor=ne.color),P(!0),k.current&&V.current&&k.current.removeEventListener("animationend",V.current),V.current=null)};k.current&&(V.current=xe,k.current.addEventListener("animationend",xe));const Re=Te=>{const _=Te.target;_&&(_.closest(`.${Ge.thumbsWrapper}`)||_.closest(`.${Ge.thumbsContainer}`))||T.type!=="slide"&&Te.preventDefault()};return document.addEventListener("touchmove",Re,{passive:!1}),()=>{document.body.style.overflow=z,document.removeEventListener("touchmove",Re),k.current&&V.current&&(k.current.removeEventListener("animationend",V.current),V.current=null),P(!1)}},[e,l,ne.color,T.type]),a.useEffect(()=>{if(!e)return;const z=le=>{var xe,Re;if(Z.current){le.stopPropagation();return}if(ie.current){ie.current=!1;return}const he=le.target;if(!(he&&(he.closest(`.${Ge.thumbsContainer}`)||he.closest(`.${Ge.thumbItem}`)||he.closest(`.${Ge.arrow}`)||he.closest(`.${Ge.closeButton}`)||he.closest(`.${Ge.caption}`)))){if(T.type==="slide"&&oe.type==="drag"&&((Re=(xe=x.current)==null?void 0:xe.splide)!=null&&Re.root)){const Te=x.current.splide.root;if(he&&(Te.contains(he)||Te===he))return}if(le.touches.length===0&&le.changedTouches.length>0){const Te=n[v],_=(Te==null?void 0:Te.image.objectFit)==="cover",pe=le.changedTouches[0];let te;if(_&&E.current){const N=Ts(E.current);te=pe.clientX>=N.left&&pe.clientX<=N.right&&pe.clientY>=N.top&&pe.clientY<=N.bottom}else{const N=E.current?pr(E.current):null;if(!N)return;te=pe.clientX>=N.x&&pe.clientX<=N.x+N.width&&pe.clientY>=N.y&&pe.clientY<=N.y+N.height}if(!te){le.stopPropagation(),Z.current=!0;const N=ee=>{ee.stopPropagation(),ee.preventDefault(),document.removeEventListener("click",N,!0)};document.addEventListener("click",N,!0),Y()}}}};return document.addEventListener("touchend",z,{passive:!0}),()=>{document.removeEventListener("touchend",z)}},[e,Y,v,n]);const ce=(T.type==="scale"||T.type==="fade")&&T.direction==="vert"&&oe.type==="drag";a.useEffect(()=>{var ee,Ie;if(!e||!ce||!((Ie=(ee=x.current)==null?void 0:ee.splide)!=null&&Ie.root))return;const z=x.current.splide.root,le=30,he=(re,O)=>{if(G.current){const Ve=Math.abs(re-G.current.x),Oe=Math.abs(O-G.current.y);(Ve>0||Oe>0)&&(ie.current=!0)}},xe=re=>{G.current&&(re.preventDefault(),he(re.clientX,re.clientY))},Re=re=>{G.current&&re.touches.length>0&&(re.preventDefault(),he(re.touches[0].clientX,re.touches[0].clientY))},Te=(re,O)=>{if(!G.current||!x.current){G.current=null;return}const Ve=Math.abs(re-G.current.x),Oe=Math.abs(O-G.current.y);Oe>le&&Oe>Ve&&x.current.go(O<G.current.y?"+1":"-1"),G.current=null},_=re=>{G.current&&Te(re.clientX,re.clientY),document.removeEventListener("pointerup",_),document.removeEventListener("pointercancel",_),document.removeEventListener("pointermove",xe)},pe=re=>{if(G.current){if(re.changedTouches.length>0){const O=re.changedTouches[0];Te(O.clientX,O.clientY)}document.removeEventListener("touchend",pe),document.removeEventListener("touchcancel",pe),document.removeEventListener("touchmove",Re)}},te=re=>{G.current={x:re.clientX,y:re.clientY},ie.current=!1,document.addEventListener("pointermove",xe,{passive:!1}),document.addEventListener("pointerup",_),document.addEventListener("pointercancel",_)},N=re=>{re.touches.length>0&&(G.current={x:re.touches[0].clientX,y:re.touches[0].clientY},ie.current=!1,document.addEventListener("touchmove",Re,{passive:!1}),document.addEventListener("touchend",pe),document.addEventListener("touchcancel",pe))};return z.addEventListener("pointerdown",te),z.addEventListener("touchstart",N),()=>{z.removeEventListener("pointerdown",te),z.removeEventListener("touchstart",N),document.removeEventListener("pointermove",xe),document.removeEventListener("pointerup",_),document.removeEventListener("pointercancel",_),document.removeEventListener("touchmove",Re),document.removeEventListener("touchend",pe),document.removeEventListener("touchcancel",pe),G.current=null,ie.current=!1}},[e,ce,R]);const ge={backgroundColor:ne.color,backdropFilter:`blur(${ne.blur}px)`,animationDuration:`${parseInt(se.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(s)?null:Yn.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:l?null:k,className:rt(Ge.background,X?de:me,{[Ge.editor]:l},{[Ge.hidden]:!e}),style:{...ge,...B&&!l&&!X?{position:"absolute"}:{}}}),r.jsxs("div",{ref:l?k:null,className:rt(Ge.contentStyle,X?q:Ee,{[Ge.editor]:l},{[Ge.hidden]:!e}),style:{animationDuration:`${parseInt(se.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[r.jsx(Ka,{onMove:z=>M(z.index),ref:x,className:Ge.lightboxSplide,options:{arrows:!1,speed:T.duration?parseInt(T.duration):500,direction:T.direction==="horiz"||T.type==="fade"||T.type==="scale"?"ltr":"ttb",pagination:!1,drag:oe.type==="drag"&&!ce,perPage:1,width:"100%",height:"100%",type:T.type==="fade"||T.type==="scale"?"fade":"loop",padding:0,rewind:oe.repeat!=="close",start:0},style:{"--splide-speed":T.duration},children:n.map((z,le)=>{const he=Oo(ve.position,ve.offset,l),xe=`${S.scalingValue(ve.padding.top,l)} ${S.scalingValue(ve.padding.right,l)} ${S.scalingValue(ve.padding.bottom,l)} ${S.scalingValue(ve.padding.left,l)}`,Re=T.type==="scale"?(()=>{const{transform:Te,..._}=he;return{..._,position:"absolute",padding:xe,boxSizing:"border-box","--position-transform":Te||"none"}})():{...he,position:"absolute",padding:xe,boxSizing:"border-box"};return r.jsx(Xa,{children:r.jsx("div",{className:Ge.imgWrapper,onClick:Ce,children:r.jsx("img",{ref:le===v?E:null,className:rt(Ge.imageStyle,{[Ge.contain]:z.image.objectFit==="contain",[Ge.cover]:z.image.objectFit==="cover",[Ge.scaleSlide]:T.type==="scale"}),src:z.image.url,alt:z.image.name??"",style:{...Re,pointerEvents:z.image.objectFit==="contain"?"none":"auto"}})})},le)})},R),F.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:rt(Ge.arrow,{[Ge.arrowVertical]:T.direction==="vert"}),style:{color:F.color,"--arrow-hover-color":F.hover},children:r.jsxs("button",{className:Ge.arrowInner,style:{transform:`translate(${S.scalingValue(F.offset.x,l)}, ${S.scalingValue(F.offset.y*(T.direction==="horiz"?1:-1),l)}) scale(${F.scale}) rotate(${T.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var z;return(z=x.current)==null?void 0:z.go("-1")},"aria-label":"Previous",children:[F.arrowsImgUrl&&r.jsx(rn,{url:F.arrowsImgUrl,fill:F.color,hoverFill:F.hover,className:rt(Ge.arrowImg,Ge.mirror)}),!F.arrowsImgUrl&&r.jsx(Rs,{color:F.color,className:rt(Ge.arrowIcon,Ge.arrowImg,Ge.mirror)})]})}),r.jsx("div",{className:rt(Ge.arrow,Ge.nextArrow,{[Ge.arrowVertical]:T.direction==="vert"}),style:{color:F.color,"--arrow-hover-color":F.hover},children:r.jsxs("button",{className:Ge.arrowInner,style:{transform:`translate(${S.scalingValue(F.offset.x*(T.direction==="horiz"?-1:1),l)}, ${S.scalingValue(F.offset.y,l)}) scale(${F.scale}) rotate(${T.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var z;return(z=x.current)==null?void 0:z.go("+1")},"aria-label":"Next",children:[F.arrowsImgUrl&&r.jsx(rn,{url:F.arrowsImgUrl,fill:F.color,hoverFill:F.hover,className:Ge.arrowImg}),!F.arrowsImgUrl&&r.jsx(Rs,{color:F.color,className:rt(Ge.arrowIcon,Ge.arrowImg)})]})})]}),ne.closeIconUrl&&(()=>{const z=Oo(ne.closeIconAlign,ne.closeIconOffset,l),le=`scale(${ne.closeIconScale})`,he=z.transform?`${z.transform} ${le}`:le;return r.jsx("button",{className:Ge.closeButton,style:{...z,transform:he},onClick:Y,"aria-label":"Close lightbox",children:r.jsx(rn,{url:ne.closeIconUrl,fill:ne.closeIconColor??"#000000",hoverFill:ne.closeIconHover??"#cccccc"})})})(),J&&J.isActive&&i.imageCaption&&((we=n[v])==null?void 0:we.imageCaption)&&r.jsx("div",{className:Ge.caption,style:{...Oo(J.alignment,J.offset,l),fontFamily:Ir(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":S.scalingValue(c.width,l),letterSpacing:S.scalingValue(p,l),wordSpacing:S.scalingValue(w,l),textAlign:b,fontSize:S.scalingValue(f.fontSize,l),lineHeight:S.scalingValue(f.lineHeight,l),textTransform:h.textTransform??"none",textDecoration:h.textDecoration??"none",fontVariant:h.fontVariant??"normal",color:m},onClick:z=>z.stopPropagation(),children:r.jsx("div",{"data-styles":"imageCaption",className:Ge.captionTextInner,style:{"--link-color":J.linkColor,"--link-hover-color":J.linkHoverColor},children:r.jsx(yi,{content:n[v].imageCaption})})}),ue.isActive&&(()=>{const[z,le]=ue.position.split("-"),he=T.direction==="horiz"?`${z}-left`:ue.position,xe=Oo(he,ue.offset,l),Re=()=>{if(T.direction==="horiz"){if(le==="left")return"flex-start";if(le==="center")return"center";if(le==="right")return"flex-end"}else{if(z==="top")return"flex-start";if(z==="middle")return"center";if(z==="bottom")return"flex-end"}return"flex-start"};return r.jsx("div",{ref:$,className:Ge.thumbsWrapper,onClick:Te=>ke(Te),style:{position:l?"absolute":"fixed",...xe,...T.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:r.jsx("div",{className:rt(Ge.thumbsContainer,{[Ge.thumbsContainerVertical]:T.direction==="vert",[Ge.thumbsAlignStart]:ue.align==="start",[Ge.thumbsAlignCenter]:ue.align==="center",[Ge.thumbsAlignEnd]:ue.align==="end"}),style:{gap:S.scalingValue(ue.grid.gap,l),justifyContent:I?"flex-start":Re()},children:n.map((Te,_)=>{const pe=_===v,te=C[_],ee=ue.grid.size*(pe?ue.activeState.scale:1),Ie=()=>{if(ue.fit!=="fit")return{};if(!te)return T.direction==="horiz"?{height:S.scalingValue(ee,l)}:{width:S.scalingValue(ee,l)};const re=te.width/te.height;if(T.direction==="horiz"){const O=ee,Ve=O*re;return{width:S.scalingValue(Ve,l),height:S.scalingValue(O,l)}}else{const O=ee,Ve=O/re;return{width:S.scalingValue(O,l),height:S.scalingValue(Ve,l)}}};return r.jsx("button",{className:Ge.thumbItem,style:{...T.direction==="horiz"&&ue.fit!=="fit"?{height:S.scalingValue(ee,l)}:{},...T.direction==="vert"&&ue.fit!=="fit"?{width:S.scalingValue(ee,l)}:{},...ue.fit==="cover"?{width:S.scalingValue(ee,l),height:S.scalingValue(ee,l)}:{},...Ie(),transition:pe?"all 0.25s ease-out":"none",opacity:pe?ue.activeState.opacity/100:ue.opacity/100,"--thumb-hover":ue.activeState.opacity/100},onClick:re=>{var O;re.stopPropagation(),M(_),(O=x.current)==null||O.go(_)},onMouseEnter:()=>{var re;ue.triggers==="hov"&&((re=x.current)==null||re.go(_))},children:r.jsx("img",{src:Te.image.url,alt:Te.image.name??"",onLoad:re=>{const O=re.currentTarget;O.naturalWidth&&O.naturalHeight&&j(Ve=>({...Ve,[_]:{width:O.naturalWidth,height:O.naturalHeight}}))},style:{objectFit:ue.fit==="cover"?"cover":"contain",...ue.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...ue.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${Te.image.name}-${_}`)})})})})()]})]}),document.getElementById(s))};function Rs({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 Qp={element:Zp,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 Do(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function em(e){return`
6
+ */const Vu="RichTextRenderer-module__link___BWeZ2",Gu={link:Vu},qu=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))},Ir=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>qu(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function on(e){const{color:t,...n}=e;return n}function Ut(e,t){var o,s,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:Ir(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:S.scalingValue(e.letterSpacing,t),wordSpacing:S.scalingValue(e.wordSpacing,t),fontSize:S.scalingValue(n,t),lineHeight:i!==void 0?S.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(s=e.textAppearance)==null?void 0:s.textDecoration,fontVariant:(l=e.textAppearance)==null?void 0:l.fontVariant,textAlign:e.textAlign,color:e.color}}const yi=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?r.jsx("a",{className:Gu.link,href:i.value,target:i.target,children:t(i.children)},o):r.jsx("span",{style:Uu(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 Uu(e){return{...e.fontFamily&&{fontFamily:Ir(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 Ku="SvgImage-module__svg___q3xE-",Xu="SvgImage-module__img___VsTm-",Ss={svg:Ku,img:Xu},Yu=e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")||t.includes(".svg")||t.startsWith("blob:"))},Zu=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,rn=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[s,l]=a.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return a.useEffect(()=>{if(typeof window<"u"&&window.CSS){const d=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');l(d)}},[]),!Yu(e)||!s?r.jsx("img",{src:e,alt:"",className:rt(Ss.img,i),style:o}):r.jsx("span",{"data-supports-mask":s,className:rt(Ss.svg,i),style:{"--svg":Zu(e),"--fill":t,"--hover-fill":n,...o??{}}})},Ju={"top-left":it.topLeftAlignment,"top-center":it.topCenterAlignment,"top-right":it.topRightAlignment,"middle-left":it.middleLeftAlignment,"middle-center":it.middleCenterAlignment,"middle-right":it.middleRightAlignment,"bottom-left":it.bottomLeftAlignment,"bottom-center":it.bottomCenterAlignment,"bottom-right":it.bottomRightAlignment};function Qu({settings:e,content:t,styles:n,isEditor:i}){const[o,s]=a.useState(null),{widthSettings:l,fontSettings:d,letterSpacing:c,textAlign:u,wordSpacing:p,fontSizeLineHeight:b,textAppearance:w,color:f}=n.imageCaption??{},[h,m]=a.useState(void 0),[v,M]=a.useState(null),[R,L]=a.useState(0),[X,F]=a.useState(0),{direction:B,transition:k,controls:C,pagination:j,imageCaption:x,triggers:W}=e,E=a.useRef(k.type),{x:Z,y:P}=e.controls.offset,U=V=>{o&&o.go(V)};return a.useEffect(()=>{if(!v)return;const V=new ResizeObserver(G=>{if(!o)return;const[ie]=G;m({width:Math.round(ie.contentRect.width),height:Math.round(ie.contentRect.height)})});return V.observe(v),()=>V.unobserve(v)},[v]),a.useEffect(()=>{!o||E.current===k.type||(F(V=>V+1),E.current=k.type)},[k.type]),r.jsx("div",{className:rt(it.wrapper,{[it.editor]:i}),ref:M,children:r.jsxs("div",{className:it.sliderInner,style:{width:h?h.width:"100%",height:h?h.height:"100%",backgroundColor:k.backgroundColor&&k.type==="fade in"?k.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&r.jsx("div",{className:rt(it.captionBlock),children:r.jsx("div",{className:it.captionTextWrapper,children:t.map((V,G)=>r.jsx("div",{className:rt(it.captionText,Ju[x.alignment],{[it.withPointerEvents]:G===R&&i,[it.active]:G===R}),style:{fontFamily:Ir(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":S.scalingValue(l.width,i),letterSpacing:S.scalingValue(c,i),wordSpacing:S.scalingValue(p,i),textAlign:u,fontSize:S.scalingValue(b.fontSize,i),lineHeight:S.scalingValue(b.lineHeight,i),textTransform:w.textTransform??"none",textDecoration:w.textDecoration??"none",fontVariant:w.fontVariant??"normal",color:f,transitionDuration:k.duration?`${Math.round(parseInt(k.duration)/2)}ms`:"500ms"},children:r.jsx("div",{"data-styles":"imageCaption",className:it.captionTextInner,style:{"--link-hover-color":x.linkHoverColor,"--link-color":x.linkColor,position:"relative",top:S.scalingValue(x.offset.y,i),left:S.scalingValue(x.offset.x,i)},children:r.jsx(yi,{content:V.imageCaption})})},G))})}),r.jsx(Ka,{onMove:V=>{L(V.index)},ref:s,options:{arrows:!1,speed:k.duration?parseInt(k.duration):500,autoplay:W.autoPlay!==null,...W.autoPlay!==null&&{interval:parseInt(W.autoPlay)*1e3},direction:B==="horiz"||k.type==="fade in"?"ltr":"ttb",pagination:!1,drag:W.triggersList.drag,perPage:1,width:h?h.width:"100%",height:h?h.height:"100%",type:k.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((V,G)=>r.jsx(Xa,{children:r.jsx("div",{className:it.sliderItem,children:r.jsx("div",{className:it.imgWrapper,children:r.jsx("img",{className:rt(it.sliderImage,{[it.contain]:V.image.objectFit==="contain",[it.cover]:V.image.objectFit==="cover"}),src:V.image.url,alt:V.image.name??""})})})},G))},X),C.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:rt(it.arrow,{[it.arrowVertical]:B==="vert",[it.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:r.jsxs("button",{onClick:()=>{U("-1")},className:it.arrowInner,style:{transform:`translate(${S.scalingValue(Z,i)}, ${S.scalingValue(P*(B==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&r.jsx(rn,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:rt(it.arrowImg,it.mirror)}),!C.arrowsImgUrl&&r.jsx($s,{color:C.color,className:rt(it.arrowIcon,it.arrowImg,it.mirror)})]})}),r.jsx("div",{className:rt(it.arrow,it.nextArrow,{[it.arrowVertical]:B==="vert",[it.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:r.jsxs("button",{className:it.arrowInner,onClick:()=>U("+1"),style:{transform:`translate(${S.scalingValue(Z*(B==="horiz"?-1:1),i)}, ${S.scalingValue(P,i)}) scale(${e.controls.scale/100}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&r.jsx(rn,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:it.arrowImg}),!C.arrowsImgUrl&&r.jsx($s,{color:C.color,className:rt(it.arrowIcon,it.arrowImg)})]})})]}),W.triggersList.click&&r.jsx("div",{className:it.clickOverlay,onClick:()=>{o&&o.go("+1")}}),j.isActive&&r.jsx("div",{className:rt(it.pagination,{[it.paginationInsideBottom]:j.position==="inside-1"&&B==="horiz",[it.paginationInsideTop]:j.position==="inside-2"&&B==="horiz",[it.paginationOutsideBottom]:j.position==="outside-1"&&B==="horiz",[it.paginationOutsideTop]:j.position==="outside-2"&&B==="horiz",[it.paginationInsideLeft]:j.position==="inside-1"&&B==="vert",[it.paginationInsideRight]:j.position==="inside-2"&&B==="vert",[it.paginationOutsideLeft]:j.position==="outside-1"&&B==="vert",[it.paginationOutsideRight]:j.position==="outside-2"&&B==="vert",[it.paginationVertical]:B==="vert"}),children:r.jsx("div",{className:it.paginationInner,style:{backgroundColor:j.colors[2],transform:`scale(${j.scale/100}) translate(${S.scalingValue(j.offset.x,i)}, ${S.scalingValue(j.offset.y,i)}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:t.map((V,G)=>r.jsx("button",{onClick:()=>{o&&o.go(G)},className:rt(it.paginationItem),children:r.jsx("div",{className:rt(it.dot,{[it.activeDot]:G===R}),style:{backgroundColor:G===R?j.colors[0]:j.colors[1],"--pagination-hover-color":j.hover}})},G))})})]})})}function $s({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 ep={element:Qu,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"]}},tp="ImageRevealSlider-module__imageRevealSlider___UE5Ob",np="ImageRevealSlider-module__image___Qjt-e",ip="ImageRevealSlider-module__link___N-iLG",op="ImageRevealSlider-module__cursor___2U03d",wi={imageRevealSlider:tp,image:np,link:ip,cursor:op};function Cs(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,l=o.naturalHeight/o.naturalWidth*s,d=s/2,c=l/2;if(e>=i.x-d&&e<=i.x+d&&t>=i.y-c&&t<=i.y+c)return!0}return!1}function zr(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function rp(e,t,n,i){let o,s;if(t==="custom"){o=n;const l=await zr(e);s=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await zr(e);s=l.height/l.width*o}else{const l=await zr(e);o=l.width,s=l.height}return{width:o,height:s,finalWidth:`${o}px`}}function ap({settings:e,content:t,isEditor:n}){const[i,o]=a.useState(null),[s,l]=a.useState([]),[d,c]=a.useState(0),u=a.useRef(0),[p,b]=a.useState({x:0,y:0}),[w,f]=a.useState(1),[h,m]=a.useState("none"),v=a.useRef({x:0,y:0}),[M,R]=a.useState(!1),{sizeType:L,imageWidth:X,randomRangeImageWidth:F}=e.imageSize,{revealPosition:B,visible:k}=e.position,{cursorType:C,target:j,defaultCursorScale:x,defaultCursor:W,hoverCursorScale:E,hoverCursor:Z}=e.cursor;a.useEffect(()=>{if(!i)return;const V=($,I)=>{const D=i.getBoundingClientRect(),se=$-D.left,oe=I-D.top;if(b({x:se,y:oe}),C==="system"){m("none"),f(1);return}const T=se,ue=oe,A=document.elementFromPoint(D.left+T,D.top+ue);if(A&&A.closest("a")){m("none"),f(1);return}const ne=Cs(T,ue,s)||j==="area"?{img:Z??"none",scale:E}:{img:W??"none",scale:x};m(ne.img),f(ne.scale)},G=$=>{$.stopPropagation(),v.current={x:$.clientX,y:$.clientY},V($.clientX,$.clientY)},ie=()=>{M&&V(v.current.x,v.current.y)};return i.addEventListener("mousemove",G),window.addEventListener("scroll",ie,!0),()=>{i.removeEventListener("mousemove",G),window.removeEventListener("scroll",ie,!0)}},[i,M,p,C,j,Z,W,E,x,s]),a.useEffect(()=>{M||(m("none"),f(0))},[M]);const P=async(V,G,ie,$={})=>{const{width:I,height:D,finalWidth:se}=await rp(V.image.url,L,X,F);let oe=0,T=0;B==="same"?(oe=G/2,T=ie/2):(oe=$.x??Math.random()*G,T=$.y??Math.random()*ie);const ue=Math.min(Math.max(oe,I/2),G-I/2),A=Math.min(Math.max(T,D/2),ie-D/2);return{id:u.current++,url:V.image.url,link:V.link,name:V.image.name,x:ue,y:A,width:se}};a.useEffect(()=>{if(!i||t.length===0)return;const V=i.getBoundingClientRect(),G=V.width,ie=V.height,$=[];(async()=>{const D=t[0],se=await P(D,G,ie);$.push(se),l($),c(1)})()},[L,X,F,B,i]),a.useEffect(()=>{k==="last One"&&l(V=>V.length>0?[V[V.length-1]]:[])},[k]);const U=async V=>{if(!i)return;const G=i.getBoundingClientRect(),ie=V.clientX-G.left,$=V.clientY-G.top;if(j==="image"&&!Cs(ie,$,s))return;let I=0,D=0;B==="on Click"?(I=ie,D=$):B==="same"?(I=G.width/2,D=G.height/2):(I=Math.random()*G.width,D=Math.random()*G.height);const se=t[d],oe=await P(se,G.width,G.height,{x:I,y:D});l(T=>k==="all"?[...T,oe]:[oe]),c(T=>T>=t.length-1?0:T+1)};return r.jsxs("div",{ref:o,onClick:U,onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1),className:wi.imageRevealSlider,style:{cursor:h==="none"?"default":"none"},children:[s.map(V=>r.jsx("div",{className:wi.wrapper,style:{top:`${V.y}px`,left:`${V.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:V.width??"auto",height:"auto",cursor:h==="none"?"default":"none"},children:j==="area"&&V.link?r.jsx("a",{href:V.link,target:"_blank",className:wi.link,children:r.jsx("img",{src:V.url,alt:V.name,className:wi.image},V.id)}):r.jsx("img",{src:V.url,alt:V.name,className:wi.image},V.id)},V.id)),M&&r.jsx("div",{className:wi.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${w})`,backgroundImage:`url('${h}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const sp={element:ap,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:""}]}}}},lp="LightBox-module__hidden___9s-9x",cp="LightBox-module__heroImage___sTxNF",dp="LightBox-module__background___rm9ml",up="LightBox-module__editor___4ACaY",pp="LightBox-module__contentStyle___Bgnsq",mp="LightBox-module__imageStyle___tLIlB",gp="LightBox-module__imgWrapper___LuFUp",hp="LightBox-module__contain___8-yaS",fp="LightBox-module__cover___hNvOG",yp="LightBox-module__caption___b6L2I",vp="LightBox-module__captionTextInner___rCGNH",xp="LightBox-module__lightboxSplide___XFuWC",bp="LightBox-module__arrow___iz38X",wp="LightBox-module__arrowVertical___Zfz81",Sp="LightBox-module__nextArrow___zkAQN",$p="LightBox-module__arrowInner___p48sW",Cp="LightBox-module__arrowIcon___3VaFf",Tp="LightBox-module__arrowImg___pNV88",Lp="LightBox-module__mirror___pjeXc",Rp="LightBox-module__thumbsWrapper___GB-nU",Ip="LightBox-module__thumbsContainerVertical___wttk5",Mp="LightBox-module__thumbsContainer___osSma",Ep="LightBox-module__thumbsAlignStart___MO6tY",Pp="LightBox-module__thumbsAlignCenter___Q4sUx",kp="LightBox-module__thumbsAlignEnd___p4y9R",Ap="LightBox-module__thumbItem___HvnF3",Fp="LightBox-module__closeButton___g2khP",Wp="LightBox-module__fadeIn___0m5GW",_p="LightBox-module__slideInLeft___gPYwC",Np="LightBox-module__slideInRight___S-pPp",Hp="LightBox-module__slideInTop___DFdAj",Op="LightBox-module__slideInBottom___m27kZ",Dp="LightBox-module__fadeOut___55qBR",jp="LightBox-module__slideOutLeft___NvU7P",zp="LightBox-module__slideOutRight___SK7eC",Bp="LightBox-module__slideOutTop___Vgg0z",Vp="LightBox-module__slideOutBottom___nJ0Ef",Gp="LightBox-module__scaleSlide___vZriG",Ge={hidden:lp,heroImage:cp,background:dp,editor:up,contentStyle:pp,imageStyle:mp,imgWrapper:gp,contain:hp,cover:fp,caption:yp,captionTextInner:vp,lightboxSplide:xp,arrow:bp,arrowVertical:wp,nextArrow:Sp,arrowInner:$p,arrowIcon:Cp,arrowImg:Tp,mirror:Lp,thumbsWrapper:Rp,thumbsContainerVertical:Ip,thumbsContainer:Mp,thumbsAlignStart:Ep,thumbsAlignCenter:Pp,thumbsAlignEnd:kp,thumbItem:Ap,closeButton:Fp,fadeIn:Wp,slideInLeft:_p,slideInRight:Np,slideInTop:Hp,slideInBottom:Op,fadeOut:Dp,slideOutLeft:jp,slideOutRight:zp,slideOutTop:Bp,slideOutBottom:Vp,scaleSlide:Gp},Oo=(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% + ${S.scalingValue(t.x,n)}), calc(-50% + ${S.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${S.scalingValue(t.x,n)}, calc(-50% + ${S.scalingValue(t.y,n)}))`:s==="center"?i.transform=`translate(calc(-50% + ${S.scalingValue(t.x,n)}), ${S.scalingValue(t.y,n)})`:i.transform=`translate(${S.scalingValue(t.x,n)}, ${S.scalingValue(t.y,n)})`,i};function uc(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 qp(e){const t=e.trim().split(/\s+/),n=i=>{if(i.endsWith("%"))return parseFloat(i)/100;switch(i){case"left":case"top":return 0;case"right":case"bottom":return 1;case"center":return .5;default:return .5}};if(t.length===1){const i=t[0];return i==="center"?{x:.5,y:.5}:i==="top"||i==="bottom"?{x:.5,y:n(i)}:i==="left"||i==="right"?{x:n(i),y:.5}:{x:n(i),y:.5}}return{x:n(t[0]),y:n(t[1])}}function pc(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,s=n/i;if(s>o){const d=e;return{renderedW:d,renderedH:d/s}}const l=t;return{renderedW:l*s,renderedH:l}}function Up(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,s=n/i;if(s>o){const d=t;return{renderedW:d*s,renderedH:d}}const l=e;return{renderedW:l,renderedH:l/s}}function mc(e,t,n,i,o){const{x:s,y:l}=qp(o);return{offsetX:s*(e-n),offsetY:l*(t-i)}}function Kp(e){const t=e.getBoundingClientRect(),n=t.width,i=t.height;if(!n||!i)return"center center";const o=e instanceof HTMLVideoElement?e.videoWidth:e.naturalWidth,s=e instanceof HTMLVideoElement?e.videoHeight:e.naturalHeight,{objectFit:l,objectPosition:d}=window.getComputedStyle(e),c=l==="cover"?Up:pc,{renderedW:u,renderedH:p}=c(n,i,o,s),{offsetX:b,offsetY:w}=mc(n,i,u,p,d),f=(b+u/2)/n*100,h=(w+p/2)/i*100;return`${f}% ${h}%`}function Xp(e){return Kp(e)}function pr(e){const t=e.getBoundingClientRect(),n=uc(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),s=e.naturalWidth,l=e.naturalHeight,{renderedW:d,renderedH:c}=pc(i,o,s,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:b}=mc(i,o,d,c,u),w=t.left+n.left,f=t.top+n.top;return{x:p+w,y:b+f,width:d,height:c}}function Ts(e){const t=e.getBoundingClientRect(),n=uc(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Ls(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 Yp(e,t){const n=(()=>{if(e==="fade in")return Ge.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return Ge.slideInLeft;case"right":return Ge.slideInRight;case"top":return Ge.slideInTop;case"bottom":return Ge.slideInBottom;default:return Ge.slideInRight}return Ge.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return Ge.fadeIn;if(e==="slide in")switch(t){case"left":return Ge.slideInLeft;case"right":return Ge.slideInRight;case"top":return Ge.slideInTop;case"bottom":return Ge.slideInBottom;default:return Ge.slideInRight}return Ge.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return Ge.fadeOut;if(e==="slide in")switch(t){case"left":return Ge.slideOutLeft;case"right":return Ge.slideOutRight;case"top":return Ge.slideOutTop;case"bottom":return Ge.slideOutBottom;default:return Ge.slideOutRight}return Ge.fadeOut})(),s=(()=>{if(e==="fade in")return Ge.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return Ge.slideOutLeft;case"right":return Ge.slideOutRight;case"top":return Ge.slideOutTop;case"bottom":return Ge.slideOutBottom;default:return Ge.slideOutRight}return Ge.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:s}}const Zp=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:s,isPreviewMode:l})=>{const[d,c]=a.useState(!1),{url:u}=e.thumbnailBlock.cover;return a.useEffect(()=>{o==="close"&&c(!1),o==="open"&&c(!0)},[o]),r.jsxs(r.Fragment,{children:[r.jsx("img",{src:u,alt:"Cover",className:Ge.heroImage,onClick:()=>c(!0)}),r.jsx(Jp,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:s})]})},Jp=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:s,isEditor:l,metadata:d})=>{var we;const{widthSettings:c,fontSettings:u,letterSpacing:p,textAlign:b,wordSpacing:w,fontSizeLineHeight:f,textAppearance:h,color:m}=i.imageCaption??{},[v,M]=a.useState(0),[R,L]=a.useState(0),[X,F]=a.useState(!1),[B,k]=a.useState(!1),[C,j]=a.useState({}),x=a.useRef(null),W=a.useRef(null),E=a.useRef(null),Z=a.useRef(!1),P=a.useRef(null),U=a.useRef(null),V=a.useRef(null),G=a.useRef(null),ie=a.useRef(!1),$=a.useRef(null),[I,D]=a.useState(!1),{appear:se,triggers:oe,slider:T,thumbnail:ue,controls:A,area:ne,caption:J,layout:ve}=o.lightboxBlock,{appearClass:Ee,backdropAppearClass:me,backdropDisappearClass:de,disappearClass:q}=Yp(se.type,se.direction),Q=(d==null?void 0:d.itemId)??null;a.useEffect(()=>{const z=()=>{setTimeout(()=>{var he,xe;(xe=(he=x.current)==null?void 0:he.splide)==null||xe.refresh()},16)},le=()=>{L(he=>he+1)};return window.addEventListener("ArticleEditor.Layout:change",z),window.addEventListener("ArticleEditor.ComponentContent:change",le),()=>{window.removeEventListener("ArticleEditor.Layout:change",z),window.removeEventListener("ArticleEditor.ComponentContent:change",le)}},[]),a.useEffect(()=>{if(!e||!ue.isActive){D(!1);return}const z=$.current;if(!z)return;const le=()=>{T.direction==="horiz"?D(z.scrollWidth>z.clientWidth):D(z.scrollHeight>z.clientHeight)};le();const he=new ResizeObserver(le);return he.observe(z),()=>he.disconnect()},[e,ue.isActive,n.length,C,T.direction]);const Y=a.useCallback(()=>{const z=window.matchMedia("(max-width: 768px)").matches,le=Ls(ne.color);z&&!l&&le>.9&&(document.body.style.backgroundColor=""),F(!0),Z.current=!0;const he=xe=>{xe.target===P.current&&xe.animationName&&(P.current&&U.current&&P.current.removeEventListener("animationend",U.current),U.current=null,Z.current&&(Z.current=!1,t()),F(!1))};P.current&&(U.current=he,P.current.addEventListener("animationend",he))},[t,ne.color,l]),_e=(z,le,he)=>{var xe,Re;if(z){if(oe.type==="click"&&oe.switch==="image")oe.repeat==="close"&&v===n.length-1?Y():(xe=x.current)==null||xe.go("+1");else if(oe.type==="click"&&oe.switch==="50/50"){const Te=z.getBoundingClientRect(),_=le-Te.left,pe=he-Te.top,te=Te.width,N=Te.height;let ee;T.direction==="horiz"?ee=_<te/2?"-1":"+1":ee=pe<N/2?"-1":"+1",(Re=x.current)==null||Re.go(ee)}}},Ce=z=>{if(ie.current){ie.current=!1;return}const le=n[v],he=(le==null?void 0:le.image.objectFit)==="cover";let xe,Re;if("changedTouches"in z&&z.changedTouches.length>0)xe=z.changedTouches[0].clientX,Re=z.changedTouches[0].clientY;else if("clientX"in z)xe=z.clientX,Re=z.clientY;else return;let Te;if(he&&E.current){const _=Ts(E.current);Te=xe>=_.left&&xe<=_.right&&Re>=_.top&&Re<=_.bottom}else{const _=E.current?pr(E.current):null;if(!_){z.target===z.currentTarget&&Y();return}Te=xe>=_.x&&xe<=_.x+_.width&&Re>=_.y&&Re<=_.y+_.height}Te?_e(E.current,xe,Re):Y()},ke=z=>{const le=z.target;(le.classList.contains(Ge.thumbsWrapper)||le.classList.contains(Ge.thumbsContainer))&&Ce(z)};a.useEffect(()=>{if(!e)return;const z=le=>{var he,xe;if(le.key==="Escape"){Y();return}if(le.key==="ArrowRight"){M(Re=>(Re+1)%Math.max(n.length,1)),(he=x.current)==null||he.go("+1");return}le.key==="ArrowLeft"&&(M(Re=>(Re-1+Math.max(n.length,1))%Math.max(n.length,1)),(xe=x.current)==null||xe.go("-1"))};return window.addEventListener("keydown",z),()=>{window.removeEventListener("keydown",z)}},[e,Y,n.length]),a.useEffect(()=>{if(e){if(M(0),L(le=>le+1),Z.current=!1,F(!1),k(!1),j({}),!Q)return;const z=new CustomEvent("page-overlay",{detail:{itemId:Q}});window.dispatchEvent(z)}return()=>{P.current&&U.current&&(P.current.removeEventListener("animationend",U.current),U.current=null),k(!1)}},[e,Q]),a.useEffect(()=>{W.current!==null&&W.current!==T.type&&L(z=>z+1),W.current=T.type},[T.type]),a.useEffect(()=>{if(!e)return;const z=document.body.style.overflow,le=window.matchMedia("(max-width: 768px)").matches,he=Ls(ne.color);document.body.style.overflow="hidden",k(!1);const xe=Te=>{Te.target===P.current&&!Z.current&&Te.animationName&&(le&&!l&&he>.9&&(document.body.style.backgroundColor=ne.color),k(!0),P.current&&V.current&&P.current.removeEventListener("animationend",V.current),V.current=null)};P.current&&(V.current=xe,P.current.addEventListener("animationend",xe));const Re=Te=>{const _=Te.target;_&&(_.closest(`.${Ge.thumbsWrapper}`)||_.closest(`.${Ge.thumbsContainer}`))||T.type!=="slide"&&Te.preventDefault()};return document.addEventListener("touchmove",Re,{passive:!1}),()=>{document.body.style.overflow=z,document.removeEventListener("touchmove",Re),P.current&&V.current&&(P.current.removeEventListener("animationend",V.current),V.current=null),k(!1)}},[e,l,ne.color,T.type]),a.useEffect(()=>{if(!e)return;const z=le=>{var xe,Re;if(Z.current){le.stopPropagation();return}if(ie.current){ie.current=!1;return}const he=le.target;if(!(he&&(he.closest(`.${Ge.thumbsContainer}`)||he.closest(`.${Ge.thumbItem}`)||he.closest(`.${Ge.arrow}`)||he.closest(`.${Ge.closeButton}`)||he.closest(`.${Ge.caption}`)))){if(T.type==="slide"&&oe.type==="drag"&&((Re=(xe=x.current)==null?void 0:xe.splide)!=null&&Re.root)){const Te=x.current.splide.root;if(he&&(Te.contains(he)||Te===he))return}if(le.touches.length===0&&le.changedTouches.length>0){const Te=n[v],_=(Te==null?void 0:Te.image.objectFit)==="cover",pe=le.changedTouches[0];let te;if(_&&E.current){const N=Ts(E.current);te=pe.clientX>=N.left&&pe.clientX<=N.right&&pe.clientY>=N.top&&pe.clientY<=N.bottom}else{const N=E.current?pr(E.current):null;if(!N)return;te=pe.clientX>=N.x&&pe.clientX<=N.x+N.width&&pe.clientY>=N.y&&pe.clientY<=N.y+N.height}if(!te){le.stopPropagation(),Z.current=!0;const N=ee=>{ee.stopPropagation(),ee.preventDefault(),document.removeEventListener("click",N,!0)};document.addEventListener("click",N,!0),Y()}}}};return document.addEventListener("touchend",z,{passive:!0}),()=>{document.removeEventListener("touchend",z)}},[e,Y,v,n]);const ce=(T.type==="scale"||T.type==="fade")&&T.direction==="vert"&&oe.type==="drag";a.useEffect(()=>{var ee,Ie;if(!e||!ce||!((Ie=(ee=x.current)==null?void 0:ee.splide)!=null&&Ie.root))return;const z=x.current.splide.root,le=30,he=(re,O)=>{if(G.current){const Ve=Math.abs(re-G.current.x),Oe=Math.abs(O-G.current.y);(Ve>0||Oe>0)&&(ie.current=!0)}},xe=re=>{G.current&&(re.preventDefault(),he(re.clientX,re.clientY))},Re=re=>{G.current&&re.touches.length>0&&(re.preventDefault(),he(re.touches[0].clientX,re.touches[0].clientY))},Te=(re,O)=>{if(!G.current||!x.current){G.current=null;return}const Ve=Math.abs(re-G.current.x),Oe=Math.abs(O-G.current.y);Oe>le&&Oe>Ve&&x.current.go(O<G.current.y?"+1":"-1"),G.current=null},_=re=>{G.current&&Te(re.clientX,re.clientY),document.removeEventListener("pointerup",_),document.removeEventListener("pointercancel",_),document.removeEventListener("pointermove",xe)},pe=re=>{if(G.current){if(re.changedTouches.length>0){const O=re.changedTouches[0];Te(O.clientX,O.clientY)}document.removeEventListener("touchend",pe),document.removeEventListener("touchcancel",pe),document.removeEventListener("touchmove",Re)}},te=re=>{G.current={x:re.clientX,y:re.clientY},ie.current=!1,document.addEventListener("pointermove",xe,{passive:!1}),document.addEventListener("pointerup",_),document.addEventListener("pointercancel",_)},N=re=>{re.touches.length>0&&(G.current={x:re.touches[0].clientX,y:re.touches[0].clientY},ie.current=!1,document.addEventListener("touchmove",Re,{passive:!1}),document.addEventListener("touchend",pe),document.addEventListener("touchcancel",pe))};return z.addEventListener("pointerdown",te),z.addEventListener("touchstart",N),()=>{z.removeEventListener("pointerdown",te),z.removeEventListener("touchstart",N),document.removeEventListener("pointermove",xe),document.removeEventListener("pointerup",_),document.removeEventListener("pointercancel",_),document.removeEventListener("touchmove",Re),document.removeEventListener("touchend",pe),document.removeEventListener("touchcancel",pe),G.current=null,ie.current=!1}},[e,ce,R]);const ge={backgroundColor:ne.color,backdropFilter:`blur(${ne.blur}px)`,animationDuration:`${parseInt(se.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(s)?null:Yn.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:l?null:P,className:rt(Ge.background,X?de:me,{[Ge.editor]:l},{[Ge.hidden]:!e}),style:{...ge,...B&&!l&&!X?{position:"absolute"}:{}}}),r.jsxs("div",{ref:l?P:null,className:rt(Ge.contentStyle,X?q:Ee,{[Ge.editor]:l},{[Ge.hidden]:!e}),style:{animationDuration:`${parseInt(se.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[r.jsx(Ka,{onMove:z=>M(z.index),ref:x,className:Ge.lightboxSplide,options:{arrows:!1,speed:T.duration?parseInt(T.duration):500,direction:T.direction==="horiz"||T.type==="fade"||T.type==="scale"?"ltr":"ttb",pagination:!1,drag:oe.type==="drag"&&!ce,perPage:1,width:"100%",height:"100%",type:T.type==="fade"||T.type==="scale"?"fade":"loop",padding:0,rewind:oe.repeat!=="close",start:0},style:{"--splide-speed":T.duration},children:n.map((z,le)=>{const he=Oo(ve.position,ve.offset,l),xe=`${S.scalingValue(ve.padding.top,l)} ${S.scalingValue(ve.padding.right,l)} ${S.scalingValue(ve.padding.bottom,l)} ${S.scalingValue(ve.padding.left,l)}`,Re=T.type==="scale"?(()=>{const{transform:Te,..._}=he;return{..._,position:"absolute",padding:xe,boxSizing:"border-box","--position-transform":Te||"none"}})():{...he,position:"absolute",padding:xe,boxSizing:"border-box"};return r.jsx(Xa,{children:r.jsx("div",{className:Ge.imgWrapper,onClick:Ce,children:r.jsx("img",{ref:le===v?E:null,className:rt(Ge.imageStyle,{[Ge.contain]:z.image.objectFit==="contain",[Ge.cover]:z.image.objectFit==="cover",[Ge.scaleSlide]:T.type==="scale"}),src:z.image.url,alt:z.image.name??"",style:{...Re,pointerEvents:z.image.objectFit==="contain"?"none":"auto"}})})},le)})},R),A.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:rt(Ge.arrow,{[Ge.arrowVertical]:T.direction==="vert"}),style:{color:A.color,"--arrow-hover-color":A.hover},children:r.jsxs("button",{className:Ge.arrowInner,style:{transform:`translate(${S.scalingValue(A.offset.x,l)}, ${S.scalingValue(A.offset.y*(T.direction==="horiz"?1:-1),l)}) scale(${A.scale}) rotate(${T.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var z;return(z=x.current)==null?void 0:z.go("-1")},"aria-label":"Previous",children:[A.arrowsImgUrl&&r.jsx(rn,{url:A.arrowsImgUrl,fill:A.color,hoverFill:A.hover,className:rt(Ge.arrowImg,Ge.mirror)}),!A.arrowsImgUrl&&r.jsx(Rs,{color:A.color,className:rt(Ge.arrowIcon,Ge.arrowImg,Ge.mirror)})]})}),r.jsx("div",{className:rt(Ge.arrow,Ge.nextArrow,{[Ge.arrowVertical]:T.direction==="vert"}),style:{color:A.color,"--arrow-hover-color":A.hover},children:r.jsxs("button",{className:Ge.arrowInner,style:{transform:`translate(${S.scalingValue(A.offset.x*(T.direction==="horiz"?-1:1),l)}, ${S.scalingValue(A.offset.y,l)}) scale(${A.scale}) rotate(${T.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var z;return(z=x.current)==null?void 0:z.go("+1")},"aria-label":"Next",children:[A.arrowsImgUrl&&r.jsx(rn,{url:A.arrowsImgUrl,fill:A.color,hoverFill:A.hover,className:Ge.arrowImg}),!A.arrowsImgUrl&&r.jsx(Rs,{color:A.color,className:rt(Ge.arrowIcon,Ge.arrowImg)})]})})]}),ne.closeIconUrl&&(()=>{const z=Oo(ne.closeIconAlign,ne.closeIconOffset,l),le=`scale(${ne.closeIconScale})`,he=z.transform?`${z.transform} ${le}`:le;return r.jsx("button",{className:Ge.closeButton,style:{...z,transform:he},onClick:Y,"aria-label":"Close lightbox",children:r.jsx(rn,{url:ne.closeIconUrl,fill:ne.closeIconColor??"#000000",hoverFill:ne.closeIconHover??"#cccccc"})})})(),J&&J.isActive&&i.imageCaption&&((we=n[v])==null?void 0:we.imageCaption)&&r.jsx("div",{className:Ge.caption,style:{...Oo(J.alignment,J.offset,l),fontFamily:Ir(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":S.scalingValue(c.width,l),letterSpacing:S.scalingValue(p,l),wordSpacing:S.scalingValue(w,l),textAlign:b,fontSize:S.scalingValue(f.fontSize,l),lineHeight:S.scalingValue(f.lineHeight,l),textTransform:h.textTransform??"none",textDecoration:h.textDecoration??"none",fontVariant:h.fontVariant??"normal",color:m},onClick:z=>z.stopPropagation(),children:r.jsx("div",{"data-styles":"imageCaption",className:Ge.captionTextInner,style:{"--link-color":J.linkColor,"--link-hover-color":J.linkHoverColor},children:r.jsx(yi,{content:n[v].imageCaption})})}),ue.isActive&&(()=>{const[z,le]=ue.position.split("-"),he=T.direction==="horiz"?`${z}-left`:ue.position,xe=Oo(he,ue.offset,l),Re=()=>{if(T.direction==="horiz"){if(le==="left")return"flex-start";if(le==="center")return"center";if(le==="right")return"flex-end"}else{if(z==="top")return"flex-start";if(z==="middle")return"center";if(z==="bottom")return"flex-end"}return"flex-start"};return r.jsx("div",{ref:$,className:Ge.thumbsWrapper,onClick:Te=>ke(Te),style:{position:l?"absolute":"fixed",...xe,...T.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:r.jsx("div",{className:rt(Ge.thumbsContainer,{[Ge.thumbsContainerVertical]:T.direction==="vert",[Ge.thumbsAlignStart]:ue.align==="start",[Ge.thumbsAlignCenter]:ue.align==="center",[Ge.thumbsAlignEnd]:ue.align==="end"}),style:{gap:S.scalingValue(ue.grid.gap,l),justifyContent:I?"flex-start":Re()},children:n.map((Te,_)=>{const pe=_===v,te=C[_],ee=ue.grid.size*(pe?ue.activeState.scale:1),Ie=()=>{if(ue.fit!=="fit")return{};if(!te)return T.direction==="horiz"?{height:S.scalingValue(ee,l)}:{width:S.scalingValue(ee,l)};const re=te.width/te.height;if(T.direction==="horiz"){const O=ee,Ve=O*re;return{width:S.scalingValue(Ve,l),height:S.scalingValue(O,l)}}else{const O=ee,Ve=O/re;return{width:S.scalingValue(O,l),height:S.scalingValue(Ve,l)}}};return r.jsx("button",{className:Ge.thumbItem,style:{...T.direction==="horiz"&&ue.fit!=="fit"?{height:S.scalingValue(ee,l)}:{},...T.direction==="vert"&&ue.fit!=="fit"?{width:S.scalingValue(ee,l)}:{},...ue.fit==="cover"?{width:S.scalingValue(ee,l),height:S.scalingValue(ee,l)}:{},...Ie(),transition:pe?"all 0.25s ease-out":"none",opacity:pe?ue.activeState.opacity/100:ue.opacity/100,"--thumb-hover":ue.activeState.opacity/100},onClick:re=>{var O;re.stopPropagation(),M(_),(O=x.current)==null||O.go(_)},onMouseEnter:()=>{var re;ue.triggers==="hov"&&((re=x.current)==null||re.go(_))},children:r.jsx("img",{src:Te.image.url,alt:Te.image.name??"",onLoad:re=>{const O=re.currentTarget;O.naturalWidth&&O.naturalHeight&&j(Ve=>({...Ve,[_]:{width:O.naturalWidth,height:O.naturalHeight}}))},style:{objectFit:ue.fit==="cover"?"cover":"contain",...ue.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...ue.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${Te.image.name}-${_}`)})})})})()]})]}),document.getElementById(s))};function Rs({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 Qp={element:Zp,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 Do(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function em(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 tm({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:s}){const l=!!n,d=i&&t||!t,{prefix:c}=S.useScopedStyles(),{type:u="A",fieldsToShow:p=2,fields:b=[],buttonLabel:w,gap:f,fieldsGap:h,buttonCorners:m,buttonStroke:v,buttonPadding:M,isButtonFullWidth:R,inputCorners:L,inputStroke:X,inputPadding:A,inputColor:B,inputTextColor:P,inputBorderColor:C,placeholderColor:j,buttonColor:x,buttonTextColor:W,buttonBorderColor:E,labelTextColor:Z,successColor:k,errorColor:U,fontFamily:V,inputFontSettings:G,inputFontSize:ie,inputLineHeight:$,inputLetterSpacing:I,inputWordSpacing:D,inputTextAppearance:se,buttonFontSettings:oe,buttonFontSize:T,buttonLineHeight:ue,buttonLetterSpacing:F,buttonWordSpacing:ne,buttonTextAppearance:J,labelFontSettings:ve,labelFontSize:Ee,labelLineHeight:me,labelLetterSpacing:de,labelWordSpacing:q,labelTextAppearance:Q,statusFontSettings:Y,statusFontSize:_e,statusLineHeight:Ce,statusLetterSpacing:ke,statusWordSpacing:ce,statusTextAppearance:ge,successMessage:we,errorMessage:z,stateOverrides:le}=e,he=u==="B",xe=b.slice(0,Math.min(p,b.length)),Re={fontSettings:{fontFamily:V,fontWeight:(G==null?void 0:G.fontWeight)??400,fontStyle:(G==null?void 0:G.fontStyle)??"normal"},fontSize:ie??.01,lineHeight:$,letterSpacing:I??0,wordSpacing:D??0,textAppearance:se,color:P},Te=on(Ut(Re,t)),_=S.scalingValue(X??0,t),pe=S.scalingValue(($??ie??.01)+((A==null?void 0:A.top)??0)+((A==null?void 0:A.bottom)??0)+(u==="C"?X??0:(X??0)*2),t),te={...Te,borderStyle:"solid",borderRadius:u==="C"?0:S.scalingValue(L??0,t),...u==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:_,borderLeftWidth:0}:{borderWidth:_},paddingTop:S.scalingValue((A==null?void 0:A.top)??0,t),paddingRight:S.scalingValue((A==null?void 0:A.right)??0,t),paddingBottom:S.scalingValue((A==null?void 0:A.bottom)??0,t),paddingLeft:S.scalingValue((A==null?void 0:A.left)??0,t),height:pe,minHeight:pe},N={fontSettings:{fontFamily:V,fontWeight:(oe==null?void 0:oe.fontWeight)??400,fontStyle:(oe==null?void 0:oe.fontStyle)??"normal"},fontSize:T??.01,lineHeight:ue,letterSpacing:F??0,wordSpacing:ne??0,textAppearance:J,color:W},ee=on(Ut(N,t)),Ie=S.scalingValue(v??0,t),re={fontSettings:{fontFamily:V,fontWeight:(ve==null?void 0:ve.fontWeight)??400,fontStyle:(ve==null?void 0:ve.fontStyle)??"normal"},fontSize:Ee??.01,lineHeight:me,letterSpacing:de??0,wordSpacing:q??0,textAppearance:Q,color:Z},O=Ut(re,t),Ve={fontSettings:{fontFamily:V,fontWeight:(Y==null?void 0:Y.fontWeight)??400,fontStyle:(Y==null?void 0:Y.fontStyle)??"normal"},fontSize:_e??.01,lineHeight:Ce,letterSpacing:ke??0,wordSpacing:ce??0,textAppearance:ge,color:k},Oe=on(Ut(Ve,t)),lt=S.buildColorVars(c,{inputColor:B,inputTextColor:P,inputBorderColor:C,placeholderColor:j!=null&&j.trim()?j:"#cccccc",buttonColor:x,buttonTextColor:W,buttonBorderColor:E,labelTextColor:Z,successColor:k,errorColor:U},nm,im,le),[tt,ht]=a.useState(()=>Object.fromEntries(xe.map(Fe=>[Fe.name,""]))),[nt,Be]=a.useState("idle"),[ye,Pe]=a.useState(null),De=s==="success"?"success":s==="error"?"error":nt,qe=s==="error"?z:ye,Se=s==="filled",Ne=a.useMemo(()=>{if(!Se)return tt;let Fe=null;for(const Ke of xe)(tt[Ke.name]??"").trim().length>0||(Fe=Fe??{...tt},Fe[Ke.name]="Filled");return Fe??tt},[tt,Se,xe]),ze=De==="error"?S.getFormFieldValidationError(xe,Ne):null,ct=`${s&&s!=="default"?`${c}-state-${s}`:""}`.trim(),Je=o==null?void 0:o.submitUrl,$t=(Fe,Ke)=>{ht(je=>({...je,[Fe]:Ke}))},dt=async Fe=>{if(Fe.preventDefault(),!d)return;const Ke=Object.fromEntries(xe.map(ut=>{var pt;return[ut.name,((pt=tt[ut.name])==null?void 0:pt.trim())??""]}).filter(([,ut])=>ut));if(!Je){Be("error"),Pe("No integrations were found for this form.");return}if(Object.keys(Ke).length===0)return;const je=S.getFormFieldValidationError(xe,tt);if(je){Be("error"),Pe(je);return}Be("submitting"),Pe(null);try{const ut=await fetch(Je,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ke)});if(!ut.ok){const pt=await ut.text();throw new Error(pt||`Request failed: ${ut.status}`)}Be("success"),ht(Object.fromEntries(xe.map(pt=>[pt.name,""])))}catch(ut){Be("error"),Pe(ut instanceof Error?ut.message:"Something went wrong")}};return r.jsxs("div",{className:`${c}-wrapper ${c}-type-${u} ${ct}`.trim(),style:lt,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:em(c)}}),r.jsxs("form",{onSubmit:dt,className:`${c}-form`,children:[r.jsx("div",{className:`${c}-fields`,children:xe.map((Fe,Ke)=>r.jsxs(a.Fragment,{children:[Ke>0&&r.jsx("div",{"data-controls":l?"fieldsGap":void 0,className:l?`${c}-control`:void 0,style:{height:S.scalingValue(h??0,t)}}),r.jsxs("div",{className:`${c}-field-group${he?` ${c}-labeled`:""}`,children:[he&&r.jsx("span",{className:`${c}-field-label`,style:O?{...O,lineHeight:O.fontSize}:void 0,children:Fe.label||Fe.name}),Fe.type==="textarea"?r.jsx("textarea",{name:Fe.name,autoComplete:"off",value:Ne[Fe.name]??"",onChange:je=>$t(Fe.name,je.target.value),placeholder:Fe.placeholder,className:`${c}-input`,style:te,rows:1,"data-filled":Se||(Ne[Fe.name]??"").trim().length>0,"data-field-type":"textarea"}):r.jsx("input",{type:Fe.type==="phone"?"tel":Fe.type==="email"?"email":"text",name:Fe.name,autoComplete:"off",value:Ne[Fe.name]??"",onChange:je=>$t(Fe.name,je.target.value),placeholder:Fe.placeholder,required:Fe.isRequired??Fe.type==="email",className:`${c}-input`,style:te,"data-filled":Se||(Ne[Fe.name]??"").trim().length>0})]})]},Ke))}),r.jsx("div",{"data-controls":l?"gap":void 0,className:l?`${c}-control`:void 0,style:{height:S.scalingValue(f??0,t)}}),r.jsx("div",{className:`${c}-overlay-anchor`,children:r.jsx("button",{type:d?"submit":"button",className:`${c}-button`,style:{borderStyle:"solid",borderRadius:S.scalingValue(m??0,t),borderWidth:Ie,paddingTop:S.scalingValue((M==null?void 0:M.top)??0,t),paddingRight:S.scalingValue((M==null?void 0:M.right)??0,t),paddingBottom:S.scalingValue((M==null?void 0:M.bottom)??0,t),paddingLeft:S.scalingValue((M==null?void 0:M.left)??0,t),pointerEvents:d?"auto":void 0,...ee,...R?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:r.jsx("span",{className:`${c}-overlay-anchor`,style:R?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:nt==="submitting"?"...":w})})})]}),De==="success"&&r.jsx("p",{className:`${c}-success`,style:{...Oe},children:we}),De==="error"&&r.jsx("p",{className:`${c}-error`,style:{...Oe},role:"alert",children:ze??qe??z})]})}const nm={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"},im=["hover","focus","filled","success","error"],om=`import React, { useMemo, useState } from 'react';
158
+ `}function tm({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:s}){const l=!!n,d=i&&t||!t,{prefix:c}=S.useScopedStyles(),{type:u="A",fieldsToShow:p=2,fields:b=[],buttonLabel:w,gap:f,fieldsGap:h,buttonCorners:m,buttonStroke:v,buttonPadding:M,isButtonFullWidth:R,inputCorners:L,inputStroke:X,inputPadding:F,inputColor:B,inputTextColor:k,inputBorderColor:C,placeholderColor:j,buttonColor:x,buttonTextColor:W,buttonBorderColor:E,labelTextColor:Z,successColor:P,errorColor:U,fontFamily:V,inputFontSettings:G,inputFontSize:ie,inputLineHeight:$,inputLetterSpacing:I,inputWordSpacing:D,inputTextAppearance:se,buttonFontSettings:oe,buttonFontSize:T,buttonLineHeight:ue,buttonLetterSpacing:A,buttonWordSpacing:ne,buttonTextAppearance:J,labelFontSettings:ve,labelFontSize:Ee,labelLineHeight:me,labelLetterSpacing:de,labelWordSpacing:q,labelTextAppearance:Q,statusFontSettings:Y,statusFontSize:_e,statusLineHeight:Ce,statusLetterSpacing:ke,statusWordSpacing:ce,statusTextAppearance:ge,successMessage:we,errorMessage:z,stateOverrides:le}=e,he=u==="B",xe=b.slice(0,Math.min(p,b.length)),Re={fontSettings:{fontFamily:V,fontWeight:(G==null?void 0:G.fontWeight)??400,fontStyle:(G==null?void 0:G.fontStyle)??"normal"},fontSize:ie??.01,lineHeight:$,letterSpacing:I??0,wordSpacing:D??0,textAppearance:se,color:k},Te=on(Ut(Re,t)),_=S.scalingValue(X??0,t),pe=S.scalingValue(($??ie??.01)+((F==null?void 0:F.top)??0)+((F==null?void 0:F.bottom)??0)+(u==="C"?X??0:(X??0)*2),t),te={...Te,borderStyle:"solid",borderRadius:u==="C"?0:S.scalingValue(L??0,t),...u==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:_,borderLeftWidth:0}:{borderWidth:_},paddingTop:S.scalingValue((F==null?void 0:F.top)??0,t),paddingRight:S.scalingValue((F==null?void 0:F.right)??0,t),paddingBottom:S.scalingValue((F==null?void 0:F.bottom)??0,t),paddingLeft:S.scalingValue((F==null?void 0:F.left)??0,t),height:pe,minHeight:pe},N={fontSettings:{fontFamily:V,fontWeight:(oe==null?void 0:oe.fontWeight)??400,fontStyle:(oe==null?void 0:oe.fontStyle)??"normal"},fontSize:T??.01,lineHeight:ue,letterSpacing:A??0,wordSpacing:ne??0,textAppearance:J,color:W},ee=on(Ut(N,t)),Ie=S.scalingValue(v??0,t),re={fontSettings:{fontFamily:V,fontWeight:(ve==null?void 0:ve.fontWeight)??400,fontStyle:(ve==null?void 0:ve.fontStyle)??"normal"},fontSize:Ee??.01,lineHeight:me,letterSpacing:de??0,wordSpacing:q??0,textAppearance:Q,color:Z},O=Ut(re,t),Ve={fontSettings:{fontFamily:V,fontWeight:(Y==null?void 0:Y.fontWeight)??400,fontStyle:(Y==null?void 0:Y.fontStyle)??"normal"},fontSize:_e??.01,lineHeight:Ce,letterSpacing:ke??0,wordSpacing:ce??0,textAppearance:ge,color:P},Oe=on(Ut(Ve,t)),lt=S.buildColorVars(c,{inputColor:B,inputTextColor:k,inputBorderColor:C,placeholderColor:j!=null&&j.trim()?j:"#cccccc",buttonColor:x,buttonTextColor:W,buttonBorderColor:E,labelTextColor:Z,successColor:P,errorColor:U},nm,im,le),[tt,ht]=a.useState(()=>Object.fromEntries(xe.map(Fe=>[Fe.name,""]))),[nt,Be]=a.useState("idle"),[ye,Pe]=a.useState(null),De=s==="success"?"success":s==="error"?"error":nt,qe=s==="error"?z:ye,Se=s==="filled",Ne=a.useMemo(()=>{if(!Se)return tt;let Fe=null;for(const Ke of xe)(tt[Ke.name]??"").trim().length>0||(Fe=Fe??{...tt},Fe[Ke.name]="Filled");return Fe??tt},[tt,Se,xe]),ze=De==="error"?S.getFormFieldValidationError(xe,Ne):null,ct=`${s&&s!=="default"?`${c}-state-${s}`:""}`.trim(),Je=o==null?void 0:o.submitUrl,$t=(Fe,Ke)=>{ht(je=>({...je,[Fe]:Ke}))},dt=async Fe=>{if(Fe.preventDefault(),!d)return;const Ke=Object.fromEntries(xe.map(ut=>{var pt;return[ut.name,((pt=tt[ut.name])==null?void 0:pt.trim())??""]}).filter(([,ut])=>ut));if(!Je){Be("error"),Pe("No integrations were found for this form.");return}if(Object.keys(Ke).length===0)return;const je=S.getFormFieldValidationError(xe,tt);if(je){Be("error"),Pe(je);return}Be("submitting"),Pe(null);try{const ut=await fetch(Je,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ke)});if(!ut.ok){const pt=await ut.text();throw new Error(pt||`Request failed: ${ut.status}`)}Be("success"),ht(Object.fromEntries(xe.map(pt=>[pt.name,""])))}catch(ut){Be("error"),Pe(ut instanceof Error?ut.message:"Something went wrong")}};return r.jsxs("div",{className:`${c}-wrapper ${c}-type-${u} ${ct}`.trim(),style:lt,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:em(c)}}),r.jsxs("form",{onSubmit:dt,className:`${c}-form`,children:[r.jsx("div",{className:`${c}-fields`,children:xe.map((Fe,Ke)=>r.jsxs(a.Fragment,{children:[Ke>0&&r.jsx("div",{"data-controls":l?"fieldsGap":void 0,className:l?`${c}-control`:void 0,style:{height:S.scalingValue(h??0,t)}}),r.jsxs("div",{className:`${c}-field-group${he?` ${c}-labeled`:""}`,children:[he&&r.jsx("span",{className:`${c}-field-label`,style:O?{...O,lineHeight:O.fontSize}:void 0,children:Fe.label||Fe.name}),Fe.type==="textarea"?r.jsx("textarea",{name:Fe.name,autoComplete:"off",value:Ne[Fe.name]??"",onChange:je=>$t(Fe.name,je.target.value),placeholder:Fe.placeholder,className:`${c}-input`,style:te,rows:1,"data-filled":Se||(Ne[Fe.name]??"").trim().length>0,"data-field-type":"textarea"}):r.jsx("input",{type:Fe.type==="phone"?"tel":Fe.type==="email"?"email":"text",name:Fe.name,autoComplete:"off",value:Ne[Fe.name]??"",onChange:je=>$t(Fe.name,je.target.value),placeholder:Fe.placeholder,required:Fe.isRequired??Fe.type==="email",className:`${c}-input`,style:te,"data-filled":Se||(Ne[Fe.name]??"").trim().length>0})]})]},Ke))}),r.jsx("div",{"data-controls":l?"gap":void 0,className:l?`${c}-control`:void 0,style:{height:S.scalingValue(f??0,t)}}),r.jsx("div",{className:`${c}-overlay-anchor`,children:r.jsx("button",{type:d?"submit":"button",className:`${c}-button`,style:{borderStyle:"solid",borderRadius:S.scalingValue(m??0,t),borderWidth:Ie,paddingTop:S.scalingValue((M==null?void 0:M.top)??0,t),paddingRight:S.scalingValue((M==null?void 0:M.right)??0,t),paddingBottom:S.scalingValue((M==null?void 0:M.bottom)??0,t),paddingLeft:S.scalingValue((M==null?void 0:M.left)??0,t),pointerEvents:d?"auto":void 0,...ee,...R?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:r.jsx("span",{className:`${c}-overlay-anchor`,style:R?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:nt==="submitting"?"...":w})})})]}),De==="success"&&r.jsx("p",{className:`${c}-success`,style:{...Oe},children:we}),De==="error"&&r.jsx("p",{className:`${c}-error`,style:{...Oe},role:"alert",children:ze??qe??z})]})}const nm={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"},im=["hover","focus","filled","success","error"],om=`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: ${zo(14)};
981
981
  color: var(--${e}-error-error-color, var(--${e}-error-color));
982
982
  }
983
- `}const dm=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:s}=S.useScopedStyles(),l=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:c,buttonLabel:u,fieldsToShow:p=1,fontFamily:b,inputFontSettings:w,inputFontSize:f,inputLineHeight:h,inputLetterSpacing:m,inputWordSpacing:v,inputTextAppearance:M,buttonFontSettings:R,buttonFontSize:L,buttonLineHeight:X,buttonLetterSpacing:A,buttonWordSpacing:B,buttonTextAppearance:P,statusFontSettings:C,statusFontSize:j,statusLineHeight:x,statusLetterSpacing:W,statusWordSpacing:E,statusTextAppearance:Z,iconMaxWidth:k,minHeight:U,corners:V,stroke:G,stateOverrides:ie,inputPadding:$,buttonPadding:I,successMessage:D="Thanks for subscribing!",errorMessage:se="Please, fill all required fields."}=e,oe=d.slice(0,Math.min(p,d.length)),[T,ue]=a.useState(()=>Object.fromEntries(oe.map(re=>[re.name,""]))),[F,ne]=a.useState("idle"),[J,ve]=a.useState(null),Ee=o==="success"?"success":o==="error"?"error":F,me=o==="error"?se:J,de=o==="filled",q=a.useMemo(()=>{if(!de)return T;let re=null;for(const O of oe)(T[O.name]??"").trim().length>0||(re=re??{...T},re[O.name]="Filled");return re??T},[de,T,oe]),Q=Ee==="error"?S.getFormFieldValidationError(oe,q):null,Y=o&&o!=="default"?`${s}-state-${o}`:"",_e=oe.some(re=>(q[re.name]??"").trim().length>0),Ce=Y!==`${s}-state-filled`&&_e?`${s}-state-filled`:"",ke=`${Y} ${Ce}`.trim(),ce=i==null?void 0:i.submitUrl,ge=u??"",we=(c==null?void 0:c.icon)??"",z=(c==null?void 0:c.mode)==="On",le=ge||"Submit",he={fontSettings:{fontFamily:b,fontWeight:(w==null?void 0:w.fontWeight)??400,fontStyle:(w==null?void 0:w.fontStyle)??"normal"},fontSize:f??.01,lineHeight:h,letterSpacing:m??0,wordSpacing:v??0,textAppearance:M,color:e.inputTextColor??"#111111"},xe={fontSettings:{fontFamily:b,fontWeight:(R==null?void 0:R.fontWeight)??400,fontStyle:(R==null?void 0:R.fontStyle)??"normal"},fontSize:L??.01,lineHeight:X,letterSpacing:A??0,wordSpacing:B??0,textAppearance:P,color:e.buttonTextColor??"#ffffff"},Re={fontSettings:{fontFamily:b,fontWeight:(C==null?void 0:C.fontWeight)??400,fontStyle:(C==null?void 0:C.fontStyle)??"normal"},fontSize:j??.01,lineHeight:x,letterSpacing:W??0,wordSpacing:E??0,textAppearance:Z,color:e.successColor??"#22c55e"},Te=on(Ut(he,t)),_=on(Ut(xe,t)),pe=on(Ut(Re,t)),te=S.buildColorVars(s,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(he==null?void 0:he.color)??"#111111",buttonTextColor:e.buttonTextColor??(xe==null?void 0:xe.color)??"#ffffff"},um,pm,ie),N={borderRadius:S.scalingValue(V,t),borderWidth:S.scalingValue(G,t),borderStyle:"solid"},ee={borderLeftWidth:S.scalingValue(G,t)},Ie=async re=>{if(re.preventDefault(),!l)return;const O=Object.fromEntries(oe.map(Oe=>{var lt;return[Oe.name,((lt=T[Oe.name])==null?void 0:lt.trim())??""]}).filter(([,Oe])=>Oe));if(!ce){ne("error"),ve("No integrations were found for this form.");return}if(Object.keys(O).length===0)return;const Ve=S.getFormFieldValidationError(oe,T);if(Ve){ne("error"),ve(Ve);return}ne("submitting"),ve(null);try{const Oe=await fetch(ce,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(O)});if(!Oe.ok){const lt=await Oe.text();throw new Error(lt||`Request failed: ${Oe.status}`)}ne("success"),ue(Object.fromEntries(oe.map(lt=>[lt.name,""])))}catch(Oe){ne("error"),ve(Oe instanceof Error?Oe.message:"Something went wrong")}};return r.jsxs("div",{className:`${s}-wrapper ${ke}`.trim(),style:te,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:cm(s)}}),r.jsxs("form",{onSubmit:Ie,className:`${s}-form`,style:{...N,height:S.scalingValue(U,t),minHeight:S.scalingValue(U,t)},children:[r.jsx("div",{className:`${s}-inputWrap ${s}-overlayAnchor`,style:{flex:1,minWidth:0},children:oe.map(re=>r.jsx("input",{type:re.type==="email"?"email":re.type==="phone"?"tel":"text",name:re.name,autoComplete:"off",value:q[re.name]??"",onChange:O=>ue(Ve=>({...Ve,[re.name]:O.target.value})),placeholder:re.placeholder,required:re.isRequired??re.type==="email",className:`${s}-input`,style:{...Te,paddingRight:S.scalingValue($.right,t),paddingLeft:S.scalingValue($.left,t),paddingTop:S.scalingValue($.top,t),paddingBottom:S.scalingValue($.bottom,t)}},re.name))}),r.jsx("div",{className:`${s}-overlayAnchor`,children:r.jsx("button",{type:l?"submit":"button",className:`${s}-submitBtn`,"aria-label":le,style:{..._,...ee,paddingRight:S.scalingValue(I.right,t),paddingLeft:S.scalingValue(I.left,t),paddingTop:S.scalingValue(I.top,t),paddingBottom:S.scalingValue(I.bottom,t),pointerEvents:l?"auto":void 0},children:F==="submitting"?"...":z?we&&r.jsx(rn,{url:we,className:`${s}-submitBtnIcon`,style:{maxWidth:S.scalingValue(k??0,t)},fill:`var(--${s}-button-text-color)`,hoverFill:`var(--${s}-button-text-color)`}):ge})})]}),Ee==="success"&&r.jsx("p",{className:`${s}-success`,style:{...pe},children:D}),Ee==="error"&&r.jsx("p",{className:`${s}-error`,style:{...pe},role:"alert",children:Q??me??se})]})},um={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"},pm=["hover","focus","filled","success","error"],mm=`import React, { useMemo, useState } from 'react';
983
+ `}const dm=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:s}=S.useScopedStyles(),l=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:c,buttonLabel:u,fieldsToShow:p=1,fontFamily:b,inputFontSettings:w,inputFontSize:f,inputLineHeight:h,inputLetterSpacing:m,inputWordSpacing:v,inputTextAppearance:M,buttonFontSettings:R,buttonFontSize:L,buttonLineHeight:X,buttonLetterSpacing:F,buttonWordSpacing:B,buttonTextAppearance:k,statusFontSettings:C,statusFontSize:j,statusLineHeight:x,statusLetterSpacing:W,statusWordSpacing:E,statusTextAppearance:Z,iconMaxWidth:P,minHeight:U,corners:V,stroke:G,stateOverrides:ie,inputPadding:$,buttonPadding:I,successMessage:D="Thanks for subscribing!",errorMessage:se="Please, fill all required fields."}=e,oe=d.slice(0,Math.min(p,d.length)),[T,ue]=a.useState(()=>Object.fromEntries(oe.map(re=>[re.name,""]))),[A,ne]=a.useState("idle"),[J,ve]=a.useState(null),Ee=o==="success"?"success":o==="error"?"error":A,me=o==="error"?se:J,de=o==="filled",q=a.useMemo(()=>{if(!de)return T;let re=null;for(const O of oe)(T[O.name]??"").trim().length>0||(re=re??{...T},re[O.name]="Filled");return re??T},[de,T,oe]),Q=Ee==="error"?S.getFormFieldValidationError(oe,q):null,Y=o&&o!=="default"?`${s}-state-${o}`:"",_e=oe.some(re=>(q[re.name]??"").trim().length>0),Ce=Y!==`${s}-state-filled`&&_e?`${s}-state-filled`:"",ke=`${Y} ${Ce}`.trim(),ce=i==null?void 0:i.submitUrl,ge=u??"",we=(c==null?void 0:c.icon)??"",z=(c==null?void 0:c.mode)==="On",le=ge||"Submit",he={fontSettings:{fontFamily:b,fontWeight:(w==null?void 0:w.fontWeight)??400,fontStyle:(w==null?void 0:w.fontStyle)??"normal"},fontSize:f??.01,lineHeight:h,letterSpacing:m??0,wordSpacing:v??0,textAppearance:M,color:e.inputTextColor??"#111111"},xe={fontSettings:{fontFamily:b,fontWeight:(R==null?void 0:R.fontWeight)??400,fontStyle:(R==null?void 0:R.fontStyle)??"normal"},fontSize:L??.01,lineHeight:X,letterSpacing:F??0,wordSpacing:B??0,textAppearance:k,color:e.buttonTextColor??"#ffffff"},Re={fontSettings:{fontFamily:b,fontWeight:(C==null?void 0:C.fontWeight)??400,fontStyle:(C==null?void 0:C.fontStyle)??"normal"},fontSize:j??.01,lineHeight:x,letterSpacing:W??0,wordSpacing:E??0,textAppearance:Z,color:e.successColor??"#22c55e"},Te=on(Ut(he,t)),_=on(Ut(xe,t)),pe=on(Ut(Re,t)),te=S.buildColorVars(s,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(he==null?void 0:he.color)??"#111111",buttonTextColor:e.buttonTextColor??(xe==null?void 0:xe.color)??"#ffffff"},um,pm,ie),N={borderRadius:S.scalingValue(V,t),borderWidth:S.scalingValue(G,t),borderStyle:"solid"},ee={borderLeftWidth:S.scalingValue(G,t)},Ie=async re=>{if(re.preventDefault(),!l)return;const O=Object.fromEntries(oe.map(Oe=>{var lt;return[Oe.name,((lt=T[Oe.name])==null?void 0:lt.trim())??""]}).filter(([,Oe])=>Oe));if(!ce){ne("error"),ve("No integrations were found for this form.");return}if(Object.keys(O).length===0)return;const Ve=S.getFormFieldValidationError(oe,T);if(Ve){ne("error"),ve(Ve);return}ne("submitting"),ve(null);try{const Oe=await fetch(ce,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(O)});if(!Oe.ok){const lt=await Oe.text();throw new Error(lt||`Request failed: ${Oe.status}`)}ne("success"),ue(Object.fromEntries(oe.map(lt=>[lt.name,""])))}catch(Oe){ne("error"),ve(Oe instanceof Error?Oe.message:"Something went wrong")}};return r.jsxs("div",{className:`${s}-wrapper ${ke}`.trim(),style:te,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:cm(s)}}),r.jsxs("form",{onSubmit:Ie,className:`${s}-form`,style:{...N,height:S.scalingValue(U,t),minHeight:S.scalingValue(U,t)},children:[r.jsx("div",{className:`${s}-inputWrap ${s}-overlayAnchor`,style:{flex:1,minWidth:0},children:oe.map(re=>r.jsx("input",{type:re.type==="email"?"email":re.type==="phone"?"tel":"text",name:re.name,autoComplete:"off",value:q[re.name]??"",onChange:O=>ue(Ve=>({...Ve,[re.name]:O.target.value})),placeholder:re.placeholder,required:re.isRequired??re.type==="email",className:`${s}-input`,style:{...Te,paddingRight:S.scalingValue($.right,t),paddingLeft:S.scalingValue($.left,t),paddingTop:S.scalingValue($.top,t),paddingBottom:S.scalingValue($.bottom,t)}},re.name))}),r.jsx("div",{className:`${s}-overlayAnchor`,children:r.jsx("button",{type:l?"submit":"button",className:`${s}-submitBtn`,"aria-label":le,style:{..._,...ee,paddingRight:S.scalingValue(I.right,t),paddingLeft:S.scalingValue(I.left,t),paddingTop:S.scalingValue(I.top,t),paddingBottom:S.scalingValue(I.bottom,t),pointerEvents:l?"auto":void 0},children:A==="submitting"?"...":z?we&&r.jsx(rn,{url:we,className:`${s}-submitBtnIcon`,style:{maxWidth:S.scalingValue(P??0,t)},fill:`var(--${s}-button-text-color)`,hoverFill:`var(--${s}-button-text-color)`}):ge})})]}),Ee==="success"&&r.jsx("p",{className:`${s}-success`,style:{...pe},children:D}),Ee==="error"&&r.jsx("p",{className:`${s}-error`,style:{...pe},role:"alert",children:Q??me??se})]})},um={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"},pm=["hover","focus","filled","success","error"],mm=`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';
@@ -1689,7 +1689,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
1689
1689
  .${e}-image-hover-grayscale:hover video {
1690
1690
  filter: grayscale(100%);
1691
1691
  }
1692
- `}const bm=30,wm=20,Vr=3,Sm=12,$m=32,Cm=3,Tm=e=>{e.style.setProperty("animation-name","none"),e.style.setProperty("-webkit-animation-name","none"),e.offsetHeight,e.style.removeProperty("animation-name"),e.style.removeProperty("-webkit-animation-name")},Lm=(e,t)=>Array.from({length:t},()=>e).flat(),Rm=e=>typeof e=="string"?{display:e.toLowerCase()==="cover"?"cover":"fit",ratioValue:"16:9",reversed:!1}:{display:(typeof(e==null?void 0:e.display)=="string"?e.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(e==null?void 0:e.ratioValue)??"16:9",reversed:(e==null?void 0:e.reversed)??!1},gc=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),Is=(e,t)=>{if(t<=0||e.children.length<t)return 0;const n=e.children[0],i=e.children[t-1];if(!n||!i)return 0;const o=getComputedStyle(e),s=Number.parseFloat(o.columnGap||o.gap||"0")||0,l=i.getBoundingClientRect().right-n.getBoundingClientRect().left;if(l>0)return l;const d=Array.from({length:t},(u,p)=>e.children[p]),c=gc(d);return c<=0?0:c+s*Math.max(0,t-1)},Im=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=gc(Array.from(e.children));if(i<=0)return 0;const o=getComputedStyle(e),s=Number.parseFloat(o.columnGap||o.gap||"0")||0,l=Number.parseFloat(o.paddingRight)||0;return i+s*Math.max(0,e.children.length-1)+l},Mm=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},Em=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>Mm(i,e))},Pm=e=>{if(e.type==="video")return!0;if(e.type==="image")return!1;const t=e.name??"";return/\.(mp4|webm|ogg|mov)(\?|$)/i.test(t)?!0:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.url??"")},km=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,Am=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,cornerRadius:s,imageHoverClass:l,isFirstSet:d,scaled:c,onFirstSetImageDone:u})=>{var E,Z,k,U;const p=a.useRef(null),b=!!((E=e.image)!=null&&E.url&&Pm(e.image));a.useLayoutEffect(()=>{d&&km(p.current)&&(u==null||u())},[d,(Z=e.image)==null?void 0:Z.url,u]);const w=n.display==="cover",f=n.ratioValue??"1:1",h=n.reversed??!1,[m,v]=f.split(":").map(Number),L=(h?v:m)/(h?m:v),X=i/L,A=X>o?o:X,B=X>o?o*L:i,P=c(B),C=c(A),j={borderRadius:c(s)},x=w?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover",...j}:{pointerEvents:"auto",display:"block",width:"auto",height:"auto",maxWidth:c(i),maxHeight:c(o),objectFit:"contain",...j},W=((k=e.image)==null?void 0:k.url)&&(b?r.jsx("video",{ref:V=>{p.current=V},src:e.image.url,style:x,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto",onLoadedData:d?u:void 0,onError:d?u:void 0}):r.jsx("img",{ref:V=>{p.current=V},src:e.image.url,alt:((U=e.image)==null?void 0:U.name)??"",style:x,onLoad:d?u:void 0,onError:d?u:void 0}));return r.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...w?{width:P}:{width:"max-content",maxWidth:c(i),minWidth:0}},children:r.jsx("div",{className:l,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...w?{width:P,height:C,overflow:"hidden",...j}:{width:"max-content",maxWidth:c(i),height:c(o)}},children:W&&e.link?r.jsx("a",{href:e.link,target:"_self",rel:"noopener noreferrer",className:rt(`${t}-marquee-link`,!w&&`${t}-marquee-link-contain`),children:W}):W})})},Fm=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:s}=S.useScopedStyles(),[l,d]=a.useState(0),c=l>0?Math.round(l):0,u=a.useMemo(()=>xm(s,c),[s,c]),{speed:p,direction:b,pauseOnHover:w,gap:f,imageMaxWidth:h,imageMaxHeight:m,hoverEffect:v,cornerRadius:M=0}=e,R=a.useMemo(()=>Rm(e.imageFit),[e.imageFit]),L=(t==null?void 0:t.length)??0,X=!!o,A=!n||!!i,B=A&&v!=="off"&&v!=="randomize"?`${s}-image-hover-${v}`:void 0,P=n?!!i:!0,j=((t==null?void 0:t.length)??0)>0&&(P||!!n),x=Math.max(0,p)*bm,W=Ce=>S.scalingValue(Ce,n??!1),E=a.useRef(null),Z=a.useRef(null),k=a.useRef(null),[U,V]=a.useState(0),G=P&&w==="on",[ie,$]=a.useState(!1),[I,D]=a.useState({}),se=a.useRef(I);se.current=I;const oe=a.useRef(null),T=a.useRef(0),ue=a.useRef(null),F=a.useMemo(()=>(t??[]).map(Ce=>{var ke;return((ke=Ce.image)==null?void 0:ke.url)??""}).join("\0"),[t]),[ne,J]=a.useState(Vr),ve=a.useMemo(()=>{const Ce=t??[];return Ce.length===0||!(P||!!n)?Ce:Lm(Ce,ne)},[t,P,ne,n]),Ee=a.useMemo(()=>(t??[]).filter(Ce=>{var ke;return!!((ke=Ce.image)!=null&&ke.url)}).length,[t]),me=j?Cm:1;a.useLayoutEffect(()=>{T.current=0,D({}),oe.current=null,J(Vr),d(0)},[F]),a.useEffect(()=>{if(!A||v!=="randomize")return;const Ce=E.current;if(!Ce)return;const ke=z=>{D(le=>{const he=Array.from(z).filter(Re=>Re in le&&!Em(Ce,Re));if(he.length===0)return le;const xe={...le};return he.forEach(Re=>{delete xe[Re]}),xe})},ce=new IntersectionObserver(z=>{const le=new Set;for(const he of z){const xe=he.target.dataset.marqueeItemIndex,Re=xe!==void 0?Number(xe):NaN;Number.isNaN(Re)||le.add(Re)}le.size>0&&ke(le)},{root:Ce,threshold:0});Object.keys(I).forEach(z=>{const le=Number(z);Ce.querySelectorAll(`[data-marquee-item-index="${le}"]`).forEach(he=>ce.observe(he))});const ge={current:0},we=()=>{const z=Object.keys(se.current);z.length!==0&&(ke(z.map(Number)),ge.current=requestAnimationFrame(we))};return Object.keys(se.current).length>0&&(ge.current=requestAnimationFrame(we)),()=>{cancelAnimationFrame(ge.current),ce.disconnect()}},[v,I,A]),a.useLayoutEffect(()=>{if(!j)return;const Ce=E.current,ke=k.current;if(!Ce||!ke)return;const ce={current:0},ge=()=>{const le=Ce.getBoundingClientRect().width||Ce.offsetWidth,he=Im(ke),xe=oe.current,Re=typeof xe=="number"&&Math.abs(xe-he)<=.25;oe.current=he;let Te=ne,_=0;if((P||n)&&L>0&&le>0){const N=Is(ke,L);if(N>=$m){_=N;const ee=Math.min(Sm,Math.max(Vr,Math.ceil(le/N)+1));Te=ee,ee!==ne&&J(ee)}}const te=Te!==ne&&_>0?_*Te:he>0?he:_>0?_*Te:(()=>{const N=Is(ke,L);return N>0?N*Te:0})();te>0?d(N=>N<=0?te:!Re||Math.round(N)===Math.round(te)?N:te):!Re&&l<=0&&(cancelAnimationFrame(ce.current),ce.current=requestAnimationFrame(ge))},we=()=>{cancelAnimationFrame(ce.current),ce.current=requestAnimationFrame(ge)};ue.current=we,we();const z=new ResizeObserver(we);return z.observe(Ce),z.observe(ke),()=>{ue.current=null,cancelAnimationFrame(ce.current),z.disconnect()}},[P,j,l,F,ne,L,n]),a.useLayoutEffect(()=>{if(!j||c<=0)return;const Ce=Z.current;Ce&&Tm(Ce)},[j,c,b,x]),a.useLayoutEffect(()=>{if(!j||l<=0){V(0);return}const Ce=Z.current,ke=k.current;if(!Ce||!ke)return;const ce=()=>{const we=Ce.offsetHeight||Ce.getBoundingClientRect().height,z=Array.from(ke.children).reduce((he,xe)=>Math.max(he,xe.offsetHeight||xe.getBoundingClientRect().height),0),le=we>0?we:z;V(le>0?le:0)};ce();const ge=new ResizeObserver(ce);return ge.observe(Ce),ge.observe(ke),()=>ge.disconnect()},[j,me,ve,n,f,h,m,l,R,I]),a.useLayoutEffect(()=>{if(!n||!X||!j||typeof window>"u")return;const Ce=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame(Ce)},[n,X,j,b,l,U,f,ve]);const de=()=>{G&&$(!0)},q=()=>{G&&$(!1)},Q=a.useCallback(()=>{var Ce;T.current=Math.min(Ee,T.current+1),(Ce=ue.current)==null||Ce.call(ue)},[Ee]),Y=a.useCallback((Ce,ke)=>{D(ce=>{const ge=ce[Ce]??ke,we=(t??[]).filter(le=>le!==ge);if(we.length===0)return ce;const z=we[Math.floor(Math.random()*we.length)];return{...ce,[Ce]:z}})},[t]),_e=(Ce,ke,ce,ge)=>{const we=A&&v==="randomize"&&R.display==="cover"?I[ce]??Ce:Ce,z=`max(${W(f)}, ${wm}px)`,le=`calc(-0.5 * (${z} + ${W(f)}))`;return r.jsxs("div",{className:`${s}-marquee-card`,"data-marquee-item-index":ce,onMouseEnter:A&&v==="randomize"&&R.display==="cover"?()=>Y(ce,Ce):void 0,children:[r.jsx(Am,{item:we,prefix:s,imageFit:R,imageMaxWidth:h,imageMaxHeight:m,cornerRadius:M,imageHoverClass:B,isEditor:n,isFirstSet:ge,scaled:W,onFirstSetImageDone:Q}),X&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${s}-gap-control`,style:{position:"absolute",top:0,right:le,width:z,height:"100%"}})]},`${ke}-${ce}`)};if(j){const Ce=P?G&&ie?"paused":"running":"paused",ke=c>0&&x>0?c/x*1e3:0,ce=`${Math.max(0,ke)/1e3}s`;return r.jsxs("div",{ref:E,className:rt(`${s}-wrapper`,`${s}-marquee-wrapper`),"aria-label":"Marquee",style:U>0?{height:U}:void 0,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),r.jsx("div",{ref:Z,className:`${s}-marquee-track`,"data-direction":b,onMouseEnter:de,onMouseLeave:q,style:{WebkitAnimationDuration:ce,animationDuration:ce,WebkitAnimationPlayState:Ce,animationPlayState:Ce},children:Array.from({length:me},(ge,we)=>r.jsx("div",{ref:we===0?k:void 0,className:rt(`${s}-marquee-row`,`${s}-marquee-set`),style:{gap:W(f),paddingRight:W(f)},"aria-hidden":we>0,children:ve.map((z,le)=>_e(z,we,le,we===0&&le<L))},`set-${we}`))})]})}return r.jsxs("div",{ref:E,className:`${s}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),r.jsx("div",{className:rt(`${s}-marquee-row`,`${s}-marquee-static`),style:{gap:W(f),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((Ce,ke)=>_e(Ce,0,ke))},"marquee-static")]})},Wm=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
1692
+ `}const bm=30,wm=20,Vr=3,Sm=12,$m=32,Cm=3,Tm=e=>{e.style.setProperty("animation-name","none"),e.style.setProperty("-webkit-animation-name","none"),e.offsetHeight,e.style.removeProperty("animation-name"),e.style.removeProperty("-webkit-animation-name")},Lm=(e,t)=>Array.from({length:t},()=>e).flat(),Rm=e=>typeof e=="string"?{display:e.toLowerCase()==="cover"?"cover":"fit",ratioValue:"16:9",reversed:!1}:{display:(typeof(e==null?void 0:e.display)=="string"?e.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(e==null?void 0:e.ratioValue)??"16:9",reversed:(e==null?void 0:e.reversed)??!1},gc=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),Is=(e,t)=>{if(t<=0||e.children.length<t)return 0;const n=e.children[0],i=e.children[t-1];if(!n||!i)return 0;const o=getComputedStyle(e),s=Number.parseFloat(o.columnGap||o.gap||"0")||0,l=i.getBoundingClientRect().right-n.getBoundingClientRect().left;if(l>0)return l;const d=Array.from({length:t},(u,p)=>e.children[p]),c=gc(d);return c<=0?0:c+s*Math.max(0,t-1)},Im=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=gc(Array.from(e.children));if(i<=0)return 0;const o=getComputedStyle(e),s=Number.parseFloat(o.columnGap||o.gap||"0")||0,l=Number.parseFloat(o.paddingRight)||0;return i+s*Math.max(0,e.children.length-1)+l},Mm=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},Em=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>Mm(i,e))},Pm=e=>{if(e.type==="video")return!0;if(e.type==="image")return!1;const t=e.name??"";return/\.(mp4|webm|ogg|mov)(\?|$)/i.test(t)?!0:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.url??"")},km=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,Am=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,cornerRadius:s,imageHoverClass:l,isFirstSet:d,scaled:c,onFirstSetImageDone:u})=>{var E,Z,P,U;const p=a.useRef(null),b=!!((E=e.image)!=null&&E.url&&Pm(e.image));a.useLayoutEffect(()=>{d&&km(p.current)&&(u==null||u())},[d,(Z=e.image)==null?void 0:Z.url,u]);const w=n.display==="cover",f=n.ratioValue??"1:1",h=n.reversed??!1,[m,v]=f.split(":").map(Number),L=(h?v:m)/(h?m:v),X=i/L,F=X>o?o:X,B=X>o?o*L:i,k=c(B),C=c(F),j={borderRadius:c(s)},x=w?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover",...j}:{pointerEvents:"auto",display:"block",width:"auto",height:"auto",maxWidth:c(i),maxHeight:c(o),objectFit:"contain",...j},W=((P=e.image)==null?void 0:P.url)&&(b?r.jsx("video",{ref:V=>{p.current=V},src:e.image.url,style:x,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto",onLoadedData:d?u:void 0,onError:d?u:void 0}):r.jsx("img",{ref:V=>{p.current=V},src:e.image.url,alt:((U=e.image)==null?void 0:U.name)??"",style:x,onLoad:d?u:void 0,onError:d?u:void 0}));return r.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...w?{width:k}:{width:"max-content",maxWidth:c(i),minWidth:0}},children:r.jsx("div",{className:l,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...w?{width:k,height:C,overflow:"hidden",...j}:{width:"max-content",maxWidth:c(i),height:c(o)}},children:W&&e.link?r.jsx("a",{href:e.link,target:"_self",rel:"noopener noreferrer",className:rt(`${t}-marquee-link`,!w&&`${t}-marquee-link-contain`),children:W}):W})})},Fm=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:s}=S.useScopedStyles(),[l,d]=a.useState(0),c=l>0?Math.round(l):0,u=a.useMemo(()=>xm(s,c),[s,c]),{speed:p,direction:b,pauseOnHover:w,gap:f,imageMaxWidth:h,imageMaxHeight:m,hoverEffect:v,cornerRadius:M=0}=e,R=a.useMemo(()=>Rm(e.imageFit),[e.imageFit]),L=(t==null?void 0:t.length)??0,X=!!o,F=!n||!!i,B=F&&v!=="off"&&v!=="randomize"?`${s}-image-hover-${v}`:void 0,k=n?!!i:!0,j=((t==null?void 0:t.length)??0)>0&&(k||!!n),x=Math.max(0,p)*bm,W=Ce=>S.scalingValue(Ce,n??!1),E=a.useRef(null),Z=a.useRef(null),P=a.useRef(null),[U,V]=a.useState(0),G=k&&w==="on",[ie,$]=a.useState(!1),[I,D]=a.useState({}),se=a.useRef(I);se.current=I;const oe=a.useRef(null),T=a.useRef(0),ue=a.useRef(null),A=a.useMemo(()=>(t??[]).map(Ce=>{var ke;return((ke=Ce.image)==null?void 0:ke.url)??""}).join("\0"),[t]),[ne,J]=a.useState(Vr),ve=a.useMemo(()=>{const Ce=t??[];return Ce.length===0||!(k||!!n)?Ce:Lm(Ce,ne)},[t,k,ne,n]),Ee=a.useMemo(()=>(t??[]).filter(Ce=>{var ke;return!!((ke=Ce.image)!=null&&ke.url)}).length,[t]),me=j?Cm:1;a.useLayoutEffect(()=>{T.current=0,D({}),oe.current=null,J(Vr),d(0)},[A]),a.useEffect(()=>{if(!F||v!=="randomize")return;const Ce=E.current;if(!Ce)return;const ke=z=>{D(le=>{const he=Array.from(z).filter(Re=>Re in le&&!Em(Ce,Re));if(he.length===0)return le;const xe={...le};return he.forEach(Re=>{delete xe[Re]}),xe})},ce=new IntersectionObserver(z=>{const le=new Set;for(const he of z){const xe=he.target.dataset.marqueeItemIndex,Re=xe!==void 0?Number(xe):NaN;Number.isNaN(Re)||le.add(Re)}le.size>0&&ke(le)},{root:Ce,threshold:0});Object.keys(I).forEach(z=>{const le=Number(z);Ce.querySelectorAll(`[data-marquee-item-index="${le}"]`).forEach(he=>ce.observe(he))});const ge={current:0},we=()=>{const z=Object.keys(se.current);z.length!==0&&(ke(z.map(Number)),ge.current=requestAnimationFrame(we))};return Object.keys(se.current).length>0&&(ge.current=requestAnimationFrame(we)),()=>{cancelAnimationFrame(ge.current),ce.disconnect()}},[v,I,F]),a.useLayoutEffect(()=>{if(!j)return;const Ce=E.current,ke=P.current;if(!Ce||!ke)return;const ce={current:0},ge=()=>{const le=Ce.getBoundingClientRect().width||Ce.offsetWidth,he=Im(ke),xe=oe.current,Re=typeof xe=="number"&&Math.abs(xe-he)<=.25;oe.current=he;let Te=ne,_=0;if((k||n)&&L>0&&le>0){const N=Is(ke,L);if(N>=$m){_=N;const ee=Math.min(Sm,Math.max(Vr,Math.ceil(le/N)+1));Te=ee,ee!==ne&&J(ee)}}const te=Te!==ne&&_>0?_*Te:he>0?he:_>0?_*Te:(()=>{const N=Is(ke,L);return N>0?N*Te:0})();te>0?d(N=>N<=0?te:!Re||Math.round(N)===Math.round(te)?N:te):!Re&&l<=0&&(cancelAnimationFrame(ce.current),ce.current=requestAnimationFrame(ge))},we=()=>{cancelAnimationFrame(ce.current),ce.current=requestAnimationFrame(ge)};ue.current=we,we();const z=new ResizeObserver(we);return z.observe(Ce),z.observe(ke),()=>{ue.current=null,cancelAnimationFrame(ce.current),z.disconnect()}},[k,j,l,A,ne,L,n]),a.useLayoutEffect(()=>{if(!j||c<=0)return;const Ce=Z.current;Ce&&Tm(Ce)},[j,c,b,x]),a.useLayoutEffect(()=>{if(!j||l<=0){V(0);return}const Ce=Z.current,ke=P.current;if(!Ce||!ke)return;const ce=()=>{const we=Ce.offsetHeight||Ce.getBoundingClientRect().height,z=Array.from(ke.children).reduce((he,xe)=>Math.max(he,xe.offsetHeight||xe.getBoundingClientRect().height),0),le=we>0?we:z;V(le>0?le:0)};ce();const ge=new ResizeObserver(ce);return ge.observe(Ce),ge.observe(ke),()=>ge.disconnect()},[j,me,ve,n,f,h,m,l,R,I]),a.useLayoutEffect(()=>{if(!n||!X||!j||typeof window>"u")return;const Ce=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame(Ce)},[n,X,j,b,l,U,f,ve]);const de=()=>{G&&$(!0)},q=()=>{G&&$(!1)},Q=a.useCallback(()=>{var Ce;T.current=Math.min(Ee,T.current+1),(Ce=ue.current)==null||Ce.call(ue)},[Ee]),Y=a.useCallback((Ce,ke)=>{D(ce=>{const ge=ce[Ce]??ke,we=(t??[]).filter(le=>le!==ge);if(we.length===0)return ce;const z=we[Math.floor(Math.random()*we.length)];return{...ce,[Ce]:z}})},[t]),_e=(Ce,ke,ce,ge)=>{const we=F&&v==="randomize"&&R.display==="cover"?I[ce]??Ce:Ce,z=`max(${W(f)}, ${wm}px)`,le=`calc(-0.5 * (${z} + ${W(f)}))`;return r.jsxs("div",{className:`${s}-marquee-card`,"data-marquee-item-index":ce,onMouseEnter:F&&v==="randomize"&&R.display==="cover"?()=>Y(ce,Ce):void 0,children:[r.jsx(Am,{item:we,prefix:s,imageFit:R,imageMaxWidth:h,imageMaxHeight:m,cornerRadius:M,imageHoverClass:B,isEditor:n,isFirstSet:ge,scaled:W,onFirstSetImageDone:Q}),X&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${s}-gap-control`,style:{position:"absolute",top:0,right:le,width:z,height:"100%"}})]},`${ke}-${ce}`)};if(j){const Ce=k?G&&ie?"paused":"running":"paused",ke=c>0&&x>0?c/x*1e3:0,ce=`${Math.max(0,ke)/1e3}s`;return r.jsxs("div",{ref:E,className:rt(`${s}-wrapper`,`${s}-marquee-wrapper`),"aria-label":"Marquee",style:U>0?{height:U}:void 0,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),r.jsx("div",{ref:Z,className:`${s}-marquee-track`,"data-direction":b,onMouseEnter:de,onMouseLeave:q,style:{WebkitAnimationDuration:ce,animationDuration:ce,WebkitAnimationPlayState:Ce,animationPlayState:Ce},children:Array.from({length:me},(ge,we)=>r.jsx("div",{ref:we===0?P:void 0,className:rt(`${s}-marquee-row`,`${s}-marquee-set`),style:{gap:W(f),paddingRight:W(f)},"aria-hidden":we>0,children:ve.map((z,le)=>_e(z,we,le,we===0&&le<L))},`set-${we}`))})]})}return r.jsxs("div",{ref:E,className:`${s}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),r.jsx("div",{className:rt(`${s}-marquee-row`,`${s}-marquee-static`),style:{gap:W(f),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((Ce,ke)=>_e(Ce,0,ke))},"marquee-static")]})},Wm=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
1693
1693
  import cn from 'classnames';
1694
1694
  import { CommonComponentProps } from '../props';
1695
1695
  import { scalingValue } from '../utils/scalingValue';
@@ -2561,7 +2561,7 @@ type MarqueeProps = {
2561
2561
  pointer-events: auto;
2562
2562
  z-index: 10;
2563
2563
  }
2564
- `}const Om=30,Ms=2,Dm=e=>{e.style.setProperty("animation-name","none"),e.style.setProperty("-webkit-animation-name","none"),e.offsetHeight,e.style.removeProperty("animation-name"),e.style.removeProperty("-webkit-animation-name")},jm=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:s}=S.useScopedStyles(),{align:l,speed:d,direction:c,pauseOnHover:u,gap:p,cardWidth:b,corners:w,stroke:f,strokeColor:h,bgColor:m,padding:v,logoMarginTop:M,logoWidth:R,logoHeight:L,captionMarginTop:X}=e,A=!!o,B=((t==null?void 0:t.length)??0)>0,P=d>0&&(!n||i),C=B&&(P||n),j=Math.max(0,d)*Om,x=_=>S.scalingValue(_,n??!1),W=a.useRef(null),E=a.useRef(null),Z=a.useRef(null),[k,U]=a.useState(0),[V,G]=a.useState(0),ie=V>0?V:0,$=a.useMemo(()=>Hm(s,ie),[s,ie]),[I,D]=a.useState(0),se=P&&u==="on",[oe,T]=a.useState(!1),ue=a.useRef(null),[F,ne]=a.useState(0),[J,ve]=a.useState(0),Ee=a.useRef(null),me=_=>{var te,N,ee,Ie,re;return{fontSettings:{fontFamily:(e==null?void 0:e[`${_}FontFamily`])??"Arial",fontWeight:((te=e==null?void 0:e[`${_}FontSettings`])==null?void 0:te.fontWeight)??400,fontStyle:((N=e==null?void 0:e[`${_}FontSettings`])==null?void 0:N.fontStyle)??"normal"},textAppearance:{textTransform:((ee=e==null?void 0:e[`${_}TextAppearance`])==null?void 0:ee.textTransform)??"none",textDecoration:((Ie=e==null?void 0:e[`${_}TextAppearance`])==null?void 0:Ie.textDecoration)??"none",fontVariant:((re=e==null?void 0:e[`${_}TextAppearance`])==null?void 0:re.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${_}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${_}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${_}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${_}LineHeight`])??.01,color:(e==null?void 0:e[`${_}Color`])??"#000000"}},de=me("text"),q=me("caption"),Q=a.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(_=>{var pe,te;return(((pe=_.text)==null?void 0:pe.length)??0)>0||(((te=_.caption)==null?void 0:te.length)??0)>0}),[t]),Y=a.useMemo(()=>!C||(t==null?void 0:t.length)===0?1:V<=0||k<=0?Ms:Math.max(Ms,Math.ceil(k/V)+1),[C,t==null?void 0:t.length,V,k]);a.useLayoutEffect(()=>{if(!C)return;const _=W.current,pe=Z.current;if(!_||!pe)return;let te=0;const N=()=>{const re=_.getBoundingClientRect().width,O=pe.getBoundingClientRect().width,Ve=Ee.current,Oe=typeof Ve=="number"&&Math.abs(Ve-O)<=.25;if(Ee.current=O,U(re),typeof O=="number"&&O>0&&V<=0){G(O);return}Oe&&O!==V?G(O):!Oe&&V<=0&&(cancelAnimationFrame(te),te=requestAnimationFrame(N))},ee=()=>{cancelAnimationFrame(te),te=requestAnimationFrame(N)};ee();const Ie=new ResizeObserver(ee);return Ie.observe(_),Ie.observe(pe),()=>{cancelAnimationFrame(te),Ie.disconnect()}},[P,C,V]);const _e=ie>0&&j>0?ie/j*1e3:0,Ce=`${Math.max(0,_e)/1e3}s`;a.useLayoutEffect(()=>{if(!C||ie<=0)return;const _=E.current;_&&Dm(_)},[C,ie,c]),a.useLayoutEffect(()=>{if(!C){D(0);return}const _=Z.current,pe=E.current;if(!_||!pe)return;const te=()=>{let ee=0;for(let Ie=0;Ie<_.children.length;Ie++){const O=_.children[Ie].firstElementChild;O&&(ee=Math.max(ee,O.offsetHeight))}ee<=0&&(ee=pe.offsetHeight),D(ee>0?ee:0)};te();const N=new ResizeObserver(te);return N.observe(_),N.observe(pe),()=>{N.disconnect()}},[C,Y,t,n,p,b,v,f,w,R,L,F,J]);const ke=()=>{se&&T(!0)},ce=()=>{se&&T(!1)},ge=a.useMemo(()=>{switch(l){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[l]),we=a.useMemo(()=>{switch(l){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[l]),z=a.useCallback((_,pe,te,N)=>r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ge,width:"100%"},children:[r.jsx("div",{"data-controls":A?N==null?void 0:N.controlsName:void 0,"data-controls-axis":A?"y":void 0,className:A?`${s}-control`:void 0,style:{height:x((N==null?void 0:N.marginTop)??0)}}),r.jsx("div",{...N!=null&&N.dataMeasureKind?{"data-testimonial-measure":N.dataMeasureKind}:{},style:{...Ut(_,n),textAlign:we,pointerEvents:"auto",...typeof(N==null?void 0:N.minHeightPx)=="number"&&N.minHeightPx>0?{minHeight:N.minHeightPx}:{}},children:r.jsx(yi,{content:pe})})]},te),[ge,we,n,A,s,x]),le=a.useCallback((_,pe,te)=>{var N,ee,Ie;return r.jsxs("div",{style:{padding:`${x(v.top)} ${x(v.right)} ${x(v.bottom)} ${x(v.left)}`,width:x(b+f*2),height:"100%",borderRadius:x(w),border:`${x(f)} solid ${h}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[r.jsx("div",{className:`${s}-cover`,style:{background:m}}),r.jsxs("div",{className:`${s}-elements-overlay`,style:{alignItems:ge,textAlign:we},children:[_.text&&z(de,_.text,"text",te!=null&&te.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(te==null?void 0:te.textMinHeightPx)=="number"&&te.textMinHeightPx>0?{minHeightPx:te.textMinHeightPx}:void 0),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ge,width:"100%"},children:[r.jsx("div",{"data-controls":A&&!(te!=null&&te.dataMeasureAttrs)?"logoMarginTop":void 0,className:A&&!(te!=null&&te.dataMeasureAttrs)?`${s}-control`:void 0,style:{height:x(M)}}),r.jsx("div",{style:{width:x(R),height:x(L)},children:((N=_.logo)==null?void 0:N.url)&&r.jsx("img",{src:_.logo.url,alt:((ee=_.logo)==null?void 0:ee.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((Ie=_.logo)==null?void 0:Ie.objectFit)||"contain"}})})]}),_.caption&&z(q,_.caption,"caption",{...te!=null&&te.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:X,...te!=null&&te.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(te==null?void 0:te.captionMinHeightPx)=="number"&&te.captionMinHeightPx>0?{minHeightPx:te.captionMinHeightPx}:{}})]})]},pe)},[m,X,q,b,w,L,M,R,ge,we,v.bottom,v.left,v.right,v.top,z,f,h,de,n,A,s]),he=a.useCallback(_=>{ne(_.maxTextPx),ve(_.maxCaptionPx)},[]);a.useLayoutEffect(()=>{if(!Q){he({maxTextPx:0,maxCaptionPx:0});return}const _=ue.current;if(!_)return;const pe=()=>{S.readTestimonialTextMeasure(_,he)};pe();const te=new ResizeObserver(pe);return te.observe(_),()=>{te.disconnect()}},[Q,he,t,le]);const xe=Q?{textMinHeightPx:F,captionMinHeightPx:J}:void 0,Re=Q?r.jsx("div",{ref:ue,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((_,pe)=>le(_,`measure-${pe}`,{dataMeasureAttrs:!0}))}):null,Te=(_,pe)=>r.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[le(_,`card-${pe}`,xe),A&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${x(p)})`,width:x(p),height:"100%",pointerEvents:"auto",zIndex:2}})]},pe);if(C){const _=P?se&&oe?"paused":"running":"paused";return r.jsxs("div",{ref:W,className:rt(`${s}-wrapper`,`${s}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...I>0?{height:I}:{}},children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:$}}),Re,r.jsx("div",{ref:E,className:`${s}-marquee-track`,"data-direction":c,onMouseEnter:ke,onMouseLeave:ce,style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",width:"max-content",willChange:"transform",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",perspective:"1000px",animationDuration:Ce,WebkitAnimationDuration:Ce,animationPlayState:_,WebkitAnimationPlayState:_},children:Array.from({length:Y},(pe,te)=>r.jsx("div",{ref:te===0?Z:void 0,className:`${s}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:x(p),paddingRight:x(p)},"aria-hidden":te>0,children:t==null?void 0:t.map((N,ee)=>Te(N,`${te}-${ee}`))},`set-${te}`))})]})}return r.jsxs("div",{className:`${s}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:$}}),Re,r.jsx("div",{style:{gap:x(p),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((_,pe)=>Te(_,pe))})]})},zm=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
2564
+ `}const Om=30,Ms=2,Dm=e=>{e.style.setProperty("animation-name","none"),e.style.setProperty("-webkit-animation-name","none"),e.offsetHeight,e.style.removeProperty("animation-name"),e.style.removeProperty("-webkit-animation-name")},jm=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:s}=S.useScopedStyles(),{align:l,speed:d,direction:c,pauseOnHover:u,gap:p,cardWidth:b,corners:w,stroke:f,strokeColor:h,bgColor:m,padding:v,logoMarginTop:M,logoWidth:R,logoHeight:L,captionMarginTop:X}=e,F=!!o,B=((t==null?void 0:t.length)??0)>0,k=d>0&&(!n||i),C=B&&(k||n),j=Math.max(0,d)*Om,x=_=>S.scalingValue(_,n??!1),W=a.useRef(null),E=a.useRef(null),Z=a.useRef(null),[P,U]=a.useState(0),[V,G]=a.useState(0),ie=V>0?V:0,$=a.useMemo(()=>Hm(s,ie),[s,ie]),[I,D]=a.useState(0),se=k&&u==="on",[oe,T]=a.useState(!1),ue=a.useRef(null),[A,ne]=a.useState(0),[J,ve]=a.useState(0),Ee=a.useRef(null),me=_=>{var te,N,ee,Ie,re;return{fontSettings:{fontFamily:(e==null?void 0:e[`${_}FontFamily`])??"Arial",fontWeight:((te=e==null?void 0:e[`${_}FontSettings`])==null?void 0:te.fontWeight)??400,fontStyle:((N=e==null?void 0:e[`${_}FontSettings`])==null?void 0:N.fontStyle)??"normal"},textAppearance:{textTransform:((ee=e==null?void 0:e[`${_}TextAppearance`])==null?void 0:ee.textTransform)??"none",textDecoration:((Ie=e==null?void 0:e[`${_}TextAppearance`])==null?void 0:Ie.textDecoration)??"none",fontVariant:((re=e==null?void 0:e[`${_}TextAppearance`])==null?void 0:re.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${_}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${_}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${_}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${_}LineHeight`])??.01,color:(e==null?void 0:e[`${_}Color`])??"#000000"}},de=me("text"),q=me("caption"),Q=a.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(_=>{var pe,te;return(((pe=_.text)==null?void 0:pe.length)??0)>0||(((te=_.caption)==null?void 0:te.length)??0)>0}),[t]),Y=a.useMemo(()=>!C||(t==null?void 0:t.length)===0?1:V<=0||P<=0?Ms:Math.max(Ms,Math.ceil(P/V)+1),[C,t==null?void 0:t.length,V,P]);a.useLayoutEffect(()=>{if(!C)return;const _=W.current,pe=Z.current;if(!_||!pe)return;let te=0;const N=()=>{const re=_.getBoundingClientRect().width,O=pe.getBoundingClientRect().width,Ve=Ee.current,Oe=typeof Ve=="number"&&Math.abs(Ve-O)<=.25;if(Ee.current=O,U(re),typeof O=="number"&&O>0&&V<=0){G(O);return}Oe&&O!==V?G(O):!Oe&&V<=0&&(cancelAnimationFrame(te),te=requestAnimationFrame(N))},ee=()=>{cancelAnimationFrame(te),te=requestAnimationFrame(N)};ee();const Ie=new ResizeObserver(ee);return Ie.observe(_),Ie.observe(pe),()=>{cancelAnimationFrame(te),Ie.disconnect()}},[k,C,V]);const _e=ie>0&&j>0?ie/j*1e3:0,Ce=`${Math.max(0,_e)/1e3}s`;a.useLayoutEffect(()=>{if(!C||ie<=0)return;const _=E.current;_&&Dm(_)},[C,ie,c]),a.useLayoutEffect(()=>{if(!C){D(0);return}const _=Z.current,pe=E.current;if(!_||!pe)return;const te=()=>{let ee=0;for(let Ie=0;Ie<_.children.length;Ie++){const O=_.children[Ie].firstElementChild;O&&(ee=Math.max(ee,O.offsetHeight))}ee<=0&&(ee=pe.offsetHeight),D(ee>0?ee:0)};te();const N=new ResizeObserver(te);return N.observe(_),N.observe(pe),()=>{N.disconnect()}},[C,Y,t,n,p,b,v,f,w,R,L,A,J]);const ke=()=>{se&&T(!0)},ce=()=>{se&&T(!1)},ge=a.useMemo(()=>{switch(l){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[l]),we=a.useMemo(()=>{switch(l){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[l]),z=a.useCallback((_,pe,te,N)=>r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ge,width:"100%"},children:[r.jsx("div",{"data-controls":F?N==null?void 0:N.controlsName:void 0,"data-controls-axis":F?"y":void 0,className:F?`${s}-control`:void 0,style:{height:x((N==null?void 0:N.marginTop)??0)}}),r.jsx("div",{...N!=null&&N.dataMeasureKind?{"data-testimonial-measure":N.dataMeasureKind}:{},style:{...Ut(_,n),textAlign:we,pointerEvents:"auto",...typeof(N==null?void 0:N.minHeightPx)=="number"&&N.minHeightPx>0?{minHeight:N.minHeightPx}:{}},children:r.jsx(yi,{content:pe})})]},te),[ge,we,n,F,s,x]),le=a.useCallback((_,pe,te)=>{var N,ee,Ie;return r.jsxs("div",{style:{padding:`${x(v.top)} ${x(v.right)} ${x(v.bottom)} ${x(v.left)}`,width:x(b+f*2),height:"100%",borderRadius:x(w),border:`${x(f)} solid ${h}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[r.jsx("div",{className:`${s}-cover`,style:{background:m}}),r.jsxs("div",{className:`${s}-elements-overlay`,style:{alignItems:ge,textAlign:we},children:[_.text&&z(de,_.text,"text",te!=null&&te.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(te==null?void 0:te.textMinHeightPx)=="number"&&te.textMinHeightPx>0?{minHeightPx:te.textMinHeightPx}:void 0),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ge,width:"100%"},children:[r.jsx("div",{"data-controls":F&&!(te!=null&&te.dataMeasureAttrs)?"logoMarginTop":void 0,className:F&&!(te!=null&&te.dataMeasureAttrs)?`${s}-control`:void 0,style:{height:x(M)}}),r.jsx("div",{style:{width:x(R),height:x(L)},children:((N=_.logo)==null?void 0:N.url)&&r.jsx("img",{src:_.logo.url,alt:((ee=_.logo)==null?void 0:ee.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((Ie=_.logo)==null?void 0:Ie.objectFit)||"contain"}})})]}),_.caption&&z(q,_.caption,"caption",{...te!=null&&te.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:X,...te!=null&&te.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(te==null?void 0:te.captionMinHeightPx)=="number"&&te.captionMinHeightPx>0?{minHeightPx:te.captionMinHeightPx}:{}})]})]},pe)},[m,X,q,b,w,L,M,R,ge,we,v.bottom,v.left,v.right,v.top,z,f,h,de,n,F,s]),he=a.useCallback(_=>{ne(_.maxTextPx),ve(_.maxCaptionPx)},[]);a.useLayoutEffect(()=>{if(!Q){he({maxTextPx:0,maxCaptionPx:0});return}const _=ue.current;if(!_)return;const pe=()=>{S.readTestimonialTextMeasure(_,he)};pe();const te=new ResizeObserver(pe);return te.observe(_),()=>{te.disconnect()}},[Q,he,t,le]);const xe=Q?{textMinHeightPx:A,captionMinHeightPx:J}:void 0,Re=Q?r.jsx("div",{ref:ue,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((_,pe)=>le(_,`measure-${pe}`,{dataMeasureAttrs:!0}))}):null,Te=(_,pe)=>r.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[le(_,`card-${pe}`,xe),F&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${x(p)})`,width:x(p),height:"100%",pointerEvents:"auto",zIndex:2}})]},pe);if(C){const _=k?se&&oe?"paused":"running":"paused";return r.jsxs("div",{ref:W,className:rt(`${s}-wrapper`,`${s}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...I>0?{height:I}:{}},children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:$}}),Re,r.jsx("div",{ref:E,className:`${s}-marquee-track`,"data-direction":c,onMouseEnter:ke,onMouseLeave:ce,style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",width:"max-content",willChange:"transform",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",perspective:"1000px",animationDuration:Ce,WebkitAnimationDuration:Ce,animationPlayState:_,WebkitAnimationPlayState:_},children:Array.from({length:Y},(pe,te)=>r.jsx("div",{ref:te===0?Z:void 0,className:`${s}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:x(p),paddingRight:x(p)},"aria-hidden":te>0,children:t==null?void 0:t.map((N,ee)=>Te(N,`${te}-${ee}`))},`set-${te}`))})]})}return r.jsxs("div",{className:`${s}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:$}}),Re,r.jsx("div",{style:{gap:x(p),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((_,pe)=>Te(_,pe))})]})},zm=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
2565
2565
  import cn from 'classnames';
2566
2566
  import { CommonComponentProps } from '../props';
2567
2567
  import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
@@ -3316,7 +3316,7 @@ type TestimonialsSettings = {
3316
3316
  width: 100%;
3317
3317
  height: 100%;
3318
3318
  }
3319
- `}const qm=3e3,Um=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:s}=S.useScopedStyles(),l=t||[],{speed:d,align:c,width:u,imageMarginTop:p,textMarginTop:b,captionMarginTop:w,imageWidth:f,imageHeight:h,controlsWidth:m,controlsColor:v,controlsHoverColor:M}=e,R=d>0&&(!n||!!i),[L,X]=a.useState(0),[A,B]=a.useState(null),[P,C]=a.useState(!1),j=a.useRef(null),x=a.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),W=a.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);a.useEffect(()=>{X(0),B(null),C(!1)},[l.length]);const E=l[L],Z=A===null?null:l[A],k=me=>{var q,Q,Y,_e,Ce;return{fontSettings:{fontFamily:(e==null?void 0:e[`${me}FontFamily`])??"Arial",fontWeight:((q=e==null?void 0:e[`${me}FontSettings`])==null?void 0:q.fontWeight)??400,fontStyle:((Q=e==null?void 0:e[`${me}FontSettings`])==null?void 0:Q.fontStyle)??"normal"},textAppearance:{textTransform:((Y=e==null?void 0:e[`${me}TextAppearance`])==null?void 0:Y.textTransform)??"none",textDecoration:((_e=e==null?void 0:e[`${me}TextAppearance`])==null?void 0:_e.textDecoration)??"none",fontVariant:((Ce=e==null?void 0:e[`${me}TextAppearance`])==null?void 0:Ce.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${me}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${me}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${me}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${me}WordSpacing`])??0,color:(e==null?void 0:e[`${me}Color`])??"#000000"}},U=k("text"),V=k("caption"),G=l.length>1&&l.some(me=>{var de,q;return(((de=me.text)==null?void 0:de.length)??0)>0||(((q=me.caption)==null?void 0:q.length)??0)>0}),ie=a.useRef(null),[$,I]=a.useState(0),[D,se]=a.useState(0),oe=e.controls??{mode:"Off",icon:null},T=l.length>1,ue=a.useCallback((me,de)=>!T||de===me?me:(j.current&&window.clearTimeout(j.current),B(me),C(!0),j.current=window.setTimeout(()=>{B(null),C(!1),j.current=null},300),de),[T]),F=a.useCallback(()=>{T&&X(me=>ue(me,(me-1+l.length)%l.length))},[T,ue,l.length]),ne=a.useCallback(()=>{T&&X(me=>ue(me,(me+1)%l.length))},[T,ue,l.length]);a.useEffect(()=>{if(!R||!T)return;const me=Math.max(300,qm/d),de=window.setInterval(()=>{X(q=>ue(q,(q+1)%l.length))},me);return()=>{window.clearInterval(de)}},[R,T,ue,l.length,d]),a.useEffect(()=>()=>{j.current&&window.clearTimeout(j.current)},[]);const J=(me,de)=>{var Ce,ke,ce,ge;const q=de==null?void 0:de.textMinHeightPx,Q=de==null?void 0:de.captionMinHeightPx,Y=de==null?void 0:de.dataMeasureAttrs,_e=o&&!(de!=null&&de.dataMeasureAttrs)&&!(de!=null&&de.hideControls);return r.jsxs(r.Fragment,{children:[me.text&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:x,width:"100%"},children:[r.jsx("div",{"data-controls":_e?"textMarginTop":void 0,className:_e?`${s}-control`:void 0,style:{height:S.scalingValue(b??0,n??!1)}}),r.jsx("div",{...Y&&{"data-testimonial-measure":"text"},style:{...Ut(U,n),...q&&q>0?{minHeight:q}:{},textAlign:W,pointerEvents:"auto"},children:r.jsx(yi,{content:me.text})})]}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:x,width:"100%"},children:[r.jsx("div",{"data-controls":_e?"imageMarginTop":void 0,className:_e?`${s}-control`:void 0,style:{height:S.scalingValue(p??0,n??!1)}}),r.jsx("div",{style:{width:S.scalingValue(f??0,n??!1),height:S.scalingValue(h??0,n??!1)},children:((Ce=me.image)==null?void 0:Ce.url)&&r.jsx("img",{src:(ke=me.image)==null?void 0:ke.url,alt:((ce=me.image)==null?void 0:ce.name)??"",className:`${s}-icon`,style:{objectFit:((ge=me.image)==null?void 0:ge.objectFit)||"contain"}})})]}),me.caption&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:x,width:"100%"},children:[r.jsx("div",{"data-controls":_e?"captionMarginTop":void 0,className:_e?`${s}-control`:void 0,style:{height:S.scalingValue(w??0,n??!1)}}),r.jsx("div",{...Y?{"data-testimonial-measure":"caption"}:{},style:{...Ut(V,n),...Q&&Q>0?{minHeight:Q}:{},textAlign:W,pointerEvents:"auto"},children:r.jsx(yi,{content:me.caption})})]})]})},ve=a.useCallback(me=>{I(me.maxTextPx),se(me.maxCaptionPx)},[]);if(a.useLayoutEffect(()=>{if(!G){ve({maxTextPx:0,maxCaptionPx:0});return}const me=ie.current;if(!me)return;const de=()=>{S.readTestimonialTextMeasure(me,ve)};de();const q=new ResizeObserver(de);return q.observe(me),()=>{q.disconnect()}},[G,ve,t]),!E)return r.jsx(r.Fragment,{});const Ee=G?{textMinHeightPx:$,captionMinHeightPx:D}:void 0;return r.jsx(r.Fragment,{children:r.jsxs("div",{className:`${s}-container`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Gm(s)}}),r.jsxs("div",{className:`${s}-wrapper`,style:{width:S.scalingValue(u??0,n??!1),alignItems:x},children:[G&&r.jsx("div",{ref:ie,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:l.map((me,de)=>r.jsx("div",{style:{width:"100%"},children:J(me,{dataMeasureAttrs:!0})},de))}),r.jsxs("div",{className:`${s}-fade-stack`,children:[Z&&P&&r.jsx("div",{className:rt(`${s}-fade-item-prev`,`${s}-fade-out`),children:J(Z,{...Ee,hideControls:!0})}),r.jsx("div",{className:rt(`${s}-fade-item-current`,P?`${s}-fade-in`:void 0),children:J(E,Ee)})]})]}),oe.mode==="On"&&r.jsxs("div",{className:`${s}-controls`,children:[r.jsx("div",{className:`${s}-arrow`,style:{width:S.scalingValue(m??.02,n??!1),height:S.scalingValue(m??.02,n??!1),"--arrow-hover-color":M},children:r.jsx("button",{type:"button",className:`${s}-arrow-inner`,onClick:F,disabled:!T,"aria-label":"Previous testimonial",children:oe.icon&&r.jsx(rn,{url:oe.icon,fill:v,hoverFill:M,className:rt(`${s}-arrow-img`,`${s}-mirror`)})})}),r.jsx("div",{className:rt(`${s}-arrow`,`${s}-next-arrow`),style:{width:S.scalingValue(m??.02,n??!1),height:S.scalingValue(m??.02,n??!1),"--arrow-hover-color":M},children:r.jsx("button",{type:"button",className:`${s}-arrow-inner`,onClick:ne,disabled:!T,"aria-label":"Next testimonial",children:oe.icon&&r.jsx(rn,{url:oe.icon,fill:v,hoverFill:M,className:`${s}-arrow-img`})})})]})]})})},Km=`import cn from 'classnames';
3319
+ `}const qm=3e3,Um=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:s}=S.useScopedStyles(),l=t||[],{speed:d,align:c,width:u,imageMarginTop:p,textMarginTop:b,captionMarginTop:w,imageWidth:f,imageHeight:h,controlsWidth:m,controlsColor:v,controlsHoverColor:M}=e,R=d>0&&(!n||!!i),[L,X]=a.useState(0),[F,B]=a.useState(null),[k,C]=a.useState(!1),j=a.useRef(null),x=a.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),W=a.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);a.useEffect(()=>{X(0),B(null),C(!1)},[l.length]);const E=l[L],Z=F===null?null:l[F],P=me=>{var q,Q,Y,_e,Ce;return{fontSettings:{fontFamily:(e==null?void 0:e[`${me}FontFamily`])??"Arial",fontWeight:((q=e==null?void 0:e[`${me}FontSettings`])==null?void 0:q.fontWeight)??400,fontStyle:((Q=e==null?void 0:e[`${me}FontSettings`])==null?void 0:Q.fontStyle)??"normal"},textAppearance:{textTransform:((Y=e==null?void 0:e[`${me}TextAppearance`])==null?void 0:Y.textTransform)??"none",textDecoration:((_e=e==null?void 0:e[`${me}TextAppearance`])==null?void 0:_e.textDecoration)??"none",fontVariant:((Ce=e==null?void 0:e[`${me}TextAppearance`])==null?void 0:Ce.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${me}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${me}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${me}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${me}WordSpacing`])??0,color:(e==null?void 0:e[`${me}Color`])??"#000000"}},U=P("text"),V=P("caption"),G=l.length>1&&l.some(me=>{var de,q;return(((de=me.text)==null?void 0:de.length)??0)>0||(((q=me.caption)==null?void 0:q.length)??0)>0}),ie=a.useRef(null),[$,I]=a.useState(0),[D,se]=a.useState(0),oe=e.controls??{mode:"Off",icon:null},T=l.length>1,ue=a.useCallback((me,de)=>!T||de===me?me:(j.current&&window.clearTimeout(j.current),B(me),C(!0),j.current=window.setTimeout(()=>{B(null),C(!1),j.current=null},300),de),[T]),A=a.useCallback(()=>{T&&X(me=>ue(me,(me-1+l.length)%l.length))},[T,ue,l.length]),ne=a.useCallback(()=>{T&&X(me=>ue(me,(me+1)%l.length))},[T,ue,l.length]);a.useEffect(()=>{if(!R||!T)return;const me=Math.max(300,qm/d),de=window.setInterval(()=>{X(q=>ue(q,(q+1)%l.length))},me);return()=>{window.clearInterval(de)}},[R,T,ue,l.length,d]),a.useEffect(()=>()=>{j.current&&window.clearTimeout(j.current)},[]);const J=(me,de)=>{var Ce,ke,ce,ge;const q=de==null?void 0:de.textMinHeightPx,Q=de==null?void 0:de.captionMinHeightPx,Y=de==null?void 0:de.dataMeasureAttrs,_e=o&&!(de!=null&&de.dataMeasureAttrs)&&!(de!=null&&de.hideControls);return r.jsxs(r.Fragment,{children:[me.text&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:x,width:"100%"},children:[r.jsx("div",{"data-controls":_e?"textMarginTop":void 0,className:_e?`${s}-control`:void 0,style:{height:S.scalingValue(b??0,n??!1)}}),r.jsx("div",{...Y&&{"data-testimonial-measure":"text"},style:{...Ut(U,n),...q&&q>0?{minHeight:q}:{},textAlign:W,pointerEvents:"auto"},children:r.jsx(yi,{content:me.text})})]}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:x,width:"100%"},children:[r.jsx("div",{"data-controls":_e?"imageMarginTop":void 0,className:_e?`${s}-control`:void 0,style:{height:S.scalingValue(p??0,n??!1)}}),r.jsx("div",{style:{width:S.scalingValue(f??0,n??!1),height:S.scalingValue(h??0,n??!1)},children:((Ce=me.image)==null?void 0:Ce.url)&&r.jsx("img",{src:(ke=me.image)==null?void 0:ke.url,alt:((ce=me.image)==null?void 0:ce.name)??"",className:`${s}-icon`,style:{objectFit:((ge=me.image)==null?void 0:ge.objectFit)||"contain"}})})]}),me.caption&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:x,width:"100%"},children:[r.jsx("div",{"data-controls":_e?"captionMarginTop":void 0,className:_e?`${s}-control`:void 0,style:{height:S.scalingValue(w??0,n??!1)}}),r.jsx("div",{...Y?{"data-testimonial-measure":"caption"}:{},style:{...Ut(V,n),...Q&&Q>0?{minHeight:Q}:{},textAlign:W,pointerEvents:"auto"},children:r.jsx(yi,{content:me.caption})})]})]})},ve=a.useCallback(me=>{I(me.maxTextPx),se(me.maxCaptionPx)},[]);if(a.useLayoutEffect(()=>{if(!G){ve({maxTextPx:0,maxCaptionPx:0});return}const me=ie.current;if(!me)return;const de=()=>{S.readTestimonialTextMeasure(me,ve)};de();const q=new ResizeObserver(de);return q.observe(me),()=>{q.disconnect()}},[G,ve,t]),!E)return r.jsx(r.Fragment,{});const Ee=G?{textMinHeightPx:$,captionMinHeightPx:D}:void 0;return r.jsx(r.Fragment,{children:r.jsxs("div",{className:`${s}-container`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Gm(s)}}),r.jsxs("div",{className:`${s}-wrapper`,style:{width:S.scalingValue(u??0,n??!1),alignItems:x},children:[G&&r.jsx("div",{ref:ie,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:l.map((me,de)=>r.jsx("div",{style:{width:"100%"},children:J(me,{dataMeasureAttrs:!0})},de))}),r.jsxs("div",{className:`${s}-fade-stack`,children:[Z&&k&&r.jsx("div",{className:rt(`${s}-fade-item-prev`,`${s}-fade-out`),children:J(Z,{...Ee,hideControls:!0})}),r.jsx("div",{className:rt(`${s}-fade-item-current`,k?`${s}-fade-in`:void 0),children:J(E,Ee)})]})]}),oe.mode==="On"&&r.jsxs("div",{className:`${s}-controls`,children:[r.jsx("div",{className:`${s}-arrow`,style:{width:S.scalingValue(m??.02,n??!1),height:S.scalingValue(m??.02,n??!1),"--arrow-hover-color":M},children:r.jsx("button",{type:"button",className:`${s}-arrow-inner`,onClick:A,disabled:!T,"aria-label":"Previous testimonial",children:oe.icon&&r.jsx(rn,{url:oe.icon,fill:v,hoverFill:M,className:rt(`${s}-arrow-img`,`${s}-mirror`)})})}),r.jsx("div",{className:rt(`${s}-arrow`,`${s}-next-arrow`),style:{width:S.scalingValue(m??.02,n??!1),height:S.scalingValue(m??.02,n??!1),"--arrow-hover-color":M},children:r.jsx("button",{type:"button",className:`${s}-arrow-inner`,onClick:ne,disabled:!T,"aria-label":"Next testimonial",children:oe.icon&&r.jsx(rn,{url:oe.icon,fill:v,hoverFill:M,className:`${s}-arrow-img`})})})]})]})})},Km=`import cn from 'classnames';
3320
3320
  import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
3321
3321
  import { CommonComponentProps } from '../props';
3322
3322
  import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
@@ -4159,7 +4159,7 @@ type TestimonialsSettings = {
4159
4159
  z-index: 2;
4160
4160
  width: 100%;
4161
4161
  }
4162
- `}function eg(){return Math.random()<.5?"ltr":"ttb"}function tg(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function ng(e){const t=eg();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{tg(e)})})}const vn=500,ig=750,Nn="cubic-bezier(0.22, 1, 0.36, 1)",og=72,rg=50;function ag(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 sg(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function lg(e){const[t]=e.media;return t!=null&&t.url?t:null}function hc(e){return!Array.isArray(e)||e.length===0?[]:ag(e)?e.flatMap(t=>{const n=sg(t);if(!n)return[];const i=lg(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 gi(e){return e.type==="video"}function cg(e){const t=new Set,n=[];for(const i of e){const o=hc(i.gallery);for(const s of o){const l=s.lightboxMedia;l!=null&&l.url&&!t.has(l.url)&&(t.add(l.url),n.push(l))}}return n}function dg({mediaList:e}){return e.length===0?null:r.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>gi(t)?r.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):r.jsx("img",{src:t.url,alt:""},t.url))})}function ug(e){e.pause(),e.removeAttribute("src"),e.load()}function As({media:e,className:t,style:n,onMediaClick:i}){return gi(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 Fs(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function pg(e,t){if(!t||!t.width||!t.height||!e.width||!e.height)return e;const n=t.width/t.height,i=e.width/e.height;if(n>i){const s=e.width/n;return{width:e.width,height:s,left:e.left,top:e.top+(e.height-s)/2}}const o=e.height*n;return{width:o,height:e.height,left:e.left+(e.width-o)/2,top:e.top}}function mg({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:s,onMouseMove:l}){return a.useEffect(()=>{const d=n.current;if(d)return()=>{ug(d)}},[e,n]),r.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:s,onMouseMove:l,style:i})}function gg({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:s,onPrev:l,onNext:d,counterClassName:c,counterStyle:u}){const p=i==="cover",b=a.useRef(null),w=a.useRef(null),f=a.useRef(null),h=a.useRef(null),m=a.useRef(0),v=a.useRef(0),M=a.useRef("none"),R=a.useRef(!1),L=a.useRef(!1),X=a.useRef(null),A=a.useRef(0),B=a.useRef(null),P=a.useRef(!1),C=a.useRef(null),j=a.useRef(null),x=a.useRef(null),W=a.useRef(()=>{}),[E,Z]=a.useState(null),[k,U]=a.useState(null),[V,G]=a.useState("opening"),[ie,$]=a.useState(0),[I,D]=a.useState(0),[se,oe]=a.useState(null),[T,ue]=a.useState(!1),[F,ne]=a.useState(!1),[J,ve]=a.useState(!1),[Ee,me]=a.useState(null),de=a.useRef(n),q=a.useRef(void 0),Q=t[n],Y=Q?gi(Q):!1,_e=I!==0||T,Ce=se!==null,ke=a.useCallback(Se=>{const Ne=Se.currentTarget,ze=Ne instanceof HTMLVideoElement?{width:Ne.videoWidth,height:Ne.videoHeight}:{width:Ne.naturalWidth,height:Ne.naturalHeight};!ze.width||!ze.height||me(ze)},[]);a.useEffect(()=>{X.current=k},[k]),a.useEffect(()=>{const Se=b.current;if(!Se)return;const Ne=()=>U(Fs(Se));Ne();const ze=new ResizeObserver(Ne);return ze.observe(Se),()=>ze.disconnect()},[]);const ce=a.useCallback(()=>{C.current!==null&&(window.clearTimeout(C.current),C.current=null)},[]),ge=a.useCallback(()=>{const Se=j.current;j.current=null,ce(),B.current=null,P.current=!1,oe(null),ue(!1),D(0),A.current=0,ne(!1),R.current=!1,v.current=0,M.current="none",Se===1?d():Se===-1&&l()},[ce,d,l]),we=a.useCallback(()=>{ce(),j.current=null,B.current=null,P.current=!1,oe(null),ue(!1),D(0),A.current=0},[ce]),z=a.useCallback(()=>{ce(),C.current=window.setTimeout(()=>{j.current!==null&&ge()},vn+32)},[ce,ge]),le=a.useCallback((Se,Ne)=>{var Xe;const ze=((Xe=X.current)==null?void 0:Xe.width)??0;if(ce(),B.current=Se,oe(Se),P.current=!0,ue(!0),Ne){j.current=Se;const ct=-Se*ze;A.current=ct,D(ct),z();return}A.current=0,D(0),C.current=window.setTimeout(()=>{C.current=null,we()},vn+32)},[ce,we,z]),he=a.useCallback(Se=>{if(!(t.length<=1)){if(P.current){if(j.current===Se){x.current=Se,ge();return}we()}ce(),B.current=Se,oe(Se),P.current=!1,ue(!1),A.current=0,D(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{le(Se,!0)})})}},[t.length,le,ge,we,ce]);W.current=he;const xe=a.useCallback(Se=>{Se.propertyName!=="transform"||!P.current||j.current!==null&&ge()},[ge]),Re=a.useCallback(()=>{const Se=w.current;if(!Se)return;const Ne=Fs(Se);!Ne.width||!Ne.height||Z(Ne)},[]);a.useEffect(()=>{Re();const Se=w.current;if(!Se)return;const Ne=new ResizeObserver(()=>Re());return Ne.observe(Se),()=>Ne.disconnect()},[Re]),a.useEffect(()=>{V==="opening"&&E&&G("open")},[V,E]),a.useEffect(()=>{if(V!=="closing")return;const Se=setTimeout(()=>s(),vn);return()=>clearTimeout(Se)},[V,s]),a.useEffect(()=>()=>{ce()},[ce]),a.useLayoutEffect(()=>{de.current===n&&q.current===(Q==null?void 0:Q.url)||(ce(),j.current=null,oe(null),$(0),D(0),ue(!1),ve(!1),ne(!1),me(null),m.current=0,v.current=0,M.current="none",R.current=!1,P.current=!1,A.current=0,B.current=null,h.current=null,L.current=!1,de.current=n,q.current=Q==null?void 0:Q.url)},[n,Q==null?void 0:Q.url,ce]),a.useLayoutEffect(()=>{const Se=x.current;Se!==null&&(x.current=null,requestAnimationFrame(()=>{W.current(Se)}))},[n,Q==null?void 0:Q.url]),a.useEffect(()=>{if(V!=="open")return;let Se=null;const Ne=()=>{Se&&(document.removeEventListener("click",Se,!0),Se=null)},ze=()=>{Ne(),Se=dt=>{dt.stopPropagation(),dt.preventDefault(),Ne()},document.addEventListener("click",Se,!0)},Xe=dt=>{const Fe=dt<0?1:-1;if(Math.abs(dt)>rg&&t.length>1){le(Fe,!0);return}le(Fe,!1)},ct=dt=>{if(dt.touches.length!==1||P.current)return;const Fe=dt.touches[0];L.current=!0,h.current={x:Fe.clientX,y:Fe.clientY},M.current="none",v.current=0,R.current=!1},Je=dt=>{if(!h.current||dt.touches.length!==1||P.current)return;const Fe=dt.touches[0],Ke=Fe.clientX-h.current.x,je=Fe.clientY-h.current.y;if(M.current==="none"){if(Math.abs(Ke)<10&&Math.abs(je)<10)return;if(Math.abs(Ke)>Math.abs(je)){if(t.length<=1)return;M.current="horizontal"}else if(je>0)M.current="vertical";else return}if(M.current==="horizontal"){R.current=!0,ne(!0),v.current=Ke;const ut=Ke<0?1:-1;B.current!==ut&&(B.current=ut,oe(ut)),A.current=Ke,D(Ke),dt.preventDefault();return}M.current==="vertical"&&(R.current=!0,ne(!0),m.current=je,$(je),dt.preventDefault())},$t=()=>{if(!h.current)return;const dt=M.current,Fe=R.current;if(Fe&&dt==="horizontal")Xe(v.current),ze();else if(Fe&&dt==="vertical")if(m.current>og){const je=window.innerHeight;m.current=je,ve(!0),$(je),G("closing")}else m.current=0,$(0),ze();else dt==="horizontal"&&Math.abs(v.current)>0&&(Xe(v.current),ze());h.current=null,M.current="none",v.current=0,R.current=!1,ne(!1)};return document.addEventListener("touchstart",ct,{passive:!0}),document.addEventListener("touchmove",Je,{passive:!1}),document.addEventListener("touchend",$t),document.addEventListener("touchcancel",$t),()=>{document.removeEventListener("touchstart",ct),document.removeEventListener("touchmove",Je),document.removeEventListener("touchend",$t),document.removeEventListener("touchcancel",$t),Ne()}},[V,t.length,le]),a.useEffect(()=>{const Se=Ne=>{Ne.key==="Escape"&&(Ne.preventDefault(),Ne.stopPropagation(),V!=="closing"&&G("closing"))};return window.addEventListener("keydown",Se,!0),()=>window.removeEventListener("keydown",Se,!0)},[V]);const Te=()=>{V!=="closing"&&G("closing")},_=V==="open",pe=V==="closing",te=ie>0?Math.max(0,1-ie/500):1,N=ie>0?Math.max(.35,1-ie/500):1,ee=E?p?E:pg(E,Ee):null,Ie=Se=>{if(Se.stopPropagation(),L.current){L.current=!1;return}if(t.length<=1)return;const Ne=ee??Se.currentTarget.getBoundingClientRect(),ze=Se.clientY-Ne.top,Xe=Math.min(52,Ne.height*.2);if(!(ze>Ne.height-Xe)){if(Se.clientX-Ne.left<Ne.width/2){he(-1);return}he(1)}},re=Se=>{if(t.length<=1)return;const Ne=ee??Se.currentTarget.getBoundingClientRect(),ze=Se.clientX-Ne.left,Xe=Se.clientY-Ne.top,ct=Math.min(52,Ne.height*.2);if(Xe>Ne.height-ct){Se.currentTarget.style.cursor="default";return}Se.currentTarget.style.cursor=ze<Ne.width/2?"w-resize":"e-resize"},O={position:"fixed",top:k==null?void 0:k.top,left:k==null?void 0:k.left,width:k==null?void 0:k.width,height:k==null?void 0:k.height,zIndex:9998},Ve=p?"cover":"contain",Oe=I!==0||ie>0?`translate(${I}px, ${ie}px)`:void 0,lt=F&&!T?"none":T?`transform ${vn}ms ${Nn}`:J?`transform ${vn}ms ${Nn}, opacity ${vn}ms ${Nn}`:V==="opening"||pe?`opacity ${vn}ms ${Nn}`:"none",tt={...O,transform:Oe,opacity:ie>0?N:V==="opening"||pe?0:1,transition:lt,pointerEvents:"none"},ht={position:"absolute",top:((ee==null?void 0:ee.top)??0)-((k==null?void 0:k.top)??0),left:((ee==null?void 0:ee.left)??0)-((k==null?void 0:k.left)??0),width:ee==null?void 0:ee.width,height:ee==null?void 0:ee.height,objectFit:Ve,pointerEvents:Y&&_&&!_e?"auto":"none",touchAction:Y&&_?"none":void 0},nt=(k==null?void 0:k.width)??0,Be=Ce?(n+se+t.length)%t.length:null,ye=Be!==null?t[Be]:null,Pe={...O,transform:Ce?`translateX(${se*nt+I}px)`:void 0,opacity:1,transition:T?`transform ${vn}ms ${Nn}`:"none",pointerEvents:"none"},De={position:"absolute",top:((E==null?void 0:E.top)??0)-((k==null?void 0:k.top)??0),left:((E==null?void 0:E.left)??0)-((k==null?void 0:k.left)??0),width:E==null?void 0:E.width,height:E==null?void 0:E.height,objectFit:Ve,pointerEvents:"none"},qe=ee?{position:"fixed",top:ee.top,height:ee.height,width:ee.width/2,zIndex:9999}:null;return r.jsxs("div",{ref:b,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:V==="open"?"none":void 0},onClick:Te,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:_?te:0,transition:F?"none":`opacity ${vn}ms ${Nn}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:p?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:w,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:_?1:0,transition:`opacity ${vn}ms ${Nn}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.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:w,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:_?1:0,transition:`opacity ${vn}ms ${Nn}`},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),E&&k&&ye&&r.jsx("div",{style:Pe,onTransitionEnd:xe,children:gi(ye)?r.jsx("video",{src:ye.url,muted:!0,playsInline:!0,preload:"auto",style:De},`neighbor-${Be}-${ye.url}`):r.jsx("img",{src:ye.url,alt:ye.name,style:De},`neighbor-${Be}-${ye.url}`)}),E&&k&&Q&&r.jsx("div",{style:tt,onTransitionEnd:xe,children:Y?r.jsx(mg,{src:Q.url,phase:V,mediaRef:f,mediaStyle:ht,onLoadedMetadata:ke,onClick:Ie,onMouseMove:re},`${n}-${Q.url}`):r.jsx("img",{ref:f,src:Q.url,alt:Q.name,onLoad:ke,style:ht},`${n}-${Q.url}`)}),_&&qe&&t.length>1&&!Y&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...qe,left:ee.left,cursor:"w-resize",pointerEvents:F?"none":"auto"},onClick:Se=>{if(L.current){L.current=!1;return}Se.stopPropagation(),he(-1)}}),r.jsx("div",{style:{...qe,left:ee.left+ee.width/2,cursor:"e-resize",pointerEvents:F?"none":"auto"},onClick:Se=>{if(L.current){L.current=!1;return}Se.stopPropagation(),he(1)}})]})]})}function hg(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function fg({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:s,activeEvent:l,layoutId:d,portalId:c}){const{prefix:u}=S.useScopedStyles(),{type:p="a",gridLayout:b,textBoxWidth:w=100,verticalGap:f,entriesCount:h,lightbox:m,imageDisplay:v,imageCorners:M,lightboxImageDisplay:R,slider:L,sliderTiming:X,direction:A,transition:B,titleMarginTop:P,subtitleMarginTop:C,titleColor:j,subtitleColor:x,lightboxCounterColor:W,titleFontFamily:E,titleFontSettings:Z,titleFontSize:k,titleLineHeight:U,titleLetterSpacing:V,titleWordSpacing:G,titleTextAppearance:ie,subtitleFontFamily:$,subtitleFontSettings:I,subtitleFontSize:D,subtitleLineHeight:se,subtitleLetterSpacing:oe,subtitleWordSpacing:T,subtitleTextAppearance:ue,lightboxCounterFontFamily:F,lightboxCounterFontSettings:ne,lightboxCounterFontSize:J,lightboxCounterLineHeight:ve,lightboxCounterLetterSpacing:Ee,lightboxCounterWordSpacing:me,lightboxCounterTextAppearance:de,showText:q="always",alignEntries:Q="off",align:Y="top"}=e,_e={fontSettings:{fontFamily:E,fontWeight:(Z==null?void 0:Z.fontWeight)??400,fontStyle:(Z==null?void 0:Z.fontStyle)??"normal"},fontSize:k??.01,lineHeight:U,letterSpacing:V??0,wordSpacing:G??0,textAppearance:ie,color:j},ke={...on(Ut(_e,n))},ce={fontSettings:{fontFamily:$,fontWeight:(I==null?void 0:I.fontWeight)??400,fontStyle:(I==null?void 0:I.fontStyle)??"normal"},fontSize:D??.01,lineHeight:se,letterSpacing:oe??0,wordSpacing:T??0,textAppearance:ue,color:x},we={...on(Ut(ce,n))},z={fontSettings:{fontFamily:F,fontWeight:(ne==null?void 0:ne.fontWeight)??400,fontStyle:(ne==null?void 0:ne.fontStyle)??"normal"},fontSize:J??.01,lineHeight:ve,letterSpacing:Ee??0,wordSpacing:me??0,textAppearance:de,color:W},he={...on(Ut(z,n)),...qr(J,ve,u,n)},xe=Gr(k,U,`${u}-item-title`,`${u}-text-tight-leading`),Re=Gr(D,se,`${u}-item-subtitle`,`${u}-text-tight-leading`),Te=qr(k,U,u,n),_=qr(D,se,u,n),pe=Gr(J,ve,`${u}-lightbox-counter`,`${u}-text-tight-leading`),te=S.buildColorVars(u,{titleColor:j,subtitleColor:x,lightboxCounterColor:W},yg,vg),Ie=`${l&&l!=="default"?`${u}-state-${l}`:""}${q==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),re=h===0?1/0:h,O=(t??[]).slice(0,re),Ve=a.useMemo(()=>m==="on"?cg(O):[],[O,m]),Oe=b.entryWidth??.2,lt=(v==null?void 0:v.display)==="cover",tt=(v==null?void 0:v.ratioValue)??"1:1",ht=(v==null?void 0:v.reversed)??!1,[nt,Be]=tt.split(":").map(Number),De=`${ht?Be:nt} / ${ht?nt:Be}`,qe=b.columnsCount,Se=S.scalingValue(Oe??0,n),Ne=Se,ze=!lt&&L!=="off",Xe=O.length%qe||qe,ct=Xe<qe&&O.length>0,Je=O.length-Xe,$t=ct?Math.floor((qe-Xe)/2)+1:1,dt=M?S.scalingValue(M,n):void 0,Fe={width:Ne,...lt?{aspectRatio:De,height:"auto",overflow:"hidden"}:{height:"auto"},...dt?{borderRadius:dt,overflow:"hidden"}:{}},Ke=`${u}-item-image-wrapper${ze?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),je=p==="d"||p==="e"||p==="f",ut=Q==="on",pt=`calc(${S.scalingValue(Oe??0,n)} * (${w} / 100))`,mt=S.scalingValue(Oe*w/100,n),kt=lt?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...dt?{borderRadius:dt}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...dt?{borderRadius:dt}:{}},[Xt,Yt]=a.useState(0),vt=a.useRef(null),bt=B==="fade"||A==="horizontal"?"ltr":A==="vertical"?"ttb":"ltr";a.useEffect(()=>{const at=vt.current;if(!at)return;const $e=new ResizeObserver(We=>{Yt(Math.round(We[0].contentRect.width))});return $e.observe(at),()=>$e.disconnect()},[]);const Gt=(()=>{const at={...te},$e=vt.current?getComputedStyle(vt.current).getPropertyValue("--cntrl-article-width").trim():"";return $e&&(at["--cntrl-article-width"]=$e),at})(),[Ft,xt]=a.useState(!1),[Ht,qt]=a.useState([]),[Zt,tn]=a.useState(0),Ct=m==="on"&&(!n||i),jt=(at,$e)=>{n&&!i||m!=="off"&&(qt(at),tn($e),xt(!0))};a.useEffect(()=>{if(!Ft||m!=="on"||typeof document>"u")return;const at=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=at}},[Ft,m]),a.useEffect(()=>{!n||i||xt(!1)},[n,i]);const cn=a.useMemo(()=>Qm(u),[u]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:cn}}),m==="on"&&r.jsx(dg,{mediaList:Ve}),r.jsx("div",{style:te,children:r.jsx("div",{ref:vt,className:`${u}-wrapper ${u}-type-${p}${ut?` ${u}-align-entries`:""} ${u}-image-align-${Y} ${Ie}`.trim(),style:{gridTemplateColumns:`repeat(${qe}, ${Se})`,rowGap:ut?0:S.scalingValue(f??0,n),columnGap:S.scalingValue(b.horizontalGap??0,n),width:S.scalingValue(b.wrapperWidth??0,n),...ut?{[`--${u}-align-entries-row-gap`]:S.scalingValue(f??0,n)}:{}},children:O.map((at,$e)=>{var At;const We=ks(at.title),Qe=ks(at.subtitle),st=(((At=at.link)==null?void 0:At.length)??0)>0&&m==="off"?at.link:void 0,gt=Math.floor($e/qe)===Math.ceil(O.length/qe)-1,Rt=ct&&$e>=Je?`${$t+($e-Je)}`:void 0,ot=je?r.jsxs("div",{className:`${u}-item-text-block`,children:[We&&r.jsx("p",{className:xe,style:{width:pt,...ke,...Te},children:at.title}),We&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:S.scalingValue(P??0,n),width:mt}}),Qe&&r.jsx("p",{className:Re,style:{width:pt,...we,..._},children:at.subtitle}),Qe&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:S.scalingValue(C??0,n),width:mt}})]}):null,Ot=ut?r.jsxs("div",{className:`${u}-item-title-row`,children:[!je&&r.jsx("div",{"data-controls":o&&We?"titleMarginTop":void 0,className:o&&We?`${u}-control`:void 0,style:{height:We?S.scalingValue(P??0,n):0,width:mt}}),We&&r.jsx("p",{className:xe,style:{width:pt,...ke,...Te},children:at.title}),je&&We&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:S.scalingValue(P??0,n),width:mt}})]}):null,Pt=ut?r.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!je&&r.jsx("div",{"data-controls":o&&Qe?"subtitleMarginTop":void 0,className:o&&Qe?`${u}-control`:void 0,style:{height:Qe?S.scalingValue(C??0,n):0,width:mt}}),Qe&&r.jsx("p",{className:Re,style:{width:pt,...we,..._},children:at.subtitle}),je&&Qe&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:S.scalingValue(C??0,n),width:mt}})]}):null,Et=st?r.jsxs("a",{href:st,target:"_blank",className:`${u}-item-text-link`,children:[Ot,Pt]}):r.jsxs(r.Fragment,{children:[Ot,Pt]}),zt=hc(at.gallery),Bt=zt.filter(wt=>wt.lightboxMedia).map(wt=>wt.lightboxMedia),Wt=r.jsx("div",{className:Ke,style:Fe,children:zt.length===0?null:L==="off"?(()=>{const{displayMedia:wt,lightboxMedia:y}=zt[0],fe=y?Bt.findIndex(Le=>Le.url===y.url):-1;return r.jsx(As,{media:wt,className:`${u}-item-${gi(wt)?"video":"image"}`.trim(),style:kt,onMediaClick:Ct&&fe>=0?()=>jt(Bt,fe):void 0})})():r.jsxs(r.Fragment,{children:[ze&&r.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:zt.map(({displayMedia:wt})=>gi(wt)?r.jsx("video",{src:wt.url,muted:!0,playsInline:!0},`sizer-${wt.url}`):r.jsx("img",{src:wt.url,alt:""},`sizer-${wt.url}`))}),r.jsx(Ka,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:X*1e3,width:"100%",height:"100%",speed:ig,type:B==="fade"?"fade":"loop",rewind:B==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:bt},onMoved:wt=>{A!=="random"||B==="fade"||ng(wt)},children:zt.map(({displayMedia:wt,lightboxMedia:y},fe)=>{const Le=y?Bt.findIndex(Me=>Me.url===y.url):-1;return r.jsx(Xa,{children:r.jsx(As,{media:wt,className:`${u}-item-${gi(wt)?"video":"image"}`.trim(),style:kt,onMediaClick:Ct&&Le>=0?()=>jt(Bt,Le):void 0})},fe)})},`${B}-${Oe}-${A}-${X}-${Xt}-${d}`)]})}),_t=je?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":o&&We?"titleMarginTop":void 0,className:o&&We?`${u}-control`:void 0,style:{height:We?S.scalingValue(P??0,n):0,width:mt}}),r.jsx("p",{className:xe,style:{width:pt,...ke,...Te},children:at.title}),r.jsx("div",{"data-controls":o&&Qe?"subtitleMarginTop":void 0,className:o&&Qe?`${u}-control`:void 0,style:{height:Qe?S.scalingValue(C??0,n):0,width:mt}}),r.jsx("p",{className:Re,style:{width:pt,...we,..._},children:at.subtitle})]});return r.jsx("div",{className:`${u}-item`.trim(),style:Rt&&!ut?{gridColumn:Rt}:void 0,children:r.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${ut&&gt?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(w??0)>100?`calc(${Se} * (${w} / 100))`:Se,...Rt&&ut?{gridColumn:Rt}:{}},children:ut?r.jsx(r.Fragment,{children:je?r.jsxs(r.Fragment,{children:[Et,r.jsx("a",{href:st,target:"_blank",className:`${u}-item-image-link`,children:Wt})]}):r.jsxs(r.Fragment,{children:[r.jsx("a",{href:st,target:"_blank",className:`${u}-item-image-link`,children:Wt}),Et]})}):st?r.jsxs(r.Fragment,{children:[r.jsxs("a",{href:st,target:"_blank",className:`${u}-item-image-link`,children:[ot,Wt]}),!je&&r.jsx("a",{href:st,target:"_blank",className:`${u}-item-text-link`,children:_t})]}):r.jsxs(r.Fragment,{children:[ot,Wt,_t]})})},$e)})})}),(!n||i)&&Ft&&typeof document<"u"&&m==="on"&&(()=>{const at=(c?document.getElementById(c):null)??document.body;return Yn.createPortal(r.jsx("div",{style:Gt,"data-selection":"none",children:r.jsx(gg,{prefix:u,items:Ht,index:Zt,imageDisplay:hg(R),isEditor:n,onClose:()=>xt(!1),onPrev:()=>tn($e=>($e-1+Ht.length)%Ht.length),onNext:()=>tn($e=>($e+1)%Ht.length),counterClassName:pe,counterStyle:he})}),at)})()]})}const yg={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},vg=["hover","focus","filled","success","error"],xg=`import { Splide, SplideSlide } from '@splidejs/react-splide';
4162
+ `}function eg(){return Math.random()<.5?"ltr":"ttb"}function tg(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function ng(e){const t=eg();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{tg(e)})})}const vn=500,ig=750,Nn="cubic-bezier(0.22, 1, 0.36, 1)",og=72,rg=50;function ag(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 sg(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function lg(e){const[t]=e.media;return t!=null&&t.url?t:null}function hc(e){return!Array.isArray(e)||e.length===0?[]:ag(e)?e.flatMap(t=>{const n=sg(t);if(!n)return[];const i=lg(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 gi(e){return e.type==="video"}function cg(e){const t=new Set,n=[];for(const i of e){const o=hc(i.gallery);for(const s of o){const l=s.lightboxMedia;l!=null&&l.url&&!t.has(l.url)&&(t.add(l.url),n.push(l))}}return n}function dg({mediaList:e}){return e.length===0?null:r.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>gi(t)?r.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):r.jsx("img",{src:t.url,alt:""},t.url))})}function ug(e){e.pause(),e.removeAttribute("src"),e.load()}function As({media:e,className:t,style:n,onMediaClick:i}){return gi(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 Fs(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function pg(e,t){if(!t||!t.width||!t.height||!e.width||!e.height)return e;const n=t.width/t.height,i=e.width/e.height;if(n>i){const s=e.width/n;return{width:e.width,height:s,left:e.left,top:e.top+(e.height-s)/2}}const o=e.height*n;return{width:o,height:e.height,left:e.left+(e.width-o)/2,top:e.top}}function mg({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:s,onMouseMove:l}){return a.useEffect(()=>{const d=n.current;if(d)return()=>{ug(d)}},[e,n]),r.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:s,onMouseMove:l,style:i})}function gg({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:s,onPrev:l,onNext:d,counterClassName:c,counterStyle:u}){const p=i==="cover",b=a.useRef(null),w=a.useRef(null),f=a.useRef(null),h=a.useRef(null),m=a.useRef(0),v=a.useRef(0),M=a.useRef("none"),R=a.useRef(!1),L=a.useRef(!1),X=a.useRef(null),F=a.useRef(0),B=a.useRef(null),k=a.useRef(!1),C=a.useRef(null),j=a.useRef(null),x=a.useRef(null),W=a.useRef(()=>{}),[E,Z]=a.useState(null),[P,U]=a.useState(null),[V,G]=a.useState("opening"),[ie,$]=a.useState(0),[I,D]=a.useState(0),[se,oe]=a.useState(null),[T,ue]=a.useState(!1),[A,ne]=a.useState(!1),[J,ve]=a.useState(!1),[Ee,me]=a.useState(null),de=a.useRef(n),q=a.useRef(void 0),Q=t[n],Y=Q?gi(Q):!1,_e=I!==0||T,Ce=se!==null,ke=a.useCallback(Se=>{const Ne=Se.currentTarget,ze=Ne instanceof HTMLVideoElement?{width:Ne.videoWidth,height:Ne.videoHeight}:{width:Ne.naturalWidth,height:Ne.naturalHeight};!ze.width||!ze.height||me(ze)},[]);a.useEffect(()=>{X.current=P},[P]),a.useEffect(()=>{const Se=b.current;if(!Se)return;const Ne=()=>U(Fs(Se));Ne();const ze=new ResizeObserver(Ne);return ze.observe(Se),()=>ze.disconnect()},[]);const ce=a.useCallback(()=>{C.current!==null&&(window.clearTimeout(C.current),C.current=null)},[]),ge=a.useCallback(()=>{const Se=j.current;j.current=null,ce(),B.current=null,k.current=!1,oe(null),ue(!1),D(0),F.current=0,ne(!1),R.current=!1,v.current=0,M.current="none",Se===1?d():Se===-1&&l()},[ce,d,l]),we=a.useCallback(()=>{ce(),j.current=null,B.current=null,k.current=!1,oe(null),ue(!1),D(0),F.current=0},[ce]),z=a.useCallback(()=>{ce(),C.current=window.setTimeout(()=>{j.current!==null&&ge()},vn+32)},[ce,ge]),le=a.useCallback((Se,Ne)=>{var Xe;const ze=((Xe=X.current)==null?void 0:Xe.width)??0;if(ce(),B.current=Se,oe(Se),k.current=!0,ue(!0),Ne){j.current=Se;const ct=-Se*ze;F.current=ct,D(ct),z();return}F.current=0,D(0),C.current=window.setTimeout(()=>{C.current=null,we()},vn+32)},[ce,we,z]),he=a.useCallback(Se=>{if(!(t.length<=1)){if(k.current){if(j.current===Se){x.current=Se,ge();return}we()}ce(),B.current=Se,oe(Se),k.current=!1,ue(!1),F.current=0,D(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{le(Se,!0)})})}},[t.length,le,ge,we,ce]);W.current=he;const xe=a.useCallback(Se=>{Se.propertyName!=="transform"||!k.current||j.current!==null&&ge()},[ge]),Re=a.useCallback(()=>{const Se=w.current;if(!Se)return;const Ne=Fs(Se);!Ne.width||!Ne.height||Z(Ne)},[]);a.useEffect(()=>{Re();const Se=w.current;if(!Se)return;const Ne=new ResizeObserver(()=>Re());return Ne.observe(Se),()=>Ne.disconnect()},[Re]),a.useEffect(()=>{V==="opening"&&E&&G("open")},[V,E]),a.useEffect(()=>{if(V!=="closing")return;const Se=setTimeout(()=>s(),vn);return()=>clearTimeout(Se)},[V,s]),a.useEffect(()=>()=>{ce()},[ce]),a.useLayoutEffect(()=>{de.current===n&&q.current===(Q==null?void 0:Q.url)||(ce(),j.current=null,oe(null),$(0),D(0),ue(!1),ve(!1),ne(!1),me(null),m.current=0,v.current=0,M.current="none",R.current=!1,k.current=!1,F.current=0,B.current=null,h.current=null,L.current=!1,de.current=n,q.current=Q==null?void 0:Q.url)},[n,Q==null?void 0:Q.url,ce]),a.useLayoutEffect(()=>{const Se=x.current;Se!==null&&(x.current=null,requestAnimationFrame(()=>{W.current(Se)}))},[n,Q==null?void 0:Q.url]),a.useEffect(()=>{if(V!=="open")return;let Se=null;const Ne=()=>{Se&&(document.removeEventListener("click",Se,!0),Se=null)},ze=()=>{Ne(),Se=dt=>{dt.stopPropagation(),dt.preventDefault(),Ne()},document.addEventListener("click",Se,!0)},Xe=dt=>{const Fe=dt<0?1:-1;if(Math.abs(dt)>rg&&t.length>1){le(Fe,!0);return}le(Fe,!1)},ct=dt=>{if(dt.touches.length!==1||k.current)return;const Fe=dt.touches[0];L.current=!0,h.current={x:Fe.clientX,y:Fe.clientY},M.current="none",v.current=0,R.current=!1},Je=dt=>{if(!h.current||dt.touches.length!==1||k.current)return;const Fe=dt.touches[0],Ke=Fe.clientX-h.current.x,je=Fe.clientY-h.current.y;if(M.current==="none"){if(Math.abs(Ke)<10&&Math.abs(je)<10)return;if(Math.abs(Ke)>Math.abs(je)){if(t.length<=1)return;M.current="horizontal"}else if(je>0)M.current="vertical";else return}if(M.current==="horizontal"){R.current=!0,ne(!0),v.current=Ke;const ut=Ke<0?1:-1;B.current!==ut&&(B.current=ut,oe(ut)),F.current=Ke,D(Ke),dt.preventDefault();return}M.current==="vertical"&&(R.current=!0,ne(!0),m.current=je,$(je),dt.preventDefault())},$t=()=>{if(!h.current)return;const dt=M.current,Fe=R.current;if(Fe&&dt==="horizontal")Xe(v.current),ze();else if(Fe&&dt==="vertical")if(m.current>og){const je=window.innerHeight;m.current=je,ve(!0),$(je),G("closing")}else m.current=0,$(0),ze();else dt==="horizontal"&&Math.abs(v.current)>0&&(Xe(v.current),ze());h.current=null,M.current="none",v.current=0,R.current=!1,ne(!1)};return document.addEventListener("touchstart",ct,{passive:!0}),document.addEventListener("touchmove",Je,{passive:!1}),document.addEventListener("touchend",$t),document.addEventListener("touchcancel",$t),()=>{document.removeEventListener("touchstart",ct),document.removeEventListener("touchmove",Je),document.removeEventListener("touchend",$t),document.removeEventListener("touchcancel",$t),Ne()}},[V,t.length,le]),a.useEffect(()=>{const Se=Ne=>{Ne.key==="Escape"&&(Ne.preventDefault(),Ne.stopPropagation(),V!=="closing"&&G("closing"))};return window.addEventListener("keydown",Se,!0),()=>window.removeEventListener("keydown",Se,!0)},[V]);const Te=()=>{V!=="closing"&&G("closing")},_=V==="open",pe=V==="closing",te=ie>0?Math.max(0,1-ie/500):1,N=ie>0?Math.max(.35,1-ie/500):1,ee=E?p?E:pg(E,Ee):null,Ie=Se=>{if(Se.stopPropagation(),L.current){L.current=!1;return}if(t.length<=1)return;const Ne=ee??Se.currentTarget.getBoundingClientRect(),ze=Se.clientY-Ne.top,Xe=Math.min(52,Ne.height*.2);if(!(ze>Ne.height-Xe)){if(Se.clientX-Ne.left<Ne.width/2){he(-1);return}he(1)}},re=Se=>{if(t.length<=1)return;const Ne=ee??Se.currentTarget.getBoundingClientRect(),ze=Se.clientX-Ne.left,Xe=Se.clientY-Ne.top,ct=Math.min(52,Ne.height*.2);if(Xe>Ne.height-ct){Se.currentTarget.style.cursor="default";return}Se.currentTarget.style.cursor=ze<Ne.width/2?"w-resize":"e-resize"},O={position:"fixed",top:P==null?void 0:P.top,left:P==null?void 0:P.left,width:P==null?void 0:P.width,height:P==null?void 0:P.height,zIndex:9998},Ve=p?"cover":"contain",Oe=I!==0||ie>0?`translate(${I}px, ${ie}px)`:void 0,lt=A&&!T?"none":T?`transform ${vn}ms ${Nn}`:J?`transform ${vn}ms ${Nn}, opacity ${vn}ms ${Nn}`:V==="opening"||pe?`opacity ${vn}ms ${Nn}`:"none",tt={...O,transform:Oe,opacity:ie>0?N:V==="opening"||pe?0:1,transition:lt,pointerEvents:"none"},ht={position:"absolute",top:((ee==null?void 0:ee.top)??0)-((P==null?void 0:P.top)??0),left:((ee==null?void 0:ee.left)??0)-((P==null?void 0:P.left)??0),width:ee==null?void 0:ee.width,height:ee==null?void 0:ee.height,objectFit:Ve,pointerEvents:Y&&_&&!_e?"auto":"none",touchAction:Y&&_?"none":void 0},nt=(P==null?void 0:P.width)??0,Be=Ce?(n+se+t.length)%t.length:null,ye=Be!==null?t[Be]:null,Pe={...O,transform:Ce?`translateX(${se*nt+I}px)`:void 0,opacity:1,transition:T?`transform ${vn}ms ${Nn}`:"none",pointerEvents:"none"},De={position:"absolute",top:((E==null?void 0:E.top)??0)-((P==null?void 0:P.top)??0),left:((E==null?void 0:E.left)??0)-((P==null?void 0:P.left)??0),width:E==null?void 0:E.width,height:E==null?void 0:E.height,objectFit:Ve,pointerEvents:"none"},qe=ee?{position:"fixed",top:ee.top,height:ee.height,width:ee.width/2,zIndex:9999}:null;return r.jsxs("div",{ref:b,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:V==="open"?"none":void 0},onClick:Te,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:_?te:0,transition:A?"none":`opacity ${vn}ms ${Nn}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:p?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:w,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:_?1:0,transition:`opacity ${vn}ms ${Nn}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.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:w,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:_?1:0,transition:`opacity ${vn}ms ${Nn}`},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),E&&P&&ye&&r.jsx("div",{style:Pe,onTransitionEnd:xe,children:gi(ye)?r.jsx("video",{src:ye.url,muted:!0,playsInline:!0,preload:"auto",style:De},`neighbor-${Be}-${ye.url}`):r.jsx("img",{src:ye.url,alt:ye.name,style:De},`neighbor-${Be}-${ye.url}`)}),E&&P&&Q&&r.jsx("div",{style:tt,onTransitionEnd:xe,children:Y?r.jsx(mg,{src:Q.url,phase:V,mediaRef:f,mediaStyle:ht,onLoadedMetadata:ke,onClick:Ie,onMouseMove:re},`${n}-${Q.url}`):r.jsx("img",{ref:f,src:Q.url,alt:Q.name,onLoad:ke,style:ht},`${n}-${Q.url}`)}),_&&qe&&t.length>1&&!Y&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...qe,left:ee.left,cursor:"w-resize",pointerEvents:A?"none":"auto"},onClick:Se=>{if(L.current){L.current=!1;return}Se.stopPropagation(),he(-1)}}),r.jsx("div",{style:{...qe,left:ee.left+ee.width/2,cursor:"e-resize",pointerEvents:A?"none":"auto"},onClick:Se=>{if(L.current){L.current=!1;return}Se.stopPropagation(),he(1)}})]})]})}function hg(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function fg({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:s,activeEvent:l,layoutId:d,portalId:c}){const{prefix:u}=S.useScopedStyles(),{type:p="a",gridLayout:b,textBoxWidth:w=100,verticalGap:f,entriesCount:h,lightbox:m,imageDisplay:v,imageCorners:M,lightboxImageDisplay:R,slider:L,sliderTiming:X,direction:F,transition:B,titleMarginTop:k,subtitleMarginTop:C,titleColor:j,subtitleColor:x,lightboxCounterColor:W,titleFontFamily:E,titleFontSettings:Z,titleFontSize:P,titleLineHeight:U,titleLetterSpacing:V,titleWordSpacing:G,titleTextAppearance:ie,subtitleFontFamily:$,subtitleFontSettings:I,subtitleFontSize:D,subtitleLineHeight:se,subtitleLetterSpacing:oe,subtitleWordSpacing:T,subtitleTextAppearance:ue,lightboxCounterFontFamily:A,lightboxCounterFontSettings:ne,lightboxCounterFontSize:J,lightboxCounterLineHeight:ve,lightboxCounterLetterSpacing:Ee,lightboxCounterWordSpacing:me,lightboxCounterTextAppearance:de,showText:q="always",alignEntries:Q="off",align:Y="top"}=e,_e={fontSettings:{fontFamily:E,fontWeight:(Z==null?void 0:Z.fontWeight)??400,fontStyle:(Z==null?void 0:Z.fontStyle)??"normal"},fontSize:P??.01,lineHeight:U,letterSpacing:V??0,wordSpacing:G??0,textAppearance:ie,color:j},ke={...on(Ut(_e,n))},ce={fontSettings:{fontFamily:$,fontWeight:(I==null?void 0:I.fontWeight)??400,fontStyle:(I==null?void 0:I.fontStyle)??"normal"},fontSize:D??.01,lineHeight:se,letterSpacing:oe??0,wordSpacing:T??0,textAppearance:ue,color:x},we={...on(Ut(ce,n))},z={fontSettings:{fontFamily:A,fontWeight:(ne==null?void 0:ne.fontWeight)??400,fontStyle:(ne==null?void 0:ne.fontStyle)??"normal"},fontSize:J??.01,lineHeight:ve,letterSpacing:Ee??0,wordSpacing:me??0,textAppearance:de,color:W},he={...on(Ut(z,n)),...qr(J,ve,u,n)},xe=Gr(P,U,`${u}-item-title`,`${u}-text-tight-leading`),Re=Gr(D,se,`${u}-item-subtitle`,`${u}-text-tight-leading`),Te=qr(P,U,u,n),_=qr(D,se,u,n),pe=Gr(J,ve,`${u}-lightbox-counter`,`${u}-text-tight-leading`),te=S.buildColorVars(u,{titleColor:j,subtitleColor:x,lightboxCounterColor:W},yg,vg),Ie=`${l&&l!=="default"?`${u}-state-${l}`:""}${q==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),re=h===0?1/0:h,O=(t??[]).slice(0,re),Ve=a.useMemo(()=>m==="on"?cg(O):[],[O,m]),Oe=b.entryWidth??.2,lt=(v==null?void 0:v.display)==="cover",tt=(v==null?void 0:v.ratioValue)??"1:1",ht=(v==null?void 0:v.reversed)??!1,[nt,Be]=tt.split(":").map(Number),De=`${ht?Be:nt} / ${ht?nt:Be}`,qe=b.columnsCount,Se=S.scalingValue(Oe??0,n),Ne=Se,ze=!lt&&L!=="off",Xe=O.length%qe||qe,ct=Xe<qe&&O.length>0,Je=O.length-Xe,$t=ct?Math.floor((qe-Xe)/2)+1:1,dt=M?S.scalingValue(M,n):void 0,Fe={width:Ne,...lt?{aspectRatio:De,height:"auto",overflow:"hidden"}:{height:"auto"},...dt?{borderRadius:dt,overflow:"hidden"}:{}},Ke=`${u}-item-image-wrapper${ze?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),je=p==="d"||p==="e"||p==="f",ut=Q==="on",pt=`calc(${S.scalingValue(Oe??0,n)} * (${w} / 100))`,mt=S.scalingValue(Oe*w/100,n),kt=lt?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...dt?{borderRadius:dt}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...dt?{borderRadius:dt}:{}},[Xt,Yt]=a.useState(0),vt=a.useRef(null),bt=B==="fade"||F==="horizontal"?"ltr":F==="vertical"?"ttb":"ltr";a.useEffect(()=>{const at=vt.current;if(!at)return;const $e=new ResizeObserver(We=>{Yt(Math.round(We[0].contentRect.width))});return $e.observe(at),()=>$e.disconnect()},[]);const Gt=(()=>{const at={...te},$e=vt.current?getComputedStyle(vt.current).getPropertyValue("--cntrl-article-width").trim():"";return $e&&(at["--cntrl-article-width"]=$e),at})(),[Ft,xt]=a.useState(!1),[Ht,qt]=a.useState([]),[Zt,tn]=a.useState(0),Ct=m==="on"&&(!n||i),jt=(at,$e)=>{n&&!i||m!=="off"&&(qt(at),tn($e),xt(!0))};a.useEffect(()=>{if(!Ft||m!=="on"||typeof document>"u")return;const at=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=at}},[Ft,m]),a.useEffect(()=>{!n||i||xt(!1)},[n,i]);const cn=a.useMemo(()=>Qm(u),[u]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:cn}}),m==="on"&&r.jsx(dg,{mediaList:Ve}),r.jsx("div",{style:te,children:r.jsx("div",{ref:vt,className:`${u}-wrapper ${u}-type-${p}${ut?` ${u}-align-entries`:""} ${u}-image-align-${Y} ${Ie}`.trim(),style:{gridTemplateColumns:`repeat(${qe}, ${Se})`,rowGap:ut?0:S.scalingValue(f??0,n),columnGap:S.scalingValue(b.horizontalGap??0,n),width:S.scalingValue(b.wrapperWidth??0,n),...ut?{[`--${u}-align-entries-row-gap`]:S.scalingValue(f??0,n)}:{}},children:O.map((at,$e)=>{var At;const We=ks(at.title),Qe=ks(at.subtitle),st=(((At=at.link)==null?void 0:At.length)??0)>0&&m==="off"?at.link:void 0,gt=Math.floor($e/qe)===Math.ceil(O.length/qe)-1,Rt=ct&&$e>=Je?`${$t+($e-Je)}`:void 0,ot=je?r.jsxs("div",{className:`${u}-item-text-block`,children:[We&&r.jsx("p",{className:xe,style:{width:pt,...ke,...Te},children:at.title}),We&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:S.scalingValue(k??0,n),width:mt}}),Qe&&r.jsx("p",{className:Re,style:{width:pt,...we,..._},children:at.subtitle}),Qe&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:S.scalingValue(C??0,n),width:mt}})]}):null,Ot=ut?r.jsxs("div",{className:`${u}-item-title-row`,children:[!je&&r.jsx("div",{"data-controls":o&&We?"titleMarginTop":void 0,className:o&&We?`${u}-control`:void 0,style:{height:We?S.scalingValue(k??0,n):0,width:mt}}),We&&r.jsx("p",{className:xe,style:{width:pt,...ke,...Te},children:at.title}),je&&We&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:S.scalingValue(k??0,n),width:mt}})]}):null,Pt=ut?r.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!je&&r.jsx("div",{"data-controls":o&&Qe?"subtitleMarginTop":void 0,className:o&&Qe?`${u}-control`:void 0,style:{height:Qe?S.scalingValue(C??0,n):0,width:mt}}),Qe&&r.jsx("p",{className:Re,style:{width:pt,...we,..._},children:at.subtitle}),je&&Qe&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:S.scalingValue(C??0,n),width:mt}})]}):null,Et=st?r.jsxs("a",{href:st,target:"_blank",className:`${u}-item-text-link`,children:[Ot,Pt]}):r.jsxs(r.Fragment,{children:[Ot,Pt]}),zt=hc(at.gallery),Bt=zt.filter(wt=>wt.lightboxMedia).map(wt=>wt.lightboxMedia),Wt=r.jsx("div",{className:Ke,style:Fe,children:zt.length===0?null:L==="off"?(()=>{const{displayMedia:wt,lightboxMedia:y}=zt[0],fe=y?Bt.findIndex(Le=>Le.url===y.url):-1;return r.jsx(As,{media:wt,className:`${u}-item-${gi(wt)?"video":"image"}`.trim(),style:kt,onMediaClick:Ct&&fe>=0?()=>jt(Bt,fe):void 0})})():r.jsxs(r.Fragment,{children:[ze&&r.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:zt.map(({displayMedia:wt})=>gi(wt)?r.jsx("video",{src:wt.url,muted:!0,playsInline:!0},`sizer-${wt.url}`):r.jsx("img",{src:wt.url,alt:""},`sizer-${wt.url}`))}),r.jsx(Ka,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:X*1e3,width:"100%",height:"100%",speed:ig,type:B==="fade"?"fade":"loop",rewind:B==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:bt},onMoved:wt=>{F!=="random"||B==="fade"||ng(wt)},children:zt.map(({displayMedia:wt,lightboxMedia:y},fe)=>{const Le=y?Bt.findIndex(Me=>Me.url===y.url):-1;return r.jsx(Xa,{children:r.jsx(As,{media:wt,className:`${u}-item-${gi(wt)?"video":"image"}`.trim(),style:kt,onMediaClick:Ct&&Le>=0?()=>jt(Bt,Le):void 0})},fe)})},`${B}-${Oe}-${F}-${X}-${Xt}-${d}`)]})}),_t=je?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":o&&We?"titleMarginTop":void 0,className:o&&We?`${u}-control`:void 0,style:{height:We?S.scalingValue(k??0,n):0,width:mt}}),r.jsx("p",{className:xe,style:{width:pt,...ke,...Te},children:at.title}),r.jsx("div",{"data-controls":o&&Qe?"subtitleMarginTop":void 0,className:o&&Qe?`${u}-control`:void 0,style:{height:Qe?S.scalingValue(C??0,n):0,width:mt}}),r.jsx("p",{className:Re,style:{width:pt,...we,..._},children:at.subtitle})]});return r.jsx("div",{className:`${u}-item`.trim(),style:Rt&&!ut?{gridColumn:Rt}:void 0,children:r.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${ut&&gt?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(w??0)>100?`calc(${Se} * (${w} / 100))`:Se,...Rt&&ut?{gridColumn:Rt}:{}},children:ut?r.jsx(r.Fragment,{children:je?r.jsxs(r.Fragment,{children:[Et,r.jsx("a",{href:st,target:"_blank",className:`${u}-item-image-link`,children:Wt})]}):r.jsxs(r.Fragment,{children:[r.jsx("a",{href:st,target:"_blank",className:`${u}-item-image-link`,children:Wt}),Et]})}):st?r.jsxs(r.Fragment,{children:[r.jsxs("a",{href:st,target:"_blank",className:`${u}-item-image-link`,children:[ot,Wt]}),!je&&r.jsx("a",{href:st,target:"_blank",className:`${u}-item-text-link`,children:_t})]}):r.jsxs(r.Fragment,{children:[ot,Wt,_t]})})},$e)})})}),(!n||i)&&Ft&&typeof document<"u"&&m==="on"&&(()=>{const at=(c?document.getElementById(c):null)??document.body;return Yn.createPortal(r.jsx("div",{style:Gt,"data-selection":"none",children:r.jsx(gg,{prefix:u,items:Ht,index:Zt,imageDisplay:hg(R),isEditor:n,onClose:()=>xt(!1),onPrev:()=>tn($e=>($e-1+Ht.length)%Ht.length),onNext:()=>tn($e=>($e+1)%Ht.length),counterClassName:pe,counterStyle:he})}),at)})()]})}const yg={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},vg=["hover","focus","filled","success","error"],xg=`import { Splide, SplideSlide } from '@splidejs/react-splide';
4163
4163
  import '@splidejs/react-splide/css/core';
4164
4164
  import { CommonComponentProps } from '../props';
4165
4165
  import {
@@ -6212,7 +6212,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
6212
6212
  };
6213
6213
 
6214
6214
  const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
6215
- `,Ur={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},bg=["titleColor","subtitleColor","lightboxCounterColor"],wg={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{title:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},subtitle:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},gallery:{type:"array",label:"Gallery",display:{type:"media-pair-list-input"},items:{type:"object",properties:{media:{type:"array",items:{type:"object",properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}}}}}}},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["gallery"]},default:[{title:"Earth-orbital mission",subtitle:"Hasselblad SWC/ Zeiss Biogon 38 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Salton Sea from Above",subtitle:"Hasselblad 500 EL / Zeiss Sonnar 250 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Lunar Module Pilot",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Lunar Module 3 porch",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Command Module",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-10.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"CSM and Lunar Module LM",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"David R. Scott during EVA",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Fourth day of the mission",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-8.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Landing of the Spider1",subtitle:"Hasselblad SWC/ Zeiss Biogon 38 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-9.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""}]},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c","d","e","f"]},gridLayout:{type:"grid-layout",scope:"layout",display:{type:"grid-layout"},gridParams:{type:"object",properties:{columnsCount:{type:"number",title:"Columns",min:1,max:4},wrapperWidth:{type:"number",title:"Width",min:0},entryWidth:{type:"number",title:"Entry",min:0},horizontalGap:{type:"number",title:"Gutter",min:0}}}},textBoxWidth:{type:"number",scope:"layout",title:"Text Width (%)",display:{type:"percentage-input"},min:0},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},showText:{type:"boolean",scope:"common",title:"Show text",display:{type:"toggle-cycle",enum:["always","on hover"]}},alignEntries:{type:"boolean",scope:"layout",title:"Align entries",display:{type:"toggle-cycle",enum:["on","off"]}},align:{type:"string",scope:"layout",title:"Align",display:{type:"toggle-cycle",enum:["top","center","bottom"]}},entriesCount:{type:"number",scope:"layout",title:"Entries #",display:{type:"toggle-numeric-input",enum:["auto","fixed"]},min:1},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},imageDisplay:{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"}}},imageCorners:{type:"number",scope:"layout",title:"Round corners",min:0,display:{type:"numeric-input"}},lightboxImageDisplay:{type:"string",scope:"common",title:"Display",display:{type:"toggle-cycle",enum:["fit","cover"]}},slider:{type:"boolean",scope:"common",title:"Slider",display:{type:"toggle-cycle",enum:["on","off"]}},sliderTiming:{type:"number",scope:"common",title:"Timing (Sec)",display:{type:"common-numeric-input"},min:1,max:10},direction:{type:"string",scope:"common",title:"Direction",display:{type:"toggle-cycle",enum:["horizontal","vertical","random"],enabled:!0}},transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["fade","slide"]}},titleMarginTop:{type:"number",scope:"layout",title:"Title margin top",min:0,max:100,display:{type:"range-control"}},subtitleMarginTop:{type:"number",scope:"layout",title:"Subtitle margin top",min:0,max:100,display:{type:"range-control"}},titleColor:{type:"string",scope:"common",title:"Title Entry",display:{type:"palette-color-picker"}},subtitleColor:{type:"string",scope:"common",title:"Subtitle Entry",display:{type:"palette-color-picker"}},lightboxCounterColor:{type:"string",scope:"common",title:"Counter Lightbox",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...Ur.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},titleFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},subtitleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},subtitleFontSettings:{...Ur.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},subtitleFontSize:{type:"number",scope:"layout",title:"Subtitle Font Size",display:{type:"font-size"}},subtitleLineHeight:{type:"number",scope:"layout",title:"Subtitle Line Height",display:{type:"line-height-input"}},subtitleLetterSpacing:{type:"number",scope:"layout",title:"Subtitle Letter Spacing",display:{type:"letter-spacing-input"}},subtitleWordSpacing:{type:"number",scope:"layout",title:"Subtitle Word Spacing",display:{type:"word-spacing-input"}},subtitleTextAppearance:{type:"object",scope:"layout",title:"Subtitle Text Appearance",display:{type:"text-appearance"}},lightboxCounterFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},lightboxCounterFontSettings:{...Ur.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},lightboxCounterFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},lightboxCounterLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},lightboxCounterLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},lightboxCounterWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},lightboxCounterTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}}},defaults:{lightbox:"on",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",slider:"on",sliderTiming:3,direction:"horizontal",transition:"fade",showText:"always",alignEntries:"off",align:"top",titleColor:"#000000",subtitleColor:"#000000",lightboxCounterColor:"#DEDDDD",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},subtitleFontFamily:"Goudy Bookletter 1911",subtitleFontSettings:{fontWeight:400,fontStyle:"normal"},subtitleLetterSpacing:0,subtitleWordSpacing:0,subtitleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},lightboxCounterFontFamily:"Goudy Bookletter 1911",lightboxCounterFontSettings:{fontWeight:400,fontStyle:"normal"},lightboxCounterLetterSpacing:0,lightboxCounterWordSpacing:0,lightboxCounterTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{type:"b",gridLayout:{entryWidth:.8,horizontalGap:.0533,wrapperWidth:1,columnsCount:1,lockedParam:null},textBoxWidth:100,verticalGap:.266,entriesCount:0,titleMarginTop:.02,subtitleMarginTop:.02,titleStroke:.003,titleCorners:.192,imageCorners:0,subtitlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titleFontSize:.1066,titleLineHeight:.0853,subtitleFontSize:.056,subtitleLineHeight:.064,lightboxCounterFontSize:.0373,lightboxCounterLineHeight:.0373},t:{type:"b",gridLayout:{entryWidth:.1041,horizontalGap:.26041,wrapperWidth:1,columnsCount:3,lockedParam:null},textBoxWidth:250,verticalGap:.09722,entriesCount:0,titleMarginTop:.01953125,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,imageCorners:0,subtitlePadding:{top:.01,right:.01,bottom:.01,left:.01},titlePadding:{top:.01,right:.01,bottom:.01,left:.01},titleFontSize:.03255,titleLineHeight:.03255,titleLetterSpacing:-.00118,subtitleFontSize:.01822,subtitleLineHeight:.02083,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01},d:{type:"b",gridLayout:{entryWidth:.0833,horizontalGap:.25,wrapperWidth:1,columnsCount:3,lockedParam:null},textBoxWidth:200,verticalGap:.09722,entriesCount:0,titleMarginTop:.008,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,imageCorners:0,subtitlePadding:{top:.01,right:.01,bottom:.01,left:.01},titlePadding:{top:.01,right:.01,bottom:.01,left:.01},titleFontSize:.027,titleLineHeight:.0222,titleLetterSpacing:-.00118,subtitleFontSize:.01,subtitleLineHeight:.01,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01}},displayRules:[{if:{name:"transition",value:"fade"},then:{name:"properties.direction.display.enabled",value:!1}},{if:{name:"lightbox",value:"off"},then:{name:"properties.lightboxImageDisplay.display.enabled",value:!1}},{if:{name:"imageDisplay.display",value:"cover"},then:{name:"properties.align.display.enabled",value:!1}}],layout:["__componentName__","name","type","gridLayout","textBoxWidth","verticalGap","showText","alignEntries","align","entriesCount","lightbox","imageDisplay","imageCorners","lightboxImageDisplay","slider","sliderTiming","direction","transition","transition","titleMarginTop","subtitleMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"Grid",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["textBoxWidth","verticalGap"]},{type:"row",title:"",items:["entriesCount","showText"]},{type:"row",title:"",items:["alignEntries","align"]}]},{id:"imageSettings",icon:"cover",title:"Image settings",tooltip:"Image settings",layout:["__componentName__",{type:"row",title:"Image",items:["imageDisplay","imageCorners"]},{type:"row",title:"Lightbox",items:["lightbox","lightboxImageDisplay"]},{type:"row",title:"Slider",items:[{type:"group",title:"",items:["slider","direction"]},{type:"group",title:"",items:["sliderTiming","transition"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]},{type:"group",title:"Subtitle",items:["subtitleFontFamily","subtitleFontSettings",{type:"row",items:["subtitleFontSize","subtitleLineHeight","subtitleLetterSpacing","subtitleWordSpacing"]},"subtitleTextAppearance"]},{type:"group",title:"Lightbox Counter",items:["lightboxCounterFontFamily","lightboxCounterFontSettings",{type:"row",items:["lightboxCounterFontSize","lightboxCounterLineHeight","lightboxCounterLetterSpacing","lightboxCounterWordSpacing"]},"lightboxCounterTextAppearance"]}]}],paletteBookmark:{items:[...bg],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Sg={element:fg,id:"grid",name:"Neptune",category:"grids",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Neptune_Grid.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"subtitleFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",subtitleFontSettings:"subtitleFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"},schema:wg,sourceCode:xg},$g=50,Ws=10,Ya="cntrl-lightbox-journal",Mr=Ya,Sa=`${Ya}-`,Er=e=>`${Ya}-${e}`,Za=e=>e===Mr||e.startsWith(Sa),_s=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},Ns=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=_s(t.get(Er(e)));if(i)return i}const n=_s(t.get(Mr));if(n)return n;for(const[i]of t){if(!i.startsWith(Sa))continue;const o=i.slice(Sa.length);if(!/^\d+$/.test(o))continue;const s=Number.parseInt(o,10);if(Number.isFinite(s)&&s>=1)return s}return null},Hs=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},fc=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{Za(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(Er(t),String(e)):i.searchParams.set(Mr,String(e));const o=n?"replaceState":"pushState",s=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",s)},Cg=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===Er(e)||i===Mr:Za(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)}},yc=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(Er(e)):[...t.keys()].some(n=>Za(n))},Tg=(e,t)=>{if(yc(t)){if(e){window.history.back();return}Cg(t)}},Lg=20,Rg=2,Kr=e=>`max(${e}, ${Lg}px)`,Hi=e=>((e==null?void 0:e.image)??[]).slice(0,Rg),vc=e=>e.reduce((t,n)=>t+Hi(n).length,0),Ig=(e,t)=>{const n=e.slice(0,t).reduce((o,s)=>o+Hi(s).length,1),i=Hi(e[t]).length;return{start:n,end:n+i-1}},Mg=(e,t)=>{const n=vc(e),{start:i,end:o}=Ig(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},or=(e,t)=>t==="B"?e.flatMap((n,i)=>Hi(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Hi(n)})),Eg=(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 Mg(i,o)},Os=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",Pg=(e,t,n)=>e==="B"?t.length>1:vc(n)>1,gn=.004,Bn=.004,Ai={title1Width:.13,title2Width:.13,title3Width:.14},Vn=(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},Oi=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((s,l)=>s+l,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:s,widths:l},d)=>{if(s<=0||d<=0)return{overflow:s,widths:[d,...l]};const c=Math.min(s,d);return{overflow:s-c,widths:[d-c,...l]}},{overflow:i-1,widths:[]});return o},bo=(e,t)=>Oi(e,t),sn=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Gn=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Oi(e.length,n),effective:bo(e.length,n)}},xc=(e,t,n,i)=>e.slice(0,i).reduce((o,s,l)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[l]??0),0),bc=(e,t,n,i)=>e.slice(0,i+1).reduce((o,s,l)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[l]??0),0),Kn=["title1","title2","title3","count"],Ze=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Ja={title1:"1",title2:"2",title3:"3",count:"Count"},Qa=e=>[Ze(e,"fontFamily"),Ze(e,"fontSettings"),{type:"row",items:[Ze(e,"fontSize"),Ze(e,"lineHeight"),Ze(e,"letterSpacing"),Ze(e,"wordSpacing")]},Ze(e,"textAlign"),Ze(e,"textAppearance")],kg=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Kn.map(e=>[Ja[e],Qa(e)]))}),Ag={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Fg={title1:.02,title2:.02,title3:.02,count:.017},ui=(e,t)=>{const n=i=>{const o=Ze(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[Ag[t]]}},pi=(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??Fg[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Ut(i,n)};function wc({prefix:e,entry:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,onClose:l}){const{title1Width:d,title2Width:c,title3Width:u,title1MarginLeft:p=0,title2MarginLeft:b=0,title3MarginLeft:w=0,titleRowMarginBottom:f=0,titleHeaderLayout:h="desktop",contentMarginTop:m=0,iconMarginRight:v=0,closeIcon:M=null,closeIconMaxWidth:R=0,closeIconColor:L="#000000",closeIconHoverColor:X="#cccccc"}=n,A=S.scalingValue(m,i),B=S.scalingValue(v,i),P=S.scalingValue(f,i),C=h==="mobile",j=pi("title1",ui(n,"title1"),i),x=pi("title2",ui(n,"title2"),i),W=pi("title3",ui(n,"title3"),i),E=a.useMemo(()=>({title1Width:d??Ai.title1Width,title2Width:c??Ai.title2Width,title3Width:u??Ai.title3Width}),[d,c,u]),Z=a.useMemo(()=>({title2MarginLeft:b,title3MarginLeft:w}),[b,w]),k=a.useMemo(()=>Vn(e,t,j,x,W),[e,t,j,x,W]),U=a.useMemo(()=>k.map(N=>E[N.widthKey]),[k,E]),V=a.useMemo(()=>Oi(k.length,U),[k.length,U]),G=a.useMemo(()=>bo(k.length,U),[k.length,U]),ie=a.useMemo(()=>k.filter(N=>N.prefix==="title1"),[k]),$=a.useMemo(()=>k.filter(N=>N.prefix==="title2"||N.prefix==="title3"),[k]),I=a.useMemo(()=>Gn(ie,E),[ie,E]),D=a.useMemo(()=>Gn($,E),[$,E]),se=!!(t.title1||t.title2||t.title3),oe=M!==null;if(!(se||oe))return null;const ue=(p??0)>0||o,F=(N,ee)=>{const Ie=k.findIndex(O=>O.prefix===N.prefix);if(!C||ee==="single-row")return{effectiveWidth:G[Ie]??0,resolvedWidth:V[Ie]??0,maxWidth:sn(Ie,V)};if(ee==="two-row-top"){const O=ie.findIndex(Ve=>Ve.prefix===N.prefix);return{effectiveWidth:I.effective[O]??0,resolvedWidth:I.resolved[O]??0,maxWidth:sn(O,I.resolved)}}const re=$.findIndex(O=>O.prefix===N.prefix);return{effectiveWidth:D.effective[re]??0,resolvedWidth:D.resolved[re]??0,maxWidth:sn(re,D.resolved)}},ne=(N,ee,Ie)=>{if(!C||Ie==="single-row"){const lt=N.findIndex(Be=>Be.prefix===ee.prefix),tt=N.map(Be=>E[Be.widthKey]),ht=Oi(N.length,tt);return{effectiveWidth:bo(N.length,tt)[lt]??0,resolvedWidth:ht[lt]??0,maxWidth:sn(lt,ht)}}if(Ie==="two-row-top"){const lt=N.filter(Be=>Be.prefix==="title1"),tt=lt.findIndex(Be=>Be.prefix===ee.prefix),{resolved:ht,effective:nt}=Gn(lt,E);return{effectiveWidth:nt[tt]??0,resolvedWidth:ht[tt]??0,maxWidth:sn(tt,ht)}}const re=N.filter(lt=>lt.prefix==="title2"||lt.prefix==="title3"),O=re.findIndex(lt=>lt.prefix===ee.prefix),{resolved:Ve,effective:Oe}=Gn(re,E);return{effectiveWidth:Oe[O]??0,resolvedWidth:Ve[O]??0,maxWidth:sn(O,Ve)}},J=N=>bc(k,V,Z,N)+(C?0:p??0),ve=()=>C?0:p??0,Ee=N=>$.slice(0,N).reduce((ee,Ie,re)=>ee+(Ie.marginLeftKey?Z[Ie.marginLeftKey]??0:0)+(D.resolved[re]??0),0),me=N=>{const ee=$[N];return Ee(N)+(ee.marginLeftKey?Z[ee.marginLeftKey]??0:0)+(D.resolved[N]??0)},de=(N,ee,Ie)=>{const re=N.marginLeftKey?Z[N.marginLeftKey]??0:0,{effectiveWidth:O,resolvedWidth:Ve,maxWidth:Oe}=Ie??F(N,ee),lt=Math.max(re,Bn),tt=o&&ee==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":N.prefix,style:{width:S.scalingValue(O,i),...re>0?{marginLeft:S.scalingValue(re,i)}:{}},children:[r.jsx("p",{className:N.className,style:N.style,children:N.text}),tt&&N.marginLeftKey?r.jsx("div",{"data-controls":N.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ve),style:{position:"absolute",top:0,left:S.scalingValue(-re,i),width:S.scalingValue(lt,i),height:"100%",pointerEvents:"auto"}}):null,tt?r.jsx("div",{"data-controls":N.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Oe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:S.scalingValue(-gn/2,i),width:S.scalingValue(gn,i),height:"100%",pointerEvents:"auto"}}):null]},N.className)},q=(N="two-row")=>{const ee=k.findIndex(O=>O.prefix==="title1"),Ie=ee>=0?V[ee]:E.title1Width,re=N==="two-row"&&o;return r.jsx("div",{...re?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ie)}:{},style:{width:S.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...re?{pointerEvents:"auto"}:{}}})},Q=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:j,"aria-hidden":"true",children:" "}),Y=N=>{const ee=Vn(e,N,j,x,W);return r.jsx(r.Fragment,{children:ee.map(Ie=>de(Ie,"single-row",ne(ee,Ie,"single-row")))})},_e=N=>{const ee=Vn(e,N,j,x,W),Ie=ee.find(re=>re.prefix==="title1");return Ie?de(Ie,"two-row-top",ne(ee,Ie,"two-row-top")):null},Ce=(N,ee=!1)=>{const Ie=Vn(e,N,j,x,W),re=Ie.filter(Oe=>Oe.prefix==="title2"||Oe.prefix==="title3"),O=o&&ee;return re.length>0||O||(f??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[re.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[r.jsx("div",{className:`${e}-titles-stack`,children:re.map(Oe=>de(Oe,"two-row-bottom",ne(Ie,Oe,"two-row-bottom")))}),ee&&o?r.jsxs(r.Fragment,{children:[xe(),Re()]}):null]}):null,(f??0)>0||O?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:P,width:"100%",flexShrink:0,pointerEvents:O?"auto":"none"}}):null]}):null},ke=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:S.scalingValue(R??0,i),height:S.scalingValue(R??0,i),marginRight:B,"--close-icon-hover-color":X},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:N=>{N.stopPropagation(),l==null||l()},"aria-label":"Close",children:r.jsx(rn,{url:M??"",fill:L,hoverFill:i&&!s?L:X,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:B,height:"100%",pointerEvents:"auto"}})]}),ce=()=>oe?r.jsx("div",{className:`${e}-titles-row-header-controls`,children:ke()}):null,ge=N=>r.jsx("div",{className:`${e}-titles-row-titles`,children:r.jsx("div",{className:`${e}-titles-stack`,children:N})}),we=N=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[oe||se?Q():null,ue?q("two-row"):null,ge(N),ce()]}),z=(N,ee=!1)=>r.jsxs(r.Fragment,{children:[we(_e(N)),Ce(N,ee)]}),le=()=>{const N=C?-1:k.findIndex(re=>re.prefix==="title1"),ee=!C&&(o||(p??0)>0)?(()=>{const re=p??0,O=N>=0?V[N]:E.title1Width,Ve=Math.max(re,Bn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(O),style:{position:"absolute",top:0,left:0,width:S.scalingValue(Ve,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,Ie=k.flatMap((re,O)=>{if(!re.marginLeftKey)return[];const Ve=Z[re.marginLeftKey]??0,Oe=xc(k,V,Z,O)+ve(),lt=Math.max(Ve,Bn);return r.jsx("div",{"data-controls":re.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(V[O]),style:{position:"absolute",top:0,left:S.scalingValue(Oe,i),width:S.scalingValue(lt,i),height:"100%",pointerEvents:"auto"}},re.marginLeftKey)});return ee?[ee,...Ie]:Ie},he=()=>k.map((N,ee)=>{const Ie=sn(ee,V),O=J(ee)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":N.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ie),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:S.scalingValue(O,i),width:S.scalingValue(gn,i),height:"100%",pointerEvents:"auto"}})},`${N.widthKey}-junction`)}),xe=()=>$.flatMap((N,ee)=>{if(!N.marginLeftKey)return[];const Ie=Z[N.marginLeftKey]??0,re=Ee(ee),O=Math.max(Ie,Bn),{resolvedWidth:Ve}=F(N,"two-row-bottom");return r.jsx("div",{"data-controls":N.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ve),style:{position:"absolute",top:0,left:S.scalingValue(re,i),width:S.scalingValue(O,i),height:"100%",pointerEvents:"auto"}},N.marginLeftKey)}),Re=()=>$.map((N,ee)=>{const{maxWidth:Ie}=F(N,"two-row-bottom"),O=me(ee)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":N.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ie),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:S.scalingValue(O,i),width:S.scalingValue(gn,i),height:"100%",pointerEvents:"auto"}})},`${N.widthKey}-junction`)}),Te=()=>!o||C?null:r.jsxs(r.Fragment,{children:[le(),he()]}),_=!!(t.title2||t.title3||(f??0)>0||o),pe=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[oe||se?Q():null,ue?q("single-row"):null,se?ge(Y(t)):r.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),ce(),Te()]}),te=()=>r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,..._?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:_?void 0:{flex:"0 0 auto",height:"auto"},children:z(t,!0)}),Te()]});return r.jsxs("div",{className:`${e}-lightbox-overlay-content`,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:A,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...C?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${C?` ${e}-lightbox-content-area-stacked`:""}`,children:r.jsx("div",{className:`${e}-text-bar-cell${C?` ${e}-text-bar-cell-stacked`:""}`,style:C?void 0:{flex:1,minWidth:0,width:"100%"},children:C?te():pe()})})})]})}function Wg(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function _g(e){return`
6215
+ `,Ur={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},bg=["titleColor","subtitleColor","lightboxCounterColor"],wg={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{title:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},subtitle:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},gallery:{type:"array",label:"Gallery",display:{type:"media-pair-list-input"},items:{type:"object",properties:{media:{type:"array",items:{type:"object",properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}}}}}}},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["gallery"]},default:[{title:"Earth-orbital mission",subtitle:"Hasselblad SWC/ Zeiss Biogon 38 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Salton Sea from Above",subtitle:"Hasselblad 500 EL / Zeiss Sonnar 250 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Lunar Module Pilot",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Lunar Module 3 porch",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Command Module",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-10.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"CSM and Lunar Module LM",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"David R. Scott during EVA",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Fourth day of the mission",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-8.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Landing of the Spider1",subtitle:"Hasselblad SWC/ Zeiss Biogon 38 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-9.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""}]},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c","d","e","f"]},gridLayout:{type:"grid-layout",scope:"layout",display:{type:"grid-layout"},gridParams:{type:"object",properties:{columnsCount:{type:"number",title:"Columns",min:1,max:4},wrapperWidth:{type:"number",title:"Width",min:0},entryWidth:{type:"number",title:"Entry",min:0},horizontalGap:{type:"number",title:"Gutter",min:0}}}},textBoxWidth:{type:"number",scope:"layout",title:"Text Width (%)",display:{type:"percentage-input"},min:0},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},showText:{type:"boolean",scope:"common",title:"Show text",display:{type:"toggle-cycle",enum:["always","on hover"]}},alignEntries:{type:"boolean",scope:"layout",title:"Align entries",display:{type:"toggle-cycle",enum:["on","off"]}},align:{type:"string",scope:"layout",title:"Align",display:{type:"toggle-cycle",enum:["top","center","bottom"]}},entriesCount:{type:"number",scope:"layout",title:"Entries #",display:{type:"toggle-numeric-input",enum:["auto","fixed"]},min:1},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},imageDisplay:{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"}}},imageCorners:{type:"number",scope:"layout",title:"Round corners",min:0,display:{type:"numeric-input"}},lightboxImageDisplay:{type:"string",scope:"common",title:"Display",display:{type:"toggle-cycle",enum:["fit","cover"]}},slider:{type:"boolean",scope:"common",title:"Slider",display:{type:"toggle-cycle",enum:["on","off"]}},sliderTiming:{type:"number",scope:"common",title:"Timing (Sec)",display:{type:"common-numeric-input"},min:1,max:10},direction:{type:"string",scope:"common",title:"Direction",display:{type:"toggle-cycle",enum:["horizontal","vertical","random"],enabled:!0}},transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["fade","slide"]}},titleMarginTop:{type:"number",scope:"layout",title:"Title margin top",min:0,max:100,display:{type:"range-control"}},subtitleMarginTop:{type:"number",scope:"layout",title:"Subtitle margin top",min:0,max:100,display:{type:"range-control"}},titleColor:{type:"string",scope:"common",title:"Title Entry",display:{type:"palette-color-picker"}},subtitleColor:{type:"string",scope:"common",title:"Subtitle Entry",display:{type:"palette-color-picker"}},lightboxCounterColor:{type:"string",scope:"common",title:"Counter Lightbox",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...Ur.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},titleFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},subtitleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},subtitleFontSettings:{...Ur.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},subtitleFontSize:{type:"number",scope:"layout",title:"Subtitle Font Size",display:{type:"font-size"}},subtitleLineHeight:{type:"number",scope:"layout",title:"Subtitle Line Height",display:{type:"line-height-input"}},subtitleLetterSpacing:{type:"number",scope:"layout",title:"Subtitle Letter Spacing",display:{type:"letter-spacing-input"}},subtitleWordSpacing:{type:"number",scope:"layout",title:"Subtitle Word Spacing",display:{type:"word-spacing-input"}},subtitleTextAppearance:{type:"object",scope:"layout",title:"Subtitle Text Appearance",display:{type:"text-appearance"}},lightboxCounterFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},lightboxCounterFontSettings:{...Ur.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},lightboxCounterFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},lightboxCounterLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},lightboxCounterLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},lightboxCounterWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},lightboxCounterTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}}},defaults:{lightbox:"on",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",slider:"on",sliderTiming:3,direction:"horizontal",transition:"fade",showText:"always",alignEntries:"off",align:"top",titleColor:"#000000",subtitleColor:"#000000",lightboxCounterColor:"#DEDDDD",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},subtitleFontFamily:"Goudy Bookletter 1911",subtitleFontSettings:{fontWeight:400,fontStyle:"normal"},subtitleLetterSpacing:0,subtitleWordSpacing:0,subtitleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},lightboxCounterFontFamily:"Goudy Bookletter 1911",lightboxCounterFontSettings:{fontWeight:400,fontStyle:"normal"},lightboxCounterLetterSpacing:0,lightboxCounterWordSpacing:0,lightboxCounterTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{type:"b",gridLayout:{entryWidth:.8,horizontalGap:.0533,wrapperWidth:1,columnsCount:1,lockedParam:null},textBoxWidth:100,verticalGap:.266,entriesCount:0,titleMarginTop:.02,subtitleMarginTop:.02,titleStroke:.003,titleCorners:.192,imageCorners:0,subtitlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titleFontSize:.1066,titleLineHeight:.0853,subtitleFontSize:.056,subtitleLineHeight:.064,lightboxCounterFontSize:.0373,lightboxCounterLineHeight:.0373},t:{type:"b",gridLayout:{entryWidth:.1041,horizontalGap:.26041,wrapperWidth:1,columnsCount:3,lockedParam:null},textBoxWidth:250,verticalGap:.09722,entriesCount:0,titleMarginTop:.01953125,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,imageCorners:0,subtitlePadding:{top:.01,right:.01,bottom:.01,left:.01},titlePadding:{top:.01,right:.01,bottom:.01,left:.01},titleFontSize:.03255,titleLineHeight:.03255,titleLetterSpacing:-.00118,subtitleFontSize:.01822,subtitleLineHeight:.02083,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01},d:{type:"b",gridLayout:{entryWidth:.0833,horizontalGap:.25,wrapperWidth:1,columnsCount:3,lockedParam:null},textBoxWidth:200,verticalGap:.09722,entriesCount:0,titleMarginTop:.008,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,imageCorners:0,subtitlePadding:{top:.01,right:.01,bottom:.01,left:.01},titlePadding:{top:.01,right:.01,bottom:.01,left:.01},titleFontSize:.027,titleLineHeight:.0222,titleLetterSpacing:-.00118,subtitleFontSize:.01,subtitleLineHeight:.01,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01}},displayRules:[{if:{name:"transition",value:"fade"},then:{name:"properties.direction.display.enabled",value:!1}},{if:{name:"lightbox",value:"off"},then:{name:"properties.lightboxImageDisplay.display.enabled",value:!1}},{if:{name:"imageDisplay.display",value:"cover"},then:{name:"properties.align.display.enabled",value:!1}}],layout:["__componentName__","name","type","gridLayout","textBoxWidth","verticalGap","showText","alignEntries","align","entriesCount","lightbox","imageDisplay","imageCorners","lightboxImageDisplay","slider","sliderTiming","direction","transition","transition","titleMarginTop","subtitleMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"Grid",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["textBoxWidth","verticalGap"]},{type:"row",title:"",items:["entriesCount","showText"]},{type:"row",title:"",items:["alignEntries","align"]}]},{id:"imageSettings",icon:"cover",title:"Image settings",tooltip:"Image settings",layout:["__componentName__",{type:"row",title:"Image",items:["imageDisplay","imageCorners"]},{type:"row",title:"Lightbox",items:["lightbox","lightboxImageDisplay"]},{type:"row",title:"Slider",items:[{type:"group",title:"",items:["slider","direction"]},{type:"group",title:"",items:["sliderTiming","transition"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]},{type:"group",title:"Subtitle",items:["subtitleFontFamily","subtitleFontSettings",{type:"row",items:["subtitleFontSize","subtitleLineHeight","subtitleLetterSpacing","subtitleWordSpacing"]},"subtitleTextAppearance"]},{type:"group",title:"Lightbox Counter",items:["lightboxCounterFontFamily","lightboxCounterFontSettings",{type:"row",items:["lightboxCounterFontSize","lightboxCounterLineHeight","lightboxCounterLetterSpacing","lightboxCounterWordSpacing"]},"lightboxCounterTextAppearance"]}]}],paletteBookmark:{items:[...bg],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Sg={element:fg,id:"grid",name:"Neptune",category:"grids",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Neptune_Grid.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"subtitleFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",subtitleFontSettings:"subtitleFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"},schema:wg,sourceCode:xg},$g=50,Ws=10,Ya="cntrl-lightbox-journal",Mr=Ya,Sa=`${Ya}-`,Er=e=>`${Ya}-${e}`,Za=e=>e===Mr||e.startsWith(Sa),_s=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},Ns=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=_s(t.get(Er(e)));if(i)return i}const n=_s(t.get(Mr));if(n)return n;for(const[i]of t){if(!i.startsWith(Sa))continue;const o=i.slice(Sa.length);if(!/^\d+$/.test(o))continue;const s=Number.parseInt(o,10);if(Number.isFinite(s)&&s>=1)return s}return null},Hs=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},fc=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{Za(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(Er(t),String(e)):i.searchParams.set(Mr,String(e));const o=n?"replaceState":"pushState",s=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",s)},Cg=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===Er(e)||i===Mr:Za(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)}},yc=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(Er(e)):[...t.keys()].some(n=>Za(n))},Tg=(e,t)=>{if(yc(t)){if(e){window.history.back();return}Cg(t)}},Lg=20,Rg=2,Kr=e=>`max(${e}, ${Lg}px)`,Hi=e=>((e==null?void 0:e.image)??[]).slice(0,Rg),vc=e=>e.reduce((t,n)=>t+Hi(n).length,0),Ig=(e,t)=>{const n=e.slice(0,t).reduce((o,s)=>o+Hi(s).length,1),i=Hi(e[t]).length;return{start:n,end:n+i-1}},Mg=(e,t)=>{const n=vc(e),{start:i,end:o}=Ig(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},or=(e,t)=>t==="B"?e.flatMap((n,i)=>Hi(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Hi(n)})),Eg=(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 Mg(i,o)},Os=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",Pg=(e,t,n)=>e==="B"?t.length>1:vc(n)>1,gn=.004,Bn=.004,Ai={title1Width:.13,title2Width:.13,title3Width:.14},Vn=(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},Oi=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((s,l)=>s+l,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:s,widths:l},d)=>{if(s<=0||d<=0)return{overflow:s,widths:[d,...l]};const c=Math.min(s,d);return{overflow:s-c,widths:[d-c,...l]}},{overflow:i-1,widths:[]});return o},bo=(e,t)=>Oi(e,t),sn=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Gn=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Oi(e.length,n),effective:bo(e.length,n)}},xc=(e,t,n,i)=>e.slice(0,i).reduce((o,s,l)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[l]??0),0),bc=(e,t,n,i)=>e.slice(0,i+1).reduce((o,s,l)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[l]??0),0),Kn=["title1","title2","title3","count"],Ze=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Ja={title1:"1",title2:"2",title3:"3",count:"Count"},Qa=e=>[Ze(e,"fontFamily"),Ze(e,"fontSettings"),{type:"row",items:[Ze(e,"fontSize"),Ze(e,"lineHeight"),Ze(e,"letterSpacing"),Ze(e,"wordSpacing")]},Ze(e,"textAlign"),Ze(e,"textAppearance")],kg=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Kn.map(e=>[Ja[e],Qa(e)]))}),Ag={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Fg={title1:.02,title2:.02,title3:.02,count:.017},ui=(e,t)=>{const n=i=>{const o=Ze(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[Ag[t]]}},pi=(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??Fg[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Ut(i,n)};function wc({prefix:e,entry:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,onClose:l}){const{title1Width:d,title2Width:c,title3Width:u,title1MarginLeft:p=0,title2MarginLeft:b=0,title3MarginLeft:w=0,titleRowMarginBottom:f=0,titleHeaderLayout:h="desktop",contentMarginTop:m=0,iconMarginRight:v=0,closeIcon:M=null,closeIconMaxWidth:R=0,closeIconColor:L="#000000",closeIconHoverColor:X="#cccccc"}=n,F=S.scalingValue(m,i),B=S.scalingValue(v,i),k=S.scalingValue(f,i),C=h==="mobile",j=pi("title1",ui(n,"title1"),i),x=pi("title2",ui(n,"title2"),i),W=pi("title3",ui(n,"title3"),i),E=a.useMemo(()=>({title1Width:d??Ai.title1Width,title2Width:c??Ai.title2Width,title3Width:u??Ai.title3Width}),[d,c,u]),Z=a.useMemo(()=>({title2MarginLeft:b,title3MarginLeft:w}),[b,w]),P=a.useMemo(()=>Vn(e,t,j,x,W),[e,t,j,x,W]),U=a.useMemo(()=>P.map(N=>E[N.widthKey]),[P,E]),V=a.useMemo(()=>Oi(P.length,U),[P.length,U]),G=a.useMemo(()=>bo(P.length,U),[P.length,U]),ie=a.useMemo(()=>P.filter(N=>N.prefix==="title1"),[P]),$=a.useMemo(()=>P.filter(N=>N.prefix==="title2"||N.prefix==="title3"),[P]),I=a.useMemo(()=>Gn(ie,E),[ie,E]),D=a.useMemo(()=>Gn($,E),[$,E]),se=!!(t.title1||t.title2||t.title3),oe=M!==null;if(!(se||oe))return null;const ue=(p??0)>0||o,A=(N,ee)=>{const Ie=P.findIndex(O=>O.prefix===N.prefix);if(!C||ee==="single-row")return{effectiveWidth:G[Ie]??0,resolvedWidth:V[Ie]??0,maxWidth:sn(Ie,V)};if(ee==="two-row-top"){const O=ie.findIndex(Ve=>Ve.prefix===N.prefix);return{effectiveWidth:I.effective[O]??0,resolvedWidth:I.resolved[O]??0,maxWidth:sn(O,I.resolved)}}const re=$.findIndex(O=>O.prefix===N.prefix);return{effectiveWidth:D.effective[re]??0,resolvedWidth:D.resolved[re]??0,maxWidth:sn(re,D.resolved)}},ne=(N,ee,Ie)=>{if(!C||Ie==="single-row"){const lt=N.findIndex(Be=>Be.prefix===ee.prefix),tt=N.map(Be=>E[Be.widthKey]),ht=Oi(N.length,tt);return{effectiveWidth:bo(N.length,tt)[lt]??0,resolvedWidth:ht[lt]??0,maxWidth:sn(lt,ht)}}if(Ie==="two-row-top"){const lt=N.filter(Be=>Be.prefix==="title1"),tt=lt.findIndex(Be=>Be.prefix===ee.prefix),{resolved:ht,effective:nt}=Gn(lt,E);return{effectiveWidth:nt[tt]??0,resolvedWidth:ht[tt]??0,maxWidth:sn(tt,ht)}}const re=N.filter(lt=>lt.prefix==="title2"||lt.prefix==="title3"),O=re.findIndex(lt=>lt.prefix===ee.prefix),{resolved:Ve,effective:Oe}=Gn(re,E);return{effectiveWidth:Oe[O]??0,resolvedWidth:Ve[O]??0,maxWidth:sn(O,Ve)}},J=N=>bc(P,V,Z,N)+(C?0:p??0),ve=()=>C?0:p??0,Ee=N=>$.slice(0,N).reduce((ee,Ie,re)=>ee+(Ie.marginLeftKey?Z[Ie.marginLeftKey]??0:0)+(D.resolved[re]??0),0),me=N=>{const ee=$[N];return Ee(N)+(ee.marginLeftKey?Z[ee.marginLeftKey]??0:0)+(D.resolved[N]??0)},de=(N,ee,Ie)=>{const re=N.marginLeftKey?Z[N.marginLeftKey]??0:0,{effectiveWidth:O,resolvedWidth:Ve,maxWidth:Oe}=Ie??A(N,ee),lt=Math.max(re,Bn),tt=o&&ee==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":N.prefix,style:{width:S.scalingValue(O,i),...re>0?{marginLeft:S.scalingValue(re,i)}:{}},children:[r.jsx("p",{className:N.className,style:N.style,children:N.text}),tt&&N.marginLeftKey?r.jsx("div",{"data-controls":N.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ve),style:{position:"absolute",top:0,left:S.scalingValue(-re,i),width:S.scalingValue(lt,i),height:"100%",pointerEvents:"auto"}}):null,tt?r.jsx("div",{"data-controls":N.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Oe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:S.scalingValue(-gn/2,i),width:S.scalingValue(gn,i),height:"100%",pointerEvents:"auto"}}):null]},N.className)},q=(N="two-row")=>{const ee=P.findIndex(O=>O.prefix==="title1"),Ie=ee>=0?V[ee]:E.title1Width,re=N==="two-row"&&o;return r.jsx("div",{...re?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ie)}:{},style:{width:S.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...re?{pointerEvents:"auto"}:{}}})},Q=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:j,"aria-hidden":"true",children:" "}),Y=N=>{const ee=Vn(e,N,j,x,W);return r.jsx(r.Fragment,{children:ee.map(Ie=>de(Ie,"single-row",ne(ee,Ie,"single-row")))})},_e=N=>{const ee=Vn(e,N,j,x,W),Ie=ee.find(re=>re.prefix==="title1");return Ie?de(Ie,"two-row-top",ne(ee,Ie,"two-row-top")):null},Ce=(N,ee=!1)=>{const Ie=Vn(e,N,j,x,W),re=Ie.filter(Oe=>Oe.prefix==="title2"||Oe.prefix==="title3"),O=o&&ee;return re.length>0||O||(f??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[re.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[r.jsx("div",{className:`${e}-titles-stack`,children:re.map(Oe=>de(Oe,"two-row-bottom",ne(Ie,Oe,"two-row-bottom")))}),ee&&o?r.jsxs(r.Fragment,{children:[xe(),Re()]}):null]}):null,(f??0)>0||O?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:k,width:"100%",flexShrink:0,pointerEvents:O?"auto":"none"}}):null]}):null},ke=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:S.scalingValue(R??0,i),height:S.scalingValue(R??0,i),marginRight:B,"--close-icon-hover-color":X},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:N=>{N.stopPropagation(),l==null||l()},"aria-label":"Close",children:r.jsx(rn,{url:M??"",fill:L,hoverFill:i&&!s?L:X,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:B,height:"100%",pointerEvents:"auto"}})]}),ce=()=>oe?r.jsx("div",{className:`${e}-titles-row-header-controls`,children:ke()}):null,ge=N=>r.jsx("div",{className:`${e}-titles-row-titles`,children:r.jsx("div",{className:`${e}-titles-stack`,children:N})}),we=N=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[oe||se?Q():null,ue?q("two-row"):null,ge(N),ce()]}),z=(N,ee=!1)=>r.jsxs(r.Fragment,{children:[we(_e(N)),Ce(N,ee)]}),le=()=>{const N=C?-1:P.findIndex(re=>re.prefix==="title1"),ee=!C&&(o||(p??0)>0)?(()=>{const re=p??0,O=N>=0?V[N]:E.title1Width,Ve=Math.max(re,Bn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(O),style:{position:"absolute",top:0,left:0,width:S.scalingValue(Ve,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,Ie=P.flatMap((re,O)=>{if(!re.marginLeftKey)return[];const Ve=Z[re.marginLeftKey]??0,Oe=xc(P,V,Z,O)+ve(),lt=Math.max(Ve,Bn);return r.jsx("div",{"data-controls":re.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(V[O]),style:{position:"absolute",top:0,left:S.scalingValue(Oe,i),width:S.scalingValue(lt,i),height:"100%",pointerEvents:"auto"}},re.marginLeftKey)});return ee?[ee,...Ie]:Ie},he=()=>P.map((N,ee)=>{const Ie=sn(ee,V),O=J(ee)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":N.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ie),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:S.scalingValue(O,i),width:S.scalingValue(gn,i),height:"100%",pointerEvents:"auto"}})},`${N.widthKey}-junction`)}),xe=()=>$.flatMap((N,ee)=>{if(!N.marginLeftKey)return[];const Ie=Z[N.marginLeftKey]??0,re=Ee(ee),O=Math.max(Ie,Bn),{resolvedWidth:Ve}=A(N,"two-row-bottom");return r.jsx("div",{"data-controls":N.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ve),style:{position:"absolute",top:0,left:S.scalingValue(re,i),width:S.scalingValue(O,i),height:"100%",pointerEvents:"auto"}},N.marginLeftKey)}),Re=()=>$.map((N,ee)=>{const{maxWidth:Ie}=A(N,"two-row-bottom"),O=me(ee)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":N.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ie),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:S.scalingValue(O,i),width:S.scalingValue(gn,i),height:"100%",pointerEvents:"auto"}})},`${N.widthKey}-junction`)}),Te=()=>!o||C?null:r.jsxs(r.Fragment,{children:[le(),he()]}),_=!!(t.title2||t.title3||(f??0)>0||o),pe=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[oe||se?Q():null,ue?q("single-row"):null,se?ge(Y(t)):r.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),ce(),Te()]}),te=()=>r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,..._?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:_?void 0:{flex:"0 0 auto",height:"auto"},children:z(t,!0)}),Te()]});return r.jsxs("div",{className:`${e}-lightbox-overlay-content`,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:F,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...C?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${C?` ${e}-lightbox-content-area-stacked`:""}`,children:r.jsx("div",{className:`${e}-text-bar-cell${C?` ${e}-text-bar-cell-stacked`:""}`,style:C?void 0:{flex:1,minWidth:0,width:"100%"},children:C?te():pe()})})})]})}function Wg(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function _g(e){return`
6216
6216
  .${e}-wrapper {
6217
6217
  display: grid;
6218
6218
  align-items: start;
@@ -6532,7 +6532,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
6532
6532
  pointer-events: auto;
6533
6533
  flex-shrink: 0;
6534
6534
  }
6535
- `}const Ds={url:"",name:"",objectFit:"cover"},$n=500,eo=650,un="cubic-bezier(0.22, 1, 0.36, 1)",Ng=72,Hg=50,Og=1e4,Dg=650,jg=500;function zg(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,s=e.top-t.top;return`translate(${o}px, ${s}px) scale(${n}, ${i})`}function Sc(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=pr(e);return{left:i.x,top:i.y,width:i.width,height:i.height}}const n=e.getBoundingClientRect();return{left:n.left,top:n.top,width:n.width,height:n.height}}function Bg(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?Sc(i,n):null}function Vg(e){return e.reduce((t,n,i)=>{const o=es(n.gallery),l=ts(o).filter(d=>d.lightboxMedia).map(d=>d.lightboxMedia);return l.length===0||t.push({gridIndex:i,items:l,entry:{title1:n.title1??"",title2:n.title2??"",title3:n.title3??""}}),t},[])}function ro(e,t,n){var o;if(e.length<=1)return null;const i=(t+n+e.length)%e.length;return((o=e[i])==null?void 0:o.items[0])??null}function js(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return ro(e,i,n)}const Gg=.03;function $c(e){return e.width*Gg}const Xr={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Bo(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function zs(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function qg(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function $a(e,t,n){const i=e.getBoundingClientRect(),o=i.width,s=i.height,l=t/n,d=o/s;if(l>d){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(s-u)/2}}const c=s*l;return{width:c,height:s,left:i.left+(o-c)/2,top:i.top}}function Ug(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:$a(e,t.width,t.height)}function Kg(e,t){if(Zi(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.url,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.url,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.url,n.naturalWidth,n.naturalHeight)},n.src=e.url}function Xg(e){const t=new Set,n=[];for(const i of e){const o=es(i.gallery),s=ts(o);for(const l of s)for(const d of[l.displayMedia,l.lightboxMedia])d!=null&&d.url&&!t.has(d.url)&&(t.add(d.url),n.push(d))}return n}function Yg({mediaList:e}){return e.length===0?null:r.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Zi(t)?r.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):r.jsx("img",{src:t.url,alt:""},t.url))})}function Di(e,t,n){const{width:i,height:o,top:s}=e,{left:l,width:d}=n,c=$c(n);return t==="left"?{left:l+c-i,top:s,width:i,height:o}:{left:l+d-c,top:s,width:i,height:o}}function mr(e,t,n){const i=Di(e,t,n);return{...i,left:2*i.left-e.left}}function Zg(e,t,n){const{left:i,width:o}=n,s=$c(n);return t==="left"?{left:i,top:e.top,width:s,height:e.height}:{left:i+o-s,top:e.top,width:s,height:e.height}}function Cc(e,t,n,i){const o=Di(e,"left",i),s=Di(e,"right",i),l=mr(e,"left",i),d=mr(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:s,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:d,end:s};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:s};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:s,end:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function Jg(e,t,n,i){const{start:o,end:s}=Cc(e,t,n,i);return{x:s.left-o.left,y:s.top-o.top}}function Qg(e,t,n){const i=Di(e,t,n),o=mr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Tc(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 es(e){if(!e)return;if(Tc(e))return e;if(!Array.isArray(e))return;const[t,n]=e,i=t!=null&&t.url?t:void 0,o=n!=null&&n.url?n:void 0;if(!(!i&&!o))return[{media:[o??i??Ds,i??o??Ds]}]}function eh(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function th(e){const[t]=e.media;return t!=null&&t.url?t:null}function ts(e){if(!Array.isArray(e)||e.length===0)return[];if(Tc(e)){const t=[];for(const n of e){const i=eh(n);if(!i)continue;const o=th(n);t.push({displayMedia:i,lightboxMedia:o!=null&&o.url?o:null})}return t}return e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function Zi(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function nh({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return Zi(e)?r.jsx("video",{src:e.url,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onClick:o}):r.jsx("img",{src:e.url,alt:e.name,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},onClick:o})}function ih({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:s,onTransitionEnd:l}){const d=a.useRef(null);return a.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),r.jsx("div",{style:i,onTransitionEnd:l,children:r.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:s,onClick:c=>c.stopPropagation(),style:o},e)})}function Vo({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Zi(e)?r.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const s=o.currentTarget;s.videoWidth>0&&s.videoHeight>0&&(i==null||i(e.url,s.videoWidth,s.videoHeight))},onTransitionEnd:n}):r.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const s=o.currentTarget;s.naturalWidth>0&&s.naturalHeight>0&&(i==null||i(e.url,s.naturalWidth,s.naturalHeight))},onTransitionEnd:n})}function oh({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:b,sourceRect:w,resolveCloseSourceRect:f,onClose:h,onPrev:m,onNext:v}){const M=a.useRef(null),R=a.useRef(null),L=a.useRef(null),X=a.useRef(new Map),[A,B]=a.useState(0),P=a.useRef(null),C=a.useRef(0),j=a.useRef(0),x=a.useRef("none"),W=a.useRef(!1),E=a.useRef(!1),Z=a.useRef(!1),k=a.useRef(null),U=a.useRef(null),V=a.useRef(null),G=a.useRef(()=>{}),ie=a.useRef(null),$=a.useRef(null),I=a.useRef(null),D=a.useRef(!1),[se,oe]=a.useState(null),[T,ue]=a.useState(Xr),[F,ne]=a.useState(0),[J,ve]=a.useState("opening"),[Ee,me]=a.useState(0),[de,q]=a.useState(0),[Q,Y]=a.useState(!1),[_e,Ce]=a.useState(null),[ke,ce]=a.useState(null),[ge,we]=a.useState(null),[z,le]=a.useState(!1),[he,xe]=a.useState(null),[Re,Te]=a.useState(!1),_=a.useRef(!1),[pe,te]=a.useState(!1),[N,ee]=a.useState(!1),Ie=a.useRef(n),re=a.useRef(void 0),O=t[n],Ve=O?Zi(O):!1,Oe=de!==0||Q,lt=!l&&(!s||!!d),tt=c&&!l,ht=u.length>1,nt=a.useCallback((y,fe)=>t.length<=1?null:t[(y+fe+t.length)%t.length]??null,[t]),Be=ht?ro(u,p,-1):nt(n,-1),ye=ht?ro(u,p,1):nt(n,1),Pe=_e===-1&&Oe?ht&&ke!==null?ro(u,ke,-1):ge!==null?nt(ge,-1):null:null,De=_e===1&&Oe?ht&&ke!==null?ro(u,ke,1):ge!==null?nt(ge,1):null:null,qe=Pe&&Pe.url!==(Be==null?void 0:Be.url)?Pe:null,Se=De&&De.url!==(ye==null?void 0:ye.url)?De:null,Ne=Be&&tt?(()=>{const y=ht?js(u,p,-1):t.length>2?nt((n-1+t.length)%t.length,-1):null;return y&&y.url!==Be.url?y:null})():null,ze=ye&&tt?(()=>{const y=ht?js(u,p,1):t.length>2?nt((n+1)%t.length,1):null;return y&&y.url!==ye.url?y:null})():null,Xe=qe??Ne,ct=Se??ze,Je=a.useCallback((y,fe,Le)=>{if(!y||!fe||!Le)return;const Me=X.current,et=Me.get(y);(et==null?void 0:et.width)===fe&&(et==null?void 0:et.height)===Le||(Me.set(y,{width:fe,height:Le}),B(Mt=>Mt+1))},[]),$t=a.useCallback(y=>{if(!(y!=null&&y.url))return null;const fe=X.current.get(y.url);return Ug(R.current,fe)},[A,F]),dt=a.useCallback(()=>{if(!O)return;const y=$t(O);if(y){oe(y);return}const fe=R.current;fe&&oe(zs(fe))},[O,$t]),Fe=a.useCallback(y=>{if(ht){const fe=u.length;ce((p+y+fe)%fe),we(null);return}t.length>1&&(we((n+y+t.length)%t.length),ce(null))},[ht,u.length,p,t.length,n]),Ke=a.useCallback(y=>{Z.current=y,Y(y)},[]),je=a.useCallback(()=>{k.current!==null&&(window.clearTimeout(k.current),k.current=null)},[]),ut=a.useCallback(()=>{je(),k.current=window.setTimeout(()=>{je(),Ke(!1)},eo+32)},[je,Ke]),pt=a.useCallback(()=>{const y=M.current;if(!y){ue({left:0,top:0,width:typeof window<"u"?window.innerWidth:Xr.width,height:typeof window<"u"?window.innerHeight:Xr.height});return}const fe=y.getBoundingClientRect();ue({left:fe.left,top:fe.top,width:fe.width,height:fe.height})},[]),mt=a.useCallback((y,fe)=>{if(Oe){if(pe&&!Q)return`translate(${de}px, 0px)`;if(Q&&_e!==null){const Le=$t(y);if(!Le)return;const{x:Me,y:et}=Jg(Le,fe,_e,T);return`translate(${Me}px, ${et}px)`}if(Q)return"translate(0px, 0px)"}},[Oe,pe,Q,de,_e,T,$t]),kt=a.useCallback(()=>{const y=U.current;U.current=null,je(),Ke(!1),Ce(null),ce(null),we(null),q(0),te(!1),W.current=!1,j.current=0,x.current="none",y===-1?m():y===1&&v()},[je,Ke,m,v]),Xt=a.useCallback(()=>{je(),k.current=window.setTimeout(()=>{U.current!==null&&kt()},eo+32)},[je,kt]),Yt=a.useCallback(()=>{je(),U.current=null,Ke(!1),Ce(null),ce(null),we(null),q(0),te(!1),W.current=!1,j.current=0,x.current="none"},[je,Ke]),vt=a.useCallback(y=>{if(!(!tt||!se)){if(Z.current){if(U.current===y){V.current=y,kt();return}Yt()}je(),Fe(y),U.current=y,Ce(y),Ke(!0),Xt()}},[tt,se,kt,Yt,je,Fe,Ke,Xt]);G.current=vt;const bt=a.useCallback(()=>{ie.current=null,D.current=!1,$.current!==null&&(window.clearInterval($.current),$.current=null),I.current!==null&&(window.clearTimeout(I.current),I.current=null)},[]),Gt=a.useCallback(y=>{$.current!==null&&window.clearInterval($.current);const fe=D.current?jg:Dg;$.current=window.setInterval(()=>{G.current(y)},fe)},[]),Ft=a.useCallback(y=>{ie.current!==y&&(bt(),ie.current=y,D.current=!1,G.current(y),Gt(y),I.current=window.setTimeout(()=>{I.current=null,ie.current===y&&(D.current=!0,Gt(y))},Og))},[bt,Gt]),xt=a.useCallback(()=>{const y=R.current;if(!y)return;const fe=O==null?void 0:O.url,Le=fe?X.current.get(fe):void 0;if(Le!=null&&Le.width&&(Le!=null&&Le.height)){oe($a(y,Le.width,Le.height));return}const Me=L.current;if(Me&&fe&&(Me.src===fe||Me.currentSrc===fe)){const{width:Mt,height:Ye}=qg(Me);if(Mt&&Ye){Je(fe,Mt,Ye),oe($a(y,Mt,Ye));return}}const et=zs(y);!et.width||!et.height||oe(et)},[O==null?void 0:O.url,Je]),Ht=a.useCallback(y=>{if(L.current=y,!!y){if(y instanceof HTMLVideoElement){y.readyState>=1&&y.videoWidth>0&&xt();return}y.complete&&y.naturalWidth>0&&xt()}},[xt]),qt=a.useCallback(()=>{pt(),xt(),ne(y=>y+1)},[pt,xt]);a.useEffect(()=>{qt();const y=R.current,fe=M.current,Le=new ResizeObserver(()=>qt());return y&&Le.observe(y),fe&&Le.observe(fe),window.addEventListener("resize",qt),()=>{Le.disconnect(),window.removeEventListener("resize",qt)}},[qt,n,b]),a.useLayoutEffect(()=>{if(!O)return;const y=L.current;if(y){if(y instanceof HTMLImageElement&&y.complete&&y.naturalWidth>0){xt();return}y instanceof HTMLVideoElement&&y.readyState>=1&&y.videoWidth>0&&xt()}},[O==null?void 0:O.url,n,xt]),a.useEffect(()=>{dt()},[dt,A]),a.useEffect(()=>{const y=new Set,fe=[],Le=Me=>{!(Me!=null&&Me.url)||y.has(Me.url)||(y.add(Me.url),fe.push(Me))};t.forEach(Le),u.forEach(Me=>Me.items.forEach(Le)),fe.forEach(Me=>{X.current.has(Me.url)||Kg(Me,Je)})},[t,u,Je]),a.useEffect(()=>{if(J!=="opening"||!se)return;if(!w){ve("open");return}le(!1);const y=requestAnimationFrame(()=>{requestAnimationFrame(()=>{le(!0),ve("open")})});return()=>cancelAnimationFrame(y)},[J,se,w]),a.useEffect(()=>{if(J!=="closing")return;const y=setTimeout(()=>h(),$n);return()=>clearTimeout(y)},[J,h]),a.useEffect(()=>()=>{je()},[je]),a.useLayoutEffect(()=>{Ie.current===n&&re.current===(O==null?void 0:O.url)||(je(),U.current=null,Ce(null),ce(null),we(null),me(0),q(0),Ke(!1),ee(!1),te(!1),C.current=0,j.current=0,x.current="none",W.current=!1,P.current=null,E.current=!1,L.current=null,dt(),Ie.current=n,re.current=O==null?void 0:O.url)},[n,O==null?void 0:O.url,Ke,je,dt]),a.useLayoutEffect(()=>{const y=V.current;y!==null&&(V.current=null,requestAnimationFrame(()=>{G.current(y)}))},[n,p,O==null?void 0:O.url]),a.useLayoutEffect(()=>{if(J==="opening"){_.current=!1,Te(!1);return}if(J!=="open"||_.current)return;if(!Be&&!ye){_.current=!0;return}Te(!1);const y=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Te(!0),_.current=!0})});return()=>cancelAnimationFrame(y)},[J,Be==null?void 0:Be.url,ye==null?void 0:ye.url]),a.useEffect(()=>{if(J!=="open")return;const y=()=>{const Ye=ft=>{ft.stopPropagation(),ft.preventDefault(),document.removeEventListener("click",Ye,!0)};document.addEventListener("click",Ye,!0)},fe=Ye=>{const ft=Ye<0?1:-1;je(),Fe(ft),U.current=ft,Ce(ft),Ke(!0),Xt()},Le=Ye=>{if(Math.abs(Ye)>Hg&&tt){fe(Ye);return}U.current=null,Ce(null),ce(null),we(null),Ke(!0),q(0),ut()},Me=Ye=>{if(Ye.touches.length!==1||Z.current)return;const ft=Ye.touches[0];E.current=!0,P.current={x:ft.clientX,y:ft.clientY},x.current="none",j.current=0,W.current=!1},et=Ye=>{if(!P.current||Ye.touches.length!==1||Z.current)return;const ft=Ye.touches[0],Nt=ft.clientX-P.current.x,Tt=ft.clientY-P.current.y;if(x.current==="none"){if(Math.abs(Nt)<10&&Math.abs(Tt)<10)return;if(Math.abs(Nt)>Math.abs(Tt)){if(!tt)return;x.current="horizontal"}else if(Tt>0){if(!lt)return;x.current="vertical"}else return}if(x.current==="horizontal"){W.current=!0,te(!0),j.current=Nt,q(Nt),Ye.preventDefault();return}x.current==="vertical"&&(W.current=!0,te(!0),C.current=Tt,me(Tt),Ye.preventDefault())},Mt=()=>{if(!P.current)return;const Ye=x.current,ft=W.current;if(ft&&Ye==="horizontal")Le(j.current),y();else if(ft&&Ye==="vertical"){const Nt=C.current;if(lt&&Nt>Ng){const Tt=window.innerHeight;C.current=Tt,ee(!0),me(Tt),ve("closing")}else C.current=0,me(0);y()}else Ye==="horizontal"&&Math.abs(j.current)>0&&(Le(j.current),y());P.current=null,x.current="none",j.current=0,W.current=!1,te(!1)};return document.addEventListener("touchstart",Me,{passive:!0}),document.addEventListener("touchmove",et,{passive:!1}),document.addEventListener("touchend",Mt),document.addEventListener("touchcancel",Mt),()=>{document.removeEventListener("touchstart",Me),document.removeEventListener("touchmove",et),document.removeEventListener("touchend",Mt),document.removeEventListener("touchcancel",Mt)}},[J,tt,Ke,ut,je,lt,Xt,Fe]);const Zt=a.useCallback(()=>{const y=(f==null?void 0:f())??w??null;y&&se&&(xe(y),le(!0)),ve("closing")},[f,w,se]);a.useEffect(()=>{const y=Me=>{if(Me.key==="Escape"){if(s&&d||J==="closing")return;bt(),Zt();return}if(Me.key!=="ArrowLeft"&&Me.key!=="ArrowRight"||J!=="open"||!tt)return;Me.preventDefault();const et=Me.key==="ArrowLeft"?-1:1;Me.repeat&&ie.current===et||Ft(et)},fe=Me=>{if(Me.key!=="ArrowLeft"&&Me.key!=="ArrowRight")return;const et=Me.key==="ArrowLeft"?-1:1;ie.current===et&&bt()},Le=()=>{bt()};return window.addEventListener("keydown",y),window.addEventListener("keyup",fe),window.addEventListener("blur",Le),()=>{window.removeEventListener("keydown",y),window.removeEventListener("keyup",fe),window.removeEventListener("blur",Le),bt()}},[J,s,d,Zt,tt,Ft,bt]),a.useEffect(()=>{J!=="open"&&bt()},[J,bt]);const tn=()=>{J==="closing"||l||Zt()},Ct=J==="open",jt=J==="closing",cn=Ee>0?Math.max(0,1-Ee/500):1,at=Ee>0?Math.max(.35,1-Ee/500):1,$e=a.useCallback(y=>{if(!(y.propertyName!=="transform"||!Z.current)){if(U.current!==null){kt();return}je(),Ke(!1)}},[je,Ke,kt]),We=J==="closing"?he??w:w,Qe=We&&se&&(J==="opening"||jt)?zg(We,se):void 0,st=Oe&&O?mt(O,"center"):Ee>0?`translateY(${Ee}px)`:Qe,gt=se?Bo(se,T):null,Rt=!!(We&&se),ot=Rt&&(J==="closing"||J==="open"&&z),Ot={position:"absolute",top:gt==null?void 0:gt.top,left:gt==null?void 0:gt.left,width:gt==null?void 0:gt.width,height:gt==null?void 0:gt.height,objectFit:"contain",transformOrigin:"top left",transform:st,opacity:Ee>0?at:Rt?1:J==="opening"||jt?0:1,transition:pe&&!Q?"none":Q?`transform ${eo}ms ${un}`:N?`transform ${$n}ms ${un}, opacity ${$n}ms ${un}`:ot?`transform ${$n}ms ${un}`:J==="opening"||jt?`opacity ${$n}ms ${un}`:"none",pointerEvents:Ve&&Ct&&!Oe?"auto":"none",touchAction:Ve&&Ct?"none":void 0,zIndex:1,overflow:Ve?"hidden":void 0},Pt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Ct&&!Oe?"auto":"none"},Et=(y,fe,Le="adjacent")=>{const Me=$t(y);if(!Me)return{display:"none"};const et=Le==="far"?fe==="left"?"far-left":"far-right":fe==="left"?"left-adjacent":"right-adjacent",{start:Mt}=_e!==null?Cc(Me,et,_e,T):{start:Le==="far"?mr(Me,fe,T):Di(Me,fe,T)},Ye=Bo(Mt,T),ft=mt(y,et),Nt=!Oe&&Le==="adjacent"&&Ct&&!Re?Qg(Me,fe,T):null,Tt=Le==="far"&&Oe&&_e===(fe==="left"?-1:1),nn=pe&&!Q?!1:Q,dn=Le==="adjacent"&&Ct&&Re&&!Oe;return{position:"absolute",top:Ye.top,left:Ye.left,width:Ye.width,height:Ye.height,objectFit:"contain",transform:ft??(Nt?`translate(${Nt.x}px, ${Nt.y}px)`:void 0),opacity:Le==="far"?Ct&&Tt?1:0:Ct?1:0,transition:nn?Le==="far"?`transform ${eo}ms ${un}`:`transform ${eo}ms ${un}, opacity ${$n}ms ${un}`:dn?`transform ${$n}ms ${un}`:J==="opening"||jt?`opacity ${$n}ms ${un}`:"none",pointerEvents:"none",zIndex:1}},zt=(y,fe)=>{const Le=$t(y);return Le?Zg(Di(Le,fe,T),fe,T):null},Bt=y=>fe=>{if(!l){if(E.current){E.current=!1;return}fe.stopPropagation(),vt(y)}},Wt=Be?zt(Be,"left"):null,_t=ye?zt(ye,"right"):null,At=Wt?Bo(Wt,T):null,wt=_t?Bo(_t,T):null;return r.jsxs("div",{ref:M,className:[`${e}-lightbox`,s?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:J==="open"?"none":void 0},onClick:tn,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Ct?cn:0,transition:pe?"none":`opacity ${$n}ms ${un}`,pointerEvents:"none"}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[r.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},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:R,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{height:"10%"}})]}),r.jsx("div",{style:{position:"absolute",inset:0,opacity:Ct?1:0,transition:pe?"none":`opacity ${$n}ms ${un}`,pointerEvents:"none"},children:r.jsx(wc,{prefix:e,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,onClose:tn})})]}),Ct&&Xe&&r.jsx(Vo,{media:Xe,style:Et(Xe,"left","far"),onMeasure:Je,onTransitionEnd:$e},`far-prev-${Xe.url}`),Ct&&Be&&r.jsxs(r.Fragment,{children:[r.jsx(Vo,{media:Be,style:Et(Be,"left"),onMeasure:Je,onTransitionEnd:$e},`prev-${Be.url}`),At&&r.jsx("div",{style:{position:"absolute",top:At.top,left:At.left,width:At.width,height:At.height,cursor:l||pe?"default":"pointer",pointerEvents:l||pe?"none":"auto",zIndex:3},onClick:Bt(-1)})]}),Ct&&ye&&r.jsxs(r.Fragment,{children:[r.jsx(Vo,{media:ye,style:Et(ye,"right"),onMeasure:Je,onTransitionEnd:$e},`next-${ye.url}`),wt&&r.jsx("div",{style:{position:"absolute",top:wt.top,left:wt.left,width:wt.width,height:wt.height,cursor:l||pe?"default":"pointer",pointerEvents:l||pe?"none":"auto",zIndex:3},onClick:Bt(1)})]}),Ct&&ct&&r.jsx(Vo,{media:ct,style:Et(ct,"right","far"),onMeasure:Je,onTransitionEnd:$e},`far-next-${ct.url}`),se&&O&&(Ve?r.jsx(ih,{src:O.url,phase:J,onMediaElement:Ht,wrapperStyle:Ot,videoStyle:Pt,onLoadedMetadata:xt,onTransitionEnd:$e},`${n}-${O.url}`):r.jsx("img",{ref:Ht,src:O.url,alt:O.name,onLoad:xt,onTransitionEnd:$e,style:Ot},`${n}-${O.url}`))]})}function rh({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:s,portalId:l}){const{prefix:d}=S.useScopedStyles(),{gridLayout:c,verticalGap:u,align:p="top",imageDisplay:b}=e,w=(b==null?void 0:b.display)==="cover",f=(b==null?void 0:b.ratioValue)??"1:1",h=(b==null?void 0:b.reversed)??!1,[m,v]=f.split(":").map(Number),L=`${h?v:m} / ${h?m:v}`,X=c.entryWidth??.2,A=c.columnsCount,B=S.scalingValue(X,n),P=S.scalingValue(c.horizontalGap??0,n),C=B,j=B,x={width:C,...w?{aspectRatio:L,height:"auto",overflow:"hidden"}:{height:"auto"}},W=w?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},E=a.useRef(null),[Z,k]=a.useState(!1),[U,V]=a.useState([]),[G,ie]=a.useState(0),[$,I]=a.useState(0),[D,se]=a.useState(null),[oe,T]=a.useState({title1:"",title2:"",title3:""}),ue=(()=>{const ge={},we=E.current?getComputedStyle(E.current).getPropertyValue("--cntrl-article-width").trim():"";return we&&(ge["--cntrl-article-width"]=we),ge})(),F=!n||i||o,ne=a.useMemo(()=>_g(d),[d]),J=t??[],ve=J.length%A||A,Ee=ve<A&&J.length>0,me=J.length-ve,de=Ee?Math.floor((A-ve)/2)+1:1,q=a.useMemo(()=>Vg(J),[J]),Q=a.useMemo(()=>Xg(J),[J]),Y=(ge,we,z)=>{if(n&&!o&&!i)return;const le=q.findIndex(xe=>xe.gridIndex===ge);if(le<0)return;const he=q[le];I(le),V(he.items),ie(we),T(he.entry),se(z??null),k(!0)},_e=a.useCallback(()=>{k(!1),se(null)},[]),Ce=a.useCallback(()=>{const ge=q[$];return!ge||!E.current?D:Bg(E.current,ge.gridIndex,w?"cover":"contain")??D},[q,$,D,w]),ke=a.useCallback(ge=>{if(q.length>1){const we=q.length,z=($+ge+we)%we,le=q[z],he=Math.min(G,le.items.length-1);I(z),V(le.items),ie(he),T(le.entry);return}ie(we=>(we+ge+U.length)%U.length)},[q,$,G,U.length]),ce=q.length>1||U.length>1;return a.useEffect(()=>{if(!Z||typeof document>"u")return;const ge=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ge}},[Z]),a.useEffect(()=>{!n||o||i||k(!1)},[n,o,i]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:ne}}),r.jsx(Yg,{mediaList:Q}),r.jsx("div",{ref:E,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${A}, ${B})`,rowGap:0,columnGap:P,width:S.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:S.scalingValue(u??0,n)},children:J.map((ge,we)=>{const z=es(ge.gallery),le=ts(z),he=le.filter(te=>te.lightboxMedia).map(te=>te.lightboxMedia),xe=Math.floor(we/A)===Math.ceil(J.length/A)-1,Re=Ee&&we>=me?`${de+(we-me)}`:void 0,Te=le[0],_=Te!=null&&Te.lightboxMedia?he.findIndex(te=>te.url===Te.lightboxMedia.url):-1,pe=r.jsx("div",{className:`${d}-item-image-wrapper`,style:x,children:le.length>0&&r.jsx(nh,{media:Te.displayMedia,gridIndex:we,className:`${d}-item-${Zi(Te.displayMedia)?"video":"image"}`.trim(),style:W,onMediaClick:F&&_>=0?te=>Y(we,_,Sc(te.currentTarget,w?"cover":"contain")):void 0})});return r.jsx("div",{className:`${d}-item`,children:r.jsxs("div",{className:[o?`${d}-item-inner`:`${d}-item-inner-hidden`,xe?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:B,...Re?{gridColumn:Re}:{}},children:[r.jsx("div",{className:`${d}-item-title-row`,children:r.jsx("div",{style:{height:0,width:j}})}),r.jsx("a",{className:`${d}-item-image-link`,children:pe}),r.jsx("div",{className:`${d}-item-subtitle-row`,children:r.jsx("div",{style:{height:0,width:j}})})]})},we)})}),Z&&typeof document<"u"&&(()=>{const ge=(l?document.getElementById(l):null)??document.body;return Yn.createPortal(r.jsx("div",{style:ue,"data-selection":"none",children:r.jsx(oh,{prefix:d,items:U,index:G,entry:oe,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:ce,lightboxEntries:q,entryIdx:$,layoutId:s,sourceRect:D,resolveCloseSourceRect:Ce,onClose:_e,onPrev:()=>ke(-1),onNext:()=>ke(1)})}),ge)})()]})}const ah=`import { CommonComponentProps } from '../props';
6535
+ `}const Ds={url:"",name:"",objectFit:"cover"},$n=500,eo=650,un="cubic-bezier(0.22, 1, 0.36, 1)",Ng=72,Hg=50,Og=1e4,Dg=650,jg=500;function zg(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,s=e.top-t.top;return`translate(${o}px, ${s}px) scale(${n}, ${i})`}function Sc(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=pr(e);return{left:i.x,top:i.y,width:i.width,height:i.height}}const n=e.getBoundingClientRect();return{left:n.left,top:n.top,width:n.width,height:n.height}}function Bg(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?Sc(i,n):null}function Vg(e){return e.reduce((t,n,i)=>{const o=es(n.gallery),l=ts(o).filter(d=>d.lightboxMedia).map(d=>d.lightboxMedia);return l.length===0||t.push({gridIndex:i,items:l,entry:{title1:n.title1??"",title2:n.title2??"",title3:n.title3??""}}),t},[])}function ro(e,t,n){var o;if(e.length<=1)return null;const i=(t+n+e.length)%e.length;return((o=e[i])==null?void 0:o.items[0])??null}function js(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return ro(e,i,n)}const Gg=.03;function $c(e){return e.width*Gg}const Xr={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Bo(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function zs(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function qg(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function $a(e,t,n){const i=e.getBoundingClientRect(),o=i.width,s=i.height,l=t/n,d=o/s;if(l>d){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(s-u)/2}}const c=s*l;return{width:c,height:s,left:i.left+(o-c)/2,top:i.top}}function Ug(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:$a(e,t.width,t.height)}function Kg(e,t){if(Zi(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.url,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.url,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.url,n.naturalWidth,n.naturalHeight)},n.src=e.url}function Xg(e){const t=new Set,n=[];for(const i of e){const o=es(i.gallery),s=ts(o);for(const l of s)for(const d of[l.displayMedia,l.lightboxMedia])d!=null&&d.url&&!t.has(d.url)&&(t.add(d.url),n.push(d))}return n}function Yg({mediaList:e}){return e.length===0?null:r.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Zi(t)?r.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):r.jsx("img",{src:t.url,alt:""},t.url))})}function Di(e,t,n){const{width:i,height:o,top:s}=e,{left:l,width:d}=n,c=$c(n);return t==="left"?{left:l+c-i,top:s,width:i,height:o}:{left:l+d-c,top:s,width:i,height:o}}function mr(e,t,n){const i=Di(e,t,n);return{...i,left:2*i.left-e.left}}function Zg(e,t,n){const{left:i,width:o}=n,s=$c(n);return t==="left"?{left:i,top:e.top,width:s,height:e.height}:{left:i+o-s,top:e.top,width:s,height:e.height}}function Cc(e,t,n,i){const o=Di(e,"left",i),s=Di(e,"right",i),l=mr(e,"left",i),d=mr(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:s,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:d,end:s};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:s};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:s,end:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function Jg(e,t,n,i){const{start:o,end:s}=Cc(e,t,n,i);return{x:s.left-o.left,y:s.top-o.top}}function Qg(e,t,n){const i=Di(e,t,n),o=mr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Tc(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 es(e){if(!e)return;if(Tc(e))return e;if(!Array.isArray(e))return;const[t,n]=e,i=t!=null&&t.url?t:void 0,o=n!=null&&n.url?n:void 0;if(!(!i&&!o))return[{media:[o??i??Ds,i??o??Ds]}]}function eh(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function th(e){const[t]=e.media;return t!=null&&t.url?t:null}function ts(e){if(!Array.isArray(e)||e.length===0)return[];if(Tc(e)){const t=[];for(const n of e){const i=eh(n);if(!i)continue;const o=th(n);t.push({displayMedia:i,lightboxMedia:o!=null&&o.url?o:null})}return t}return e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function Zi(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function nh({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return Zi(e)?r.jsx("video",{src:e.url,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onClick:o}):r.jsx("img",{src:e.url,alt:e.name,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},onClick:o})}function ih({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:s,onTransitionEnd:l}){const d=a.useRef(null);return a.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),r.jsx("div",{style:i,onTransitionEnd:l,children:r.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:s,onClick:c=>c.stopPropagation(),style:o},e)})}function Vo({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Zi(e)?r.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const s=o.currentTarget;s.videoWidth>0&&s.videoHeight>0&&(i==null||i(e.url,s.videoWidth,s.videoHeight))},onTransitionEnd:n}):r.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const s=o.currentTarget;s.naturalWidth>0&&s.naturalHeight>0&&(i==null||i(e.url,s.naturalWidth,s.naturalHeight))},onTransitionEnd:n})}function oh({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:b,sourceRect:w,resolveCloseSourceRect:f,onClose:h,onPrev:m,onNext:v}){const M=a.useRef(null),R=a.useRef(null),L=a.useRef(null),X=a.useRef(new Map),[F,B]=a.useState(0),k=a.useRef(null),C=a.useRef(0),j=a.useRef(0),x=a.useRef("none"),W=a.useRef(!1),E=a.useRef(!1),Z=a.useRef(!1),P=a.useRef(null),U=a.useRef(null),V=a.useRef(null),G=a.useRef(()=>{}),ie=a.useRef(null),$=a.useRef(null),I=a.useRef(null),D=a.useRef(!1),[se,oe]=a.useState(null),[T,ue]=a.useState(Xr),[A,ne]=a.useState(0),[J,ve]=a.useState("opening"),[Ee,me]=a.useState(0),[de,q]=a.useState(0),[Q,Y]=a.useState(!1),[_e,Ce]=a.useState(null),[ke,ce]=a.useState(null),[ge,we]=a.useState(null),[z,le]=a.useState(!1),[he,xe]=a.useState(null),[Re,Te]=a.useState(!1),_=a.useRef(!1),[pe,te]=a.useState(!1),[N,ee]=a.useState(!1),Ie=a.useRef(n),re=a.useRef(void 0),O=t[n],Ve=O?Zi(O):!1,Oe=de!==0||Q,lt=!l&&(!s||!!d),tt=c&&!l,ht=u.length>1,nt=a.useCallback((y,fe)=>t.length<=1?null:t[(y+fe+t.length)%t.length]??null,[t]),Be=ht?ro(u,p,-1):nt(n,-1),ye=ht?ro(u,p,1):nt(n,1),Pe=_e===-1&&Oe?ht&&ke!==null?ro(u,ke,-1):ge!==null?nt(ge,-1):null:null,De=_e===1&&Oe?ht&&ke!==null?ro(u,ke,1):ge!==null?nt(ge,1):null:null,qe=Pe&&Pe.url!==(Be==null?void 0:Be.url)?Pe:null,Se=De&&De.url!==(ye==null?void 0:ye.url)?De:null,Ne=Be&&tt?(()=>{const y=ht?js(u,p,-1):t.length>2?nt((n-1+t.length)%t.length,-1):null;return y&&y.url!==Be.url?y:null})():null,ze=ye&&tt?(()=>{const y=ht?js(u,p,1):t.length>2?nt((n+1)%t.length,1):null;return y&&y.url!==ye.url?y:null})():null,Xe=qe??Ne,ct=Se??ze,Je=a.useCallback((y,fe,Le)=>{if(!y||!fe||!Le)return;const Me=X.current,et=Me.get(y);(et==null?void 0:et.width)===fe&&(et==null?void 0:et.height)===Le||(Me.set(y,{width:fe,height:Le}),B(Mt=>Mt+1))},[]),$t=a.useCallback(y=>{if(!(y!=null&&y.url))return null;const fe=X.current.get(y.url);return Ug(R.current,fe)},[F,A]),dt=a.useCallback(()=>{if(!O)return;const y=$t(O);if(y){oe(y);return}const fe=R.current;fe&&oe(zs(fe))},[O,$t]),Fe=a.useCallback(y=>{if(ht){const fe=u.length;ce((p+y+fe)%fe),we(null);return}t.length>1&&(we((n+y+t.length)%t.length),ce(null))},[ht,u.length,p,t.length,n]),Ke=a.useCallback(y=>{Z.current=y,Y(y)},[]),je=a.useCallback(()=>{P.current!==null&&(window.clearTimeout(P.current),P.current=null)},[]),ut=a.useCallback(()=>{je(),P.current=window.setTimeout(()=>{je(),Ke(!1)},eo+32)},[je,Ke]),pt=a.useCallback(()=>{const y=M.current;if(!y){ue({left:0,top:0,width:typeof window<"u"?window.innerWidth:Xr.width,height:typeof window<"u"?window.innerHeight:Xr.height});return}const fe=y.getBoundingClientRect();ue({left:fe.left,top:fe.top,width:fe.width,height:fe.height})},[]),mt=a.useCallback((y,fe)=>{if(Oe){if(pe&&!Q)return`translate(${de}px, 0px)`;if(Q&&_e!==null){const Le=$t(y);if(!Le)return;const{x:Me,y:et}=Jg(Le,fe,_e,T);return`translate(${Me}px, ${et}px)`}if(Q)return"translate(0px, 0px)"}},[Oe,pe,Q,de,_e,T,$t]),kt=a.useCallback(()=>{const y=U.current;U.current=null,je(),Ke(!1),Ce(null),ce(null),we(null),q(0),te(!1),W.current=!1,j.current=0,x.current="none",y===-1?m():y===1&&v()},[je,Ke,m,v]),Xt=a.useCallback(()=>{je(),P.current=window.setTimeout(()=>{U.current!==null&&kt()},eo+32)},[je,kt]),Yt=a.useCallback(()=>{je(),U.current=null,Ke(!1),Ce(null),ce(null),we(null),q(0),te(!1),W.current=!1,j.current=0,x.current="none"},[je,Ke]),vt=a.useCallback(y=>{if(!(!tt||!se)){if(Z.current){if(U.current===y){V.current=y,kt();return}Yt()}je(),Fe(y),U.current=y,Ce(y),Ke(!0),Xt()}},[tt,se,kt,Yt,je,Fe,Ke,Xt]);G.current=vt;const bt=a.useCallback(()=>{ie.current=null,D.current=!1,$.current!==null&&(window.clearInterval($.current),$.current=null),I.current!==null&&(window.clearTimeout(I.current),I.current=null)},[]),Gt=a.useCallback(y=>{$.current!==null&&window.clearInterval($.current);const fe=D.current?jg:Dg;$.current=window.setInterval(()=>{G.current(y)},fe)},[]),Ft=a.useCallback(y=>{ie.current!==y&&(bt(),ie.current=y,D.current=!1,G.current(y),Gt(y),I.current=window.setTimeout(()=>{I.current=null,ie.current===y&&(D.current=!0,Gt(y))},Og))},[bt,Gt]),xt=a.useCallback(()=>{const y=R.current;if(!y)return;const fe=O==null?void 0:O.url,Le=fe?X.current.get(fe):void 0;if(Le!=null&&Le.width&&(Le!=null&&Le.height)){oe($a(y,Le.width,Le.height));return}const Me=L.current;if(Me&&fe&&(Me.src===fe||Me.currentSrc===fe)){const{width:Mt,height:Ye}=qg(Me);if(Mt&&Ye){Je(fe,Mt,Ye),oe($a(y,Mt,Ye));return}}const et=zs(y);!et.width||!et.height||oe(et)},[O==null?void 0:O.url,Je]),Ht=a.useCallback(y=>{if(L.current=y,!!y){if(y instanceof HTMLVideoElement){y.readyState>=1&&y.videoWidth>0&&xt();return}y.complete&&y.naturalWidth>0&&xt()}},[xt]),qt=a.useCallback(()=>{pt(),xt(),ne(y=>y+1)},[pt,xt]);a.useEffect(()=>{qt();const y=R.current,fe=M.current,Le=new ResizeObserver(()=>qt());return y&&Le.observe(y),fe&&Le.observe(fe),window.addEventListener("resize",qt),()=>{Le.disconnect(),window.removeEventListener("resize",qt)}},[qt,n,b]),a.useLayoutEffect(()=>{if(!O)return;const y=L.current;if(y){if(y instanceof HTMLImageElement&&y.complete&&y.naturalWidth>0){xt();return}y instanceof HTMLVideoElement&&y.readyState>=1&&y.videoWidth>0&&xt()}},[O==null?void 0:O.url,n,xt]),a.useEffect(()=>{dt()},[dt,F]),a.useEffect(()=>{const y=new Set,fe=[],Le=Me=>{!(Me!=null&&Me.url)||y.has(Me.url)||(y.add(Me.url),fe.push(Me))};t.forEach(Le),u.forEach(Me=>Me.items.forEach(Le)),fe.forEach(Me=>{X.current.has(Me.url)||Kg(Me,Je)})},[t,u,Je]),a.useEffect(()=>{if(J!=="opening"||!se)return;if(!w){ve("open");return}le(!1);const y=requestAnimationFrame(()=>{requestAnimationFrame(()=>{le(!0),ve("open")})});return()=>cancelAnimationFrame(y)},[J,se,w]),a.useEffect(()=>{if(J!=="closing")return;const y=setTimeout(()=>h(),$n);return()=>clearTimeout(y)},[J,h]),a.useEffect(()=>()=>{je()},[je]),a.useLayoutEffect(()=>{Ie.current===n&&re.current===(O==null?void 0:O.url)||(je(),U.current=null,Ce(null),ce(null),we(null),me(0),q(0),Ke(!1),ee(!1),te(!1),C.current=0,j.current=0,x.current="none",W.current=!1,k.current=null,E.current=!1,L.current=null,dt(),Ie.current=n,re.current=O==null?void 0:O.url)},[n,O==null?void 0:O.url,Ke,je,dt]),a.useLayoutEffect(()=>{const y=V.current;y!==null&&(V.current=null,requestAnimationFrame(()=>{G.current(y)}))},[n,p,O==null?void 0:O.url]),a.useLayoutEffect(()=>{if(J==="opening"){_.current=!1,Te(!1);return}if(J!=="open"||_.current)return;if(!Be&&!ye){_.current=!0;return}Te(!1);const y=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Te(!0),_.current=!0})});return()=>cancelAnimationFrame(y)},[J,Be==null?void 0:Be.url,ye==null?void 0:ye.url]),a.useEffect(()=>{if(J!=="open")return;const y=()=>{const Ye=ft=>{ft.stopPropagation(),ft.preventDefault(),document.removeEventListener("click",Ye,!0)};document.addEventListener("click",Ye,!0)},fe=Ye=>{const ft=Ye<0?1:-1;je(),Fe(ft),U.current=ft,Ce(ft),Ke(!0),Xt()},Le=Ye=>{if(Math.abs(Ye)>Hg&&tt){fe(Ye);return}U.current=null,Ce(null),ce(null),we(null),Ke(!0),q(0),ut()},Me=Ye=>{if(Ye.touches.length!==1||Z.current)return;const ft=Ye.touches[0];E.current=!0,k.current={x:ft.clientX,y:ft.clientY},x.current="none",j.current=0,W.current=!1},et=Ye=>{if(!k.current||Ye.touches.length!==1||Z.current)return;const ft=Ye.touches[0],Nt=ft.clientX-k.current.x,Tt=ft.clientY-k.current.y;if(x.current==="none"){if(Math.abs(Nt)<10&&Math.abs(Tt)<10)return;if(Math.abs(Nt)>Math.abs(Tt)){if(!tt)return;x.current="horizontal"}else if(Tt>0){if(!lt)return;x.current="vertical"}else return}if(x.current==="horizontal"){W.current=!0,te(!0),j.current=Nt,q(Nt),Ye.preventDefault();return}x.current==="vertical"&&(W.current=!0,te(!0),C.current=Tt,me(Tt),Ye.preventDefault())},Mt=()=>{if(!k.current)return;const Ye=x.current,ft=W.current;if(ft&&Ye==="horizontal")Le(j.current),y();else if(ft&&Ye==="vertical"){const Nt=C.current;if(lt&&Nt>Ng){const Tt=window.innerHeight;C.current=Tt,ee(!0),me(Tt),ve("closing")}else C.current=0,me(0);y()}else Ye==="horizontal"&&Math.abs(j.current)>0&&(Le(j.current),y());k.current=null,x.current="none",j.current=0,W.current=!1,te(!1)};return document.addEventListener("touchstart",Me,{passive:!0}),document.addEventListener("touchmove",et,{passive:!1}),document.addEventListener("touchend",Mt),document.addEventListener("touchcancel",Mt),()=>{document.removeEventListener("touchstart",Me),document.removeEventListener("touchmove",et),document.removeEventListener("touchend",Mt),document.removeEventListener("touchcancel",Mt)}},[J,tt,Ke,ut,je,lt,Xt,Fe]);const Zt=a.useCallback(()=>{const y=(f==null?void 0:f())??w??null;y&&se&&(xe(y),le(!0)),ve("closing")},[f,w,se]);a.useEffect(()=>{const y=Me=>{if(Me.key==="Escape"){if(s&&d||J==="closing")return;bt(),Zt();return}if(Me.key!=="ArrowLeft"&&Me.key!=="ArrowRight"||J!=="open"||!tt)return;Me.preventDefault();const et=Me.key==="ArrowLeft"?-1:1;Me.repeat&&ie.current===et||Ft(et)},fe=Me=>{if(Me.key!=="ArrowLeft"&&Me.key!=="ArrowRight")return;const et=Me.key==="ArrowLeft"?-1:1;ie.current===et&&bt()},Le=()=>{bt()};return window.addEventListener("keydown",y),window.addEventListener("keyup",fe),window.addEventListener("blur",Le),()=>{window.removeEventListener("keydown",y),window.removeEventListener("keyup",fe),window.removeEventListener("blur",Le),bt()}},[J,s,d,Zt,tt,Ft,bt]),a.useEffect(()=>{J!=="open"&&bt()},[J,bt]);const tn=()=>{J==="closing"||l||Zt()},Ct=J==="open",jt=J==="closing",cn=Ee>0?Math.max(0,1-Ee/500):1,at=Ee>0?Math.max(.35,1-Ee/500):1,$e=a.useCallback(y=>{if(!(y.propertyName!=="transform"||!Z.current)){if(U.current!==null){kt();return}je(),Ke(!1)}},[je,Ke,kt]),We=J==="closing"?he??w:w,Qe=We&&se&&(J==="opening"||jt)?zg(We,se):void 0,st=Oe&&O?mt(O,"center"):Ee>0?`translateY(${Ee}px)`:Qe,gt=se?Bo(se,T):null,Rt=!!(We&&se),ot=Rt&&(J==="closing"||J==="open"&&z),Ot={position:"absolute",top:gt==null?void 0:gt.top,left:gt==null?void 0:gt.left,width:gt==null?void 0:gt.width,height:gt==null?void 0:gt.height,objectFit:"contain",transformOrigin:"top left",transform:st,opacity:Ee>0?at:Rt?1:J==="opening"||jt?0:1,transition:pe&&!Q?"none":Q?`transform ${eo}ms ${un}`:N?`transform ${$n}ms ${un}, opacity ${$n}ms ${un}`:ot?`transform ${$n}ms ${un}`:J==="opening"||jt?`opacity ${$n}ms ${un}`:"none",pointerEvents:Ve&&Ct&&!Oe?"auto":"none",touchAction:Ve&&Ct?"none":void 0,zIndex:1,overflow:Ve?"hidden":void 0},Pt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Ct&&!Oe?"auto":"none"},Et=(y,fe,Le="adjacent")=>{const Me=$t(y);if(!Me)return{display:"none"};const et=Le==="far"?fe==="left"?"far-left":"far-right":fe==="left"?"left-adjacent":"right-adjacent",{start:Mt}=_e!==null?Cc(Me,et,_e,T):{start:Le==="far"?mr(Me,fe,T):Di(Me,fe,T)},Ye=Bo(Mt,T),ft=mt(y,et),Nt=!Oe&&Le==="adjacent"&&Ct&&!Re?Qg(Me,fe,T):null,Tt=Le==="far"&&Oe&&_e===(fe==="left"?-1:1),nn=pe&&!Q?!1:Q,dn=Le==="adjacent"&&Ct&&Re&&!Oe;return{position:"absolute",top:Ye.top,left:Ye.left,width:Ye.width,height:Ye.height,objectFit:"contain",transform:ft??(Nt?`translate(${Nt.x}px, ${Nt.y}px)`:void 0),opacity:Le==="far"?Ct&&Tt?1:0:Ct?1:0,transition:nn?Le==="far"?`transform ${eo}ms ${un}`:`transform ${eo}ms ${un}, opacity ${$n}ms ${un}`:dn?`transform ${$n}ms ${un}`:J==="opening"||jt?`opacity ${$n}ms ${un}`:"none",pointerEvents:"none",zIndex:1}},zt=(y,fe)=>{const Le=$t(y);return Le?Zg(Di(Le,fe,T),fe,T):null},Bt=y=>fe=>{if(!l){if(E.current){E.current=!1;return}fe.stopPropagation(),vt(y)}},Wt=Be?zt(Be,"left"):null,_t=ye?zt(ye,"right"):null,At=Wt?Bo(Wt,T):null,wt=_t?Bo(_t,T):null;return r.jsxs("div",{ref:M,className:[`${e}-lightbox`,s?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:J==="open"?"none":void 0},onClick:tn,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Ct?cn:0,transition:pe?"none":`opacity ${$n}ms ${un}`,pointerEvents:"none"}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[r.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},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:R,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{height:"10%"}})]}),r.jsx("div",{style:{position:"absolute",inset:0,opacity:Ct?1:0,transition:pe?"none":`opacity ${$n}ms ${un}`,pointerEvents:"none"},children:r.jsx(wc,{prefix:e,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,onClose:tn})})]}),Ct&&Xe&&r.jsx(Vo,{media:Xe,style:Et(Xe,"left","far"),onMeasure:Je,onTransitionEnd:$e},`far-prev-${Xe.url}`),Ct&&Be&&r.jsxs(r.Fragment,{children:[r.jsx(Vo,{media:Be,style:Et(Be,"left"),onMeasure:Je,onTransitionEnd:$e},`prev-${Be.url}`),At&&r.jsx("div",{style:{position:"absolute",top:At.top,left:At.left,width:At.width,height:At.height,cursor:l||pe?"default":"pointer",pointerEvents:l||pe?"none":"auto",zIndex:3},onClick:Bt(-1)})]}),Ct&&ye&&r.jsxs(r.Fragment,{children:[r.jsx(Vo,{media:ye,style:Et(ye,"right"),onMeasure:Je,onTransitionEnd:$e},`next-${ye.url}`),wt&&r.jsx("div",{style:{position:"absolute",top:wt.top,left:wt.left,width:wt.width,height:wt.height,cursor:l||pe?"default":"pointer",pointerEvents:l||pe?"none":"auto",zIndex:3},onClick:Bt(1)})]}),Ct&&ct&&r.jsx(Vo,{media:ct,style:Et(ct,"right","far"),onMeasure:Je,onTransitionEnd:$e},`far-next-${ct.url}`),se&&O&&(Ve?r.jsx(ih,{src:O.url,phase:J,onMediaElement:Ht,wrapperStyle:Ot,videoStyle:Pt,onLoadedMetadata:xt,onTransitionEnd:$e},`${n}-${O.url}`):r.jsx("img",{ref:Ht,src:O.url,alt:O.name,onLoad:xt,onTransitionEnd:$e,style:Ot},`${n}-${O.url}`))]})}function rh({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:s,portalId:l}){const{prefix:d}=S.useScopedStyles(),{gridLayout:c,verticalGap:u,align:p="top",imageDisplay:b}=e,w=(b==null?void 0:b.display)==="cover",f=(b==null?void 0:b.ratioValue)??"1:1",h=(b==null?void 0:b.reversed)??!1,[m,v]=f.split(":").map(Number),L=`${h?v:m} / ${h?m:v}`,X=c.entryWidth??.2,F=c.columnsCount,B=S.scalingValue(X,n),k=S.scalingValue(c.horizontalGap??0,n),C=B,j=B,x={width:C,...w?{aspectRatio:L,height:"auto",overflow:"hidden"}:{height:"auto"}},W=w?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},E=a.useRef(null),[Z,P]=a.useState(!1),[U,V]=a.useState([]),[G,ie]=a.useState(0),[$,I]=a.useState(0),[D,se]=a.useState(null),[oe,T]=a.useState({title1:"",title2:"",title3:""}),ue=(()=>{const ge={},we=E.current?getComputedStyle(E.current).getPropertyValue("--cntrl-article-width").trim():"";return we&&(ge["--cntrl-article-width"]=we),ge})(),A=!n||i||o,ne=a.useMemo(()=>_g(d),[d]),J=t??[],ve=J.length%F||F,Ee=ve<F&&J.length>0,me=J.length-ve,de=Ee?Math.floor((F-ve)/2)+1:1,q=a.useMemo(()=>Vg(J),[J]),Q=a.useMemo(()=>Xg(J),[J]),Y=(ge,we,z)=>{if(n&&!o&&!i)return;const le=q.findIndex(xe=>xe.gridIndex===ge);if(le<0)return;const he=q[le];I(le),V(he.items),ie(we),T(he.entry),se(z??null),P(!0)},_e=a.useCallback(()=>{P(!1),se(null)},[]),Ce=a.useCallback(()=>{const ge=q[$];return!ge||!E.current?D:Bg(E.current,ge.gridIndex,w?"cover":"contain")??D},[q,$,D,w]),ke=a.useCallback(ge=>{if(q.length>1){const we=q.length,z=($+ge+we)%we,le=q[z],he=Math.min(G,le.items.length-1);I(z),V(le.items),ie(he),T(le.entry);return}ie(we=>(we+ge+U.length)%U.length)},[q,$,G,U.length]),ce=q.length>1||U.length>1;return a.useEffect(()=>{if(!Z||typeof document>"u")return;const ge=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ge}},[Z]),a.useEffect(()=>{!n||o||i||P(!1)},[n,o,i]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:ne}}),r.jsx(Yg,{mediaList:Q}),r.jsx("div",{ref:E,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${F}, ${B})`,rowGap:0,columnGap:k,width:S.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:S.scalingValue(u??0,n)},children:J.map((ge,we)=>{const z=es(ge.gallery),le=ts(z),he=le.filter(te=>te.lightboxMedia).map(te=>te.lightboxMedia),xe=Math.floor(we/F)===Math.ceil(J.length/F)-1,Re=Ee&&we>=me?`${de+(we-me)}`:void 0,Te=le[0],_=Te!=null&&Te.lightboxMedia?he.findIndex(te=>te.url===Te.lightboxMedia.url):-1,pe=r.jsx("div",{className:`${d}-item-image-wrapper`,style:x,children:le.length>0&&r.jsx(nh,{media:Te.displayMedia,gridIndex:we,className:`${d}-item-${Zi(Te.displayMedia)?"video":"image"}`.trim(),style:W,onMediaClick:A&&_>=0?te=>Y(we,_,Sc(te.currentTarget,w?"cover":"contain")):void 0})});return r.jsx("div",{className:`${d}-item`,children:r.jsxs("div",{className:[o?`${d}-item-inner`:`${d}-item-inner-hidden`,xe?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:B,...Re?{gridColumn:Re}:{}},children:[r.jsx("div",{className:`${d}-item-title-row`,children:r.jsx("div",{style:{height:0,width:j}})}),r.jsx("a",{className:`${d}-item-image-link`,children:pe}),r.jsx("div",{className:`${d}-item-subtitle-row`,children:r.jsx("div",{style:{height:0,width:j}})})]})},we)})}),Z&&typeof document<"u"&&(()=>{const ge=(l?document.getElementById(l):null)??document.body;return Yn.createPortal(r.jsx("div",{style:ue,"data-selection":"none",children:r.jsx(oh,{prefix:d,items:U,index:G,entry:oe,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:ce,lightboxEntries:q,entryIdx:$,layoutId:s,sourceRect:D,resolveCloseSourceRect:Ce,onClose:_e,onPrev:()=>ke(-1),onNext:()=>ke(1)})}),ge)})()]})}const ah=`import { CommonComponentProps } from '../props';
6536
6536
  import { scalingValue, useScopedStyles } from '../utils/index';
6537
6537
  import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
6538
6538
  import { createPortal } from 'react-dom';
@@ -9251,7 +9251,7 @@ a.${e}-list-item {
9251
9251
  overflow-wrap: anywhere;
9252
9252
  word-break: break-word;
9253
9253
  }
9254
- `}const Xn=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],ns=["AColumn","BColumn","CColumn","DColumn","EColumn"],An="cutLabel",wo=[...ns,An],Pr=["A","B","C","D","E"];function Lc(e){return`${e}ColumnVerticalAlign`}const Ca=["Top","Center","Bottom"];function is(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return Pr.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function Ch(e){const t=is(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function Th(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return Pr.includes(n)?n:null}function Rc(e,t,n){const i=Th(e);return i?i===t?!1:Ch(n[Lc(i)]):!0}function So(e){const t=is(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return Pr.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function Lh(e,t,n){if(Ic(e,t,n))return So(e);const i=So(e);return i.kind==="baseline"?{kind:"top"}:i}function Rh(e){const t=So(e);return t.kind==="baseline"?{kind:"top"}:t}function Ic(e,t,n){return Rc(e,n,t)?So(e).kind==="baseline":!1}function Ih(e){const t={};let n=!1;for(const i of Pr){const o=Lc(i),s=e[o];if(e.type==="b"){const l=String(s??"Top").trim();l!=="Top"&&l!=="Center"&&l!=="Bottom"&&(t[o]="Top",n=!0);continue}Rc(s,i,e)||(t[o]="Top",n=!0)}return n?t:null}function Mh(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function Eh(e){const t=So(e).kind;return t==="baseline"?"center":t}function Ph(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Ks(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function kh(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 Qr(e,t,n,i){const o=e.titleEl;if(!o)return 0;const s=o.closest(`.${n}`);if(!s)return 0;const l=kh(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+l;const d=s.getBoundingClientRect(),c=o.getBoundingClientRect().height;let u=0;return e.kind==="center"?u=(d.height-c)/2:e.kind==="bottom"&&(u=d.height-c),d.top-t+u+l}function Ah(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 Fh(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const Wh={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function It(e,t){return`${e}${t.replace(/^text/,"Text")}`}const _h={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function Nh(e){return[It(e,"textFontFamily"),It(e,"textFontSettings"),{type:"row",items:[It(e,"textFontSize"),It(e,"textLineHeight"),It(e,"textLetterSpacing"),It(e,"textWordSpacing")]},It(e,"textTextAlign"),It(e,"textTextAppearance"),`${e}VerticalAlign`]}function Hh(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(wo.map(e=>[_h[e],Nh(e)]))}}function gr(e,t){const n=i=>{const o=It(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===An?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Xs(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 on(Ut(n,t))}function Ys(e,t,n,i){const o=gr(e,t),s=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<s?`${n} ${i}`:n}function Zs(e,t,n,i){const o=gr(e,t),s=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=s?{}:{[`--${n}-title-leading-gap`]:S.scalingValue((s-l)/2,i)}}const fn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],zi=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],Bi=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Vi=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Oh={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Dh=["hover","focus","filled","success","error"],Js=.004,Ii=.004,ea=Ii,os=50,$o=1440,Co=os/$o;function Mc(e){const t=typeof e=="number"&&e>0?e:$o;return os/t}function jh(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 $o}const Ec={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function uo(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function zh(e,t=1){const n=t/e;return Object.fromEntries(fn.map(i=>[i,n]))}function Bh(){return Object.fromEntries([...zi.map(e=>[e,0]),...Bi.map(e=>[e,0])])}function Vh(){return Object.fromEntries(Vi.map(e=>[e,0]))}function Go(e){return Object.fromEntries(fn.map(t=>[t,typeof e[t]=="number"?e[t]:Ec[t]]))}function Pc(e,t,n){const i=e-Co,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 rr(e,t,n){const i=rs(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((s,l)=>s+l,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function Gh(e,t,n){const i={};for(let o=0;o<e;o+=1){const s=zi[o],l=Bi[o],d=typeof n[s]=="number"?n[s]:0,c=typeof n[l]=="number"?n[l]:0,u=Pc(t[o]??0,d,c);u.paddingLeft!==d&&(i[s]=u.paddingLeft),u.paddingRight!==c&&(i[l]=u.paddingRight)}return i}function rs(e,t,n){if(e<=0)return[];const i=fn.slice(0,e).map(u=>n[u]);if(e===1)return i;const o=i.slice(0,e-1),l=o.reduce((u,p)=>u+p,0)+Co;if(t>=l)return i;const d=[...o];let c=l-t;for(let u=d.length-1;u>=0&&c>0;u-=1){const p=d[u]-Co;if(p<=0)continue;const b=Math.min(c,p);d[u]-=b,c-=b}return[...d,i[e-1]]}function qh(e,t,n){if(e<=1)return{};const i=rs(e,t,n),o={};for(let s=0;s<e-1;s+=1){const l=fn[s];i[s]!==n[l]&&(o[l]=i[s])}return o}function Qs(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Xn]}function Uh(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function Kh(e,t,n,i){const o=Math.min(i,e.length,fn.length),s={};for(let l=0;l<o;l+=1){const d=e[l],c=t.indexOf(d);if(c===-1)continue;const u=fn[c],p=zi[c],b=Bi[c],w=Vi[c],f=fn[l],h=zi[l],m=Bi[l],v=Vi[l],M=n[u],R=n[p],L=n[b],X=n[w];typeof M=="number"&&(s[f]=M),typeof R=="number"&&(s[h]=R),typeof L=="number"&&(s[m]=L),typeof X=="number"&&(s[v]=X)}return s}function kc(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 Xh(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=uo(e),s=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...zh(n,o),...Bh()};if(s)for(const d of Vi)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,Vh());return kc(e,l)?l:e}function Yh(e,t,n){const i=Ih(e);i&&(e={...e,...i});const o=Mc(n==null?void 0:n.designWidth),s=e.columns,l=t.columns,d=uo(e),c=uo(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof s=="number"?s:typeof l=="number"?l:Xn.length,b=L=>{if(u)return L;const X=Go({...t,...L}),A=uo(L),B=rr(p,A,X),P=Gh(p,B,{...t,...L});return Object.keys(P).length===0?L:{...L,...P}};if(typeof s=="number"&&s!==l)return e;const w=Qs(e),f=Qs(t);if(!Uh(w,f))return b({...e,...Kh(w,f,t,p)});if(d<c&&typeof p=="number"&&!u){const L=Go({...t,...e});return b({...e,...qh(p,d,L)})}if(u){const L=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,X=Math.max(0,(d-o)/2);return L>X?{...e,textPaddingLR:X}:e}const h=Go({...t,...e}),m=rr(p,c,Go(t)),M=rr(p,d,h).some((L,X)=>L<(m[X]??L)),R=fn.some(L=>{const X=e[L],A=t[L];return typeof X=="number"&&typeof A=="number"&&X!==A});return M||R?b(e):e}function Zh(e,t,n,i){const o=t.slice(0,e).reduce((l,d)=>l+d,0),s=n.slice(e+1,t.length-1).reduce((l,d)=>l+d,0);return Math.max(Co,i-o-s-Co)}function Jh(e,t){return Math.random()*(t-e)+e}function Qh(e){return Object.fromEntries(fn.map(t=>[t,typeof e[t]=="number"?e[t]:Ec[t]]))}function ta(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function ef(e,t,n,i,o,s){return e.slice(0,t).map((l,d)=>{const c=zi[d],u=Bi[d],p=Vi[d];return{key:l,textPrefix:Wh[l],widthKey:fn[d],width:n[fn[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[u],paddingBottom:s[p]}})}function tf({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:s,layoutId:l,onUpdateSettings:d}){const{prefix:c}=S.useScopedStyles(),u=!!o,{columns:p,type:b,wrapperWidth:w,entriesCount:f,cellMinHeight:h,dividerWidth:m,showVisibility:v,cut:M,showCut:R,cutCellMinHeight:L,cutLabel:X,imageSize:A,imageOnHover:B,imagePosition:P="cursor",imageInterpolation:C="on",entryHoverEffect:j,entryHoverShowOption:x,rowPaddingTop:W,rowPaddingBottom:E,rowPaddingTopB:Z,columnsOrder:k,textPaddingLR:U,textColor:V,backgroundColor:G,dividerColor:ie,textHoverColor:$,backgroundHoverColor:I,dividerHoverColor:D}=e,[se,oe]=a.useState(void 0),[T,ue]=a.useState(null),F=a.useRef(null),ne=B==="on"&&(!n||i),J=P==="cursor",ve=J&&C==="on",{anchorRef:Ee,onShow:me,onCursorMove:de,exit:q}=Sh(!!(ne&&T!==null),ve),Q=(M??0)>0,Y=b==="b",_e=a.useRef(null),Ce=a.useRef(null),[ke,ce]=a.useState(null),[ge,we]=a.useState($o),z=Mc(ge),le=Math.max(0,((w??0)-z)/2),he=Math.min(U??0,le),xe=Math.max(he,Ii),Re=((w??0)+z)/2;a.useLayoutEffect(()=>{if(!n){we($o);return}const $e=()=>{we(jh(_e.current))};$e();const We=_e.current;if(!We)return;const Qe=new ResizeObserver($e);Qe.observe(We);let st=We;for(;st&&!st.style.getPropertyValue("--cntrl-article-width");)st=st.parentElement;return st&&Qe.observe(st),()=>Qe.disconnect()},[n,l]),a.useEffect(()=>{oe(void 0)},[M,R,t,f]),a.useEffect(()=>{n&&!i&&oe(void 0)},[n,i]);const Te=S.buildColorVars(c,{textColor:V,backgroundColor:G,dividerColor:ie,textHoverColor:$,backgroundHoverColor:I,dividerHoverColor:D},Oh,Dh),_=s&&s!=="default"?`${c}-state-${s}`:"",te=`${!n||i?j==="default"?`${c}-entry-hover-default`:j==="blinds"?`${c}-entry-hover-blinds`:j==="reveal"?`${c}-entry-hover-reveal`:"":""} ${_}`.trim(),N=j==="reveal"&&(!n||i),ee=(v==null?void 0:v[0])??!1,Ie=(v==null?void 0:v[1])??!1,re=a.useRef(e),O=a.useRef(l);a.useEffect(()=>{if(!d||!n){re.current=e,O.current=l;return}if(O.current!==l){re.current=e,O.current=l;return}const $e=re.current;if(!($e!==e))return;if(typeof $e.columns=="number"&&typeof e.columns=="number"&&$e.columns!==e.columns){re.current=e;return}const Qe=Yh(e,$e,{designWidth:ge});re.current=e,kc(e,Qe)&&d(Qe)},[e,d,n,l,ge]);const Ve=a.useMemo(()=>Qh(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),Oe=a.useMemo(()=>ta(e,zi),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),lt=a.useMemo(()=>ta(e,Bi),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),tt=a.useMemo(()=>ta(e,Vi),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),ht=a.useMemo(()=>Array.isArray(k)&&k.length>0?k:[...Xn],[k]),nt=a.useMemo(()=>ef(ht,p,Ve,Oe,lt,tt),[ht,p,Ve,Oe,lt,tt]),Be=uo(e),ye=a.useMemo(()=>fn.slice(0,p).map($e=>Ve[$e]),[p,Ve]),Pe=a.useMemo(()=>rs(p,Be,Ve),[p,Be,Ve]),De=a.useMemo(()=>rr(p,Be,Ve),[p,Be,Ve]),qe=a.useMemo(()=>nt.map(($e,We)=>Pc(De[We]??0,$e.paddingLeft,$e.paddingRight)),[nt,De]),Se=a.useMemo(()=>{const $e=f===0?1/0:f;return(t??[]).slice(0,$e).map((Qe,st)=>({id:st,cells:Object.fromEntries(Xn.map(gt=>[gt,Qe[gt]??""])),image:Qe.image,link:Qe.link}))},[t,f]),Ne=Q?se??M:Se.length,ze=a.useMemo(()=>Q?Se.slice(0,Ne):Se,[Se,Q,Ne]),Xe=Q&&Ne<Se.length,ct=ze.length>1||Xe,Je=[ee?`${c}-divider-top`:"",Ie||ct?`${c}-divider-bottom`:""].filter(Boolean).join(" "),$t=!n||i,dt=()=>{if(!$t)return;const $e=se??M;if(!R){oe(Se.length);return}oe(Math.min($e+R,Se.length))},Fe=$e=>S.scalingValue($e,n??!1),Ke=Y?Z??0:W??0,je=E??0,ut=h??0,pt=Math.max(je,ea),mt=Gs(0,ze.length,ee,Ie,Xe,m??0,n??!1).borderTopWidth,kt=Y?"rowPaddingTopB":"rowPaddingTop",Xt=nt[0],Yt=nt[nt.length-1],vt=qe[0],bt=qe[qe.length-1],Gt=Xt&&vt?Math.max(vt.paddingLeft,Ii):0,Ft=Yt&&bt?Math.max(bt.paddingRight,Ii):0,xt=Be,Ht=($e,We)=>wh(P,_e.current,J?$e:null,We),qt=($e,We)=>{if(!ne)return;const Qe=$e.image;if(!(Qe!=null&&Qe.url)){q(()=>ue(null));return}const st=(A==null?void 0:A.min)??80,gt=(A==null?void 0:A.max)??320,Rt=(T==null?void 0:T.rowId)===$e.id,ot=Rt?T.widthPx:Jh(st,gt),{x:Ot,y:Pt}=Ht(We,ot);if(Rt&&J){de(Ot,Pt);return}ue({rowId:$e.id,url:Qe.url,objectFit:"contain",isVideo:fh(Qe),widthPx:ot}),F.current={x:Ot,y:Pt}},Zt=$e=>{if(!ne||!T||!J)return;const{x:We,y:Qe}=Ht($e,T.widthPx);de(We,Qe)},tn=()=>{T&&q(()=>ue(null))},Ct=$e=>{N&&Bs($e,c),!(!ne||!T)&&q(()=>ue(null))},jt=$e=>{N&&Vs($e,c)};a.useLayoutEffect(()=>{if(!T||!F.current)return;const{x:$e,y:We}=F.current;F.current=null,me($e,We)},[T==null?void 0:T.rowId,T==null?void 0:T.url,me]),a.useLayoutEffect(()=>{if(!u||Y){ce(null);return}const $e=Ce.current,We=$e==null?void 0:$e.parentElement;if(!$e||!We){ce(null);return}const Qe=()=>{const gt=$e.querySelector("[data-list-row]");if(!gt){ce(null);return}const Rt=We.getBoundingClientRect(),ot=gt.getBoundingClientRect();ce(ot.top-Rt.top+ot.height/2)};Qe();const st=new ResizeObserver(Qe);return st.observe($e),st.observe(We),()=>st.disconnect()},[u,Y,ze,Ke,je,ut,t,e,nt,De,ge,m,ee,Ie,Xe]);const cn=a.useMemo(()=>!Y&&ns.some($e=>{const We=$e.charAt(0),Qe=e[`${$e}VerticalAlign`];return Ic(Qe,e,We)}),[Y,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);a.useLayoutEffect(()=>{var Ot;const $e=_e.current;if(!$e)return;const We=()=>{$e.querySelectorAll("[data-list-col]").forEach(Pt=>{Pt.style.transform="";const Et=Pt.querySelector(`.${c}-list-col`);Et&&(Et.style.minHeight="",Et.style.height="");const zt=Pt.querySelector(`.${c}-list-col-title`);zt&&(zt.style.transform="")})};if(Y||!cn){We();return}const Qe=()=>{const Pt=Array.from($e.querySelectorAll("[data-list-row]")),Et=`${c}-list-col`,zt=`${c}-baseline-probe`;Pt.forEach(Bt=>{Bt.querySelectorAll("[data-list-col]").forEach(Wt=>{Wt.style.transform="";const _t=Wt.querySelector(`.${Et}`);_t&&(_t.style.minHeight="",_t.style.height="");const At=Wt.querySelector(`.${c}-list-col-title`);At&&(At.style.transform="")})}),Pt.forEach(Bt=>{const Wt=Array.from(Bt.querySelectorAll("[data-list-col]"));Ah(Bt,Wt,Et)}),$e.offsetHeight,Pt.forEach(Bt=>{const Wt=Array.from(Bt.querySelectorAll("[data-list-col]")),_t=Bt.getBoundingClientRect().top,At=new Map,wt=Wt.map(Le=>{const Me=Le.querySelector(`.${c}-list-col-title`),et={el:Le,titleEl:Me,letter:Le.getAttribute("data-col-letter")??"",kind:Le.getAttribute("data-valign")??"top",anchor:Le.getAttribute("data-valign-anchor")};return At.set(et.letter,et),et}),y=new Map,fe=(Le,Me)=>{const et=y.get(Le.letter);if(et!==void 0)return et;const Mt=Le.anchor?At.get(Le.anchor):void 0;if(Le.kind!=="baseline"||!Mt||Me.has(Le.letter)){const nn=Qr(Le,_t,Et,zt);return y.set(Le.letter,nn),nn}Me.add(Le.letter);const Ye=fe(Mt,Me);Me.delete(Le.letter);const ft=Qr(Le,_t,Et,zt),Nt=Ye-ft;Fh(Le.titleEl,Nt);const Tt=Qr(Le,_t,Et,zt);return y.set(Le.letter,Tt),Tt};wt.forEach(Le=>fe(Le,new Set))})};let st=null;const gt=()=>{st===null&&(st=requestAnimationFrame(()=>{st=null,Qe()}))};Qe();const Rt=new ResizeObserver(()=>gt());Rt.observe($e);let ot=!1;return typeof document<"u"&&((Ot=document.fonts)!=null&&Ot.ready)&&document.fonts.ready.then(()=>{ot||gt()}),()=>{ot=!0,st!==null&&(cancelAnimationFrame(st),st=null),Rt.disconnect(),We()}},[cn,Y,e,t,ge,ze,De]);const at=a.useMemo(()=>$h(c),[c]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:at}}),r.jsx("div",{style:Te,children:r.jsxs("div",{ref:_e,className:`${c}-wrapper ${te}${Je?` ${Je}`:""}${Y?` ${c}-type-b`:""}`.trim(),style:{width:S.scalingValue(w??0,n)},onMouseMove:ne?Zt:void 0,onMouseLeave:ne?tn:void 0,children:[r.jsxs("div",{style:{width:"100%",position:"relative"},children:[ze.map(($e,We)=>{var Rt;const Qe=(((Rt=$e.link)==null?void 0:Rt.length)??0)>0,st=Qe&&(!n||i)?"a":"div",gt=Gs(We,ze.length,ee,Ie,Xe,m??0,n??!1);return r.jsxs(st,{ref:We===0?ot=>{Ce.current=ot}:void 0,className:`${c}-list-item${Qe||x==="always"?` ${c}-list-item-has-link`:""}${Xe&&We===ze.length-1?` ${c}-list-item-before-cut`:""}`,...Qe?{href:$e.link,target:"_blank"}:{},style:gt,onMouseEnter:ot=>{N&&(Qe||x==="always")&&Bs(ot,c),ne&&qt($e,ot)},onMouseLeave:ot=>{N&&(Qe||x==="always")&&Vs(ot,c)},children:[Ke>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Fe(Ke)}}),r.jsxs("div",{className:`${c}-list-cols-row${Y?"":` ${c}-list-cols-row-h`}${u&&We===0&&Y?` ${c}-list-cols-row-controls`:""}`,...Y?{}:{"data-list-row":""},style:Y?void 0:{minHeight:Fe(ut)},children:[nt.map((ot,Ot)=>{const Pt=Ot===nt.length-1,Et=qe[Ot],zt=ot.paddingBottom,Bt=vh($e.cells[ot.key]),Wt=Y&&Bt&&zt>0,_t=Y?{minHeight:Fe(ut)}:{width:Fe(De[Ot])},At=Y?{paddingLeft:Fe(he),paddingRight:Fe(he)}:{paddingLeft:Fe(Et.paddingLeft),paddingRight:Fe(Et.paddingRight)},wt=ot.textPrefix.charAt(0),y=Y?Rh(e[`${ot.textPrefix}VerticalAlign`]):Lh(e[`${ot.textPrefix}VerticalAlign`],e,wt),fe=Y&&Bt&&u&&We===0;return Y&&!Bt?null:r.jsxs("div",{className:Y?`${c}-list-col-wrap`:void 0,...Y?{}:{"data-list-col":"","data-col-letter":wt,"data-valign":y.kind,...y.kind==="baseline"?{"data-valign-anchor":y.anchorLetter}:{}},children:[r.jsx("div",{className:`${c}-list-col${Pt?` ${c}-list-col-last`:""}`,style:{...At,..._t,...Y?{justifyContent:Ks(y.kind)}:{}},"data-test":ot.width,children:r.jsx("span",{className:Ys(e,ot.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Xs(gr(e,ot.textPrefix),n),...Zs(e,ot.textPrefix,c,n),...Y?{}:Mh(y.kind)},children:$e.cells[ot.key]??null})}),Wt&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Fe(zt)}}),fe&&r.jsx("div",{"data-controls":ot.paddingBottomKey,"data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Fe(Math.max(zt,ea))}})]},ot.key)}),u&&We===0&&Y&&r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Re),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:0,width:Fe(xe),height:"100%"}}),r.jsx("div",{"data-controls":"textPaddingLR","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),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:Fe(Math.max(xe,Be-xe)),width:Fe(xe),height:"100%"}})]})]}),!Y&&je>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Fe(je)}}),u&&We===0&&!Y&&r.jsx("div",{"data-controls":"rowPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${c}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Fe(pt)}})]},$e.id)}),u&&r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":kt,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":Y?"center":"left-y",className:`${c}-control-anchor`,style:{top:mt,left:0,width:"100%",height:Fe(Math.max(Ke,ea))}})},"row-padding-handles"),u&&!Y&&Xt&&Yt&&r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx("div",{"data-controls":Xt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(De[0]-((vt==null?void 0:vt.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":ke??void 0,className:`${c}-control-anchor`,style:{top:0,left:0,width:Fe(Gt),height:"100%"}}),r.jsx("div",{"data-controls":Yt.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(De[nt.length-1]-((bt==null?void 0:bt.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":ke??void 0,className:`${c}-control-anchor`,style:{top:0,left:Fe(xt-Ft),width:Fe(Ft),height:"100%"}})]},"column-edge-padding-handles"),u&&!Y&&nt.slice(0,-1).map(($e,We)=>{const Qe=nt[We+1],st=Pe.slice(0,We+1).reduce((Pt,Et)=>Pt+Et,0),gt=qe[We],Rt=qe[We+1],ot=Math.max(gt.paddingRight,Ii),Ot=Math.max(Rt.paddingLeft,Ii);return r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx("div",{"data-controls":$e.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(De[We]-gt.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":ke??void 0,className:`${c}-control-anchor`,style:{top:0,left:Fe(st-ot),width:Fe(ot),height:"100%"}}),r.jsx("div",{"data-controls":Qe.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(De[We+1]-Rt.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":ke??void 0,className:`${c}-control-anchor`,style:{top:0,left:Fe(st),width:Fe(Ot),height:"100%"}})]},`${$e.paddingRightKey}-padding`)}),u&&!Y&&nt.slice(0,-1).map(($e,We)=>{const Qe=Zh(We,Pe,ye,Be),gt=Pe.slice(0,We+1).reduce((Rt,ot)=>Rt+ot,0)-Js/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":$e.widthKey,"data-controls-axis":"x","data-controls-min":String(os),"data-controls-max-fraction":String(Qe),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Fe(gt),width:Fe(Js),height:"calc(100%)",pointerEvents:"auto"}})},`${$e.widthKey}-junction`)})]}),Xe&&(()=>{const $e=gr(e,An),We=Eh(e.cutLabelVerticalAlign),Qe=$e.textTextAlign==="justify"||Y;return r.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:Fe(L??0),cursor:$t?"pointer":"default",...xh(Ie,m??0,n??!1)},onClick:$t?dt:void 0,onMouseEnter:N||ne?Ct:void 0,onMouseLeave:N?jt:void 0,children:r.jsx("div",{className:`${c}-list-cols-row`,style:{...Y?{paddingLeft:Fe(he),paddingRight:Fe(he)}:{},justifyContent:Ph($e.textTextAlign),alignItems:Ks(We)},children:r.jsx("span",{className:Ys(e,An,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Xs($e,n),...Zs(e,An,c,n),...Qe?{width:"100%"}:{}},children:X})})})})(),ne&&T&&(()=>{const $e=`${T.widthPx}px`,We={width:$e,height:"auto",maxHeight:$e,objectFit:"contain"};return r.jsx("div",{ref:Ee,className:`${c}-hover-media-anchor`,children:r.jsx(yh,{media:T,className:T.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:We},`${T.rowId}-${T.url}`)})})()]})})]})}const nf=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
9254
+ `}const Xn=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],ns=["AColumn","BColumn","CColumn","DColumn","EColumn"],An="cutLabel",wo=[...ns,An],Pr=["A","B","C","D","E"];function Lc(e){return`${e}ColumnVerticalAlign`}const Ca=["Top","Center","Bottom"];function is(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return Pr.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function Ch(e){const t=is(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function Th(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return Pr.includes(n)?n:null}function Rc(e,t,n){const i=Th(e);return i?i===t?!1:Ch(n[Lc(i)]):!0}function So(e){const t=is(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return Pr.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function Lh(e,t,n){if(Ic(e,t,n))return So(e);const i=So(e);return i.kind==="baseline"?{kind:"top"}:i}function Rh(e){const t=So(e);return t.kind==="baseline"?{kind:"top"}:t}function Ic(e,t,n){return Rc(e,n,t)?So(e).kind==="baseline":!1}function Ih(e){const t={};let n=!1;for(const i of Pr){const o=Lc(i),s=e[o];if(e.type==="b"){const l=String(s??"Top").trim();l!=="Top"&&l!=="Center"&&l!=="Bottom"&&(t[o]="Top",n=!0);continue}Rc(s,i,e)||(t[o]="Top",n=!0)}return n?t:null}function Mh(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function Eh(e){const t=So(e).kind;return t==="baseline"?"center":t}function Ph(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Ks(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function kh(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 Qr(e,t,n,i){const o=e.titleEl;if(!o)return 0;const s=o.closest(`.${n}`);if(!s)return 0;const l=kh(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+l;const d=s.getBoundingClientRect(),c=o.getBoundingClientRect().height;let u=0;return e.kind==="center"?u=(d.height-c)/2:e.kind==="bottom"&&(u=d.height-c),d.top-t+u+l}function Ah(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 Fh(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const Wh={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function It(e,t){return`${e}${t.replace(/^text/,"Text")}`}const _h={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function Nh(e){return[It(e,"textFontFamily"),It(e,"textFontSettings"),{type:"row",items:[It(e,"textFontSize"),It(e,"textLineHeight"),It(e,"textLetterSpacing"),It(e,"textWordSpacing")]},It(e,"textTextAlign"),It(e,"textTextAppearance"),`${e}VerticalAlign`]}function Hh(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(wo.map(e=>[_h[e],Nh(e)]))}}function gr(e,t){const n=i=>{const o=It(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===An?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Xs(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 on(Ut(n,t))}function Ys(e,t,n,i){const o=gr(e,t),s=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<s?`${n} ${i}`:n}function Zs(e,t,n,i){const o=gr(e,t),s=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=s?{}:{[`--${n}-title-leading-gap`]:S.scalingValue((s-l)/2,i)}}const fn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],zi=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],Bi=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Vi=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Oh={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Dh=["hover","focus","filled","success","error"],Js=.004,Ii=.004,ea=Ii,os=50,$o=1440,Co=os/$o;function Mc(e){const t=typeof e=="number"&&e>0?e:$o;return os/t}function jh(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 $o}const Ec={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function uo(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function zh(e,t=1){const n=t/e;return Object.fromEntries(fn.map(i=>[i,n]))}function Bh(){return Object.fromEntries([...zi.map(e=>[e,0]),...Bi.map(e=>[e,0])])}function Vh(){return Object.fromEntries(Vi.map(e=>[e,0]))}function Go(e){return Object.fromEntries(fn.map(t=>[t,typeof e[t]=="number"?e[t]:Ec[t]]))}function Pc(e,t,n){const i=e-Co,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 rr(e,t,n){const i=rs(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((s,l)=>s+l,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function Gh(e,t,n){const i={};for(let o=0;o<e;o+=1){const s=zi[o],l=Bi[o],d=typeof n[s]=="number"?n[s]:0,c=typeof n[l]=="number"?n[l]:0,u=Pc(t[o]??0,d,c);u.paddingLeft!==d&&(i[s]=u.paddingLeft),u.paddingRight!==c&&(i[l]=u.paddingRight)}return i}function rs(e,t,n){if(e<=0)return[];const i=fn.slice(0,e).map(u=>n[u]);if(e===1)return i;const o=i.slice(0,e-1),l=o.reduce((u,p)=>u+p,0)+Co;if(t>=l)return i;const d=[...o];let c=l-t;for(let u=d.length-1;u>=0&&c>0;u-=1){const p=d[u]-Co;if(p<=0)continue;const b=Math.min(c,p);d[u]-=b,c-=b}return[...d,i[e-1]]}function qh(e,t,n){if(e<=1)return{};const i=rs(e,t,n),o={};for(let s=0;s<e-1;s+=1){const l=fn[s];i[s]!==n[l]&&(o[l]=i[s])}return o}function Qs(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Xn]}function Uh(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function Kh(e,t,n,i){const o=Math.min(i,e.length,fn.length),s={};for(let l=0;l<o;l+=1){const d=e[l],c=t.indexOf(d);if(c===-1)continue;const u=fn[c],p=zi[c],b=Bi[c],w=Vi[c],f=fn[l],h=zi[l],m=Bi[l],v=Vi[l],M=n[u],R=n[p],L=n[b],X=n[w];typeof M=="number"&&(s[f]=M),typeof R=="number"&&(s[h]=R),typeof L=="number"&&(s[m]=L),typeof X=="number"&&(s[v]=X)}return s}function kc(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 Xh(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=uo(e),s=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...zh(n,o),...Bh()};if(s)for(const d of Vi)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,Vh());return kc(e,l)?l:e}function Yh(e,t,n){const i=Ih(e);i&&(e={...e,...i});const o=Mc(n==null?void 0:n.designWidth),s=e.columns,l=t.columns,d=uo(e),c=uo(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof s=="number"?s:typeof l=="number"?l:Xn.length,b=L=>{if(u)return L;const X=Go({...t,...L}),F=uo(L),B=rr(p,F,X),k=Gh(p,B,{...t,...L});return Object.keys(k).length===0?L:{...L,...k}};if(typeof s=="number"&&s!==l)return e;const w=Qs(e),f=Qs(t);if(!Uh(w,f))return b({...e,...Kh(w,f,t,p)});if(d<c&&typeof p=="number"&&!u){const L=Go({...t,...e});return b({...e,...qh(p,d,L)})}if(u){const L=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,X=Math.max(0,(d-o)/2);return L>X?{...e,textPaddingLR:X}:e}const h=Go({...t,...e}),m=rr(p,c,Go(t)),M=rr(p,d,h).some((L,X)=>L<(m[X]??L)),R=fn.some(L=>{const X=e[L],F=t[L];return typeof X=="number"&&typeof F=="number"&&X!==F});return M||R?b(e):e}function Zh(e,t,n,i){const o=t.slice(0,e).reduce((l,d)=>l+d,0),s=n.slice(e+1,t.length-1).reduce((l,d)=>l+d,0);return Math.max(Co,i-o-s-Co)}function Jh(e,t){return Math.random()*(t-e)+e}function Qh(e){return Object.fromEntries(fn.map(t=>[t,typeof e[t]=="number"?e[t]:Ec[t]]))}function ta(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function ef(e,t,n,i,o,s){return e.slice(0,t).map((l,d)=>{const c=zi[d],u=Bi[d],p=Vi[d];return{key:l,textPrefix:Wh[l],widthKey:fn[d],width:n[fn[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[u],paddingBottom:s[p]}})}function tf({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:s,layoutId:l,onUpdateSettings:d}){const{prefix:c}=S.useScopedStyles(),u=!!o,{columns:p,type:b,wrapperWidth:w,entriesCount:f,cellMinHeight:h,dividerWidth:m,showVisibility:v,cut:M,showCut:R,cutCellMinHeight:L,cutLabel:X,imageSize:F,imageOnHover:B,imagePosition:k="cursor",imageInterpolation:C="on",entryHoverEffect:j,entryHoverShowOption:x,rowPaddingTop:W,rowPaddingBottom:E,rowPaddingTopB:Z,columnsOrder:P,textPaddingLR:U,textColor:V,backgroundColor:G,dividerColor:ie,textHoverColor:$,backgroundHoverColor:I,dividerHoverColor:D}=e,[se,oe]=a.useState(void 0),[T,ue]=a.useState(null),A=a.useRef(null),ne=B==="on"&&(!n||i),J=k==="cursor",ve=J&&C==="on",{anchorRef:Ee,onShow:me,onCursorMove:de,exit:q}=Sh(!!(ne&&T!==null),ve),Q=(M??0)>0,Y=b==="b",_e=a.useRef(null),Ce=a.useRef(null),[ke,ce]=a.useState(null),[ge,we]=a.useState($o),z=Mc(ge),le=Math.max(0,((w??0)-z)/2),he=Math.min(U??0,le),xe=Math.max(he,Ii),Re=((w??0)+z)/2;a.useLayoutEffect(()=>{if(!n){we($o);return}const $e=()=>{we(jh(_e.current))};$e();const We=_e.current;if(!We)return;const Qe=new ResizeObserver($e);Qe.observe(We);let st=We;for(;st&&!st.style.getPropertyValue("--cntrl-article-width");)st=st.parentElement;return st&&Qe.observe(st),()=>Qe.disconnect()},[n,l]),a.useEffect(()=>{oe(void 0)},[M,R,t,f]),a.useEffect(()=>{n&&!i&&oe(void 0)},[n,i]);const Te=S.buildColorVars(c,{textColor:V,backgroundColor:G,dividerColor:ie,textHoverColor:$,backgroundHoverColor:I,dividerHoverColor:D},Oh,Dh),_=s&&s!=="default"?`${c}-state-${s}`:"",te=`${!n||i?j==="default"?`${c}-entry-hover-default`:j==="blinds"?`${c}-entry-hover-blinds`:j==="reveal"?`${c}-entry-hover-reveal`:"":""} ${_}`.trim(),N=j==="reveal"&&(!n||i),ee=(v==null?void 0:v[0])??!1,Ie=(v==null?void 0:v[1])??!1,re=a.useRef(e),O=a.useRef(l);a.useEffect(()=>{if(!d||!n){re.current=e,O.current=l;return}if(O.current!==l){re.current=e,O.current=l;return}const $e=re.current;if(!($e!==e))return;if(typeof $e.columns=="number"&&typeof e.columns=="number"&&$e.columns!==e.columns){re.current=e;return}const Qe=Yh(e,$e,{designWidth:ge});re.current=e,kc(e,Qe)&&d(Qe)},[e,d,n,l,ge]);const Ve=a.useMemo(()=>Qh(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),Oe=a.useMemo(()=>ta(e,zi),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),lt=a.useMemo(()=>ta(e,Bi),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),tt=a.useMemo(()=>ta(e,Vi),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),ht=a.useMemo(()=>Array.isArray(P)&&P.length>0?P:[...Xn],[P]),nt=a.useMemo(()=>ef(ht,p,Ve,Oe,lt,tt),[ht,p,Ve,Oe,lt,tt]),Be=uo(e),ye=a.useMemo(()=>fn.slice(0,p).map($e=>Ve[$e]),[p,Ve]),Pe=a.useMemo(()=>rs(p,Be,Ve),[p,Be,Ve]),De=a.useMemo(()=>rr(p,Be,Ve),[p,Be,Ve]),qe=a.useMemo(()=>nt.map(($e,We)=>Pc(De[We]??0,$e.paddingLeft,$e.paddingRight)),[nt,De]),Se=a.useMemo(()=>{const $e=f===0?1/0:f;return(t??[]).slice(0,$e).map((Qe,st)=>({id:st,cells:Object.fromEntries(Xn.map(gt=>[gt,Qe[gt]??""])),image:Qe.image,link:Qe.link}))},[t,f]),Ne=Q?se??M:Se.length,ze=a.useMemo(()=>Q?Se.slice(0,Ne):Se,[Se,Q,Ne]),Xe=Q&&Ne<Se.length,ct=ze.length>1||Xe,Je=[ee?`${c}-divider-top`:"",Ie||ct?`${c}-divider-bottom`:""].filter(Boolean).join(" "),$t=!n||i,dt=()=>{if(!$t)return;const $e=se??M;if(!R){oe(Se.length);return}oe(Math.min($e+R,Se.length))},Fe=$e=>S.scalingValue($e,n??!1),Ke=Y?Z??0:W??0,je=E??0,ut=h??0,pt=Math.max(je,ea),mt=Gs(0,ze.length,ee,Ie,Xe,m??0,n??!1).borderTopWidth,kt=Y?"rowPaddingTopB":"rowPaddingTop",Xt=nt[0],Yt=nt[nt.length-1],vt=qe[0],bt=qe[qe.length-1],Gt=Xt&&vt?Math.max(vt.paddingLeft,Ii):0,Ft=Yt&&bt?Math.max(bt.paddingRight,Ii):0,xt=Be,Ht=($e,We)=>wh(k,_e.current,J?$e:null,We),qt=($e,We)=>{if(!ne)return;const Qe=$e.image;if(!(Qe!=null&&Qe.url)){q(()=>ue(null));return}const st=(F==null?void 0:F.min)??80,gt=(F==null?void 0:F.max)??320,Rt=(T==null?void 0:T.rowId)===$e.id,ot=Rt?T.widthPx:Jh(st,gt),{x:Ot,y:Pt}=Ht(We,ot);if(Rt&&J){de(Ot,Pt);return}ue({rowId:$e.id,url:Qe.url,objectFit:"contain",isVideo:fh(Qe),widthPx:ot}),A.current={x:Ot,y:Pt}},Zt=$e=>{if(!ne||!T||!J)return;const{x:We,y:Qe}=Ht($e,T.widthPx);de(We,Qe)},tn=()=>{T&&q(()=>ue(null))},Ct=$e=>{N&&Bs($e,c),!(!ne||!T)&&q(()=>ue(null))},jt=$e=>{N&&Vs($e,c)};a.useLayoutEffect(()=>{if(!T||!A.current)return;const{x:$e,y:We}=A.current;A.current=null,me($e,We)},[T==null?void 0:T.rowId,T==null?void 0:T.url,me]),a.useLayoutEffect(()=>{if(!u||Y){ce(null);return}const $e=Ce.current,We=$e==null?void 0:$e.parentElement;if(!$e||!We){ce(null);return}const Qe=()=>{const gt=$e.querySelector("[data-list-row]");if(!gt){ce(null);return}const Rt=We.getBoundingClientRect(),ot=gt.getBoundingClientRect();ce(ot.top-Rt.top+ot.height/2)};Qe();const st=new ResizeObserver(Qe);return st.observe($e),st.observe(We),()=>st.disconnect()},[u,Y,ze,Ke,je,ut,t,e,nt,De,ge,m,ee,Ie,Xe]);const cn=a.useMemo(()=>!Y&&ns.some($e=>{const We=$e.charAt(0),Qe=e[`${$e}VerticalAlign`];return Ic(Qe,e,We)}),[Y,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);a.useLayoutEffect(()=>{var Ot;const $e=_e.current;if(!$e)return;const We=()=>{$e.querySelectorAll("[data-list-col]").forEach(Pt=>{Pt.style.transform="";const Et=Pt.querySelector(`.${c}-list-col`);Et&&(Et.style.minHeight="",Et.style.height="");const zt=Pt.querySelector(`.${c}-list-col-title`);zt&&(zt.style.transform="")})};if(Y||!cn){We();return}const Qe=()=>{const Pt=Array.from($e.querySelectorAll("[data-list-row]")),Et=`${c}-list-col`,zt=`${c}-baseline-probe`;Pt.forEach(Bt=>{Bt.querySelectorAll("[data-list-col]").forEach(Wt=>{Wt.style.transform="";const _t=Wt.querySelector(`.${Et}`);_t&&(_t.style.minHeight="",_t.style.height="");const At=Wt.querySelector(`.${c}-list-col-title`);At&&(At.style.transform="")})}),Pt.forEach(Bt=>{const Wt=Array.from(Bt.querySelectorAll("[data-list-col]"));Ah(Bt,Wt,Et)}),$e.offsetHeight,Pt.forEach(Bt=>{const Wt=Array.from(Bt.querySelectorAll("[data-list-col]")),_t=Bt.getBoundingClientRect().top,At=new Map,wt=Wt.map(Le=>{const Me=Le.querySelector(`.${c}-list-col-title`),et={el:Le,titleEl:Me,letter:Le.getAttribute("data-col-letter")??"",kind:Le.getAttribute("data-valign")??"top",anchor:Le.getAttribute("data-valign-anchor")};return At.set(et.letter,et),et}),y=new Map,fe=(Le,Me)=>{const et=y.get(Le.letter);if(et!==void 0)return et;const Mt=Le.anchor?At.get(Le.anchor):void 0;if(Le.kind!=="baseline"||!Mt||Me.has(Le.letter)){const nn=Qr(Le,_t,Et,zt);return y.set(Le.letter,nn),nn}Me.add(Le.letter);const Ye=fe(Mt,Me);Me.delete(Le.letter);const ft=Qr(Le,_t,Et,zt),Nt=Ye-ft;Fh(Le.titleEl,Nt);const Tt=Qr(Le,_t,Et,zt);return y.set(Le.letter,Tt),Tt};wt.forEach(Le=>fe(Le,new Set))})};let st=null;const gt=()=>{st===null&&(st=requestAnimationFrame(()=>{st=null,Qe()}))};Qe();const Rt=new ResizeObserver(()=>gt());Rt.observe($e);let ot=!1;return typeof document<"u"&&((Ot=document.fonts)!=null&&Ot.ready)&&document.fonts.ready.then(()=>{ot||gt()}),()=>{ot=!0,st!==null&&(cancelAnimationFrame(st),st=null),Rt.disconnect(),We()}},[cn,Y,e,t,ge,ze,De]);const at=a.useMemo(()=>$h(c),[c]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:at}}),r.jsx("div",{style:Te,children:r.jsxs("div",{ref:_e,className:`${c}-wrapper ${te}${Je?` ${Je}`:""}${Y?` ${c}-type-b`:""}`.trim(),style:{width:S.scalingValue(w??0,n)},onMouseMove:ne?Zt:void 0,onMouseLeave:ne?tn:void 0,children:[r.jsxs("div",{style:{width:"100%",position:"relative"},children:[ze.map(($e,We)=>{var Rt;const Qe=(((Rt=$e.link)==null?void 0:Rt.length)??0)>0,st=Qe&&(!n||i)?"a":"div",gt=Gs(We,ze.length,ee,Ie,Xe,m??0,n??!1);return r.jsxs(st,{ref:We===0?ot=>{Ce.current=ot}:void 0,className:`${c}-list-item${Qe||x==="always"?` ${c}-list-item-has-link`:""}${Xe&&We===ze.length-1?` ${c}-list-item-before-cut`:""}`,...Qe?{href:$e.link,target:"_blank"}:{},style:gt,onMouseEnter:ot=>{N&&(Qe||x==="always")&&Bs(ot,c),ne&&qt($e,ot)},onMouseLeave:ot=>{N&&(Qe||x==="always")&&Vs(ot,c)},children:[Ke>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Fe(Ke)}}),r.jsxs("div",{className:`${c}-list-cols-row${Y?"":` ${c}-list-cols-row-h`}${u&&We===0&&Y?` ${c}-list-cols-row-controls`:""}`,...Y?{}:{"data-list-row":""},style:Y?void 0:{minHeight:Fe(ut)},children:[nt.map((ot,Ot)=>{const Pt=Ot===nt.length-1,Et=qe[Ot],zt=ot.paddingBottom,Bt=vh($e.cells[ot.key]),Wt=Y&&Bt&&zt>0,_t=Y?{minHeight:Fe(ut)}:{width:Fe(De[Ot])},At=Y?{paddingLeft:Fe(he),paddingRight:Fe(he)}:{paddingLeft:Fe(Et.paddingLeft),paddingRight:Fe(Et.paddingRight)},wt=ot.textPrefix.charAt(0),y=Y?Rh(e[`${ot.textPrefix}VerticalAlign`]):Lh(e[`${ot.textPrefix}VerticalAlign`],e,wt),fe=Y&&Bt&&u&&We===0;return Y&&!Bt?null:r.jsxs("div",{className:Y?`${c}-list-col-wrap`:void 0,...Y?{}:{"data-list-col":"","data-col-letter":wt,"data-valign":y.kind,...y.kind==="baseline"?{"data-valign-anchor":y.anchorLetter}:{}},children:[r.jsx("div",{className:`${c}-list-col${Pt?` ${c}-list-col-last`:""}`,style:{...At,..._t,...Y?{justifyContent:Ks(y.kind)}:{}},"data-test":ot.width,children:r.jsx("span",{className:Ys(e,ot.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Xs(gr(e,ot.textPrefix),n),...Zs(e,ot.textPrefix,c,n),...Y?{}:Mh(y.kind)},children:$e.cells[ot.key]??null})}),Wt&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Fe(zt)}}),fe&&r.jsx("div",{"data-controls":ot.paddingBottomKey,"data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Fe(Math.max(zt,ea))}})]},ot.key)}),u&&We===0&&Y&&r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Re),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:0,width:Fe(xe),height:"100%"}}),r.jsx("div",{"data-controls":"textPaddingLR","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),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:Fe(Math.max(xe,Be-xe)),width:Fe(xe),height:"100%"}})]})]}),!Y&&je>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Fe(je)}}),u&&We===0&&!Y&&r.jsx("div",{"data-controls":"rowPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${c}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Fe(pt)}})]},$e.id)}),u&&r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":kt,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":Y?"center":"left-y",className:`${c}-control-anchor`,style:{top:mt,left:0,width:"100%",height:Fe(Math.max(Ke,ea))}})},"row-padding-handles"),u&&!Y&&Xt&&Yt&&r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx("div",{"data-controls":Xt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(De[0]-((vt==null?void 0:vt.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":ke??void 0,className:`${c}-control-anchor`,style:{top:0,left:0,width:Fe(Gt),height:"100%"}}),r.jsx("div",{"data-controls":Yt.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(De[nt.length-1]-((bt==null?void 0:bt.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":ke??void 0,className:`${c}-control-anchor`,style:{top:0,left:Fe(xt-Ft),width:Fe(Ft),height:"100%"}})]},"column-edge-padding-handles"),u&&!Y&&nt.slice(0,-1).map(($e,We)=>{const Qe=nt[We+1],st=Pe.slice(0,We+1).reduce((Pt,Et)=>Pt+Et,0),gt=qe[We],Rt=qe[We+1],ot=Math.max(gt.paddingRight,Ii),Ot=Math.max(Rt.paddingLeft,Ii);return r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx("div",{"data-controls":$e.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(De[We]-gt.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":ke??void 0,className:`${c}-control-anchor`,style:{top:0,left:Fe(st-ot),width:Fe(ot),height:"100%"}}),r.jsx("div",{"data-controls":Qe.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(De[We+1]-Rt.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":ke??void 0,className:`${c}-control-anchor`,style:{top:0,left:Fe(st),width:Fe(Ot),height:"100%"}})]},`${$e.paddingRightKey}-padding`)}),u&&!Y&&nt.slice(0,-1).map(($e,We)=>{const Qe=Zh(We,Pe,ye,Be),gt=Pe.slice(0,We+1).reduce((Rt,ot)=>Rt+ot,0)-Js/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":$e.widthKey,"data-controls-axis":"x","data-controls-min":String(os),"data-controls-max-fraction":String(Qe),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Fe(gt),width:Fe(Js),height:"calc(100%)",pointerEvents:"auto"}})},`${$e.widthKey}-junction`)})]}),Xe&&(()=>{const $e=gr(e,An),We=Eh(e.cutLabelVerticalAlign),Qe=$e.textTextAlign==="justify"||Y;return r.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:Fe(L??0),cursor:$t?"pointer":"default",...xh(Ie,m??0,n??!1)},onClick:$t?dt:void 0,onMouseEnter:N||ne?Ct:void 0,onMouseLeave:N?jt:void 0,children:r.jsx("div",{className:`${c}-list-cols-row`,style:{...Y?{paddingLeft:Fe(he),paddingRight:Fe(he)}:{},justifyContent:Ph($e.textTextAlign),alignItems:Ks(We)},children:r.jsx("span",{className:Ys(e,An,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Xs($e,n),...Zs(e,An,c,n),...Qe?{width:"100%"}:{}},children:X})})})})(),ne&&T&&(()=>{const $e=`${T.widthPx}px`,We={width:$e,height:"auto",maxHeight:$e,objectFit:"contain"};return r.jsx("div",{ref:Ee,className:`${c}-hover-media-anchor`,children:r.jsx(yh,{media:T,className:T.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:We},`${T.rowId}-${T.url}`)})})()]})})]})}const nf=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
9255
9255
  import { CommonComponentProps } from '../props';
9256
9256
  import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
9257
9257
  import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';
@@ -12441,6 +12441,8 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
12441
12441
  top: 50%;
12442
12442
  left: 50%;
12443
12443
  transform: translate(-50%, -50%);
12444
+ width: 100%;
12445
+ height: 100%;
12444
12446
  transition: background-color 250ms;
12445
12447
  }
12446
12448
  .${e}-wrapper.${e}-entry-hover-default .${e}-item:not(.${e}-item-open):hover .${e}-icon-image,
@@ -12502,7 +12504,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
12502
12504
  pointer-events: none;
12503
12505
  z-index: 2;
12504
12506
  }
12505
- `}function al(e,t,n,i,o,s,l,d){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:l,color:d??"#000000"}}function Tf({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:s}){const{prefix:l}=S.useScopedStyles(),d=o??!1,{wrapperWidth:c=1,cellMinHeight:u=0,dividerWidth:p=694e-6,dividerStyle:b="solid",entryHoverEffect:w="default",autoclose:f="off",icon:h,iconMaxWidth:m=.00833,iconPaddingRight:v=0,iconAnimation:M="rotate 45",questionColor:R="#000000",answerColor:L="#000000",dividerColor:X="#0000001F",iconColor:A="#000000",questionHoverColor:B="#666666",iconHoverColor:P="#666666",iconActiveColor:C="#000000",dividerHoverColor:j="#000000",questionFontFamily:x,questionFontSettings:W,questionFontSize:E,questionLineHeight:Z,questionLetterSpacing:k,questionWordSpacing:U,questionTextAppearance:V,answerFontFamily:G,answerFontSettings:ie,answerFontSize:$,answerLineHeight:I,answerLetterSpacing:D,answerWordSpacing:se,answerTextAppearance:oe,questionPaddingLeft:T=0,questionPaddingTop:ue=0,questionPaddingBottom:F=0,answerPaddingLeft:ne=0,answerPaddingRight:J=0,answerPaddingTop:ve=0,answerPaddingBottom:Ee=0}=e,me=t??[],[de,q]=a.useState(()=>new Set),Q=!n||i;a.useEffect(()=>{q(new Set)},[f]),a.useEffect(()=>{n&&!o&&!i&&q(new Set)},[n,o,i]);const Y=qe=>S.scalingValue(qe,n??!1),_e=Math.max(T,Hn),Ce=Math.max(ue,Hn),ke=Math.max(F,Hn),ce=Math.max(ne,Hn),ge=Math.max(J,Hn),we=Math.max(ve,Hn),z=Math.max(Ee,Hn),le=Math.max(0,(c??1)-v-m),he=Math.max(0,(c??1)-J),xe=Math.max(0,(c??1)-ne),Re=Math.max(v,Hn),Te=Math.max(0,(c??1)-T-m),_=a.useMemo(()=>de.size===0?0:Math.min(...de),[de]),pe=a.useCallback(qe=>de.has(qe),[de]),te=Q&&w==="default"?`${l}-entry-hover-default`:"",N=h??"",ee=N!=="",Ie=M.replace(/^rotate /,""),re=`${l}-icon-anim-${Ie}`,O=on(Ut(al(x,W,E,Z,k,U,V,R),n)),Ve=on(Ut(al(G,ie,$,I,D,se,oe,L),n)),Oe=ol(E,Z,`${l}-question`,`${l}-text-tight-leading`),lt=ol($,I,`${l}-answer-text`,`${l}-text-tight-leading`),tt=rl(E,Z,l,n),ht=rl($,I,l,n),nt=S.buildColorVars(l,{questionColor:R,answerColor:L,dividerColor:X,iconColor:A,questionHoverColor:B,iconHoverColor:P,iconActiveColor:C,dividerHoverColor:j},wf,Sf),Be=s&&s!=="default"?`${l}-state-${s}`:"",ye=a.useCallback(qe=>{Q&&q(Se=>{if(Se.has(qe)){const ze=new Set(Se);return ze.delete(qe),ze}if(f==="on")return new Set([qe]);const Ne=new Set(Se);return Ne.add(qe),Ne})},[Q,f]),Pe=a.useMemo(()=>Cf(l),[l]),De={[`--${l}-divider-width`]:S.scalingValue(p,n??!1),[`--${l}-divider-style`]:b,[`--${l}-icon-max-width`]:S.scalingValue(m,n??!1),...u>0?{[`--${l}-question-min-height`]:S.scalingValue(u,n??!1)}:{}};return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Pe}}),r.jsx("div",{style:nt,children:r.jsx("div",{className:rt(`${l}-wrapper`,n&&!i&&`${l}-editor`,te,Be),style:{width:S.scalingValue(c,n??!1),maxWidth:"100%",...De},children:me.map((qe,Se)=>{var $t;const Ne=pe(Se),ze=(($t=qe.question)==null?void 0:$t.trim())??"",Xe=qe.answer,ct=((Xe==null?void 0:Xe.length)??0)>0,Je=d&&Se===_;return r.jsxs("div",{className:rt(`${l}-item`,Ne&&`${l}-item-open`),"data-faq-item":"",children:[r.jsxs("div",{className:`${l}-question-controls`,children:[Je&&r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":"questionPaddingTop","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{top:0,left:0,width:"100%",height:Y(Ce)}}),r.jsx("div",{"data-controls":"questionPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(le),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:Y(_e),height:"100%"}}),r.jsx("div",{"data-controls":"iconPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Te),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:Y(Re),height:"100%"}})]}),r.jsxs("button",{type:"button",className:`${l}-question-button`,"aria-expanded":Ne,style:{...O,...tt,paddingLeft:Y(T),paddingRight:Y(v)},onClick:()=>ye(Se),children:[ue>0&&r.jsx("span",{className:`${l}-padding-handle`,style:{height:Y(ue)},"aria-hidden":"true"}),r.jsxs("span",{className:`${l}-question-row`,children:[r.jsx("span",{className:Oe,children:ze}),ct&&(ee?r.jsx("span",{className:`${l}-icon ${l}-icon-custom ${re}`,"aria-hidden":"true",children:r.jsx(rn,{url:N,fill:A,hoverFill:P,className:`${l}-icon-image`})}):r.jsx("span",{className:`${l}-icon ${l}-icon-default ${re}`,"aria-hidden":"true"}))]}),F>0&&r.jsx("span",{className:`${l}-padding-handle`,style:{height:Y(F)},"aria-hidden":"true"})]}),Je&&r.jsx("div",{"data-controls":"questionPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Y(ke)}})]}),ct&&Xe&&r.jsx("div",{className:`${l}-panel`,"aria-hidden":!Ne,children:r.jsx("div",{className:`${l}-panel-inner`,children:r.jsxs("div",{className:`${l}-answer-controls`,children:[Je&&Ne&&r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":"answerPaddingTop","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{top:0,left:0,width:"100%",height:Y(we)}}),r.jsx("div",{"data-controls":"answerPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(he),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:Y(ce),height:"100%"}}),r.jsx("div",{"data-controls":"answerPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(xe),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:Y(ge),height:"100%"}})]}),ve>0&&r.jsx("div",{className:`${l}-padding-handle`,style:{height:Y(ve)}}),r.jsx("div",{className:`${l}-answer`,style:{...Ve,...ht,paddingLeft:Y(ne),paddingRight:Y(J)},children:r.jsx("div",{className:lt,children:r.jsx(yi,{content:Xe})})}),Ee>0&&r.jsx("div",{className:`${l}-padding-handle`,style:{height:Y(Ee)}}),Je&&Ne&&r.jsx("div",{"data-controls":"answerPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Y(z)}})]})})})]},Se)})})})]})}const Lf=`import { useCallback, useEffect, useMemo, useState } from 'react';
12507
+ `}function al(e,t,n,i,o,s,l,d){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:l,color:d??"#000000"}}function Tf({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:s}){const{prefix:l}=S.useScopedStyles(),d=o??!1,{wrapperWidth:c=1,cellMinHeight:u=0,dividerWidth:p=694e-6,dividerStyle:b="solid",entryHoverEffect:w="default",autoclose:f="off",icon:h,iconMaxWidth:m=.00833,iconPaddingRight:v=0,iconAnimation:M="rotate 45",questionColor:R="#000000",answerColor:L="#000000",dividerColor:X="#0000001F",iconColor:F="#000000",questionHoverColor:B="#666666",iconHoverColor:k="#666666",iconActiveColor:C="#000000",dividerHoverColor:j="#000000",questionFontFamily:x,questionFontSettings:W,questionFontSize:E,questionLineHeight:Z,questionLetterSpacing:P,questionWordSpacing:U,questionTextAppearance:V,answerFontFamily:G,answerFontSettings:ie,answerFontSize:$,answerLineHeight:I,answerLetterSpacing:D,answerWordSpacing:se,answerTextAppearance:oe,questionPaddingLeft:T=0,questionPaddingTop:ue=0,questionPaddingBottom:A=0,answerPaddingLeft:ne=0,answerPaddingRight:J=0,answerPaddingTop:ve=0,answerPaddingBottom:Ee=0}=e,me=t??[],[de,q]=a.useState(()=>new Set),Q=!n||i;a.useEffect(()=>{q(new Set)},[f]),a.useEffect(()=>{n&&!o&&!i&&q(new Set)},[n,o,i]);const Y=qe=>S.scalingValue(qe,n??!1),_e=Math.max(T,Hn),Ce=Math.max(ue,Hn),ke=Math.max(A,Hn),ce=Math.max(ne,Hn),ge=Math.max(J,Hn),we=Math.max(ve,Hn),z=Math.max(Ee,Hn),le=Math.max(0,(c??1)-v-m),he=Math.max(0,(c??1)-J),xe=Math.max(0,(c??1)-ne),Re=Math.max(v,Hn),Te=Math.max(0,(c??1)-T-m),_=a.useMemo(()=>de.size===0?0:Math.min(...de),[de]),pe=a.useCallback(qe=>de.has(qe),[de]),te=Q&&w==="default"?`${l}-entry-hover-default`:"",N=h??"",ee=N!=="",Ie=M.replace(/^rotate /,""),re=`${l}-icon-anim-${Ie}`,O=on(Ut(al(x,W,E,Z,P,U,V,R),n)),Ve=on(Ut(al(G,ie,$,I,D,se,oe,L),n)),Oe=ol(E,Z,`${l}-question`,`${l}-text-tight-leading`),lt=ol($,I,`${l}-answer-text`,`${l}-text-tight-leading`),tt=rl(E,Z,l,n),ht=rl($,I,l,n),nt=S.buildColorVars(l,{questionColor:R,answerColor:L,dividerColor:X,iconColor:F,questionHoverColor:B,iconHoverColor:k,iconActiveColor:C,dividerHoverColor:j},wf,Sf),Be=s&&s!=="default"?`${l}-state-${s}`:"",ye=a.useCallback(qe=>{Q&&q(Se=>{if(Se.has(qe)){const ze=new Set(Se);return ze.delete(qe),ze}if(f==="on")return new Set([qe]);const Ne=new Set(Se);return Ne.add(qe),Ne})},[Q,f]),Pe=a.useMemo(()=>Cf(l),[l]),De={[`--${l}-divider-width`]:S.scalingValue(p,n??!1),[`--${l}-divider-style`]:b,[`--${l}-icon-max-width`]:S.scalingValue(m,n??!1),...u>0?{[`--${l}-question-min-height`]:S.scalingValue(u,n??!1)}:{}};return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Pe}}),r.jsx("div",{style:nt,children:r.jsx("div",{className:rt(`${l}-wrapper`,n&&!i&&`${l}-editor`,te,Be),style:{width:S.scalingValue(c,n??!1),maxWidth:"100%",...De},children:me.map((qe,Se)=>{var $t;const Ne=pe(Se),ze=(($t=qe.question)==null?void 0:$t.trim())??"",Xe=qe.answer,ct=((Xe==null?void 0:Xe.length)??0)>0,Je=d&&Se===_;return r.jsxs("div",{className:rt(`${l}-item`,Ne&&`${l}-item-open`),"data-faq-item":"",children:[r.jsxs("div",{className:`${l}-question-controls`,children:[Je&&r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":"questionPaddingTop","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{top:0,left:0,width:"100%",height:Y(Ce)}}),r.jsx("div",{"data-controls":"questionPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(le),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:Y(_e),height:"100%"}}),r.jsx("div",{"data-controls":"iconPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Te),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:Y(Re),height:"100%"}})]}),r.jsxs("button",{type:"button",className:`${l}-question-button`,"aria-expanded":Ne,style:{...O,...tt,paddingLeft:Y(T),paddingRight:Y(v)},onClick:()=>ye(Se),children:[ue>0&&r.jsx("span",{className:`${l}-padding-handle`,style:{height:Y(ue)},"aria-hidden":"true"}),r.jsxs("span",{className:`${l}-question-row`,children:[r.jsx("span",{className:Oe,children:ze}),ct&&(ee?r.jsx("span",{className:`${l}-icon ${l}-icon-custom ${re}`,"aria-hidden":"true",children:r.jsx(rn,{url:N,fill:`var(--${l}-icon-color)`,hoverFill:`var(--${l}-icon-hover-color, var(--${l}-icon-color))`,className:`${l}-icon-image`})}):r.jsx("span",{className:`${l}-icon ${l}-icon-default ${re}`,"aria-hidden":"true"}))]}),A>0&&r.jsx("span",{className:`${l}-padding-handle`,style:{height:Y(A)},"aria-hidden":"true"})]}),Je&&r.jsx("div",{"data-controls":"questionPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Y(ke)}})]}),ct&&Xe&&r.jsx("div",{className:`${l}-panel`,"aria-hidden":!Ne,children:r.jsx("div",{className:`${l}-panel-inner`,children:r.jsxs("div",{className:`${l}-answer-controls`,children:[Je&&Ne&&r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":"answerPaddingTop","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{top:0,left:0,width:"100%",height:Y(we)}}),r.jsx("div",{"data-controls":"answerPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(he),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:Y(ce),height:"100%"}}),r.jsx("div",{"data-controls":"answerPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(xe),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:Y(ge),height:"100%"}})]}),ve>0&&r.jsx("div",{className:`${l}-padding-handle`,style:{height:Y(ve)}}),r.jsx("div",{className:`${l}-answer`,style:{...Ve,...ht,paddingLeft:Y(ne),paddingRight:Y(J)},children:r.jsx("div",{className:lt,children:r.jsx(yi,{content:Xe})})}),Ee>0&&r.jsx("div",{className:`${l}-padding-handle`,style:{height:Y(Ee)}}),Je&&Ne&&r.jsx("div",{"data-controls":"answerPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Y(z)}})]})})})]},Se)})})})]})}const Lf=`import { useCallback, useEffect, useMemo, useState } from 'react';
12506
12508
  import cn from 'classnames';
12507
12509
  import { CommonComponentProps } from '../props';
12508
12510
  import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
@@ -12731,6 +12733,8 @@ function getCSS(P: string): string {
12731
12733
  top: 50%;
12732
12734
  left: 50%;
12733
12735
  transform: translate(-50%, -50%);
12736
+ width: 100%;
12737
+ height: 100%;
12734
12738
  transition: background-color 250ms;
12735
12739
  }
12736
12740
  .\${P}-wrapper.\${P}-entry-hover-default .\${P}-item:not(.\${P}-item-open):hover .\${P}-icon-image,
@@ -13102,8 +13106,8 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
13102
13106
  <span className={\`\${P}-icon \${P}-icon-custom \${iconAnimClass}\`} aria-hidden="true">
13103
13107
  <SvgImage
13104
13108
  url={iconSrc}
13105
- fill={iconColor}
13106
- hoverFill={iconHoverColor}
13109
+ fill={\`var(--\${P}-icon-color)\`}
13110
+ hoverFill={\`var(--\${P}-icon-hover-color, var(--\${P}-icon-color))\`}
13107
13111
  className={\`\${P}-icon-image\`}
13108
13112
  />
13109
13113
  </span>
@@ -13248,7 +13252,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
13248
13252
  </>
13249
13253
  );
13250
13254
  }
13251
- `;function On(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const sl={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Rf=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],If={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:On("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:{...sl.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:{...sl.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:On("Question Padding Left"),questionPaddingTop:On("Question Padding Top"),questionPaddingBottom:On("Question Padding Bottom"),answerPaddingLeft:On("Answer Padding Left"),answerPaddingRight:On("Answer Padding Right"),answerPaddingTop:On("Answer Padding Top"),answerPaddingBottom:On("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:[...Rf],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},Mf={element:Tf,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:If,sourceCode:Lf},Fn=e=>e.display==="cover",kr=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},ll=100,Ef=.2,cl=8,Fc=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,s]=a.useState(0),[l,d]=a.useState(!1),c=a.useRef(null),u=a.useRef(0);u.current=o;const p=a.useMemo(()=>typeof window>"u"?ll:Math.max(ll,window.innerHeight*Ef),[]),b=a.useCallback(x=>Math.max(0,1-x/(p*1.5)),[p]),w=a.useCallback(x=>Math.max(0,1-x/(p*.45)),[p]),f=a.useCallback(x=>{const W=typeof window<"u"?window.innerHeight:800,E=Math.max(.88,1-x/W*.12);return`translateY(${x}px) scale(${E})`},[]),h=a.useCallback(()=>{c.current=null},[]),m=a.useCallback(()=>{d(!0),s(0),window.setTimeout(()=>d(!1),n),h()},[n,h]),v=a.useCallback(()=>{const x=typeof window<"u"?window.innerHeight:800;d(!0),s(x),window.setTimeout(()=>{t(),h(),d(!1)},Math.min(n,200))},[n,t,h]),M=a.useCallback(x=>{!e||l||x.pointerType==="touch"&&(i!=null&&i(x.target)||(c.current={startX:x.clientX,startY:x.clientY,isLocked:null,pointerId:x.pointerId}))},[e,l,i]),R=a.useCallback(x=>{const W=c.current;if(!e||!W||x.pointerType!=="touch"||W.pointerId!==x.pointerId)return;const E=x.clientX-W.startX,Z=x.clientY-W.startY;if(W.isLocked===null){if(Math.abs(E)<cl&&Math.abs(Z)<cl)return;if(Z>0&&Z>Math.abs(E))W.isLocked=!0,x.currentTarget.setPointerCapture(x.pointerId);else{W.isLocked=!1,h();return}}if(!W.isLocked)return;x.preventDefault();const k=Math.max(0,Z);u.current=k,s(k)},[e,h]),L=a.useCallback(x=>{const W=c.current;if(!e||!W||x.pointerType!=="touch"||W.pointerId!==x.pointerId)return;const E=W.isLocked===!0;if(x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId),!E){h();return}x.clientY-W.startY>=p?v():m()},[p,v,e,h,m]),X=a.useCallback(x=>{L(x)},[L]),A=a.useCallback(x=>{L(x)},[L]),B=o>0,P=l?`transform ${n}ms ease`:"none",C=l?`opacity ${n}ms ease`:"none",j=o>0||l;return{isSwipeDragging:B,backdropStyle:{opacity:b(o),transition:C},mediaAreaStyle:{transform:f(o),transition:P,touchAction:B?"none":void 0,willChange:B?"transform":void 0},overlayContentStyle:j?{opacity:w(o),transition:C}:void 0,swipeHandlers:e?{onPointerDown:M,onPointerMove:R,onPointerUp:X,onPointerCancel:A}:{},dismissAreaStyle:e?{touchAction:B?"none":"pan-x"}:void 0}},Pf="[data-lightbox-scrollable]",Wc=()=>{a.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 l=d=>{const c=d.target;c instanceof Element&&c.closest(Pf)||d.preventDefault()};return document.addEventListener("touchmove",l,{passive:!1}),()=>{document.removeEventListener("touchmove",l),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({top:e,left:0,behavior:"instant"})}},[])},kf=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},Af=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},Ff=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},Wf=(e,t,n,{duration:i,easing:o,onComplete:s})=>{const l=e.scrollLeft,d=n-l,c=l-n,u=(h,m)=>{Af(t),e.scrollLeft=h,m&&(s==null||s())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let p=!1,b=0;const w=()=>{t.removeEventListener("transitionend",f),clearTimeout(b)},f=h=>{h.target!==t||h.propertyName!=="transform"||p||(p=!0,w(),u(n,!0))};return t.addEventListener("transitionend",f),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(),u(n,!0))},i+64),()=>{p||(p=!0,w(),u(l-Ff(t),!1))}},po=300,_f=900,Nf=1500,Hf="cubic-bezier(0.16, 1, 0.3, 1)",Of=3e3,Df=2,jf=16,zf=.05,Bf=1,Uo=.3,Vf=50,Gf=20,Si=.004,Gi=["title1","title2","title3"],qf={title1:"1",title2:"2",title3:"3"},Uf={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Kf={title1:.02,title2:.02,title3:.02},Ko=e=>`max(${e}, ${Gf}px)`,Xf=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]}},Yf=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=Xf(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Dt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Zf=e=>[Dt(e,"fontFamily"),Dt(e,"fontSettings"),{type:"row",items:[Dt(e,"fontSize"),Dt(e,"lineHeight"),Dt(e,"letterSpacing"),Dt(e,"wordSpacing")]},Dt(e,"textAlign"),Dt(e,"textAppearance")],Jf=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(Gi.map(e=>[qf[e],Zf(e)]))}),as=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((s,l)=>s+l,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:s,widths:l},d)=>{if(s<=0||d<=0)return{overflow:s,widths:[d,...l]};const c=Math.min(s,d);return{overflow:s-c,widths:[d-c,...l]}},{overflow:i-1,widths:[]});return o},_c=(e,t)=>as(e,t),Xo=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},dl=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:as(e.length,n),effective:_c(e.length,n)}},Qf=(e,t,n,i,o,s,l)=>{const d=[];return t&&d.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:o,text:t}),n&&d.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:s,text:n}),i&&d.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:l,text:i}),d},na=(e,t)=>{const n=i=>{const o=Dt(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[Uf[t]]}},ey=(e,t,n,i)=>e.slice(0,i).reduce((o,s,l)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[l]??0),0),ia=(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??Kf[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Ut(i,n)},ty=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,onClose:l})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:b,closeIcon:w,closeIconMaxWidth:f,closeIconColor:h,closeIconHoverColor:m,thumbnailTrigger:v,thumbnailVisibility:M,thumbnailObjectFit:R,thumbnailActive:L,thumbnailActiveColor:X,title1Width:A,title2Width:B,title3Width:P,title1MarginLeft:C=0,title2MarginLeft:j=0,title3MarginLeft:x=0,titleRowMarginBottom:W=0,titleHeaderLayout:E="desktop",contentMarginTop:Z,iconMarginLeft:k}=n,U=g=>S.scalingValue(g,i??!1),V=c??n.thumnailSize??.03,G=U(V),ie=U(u),$=U(p??.02),I=U(b??0),D=U(Z??0),se=Ko(D),oe=U(k??0),[T,ue]=a.useState(0),F=a.useRef(T);F.current=T;const ne=t[T],{title1:J,title2:ve,title3:Ee}=Yf(ne),me=ia("title1",na(n,"title1"),i),de=ia("title2",na(n,"title2"),i),q=ia("title3",na(n,"title3"),i),Q=E==="mobile",Y=!o&&(!i||s),_e=Y,Ce=Y,ke=Y,ce=Fn(R),ge=ce?{"--image-aspect-ratio":kr(R)}:void 0,we=!!(J||ve||Ee),z=a.useMemo(()=>Qf(e,J,ve,Ee,me,de,q),[e,T,J,ve,Ee,me,de,q]),le=a.useMemo(()=>({title1Width:A,title2Width:B,title3Width:P}),[A,B,P]),he=a.useMemo(()=>z.map(g=>le[g.widthKey]),[z,le]),xe=a.useMemo(()=>as(z.length,he),[z.length,he]),Re=a.useMemo(()=>_c(z.length,he),[z.length,he]),Te=a.useMemo(()=>z.filter(g=>g.prefix==="title1"),[z]),_=a.useMemo(()=>z.filter(g=>g.prefix==="title2"||g.prefix==="title3"),[z]),pe=a.useMemo(()=>dl(Te,le),[Te,le]),te=a.useMemo(()=>dl(_,le),[_,le]),N=a.useCallback((g,H)=>{const K=z.indexOf(g);if(!Q||H==="single-row")return{effectiveWidth:Re[K]??0,resolvedWidth:xe[K]??0,maxWidth:Xo(K,xe)};if(H==="two-row-top"){const Ae=Te.indexOf(g);return{effectiveWidth:pe.effective[Ae]??0,resolvedWidth:pe.resolved[Ae]??0,maxWidth:Xo(Ae,pe.resolved)}}const be=_.indexOf(g);return{effectiveWidth:te.effective[be]??0,resolvedWidth:te.resolved[be]??0,maxWidth:Xo(be,te.resolved)}},[_,te,Re,xe,z,Te,pe,Q]),ee=a.useCallback(g=>S.scalingValue(g,i??!1),[i]),Ie=ee(W??0),re=a.useMemo(()=>({title1MarginLeft:C,title2MarginLeft:j,title3MarginLeft:x}),[C,j,x]),O=a.useCallback(g=>z.slice(0,g+1).reduce((H,K,be)=>H+(K!=null&&K.marginLeftKey?re[K.marginLeftKey]??0:0)+(xe[be]??0),0)+(Q?0:C??0),[z,re,xe,Q,C]),Ve=a.useCallback(()=>Q?0:C??0,[Q,C]),Oe=a.useCallback(g=>_.slice(0,g).reduce((H,K,be)=>H+(K.marginLeftKey?re[K.marginLeftKey]??0:0)+(te.resolved[be]??0),0),[_,te.resolved,re]),lt=a.useCallback(g=>{const H=_[g];return Oe(g)+(H.marginLeftKey?re[H.marginLeftKey]??0:0)+(te.resolved[g]??0)},[_,te.resolved,Oe,re]),tt=(g,H)=>{const K=g.marginLeftKey?re[g.marginLeftKey]??0:0,{effectiveWidth:be,resolvedWidth:Ae,maxWidth:Ue}=N(g,H),yt=o&&H==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":g.prefix,style:{...H==="single-row"?{gridArea:g.prefix}:{},width:ee(be),...K>0?{marginLeft:ee(K)}:{}},children:[r.jsx("p",{className:g.className,style:g.style,children:g.text}),yt&&g.marginLeftKey&&r.jsx("div",{"data-controls":g.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ae),style:{position:"absolute",top:0,left:ee(-K),width:`max(${ee(K)}, 10px)`,height:"100%",pointerEvents:"auto"}}),yt&&r.jsx("div",{"data-controls":g.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ue),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:ee(-Si/2),width:ee(Si),height:"100%",pointerEvents:"auto"}})]},g.className)},ht=()=>{const g=Q?-1:z.findIndex(be=>be.prefix==="title1"),H=!Q&&(o||(C??0)>0)?(()=>{const be=C??0,Ae=g>=0?xe[g]:A??0;return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ae),style:{position:"absolute",top:0,left:0,width:`max(${ee(be)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,K=z.flatMap((be,Ae)=>{if(!be.marginLeftKey)return[];const Ue=re[be.marginLeftKey]??0,yt=ey(z,xe,re,Ae)+Ve();return r.jsx("div",{"data-controls":be.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(xe[Ae]),style:{position:"absolute",top:0,left:ee(yt),width:`max(${ee(Ue)}, 10px)`,height:"100%",pointerEvents:"auto"}},be.marginLeftKey)});return H?[H,...K]:K},nt=()=>z.map((g,H)=>{const K=Xo(H,xe),Ae=O(H)-Si/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":g.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(K),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:ee(Ae),width:ee(Si),height:"100%",pointerEvents:"auto"}})},`${g.widthKey}-junction`)}),Be=()=>_.flatMap((g,H)=>{if(!g.marginLeftKey)return[];const K=re[g.marginLeftKey]??0,be=Oe(H),{resolvedWidth:Ae}=N(g,"two-row-bottom");return r.jsx("div",{"data-controls":g.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ae),style:{position:"absolute",top:0,left:ee(be),width:`max(${ee(K)}, 10px)`,height:"100%",pointerEvents:"auto"}},g.marginLeftKey)}),ye=()=>_.map((g,H)=>{const{maxWidth:K}=N(g,"two-row-bottom"),Ae=lt(H)-Si/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":g.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(K),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:ee(Ae),width:ee(Si),height:"100%",pointerEvents:"auto"}})},`${g.widthKey}-junction`)}),Pe=a.useRef(null),De=a.useRef(null),qe=a.useRef(null),Se=a.useRef(null),Ne=a.useRef([]),ze=a.useRef([]),Xe=a.useRef(0),ct=a.useRef(null),Je=a.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),$t=a.useRef(null),dt=a.useRef(null),Fe=a.useRef(0),Ke=a.useRef("forward"),je=a.useRef(0),ut=a.useRef(null),pt=a.useRef(!1),mt=t.length>1&&(!o||!!s),kt=mt?3:1,Xt=a.useMemo(()=>Array.from({length:kt},()=>t).flat(),[t,kt]),[Yt,vt]=a.useState(!1),[bt,Gt]=a.useState(!1),[Ft,xt]=a.useState(!0),Ht=a.useRef(null),qt=a.useRef(null),Zt=a.useRef(!1),tn=a.useRef(!1),Ct=a.useRef(null),jt=a.useRef(null),cn=_e&&!Ft,at=a.useCallback(()=>{_e&&(xt(!0),jt.current&&clearTimeout(jt.current),jt.current=setTimeout(()=>{Je.current.isActive||xt(!1)},Of))},[_e]),$e=a.useCallback(()=>{o||tn.current||(tn.current=!0,Gt(!1),Ct.current=setTimeout(()=>{l()},po))},[o,l]),We=()=>r.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":cn?"true":"false",style:{width:S.scalingValue(f??0,i),height:S.scalingValue(f??0,i),marginRight:oe,"--close-icon-hover-color":m},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:$e,"aria-label":"Close",children:r.jsx(rn,{url:w,fill:h,hoverFill:i&&!s?h:m,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:oe,height:"100%",pointerEvents:"auto"}})]}),Qe=(g="two-row")=>r.jsx("div",{...g==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:ee(C??0),flexShrink:0,...g==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...g==="two-row"&&o?{pointerEvents:"auto"}:{}}}),st=()=>{const g=z.find(be=>be.prefix==="title1"),H=z.filter(be=>be.prefix==="title2"||be.prefix==="title3"),K=H.length>0||o||(W??0)>0;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${e}-header-row-top`,children:[(C??0)>0||o?Qe():null,g&&tt(g,"two-row-top"),w&&We()]}),K?r.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[H.length>0?r.jsxs("div",{className:`${e}-header-row-bottom`,children:[H.map(be=>tt(be,"two-row-bottom")),o&&r.jsxs(r.Fragment,{children:[Be(),ye()]})]}):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:Ie,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},gt=()=>r.jsxs(r.Fragment,{children:[(C??0)>0||o?Qe("single-row"):null,z.map(g=>tt(g,"single-row")),o?r.jsxs(r.Fragment,{children:[ht(),nt()]}):null,w?We():null]}),Rt=a.useCallback(g=>!!(g.closest("[data-controls]")||g.closest(`.${e}-thumbnails`)||g.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:ot,backdropStyle:Ot,mediaAreaStyle:Pt,overlayContentStyle:Et,swipeHandlers:zt,dismissAreaStyle:Bt}=Fc({enabled:Y??!1,onClose:$e,animMs:po,isBlockedTarget:Rt}),Wt=()=>{if(!mt||t.length===0)return Xe.current=0,0;const g=ze.current[0],H=ze.current[t.length];if(!g||!H)return Xe.current;const K=H.offsetLeft-g.offsetLeft;return K>0&&(Xe.current=K),Xe.current},_t=(g=!1)=>{if(!mt)return;const H=De.current,K=Wt();!H||K<=0||K<H.clientWidth*.25||(H.scrollLeft<=0?(H.scrollLeft+=K,g&&(Je.current.scrollLeft+=K),pt.current&&(je.current+=K)):H.scrollLeft>=K*2&&(H.scrollLeft-=K,g&&(Je.current.scrollLeft-=K),pt.current&&(je.current-=K)))},At=(g,H=(K=>(K=De.current)==null?void 0:K.scrollLeft)()??0)=>{if(!mt)return g;let be=t.length+g,Ae=1/0;for(let Ue=0;Ue<kt;Ue++){const yt=Ue*t.length+g,Lt=ze.current[yt];if(!Lt)continue;const en=Math.abs(Lt.offsetLeft-H);en<Ae&&(Ae=en,be=yt)}return be},wt=g=>{const H=De.current;return!g||!H?!1:g.offsetWidth>H.clientWidth+1},y=g=>{const H=De.current;if(!g||!H||!wt(g))return!1;const K=g.offsetLeft,be=K+g.offsetWidth;return H.scrollLeft>=K-1&&H.scrollLeft+H.clientWidth<=be+1},fe=(g=(H=>(H=De.current)==null?void 0:H.scrollLeft)()??0)=>{for(let be=0;be<ze.current.length;be+=1){const Ae=ze.current[be];if(Ae&&y(Ae))return be}let K={flatIndex:0,distance:1/0};return ze.current.forEach((be,Ae)=>{if(!be)return;const Ue=Math.abs(be.offsetLeft-g);Ue<K.distance&&(K={flatIndex:Ae,distance:Ue})}),K.flatIndex},Le=g=>{De.current&&ze.current.forEach(H=>{H&&(H.style.scrollSnapAlign=wt(H)&&g==="backward"?"end":"start")})},Me=(g,H,K)=>{const be=g-H,Ae=fe(H),Ue=ze.current[Ae];if(y(Ue))return fe(g)%t.length;const yt=ze.current[Ae+1],Lt=Ue?yt?yt.offsetLeft-Ue.offsetLeft:Ue.offsetWidth:0,en=Lt>0?be>Lt*Uo?1:be<-Lt*Uo?-1:0:0;return en===0?K:mt?(K+en+t.length)%t.length:Math.max(0,Math.min(t.length-1,K+en))},et=a.useCallback((g=!1)=>{if(M!=="on"||o)return;const H=Se.current,K=F.current,be=Ne.current[K];if(!H||!be||H.scrollWidth<=H.clientWidth)return;const Ae=H.scrollLeft,Ue=Ae+H.clientWidth,yt=be.offsetLeft,Lt=yt+be.offsetWidth;if(yt>=Ae&&Lt<=Ue)return;const en=H.scrollWidth-H.clientWidth;let Jt=Ae;if(!g&&Ht.current===null){const bi=Ne.current[K-1],Qi=Ne.current[K+1],No=bi?be.offsetLeft-bi.offsetLeft:Qi?Qi.offsetLeft-be.offsetLeft:be.offsetWidth;Lt>Ue?Jt+=No:yt<Ae&&(Jt-=No)}else Lt>Ue?Jt=Lt-H.clientWidth:Jt=yt;H.scrollLeft=Math.max(0,Math.min(en,Jt))},[o,M]),Mt=a.useCallback((g=!1)=>{g&&(Zt.current=!0),qt.current===null&&(qt.current=requestAnimationFrame(()=>{qt.current=null;const H=Zt.current;Zt.current=!1,et(H)}))},[et]),Ye=a.useCallback(g=>{if(g===F.current)return;const H=F.current;F.current=g;const K=Math.abs(g-H)>1,be=mt&&t.length>1&&(H===t.length-1&&g===0||H===0&&g===t.length-1);ue(g),Mt(K||be)},[t.length,mt,Mt]),ft=()=>{if(!De.current||t.length===0||Ht.current!==null||Je.current.isActive&&Je.current.hasMoved)return;const g=De.current.scrollLeft,H=fe(g)%t.length;H!==F.current&&Ye(H)},Nt=()=>{Ht.current=null},Tt=g=>{const H=De.current;H&&(H.style.scrollSnapType=g?"":"none")},nn=()=>{var g;(g=dt.current)==null||g.call(dt),dt.current=null},dn=()=>{ut.current!==null&&(cancelAnimationFrame(ut.current),ut.current=null),pt.current=!1},ei=()=>{const g=De.current;if(!g){ut.current=null,pt.current=!1;return}const H=je.current-g.scrollLeft;if(Math.abs(H)<.5){g.scrollLeft=je.current,_t(),ft(),ut.current=null,pt.current=!1;return}g.scrollLeft+=H*zf,_t(),ft(),at(),ut.current=requestAnimationFrame(ei)},ti=()=>{const g=qe.current;g&&(g.style.transition="",g.style.transform="",g.style.willChange="")},Ao=(g,H,K,be)=>{ti(),g.scrollLeft=H,Fe.current=g.scrollLeft,_t(),K!==void 0?(F.current=K,ue(K)):ft(),Tt(!0),be==null||be()},Fo=(g,{behavior:H="smooth",activeIndex:K,onComplete:be}={})=>{const Ae=De.current,Ue=qe.current;if(!Ae||!Ue)return;if(dn(),nn(),Tt(!1),H==="auto"){Ao(Ae,g,K,be);return}const yt=Math.abs(g-Ae.scrollLeft),Lt=kf(yt,_f,Nf,Ae.clientWidth*.55);dt.current=Wf(Ae,Ue,g,{duration:Lt,easing:Hf,onComplete:()=>{dt.current=null,Ao(Ae,g,K,be)}})},Fr=(g="smooth")=>{const H=De.current;if(!H||t.length===0)return;const K=fe()%t.length,be=At(K,H.scrollLeft),Ae=ze.current[be];Ae&&Fo(Ae.offsetLeft,{behavior:g,activeIndex:K})},Wr=(g,H="smooth",K,be)=>{const Ae=De.current;if(!Ae||t.length===0)return;const Ue=(be??Ae.scrollLeft)-g,yt=fe(g),Lt=ze.current[yt];if(y(Lt)){Tt(!0),ft();return}const en=ze.current[yt+1],Jt=Lt?en?en.offsetLeft-Lt.offsetLeft:Lt.offsetWidth:0;if((Jt>0?Ue>Jt*Uo?1:Ue<-Jt*Uo?-1:0:0)!==0){const Bc=K??yt%t.length,Vc=Me(be??Ae.scrollLeft,g,Bc);Sn(Vc,H);return}const Qi=be??Ae.scrollLeft,No=fe(Qi),ss=ze.current[No];if(ss&&Math.abs(ss.offsetLeft-Qi)<1){Tt(!0),ft();return}Fr("auto")},Sn=(g,H="smooth")=>{const K=De.current;if(!K||t.length===0)return;const be=At(g,K.scrollLeft),Ae=ze.current[be];Ae&&(H==="smooth"?Ht.current=g:Ht.current=null,F.current=g,ue(g),Mt(!0),Fo(Ae.offsetLeft,{behavior:H,activeIndex:g,onComplete:H==="smooth"?Nt:void 0}))},xi=()=>{$t.current&&(window.removeEventListener("pointerup",$t.current),window.removeEventListener("pointercancel",$t.current),$t.current=null)},Wo=(g,H,K,be,Ae)=>{const Ue=K-g,yt=be-H,Lt=Math.abs(Ue),en=Math.abs(yt);if(Lt<Vf||Lt<=en)return!1;const Jt=Ue<0?1:-1,bi=mt?(Ae+Jt+t.length)%t.length:Math.max(0,Math.min(t.length-1,Ae+Jt));return bi===Ae?!1:(Sn(bi),!0)},ni=g=>{if(!Je.current.isActive)return;xi();const H=De.current;if(!H)return;const{scrollLeft:K,startActiveIndex:be,hasMoved:Ae}=Je.current,Ue=H.scrollLeft;_t(!0),Je.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},vt(!1),g!==void 0&&H.hasPointerCapture(g)&&H.releasePointerCapture(g),Ae?Wr(K,"smooth",be,Ue):(Tt(!0),ft()),at()},_o=(g,H)=>{const K=ct.current;ct.current=null,K&&(Wo(K.startX,K.startY,g,H,K.startActiveIndex),at())},_r=g=>{if(!Ce)return;if(g.pointerType==="touch"){if(dn(),Tt(!0),Rt(g.target))return;ct.current={startX:g.clientX,startY:g.clientY,startActiveIndex:F.current};return}if(g.pointerType!=="mouse"||g.button!==0||Rt(g.target))return;const H=De.current;if(!H)return;dn(),nn(),ti(),Ht.current=null,Je.current={isActive:!0,startX:g.clientX,scrollLeft:H.scrollLeft,startActiveIndex:F.current,hasMoved:!1},Tt(!1),at(),H.setPointerCapture(g.pointerId),xi();const K=be=>{be.pointerType==="mouse"&&ni(be.pointerId)};$t.current=K,window.addEventListener("pointerup",K),window.addEventListener("pointercancel",K)},Nr=g=>{if(!Ce||g.pointerType!=="mouse")return;const H=De.current;if(!H||!Je.current.isActive)return;if(g.buttons===0){ni(g.pointerId);return}const K=g.clientX-Je.current.startX;Math.abs(K)>Bf&&(Je.current.hasMoved=!0,vt(!0)),Je.current.hasMoved&&(g.preventDefault(),H.scrollLeft=Je.current.scrollLeft-K,_t(!0),ft(),at())},ae=g=>{if(Ce){if(g.pointerType==="touch"){g.type==="pointerup"?_o(g.clientX,g.clientY):ct.current=null;return}g.pointerType==="mouse"&&ni(g.pointerId)}},He=g=>{!Ce||g.pointerType!=="mouse"||ni(g.pointerId)};return Wc(),a.useEffect(()=>{const g=requestAnimationFrame(()=>Gt(!0));return()=>{cancelAnimationFrame(g),nn(),xi(),qt.current!==null&&(cancelAnimationFrame(qt.current),qt.current=null),Ct.current&&clearTimeout(Ct.current),jt.current&&clearTimeout(jt.current)}},[]),a.useEffect(()=>{if(!_e){xt(!0);return}at();const g=Pe.current;if(!g)return;const H=()=>at();return g.addEventListener("pointermove",H),g.addEventListener("pointerdown",H),()=>{g.removeEventListener("pointermove",H),g.removeEventListener("pointerdown",H),jt.current&&clearTimeout(jt.current)}},[_e,at]),a.useEffect(()=>{const g=H=>{H.key==="Escape"&&$e()};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[$e]),a.useLayoutEffect(()=>{Wt()},[I,t.length,mt]),a.useLayoutEffect(()=>{o||Sn(F.current,"auto")},[I,o]),a.useLayoutEffect(()=>{Sn(0,"auto")},[t.length,mt]),a.useEffect(()=>{const g=De.current;if(!g||o||!Y)return;const H=K=>{if(K.preventDefault(),Math.abs(K.deltaY)<=Math.abs(K.deltaX))return;const be=K.deltaMode===1?jf:K.deltaMode===2?g.clientHeight:1,Ae=K.deltaY*be*Df;if(Ae!==0){if(nn(),pt.current||(pt.current=!0,je.current=g.scrollLeft,Ht.current=null,Tt(!1)),je.current+=Ae,!mt){const Ue=g.scrollWidth-g.clientWidth;je.current=Math.max(0,Math.min(Ue,je.current))}at(),ut.current===null&&(ut.current=requestAnimationFrame(ei))}};return g.addEventListener("wheel",H,{passive:!1}),()=>{g.removeEventListener("wheel",H),dn()}},[o,Y,mt]),a.useEffect(()=>{const g=De.current;if(!g)return;const H=()=>{_t(Je.current.isActive);const be=g.scrollLeft,Ae=be-Fe.current;Fe.current=be;const Ue=Xe.current>0?Xe.current*.5:1/0;if(Ae!==0&&Math.abs(Ae)<Ue){const yt=Ae>0?"forward":"backward";yt!==Ke.current&&(Ke.current=yt,Le(yt))}Je.current.isActive&&Je.current.hasMoved||ft()};g.addEventListener("scroll",H,{passive:!0});const K=new ResizeObserver(()=>{Wt(),_t(Je.current.isActive),Le(Ke.current),ft()});return K.observe(g),()=>{nn(),g.removeEventListener("scroll",H),K.disconnect()}},[t.length,mt]),r.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{ot||$e()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:bt?1:0,transition:`opacity ${po}ms ease`,pointerEvents:bt?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...Ot}}),r.jsxs("div",{ref:Pe,className:`${e}-lightbox-dismiss-area`,style:Bt,...zt,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:Pt,onClick:g=>g.stopPropagation(),children:r.jsx("div",{ref:De,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":Ce&&t.length>0?"true":"false","data-mouse-dragging":Yt?"true":"false",onPointerDown:_r,onPointerMove:Nr,onPointerUp:ae,onPointerCancel:ae,onLostPointerCapture:He,children:r.jsx("div",{ref:qe,className:`${e}-lightbox-strip-track`,style:{gap:I},children:Xt.map((g,H)=>{const K=g.image.objectFit??"contain",be=H%t.length,Ae=Math.floor(H/t.length),Ue=Ko(I),yt=`calc(-0.5 * (${Ue} + ${I}))`;return r.jsxs("div",{ref:Lt=>ze.current[H]=Lt,className:`${e}-strip-item`,style:{height:E==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[r.jsx("img",{src:g.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:K}}),o&&be<t.length-1&&Ae===0&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:yt,width:Ue,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Ae}-${g.image.url}-${be}`)})})})}),r.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":cn?"true":"false",style:Et,children:[r.jsx("div",{style:{position:"relative",width:"100%",height:D,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:se,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${Q?` ${e}-lightbox-content-area-stacked`:""}`,children:(we||w)&&r.jsx("div",{className:`${e}-header ${Q?`${e}-header-two-row`:`${e}-header-single-row`}`,children:Q?st():we||w?gt():null})})})]}),t.length>1&&M==="on"&&(()=>{const g=Ko($),H=`calc(-0.5 * (${$} + ${g}))`;return r.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:$},children:r.jsx("div",{ref:Se,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:K=>K.stopPropagation(),children:r.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":L,style:{gap:ie,"--thumbnail-active-color":X},children:[t.map((K,be)=>{const Ae=Ko(ie),Ue=`calc(-0.5 * (${Ae} + ${ie}))`;return r.jsxs("div",{ref:yt=>{Ne.current[be]=yt},style:{position:"relative",flex:"0 0 auto"},children:[r.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":T===be?"true":"false",onClick:()=>Y&&v==="click"&&Sn(be),onMouseEnter:()=>ke&&v==="hover"&&Sn(be),"aria-label":K.image.name?`View ${K.image.name}`:`View image ${be+1}`,"aria-current":T===be?"true":void 0,children:r.jsx("img",{className:`${e}-thumb-image${ce?` ${e}-thumb-image-cover`:""}`,src:K.image.url,alt:"",draggable:!1,style:{...ge,maxWidth:G,maxHeight:G,width:R.display==="cover"?"auto":"100%",height:"auto",objectFit:R.display==="cover"?"cover":"contain"}})}),o&&be<t.length-1&&r.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Ue,width:Ae,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${K.image.url}-${be}`)}),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:g,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function ny(e){return`
13255
+ `;function On(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const sl={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Rf=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],If={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:On("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:{...sl.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:{...sl.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:On("Question Padding Left"),questionPaddingTop:On("Question Padding Top"),questionPaddingBottom:On("Question Padding Bottom"),answerPaddingLeft:On("Answer Padding Left"),answerPaddingRight:On("Answer Padding Right"),answerPaddingTop:On("Answer Padding Top"),answerPaddingBottom:On("Answer Padding Bottom")},defaults:{dividerStyle:"dotted",entryHoverEffect:"default",autoclose:"off",icon:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01M0GB8Z9EQFMGYA20F2J0ACA8.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:[...Rf],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},Mf={element:Tf,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:If,sourceCode:Lf},Fn=e=>e.display==="cover",kr=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},ll=100,Ef=.2,cl=8,Fc=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,s]=a.useState(0),[l,d]=a.useState(!1),c=a.useRef(null),u=a.useRef(0);u.current=o;const p=a.useMemo(()=>typeof window>"u"?ll:Math.max(ll,window.innerHeight*Ef),[]),b=a.useCallback(x=>Math.max(0,1-x/(p*1.5)),[p]),w=a.useCallback(x=>Math.max(0,1-x/(p*.45)),[p]),f=a.useCallback(x=>{const W=typeof window<"u"?window.innerHeight:800,E=Math.max(.88,1-x/W*.12);return`translateY(${x}px) scale(${E})`},[]),h=a.useCallback(()=>{c.current=null},[]),m=a.useCallback(()=>{d(!0),s(0),window.setTimeout(()=>d(!1),n),h()},[n,h]),v=a.useCallback(()=>{const x=typeof window<"u"?window.innerHeight:800;d(!0),s(x),window.setTimeout(()=>{t(),h(),d(!1)},Math.min(n,200))},[n,t,h]),M=a.useCallback(x=>{!e||l||x.pointerType==="touch"&&(i!=null&&i(x.target)||(c.current={startX:x.clientX,startY:x.clientY,isLocked:null,pointerId:x.pointerId}))},[e,l,i]),R=a.useCallback(x=>{const W=c.current;if(!e||!W||x.pointerType!=="touch"||W.pointerId!==x.pointerId)return;const E=x.clientX-W.startX,Z=x.clientY-W.startY;if(W.isLocked===null){if(Math.abs(E)<cl&&Math.abs(Z)<cl)return;if(Z>0&&Z>Math.abs(E))W.isLocked=!0,x.currentTarget.setPointerCapture(x.pointerId);else{W.isLocked=!1,h();return}}if(!W.isLocked)return;x.preventDefault();const P=Math.max(0,Z);u.current=P,s(P)},[e,h]),L=a.useCallback(x=>{const W=c.current;if(!e||!W||x.pointerType!=="touch"||W.pointerId!==x.pointerId)return;const E=W.isLocked===!0;if(x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId),!E){h();return}x.clientY-W.startY>=p?v():m()},[p,v,e,h,m]),X=a.useCallback(x=>{L(x)},[L]),F=a.useCallback(x=>{L(x)},[L]),B=o>0,k=l?`transform ${n}ms ease`:"none",C=l?`opacity ${n}ms ease`:"none",j=o>0||l;return{isSwipeDragging:B,backdropStyle:{opacity:b(o),transition:C},mediaAreaStyle:{transform:f(o),transition:k,touchAction:B?"none":void 0,willChange:B?"transform":void 0},overlayContentStyle:j?{opacity:w(o),transition:C}:void 0,swipeHandlers:e?{onPointerDown:M,onPointerMove:R,onPointerUp:X,onPointerCancel:F}:{},dismissAreaStyle:e?{touchAction:B?"none":"pan-x"}:void 0}},Pf="[data-lightbox-scrollable]",Wc=()=>{a.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 l=d=>{const c=d.target;c instanceof Element&&c.closest(Pf)||d.preventDefault()};return document.addEventListener("touchmove",l,{passive:!1}),()=>{document.removeEventListener("touchmove",l),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({top:e,left:0,behavior:"instant"})}},[])},kf=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},Af=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},Ff=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},Wf=(e,t,n,{duration:i,easing:o,onComplete:s})=>{const l=e.scrollLeft,d=n-l,c=l-n,u=(h,m)=>{Af(t),e.scrollLeft=h,m&&(s==null||s())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let p=!1,b=0;const w=()=>{t.removeEventListener("transitionend",f),clearTimeout(b)},f=h=>{h.target!==t||h.propertyName!=="transform"||p||(p=!0,w(),u(n,!0))};return t.addEventListener("transitionend",f),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(),u(n,!0))},i+64),()=>{p||(p=!0,w(),u(l-Ff(t),!1))}},po=300,_f=900,Nf=1500,Hf="cubic-bezier(0.16, 1, 0.3, 1)",Of=3e3,Df=2,jf=16,zf=.05,Bf=1,Uo=.3,Vf=50,Gf=20,Si=.004,Gi=["title1","title2","title3"],qf={title1:"1",title2:"2",title3:"3"},Uf={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Kf={title1:.02,title2:.02,title3:.02},Ko=e=>`max(${e}, ${Gf}px)`,Xf=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]}},Yf=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=Xf(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Dt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Zf=e=>[Dt(e,"fontFamily"),Dt(e,"fontSettings"),{type:"row",items:[Dt(e,"fontSize"),Dt(e,"lineHeight"),Dt(e,"letterSpacing"),Dt(e,"wordSpacing")]},Dt(e,"textAlign"),Dt(e,"textAppearance")],Jf=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(Gi.map(e=>[qf[e],Zf(e)]))}),as=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((s,l)=>s+l,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:s,widths:l},d)=>{if(s<=0||d<=0)return{overflow:s,widths:[d,...l]};const c=Math.min(s,d);return{overflow:s-c,widths:[d-c,...l]}},{overflow:i-1,widths:[]});return o},_c=(e,t)=>as(e,t),Xo=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},dl=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:as(e.length,n),effective:_c(e.length,n)}},Qf=(e,t,n,i,o,s,l)=>{const d=[];return t&&d.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:o,text:t}),n&&d.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:s,text:n}),i&&d.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:l,text:i}),d},na=(e,t)=>{const n=i=>{const o=Dt(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[Uf[t]]}},ey=(e,t,n,i)=>e.slice(0,i).reduce((o,s,l)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[l]??0),0),ia=(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??Kf[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Ut(i,n)},ty=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,onClose:l})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:b,closeIcon:w,closeIconMaxWidth:f,closeIconColor:h,closeIconHoverColor:m,thumbnailTrigger:v,thumbnailVisibility:M,thumbnailObjectFit:R,thumbnailActive:L,thumbnailActiveColor:X,title1Width:F,title2Width:B,title3Width:k,title1MarginLeft:C=0,title2MarginLeft:j=0,title3MarginLeft:x=0,titleRowMarginBottom:W=0,titleHeaderLayout:E="desktop",contentMarginTop:Z,iconMarginLeft:P}=n,U=g=>S.scalingValue(g,i??!1),V=c??n.thumnailSize??.03,G=U(V),ie=U(u),$=U(p??.02),I=U(b??0),D=U(Z??0),se=Ko(D),oe=U(P??0),[T,ue]=a.useState(0),A=a.useRef(T);A.current=T;const ne=t[T],{title1:J,title2:ve,title3:Ee}=Yf(ne),me=ia("title1",na(n,"title1"),i),de=ia("title2",na(n,"title2"),i),q=ia("title3",na(n,"title3"),i),Q=E==="mobile",Y=!o&&(!i||s),_e=Y,Ce=Y,ke=Y,ce=Fn(R),ge=ce?{"--image-aspect-ratio":kr(R)}:void 0,we=!!(J||ve||Ee),z=a.useMemo(()=>Qf(e,J,ve,Ee,me,de,q),[e,T,J,ve,Ee,me,de,q]),le=a.useMemo(()=>({title1Width:F,title2Width:B,title3Width:k}),[F,B,k]),he=a.useMemo(()=>z.map(g=>le[g.widthKey]),[z,le]),xe=a.useMemo(()=>as(z.length,he),[z.length,he]),Re=a.useMemo(()=>_c(z.length,he),[z.length,he]),Te=a.useMemo(()=>z.filter(g=>g.prefix==="title1"),[z]),_=a.useMemo(()=>z.filter(g=>g.prefix==="title2"||g.prefix==="title3"),[z]),pe=a.useMemo(()=>dl(Te,le),[Te,le]),te=a.useMemo(()=>dl(_,le),[_,le]),N=a.useCallback((g,H)=>{const K=z.indexOf(g);if(!Q||H==="single-row")return{effectiveWidth:Re[K]??0,resolvedWidth:xe[K]??0,maxWidth:Xo(K,xe)};if(H==="two-row-top"){const Ae=Te.indexOf(g);return{effectiveWidth:pe.effective[Ae]??0,resolvedWidth:pe.resolved[Ae]??0,maxWidth:Xo(Ae,pe.resolved)}}const be=_.indexOf(g);return{effectiveWidth:te.effective[be]??0,resolvedWidth:te.resolved[be]??0,maxWidth:Xo(be,te.resolved)}},[_,te,Re,xe,z,Te,pe,Q]),ee=a.useCallback(g=>S.scalingValue(g,i??!1),[i]),Ie=ee(W??0),re=a.useMemo(()=>({title1MarginLeft:C,title2MarginLeft:j,title3MarginLeft:x}),[C,j,x]),O=a.useCallback(g=>z.slice(0,g+1).reduce((H,K,be)=>H+(K!=null&&K.marginLeftKey?re[K.marginLeftKey]??0:0)+(xe[be]??0),0)+(Q?0:C??0),[z,re,xe,Q,C]),Ve=a.useCallback(()=>Q?0:C??0,[Q,C]),Oe=a.useCallback(g=>_.slice(0,g).reduce((H,K,be)=>H+(K.marginLeftKey?re[K.marginLeftKey]??0:0)+(te.resolved[be]??0),0),[_,te.resolved,re]),lt=a.useCallback(g=>{const H=_[g];return Oe(g)+(H.marginLeftKey?re[H.marginLeftKey]??0:0)+(te.resolved[g]??0)},[_,te.resolved,Oe,re]),tt=(g,H)=>{const K=g.marginLeftKey?re[g.marginLeftKey]??0:0,{effectiveWidth:be,resolvedWidth:Ae,maxWidth:Ue}=N(g,H),yt=o&&H==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":g.prefix,style:{...H==="single-row"?{gridArea:g.prefix}:{},width:ee(be),...K>0?{marginLeft:ee(K)}:{}},children:[r.jsx("p",{className:g.className,style:g.style,children:g.text}),yt&&g.marginLeftKey&&r.jsx("div",{"data-controls":g.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ae),style:{position:"absolute",top:0,left:ee(-K),width:`max(${ee(K)}, 10px)`,height:"100%",pointerEvents:"auto"}}),yt&&r.jsx("div",{"data-controls":g.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ue),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:ee(-Si/2),width:ee(Si),height:"100%",pointerEvents:"auto"}})]},g.className)},ht=()=>{const g=Q?-1:z.findIndex(be=>be.prefix==="title1"),H=!Q&&(o||(C??0)>0)?(()=>{const be=C??0,Ae=g>=0?xe[g]:F??0;return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ae),style:{position:"absolute",top:0,left:0,width:`max(${ee(be)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,K=z.flatMap((be,Ae)=>{if(!be.marginLeftKey)return[];const Ue=re[be.marginLeftKey]??0,yt=ey(z,xe,re,Ae)+Ve();return r.jsx("div",{"data-controls":be.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(xe[Ae]),style:{position:"absolute",top:0,left:ee(yt),width:`max(${ee(Ue)}, 10px)`,height:"100%",pointerEvents:"auto"}},be.marginLeftKey)});return H?[H,...K]:K},nt=()=>z.map((g,H)=>{const K=Xo(H,xe),Ae=O(H)-Si/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":g.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(K),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:ee(Ae),width:ee(Si),height:"100%",pointerEvents:"auto"}})},`${g.widthKey}-junction`)}),Be=()=>_.flatMap((g,H)=>{if(!g.marginLeftKey)return[];const K=re[g.marginLeftKey]??0,be=Oe(H),{resolvedWidth:Ae}=N(g,"two-row-bottom");return r.jsx("div",{"data-controls":g.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ae),style:{position:"absolute",top:0,left:ee(be),width:`max(${ee(K)}, 10px)`,height:"100%",pointerEvents:"auto"}},g.marginLeftKey)}),ye=()=>_.map((g,H)=>{const{maxWidth:K}=N(g,"two-row-bottom"),Ae=lt(H)-Si/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":g.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(K),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:ee(Ae),width:ee(Si),height:"100%",pointerEvents:"auto"}})},`${g.widthKey}-junction`)}),Pe=a.useRef(null),De=a.useRef(null),qe=a.useRef(null),Se=a.useRef(null),Ne=a.useRef([]),ze=a.useRef([]),Xe=a.useRef(0),ct=a.useRef(null),Je=a.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),$t=a.useRef(null),dt=a.useRef(null),Fe=a.useRef(0),Ke=a.useRef("forward"),je=a.useRef(0),ut=a.useRef(null),pt=a.useRef(!1),mt=t.length>1&&(!o||!!s),kt=mt?3:1,Xt=a.useMemo(()=>Array.from({length:kt},()=>t).flat(),[t,kt]),[Yt,vt]=a.useState(!1),[bt,Gt]=a.useState(!1),[Ft,xt]=a.useState(!0),Ht=a.useRef(null),qt=a.useRef(null),Zt=a.useRef(!1),tn=a.useRef(!1),Ct=a.useRef(null),jt=a.useRef(null),cn=_e&&!Ft,at=a.useCallback(()=>{_e&&(xt(!0),jt.current&&clearTimeout(jt.current),jt.current=setTimeout(()=>{Je.current.isActive||xt(!1)},Of))},[_e]),$e=a.useCallback(()=>{o||tn.current||(tn.current=!0,Gt(!1),Ct.current=setTimeout(()=>{l()},po))},[o,l]),We=()=>r.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":cn?"true":"false",style:{width:S.scalingValue(f??0,i),height:S.scalingValue(f??0,i),marginRight:oe,"--close-icon-hover-color":m},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:$e,"aria-label":"Close",children:r.jsx(rn,{url:w,fill:h,hoverFill:i&&!s?h:m,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:oe,height:"100%",pointerEvents:"auto"}})]}),Qe=(g="two-row")=>r.jsx("div",{...g==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:ee(C??0),flexShrink:0,...g==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...g==="two-row"&&o?{pointerEvents:"auto"}:{}}}),st=()=>{const g=z.find(be=>be.prefix==="title1"),H=z.filter(be=>be.prefix==="title2"||be.prefix==="title3"),K=H.length>0||o||(W??0)>0;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${e}-header-row-top`,children:[(C??0)>0||o?Qe():null,g&&tt(g,"two-row-top"),w&&We()]}),K?r.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[H.length>0?r.jsxs("div",{className:`${e}-header-row-bottom`,children:[H.map(be=>tt(be,"two-row-bottom")),o&&r.jsxs(r.Fragment,{children:[Be(),ye()]})]}):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:Ie,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},gt=()=>r.jsxs(r.Fragment,{children:[(C??0)>0||o?Qe("single-row"):null,z.map(g=>tt(g,"single-row")),o?r.jsxs(r.Fragment,{children:[ht(),nt()]}):null,w?We():null]}),Rt=a.useCallback(g=>!!(g.closest("[data-controls]")||g.closest(`.${e}-thumbnails`)||g.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:ot,backdropStyle:Ot,mediaAreaStyle:Pt,overlayContentStyle:Et,swipeHandlers:zt,dismissAreaStyle:Bt}=Fc({enabled:Y??!1,onClose:$e,animMs:po,isBlockedTarget:Rt}),Wt=()=>{if(!mt||t.length===0)return Xe.current=0,0;const g=ze.current[0],H=ze.current[t.length];if(!g||!H)return Xe.current;const K=H.offsetLeft-g.offsetLeft;return K>0&&(Xe.current=K),Xe.current},_t=(g=!1)=>{if(!mt)return;const H=De.current,K=Wt();!H||K<=0||K<H.clientWidth*.25||(H.scrollLeft<=0?(H.scrollLeft+=K,g&&(Je.current.scrollLeft+=K),pt.current&&(je.current+=K)):H.scrollLeft>=K*2&&(H.scrollLeft-=K,g&&(Je.current.scrollLeft-=K),pt.current&&(je.current-=K)))},At=(g,H=(K=>(K=De.current)==null?void 0:K.scrollLeft)()??0)=>{if(!mt)return g;let be=t.length+g,Ae=1/0;for(let Ue=0;Ue<kt;Ue++){const yt=Ue*t.length+g,Lt=ze.current[yt];if(!Lt)continue;const en=Math.abs(Lt.offsetLeft-H);en<Ae&&(Ae=en,be=yt)}return be},wt=g=>{const H=De.current;return!g||!H?!1:g.offsetWidth>H.clientWidth+1},y=g=>{const H=De.current;if(!g||!H||!wt(g))return!1;const K=g.offsetLeft,be=K+g.offsetWidth;return H.scrollLeft>=K-1&&H.scrollLeft+H.clientWidth<=be+1},fe=(g=(H=>(H=De.current)==null?void 0:H.scrollLeft)()??0)=>{for(let be=0;be<ze.current.length;be+=1){const Ae=ze.current[be];if(Ae&&y(Ae))return be}let K={flatIndex:0,distance:1/0};return ze.current.forEach((be,Ae)=>{if(!be)return;const Ue=Math.abs(be.offsetLeft-g);Ue<K.distance&&(K={flatIndex:Ae,distance:Ue})}),K.flatIndex},Le=g=>{De.current&&ze.current.forEach(H=>{H&&(H.style.scrollSnapAlign=wt(H)&&g==="backward"?"end":"start")})},Me=(g,H,K)=>{const be=g-H,Ae=fe(H),Ue=ze.current[Ae];if(y(Ue))return fe(g)%t.length;const yt=ze.current[Ae+1],Lt=Ue?yt?yt.offsetLeft-Ue.offsetLeft:Ue.offsetWidth:0,en=Lt>0?be>Lt*Uo?1:be<-Lt*Uo?-1:0:0;return en===0?K:mt?(K+en+t.length)%t.length:Math.max(0,Math.min(t.length-1,K+en))},et=a.useCallback((g=!1)=>{if(M!=="on"||o)return;const H=Se.current,K=A.current,be=Ne.current[K];if(!H||!be||H.scrollWidth<=H.clientWidth)return;const Ae=H.scrollLeft,Ue=Ae+H.clientWidth,yt=be.offsetLeft,Lt=yt+be.offsetWidth;if(yt>=Ae&&Lt<=Ue)return;const en=H.scrollWidth-H.clientWidth;let Jt=Ae;if(!g&&Ht.current===null){const bi=Ne.current[K-1],Qi=Ne.current[K+1],No=bi?be.offsetLeft-bi.offsetLeft:Qi?Qi.offsetLeft-be.offsetLeft:be.offsetWidth;Lt>Ue?Jt+=No:yt<Ae&&(Jt-=No)}else Lt>Ue?Jt=Lt-H.clientWidth:Jt=yt;H.scrollLeft=Math.max(0,Math.min(en,Jt))},[o,M]),Mt=a.useCallback((g=!1)=>{g&&(Zt.current=!0),qt.current===null&&(qt.current=requestAnimationFrame(()=>{qt.current=null;const H=Zt.current;Zt.current=!1,et(H)}))},[et]),Ye=a.useCallback(g=>{if(g===A.current)return;const H=A.current;A.current=g;const K=Math.abs(g-H)>1,be=mt&&t.length>1&&(H===t.length-1&&g===0||H===0&&g===t.length-1);ue(g),Mt(K||be)},[t.length,mt,Mt]),ft=()=>{if(!De.current||t.length===0||Ht.current!==null||Je.current.isActive&&Je.current.hasMoved)return;const g=De.current.scrollLeft,H=fe(g)%t.length;H!==A.current&&Ye(H)},Nt=()=>{Ht.current=null},Tt=g=>{const H=De.current;H&&(H.style.scrollSnapType=g?"":"none")},nn=()=>{var g;(g=dt.current)==null||g.call(dt),dt.current=null},dn=()=>{ut.current!==null&&(cancelAnimationFrame(ut.current),ut.current=null),pt.current=!1},ei=()=>{const g=De.current;if(!g){ut.current=null,pt.current=!1;return}const H=je.current-g.scrollLeft;if(Math.abs(H)<.5){g.scrollLeft=je.current,_t(),ft(),ut.current=null,pt.current=!1;return}g.scrollLeft+=H*zf,_t(),ft(),at(),ut.current=requestAnimationFrame(ei)},ti=()=>{const g=qe.current;g&&(g.style.transition="",g.style.transform="",g.style.willChange="")},Ao=(g,H,K,be)=>{ti(),g.scrollLeft=H,Fe.current=g.scrollLeft,_t(),K!==void 0?(A.current=K,ue(K)):ft(),Tt(!0),be==null||be()},Fo=(g,{behavior:H="smooth",activeIndex:K,onComplete:be}={})=>{const Ae=De.current,Ue=qe.current;if(!Ae||!Ue)return;if(dn(),nn(),Tt(!1),H==="auto"){Ao(Ae,g,K,be);return}const yt=Math.abs(g-Ae.scrollLeft),Lt=kf(yt,_f,Nf,Ae.clientWidth*.55);dt.current=Wf(Ae,Ue,g,{duration:Lt,easing:Hf,onComplete:()=>{dt.current=null,Ao(Ae,g,K,be)}})},Fr=(g="smooth")=>{const H=De.current;if(!H||t.length===0)return;const K=fe()%t.length,be=At(K,H.scrollLeft),Ae=ze.current[be];Ae&&Fo(Ae.offsetLeft,{behavior:g,activeIndex:K})},Wr=(g,H="smooth",K,be)=>{const Ae=De.current;if(!Ae||t.length===0)return;const Ue=(be??Ae.scrollLeft)-g,yt=fe(g),Lt=ze.current[yt];if(y(Lt)){Tt(!0),ft();return}const en=ze.current[yt+1],Jt=Lt?en?en.offsetLeft-Lt.offsetLeft:Lt.offsetWidth:0;if((Jt>0?Ue>Jt*Uo?1:Ue<-Jt*Uo?-1:0:0)!==0){const Bc=K??yt%t.length,Vc=Me(be??Ae.scrollLeft,g,Bc);Sn(Vc,H);return}const Qi=be??Ae.scrollLeft,No=fe(Qi),ss=ze.current[No];if(ss&&Math.abs(ss.offsetLeft-Qi)<1){Tt(!0),ft();return}Fr("auto")},Sn=(g,H="smooth")=>{const K=De.current;if(!K||t.length===0)return;const be=At(g,K.scrollLeft),Ae=ze.current[be];Ae&&(H==="smooth"?Ht.current=g:Ht.current=null,A.current=g,ue(g),Mt(!0),Fo(Ae.offsetLeft,{behavior:H,activeIndex:g,onComplete:H==="smooth"?Nt:void 0}))},xi=()=>{$t.current&&(window.removeEventListener("pointerup",$t.current),window.removeEventListener("pointercancel",$t.current),$t.current=null)},Wo=(g,H,K,be,Ae)=>{const Ue=K-g,yt=be-H,Lt=Math.abs(Ue),en=Math.abs(yt);if(Lt<Vf||Lt<=en)return!1;const Jt=Ue<0?1:-1,bi=mt?(Ae+Jt+t.length)%t.length:Math.max(0,Math.min(t.length-1,Ae+Jt));return bi===Ae?!1:(Sn(bi),!0)},ni=g=>{if(!Je.current.isActive)return;xi();const H=De.current;if(!H)return;const{scrollLeft:K,startActiveIndex:be,hasMoved:Ae}=Je.current,Ue=H.scrollLeft;_t(!0),Je.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},vt(!1),g!==void 0&&H.hasPointerCapture(g)&&H.releasePointerCapture(g),Ae?Wr(K,"smooth",be,Ue):(Tt(!0),ft()),at()},_o=(g,H)=>{const K=ct.current;ct.current=null,K&&(Wo(K.startX,K.startY,g,H,K.startActiveIndex),at())},_r=g=>{if(!Ce)return;if(g.pointerType==="touch"){if(dn(),Tt(!0),Rt(g.target))return;ct.current={startX:g.clientX,startY:g.clientY,startActiveIndex:A.current};return}if(g.pointerType!=="mouse"||g.button!==0||Rt(g.target))return;const H=De.current;if(!H)return;dn(),nn(),ti(),Ht.current=null,Je.current={isActive:!0,startX:g.clientX,scrollLeft:H.scrollLeft,startActiveIndex:A.current,hasMoved:!1},Tt(!1),at(),H.setPointerCapture(g.pointerId),xi();const K=be=>{be.pointerType==="mouse"&&ni(be.pointerId)};$t.current=K,window.addEventListener("pointerup",K),window.addEventListener("pointercancel",K)},Nr=g=>{if(!Ce||g.pointerType!=="mouse")return;const H=De.current;if(!H||!Je.current.isActive)return;if(g.buttons===0){ni(g.pointerId);return}const K=g.clientX-Je.current.startX;Math.abs(K)>Bf&&(Je.current.hasMoved=!0,vt(!0)),Je.current.hasMoved&&(g.preventDefault(),H.scrollLeft=Je.current.scrollLeft-K,_t(!0),ft(),at())},ae=g=>{if(Ce){if(g.pointerType==="touch"){g.type==="pointerup"?_o(g.clientX,g.clientY):ct.current=null;return}g.pointerType==="mouse"&&ni(g.pointerId)}},He=g=>{!Ce||g.pointerType!=="mouse"||ni(g.pointerId)};return Wc(),a.useEffect(()=>{const g=requestAnimationFrame(()=>Gt(!0));return()=>{cancelAnimationFrame(g),nn(),xi(),qt.current!==null&&(cancelAnimationFrame(qt.current),qt.current=null),Ct.current&&clearTimeout(Ct.current),jt.current&&clearTimeout(jt.current)}},[]),a.useEffect(()=>{if(!_e){xt(!0);return}at();const g=Pe.current;if(!g)return;const H=()=>at();return g.addEventListener("pointermove",H),g.addEventListener("pointerdown",H),()=>{g.removeEventListener("pointermove",H),g.removeEventListener("pointerdown",H),jt.current&&clearTimeout(jt.current)}},[_e,at]),a.useEffect(()=>{const g=H=>{H.key==="Escape"&&$e()};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[$e]),a.useLayoutEffect(()=>{Wt()},[I,t.length,mt]),a.useLayoutEffect(()=>{o||Sn(A.current,"auto")},[I,o]),a.useLayoutEffect(()=>{Sn(0,"auto")},[t.length,mt]),a.useEffect(()=>{const g=De.current;if(!g||o||!Y)return;const H=K=>{if(K.preventDefault(),Math.abs(K.deltaY)<=Math.abs(K.deltaX))return;const be=K.deltaMode===1?jf:K.deltaMode===2?g.clientHeight:1,Ae=K.deltaY*be*Df;if(Ae!==0){if(nn(),pt.current||(pt.current=!0,je.current=g.scrollLeft,Ht.current=null,Tt(!1)),je.current+=Ae,!mt){const Ue=g.scrollWidth-g.clientWidth;je.current=Math.max(0,Math.min(Ue,je.current))}at(),ut.current===null&&(ut.current=requestAnimationFrame(ei))}};return g.addEventListener("wheel",H,{passive:!1}),()=>{g.removeEventListener("wheel",H),dn()}},[o,Y,mt]),a.useEffect(()=>{const g=De.current;if(!g)return;const H=()=>{_t(Je.current.isActive);const be=g.scrollLeft,Ae=be-Fe.current;Fe.current=be;const Ue=Xe.current>0?Xe.current*.5:1/0;if(Ae!==0&&Math.abs(Ae)<Ue){const yt=Ae>0?"forward":"backward";yt!==Ke.current&&(Ke.current=yt,Le(yt))}Je.current.isActive&&Je.current.hasMoved||ft()};g.addEventListener("scroll",H,{passive:!0});const K=new ResizeObserver(()=>{Wt(),_t(Je.current.isActive),Le(Ke.current),ft()});return K.observe(g),()=>{nn(),g.removeEventListener("scroll",H),K.disconnect()}},[t.length,mt]),r.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{ot||$e()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:bt?1:0,transition:`opacity ${po}ms ease`,pointerEvents:bt?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...Ot}}),r.jsxs("div",{ref:Pe,className:`${e}-lightbox-dismiss-area`,style:Bt,...zt,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:Pt,onClick:g=>g.stopPropagation(),children:r.jsx("div",{ref:De,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":Ce&&t.length>0?"true":"false","data-mouse-dragging":Yt?"true":"false",onPointerDown:_r,onPointerMove:Nr,onPointerUp:ae,onPointerCancel:ae,onLostPointerCapture:He,children:r.jsx("div",{ref:qe,className:`${e}-lightbox-strip-track`,style:{gap:I},children:Xt.map((g,H)=>{const K=g.image.objectFit??"contain",be=H%t.length,Ae=Math.floor(H/t.length),Ue=Ko(I),yt=`calc(-0.5 * (${Ue} + ${I}))`;return r.jsxs("div",{ref:Lt=>ze.current[H]=Lt,className:`${e}-strip-item`,style:{height:E==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[r.jsx("img",{src:g.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:K}}),o&&be<t.length-1&&Ae===0&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:yt,width:Ue,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Ae}-${g.image.url}-${be}`)})})})}),r.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":cn?"true":"false",style:Et,children:[r.jsx("div",{style:{position:"relative",width:"100%",height:D,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:se,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${Q?` ${e}-lightbox-content-area-stacked`:""}`,children:(we||w)&&r.jsx("div",{className:`${e}-header ${Q?`${e}-header-two-row`:`${e}-header-single-row`}`,children:Q?st():we||w?gt():null})})})]}),t.length>1&&M==="on"&&(()=>{const g=Ko($),H=`calc(-0.5 * (${$} + ${g}))`;return r.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:$},children:r.jsx("div",{ref:Se,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:K=>K.stopPropagation(),children:r.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":L,style:{gap:ie,"--thumbnail-active-color":X},children:[t.map((K,be)=>{const Ae=Ko(ie),Ue=`calc(-0.5 * (${Ae} + ${ie}))`;return r.jsxs("div",{ref:yt=>{Ne.current[be]=yt},style:{position:"relative",flex:"0 0 auto"},children:[r.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":T===be?"true":"false",onClick:()=>Y&&v==="click"&&Sn(be),onMouseEnter:()=>ke&&v==="hover"&&Sn(be),"aria-label":K.image.name?`View ${K.image.name}`:`View image ${be+1}`,"aria-current":T===be?"true":void 0,children:r.jsx("img",{className:`${e}-thumb-image${ce?` ${e}-thumb-image-cover`:""}`,src:K.image.url,alt:"",draggable:!1,style:{...ge,maxWidth:G,maxHeight:G,width:R.display==="cover"?"auto":"100%",height:"auto",objectFit:R.display==="cover"?"cover":"contain"}})}),o&&be<t.length-1&&r.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Ue,width:Ae,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${K.image.url}-${be}`)}),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:g,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function ny(e){return`
13252
13256
  .${e}-wrapper {
13253
13257
  position: relative;
13254
13258
  width: 100%;
@@ -14179,7 +14183,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
14179
14183
  </>
14180
14184
  );
14181
14185
  };
14182
- `,ry="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>'),si={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 ay(e){const t={};return t[Dt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Dt(e,"fontSettings")]={...si.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Dt(e,"fontSize")]={...si.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Dt(e,"lineHeight")]={...si.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Dt(e,"letterSpacing")]={...si.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Dt(e,"wordSpacing")]={...si.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Dt(e,"textAlign")]={...si.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Dt(e,"textAppearance")]={...si.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const sy=Gi.reduce((e,t)=>({...e,...ay(t)}),{}),ly=Gi.reduce((e,t)=>({...e,[Dt(t,"fontFamily")]:"Goudy Bookletter 1911",[Dt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Dt(t,"letterSpacing")]:0,[Dt(t,"wordSpacing")]:0,[Dt(t,"textAlign")]:"left",[Dt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function oa(e){return Gi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Dt(n,"fontSize")]=i),o!==void 0&&(t[Dt(n,"lineHeight")]=o),t},{})}const cy=Jf(),dy={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:"layout",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"layout",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","none"]}},thumbnailActiveColor:{type:"string",scope:"layout",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:"layout",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"layout",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"layout",title:"Caption Default",display:{type:"palette-color-picker"}},...sy,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/Component-default-1.jpg",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:ry,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...ly},layoutDefaults:{m:{thumbnailSize:.1,thumbnailVisibility:"off",titleHeaderLayout:"mobile",thumbnailGap:.04,thumbnailMarginBottom:.04,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",title1Width:.25,title2Width:.6,title3Width:.25,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.04,titleRowMarginBottom:.08,closeIconMaxWidth:.04,contentMarginTop:.08,iconMarginLeft:.02,...oa({title1FontSize:.042,title1LineHeight:.042,title2FontSize:.042,title2LineHeight:.042,title3FontSize:.042,title3LineHeight:.042})},t:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#FFFFFF",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#FFFFFF",title2Color:"#FFFFFF",title3Color:"#FFFFFF",title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.039,contentMarginTop:.015,iconMarginLeft:.02,...oa({title1FontSize:.0208,title1LineHeight:.0208,title2FontSize:.0208,title2LineHeight:.0208,title3FontSize:.0208,title3LineHeight:.0208})},d:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#FFFFFF",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#FFFFFF",title2Color:"#FFFFFF",title3Color:"#FFFFFF",title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.02,contentMarginTop:.015,iconMarginLeft:.02,...oa({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:[cy]}],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/Component-default-2.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"}]}},uy={element:iy,id:"lightbox-strip",name:"Strip",category:"galleries",version:1,defaultSize:{d:{width:350},t:{width:300},m:{width:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Strip.mp4"},schema:dy,sourceCode:oy,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Gi.map(e=>({path:`${Dt(e,"fontFamily")}`}))]},fontRelations:{...Gi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Dt(t,"fontFamily")}`}),{})}},py=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,initialSlideIndex:l=0,enableUrlSync:d=!1,journalItemId:c=null,onBeforeClose:u,onClose:p})=>{const{type:b,coverFit:w,backgroundColor:f,imageGap:h,maxWidth:m,maxHeight:v,textTransition:M,title1Width:R,title2Width:L,title3Width:X,title1MarginLeft:A=0,title2MarginLeft:B=0,title3MarginLeft:P=0,titleRowMarginBottom:C=0,titleHeaderLayout:j="single-row",countCloseGap:x=0,closeIcon:W,closeIconMaxWidth:E,closeIconColor:Z,closeIconHoverColor:k,contentMarginTop:U=0,iconMarginRight:V=0}=n,G=a.useCallback(ae=>S.scalingValue(ae,i??!1),[i]),ie=G(h??0),$=`${m}%`,I=`${v}%`,D=G(x),se=G(U),oe=G(V),T=pi("title1",ui(n,"title1"),i),ue=pi("title2",ui(n,"title2"),i),F=pi("title3",ui(n,"title3"),i),ne=pi("count",ui(n,"count"),i),J=j==="mobile",ve=!i||!!s,Ee=!o&&(!i||!!s),me=a.useMemo(()=>or(t,b),[t,b]),[de,q]=a.useState(l),Q=me[de],Y=Q==null?void 0:Q.entry,[_e,Ce]=a.useState(!1),[ke,ce]=a.useState(null),[ge,we]=a.useState(!1),[z,le]=a.useState(null),[he,xe]=a.useState(!1),[Re,Te]=a.useState(0),[_,pe]=a.useState(),[te,N]=a.useState(),[ee,Ie]=a.useState(null),re=a.useRef(null),O=a.useRef(0),Ve=a.useRef(0),Oe=a.useRef(0),lt=a.useRef(!1),tt=a.useRef(null),ht=a.useRef(null),nt=a.useRef(null),Be=a.useRef(null),ye=a.useRef(null),Pe=a.useRef(null),De=a.useRef(null),qe=a.useCallback(()=>{const ae=ht.current;if(!ae)return;const He=ae.closest(`.${e}-lightbox-content-area`);if(!He)return ae.getBoundingClientRect().width;const g=Array.from(He.children).reduce((H,K)=>!(K instanceof HTMLElement)||K.contains(ae)?H:H+K.getBoundingClientRect().width,0);return He.getBoundingClientRect().width-g},[e]),Se=a.useCallback(()=>{re.current&&(clearTimeout(re.current),re.current=null)},[]),Ne=a.useCallback(ae=>{ae===O.current&&(le(null),xe(!1))},[]),ze=a.useCallback(()=>{o||lt.current||(lt.current=!0,u==null||u(),Ce(!1),tt.current=setTimeout(()=>{p()},300))},[o,u,p]),Xe=a.useCallback(ae=>!!(ae.closest("[data-controls]")||ae.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:ct,backdropStyle:Je,mediaAreaStyle:$t,overlayContentStyle:dt,swipeHandlers:Fe,dismissAreaStyle:Ke}=Fc({enabled:Ee,onClose:ze,animMs:300,isBlockedTarget:Xe}),je=a.useCallback(ae=>{d&&fc(ae+1,c,!0)},[d,c]),ut=a.useCallback(ae=>{if(ae)return ae.getBoundingClientRect().height},[]),pt=a.useCallback(ae=>{if(me.length===0)return;const He=(ae%me.length+me.length)%me.length;if(He===de)return;const g=me[de],H=me[He];O.current+=1;const K=O.current,be=M==="fade"&&Os(g==null?void 0:g.entry)!==Os(H==null?void 0:H.entry),Ae=ut(nt.current),Ue=be?(()=>{const Lt=qe();Yn.flushSync(()=>{Ie(H.entry)}),nt.current&&Lt&&(nt.current.style.width=`${Lt}px`);const en=ut(nt.current);return nt.current&&(nt.current.style.width=""),{measuredIncomingTitlesHeight:en,incomingTitlesMeasureWidth:Lt}})():void 0,yt=Math.max(Ae??0,(Ue==null?void 0:Ue.measuredIncomingTitlesHeight)??0)||void 0;Te(K),le(de),xe(!0),q(He),je(He),Oe.current=He,be?(Se(),yt&&pe(yt),Ue!=null&&Ue.incomingTitlesMeasureWidth&&N(Ue.incomingTitlesMeasureWidth),ce((g==null?void 0:g.entryIndex)??null),we(!0),Ve.current=H.entryIndex,re.current=setTimeout(()=>{ce(null),we(!1),pe(void 0),N(void 0),Ie(null),re.current=null},400)):(Se(),ce(null),we(!1),pe(void 0),N(void 0),Ie(null),Ve.current=H.entryIndex)},[de,Se,qe,ut,me,je,M]),mt=a.useCallback(()=>{De.current=null},[]),kt=a.useCallback(ae=>{!ve||me.length<=1||ae.pointerType==="mouse"&&ae.button!==0||ae.target.closest("[data-controls]")||(De.current={startX:ae.clientX,startY:ae.clientY,pointerId:ae.pointerId})},[ve,me.length]),Xt=a.useCallback(ae=>{var Lt;if(!ve||me.length<=1||ae.pointerType==="mouse"&&ae.button!==0)return;if(ct){mt();return}const He=De.current;if(!He||He.pointerId!==ae.pointerId||(mt(),ae.target.closest("[data-controls]")))return;const H=ae.clientX-He.startX,K=ae.clientY-He.startY,be=Math.abs(H),Ae=Math.abs(K);if(be>=$g&&be>Ae){pt(H>0?de-1:de+1);return}if(be>Ws||Ae>Ws)return;const Ue=(Lt=Be.current)==null?void 0:Lt.getBoundingClientRect(),yt=Ue?Ue.left+Ue.width/2:window.innerWidth/2;pt(ae.clientX<yt?de-1:de+1)},[de,ve,pt,ct,mt,me.length]),Yt=a.useCallback(ae=>{const He=De.current;(He==null?void 0:He.pointerId)===ae.pointerId&&mt()},[mt]);Wc(),a.useEffect(()=>{Pe.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const ae=requestAnimationFrame(()=>{Ce(!0),requestAnimationFrame(()=>{ye.current?ye.current.focus():Be.current&&Be.current.focus()})});return()=>{cancelAnimationFrame(ae),tt.current&&clearTimeout(tt.current),re.current&&clearTimeout(re.current);const He=Pe.current;He&&document.contains(He)&&He.focus({preventScroll:!0})}},[]),a.useEffect(()=>{var ae;M!=="fade"&&(Ve.current=((ae=me[de])==null?void 0:ae.entryIndex)??0,Se(),ce(null),we(!1),pe(void 0),N(void 0))},[de,Se,me,M]),a.useEffect(()=>{const ae=He=>{if(He.key==="Escape"){ze();return}if(He.key==="ArrowLeft"&&me.length>1){pt(de-1);return}if(He.key==="ArrowRight"&&me.length>1){pt(de+1);return}if(He.key==="Tab"&&Be.current){const g=Be.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),H=Array.from(g).filter(Ue=>!Ue.closest('[aria-hidden="true"]'));if(H.length===0)return;const K=H[0],be=H[H.length-1],Ae=document.activeElement;He.shiftKey?(Ae===K||!Be.current.contains(Ae))&&(He.preventDefault(),be.focus()):(Ae===be||!Be.current.contains(Ae))&&(He.preventDefault(),K.focus())}};return window.addEventListener("keydown",ae),()=>window.removeEventListener("keydown",ae)},[pt,ze,de,me.length]),a.useLayoutEffect(()=>{Se(),O.current=0,Te(0),le(null),xe(!1),ce(null),we(!1),pe(void 0),N(void 0),Ie(null),q(ae=>{const He=Math.max(0,me.length-1);return Math.min(ae,He)})},[Se,t.length,b,me.length]),a.useLayoutEffect(()=>{var g;const ae=Math.max(0,me.length-1),He=Math.min(Math.max(0,l),ae);Oe.current=He,Ve.current=((g=me[He])==null?void 0:g.entryIndex)??0,q(He)},[l]);const vt=ke!==null?t[ke]:null,bt=z!==null?me[z]:null,Gt=(Y==null?void 0:Y.title1)||(Y==null?void 0:Y.title2)||(Y==null?void 0:Y.title3)||(vt==null?void 0:vt.title1)||(vt==null?void 0:vt.title2)||(vt==null?void 0:vt.title3),Ft=Pg(b,me,t),xt=W!==null,Ht=Gt||Ft||xt,qt=Ft&&xt?{gap:D}:void 0,Zt=`${e}-titles-stack${J?` ${e}-titles-stack-stacked`:""}`,tn=`${e}-titles-layer-out${J?` ${e}-titles-layer-out-stacked`:""}`,Ct=`${e}-titles-layer-out`,jt=(A??0)>0||o,cn=G(C),at=a.useMemo(()=>({title1Width:R??Ai.title1Width,title2Width:L??Ai.title2Width,title3Width:X??Ai.title3Width}),[R,L,X]),$e=a.useMemo(()=>({title2MarginLeft:B,title3MarginLeft:P}),[B,P]),We=a.useMemo(()=>Y?Vn(e,Y,T,ue,F):[],[e,Y,T,ue,F]),Qe=a.useMemo(()=>We.map(ae=>at[ae.widthKey]),[We,at]),st=a.useMemo(()=>Oi(We.length,Qe),[We.length,Qe]),gt=a.useMemo(()=>bo(We.length,Qe),[We.length,Qe]),Rt=a.useMemo(()=>We.filter(ae=>ae.prefix==="title1"),[We]),ot=a.useMemo(()=>We.filter(ae=>ae.prefix==="title2"||ae.prefix==="title3"),[We]),Ot=a.useMemo(()=>Gn(Rt,at),[Rt,at]),Pt=a.useMemo(()=>Gn(ot,at),[ot,at]),Et=a.useCallback((ae,He)=>{const g=We.findIndex(K=>K.prefix===ae.prefix);if(!J||He==="single-row")return{effectiveWidth:gt[g]??0,resolvedWidth:st[g]??0,maxWidth:sn(g,st)};if(He==="two-row-top"){const K=Rt.findIndex(be=>be.prefix===ae.prefix);return{effectiveWidth:Ot.effective[K]??0,resolvedWidth:Ot.resolved[K]??0,maxWidth:sn(K,Ot.resolved)}}const H=ot.findIndex(K=>K.prefix===ae.prefix);return{effectiveWidth:Pt.effective[H]??0,resolvedWidth:Pt.resolved[H]??0,maxWidth:sn(H,Pt.resolved)}},[We,ot,Pt,gt,st,Rt,Ot,J]),zt=a.useCallback(ae=>bc(We,st,$e,ae)+(J?0:A??0),[We,st,$e,J,A]),Bt=a.useCallback(()=>J?0:A??0,[J,A]),Wt=a.useCallback(ae=>ot.slice(0,ae).reduce((He,g,H)=>He+(g.marginLeftKey?$e[g.marginLeftKey]??0:0)+(Pt.resolved[H]??0),0),[ot,Pt.resolved,$e]),_t=a.useCallback(ae=>{const He=ot[ae];return Wt(ae)+(He.marginLeftKey?$e[He.marginLeftKey]??0:0)+(Pt.resolved[ae]??0)},[ot,Pt.resolved,Wt,$e]),At=a.useCallback((ae,He,g)=>{if(!J||g==="single-row"){const Ue=ae.findIndex(Jt=>Jt.prefix===He.prefix),yt=ae.map(Jt=>at[Jt.widthKey]),Lt=Oi(ae.length,yt);return{effectiveWidth:bo(ae.length,yt)[Ue]??0,resolvedWidth:Lt[Ue]??0,maxWidth:sn(Ue,Lt)}}if(g==="two-row-top"){const Ue=ae.filter(Jt=>Jt.prefix==="title1"),yt=Ue.findIndex(Jt=>Jt.prefix===He.prefix),{resolved:Lt,effective:en}=Gn(Ue,at);return{effectiveWidth:en[yt]??0,resolvedWidth:Lt[yt]??0,maxWidth:sn(yt,Lt)}}const H=ae.filter(Ue=>Ue.prefix==="title2"||Ue.prefix==="title3"),K=H.findIndex(Ue=>Ue.prefix===He.prefix),{resolved:be,effective:Ae}=Gn(H,at);return{effectiveWidth:Ae[K]??0,resolvedWidth:be[K]??0,maxWidth:sn(K,be)}},[at,J]),wt=(ae,He,g)=>{const H=ae.marginLeftKey?$e[ae.marginLeftKey]??0:0,{effectiveWidth:K,resolvedWidth:be,maxWidth:Ae}=g??Et(ae,He),Ue=Math.max(H,Bn),yt=o&&He==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":ae.prefix,style:{width:G(K),...H>0?{marginLeft:G(H)}:{}},children:[r.jsx("p",{className:ae.className,style:ae.style,children:ae.text}),yt&&ae.marginLeftKey?r.jsx("div",{"data-controls":ae.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(be),style:{position:"absolute",top:0,left:G(-H),width:G(Ue),height:"100%",pointerEvents:"auto"}}):null,yt?r.jsx("div",{"data-controls":ae.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ae),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:G(-gn/2),width:G(gn),height:"100%",pointerEvents:"auto"}}):null]},ae.className)},y=(ae="two-row")=>{const He=We.findIndex(K=>K.prefix==="title1"),g=He>=0?st[He]:at.title1Width,H=ae==="two-row"&&o;return r.jsx("div",{...H?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(g)}:{},style:{width:G(A??0),flexShrink:0,alignSelf:"stretch",...H?{pointerEvents:"auto"}:{}}})},fe=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:T,"aria-hidden":"true",children:" "}),Le=()=>r.jsx("span",{className:`${e}-entry-counter`,style:ne,"aria-live":"polite","aria-atomic":"true",children:Eg(me,de,b,t)}),Me=()=>Ft?o&&xt?r.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Le(),r.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${Kr(D)} + ${D}))`,width:Kr(D),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Le():null,et=()=>!Ft&&!xt?null:r.jsxs("div",{className:`${e}-titles-row-header-controls`,style:qt,children:[Me(),xt?ft():null]}),Mt=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Ft||Gt?fe():null,jt?y("single-row"):null,Tt(Y),r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),et(),Sn()]}),Ye=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Ft||Gt?fe():null,jt?y("single-row"):null,r.jsxs("div",{className:`${e}-titles-row-titles`,style:ge&&_?{minHeight:_}:void 0,children:[r.jsx("div",{ref:nt,className:Zt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ti(ee||Y)}),r.jsxs("div",{ref:ht,className:Zt,style:{position:ge?"absolute":"relative",inset:ge?0:void 0,width:"100%",...ge&&te?{width:te,maxWidth:"100%"}:void 0},children:[vt&&ge?r.jsx("div",{className:`${tn} ${e}-titles-fade-out`,children:ti(vt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${ge?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:ti(Y)})]})]}),et(),Sn()]}),ft=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:S.scalingValue(E??0,i),height:S.scalingValue(E??0,i),marginRight:oe,"--close-icon-hover-color":k},children:[r.jsx("button",{ref:ye,type:"button",className:`${e}-close-icon-inner`,onClick:ze,"aria-label":"Close",children:r.jsx(rn,{url:W??"",fill:Z,hoverFill:i&&!s?Z:k,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:oe,height:"100%",pointerEvents:"auto"}})]}),Nt=(ae,He)=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[Ft||Gt?fe():null,jt?y("two-row"):null,He!==void 0?r.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:He},children:ae}):r.jsxs(r.Fragment,{children:[ae,r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),et()]}),Tt=ae=>{if(!ae)return null;const He=Vn(e,ae,T,ue,F);return r.jsx(r.Fragment,{children:He.map(g=>wt(g,"single-row",At(He,g,"single-row")))})},nn=ae=>{if(!ae)return null;const He=Vn(e,ae,T,ue,F),g=He.find(H=>H.prefix==="title1");return g?wt(g,"two-row-top",At(He,g,"two-row-top")):null},dn=(ae,He=!1)=>{const g=ae?Vn(e,ae,T,ue,F):[],H=g.filter(Ae=>Ae.prefix==="title2"||Ae.prefix==="title3"),K=o&&He;return H.length>0||K||(C??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(Ae=>wt(Ae,"two-row-bottom",At(g,Ae,"two-row-bottom"))),He&&o?r.jsxs(r.Fragment,{children:[Fr(),Wr()]}):null]}):null,(C??0)>0||K?r.jsx("div",{"data-controls":K?"titleRowMarginBottom":void 0,"data-controls-axis":K?"y":void 0,"data-controls-reverse":K?"":void 0,className:K?`${e}-control`:void 0,style:{height:cn,width:"100%",flexShrink:0,pointerEvents:K?"auto":"none"}}):null]}):null},ei=(ae,He=!1)=>r.jsxs(r.Fragment,{children:[Nt(nn(ae)),dn(ae,He)]}),ti=ae=>J?r.jsx("div",{className:`${e}-titles-row-two-row`,children:ei(ae)}):ae?r.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:Tt(ae)}):null,Ao=()=>{const ae=J?-1:We.findIndex(H=>H.prefix==="title1"),He=!J&&(o||(A??0)>0)?(()=>{const H=A??0,K=ae>=0?st[ae]:at.title1Width,be=Math.max(H,Bn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(K),style:{position:"absolute",top:0,left:0,width:G(be),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,g=We.flatMap((H,K)=>{if(!H.marginLeftKey)return[];const be=$e[H.marginLeftKey]??0,Ae=xc(We,st,$e,K)+Bt(),Ue=Math.max(be,Bn);return r.jsx("div",{"data-controls":H.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(st[K]),style:{position:"absolute",top:0,left:G(Ae),width:G(Ue),height:"100%",pointerEvents:"auto"}},H.marginLeftKey)});return He?[He,...g]:g},Fo=()=>We.map((ae,He)=>{const g=sn(He,st),K=zt(He)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":ae.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(g),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:G(K),width:G(gn),height:"100%",pointerEvents:"auto"}})},`${ae.widthKey}-junction`)}),Fr=()=>ot.flatMap((ae,He)=>{if(!ae.marginLeftKey)return[];const g=$e[ae.marginLeftKey]??0,H=Wt(He),K=Math.max(g,Bn),{resolvedWidth:be}=Et(ae,"two-row-bottom");return r.jsx("div",{"data-controls":ae.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(be),style:{position:"absolute",top:0,left:G(H),width:G(K),height:"100%",pointerEvents:"auto"}},ae.marginLeftKey)}),Wr=()=>ot.map((ae,He)=>{const{maxWidth:g}=Et(ae,"two-row-bottom"),K=_t(He)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":ae.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(g),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:G(K),width:G(gn),height:"100%",pointerEvents:"auto"}})},`${ae.widthKey}-junction`)}),Sn=()=>!o||J?null:r.jsxs(r.Fragment,{children:[Ao(),Fo()]}),xi=ae=>{const He=!ae.objectFit&&Fn(w);return{className:`${e}-slide-image-cell${He?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:$,maxHeight:I,...He?{"--image-aspect-ratio":kr(w)}:{}}}},Wo=ae=>ae.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":ae.objectFit}}:Fn(w)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},ni=ae=>{if(ae.length===0)return null;const He=ae.length>1,g=Kr(ie),H=`calc(-0.5 * (${g} + ${ie}))`;if(ae.length===1){const K=ae[0];return r.jsx("div",{...xi(K),children:r.jsx("img",{...Wo(K),src:K.url,alt:K.name??"",draggable:!1})})}return r.jsx("div",{className:`${e}-slide-inner`,style:He?{gap:ie}:void 0,children:ae.map((K,be)=>r.jsxs("div",{...xi(K),children:[r.jsx("img",{...Wo(K),src:K.url,alt:K.name??"",draggable:!1}),o&&He&&be<ae.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:H,width:g,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${K.url}-${be}`))})},_o=!!(Y!=null&&Y.title2||Y!=null&&Y.title3||vt!=null&&vt.title2||vt!=null&&vt.title3||(C??0)>0||o),_r=()=>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:nt,className:Zt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ei(ee||Y)}),r.jsxs("div",{ref:ht,className:`${e}-titles-row-two-row`,style:{...ge&&_?{minHeight:_}:void 0,...ge&&te?{width:te,maxWidth:"100%"}:void 0},children:[Nt(r.jsxs("div",{className:Zt,style:{position:ge?"absolute":"relative",inset:ge?0:void 0,width:"100%"},children:[vt&&ge?r.jsx("div",{className:`${Ct} ${e}-titles-fade-out`,children:nn(vt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${ge?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:nn(Y)})]}),ge&&_?_:void 0),_o?r.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[vt&&ge?r.jsx("div",{className:`${tn} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:dn(vt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${ge?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${J?` ${e}-titles-layer-in-stacked`:""}`,children:dn(Y,!0)})]}):null]})]}),Nr=()=>{const ae=_o;return r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...ae?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:ae?void 0:{flex:"0 0 auto",height:"auto"},children:ei(Y,!0)}),Sn()]})};return r.jsxs("div",{ref:Be,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{ct||ze()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:xt?void 0:-1,style:{opacity:_e?1:0,transition:"opacity 300ms ease",pointerEvents:_e?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:f,...Je}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:Ke,...Fe,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:$t,onClick:ae=>ae.stopPropagation(),children:r.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":ve&&me.length>1?"true":"false",onPointerDown:ve?kt:void 0,onPointerUp:ve?Xt:void 0,onPointerCancel:ve?Yt:void 0,children:r.jsxs("div",{className:`${e}-slide-stack`,children:[bt&&he?r.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:ae=>{ae.target===ae.currentTarget&&Ne(Re)},children:r.jsx("div",{className:`${e}-slide-area`,children:ni(bt.images)})},`slide-out-${Re}`):null,r.jsx("div",{className:`${e}-slide-layer-in${he?` ${e}-slide-fade-in`:""}`,children:r.jsx("div",{className:`${e}-slide-area`,children:Q?ni(Q.images):null})},`slide-in-${Re}-${de}`)]})})}),r.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:dt,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:se,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...J?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${J?` ${e}-lightbox-content-area-stacked`:""}`,children:Ht&&r.jsx("div",{className:`${e}-text-bar-cell${J?` ${e}-text-bar-cell-stacked`:""}`,style:J?void 0:{flex:1,minWidth:0,width:"100%"},children:J?M==="fade"?_r():Nr():M==="fade"?Ye():Mt()})})})]})]})]})};function my(e){return`
14186
+ `,ry="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>'),si={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 ay(e){const t={};return t[Dt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Dt(e,"fontSettings")]={...si.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Dt(e,"fontSize")]={...si.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Dt(e,"lineHeight")]={...si.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Dt(e,"letterSpacing")]={...si.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Dt(e,"wordSpacing")]={...si.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Dt(e,"textAlign")]={...si.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Dt(e,"textAppearance")]={...si.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const sy=Gi.reduce((e,t)=>({...e,...ay(t)}),{}),ly=Gi.reduce((e,t)=>({...e,[Dt(t,"fontFamily")]:"Goudy Bookletter 1911",[Dt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Dt(t,"letterSpacing")]:0,[Dt(t,"wordSpacing")]:0,[Dt(t,"textAlign")]:"left",[Dt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function oa(e){return Gi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Dt(n,"fontSize")]=i),o!==void 0&&(t[Dt(n,"lineHeight")]=o),t},{})}const cy=Jf(),dy={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:"layout",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"layout",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","none"]}},thumbnailActiveColor:{type:"string",scope:"layout",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:"layout",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"layout",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"layout",title:"Caption Default",display:{type:"palette-color-picker"}},...sy,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/Component-default-1.jpg",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:ry,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...ly},layoutDefaults:{m:{thumbnailSize:.1,thumbnailVisibility:"off",titleHeaderLayout:"mobile",thumbnailGap:.04,thumbnailMarginBottom:.04,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",title1Width:.25,title2Width:.6,title3Width:.25,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.04,titleRowMarginBottom:.08,closeIconMaxWidth:.04,contentMarginTop:.08,iconMarginLeft:.02,...oa({title1FontSize:.042,title1LineHeight:.042,title2FontSize:.042,title2LineHeight:.042,title3FontSize:.042,title3LineHeight:.042})},t:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#FFFFFF",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#FFFFFF",title2Color:"#FFFFFF",title3Color:"#FFFFFF",title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.039,contentMarginTop:.015,iconMarginLeft:.02,...oa({title1FontSize:.0208,title1LineHeight:.0208,title2FontSize:.0208,title2LineHeight:.0208,title3FontSize:.0208,title3LineHeight:.0208})},d:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#FFFFFF",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#FFFFFF",title2Color:"#FFFFFF",title3Color:"#FFFFFF",title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.02,contentMarginTop:.015,iconMarginLeft:.02,...oa({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:[cy]}],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/Component-default-2.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"}]}},uy={element:iy,id:"lightbox-strip",name:"Strip",category:"galleries",version:1,defaultSize:{d:{width:350},t:{width:300},m:{width:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Strip.mp4"},schema:dy,sourceCode:oy,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Gi.map(e=>({path:`${Dt(e,"fontFamily")}`}))]},fontRelations:{...Gi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Dt(t,"fontFamily")}`}),{})}},py=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,initialSlideIndex:l=0,enableUrlSync:d=!1,journalItemId:c=null,onBeforeClose:u,onClose:p})=>{const{type:b,coverFit:w,backgroundColor:f,imageGap:h,maxWidth:m,maxHeight:v,textTransition:M,title1Width:R,title2Width:L,title3Width:X,title1MarginLeft:F=0,title2MarginLeft:B=0,title3MarginLeft:k=0,titleRowMarginBottom:C=0,titleHeaderLayout:j="single-row",countCloseGap:x=0,closeIcon:W,closeIconMaxWidth:E,closeIconColor:Z,closeIconHoverColor:P,contentMarginTop:U=0,iconMarginRight:V=0}=n,G=a.useCallback(ae=>S.scalingValue(ae,i??!1),[i]),ie=G(h??0),$=`${m}%`,I=`${v}%`,D=G(x),se=G(U),oe=G(V),T=pi("title1",ui(n,"title1"),i),ue=pi("title2",ui(n,"title2"),i),A=pi("title3",ui(n,"title3"),i),ne=pi("count",ui(n,"count"),i),J=j==="mobile",ve=!i||!!s,Ee=!o&&(!i||!!s),me=a.useMemo(()=>or(t,b),[t,b]),[de,q]=a.useState(l),Q=me[de],Y=Q==null?void 0:Q.entry,[_e,Ce]=a.useState(!1),[ke,ce]=a.useState(null),[ge,we]=a.useState(!1),[z,le]=a.useState(null),[he,xe]=a.useState(!1),[Re,Te]=a.useState(0),[_,pe]=a.useState(),[te,N]=a.useState(),[ee,Ie]=a.useState(null),re=a.useRef(null),O=a.useRef(0),Ve=a.useRef(0),Oe=a.useRef(0),lt=a.useRef(!1),tt=a.useRef(null),ht=a.useRef(null),nt=a.useRef(null),Be=a.useRef(null),ye=a.useRef(null),Pe=a.useRef(null),De=a.useRef(null),qe=a.useCallback(()=>{const ae=ht.current;if(!ae)return;const He=ae.closest(`.${e}-lightbox-content-area`);if(!He)return ae.getBoundingClientRect().width;const g=Array.from(He.children).reduce((H,K)=>!(K instanceof HTMLElement)||K.contains(ae)?H:H+K.getBoundingClientRect().width,0);return He.getBoundingClientRect().width-g},[e]),Se=a.useCallback(()=>{re.current&&(clearTimeout(re.current),re.current=null)},[]),Ne=a.useCallback(ae=>{ae===O.current&&(le(null),xe(!1))},[]),ze=a.useCallback(()=>{o||lt.current||(lt.current=!0,u==null||u(),Ce(!1),tt.current=setTimeout(()=>{p()},300))},[o,u,p]),Xe=a.useCallback(ae=>!!(ae.closest("[data-controls]")||ae.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:ct,backdropStyle:Je,mediaAreaStyle:$t,overlayContentStyle:dt,swipeHandlers:Fe,dismissAreaStyle:Ke}=Fc({enabled:Ee,onClose:ze,animMs:300,isBlockedTarget:Xe}),je=a.useCallback(ae=>{d&&fc(ae+1,c,!0)},[d,c]),ut=a.useCallback(ae=>{if(ae)return ae.getBoundingClientRect().height},[]),pt=a.useCallback(ae=>{if(me.length===0)return;const He=(ae%me.length+me.length)%me.length;if(He===de)return;const g=me[de],H=me[He];O.current+=1;const K=O.current,be=M==="fade"&&Os(g==null?void 0:g.entry)!==Os(H==null?void 0:H.entry),Ae=ut(nt.current),Ue=be?(()=>{const Lt=qe();Yn.flushSync(()=>{Ie(H.entry)}),nt.current&&Lt&&(nt.current.style.width=`${Lt}px`);const en=ut(nt.current);return nt.current&&(nt.current.style.width=""),{measuredIncomingTitlesHeight:en,incomingTitlesMeasureWidth:Lt}})():void 0,yt=Math.max(Ae??0,(Ue==null?void 0:Ue.measuredIncomingTitlesHeight)??0)||void 0;Te(K),le(de),xe(!0),q(He),je(He),Oe.current=He,be?(Se(),yt&&pe(yt),Ue!=null&&Ue.incomingTitlesMeasureWidth&&N(Ue.incomingTitlesMeasureWidth),ce((g==null?void 0:g.entryIndex)??null),we(!0),Ve.current=H.entryIndex,re.current=setTimeout(()=>{ce(null),we(!1),pe(void 0),N(void 0),Ie(null),re.current=null},400)):(Se(),ce(null),we(!1),pe(void 0),N(void 0),Ie(null),Ve.current=H.entryIndex)},[de,Se,qe,ut,me,je,M]),mt=a.useCallback(()=>{De.current=null},[]),kt=a.useCallback(ae=>{!ve||me.length<=1||ae.pointerType==="mouse"&&ae.button!==0||ae.target.closest("[data-controls]")||(De.current={startX:ae.clientX,startY:ae.clientY,pointerId:ae.pointerId})},[ve,me.length]),Xt=a.useCallback(ae=>{var Lt;if(!ve||me.length<=1||ae.pointerType==="mouse"&&ae.button!==0)return;if(ct){mt();return}const He=De.current;if(!He||He.pointerId!==ae.pointerId||(mt(),ae.target.closest("[data-controls]")))return;const H=ae.clientX-He.startX,K=ae.clientY-He.startY,be=Math.abs(H),Ae=Math.abs(K);if(be>=$g&&be>Ae){pt(H>0?de-1:de+1);return}if(be>Ws||Ae>Ws)return;const Ue=(Lt=Be.current)==null?void 0:Lt.getBoundingClientRect(),yt=Ue?Ue.left+Ue.width/2:window.innerWidth/2;pt(ae.clientX<yt?de-1:de+1)},[de,ve,pt,ct,mt,me.length]),Yt=a.useCallback(ae=>{const He=De.current;(He==null?void 0:He.pointerId)===ae.pointerId&&mt()},[mt]);Wc(),a.useEffect(()=>{Pe.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const ae=requestAnimationFrame(()=>{Ce(!0),requestAnimationFrame(()=>{ye.current?ye.current.focus():Be.current&&Be.current.focus()})});return()=>{cancelAnimationFrame(ae),tt.current&&clearTimeout(tt.current),re.current&&clearTimeout(re.current);const He=Pe.current;He&&document.contains(He)&&He.focus({preventScroll:!0})}},[]),a.useEffect(()=>{var ae;M!=="fade"&&(Ve.current=((ae=me[de])==null?void 0:ae.entryIndex)??0,Se(),ce(null),we(!1),pe(void 0),N(void 0))},[de,Se,me,M]),a.useEffect(()=>{const ae=He=>{if(He.key==="Escape"){ze();return}if(He.key==="ArrowLeft"&&me.length>1){pt(de-1);return}if(He.key==="ArrowRight"&&me.length>1){pt(de+1);return}if(He.key==="Tab"&&Be.current){const g=Be.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),H=Array.from(g).filter(Ue=>!Ue.closest('[aria-hidden="true"]'));if(H.length===0)return;const K=H[0],be=H[H.length-1],Ae=document.activeElement;He.shiftKey?(Ae===K||!Be.current.contains(Ae))&&(He.preventDefault(),be.focus()):(Ae===be||!Be.current.contains(Ae))&&(He.preventDefault(),K.focus())}};return window.addEventListener("keydown",ae),()=>window.removeEventListener("keydown",ae)},[pt,ze,de,me.length]),a.useLayoutEffect(()=>{Se(),O.current=0,Te(0),le(null),xe(!1),ce(null),we(!1),pe(void 0),N(void 0),Ie(null),q(ae=>{const He=Math.max(0,me.length-1);return Math.min(ae,He)})},[Se,t.length,b,me.length]),a.useLayoutEffect(()=>{var g;const ae=Math.max(0,me.length-1),He=Math.min(Math.max(0,l),ae);Oe.current=He,Ve.current=((g=me[He])==null?void 0:g.entryIndex)??0,q(He)},[l]);const vt=ke!==null?t[ke]:null,bt=z!==null?me[z]:null,Gt=(Y==null?void 0:Y.title1)||(Y==null?void 0:Y.title2)||(Y==null?void 0:Y.title3)||(vt==null?void 0:vt.title1)||(vt==null?void 0:vt.title2)||(vt==null?void 0:vt.title3),Ft=Pg(b,me,t),xt=W!==null,Ht=Gt||Ft||xt,qt=Ft&&xt?{gap:D}:void 0,Zt=`${e}-titles-stack${J?` ${e}-titles-stack-stacked`:""}`,tn=`${e}-titles-layer-out${J?` ${e}-titles-layer-out-stacked`:""}`,Ct=`${e}-titles-layer-out`,jt=(F??0)>0||o,cn=G(C),at=a.useMemo(()=>({title1Width:R??Ai.title1Width,title2Width:L??Ai.title2Width,title3Width:X??Ai.title3Width}),[R,L,X]),$e=a.useMemo(()=>({title2MarginLeft:B,title3MarginLeft:k}),[B,k]),We=a.useMemo(()=>Y?Vn(e,Y,T,ue,A):[],[e,Y,T,ue,A]),Qe=a.useMemo(()=>We.map(ae=>at[ae.widthKey]),[We,at]),st=a.useMemo(()=>Oi(We.length,Qe),[We.length,Qe]),gt=a.useMemo(()=>bo(We.length,Qe),[We.length,Qe]),Rt=a.useMemo(()=>We.filter(ae=>ae.prefix==="title1"),[We]),ot=a.useMemo(()=>We.filter(ae=>ae.prefix==="title2"||ae.prefix==="title3"),[We]),Ot=a.useMemo(()=>Gn(Rt,at),[Rt,at]),Pt=a.useMemo(()=>Gn(ot,at),[ot,at]),Et=a.useCallback((ae,He)=>{const g=We.findIndex(K=>K.prefix===ae.prefix);if(!J||He==="single-row")return{effectiveWidth:gt[g]??0,resolvedWidth:st[g]??0,maxWidth:sn(g,st)};if(He==="two-row-top"){const K=Rt.findIndex(be=>be.prefix===ae.prefix);return{effectiveWidth:Ot.effective[K]??0,resolvedWidth:Ot.resolved[K]??0,maxWidth:sn(K,Ot.resolved)}}const H=ot.findIndex(K=>K.prefix===ae.prefix);return{effectiveWidth:Pt.effective[H]??0,resolvedWidth:Pt.resolved[H]??0,maxWidth:sn(H,Pt.resolved)}},[We,ot,Pt,gt,st,Rt,Ot,J]),zt=a.useCallback(ae=>bc(We,st,$e,ae)+(J?0:F??0),[We,st,$e,J,F]),Bt=a.useCallback(()=>J?0:F??0,[J,F]),Wt=a.useCallback(ae=>ot.slice(0,ae).reduce((He,g,H)=>He+(g.marginLeftKey?$e[g.marginLeftKey]??0:0)+(Pt.resolved[H]??0),0),[ot,Pt.resolved,$e]),_t=a.useCallback(ae=>{const He=ot[ae];return Wt(ae)+(He.marginLeftKey?$e[He.marginLeftKey]??0:0)+(Pt.resolved[ae]??0)},[ot,Pt.resolved,Wt,$e]),At=a.useCallback((ae,He,g)=>{if(!J||g==="single-row"){const Ue=ae.findIndex(Jt=>Jt.prefix===He.prefix),yt=ae.map(Jt=>at[Jt.widthKey]),Lt=Oi(ae.length,yt);return{effectiveWidth:bo(ae.length,yt)[Ue]??0,resolvedWidth:Lt[Ue]??0,maxWidth:sn(Ue,Lt)}}if(g==="two-row-top"){const Ue=ae.filter(Jt=>Jt.prefix==="title1"),yt=Ue.findIndex(Jt=>Jt.prefix===He.prefix),{resolved:Lt,effective:en}=Gn(Ue,at);return{effectiveWidth:en[yt]??0,resolvedWidth:Lt[yt]??0,maxWidth:sn(yt,Lt)}}const H=ae.filter(Ue=>Ue.prefix==="title2"||Ue.prefix==="title3"),K=H.findIndex(Ue=>Ue.prefix===He.prefix),{resolved:be,effective:Ae}=Gn(H,at);return{effectiveWidth:Ae[K]??0,resolvedWidth:be[K]??0,maxWidth:sn(K,be)}},[at,J]),wt=(ae,He,g)=>{const H=ae.marginLeftKey?$e[ae.marginLeftKey]??0:0,{effectiveWidth:K,resolvedWidth:be,maxWidth:Ae}=g??Et(ae,He),Ue=Math.max(H,Bn),yt=o&&He==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":ae.prefix,style:{width:G(K),...H>0?{marginLeft:G(H)}:{}},children:[r.jsx("p",{className:ae.className,style:ae.style,children:ae.text}),yt&&ae.marginLeftKey?r.jsx("div",{"data-controls":ae.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(be),style:{position:"absolute",top:0,left:G(-H),width:G(Ue),height:"100%",pointerEvents:"auto"}}):null,yt?r.jsx("div",{"data-controls":ae.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ae),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:G(-gn/2),width:G(gn),height:"100%",pointerEvents:"auto"}}):null]},ae.className)},y=(ae="two-row")=>{const He=We.findIndex(K=>K.prefix==="title1"),g=He>=0?st[He]:at.title1Width,H=ae==="two-row"&&o;return r.jsx("div",{...H?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(g)}:{},style:{width:G(F??0),flexShrink:0,alignSelf:"stretch",...H?{pointerEvents:"auto"}:{}}})},fe=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:T,"aria-hidden":"true",children:" "}),Le=()=>r.jsx("span",{className:`${e}-entry-counter`,style:ne,"aria-live":"polite","aria-atomic":"true",children:Eg(me,de,b,t)}),Me=()=>Ft?o&&xt?r.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Le(),r.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${Kr(D)} + ${D}))`,width:Kr(D),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Le():null,et=()=>!Ft&&!xt?null:r.jsxs("div",{className:`${e}-titles-row-header-controls`,style:qt,children:[Me(),xt?ft():null]}),Mt=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Ft||Gt?fe():null,jt?y("single-row"):null,Tt(Y),r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),et(),Sn()]}),Ye=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Ft||Gt?fe():null,jt?y("single-row"):null,r.jsxs("div",{className:`${e}-titles-row-titles`,style:ge&&_?{minHeight:_}:void 0,children:[r.jsx("div",{ref:nt,className:Zt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ti(ee||Y)}),r.jsxs("div",{ref:ht,className:Zt,style:{position:ge?"absolute":"relative",inset:ge?0:void 0,width:"100%",...ge&&te?{width:te,maxWidth:"100%"}:void 0},children:[vt&&ge?r.jsx("div",{className:`${tn} ${e}-titles-fade-out`,children:ti(vt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${ge?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:ti(Y)})]})]}),et(),Sn()]}),ft=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:S.scalingValue(E??0,i),height:S.scalingValue(E??0,i),marginRight:oe,"--close-icon-hover-color":P},children:[r.jsx("button",{ref:ye,type:"button",className:`${e}-close-icon-inner`,onClick:ze,"aria-label":"Close",children:r.jsx(rn,{url:W??"",fill:Z,hoverFill:i&&!s?Z:P,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:oe,height:"100%",pointerEvents:"auto"}})]}),Nt=(ae,He)=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[Ft||Gt?fe():null,jt?y("two-row"):null,He!==void 0?r.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:He},children:ae}):r.jsxs(r.Fragment,{children:[ae,r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),et()]}),Tt=ae=>{if(!ae)return null;const He=Vn(e,ae,T,ue,A);return r.jsx(r.Fragment,{children:He.map(g=>wt(g,"single-row",At(He,g,"single-row")))})},nn=ae=>{if(!ae)return null;const He=Vn(e,ae,T,ue,A),g=He.find(H=>H.prefix==="title1");return g?wt(g,"two-row-top",At(He,g,"two-row-top")):null},dn=(ae,He=!1)=>{const g=ae?Vn(e,ae,T,ue,A):[],H=g.filter(Ae=>Ae.prefix==="title2"||Ae.prefix==="title3"),K=o&&He;return H.length>0||K||(C??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(Ae=>wt(Ae,"two-row-bottom",At(g,Ae,"two-row-bottom"))),He&&o?r.jsxs(r.Fragment,{children:[Fr(),Wr()]}):null]}):null,(C??0)>0||K?r.jsx("div",{"data-controls":K?"titleRowMarginBottom":void 0,"data-controls-axis":K?"y":void 0,"data-controls-reverse":K?"":void 0,className:K?`${e}-control`:void 0,style:{height:cn,width:"100%",flexShrink:0,pointerEvents:K?"auto":"none"}}):null]}):null},ei=(ae,He=!1)=>r.jsxs(r.Fragment,{children:[Nt(nn(ae)),dn(ae,He)]}),ti=ae=>J?r.jsx("div",{className:`${e}-titles-row-two-row`,children:ei(ae)}):ae?r.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:Tt(ae)}):null,Ao=()=>{const ae=J?-1:We.findIndex(H=>H.prefix==="title1"),He=!J&&(o||(F??0)>0)?(()=>{const H=F??0,K=ae>=0?st[ae]:at.title1Width,be=Math.max(H,Bn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(K),style:{position:"absolute",top:0,left:0,width:G(be),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,g=We.flatMap((H,K)=>{if(!H.marginLeftKey)return[];const be=$e[H.marginLeftKey]??0,Ae=xc(We,st,$e,K)+Bt(),Ue=Math.max(be,Bn);return r.jsx("div",{"data-controls":H.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(st[K]),style:{position:"absolute",top:0,left:G(Ae),width:G(Ue),height:"100%",pointerEvents:"auto"}},H.marginLeftKey)});return He?[He,...g]:g},Fo=()=>We.map((ae,He)=>{const g=sn(He,st),K=zt(He)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":ae.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(g),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:G(K),width:G(gn),height:"100%",pointerEvents:"auto"}})},`${ae.widthKey}-junction`)}),Fr=()=>ot.flatMap((ae,He)=>{if(!ae.marginLeftKey)return[];const g=$e[ae.marginLeftKey]??0,H=Wt(He),K=Math.max(g,Bn),{resolvedWidth:be}=Et(ae,"two-row-bottom");return r.jsx("div",{"data-controls":ae.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(be),style:{position:"absolute",top:0,left:G(H),width:G(K),height:"100%",pointerEvents:"auto"}},ae.marginLeftKey)}),Wr=()=>ot.map((ae,He)=>{const{maxWidth:g}=Et(ae,"two-row-bottom"),K=_t(He)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":ae.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(g),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:G(K),width:G(gn),height:"100%",pointerEvents:"auto"}})},`${ae.widthKey}-junction`)}),Sn=()=>!o||J?null:r.jsxs(r.Fragment,{children:[Ao(),Fo()]}),xi=ae=>{const He=!ae.objectFit&&Fn(w);return{className:`${e}-slide-image-cell${He?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:$,maxHeight:I,...He?{"--image-aspect-ratio":kr(w)}:{}}}},Wo=ae=>ae.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":ae.objectFit}}:Fn(w)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},ni=ae=>{if(ae.length===0)return null;const He=ae.length>1,g=Kr(ie),H=`calc(-0.5 * (${g} + ${ie}))`;if(ae.length===1){const K=ae[0];return r.jsx("div",{...xi(K),children:r.jsx("img",{...Wo(K),src:K.url,alt:K.name??"",draggable:!1})})}return r.jsx("div",{className:`${e}-slide-inner`,style:He?{gap:ie}:void 0,children:ae.map((K,be)=>r.jsxs("div",{...xi(K),children:[r.jsx("img",{...Wo(K),src:K.url,alt:K.name??"",draggable:!1}),o&&He&&be<ae.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:H,width:g,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${K.url}-${be}`))})},_o=!!(Y!=null&&Y.title2||Y!=null&&Y.title3||vt!=null&&vt.title2||vt!=null&&vt.title3||(C??0)>0||o),_r=()=>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:nt,className:Zt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ei(ee||Y)}),r.jsxs("div",{ref:ht,className:`${e}-titles-row-two-row`,style:{...ge&&_?{minHeight:_}:void 0,...ge&&te?{width:te,maxWidth:"100%"}:void 0},children:[Nt(r.jsxs("div",{className:Zt,style:{position:ge?"absolute":"relative",inset:ge?0:void 0,width:"100%"},children:[vt&&ge?r.jsx("div",{className:`${Ct} ${e}-titles-fade-out`,children:nn(vt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${ge?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:nn(Y)})]}),ge&&_?_:void 0),_o?r.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[vt&&ge?r.jsx("div",{className:`${tn} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:dn(vt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${ge?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${J?` ${e}-titles-layer-in-stacked`:""}`,children:dn(Y,!0)})]}):null]})]}),Nr=()=>{const ae=_o;return r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...ae?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:ae?void 0:{flex:"0 0 auto",height:"auto"},children:ei(Y,!0)}),Sn()]})};return r.jsxs("div",{ref:Be,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{ct||ze()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:xt?void 0:-1,style:{opacity:_e?1:0,transition:"opacity 300ms ease",pointerEvents:_e?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:f,...Je}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:Ke,...Fe,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:$t,onClick:ae=>ae.stopPropagation(),children:r.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":ve&&me.length>1?"true":"false",onPointerDown:ve?kt:void 0,onPointerUp:ve?Xt:void 0,onPointerCancel:ve?Yt:void 0,children:r.jsxs("div",{className:`${e}-slide-stack`,children:[bt&&he?r.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:ae=>{ae.target===ae.currentTarget&&Ne(Re)},children:r.jsx("div",{className:`${e}-slide-area`,children:ni(bt.images)})},`slide-out-${Re}`):null,r.jsx("div",{className:`${e}-slide-layer-in${he?` ${e}-slide-fade-in`:""}`,children:r.jsx("div",{className:`${e}-slide-area`,children:Q?ni(Q.images):null})},`slide-in-${Re}-${de}`)]})})}),r.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:dt,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:se,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...J?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${J?` ${e}-lightbox-content-area-stacked`:""}`,children:Ht&&r.jsx("div",{className:`${e}-text-bar-cell${J?` ${e}-text-bar-cell-stacked`:""}`,style:J?void 0:{flex:1,minWidth:0,width:"100%"},children:J?M==="fade"?_r():Nr():M==="fade"?Ye():Mt()})})})]})]})]})};function my(e){return`
14183
14187
  .${e}-wrapper {
14184
14188
  position: relative;
14185
14189
  width: 100%;
@@ -14701,7 +14705,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
14701
14705
  pointer-events: auto;
14702
14706
  z-index: 10;
14703
14707
  }
14704
- `}const gy=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:s,metadata:l})=>{const{prefix:d}=S.useScopedStyles(),c=(l==null?void 0:l.itemId)??null,{cover:u,coverFit:p,type:b}=e,w=a.useRef(null),[f,h]=a.useState(!1),[m,v]=a.useState(0),M=a.useRef(!1),R=a.useRef(!1),L=a.useRef(!1),X=a.useMemo(()=>(t??[]).filter(x=>Hi(x).length>0),[t]),A=f&&X.length>0,B=!n,P=a.useCallback(()=>{B&&(L.current=!0,Tg(R.current,c),R.current=!1)},[B,c]),C=(x=0)=>{if(X.length===0||n&&!i&&!o)return;const W=or(X,b),E=Math.max(0,Math.min(x,W.length-1));if(v(E),B){const Z=yc();fc(E+1,c,Z),R.current=!Z}h(!0)},j=a.useCallback(()=>{h(!1),L.current=!1},[]);return a.useEffect(()=>{!n||i||o||h(!1)},[n,i,o]),a.useEffect(()=>{if(!B||M.current)return;M.current=!0;const x=Ns(c);if(!x)return;const W=Hs(x,or(X,b).length);W<0||(v(W),h(!0))},[X,c,B,b]),a.useEffect(()=>{if(!B)return;const x=()=>{if(L.current){L.current=!1,h(!1);return}const W=Ns(c);if(!W){h(!1);return}const E=Hs(W,or(X,b).length);if(E<0){h(!1);return}R.current=!1,v(E),h(!0)};return window.addEventListener("popstate",x),()=>window.removeEventListener("popstate",x)},[X,c,B,b]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:w,className:`${d}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:my(d)}}),u?r.jsx("button",{type:"button",className:`${d}-cover ${Fn(p)?`${d}-ratio-wrapper-cover`:`${d}-ratio-wrapper-fit`}`,onClick:()=>C(),style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...Fn(p)?{"--image-aspect-ratio":kr(p)}:{}},"aria-label":"Open journal gallery",children:r.jsx("img",{className:`${d}-cover-image ${Fn(p)?`${d}-cover-image-cover`:`${d}-cover-image-fit`}`,src:u,alt:"cover"})}):null]}),A&&typeof document<"u"&&(()=>{const x=(s?document.getElementById(s):null)??document.body;return Yn.createPortal(r.jsx(py,{prefix:d,entries:X,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:m,enableUrlSync:B,journalItemId:c,onBeforeClose:P,onClose:j}),x)})()]})},hy=`import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
14708
+ `}const gy=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:s,metadata:l})=>{const{prefix:d}=S.useScopedStyles(),c=(l==null?void 0:l.itemId)??null,{cover:u,coverFit:p,type:b}=e,w=a.useRef(null),[f,h]=a.useState(!1),[m,v]=a.useState(0),M=a.useRef(!1),R=a.useRef(!1),L=a.useRef(!1),X=a.useMemo(()=>(t??[]).filter(x=>Hi(x).length>0),[t]),F=f&&X.length>0,B=!n,k=a.useCallback(()=>{B&&(L.current=!0,Tg(R.current,c),R.current=!1)},[B,c]),C=(x=0)=>{if(X.length===0||n&&!i&&!o)return;const W=or(X,b),E=Math.max(0,Math.min(x,W.length-1));if(v(E),B){const Z=yc();fc(E+1,c,Z),R.current=!Z}h(!0)},j=a.useCallback(()=>{h(!1),L.current=!1},[]);return a.useEffect(()=>{!n||i||o||h(!1)},[n,i,o]),a.useEffect(()=>{if(!B||M.current)return;M.current=!0;const x=Ns(c);if(!x)return;const W=Hs(x,or(X,b).length);W<0||(v(W),h(!0))},[X,c,B,b]),a.useEffect(()=>{if(!B)return;const x=()=>{if(L.current){L.current=!1,h(!1);return}const W=Ns(c);if(!W){h(!1);return}const E=Hs(W,or(X,b).length);if(E<0){h(!1);return}R.current=!1,v(E),h(!0)};return window.addEventListener("popstate",x),()=>window.removeEventListener("popstate",x)},[X,c,B,b]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:w,className:`${d}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:my(d)}}),u?r.jsx("button",{type:"button",className:`${d}-cover ${Fn(p)?`${d}-ratio-wrapper-cover`:`${d}-ratio-wrapper-fit`}`,onClick:()=>C(),style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...Fn(p)?{"--image-aspect-ratio":kr(p)}:{}},"aria-label":"Open journal gallery",children:r.jsx("img",{className:`${d}-cover-image ${Fn(p)?`${d}-cover-image-cover`:`${d}-cover-image-fit`}`,src:u,alt:"cover"})}):null]}),F&&typeof document<"u"&&(()=>{const x=(s?document.getElementById(s):null)??document.body;return Yn.createPortal(r.jsx(py,{prefix:d,entries:X,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:m,enableUrlSync:B,journalItemId:c,onBeforeClose:k,onClose:j}),x)})()]})},hy=`import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
14705
14709
  import { createPortal } from 'react-dom';
14706
14710
  import { CommonComponentProps } from '../props';
14707
14711
  import { useScopedStyles } from '../utils/useScopedStyles';
@@ -15492,7 +15496,7 @@ export type LightboxJournalSettings = {
15492
15496
  width: 32px;
15493
15497
  height: 32px;
15494
15498
  }
15495
- `}function Ly(e){return new Promise(t=>{const n=new Image;n.onload=()=>{t({aspectRatio:n.naturalHeight/n.naturalWidth,naturalWidth:n.naturalWidth})},n.onerror=()=>{t({aspectRatio:1,naturalWidth:700})},n.src=e})}async function Ry(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await Ly(i)]));return new Map(n)}function Iy({settings:e,content:t=[],isEditor:n}){const{prefix:i}=S.useScopedStyles(),[o,s]=a.useState(null),[l,d]=a.useState([]),[c,u]=a.useState(0),p=a.useRef(0),[b,w]=a.useState({x:0,y:0}),[f,h]=a.useState("none"),m=a.useRef({x:0,y:0}),[v,M]=a.useState(!1),[R,L]=a.useState(!1),X=a.useRef(new Map),{imageSize:A=$y,cursor:B="system",target:P="area",position:C="random",visible:j="all",defaultCursor:x=null,hoverCursor:W=null}=e,E=t.filter($=>{var I;return!!((I=$==null?void 0:$.image)!=null&&I.url)}),Z=a.useMemo(()=>Ty(i),[i]),k=a.useCallback(($,I,D=l)=>{if(!o)return;const se=o.getBoundingClientRect(),oe=$-se.left,T=I-se.top;w({x:oe,y:T}),h(Cy(oe,T,D,o,B,P,W,x))},[o,l,B,P,W,x]);a.useEffect(()=>{const $=[...E.map(D=>D.image.url),x,W].filter(D=>!!D);if($.length===0){X.current=new Map,L(!0);return}let I=!1;return L(!1),Ry($).then(D=>{I||(X.current=D,L(!0))}),()=>{I=!0}},[t,x,W]),a.useEffect(()=>{if(!o)return;const $=D=>{D.stopPropagation(),m.current={x:D.clientX,y:D.clientY},k(D.clientX,D.clientY)},I=()=>{v&&k(m.current.x,m.current.y)};return o.addEventListener("mousemove",$),window.addEventListener("scroll",I,!0),()=>{o.removeEventListener("mousemove",$),window.removeEventListener("scroll",I,!0)}},[o,v,k]),a.useEffect(()=>{!o||!v||k(m.current.x,m.current.y)},[l,o,v,k]),a.useEffect(()=>{v||h("none")},[v]);const U=($,I,D,se={})=>{var J,ve;if(!((J=$==null?void 0:$.image)!=null&&J.url))return null;const oe=((ve=X.current.get($.image.url))==null?void 0:ve.aspectRatio)??1,T=pl($.image.url,A,X.current),{heightPx:ue}=hr(T,oe);let F=0,ne=0;return C==="same"?{x:F,y:ne}=ul(I,D,T,oe):(F=se.x??Math.random()*I,ne=se.y??Math.random()*D,{x:F,y:ne}=Ta(F,ne,I,D,T,ue)),{id:p.current++,url:$.image.url,link:$.link,name:$.image.name,x:F,y:ne,xRatio:F/I,yRatio:ne/D,aspectRatio:oe,widthPx:T}},V=()=>{if(!o)return;const $=o.getBoundingClientRect(),I=$.width,D=$.height;I===0||D===0||d(se=>se.length===0?se:se.map(oe=>{const T=A.sizeType==="random"?oe.widthPx:pl(oe.url,A,X.current),{heightPx:ue}=hr(T,oe.aspectRatio);if(C==="same"){const{x:J,y:ve}=ul(I,D,T,oe.aspectRatio);return{...oe,x:J,y:ve,widthPx:T}}const{x:F,y:ne}=Ta(oe.xRatio*I,oe.yRatio*D,I,D,T,ue);return{...oe,x:F,y:ne,widthPx:T}}))};a.useEffect(()=>{if(!o||E.length===0||!R)return;const $=o.getBoundingClientRect(),I=$.width,D=$.height,se=U(E[0],I,D);se&&(d([se]),u(E.length>1?1:0))},[A,C,o,t,R]),a.useEffect(()=>{if(!o)return;V();const $=new ResizeObserver(V);return $.observe(o),window.addEventListener("resize",V),()=>{$.disconnect(),window.removeEventListener("resize",V)}},[o,C,A,l.length]),a.useEffect(()=>{j==="last One"&&d($=>$.length>0?[$[$.length-1]]:[])},[j]);const G=$=>{if(!o||E.length===0||!R)return;const I=o.getBoundingClientRect(),D=$.clientX-I.left,se=$.clientY-I.top;if(P==="image"&&!Nc(D,se,l))return;let oe=0,T=0;C==="on Click"?(oe=D,T=se):C==="same"?(oe=I.width/2,T=I.height/2):(oe=Math.random()*I.width,T=Math.random()*I.height);const ue=E[c%E.length],F=U(ue,I.width,I.height,{x:oe,y:T});if(!F)return;const ne=j==="all"?[...l,F]:[F];d(ne),u(J=>(J+1)%E.length),k($.clientX,$.clientY,ne)},ie=B==="custom"&&f!=="none";return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Z}}),r.jsxs("div",{ref:s,onClick:G,onMouseEnter:()=>M(!0),onMouseLeave:()=>M(!1),className:`${i}-root`,style:{cursor:ie?"none":"default"},children:[l.map($=>r.jsx("div",{className:`${i}-wrapper`,style:{top:`${$.y}px`,left:`${$.x}px`,width:`${$.widthPx}px`,cursor:ie?"none":"default"},children:P==="area"&&$.link?r.jsx("a",{href:$.link,target:"_blank",rel:"noreferrer",className:`${i}-link`,children:r.jsx("img",{src:$.url,alt:$.name,className:`${i}-image`})}):r.jsx("img",{src:$.url,alt:$.name,className:`${i}-image`})},$.id)),v&&ie&&r.jsx("div",{className:`${i}-cursor`,style:{left:`${b.x}px`,top:`${b.y}px`,transform:"translate(-50%, -50%)",backgroundImage:`url('${f}')`,backgroundSize:"cover",backgroundPosition:"center"}})]})]})}const My=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
15499
+ `}function Ly(e){return new Promise(t=>{const n=new Image;n.onload=()=>{t({aspectRatio:n.naturalHeight/n.naturalWidth,naturalWidth:n.naturalWidth})},n.onerror=()=>{t({aspectRatio:1,naturalWidth:700})},n.src=e})}async function Ry(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await Ly(i)]));return new Map(n)}function Iy({settings:e,content:t=[],isEditor:n}){const{prefix:i}=S.useScopedStyles(),[o,s]=a.useState(null),[l,d]=a.useState([]),[c,u]=a.useState(0),p=a.useRef(0),[b,w]=a.useState({x:0,y:0}),[f,h]=a.useState("none"),m=a.useRef({x:0,y:0}),[v,M]=a.useState(!1),[R,L]=a.useState(!1),X=a.useRef(new Map),{imageSize:F=$y,cursor:B="system",target:k="area",position:C="random",visible:j="all",defaultCursor:x=null,hoverCursor:W=null}=e,E=t.filter($=>{var I;return!!((I=$==null?void 0:$.image)!=null&&I.url)}),Z=a.useMemo(()=>Ty(i),[i]),P=a.useCallback(($,I,D=l)=>{if(!o)return;const se=o.getBoundingClientRect(),oe=$-se.left,T=I-se.top;w({x:oe,y:T}),h(Cy(oe,T,D,o,B,k,W,x))},[o,l,B,k,W,x]);a.useEffect(()=>{const $=[...E.map(D=>D.image.url),x,W].filter(D=>!!D);if($.length===0){X.current=new Map,L(!0);return}let I=!1;return L(!1),Ry($).then(D=>{I||(X.current=D,L(!0))}),()=>{I=!0}},[t,x,W]),a.useEffect(()=>{if(!o)return;const $=D=>{D.stopPropagation(),m.current={x:D.clientX,y:D.clientY},P(D.clientX,D.clientY)},I=()=>{v&&P(m.current.x,m.current.y)};return o.addEventListener("mousemove",$),window.addEventListener("scroll",I,!0),()=>{o.removeEventListener("mousemove",$),window.removeEventListener("scroll",I,!0)}},[o,v,P]),a.useEffect(()=>{!o||!v||P(m.current.x,m.current.y)},[l,o,v,P]),a.useEffect(()=>{v||h("none")},[v]);const U=($,I,D,se={})=>{var J,ve;if(!((J=$==null?void 0:$.image)!=null&&J.url))return null;const oe=((ve=X.current.get($.image.url))==null?void 0:ve.aspectRatio)??1,T=pl($.image.url,F,X.current),{heightPx:ue}=hr(T,oe);let A=0,ne=0;return C==="same"?{x:A,y:ne}=ul(I,D,T,oe):(A=se.x??Math.random()*I,ne=se.y??Math.random()*D,{x:A,y:ne}=Ta(A,ne,I,D,T,ue)),{id:p.current++,url:$.image.url,link:$.link,name:$.image.name,x:A,y:ne,xRatio:A/I,yRatio:ne/D,aspectRatio:oe,widthPx:T}},V=()=>{if(!o)return;const $=o.getBoundingClientRect(),I=$.width,D=$.height;I===0||D===0||d(se=>se.length===0?se:se.map(oe=>{const T=F.sizeType==="random"?oe.widthPx:pl(oe.url,F,X.current),{heightPx:ue}=hr(T,oe.aspectRatio);if(C==="same"){const{x:J,y:ve}=ul(I,D,T,oe.aspectRatio);return{...oe,x:J,y:ve,widthPx:T}}const{x:A,y:ne}=Ta(oe.xRatio*I,oe.yRatio*D,I,D,T,ue);return{...oe,x:A,y:ne,widthPx:T}}))};a.useEffect(()=>{if(!o||E.length===0||!R)return;const $=o.getBoundingClientRect(),I=$.width,D=$.height,se=U(E[0],I,D);se&&(d([se]),u(E.length>1?1:0))},[F,C,o,t,R]),a.useEffect(()=>{if(!o)return;V();const $=new ResizeObserver(V);return $.observe(o),window.addEventListener("resize",V),()=>{$.disconnect(),window.removeEventListener("resize",V)}},[o,C,F,l.length]),a.useEffect(()=>{j==="last One"&&d($=>$.length>0?[$[$.length-1]]:[])},[j]);const G=$=>{if(!o||E.length===0||!R)return;const I=o.getBoundingClientRect(),D=$.clientX-I.left,se=$.clientY-I.top;if(k==="image"&&!Nc(D,se,l))return;let oe=0,T=0;C==="on Click"?(oe=D,T=se):C==="same"?(oe=I.width/2,T=I.height/2):(oe=Math.random()*I.width,T=Math.random()*I.height);const ue=E[c%E.length],A=U(ue,I.width,I.height,{x:oe,y:T});if(!A)return;const ne=j==="all"?[...l,A]:[A];d(ne),u(J=>(J+1)%E.length),P($.clientX,$.clientY,ne)},ie=B==="custom"&&f!=="none";return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Z}}),r.jsxs("div",{ref:s,onClick:G,onMouseEnter:()=>M(!0),onMouseLeave:()=>M(!1),className:`${i}-root`,style:{cursor:ie?"none":"default"},children:[l.map($=>r.jsx("div",{className:`${i}-wrapper`,style:{top:`${$.y}px`,left:`${$.x}px`,width:`${$.widthPx}px`,cursor:ie?"none":"default"},children:k==="area"&&$.link?r.jsx("a",{href:$.link,target:"_blank",rel:"noreferrer",className:`${i}-link`,children:r.jsx("img",{src:$.url,alt:$.name,className:`${i}-image`})}):r.jsx("img",{src:$.url,alt:$.name,className:`${i}-image`})},$.id)),v&&ie&&r.jsx("div",{className:`${i}-cursor`,style:{left:`${b.x}px`,top:`${b.y}px`,transform:"translate(-50%, -50%)",backgroundImage:`url('${f}')`,backgroundSize:"cover",backgroundPosition:"center"}})]})]})}const My=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
15496
15500
  import { CommonComponentProps } from '../props';
15497
15501
  import { useScopedStyles } from '../utils/index';
15498
15502
 
@@ -16132,7 +16136,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
16132
16136
  display: block;
16133
16137
  pointer-events: none;
16134
16138
  }
16135
- `}function Wy(e){return e==="blur"?Ay:e==="greyscale"?ky:0}function no(e,t=1,n=1){const i=Wy(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 ml(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function _y(e,t){return t<=1?0:(e-1+t)%t}function Ny(e,t=1){return!e||e.height===0?t:e.width/e.height}function Hy(e,t,n,i,o){if(e<=0||t<=0)return{widthPercent:i,heightPercent:o};const s=e*i/100,l=t*o/100;let d=s,c=d/n;return c>l&&(c=l,d=c*n),{widthPercent:d/e*100,heightPercent:c/t*100}}function gl(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 Hc(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function hl(e,t,n){return{...Hc(e),[`--${n}-stage-scale`]:t}}function Oy(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 Dy({settings:e,content:t,isEditor:n,isPreviewMode:i}){var we,z,le,he,xe,Re,Te;const{prefix:o}=S.useScopedStyles(),s=a.useMemo(()=>Fy(o),[o]),{imageSize:l,maxWidth:d,maxHeight:c,transition:u=1e3,bgImage:p="greyscale"}=e,b=t??[],w=ml(b.length),[f,h]=a.useState(w.activeIndex),[m,v]=a.useState(w.backgroundIndex),[M,R]=a.useState(!1),[L,X]=a.useState(!1),[A,B]=a.useState(null),[P,C]=a.useState(null),[j,x]=a.useState(0),[W,E]=a.useState(1),[Z,k]=a.useState("none"),[U,V]=a.useState("next"),[G,ie]=a.useState({}),[$,I]=a.useState({width:0,height:0}),D=a.useRef(null),se=a.useRef(null),oe=!n||!!i,T=l??60,ue=Math.max(10,Math.min(100,d??T)),F=Math.max(10,Math.min(100,c??T)),ne=Math.max(100,u),J=no(p),ve=a.useCallback(_=>{const pe=Ny(_?G[_]:void 0);return Hy($.width,$.height,pe,ue,F)},[$.height,$.width,G,F,ue]);a.useEffect(()=>{const _=se.current;if(!_)return;const pe=new ResizeObserver(([te])=>{const{width:N,height:ee}=te.contentRect;I({width:N,height:ee})});return pe.observe(_),()=>pe.disconnect()},[]),a.useEffect(()=>{const _=(t??[]).map(pe=>{var te;return(te=pe.image)==null?void 0:te.url}).filter(pe=>!!pe);Oy(_,(pe,te)=>{ie(N=>{var ee,Ie;return((ee=N[pe])==null?void 0:ee.width)===te.width&&((Ie=N[pe])==null?void 0:Ie.height)===te.height?N:{...N,[pe]:te}})})},[t]),a.useEffect(()=>{const{backgroundIndex:_,activeIndex:pe}=ml(b.length);h(pe),v(_),R(!1),X(!1),B(null),C(null),x(0),E(1),k("none"),V("next")},[b.length,t]),a.useEffect(()=>()=>{D.current&&clearTimeout(D.current)},[]);const Ee=a.useCallback(_=>{var re,O,Ve,Oe;if(!oe||M||b.length<=1)return;const pe=_==="next"?(f+1)%b.length:(f-1+b.length)%b.length,te=ve((O=(re=b[f])==null?void 0:re.image)==null?void 0:O.url),N=ve((Oe=(Ve=b[pe])==null?void 0:Ve.image)==null?void 0:Oe.url),ee=gl($.width,$.height,te),Ie=gl($.width,$.height,N);D.current&&clearTimeout(D.current),V(_),X(!0),R(!0),_==="next"?(B(f),C(pe),x(0),E(1),k(no(p,0,1))):(v(_y(pe,b.length)),B(pe),C(f),x(1),E(Ie),k(no(p,1,Ie))),requestAnimationFrame(()=>{X(!1),requestAnimationFrame(()=>{_==="next"?(x(1),E(ee),k(no(p,1,ee))):(x(0),E(1),k(no(p,0,1)))})}),D.current=setTimeout(()=>{_==="next"&&v(f),h(pe),B(null),C(null),R(!1)},ne)},[f,p,$.height,$.width,ve,M,oe,b,ne]),me=b[f],de=m!==null?b[m]:null,q=A!==null?b[A]:null,Q=P!==null?b[P]:null,Y=b.length<=1?0:(f-1+b.length)%b.length,_e=b.length<=1?0:(f+1)%b.length,Ce=ve((we=me==null?void 0:me.image)==null?void 0:we.url),ke=ve((z=q==null?void 0:q.image)==null?void 0:z.url),ce=ve((le=Q==null?void 0:Q.image)==null?void 0:le.url),ge={[`--${o}-transition-ms`]:`${ne}ms`};return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:s}}),r.jsxs("div",{ref:se,className:rt(`${o}-wrapper`,L&&`${o}-snap`,n&&!i&&`${o}-editor`),style:ge,"aria-label":"Zoom gallery",children:[((he=de==null?void 0:de.image)==null?void 0:he.url)&&r.jsx("div",{className:`${o}-background`,"aria-hidden":"true",children:r.jsx("img",{className:`${o}-effect-image`,src:de.image.url,alt:"",style:{filter:J}})}),M&&((xe=q==null?void 0:q.image)==null?void 0:xe.url)&&r.jsx("div",{className:rt(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${U}`),style:hl(ke,W,o),"aria-hidden":"true",children:r.jsx("img",{className:`${o}-effect-image`,src:q.image.url,alt:"",style:{filter:Z}})}),M&&((Re=Q==null?void 0:Q.image)==null?void 0:Re.url)&&r.jsx("div",{className:rt(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${U}`),style:hl(ce,j,o),"aria-hidden":"true",children:r.jsx("img",{className:`${o}-image`,src:Q.image.url,alt:""})}),!M&&((Te=me==null?void 0:me.image)==null?void 0:Te.url)&&r.jsx("div",{className:rt(`${o}-stage`,`${o}-foreground`),style:Hc(Ce),children:r.jsx("img",{className:`${o}-image`,src:me.image.url,alt:me.image.name??""})}),oe&&b.length>1&&!M&&r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:rt(`${o}-nav`,`${o}-nav-prev`),onClick:()=>Ee("prev"),"aria-label":`Show previous image (${Y+1} of ${b.length})`}),r.jsx("button",{type:"button",className:rt(`${o}-nav`,`${o}-nav-next`),onClick:()=>Ee("next"),"aria-label":`Show next image (${_e+1} of ${b.length})`})]})]})]})}const jy=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
16139
+ `}function Wy(e){return e==="blur"?Ay:e==="greyscale"?ky:0}function no(e,t=1,n=1){const i=Wy(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 ml(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function _y(e,t){return t<=1?0:(e-1+t)%t}function Ny(e,t=1){return!e||e.height===0?t:e.width/e.height}function Hy(e,t,n,i,o){if(e<=0||t<=0)return{widthPercent:i,heightPercent:o};const s=e*i/100,l=t*o/100;let d=s,c=d/n;return c>l&&(c=l,d=c*n),{widthPercent:d/e*100,heightPercent:c/t*100}}function gl(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 Hc(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function hl(e,t,n){return{...Hc(e),[`--${n}-stage-scale`]:t}}function Oy(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 Dy({settings:e,content:t,isEditor:n,isPreviewMode:i}){var we,z,le,he,xe,Re,Te;const{prefix:o}=S.useScopedStyles(),s=a.useMemo(()=>Fy(o),[o]),{imageSize:l,maxWidth:d,maxHeight:c,transition:u=1e3,bgImage:p="greyscale"}=e,b=t??[],w=ml(b.length),[f,h]=a.useState(w.activeIndex),[m,v]=a.useState(w.backgroundIndex),[M,R]=a.useState(!1),[L,X]=a.useState(!1),[F,B]=a.useState(null),[k,C]=a.useState(null),[j,x]=a.useState(0),[W,E]=a.useState(1),[Z,P]=a.useState("none"),[U,V]=a.useState("next"),[G,ie]=a.useState({}),[$,I]=a.useState({width:0,height:0}),D=a.useRef(null),se=a.useRef(null),oe=!n||!!i,T=l??60,ue=Math.max(10,Math.min(100,d??T)),A=Math.max(10,Math.min(100,c??T)),ne=Math.max(100,u),J=no(p),ve=a.useCallback(_=>{const pe=Ny(_?G[_]:void 0);return Hy($.width,$.height,pe,ue,A)},[$.height,$.width,G,A,ue]);a.useEffect(()=>{const _=se.current;if(!_)return;const pe=new ResizeObserver(([te])=>{const{width:N,height:ee}=te.contentRect;I({width:N,height:ee})});return pe.observe(_),()=>pe.disconnect()},[]),a.useEffect(()=>{const _=(t??[]).map(pe=>{var te;return(te=pe.image)==null?void 0:te.url}).filter(pe=>!!pe);Oy(_,(pe,te)=>{ie(N=>{var ee,Ie;return((ee=N[pe])==null?void 0:ee.width)===te.width&&((Ie=N[pe])==null?void 0:Ie.height)===te.height?N:{...N,[pe]:te}})})},[t]),a.useEffect(()=>{const{backgroundIndex:_,activeIndex:pe}=ml(b.length);h(pe),v(_),R(!1),X(!1),B(null),C(null),x(0),E(1),P("none"),V("next")},[b.length,t]),a.useEffect(()=>()=>{D.current&&clearTimeout(D.current)},[]);const Ee=a.useCallback(_=>{var re,O,Ve,Oe;if(!oe||M||b.length<=1)return;const pe=_==="next"?(f+1)%b.length:(f-1+b.length)%b.length,te=ve((O=(re=b[f])==null?void 0:re.image)==null?void 0:O.url),N=ve((Oe=(Ve=b[pe])==null?void 0:Ve.image)==null?void 0:Oe.url),ee=gl($.width,$.height,te),Ie=gl($.width,$.height,N);D.current&&clearTimeout(D.current),V(_),X(!0),R(!0),_==="next"?(B(f),C(pe),x(0),E(1),P(no(p,0,1))):(v(_y(pe,b.length)),B(pe),C(f),x(1),E(Ie),P(no(p,1,Ie))),requestAnimationFrame(()=>{X(!1),requestAnimationFrame(()=>{_==="next"?(x(1),E(ee),P(no(p,1,ee))):(x(0),E(1),P(no(p,0,1)))})}),D.current=setTimeout(()=>{_==="next"&&v(f),h(pe),B(null),C(null),R(!1)},ne)},[f,p,$.height,$.width,ve,M,oe,b,ne]),me=b[f],de=m!==null?b[m]:null,q=F!==null?b[F]:null,Q=k!==null?b[k]:null,Y=b.length<=1?0:(f-1+b.length)%b.length,_e=b.length<=1?0:(f+1)%b.length,Ce=ve((we=me==null?void 0:me.image)==null?void 0:we.url),ke=ve((z=q==null?void 0:q.image)==null?void 0:z.url),ce=ve((le=Q==null?void 0:Q.image)==null?void 0:le.url),ge={[`--${o}-transition-ms`]:`${ne}ms`};return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:s}}),r.jsxs("div",{ref:se,className:rt(`${o}-wrapper`,L&&`${o}-snap`,n&&!i&&`${o}-editor`),style:ge,"aria-label":"Zoom gallery",children:[((he=de==null?void 0:de.image)==null?void 0:he.url)&&r.jsx("div",{className:`${o}-background`,"aria-hidden":"true",children:r.jsx("img",{className:`${o}-effect-image`,src:de.image.url,alt:"",style:{filter:J}})}),M&&((xe=q==null?void 0:q.image)==null?void 0:xe.url)&&r.jsx("div",{className:rt(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${U}`),style:hl(ke,W,o),"aria-hidden":"true",children:r.jsx("img",{className:`${o}-effect-image`,src:q.image.url,alt:"",style:{filter:Z}})}),M&&((Re=Q==null?void 0:Q.image)==null?void 0:Re.url)&&r.jsx("div",{className:rt(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${U}`),style:hl(ce,j,o),"aria-hidden":"true",children:r.jsx("img",{className:`${o}-image`,src:Q.image.url,alt:""})}),!M&&((Te=me==null?void 0:me.image)==null?void 0:Te.url)&&r.jsx("div",{className:rt(`${o}-stage`,`${o}-foreground`),style:Hc(Ce),children:r.jsx("img",{className:`${o}-image`,src:me.image.url,alt:me.image.name??""})}),oe&&b.length>1&&!M&&r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:rt(`${o}-nav`,`${o}-nav-prev`),onClick:()=>Ee("prev"),"aria-label":`Show previous image (${Y+1} of ${b.length})`}),r.jsx("button",{type:"button",className:rt(`${o}-nav`,`${o}-nav-next`),onClick:()=>Ee("next"),"aria-label":`Show next image (${_e+1} of ${b.length})`})]})]})]})}const jy=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
16136
16140
  import cn from 'classnames';
16137
16141
  import { CommonComponentProps } from '../props';
16138
16142
  import { useScopedStyles } from '../utils/useScopedStyles';
@@ -16891,7 +16895,7 @@ a:active .${e}-button .${e}-icon-image,
16891
16895
  height: calc(1em * var(--${e}-icon-scale, 1));
16892
16896
  width: calc(1em * var(--${e}-icon-scale, 1));
16893
16897
  }
16894
- `}function sa(e,t,n="",i,o){const s=t();return r.jsxs("span",{className:`${e}-content-roll-wrap ${n}`.trim(),style:i,children:[r.jsx("span",{className:`${e}-content-roll-spacer`,"aria-hidden":"true",style:o,children:s}),r.jsxs("span",{className:`${e}-content-roll-viewport`,children:[r.jsx("span",{className:`${e}-content-roll-layer`,style:o,children:t()}),r.jsx("span",{className:`${e}-content-roll-layer ${e}-content-roll-layer-hover`,"aria-hidden":"true",style:o,children:t()})]})]})}function fl(e,t,n="fill",i=100,o=0,s){if(!t)return null;const l=r.jsx(rn,{url:t,fill:`var(--${e}-icon-color)`,hoverFill:`var(--${e}-icon-color)`,className:`${e}-icon-image`});if(n==="inline")return r.jsx("span",{className:`${e}-icon ${e}-icon-inline`,style:{[`--${e}-icon-scale`]:i/100},"aria-hidden":"true",children:l});if(n==="fixed"&&o>0){const d=S.scalingValue(o,s);return r.jsx("span",{className:`${e}-icon`,style:{width:d,height:d},"aria-hidden":"true",children:l})}return r.jsx("span",{className:`${e}-icon ${e}-icon-fill`,"aria-hidden":"true",children:l})}function Xy({settings:e,isEditor:t,isPreviewMode:n,activeEvent:i,hasLink:o}){const{prefix:s}=S.useScopedStyles(),l=a.useMemo(()=>Ky(s),[s]),{type:d="a",label:c="Button",icon:u,alignment:p="center",alignA:b,order:w="text-icon",gap:f=0,iconSize:h=0,iconWidthC:m=0,dimensions:v=!1,padding:M={top:0,right:0,bottom:0,left:0},cornerRadius:R=0,boxShadow:L={top:0,left:0,right:0,bottom:0},boxShadowColor:X="rgba(0, 0, 0, 0)",innerBoxShadow:A={top:0,left:0,right:0,bottom:0},innerBoxShadowColor:B="rgba(0, 0, 0, 0)",stroke:P=0,backgroundColor:C="#000000",textColor:j="#ffffff",borderColor:x="#ffffff",iconColor:W="#ffffff",hoverEffect:E="none",fontFamily:Z,fontSettings:k,fontSize:U,lineHeight:V,letterSpacing:G=0,wordSpacing:ie=0,textAppearance:$,stateOverrides:I,minWidth:D=0,minHeight:se=0,width:oe=0,height:T=0}=e,ue=S.buildColorVars(s,{backgroundColor:C,textColor:j,borderColor:x,iconColor:W,boxShadowColor:X,innerBoxShadowColor:B},Vy,Gy,I),F=i&&i!=="default"?`${s}-state-${i}`:"",ne=t&&!n?`${s}-editing`:"",J=E!=="none"&&(!t||n||i==="hover")?`${s}-hover-effect-${E}`:"",ve=E==="reveal"||E==="swipe",Ee=E==="content-roll",me=E==="reveal"&&(!t||n),de=v===!0,Q=d==="a"?b??p:p,Y=d==="c",_e=d!=="b",Ce={fontSettings:{fontFamily:Z,fontWeight:(k==null?void 0:k.fontWeight)??400,fontStyle:(k==null?void 0:k.fontStyle)??"normal"},fontSize:U??.01,lineHeight:V,letterSpacing:G,wordSpacing:ie,textAppearance:$,color:j},ce={..._e?on(Ut(Ce,t)):{},[`--${s}-box-shadow-x`]:S.scalingValue(L.left,t),[`--${s}-box-shadow-y`]:S.scalingValue(L.top,t),[`--${s}-box-shadow-blur`]:S.scalingValue(L.right,t),[`--${s}-box-shadow-spread`]:S.scalingValue(L.bottom,t),[`--${s}-inner-box-shadow-x`]:S.scalingValue(A.left,t),[`--${s}-inner-box-shadow-y`]:S.scalingValue(A.top,t),[`--${s}-inner-box-shadow-blur`]:S.scalingValue(A.right,t),[`--${s}-inner-box-shadow-spread`]:S.scalingValue(A.bottom,t),paddingTop:S.scalingValue(M.top,t),paddingRight:S.scalingValue(M.right,t),paddingBottom:S.scalingValue(M.bottom,t),paddingLeft:S.scalingValue(M.left,t),borderRadius:S.scalingValue(R,t),borderWidth:S.scalingValue(P,t),...Y?{}:{justifyContent:aa[Q],textAlign:Q},...Y&&!Ee?{gap:S.scalingValue(f,t)}:{},...de?{width:S.scalingValue(oe,t),height:S.scalingValue(T,t)}:{minWidth:S.scalingValue(D,t),minHeight:S.scalingValue(se,t),...Y?{width:"100%"}:{}}};let ge;const we={display:"inline-flex",alignItems:"center",justifyContent:Y?aa[Q]:aa[d==="a"?Q:"center"],gap:Y?S.scalingValue(f,t):void 0,width:"100%",height:"100%",...d==="a"?{textAlign:Q}:{}};if(d==="b"){const he=()=>fl(s,u,h>0?"fixed":"fill",100,h,t);ge=Ee?sa(s,he,`${s}-icon-roll`,void 0,we):he()}else if(d==="c"){const he=()=>{const xe=r.jsx("span",{className:`${s}-text`,style:{textAlign:Q},children:c}),Re=fl(s,u,m>0?"fixed":"fill",100,m,t);return w==="icon-text"?r.jsxs(r.Fragment,{children:[Re,xe]}):r.jsxs(r.Fragment,{children:[xe,Re]})};ge=Ee?sa(s,he,`${s}-icon-text-roll`,void 0,we):he()}else ge=Ee?sa(s,()=>c,`${s}-label-roll`,void 0,we):ve?r.jsx("span",{className:`${s}-button-inner`,children:c}):c;const z=me?he=>qy(he,s):void 0,le=me?he=>Uy(he,s):void 0;return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),r.jsx("div",{className:`${s}-root`,style:ue,children:r.jsx("div",{className:`${s}-wrapper ${F} ${ne}`.trim(),children:r.jsx("div",{className:`${s}-button ${J}`.trim(),style:ce,onMouseEnter:z,onMouseLeave:le,role:"button",tabIndex:o||t&&!n?void 0:0,children:ge})})})]})}const Yy=`import { useMemo, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
16898
+ `}function sa(e,t,n="",i,o){const s=t();return r.jsxs("span",{className:`${e}-content-roll-wrap ${n}`.trim(),style:i,children:[r.jsx("span",{className:`${e}-content-roll-spacer`,"aria-hidden":"true",style:o,children:s}),r.jsxs("span",{className:`${e}-content-roll-viewport`,children:[r.jsx("span",{className:`${e}-content-roll-layer`,style:o,children:t()}),r.jsx("span",{className:`${e}-content-roll-layer ${e}-content-roll-layer-hover`,"aria-hidden":"true",style:o,children:t()})]})]})}function fl(e,t,n="fill",i=100,o=0,s){if(!t)return null;const l=r.jsx(rn,{url:t,fill:`var(--${e}-icon-color)`,hoverFill:`var(--${e}-icon-color)`,className:`${e}-icon-image`});if(n==="inline")return r.jsx("span",{className:`${e}-icon ${e}-icon-inline`,style:{[`--${e}-icon-scale`]:i/100},"aria-hidden":"true",children:l});if(n==="fixed"&&o>0){const d=S.scalingValue(o,s);return r.jsx("span",{className:`${e}-icon`,style:{width:d,height:d},"aria-hidden":"true",children:l})}return r.jsx("span",{className:`${e}-icon ${e}-icon-fill`,"aria-hidden":"true",children:l})}function Xy({settings:e,isEditor:t,isPreviewMode:n,activeEvent:i,hasLink:o}){const{prefix:s}=S.useScopedStyles(),l=a.useMemo(()=>Ky(s),[s]),{type:d="a",label:c="Button",icon:u,alignment:p="center",alignA:b,order:w="text-icon",gap:f=0,iconSize:h=0,iconWidthC:m=0,dimensions:v=!1,padding:M={top:0,right:0,bottom:0,left:0},cornerRadius:R=0,boxShadow:L={top:0,left:0,right:0,bottom:0},boxShadowColor:X="rgba(0, 0, 0, 0)",innerBoxShadow:F={top:0,left:0,right:0,bottom:0},innerBoxShadowColor:B="rgba(0, 0, 0, 0)",stroke:k=0,backgroundColor:C="#000000",textColor:j="#ffffff",borderColor:x="#ffffff",iconColor:W="#ffffff",hoverEffect:E="none",fontFamily:Z,fontSettings:P,fontSize:U,lineHeight:V,letterSpacing:G=0,wordSpacing:ie=0,textAppearance:$,stateOverrides:I,minWidth:D=0,minHeight:se=0,width:oe=0,height:T=0}=e,ue=S.buildColorVars(s,{backgroundColor:C,textColor:j,borderColor:x,iconColor:W,boxShadowColor:X,innerBoxShadowColor:B},Vy,Gy,I),A=i&&i!=="default"?`${s}-state-${i}`:"",ne=t&&!n?`${s}-editing`:"",J=E!=="none"&&(!t||n||i==="hover")?`${s}-hover-effect-${E}`:"",ve=E==="reveal"||E==="swipe",Ee=E==="content-roll",me=E==="reveal"&&(!t||n),de=v===!0,Q=d==="a"?b??p:p,Y=d==="c",_e=d!=="b",Ce={fontSettings:{fontFamily:Z,fontWeight:(P==null?void 0:P.fontWeight)??400,fontStyle:(P==null?void 0:P.fontStyle)??"normal"},fontSize:U??.01,lineHeight:V,letterSpacing:G,wordSpacing:ie,textAppearance:$,color:j},ce={..._e?on(Ut(Ce,t)):{},[`--${s}-box-shadow-x`]:S.scalingValue(L.left,t),[`--${s}-box-shadow-y`]:S.scalingValue(L.top,t),[`--${s}-box-shadow-blur`]:S.scalingValue(L.right,t),[`--${s}-box-shadow-spread`]:S.scalingValue(L.bottom,t),[`--${s}-inner-box-shadow-x`]:S.scalingValue(F.left,t),[`--${s}-inner-box-shadow-y`]:S.scalingValue(F.top,t),[`--${s}-inner-box-shadow-blur`]:S.scalingValue(F.right,t),[`--${s}-inner-box-shadow-spread`]:S.scalingValue(F.bottom,t),paddingTop:S.scalingValue(M.top,t),paddingRight:S.scalingValue(M.right,t),paddingBottom:S.scalingValue(M.bottom,t),paddingLeft:S.scalingValue(M.left,t),borderRadius:S.scalingValue(R,t),borderWidth:S.scalingValue(k,t),...Y?{}:{justifyContent:aa[Q],textAlign:Q},...Y&&!Ee?{gap:S.scalingValue(f,t)}:{},...de?{width:S.scalingValue(oe,t),height:S.scalingValue(T,t)}:{minWidth:S.scalingValue(D,t),minHeight:S.scalingValue(se,t),...Y?{width:"100%"}:{}}};let ge;const we={display:"inline-flex",alignItems:"center",justifyContent:Y?aa[Q]:aa[d==="a"?Q:"center"],gap:Y?S.scalingValue(f,t):void 0,width:"100%",height:"100%",...d==="a"?{textAlign:Q}:{}};if(d==="b"){const he=()=>fl(s,u,h>0?"fixed":"fill",100,h,t);ge=Ee?sa(s,he,`${s}-icon-roll`,void 0,we):he()}else if(d==="c"){const he=()=>{const xe=r.jsx("span",{className:`${s}-text`,style:{textAlign:Q},children:c}),Re=fl(s,u,m>0?"fixed":"fill",100,m,t);return w==="icon-text"?r.jsxs(r.Fragment,{children:[Re,xe]}):r.jsxs(r.Fragment,{children:[xe,Re]})};ge=Ee?sa(s,he,`${s}-icon-text-roll`,void 0,we):he()}else ge=Ee?sa(s,()=>c,`${s}-label-roll`,void 0,we):ve?r.jsx("span",{className:`${s}-button-inner`,children:c}):c;const z=me?he=>qy(he,s):void 0,le=me?he=>Uy(he,s):void 0;return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),r.jsx("div",{className:`${s}-root`,style:ue,children:r.jsx("div",{className:`${s}-wrapper ${A} ${ne}`.trim(),children:r.jsx("div",{className:`${s}-button ${J}`.trim(),style:ce,onMouseEnter:z,onMouseLeave:le,role:"button",tabIndex:o||t&&!n?void 0:0,children:ge})})})]})}const Yy=`import { useMemo, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
16895
16899
  import { SvgImage } from '../helpers/SvgImage/SvgImage';
16896
16900
  import { CommonComponentProps } from '../props';
16897
16901
  import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
@@ -17518,7 +17522,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
17518
17522
  </>
17519
17523
  );
17520
17524
  }
17521
- `,Zy={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Jy=["backgroundColor","textColor","borderColor","iconColor","boxShadowColor","innerBoxShadowColor"],Qy={type:"object",version:1,settings:{sizing:"auto",hasLinkParameter:!0,properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},label:{type:"string",scope:"common",title:"Label",display:{type:"label-input"}},icon:{type:["string","null"],scope:"common",title:"Icon",display:{type:"settings-image-input",visible:!1}},alignment:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"]}},alignA:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"],visible:!1}},order:{type:"string",scope:"layout",title:"Order",display:{type:"toggle-cycle",enum:["text-icon","icon-text"],visible:!1}},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",visible:!1},min:0,max:9999},iconSize:{type:"number",scope:"layout",title:"Icon width",display:{type:"numeric-input",visible:!1},min:0,max:9999},iconWidthC:{type:"number",scope:"layout",title:"Icon width",display:{type:"numeric-input",visible:!1},min:0,max:9999},dimensions:{type:"boolean",scope:"layout",title:"Dimensions",display:{type:"toggle",enum:["auto","fixed"]}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},cornerRadius:{type:"number",scope:"layout",title:"Corner radius",min:0,display:{type:"numeric-input"}},boxShadow:{type:"object",scope:"layout",title:"Shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},boxShadowColor:{type:"string",scope:"common",title:"Shadow Default",titleByState:{default:"Shadow Default",hover:"Shadow Hover",active:"Shadow Active"},display:{type:"palette-color-picker"}},innerBoxShadow:{type:"object",scope:"layout",title:"Inner shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},innerBoxShadowColor:{type:"string",scope:"common",title:"Inner Shadow Default",titleByState:{default:"Inner Shadow Default",hover:"Inner Shadow Hover",active:"Inner Shadow Active"},display:{type:"palette-color-picker"}},stroke:{type:"number",scope:"layout",title:"Stroke Width",display:{type:"numeric-input"},min:0,max:9999},backgroundColor:{type:"string",scope:"common",title:"Background Default",titleByState:{default:"Background Default",hover:"Background Hover",active:"Background Active"},display:{type:"palette-color-picker"}},textColor:{type:"string",scope:"common",title:"Text Default",titleByState:{default:"Text Default",hover:"Text Hover",active:"Text Active"},display:{type:"palette-color-picker"}},borderColor:{type:"string",scope:"common",title:"Border Default",titleByState:{default:"Border Default",hover:"Border Hover",active:"Border Active"},display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",titleByState:{default:"Icon Default",hover:"Icon Hover",active:"Icon Active"},display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},hoverEffect:{type:"string",scope:"layout",title:"Hover effect",display:{type:"toggle-cycle",enum:["none","scale-up","lift","reveal","swipe","content-roll"]}},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},fontSettings:{...Zy.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},fontSize:{type:"number",scope:"layout",title:"Font size",display:{type:"font-size"}},lineHeight:{type:"number",scope:"layout",title:"Line height",display:{type:"line-height-input"}},letterSpacing:{type:"number",scope:"layout",title:"Letter spacing",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",scope:"layout",title:"Word spacing",display:{type:"word-spacing-input"}},textAppearance:{type:"object",scope:"layout",title:"Text appearance",display:{type:"text-appearance"}},minWidth:{type:"number",scope:"layout",title:"Min width",display:{type:"numeric-input"},min:0,max:9999},minHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},width:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input",visible:!1},min:0,max:9999},height:{type:"number",scope:"layout",title:"Height",display:{type:"numeric-input",visible:!1},min:0,max:9999}},defaults:{label:"Button",icon:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01KY78A0YVT403B042HVWWTHBC.svg",boxShadowColor:"#000000",innerBoxShadowColor:"#000000",backgroundColor:"#2E12F0",textColor:"#ffffff",borderColor:"#ffffff",iconColor:"#ffffff",fontFamily:"Arial",fontSettings:{fontWeight:400,fontStyle:"normal"},stateOverrides:{hover:{backgroundColor:"#3642EF"},active:{backgroundColor:"#475FFF"}}},layoutDefaults:{m:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/375,right:20/375,bottom:10/375,left:20/375},minWidth:0/375,minHeight:0/375,width:100/375,height:100/375,cornerRadius:20/375,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/375,gap:10/375,iconWidthC:16/375,fontSize:16/375,lineHeight:16/375,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},t:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/768,right:20/768,bottom:10/768,left:20/768},minWidth:0/768,minHeight:0/768,width:100/768,height:100/768,cornerRadius:20/768,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/768,gap:10/768,iconWidthC:16/768,fontSize:16/768,lineHeight:16/768,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},d:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/1440,right:20/1440,bottom:10/1440,left:20/1440},minWidth:0/1440,minHeight:0/1440,width:100/1440,height:100/1440,cornerRadius:20/1440,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/1440,gap:10/1440,iconWidthC:16/1440,fontSize:16/1440,lineHeight:16/1440,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}},layout:["__componentName__","type","label","icon","alignment","order","gap","iconSize","iconWidthC","hoverEffect",{type:"row",title:"",items:["dimensions","padding"]},"cornerRadius","boxShadow","boxShadowColor","innerBoxShadow","innerBoxShadowColor",{type:"row",title:"",items:["stroke","borderColor"]},{type:"row",title:"",items:["minWidth","minHeight","width","height"]}],displayRules:[{if:{name:"type",value:"a"},then:{name:"properties.icon.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignment.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignA.display.visible",value:!0}},{if:{name:"type",value:"a"},then:{name:"properties.iconColor.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"b"},then:{name:"properties.label.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontFamily.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSettings.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSize.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.lineHeight.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.letterSpacing.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.wordSpacing.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.textAppearance.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.iconSize.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.order.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.iconWidthC.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.gap.display.visible",value:!0}},{if:{name:"stroke",value:0},then:{name:"properties.borderColor.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minWidth.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minHeight.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.width.display.visible",value:!0}},{if:{name:"dimensions",value:!0},then:{name:"properties.height.display.visible",value:!0}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"",items:["label","icon","iconSize","alignA"]},{type:"row",title:"",items:["alignment","order"]},{type:"row",title:"",items:["gap","iconWidthC"]},{type:"row",title:"",items:["dimensions","padding"]},{type:"row",title:"",items:["minWidth","minHeight","width","height"]},{type:"row",title:"",items:["hoverEffect","cornerRadius"]},{type:"row",title:"",items:["boxShadow"]},{type:"row",title:"",items:["innerBoxShadow"]},{type:"row",title:"",items:["stroke"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily","fontSettings",{type:"row",title:"",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]},"textAppearance"]}],paletteBookmark:{items:[...Jy],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"],hover:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"],active:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"]}},states:["default","hover","active"]},ev={element:Xy,id:"simple-button",name:"Simple Button",category:"ui-elements",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/button-preview.png"},schema:Qy,sourceCode:Yy,assetsPaths:{content:[],parameters:[{path:"icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{fontSettings:"fontFamily"}};function tv(e){return`
17525
+ `,Zy={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Jy=["backgroundColor","textColor","borderColor","iconColor","boxShadowColor","innerBoxShadowColor"],Qy={type:"object",version:1,settings:{sizing:"auto",hasLinkParameter:!0,properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},label:{type:"string",scope:"common",title:"Label",display:{type:"label-input"}},icon:{type:["string","null"],scope:"common",title:"Icon",display:{type:"settings-image-input",visible:!1}},alignment:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"]}},alignA:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"],visible:!1}},order:{type:"string",scope:"layout",title:"Order",display:{type:"toggle-cycle",enum:["text-icon","icon-text"],visible:!1}},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",visible:!1},min:0,max:9999},iconSize:{type:"number",scope:"layout",title:"Icon width",display:{type:"numeric-input",visible:!1},min:0,max:9999},iconWidthC:{type:"number",scope:"layout",title:"Icon width",display:{type:"numeric-input",visible:!1},min:0,max:9999},dimensions:{type:"boolean",scope:"layout",title:"Dimensions",display:{type:"toggle",enum:["auto","fixed"]}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},cornerRadius:{type:"number",scope:"layout",title:"Corner radius",min:0,display:{type:"numeric-input"}},boxShadow:{type:"object",scope:"layout",title:"Shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},boxShadowColor:{type:"string",scope:"common",title:"Shadow Default",titleByState:{default:"Shadow Default",hover:"Shadow Hover",active:"Shadow Active"},display:{type:"palette-color-picker"}},innerBoxShadow:{type:"object",scope:"layout",title:"Inner shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},innerBoxShadowColor:{type:"string",scope:"common",title:"Inner Shadow Default",titleByState:{default:"Inner Shadow Default",hover:"Inner Shadow Hover",active:"Inner Shadow Active"},display:{type:"palette-color-picker"}},stroke:{type:"number",scope:"layout",title:"Stroke Width",display:{type:"numeric-input"},min:0,max:9999},backgroundColor:{type:"string",scope:"common",title:"BG Default",titleByState:{default:"BG Default",hover:"BG Hover",active:"BG Active"},display:{type:"palette-color-picker"}},textColor:{type:"string",scope:"common",title:"Text Default",titleByState:{default:"Text Default",hover:"Text Hover",active:"Text Active"},display:{type:"palette-color-picker"}},borderColor:{type:"string",scope:"common",title:"Border Default",titleByState:{default:"Border Default",hover:"Border Hover",active:"Border Active"},display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",titleByState:{default:"Icon Default",hover:"Icon Hover",active:"Icon Active"},display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},hoverEffect:{type:"string",scope:"layout",title:"Hover effect",display:{type:"toggle-cycle",enum:["none","scale-up","lift","reveal","swipe","content-roll"]}},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},fontSettings:{...Zy.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},fontSize:{type:"number",scope:"layout",title:"Font size",display:{type:"font-size"}},lineHeight:{type:"number",scope:"layout",title:"Line height",display:{type:"line-height-input"}},letterSpacing:{type:"number",scope:"layout",title:"Letter spacing",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",scope:"layout",title:"Word spacing",display:{type:"word-spacing-input"}},textAppearance:{type:"object",scope:"layout",title:"Text appearance",display:{type:"text-appearance"}},minWidth:{type:"number",scope:"layout",title:"Min width",display:{type:"numeric-input"},min:0,max:9999},minHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},width:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input",visible:!1},min:0,max:9999},height:{type:"number",scope:"layout",title:"Height",display:{type:"numeric-input",visible:!1},min:0,max:9999}},defaults:{label:"Button",icon:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01KY78A0YVT403B042HVWWTHBC.svg",boxShadowColor:"#000000",innerBoxShadowColor:"#000000",backgroundColor:"#2E12F0",textColor:"#ffffff",borderColor:"#ffffff",iconColor:"#ffffff",fontFamily:"Arial",fontSettings:{fontWeight:400,fontStyle:"normal"},stateOverrides:{hover:{backgroundColor:"#3642EF"},active:{backgroundColor:"#475FFF"}}},layoutDefaults:{m:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/375,right:20/375,bottom:10/375,left:20/375},minWidth:0/375,minHeight:0/375,width:100/375,height:100/375,cornerRadius:20/375,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/375,gap:10/375,iconWidthC:16/375,fontSize:16/375,lineHeight:16/375,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},t:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/768,right:20/768,bottom:10/768,left:20/768},minWidth:0/768,minHeight:0/768,width:100/768,height:100/768,cornerRadius:20/768,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/768,gap:10/768,iconWidthC:16/768,fontSize:16/768,lineHeight:16/768,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},d:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/1440,right:20/1440,bottom:10/1440,left:20/1440},minWidth:0/1440,minHeight:0/1440,width:100/1440,height:100/1440,cornerRadius:20/1440,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/1440,gap:10/1440,iconWidthC:16/1440,fontSize:16/1440,lineHeight:16/1440,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}},layout:["__componentName__","type","label","icon","alignment","order","gap","iconSize","iconWidthC","hoverEffect",{type:"row",title:"",items:["dimensions","padding"]},"cornerRadius","boxShadow","boxShadowColor","innerBoxShadow","innerBoxShadowColor",{type:"row",title:"",items:["stroke","borderColor"]},{type:"row",title:"",items:["minWidth","minHeight","width","height"]}],displayRules:[{if:{name:"type",value:"a"},then:{name:"properties.icon.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignment.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignA.display.visible",value:!0}},{if:{name:"type",value:"a"},then:{name:"properties.iconColor.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"b"},then:{name:"properties.label.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontFamily.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSettings.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSize.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.lineHeight.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.letterSpacing.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.wordSpacing.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.textAppearance.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.iconSize.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.order.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.iconWidthC.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.gap.display.visible",value:!0}},{if:{name:"stroke",value:0},then:{name:"properties.borderColor.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minWidth.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minHeight.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.width.display.visible",value:!0}},{if:{name:"dimensions",value:!0},then:{name:"properties.height.display.visible",value:!0}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"",items:["label","icon","iconSize","alignA"]},{type:"row",title:"",items:["alignment","order"]},{type:"row",title:"",items:["gap","iconWidthC"]},{type:"row",title:"",items:["dimensions","padding"]},{type:"row",title:"",items:["minWidth","minHeight","width","height"]},{type:"row",title:"",items:["hoverEffect","cornerRadius"]},{type:"row",title:"",items:["boxShadow"]},{type:"row",title:"",items:["innerBoxShadow"]},{type:"row",title:"",items:["stroke"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily","fontSettings",{type:"row",title:"",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]},"textAppearance"]}],paletteBookmark:{items:[...Jy],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"],hover:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"],active:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"]}},states:["default","hover","active"]},ev={element:Xy,id:"simple-button",name:"Simple Button",category:"ui-elements",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/button-preview.png"},schema:Qy,sourceCode:Yy,assetsPaths:{content:[],parameters:[{path:"icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{fontSettings:"fontFamily"}};function tv(e){return`
17522
17526
  .${e}-titles-row {
17523
17527
  position: relative;
17524
17528
  flex: 0 1 auto;
@@ -17716,7 +17720,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
17716
17720
  pointer-events: auto;
17717
17721
  flex-shrink: 0;
17718
17722
  }
17719
- `}const Cn=500,io=650,pn="cubic-bezier(0.22, 1, 0.36, 1)",nv=72,iv=50,ov=1e4,rv=650,av=500;function sv(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,s=e.top-t.top;return`translate(${o}px, ${s}px) scale(${n}, ${i})`}function Oc(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=pr(e);return{left:i.x,top:i.y,width:i.width,height:i.height}}const n=e.getBoundingClientRect();return{left:n.left,top:n.top,width:n.width,height:n.height}}function lv(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?Oc(i,n):null}function cv(e){return e.reduce((t,n,i)=>{var o;return(o=n.image)!=null&&o.url&&t.push({gridIndex:i,items:[n.image],entry:{title1:n.title??"",title2:n.subtitle??"",title3:n.caption??""}}),t},[])}function ao(e,t,n){var o;if(e.length<=1)return null;const i=(t+n+e.length)%e.length;return((o=e[i])==null?void 0:o.items[0])??null}function yl(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return ao(e,i,n)}const dv=.03;function Dc(e){return e.width*dv}const la={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Yo(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function vl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function uv(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function La(e,t,n){const i=e.getBoundingClientRect(),o=i.width,s=i.height,l=t/n,d=o/s;if(l>d){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(s-u)/2}}const c=s*l;return{width:c,height:s,left:i.left+(o-c)/2,top:i.top}}function pv(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:La(e,t.width,t.height)}function mv(e,t){if(Ar(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.url,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.url,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.url,n.naturalWidth,n.naturalHeight)},n.src=e.url}function gv(e){const t=new Set,n=[];for(const i of e){const o=i.image;!(o!=null&&o.url)||t.has(o.url)||(t.add(o.url),n.push(o))}return n}function hv({mediaList:e}){return e.length===0?null:r.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Ar(t)?r.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):r.jsx("img",{src:t.url,alt:""},t.url))})}function qi(e,t,n){const{width:i,height:o,top:s}=e,{left:l,width:d}=n,c=Dc(n);return t==="left"?{left:l+c-i,top:s,width:i,height:o}:{left:l+d-c,top:s,width:i,height:o}}function fr(e,t,n){const i=qi(e,t,n);return{...i,left:2*i.left-e.left}}function fv(e,t,n){const{left:i,width:o}=n,s=Dc(n);return t==="left"?{left:i,top:e.top,width:s,height:e.height}:{left:i+o-s,top:e.top,width:s,height:e.height}}function jc(e,t,n,i){const o=qi(e,"left",i),s=qi(e,"right",i),l=fr(e,"left",i),d=fr(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:s,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:d,end:s};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:s};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:s,end:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function yv(e,t,n,i){const{start:o,end:s}=jc(e,t,n,i);return{x:s.left-o.left,y:s.top-o.top}}function vv(e,t,n){const i=qi(e,t,n),o=fr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Ar(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function xv({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:s,onTransitionEnd:l}){const d=a.useRef(null);return a.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),r.jsx("div",{style:i,onTransitionEnd:l,children:r.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:s,onClick:c=>c.stopPropagation(),style:o},e)})}function Zo({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Ar(e)?r.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const s=o.currentTarget;s.videoWidth>0&&s.videoHeight>0&&(i==null||i(e.url,s.videoWidth,s.videoHeight))},onTransitionEnd:n}):r.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const s=o.currentTarget;s.naturalWidth>0&&s.naturalHeight>0&&(i==null||i(e.url,s.naturalWidth,s.naturalHeight))},onTransitionEnd:n})}function bv({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:b,sourceRect:w,resolveCloseSourceRect:f,onClose:h,onPrev:m,onNext:v}){const M=a.useRef(null),R=a.useRef(null),L=a.useRef(null),X=a.useRef(new Map),[A,B]=a.useState(0),P=a.useRef(null),C=a.useRef(0),j=a.useRef(0),x=a.useRef("none"),W=a.useRef(!1),E=a.useRef(!1),Z=a.useRef(!1),k=a.useRef(null),U=a.useRef(null),V=a.useRef(null),G=a.useRef(()=>{}),ie=a.useRef(null),$=a.useRef(null),I=a.useRef(null),D=a.useRef(!1),[se,oe]=a.useState(null),[T,ue]=a.useState(la),[F,ne]=a.useState(0),[J,ve]=a.useState("opening"),[Ee,me]=a.useState(0),[de,q]=a.useState(0),[Q,Y]=a.useState(!1),[_e,Ce]=a.useState(null),[ke,ce]=a.useState(null),[ge,we]=a.useState(null),[z,le]=a.useState(!1),[he,xe]=a.useState(null),[Re,Te]=a.useState(!1),_=a.useRef(!1),[pe,te]=a.useState(!1),[N,ee]=a.useState(!1),Ie=a.useRef(n),re=a.useRef(void 0),O=t[n],Ve=O?Ar(O):!1,Oe=de!==0||Q,lt=!l&&(!s||!!d),tt=c&&!l,ht=u.length>1,nt=a.useCallback((y,fe)=>t.length<=1?null:t[(y+fe+t.length)%t.length]??null,[t]),Be=ht?ao(u,p,-1):nt(n,-1),ye=ht?ao(u,p,1):nt(n,1),Pe=_e===-1&&Oe?ht&&ke!==null?ao(u,ke,-1):ge!==null?nt(ge,-1):null:null,De=_e===1&&Oe?ht&&ke!==null?ao(u,ke,1):ge!==null?nt(ge,1):null:null,qe=Pe&&Pe.url!==(Be==null?void 0:Be.url)?Pe:null,Se=De&&De.url!==(ye==null?void 0:ye.url)?De:null,Ne=Be&&tt?(()=>{const y=ht?yl(u,p,-1):t.length>2?nt((n-1+t.length)%t.length,-1):null;return y&&y.url!==Be.url?y:null})():null,ze=ye&&tt?(()=>{const y=ht?yl(u,p,1):t.length>2?nt((n+1)%t.length,1):null;return y&&y.url!==ye.url?y:null})():null,Xe=qe??Ne,ct=Se??ze,Je=a.useCallback((y,fe,Le)=>{if(!y||!fe||!Le)return;const Me=X.current,et=Me.get(y);(et==null?void 0:et.width)===fe&&(et==null?void 0:et.height)===Le||(Me.set(y,{width:fe,height:Le}),B(Mt=>Mt+1))},[]),$t=a.useCallback(y=>{if(!(y!=null&&y.url))return null;const fe=X.current.get(y.url);return pv(R.current,fe)},[A,F]),dt=a.useCallback(()=>{if(!O)return;const y=$t(O);if(y){oe(y);return}const fe=R.current;fe&&oe(vl(fe))},[O,$t]),Fe=a.useCallback(y=>{if(ht){const fe=u.length;ce((p+y+fe)%fe),we(null);return}t.length>1&&(we((n+y+t.length)%t.length),ce(null))},[ht,u.length,p,t.length,n]),Ke=a.useCallback(y=>{Z.current=y,Y(y)},[]),je=a.useCallback(()=>{k.current!==null&&(window.clearTimeout(k.current),k.current=null)},[]),ut=a.useCallback(()=>{je(),k.current=window.setTimeout(()=>{je(),Ke(!1)},io+32)},[je,Ke]),pt=a.useCallback(()=>{const y=M.current;if(!y){ue({left:0,top:0,width:typeof window<"u"?window.innerWidth:la.width,height:typeof window<"u"?window.innerHeight:la.height});return}const fe=y.getBoundingClientRect();ue({left:fe.left,top:fe.top,width:fe.width,height:fe.height})},[]),mt=a.useCallback((y,fe)=>{if(Oe){if(pe&&!Q)return`translate(${de}px, 0px)`;if(Q&&_e!==null){const Le=$t(y);if(!Le)return;const{x:Me,y:et}=yv(Le,fe,_e,T);return`translate(${Me}px, ${et}px)`}if(Q)return"translate(0px, 0px)"}},[Oe,pe,Q,de,_e,T,$t]),kt=a.useCallback(()=>{const y=U.current;U.current=null,je(),Ke(!1),Ce(null),ce(null),we(null),q(0),te(!1),W.current=!1,j.current=0,x.current="none",y===-1?m():y===1&&v()},[je,Ke,m,v]),Xt=a.useCallback(()=>{je(),k.current=window.setTimeout(()=>{U.current!==null&&kt()},io+32)},[je,kt]),Yt=a.useCallback(()=>{je(),U.current=null,Ke(!1),Ce(null),ce(null),we(null),q(0),te(!1),W.current=!1,j.current=0,x.current="none"},[je,Ke]),vt=a.useCallback(y=>{if(!(!tt||!se)){if(Z.current){if(U.current===y){V.current=y,kt();return}Yt()}je(),Fe(y),U.current=y,Ce(y),Ke(!0),Xt()}},[tt,se,kt,Yt,je,Fe,Ke,Xt]);G.current=vt;const bt=a.useCallback(()=>{ie.current=null,D.current=!1,$.current!==null&&(window.clearInterval($.current),$.current=null),I.current!==null&&(window.clearTimeout(I.current),I.current=null)},[]),Gt=a.useCallback(y=>{$.current!==null&&window.clearInterval($.current);const fe=D.current?av:rv;$.current=window.setInterval(()=>{G.current(y)},fe)},[]),Ft=a.useCallback(y=>{ie.current!==y&&(bt(),ie.current=y,D.current=!1,G.current(y),Gt(y),I.current=window.setTimeout(()=>{I.current=null,ie.current===y&&(D.current=!0,Gt(y))},ov))},[bt,Gt]),xt=a.useCallback(()=>{const y=R.current;if(!y)return;const fe=O==null?void 0:O.url,Le=fe?X.current.get(fe):void 0;if(Le!=null&&Le.width&&(Le!=null&&Le.height)){oe(La(y,Le.width,Le.height));return}const Me=L.current;if(Me&&fe&&(Me.src===fe||Me.currentSrc===fe)){const{width:Mt,height:Ye}=uv(Me);if(Mt&&Ye){Je(fe,Mt,Ye),oe(La(y,Mt,Ye));return}}const et=vl(y);!et.width||!et.height||oe(et)},[O==null?void 0:O.url,Je]),Ht=a.useCallback(y=>{if(L.current=y,!!y){if(y instanceof HTMLVideoElement){y.readyState>=1&&y.videoWidth>0&&xt();return}y.complete&&y.naturalWidth>0&&xt()}},[xt]),qt=a.useCallback(()=>{pt(),xt(),ne(y=>y+1)},[pt,xt]);a.useEffect(()=>{qt();const y=R.current,fe=M.current,Le=new ResizeObserver(()=>qt());return y&&Le.observe(y),fe&&Le.observe(fe),window.addEventListener("resize",qt),()=>{Le.disconnect(),window.removeEventListener("resize",qt)}},[qt,n,b]),a.useLayoutEffect(()=>{if(!O)return;const y=L.current;if(y){if(y instanceof HTMLImageElement&&y.complete&&y.naturalWidth>0){xt();return}y instanceof HTMLVideoElement&&y.readyState>=1&&y.videoWidth>0&&xt()}},[O==null?void 0:O.url,n,xt]),a.useEffect(()=>{dt()},[dt,A]),a.useEffect(()=>{const y=new Set,fe=[],Le=Me=>{!(Me!=null&&Me.url)||y.has(Me.url)||(y.add(Me.url),fe.push(Me))};t.forEach(Le),u.forEach(Me=>Me.items.forEach(Le)),fe.forEach(Me=>{X.current.has(Me.url)||mv(Me,Je)})},[t,u,Je]),a.useEffect(()=>{if(J!=="opening"||!se)return;if(!w){ve("open");return}le(!1);const y=requestAnimationFrame(()=>{requestAnimationFrame(()=>{le(!0),ve("open")})});return()=>cancelAnimationFrame(y)},[J,se,w]),a.useEffect(()=>{if(J!=="closing")return;const y=setTimeout(()=>h(),Cn);return()=>clearTimeout(y)},[J,h]),a.useEffect(()=>()=>{je()},[je]),a.useLayoutEffect(()=>{Ie.current===n&&re.current===(O==null?void 0:O.url)||(je(),U.current=null,Ce(null),ce(null),we(null),me(0),q(0),Ke(!1),ee(!1),te(!1),C.current=0,j.current=0,x.current="none",W.current=!1,P.current=null,E.current=!1,L.current=null,dt(),Ie.current=n,re.current=O==null?void 0:O.url)},[n,O==null?void 0:O.url,Ke,je,dt]),a.useLayoutEffect(()=>{const y=V.current;y!==null&&(V.current=null,requestAnimationFrame(()=>{G.current(y)}))},[n,p,O==null?void 0:O.url]),a.useLayoutEffect(()=>{if(J==="opening"){_.current=!1,Te(!1);return}if(J!=="open"||_.current)return;if(!Be&&!ye){_.current=!0;return}Te(!1);const y=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Te(!0),_.current=!0})});return()=>cancelAnimationFrame(y)},[J,Be==null?void 0:Be.url,ye==null?void 0:ye.url]),a.useEffect(()=>{if(J!=="open")return;const y=()=>{const Ye=ft=>{ft.stopPropagation(),ft.preventDefault(),document.removeEventListener("click",Ye,!0)};document.addEventListener("click",Ye,!0)},fe=Ye=>{const ft=Ye<0?1:-1;je(),Fe(ft),U.current=ft,Ce(ft),Ke(!0),Xt()},Le=Ye=>{if(Math.abs(Ye)>iv&&tt){fe(Ye);return}U.current=null,Ce(null),ce(null),we(null),Ke(!0),q(0),ut()},Me=Ye=>{if(Ye.touches.length!==1||Z.current)return;const ft=Ye.touches[0];E.current=!0,P.current={x:ft.clientX,y:ft.clientY},x.current="none",j.current=0,W.current=!1},et=Ye=>{if(!P.current||Ye.touches.length!==1||Z.current)return;const ft=Ye.touches[0],Nt=ft.clientX-P.current.x,Tt=ft.clientY-P.current.y;if(x.current==="none"){if(Math.abs(Nt)<10&&Math.abs(Tt)<10)return;if(Math.abs(Nt)>Math.abs(Tt)){if(!tt)return;x.current="horizontal"}else if(Tt>0){if(!lt)return;x.current="vertical"}else return}if(x.current==="horizontal"){W.current=!0,te(!0),j.current=Nt,q(Nt),Ye.preventDefault();return}x.current==="vertical"&&(W.current=!0,te(!0),C.current=Tt,me(Tt),Ye.preventDefault())},Mt=()=>{if(!P.current)return;const Ye=x.current,ft=W.current;if(ft&&Ye==="horizontal")Le(j.current),y();else if(ft&&Ye==="vertical"){const Nt=C.current;if(lt&&Nt>nv){const Tt=window.innerHeight;C.current=Tt,ee(!0),me(Tt),ve("closing")}else C.current=0,me(0);y()}else Ye==="horizontal"&&Math.abs(j.current)>0&&(Le(j.current),y());P.current=null,x.current="none",j.current=0,W.current=!1,te(!1)};return document.addEventListener("touchstart",Me,{passive:!0}),document.addEventListener("touchmove",et,{passive:!1}),document.addEventListener("touchend",Mt),document.addEventListener("touchcancel",Mt),()=>{document.removeEventListener("touchstart",Me),document.removeEventListener("touchmove",et),document.removeEventListener("touchend",Mt),document.removeEventListener("touchcancel",Mt)}},[J,tt,Ke,ut,je,lt,Xt,Fe]);const Zt=a.useCallback(()=>{const y=(f==null?void 0:f())??w??null;y&&se&&(xe(y),le(!0)),ve("closing")},[f,w,se]);a.useEffect(()=>{const y=Me=>{if(Me.key==="Escape"){if(s&&d||J==="closing")return;bt(),Zt();return}if(Me.key!=="ArrowLeft"&&Me.key!=="ArrowRight"||J!=="open"||!tt)return;Me.preventDefault();const et=Me.key==="ArrowLeft"?-1:1;Me.repeat&&ie.current===et||Ft(et)},fe=Me=>{if(Me.key!=="ArrowLeft"&&Me.key!=="ArrowRight")return;const et=Me.key==="ArrowLeft"?-1:1;ie.current===et&&bt()},Le=()=>{bt()};return window.addEventListener("keydown",y),window.addEventListener("keyup",fe),window.addEventListener("blur",Le),()=>{window.removeEventListener("keydown",y),window.removeEventListener("keyup",fe),window.removeEventListener("blur",Le),bt()}},[J,s,d,Zt,tt,Ft,bt]),a.useEffect(()=>{J!=="open"&&bt()},[J,bt]);const tn=()=>{J==="closing"||l||Zt()},Ct=J==="open",jt=J==="closing",cn=Ee>0?Math.max(0,1-Ee/500):1,at=Ee>0?Math.max(.35,1-Ee/500):1,$e=a.useCallback(y=>{if(!(y.propertyName!=="transform"||!Z.current)){if(U.current!==null){kt();return}je(),Ke(!1)}},[je,Ke,kt]),We=J==="closing"?he??w:w,Qe=We&&se&&(J==="opening"||jt)?sv(We,se):void 0,st=Oe&&O?mt(O,"center"):Ee>0?`translateY(${Ee}px)`:Qe,gt=se?Yo(se,T):null,Rt=!!(We&&se),ot=Rt&&(J==="closing"||J==="open"&&z),Ot={position:"absolute",top:gt==null?void 0:gt.top,left:gt==null?void 0:gt.left,width:gt==null?void 0:gt.width,height:gt==null?void 0:gt.height,objectFit:"contain",transformOrigin:"top left",transform:st,opacity:Ee>0?at:Rt?1:J==="opening"||jt?0:1,transition:pe&&!Q?"none":Q?`transform ${io}ms ${pn}`:N?`transform ${Cn}ms ${pn}, opacity ${Cn}ms ${pn}`:ot?`transform ${Cn}ms ${pn}`:J==="opening"||jt?`opacity ${Cn}ms ${pn}`:"none",pointerEvents:Ve&&Ct&&!Oe?"auto":"none",touchAction:Ve&&Ct?"none":void 0,zIndex:1,overflow:Ve?"hidden":void 0},Pt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Ct&&!Oe?"auto":"none"},Et=(y,fe,Le="adjacent")=>{const Me=$t(y);if(!Me)return{display:"none"};const et=Le==="far"?fe==="left"?"far-left":"far-right":fe==="left"?"left-adjacent":"right-adjacent",{start:Mt}=_e!==null?jc(Me,et,_e,T):{start:Le==="far"?fr(Me,fe,T):qi(Me,fe,T)},Ye=Yo(Mt,T),ft=mt(y,et),Nt=!Oe&&Le==="adjacent"&&Ct&&!Re?vv(Me,fe,T):null,Tt=Le==="far"&&Oe&&_e===(fe==="left"?-1:1),nn=pe&&!Q?!1:Q,dn=Le==="adjacent"&&Ct&&Re&&!Oe;return{position:"absolute",top:Ye.top,left:Ye.left,width:Ye.width,height:Ye.height,objectFit:"contain",transform:ft??(Nt?`translate(${Nt.x}px, ${Nt.y}px)`:void 0),opacity:Le==="far"?Ct&&Tt?1:0:Ct?1:0,transition:nn?Le==="far"?`transform ${io}ms ${pn}`:`transform ${io}ms ${pn}, opacity ${Cn}ms ${pn}`:dn?`transform ${Cn}ms ${pn}`:J==="opening"||jt?`opacity ${Cn}ms ${pn}`:"none",pointerEvents:"none",zIndex:1}},zt=(y,fe)=>{const Le=$t(y);return Le?fv(qi(Le,fe,T),fe,T):null},Bt=y=>fe=>{if(!l){if(E.current){E.current=!1;return}fe.stopPropagation(),vt(y)}},Wt=Be?zt(Be,"left"):null,_t=ye?zt(ye,"right"):null,At=Wt?Yo(Wt,T):null,wt=_t?Yo(_t,T):null;return r.jsxs("div",{ref:M,className:[`${e}-lightbox`,s?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:J==="open"?"none":void 0},onClick:tn,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Ct?cn:0,transition:pe?"none":`opacity ${Cn}ms ${pn}`,pointerEvents:"none"}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[r.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},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:R,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{height:"10%"}})]}),r.jsx("div",{style:{position:"absolute",inset:0,opacity:Ct?1:0,transition:pe?"none":`opacity ${Cn}ms ${pn}`,pointerEvents:"none"},children:r.jsx(wc,{prefix:e,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,onClose:tn})})]}),Ct&&Xe&&r.jsx(Zo,{media:Xe,style:Et(Xe,"left","far"),onMeasure:Je,onTransitionEnd:$e},`far-prev-${Xe.url}`),Ct&&Be&&r.jsxs(r.Fragment,{children:[r.jsx(Zo,{media:Be,style:Et(Be,"left"),onMeasure:Je,onTransitionEnd:$e},`prev-${Be.url}`),At&&r.jsx("div",{style:{position:"absolute",top:At.top,left:At.left,width:At.width,height:At.height,cursor:l||pe?"default":"pointer",pointerEvents:l||pe?"none":"auto",zIndex:3},onClick:Bt(-1)})]}),Ct&&ye&&r.jsxs(r.Fragment,{children:[r.jsx(Zo,{media:ye,style:Et(ye,"right"),onMeasure:Je,onTransitionEnd:$e},`next-${ye.url}`),wt&&r.jsx("div",{style:{position:"absolute",top:wt.top,left:wt.left,width:wt.width,height:wt.height,cursor:l||pe?"default":"pointer",pointerEvents:l||pe?"none":"auto",zIndex:3},onClick:Bt(1)})]}),Ct&&ct&&r.jsx(Zo,{media:ct,style:Et(ct,"right","far"),onMeasure:Je,onTransitionEnd:$e},`far-next-${ct.url}`),se&&O&&(Ve?r.jsx(xv,{src:O.url,phase:J,onMediaElement:Ht,wrapperStyle:Ot,videoStyle:Pt,onLoadedMetadata:xt,onTransitionEnd:$e},`${n}-${O.url}`):r.jsx("img",{ref:Ht,src:O.url,alt:O.name,onLoad:xt,onTransitionEnd:$e,style:Ot},`${n}-${O.url}`))]})}const wv=20,Sv=.18;function $v(e){return`
17723
+ `}const Cn=500,io=650,pn="cubic-bezier(0.22, 1, 0.36, 1)",nv=72,iv=50,ov=1e4,rv=650,av=500;function sv(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,s=e.top-t.top;return`translate(${o}px, ${s}px) scale(${n}, ${i})`}function Oc(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=pr(e);return{left:i.x,top:i.y,width:i.width,height:i.height}}const n=e.getBoundingClientRect();return{left:n.left,top:n.top,width:n.width,height:n.height}}function lv(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?Oc(i,n):null}function cv(e){return e.reduce((t,n,i)=>{var o;return(o=n.image)!=null&&o.url&&t.push({gridIndex:i,items:[n.image],entry:{title1:n.title??"",title2:n.subtitle??"",title3:n.caption??""}}),t},[])}function ao(e,t,n){var o;if(e.length<=1)return null;const i=(t+n+e.length)%e.length;return((o=e[i])==null?void 0:o.items[0])??null}function yl(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return ao(e,i,n)}const dv=.03;function Dc(e){return e.width*dv}const la={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Yo(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function vl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function uv(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function La(e,t,n){const i=e.getBoundingClientRect(),o=i.width,s=i.height,l=t/n,d=o/s;if(l>d){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(s-u)/2}}const c=s*l;return{width:c,height:s,left:i.left+(o-c)/2,top:i.top}}function pv(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:La(e,t.width,t.height)}function mv(e,t){if(Ar(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.url,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.url,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.url,n.naturalWidth,n.naturalHeight)},n.src=e.url}function gv(e){const t=new Set,n=[];for(const i of e){const o=i.image;!(o!=null&&o.url)||t.has(o.url)||(t.add(o.url),n.push(o))}return n}function hv({mediaList:e}){return e.length===0?null:r.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Ar(t)?r.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):r.jsx("img",{src:t.url,alt:""},t.url))})}function qi(e,t,n){const{width:i,height:o,top:s}=e,{left:l,width:d}=n,c=Dc(n);return t==="left"?{left:l+c-i,top:s,width:i,height:o}:{left:l+d-c,top:s,width:i,height:o}}function fr(e,t,n){const i=qi(e,t,n);return{...i,left:2*i.left-e.left}}function fv(e,t,n){const{left:i,width:o}=n,s=Dc(n);return t==="left"?{left:i,top:e.top,width:s,height:e.height}:{left:i+o-s,top:e.top,width:s,height:e.height}}function jc(e,t,n,i){const o=qi(e,"left",i),s=qi(e,"right",i),l=fr(e,"left",i),d=fr(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:s,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:d,end:s};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:s};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:s,end:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function yv(e,t,n,i){const{start:o,end:s}=jc(e,t,n,i);return{x:s.left-o.left,y:s.top-o.top}}function vv(e,t,n){const i=qi(e,t,n),o=fr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Ar(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function xv({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:s,onTransitionEnd:l}){const d=a.useRef(null);return a.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),r.jsx("div",{style:i,onTransitionEnd:l,children:r.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:s,onClick:c=>c.stopPropagation(),style:o},e)})}function Zo({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Ar(e)?r.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const s=o.currentTarget;s.videoWidth>0&&s.videoHeight>0&&(i==null||i(e.url,s.videoWidth,s.videoHeight))},onTransitionEnd:n}):r.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const s=o.currentTarget;s.naturalWidth>0&&s.naturalHeight>0&&(i==null||i(e.url,s.naturalWidth,s.naturalHeight))},onTransitionEnd:n})}function bv({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:b,sourceRect:w,resolveCloseSourceRect:f,onClose:h,onPrev:m,onNext:v}){const M=a.useRef(null),R=a.useRef(null),L=a.useRef(null),X=a.useRef(new Map),[F,B]=a.useState(0),k=a.useRef(null),C=a.useRef(0),j=a.useRef(0),x=a.useRef("none"),W=a.useRef(!1),E=a.useRef(!1),Z=a.useRef(!1),P=a.useRef(null),U=a.useRef(null),V=a.useRef(null),G=a.useRef(()=>{}),ie=a.useRef(null),$=a.useRef(null),I=a.useRef(null),D=a.useRef(!1),[se,oe]=a.useState(null),[T,ue]=a.useState(la),[A,ne]=a.useState(0),[J,ve]=a.useState("opening"),[Ee,me]=a.useState(0),[de,q]=a.useState(0),[Q,Y]=a.useState(!1),[_e,Ce]=a.useState(null),[ke,ce]=a.useState(null),[ge,we]=a.useState(null),[z,le]=a.useState(!1),[he,xe]=a.useState(null),[Re,Te]=a.useState(!1),_=a.useRef(!1),[pe,te]=a.useState(!1),[N,ee]=a.useState(!1),Ie=a.useRef(n),re=a.useRef(void 0),O=t[n],Ve=O?Ar(O):!1,Oe=de!==0||Q,lt=!l&&(!s||!!d),tt=c&&!l,ht=u.length>1,nt=a.useCallback((y,fe)=>t.length<=1?null:t[(y+fe+t.length)%t.length]??null,[t]),Be=ht?ao(u,p,-1):nt(n,-1),ye=ht?ao(u,p,1):nt(n,1),Pe=_e===-1&&Oe?ht&&ke!==null?ao(u,ke,-1):ge!==null?nt(ge,-1):null:null,De=_e===1&&Oe?ht&&ke!==null?ao(u,ke,1):ge!==null?nt(ge,1):null:null,qe=Pe&&Pe.url!==(Be==null?void 0:Be.url)?Pe:null,Se=De&&De.url!==(ye==null?void 0:ye.url)?De:null,Ne=Be&&tt?(()=>{const y=ht?yl(u,p,-1):t.length>2?nt((n-1+t.length)%t.length,-1):null;return y&&y.url!==Be.url?y:null})():null,ze=ye&&tt?(()=>{const y=ht?yl(u,p,1):t.length>2?nt((n+1)%t.length,1):null;return y&&y.url!==ye.url?y:null})():null,Xe=qe??Ne,ct=Se??ze,Je=a.useCallback((y,fe,Le)=>{if(!y||!fe||!Le)return;const Me=X.current,et=Me.get(y);(et==null?void 0:et.width)===fe&&(et==null?void 0:et.height)===Le||(Me.set(y,{width:fe,height:Le}),B(Mt=>Mt+1))},[]),$t=a.useCallback(y=>{if(!(y!=null&&y.url))return null;const fe=X.current.get(y.url);return pv(R.current,fe)},[F,A]),dt=a.useCallback(()=>{if(!O)return;const y=$t(O);if(y){oe(y);return}const fe=R.current;fe&&oe(vl(fe))},[O,$t]),Fe=a.useCallback(y=>{if(ht){const fe=u.length;ce((p+y+fe)%fe),we(null);return}t.length>1&&(we((n+y+t.length)%t.length),ce(null))},[ht,u.length,p,t.length,n]),Ke=a.useCallback(y=>{Z.current=y,Y(y)},[]),je=a.useCallback(()=>{P.current!==null&&(window.clearTimeout(P.current),P.current=null)},[]),ut=a.useCallback(()=>{je(),P.current=window.setTimeout(()=>{je(),Ke(!1)},io+32)},[je,Ke]),pt=a.useCallback(()=>{const y=M.current;if(!y){ue({left:0,top:0,width:typeof window<"u"?window.innerWidth:la.width,height:typeof window<"u"?window.innerHeight:la.height});return}const fe=y.getBoundingClientRect();ue({left:fe.left,top:fe.top,width:fe.width,height:fe.height})},[]),mt=a.useCallback((y,fe)=>{if(Oe){if(pe&&!Q)return`translate(${de}px, 0px)`;if(Q&&_e!==null){const Le=$t(y);if(!Le)return;const{x:Me,y:et}=yv(Le,fe,_e,T);return`translate(${Me}px, ${et}px)`}if(Q)return"translate(0px, 0px)"}},[Oe,pe,Q,de,_e,T,$t]),kt=a.useCallback(()=>{const y=U.current;U.current=null,je(),Ke(!1),Ce(null),ce(null),we(null),q(0),te(!1),W.current=!1,j.current=0,x.current="none",y===-1?m():y===1&&v()},[je,Ke,m,v]),Xt=a.useCallback(()=>{je(),P.current=window.setTimeout(()=>{U.current!==null&&kt()},io+32)},[je,kt]),Yt=a.useCallback(()=>{je(),U.current=null,Ke(!1),Ce(null),ce(null),we(null),q(0),te(!1),W.current=!1,j.current=0,x.current="none"},[je,Ke]),vt=a.useCallback(y=>{if(!(!tt||!se)){if(Z.current){if(U.current===y){V.current=y,kt();return}Yt()}je(),Fe(y),U.current=y,Ce(y),Ke(!0),Xt()}},[tt,se,kt,Yt,je,Fe,Ke,Xt]);G.current=vt;const bt=a.useCallback(()=>{ie.current=null,D.current=!1,$.current!==null&&(window.clearInterval($.current),$.current=null),I.current!==null&&(window.clearTimeout(I.current),I.current=null)},[]),Gt=a.useCallback(y=>{$.current!==null&&window.clearInterval($.current);const fe=D.current?av:rv;$.current=window.setInterval(()=>{G.current(y)},fe)},[]),Ft=a.useCallback(y=>{ie.current!==y&&(bt(),ie.current=y,D.current=!1,G.current(y),Gt(y),I.current=window.setTimeout(()=>{I.current=null,ie.current===y&&(D.current=!0,Gt(y))},ov))},[bt,Gt]),xt=a.useCallback(()=>{const y=R.current;if(!y)return;const fe=O==null?void 0:O.url,Le=fe?X.current.get(fe):void 0;if(Le!=null&&Le.width&&(Le!=null&&Le.height)){oe(La(y,Le.width,Le.height));return}const Me=L.current;if(Me&&fe&&(Me.src===fe||Me.currentSrc===fe)){const{width:Mt,height:Ye}=uv(Me);if(Mt&&Ye){Je(fe,Mt,Ye),oe(La(y,Mt,Ye));return}}const et=vl(y);!et.width||!et.height||oe(et)},[O==null?void 0:O.url,Je]),Ht=a.useCallback(y=>{if(L.current=y,!!y){if(y instanceof HTMLVideoElement){y.readyState>=1&&y.videoWidth>0&&xt();return}y.complete&&y.naturalWidth>0&&xt()}},[xt]),qt=a.useCallback(()=>{pt(),xt(),ne(y=>y+1)},[pt,xt]);a.useEffect(()=>{qt();const y=R.current,fe=M.current,Le=new ResizeObserver(()=>qt());return y&&Le.observe(y),fe&&Le.observe(fe),window.addEventListener("resize",qt),()=>{Le.disconnect(),window.removeEventListener("resize",qt)}},[qt,n,b]),a.useLayoutEffect(()=>{if(!O)return;const y=L.current;if(y){if(y instanceof HTMLImageElement&&y.complete&&y.naturalWidth>0){xt();return}y instanceof HTMLVideoElement&&y.readyState>=1&&y.videoWidth>0&&xt()}},[O==null?void 0:O.url,n,xt]),a.useEffect(()=>{dt()},[dt,F]),a.useEffect(()=>{const y=new Set,fe=[],Le=Me=>{!(Me!=null&&Me.url)||y.has(Me.url)||(y.add(Me.url),fe.push(Me))};t.forEach(Le),u.forEach(Me=>Me.items.forEach(Le)),fe.forEach(Me=>{X.current.has(Me.url)||mv(Me,Je)})},[t,u,Je]),a.useEffect(()=>{if(J!=="opening"||!se)return;if(!w){ve("open");return}le(!1);const y=requestAnimationFrame(()=>{requestAnimationFrame(()=>{le(!0),ve("open")})});return()=>cancelAnimationFrame(y)},[J,se,w]),a.useEffect(()=>{if(J!=="closing")return;const y=setTimeout(()=>h(),Cn);return()=>clearTimeout(y)},[J,h]),a.useEffect(()=>()=>{je()},[je]),a.useLayoutEffect(()=>{Ie.current===n&&re.current===(O==null?void 0:O.url)||(je(),U.current=null,Ce(null),ce(null),we(null),me(0),q(0),Ke(!1),ee(!1),te(!1),C.current=0,j.current=0,x.current="none",W.current=!1,k.current=null,E.current=!1,L.current=null,dt(),Ie.current=n,re.current=O==null?void 0:O.url)},[n,O==null?void 0:O.url,Ke,je,dt]),a.useLayoutEffect(()=>{const y=V.current;y!==null&&(V.current=null,requestAnimationFrame(()=>{G.current(y)}))},[n,p,O==null?void 0:O.url]),a.useLayoutEffect(()=>{if(J==="opening"){_.current=!1,Te(!1);return}if(J!=="open"||_.current)return;if(!Be&&!ye){_.current=!0;return}Te(!1);const y=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Te(!0),_.current=!0})});return()=>cancelAnimationFrame(y)},[J,Be==null?void 0:Be.url,ye==null?void 0:ye.url]),a.useEffect(()=>{if(J!=="open")return;const y=()=>{const Ye=ft=>{ft.stopPropagation(),ft.preventDefault(),document.removeEventListener("click",Ye,!0)};document.addEventListener("click",Ye,!0)},fe=Ye=>{const ft=Ye<0?1:-1;je(),Fe(ft),U.current=ft,Ce(ft),Ke(!0),Xt()},Le=Ye=>{if(Math.abs(Ye)>iv&&tt){fe(Ye);return}U.current=null,Ce(null),ce(null),we(null),Ke(!0),q(0),ut()},Me=Ye=>{if(Ye.touches.length!==1||Z.current)return;const ft=Ye.touches[0];E.current=!0,k.current={x:ft.clientX,y:ft.clientY},x.current="none",j.current=0,W.current=!1},et=Ye=>{if(!k.current||Ye.touches.length!==1||Z.current)return;const ft=Ye.touches[0],Nt=ft.clientX-k.current.x,Tt=ft.clientY-k.current.y;if(x.current==="none"){if(Math.abs(Nt)<10&&Math.abs(Tt)<10)return;if(Math.abs(Nt)>Math.abs(Tt)){if(!tt)return;x.current="horizontal"}else if(Tt>0){if(!lt)return;x.current="vertical"}else return}if(x.current==="horizontal"){W.current=!0,te(!0),j.current=Nt,q(Nt),Ye.preventDefault();return}x.current==="vertical"&&(W.current=!0,te(!0),C.current=Tt,me(Tt),Ye.preventDefault())},Mt=()=>{if(!k.current)return;const Ye=x.current,ft=W.current;if(ft&&Ye==="horizontal")Le(j.current),y();else if(ft&&Ye==="vertical"){const Nt=C.current;if(lt&&Nt>nv){const Tt=window.innerHeight;C.current=Tt,ee(!0),me(Tt),ve("closing")}else C.current=0,me(0);y()}else Ye==="horizontal"&&Math.abs(j.current)>0&&(Le(j.current),y());k.current=null,x.current="none",j.current=0,W.current=!1,te(!1)};return document.addEventListener("touchstart",Me,{passive:!0}),document.addEventListener("touchmove",et,{passive:!1}),document.addEventListener("touchend",Mt),document.addEventListener("touchcancel",Mt),()=>{document.removeEventListener("touchstart",Me),document.removeEventListener("touchmove",et),document.removeEventListener("touchend",Mt),document.removeEventListener("touchcancel",Mt)}},[J,tt,Ke,ut,je,lt,Xt,Fe]);const Zt=a.useCallback(()=>{const y=(f==null?void 0:f())??w??null;y&&se&&(xe(y),le(!0)),ve("closing")},[f,w,se]);a.useEffect(()=>{const y=Me=>{if(Me.key==="Escape"){if(s&&d||J==="closing")return;bt(),Zt();return}if(Me.key!=="ArrowLeft"&&Me.key!=="ArrowRight"||J!=="open"||!tt)return;Me.preventDefault();const et=Me.key==="ArrowLeft"?-1:1;Me.repeat&&ie.current===et||Ft(et)},fe=Me=>{if(Me.key!=="ArrowLeft"&&Me.key!=="ArrowRight")return;const et=Me.key==="ArrowLeft"?-1:1;ie.current===et&&bt()},Le=()=>{bt()};return window.addEventListener("keydown",y),window.addEventListener("keyup",fe),window.addEventListener("blur",Le),()=>{window.removeEventListener("keydown",y),window.removeEventListener("keyup",fe),window.removeEventListener("blur",Le),bt()}},[J,s,d,Zt,tt,Ft,bt]),a.useEffect(()=>{J!=="open"&&bt()},[J,bt]);const tn=()=>{J==="closing"||l||Zt()},Ct=J==="open",jt=J==="closing",cn=Ee>0?Math.max(0,1-Ee/500):1,at=Ee>0?Math.max(.35,1-Ee/500):1,$e=a.useCallback(y=>{if(!(y.propertyName!=="transform"||!Z.current)){if(U.current!==null){kt();return}je(),Ke(!1)}},[je,Ke,kt]),We=J==="closing"?he??w:w,Qe=We&&se&&(J==="opening"||jt)?sv(We,se):void 0,st=Oe&&O?mt(O,"center"):Ee>0?`translateY(${Ee}px)`:Qe,gt=se?Yo(se,T):null,Rt=!!(We&&se),ot=Rt&&(J==="closing"||J==="open"&&z),Ot={position:"absolute",top:gt==null?void 0:gt.top,left:gt==null?void 0:gt.left,width:gt==null?void 0:gt.width,height:gt==null?void 0:gt.height,objectFit:"contain",transformOrigin:"top left",transform:st,opacity:Ee>0?at:Rt?1:J==="opening"||jt?0:1,transition:pe&&!Q?"none":Q?`transform ${io}ms ${pn}`:N?`transform ${Cn}ms ${pn}, opacity ${Cn}ms ${pn}`:ot?`transform ${Cn}ms ${pn}`:J==="opening"||jt?`opacity ${Cn}ms ${pn}`:"none",pointerEvents:Ve&&Ct&&!Oe?"auto":"none",touchAction:Ve&&Ct?"none":void 0,zIndex:1,overflow:Ve?"hidden":void 0},Pt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Ct&&!Oe?"auto":"none"},Et=(y,fe,Le="adjacent")=>{const Me=$t(y);if(!Me)return{display:"none"};const et=Le==="far"?fe==="left"?"far-left":"far-right":fe==="left"?"left-adjacent":"right-adjacent",{start:Mt}=_e!==null?jc(Me,et,_e,T):{start:Le==="far"?fr(Me,fe,T):qi(Me,fe,T)},Ye=Yo(Mt,T),ft=mt(y,et),Nt=!Oe&&Le==="adjacent"&&Ct&&!Re?vv(Me,fe,T):null,Tt=Le==="far"&&Oe&&_e===(fe==="left"?-1:1),nn=pe&&!Q?!1:Q,dn=Le==="adjacent"&&Ct&&Re&&!Oe;return{position:"absolute",top:Ye.top,left:Ye.left,width:Ye.width,height:Ye.height,objectFit:"contain",transform:ft??(Nt?`translate(${Nt.x}px, ${Nt.y}px)`:void 0),opacity:Le==="far"?Ct&&Tt?1:0:Ct?1:0,transition:nn?Le==="far"?`transform ${io}ms ${pn}`:`transform ${io}ms ${pn}, opacity ${Cn}ms ${pn}`:dn?`transform ${Cn}ms ${pn}`:J==="opening"||jt?`opacity ${Cn}ms ${pn}`:"none",pointerEvents:"none",zIndex:1}},zt=(y,fe)=>{const Le=$t(y);return Le?fv(qi(Le,fe,T),fe,T):null},Bt=y=>fe=>{if(!l){if(E.current){E.current=!1;return}fe.stopPropagation(),vt(y)}},Wt=Be?zt(Be,"left"):null,_t=ye?zt(ye,"right"):null,At=Wt?Yo(Wt,T):null,wt=_t?Yo(_t,T):null;return r.jsxs("div",{ref:M,className:[`${e}-lightbox`,s?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:J==="open"?"none":void 0},onClick:tn,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Ct?cn:0,transition:pe?"none":`opacity ${Cn}ms ${pn}`,pointerEvents:"none"}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[r.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},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:R,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{height:"10%"}})]}),r.jsx("div",{style:{position:"absolute",inset:0,opacity:Ct?1:0,transition:pe?"none":`opacity ${Cn}ms ${pn}`,pointerEvents:"none"},children:r.jsx(wc,{prefix:e,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,onClose:tn})})]}),Ct&&Xe&&r.jsx(Zo,{media:Xe,style:Et(Xe,"left","far"),onMeasure:Je,onTransitionEnd:$e},`far-prev-${Xe.url}`),Ct&&Be&&r.jsxs(r.Fragment,{children:[r.jsx(Zo,{media:Be,style:Et(Be,"left"),onMeasure:Je,onTransitionEnd:$e},`prev-${Be.url}`),At&&r.jsx("div",{style:{position:"absolute",top:At.top,left:At.left,width:At.width,height:At.height,cursor:l||pe?"default":"pointer",pointerEvents:l||pe?"none":"auto",zIndex:3},onClick:Bt(-1)})]}),Ct&&ye&&r.jsxs(r.Fragment,{children:[r.jsx(Zo,{media:ye,style:Et(ye,"right"),onMeasure:Je,onTransitionEnd:$e},`next-${ye.url}`),wt&&r.jsx("div",{style:{position:"absolute",top:wt.top,left:wt.left,width:wt.width,height:wt.height,cursor:l||pe?"default":"pointer",pointerEvents:l||pe?"none":"auto",zIndex:3},onClick:Bt(1)})]}),Ct&&ct&&r.jsx(Zo,{media:ct,style:Et(ct,"right","far"),onMeasure:Je,onTransitionEnd:$e},`far-next-${ct.url}`),se&&O&&(Ve?r.jsx(xv,{src:O.url,phase:J,onMediaElement:Ht,wrapperStyle:Ot,videoStyle:Pt,onLoadedMetadata:xt,onTransitionEnd:$e},`${n}-${O.url}`):r.jsx("img",{ref:Ht,src:O.url,alt:O.name,onLoad:xt,onTransitionEnd:$e,style:Ot},`${n}-${O.url}`))]})}const wv=20,Sv=.18;function $v(e){return`
17720
17724
  .${e}-wrapper {
17721
17725
  box-sizing: border-box;
17722
17726
  max-width: 100%;
@@ -17804,7 +17808,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
17804
17808
  pointer-events: auto;
17805
17809
  }
17806
17810
  ${tv(e)}
17807
- `}function Cv(e){const{imageDisplay:t}=e??{},n=(t==null?void 0:t.ratioValue)??"1:1",i=(t==null?void 0:t.reversed)??!1,[o,s]=n.split(":").map(Number),l=i?s:o,d=i?o:s;return d>0?l/d:1}function Tv(e){const t=e instanceof HTMLVideoElement?e.videoWidth:e.naturalWidth,n=e instanceof HTMLVideoElement?e.videoHeight:e.naturalHeight;return!t||!n?null:t/n}function Lv(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:S.scalingValue(o,n??!1),[`--${t}-image-inline-gap`]:S.scalingValue(i*Sv,n??!1),[`--${t}-image-aspect`]:Cv(e)}}function Rv(e,t){var i,o;const n={fontSettings:{fontFamily:(e==null?void 0:e.titleFontFamily)??"Arial",fontWeight:((i=e==null?void 0:e.titleFontSettings)==null?void 0:i.fontWeight)??400,fontStyle:((o=e==null?void 0:e.titleFontSettings)==null?void 0:o.fontStyle)??"normal"},fontSize:(e==null?void 0:e.titleFontSize)??.07,lineHeight:e==null?void 0:e.titleLineHeight,letterSpacing:(e==null?void 0:e.titleLetterSpacing)??0,wordSpacing:(e==null?void 0:e.titleWordSpacing)??0,textAppearance:e==null?void 0:e.titleTextAppearance,color:(e==null?void 0:e.titleColor)??"#000000"};return Ut(n,t)}function Iv(e){var o;const t=((o=e==null?void 0:e.imageDisplay)==null?void 0:o.display)==="cover",n=((e==null?void 0:e.lightbox)??"on")==="on",i={objectFit:t?"cover":"contain",pointerEvents:"auto",...n?{cursor:"pointer"}:null};return{objectFitMode:t?"cover":"contain",imageStyle:i}}function Mv(e,t,n,i,o,s){if(!(!e||!t))return l=>{var c;const d=((c=l.currentTarget.closest(`.${i}-item`))==null?void 0:c.querySelector(`[data-waterfall-index="${n}"]`))??(l.currentTarget instanceof HTMLImageElement||l.currentTarget instanceof HTMLVideoElement?l.currentTarget:null);s(n,d?Oc(d,o):void 0)}}function Ev({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:s,portalId:l}){const{prefix:d}=S.useScopedStyles(),c=a.useMemo(()=>$v(d),[d]),u=t??[],p=(e==null?void 0:e.type)??"a",b=typeof(e==null?void 0:e.wrapperWidth)=="number"?e.wrapperWidth:1,w=typeof(e==null?void 0:e.horizontalGap)=="number"?e.horizontalGap:0,f=S.scalingValue(w,n??!1),h=`max(${f}, ${wv}px)`,{objectFitMode:m,imageStyle:v}=Iv(e),M=Rv(e,n),R=a.useRef(null),[L,X]=a.useState(!1),[A,B]=a.useState([]),[P,C]=a.useState(0),[j,x]=a.useState(0),[W,E]=a.useState(null),[Z,k]=a.useState({title1:"",title2:"",title3:""}),U=(!n||i)&&!L,V=(e==null?void 0:e.imageHoverEffect)??{sizeType:"none",value:120},G=V.sizeType??"none",ie=U&&G!=="none"?`${d}-item-image-hover-${G}`:void 0,$=(V.value??120)/100,I=a.useCallback(de=>{!de||G!=="scale"||(de.style.transformOrigin=Xp(de))},[G]),D=a.useCallback(de=>{if(de){if(m==="contain"){const q=Tv(de);if(q){const Q=de.closest(`.${d}-item-image`);Q instanceof HTMLElement&&Q.style.setProperty(`--${d}-item-media-aspect`,String(q))}}I(de)}},[d,I,m]),se={width:S.scalingValue(b,n??!1),...M,...Lv(e,d,n),[`--${d}-image-hover-scale`]:String($)},oe=(()=>{const de={},q=R.current?getComputedStyle(R.current).getPropertyValue("--cntrl-article-width").trim():"";return q&&(de["--cntrl-article-width"]=q),de})(),T=((e==null?void 0:e.lightbox)??"on")==="on"&&(!n||i||o),ue=a.useMemo(()=>cv(u),[u]),F=a.useMemo(()=>gv(u),[u]),ne=(de,q)=>{if(((e==null?void 0:e.lightbox)??"on")==="off"||n&&!o&&!i)return;const Q=ue.findIndex(_e=>_e.gridIndex===de);if(Q<0)return;const Y=ue[Q];x(Q),B(Y.items),C(0),k(Y.entry),E(q??null),X(!0)},J=a.useCallback(()=>{X(!1),E(null)},[]),ve=a.useCallback(()=>{const de=ue[j];return!de||!R.current?W:lv(R.current,de.gridIndex,m)??W},[ue,j,W,m]),Ee=a.useCallback(de=>{if(ue.length>1){const q=ue.length,Q=(j+de+q)%q,Y=ue[Q];x(Q),B(Y.items),C(0),k(Y.entry);return}C(q=>(q+de+A.length)%A.length)},[ue,j,A.length]),me=ue.length>1||A.length>1;return a.useEffect(()=>{if(!L||typeof document>"u")return;const de=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=de}},[L]),a.useEffect(()=>{!n||o||i||X(!1)},[n,o,i]),a.useEffect(()=>{((e==null?void 0:e.lightbox)??"on")==="off"&&X(!1)},[e==null?void 0:e.lightbox]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),r.jsx(hv,{mediaList:F}),r.jsx("div",{ref:R,className:`${d}-wrapper ${d}-type-${p}`,style:se,children:u.map((de,q)=>{var _e,Ce;const Q=!!((_e=de.image)!=null&&_e.url),Y=Mv(!!T,Q,q,d,m,ne);return r.jsxs("div",{className:`${d}-item`,children:[de.title?r.jsx("span",{className:`${d}-item-title`,onClick:Y,style:Y?{cursor:"pointer"}:void 0,children:de.title}):null,(Ce=de.image)!=null&&Ce.url?r.jsx("span",{className:[`${d}-item-image`,m==="contain"?`${d}-item-image-fit`:void 0,ie].filter(Boolean).join(" "),children:de.image.type==="video"?r.jsx("video",{ref:D,src:de.image.url,"data-waterfall-index":q,style:v,playsInline:!0,muted:!0,loop:!0,autoPlay:!0,onClick:Y,onLoadedData:ke=>D(ke.currentTarget)}):r.jsx("img",{ref:D,src:de.image.url,alt:de.image.name??"","data-waterfall-index":q,style:v,onClick:Y,onLoad:ke=>D(ke.currentTarget)})}):null,q<u.length-1&&r.jsx("div",{className:`${d}-item-gap-host`,style:{width:f},children:o&&!L&&r.jsx("div",{"data-controls":"horizontalGap","data-controls-axis":"x","data-controls-min":"0",className:`${d}-item-gap-control`,style:{left:"50%",transform:"translateX(-50%)",width:h,height:"100%"}})})]},q)})}),L&&((e==null?void 0:e.lightbox)??"on")==="on"&&typeof document<"u"&&e&&(()=>{const de=(l?document.getElementById(l):null)??document.body;return Yn.createPortal(r.jsx("div",{style:oe,"data-selection":"none",children:r.jsx(bv,{prefix:d,items:A,index:P,entry:Z,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:me,lightboxEntries:ue,entryIdx:j,layoutId:s,sourceRect:W,resolveCloseSourceRect:ve,onClose:J,onPrev:()=>Ee(-1),onNext:()=>Ee(1)})}),de)})()]})}const Pv=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
17811
+ `}function Cv(e){const{imageDisplay:t}=e??{},n=(t==null?void 0:t.ratioValue)??"1:1",i=(t==null?void 0:t.reversed)??!1,[o,s]=n.split(":").map(Number),l=i?s:o,d=i?o:s;return d>0?l/d:1}function Tv(e){const t=e instanceof HTMLVideoElement?e.videoWidth:e.naturalWidth,n=e instanceof HTMLVideoElement?e.videoHeight:e.naturalHeight;return!t||!n?null:t/n}function Lv(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:S.scalingValue(o,n??!1),[`--${t}-image-inline-gap`]:S.scalingValue(i*Sv,n??!1),[`--${t}-image-aspect`]:Cv(e)}}function Rv(e,t){var i,o;const n={fontSettings:{fontFamily:(e==null?void 0:e.titleFontFamily)??"Arial",fontWeight:((i=e==null?void 0:e.titleFontSettings)==null?void 0:i.fontWeight)??400,fontStyle:((o=e==null?void 0:e.titleFontSettings)==null?void 0:o.fontStyle)??"normal"},fontSize:(e==null?void 0:e.titleFontSize)??.07,lineHeight:e==null?void 0:e.titleLineHeight,letterSpacing:(e==null?void 0:e.titleLetterSpacing)??0,wordSpacing:(e==null?void 0:e.titleWordSpacing)??0,textAppearance:e==null?void 0:e.titleTextAppearance,color:(e==null?void 0:e.titleColor)??"#000000"};return Ut(n,t)}function Iv(e){var o;const t=((o=e==null?void 0:e.imageDisplay)==null?void 0:o.display)==="cover",n=((e==null?void 0:e.lightbox)??"on")==="on",i={objectFit:t?"cover":"contain",pointerEvents:"auto",...n?{cursor:"pointer"}:null};return{objectFitMode:t?"cover":"contain",imageStyle:i}}function Mv(e,t,n,i,o,s){if(!(!e||!t))return l=>{var c;const d=((c=l.currentTarget.closest(`.${i}-item`))==null?void 0:c.querySelector(`[data-waterfall-index="${n}"]`))??(l.currentTarget instanceof HTMLImageElement||l.currentTarget instanceof HTMLVideoElement?l.currentTarget:null);s(n,d?Oc(d,o):void 0)}}function Ev({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:s,portalId:l}){const{prefix:d}=S.useScopedStyles(),c=a.useMemo(()=>$v(d),[d]),u=t??[],p=(e==null?void 0:e.type)??"a",b=typeof(e==null?void 0:e.wrapperWidth)=="number"?e.wrapperWidth:1,w=typeof(e==null?void 0:e.horizontalGap)=="number"?e.horizontalGap:0,f=S.scalingValue(w,n??!1),h=`max(${f}, ${wv}px)`,{objectFitMode:m,imageStyle:v}=Iv(e),M=Rv(e,n),R=a.useRef(null),[L,X]=a.useState(!1),[F,B]=a.useState([]),[k,C]=a.useState(0),[j,x]=a.useState(0),[W,E]=a.useState(null),[Z,P]=a.useState({title1:"",title2:"",title3:""}),U=(!n||i)&&!L,V=(e==null?void 0:e.imageHoverEffect)??{sizeType:"none",value:120},G=V.sizeType??"none",ie=U&&G!=="none"?`${d}-item-image-hover-${G}`:void 0,$=(V.value??120)/100,I=a.useCallback(de=>{!de||G!=="scale"||(de.style.transformOrigin=Xp(de))},[G]),D=a.useCallback(de=>{if(de){if(m==="contain"){const q=Tv(de);if(q){const Q=de.closest(`.${d}-item-image`);Q instanceof HTMLElement&&Q.style.setProperty(`--${d}-item-media-aspect`,String(q))}}I(de)}},[d,I,m]),se={width:S.scalingValue(b,n??!1),...M,...Lv(e,d,n),[`--${d}-image-hover-scale`]:String($)},oe=(()=>{const de={},q=R.current?getComputedStyle(R.current).getPropertyValue("--cntrl-article-width").trim():"";return q&&(de["--cntrl-article-width"]=q),de})(),T=((e==null?void 0:e.lightbox)??"on")==="on"&&(!n||i||o),ue=a.useMemo(()=>cv(u),[u]),A=a.useMemo(()=>gv(u),[u]),ne=(de,q)=>{if(((e==null?void 0:e.lightbox)??"on")==="off"||n&&!o&&!i)return;const Q=ue.findIndex(_e=>_e.gridIndex===de);if(Q<0)return;const Y=ue[Q];x(Q),B(Y.items),C(0),P(Y.entry),E(q??null),X(!0)},J=a.useCallback(()=>{X(!1),E(null)},[]),ve=a.useCallback(()=>{const de=ue[j];return!de||!R.current?W:lv(R.current,de.gridIndex,m)??W},[ue,j,W,m]),Ee=a.useCallback(de=>{if(ue.length>1){const q=ue.length,Q=(j+de+q)%q,Y=ue[Q];x(Q),B(Y.items),C(0),P(Y.entry);return}C(q=>(q+de+F.length)%F.length)},[ue,j,F.length]),me=ue.length>1||F.length>1;return a.useEffect(()=>{if(!L||typeof document>"u")return;const de=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=de}},[L]),a.useEffect(()=>{!n||o||i||X(!1)},[n,o,i]),a.useEffect(()=>{((e==null?void 0:e.lightbox)??"on")==="off"&&X(!1)},[e==null?void 0:e.lightbox]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),r.jsx(hv,{mediaList:A}),r.jsx("div",{ref:R,className:`${d}-wrapper ${d}-type-${p}`,style:se,children:u.map((de,q)=>{var _e,Ce;const Q=!!((_e=de.image)!=null&&_e.url),Y=Mv(!!T,Q,q,d,m,ne);return r.jsxs("div",{className:`${d}-item`,children:[de.title?r.jsx("span",{className:`${d}-item-title`,onClick:Y,style:Y?{cursor:"pointer"}:void 0,children:de.title}):null,(Ce=de.image)!=null&&Ce.url?r.jsx("span",{className:[`${d}-item-image`,m==="contain"?`${d}-item-image-fit`:void 0,ie].filter(Boolean).join(" "),children:de.image.type==="video"?r.jsx("video",{ref:D,src:de.image.url,"data-waterfall-index":q,style:v,playsInline:!0,muted:!0,loop:!0,autoPlay:!0,onClick:Y,onLoadedData:ke=>D(ke.currentTarget)}):r.jsx("img",{ref:D,src:de.image.url,alt:de.image.name??"","data-waterfall-index":q,style:v,onClick:Y,onLoad:ke=>D(ke.currentTarget)})}):null,q<u.length-1&&r.jsx("div",{className:`${d}-item-gap-host`,style:{width:f},children:o&&!L&&r.jsx("div",{"data-controls":"horizontalGap","data-controls-axis":"x","data-controls-min":"0",className:`${d}-item-gap-control`,style:{left:"50%",transform:"translateX(-50%)",width:h,height:"100%"}})})]},q)})}),L&&((e==null?void 0:e.lightbox)??"on")==="on"&&typeof document<"u"&&e&&(()=>{const de=(l?document.getElementById(l):null)??document.body;return Yn.createPortal(r.jsx("div",{style:oe,"data-selection":"none",children:r.jsx(bv,{prefix:d,items:F,index:k,entry:Z,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:me,lightboxEntries:ue,entryIdx:j,layoutId:s,sourceRect:W,resolveCloseSourceRect:ve,onClose:J,onPrev:()=>Ee(-1),onNext:()=>Ee(1)})}),de)})()]})}const Pv=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
17808
17812
  import type React from 'react';
17809
17813
  import { createPortal } from 'react-dom';
17810
17814
  import { CommonComponentProps } from '../props';
@@ -18588,7 +18592,7 @@ export function Waterfall({
18588
18592
  from { clip-path: inset(100% 0 0 0); }
18589
18593
  to { clip-path: inset(0 0 0 0); }
18590
18594
  }
18591
- `}function Qv({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:s}=S.useScopedStyles(),l=Uv(e,n),d=t??[],c=d.length,u=(e==null?void 0:e.trigger)??bl,p=u.sizeType??"drag",b=u.value??bl.value,w=(e==null?void 0:e.direction)??"horizontal",f=(e==null?void 0:e.transition)??"slide",h=(e==null?void 0:e.nav)??"classic",m=(e==null?void 0:e.navSize)??"m",v=Gv[m],M=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,R=ye=>S.scalingValue(ye*M,n),L=(e==null?void 0:e.show)??"always",X=(e==null?void 0:e.controls)??null,A=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,B=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,P=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,C=(e==null?void 0:e.controlsColor)??xl.color,j=(e==null?void 0:e.controlsHoverColor)??xl.hover,x=(e==null?void 0:e.navColor)??oo.colors.inactive,W=(e==null?void 0:e.navPaginationColor)??oo.colors.pagination,E=(e==null?void 0:e.navBackgroundColor)??oo.colors.background,Z=(e==null?void 0:e.linkColor)??da.linkColor,k=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,U=w==="horizontal",V=p==="click",G=p==="drag",ie=p==="auto"&&(!n||!!i),$=!n,I=f==="slide",D=h==="classic",se=L!=="never",oe=L==="on hover",T=S.scalingValue(A,n),ue={width:T,height:T,maxWidth:T},F=I&&c>1,[ne,J]=a.useState(0),[ve,Ee]=a.useState(F?1:0),[me,de]=a.useState(!1),[q,Q]=a.useState(!1),[Y,_e]=a.useState(!1),[Ce,ke]=a.useState(0),[ce,ge]=a.useState(!1),[we,z]=a.useState(!1),le=a.useRef(!1),he=a.useRef(ve);he.current=ve;const xe=a.useRef(null),Re=a.useRef(0),Te=a.useRef(null),_=a.useRef(null),pe=a.useRef(null),te=a.useRef(null),N=a.useCallback(ye=>{le.current=ye,de(ye)},[]),ee=a.useCallback(ye=>{if(c<2||ye===0)return;const Pe=ye>0?1:-1,De=Math.abs(ye);if(ge(!0),N(!0),!I){J(ct=>so(ct+ye,c));return}let qe=he.current;const Se=F&&(qe===0||qe===c+1),Ne=Se?ne+1:null;Se&&(qe=ne+1);let ze=De;for(;ze>0;){const ct=Kv(qe,Pe,c,F);if(qe=ct.position,ze-=1,ct.hitBoundary){Re.current=ze*Pe;break}}const Xe=De-ze;if(Xe>0&&J(ct=>so(ct+Xe*Pe,c)),he.current=qe,Ne!==null){if(he.current=Ne,qe===Ne){Q(!0),Ee(qe);return}xe.current=qe,Q(!0),Ee(Ne);return}Q(!1),Ee(qe)},[ne,c,F,I,N]),Ie=a.useCallback(ye=>{ee(ye)},[ee]),re=a.useCallback(ye=>{if(c<2)return;const Pe=so(ye,c);if(!(Pe===ne&&!le.current)&&(ge(!0),N(!0),J(Pe),I)){const De=Pe+(F?1:0);xe.current=null,Re.current=0,he.current=De,Q(!1),Ee(De)}},[ne,c,F,I,N]);a.useEffect(()=>{if(!me)return;const ye=window.setTimeout(()=>{if(F&&(ve===0||ve===c+1)){xe.current=null,Q(!0),Ee(ne+1);return}N(!1)},Fi);return()=>window.clearTimeout(ye)},[ne,c,F,me,N,ve]),a.useEffect(()=>{if(!q)return;let ye=0;const Pe=requestAnimationFrame(()=>{ye=requestAnimationFrame(()=>{const De=xe.current;xe.current=null;const qe=Re.current;if(Re.current=0,Q(!1),De!==null){he.current=De,Ee(De);return}if(qe!==0){ee(qe);return}N(!1)})});return()=>{cancelAnimationFrame(Pe),cancelAnimationFrame(ye)}},[ee,N,q]);const O=`${F}:${c}`,Ve=a.useRef(O);a.useEffect(()=>{if(Ve.current===O)return;Ve.current=O;const ye=c>0?Math.min(ne,c-1):0;pe.current=null,te.current=null,_e(!1),ke(0),J(ye),Q(!0),Ee(ye+(F?1:0))},[ne,c,F,O]),a.useEffect(()=>{if(!ce)return;const ye=window.setTimeout(()=>ge(!1),Dv);return()=>window.clearTimeout(ye)},[ce,ne]),a.useEffect(()=>{if(!ie||c<2)return;const ye=Math.max(b,.1)*1e3,Pe=window.setInterval(()=>{$&&we||Ie(1)},ye);return()=>window.clearInterval(Pe)},[b,c,Ie,ie,we,$]);const Oe=a.useCallback(ye=>{const Pe=pe.current;if(!Pe||Pe.pointerId!==ye.pointerId)return;pe.current=null,te.current=null;const De=Te.current;if(De!=null&&De.hasPointerCapture(ye.pointerId)&&De.releasePointerCapture(ye.pointerId),!Pe.isActive){I&&ke(0);return}const Se=!(ye.timeStamp-Pe.lastTime>Vv)&&Math.abs(Pe.velocity)>Bv,Ne=Pe.size>0&&Math.abs(Pe.offset-Pe.baseOffset)>Pe.size*zv;if(_e(!1),!Se&&!Ne){ke(0);return}const ze=Ne?Pe.offset-Pe.baseOffset:Pe.velocity;let Xe=1;Ne&&Pe.size>0&&(Xe=Math.max(1,Math.round(Math.abs(ze)/Pe.size))),ke(0),ee(ze<0?Xe:-Xe)},[ee,I]);a.useEffect(()=>{const ye=Pe=>{te.current===null||Pe.pointerId!==te.current||Oe(Pe)};return window.addEventListener("pointerup",ye),window.addEventListener("pointercancel",ye),()=>{window.removeEventListener("pointerup",ye),window.removeEventListener("pointercancel",ye)}},[Oe]);const lt=ye=>{const Pe=Te.current;if(!G||c<2||!Pe||ye.pointerType==="mouse"&&ye.button!==0)return;xe.current=null,Re.current=0,le.current&&N(!1);let De=0;const qe=_.current;if(I&&qe){const Se=U?qe.offsetWidth:qe.offsetHeight;if(Se>0){const Ne=Xv(qe,U);let ze=he.current;F&&(ze===0||ze===c+1)?(ze=ne+1,he.current=ze,Q(!0),Ee(ze),De=0):De=Ne+ze*Se,ke(De)}}Pe.setPointerCapture(ye.pointerId),te.current=ye.pointerId,pe.current={pointerId:ye.pointerId,startClientX:ye.clientX,startClientY:ye.clientY,axes:Yv(Pe,`${s}-axis-probe`),size:U?Pe.offsetWidth:Pe.offsetHeight,isActive:!1,baseOffset:De,offset:De,lastTime:ye.timeStamp,velocity:0}},tt=ye=>{const Pe=pe.current;if(!Pe||Pe.pointerId!==ye.pointerId)return;if(ye.pointerType==="mouse"&&ye.buttons===0){Oe(ye);return}const De=ye.clientX-Pe.startClientX,qe=ye.clientY-Pe.startClientY,Se=Pe.axes?Zv(Pe.axes,De,qe):{x:De,y:qe},Ne=U?Se.x:Se.y,ze=U?Se.y:Se.x,Xe=Pe.baseOffset+Ne;if(!Pe.isActive){if(Math.max(Math.abs(Ne),Math.abs(ze))<jv)return;if(Math.abs(ze)>Math.abs(Ne)){const Je=Te.current;Je!=null&&Je.hasPointerCapture(Pe.pointerId)&&Je.releasePointerCapture(Pe.pointerId),pe.current=null,te.current=null,I&&ke(0);return}Pe.isActive=!0,_e(!0)}const ct=ye.timeStamp-Pe.lastTime;ct>0&&(Pe.velocity=(Xe-Pe.offset)/ct,Pe.lastTime=ye.timeStamp),Pe.offset=Xe,I&&ke(Xe)},ht=ye=>{Oe(ye)},nt=U?`translate3d(calc(${-ve*100}% + ${Ce}px), 0, 0)`:`translate3d(0, calc(${-ve*100}% + ${Ce}px), 0)`,Be=F?[d[c-1],...d,d[0]]:d;return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Jv(s,n)}}),r.jsxs("div",{className:rt(`${s}-wrapper`,{[`${s}-transition-reveal`]:f==="reveal",[`${s}-transition-reveal-vertical`]:f==="reveal"&&!U}),onMouseEnter:()=>z(!0),onMouseLeave:()=>z(!1),children:[r.jsxs("div",{className:`${s}-slider-inner`,style:{backgroundColor:"transparent"},children:[r.jsx("div",{ref:Te,className:rt(`${s}-track`,{[`${s}-track-draggable`]:G,[`${s}-track-draggable-vertical`]:G&&!U}),onPointerDown:lt,onPointerMove:tt,onPointerUp:ht,onPointerCancel:ht,onLostPointerCapture:ye=>{te.current===ye.pointerId&&Oe(ye)},children:r.jsx("div",{ref:_,className:rt(`${s}-list`,{[`${s}-list-slide`]:I,[`${s}-list-slide-vertical`]:I&&!U,[`${s}-list-fade`]:!I}),style:I?{transform:nt,transition:Y||q?"none":`transform ${Fi}ms ${zc}`}:void 0,children:Be.map((ye,Pe)=>{const De=F?so(Pe-1,c):Pe,Se=F&&(Pe===0||Pe===c+1)?`clone-${Pe===0?"start":"end"}`:`slide-${De}`;return r.jsx("div",{className:rt(`${s}-slide`,{[`${s}-is-active`]:!I&&De===ne}),children:r.jsx("div",{className:`${s}-slider-item`,children:r.jsx("div",{className:`${s}-img-wrapper`,children:r.jsx("img",{className:rt(`${s}-slider-image`,{[`${s}-contain`]:ye.image.objectFit==="contain",[`${s}-cover`]:ye.image.objectFit==="cover"}),src:ye.image.url,alt:ye.image.name??"",draggable:!1})})})},Se)})})}),se&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:rt(`${s}-arrow`,{[`${s}-arrow-prev`]:U,[`${s}-arrow-prev-vertical`]:!U,[`${s}-hover-arrow`]:oe}),style:{color:C,"--arrow-hover-color":j,...ue},children:r.jsxs("button",{onClick:ye=>{ye.stopPropagation(),Ie(-1)},className:`${s}-arrow-inner`,style:{transform:`translate(${S.scalingValue(B,n)}, ${S.scalingValue(P*(U?1:-1),n)}) rotate(${U?"0deg":"90deg"})`},children:[X&&r.jsx(rn,{url:X,fill:C,hoverFill:j,className:rt(`${s}-arrow-img`,`${s}-mirror`),style:ue}),!X&&r.jsx(wl,{color:C,className:rt(`${s}-arrow-icon`,`${s}-arrow-img`,`${s}-mirror`)})]})}),r.jsx("div",{className:rt(`${s}-arrow`,{[`${s}-arrow-next`]:U,[`${s}-arrow-next-vertical`]:!U,[`${s}-hover-arrow`]:oe}),style:{color:C,"--arrow-hover-color":j,...ue},children:r.jsxs("button",{className:`${s}-arrow-inner`,onClick:ye=>{ye.stopPropagation(),Ie(1)},style:{transform:`translate(${S.scalingValue(B*(U?-1:1),n)}, ${S.scalingValue(P,n)}) rotate(${U?"0deg":"90deg"})`},children:[X&&r.jsx(rn,{url:X,fill:C,hoverFill:j,className:`${s}-arrow-img`,style:ue}),!X&&r.jsx(wl,{color:C,className:rt(`${s}-arrow-icon`,`${s}-arrow-img`)})]})})]}),V&&r.jsx("div",{className:`${s}-click-overlay`,onClick:()=>Ie(1)}),D&&r.jsx("div",{className:rt(`${s}-pagination`,{[`${s}-pagination-inside-bottom`]:U,[`${s}-pagination-inside-left`]:!U}),style:U?{bottom:R(v.inset)}:{left:R(v.inset)},children:r.jsx("div",{className:rt(`${s}-pagination-inner`,{[`${s}-pagination-vertical`]:!U,[`${s}-animate-dots`]:ce}),style:{backgroundColor:E,gap:R(v.gapInactive-v.activeDot+v.dot),...U?{height:R(v.activeDot+v.paddingY*2),paddingTop:R(v.paddingY),paddingBottom:R(v.paddingY),paddingLeft:R(v.paddingActive),paddingRight:R(v.paddingActive)}:{width:R(v.activeDot+v.paddingY*2),paddingLeft:R(v.paddingY),paddingRight:R(v.paddingY),paddingTop:R(v.paddingActive),paddingBottom:R(v.paddingActive)},borderRadius:R(v.borderRadius),transform:`translate(${S.scalingValue(oo.offset.x,n)}, ${S.scalingValue(oo.offset.y,n)})`},children:d.map((ye,Pe)=>{const De=Pe===ne,qe=De?v.activeDot:v.dot;return r.jsx("button",{onClick:()=>re(Pe),className:`${s}-pagination-item`,style:{width:R(v.activeDot)},children:r.jsx("div",{className:`${s}-dot`,style:{backgroundColor:De?W:x,width:R(qe)}})},Pe)})},`${m}-${w}`)})]}),r.jsxs("div",{className:`${s}-caption-block`,children:[r.jsx("div",{"data-controls":o?"captionMarginTop":void 0,className:o?`${s}-control`:void 0,style:{height:S.scalingValue(k,n)}}),r.jsx("div",{className:`${s}-caption-text-wrapper`,children:d.map((ye,Pe)=>r.jsx("div",{className:rt(`${s}-caption-text`,{[`${s}-with-pointer-events`]:Pe===ne&&n,[`${s}-active`]:Pe===ne}),style:{...l,width:"max-content",transitionDuration:`${Math.round(Fi/2)}ms`},children:r.jsx("div",{className:`${s}-caption-text-inner`,style:{"--link-color":Z,"--link-hover-color":Z,position:"relative",top:S.scalingValue(da.offset.y,n),left:S.scalingValue(da.offset.x,n)},children:r.jsx(yi,{content:ye.imageCaption})})},Pe))})]})]})]})}function wl({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 e0=`import React, { useCallback, useEffect, useRef, useState } from 'react';
18595
+ `}function Qv({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:s}=S.useScopedStyles(),l=Uv(e,n),d=t??[],c=d.length,u=(e==null?void 0:e.trigger)??bl,p=u.sizeType??"drag",b=u.value??bl.value,w=(e==null?void 0:e.direction)??"horizontal",f=(e==null?void 0:e.transition)??"slide",h=(e==null?void 0:e.nav)??"classic",m=(e==null?void 0:e.navSize)??"m",v=Gv[m],M=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,R=ye=>S.scalingValue(ye*M,n),L=(e==null?void 0:e.show)??"always",X=(e==null?void 0:e.controls)??null,F=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,B=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,k=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,C=(e==null?void 0:e.controlsColor)??xl.color,j=(e==null?void 0:e.controlsHoverColor)??xl.hover,x=(e==null?void 0:e.navColor)??oo.colors.inactive,W=(e==null?void 0:e.navPaginationColor)??oo.colors.pagination,E=(e==null?void 0:e.navBackgroundColor)??oo.colors.background,Z=(e==null?void 0:e.linkColor)??da.linkColor,P=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,U=w==="horizontal",V=p==="click",G=p==="drag",ie=p==="auto"&&(!n||!!i),$=!n,I=f==="slide",D=h==="classic",se=L!=="never",oe=L==="on hover",T=S.scalingValue(F,n),ue={width:T,height:T,maxWidth:T},A=I&&c>1,[ne,J]=a.useState(0),[ve,Ee]=a.useState(A?1:0),[me,de]=a.useState(!1),[q,Q]=a.useState(!1),[Y,_e]=a.useState(!1),[Ce,ke]=a.useState(0),[ce,ge]=a.useState(!1),[we,z]=a.useState(!1),le=a.useRef(!1),he=a.useRef(ve);he.current=ve;const xe=a.useRef(null),Re=a.useRef(0),Te=a.useRef(null),_=a.useRef(null),pe=a.useRef(null),te=a.useRef(null),N=a.useCallback(ye=>{le.current=ye,de(ye)},[]),ee=a.useCallback(ye=>{if(c<2||ye===0)return;const Pe=ye>0?1:-1,De=Math.abs(ye);if(ge(!0),N(!0),!I){J(ct=>so(ct+ye,c));return}let qe=he.current;const Se=A&&(qe===0||qe===c+1),Ne=Se?ne+1:null;Se&&(qe=ne+1);let ze=De;for(;ze>0;){const ct=Kv(qe,Pe,c,A);if(qe=ct.position,ze-=1,ct.hitBoundary){Re.current=ze*Pe;break}}const Xe=De-ze;if(Xe>0&&J(ct=>so(ct+Xe*Pe,c)),he.current=qe,Ne!==null){if(he.current=Ne,qe===Ne){Q(!0),Ee(qe);return}xe.current=qe,Q(!0),Ee(Ne);return}Q(!1),Ee(qe)},[ne,c,A,I,N]),Ie=a.useCallback(ye=>{ee(ye)},[ee]),re=a.useCallback(ye=>{if(c<2)return;const Pe=so(ye,c);if(!(Pe===ne&&!le.current)&&(ge(!0),N(!0),J(Pe),I)){const De=Pe+(A?1:0);xe.current=null,Re.current=0,he.current=De,Q(!1),Ee(De)}},[ne,c,A,I,N]);a.useEffect(()=>{if(!me)return;const ye=window.setTimeout(()=>{if(A&&(ve===0||ve===c+1)){xe.current=null,Q(!0),Ee(ne+1);return}N(!1)},Fi);return()=>window.clearTimeout(ye)},[ne,c,A,me,N,ve]),a.useEffect(()=>{if(!q)return;let ye=0;const Pe=requestAnimationFrame(()=>{ye=requestAnimationFrame(()=>{const De=xe.current;xe.current=null;const qe=Re.current;if(Re.current=0,Q(!1),De!==null){he.current=De,Ee(De);return}if(qe!==0){ee(qe);return}N(!1)})});return()=>{cancelAnimationFrame(Pe),cancelAnimationFrame(ye)}},[ee,N,q]);const O=`${A}:${c}`,Ve=a.useRef(O);a.useEffect(()=>{if(Ve.current===O)return;Ve.current=O;const ye=c>0?Math.min(ne,c-1):0;pe.current=null,te.current=null,_e(!1),ke(0),J(ye),Q(!0),Ee(ye+(A?1:0))},[ne,c,A,O]),a.useEffect(()=>{if(!ce)return;const ye=window.setTimeout(()=>ge(!1),Dv);return()=>window.clearTimeout(ye)},[ce,ne]),a.useEffect(()=>{if(!ie||c<2)return;const ye=Math.max(b,.1)*1e3,Pe=window.setInterval(()=>{$&&we||Ie(1)},ye);return()=>window.clearInterval(Pe)},[b,c,Ie,ie,we,$]);const Oe=a.useCallback(ye=>{const Pe=pe.current;if(!Pe||Pe.pointerId!==ye.pointerId)return;pe.current=null,te.current=null;const De=Te.current;if(De!=null&&De.hasPointerCapture(ye.pointerId)&&De.releasePointerCapture(ye.pointerId),!Pe.isActive){I&&ke(0);return}const Se=!(ye.timeStamp-Pe.lastTime>Vv)&&Math.abs(Pe.velocity)>Bv,Ne=Pe.size>0&&Math.abs(Pe.offset-Pe.baseOffset)>Pe.size*zv;if(_e(!1),!Se&&!Ne){ke(0);return}const ze=Ne?Pe.offset-Pe.baseOffset:Pe.velocity;let Xe=1;Ne&&Pe.size>0&&(Xe=Math.max(1,Math.round(Math.abs(ze)/Pe.size))),ke(0),ee(ze<0?Xe:-Xe)},[ee,I]);a.useEffect(()=>{const ye=Pe=>{te.current===null||Pe.pointerId!==te.current||Oe(Pe)};return window.addEventListener("pointerup",ye),window.addEventListener("pointercancel",ye),()=>{window.removeEventListener("pointerup",ye),window.removeEventListener("pointercancel",ye)}},[Oe]);const lt=ye=>{const Pe=Te.current;if(!G||c<2||!Pe||ye.pointerType==="mouse"&&ye.button!==0)return;xe.current=null,Re.current=0,le.current&&N(!1);let De=0;const qe=_.current;if(I&&qe){const Se=U?qe.offsetWidth:qe.offsetHeight;if(Se>0){const Ne=Xv(qe,U);let ze=he.current;A&&(ze===0||ze===c+1)?(ze=ne+1,he.current=ze,Q(!0),Ee(ze),De=0):De=Ne+ze*Se,ke(De)}}Pe.setPointerCapture(ye.pointerId),te.current=ye.pointerId,pe.current={pointerId:ye.pointerId,startClientX:ye.clientX,startClientY:ye.clientY,axes:Yv(Pe,`${s}-axis-probe`),size:U?Pe.offsetWidth:Pe.offsetHeight,isActive:!1,baseOffset:De,offset:De,lastTime:ye.timeStamp,velocity:0}},tt=ye=>{const Pe=pe.current;if(!Pe||Pe.pointerId!==ye.pointerId)return;if(ye.pointerType==="mouse"&&ye.buttons===0){Oe(ye);return}const De=ye.clientX-Pe.startClientX,qe=ye.clientY-Pe.startClientY,Se=Pe.axes?Zv(Pe.axes,De,qe):{x:De,y:qe},Ne=U?Se.x:Se.y,ze=U?Se.y:Se.x,Xe=Pe.baseOffset+Ne;if(!Pe.isActive){if(Math.max(Math.abs(Ne),Math.abs(ze))<jv)return;if(Math.abs(ze)>Math.abs(Ne)){const Je=Te.current;Je!=null&&Je.hasPointerCapture(Pe.pointerId)&&Je.releasePointerCapture(Pe.pointerId),pe.current=null,te.current=null,I&&ke(0);return}Pe.isActive=!0,_e(!0)}const ct=ye.timeStamp-Pe.lastTime;ct>0&&(Pe.velocity=(Xe-Pe.offset)/ct,Pe.lastTime=ye.timeStamp),Pe.offset=Xe,I&&ke(Xe)},ht=ye=>{Oe(ye)},nt=U?`translate3d(calc(${-ve*100}% + ${Ce}px), 0, 0)`:`translate3d(0, calc(${-ve*100}% + ${Ce}px), 0)`,Be=A?[d[c-1],...d,d[0]]:d;return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Jv(s,n)}}),r.jsxs("div",{className:rt(`${s}-wrapper`,{[`${s}-transition-reveal`]:f==="reveal",[`${s}-transition-reveal-vertical`]:f==="reveal"&&!U}),onMouseEnter:()=>z(!0),onMouseLeave:()=>z(!1),children:[r.jsxs("div",{className:`${s}-slider-inner`,style:{backgroundColor:"transparent"},children:[r.jsx("div",{ref:Te,className:rt(`${s}-track`,{[`${s}-track-draggable`]:G,[`${s}-track-draggable-vertical`]:G&&!U}),onPointerDown:lt,onPointerMove:tt,onPointerUp:ht,onPointerCancel:ht,onLostPointerCapture:ye=>{te.current===ye.pointerId&&Oe(ye)},children:r.jsx("div",{ref:_,className:rt(`${s}-list`,{[`${s}-list-slide`]:I,[`${s}-list-slide-vertical`]:I&&!U,[`${s}-list-fade`]:!I}),style:I?{transform:nt,transition:Y||q?"none":`transform ${Fi}ms ${zc}`}:void 0,children:Be.map((ye,Pe)=>{const De=A?so(Pe-1,c):Pe,Se=A&&(Pe===0||Pe===c+1)?`clone-${Pe===0?"start":"end"}`:`slide-${De}`;return r.jsx("div",{className:rt(`${s}-slide`,{[`${s}-is-active`]:!I&&De===ne}),children:r.jsx("div",{className:`${s}-slider-item`,children:r.jsx("div",{className:`${s}-img-wrapper`,children:r.jsx("img",{className:rt(`${s}-slider-image`,{[`${s}-contain`]:ye.image.objectFit==="contain",[`${s}-cover`]:ye.image.objectFit==="cover"}),src:ye.image.url,alt:ye.image.name??"",draggable:!1})})})},Se)})})}),se&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:rt(`${s}-arrow`,{[`${s}-arrow-prev`]:U,[`${s}-arrow-prev-vertical`]:!U,[`${s}-hover-arrow`]:oe}),style:{color:C,"--arrow-hover-color":j,...ue},children:r.jsxs("button",{onClick:ye=>{ye.stopPropagation(),Ie(-1)},className:`${s}-arrow-inner`,style:{transform:`translate(${S.scalingValue(B,n)}, ${S.scalingValue(k*(U?1:-1),n)}) rotate(${U?"0deg":"90deg"})`},children:[X&&r.jsx(rn,{url:X,fill:C,hoverFill:j,className:rt(`${s}-arrow-img`,`${s}-mirror`),style:ue}),!X&&r.jsx(wl,{color:C,className:rt(`${s}-arrow-icon`,`${s}-arrow-img`,`${s}-mirror`)})]})}),r.jsx("div",{className:rt(`${s}-arrow`,{[`${s}-arrow-next`]:U,[`${s}-arrow-next-vertical`]:!U,[`${s}-hover-arrow`]:oe}),style:{color:C,"--arrow-hover-color":j,...ue},children:r.jsxs("button",{className:`${s}-arrow-inner`,onClick:ye=>{ye.stopPropagation(),Ie(1)},style:{transform:`translate(${S.scalingValue(B*(U?-1:1),n)}, ${S.scalingValue(k,n)}) rotate(${U?"0deg":"90deg"})`},children:[X&&r.jsx(rn,{url:X,fill:C,hoverFill:j,className:`${s}-arrow-img`,style:ue}),!X&&r.jsx(wl,{color:C,className:rt(`${s}-arrow-icon`,`${s}-arrow-img`)})]})})]}),V&&r.jsx("div",{className:`${s}-click-overlay`,onClick:()=>Ie(1)}),D&&r.jsx("div",{className:rt(`${s}-pagination`,{[`${s}-pagination-inside-bottom`]:U,[`${s}-pagination-inside-left`]:!U}),style:U?{bottom:R(v.inset)}:{left:R(v.inset)},children:r.jsx("div",{className:rt(`${s}-pagination-inner`,{[`${s}-pagination-vertical`]:!U,[`${s}-animate-dots`]:ce}),style:{backgroundColor:E,gap:R(v.gapInactive-v.activeDot+v.dot),...U?{height:R(v.activeDot+v.paddingY*2),paddingTop:R(v.paddingY),paddingBottom:R(v.paddingY),paddingLeft:R(v.paddingActive),paddingRight:R(v.paddingActive)}:{width:R(v.activeDot+v.paddingY*2),paddingLeft:R(v.paddingY),paddingRight:R(v.paddingY),paddingTop:R(v.paddingActive),paddingBottom:R(v.paddingActive)},borderRadius:R(v.borderRadius),transform:`translate(${S.scalingValue(oo.offset.x,n)}, ${S.scalingValue(oo.offset.y,n)})`},children:d.map((ye,Pe)=>{const De=Pe===ne,qe=De?v.activeDot:v.dot;return r.jsx("button",{onClick:()=>re(Pe),className:`${s}-pagination-item`,style:{width:R(v.activeDot)},children:r.jsx("div",{className:`${s}-dot`,style:{backgroundColor:De?W:x,width:R(qe)}})},Pe)})},`${m}-${w}`)})]}),r.jsxs("div",{className:`${s}-caption-block`,children:[r.jsx("div",{"data-controls":o?"captionMarginTop":void 0,className:o?`${s}-control`:void 0,style:{height:S.scalingValue(P,n)}}),r.jsx("div",{className:`${s}-caption-text-wrapper`,children:d.map((ye,Pe)=>r.jsx("div",{className:rt(`${s}-caption-text`,{[`${s}-with-pointer-events`]:Pe===ne&&n,[`${s}-active`]:Pe===ne}),style:{...l,width:"max-content",transitionDuration:`${Math.round(Fi/2)}ms`},children:r.jsx("div",{className:`${s}-caption-text-inner`,style:{"--link-color":Z,"--link-hover-color":Z,position:"relative",top:S.scalingValue(da.offset.y,n),left:S.scalingValue(da.offset.x,n)},children:r.jsx(yi,{content:ye.imageCaption})})},Pe))})]})]})]})}function wl({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 e0=`import React, { useCallback, useEffect, useRef, useState } from 'react';
18592
18596
  import cn from 'classnames';
18593
18597
  import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
18594
18598
  import { scalingValue } from '../utils/scalingValue';
@@ -19986,7 +19990,7 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
19986
19990
  width: var(--cntrl-article-width, 100vw) !important;
19987
19991
  height: var(--cntrl-viewport-height, 100vh) !important;
19988
19992
  }
19989
- `}const a0="rgba(28,31,34,0.9)",In=500,ci="cubic-bezier(0.22, 1, 0.36, 1)",s0=72,l0=50,c0={titleColor:"title-color",lightboxCounterColor:"lightbox-counter-color"},d0=[];function u0(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 p0(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function m0(e){const[t]=e.media;return t!=null&&t.url?t:null}function g0(e){if(!Array.isArray(e)||e.length===0)return[];if(u0(e)){const t=[];for(const n of e){const i=p0(n);if(!i)continue;const o=m0(n);t.push({displayMedia:i,lightboxMedia:o!=null&&o.url?o:null})}return t}return e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function Ra(e){return e.type==="video"}function h0(e){e.pause(),e.removeAttribute("src"),e.load()}function Qo(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function f0(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const y0=1140/1440;function v0(e){return typeof e=="string"?{display:e.toLowerCase()==="cover"?"cover":"fit",ratioValue:"2:3",reversed:!1}:{display:(typeof(e==null?void 0:e.display)=="string"?e.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(e==null?void 0:e.ratioValue)??"2:3",reversed:(e==null?void 0:e.reversed)??!1}}function x0(e){const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`}function b0(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function w0({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:s,onMouseMove:l,onTransitionEnd:d}){return a.useEffect(()=>{const c=n.current;if(c)return()=>{h0(c)}},[e,n]),r.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:s,onMouseMove:l,onTransitionEnd:d,style:i})}function S0({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:s,onPrev:l,onNext:d,counterClassName:c,counterStyle:u,backgroundColor:p}){const b=i==="cover",w=a.useRef(null),f=a.useRef(null),h=a.useRef(null),m=a.useRef(0),v=a.useRef(0),M=a.useRef("none"),R=a.useRef(!1),L=a.useRef(!1),X=a.useRef(!1),A=a.useRef(null),[B,P]=a.useState(null),[C,j]=a.useState("opening"),[x,W]=a.useState(0),[E,Z]=a.useState(0),[k,U]=a.useState(!1),[V,G]=a.useState(!1),[ie,$]=a.useState(!1),I=a.useRef(n),D=t[n],se=D?Ra(D):!1,oe=E!==0||k,T=a.useCallback(ce=>{X.current=ce,U(ce)},[]),ue=a.useCallback(()=>{A.current!==null&&(window.clearTimeout(A.current),A.current=null)},[]),F=a.useCallback(()=>{ue(),A.current=window.setTimeout(()=>{ue(),T(!1)},In+32)},[ue,T]),ne=a.useCallback(()=>{const ce=w.current,ge=f.current;if(!ce)return;const we=ce.getBoundingClientRect(),z=we.width,le=we.height;if(!z||!le)return;if(i==="cover"){P({width:z,height:le,left:we.left,top:we.top});return}if(!ge){P(Qo(ce));return}const{width:he,height:xe}=f0(ge);if(!he||!xe){P(Qo(ce));return}const Re=he/xe,Te=z/le;if(Re>Te){const _=z/Re;P({width:z,height:_,left:we.left,top:we.top+(le-_)/2})}else{const _=le*Re;P({width:_,height:le,left:we.left+(z-_)/2,top:we.top})}},[i]);a.useEffect(()=>{ne();const ce=w.current;if(!ce)return;const ge=new ResizeObserver(()=>ne());return ge.observe(ce),()=>ge.disconnect()},[ne,n]),a.useEffect(()=>{C==="opening"&&B&&j("open")},[C,B]),a.useEffect(()=>{if(C!=="closing")return;const ce=setTimeout(()=>s(),In);return()=>clearTimeout(ce)},[C,s]),a.useEffect(()=>()=>{ue()},[ue]),a.useLayoutEffect(()=>{if(I.current===n)return;ue(),W(0),Z(0),T(!1),$(!1),G(!1),m.current=0,v.current=0,M.current="none",R.current=!1,h.current=null,L.current=!1;const ce=w.current;ce&&P(Qo(ce)),I.current=n},[n,T,ue]),a.useEffect(()=>{if(C!=="open")return;let ce=null;const ge=()=>{ce&&(document.removeEventListener("click",ce,!0),ce=null)},we=()=>{ge(),ce=Te=>{Te.stopPropagation(),Te.preventDefault(),ge()},document.addEventListener("click",ce,!0)},z=Te=>{ue(),X.current=!1,U(!1),Z(0),G(!1),R.current=!1,v.current=0,M.current="none";const _=w.current;_&&P(Qo(_)),Te<0?d():l()},le=Te=>{if(Math.abs(Te)>l0&&t.length>1){z(Te);return}T(!0),Z(0),F()},he=Te=>{if(Te.touches.length!==1||X.current)return;const _=Te.touches[0];L.current=!0,h.current={x:_.clientX,y:_.clientY},M.current="none",v.current=0,R.current=!1},xe=Te=>{if(!h.current||Te.touches.length!==1||X.current)return;const _=Te.touches[0],pe=_.clientX-h.current.x,te=_.clientY-h.current.y;if(M.current==="none"){if(Math.abs(pe)<10&&Math.abs(te)<10)return;if(Math.abs(pe)>Math.abs(te)){if(t.length<=1)return;M.current="horizontal"}else if(te>0)M.current="vertical";else return}if(M.current==="horizontal"){R.current=!0,G(!0),v.current=pe,Z(pe),Te.preventDefault();return}M.current==="vertical"&&(R.current=!0,G(!0),m.current=te,W(te),Te.preventDefault())},Re=()=>{if(!h.current)return;const Te=M.current,_=R.current;if(_&&Te==="horizontal")le(v.current),we();else if(_&&Te==="vertical")if(m.current>s0){const te=window.innerHeight;m.current=te,$(!0),W(te),j("closing")}else m.current=0,W(0),we();else Te==="horizontal"&&Math.abs(v.current)>0&&(le(v.current),we());h.current=null,M.current="none",v.current=0,R.current=!1,G(!1)};return document.addEventListener("touchstart",he,{passive:!0}),document.addEventListener("touchmove",xe,{passive:!1}),document.addEventListener("touchend",Re),document.addEventListener("touchcancel",Re),()=>{document.removeEventListener("touchstart",he),document.removeEventListener("touchmove",xe),document.removeEventListener("touchend",Re),document.removeEventListener("touchcancel",Re),ge()}},[C,t.length,d,l,T,F,ue]),a.useEffect(()=>{const ce=ge=>{ge.key==="Escape"&&(ge.preventDefault(),ge.stopPropagation(),C!=="closing"&&j("closing"))};return window.addEventListener("keydown",ce,!0),()=>window.removeEventListener("keydown",ce,!0)},[C]);const J=()=>{C!=="closing"&&j("closing")},ve=C==="open",Ee=C==="closing",me=x>0?Math.max(0,1-x/500):1,de=x>0?Math.max(.35,1-x/500):1,q=ce=>{if(ce.stopPropagation(),L.current){L.current=!1;return}if(t.length<=1)return;const ge=ce.currentTarget.getBoundingClientRect(),we=ce.clientY-ge.top,z=Math.min(52,ge.height*.2);if(!(we>ge.height-z)){if(ce.clientX-ge.left<ge.width/2){l();return}d()}},Q=ce=>{if(t.length<=1)return;const ge=ce.currentTarget.getBoundingClientRect(),we=ce.clientX-ge.left,z=ce.clientY-ge.top,le=Math.min(52,ge.height*.2);if(z>ge.height-le){ce.currentTarget.style.cursor="default";return}ce.currentTarget.style.cursor=we<ge.width/2?"w-resize":"e-resize"},Y=a.useCallback(ce=>{ce.propertyName!=="transform"||!X.current||(ue(),T(!1))},[ue,T]),_e=oe?`translateX(${E}px)`:x>0?`translateY(${x}px)`:void 0,Ce={position:"fixed",top:B==null?void 0:B.top,left:B==null?void 0:B.left,width:B==null?void 0:B.width,height:B==null?void 0:B.height,objectFit:i==="cover"?"cover":"contain",transform:_e,opacity:x>0?de:C==="opening"||Ee?0:1,transition:V&&!k?"none":k?`transform ${In}ms ${ci}`:ie?`transform ${In}ms ${ci}, opacity ${In}ms ${ci}`:C==="opening"||Ee?`opacity ${In}ms ${ci}`:"none",pointerEvents:se&&ve&&!oe?"auto":"none",touchAction:se&&ve?"none":void 0,zIndex:9998},ke=B?{position:"fixed",top:B.top,height:B.height,width:B.width/2,zIndex:9999}:null;return r.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:C==="open"?"none":void 0},onClick:J,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:ve?me:0,transition:V?"none":`opacity ${In}ms ${ci}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:b?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:w,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:ve?1:0,transition:`opacity ${In}ms ${ci}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.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:w,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ve?1:0,transition:`opacity ${In}ms ${ci}`},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),B&&D&&(se?r.jsx(w0,{src:D.url,phase:C,mediaRef:f,mediaStyle:Ce,onLoadedMetadata:ne,onClick:q,onMouseMove:Q,onTransitionEnd:Y},`${n}-${D.url}`):r.jsx("img",{ref:f,src:D.url,alt:D.name,onLoad:ne,onTransitionEnd:Y,style:Ce},`${n}-${D.url}`)),ve&&ke&&t.length>1&&!se&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...ke,left:B.left,cursor:"w-resize",pointerEvents:oe?"none":"auto"},onClick:ce=>{if(L.current){L.current=!1;return}ce.stopPropagation(),l()}}),r.jsx("div",{style:{...ke,left:B.left+B.width/2,cursor:"e-resize",pointerEvents:oe?"none":"auto"},onClick:ce=>{if(L.current){L.current=!1;return}ce.stopPropagation(),d()}})]})]})}function Cl({P:e,media:t,imgWidth:n,cornerRadius:i,fillGalleryWidth:o,imageDisplay:s,isEditor:l,galleryPaddingBetween:d=0,showPaddingAfter:c=!1,showControls:u=!1,onMediaClick:p}){const b=`${e}-gallery-${Ra(t)?"video":"image"}`,w=s.display==="cover",f=x0(s),h=C=>S.scalingValue(C,l??!1),m=n??Mi,v=o?{width:"100%",maxWidth:"100%"}:{width:h(m),maxWidth:"100%"},M=i?{borderRadius:h(i)}:{},R={...v,...w?{aspectRatio:f,height:"auto",overflow:"hidden"}:{},...M},L={...w?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":h(m)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...w?{}:M},A={className:b,style:L,onClick:p?C=>{C.stopPropagation(),p()}:void 0},B=Math.max(d,di),P=Ra(t)?r.jsx("video",{...A,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):r.jsx("img",{...A,src:t.url,alt:t.name??""});return r.jsxs("div",{className:`${e}-gallery-item`,children:[w?r.jsx("div",{style:R,children:P}):P,c&&d>0&&r.jsx("div",{className:`${e}-padding-handle`,style:{height:h(d)},"aria-hidden":"true"}),u&&c&&r.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:h(B)}})]})}function $0({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:s,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:d,showControls:c,scaled:u,children:p}){const b=t==="a"?i:t==="c"?o:0,w=b>0||c;return r.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&w&&r.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(b)},"aria-hidden":"true"}),c&&t==="c"&&r.jsx("div",{"data-controls":"galleryPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(d),className:`${e}-control-anchor`,style:{top:0,left:0,width:u(l),height:"100%"}}),r.jsx("div",{className:`${e}-gallery`,style:n,children:p}),t==="a"&&w&&r.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(b)},"aria-hidden":"true"}),c&&t==="a"&&r.jsx("div",{"data-controls":"galleryPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(d),className:`${e}-control-anchor`,style:{top:0,right:0,width:u(s),height:"100%"}})]})}function C0(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function Tl({P:e,scaled:t,height:n,paired:i}){return r.jsx("div",{"data-controls":"titleTopPadding",...i?{"data-controls-paired":""}:{},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{top:0,left:0,width:"100%",height:t(n)}})}function Ll({P:e,controlKey:t,scaled:n,width:i,maxFraction:o,side:s,paired:l,anchorStyle:d}){return r.jsx("div",{"data-controls":t,...l?{"data-controls-paired":""}:{},"data-controls-axis":"x","data-controls-variant":"column-padding",...s==="right"?{"data-controls-reverse":""}:{},"data-controls-min":"0","data-controls-max-fraction":String(o),className:`${e}-control-anchor`,style:{top:0,...s==="left"?{left:0}:{right:0},width:n(i),height:"100%",...d}})}function ua({P:e,title:t,position:n,titleRef:i,titleClassName:o,titleContainerStyle:s,titleTextBoxStyle:l,titleStyle:d,showTextBoxOutline:c=!1,topPaddingControl:u}){const p=a.useRef(null),[b,w]=a.useState(0),f=t??"",h=n==="left"||n==="center"||n==="right";return a.useLayoutEffect(()=>{if(!h)return;const m=p.current;if(!m||typeof ResizeObserver>"u")return;const v=()=>w(m.offsetHeight);v();const M=new ResizeObserver(v);return M.observe(m),()=>M.disconnect()},[f,h]),r.jsx("div",{ref:m=>{p.current=m,i(m)},className:[o,`${e}-title-position-${n}`].join(" "),style:{...h?{[`--${e}-title-height`]:`${b}px`}:{},...s},children:r.jsxs("div",{className:`${e}-title-text-stack`,style:l,children:[u,r.jsx("div",{className:c?`${e}-title-text-inner`:`${e}-title-text-inner-hidden`,style:{width:"100%"},children:r.jsx("span",{className:`${e}-title-text`,style:d,children:f})})]})})}const Rl=45;function Il(e,t,n){let i=e;for(;i;){const o=getComputedStyle(i).getPropertyValue(t).trim();if(o){const s=parseFloat(o);if(!Number.isNaN(s))return s}i=i.parentElement}return n}function T0(e){const t=Il(e,"--cntrl-viewport-height",window.innerHeight),n=Il(e,"--cntrl-article-top",0);return{top:n,centerY:n+t/2}}function L0(e,t,n){const{top:i,centerY:o}=T0(n);if(t==="top"){const l=n&&parseFloat(getComputedStyle(n).top)||i;return Math.abs(e.top-l)}const s=e.top+e.height/2;return Math.abs(s-o)}function R0(e,t,n){const i=Array.from({length:t},(l,d)=>{const c=e.current[d];if(!c)return 0;const u=c.getBoundingClientRect(),p=L0(u,n,c);return Math.exp(-(p*p)/(2*Rl*Rl))});let o=0,s=-1;return i.forEach((l,d)=>{l>s&&(s=l,o=d)}),{opacities:i,dominantIndex:o}}function I0(e,t,n){const i=a.useRef([]),[{opacities:o,dominantIndex:s},l]=a.useState(()=>({opacities:Array.from({length:e},(c,u)=>u===0?1:0),dominantIndex:0}));return a.useLayoutEffect(()=>{if(!t||e===0){l({opacities:Array.from({length:e},()=>1),dominantIndex:0});return}let c=0;const u=()=>{l(R0(i,e,n))},p=()=>{c||(c=window.requestAnimationFrame(()=>{c=0,u()}))};return u(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p,{passive:!0}),()=>{c&&window.cancelAnimationFrame(c),window.removeEventListener("scroll",p),window.removeEventListener("resize",p)}},[t,e,n]),{setTitleRef:c=>u=>{i.current[c]=u},opacities:o,dominantIndex:s}}function M0(e,t){const[n,i]=a.useState(e),o=a.useRef(e);return a.useEffect(()=>{if(!t){o.current=e,i(e);return}const s=Array.from(o.current),l=Array.from(e),d=Math.max(s.length,l.length);if(d===0||o.current===e)return;let c=0;const u=window.setInterval(()=>{c+=1;const p=[...l.slice(0,c),...s.slice(c)].join("");o.current=p,i(p),c>=d&&window.clearInterval(u)},35);return()=>window.clearInterval(u)},[t,e]),n}function E0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:s}){var ut;const{prefix:l}=S.useScopedStyles(),d=a.useMemo(()=>r0(l),[l]),c=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",b=(e==null?void 0:e.imgWidth)??Mi,w=(e==null?void 0:e.titleWidth)??y0,f=v0(e==null?void 0:e.imageDisplay),h=(e==null?void 0:e.cornerRadius)??i0,m=(e==null?void 0:e.position)??"center",v=(e==null?void 0:e.titleTopPadding)??0,M=(e==null?void 0:e.titleLeftPadding)??0,R=(e==null?void 0:e.titleRightPadding)??0,L=C0(e==null?void 0:e.transition),X=(e==null?void 0:e.lightbox)??"on",A=p==="b",B=L==="fade"||L==="retype",{setTitleRef:P,dominantIndex:C}=I0(c.length,B,m),j=((ut=c[C])==null?void 0:ut.title)??"",x=M0(j,L==="retype"),W=L==="fade"||L==="retype",E=L==="retype"?x:j,Z=A?void 0:{width:S.scalingValue(b,n??!1)},k=X==="on"&&(!n||i||o),U=o??!1,V=(e==null?void 0:e.galleryPaddingRight)??0,G=(e==null?void 0:e.galleryPaddingLeft)??0,ie=(e==null?void 0:e.galleryPaddingBetween)??0,$=pt=>S.scalingValue(pt,n??!1),D={width:$(w)},se=p==="a"?V:G,oe=A?{width:"100%"}:{width:`calc(100% - ${$(b)} - ${$(se)})`,...p==="c"?{marginLeft:"auto"}:{}},T=Math.max(V,di),ue=Math.max(G,di),F=Math.max(ie,di),ne=Math.max(v,di),J=Math.max(M,di),ve=Math.max(R,di),Ee=Math.max(0,(u??1)-(b??Mi)),me=p==="a"?Math.max(0,(u??1)-(b??Mi)-V):p==="c"?Math.max(0,(u??1)-(b??Mi)-G):p==="b"?u??1:1,de=U&&(p==="a"||p==="b"||p==="c")&&m==="top",q=U&&((p==="a"||p==="b")&&(m==="left"||m==="top")||p==="c"&&(m==="left"||m==="top")),Q=U&&((p==="c"||p==="b")&&m==="right"||p==="a"&&m==="right"),Y=c.length>1,_e=A?void 0:$((p==="c"?G:V)+(b??Mi)),Ce=p==="c"&&_e?{left:_e}:void 0,ke=p==="a"&&_e?{right:_e}:void 0,ce=A?{left:0,width:"100%"}:p==="a"?{right:$(V),width:$(b)}:{left:$(G),width:$(b)},{titleColor:ge,titleFontFamily:we,titleFontSettings:z,titleFontSize:le,titleLineHeight:he,titleLetterSpacing:xe,titleWordSpacing:Re,titleAlign:Te,titleTextAppearance:_,lightboxCounterColor:pe,lightboxCounterFontFamily:te,lightboxCounterFontSettings:N,lightboxCounterFontSize:ee,lightboxCounterLineHeight:Ie,lightboxCounterLetterSpacing:re,lightboxCounterWordSpacing:O,lightboxCounterTextAppearance:Ve}=e??{},Oe={fontSettings:{fontFamily:we,fontWeight:(z==null?void 0:z.fontWeight)??400,fontStyle:(z==null?void 0:z.fontStyle)??"normal"},fontSize:le??.01,lineHeight:he,letterSpacing:xe??0,wordSpacing:Re??0,textAlign:Te??"left",textAppearance:_,color:ge??"#000000"},tt=on(Ut(Oe,n)),ht=D,nt=$l(le,he,l,n),Be=Sl(le,he,`${l}-title`,`${l}-text-tight-leading`),ye={fontSettings:{fontFamily:te,fontWeight:(N==null?void 0:N.fontWeight)??400,fontStyle:(N==null?void 0:N.fontStyle)??"normal"},fontSize:ee??.01,lineHeight:Ie,letterSpacing:re??0,wordSpacing:O??0,textAppearance:Ve,color:pe??"#DEDDDD"},De={...on(Ut(ye,n)),...$l(ee,Ie,l,n)},qe=Sl(ee,Ie,`${l}-lightbox-counter`,`${l}-text-tight-leading`),Se=S.buildColorVars(l,{titleColor:ge??"#000000",lightboxCounterColor:pe??"#DEDDDD"},c0,d0),Ne=a.useRef(null),[ze,Xe]=a.useState(!1),[ct,Je]=a.useState([]),[$t,dt]=a.useState(0),Fe=a.useCallback((pt,mt)=>{k&&(Je(pt),dt(mt),Xe(!0))},[k]),Ke=a.useCallback(()=>{Xe(!1)},[]),je=a.useMemo(()=>{const pt={...Se},mt=Ne.current?getComputedStyle(Ne.current).getPropertyValue("--cntrl-article-width").trim():"";return mt&&(pt["--cntrl-article-width"]=mt),pt},[Se,ze]);return a.useEffect(()=>{if(!ze||X!=="on"||typeof document>"u")return;const pt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=pt}},[ze,X]),a.useEffect(()=>{!n||o||i||Xe(!1)},[n,o,i]),a.useEffect(()=>{X==="off"&&Xe(!1)},[X]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),r.jsx("div",{style:Se,children:r.jsxs("div",{ref:Ne,className:`${l}-wrapper`,style:{width:S.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:(p==="a"||p==="b"||p==="c")&&m==="top"?$(v):void 0,[`--${l}-title-left-padding`]:(p==="a"||p==="b")&&(m==="left"||m==="top")||p==="c"&&(m==="left"||m==="top")?$(M):void 0,[`--${l}-title-right-padding`]:(p==="c"||p==="b")&&m==="right"||p==="a"&&m==="right"?$(R):void 0},children:[W&&r.jsx("div",{className:`${l}-single-title-layer`,children:r.jsx(ua,{P:l,title:E,position:m,titleRef:()=>{},titleClassName:`${Be} ${l}-single-title`,titleContainerStyle:{...nt,...oe},titleTextBoxStyle:ht,titleStyle:tt,showTextBoxOutline:U,topPaddingControl:de?Tl({P:l,scaled:$,height:ne,paired:!1}):void 0})}),c.map((pt,mt)=>{const kt=g0(pt.gallery),Xt=mt<c.length-1,Yt=kt.filter(bt=>bt.lightboxMedia).map(bt=>bt.lightboxMedia),vt={P:l,position:m,titleRef:P(mt),titleClassName:Be,titleContainerStyle:nt,titleTextBoxStyle:W?{maxWidth:"100%"}:ht,titleStyle:tt,showTextBoxOutline:U&&!W,topPaddingControl:de&&!W?Tl({P:l,scaled:$,height:ne,paired:Y}):void 0};return r.jsxs("div",{"data-item-index":mt,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:Xt?$(ie):void 0},children:[q&&Ll({P:l,controlKey:"titleLeftPadding",scaled:$,width:J,maxFraction:me,side:"left",paired:Y,anchorStyle:Ce}),Q&&Ll({P:l,controlKey:"titleRightPadding",scaled:$,width:ve,maxFraction:me,side:"right",paired:Y,anchorStyle:ke}),U&&Xt&&r.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${l}-control-anchor`,style:{bottom:0,height:$(F),...ce}}),A?r.jsxs("div",{className:`${l}-gallery`,children:[r.jsx("div",{className:`${l}-gallery-media`,children:kt.map(({displayMedia:bt,lightboxMedia:Gt},Ft)=>{const xt=Gt?Yt.findIndex(Ht=>Ht.url===Gt.url):-1;return r.jsx(Cl,{P:l,media:bt,imgWidth:b||void 0,cornerRadius:h||void 0,imageDisplay:f,isEditor:n,galleryPaddingBetween:ie,showPaddingAfter:Ft<kt.length-1,showControls:U,onMediaClick:k&&xt>=0?()=>Fe(Yt,xt):void 0},`${bt.url}-${Ft}`)})}),r.jsx("div",{className:`${l}-title-layer`,children:r.jsx(ua,{...vt,title:W?"":pt.title})})]}):r.jsxs(r.Fragment,{children:[r.jsx(ua,{...vt,title:W?"":pt.title}),kt.length>0&&r.jsx($0,{P:l,layoutType:p,galleryWidthStyle:Z,galleryPaddingRight:V,galleryPaddingLeft:G,galleryPaddingRightWidth:T,galleryPaddingLeftWidth:ue,galleryPaddingMaxFraction:Ee,showControls:U,scaled:$,children:kt.map(({displayMedia:bt,lightboxMedia:Gt},Ft)=>{const xt=Gt?Yt.findIndex(Ht=>Ht.url===Gt.url):-1;return r.jsx(Cl,{P:l,media:bt,cornerRadius:h||void 0,fillGalleryWidth:!0,imageDisplay:f,isEditor:n,galleryPaddingBetween:ie,showPaddingAfter:Ft<kt.length-1,showControls:U,onMediaClick:k&&xt>=0?()=>Fe(Yt,xt):void 0},`${bt.url}-${Ft}`)})})]})]},mt)})]})}),ze&&X==="on"&&typeof document<"u"&&e&&(()=>{const pt=(s?document.getElementById(s):null)??document.body;return Yn.createPortal(r.jsx("div",{style:je,"data-selection":"none",children:r.jsx(S0,{prefix:l,items:ct,index:$t,imageDisplay:b0(e.lightboxImageDisplay),isEditor:n,onClose:Ke,onPrev:()=>dt(mt=>(mt-1+ct.length)%ct.length),onNext:()=>dt(mt=>(mt+1)%ct.length),counterClassName:qe,counterStyle:De,backgroundColor:e.backgroundColor??a0})}),pt)})()]})}const P0=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
19993
+ `}const a0="rgba(28,31,34,0.9)",In=500,ci="cubic-bezier(0.22, 1, 0.36, 1)",s0=72,l0=50,c0={titleColor:"title-color",lightboxCounterColor:"lightbox-counter-color"},d0=[];function u0(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 p0(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function m0(e){const[t]=e.media;return t!=null&&t.url?t:null}function g0(e){if(!Array.isArray(e)||e.length===0)return[];if(u0(e)){const t=[];for(const n of e){const i=p0(n);if(!i)continue;const o=m0(n);t.push({displayMedia:i,lightboxMedia:o!=null&&o.url?o:null})}return t}return e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function Ra(e){return e.type==="video"}function h0(e){e.pause(),e.removeAttribute("src"),e.load()}function Qo(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function f0(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const y0=1140/1440;function v0(e){return typeof e=="string"?{display:e.toLowerCase()==="cover"?"cover":"fit",ratioValue:"2:3",reversed:!1}:{display:(typeof(e==null?void 0:e.display)=="string"?e.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(e==null?void 0:e.ratioValue)??"2:3",reversed:(e==null?void 0:e.reversed)??!1}}function x0(e){const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`}function b0(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function w0({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:s,onMouseMove:l,onTransitionEnd:d}){return a.useEffect(()=>{const c=n.current;if(c)return()=>{h0(c)}},[e,n]),r.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:s,onMouseMove:l,onTransitionEnd:d,style:i})}function S0({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:s,onPrev:l,onNext:d,counterClassName:c,counterStyle:u,backgroundColor:p}){const b=i==="cover",w=a.useRef(null),f=a.useRef(null),h=a.useRef(null),m=a.useRef(0),v=a.useRef(0),M=a.useRef("none"),R=a.useRef(!1),L=a.useRef(!1),X=a.useRef(!1),F=a.useRef(null),[B,k]=a.useState(null),[C,j]=a.useState("opening"),[x,W]=a.useState(0),[E,Z]=a.useState(0),[P,U]=a.useState(!1),[V,G]=a.useState(!1),[ie,$]=a.useState(!1),I=a.useRef(n),D=t[n],se=D?Ra(D):!1,oe=E!==0||P,T=a.useCallback(ce=>{X.current=ce,U(ce)},[]),ue=a.useCallback(()=>{F.current!==null&&(window.clearTimeout(F.current),F.current=null)},[]),A=a.useCallback(()=>{ue(),F.current=window.setTimeout(()=>{ue(),T(!1)},In+32)},[ue,T]),ne=a.useCallback(()=>{const ce=w.current,ge=f.current;if(!ce)return;const we=ce.getBoundingClientRect(),z=we.width,le=we.height;if(!z||!le)return;if(i==="cover"){k({width:z,height:le,left:we.left,top:we.top});return}if(!ge){k(Qo(ce));return}const{width:he,height:xe}=f0(ge);if(!he||!xe){k(Qo(ce));return}const Re=he/xe,Te=z/le;if(Re>Te){const _=z/Re;k({width:z,height:_,left:we.left,top:we.top+(le-_)/2})}else{const _=le*Re;k({width:_,height:le,left:we.left+(z-_)/2,top:we.top})}},[i]);a.useEffect(()=>{ne();const ce=w.current;if(!ce)return;const ge=new ResizeObserver(()=>ne());return ge.observe(ce),()=>ge.disconnect()},[ne,n]),a.useEffect(()=>{C==="opening"&&B&&j("open")},[C,B]),a.useEffect(()=>{if(C!=="closing")return;const ce=setTimeout(()=>s(),In);return()=>clearTimeout(ce)},[C,s]),a.useEffect(()=>()=>{ue()},[ue]),a.useLayoutEffect(()=>{if(I.current===n)return;ue(),W(0),Z(0),T(!1),$(!1),G(!1),m.current=0,v.current=0,M.current="none",R.current=!1,h.current=null,L.current=!1;const ce=w.current;ce&&k(Qo(ce)),I.current=n},[n,T,ue]),a.useEffect(()=>{if(C!=="open")return;let ce=null;const ge=()=>{ce&&(document.removeEventListener("click",ce,!0),ce=null)},we=()=>{ge(),ce=Te=>{Te.stopPropagation(),Te.preventDefault(),ge()},document.addEventListener("click",ce,!0)},z=Te=>{ue(),X.current=!1,U(!1),Z(0),G(!1),R.current=!1,v.current=0,M.current="none";const _=w.current;_&&k(Qo(_)),Te<0?d():l()},le=Te=>{if(Math.abs(Te)>l0&&t.length>1){z(Te);return}T(!0),Z(0),A()},he=Te=>{if(Te.touches.length!==1||X.current)return;const _=Te.touches[0];L.current=!0,h.current={x:_.clientX,y:_.clientY},M.current="none",v.current=0,R.current=!1},xe=Te=>{if(!h.current||Te.touches.length!==1||X.current)return;const _=Te.touches[0],pe=_.clientX-h.current.x,te=_.clientY-h.current.y;if(M.current==="none"){if(Math.abs(pe)<10&&Math.abs(te)<10)return;if(Math.abs(pe)>Math.abs(te)){if(t.length<=1)return;M.current="horizontal"}else if(te>0)M.current="vertical";else return}if(M.current==="horizontal"){R.current=!0,G(!0),v.current=pe,Z(pe),Te.preventDefault();return}M.current==="vertical"&&(R.current=!0,G(!0),m.current=te,W(te),Te.preventDefault())},Re=()=>{if(!h.current)return;const Te=M.current,_=R.current;if(_&&Te==="horizontal")le(v.current),we();else if(_&&Te==="vertical")if(m.current>s0){const te=window.innerHeight;m.current=te,$(!0),W(te),j("closing")}else m.current=0,W(0),we();else Te==="horizontal"&&Math.abs(v.current)>0&&(le(v.current),we());h.current=null,M.current="none",v.current=0,R.current=!1,G(!1)};return document.addEventListener("touchstart",he,{passive:!0}),document.addEventListener("touchmove",xe,{passive:!1}),document.addEventListener("touchend",Re),document.addEventListener("touchcancel",Re),()=>{document.removeEventListener("touchstart",he),document.removeEventListener("touchmove",xe),document.removeEventListener("touchend",Re),document.removeEventListener("touchcancel",Re),ge()}},[C,t.length,d,l,T,A,ue]),a.useEffect(()=>{const ce=ge=>{ge.key==="Escape"&&(ge.preventDefault(),ge.stopPropagation(),C!=="closing"&&j("closing"))};return window.addEventListener("keydown",ce,!0),()=>window.removeEventListener("keydown",ce,!0)},[C]);const J=()=>{C!=="closing"&&j("closing")},ve=C==="open",Ee=C==="closing",me=x>0?Math.max(0,1-x/500):1,de=x>0?Math.max(.35,1-x/500):1,q=ce=>{if(ce.stopPropagation(),L.current){L.current=!1;return}if(t.length<=1)return;const ge=ce.currentTarget.getBoundingClientRect(),we=ce.clientY-ge.top,z=Math.min(52,ge.height*.2);if(!(we>ge.height-z)){if(ce.clientX-ge.left<ge.width/2){l();return}d()}},Q=ce=>{if(t.length<=1)return;const ge=ce.currentTarget.getBoundingClientRect(),we=ce.clientX-ge.left,z=ce.clientY-ge.top,le=Math.min(52,ge.height*.2);if(z>ge.height-le){ce.currentTarget.style.cursor="default";return}ce.currentTarget.style.cursor=we<ge.width/2?"w-resize":"e-resize"},Y=a.useCallback(ce=>{ce.propertyName!=="transform"||!X.current||(ue(),T(!1))},[ue,T]),_e=oe?`translateX(${E}px)`:x>0?`translateY(${x}px)`:void 0,Ce={position:"fixed",top:B==null?void 0:B.top,left:B==null?void 0:B.left,width:B==null?void 0:B.width,height:B==null?void 0:B.height,objectFit:i==="cover"?"cover":"contain",transform:_e,opacity:x>0?de:C==="opening"||Ee?0:1,transition:V&&!P?"none":P?`transform ${In}ms ${ci}`:ie?`transform ${In}ms ${ci}, opacity ${In}ms ${ci}`:C==="opening"||Ee?`opacity ${In}ms ${ci}`:"none",pointerEvents:se&&ve&&!oe?"auto":"none",touchAction:se&&ve?"none":void 0,zIndex:9998},ke=B?{position:"fixed",top:B.top,height:B.height,width:B.width/2,zIndex:9999}:null;return r.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:C==="open"?"none":void 0},onClick:J,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:ve?me:0,transition:V?"none":`opacity ${In}ms ${ci}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:b?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:w,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:ve?1:0,transition:`opacity ${In}ms ${ci}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.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:w,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ve?1:0,transition:`opacity ${In}ms ${ci}`},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),B&&D&&(se?r.jsx(w0,{src:D.url,phase:C,mediaRef:f,mediaStyle:Ce,onLoadedMetadata:ne,onClick:q,onMouseMove:Q,onTransitionEnd:Y},`${n}-${D.url}`):r.jsx("img",{ref:f,src:D.url,alt:D.name,onLoad:ne,onTransitionEnd:Y,style:Ce},`${n}-${D.url}`)),ve&&ke&&t.length>1&&!se&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...ke,left:B.left,cursor:"w-resize",pointerEvents:oe?"none":"auto"},onClick:ce=>{if(L.current){L.current=!1;return}ce.stopPropagation(),l()}}),r.jsx("div",{style:{...ke,left:B.left+B.width/2,cursor:"e-resize",pointerEvents:oe?"none":"auto"},onClick:ce=>{if(L.current){L.current=!1;return}ce.stopPropagation(),d()}})]})]})}function Cl({P:e,media:t,imgWidth:n,cornerRadius:i,fillGalleryWidth:o,imageDisplay:s,isEditor:l,galleryPaddingBetween:d=0,showPaddingAfter:c=!1,showControls:u=!1,onMediaClick:p}){const b=`${e}-gallery-${Ra(t)?"video":"image"}`,w=s.display==="cover",f=x0(s),h=C=>S.scalingValue(C,l??!1),m=n??Mi,v=o?{width:"100%",maxWidth:"100%"}:{width:h(m),maxWidth:"100%"},M=i?{borderRadius:h(i)}:{},R={...v,...w?{aspectRatio:f,height:"auto",overflow:"hidden"}:{},...M},L={...w?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":h(m)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...w?{}:M},F={className:b,style:L,onClick:p?C=>{C.stopPropagation(),p()}:void 0},B=Math.max(d,di),k=Ra(t)?r.jsx("video",{...F,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):r.jsx("img",{...F,src:t.url,alt:t.name??""});return r.jsxs("div",{className:`${e}-gallery-item`,children:[w?r.jsx("div",{style:R,children:k}):k,c&&d>0&&r.jsx("div",{className:`${e}-padding-handle`,style:{height:h(d)},"aria-hidden":"true"}),u&&c&&r.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:h(B)}})]})}function $0({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:s,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:d,showControls:c,scaled:u,children:p}){const b=t==="a"?i:t==="c"?o:0,w=b>0||c;return r.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&w&&r.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(b)},"aria-hidden":"true"}),c&&t==="c"&&r.jsx("div",{"data-controls":"galleryPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(d),className:`${e}-control-anchor`,style:{top:0,left:0,width:u(l),height:"100%"}}),r.jsx("div",{className:`${e}-gallery`,style:n,children:p}),t==="a"&&w&&r.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(b)},"aria-hidden":"true"}),c&&t==="a"&&r.jsx("div",{"data-controls":"galleryPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(d),className:`${e}-control-anchor`,style:{top:0,right:0,width:u(s),height:"100%"}})]})}function C0(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function Tl({P:e,scaled:t,height:n,paired:i}){return r.jsx("div",{"data-controls":"titleTopPadding",...i?{"data-controls-paired":""}:{},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{top:0,left:0,width:"100%",height:t(n)}})}function Ll({P:e,controlKey:t,scaled:n,width:i,maxFraction:o,side:s,paired:l,anchorStyle:d}){return r.jsx("div",{"data-controls":t,...l?{"data-controls-paired":""}:{},"data-controls-axis":"x","data-controls-variant":"column-padding",...s==="right"?{"data-controls-reverse":""}:{},"data-controls-min":"0","data-controls-max-fraction":String(o),className:`${e}-control-anchor`,style:{top:0,...s==="left"?{left:0}:{right:0},width:n(i),height:"100%",...d}})}function ua({P:e,title:t,position:n,titleRef:i,titleClassName:o,titleContainerStyle:s,titleTextBoxStyle:l,titleStyle:d,showTextBoxOutline:c=!1,topPaddingControl:u}){const p=a.useRef(null),[b,w]=a.useState(0),f=t??"",h=n==="left"||n==="center"||n==="right";return a.useLayoutEffect(()=>{if(!h)return;const m=p.current;if(!m||typeof ResizeObserver>"u")return;const v=()=>w(m.offsetHeight);v();const M=new ResizeObserver(v);return M.observe(m),()=>M.disconnect()},[f,h]),r.jsx("div",{ref:m=>{p.current=m,i(m)},className:[o,`${e}-title-position-${n}`].join(" "),style:{...h?{[`--${e}-title-height`]:`${b}px`}:{},...s},children:r.jsxs("div",{className:`${e}-title-text-stack`,style:l,children:[u,r.jsx("div",{className:c?`${e}-title-text-inner`:`${e}-title-text-inner-hidden`,style:{width:"100%"},children:r.jsx("span",{className:`${e}-title-text`,style:d,children:f})})]})})}const Rl=45;function Il(e,t,n){let i=e;for(;i;){const o=getComputedStyle(i).getPropertyValue(t).trim();if(o){const s=parseFloat(o);if(!Number.isNaN(s))return s}i=i.parentElement}return n}function T0(e){const t=Il(e,"--cntrl-viewport-height",window.innerHeight),n=Il(e,"--cntrl-article-top",0);return{top:n,centerY:n+t/2}}function L0(e,t,n){const{top:i,centerY:o}=T0(n);if(t==="top"){const l=n&&parseFloat(getComputedStyle(n).top)||i;return Math.abs(e.top-l)}const s=e.top+e.height/2;return Math.abs(s-o)}function R0(e,t,n){const i=Array.from({length:t},(l,d)=>{const c=e.current[d];if(!c)return 0;const u=c.getBoundingClientRect(),p=L0(u,n,c);return Math.exp(-(p*p)/(2*Rl*Rl))});let o=0,s=-1;return i.forEach((l,d)=>{l>s&&(s=l,o=d)}),{opacities:i,dominantIndex:o}}function I0(e,t,n){const i=a.useRef([]),[{opacities:o,dominantIndex:s},l]=a.useState(()=>({opacities:Array.from({length:e},(c,u)=>u===0?1:0),dominantIndex:0}));return a.useLayoutEffect(()=>{if(!t||e===0){l({opacities:Array.from({length:e},()=>1),dominantIndex:0});return}let c=0;const u=()=>{l(R0(i,e,n))},p=()=>{c||(c=window.requestAnimationFrame(()=>{c=0,u()}))};return u(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p,{passive:!0}),()=>{c&&window.cancelAnimationFrame(c),window.removeEventListener("scroll",p),window.removeEventListener("resize",p)}},[t,e,n]),{setTitleRef:c=>u=>{i.current[c]=u},opacities:o,dominantIndex:s}}function M0(e,t){const[n,i]=a.useState(e),o=a.useRef(e);return a.useEffect(()=>{if(!t){o.current=e,i(e);return}const s=Array.from(o.current),l=Array.from(e),d=Math.max(s.length,l.length);if(d===0||o.current===e)return;let c=0;const u=window.setInterval(()=>{c+=1;const p=[...l.slice(0,c),...s.slice(c)].join("");o.current=p,i(p),c>=d&&window.clearInterval(u)},35);return()=>window.clearInterval(u)},[t,e]),n}function E0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:s}){var ut;const{prefix:l}=S.useScopedStyles(),d=a.useMemo(()=>r0(l),[l]),c=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",b=(e==null?void 0:e.imgWidth)??Mi,w=(e==null?void 0:e.titleWidth)??y0,f=v0(e==null?void 0:e.imageDisplay),h=(e==null?void 0:e.cornerRadius)??i0,m=(e==null?void 0:e.position)??"center",v=(e==null?void 0:e.titleTopPadding)??0,M=(e==null?void 0:e.titleLeftPadding)??0,R=(e==null?void 0:e.titleRightPadding)??0,L=C0(e==null?void 0:e.transition),X=(e==null?void 0:e.lightbox)??"on",F=p==="b",B=L==="fade"||L==="retype",{setTitleRef:k,dominantIndex:C}=I0(c.length,B,m),j=((ut=c[C])==null?void 0:ut.title)??"",x=M0(j,L==="retype"),W=L==="fade"||L==="retype",E=L==="retype"?x:j,Z=F?void 0:{width:S.scalingValue(b,n??!1)},P=X==="on"&&(!n||i||o),U=o??!1,V=(e==null?void 0:e.galleryPaddingRight)??0,G=(e==null?void 0:e.galleryPaddingLeft)??0,ie=(e==null?void 0:e.galleryPaddingBetween)??0,$=pt=>S.scalingValue(pt,n??!1),D={width:$(w)},se=p==="a"?V:G,oe=F?{width:"100%"}:{width:`calc(100% - ${$(b)} - ${$(se)})`,...p==="c"?{marginLeft:"auto"}:{}},T=Math.max(V,di),ue=Math.max(G,di),A=Math.max(ie,di),ne=Math.max(v,di),J=Math.max(M,di),ve=Math.max(R,di),Ee=Math.max(0,(u??1)-(b??Mi)),me=p==="a"?Math.max(0,(u??1)-(b??Mi)-V):p==="c"?Math.max(0,(u??1)-(b??Mi)-G):p==="b"?u??1:1,de=U&&(p==="a"||p==="b"||p==="c")&&m==="top",q=U&&((p==="a"||p==="b")&&(m==="left"||m==="top")||p==="c"&&(m==="left"||m==="top")),Q=U&&((p==="c"||p==="b")&&m==="right"||p==="a"&&m==="right"),Y=c.length>1,_e=F?void 0:$((p==="c"?G:V)+(b??Mi)),Ce=p==="c"&&_e?{left:_e}:void 0,ke=p==="a"&&_e?{right:_e}:void 0,ce=F?{left:0,width:"100%"}:p==="a"?{right:$(V),width:$(b)}:{left:$(G),width:$(b)},{titleColor:ge,titleFontFamily:we,titleFontSettings:z,titleFontSize:le,titleLineHeight:he,titleLetterSpacing:xe,titleWordSpacing:Re,titleAlign:Te,titleTextAppearance:_,lightboxCounterColor:pe,lightboxCounterFontFamily:te,lightboxCounterFontSettings:N,lightboxCounterFontSize:ee,lightboxCounterLineHeight:Ie,lightboxCounterLetterSpacing:re,lightboxCounterWordSpacing:O,lightboxCounterTextAppearance:Ve}=e??{},Oe={fontSettings:{fontFamily:we,fontWeight:(z==null?void 0:z.fontWeight)??400,fontStyle:(z==null?void 0:z.fontStyle)??"normal"},fontSize:le??.01,lineHeight:he,letterSpacing:xe??0,wordSpacing:Re??0,textAlign:Te??"left",textAppearance:_,color:ge??"#000000"},tt=on(Ut(Oe,n)),ht=D,nt=$l(le,he,l,n),Be=Sl(le,he,`${l}-title`,`${l}-text-tight-leading`),ye={fontSettings:{fontFamily:te,fontWeight:(N==null?void 0:N.fontWeight)??400,fontStyle:(N==null?void 0:N.fontStyle)??"normal"},fontSize:ee??.01,lineHeight:Ie,letterSpacing:re??0,wordSpacing:O??0,textAppearance:Ve,color:pe??"#DEDDDD"},De={...on(Ut(ye,n)),...$l(ee,Ie,l,n)},qe=Sl(ee,Ie,`${l}-lightbox-counter`,`${l}-text-tight-leading`),Se=S.buildColorVars(l,{titleColor:ge??"#000000",lightboxCounterColor:pe??"#DEDDDD"},c0,d0),Ne=a.useRef(null),[ze,Xe]=a.useState(!1),[ct,Je]=a.useState([]),[$t,dt]=a.useState(0),Fe=a.useCallback((pt,mt)=>{P&&(Je(pt),dt(mt),Xe(!0))},[P]),Ke=a.useCallback(()=>{Xe(!1)},[]),je=a.useMemo(()=>{const pt={...Se},mt=Ne.current?getComputedStyle(Ne.current).getPropertyValue("--cntrl-article-width").trim():"";return mt&&(pt["--cntrl-article-width"]=mt),pt},[Se,ze]);return a.useEffect(()=>{if(!ze||X!=="on"||typeof document>"u")return;const pt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=pt}},[ze,X]),a.useEffect(()=>{!n||o||i||Xe(!1)},[n,o,i]),a.useEffect(()=>{X==="off"&&Xe(!1)},[X]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),r.jsx("div",{style:Se,children:r.jsxs("div",{ref:Ne,className:`${l}-wrapper`,style:{width:S.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:(p==="a"||p==="b"||p==="c")&&m==="top"?$(v):void 0,[`--${l}-title-left-padding`]:(p==="a"||p==="b")&&(m==="left"||m==="top")||p==="c"&&(m==="left"||m==="top")?$(M):void 0,[`--${l}-title-right-padding`]:(p==="c"||p==="b")&&m==="right"||p==="a"&&m==="right"?$(R):void 0},children:[W&&r.jsx("div",{className:`${l}-single-title-layer`,children:r.jsx(ua,{P:l,title:E,position:m,titleRef:()=>{},titleClassName:`${Be} ${l}-single-title`,titleContainerStyle:{...nt,...oe},titleTextBoxStyle:ht,titleStyle:tt,showTextBoxOutline:U,topPaddingControl:de?Tl({P:l,scaled:$,height:ne,paired:!1}):void 0})}),c.map((pt,mt)=>{const kt=g0(pt.gallery),Xt=mt<c.length-1,Yt=kt.filter(bt=>bt.lightboxMedia).map(bt=>bt.lightboxMedia),vt={P:l,position:m,titleRef:k(mt),titleClassName:Be,titleContainerStyle:nt,titleTextBoxStyle:W?{maxWidth:"100%"}:ht,titleStyle:tt,showTextBoxOutline:U&&!W,topPaddingControl:de&&!W?Tl({P:l,scaled:$,height:ne,paired:Y}):void 0};return r.jsxs("div",{"data-item-index":mt,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:Xt?$(ie):void 0},children:[q&&Ll({P:l,controlKey:"titleLeftPadding",scaled:$,width:J,maxFraction:me,side:"left",paired:Y,anchorStyle:Ce}),Q&&Ll({P:l,controlKey:"titleRightPadding",scaled:$,width:ve,maxFraction:me,side:"right",paired:Y,anchorStyle:ke}),U&&Xt&&r.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${l}-control-anchor`,style:{bottom:0,height:$(A),...ce}}),F?r.jsxs("div",{className:`${l}-gallery`,children:[r.jsx("div",{className:`${l}-gallery-media`,children:kt.map(({displayMedia:bt,lightboxMedia:Gt},Ft)=>{const xt=Gt?Yt.findIndex(Ht=>Ht.url===Gt.url):-1;return r.jsx(Cl,{P:l,media:bt,imgWidth:b||void 0,cornerRadius:h||void 0,imageDisplay:f,isEditor:n,galleryPaddingBetween:ie,showPaddingAfter:Ft<kt.length-1,showControls:U,onMediaClick:P&&xt>=0?()=>Fe(Yt,xt):void 0},`${bt.url}-${Ft}`)})}),r.jsx("div",{className:`${l}-title-layer`,children:r.jsx(ua,{...vt,title:W?"":pt.title})})]}):r.jsxs(r.Fragment,{children:[r.jsx(ua,{...vt,title:W?"":pt.title}),kt.length>0&&r.jsx($0,{P:l,layoutType:p,galleryWidthStyle:Z,galleryPaddingRight:V,galleryPaddingLeft:G,galleryPaddingRightWidth:T,galleryPaddingLeftWidth:ue,galleryPaddingMaxFraction:Ee,showControls:U,scaled:$,children:kt.map(({displayMedia:bt,lightboxMedia:Gt},Ft)=>{const xt=Gt?Yt.findIndex(Ht=>Ht.url===Gt.url):-1;return r.jsx(Cl,{P:l,media:bt,cornerRadius:h||void 0,fillGalleryWidth:!0,imageDisplay:f,isEditor:n,galleryPaddingBetween:ie,showPaddingAfter:Ft<kt.length-1,showControls:U,onMediaClick:P&&xt>=0?()=>Fe(Yt,xt):void 0},`${bt.url}-${Ft}`)})})]})]},mt)})]})}),ze&&X==="on"&&typeof document<"u"&&e&&(()=>{const pt=(s?document.getElementById(s):null)??document.body;return Yn.createPortal(r.jsx("div",{style:je,"data-selection":"none",children:r.jsx(S0,{prefix:l,items:ct,index:$t,imageDisplay:b0(e.lightboxImageDisplay),isEditor:n,onClose:Ke,onPrev:()=>dt(mt=>(mt-1+ct.length)%ct.length),onNext:()=>dt(mt=>(mt+1)%ct.length),counterClassName:qe,counterStyle:De,backgroundColor:e.backgroundColor??a0})}),pt)})()]})}const P0=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
19990
19994
  import { createPortal } from 'react-dom';
19991
19995
  import type React from 'react';
19992
19996
  import { CommonComponentProps } from '../props';