@cntrl-site/components 1.0.56-alpha.0 → 1.0.56-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Components/Mercury/Mercury.d.ts +7 -1
- package/dist/index.js +202 -86
- package/dist/index.mjs +5459 -5251
- 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"),ct=require("classnames"),v=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Yn=require("react-dom");function Hc(e){return e.type==="object"&&e.version===1}const Oc="ControlSlider-module__wrapper___sHEkd",jc="ControlSlider-module__hoverArrow___A-dOH",Dc="ControlSlider-module__sliderItem___QQSkR",zc="ControlSlider-module__sliderImage___9hRl-",Bc="ControlSlider-module__arrow___05ghY",Vc="ControlSlider-module__arrowVertical___tBfVN",Gc="ControlSlider-module__nextArrow___-30Yc",qc="ControlSlider-module__arrowInner___aEra3",Uc="ControlSlider-module__arrowIcon___S4ztF",Kc="ControlSlider-module__arrowImg___2dwJW",Xc="ControlSlider-module__mirror___brd6U",Yc="ControlSlider-module__pagination___bicLF",Zc="ControlSlider-module__paginationInner___bT-P-",Jc="ControlSlider-module__paginationVertical___zYqKw",Qc="ControlSlider-module__paginationItem___nTRbk",ed="ControlSlider-module__dot___p1Qun",td="ControlSlider-module__activeDot___LHFaj",nd="ControlSlider-module__paginationInsideBottom___R3FWn",id="ControlSlider-module__paginationInsideTop___V-qb-",od="ControlSlider-module__paginationOutsideBottom___14w8D",rd="ControlSlider-module__paginationOutsideTop___SCLqB",ad="ControlSlider-module__paginationInsideLeft___yOBRZ",sd="ControlSlider-module__paginationInsideRight___Rtt3o",ld="ControlSlider-module__paginationOutsideLeft___lahaw",cd="ControlSlider-module__paginationOutsideRight___EtuQa",dd="ControlSlider-module__imgWrapper___UjEgB",ud="ControlSlider-module__captionBlock___dJ6-j",pd="ControlSlider-module__captionTextWrapper___HFlpf",md="ControlSlider-module__captionText___uGBVc",gd="ControlSlider-module__active___WZK4G",hd="ControlSlider-module__withPointerEvents___t-18M",fd="ControlSlider-module__topLeftAlignment___zjnGM",yd="ControlSlider-module__topCenterAlignment___gD1xW",vd="ControlSlider-module__topRightAlignment___NMapS",xd="ControlSlider-module__middleLeftAlignment___OnUrY",bd="ControlSlider-module__middleCenterAlignment___Tdkl0",wd="ControlSlider-module__middleRightAlignment___wEbfX",Sd="ControlSlider-module__bottomLeftAlignment___cTP2-",$d="ControlSlider-module__bottomCenterAlignment___c54fB",Cd="ControlSlider-module__bottomRightAlignment___kEwrz",Td="ControlSlider-module__clickOverlay___DZA28",Ld="ControlSlider-module__contain___pLyq7",Id="ControlSlider-module__cover___KdDat",rt={wrapper:Oc,hoverArrow:jc,sliderItem:Dc,sliderImage:zc,arrow:Bc,arrowVertical:Vc,nextArrow:Gc,arrowInner:qc,arrowIcon:Uc,arrowImg:Kc,mirror:Xc,pagination:Yc,paginationInner:Zc,paginationVertical:Jc,paginationItem:Qc,dot:ed,activeDot:td,paginationInsideBottom:nd,paginationInsideTop:id,paginationOutsideBottom:od,paginationOutsideTop:rd,paginationInsideLeft:ad,paginationInsideRight:sd,paginationOutsideLeft:ld,paginationOutsideRight:cd,imgWrapper:dd,captionBlock:ud,captionTextWrapper:pd,captionText:md,active:gd,withPointerEvents:hd,topLeftAlignment:fd,topCenterAlignment:yd,topRightAlignment:vd,middleLeftAlignment:xd,middleCenterAlignment:bd,middleRightAlignment:wd,bottomLeftAlignment:Sd,bottomCenterAlignment:$d,bottomRightAlignment:Cd,clickOverlay:Td,contain:Ld,cover:Id};function Rd(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 Ed(e,t,n){return t&&Rd(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var rs="(prefers-reduced-motion: reduce)",Li=1,Md=2,Pi=3,Gi=4,So=5,Jo=6,rr=7,kd={CREATED:Li,MOUNTED:Md,IDLE:Pi,MOVING:Gi,SCROLLING:So,DRAGGING:Jo,DESTROYED:rr};function Wn(e){e.length=0}function Zn(e,t,n){return Array.prototype.slice.call(e,t,n)}function Nt(e){return e.bind.apply(e,[null].concat(Zn(arguments,1)))}var $l=setTimeout,da=function(){};function as(e){return requestAnimationFrame(e)}function hr(e,t){return typeof t===e}function co(e){return!La(e)&&hr("object",e)}var Ta=Array.isArray,Cl=Nt(hr,"function"),qn=Nt(hr,"string"),$o=Nt(hr,"undefined");function La(e){return e===null}function Tl(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Co(e){return Ta(e)?e:[e]}function yn(e,t){Co(e).forEach(t)}function Ia(e,t){return e.indexOf(t)>-1}function Qo(e,t){return e.push.apply(e,Co(t)),e}function Mn(e,t,n){e&&yn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Tn(e,t){Mn(e,qn(t)?t.split(" "):t,!0)}function To(e,t){yn(t,e.appendChild.bind(e))}function Ra(e,t){yn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function uo(e,t){return Tl(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Ll(e,t){var n=e?Zn(e.children):[];return t?n.filter(function(i){return uo(i,t)}):n}function Lo(e,t){return t?Ll(e,t)[0]:e.firstElementChild}var po=Object.keys;function pi(e,t,n){return e&&(n?po(e).reverse():po(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function mo(e){return Zn(arguments,1).forEach(function(t){pi(t,function(n,i){e[i]=t[i]})}),e}function zn(e){return Zn(arguments,1).forEach(function(t){pi(t,function(n,i){Ta(n)?e[i]=n.slice():co(n)?e[i]=zn({},co(e[i])?e[i]:{},n):e[i]=n})}),e}function ss(e,t){yn(t||po(e),function(n){delete e[n]})}function Ln(e,t){yn(e,function(n){yn(t,function(i){n&&n.removeAttribute(i)})})}function yt(e,t,n){co(t)?pi(t,function(i,o){yt(e,o,i)}):yn(e,function(i){La(n)||n===""?Ln(i,t):i.setAttribute(t,String(n))})}function Ii(e,t,n){var i=document.createElement(e);return t&&(qn(t)?Tn(i,t):yt(i,t)),n&&To(n,i),i}function vn(e,t,n){if($o(n))return getComputedStyle(e)[t];La(n)||(e.style[t]=""+n)}function go(e,t){vn(e,"display",t)}function Il(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function xn(e,t){return e.getAttribute(t)}function ls(e,t){return e&&e.classList.contains(t)}function mn(e){return e.getBoundingClientRect()}function mi(e){yn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Rl(e){return Lo(new DOMParser().parseFromString(e,"text/html").body)}function En(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function El(e,t){return e&&e.querySelector(t)}function Ea(e,t){return t?Zn(e.querySelectorAll(t)):[]}function kn(e,t){Mn(e,t,!1)}function ua(e){return e.timeStamp}function ii(e){return qn(e)?e:e?e+"px":""}var Io="splide",Ma="data-"+Io;function oo(e,t){if(!e)throw new Error("["+Io+"] "+(t||""))}var Un=Math.min,ar=Math.max,sr=Math.floor,ho=Math.ceil,sn=Math.abs;function Ml(e,t,n){return sn(e-t)<n}function er(e,t,n,i){var o=Un(t,n),s=ar(t,n);return i?o<e&&e<s:o<=e&&e<=s}function $i(e,t,n){var i=Un(t,n),o=ar(t,n);return Un(ar(i,e),o)}function pa(e){return+(e>0)-+(e<0)}function ma(e,t){return yn(t,function(n){e=e.replace("%s",""+n)}),e}function ka(e){return e<10?"0"+e:""+e}var cs={};function Pd(e){return""+e+ka(cs[e]=(cs[e]||0)+1)}function kl(){var e=[];function t(l,d,c,u){o(l,d,function(p,b,S){var T="addEventListener"in p,g=T?p.removeEventListener.bind(p,b,c,u):p.removeListener.bind(p,c);T?p.addEventListener(b,c,u):p.addListener(c),e.push([p,b,S,c,g])})}function n(l,d,c){o(l,d,function(u,p,b){e=e.filter(function(S){return S[0]===u&&S[1]===p&&S[2]===b&&(!c||S[3]===c)?(S[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 S=b.split(".");c(u,S[0],S[1])})})})}function s(){e.forEach(function(l){l[4]()}),Wn(e)}return{bind:t,unbind:n,dispatch:i,destroy:s}}var Jn="mounted",ga="ready",_n="move",qi="moved",Pa="click",Pl="active",Al="inactive",Fl="visible",Wl="hidden",Qt="refresh",rn="updated",Ai="resize",fr="resized",_l="drag",Nl="dragging",Hl="dragged",yr="scroll",fi="scrolled",Ad="overflow",Aa="destroy",Ol="arrows:mounted",jl="arrows:updated",Dl="pagination:mounted",zl="pagination:updated",Fa="navigation:mounted",Wa="autoplay:play",Bl="autoplay:playing",_a="autoplay:pause",Na="lazyload:loaded",Vl="sk",Gl="sh",lr="ei";function Bt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=kl();function i(s,l){n.bind(t,Co(s).join(" "),function(d){l.apply(l,Ta(d.detail)?d.detail:[])})}function o(s){n.dispatch(t,s,Zn(arguments,1))}return e&&e.event.on(Aa,n.destroy),mo(n,{bus:t,on:i,off:Nt(n.unbind,t),emit:o})}function vr(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 S();d=as(p)}}function b(I){I||g(),s=o()-(I?l*e:0),c=!1,d=as(p)}function S(){c=!0}function T(){s=o(),l=0,n&&n(l)}function g(){d&&cancelAnimationFrame(d),l=0,d=0,c=!0}function $(I){e=I}function h(){return c}return{start:b,rewind:T,pause:S,cancel:g,set:$,isPaused:h}}function Fd(e){var t=e;function n(o){t=o}function i(o){return Ia(Co(o),t)}return{set:n,is:i}}function Wd(e,t){var n=vr(0,e,null,1);return function(){n.isPaused()&&n.start()}}function _d(e,t,n){var i=e.state,o=n.breakpoints||{},s=n.reducedMotion||{},l=kl(),d=[];function c(){var g=n.mediaQuery==="min";po(o).sort(function($,h){return g?+$-+h:+h-+$}).forEach(function($){p(o[$],"("+(g?"min":"max")+"-width:"+$+"px)")}),p(s,rs),b()}function u(g){g&&l.destroy()}function p(g,$){var h=matchMedia($);l.bind(h,"change",b),d.push([g,h])}function b(){var g=i.is(rr),$=n.direction,h=d.reduce(function(I,R){return zn(I,R[1].matches?R[0]:{})},{});ss(n),T(h),n.destroy?e.destroy(n.destroy==="completely"):g?(u(!0),e.mount()):$!==n.direction&&e.refresh()}function S(g){matchMedia(rs).matches&&(g?zn(n,s):ss(n,po(s)))}function T(g,$,h){zn(n,g),$&&zn(Object.getPrototypeOf(n),g),(h||!i.is(Li))&&e.emit(rn,n)}return{setup:c,destroy:u,reduce:S,set:T}}var xr="Arrow",br=xr+"Left",wr=xr+"Right",ql=xr+"Up",Ul=xr+"Down",ds="rtl",Sr="ttb",_r={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[ql,wr],ArrowRight:[Ul,br]};function Nd(e,t,n){function i(s,l,d){d=d||n.direction;var c=d===ds&&!l?1:d===Sr?0:-1;return _r[s]&&_r[s][c]||s.replace(/width|left|right/i,function(u,p){var b=_r[u.toLowerCase()][c]||u;return p>0?b.charAt(0).toUpperCase()+b.slice(1):b})}function o(s){return s*(n.direction===ds?1:-1)}return{resolve:i,orient:o}}var Pn="role",Ri="tabindex",Hd="disabled",bn="aria-",Ro=bn+"controls",Kl=bn+"current",us=bn+"selected",hn=bn+"label",Ha=bn+"labelledby",Xl=bn+"hidden",Oa=bn+"orientation",fo=bn+"roledescription",ps=bn+"live",ms=bn+"busy",gs=bn+"atomic",ja=[Pn,Ri,Hd,Ro,Kl,hn,Ha,Xl,Oa,fo],In=Io+"__",Qn="is-",Nr=Io,hs=In+"track",Od=In+"list",$r=In+"slide",Yl=$r+"--clone",jd=$r+"__container",Da=In+"arrows",Cr=In+"arrow",Zl=Cr+"--prev",Jl=Cr+"--next",Tr=In+"pagination",Ql=Tr+"__page",Dd=In+"progress",zd=Dd+"__bar",Bd=In+"toggle",Vd=In+"spinner",Gd=In+"sr",qd=Qn+"initialized",gi=Qn+"active",ec=Qn+"prev",tc=Qn+"next",ha=Qn+"visible",fa=Qn+"loading",nc=Qn+"focus-in",ic=Qn+"overflow",Ud=[gi,ha,ec,tc,fa,nc,ic],Kd={slide:$r,clone:Yl,arrows:Da,arrow:Cr,prev:Zl,next:Jl,pagination:Tr,page:Ql,spinner:Vd};function Xd(e,t){if(Cl(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!uo(n,t);)n=n.parentElement;return n}var Yd=5,fs=200,oc="touchstart mousedown",Hr="touchmove mousemove",Or="touchend touchcancel mouseup click";function Zd(e,t,n){var i=Bt(e),o=i.on,s=i.bind,l=e.root,d=n.i18n,c={},u=[],p=[],b=[],S,T,g;function $(){E(),Z(),R()}function h(){o(Qt,I),o(Qt,$),o(rn,R),s(document,oc+" keydown",function(M){g=M.type==="keydown"},{capture:!0}),s(l,"focusin",function(){Mn(l,nc,!!g)})}function I(M){var C=ja.concat("style");Wn(u),kn(l,p),kn(S,b),Ln([S,T],C),Ln(l,M?C:["style",fo])}function R(){kn(l,p),kn(S,b),p=B(Nr),b=B(hs),Tn(l,p),Tn(S,b),yt(l,hn,n.label),yt(l,Ha,n.labelledby)}function E(){S=P("."+hs),T=Lo(S,"."+Od),oo(S&&T,"A track/list element is missing."),Qo(u,Ll(T,"."+$r+":not(."+Yl+")")),pi({arrows:Da,pagination:Tr,prev:Zl,next:Jl,bar:zd,toggle:Bd},function(M,C){c[C]=P("."+M)}),mo(c,{root:l,track:S,list:T,slides:u})}function Z(){var M=l.id||Pd(Io),C=n.role;l.id=M,S.id=S.id||M+"-track",T.id=T.id||M+"-list",!xn(l,Pn)&&l.tagName!=="SECTION"&&C&&yt(l,Pn,C),yt(l,fo,d.carousel),yt(T,Pn,"presentation")}function P(M){var C=El(l,M);return C&&Xd(C,"."+Nr)===l?C:void 0}function B(M){return[M+"--"+n.type,M+"--"+n.direction,n.drag&&M+"--draggable",n.isNavigation&&M+"--nav",M===Nr&&gi]}return mo(c,{setup:$,mount:h,destroy:I})}var Fi="slide",Ui="loop",Eo="fade";function Jd(e,t,n,i){var o=Bt(e),s=o.on,l=o.emit,d=o.bind,c=e.Components,u=e.root,p=e.options,b=p.isNavigation,S=p.updateOnMove,T=p.i18n,g=p.pagination,$=p.slideFocus,h=c.Direction.resolve,I=xn(i,"style"),R=xn(i,hn),E=n>-1,Z=Lo(i,"."+jd),P;function B(){E||(i.id=u.id+"-slide"+ka(t+1),yt(i,Pn,g?"tabpanel":"group"),yt(i,fo,T.slide),yt(i,hn,R||ma(T.slideLabel,[t+1,e.length]))),M()}function M(){d(i,"click",Nt(l,Pa,D)),d(i,"keydown",Nt(l,Vl,D)),s([qi,Gl,fi],x),s(Fa,W),S&&s(_n,y)}function C(){P=!0,o.destroy(),kn(i,Ud),Ln(i,ja),yt(i,"style",I),yt(i,hn,R||"")}function W(){var O=e.splides.map(function(L){var U=L.splide.Components.Slides.getAt(t);return U?U.slide.id:""}).join(" ");yt(i,hn,ma(T.slideX,(E?n:t)+1)),yt(i,Ro,O),yt(i,Pn,$?"button":""),$&&Ln(i,fo)}function y(){P||x()}function x(){if(!P){var O=e.index;A(),H(),Mn(i,ec,t===O-1),Mn(i,tc,t===O+1)}}function A(){var O=G();O!==ls(i,gi)&&(Mn(i,gi,O),yt(i,Kl,b&&O||""),l(O?Pl:Al,D))}function H(){var O=Y(),L=!O&&(!G()||E);if(e.state.is([Gi,So])||yt(i,Xl,L||""),yt(Ea(i,p.focusableNodes||""),Ri,L?-1:""),$&&yt(i,Ri,L?-1:0),O!==ls(i,ha)&&(Mn(i,ha,O),l(O?Fl:Wl,D)),!O&&document.activeElement===i){var U=c.Slides.getAt(e.index);U&&Il(U.slide)}}function K(O,L,U){vn(U&&Z||i,O,L)}function G(){var O=e.index;return O===t||p.cloneStatus&&O===n}function Y(){if(e.is(Eo))return G();var O=mn(c.Elements.track),L=mn(i),U=h("left",!0),J=h("right",!0);return sr(O[U])<=ho(L[U])&&sr(L[J])<=ho(O[J])}function V(O,L){var U=sn(O-t);return!E&&(p.rewind||e.is(Ui))&&(U=Un(U,e.length-U)),U<=L}var D={index:t,slideIndex:n,slide:i,container:Z,isClone:E,mount:B,destroy:C,update:x,style:K,isWithin:V};return D}function Qd(e,t,n){var i=Bt(e),o=i.on,s=i.emit,l=i.bind,d=t.Elements,c=d.slides,u=d.list,p=[];function b(){S(),o(Qt,T),o(Qt,S)}function S(){c.forEach(function(x,A){$(x,A,-1)})}function T(){P(function(x){x.destroy()}),Wn(p)}function g(){P(function(x){x.update()})}function $(x,A,H){var K=Jd(e,A,H,x);K.mount(),p.push(K),p.sort(function(G,Y){return G.index-Y.index})}function h(x){return x?B(function(A){return!A.isClone}):p}function I(x){var A=t.Controller,H=A.toIndex(x),K=A.hasFocus()?1:n.perPage;return B(function(G){return er(G.index,H,H+K-1)})}function R(x){return B(x)[0]}function E(x,A){yn(x,function(H){if(qn(H)&&(H=Rl(H)),Tl(H)){var K=c[A];K?Ra(H,K):To(u,H),Tn(H,n.classes.slide),C(H,Nt(s,Ai))}}),s(Qt)}function Z(x){mi(B(x).map(function(A){return A.slide})),s(Qt)}function P(x,A){h(A).forEach(x)}function B(x){return p.filter(Cl(x)?x:function(A){return qn(x)?uo(A.slide,x):Ia(Co(x),A.index)})}function M(x,A,H){P(function(K){K.style(x,A,H)})}function C(x,A){var H=Ea(x,"img"),K=H.length;K?H.forEach(function(G){l(G,"load error",function(){--K||A()})}):A()}function W(x){return x?c.length:p.length}function y(){return p.length>n.perPage}return{mount:b,destroy:T,update:g,register:$,get:h,getIn:I,getAt:R,add:E,remove:Z,forEach:P,filter:B,style:M,getLength:W,isEnough:y}}function eu(e,t,n){var i=Bt(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,S=u.list,T=d.getAt,g=d.style,$,h,I;function R(){E(),s(window,"resize load",Wd(Nt(l,Ai))),o([rn,Qt],E),o(Ai,Z)}function E(){$=n.direction===Sr,vn(p,"maxWidth",ii(n.width)),vn(b,c("paddingLeft"),P(!1)),vn(b,c("paddingRight"),P(!0)),Z(!0)}function Z(D){var O=mn(p);(D||h.width!==O.width||h.height!==O.height)&&(vn(b,"height",B()),g(c("marginRight"),ii(n.gap)),g("width",C()),g("height",W(),!0),h=O,l(fr),I!==(I=V())&&(Mn(p,ic,I),l(Ad,I)))}function P(D){var O=n.padding,L=c(D?"right":"left");return O&&ii(O[L]||(co(O)?0:O))||"0px"}function B(){var D="";return $&&(D=M(),oo(D,"height or heightRatio is missing."),D="calc("+D+" - "+P(!1)+" - "+P(!0)+")"),D}function M(){return ii(n.height||mn(S).width*n.heightRatio)}function C(){return n.autoWidth?null:ii(n.fixedWidth)||($?"":y())}function W(){return ii(n.fixedHeight)||($?n.autoHeight?null:y():M())}function y(){var D=ii(n.gap);return"calc((100%"+(D&&" + "+D)+")/"+(n.perPage||1)+(D&&" - "+D)+")"}function x(){return mn(S)[c("width")]}function A(D,O){var L=T(D||0);return L?mn(L.slide)[c("width")]+(O?0:G()):0}function H(D,O){var L=T(D);if(L){var U=mn(L.slide)[c("right")],J=mn(S)[c("left")];return sn(U-J)+(O?0:G())}return 0}function K(D){return H(e.length-1)-H(0)+A(0,D)}function G(){var D=T(0);return D&&parseFloat(vn(D.slide,c("marginRight")))||0}function Y(D){return parseFloat(vn(b,c("padding"+(D?"Right":"Left"))))||0}function V(){return e.is(Eo)||K(!0)>x()}return{mount:R,resize:Z,listSize:x,slideSize:A,sliderSize:K,totalSize:H,getPadding:Y,isOverflow:V}}var tu=2;function nu(e,t,n){var i=Bt(e),o=i.on,s=t.Elements,l=t.Slides,d=t.Direction.resolve,c=[],u;function p(){o(Qt,b),o([rn,Ai],T),(u=h())&&(g(u),t.Layout.resize(!0))}function b(){S(),p()}function S(){mi(c),Wn(c),i.destroy()}function T(){var I=h();u!==I&&(u<I||!I)&&i.emit(Qt)}function g(I){var R=l.get().slice(),E=R.length;if(E){for(;R.length<I;)Qo(R,R);Qo(R.slice(-I),R.slice(0,I)).forEach(function(Z,P){var B=P<I,M=$(Z.slide,P);B?Ra(M,R[0].slide):To(s.list,M),Qo(c,M),l.register(M,P-I+(B?0:E),Z.index)})}}function $(I,R){var E=I.cloneNode(!0);return Tn(E,n.classes.clone),E.id=e.root.id+"-clone"+ka(R+1),E}function h(){var I=n.clones;if(!e.is(Ui))I=0;else if($o(I)){var R=n[d("fixedWidth")]&&t.Layout.slideSize(0),E=R&&ho(mn(s.track)[d("width")]/R);I=E||n[d("autoWidth")]&&e.length||n.perPage*tu}return I}return{mount:p,destroy:S}}function iu(e,t,n){var i=Bt(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,S=d.sliderSize,T=t.Direction,g=T.resolve,$=T.orient,h=t.Elements,I=h.list,R=h.track,E;function Z(){E=t.Transition,o([Jn,fr,rn,Qt],P)}function P(){t.Controller.isBusy()||(t.Scroll.cancel(),M(e.index),t.Slides.update())}function B(L,U,J,ce){L!==U&&D(L>J)&&(x(),C(y(K(),L>J),!0)),l(Gi),s(_n,U,J,L),E.start(U,function(){l(Pi),s(qi,U,J,L),ce&&ce()})}function M(L){C(H(L,!0))}function C(L,U){if(!e.is(Eo)){var J=U?L:W(L);vn(I,"transform","translate"+g("X")+"("+J+"px)"),L!==J&&s(Gl)}}function W(L){if(e.is(Ui)){var U=A(L),J=U>t.Controller.getEnd(),ce=U<0;(ce||J)&&(L=y(L,J))}return L}function y(L,U){var J=L-V(U),ce=S();return L-=$(ce*(ho(sn(J)/ce)||1))*(U?1:-1),L}function x(){C(K(),!0),E.cancel()}function A(L){for(var U=t.Slides.get(),J=0,ce=1/0,_=0;_<U.length;_++){var de=U[_].index,w=sn(H(de,!0)-L);if(w<=ce)ce=w,J=de;else break}return J}function H(L,U){var J=$(p(L-1)-Y(L));return U?G(J):J}function K(){var L=g("left");return mn(I)[L]-mn(R)[L]+$(u(!1))}function G(L){return n.trimSpace&&e.is(Fi)&&(L=$i(L,0,$(S(!0)-b()))),L}function Y(L){var U=n.focus;return U==="center"?(b()-c(L,!0))/2:+U*c(L)||0}function V(L){return H(L?t.Controller.getEnd():0,!!n.trimSpace)}function D(L){var U=$(y(K(),L));return L?U>=0:U<=I[g("scrollWidth")]-mn(R)[g("width")]}function O(L,U){U=$o(U)?K():U;var J=L!==!0&&$(U)<$(V(!1)),ce=L!==!1&&$(U)>$(V(!0));return J||ce}return{mount:Z,move:B,jump:M,translate:C,shift:y,cancel:x,toIndex:A,toPosition:H,getPosition:K,getLimit:V,exceededLimit:O,reposition:P}}function ou(e,t,n){var i=Bt(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,S=p.getLength,T=n.omitEnd,g=e.is(Ui),$=e.is(Fi),h=Nt(K,!1),I=Nt(K,!0),R=n.start||0,E,Z=R,P,B,M;function C(){W(),o([rn,Qt,lr],W),o(fr,y)}function W(){P=S(!0),B=n.perMove,M=n.perPage,E=D();var w=$i(R,0,T?E:P-1);w!==R&&(R=w,l.reposition())}function y(){E!==D()&&s(lr)}function x(w,ge,Q){if(!de()){var ve=H(w),Le=V(ve);Le>-1&&(ge||Le!==R)&&(J(Le),l.move(ve,Le,Z,Q))}}function A(w,ge,Q,ve){t.Scroll.scroll(w,ge,Q,function(){var Le=V(l.toIndex(d()));J(T?Un(Le,E):Le),ve&&ve()})}function H(w){var ge=R;if(qn(w)){var Q=w.match(/([+\-<>])(\d+)?/)||[],ve=Q[1],Le=Q[2];ve==="+"||ve==="-"?ge=G(R+ +(""+ve+(+Le||1)),R):ve===">"?ge=Le?O(+Le):h(!0):ve==="<"&&(ge=I(!0))}else ge=g?w:$i(w,0,E);return ge}function K(w,ge){var Q=B||(_()?1:M),ve=G(R+Q*(w?-1:1),R,!(B||_()));return ve===-1&&$&&!Ml(d(),c(!w),1)?w?0:E:ge?ve:V(ve)}function G(w,ge,Q){if(b()||_()){var ve=Y(w);ve!==w&&(ge=w,w=ve,Q=!1),w<0||w>E?!B&&(er(0,w,ge,!0)||er(E,ge,w,!0))?w=O(L(w)):g?w=Q?w<0?-(P%M||M):P:w:n.rewind?w=w<0?E:0:w=-1:Q&&w!==ge&&(w=O(L(ge)+(w<ge?-1:1)))}else w=-1;return w}function Y(w){if($&&n.trimSpace==="move"&&w!==R)for(var ge=d();ge===u(w,!0)&&er(w,0,e.length-1,!n.rewind);)w<R?--w:++w;return w}function V(w){return g?(w+P)%P||0:w}function D(){for(var w=P-(_()||g&&B?1:M);T&&w-- >0;)if(u(P-1,!0)!==u(w,!0)){w++;break}return $i(w,0,P-1)}function O(w){return $i(_()?w:M*w,0,E)}function L(w){return _()?Un(w,E):sr((w>=E?P-1:w)/M)}function U(w){var ge=l.toIndex(w);return $?$i(ge,0,E):ge}function J(w){w!==R&&(Z=R,R=w)}function ce(w){return w?Z:R}function _(){return!$o(n.focus)||n.isNavigation}function de(){return e.state.is([Gi,So])&&!!n.waitForTransition}return{mount:C,go:x,scroll:A,getNext:h,getPrev:I,getAdjacent:K,getEnd:D,setIndex:J,getIndex:ce,toIndex:O,toPage:L,toDest:U,hasFocus:_,isBusy:de}}var ru="http://www.w3.org/2000/svg",au="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",Wo=40;function su(e,t,n){var i=Bt(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,S=u.track,T=b,g=u.prev,$=u.next,h,I,R={};function E(){P(),o(rn,Z)}function Z(){B(),E()}function P(){var A=n.arrows;A&&!(g&&$)&&W(),g&&$&&(mo(R,{prev:g,next:$}),go(T,A?"":"none"),Tn(T,I=Da+"--"+n.direction),A&&(M(),x(),yt([g,$],Ro,S.id),l(Ol,g,$)))}function B(){i.destroy(),kn(T,I),h?(mi(b?[g,$]:T),g=$=null):Ln([g,$],ja)}function M(){o([Jn,qi,Qt,fi,lr],x),s($,"click",Nt(C,">")),s(g,"click",Nt(C,"<"))}function C(A){p.go(A,!0)}function W(){T=b||Ii("div",d.arrows),g=y(!0),$=y(!1),h=!0,To(T,[g,$]),!b&&Ra(T,S)}function y(A){var H='<button class="'+d.arrow+" "+(A?d.prev:d.next)+'" type="button"><svg xmlns="'+ru+'" viewBox="0 0 '+Wo+" "+Wo+'" width="'+Wo+'" height="'+Wo+'" focusable="false"><path d="'+(n.arrowPath||au)+'" />';return Rl(H)}function x(){if(g&&$){var A=e.index,H=p.getPrev(),K=p.getNext(),G=H>-1&&A<H?c.last:c.prev,Y=K>-1&&A>K?c.first:c.next;g.disabled=H<0,$.disabled=K<0,yt(g,hn,G),yt($,hn,Y),l(jl,g,$,H,K)}}return{arrows:R,mount:E,destroy:B,update:x}}var lu=Ma+"-interval";function cu(e,t,n){var i=Bt(e),o=i.on,s=i.bind,l=i.emit,d=vr(n.interval,e.go.bind(e,">"),M),c=d.isPaused,u=t.Elements,p=t.Elements,b=p.root,S=p.toggle,T=n.autoplay,g,$,h=T==="pause";function I(){T&&(R(),S&&yt(S,Ro,u.track.id),h||E(),B())}function R(){n.pauseOnHover&&s(b,"mouseenter mouseleave",function(W){g=W.type==="mouseenter",P()}),n.pauseOnFocus&&s(b,"focusin focusout",function(W){$=W.type==="focusin",P()}),S&&s(S,"click",function(){h?E():Z(!0)}),o([_n,yr,Qt],d.rewind),o(_n,C)}function E(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),$=g=h=!1,B(),l(Wa))}function Z(W){W===void 0&&(W=!0),h=!!W,B(),c()||(d.pause(),l(_a))}function P(){h||(g||$?Z(!1):E())}function B(){S&&(Mn(S,gi,!h),yt(S,hn,n.i18n[h?"play":"pause"]))}function M(W){var y=u.bar;y&&vn(y,"width",W*100+"%"),l(Bl,W)}function C(W){var y=t.Slides.getAt(W);d.set(y&&+xn(y.slide,lu)||n.interval)}return{mount:I,destroy:d.cancel,play:E,pause:Z,isPaused:c}}function du(e,t,n){var i=Bt(e),o=i.on;function s(){n.cover&&(o(Na,Nt(d,!0)),o([Jn,rn,Qt],Nt(l,!0)))}function l(c){t.Slides.forEach(function(u){var p=Lo(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),go(u,c?"none":"")}return{mount:s,destroy:Nt(l,!1)}}var uu=10,pu=600,mu=.6,gu=1.5,hu=800;function fu(e,t,n){var i=Bt(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,S=e.is(Fi),T,g,$=1;function h(){o(_n,Z),o([rn,Qt],P)}function I(M,C,W,y,x){var A=c();if(Z(),W&&(!S||!p())){var H=t.Layout.sliderSize(),K=pa(M)*H*sr(sn(M)/H)||0;M=d.toPosition(t.Controller.toDest(M%H))+K}var G=Ml(A,M,1);$=1,C=G?0:C||ar(sn(M-A)/gu,hu),g=y,T=vr(C,R,Nt(E,A,M,x),1),l(So),s(yr),T.start()}function R(){l(Pi),g&&g(),s(fi)}function E(M,C,W,y){var x=c(),A=M+(C-M)*B(y),H=(A-x)*$;b(x+H),S&&!W&&p()&&($*=mu,sn(H)<uu&&I(u(p(!0)),pu,!1,g,!0))}function Z(){T&&T.cancel()}function P(){T&&!T.isPaused()&&(Z(),R())}function B(M){var C=n.easingFunc;return C?C(M):1-Math.pow(1-M,4)}return{mount:h,destroy:Z,scroll:I,cancel:P}}var Ci={passive:!1,capture:!0};function yu(e,t,n){var i=Bt(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,S=t.Elements.track,T=t.Media.reduce,g=t.Direction,$=g.resolve,h=g.orient,I=u.getPosition,R=u.exceededLimit,E,Z,P,B,M,C=!1,W,y,x;function A(){l(S,Hr,da,Ci),l(S,Or,da,Ci),l(S,oc,K,Ci),l(S,"click",V,{capture:!0}),l(S,"dragstart",En),o([Jn,rn],H)}function H(){var q=n.drag;ae(!q),B=q==="free"}function K(q){if(W=!1,!y){var se=Le(q);ve(q.target)&&(se||!q.button)&&(b.isBusy()?En(q,!0):(x=se?S:window,M=c.is([Gi,So]),P=null,l(x,Hr,G,Ci),l(x,Or,Y,Ci),u.cancel(),p.cancel(),D(q)))}}function G(q){if(c.is(Jo)||(c.set(Jo),s(_l)),q.cancelable)if(M){u.translate(E+Q(_(q)));var se=de(q)>fs,he=C!==(C=R());(se||he)&&D(q),W=!0,s(Nl),En(q)}else U(q)&&(M=L(q),En(q))}function Y(q){c.is(Jo)&&(c.set(Pi),s(Hl)),M&&(O(q),En(q)),d(x,Hr,G),d(x,Or,Y),M=!1}function V(q){!y&&W&&En(q,!0)}function D(q){P=Z,Z=q,E=I()}function O(q){var se=J(q),he=ce(se),Pe=n.rewind&&n.rewindByDrag;T(!1),B?b.scroll(he,0,n.snap):e.is(Eo)?b.go(h(pa(se))<0?Pe?"<":"-":Pe?">":"+"):e.is(Fi)&&C&&Pe?b.go(R(!0)?">":"<"):b.go(b.toDest(he),!0),T(!0)}function L(q){var se=n.dragMinThreshold,he=co(se),Pe=he&&se.mouse||0,Ce=(he?se.touch:+se)||10;return sn(_(q))>(Le(q)?Ce:Pe)}function U(q){return sn(_(q))>sn(_(q,!0))}function J(q){if(e.is(Ui)||!C){var se=de(q);if(se&&se<fs)return _(q)/se}return 0}function ce(q){return I()+pa(q)*Un(sn(q)*(n.flickPower||600),B?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function _(q,se){return ge(q,se)-ge(w(q),se)}function de(q){return ua(q)-ua(w(q))}function w(q){return Z===q&&P||Z}function ge(q,se){return(Le(q)?q.changedTouches[0]:q)["page"+$(se?"Y":"X")]}function Q(q){return q/(C&&e.is(Fi)?Yd:1)}function ve(q){var se=n.noDrag;return!uo(q,"."+Ql+", ."+Cr)&&(!se||!uo(q,se))}function Le(q){return typeof TouchEvent<"u"&&q instanceof TouchEvent}function pe(){return M}function ae(q){y=q}return{mount:A,disable:ae,isDragging:pe}}var vu={Spacebar:" ",Right:wr,Left:br,Up:ql,Down:Ul};function za(e){return e=qn(e)?e:e.key,vu[e]||e}var ys="keydown";function xu(e,t,n){var i=Bt(e),o=i.on,s=i.bind,l=i.unbind,d=e.root,c=t.Direction.resolve,u,p;function b(){S(),o(rn,T),o(rn,S),o(_n,$)}function S(){var I=n.keyboard;I&&(u=I==="global"?window:d,s(u,ys,h))}function T(){l(u,ys)}function g(I){p=I}function $(){var I=p;p=!0,$l(function(){p=I})}function h(I){if(!p){var R=za(I);R===c(br)?e.go("<"):R===c(wr)&&e.go(">")}}return{mount:b,destroy:T,disable:g}}var ro=Ma+"-lazy",tr=ro+"-srcset",bu="["+ro+"], ["+tr+"]";function wu(e,t,n){var i=Bt(e),o=i.on,s=i.off,l=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[qi,fi],p=[];function b(){n.lazyLoad&&(S(),o(Qt,S))}function S(){Wn(p),T(),c?I():(s(u),o(u,g),g())}function T(){t.Slides.forEach(function(R){Ea(R.slide,bu).forEach(function(E){var Z=xn(E,ro),P=xn(E,tr);if(Z!==E.src||P!==E.srcset){var B=n.classes.spinner,M=E.parentElement,C=Lo(M,"."+B)||Ii("span",B,M);p.push([E,R,C]),E.src||go(E,"none")}})})}function g(){p=p.filter(function(R){var E=n.perPage*((n.preloadPages||1)+1)-1;return R[1].isWithin(e.index,E)?$(R):!0}),p.length||s(u)}function $(R){var E=R[0];Tn(R[1].slide,fa),l(E,"load error",Nt(h,R)),yt(E,"src",xn(E,ro)),yt(E,"srcset",xn(E,tr)),Ln(E,ro),Ln(E,tr)}function h(R,E){var Z=R[0],P=R[1];kn(P.slide,fa),E.type!=="error"&&(mi(R[2]),go(Z,""),d(Na,Z,P),d(Ai)),c&&I()}function I(){p.length&&$(p.shift())}return{mount:b,destroy:Nt(Wn,p),check:g}}function Su(e,t,n){var i=Bt(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,S=u.go,T=t.Direction.resolve,g=c.pagination,$=[],h,I;function R(){E(),o([rn,Qt,lr],R);var y=n.pagination;g&&go(g,y?"":"none"),y&&(o([_n,yr,fi],W),Z(),W(),s(Dl,{list:h,items:$},C(e.index)))}function E(){h&&(mi(g?Zn(h.children):h),kn(h,I),Wn($),h=null),i.destroy()}function Z(){var y=e.length,x=n.classes,A=n.i18n,H=n.perPage,K=p()?u.getEnd()+1:ho(y/H);h=g||Ii("ul",x.pagination,c.track.parentElement),Tn(h,I=Tr+"--"+M()),yt(h,Pn,"tablist"),yt(h,hn,A.select),yt(h,Oa,M()===Sr?"vertical":"");for(var G=0;G<K;G++){var Y=Ii("li",null,h),V=Ii("button",{class:x.page,type:"button"},Y),D=d.getIn(G).map(function(L){return L.slide.id}),O=!p()&&H>1?A.pageX:A.slideX;l(V,"click",Nt(P,G)),n.paginationKeyboard&&l(V,"keydown",Nt(B,G)),yt(Y,Pn,"presentation"),yt(V,Pn,"tab"),yt(V,Ro,D.join(" ")),yt(V,hn,ma(O,G+1)),yt(V,Ri,-1),$.push({li:Y,button:V,page:G})}}function P(y){S(">"+y,!0)}function B(y,x){var A=$.length,H=za(x),K=M(),G=-1;H===T(wr,!1,K)?G=++y%A:H===T(br,!1,K)?G=(--y+A)%A:H==="Home"?G=0:H==="End"&&(G=A-1);var Y=$[G];Y&&(Il(Y.button),S(">"+G),En(x,!0))}function M(){return n.paginationDirection||n.direction}function C(y){return $[u.toPage(y)]}function W(){var y=C(b(!0)),x=C(b());if(y){var A=y.button;kn(A,gi),Ln(A,us),yt(A,Ri,-1)}if(x){var H=x.button;Tn(H,gi),yt(H,us,!0),yt(H,Ri,"")}s(zl,{list:h,items:$},y,x)}return{items:$,mount:R,destroy:E,getAt:C,update:W}}var $u=[" ","Enter"];function Cu(e,t,n){var i=n.isNavigation,o=n.slideFocus,s=[];function l(){e.splides.forEach(function(g){g.isParent||(u(e,g.splide),u(g.splide,e))}),i&&p()}function d(){s.forEach(function(g){g.destroy()}),Wn(s)}function c(){d(),l()}function u(g,$){var h=Bt(g);h.on(_n,function(I,R,E){$.go($.is(Ui)?E:I)}),s.push(h)}function p(){var g=Bt(e),$=g.on;$(Pa,S),$(Vl,T),$([Jn,rn],b),s.push(g),g.emit(Fa,e.splides)}function b(){yt(t.Elements.list,Oa,n.direction===Sr?"vertical":"")}function S(g){e.go(g.index)}function T(g,$){Ia($u,za($))&&(S(g),En($))}return{setup:Nt(t.Media.set,{slideFocus:$o(o)?i:o},!0),mount:l,destroy:d,remount:c}}function Tu(e,t,n){var i=Bt(e),o=i.bind,s=0;function l(){n.wheel&&o(t.Elements.track,"wheel",d,Ci)}function d(u){if(u.cancelable){var p=u.deltaY,b=p<0,S=ua(u),T=n.wheelMinThreshold||0,g=n.wheelSleep||0;sn(p)>T&&S-s>g&&(e.go(b?"<":">"),s=S),c(b)&&En(u)}}function c(u){return!n.releaseWheel||e.state.is(Gi)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var Lu=90;function Iu(e,t,n){var i=Bt(e),o=i.on,s=t.Elements.track,l=n.live&&!n.isNavigation,d=Ii("span",Gd),c=vr(Lu,Nt(p,!1));function u(){l&&(S(!t.Autoplay.isPaused()),yt(s,gs,!0),d.textContent="…",o(Wa,Nt(S,!0)),o(_a,Nt(S,!1)),o([qi,fi],Nt(p,!0)))}function p(T){yt(s,ms,T),T?(To(s,d),c.start()):(mi(d),c.cancel())}function b(){Ln(s,[ps,gs,ms]),mi(d)}function S(T){l&&yt(s,ps,T?"off":"polite")}return{mount:u,disable:S,destroy:b}}var Ru=Object.freeze({__proto__:null,Media:_d,Direction:Nd,Elements:Zd,Slides:Qd,Layout:eu,Clones:nu,Move:iu,Controller:ou,Arrows:su,Autoplay:cu,Cover:du,Scroll:fu,Drag:yu,Keyboard:xu,LazyLoad:wu,Pagination:Su,Sync:Cu,Wheel:Tu,Live:Iu}),Eu={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"},Mu={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:Kd,i18n:Eu,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function ku(e,t,n){var i=t.Slides;function o(){Bt(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),$l(c)}return{mount:o,start:l,cancel:da}}function Pu(e,t,n){var i=t.Move,o=t.Controller,s=t.Scroll,l=t.Elements.list,d=Nt(vn,l,"transition"),c;function u(){Bt(e).bind(l,"transitionend",function(T){T.target===l&&c&&(b(),c())})}function p(T,g){var $=i.toPosition(T,!0),h=i.getPosition(),I=S(T);sn($-h)>=1&&I>=1?n.useScroll?s.scroll($,I,!1,g):(d("transform "+I+"ms "+n.easing),i.translate($,!0),c=g):(i.jump(T),g())}function b(){d(""),s.cancel()}function S(T){var g=n.rewindSpeed;if(e.is(Fi)&&g){var $=o.getIndex(!0),h=o.getEnd();if($===0&&T>=h||$>=h&&T===0)return g}return n.speed}return{mount:u,start:p,cancel:b}}var Au=(function(){function e(n,i){this.event=Bt(),this.Components={},this.state=Fd(Li),this.splides=[],this._o={},this._E={};var o=qn(n)?El(document,n):n;oo(o,o+" is invalid."),this.root=o,i=zn({label:xn(o,hn)||"",labelledby:xn(o,Ha)||""},Mu,e.defaults,i||{});try{zn(i,JSON.parse(xn(o,Ma)))}catch{oo(!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;oo(l.is([Li,rr]),"Already mounted!"),l.set(Li),this._C=d,this._T=o||this._T||(this.is(Eo)?ku:Pu),this._E=i||this._E;var c=mo({},Ru,this._E,{Transition:this._T});return pi(c,function(u,p){var b=u(s,d,s._o);d[p]=b,b.setup&&b.setup()}),pi(d,function(u){u.mount&&u.mount()}),this.emit(Jn),Tn(this.root,qd),l.set(Pi),this.emit(ga),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(Pi)&&(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(Li)?Bt(this).on(ga,this.destroy.bind(this,i)):(pi(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(Aa),o.destroy(),i&&Wn(this.splides),s.set(rr)),this},Ed(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})(),Ba=Au;Ba.defaults={};Ba.STATES=kd;var vs=[[Jn,"onMounted"],[ga,"onReady"],[_n,"onMove"],[qi,"onMoved"],[Pa,"onClick"],[Pl,"onActive"],[Al,"onInactive"],[Fl,"onVisible"],[Wl,"onHidden"],[Qt,"onRefresh"],[rn,"onUpdated"],[Ai,"onResize"],[fr,"onResized"],[_l,"onDrag"],[Nl,"onDragging"],[Hl,"onDragged"],[yr,"onScroll"],[fi,"onScrolled"],[Aa,"onDestroy"],[Ol,"onArrowsMounted"],[jl,"onArrowsUpdated"],[Dl,"onPaginationMounted"],[zl,"onPaginationUpdated"],[Fa,"onNavigationMounted"],[Wa,"onAutoplayPlay"],[Bl,"onAutoplayPlaying"],[_a,"onAutoplayPause"],[Na,"onLazyLoadLoaded"]];function Va(...e){return e.filter(Boolean).join(" ")}function cr(e){return e!==null&&typeof e=="object"}function ya(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!ya(n,t[i]));if(cr(e)&&cr(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!ya(e[o],t[o]))}return e===t}function Fu(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function Wu(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 va(e,t){const n=e;return Wu(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():cr(i)?n[o]=va(cr(n[o])?n[o]:{},i):n[o]=i}),n}var _u=({children:e,className:t,...n})=>a.createElement("div",{className:Va("splide__track",t),...n},a.createElement("ul",{className:"splide__list"},e)),Ga=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 Ba(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=va({},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&&!ya(this.options,e)&&(this.splide.options=e,this.options=va({},e));const t=this.getSlides();Fu(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){vs.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:Va("splide",e),ref:this.splideRef,...this.omit(o,["options",...vs.map(s=>s[1])])},n?a.createElement(_u,null,i):i)}},qa=({children:e,className:t,...n})=>a.createElement("li",{className:Va("splide__slide",t),...n},e);/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),a=require("react"),dt=require("classnames"),x=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Yn=require("react-dom");function Hc(e){return e.type==="object"&&e.version===1}const Oc="ControlSlider-module__wrapper___sHEkd",Dc="ControlSlider-module__hoverArrow___A-dOH",jc="ControlSlider-module__sliderItem___QQSkR",zc="ControlSlider-module__sliderImage___9hRl-",Bc="ControlSlider-module__arrow___05ghY",Vc="ControlSlider-module__arrowVertical___tBfVN",Gc="ControlSlider-module__nextArrow___-30Yc",qc="ControlSlider-module__arrowInner___aEra3",Uc="ControlSlider-module__arrowIcon___S4ztF",Kc="ControlSlider-module__arrowImg___2dwJW",Xc="ControlSlider-module__mirror___brd6U",Yc="ControlSlider-module__pagination___bicLF",Zc="ControlSlider-module__paginationInner___bT-P-",Jc="ControlSlider-module__paginationVertical___zYqKw",Qc="ControlSlider-module__paginationItem___nTRbk",ed="ControlSlider-module__dot___p1Qun",td="ControlSlider-module__activeDot___LHFaj",nd="ControlSlider-module__paginationInsideBottom___R3FWn",id="ControlSlider-module__paginationInsideTop___V-qb-",od="ControlSlider-module__paginationOutsideBottom___14w8D",rd="ControlSlider-module__paginationOutsideTop___SCLqB",ad="ControlSlider-module__paginationInsideLeft___yOBRZ",sd="ControlSlider-module__paginationInsideRight___Rtt3o",ld="ControlSlider-module__paginationOutsideLeft___lahaw",cd="ControlSlider-module__paginationOutsideRight___EtuQa",dd="ControlSlider-module__imgWrapper___UjEgB",ud="ControlSlider-module__captionBlock___dJ6-j",pd="ControlSlider-module__captionTextWrapper___HFlpf",md="ControlSlider-module__captionText___uGBVc",gd="ControlSlider-module__active___WZK4G",hd="ControlSlider-module__withPointerEvents___t-18M",fd="ControlSlider-module__topLeftAlignment___zjnGM",yd="ControlSlider-module__topCenterAlignment___gD1xW",vd="ControlSlider-module__topRightAlignment___NMapS",xd="ControlSlider-module__middleLeftAlignment___OnUrY",bd="ControlSlider-module__middleCenterAlignment___Tdkl0",wd="ControlSlider-module__middleRightAlignment___wEbfX",Sd="ControlSlider-module__bottomLeftAlignment___cTP2-",$d="ControlSlider-module__bottomCenterAlignment___c54fB",Cd="ControlSlider-module__bottomRightAlignment___kEwrz",Td="ControlSlider-module__clickOverlay___DZA28",Ld="ControlSlider-module__contain___pLyq7",Id="ControlSlider-module__cover___KdDat",ot={wrapper:Oc,hoverArrow:Dc,sliderItem:jc,sliderImage:zc,arrow:Bc,arrowVertical:Vc,nextArrow:Gc,arrowInner:qc,arrowIcon:Uc,arrowImg:Kc,mirror:Xc,pagination:Yc,paginationInner:Zc,paginationVertical:Jc,paginationItem:Qc,dot:ed,activeDot:td,paginationInsideBottom:nd,paginationInsideTop:id,paginationOutsideBottom:od,paginationOutsideTop:rd,paginationInsideLeft:ad,paginationInsideRight:sd,paginationOutsideLeft:ld,paginationOutsideRight:cd,imgWrapper:dd,captionBlock:ud,captionTextWrapper:pd,captionText:md,active:gd,withPointerEvents:hd,topLeftAlignment:fd,topCenterAlignment:yd,topRightAlignment:vd,middleLeftAlignment:xd,middleCenterAlignment:bd,middleRightAlignment:wd,bottomLeftAlignment:Sd,bottomCenterAlignment:$d,bottomRightAlignment:Cd,clickOverlay:Td,contain:Ld,cover:Id};function Rd(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 Ed(e,t,n){return t&&Rd(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var as="(prefers-reduced-motion: reduce)",Li=1,Md=2,Pi=3,Gi=4,So=5,Jo=6,rr=7,kd={CREATED:Li,MOUNTED:Md,IDLE:Pi,MOVING:Gi,SCROLLING:So,DRAGGING:Jo,DESTROYED:rr};function Wn(e){e.length=0}function Zn(e,t,n){return Array.prototype.slice.call(e,t,n)}function Nt(e){return e.bind.apply(e,[null].concat(Zn(arguments,1)))}var $l=setTimeout,da=function(){};function ss(e){return requestAnimationFrame(e)}function hr(e,t){return typeof t===e}function co(e){return!Ia(e)&&hr("object",e)}var La=Array.isArray,Cl=Nt(hr,"function"),qn=Nt(hr,"string"),$o=Nt(hr,"undefined");function Ia(e){return e===null}function Tl(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Co(e){return La(e)?e:[e]}function yn(e,t){Co(e).forEach(t)}function Ra(e,t){return e.indexOf(t)>-1}function Qo(e,t){return e.push.apply(e,Co(t)),e}function Mn(e,t,n){e&&yn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Tn(e,t){Mn(e,qn(t)?t.split(" "):t,!0)}function To(e,t){yn(t,e.appendChild.bind(e))}function Ea(e,t){yn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function uo(e,t){return Tl(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Ll(e,t){var n=e?Zn(e.children):[];return t?n.filter(function(i){return uo(i,t)}):n}function Lo(e,t){return t?Ll(e,t)[0]:e.firstElementChild}var po=Object.keys;function pi(e,t,n){return e&&(n?po(e).reverse():po(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function mo(e){return Zn(arguments,1).forEach(function(t){pi(t,function(n,i){e[i]=t[i]})}),e}function zn(e){return Zn(arguments,1).forEach(function(t){pi(t,function(n,i){La(n)?e[i]=n.slice():co(n)?e[i]=zn({},co(e[i])?e[i]:{},n):e[i]=n})}),e}function ls(e,t){yn(t||po(e),function(n){delete e[n]})}function Ln(e,t){yn(e,function(n){yn(t,function(i){n&&n.removeAttribute(i)})})}function yt(e,t,n){co(t)?pi(t,function(i,o){yt(e,o,i)}):yn(e,function(i){Ia(n)||n===""?Ln(i,t):i.setAttribute(t,String(n))})}function Ii(e,t,n){var i=document.createElement(e);return t&&(qn(t)?Tn(i,t):yt(i,t)),n&&To(n,i),i}function vn(e,t,n){if($o(n))return getComputedStyle(e)[t];Ia(n)||(e.style[t]=""+n)}function go(e,t){vn(e,"display",t)}function Il(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function xn(e,t){return e.getAttribute(t)}function cs(e,t){return e&&e.classList.contains(t)}function mn(e){return e.getBoundingClientRect()}function mi(e){yn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Rl(e){return Lo(new DOMParser().parseFromString(e,"text/html").body)}function En(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function El(e,t){return e&&e.querySelector(t)}function Ma(e,t){return t?Zn(e.querySelectorAll(t)):[]}function kn(e,t){Mn(e,t,!1)}function ua(e){return e.timeStamp}function ii(e){return qn(e)?e:e?e+"px":""}var Io="splide",ka="data-"+Io;function oo(e,t){if(!e)throw new Error("["+Io+"] "+(t||""))}var Un=Math.min,ar=Math.max,sr=Math.floor,ho=Math.ceil,sn=Math.abs;function Ml(e,t,n){return sn(e-t)<n}function er(e,t,n,i){var o=Un(t,n),s=ar(t,n);return i?o<e&&e<s:o<=e&&e<=s}function $i(e,t,n){var i=Un(t,n),o=ar(t,n);return Un(ar(i,e),o)}function pa(e){return+(e>0)-+(e<0)}function ma(e,t){return yn(t,function(n){e=e.replace("%s",""+n)}),e}function Pa(e){return e<10?"0"+e:""+e}var ds={};function Pd(e){return""+e+Pa(ds[e]=(ds[e]||0)+1)}function kl(){var e=[];function t(l,d,c,u){o(l,d,function(p,w,v){var T="addEventListener"in p,g=T?p.removeEventListener.bind(p,w,c,u):p.removeListener.bind(p,c);T?p.addEventListener(w,c,u):p.addListener(c),e.push([p,w,v,c,g])})}function n(l,d,c){o(l,d,function(u,p,w){e=e.filter(function(v){return v[0]===u&&v[1]===p&&v[2]===w&&(!c||v[3]===c)?(v[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(w){var v=w.split(".");c(u,v[0],v[1])})})})}function s(){e.forEach(function(l){l[4]()}),Wn(e)}return{bind:t,unbind:n,dispatch:i,destroy:s}}var Jn="mounted",ga="ready",_n="move",qi="moved",Aa="click",Pl="active",Al="inactive",Fl="visible",Wl="hidden",Qt="refresh",rn="updated",Ai="resize",fr="resized",_l="drag",Nl="dragging",Hl="dragged",yr="scroll",fi="scrolled",Ad="overflow",Fa="destroy",Ol="arrows:mounted",Dl="arrows:updated",jl="pagination:mounted",zl="pagination:updated",Wa="navigation:mounted",_a="autoplay:play",Bl="autoplay:playing",Na="autoplay:pause",Ha="lazyload:loaded",Vl="sk",Gl="sh",lr="ei";function Bt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=kl();function i(s,l){n.bind(t,Co(s).join(" "),function(d){l.apply(l,La(d.detail)?d.detail:[])})}function o(s){n.dispatch(t,s,Zn(arguments,1))}return e&&e.event.on(Fa,n.destroy),mo(n,{bus:t,on:i,off:Nt(n.unbind,t),emit:o})}function vr(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 v();d=ss(p)}}function w(R){R||g(),s=o()-(R?l*e:0),c=!1,d=ss(p)}function v(){c=!0}function T(){s=o(),l=0,n&&n(l)}function g(){d&&cancelAnimationFrame(d),l=0,d=0,c=!0}function $(R){e=R}function f(){return c}return{start:w,rewind:T,pause:v,cancel:g,set:$,isPaused:f}}function Fd(e){var t=e;function n(o){t=o}function i(o){return Ra(Co(o),t)}return{set:n,is:i}}function Wd(e,t){var n=vr(0,e,null,1);return function(){n.isPaused()&&n.start()}}function _d(e,t,n){var i=e.state,o=n.breakpoints||{},s=n.reducedMotion||{},l=kl(),d=[];function c(){var g=n.mediaQuery==="min";po(o).sort(function($,f){return g?+$-+f:+f-+$}).forEach(function($){p(o[$],"("+(g?"min":"max")+"-width:"+$+"px)")}),p(s,as),w()}function u(g){g&&l.destroy()}function p(g,$){var f=matchMedia($);l.bind(f,"change",w),d.push([g,f])}function w(){var g=i.is(rr),$=n.direction,f=d.reduce(function(R,L){return zn(R,L[1].matches?L[0]:{})},{});ls(n),T(f),n.destroy?e.destroy(n.destroy==="completely"):g?(u(!0),e.mount()):$!==n.direction&&e.refresh()}function v(g){matchMedia(as).matches&&(g?zn(n,s):ls(n,po(s)))}function T(g,$,f){zn(n,g),$&&zn(Object.getPrototypeOf(n),g),(f||!i.is(Li))&&e.emit(rn,n)}return{setup:c,destroy:u,reduce:v,set:T}}var xr="Arrow",br=xr+"Left",wr=xr+"Right",ql=xr+"Up",Ul=xr+"Down",us="rtl",Sr="ttb",_r={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[ql,wr],ArrowRight:[Ul,br]};function Nd(e,t,n){function i(s,l,d){d=d||n.direction;var c=d===us&&!l?1:d===Sr?0:-1;return _r[s]&&_r[s][c]||s.replace(/width|left|right/i,function(u,p){var w=_r[u.toLowerCase()][c]||u;return p>0?w.charAt(0).toUpperCase()+w.slice(1):w})}function o(s){return s*(n.direction===us?1:-1)}return{resolve:i,orient:o}}var Pn="role",Ri="tabindex",Hd="disabled",bn="aria-",Ro=bn+"controls",Kl=bn+"current",ps=bn+"selected",hn=bn+"label",Oa=bn+"labelledby",Xl=bn+"hidden",Da=bn+"orientation",fo=bn+"roledescription",ms=bn+"live",gs=bn+"busy",hs=bn+"atomic",ja=[Pn,Ri,Hd,Ro,Kl,hn,Oa,Xl,Da,fo],In=Io+"__",Qn="is-",Nr=Io,fs=In+"track",Od=In+"list",$r=In+"slide",Yl=$r+"--clone",Dd=$r+"__container",za=In+"arrows",Cr=In+"arrow",Zl=Cr+"--prev",Jl=Cr+"--next",Tr=In+"pagination",Ql=Tr+"__page",jd=In+"progress",zd=jd+"__bar",Bd=In+"toggle",Vd=In+"spinner",Gd=In+"sr",qd=Qn+"initialized",gi=Qn+"active",ec=Qn+"prev",tc=Qn+"next",ha=Qn+"visible",fa=Qn+"loading",nc=Qn+"focus-in",ic=Qn+"overflow",Ud=[gi,ha,ec,tc,fa,nc,ic],Kd={slide:$r,clone:Yl,arrows:za,arrow:Cr,prev:Zl,next:Jl,pagination:Tr,page:Ql,spinner:Vd};function Xd(e,t){if(Cl(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!uo(n,t);)n=n.parentElement;return n}var Yd=5,ys=200,oc="touchstart mousedown",Hr="touchmove mousemove",Or="touchend touchcancel mouseup click";function Zd(e,t,n){var i=Bt(e),o=i.on,s=i.bind,l=e.root,d=n.i18n,c={},u=[],p=[],w=[],v,T,g;function $(){I(),Y(),L()}function f(){o(Qt,R),o(Qt,$),o(rn,L),s(document,oc+" keydown",function(M){g=M.type==="keydown"},{capture:!0}),s(l,"focusin",function(){Mn(l,nc,!!g)})}function R(M){var C=ja.concat("style");Wn(u),kn(l,p),kn(v,w),Ln([v,T],C),Ln(l,M?C:["style",fo])}function L(){kn(l,p),kn(v,w),p=V(Nr),w=V(fs),Tn(l,p),Tn(v,w),yt(l,hn,n.label),yt(l,Oa,n.labelledby)}function I(){v=P("."+fs),T=Lo(v,"."+Od),oo(v&&T,"A track/list element is missing."),Qo(u,Ll(T,"."+$r+":not(."+Yl+")")),pi({arrows:za,pagination:Tr,prev:Zl,next:Jl,bar:zd,toggle:Bd},function(M,C){c[C]=P("."+M)}),mo(c,{root:l,track:v,list:T,slides:u})}function Y(){var M=l.id||Pd(Io),C=n.role;l.id=M,v.id=v.id||M+"-track",T.id=T.id||M+"-list",!xn(l,Pn)&&l.tagName!=="SECTION"&&C&&yt(l,Pn,C),yt(l,fo,d.carousel),yt(T,Pn,"presentation")}function P(M){var C=El(l,M);return C&&Xd(C,"."+Nr)===l?C:void 0}function V(M){return[M+"--"+n.type,M+"--"+n.direction,n.drag&&M+"--draggable",n.isNavigation&&M+"--nav",M===Nr&&gi]}return mo(c,{setup:$,mount:f,destroy:R})}var Fi="slide",Ui="loop",Eo="fade";function Jd(e,t,n,i){var o=Bt(e),s=o.on,l=o.emit,d=o.bind,c=e.Components,u=e.root,p=e.options,w=p.isNavigation,v=p.updateOnMove,T=p.i18n,g=p.pagination,$=p.slideFocus,f=c.Direction.resolve,R=xn(i,"style"),L=xn(i,hn),I=n>-1,Y=Lo(i,"."+Dd),P;function V(){I||(i.id=u.id+"-slide"+Pa(t+1),yt(i,Pn,g?"tabpanel":"group"),yt(i,fo,T.slide),yt(i,hn,L||ma(T.slideLabel,[t+1,e.length]))),M()}function M(){d(i,"click",Nt(l,Aa,j)),d(i,"keydown",Nt(l,Vl,j)),s([qi,Gl,fi],S),s(Wa,A),v&&s(_n,y)}function C(){P=!0,o.destroy(),kn(i,Ud),Ln(i,ja),yt(i,"style",R),yt(i,hn,L||"")}function A(){var O=e.splides.map(function(E){var K=E.splide.Components.Slides.getAt(t);return K?K.slide.id:""}).join(" ");yt(i,hn,ma(T.slideX,(I?n:t)+1)),yt(i,Ro,O),yt(i,Pn,$?"button":""),$&&Ln(i,fo)}function y(){P||S()}function S(){if(!P){var O=e.index;F(),W(),Mn(i,ec,t===O-1),Mn(i,tc,t===O+1)}}function F(){var O=G();O!==cs(i,gi)&&(Mn(i,gi,O),yt(i,Kl,w&&O||""),l(O?Pl:Al,j))}function W(){var O=J(),E=!O&&(!G()||I);if(e.state.is([Gi,So])||yt(i,Xl,E||""),yt(Ma(i,p.focusableNodes||""),Ri,E?-1:""),$&&yt(i,Ri,E?-1:0),O!==cs(i,ha)&&(Mn(i,ha,O),l(O?Fl:Wl,j)),!O&&document.activeElement===i){var K=c.Slides.getAt(e.index);K&&Il(K.slide)}}function U(O,E,K){vn(K&&Y||i,O,E)}function G(){var O=e.index;return O===t||p.cloneStatus&&O===n}function J(){if(e.is(Eo))return G();var O=mn(c.Elements.track),E=mn(i),K=f("left",!0),Z=f("right",!0);return sr(O[K])<=ho(E[K])&&sr(E[Z])<=ho(O[Z])}function D(O,E){var K=sn(O-t);return!I&&(p.rewind||e.is(Ui))&&(K=Un(K,e.length-K)),K<=E}var j={index:t,slideIndex:n,slide:i,container:Y,isClone:I,mount:V,destroy:C,update:S,style:U,isWithin:D};return j}function Qd(e,t,n){var i=Bt(e),o=i.on,s=i.emit,l=i.bind,d=t.Elements,c=d.slides,u=d.list,p=[];function w(){v(),o(Qt,T),o(Qt,v)}function v(){c.forEach(function(S,F){$(S,F,-1)})}function T(){P(function(S){S.destroy()}),Wn(p)}function g(){P(function(S){S.update()})}function $(S,F,W){var U=Jd(e,F,W,S);U.mount(),p.push(U),p.sort(function(G,J){return G.index-J.index})}function f(S){return S?V(function(F){return!F.isClone}):p}function R(S){var F=t.Controller,W=F.toIndex(S),U=F.hasFocus()?1:n.perPage;return V(function(G){return er(G.index,W,W+U-1)})}function L(S){return V(S)[0]}function I(S,F){yn(S,function(W){if(qn(W)&&(W=Rl(W)),Tl(W)){var U=c[F];U?Ea(W,U):To(u,W),Tn(W,n.classes.slide),C(W,Nt(s,Ai))}}),s(Qt)}function Y(S){mi(V(S).map(function(F){return F.slide})),s(Qt)}function P(S,F){f(F).forEach(S)}function V(S){return p.filter(Cl(S)?S:function(F){return qn(S)?uo(F.slide,S):Ra(Co(S),F.index)})}function M(S,F,W){P(function(U){U.style(S,F,W)})}function C(S,F){var W=Ma(S,"img"),U=W.length;U?W.forEach(function(G){l(G,"load error",function(){--U||F()})}):F()}function A(S){return S?c.length:p.length}function y(){return p.length>n.perPage}return{mount:w,destroy:T,update:g,register:$,get:f,getIn:R,getAt:L,add:I,remove:Y,forEach:P,filter:V,style:M,getLength:A,isEnough:y}}function eu(e,t,n){var i=Bt(e),o=i.on,s=i.bind,l=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,p=u.root,w=u.track,v=u.list,T=d.getAt,g=d.style,$,f,R;function L(){I(),s(window,"resize load",Wd(Nt(l,Ai))),o([rn,Qt],I),o(Ai,Y)}function I(){$=n.direction===Sr,vn(p,"maxWidth",ii(n.width)),vn(w,c("paddingLeft"),P(!1)),vn(w,c("paddingRight"),P(!0)),Y(!0)}function Y(j){var O=mn(p);(j||f.width!==O.width||f.height!==O.height)&&(vn(w,"height",V()),g(c("marginRight"),ii(n.gap)),g("width",C()),g("height",A(),!0),f=O,l(fr),R!==(R=D())&&(Mn(p,ic,R),l(Ad,R)))}function P(j){var O=n.padding,E=c(j?"right":"left");return O&&ii(O[E]||(co(O)?0:O))||"0px"}function V(){var j="";return $&&(j=M(),oo(j,"height or heightRatio is missing."),j="calc("+j+" - "+P(!1)+" - "+P(!0)+")"),j}function M(){return ii(n.height||mn(v).width*n.heightRatio)}function C(){return n.autoWidth?null:ii(n.fixedWidth)||($?"":y())}function A(){return ii(n.fixedHeight)||($?n.autoHeight?null:y():M())}function y(){var j=ii(n.gap);return"calc((100%"+(j&&" + "+j)+")/"+(n.perPage||1)+(j&&" - "+j)+")"}function S(){return mn(v)[c("width")]}function F(j,O){var E=T(j||0);return E?mn(E.slide)[c("width")]+(O?0:G()):0}function W(j,O){var E=T(j);if(E){var K=mn(E.slide)[c("right")],Z=mn(v)[c("left")];return sn(K-Z)+(O?0:G())}return 0}function U(j){return W(e.length-1)-W(0)+F(0,j)}function G(){var j=T(0);return j&&parseFloat(vn(j.slide,c("marginRight")))||0}function J(j){return parseFloat(vn(w,c("padding"+(j?"Right":"Left"))))||0}function D(){return e.is(Eo)||U(!0)>S()}return{mount:L,resize:Y,listSize:S,slideSize:F,sliderSize:U,totalSize:W,getPadding:J,isOverflow:D}}var tu=2;function nu(e,t,n){var i=Bt(e),o=i.on,s=t.Elements,l=t.Slides,d=t.Direction.resolve,c=[],u;function p(){o(Qt,w),o([rn,Ai],T),(u=f())&&(g(u),t.Layout.resize(!0))}function w(){v(),p()}function v(){mi(c),Wn(c),i.destroy()}function T(){var R=f();u!==R&&(u<R||!R)&&i.emit(Qt)}function g(R){var L=l.get().slice(),I=L.length;if(I){for(;L.length<R;)Qo(L,L);Qo(L.slice(-R),L.slice(0,R)).forEach(function(Y,P){var V=P<R,M=$(Y.slide,P);V?Ea(M,L[0].slide):To(s.list,M),Qo(c,M),l.register(M,P-R+(V?0:I),Y.index)})}}function $(R,L){var I=R.cloneNode(!0);return Tn(I,n.classes.clone),I.id=e.root.id+"-clone"+Pa(L+1),I}function f(){var R=n.clones;if(!e.is(Ui))R=0;else if($o(R)){var L=n[d("fixedWidth")]&&t.Layout.slideSize(0),I=L&&ho(mn(s.track)[d("width")]/L);R=I||n[d("autoWidth")]&&e.length||n.perPage*tu}return R}return{mount:p,destroy:v}}function iu(e,t,n){var i=Bt(e),o=i.on,s=i.emit,l=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,p=d.totalSize,w=d.listSize,v=d.sliderSize,T=t.Direction,g=T.resolve,$=T.orient,f=t.Elements,R=f.list,L=f.track,I;function Y(){I=t.Transition,o([Jn,fr,rn,Qt],P)}function P(){t.Controller.isBusy()||(t.Scroll.cancel(),M(e.index),t.Slides.update())}function V(E,K,Z,ce){E!==K&&j(E>Z)&&(S(),C(y(U(),E>Z),!0)),l(Gi),s(_n,K,Z,E),I.start(K,function(){l(Pi),s(qi,K,Z,E),ce&&ce()})}function M(E){C(W(E,!0))}function C(E,K){if(!e.is(Eo)){var Z=K?E:A(E);vn(R,"transform","translate"+g("X")+"("+Z+"px)"),E!==Z&&s(Gl)}}function A(E){if(e.is(Ui)){var K=F(E),Z=K>t.Controller.getEnd(),ce=K<0;(ce||Z)&&(E=y(E,Z))}return E}function y(E,K){var Z=E-D(K),ce=v();return E-=$(ce*(ho(sn(Z)/ce)||1))*(K?1:-1),E}function S(){C(U(),!0),I.cancel()}function F(E){for(var K=t.Slides.get(),Z=0,ce=1/0,N=0;N<K.length;N++){var pe=K[N].index,b=sn(W(pe,!0)-E);if(b<=ce)ce=b,Z=pe;else break}return Z}function W(E,K){var Z=$(p(E-1)-J(E));return K?G(Z):Z}function U(){var E=g("left");return mn(R)[E]-mn(L)[E]+$(u(!1))}function G(E){return n.trimSpace&&e.is(Fi)&&(E=$i(E,0,$(v(!0)-w()))),E}function J(E){var K=n.focus;return K==="center"?(w()-c(E,!0))/2:+K*c(E)||0}function D(E){return W(E?t.Controller.getEnd():0,!!n.trimSpace)}function j(E){var K=$(y(U(),E));return E?K>=0:K<=R[g("scrollWidth")]-mn(L)[g("width")]}function O(E,K){K=$o(K)?U():K;var Z=E!==!0&&$(K)<$(D(!1)),ce=E!==!1&&$(K)>$(D(!0));return Z||ce}return{mount:Y,move:V,jump:M,translate:C,shift:y,cancel:S,toIndex:F,toPosition:W,getPosition:U,getLimit:D,exceededLimit:O,reposition:P}}function ou(e,t,n){var i=Bt(e),o=i.on,s=i.emit,l=t.Move,d=l.getPosition,c=l.getLimit,u=l.toPosition,p=t.Slides,w=p.isEnough,v=p.getLength,T=n.omitEnd,g=e.is(Ui),$=e.is(Fi),f=Nt(U,!1),R=Nt(U,!0),L=n.start||0,I,Y=L,P,V,M;function C(){A(),o([rn,Qt,lr],A),o(fr,y)}function A(){P=v(!0),V=n.perMove,M=n.perPage,I=j();var b=$i(L,0,T?I:P-1);b!==L&&(L=b,l.reposition())}function y(){I!==j()&&s(lr)}function S(b,he,Q){if(!pe()){var we=W(b),Te=D(we);Te>-1&&(he||Te!==L)&&(Z(Te),l.move(we,Te,Y,Q))}}function F(b,he,Q,we){t.Scroll.scroll(b,he,Q,function(){var Te=D(l.toIndex(d()));Z(T?Un(Te,I):Te),we&&we()})}function W(b){var he=L;if(qn(b)){var Q=b.match(/([+\-<>])(\d+)?/)||[],we=Q[1],Te=Q[2];we==="+"||we==="-"?he=G(L+ +(""+we+(+Te||1)),L):we===">"?he=Te?O(+Te):f(!0):we==="<"&&(he=R(!0))}else he=g?b:$i(b,0,I);return he}function U(b,he){var Q=V||(N()?1:M),we=G(L+Q*(b?-1:1),L,!(V||N()));return we===-1&&$&&!Ml(d(),c(!b),1)?b?0:I:he?we:D(we)}function G(b,he,Q){if(w()||N()){var we=J(b);we!==b&&(he=b,b=we,Q=!1),b<0||b>I?!V&&(er(0,b,he,!0)||er(I,he,b,!0))?b=O(E(b)):g?b=Q?b<0?-(P%M||M):P:b:n.rewind?b=b<0?I:0:b=-1:Q&&b!==he&&(b=O(E(he)+(b<he?-1:1)))}else b=-1;return b}function J(b){if($&&n.trimSpace==="move"&&b!==L)for(var he=d();he===u(b,!0)&&er(b,0,e.length-1,!n.rewind);)b<L?--b:++b;return b}function D(b){return g?(b+P)%P||0:b}function j(){for(var b=P-(N()||g&&V?1:M);T&&b-- >0;)if(u(P-1,!0)!==u(b,!0)){b++;break}return $i(b,0,P-1)}function O(b){return $i(N()?b:M*b,0,I)}function E(b){return N()?Un(b,I):sr((b>=I?P-1:b)/M)}function K(b){var he=l.toIndex(b);return $?$i(he,0,I):he}function Z(b){b!==L&&(Y=L,L=b)}function ce(b){return b?Y:L}function N(){return!$o(n.focus)||n.isNavigation}function pe(){return e.state.is([Gi,So])&&!!n.waitForTransition}return{mount:C,go:S,scroll:F,getNext:f,getPrev:R,getAdjacent:U,getEnd:j,setIndex:Z,getIndex:ce,toIndex:O,toPage:E,toDest:K,hasFocus:N,isBusy:pe}}var ru="http://www.w3.org/2000/svg",au="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",Wo=40;function su(e,t,n){var i=Bt(e),o=i.on,s=i.bind,l=i.emit,d=n.classes,c=n.i18n,u=t.Elements,p=t.Controller,w=u.arrows,v=u.track,T=w,g=u.prev,$=u.next,f,R,L={};function I(){P(),o(rn,Y)}function Y(){V(),I()}function P(){var F=n.arrows;F&&!(g&&$)&&A(),g&&$&&(mo(L,{prev:g,next:$}),go(T,F?"":"none"),Tn(T,R=za+"--"+n.direction),F&&(M(),S(),yt([g,$],Ro,v.id),l(Ol,g,$)))}function V(){i.destroy(),kn(T,R),f?(mi(w?[g,$]:T),g=$=null):Ln([g,$],ja)}function M(){o([Jn,qi,Qt,fi,lr],S),s($,"click",Nt(C,">")),s(g,"click",Nt(C,"<"))}function C(F){p.go(F,!0)}function A(){T=w||Ii("div",d.arrows),g=y(!0),$=y(!1),f=!0,To(T,[g,$]),!w&&Ea(T,v)}function y(F){var W='<button class="'+d.arrow+" "+(F?d.prev:d.next)+'" type="button"><svg xmlns="'+ru+'" viewBox="0 0 '+Wo+" "+Wo+'" width="'+Wo+'" height="'+Wo+'" focusable="false"><path d="'+(n.arrowPath||au)+'" />';return Rl(W)}function S(){if(g&&$){var F=e.index,W=p.getPrev(),U=p.getNext(),G=W>-1&&F<W?c.last:c.prev,J=U>-1&&F>U?c.first:c.next;g.disabled=W<0,$.disabled=U<0,yt(g,hn,G),yt($,hn,J),l(Dl,g,$,W,U)}}return{arrows:L,mount:I,destroy:V,update:S}}var lu=ka+"-interval";function cu(e,t,n){var i=Bt(e),o=i.on,s=i.bind,l=i.emit,d=vr(n.interval,e.go.bind(e,">"),M),c=d.isPaused,u=t.Elements,p=t.Elements,w=p.root,v=p.toggle,T=n.autoplay,g,$,f=T==="pause";function R(){T&&(L(),v&&yt(v,Ro,u.track.id),f||I(),V())}function L(){n.pauseOnHover&&s(w,"mouseenter mouseleave",function(A){g=A.type==="mouseenter",P()}),n.pauseOnFocus&&s(w,"focusin focusout",function(A){$=A.type==="focusin",P()}),v&&s(v,"click",function(){f?I():Y(!0)}),o([_n,yr,Qt],d.rewind),o(_n,C)}function I(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),$=g=f=!1,V(),l(_a))}function Y(A){A===void 0&&(A=!0),f=!!A,V(),c()||(d.pause(),l(Na))}function P(){f||(g||$?Y(!1):I())}function V(){v&&(Mn(v,gi,!f),yt(v,hn,n.i18n[f?"play":"pause"]))}function M(A){var y=u.bar;y&&vn(y,"width",A*100+"%"),l(Bl,A)}function C(A){var y=t.Slides.getAt(A);d.set(y&&+xn(y.slide,lu)||n.interval)}return{mount:R,destroy:d.cancel,play:I,pause:Y,isPaused:c}}function du(e,t,n){var i=Bt(e),o=i.on;function s(){n.cover&&(o(Ha,Nt(d,!0)),o([Jn,rn,Qt],Nt(l,!0)))}function l(c){t.Slides.forEach(function(u){var p=Lo(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),go(u,c?"none":"")}return{mount:s,destroy:Nt(l,!1)}}var uu=10,pu=600,mu=.6,gu=1.5,hu=800;function fu(e,t,n){var i=Bt(e),o=i.on,s=i.emit,l=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,p=d.exceededLimit,w=d.translate,v=e.is(Fi),T,g,$=1;function f(){o(_n,Y),o([rn,Qt],P)}function R(M,C,A,y,S){var F=c();if(Y(),A&&(!v||!p())){var W=t.Layout.sliderSize(),U=pa(M)*W*sr(sn(M)/W)||0;M=d.toPosition(t.Controller.toDest(M%W))+U}var G=Ml(F,M,1);$=1,C=G?0:C||ar(sn(M-F)/gu,hu),g=y,T=vr(C,L,Nt(I,F,M,S),1),l(So),s(yr),T.start()}function L(){l(Pi),g&&g(),s(fi)}function I(M,C,A,y){var S=c(),F=M+(C-M)*V(y),W=(F-S)*$;w(S+W),v&&!A&&p()&&($*=mu,sn(W)<uu&&R(u(p(!0)),pu,!1,g,!0))}function Y(){T&&T.cancel()}function P(){T&&!T.isPaused()&&(Y(),L())}function V(M){var C=n.easingFunc;return C?C(M):1-Math.pow(1-M,4)}return{mount:f,destroy:Y,scroll:R,cancel:P}}var Ci={passive:!1,capture:!0};function yu(e,t,n){var i=Bt(e),o=i.on,s=i.emit,l=i.bind,d=i.unbind,c=e.state,u=t.Move,p=t.Scroll,w=t.Controller,v=t.Elements.track,T=t.Media.reduce,g=t.Direction,$=g.resolve,f=g.orient,R=u.getPosition,L=u.exceededLimit,I,Y,P,V,M,C=!1,A,y,S;function F(){l(v,Hr,da,Ci),l(v,Or,da,Ci),l(v,oc,U,Ci),l(v,"click",D,{capture:!0}),l(v,"dragstart",En),o([Jn,rn],W)}function W(){var q=n.drag;oe(!q),V=q==="free"}function U(q){if(A=!1,!y){var de=Te(q);we(q.target)&&(de||!q.button)&&(w.isBusy()?En(q,!0):(S=de?v:window,M=c.is([Gi,So]),P=null,l(S,Hr,G,Ci),l(S,Or,J,Ci),u.cancel(),p.cancel(),j(q)))}}function G(q){if(c.is(Jo)||(c.set(Jo),s(_l)),q.cancelable)if(M){u.translate(I+Q(N(q)));var de=pe(q)>ys,ge=C!==(C=L());(de||ge)&&j(q),A=!0,s(Nl),En(q)}else K(q)&&(M=E(q),En(q))}function J(q){c.is(Jo)&&(c.set(Pi),s(Hl)),M&&(O(q),En(q)),d(S,Hr,G),d(S,Or,J),M=!1}function D(q){!y&&A&&En(q,!0)}function j(q){P=Y,Y=q,I=R()}function O(q){var de=Z(q),ge=ce(de),_e=n.rewind&&n.rewindByDrag;T(!1),V?w.scroll(ge,0,n.snap):e.is(Eo)?w.go(f(pa(de))<0?_e?"<":"-":_e?">":"+"):e.is(Fi)&&C&&_e?w.go(L(!0)?">":"<"):w.go(w.toDest(ge),!0),T(!0)}function E(q){var de=n.dragMinThreshold,ge=co(de),_e=ge&&de.mouse||0,Ce=(ge?de.touch:+de)||10;return sn(N(q))>(Te(q)?Ce:_e)}function K(q){return sn(N(q))>sn(N(q,!0))}function Z(q){if(e.is(Ui)||!C){var de=pe(q);if(de&&de<ys)return N(q)/de}return 0}function ce(q){return R()+pa(q)*Un(sn(q)*(n.flickPower||600),V?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function N(q,de){return he(q,de)-he(b(q),de)}function pe(q){return ua(q)-ua(b(q))}function b(q){return Y===q&&P||Y}function he(q,de){return(Te(q)?q.changedTouches[0]:q)["page"+$(de?"Y":"X")]}function Q(q){return q/(C&&e.is(Fi)?Yd:1)}function we(q){var de=n.noDrag;return!uo(q,"."+Ql+", ."+Cr)&&(!de||!uo(q,de))}function Te(q){return typeof TouchEvent<"u"&&q instanceof TouchEvent}function se(){return M}function oe(q){y=q}return{mount:F,disable:oe,isDragging:se}}var vu={Spacebar:" ",Right:wr,Left:br,Up:ql,Down:Ul};function Ba(e){return e=qn(e)?e:e.key,vu[e]||e}var vs="keydown";function xu(e,t,n){var i=Bt(e),o=i.on,s=i.bind,l=i.unbind,d=e.root,c=t.Direction.resolve,u,p;function w(){v(),o(rn,T),o(rn,v),o(_n,$)}function v(){var R=n.keyboard;R&&(u=R==="global"?window:d,s(u,vs,f))}function T(){l(u,vs)}function g(R){p=R}function $(){var R=p;p=!0,$l(function(){p=R})}function f(R){if(!p){var L=Ba(R);L===c(br)?e.go("<"):L===c(wr)&&e.go(">")}}return{mount:w,destroy:T,disable:g}}var ro=ka+"-lazy",tr=ro+"-srcset",bu="["+ro+"], ["+tr+"]";function wu(e,t,n){var i=Bt(e),o=i.on,s=i.off,l=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[qi,fi],p=[];function w(){n.lazyLoad&&(v(),o(Qt,v))}function v(){Wn(p),T(),c?R():(s(u),o(u,g),g())}function T(){t.Slides.forEach(function(L){Ma(L.slide,bu).forEach(function(I){var Y=xn(I,ro),P=xn(I,tr);if(Y!==I.src||P!==I.srcset){var V=n.classes.spinner,M=I.parentElement,C=Lo(M,"."+V)||Ii("span",V,M);p.push([I,L,C]),I.src||go(I,"none")}})})}function g(){p=p.filter(function(L){var I=n.perPage*((n.preloadPages||1)+1)-1;return L[1].isWithin(e.index,I)?$(L):!0}),p.length||s(u)}function $(L){var I=L[0];Tn(L[1].slide,fa),l(I,"load error",Nt(f,L)),yt(I,"src",xn(I,ro)),yt(I,"srcset",xn(I,tr)),Ln(I,ro),Ln(I,tr)}function f(L,I){var Y=L[0],P=L[1];kn(P.slide,fa),I.type!=="error"&&(mi(L[2]),go(Y,""),d(Ha,Y,P),d(Ai)),c&&R()}function R(){p.length&&$(p.shift())}return{mount:w,destroy:Nt(Wn,p),check:g}}function Su(e,t,n){var i=Bt(e),o=i.on,s=i.emit,l=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,p=u.hasFocus,w=u.getIndex,v=u.go,T=t.Direction.resolve,g=c.pagination,$=[],f,R;function L(){I(),o([rn,Qt,lr],L);var y=n.pagination;g&&go(g,y?"":"none"),y&&(o([_n,yr,fi],A),Y(),A(),s(jl,{list:f,items:$},C(e.index)))}function I(){f&&(mi(g?Zn(f.children):f),kn(f,R),Wn($),f=null),i.destroy()}function Y(){var y=e.length,S=n.classes,F=n.i18n,W=n.perPage,U=p()?u.getEnd()+1:ho(y/W);f=g||Ii("ul",S.pagination,c.track.parentElement),Tn(f,R=Tr+"--"+M()),yt(f,Pn,"tablist"),yt(f,hn,F.select),yt(f,Da,M()===Sr?"vertical":"");for(var G=0;G<U;G++){var J=Ii("li",null,f),D=Ii("button",{class:S.page,type:"button"},J),j=d.getIn(G).map(function(E){return E.slide.id}),O=!p()&&W>1?F.pageX:F.slideX;l(D,"click",Nt(P,G)),n.paginationKeyboard&&l(D,"keydown",Nt(V,G)),yt(J,Pn,"presentation"),yt(D,Pn,"tab"),yt(D,Ro,j.join(" ")),yt(D,hn,ma(O,G+1)),yt(D,Ri,-1),$.push({li:J,button:D,page:G})}}function P(y){v(">"+y,!0)}function V(y,S){var F=$.length,W=Ba(S),U=M(),G=-1;W===T(wr,!1,U)?G=++y%F:W===T(br,!1,U)?G=(--y+F)%F:W==="Home"?G=0:W==="End"&&(G=F-1);var J=$[G];J&&(Il(J.button),v(">"+G),En(S,!0))}function M(){return n.paginationDirection||n.direction}function C(y){return $[u.toPage(y)]}function A(){var y=C(w(!0)),S=C(w());if(y){var F=y.button;kn(F,gi),Ln(F,ps),yt(F,Ri,-1)}if(S){var W=S.button;Tn(W,gi),yt(W,ps,!0),yt(W,Ri,"")}s(zl,{list:f,items:$},y,S)}return{items:$,mount:L,destroy:I,getAt:C,update:A}}var $u=[" ","Enter"];function Cu(e,t,n){var i=n.isNavigation,o=n.slideFocus,s=[];function l(){e.splides.forEach(function(g){g.isParent||(u(e,g.splide),u(g.splide,e))}),i&&p()}function d(){s.forEach(function(g){g.destroy()}),Wn(s)}function c(){d(),l()}function u(g,$){var f=Bt(g);f.on(_n,function(R,L,I){$.go($.is(Ui)?I:R)}),s.push(f)}function p(){var g=Bt(e),$=g.on;$(Aa,v),$(Vl,T),$([Jn,rn],w),s.push(g),g.emit(Wa,e.splides)}function w(){yt(t.Elements.list,Da,n.direction===Sr?"vertical":"")}function v(g){e.go(g.index)}function T(g,$){Ra($u,Ba($))&&(v(g),En($))}return{setup:Nt(t.Media.set,{slideFocus:$o(o)?i:o},!0),mount:l,destroy:d,remount:c}}function Tu(e,t,n){var i=Bt(e),o=i.bind,s=0;function l(){n.wheel&&o(t.Elements.track,"wheel",d,Ci)}function d(u){if(u.cancelable){var p=u.deltaY,w=p<0,v=ua(u),T=n.wheelMinThreshold||0,g=n.wheelSleep||0;sn(p)>T&&v-s>g&&(e.go(w?"<":">"),s=v),c(w)&&En(u)}}function c(u){return!n.releaseWheel||e.state.is(Gi)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var Lu=90;function Iu(e,t,n){var i=Bt(e),o=i.on,s=t.Elements.track,l=n.live&&!n.isNavigation,d=Ii("span",Gd),c=vr(Lu,Nt(p,!1));function u(){l&&(v(!t.Autoplay.isPaused()),yt(s,hs,!0),d.textContent="…",o(_a,Nt(v,!0)),o(Na,Nt(v,!1)),o([qi,fi],Nt(p,!0)))}function p(T){yt(s,gs,T),T?(To(s,d),c.start()):(mi(d),c.cancel())}function w(){Ln(s,[ms,hs,gs]),mi(d)}function v(T){l&&yt(s,ms,T?"off":"polite")}return{mount:u,disable:v,destroy:w}}var Ru=Object.freeze({__proto__:null,Media:_d,Direction:Nd,Elements:Zd,Slides:Qd,Layout:eu,Clones:nu,Move:iu,Controller:ou,Arrows:su,Autoplay:cu,Cover:du,Scroll:fu,Drag:yu,Keyboard:xu,LazyLoad:wu,Pagination:Su,Sync:Cu,Wheel:Tu,Live:Iu}),Eu={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"},Mu={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:Kd,i18n:Eu,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function ku(e,t,n){var i=t.Slides;function o(){Bt(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),$l(c)}return{mount:o,start:l,cancel:da}}function Pu(e,t,n){var i=t.Move,o=t.Controller,s=t.Scroll,l=t.Elements.list,d=Nt(vn,l,"transition"),c;function u(){Bt(e).bind(l,"transitionend",function(T){T.target===l&&c&&(w(),c())})}function p(T,g){var $=i.toPosition(T,!0),f=i.getPosition(),R=v(T);sn($-f)>=1&&R>=1?n.useScroll?s.scroll($,R,!1,g):(d("transform "+R+"ms "+n.easing),i.translate($,!0),c=g):(i.jump(T),g())}function w(){d(""),s.cancel()}function v(T){var g=n.rewindSpeed;if(e.is(Fi)&&g){var $=o.getIndex(!0),f=o.getEnd();if($===0&&T>=f||$>=f&&T===0)return g}return n.speed}return{mount:u,start:p,cancel:w}}var Au=(function(){function e(n,i){this.event=Bt(),this.Components={},this.state=Fd(Li),this.splides=[],this._o={},this._E={};var o=qn(n)?El(document,n):n;oo(o,o+" is invalid."),this.root=o,i=zn({label:xn(o,hn)||"",labelledby:xn(o,Oa)||""},Mu,e.defaults,i||{});try{zn(i,JSON.parse(xn(o,ka)))}catch{oo(!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;oo(l.is([Li,rr]),"Already mounted!"),l.set(Li),this._C=d,this._T=o||this._T||(this.is(Eo)?ku:Pu),this._E=i||this._E;var c=mo({},Ru,this._E,{Transition:this._T});return pi(c,function(u,p){var w=u(s,d,s._o);d[p]=w,w.setup&&w.setup()}),pi(d,function(u){u.mount&&u.mount()}),this.emit(Jn),Tn(this.root,qd),l.set(Pi),this.emit(ga),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(Pi)&&(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(Li)?Bt(this).on(ga,this.destroy.bind(this,i)):(pi(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(Fa),o.destroy(),i&&Wn(this.splides),s.set(rr)),this},Ed(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})(),Va=Au;Va.defaults={};Va.STATES=kd;var xs=[[Jn,"onMounted"],[ga,"onReady"],[_n,"onMove"],[qi,"onMoved"],[Aa,"onClick"],[Pl,"onActive"],[Al,"onInactive"],[Fl,"onVisible"],[Wl,"onHidden"],[Qt,"onRefresh"],[rn,"onUpdated"],[Ai,"onResize"],[fr,"onResized"],[_l,"onDrag"],[Nl,"onDragging"],[Hl,"onDragged"],[yr,"onScroll"],[fi,"onScrolled"],[Fa,"onDestroy"],[Ol,"onArrowsMounted"],[Dl,"onArrowsUpdated"],[jl,"onPaginationMounted"],[zl,"onPaginationUpdated"],[Wa,"onNavigationMounted"],[_a,"onAutoplayPlay"],[Bl,"onAutoplayPlaying"],[Na,"onAutoplayPause"],[Ha,"onLazyLoadLoaded"]];function Ga(...e){return e.filter(Boolean).join(" ")}function cr(e){return e!==null&&typeof e=="object"}function ya(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!ya(n,t[i]));if(cr(e)&&cr(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!ya(e[o],t[o]))}return e===t}function Fu(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function Wu(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 va(e,t){const n=e;return Wu(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():cr(i)?n[o]=va(cr(n[o])?n[o]:{},i):n[o]=i}),n}var _u=({children:e,className:t,...n})=>a.createElement("div",{className:Ga("splide__track",t),...n},a.createElement("ul",{className:"splide__list"},e)),qa=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 Va(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=va({},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&&!ya(this.options,e)&&(this.splide.options=e,this.options=va({},e));const t=this.getSlides();Fu(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){xs.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:Ga("splide",e),ref:this.splideRef,...this.omit(o,["options",...xs.map(s=>s[1])])},n?a.createElement(_u,null,i):i)}},Ua=({children:e,className:t,...n})=>a.createElement("li",{className:Ga("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 Nu="RichTextRenderer-module__link___BWeZ2",Hu={link:Nu},Ou=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))},Lr=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Ou(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function nn(e){const{color:t,...n}=e;return n}function zt(e,t){var o,s,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:Lr(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:v.scalingValue(e.letterSpacing,t),wordSpacing:v.scalingValue(e.wordSpacing,t),fontSize:v.scalingValue(n,t),lineHeight:i!==void 0?v.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 hi=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?r.jsx("a",{className:Hu.link,href:i.value,target:i.target,children:t(i.children)},o):r.jsx("span",{style:ju(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 ju(e){return{...e.fontFamily&&{fontFamily:Lr(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 Du="SvgImage-module__svg___q3xE-",zu="SvgImage-module__img___VsTm-",xs={svg:Du,img:zu},Bu=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},Vu=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,on=({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)}},[]),!Bu(e)||!s?r.jsx("img",{src:e,alt:"",className:ct(xs.img,i),style:o}):r.jsx("span",{"data-supports-mask":s,className:ct(xs.svg,i),style:{"--svg":Vu(e),"--fill":t,"--hover-fill":n,...o??{}}})},Gu={"top-left":rt.topLeftAlignment,"top-center":rt.topCenterAlignment,"top-right":rt.topRightAlignment,"middle-left":rt.middleLeftAlignment,"middle-center":rt.middleCenterAlignment,"middle-right":rt.middleRightAlignment,"bottom-left":rt.bottomLeftAlignment,"bottom-center":rt.bottomCenterAlignment,"bottom-right":rt.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:S,color:T}=n.imageCaption??{},[g,$]=a.useState(void 0),[h,I]=a.useState(null),[R,E]=a.useState(0),[Z,P]=a.useState(0),{direction:B,transition:M,controls:C,pagination:W,imageCaption:y,triggers:x}=e,A=a.useRef(M.type),{x:H,y:K}=e.controls.offset,G=Y=>{o&&o.go(Y)};return a.useEffect(()=>{if(!h)return;const Y=new ResizeObserver(V=>{if(!o)return;const[D]=V;$({width:Math.round(D.contentRect.width),height:Math.round(D.contentRect.height)})});return Y.observe(h),()=>Y.unobserve(h)},[h]),a.useEffect(()=>{!o||A.current===M.type||(P(Y=>Y+1),A.current=M.type)},[M.type]),r.jsx("div",{className:ct(rt.wrapper,{[rt.editor]:i}),ref:I,children:r.jsxs("div",{className:rt.sliderInner,style:{width:g?g.width:"100%",height:g?g.height:"100%",backgroundColor:M.backgroundColor&&M.type==="fade in"?M.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&r.jsx("div",{className:ct(rt.captionBlock),children:r.jsx("div",{className:rt.captionTextWrapper,children:t.map((Y,V)=>r.jsx("div",{className:ct(rt.captionText,Gu[y.alignment],{[rt.withPointerEvents]:V===R&&i,[rt.active]:V===R}),style:{fontFamily:Lr(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":v.scalingValue(l.width,i),letterSpacing:v.scalingValue(c,i),wordSpacing:v.scalingValue(p,i),textAlign:u,fontSize:v.scalingValue(b.fontSize,i),lineHeight:v.scalingValue(b.lineHeight,i),textTransform:S.textTransform??"none",textDecoration:S.textDecoration??"none",fontVariant:S.fontVariant??"normal",color:T,transitionDuration:M.duration?`${Math.round(parseInt(M.duration)/2)}ms`:"500ms"},children:r.jsx("div",{"data-styles":"imageCaption",className:rt.captionTextInner,style:{"--link-hover-color":y.linkHoverColor,"--link-color":y.linkColor,position:"relative",top:v.scalingValue(y.offset.y,i),left:v.scalingValue(y.offset.x,i)},children:r.jsx(hi,{content:Y.imageCaption})})},V))})}),r.jsx(Ga,{onMove:Y=>{E(Y.index)},ref:s,options:{arrows:!1,speed:M.duration?parseInt(M.duration):500,autoplay:x.autoPlay!==null,...x.autoPlay!==null&&{interval:parseInt(x.autoPlay)*1e3},direction:B==="horiz"||M.type==="fade in"?"ltr":"ttb",pagination:!1,drag:x.triggersList.drag,perPage:1,width:g?g.width:"100%",height:g?g.height:"100%",type:M.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((Y,V)=>r.jsx(qa,{children:r.jsx("div",{className:rt.sliderItem,children:r.jsx("div",{className:rt.imgWrapper,children:r.jsx("img",{className:ct(rt.sliderImage,{[rt.contain]:Y.image.objectFit==="contain",[rt.cover]:Y.image.objectFit==="cover"}),src:Y.image.url,alt:Y.image.name??""})})})},V))},Z),C.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:ct(rt.arrow,{[rt.arrowVertical]:B==="vert",[rt.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:r.jsxs("button",{onClick:()=>{G("-1")},className:rt.arrowInner,style:{transform:`translate(${v.scalingValue(H,i)}, ${v.scalingValue(K*(B==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&r.jsx(on,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:ct(rt.arrowImg,rt.mirror)}),!C.arrowsImgUrl&&r.jsx(bs,{color:C.color,className:ct(rt.arrowIcon,rt.arrowImg,rt.mirror)})]})}),r.jsx("div",{className:ct(rt.arrow,rt.nextArrow,{[rt.arrowVertical]:B==="vert",[rt.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:r.jsxs("button",{className:rt.arrowInner,onClick:()=>G("+1"),style:{transform:`translate(${v.scalingValue(H*(B==="horiz"?-1:1),i)}, ${v.scalingValue(K,i)}) scale(${e.controls.scale/100}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&r.jsx(on,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:rt.arrowImg}),!C.arrowsImgUrl&&r.jsx(bs,{color:C.color,className:ct(rt.arrowIcon,rt.arrowImg)})]})})]}),x.triggersList.click&&r.jsx("div",{className:rt.clickOverlay,onClick:()=>{o&&o.go("+1")}}),W.isActive&&r.jsx("div",{className:ct(rt.pagination,{[rt.paginationInsideBottom]:W.position==="inside-1"&&B==="horiz",[rt.paginationInsideTop]:W.position==="inside-2"&&B==="horiz",[rt.paginationOutsideBottom]:W.position==="outside-1"&&B==="horiz",[rt.paginationOutsideTop]:W.position==="outside-2"&&B==="horiz",[rt.paginationInsideLeft]:W.position==="inside-1"&&B==="vert",[rt.paginationInsideRight]:W.position==="inside-2"&&B==="vert",[rt.paginationOutsideLeft]:W.position==="outside-1"&&B==="vert",[rt.paginationOutsideRight]:W.position==="outside-2"&&B==="vert",[rt.paginationVertical]:B==="vert"}),children:r.jsx("div",{className:rt.paginationInner,style:{backgroundColor:W.colors[2],transform:`scale(${W.scale/100}) translate(${v.scalingValue(W.offset.x,i)}, ${v.scalingValue(W.offset.y,i)}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:t.map((Y,V)=>r.jsx("button",{onClick:()=>{o&&o.go(V)},className:ct(rt.paginationItem),children:r.jsx("div",{className:ct(rt.dot,{[rt.activeDot]:V===R}),style:{backgroundColor:V===R?W.colors[0]:W.colors[1],"--pagination-hover-color":W.hover}})},V))})})]})})}function bs({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 Uu={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"]}},Ku="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Xu="ImageRevealSlider-module__image___Qjt-e",Yu="ImageRevealSlider-module__link___N-iLG",Zu="ImageRevealSlider-module__cursor___2U03d",xi={imageRevealSlider:Ku,image:Xu,link:Yu,cursor:Zu};function ws(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 jr(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Ju(e,t,n,i){let o,s;if(t==="custom"){o=n;const l=await jr(e);s=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await jr(e);s=l.height/l.width*o}else{const l=await jr(e);o=l.width,s=l.height}return{width:o,height:s,finalWidth:`${o}px`}}function Qu({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}),[S,T]=a.useState(1),[g,$]=a.useState("none"),h=a.useRef({x:0,y:0}),[I,R]=a.useState(!1),{sizeType:E,imageWidth:Z,randomRangeImageWidth:P}=e.imageSize,{revealPosition:B,visible:M}=e.position,{cursorType:C,target:W,defaultCursorScale:y,defaultCursor:x,hoverCursorScale:A,hoverCursor:H}=e.cursor;a.useEffect(()=>{if(!i)return;const Y=(O,L)=>{const U=i.getBoundingClientRect(),J=O-U.left,ce=L-U.top;if(b({x:J,y:ce}),C==="system"){$("none"),T(1);return}const _=J,de=ce,w=document.elementFromPoint(U.left+_,U.top+de);if(w&&w.closest("a")){$("none"),T(1);return}const ge=ws(_,de,s)||W==="area"?{img:H??"none",scale:A}:{img:x??"none",scale:y};$(ge.img),T(ge.scale)},V=O=>{O.stopPropagation(),h.current={x:O.clientX,y:O.clientY},Y(O.clientX,O.clientY)},D=()=>{I&&Y(h.current.x,h.current.y)};return i.addEventListener("mousemove",V),window.addEventListener("scroll",D,!0),()=>{i.removeEventListener("mousemove",V),window.removeEventListener("scroll",D,!0)}},[i,I,p,C,W,H,x,A,y,s]),a.useEffect(()=>{I||($("none"),T(0))},[I]);const K=async(Y,V,D,O={})=>{const{width:L,height:U,finalWidth:J}=await Ju(Y.image.url,E,Z,P);let ce=0,_=0;B==="same"?(ce=V/2,_=D/2):(ce=O.x??Math.random()*V,_=O.y??Math.random()*D);const de=Math.min(Math.max(ce,L/2),V-L/2),w=Math.min(Math.max(_,U/2),D-U/2);return{id:u.current++,url:Y.image.url,link:Y.link,name:Y.image.name,x:de,y:w,width:J}};a.useEffect(()=>{if(!i||t.length===0)return;const Y=i.getBoundingClientRect(),V=Y.width,D=Y.height,O=[];(async()=>{const U=t[0],J=await K(U,V,D);O.push(J),l(O),c(1)})()},[E,Z,P,B,i]),a.useEffect(()=>{M==="last One"&&l(Y=>Y.length>0?[Y[Y.length-1]]:[])},[M]);const G=async Y=>{if(!i)return;const V=i.getBoundingClientRect(),D=Y.clientX-V.left,O=Y.clientY-V.top;if(W==="image"&&!ws(D,O,s))return;let L=0,U=0;B==="on Click"?(L=D,U=O):B==="same"?(L=V.width/2,U=V.height/2):(L=Math.random()*V.width,U=Math.random()*V.height);const J=t[d],ce=await K(J,V.width,V.height,{x:L,y:U});l(_=>M==="all"?[..._,ce]:[ce]),c(_=>_>=t.length-1?0:_+1)};return r.jsxs("div",{ref:o,onClick:G,onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1),className:xi.imageRevealSlider,style:{cursor:g==="none"?"default":"none"},children:[s.map(Y=>r.jsx("div",{className:xi.wrapper,style:{top:`${Y.y}px`,left:`${Y.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:Y.width??"auto",height:"auto",cursor:g==="none"?"default":"none"},children:W==="area"&&Y.link?r.jsx("a",{href:Y.link,target:"_blank",className:xi.link,children:r.jsx("img",{src:Y.url,alt:Y.name,className:xi.image},Y.id)}):r.jsx("img",{src:Y.url,alt:Y.name,className:xi.image},Y.id)},Y.id)),I&&r.jsx("div",{className:xi.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${S})`,backgroundImage:`url('${g}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const ep={element:Qu,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:""}]}}}},tp="LightBox-module__hidden___9s-9x",np="LightBox-module__heroImage___sTxNF",ip="LightBox-module__background___rm9ml",op="LightBox-module__editor___4ACaY",rp="LightBox-module__contentStyle___Bgnsq",ap="LightBox-module__imageStyle___tLIlB",sp="LightBox-module__imgWrapper___LuFUp",lp="LightBox-module__contain___8-yaS",cp="LightBox-module__cover___hNvOG",dp="LightBox-module__caption___b6L2I",up="LightBox-module__captionTextInner___rCGNH",pp="LightBox-module__lightboxSplide___XFuWC",mp="LightBox-module__arrow___iz38X",gp="LightBox-module__arrowVertical___Zfz81",hp="LightBox-module__nextArrow___zkAQN",fp="LightBox-module__arrowInner___p48sW",yp="LightBox-module__arrowIcon___3VaFf",vp="LightBox-module__arrowImg___pNV88",xp="LightBox-module__mirror___pjeXc",bp="LightBox-module__thumbsWrapper___GB-nU",wp="LightBox-module__thumbsContainerVertical___wttk5",Sp="LightBox-module__thumbsContainer___osSma",$p="LightBox-module__thumbsAlignStart___MO6tY",Cp="LightBox-module__thumbsAlignCenter___Q4sUx",Tp="LightBox-module__thumbsAlignEnd___p4y9R",Lp="LightBox-module__thumbItem___HvnF3",Ip="LightBox-module__closeButton___g2khP",Rp="LightBox-module__fadeIn___0m5GW",Ep="LightBox-module__slideInLeft___gPYwC",Mp="LightBox-module__slideInRight___S-pPp",kp="LightBox-module__slideInTop___DFdAj",Pp="LightBox-module__slideInBottom___m27kZ",Ap="LightBox-module__fadeOut___55qBR",Fp="LightBox-module__slideOutLeft___NvU7P",Wp="LightBox-module__slideOutRight___SK7eC",_p="LightBox-module__slideOutTop___Vgg0z",Np="LightBox-module__slideOutBottom___nJ0Ef",Hp="LightBox-module__scaleSlide___vZriG",je={hidden:tp,heroImage:np,background:ip,editor:op,contentStyle:rp,imageStyle:ap,imgWrapper:sp,contain:lp,cover:cp,caption:dp,captionTextInner:up,lightboxSplide:pp,arrow:mp,arrowVertical:gp,nextArrow:hp,arrowInner:fp,arrowIcon:yp,arrowImg:vp,mirror:xp,thumbsWrapper:bp,thumbsContainerVertical:wp,thumbsContainer:Sp,thumbsAlignStart:$p,thumbsAlignCenter:Cp,thumbsAlignEnd:Tp,thumbItem:Lp,closeButton:Ip,fadeIn:Rp,slideInLeft:Ep,slideInRight:Mp,slideInTop:kp,slideInBottom:Pp,fadeOut:Ap,slideOutLeft:Fp,slideOutRight:Wp,slideOutTop:_p,slideOutBottom:Np,scaleSlide:Hp},_o=(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% + ${v.scalingValue(t.x,n)}), calc(-50% + ${v.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${v.scalingValue(t.x,n)}, calc(-50% + ${v.scalingValue(t.y,n)}))`:s==="center"?i.transform=`translate(calc(-50% + ${v.scalingValue(t.x,n)}), ${v.scalingValue(t.y,n)})`:i.transform=`translate(${v.scalingValue(t.x,n)}, ${v.scalingValue(t.y,n)})`,i};function rc(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 Op(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 ac(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 jp(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 sc(e,t,n,i,o){const{x:s,y:l}=Op(o);return{offsetX:s*(e-n),offsetY:l*(t-i)}}function Dp(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"?jp:ac,{renderedW:u,renderedH:p}=c(n,i,o,s),{offsetX:b,offsetY:S}=sc(n,i,u,p,d),T=(b+u/2)/n*100,g=(S+p/2)/i*100;return`${T}% ${g}%`}function zp(e){return Dp(e)}function dr(e){const t=e.getBoundingClientRect(),n=rc(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}=ac(i,o,s,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:b}=sc(i,o,d,c,u),S=t.left+n.left,T=t.top+n.top;return{x:p+S,y:b+T,width:d,height:c}}function Ss(e){const t=e.getBoundingClientRect(),n=rc(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function $s(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 Bp(e,t){const n=(()=>{if(e==="fade in")return je.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return je.slideInLeft;case"right":return je.slideInRight;case"top":return je.slideInTop;case"bottom":return je.slideInBottom;default:return je.slideInRight}return je.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return je.fadeIn;if(e==="slide in")switch(t){case"left":return je.slideInLeft;case"right":return je.slideInRight;case"top":return je.slideInTop;case"bottom":return je.slideInBottom;default:return je.slideInRight}return je.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return je.fadeOut;if(e==="slide in")switch(t){case"left":return je.slideOutLeft;case"right":return je.slideOutRight;case"top":return je.slideOutTop;case"bottom":return je.slideOutBottom;default:return je.slideOutRight}return je.fadeOut})(),s=(()=>{if(e==="fade in")return je.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return je.slideOutLeft;case"right":return je.slideOutRight;case"top":return je.slideOutTop;case"bottom":return je.slideOutBottom;default:return je.slideOutRight}return je.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:s}}const Vp=({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:je.heroImage,onClick:()=>c(!0)}),r.jsx(Gp,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:s})]})},Gp=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:s,isEditor:l,metadata:d})=>{var Se;const{widthSettings:c,fontSettings:u,letterSpacing:p,textAlign:b,wordSpacing:S,fontSizeLineHeight:T,textAppearance:g,color:$}=i.imageCaption??{},[h,I]=a.useState(0),[R,E]=a.useState(0),[Z,P]=a.useState(!1),[B,M]=a.useState(!1),[C,W]=a.useState({}),y=a.useRef(null),x=a.useRef(null),A=a.useRef(null),H=a.useRef(!1),K=a.useRef(null),G=a.useRef(null),Y=a.useRef(null),V=a.useRef(null),D=a.useRef(!1),O=a.useRef(null),[L,U]=a.useState(!1),{appear:J,triggers:ce,slider:_,thumbnail:de,controls:w,area:ge,caption:Q,layout:ve}=o.lightboxBlock,{appearClass:Le,backdropAppearClass:pe,backdropDisappearClass:ae,disappearClass:q}=Bp(J.type,J.direction),se=(d==null?void 0:d.itemId)??null;a.useEffect(()=>{const z=()=>{setTimeout(()=>{var ye,ue;(ue=(ye=y.current)==null?void 0:ye.splide)==null||ue.refresh()},16)},me=()=>{E(ye=>ye+1)};return window.addEventListener("ArticleEditor.Layout:change",z),window.addEventListener("ArticleEditor.ComponentContent:change",me),()=>{window.removeEventListener("ArticleEditor.Layout:change",z),window.removeEventListener("ArticleEditor.ComponentContent:change",me)}},[]),a.useEffect(()=>{if(!e||!de.isActive){U(!1);return}const z=O.current;if(!z)return;const me=()=>{_.direction==="horiz"?U(z.scrollWidth>z.clientWidth):U(z.scrollHeight>z.clientHeight)};me();const ye=new ResizeObserver(me);return ye.observe(z),()=>ye.disconnect()},[e,de.isActive,n.length,C,_.direction]);const he=a.useCallback(()=>{const z=window.matchMedia("(max-width: 768px)").matches,me=$s(ge.color);z&&!l&&me>.9&&(document.body.style.backgroundColor=""),P(!0),H.current=!0;const ye=ue=>{ue.target===K.current&&ue.animationName&&(K.current&&G.current&&K.current.removeEventListener("animationend",G.current),G.current=null,H.current&&(H.current=!1,t()),P(!1))};K.current&&(G.current=ye,K.current.addEventListener("animationend",ye))},[t,ge.color,l]),Pe=(z,me,ye)=>{var ue,Ee;if(z){if(ce.type==="click"&&ce.switch==="image")ce.repeat==="close"&&h===n.length-1?he():(ue=y.current)==null||ue.go("+1");else if(ce.type==="click"&&ce.switch==="50/50"){const we=z.getBoundingClientRect(),k=me-we.left,le=ye-we.top,te=we.width,j=we.height;let re;_.direction==="horiz"?re=k<te/2?"-1":"+1":re=le<j/2?"-1":"+1",(Ee=y.current)==null||Ee.go(re)}}},Ce=z=>{if(D.current){D.current=!1;return}const me=n[h],ye=(me==null?void 0:me.image.objectFit)==="cover";let ue,Ee;if("changedTouches"in z&&z.changedTouches.length>0)ue=z.changedTouches[0].clientX,Ee=z.changedTouches[0].clientY;else if("clientX"in z)ue=z.clientX,Ee=z.clientY;else return;let we;if(ye&&A.current){const k=Ss(A.current);we=ue>=k.left&&ue<=k.right&&Ee>=k.top&&Ee<=k.bottom}else{const k=A.current?dr(A.current):null;if(!k){z.target===z.currentTarget&&he();return}we=ue>=k.x&&ue<=k.x+k.width&&Ee>=k.y&&Ee<=k.y+k.height}we?Pe(A.current,ue,Ee):he()},ke=z=>{const me=z.target;(me.classList.contains(je.thumbsWrapper)||me.classList.contains(je.thumbsContainer))&&Ce(z)};a.useEffect(()=>{if(!e)return;const z=me=>{var ye,ue;if(me.key==="Escape"){he();return}if(me.key==="ArrowRight"){I(Ee=>(Ee+1)%Math.max(n.length,1)),(ye=y.current)==null||ye.go("+1");return}me.key==="ArrowLeft"&&(I(Ee=>(Ee-1+Math.max(n.length,1))%Math.max(n.length,1)),(ue=y.current)==null||ue.go("-1"))};return window.addEventListener("keydown",z),()=>{window.removeEventListener("keydown",z)}},[e,he,n.length]),a.useEffect(()=>{if(e){if(I(0),E(me=>me+1),H.current=!1,P(!1),M(!1),W({}),!se)return;const z=new CustomEvent("page-overlay",{detail:{itemId:se}});window.dispatchEvent(z)}return()=>{K.current&&G.current&&(K.current.removeEventListener("animationend",G.current),G.current=null),M(!1)}},[e,se]),a.useEffect(()=>{x.current!==null&&x.current!==_.type&&E(z=>z+1),x.current=_.type},[_.type]),a.useEffect(()=>{if(!e)return;const z=document.body.style.overflow,me=window.matchMedia("(max-width: 768px)").matches,ye=$s(ge.color);document.body.style.overflow="hidden",M(!1);const ue=we=>{we.target===K.current&&!H.current&&we.animationName&&(me&&!l&&ye>.9&&(document.body.style.backgroundColor=ge.color),M(!0),K.current&&Y.current&&K.current.removeEventListener("animationend",Y.current),Y.current=null)};K.current&&(Y.current=ue,K.current.addEventListener("animationend",ue));const Ee=we=>{const k=we.target;k&&(k.closest(`.${je.thumbsWrapper}`)||k.closest(`.${je.thumbsContainer}`))||_.type!=="slide"&&we.preventDefault()};return document.addEventListener("touchmove",Ee,{passive:!1}),()=>{document.body.style.overflow=z,document.removeEventListener("touchmove",Ee),K.current&&Y.current&&(K.current.removeEventListener("animationend",Y.current),Y.current=null),M(!1)}},[e,l,ge.color,_.type]),a.useEffect(()=>{if(!e)return;const z=me=>{var ue,Ee;if(H.current){me.stopPropagation();return}if(D.current){D.current=!1;return}const ye=me.target;if(!(ye&&(ye.closest(`.${je.thumbsContainer}`)||ye.closest(`.${je.thumbItem}`)||ye.closest(`.${je.arrow}`)||ye.closest(`.${je.closeButton}`)||ye.closest(`.${je.caption}`)))){if(_.type==="slide"&&ce.type==="drag"&&((Ee=(ue=y.current)==null?void 0:ue.splide)!=null&&Ee.root)){const we=y.current.splide.root;if(ye&&(we.contains(ye)||we===ye))return}if(me.touches.length===0&&me.changedTouches.length>0){const we=n[h],k=(we==null?void 0:we.image.objectFit)==="cover",le=me.changedTouches[0];let te;if(k&&A.current){const j=Ss(A.current);te=le.clientX>=j.left&&le.clientX<=j.right&&le.clientY>=j.top&&le.clientY<=j.bottom}else{const j=A.current?dr(A.current):null;if(!j)return;te=le.clientX>=j.x&&le.clientX<=j.x+j.width&&le.clientY>=j.y&&le.clientY<=j.y+j.height}if(!te){me.stopPropagation(),H.current=!0;const j=re=>{re.stopPropagation(),re.preventDefault(),document.removeEventListener("click",j,!0)};document.addEventListener("click",j,!0),he()}}}};return document.addEventListener("touchend",z,{passive:!0}),()=>{document.removeEventListener("touchend",z)}},[e,he,h,n]);const fe=(_.type==="scale"||_.type==="fade")&&_.direction==="vert"&&ce.type==="drag";a.useEffect(()=>{var re,Ie;if(!e||!fe||!((Ie=(re=y.current)==null?void 0:re.splide)!=null&&Ie.root))return;const z=y.current.splide.root,me=30,ye=(ie,F)=>{if(V.current){const He=Math.abs(ie-V.current.x),Ne=Math.abs(F-V.current.y);(He>0||Ne>0)&&(D.current=!0)}},ue=ie=>{V.current&&(ie.preventDefault(),ye(ie.clientX,ie.clientY))},Ee=ie=>{V.current&&ie.touches.length>0&&(ie.preventDefault(),ye(ie.touches[0].clientX,ie.touches[0].clientY))},we=(ie,F)=>{if(!V.current||!y.current){V.current=null;return}const He=Math.abs(ie-V.current.x),Ne=Math.abs(F-V.current.y);Ne>me&&Ne>He&&y.current.go(F<V.current.y?"+1":"-1"),V.current=null},k=ie=>{V.current&&we(ie.clientX,ie.clientY),document.removeEventListener("pointerup",k),document.removeEventListener("pointercancel",k),document.removeEventListener("pointermove",ue)},le=ie=>{if(V.current){if(ie.changedTouches.length>0){const F=ie.changedTouches[0];we(F.clientX,F.clientY)}document.removeEventListener("touchend",le),document.removeEventListener("touchcancel",le),document.removeEventListener("touchmove",Ee)}},te=ie=>{V.current={x:ie.clientX,y:ie.clientY},D.current=!1,document.addEventListener("pointermove",ue,{passive:!1}),document.addEventListener("pointerup",k),document.addEventListener("pointercancel",k)},j=ie=>{ie.touches.length>0&&(V.current={x:ie.touches[0].clientX,y:ie.touches[0].clientY},D.current=!1,document.addEventListener("touchmove",Ee,{passive:!1}),document.addEventListener("touchend",le),document.addEventListener("touchcancel",le))};return z.addEventListener("pointerdown",te),z.addEventListener("touchstart",j),()=>{z.removeEventListener("pointerdown",te),z.removeEventListener("touchstart",j),document.removeEventListener("pointermove",ue),document.removeEventListener("pointerup",k),document.removeEventListener("pointercancel",k),document.removeEventListener("touchmove",Ee),document.removeEventListener("touchend",le),document.removeEventListener("touchcancel",le),V.current=null,D.current=!1}},[e,fe,R]);const xe={backgroundColor:ge.color,backdropFilter:`blur(${ge.blur}px)`,animationDuration:`${parseInt(J.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:ct(je.background,Z?ae:pe,{[je.editor]:l},{[je.hidden]:!e}),style:{...xe,...B&&!l&&!Z?{position:"absolute"}:{}}}),r.jsxs("div",{ref:l?K:null,className:ct(je.contentStyle,Z?q:Le,{[je.editor]:l},{[je.hidden]:!e}),style:{animationDuration:`${parseInt(J.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[r.jsx(Ga,{onMove:z=>I(z.index),ref:y,className:je.lightboxSplide,options:{arrows:!1,speed:_.duration?parseInt(_.duration):500,direction:_.direction==="horiz"||_.type==="fade"||_.type==="scale"?"ltr":"ttb",pagination:!1,drag:ce.type==="drag"&&!fe,perPage:1,width:"100%",height:"100%",type:_.type==="fade"||_.type==="scale"?"fade":"loop",padding:0,rewind:ce.repeat!=="close",start:0},style:{"--splide-speed":_.duration},children:n.map((z,me)=>{const ye=_o(ve.position,ve.offset,l),ue=`${v.scalingValue(ve.padding.top,l)} ${v.scalingValue(ve.padding.right,l)} ${v.scalingValue(ve.padding.bottom,l)} ${v.scalingValue(ve.padding.left,l)}`,Ee=_.type==="scale"?(()=>{const{transform:we,...k}=ye;return{...k,position:"absolute",padding:ue,boxSizing:"border-box","--position-transform":we||"none"}})():{...ye,position:"absolute",padding:ue,boxSizing:"border-box"};return r.jsx(qa,{children:r.jsx("div",{className:je.imgWrapper,onClick:Ce,children:r.jsx("img",{ref:me===h?A:null,className:ct(je.imageStyle,{[je.contain]:z.image.objectFit==="contain",[je.cover]:z.image.objectFit==="cover",[je.scaleSlide]:_.type==="scale"}),src:z.image.url,alt:z.image.name??"",style:{...Ee,pointerEvents:z.image.objectFit==="contain"?"none":"auto"}})})},me)})},R),w.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:ct(je.arrow,{[je.arrowVertical]:_.direction==="vert"}),style:{color:w.color,"--arrow-hover-color":w.hover},children:r.jsxs("button",{className:je.arrowInner,style:{transform:`translate(${v.scalingValue(w.offset.x,l)}, ${v.scalingValue(w.offset.y*(_.direction==="horiz"?1:-1),l)}) scale(${w.scale}) rotate(${_.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var z;return(z=y.current)==null?void 0:z.go("-1")},"aria-label":"Previous",children:[w.arrowsImgUrl&&r.jsx(on,{url:w.arrowsImgUrl,fill:w.color,hoverFill:w.hover,className:ct(je.arrowImg,je.mirror)}),!w.arrowsImgUrl&&r.jsx(Cs,{color:w.color,className:ct(je.arrowIcon,je.arrowImg,je.mirror)})]})}),r.jsx("div",{className:ct(je.arrow,je.nextArrow,{[je.arrowVertical]:_.direction==="vert"}),style:{color:w.color,"--arrow-hover-color":w.hover},children:r.jsxs("button",{className:je.arrowInner,style:{transform:`translate(${v.scalingValue(w.offset.x*(_.direction==="horiz"?-1:1),l)}, ${v.scalingValue(w.offset.y,l)}) scale(${w.scale}) rotate(${_.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var z;return(z=y.current)==null?void 0:z.go("+1")},"aria-label":"Next",children:[w.arrowsImgUrl&&r.jsx(on,{url:w.arrowsImgUrl,fill:w.color,hoverFill:w.hover,className:je.arrowImg}),!w.arrowsImgUrl&&r.jsx(Cs,{color:w.color,className:ct(je.arrowIcon,je.arrowImg)})]})})]}),ge.closeIconUrl&&(()=>{const z=_o(ge.closeIconAlign,ge.closeIconOffset,l),me=`scale(${ge.closeIconScale})`,ye=z.transform?`${z.transform} ${me}`:me;return r.jsx("button",{className:je.closeButton,style:{...z,transform:ye},onClick:he,"aria-label":"Close lightbox",children:r.jsx(on,{url:ge.closeIconUrl,fill:ge.closeIconColor??"#000000",hoverFill:ge.closeIconHover??"#cccccc"})})})(),Q&&Q.isActive&&i.imageCaption&&((Se=n[h])==null?void 0:Se.imageCaption)&&r.jsx("div",{className:je.caption,style:{..._o(Q.alignment,Q.offset,l),fontFamily:Lr(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":v.scalingValue(c.width,l),letterSpacing:v.scalingValue(p,l),wordSpacing:v.scalingValue(S,l),textAlign:b,fontSize:v.scalingValue(T.fontSize,l),lineHeight:v.scalingValue(T.lineHeight,l),textTransform:g.textTransform??"none",textDecoration:g.textDecoration??"none",fontVariant:g.fontVariant??"normal",color:$},onClick:z=>z.stopPropagation(),children:r.jsx("div",{"data-styles":"imageCaption",className:je.captionTextInner,style:{"--link-color":Q.linkColor,"--link-hover-color":Q.linkHoverColor},children:r.jsx(hi,{content:n[h].imageCaption})})}),de.isActive&&(()=>{const[z,me]=de.position.split("-"),ye=_.direction==="horiz"?`${z}-left`:de.position,ue=_o(ye,de.offset,l),Ee=()=>{if(_.direction==="horiz"){if(me==="left")return"flex-start";if(me==="center")return"center";if(me==="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:O,className:je.thumbsWrapper,onClick:we=>ke(we),style:{position:l?"absolute":"fixed",...ue,..._.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:r.jsx("div",{className:ct(je.thumbsContainer,{[je.thumbsContainerVertical]:_.direction==="vert",[je.thumbsAlignStart]:de.align==="start",[je.thumbsAlignCenter]:de.align==="center",[je.thumbsAlignEnd]:de.align==="end"}),style:{gap:v.scalingValue(de.grid.gap,l),justifyContent:L?"flex-start":Ee()},children:n.map((we,k)=>{const le=k===h,te=C[k],re=de.grid.size*(le?de.activeState.scale:1),Ie=()=>{if(de.fit!=="fit")return{};if(!te)return _.direction==="horiz"?{height:v.scalingValue(re,l)}:{width:v.scalingValue(re,l)};const ie=te.width/te.height;if(_.direction==="horiz"){const F=re,He=F*ie;return{width:v.scalingValue(He,l),height:v.scalingValue(F,l)}}else{const F=re,He=F/ie;return{width:v.scalingValue(F,l),height:v.scalingValue(He,l)}}};return r.jsx("button",{className:je.thumbItem,style:{..._.direction==="horiz"&&de.fit!=="fit"?{height:v.scalingValue(re,l)}:{},..._.direction==="vert"&&de.fit!=="fit"?{width:v.scalingValue(re,l)}:{},...de.fit==="cover"?{width:v.scalingValue(re,l),height:v.scalingValue(re,l)}:{},...Ie(),transition:le?"all 0.25s ease-out":"none",opacity:le?de.activeState.opacity/100:de.opacity/100,"--thumb-hover":de.activeState.opacity/100},onClick:ie=>{var F;ie.stopPropagation(),I(k),(F=y.current)==null||F.go(k)},onMouseEnter:()=>{var ie;de.triggers==="hov"&&((ie=y.current)==null||ie.go(k))},children:r.jsx("img",{src:we.image.url,alt:we.image.name??"",onLoad:ie=>{const F=ie.currentTarget;F.naturalWidth&&F.naturalHeight&&W(He=>({...He,[k]:{width:F.naturalWidth,height:F.naturalHeight}}))},style:{objectFit:de.fit==="cover"?"cover":"contain",...de.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...de.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${we.image.name}-${k}`)})})})})()]})]}),document.getElementById(s))};function Cs({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:Vp,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 No(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Up(e){return`
|
|
6
|
+
*/const Nu="RichTextRenderer-module__link___BWeZ2",Hu={link:Nu},Ou=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))},Lr=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Ou(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function nn(e){const{color:t,...n}=e;return n}function zt(e,t){var o,s,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:Lr(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:x.scalingValue(e.letterSpacing,t),wordSpacing:x.scalingValue(e.wordSpacing,t),fontSize:x.scalingValue(n,t),lineHeight:i!==void 0?x.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 hi=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?r.jsx("a",{className:Hu.link,href:i.value,target:i.target,children:t(i.children)},o):r.jsx("span",{style:Du(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 Du(e){return{...e.fontFamily&&{fontFamily:Lr(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 ju="SvgImage-module__svg___q3xE-",zu="SvgImage-module__img___VsTm-",bs={svg:ju,img:zu},Bu=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},Vu=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,on=({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)}},[]),!Bu(e)||!s?r.jsx("img",{src:e,alt:"",className:dt(bs.img,i),style:o}):r.jsx("span",{"data-supports-mask":s,className:dt(bs.svg,i),style:{"--svg":Vu(e),"--fill":t,"--hover-fill":n,...o??{}}})},Gu={"top-left":ot.topLeftAlignment,"top-center":ot.topCenterAlignment,"top-right":ot.topRightAlignment,"middle-left":ot.middleLeftAlignment,"middle-center":ot.middleCenterAlignment,"middle-right":ot.middleRightAlignment,"bottom-left":ot.bottomLeftAlignment,"bottom-center":ot.bottomCenterAlignment,"bottom-right":ot.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:w,textAppearance:v,color:T}=n.imageCaption??{},[g,$]=a.useState(void 0),[f,R]=a.useState(null),[L,I]=a.useState(0),[Y,P]=a.useState(0),{direction:V,transition:M,controls:C,pagination:A,imageCaption:y,triggers:S}=e,F=a.useRef(M.type),{x:W,y:U}=e.controls.offset,G=J=>{o&&o.go(J)};return a.useEffect(()=>{if(!f)return;const J=new ResizeObserver(D=>{if(!o)return;const[j]=D;$({width:Math.round(j.contentRect.width),height:Math.round(j.contentRect.height)})});return J.observe(f),()=>J.unobserve(f)},[f]),a.useEffect(()=>{!o||F.current===M.type||(P(J=>J+1),F.current=M.type)},[M.type]),r.jsx("div",{className:dt(ot.wrapper,{[ot.editor]:i}),ref:R,children:r.jsxs("div",{className:ot.sliderInner,style:{width:g?g.width:"100%",height:g?g.height:"100%",backgroundColor:M.backgroundColor&&M.type==="fade in"?M.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&r.jsx("div",{className:dt(ot.captionBlock),children:r.jsx("div",{className:ot.captionTextWrapper,children:t.map((J,D)=>r.jsx("div",{className:dt(ot.captionText,Gu[y.alignment],{[ot.withPointerEvents]:D===L&&i,[ot.active]:D===L}),style:{fontFamily:Lr(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":x.scalingValue(l.width,i),letterSpacing:x.scalingValue(c,i),wordSpacing:x.scalingValue(p,i),textAlign:u,fontSize:x.scalingValue(w.fontSize,i),lineHeight:x.scalingValue(w.lineHeight,i),textTransform:v.textTransform??"none",textDecoration:v.textDecoration??"none",fontVariant:v.fontVariant??"normal",color:T,transitionDuration:M.duration?`${Math.round(parseInt(M.duration)/2)}ms`:"500ms"},children:r.jsx("div",{"data-styles":"imageCaption",className:ot.captionTextInner,style:{"--link-hover-color":y.linkHoverColor,"--link-color":y.linkColor,position:"relative",top:x.scalingValue(y.offset.y,i),left:x.scalingValue(y.offset.x,i)},children:r.jsx(hi,{content:J.imageCaption})})},D))})}),r.jsx(qa,{onMove:J=>{I(J.index)},ref:s,options:{arrows:!1,speed:M.duration?parseInt(M.duration):500,autoplay:S.autoPlay!==null,...S.autoPlay!==null&&{interval:parseInt(S.autoPlay)*1e3},direction:V==="horiz"||M.type==="fade in"?"ltr":"ttb",pagination:!1,drag:S.triggersList.drag,perPage:1,width:g?g.width:"100%",height:g?g.height:"100%",type:M.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((J,D)=>r.jsx(Ua,{children:r.jsx("div",{className:ot.sliderItem,children:r.jsx("div",{className:ot.imgWrapper,children:r.jsx("img",{className:dt(ot.sliderImage,{[ot.contain]:J.image.objectFit==="contain",[ot.cover]:J.image.objectFit==="cover"}),src:J.image.url,alt:J.image.name??""})})})},D))},Y),C.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:dt(ot.arrow,{[ot.arrowVertical]:V==="vert",[ot.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:r.jsxs("button",{onClick:()=>{G("-1")},className:ot.arrowInner,style:{transform:`translate(${x.scalingValue(W,i)}, ${x.scalingValue(U*(V==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${V==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&r.jsx(on,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:dt(ot.arrowImg,ot.mirror)}),!C.arrowsImgUrl&&r.jsx(ws,{color:C.color,className:dt(ot.arrowIcon,ot.arrowImg,ot.mirror)})]})}),r.jsx("div",{className:dt(ot.arrow,ot.nextArrow,{[ot.arrowVertical]:V==="vert",[ot.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:r.jsxs("button",{className:ot.arrowInner,onClick:()=>G("+1"),style:{transform:`translate(${x.scalingValue(W*(V==="horiz"?-1:1),i)}, ${x.scalingValue(U,i)}) scale(${e.controls.scale/100}) rotate(${V==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&r.jsx(on,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:ot.arrowImg}),!C.arrowsImgUrl&&r.jsx(ws,{color:C.color,className:dt(ot.arrowIcon,ot.arrowImg)})]})})]}),S.triggersList.click&&r.jsx("div",{className:ot.clickOverlay,onClick:()=>{o&&o.go("+1")}}),A.isActive&&r.jsx("div",{className:dt(ot.pagination,{[ot.paginationInsideBottom]:A.position==="inside-1"&&V==="horiz",[ot.paginationInsideTop]:A.position==="inside-2"&&V==="horiz",[ot.paginationOutsideBottom]:A.position==="outside-1"&&V==="horiz",[ot.paginationOutsideTop]:A.position==="outside-2"&&V==="horiz",[ot.paginationInsideLeft]:A.position==="inside-1"&&V==="vert",[ot.paginationInsideRight]:A.position==="inside-2"&&V==="vert",[ot.paginationOutsideLeft]:A.position==="outside-1"&&V==="vert",[ot.paginationOutsideRight]:A.position==="outside-2"&&V==="vert",[ot.paginationVertical]:V==="vert"}),children:r.jsx("div",{className:ot.paginationInner,style:{backgroundColor:A.colors[2],transform:`scale(${A.scale/100}) translate(${x.scalingValue(A.offset.x,i)}, ${x.scalingValue(A.offset.y,i)}) rotate(${V==="horiz"?"0deg":"90deg"})`},children:t.map((J,D)=>r.jsx("button",{onClick:()=>{o&&o.go(D)},className:dt(ot.paginationItem),children:r.jsx("div",{className:dt(ot.dot,{[ot.activeDot]:D===L}),style:{backgroundColor:D===L?A.colors[0]:A.colors[1],"--pagination-hover-color":A.hover}})},D))})})]})})}function ws({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 Uu={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"]}},Ku="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Xu="ImageRevealSlider-module__image___Qjt-e",Yu="ImageRevealSlider-module__link___N-iLG",Zu="ImageRevealSlider-module__cursor___2U03d",xi={imageRevealSlider:Ku,image:Xu,link:Yu,cursor:Zu};function Ss(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 Dr(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Ju(e,t,n,i){let o,s;if(t==="custom"){o=n;const l=await Dr(e);s=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await Dr(e);s=l.height/l.width*o}else{const l=await Dr(e);o=l.width,s=l.height}return{width:o,height:s,finalWidth:`${o}px`}}function Qu({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,w]=a.useState({x:0,y:0}),[v,T]=a.useState(1),[g,$]=a.useState("none"),f=a.useRef({x:0,y:0}),[R,L]=a.useState(!1),{sizeType:I,imageWidth:Y,randomRangeImageWidth:P}=e.imageSize,{revealPosition:V,visible:M}=e.position,{cursorType:C,target:A,defaultCursorScale:y,defaultCursor:S,hoverCursorScale:F,hoverCursor:W}=e.cursor;a.useEffect(()=>{if(!i)return;const J=(O,E)=>{const K=i.getBoundingClientRect(),Z=O-K.left,ce=E-K.top;if(w({x:Z,y:ce}),C==="system"){$("none"),T(1);return}const N=Z,pe=ce,b=document.elementFromPoint(K.left+N,K.top+pe);if(b&&b.closest("a")){$("none"),T(1);return}const he=Ss(N,pe,s)||A==="area"?{img:W??"none",scale:F}:{img:S??"none",scale:y};$(he.img),T(he.scale)},D=O=>{O.stopPropagation(),f.current={x:O.clientX,y:O.clientY},J(O.clientX,O.clientY)},j=()=>{R&&J(f.current.x,f.current.y)};return i.addEventListener("mousemove",D),window.addEventListener("scroll",j,!0),()=>{i.removeEventListener("mousemove",D),window.removeEventListener("scroll",j,!0)}},[i,R,p,C,A,W,S,F,y,s]),a.useEffect(()=>{R||($("none"),T(0))},[R]);const U=async(J,D,j,O={})=>{const{width:E,height:K,finalWidth:Z}=await Ju(J.image.url,I,Y,P);let ce=0,N=0;V==="same"?(ce=D/2,N=j/2):(ce=O.x??Math.random()*D,N=O.y??Math.random()*j);const pe=Math.min(Math.max(ce,E/2),D-E/2),b=Math.min(Math.max(N,K/2),j-K/2);return{id:u.current++,url:J.image.url,link:J.link,name:J.image.name,x:pe,y:b,width:Z}};a.useEffect(()=>{if(!i||t.length===0)return;const J=i.getBoundingClientRect(),D=J.width,j=J.height,O=[];(async()=>{const K=t[0],Z=await U(K,D,j);O.push(Z),l(O),c(1)})()},[I,Y,P,V,i]),a.useEffect(()=>{M==="last One"&&l(J=>J.length>0?[J[J.length-1]]:[])},[M]);const G=async J=>{if(!i)return;const D=i.getBoundingClientRect(),j=J.clientX-D.left,O=J.clientY-D.top;if(A==="image"&&!Ss(j,O,s))return;let E=0,K=0;V==="on Click"?(E=j,K=O):V==="same"?(E=D.width/2,K=D.height/2):(E=Math.random()*D.width,K=Math.random()*D.height);const Z=t[d],ce=await U(Z,D.width,D.height,{x:E,y:K});l(N=>M==="all"?[...N,ce]:[ce]),c(N=>N>=t.length-1?0:N+1)};return r.jsxs("div",{ref:o,onClick:G,onMouseEnter:()=>L(!0),onMouseLeave:()=>L(!1),className:xi.imageRevealSlider,style:{cursor:g==="none"?"default":"none"},children:[s.map(J=>r.jsx("div",{className:xi.wrapper,style:{top:`${J.y}px`,left:`${J.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:J.width??"auto",height:"auto",cursor:g==="none"?"default":"none"},children:A==="area"&&J.link?r.jsx("a",{href:J.link,target:"_blank",className:xi.link,children:r.jsx("img",{src:J.url,alt:J.name,className:xi.image},J.id)}):r.jsx("img",{src:J.url,alt:J.name,className:xi.image},J.id)},J.id)),R&&r.jsx("div",{className:xi.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${v})`,backgroundImage:`url('${g}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const ep={element:Qu,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:""}]}}}},tp="LightBox-module__hidden___9s-9x",np="LightBox-module__heroImage___sTxNF",ip="LightBox-module__background___rm9ml",op="LightBox-module__editor___4ACaY",rp="LightBox-module__contentStyle___Bgnsq",ap="LightBox-module__imageStyle___tLIlB",sp="LightBox-module__imgWrapper___LuFUp",lp="LightBox-module__contain___8-yaS",cp="LightBox-module__cover___hNvOG",dp="LightBox-module__caption___b6L2I",up="LightBox-module__captionTextInner___rCGNH",pp="LightBox-module__lightboxSplide___XFuWC",mp="LightBox-module__arrow___iz38X",gp="LightBox-module__arrowVertical___Zfz81",hp="LightBox-module__nextArrow___zkAQN",fp="LightBox-module__arrowInner___p48sW",yp="LightBox-module__arrowIcon___3VaFf",vp="LightBox-module__arrowImg___pNV88",xp="LightBox-module__mirror___pjeXc",bp="LightBox-module__thumbsWrapper___GB-nU",wp="LightBox-module__thumbsContainerVertical___wttk5",Sp="LightBox-module__thumbsContainer___osSma",$p="LightBox-module__thumbsAlignStart___MO6tY",Cp="LightBox-module__thumbsAlignCenter___Q4sUx",Tp="LightBox-module__thumbsAlignEnd___p4y9R",Lp="LightBox-module__thumbItem___HvnF3",Ip="LightBox-module__closeButton___g2khP",Rp="LightBox-module__fadeIn___0m5GW",Ep="LightBox-module__slideInLeft___gPYwC",Mp="LightBox-module__slideInRight___S-pPp",kp="LightBox-module__slideInTop___DFdAj",Pp="LightBox-module__slideInBottom___m27kZ",Ap="LightBox-module__fadeOut___55qBR",Fp="LightBox-module__slideOutLeft___NvU7P",Wp="LightBox-module__slideOutRight___SK7eC",_p="LightBox-module__slideOutTop___Vgg0z",Np="LightBox-module__slideOutBottom___nJ0Ef",Hp="LightBox-module__scaleSlide___vZriG",ze={hidden:tp,heroImage:np,background:ip,editor:op,contentStyle:rp,imageStyle:ap,imgWrapper:sp,contain:lp,cover:cp,caption:dp,captionTextInner:up,lightboxSplide:pp,arrow:mp,arrowVertical:gp,nextArrow:hp,arrowInner:fp,arrowIcon:yp,arrowImg:vp,mirror:xp,thumbsWrapper:bp,thumbsContainerVertical:wp,thumbsContainer:Sp,thumbsAlignStart:$p,thumbsAlignCenter:Cp,thumbsAlignEnd:Tp,thumbItem:Lp,closeButton:Ip,fadeIn:Rp,slideInLeft:Ep,slideInRight:Mp,slideInTop:kp,slideInBottom:Pp,fadeOut:Ap,slideOutLeft:Fp,slideOutRight:Wp,slideOutTop:_p,slideOutBottom:Np,scaleSlide:Hp},_o=(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% + ${x.scalingValue(t.x,n)}), calc(-50% + ${x.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${x.scalingValue(t.x,n)}, calc(-50% + ${x.scalingValue(t.y,n)}))`:s==="center"?i.transform=`translate(calc(-50% + ${x.scalingValue(t.x,n)}), ${x.scalingValue(t.y,n)})`:i.transform=`translate(${x.scalingValue(t.x,n)}, ${x.scalingValue(t.y,n)})`,i};function rc(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 Op(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 ac(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 Dp(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 sc(e,t,n,i,o){const{x:s,y:l}=Op(o);return{offsetX:s*(e-n),offsetY:l*(t-i)}}function jp(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"?Dp:ac,{renderedW:u,renderedH:p}=c(n,i,o,s),{offsetX:w,offsetY:v}=sc(n,i,u,p,d),T=(w+u/2)/n*100,g=(v+p/2)/i*100;return`${T}% ${g}%`}function zp(e){return jp(e)}function dr(e){const t=e.getBoundingClientRect(),n=rc(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}=ac(i,o,s,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:w}=sc(i,o,d,c,u),v=t.left+n.left,T=t.top+n.top;return{x:p+v,y:w+T,width:d,height:c}}function $s(e){const t=e.getBoundingClientRect(),n=rc(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Cs(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 Bp(e,t){const n=(()=>{if(e==="fade in")return ze.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return ze.slideInLeft;case"right":return ze.slideInRight;case"top":return ze.slideInTop;case"bottom":return ze.slideInBottom;default:return ze.slideInRight}return ze.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return ze.fadeIn;if(e==="slide in")switch(t){case"left":return ze.slideInLeft;case"right":return ze.slideInRight;case"top":return ze.slideInTop;case"bottom":return ze.slideInBottom;default:return ze.slideInRight}return ze.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return ze.fadeOut;if(e==="slide in")switch(t){case"left":return ze.slideOutLeft;case"right":return ze.slideOutRight;case"top":return ze.slideOutTop;case"bottom":return ze.slideOutBottom;default:return ze.slideOutRight}return ze.fadeOut})(),s=(()=>{if(e==="fade in")return ze.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return ze.slideOutLeft;case"right":return ze.slideOutRight;case"top":return ze.slideOutTop;case"bottom":return ze.slideOutBottom;default:return ze.slideOutRight}return ze.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:s}}const Vp=({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:ze.heroImage,onClick:()=>c(!0)}),r.jsx(Gp,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:s})]})},Gp=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:s,isEditor:l,metadata:d})=>{var Se;const{widthSettings:c,fontSettings:u,letterSpacing:p,textAlign:w,wordSpacing:v,fontSizeLineHeight:T,textAppearance:g,color:$}=i.imageCaption??{},[f,R]=a.useState(0),[L,I]=a.useState(0),[Y,P]=a.useState(!1),[V,M]=a.useState(!1),[C,A]=a.useState({}),y=a.useRef(null),S=a.useRef(null),F=a.useRef(null),W=a.useRef(!1),U=a.useRef(null),G=a.useRef(null),J=a.useRef(null),D=a.useRef(null),j=a.useRef(!1),O=a.useRef(null),[E,K]=a.useState(!1),{appear:Z,triggers:ce,slider:N,thumbnail:pe,controls:b,area:he,caption:Q,layout:we}=o.lightboxBlock,{appearClass:Te,backdropAppearClass:se,backdropDisappearClass:oe,disappearClass:q}=Bp(Z.type,Z.direction),de=(d==null?void 0:d.itemId)??null;a.useEffect(()=>{const B=()=>{setTimeout(()=>{var ve,me;(me=(ve=y.current)==null?void 0:ve.splide)==null||me.refresh()},16)},ue=()=>{I(ve=>ve+1)};return window.addEventListener("ArticleEditor.Layout:change",B),window.addEventListener("ArticleEditor.ComponentContent:change",ue),()=>{window.removeEventListener("ArticleEditor.Layout:change",B),window.removeEventListener("ArticleEditor.ComponentContent:change",ue)}},[]),a.useEffect(()=>{if(!e||!pe.isActive){K(!1);return}const B=O.current;if(!B)return;const ue=()=>{N.direction==="horiz"?K(B.scrollWidth>B.clientWidth):K(B.scrollHeight>B.clientHeight)};ue();const ve=new ResizeObserver(ue);return ve.observe(B),()=>ve.disconnect()},[e,pe.isActive,n.length,C,N.direction]);const ge=a.useCallback(()=>{const B=window.matchMedia("(max-width: 768px)").matches,ue=Cs(he.color);B&&!l&&ue>.9&&(document.body.style.backgroundColor=""),P(!0),W.current=!0;const ve=me=>{me.target===U.current&&me.animationName&&(U.current&&G.current&&U.current.removeEventListener("animationend",G.current),G.current=null,W.current&&(W.current=!1,t()),P(!1))};U.current&&(G.current=ve,U.current.addEventListener("animationend",ve))},[t,he.color,l]),_e=(B,ue,ve)=>{var me,Ee;if(B){if(ce.type==="click"&&ce.switch==="image")ce.repeat==="close"&&f===n.length-1?ge():(me=y.current)==null||me.go("+1");else if(ce.type==="click"&&ce.switch==="50/50"){const be=B.getBoundingClientRect(),k=ue-be.left,re=ve-be.top,te=be.width,z=be.height;let le;N.direction==="horiz"?le=k<te/2?"-1":"+1":le=re<z/2?"-1":"+1",(Ee=y.current)==null||Ee.go(le)}}},Ce=B=>{if(j.current){j.current=!1;return}const ue=n[f],ve=(ue==null?void 0:ue.image.objectFit)==="cover";let me,Ee;if("changedTouches"in B&&B.changedTouches.length>0)me=B.changedTouches[0].clientX,Ee=B.changedTouches[0].clientY;else if("clientX"in B)me=B.clientX,Ee=B.clientY;else return;let be;if(ve&&F.current){const k=$s(F.current);be=me>=k.left&&me<=k.right&&Ee>=k.top&&Ee<=k.bottom}else{const k=F.current?dr(F.current):null;if(!k){B.target===B.currentTarget&&ge();return}be=me>=k.x&&me<=k.x+k.width&&Ee>=k.y&&Ee<=k.y+k.height}be?_e(F.current,me,Ee):ge()},Me=B=>{const ue=B.target;(ue.classList.contains(ze.thumbsWrapper)||ue.classList.contains(ze.thumbsContainer))&&Ce(B)};a.useEffect(()=>{if(!e)return;const B=ue=>{var ve,me;if(ue.key==="Escape"){ge();return}if(ue.key==="ArrowRight"){R(Ee=>(Ee+1)%Math.max(n.length,1)),(ve=y.current)==null||ve.go("+1");return}ue.key==="ArrowLeft"&&(R(Ee=>(Ee-1+Math.max(n.length,1))%Math.max(n.length,1)),(me=y.current)==null||me.go("-1"))};return window.addEventListener("keydown",B),()=>{window.removeEventListener("keydown",B)}},[e,ge,n.length]),a.useEffect(()=>{if(e){if(R(0),I(ue=>ue+1),W.current=!1,P(!1),M(!1),A({}),!de)return;const B=new CustomEvent("page-overlay",{detail:{itemId:de}});window.dispatchEvent(B)}return()=>{U.current&&G.current&&(U.current.removeEventListener("animationend",G.current),G.current=null),M(!1)}},[e,de]),a.useEffect(()=>{S.current!==null&&S.current!==N.type&&I(B=>B+1),S.current=N.type},[N.type]),a.useEffect(()=>{if(!e)return;const B=document.body.style.overflow,ue=window.matchMedia("(max-width: 768px)").matches,ve=Cs(he.color);document.body.style.overflow="hidden",M(!1);const me=be=>{be.target===U.current&&!W.current&&be.animationName&&(ue&&!l&&ve>.9&&(document.body.style.backgroundColor=he.color),M(!0),U.current&&J.current&&U.current.removeEventListener("animationend",J.current),J.current=null)};U.current&&(J.current=me,U.current.addEventListener("animationend",me));const Ee=be=>{const k=be.target;k&&(k.closest(`.${ze.thumbsWrapper}`)||k.closest(`.${ze.thumbsContainer}`))||N.type!=="slide"&&be.preventDefault()};return document.addEventListener("touchmove",Ee,{passive:!1}),()=>{document.body.style.overflow=B,document.removeEventListener("touchmove",Ee),U.current&&J.current&&(U.current.removeEventListener("animationend",J.current),J.current=null),M(!1)}},[e,l,he.color,N.type]),a.useEffect(()=>{if(!e)return;const B=ue=>{var me,Ee;if(W.current){ue.stopPropagation();return}if(j.current){j.current=!1;return}const ve=ue.target;if(!(ve&&(ve.closest(`.${ze.thumbsContainer}`)||ve.closest(`.${ze.thumbItem}`)||ve.closest(`.${ze.arrow}`)||ve.closest(`.${ze.closeButton}`)||ve.closest(`.${ze.caption}`)))){if(N.type==="slide"&&ce.type==="drag"&&((Ee=(me=y.current)==null?void 0:me.splide)!=null&&Ee.root)){const be=y.current.splide.root;if(ve&&(be.contains(ve)||be===ve))return}if(ue.touches.length===0&&ue.changedTouches.length>0){const be=n[f],k=(be==null?void 0:be.image.objectFit)==="cover",re=ue.changedTouches[0];let te;if(k&&F.current){const z=$s(F.current);te=re.clientX>=z.left&&re.clientX<=z.right&&re.clientY>=z.top&&re.clientY<=z.bottom}else{const z=F.current?dr(F.current):null;if(!z)return;te=re.clientX>=z.x&&re.clientX<=z.x+z.width&&re.clientY>=z.y&&re.clientY<=z.y+z.height}if(!te){ue.stopPropagation(),W.current=!0;const z=le=>{le.stopPropagation(),le.preventDefault(),document.removeEventListener("click",z,!0)};document.addEventListener("click",z,!0),ge()}}}};return document.addEventListener("touchend",B,{passive:!0}),()=>{document.removeEventListener("touchend",B)}},[e,ge,f,n]);const fe=(N.type==="scale"||N.type==="fade")&&N.direction==="vert"&&ce.type==="drag";a.useEffect(()=>{var le,Re;if(!e||!fe||!((Re=(le=y.current)==null?void 0:le.splide)!=null&&Re.root))return;const B=y.current.splide.root,ue=30,ve=(ae,_)=>{if(D.current){const Ne=Math.abs(ae-D.current.x),Fe=Math.abs(_-D.current.y);(Ne>0||Fe>0)&&(j.current=!0)}},me=ae=>{D.current&&(ae.preventDefault(),ve(ae.clientX,ae.clientY))},Ee=ae=>{D.current&&ae.touches.length>0&&(ae.preventDefault(),ve(ae.touches[0].clientX,ae.touches[0].clientY))},be=(ae,_)=>{if(!D.current||!y.current){D.current=null;return}const Ne=Math.abs(ae-D.current.x),Fe=Math.abs(_-D.current.y);Fe>ue&&Fe>Ne&&y.current.go(_<D.current.y?"+1":"-1"),D.current=null},k=ae=>{D.current&&be(ae.clientX,ae.clientY),document.removeEventListener("pointerup",k),document.removeEventListener("pointercancel",k),document.removeEventListener("pointermove",me)},re=ae=>{if(D.current){if(ae.changedTouches.length>0){const _=ae.changedTouches[0];be(_.clientX,_.clientY)}document.removeEventListener("touchend",re),document.removeEventListener("touchcancel",re),document.removeEventListener("touchmove",Ee)}},te=ae=>{D.current={x:ae.clientX,y:ae.clientY},j.current=!1,document.addEventListener("pointermove",me,{passive:!1}),document.addEventListener("pointerup",k),document.addEventListener("pointercancel",k)},z=ae=>{ae.touches.length>0&&(D.current={x:ae.touches[0].clientX,y:ae.touches[0].clientY},j.current=!1,document.addEventListener("touchmove",Ee,{passive:!1}),document.addEventListener("touchend",re),document.addEventListener("touchcancel",re))};return B.addEventListener("pointerdown",te),B.addEventListener("touchstart",z),()=>{B.removeEventListener("pointerdown",te),B.removeEventListener("touchstart",z),document.removeEventListener("pointermove",me),document.removeEventListener("pointerup",k),document.removeEventListener("pointercancel",k),document.removeEventListener("touchmove",Ee),document.removeEventListener("touchend",re),document.removeEventListener("touchcancel",re),D.current=null,j.current=!1}},[e,fe,L]);const ye={backgroundColor:he.color,backdropFilter:`blur(${he.blur}px)`,animationDuration:`${parseInt(Z.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:U,className:dt(ze.background,Y?oe:se,{[ze.editor]:l},{[ze.hidden]:!e}),style:{...ye,...V&&!l&&!Y?{position:"absolute"}:{}}}),r.jsxs("div",{ref:l?U:null,className:dt(ze.contentStyle,Y?q:Te,{[ze.editor]:l},{[ze.hidden]:!e}),style:{animationDuration:`${parseInt(Z.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[r.jsx(qa,{onMove:B=>R(B.index),ref:y,className:ze.lightboxSplide,options:{arrows:!1,speed:N.duration?parseInt(N.duration):500,direction:N.direction==="horiz"||N.type==="fade"||N.type==="scale"?"ltr":"ttb",pagination:!1,drag:ce.type==="drag"&&!fe,perPage:1,width:"100%",height:"100%",type:N.type==="fade"||N.type==="scale"?"fade":"loop",padding:0,rewind:ce.repeat!=="close",start:0},style:{"--splide-speed":N.duration},children:n.map((B,ue)=>{const ve=_o(we.position,we.offset,l),me=`${x.scalingValue(we.padding.top,l)} ${x.scalingValue(we.padding.right,l)} ${x.scalingValue(we.padding.bottom,l)} ${x.scalingValue(we.padding.left,l)}`,Ee=N.type==="scale"?(()=>{const{transform:be,...k}=ve;return{...k,position:"absolute",padding:me,boxSizing:"border-box","--position-transform":be||"none"}})():{...ve,position:"absolute",padding:me,boxSizing:"border-box"};return r.jsx(Ua,{children:r.jsx("div",{className:ze.imgWrapper,onClick:Ce,children:r.jsx("img",{ref:ue===f?F:null,className:dt(ze.imageStyle,{[ze.contain]:B.image.objectFit==="contain",[ze.cover]:B.image.objectFit==="cover",[ze.scaleSlide]:N.type==="scale"}),src:B.image.url,alt:B.image.name??"",style:{...Ee,pointerEvents:B.image.objectFit==="contain"?"none":"auto"}})})},ue)})},L),b.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:dt(ze.arrow,{[ze.arrowVertical]:N.direction==="vert"}),style:{color:b.color,"--arrow-hover-color":b.hover},children:r.jsxs("button",{className:ze.arrowInner,style:{transform:`translate(${x.scalingValue(b.offset.x,l)}, ${x.scalingValue(b.offset.y*(N.direction==="horiz"?1:-1),l)}) scale(${b.scale}) rotate(${N.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var B;return(B=y.current)==null?void 0:B.go("-1")},"aria-label":"Previous",children:[b.arrowsImgUrl&&r.jsx(on,{url:b.arrowsImgUrl,fill:b.color,hoverFill:b.hover,className:dt(ze.arrowImg,ze.mirror)}),!b.arrowsImgUrl&&r.jsx(Ts,{color:b.color,className:dt(ze.arrowIcon,ze.arrowImg,ze.mirror)})]})}),r.jsx("div",{className:dt(ze.arrow,ze.nextArrow,{[ze.arrowVertical]:N.direction==="vert"}),style:{color:b.color,"--arrow-hover-color":b.hover},children:r.jsxs("button",{className:ze.arrowInner,style:{transform:`translate(${x.scalingValue(b.offset.x*(N.direction==="horiz"?-1:1),l)}, ${x.scalingValue(b.offset.y,l)}) scale(${b.scale}) rotate(${N.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var B;return(B=y.current)==null?void 0:B.go("+1")},"aria-label":"Next",children:[b.arrowsImgUrl&&r.jsx(on,{url:b.arrowsImgUrl,fill:b.color,hoverFill:b.hover,className:ze.arrowImg}),!b.arrowsImgUrl&&r.jsx(Ts,{color:b.color,className:dt(ze.arrowIcon,ze.arrowImg)})]})})]}),he.closeIconUrl&&(()=>{const B=_o(he.closeIconAlign,he.closeIconOffset,l),ue=`scale(${he.closeIconScale})`,ve=B.transform?`${B.transform} ${ue}`:ue;return r.jsx("button",{className:ze.closeButton,style:{...B,transform:ve},onClick:ge,"aria-label":"Close lightbox",children:r.jsx(on,{url:he.closeIconUrl,fill:he.closeIconColor??"#000000",hoverFill:he.closeIconHover??"#cccccc"})})})(),Q&&Q.isActive&&i.imageCaption&&((Se=n[f])==null?void 0:Se.imageCaption)&&r.jsx("div",{className:ze.caption,style:{..._o(Q.alignment,Q.offset,l),fontFamily:Lr(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":x.scalingValue(c.width,l),letterSpacing:x.scalingValue(p,l),wordSpacing:x.scalingValue(v,l),textAlign:w,fontSize:x.scalingValue(T.fontSize,l),lineHeight:x.scalingValue(T.lineHeight,l),textTransform:g.textTransform??"none",textDecoration:g.textDecoration??"none",fontVariant:g.fontVariant??"normal",color:$},onClick:B=>B.stopPropagation(),children:r.jsx("div",{"data-styles":"imageCaption",className:ze.captionTextInner,style:{"--link-color":Q.linkColor,"--link-hover-color":Q.linkHoverColor},children:r.jsx(hi,{content:n[f].imageCaption})})}),pe.isActive&&(()=>{const[B,ue]=pe.position.split("-"),ve=N.direction==="horiz"?`${B}-left`:pe.position,me=_o(ve,pe.offset,l),Ee=()=>{if(N.direction==="horiz"){if(ue==="left")return"flex-start";if(ue==="center")return"center";if(ue==="right")return"flex-end"}else{if(B==="top")return"flex-start";if(B==="middle")return"center";if(B==="bottom")return"flex-end"}return"flex-start"};return r.jsx("div",{ref:O,className:ze.thumbsWrapper,onClick:be=>Me(be),style:{position:l?"absolute":"fixed",...me,...N.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:r.jsx("div",{className:dt(ze.thumbsContainer,{[ze.thumbsContainerVertical]:N.direction==="vert",[ze.thumbsAlignStart]:pe.align==="start",[ze.thumbsAlignCenter]:pe.align==="center",[ze.thumbsAlignEnd]:pe.align==="end"}),style:{gap:x.scalingValue(pe.grid.gap,l),justifyContent:E?"flex-start":Ee()},children:n.map((be,k)=>{const re=k===f,te=C[k],le=pe.grid.size*(re?pe.activeState.scale:1),Re=()=>{if(pe.fit!=="fit")return{};if(!te)return N.direction==="horiz"?{height:x.scalingValue(le,l)}:{width:x.scalingValue(le,l)};const ae=te.width/te.height;if(N.direction==="horiz"){const _=le,Ne=_*ae;return{width:x.scalingValue(Ne,l),height:x.scalingValue(_,l)}}else{const _=le,Ne=_/ae;return{width:x.scalingValue(_,l),height:x.scalingValue(Ne,l)}}};return r.jsx("button",{className:ze.thumbItem,style:{...N.direction==="horiz"&&pe.fit!=="fit"?{height:x.scalingValue(le,l)}:{},...N.direction==="vert"&&pe.fit!=="fit"?{width:x.scalingValue(le,l)}:{},...pe.fit==="cover"?{width:x.scalingValue(le,l),height:x.scalingValue(le,l)}:{},...Re(),transition:re?"all 0.25s ease-out":"none",opacity:re?pe.activeState.opacity/100:pe.opacity/100,"--thumb-hover":pe.activeState.opacity/100},onClick:ae=>{var _;ae.stopPropagation(),R(k),(_=y.current)==null||_.go(k)},onMouseEnter:()=>{var ae;pe.triggers==="hov"&&((ae=y.current)==null||ae.go(k))},children:r.jsx("img",{src:be.image.url,alt:be.image.name??"",onLoad:ae=>{const _=ae.currentTarget;_.naturalWidth&&_.naturalHeight&&A(Ne=>({...Ne,[k]:{width:_.naturalWidth,height:_.naturalHeight}}))},style:{objectFit:pe.fit==="cover"?"cover":"contain",...pe.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...pe.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${be.image.name}-${k}`)})})})})()]})]}),document.getElementById(s))};function Ts({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:Vp,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 No(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Up(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 Kp({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:s}){const l=!!n,d=i&&t||!t,{prefix:c}=
|
|
158
|
+
`}function Kp({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:s}){const l=!!n,d=i&&t||!t,{prefix:c}=x.useScopedStyles(),{type:u="A",fieldsToShow:p=2,fields:w=[],buttonLabel:v,gap:T,fieldsGap:g,buttonCorners:$,buttonStroke:f,buttonPadding:R,isButtonFullWidth:L,inputCorners:I,inputStroke:Y,inputPadding:P,inputColor:V,inputTextColor:M,inputBorderColor:C,placeholderColor:A,buttonColor:y,buttonTextColor:S,buttonBorderColor:F,labelTextColor:W,successColor:U,errorColor:G,fontFamily:J,inputFontSettings:D,inputFontSize:j,inputLineHeight:O,inputLetterSpacing:E,inputWordSpacing:K,inputTextAppearance:Z,buttonFontSettings:ce,buttonFontSize:N,buttonLineHeight:pe,buttonLetterSpacing:b,buttonWordSpacing:he,buttonTextAppearance:Q,labelFontSettings:we,labelFontSize:Te,labelLineHeight:se,labelLetterSpacing:oe,labelWordSpacing:q,labelTextAppearance:de,statusFontSettings:ge,statusFontSize:_e,statusLineHeight:Ce,statusLetterSpacing:Me,statusWordSpacing:fe,statusTextAppearance:ye,successMessage:Se,errorMessage:B,stateOverrides:ue}=e,ve=u==="B",me=w.slice(0,Math.min(p,w.length)),Ee={fontSettings:{fontFamily:J,fontWeight:(D==null?void 0:D.fontWeight)??400,fontStyle:(D==null?void 0:D.fontStyle)??"normal"},fontSize:j??.01,lineHeight:O,letterSpacing:E??0,wordSpacing:K??0,textAppearance:Z,color:M},be=nn(zt(Ee,t)),k=x.scalingValue(Y??0,t),re=x.scalingValue((O??j??.01)+((P==null?void 0:P.top)??0)+((P==null?void 0:P.bottom)??0)+(u==="C"?Y??0:(Y??0)*2),t),te={...be,borderStyle:"solid",borderRadius:u==="C"?0:x.scalingValue(I??0,t),...u==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:k,borderLeftWidth:0}:{borderWidth:k},paddingTop:x.scalingValue((P==null?void 0:P.top)??0,t),paddingRight:x.scalingValue((P==null?void 0:P.right)??0,t),paddingBottom:x.scalingValue((P==null?void 0:P.bottom)??0,t),paddingLeft:x.scalingValue((P==null?void 0:P.left)??0,t),height:re,minHeight:re},z={fontSettings:{fontFamily:J,fontWeight:(ce==null?void 0:ce.fontWeight)??400,fontStyle:(ce==null?void 0:ce.fontStyle)??"normal"},fontSize:N??.01,lineHeight:pe,letterSpacing:b??0,wordSpacing:he??0,textAppearance:Q,color:S},le=nn(zt(z,t)),Re=x.scalingValue(f??0,t),ae={fontSettings:{fontFamily:J,fontWeight:(we==null?void 0:we.fontWeight)??400,fontStyle:(we==null?void 0:we.fontStyle)??"normal"},fontSize:Te??.01,lineHeight:se,letterSpacing:oe??0,wordSpacing:q??0,textAppearance:de,color:W},_=zt(ae,t),Ne={fontSettings:{fontFamily:J,fontWeight:(ge==null?void 0:ge.fontWeight)??400,fontStyle:(ge==null?void 0:ge.fontStyle)??"normal"},fontSize:_e??.01,lineHeight:Ce,letterSpacing:Me??0,wordSpacing:fe??0,textAppearance:ye,color:U},Fe=nn(zt(Ne,t)),et=x.buildColorVars(c,{inputColor:V,inputTextColor:M,inputBorderColor:C,placeholderColor:A!=null&&A.trim()?A:"#cccccc",buttonColor:y,buttonTextColor:S,buttonBorderColor:F,labelTextColor:W,successColor:U,errorColor:G},Xp,Yp,ue),[Ke,Ie]=a.useState(()=>Object.fromEntries(me.map(nt=>[nt.name,""]))),[ee,ne]=a.useState("idle"),[He,st]=a.useState(null),Be=s==="success"?"success":s==="error"?"error":ee,Oe=s==="error"?B:He,je=s==="filled",qe=a.useMemo(()=>{if(!je)return Ke;let nt=null;for(const Ve of me)(Ke[Ve.name]??"").trim().length>0||(nt=nt??{...Ke},nt[Ve.name]="Filled");return nt??Ke},[Ke,je,me]),tt=Be==="error"?x.getFormFieldValidationError(me,qe):null,St=`${s&&s!=="default"?`${c}-state-${s}`:""}`.trim(),lt=o==null?void 0:o.submitUrl,pt=(nt,Ve)=>{Ie(De=>({...De,[nt]:Ve}))},Mt=async nt=>{if(nt.preventDefault(),!d)return;const Ve=Object.fromEntries(me.map(vt=>{var bt;return[vt.name,((bt=Ke[vt.name])==null?void 0:bt.trim())??""]}).filter(([,vt])=>vt));if(!lt){ne("error"),st("No integrations were found for this form.");return}if(Object.keys(Ve).length===0)return;const De=x.getFormFieldValidationError(me,Ke);if(De){ne("error"),st(De);return}ne("submitting"),st(null);try{const vt=await fetch(lt,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ve)});if(!vt.ok){const bt=await vt.text();throw new Error(bt||`Request failed: ${vt.status}`)}ne("success"),Ie(Object.fromEntries(me.map(bt=>[bt.name,""])))}catch(vt){ne("error"),st(vt instanceof Error?vt.message:"Something went wrong")}};return r.jsxs("div",{className:`${c}-wrapper ${c}-type-${u} ${St}`.trim(),style:et,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Up(c)}}),r.jsxs("form",{onSubmit:Mt,className:`${c}-form`,children:[r.jsx("div",{className:`${c}-fields`,children:me.map((nt,Ve)=>r.jsxs(a.Fragment,{children:[Ve>0&&r.jsx("div",{"data-controls":l?"fieldsGap":void 0,className:l?`${c}-control`:void 0,style:{height:x.scalingValue(g??0,t)}}),r.jsxs("div",{className:`${c}-field-group${ve?` ${c}-labeled`:""}`,children:[ve&&r.jsx("span",{className:`${c}-field-label`,style:_?{..._,lineHeight:_.fontSize}:void 0,children:nt.label||nt.name}),nt.type==="textarea"?r.jsx("textarea",{name:nt.name,autoComplete:"off",value:qe[nt.name]??"",onChange:De=>pt(nt.name,De.target.value),placeholder:nt.placeholder,className:`${c}-input`,style:te,rows:1,"data-filled":je||(qe[nt.name]??"").trim().length>0,"data-field-type":"textarea"}):r.jsx("input",{type:nt.type==="phone"?"tel":nt.type==="email"?"email":"text",name:nt.name,autoComplete:"off",value:qe[nt.name]??"",onChange:De=>pt(nt.name,De.target.value),placeholder:nt.placeholder,required:nt.isRequired??nt.type==="email",className:`${c}-input`,style:te,"data-filled":je||(qe[nt.name]??"").trim().length>0})]})]},Ve))}),r.jsx("div",{"data-controls":l?"gap":void 0,className:l?`${c}-control`:void 0,style:{height:x.scalingValue(T??0,t)}}),r.jsx("div",{className:`${c}-overlay-anchor`,children:r.jsx("button",{type:d?"submit":"button",className:`${c}-button`,style:{borderStyle:"solid",borderRadius:x.scalingValue($??0,t),borderWidth:Re,paddingTop:x.scalingValue((R==null?void 0:R.top)??0,t),paddingRight:x.scalingValue((R==null?void 0:R.right)??0,t),paddingBottom:x.scalingValue((R==null?void 0:R.bottom)??0,t),paddingLeft:x.scalingValue((R==null?void 0:R.left)??0,t),pointerEvents:d?"auto":void 0,...le,...L?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:r.jsx("span",{className:`${c}-overlay-anchor`,style:L?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:ee==="submitting"?"...":v})})})]}),Be==="success"&&r.jsx("p",{className:`${c}-success`,style:{...Fe},children:Se}),Be==="error"&&r.jsx("p",{className:`${c}-error`,style:{...Fe},role:"alert",children:tt??Oe??B})]})}const Xp={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"},Yp=["hover","focus","filled","success","error"],Zp=`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: ${Oo(14)};
|
|
981
981
|
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
982
982
|
}
|
|
983
|
-
`}const im=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:s}=
|
|
983
|
+
`}const im=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:s}=x.useScopedStyles(),l=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:c,buttonLabel:u,fieldsToShow:p=1,fontFamily:w,inputFontSettings:v,inputFontSize:T,inputLineHeight:g,inputLetterSpacing:$,inputWordSpacing:f,inputTextAppearance:R,buttonFontSettings:L,buttonFontSize:I,buttonLineHeight:Y,buttonLetterSpacing:P,buttonWordSpacing:V,buttonTextAppearance:M,statusFontSettings:C,statusFontSize:A,statusLineHeight:y,statusLetterSpacing:S,statusWordSpacing:F,statusTextAppearance:W,iconMaxWidth:U,minHeight:G,corners:J,stroke:D,stateOverrides:j,inputPadding:O,buttonPadding:E,successMessage:K="Thanks for subscribing!",errorMessage:Z="Please, fill all required fields."}=e,ce=d.slice(0,Math.min(p,d.length)),[N,pe]=a.useState(()=>Object.fromEntries(ce.map(ae=>[ae.name,""]))),[b,he]=a.useState("idle"),[Q,we]=a.useState(null),Te=o==="success"?"success":o==="error"?"error":b,se=o==="error"?Z:Q,oe=o==="filled",q=a.useMemo(()=>{if(!oe)return N;let ae=null;for(const _ of ce)(N[_.name]??"").trim().length>0||(ae=ae??{...N},ae[_.name]="Filled");return ae??N},[oe,N,ce]),de=Te==="error"?x.getFormFieldValidationError(ce,q):null,ge=o&&o!=="default"?`${s}-state-${o}`:"",_e=ce.some(ae=>(q[ae.name]??"").trim().length>0),Ce=ge!==`${s}-state-filled`&&_e?`${s}-state-filled`:"",Me=`${ge} ${Ce}`.trim(),fe=i==null?void 0:i.submitUrl,ye=u??"",Se=(c==null?void 0:c.icon)??"",B=(c==null?void 0:c.mode)==="On",ue=ye||"Submit",ve={fontSettings:{fontFamily:w,fontWeight:(v==null?void 0:v.fontWeight)??400,fontStyle:(v==null?void 0:v.fontStyle)??"normal"},fontSize:T??.01,lineHeight:g,letterSpacing:$??0,wordSpacing:f??0,textAppearance:R,color:e.inputTextColor??"#111111"},me={fontSettings:{fontFamily:w,fontWeight:(L==null?void 0:L.fontWeight)??400,fontStyle:(L==null?void 0:L.fontStyle)??"normal"},fontSize:I??.01,lineHeight:Y,letterSpacing:P??0,wordSpacing:V??0,textAppearance:M,color:e.buttonTextColor??"#ffffff"},Ee={fontSettings:{fontFamily:w,fontWeight:(C==null?void 0:C.fontWeight)??400,fontStyle:(C==null?void 0:C.fontStyle)??"normal"},fontSize:A??.01,lineHeight:y,letterSpacing:S??0,wordSpacing:F??0,textAppearance:W,color:e.successColor??"#22c55e"},be=nn(zt(ve,t)),k=nn(zt(me,t)),re=nn(zt(Ee,t)),te=x.buildColorVars(s,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(ve==null?void 0:ve.color)??"#111111",buttonTextColor:e.buttonTextColor??(me==null?void 0:me.color)??"#ffffff"},om,rm,j),z={borderRadius:x.scalingValue(J,t),borderWidth:x.scalingValue(D,t),borderStyle:"solid"},le={borderLeftWidth:x.scalingValue(D,t)},Re=async ae=>{if(ae.preventDefault(),!l)return;const _=Object.fromEntries(ce.map(Fe=>{var et;return[Fe.name,((et=N[Fe.name])==null?void 0:et.trim())??""]}).filter(([,Fe])=>Fe));if(!fe){he("error"),we("No integrations were found for this form.");return}if(Object.keys(_).length===0)return;const Ne=x.getFormFieldValidationError(ce,N);if(Ne){he("error"),we(Ne);return}he("submitting"),we(null);try{const Fe=await fetch(fe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(_)});if(!Fe.ok){const et=await Fe.text();throw new Error(et||`Request failed: ${Fe.status}`)}he("success"),pe(Object.fromEntries(ce.map(et=>[et.name,""])))}catch(Fe){he("error"),we(Fe instanceof Error?Fe.message:"Something went wrong")}};return r.jsxs("div",{className:`${s}-wrapper ${Me}`.trim(),style:te,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:nm(s)}}),r.jsxs("form",{onSubmit:Re,className:`${s}-form`,style:{...z,height:x.scalingValue(G,t),minHeight:x.scalingValue(G,t)},children:[r.jsx("div",{className:`${s}-inputWrap ${s}-overlayAnchor`,style:{flex:1,minWidth:0},children:ce.map(ae=>r.jsx("input",{type:ae.type==="email"?"email":ae.type==="phone"?"tel":"text",name:ae.name,autoComplete:"off",value:q[ae.name]??"",onChange:_=>pe(Ne=>({...Ne,[ae.name]:_.target.value})),placeholder:ae.placeholder,required:ae.isRequired??ae.type==="email",className:`${s}-input`,style:{...be,paddingRight:x.scalingValue(O.right,t),paddingLeft:x.scalingValue(O.left,t),paddingTop:x.scalingValue(O.top,t),paddingBottom:x.scalingValue(O.bottom,t)}},ae.name))}),r.jsx("div",{className:`${s}-overlayAnchor`,children:r.jsx("button",{type:l?"submit":"button",className:`${s}-submitBtn`,"aria-label":ue,style:{...k,...le,paddingRight:x.scalingValue(E.right,t),paddingLeft:x.scalingValue(E.left,t),paddingTop:x.scalingValue(E.top,t),paddingBottom:x.scalingValue(E.bottom,t),pointerEvents:l?"auto":void 0},children:b==="submitting"?"...":B?Se&&r.jsx(on,{url:Se,className:`${s}-submitBtnIcon`,style:{maxWidth:x.scalingValue(U??0,t)},fill:`var(--${s}-button-text-color)`,hoverFill:`var(--${s}-button-text-color)`}):ye})})]}),Te==="success"&&r.jsx("p",{className:`${s}-success`,style:{...re},children:K}),Te==="error"&&r.jsx("p",{className:`${s}-error`,style:{...re},role:"alert",children:de??se??Z})]})},om={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"},rm=["hover","focus","filled","success","error"],am=`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';
|
|
@@ -1557,7 +1557,7 @@ const COLOR_VAR_MAP: Record<OnelinerColorKeys, string> = {
|
|
|
1557
1557
|
};
|
|
1558
1558
|
|
|
1559
1559
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
1560
|
-
`,sm="data:image/svg+xml,"+encodeURIComponent('<svg width="23px" height="20px" viewBox="0 0 23 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Newsletter" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Tutorials-pop-up-Copy-12" transform="translate(-43, -687)" fill="#FFFFFF" fill-rule="nonzero"><path d="M66,697 C66,697.552285 65.5522847,698 65,698 L44,698 C43.4477153,698 43,697.552285 43,697 C43,696.447715 43.4477153,696 44,696 L65,696 C65.5522847,696 66,696.447715 66,697 Z M55.6689647,687.256706 L65.6689647,696.256706 C66.1103451,696.653948 66.1103451,697.346052 65.6689647,697.743294 L55.6689647,706.743294 C55.2584547,707.112753 54.6261649,707.079475 54.2567059,706.668965 C53.8872468,706.258455 53.9205252,705.626165 54.3310353,705.256706 L63.5051529,697 L54.3310353,688.743294 C53.9205252,688.373835 53.8872468,687.741545 54.2567059,687.331035 C54.6261649,686.920525 55.2584547,686.887247 55.6689647,687.256706 Z" id="Combined-Shape"></path></g></g></svg>'),lm=[{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."}],Dr={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},cm=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],dm={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"common-numeric-input"},min:1,max:3},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},buttonIcon:{type:"object",scope:"common",title:"Button Icon",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},iconMaxWidth:{type:"number",scope:"common",title:"Icon Max Width",display:{type:"full-width-input"},min:0,max:1},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputPadding:{type:"object",scope:"layout",title:"Input Padding",display:{type:"padding-controls"}},buttonPadding:{type:"object",scope:"layout",title:"Button Padding",display:{type:"padding-controls"}},minHeight:{type:"number",scope:"layout",title:"min Height",display:{type:"numeric-input"},min:0,max:200},corners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input"},min:0,max:100},stroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},strokeColor:{type:"string",scope:"common",title:"Stroke All",display:{type:"palette-color-picker"}},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},stateOverrides:{type:"object",scope:"common"},inputFontSettings:{...Dr.fontSettings,scope:"common",title:"Input"},inputFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},inputLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},inputLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},inputWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},inputTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},buttonFontSettings:{...Dr.fontSettings,scope:"common",title:"Button"},buttonFontSize:{type:"number",scope:"layout",title:"Button Font Size",display:{type:"font-size"}},buttonLineHeight:{type:"number",scope:"layout",title:"Button Line Height",display:{type:"line-height-input"}},buttonLetterSpacing:{type:"number",scope:"layout",title:"Button Letter Spacing",display:{type:"letter-spacing-input"}},buttonWordSpacing:{type:"number",scope:"layout",title:"Button Word Spacing",display:{type:"word-spacing-input"}},buttonTextAppearance:{type:"object",scope:"layout",title:"Button Text Appearance",display:{type:"text-appearance"}},statusFontSettings:{...Dr.fontSettings,scope:"common",title:"Success/Error"},statusFontSize:{type:"number",scope:"layout",title:"Success/Error Font Size",display:{type:"font-size"}},statusLineHeight:{type:"number",scope:"layout",title:"Success/Error Line Height",display:{type:"line-height-input"}},statusLetterSpacing:{type:"number",scope:"layout",title:"Success/Error Letter Spacing",display:{type:"letter-spacing-input"}},statusWordSpacing:{type:"number",scope:"layout",title:"Success/Error Word Spacing",display:{type:"word-spacing-input"}},statusTextAppearance:{type:"object",scope:"layout",title:"Success/Error Text Appearance",display:{type:"text-appearance"}}},defaults:{fields:lm,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:sm},fontFamily:"Arial",strokeColor:"#000000",inputColor:"#ffffff",inputTextColor:"#0A00F8",placeholderColor:"#000000",buttonColor:"#000000",buttonTextColor:"#ffffff",errorColor:"#ef4444",successColor:"#22c55e",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields.",stateOverrides:{hover:{buttonColor:"#33A2F2"}},inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{minHeight:.1,iconMaxWidth:.1,stroke:.001,corners:.0053,buttonPadding:{top:.02,right:.04,bottom:.02,left:.04},inputPadding:{top:.01,right:.03,bottom:.01,left:.03},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},t:{minHeight:.0651,iconMaxWidth:.1,stroke:.001,corners:.0026,buttonPadding:{top:.02604,right:.02604,bottom:.02604,left:.02604},inputPadding:{top:.02604,right:.02604,bottom:.02604,left:.0182},inputFontSize:.0208,inputLineHeight:.02604,buttonFontSize:.0208,buttonLineHeight:.02604,statusFontSize:.0208,statusLineHeight:.02604},d:{minHeight:.028,iconMaxWidth:.028,stroke:.001,corners:.0027,buttonPadding:{right:.0175,left:.0175,top:.005,bottom:.004},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.009,buttonLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSettings.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSize.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLineHeight.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLetterSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonWordSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonTextAppearance.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"Off"},then:{name:"properties.iconMaxWidth.display.visible",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["fieldsToShow","minHeight"]},{type:"row",items:["corners","stroke"]},{type:"row",title:"",items:["inputPadding","buttonPadding"]},{type:"row",title:"",items:["buttonIcon"]},"iconMaxWidth"]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["__componentName__","fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...cm],panelIds:["general","typeStyle"],stateItems:{default:["strokeColor","placeholderColor","inputColor","buttonTextColor","buttonColor"],hover:["strokeColor","inputColor","buttonTextColor","buttonColor"],focus:["strokeColor","inputTextColor","buttonTextColor","buttonColor"],filled:["strokeColor","inputColor","inputTextColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},um={element:im,id:"oneliner-form",name:"Newsletter Single Line",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Single_Line.png"},defaultSize:{d:{width:400},t:{width:500},m:{width:340}},assetsPaths:{content:[],parameters:[{path:"buttonIcon.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",statusFontSettings:"fontFamily"},schema:dm,sourceCode:am};function pm(e,t){const n=t>0?`${t}px`:"0px";return`
|
|
1560
|
+
`,sm="data:image/svg+xml,"+encodeURIComponent('<svg width="23px" height="20px" viewBox="0 0 23 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Newsletter" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Tutorials-pop-up-Copy-12" transform="translate(-43, -687)" fill="#FFFFFF" fill-rule="nonzero"><path d="M66,697 C66,697.552285 65.5522847,698 65,698 L44,698 C43.4477153,698 43,697.552285 43,697 C43,696.447715 43.4477153,696 44,696 L65,696 C65.5522847,696 66,696.447715 66,697 Z M55.6689647,687.256706 L65.6689647,696.256706 C66.1103451,696.653948 66.1103451,697.346052 65.6689647,697.743294 L55.6689647,706.743294 C55.2584547,707.112753 54.6261649,707.079475 54.2567059,706.668965 C53.8872468,706.258455 53.9205252,705.626165 54.3310353,705.256706 L63.5051529,697 L54.3310353,688.743294 C53.9205252,688.373835 53.8872468,687.741545 54.2567059,687.331035 C54.6261649,686.920525 55.2584547,686.887247 55.6689647,687.256706 Z" id="Combined-Shape"></path></g></g></svg>'),lm=[{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."}],jr={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},cm=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],dm={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"common-numeric-input"},min:1,max:3},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},buttonIcon:{type:"object",scope:"common",title:"Button Icon",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},iconMaxWidth:{type:"number",scope:"common",title:"Icon Max Width",display:{type:"full-width-input"},min:0,max:1},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputPadding:{type:"object",scope:"layout",title:"Input Padding",display:{type:"padding-controls"}},buttonPadding:{type:"object",scope:"layout",title:"Button Padding",display:{type:"padding-controls"}},minHeight:{type:"number",scope:"layout",title:"min Height",display:{type:"numeric-input"},min:0,max:200},corners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input"},min:0,max:100},stroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},strokeColor:{type:"string",scope:"common",title:"Stroke All",display:{type:"palette-color-picker"}},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},stateOverrides:{type:"object",scope:"common"},inputFontSettings:{...jr.fontSettings,scope:"common",title:"Input"},inputFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},inputLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},inputLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},inputWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},inputTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},buttonFontSettings:{...jr.fontSettings,scope:"common",title:"Button"},buttonFontSize:{type:"number",scope:"layout",title:"Button Font Size",display:{type:"font-size"}},buttonLineHeight:{type:"number",scope:"layout",title:"Button Line Height",display:{type:"line-height-input"}},buttonLetterSpacing:{type:"number",scope:"layout",title:"Button Letter Spacing",display:{type:"letter-spacing-input"}},buttonWordSpacing:{type:"number",scope:"layout",title:"Button Word Spacing",display:{type:"word-spacing-input"}},buttonTextAppearance:{type:"object",scope:"layout",title:"Button Text Appearance",display:{type:"text-appearance"}},statusFontSettings:{...jr.fontSettings,scope:"common",title:"Success/Error"},statusFontSize:{type:"number",scope:"layout",title:"Success/Error Font Size",display:{type:"font-size"}},statusLineHeight:{type:"number",scope:"layout",title:"Success/Error Line Height",display:{type:"line-height-input"}},statusLetterSpacing:{type:"number",scope:"layout",title:"Success/Error Letter Spacing",display:{type:"letter-spacing-input"}},statusWordSpacing:{type:"number",scope:"layout",title:"Success/Error Word Spacing",display:{type:"word-spacing-input"}},statusTextAppearance:{type:"object",scope:"layout",title:"Success/Error Text Appearance",display:{type:"text-appearance"}}},defaults:{fields:lm,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:sm},fontFamily:"Arial",strokeColor:"#000000",inputColor:"#ffffff",inputTextColor:"#0A00F8",placeholderColor:"#000000",buttonColor:"#000000",buttonTextColor:"#ffffff",errorColor:"#ef4444",successColor:"#22c55e",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields.",stateOverrides:{hover:{buttonColor:"#33A2F2"}},inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{minHeight:.1,iconMaxWidth:.1,stroke:.001,corners:.0053,buttonPadding:{top:.02,right:.04,bottom:.02,left:.04},inputPadding:{top:.01,right:.03,bottom:.01,left:.03},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},t:{minHeight:.0651,iconMaxWidth:.1,stroke:.001,corners:.0026,buttonPadding:{top:.02604,right:.02604,bottom:.02604,left:.02604},inputPadding:{top:.02604,right:.02604,bottom:.02604,left:.0182},inputFontSize:.0208,inputLineHeight:.02604,buttonFontSize:.0208,buttonLineHeight:.02604,statusFontSize:.0208,statusLineHeight:.02604},d:{minHeight:.028,iconMaxWidth:.028,stroke:.001,corners:.0027,buttonPadding:{right:.0175,left:.0175,top:.005,bottom:.004},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.009,buttonLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSettings.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSize.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLineHeight.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLetterSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonWordSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonTextAppearance.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"Off"},then:{name:"properties.iconMaxWidth.display.visible",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["fieldsToShow","minHeight"]},{type:"row",items:["corners","stroke"]},{type:"row",title:"",items:["inputPadding","buttonPadding"]},{type:"row",title:"",items:["buttonIcon"]},"iconMaxWidth"]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["__componentName__","fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...cm],panelIds:["general","typeStyle"],stateItems:{default:["strokeColor","placeholderColor","inputColor","buttonTextColor","buttonColor"],hover:["strokeColor","inputColor","buttonTextColor","buttonColor"],focus:["strokeColor","inputTextColor","buttonTextColor","buttonColor"],filled:["strokeColor","inputColor","inputTextColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},um={element:im,id:"oneliner-form",name:"Newsletter Single Line",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Single_Line.png"},defaultSize:{d:{width:400},t:{width:500},m:{width:340}},assetsPaths:{content:[],parameters:[{path:"buttonIcon.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",statusFontSettings:"fontFamily"},schema:dm,sourceCode:am};function pm(e,t){const n=t>0?`${t}px`:"0px";return`
|
|
1561
1561
|
.${e}-marquee-wrapper {
|
|
1562
1562
|
overflow: hidden;
|
|
1563
1563
|
width: 100%;
|
|
@@ -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 mm=30,gm=20,zr=3,hm=12,fm=32,ym=3,vm=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")},xm=(e,t)=>Array.from({length:t},()=>e).flat(),bm=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},lc=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),
|
|
1692
|
+
`}const mm=30,gm=20,zr=3,hm=12,fm=32,ym=3,vm=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")},xm=(e,t)=>Array.from({length:t},()=>e).flat(),bm=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},lc=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),Ls=(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=lc(d);return c<=0?0:c+s*Math.max(0,t-1)},wm=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=lc(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},Sm=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},$m=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>Sm(i,e))},Cm=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??"")},Tm=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,Lm=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,cornerRadius:s,imageHoverClass:l,isFirstSet:d,scaled:c,onFirstSetImageDone:u})=>{var F,W,U,G;const p=a.useRef(null),w=!!((F=e.image)!=null&&F.url&&Cm(e.image));a.useLayoutEffect(()=>{d&&Tm(p.current)&&(u==null||u())},[d,(W=e.image)==null?void 0:W.url,u]);const v=n.display==="cover",T=n.ratioValue??"1:1",g=n.reversed??!1,[$,f]=T.split(":").map(Number),I=(g?f:$)/(g?$:f),Y=i/I,P=Y>o?o:Y,V=Y>o?o*I:i,M=c(V),C=c(P),A={borderRadius:c(s)},y=v?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover",...A}:{pointerEvents:"auto",display:"block",width:"auto",height:"auto",maxWidth:c(i),maxHeight:c(o),objectFit:"contain",...A},S=((U=e.image)==null?void 0:U.url)&&(w?r.jsx("video",{ref:J=>{p.current=J},src:e.image.url,style:y,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto",onLoadedData:d?u:void 0,onError:d?u:void 0}):r.jsx("img",{ref:J=>{p.current=J},src:e.image.url,alt:((G=e.image)==null?void 0:G.name)??"",style:y,onLoad:d?u:void 0,onError:d?u:void 0}));return r.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...v?{width:M}:{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,...v?{width:M,height:C,overflow:"hidden",...A}:{width:"max-content",maxWidth:c(i),height:c(o)}},children:S&&e.link?r.jsx("a",{href:e.link,target:"_self",rel:"noopener noreferrer",className:dt(`${t}-marquee-link`,!v&&`${t}-marquee-link-contain`),children:S}):S})})},Im=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:s}=x.useScopedStyles(),[l,d]=a.useState(0),c=l>0?Math.round(l):0,u=a.useMemo(()=>pm(s,c),[s,c]),{speed:p,direction:w,pauseOnHover:v,gap:T,imageMaxWidth:g,imageMaxHeight:$,hoverEffect:f,cornerRadius:R=0}=e,L=a.useMemo(()=>bm(e.imageFit),[e.imageFit]),I=(t==null?void 0:t.length)??0,Y=!!o,P=!n||!!i,V=P&&f!=="off"&&f!=="randomize"?`${s}-image-hover-${f}`:void 0,M=n?!!i:!0,A=((t==null?void 0:t.length)??0)>0&&(M||!!n),y=Math.max(0,p)*mm,S=Ce=>x.scalingValue(Ce,n??!1),F=a.useRef(null),W=a.useRef(null),U=a.useRef(null),[G,J]=a.useState(0),D=M&&v==="on",[j,O]=a.useState(!1),[E,K]=a.useState({}),Z=a.useRef(E);Z.current=E;const ce=a.useRef(null),N=a.useRef(0),pe=a.useRef(null),b=a.useMemo(()=>(t??[]).map(Ce=>{var Me;return((Me=Ce.image)==null?void 0:Me.url)??""}).join("\0"),[t]),[he,Q]=a.useState(zr),we=a.useMemo(()=>{const Ce=t??[];return Ce.length===0||!(M||!!n)?Ce:xm(Ce,he)},[t,M,he,n]),Te=a.useMemo(()=>(t??[]).filter(Ce=>{var Me;return!!((Me=Ce.image)!=null&&Me.url)}).length,[t]),se=A?ym:1;a.useLayoutEffect(()=>{N.current=0,K({}),ce.current=null,Q(zr),d(0)},[b]),a.useEffect(()=>{if(!P||f!=="randomize")return;const Ce=F.current;if(!Ce)return;const Me=B=>{K(ue=>{const ve=Array.from(B).filter(Ee=>Ee in ue&&!$m(Ce,Ee));if(ve.length===0)return ue;const me={...ue};return ve.forEach(Ee=>{delete me[Ee]}),me})},fe=new IntersectionObserver(B=>{const ue=new Set;for(const ve of B){const me=ve.target.dataset.marqueeItemIndex,Ee=me!==void 0?Number(me):NaN;Number.isNaN(Ee)||ue.add(Ee)}ue.size>0&&Me(ue)},{root:Ce,threshold:0});Object.keys(E).forEach(B=>{const ue=Number(B);Ce.querySelectorAll(`[data-marquee-item-index="${ue}"]`).forEach(ve=>fe.observe(ve))});const ye={current:0},Se=()=>{const B=Object.keys(Z.current);B.length!==0&&(Me(B.map(Number)),ye.current=requestAnimationFrame(Se))};return Object.keys(Z.current).length>0&&(ye.current=requestAnimationFrame(Se)),()=>{cancelAnimationFrame(ye.current),fe.disconnect()}},[f,E,P]),a.useLayoutEffect(()=>{if(!A)return;const Ce=F.current,Me=U.current;if(!Ce||!Me)return;const fe={current:0},ye=()=>{const ue=Ce.getBoundingClientRect().width||Ce.offsetWidth,ve=wm(Me),me=ce.current,Ee=typeof me=="number"&&Math.abs(me-ve)<=.25;ce.current=ve;let be=he,k=0;if((M||n)&&I>0&&ue>0){const z=Ls(Me,I);if(z>=fm){k=z;const le=Math.min(hm,Math.max(zr,Math.ceil(ue/z)+1));be=le,le!==he&&Q(le)}}const te=be!==he&&k>0?k*be:ve>0?ve:k>0?k*be:(()=>{const z=Ls(Me,I);return z>0?z*be:0})();te>0?d(z=>z<=0?te:!Ee||Math.round(z)===Math.round(te)?z:te):!Ee&&l<=0&&(cancelAnimationFrame(fe.current),fe.current=requestAnimationFrame(ye))},Se=()=>{cancelAnimationFrame(fe.current),fe.current=requestAnimationFrame(ye)};pe.current=Se,Se();const B=new ResizeObserver(Se);return B.observe(Ce),B.observe(Me),()=>{pe.current=null,cancelAnimationFrame(fe.current),B.disconnect()}},[M,A,l,b,he,I,n]),a.useLayoutEffect(()=>{if(!A||c<=0)return;const Ce=W.current;Ce&&vm(Ce)},[A,c,w,y]),a.useLayoutEffect(()=>{if(!A||l<=0){J(0);return}const Ce=W.current,Me=U.current;if(!Ce||!Me)return;const fe=()=>{const Se=Ce.offsetHeight||Ce.getBoundingClientRect().height,B=Array.from(Me.children).reduce((ve,me)=>Math.max(ve,me.offsetHeight||me.getBoundingClientRect().height),0),ue=Se>0?Se:B;J(ue>0?ue:0)};fe();const ye=new ResizeObserver(fe);return ye.observe(Ce),ye.observe(Me),()=>ye.disconnect()},[A,se,we,n,T,g,$,l,L,E]),a.useLayoutEffect(()=>{if(!n||!Y||!A||typeof window>"u")return;const Ce=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame(Ce)},[n,Y,A,w,l,G,T,we]);const oe=()=>{D&&O(!0)},q=()=>{D&&O(!1)},de=a.useCallback(()=>{var Ce;N.current=Math.min(Te,N.current+1),(Ce=pe.current)==null||Ce.call(pe)},[Te]),ge=a.useCallback((Ce,Me)=>{K(fe=>{const ye=fe[Ce]??Me,Se=(t??[]).filter(ue=>ue!==ye);if(Se.length===0)return fe;const B=Se[Math.floor(Math.random()*Se.length)];return{...fe,[Ce]:B}})},[t]),_e=(Ce,Me,fe,ye)=>{const Se=P&&f==="randomize"&&L.display==="cover"?E[fe]??Ce:Ce,B=`max(${S(T)}, ${gm}px)`,ue=`calc(-0.5 * (${B} + ${S(T)}))`;return r.jsxs("div",{className:`${s}-marquee-card`,"data-marquee-item-index":fe,onMouseEnter:P&&f==="randomize"&&L.display==="cover"?()=>ge(fe,Ce):void 0,children:[r.jsx(Lm,{item:Se,prefix:s,imageFit:L,imageMaxWidth:g,imageMaxHeight:$,cornerRadius:R,imageHoverClass:V,isEditor:n,isFirstSet:ye,scaled:S,onFirstSetImageDone:de}),Y&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${s}-gap-control`,style:{position:"absolute",top:0,right:ue,width:B,height:"100%"}})]},`${Me}-${fe}`)};if(A){const Ce=M?D&&j?"paused":"running":"paused",Me=c>0&&y>0?c/y*1e3:0,fe=`${Math.max(0,Me)/1e3}s`;return r.jsxs("div",{ref:F,className:dt(`${s}-wrapper`,`${s}-marquee-wrapper`),"aria-label":"Marquee",style:G>0?{height:G}:void 0,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),r.jsx("div",{ref:W,className:`${s}-marquee-track`,"data-direction":w,onMouseEnter:oe,onMouseLeave:q,style:{WebkitAnimationDuration:fe,animationDuration:fe,WebkitAnimationPlayState:Ce,animationPlayState:Ce},children:Array.from({length:se},(ye,Se)=>r.jsx("div",{ref:Se===0?U:void 0,className:dt(`${s}-marquee-row`,`${s}-marquee-set`),style:{gap:S(T),paddingRight:S(T)},"aria-hidden":Se>0,children:we.map((B,ue)=>_e(B,Se,ue,Se===0&&ue<I))},`set-${Se}`))})]})}return r.jsxs("div",{ref:F,className:`${s}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),r.jsx("div",{className:dt(`${s}-marquee-row`,`${s}-marquee-static`),style:{gap:S(T),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((Ce,Me)=>_e(Ce,0,Me))},"marquee-static")]})},Rm=`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 Pm=30,
|
|
2564
|
+
`}const Pm=30,Is=2,Am=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")},Fm=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:s}=x.useScopedStyles(),{align:l,speed:d,direction:c,pauseOnHover:u,gap:p,cardWidth:w,corners:v,stroke:T,strokeColor:g,bgColor:$,padding:f,logoMarginTop:R,logoWidth:L,logoHeight:I,captionMarginTop:Y}=e,P=!!o,V=((t==null?void 0:t.length)??0)>0,M=d>0&&(!n||i),C=V&&(M||n),A=Math.max(0,d)*Pm,y=k=>x.scalingValue(k,n??!1),S=a.useRef(null),F=a.useRef(null),W=a.useRef(null),[U,G]=a.useState(0),[J,D]=a.useState(0),j=J>0?J:0,O=a.useMemo(()=>km(s,j),[s,j]),[E,K]=a.useState(0),Z=M&&u==="on",[ce,N]=a.useState(!1),pe=a.useRef(null),[b,he]=a.useState(0),[Q,we]=a.useState(0),Te=a.useRef(null),se=k=>{var te,z,le,Re,ae;return{fontSettings:{fontFamily:(e==null?void 0:e[`${k}FontFamily`])??"Arial",fontWeight:((te=e==null?void 0:e[`${k}FontSettings`])==null?void 0:te.fontWeight)??400,fontStyle:((z=e==null?void 0:e[`${k}FontSettings`])==null?void 0:z.fontStyle)??"normal"},textAppearance:{textTransform:((le=e==null?void 0:e[`${k}TextAppearance`])==null?void 0:le.textTransform)??"none",textDecoration:((Re=e==null?void 0:e[`${k}TextAppearance`])==null?void 0:Re.textDecoration)??"none",fontVariant:((ae=e==null?void 0:e[`${k}TextAppearance`])==null?void 0:ae.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${k}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${k}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${k}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${k}LineHeight`])??.01,color:(e==null?void 0:e[`${k}Color`])??"#000000"}},oe=se("text"),q=se("caption"),de=a.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(k=>{var re,te;return(((re=k.text)==null?void 0:re.length)??0)>0||(((te=k.caption)==null?void 0:te.length)??0)>0}),[t]),ge=a.useMemo(()=>!C||(t==null?void 0:t.length)===0?1:J<=0||U<=0?Is:Math.max(Is,Math.ceil(U/J)+1),[C,t==null?void 0:t.length,J,U]);a.useLayoutEffect(()=>{if(!C)return;const k=S.current,re=W.current;if(!k||!re)return;let te=0;const z=()=>{const ae=k.getBoundingClientRect().width,_=re.getBoundingClientRect().width,Ne=Te.current,Fe=typeof Ne=="number"&&Math.abs(Ne-_)<=.25;if(Te.current=_,G(ae),typeof _=="number"&&_>0&&J<=0){D(_);return}Fe&&_!==J?D(_):!Fe&&J<=0&&(cancelAnimationFrame(te),te=requestAnimationFrame(z))},le=()=>{cancelAnimationFrame(te),te=requestAnimationFrame(z)};le();const Re=new ResizeObserver(le);return Re.observe(k),Re.observe(re),()=>{cancelAnimationFrame(te),Re.disconnect()}},[M,C,J]);const _e=j>0&&A>0?j/A*1e3:0,Ce=`${Math.max(0,_e)/1e3}s`;a.useLayoutEffect(()=>{if(!C||j<=0)return;const k=F.current;k&&Am(k)},[C,j,c]),a.useLayoutEffect(()=>{if(!C){K(0);return}const k=W.current,re=F.current;if(!k||!re)return;const te=()=>{let le=0;for(let Re=0;Re<k.children.length;Re++){const _=k.children[Re].firstElementChild;_&&(le=Math.max(le,_.offsetHeight))}le<=0&&(le=re.offsetHeight),K(le>0?le:0)};te();const z=new ResizeObserver(te);return z.observe(k),z.observe(re),()=>{z.disconnect()}},[C,ge,t,n,p,w,f,T,v,L,I,b,Q]);const Me=()=>{Z&&N(!0)},fe=()=>{Z&&N(!1)},ye=a.useMemo(()=>{switch(l){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[l]),Se=a.useMemo(()=>{switch(l){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[l]),B=a.useCallback((k,re,te,z)=>r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ye,width:"100%"},children:[r.jsx("div",{"data-controls":P?z==null?void 0:z.controlsName:void 0,"data-controls-axis":P?"y":void 0,className:P?`${s}-control`:void 0,style:{height:y((z==null?void 0:z.marginTop)??0)}}),r.jsx("div",{...z!=null&&z.dataMeasureKind?{"data-testimonial-measure":z.dataMeasureKind}:{},style:{...zt(k,n),textAlign:Se,pointerEvents:"auto",...typeof(z==null?void 0:z.minHeightPx)=="number"&&z.minHeightPx>0?{minHeight:z.minHeightPx}:{}},children:r.jsx(hi,{content:re})})]},te),[ye,Se,n,P,s,y]),ue=a.useCallback((k,re,te)=>{var z,le,Re;return r.jsxs("div",{style:{padding:`${y(f.top)} ${y(f.right)} ${y(f.bottom)} ${y(f.left)}`,width:y(w+T*2),height:"100%",borderRadius:y(v),border:`${y(T)} solid ${g}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[r.jsx("div",{className:`${s}-cover`,style:{background:$}}),r.jsxs("div",{className:`${s}-elements-overlay`,style:{alignItems:ye,textAlign:Se},children:[k.text&&B(oe,k.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:ye,width:"100%"},children:[r.jsx("div",{"data-controls":P&&!(te!=null&&te.dataMeasureAttrs)?"logoMarginTop":void 0,className:P&&!(te!=null&&te.dataMeasureAttrs)?`${s}-control`:void 0,style:{height:y(R)}}),r.jsx("div",{style:{width:y(L),height:y(I)},children:((z=k.logo)==null?void 0:z.url)&&r.jsx("img",{src:k.logo.url,alt:((le=k.logo)==null?void 0:le.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((Re=k.logo)==null?void 0:Re.objectFit)||"contain"}})})]}),k.caption&&B(q,k.caption,"caption",{...te!=null&&te.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:Y,...te!=null&&te.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(te==null?void 0:te.captionMinHeightPx)=="number"&&te.captionMinHeightPx>0?{minHeightPx:te.captionMinHeightPx}:{}})]})]},re)},[$,Y,q,w,v,I,R,L,ye,Se,f.bottom,f.left,f.right,f.top,B,T,g,oe,n,P,s]),ve=a.useCallback(k=>{he(k.maxTextPx),we(k.maxCaptionPx)},[]);a.useLayoutEffect(()=>{if(!de){ve({maxTextPx:0,maxCaptionPx:0});return}const k=pe.current;if(!k)return;const re=()=>{x.readTestimonialTextMeasure(k,ve)};re();const te=new ResizeObserver(re);return te.observe(k),()=>{te.disconnect()}},[de,ve,t,ue]);const me=de?{textMinHeightPx:b,captionMinHeightPx:Q}:void 0,Ee=de?r.jsx("div",{ref:pe,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((k,re)=>ue(k,`measure-${re}`,{dataMeasureAttrs:!0}))}):null,be=(k,re)=>r.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[ue(k,`card-${re}`,me),P&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${y(p)})`,width:y(p),height:"100%",pointerEvents:"auto",zIndex:2}})]},re);if(C){const k=M?Z&&ce?"paused":"running":"paused";return r.jsxs("div",{ref:S,className:dt(`${s}-wrapper`,`${s}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...E>0?{height:E}:{}},children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:O}}),Ee,r.jsx("div",{ref:F,className:`${s}-marquee-track`,"data-direction":c,onMouseEnter:Me,onMouseLeave:fe,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:k,WebkitAnimationPlayState:k},children:Array.from({length:ge},(re,te)=>r.jsx("div",{ref:te===0?W:void 0,className:`${s}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:y(p),paddingRight:y(p)},"aria-hidden":te>0,children:t==null?void 0:t.map((z,le)=>be(z,`${te}-${le}`))},`set-${te}`))})]})}return r.jsxs("div",{className:`${s}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:O}}),Ee,r.jsx("div",{style:{gap:y(p),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((k,re)=>be(k,re))})]})},Wm=`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';
|
|
@@ -3192,7 +3192,7 @@ type TestimonialsSettings = {
|
|
|
3192
3192
|
logoHeight: number;
|
|
3193
3193
|
captionMarginTop: number;
|
|
3194
3194
|
};
|
|
3195
|
-
`,
|
|
3195
|
+
`,Rs={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},_m={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:8},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle-cycle",enum:["on","off"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,max:200,display:{type:"range-control"}},align:{type:"string",title:"Alignment",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},cardWidth:{type:"number",scope:"layout",title:"width",min:0,max:400,display:{type:"numeric-input"}},corners:{type:"number",scope:"layout",title:"Corners",min:0,max:100,display:{type:"numeric-input"}},stroke:{type:"number",scope:"layout",title:"Stroke",min:0,max:10,display:{type:"numeric-input"}},strokeColor:{type:"string",scope:"common",title:"Stroke Card",display:{type:"palette-color-picker",visible:!0}},bgColor:{title:"BG card",type:"string",scope:"common",display:{type:"palette-color-picker"}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},logoMarginTop:{type:"number",scope:"layout",title:"Logo margin top",min:0,max:200,display:{type:"range-control"}},logoWidth:{type:"number",scope:"layout",title:"width",min:0,max:200,display:{type:"numeric-input"}},logoHeight:{type:"number",scope:"layout",title:"height",min:0,max:200,display:{type:"numeric-input"}},textColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},captionColor:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:200,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...Rs.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},captionFontSize:{type:"number",scope:"layout",title:"Caption Font Size",display:{type:"font-size"}},captionLineHeight:{type:"number",scope:"layout",title:"Caption Line Height",display:{type:"line-height-input"}},captionLetterSpacing:{type:"number",scope:"layout",title:"Caption Letter Spacing",display:{type:"letter-spacing-input"}},captionWordSpacing:{type:"number",scope:"layout",title:"Caption Word Spacing",display:{type:"word-spacing-input"}},captionTextAppearance:{type:"object",scope:"layout",title:"Caption Text Appearance",display:{type:"text-appearance"}},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...Rs.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Text Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Text Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Text Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Text Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Text Appearance",display:{type:"text-appearance"}}},defaults:{direction:"left",pauseOnHover:"off",strokeColor:"#000000",bgColor:"rgba(255, 255, 255, 0.81)",textColor:"#000000",captionColor:"#000000",captionFontFamily:"Goudy Bookletter 1911",captionFontSettings:{fontWeight:400,fontStyle:"normal"},align:"center",captionLetterSpacing:0,captionWordSpacing:0,captionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{speed:.55,gap:.04,cardWidth:.8,corners:.02,stroke:.001,padding:{top:.053,right:.026,bottom:.053,left:.026},logoMarginTop:.18,logoWidth:.21,logoHeight:.21,captionMarginTop:.056,textFontSize:.069,textLineHeight:.093,captionFontSize:.053,captionLineHeight:.069},t:{speed:1.64,gap:.02,cardWidth:.44,corners:.005,stroke:.001,padding:{top:.01,right:.01,bottom:.065,left:.01},logoMarginTop:.1,logoWidth:.052,logoHeight:.052,captionMarginTop:.005,textFontSize:.035,textLineHeight:.04,captionFontSize:.023,captionLineHeight:.029},d:{speed:1.64,gap:.02,cardWidth:.15,corners:.005,stroke:.001,padding:{top:.01,right:.01,bottom:.01,left:.01},logoMarginTop:.048,logoWidth:.055,logoHeight:.027,captionMarginTop:.005,textFontSize:.012,textLineHeight:.013,captionFontSize:.01,captionLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}}],layout:["__componentName__","speed","direction","pauseOnHover","gap","cardWidth","corners","stroke","strokeColor","bgColor","padding","logoMarginTop","logoWidth","logoHeight","captionMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["align","direction"]},{type:"row",items:["speed","pauseOnHover"]},{type:"row",title:"Card",items:[{type:"group",title:"",items:["cardWidth","corners"]},{type:"group",title:"",items:["stroke","padding"]}]},{type:"row",title:"Image Container",items:["logoWidth","logoHeight"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Text",items:["textFontFamily","textFontSettings",{type:"group",title:"",items:["text",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}]},{type:"group",title:"Caption",items:["captionFontFamily","captionFontSettings",{type:"group",title:"",items:["caption",{type:"row",items:["captionFontSize","captionLineHeight","captionLetterSpacing","captionWordSpacing"]},"captionTextAppearance"]}]}]}],paletteBookmark:{items:["bgColor","strokeColor","textColor","captionColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{logo:{type:"object",label:"Image",display:{type:"media-input"}},text:{placeholder:"Add Text...",label:"Text",display:{type:"rich-text"}},caption:{placeholder:"Add Caption...",label:"Caption",display:{type:"rich-text"}}}},default:[{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/julia.png",name:""},text:[{type:"paragraph",children:[{text:"This website is a great tool for designers and developers. The ease of creating animations here is mesmerizing. Bravo to the creators of this product!"}]}],caption:[{type:"paragraph",children:[{text:"Julia Smith,"}]},{type:"paragraph",children:[{text:"Freelance Designer"}]}]},{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/mark.png",name:""},text:[{type:"paragraph",children:[{text:"This is super cool. The on onboarding terminal style animation brings me back to what made the Internet simple and fun."}]}],caption:[{type:"paragraph",children:[{text:"Mark Travis,"}]},{type:"paragraph",children:[{text:"Architect @ United Architects"}]}]},{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/pia.png",name:""},text:[{type:"paragraph",children:[{text:"Great tool for someone who wants to quickly and easily build a site that has fancy scrolling animations. Totally addictive!"}]}],caption:[{type:"paragraph",children:[{text:"Pia,"}]},{type:"paragraph",children:[{text:"Media Buyer"}]}]}]}},Nm={element:Fm,id:"testimonials",name:"Eliana",category:"testimonials",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Testimonials_Grid.mp4"},defaultSize:{d:{width:"100%",height:320}},schema:_m,sourceCode:Wm,assetsPaths:{content:[{path:"logo.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function Hm(e){return`
|
|
3196
3196
|
.${e}-container {
|
|
3197
3197
|
position: relative;
|
|
3198
3198
|
overflow-x: clip;
|
|
@@ -3316,7 +3316,7 @@ type TestimonialsSettings = {
|
|
|
3316
3316
|
width: 100%;
|
|
3317
3317
|
height: 100%;
|
|
3318
3318
|
}
|
|
3319
|
-
`}const Om=3e3,
|
|
3319
|
+
`}const Om=3e3,Dm=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:s}=x.useScopedStyles(),l=t||[],{speed:d,align:c,width:u,imageMarginTop:p,textMarginTop:w,captionMarginTop:v,imageWidth:T,imageHeight:g,controlsWidth:$,controlsColor:f,controlsHoverColor:R}=e,L=d>0&&(!n||!!i),[I,Y]=a.useState(0),[P,V]=a.useState(null),[M,C]=a.useState(!1),A=a.useRef(null),y=a.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),S=a.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);a.useEffect(()=>{Y(0),V(null),C(!1)},[l.length]);const F=l[I],W=P===null?null:l[P],U=se=>{var q,de,ge,_e,Ce;return{fontSettings:{fontFamily:(e==null?void 0:e[`${se}FontFamily`])??"Arial",fontWeight:((q=e==null?void 0:e[`${se}FontSettings`])==null?void 0:q.fontWeight)??400,fontStyle:((de=e==null?void 0:e[`${se}FontSettings`])==null?void 0:de.fontStyle)??"normal"},textAppearance:{textTransform:((ge=e==null?void 0:e[`${se}TextAppearance`])==null?void 0:ge.textTransform)??"none",textDecoration:((_e=e==null?void 0:e[`${se}TextAppearance`])==null?void 0:_e.textDecoration)??"none",fontVariant:((Ce=e==null?void 0:e[`${se}TextAppearance`])==null?void 0:Ce.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${se}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${se}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${se}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${se}WordSpacing`])??0,color:(e==null?void 0:e[`${se}Color`])??"#000000"}},G=U("text"),J=U("caption"),D=l.length>1&&l.some(se=>{var oe,q;return(((oe=se.text)==null?void 0:oe.length)??0)>0||(((q=se.caption)==null?void 0:q.length)??0)>0}),j=a.useRef(null),[O,E]=a.useState(0),[K,Z]=a.useState(0),ce=e.controls??{mode:"Off",icon:null},N=l.length>1,pe=a.useCallback((se,oe)=>!N||oe===se?se:(A.current&&window.clearTimeout(A.current),V(se),C(!0),A.current=window.setTimeout(()=>{V(null),C(!1),A.current=null},300),oe),[N]),b=a.useCallback(()=>{N&&Y(se=>pe(se,(se-1+l.length)%l.length))},[N,pe,l.length]),he=a.useCallback(()=>{N&&Y(se=>pe(se,(se+1)%l.length))},[N,pe,l.length]);a.useEffect(()=>{if(!L||!N)return;const se=Math.max(300,Om/d),oe=window.setInterval(()=>{Y(q=>pe(q,(q+1)%l.length))},se);return()=>{window.clearInterval(oe)}},[L,N,pe,l.length,d]),a.useEffect(()=>()=>{A.current&&window.clearTimeout(A.current)},[]);const Q=(se,oe)=>{var Ce,Me,fe,ye;const q=oe==null?void 0:oe.textMinHeightPx,de=oe==null?void 0:oe.captionMinHeightPx,ge=oe==null?void 0:oe.dataMeasureAttrs,_e=o&&!(oe!=null&&oe.dataMeasureAttrs)&&!(oe!=null&&oe.hideControls);return r.jsxs(r.Fragment,{children:[se.text&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:y,width:"100%"},children:[r.jsx("div",{"data-controls":_e?"textMarginTop":void 0,className:_e?`${s}-control`:void 0,style:{height:x.scalingValue(w??0,n??!1)}}),r.jsx("div",{...ge&&{"data-testimonial-measure":"text"},style:{...zt(G,n),...q&&q>0?{minHeight:q}:{},textAlign:S,pointerEvents:"auto"},children:r.jsx(hi,{content:se.text})})]}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:y,width:"100%"},children:[r.jsx("div",{"data-controls":_e?"imageMarginTop":void 0,className:_e?`${s}-control`:void 0,style:{height:x.scalingValue(p??0,n??!1)}}),r.jsx("div",{style:{width:x.scalingValue(T??0,n??!1),height:x.scalingValue(g??0,n??!1)},children:((Ce=se.image)==null?void 0:Ce.url)&&r.jsx("img",{src:(Me=se.image)==null?void 0:Me.url,alt:((fe=se.image)==null?void 0:fe.name)??"",className:`${s}-icon`,style:{objectFit:((ye=se.image)==null?void 0:ye.objectFit)||"contain"}})})]}),se.caption&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:y,width:"100%"},children:[r.jsx("div",{"data-controls":_e?"captionMarginTop":void 0,className:_e?`${s}-control`:void 0,style:{height:x.scalingValue(v??0,n??!1)}}),r.jsx("div",{...ge?{"data-testimonial-measure":"caption"}:{},style:{...zt(J,n),...de&&de>0?{minHeight:de}:{},textAlign:S,pointerEvents:"auto"},children:r.jsx(hi,{content:se.caption})})]})]})},we=a.useCallback(se=>{E(se.maxTextPx),Z(se.maxCaptionPx)},[]);if(a.useLayoutEffect(()=>{if(!D){we({maxTextPx:0,maxCaptionPx:0});return}const se=j.current;if(!se)return;const oe=()=>{x.readTestimonialTextMeasure(se,we)};oe();const q=new ResizeObserver(oe);return q.observe(se),()=>{q.disconnect()}},[D,we,t]),!F)return r.jsx(r.Fragment,{});const Te=D?{textMinHeightPx:O,captionMinHeightPx:K}:void 0;return r.jsx(r.Fragment,{children:r.jsxs("div",{className:`${s}-container`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Hm(s)}}),r.jsxs("div",{className:`${s}-wrapper`,style:{width:x.scalingValue(u??0,n??!1),alignItems:y},children:[D&&r.jsx("div",{ref:j,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:l.map((se,oe)=>r.jsx("div",{style:{width:"100%"},children:Q(se,{dataMeasureAttrs:!0})},oe))}),r.jsxs("div",{className:`${s}-fade-stack`,children:[W&&M&&r.jsx("div",{className:dt(`${s}-fade-item-prev`,`${s}-fade-out`),children:Q(W,{...Te,hideControls:!0})}),r.jsx("div",{className:dt(`${s}-fade-item-current`,M?`${s}-fade-in`:void 0),children:Q(F,Te)})]})]}),ce.mode==="On"&&r.jsxs("div",{className:`${s}-controls`,children:[r.jsx("div",{className:`${s}-arrow`,style:{width:x.scalingValue($??.02,n??!1),height:x.scalingValue($??.02,n??!1),"--arrow-hover-color":R},children:r.jsx("button",{type:"button",className:`${s}-arrow-inner`,onClick:b,disabled:!N,"aria-label":"Previous testimonial",children:ce.icon&&r.jsx(on,{url:ce.icon,fill:f,hoverFill:R,className:dt(`${s}-arrow-img`,`${s}-mirror`)})})}),r.jsx("div",{className:dt(`${s}-arrow`,`${s}-next-arrow`),style:{width:x.scalingValue($??.02,n??!1),height:x.scalingValue($??.02,n??!1),"--arrow-hover-color":R},children:r.jsx("button",{type:"button",className:`${s}-arrow-inner`,onClick:he,disabled:!N,"aria-label":"Next testimonial",children:ce.icon&&r.jsx(on,{url:ce.icon,fill:f,hoverFill:R,className:`${s}-arrow-img`})})})]})]})})},jm=`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';
|
|
@@ -3812,7 +3812,7 @@ type TestimonialsSettings = {
|
|
|
3812
3812
|
icon?: string | null;
|
|
3813
3813
|
};
|
|
3814
3814
|
};
|
|
3815
|
-
`,zm="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 18" width="10" height="18"><path fill="#000000" fill-rule="evenodd" 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" transform="translate(5, 9) rotate(-90) translate(-5, -9)"/></svg>'),
|
|
3815
|
+
`,zm="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 18" width="10" height="18"><path fill="#000000" fill-rule="evenodd" 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" transform="translate(5, 9) rotate(-90) translate(-5, -9)"/></svg>'),Es={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Bm={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:8},align:{type:"string",scope:"common",title:"Alignment",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},width:{type:"number",scope:"layout",title:"width",min:0,max:1e3,display:{type:"numeric-input"}},imageWidth:{type:"number",scope:"layout",title:"width",min:0,max:300,display:{type:"numeric-input"}},imageHeight:{type:"number",scope:"layout",title:"height",min:0,max:300,display:{type:"numeric-input"}},imageMarginTop:{type:"number",scope:"layout",title:"Image margin top",min:0,max:200,display:{type:"range-control"}},textMarginTop:{type:"number",scope:"layout",title:"Text margin top",min:0,max:200,display:{type:"range-control"}},controls:{type:"object",scope:"common",title:"Controls",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},controlsWidth:{type:"number",scope:"layout",title:"Controls width",min:0,max:100,display:{type:"numeric-input"}},controlsColor:{type:"string",scope:"common",title:"Controls Default",display:{type:"settings-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Controls Hover",display:{type:"settings-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:200,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...Es.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},captionFontSize:{type:"number",scope:"layout",title:"Caption Font Size",display:{type:"font-size"}},captionLineHeight:{type:"number",scope:"layout",title:"Caption Line Height",display:{type:"line-height-input"}},captionLetterSpacing:{type:"number",scope:"layout",title:"Caption Letter Spacing",display:{type:"letter-spacing-input"}},captionWordSpacing:{type:"number",scope:"layout",title:"Caption Word Spacing",display:{type:"word-spacing-input"}},captionTextAppearance:{type:"object",scope:"layout",title:"Caption Text Appearance",display:{type:"text-appearance"}},captionColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Caption Default"},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...Es.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Text Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Text Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Text Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Text Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Text Appearance",display:{type:"text-appearance"}},textColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Text Default"}},defaults:{controls:{mode:"On",icon:zm},controlsColor:"#000000",controlsHoverColor:"#EABC01",align:"center",textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textColor:"#000000",captionFontFamily:"Goudy Bookletter 1911",captionFontSettings:{fontWeight:400,fontStyle:"normal"},captionLetterSpacing:0,captionWordSpacing:0,captionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},captionColor:"#000000"},layoutDefaults:{m:{speed:1,width:.69,imageMarginTop:.08,captionMarginTop:.04,textMarginTop:0,textFontSize:.069,captionFontSize:.053,textLineHeight:.093,captionLineHeight:.069,imageWidth:.21,imageHeight:.21,controlsWidth:.06},t:{speed:1,width:.65,imageMarginTop:.026,captionMarginTop:.01,textMarginTop:0,textFontSize:.035,captionFontSize:.023,textLineHeight:.04,captionLineHeight:.029,imageWidth:.05,imageHeight:.05,controlsWidth:.026},d:{speed:1,width:.35,imageMarginTop:.02,textMarginTop:0,captionMarginTop:.01,textFontSize:.016,captionFontSize:.009,textLineHeight:.018,captionLineHeight:.009,imageWidth:.027,imageHeight:.027,controlsWidth:.014}},layout:["__componentName__","speed","width","imageMarginTop","textMarginTop","captionMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["width","align"]},{type:"row",items:["controls"]},{type:"row",items:["controlsWidth","speed"]},{type:"row",title:"Image Container",items:["imageWidth","imageHeight"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Text",items:["textFontFamily","textFontSettings",{type:"group",title:"",items:["text",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}]},{type:"group",title:"Caption",items:["captionFontFamily","captionFontSettings",{type:"group",title:"",items:["caption",{type:"row",items:["captionFontSize","captionLineHeight","captionLetterSpacing","captionWordSpacing"]},"captionTextAppearance"]}]}]}],paletteBookmark:{items:["textColor","captionColor","controlsColor","controlsHoverColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"}},text:{placeholder:"Add Text...",label:"Text",display:{type:"rich-text"}},caption:{placeholder:"Add Caption...",label:"Caption",display:{type:"rich-text"}}}},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/julia.png",name:""},text:[{type:"paragraph",children:[{text:"This website is a great tool for designers and developers. The ease of creating animations here is mesmerizing. Bravo to the creators of this product!"}]}],caption:[{type:"paragraph",children:[{text:"Julia Smith,"}]},{type:"paragraph",children:[{text:"Freelance Designer"}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/mark.png",name:""},text:[{type:"paragraph",children:[{text:"This is super cool. The on onboarding terminal style animation brings me back to what made the Internet simple and fun."}]}],caption:[{type:"paragraph",children:[{text:"Mark Travis,"}]},{type:"paragraph",children:[{text:"Architect @ United Architects"}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/pia.png",name:""},text:[{type:"paragraph",children:[{text:"Great tool for someone who wants to quickly and easily build a site that has fancy scrolling animations. Totally addictive!"}]}],caption:[{type:"paragraph",children:[{text:"Pia,"}]},{type:"paragraph",children:[{text:"Media Buyer"}]}]}]}},Vm={element:Dm,id:"testimonial-single",name:"Clara",category:"testimonials",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Testimonials_Single.png"},defaultSize:{d:{width:700},t:{width:700},m:{width:334}},schema:Bm,sourceCode:jm,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function Gm(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ms(e){return((e==null?void 0:e.trim().length)??0)>0}function Br(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Vr(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:x.scalingValue((o-t)/2,i)}}function qm(e){return`
|
|
3816
3816
|
.${e}-wrapper {
|
|
3817
3817
|
display: grid;
|
|
3818
3818
|
align-items: start;
|
|
@@ -4155,7 +4155,7 @@ type TestimonialsSettings = {
|
|
|
4155
4155
|
z-index: 2;
|
|
4156
4156
|
width: 100%;
|
|
4157
4157
|
}
|
|
4158
|
-
`}const Sn=500,Um=750,Nn="cubic-bezier(0.22, 1, 0.36, 1)",Km=72,Xm=50;function Ym(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 Zm(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Jm(e){const[t]=e.media;return t!=null&&t.url?t:null}function Qm(e){return!Array.isArray(e)||e.length===0?[]:Ym(e)?e.flatMap(t=>{const n=Zm(t);if(!n)return[];const i=Jm(t);return[{displayMedia:n,lightboxMedia:i!=null&&i.url?i:null}]}):e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function Ei(e){return e.type==="video"}function eg(e){e.pause(),e.removeAttribute("src"),e.load()}function Ms({media:e,className:t,style:n,onMediaClick:i}){return Ei(e)?r.jsx("video",{src:e.url,className:t,style:{...n,cursor:i?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,onClick:i}):r.jsx("img",{src:e.url,alt:e.name,className:t,style:{...n,cursor:i?"pointer":"default"},onClick:i})}function ks(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function tg(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 ng({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:s,onMouseMove:l}){return a.useEffect(()=>{const d=n.current;if(d)return()=>{eg(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 ig({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),S=a.useRef(null),T=a.useRef(null),g=a.useRef(null),$=a.useRef(0),h=a.useRef(0),I=a.useRef("none"),R=a.useRef(!1),E=a.useRef(!1),Z=a.useRef(null),P=a.useRef(0),B=a.useRef(null),M=a.useRef(!1),C=a.useRef(null),[W,y]=a.useState(null),[x,A]=a.useState(null),[H,K]=a.useState("opening"),[G,Y]=a.useState(0),[V,D]=a.useState(0),[O,L]=a.useState(null),[U,J]=a.useState(!1),[ce,_]=a.useState(!1),[de,w]=a.useState(!1),[ge,Q]=a.useState(null),ve=a.useRef(n),Le=t[n],pe=Le?Ei(Le):!1,ae=O!==null,q=a.useCallback(Re=>{const ee=Re.currentTarget,ne=ee instanceof HTMLVideoElement?{width:ee.videoWidth,height:ee.videoHeight}:{width:ee.naturalWidth,height:ee.naturalHeight};!ne.width||!ne.height||Q(ne)},[]);a.useEffect(()=>{Z.current=x},[x]),a.useEffect(()=>{const Re=b.current;if(!Re)return;const ee=()=>A(ks(Re));ee();const ne=new ResizeObserver(ee);return ne.observe(Re),()=>ne.disconnect()},[]);const se=a.useCallback(()=>{C.current!==null&&(window.clearTimeout(C.current),C.current=null)},[]),he=a.useCallback(()=>{se(),P.current=0,B.current=null,M.current=!1,D(0),L(null),J(!1)},[se]),Pe=a.useCallback(Re=>{he(),Re===1?d():l()},[d,l,he]),Ce=a.useCallback((Re,ee)=>{var qe;const ne=((qe=Z.current)==null?void 0:qe.width)??0;se(),B.current=Re,L(Re),M.current=!0,J(!0);const Me=ee?-Re*ne:0;P.current=Me,D(Me),C.current=window.setTimeout(()=>{C.current=null,ee?Pe(Re):he()},Sn+32)},[se,Pe,he]),ke=a.useCallback(Re=>{M.current||t.length<=1||(B.current=Re,L(Re),M.current=!1,J(!1),P.current=0,D(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ce(Re,!0)})}))},[t.length,Ce]),fe=a.useCallback(()=>{const Re=S.current;if(!Re)return;const ee=ks(Re);!ee.width||!ee.height||y(ee)},[]);a.useEffect(()=>{fe();const Re=S.current;if(!Re)return;const ee=new ResizeObserver(()=>fe());return ee.observe(Re),()=>ee.disconnect()},[fe]),a.useEffect(()=>{H==="opening"&&W&&K("open")},[H,W]),a.useEffect(()=>{if(H!=="closing")return;const Re=setTimeout(()=>s(),Sn);return()=>clearTimeout(Re)},[H,s]),a.useEffect(()=>()=>{se()},[se]),a.useLayoutEffect(()=>{ve.current!==n&&(he(),Y(0),w(!1),_(!1),Q(null),$.current=0,h.current=0,I.current="none",R.current=!1,g.current=null,E.current=!1,ve.current=n)},[n,he]),a.useEffect(()=>{if(H!=="open")return;let Re=null;const ee=()=>{Re&&(document.removeEventListener("click",Re,!0),Re=null)},ne=()=>{ee(),Re=Ve=>{Ve.stopPropagation(),Ve.preventDefault(),ee()},document.addEventListener("click",Re,!0)},Me=Ve=>{const it=Ve<0?1:-1;if(Math.abs(Ve)>Xm&&t.length>1){Ce(it,!0);return}Ce(it,!1)},qe=Ve=>{if(Ve.touches.length!==1||M.current)return;const it=Ve.touches[0];E.current=!0,g.current={x:it.clientX,y:it.clientY},I.current="none",h.current=0,R.current=!1},De=Ve=>{if(!g.current||Ve.touches.length!==1||M.current)return;const it=Ve.touches[0],Qe=it.clientX-g.current.x,pt=it.clientY-g.current.y;if(I.current==="none"){if(Math.abs(Qe)<10&&Math.abs(pt)<10)return;if(Math.abs(Qe)>Math.abs(pt)){if(t.length<=1)return;I.current="horizontal"}else if(pt>0)I.current="vertical";else return}if(I.current==="horizontal"){R.current=!0,_(!0),h.current=Qe;const bt=Qe<0?1:-1;B.current!==bt&&(B.current=bt,L(bt)),P.current=Qe,D(Qe),Ve.preventDefault();return}I.current==="vertical"&&(R.current=!0,_(!0),$.current=pt,Y(pt),Ve.preventDefault())},Oe=()=>{if(!g.current)return;const Ve=I.current,it=R.current;if(it&&Ve==="horizontal")Me(h.current),ne();else if(it&&Ve==="vertical")if($.current>Km){const pt=window.innerHeight;$.current=pt,w(!0),Y(pt),K("closing")}else $.current=0,Y(0),ne();else Ve==="horizontal"&&Math.abs(h.current)>0&&(Me(h.current),ne());g.current=null,I.current="none",h.current=0,R.current=!1,_(!1)};return document.addEventListener("touchstart",qe,{passive:!0}),document.addEventListener("touchmove",De,{passive:!1}),document.addEventListener("touchend",Oe),document.addEventListener("touchcancel",Oe),()=>{document.removeEventListener("touchstart",qe),document.removeEventListener("touchmove",De),document.removeEventListener("touchend",Oe),document.removeEventListener("touchcancel",Oe),ee()}},[H,t.length,Ce]),a.useEffect(()=>{const Re=ee=>{ee.key==="Escape"&&(ee.preventDefault(),ee.stopPropagation(),H!=="closing"&&K("closing"))};return window.addEventListener("keydown",Re,!0),()=>window.removeEventListener("keydown",Re,!0)},[H]);const xe=()=>{H!=="closing"&&K("closing")},Se=H==="open",z=H==="closing",me=G>0?Math.max(0,1-G/500):1,ye=G>0?Math.max(.35,1-G/500):1,ue=W?p?W:tg(W,ge):null,Ee=Re=>{if(Re.stopPropagation(),E.current){E.current=!1;return}if(t.length<=1)return;const ee=ue??Re.currentTarget.getBoundingClientRect(),ne=Re.clientY-ee.top,Me=Math.min(52,ee.height*.2);if(!(ne>ee.height-Me)){if(Re.clientX-ee.left<ee.width/2){ke(-1);return}ke(1)}},we=Re=>{if(t.length<=1)return;const ee=ue??Re.currentTarget.getBoundingClientRect(),ne=Re.clientX-ee.left,Me=Re.clientY-ee.top,qe=Math.min(52,ee.height*.2);if(Me>ee.height-qe){Re.currentTarget.style.cursor="default";return}Re.currentTarget.style.cursor=ne<ee.width/2?"w-resize":"e-resize"},k={position:"fixed",top:x==null?void 0:x.top,left:x==null?void 0:x.left,width:x==null?void 0:x.width,height:x==null?void 0:x.height,zIndex:9998},le=p?"cover":"contain",te=V!==0||G>0?`translate(${V}px, ${G}px)`:void 0,j=ce&&!U?"none":U?`transform ${Sn}ms ${Nn}`:de?`transform ${Sn}ms ${Nn}, opacity ${Sn}ms ${Nn}`:H==="opening"||z?`opacity ${Sn}ms ${Nn}`:"none",re={...k,transform:te,opacity:G>0?ye:H==="opening"||z?0:1,transition:j,pointerEvents:"none"},Ie={position:"absolute",top:((ue==null?void 0:ue.top)??0)-((x==null?void 0:x.top)??0),left:((ue==null?void 0:ue.left)??0)-((x==null?void 0:x.left)??0),width:ue==null?void 0:ue.width,height:ue==null?void 0:ue.height,objectFit:le,pointerEvents:pe&&Se&&!ae?"auto":"none",touchAction:pe&&Se?"none":void 0},ie=(x==null?void 0:x.width)??0,F=ae?(n+O+t.length)%t.length:null,He=F!==null?t[F]:null,Ne={...k,transform:ae?`translateX(${O*ie+V}px)`:void 0,opacity:1,transition:U?`transform ${Sn}ms ${Nn}`:"none",pointerEvents:"none"},tt={position:"absolute",top:((W==null?void 0:W.top)??0)-((x==null?void 0:x.top)??0),left:((W==null?void 0:W.left)??0)-((x==null?void 0:x.left)??0),width:W==null?void 0:W.width,height:W==null?void 0:W.height,objectFit:le,pointerEvents:"none"},Ke=ue?{position:"fixed",top:ue.top,height:ue.height,width:ue.width/2,zIndex:9999}:null;return r.jsxs("div",{ref:b,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:H==="open"?"none":void 0},onClick:xe,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:Se?me:0,transition:ce?"none":`opacity ${Sn}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:S,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:Se?1:0,transition:`opacity ${Sn}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:S,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:Se?1:0,transition:`opacity ${Sn}ms ${Nn}`},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),W&&x&&He&&r.jsx("div",{style:Ne,children:Ei(He)?r.jsx("video",{src:He.url,muted:!0,playsInline:!0,preload:"auto",style:tt},`neighbor-${F}-${He.url}`):r.jsx("img",{src:He.url,alt:He.name,style:tt},`neighbor-${F}-${He.url}`)}),W&&x&&Le&&r.jsx("div",{style:re,children:pe?r.jsx(ng,{src:Le.url,phase:H,mediaRef:T,mediaStyle:Ie,onLoadedMetadata:q,onClick:Ee,onMouseMove:we},`${n}-${Le.url}`):r.jsx("img",{ref:T,src:Le.url,alt:Le.name,onLoad:q,style:Ie},`${n}-${Le.url}`)}),Se&&Ke&&t.length>1&&!pe&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...Ke,left:ue.left,cursor:"w-resize",pointerEvents:ae?"none":"auto"},onClick:Re=>{if(E.current){E.current=!1;return}Re.stopPropagation(),ke(-1)}}),r.jsx("div",{style:{...Ke,left:ue.left+ue.width/2,cursor:"e-resize",pointerEvents:ae?"none":"auto"},onClick:Re=>{if(E.current){E.current=!1;return}Re.stopPropagation(),ke(1)}})]})]})}function og(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function rg({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:s,activeEvent:l,layoutId:d,portalId:c}){const{prefix:u}=v.useScopedStyles(),{type:p="a",gridLayout:b,textBoxWidth:S=100,verticalGap:T,entriesCount:g,lightbox:$,imageDisplay:h,imageCorners:I,lightboxImageDisplay:R,slider:E,sliderTiming:Z,direction:P,transition:B,titleMarginTop:M,subtitleMarginTop:C,titleColor:W,subtitleColor:y,lightboxCounterColor:x,titleFontFamily:A,titleFontSettings:H,titleFontSize:K,titleLineHeight:G,titleLetterSpacing:Y,titleWordSpacing:V,titleTextAppearance:D,subtitleFontFamily:O,subtitleFontSettings:L,subtitleFontSize:U,subtitleLineHeight:J,subtitleLetterSpacing:ce,subtitleWordSpacing:_,subtitleTextAppearance:de,lightboxCounterFontFamily:w,lightboxCounterFontSettings:ge,lightboxCounterFontSize:Q,lightboxCounterLineHeight:ve,lightboxCounterLetterSpacing:Le,lightboxCounterWordSpacing:pe,lightboxCounterTextAppearance:ae,showText:q="always",alignEntries:se="off",align:he="top"}=e,Pe={fontSettings:{fontFamily:A,fontWeight:(H==null?void 0:H.fontWeight)??400,fontStyle:(H==null?void 0:H.fontStyle)??"normal"},fontSize:K??.01,lineHeight:G,letterSpacing:Y??0,wordSpacing:V??0,textAppearance:D,color:W},ke={...nn(zt(Pe,n))},fe={fontSettings:{fontFamily:O,fontWeight:(L==null?void 0:L.fontWeight)??400,fontStyle:(L==null?void 0:L.fontStyle)??"normal"},fontSize:U??.01,lineHeight:J,letterSpacing:ce??0,wordSpacing:_??0,textAppearance:de,color:y},Se={...nn(zt(fe,n))},z={fontSettings:{fontFamily:w,fontWeight:(ge==null?void 0:ge.fontWeight)??400,fontStyle:(ge==null?void 0:ge.fontStyle)??"normal"},fontSize:Q??.01,lineHeight:ve,letterSpacing:Le??0,wordSpacing:pe??0,textAppearance:ae,color:x},ye={...nn(zt(z,n)),...Vr(Q,ve,u,n)},ue=Br(K,G,`${u}-item-title`,`${u}-text-tight-leading`),Ee=Br(U,J,`${u}-item-subtitle`,`${u}-text-tight-leading`),we=Vr(K,G,u,n),k=Vr(U,J,u,n),le=Br(Q,ve,`${u}-lightbox-counter`,`${u}-text-tight-leading`),te=v.buildColorVars(u,{titleColor:W,subtitleColor:y,lightboxCounterColor:x},ag,sg),Ie=`${l&&l!=="default"?`${u}-state-${l}`:""}${q==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),ie=g===0?1/0:g,F=(t??[]).slice(0,ie),He=b.entryWidth??.2,Ne=(h==null?void 0:h.display)==="cover",tt=(h==null?void 0:h.ratioValue)??"1:1",Ke=(h==null?void 0:h.reversed)??!1,[Re,ee]=tt.split(":").map(Number),qe=`${Ke?ee:Re} / ${Ke?Re:ee}`,De=b.columnsCount,Oe=v.scalingValue(He??0,n),Ve=Oe,it=!Ne&&E!=="off",Qe=F.length%De||De,pt=Qe<De&&F.length>0,bt=F.length-Qe,ot=pt?Math.floor((De-Qe)/2)+1:1,ht=I?v.scalingValue(I,n):void 0,Wt={width:Ve,...Ne?{aspectRatio:qe,height:"auto",overflow:"hidden"}:{height:"auto"},...ht?{borderRadius:ht,overflow:"hidden"}:{}},dt=`${u}-item-image-wrapper${it?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),Xe=p==="d"||p==="e"||p==="f",ze=se==="on",vt=`calc(${v.scalingValue(He??0,n)} * (${S} / 100))`,wt=v.scalingValue(He*S/100,n),kt=Ne?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...ht?{borderRadius:ht}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...ht?{borderRadius:ht}:{}},[jt,tn]=a.useState("ltr"),[ln,Tt]=a.useState(0),Mt=a.useRef(null);a.useEffect(()=>{const Ze=Mt.current;if(!Ze)return;const Je=new ResizeObserver(at=>{Tt(Math.round(at[0].contentRect.width))});return Je.observe(Ze),()=>Je.disconnect()},[]);const Yt=(()=>{const Ze={...te},Je=Mt.current?getComputedStyle(Mt.current).getPropertyValue("--cntrl-article-width").trim():"";return Je&&(Ze["--cntrl-article-width"]=Je),Ze})(),[qt,Te]=a.useState(!1),[Ge,Ue]=a.useState([]),[lt,Rt]=a.useState(0),ut=$==="on"&&(!n||i),nt=(Ze,Je)=>{n&&!i||$!=="off"&&(Ue(Ze),Rt(Je),Te(!0))};a.useEffect(()=>{if(!qt||$!=="on"||typeof document>"u")return;const Ze=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Ze}},[qt,$]),a.useEffect(()=>{!n||i||Te(!1)},[n,i]);const Ut=a.useMemo(()=>qm(u),[u]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Ut}}),r.jsx("div",{style:te,children:r.jsx("div",{ref:Mt,className:`${u}-wrapper ${u}-type-${p}${ze?` ${u}-align-entries`:""} ${u}-image-align-${he} ${Ie}`.trim(),style:{gridTemplateColumns:`repeat(${De}, ${Oe})`,rowGap:ze?0:v.scalingValue(T??0,n),columnGap:v.scalingValue(b.horizontalGap??0,n),width:v.scalingValue(b.wrapperWidth??0,n),...ze?{[`--${u}-align-entries-row-gap`]:v.scalingValue(T??0,n)}:{}},children:F.map((Ze,Je)=>{var Dt;const at=Es(Ze.title),Lt=Es(Ze.subtitle),It=(((Dt=Ze.link)==null?void 0:Dt.length)??0)>0&&$==="off"?Ze.link:void 0,ft=Math.floor(Je/De)===Math.ceil(F.length/De)-1,At=pt&&Je>=bt?`${ot+(Je-bt)}`:void 0,Ot=Xe?r.jsxs("div",{className:`${u}-item-text-block`,children:[at&&r.jsx("p",{className:ue,style:{width:vt,...ke,...we},children:Ze.title}),at&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:v.scalingValue(M??0,n),width:wt}}),Lt&&r.jsx("p",{className:Ee,style:{width:vt,...Se,...k},children:Ze.subtitle}),Lt&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:v.scalingValue(C??0,n),width:wt}})]}):null,Ht=ze?r.jsxs("div",{className:`${u}-item-title-row`,children:[!Xe&&r.jsx("div",{"data-controls":o&&at?"titleMarginTop":void 0,className:o&&at?`${u}-control`:void 0,style:{height:at?v.scalingValue(M??0,n):0,width:wt}}),at&&r.jsx("p",{className:ue,style:{width:vt,...ke,...we},children:Ze.title}),Xe&&at&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:v.scalingValue(M??0,n),width:wt}})]}):null,Vt=ze?r.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!Xe&&r.jsx("div",{"data-controls":o&&Lt?"subtitleMarginTop":void 0,className:o&&Lt?`${u}-control`:void 0,style:{height:Lt?v.scalingValue(C??0,n):0,width:wt}}),Lt&&r.jsx("p",{className:Ee,style:{width:vt,...Se,...k},children:Ze.subtitle}),Xe&&Lt&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:v.scalingValue(C??0,n),width:wt}})]}):null,xt=It?r.jsxs("a",{href:It,target:"_blank",className:`${u}-item-text-link`,children:[Ht,Vt]}):r.jsxs(r.Fragment,{children:[Ht,Vt]}),Gt=Qm(Ze.gallery),Kt=Gt.filter(St=>St.lightboxMedia).map(St=>St.lightboxMedia),Xt=r.jsx("div",{className:dt,style:Wt,children:Gt.length===0?null:E==="off"?(()=>{const{displayMedia:St,lightboxMedia:f}=Gt[0],be=f?Kt.findIndex(Fe=>Fe.url===f.url):-1;return r.jsx(Ms,{media:St,className:`${u}-item-${Ei(St)?"video":"image"}`.trim(),style:kt,onMediaClick:ut&&be>=0?()=>nt(Kt,be):void 0})})():r.jsxs(r.Fragment,{children:[it&&ze&&r.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Gt.map(({displayMedia:St})=>Ei(St)?r.jsx("video",{src:St.url,muted:!0,playsInline:!0},`sizer-${St.url}`):r.jsx("img",{src:St.url,alt:""},`sizer-${St.url}`))}),r.jsx(Ga,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:Z*1e3,width:"100%",height:"100%",speed:Um,type:B==="fade"?"fade":"loop",rewind:B==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:B==="fade"?"ltr":P!=="random"?P==="horizontal"?"ltr":"ttb":jt},onMoved:St=>{if(P!=="random"||B==="fade")return;const f=Math.random()>.5?Math.random()>.5?"rtl":"ltr":"ttb";tn(f),setTimeout(()=>{St.refresh()},0)},children:Gt.map(({displayMedia:St,lightboxMedia:f},be)=>{const Fe=f?Kt.findIndex(We=>We.url===f.url):-1;return r.jsx(qa,{children:r.jsx(Ms,{media:St,className:`${u}-item-${Ei(St)?"video":"image"}`.trim(),style:kt,onMediaClick:ut&&Fe>=0?()=>nt(Kt,Fe):void 0})},be)})},`${B}-${He}-${P}-${Z}-${ln}-${d}`)]})}),Zt=Xe?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":o&&at?"titleMarginTop":void 0,className:o&&at?`${u}-control`:void 0,style:{height:at?v.scalingValue(M??0,n):0,width:wt}}),r.jsx("p",{className:ue,style:{width:vt,...ke,...we},children:Ze.title}),r.jsx("div",{"data-controls":o&&Lt?"subtitleMarginTop":void 0,className:o&&Lt?`${u}-control`:void 0,style:{height:Lt?v.scalingValue(C??0,n):0,width:wt}}),r.jsx("p",{className:Ee,style:{width:vt,...Se,...k},children:Ze.subtitle})]});return r.jsx("div",{className:`${u}-item`.trim(),style:At&&!ze?{gridColumn:At}:void 0,children:r.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${ze&&ft?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(S??0)>100?`calc(${Oe} * (${S} / 100))`:Oe,...At&&ze?{gridColumn:At}:{}},children:ze?r.jsx(r.Fragment,{children:Xe?r.jsxs(r.Fragment,{children:[xt,r.jsx("a",{href:It,target:"_blank",className:`${u}-item-image-link`,children:Xt})]}):r.jsxs(r.Fragment,{children:[r.jsx("a",{href:It,target:"_blank",className:`${u}-item-image-link`,children:Xt}),xt]})}):It?r.jsxs(r.Fragment,{children:[r.jsxs("a",{href:It,target:"_blank",className:`${u}-item-image-link`,children:[Ot,Xt]}),!Xe&&r.jsx("a",{href:It,target:"_blank",className:`${u}-item-text-link`,children:Zt})]}):r.jsxs(r.Fragment,{children:[Ot,Xt,Zt]})})},Je)})})}),(!n||i)&&qt&&typeof document<"u"&&$==="on"&&(()=>{const Ze=(c?document.getElementById(c):null)??document.body;return Yn.createPortal(r.jsx("div",{style:Yt,"data-selection":"none",children:r.jsx(ig,{prefix:u,items:Ge,index:lt,imageDisplay:og(R),isEditor:n,onClose:()=>Te(!1),onPrev:()=>Rt(Je=>(Je-1+Ge.length)%Ge.length),onNext:()=>Rt(Je=>(Je+1)%Ge.length),counterClassName:le,counterStyle:ye})}),Ze)})()]})}const ag={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},sg=["hover","focus","filled","success","error"],lg=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
4158
|
+
`}const Sn=500,Um=750,Nn="cubic-bezier(0.22, 1, 0.36, 1)",Km=72,Xm=50;function Ym(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 Zm(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Jm(e){const[t]=e.media;return t!=null&&t.url?t:null}function Qm(e){return!Array.isArray(e)||e.length===0?[]:Ym(e)?e.flatMap(t=>{const n=Zm(t);if(!n)return[];const i=Jm(t);return[{displayMedia:n,lightboxMedia:i!=null&&i.url?i:null}]}):e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function Ei(e){return e.type==="video"}function eg(e){e.pause(),e.removeAttribute("src"),e.load()}function ks({media:e,className:t,style:n,onMediaClick:i}){return Ei(e)?r.jsx("video",{src:e.url,className:t,style:{...n,cursor:i?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,onClick:i}):r.jsx("img",{src:e.url,alt:e.name,className:t,style:{...n,cursor:i?"pointer":"default"},onClick:i})}function Ps(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function tg(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 ng({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:s,onMouseMove:l}){return a.useEffect(()=>{const d=n.current;if(d)return()=>{eg(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 ig({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:s,onPrev:l,onNext:d,counterClassName:c,counterStyle:u}){const p=i==="cover",w=a.useRef(null),v=a.useRef(null),T=a.useRef(null),g=a.useRef(null),$=a.useRef(0),f=a.useRef(0),R=a.useRef("none"),L=a.useRef(!1),I=a.useRef(!1),Y=a.useRef(null),P=a.useRef(0),V=a.useRef(null),M=a.useRef(!1),C=a.useRef(null),[A,y]=a.useState(null),[S,F]=a.useState(null),[W,U]=a.useState("opening"),[G,J]=a.useState(0),[D,j]=a.useState(0),[O,E]=a.useState(null),[K,Z]=a.useState(!1),[ce,N]=a.useState(!1),[pe,b]=a.useState(!1),[he,Q]=a.useState(null),we=a.useRef(n),Te=t[n],se=Te?Ei(Te):!1,oe=O!==null,q=a.useCallback(Ie=>{const ee=Ie.currentTarget,ne=ee instanceof HTMLVideoElement?{width:ee.videoWidth,height:ee.videoHeight}:{width:ee.naturalWidth,height:ee.naturalHeight};!ne.width||!ne.height||Q(ne)},[]);a.useEffect(()=>{Y.current=S},[S]),a.useEffect(()=>{const Ie=w.current;if(!Ie)return;const ee=()=>F(Ps(Ie));ee();const ne=new ResizeObserver(ee);return ne.observe(Ie),()=>ne.disconnect()},[]);const de=a.useCallback(()=>{C.current!==null&&(window.clearTimeout(C.current),C.current=null)},[]),ge=a.useCallback(()=>{de(),P.current=0,V.current=null,M.current=!1,j(0),E(null),Z(!1)},[de]),_e=a.useCallback(Ie=>{ge(),Ie===1?d():l()},[d,l,ge]),Ce=a.useCallback((Ie,ee)=>{var st;const ne=((st=Y.current)==null?void 0:st.width)??0;de(),V.current=Ie,E(Ie),M.current=!0,Z(!0);const He=ee?-Ie*ne:0;P.current=He,j(He),C.current=window.setTimeout(()=>{C.current=null,ee?_e(Ie):ge()},Sn+32)},[de,_e,ge]),Me=a.useCallback(Ie=>{M.current||t.length<=1||(V.current=Ie,E(Ie),M.current=!1,Z(!1),P.current=0,j(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ce(Ie,!0)})}))},[t.length,Ce]),fe=a.useCallback(()=>{const Ie=v.current;if(!Ie)return;const ee=Ps(Ie);!ee.width||!ee.height||y(ee)},[]);a.useEffect(()=>{fe();const Ie=v.current;if(!Ie)return;const ee=new ResizeObserver(()=>fe());return ee.observe(Ie),()=>ee.disconnect()},[fe]),a.useEffect(()=>{W==="opening"&&A&&U("open")},[W,A]),a.useEffect(()=>{if(W!=="closing")return;const Ie=setTimeout(()=>s(),Sn);return()=>clearTimeout(Ie)},[W,s]),a.useEffect(()=>()=>{de()},[de]),a.useLayoutEffect(()=>{we.current!==n&&(ge(),J(0),b(!1),N(!1),Q(null),$.current=0,f.current=0,R.current="none",L.current=!1,g.current=null,I.current=!1,we.current=n)},[n,ge]),a.useEffect(()=>{if(W!=="open")return;let Ie=null;const ee=()=>{Ie&&(document.removeEventListener("click",Ie,!0),Ie=null)},ne=()=>{ee(),Ie=je=>{je.stopPropagation(),je.preventDefault(),ee()},document.addEventListener("click",Ie,!0)},He=je=>{const qe=je<0?1:-1;if(Math.abs(je)>Xm&&t.length>1){Ce(qe,!0);return}Ce(qe,!1)},st=je=>{if(je.touches.length!==1||M.current)return;const qe=je.touches[0];I.current=!0,g.current={x:qe.clientX,y:qe.clientY},R.current="none",f.current=0,L.current=!1},Be=je=>{if(!g.current||je.touches.length!==1||M.current)return;const qe=je.touches[0],tt=qe.clientX-g.current.x,mt=qe.clientY-g.current.y;if(R.current==="none"){if(Math.abs(tt)<10&&Math.abs(mt)<10)return;if(Math.abs(tt)>Math.abs(mt)){if(t.length<=1)return;R.current="horizontal"}else if(mt>0)R.current="vertical";else return}if(R.current==="horizontal"){L.current=!0,N(!0),f.current=tt;const St=tt<0?1:-1;V.current!==St&&(V.current=St,E(St)),P.current=tt,j(tt),je.preventDefault();return}R.current==="vertical"&&(L.current=!0,N(!0),$.current=mt,J(mt),je.preventDefault())},Oe=()=>{if(!g.current)return;const je=R.current,qe=L.current;if(qe&&je==="horizontal")He(f.current),ne();else if(qe&&je==="vertical")if($.current>Km){const mt=window.innerHeight;$.current=mt,b(!0),J(mt),U("closing")}else $.current=0,J(0),ne();else je==="horizontal"&&Math.abs(f.current)>0&&(He(f.current),ne());g.current=null,R.current="none",f.current=0,L.current=!1,N(!1)};return document.addEventListener("touchstart",st,{passive:!0}),document.addEventListener("touchmove",Be,{passive:!1}),document.addEventListener("touchend",Oe),document.addEventListener("touchcancel",Oe),()=>{document.removeEventListener("touchstart",st),document.removeEventListener("touchmove",Be),document.removeEventListener("touchend",Oe),document.removeEventListener("touchcancel",Oe),ee()}},[W,t.length,Ce]),a.useEffect(()=>{const Ie=ee=>{ee.key==="Escape"&&(ee.preventDefault(),ee.stopPropagation(),W!=="closing"&&U("closing"))};return window.addEventListener("keydown",Ie,!0),()=>window.removeEventListener("keydown",Ie,!0)},[W]);const ye=()=>{W!=="closing"&&U("closing")},Se=W==="open",B=W==="closing",ue=G>0?Math.max(0,1-G/500):1,ve=G>0?Math.max(.35,1-G/500):1,me=A?p?A:tg(A,he):null,Ee=Ie=>{if(Ie.stopPropagation(),I.current){I.current=!1;return}if(t.length<=1)return;const ee=me??Ie.currentTarget.getBoundingClientRect(),ne=Ie.clientY-ee.top,He=Math.min(52,ee.height*.2);if(!(ne>ee.height-He)){if(Ie.clientX-ee.left<ee.width/2){Me(-1);return}Me(1)}},be=Ie=>{if(t.length<=1)return;const ee=me??Ie.currentTarget.getBoundingClientRect(),ne=Ie.clientX-ee.left,He=Ie.clientY-ee.top,st=Math.min(52,ee.height*.2);if(He>ee.height-st){Ie.currentTarget.style.cursor="default";return}Ie.currentTarget.style.cursor=ne<ee.width/2?"w-resize":"e-resize"},k={position:"fixed",top:S==null?void 0:S.top,left:S==null?void 0:S.left,width:S==null?void 0:S.width,height:S==null?void 0:S.height,zIndex:9998},re=p?"cover":"contain",te=D!==0||G>0?`translate(${D}px, ${G}px)`:void 0,z=ce&&!K?"none":K?`transform ${Sn}ms ${Nn}`:pe?`transform ${Sn}ms ${Nn}, opacity ${Sn}ms ${Nn}`:W==="opening"||B?`opacity ${Sn}ms ${Nn}`:"none",le={...k,transform:te,opacity:G>0?ve:W==="opening"||B?0:1,transition:z,pointerEvents:"none"},Re={position:"absolute",top:((me==null?void 0:me.top)??0)-((S==null?void 0:S.top)??0),left:((me==null?void 0:me.left)??0)-((S==null?void 0:S.left)??0),width:me==null?void 0:me.width,height:me==null?void 0:me.height,objectFit:re,pointerEvents:se&&Se&&!oe?"auto":"none",touchAction:se&&Se?"none":void 0},ae=(S==null?void 0:S.width)??0,_=oe?(n+O+t.length)%t.length:null,Ne=_!==null?t[_]:null,Fe={...k,transform:oe?`translateX(${O*ae+D}px)`:void 0,opacity:1,transition:K?`transform ${Sn}ms ${Nn}`:"none",pointerEvents:"none"},et={position:"absolute",top:((A==null?void 0:A.top)??0)-((S==null?void 0:S.top)??0),left:((A==null?void 0:A.left)??0)-((S==null?void 0:S.left)??0),width:A==null?void 0:A.width,height:A==null?void 0:A.height,objectFit:re,pointerEvents:"none"},Ke=me?{position:"fixed",top:me.top,height:me.height,width:me.width/2,zIndex:9999}:null;return r.jsxs("div",{ref:w,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:W==="open"?"none":void 0},onClick:ye,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:Se?ue:0,transition:ce?"none":`opacity ${Sn}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:v,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:Se?1:0,transition:`opacity ${Sn}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:v,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:Se?1:0,transition:`opacity ${Sn}ms ${Nn}`},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),A&&S&&Ne&&r.jsx("div",{style:Fe,children:Ei(Ne)?r.jsx("video",{src:Ne.url,muted:!0,playsInline:!0,preload:"auto",style:et},`neighbor-${_}-${Ne.url}`):r.jsx("img",{src:Ne.url,alt:Ne.name,style:et},`neighbor-${_}-${Ne.url}`)}),A&&S&&Te&&r.jsx("div",{style:le,children:se?r.jsx(ng,{src:Te.url,phase:W,mediaRef:T,mediaStyle:Re,onLoadedMetadata:q,onClick:Ee,onMouseMove:be},`${n}-${Te.url}`):r.jsx("img",{ref:T,src:Te.url,alt:Te.name,onLoad:q,style:Re},`${n}-${Te.url}`)}),Se&&Ke&&t.length>1&&!se&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...Ke,left:me.left,cursor:"w-resize",pointerEvents:oe?"none":"auto"},onClick:Ie=>{if(I.current){I.current=!1;return}Ie.stopPropagation(),Me(-1)}}),r.jsx("div",{style:{...Ke,left:me.left+me.width/2,cursor:"e-resize",pointerEvents:oe?"none":"auto"},onClick:Ie=>{if(I.current){I.current=!1;return}Ie.stopPropagation(),Me(1)}})]})]})}function og(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function rg({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:s,activeEvent:l,layoutId:d,portalId:c}){const{prefix:u}=x.useScopedStyles(),{type:p="a",gridLayout:w,textBoxWidth:v=100,verticalGap:T,entriesCount:g,lightbox:$,imageDisplay:f,imageCorners:R,lightboxImageDisplay:L,slider:I,sliderTiming:Y,direction:P,transition:V,titleMarginTop:M,subtitleMarginTop:C,titleColor:A,subtitleColor:y,lightboxCounterColor:S,titleFontFamily:F,titleFontSettings:W,titleFontSize:U,titleLineHeight:G,titleLetterSpacing:J,titleWordSpacing:D,titleTextAppearance:j,subtitleFontFamily:O,subtitleFontSettings:E,subtitleFontSize:K,subtitleLineHeight:Z,subtitleLetterSpacing:ce,subtitleWordSpacing:N,subtitleTextAppearance:pe,lightboxCounterFontFamily:b,lightboxCounterFontSettings:he,lightboxCounterFontSize:Q,lightboxCounterLineHeight:we,lightboxCounterLetterSpacing:Te,lightboxCounterWordSpacing:se,lightboxCounterTextAppearance:oe,showText:q="always",alignEntries:de="off",align:ge="top"}=e,_e={fontSettings:{fontFamily:F,fontWeight:(W==null?void 0:W.fontWeight)??400,fontStyle:(W==null?void 0:W.fontStyle)??"normal"},fontSize:U??.01,lineHeight:G,letterSpacing:J??0,wordSpacing:D??0,textAppearance:j,color:A},Me={...nn(zt(_e,n))},fe={fontSettings:{fontFamily:O,fontWeight:(E==null?void 0:E.fontWeight)??400,fontStyle:(E==null?void 0:E.fontStyle)??"normal"},fontSize:K??.01,lineHeight:Z,letterSpacing:ce??0,wordSpacing:N??0,textAppearance:pe,color:y},Se={...nn(zt(fe,n))},B={fontSettings:{fontFamily:b,fontWeight:(he==null?void 0:he.fontWeight)??400,fontStyle:(he==null?void 0:he.fontStyle)??"normal"},fontSize:Q??.01,lineHeight:we,letterSpacing:Te??0,wordSpacing:se??0,textAppearance:oe,color:S},ve={...nn(zt(B,n)),...Vr(Q,we,u,n)},me=Br(U,G,`${u}-item-title`,`${u}-text-tight-leading`),Ee=Br(K,Z,`${u}-item-subtitle`,`${u}-text-tight-leading`),be=Vr(U,G,u,n),k=Vr(K,Z,u,n),re=Br(Q,we,`${u}-lightbox-counter`,`${u}-text-tight-leading`),te=x.buildColorVars(u,{titleColor:A,subtitleColor:y,lightboxCounterColor:S},ag,sg),Re=`${l&&l!=="default"?`${u}-state-${l}`:""}${q==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),ae=g===0?1/0:g,_=(t??[]).slice(0,ae),Ne=w.entryWidth??.2,Fe=(f==null?void 0:f.display)==="cover",et=(f==null?void 0:f.ratioValue)??"1:1",Ke=(f==null?void 0:f.reversed)??!1,[Ie,ee]=et.split(":").map(Number),st=`${Ke?ee:Ie} / ${Ke?Ie:ee}`,Be=w.columnsCount,Oe=x.scalingValue(Ne??0,n),je=Oe,qe=!Fe&&I!=="off",tt=_.length%Be||Be,mt=tt<Be&&_.length>0,St=_.length-tt,lt=mt?Math.floor((Be-tt)/2)+1:1,pt=R?x.scalingValue(R,n):void 0,Mt={width:je,...Fe?{aspectRatio:st,height:"auto",overflow:"hidden"}:{height:"auto"},...pt?{borderRadius:pt,overflow:"hidden"}:{}},nt=`${u}-item-image-wrapper${qe?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),Ve=p==="d"||p==="e"||p==="f",De=de==="on",vt=`calc(${x.scalingValue(Ne??0,n)} * (${v} / 100))`,bt=x.scalingValue(Ne*v/100,n),Pt=Fe?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...pt?{borderRadius:pt}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...pt?{borderRadius:pt}:{}},[Dt,tn]=a.useState("ltr"),[ln,Tt]=a.useState(0),kt=a.useRef(null);a.useEffect(()=>{const Ze=kt.current;if(!Ze)return;const Je=new ResizeObserver(rt=>{Tt(Math.round(rt[0].contentRect.width))});return Je.observe(Ze),()=>Je.disconnect()},[]);const Yt=(()=>{const Ze={...te},Je=kt.current?getComputedStyle(kt.current).getPropertyValue("--cntrl-article-width").trim():"";return Je&&(Ze["--cntrl-article-width"]=Je),Ze})(),[qt,Le]=a.useState(!1),[Ue,Xe]=a.useState([]),[ct,Rt]=a.useState(0),ut=$==="on"&&(!n||i),it=(Ze,Je)=>{n&&!i||$!=="off"&&(Xe(Ze),Rt(Je),Le(!0))};a.useEffect(()=>{if(!qt||$!=="on"||typeof document>"u")return;const Ze=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Ze}},[qt,$]),a.useEffect(()=>{!n||i||Le(!1)},[n,i]);const Ut=a.useMemo(()=>qm(u),[u]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Ut}}),r.jsx("div",{style:te,children:r.jsx("div",{ref:kt,className:`${u}-wrapper ${u}-type-${p}${De?` ${u}-align-entries`:""} ${u}-image-align-${ge} ${Re}`.trim(),style:{gridTemplateColumns:`repeat(${Be}, ${Oe})`,rowGap:De?0:x.scalingValue(T??0,n),columnGap:x.scalingValue(w.horizontalGap??0,n),width:x.scalingValue(w.wrapperWidth??0,n),...De?{[`--${u}-align-entries-row-gap`]:x.scalingValue(T??0,n)}:{}},children:_.map((Ze,Je)=>{var jt;const rt=Ms(Ze.title),Lt=Ms(Ze.subtitle),It=(((jt=Ze.link)==null?void 0:jt.length)??0)>0&&$==="off"?Ze.link:void 0,ft=Math.floor(Je/Be)===Math.ceil(_.length/Be)-1,Ft=mt&&Je>=St?`${lt+(Je-St)}`:void 0,Ot=Ve?r.jsxs("div",{className:`${u}-item-text-block`,children:[rt&&r.jsx("p",{className:me,style:{width:vt,...Me,...be},children:Ze.title}),rt&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:x.scalingValue(M??0,n),width:bt}}),Lt&&r.jsx("p",{className:Ee,style:{width:vt,...Se,...k},children:Ze.subtitle}),Lt&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:x.scalingValue(C??0,n),width:bt}})]}):null,Ht=De?r.jsxs("div",{className:`${u}-item-title-row`,children:[!Ve&&r.jsx("div",{"data-controls":o&&rt?"titleMarginTop":void 0,className:o&&rt?`${u}-control`:void 0,style:{height:rt?x.scalingValue(M??0,n):0,width:bt}}),rt&&r.jsx("p",{className:me,style:{width:vt,...Me,...be},children:Ze.title}),Ve&&rt&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:x.scalingValue(M??0,n),width:bt}})]}):null,Vt=De?r.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!Ve&&r.jsx("div",{"data-controls":o&&Lt?"subtitleMarginTop":void 0,className:o&&Lt?`${u}-control`:void 0,style:{height:Lt?x.scalingValue(C??0,n):0,width:bt}}),Lt&&r.jsx("p",{className:Ee,style:{width:vt,...Se,...k},children:Ze.subtitle}),Ve&&Lt&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:x.scalingValue(C??0,n),width:bt}})]}):null,xt=It?r.jsxs("a",{href:It,target:"_blank",className:`${u}-item-text-link`,children:[Ht,Vt]}):r.jsxs(r.Fragment,{children:[Ht,Vt]}),Gt=Qm(Ze.gallery),Kt=Gt.filter(wt=>wt.lightboxMedia).map(wt=>wt.lightboxMedia),Xt=r.jsx("div",{className:nt,style:Mt,children:Gt.length===0?null:I==="off"?(()=>{const{displayMedia:wt,lightboxMedia:h}=Gt[0],xe=h?Kt.findIndex(Pe=>Pe.url===h.url):-1;return r.jsx(ks,{media:wt,className:`${u}-item-${Ei(wt)?"video":"image"}`.trim(),style:Pt,onMediaClick:ut&&xe>=0?()=>it(Kt,xe):void 0})})():r.jsxs(r.Fragment,{children:[qe&&De&&r.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Gt.map(({displayMedia:wt})=>Ei(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(qa,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:Y*1e3,width:"100%",height:"100%",speed:Um,type:V==="fade"?"fade":"loop",rewind:V==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:V==="fade"?"ltr":P!=="random"?P==="horizontal"?"ltr":"ttb":Dt},onMoved:wt=>{if(P!=="random"||V==="fade")return;const h=Math.random()>.5?Math.random()>.5?"rtl":"ltr":"ttb";tn(h),setTimeout(()=>{wt.refresh()},0)},children:Gt.map(({displayMedia:wt,lightboxMedia:h},xe)=>{const Pe=h?Kt.findIndex(Ae=>Ae.url===h.url):-1;return r.jsx(Ua,{children:r.jsx(ks,{media:wt,className:`${u}-item-${Ei(wt)?"video":"image"}`.trim(),style:Pt,onMediaClick:ut&&Pe>=0?()=>it(Kt,Pe):void 0})},xe)})},`${V}-${Ne}-${P}-${Y}-${ln}-${d}`)]})}),Zt=Ve?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":o&&rt?"titleMarginTop":void 0,className:o&&rt?`${u}-control`:void 0,style:{height:rt?x.scalingValue(M??0,n):0,width:bt}}),r.jsx("p",{className:me,style:{width:vt,...Me,...be},children:Ze.title}),r.jsx("div",{"data-controls":o&&Lt?"subtitleMarginTop":void 0,className:o&&Lt?`${u}-control`:void 0,style:{height:Lt?x.scalingValue(C??0,n):0,width:bt}}),r.jsx("p",{className:Ee,style:{width:vt,...Se,...k},children:Ze.subtitle})]});return r.jsx("div",{className:`${u}-item`.trim(),style:Ft&&!De?{gridColumn:Ft}:void 0,children:r.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${De&&ft?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(v??0)>100?`calc(${Oe} * (${v} / 100))`:Oe,...Ft&&De?{gridColumn:Ft}:{}},children:De?r.jsx(r.Fragment,{children:Ve?r.jsxs(r.Fragment,{children:[xt,r.jsx("a",{href:It,target:"_blank",className:`${u}-item-image-link`,children:Xt})]}):r.jsxs(r.Fragment,{children:[r.jsx("a",{href:It,target:"_blank",className:`${u}-item-image-link`,children:Xt}),xt]})}):It?r.jsxs(r.Fragment,{children:[r.jsxs("a",{href:It,target:"_blank",className:`${u}-item-image-link`,children:[Ot,Xt]}),!Ve&&r.jsx("a",{href:It,target:"_blank",className:`${u}-item-text-link`,children:Zt})]}):r.jsxs(r.Fragment,{children:[Ot,Xt,Zt]})})},Je)})})}),(!n||i)&&qt&&typeof document<"u"&&$==="on"&&(()=>{const Ze=(c?document.getElementById(c):null)??document.body;return Yn.createPortal(r.jsx("div",{style:Yt,"data-selection":"none",children:r.jsx(ig,{prefix:u,items:Ue,index:ct,imageDisplay:og(L),isEditor:n,onClose:()=>Le(!1),onPrev:()=>Rt(Je=>(Je-1+Ue.length)%Ue.length),onNext:()=>Rt(Je=>(Je+1)%Ue.length),counterClassName:re,counterStyle:ve})}),Ze)})()]})}const ag={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},sg=["hover","focus","filled","success","error"],lg=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
4159
4159
|
import '@splidejs/react-splide/css/core';
|
|
4160
4160
|
import { CommonComponentProps } from '../props';
|
|
4161
4161
|
import {
|
|
@@ -6047,7 +6047,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
6047
6047
|
};
|
|
6048
6048
|
|
|
6049
6049
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
6050
|
-
`,Gr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},cg=["titleColor","subtitleColor","lightboxCounterColor"],dg={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:{...Gr.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:{...Gr.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:{...Gr.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:[...cg],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},ug={element:rg,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:dg,sourceCode:lg},pg=50,Ps=10,Ua="cntrl-lightbox-journal",Ir=Ua,xa=`${Ua}-`,Rr=e=>`${Ua}-${e}`,Ka=e=>e===Ir||e.startsWith(xa),As=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},Fs=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=As(t.get(Rr(e)));if(i)return i}const n=As(t.get(Ir));if(n)return n;for(const[i]of t){if(!i.startsWith(xa))continue;const o=i.slice(xa.length);if(!/^\d+$/.test(o))continue;const s=Number.parseInt(o,10);if(Number.isFinite(s)&&s>=1)return s}return null},Ws=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},cc=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{Ka(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(Rr(t),String(e)):i.searchParams.set(Ir,String(e));const o=n?"replaceState":"pushState",s=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",s)},mg=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===Rr(e)||i===Ir:Ka(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)}},dc=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(Rr(e)):[...t.keys()].some(n=>Ka(n))},gg=(e,t)=>{if(dc(t)){if(e){window.history.back();return}mg(t)}},hg=20,fg=2,qr=e=>`max(${e}, ${hg}px)`,Wi=e=>((e==null?void 0:e.image)??[]).slice(0,fg),uc=e=>e.reduce((t,n)=>t+Wi(n).length,0),yg=(e,t)=>{const n=e.slice(0,t).reduce((o,s)=>o+Wi(s).length,1),i=Wi(e[t]).length;return{start:n,end:n+i-1}},vg=(e,t)=>{const n=uc(e),{start:i,end:o}=yg(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},nr=(e,t)=>t==="B"?e.flatMap((n,i)=>Wi(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Wi(n)})),xg=(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 vg(i,o)},_s=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",bg=(e,t,n)=>e==="B"?t.length>1:uc(n)>1,gn=.004,Bn=.004,Mi={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},_i=(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},yo=(e,t)=>_i(e,t),an=(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:_i(e.length,n),effective:yo(e.length,n)}},pc=(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),mc=(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"],Ye=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Xa={title1:"1",title2:"2",title3:"3",count:"Count"},Ya=e=>[Ye(e,"fontFamily"),Ye(e,"fontSettings"),{type:"row",items:[Ye(e,"fontSize"),Ye(e,"lineHeight"),Ye(e,"letterSpacing"),Ye(e,"wordSpacing")]},Ye(e,"textAlign"),Ye(e,"textAppearance")],wg=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Kn.map(e=>[Xa[e],Ya(e)]))}),Sg={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},$g={title1:.02,title2:.02,title3:.02,count:.017},di=(e,t)=>{const n=i=>{const o=Ye(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[Sg[t]]}},ui=(e,t,n)=>{var o,s;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((s=t.fontSettings)==null?void 0:s.fontStyle)??"normal"},fontSize:t.fontSize??$g[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return zt(i,n)};function gc({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:S=0,titleRowMarginBottom:T=0,titleHeaderLayout:g="desktop",contentMarginTop:$=0,iconMarginRight:h=0,closeIcon:I=null,closeIconMaxWidth:R=0,closeIconColor:E="#000000",closeIconHoverColor:Z="#cccccc"}=n,P=v.scalingValue($,i),B=v.scalingValue(h,i),M=v.scalingValue(T,i),C=g==="mobile",W=ui("title1",di(n,"title1"),i),y=ui("title2",di(n,"title2"),i),x=ui("title3",di(n,"title3"),i),A=a.useMemo(()=>({title1Width:d??Mi.title1Width,title2Width:c??Mi.title2Width,title3Width:u??Mi.title3Width}),[d,c,u]),H=a.useMemo(()=>({title2MarginLeft:b,title3MarginLeft:S}),[b,S]),K=a.useMemo(()=>Vn(e,t,W,y,x),[e,t,W,y,x]),G=a.useMemo(()=>K.map(j=>A[j.widthKey]),[K,A]),Y=a.useMemo(()=>_i(K.length,G),[K.length,G]),V=a.useMemo(()=>yo(K.length,G),[K.length,G]),D=a.useMemo(()=>K.filter(j=>j.prefix==="title1"),[K]),O=a.useMemo(()=>K.filter(j=>j.prefix==="title2"||j.prefix==="title3"),[K]),L=a.useMemo(()=>Gn(D,A),[D,A]),U=a.useMemo(()=>Gn(O,A),[O,A]),J=!!(t.title1||t.title2||t.title3),ce=I!==null;if(!(J||ce))return null;const de=(p??0)>0||o,w=(j,re)=>{const Ie=K.findIndex(F=>F.prefix===j.prefix);if(!C||re==="single-row")return{effectiveWidth:V[Ie]??0,resolvedWidth:Y[Ie]??0,maxWidth:an(Ie,Y)};if(re==="two-row-top"){const F=D.findIndex(He=>He.prefix===j.prefix);return{effectiveWidth:L.effective[F]??0,resolvedWidth:L.resolved[F]??0,maxWidth:an(F,L.resolved)}}const ie=O.findIndex(F=>F.prefix===j.prefix);return{effectiveWidth:U.effective[ie]??0,resolvedWidth:U.resolved[ie]??0,maxWidth:an(ie,U.resolved)}},ge=(j,re,Ie)=>{if(!C||Ie==="single-row"){const tt=j.findIndex(ne=>ne.prefix===re.prefix),Ke=j.map(ne=>A[ne.widthKey]),Re=_i(j.length,Ke);return{effectiveWidth:yo(j.length,Ke)[tt]??0,resolvedWidth:Re[tt]??0,maxWidth:an(tt,Re)}}if(Ie==="two-row-top"){const tt=j.filter(ne=>ne.prefix==="title1"),Ke=tt.findIndex(ne=>ne.prefix===re.prefix),{resolved:Re,effective:ee}=Gn(tt,A);return{effectiveWidth:ee[Ke]??0,resolvedWidth:Re[Ke]??0,maxWidth:an(Ke,Re)}}const ie=j.filter(tt=>tt.prefix==="title2"||tt.prefix==="title3"),F=ie.findIndex(tt=>tt.prefix===re.prefix),{resolved:He,effective:Ne}=Gn(ie,A);return{effectiveWidth:Ne[F]??0,resolvedWidth:He[F]??0,maxWidth:an(F,He)}},Q=j=>mc(K,Y,H,j)+(C?0:p??0),ve=()=>C?0:p??0,Le=j=>O.slice(0,j).reduce((re,Ie,ie)=>re+(Ie.marginLeftKey?H[Ie.marginLeftKey]??0:0)+(U.resolved[ie]??0),0),pe=j=>{const re=O[j];return Le(j)+(re.marginLeftKey?H[re.marginLeftKey]??0:0)+(U.resolved[j]??0)},ae=(j,re,Ie)=>{const ie=j.marginLeftKey?H[j.marginLeftKey]??0:0,{effectiveWidth:F,resolvedWidth:He,maxWidth:Ne}=Ie??w(j,re),tt=Math.max(ie,Bn),Ke=o&&re==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":j.prefix,style:{width:v.scalingValue(F,i),...ie>0?{marginLeft:v.scalingValue(ie,i)}:{}},children:[r.jsx("p",{className:j.className,style:j.style,children:j.text}),Ke&&j.marginLeftKey?r.jsx("div",{"data-controls":j.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(He),style:{position:"absolute",top:0,left:v.scalingValue(-ie,i),width:v.scalingValue(tt,i),height:"100%",pointerEvents:"auto"}}):null,Ke?r.jsx("div",{"data-controls":j.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ne),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:v.scalingValue(-gn/2,i),width:v.scalingValue(gn,i),height:"100%",pointerEvents:"auto"}}):null]},j.className)},q=(j="two-row")=>{const re=K.findIndex(F=>F.prefix==="title1"),Ie=re>=0?Y[re]:A.title1Width,ie=j==="two-row"&&o;return r.jsx("div",{...ie?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ie)}:{},style:{width:v.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...ie?{pointerEvents:"auto"}:{}}})},se=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:W,"aria-hidden":"true",children:" "}),he=j=>{const re=Vn(e,j,W,y,x);return r.jsx(r.Fragment,{children:re.map(Ie=>ae(Ie,"single-row",ge(re,Ie,"single-row")))})},Pe=j=>{const re=Vn(e,j,W,y,x),Ie=re.find(ie=>ie.prefix==="title1");return Ie?ae(Ie,"two-row-top",ge(re,Ie,"two-row-top")):null},Ce=(j,re=!1)=>{const Ie=Vn(e,j,W,y,x),ie=Ie.filter(Ne=>Ne.prefix==="title2"||Ne.prefix==="title3"),F=o&&re;return ie.length>0||F||(T??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[ie.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[r.jsx("div",{className:`${e}-titles-stack`,children:ie.map(Ne=>ae(Ne,"two-row-bottom",ge(Ie,Ne,"two-row-bottom")))}),re&&o?r.jsxs(r.Fragment,{children:[ue(),Ee()]}):null]}):null,(T??0)>0||F?r.jsx("div",{"data-controls":F?"titleRowMarginBottom":void 0,"data-controls-axis":F?"y":void 0,"data-controls-reverse":F?"":void 0,className:F?`${e}-control`:void 0,style:{height:M,width:"100%",flexShrink:0,pointerEvents:F?"auto":"none"}}):null]}):null},ke=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:v.scalingValue(R??0,i),height:v.scalingValue(R??0,i),marginRight:B,"--close-icon-hover-color":Z},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:j=>{j.stopPropagation(),l==null||l()},"aria-label":"Close",children:r.jsx(on,{url:I??"",fill:E,hoverFill:i&&!s?E:Z,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"}})]}),fe=()=>ce?r.jsx("div",{className:`${e}-titles-row-header-controls`,children:ke()}):null,xe=j=>r.jsx("div",{className:`${e}-titles-row-titles`,children:r.jsx("div",{className:`${e}-titles-stack`,children:j})}),Se=j=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[ce||J?se():null,de?q("two-row"):null,xe(j),fe()]}),z=(j,re=!1)=>r.jsxs(r.Fragment,{children:[Se(Pe(j)),Ce(j,re)]}),me=()=>{const j=C?-1:K.findIndex(ie=>ie.prefix==="title1"),re=!C&&(o||(p??0)>0)?(()=>{const ie=p??0,F=j>=0?Y[j]:A.title1Width,He=Math.max(ie,Bn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(F),style:{position:"absolute",top:0,left:0,width:v.scalingValue(He,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,Ie=K.flatMap((ie,F)=>{if(!ie.marginLeftKey)return[];const He=H[ie.marginLeftKey]??0,Ne=pc(K,Y,H,F)+ve(),tt=Math.max(He,Bn);return r.jsx("div",{"data-controls":ie.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Y[F]),style:{position:"absolute",top:0,left:v.scalingValue(Ne,i),width:v.scalingValue(tt,i),height:"100%",pointerEvents:"auto"}},ie.marginLeftKey)});return re?[re,...Ie]:Ie},ye=()=>K.map((j,re)=>{const Ie=an(re,Y),F=Q(re)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":j.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:v.scalingValue(F,i),width:v.scalingValue(gn,i),height:"100%",pointerEvents:"auto"}})},`${j.widthKey}-junction`)}),ue=()=>O.flatMap((j,re)=>{if(!j.marginLeftKey)return[];const Ie=H[j.marginLeftKey]??0,ie=Le(re),F=Math.max(Ie,Bn),{resolvedWidth:He}=w(j,"two-row-bottom");return r.jsx("div",{"data-controls":j.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(He),style:{position:"absolute",top:0,left:v.scalingValue(ie,i),width:v.scalingValue(F,i),height:"100%",pointerEvents:"auto"}},j.marginLeftKey)}),Ee=()=>O.map((j,re)=>{const{maxWidth:Ie}=w(j,"two-row-bottom"),F=pe(re)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":j.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:v.scalingValue(F,i),width:v.scalingValue(gn,i),height:"100%",pointerEvents:"auto"}})},`${j.widthKey}-junction`)}),we=()=>!o||C?null:r.jsxs(r.Fragment,{children:[me(),ye()]}),k=!!(t.title2||t.title3||(T??0)>0||o),le=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[ce||J?se():null,de?q("single-row"):null,J?xe(he(t)):r.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),fe(),we()]}),te=()=>r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...k?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:k?void 0:{flex:"0 0 auto",height:"auto"},children:z(t,!0)}),we()]});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:P,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():le()})})})]})}function Cg(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Tg(e){return`
|
|
6050
|
+
`,Gr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},cg=["titleColor","subtitleColor","lightboxCounterColor"],dg={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:{...Gr.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:{...Gr.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:{...Gr.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:[...cg],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},ug={element:rg,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:dg,sourceCode:lg},pg=50,As=10,Ka="cntrl-lightbox-journal",Ir=Ka,xa=`${Ka}-`,Rr=e=>`${Ka}-${e}`,Xa=e=>e===Ir||e.startsWith(xa),Fs=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},Ws=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=Fs(t.get(Rr(e)));if(i)return i}const n=Fs(t.get(Ir));if(n)return n;for(const[i]of t){if(!i.startsWith(xa))continue;const o=i.slice(xa.length);if(!/^\d+$/.test(o))continue;const s=Number.parseInt(o,10);if(Number.isFinite(s)&&s>=1)return s}return null},_s=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},cc=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{Xa(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(Rr(t),String(e)):i.searchParams.set(Ir,String(e));const o=n?"replaceState":"pushState",s=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",s)},mg=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===Rr(e)||i===Ir:Xa(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)}},dc=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(Rr(e)):[...t.keys()].some(n=>Xa(n))},gg=(e,t)=>{if(dc(t)){if(e){window.history.back();return}mg(t)}},hg=20,fg=2,qr=e=>`max(${e}, ${hg}px)`,Wi=e=>((e==null?void 0:e.image)??[]).slice(0,fg),uc=e=>e.reduce((t,n)=>t+Wi(n).length,0),yg=(e,t)=>{const n=e.slice(0,t).reduce((o,s)=>o+Wi(s).length,1),i=Wi(e[t]).length;return{start:n,end:n+i-1}},vg=(e,t)=>{const n=uc(e),{start:i,end:o}=yg(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},nr=(e,t)=>t==="B"?e.flatMap((n,i)=>Wi(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Wi(n)})),xg=(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 vg(i,o)},Ns=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",bg=(e,t,n)=>e==="B"?t.length>1:uc(n)>1,gn=.004,Bn=.004,Mi={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},_i=(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},yo=(e,t)=>_i(e,t),an=(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:_i(e.length,n),effective:yo(e.length,n)}},pc=(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),mc=(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"],Ye=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Ya={title1:"1",title2:"2",title3:"3",count:"Count"},Za=e=>[Ye(e,"fontFamily"),Ye(e,"fontSettings"),{type:"row",items:[Ye(e,"fontSize"),Ye(e,"lineHeight"),Ye(e,"letterSpacing"),Ye(e,"wordSpacing")]},Ye(e,"textAlign"),Ye(e,"textAppearance")],wg=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Kn.map(e=>[Ya[e],Za(e)]))}),Sg={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},$g={title1:.02,title2:.02,title3:.02,count:.017},di=(e,t)=>{const n=i=>{const o=Ye(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[Sg[t]]}},ui=(e,t,n)=>{var o,s;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((s=t.fontSettings)==null?void 0:s.fontStyle)??"normal"},fontSize:t.fontSize??$g[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return zt(i,n)};function gc({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:w=0,title3MarginLeft:v=0,titleRowMarginBottom:T=0,titleHeaderLayout:g="desktop",contentMarginTop:$=0,iconMarginRight:f=0,closeIcon:R=null,closeIconMaxWidth:L=0,closeIconColor:I="#000000",closeIconHoverColor:Y="#cccccc"}=n,P=x.scalingValue($,i),V=x.scalingValue(f,i),M=x.scalingValue(T,i),C=g==="mobile",A=ui("title1",di(n,"title1"),i),y=ui("title2",di(n,"title2"),i),S=ui("title3",di(n,"title3"),i),F=a.useMemo(()=>({title1Width:d??Mi.title1Width,title2Width:c??Mi.title2Width,title3Width:u??Mi.title3Width}),[d,c,u]),W=a.useMemo(()=>({title2MarginLeft:w,title3MarginLeft:v}),[w,v]),U=a.useMemo(()=>Vn(e,t,A,y,S),[e,t,A,y,S]),G=a.useMemo(()=>U.map(z=>F[z.widthKey]),[U,F]),J=a.useMemo(()=>_i(U.length,G),[U.length,G]),D=a.useMemo(()=>yo(U.length,G),[U.length,G]),j=a.useMemo(()=>U.filter(z=>z.prefix==="title1"),[U]),O=a.useMemo(()=>U.filter(z=>z.prefix==="title2"||z.prefix==="title3"),[U]),E=a.useMemo(()=>Gn(j,F),[j,F]),K=a.useMemo(()=>Gn(O,F),[O,F]),Z=!!(t.title1||t.title2||t.title3),ce=R!==null;if(!(Z||ce))return null;const pe=(p??0)>0||o,b=(z,le)=>{const Re=U.findIndex(_=>_.prefix===z.prefix);if(!C||le==="single-row")return{effectiveWidth:D[Re]??0,resolvedWidth:J[Re]??0,maxWidth:an(Re,J)};if(le==="two-row-top"){const _=j.findIndex(Ne=>Ne.prefix===z.prefix);return{effectiveWidth:E.effective[_]??0,resolvedWidth:E.resolved[_]??0,maxWidth:an(_,E.resolved)}}const ae=O.findIndex(_=>_.prefix===z.prefix);return{effectiveWidth:K.effective[ae]??0,resolvedWidth:K.resolved[ae]??0,maxWidth:an(ae,K.resolved)}},he=(z,le,Re)=>{if(!C||Re==="single-row"){const et=z.findIndex(ne=>ne.prefix===le.prefix),Ke=z.map(ne=>F[ne.widthKey]),Ie=_i(z.length,Ke);return{effectiveWidth:yo(z.length,Ke)[et]??0,resolvedWidth:Ie[et]??0,maxWidth:an(et,Ie)}}if(Re==="two-row-top"){const et=z.filter(ne=>ne.prefix==="title1"),Ke=et.findIndex(ne=>ne.prefix===le.prefix),{resolved:Ie,effective:ee}=Gn(et,F);return{effectiveWidth:ee[Ke]??0,resolvedWidth:Ie[Ke]??0,maxWidth:an(Ke,Ie)}}const ae=z.filter(et=>et.prefix==="title2"||et.prefix==="title3"),_=ae.findIndex(et=>et.prefix===le.prefix),{resolved:Ne,effective:Fe}=Gn(ae,F);return{effectiveWidth:Fe[_]??0,resolvedWidth:Ne[_]??0,maxWidth:an(_,Ne)}},Q=z=>mc(U,J,W,z)+(C?0:p??0),we=()=>C?0:p??0,Te=z=>O.slice(0,z).reduce((le,Re,ae)=>le+(Re.marginLeftKey?W[Re.marginLeftKey]??0:0)+(K.resolved[ae]??0),0),se=z=>{const le=O[z];return Te(z)+(le.marginLeftKey?W[le.marginLeftKey]??0:0)+(K.resolved[z]??0)},oe=(z,le,Re)=>{const ae=z.marginLeftKey?W[z.marginLeftKey]??0:0,{effectiveWidth:_,resolvedWidth:Ne,maxWidth:Fe}=Re??b(z,le),et=Math.max(ae,Bn),Ke=o&&le==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":z.prefix,style:{width:x.scalingValue(_,i),...ae>0?{marginLeft:x.scalingValue(ae,i)}:{}},children:[r.jsx("p",{className:z.className,style:z.style,children:z.text}),Ke&&z.marginLeftKey?r.jsx("div",{"data-controls":z.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ne),style:{position:"absolute",top:0,left:x.scalingValue(-ae,i),width:x.scalingValue(et,i),height:"100%",pointerEvents:"auto"}}):null,Ke?r.jsx("div",{"data-controls":z.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Fe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:x.scalingValue(-gn/2,i),width:x.scalingValue(gn,i),height:"100%",pointerEvents:"auto"}}):null]},z.className)},q=(z="two-row")=>{const le=U.findIndex(_=>_.prefix==="title1"),Re=le>=0?J[le]:F.title1Width,ae=z==="two-row"&&o;return r.jsx("div",{...ae?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Re)}:{},style:{width:x.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...ae?{pointerEvents:"auto"}:{}}})},de=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:A,"aria-hidden":"true",children:" "}),ge=z=>{const le=Vn(e,z,A,y,S);return r.jsx(r.Fragment,{children:le.map(Re=>oe(Re,"single-row",he(le,Re,"single-row")))})},_e=z=>{const le=Vn(e,z,A,y,S),Re=le.find(ae=>ae.prefix==="title1");return Re?oe(Re,"two-row-top",he(le,Re,"two-row-top")):null},Ce=(z,le=!1)=>{const Re=Vn(e,z,A,y,S),ae=Re.filter(Fe=>Fe.prefix==="title2"||Fe.prefix==="title3"),_=o&≤return ae.length>0||_||(T??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[ae.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[r.jsx("div",{className:`${e}-titles-stack`,children:ae.map(Fe=>oe(Fe,"two-row-bottom",he(Re,Fe,"two-row-bottom")))}),le&&o?r.jsxs(r.Fragment,{children:[me(),Ee()]}):null]}):null,(T??0)>0||_?r.jsx("div",{"data-controls":_?"titleRowMarginBottom":void 0,"data-controls-axis":_?"y":void 0,"data-controls-reverse":_?"":void 0,className:_?`${e}-control`:void 0,style:{height:M,width:"100%",flexShrink:0,pointerEvents:_?"auto":"none"}}):null]}):null},Me=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:x.scalingValue(L??0,i),height:x.scalingValue(L??0,i),marginRight:V,"--close-icon-hover-color":Y},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:z=>{z.stopPropagation(),l==null||l()},"aria-label":"Close",children:r.jsx(on,{url:R??"",fill:I,hoverFill:i&&!s?I:Y,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:V,height:"100%",pointerEvents:"auto"}})]}),fe=()=>ce?r.jsx("div",{className:`${e}-titles-row-header-controls`,children:Me()}):null,ye=z=>r.jsx("div",{className:`${e}-titles-row-titles`,children:r.jsx("div",{className:`${e}-titles-stack`,children:z})}),Se=z=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[ce||Z?de():null,pe?q("two-row"):null,ye(z),fe()]}),B=(z,le=!1)=>r.jsxs(r.Fragment,{children:[Se(_e(z)),Ce(z,le)]}),ue=()=>{const z=C?-1:U.findIndex(ae=>ae.prefix==="title1"),le=!C&&(o||(p??0)>0)?(()=>{const ae=p??0,_=z>=0?J[z]:F.title1Width,Ne=Math.max(ae,Bn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(_),style:{position:"absolute",top:0,left:0,width:x.scalingValue(Ne,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,Re=U.flatMap((ae,_)=>{if(!ae.marginLeftKey)return[];const Ne=W[ae.marginLeftKey]??0,Fe=pc(U,J,W,_)+we(),et=Math.max(Ne,Bn);return r.jsx("div",{"data-controls":ae.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(J[_]),style:{position:"absolute",top:0,left:x.scalingValue(Fe,i),width:x.scalingValue(et,i),height:"100%",pointerEvents:"auto"}},ae.marginLeftKey)});return le?[le,...Re]:Re},ve=()=>U.map((z,le)=>{const Re=an(le,J),_=Q(le)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":z.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Re),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:x.scalingValue(_,i),width:x.scalingValue(gn,i),height:"100%",pointerEvents:"auto"}})},`${z.widthKey}-junction`)}),me=()=>O.flatMap((z,le)=>{if(!z.marginLeftKey)return[];const Re=W[z.marginLeftKey]??0,ae=Te(le),_=Math.max(Re,Bn),{resolvedWidth:Ne}=b(z,"two-row-bottom");return r.jsx("div",{"data-controls":z.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ne),style:{position:"absolute",top:0,left:x.scalingValue(ae,i),width:x.scalingValue(_,i),height:"100%",pointerEvents:"auto"}},z.marginLeftKey)}),Ee=()=>O.map((z,le)=>{const{maxWidth:Re}=b(z,"two-row-bottom"),_=se(le)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":z.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Re),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:x.scalingValue(_,i),width:x.scalingValue(gn,i),height:"100%",pointerEvents:"auto"}})},`${z.widthKey}-junction`)}),be=()=>!o||C?null:r.jsxs(r.Fragment,{children:[ue(),ve()]}),k=!!(t.title2||t.title3||(T??0)>0||o),re=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[ce||Z?de():null,pe?q("single-row"):null,Z?ye(ge(t)):r.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),fe(),be()]}),te=()=>r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...k?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:k?void 0:{flex:"0 0 auto",height:"auto"},children:B(t,!0)}),be()]});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:P,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():re()})})})]})}function Cg(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Tg(e){return`
|
|
6051
6051
|
.${e}-wrapper {
|
|
6052
6052
|
display: grid;
|
|
6053
6053
|
align-items: start;
|
|
@@ -6367,7 +6367,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
6367
6367
|
pointer-events: auto;
|
|
6368
6368
|
flex-shrink: 0;
|
|
6369
6369
|
}
|
|
6370
|
-
`}const Ns={url:"",name:"",objectFit:"cover"},$n=500,Zi=650,un="cubic-bezier(0.22, 1, 0.36, 1)",Lg=72,Ig=50,Rg=1e4,Eg=650,Mg=500;function kg(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 hc(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=dr(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 Pg(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?hc(i,n):null}function Ag(e){return e.reduce((t,n,i)=>{const o=Za(n.gallery),l=Ja(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 to(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 Hs(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return to(e,i,n)}const Fg=.03;function fc(e){return e.width*Fg}const Ur={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function jo(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function Os(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Wg(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function ba(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 _g(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:ba(e,t.width,t.height)}function Ng(e,t){if(Ki(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 Hg(e){const t=new Set,n=[];for(const i of e){const o=Za(i.gallery),s=Ja(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 Og({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=>Ki(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 Ni(e,t,n){const{width:i,height:o,top:s}=e,{left:l,width:d}=n,c=fc(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 ur(e,t,n){const i=Ni(e,t,n);return{...i,left:2*i.left-e.left}}function jg(e,t,n){const{left:i,width:o}=n,s=fc(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 yc(e,t,n,i){const o=Ni(e,"left",i),s=Ni(e,"right",i),l=ur(e,"left",i),d=ur(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 Dg(e,t,n,i){const{start:o,end:s}=yc(e,t,n,i);return{x:s.left-o.left,y:s.top-o.top}}function zg(e,t,n){const i=Ni(e,t,n),o=ur(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function vc(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 Za(e){if(!e)return;if(vc(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??Ns,i??o??Ns]}]}function Bg(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Vg(e){const[t]=e.media;return t!=null&&t.url?t:null}function Ja(e){if(!Array.isArray(e)||e.length===0)return[];if(vc(e)){const t=[];for(const n of e){const i=Bg(n);if(!i)continue;const o=Vg(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 Ki(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function Gg({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return Ki(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 qg({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 Do({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Ki(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 Ug({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:S,resolveCloseSourceRect:T,onClose:g,onPrev:$,onNext:h}){const I=a.useRef(null),R=a.useRef(null),E=a.useRef(null),Z=a.useRef(new Map),[P,B]=a.useState(0),M=a.useRef(null),C=a.useRef(0),W=a.useRef(0),y=a.useRef("none"),x=a.useRef(!1),A=a.useRef(!1),H=a.useRef(!1),K=a.useRef(null),G=a.useRef(null),Y=a.useRef(null),V=a.useRef(()=>{}),D=a.useRef(null),O=a.useRef(null),L=a.useRef(null),U=a.useRef(!1),[J,ce]=a.useState(null),[_,de]=a.useState(Ur),[w,ge]=a.useState(0),[Q,ve]=a.useState("opening"),[Le,pe]=a.useState(0),[ae,q]=a.useState(0),[se,he]=a.useState(!1),[Pe,Ce]=a.useState(null),[ke,fe]=a.useState(null),[xe,Se]=a.useState(null),[z,me]=a.useState(!1),[ye,ue]=a.useState(null),[Ee,we]=a.useState(!1),k=a.useRef(!1),[le,te]=a.useState(!1),[j,re]=a.useState(!1),Ie=a.useRef(n),ie=a.useRef(void 0),F=t[n],He=F?Ki(F):!1,Ne=ae!==0||se,tt=!l&&(!s||!!d),Ke=c&&!l,Re=u.length>1,ee=a.useCallback((f,be)=>t.length<=1?null:t[(f+be+t.length)%t.length]??null,[t]),ne=Re?to(u,p,-1):ee(n,-1),Me=Re?to(u,p,1):ee(n,1),qe=Pe===-1&&Ne?Re&&ke!==null?to(u,ke,-1):xe!==null?ee(xe,-1):null:null,De=Pe===1&&Ne?Re&&ke!==null?to(u,ke,1):xe!==null?ee(xe,1):null:null,Oe=qe&&qe.url!==(ne==null?void 0:ne.url)?qe:null,Ve=De&&De.url!==(Me==null?void 0:Me.url)?De:null,it=ne&&Ke?(()=>{const f=Re?Hs(u,p,-1):t.length>2?ee((n-1+t.length)%t.length,-1):null;return f&&f.url!==ne.url?f:null})():null,Qe=Me&&Ke?(()=>{const f=Re?Hs(u,p,1):t.length>2?ee((n+1)%t.length,1):null;return f&&f.url!==Me.url?f:null})():null,pt=Oe??it,bt=Ve??Qe,ot=a.useCallback((f,be,Fe)=>{if(!f||!be||!Fe)return;const We=Z.current,st=We.get(f);(st==null?void 0:st.width)===be&&(st==null?void 0:st.height)===Fe||(We.set(f,{width:be,height:Fe}),B(Pt=>Pt+1))},[]),ht=a.useCallback(f=>{if(!(f!=null&&f.url))return null;const be=Z.current.get(f.url);return _g(R.current,be)},[P,w]),Wt=a.useCallback(()=>{if(!F)return;const f=ht(F);if(f){ce(f);return}const be=R.current;be&&ce(Os(be))},[F,ht]),dt=a.useCallback(f=>{if(Re){const be=u.length;fe((p+f+be)%be),Se(null);return}t.length>1&&(Se((n+f+t.length)%t.length),fe(null))},[Re,u.length,p,t.length,n]),Xe=a.useCallback(f=>{H.current=f,he(f)},[]),ze=a.useCallback(()=>{K.current!==null&&(window.clearTimeout(K.current),K.current=null)},[]),vt=a.useCallback(()=>{ze(),K.current=window.setTimeout(()=>{ze(),Xe(!1)},Zi+32)},[ze,Xe]),wt=a.useCallback(()=>{const f=I.current;if(!f){de({left:0,top:0,width:typeof window<"u"?window.innerWidth:Ur.width,height:typeof window<"u"?window.innerHeight:Ur.height});return}const be=f.getBoundingClientRect();de({left:be.left,top:be.top,width:be.width,height:be.height})},[]),kt=a.useCallback((f,be)=>{if(Ne){if(le&&!se)return`translate(${ae}px, 0px)`;if(se&&Pe!==null){const Fe=ht(f);if(!Fe)return;const{x:We,y:st}=Dg(Fe,be,Pe,_);return`translate(${We}px, ${st}px)`}if(se)return"translate(0px, 0px)"}},[Ne,le,se,ae,Pe,_,ht]),jt=a.useCallback(()=>{const f=G.current;G.current=null,ze(),Xe(!1),Ce(null),fe(null),Se(null),q(0),te(!1),x.current=!1,W.current=0,y.current="none",f===-1?$():f===1&&h()},[ze,Xe,$,h]),tn=a.useCallback(()=>{ze(),K.current=window.setTimeout(()=>{G.current!==null&&jt()},Zi+32)},[ze,jt]),ln=a.useCallback(()=>{ze(),G.current=null,Xe(!1),Ce(null),fe(null),Se(null),q(0),te(!1),x.current=!1,W.current=0,y.current="none"},[ze,Xe]),Tt=a.useCallback(f=>{if(!(!Ke||!J)){if(H.current){if(G.current===f){Y.current=f,jt();return}ln()}ze(),dt(f),G.current=f,Ce(f),Xe(!0),tn()}},[Ke,J,jt,ln,ze,dt,Xe,tn]);V.current=Tt;const Mt=a.useCallback(()=>{D.current=null,U.current=!1,O.current!==null&&(window.clearInterval(O.current),O.current=null),L.current!==null&&(window.clearTimeout(L.current),L.current=null)},[]),Yt=a.useCallback(f=>{O.current!==null&&window.clearInterval(O.current);const be=U.current?Mg:Eg;O.current=window.setInterval(()=>{V.current(f)},be)},[]),qt=a.useCallback(f=>{D.current!==f&&(Mt(),D.current=f,U.current=!1,V.current(f),Yt(f),L.current=window.setTimeout(()=>{L.current=null,D.current===f&&(U.current=!0,Yt(f))},Rg))},[Mt,Yt]),Te=a.useCallback(()=>{const f=R.current;if(!f)return;const be=F==null?void 0:F.url,Fe=be?Z.current.get(be):void 0;if(Fe!=null&&Fe.width&&(Fe!=null&&Fe.height)){ce(ba(f,Fe.width,Fe.height));return}const We=E.current;if(We&&be&&(We.src===be||We.currentSrc===be)){const{width:Pt,height:et}=Wg(We);if(Pt&&et){ot(be,Pt,et),ce(ba(f,Pt,et));return}}const st=Os(f);!st.width||!st.height||ce(st)},[F==null?void 0:F.url,ot]),Ge=a.useCallback(f=>{if(E.current=f,!!f){if(f instanceof HTMLVideoElement){f.readyState>=1&&f.videoWidth>0&&Te();return}f.complete&&f.naturalWidth>0&&Te()}},[Te]),Ue=a.useCallback(()=>{wt(),Te(),ge(f=>f+1)},[wt,Te]);a.useEffect(()=>{Ue();const f=R.current,be=I.current,Fe=new ResizeObserver(()=>Ue());return f&&Fe.observe(f),be&&Fe.observe(be),window.addEventListener("resize",Ue),()=>{Fe.disconnect(),window.removeEventListener("resize",Ue)}},[Ue,n,b]),a.useLayoutEffect(()=>{if(!F)return;const f=E.current;if(f){if(f instanceof HTMLImageElement&&f.complete&&f.naturalWidth>0){Te();return}f instanceof HTMLVideoElement&&f.readyState>=1&&f.videoWidth>0&&Te()}},[F==null?void 0:F.url,n,Te]),a.useEffect(()=>{Wt()},[Wt,P]),a.useEffect(()=>{const f=new Set,be=[],Fe=We=>{!(We!=null&&We.url)||f.has(We.url)||(f.add(We.url),be.push(We))};t.forEach(Fe),u.forEach(We=>We.items.forEach(Fe)),be.forEach(We=>{Z.current.has(We.url)||Ng(We,ot)})},[t,u,ot]),a.useEffect(()=>{if(Q!=="opening"||!J)return;if(!S){ve("open");return}me(!1);const f=requestAnimationFrame(()=>{requestAnimationFrame(()=>{me(!0),ve("open")})});return()=>cancelAnimationFrame(f)},[Q,J,S]),a.useEffect(()=>{if(Q!=="closing")return;const f=setTimeout(()=>g(),$n);return()=>clearTimeout(f)},[Q,g]),a.useEffect(()=>()=>{ze()},[ze]),a.useLayoutEffect(()=>{Ie.current===n&&ie.current===(F==null?void 0:F.url)||(ze(),G.current=null,Ce(null),fe(null),Se(null),pe(0),q(0),Xe(!1),re(!1),te(!1),C.current=0,W.current=0,y.current="none",x.current=!1,M.current=null,A.current=!1,E.current=null,Wt(),Ie.current=n,ie.current=F==null?void 0:F.url)},[n,F==null?void 0:F.url,Xe,ze,Wt]),a.useLayoutEffect(()=>{const f=Y.current;f!==null&&(Y.current=null,requestAnimationFrame(()=>{V.current(f)}))},[n,p,F==null?void 0:F.url]),a.useLayoutEffect(()=>{if(Q==="opening"){k.current=!1,we(!1);return}if(Q!=="open"||k.current)return;if(!ne&&!Me){k.current=!0;return}we(!1);const f=requestAnimationFrame(()=>{requestAnimationFrame(()=>{we(!0),k.current=!0})});return()=>cancelAnimationFrame(f)},[Q,ne==null?void 0:ne.url,Me==null?void 0:Me.url]),a.useEffect(()=>{if(Q!=="open")return;const f=()=>{const et=mt=>{mt.stopPropagation(),mt.preventDefault(),document.removeEventListener("click",et,!0)};document.addEventListener("click",et,!0)},be=et=>{const mt=et<0?1:-1;ze(),dt(mt),G.current=mt,Ce(mt),Xe(!0),tn()},Fe=et=>{if(Math.abs(et)>Ig&&Ke){be(et);return}G.current=null,Ce(null),fe(null),Se(null),Xe(!0),q(0),vt()},We=et=>{if(et.touches.length!==1||H.current)return;const mt=et.touches[0];A.current=!0,M.current={x:mt.clientX,y:mt.clientY},y.current="none",W.current=0,x.current=!1},st=et=>{if(!M.current||et.touches.length!==1||H.current)return;const mt=et.touches[0],_t=mt.clientX-M.current.x,Et=mt.clientY-M.current.y;if(y.current==="none"){if(Math.abs(_t)<10&&Math.abs(Et)<10)return;if(Math.abs(_t)>Math.abs(Et)){if(!Ke)return;y.current="horizontal"}else if(Et>0){if(!tt)return;y.current="vertical"}else return}if(y.current==="horizontal"){x.current=!0,te(!0),W.current=_t,q(_t),et.preventDefault();return}y.current==="vertical"&&(x.current=!0,te(!0),C.current=Et,pe(Et),et.preventDefault())},Pt=()=>{if(!M.current)return;const et=y.current,mt=x.current;if(mt&&et==="horizontal")Fe(W.current),f();else if(mt&&et==="vertical"){const _t=C.current;if(tt&&_t>Lg){const Et=window.innerHeight;C.current=Et,re(!0),pe(Et),ve("closing")}else C.current=0,pe(0);f()}else et==="horizontal"&&Math.abs(W.current)>0&&(Fe(W.current),f());M.current=null,y.current="none",W.current=0,x.current=!1,te(!1)};return document.addEventListener("touchstart",We,{passive:!0}),document.addEventListener("touchmove",st,{passive:!1}),document.addEventListener("touchend",Pt),document.addEventListener("touchcancel",Pt),()=>{document.removeEventListener("touchstart",We),document.removeEventListener("touchmove",st),document.removeEventListener("touchend",Pt),document.removeEventListener("touchcancel",Pt)}},[Q,Ke,Xe,vt,ze,tt,tn,dt]);const lt=a.useCallback(()=>{const f=(T==null?void 0:T())??S??null;f&&J&&(ue(f),me(!0)),ve("closing")},[T,S,J]);a.useEffect(()=>{const f=We=>{if(We.key==="Escape"){if(s&&d||Q==="closing")return;Mt(),lt();return}if(We.key!=="ArrowLeft"&&We.key!=="ArrowRight"||Q!=="open"||!Ke)return;We.preventDefault();const st=We.key==="ArrowLeft"?-1:1;We.repeat&&D.current===st||qt(st)},be=We=>{if(We.key!=="ArrowLeft"&&We.key!=="ArrowRight")return;const st=We.key==="ArrowLeft"?-1:1;D.current===st&&Mt()},Fe=()=>{Mt()};return window.addEventListener("keydown",f),window.addEventListener("keyup",be),window.addEventListener("blur",Fe),()=>{window.removeEventListener("keydown",f),window.removeEventListener("keyup",be),window.removeEventListener("blur",Fe),Mt()}},[Q,s,d,lt,Ke,qt,Mt]),a.useEffect(()=>{Q!=="open"&&Mt()},[Q,Mt]);const Rt=()=>{Q==="closing"||l||lt()},ut=Q==="open",nt=Q==="closing",Ut=Le>0?Math.max(0,1-Le/500):1,Ze=Le>0?Math.max(.35,1-Le/500):1,Je=a.useCallback(f=>{if(!(f.propertyName!=="transform"||!H.current)){if(G.current!==null){jt();return}ze(),Xe(!1)}},[ze,Xe,jt]),at=Q==="closing"?ye??S:S,Lt=at&&J&&(Q==="opening"||nt)?kg(at,J):void 0,It=Ne&&F?kt(F,"center"):Le>0?`translateY(${Le}px)`:Lt,ft=J?jo(J,_):null,At=!!(at&&J),Ot=At&&(Q==="closing"||Q==="open"&&z),Ht={position:"absolute",top:ft==null?void 0:ft.top,left:ft==null?void 0:ft.left,width:ft==null?void 0:ft.width,height:ft==null?void 0:ft.height,objectFit:"contain",transformOrigin:"top left",transform:It,opacity:Le>0?Ze:At?1:Q==="opening"||nt?0:1,transition:le&&!se?"none":se?`transform ${Zi}ms ${un}`:j?`transform ${$n}ms ${un}, opacity ${$n}ms ${un}`:Ot?`transform ${$n}ms ${un}`:Q==="opening"||nt?`opacity ${$n}ms ${un}`:"none",pointerEvents:He&&ut&&!Ne?"auto":"none",touchAction:He&&ut?"none":void 0,zIndex:1,overflow:He?"hidden":void 0},Vt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:ut&&!Ne?"auto":"none"},xt=(f,be,Fe="adjacent")=>{const We=ht(f);if(!We)return{display:"none"};const st=Fe==="far"?be==="left"?"far-left":"far-right":be==="left"?"left-adjacent":"right-adjacent",{start:Pt}=Pe!==null?yc(We,st,Pe,_):{start:Fe==="far"?ur(We,be,_):Ni(We,be,_)},et=jo(Pt,_),mt=kt(f,st),_t=!Ne&&Fe==="adjacent"&&ut&&!Ee?zg(We,be,_):null,Et=Fe==="far"&&Ne&&Pe===(be==="left"?-1:1),cn=le&&!se?!1:se,dn=Fe==="adjacent"&&ut&&Ee&&!Ne;return{position:"absolute",top:et.top,left:et.left,width:et.width,height:et.height,objectFit:"contain",transform:mt??(_t?`translate(${_t.x}px, ${_t.y}px)`:void 0),opacity:Fe==="far"?ut&&Et?1:0:ut?1:0,transition:cn?Fe==="far"?`transform ${Zi}ms ${un}`:`transform ${Zi}ms ${un}, opacity ${$n}ms ${un}`:dn?`transform ${$n}ms ${un}`:Q==="opening"||nt?`opacity ${$n}ms ${un}`:"none",pointerEvents:"none",zIndex:1}},Gt=(f,be)=>{const Fe=ht(f);return Fe?jg(Ni(Fe,be,_),be,_):null},Kt=f=>be=>{if(!l){if(A.current){A.current=!1;return}be.stopPropagation(),Tt(f)}},Xt=ne?Gt(ne,"left"):null,Zt=Me?Gt(Me,"right"):null,Dt=Xt?jo(Xt,_):null,St=Zt?jo(Zt,_):null;return r.jsxs("div",{ref:I,className:[`${e}-lightbox`,s?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:Q==="open"?"none":void 0},onClick:Rt,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:ut?Ut:0,transition:le?"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:ut?1:0,transition:le?"none":`opacity ${$n}ms ${un}`,pointerEvents:"none"},children:r.jsx(gc,{prefix:e,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,onClose:Rt})})]}),ut&&pt&&r.jsx(Do,{media:pt,style:xt(pt,"left","far"),onMeasure:ot,onTransitionEnd:Je},`far-prev-${pt.url}`),ut&&ne&&r.jsxs(r.Fragment,{children:[r.jsx(Do,{media:ne,style:xt(ne,"left"),onMeasure:ot,onTransitionEnd:Je},`prev-${ne.url}`),Dt&&r.jsx("div",{style:{position:"absolute",top:Dt.top,left:Dt.left,width:Dt.width,height:Dt.height,cursor:l||le?"default":"pointer",pointerEvents:l||le?"none":"auto",zIndex:3},onClick:Kt(-1)})]}),ut&&Me&&r.jsxs(r.Fragment,{children:[r.jsx(Do,{media:Me,style:xt(Me,"right"),onMeasure:ot,onTransitionEnd:Je},`next-${Me.url}`),St&&r.jsx("div",{style:{position:"absolute",top:St.top,left:St.left,width:St.width,height:St.height,cursor:l||le?"default":"pointer",pointerEvents:l||le?"none":"auto",zIndex:3},onClick:Kt(1)})]}),ut&&bt&&r.jsx(Do,{media:bt,style:xt(bt,"right","far"),onMeasure:ot,onTransitionEnd:Je},`far-next-${bt.url}`),J&&F&&(He?r.jsx(qg,{src:F.url,phase:Q,onMediaElement:Ge,wrapperStyle:Ht,videoStyle:Vt,onLoadedMetadata:Te,onTransitionEnd:Je},`${n}-${F.url}`):r.jsx("img",{ref:Ge,src:F.url,alt:F.name,onLoad:Te,onTransitionEnd:Je,style:Ht},`${n}-${F.url}`))]})}function Kg({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:s,portalId:l}){const{prefix:d}=v.useScopedStyles(),{gridLayout:c,verticalGap:u,align:p="top",imageDisplay:b}=e,S=(b==null?void 0:b.display)==="cover",T=(b==null?void 0:b.ratioValue)??"1:1",g=(b==null?void 0:b.reversed)??!1,[$,h]=T.split(":").map(Number),E=`${g?h:$} / ${g?$:h}`,Z=c.entryWidth??.2,P=c.columnsCount,B=v.scalingValue(Z,n),M=v.scalingValue(c.horizontalGap??0,n),C=B,W=B,y={width:C,...S?{aspectRatio:E,height:"auto",overflow:"hidden"}:{height:"auto"}},x=S?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},A=a.useRef(null),[H,K]=a.useState(!1),[G,Y]=a.useState([]),[V,D]=a.useState(0),[O,L]=a.useState(0),[U,J]=a.useState(null),[ce,_]=a.useState({title1:"",title2:"",title3:""}),de=(()=>{const xe={},Se=A.current?getComputedStyle(A.current).getPropertyValue("--cntrl-article-width").trim():"";return Se&&(xe["--cntrl-article-width"]=Se),xe})(),w=!n||i||o,ge=a.useMemo(()=>Tg(d),[d]),Q=t??[],ve=Q.length%P||P,Le=ve<P&&Q.length>0,pe=Q.length-ve,ae=Le?Math.floor((P-ve)/2)+1:1,q=a.useMemo(()=>Ag(Q),[Q]),se=a.useMemo(()=>Hg(Q),[Q]),he=(xe,Se,z)=>{if(n&&!o&&!i)return;const me=q.findIndex(ue=>ue.gridIndex===xe);if(me<0)return;const ye=q[me];L(me),Y(ye.items),D(Se),_(ye.entry),J(z??null),K(!0)},Pe=a.useCallback(()=>{K(!1),J(null)},[]),Ce=a.useCallback(()=>{const xe=q[O];return!xe||!A.current?U:Pg(A.current,xe.gridIndex,S?"cover":"contain")??U},[q,O,U,S]),ke=a.useCallback(xe=>{if(q.length>1){const Se=q.length,z=(O+xe+Se)%Se,me=q[z],ye=Math.min(V,me.items.length-1);L(z),Y(me.items),D(ye),_(me.entry);return}D(Se=>(Se+xe+G.length)%G.length)},[q,O,V,G.length]),fe=q.length>1||G.length>1;return a.useEffect(()=>{if(!H||typeof document>"u")return;const xe=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=xe}},[H]),a.useEffect(()=>{!n||o||i||K(!1)},[n,o,i]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:ge}}),r.jsx(Og,{mediaList:se}),r.jsx("div",{ref:A,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${P}, ${B})`,rowGap:0,columnGap:M,width:v.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:v.scalingValue(u??0,n)},children:Q.map((xe,Se)=>{const z=Za(xe.gallery),me=Ja(z),ye=me.filter(te=>te.lightboxMedia).map(te=>te.lightboxMedia),ue=Math.floor(Se/P)===Math.ceil(Q.length/P)-1,Ee=Le&&Se>=pe?`${ae+(Se-pe)}`:void 0,we=me[0],k=we!=null&&we.lightboxMedia?ye.findIndex(te=>te.url===we.lightboxMedia.url):-1,le=r.jsx("div",{className:`${d}-item-image-wrapper`,style:y,children:me.length>0&&r.jsx(Gg,{media:we.displayMedia,gridIndex:Se,className:`${d}-item-${Ki(we.displayMedia)?"video":"image"}`.trim(),style:x,onMediaClick:w&&k>=0?te=>he(Se,k,hc(te.currentTarget,S?"cover":"contain")):void 0})});return r.jsx("div",{className:`${d}-item`,children:r.jsxs("div",{className:[o?`${d}-item-inner`:`${d}-item-inner-hidden`,ue?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:B,...Ee?{gridColumn:Ee}:{}},children:[r.jsx("div",{className:`${d}-item-title-row`,children:r.jsx("div",{style:{height:0,width:W}})}),r.jsx("a",{className:`${d}-item-image-link`,children:le}),r.jsx("div",{className:`${d}-item-subtitle-row`,children:r.jsx("div",{style:{height:0,width:W}})})]})},Se)})}),H&&typeof document<"u"&&(()=>{const xe=(l?document.getElementById(l):null)??document.body;return Yn.createPortal(r.jsx("div",{style:de,"data-selection":"none",children:r.jsx(Ug,{prefix:d,items:G,index:V,entry:ce,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:fe,lightboxEntries:q,entryIdx:O,layoutId:s,sourceRect:U,resolveCloseSourceRect:Ce,onClose:Pe,onPrev:()=>ke(-1),onNext:()=>ke(1)})}),xe)})()]})}const Xg=`import { CommonComponentProps } from '../props';
|
|
6370
|
+
`}const Hs={url:"",name:"",objectFit:"cover"},$n=500,Zi=650,un="cubic-bezier(0.22, 1, 0.36, 1)",Lg=72,Ig=50,Rg=1e4,Eg=650,Mg=500;function kg(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 hc(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=dr(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 Pg(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?hc(i,n):null}function Ag(e){return e.reduce((t,n,i)=>{const o=Ja(n.gallery),l=Qa(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 to(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 Os(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return to(e,i,n)}const Fg=.03;function fc(e){return e.width*Fg}const Ur={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Do(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function Ds(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Wg(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function ba(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 _g(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:ba(e,t.width,t.height)}function Ng(e,t){if(Ki(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 Hg(e){const t=new Set,n=[];for(const i of e){const o=Ja(i.gallery),s=Qa(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 Og({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=>Ki(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 Ni(e,t,n){const{width:i,height:o,top:s}=e,{left:l,width:d}=n,c=fc(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 ur(e,t,n){const i=Ni(e,t,n);return{...i,left:2*i.left-e.left}}function Dg(e,t,n){const{left:i,width:o}=n,s=fc(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 yc(e,t,n,i){const o=Ni(e,"left",i),s=Ni(e,"right",i),l=ur(e,"left",i),d=ur(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}=yc(e,t,n,i);return{x:s.left-o.left,y:s.top-o.top}}function zg(e,t,n){const i=Ni(e,t,n),o=ur(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function vc(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 Ja(e){if(!e)return;if(vc(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??Hs,i??o??Hs]}]}function Bg(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Vg(e){const[t]=e.media;return t!=null&&t.url?t:null}function Qa(e){if(!Array.isArray(e)||e.length===0)return[];if(vc(e)){const t=[];for(const n of e){const i=Bg(n);if(!i)continue;const o=Vg(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 Ki(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function Gg({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return Ki(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 qg({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 jo({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Ki(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 Ug({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:w,sourceRect:v,resolveCloseSourceRect:T,onClose:g,onPrev:$,onNext:f}){const R=a.useRef(null),L=a.useRef(null),I=a.useRef(null),Y=a.useRef(new Map),[P,V]=a.useState(0),M=a.useRef(null),C=a.useRef(0),A=a.useRef(0),y=a.useRef("none"),S=a.useRef(!1),F=a.useRef(!1),W=a.useRef(!1),U=a.useRef(null),G=a.useRef(null),J=a.useRef(null),D=a.useRef(()=>{}),j=a.useRef(null),O=a.useRef(null),E=a.useRef(null),K=a.useRef(!1),[Z,ce]=a.useState(null),[N,pe]=a.useState(Ur),[b,he]=a.useState(0),[Q,we]=a.useState("opening"),[Te,se]=a.useState(0),[oe,q]=a.useState(0),[de,ge]=a.useState(!1),[_e,Ce]=a.useState(null),[Me,fe]=a.useState(null),[ye,Se]=a.useState(null),[B,ue]=a.useState(!1),[ve,me]=a.useState(null),[Ee,be]=a.useState(!1),k=a.useRef(!1),[re,te]=a.useState(!1),[z,le]=a.useState(!1),Re=a.useRef(n),ae=a.useRef(void 0),_=t[n],Ne=_?Ki(_):!1,Fe=oe!==0||de,et=!l&&(!s||!!d),Ke=c&&!l,Ie=u.length>1,ee=a.useCallback((h,xe)=>t.length<=1?null:t[(h+xe+t.length)%t.length]??null,[t]),ne=Ie?to(u,p,-1):ee(n,-1),He=Ie?to(u,p,1):ee(n,1),st=_e===-1&&Fe?Ie&&Me!==null?to(u,Me,-1):ye!==null?ee(ye,-1):null:null,Be=_e===1&&Fe?Ie&&Me!==null?to(u,Me,1):ye!==null?ee(ye,1):null:null,Oe=st&&st.url!==(ne==null?void 0:ne.url)?st:null,je=Be&&Be.url!==(He==null?void 0:He.url)?Be:null,qe=ne&&Ke?(()=>{const h=Ie?Os(u,p,-1):t.length>2?ee((n-1+t.length)%t.length,-1):null;return h&&h.url!==ne.url?h:null})():null,tt=He&&Ke?(()=>{const h=Ie?Os(u,p,1):t.length>2?ee((n+1)%t.length,1):null;return h&&h.url!==He.url?h:null})():null,mt=Oe??qe,St=je??tt,lt=a.useCallback((h,xe,Pe)=>{if(!h||!xe||!Pe)return;const Ae=Y.current,at=Ae.get(h);(at==null?void 0:at.width)===xe&&(at==null?void 0:at.height)===Pe||(Ae.set(h,{width:xe,height:Pe}),V(At=>At+1))},[]),pt=a.useCallback(h=>{if(!(h!=null&&h.url))return null;const xe=Y.current.get(h.url);return _g(L.current,xe)},[P,b]),Mt=a.useCallback(()=>{if(!_)return;const h=pt(_);if(h){ce(h);return}const xe=L.current;xe&&ce(Ds(xe))},[_,pt]),nt=a.useCallback(h=>{if(Ie){const xe=u.length;fe((p+h+xe)%xe),Se(null);return}t.length>1&&(Se((n+h+t.length)%t.length),fe(null))},[Ie,u.length,p,t.length,n]),Ve=a.useCallback(h=>{W.current=h,ge(h)},[]),De=a.useCallback(()=>{U.current!==null&&(window.clearTimeout(U.current),U.current=null)},[]),vt=a.useCallback(()=>{De(),U.current=window.setTimeout(()=>{De(),Ve(!1)},Zi+32)},[De,Ve]),bt=a.useCallback(()=>{const h=R.current;if(!h){pe({left:0,top:0,width:typeof window<"u"?window.innerWidth:Ur.width,height:typeof window<"u"?window.innerHeight:Ur.height});return}const xe=h.getBoundingClientRect();pe({left:xe.left,top:xe.top,width:xe.width,height:xe.height})},[]),Pt=a.useCallback((h,xe)=>{if(Fe){if(re&&!de)return`translate(${oe}px, 0px)`;if(de&&_e!==null){const Pe=pt(h);if(!Pe)return;const{x:Ae,y:at}=jg(Pe,xe,_e,N);return`translate(${Ae}px, ${at}px)`}if(de)return"translate(0px, 0px)"}},[Fe,re,de,oe,_e,N,pt]),Dt=a.useCallback(()=>{const h=G.current;G.current=null,De(),Ve(!1),Ce(null),fe(null),Se(null),q(0),te(!1),S.current=!1,A.current=0,y.current="none",h===-1?$():h===1&&f()},[De,Ve,$,f]),tn=a.useCallback(()=>{De(),U.current=window.setTimeout(()=>{G.current!==null&&Dt()},Zi+32)},[De,Dt]),ln=a.useCallback(()=>{De(),G.current=null,Ve(!1),Ce(null),fe(null),Se(null),q(0),te(!1),S.current=!1,A.current=0,y.current="none"},[De,Ve]),Tt=a.useCallback(h=>{if(!(!Ke||!Z)){if(W.current){if(G.current===h){J.current=h,Dt();return}ln()}De(),nt(h),G.current=h,Ce(h),Ve(!0),tn()}},[Ke,Z,Dt,ln,De,nt,Ve,tn]);D.current=Tt;const kt=a.useCallback(()=>{j.current=null,K.current=!1,O.current!==null&&(window.clearInterval(O.current),O.current=null),E.current!==null&&(window.clearTimeout(E.current),E.current=null)},[]),Yt=a.useCallback(h=>{O.current!==null&&window.clearInterval(O.current);const xe=K.current?Mg:Eg;O.current=window.setInterval(()=>{D.current(h)},xe)},[]),qt=a.useCallback(h=>{j.current!==h&&(kt(),j.current=h,K.current=!1,D.current(h),Yt(h),E.current=window.setTimeout(()=>{E.current=null,j.current===h&&(K.current=!0,Yt(h))},Rg))},[kt,Yt]),Le=a.useCallback(()=>{const h=L.current;if(!h)return;const xe=_==null?void 0:_.url,Pe=xe?Y.current.get(xe):void 0;if(Pe!=null&&Pe.width&&(Pe!=null&&Pe.height)){ce(ba(h,Pe.width,Pe.height));return}const Ae=I.current;if(Ae&&xe&&(Ae.src===xe||Ae.currentSrc===xe)){const{width:At,height:Qe}=Wg(Ae);if(At&&Qe){lt(xe,At,Qe),ce(ba(h,At,Qe));return}}const at=Ds(h);!at.width||!at.height||ce(at)},[_==null?void 0:_.url,lt]),Ue=a.useCallback(h=>{if(I.current=h,!!h){if(h instanceof HTMLVideoElement){h.readyState>=1&&h.videoWidth>0&&Le();return}h.complete&&h.naturalWidth>0&&Le()}},[Le]),Xe=a.useCallback(()=>{bt(),Le(),he(h=>h+1)},[bt,Le]);a.useEffect(()=>{Xe();const h=L.current,xe=R.current,Pe=new ResizeObserver(()=>Xe());return h&&Pe.observe(h),xe&&Pe.observe(xe),window.addEventListener("resize",Xe),()=>{Pe.disconnect(),window.removeEventListener("resize",Xe)}},[Xe,n,w]),a.useLayoutEffect(()=>{if(!_)return;const h=I.current;if(h){if(h instanceof HTMLImageElement&&h.complete&&h.naturalWidth>0){Le();return}h instanceof HTMLVideoElement&&h.readyState>=1&&h.videoWidth>0&&Le()}},[_==null?void 0:_.url,n,Le]),a.useEffect(()=>{Mt()},[Mt,P]),a.useEffect(()=>{const h=new Set,xe=[],Pe=Ae=>{!(Ae!=null&&Ae.url)||h.has(Ae.url)||(h.add(Ae.url),xe.push(Ae))};t.forEach(Pe),u.forEach(Ae=>Ae.items.forEach(Pe)),xe.forEach(Ae=>{Y.current.has(Ae.url)||Ng(Ae,lt)})},[t,u,lt]),a.useEffect(()=>{if(Q!=="opening"||!Z)return;if(!v){we("open");return}ue(!1);const h=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ue(!0),we("open")})});return()=>cancelAnimationFrame(h)},[Q,Z,v]),a.useEffect(()=>{if(Q!=="closing")return;const h=setTimeout(()=>g(),$n);return()=>clearTimeout(h)},[Q,g]),a.useEffect(()=>()=>{De()},[De]),a.useLayoutEffect(()=>{Re.current===n&&ae.current===(_==null?void 0:_.url)||(De(),G.current=null,Ce(null),fe(null),Se(null),se(0),q(0),Ve(!1),le(!1),te(!1),C.current=0,A.current=0,y.current="none",S.current=!1,M.current=null,F.current=!1,I.current=null,Mt(),Re.current=n,ae.current=_==null?void 0:_.url)},[n,_==null?void 0:_.url,Ve,De,Mt]),a.useLayoutEffect(()=>{const h=J.current;h!==null&&(J.current=null,requestAnimationFrame(()=>{D.current(h)}))},[n,p,_==null?void 0:_.url]),a.useLayoutEffect(()=>{if(Q==="opening"){k.current=!1,be(!1);return}if(Q!=="open"||k.current)return;if(!ne&&!He){k.current=!0;return}be(!1);const h=requestAnimationFrame(()=>{requestAnimationFrame(()=>{be(!0),k.current=!0})});return()=>cancelAnimationFrame(h)},[Q,ne==null?void 0:ne.url,He==null?void 0:He.url]),a.useEffect(()=>{if(Q!=="open")return;const h=()=>{const Qe=gt=>{gt.stopPropagation(),gt.preventDefault(),document.removeEventListener("click",Qe,!0)};document.addEventListener("click",Qe,!0)},xe=Qe=>{const gt=Qe<0?1:-1;De(),nt(gt),G.current=gt,Ce(gt),Ve(!0),tn()},Pe=Qe=>{if(Math.abs(Qe)>Ig&&Ke){xe(Qe);return}G.current=null,Ce(null),fe(null),Se(null),Ve(!0),q(0),vt()},Ae=Qe=>{if(Qe.touches.length!==1||W.current)return;const gt=Qe.touches[0];F.current=!0,M.current={x:gt.clientX,y:gt.clientY},y.current="none",A.current=0,S.current=!1},at=Qe=>{if(!M.current||Qe.touches.length!==1||W.current)return;const gt=Qe.touches[0],_t=gt.clientX-M.current.x,Et=gt.clientY-M.current.y;if(y.current==="none"){if(Math.abs(_t)<10&&Math.abs(Et)<10)return;if(Math.abs(_t)>Math.abs(Et)){if(!Ke)return;y.current="horizontal"}else if(Et>0){if(!et)return;y.current="vertical"}else return}if(y.current==="horizontal"){S.current=!0,te(!0),A.current=_t,q(_t),Qe.preventDefault();return}y.current==="vertical"&&(S.current=!0,te(!0),C.current=Et,se(Et),Qe.preventDefault())},At=()=>{if(!M.current)return;const Qe=y.current,gt=S.current;if(gt&&Qe==="horizontal")Pe(A.current),h();else if(gt&&Qe==="vertical"){const _t=C.current;if(et&&_t>Lg){const Et=window.innerHeight;C.current=Et,le(!0),se(Et),we("closing")}else C.current=0,se(0);h()}else Qe==="horizontal"&&Math.abs(A.current)>0&&(Pe(A.current),h());M.current=null,y.current="none",A.current=0,S.current=!1,te(!1)};return document.addEventListener("touchstart",Ae,{passive:!0}),document.addEventListener("touchmove",at,{passive:!1}),document.addEventListener("touchend",At),document.addEventListener("touchcancel",At),()=>{document.removeEventListener("touchstart",Ae),document.removeEventListener("touchmove",at),document.removeEventListener("touchend",At),document.removeEventListener("touchcancel",At)}},[Q,Ke,Ve,vt,De,et,tn,nt]);const ct=a.useCallback(()=>{const h=(T==null?void 0:T())??v??null;h&&Z&&(me(h),ue(!0)),we("closing")},[T,v,Z]);a.useEffect(()=>{const h=Ae=>{if(Ae.key==="Escape"){if(s&&d||Q==="closing")return;kt(),ct();return}if(Ae.key!=="ArrowLeft"&&Ae.key!=="ArrowRight"||Q!=="open"||!Ke)return;Ae.preventDefault();const at=Ae.key==="ArrowLeft"?-1:1;Ae.repeat&&j.current===at||qt(at)},xe=Ae=>{if(Ae.key!=="ArrowLeft"&&Ae.key!=="ArrowRight")return;const at=Ae.key==="ArrowLeft"?-1:1;j.current===at&&kt()},Pe=()=>{kt()};return window.addEventListener("keydown",h),window.addEventListener("keyup",xe),window.addEventListener("blur",Pe),()=>{window.removeEventListener("keydown",h),window.removeEventListener("keyup",xe),window.removeEventListener("blur",Pe),kt()}},[Q,s,d,ct,Ke,qt,kt]),a.useEffect(()=>{Q!=="open"&&kt()},[Q,kt]);const Rt=()=>{Q==="closing"||l||ct()},ut=Q==="open",it=Q==="closing",Ut=Te>0?Math.max(0,1-Te/500):1,Ze=Te>0?Math.max(.35,1-Te/500):1,Je=a.useCallback(h=>{if(!(h.propertyName!=="transform"||!W.current)){if(G.current!==null){Dt();return}De(),Ve(!1)}},[De,Ve,Dt]),rt=Q==="closing"?ve??v:v,Lt=rt&&Z&&(Q==="opening"||it)?kg(rt,Z):void 0,It=Fe&&_?Pt(_,"center"):Te>0?`translateY(${Te}px)`:Lt,ft=Z?Do(Z,N):null,Ft=!!(rt&&Z),Ot=Ft&&(Q==="closing"||Q==="open"&&B),Ht={position:"absolute",top:ft==null?void 0:ft.top,left:ft==null?void 0:ft.left,width:ft==null?void 0:ft.width,height:ft==null?void 0:ft.height,objectFit:"contain",transformOrigin:"top left",transform:It,opacity:Te>0?Ze:Ft?1:Q==="opening"||it?0:1,transition:re&&!de?"none":de?`transform ${Zi}ms ${un}`:z?`transform ${$n}ms ${un}, opacity ${$n}ms ${un}`:Ot?`transform ${$n}ms ${un}`:Q==="opening"||it?`opacity ${$n}ms ${un}`:"none",pointerEvents:Ne&&ut&&!Fe?"auto":"none",touchAction:Ne&&ut?"none":void 0,zIndex:1,overflow:Ne?"hidden":void 0},Vt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:ut&&!Fe?"auto":"none"},xt=(h,xe,Pe="adjacent")=>{const Ae=pt(h);if(!Ae)return{display:"none"};const at=Pe==="far"?xe==="left"?"far-left":"far-right":xe==="left"?"left-adjacent":"right-adjacent",{start:At}=_e!==null?yc(Ae,at,_e,N):{start:Pe==="far"?ur(Ae,xe,N):Ni(Ae,xe,N)},Qe=Do(At,N),gt=Pt(h,at),_t=!Fe&&Pe==="adjacent"&&ut&&!Ee?zg(Ae,xe,N):null,Et=Pe==="far"&&Fe&&_e===(xe==="left"?-1:1),cn=re&&!de?!1:de,dn=Pe==="adjacent"&&ut&&Ee&&!Fe;return{position:"absolute",top:Qe.top,left:Qe.left,width:Qe.width,height:Qe.height,objectFit:"contain",transform:gt??(_t?`translate(${_t.x}px, ${_t.y}px)`:void 0),opacity:Pe==="far"?ut&&Et?1:0:ut?1:0,transition:cn?Pe==="far"?`transform ${Zi}ms ${un}`:`transform ${Zi}ms ${un}, opacity ${$n}ms ${un}`:dn?`transform ${$n}ms ${un}`:Q==="opening"||it?`opacity ${$n}ms ${un}`:"none",pointerEvents:"none",zIndex:1}},Gt=(h,xe)=>{const Pe=pt(h);return Pe?Dg(Ni(Pe,xe,N),xe,N):null},Kt=h=>xe=>{if(!l){if(F.current){F.current=!1;return}xe.stopPropagation(),Tt(h)}},Xt=ne?Gt(ne,"left"):null,Zt=He?Gt(He,"right"):null,jt=Xt?Do(Xt,N):null,wt=Zt?Do(Zt,N):null;return r.jsxs("div",{ref:R,className:[`${e}-lightbox`,s?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:Q==="open"?"none":void 0},onClick:Rt,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:ut?Ut:0,transition:re?"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:L,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{height:"10%"}})]}),r.jsx("div",{style:{position:"absolute",inset:0,opacity:ut?1:0,transition:re?"none":`opacity ${$n}ms ${un}`,pointerEvents:"none"},children:r.jsx(gc,{prefix:e,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,onClose:Rt})})]}),ut&&mt&&r.jsx(jo,{media:mt,style:xt(mt,"left","far"),onMeasure:lt,onTransitionEnd:Je},`far-prev-${mt.url}`),ut&&ne&&r.jsxs(r.Fragment,{children:[r.jsx(jo,{media:ne,style:xt(ne,"left"),onMeasure:lt,onTransitionEnd:Je},`prev-${ne.url}`),jt&&r.jsx("div",{style:{position:"absolute",top:jt.top,left:jt.left,width:jt.width,height:jt.height,cursor:l||re?"default":"pointer",pointerEvents:l||re?"none":"auto",zIndex:3},onClick:Kt(-1)})]}),ut&&He&&r.jsxs(r.Fragment,{children:[r.jsx(jo,{media:He,style:xt(He,"right"),onMeasure:lt,onTransitionEnd:Je},`next-${He.url}`),wt&&r.jsx("div",{style:{position:"absolute",top:wt.top,left:wt.left,width:wt.width,height:wt.height,cursor:l||re?"default":"pointer",pointerEvents:l||re?"none":"auto",zIndex:3},onClick:Kt(1)})]}),ut&&St&&r.jsx(jo,{media:St,style:xt(St,"right","far"),onMeasure:lt,onTransitionEnd:Je},`far-next-${St.url}`),Z&&_&&(Ne?r.jsx(qg,{src:_.url,phase:Q,onMediaElement:Ue,wrapperStyle:Ht,videoStyle:Vt,onLoadedMetadata:Le,onTransitionEnd:Je},`${n}-${_.url}`):r.jsx("img",{ref:Ue,src:_.url,alt:_.name,onLoad:Le,onTransitionEnd:Je,style:Ht},`${n}-${_.url}`))]})}function Kg({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:s,portalId:l}){const{prefix:d}=x.useScopedStyles(),{gridLayout:c,verticalGap:u,align:p="top",imageDisplay:w}=e,v=(w==null?void 0:w.display)==="cover",T=(w==null?void 0:w.ratioValue)??"1:1",g=(w==null?void 0:w.reversed)??!1,[$,f]=T.split(":").map(Number),I=`${g?f:$} / ${g?$:f}`,Y=c.entryWidth??.2,P=c.columnsCount,V=x.scalingValue(Y,n),M=x.scalingValue(c.horizontalGap??0,n),C=V,A=V,y={width:C,...v?{aspectRatio:I,height:"auto",overflow:"hidden"}:{height:"auto"}},S=v?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},F=a.useRef(null),[W,U]=a.useState(!1),[G,J]=a.useState([]),[D,j]=a.useState(0),[O,E]=a.useState(0),[K,Z]=a.useState(null),[ce,N]=a.useState({title1:"",title2:"",title3:""}),pe=(()=>{const ye={},Se=F.current?getComputedStyle(F.current).getPropertyValue("--cntrl-article-width").trim():"";return Se&&(ye["--cntrl-article-width"]=Se),ye})(),b=!n||i||o,he=a.useMemo(()=>Tg(d),[d]),Q=t??[],we=Q.length%P||P,Te=we<P&&Q.length>0,se=Q.length-we,oe=Te?Math.floor((P-we)/2)+1:1,q=a.useMemo(()=>Ag(Q),[Q]),de=a.useMemo(()=>Hg(Q),[Q]),ge=(ye,Se,B)=>{if(n&&!o&&!i)return;const ue=q.findIndex(me=>me.gridIndex===ye);if(ue<0)return;const ve=q[ue];E(ue),J(ve.items),j(Se),N(ve.entry),Z(B??null),U(!0)},_e=a.useCallback(()=>{U(!1),Z(null)},[]),Ce=a.useCallback(()=>{const ye=q[O];return!ye||!F.current?K:Pg(F.current,ye.gridIndex,v?"cover":"contain")??K},[q,O,K,v]),Me=a.useCallback(ye=>{if(q.length>1){const Se=q.length,B=(O+ye+Se)%Se,ue=q[B],ve=Math.min(D,ue.items.length-1);E(B),J(ue.items),j(ve),N(ue.entry);return}j(Se=>(Se+ye+G.length)%G.length)},[q,O,D,G.length]),fe=q.length>1||G.length>1;return a.useEffect(()=>{if(!W||typeof document>"u")return;const ye=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ye}},[W]),a.useEffect(()=>{!n||o||i||U(!1)},[n,o,i]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:he}}),r.jsx(Og,{mediaList:de}),r.jsx("div",{ref:F,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${P}, ${V})`,rowGap:0,columnGap:M,width:x.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:x.scalingValue(u??0,n)},children:Q.map((ye,Se)=>{const B=Ja(ye.gallery),ue=Qa(B),ve=ue.filter(te=>te.lightboxMedia).map(te=>te.lightboxMedia),me=Math.floor(Se/P)===Math.ceil(Q.length/P)-1,Ee=Te&&Se>=se?`${oe+(Se-se)}`:void 0,be=ue[0],k=be!=null&&be.lightboxMedia?ve.findIndex(te=>te.url===be.lightboxMedia.url):-1,re=r.jsx("div",{className:`${d}-item-image-wrapper`,style:y,children:ue.length>0&&r.jsx(Gg,{media:be.displayMedia,gridIndex:Se,className:`${d}-item-${Ki(be.displayMedia)?"video":"image"}`.trim(),style:S,onMediaClick:b&&k>=0?te=>ge(Se,k,hc(te.currentTarget,v?"cover":"contain")):void 0})});return r.jsx("div",{className:`${d}-item`,children:r.jsxs("div",{className:[o?`${d}-item-inner`:`${d}-item-inner-hidden`,me?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:V,...Ee?{gridColumn:Ee}:{}},children:[r.jsx("div",{className:`${d}-item-title-row`,children:r.jsx("div",{style:{height:0,width:A}})}),r.jsx("a",{className:`${d}-item-image-link`,children:re}),r.jsx("div",{className:`${d}-item-subtitle-row`,children:r.jsx("div",{style:{height:0,width:A}})})]})},Se)})}),W&&typeof document<"u"&&(()=>{const ye=(l?document.getElementById(l):null)??document.body;return Yn.createPortal(r.jsx("div",{style:pe,"data-selection":"none",children:r.jsx(Ug,{prefix:d,items:G,index:D,entry:ce,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:fe,lightboxEntries:q,entryIdx:O,layoutId:s,sourceRect:K,resolveCloseSourceRect:Ce,onClose:_e,onPrev:()=>Me(-1),onNext:()=>Me(1)})}),ye)})()]})}const Xg=`import { CommonComponentProps } from '../props';
|
|
6371
6371
|
import { scalingValue, useScopedStyles } from '../utils/index';
|
|
6372
6372
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
6373
6373
|
import { createPortal } from 'react-dom';
|
|
@@ -8710,7 +8710,7 @@ export function Hive({
|
|
|
8710
8710
|
</>
|
|
8711
8711
|
);
|
|
8712
8712
|
}
|
|
8713
|
-
`,Yg="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>'),oi={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 Zg(e){const t={};return t[Ye(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Ye(e,"fontSettings")]={...oi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Ye(e,"fontSize")]={...oi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ye(e,"lineHeight")]={...oi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ye(e,"letterSpacing")]={...oi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ye(e,"wordSpacing")]={...oi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ye(e,"textAlign")]={...oi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ye(e,"textAppearance")]={...oi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Hi=Kn.filter(e=>e!=="count"),Jg=Hi.reduce((e,t)=>({...e,...Zg(t)}),{}),Qg=Hi.reduce((e,t)=>({...e,[Ye(t,"fontFamily")]:"Arial",[Ye(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Ye(t,"letterSpacing")]:0,[Ye(t,"wordSpacing")]:0,[Ye(t,"textAlign")]:"left",[Ye(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Kr(e){return Hi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Ye(n,"fontSize")]=i),o!==void 0&&(t[Ye(n,"lineHeight")]=o),t},{})}const eh={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Hi.map(e=>[Xa[e],Ya(e)]))},th={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},nh=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...th,gallery:[{media:[{url:`https://cdn.cntrl.site/component-assets/hive_${t}.jpg`,name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]});return e})(),ih={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{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"}},gallery:{type:"array",label:"Gallery",max:1,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"]}}}}}}}},required:["gallery"]},default:nh},settings:{sizing:"auto auto",properties:{gridLayout:{type:"grid-layout",scope:"layout",display:{type:"grid-layout"},gridParams:{type:"object",properties:{columnsCount:{type:"number",title:"Columns",min:1,max:9999,display:{type:"numeric-input"}},wrapperWidth:{type:"number",title:"Width",min:0},entryWidth:{type:"number",title:"Entry",min:0},horizontalGap:{type:"number",title:"Gutter",min:0}}}},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},align:{type:"string",scope:"layout",title:"Align",display:{type:"toggle-cycle",enum:["top","center","bottom"]}},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"}}},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"]}},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"}},title1Color:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",display:{type:"settings-color-picker"}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",min:0,display:{type:"range-control"}},...Jg},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:Yg,closeIconColor:"#000000",closeIconHoverColor:"#999999",...Qg},layoutDefaults:{m:{gridLayout:{entryWidth:.37837,horizontalGap:.081,wrapperWidth:1,columnsCount:2,lockedParam:"wrapperWidth"},verticalGap:.081,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.464864,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,contentMarginTop:.081,closeIconMaxWidth:.081,iconMarginRight:.05405,...Kr({title1FontSize:.04864,title1LineHeight:.056756,title2FontSize:.04864,title2LineHeight:.056756,title3FontSize:.04864,title3LineHeight:.056756})},t:{gridLayout:{entryWidth:.10416,horizontalGap:.013,wrapperWidth:1,columnsCount:8,lockedParam:"wrapperWidth"},verticalGap:.013,titleHeaderLayout:"desktop",title1Width:.3,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.026,closeIconMaxWidth:.039,iconMarginRight:.026,...Kr({title1FontSize:.02083,title1LineHeight:.02734,title2FontSize:.02083,title2LineHeight:.02734,title3FontSize:.02083,title3LineHeight:.02734})},d:{gridLayout:{entryWidth:.06944,horizontalGap:.006944,wrapperWidth:1,columnsCount:12,lockedParam:"wrapperWidth"},verticalGap:.00694,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.01,closeIconMaxWidth:.0125,iconMarginRight:.01,...Kr({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098})}},displayRules:[{if:{name:"imageDisplay.display",value:"cover"},then:{name:"properties.align.display.enabled",value:!1}}],layout:["__componentName__","gridLayout","verticalGap","align","imageDisplay","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","contentMarginTop","closeIconMaxWidth","iconMarginRight"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["verticalGap"]},{type:"row",title:"",items:["imageDisplay","align"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[eh]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},oh={element:Kg,id:"hive",name:"Catalogue",category:"grids",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/hive.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...Hi.map(e=>({path:`${Ye(e,"fontFamily")}`}))]},fontRelations:{...Hi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Ye(t,"fontFamily")}`}),{})},schema:ih,sourceCode:Xg};function rh(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)}function ah({media:e,className:t,style:n}){const i=a.useRef(null);return a.useEffect(()=>{if(!e.isVideo)return;const o=i.current;if(!o)return;const s=o.play();s&&s.catch(()=>{})},[e.isVideo,e.url]),e.isVideo?r.jsx("video",{ref:i,className:t,src:e.url,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):r.jsx("img",{className:t,src:e.url,alt:"",style:n})}function Xr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function sh(e){return String(e??"").trim().length>0}function js(e,t){const n=e.currentTarget,i=n.getBoundingClientRect(),o=e.clientY-i.top>i.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,o)}function Ds(e,t){const n=e.currentTarget,i=n.getBoundingClientRect(),o=e.clientY<i.top+i.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,o)}function zs(e,t,n,i,o,s,l){const d=v.scalingValue(s,l),c=v.scalingValue(0,l),u=e===0,p=e===t-1&&!o;return{borderTopWidth:u&&n?d:c,borderBottomWidth:!p||i?d:c}}function lh(e,t,n){const i=v.scalingValue(t,n),o=v.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Bs=10;function ch(e){return`
|
|
8713
|
+
`,Yg="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>'),oi={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 Zg(e){const t={};return t[Ye(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Ye(e,"fontSettings")]={...oi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Ye(e,"fontSize")]={...oi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ye(e,"lineHeight")]={...oi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ye(e,"letterSpacing")]={...oi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ye(e,"wordSpacing")]={...oi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ye(e,"textAlign")]={...oi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ye(e,"textAppearance")]={...oi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Hi=Kn.filter(e=>e!=="count"),Jg=Hi.reduce((e,t)=>({...e,...Zg(t)}),{}),Qg=Hi.reduce((e,t)=>({...e,[Ye(t,"fontFamily")]:"Arial",[Ye(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Ye(t,"letterSpacing")]:0,[Ye(t,"wordSpacing")]:0,[Ye(t,"textAlign")]:"left",[Ye(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Kr(e){return Hi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Ye(n,"fontSize")]=i),o!==void 0&&(t[Ye(n,"lineHeight")]=o),t},{})}const eh={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Hi.map(e=>[Ya[e],Za(e)]))},th={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},nh=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...th,gallery:[{media:[{url:`https://cdn.cntrl.site/component-assets/hive_${t}.jpg`,name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]});return e})(),ih={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{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"}},gallery:{type:"array",label:"Gallery",max:1,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"]}}}}}}}},required:["gallery"]},default:nh},settings:{sizing:"auto auto",properties:{gridLayout:{type:"grid-layout",scope:"layout",display:{type:"grid-layout"},gridParams:{type:"object",properties:{columnsCount:{type:"number",title:"Columns",min:1,max:9999,display:{type:"numeric-input"}},wrapperWidth:{type:"number",title:"Width",min:0},entryWidth:{type:"number",title:"Entry",min:0},horizontalGap:{type:"number",title:"Gutter",min:0}}}},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},align:{type:"string",scope:"layout",title:"Align",display:{type:"toggle-cycle",enum:["top","center","bottom"]}},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"}}},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"]}},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"}},title1Color:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",display:{type:"settings-color-picker"}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",min:0,display:{type:"range-control"}},...Jg},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:Yg,closeIconColor:"#000000",closeIconHoverColor:"#999999",...Qg},layoutDefaults:{m:{gridLayout:{entryWidth:.37837,horizontalGap:.081,wrapperWidth:1,columnsCount:2,lockedParam:"wrapperWidth"},verticalGap:.081,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.464864,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,contentMarginTop:.081,closeIconMaxWidth:.081,iconMarginRight:.05405,...Kr({title1FontSize:.04864,title1LineHeight:.056756,title2FontSize:.04864,title2LineHeight:.056756,title3FontSize:.04864,title3LineHeight:.056756})},t:{gridLayout:{entryWidth:.10416,horizontalGap:.013,wrapperWidth:1,columnsCount:8,lockedParam:"wrapperWidth"},verticalGap:.013,titleHeaderLayout:"desktop",title1Width:.3,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.026,closeIconMaxWidth:.039,iconMarginRight:.026,...Kr({title1FontSize:.02083,title1LineHeight:.02734,title2FontSize:.02083,title2LineHeight:.02734,title3FontSize:.02083,title3LineHeight:.02734})},d:{gridLayout:{entryWidth:.06944,horizontalGap:.006944,wrapperWidth:1,columnsCount:12,lockedParam:"wrapperWidth"},verticalGap:.00694,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.01,closeIconMaxWidth:.0125,iconMarginRight:.01,...Kr({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098})}},displayRules:[{if:{name:"imageDisplay.display",value:"cover"},then:{name:"properties.align.display.enabled",value:!1}}],layout:["__componentName__","gridLayout","verticalGap","align","imageDisplay","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","contentMarginTop","closeIconMaxWidth","iconMarginRight"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["verticalGap"]},{type:"row",title:"",items:["imageDisplay","align"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[eh]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},oh={element:Kg,id:"hive",name:"Catalogue",category:"grids",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/hive.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...Hi.map(e=>({path:`${Ye(e,"fontFamily")}`}))]},fontRelations:{...Hi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Ye(t,"fontFamily")}`}),{})},schema:ih,sourceCode:Xg};function rh(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)}function ah({media:e,className:t,style:n}){const i=a.useRef(null);return a.useEffect(()=>{if(!e.isVideo)return;const o=i.current;if(!o)return;const s=o.play();s&&s.catch(()=>{})},[e.isVideo,e.url]),e.isVideo?r.jsx("video",{ref:i,className:t,src:e.url,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):r.jsx("img",{className:t,src:e.url,alt:"",style:n})}function Xr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function sh(e){return String(e??"").trim().length>0}function js(e,t){const n=e.currentTarget,i=n.getBoundingClientRect(),o=e.clientY-i.top>i.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,o)}function zs(e,t){const n=e.currentTarget,i=n.getBoundingClientRect(),o=e.clientY<i.top+i.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,o)}function Bs(e,t,n,i,o,s,l){const d=x.scalingValue(s,l),c=x.scalingValue(0,l),u=e===0,p=e===t-1&&!o;return{borderTopWidth:u&&n?d:c,borderBottomWidth:!p||i?d:c}}function lh(e,t,n){const i=x.scalingValue(t,n),o=x.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Vs=10;function ch(e){return`
|
|
8714
8714
|
.${e}-wrapper {
|
|
8715
8715
|
display: grid;
|
|
8716
8716
|
align-items: start;
|
|
@@ -9079,7 +9079,7 @@ a.${e}-list-item {
|
|
|
9079
9079
|
overflow-wrap: anywhere;
|
|
9080
9080
|
word-break: break-word;
|
|
9081
9081
|
}
|
|
9082
|
-
`}const Xn=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Qa=["AColumn","BColumn","CColumn","DColumn","EColumn"],An="cutLabel",vo=[...Qa,An],Er=["A","B","C","D","E"];function xc(e){return`${e}ColumnVerticalAlign`}const wa=["Top","Center","Bottom"];function es(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return Er.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function dh(e){const t=es(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function uh(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return Er.includes(n)?n:null}function bc(e,t,n){const i=uh(e);return i?i===t?!1:dh(n[xc(i)]):!0}function xo(e){const t=es(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return Er.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function ph(e,t,n){if(wc(e,t,n))return xo(e);const i=xo(e);return i.kind==="baseline"?{kind:"top"}:i}function mh(e){const t=xo(e);return t.kind==="baseline"?{kind:"top"}:t}function wc(e,t,n){return bc(e,n,t)?xo(e).kind==="baseline":!1}function gh(e){const t={};let n=!1;for(const i of Er){const o=xc(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}bc(s,i,e)||(t[o]="Top",n=!0)}return n?t:null}function hh(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function fh(e){const t=xo(e).kind;return t==="baseline"?"center":t}function yh(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Vs(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function vh(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 Yr(e,t,n,i){const o=e.titleEl;if(!o)return 0;const s=o.closest(`.${n}`);if(!s)return 0;const l=vh(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 xh(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 bh(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 Ct(e,t){return`${e}${t.replace(/^text/,"Text")}`}const Sh={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function $h(e){return[Ct(e,"textFontFamily"),Ct(e,"textFontSettings"),{type:"row",items:[Ct(e,"textFontSize"),Ct(e,"textLineHeight"),Ct(e,"textLetterSpacing"),Ct(e,"textWordSpacing")]},Ct(e,"textTextAlign"),Ct(e,"textTextAppearance"),`${e}VerticalAlign`]}function Ch(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(vo.map(e=>[Sh[e],$h(e)]))}}function pr(e,t){const n=i=>{const o=Ct(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 Gs(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 nn(zt(n,t))}function qs(e,t,n,i){const o=pr(e,t),s=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<s?`${n} ${i}`:n}function Us(e,t,n,i){const o=pr(e,t),s=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=s?{}:{[`--${n}-title-leading-gap`]:v.scalingValue((s-l)/2,i)}}const fn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Oi=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],ji=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Di=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Th={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Lh=["hover","focus","filled","success","error"],Ks=.004,Ti=.004,Zr=Ti,ts=50,bo=1440,wo=ts/bo;function Sc(e){const t=typeof e=="number"&&e>0?e:bo;return ts/t}function Ih(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 bo}const $c={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function ao(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function Rh(e,t=1){const n=t/e;return Object.fromEntries(fn.map(i=>[i,n]))}function Eh(){return Object.fromEntries([...Oi.map(e=>[e,0]),...ji.map(e=>[e,0])])}function Mh(){return Object.fromEntries(Di.map(e=>[e,0]))}function zo(e){return Object.fromEntries(fn.map(t=>[t,typeof e[t]=="number"?e[t]:$c[t]]))}function Cc(e,t,n){const i=e-wo,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 ir(e,t,n){const i=ns(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 kh(e,t,n){const i={};for(let o=0;o<e;o+=1){const s=Oi[o],l=ji[o],d=typeof n[s]=="number"?n[s]:0,c=typeof n[l]=="number"?n[l]:0,u=Cc(t[o]??0,d,c);u.paddingLeft!==d&&(i[s]=u.paddingLeft),u.paddingRight!==c&&(i[l]=u.paddingRight)}return i}function ns(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)+wo;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]-wo;if(p<=0)continue;const b=Math.min(c,p);d[u]-=b,c-=b}return[...d,i[e-1]]}function Ph(e,t,n){if(e<=1)return{};const i=ns(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 Xs(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Xn]}function Ah(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function Fh(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=Oi[c],b=ji[c],S=Di[c],T=fn[l],g=Oi[l],$=ji[l],h=Di[l],I=n[u],R=n[p],E=n[b],Z=n[S];typeof I=="number"&&(s[T]=I),typeof R=="number"&&(s[g]=R),typeof E=="number"&&(s[$]=E),typeof Z=="number"&&(s[h]=Z)}return s}function Tc(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 Wh(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=ao(e),s=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...Rh(n,o),...Eh()};if(s)for(const d of Di)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,Mh());return Tc(e,l)?l:e}function _h(e,t,n){const i=gh(e);i&&(e={...e,...i});const o=Sc(n==null?void 0:n.designWidth),s=e.columns,l=t.columns,d=ao(e),c=ao(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof s=="number"?s:typeof l=="number"?l:Xn.length,b=E=>{if(u)return E;const Z=zo({...t,...E}),P=ao(E),B=ir(p,P,Z),M=kh(p,B,{...t,...E});return Object.keys(M).length===0?E:{...E,...M}};if(typeof s=="number"&&s!==l)return e;const S=Xs(e),T=Xs(t);if(!Ah(S,T))return b({...e,...Fh(S,T,t,p)});if(d<c&&typeof p=="number"&&!u){const E=zo({...t,...e});return b({...e,...Ph(p,d,E)})}if(u){const E=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,Z=Math.max(0,(d-o)/2);return E>Z?{...e,textPaddingLR:Z}:e}const g=zo({...t,...e}),$=ir(p,c,zo(t)),I=ir(p,d,g).some((E,Z)=>E<($[Z]??E)),R=fn.some(E=>{const Z=e[E],P=t[E];return typeof Z=="number"&&typeof P=="number"&&Z!==P});return I||R?b(e):e}function Nh(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(wo,i-o-s-wo)}function Hh(e,t){return Math.random()*(t-e)+e}function Oh(e){return Object.fromEntries(fn.map(t=>[t,typeof e[t]=="number"?e[t]:$c[t]]))}function Jr(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function jh(e,t,n,i,o,s){return e.slice(0,t).map((l,d)=>{const c=Oi[d],u=ji[d],p=Di[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 Dh({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:s,layoutId:l,onUpdateSettings:d}){const{prefix:c}=v.useScopedStyles(),u=!!o,{columns:p,type:b,wrapperWidth:S,entriesCount:T,cellMinHeight:g,dividerWidth:$,showVisibility:h,cut:I,showCut:R,cutCellMinHeight:E,cutLabel:Z,imageSize:P,imageOnHover:B,entryHoverEffect:M,entryHoverShowOption:C,rowPaddingTop:W,rowPaddingBottom:y,rowPaddingTopB:x,columnsOrder:A,textPaddingLR:H,textColor:K,backgroundColor:G,dividerColor:Y,textHoverColor:V,backgroundHoverColor:D,dividerHoverColor:O}=e,[L,U]=a.useState(void 0),[J,ce]=a.useState(null),_=B==="on"&&(!n||i),de=(I??0)>0,w=b==="b",ge=a.useRef(null),Q=a.useRef(null),[ve,Le]=a.useState(null),[pe,ae]=a.useState(bo),q=Sc(pe),se=Math.max(0,((S??0)-q)/2),he=Math.min(H??0,se),Pe=Math.max(he,Ti),Ce=((S??0)+q)/2;a.useLayoutEffect(()=>{if(!n){ae(bo);return}const Te=()=>{ae(Ih(ge.current))};Te();const Ge=ge.current;if(!Ge)return;const Ue=new ResizeObserver(Te);Ue.observe(Ge);let lt=Ge;for(;lt&&!lt.style.getPropertyValue("--cntrl-article-width");)lt=lt.parentElement;return lt&&Ue.observe(lt),()=>Ue.disconnect()},[n,l]),a.useEffect(()=>{U(void 0)},[I,R,t,T]),a.useEffect(()=>{n&&!i&&U(void 0)},[n,i]);const ke=v.buildColorVars(c,{textColor:K,backgroundColor:G,dividerColor:Y,textHoverColor:V,backgroundHoverColor:D,dividerHoverColor:O},Th,Lh),fe=s&&s!=="default"?`${c}-state-${s}`:"",Se=`${!n||i?M==="default"?`${c}-entry-hover-default`:M==="blinds"?`${c}-entry-hover-blinds`:M==="reveal"?`${c}-entry-hover-reveal`:"":""} ${fe}`.trim(),z=M==="reveal"&&(!n||i),me=(h==null?void 0:h[0])??!1,ye=(h==null?void 0:h[1])??!1,ue=a.useRef(e),Ee=a.useRef(l);a.useEffect(()=>{if(!d||!n){ue.current=e,Ee.current=l;return}if(Ee.current!==l){ue.current=e,Ee.current=l;return}const Te=ue.current;if(!(Te!==e))return;if(typeof Te.columns=="number"&&typeof e.columns=="number"&&Te.columns!==e.columns){ue.current=e;return}const Ue=_h(e,Te,{designWidth:pe});ue.current=e,Tc(e,Ue)&&d(Ue)},[e,d,n,l,pe]);const we=a.useMemo(()=>Oh(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),k=a.useMemo(()=>Jr(e,Oi),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),le=a.useMemo(()=>Jr(e,ji),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),te=a.useMemo(()=>Jr(e,Di),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),j=a.useMemo(()=>Array.isArray(A)&&A.length>0?A:[...Xn],[A]),re=a.useMemo(()=>jh(j,p,we,k,le,te),[j,p,we,k,le,te]),Ie=ao(e),ie=a.useMemo(()=>fn.slice(0,p).map(Te=>we[Te]),[p,we]),F=a.useMemo(()=>ns(p,Ie,we),[p,Ie,we]),He=a.useMemo(()=>ir(p,Ie,we),[p,Ie,we]),Ne=a.useMemo(()=>re.map((Te,Ge)=>Cc(He[Ge]??0,Te.paddingLeft,Te.paddingRight)),[re,He]),tt=a.useMemo(()=>{const Te=T===0?1/0:T;return(t??[]).slice(0,Te).map((Ue,lt)=>({id:lt,cells:Object.fromEntries(Xn.map(Rt=>[Rt,Ue[Rt]??""])),image:Ue.image,link:Ue.link}))},[t,T]),Ke=de?L??I:tt.length,Re=a.useMemo(()=>de?tt.slice(0,Ke):tt,[tt,de,Ke]),ee=de&&Ke<tt.length,ne=Re.length>1||ee,Me=[me?`${c}-divider-top`:"",ye||ne?`${c}-divider-bottom`:""].filter(Boolean).join(" "),qe=!n||i,De=()=>{if(!qe)return;const Te=L??I;if(!R){U(tt.length);return}U(Math.min(Te+R,tt.length))},Oe=Te=>v.scalingValue(Te,n??!1),Ve=w?x??0:W??0,it=y??0,Qe=g??0,pt=Math.max(it,Zr),bt=zs(0,Re.length,me,ye,ee,$??0,n??!1).borderTopWidth,ot=w?"rowPaddingTopB":"rowPaddingTop",ht=re[0],Wt=re[re.length-1],dt=Ne[0],Xe=Ne[Ne.length-1],ze=ht&&dt?Math.max(dt.paddingLeft,Ti):0,vt=Wt&&Xe?Math.max(Xe.paddingRight,Ti):0,wt=Ie,kt=Te=>{const Ge=ge.current;if(!Ge)return{x:0,y:0};const Ue=Ge.getBoundingClientRect();return{x:Te.clientX-Ue.left+Bs,y:Te.clientY-Ue.top+Bs}},jt=(Te,Ge)=>{if(!_)return;const Ue=Te.image;if(!(Ue!=null&&Ue.url)){ce(null);return}const{x:lt,y:Rt}=kt(Ge),ut=(P==null?void 0:P.min)??80,nt=(P==null?void 0:P.max)??320,Ut=(J==null?void 0:J.rowId)===Te.id?J.widthPx:Hh(ut,nt);ce({rowId:Te.id,url:Ue.url,objectFit:"contain",isVideo:rh(Ue),widthPx:Ut,x:lt,y:Rt})},tn=Te=>{if(!_||!J)return;const{x:Ge,y:Ue}=kt(Te);ce(lt=>!lt||lt.x===Ge&<.y===Ue?lt:{...lt,x:Ge,y:Ue})},ln=()=>{ce(null)},Tt=Te=>{z&&js(Te,c),_&&ce(null)},Mt=Te=>{z&&Ds(Te,c)};a.useLayoutEffect(()=>{if(!u||w){Le(null);return}const Te=Q.current,Ge=Te==null?void 0:Te.parentElement;if(!Te||!Ge){Le(null);return}const Ue=()=>{const Rt=Te.querySelector("[data-list-row]");if(!Rt){Le(null);return}const ut=Ge.getBoundingClientRect(),nt=Rt.getBoundingClientRect();Le(nt.top-ut.top+nt.height/2)};Ue();const lt=new ResizeObserver(Ue);return lt.observe(Te),lt.observe(Ge),()=>lt.disconnect()},[u,w,Re,Ve,it,Qe,t,e,re,He,pe,$,me,ye,ee]);const Yt=a.useMemo(()=>!w&&Qa.some(Te=>{const Ge=Te.charAt(0),Ue=e[`${Te}VerticalAlign`];return wc(Ue,e,Ge)}),[w,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);a.useLayoutEffect(()=>{var Ut;const Te=ge.current;if(!Te)return;const Ge=()=>{Te.querySelectorAll("[data-list-col]").forEach(Ze=>{Ze.style.transform="";const Je=Ze.querySelector(`.${c}-list-col`);Je&&(Je.style.minHeight="",Je.style.height="");const at=Ze.querySelector(`.${c}-list-col-title`);at&&(at.style.transform="")})};if(w||!Yt){Ge();return}const Ue=()=>{const Ze=Array.from(Te.querySelectorAll("[data-list-row]")),Je=`${c}-list-col`,at=`${c}-baseline-probe`;Ze.forEach(Lt=>{Lt.querySelectorAll("[data-list-col]").forEach(It=>{It.style.transform="";const ft=It.querySelector(`.${Je}`);ft&&(ft.style.minHeight="",ft.style.height="");const At=It.querySelector(`.${c}-list-col-title`);At&&(At.style.transform="")})}),Ze.forEach(Lt=>{const It=Array.from(Lt.querySelectorAll("[data-list-col]"));xh(Lt,It,Je)}),Te.offsetHeight,Ze.forEach(Lt=>{const It=Array.from(Lt.querySelectorAll("[data-list-col]")),ft=Lt.getBoundingClientRect().top,At=new Map,Ot=It.map(xt=>{const Gt=xt.querySelector(`.${c}-list-col-title`),Kt={el:xt,titleEl:Gt,letter:xt.getAttribute("data-col-letter")??"",kind:xt.getAttribute("data-valign")??"top",anchor:xt.getAttribute("data-valign-anchor")};return At.set(Kt.letter,Kt),Kt}),Ht=new Map,Vt=(xt,Gt)=>{const Kt=Ht.get(xt.letter);if(Kt!==void 0)return Kt;const Xt=xt.anchor?At.get(xt.anchor):void 0;if(xt.kind!=="baseline"||!Xt||Gt.has(xt.letter)){const be=Yr(xt,ft,Je,at);return Ht.set(xt.letter,be),be}Gt.add(xt.letter);const Zt=Vt(Xt,Gt);Gt.delete(xt.letter);const Dt=Yr(xt,ft,Je,at),St=Zt-Dt;bh(xt.titleEl,St);const f=Yr(xt,ft,Je,at);return Ht.set(xt.letter,f),f};Ot.forEach(xt=>Vt(xt,new Set))})};let lt=null;const Rt=()=>{lt===null&&(lt=requestAnimationFrame(()=>{lt=null,Ue()}))};Ue();const ut=new ResizeObserver(()=>Rt());ut.observe(Te);let nt=!1;return typeof document<"u"&&((Ut=document.fonts)!=null&&Ut.ready)&&document.fonts.ready.then(()=>{nt||Rt()}),()=>{nt=!0,lt!==null&&(cancelAnimationFrame(lt),lt=null),ut.disconnect(),Ge()}},[Yt,w,e,t,pe,Re,He]);const qt=a.useMemo(()=>ch(c),[c]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:qt}}),r.jsx("div",{style:ke,children:r.jsxs("div",{ref:ge,className:`${c}-wrapper ${Se}${Me?` ${Me}`:""}${w?` ${c}-type-b`:""}`.trim(),style:{width:v.scalingValue(S??0,n)},onMouseMove:_?tn:void 0,onMouseLeave:_?ln:void 0,children:[r.jsxs("div",{style:{width:"100%",position:"relative"},children:[Re.map((Te,Ge)=>{var ut;const Ue=(((ut=Te.link)==null?void 0:ut.length)??0)>0,lt=Ue&&(!n||i)?"a":"div",Rt=zs(Ge,Re.length,me,ye,ee,$??0,n??!1);return r.jsxs(lt,{ref:Ge===0?nt=>{Q.current=nt}:void 0,className:`${c}-list-item${Ue||C==="always"?` ${c}-list-item-has-link`:""}${ee&&Ge===Re.length-1?` ${c}-list-item-before-cut`:""}`,...Ue?{href:Te.link,target:"_blank"}:{},style:Rt,onMouseEnter:nt=>{z&&(Ue||C==="always")&&js(nt,c),_&&jt(Te,nt)},onMouseLeave:nt=>{z&&(Ue||C==="always")&&Ds(nt,c)},children:[Ve>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Oe(Ve)}}),r.jsxs("div",{className:`${c}-list-cols-row${w?"":` ${c}-list-cols-row-h`}${u&&Ge===0&&w?` ${c}-list-cols-row-controls`:""}`,...w?{}:{"data-list-row":""},style:w?void 0:{minHeight:Oe(Qe)},children:[re.map((nt,Ut)=>{const Ze=Ut===re.length-1,Je=Ne[Ut],at=nt.paddingBottom,Lt=sh(Te.cells[nt.key]),It=w&&Lt&&at>0,ft=w?{minHeight:Oe(Qe)}:{width:Oe(He[Ut])},At=w?{paddingLeft:Oe(he),paddingRight:Oe(he)}:{paddingLeft:Oe(Je.paddingLeft),paddingRight:Oe(Je.paddingRight)},Ot=nt.textPrefix.charAt(0),Ht=w?mh(e[`${nt.textPrefix}VerticalAlign`]):ph(e[`${nt.textPrefix}VerticalAlign`],e,Ot),Vt=w&&Lt&&u&&Ge===0;return w&&!Lt?null:r.jsxs("div",{className:w?`${c}-list-col-wrap`:void 0,...w?{}:{"data-list-col":"","data-col-letter":Ot,"data-valign":Ht.kind,...Ht.kind==="baseline"?{"data-valign-anchor":Ht.anchorLetter}:{}},children:[r.jsx("div",{className:`${c}-list-col${Ze?` ${c}-list-col-last`:""}`,style:{...At,...ft,...w?{justifyContent:Vs(Ht.kind)}:{}},"data-test":nt.width,children:r.jsx("span",{className:qs(e,nt.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Gs(pr(e,nt.textPrefix),n),...Us(e,nt.textPrefix,c,n),...w?{}:hh(Ht.kind)},children:Te.cells[nt.key]??null})}),It&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Oe(at)}}),Vt&&r.jsx("div",{"data-controls":nt.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:Oe(Math.max(at,Zr))}})]},nt.key)}),u&&Ge===0&&w&&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(Ce),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:0,width:Oe(Pe),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(Ce),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:Oe(Math.max(Pe,Ie-Pe)),width:Oe(Pe),height:"100%"}})]})]}),!w&&it>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Oe(it)}}),u&&Ge===0&&!w&&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:Oe(pt)}})]},Te.id)}),u&&r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":ot,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":w?"center":"left-y",className:`${c}-control-anchor`,style:{top:bt,left:0,width:"100%",height:Oe(Math.max(Ve,Zr))}})},"row-padding-handles"),u&&!w&&ht&&Wt&&r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx("div",{"data-controls":ht.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(He[0]-((dt==null?void 0:dt.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":ve??void 0,className:`${c}-control-anchor`,style:{top:0,left:0,width:Oe(ze),height:"100%"}}),r.jsx("div",{"data-controls":Wt.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(He[re.length-1]-((Xe==null?void 0:Xe.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":ve??void 0,className:`${c}-control-anchor`,style:{top:0,left:Oe(wt-vt),width:Oe(vt),height:"100%"}})]},"column-edge-padding-handles"),u&&!w&&re.slice(0,-1).map((Te,Ge)=>{const Ue=re[Ge+1],lt=F.slice(0,Ge+1).reduce((Ze,Je)=>Ze+Je,0),Rt=Ne[Ge],ut=Ne[Ge+1],nt=Math.max(Rt.paddingRight,Ti),Ut=Math.max(ut.paddingLeft,Ti);return r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx("div",{"data-controls":Te.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(He[Ge]-Rt.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":ve??void 0,className:`${c}-control-anchor`,style:{top:0,left:Oe(lt-nt),width:Oe(nt),height:"100%"}}),r.jsx("div",{"data-controls":Ue.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(He[Ge+1]-ut.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":ve??void 0,className:`${c}-control-anchor`,style:{top:0,left:Oe(lt),width:Oe(Ut),height:"100%"}})]},`${Te.paddingRightKey}-padding`)}),u&&!w&&re.slice(0,-1).map((Te,Ge)=>{const Ue=Nh(Ge,F,ie,Ie),Rt=F.slice(0,Ge+1).reduce((ut,nt)=>ut+nt,0)-Ks/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":Te.widthKey,"data-controls-axis":"x","data-controls-min":String(ts),"data-controls-max-fraction":String(Ue),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Oe(Rt),width:Oe(Ks),height:"calc(100%)",pointerEvents:"auto"}})},`${Te.widthKey}-junction`)})]}),ee&&(()=>{const Te=pr(e,An),Ge=fh(e.cutLabelVerticalAlign),Ue=Te.textTextAlign==="justify"||w;return r.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:Oe(E??0),cursor:qe?"pointer":"default",...lh(ye,$??0,n??!1)},onClick:qe?De:void 0,onMouseEnter:z||_?Tt:void 0,onMouseLeave:z?Mt:void 0,children:r.jsx("div",{className:`${c}-list-cols-row`,style:{...w?{paddingLeft:Oe(he),paddingRight:Oe(he)}:{},justifyContent:yh(Te.textTextAlign),alignItems:Vs(Ge)},children:r.jsx("span",{className:qs(e,An,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Gs(Te,n),...Us(e,An,c,n),...Ue?{width:"100%"}:{}},children:Z})})})})(),_&&J&&(()=>{const Te=`${J.widthPx}px`,Ge={width:Te,height:"auto",maxHeight:Te,objectFit:"contain",left:J.x,top:J.y,position:"absolute"};return r.jsx(ah,{media:J,className:J.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:Ge},`${J.rowId}-${J.url}`)})()]})})]})}const zh=`import { useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
9082
|
+
`}const Xn=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],es=["AColumn","BColumn","CColumn","DColumn","EColumn"],An="cutLabel",vo=[...es,An],Er=["A","B","C","D","E"];function xc(e){return`${e}ColumnVerticalAlign`}const wa=["Top","Center","Bottom"];function ts(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return Er.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function dh(e){const t=ts(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function uh(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return Er.includes(n)?n:null}function bc(e,t,n){const i=uh(e);return i?i===t?!1:dh(n[xc(i)]):!0}function xo(e){const t=ts(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return Er.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function ph(e,t,n){if(wc(e,t,n))return xo(e);const i=xo(e);return i.kind==="baseline"?{kind:"top"}:i}function mh(e){const t=xo(e);return t.kind==="baseline"?{kind:"top"}:t}function wc(e,t,n){return bc(e,n,t)?xo(e).kind==="baseline":!1}function gh(e){const t={};let n=!1;for(const i of Er){const o=xc(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}bc(s,i,e)||(t[o]="Top",n=!0)}return n?t:null}function hh(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function fh(e){const t=xo(e).kind;return t==="baseline"?"center":t}function yh(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Gs(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function vh(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 Yr(e,t,n,i){const o=e.titleEl;if(!o)return 0;const s=o.closest(`.${n}`);if(!s)return 0;const l=vh(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 xh(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 bh(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 Ct(e,t){return`${e}${t.replace(/^text/,"Text")}`}const Sh={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function $h(e){return[Ct(e,"textFontFamily"),Ct(e,"textFontSettings"),{type:"row",items:[Ct(e,"textFontSize"),Ct(e,"textLineHeight"),Ct(e,"textLetterSpacing"),Ct(e,"textWordSpacing")]},Ct(e,"textTextAlign"),Ct(e,"textTextAppearance"),`${e}VerticalAlign`]}function Ch(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(vo.map(e=>[Sh[e],$h(e)]))}}function pr(e,t){const n=i=>{const o=Ct(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 qs(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 nn(zt(n,t))}function Us(e,t,n,i){const o=pr(e,t),s=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<s?`${n} ${i}`:n}function Ks(e,t,n,i){const o=pr(e,t),s=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=s?{}:{[`--${n}-title-leading-gap`]:x.scalingValue((s-l)/2,i)}}const fn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Oi=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],Di=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],ji=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Th={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Lh=["hover","focus","filled","success","error"],Xs=.004,Ti=.004,Zr=Ti,ns=50,bo=1440,wo=ns/bo;function Sc(e){const t=typeof e=="number"&&e>0?e:bo;return ns/t}function Ih(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 bo}const $c={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function ao(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function Rh(e,t=1){const n=t/e;return Object.fromEntries(fn.map(i=>[i,n]))}function Eh(){return Object.fromEntries([...Oi.map(e=>[e,0]),...Di.map(e=>[e,0])])}function Mh(){return Object.fromEntries(ji.map(e=>[e,0]))}function zo(e){return Object.fromEntries(fn.map(t=>[t,typeof e[t]=="number"?e[t]:$c[t]]))}function Cc(e,t,n){const i=e-wo,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 ir(e,t,n){const i=is(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 kh(e,t,n){const i={};for(let o=0;o<e;o+=1){const s=Oi[o],l=Di[o],d=typeof n[s]=="number"?n[s]:0,c=typeof n[l]=="number"?n[l]:0,u=Cc(t[o]??0,d,c);u.paddingLeft!==d&&(i[s]=u.paddingLeft),u.paddingRight!==c&&(i[l]=u.paddingRight)}return i}function is(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)+wo;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]-wo;if(p<=0)continue;const w=Math.min(c,p);d[u]-=w,c-=w}return[...d,i[e-1]]}function Ph(e,t,n){if(e<=1)return{};const i=is(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 Ys(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Xn]}function Ah(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function Fh(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=Oi[c],w=Di[c],v=ji[c],T=fn[l],g=Oi[l],$=Di[l],f=ji[l],R=n[u],L=n[p],I=n[w],Y=n[v];typeof R=="number"&&(s[T]=R),typeof L=="number"&&(s[g]=L),typeof I=="number"&&(s[$]=I),typeof Y=="number"&&(s[f]=Y)}return s}function Tc(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 Wh(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=ao(e),s=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...Rh(n,o),...Eh()};if(s)for(const d of ji)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,Mh());return Tc(e,l)?l:e}function _h(e,t,n){const i=gh(e);i&&(e={...e,...i});const o=Sc(n==null?void 0:n.designWidth),s=e.columns,l=t.columns,d=ao(e),c=ao(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof s=="number"?s:typeof l=="number"?l:Xn.length,w=I=>{if(u)return I;const Y=zo({...t,...I}),P=ao(I),V=ir(p,P,Y),M=kh(p,V,{...t,...I});return Object.keys(M).length===0?I:{...I,...M}};if(typeof s=="number"&&s!==l)return e;const v=Ys(e),T=Ys(t);if(!Ah(v,T))return w({...e,...Fh(v,T,t,p)});if(d<c&&typeof p=="number"&&!u){const I=zo({...t,...e});return w({...e,...Ph(p,d,I)})}if(u){const I=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,Y=Math.max(0,(d-o)/2);return I>Y?{...e,textPaddingLR:Y}:e}const g=zo({...t,...e}),$=ir(p,c,zo(t)),R=ir(p,d,g).some((I,Y)=>I<($[Y]??I)),L=fn.some(I=>{const Y=e[I],P=t[I];return typeof Y=="number"&&typeof P=="number"&&Y!==P});return R||L?w(e):e}function Nh(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(wo,i-o-s-wo)}function Hh(e,t){return Math.random()*(t-e)+e}function Oh(e){return Object.fromEntries(fn.map(t=>[t,typeof e[t]=="number"?e[t]:$c[t]]))}function Jr(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function Dh(e,t,n,i,o,s){return e.slice(0,t).map((l,d)=>{const c=Oi[d],u=Di[d],p=ji[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 jh({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:s,layoutId:l,onUpdateSettings:d}){const{prefix:c}=x.useScopedStyles(),u=!!o,{columns:p,type:w,wrapperWidth:v,entriesCount:T,cellMinHeight:g,dividerWidth:$,showVisibility:f,cut:R,showCut:L,cutCellMinHeight:I,cutLabel:Y,imageSize:P,imageOnHover:V,entryHoverEffect:M,entryHoverShowOption:C,rowPaddingTop:A,rowPaddingBottom:y,rowPaddingTopB:S,columnsOrder:F,textPaddingLR:W,textColor:U,backgroundColor:G,dividerColor:J,textHoverColor:D,backgroundHoverColor:j,dividerHoverColor:O}=e,[E,K]=a.useState(void 0),[Z,ce]=a.useState(null),N=V==="on"&&(!n||i),pe=(R??0)>0,b=w==="b",he=a.useRef(null),Q=a.useRef(null),[we,Te]=a.useState(null),[se,oe]=a.useState(bo),q=Sc(se),de=Math.max(0,((v??0)-q)/2),ge=Math.min(W??0,de),_e=Math.max(ge,Ti),Ce=((v??0)+q)/2;a.useLayoutEffect(()=>{if(!n){oe(bo);return}const Le=()=>{oe(Ih(he.current))};Le();const Ue=he.current;if(!Ue)return;const Xe=new ResizeObserver(Le);Xe.observe(Ue);let ct=Ue;for(;ct&&!ct.style.getPropertyValue("--cntrl-article-width");)ct=ct.parentElement;return ct&&Xe.observe(ct),()=>Xe.disconnect()},[n,l]),a.useEffect(()=>{K(void 0)},[R,L,t,T]),a.useEffect(()=>{n&&!i&&K(void 0)},[n,i]);const Me=x.buildColorVars(c,{textColor:U,backgroundColor:G,dividerColor:J,textHoverColor:D,backgroundHoverColor:j,dividerHoverColor:O},Th,Lh),fe=s&&s!=="default"?`${c}-state-${s}`:"",Se=`${!n||i?M==="default"?`${c}-entry-hover-default`:M==="blinds"?`${c}-entry-hover-blinds`:M==="reveal"?`${c}-entry-hover-reveal`:"":""} ${fe}`.trim(),B=M==="reveal"&&(!n||i),ue=(f==null?void 0:f[0])??!1,ve=(f==null?void 0:f[1])??!1,me=a.useRef(e),Ee=a.useRef(l);a.useEffect(()=>{if(!d||!n){me.current=e,Ee.current=l;return}if(Ee.current!==l){me.current=e,Ee.current=l;return}const Le=me.current;if(!(Le!==e))return;if(typeof Le.columns=="number"&&typeof e.columns=="number"&&Le.columns!==e.columns){me.current=e;return}const Xe=_h(e,Le,{designWidth:se});me.current=e,Tc(e,Xe)&&d(Xe)},[e,d,n,l,se]);const be=a.useMemo(()=>Oh(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),k=a.useMemo(()=>Jr(e,Oi),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),re=a.useMemo(()=>Jr(e,Di),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),te=a.useMemo(()=>Jr(e,ji),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),z=a.useMemo(()=>Array.isArray(F)&&F.length>0?F:[...Xn],[F]),le=a.useMemo(()=>Dh(z,p,be,k,re,te),[z,p,be,k,re,te]),Re=ao(e),ae=a.useMemo(()=>fn.slice(0,p).map(Le=>be[Le]),[p,be]),_=a.useMemo(()=>is(p,Re,be),[p,Re,be]),Ne=a.useMemo(()=>ir(p,Re,be),[p,Re,be]),Fe=a.useMemo(()=>le.map((Le,Ue)=>Cc(Ne[Ue]??0,Le.paddingLeft,Le.paddingRight)),[le,Ne]),et=a.useMemo(()=>{const Le=T===0?1/0:T;return(t??[]).slice(0,Le).map((Xe,ct)=>({id:ct,cells:Object.fromEntries(Xn.map(Rt=>[Rt,Xe[Rt]??""])),image:Xe.image,link:Xe.link}))},[t,T]),Ke=pe?E??R:et.length,Ie=a.useMemo(()=>pe?et.slice(0,Ke):et,[et,pe,Ke]),ee=pe&&Ke<et.length,ne=Ie.length>1||ee,He=[ue?`${c}-divider-top`:"",ve||ne?`${c}-divider-bottom`:""].filter(Boolean).join(" "),st=!n||i,Be=()=>{if(!st)return;const Le=E??R;if(!L){K(et.length);return}K(Math.min(Le+L,et.length))},Oe=Le=>x.scalingValue(Le,n??!1),je=b?S??0:A??0,qe=y??0,tt=g??0,mt=Math.max(qe,Zr),St=Bs(0,Ie.length,ue,ve,ee,$??0,n??!1).borderTopWidth,lt=b?"rowPaddingTopB":"rowPaddingTop",pt=le[0],Mt=le[le.length-1],nt=Fe[0],Ve=Fe[Fe.length-1],De=pt&&nt?Math.max(nt.paddingLeft,Ti):0,vt=Mt&&Ve?Math.max(Ve.paddingRight,Ti):0,bt=Re,Pt=Le=>{const Ue=he.current;if(!Ue)return{x:0,y:0};const Xe=Ue.getBoundingClientRect();return{x:Le.clientX-Xe.left+Vs,y:Le.clientY-Xe.top+Vs}},Dt=(Le,Ue)=>{if(!N)return;const Xe=Le.image;if(!(Xe!=null&&Xe.url)){ce(null);return}const{x:ct,y:Rt}=Pt(Ue),ut=(P==null?void 0:P.min)??80,it=(P==null?void 0:P.max)??320,Ut=(Z==null?void 0:Z.rowId)===Le.id?Z.widthPx:Hh(ut,it);ce({rowId:Le.id,url:Xe.url,objectFit:"contain",isVideo:rh(Xe),widthPx:Ut,x:ct,y:Rt})},tn=Le=>{if(!N||!Z)return;const{x:Ue,y:Xe}=Pt(Le);ce(ct=>!ct||ct.x===Ue&&ct.y===Xe?ct:{...ct,x:Ue,y:Xe})},ln=()=>{ce(null)},Tt=Le=>{B&&js(Le,c),N&&ce(null)},kt=Le=>{B&&zs(Le,c)};a.useLayoutEffect(()=>{if(!u||b){Te(null);return}const Le=Q.current,Ue=Le==null?void 0:Le.parentElement;if(!Le||!Ue){Te(null);return}const Xe=()=>{const Rt=Le.querySelector("[data-list-row]");if(!Rt){Te(null);return}const ut=Ue.getBoundingClientRect(),it=Rt.getBoundingClientRect();Te(it.top-ut.top+it.height/2)};Xe();const ct=new ResizeObserver(Xe);return ct.observe(Le),ct.observe(Ue),()=>ct.disconnect()},[u,b,Ie,je,qe,tt,t,e,le,Ne,se,$,ue,ve,ee]);const Yt=a.useMemo(()=>!b&&es.some(Le=>{const Ue=Le.charAt(0),Xe=e[`${Le}VerticalAlign`];return wc(Xe,e,Ue)}),[b,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);a.useLayoutEffect(()=>{var Ut;const Le=he.current;if(!Le)return;const Ue=()=>{Le.querySelectorAll("[data-list-col]").forEach(Ze=>{Ze.style.transform="";const Je=Ze.querySelector(`.${c}-list-col`);Je&&(Je.style.minHeight="",Je.style.height="");const rt=Ze.querySelector(`.${c}-list-col-title`);rt&&(rt.style.transform="")})};if(b||!Yt){Ue();return}const Xe=()=>{const Ze=Array.from(Le.querySelectorAll("[data-list-row]")),Je=`${c}-list-col`,rt=`${c}-baseline-probe`;Ze.forEach(Lt=>{Lt.querySelectorAll("[data-list-col]").forEach(It=>{It.style.transform="";const ft=It.querySelector(`.${Je}`);ft&&(ft.style.minHeight="",ft.style.height="");const Ft=It.querySelector(`.${c}-list-col-title`);Ft&&(Ft.style.transform="")})}),Ze.forEach(Lt=>{const It=Array.from(Lt.querySelectorAll("[data-list-col]"));xh(Lt,It,Je)}),Le.offsetHeight,Ze.forEach(Lt=>{const It=Array.from(Lt.querySelectorAll("[data-list-col]")),ft=Lt.getBoundingClientRect().top,Ft=new Map,Ot=It.map(xt=>{const Gt=xt.querySelector(`.${c}-list-col-title`),Kt={el:xt,titleEl:Gt,letter:xt.getAttribute("data-col-letter")??"",kind:xt.getAttribute("data-valign")??"top",anchor:xt.getAttribute("data-valign-anchor")};return Ft.set(Kt.letter,Kt),Kt}),Ht=new Map,Vt=(xt,Gt)=>{const Kt=Ht.get(xt.letter);if(Kt!==void 0)return Kt;const Xt=xt.anchor?Ft.get(xt.anchor):void 0;if(xt.kind!=="baseline"||!Xt||Gt.has(xt.letter)){const xe=Yr(xt,ft,Je,rt);return Ht.set(xt.letter,xe),xe}Gt.add(xt.letter);const Zt=Vt(Xt,Gt);Gt.delete(xt.letter);const jt=Yr(xt,ft,Je,rt),wt=Zt-jt;bh(xt.titleEl,wt);const h=Yr(xt,ft,Je,rt);return Ht.set(xt.letter,h),h};Ot.forEach(xt=>Vt(xt,new Set))})};let ct=null;const Rt=()=>{ct===null&&(ct=requestAnimationFrame(()=>{ct=null,Xe()}))};Xe();const ut=new ResizeObserver(()=>Rt());ut.observe(Le);let it=!1;return typeof document<"u"&&((Ut=document.fonts)!=null&&Ut.ready)&&document.fonts.ready.then(()=>{it||Rt()}),()=>{it=!0,ct!==null&&(cancelAnimationFrame(ct),ct=null),ut.disconnect(),Ue()}},[Yt,b,e,t,se,Ie,Ne]);const qt=a.useMemo(()=>ch(c),[c]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:qt}}),r.jsx("div",{style:Me,children:r.jsxs("div",{ref:he,className:`${c}-wrapper ${Se}${He?` ${He}`:""}${b?` ${c}-type-b`:""}`.trim(),style:{width:x.scalingValue(v??0,n)},onMouseMove:N?tn:void 0,onMouseLeave:N?ln:void 0,children:[r.jsxs("div",{style:{width:"100%",position:"relative"},children:[Ie.map((Le,Ue)=>{var ut;const Xe=(((ut=Le.link)==null?void 0:ut.length)??0)>0,ct=Xe&&(!n||i)?"a":"div",Rt=Bs(Ue,Ie.length,ue,ve,ee,$??0,n??!1);return r.jsxs(ct,{ref:Ue===0?it=>{Q.current=it}:void 0,className:`${c}-list-item${Xe||C==="always"?` ${c}-list-item-has-link`:""}${ee&&Ue===Ie.length-1?` ${c}-list-item-before-cut`:""}`,...Xe?{href:Le.link,target:"_blank"}:{},style:Rt,onMouseEnter:it=>{B&&(Xe||C==="always")&&js(it,c),N&&Dt(Le,it)},onMouseLeave:it=>{B&&(Xe||C==="always")&&zs(it,c)},children:[je>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Oe(je)}}),r.jsxs("div",{className:`${c}-list-cols-row${b?"":` ${c}-list-cols-row-h`}${u&&Ue===0&&b?` ${c}-list-cols-row-controls`:""}`,...b?{}:{"data-list-row":""},style:b?void 0:{minHeight:Oe(tt)},children:[le.map((it,Ut)=>{const Ze=Ut===le.length-1,Je=Fe[Ut],rt=it.paddingBottom,Lt=sh(Le.cells[it.key]),It=b&&Lt&&rt>0,ft=b?{minHeight:Oe(tt)}:{width:Oe(Ne[Ut])},Ft=b?{paddingLeft:Oe(ge),paddingRight:Oe(ge)}:{paddingLeft:Oe(Je.paddingLeft),paddingRight:Oe(Je.paddingRight)},Ot=it.textPrefix.charAt(0),Ht=b?mh(e[`${it.textPrefix}VerticalAlign`]):ph(e[`${it.textPrefix}VerticalAlign`],e,Ot),Vt=b&&Lt&&u&&Ue===0;return b&&!Lt?null:r.jsxs("div",{className:b?`${c}-list-col-wrap`:void 0,...b?{}:{"data-list-col":"","data-col-letter":Ot,"data-valign":Ht.kind,...Ht.kind==="baseline"?{"data-valign-anchor":Ht.anchorLetter}:{}},children:[r.jsx("div",{className:`${c}-list-col${Ze?` ${c}-list-col-last`:""}`,style:{...Ft,...ft,...b?{justifyContent:Gs(Ht.kind)}:{}},"data-test":it.width,children:r.jsx("span",{className:Us(e,it.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...qs(pr(e,it.textPrefix),n),...Ks(e,it.textPrefix,c,n),...b?{}:hh(Ht.kind)},children:Le.cells[it.key]??null})}),It&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Oe(rt)}}),Vt&&r.jsx("div",{"data-controls":it.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:Oe(Math.max(rt,Zr))}})]},it.key)}),u&&Ue===0&&b&&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(Ce),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:0,width:Oe(_e),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(Ce),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:Oe(Math.max(_e,Re-_e)),width:Oe(_e),height:"100%"}})]})]}),!b&&qe>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Oe(qe)}}),u&&Ue===0&&!b&&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:Oe(mt)}})]},Le.id)}),u&&r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":lt,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":b?"center":"left-y",className:`${c}-control-anchor`,style:{top:St,left:0,width:"100%",height:Oe(Math.max(je,Zr))}})},"row-padding-handles"),u&&!b&&pt&&Mt&&r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx("div",{"data-controls":pt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ne[0]-((nt==null?void 0:nt.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":we??void 0,className:`${c}-control-anchor`,style:{top:0,left:0,width:Oe(De),height:"100%"}}),r.jsx("div",{"data-controls":Mt.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ne[le.length-1]-((Ve==null?void 0:Ve.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":we??void 0,className:`${c}-control-anchor`,style:{top:0,left:Oe(bt-vt),width:Oe(vt),height:"100%"}})]},"column-edge-padding-handles"),u&&!b&&le.slice(0,-1).map((Le,Ue)=>{const Xe=le[Ue+1],ct=_.slice(0,Ue+1).reduce((Ze,Je)=>Ze+Je,0),Rt=Fe[Ue],ut=Fe[Ue+1],it=Math.max(Rt.paddingRight,Ti),Ut=Math.max(ut.paddingLeft,Ti);return r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx("div",{"data-controls":Le.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ne[Ue]-Rt.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":we??void 0,className:`${c}-control-anchor`,style:{top:0,left:Oe(ct-it),width:Oe(it),height:"100%"}}),r.jsx("div",{"data-controls":Xe.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ne[Ue+1]-ut.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":we??void 0,className:`${c}-control-anchor`,style:{top:0,left:Oe(ct),width:Oe(Ut),height:"100%"}})]},`${Le.paddingRightKey}-padding`)}),u&&!b&&le.slice(0,-1).map((Le,Ue)=>{const Xe=Nh(Ue,_,ae,Re),Rt=_.slice(0,Ue+1).reduce((ut,it)=>ut+it,0)-Xs/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":Le.widthKey,"data-controls-axis":"x","data-controls-min":String(ns),"data-controls-max-fraction":String(Xe),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Oe(Rt),width:Oe(Xs),height:"calc(100%)",pointerEvents:"auto"}})},`${Le.widthKey}-junction`)})]}),ee&&(()=>{const Le=pr(e,An),Ue=fh(e.cutLabelVerticalAlign),Xe=Le.textTextAlign==="justify"||b;return r.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:Oe(I??0),cursor:st?"pointer":"default",...lh(ve,$??0,n??!1)},onClick:st?Be:void 0,onMouseEnter:B||N?Tt:void 0,onMouseLeave:B?kt:void 0,children:r.jsx("div",{className:`${c}-list-cols-row`,style:{...b?{paddingLeft:Oe(ge),paddingRight:Oe(ge)}:{},justifyContent:yh(Le.textTextAlign),alignItems:Gs(Ue)},children:r.jsx("span",{className:Us(e,An,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...qs(Le,n),...Ks(e,An,c,n),...Xe?{width:"100%"}:{}},children:Y})})})})(),N&&Z&&(()=>{const Le=`${Z.widthPx}px`,Ue={width:Le,height:"auto",maxHeight:Le,objectFit:"contain",left:Z.x,top:Z.y,position:"absolute"};return r.jsx(ah,{media:Z,className:Z.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:Ue},`${Z.rowId}-${Z.url}`)})()]})})]})}const zh=`import { useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
9083
9083
|
import { CommonComponentProps } from '../props';
|
|
9084
9084
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
9085
9085
|
import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';
|
|
@@ -11953,7 +11953,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
11953
11953
|
</>
|
|
11954
11954
|
);
|
|
11955
11955
|
}
|
|
11956
|
-
`,Xi=["A","B","C","D","E"],Ys=[...wa,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],ri={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"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function Bh(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function Bo(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function Vh(){return Object.fromEntries(Xi.map((e,t)=>{const n=Xn[t],i=`${e} column`;return[n,Bh(i)]}))}function Gh(){const e={};for(const t of Xi)e[`${t}ColumnWidth`]=Bo(`${t} column width`),e[`${t}ColumnPaddingLeft`]=Bo(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=Bo(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=Bo(`${t} column padding bottom`);return e}function Zs(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...Xn]};for(const s of Xi)i[`${s}ColumnWidth`]=s==="A"?.0798:.32,i[`${s}ColumnPaddingLeft`]=0,i[`${s}ColumnPaddingRight`]=0,i[`${s}ColumnPaddingBottom`]=0;const o=n.type==="b"&&t?t:{};return{...i,...o,...n}}function qh(e){const t={};if(e===An)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...wa]},enum:[...wa]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Ys],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...Ys]}}return t[Ct(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[Ct(e,"textFontSettings")]={...ri.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[Ct(e,"textFontSize")]={...ri.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ct(e,"textLineHeight")]={...ri.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ct(e,"textLetterSpacing")]={...ri.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ct(e,"textWordSpacing")]={...ri.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ct(e,"textTextAlign")]={...ri.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ct(e,"textTextAppearance")]={...ri.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const Uh=vo.reduce((e,t)=>({...e,...qh(t)}),{});function Kh(e){return{verticalAlign:e===An?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===An?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function Xh(e,t={}){var n;return{...Kh(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const Js=new Set(["textFontFamily","textFontSettings"]);function Yh(e,t,n){const i=s=>n===void 0?!0:n==="common"?Js.has(s):!Js.has(s),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=es(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[Ct(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[Ct(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[Ct(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[Ct(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[Ct(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[Ct(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[Ct(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[Ct(e,"textTextAppearance")]=t.textTextAppearance),o}function or(e={},t){return vo.reduce((n,i)=>({...n,...Yh(i,Xh(i,e),t)}),{})}const Zh=or(),Jh=Ch();function Lc(e){return[Ct(e,"textFontFamily"),Ct(e,"textFontSettings"),Ct(e,"textFontSize"),Ct(e,"textLineHeight"),Ct(e,"textLetterSpacing"),Ct(e,"textWordSpacing"),Ct(e,"textTextAlign"),Ct(e,"textTextAppearance"),`${e}VerticalAlign`]}function Qh(){const e=[];return Qa.forEach((t,n)=>{const i=Xn[n],o=Lc(t);for(let s=1;s<Xn.length;s+=1){const l=[{name:"columns",value:s},...Array.from({length:s},(d,c)=>({name:`columnsOrder.${c}`,value:i,isNotEqual:!0}))];o.forEach(d=>{e.push({if:l,then:{name:`properties.${d}.display.visible`,value:!1}})})}}),e}const ef=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];Lc(An);const tf=[...Xi.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],ai=[{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg"}],nf=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:ai[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:ai[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:ai[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:ai[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:ai[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:ai[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:ai[6],link:""}],of=[...Xi.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],rf={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array",ref:{columnsOrder:"settings.properties.columnsOrder",columnsCount:"settings.properties.columns"}},items:{type:"object",properties:{...Vh(),image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"contain",type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["image"]},default:nf},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b"]},columns:{type:"number",scope:"layout",title:"Columns",display:{type:"count-number"},min:1,max:5},wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},textPaddingLR:{type:"number",scope:"layout",title:"Text Padding LR",min:0,max:9999,display:{type:"range-control"}},entriesCount:{type:"number",scope:"layout",title:"Amount",display:{type:"toggle-numeric-input",enum:["auto","fixed"]},min:1},cellMinHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},imageOnHover:{type:"boolean",scope:"common",title:"Image On Hover",display:{type:"toggle-cycle",enum:["on","off"]}},imageSize:{type:"object",scope:"layout",title:"Image size",display:{type:"min-max-input"},min:1,max:1440,properties:{min:{type:"number"},max:{type:"number"}}},dividerWidth:{type:"number",scope:"layout",title:"Divider width",display:{type:"numeric-input"},min:0,max:9999},showVisibility:{type:"array",scope:"common",title:"Show",display:{type:"double-toggle",enum:["top","bottom"]},items:{type:"boolean"},default:[!0,!1]},cut:{type:"number",scope:"layout",title:"Display",display:{type:"toggle-numeric-input",enum:["off","on"]},min:1},entryHoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["none","default","blinds","reveal"]}},entryHoverShowOption:{type:"string",scope:"common",title:"Show",display:{type:"toggle-cycle",enum:["always","link only"]}},cutCellMinHeight:{type:"number",scope:"layout",title:"Cell min height",display:{type:"numeric-input"},min:0,max:9999},cutLabel:{type:"string",scope:"common",title:"Cut Label",display:{type:"label-input"}},showCut:{type:"number",scope:"layout",title:"Show",display:{type:"toggle-numeric-input",enum:["all","custom"]},min:1},rowPaddingTop:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},rowPaddingBottom:{type:"number",scope:"layout",title:"Row Padding Bottom",min:0,max:100,display:{type:"range-control"}},rowPaddingTopB:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},...Gh(),columnsOrder:{type:"array",scope:"layout",title:"Columns Order",display:{type:"reorder-input"},items:{type:"string"}},textColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},textHoverColor:{type:"string",scope:"common",title:"Text Hover",display:{type:"palette-color-picker"}},...Uh,backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},dividerColor:{type:"string",scope:"common",title:"Divider Default",display:{type:"palette-color-picker"}},backgroundHoverColor:{type:"string",scope:"common",title:"BG Hover",display:{type:"palette-color-picker"}},dividerHoverColor:{type:"string",scope:"common",title:"Divider Hover",display:{type:"palette-color-picker"}}},defaults:{imageOnHover:"on",entryHoverEffect:"default",entryHoverShowOption:"always",cutLabel:"SEE ALL",showVisibility:[!0,!0],textColor:"#000000",textHoverColor:"#FFFFFF",...Zh,...or({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:Zs({columns:3,type:"b",textPaddingLR:.0373,entriesCount:0,cellMinHeight:.02,imageSize:{min:80,max:320},dividerWidth:.004,cut:0,showCut:0,cutCellMinHeight:.02,rowPaddingTop:.01,rowPaddingBottom:.01,typeBDefaults:{rowPaddingTopB:.0461,AColumnPaddingBottom:.041,BColumnPaddingBottom:.041,CColumnPaddingBottom:.0615,DColumnPaddingBottom:0,EColumnPaddingBottom:0},textStroke:.003,textCorners:.192,textPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},...or({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:Zs({columns:4,type:"a",textPaddingLR:.01,entriesCount:0,cellMinHeight:.0555,imageSize:{min:200,max:200},dividerWidth:.002083,cut:0,showCut:0,cutCellMinHeight:.0555,rowPaddingTop:0,rowPaddingBottom:0,rowPaddingTopB:.01,textStroke:.001,textCorners:.05,textPadding:{top:.01,right:.01,bottom:.01,left:.01},...or({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...Qh(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...tf.map(e=>({if:{name:"type",value:"b"},then:{name:`properties.${e}.display.visible`,value:!1}})),{if:{name:"type",value:"a"},then:{name:"properties.rowPaddingTopB.display.visible",value:!1}},...Xi.map(e=>({if:{name:"type",value:"a"},then:{name:`properties.${e}ColumnPaddingBottom.display.visible`,value:!1}}))],layout:["__componentName__","name","type","columns","wrapperWidth","textPaddingLR","entriesCount","cellMinHeight","imageOnHover","imageSize","dividerWidth","showVisibility","cut","showCut","cutCellMinHeight","entryHoverEffect","entryHoverShowOption","cutLabel","rowPaddingTop","rowPaddingBottom","rowPaddingTopB",...of]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"row",title:"",items:["columns","wrapperWidth"]},{type:"row",title:"Entries",items:["entriesCount","cellMinHeight"]},{type:"row",title:"",items:["imageOnHover","imageSize"]},{type:"row",title:"Entry Hover",items:["entryHoverEffect","entryHoverShowOption"]},{type:"row",title:"Divider Settings",items:["dividerWidth","showVisibility"]}]},{id:"columnsOrder",icon:"layers",title:"Columns Order",tooltip:"Columns order",layout:["__componentName__","columnsOrder"]},{id:"cutSettings",icon:"cut",title:"Cut settings",tooltip:"Cut settings",layout:["__componentName__",{type:"row",title:"",items:["cut"]},{type:"row",title:"Cut Settings",items:["cutLabel","cutCellMinHeight"]},{type:"row",title:"",items:["showCut"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",Jh]}],paletteBookmark:{items:[...ef],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},af={element:Dh,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>Wh(e,t),preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Programme-list-default.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...vo.map(e=>({path:`${Ct(e,"textFontFamily")}`}))]},fontRelations:{...vo.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${Ct(t,"textFontFamily")}`}),{})},schema:rf,sourceCode:zh},Qs=300,Hn=.004,sf={questionColor:"question-color",answerColor:"answer-color",dividerColor:"divider-color",iconColor:"icon-color",questionHoverColor:"question-hover-color",iconHoverColor:"icon-hover-color",iconActiveColor:"icon-active-color",dividerHoverColor:"divider-hover-color"},lf=["hover","focus","filled","success","error"];function cf(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function el(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function tl(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:v.scalingValue((o-t)/2,i)}}function df(e){return`
|
|
11956
|
+
`,Xi=["A","B","C","D","E"],Zs=[...wa,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],ri={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"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function Bh(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function Bo(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function Vh(){return Object.fromEntries(Xi.map((e,t)=>{const n=Xn[t],i=`${e} column`;return[n,Bh(i)]}))}function Gh(){const e={};for(const t of Xi)e[`${t}ColumnWidth`]=Bo(`${t} column width`),e[`${t}ColumnPaddingLeft`]=Bo(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=Bo(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=Bo(`${t} column padding bottom`);return e}function Js(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...Xn]};for(const s of Xi)i[`${s}ColumnWidth`]=s==="A"?.0798:.32,i[`${s}ColumnPaddingLeft`]=0,i[`${s}ColumnPaddingRight`]=0,i[`${s}ColumnPaddingBottom`]=0;const o=n.type==="b"&&t?t:{};return{...i,...o,...n}}function qh(e){const t={};if(e===An)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...wa]},enum:[...wa]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Zs],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...Zs]}}return t[Ct(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[Ct(e,"textFontSettings")]={...ri.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[Ct(e,"textFontSize")]={...ri.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ct(e,"textLineHeight")]={...ri.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ct(e,"textLetterSpacing")]={...ri.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ct(e,"textWordSpacing")]={...ri.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ct(e,"textTextAlign")]={...ri.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ct(e,"textTextAppearance")]={...ri.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const Uh=vo.reduce((e,t)=>({...e,...qh(t)}),{});function Kh(e){return{verticalAlign:e===An?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===An?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function Xh(e,t={}){var n;return{...Kh(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const Qs=new Set(["textFontFamily","textFontSettings"]);function Yh(e,t,n){const i=s=>n===void 0?!0:n==="common"?Qs.has(s):!Qs.has(s),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=ts(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[Ct(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[Ct(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[Ct(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[Ct(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[Ct(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[Ct(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[Ct(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[Ct(e,"textTextAppearance")]=t.textTextAppearance),o}function or(e={},t){return vo.reduce((n,i)=>({...n,...Yh(i,Xh(i,e),t)}),{})}const Zh=or(),Jh=Ch();function Lc(e){return[Ct(e,"textFontFamily"),Ct(e,"textFontSettings"),Ct(e,"textFontSize"),Ct(e,"textLineHeight"),Ct(e,"textLetterSpacing"),Ct(e,"textWordSpacing"),Ct(e,"textTextAlign"),Ct(e,"textTextAppearance"),`${e}VerticalAlign`]}function Qh(){const e=[];return es.forEach((t,n)=>{const i=Xn[n],o=Lc(t);for(let s=1;s<Xn.length;s+=1){const l=[{name:"columns",value:s},...Array.from({length:s},(d,c)=>({name:`columnsOrder.${c}`,value:i,isNotEqual:!0}))];o.forEach(d=>{e.push({if:l,then:{name:`properties.${d}.display.visible`,value:!1}})})}}),e}const ef=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];Lc(An);const tf=[...Xi.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],ai=[{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg"}],nf=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:ai[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:ai[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:ai[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:ai[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:ai[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:ai[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:ai[6],link:""}],of=[...Xi.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],rf={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array",ref:{columnsOrder:"settings.properties.columnsOrder",columnsCount:"settings.properties.columns"}},items:{type:"object",properties:{...Vh(),image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"contain",type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["image"]},default:nf},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b"]},columns:{type:"number",scope:"layout",title:"Columns",display:{type:"count-number"},min:1,max:5},wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},textPaddingLR:{type:"number",scope:"layout",title:"Text Padding LR",min:0,max:9999,display:{type:"range-control"}},entriesCount:{type:"number",scope:"layout",title:"Amount",display:{type:"toggle-numeric-input",enum:["auto","fixed"]},min:1},cellMinHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},imageOnHover:{type:"boolean",scope:"common",title:"Image On Hover",display:{type:"toggle-cycle",enum:["on","off"]}},imageSize:{type:"object",scope:"layout",title:"Image size",display:{type:"min-max-input"},min:1,max:1440,properties:{min:{type:"number"},max:{type:"number"}}},dividerWidth:{type:"number",scope:"layout",title:"Divider width",display:{type:"numeric-input"},min:0,max:9999},showVisibility:{type:"array",scope:"common",title:"Show",display:{type:"double-toggle",enum:["top","bottom"]},items:{type:"boolean"},default:[!0,!1]},cut:{type:"number",scope:"layout",title:"Display",display:{type:"toggle-numeric-input",enum:["off","on"]},min:1},entryHoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["none","default","blinds","reveal"]}},entryHoverShowOption:{type:"string",scope:"common",title:"Show",display:{type:"toggle-cycle",enum:["always","link only"]}},cutCellMinHeight:{type:"number",scope:"layout",title:"Cell min height",display:{type:"numeric-input"},min:0,max:9999},cutLabel:{type:"string",scope:"common",title:"Cut Label",display:{type:"label-input"}},showCut:{type:"number",scope:"layout",title:"Show",display:{type:"toggle-numeric-input",enum:["all","custom"]},min:1},rowPaddingTop:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},rowPaddingBottom:{type:"number",scope:"layout",title:"Row Padding Bottom",min:0,max:100,display:{type:"range-control"}},rowPaddingTopB:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},...Gh(),columnsOrder:{type:"array",scope:"layout",title:"Columns Order",display:{type:"reorder-input"},items:{type:"string"}},textColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},textHoverColor:{type:"string",scope:"common",title:"Text Hover",display:{type:"palette-color-picker"}},...Uh,backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},dividerColor:{type:"string",scope:"common",title:"Divider Default",display:{type:"palette-color-picker"}},backgroundHoverColor:{type:"string",scope:"common",title:"BG Hover",display:{type:"palette-color-picker"}},dividerHoverColor:{type:"string",scope:"common",title:"Divider Hover",display:{type:"palette-color-picker"}}},defaults:{imageOnHover:"on",entryHoverEffect:"default",entryHoverShowOption:"always",cutLabel:"SEE ALL",showVisibility:[!0,!0],textColor:"#000000",textHoverColor:"#FFFFFF",...Zh,...or({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:Js({columns:3,type:"b",textPaddingLR:.0373,entriesCount:0,cellMinHeight:.02,imageSize:{min:80,max:320},dividerWidth:.004,cut:0,showCut:0,cutCellMinHeight:.02,rowPaddingTop:.01,rowPaddingBottom:.01,typeBDefaults:{rowPaddingTopB:.0461,AColumnPaddingBottom:.041,BColumnPaddingBottom:.041,CColumnPaddingBottom:.0615,DColumnPaddingBottom:0,EColumnPaddingBottom:0},textStroke:.003,textCorners:.192,textPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},...or({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:Js({columns:4,type:"a",textPaddingLR:.01,entriesCount:0,cellMinHeight:.0555,imageSize:{min:200,max:200},dividerWidth:.002083,cut:0,showCut:0,cutCellMinHeight:.0555,rowPaddingTop:0,rowPaddingBottom:0,rowPaddingTopB:.01,textStroke:.001,textCorners:.05,textPadding:{top:.01,right:.01,bottom:.01,left:.01},...or({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...Qh(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...tf.map(e=>({if:{name:"type",value:"b"},then:{name:`properties.${e}.display.visible`,value:!1}})),{if:{name:"type",value:"a"},then:{name:"properties.rowPaddingTopB.display.visible",value:!1}},...Xi.map(e=>({if:{name:"type",value:"a"},then:{name:`properties.${e}ColumnPaddingBottom.display.visible`,value:!1}}))],layout:["__componentName__","name","type","columns","wrapperWidth","textPaddingLR","entriesCount","cellMinHeight","imageOnHover","imageSize","dividerWidth","showVisibility","cut","showCut","cutCellMinHeight","entryHoverEffect","entryHoverShowOption","cutLabel","rowPaddingTop","rowPaddingBottom","rowPaddingTopB",...of]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"row",title:"",items:["columns","wrapperWidth"]},{type:"row",title:"Entries",items:["entriesCount","cellMinHeight"]},{type:"row",title:"",items:["imageOnHover","imageSize"]},{type:"row",title:"Entry Hover",items:["entryHoverEffect","entryHoverShowOption"]},{type:"row",title:"Divider Settings",items:["dividerWidth","showVisibility"]}]},{id:"columnsOrder",icon:"layers",title:"Columns Order",tooltip:"Columns order",layout:["__componentName__","columnsOrder"]},{id:"cutSettings",icon:"cut",title:"Cut settings",tooltip:"Cut settings",layout:["__componentName__",{type:"row",title:"",items:["cut"]},{type:"row",title:"Cut Settings",items:["cutLabel","cutCellMinHeight"]},{type:"row",title:"",items:["showCut"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",Jh]}],paletteBookmark:{items:[...ef],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},af={element:jh,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>Wh(e,t),preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Programme-list-default.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...vo.map(e=>({path:`${Ct(e,"textFontFamily")}`}))]},fontRelations:{...vo.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${Ct(t,"textFontFamily")}`}),{})},schema:rf,sourceCode:zh},el=300,Hn=.004,sf={questionColor:"question-color",answerColor:"answer-color",dividerColor:"divider-color",iconColor:"icon-color",questionHoverColor:"question-hover-color",iconHoverColor:"icon-hover-color",iconActiveColor:"icon-active-color",dividerHoverColor:"divider-hover-color"},lf=["hover","focus","filled","success","error"];function cf(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function tl(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function nl(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:x.scalingValue((o-t)/2,i)}}function df(e){return`
|
|
11957
11957
|
.${e}-wrapper {
|
|
11958
11958
|
box-sizing: border-box;
|
|
11959
11959
|
display: flex;
|
|
@@ -12043,7 +12043,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
12043
12043
|
width: var(--${e}-icon-max-width);
|
|
12044
12044
|
height: var(--${e}-icon-max-width);
|
|
12045
12045
|
position: relative;
|
|
12046
|
-
transition: transform ${
|
|
12046
|
+
transition: transform ${el}ms ease;
|
|
12047
12047
|
}
|
|
12048
12048
|
.${e}-icon-custom {
|
|
12049
12049
|
display: flex;
|
|
@@ -12078,7 +12078,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
12078
12078
|
.${e}-panel {
|
|
12079
12079
|
display: grid;
|
|
12080
12080
|
grid-template-rows: 0fr;
|
|
12081
|
-
transition: grid-template-rows ${
|
|
12081
|
+
transition: grid-template-rows ${el}ms ease;
|
|
12082
12082
|
}
|
|
12083
12083
|
.${e}-item-open .${e}-panel {
|
|
12084
12084
|
grid-template-rows: 1fr;
|
|
@@ -12116,7 +12116,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
12116
12116
|
pointer-events: none;
|
|
12117
12117
|
z-index: 2;
|
|
12118
12118
|
}
|
|
12119
|
-
`}function
|
|
12119
|
+
`}function il(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 uf({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:s}){const{prefix:l}=x.useScopedStyles(),d=o??!1,{wrapperWidth:c=1,cellMinHeight:u=0,dividerWidth:p=694e-6,dividerStyle:w="solid",entryHoverEffect:v="default",autoclose:T="off",icon:g,iconMaxWidth:$=.00833,iconPaddingRight:f=0,iconAnimation:R="rotate 45",questionColor:L="#000000",answerColor:I="#000000",dividerColor:Y="#0000001F",iconColor:P="#000000",questionHoverColor:V="#666666",iconHoverColor:M="#666666",iconActiveColor:C="#000000",dividerHoverColor:A="#000000",questionFontFamily:y,questionFontSettings:S,questionFontSize:F,questionLineHeight:W,questionLetterSpacing:U,questionWordSpacing:G,questionTextAppearance:J,answerFontFamily:D,answerFontSettings:j,answerFontSize:O,answerLineHeight:E,answerLetterSpacing:K,answerWordSpacing:Z,answerTextAppearance:ce,questionPaddingLeft:N=0,questionPaddingTop:pe=0,questionPaddingBottom:b=0,answerPaddingLeft:he=0,answerPaddingRight:Q=0,answerPaddingTop:we=0,answerPaddingBottom:Te=0}=e,se=t??[],[oe,q]=a.useState(()=>new Set),de=!n||i;a.useEffect(()=>{q(new Set)},[T]),a.useEffect(()=>{n&&!o&&!i&&q(new Set)},[n,o,i]);const ge=Oe=>x.scalingValue(Oe,n??!1),_e=Math.max(N,Hn),Ce=Math.max(pe,Hn),Me=Math.max(b,Hn),fe=Math.max(he,Hn),ye=Math.max(Q,Hn),Se=Math.max(we,Hn),B=Math.max(Te,Hn),ue=Math.max(0,(c??1)-f-$),ve=Math.max(0,(c??1)-Q),me=Math.max(0,(c??1)-he),Ee=Math.max(f,Hn),be=Math.max(0,(c??1)-N-$),k=a.useMemo(()=>oe.size===0?0:Math.min(...oe),[oe]),re=a.useCallback(Oe=>oe.has(Oe),[oe]),te=de&&v==="default"?`${l}-entry-hover-default`:"",z=g??"",le=z!=="",Re=R.replace(/^rotate /,""),ae=`${l}-icon-anim-${Re}`,_=nn(zt(il(y,S,F,W,U,G,J,L),n)),Ne=nn(zt(il(D,j,O,E,K,Z,ce,I),n)),Fe=tl(F,W,`${l}-question`,`${l}-text-tight-leading`),et=tl(O,E,`${l}-answer-text`,`${l}-text-tight-leading`),Ke=nl(F,W,l,n),Ie=nl(O,E,l,n),ee=x.buildColorVars(l,{questionColor:L,answerColor:I,dividerColor:Y,iconColor:P,questionHoverColor:V,iconHoverColor:M,iconActiveColor:C,dividerHoverColor:A},sf,lf),ne=s&&s!=="default"?`${l}-state-${s}`:"",He=a.useCallback(Oe=>{de&&q(je=>{if(je.has(Oe)){const tt=new Set(je);return tt.delete(Oe),tt}if(T==="on")return new Set([Oe]);const qe=new Set(je);return qe.add(Oe),qe})},[de,T]),st=a.useMemo(()=>df(l),[l]),Be={[`--${l}-divider-width`]:x.scalingValue(p,n??!1),[`--${l}-divider-style`]:w,[`--${l}-icon-max-width`]:x.scalingValue($,n??!1),...u>0?{[`--${l}-question-min-height`]:x.scalingValue(u,n??!1)}:{}};return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:st}}),r.jsx("div",{style:ee,children:r.jsx("div",{className:dt(`${l}-wrapper`,n&&!i&&`${l}-editor`,te,ne),style:{width:x.scalingValue(c,n??!1),maxWidth:"100%",...Be},children:se.map((Oe,je)=>{var pt;const qe=re(je),tt=((pt=Oe.question)==null?void 0:pt.trim())??"",mt=Oe.answer,St=((mt==null?void 0:mt.length)??0)>0,lt=d&&je===k;return r.jsxs("div",{className:dt(`${l}-item`,qe&&`${l}-item-open`),"data-faq-item":"",children:[r.jsxs("div",{className:`${l}-question-controls`,children:[lt&&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:ge(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(ue),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:ge(_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(be),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:ge(Ee),height:"100%"}})]}),r.jsxs("button",{type:"button",className:`${l}-question-button`,"aria-expanded":qe,style:{..._,...Ke,paddingLeft:ge(N),paddingRight:ge(f)},onClick:()=>He(je),children:[pe>0&&r.jsx("span",{className:`${l}-padding-handle`,style:{height:ge(pe)},"aria-hidden":"true"}),r.jsxs("span",{className:`${l}-question-row`,children:[r.jsx("span",{className:Fe,children:tt}),St&&(le?r.jsx("span",{className:`${l}-icon ${l}-icon-custom ${ae}`,"aria-hidden":"true",children:r.jsx(on,{url:z,fill:P,hoverFill:M,className:`${l}-icon-image`})}):r.jsx("span",{className:`${l}-icon ${l}-icon-default ${ae}`,"aria-hidden":"true"}))]}),b>0&&r.jsx("span",{className:`${l}-padding-handle`,style:{height:ge(b)},"aria-hidden":"true"})]}),lt&&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:ge(Me)}})]}),St&&mt&&r.jsx("div",{className:`${l}-panel`,"aria-hidden":!qe,children:r.jsx("div",{className:`${l}-panel-inner`,children:r.jsxs("div",{className:`${l}-answer-controls`,children:[lt&&qe&&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:ge(Se)}}),r.jsx("div",{"data-controls":"answerPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(ve),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:ge(fe),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(me),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:ge(ye),height:"100%"}})]}),we>0&&r.jsx("div",{className:`${l}-padding-handle`,style:{height:ge(we)}}),r.jsx("div",{className:`${l}-answer`,style:{...Ne,...Ie,paddingLeft:ge(he),paddingRight:ge(Q)},children:r.jsx("div",{className:et,children:r.jsx(hi,{content:mt})})}),Te>0&&r.jsx("div",{className:`${l}-padding-handle`,style:{height:ge(Te)}}),lt&&qe&&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:ge(B)}})]})})})]},je)})})})]})}const pf=`import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
12120
12120
|
import cn from 'classnames';
|
|
12121
12121
|
import { CommonComponentProps } from '../props';
|
|
12122
12122
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -12862,7 +12862,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
12862
12862
|
</>
|
|
12863
12863
|
);
|
|
12864
12864
|
}
|
|
12865
|
-
`;function On(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const il={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},mf=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],gf={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:{...il.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:{...il.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:[...mf],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},hf={element:uf,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:gf,sourceCode:pf},Fn=e=>e.display==="cover",Mr=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},ol=100,ff=.2,rl=8,Ic=({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"?ol:Math.max(ol,window.innerHeight*ff),[]),b=a.useCallback(y=>Math.max(0,1-y/(p*1.5)),[p]),S=a.useCallback(y=>Math.max(0,1-y/(p*.45)),[p]),T=a.useCallback(y=>{const x=typeof window<"u"?window.innerHeight:800,A=Math.max(.88,1-y/x*.12);return`translateY(${y}px) scale(${A})`},[]),g=a.useCallback(()=>{c.current=null},[]),$=a.useCallback(()=>{d(!0),s(0),window.setTimeout(()=>d(!1),n),g()},[n,g]),h=a.useCallback(()=>{const y=typeof window<"u"?window.innerHeight:800;d(!0),s(y),window.setTimeout(()=>{t(),g(),d(!1)},Math.min(n,200))},[n,t,g]),I=a.useCallback(y=>{!e||l||y.pointerType==="touch"&&(i!=null&&i(y.target)||(c.current={startX:y.clientX,startY:y.clientY,isLocked:null,pointerId:y.pointerId}))},[e,l,i]),R=a.useCallback(y=>{const x=c.current;if(!e||!x||y.pointerType!=="touch"||x.pointerId!==y.pointerId)return;const A=y.clientX-x.startX,H=y.clientY-x.startY;if(x.isLocked===null){if(Math.abs(A)<rl&&Math.abs(H)<rl)return;if(H>0&&H>Math.abs(A))x.isLocked=!0,y.currentTarget.setPointerCapture(y.pointerId);else{x.isLocked=!1,g();return}}if(!x.isLocked)return;y.preventDefault();const K=Math.max(0,H);u.current=K,s(K)},[e,g]),E=a.useCallback(y=>{const x=c.current;if(!e||!x||y.pointerType!=="touch"||x.pointerId!==y.pointerId)return;const A=x.isLocked===!0;if(y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),!A){g();return}y.clientY-x.startY>=p?h():$()},[p,h,e,g,$]),Z=a.useCallback(y=>{E(y)},[E]),P=a.useCallback(y=>{E(y)},[E]),B=o>0,M=l?`transform ${n}ms ease`:"none",C=l?`opacity ${n}ms ease`:"none",W=o>0||l;return{isSwipeDragging:B,backdropStyle:{opacity:b(o),transition:C},mediaAreaStyle:{transform:T(o),transition:M,touchAction:B?"none":void 0,willChange:B?"transform":void 0},overlayContentStyle:W?{opacity:S(o),transition:C}:void 0,swipeHandlers:e?{onPointerDown:I,onPointerMove:R,onPointerUp:Z,onPointerCancel:P}:{},dismissAreaStyle:e?{touchAction:B?"none":"pan-x"}:void 0}},yf="[data-lightbox-scrollable]",Rc=()=>{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(yf)||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"})}},[])},vf=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},xf=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},bf=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=(g,$)=>{xf(t),e.scrollLeft=g,$&&(s==null||s())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let p=!1,b=0;const S=()=>{t.removeEventListener("transitionend",T),clearTimeout(b)},T=g=>{g.target!==t||g.propertyName!=="transform"||p||(p=!0,S(),u(n,!0))};return t.addEventListener("transitionend",T),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,S(),u(n,!0))},i+64),()=>{p||(p=!0,S(),u(l-bf(t),!1))}},so=300,Sf=900,$f=1500,Cf="cubic-bezier(0.16, 1, 0.3, 1)",Tf=3e3,Lf=2,If=16,Rf=.05,Ef=1,Vo=.3,Mf=50,kf=20,bi=.004,zi=["title1","title2","title3"],Pf={title1:"1",title2:"2",title3:"3"},Af={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Ff={title1:.02,title2:.02,title3:.02},Go=e=>`max(${e}, ${kf}px)`,Wf=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]}},_f=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=Wf(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Ft=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Nf=e=>[Ft(e,"fontFamily"),Ft(e,"fontSettings"),{type:"row",items:[Ft(e,"fontSize"),Ft(e,"lineHeight"),Ft(e,"letterSpacing"),Ft(e,"wordSpacing")]},Ft(e,"textAlign"),Ft(e,"textAppearance")],Hf=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(zi.map(e=>[Pf[e],Nf(e)]))}),is=(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},Ec=(e,t)=>is(e,t),qo=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},al=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:is(e.length,n),effective:Ec(e.length,n)}},Of=(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},Qr=(e,t)=>{const n=i=>{const o=Ft(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[Af[t]]}},jf=(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),ea=(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??Ff[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return zt(i,n)},Df=({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:S,closeIconMaxWidth:T,closeIconColor:g,closeIconHoverColor:$,thumbnailTrigger:h,thumbnailVisibility:I,thumbnailObjectFit:R,thumbnailActive:E,thumbnailActiveColor:Z,title1Width:P,title2Width:B,title3Width:M,title1MarginLeft:C=0,title2MarginLeft:W=0,title3MarginLeft:y=0,titleRowMarginBottom:x=0,titleHeaderLayout:A="desktop",contentMarginTop:H,iconMarginLeft:K}=n,G=m=>v.scalingValue(m,i??!1),Y=c??n.thumnailSize??.03,V=G(Y),D=G(u),O=G(p??.02),L=G(b??0),U=G(H??0),J=Go(U),ce=G(K??0),[_,de]=a.useState(0),w=a.useRef(_);w.current=_;const ge=t[_],{title1:Q,title2:ve,title3:Le}=_f(ge),pe=ea("title1",Qr(n,"title1"),i),ae=ea("title2",Qr(n,"title2"),i),q=ea("title3",Qr(n,"title3"),i),se=A==="mobile",he=!o&&(!i||s),Pe=he,Ce=he,ke=he,fe=Fn(R),xe=fe?{"--image-aspect-ratio":Mr(R)}:void 0,Se=!!(Q||ve||Le),z=a.useMemo(()=>Of(e,Q,ve,Le,pe,ae,q),[e,_,Q,ve,Le,pe,ae,q]),me=a.useMemo(()=>({title1Width:P,title2Width:B,title3Width:M}),[P,B,M]),ye=a.useMemo(()=>z.map(m=>me[m.widthKey]),[z,me]),ue=a.useMemo(()=>is(z.length,ye),[z.length,ye]),Ee=a.useMemo(()=>Ec(z.length,ye),[z.length,ye]),we=a.useMemo(()=>z.filter(m=>m.prefix==="title1"),[z]),k=a.useMemo(()=>z.filter(m=>m.prefix==="title2"||m.prefix==="title3"),[z]),le=a.useMemo(()=>al(we,me),[we,me]),te=a.useMemo(()=>al(k,me),[k,me]),j=a.useCallback((m,N)=>{const X=z.indexOf(m);if(!se||N==="single-row")return{effectiveWidth:Ee[X]??0,resolvedWidth:ue[X]??0,maxWidth:qo(X,ue)};if(N==="two-row-top"){const Ae=we.indexOf(m);return{effectiveWidth:le.effective[Ae]??0,resolvedWidth:le.resolved[Ae]??0,maxWidth:qo(Ae,le.resolved)}}const $e=k.indexOf(m);return{effectiveWidth:te.effective[$e]??0,resolvedWidth:te.resolved[$e]??0,maxWidth:qo($e,te.resolved)}},[k,te,Ee,ue,z,we,le,se]),re=a.useCallback(m=>v.scalingValue(m,i??!1),[i]),Ie=re(x??0),ie=a.useMemo(()=>({title1MarginLeft:C,title2MarginLeft:W,title3MarginLeft:y}),[C,W,y]),F=a.useCallback(m=>z.slice(0,m+1).reduce((N,X,$e)=>N+(X!=null&&X.marginLeftKey?ie[X.marginLeftKey]??0:0)+(ue[$e]??0),0)+(se?0:C??0),[z,ie,ue,se,C]),He=a.useCallback(()=>se?0:C??0,[se,C]),Ne=a.useCallback(m=>k.slice(0,m).reduce((N,X,$e)=>N+(X.marginLeftKey?ie[X.marginLeftKey]??0:0)+(te.resolved[$e]??0),0),[k,te.resolved,ie]),tt=a.useCallback(m=>{const N=k[m];return Ne(m)+(N.marginLeftKey?ie[N.marginLeftKey]??0:0)+(te.resolved[m]??0)},[k,te.resolved,Ne,ie]),Ke=(m,N)=>{const X=m.marginLeftKey?ie[m.marginLeftKey]??0:0,{effectiveWidth:$e,resolvedWidth:Ae,maxWidth:Be}=j(m,N),gt=o&&N==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":m.prefix,style:{...N==="single-row"?{gridArea:m.prefix}:{},width:re($e),...X>0?{marginLeft:re(X)}:{}},children:[r.jsx("p",{className:m.className,style:m.style,children:m.text}),gt&&m.marginLeftKey&&r.jsx("div",{"data-controls":m.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ae),style:{position:"absolute",top:0,left:re(-X),width:`max(${re(X)}, 10px)`,height:"100%",pointerEvents:"auto"}}),gt&&r.jsx("div",{"data-controls":m.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Be),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:re(-bi/2),width:re(bi),height:"100%",pointerEvents:"auto"}})]},m.className)},Re=()=>{const m=se?-1:z.findIndex($e=>$e.prefix==="title1"),N=!se&&(o||(C??0)>0)?(()=>{const $e=C??0,Ae=m>=0?ue[m]:P??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(${re($e)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,X=z.flatMap(($e,Ae)=>{if(!$e.marginLeftKey)return[];const Be=ie[$e.marginLeftKey]??0,gt=jf(z,ue,ie,Ae)+He();return r.jsx("div",{"data-controls":$e.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ue[Ae]),style:{position:"absolute",top:0,left:re(gt),width:`max(${re(Be)}, 10px)`,height:"100%",pointerEvents:"auto"}},$e.marginLeftKey)});return N?[N,...X]:X},ee=()=>z.map((m,N)=>{const X=qo(N,ue),Ae=F(N)-bi/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":m.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(X),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:re(Ae),width:re(bi),height:"100%",pointerEvents:"auto"}})},`${m.widthKey}-junction`)}),ne=()=>k.flatMap((m,N)=>{if(!m.marginLeftKey)return[];const X=ie[m.marginLeftKey]??0,$e=Ne(N),{resolvedWidth:Ae}=j(m,"two-row-bottom");return r.jsx("div",{"data-controls":m.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ae),style:{position:"absolute",top:0,left:re($e),width:`max(${re(X)}, 10px)`,height:"100%",pointerEvents:"auto"}},m.marginLeftKey)}),Me=()=>k.map((m,N)=>{const{maxWidth:X}=j(m,"two-row-bottom"),Ae=tt(N)-bi/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":m.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(X),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:re(Ae),width:re(bi),height:"100%",pointerEvents:"auto"}})},`${m.widthKey}-junction`)}),qe=a.useRef(null),De=a.useRef(null),Oe=a.useRef(null),Ve=a.useRef(null),it=a.useRef([]),Qe=a.useRef([]),pt=a.useRef(0),bt=a.useRef(null),ot=a.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),ht=a.useRef(null),Wt=a.useRef(null),dt=a.useRef(0),Xe=a.useRef("forward"),ze=a.useRef(0),vt=a.useRef(null),wt=a.useRef(!1),kt=t.length>1&&(!o||!!s),jt=kt?3:1,tn=a.useMemo(()=>Array.from({length:jt},()=>t).flat(),[t,jt]),[ln,Tt]=a.useState(!1),[Mt,Yt]=a.useState(!1),[qt,Te]=a.useState(!0),Ge=a.useRef(null),Ue=a.useRef(null),lt=a.useRef(!1),Rt=a.useRef(!1),ut=a.useRef(null),nt=a.useRef(null),Ut=Pe&&!qt,Ze=a.useCallback(()=>{Pe&&(Te(!0),nt.current&&clearTimeout(nt.current),nt.current=setTimeout(()=>{ot.current.isActive||Te(!1)},Tf))},[Pe]),Je=a.useCallback(()=>{o||Rt.current||(Rt.current=!0,Yt(!1),ut.current=setTimeout(()=>{l()},so))},[o,l]),at=()=>r.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":Ut?"true":"false",style:{width:v.scalingValue(T??0,i),height:v.scalingValue(T??0,i),marginRight:ce,"--close-icon-hover-color":$},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Je,"aria-label":"Close",children:r.jsx(on,{url:S,fill:g,hoverFill:i&&!s?g:$,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:ce,height:"100%",pointerEvents:"auto"}})]}),Lt=(m="two-row")=>r.jsx("div",{...m==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:re(C??0),flexShrink:0,...m==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...m==="two-row"&&o?{pointerEvents:"auto"}:{}}}),It=()=>{const m=z.find($e=>$e.prefix==="title1"),N=z.filter($e=>$e.prefix==="title2"||$e.prefix==="title3"),X=N.length>0||o||(x??0)>0;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${e}-header-row-top`,children:[(C??0)>0||o?Lt():null,m&&Ke(m,"two-row-top"),S&&at()]}),X?r.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[N.length>0?r.jsxs("div",{className:`${e}-header-row-bottom`,children:[N.map($e=>Ke($e,"two-row-bottom")),o&&r.jsxs(r.Fragment,{children:[ne(),Me()]})]}):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]})},ft=()=>r.jsxs(r.Fragment,{children:[(C??0)>0||o?Lt("single-row"):null,z.map(m=>Ke(m,"single-row")),o?r.jsxs(r.Fragment,{children:[Re(),ee()]}):null,S?at():null]}),At=a.useCallback(m=>!!(m.closest("[data-controls]")||m.closest(`.${e}-thumbnails`)||m.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:Ot,backdropStyle:Ht,mediaAreaStyle:Vt,overlayContentStyle:xt,swipeHandlers:Gt,dismissAreaStyle:Kt}=Ic({enabled:he??!1,onClose:Je,animMs:so,isBlockedTarget:At}),Xt=()=>{if(!kt||t.length===0)return pt.current=0,0;const m=Qe.current[0],N=Qe.current[t.length];if(!m||!N)return pt.current;const X=N.offsetLeft-m.offsetLeft;return X>0&&(pt.current=X),pt.current},Zt=(m=!1)=>{if(!kt)return;const N=De.current,X=Xt();!N||X<=0||X<N.clientWidth*.25||(N.scrollLeft<=0?(N.scrollLeft+=X,m&&(ot.current.scrollLeft+=X),wt.current&&(ze.current+=X)):N.scrollLeft>=X*2&&(N.scrollLeft-=X,m&&(ot.current.scrollLeft-=X),wt.current&&(ze.current-=X)))},Dt=(m,N=(X=>(X=De.current)==null?void 0:X.scrollLeft)()??0)=>{if(!kt)return m;let $e=t.length+m,Ae=1/0;for(let Be=0;Be<jt;Be++){const gt=Be*t.length+m,$t=Qe.current[gt];if(!$t)continue;const en=Math.abs($t.offsetLeft-N);en<Ae&&(Ae=en,$e=gt)}return $e},St=m=>{const N=De.current;return!m||!N?!1:m.offsetWidth>N.clientWidth+1},f=m=>{const N=De.current;if(!m||!N||!St(m))return!1;const X=m.offsetLeft,$e=X+m.offsetWidth;return N.scrollLeft>=X-1&&N.scrollLeft+N.clientWidth<=$e+1},be=(m=(N=>(N=De.current)==null?void 0:N.scrollLeft)()??0)=>{for(let $e=0;$e<Qe.current.length;$e+=1){const Ae=Qe.current[$e];if(Ae&&f(Ae))return $e}let X={flatIndex:0,distance:1/0};return Qe.current.forEach(($e,Ae)=>{if(!$e)return;const Be=Math.abs($e.offsetLeft-m);Be<X.distance&&(X={flatIndex:Ae,distance:Be})}),X.flatIndex},Fe=m=>{De.current&&Qe.current.forEach(N=>{N&&(N.style.scrollSnapAlign=St(N)&&m==="backward"?"end":"start")})},We=(m,N,X)=>{const $e=m-N,Ae=be(N),Be=Qe.current[Ae];if(f(Be))return be(m)%t.length;const gt=Qe.current[Ae+1],$t=Be?gt?gt.offsetLeft-Be.offsetLeft:Be.offsetWidth:0,en=$t>0?$e>$t*Vo?1:$e<-$t*Vo?-1:0:0;return en===0?X:kt?(X+en+t.length)%t.length:Math.max(0,Math.min(t.length-1,X+en))},st=a.useCallback((m=!1)=>{if(I!=="on"||o)return;const N=Ve.current,X=w.current,$e=it.current[X];if(!N||!$e||N.scrollWidth<=N.clientWidth)return;const Ae=N.scrollLeft,Be=Ae+N.clientWidth,gt=$e.offsetLeft,$t=gt+$e.offsetWidth;if(gt>=Ae&&$t<=Be)return;const en=N.scrollWidth-N.clientWidth;let Jt=Ae;if(!m&&Ge.current===null){const vi=it.current[X-1],Yi=it.current[X+1],Fo=vi?$e.offsetLeft-vi.offsetLeft:Yi?Yi.offsetLeft-$e.offsetLeft:$e.offsetWidth;$t>Be?Jt+=Fo:gt<Ae&&(Jt-=Fo)}else $t>Be?Jt=$t-N.clientWidth:Jt=gt;N.scrollLeft=Math.max(0,Math.min(en,Jt))},[o,I]),Pt=a.useCallback((m=!1)=>{m&&(lt.current=!0),Ue.current===null&&(Ue.current=requestAnimationFrame(()=>{Ue.current=null;const N=lt.current;lt.current=!1,st(N)}))},[st]),et=a.useCallback(m=>{if(m===w.current)return;const N=w.current;w.current=m;const X=Math.abs(m-N)>1,$e=kt&&t.length>1&&(N===t.length-1&&m===0||N===0&&m===t.length-1);de(m),Pt(X||$e)},[t.length,kt,Pt]),mt=()=>{if(!De.current||t.length===0||Ge.current!==null||ot.current.isActive&&ot.current.hasMoved)return;const m=De.current.scrollLeft,N=be(m)%t.length;N!==w.current&&et(N)},_t=()=>{Ge.current=null},Et=m=>{const N=De.current;N&&(N.style.scrollSnapType=m?"":"none")},cn=()=>{var m;(m=Wt.current)==null||m.call(Wt),Wt.current=null},dn=()=>{vt.current!==null&&(cancelAnimationFrame(vt.current),vt.current=null),wt.current=!1},ei=()=>{const m=De.current;if(!m){vt.current=null,wt.current=!1;return}const N=ze.current-m.scrollLeft;if(Math.abs(N)<.5){m.scrollLeft=ze.current,Zt(),mt(),vt.current=null,wt.current=!1;return}m.scrollLeft+=N*Rf,Zt(),mt(),Ze(),vt.current=requestAnimationFrame(ei)},ti=()=>{const m=Oe.current;m&&(m.style.transition="",m.style.transform="",m.style.willChange="")},Mo=(m,N,X,$e)=>{ti(),m.scrollLeft=N,dt.current=m.scrollLeft,Zt(),X!==void 0?(w.current=X,de(X)):mt(),Et(!0),$e==null||$e()},ko=(m,{behavior:N="smooth",activeIndex:X,onComplete:$e}={})=>{const Ae=De.current,Be=Oe.current;if(!Ae||!Be)return;if(dn(),cn(),Et(!1),N==="auto"){Mo(Ae,m,X,$e);return}const gt=Math.abs(m-Ae.scrollLeft),$t=vf(gt,Sf,$f,Ae.clientWidth*.55);Wt.current=wf(Ae,Be,m,{duration:$t,easing:Cf,onComplete:()=>{Wt.current=null,Mo(Ae,m,X,$e)}})},Pr=(m="smooth")=>{const N=De.current;if(!N||t.length===0)return;const X=be()%t.length,$e=Dt(X,N.scrollLeft),Ae=Qe.current[$e];Ae&&ko(Ae.offsetLeft,{behavior:m,activeIndex:X})},Ar=(m,N="smooth",X,$e)=>{const Ae=De.current;if(!Ae||t.length===0)return;const Be=($e??Ae.scrollLeft)-m,gt=be(m),$t=Qe.current[gt];if(f($t)){Et(!0),mt();return}const en=Qe.current[gt+1],Jt=$t?en?en.offsetLeft-$t.offsetLeft:$t.offsetWidth:0;if((Jt>0?Be>Jt*Vo?1:Be<-Jt*Vo?-1:0:0)!==0){const _c=X??gt%t.length,Nc=We($e??Ae.scrollLeft,m,_c);wn(Nc,N);return}const Yi=$e??Ae.scrollLeft,Fo=be(Yi),os=Qe.current[Fo];if(os&&Math.abs(os.offsetLeft-Yi)<1){Et(!0),mt();return}Pr("auto")},wn=(m,N="smooth")=>{const X=De.current;if(!X||t.length===0)return;const $e=Dt(m,X.scrollLeft),Ae=Qe.current[$e];Ae&&(N==="smooth"?Ge.current=m:Ge.current=null,w.current=m,de(m),Pt(!0),ko(Ae.offsetLeft,{behavior:N,activeIndex:m,onComplete:N==="smooth"?_t:void 0}))},yi=()=>{ht.current&&(window.removeEventListener("pointerup",ht.current),window.removeEventListener("pointercancel",ht.current),ht.current=null)},Po=(m,N,X,$e,Ae)=>{const Be=X-m,gt=$e-N,$t=Math.abs(Be),en=Math.abs(gt);if($t<Mf||$t<=en)return!1;const Jt=Be<0?1:-1,vi=kt?(Ae+Jt+t.length)%t.length:Math.max(0,Math.min(t.length-1,Ae+Jt));return vi===Ae?!1:(wn(vi),!0)},ni=m=>{if(!ot.current.isActive)return;yi();const N=De.current;if(!N)return;const{scrollLeft:X,startActiveIndex:$e,hasMoved:Ae}=ot.current,Be=N.scrollLeft;Zt(!0),ot.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},Tt(!1),m!==void 0&&N.hasPointerCapture(m)&&N.releasePointerCapture(m),Ae?Ar(X,"smooth",$e,Be):(Et(!0),mt()),Ze()},Ao=(m,N)=>{const X=bt.current;bt.current=null,X&&(Po(X.startX,X.startY,m,N,X.startActiveIndex),Ze())},Fr=m=>{if(!Ce)return;if(m.pointerType==="touch"){if(dn(),Et(!0),At(m.target))return;bt.current={startX:m.clientX,startY:m.clientY,startActiveIndex:w.current};return}if(m.pointerType!=="mouse"||m.button!==0||At(m.target))return;const N=De.current;if(!N)return;dn(),cn(),ti(),Ge.current=null,ot.current={isActive:!0,startX:m.clientX,scrollLeft:N.scrollLeft,startActiveIndex:w.current,hasMoved:!1},Et(!1),Ze(),N.setPointerCapture(m.pointerId),yi();const X=$e=>{$e.pointerType==="mouse"&&ni($e.pointerId)};ht.current=X,window.addEventListener("pointerup",X),window.addEventListener("pointercancel",X)},Wr=m=>{if(!Ce||m.pointerType!=="mouse")return;const N=De.current;if(!N||!ot.current.isActive)return;if(m.buttons===0){ni(m.pointerId);return}const X=m.clientX-ot.current.startX;Math.abs(X)>Ef&&(ot.current.hasMoved=!0,Tt(!0)),ot.current.hasMoved&&(m.preventDefault(),N.scrollLeft=ot.current.scrollLeft-X,Zt(!0),mt(),Ze())},oe=m=>{if(Ce){if(m.pointerType==="touch"){m.type==="pointerup"?Ao(m.clientX,m.clientY):bt.current=null;return}m.pointerType==="mouse"&&ni(m.pointerId)}},_e=m=>{!Ce||m.pointerType!=="mouse"||ni(m.pointerId)};return Rc(),a.useEffect(()=>{const m=requestAnimationFrame(()=>Yt(!0));return()=>{cancelAnimationFrame(m),cn(),yi(),Ue.current!==null&&(cancelAnimationFrame(Ue.current),Ue.current=null),ut.current&&clearTimeout(ut.current),nt.current&&clearTimeout(nt.current)}},[]),a.useEffect(()=>{if(!Pe){Te(!0);return}Ze();const m=qe.current;if(!m)return;const N=()=>Ze();return m.addEventListener("pointermove",N),m.addEventListener("pointerdown",N),()=>{m.removeEventListener("pointermove",N),m.removeEventListener("pointerdown",N),nt.current&&clearTimeout(nt.current)}},[Pe,Ze]),a.useEffect(()=>{const m=N=>{N.key==="Escape"&&Je()};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[Je]),a.useLayoutEffect(()=>{Xt()},[L,t.length,kt]),a.useLayoutEffect(()=>{o||wn(w.current,"auto")},[L,o]),a.useLayoutEffect(()=>{wn(0,"auto")},[t.length,kt]),a.useEffect(()=>{const m=De.current;if(!m||o||!he)return;const N=X=>{if(X.preventDefault(),Math.abs(X.deltaY)<=Math.abs(X.deltaX))return;const $e=X.deltaMode===1?If:X.deltaMode===2?m.clientHeight:1,Ae=X.deltaY*$e*Lf;if(Ae!==0){if(cn(),wt.current||(wt.current=!0,ze.current=m.scrollLeft,Ge.current=null,Et(!1)),ze.current+=Ae,!kt){const Be=m.scrollWidth-m.clientWidth;ze.current=Math.max(0,Math.min(Be,ze.current))}Ze(),vt.current===null&&(vt.current=requestAnimationFrame(ei))}};return m.addEventListener("wheel",N,{passive:!1}),()=>{m.removeEventListener("wheel",N),dn()}},[o,he,kt]),a.useEffect(()=>{const m=De.current;if(!m)return;const N=()=>{Zt(ot.current.isActive);const $e=m.scrollLeft,Ae=$e-dt.current;dt.current=$e;const Be=pt.current>0?pt.current*.5:1/0;if(Ae!==0&&Math.abs(Ae)<Be){const gt=Ae>0?"forward":"backward";gt!==Xe.current&&(Xe.current=gt,Fe(gt))}ot.current.isActive&&ot.current.hasMoved||mt()};m.addEventListener("scroll",N,{passive:!0});const X=new ResizeObserver(()=>{Xt(),Zt(ot.current.isActive),Fe(Xe.current),mt()});return X.observe(m),()=>{cn(),m.removeEventListener("scroll",N),X.disconnect()}},[t.length,kt]),r.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{Ot||Je()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:Mt?1:0,transition:`opacity ${so}ms ease`,pointerEvents:Mt?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...Ht}}),r.jsxs("div",{ref:qe,className:`${e}-lightbox-dismiss-area`,style:Kt,...Gt,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:Vt,onClick:m=>m.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":ln?"true":"false",onPointerDown:Fr,onPointerMove:Wr,onPointerUp:oe,onPointerCancel:oe,onLostPointerCapture:_e,children:r.jsx("div",{ref:Oe,className:`${e}-lightbox-strip-track`,style:{gap:L},children:tn.map((m,N)=>{const X=m.image.objectFit??"contain",$e=N%t.length,Ae=Math.floor(N/t.length),Be=Go(L),gt=`calc(-0.5 * (${Be} + ${L}))`;return r.jsxs("div",{ref:$t=>Qe.current[N]=$t,className:`${e}-strip-item`,style:{height:A==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[r.jsx("img",{src:m.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:X}}),o&&$e<t.length-1&&Ae===0&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:gt,width:Be,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Ae}-${m.image.url}-${$e}`)})})})}),r.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":Ut?"true":"false",style:xt,children:[r.jsx("div",{style:{position:"relative",width:"100%",height:U,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:J,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${se?` ${e}-lightbox-content-area-stacked`:""}`,children:(Se||S)&&r.jsx("div",{className:`${e}-header ${se?`${e}-header-two-row`:`${e}-header-single-row`}`,children:se?It():Se||S?ft():null})})})]}),t.length>1&&I==="on"&&(()=>{const m=Go(O),N=`calc(-0.5 * (${O} + ${m}))`;return r.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:O},children:r.jsx("div",{ref:Ve,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:X=>X.stopPropagation(),children:r.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":E,style:{gap:D,"--thumbnail-active-color":Z},children:[t.map((X,$e)=>{const Ae=Go(D),Be=`calc(-0.5 * (${Ae} + ${D}))`;return r.jsxs("div",{ref:gt=>{it.current[$e]=gt},style:{position:"relative",flex:"0 0 auto"},children:[r.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":_===$e?"true":"false",onClick:()=>he&&h==="click"&&wn($e),onMouseEnter:()=>ke&&h==="hover"&&wn($e),"aria-label":X.image.name?`View ${X.image.name}`:`View image ${$e+1}`,"aria-current":_===$e?"true":void 0,children:r.jsx("img",{className:`${e}-thumb-image${fe?` ${e}-thumb-image-cover`:""}`,src:X.image.url,alt:"",draggable:!1,style:{...xe,maxWidth:V,maxHeight:V,width:R.display==="cover"?"auto":"100%",height:"auto",objectFit:R.display==="cover"?"cover":"contain"}})}),o&&$e<t.length-1&&r.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Be,width:Ae,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${X.image.url}-${$e}`)}),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:N,height:m,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function zf(e){return`
|
|
12865
|
+
`;function On(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const ol={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},mf=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],gf={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:{...ol.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:{...ol.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:[...mf],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},hf={element:uf,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:gf,sourceCode:pf},Fn=e=>e.display==="cover",Mr=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},rl=100,ff=.2,al=8,Ic=({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"?rl:Math.max(rl,window.innerHeight*ff),[]),w=a.useCallback(y=>Math.max(0,1-y/(p*1.5)),[p]),v=a.useCallback(y=>Math.max(0,1-y/(p*.45)),[p]),T=a.useCallback(y=>{const S=typeof window<"u"?window.innerHeight:800,F=Math.max(.88,1-y/S*.12);return`translateY(${y}px) scale(${F})`},[]),g=a.useCallback(()=>{c.current=null},[]),$=a.useCallback(()=>{d(!0),s(0),window.setTimeout(()=>d(!1),n),g()},[n,g]),f=a.useCallback(()=>{const y=typeof window<"u"?window.innerHeight:800;d(!0),s(y),window.setTimeout(()=>{t(),g(),d(!1)},Math.min(n,200))},[n,t,g]),R=a.useCallback(y=>{!e||l||y.pointerType==="touch"&&(i!=null&&i(y.target)||(c.current={startX:y.clientX,startY:y.clientY,isLocked:null,pointerId:y.pointerId}))},[e,l,i]),L=a.useCallback(y=>{const S=c.current;if(!e||!S||y.pointerType!=="touch"||S.pointerId!==y.pointerId)return;const F=y.clientX-S.startX,W=y.clientY-S.startY;if(S.isLocked===null){if(Math.abs(F)<al&&Math.abs(W)<al)return;if(W>0&&W>Math.abs(F))S.isLocked=!0,y.currentTarget.setPointerCapture(y.pointerId);else{S.isLocked=!1,g();return}}if(!S.isLocked)return;y.preventDefault();const U=Math.max(0,W);u.current=U,s(U)},[e,g]),I=a.useCallback(y=>{const S=c.current;if(!e||!S||y.pointerType!=="touch"||S.pointerId!==y.pointerId)return;const F=S.isLocked===!0;if(y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),!F){g();return}y.clientY-S.startY>=p?f():$()},[p,f,e,g,$]),Y=a.useCallback(y=>{I(y)},[I]),P=a.useCallback(y=>{I(y)},[I]),V=o>0,M=l?`transform ${n}ms ease`:"none",C=l?`opacity ${n}ms ease`:"none",A=o>0||l;return{isSwipeDragging:V,backdropStyle:{opacity:w(o),transition:C},mediaAreaStyle:{transform:T(o),transition:M,touchAction:V?"none":void 0,willChange:V?"transform":void 0},overlayContentStyle:A?{opacity:v(o),transition:C}:void 0,swipeHandlers:e?{onPointerDown:R,onPointerMove:L,onPointerUp:Y,onPointerCancel:P}:{},dismissAreaStyle:e?{touchAction:V?"none":"pan-x"}:void 0}},yf="[data-lightbox-scrollable]",Rc=()=>{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(yf)||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"})}},[])},vf=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},xf=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},bf=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=(g,$)=>{xf(t),e.scrollLeft=g,$&&(s==null||s())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let p=!1,w=0;const v=()=>{t.removeEventListener("transitionend",T),clearTimeout(w)},T=g=>{g.target!==t||g.propertyName!=="transform"||p||(p=!0,v(),u(n,!0))};return t.addEventListener("transitionend",T),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)`,w=window.setTimeout(()=>{p||(p=!0,v(),u(n,!0))},i+64),()=>{p||(p=!0,v(),u(l-bf(t),!1))}},so=300,Sf=900,$f=1500,Cf="cubic-bezier(0.16, 1, 0.3, 1)",Tf=3e3,Lf=2,If=16,Rf=.05,Ef=1,Vo=.3,Mf=50,kf=20,bi=.004,zi=["title1","title2","title3"],Pf={title1:"1",title2:"2",title3:"3"},Af={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Ff={title1:.02,title2:.02,title3:.02},Go=e=>`max(${e}, ${kf}px)`,Wf=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]}},_f=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=Wf(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Wt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Nf=e=>[Wt(e,"fontFamily"),Wt(e,"fontSettings"),{type:"row",items:[Wt(e,"fontSize"),Wt(e,"lineHeight"),Wt(e,"letterSpacing"),Wt(e,"wordSpacing")]},Wt(e,"textAlign"),Wt(e,"textAppearance")],Hf=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(zi.map(e=>[Pf[e],Nf(e)]))}),os=(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},Ec=(e,t)=>os(e,t),qo=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},sl=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:os(e.length,n),effective:Ec(e.length,n)}},Of=(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},Qr=(e,t)=>{const n=i=>{const o=Wt(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[Af[t]]}},Df=(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),ea=(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??Ff[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return zt(i,n)},jf=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,onClose:l})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:w,closeIcon:v,closeIconMaxWidth:T,closeIconColor:g,closeIconHoverColor:$,thumbnailTrigger:f,thumbnailVisibility:R,thumbnailObjectFit:L,thumbnailActive:I,thumbnailActiveColor:Y,title1Width:P,title2Width:V,title3Width:M,title1MarginLeft:C=0,title2MarginLeft:A=0,title3MarginLeft:y=0,titleRowMarginBottom:S=0,titleHeaderLayout:F="desktop",contentMarginTop:W,iconMarginLeft:U}=n,G=m=>x.scalingValue(m,i??!1),J=c??n.thumnailSize??.03,D=G(J),j=G(u),O=G(p??.02),E=G(w??0),K=G(W??0),Z=Go(K),ce=G(U??0),[N,pe]=a.useState(0),b=a.useRef(N);b.current=N;const he=t[N],{title1:Q,title2:we,title3:Te}=_f(he),se=ea("title1",Qr(n,"title1"),i),oe=ea("title2",Qr(n,"title2"),i),q=ea("title3",Qr(n,"title3"),i),de=F==="mobile",ge=!o&&(!i||s),_e=ge,Ce=ge,Me=ge,fe=Fn(L),ye=fe?{"--image-aspect-ratio":Mr(L)}:void 0,Se=!!(Q||we||Te),B=a.useMemo(()=>Of(e,Q,we,Te,se,oe,q),[e,N,Q,we,Te,se,oe,q]),ue=a.useMemo(()=>({title1Width:P,title2Width:V,title3Width:M}),[P,V,M]),ve=a.useMemo(()=>B.map(m=>ue[m.widthKey]),[B,ue]),me=a.useMemo(()=>os(B.length,ve),[B.length,ve]),Ee=a.useMemo(()=>Ec(B.length,ve),[B.length,ve]),be=a.useMemo(()=>B.filter(m=>m.prefix==="title1"),[B]),k=a.useMemo(()=>B.filter(m=>m.prefix==="title2"||m.prefix==="title3"),[B]),re=a.useMemo(()=>sl(be,ue),[be,ue]),te=a.useMemo(()=>sl(k,ue),[k,ue]),z=a.useCallback((m,H)=>{const X=B.indexOf(m);if(!de||H==="single-row")return{effectiveWidth:Ee[X]??0,resolvedWidth:me[X]??0,maxWidth:qo(X,me)};if(H==="two-row-top"){const ke=be.indexOf(m);return{effectiveWidth:re.effective[ke]??0,resolvedWidth:re.resolved[ke]??0,maxWidth:qo(ke,re.resolved)}}const $e=k.indexOf(m);return{effectiveWidth:te.effective[$e]??0,resolvedWidth:te.resolved[$e]??0,maxWidth:qo($e,te.resolved)}},[k,te,Ee,me,B,be,re,de]),le=a.useCallback(m=>x.scalingValue(m,i??!1),[i]),Re=le(S??0),ae=a.useMemo(()=>({title1MarginLeft:C,title2MarginLeft:A,title3MarginLeft:y}),[C,A,y]),_=a.useCallback(m=>B.slice(0,m+1).reduce((H,X,$e)=>H+(X!=null&&X.marginLeftKey?ae[X.marginLeftKey]??0:0)+(me[$e]??0),0)+(de?0:C??0),[B,ae,me,de,C]),Ne=a.useCallback(()=>de?0:C??0,[de,C]),Fe=a.useCallback(m=>k.slice(0,m).reduce((H,X,$e)=>H+(X.marginLeftKey?ae[X.marginLeftKey]??0:0)+(te.resolved[$e]??0),0),[k,te.resolved,ae]),et=a.useCallback(m=>{const H=k[m];return Fe(m)+(H.marginLeftKey?ae[H.marginLeftKey]??0:0)+(te.resolved[m]??0)},[k,te.resolved,Fe,ae]),Ke=(m,H)=>{const X=m.marginLeftKey?ae[m.marginLeftKey]??0:0,{effectiveWidth:$e,resolvedWidth:ke,maxWidth:Ge}=z(m,H),ht=o&&H==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":m.prefix,style:{...H==="single-row"?{gridArea:m.prefix}:{},width:le($e),...X>0?{marginLeft:le(X)}:{}},children:[r.jsx("p",{className:m.className,style:m.style,children:m.text}),ht&&m.marginLeftKey&&r.jsx("div",{"data-controls":m.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ke),style:{position:"absolute",top:0,left:le(-X),width:`max(${le(X)}, 10px)`,height:"100%",pointerEvents:"auto"}}),ht&&r.jsx("div",{"data-controls":m.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ge),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:le(-bi/2),width:le(bi),height:"100%",pointerEvents:"auto"}})]},m.className)},Ie=()=>{const m=de?-1:B.findIndex($e=>$e.prefix==="title1"),H=!de&&(o||(C??0)>0)?(()=>{const $e=C??0,ke=m>=0?me[m]:P??0;return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ke),style:{position:"absolute",top:0,left:0,width:`max(${le($e)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,X=B.flatMap(($e,ke)=>{if(!$e.marginLeftKey)return[];const Ge=ae[$e.marginLeftKey]??0,ht=Df(B,me,ae,ke)+Ne();return r.jsx("div",{"data-controls":$e.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(me[ke]),style:{position:"absolute",top:0,left:le(ht),width:`max(${le(Ge)}, 10px)`,height:"100%",pointerEvents:"auto"}},$e.marginLeftKey)});return H?[H,...X]:X},ee=()=>B.map((m,H)=>{const X=qo(H,me),ke=_(H)-bi/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":m.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(X),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:le(ke),width:le(bi),height:"100%",pointerEvents:"auto"}})},`${m.widthKey}-junction`)}),ne=()=>k.flatMap((m,H)=>{if(!m.marginLeftKey)return[];const X=ae[m.marginLeftKey]??0,$e=Fe(H),{resolvedWidth:ke}=z(m,"two-row-bottom");return r.jsx("div",{"data-controls":m.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ke),style:{position:"absolute",top:0,left:le($e),width:`max(${le(X)}, 10px)`,height:"100%",pointerEvents:"auto"}},m.marginLeftKey)}),He=()=>k.map((m,H)=>{const{maxWidth:X}=z(m,"two-row-bottom"),ke=et(H)-bi/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":m.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(X),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:le(ke),width:le(bi),height:"100%",pointerEvents:"auto"}})},`${m.widthKey}-junction`)}),st=a.useRef(null),Be=a.useRef(null),Oe=a.useRef(null),je=a.useRef(null),qe=a.useRef([]),tt=a.useRef([]),mt=a.useRef(0),St=a.useRef(null),lt=a.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),pt=a.useRef(null),Mt=a.useRef(null),nt=a.useRef(0),Ve=a.useRef("forward"),De=a.useRef(0),vt=a.useRef(null),bt=a.useRef(!1),Pt=t.length>1&&(!o||!!s),Dt=Pt?3:1,tn=a.useMemo(()=>Array.from({length:Dt},()=>t).flat(),[t,Dt]),[ln,Tt]=a.useState(!1),[kt,Yt]=a.useState(!1),[qt,Le]=a.useState(!0),Ue=a.useRef(null),Xe=a.useRef(null),ct=a.useRef(!1),Rt=a.useRef(!1),ut=a.useRef(null),it=a.useRef(null),Ut=_e&&!qt,Ze=a.useCallback(()=>{_e&&(Le(!0),it.current&&clearTimeout(it.current),it.current=setTimeout(()=>{lt.current.isActive||Le(!1)},Tf))},[_e]),Je=a.useCallback(()=>{o||Rt.current||(Rt.current=!0,Yt(!1),ut.current=setTimeout(()=>{l()},so))},[o,l]),rt=()=>r.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":Ut?"true":"false",style:{width:x.scalingValue(T??0,i),height:x.scalingValue(T??0,i),marginRight:ce,"--close-icon-hover-color":$},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Je,"aria-label":"Close",children:r.jsx(on,{url:v,fill:g,hoverFill:i&&!s?g:$,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:ce,height:"100%",pointerEvents:"auto"}})]}),Lt=(m="two-row")=>r.jsx("div",{...m==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:le(C??0),flexShrink:0,...m==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...m==="two-row"&&o?{pointerEvents:"auto"}:{}}}),It=()=>{const m=B.find($e=>$e.prefix==="title1"),H=B.filter($e=>$e.prefix==="title2"||$e.prefix==="title3"),X=H.length>0||o||(S??0)>0;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${e}-header-row-top`,children:[(C??0)>0||o?Lt():null,m&&Ke(m,"two-row-top"),v&&rt()]}),X?r.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[H.length>0?r.jsxs("div",{className:`${e}-header-row-bottom`,children:[H.map($e=>Ke($e,"two-row-bottom")),o&&r.jsxs(r.Fragment,{children:[ne(),He()]})]}):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:Re,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},ft=()=>r.jsxs(r.Fragment,{children:[(C??0)>0||o?Lt("single-row"):null,B.map(m=>Ke(m,"single-row")),o?r.jsxs(r.Fragment,{children:[Ie(),ee()]}):null,v?rt():null]}),Ft=a.useCallback(m=>!!(m.closest("[data-controls]")||m.closest(`.${e}-thumbnails`)||m.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:Ot,backdropStyle:Ht,mediaAreaStyle:Vt,overlayContentStyle:xt,swipeHandlers:Gt,dismissAreaStyle:Kt}=Ic({enabled:ge??!1,onClose:Je,animMs:so,isBlockedTarget:Ft}),Xt=()=>{if(!Pt||t.length===0)return mt.current=0,0;const m=tt.current[0],H=tt.current[t.length];if(!m||!H)return mt.current;const X=H.offsetLeft-m.offsetLeft;return X>0&&(mt.current=X),mt.current},Zt=(m=!1)=>{if(!Pt)return;const H=Be.current,X=Xt();!H||X<=0||X<H.clientWidth*.25||(H.scrollLeft<=0?(H.scrollLeft+=X,m&&(lt.current.scrollLeft+=X),bt.current&&(De.current+=X)):H.scrollLeft>=X*2&&(H.scrollLeft-=X,m&&(lt.current.scrollLeft-=X),bt.current&&(De.current-=X)))},jt=(m,H=(X=>(X=Be.current)==null?void 0:X.scrollLeft)()??0)=>{if(!Pt)return m;let $e=t.length+m,ke=1/0;for(let Ge=0;Ge<Dt;Ge++){const ht=Ge*t.length+m,$t=tt.current[ht];if(!$t)continue;const en=Math.abs($t.offsetLeft-H);en<ke&&(ke=en,$e=ht)}return $e},wt=m=>{const H=Be.current;return!m||!H?!1:m.offsetWidth>H.clientWidth+1},h=m=>{const H=Be.current;if(!m||!H||!wt(m))return!1;const X=m.offsetLeft,$e=X+m.offsetWidth;return H.scrollLeft>=X-1&&H.scrollLeft+H.clientWidth<=$e+1},xe=(m=(H=>(H=Be.current)==null?void 0:H.scrollLeft)()??0)=>{for(let $e=0;$e<tt.current.length;$e+=1){const ke=tt.current[$e];if(ke&&h(ke))return $e}let X={flatIndex:0,distance:1/0};return tt.current.forEach(($e,ke)=>{if(!$e)return;const Ge=Math.abs($e.offsetLeft-m);Ge<X.distance&&(X={flatIndex:ke,distance:Ge})}),X.flatIndex},Pe=m=>{Be.current&&tt.current.forEach(H=>{H&&(H.style.scrollSnapAlign=wt(H)&&m==="backward"?"end":"start")})},Ae=(m,H,X)=>{const $e=m-H,ke=xe(H),Ge=tt.current[ke];if(h(Ge))return xe(m)%t.length;const ht=tt.current[ke+1],$t=Ge?ht?ht.offsetLeft-Ge.offsetLeft:Ge.offsetWidth:0,en=$t>0?$e>$t*Vo?1:$e<-$t*Vo?-1:0:0;return en===0?X:Pt?(X+en+t.length)%t.length:Math.max(0,Math.min(t.length-1,X+en))},at=a.useCallback((m=!1)=>{if(R!=="on"||o)return;const H=je.current,X=b.current,$e=qe.current[X];if(!H||!$e||H.scrollWidth<=H.clientWidth)return;const ke=H.scrollLeft,Ge=ke+H.clientWidth,ht=$e.offsetLeft,$t=ht+$e.offsetWidth;if(ht>=ke&&$t<=Ge)return;const en=H.scrollWidth-H.clientWidth;let Jt=ke;if(!m&&Ue.current===null){const vi=qe.current[X-1],Yi=qe.current[X+1],Fo=vi?$e.offsetLeft-vi.offsetLeft:Yi?Yi.offsetLeft-$e.offsetLeft:$e.offsetWidth;$t>Ge?Jt+=Fo:ht<ke&&(Jt-=Fo)}else $t>Ge?Jt=$t-H.clientWidth:Jt=ht;H.scrollLeft=Math.max(0,Math.min(en,Jt))},[o,R]),At=a.useCallback((m=!1)=>{m&&(ct.current=!0),Xe.current===null&&(Xe.current=requestAnimationFrame(()=>{Xe.current=null;const H=ct.current;ct.current=!1,at(H)}))},[at]),Qe=a.useCallback(m=>{if(m===b.current)return;const H=b.current;b.current=m;const X=Math.abs(m-H)>1,$e=Pt&&t.length>1&&(H===t.length-1&&m===0||H===0&&m===t.length-1);pe(m),At(X||$e)},[t.length,Pt,At]),gt=()=>{if(!Be.current||t.length===0||Ue.current!==null||lt.current.isActive&<.current.hasMoved)return;const m=Be.current.scrollLeft,H=xe(m)%t.length;H!==b.current&&Qe(H)},_t=()=>{Ue.current=null},Et=m=>{const H=Be.current;H&&(H.style.scrollSnapType=m?"":"none")},cn=()=>{var m;(m=Mt.current)==null||m.call(Mt),Mt.current=null},dn=()=>{vt.current!==null&&(cancelAnimationFrame(vt.current),vt.current=null),bt.current=!1},ei=()=>{const m=Be.current;if(!m){vt.current=null,bt.current=!1;return}const H=De.current-m.scrollLeft;if(Math.abs(H)<.5){m.scrollLeft=De.current,Zt(),gt(),vt.current=null,bt.current=!1;return}m.scrollLeft+=H*Rf,Zt(),gt(),Ze(),vt.current=requestAnimationFrame(ei)},ti=()=>{const m=Oe.current;m&&(m.style.transition="",m.style.transform="",m.style.willChange="")},Mo=(m,H,X,$e)=>{ti(),m.scrollLeft=H,nt.current=m.scrollLeft,Zt(),X!==void 0?(b.current=X,pe(X)):gt(),Et(!0),$e==null||$e()},ko=(m,{behavior:H="smooth",activeIndex:X,onComplete:$e}={})=>{const ke=Be.current,Ge=Oe.current;if(!ke||!Ge)return;if(dn(),cn(),Et(!1),H==="auto"){Mo(ke,m,X,$e);return}const ht=Math.abs(m-ke.scrollLeft),$t=vf(ht,Sf,$f,ke.clientWidth*.55);Mt.current=wf(ke,Ge,m,{duration:$t,easing:Cf,onComplete:()=>{Mt.current=null,Mo(ke,m,X,$e)}})},Pr=(m="smooth")=>{const H=Be.current;if(!H||t.length===0)return;const X=xe()%t.length,$e=jt(X,H.scrollLeft),ke=tt.current[$e];ke&&ko(ke.offsetLeft,{behavior:m,activeIndex:X})},Ar=(m,H="smooth",X,$e)=>{const ke=Be.current;if(!ke||t.length===0)return;const Ge=($e??ke.scrollLeft)-m,ht=xe(m),$t=tt.current[ht];if(h($t)){Et(!0),gt();return}const en=tt.current[ht+1],Jt=$t?en?en.offsetLeft-$t.offsetLeft:$t.offsetWidth:0;if((Jt>0?Ge>Jt*Vo?1:Ge<-Jt*Vo?-1:0:0)!==0){const _c=X??ht%t.length,Nc=Ae($e??ke.scrollLeft,m,_c);wn(Nc,H);return}const Yi=$e??ke.scrollLeft,Fo=xe(Yi),rs=tt.current[Fo];if(rs&&Math.abs(rs.offsetLeft-Yi)<1){Et(!0),gt();return}Pr("auto")},wn=(m,H="smooth")=>{const X=Be.current;if(!X||t.length===0)return;const $e=jt(m,X.scrollLeft),ke=tt.current[$e];ke&&(H==="smooth"?Ue.current=m:Ue.current=null,b.current=m,pe(m),At(!0),ko(ke.offsetLeft,{behavior:H,activeIndex:m,onComplete:H==="smooth"?_t:void 0}))},yi=()=>{pt.current&&(window.removeEventListener("pointerup",pt.current),window.removeEventListener("pointercancel",pt.current),pt.current=null)},Po=(m,H,X,$e,ke)=>{const Ge=X-m,ht=$e-H,$t=Math.abs(Ge),en=Math.abs(ht);if($t<Mf||$t<=en)return!1;const Jt=Ge<0?1:-1,vi=Pt?(ke+Jt+t.length)%t.length:Math.max(0,Math.min(t.length-1,ke+Jt));return vi===ke?!1:(wn(vi),!0)},ni=m=>{if(!lt.current.isActive)return;yi();const H=Be.current;if(!H)return;const{scrollLeft:X,startActiveIndex:$e,hasMoved:ke}=lt.current,Ge=H.scrollLeft;Zt(!0),lt.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},Tt(!1),m!==void 0&&H.hasPointerCapture(m)&&H.releasePointerCapture(m),ke?Ar(X,"smooth",$e,Ge):(Et(!0),gt()),Ze()},Ao=(m,H)=>{const X=St.current;St.current=null,X&&(Po(X.startX,X.startY,m,H,X.startActiveIndex),Ze())},Fr=m=>{if(!Ce)return;if(m.pointerType==="touch"){if(dn(),Et(!0),Ft(m.target))return;St.current={startX:m.clientX,startY:m.clientY,startActiveIndex:b.current};return}if(m.pointerType!=="mouse"||m.button!==0||Ft(m.target))return;const H=Be.current;if(!H)return;dn(),cn(),ti(),Ue.current=null,lt.current={isActive:!0,startX:m.clientX,scrollLeft:H.scrollLeft,startActiveIndex:b.current,hasMoved:!1},Et(!1),Ze(),H.setPointerCapture(m.pointerId),yi();const X=$e=>{$e.pointerType==="mouse"&&ni($e.pointerId)};pt.current=X,window.addEventListener("pointerup",X),window.addEventListener("pointercancel",X)},Wr=m=>{if(!Ce||m.pointerType!=="mouse")return;const H=Be.current;if(!H||!lt.current.isActive)return;if(m.buttons===0){ni(m.pointerId);return}const X=m.clientX-lt.current.startX;Math.abs(X)>Ef&&(lt.current.hasMoved=!0,Tt(!0)),lt.current.hasMoved&&(m.preventDefault(),H.scrollLeft=lt.current.scrollLeft-X,Zt(!0),gt(),Ze())},ie=m=>{if(Ce){if(m.pointerType==="touch"){m.type==="pointerup"?Ao(m.clientX,m.clientY):St.current=null;return}m.pointerType==="mouse"&&ni(m.pointerId)}},We=m=>{!Ce||m.pointerType!=="mouse"||ni(m.pointerId)};return Rc(),a.useEffect(()=>{const m=requestAnimationFrame(()=>Yt(!0));return()=>{cancelAnimationFrame(m),cn(),yi(),Xe.current!==null&&(cancelAnimationFrame(Xe.current),Xe.current=null),ut.current&&clearTimeout(ut.current),it.current&&clearTimeout(it.current)}},[]),a.useEffect(()=>{if(!_e){Le(!0);return}Ze();const m=st.current;if(!m)return;const H=()=>Ze();return m.addEventListener("pointermove",H),m.addEventListener("pointerdown",H),()=>{m.removeEventListener("pointermove",H),m.removeEventListener("pointerdown",H),it.current&&clearTimeout(it.current)}},[_e,Ze]),a.useEffect(()=>{const m=H=>{H.key==="Escape"&&Je()};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[Je]),a.useLayoutEffect(()=>{Xt()},[E,t.length,Pt]),a.useLayoutEffect(()=>{o||wn(b.current,"auto")},[E,o]),a.useLayoutEffect(()=>{wn(0,"auto")},[t.length,Pt]),a.useEffect(()=>{const m=Be.current;if(!m||o||!ge)return;const H=X=>{if(X.preventDefault(),Math.abs(X.deltaY)<=Math.abs(X.deltaX))return;const $e=X.deltaMode===1?If:X.deltaMode===2?m.clientHeight:1,ke=X.deltaY*$e*Lf;if(ke!==0){if(cn(),bt.current||(bt.current=!0,De.current=m.scrollLeft,Ue.current=null,Et(!1)),De.current+=ke,!Pt){const Ge=m.scrollWidth-m.clientWidth;De.current=Math.max(0,Math.min(Ge,De.current))}Ze(),vt.current===null&&(vt.current=requestAnimationFrame(ei))}};return m.addEventListener("wheel",H,{passive:!1}),()=>{m.removeEventListener("wheel",H),dn()}},[o,ge,Pt]),a.useEffect(()=>{const m=Be.current;if(!m)return;const H=()=>{Zt(lt.current.isActive);const $e=m.scrollLeft,ke=$e-nt.current;nt.current=$e;const Ge=mt.current>0?mt.current*.5:1/0;if(ke!==0&&Math.abs(ke)<Ge){const ht=ke>0?"forward":"backward";ht!==Ve.current&&(Ve.current=ht,Pe(ht))}lt.current.isActive&<.current.hasMoved||gt()};m.addEventListener("scroll",H,{passive:!0});const X=new ResizeObserver(()=>{Xt(),Zt(lt.current.isActive),Pe(Ve.current),gt()});return X.observe(m),()=>{cn(),m.removeEventListener("scroll",H),X.disconnect()}},[t.length,Pt]),r.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{Ot||Je()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:kt?1:0,transition:`opacity ${so}ms ease`,pointerEvents:kt?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...Ht}}),r.jsxs("div",{ref:st,className:`${e}-lightbox-dismiss-area`,style:Kt,...Gt,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:Vt,onClick:m=>m.stopPropagation(),children:r.jsx("div",{ref:Be,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":Ce&&t.length>0?"true":"false","data-mouse-dragging":ln?"true":"false",onPointerDown:Fr,onPointerMove:Wr,onPointerUp:ie,onPointerCancel:ie,onLostPointerCapture:We,children:r.jsx("div",{ref:Oe,className:`${e}-lightbox-strip-track`,style:{gap:E},children:tn.map((m,H)=>{const X=m.image.objectFit??"contain",$e=H%t.length,ke=Math.floor(H/t.length),Ge=Go(E),ht=`calc(-0.5 * (${Ge} + ${E}))`;return r.jsxs("div",{ref:$t=>tt.current[H]=$t,className:`${e}-strip-item`,style:{height:F==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[r.jsx("img",{src:m.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:X}}),o&&$e<t.length-1&&ke===0&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:ht,width:Ge,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${ke}-${m.image.url}-${$e}`)})})})}),r.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":Ut?"true":"false",style:xt,children:[r.jsx("div",{style:{position:"relative",width:"100%",height:K,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:Z,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${de?` ${e}-lightbox-content-area-stacked`:""}`,children:(Se||v)&&r.jsx("div",{className:`${e}-header ${de?`${e}-header-two-row`:`${e}-header-single-row`}`,children:de?It():Se||v?ft():null})})})]}),t.length>1&&R==="on"&&(()=>{const m=Go(O),H=`calc(-0.5 * (${O} + ${m}))`;return r.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:O},children:r.jsx("div",{ref:je,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:X=>X.stopPropagation(),children:r.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":I,style:{gap:j,"--thumbnail-active-color":Y},children:[t.map((X,$e)=>{const ke=Go(j),Ge=`calc(-0.5 * (${ke} + ${j}))`;return r.jsxs("div",{ref:ht=>{qe.current[$e]=ht},style:{position:"relative",flex:"0 0 auto"},children:[r.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":N===$e?"true":"false",onClick:()=>ge&&f==="click"&&wn($e),onMouseEnter:()=>Me&&f==="hover"&&wn($e),"aria-label":X.image.name?`View ${X.image.name}`:`View image ${$e+1}`,"aria-current":N===$e?"true":void 0,children:r.jsx("img",{className:`${e}-thumb-image${fe?` ${e}-thumb-image-cover`:""}`,src:X.image.url,alt:"",draggable:!1,style:{...ye,maxWidth:D,maxHeight:D,width:L.display==="cover"?"auto":"100%",height:"auto",objectFit:L.display==="cover"?"cover":"contain"}})}),o&&$e<t.length-1&&r.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Ge,width:ke,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${X.image.url}-${$e}`)}),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:m,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function zf(e){return`
|
|
12866
12866
|
.${e}-wrapper {
|
|
12867
12867
|
position: relative;
|
|
12868
12868
|
width: 100%;
|
|
@@ -13247,7 +13247,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
13247
13247
|
pointer-events: auto;
|
|
13248
13248
|
z-index: 10;
|
|
13249
13249
|
}
|
|
13250
|
-
`}const Bf=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:s})=>{const{prefix:l}=
|
|
13250
|
+
`}const Bf=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:s})=>{const{prefix:l}=x.useScopedStyles(),{cover:d,coverFit:c}=e,u=a.useRef(null),[p,w]=a.useState(!1),v=t??[],T=p&&v.length>0,g=()=>{v.length!==0&&w(!0)};return a.useEffect(()=>{!n||i||o||w(!1)},[n,i,o]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:u,className:`${l}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:zf(l)}}),d&&r.jsx("div",{className:`${l}-cover ${Fn(c)?`${l}-ratio-wrapper-cover`:`${l}-ratio-wrapper-fit`}`,onClick:()=>g(),style:{...Fn(c)?{"--image-aspect-ratio":Mr(c)}:{}},"aria-label":"Open image gallery",children:r.jsx("img",{className:`${l}-cover-image ${Fn(c)?`${l}-cover-image-cover`:`${l}-cover-image-fit`}`,src:d,alt:"cover"})})]}),T&&typeof document<"u"&&(()=>{const $=(s?document.getElementById(s):null)??document.body;return Yn.createPortal(r.jsx(jf,{prefix:l,images:v,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:()=>w(!1)}),$)})()]})},Vf=`import { useEffect, useRef, useState, type MouseEvent } from 'react';
|
|
13251
13251
|
import { createPortal } from 'react-dom';
|
|
13252
13252
|
import { CommonComponentProps } from '../props';
|
|
13253
13253
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -13793,7 +13793,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
13793
13793
|
</>
|
|
13794
13794
|
);
|
|
13795
13795
|
};
|
|
13796
|
-
`,Gf="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 qf(e){const t={};return t[Ft(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Ft(e,"fontSettings")]={...si.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Ft(e,"fontSize")]={...si.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ft(e,"lineHeight")]={...si.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ft(e,"letterSpacing")]={...si.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ft(e,"wordSpacing")]={...si.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ft(e,"textAlign")]={...si.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ft(e,"textAppearance")]={...si.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Uf=zi.reduce((e,t)=>({...e,...qf(t)}),{}),Kf=zi.reduce((e,t)=>({...e,[Ft(t,"fontFamily")]:"Goudy Bookletter 1911",[Ft(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Ft(t,"letterSpacing")]:0,[Ft(t,"wordSpacing")]:0,[Ft(t,"textAlign")]:"left",[Ft(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function ta(e){return zi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Ft(n,"fontSize")]=i),o!==void 0&&(t[Ft(n,"lineHeight")]=o),t},{})}const Xf=Hf(),Yf={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"}},...Uf,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:Gf,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...Kf},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,...ta({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,...ta({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,...ta({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:[Xf]}],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"}]}},Zf={element:Bf,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:Yf,sourceCode:Vf,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...zi.map(e=>({path:`${Ft(e,"fontFamily")}`}))]},fontRelations:{...zi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Ft(t,"fontFamily")}`}),{})}},Jf=({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:S,backgroundColor:T,imageGap:g,maxWidth:$,maxHeight:h,textTransition:I,title1Width:R,title2Width:E,title3Width:Z,title1MarginLeft:P=0,title2MarginLeft:B=0,title3MarginLeft:M=0,titleRowMarginBottom:C=0,titleHeaderLayout:W="single-row",countCloseGap:y=0,closeIcon:x,closeIconMaxWidth:A,closeIconColor:H,closeIconHoverColor:K,contentMarginTop:G=0,iconMarginRight:Y=0}=n,V=a.useCallback(oe=>v.scalingValue(oe,i??!1),[i]),D=V(g??0),O=`${$}%`,L=`${h}%`,U=V(y),J=V(G),ce=V(Y),_=ui("title1",di(n,"title1"),i),de=ui("title2",di(n,"title2"),i),w=ui("title3",di(n,"title3"),i),ge=ui("count",di(n,"count"),i),Q=W==="mobile",ve=!i||!!s,Le=!o&&(!i||!!s),pe=a.useMemo(()=>nr(t,b),[t,b]),[ae,q]=a.useState(l),se=pe[ae],he=se==null?void 0:se.entry,[Pe,Ce]=a.useState(!1),[ke,fe]=a.useState(null),[xe,Se]=a.useState(!1),[z,me]=a.useState(null),[ye,ue]=a.useState(!1),[Ee,we]=a.useState(0),[k,le]=a.useState(),[te,j]=a.useState(),[re,Ie]=a.useState(null),ie=a.useRef(null),F=a.useRef(0),He=a.useRef(0),Ne=a.useRef(0),tt=a.useRef(!1),Ke=a.useRef(null),Re=a.useRef(null),ee=a.useRef(null),ne=a.useRef(null),Me=a.useRef(null),qe=a.useRef(null),De=a.useRef(null),Oe=a.useCallback(()=>{const oe=Re.current;if(!oe)return;const _e=oe.closest(`.${e}-lightbox-content-area`);if(!_e)return oe.getBoundingClientRect().width;const m=Array.from(_e.children).reduce((N,X)=>!(X instanceof HTMLElement)||X.contains(oe)?N:N+X.getBoundingClientRect().width,0);return _e.getBoundingClientRect().width-m},[e]),Ve=a.useCallback(()=>{ie.current&&(clearTimeout(ie.current),ie.current=null)},[]),it=a.useCallback(oe=>{oe===F.current&&(me(null),ue(!1))},[]),Qe=a.useCallback(()=>{o||tt.current||(tt.current=!0,u==null||u(),Ce(!1),Ke.current=setTimeout(()=>{p()},300))},[o,u,p]),pt=a.useCallback(oe=>!!(oe.closest("[data-controls]")||oe.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:bt,backdropStyle:ot,mediaAreaStyle:ht,overlayContentStyle:Wt,swipeHandlers:dt,dismissAreaStyle:Xe}=Ic({enabled:Le,onClose:Qe,animMs:300,isBlockedTarget:pt}),ze=a.useCallback(oe=>{d&&cc(oe+1,c,!0)},[d,c]),vt=a.useCallback(oe=>{if(oe)return oe.getBoundingClientRect().height},[]),wt=a.useCallback(oe=>{if(pe.length===0)return;const _e=(oe%pe.length+pe.length)%pe.length;if(_e===ae)return;const m=pe[ae],N=pe[_e];F.current+=1;const X=F.current,$e=I==="fade"&&_s(m==null?void 0:m.entry)!==_s(N==null?void 0:N.entry),Ae=vt(ee.current),Be=$e?(()=>{const $t=Oe();Yn.flushSync(()=>{Ie(N.entry)}),ee.current&&$t&&(ee.current.style.width=`${$t}px`);const en=vt(ee.current);return ee.current&&(ee.current.style.width=""),{measuredIncomingTitlesHeight:en,incomingTitlesMeasureWidth:$t}})():void 0,gt=Math.max(Ae??0,(Be==null?void 0:Be.measuredIncomingTitlesHeight)??0)||void 0;we(X),me(ae),ue(!0),q(_e),ze(_e),Ne.current=_e,$e?(Ve(),gt&&le(gt),Be!=null&&Be.incomingTitlesMeasureWidth&&j(Be.incomingTitlesMeasureWidth),fe((m==null?void 0:m.entryIndex)??null),Se(!0),He.current=N.entryIndex,ie.current=setTimeout(()=>{fe(null),Se(!1),le(void 0),j(void 0),Ie(null),ie.current=null},400)):(Ve(),fe(null),Se(!1),le(void 0),j(void 0),Ie(null),He.current=N.entryIndex)},[ae,Ve,Oe,vt,pe,ze,I]),kt=a.useCallback(()=>{De.current=null},[]),jt=a.useCallback(oe=>{!ve||pe.length<=1||oe.pointerType==="mouse"&&oe.button!==0||oe.target.closest("[data-controls]")||(De.current={startX:oe.clientX,startY:oe.clientY,pointerId:oe.pointerId})},[ve,pe.length]),tn=a.useCallback(oe=>{var $t;if(!ve||pe.length<=1||oe.pointerType==="mouse"&&oe.button!==0)return;if(bt){kt();return}const _e=De.current;if(!_e||_e.pointerId!==oe.pointerId||(kt(),oe.target.closest("[data-controls]")))return;const N=oe.clientX-_e.startX,X=oe.clientY-_e.startY,$e=Math.abs(N),Ae=Math.abs(X);if($e>=pg&&$e>Ae){wt(N>0?ae-1:ae+1);return}if($e>Ps||Ae>Ps)return;const Be=($t=ne.current)==null?void 0:$t.getBoundingClientRect(),gt=Be?Be.left+Be.width/2:window.innerWidth/2;wt(oe.clientX<gt?ae-1:ae+1)},[ae,ve,wt,bt,kt,pe.length]),ln=a.useCallback(oe=>{const _e=De.current;(_e==null?void 0:_e.pointerId)===oe.pointerId&&kt()},[kt]);Rc(),a.useEffect(()=>{qe.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const oe=requestAnimationFrame(()=>{Ce(!0),requestAnimationFrame(()=>{Me.current?Me.current.focus():ne.current&&ne.current.focus()})});return()=>{cancelAnimationFrame(oe),Ke.current&&clearTimeout(Ke.current),ie.current&&clearTimeout(ie.current);const _e=qe.current;_e&&document.contains(_e)&&_e.focus({preventScroll:!0})}},[]),a.useEffect(()=>{var oe;I!=="fade"&&(He.current=((oe=pe[ae])==null?void 0:oe.entryIndex)??0,Ve(),fe(null),Se(!1),le(void 0),j(void 0))},[ae,Ve,pe,I]),a.useEffect(()=>{const oe=_e=>{if(_e.key==="Escape"){Qe();return}if(_e.key==="ArrowLeft"&&pe.length>1){wt(ae-1);return}if(_e.key==="ArrowRight"&&pe.length>1){wt(ae+1);return}if(_e.key==="Tab"&&ne.current){const m=ne.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),N=Array.from(m).filter(Be=>!Be.closest('[aria-hidden="true"]'));if(N.length===0)return;const X=N[0],$e=N[N.length-1],Ae=document.activeElement;_e.shiftKey?(Ae===X||!ne.current.contains(Ae))&&(_e.preventDefault(),$e.focus()):(Ae===$e||!ne.current.contains(Ae))&&(_e.preventDefault(),X.focus())}};return window.addEventListener("keydown",oe),()=>window.removeEventListener("keydown",oe)},[wt,Qe,ae,pe.length]),a.useLayoutEffect(()=>{Ve(),F.current=0,we(0),me(null),ue(!1),fe(null),Se(!1),le(void 0),j(void 0),Ie(null),q(oe=>{const _e=Math.max(0,pe.length-1);return Math.min(oe,_e)})},[Ve,t.length,b,pe.length]),a.useLayoutEffect(()=>{var m;const oe=Math.max(0,pe.length-1),_e=Math.min(Math.max(0,l),oe);Ne.current=_e,He.current=((m=pe[_e])==null?void 0:m.entryIndex)??0,q(_e)},[l]);const Tt=ke!==null?t[ke]:null,Mt=z!==null?pe[z]:null,Yt=(he==null?void 0:he.title1)||(he==null?void 0:he.title2)||(he==null?void 0:he.title3)||(Tt==null?void 0:Tt.title1)||(Tt==null?void 0:Tt.title2)||(Tt==null?void 0:Tt.title3),qt=bg(b,pe,t),Te=x!==null,Ge=Yt||qt||Te,Ue=qt&&Te?{gap:U}:void 0,lt=`${e}-titles-stack${Q?` ${e}-titles-stack-stacked`:""}`,Rt=`${e}-titles-layer-out${Q?` ${e}-titles-layer-out-stacked`:""}`,ut=`${e}-titles-layer-out`,nt=(P??0)>0||o,Ut=V(C),Ze=a.useMemo(()=>({title1Width:R??Mi.title1Width,title2Width:E??Mi.title2Width,title3Width:Z??Mi.title3Width}),[R,E,Z]),Je=a.useMemo(()=>({title2MarginLeft:B,title3MarginLeft:M}),[B,M]),at=a.useMemo(()=>he?Vn(e,he,_,de,w):[],[e,he,_,de,w]),Lt=a.useMemo(()=>at.map(oe=>Ze[oe.widthKey]),[at,Ze]),It=a.useMemo(()=>_i(at.length,Lt),[at.length,Lt]),ft=a.useMemo(()=>yo(at.length,Lt),[at.length,Lt]),At=a.useMemo(()=>at.filter(oe=>oe.prefix==="title1"),[at]),Ot=a.useMemo(()=>at.filter(oe=>oe.prefix==="title2"||oe.prefix==="title3"),[at]),Ht=a.useMemo(()=>Gn(At,Ze),[At,Ze]),Vt=a.useMemo(()=>Gn(Ot,Ze),[Ot,Ze]),xt=a.useCallback((oe,_e)=>{const m=at.findIndex(X=>X.prefix===oe.prefix);if(!Q||_e==="single-row")return{effectiveWidth:ft[m]??0,resolvedWidth:It[m]??0,maxWidth:an(m,It)};if(_e==="two-row-top"){const X=At.findIndex($e=>$e.prefix===oe.prefix);return{effectiveWidth:Ht.effective[X]??0,resolvedWidth:Ht.resolved[X]??0,maxWidth:an(X,Ht.resolved)}}const N=Ot.findIndex(X=>X.prefix===oe.prefix);return{effectiveWidth:Vt.effective[N]??0,resolvedWidth:Vt.resolved[N]??0,maxWidth:an(N,Vt.resolved)}},[at,Ot,Vt,ft,It,At,Ht,Q]),Gt=a.useCallback(oe=>mc(at,It,Je,oe)+(Q?0:P??0),[at,It,Je,Q,P]),Kt=a.useCallback(()=>Q?0:P??0,[Q,P]),Xt=a.useCallback(oe=>Ot.slice(0,oe).reduce((_e,m,N)=>_e+(m.marginLeftKey?Je[m.marginLeftKey]??0:0)+(Vt.resolved[N]??0),0),[Ot,Vt.resolved,Je]),Zt=a.useCallback(oe=>{const _e=Ot[oe];return Xt(oe)+(_e.marginLeftKey?Je[_e.marginLeftKey]??0:0)+(Vt.resolved[oe]??0)},[Ot,Vt.resolved,Xt,Je]),Dt=a.useCallback((oe,_e,m)=>{if(!Q||m==="single-row"){const Be=oe.findIndex(Jt=>Jt.prefix===_e.prefix),gt=oe.map(Jt=>Ze[Jt.widthKey]),$t=_i(oe.length,gt);return{effectiveWidth:yo(oe.length,gt)[Be]??0,resolvedWidth:$t[Be]??0,maxWidth:an(Be,$t)}}if(m==="two-row-top"){const Be=oe.filter(Jt=>Jt.prefix==="title1"),gt=Be.findIndex(Jt=>Jt.prefix===_e.prefix),{resolved:$t,effective:en}=Gn(Be,Ze);return{effectiveWidth:en[gt]??0,resolvedWidth:$t[gt]??0,maxWidth:an(gt,$t)}}const N=oe.filter(Be=>Be.prefix==="title2"||Be.prefix==="title3"),X=N.findIndex(Be=>Be.prefix===_e.prefix),{resolved:$e,effective:Ae}=Gn(N,Ze);return{effectiveWidth:Ae[X]??0,resolvedWidth:$e[X]??0,maxWidth:an(X,$e)}},[Ze,Q]),St=(oe,_e,m)=>{const N=oe.marginLeftKey?Je[oe.marginLeftKey]??0:0,{effectiveWidth:X,resolvedWidth:$e,maxWidth:Ae}=m??xt(oe,_e),Be=Math.max(N,Bn),gt=o&&_e==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":oe.prefix,style:{width:V(X),...N>0?{marginLeft:V(N)}:{}},children:[r.jsx("p",{className:oe.className,style:oe.style,children:oe.text}),gt&&oe.marginLeftKey?r.jsx("div",{"data-controls":oe.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String($e),style:{position:"absolute",top:0,left:V(-N),width:V(Be),height:"100%",pointerEvents:"auto"}}):null,gt?r.jsx("div",{"data-controls":oe.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:V(-gn/2),width:V(gn),height:"100%",pointerEvents:"auto"}}):null]},oe.className)},f=(oe="two-row")=>{const _e=at.findIndex(X=>X.prefix==="title1"),m=_e>=0?It[_e]:Ze.title1Width,N=oe==="two-row"&&o;return r.jsx("div",{...N?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(m)}:{},style:{width:V(P??0),flexShrink:0,alignSelf:"stretch",...N?{pointerEvents:"auto"}:{}}})},be=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:_,"aria-hidden":"true",children:" "}),Fe=()=>r.jsx("span",{className:`${e}-entry-counter`,style:ge,"aria-live":"polite","aria-atomic":"true",children:xg(pe,ae,b,t)}),We=()=>qt?o&&Te?r.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Fe(),r.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${qr(U)} + ${U}))`,width:qr(U),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Fe():null,st=()=>!qt&&!Te?null:r.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Ue,children:[We(),Te?mt():null]}),Pt=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[qt||Yt?be():null,nt?f("single-row"):null,Et(he),r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),st(),wn()]}),et=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[qt||Yt?be():null,nt?f("single-row"):null,r.jsxs("div",{className:`${e}-titles-row-titles`,style:xe&&k?{minHeight:k}:void 0,children:[r.jsx("div",{ref:ee,className:lt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ti(re||he)}),r.jsxs("div",{ref:Re,className:lt,style:{position:xe?"absolute":"relative",inset:xe?0:void 0,width:"100%",...xe&&te?{width:te,maxWidth:"100%"}:void 0},children:[Tt&&xe?r.jsx("div",{className:`${Rt} ${e}-titles-fade-out`,children:ti(Tt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${xe?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:ti(he)})]})]}),st(),wn()]}),mt=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:v.scalingValue(A??0,i),height:v.scalingValue(A??0,i),marginRight:ce,"--close-icon-hover-color":K},children:[r.jsx("button",{ref:Me,type:"button",className:`${e}-close-icon-inner`,onClick:Qe,"aria-label":"Close",children:r.jsx(on,{url:x??"",fill:H,hoverFill:i&&!s?H: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:ce,height:"100%",pointerEvents:"auto"}})]}),_t=(oe,_e)=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[qt||Yt?be():null,nt?f("two-row"):null,_e!==void 0?r.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:_e},children:oe}):r.jsxs(r.Fragment,{children:[oe,r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),st()]}),Et=oe=>{if(!oe)return null;const _e=Vn(e,oe,_,de,w);return r.jsx(r.Fragment,{children:_e.map(m=>St(m,"single-row",Dt(_e,m,"single-row")))})},cn=oe=>{if(!oe)return null;const _e=Vn(e,oe,_,de,w),m=_e.find(N=>N.prefix==="title1");return m?St(m,"two-row-top",Dt(_e,m,"two-row-top")):null},dn=(oe,_e=!1)=>{const m=oe?Vn(e,oe,_,de,w):[],N=m.filter(Ae=>Ae.prefix==="title2"||Ae.prefix==="title3"),X=o&&_e;return N.length>0||X||(C??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[N.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[N.map(Ae=>St(Ae,"two-row-bottom",Dt(m,Ae,"two-row-bottom"))),_e&&o?r.jsxs(r.Fragment,{children:[Pr(),Ar()]}):null]}):null,(C??0)>0||X?r.jsx("div",{"data-controls":X?"titleRowMarginBottom":void 0,"data-controls-axis":X?"y":void 0,"data-controls-reverse":X?"":void 0,className:X?`${e}-control`:void 0,style:{height:Ut,width:"100%",flexShrink:0,pointerEvents:X?"auto":"none"}}):null]}):null},ei=(oe,_e=!1)=>r.jsxs(r.Fragment,{children:[_t(cn(oe)),dn(oe,_e)]}),ti=oe=>Q?r.jsx("div",{className:`${e}-titles-row-two-row`,children:ei(oe)}):oe?r.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:Et(oe)}):null,Mo=()=>{const oe=Q?-1:at.findIndex(N=>N.prefix==="title1"),_e=!Q&&(o||(P??0)>0)?(()=>{const N=P??0,X=oe>=0?It[oe]:Ze.title1Width,$e=Math.max(N,Bn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(X),style:{position:"absolute",top:0,left:0,width:V($e),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,m=at.flatMap((N,X)=>{if(!N.marginLeftKey)return[];const $e=Je[N.marginLeftKey]??0,Ae=pc(at,It,Je,X)+Kt(),Be=Math.max($e,Bn);return r.jsx("div",{"data-controls":N.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(It[X]),style:{position:"absolute",top:0,left:V(Ae),width:V(Be),height:"100%",pointerEvents:"auto"}},N.marginLeftKey)});return _e?[_e,...m]:m},ko=()=>at.map((oe,_e)=>{const m=an(_e,It),X=Gt(_e)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":oe.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(m),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:V(X),width:V(gn),height:"100%",pointerEvents:"auto"}})},`${oe.widthKey}-junction`)}),Pr=()=>Ot.flatMap((oe,_e)=>{if(!oe.marginLeftKey)return[];const m=Je[oe.marginLeftKey]??0,N=Xt(_e),X=Math.max(m,Bn),{resolvedWidth:$e}=xt(oe,"two-row-bottom");return r.jsx("div",{"data-controls":oe.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String($e),style:{position:"absolute",top:0,left:V(N),width:V(X),height:"100%",pointerEvents:"auto"}},oe.marginLeftKey)}),Ar=()=>Ot.map((oe,_e)=>{const{maxWidth:m}=xt(oe,"two-row-bottom"),X=Zt(_e)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":oe.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(m),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:V(X),width:V(gn),height:"100%",pointerEvents:"auto"}})},`${oe.widthKey}-junction`)}),wn=()=>!o||Q?null:r.jsxs(r.Fragment,{children:[Mo(),ko()]}),yi=oe=>{const _e=!oe.objectFit&&Fn(S);return{className:`${e}-slide-image-cell${_e?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:O,maxHeight:L,..._e?{"--image-aspect-ratio":Mr(S)}:{}}}},Po=oe=>oe.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":oe.objectFit}}:Fn(S)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},ni=oe=>{if(oe.length===0)return null;const _e=oe.length>1,m=qr(D),N=`calc(-0.5 * (${m} + ${D}))`;if(oe.length===1){const X=oe[0];return r.jsx("div",{...yi(X),children:r.jsx("img",{...Po(X),src:X.url,alt:X.name??"",draggable:!1})})}return r.jsx("div",{className:`${e}-slide-inner`,style:_e?{gap:D}:void 0,children:oe.map((X,$e)=>r.jsxs("div",{...yi(X),children:[r.jsx("img",{...Po(X),src:X.url,alt:X.name??"",draggable:!1}),o&&_e&&$e<oe.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:N,width:m,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${X.url}-${$e}`))})},Ao=!!(he!=null&&he.title2||he!=null&&he.title3||Tt!=null&&Tt.title2||Tt!=null&&Tt.title3||(C??0)>0||o),Fr=()=>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:ee,className:lt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ei(re||he)}),r.jsxs("div",{ref:Re,className:`${e}-titles-row-two-row`,style:{...xe&&k?{minHeight:k}:void 0,...xe&&te?{width:te,maxWidth:"100%"}:void 0},children:[_t(r.jsxs("div",{className:lt,style:{position:xe?"absolute":"relative",inset:xe?0:void 0,width:"100%"},children:[Tt&&xe?r.jsx("div",{className:`${ut} ${e}-titles-fade-out`,children:cn(Tt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${xe?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:cn(he)})]}),xe&&k?k:void 0),Ao?r.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[Tt&&xe?r.jsx("div",{className:`${Rt} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:dn(Tt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${xe?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${Q?` ${e}-titles-layer-in-stacked`:""}`,children:dn(he,!0)})]}):null]})]}),Wr=()=>{const oe=Ao;return r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...oe?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:oe?void 0:{flex:"0 0 auto",height:"auto"},children:ei(he,!0)}),wn()]})};return r.jsxs("div",{ref:ne,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{bt||Qe()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:Te?void 0:-1,style:{opacity:Pe?1:0,transition:"opacity 300ms ease",pointerEvents:Pe?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:T,...ot}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:Xe,...dt,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:ht,onClick:oe=>oe.stopPropagation(),children:r.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":ve&&pe.length>1?"true":"false",onPointerDown:ve?jt:void 0,onPointerUp:ve?tn:void 0,onPointerCancel:ve?ln:void 0,children:r.jsxs("div",{className:`${e}-slide-stack`,children:[Mt&&ye?r.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:oe=>{oe.target===oe.currentTarget&&it(Ee)},children:r.jsx("div",{className:`${e}-slide-area`,children:ni(Mt.images)})},`slide-out-${Ee}`):null,r.jsx("div",{className:`${e}-slide-layer-in${ye?` ${e}-slide-fade-in`:""}`,children:r.jsx("div",{className:`${e}-slide-area`,children:se?ni(se.images):null})},`slide-in-${Ee}-${ae}`)]})})}),r.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Wt,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:J,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...Q?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${Q?` ${e}-lightbox-content-area-stacked`:""}`,children:Ge&&r.jsx("div",{className:`${e}-text-bar-cell${Q?` ${e}-text-bar-cell-stacked`:""}`,style:Q?void 0:{flex:1,minWidth:0,width:"100%"},children:Q?I==="fade"?Fr():Wr():I==="fade"?et():Pt()})})})]})]})]})};function Qf(e){return`
|
|
13796
|
+
`,Gf="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 qf(e){const t={};return t[Wt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Wt(e,"fontSettings")]={...si.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Wt(e,"fontSize")]={...si.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Wt(e,"lineHeight")]={...si.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Wt(e,"letterSpacing")]={...si.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Wt(e,"wordSpacing")]={...si.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Wt(e,"textAlign")]={...si.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Wt(e,"textAppearance")]={...si.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Uf=zi.reduce((e,t)=>({...e,...qf(t)}),{}),Kf=zi.reduce((e,t)=>({...e,[Wt(t,"fontFamily")]:"Goudy Bookletter 1911",[Wt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Wt(t,"letterSpacing")]:0,[Wt(t,"wordSpacing")]:0,[Wt(t,"textAlign")]:"left",[Wt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function ta(e){return zi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Wt(n,"fontSize")]=i),o!==void 0&&(t[Wt(n,"lineHeight")]=o),t},{})}const Xf=Hf(),Yf={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"}},...Uf,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:Gf,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...Kf},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,...ta({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,...ta({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,...ta({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:[Xf]}],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"}]}},Zf={element:Bf,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:Yf,sourceCode:Vf,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...zi.map(e=>({path:`${Wt(e,"fontFamily")}`}))]},fontRelations:{...zi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Wt(t,"fontFamily")}`}),{})}},Jf=({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:w,coverFit:v,backgroundColor:T,imageGap:g,maxWidth:$,maxHeight:f,textTransition:R,title1Width:L,title2Width:I,title3Width:Y,title1MarginLeft:P=0,title2MarginLeft:V=0,title3MarginLeft:M=0,titleRowMarginBottom:C=0,titleHeaderLayout:A="single-row",countCloseGap:y=0,closeIcon:S,closeIconMaxWidth:F,closeIconColor:W,closeIconHoverColor:U,contentMarginTop:G=0,iconMarginRight:J=0}=n,D=a.useCallback(ie=>x.scalingValue(ie,i??!1),[i]),j=D(g??0),O=`${$}%`,E=`${f}%`,K=D(y),Z=D(G),ce=D(J),N=ui("title1",di(n,"title1"),i),pe=ui("title2",di(n,"title2"),i),b=ui("title3",di(n,"title3"),i),he=ui("count",di(n,"count"),i),Q=A==="mobile",we=!i||!!s,Te=!o&&(!i||!!s),se=a.useMemo(()=>nr(t,w),[t,w]),[oe,q]=a.useState(l),de=se[oe],ge=de==null?void 0:de.entry,[_e,Ce]=a.useState(!1),[Me,fe]=a.useState(null),[ye,Se]=a.useState(!1),[B,ue]=a.useState(null),[ve,me]=a.useState(!1),[Ee,be]=a.useState(0),[k,re]=a.useState(),[te,z]=a.useState(),[le,Re]=a.useState(null),ae=a.useRef(null),_=a.useRef(0),Ne=a.useRef(0),Fe=a.useRef(0),et=a.useRef(!1),Ke=a.useRef(null),Ie=a.useRef(null),ee=a.useRef(null),ne=a.useRef(null),He=a.useRef(null),st=a.useRef(null),Be=a.useRef(null),Oe=a.useCallback(()=>{const ie=Ie.current;if(!ie)return;const We=ie.closest(`.${e}-lightbox-content-area`);if(!We)return ie.getBoundingClientRect().width;const m=Array.from(We.children).reduce((H,X)=>!(X instanceof HTMLElement)||X.contains(ie)?H:H+X.getBoundingClientRect().width,0);return We.getBoundingClientRect().width-m},[e]),je=a.useCallback(()=>{ae.current&&(clearTimeout(ae.current),ae.current=null)},[]),qe=a.useCallback(ie=>{ie===_.current&&(ue(null),me(!1))},[]),tt=a.useCallback(()=>{o||et.current||(et.current=!0,u==null||u(),Ce(!1),Ke.current=setTimeout(()=>{p()},300))},[o,u,p]),mt=a.useCallback(ie=>!!(ie.closest("[data-controls]")||ie.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:St,backdropStyle:lt,mediaAreaStyle:pt,overlayContentStyle:Mt,swipeHandlers:nt,dismissAreaStyle:Ve}=Ic({enabled:Te,onClose:tt,animMs:300,isBlockedTarget:mt}),De=a.useCallback(ie=>{d&&cc(ie+1,c,!0)},[d,c]),vt=a.useCallback(ie=>{if(ie)return ie.getBoundingClientRect().height},[]),bt=a.useCallback(ie=>{if(se.length===0)return;const We=(ie%se.length+se.length)%se.length;if(We===oe)return;const m=se[oe],H=se[We];_.current+=1;const X=_.current,$e=R==="fade"&&Ns(m==null?void 0:m.entry)!==Ns(H==null?void 0:H.entry),ke=vt(ee.current),Ge=$e?(()=>{const $t=Oe();Yn.flushSync(()=>{Re(H.entry)}),ee.current&&$t&&(ee.current.style.width=`${$t}px`);const en=vt(ee.current);return ee.current&&(ee.current.style.width=""),{measuredIncomingTitlesHeight:en,incomingTitlesMeasureWidth:$t}})():void 0,ht=Math.max(ke??0,(Ge==null?void 0:Ge.measuredIncomingTitlesHeight)??0)||void 0;be(X),ue(oe),me(!0),q(We),De(We),Fe.current=We,$e?(je(),ht&&re(ht),Ge!=null&&Ge.incomingTitlesMeasureWidth&&z(Ge.incomingTitlesMeasureWidth),fe((m==null?void 0:m.entryIndex)??null),Se(!0),Ne.current=H.entryIndex,ae.current=setTimeout(()=>{fe(null),Se(!1),re(void 0),z(void 0),Re(null),ae.current=null},400)):(je(),fe(null),Se(!1),re(void 0),z(void 0),Re(null),Ne.current=H.entryIndex)},[oe,je,Oe,vt,se,De,R]),Pt=a.useCallback(()=>{Be.current=null},[]),Dt=a.useCallback(ie=>{!we||se.length<=1||ie.pointerType==="mouse"&&ie.button!==0||ie.target.closest("[data-controls]")||(Be.current={startX:ie.clientX,startY:ie.clientY,pointerId:ie.pointerId})},[we,se.length]),tn=a.useCallback(ie=>{var $t;if(!we||se.length<=1||ie.pointerType==="mouse"&&ie.button!==0)return;if(St){Pt();return}const We=Be.current;if(!We||We.pointerId!==ie.pointerId||(Pt(),ie.target.closest("[data-controls]")))return;const H=ie.clientX-We.startX,X=ie.clientY-We.startY,$e=Math.abs(H),ke=Math.abs(X);if($e>=pg&&$e>ke){bt(H>0?oe-1:oe+1);return}if($e>As||ke>As)return;const Ge=($t=ne.current)==null?void 0:$t.getBoundingClientRect(),ht=Ge?Ge.left+Ge.width/2:window.innerWidth/2;bt(ie.clientX<ht?oe-1:oe+1)},[oe,we,bt,St,Pt,se.length]),ln=a.useCallback(ie=>{const We=Be.current;(We==null?void 0:We.pointerId)===ie.pointerId&&Pt()},[Pt]);Rc(),a.useEffect(()=>{st.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const ie=requestAnimationFrame(()=>{Ce(!0),requestAnimationFrame(()=>{He.current?He.current.focus():ne.current&&ne.current.focus()})});return()=>{cancelAnimationFrame(ie),Ke.current&&clearTimeout(Ke.current),ae.current&&clearTimeout(ae.current);const We=st.current;We&&document.contains(We)&&We.focus({preventScroll:!0})}},[]),a.useEffect(()=>{var ie;R!=="fade"&&(Ne.current=((ie=se[oe])==null?void 0:ie.entryIndex)??0,je(),fe(null),Se(!1),re(void 0),z(void 0))},[oe,je,se,R]),a.useEffect(()=>{const ie=We=>{if(We.key==="Escape"){tt();return}if(We.key==="ArrowLeft"&&se.length>1){bt(oe-1);return}if(We.key==="ArrowRight"&&se.length>1){bt(oe+1);return}if(We.key==="Tab"&&ne.current){const m=ne.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),H=Array.from(m).filter(Ge=>!Ge.closest('[aria-hidden="true"]'));if(H.length===0)return;const X=H[0],$e=H[H.length-1],ke=document.activeElement;We.shiftKey?(ke===X||!ne.current.contains(ke))&&(We.preventDefault(),$e.focus()):(ke===$e||!ne.current.contains(ke))&&(We.preventDefault(),X.focus())}};return window.addEventListener("keydown",ie),()=>window.removeEventListener("keydown",ie)},[bt,tt,oe,se.length]),a.useLayoutEffect(()=>{je(),_.current=0,be(0),ue(null),me(!1),fe(null),Se(!1),re(void 0),z(void 0),Re(null),q(ie=>{const We=Math.max(0,se.length-1);return Math.min(ie,We)})},[je,t.length,w,se.length]),a.useLayoutEffect(()=>{var m;const ie=Math.max(0,se.length-1),We=Math.min(Math.max(0,l),ie);Fe.current=We,Ne.current=((m=se[We])==null?void 0:m.entryIndex)??0,q(We)},[l]);const Tt=Me!==null?t[Me]:null,kt=B!==null?se[B]:null,Yt=(ge==null?void 0:ge.title1)||(ge==null?void 0:ge.title2)||(ge==null?void 0:ge.title3)||(Tt==null?void 0:Tt.title1)||(Tt==null?void 0:Tt.title2)||(Tt==null?void 0:Tt.title3),qt=bg(w,se,t),Le=S!==null,Ue=Yt||qt||Le,Xe=qt&&Le?{gap:K}:void 0,ct=`${e}-titles-stack${Q?` ${e}-titles-stack-stacked`:""}`,Rt=`${e}-titles-layer-out${Q?` ${e}-titles-layer-out-stacked`:""}`,ut=`${e}-titles-layer-out`,it=(P??0)>0||o,Ut=D(C),Ze=a.useMemo(()=>({title1Width:L??Mi.title1Width,title2Width:I??Mi.title2Width,title3Width:Y??Mi.title3Width}),[L,I,Y]),Je=a.useMemo(()=>({title2MarginLeft:V,title3MarginLeft:M}),[V,M]),rt=a.useMemo(()=>ge?Vn(e,ge,N,pe,b):[],[e,ge,N,pe,b]),Lt=a.useMemo(()=>rt.map(ie=>Ze[ie.widthKey]),[rt,Ze]),It=a.useMemo(()=>_i(rt.length,Lt),[rt.length,Lt]),ft=a.useMemo(()=>yo(rt.length,Lt),[rt.length,Lt]),Ft=a.useMemo(()=>rt.filter(ie=>ie.prefix==="title1"),[rt]),Ot=a.useMemo(()=>rt.filter(ie=>ie.prefix==="title2"||ie.prefix==="title3"),[rt]),Ht=a.useMemo(()=>Gn(Ft,Ze),[Ft,Ze]),Vt=a.useMemo(()=>Gn(Ot,Ze),[Ot,Ze]),xt=a.useCallback((ie,We)=>{const m=rt.findIndex(X=>X.prefix===ie.prefix);if(!Q||We==="single-row")return{effectiveWidth:ft[m]??0,resolvedWidth:It[m]??0,maxWidth:an(m,It)};if(We==="two-row-top"){const X=Ft.findIndex($e=>$e.prefix===ie.prefix);return{effectiveWidth:Ht.effective[X]??0,resolvedWidth:Ht.resolved[X]??0,maxWidth:an(X,Ht.resolved)}}const H=Ot.findIndex(X=>X.prefix===ie.prefix);return{effectiveWidth:Vt.effective[H]??0,resolvedWidth:Vt.resolved[H]??0,maxWidth:an(H,Vt.resolved)}},[rt,Ot,Vt,ft,It,Ft,Ht,Q]),Gt=a.useCallback(ie=>mc(rt,It,Je,ie)+(Q?0:P??0),[rt,It,Je,Q,P]),Kt=a.useCallback(()=>Q?0:P??0,[Q,P]),Xt=a.useCallback(ie=>Ot.slice(0,ie).reduce((We,m,H)=>We+(m.marginLeftKey?Je[m.marginLeftKey]??0:0)+(Vt.resolved[H]??0),0),[Ot,Vt.resolved,Je]),Zt=a.useCallback(ie=>{const We=Ot[ie];return Xt(ie)+(We.marginLeftKey?Je[We.marginLeftKey]??0:0)+(Vt.resolved[ie]??0)},[Ot,Vt.resolved,Xt,Je]),jt=a.useCallback((ie,We,m)=>{if(!Q||m==="single-row"){const Ge=ie.findIndex(Jt=>Jt.prefix===We.prefix),ht=ie.map(Jt=>Ze[Jt.widthKey]),$t=_i(ie.length,ht);return{effectiveWidth:yo(ie.length,ht)[Ge]??0,resolvedWidth:$t[Ge]??0,maxWidth:an(Ge,$t)}}if(m==="two-row-top"){const Ge=ie.filter(Jt=>Jt.prefix==="title1"),ht=Ge.findIndex(Jt=>Jt.prefix===We.prefix),{resolved:$t,effective:en}=Gn(Ge,Ze);return{effectiveWidth:en[ht]??0,resolvedWidth:$t[ht]??0,maxWidth:an(ht,$t)}}const H=ie.filter(Ge=>Ge.prefix==="title2"||Ge.prefix==="title3"),X=H.findIndex(Ge=>Ge.prefix===We.prefix),{resolved:$e,effective:ke}=Gn(H,Ze);return{effectiveWidth:ke[X]??0,resolvedWidth:$e[X]??0,maxWidth:an(X,$e)}},[Ze,Q]),wt=(ie,We,m)=>{const H=ie.marginLeftKey?Je[ie.marginLeftKey]??0:0,{effectiveWidth:X,resolvedWidth:$e,maxWidth:ke}=m??xt(ie,We),Ge=Math.max(H,Bn),ht=o&&We==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":ie.prefix,style:{width:D(X),...H>0?{marginLeft:D(H)}:{}},children:[r.jsx("p",{className:ie.className,style:ie.style,children:ie.text}),ht&&ie.marginLeftKey?r.jsx("div",{"data-controls":ie.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String($e),style:{position:"absolute",top:0,left:D(-H),width:D(Ge),height:"100%",pointerEvents:"auto"}}):null,ht?r.jsx("div",{"data-controls":ie.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ke),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:D(-gn/2),width:D(gn),height:"100%",pointerEvents:"auto"}}):null]},ie.className)},h=(ie="two-row")=>{const We=rt.findIndex(X=>X.prefix==="title1"),m=We>=0?It[We]:Ze.title1Width,H=ie==="two-row"&&o;return r.jsx("div",{...H?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(m)}:{},style:{width:D(P??0),flexShrink:0,alignSelf:"stretch",...H?{pointerEvents:"auto"}:{}}})},xe=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:N,"aria-hidden":"true",children:" "}),Pe=()=>r.jsx("span",{className:`${e}-entry-counter`,style:he,"aria-live":"polite","aria-atomic":"true",children:xg(se,oe,w,t)}),Ae=()=>qt?o&&Le?r.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Pe(),r.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${qr(K)} + ${K}))`,width:qr(K),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Pe():null,at=()=>!qt&&!Le?null:r.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Xe,children:[Ae(),Le?gt():null]}),At=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[qt||Yt?xe():null,it?h("single-row"):null,Et(ge),r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),at(),wn()]}),Qe=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[qt||Yt?xe():null,it?h("single-row"):null,r.jsxs("div",{className:`${e}-titles-row-titles`,style:ye&&k?{minHeight:k}:void 0,children:[r.jsx("div",{ref:ee,className:ct,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ti(le||ge)}),r.jsxs("div",{ref:Ie,className:ct,style:{position:ye?"absolute":"relative",inset:ye?0:void 0,width:"100%",...ye&&te?{width:te,maxWidth:"100%"}:void 0},children:[Tt&&ye?r.jsx("div",{className:`${Rt} ${e}-titles-fade-out`,children:ti(Tt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${ye?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:ti(ge)})]})]}),at(),wn()]}),gt=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:x.scalingValue(F??0,i),height:x.scalingValue(F??0,i),marginRight:ce,"--close-icon-hover-color":U},children:[r.jsx("button",{ref:He,type:"button",className:`${e}-close-icon-inner`,onClick:tt,"aria-label":"Close",children:r.jsx(on,{url:S??"",fill:W,hoverFill:i&&!s?W:U,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:ce,height:"100%",pointerEvents:"auto"}})]}),_t=(ie,We)=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[qt||Yt?xe():null,it?h("two-row"):null,We!==void 0?r.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:We},children:ie}):r.jsxs(r.Fragment,{children:[ie,r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),at()]}),Et=ie=>{if(!ie)return null;const We=Vn(e,ie,N,pe,b);return r.jsx(r.Fragment,{children:We.map(m=>wt(m,"single-row",jt(We,m,"single-row")))})},cn=ie=>{if(!ie)return null;const We=Vn(e,ie,N,pe,b),m=We.find(H=>H.prefix==="title1");return m?wt(m,"two-row-top",jt(We,m,"two-row-top")):null},dn=(ie,We=!1)=>{const m=ie?Vn(e,ie,N,pe,b):[],H=m.filter(ke=>ke.prefix==="title2"||ke.prefix==="title3"),X=o&&We;return H.length>0||X||(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(ke=>wt(ke,"two-row-bottom",jt(m,ke,"two-row-bottom"))),We&&o?r.jsxs(r.Fragment,{children:[Pr(),Ar()]}):null]}):null,(C??0)>0||X?r.jsx("div",{"data-controls":X?"titleRowMarginBottom":void 0,"data-controls-axis":X?"y":void 0,"data-controls-reverse":X?"":void 0,className:X?`${e}-control`:void 0,style:{height:Ut,width:"100%",flexShrink:0,pointerEvents:X?"auto":"none"}}):null]}):null},ei=(ie,We=!1)=>r.jsxs(r.Fragment,{children:[_t(cn(ie)),dn(ie,We)]}),ti=ie=>Q?r.jsx("div",{className:`${e}-titles-row-two-row`,children:ei(ie)}):ie?r.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:Et(ie)}):null,Mo=()=>{const ie=Q?-1:rt.findIndex(H=>H.prefix==="title1"),We=!Q&&(o||(P??0)>0)?(()=>{const H=P??0,X=ie>=0?It[ie]:Ze.title1Width,$e=Math.max(H,Bn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(X),style:{position:"absolute",top:0,left:0,width:D($e),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,m=rt.flatMap((H,X)=>{if(!H.marginLeftKey)return[];const $e=Je[H.marginLeftKey]??0,ke=pc(rt,It,Je,X)+Kt(),Ge=Math.max($e,Bn);return r.jsx("div",{"data-controls":H.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(It[X]),style:{position:"absolute",top:0,left:D(ke),width:D(Ge),height:"100%",pointerEvents:"auto"}},H.marginLeftKey)});return We?[We,...m]:m},ko=()=>rt.map((ie,We)=>{const m=an(We,It),X=Gt(We)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":ie.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(m),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:D(X),width:D(gn),height:"100%",pointerEvents:"auto"}})},`${ie.widthKey}-junction`)}),Pr=()=>Ot.flatMap((ie,We)=>{if(!ie.marginLeftKey)return[];const m=Je[ie.marginLeftKey]??0,H=Xt(We),X=Math.max(m,Bn),{resolvedWidth:$e}=xt(ie,"two-row-bottom");return r.jsx("div",{"data-controls":ie.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String($e),style:{position:"absolute",top:0,left:D(H),width:D(X),height:"100%",pointerEvents:"auto"}},ie.marginLeftKey)}),Ar=()=>Ot.map((ie,We)=>{const{maxWidth:m}=xt(ie,"two-row-bottom"),X=Zt(We)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":ie.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(m),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:D(X),width:D(gn),height:"100%",pointerEvents:"auto"}})},`${ie.widthKey}-junction`)}),wn=()=>!o||Q?null:r.jsxs(r.Fragment,{children:[Mo(),ko()]}),yi=ie=>{const We=!ie.objectFit&&Fn(v);return{className:`${e}-slide-image-cell${We?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:O,maxHeight:E,...We?{"--image-aspect-ratio":Mr(v)}:{}}}},Po=ie=>ie.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":ie.objectFit}}:Fn(v)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},ni=ie=>{if(ie.length===0)return null;const We=ie.length>1,m=qr(j),H=`calc(-0.5 * (${m} + ${j}))`;if(ie.length===1){const X=ie[0];return r.jsx("div",{...yi(X),children:r.jsx("img",{...Po(X),src:X.url,alt:X.name??"",draggable:!1})})}return r.jsx("div",{className:`${e}-slide-inner`,style:We?{gap:j}:void 0,children:ie.map((X,$e)=>r.jsxs("div",{...yi(X),children:[r.jsx("img",{...Po(X),src:X.url,alt:X.name??"",draggable:!1}),o&&We&&$e<ie.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:H,width:m,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${X.url}-${$e}`))})},Ao=!!(ge!=null&&ge.title2||ge!=null&&ge.title3||Tt!=null&&Tt.title2||Tt!=null&&Tt.title3||(C??0)>0||o),Fr=()=>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:ee,className:ct,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ei(le||ge)}),r.jsxs("div",{ref:Ie,className:`${e}-titles-row-two-row`,style:{...ye&&k?{minHeight:k}:void 0,...ye&&te?{width:te,maxWidth:"100%"}:void 0},children:[_t(r.jsxs("div",{className:ct,style:{position:ye?"absolute":"relative",inset:ye?0:void 0,width:"100%"},children:[Tt&&ye?r.jsx("div",{className:`${ut} ${e}-titles-fade-out`,children:cn(Tt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${ye?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:cn(ge)})]}),ye&&k?k:void 0),Ao?r.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[Tt&&ye?r.jsx("div",{className:`${Rt} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:dn(Tt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${ye?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${Q?` ${e}-titles-layer-in-stacked`:""}`,children:dn(ge,!0)})]}):null]})]}),Wr=()=>{const ie=Ao;return r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...ie?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:ie?void 0:{flex:"0 0 auto",height:"auto"},children:ei(ge,!0)}),wn()]})};return r.jsxs("div",{ref:ne,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{St||tt()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:Le?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:T,...lt}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:Ve,...nt,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:pt,onClick:ie=>ie.stopPropagation(),children:r.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":we&&se.length>1?"true":"false",onPointerDown:we?Dt:void 0,onPointerUp:we?tn:void 0,onPointerCancel:we?ln:void 0,children:r.jsxs("div",{className:`${e}-slide-stack`,children:[kt&&ve?r.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:ie=>{ie.target===ie.currentTarget&&qe(Ee)},children:r.jsx("div",{className:`${e}-slide-area`,children:ni(kt.images)})},`slide-out-${Ee}`):null,r.jsx("div",{className:`${e}-slide-layer-in${ve?` ${e}-slide-fade-in`:""}`,children:r.jsx("div",{className:`${e}-slide-area`,children:de?ni(de.images):null})},`slide-in-${Ee}-${oe}`)]})})}),r.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Mt,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:Z,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...Q?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${Q?` ${e}-lightbox-content-area-stacked`:""}`,children:Ue&&r.jsx("div",{className:`${e}-text-bar-cell${Q?` ${e}-text-bar-cell-stacked`:""}`,style:Q?void 0:{flex:1,minWidth:0,width:"100%"},children:Q?R==="fade"?Fr():Wr():R==="fade"?Qe():At()})})})]})]})]})};function Qf(e){return`
|
|
13797
13797
|
.${e}-wrapper {
|
|
13798
13798
|
position: relative;
|
|
13799
13799
|
width: 100%;
|
|
@@ -14315,7 +14315,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
14315
14315
|
pointer-events: auto;
|
|
14316
14316
|
z-index: 10;
|
|
14317
14317
|
}
|
|
14318
|
-
`}const ey=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:s,metadata:l})=>{const{prefix:d}=
|
|
14318
|
+
`}const ey=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:s,metadata:l})=>{const{prefix:d}=x.useScopedStyles(),c=(l==null?void 0:l.itemId)??null,{cover:u,coverFit:p,type:w}=e,v=a.useRef(null),[T,g]=a.useState(!1),[$,f]=a.useState(0),R=a.useRef(!1),L=a.useRef(!1),I=a.useRef(!1),Y=a.useMemo(()=>(t??[]).filter(y=>Wi(y).length>0),[t]),P=T&&Y.length>0,V=!n,M=a.useCallback(()=>{V&&(I.current=!0,gg(L.current,c),L.current=!1)},[V,c]),C=(y=0)=>{if(Y.length===0||n&&!i&&!o)return;const S=nr(Y,w),F=Math.max(0,Math.min(y,S.length-1));if(f(F),V){const W=dc();cc(F+1,c,W),L.current=!W}g(!0)},A=a.useCallback(()=>{g(!1),I.current=!1},[]);return a.useEffect(()=>{!n||i||o||g(!1)},[n,i,o]),a.useEffect(()=>{if(!V||R.current)return;R.current=!0;const y=Ws(c);if(!y)return;const S=_s(y,nr(Y,w).length);S<0||(f(S),g(!0))},[Y,c,V,w]),a.useEffect(()=>{if(!V)return;const y=()=>{if(I.current){I.current=!1,g(!1);return}const S=Ws(c);if(!S){g(!1);return}const F=_s(S,nr(Y,w).length);if(F<0){g(!1);return}L.current=!1,f(F),g(!0)};return window.addEventListener("popstate",y),()=>window.removeEventListener("popstate",y)},[Y,c,V,w]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:v,className:`${d}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Qf(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":Mr(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]}),P&&typeof document<"u"&&(()=>{const y=(s?document.getElementById(s):null)??document.body;return Yn.createPortal(r.jsx(Jf,{prefix:d,entries:Y,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:$,enableUrlSync:V,journalItemId:c,onBeforeClose:M,onClose:A}),y)})()]})},ty=`import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
|
|
14319
14319
|
import { createPortal } from 'react-dom';
|
|
14320
14320
|
import { CommonComponentProps } from '../props';
|
|
14321
14321
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -15071,7 +15071,7 @@ export type LightboxJournalSettings = {
|
|
|
15071
15071
|
closeIconColor: string;
|
|
15072
15072
|
closeIconHoverColor: string;
|
|
15073
15073
|
};
|
|
15074
|
-
`,ny="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>'),li={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 iy(e){const t={};return t[Ye(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Ye(e,"fontSettings")]={...li.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Ye(e,"fontSize")]={...li.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ye(e,"lineHeight")]={...li.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ye(e,"letterSpacing")]={...li.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ye(e,"wordSpacing")]={...li.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ye(e,"textAlign")]={...li.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ye(e,"textAppearance")]={...li.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const oy=Kn.reduce((e,t)=>({...e,...iy(t)}),{}),ry=Kn.reduce((e,t)=>({...e,[Ye(t,"fontFamily")]:"Goudy Bookletter 1911",[Ye(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Ye(t,"letterSpacing")]:0,[Ye(t,"wordSpacing")]:0,[Ye(t,"textAlign")]:"left",[Ye(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function na(e){return Kn.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Ye(n,"fontSize")]=i),o!==void 0&&(t[Ye(n,"lineHeight")]=o),t},{})}const ay=wg(),sy={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"}}},type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["A","B"]},maxHeight:{type:"number",scope:"layout",title:"Max Height (%)",min:0,max:100,display:{type:"percentage-input"}},maxWidth:{type:"number",scope:"layout",title:"Max Width (%)",min:0,max:100,display:{type:"percentage-input"}},imageGap:{type:"number",scope:"layout",title:"Image Gap",min:0,display:{type:"range-control",visible:!1}},backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"settings-color-picker"}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},textTransition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["none","fade"]}},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"]}},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"}},countCloseGap:{type:"number",scope:"layout",title:"Count / Close Gap",min:0,display:{type:"range-control"}},title1Color:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},countColor:{type:"string",scope:"common",title:"Count Default",display:{type:"palette-color-picker"}},...oy,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",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:ny,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#000000",...ry,countFontFamily:"Arial"},layoutDefaults:{m:{type:"B",imageGap:.01,maxHeight:80,maxWidth:80,closeIconMaxWidth:.08,contentMarginTop:.04,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.55,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,iconMarginRight:.01,countCloseGap:.04,...na({title1FontSize:.04,title1LineHeight:.04,title2FontSize:.04,title2LineHeight:.04,title3FontSize:.04,title3LineHeight:.04,countFontSize:.04,countLineHeight:.04})},t:{type:"A",imageGap:.05,maxHeight:80,maxWidth:40,closeIconMaxWidth:.03,contentMarginTop:.01,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.16,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,iconMarginRight:.01,countCloseGap:.03,...na({title1FontSize:.0208,title1LineHeight:.0208,title2FontSize:.0208,title2LineHeight:.0208,title3FontSize:.0208,title3LineHeight:.0208,countFontSize:.0208,countLineHeight:.0208})},d:{type:"A",maxHeight:80,maxWidth:40,imageGap:.05,closeIconMaxWidth:.0125,contentMarginTop:.01,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,iconMarginRight:.01,countCloseGap:.02,...na({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098,countFontSize:.008,countLineHeight:.0098})}},layout:["__componentName__","maxWidth","maxHeight","imageGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","countCloseGap","contentMarginTop","iconMarginRight"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["type"]},{type:"row",title:"Image",items:["maxWidth","maxHeight"]},{type:"row",title:"Text",items:["textTransition"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]},{type:"row",title:"Cover Image",items:["cover","coverFit"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[ay]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","countColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemWithoutImage:!0},items:{type:"object",properties:{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"}},image:{type:"object",label:"Image",max:2,display:{type:"media-list-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]}}},default:[{title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"contain"},{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"},{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"}]}]}},ly={element:ey,id:"lightbox-journal",name:"Journal",category:"galleries",version:1,defaultSize:{d:{width:350},t:{width:300},m:{width:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Journal.png"},schema:sy,sourceCode:ty,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Kn.map(e=>({path:`${Ye(e,"fontFamily")}`}))]},fontRelations:{...Kn.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Ye(t,"fontFamily")}`}),{})}},cy={sizeType:"custom",value:700,min:400,max:700};function mr(e,t){return{widthPx:e,heightPx:e*t}}function Sa(e,t,n,i,o,s){return{x:Math.min(Math.max(e,o/2),n-o/2),y:Math.min(Math.max(t,s/2),i-s/2)}}function sl(e,t,n,i){const{heightPx:o}=mr(n,i);return Sa(e/2,t/2,e,t,n,o)}function Mc(e,t,n){for(const i of n){const{heightPx:o}=mr(i.widthPx,i.aspectRatio),s=i.widthPx/2,l=o/2;if(e>=i.x-s&&e<=i.x+s&&t>=i.y-l&&t<=i.y+l)return!0}return!1}function dy(e,t,n,i,o,s,l,d){if(o==="system")return"none";const c=i.getBoundingClientRect(),u=document.elementFromPoint(c.left+e,c.top+t);return u&&u.closest("a")?"none":Mc(e,t,n)||s==="area"?l??"none":d??"none"}function ll(e,t,n){var d;const{sizeType:i,value:o,min:s,max:l}=t;return i==="custom"?o:i==="as is"?((d=n.get(e))==null?void 0:d.naturalWidth)??o:Math.round(Math.random()*(l-s)+s)}function uy(e){return`
|
|
15074
|
+
`,ny="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>'),li={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 iy(e){const t={};return t[Ye(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Ye(e,"fontSettings")]={...li.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Ye(e,"fontSize")]={...li.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ye(e,"lineHeight")]={...li.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ye(e,"letterSpacing")]={...li.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ye(e,"wordSpacing")]={...li.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ye(e,"textAlign")]={...li.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ye(e,"textAppearance")]={...li.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const oy=Kn.reduce((e,t)=>({...e,...iy(t)}),{}),ry=Kn.reduce((e,t)=>({...e,[Ye(t,"fontFamily")]:"Goudy Bookletter 1911",[Ye(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Ye(t,"letterSpacing")]:0,[Ye(t,"wordSpacing")]:0,[Ye(t,"textAlign")]:"left",[Ye(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function na(e){return Kn.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Ye(n,"fontSize")]=i),o!==void 0&&(t[Ye(n,"lineHeight")]=o),t},{})}const ay=wg(),sy={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"}}},type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["A","B"]},maxHeight:{type:"number",scope:"layout",title:"Max Height (%)",min:0,max:100,display:{type:"percentage-input"}},maxWidth:{type:"number",scope:"layout",title:"Max Width (%)",min:0,max:100,display:{type:"percentage-input"}},imageGap:{type:"number",scope:"layout",title:"Image Gap",min:0,display:{type:"range-control",visible:!1}},backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"settings-color-picker"}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},textTransition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["none","fade"]}},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"]}},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"}},countCloseGap:{type:"number",scope:"layout",title:"Count / Close Gap",min:0,display:{type:"range-control"}},title1Color:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},countColor:{type:"string",scope:"common",title:"Count Default",display:{type:"palette-color-picker"}},...oy,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",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:ny,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#000000",...ry,countFontFamily:"Arial"},layoutDefaults:{m:{type:"B",imageGap:.01,maxHeight:80,maxWidth:80,closeIconMaxWidth:.08,contentMarginTop:.04,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.55,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,iconMarginRight:.01,countCloseGap:.04,...na({title1FontSize:.04,title1LineHeight:.04,title2FontSize:.04,title2LineHeight:.04,title3FontSize:.04,title3LineHeight:.04,countFontSize:.04,countLineHeight:.04})},t:{type:"A",imageGap:.05,maxHeight:80,maxWidth:40,closeIconMaxWidth:.03,contentMarginTop:.01,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.16,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,iconMarginRight:.01,countCloseGap:.03,...na({title1FontSize:.0208,title1LineHeight:.0208,title2FontSize:.0208,title2LineHeight:.0208,title3FontSize:.0208,title3LineHeight:.0208,countFontSize:.0208,countLineHeight:.0208})},d:{type:"A",maxHeight:80,maxWidth:40,imageGap:.05,closeIconMaxWidth:.0125,contentMarginTop:.01,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,iconMarginRight:.01,countCloseGap:.02,...na({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098,countFontSize:.008,countLineHeight:.0098})}},layout:["__componentName__","maxWidth","maxHeight","imageGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","countCloseGap","contentMarginTop","iconMarginRight"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["type"]},{type:"row",title:"Image",items:["maxWidth","maxHeight"]},{type:"row",title:"Text",items:["textTransition"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]},{type:"row",title:"Cover Image",items:["cover","coverFit"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[ay]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","countColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemWithoutImage:!0},items:{type:"object",properties:{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"}},image:{type:"object",label:"Image",max:2,display:{type:"media-list-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]}}},default:[{title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"contain"},{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"},{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"}]}]}},ly={element:ey,id:"lightbox-journal",name:"Journal",category:"galleries",version:1,defaultSize:{d:{width:350},t:{width:300},m:{width:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Journal.png"},schema:sy,sourceCode:ty,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Kn.map(e=>({path:`${Ye(e,"fontFamily")}`}))]},fontRelations:{...Kn.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Ye(t,"fontFamily")}`}),{})}},cy={sizeType:"custom",value:700,min:400,max:700};function mr(e,t){return{widthPx:e,heightPx:e*t}}function Sa(e,t,n,i,o,s){return{x:Math.min(Math.max(e,o/2),n-o/2),y:Math.min(Math.max(t,s/2),i-s/2)}}function ll(e,t,n,i){const{heightPx:o}=mr(n,i);return Sa(e/2,t/2,e,t,n,o)}function Mc(e,t,n){for(const i of n){const{heightPx:o}=mr(i.widthPx,i.aspectRatio),s=i.widthPx/2,l=o/2;if(e>=i.x-s&&e<=i.x+s&&t>=i.y-l&&t<=i.y+l)return!0}return!1}function dy(e,t,n,i,o,s,l,d){if(o==="system")return"none";const c=i.getBoundingClientRect(),u=document.elementFromPoint(c.left+e,c.top+t);return u&&u.closest("a")?"none":Mc(e,t,n)||s==="area"?l??"none":d??"none"}function cl(e,t,n){var d;const{sizeType:i,value:o,min:s,max:l}=t;return i==="custom"?o:i==="as is"?((d=n.get(e))==null?void 0:d.naturalWidth)??o:Math.round(Math.random()*(l-s)+s)}function uy(e){return`
|
|
15075
15075
|
.${e}-root {
|
|
15076
15076
|
position: absolute;
|
|
15077
15077
|
top: 0;
|
|
@@ -15106,7 +15106,7 @@ export type LightboxJournalSettings = {
|
|
|
15106
15106
|
width: 32px;
|
|
15107
15107
|
height: 32px;
|
|
15108
15108
|
}
|
|
15109
|
-
`}function py(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 my(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await py(i)]));return new Map(n)}function gy({settings:e,content:t=[],isEditor:n}){const{prefix:i}=
|
|
15109
|
+
`}function py(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 my(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await py(i)]));return new Map(n)}function gy({settings:e,content:t=[],isEditor:n}){const{prefix:i}=x.useScopedStyles(),[o,s]=a.useState(null),[l,d]=a.useState([]),[c,u]=a.useState(0),p=a.useRef(0),[w,v]=a.useState({x:0,y:0}),[T,g]=a.useState("none"),$=a.useRef({x:0,y:0}),[f,R]=a.useState(!1),[L,I]=a.useState(!1),Y=a.useRef(new Map),{imageSize:P=cy,cursor:V="system",target:M="area",position:C="random",visible:A="all",defaultCursor:y=null,hoverCursor:S=null}=e,F=a.useMemo(()=>uy(i),[i]),W=a.useCallback((j,O,E=l)=>{if(!o)return;const K=o.getBoundingClientRect(),Z=j-K.left,ce=O-K.top;v({x:Z,y:ce}),g(dy(Z,ce,E,o,V,M,S,y))},[o,l,V,M,S,y]);a.useEffect(()=>{const j=[...t.map(E=>E.image.url),y,S].filter(E=>!!E);if(j.length===0){Y.current=new Map,I(!0);return}let O=!1;return I(!1),my(j).then(E=>{O||(Y.current=E,I(!0))}),()=>{O=!0}},[t,y,S]),a.useEffect(()=>{if(!o)return;const j=E=>{E.stopPropagation(),$.current={x:E.clientX,y:E.clientY},W(E.clientX,E.clientY)},O=()=>{f&&W($.current.x,$.current.y)};return o.addEventListener("mousemove",j),window.addEventListener("scroll",O,!0),()=>{o.removeEventListener("mousemove",j),window.removeEventListener("scroll",O,!0)}},[o,f,W]),a.useEffect(()=>{!o||!f||W($.current.x,$.current.y)},[l,o,f,W]),a.useEffect(()=>{f||g("none")},[f]);const U=(j,O,E,K={})=>{var he;const Z=((he=Y.current.get(j.image.url))==null?void 0:he.aspectRatio)??1,ce=cl(j.image.url,P,Y.current),{heightPx:N}=mr(ce,Z);let pe=0,b=0;return C==="same"?{x:pe,y:b}=ll(O,E,ce,Z):(pe=K.x??Math.random()*O,b=K.y??Math.random()*E,{x:pe,y:b}=Sa(pe,b,O,E,ce,N)),{id:p.current++,url:j.image.url,link:j.link,name:j.image.name,x:pe,y:b,xRatio:pe/O,yRatio:b/E,aspectRatio:Z,widthPx:ce}},G=()=>{if(!o)return;const j=o.getBoundingClientRect(),O=j.width,E=j.height;O===0||E===0||d(K=>K.length===0?K:K.map(Z=>{const ce=P.sizeType==="random"?Z.widthPx:cl(Z.url,P,Y.current),{heightPx:N}=mr(ce,Z.aspectRatio);if(C==="same"){const{x:he,y:Q}=ll(O,E,ce,Z.aspectRatio);return{...Z,x:he,y:Q,widthPx:ce}}const{x:pe,y:b}=Sa(Z.xRatio*O,Z.yRatio*E,O,E,ce,N);return{...Z,x:pe,y:b,widthPx:ce}}))};a.useEffect(()=>{if(!o||t.length===0||!L)return;const j=o.getBoundingClientRect(),O=j.width,E=j.height,K=U(t[0],O,E);d([K]),u(1)},[P,C,o,t,L]),a.useEffect(()=>{if(!o)return;G();const j=new ResizeObserver(G);return j.observe(o),window.addEventListener("resize",G),()=>{j.disconnect(),window.removeEventListener("resize",G)}},[o,C,P,l.length]),a.useEffect(()=>{A==="last One"&&d(j=>j.length>0?[j[j.length-1]]:[])},[A]);const J=j=>{if(!o||t.length===0||!L)return;const O=o.getBoundingClientRect(),E=j.clientX-O.left,K=j.clientY-O.top;if(M==="image"&&!Mc(E,K,l))return;let Z=0,ce=0;C==="on Click"?(Z=E,ce=K):C==="same"?(Z=O.width/2,ce=O.height/2):(Z=Math.random()*O.width,ce=Math.random()*O.height);const N=t[c],pe=U(N,O.width,O.height,{x:Z,y:ce}),b=A==="all"?[...l,pe]:[pe];d(b),u(he=>he>=t.length-1?0:he+1),W(j.clientX,j.clientY,b)},D=V==="custom"&&T!=="none";return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:F}}),r.jsxs("div",{ref:s,onClick:J,onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1),className:`${i}-root`,style:{cursor:D?"none":"default"},children:[l.map(j=>r.jsx("div",{className:`${i}-wrapper`,style:{top:`${j.y}px`,left:`${j.x}px`,width:`${j.widthPx}px`,cursor:D?"none":"default"},children:M==="area"&&j.link?r.jsx("a",{href:j.link,target:"_blank",rel:"noreferrer",className:`${i}-link`,children:r.jsx("img",{src:j.url,alt:j.name,className:`${i}-image`})}):r.jsx("img",{src:j.url,alt:j.name,className:`${i}-image`})},j.id)),f&&D&&r.jsx("div",{className:`${i}-cursor`,style:{left:`${w.x}px`,top:`${w.y}px`,transform:"translate(-50%, -50%)",backgroundImage:`url('${T}')`,backgroundSize:"cover",backgroundPosition:"center"}})]})]})}const hy=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
15110
15110
|
import { CommonComponentProps } from '../props';
|
|
15111
15111
|
import { useScopedStyles } from '../utils/index';
|
|
15112
15112
|
|
|
@@ -15627,7 +15627,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
15627
15627
|
</>
|
|
15628
15628
|
);
|
|
15629
15629
|
}
|
|
15630
|
-
`,fy={type:"object",version:1,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"}},required:["url","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}},required:["image"]},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:"Slider-1.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"Slider-2.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"Slider-3.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"Slider-4.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"Slider-5.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"Slider-6.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"Slider-7.png"},link:""}]},settings:{sizing:"manual",properties:{imageSize:{type:"object",scope:"layout",title:"Img Size",display:{type:"toggle-cycle-numeric-input",enum:["custom","as is","random"],inputs:{custom:"single","as is":"none",random:"range"},defaultValue:700,defaultMin:400,defaultMax:700},min:0,max:9999,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},cursor:{type:"string",scope:"common",title:"Cursor",display:{type:"toggle-cycle",enum:["system","custom"]}},target:{type:"string",scope:"common",title:"Target",display:{type:"toggle-cycle",enum:["area","image"]}},position:{type:"string",scope:"common",title:"Position",display:{type:"toggle-cycle",enum:["random","same","on Click"]}},visible:{type:"string",scope:"common",title:"Visible",display:{type:"toggle-cycle",enum:["all","last One"]}},defaultCursor:{type:["string","null"],scope:"common",title:"Default",display:{type:"settings-image-input",visible:!1}},hoverCursor:{type:["string","null"],scope:"common",title:"Hover",display:{type:"settings-image-input",visible:!1}}},defaults:{imageSize:{sizeType:"custom",value:700,min:400,max:700},cursor:"system",target:"area",position:"random",visible:"all",defaultCursor:null,hoverCursor:null},layoutDefaults:{m:{imageSize:{sizeType:"custom",value:500,min:400,max:700}},t:{imageSize:{sizeType:"custom",value:600,min:400,max:700}},d:{imageSize:{sizeType:"custom",value:700,min:400,max:700}}},displayRules:[{if:{name:"cursor",value:"custom"},then:{name:"properties.defaultCursor.display.visible",value:!0}},{if:{name:"cursor",value:"custom"},then:{name:"properties.hoverCursor.display.visible",value:!0}}],layout:["__componentName__","imageSize","cursor","target","position","visible","defaultCursor","hoverCursor"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["imageSize"]},{type:"row",title:"",items:["cursor","target"]},{type:"row",title:"",items:["position","visible"]},{type:"row",title:"Custom Cursor",items:["defaultCursor","hoverCursor"]}]}]},yy={element:gy,id:"click-gallerie",name:"Click",category:"galleries",version:1,defaultSize:{d:{width:"100%",height:"100%"},t:{width:"100%",height:"100%"},m:{width:"100%",height:"100%"}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Click_Gallery.mp4"},schema:fy,sourceCode:hy,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"defaultCursor"},{path:"hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]}},vy=100,xy=70,
|
|
15630
|
+
`,fy={type:"object",version:1,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"}},required:["url","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}},required:["image"]},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:"Slider-1.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"Slider-2.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"Slider-3.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"Slider-4.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"Slider-5.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"Slider-6.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"Slider-7.png"},link:""}]},settings:{sizing:"manual",properties:{imageSize:{type:"object",scope:"layout",title:"Img Size",display:{type:"toggle-cycle-numeric-input",enum:["custom","as is","random"],inputs:{custom:"single","as is":"none",random:"range"},defaultValue:700,defaultMin:400,defaultMax:700},min:0,max:9999,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},cursor:{type:"string",scope:"common",title:"Cursor",display:{type:"toggle-cycle",enum:["system","custom"]}},target:{type:"string",scope:"common",title:"Target",display:{type:"toggle-cycle",enum:["area","image"]}},position:{type:"string",scope:"common",title:"Position",display:{type:"toggle-cycle",enum:["random","same","on Click"]}},visible:{type:"string",scope:"common",title:"Visible",display:{type:"toggle-cycle",enum:["all","last One"]}},defaultCursor:{type:["string","null"],scope:"common",title:"Default",display:{type:"settings-image-input",visible:!1}},hoverCursor:{type:["string","null"],scope:"common",title:"Hover",display:{type:"settings-image-input",visible:!1}}},defaults:{imageSize:{sizeType:"custom",value:700,min:400,max:700},cursor:"system",target:"area",position:"random",visible:"all",defaultCursor:null,hoverCursor:null},layoutDefaults:{m:{imageSize:{sizeType:"custom",value:500,min:400,max:700}},t:{imageSize:{sizeType:"custom",value:600,min:400,max:700}},d:{imageSize:{sizeType:"custom",value:700,min:400,max:700}}},displayRules:[{if:{name:"cursor",value:"custom"},then:{name:"properties.defaultCursor.display.visible",value:!0}},{if:{name:"cursor",value:"custom"},then:{name:"properties.hoverCursor.display.visible",value:!0}}],layout:["__componentName__","imageSize","cursor","target","position","visible","defaultCursor","hoverCursor"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["imageSize"]},{type:"row",title:"",items:["cursor","target"]},{type:"row",title:"",items:["position","visible"]},{type:"row",title:"Custom Cursor",items:["defaultCursor","hoverCursor"]}]}]},yy={element:gy,id:"click-gallerie",name:"Click",category:"galleries",version:1,defaultSize:{d:{width:"100%",height:"100%"},t:{width:"100%",height:"100%"},m:{width:"100%",height:"100%"}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Click_Gallery.mp4"},schema:fy,sourceCode:hy,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"defaultCursor"},{path:"hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]}},vy=100,xy=70,Dn="cubic-bezier(0.86, 0, 0.07, 1)";function by(e){return`
|
|
15631
15631
|
.${e}-wrapper {
|
|
15632
15632
|
position: relative;
|
|
15633
15633
|
width: 100%;
|
|
@@ -15662,34 +15662,34 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
15662
15662
|
}
|
|
15663
15663
|
.${e}-incoming-next {
|
|
15664
15664
|
z-index: 4;
|
|
15665
|
-
transition: transform var(--${e}-transition-ms) ${
|
|
15665
|
+
transition: transform var(--${e}-transition-ms) ${Dn};
|
|
15666
15666
|
}
|
|
15667
15667
|
.${e}-incoming-prev {
|
|
15668
15668
|
z-index: 4;
|
|
15669
|
-
transition: transform var(--${e}-transition-ms) ${
|
|
15669
|
+
transition: transform var(--${e}-transition-ms) ${Dn};
|
|
15670
15670
|
}
|
|
15671
15671
|
.${e}-outgoing {
|
|
15672
15672
|
will-change: transform;
|
|
15673
15673
|
}
|
|
15674
15674
|
.${e}-outgoing-next {
|
|
15675
15675
|
z-index: 3;
|
|
15676
|
-
transition: transform var(--${e}-transition-ms) ${
|
|
15676
|
+
transition: transform var(--${e}-transition-ms) ${Dn};
|
|
15677
15677
|
}
|
|
15678
15678
|
.${e}-outgoing-prev {
|
|
15679
15679
|
z-index: 3;
|
|
15680
|
-
transition: transform var(--${e}-transition-ms) ${
|
|
15680
|
+
transition: transform var(--${e}-transition-ms) ${Dn};
|
|
15681
15681
|
}
|
|
15682
15682
|
.${e}-outgoing-next .${e}-effect-image {
|
|
15683
|
-
transition: filter var(--${e}-transition-ms) ${
|
|
15683
|
+
transition: filter var(--${e}-transition-ms) ${Dn};
|
|
15684
15684
|
}
|
|
15685
15685
|
.${e}-outgoing-prev .${e}-effect-image {
|
|
15686
|
-
transition: filter var(--${e}-transition-ms) ${
|
|
15686
|
+
transition: filter var(--${e}-transition-ms) ${Dn};
|
|
15687
15687
|
}
|
|
15688
15688
|
.${e}-incoming .${e}-effect-image {
|
|
15689
|
-
transition: filter var(--${e}-transition-ms) ${
|
|
15689
|
+
transition: filter var(--${e}-transition-ms) ${Dn};
|
|
15690
15690
|
}
|
|
15691
15691
|
.${e}-background .${e}-effect-image {
|
|
15692
|
-
transition: filter var(--${e}-transition-ms) ${
|
|
15692
|
+
transition: filter var(--${e}-transition-ms) ${Dn};
|
|
15693
15693
|
}
|
|
15694
15694
|
.${e}-snap .${e}-incoming,
|
|
15695
15695
|
.${e}-snap .${e}-outgoing,
|
|
@@ -15737,7 +15737,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
15737
15737
|
display: block;
|
|
15738
15738
|
pointer-events: none;
|
|
15739
15739
|
}
|
|
15740
|
-
`}function wy(e){return e==="blur"?xy:e==="greyscale"?vy:0}function Ji(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
|
|
15740
|
+
`}function wy(e){return e==="blur"?xy:e==="greyscale"?vy:0}function Ji(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 dl(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function Sy(e,t){return t<=1?0:(e-1+t)%t}function $y(e,t=1){return!e||e.height===0?t:e.width/e.height}function Cy(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 ul(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 kc(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function pl(e,t,n){return{...kc(e),[`--${n}-stage-scale`]:t}}function Ty(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 Ly({settings:e,content:t,isEditor:n,isPreviewMode:i}){var Se,B,ue,ve,me,Ee,be;const{prefix:o}=x.useScopedStyles(),s=a.useMemo(()=>by(o),[o]),{imageSize:l,maxWidth:d,maxHeight:c,transition:u=1e3,bgImage:p="greyscale"}=e,w=t??[],v=dl(w.length),[T,g]=a.useState(v.activeIndex),[$,f]=a.useState(v.backgroundIndex),[R,L]=a.useState(!1),[I,Y]=a.useState(!1),[P,V]=a.useState(null),[M,C]=a.useState(null),[A,y]=a.useState(0),[S,F]=a.useState(1),[W,U]=a.useState("none"),[G,J]=a.useState("next"),[D,j]=a.useState({}),[O,E]=a.useState({width:0,height:0}),K=a.useRef(null),Z=a.useRef(null),ce=!n||!!i,N=l??60,pe=Math.max(10,Math.min(100,d??N)),b=Math.max(10,Math.min(100,c??N)),he=Math.max(100,u),Q=Ji(p),we=a.useCallback(k=>{const re=$y(k?D[k]:void 0);return Cy(O.width,O.height,re,pe,b)},[O.height,O.width,D,b,pe]);a.useEffect(()=>{const k=Z.current;if(!k)return;const re=new ResizeObserver(([te])=>{const{width:z,height:le}=te.contentRect;E({width:z,height:le})});return re.observe(k),()=>re.disconnect()},[]),a.useEffect(()=>{const k=(t??[]).map(re=>{var te;return(te=re.image)==null?void 0:te.url}).filter(re=>!!re);Ty(k,(re,te)=>{j(z=>{var le,Re;return((le=z[re])==null?void 0:le.width)===te.width&&((Re=z[re])==null?void 0:Re.height)===te.height?z:{...z,[re]:te}})})},[t]),a.useEffect(()=>{const{backgroundIndex:k,activeIndex:re}=dl(w.length);g(re),f(k),L(!1),Y(!1),V(null),C(null),y(0),F(1),U("none"),J("next")},[w.length,t]),a.useEffect(()=>()=>{K.current&&clearTimeout(K.current)},[]);const Te=a.useCallback(k=>{var ae,_,Ne,Fe;if(!ce||R||w.length<=1)return;const re=k==="next"?(T+1)%w.length:(T-1+w.length)%w.length,te=we((_=(ae=w[T])==null?void 0:ae.image)==null?void 0:_.url),z=we((Fe=(Ne=w[re])==null?void 0:Ne.image)==null?void 0:Fe.url),le=ul(O.width,O.height,te),Re=ul(O.width,O.height,z);K.current&&clearTimeout(K.current),J(k),Y(!0),L(!0),k==="next"?(V(T),C(re),y(0),F(1),U(Ji(p,0,1))):(f(Sy(re,w.length)),V(re),C(T),y(1),F(Re),U(Ji(p,1,Re))),requestAnimationFrame(()=>{Y(!1),requestAnimationFrame(()=>{k==="next"?(y(1),F(le),U(Ji(p,1,le))):(y(0),F(1),U(Ji(p,0,1)))})}),K.current=setTimeout(()=>{k==="next"&&f(T),g(re),V(null),C(null),L(!1)},he)},[T,p,O.height,O.width,we,R,ce,w,he]),se=w[T],oe=$!==null?w[$]:null,q=P!==null?w[P]:null,de=M!==null?w[M]:null,ge=w.length<=1?0:(T-1+w.length)%w.length,_e=w.length<=1?0:(T+1)%w.length,Ce=we((Se=se==null?void 0:se.image)==null?void 0:Se.url),Me=we((B=q==null?void 0:q.image)==null?void 0:B.url),fe=we((ue=de==null?void 0:de.image)==null?void 0:ue.url),ye={[`--${o}-transition-ms`]:`${he}ms`};return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:s}}),r.jsxs("div",{ref:Z,className:dt(`${o}-wrapper`,I&&`${o}-snap`,n&&!i&&`${o}-editor`),style:ye,"aria-label":"Zoom gallery",children:[((ve=oe==null?void 0:oe.image)==null?void 0:ve.url)&&r.jsx("div",{className:`${o}-background`,"aria-hidden":"true",children:r.jsx("img",{className:`${o}-effect-image`,src:oe.image.url,alt:"",style:{filter:Q}})}),R&&((me=q==null?void 0:q.image)==null?void 0:me.url)&&r.jsx("div",{className:dt(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${G}`),style:pl(Me,S,o),"aria-hidden":"true",children:r.jsx("img",{className:`${o}-effect-image`,src:q.image.url,alt:"",style:{filter:W}})}),R&&((Ee=de==null?void 0:de.image)==null?void 0:Ee.url)&&r.jsx("div",{className:dt(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${G}`),style:pl(fe,A,o),"aria-hidden":"true",children:r.jsx("img",{className:`${o}-image`,src:de.image.url,alt:""})}),!R&&((be=se==null?void 0:se.image)==null?void 0:be.url)&&r.jsx("div",{className:dt(`${o}-stage`,`${o}-foreground`),style:kc(Ce),children:r.jsx("img",{className:`${o}-image`,src:se.image.url,alt:se.image.name??""})}),ce&&w.length>1&&!R&&r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:dt(`${o}-nav`,`${o}-nav-prev`),onClick:()=>Te("prev"),"aria-label":`Show previous image (${ge+1} of ${w.length})`}),r.jsx("button",{type:"button",className:dt(`${o}-nav`,`${o}-nav-next`),onClick:()=>Te("next"),"aria-label":`Show next image (${_e+1} of ${w.length})`})]})]})]})}const Iy=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
15741
15741
|
import cn from 'classnames';
|
|
15742
15742
|
import { CommonComponentProps } from '../props';
|
|
15743
15743
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -16256,7 +16256,7 @@ export function Scale({ settings, content, isEditor, isPreviewMode }: ScaleProps
|
|
|
16256
16256
|
</>
|
|
16257
16257
|
);
|
|
16258
16258
|
}
|
|
16259
|
-
`,Ry={type:"object",version:1,settings:{sizing:"manual",properties:{maxWidth:{type:"number",scope:"common",title:"Max width (%)",display:{type:"percentage-input"},min:10,max:100},maxHeight:{type:"number",scope:"common",title:"Max height (%)",display:{type:"percentage-input"},min:10,max:100},transition:{type:"number",scope:"common",title:"Transition (ms)",display:{type:"common-numeric-input"},min:100,max:9999},bgImage:{type:"string",scope:"common",title:"BG image",display:{type:"toggle-cycle",enum:["greyscale","blur","as is"]}}},defaults:{maxWidth:60,maxHeight:60,transition:700,bgImage:"greyscale"},layout:["__componentName__","maxWidth","maxHeight","transition","bgImage"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["maxWidth","maxHeight"]},{type:"row",title:"",items:["transition","bgImage"]}]}],content:{type:"array",settings:{addItemFromFileExplorer:!0,deleteImageDeletesEntry:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input",isObjectFitEditable:!1}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:""}}]}},Ey={element:Ly,id:"scale",name:"Scale",category:"galleries",version:1,defaultSize:{d:{width:920,height:540},m:{width:"100%",height:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Scale.mp4"},schema:Ry,sourceCode:Iy,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},My={backgroundColor:"background-color",textColor:"text-color",borderColor:"border-color",iconColor:"icon-color",boxShadowColor:"box-shadow-color",innerBoxShadowColor:"inner-box-shadow-color"},ky=["hover","active"],ia={left:"flex-start",center:"center",right:"flex-end"};function Py(e,t){const n=e.currentTarget,i=n.getBoundingClientRect(),o=e.clientY-i.top>i.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,o)}function Ay(e,t){const n=e.currentTarget,i=n.getBoundingClientRect(),o=e.clientY<i.top+i.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,o)}function Fy(e){const t=`var(--${e}-box-shadow-x, 0) var(--${e}-box-shadow-y, 0) var(--${e}-box-shadow-blur, 0) var(--${e}-box-shadow-spread, 0) var(--${e}-box-shadow-color, transparent)`,n=`inset var(--${e}-inner-box-shadow-x, 0) var(--${e}-inner-box-shadow-y, 0) var(--${e}-inner-box-shadow-blur, 0) var(--${e}-inner-box-shadow-spread, 0) var(--${e}-inner-box-shadow-color, transparent)`,i=`${t}, ${n}`,o=`var(--${e}-box-shadow-x, 0) var(--${e}-box-shadow-y, 0) var(--${e}-box-shadow-blur, 0) var(--${e}-box-shadow-spread, 0) var(--${e}-hover-box-shadow-color, var(--${e}-box-shadow-color, transparent))`,s=`inset var(--${e}-inner-box-shadow-x, 0) var(--${e}-inner-box-shadow-y, 0) var(--${e}-inner-box-shadow-blur, 0) var(--${e}-inner-box-shadow-spread, 0) var(--${e}-hover-inner-box-shadow-color, var(--${e}-inner-box-shadow-color, transparent))`,l=`${o}, ${s}`,d=`var(--${e}-box-shadow-x, 0) var(--${e}-box-shadow-y, 0) var(--${e}-box-shadow-blur, 0) var(--${e}-box-shadow-spread, 0) var(--${e}-active-box-shadow-color, var(--${e}-box-shadow-color, transparent))`,c=`inset var(--${e}-inner-box-shadow-x, 0) var(--${e}-inner-box-shadow-y, 0) var(--${e}-inner-box-shadow-blur, 0) var(--${e}-inner-box-shadow-spread, 0) var(--${e}-active-inner-box-shadow-color, var(--${e}-inner-box-shadow-color, transparent))`,u=`${d}, ${c}`,p=`0 4px 12px rgba(0, 0, 0, 0.15), ${n}`,
|
|
16259
|
+
`,Ry={type:"object",version:1,settings:{sizing:"manual",properties:{maxWidth:{type:"number",scope:"common",title:"Max width (%)",display:{type:"percentage-input"},min:10,max:100},maxHeight:{type:"number",scope:"common",title:"Max height (%)",display:{type:"percentage-input"},min:10,max:100},transition:{type:"number",scope:"common",title:"Transition (ms)",display:{type:"common-numeric-input"},min:100,max:9999},bgImage:{type:"string",scope:"common",title:"BG image",display:{type:"toggle-cycle",enum:["greyscale","blur","as is"]}}},defaults:{maxWidth:60,maxHeight:60,transition:700,bgImage:"greyscale"},layout:["__componentName__","maxWidth","maxHeight","transition","bgImage"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["maxWidth","maxHeight"]},{type:"row",title:"",items:["transition","bgImage"]}]}],content:{type:"array",settings:{addItemFromFileExplorer:!0,deleteImageDeletesEntry:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input",isObjectFitEditable:!1}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:""}}]}},Ey={element:Ly,id:"scale",name:"Scale",category:"galleries",version:1,defaultSize:{d:{width:920,height:540},m:{width:"100%",height:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Scale.mp4"},schema:Ry,sourceCode:Iy,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},My={backgroundColor:"background-color",textColor:"text-color",borderColor:"border-color",iconColor:"icon-color",boxShadowColor:"box-shadow-color",innerBoxShadowColor:"inner-box-shadow-color"},ky=["hover","active"],ia={left:"flex-start",center:"center",right:"flex-end"};function Py(e,t){const n=e.currentTarget,i=n.getBoundingClientRect(),o=e.clientY-i.top>i.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,o)}function Ay(e,t){const n=e.currentTarget,i=n.getBoundingClientRect(),o=e.clientY<i.top+i.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,o)}function Fy(e){const t=`var(--${e}-box-shadow-x, 0) var(--${e}-box-shadow-y, 0) var(--${e}-box-shadow-blur, 0) var(--${e}-box-shadow-spread, 0) var(--${e}-box-shadow-color, transparent)`,n=`inset var(--${e}-inner-box-shadow-x, 0) var(--${e}-inner-box-shadow-y, 0) var(--${e}-inner-box-shadow-blur, 0) var(--${e}-inner-box-shadow-spread, 0) var(--${e}-inner-box-shadow-color, transparent)`,i=`${t}, ${n}`,o=`var(--${e}-box-shadow-x, 0) var(--${e}-box-shadow-y, 0) var(--${e}-box-shadow-blur, 0) var(--${e}-box-shadow-spread, 0) var(--${e}-hover-box-shadow-color, var(--${e}-box-shadow-color, transparent))`,s=`inset var(--${e}-inner-box-shadow-x, 0) var(--${e}-inner-box-shadow-y, 0) var(--${e}-inner-box-shadow-blur, 0) var(--${e}-inner-box-shadow-spread, 0) var(--${e}-hover-inner-box-shadow-color, var(--${e}-inner-box-shadow-color, transparent))`,l=`${o}, ${s}`,d=`var(--${e}-box-shadow-x, 0) var(--${e}-box-shadow-y, 0) var(--${e}-box-shadow-blur, 0) var(--${e}-box-shadow-spread, 0) var(--${e}-active-box-shadow-color, var(--${e}-box-shadow-color, transparent))`,c=`inset var(--${e}-inner-box-shadow-x, 0) var(--${e}-inner-box-shadow-y, 0) var(--${e}-inner-box-shadow-blur, 0) var(--${e}-inner-box-shadow-spread, 0) var(--${e}-active-inner-box-shadow-color, var(--${e}-inner-box-shadow-color, transparent))`,u=`${d}, ${c}`,p=`0 4px 12px rgba(0, 0, 0, 0.15), ${n}`,w=`.${e}-button:focus-visible, a:focus-visible .${e}-button`,v=`.${e}-button:hover, ${w}`,T=g=>`.${e}-hover-effect-${g}:hover, .${e}-hover-effect-${g}:focus-visible, a:focus-visible .${e}-hover-effect-${g}`;return`
|
|
16260
16260
|
.${e}-root {
|
|
16261
16261
|
line-height: 0;
|
|
16262
16262
|
}
|
|
@@ -16417,7 +16417,7 @@ a:focus-visible .${e}-hover-effect-content-roll .${e}-content-roll-layer-hover,
|
|
|
16417
16417
|
transform: translateY(-50%);
|
|
16418
16418
|
opacity: 1;
|
|
16419
16419
|
}
|
|
16420
|
-
${
|
|
16420
|
+
${v} {
|
|
16421
16421
|
background-color: var(--${e}-hover-background-color, var(--${e}-background-color));
|
|
16422
16422
|
color: var(--${e}-hover-text-color, var(--${e}-text-color));
|
|
16423
16423
|
border-color: var(--${e}-hover-border-color, var(--${e}-border-color));
|
|
@@ -16496,7 +16496,7 @@ a:active .${e}-button .${e}-icon-image,
|
|
|
16496
16496
|
height: calc(1em * var(--${e}-icon-scale, 1));
|
|
16497
16497
|
width: calc(1em * var(--${e}-icon-scale, 1));
|
|
16498
16498
|
}
|
|
16499
|
-
`}function oa(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
|
|
16499
|
+
`}function oa(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 ml(e,t,n="fill",i=100,o=0,s){if(!t)return null;const l=r.jsx(on,{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=x.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 Wy({settings:e,isEditor:t,isPreviewMode:n,activeEvent:i,hasLink:o}){const{prefix:s}=x.useScopedStyles(),l=a.useMemo(()=>Fy(s),[s]),{type:d="a",label:c="Button",icon:u,alignment:p="center",alignA:w,order:v="text-icon",gap:T=0,iconSize:g=0,iconWidthC:$=0,dimensions:f=!1,padding:R={top:0,right:0,bottom:0,left:0},cornerRadius:L=0,boxShadow:I={top:0,left:0,right:0,bottom:0},boxShadowColor:Y="rgba(0, 0, 0, 0)",innerBoxShadow:P={top:0,left:0,right:0,bottom:0},innerBoxShadowColor:V="rgba(0, 0, 0, 0)",stroke:M=0,backgroundColor:C="#000000",textColor:A="#ffffff",borderColor:y="#ffffff",iconColor:S="#ffffff",hoverEffect:F="none",fontFamily:W,fontSettings:U,fontSize:G,lineHeight:J,letterSpacing:D=0,wordSpacing:j=0,textAppearance:O,stateOverrides:E,minWidth:K=0,minHeight:Z=0,width:ce=0,height:N=0}=e,pe=x.buildColorVars(s,{backgroundColor:C,textColor:A,borderColor:y,iconColor:S,boxShadowColor:Y,innerBoxShadowColor:V},My,ky,E),b=i&&i!=="default"?`${s}-state-${i}`:"",he=t&&!n?`${s}-editing`:"",Q=F!=="none"&&(!t||n||i==="hover")?`${s}-hover-effect-${F}`:"",we=F==="reveal"||F==="swipe",Te=F==="content-roll",se=F==="reveal"&&(!t||n),oe=f===!0,de=d==="a"?w??p:p,ge=d==="c",_e=d!=="b",Ce={fontSettings:{fontFamily:W,fontWeight:(U==null?void 0:U.fontWeight)??400,fontStyle:(U==null?void 0:U.fontStyle)??"normal"},fontSize:G??.01,lineHeight:J,letterSpacing:D,wordSpacing:j,textAppearance:O,color:A},fe={..._e?nn(zt(Ce,t)):{},[`--${s}-box-shadow-x`]:x.scalingValue(I.left,t),[`--${s}-box-shadow-y`]:x.scalingValue(I.top,t),[`--${s}-box-shadow-blur`]:x.scalingValue(I.right,t),[`--${s}-box-shadow-spread`]:x.scalingValue(I.bottom,t),[`--${s}-inner-box-shadow-x`]:x.scalingValue(P.left,t),[`--${s}-inner-box-shadow-y`]:x.scalingValue(P.top,t),[`--${s}-inner-box-shadow-blur`]:x.scalingValue(P.right,t),[`--${s}-inner-box-shadow-spread`]:x.scalingValue(P.bottom,t),paddingTop:x.scalingValue(R.top,t),paddingRight:x.scalingValue(R.right,t),paddingBottom:x.scalingValue(R.bottom,t),paddingLeft:x.scalingValue(R.left,t),borderRadius:x.scalingValue(L,t),borderWidth:x.scalingValue(M,t),...ge?{}:{justifyContent:ia[de],textAlign:de},...ge&&!Te?{gap:x.scalingValue(T,t)}:{},...oe?{width:x.scalingValue(ce,t),height:x.scalingValue(N,t)}:{minWidth:x.scalingValue(K,t),minHeight:x.scalingValue(Z,t),...ge?{width:"100%"}:{}}};let ye;const Se={display:"inline-flex",alignItems:"center",justifyContent:ge?ia[de]:ia[d==="a"?de:"center"],gap:ge?x.scalingValue(T,t):void 0,width:"100%",height:"100%",...d==="a"?{textAlign:de}:{}};if(d==="b"){const ve=()=>ml(s,u,g>0?"fixed":"fill",100,g,t);ye=Te?oa(s,ve,`${s}-icon-roll`,void 0,Se):ve()}else if(d==="c"){const ve=()=>{const me=r.jsx("span",{className:`${s}-text`,style:{textAlign:de},children:c}),Ee=ml(s,u,$>0?"fixed":"fill",100,$,t);return v==="icon-text"?r.jsxs(r.Fragment,{children:[Ee,me]}):r.jsxs(r.Fragment,{children:[me,Ee]})};ye=Te?oa(s,ve,`${s}-icon-text-roll`,void 0,Se):ve()}else ye=Te?oa(s,()=>c,`${s}-label-roll`,void 0,Se):we?r.jsx("span",{className:`${s}-button-inner`,children:c}):c;const B=se?ve=>Py(ve,s):void 0,ue=se?ve=>Ay(ve,s):void 0;return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),r.jsx("div",{className:`${s}-root`,style:pe,children:r.jsx("div",{className:`${s}-wrapper ${b} ${he}`.trim(),children:r.jsx("div",{className:`${s}-button ${Q}`.trim(),style:fe,onMouseEnter:B,onMouseLeave:ue,role:"button",tabIndex:o||t&&!n?void 0:0,children:ye})})})]})}const _y=`import { useMemo, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
|
|
16500
16500
|
import { SvgImage } from '../helpers/SvgImage/SvgImage';
|
|
16501
16501
|
import { CommonComponentProps } from '../props';
|
|
16502
16502
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
|
|
@@ -17123,7 +17123,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
17123
17123
|
</>
|
|
17124
17124
|
);
|
|
17125
17125
|
}
|
|
17126
|
-
`,Ny={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Hy=["backgroundColor","textColor","borderColor","iconColor","boxShadowColor","innerBoxShadowColor"],Oy={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:{...Ny.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:[...Hy],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"]},jy={element:Wy,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:Oy,sourceCode:_y,assetsPaths:{content:[],parameters:[{path:"icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{fontSettings:"fontFamily"}};function Dy(e){return`
|
|
17126
|
+
`,Ny={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Hy=["backgroundColor","textColor","borderColor","iconColor","boxShadowColor","innerBoxShadowColor"],Oy={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:{...Ny.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:[...Hy],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"]},Dy={element:Wy,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:Oy,sourceCode:_y,assetsPaths:{content:[],parameters:[{path:"icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{fontSettings:"fontFamily"}};function jy(e){return`
|
|
17127
17127
|
.${e}-titles-row {
|
|
17128
17128
|
position: relative;
|
|
17129
17129
|
flex: 0 1 auto;
|
|
@@ -17321,7 +17321,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
17321
17321
|
pointer-events: auto;
|
|
17322
17322
|
flex-shrink: 0;
|
|
17323
17323
|
}
|
|
17324
|
-
`}const Cn=500,Qi=650,pn="cubic-bezier(0.22, 1, 0.36, 1)",zy=72,By=50,Vy=1e4,Gy=650,qy=500;function Uy(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 Pc(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=dr(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 Ky(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?Pc(i,n):null}function Xy(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 no(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 ml(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return no(e,i,n)}const Yy=.03;function Ac(e){return e.width*Yy}const ra={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Uo(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function gl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Zy(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 Jy(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:$a(e,t.width,t.height)}function Qy(e,t){if(kr(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 ev(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 tv({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=>kr(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 Bi(e,t,n){const{width:i,height:o,top:s}=e,{left:l,width:d}=n,c=Ac(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 gr(e,t,n){const i=Bi(e,t,n);return{...i,left:2*i.left-e.left}}function nv(e,t,n){const{left:i,width:o}=n,s=Ac(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 Fc(e,t,n,i){const o=Bi(e,"left",i),s=Bi(e,"right",i),l=gr(e,"left",i),d=gr(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 iv(e,t,n,i){const{start:o,end:s}=Fc(e,t,n,i);return{x:s.left-o.left,y:s.top-o.top}}function ov(e,t,n){const i=Bi(e,t,n),o=gr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function kr(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function rv({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 Ko({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return kr(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 av({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:S,resolveCloseSourceRect:T,onClose:g,onPrev:$,onNext:h}){const I=a.useRef(null),R=a.useRef(null),E=a.useRef(null),Z=a.useRef(new Map),[P,B]=a.useState(0),M=a.useRef(null),C=a.useRef(0),W=a.useRef(0),y=a.useRef("none"),x=a.useRef(!1),A=a.useRef(!1),H=a.useRef(!1),K=a.useRef(null),G=a.useRef(null),Y=a.useRef(null),V=a.useRef(()=>{}),D=a.useRef(null),O=a.useRef(null),L=a.useRef(null),U=a.useRef(!1),[J,ce]=a.useState(null),[_,de]=a.useState(ra),[w,ge]=a.useState(0),[Q,ve]=a.useState("opening"),[Le,pe]=a.useState(0),[ae,q]=a.useState(0),[se,he]=a.useState(!1),[Pe,Ce]=a.useState(null),[ke,fe]=a.useState(null),[xe,Se]=a.useState(null),[z,me]=a.useState(!1),[ye,ue]=a.useState(null),[Ee,we]=a.useState(!1),k=a.useRef(!1),[le,te]=a.useState(!1),[j,re]=a.useState(!1),Ie=a.useRef(n),ie=a.useRef(void 0),F=t[n],He=F?kr(F):!1,Ne=ae!==0||se,tt=!l&&(!s||!!d),Ke=c&&!l,Re=u.length>1,ee=a.useCallback((f,be)=>t.length<=1?null:t[(f+be+t.length)%t.length]??null,[t]),ne=Re?no(u,p,-1):ee(n,-1),Me=Re?no(u,p,1):ee(n,1),qe=Pe===-1&&Ne?Re&&ke!==null?no(u,ke,-1):xe!==null?ee(xe,-1):null:null,De=Pe===1&&Ne?Re&&ke!==null?no(u,ke,1):xe!==null?ee(xe,1):null:null,Oe=qe&&qe.url!==(ne==null?void 0:ne.url)?qe:null,Ve=De&&De.url!==(Me==null?void 0:Me.url)?De:null,it=ne&&Ke?(()=>{const f=Re?ml(u,p,-1):t.length>2?ee((n-1+t.length)%t.length,-1):null;return f&&f.url!==ne.url?f:null})():null,Qe=Me&&Ke?(()=>{const f=Re?ml(u,p,1):t.length>2?ee((n+1)%t.length,1):null;return f&&f.url!==Me.url?f:null})():null,pt=Oe??it,bt=Ve??Qe,ot=a.useCallback((f,be,Fe)=>{if(!f||!be||!Fe)return;const We=Z.current,st=We.get(f);(st==null?void 0:st.width)===be&&(st==null?void 0:st.height)===Fe||(We.set(f,{width:be,height:Fe}),B(Pt=>Pt+1))},[]),ht=a.useCallback(f=>{if(!(f!=null&&f.url))return null;const be=Z.current.get(f.url);return Jy(R.current,be)},[P,w]),Wt=a.useCallback(()=>{if(!F)return;const f=ht(F);if(f){ce(f);return}const be=R.current;be&&ce(gl(be))},[F,ht]),dt=a.useCallback(f=>{if(Re){const be=u.length;fe((p+f+be)%be),Se(null);return}t.length>1&&(Se((n+f+t.length)%t.length),fe(null))},[Re,u.length,p,t.length,n]),Xe=a.useCallback(f=>{H.current=f,he(f)},[]),ze=a.useCallback(()=>{K.current!==null&&(window.clearTimeout(K.current),K.current=null)},[]),vt=a.useCallback(()=>{ze(),K.current=window.setTimeout(()=>{ze(),Xe(!1)},Qi+32)},[ze,Xe]),wt=a.useCallback(()=>{const f=I.current;if(!f){de({left:0,top:0,width:typeof window<"u"?window.innerWidth:ra.width,height:typeof window<"u"?window.innerHeight:ra.height});return}const be=f.getBoundingClientRect();de({left:be.left,top:be.top,width:be.width,height:be.height})},[]),kt=a.useCallback((f,be)=>{if(Ne){if(le&&!se)return`translate(${ae}px, 0px)`;if(se&&Pe!==null){const Fe=ht(f);if(!Fe)return;const{x:We,y:st}=iv(Fe,be,Pe,_);return`translate(${We}px, ${st}px)`}if(se)return"translate(0px, 0px)"}},[Ne,le,se,ae,Pe,_,ht]),jt=a.useCallback(()=>{const f=G.current;G.current=null,ze(),Xe(!1),Ce(null),fe(null),Se(null),q(0),te(!1),x.current=!1,W.current=0,y.current="none",f===-1?$():f===1&&h()},[ze,Xe,$,h]),tn=a.useCallback(()=>{ze(),K.current=window.setTimeout(()=>{G.current!==null&&jt()},Qi+32)},[ze,jt]),ln=a.useCallback(()=>{ze(),G.current=null,Xe(!1),Ce(null),fe(null),Se(null),q(0),te(!1),x.current=!1,W.current=0,y.current="none"},[ze,Xe]),Tt=a.useCallback(f=>{if(!(!Ke||!J)){if(H.current){if(G.current===f){Y.current=f,jt();return}ln()}ze(),dt(f),G.current=f,Ce(f),Xe(!0),tn()}},[Ke,J,jt,ln,ze,dt,Xe,tn]);V.current=Tt;const Mt=a.useCallback(()=>{D.current=null,U.current=!1,O.current!==null&&(window.clearInterval(O.current),O.current=null),L.current!==null&&(window.clearTimeout(L.current),L.current=null)},[]),Yt=a.useCallback(f=>{O.current!==null&&window.clearInterval(O.current);const be=U.current?qy:Gy;O.current=window.setInterval(()=>{V.current(f)},be)},[]),qt=a.useCallback(f=>{D.current!==f&&(Mt(),D.current=f,U.current=!1,V.current(f),Yt(f),L.current=window.setTimeout(()=>{L.current=null,D.current===f&&(U.current=!0,Yt(f))},Vy))},[Mt,Yt]),Te=a.useCallback(()=>{const f=R.current;if(!f)return;const be=F==null?void 0:F.url,Fe=be?Z.current.get(be):void 0;if(Fe!=null&&Fe.width&&(Fe!=null&&Fe.height)){ce($a(f,Fe.width,Fe.height));return}const We=E.current;if(We&&be&&(We.src===be||We.currentSrc===be)){const{width:Pt,height:et}=Zy(We);if(Pt&&et){ot(be,Pt,et),ce($a(f,Pt,et));return}}const st=gl(f);!st.width||!st.height||ce(st)},[F==null?void 0:F.url,ot]),Ge=a.useCallback(f=>{if(E.current=f,!!f){if(f instanceof HTMLVideoElement){f.readyState>=1&&f.videoWidth>0&&Te();return}f.complete&&f.naturalWidth>0&&Te()}},[Te]),Ue=a.useCallback(()=>{wt(),Te(),ge(f=>f+1)},[wt,Te]);a.useEffect(()=>{Ue();const f=R.current,be=I.current,Fe=new ResizeObserver(()=>Ue());return f&&Fe.observe(f),be&&Fe.observe(be),window.addEventListener("resize",Ue),()=>{Fe.disconnect(),window.removeEventListener("resize",Ue)}},[Ue,n,b]),a.useLayoutEffect(()=>{if(!F)return;const f=E.current;if(f){if(f instanceof HTMLImageElement&&f.complete&&f.naturalWidth>0){Te();return}f instanceof HTMLVideoElement&&f.readyState>=1&&f.videoWidth>0&&Te()}},[F==null?void 0:F.url,n,Te]),a.useEffect(()=>{Wt()},[Wt,P]),a.useEffect(()=>{const f=new Set,be=[],Fe=We=>{!(We!=null&&We.url)||f.has(We.url)||(f.add(We.url),be.push(We))};t.forEach(Fe),u.forEach(We=>We.items.forEach(Fe)),be.forEach(We=>{Z.current.has(We.url)||Qy(We,ot)})},[t,u,ot]),a.useEffect(()=>{if(Q!=="opening"||!J)return;if(!S){ve("open");return}me(!1);const f=requestAnimationFrame(()=>{requestAnimationFrame(()=>{me(!0),ve("open")})});return()=>cancelAnimationFrame(f)},[Q,J,S]),a.useEffect(()=>{if(Q!=="closing")return;const f=setTimeout(()=>g(),Cn);return()=>clearTimeout(f)},[Q,g]),a.useEffect(()=>()=>{ze()},[ze]),a.useLayoutEffect(()=>{Ie.current===n&&ie.current===(F==null?void 0:F.url)||(ze(),G.current=null,Ce(null),fe(null),Se(null),pe(0),q(0),Xe(!1),re(!1),te(!1),C.current=0,W.current=0,y.current="none",x.current=!1,M.current=null,A.current=!1,E.current=null,Wt(),Ie.current=n,ie.current=F==null?void 0:F.url)},[n,F==null?void 0:F.url,Xe,ze,Wt]),a.useLayoutEffect(()=>{const f=Y.current;f!==null&&(Y.current=null,requestAnimationFrame(()=>{V.current(f)}))},[n,p,F==null?void 0:F.url]),a.useLayoutEffect(()=>{if(Q==="opening"){k.current=!1,we(!1);return}if(Q!=="open"||k.current)return;if(!ne&&!Me){k.current=!0;return}we(!1);const f=requestAnimationFrame(()=>{requestAnimationFrame(()=>{we(!0),k.current=!0})});return()=>cancelAnimationFrame(f)},[Q,ne==null?void 0:ne.url,Me==null?void 0:Me.url]),a.useEffect(()=>{if(Q!=="open")return;const f=()=>{const et=mt=>{mt.stopPropagation(),mt.preventDefault(),document.removeEventListener("click",et,!0)};document.addEventListener("click",et,!0)},be=et=>{const mt=et<0?1:-1;ze(),dt(mt),G.current=mt,Ce(mt),Xe(!0),tn()},Fe=et=>{if(Math.abs(et)>By&&Ke){be(et);return}G.current=null,Ce(null),fe(null),Se(null),Xe(!0),q(0),vt()},We=et=>{if(et.touches.length!==1||H.current)return;const mt=et.touches[0];A.current=!0,M.current={x:mt.clientX,y:mt.clientY},y.current="none",W.current=0,x.current=!1},st=et=>{if(!M.current||et.touches.length!==1||H.current)return;const mt=et.touches[0],_t=mt.clientX-M.current.x,Et=mt.clientY-M.current.y;if(y.current==="none"){if(Math.abs(_t)<10&&Math.abs(Et)<10)return;if(Math.abs(_t)>Math.abs(Et)){if(!Ke)return;y.current="horizontal"}else if(Et>0){if(!tt)return;y.current="vertical"}else return}if(y.current==="horizontal"){x.current=!0,te(!0),W.current=_t,q(_t),et.preventDefault();return}y.current==="vertical"&&(x.current=!0,te(!0),C.current=Et,pe(Et),et.preventDefault())},Pt=()=>{if(!M.current)return;const et=y.current,mt=x.current;if(mt&&et==="horizontal")Fe(W.current),f();else if(mt&&et==="vertical"){const _t=C.current;if(tt&&_t>zy){const Et=window.innerHeight;C.current=Et,re(!0),pe(Et),ve("closing")}else C.current=0,pe(0);f()}else et==="horizontal"&&Math.abs(W.current)>0&&(Fe(W.current),f());M.current=null,y.current="none",W.current=0,x.current=!1,te(!1)};return document.addEventListener("touchstart",We,{passive:!0}),document.addEventListener("touchmove",st,{passive:!1}),document.addEventListener("touchend",Pt),document.addEventListener("touchcancel",Pt),()=>{document.removeEventListener("touchstart",We),document.removeEventListener("touchmove",st),document.removeEventListener("touchend",Pt),document.removeEventListener("touchcancel",Pt)}},[Q,Ke,Xe,vt,ze,tt,tn,dt]);const lt=a.useCallback(()=>{const f=(T==null?void 0:T())??S??null;f&&J&&(ue(f),me(!0)),ve("closing")},[T,S,J]);a.useEffect(()=>{const f=We=>{if(We.key==="Escape"){if(s&&d||Q==="closing")return;Mt(),lt();return}if(We.key!=="ArrowLeft"&&We.key!=="ArrowRight"||Q!=="open"||!Ke)return;We.preventDefault();const st=We.key==="ArrowLeft"?-1:1;We.repeat&&D.current===st||qt(st)},be=We=>{if(We.key!=="ArrowLeft"&&We.key!=="ArrowRight")return;const st=We.key==="ArrowLeft"?-1:1;D.current===st&&Mt()},Fe=()=>{Mt()};return window.addEventListener("keydown",f),window.addEventListener("keyup",be),window.addEventListener("blur",Fe),()=>{window.removeEventListener("keydown",f),window.removeEventListener("keyup",be),window.removeEventListener("blur",Fe),Mt()}},[Q,s,d,lt,Ke,qt,Mt]),a.useEffect(()=>{Q!=="open"&&Mt()},[Q,Mt]);const Rt=()=>{Q==="closing"||l||lt()},ut=Q==="open",nt=Q==="closing",Ut=Le>0?Math.max(0,1-Le/500):1,Ze=Le>0?Math.max(.35,1-Le/500):1,Je=a.useCallback(f=>{if(!(f.propertyName!=="transform"||!H.current)){if(G.current!==null){jt();return}ze(),Xe(!1)}},[ze,Xe,jt]),at=Q==="closing"?ye??S:S,Lt=at&&J&&(Q==="opening"||nt)?Uy(at,J):void 0,It=Ne&&F?kt(F,"center"):Le>0?`translateY(${Le}px)`:Lt,ft=J?Uo(J,_):null,At=!!(at&&J),Ot=At&&(Q==="closing"||Q==="open"&&z),Ht={position:"absolute",top:ft==null?void 0:ft.top,left:ft==null?void 0:ft.left,width:ft==null?void 0:ft.width,height:ft==null?void 0:ft.height,objectFit:"contain",transformOrigin:"top left",transform:It,opacity:Le>0?Ze:At?1:Q==="opening"||nt?0:1,transition:le&&!se?"none":se?`transform ${Qi}ms ${pn}`:j?`transform ${Cn}ms ${pn}, opacity ${Cn}ms ${pn}`:Ot?`transform ${Cn}ms ${pn}`:Q==="opening"||nt?`opacity ${Cn}ms ${pn}`:"none",pointerEvents:He&&ut&&!Ne?"auto":"none",touchAction:He&&ut?"none":void 0,zIndex:1,overflow:He?"hidden":void 0},Vt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:ut&&!Ne?"auto":"none"},xt=(f,be,Fe="adjacent")=>{const We=ht(f);if(!We)return{display:"none"};const st=Fe==="far"?be==="left"?"far-left":"far-right":be==="left"?"left-adjacent":"right-adjacent",{start:Pt}=Pe!==null?Fc(We,st,Pe,_):{start:Fe==="far"?gr(We,be,_):Bi(We,be,_)},et=Uo(Pt,_),mt=kt(f,st),_t=!Ne&&Fe==="adjacent"&&ut&&!Ee?ov(We,be,_):null,Et=Fe==="far"&&Ne&&Pe===(be==="left"?-1:1),cn=le&&!se?!1:se,dn=Fe==="adjacent"&&ut&&Ee&&!Ne;return{position:"absolute",top:et.top,left:et.left,width:et.width,height:et.height,objectFit:"contain",transform:mt??(_t?`translate(${_t.x}px, ${_t.y}px)`:void 0),opacity:Fe==="far"?ut&&Et?1:0:ut?1:0,transition:cn?Fe==="far"?`transform ${Qi}ms ${pn}`:`transform ${Qi}ms ${pn}, opacity ${Cn}ms ${pn}`:dn?`transform ${Cn}ms ${pn}`:Q==="opening"||nt?`opacity ${Cn}ms ${pn}`:"none",pointerEvents:"none",zIndex:1}},Gt=(f,be)=>{const Fe=ht(f);return Fe?nv(Bi(Fe,be,_),be,_):null},Kt=f=>be=>{if(!l){if(A.current){A.current=!1;return}be.stopPropagation(),Tt(f)}},Xt=ne?Gt(ne,"left"):null,Zt=Me?Gt(Me,"right"):null,Dt=Xt?Uo(Xt,_):null,St=Zt?Uo(Zt,_):null;return r.jsxs("div",{ref:I,className:[`${e}-lightbox`,s?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:Q==="open"?"none":void 0},onClick:Rt,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:ut?Ut:0,transition:le?"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:ut?1:0,transition:le?"none":`opacity ${Cn}ms ${pn}`,pointerEvents:"none"},children:r.jsx(gc,{prefix:e,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,onClose:Rt})})]}),ut&&pt&&r.jsx(Ko,{media:pt,style:xt(pt,"left","far"),onMeasure:ot,onTransitionEnd:Je},`far-prev-${pt.url}`),ut&&ne&&r.jsxs(r.Fragment,{children:[r.jsx(Ko,{media:ne,style:xt(ne,"left"),onMeasure:ot,onTransitionEnd:Je},`prev-${ne.url}`),Dt&&r.jsx("div",{style:{position:"absolute",top:Dt.top,left:Dt.left,width:Dt.width,height:Dt.height,cursor:l||le?"default":"pointer",pointerEvents:l||le?"none":"auto",zIndex:3},onClick:Kt(-1)})]}),ut&&Me&&r.jsxs(r.Fragment,{children:[r.jsx(Ko,{media:Me,style:xt(Me,"right"),onMeasure:ot,onTransitionEnd:Je},`next-${Me.url}`),St&&r.jsx("div",{style:{position:"absolute",top:St.top,left:St.left,width:St.width,height:St.height,cursor:l||le?"default":"pointer",pointerEvents:l||le?"none":"auto",zIndex:3},onClick:Kt(1)})]}),ut&&bt&&r.jsx(Ko,{media:bt,style:xt(bt,"right","far"),onMeasure:ot,onTransitionEnd:Je},`far-next-${bt.url}`),J&&F&&(He?r.jsx(rv,{src:F.url,phase:Q,onMediaElement:Ge,wrapperStyle:Ht,videoStyle:Vt,onLoadedMetadata:Te,onTransitionEnd:Je},`${n}-${F.url}`):r.jsx("img",{ref:Ge,src:F.url,alt:F.name,onLoad:Te,onTransitionEnd:Je,style:Ht},`${n}-${F.url}`))]})}const sv=20,lv=.18;function cv(e){return`
|
|
17324
|
+
`}const Cn=500,Qi=650,pn="cubic-bezier(0.22, 1, 0.36, 1)",zy=72,By=50,Vy=1e4,Gy=650,qy=500;function Uy(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 Pc(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=dr(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 Ky(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?Pc(i,n):null}function Xy(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 no(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 gl(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return no(e,i,n)}const Yy=.03;function Ac(e){return e.width*Yy}const ra={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Uo(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function hl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Zy(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 Jy(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:$a(e,t.width,t.height)}function Qy(e,t){if(kr(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 ev(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 tv({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=>kr(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 Bi(e,t,n){const{width:i,height:o,top:s}=e,{left:l,width:d}=n,c=Ac(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 gr(e,t,n){const i=Bi(e,t,n);return{...i,left:2*i.left-e.left}}function nv(e,t,n){const{left:i,width:o}=n,s=Ac(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 Fc(e,t,n,i){const o=Bi(e,"left",i),s=Bi(e,"right",i),l=gr(e,"left",i),d=gr(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 iv(e,t,n,i){const{start:o,end:s}=Fc(e,t,n,i);return{x:s.left-o.left,y:s.top-o.top}}function ov(e,t,n){const i=Bi(e,t,n),o=gr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function kr(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function rv({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 Ko({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return kr(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 av({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:w,sourceRect:v,resolveCloseSourceRect:T,onClose:g,onPrev:$,onNext:f}){const R=a.useRef(null),L=a.useRef(null),I=a.useRef(null),Y=a.useRef(new Map),[P,V]=a.useState(0),M=a.useRef(null),C=a.useRef(0),A=a.useRef(0),y=a.useRef("none"),S=a.useRef(!1),F=a.useRef(!1),W=a.useRef(!1),U=a.useRef(null),G=a.useRef(null),J=a.useRef(null),D=a.useRef(()=>{}),j=a.useRef(null),O=a.useRef(null),E=a.useRef(null),K=a.useRef(!1),[Z,ce]=a.useState(null),[N,pe]=a.useState(ra),[b,he]=a.useState(0),[Q,we]=a.useState("opening"),[Te,se]=a.useState(0),[oe,q]=a.useState(0),[de,ge]=a.useState(!1),[_e,Ce]=a.useState(null),[Me,fe]=a.useState(null),[ye,Se]=a.useState(null),[B,ue]=a.useState(!1),[ve,me]=a.useState(null),[Ee,be]=a.useState(!1),k=a.useRef(!1),[re,te]=a.useState(!1),[z,le]=a.useState(!1),Re=a.useRef(n),ae=a.useRef(void 0),_=t[n],Ne=_?kr(_):!1,Fe=oe!==0||de,et=!l&&(!s||!!d),Ke=c&&!l,Ie=u.length>1,ee=a.useCallback((h,xe)=>t.length<=1?null:t[(h+xe+t.length)%t.length]??null,[t]),ne=Ie?no(u,p,-1):ee(n,-1),He=Ie?no(u,p,1):ee(n,1),st=_e===-1&&Fe?Ie&&Me!==null?no(u,Me,-1):ye!==null?ee(ye,-1):null:null,Be=_e===1&&Fe?Ie&&Me!==null?no(u,Me,1):ye!==null?ee(ye,1):null:null,Oe=st&&st.url!==(ne==null?void 0:ne.url)?st:null,je=Be&&Be.url!==(He==null?void 0:He.url)?Be:null,qe=ne&&Ke?(()=>{const h=Ie?gl(u,p,-1):t.length>2?ee((n-1+t.length)%t.length,-1):null;return h&&h.url!==ne.url?h:null})():null,tt=He&&Ke?(()=>{const h=Ie?gl(u,p,1):t.length>2?ee((n+1)%t.length,1):null;return h&&h.url!==He.url?h:null})():null,mt=Oe??qe,St=je??tt,lt=a.useCallback((h,xe,Pe)=>{if(!h||!xe||!Pe)return;const Ae=Y.current,at=Ae.get(h);(at==null?void 0:at.width)===xe&&(at==null?void 0:at.height)===Pe||(Ae.set(h,{width:xe,height:Pe}),V(At=>At+1))},[]),pt=a.useCallback(h=>{if(!(h!=null&&h.url))return null;const xe=Y.current.get(h.url);return Jy(L.current,xe)},[P,b]),Mt=a.useCallback(()=>{if(!_)return;const h=pt(_);if(h){ce(h);return}const xe=L.current;xe&&ce(hl(xe))},[_,pt]),nt=a.useCallback(h=>{if(Ie){const xe=u.length;fe((p+h+xe)%xe),Se(null);return}t.length>1&&(Se((n+h+t.length)%t.length),fe(null))},[Ie,u.length,p,t.length,n]),Ve=a.useCallback(h=>{W.current=h,ge(h)},[]),De=a.useCallback(()=>{U.current!==null&&(window.clearTimeout(U.current),U.current=null)},[]),vt=a.useCallback(()=>{De(),U.current=window.setTimeout(()=>{De(),Ve(!1)},Qi+32)},[De,Ve]),bt=a.useCallback(()=>{const h=R.current;if(!h){pe({left:0,top:0,width:typeof window<"u"?window.innerWidth:ra.width,height:typeof window<"u"?window.innerHeight:ra.height});return}const xe=h.getBoundingClientRect();pe({left:xe.left,top:xe.top,width:xe.width,height:xe.height})},[]),Pt=a.useCallback((h,xe)=>{if(Fe){if(re&&!de)return`translate(${oe}px, 0px)`;if(de&&_e!==null){const Pe=pt(h);if(!Pe)return;const{x:Ae,y:at}=iv(Pe,xe,_e,N);return`translate(${Ae}px, ${at}px)`}if(de)return"translate(0px, 0px)"}},[Fe,re,de,oe,_e,N,pt]),Dt=a.useCallback(()=>{const h=G.current;G.current=null,De(),Ve(!1),Ce(null),fe(null),Se(null),q(0),te(!1),S.current=!1,A.current=0,y.current="none",h===-1?$():h===1&&f()},[De,Ve,$,f]),tn=a.useCallback(()=>{De(),U.current=window.setTimeout(()=>{G.current!==null&&Dt()},Qi+32)},[De,Dt]),ln=a.useCallback(()=>{De(),G.current=null,Ve(!1),Ce(null),fe(null),Se(null),q(0),te(!1),S.current=!1,A.current=0,y.current="none"},[De,Ve]),Tt=a.useCallback(h=>{if(!(!Ke||!Z)){if(W.current){if(G.current===h){J.current=h,Dt();return}ln()}De(),nt(h),G.current=h,Ce(h),Ve(!0),tn()}},[Ke,Z,Dt,ln,De,nt,Ve,tn]);D.current=Tt;const kt=a.useCallback(()=>{j.current=null,K.current=!1,O.current!==null&&(window.clearInterval(O.current),O.current=null),E.current!==null&&(window.clearTimeout(E.current),E.current=null)},[]),Yt=a.useCallback(h=>{O.current!==null&&window.clearInterval(O.current);const xe=K.current?qy:Gy;O.current=window.setInterval(()=>{D.current(h)},xe)},[]),qt=a.useCallback(h=>{j.current!==h&&(kt(),j.current=h,K.current=!1,D.current(h),Yt(h),E.current=window.setTimeout(()=>{E.current=null,j.current===h&&(K.current=!0,Yt(h))},Vy))},[kt,Yt]),Le=a.useCallback(()=>{const h=L.current;if(!h)return;const xe=_==null?void 0:_.url,Pe=xe?Y.current.get(xe):void 0;if(Pe!=null&&Pe.width&&(Pe!=null&&Pe.height)){ce($a(h,Pe.width,Pe.height));return}const Ae=I.current;if(Ae&&xe&&(Ae.src===xe||Ae.currentSrc===xe)){const{width:At,height:Qe}=Zy(Ae);if(At&&Qe){lt(xe,At,Qe),ce($a(h,At,Qe));return}}const at=hl(h);!at.width||!at.height||ce(at)},[_==null?void 0:_.url,lt]),Ue=a.useCallback(h=>{if(I.current=h,!!h){if(h instanceof HTMLVideoElement){h.readyState>=1&&h.videoWidth>0&&Le();return}h.complete&&h.naturalWidth>0&&Le()}},[Le]),Xe=a.useCallback(()=>{bt(),Le(),he(h=>h+1)},[bt,Le]);a.useEffect(()=>{Xe();const h=L.current,xe=R.current,Pe=new ResizeObserver(()=>Xe());return h&&Pe.observe(h),xe&&Pe.observe(xe),window.addEventListener("resize",Xe),()=>{Pe.disconnect(),window.removeEventListener("resize",Xe)}},[Xe,n,w]),a.useLayoutEffect(()=>{if(!_)return;const h=I.current;if(h){if(h instanceof HTMLImageElement&&h.complete&&h.naturalWidth>0){Le();return}h instanceof HTMLVideoElement&&h.readyState>=1&&h.videoWidth>0&&Le()}},[_==null?void 0:_.url,n,Le]),a.useEffect(()=>{Mt()},[Mt,P]),a.useEffect(()=>{const h=new Set,xe=[],Pe=Ae=>{!(Ae!=null&&Ae.url)||h.has(Ae.url)||(h.add(Ae.url),xe.push(Ae))};t.forEach(Pe),u.forEach(Ae=>Ae.items.forEach(Pe)),xe.forEach(Ae=>{Y.current.has(Ae.url)||Qy(Ae,lt)})},[t,u,lt]),a.useEffect(()=>{if(Q!=="opening"||!Z)return;if(!v){we("open");return}ue(!1);const h=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ue(!0),we("open")})});return()=>cancelAnimationFrame(h)},[Q,Z,v]),a.useEffect(()=>{if(Q!=="closing")return;const h=setTimeout(()=>g(),Cn);return()=>clearTimeout(h)},[Q,g]),a.useEffect(()=>()=>{De()},[De]),a.useLayoutEffect(()=>{Re.current===n&&ae.current===(_==null?void 0:_.url)||(De(),G.current=null,Ce(null),fe(null),Se(null),se(0),q(0),Ve(!1),le(!1),te(!1),C.current=0,A.current=0,y.current="none",S.current=!1,M.current=null,F.current=!1,I.current=null,Mt(),Re.current=n,ae.current=_==null?void 0:_.url)},[n,_==null?void 0:_.url,Ve,De,Mt]),a.useLayoutEffect(()=>{const h=J.current;h!==null&&(J.current=null,requestAnimationFrame(()=>{D.current(h)}))},[n,p,_==null?void 0:_.url]),a.useLayoutEffect(()=>{if(Q==="opening"){k.current=!1,be(!1);return}if(Q!=="open"||k.current)return;if(!ne&&!He){k.current=!0;return}be(!1);const h=requestAnimationFrame(()=>{requestAnimationFrame(()=>{be(!0),k.current=!0})});return()=>cancelAnimationFrame(h)},[Q,ne==null?void 0:ne.url,He==null?void 0:He.url]),a.useEffect(()=>{if(Q!=="open")return;const h=()=>{const Qe=gt=>{gt.stopPropagation(),gt.preventDefault(),document.removeEventListener("click",Qe,!0)};document.addEventListener("click",Qe,!0)},xe=Qe=>{const gt=Qe<0?1:-1;De(),nt(gt),G.current=gt,Ce(gt),Ve(!0),tn()},Pe=Qe=>{if(Math.abs(Qe)>By&&Ke){xe(Qe);return}G.current=null,Ce(null),fe(null),Se(null),Ve(!0),q(0),vt()},Ae=Qe=>{if(Qe.touches.length!==1||W.current)return;const gt=Qe.touches[0];F.current=!0,M.current={x:gt.clientX,y:gt.clientY},y.current="none",A.current=0,S.current=!1},at=Qe=>{if(!M.current||Qe.touches.length!==1||W.current)return;const gt=Qe.touches[0],_t=gt.clientX-M.current.x,Et=gt.clientY-M.current.y;if(y.current==="none"){if(Math.abs(_t)<10&&Math.abs(Et)<10)return;if(Math.abs(_t)>Math.abs(Et)){if(!Ke)return;y.current="horizontal"}else if(Et>0){if(!et)return;y.current="vertical"}else return}if(y.current==="horizontal"){S.current=!0,te(!0),A.current=_t,q(_t),Qe.preventDefault();return}y.current==="vertical"&&(S.current=!0,te(!0),C.current=Et,se(Et),Qe.preventDefault())},At=()=>{if(!M.current)return;const Qe=y.current,gt=S.current;if(gt&&Qe==="horizontal")Pe(A.current),h();else if(gt&&Qe==="vertical"){const _t=C.current;if(et&&_t>zy){const Et=window.innerHeight;C.current=Et,le(!0),se(Et),we("closing")}else C.current=0,se(0);h()}else Qe==="horizontal"&&Math.abs(A.current)>0&&(Pe(A.current),h());M.current=null,y.current="none",A.current=0,S.current=!1,te(!1)};return document.addEventListener("touchstart",Ae,{passive:!0}),document.addEventListener("touchmove",at,{passive:!1}),document.addEventListener("touchend",At),document.addEventListener("touchcancel",At),()=>{document.removeEventListener("touchstart",Ae),document.removeEventListener("touchmove",at),document.removeEventListener("touchend",At),document.removeEventListener("touchcancel",At)}},[Q,Ke,Ve,vt,De,et,tn,nt]);const ct=a.useCallback(()=>{const h=(T==null?void 0:T())??v??null;h&&Z&&(me(h),ue(!0)),we("closing")},[T,v,Z]);a.useEffect(()=>{const h=Ae=>{if(Ae.key==="Escape"){if(s&&d||Q==="closing")return;kt(),ct();return}if(Ae.key!=="ArrowLeft"&&Ae.key!=="ArrowRight"||Q!=="open"||!Ke)return;Ae.preventDefault();const at=Ae.key==="ArrowLeft"?-1:1;Ae.repeat&&j.current===at||qt(at)},xe=Ae=>{if(Ae.key!=="ArrowLeft"&&Ae.key!=="ArrowRight")return;const at=Ae.key==="ArrowLeft"?-1:1;j.current===at&&kt()},Pe=()=>{kt()};return window.addEventListener("keydown",h),window.addEventListener("keyup",xe),window.addEventListener("blur",Pe),()=>{window.removeEventListener("keydown",h),window.removeEventListener("keyup",xe),window.removeEventListener("blur",Pe),kt()}},[Q,s,d,ct,Ke,qt,kt]),a.useEffect(()=>{Q!=="open"&&kt()},[Q,kt]);const Rt=()=>{Q==="closing"||l||ct()},ut=Q==="open",it=Q==="closing",Ut=Te>0?Math.max(0,1-Te/500):1,Ze=Te>0?Math.max(.35,1-Te/500):1,Je=a.useCallback(h=>{if(!(h.propertyName!=="transform"||!W.current)){if(G.current!==null){Dt();return}De(),Ve(!1)}},[De,Ve,Dt]),rt=Q==="closing"?ve??v:v,Lt=rt&&Z&&(Q==="opening"||it)?Uy(rt,Z):void 0,It=Fe&&_?Pt(_,"center"):Te>0?`translateY(${Te}px)`:Lt,ft=Z?Uo(Z,N):null,Ft=!!(rt&&Z),Ot=Ft&&(Q==="closing"||Q==="open"&&B),Ht={position:"absolute",top:ft==null?void 0:ft.top,left:ft==null?void 0:ft.left,width:ft==null?void 0:ft.width,height:ft==null?void 0:ft.height,objectFit:"contain",transformOrigin:"top left",transform:It,opacity:Te>0?Ze:Ft?1:Q==="opening"||it?0:1,transition:re&&!de?"none":de?`transform ${Qi}ms ${pn}`:z?`transform ${Cn}ms ${pn}, opacity ${Cn}ms ${pn}`:Ot?`transform ${Cn}ms ${pn}`:Q==="opening"||it?`opacity ${Cn}ms ${pn}`:"none",pointerEvents:Ne&&ut&&!Fe?"auto":"none",touchAction:Ne&&ut?"none":void 0,zIndex:1,overflow:Ne?"hidden":void 0},Vt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:ut&&!Fe?"auto":"none"},xt=(h,xe,Pe="adjacent")=>{const Ae=pt(h);if(!Ae)return{display:"none"};const at=Pe==="far"?xe==="left"?"far-left":"far-right":xe==="left"?"left-adjacent":"right-adjacent",{start:At}=_e!==null?Fc(Ae,at,_e,N):{start:Pe==="far"?gr(Ae,xe,N):Bi(Ae,xe,N)},Qe=Uo(At,N),gt=Pt(h,at),_t=!Fe&&Pe==="adjacent"&&ut&&!Ee?ov(Ae,xe,N):null,Et=Pe==="far"&&Fe&&_e===(xe==="left"?-1:1),cn=re&&!de?!1:de,dn=Pe==="adjacent"&&ut&&Ee&&!Fe;return{position:"absolute",top:Qe.top,left:Qe.left,width:Qe.width,height:Qe.height,objectFit:"contain",transform:gt??(_t?`translate(${_t.x}px, ${_t.y}px)`:void 0),opacity:Pe==="far"?ut&&Et?1:0:ut?1:0,transition:cn?Pe==="far"?`transform ${Qi}ms ${pn}`:`transform ${Qi}ms ${pn}, opacity ${Cn}ms ${pn}`:dn?`transform ${Cn}ms ${pn}`:Q==="opening"||it?`opacity ${Cn}ms ${pn}`:"none",pointerEvents:"none",zIndex:1}},Gt=(h,xe)=>{const Pe=pt(h);return Pe?nv(Bi(Pe,xe,N),xe,N):null},Kt=h=>xe=>{if(!l){if(F.current){F.current=!1;return}xe.stopPropagation(),Tt(h)}},Xt=ne?Gt(ne,"left"):null,Zt=He?Gt(He,"right"):null,jt=Xt?Uo(Xt,N):null,wt=Zt?Uo(Zt,N):null;return r.jsxs("div",{ref:R,className:[`${e}-lightbox`,s?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:Q==="open"?"none":void 0},onClick:Rt,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:ut?Ut:0,transition:re?"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:L,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{height:"10%"}})]}),r.jsx("div",{style:{position:"absolute",inset:0,opacity:ut?1:0,transition:re?"none":`opacity ${Cn}ms ${pn}`,pointerEvents:"none"},children:r.jsx(gc,{prefix:e,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,onClose:Rt})})]}),ut&&mt&&r.jsx(Ko,{media:mt,style:xt(mt,"left","far"),onMeasure:lt,onTransitionEnd:Je},`far-prev-${mt.url}`),ut&&ne&&r.jsxs(r.Fragment,{children:[r.jsx(Ko,{media:ne,style:xt(ne,"left"),onMeasure:lt,onTransitionEnd:Je},`prev-${ne.url}`),jt&&r.jsx("div",{style:{position:"absolute",top:jt.top,left:jt.left,width:jt.width,height:jt.height,cursor:l||re?"default":"pointer",pointerEvents:l||re?"none":"auto",zIndex:3},onClick:Kt(-1)})]}),ut&&He&&r.jsxs(r.Fragment,{children:[r.jsx(Ko,{media:He,style:xt(He,"right"),onMeasure:lt,onTransitionEnd:Je},`next-${He.url}`),wt&&r.jsx("div",{style:{position:"absolute",top:wt.top,left:wt.left,width:wt.width,height:wt.height,cursor:l||re?"default":"pointer",pointerEvents:l||re?"none":"auto",zIndex:3},onClick:Kt(1)})]}),ut&&St&&r.jsx(Ko,{media:St,style:xt(St,"right","far"),onMeasure:lt,onTransitionEnd:Je},`far-next-${St.url}`),Z&&_&&(Ne?r.jsx(rv,{src:_.url,phase:Q,onMediaElement:Ue,wrapperStyle:Ht,videoStyle:Vt,onLoadedMetadata:Le,onTransitionEnd:Je},`${n}-${_.url}`):r.jsx("img",{ref:Ue,src:_.url,alt:_.name,onLoad:Le,onTransitionEnd:Je,style:Ht},`${n}-${_.url}`))]})}const sv=20,lv=.18;function cv(e){return`
|
|
17325
17325
|
.${e}-wrapper {
|
|
17326
17326
|
box-sizing: border-box;
|
|
17327
17327
|
max-width: 100%;
|
|
@@ -17408,8 +17408,8 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
17408
17408
|
z-index: 2;
|
|
17409
17409
|
pointer-events: auto;
|
|
17410
17410
|
}
|
|
17411
|
-
${
|
|
17412
|
-
`}function dv(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 uv(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 pv(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:
|
|
17411
|
+
${jy(e)}
|
|
17412
|
+
`}function dv(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 uv(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 pv(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:x.scalingValue(o,n??!1),[`--${t}-image-inline-gap`]:x.scalingValue(i*lv,n??!1),[`--${t}-image-aspect`]:dv(e)}}function mv(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 zt(n,t)}function gv(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 hv(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?Pc(d,o):void 0)}}function fv({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:s,portalId:l}){const{prefix:d}=x.useScopedStyles(),c=a.useMemo(()=>cv(d),[d]),u=t??[],p=(e==null?void 0:e.type)??"a",w=typeof(e==null?void 0:e.wrapperWidth)=="number"?e.wrapperWidth:1,v=typeof(e==null?void 0:e.horizontalGap)=="number"?e.horizontalGap:0,T=x.scalingValue(v,n??!1),g=`max(${T}, ${sv}px)`,{objectFitMode:$,imageStyle:f}=gv(e),R=mv(e,n),L=a.useRef(null),[I,Y]=a.useState(!1),[P,V]=a.useState([]),[M,C]=a.useState(0),[A,y]=a.useState(0),[S,F]=a.useState(null),[W,U]=a.useState({title1:"",title2:"",title3:""}),G=(!n||i)&&!I,J=(e==null?void 0:e.imageHoverEffect)??{sizeType:"none",value:120},D=J.sizeType??"none",j=G&&D!=="none"?`${d}-item-image-hover-${D}`:void 0,O=(J.value??120)/100,E=a.useCallback(oe=>{!oe||D!=="scale"||(oe.style.transformOrigin=zp(oe))},[D]),K=a.useCallback(oe=>{if(oe){if($==="contain"){const q=uv(oe);if(q){const de=oe.closest(`.${d}-item-image`);de instanceof HTMLElement&&de.style.setProperty(`--${d}-item-media-aspect`,String(q))}}E(oe)}},[d,E,$]),Z={width:x.scalingValue(w,n??!1),...R,...pv(e,d,n),[`--${d}-image-hover-scale`]:String(O)},ce=(()=>{const oe={},q=L.current?getComputedStyle(L.current).getPropertyValue("--cntrl-article-width").trim():"";return q&&(oe["--cntrl-article-width"]=q),oe})(),N=((e==null?void 0:e.lightbox)??"on")==="on"&&(!n||i||o),pe=a.useMemo(()=>Xy(u),[u]),b=a.useMemo(()=>ev(u),[u]),he=(oe,q)=>{if(((e==null?void 0:e.lightbox)??"on")==="off"||n&&!o&&!i)return;const de=pe.findIndex(_e=>_e.gridIndex===oe);if(de<0)return;const ge=pe[de];y(de),V(ge.items),C(0),U(ge.entry),F(q??null),Y(!0)},Q=a.useCallback(()=>{Y(!1),F(null)},[]),we=a.useCallback(()=>{const oe=pe[A];return!oe||!L.current?S:Ky(L.current,oe.gridIndex,$)??S},[pe,A,S,$]),Te=a.useCallback(oe=>{if(pe.length>1){const q=pe.length,de=(A+oe+q)%q,ge=pe[de];y(de),V(ge.items),C(0),U(ge.entry);return}C(q=>(q+oe+P.length)%P.length)},[pe,A,P.length]),se=pe.length>1||P.length>1;return a.useEffect(()=>{if(!I||typeof document>"u")return;const oe=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=oe}},[I]),a.useEffect(()=>{!n||o||i||Y(!1)},[n,o,i]),a.useEffect(()=>{((e==null?void 0:e.lightbox)??"on")==="off"&&Y(!1)},[e==null?void 0:e.lightbox]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),r.jsx(tv,{mediaList:b}),r.jsx("div",{ref:L,className:`${d}-wrapper ${d}-type-${p}`,style:Z,children:u.map((oe,q)=>{var _e,Ce;const de=!!((_e=oe.image)!=null&&_e.url),ge=hv(!!N,de,q,d,$,he);return r.jsxs("div",{className:`${d}-item`,children:[oe.title?r.jsx("span",{className:`${d}-item-title`,onClick:ge,style:ge?{cursor:"pointer"}:void 0,children:oe.title}):null,(Ce=oe.image)!=null&&Ce.url?r.jsx("span",{className:[`${d}-item-image`,$==="contain"?`${d}-item-image-fit`:void 0,j].filter(Boolean).join(" "),children:oe.image.type==="video"?r.jsx("video",{ref:K,src:oe.image.url,"data-waterfall-index":q,style:f,playsInline:!0,muted:!0,loop:!0,autoPlay:!0,onClick:ge,onLoadedData:Me=>K(Me.currentTarget)}):r.jsx("img",{ref:K,src:oe.image.url,alt:oe.image.name??"","data-waterfall-index":q,style:f,onClick:ge,onLoad:Me=>K(Me.currentTarget)})}):null,q<u.length-1&&r.jsx("div",{className:`${d}-item-gap-host`,style:{width:T},children:o&&!I&&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:g,height:"100%"}})})]},q)})}),I&&((e==null?void 0:e.lightbox)??"on")==="on"&&typeof document<"u"&&e&&(()=>{const oe=(l?document.getElementById(l):null)??document.body;return Yn.createPortal(r.jsx("div",{style:ce,"data-selection":"none",children:r.jsx(av,{prefix:d,items:P,index:M,entry:W,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:se,lightboxEntries:pe,entryIdx:A,layoutId:s,sourceRect:S,resolveCloseSourceRect:we,onClose:Q,onPrev:()=>Te(-1),onNext:()=>Te(1)})}),oe)})()]})}const yv=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
17413
17413
|
import type React from 'react';
|
|
17414
17414
|
import { createPortal } from 'react-dom';
|
|
17415
17415
|
import { CommonComponentProps } from '../props';
|
|
@@ -17923,7 +17923,7 @@ export function Waterfall({
|
|
|
17923
17923
|
</>
|
|
17924
17924
|
);
|
|
17925
17925
|
}
|
|
17926
|
-
`,vv="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>'),Dn={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 xv(e){const t={};return t[Ye(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Ye(e,"fontSettings")]={...Dn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Ye(e,"fontSize")]={...Dn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ye(e,"lineHeight")]={...Dn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ye(e,"letterSpacing")]={...Dn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ye(e,"wordSpacing")]={...Dn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ye(e,"textAlign")]={...Dn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ye(e,"textAppearance")]={...Dn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Vi=Kn.filter(e=>e!=="count"),bv=Vi.reduce((e,t)=>({...e,...xv(t)}),{}),wv=Vi.reduce((e,t)=>({...e,[Ye(t,"fontFamily")]:"Arial",[Ye(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Ye(t,"letterSpacing")]:0,[Ye(t,"wordSpacing")]:0,[Ye(t,"textAlign")]:"left",[Ye(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function aa(e){return Vi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Ye(n,"fontSize")]=i),o!==void 0&&(t[Ye(n,"lineHeight")]=o),t},{})}const Sv={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Vi.map(e=>[Xa[e],Ya(e)]))},Xo={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},$v=[{title:"Salton Sea from Above",...Xo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",objectFit:"cover"}},{title:"Lunar Module Pilot",...Xo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",objectFit:"cover"}},{title:"CSM and Lunar Module LM",...Xo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",objectFit:"cover"}},{title:"David R. Scott During EVA",...Xo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",objectFit:"cover"}}],Cv={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"}},caption:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}},image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"cover",type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]}},required:["image"]},default:$v},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},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"}}},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},imageHoverEffect:{type:"object",scope:"common",title:"Hover",display:{type:"toggle-cycle-numeric-input",enum:["none","scale","saturate"],inputs:{none:"none",scale:"single",saturate:"none"},defaultValue:120,showDash:!1},min:0,max:9999,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},horizontalGap:{type:"number",scope:"layout",title:"Gutter",min:0,display:{type:"range-control"}},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"]}},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"}},titleColor:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title1Color:{type:"string",scope:"common",title:"Title Lightbox",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Lightbox",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Lightbox",display:{type:"palette-color-picker"}},contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",display:{type:"settings-color-picker"}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",min:0,display:{type:"range-control"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...Dn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},titleFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{type:"object",scope:"layout",title:"Text Appearance",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"]}}},...bv},defaults:{type:"a",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightbox:"on",imageHoverEffect:{sizeType:"none",value:120,min:100,max:200},titleColor:"#000000",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:vv,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...wv},layoutDefaults:{d:{wrapperWidth:1,horizontalGap:.006944,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.01,closeIconMaxWidth:.0125,iconMarginRight:.01,titleFontSize:.0625,titleLineHeight:.05555,titleLetterSpacing:-34722e-8,...aa({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098})},m:{wrapperWidth:1,horizontalGap:.026666,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.464864,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,contentMarginTop:.081,closeIconMaxWidth:.081,iconMarginRight:.05405,titleFontSize:.16,titleLineHeight:.13333,...aa({title1FontSize:.04864,title1LineHeight:.056756,title2FontSize:.04864,title2LineHeight:.056756,title3FontSize:.04864,title3LineHeight:.056756})},t:{wrapperWidth:1,horizontalGap:.01302,titleHeaderLayout:"desktop",title1Width:.3,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.026,closeIconMaxWidth:.03906,iconMarginRight:.026,titleFontSize:.07,titleLineHeight:.07,...aa({title1FontSize:.02083,title1LineHeight:.02734,title2FontSize:.02083,title2LineHeight:.02734,title3FontSize:.02083,title3LineHeight:.02734})}},layout:["__componentName__","type","wrapperWidth","imageDisplay","lightbox","imageHoverEffect","horizontalGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","contentMarginTop","closeIconMaxWidth","iconMarginRight","titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"",items:["wrapperWidth","lightbox"]},{type:"row",title:"Image",items:["imageDisplay","imageHoverEffect"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]},{type:"group",title:"Lightbox",items:[Sv]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},Tv={element:fv,id:"waterfall",name:"Waterfall",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/waterfall.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},...Vi.map(e=>({path:`${Ye(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",...Vi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Ye(t,"fontFamily")}`}),{})},schema:Cv,sourceCode:yv},ki=500,Wc="cubic-bezier(0.25, 1, 0.5, 1)",Lv=300,Iv=5,Rv=.15,Ev=.4,Mv=100,wi=100,hl={color:"#000000",hover:"#cccccc"},eo={offset:{x:0,y:0},colors:{pagination:"#cccccc",inactive:"#cccccc",background:"#000000"}},kv={s:{paddingY:5,paddingActive:5,borderRadius:9,dot:4,activeDot:8,gapInactive:9,inset:5},m:{paddingY:7,paddingActive:7,borderRadius:17,dot:8,activeDot:20,gapInactive:22,inset:7},l:{paddingY:10,paddingActive:10,borderRadius:29,dot:20,activeDot:38,gapInactive:26,inset:10}},sa={offset:{x:0,y:0},linkColor:"#cccccc"},fl={sizeType:"drag",value:3},Pv="left";function Av(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)??.02,lineHeight:(e==null?void 0:e.titleLineHeight)??.02,letterSpacing:(e==null?void 0:e.titleLetterSpacing)??0,wordSpacing:(e==null?void 0:e.titleWordSpacing)??0,textAppearance:e==null?void 0:e.titleTextAppearance,textAlign:Pv,color:(e==null?void 0:e.titleColor)??"#000000"};return zt(n,t)}function Si(e,t,n){return`${e}: ${v.scalingValue(t/1440,n)};`}function lo(e,t){return t<=0?0:(e%t+t)%t}function Fv(e,t,n,i){if(!i)return{position:lo(e+t,n),skipTransition:!1};const o=e+t;return o>=0&&o<=n+1?{position:o,skipTransition:!1}:{position:lo(e-1+t,n)+1,skipTransition:!0}}function Wv(e,t){const n=new DOMMatrixReadOnly(window.getComputedStyle(e).transform);return t?n.m41:n.m42}function _v(e,t){const n=document.createElement("div");n.className=t,n.setAttribute("aria-hidden","true"),e.appendChild(n);const i=(p,b)=>{n.style.transform=`translate(${p}px, ${b}px)`;const S=n.getBoundingClientRect();return{x:S.left,y:S.top}},o=i(0,0),s=i(wi,0),l=i(0,wi);e.removeChild(n);const d={x:(s.x-o.x)/wi,y:(s.y-o.y)/wi},c={x:(l.x-o.x)/wi,y:(l.y-o.y)/wi},u=d.x*c.y-c.x*d.y;return{ex:d,ey:c,det:u}}function Nv(e,t,n){const{ex:i,ey:o,det:s}=e;return{x:(t*o.y-n*o.x)/s,y:(i.x*n-i.y*t)/s}}function Hv(e,t){return`
|
|
17926
|
+
`,vv="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>'),jn={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 xv(e){const t={};return t[Ye(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Ye(e,"fontSettings")]={...jn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Ye(e,"fontSize")]={...jn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ye(e,"lineHeight")]={...jn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ye(e,"letterSpacing")]={...jn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ye(e,"wordSpacing")]={...jn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ye(e,"textAlign")]={...jn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ye(e,"textAppearance")]={...jn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Vi=Kn.filter(e=>e!=="count"),bv=Vi.reduce((e,t)=>({...e,...xv(t)}),{}),wv=Vi.reduce((e,t)=>({...e,[Ye(t,"fontFamily")]:"Arial",[Ye(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Ye(t,"letterSpacing")]:0,[Ye(t,"wordSpacing")]:0,[Ye(t,"textAlign")]:"left",[Ye(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function aa(e){return Vi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Ye(n,"fontSize")]=i),o!==void 0&&(t[Ye(n,"lineHeight")]=o),t},{})}const Sv={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Vi.map(e=>[Ya[e],Za(e)]))},Xo={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},$v=[{title:"Salton Sea from Above",...Xo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",objectFit:"cover"}},{title:"Lunar Module Pilot",...Xo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",objectFit:"cover"}},{title:"CSM and Lunar Module LM",...Xo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",objectFit:"cover"}},{title:"David R. Scott During EVA",...Xo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",objectFit:"cover"}}],Cv={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"}},caption:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}},image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"cover",type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]}},required:["image"]},default:$v},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},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"}}},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},imageHoverEffect:{type:"object",scope:"common",title:"Hover",display:{type:"toggle-cycle-numeric-input",enum:["none","scale","saturate"],inputs:{none:"none",scale:"single",saturate:"none"},defaultValue:120,showDash:!1},min:0,max:9999,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},horizontalGap:{type:"number",scope:"layout",title:"Gutter",min:0,display:{type:"range-control"}},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"]}},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"}},titleColor:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title1Color:{type:"string",scope:"common",title:"Title Lightbox",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Lightbox",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Lightbox",display:{type:"palette-color-picker"}},contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",display:{type:"settings-color-picker"}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",min:0,display:{type:"range-control"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...jn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},titleFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{type:"object",scope:"layout",title:"Text Appearance",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"]}}},...bv},defaults:{type:"a",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightbox:"on",imageHoverEffect:{sizeType:"none",value:120,min:100,max:200},titleColor:"#000000",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:vv,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...wv},layoutDefaults:{d:{wrapperWidth:1,horizontalGap:.006944,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.01,closeIconMaxWidth:.0125,iconMarginRight:.01,titleFontSize:.0625,titleLineHeight:.05555,titleLetterSpacing:-34722e-8,...aa({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098})},m:{wrapperWidth:1,horizontalGap:.026666,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.464864,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,contentMarginTop:.081,closeIconMaxWidth:.081,iconMarginRight:.05405,titleFontSize:.16,titleLineHeight:.13333,...aa({title1FontSize:.04864,title1LineHeight:.056756,title2FontSize:.04864,title2LineHeight:.056756,title3FontSize:.04864,title3LineHeight:.056756})},t:{wrapperWidth:1,horizontalGap:.01302,titleHeaderLayout:"desktop",title1Width:.3,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.026,closeIconMaxWidth:.03906,iconMarginRight:.026,titleFontSize:.07,titleLineHeight:.07,...aa({title1FontSize:.02083,title1LineHeight:.02734,title2FontSize:.02083,title2LineHeight:.02734,title3FontSize:.02083,title3LineHeight:.02734})}},layout:["__componentName__","type","wrapperWidth","imageDisplay","lightbox","imageHoverEffect","horizontalGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","contentMarginTop","closeIconMaxWidth","iconMarginRight","titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"",items:["wrapperWidth","lightbox"]},{type:"row",title:"Image",items:["imageDisplay","imageHoverEffect"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]},{type:"group",title:"Lightbox",items:[Sv]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},Tv={element:fv,id:"waterfall",name:"Waterfall",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/waterfall.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},...Vi.map(e=>({path:`${Ye(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",...Vi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Ye(t,"fontFamily")}`}),{})},schema:Cv,sourceCode:yv},ki=500,Wc="cubic-bezier(0.25, 1, 0.5, 1)",Lv=300,Iv=5,Rv=.15,Ev=.4,Mv=100,wi=100,fl={color:"#000000",hover:"#cccccc"},eo={offset:{x:0,y:0},colors:{pagination:"#cccccc",inactive:"#cccccc",background:"#000000"}},kv={s:{paddingY:5,paddingActive:5,borderRadius:9,dot:4,activeDot:8,gapInactive:9,inset:5},m:{paddingY:7,paddingActive:7,borderRadius:17,dot:8,activeDot:20,gapInactive:22,inset:7},l:{paddingY:10,paddingActive:10,borderRadius:29,dot:20,activeDot:38,gapInactive:26,inset:10}},sa={offset:{x:0,y:0},linkColor:"#cccccc"},yl={sizeType:"drag",value:3},Pv="left";function Av(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)??.02,lineHeight:(e==null?void 0:e.titleLineHeight)??.02,letterSpacing:(e==null?void 0:e.titleLetterSpacing)??0,wordSpacing:(e==null?void 0:e.titleWordSpacing)??0,textAppearance:e==null?void 0:e.titleTextAppearance,textAlign:Pv,color:(e==null?void 0:e.titleColor)??"#000000"};return zt(n,t)}function Si(e,t,n){return`${e}: ${x.scalingValue(t/1440,n)};`}function lo(e,t){return t<=0?0:(e%t+t)%t}function Fv(e,t,n,i){if(!i)return{position:lo(e+t,n),skipTransition:!1};const o=e+t;return o>=0&&o<=n+1?{position:o,skipTransition:!1}:{position:lo(e-1+t,n)+1,skipTransition:!0}}function Wv(e,t){const n=new DOMMatrixReadOnly(window.getComputedStyle(e).transform);return t?n.m41:n.m42}function _v(e,t){const n=document.createElement("div");n.className=t,n.setAttribute("aria-hidden","true"),e.appendChild(n);const i=(p,w)=>{n.style.transform=`translate(${p}px, ${w}px)`;const v=n.getBoundingClientRect();return{x:v.left,y:v.top}},o=i(0,0),s=i(wi,0),l=i(0,wi);e.removeChild(n);const d={x:(s.x-o.x)/wi,y:(s.y-o.y)/wi},c={x:(l.x-o.x)/wi,y:(l.y-o.y)/wi},u=d.x*c.y-c.x*d.y;return{ex:d,ey:c,det:u}}function Nv(e,t,n){const{ex:i,ey:o,det:s}=e;return{x:(t*o.y-n*o.x)/s,y:(i.x*n-i.y*t)/s}}function Hv(e,t){return`
|
|
17927
17927
|
.${e}-wrapper {
|
|
17928
17928
|
position: relative;
|
|
17929
17929
|
width: 100%;
|
|
@@ -18193,7 +18193,7 @@ export function Waterfall({
|
|
|
18193
18193
|
from { clip-path: inset(100% 0 0 0); }
|
|
18194
18194
|
to { clip-path: inset(0 0 0 0); }
|
|
18195
18195
|
}
|
|
18196
|
-
`}function Ov({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:s}=v.useScopedStyles(),l=Av(e,n),d=t??[],c=d.length,u=(e==null?void 0:e.trigger)??fl,p=u.sizeType??"drag",b=u.value??fl.value,S=(e==null?void 0:e.direction)??"horizontal",T=(e==null?void 0:e.transition)??"slide",g=(e==null?void 0:e.nav)??"classic",$=(e==null?void 0:e.navSize)??"m",h=kv[$],I=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,R=ee=>v.scalingValue(ee*I,n),E=(e==null?void 0:e.show)??"always",Z=(e==null?void 0:e.controls)??null,P=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,B=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,M=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,C=(e==null?void 0:e.controlsColor)??hl.color,W=(e==null?void 0:e.controlsHoverColor)??hl.hover,y=(e==null?void 0:e.navColor)??eo.colors.inactive,x=(e==null?void 0:e.navPaginationColor)??eo.colors.pagination,A=(e==null?void 0:e.navBackgroundColor)??eo.colors.background,H=(e==null?void 0:e.linkColor)??sa.linkColor,K=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,G=S==="horizontal",Y=p==="click",V=p==="drag",D=p==="auto"&&(!n||!!i),O=!n,L=T==="slide",U=g==="classic",J=E!=="never",ce=E==="on hover",_=v.scalingValue(P,n),de={width:_,height:_,maxWidth:_},w=L&&c>1,[ge,Q]=a.useState(0),[ve,Le]=a.useState(w?1:0),[pe,ae]=a.useState(!1),[q,se]=a.useState(!1),[he,Pe]=a.useState(!1),[Ce,ke]=a.useState(0),[fe,xe]=a.useState(!1),[Se,z]=a.useState(!1),me=a.useRef(!1),ye=a.useRef(ve);ye.current=ve;const ue=a.useRef(null),Ee=a.useRef(null),we=a.useRef(null),k=a.useRef(null),le=a.useCallback(ee=>{me.current=ee,ae(ee)},[]),te=a.useCallback(ee=>{if(c<2||ee===0)return;const ne=ee>0?1:-1,Me=Math.abs(ee);if(xe(!0),le(!0),Q(Oe=>lo(Oe+ee,c)),!L)return;let qe=ye.current,De=!1;for(let Oe=0;Oe<Me;Oe++){const Ve=Fv(qe,ne,c,w);qe=Ve.position,De||(De=Ve.skipTransition)}ye.current=qe,De&&se(!0),Le(qe)},[c,w,L,le]),j=a.useCallback(ee=>{te(ee)},[te]),re=a.useCallback(ee=>{if(c<2)return;const ne=lo(ee,c);if(!(ne===ge&&!me.current)&&(xe(!0),le(!0),Q(ne),L)){const Me=ne+(w?1:0);ye.current=Me,Le(Me)}},[ge,c,w,L,le]);a.useEffect(()=>{if(!pe)return;const ee=window.setTimeout(()=>{if(w&&(ve===0||ve===c+1)){se(!0),Le(ge+1);return}le(!1)},ki);return()=>window.clearTimeout(ee)},[ge,c,w,pe,le,ve]),a.useEffect(()=>{if(!q)return;let ee=0;const ne=requestAnimationFrame(()=>{ee=requestAnimationFrame(()=>{se(!1),le(!1)})});return()=>{cancelAnimationFrame(ne),cancelAnimationFrame(ee)}},[le,q]);const Ie=`${w}:${c}`,ie=a.useRef(Ie);a.useEffect(()=>{if(ie.current===Ie)return;ie.current=Ie;const ee=c>0?Math.min(ge,c-1):0;we.current=null,k.current=null,Pe(!1),ke(0),Q(ee),se(!0),Le(ee+(w?1:0))},[ge,c,w,Ie]),a.useEffect(()=>{if(!fe)return;const ee=window.setTimeout(()=>xe(!1),Lv);return()=>window.clearTimeout(ee)},[fe,ge]),a.useEffect(()=>{if(!D||c<2)return;const ee=Math.max(b,.1)*1e3,ne=window.setInterval(()=>{O&&Se||j(1)},ee);return()=>window.clearInterval(ne)},[b,c,j,D,Se,O]);const F=a.useCallback(ee=>{const ne=we.current;if(!ne||ne.pointerId!==ee.pointerId)return;we.current=null,k.current=null;const Me=ue.current;if(Me!=null&&Me.hasPointerCapture(ee.pointerId)&&Me.releasePointerCapture(ee.pointerId),!ne.isActive){L&&ke(0);return}Pe(!1),ke(0);const De=!(ee.timeStamp-ne.lastTime>Mv)&&Math.abs(ne.velocity)>Ev,Oe=ne.size>0&&Math.abs(ne.offset-ne.baseOffset)>ne.size*Rv;if(!De&&!Oe)return;const Ve=Oe?ne.offset-ne.baseOffset:ne.velocity;let it=1;Oe&&ne.size>0&&(it=Math.max(1,Math.round(Math.abs(Ve)/ne.size))),te(Ve<0?it:-it)},[te,L]);a.useEffect(()=>{const ee=ne=>{k.current===null||ne.pointerId!==k.current||F(ne)};return window.addEventListener("pointerup",ee),window.addEventListener("pointercancel",ee),()=>{window.removeEventListener("pointerup",ee),window.removeEventListener("pointercancel",ee)}},[F]);const He=ee=>{const ne=ue.current;if(!V||c<2||!ne||ee.pointerType==="mouse"&&ee.button!==0)return;me.current&&le(!1);let Me=0;const qe=Ee.current;if(L&&qe){const De=G?qe.offsetWidth:qe.offsetHeight;De>0&&(Me=Wv(qe,G)+ye.current*De,ke(Me))}ne.setPointerCapture(ee.pointerId),k.current=ee.pointerId,we.current={pointerId:ee.pointerId,startClientX:ee.clientX,startClientY:ee.clientY,axes:_v(ne,`${s}-axis-probe`),size:G?ne.offsetWidth:ne.offsetHeight,isActive:!1,baseOffset:Me,offset:Me,lastTime:ee.timeStamp,velocity:0}},Ne=ee=>{const ne=we.current;if(!ne||ne.pointerId!==ee.pointerId)return;if(ee.pointerType==="mouse"&&ee.buttons===0){F(ee);return}const Me=ee.clientX-ne.startClientX,qe=ee.clientY-ne.startClientY,De=ne.axes?Nv(ne.axes,Me,qe):{x:Me,y:qe},Oe=G?De.x:De.y,Ve=G?De.y:De.x,it=ne.baseOffset+Oe;if(!ne.isActive){if(Math.max(Math.abs(Oe),Math.abs(Ve))<Iv)return;if(Math.abs(Ve)>Math.abs(Oe)){const pt=ue.current;pt!=null&&pt.hasPointerCapture(ne.pointerId)&&pt.releasePointerCapture(ne.pointerId),we.current=null,k.current=null,L&&ke(0);return}ne.isActive=!0,Pe(!0)}const Qe=ee.timeStamp-ne.lastTime;Qe>0&&(ne.velocity=(it-ne.offset)/Qe,ne.lastTime=ee.timeStamp),ne.offset=it,L&&ke(it)},tt=ee=>{F(ee)},Ke=G?`translate3d(calc(${-ve*100}% + ${Ce}px), 0, 0)`:`translate3d(0, calc(${-ve*100}% + ${Ce}px), 0)`,Re=w?[d[c-1],...d,d[0]]:d;return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Hv(s,n)}}),r.jsxs("div",{className:ct(`${s}-wrapper`,{[`${s}-transition-reveal`]:T==="reveal",[`${s}-transition-reveal-vertical`]:T==="reveal"&&!G}),onMouseEnter:()=>z(!0),onMouseLeave:()=>z(!1),children:[r.jsxs("div",{className:`${s}-slider-inner`,style:{backgroundColor:"transparent"},children:[r.jsx("div",{ref:ue,className:ct(`${s}-track`,{[`${s}-track-draggable`]:V,[`${s}-track-draggable-vertical`]:V&&!G}),onPointerDown:He,onPointerMove:Ne,onPointerUp:tt,onPointerCancel:tt,onLostPointerCapture:ee=>{k.current===ee.pointerId&&F(ee)},children:r.jsx("div",{ref:Ee,className:ct(`${s}-list`,{[`${s}-list-slide`]:L,[`${s}-list-slide-vertical`]:L&&!G,[`${s}-list-fade`]:!L}),style:L?{transform:Ke,transition:he||q?"none":`transform ${ki}ms ${Wc}`}:void 0,children:Re.map((ee,ne)=>{const Me=w?lo(ne-1,c):ne,De=w&&(ne===0||ne===c+1)?`clone-${ne===0?"start":"end"}`:`slide-${Me}`;return r.jsx("div",{className:ct(`${s}-slide`,{[`${s}-is-active`]:!L&&Me===ge}),children:r.jsx("div",{className:`${s}-slider-item`,children:r.jsx("div",{className:`${s}-img-wrapper`,children:r.jsx("img",{className:ct(`${s}-slider-image`,{[`${s}-contain`]:ee.image.objectFit==="contain",[`${s}-cover`]:ee.image.objectFit==="cover"}),src:ee.image.url,alt:ee.image.name??"",draggable:!1})})})},De)})})}),J&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:ct(`${s}-arrow`,{[`${s}-arrow-prev`]:G,[`${s}-arrow-prev-vertical`]:!G,[`${s}-hover-arrow`]:ce}),style:{color:C,"--arrow-hover-color":W,...de},children:r.jsxs("button",{onClick:ee=>{ee.stopPropagation(),j(-1)},className:`${s}-arrow-inner`,style:{transform:`translate(${v.scalingValue(B,n)}, ${v.scalingValue(M*(G?1:-1),n)}) rotate(${G?"0deg":"90deg"})`},children:[Z&&r.jsx(on,{url:Z,fill:C,hoverFill:W,className:ct(`${s}-arrow-img`,`${s}-mirror`),style:de}),!Z&&r.jsx(yl,{color:C,className:ct(`${s}-arrow-icon`,`${s}-arrow-img`,`${s}-mirror`)})]})}),r.jsx("div",{className:ct(`${s}-arrow`,{[`${s}-arrow-next`]:G,[`${s}-arrow-next-vertical`]:!G,[`${s}-hover-arrow`]:ce}),style:{color:C,"--arrow-hover-color":W,...de},children:r.jsxs("button",{className:`${s}-arrow-inner`,onClick:ee=>{ee.stopPropagation(),j(1)},style:{transform:`translate(${v.scalingValue(B*(G?-1:1),n)}, ${v.scalingValue(M,n)}) rotate(${G?"0deg":"90deg"})`},children:[Z&&r.jsx(on,{url:Z,fill:C,hoverFill:W,className:`${s}-arrow-img`,style:de}),!Z&&r.jsx(yl,{color:C,className:ct(`${s}-arrow-icon`,`${s}-arrow-img`)})]})})]}),Y&&r.jsx("div",{className:`${s}-click-overlay`,onClick:()=>j(1)}),U&&r.jsx("div",{className:ct(`${s}-pagination`,{[`${s}-pagination-inside-bottom`]:G,[`${s}-pagination-inside-left`]:!G}),style:G?{bottom:R(h.inset)}:{left:R(h.inset)},children:r.jsx("div",{className:ct(`${s}-pagination-inner`,{[`${s}-pagination-vertical`]:!G,[`${s}-animate-dots`]:fe}),style:{backgroundColor:A,gap:R(h.gapInactive-h.activeDot+h.dot),...G?{height:R(h.activeDot+h.paddingY*2),paddingTop:R(h.paddingY),paddingBottom:R(h.paddingY),paddingLeft:R(h.paddingActive),paddingRight:R(h.paddingActive)}:{width:R(h.activeDot+h.paddingY*2),paddingLeft:R(h.paddingY),paddingRight:R(h.paddingY),paddingTop:R(h.paddingActive),paddingBottom:R(h.paddingActive)},borderRadius:R(h.borderRadius),transform:`translate(${v.scalingValue(eo.offset.x,n)}, ${v.scalingValue(eo.offset.y,n)})`},children:d.map((ee,ne)=>{const Me=ne===ge,qe=Me?h.activeDot:h.dot;return r.jsx("button",{onClick:()=>re(ne),className:`${s}-pagination-item`,style:{width:R(h.activeDot)},children:r.jsx("div",{className:`${s}-dot`,style:{backgroundColor:Me?x:y,width:R(qe)}})},ne)})},`${$}-${S}`)})]}),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:v.scalingValue(K,n)}}),r.jsx("div",{className:`${s}-caption-text-wrapper`,children:d.map((ee,ne)=>r.jsx("div",{className:ct(`${s}-caption-text`,{[`${s}-with-pointer-events`]:ne===ge&&n,[`${s}-active`]:ne===ge}),style:{...l,width:"max-content",transitionDuration:`${Math.round(ki/2)}ms`},children:r.jsx("div",{className:`${s}-caption-text-inner`,style:{"--link-color":H,"--link-hover-color":H,position:"relative",top:v.scalingValue(sa.offset.y,n),left:v.scalingValue(sa.offset.x,n)},children:r.jsx(hi,{content:ee.imageCaption})})},ne))})]})]})]})}function yl({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 jv=`import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
18196
|
+
`}function Ov({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:s}=x.useScopedStyles(),l=Av(e,n),d=t??[],c=d.length,u=(e==null?void 0:e.trigger)??yl,p=u.sizeType??"drag",w=u.value??yl.value,v=(e==null?void 0:e.direction)??"horizontal",T=(e==null?void 0:e.transition)??"slide",g=(e==null?void 0:e.nav)??"classic",$=(e==null?void 0:e.navSize)??"m",f=kv[$],R=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,L=ee=>x.scalingValue(ee*R,n),I=(e==null?void 0:e.show)??"always",Y=(e==null?void 0:e.controls)??null,P=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,V=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,M=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,C=(e==null?void 0:e.controlsColor)??fl.color,A=(e==null?void 0:e.controlsHoverColor)??fl.hover,y=(e==null?void 0:e.navColor)??eo.colors.inactive,S=(e==null?void 0:e.navPaginationColor)??eo.colors.pagination,F=(e==null?void 0:e.navBackgroundColor)??eo.colors.background,W=(e==null?void 0:e.linkColor)??sa.linkColor,U=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,G=v==="horizontal",J=p==="click",D=p==="drag",j=p==="auto"&&(!n||!!i),O=!n,E=T==="slide",K=g==="classic",Z=I!=="never",ce=I==="on hover",N=x.scalingValue(P,n),pe={width:N,height:N,maxWidth:N},b=E&&c>1,[he,Q]=a.useState(0),[we,Te]=a.useState(b?1:0),[se,oe]=a.useState(!1),[q,de]=a.useState(!1),[ge,_e]=a.useState(!1),[Ce,Me]=a.useState(0),[fe,ye]=a.useState(!1),[Se,B]=a.useState(!1),ue=a.useRef(!1),ve=a.useRef(we);ve.current=we;const me=a.useRef(null),Ee=a.useRef(null),be=a.useRef(null),k=a.useRef(null),re=a.useCallback(ee=>{ue.current=ee,oe(ee)},[]),te=a.useCallback(ee=>{if(c<2||ee===0)return;const ne=ee>0?1:-1,He=Math.abs(ee);if(ye(!0),re(!0),Q(Oe=>lo(Oe+ee,c)),!E)return;let st=ve.current,Be=!1;for(let Oe=0;Oe<He;Oe++){const je=Fv(st,ne,c,b);st=je.position,Be||(Be=je.skipTransition)}ve.current=st,Be&&de(!0),Te(st)},[c,b,E,re]),z=a.useCallback(ee=>{te(ee)},[te]),le=a.useCallback(ee=>{if(c<2)return;const ne=lo(ee,c);if(!(ne===he&&!ue.current)&&(ye(!0),re(!0),Q(ne),E)){const He=ne+(b?1:0);ve.current=He,Te(He)}},[he,c,b,E,re]);a.useEffect(()=>{if(!se)return;const ee=window.setTimeout(()=>{if(b&&(we===0||we===c+1)){de(!0),Te(he+1);return}re(!1)},ki);return()=>window.clearTimeout(ee)},[he,c,b,se,re,we]),a.useEffect(()=>{if(!q)return;let ee=0;const ne=requestAnimationFrame(()=>{ee=requestAnimationFrame(()=>{de(!1),re(!1)})});return()=>{cancelAnimationFrame(ne),cancelAnimationFrame(ee)}},[re,q]);const Re=`${b}:${c}`,ae=a.useRef(Re);a.useEffect(()=>{if(ae.current===Re)return;ae.current=Re;const ee=c>0?Math.min(he,c-1):0;be.current=null,k.current=null,_e(!1),Me(0),Q(ee),de(!0),Te(ee+(b?1:0))},[he,c,b,Re]),a.useEffect(()=>{if(!fe)return;const ee=window.setTimeout(()=>ye(!1),Lv);return()=>window.clearTimeout(ee)},[fe,he]),a.useEffect(()=>{if(!j||c<2)return;const ee=Math.max(w,.1)*1e3,ne=window.setInterval(()=>{O&&Se||z(1)},ee);return()=>window.clearInterval(ne)},[w,c,z,j,Se,O]);const _=a.useCallback(ee=>{const ne=be.current;if(!ne||ne.pointerId!==ee.pointerId)return;be.current=null,k.current=null;const He=me.current;if(He!=null&&He.hasPointerCapture(ee.pointerId)&&He.releasePointerCapture(ee.pointerId),!ne.isActive){E&&Me(0);return}_e(!1),Me(0);const Be=!(ee.timeStamp-ne.lastTime>Mv)&&Math.abs(ne.velocity)>Ev,Oe=ne.size>0&&Math.abs(ne.offset-ne.baseOffset)>ne.size*Rv;if(!Be&&!Oe)return;const je=Oe?ne.offset-ne.baseOffset:ne.velocity;let qe=1;Oe&&ne.size>0&&(qe=Math.max(1,Math.round(Math.abs(je)/ne.size))),te(je<0?qe:-qe)},[te,E]);a.useEffect(()=>{const ee=ne=>{k.current===null||ne.pointerId!==k.current||_(ne)};return window.addEventListener("pointerup",ee),window.addEventListener("pointercancel",ee),()=>{window.removeEventListener("pointerup",ee),window.removeEventListener("pointercancel",ee)}},[_]);const Ne=ee=>{const ne=me.current;if(!D||c<2||!ne||ee.pointerType==="mouse"&&ee.button!==0)return;ue.current&&re(!1);let He=0;const st=Ee.current;if(E&&st){const Be=G?st.offsetWidth:st.offsetHeight;Be>0&&(He=Wv(st,G)+ve.current*Be,Me(He))}ne.setPointerCapture(ee.pointerId),k.current=ee.pointerId,be.current={pointerId:ee.pointerId,startClientX:ee.clientX,startClientY:ee.clientY,axes:_v(ne,`${s}-axis-probe`),size:G?ne.offsetWidth:ne.offsetHeight,isActive:!1,baseOffset:He,offset:He,lastTime:ee.timeStamp,velocity:0}},Fe=ee=>{const ne=be.current;if(!ne||ne.pointerId!==ee.pointerId)return;if(ee.pointerType==="mouse"&&ee.buttons===0){_(ee);return}const He=ee.clientX-ne.startClientX,st=ee.clientY-ne.startClientY,Be=ne.axes?Nv(ne.axes,He,st):{x:He,y:st},Oe=G?Be.x:Be.y,je=G?Be.y:Be.x,qe=ne.baseOffset+Oe;if(!ne.isActive){if(Math.max(Math.abs(Oe),Math.abs(je))<Iv)return;if(Math.abs(je)>Math.abs(Oe)){const mt=me.current;mt!=null&&mt.hasPointerCapture(ne.pointerId)&&mt.releasePointerCapture(ne.pointerId),be.current=null,k.current=null,E&&Me(0);return}ne.isActive=!0,_e(!0)}const tt=ee.timeStamp-ne.lastTime;tt>0&&(ne.velocity=(qe-ne.offset)/tt,ne.lastTime=ee.timeStamp),ne.offset=qe,E&&Me(qe)},et=ee=>{_(ee)},Ke=G?`translate3d(calc(${-we*100}% + ${Ce}px), 0, 0)`:`translate3d(0, calc(${-we*100}% + ${Ce}px), 0)`,Ie=b?[d[c-1],...d,d[0]]:d;return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Hv(s,n)}}),r.jsxs("div",{className:dt(`${s}-wrapper`,{[`${s}-transition-reveal`]:T==="reveal",[`${s}-transition-reveal-vertical`]:T==="reveal"&&!G}),onMouseEnter:()=>B(!0),onMouseLeave:()=>B(!1),children:[r.jsxs("div",{className:`${s}-slider-inner`,style:{backgroundColor:"transparent"},children:[r.jsx("div",{ref:me,className:dt(`${s}-track`,{[`${s}-track-draggable`]:D,[`${s}-track-draggable-vertical`]:D&&!G}),onPointerDown:Ne,onPointerMove:Fe,onPointerUp:et,onPointerCancel:et,onLostPointerCapture:ee=>{k.current===ee.pointerId&&_(ee)},children:r.jsx("div",{ref:Ee,className:dt(`${s}-list`,{[`${s}-list-slide`]:E,[`${s}-list-slide-vertical`]:E&&!G,[`${s}-list-fade`]:!E}),style:E?{transform:Ke,transition:ge||q?"none":`transform ${ki}ms ${Wc}`}:void 0,children:Ie.map((ee,ne)=>{const He=b?lo(ne-1,c):ne,Be=b&&(ne===0||ne===c+1)?`clone-${ne===0?"start":"end"}`:`slide-${He}`;return r.jsx("div",{className:dt(`${s}-slide`,{[`${s}-is-active`]:!E&&He===he}),children:r.jsx("div",{className:`${s}-slider-item`,children:r.jsx("div",{className:`${s}-img-wrapper`,children:r.jsx("img",{className:dt(`${s}-slider-image`,{[`${s}-contain`]:ee.image.objectFit==="contain",[`${s}-cover`]:ee.image.objectFit==="cover"}),src:ee.image.url,alt:ee.image.name??"",draggable:!1})})})},Be)})})}),Z&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:dt(`${s}-arrow`,{[`${s}-arrow-prev`]:G,[`${s}-arrow-prev-vertical`]:!G,[`${s}-hover-arrow`]:ce}),style:{color:C,"--arrow-hover-color":A,...pe},children:r.jsxs("button",{onClick:ee=>{ee.stopPropagation(),z(-1)},className:`${s}-arrow-inner`,style:{transform:`translate(${x.scalingValue(V,n)}, ${x.scalingValue(M*(G?1:-1),n)}) rotate(${G?"0deg":"90deg"})`},children:[Y&&r.jsx(on,{url:Y,fill:C,hoverFill:A,className:dt(`${s}-arrow-img`,`${s}-mirror`),style:pe}),!Y&&r.jsx(vl,{color:C,className:dt(`${s}-arrow-icon`,`${s}-arrow-img`,`${s}-mirror`)})]})}),r.jsx("div",{className:dt(`${s}-arrow`,{[`${s}-arrow-next`]:G,[`${s}-arrow-next-vertical`]:!G,[`${s}-hover-arrow`]:ce}),style:{color:C,"--arrow-hover-color":A,...pe},children:r.jsxs("button",{className:`${s}-arrow-inner`,onClick:ee=>{ee.stopPropagation(),z(1)},style:{transform:`translate(${x.scalingValue(V*(G?-1:1),n)}, ${x.scalingValue(M,n)}) rotate(${G?"0deg":"90deg"})`},children:[Y&&r.jsx(on,{url:Y,fill:C,hoverFill:A,className:`${s}-arrow-img`,style:pe}),!Y&&r.jsx(vl,{color:C,className:dt(`${s}-arrow-icon`,`${s}-arrow-img`)})]})})]}),J&&r.jsx("div",{className:`${s}-click-overlay`,onClick:()=>z(1)}),K&&r.jsx("div",{className:dt(`${s}-pagination`,{[`${s}-pagination-inside-bottom`]:G,[`${s}-pagination-inside-left`]:!G}),style:G?{bottom:L(f.inset)}:{left:L(f.inset)},children:r.jsx("div",{className:dt(`${s}-pagination-inner`,{[`${s}-pagination-vertical`]:!G,[`${s}-animate-dots`]:fe}),style:{backgroundColor:F,gap:L(f.gapInactive-f.activeDot+f.dot),...G?{height:L(f.activeDot+f.paddingY*2),paddingTop:L(f.paddingY),paddingBottom:L(f.paddingY),paddingLeft:L(f.paddingActive),paddingRight:L(f.paddingActive)}:{width:L(f.activeDot+f.paddingY*2),paddingLeft:L(f.paddingY),paddingRight:L(f.paddingY),paddingTop:L(f.paddingActive),paddingBottom:L(f.paddingActive)},borderRadius:L(f.borderRadius),transform:`translate(${x.scalingValue(eo.offset.x,n)}, ${x.scalingValue(eo.offset.y,n)})`},children:d.map((ee,ne)=>{const He=ne===he,st=He?f.activeDot:f.dot;return r.jsx("button",{onClick:()=>le(ne),className:`${s}-pagination-item`,style:{width:L(f.activeDot)},children:r.jsx("div",{className:`${s}-dot`,style:{backgroundColor:He?S:y,width:L(st)}})},ne)})},`${$}-${v}`)})]}),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:x.scalingValue(U,n)}}),r.jsx("div",{className:`${s}-caption-text-wrapper`,children:d.map((ee,ne)=>r.jsx("div",{className:dt(`${s}-caption-text`,{[`${s}-with-pointer-events`]:ne===he&&n,[`${s}-active`]:ne===he}),style:{...l,width:"max-content",transitionDuration:`${Math.round(ki/2)}ms`},children:r.jsx("div",{className:`${s}-caption-text-inner`,style:{"--link-color":W,"--link-hover-color":W,position:"relative",top:x.scalingValue(sa.offset.y,n),left:x.scalingValue(sa.offset.x,n)},children:r.jsx(hi,{content:ee.imageCaption})})},ne))})]})]})]})}function vl({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 Dv=`import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
18197
18197
|
import cn from 'classnames';
|
|
18198
18198
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
18199
18199
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -19304,7 +19304,7 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
|
|
|
19304
19304
|
</svg>
|
|
19305
19305
|
);
|
|
19306
19306
|
}
|
|
19307
|
-
`,
|
|
19307
|
+
`,jv={type:"object",version:1,settings:{sizing:"manual",properties:{trigger:{type:"object",scope:"common",title:"Trigger",display:{type:"toggle-cycle-numeric-input",enum:["click","drag","auto"],inputs:{click:"none",drag:"none",auto:"single"},defaultValue:3,showDash:!1},min:1,max:5,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},direction:{type:"string",scope:"common",title:"Direction",display:{type:"toggle-cycle",enum:["horizontal","vertical"]}},transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["slide","fade in","reveal"]}},nav:{type:"string",scope:"common",title:"Nav",display:{type:"toggle-cycle",enum:["classic","no"]}},navSize:{type:"string",scope:"layout",title:"Nav Size",display:{type:"toggle-cycle",enum:["s","m","l"]}},navUnit:{type:"number",scope:"layout",title:"",display:{type:"numeric-input",visible:!1},min:0,max:1},controls:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},controlsMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"numeric-input"},min:0,max:9999},show:{type:"string",scope:"common",title:"Show",display:{type:"toggle-cycle",enum:["always","on hover","never"]}},paddingX:{type:"number",scope:"layout",title:"Padding X",display:{type:"numeric-input"},min:-9999,max:9999},paddingY:{type:"number",scope:"layout",title:"Padding Y",display:{type:"numeric-input"},min:-9999,max:9999},controlsColor:{type:"string",scope:"common",title:"Controls Default",display:{type:"palette-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Controls Hover",display:{type:"palette-color-picker"}},navColor:{type:"string",scope:"common",title:"Dot Nav",display:{type:"palette-color-picker"}},navPaginationColor:{type:"string",scope:"common",title:"Active Nav",display:{type:"palette-color-picker"}},navBackgroundColor:{type:"string",scope:"common",title:"BG Nav",display:{type:"palette-color-picker"}},linkColor:{type:"string",scope:"common",title:"Link Default",display:{type:"palette-color-picker"}},titleColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{type:"object",scope:"common",title:"",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},titleFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{type:"object",scope:"layout",title:"Text Appearance",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"]}}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:100,display:{type:"range-control"}}},defaults:{trigger:{sizeType:"drag",value:3,min:1,max:5},direction:"horizontal",transition:"slide",nav:"classic",controls:null,show:"always",controlsColor:"#000000",controlsHoverColor:"#3F3F3F",navColor:"#A4A4A4",navPaginationColor:"#FFFFFF",navBackgroundColor:"#000000",linkColor:"#2E12F0",titleColor:"#000000",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{d:{controlsMaxWidth:30/1440,paddingX:0,paddingY:0,captionMarginTop:10/1440,titleFontSize:16/1440,titleLineHeight:16/1440,navSize:"m",navUnit:1/1440},t:{controlsMaxWidth:30/768,paddingX:-10/768,paddingY:0,captionMarginTop:10/768,titleFontSize:16/768,titleLineHeight:16/768,navSize:"m",navUnit:1/768},m:{controlsMaxWidth:30/375,paddingX:-14/375,paddingY:0,captionMarginTop:10/375,titleFontSize:16/375,titleLineHeight:16/375,navSize:"m",navUnit:1/375}},displayRules:[{if:{name:"show",value:"never"},then:{name:"properties.controlsColor.display.visible",value:!1}},{if:{name:"show",value:"never"},then:{name:"properties.controlsHoverColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navPaginationColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navBackgroundColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navSize.display.visible",value:!1}}],layout:["__componentName__","trigger","direction","transition","nav","navSize","controls","controlsMaxWidth","show","paddingX","paddingY","captionMarginTop","titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["trigger","direction"]},{type:"row",title:"",items:["transition","nav"]},{type:"row",title:"",items:["navSize"]},{type:"group",title:"Controls",items:[{type:"row",title:"",items:["controls","controlsMaxWidth"]},{type:"row",title:"",items:["paddingX","paddingY"]},{type:"row",title:"",items:["show"]}]}]},{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"]}]}],paletteBookmark:{items:["controlsColor","controlsHoverColor","navPaginationColor","navColor","navBackgroundColor","titleColor","linkColor"],panelIds:["general","typeStyle"]},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/Component-default-1.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Earth-orbital mission"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Salton Sea from Above"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Lunar Module Pilot"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Lunar Module 3 porch"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Command Module"}]}]}]}},zv={element:Ov,id:"slider-2-0",name:"Slider 2.0",category:"galleries",version:1,defaultSize:{d:{width:400,height:400},t:{width:400,height:400},m:{width:300,height:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Slider.mp4"},schema:jv,sourceCode:Dv,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls"}]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily"}},Ca=300/1440,Bv=8/1440,io=.004;function Vv(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function xl(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function bl(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:x.scalingValue((o-t)/2,i)}}function Gv(e){return`
|
|
19308
19308
|
.${e}-wrapper {
|
|
19309
19309
|
box-sizing: border-box;
|
|
19310
19310
|
display: flex;
|
|
@@ -19349,12 +19349,25 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
|
|
|
19349
19349
|
}
|
|
19350
19350
|
.${e}-title-text {
|
|
19351
19351
|
display: block;
|
|
19352
|
-
width:
|
|
19352
|
+
width: 100%;
|
|
19353
19353
|
max-width: 100%;
|
|
19354
19354
|
white-space: pre-wrap;
|
|
19355
19355
|
overflow-wrap: anywhere;
|
|
19356
19356
|
word-break: break-word;
|
|
19357
19357
|
}
|
|
19358
|
+
.${e}-title-text-inner {
|
|
19359
|
+
display: flex;
|
|
19360
|
+
flex-direction: column;
|
|
19361
|
+
box-sizing: border-box;
|
|
19362
|
+
min-width: 0;
|
|
19363
|
+
outline: 1px solid #FF5C02;
|
|
19364
|
+
}
|
|
19365
|
+
.${e}-title-text-inner-hidden {
|
|
19366
|
+
display: flex;
|
|
19367
|
+
flex-direction: column;
|
|
19368
|
+
box-sizing: border-box;
|
|
19369
|
+
min-width: 0;
|
|
19370
|
+
}
|
|
19358
19371
|
.${e}-title-position-left,
|
|
19359
19372
|
.${e}-title-position-center,
|
|
19360
19373
|
.${e}-title-position-right {
|
|
@@ -19470,7 +19483,7 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
|
|
|
19470
19483
|
width: var(--cntrl-article-width, 100vw) !important;
|
|
19471
19484
|
height: var(--cntrl-viewport-height, 100vh) !important;
|
|
19472
19485
|
}
|
|
19473
|
-
`}const qv="rgba(28,31,34,0.9)",Rn=500,ci="cubic-bezier(0.22, 1, 0.36, 1)",Uv=72,Kv=50,Xv={titleColor:"title-color",lightboxCounterColor:"lightbox-counter-color"},Yv=[];function Zv(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 Jv(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Qv(e){const[t]=e.media;return t!=null&&t.url?t:null}function e0(e){if(!Array.isArray(e)||e.length===0)return[];if(Zv(e)){const t=[];for(const n of e){const i=Jv(n);if(!i)continue;const o=Qv(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 Ca(e){return e.type==="video"}function t0(e){e.pause(),e.removeAttribute("src"),e.load()}function Yo(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function n0(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function i0(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function o0({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()=>{t0(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 r0({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",S=a.useRef(null),T=a.useRef(null),g=a.useRef(null),$=a.useRef(0),h=a.useRef(0),I=a.useRef("none"),R=a.useRef(!1),E=a.useRef(!1),Z=a.useRef(!1),P=a.useRef(null),[B,M]=a.useState(null),[C,W]=a.useState("opening"),[y,x]=a.useState(0),[A,H]=a.useState(0),[K,G]=a.useState(!1),[Y,V]=a.useState(!1),[D,O]=a.useState(!1),L=a.useRef(n),U=t[n],J=U?Ca(U):!1,ce=A!==0||K,_=a.useCallback(fe=>{Z.current=fe,G(fe)},[]),de=a.useCallback(()=>{P.current!==null&&(window.clearTimeout(P.current),P.current=null)},[]),w=a.useCallback(()=>{de(),P.current=window.setTimeout(()=>{de(),_(!1)},Rn+32)},[de,_]),ge=a.useCallback(()=>{const fe=S.current,xe=T.current;if(!fe)return;const Se=fe.getBoundingClientRect(),z=Se.width,me=Se.height;if(!z||!me)return;if(i==="cover"){M({width:z,height:me,left:Se.left,top:Se.top});return}if(!xe){M(Yo(fe));return}const{width:ye,height:ue}=n0(xe);if(!ye||!ue){M(Yo(fe));return}const Ee=ye/ue,we=z/me;if(Ee>we){const k=z/Ee;M({width:z,height:k,left:Se.left,top:Se.top+(me-k)/2})}else{const k=me*Ee;M({width:k,height:me,left:Se.left+(z-k)/2,top:Se.top})}},[i]);a.useEffect(()=>{ge();const fe=S.current;if(!fe)return;const xe=new ResizeObserver(()=>ge());return xe.observe(fe),()=>xe.disconnect()},[ge,n]),a.useEffect(()=>{C==="opening"&&B&&W("open")},[C,B]),a.useEffect(()=>{if(C!=="closing")return;const fe=setTimeout(()=>s(),Rn);return()=>clearTimeout(fe)},[C,s]),a.useEffect(()=>()=>{de()},[de]),a.useLayoutEffect(()=>{if(L.current===n)return;de(),x(0),H(0),_(!1),O(!1),V(!1),$.current=0,h.current=0,I.current="none",R.current=!1,g.current=null,E.current=!1;const fe=S.current;fe&&M(Yo(fe)),L.current=n},[n,_,de]),a.useEffect(()=>{if(C!=="open")return;let fe=null;const xe=()=>{fe&&(document.removeEventListener("click",fe,!0),fe=null)},Se=()=>{xe(),fe=we=>{we.stopPropagation(),we.preventDefault(),xe()},document.addEventListener("click",fe,!0)},z=we=>{de(),Z.current=!1,G(!1),H(0),V(!1),R.current=!1,h.current=0,I.current="none";const k=S.current;k&&M(Yo(k)),we<0?d():l()},me=we=>{if(Math.abs(we)>Kv&&t.length>1){z(we);return}_(!0),H(0),w()},ye=we=>{if(we.touches.length!==1||Z.current)return;const k=we.touches[0];E.current=!0,g.current={x:k.clientX,y:k.clientY},I.current="none",h.current=0,R.current=!1},ue=we=>{if(!g.current||we.touches.length!==1||Z.current)return;const k=we.touches[0],le=k.clientX-g.current.x,te=k.clientY-g.current.y;if(I.current==="none"){if(Math.abs(le)<10&&Math.abs(te)<10)return;if(Math.abs(le)>Math.abs(te)){if(t.length<=1)return;I.current="horizontal"}else if(te>0)I.current="vertical";else return}if(I.current==="horizontal"){R.current=!0,V(!0),h.current=le,H(le),we.preventDefault();return}I.current==="vertical"&&(R.current=!0,V(!0),$.current=te,x(te),we.preventDefault())},Ee=()=>{if(!g.current)return;const we=I.current,k=R.current;if(k&&we==="horizontal")me(h.current),Se();else if(k&&we==="vertical")if($.current>Uv){const te=window.innerHeight;$.current=te,O(!0),x(te),W("closing")}else $.current=0,x(0),Se();else we==="horizontal"&&Math.abs(h.current)>0&&(me(h.current),Se());g.current=null,I.current="none",h.current=0,R.current=!1,V(!1)};return document.addEventListener("touchstart",ye,{passive:!0}),document.addEventListener("touchmove",ue,{passive:!1}),document.addEventListener("touchend",Ee),document.addEventListener("touchcancel",Ee),()=>{document.removeEventListener("touchstart",ye),document.removeEventListener("touchmove",ue),document.removeEventListener("touchend",Ee),document.removeEventListener("touchcancel",Ee),xe()}},[C,t.length,d,l,_,w,de]),a.useEffect(()=>{const fe=xe=>{xe.key==="Escape"&&(xe.preventDefault(),xe.stopPropagation(),C!=="closing"&&W("closing"))};return window.addEventListener("keydown",fe,!0),()=>window.removeEventListener("keydown",fe,!0)},[C]);const Q=()=>{C!=="closing"&&W("closing")},ve=C==="open",Le=C==="closing",pe=y>0?Math.max(0,1-y/500):1,ae=y>0?Math.max(.35,1-y/500):1,q=fe=>{if(fe.stopPropagation(),E.current){E.current=!1;return}if(t.length<=1)return;const xe=fe.currentTarget.getBoundingClientRect(),Se=fe.clientY-xe.top,z=Math.min(52,xe.height*.2);if(!(Se>xe.height-z)){if(fe.clientX-xe.left<xe.width/2){l();return}d()}},se=fe=>{if(t.length<=1)return;const xe=fe.currentTarget.getBoundingClientRect(),Se=fe.clientX-xe.left,z=fe.clientY-xe.top,me=Math.min(52,xe.height*.2);if(z>xe.height-me){fe.currentTarget.style.cursor="default";return}fe.currentTarget.style.cursor=Se<xe.width/2?"w-resize":"e-resize"},he=a.useCallback(fe=>{fe.propertyName!=="transform"||!Z.current||(de(),_(!1))},[de,_]),Pe=ce?`translateX(${A}px)`:y>0?`translateY(${y}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:Pe,opacity:y>0?ae:C==="opening"||Le?0:1,transition:Y&&!K?"none":K?`transform ${Rn}ms ${ci}`:D?`transform ${Rn}ms ${ci}, opacity ${Rn}ms ${ci}`:C==="opening"||Le?`opacity ${Rn}ms ${ci}`:"none",pointerEvents:J&&ve&&!ce?"auto":"none",touchAction:J&&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:Q,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:ve?pe:0,transition:Y?"none":`opacity ${Rn}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:S,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 ${Rn}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:S,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 ${Rn}ms ${ci}`},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),B&&U&&(J?r.jsx(o0,{src:U.url,phase:C,mediaRef:T,mediaStyle:Ce,onLoadedMetadata:ge,onClick:q,onMouseMove:se,onTransitionEnd:he},`${n}-${U.url}`):r.jsx("img",{ref:T,src:U.url,alt:U.name,onLoad:ge,onTransitionEnd:he,style:Ce},`${n}-${U.url}`)),ve&&ke&&t.length>1&&!J&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...ke,left:B.left,cursor:"w-resize",pointerEvents:ce?"none":"auto"},onClick:fe=>{if(E.current){E.current=!1;return}fe.stopPropagation(),l()}}),r.jsx("div",{style:{...ke,left:B.left+B.width/2,cursor:"e-resize",pointerEvents:ce?"none":"auto"},onClick:fe=>{if(E.current){E.current=!1;return}fe.stopPropagation(),d()}})]})]})}function wl({P:e,media:t,imgWidth:n,cornerRadius:i,fillGalleryWidth:o,isEditor:s,galleryPaddingBetween:l=0,showPaddingAfter:d=!1,showControls:c=!1,onMediaClick:u}){const p=`${e}-gallery-${Ca(t)?"video":"image"}`,b={...o?{width:"100%",maxWidth:"100%"}:n?{width:v.scalingValue(n,s??!1),maxWidth:"100%"}:{},...i?{borderRadius:v.scalingValue(i,s??!1)}:{},...u?{cursor:"pointer",pointerEvents:"auto"}:{}},T={className:p,style:b,onClick:u?I=>{I.stopPropagation(),u()}:void 0},g=Math.max(l,io),$=I=>v.scalingValue(I,s??!1),h=Ca(t)?r.jsx("video",{...T,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):r.jsx("img",{...T,src:t.url,alt:t.name??""});return r.jsxs("div",{className:`${e}-gallery-item`,children:[h,d&&l>0&&r.jsx("div",{className:`${e}-padding-handle`,style:{height:$(l)},"aria-hidden":"true"}),c&&d&&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:$(g)}})]})}function a0({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==="b"?o:0,S=b>0||c;return r.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="b"&&S&&r.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(b)},"aria-hidden":"true"}),c&&t==="b"&&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"&&S&&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 la({P:e,title:t,position:n,transition:i,opacity:o,titleRef:s,titleClassName:l,titleContainerStyle:d,titleStyle:c}){const u=a.useRef(null),[p,b]=a.useState(0),S=t??"";a.useLayoutEffect(()=>{const g=u.current;if(!g||typeof ResizeObserver>"u")return;const $=()=>b(g.offsetHeight);$();const h=new ResizeObserver($);return h.observe(g),()=>h.disconnect()},[S]);const T=i==="fade"?o:1;return r.jsx("div",{ref:g=>{u.current=g,s(g)},className:[l,`${e}-title-position-${n}`].join(" "),style:{[`--${e}-title-height`]:`${p}px`,opacity:T,...d},children:r.jsx("span",{className:`${e}-title-text`,style:c,children:S})})}const Sl=45;function s0(e,t,n){if(t==="top"){const o=n&&parseFloat(getComputedStyle(n).top)||0;return Math.abs(e.top-o)}const i=e.top+e.height/2;return Math.abs(i-window.innerHeight/2)}function l0(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=s0(u,n,c);return Math.exp(-(p*p)/(2*Sl*Sl))});let o=0,s=-1;return i.forEach((l,d)=>{l>s&&(s=l,o=d)}),{opacities:i,dominantIndex:o}}function c0(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(l0(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 d0(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 u0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:s}){var ne;const{prefix:l}=v.useScopedStyles(),d=a.useMemo(()=>Gv(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)??vl,S=(e==null?void 0:e.cornerRadius)??Bv,T=(e==null?void 0:e.position)??"center",g=(e==null?void 0:e.titleTopPadding)??0,$=(e==null?void 0:e.transition)??"default",h=(e==null?void 0:e.lightbox)??"on",I=p==="c",R=$!=="default",{setTitleRef:E,opacities:Z,dominantIndex:P}=c0(c.length,R,T),B=((ne=c[P])==null?void 0:ne.title)??"",M=d0(B,$==="retype"),C=$==="retype"||$==="scroll",W=$==="retype"?M:B,y=I?void 0:{width:v.scalingValue(b,n??!1)},x=h==="on"&&(!n||i||o),A=o??!1,H=(e==null?void 0:e.galleryPaddingRight)??0,K=(e==null?void 0:e.galleryPaddingLeft)??0,G=(e==null?void 0:e.galleryPaddingBetween)??0,Y=Me=>v.scalingValue(Me,n??!1),V=`calc(100% - ${Y(b)})`,D=I?{width:"100%"}:{width:V,marginLeft:p==="b"?Y(b):void 0},O=Math.max(H,io),L=Math.max(K,io),U=Math.max(G,io),J=Math.max(g,io),ce=Math.max(0,(u??1)-(b??vl)),_=I?{left:0,width:"100%"}:p==="a"?{right:Y(H),width:Y(b)}:{left:Y(K),width:Y(b)},{titleColor:de,titleFontFamily:w,titleFontSettings:ge,titleFontSize:Q,titleLineHeight:ve,titleLetterSpacing:Le,titleWordSpacing:pe,titleAlign:ae,titleTextAppearance:q,lightboxCounterColor:se,lightboxCounterFontFamily:he,lightboxCounterFontSettings:Pe,lightboxCounterFontSize:Ce,lightboxCounterLineHeight:ke,lightboxCounterLetterSpacing:fe,lightboxCounterWordSpacing:xe,lightboxCounterTextAppearance:Se}=e??{},z={fontSettings:{fontFamily:w,fontWeight:(ge==null?void 0:ge.fontWeight)??400,fontStyle:(ge==null?void 0:ge.fontStyle)??"normal"},fontSize:Q??.01,lineHeight:ve,letterSpacing:Le??0,wordSpacing:pe??0,textAlign:ae??"left",textAppearance:q,color:de??"#000000"},ye=nn(zt(z,n)),ue=bl(Q,ve,l,n),Ee=xl(Q,ve,`${l}-title`,`${l}-text-tight-leading`),we={fontSettings:{fontFamily:he,fontWeight:(Pe==null?void 0:Pe.fontWeight)??400,fontStyle:(Pe==null?void 0:Pe.fontStyle)??"normal"},fontSize:Ce??.01,lineHeight:ke,letterSpacing:fe??0,wordSpacing:xe??0,textAppearance:Se,color:se??"#DEDDDD"},le={...nn(zt(we,n)),...bl(Ce,ke,l,n)},te=xl(Ce,ke,`${l}-lightbox-counter`,`${l}-text-tight-leading`),j=v.buildColorVars(l,{titleColor:de??"#000000",lightboxCounterColor:se??"#DEDDDD"},Xv,Yv),re=a.useRef(null),[Ie,ie]=a.useState(!1),[F,He]=a.useState([]),[Ne,tt]=a.useState(0),Ke=a.useCallback((Me,qe)=>{x&&(He(Me),tt(qe),ie(!0))},[x]),Re=a.useCallback(()=>{ie(!1)},[]),ee=a.useMemo(()=>{const Me={...j},qe=re.current?getComputedStyle(re.current).getPropertyValue("--cntrl-article-width").trim():"";return qe&&(Me["--cntrl-article-width"]=qe),Me},[j,Ie]);return a.useEffect(()=>{if(!Ie||h!=="on"||typeof document>"u")return;const Me=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Me}},[Ie,h]),a.useEffect(()=>{!n||o||i||ie(!1)},[n,o,i]),a.useEffect(()=>{h==="off"&&ie(!1)},[h]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),r.jsx("div",{style:j,children:r.jsxs("div",{ref:re,className:`${l}-wrapper`,style:{width:v.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:T==="top"?Y(g):void 0},children:[A&&T==="top"&&r.jsx("div",{"data-controls":"titleTopPadding","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(J)}}),C&&r.jsx("div",{className:`${l}-single-title-layer`,children:r.jsx(la,{P:l,title:W,position:T,transition:$,opacity:1,titleRef:()=>{},titleClassName:`${Ee} ${l}-single-title`,titleContainerStyle:{...ue,...D},titleStyle:ye})}),c.map((Me,qe)=>{const De=e0(Me.gallery),Oe=qe<c.length-1,Ve=De.filter(Qe=>Qe.lightboxMedia).map(Qe=>Qe.lightboxMedia),it={P:l,position:T,transition:$,opacity:Z[qe]??0,titleRef:E(qe),titleClassName:Ee,titleContainerStyle:ue,titleStyle:ye};return r.jsxs("div",{"data-item-index":qe,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:Oe?Y(G):void 0},children:[A&&Oe&&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:Y(U),..._}}),I?r.jsxs("div",{className:`${l}-gallery`,children:[r.jsx("div",{className:`${l}-gallery-media`,children:De.map(({displayMedia:Qe,lightboxMedia:pt},bt)=>{const ot=pt?Ve.findIndex(ht=>ht.url===pt.url):-1;return r.jsx(wl,{P:l,media:Qe,imgWidth:b||void 0,cornerRadius:S||void 0,isEditor:n,galleryPaddingBetween:G,showPaddingAfter:bt<De.length-1,showControls:A,onMediaClick:x&&ot>=0?()=>Ke(Ve,ot):void 0},`${Qe.url}-${bt}`)})}),r.jsx("div",{className:`${l}-title-layer`,children:r.jsx(la,{...it,title:C?"":Me.title})})]}):r.jsxs(r.Fragment,{children:[r.jsx(la,{...it,title:C?"":Me.title}),De.length>0&&r.jsx(a0,{P:l,layoutType:p,galleryWidthStyle:y,galleryPaddingRight:H,galleryPaddingLeft:K,galleryPaddingRightWidth:O,galleryPaddingLeftWidth:L,galleryPaddingMaxFraction:ce,showControls:A,scaled:Y,children:De.map(({displayMedia:Qe,lightboxMedia:pt},bt)=>{const ot=pt?Ve.findIndex(ht=>ht.url===pt.url):-1;return r.jsx(wl,{P:l,media:Qe,cornerRadius:S||void 0,fillGalleryWidth:!0,isEditor:n,galleryPaddingBetween:G,showPaddingAfter:bt<De.length-1,showControls:A,onMediaClick:x&&ot>=0?()=>Ke(Ve,ot):void 0},`${Qe.url}-${bt}`)})})]})]},qe)})]})}),Ie&&h==="on"&&typeof document<"u"&&e&&(()=>{const Me=(s?document.getElementById(s):null)??document.body;return Yn.createPortal(r.jsx("div",{style:ee,"data-selection":"none",children:r.jsx(r0,{prefix:l,items:F,index:Ne,imageDisplay:i0(e.lightboxImageDisplay),isEditor:n,onClose:Re,onPrev:()=>tt(qe=>(qe-1+F.length)%F.length),onNext:()=>tt(qe=>(qe+1)%F.length),counterClassName:te,counterStyle:le,backgroundColor:e.backgroundColor??qv})}),Me)})()]})}const p0=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
19486
|
+
`}const qv="rgba(28,31,34,0.9)",Rn=500,ci="cubic-bezier(0.22, 1, 0.36, 1)",Uv=72,Kv=50,Xv={titleColor:"title-color",lightboxCounterColor:"lightbox-counter-color"},Yv=[];function Zv(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 Jv(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Qv(e){const[t]=e.media;return t!=null&&t.url?t:null}function e0(e){if(!Array.isArray(e)||e.length===0)return[];if(Zv(e)){const t=[];for(const n of e){const i=Jv(n);if(!i)continue;const o=Qv(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 Ta(e){return e.type==="video"}function t0(e){e.pause(),e.removeAttribute("src"),e.load()}function Yo(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function n0(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const i0=1140/1440;function o0(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 r0(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 a0(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function s0({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()=>{t0(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 l0({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:s,onPrev:l,onNext:d,counterClassName:c,counterStyle:u,backgroundColor:p}){const w=i==="cover",v=a.useRef(null),T=a.useRef(null),g=a.useRef(null),$=a.useRef(0),f=a.useRef(0),R=a.useRef("none"),L=a.useRef(!1),I=a.useRef(!1),Y=a.useRef(!1),P=a.useRef(null),[V,M]=a.useState(null),[C,A]=a.useState("opening"),[y,S]=a.useState(0),[F,W]=a.useState(0),[U,G]=a.useState(!1),[J,D]=a.useState(!1),[j,O]=a.useState(!1),E=a.useRef(n),K=t[n],Z=K?Ta(K):!1,ce=F!==0||U,N=a.useCallback(fe=>{Y.current=fe,G(fe)},[]),pe=a.useCallback(()=>{P.current!==null&&(window.clearTimeout(P.current),P.current=null)},[]),b=a.useCallback(()=>{pe(),P.current=window.setTimeout(()=>{pe(),N(!1)},Rn+32)},[pe,N]),he=a.useCallback(()=>{const fe=v.current,ye=T.current;if(!fe)return;const Se=fe.getBoundingClientRect(),B=Se.width,ue=Se.height;if(!B||!ue)return;if(i==="cover"){M({width:B,height:ue,left:Se.left,top:Se.top});return}if(!ye){M(Yo(fe));return}const{width:ve,height:me}=n0(ye);if(!ve||!me){M(Yo(fe));return}const Ee=ve/me,be=B/ue;if(Ee>be){const k=B/Ee;M({width:B,height:k,left:Se.left,top:Se.top+(ue-k)/2})}else{const k=ue*Ee;M({width:k,height:ue,left:Se.left+(B-k)/2,top:Se.top})}},[i]);a.useEffect(()=>{he();const fe=v.current;if(!fe)return;const ye=new ResizeObserver(()=>he());return ye.observe(fe),()=>ye.disconnect()},[he,n]),a.useEffect(()=>{C==="opening"&&V&&A("open")},[C,V]),a.useEffect(()=>{if(C!=="closing")return;const fe=setTimeout(()=>s(),Rn);return()=>clearTimeout(fe)},[C,s]),a.useEffect(()=>()=>{pe()},[pe]),a.useLayoutEffect(()=>{if(E.current===n)return;pe(),S(0),W(0),N(!1),O(!1),D(!1),$.current=0,f.current=0,R.current="none",L.current=!1,g.current=null,I.current=!1;const fe=v.current;fe&&M(Yo(fe)),E.current=n},[n,N,pe]),a.useEffect(()=>{if(C!=="open")return;let fe=null;const ye=()=>{fe&&(document.removeEventListener("click",fe,!0),fe=null)},Se=()=>{ye(),fe=be=>{be.stopPropagation(),be.preventDefault(),ye()},document.addEventListener("click",fe,!0)},B=be=>{pe(),Y.current=!1,G(!1),W(0),D(!1),L.current=!1,f.current=0,R.current="none";const k=v.current;k&&M(Yo(k)),be<0?d():l()},ue=be=>{if(Math.abs(be)>Kv&&t.length>1){B(be);return}N(!0),W(0),b()},ve=be=>{if(be.touches.length!==1||Y.current)return;const k=be.touches[0];I.current=!0,g.current={x:k.clientX,y:k.clientY},R.current="none",f.current=0,L.current=!1},me=be=>{if(!g.current||be.touches.length!==1||Y.current)return;const k=be.touches[0],re=k.clientX-g.current.x,te=k.clientY-g.current.y;if(R.current==="none"){if(Math.abs(re)<10&&Math.abs(te)<10)return;if(Math.abs(re)>Math.abs(te)){if(t.length<=1)return;R.current="horizontal"}else if(te>0)R.current="vertical";else return}if(R.current==="horizontal"){L.current=!0,D(!0),f.current=re,W(re),be.preventDefault();return}R.current==="vertical"&&(L.current=!0,D(!0),$.current=te,S(te),be.preventDefault())},Ee=()=>{if(!g.current)return;const be=R.current,k=L.current;if(k&&be==="horizontal")ue(f.current),Se();else if(k&&be==="vertical")if($.current>Uv){const te=window.innerHeight;$.current=te,O(!0),S(te),A("closing")}else $.current=0,S(0),Se();else be==="horizontal"&&Math.abs(f.current)>0&&(ue(f.current),Se());g.current=null,R.current="none",f.current=0,L.current=!1,D(!1)};return document.addEventListener("touchstart",ve,{passive:!0}),document.addEventListener("touchmove",me,{passive:!1}),document.addEventListener("touchend",Ee),document.addEventListener("touchcancel",Ee),()=>{document.removeEventListener("touchstart",ve),document.removeEventListener("touchmove",me),document.removeEventListener("touchend",Ee),document.removeEventListener("touchcancel",Ee),ye()}},[C,t.length,d,l,N,b,pe]),a.useEffect(()=>{const fe=ye=>{ye.key==="Escape"&&(ye.preventDefault(),ye.stopPropagation(),C!=="closing"&&A("closing"))};return window.addEventListener("keydown",fe,!0),()=>window.removeEventListener("keydown",fe,!0)},[C]);const Q=()=>{C!=="closing"&&A("closing")},we=C==="open",Te=C==="closing",se=y>0?Math.max(0,1-y/500):1,oe=y>0?Math.max(.35,1-y/500):1,q=fe=>{if(fe.stopPropagation(),I.current){I.current=!1;return}if(t.length<=1)return;const ye=fe.currentTarget.getBoundingClientRect(),Se=fe.clientY-ye.top,B=Math.min(52,ye.height*.2);if(!(Se>ye.height-B)){if(fe.clientX-ye.left<ye.width/2){l();return}d()}},de=fe=>{if(t.length<=1)return;const ye=fe.currentTarget.getBoundingClientRect(),Se=fe.clientX-ye.left,B=fe.clientY-ye.top,ue=Math.min(52,ye.height*.2);if(B>ye.height-ue){fe.currentTarget.style.cursor="default";return}fe.currentTarget.style.cursor=Se<ye.width/2?"w-resize":"e-resize"},ge=a.useCallback(fe=>{fe.propertyName!=="transform"||!Y.current||(pe(),N(!1))},[pe,N]),_e=ce?`translateX(${F}px)`:y>0?`translateY(${y}px)`:void 0,Ce={position:"fixed",top:V==null?void 0:V.top,left:V==null?void 0:V.left,width:V==null?void 0:V.width,height:V==null?void 0:V.height,objectFit:i==="cover"?"cover":"contain",transform:_e,opacity:y>0?oe:C==="opening"||Te?0:1,transition:J&&!U?"none":U?`transform ${Rn}ms ${ci}`:j?`transform ${Rn}ms ${ci}, opacity ${Rn}ms ${ci}`:C==="opening"||Te?`opacity ${Rn}ms ${ci}`:"none",pointerEvents:Z&&we&&!ce?"auto":"none",touchAction:Z&&we?"none":void 0,zIndex:9998},Me=V?{position:"fixed",top:V.top,height:V.height,width:V.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:Q,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:we?se:0,transition:J?"none":`opacity ${Rn}ms ${ci}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:w?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:v,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:we?1:0,transition:`opacity ${Rn}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:v,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:we?1:0,transition:`opacity ${Rn}ms ${ci}`},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),V&&K&&(Z?r.jsx(s0,{src:K.url,phase:C,mediaRef:T,mediaStyle:Ce,onLoadedMetadata:he,onClick:q,onMouseMove:de,onTransitionEnd:ge},`${n}-${K.url}`):r.jsx("img",{ref:T,src:K.url,alt:K.name,onLoad:he,onTransitionEnd:ge,style:Ce},`${n}-${K.url}`)),we&&Me&&t.length>1&&!Z&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...Me,left:V.left,cursor:"w-resize",pointerEvents:ce?"none":"auto"},onClick:fe=>{if(I.current){I.current=!1;return}fe.stopPropagation(),l()}}),r.jsx("div",{style:{...Me,left:V.left+V.width/2,cursor:"e-resize",pointerEvents:ce?"none":"auto"},onClick:fe=>{if(I.current){I.current=!1;return}fe.stopPropagation(),d()}})]})]})}function wl({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 w=`${e}-gallery-${Ta(t)?"video":"image"}`,v=s.display==="cover",T=r0(s),g=C=>x.scalingValue(C,l??!1),$=n??Ca,f=o?{width:"100%",maxWidth:"100%"}:{width:g($),maxWidth:"100%"},R=i?{borderRadius:g(i)}:{},L={...f,...v?{aspectRatio:T,height:"auto",overflow:"hidden"}:{},...R},I={...v?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":g($)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...v?{}:R},P={className:w,style:I,onClick:p?C=>{C.stopPropagation(),p()}:void 0},V=Math.max(d,io),M=Ta(t)?r.jsx("video",{...P,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):r.jsx("img",{...P,src:t.url,alt:t.name??""});return r.jsxs("div",{className:`${e}-gallery-item`,children:[v?r.jsx("div",{style:L,children:M}):M,c&&d>0&&r.jsx("div",{className:`${e}-padding-handle`,style:{height:g(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:g(V)}})]})}function c0({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:s,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:d,showControls:c,scaled:u,children:p}){const w=t==="a"?i:t==="b"?o:0,v=w>0||c;return r.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="b"&&v&&r.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(w)},"aria-hidden":"true"}),c&&t==="b"&&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"&&v&&r.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(w)},"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 d0(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function la({P:e,title:t,position:n,titleRef:i,titleClassName:o,titleContainerStyle:s,titleTextBoxStyle:l,titleStyle:d,showTextBoxOutline:c=!1}){const u=a.useRef(null),[p,w]=a.useState(0),v=t??"";return a.useLayoutEffect(()=>{const T=u.current;if(!T||typeof ResizeObserver>"u")return;const g=()=>w(T.offsetHeight);g();const $=new ResizeObserver(g);return $.observe(T),()=>$.disconnect()},[v]),r.jsx("div",{ref:T=>{u.current=T,i(T)},className:[o,`${e}-title-position-${n}`].join(" "),style:{[`--${e}-title-height`]:`${p}px`,...s},children:r.jsx("div",{className:c?`${e}-title-text-inner`:`${e}-title-text-inner-hidden`,style:l,children:r.jsx("span",{className:`${e}-title-text`,style:d,children:v})})})}const Sl=45;function u0(e,t,n){if(t==="top"){const o=n&&parseFloat(getComputedStyle(n).top)||0;return Math.abs(e.top-o)}const i=e.top+e.height/2;return Math.abs(i-window.innerHeight/2)}function p0(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=u0(u,n,c);return Math.exp(-(p*p)/(2*Sl*Sl))});let o=0,s=-1;return i.forEach((l,d)=>{l>s&&(s=l,o=d)}),{opacities:i,dominantIndex:o}}function m0(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(p0(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 g0(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 h0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:s}){var Oe;const{prefix:l}=x.useScopedStyles(),d=a.useMemo(()=>Gv(l),[l]),c=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",w=(e==null?void 0:e.imgWidth)??Ca,v=(e==null?void 0:e.titleWidth)??i0,T=o0(e==null?void 0:e.imageDisplay),g=(e==null?void 0:e.cornerRadius)??Bv,$=(e==null?void 0:e.position)??"center",f=(e==null?void 0:e.titleTopPadding)??0,R=d0(e==null?void 0:e.transition),L=(e==null?void 0:e.lightbox)??"on",I=p==="c",Y=R==="fade"||R==="retype",{setTitleRef:P,dominantIndex:V}=m0(c.length,Y,$),M=((Oe=c[V])==null?void 0:Oe.title)??"",C=g0(M,R==="retype"),A=R==="fade"||R==="retype",y=R==="retype"?C:M,S=I?void 0:{width:x.scalingValue(w,n??!1)},F=L==="on"&&(!n||i||o),W=o??!1,U=(e==null?void 0:e.galleryPaddingRight)??0,G=(e==null?void 0:e.galleryPaddingLeft)??0,J=(e==null?void 0:e.galleryPaddingBetween)??0,D=je=>x.scalingValue(je,n??!1),O={width:D(v),maxWidth:"100%"},E=p==="a"?U:G,K=I?{}:{width:`calc(100% - ${D(w)} - ${D(E)})`,...p==="b"?{marginLeft:"auto"}:{}},Z=Math.max(U,io),ce=Math.max(G,io),N=Math.max(J,io),pe=Math.max(f,io),b=Math.max(0,(u??1)-(w??Ca)),he=I?{left:0,width:"100%"}:p==="a"?{right:D(U),width:D(w)}:{left:D(G),width:D(w)},{titleColor:Q,titleFontFamily:we,titleFontSettings:Te,titleFontSize:se,titleLineHeight:oe,titleLetterSpacing:q,titleWordSpacing:de,titleAlign:ge,titleTextAppearance:_e,lightboxCounterColor:Ce,lightboxCounterFontFamily:Me,lightboxCounterFontSettings:fe,lightboxCounterFontSize:ye,lightboxCounterLineHeight:Se,lightboxCounterLetterSpacing:B,lightboxCounterWordSpacing:ue,lightboxCounterTextAppearance:ve}=e??{},me={fontSettings:{fontFamily:we,fontWeight:(Te==null?void 0:Te.fontWeight)??400,fontStyle:(Te==null?void 0:Te.fontStyle)??"normal"},fontSize:se??.01,lineHeight:oe,letterSpacing:q??0,wordSpacing:de??0,textAlign:ge??"left",textAppearance:_e,color:Q??"#000000"},be=nn(zt(me,n)),k=O,re=bl(se,oe,l,n),te=xl(se,oe,`${l}-title`,`${l}-text-tight-leading`),z={fontSettings:{fontFamily:Me,fontWeight:(fe==null?void 0:fe.fontWeight)??400,fontStyle:(fe==null?void 0:fe.fontStyle)??"normal"},fontSize:ye??.01,lineHeight:Se,letterSpacing:B??0,wordSpacing:ue??0,textAppearance:ve,color:Ce??"#DEDDDD"},Re={...nn(zt(z,n)),...bl(ye,Se,l,n)},ae=xl(ye,Se,`${l}-lightbox-counter`,`${l}-text-tight-leading`),_=x.buildColorVars(l,{titleColor:Q??"#000000",lightboxCounterColor:Ce??"#DEDDDD"},Xv,Yv),Ne=a.useRef(null),[Fe,et]=a.useState(!1),[Ke,Ie]=a.useState([]),[ee,ne]=a.useState(0),He=a.useCallback((je,qe)=>{F&&(Ie(je),ne(qe),et(!0))},[F]),st=a.useCallback(()=>{et(!1)},[]),Be=a.useMemo(()=>{const je={..._},qe=Ne.current?getComputedStyle(Ne.current).getPropertyValue("--cntrl-article-width").trim():"";return qe&&(je["--cntrl-article-width"]=qe),je},[_,Fe]);return a.useEffect(()=>{if(!Fe||L!=="on"||typeof document>"u")return;const je=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=je}},[Fe,L]),a.useEffect(()=>{!n||o||i||et(!1)},[n,o,i]),a.useEffect(()=>{L==="off"&&et(!1)},[L]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),r.jsx("div",{style:_,children:r.jsxs("div",{ref:Ne,className:`${l}-wrapper`,style:{width:x.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:$==="top"?D(f):void 0},children:[W&&$==="top"&&r.jsx("div",{"data-controls":"titleTopPadding","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:D(pe)}}),A&&r.jsx("div",{className:`${l}-single-title-layer`,children:r.jsx(la,{P:l,title:y,position:$,titleRef:()=>{},titleClassName:`${te} ${l}-single-title`,titleContainerStyle:{...re,...K},titleTextBoxStyle:k,titleStyle:be,showTextBoxOutline:W})}),c.map((je,qe)=>{const tt=e0(je.gallery),mt=qe<c.length-1,St=tt.filter(pt=>pt.lightboxMedia).map(pt=>pt.lightboxMedia),lt={P:l,position:$,titleRef:P(qe),titleClassName:te,titleContainerStyle:re,titleTextBoxStyle:A?{maxWidth:"100%"}:k,titleStyle:be,showTextBoxOutline:W&&!A};return r.jsxs("div",{"data-item-index":qe,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:mt?D(J):void 0},children:[W&&mt&&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:D(N),...he}}),I?r.jsxs("div",{className:`${l}-gallery`,children:[r.jsx("div",{className:`${l}-gallery-media`,children:tt.map(({displayMedia:pt,lightboxMedia:Mt},nt)=>{const Ve=Mt?St.findIndex(De=>De.url===Mt.url):-1;return r.jsx(wl,{P:l,media:pt,imgWidth:w||void 0,cornerRadius:g||void 0,imageDisplay:T,isEditor:n,galleryPaddingBetween:J,showPaddingAfter:nt<tt.length-1,showControls:W,onMediaClick:F&&Ve>=0?()=>He(St,Ve):void 0},`${pt.url}-${nt}`)})}),r.jsx("div",{className:`${l}-title-layer`,children:r.jsx(la,{...lt,title:A?"":je.title})})]}):r.jsxs(r.Fragment,{children:[r.jsx(la,{...lt,title:A?"":je.title}),tt.length>0&&r.jsx(c0,{P:l,layoutType:p,galleryWidthStyle:S,galleryPaddingRight:U,galleryPaddingLeft:G,galleryPaddingRightWidth:Z,galleryPaddingLeftWidth:ce,galleryPaddingMaxFraction:b,showControls:W,scaled:D,children:tt.map(({displayMedia:pt,lightboxMedia:Mt},nt)=>{const Ve=Mt?St.findIndex(De=>De.url===Mt.url):-1;return r.jsx(wl,{P:l,media:pt,cornerRadius:g||void 0,fillGalleryWidth:!0,imageDisplay:T,isEditor:n,galleryPaddingBetween:J,showPaddingAfter:nt<tt.length-1,showControls:W,onMediaClick:F&&Ve>=0?()=>He(St,Ve):void 0},`${pt.url}-${nt}`)})})]})]},qe)})]})}),Fe&&L==="on"&&typeof document<"u"&&e&&(()=>{const je=(s?document.getElementById(s):null)??document.body;return Yn.createPortal(r.jsx("div",{style:Be,"data-selection":"none",children:r.jsx(l0,{prefix:l,items:Ke,index:ee,imageDisplay:a0(e.lightboxImageDisplay),isEditor:n,onClose:st,onPrev:()=>ne(qe=>(qe-1+Ke.length)%Ke.length),onNext:()=>ne(qe=>(qe+1)%Ke.length),counterClassName:ae,counterStyle:Re,backgroundColor:e.backgroundColor??qv})}),je)})()]})}const f0=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
19474
19487
|
import { createPortal } from 'react-dom';
|
|
19475
19488
|
import type React from 'react';
|
|
19476
19489
|
import { CommonComponentProps } from '../props';
|
|
@@ -19566,12 +19579,25 @@ function getCSS(P: string): string {
|
|
|
19566
19579
|
}
|
|
19567
19580
|
.\${P}-title-text {
|
|
19568
19581
|
display: block;
|
|
19569
|
-
width:
|
|
19582
|
+
width: 100%;
|
|
19570
19583
|
max-width: 100%;
|
|
19571
19584
|
white-space: pre-wrap;
|
|
19572
19585
|
overflow-wrap: anywhere;
|
|
19573
19586
|
word-break: break-word;
|
|
19574
19587
|
}
|
|
19588
|
+
.\${P}-title-text-inner {
|
|
19589
|
+
display: flex;
|
|
19590
|
+
flex-direction: column;
|
|
19591
|
+
box-sizing: border-box;
|
|
19592
|
+
min-width: 0;
|
|
19593
|
+
outline: 1px solid #FF5C02;
|
|
19594
|
+
}
|
|
19595
|
+
.\${P}-title-text-inner-hidden {
|
|
19596
|
+
display: flex;
|
|
19597
|
+
flex-direction: column;
|
|
19598
|
+
box-sizing: border-box;
|
|
19599
|
+
min-width: 0;
|
|
19600
|
+
}
|
|
19575
19601
|
.\${P}-title-position-left,
|
|
19576
19602
|
.\${P}-title-position-center,
|
|
19577
19603
|
.\${P}-title-position-right {
|
|
@@ -19715,6 +19741,12 @@ export type MercurySettings = {
|
|
|
19715
19741
|
wrapperWidth?: number;
|
|
19716
19742
|
type?: 'a' | 'b' | 'c';
|
|
19717
19743
|
imgWidth?: number;
|
|
19744
|
+
titleWidth?: number;
|
|
19745
|
+
imageDisplay?: {
|
|
19746
|
+
display: 'fit' | 'cover';
|
|
19747
|
+
ratioValue: '1:1' | '2:3' | '3:4' | '4:5' | '16:9';
|
|
19748
|
+
reversed: boolean;
|
|
19749
|
+
};
|
|
19718
19750
|
galleryPaddingRight?: number;
|
|
19719
19751
|
galleryPaddingLeft?: number;
|
|
19720
19752
|
galleryPaddingBetween?: number;
|
|
@@ -19722,7 +19754,7 @@ export type MercurySettings = {
|
|
|
19722
19754
|
imgCaption?: 'on' | 'off';
|
|
19723
19755
|
position?: 'left' | 'center' | 'right' | 'top';
|
|
19724
19756
|
titleTopPadding?: number;
|
|
19725
|
-
transition?: '
|
|
19757
|
+
transition?: 'fade' | 'retype' | 'scroll';
|
|
19726
19758
|
titleColor?: string;
|
|
19727
19759
|
titleFontFamily?: string;
|
|
19728
19760
|
titleFontSettings?: { fontWeight: number; fontStyle: string };
|
|
@@ -19858,6 +19890,36 @@ function getLightboxMediaDimensions(media: HTMLImageElement | HTMLVideoElement)
|
|
|
19858
19890
|
return { width: media.naturalWidth, height: media.naturalHeight };
|
|
19859
19891
|
}
|
|
19860
19892
|
|
|
19893
|
+
const DEFAULT_TITLE_WIDTH = 1140 / 1440;
|
|
19894
|
+
|
|
19895
|
+
function normalizeImageDisplay(
|
|
19896
|
+
raw: MercurySettings['imageDisplay'] | string | undefined,
|
|
19897
|
+
): NonNullable<MercurySettings['imageDisplay']> {
|
|
19898
|
+
if (typeof raw === 'string') {
|
|
19899
|
+
return {
|
|
19900
|
+
display: raw.toLowerCase() === 'cover' ? 'cover' : 'fit',
|
|
19901
|
+
ratioValue: '2:3',
|
|
19902
|
+
reversed: false,
|
|
19903
|
+
};
|
|
19904
|
+
}
|
|
19905
|
+
|
|
19906
|
+
const display = typeof raw?.display === 'string' ? raw.display.toLowerCase() : '';
|
|
19907
|
+
return {
|
|
19908
|
+
display: display === 'cover' ? 'cover' : 'fit',
|
|
19909
|
+
ratioValue: raw?.ratioValue ?? '2:3',
|
|
19910
|
+
reversed: raw?.reversed ?? false,
|
|
19911
|
+
};
|
|
19912
|
+
}
|
|
19913
|
+
|
|
19914
|
+
function getImageAspectRatio(imageDisplay: NonNullable<MercurySettings['imageDisplay']>): string {
|
|
19915
|
+
const ratioValue = imageDisplay.ratioValue ?? '1:1';
|
|
19916
|
+
const ratioReversed = imageDisplay.reversed ?? false;
|
|
19917
|
+
const [ratioWidth, ratioHeight] = ratioValue.split(':').map(Number);
|
|
19918
|
+
const effectiveWidth = ratioReversed ? ratioHeight : ratioWidth;
|
|
19919
|
+
const effectiveHeight = ratioReversed ? ratioWidth : ratioHeight;
|
|
19920
|
+
return \`\${effectiveWidth} / \${effectiveHeight}\`;
|
|
19921
|
+
}
|
|
19922
|
+
|
|
19861
19923
|
function resolveLightboxImageDisplay(
|
|
19862
19924
|
value: MercurySettings['lightboxImageDisplay'],
|
|
19863
19925
|
): 'fit' | 'cover' {
|
|
@@ -20475,6 +20537,7 @@ function GalleryMediaItem({
|
|
|
20475
20537
|
imgWidth,
|
|
20476
20538
|
cornerRadius,
|
|
20477
20539
|
fillGalleryWidth,
|
|
20540
|
+
imageDisplay,
|
|
20478
20541
|
isEditor,
|
|
20479
20542
|
galleryPaddingBetween = 0,
|
|
20480
20543
|
showPaddingAfter = false,
|
|
@@ -20486,6 +20549,7 @@ function GalleryMediaItem({
|
|
|
20486
20549
|
imgWidth?: number;
|
|
20487
20550
|
cornerRadius?: number;
|
|
20488
20551
|
fillGalleryWidth?: boolean;
|
|
20552
|
+
imageDisplay: NonNullable<MercurySettings['imageDisplay']>;
|
|
20489
20553
|
isEditor?: boolean;
|
|
20490
20554
|
galleryPaddingBetween?: number;
|
|
20491
20555
|
showPaddingAfter?: boolean;
|
|
@@ -20493,14 +20557,36 @@ function GalleryMediaItem({
|
|
|
20493
20557
|
onMediaClick?: () => void;
|
|
20494
20558
|
}) {
|
|
20495
20559
|
const mediaClassName = \`\${P}-gallery-\${isVideoMedia(media) ? 'video' : 'image'}\`;
|
|
20560
|
+
const isCover = imageDisplay.display === 'cover';
|
|
20561
|
+
const aspectRatio = getImageAspectRatio(imageDisplay);
|
|
20562
|
+
const scaled = (value: number) => scalingValue(value, isEditor ?? false);
|
|
20563
|
+
const resolvedImgWidth = imgWidth ?? DEFAULT_IMG_WIDTH;
|
|
20564
|
+
const widthStyle = fillGalleryWidth
|
|
20565
|
+
? { width: '100%', maxWidth: '100%' }
|
|
20566
|
+
: { width: scaled(resolvedImgWidth), maxWidth: '100%' };
|
|
20567
|
+
const radiusStyle = cornerRadius ? { borderRadius: scaled(cornerRadius) } : {};
|
|
20568
|
+
const wrapperStyle: React.CSSProperties = {
|
|
20569
|
+
...widthStyle,
|
|
20570
|
+
...(isCover ? { aspectRatio, height: 'auto', overflow: 'hidden' } : {}),
|
|
20571
|
+
...radiusStyle,
|
|
20572
|
+
};
|
|
20496
20573
|
const mediaStyle: React.CSSProperties = {
|
|
20497
|
-
...(
|
|
20498
|
-
? {
|
|
20499
|
-
|
|
20500
|
-
|
|
20501
|
-
|
|
20502
|
-
|
|
20574
|
+
...(isCover
|
|
20575
|
+
? {
|
|
20576
|
+
display: 'block',
|
|
20577
|
+
width: '100%',
|
|
20578
|
+
height: '100%',
|
|
20579
|
+
objectFit: 'cover',
|
|
20580
|
+
maxWidth: '100%',
|
|
20581
|
+
}
|
|
20582
|
+
: {
|
|
20583
|
+
display: 'block',
|
|
20584
|
+
maxWidth: '100%',
|
|
20585
|
+
height: 'auto',
|
|
20586
|
+
width: fillGalleryWidth ? '100%' : scaled(resolvedImgWidth),
|
|
20587
|
+
}),
|
|
20503
20588
|
...(onMediaClick ? { cursor: 'pointer', pointerEvents: 'auto' } : {}),
|
|
20589
|
+
...(isCover ? {} : radiusStyle),
|
|
20504
20590
|
};
|
|
20505
20591
|
|
|
20506
20592
|
const handleClick = onMediaClick
|
|
@@ -20516,7 +20602,6 @@ function GalleryMediaItem({
|
|
|
20516
20602
|
onClick: handleClick,
|
|
20517
20603
|
};
|
|
20518
20604
|
const galleryPaddingBetweenHeight = Math.max(galleryPaddingBetween, PADDING_HANDLE_SIZE);
|
|
20519
|
-
const scaled = (value: number) => scalingValue(value, isEditor ?? false);
|
|
20520
20605
|
|
|
20521
20606
|
const mediaNode = isVideoMedia(media) ? (
|
|
20522
20607
|
<video
|
|
@@ -20537,7 +20622,13 @@ function GalleryMediaItem({
|
|
|
20537
20622
|
|
|
20538
20623
|
return (
|
|
20539
20624
|
<div className={\`\${P}-gallery-item\`}>
|
|
20540
|
-
{
|
|
20625
|
+
{isCover ? (
|
|
20626
|
+
<div style={wrapperStyle}>
|
|
20627
|
+
{mediaNode}
|
|
20628
|
+
</div>
|
|
20629
|
+
) : (
|
|
20630
|
+
mediaNode
|
|
20631
|
+
)}
|
|
20541
20632
|
{showPaddingAfter && galleryPaddingBetween > 0 && (
|
|
20542
20633
|
<div
|
|
20543
20634
|
className={\`\${P}-padding-handle\`}
|
|
@@ -20659,26 +20750,41 @@ function GalleryWithEdgePadding({
|
|
|
20659
20750
|
|
|
20660
20751
|
type TitlePosition = 'left' | 'center' | 'right' | 'top';
|
|
20661
20752
|
|
|
20753
|
+
type MercuryTransition = 'fade' | 'retype' | 'scroll';
|
|
20754
|
+
|
|
20755
|
+
function resolveTransition(value?: string): MercuryTransition {
|
|
20756
|
+
switch (value) {
|
|
20757
|
+
case 'fade':
|
|
20758
|
+
case 'retype':
|
|
20759
|
+
case 'scroll':
|
|
20760
|
+
return value;
|
|
20761
|
+
case 'default':
|
|
20762
|
+
return 'scroll';
|
|
20763
|
+
default:
|
|
20764
|
+
return 'scroll';
|
|
20765
|
+
}
|
|
20766
|
+
}
|
|
20767
|
+
|
|
20662
20768
|
function StickyTitle({
|
|
20663
20769
|
P,
|
|
20664
20770
|
title,
|
|
20665
20771
|
position,
|
|
20666
|
-
transition,
|
|
20667
|
-
opacity,
|
|
20668
20772
|
titleRef,
|
|
20669
20773
|
titleClassName,
|
|
20670
20774
|
titleContainerStyle,
|
|
20775
|
+
titleTextBoxStyle,
|
|
20671
20776
|
titleStyle,
|
|
20777
|
+
showTextBoxOutline = false,
|
|
20672
20778
|
}: {
|
|
20673
20779
|
P: string;
|
|
20674
20780
|
title?: string;
|
|
20675
20781
|
position: TitlePosition;
|
|
20676
|
-
transition: 'default' | 'fade' | 'retype' | 'scroll';
|
|
20677
|
-
opacity: number;
|
|
20678
20782
|
titleRef: (element: HTMLDivElement | null) => void;
|
|
20679
20783
|
titleClassName: string;
|
|
20680
20784
|
titleContainerStyle: React.CSSProperties;
|
|
20785
|
+
titleTextBoxStyle: React.CSSProperties;
|
|
20681
20786
|
titleStyle: React.CSSProperties;
|
|
20787
|
+
showTextBoxOutline?: boolean;
|
|
20682
20788
|
}) {
|
|
20683
20789
|
const ref = useRef<HTMLDivElement | null>(null);
|
|
20684
20790
|
const [height, setHeight] = useState(0);
|
|
@@ -20696,10 +20802,6 @@ function StickyTitle({
|
|
|
20696
20802
|
return () => observer.disconnect();
|
|
20697
20803
|
}, [displayedTitle]);
|
|
20698
20804
|
|
|
20699
|
-
const resolvedOpacity = transition === 'fade'
|
|
20700
|
-
? opacity
|
|
20701
|
-
: 1;
|
|
20702
|
-
|
|
20703
20805
|
return (
|
|
20704
20806
|
<div
|
|
20705
20807
|
ref={(element) => {
|
|
@@ -20712,13 +20814,17 @@ function StickyTitle({
|
|
|
20712
20814
|
].join(' ')}
|
|
20713
20815
|
style={{
|
|
20714
20816
|
[\`--\${P}-title-height\`]: \`\${height}px\`,
|
|
20715
|
-
opacity: resolvedOpacity,
|
|
20716
20817
|
...titleContainerStyle,
|
|
20717
20818
|
} as React.CSSProperties}
|
|
20718
20819
|
>
|
|
20719
|
-
<
|
|
20720
|
-
{
|
|
20721
|
-
|
|
20820
|
+
<div
|
|
20821
|
+
className={showTextBoxOutline ? \`\${P}-title-text-inner\` : \`\${P}-title-text-inner-hidden\`}
|
|
20822
|
+
style={titleTextBoxStyle}
|
|
20823
|
+
>
|
|
20824
|
+
<span className={\`\${P}-title-text\`} style={titleStyle}>
|
|
20825
|
+
{displayedTitle}
|
|
20826
|
+
</span>
|
|
20827
|
+
</div>
|
|
20722
20828
|
</div>
|
|
20723
20829
|
);
|
|
20724
20830
|
}
|
|
@@ -20867,17 +20973,19 @@ export function Mercury({
|
|
|
20867
20973
|
const wrapperWidth = settings?.wrapperWidth ?? 1;
|
|
20868
20974
|
const layoutType = settings?.type ?? 'a';
|
|
20869
20975
|
const imgWidth = settings?.imgWidth ?? DEFAULT_IMG_WIDTH;
|
|
20976
|
+
const titleWidth = settings?.titleWidth ?? DEFAULT_TITLE_WIDTH;
|
|
20977
|
+
const imageDisplay = normalizeImageDisplay(settings?.imageDisplay);
|
|
20870
20978
|
const cornerRadius = settings?.cornerRadius ?? DEFAULT_CORNER_RADIUS;
|
|
20871
20979
|
const position = settings?.position ?? 'center';
|
|
20872
20980
|
const titleTopPadding = settings?.titleTopPadding ?? 0;
|
|
20873
|
-
const transition = settings?.transition
|
|
20981
|
+
const transition = resolveTransition(settings?.transition);
|
|
20874
20982
|
const lightbox = settings?.lightbox ?? 'on';
|
|
20875
20983
|
const isOverlayLayout = layoutType === 'c';
|
|
20876
|
-
const animateTransitions = transition
|
|
20877
|
-
const { setTitleRef,
|
|
20984
|
+
const animateTransitions = transition === 'fade' || transition === 'retype';
|
|
20985
|
+
const { setTitleRef, dominantIndex } = useTitleTransitionState(items.length, animateTransitions, position);
|
|
20878
20986
|
const activeTitle = items[dominantIndex]?.title ?? '';
|
|
20879
20987
|
const retypedTitle = useRetypedTitle(activeTitle, transition === 'retype');
|
|
20880
|
-
const usesSingleTitle = transition === '
|
|
20988
|
+
const usesSingleTitle = transition === 'fade' || transition === 'retype';
|
|
20881
20989
|
const singleTitle = transition === 'retype' ? retypedTitle : activeTitle;
|
|
20882
20990
|
const galleryWidthStyle = !isOverlayLayout
|
|
20883
20991
|
? { width: scalingValue(imgWidth, isEditor ?? false) }
|
|
@@ -20888,13 +20996,18 @@ export function Mercury({
|
|
|
20888
20996
|
const galleryPaddingLeft = settings?.galleryPaddingLeft ?? 0;
|
|
20889
20997
|
const galleryPaddingBetween = settings?.galleryPaddingBetween ?? 0;
|
|
20890
20998
|
const scaled = (value: number) => scalingValue(value, isEditor ?? false);
|
|
20891
|
-
const
|
|
20892
|
-
const
|
|
20893
|
-
|
|
20894
|
-
:
|
|
20895
|
-
|
|
20896
|
-
|
|
20897
|
-
|
|
20999
|
+
const titleWidthStyle = scaled(titleWidth);
|
|
21000
|
+
const titleTextWidthStyle: React.CSSProperties = {
|
|
21001
|
+
width: titleWidthStyle,
|
|
21002
|
+
maxWidth: '100%',
|
|
21003
|
+
};
|
|
21004
|
+
const singleTitleGalleryEdgePadding = layoutType === 'a' ? galleryPaddingRight : galleryPaddingLeft;
|
|
21005
|
+
const singleTitleLayoutStyle: React.CSSProperties = !isOverlayLayout
|
|
21006
|
+
? {
|
|
21007
|
+
width: \`calc(100% - \${scaled(imgWidth)} - \${scaled(singleTitleGalleryEdgePadding)})\`,
|
|
21008
|
+
...(layoutType === 'b' ? { marginLeft: 'auto' } : {}),
|
|
21009
|
+
}
|
|
21010
|
+
: {};
|
|
20898
21011
|
const galleryPaddingRightWidth = Math.max(galleryPaddingRight, PADDING_HANDLE_SIZE);
|
|
20899
21012
|
const galleryPaddingLeftWidth = Math.max(galleryPaddingLeft, PADDING_HANDLE_SIZE);
|
|
20900
21013
|
const galleryPaddingBetweenHeight = Math.max(galleryPaddingBetween, PADDING_HANDLE_SIZE);
|
|
@@ -20942,6 +21055,7 @@ export function Mercury({
|
|
|
20942
21055
|
};
|
|
20943
21056
|
const titleTypographyCss = omitTextColors(textStylesToCss(resolvedTitleTextStyle, isEditor));
|
|
20944
21057
|
const titleStyle = titleTypographyCss;
|
|
21058
|
+
const titleTextBoxStyle = titleTextWidthStyle;
|
|
20945
21059
|
const titleContainerStyle = getTextLeadingVars(titleFontSize, titleLineHeight, P, isEditor);
|
|
20946
21060
|
const titleClassName = getTextClassName(
|
|
20947
21061
|
titleFontSize,
|
|
@@ -21063,15 +21177,15 @@ export function Mercury({
|
|
|
21063
21177
|
P={P}
|
|
21064
21178
|
title={singleTitle}
|
|
21065
21179
|
position={position}
|
|
21066
|
-
transition={transition}
|
|
21067
|
-
opacity={1}
|
|
21068
21180
|
titleRef={() => {}}
|
|
21069
21181
|
titleClassName={\`\${titleClassName} \${P}-single-title\`}
|
|
21070
21182
|
titleContainerStyle={{
|
|
21071
21183
|
...titleContainerStyle,
|
|
21072
|
-
...
|
|
21184
|
+
...singleTitleLayoutStyle,
|
|
21073
21185
|
}}
|
|
21186
|
+
titleTextBoxStyle={titleTextBoxStyle}
|
|
21074
21187
|
titleStyle={titleStyle}
|
|
21188
|
+
showTextBoxOutline={showControls}
|
|
21075
21189
|
/>
|
|
21076
21190
|
</div>
|
|
21077
21191
|
)}
|
|
@@ -21084,12 +21198,12 @@ export function Mercury({
|
|
|
21084
21198
|
const titleProps = {
|
|
21085
21199
|
P,
|
|
21086
21200
|
position,
|
|
21087
|
-
transition,
|
|
21088
|
-
opacity: opacities[index] ?? 0,
|
|
21089
21201
|
titleRef: setTitleRef(index),
|
|
21090
21202
|
titleClassName,
|
|
21091
21203
|
titleContainerStyle,
|
|
21204
|
+
titleTextBoxStyle: usesSingleTitle ? { maxWidth: '100%' } : titleTextBoxStyle,
|
|
21092
21205
|
titleStyle,
|
|
21206
|
+
showTextBoxOutline: showControls && !usesSingleTitle,
|
|
21093
21207
|
};
|
|
21094
21208
|
|
|
21095
21209
|
return (
|
|
@@ -21131,6 +21245,7 @@ export function Mercury({
|
|
|
21131
21245
|
media={displayMedia}
|
|
21132
21246
|
imgWidth={imgWidth || undefined}
|
|
21133
21247
|
cornerRadius={cornerRadius || undefined}
|
|
21248
|
+
imageDisplay={imageDisplay}
|
|
21134
21249
|
isEditor={isEditor}
|
|
21135
21250
|
galleryPaddingBetween={galleryPaddingBetween}
|
|
21136
21251
|
showPaddingAfter={mediaIndex < displayItems.length - 1}
|
|
@@ -21179,6 +21294,7 @@ export function Mercury({
|
|
|
21179
21294
|
media={displayMedia}
|
|
21180
21295
|
cornerRadius={cornerRadius || undefined}
|
|
21181
21296
|
fillGalleryWidth
|
|
21297
|
+
imageDisplay={imageDisplay}
|
|
21182
21298
|
isEditor={isEditor}
|
|
21183
21299
|
galleryPaddingBetween={galleryPaddingBetween}
|
|
21184
21300
|
showPaddingAfter={mediaIndex < displayItems.length - 1}
|
|
@@ -21222,4 +21338,4 @@ export function Mercury({
|
|
|
21222
21338
|
</>
|
|
21223
21339
|
);
|
|
21224
21340
|
}
|
|
21225
|
-
`;function Zo(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const ca={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}}},
|
|
21341
|
+
`;function Zo(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const ca={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}}},y0={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"}},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"]}}}}}}}},required:["gallery"]},default:[{title:"Earth-orbital mission",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title:"Salton Sea from Above",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title:"Lunar Module Pilot",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{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-8.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title:"Command Module",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-9.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"}]}]}]},settings:{sizing:"auto auto",properties:{wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},imgWidth:{type:"number",scope:"layout",title:"Img width",display:{type:"numeric-input"},min:0,max:9999},titleWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},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"}}},galleryPaddingRight:Zo("Gallery Padding Right"),galleryPaddingLeft:Zo("Gallery Padding Left"),galleryPaddingBetween:Zo("Gallery Padding Between"),cornerRadius:{type:"number",scope:"layout",title:"Corner radius",display:{type:"numeric-input"},min:0,max:9999},imgCaption:{type:"boolean",scope:"common",title:"Img caption",display:{type:"toggle-cycle",enum:["on","off"]}},position:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right","top"]}},titleTopPadding:Zo("Title Top Padding"),transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["fade","retype","scroll"]}},titleColor:{type:"string",scope:"common",title:"Title",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...ca.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"}},titleAlign:{...ca.textAlign,scope:"layout",title:"Align"},titleTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},lightboxImageDisplay:{type:"string",scope:"common",title:"Display",display:{type:"toggle-cycle",enum:["fit","cover"]}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",display:{type:"settings-color-picker"}},lightboxCounterColor:{type:"string",scope:"common",title:"Counter Lightbox",display:{type:"palette-color-picker"}},lightboxCounterFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},lightboxCounterFontSettings:{...ca.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:{type:"a",imgCaption:"on",position:"center",transition:"scroll",titleColor:"#000000",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleAlign:"left",titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},lightbox:"on",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",backgroundColor:"rgba(28,31,34,0.9)",lightboxCounterColor:"#DEDDDD",lightboxCounterFontFamily:"Goudy Bookletter 1911",lightboxCounterFontSettings:{fontWeight:400,fontStyle:"normal"},lightboxCounterLetterSpacing:0,lightboxCounterWordSpacing:0,lightboxCounterTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{d:{wrapperWidth:1,imgWidth:300/1440,titleWidth:400/1440,galleryPaddingRight:0,galleryPaddingLeft:0,galleryPaddingBetween:0,titleTopPadding:0,cornerRadius:8/1440,titleFontSize:.027,titleLineHeight:.0222,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01},m:{wrapperWidth:1,imgWidth:120/375,titleWidth:220/375,galleryPaddingRight:0,galleryPaddingLeft:0,galleryPaddingBetween:0,titleTopPadding:0,cornerRadius:8/375,titleFontSize:.1066,titleLineHeight:.0853,lightboxCounterFontSize:.0373,lightboxCounterLineHeight:.0373},t:{wrapperWidth:1,imgWidth:300/768,titleWidth:260/768,galleryPaddingRight:0,galleryPaddingLeft:0,galleryPaddingBetween:0,titleTopPadding:0,cornerRadius:8/768,titleFontSize:.03255,titleLineHeight:.03255,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01}},displayRules:[{if:{name:"lightbox",value:"off"},then:{name:"properties.lightboxImageDisplay.display.enabled",value:!1}}],layout:["__componentName__","type","wrapperWidth","imgWidth","titleWidth","imageDisplay","cornerRadius","imgCaption","position","transition","lightbox","lightboxImageDisplay"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",items:["wrapperWidth","imgWidth"]},{type:"row",items:["cornerRadius","imgCaption"]},{type:"row",items:["imageDisplay"]},{type:"row",title:"Title",items:["position","transition"]},"titleWidth",{type:"row",title:"Lightbox",items:["lightbox","lightboxImageDisplay"]},{type:"row",items:["backgroundColor"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleAlign","titleTextAppearance"]},{type:"group",title:"Lightbox Counter",items:["lightboxCounterFontFamily","lightboxCounterFontSettings",{type:"row",items:["lightboxCounterFontSize","lightboxCounterLineHeight","lightboxCounterLetterSpacing","lightboxCounterWordSpacing"]},"lightboxCounterTextAppearance"]}]}],paletteBookmark:{items:["titleColor","backgroundColor","lightboxCounterColor"],panelIds:["general","typeStyle"]}},v0={element:h0,id:"mercury",name:"Mercury",category:"lists",layoutMode:"structured",version:1,defaultSize:{d:{width:720,height:540}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Mercury.mp4"},schema:y0,sourceCode:f0,assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"}},x0=[Uu,ep,yy,qp,tm,um,Mm,Nm,Vm,ug,oh,af,hf,Zf,ly,Ey,Tv,Dy,zv,v0];exports.components=x0;exports.isSchemaV1=Hc;
|